Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uscreentv/v-color

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uscreentv/v-color - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

2

dist/index.esm.js

@@ -1,1 +0,1 @@

import t from"lodash/clamp";import e from"lodash/debounce";import a from"lodash/isEqual";import n from"lodash/throttle";var r=function(t,e,a,n,r,i,s,o){if(!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[a,n,r,i,s,o],c=0;(l=new Error(e.replace(/%s/g,(function(){return d[c++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}},i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function l(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var d=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},a=0;a<10;a++)e["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var a,n,r=l(t),d=1;d<arguments.length;d++){for(var c in a=Object(arguments[d]))s.call(a,c)&&(r[c]=a[c]);if(i){n=i(a);for(var u=0;u<n.length;u++)o.call(a,n[u])&&(r[n[u]]=a[n[u]])}}return r},c=/-?\d+(\.\d+)?%?/g;var u=function(t){return t.match(c)};var h=function(t,e,a){return Math.min(Math.max(t,e),a)};function p(t,e){switch(t=parseFloat(t),e){case 0:return h(t,0,360);case 1:case 2:return h(t,0,100);case 3:return h(t,0,1)}}var f=function(t){return u(t).map(p)};var g=function(t){4!==t.length&&5!==t.length||(t=function(t){for(var e="#",a=1;a<t.length;a++){var n=t.charAt(a);e+=n+n}return e}(t));var e=[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16)];if(9===t.length){var a=parseFloat((parseInt(t.substring(7,9),16)/255).toFixed(2));e.push(a)}return e};function m(t,e){return e<3?-1!=t.indexOf("%")?Math.round(255*h(parseInt(t,10),0,100)/100):h(parseInt(t,10),0,255):h(parseFloat(t),0,1)}var v=function(t){return u(t).map(m)};var b=function(t){var e,a,n,r,i,s=t[0]/360,o=t[1]/100,l=t[2]/100;if(0==o)return[i=255*l,i,i];e=2*l-(a=l<.5?l*(1+o):l+o-l*o),r=[0,0,0];for(var d=0;d<3;d++)(n=s+1/3*-(d-1))<0&&n++,n>1&&n--,i=6*n<1?e+6*(a-e)*n:2*n<1?a:3*n<2?e+(a-e)*(2/3-n)*6:e,r[d]=255*i;return r};var x={"#":g,hsl:function(t){var e=f(t),a=b(e);return 4===e.length&&a.push(e[3]),a},rgb:v};function y(t){for(var e in x)if(0===t.indexOf(e))return x[e](t)}y.rgb=v,y.hsl=f,y.hex=g;var C=y;var w=function(t){var e,a,n=t[0],r=t[1],i=t[2],s=Math.min(n,r,i),o=Math.max(n,r,i),l=o-s;return a=0==o?0:l/o*1e3/10,o==s?e=0:n==o?e=(r-i)/l:r==o?e=2+(i-n)/l:i==o&&(e=4+(n-r)/l),(e=Math.min(60*e,360))<0&&(e+=360),[e,a,o/255*1e3/10]};function k(t){var e=Math.round(h(t,0,255)).toString(16);return 1==e.length?"0"+e:e}var O=function(t){var e=4===t.length?k(255*t[3]):"";return"#"+k(t[0])+k(t[1])+k(t[2])+e};var _=function(t){var e,a,n=t[0],r=t[1]/100,i=t[2]/100;return e=r*i,[n,100*(e=(e/=(a=(2-r)*i)<=1?a:2-a)||0),100*(a/=2)]};var A=function(t){var e=t[0]/60,a=t[1]/100,n=t[2]/100,r=Math.floor(e)%6,i=e-Math.floor(e),s=255*n*(1-a),o=255*n*(1-a*i),l=255*n*(1-a*(1-i));switch(n*=255,r){case 0:return[n,l,s];case 1:return[o,n,s];case 2:return[s,n,l];case 3:return[s,o,n];case 4:return[l,s,n];case 5:return[n,s,o]}},M={name:"v-ctrl",abstract:!0,props:{direction:{type:String,default:"h",validator:function(t){return["v","h","vh","hv"].indexOf(t)>-1}},throttle:{type:Number,default:80},precision:{type:Number}},methods:{msdown:function(t){t.preventDefault(),document.addEventListener("mousemove",this.msmove),document.addEventListener("mouseup",this.msup),this.next(t)},msmove:function(t){t.preventDefault(),this.next(t)},msup:function(t){this.next(t),document.removeEventListener("mousemove",this.msmove),document.removeEventListener("mouseup",this.msup)},notify:function(t){!1===a(this.memo,t)&&(this.memo=t,this.$emit("change",t))},next:function(t){void 0===t&&(t={});var e=t.clientX;void 0===e&&(e=0);var a=t.clientY;void 0===a&&(a=0);var n=this.direction,r=this.adjust,i=this.$el.getBoundingClientRect(),s=r((e-i.left)/i.width);if("h"===n)return this.notify(s);var o=r((a-i.top)/i.height);if("v"===n)return this.notify(o);this.notify([s,o])},adjust:function(e){return function(t,e){var a=0|e;return a>0?parseFloat(t.toFixed(a)):t}(t(e,0,1),this.precision)}},render:function(t){return this.$slots.default[0]},created:function(){var t=this.msdown,e=this.msmove;this.msdown=t.bind(this),this.msmove=n(e.bind(this),this.throttle),this.memo=null},mounted:function(){this.$el.addEventListener("mousedown",this.msdown)},destroyed:function(){this.$el.removeEventListener("mousedown",this.msdown)},install:function(){Vue.component(M.name,M)}};"undefined"!=typeof window&&window.Vue&&Vue.use(M);var S={VueCtrlComponent:M};const I=Object.freeze({rgba:["r","g","b","a"],hsla:["h","s","l","a"],hex:["hex"]});function T(t,e=3){return(100*t).toPrecision(0|e)+"%"}function E(t){return t.replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3([0-9a-f]?)\4$/,"#$1$2$3$4")}var P={name:"VColorPicker",props:{value:{type:String,default:"#ff0000"},withSuggestions:{type:Boolean,default:!0}},components:{"v-ctrl":S.VueCtrlComponent},data(){const{value:t}=this,e={type:"number",maxlength:3},a={type:"string",maxlength:4};return{...this.digestProp(t),suggestions:[],currentMode:(n=t,"#"===n[0]?"hex":0===n.indexOf("rgb")?"rgba":0===n.indexOf("hsl")?"hsla":void r(!1,n+" is not valid color value!")),colorModes:I,colorModel:{hex:"",r:"",g:"",b:"",h:"",s:"",l:"",a:""},constrains:{r:e,g:e,b:e,h:e,s:a,l:a,a:{type:"number",maxlength:4},hex:{type:"string",maxlength:9}}};var n},watch:{value:{immediate:!0,handler(t,e){t!==e&&d(this,this.digestProp(t))}}},computed:{hsva(){const{hue:t,alpha:e,saturation:{x:a,y:n}}=this;return[360*t,100*a,100*(1-n),e]},rgba(){const{alpha:t,hsva:e}=this,[a,n,r]=A(e);return[Math.round(a),Math.round(n),Math.round(r),t]},hsla(){const{alpha:t,hsva:e}=this,[a,n,r]=_(e);return[Math.round(a),Math.round(n)+"%",Math.round(r)+"%",t]},hex(){return O(this.rgba)},previewBorderColor(){const[t,e,a]=this.rgba;return(t+e+a)/3>235?"rgba(160,160,160,0.8)":"transparent"},styles(){const{rgba:t,alpha:e,hue:a,saturation:n}=this,r=t.slice(0,3).join(", "),i=b([360*a,100,50]).map((t=>Math.round(t))).join(", ");return{preview:{backgroundColor:`rgba(${t.join(", ")})`,borderColor:this.previewBorderColor},saturationPane:{backgroundColor:`rgb(${i})`},saturationThumb:{left:T(n.x),top:T(n.y)},alphaTrack:{backgroundImage:`linear-gradient(to right, rgba(${r}, 0) 0%, rgb(${r}) 100%)`},alphaThumb:{left:T(e)},hueThumb:{left:T(1-a)}}}},methods:{digestProp(t){const e=C(t),a=null==e[3]?1:e[3],[n,r,i]=w(e);return{alpha:parseFloat(a.toFixed(2)),hue:n/360,saturation:{x:r/100,y:1-i/100}}},onSaturationChange([t,e]){this.saturation={x:t,y:e},this.emitChange()},onHueChange(t){this.hue=1-t,this.emitChange()},onAlphaChange(t){this.alpha=parseFloat(t.toFixed(2)),this.emitChange()},emitChange(){const{hex:t,rgba:e,hsla:a,currentMode:n}=this;if(this.updateColorModel(),"hex"===n)this.updateSuggestions(t),this.$emit("input",t);else if("hsla"===n){const t=`hsla(${a.join(",")})`;this.updateSuggestions(t),this.$emit("input",t)}else if("rgba"===n){const t=`rgba(${e.join(",")})`;this.updateSuggestions(t),this.$emit("input",t)}},onClickColor(t){this.$emit("input",t,!0)},handleInput(e,a){const{currentMode:n,colorModel:r}=this,{target:{value:i}}=a;let s=Number(i),o=!1;switch(e){case"a":r[e]===s||isNaN(s)||(r[e]=t(s,0,1),o=!0);break;case"r":case"g":case"b":r[e]===s||isNaN(s)||(r[e]=0|t(s,0,255),o=!0);break;case"h":r[e]===s||isNaN(s)||(r[e]=0|t(s,0,360),o=!0);break;case"s":case"l":"%"===i.slice(-1)&&r[e]!==i&&(s=parseFloat(i),r[e]=(0|t(s,0,360))+"%",o=!0);break;case"hex":"#"===i[0]&&r[e]!==i&&C(i).every((t=>!isNaN(t)))&&(r[e]=E(i),o=!0)}if(!o)return;const{h:l,s:c,l:u,r:h,g:p,b:f,a:g,hex:m}=r;let v=m;"rgba"===n?v=`rgba(${[h,p,f,g]})`:"hsla"===n&&(v=`hsla(${[l,c,u,g]})`),d(this,this.digestProp(v)),this.emitChange()},updateColorModel(){const{hsla:t,rgba:e,hex:a,alpha:n}=this,[r,i,s]=t,[o,l,c]=e,u=E(1===n?a.slice(0,7):a);d(this.colorModel,{r:o,g:l,b:c,h:r,s:i,l:s,a:n,hex:u})},loadSuggestions(){const t=localStorage.getItem("V_COLOR_PICKER_SUGGESTIONS");if(!t)return[];this.suggestions=JSON.parse(t)},updateSuggestions(t){if(this.suggestions.includes(t))return;let e;e=this.suggestions.length<7?this.suggestions.concat(t):this.suggestions.slice(1,7).concat(t),this.suggestions=e,localStorage.setItem("V_COLOR_PICKER_SUGGESTIONS",JSON.stringify(e))}},created(){this.handleInput=e(this.handleInput.bind(this),250),this.emitChange=e(this.emitChange.bind(this),250),this.updateColorModel(),this.loadSuggestions()}};function N(t,e,a,n,r,i,s,o,l,d){"boolean"!=typeof s&&(l=o,o=s,s=!1);const c="function"==typeof a?a.options:a;let u;if(t&&t.render&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),n&&(c._scopeId=n),i?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},c._ssrRegister=u):e&&(u=s?function(t){e.call(this,d(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,o(t))}),u)if(c.functional){const t=c.render;c.render=function(e,a){return u.call(a),t(e,a)}}else{const t=c.beforeCreate;c.beforeCreate=t?[].concat(t,u):[u]}return a}const j="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function $(t){return(t,e)=>function(t,e){const a=j?e.media||"default":t,n=R[a]||(R[a]={ids:new Set,styles:[]});if(!n.ids.has(t)){n.ids.add(t);let a=e.source;if(e.map&&(a+="\n/*# sourceURL="+e.map.sources[0]+" */",a+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),n.element||(n.element=document.createElement("style"),n.element.type="text/css",e.media&&n.element.setAttribute("media",e.media),void 0===V&&(V=document.head||document.getElementsByTagName("head")[0]),V.appendChild(n.element)),"styleSheet"in n.element)n.styles.push(a),n.element.styleSheet.cssText=n.styles.filter(Boolean).join("\n");else{const t=n.ids.size-1,e=document.createTextNode(a),r=n.element.childNodes;r[t]&&n.element.removeChild(r[t]),r.length?n.element.insertBefore(e,r[t]):n.element.appendChild(e)}}}(t,e)}let V;const R={};const B=N({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"wrapper"},[a("v-ctrl",{attrs:{direction:"vh",precision:2,throttle:80},on:{change:t.onSaturationChange}},[a("div",{staticClass:"saturation"},[a("div",{staticClass:"mask hue",style:t.styles.saturationPane}),t._v(" "),a("div",{staticClass:"mask white"}),t._v(" "),a("div",{staticClass:"mask black"}),t._v(" "),a("p",{staticClass:"thumb",style:t.styles.saturationThumb})])]),t._v(" "),a("section",{staticClass:"controls"},[a("section",{staticClass:"sliders"},[a("v-ctrl",{attrs:{direction:"h",precision:2,throttle:80},on:{change:t.onHueChange}},[a("div",{staticClass:"slider bar hue"},[a("div",{staticClass:"thumb",style:t.styles.hueThumb})])]),t._v(" "),a("v-ctrl",{attrs:{direction:"h",precision:2,throttle:80},on:{change:t.onAlphaChange}},[a("div",{staticClass:"slider alpha"},[a("div",{staticClass:"thumb",style:t.styles.alphaThumb}),t._v(" "),a("div",{staticClass:"bar",style:t.styles.alphaTrack})])])],1),t._v(" "),a("section",{staticClass:"modes"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.currentMode,expression:"currentMode"}],staticClass:"mode-input select",on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.currentMode=e.target.multiple?a:a[0]}}},t._l(t.colorModes,(function(e,n){return a("option",{key:n,domProps:{value:n}},[t._v("\n "+t._s(n)+"\n ")])})),0),t._v(" "),t._l(t.colorModes[t.currentMode],(function(e){return a("input",{key:e,staticClass:"mode-input",attrs:{type:t.constrains[e].type,maxlength:t.constrains[e].maxlength},domProps:{value:t.colorModel[e]},on:{input:function(a){return t.handleInput(e,a)}}})}))],2)]),t._v(" "),t.withSuggestions&&t.suggestions.length>0?a("section",{staticClass:"suggestions"},[a("p",[t._v("Previously used colors")]),t._v(" "),a("ul",t._l(t.suggestions,(function(e){return a("li",{key:e},[a("button",{staticClass:"suggestion",style:{backgroundColor:e},attrs:{type:"button"},on:{click:function(a){return t.onClickColor(e)}}})])})),0)]):t._e()],1)},staticRenderFns:[]},(function(t){t&&t("data-v-8fc876ba_0",{source:".wrapper[data-v-8fc876ba]{width:260px;margin:0;background:#fff;border-radius:2px;box-shadow:0 0 2px rgba(0,0,0,.3),0 4px 8px rgba(0,0,0,.3);user-select:none}.slider[data-v-8fc876ba]{position:relative;margin-bottom:16px}.slider.hue[data-v-8fc876ba]{background:linear-gradient(-90deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.slider.alpha[data-v-8fc876ba]{margin-top:8px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==) left center}.bar[data-v-8fc876ba]{height:8px;border-radius:4px}.controls[data-v-8fc876ba]{padding:20px 16px;padding-bottom:16px}.modes[data-v-8fc876ba]{display:flex;align-items:center}.mode-input[data-v-8fc876ba]{width:100%;appearance:none;-webkit-appearance:none;font-size:12px;line-height:1.5;text-align:center;text-transform:uppercase;border:none;padding:0;font-family:Inter,Helvetica,Arial,sans-serif;color:#1a202c}.mode-input.select[data-v-8fc876ba]{flex:0 0 42px;margin-right:10px;background-repeat:no-repeat;background-size:6px;background-position:center right;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI2IiB2aWV3Qm94PSIwIDAgOCA2IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMSAxLjQ3MzM5TDQgNC41MjY2Nkw3IDEuNDczMzkiIHN0cm9rZT0iIzlFQjVDOCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=)}.thumb[data-v-8fc876ba]{position:absolute;width:12px;height:12px;top:0;border-radius:50%;margin-top:-1px;transform:translateX(-50%);background-color:#f8f8f8;box-shadow:0 1px 4px 0 rgba(0,0,0,.368627);cursor:default}.saturation[data-v-8fc876ba]{position:relative;width:100%;padding-bottom:55%;overflow:hidden}.saturation>div[data-v-8fc876ba]{position:absolute;top:0;left:0;right:0;bottom:0;margin:0}.saturation>.thumb[data-v-8fc876ba]{background-color:transparent;transform:translate(-50%,-50%);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4)}.mask.white[data-v-8fc876ba]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.mask.black[data-v-8fc876ba]{background:linear-gradient(0deg,#000,transparent)}.suggestions[data-v-8fc876ba]{border-top:1px solid #e2e8f0;padding:20px 16px;padding-top:16px}.suggestions p[data-v-8fc876ba]{margin-top:0;margin-bottom:10px;font-family:Inter,Helvetica,Arial,sans-serif;font-size:12px;line-height:1.5;color:#1a202c}.suggestions ul[data-v-8fc876ba]{display:flex;align-items:center;margin:0;padding:0;list-style:none}.suggestion[data-v-8fc876ba]{width:24px;height:24px;margin:4px;border:1px solid #e2e8f0;border-radius:50%}",map:void 0,media:void 0})}),P,"data-v-8fc876ba",false,undefined,!1,$,void 0,void 0),L={BOTTOM:"bottom",LEFT:"left",RIGHT:"right",TOP:"top"};const F=N({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{ref:"root",staticClass:"popover"},[a("button",{staticClass:"trigger",attrs:{type:"button"},on:{click:t.onToggle}},[a("span",{staticClass:"preview",style:{"background-color":t.value}})]),t._v(" "),a("transition",{attrs:{name:t.currentTransitionName}},[t.isVisible?a("div",{staticClass:"frame",class:t.framePositionClass},[a("color-picker",{attrs:{value:t.value,"with-suggestions":t.withSuggestions},on:{input:t.onInput}})],1):t._e()])],1)},staticRenderFns:[]},(function(t){t&&t("data-v-0f94a0a0_0",{source:".popover[data-v-0f94a0a0]{position:relative}.trigger[data-v-0f94a0a0]{flex:0 0 auto;display:flex;align-items:center;padding:0;background:0 0;border:none;cursor:pointer}.preview[data-v-0f94a0a0]{flex:1 1 auto;display:inline-block;vertical-align:middle;width:32px;height:32px;border:1px solid #e2e8f0;border-radius:50%}.frame[data-v-0f94a0a0]{position:absolute;z-index:10}.frame.bottom[data-v-0f94a0a0]{left:0;top:calc(100% + 12px)}.frame.top[data-v-0f94a0a0]{left:0;bottom:calc(100% + 12px)}.frame.left[data-v-0f94a0a0]{right:calc(100% + 12px);top:50%;transform:translateY(-50%)}.frame.right[data-v-0f94a0a0]{left:calc(100% + 12px);top:50%;transform:translateY(-50%)}.slide-down-enter-active[data-v-0f94a0a0]{animation:slideDown-data-v-0f94a0a0 .25s}.slide-down-leave-to[data-v-0f94a0a0]{animation:slideDown-data-v-0f94a0a0 .25s reverse}@keyframes slideDown-data-v-0f94a0a0{from{transform:translateY(15px);opacity:0}}.slide-up-enter-active[data-v-0f94a0a0]{animation:slideUp-data-v-0f94a0a0 .25s}.slide-up-leave-to[data-v-0f94a0a0]{animation:slideUp-data-v-0f94a0a0 .25s reverse}@keyframes slideUp-data-v-0f94a0a0{from{transform:translateY(-15px);opacity:0}}.slide-left-enter-active[data-v-0f94a0a0]{animation:slideLeft-data-v-0f94a0a0 .25s}.slide-left-leave-to[data-v-0f94a0a0]{animation:slideLeft-data-v-0f94a0a0 .25s reverse}@keyframes slideLeft-data-v-0f94a0a0{from{transform:translateX(-15px) translateY(-50%);opacity:0}}.slide-right-enter-active[data-v-0f94a0a0]{animation:slideRight-data-v-0f94a0a0 .25s}.slide-right-leave-to[data-v-0f94a0a0]{animation:slideRight-data-v-0f94a0a0 .25s reverse}@keyframes slideRight-data-v-0f94a0a0{from{transform:translateX(15px) translateY(-50%);opacity:0}}",map:void 0,media:void 0})}),{name:"VColorPopover",components:{ColorPicker:B},props:{value:{type:String,default:"#ff0000"},withSuggestions:{type:Boolean,default:!0},position:{type:String,default:L.BOTTOM,validator:t=>Object.values(L).includes(t)}},data:()=>({isVisible:!1}),computed:{currentTransitionName(){switch(this.position){case L.BOTTOM:return"slide-down";case L.LEFT:return"slide-left";case L.RIGHT:return"slide-right";case L.TOP:return"slide-up"}},framePositionClass(){switch(this.position){case L.BOTTOM:return"bottom";case L.LEFT:return"left";case L.RIGHT:return"right";case L.TOP:return"top"}}},watch:{isVisible(t){t?document.body.addEventListener("click",this.onClickOutside):document.body.removeEventListener("click",this.onClickOutside)}},created(){window.addEventListener("keypress",this.onKeydown)},beforeDestroy(){window.removeEventListener("keypress",this.onKeydown)},methods:{getElementPath(t){const e=[];let a=t;for(;a!==document.body;)e.unshift(a),a=a.parentElement;return e},onToggle(){this.isVisible=!this.isVisible},onKeydown(t){this.isVisible&&"Escape"===t.code&&(this.isVisible=!1)},onClickOutside(t){(t.path||this.getElementPath(t.target)).includes(this.$refs.root)||(this.isVisible=!1)},onInput(t,e){this.$emit("input",t),e&&(this.isVisible=!1)}}},"data-v-0f94a0a0",false,undefined,!1,$,void 0,void 0);export{B as VColorPicker,F as VColorPopover};
import e from"lodash/clamp";import t from"lodash/debounce";import a from"lodash/isEqual";import n from"lodash/throttle";var r=function(e,t,a,n,r,i,s,o){if(!e){var d;if(void 0===t)d=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[a,n,r,i,s,o],c=0;(d=new Error(t.replace(/%s/g,(function(){return l[c++]})))).name="Invariant Violation"}throw d.framesToPop=1,d}},i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function d(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var l=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},a=0;a<10;a++)t["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var a,n,r=d(e),l=1;l<arguments.length;l++){for(var c in a=Object(arguments[l]))s.call(a,c)&&(r[c]=a[c]);if(i){n=i(a);for(var u=0;u<n.length;u++)o.call(a,n[u])&&(r[n[u]]=a[n[u]])}}return r},c=/-?\d+(\.\d+)?%?/g;var u=function(e){return e.match(c)};var h=function(e,t,a){return Math.min(Math.max(e,t),a)};function p(e,t){switch(e=parseFloat(e),t){case 0:return h(e,0,360);case 1:case 2:return h(e,0,100);case 3:return h(e,0,1)}}var g=function(e){return u(e).map(p)};var f=function(e){4!==e.length&&5!==e.length||(e=function(e){for(var t="#",a=1;a<e.length;a++){var n=e.charAt(a);t+=n+n}return t}(e));var t=[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16)];if(9===e.length){var a=parseFloat((parseInt(e.substring(7,9),16)/255).toFixed(2));t.push(a)}return t};function m(e,t){return t<3?-1!=e.indexOf("%")?Math.round(255*h(parseInt(e,10),0,100)/100):h(parseInt(e,10),0,255):h(parseFloat(e),0,1)}var v=function(e){return u(e).map(m)};var b=function(e){var t,a,n,r,i,s=e[0]/360,o=e[1]/100,d=e[2]/100;if(0==o)return[i=255*d,i,i];t=2*d-(a=d<.5?d*(1+o):d+o-d*o),r=[0,0,0];for(var l=0;l<3;l++)(n=s+1/3*-(l-1))<0&&n++,n>1&&n--,i=6*n<1?t+6*(a-t)*n:2*n<1?a:3*n<2?t+(a-t)*(2/3-n)*6:t,r[l]=255*i;return r};var x={"#":f,hsl:function(e){var t=g(e),a=b(t);return 4===t.length&&a.push(t[3]),a},rgb:v};function y(e){for(var t in x)if(0===e.indexOf(t))return x[t](e)}y.rgb=v,y.hsl=g,y.hex=f;var C=y;var w=function(e){var t,a,n=e[0],r=e[1],i=e[2],s=Math.min(n,r,i),o=Math.max(n,r,i),d=o-s;return a=0==o?0:d/o*1e3/10,o==s?t=0:n==o?t=(r-i)/d:r==o?t=2+(i-n)/d:i==o&&(t=4+(n-r)/d),(t=Math.min(60*t,360))<0&&(t+=360),[t,a,o/255*1e3/10]};function k(e){var t=Math.round(h(e,0,255)).toString(16);return 1==t.length?"0"+t:t}var O=function(e){var t=4===e.length?k(255*e[3]):"";return"#"+k(e[0])+k(e[1])+k(e[2])+t};var _=function(e){var t,a,n=e[0],r=e[1]/100,i=e[2]/100;return t=r*i,[n,100*(t=(t/=(a=(2-r)*i)<=1?a:2-a)||0),100*(a/=2)]};var A=function(e){var t=e[0]/60,a=e[1]/100,n=e[2]/100,r=Math.floor(t)%6,i=t-Math.floor(t),s=255*n*(1-a),o=255*n*(1-a*i),d=255*n*(1-a*(1-i));switch(n*=255,r){case 0:return[n,d,s];case 1:return[o,n,s];case 2:return[s,n,d];case 3:return[s,o,n];case 4:return[d,s,n];case 5:return[n,s,o]}},M={name:"v-ctrl",abstract:!0,props:{direction:{type:String,default:"h",validator:function(e){return["v","h","vh","hv"].indexOf(e)>-1}},throttle:{type:Number,default:80},precision:{type:Number}},methods:{msdown:function(e){e.preventDefault(),document.addEventListener("mousemove",this.msmove),document.addEventListener("mouseup",this.msup),this.next(e)},msmove:function(e){e.preventDefault(),this.next(e)},msup:function(e){this.next(e),document.removeEventListener("mousemove",this.msmove),document.removeEventListener("mouseup",this.msup)},notify:function(e){!1===a(this.memo,e)&&(this.memo=e,this.$emit("change",e))},next:function(e){void 0===e&&(e={});var t=e.clientX;void 0===t&&(t=0);var a=e.clientY;void 0===a&&(a=0);var n=this.direction,r=this.adjust,i=this.$el.getBoundingClientRect(),s=r((t-i.left)/i.width);if("h"===n)return this.notify(s);var o=r((a-i.top)/i.height);if("v"===n)return this.notify(o);this.notify([s,o])},adjust:function(t){return function(e,t){var a=0|t;return a>0?parseFloat(e.toFixed(a)):e}(e(t,0,1),this.precision)}},render:function(e){return this.$slots.default[0]},created:function(){var e=this.msdown,t=this.msmove;this.msdown=e.bind(this),this.msmove=n(t.bind(this),this.throttle),this.memo=null},mounted:function(){this.$el.addEventListener("mousedown",this.msdown)},destroyed:function(){this.$el.removeEventListener("mousedown",this.msdown)},install:function(){Vue.component(M.name,M)}};"undefined"!=typeof window&&window.Vue&&Vue.use(M);var S={VueCtrlComponent:M};const I=Object.freeze({rgba:["r","g","b","a"],hsla:["h","s","l","a"],hex:["hex"]});function T(e,t=3){return(100*e).toPrecision(0|t)+"%"}function E(e){return e.replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3([0-9a-f]?)\4$/,"#$1$2$3$4")}var P={name:"VColorPicker",props:{value:{type:String,default:"#ff0000"},withSuggestions:{type:Boolean,default:!0}},components:{"v-ctrl":S.VueCtrlComponent},data(){const{value:e}=this,t={type:"number",maxlength:3},a={type:"string",maxlength:4};return{...this.digestProp(e),suggestions:[],currentMode:(n=e,"#"===n[0]?"hex":0===n.indexOf("rgb")?"rgba":0===n.indexOf("hsl")?"hsla":void r(!1,n+" is not valid color value!")),colorModes:I,colorModel:{hex:"",r:"",g:"",b:"",h:"",s:"",l:"",a:""},constrains:{r:t,g:t,b:t,h:t,s:a,l:a,a:{type:"number",maxlength:4},hex:{type:"string",maxlength:9}}};var n},watch:{value:{immediate:!0,handler(e,t){e!==t&&l(this,this.digestProp(e))}}},computed:{hsva(){const{hue:e,alpha:t,saturation:{x:a,y:n}}=this;return[360*e,100*a,100*(1-n),t]},rgba(){const{alpha:e,hsva:t}=this,[a,n,r]=A(t);return[Math.round(a),Math.round(n),Math.round(r),e]},hsla(){const{alpha:e,hsva:t}=this,[a,n,r]=_(t);return[Math.round(a),Math.round(n)+"%",Math.round(r)+"%",e]},hex(){return O(this.rgba)},previewBorderColor(){const[e,t,a]=this.rgba;return(e+t+a)/3>235?"rgba(160,160,160,0.8)":"transparent"},styles(){const{rgba:e,alpha:t,hue:a,saturation:n}=this,r=e.slice(0,3).join(", "),i=b([360*a,100,50]).map((e=>Math.round(e))).join(", ");return{preview:{backgroundColor:`rgba(${e.join(", ")})`,borderColor:this.previewBorderColor},saturationPane:{backgroundColor:`rgb(${i})`},saturationThumb:{left:T(n.x),top:T(n.y)},alphaTrack:{backgroundImage:`linear-gradient(to right, rgba(${r}, 0) 0%, rgb(${r}) 100%)`},alphaThumb:{left:T(t)},hueThumb:{left:T(1-a)}}}},methods:{digestProp(e){const t=C(e),a=null==t[3]?1:t[3],[n,r,i]=w(t);return{alpha:parseFloat(a.toFixed(2)),hue:n/360,saturation:{x:r/100,y:1-i/100}}},onSaturationChange([e,t]){this.saturation={x:e,y:t},this.emitChange()},onHueChange(e){this.hue=1-e,this.emitChange()},onAlphaChange(e){this.alpha=parseFloat(e.toFixed(2)),this.emitChange()},emitChange(){const{hex:e,rgba:t,hsla:a,currentMode:n}=this;if(this.updateColorModel(),"hex"===n)this.updateSuggestions(e),this.$emit("input",e);else if("hsla"===n){const e=`hsla(${a.join(",")})`;this.updateSuggestions(e),this.$emit("input",e)}else if("rgba"===n){const e=`rgba(${t.join(",")})`;this.updateSuggestions(e),this.$emit("input",e)}},onClickColor(e){this.$emit("input",e,!0)},handleInput(t,a){const{currentMode:n,colorModel:r}=this,{target:{value:i}}=a;let s=Number(i),o=!1;switch(t){case"a":r[t]===s||isNaN(s)||(r[t]=e(s,0,1),o=!0);break;case"r":case"g":case"b":r[t]===s||isNaN(s)||(r[t]=0|e(s,0,255),o=!0);break;case"h":r[t]===s||isNaN(s)||(r[t]=0|e(s,0,360),o=!0);break;case"s":case"l":"%"===i.slice(-1)&&r[t]!==i&&(s=parseFloat(i),r[t]=(0|e(s,0,360))+"%",o=!0);break;case"hex":"#"===i[0]&&r[t]!==i&&C(i).every((e=>!isNaN(e)))&&(r[t]=E(i),o=!0)}if(!o)return;const{h:d,s:c,l:u,r:h,g:p,b:g,a:f,hex:m}=r;let v=m;"rgba"===n?v=`rgba(${[h,p,g,f]})`:"hsla"===n&&(v=`hsla(${[d,c,u,f]})`),l(this,this.digestProp(v)),this.emitChange()},updateColorModel(){const{hsla:e,rgba:t,hex:a,alpha:n}=this,[r,i,s]=e,[o,d,c]=t,u=E(1===n?a.slice(0,7):a);l(this.colorModel,{r:o,g:d,b:c,h:r,s:i,l:s,a:n,hex:u})},loadSuggestions(){const e=localStorage.getItem("V_COLOR_PICKER_SUGGESTIONS");if(!e)return[];this.suggestions=JSON.parse(e)},updateSuggestions(e){if(this.suggestions.includes(e))return;let t;t=this.suggestions.length<7?this.suggestions.concat(e):this.suggestions.slice(1,7).concat(e),this.suggestions=t,localStorage.setItem("V_COLOR_PICKER_SUGGESTIONS",JSON.stringify(t))}},created(){this.handleInput=t(this.handleInput.bind(this),250),this.emitChange=t(this.emitChange.bind(this),250),this.updateColorModel(),this.loadSuggestions()}};function N(e,t,a,n,r,i,s,o,d,l){"boolean"!=typeof s&&(d=o,o=s,s=!1);const c="function"==typeof a?a.options:a;let u;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),n&&(c._scopeId=n),i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):t&&(u=s?function(e){t.call(this,l(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,o(e))}),u)if(c.functional){const e=c.render;c.render=function(t,a){return u.call(a),e(t,a)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,u):[u]}return a}const j="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function $(e){return(e,t)=>function(e,t){const a=j?t.media||"default":e,n=R[a]||(R[a]={ids:new Set,styles:[]});if(!n.ids.has(e)){n.ids.add(e);let a=t.source;if(t.map&&(a+="\n/*# sourceURL="+t.map.sources[0]+" */",a+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),n.element||(n.element=document.createElement("style"),n.element.type="text/css",t.media&&n.element.setAttribute("media",t.media),void 0===V&&(V=document.head||document.getElementsByTagName("head")[0]),V.appendChild(n.element)),"styleSheet"in n.element)n.styles.push(a),n.element.styleSheet.cssText=n.styles.filter(Boolean).join("\n");else{const e=n.ids.size-1,t=document.createTextNode(a),r=n.element.childNodes;r[e]&&n.element.removeChild(r[e]),r.length?n.element.insertBefore(t,r[e]):n.element.appendChild(t)}}}(e,t)}let V;const R={};const B=N({render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"wrapper"},[a("v-ctrl",{attrs:{direction:"vh",precision:2,throttle:80},on:{change:e.onSaturationChange}},[a("div",{staticClass:"saturation"},[a("div",{staticClass:"mask hue",style:e.styles.saturationPane}),e._v(" "),a("div",{staticClass:"mask white"}),e._v(" "),a("div",{staticClass:"mask black"}),e._v(" "),a("p",{staticClass:"thumb",style:e.styles.saturationThumb})])]),e._v(" "),a("section",{staticClass:"controls"},[a("section",{staticClass:"sliders"},[a("v-ctrl",{attrs:{direction:"h",precision:2,throttle:80},on:{change:e.onHueChange}},[a("div",{staticClass:"slider bar hue"},[a("div",{staticClass:"thumb",style:e.styles.hueThumb})])]),e._v(" "),a("v-ctrl",{attrs:{direction:"h",precision:2,throttle:80},on:{change:e.onAlphaChange}},[a("div",{staticClass:"slider alpha"},[a("div",{staticClass:"thumb",style:e.styles.alphaThumb}),e._v(" "),a("div",{staticClass:"bar",style:e.styles.alphaTrack})])])],1),e._v(" "),a("section",{staticClass:"modes"},[a("select",{directives:[{name:"model",rawName:"v-model",value:e.currentMode,expression:"currentMode"}],staticClass:"mode-input select",on:{change:function(t){var a=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.currentMode=t.target.multiple?a:a[0]}}},e._l(e.colorModes,(function(t,n){return a("option",{key:n,domProps:{value:n}},[e._v("\n "+e._s(n)+"\n ")])})),0),e._v(" "),e._l(e.colorModes[e.currentMode],(function(t){return a("input",{key:t,staticClass:"mode-input",attrs:{type:e.constrains[t].type,maxlength:e.constrains[t].maxlength},domProps:{value:e.colorModel[t]},on:{input:function(a){return e.handleInput(t,a)}}})}))],2)]),e._v(" "),e.withSuggestions&&e.suggestions.length>0?a("section",{staticClass:"suggestions"},[a("p",[e._v("Previously used colors")]),e._v(" "),a("ul",e._l(e.suggestions,(function(t){return a("li",{key:t},[a("button",{staticClass:"suggestion",style:{backgroundColor:t},attrs:{type:"button"},on:{click:function(a){return e.onClickColor(t)}}})])})),0)]):e._e()],1)},staticRenderFns:[]},(function(e){e&&e("data-v-8fc876ba_0",{source:".wrapper[data-v-8fc876ba]{width:260px;margin:0;background:#fff;border-radius:2px;box-shadow:0 0 2px rgba(0,0,0,.3),0 4px 8px rgba(0,0,0,.3);user-select:none}.slider[data-v-8fc876ba]{position:relative;margin-bottom:16px}.slider.hue[data-v-8fc876ba]{background:linear-gradient(-90deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.slider.alpha[data-v-8fc876ba]{margin-top:8px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==) left center}.bar[data-v-8fc876ba]{height:8px;border-radius:4px}.controls[data-v-8fc876ba]{padding:20px 16px;padding-bottom:16px}.modes[data-v-8fc876ba]{display:flex;align-items:center}.mode-input[data-v-8fc876ba]{width:100%;appearance:none;-webkit-appearance:none;font-size:12px;line-height:1.5;text-align:center;text-transform:uppercase;border:none;padding:0;font-family:Inter,Helvetica,Arial,sans-serif;color:#1a202c}.mode-input.select[data-v-8fc876ba]{flex:0 0 42px;margin-right:10px;background-repeat:no-repeat;background-size:6px;background-position:center right;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI2IiB2aWV3Qm94PSIwIDAgOCA2IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMSAxLjQ3MzM5TDQgNC41MjY2Nkw3IDEuNDczMzkiIHN0cm9rZT0iIzlFQjVDOCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=)}.thumb[data-v-8fc876ba]{position:absolute;width:12px;height:12px;top:0;border-radius:50%;margin-top:-1px;transform:translateX(-50%);background-color:#f8f8f8;box-shadow:0 1px 4px 0 rgba(0,0,0,.368627);cursor:default}.saturation[data-v-8fc876ba]{position:relative;width:100%;padding-bottom:55%;overflow:hidden}.saturation>div[data-v-8fc876ba]{position:absolute;top:0;left:0;right:0;bottom:0;margin:0}.saturation>.thumb[data-v-8fc876ba]{background-color:transparent;transform:translate(-50%,-50%);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4)}.mask.white[data-v-8fc876ba]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.mask.black[data-v-8fc876ba]{background:linear-gradient(0deg,#000,transparent)}.suggestions[data-v-8fc876ba]{border-top:1px solid #e2e8f0;padding:20px 16px;padding-top:16px}.suggestions p[data-v-8fc876ba]{margin-top:0;margin-bottom:10px;font-family:Inter,Helvetica,Arial,sans-serif;font-size:12px;line-height:1.5;color:#1a202c}.suggestions ul[data-v-8fc876ba]{display:flex;align-items:center;margin:0;padding:0;list-style:none}.suggestion[data-v-8fc876ba]{width:24px;height:24px;margin:4px;border:1px solid #e2e8f0;border-radius:50%}",map:void 0,media:void 0})}),P,"data-v-8fc876ba",false,undefined,!1,$,void 0,void 0),L={BOTTOM:"bottom",LEFT:"left",RIGHT:"right",TOP:"top"};const F=N({render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"root",staticClass:"popover"},[a("button",{staticClass:"trigger",attrs:{type:"button"},on:{click:e.onToggle}},[a("span",{staticClass:"preview",style:{"background-color":e.value}})]),e._v(" "),a("transition",{attrs:{name:e.currentTransitionName}},[e.isVisible?a("div",{staticClass:"frame",class:e.framePositionClass},[a("color-picker",{attrs:{value:e.value,"with-suggestions":e.withSuggestions},on:{input:e.onInput}})],1):e._e()])],1)},staticRenderFns:[]},(function(e){e&&e("data-v-65ed649e_0",{source:".popover[data-v-65ed649e]{position:relative}.trigger[data-v-65ed649e]{flex:0 0 auto;display:flex;align-items:center;padding:0;background:0 0;border:none;cursor:pointer}.preview[data-v-65ed649e]{flex:1 1 auto;display:inline-block;vertical-align:middle;width:32px;height:32px;border:1px solid #e2e8f0;border-radius:50%}.frame[data-v-65ed649e]{position:absolute;z-index:10}.frame.bottom[data-v-65ed649e]{left:0;top:calc(100% + 12px)}.frame.top[data-v-65ed649e]{left:0;bottom:calc(100% + 12px)}.frame.left[data-v-65ed649e]{right:calc(100% + 12px);top:50%;transform:translateY(-50%)}.frame.right[data-v-65ed649e]{left:calc(100% + 12px);top:50%;transform:translateY(-50%)}.slide-down-enter-active[data-v-65ed649e]{animation:slideDown-data-v-65ed649e .25s}.slide-down-leave-to[data-v-65ed649e]{animation:slideDown-data-v-65ed649e .25s reverse}@keyframes slideDown-data-v-65ed649e{from{transform:translateY(15px);opacity:0}}.slide-up-enter-active[data-v-65ed649e]{animation:slideUp-data-v-65ed649e .25s}.slide-up-leave-to[data-v-65ed649e]{animation:slideUp-data-v-65ed649e .25s reverse}@keyframes slideUp-data-v-65ed649e{from{transform:translateY(-15px);opacity:0}}.slide-left-enter-active[data-v-65ed649e]{animation:slideLeft-data-v-65ed649e .25s}.slide-left-leave-to[data-v-65ed649e]{animation:slideLeft-data-v-65ed649e .25s reverse}@keyframes slideLeft-data-v-65ed649e{from{transform:translateX(-15px) translateY(-50%);opacity:0}}.slide-right-enter-active[data-v-65ed649e]{animation:slideRight-data-v-65ed649e .25s}.slide-right-leave-to[data-v-65ed649e]{animation:slideRight-data-v-65ed649e .25s reverse}@keyframes slideRight-data-v-65ed649e{from{transform:translateX(15px) translateY(-50%);opacity:0}}",map:void 0,media:void 0})}),{name:"VColorPopover",components:{ColorPicker:B},props:{value:{type:String,default:"#ff0000"},withSuggestions:{type:Boolean,default:!0},position:{type:String,default:L.BOTTOM,validator:e=>Object.values(L).includes(e)}},data:()=>({isVisible:!1}),computed:{currentTransitionName(){switch(this.position){case L.BOTTOM:return"slide-down";case L.LEFT:return"slide-left";case L.RIGHT:return"slide-right";case L.TOP:return"slide-up"}},framePositionClass(){switch(this.position){case L.BOTTOM:return"bottom";case L.LEFT:return"left";case L.RIGHT:return"right";case L.TOP:return"top"}}},watch:{isVisible(e){e?document.body.addEventListener("click",this.onClickOutside):document.body.removeEventListener("click",this.onClickOutside)}},created(){document.addEventListener("keyup",this.onKeydown)},beforeDestroy(){document.removeEventListener("keyup",this.onKeydown)},methods:{getElementPath(e){const t=[];let a=e;for(;a!==document.body;)t.unshift(a),a=a.parentElement;return t},onToggle(){this.isVisible=!this.isVisible},onKeydown(e){this.isVisible&&"Escape"===e.code&&(this.isVisible=!1)},onClickOutside(e){(e.path||this.getElementPath(e.target)).includes(this.$refs.root)||(this.isVisible=!1)},onInput(e,t){this.$emit("input",e),t&&(this.isVisible=!1)}}},"data-v-65ed649e",false,undefined,!1,$,void 0,void 0);export{B as VColorPicker,F as VColorPopover};

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VColor={})}(this,(function(t){"use strict";var e=function(t,e,r){return t==t&&(void 0!==r&&(t=t<=r?t:r),void 0!==e&&(t=t>=e?t:e)),t};var r=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var o="object"==typeof n&&n&&n.Object===Object&&n,i="object"==typeof self&&self&&self.Object===Object&&self,s=o||i||Function("return this")(),u=s.Symbol,c=Object.prototype,l=c.hasOwnProperty,d=c.toString,f=u?u.toStringTag:void 0;var p=function(t){var e=l.call(t,f),r=t[f];try{t[f]=void 0;var n=!0}catch(t){}var a=d.call(t);return n&&(e?t[f]=r:delete t[f]),a},h=Object.prototype.toString;var v=function(t){return h.call(t)},g=u?u.toStringTag:void 0;var b=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":g&&g in Object(t)?p(t):v(t)};var m=function(t){return null!=t&&"object"==typeof t};var y=function(t){return"symbol"==typeof t||m(t)&&"[object Symbol]"==b(t)},_=/^\s+|\s+$/g,x=/^[-+]0x[0-9a-f]+$/i,w=/^0b[01]+$/i,j=/^0o[0-7]+$/i,O=parseInt;var C=function(t){if("number"==typeof t)return t;if(y(t))return NaN;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(_,"");var n=w.test(t);return n||j.test(t)?O(t.slice(2),n?2:8):x.test(t)?NaN:+t};var k=function(t,r,n){return void 0===n&&(n=r,r=void 0),void 0!==n&&(n=(n=C(n))==n?n:0),void 0!==r&&(r=(r=C(r))==r?r:0),e(C(t),r,n)},A=function(){return s.Date.now()},T=Math.max,S=Math.min;var M=function(t,e,n){var a,o,i,s,u,c,l=0,d=!1,f=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function h(e){var r=a,n=o;return a=o=void 0,l=e,s=t.apply(n,r)}function v(t){return l=t,u=setTimeout(b,e),d?h(t):s}function g(t){var r=t-c;return void 0===c||r>=e||r<0||f&&t-l>=i}function b(){var t=A();if(g(t))return m(t);u=setTimeout(b,function(t){var r=e-(t-c);return f?S(r,i-(t-l)):r}(t))}function m(t){return u=void 0,p&&a?h(t):(a=o=void 0,s)}function y(){var t=A(),r=g(t);if(a=arguments,o=this,c=t,r){if(void 0===u)return v(c);if(f)return clearTimeout(u),u=setTimeout(b,e),h(c)}return void 0===u&&(u=setTimeout(b,e)),s}return e=C(e)||0,r(n)&&(d=!!n.leading,i=(f="maxWait"in n)?T(C(n.maxWait)||0,e):i,p="trailing"in n?!!n.trailing:p),y.cancel=function(){void 0!==u&&clearTimeout(u),l=0,a=c=o=u=void 0},y.flush=function(){return void 0===u?s:m(A())},y};var E=function(){this.__data__=[],this.size=0};var P=function(t,e){return t===e||t!=t&&e!=e};var I=function(t,e){for(var r=t.length;r--;)if(P(t[r][0],e))return r;return-1},$=Array.prototype.splice;var N=function(t){var e=this.__data__,r=I(e,t);return!(r<0)&&(r==e.length-1?e.pop():$.call(e,r,1),--this.size,!0)};var z=function(t){var e=this.__data__,r=I(e,t);return r<0?void 0:e[r][1]};var V=function(t){return I(this.__data__,t)>-1};var B=function(t,e){var r=this.__data__,n=I(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function R(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}R.prototype.clear=E,R.prototype.delete=N,R.prototype.get=z,R.prototype.has=V,R.prototype.set=B;var L=R;var F=function(){this.__data__=new L,this.size=0};var D=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var U=function(t){return this.__data__.get(t)};var G=function(t){return this.__data__.has(t)};var W,Y=function(t){if(!r(t))return!1;var e=b(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},H=s["__core-js_shared__"],J=(W=/[^.]+$/.exec(H&&H.keys&&H.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"";var Q=function(t){return!!J&&J in t},X=Function.prototype.toString;var Z=function(t){if(null!=t){try{return X.call(t)}catch(t){}try{return t+""}catch(t){}}return""},q=/^\[object .+?Constructor\]$/,K=Function.prototype,tt=Object.prototype,et=K.toString,rt=tt.hasOwnProperty,nt=RegExp("^"+et.call(rt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var at=function(t){return!(!r(t)||Q(t))&&(Y(t)?nt:q).test(Z(t))};var ot=function(t,e){return null==t?void 0:t[e]};var it=function(t,e){var r=ot(t,e);return at(r)?r:void 0},st=it(s,"Map"),ut=it(Object,"create");var ct=function(){this.__data__=ut?ut(null):{},this.size=0};var lt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},dt=Object.prototype.hasOwnProperty;var ft=function(t){var e=this.__data__;if(ut){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return dt.call(e,t)?e[t]:void 0},pt=Object.prototype.hasOwnProperty;var ht=function(t){var e=this.__data__;return ut?void 0!==e[t]:pt.call(e,t)};var vt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ut&&void 0===e?"__lodash_hash_undefined__":e,this};function gt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}gt.prototype.clear=ct,gt.prototype.delete=lt,gt.prototype.get=ft,gt.prototype.has=ht,gt.prototype.set=vt;var bt=gt;var mt=function(){this.size=0,this.__data__={hash:new bt,map:new(st||L),string:new bt}};var yt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var _t=function(t,e){var r=t.__data__;return yt(e)?r["string"==typeof e?"string":"hash"]:r.map};var xt=function(t){var e=_t(this,t).delete(t);return this.size-=e?1:0,e};var wt=function(t){return _t(this,t).get(t)};var jt=function(t){return _t(this,t).has(t)};var Ot=function(t,e){var r=_t(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Ct(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ct.prototype.clear=mt,Ct.prototype.delete=xt,Ct.prototype.get=wt,Ct.prototype.has=jt,Ct.prototype.set=Ot;var kt=Ct;var At=function(t,e){var r=this.__data__;if(r instanceof L){var n=r.__data__;if(!st||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new kt(n)}return r.set(t,e),this.size=r.size,this};function Tt(t){var e=this.__data__=new L(t);this.size=e.size}Tt.prototype.clear=F,Tt.prototype.delete=D,Tt.prototype.get=U,Tt.prototype.has=G,Tt.prototype.set=At;var St=Tt;var Mt=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var Et=function(t){return this.__data__.has(t)};function Pt(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new kt;++e<r;)this.add(t[e])}Pt.prototype.add=Pt.prototype.push=Mt,Pt.prototype.has=Et;var It=Pt;var $t=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1};var Nt=function(t,e){return t.has(e)};var zt=function(t,e,r,n,a,o){var i=1&r,s=t.length,u=e.length;if(s!=u&&!(i&&u>s))return!1;var c=o.get(t),l=o.get(e);if(c&&l)return c==e&&l==t;var d=-1,f=!0,p=2&r?new It:void 0;for(o.set(t,e),o.set(e,t);++d<s;){var h=t[d],v=e[d];if(n)var g=i?n(v,h,d,e,t,o):n(h,v,d,t,e,o);if(void 0!==g){if(g)continue;f=!1;break}if(p){if(!$t(e,(function(t,e){if(!Nt(p,e)&&(h===t||a(h,t,r,n,o)))return p.push(e)}))){f=!1;break}}else if(h!==v&&!a(h,v,r,n,o)){f=!1;break}}return o.delete(t),o.delete(e),f},Vt=s.Uint8Array;var Bt=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var Rt=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},Lt=u?u.prototype:void 0,Ft=Lt?Lt.valueOf:void 0;var Dt=function(t,e,r,n,a,o,i){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new Vt(t),new Vt(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return P(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var s=Bt;case"[object Set]":var u=1&n;if(s||(s=Rt),t.size!=e.size&&!u)return!1;var c=i.get(t);if(c)return c==e;n|=2,i.set(t,e);var l=zt(s(t),s(e),n,a,o,i);return i.delete(t),l;case"[object Symbol]":if(Ft)return Ft.call(t)==Ft.call(e)}return!1};var Ut=function(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t},Gt=Array.isArray;var Wt=function(t,e,r){var n=e(t);return Gt(t)?n:Ut(n,r(t))};var Yt=function(t,e){for(var r=-1,n=null==t?0:t.length,a=0,o=[];++r<n;){var i=t[r];e(i,r,t)&&(o[a++]=i)}return o};var Ht=function(){return[]},Jt=Object.prototype.propertyIsEnumerable,Qt=Object.getOwnPropertySymbols,Xt=Qt?function(t){return null==t?[]:(t=Object(t),Yt(Qt(t),(function(e){return Jt.call(t,e)})))}:Ht;var Zt=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var qt=function(t){return m(t)&&"[object Arguments]"==b(t)},Kt=Object.prototype,te=Kt.hasOwnProperty,ee=Kt.propertyIsEnumerable,re=qt(function(){return arguments}())?qt:function(t){return m(t)&&te.call(t,"callee")&&!ee.call(t,"callee")};var ne=function(){return!1},ae=a((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,a=n&&n.exports===r?s.Buffer:void 0,o=(a?a.isBuffer:void 0)||ne;t.exports=o})),oe=/^(?:0|[1-9]\d*)$/;var ie=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&oe.test(t))&&t>-1&&t%1==0&&t<e};var se=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},ue={};ue["[object Float32Array]"]=ue["[object Float64Array]"]=ue["[object Int8Array]"]=ue["[object Int16Array]"]=ue["[object Int32Array]"]=ue["[object Uint8Array]"]=ue["[object Uint8ClampedArray]"]=ue["[object Uint16Array]"]=ue["[object Uint32Array]"]=!0,ue["[object Arguments]"]=ue["[object Array]"]=ue["[object ArrayBuffer]"]=ue["[object Boolean]"]=ue["[object DataView]"]=ue["[object Date]"]=ue["[object Error]"]=ue["[object Function]"]=ue["[object Map]"]=ue["[object Number]"]=ue["[object Object]"]=ue["[object RegExp]"]=ue["[object Set]"]=ue["[object String]"]=ue["[object WeakMap]"]=!1;var ce=function(t){return m(t)&&se(t.length)&&!!ue[b(t)]};var le=function(t){return function(e){return t(e)}},de=a((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,a=n&&n.exports===r&&o.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=i})),fe=de&&de.isTypedArray,pe=fe?le(fe):ce,he=Object.prototype.hasOwnProperty;var ve=function(t,e){var r=Gt(t),n=!r&&re(t),a=!r&&!n&&ae(t),o=!r&&!n&&!a&&pe(t),i=r||n||a||o,s=i?Zt(t.length,String):[],u=s.length;for(var c in t)!e&&!he.call(t,c)||i&&("length"==c||a&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ie(c,u))||s.push(c);return s},ge=Object.prototype;var be=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ge)};var me=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),ye=Object.prototype.hasOwnProperty;var _e=function(t){if(!be(t))return me(t);var e=[];for(var r in Object(t))ye.call(t,r)&&"constructor"!=r&&e.push(r);return e};var xe=function(t){return null!=t&&se(t.length)&&!Y(t)};var we=function(t){return xe(t)?ve(t):_e(t)};var je=function(t){return Wt(t,we,Xt)},Oe=Object.prototype.hasOwnProperty;var Ce=function(t,e,r,n,a,o){var i=1&r,s=je(t),u=s.length;if(u!=je(e).length&&!i)return!1;for(var c=u;c--;){var l=s[c];if(!(i?l in e:Oe.call(e,l)))return!1}var d=o.get(t),f=o.get(e);if(d&&f)return d==e&&f==t;var p=!0;o.set(t,e),o.set(e,t);for(var h=i;++c<u;){var v=t[l=s[c]],g=e[l];if(n)var b=i?n(g,v,l,e,t,o):n(v,g,l,t,e,o);if(!(void 0===b?v===g||a(v,g,r,n,o):b)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var m=t.constructor,y=e.constructor;m==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y||(p=!1)}return o.delete(t),o.delete(e),p},ke=it(s,"DataView"),Ae=it(s,"Promise"),Te=it(s,"Set"),Se=it(s,"WeakMap"),Me="[object Map]",Ee="[object Promise]",Pe="[object Set]",Ie="[object WeakMap]",$e="[object DataView]",Ne=Z(ke),ze=Z(st),Ve=Z(Ae),Be=Z(Te),Re=Z(Se),Le=b;(ke&&Le(new ke(new ArrayBuffer(1)))!=$e||st&&Le(new st)!=Me||Ae&&Le(Ae.resolve())!=Ee||Te&&Le(new Te)!=Pe||Se&&Le(new Se)!=Ie)&&(Le=function(t){var e=b(t),r="[object Object]"==e?t.constructor:void 0,n=r?Z(r):"";if(n)switch(n){case Ne:return $e;case ze:return Me;case Ve:return Ee;case Be:return Pe;case Re:return Ie}return e});var Fe=Le,De="[object Arguments]",Ue="[object Array]",Ge="[object Object]",We=Object.prototype.hasOwnProperty;var Ye=function(t,e,r,n,a,o){var i=Gt(t),s=Gt(e),u=i?Ue:Fe(t),c=s?Ue:Fe(e),l=(u=u==De?Ge:u)==Ge,d=(c=c==De?Ge:c)==Ge,f=u==c;if(f&&ae(t)){if(!ae(e))return!1;i=!0,l=!1}if(f&&!l)return o||(o=new St),i||pe(t)?zt(t,e,r,n,a,o):Dt(t,e,u,r,n,a,o);if(!(1&r)){var p=l&&We.call(t,"__wrapped__"),h=d&&We.call(e,"__wrapped__");if(p||h){var v=p?t.value():t,g=h?e.value():e;return o||(o=new St),a(v,g,r,n,o)}}return!!f&&(o||(o=new St),Ce(t,e,r,n,a,o))};var He=function t(e,r,n,a,o){return e===r||(null==e||null==r||!m(e)&&!m(r)?e!=e&&r!=r:Ye(e,r,n,a,t,o))};var Je=function(t,e){return He(t,e)},Qe=function(t,e,r,n,a,o,i,s){if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,a,o,i,s],l=0;(u=new Error(e.replace(/%s/g,(function(){return c[l++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}},Xe=Object.getOwnPropertySymbols,Ze=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable;function Ke(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var tr=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,n,a=Ke(t),o=1;o<arguments.length;o++){for(var i in r=Object(arguments[o]))Ze.call(r,i)&&(a[i]=r[i]);if(Xe){n=Xe(r);for(var s=0;s<n.length;s++)qe.call(r,n[s])&&(a[n[s]]=r[n[s]])}}return a},er=/-?\d+(\.\d+)?%?/g;var rr=function(t){return t.match(er)};var nr=function(t,e,r){return Math.min(Math.max(t,e),r)};function ar(t,e){switch(t=parseFloat(t),e){case 0:return nr(t,0,360);case 1:case 2:return nr(t,0,100);case 3:return nr(t,0,1)}}var or=function(t){return rr(t).map(ar)};var ir=function(t){4!==t.length&&5!==t.length||(t=function(t){for(var e="#",r=1;r<t.length;r++){var n=t.charAt(r);e+=n+n}return e}(t));var e=[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16)];if(9===t.length){var r=parseFloat((parseInt(t.substring(7,9),16)/255).toFixed(2));e.push(r)}return e};function sr(t,e){return e<3?-1!=t.indexOf("%")?Math.round(255*nr(parseInt(t,10),0,100)/100):nr(parseInt(t,10),0,255):nr(parseFloat(t),0,1)}var ur=function(t){return rr(t).map(sr)};var cr=function(t){var e,r,n,a,o,i=t[0]/360,s=t[1]/100,u=t[2]/100;if(0==s)return[o=255*u,o,o];e=2*u-(r=u<.5?u*(1+s):u+s-u*s),a=[0,0,0];for(var c=0;c<3;c++)(n=i+1/3*-(c-1))<0&&n++,n>1&&n--,o=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,a[c]=255*o;return a};var lr={"#":ir,hsl:function(t){var e=or(t),r=cr(e);return 4===e.length&&r.push(e[3]),r},rgb:ur};function dr(t){for(var e in lr)if(0===t.indexOf(e))return lr[e](t)}dr.rgb=ur,dr.hsl=or,dr.hex=ir;var fr=dr;var pr=function(t){var e,r,n=t[0],a=t[1],o=t[2],i=Math.min(n,a,o),s=Math.max(n,a,o),u=s-i;return r=0==s?0:u/s*1e3/10,s==i?e=0:n==s?e=(a-o)/u:a==s?e=2+(o-n)/u:o==s&&(e=4+(n-a)/u),(e=Math.min(60*e,360))<0&&(e+=360),[e,r,s/255*1e3/10]};function hr(t){var e=Math.round(nr(t,0,255)).toString(16);return 1==e.length?"0"+e:e}var vr=function(t){var e=4===t.length?hr(255*t[3]):"";return"#"+hr(t[0])+hr(t[1])+hr(t[2])+e};var gr=function(t){var e,r,n=t[0],a=t[1]/100,o=t[2]/100;return e=a*o,[n,100*(e=(e/=(r=(2-a)*o)<=1?r:2-r)||0),100*(r/=2)]};var br=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),i=255*n*(1-r),s=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,a){case 0:return[n,u,i];case 1:return[s,n,i];case 2:return[i,n,u];case 3:return[i,s,n];case 4:return[u,i,n];case 5:return[n,i,s]}};var mr=function(t,e,n){var a=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return r(n)&&(a="leading"in n?!!n.leading:a,o="trailing"in n?!!n.trailing:o),M(t,e,{leading:a,maxWait:e,trailing:o})},yr={name:"v-ctrl",abstract:!0,props:{direction:{type:String,default:"h",validator:function(t){return["v","h","vh","hv"].indexOf(t)>-1}},throttle:{type:Number,default:80},precision:{type:Number}},methods:{msdown:function(t){t.preventDefault(),document.addEventListener("mousemove",this.msmove),document.addEventListener("mouseup",this.msup),this.next(t)},msmove:function(t){t.preventDefault(),this.next(t)},msup:function(t){this.next(t),document.removeEventListener("mousemove",this.msmove),document.removeEventListener("mouseup",this.msup)},notify:function(t){!1===Je(this.memo,t)&&(this.memo=t,this.$emit("change",t))},next:function(t){void 0===t&&(t={});var e=t.clientX;void 0===e&&(e=0);var r=t.clientY;void 0===r&&(r=0);var n=this.direction,a=this.adjust,o=this.$el.getBoundingClientRect(),i=a((e-o.left)/o.width);if("h"===n)return this.notify(i);var s=a((r-o.top)/o.height);if("v"===n)return this.notify(s);this.notify([i,s])},adjust:function(t){return function(t,e){var r=0|e;return r>0?parseFloat(t.toFixed(r)):t}(k(t,0,1),this.precision)}},render:function(t){return this.$slots.default[0]},created:function(){var t=this.msdown,e=this.msmove;this.msdown=t.bind(this),this.msmove=mr(e.bind(this),this.throttle),this.memo=null},mounted:function(){this.$el.addEventListener("mousedown",this.msdown)},destroyed:function(){this.$el.removeEventListener("mousedown",this.msdown)},install:function(){Vue.component(yr.name,yr)}};"undefined"!=typeof window&&window.Vue&&Vue.use(yr);var _r={VueCtrlComponent:yr};const xr=Object.freeze({rgba:["r","g","b","a"],hsla:["h","s","l","a"],hex:["hex"]});function wr(t,e=3){return(100*t).toPrecision(0|e)+"%"}function jr(t){return t.replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3([0-9a-f]?)\4$/,"#$1$2$3$4")}var Or={name:"VColorPicker",props:{value:{type:String,default:"#ff0000"},withSuggestions:{type:Boolean,default:!0}},components:{"v-ctrl":_r.VueCtrlComponent},data(){const{value:t}=this,e={type:"number",maxlength:3},r={type:"string",maxlength:4};return{...this.digestProp(t),suggestions:[],currentMode:(n=t,"#"===n[0]?"hex":0===n.indexOf("rgb")?"rgba":0===n.indexOf("hsl")?"hsla":void Qe(!1,n+" is not valid color value!")),colorModes:xr,colorModel:{hex:"",r:"",g:"",b:"",h:"",s:"",l:"",a:""},constrains:{r:e,g:e,b:e,h:e,s:r,l:r,a:{type:"number",maxlength:4},hex:{type:"string",maxlength:9}}};var n},watch:{value:{immediate:!0,handler(t,e){t!==e&&tr(this,this.digestProp(t))}}},computed:{hsva(){const{hue:t,alpha:e,saturation:{x:r,y:n}}=this;return[360*t,100*r,100*(1-n),e]},rgba(){const{alpha:t,hsva:e}=this,[r,n,a]=br(e);return[Math.round(r),Math.round(n),Math.round(a),t]},hsla(){const{alpha:t,hsva:e}=this,[r,n,a]=gr(e);return[Math.round(r),Math.round(n)+"%",Math.round(a)+"%",t]},hex(){return vr(this.rgba)},previewBorderColor(){const[t,e,r]=this.rgba;return(t+e+r)/3>235?"rgba(160,160,160,0.8)":"transparent"},styles(){const{rgba:t,alpha:e,hue:r,saturation:n}=this,a=t.slice(0,3).join(", "),o=cr([360*r,100,50]).map((t=>Math.round(t))).join(", ");return{preview:{backgroundColor:`rgba(${t.join(", ")})`,borderColor:this.previewBorderColor},saturationPane:{backgroundColor:`rgb(${o})`},saturationThumb:{left:wr(n.x),top:wr(n.y)},alphaTrack:{backgroundImage:`linear-gradient(to right, rgba(${a}, 0) 0%, rgb(${a}) 100%)`},alphaThumb:{left:wr(e)},hueThumb:{left:wr(1-r)}}}},methods:{digestProp(t){const e=fr(t),r=null==e[3]?1:e[3],[n,a,o]=pr(e);return{alpha:parseFloat(r.toFixed(2)),hue:n/360,saturation:{x:a/100,y:1-o/100}}},onSaturationChange([t,e]){this.saturation={x:t,y:e},this.emitChange()},onHueChange(t){this.hue=1-t,this.emitChange()},onAlphaChange(t){this.alpha=parseFloat(t.toFixed(2)),this.emitChange()},emitChange(){const{hex:t,rgba:e,hsla:r,currentMode:n}=this;if(this.updateColorModel(),"hex"===n)this.updateSuggestions(t),this.$emit("input",t);else if("hsla"===n){const t=`hsla(${r.join(",")})`;this.updateSuggestions(t),this.$emit("input",t)}else if("rgba"===n){const t=`rgba(${e.join(",")})`;this.updateSuggestions(t),this.$emit("input",t)}},onClickColor(t){this.$emit("input",t,!0)},handleInput(t,e){const{currentMode:r,colorModel:n}=this,{target:{value:a}}=e;let o=Number(a),i=!1;switch(t){case"a":n[t]===o||isNaN(o)||(n[t]=k(o,0,1),i=!0);break;case"r":case"g":case"b":n[t]===o||isNaN(o)||(n[t]=0|k(o,0,255),i=!0);break;case"h":n[t]===o||isNaN(o)||(n[t]=0|k(o,0,360),i=!0);break;case"s":case"l":"%"===a.slice(-1)&&n[t]!==a&&(o=parseFloat(a),n[t]=(0|k(o,0,360))+"%",i=!0);break;case"hex":"#"===a[0]&&n[t]!==a&&fr(a).every((t=>!isNaN(t)))&&(n[t]=jr(a),i=!0)}if(!i)return;const{h:s,s:u,l:c,r:l,g:d,b:f,a:p,hex:h}=n;let v=h;"rgba"===r?v=`rgba(${[l,d,f,p]})`:"hsla"===r&&(v=`hsla(${[s,u,c,p]})`),tr(this,this.digestProp(v)),this.emitChange()},updateColorModel(){const{hsla:t,rgba:e,hex:r,alpha:n}=this,[a,o,i]=t,[s,u,c]=e,l=jr(1===n?r.slice(0,7):r);tr(this.colorModel,{r:s,g:u,b:c,h:a,s:o,l:i,a:n,hex:l})},loadSuggestions(){const t=localStorage.getItem("V_COLOR_PICKER_SUGGESTIONS");if(!t)return[];this.suggestions=JSON.parse(t)},updateSuggestions(t){if(this.suggestions.includes(t))return;let e;e=this.suggestions.length<7?this.suggestions.concat(t):this.suggestions.slice(1,7).concat(t),this.suggestions=e,localStorage.setItem("V_COLOR_PICKER_SUGGESTIONS",JSON.stringify(e))}},created(){this.handleInput=M(this.handleInput.bind(this),250),this.emitChange=M(this.emitChange.bind(this),250),this.updateColorModel(),this.loadSuggestions()}};function Cr(t,e,r,n,a,o,i,s,u,c){"boolean"!=typeof i&&(u=s,s=i,i=!1);const l="function"==typeof r?r.options:r;let d;if(t&&t.render&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,a&&(l.functional=!0)),n&&(l._scopeId=n),o?(d=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,u(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},l._ssrRegister=d):e&&(d=i?function(t){e.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),d)if(l.functional){const t=l.render;l.render=function(e,r){return d.call(r),t(e,r)}}else{const t=l.beforeCreate;l.beforeCreate=t?[].concat(t,d):[d]}return r}const kr="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function Ar(t){return(t,e)=>function(t,e){const r=kr?e.media||"default":t,n=Sr[r]||(Sr[r]={ids:new Set,styles:[]});if(!n.ids.has(t)){n.ids.add(t);let r=e.source;if(e.map&&(r+="\n/*# sourceURL="+e.map.sources[0]+" */",r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),n.element||(n.element=document.createElement("style"),n.element.type="text/css",e.media&&n.element.setAttribute("media",e.media),void 0===Tr&&(Tr=document.head||document.getElementsByTagName("head")[0]),Tr.appendChild(n.element)),"styleSheet"in n.element)n.styles.push(r),n.element.styleSheet.cssText=n.styles.filter(Boolean).join("\n");else{const t=n.ids.size-1,e=document.createTextNode(r),a=n.element.childNodes;a[t]&&n.element.removeChild(a[t]),a.length?n.element.insertBefore(e,a[t]):n.element.appendChild(e)}}}(t,e)}let Tr;const Sr={};const Mr=Cr({render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"wrapper"},[r("v-ctrl",{attrs:{direction:"vh",precision:2,throttle:80},on:{change:t.onSaturationChange}},[r("div",{staticClass:"saturation"},[r("div",{staticClass:"mask hue",style:t.styles.saturationPane}),t._v(" "),r("div",{staticClass:"mask white"}),t._v(" "),r("div",{staticClass:"mask black"}),t._v(" "),r("p",{staticClass:"thumb",style:t.styles.saturationThumb})])]),t._v(" "),r("section",{staticClass:"controls"},[r("section",{staticClass:"sliders"},[r("v-ctrl",{attrs:{direction:"h",precision:2,throttle:80},on:{change:t.onHueChange}},[r("div",{staticClass:"slider bar hue"},[r("div",{staticClass:"thumb",style:t.styles.hueThumb})])]),t._v(" "),r("v-ctrl",{attrs:{direction:"h",precision:2,throttle:80},on:{change:t.onAlphaChange}},[r("div",{staticClass:"slider alpha"},[r("div",{staticClass:"thumb",style:t.styles.alphaThumb}),t._v(" "),r("div",{staticClass:"bar",style:t.styles.alphaTrack})])])],1),t._v(" "),r("section",{staticClass:"modes"},[r("select",{directives:[{name:"model",rawName:"v-model",value:t.currentMode,expression:"currentMode"}],staticClass:"mode-input select",on:{change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.currentMode=e.target.multiple?r:r[0]}}},t._l(t.colorModes,(function(e,n){return r("option",{key:n,domProps:{value:n}},[t._v("\n "+t._s(n)+"\n ")])})),0),t._v(" "),t._l(t.colorModes[t.currentMode],(function(e){return r("input",{key:e,staticClass:"mode-input",attrs:{type:t.constrains[e].type,maxlength:t.constrains[e].maxlength},domProps:{value:t.colorModel[e]},on:{input:function(r){return t.handleInput(e,r)}}})}))],2)]),t._v(" "),t.withSuggestions&&t.suggestions.length>0?r("section",{staticClass:"suggestions"},[r("p",[t._v("Previously used colors")]),t._v(" "),r("ul",t._l(t.suggestions,(function(e){return r("li",{key:e},[r("button",{staticClass:"suggestion",style:{backgroundColor:e},attrs:{type:"button"},on:{click:function(r){return t.onClickColor(e)}}})])})),0)]):t._e()],1)},staticRenderFns:[]},(function(t){t&&t("data-v-8fc876ba_0",{source:".wrapper[data-v-8fc876ba]{width:260px;margin:0;background:#fff;border-radius:2px;box-shadow:0 0 2px rgba(0,0,0,.3),0 4px 8px rgba(0,0,0,.3);user-select:none}.slider[data-v-8fc876ba]{position:relative;margin-bottom:16px}.slider.hue[data-v-8fc876ba]{background:linear-gradient(-90deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.slider.alpha[data-v-8fc876ba]{margin-top:8px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==) left center}.bar[data-v-8fc876ba]{height:8px;border-radius:4px}.controls[data-v-8fc876ba]{padding:20px 16px;padding-bottom:16px}.modes[data-v-8fc876ba]{display:flex;align-items:center}.mode-input[data-v-8fc876ba]{width:100%;appearance:none;-webkit-appearance:none;font-size:12px;line-height:1.5;text-align:center;text-transform:uppercase;border:none;padding:0;font-family:Inter,Helvetica,Arial,sans-serif;color:#1a202c}.mode-input.select[data-v-8fc876ba]{flex:0 0 42px;margin-right:10px;background-repeat:no-repeat;background-size:6px;background-position:center right;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI2IiB2aWV3Qm94PSIwIDAgOCA2IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMSAxLjQ3MzM5TDQgNC41MjY2Nkw3IDEuNDczMzkiIHN0cm9rZT0iIzlFQjVDOCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=)}.thumb[data-v-8fc876ba]{position:absolute;width:12px;height:12px;top:0;border-radius:50%;margin-top:-1px;transform:translateX(-50%);background-color:#f8f8f8;box-shadow:0 1px 4px 0 rgba(0,0,0,.368627);cursor:default}.saturation[data-v-8fc876ba]{position:relative;width:100%;padding-bottom:55%;overflow:hidden}.saturation>div[data-v-8fc876ba]{position:absolute;top:0;left:0;right:0;bottom:0;margin:0}.saturation>.thumb[data-v-8fc876ba]{background-color:transparent;transform:translate(-50%,-50%);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4)}.mask.white[data-v-8fc876ba]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.mask.black[data-v-8fc876ba]{background:linear-gradient(0deg,#000,transparent)}.suggestions[data-v-8fc876ba]{border-top:1px solid #e2e8f0;padding:20px 16px;padding-top:16px}.suggestions p[data-v-8fc876ba]{margin-top:0;margin-bottom:10px;font-family:Inter,Helvetica,Arial,sans-serif;font-size:12px;line-height:1.5;color:#1a202c}.suggestions ul[data-v-8fc876ba]{display:flex;align-items:center;margin:0;padding:0;list-style:none}.suggestion[data-v-8fc876ba]{width:24px;height:24px;margin:4px;border:1px solid #e2e8f0;border-radius:50%}",map:void 0,media:void 0})}),Or,"data-v-8fc876ba",false,undefined,!1,Ar,void 0,void 0),Er={BOTTOM:"bottom",LEFT:"left",RIGHT:"right",TOP:"top"};const Pr=Cr({render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{ref:"root",staticClass:"popover"},[r("button",{staticClass:"trigger",attrs:{type:"button"},on:{click:t.onToggle}},[r("span",{staticClass:"preview",style:{"background-color":t.value}})]),t._v(" "),r("transition",{attrs:{name:t.currentTransitionName}},[t.isVisible?r("div",{staticClass:"frame",class:t.framePositionClass},[r("color-picker",{attrs:{value:t.value,"with-suggestions":t.withSuggestions},on:{input:t.onInput}})],1):t._e()])],1)},staticRenderFns:[]},(function(t){t&&t("data-v-0f94a0a0_0",{source:".popover[data-v-0f94a0a0]{position:relative}.trigger[data-v-0f94a0a0]{flex:0 0 auto;display:flex;align-items:center;padding:0;background:0 0;border:none;cursor:pointer}.preview[data-v-0f94a0a0]{flex:1 1 auto;display:inline-block;vertical-align:middle;width:32px;height:32px;border:1px solid #e2e8f0;border-radius:50%}.frame[data-v-0f94a0a0]{position:absolute;z-index:10}.frame.bottom[data-v-0f94a0a0]{left:0;top:calc(100% + 12px)}.frame.top[data-v-0f94a0a0]{left:0;bottom:calc(100% + 12px)}.frame.left[data-v-0f94a0a0]{right:calc(100% + 12px);top:50%;transform:translateY(-50%)}.frame.right[data-v-0f94a0a0]{left:calc(100% + 12px);top:50%;transform:translateY(-50%)}.slide-down-enter-active[data-v-0f94a0a0]{animation:slideDown-data-v-0f94a0a0 .25s}.slide-down-leave-to[data-v-0f94a0a0]{animation:slideDown-data-v-0f94a0a0 .25s reverse}@keyframes slideDown-data-v-0f94a0a0{from{transform:translateY(15px);opacity:0}}.slide-up-enter-active[data-v-0f94a0a0]{animation:slideUp-data-v-0f94a0a0 .25s}.slide-up-leave-to[data-v-0f94a0a0]{animation:slideUp-data-v-0f94a0a0 .25s reverse}@keyframes slideUp-data-v-0f94a0a0{from{transform:translateY(-15px);opacity:0}}.slide-left-enter-active[data-v-0f94a0a0]{animation:slideLeft-data-v-0f94a0a0 .25s}.slide-left-leave-to[data-v-0f94a0a0]{animation:slideLeft-data-v-0f94a0a0 .25s reverse}@keyframes slideLeft-data-v-0f94a0a0{from{transform:translateX(-15px) translateY(-50%);opacity:0}}.slide-right-enter-active[data-v-0f94a0a0]{animation:slideRight-data-v-0f94a0a0 .25s}.slide-right-leave-to[data-v-0f94a0a0]{animation:slideRight-data-v-0f94a0a0 .25s reverse}@keyframes slideRight-data-v-0f94a0a0{from{transform:translateX(15px) translateY(-50%);opacity:0}}",map:void 0,media:void 0})}),{name:"VColorPopover",components:{ColorPicker:Mr},props:{value:{type:String,default:"#ff0000"},withSuggestions:{type:Boolean,default:!0},position:{type:String,default:Er.BOTTOM,validator:t=>Object.values(Er).includes(t)}},data:()=>({isVisible:!1}),computed:{currentTransitionName(){switch(this.position){case Er.BOTTOM:return"slide-down";case Er.LEFT:return"slide-left";case Er.RIGHT:return"slide-right";case Er.TOP:return"slide-up"}},framePositionClass(){switch(this.position){case Er.BOTTOM:return"bottom";case Er.LEFT:return"left";case Er.RIGHT:return"right";case Er.TOP:return"top"}}},watch:{isVisible(t){t?document.body.addEventListener("click",this.onClickOutside):document.body.removeEventListener("click",this.onClickOutside)}},created(){window.addEventListener("keypress",this.onKeydown)},beforeDestroy(){window.removeEventListener("keypress",this.onKeydown)},methods:{getElementPath(t){const e=[];let r=t;for(;r!==document.body;)e.unshift(r),r=r.parentElement;return e},onToggle(){this.isVisible=!this.isVisible},onKeydown(t){this.isVisible&&"Escape"===t.code&&(this.isVisible=!1)},onClickOutside(t){(t.path||this.getElementPath(t.target)).includes(this.$refs.root)||(this.isVisible=!1)},onInput(t,e){this.$emit("input",t),e&&(this.isVisible=!1)}}},"data-v-0f94a0a0",false,undefined,!1,Ar,void 0,void 0);t.VColorPicker=Mr,t.VColorPopover=Pr,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VColor={})}(this,(function(t){"use strict";var e=function(t,e,r){return t==t&&(void 0!==r&&(t=t<=r?t:r),void 0!==e&&(t=t>=e?t:e)),t};var r=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var o="object"==typeof n&&n&&n.Object===Object&&n,i="object"==typeof self&&self&&self.Object===Object&&self,s=o||i||Function("return this")(),u=s.Symbol,c=Object.prototype,l=c.hasOwnProperty,d=c.toString,f=u?u.toStringTag:void 0;var p=function(t){var e=l.call(t,f),r=t[f];try{t[f]=void 0;var n=!0}catch(t){}var a=d.call(t);return n&&(e?t[f]=r:delete t[f]),a},h=Object.prototype.toString;var v=function(t){return h.call(t)},g=u?u.toStringTag:void 0;var b=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":g&&g in Object(t)?p(t):v(t)};var m=function(t){return null!=t&&"object"==typeof t};var y=function(t){return"symbol"==typeof t||m(t)&&"[object Symbol]"==b(t)},_=/^\s+|\s+$/g,x=/^[-+]0x[0-9a-f]+$/i,w=/^0b[01]+$/i,j=/^0o[0-7]+$/i,O=parseInt;var C=function(t){if("number"==typeof t)return t;if(y(t))return NaN;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(_,"");var n=w.test(t);return n||j.test(t)?O(t.slice(2),n?2:8):x.test(t)?NaN:+t};var k=function(t,r,n){return void 0===n&&(n=r,r=void 0),void 0!==n&&(n=(n=C(n))==n?n:0),void 0!==r&&(r=(r=C(r))==r?r:0),e(C(t),r,n)},A=function(){return s.Date.now()},T=Math.max,S=Math.min;var M=function(t,e,n){var a,o,i,s,u,c,l=0,d=!1,f=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function h(e){var r=a,n=o;return a=o=void 0,l=e,s=t.apply(n,r)}function v(t){return l=t,u=setTimeout(b,e),d?h(t):s}function g(t){var r=t-c;return void 0===c||r>=e||r<0||f&&t-l>=i}function b(){var t=A();if(g(t))return m(t);u=setTimeout(b,function(t){var r=e-(t-c);return f?S(r,i-(t-l)):r}(t))}function m(t){return u=void 0,p&&a?h(t):(a=o=void 0,s)}function y(){var t=A(),r=g(t);if(a=arguments,o=this,c=t,r){if(void 0===u)return v(c);if(f)return clearTimeout(u),u=setTimeout(b,e),h(c)}return void 0===u&&(u=setTimeout(b,e)),s}return e=C(e)||0,r(n)&&(d=!!n.leading,i=(f="maxWait"in n)?T(C(n.maxWait)||0,e):i,p="trailing"in n?!!n.trailing:p),y.cancel=function(){void 0!==u&&clearTimeout(u),l=0,a=c=o=u=void 0},y.flush=function(){return void 0===u?s:m(A())},y};var E=function(){this.__data__=[],this.size=0};var P=function(t,e){return t===e||t!=t&&e!=e};var I=function(t,e){for(var r=t.length;r--;)if(P(t[r][0],e))return r;return-1},$=Array.prototype.splice;var N=function(t){var e=this.__data__,r=I(e,t);return!(r<0)&&(r==e.length-1?e.pop():$.call(e,r,1),--this.size,!0)};var z=function(t){var e=this.__data__,r=I(e,t);return r<0?void 0:e[r][1]};var V=function(t){return I(this.__data__,t)>-1};var B=function(t,e){var r=this.__data__,n=I(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function R(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}R.prototype.clear=E,R.prototype.delete=N,R.prototype.get=z,R.prototype.has=V,R.prototype.set=B;var L=R;var F=function(){this.__data__=new L,this.size=0};var D=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var U=function(t){return this.__data__.get(t)};var G=function(t){return this.__data__.has(t)};var W,Y=function(t){if(!r(t))return!1;var e=b(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},H=s["__core-js_shared__"],J=(W=/[^.]+$/.exec(H&&H.keys&&H.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"";var Q=function(t){return!!J&&J in t},X=Function.prototype.toString;var Z=function(t){if(null!=t){try{return X.call(t)}catch(t){}try{return t+""}catch(t){}}return""},q=/^\[object .+?Constructor\]$/,K=Function.prototype,tt=Object.prototype,et=K.toString,rt=tt.hasOwnProperty,nt=RegExp("^"+et.call(rt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var at=function(t){return!(!r(t)||Q(t))&&(Y(t)?nt:q).test(Z(t))};var ot=function(t,e){return null==t?void 0:t[e]};var it=function(t,e){var r=ot(t,e);return at(r)?r:void 0},st=it(s,"Map"),ut=it(Object,"create");var ct=function(){this.__data__=ut?ut(null):{},this.size=0};var lt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},dt=Object.prototype.hasOwnProperty;var ft=function(t){var e=this.__data__;if(ut){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return dt.call(e,t)?e[t]:void 0},pt=Object.prototype.hasOwnProperty;var ht=function(t){var e=this.__data__;return ut?void 0!==e[t]:pt.call(e,t)};var vt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ut&&void 0===e?"__lodash_hash_undefined__":e,this};function gt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}gt.prototype.clear=ct,gt.prototype.delete=lt,gt.prototype.get=ft,gt.prototype.has=ht,gt.prototype.set=vt;var bt=gt;var mt=function(){this.size=0,this.__data__={hash:new bt,map:new(st||L),string:new bt}};var yt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var _t=function(t,e){var r=t.__data__;return yt(e)?r["string"==typeof e?"string":"hash"]:r.map};var xt=function(t){var e=_t(this,t).delete(t);return this.size-=e?1:0,e};var wt=function(t){return _t(this,t).get(t)};var jt=function(t){return _t(this,t).has(t)};var Ot=function(t,e){var r=_t(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Ct(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ct.prototype.clear=mt,Ct.prototype.delete=xt,Ct.prototype.get=wt,Ct.prototype.has=jt,Ct.prototype.set=Ot;var kt=Ct;var At=function(t,e){var r=this.__data__;if(r instanceof L){var n=r.__data__;if(!st||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new kt(n)}return r.set(t,e),this.size=r.size,this};function Tt(t){var e=this.__data__=new L(t);this.size=e.size}Tt.prototype.clear=F,Tt.prototype.delete=D,Tt.prototype.get=U,Tt.prototype.has=G,Tt.prototype.set=At;var St=Tt;var Mt=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var Et=function(t){return this.__data__.has(t)};function Pt(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new kt;++e<r;)this.add(t[e])}Pt.prototype.add=Pt.prototype.push=Mt,Pt.prototype.has=Et;var It=Pt;var $t=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1};var Nt=function(t,e){return t.has(e)};var zt=function(t,e,r,n,a,o){var i=1&r,s=t.length,u=e.length;if(s!=u&&!(i&&u>s))return!1;var c=o.get(t),l=o.get(e);if(c&&l)return c==e&&l==t;var d=-1,f=!0,p=2&r?new It:void 0;for(o.set(t,e),o.set(e,t);++d<s;){var h=t[d],v=e[d];if(n)var g=i?n(v,h,d,e,t,o):n(h,v,d,t,e,o);if(void 0!==g){if(g)continue;f=!1;break}if(p){if(!$t(e,(function(t,e){if(!Nt(p,e)&&(h===t||a(h,t,r,n,o)))return p.push(e)}))){f=!1;break}}else if(h!==v&&!a(h,v,r,n,o)){f=!1;break}}return o.delete(t),o.delete(e),f},Vt=s.Uint8Array;var Bt=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var Rt=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},Lt=u?u.prototype:void 0,Ft=Lt?Lt.valueOf:void 0;var Dt=function(t,e,r,n,a,o,i){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new Vt(t),new Vt(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return P(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var s=Bt;case"[object Set]":var u=1&n;if(s||(s=Rt),t.size!=e.size&&!u)return!1;var c=i.get(t);if(c)return c==e;n|=2,i.set(t,e);var l=zt(s(t),s(e),n,a,o,i);return i.delete(t),l;case"[object Symbol]":if(Ft)return Ft.call(t)==Ft.call(e)}return!1};var Ut=function(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t},Gt=Array.isArray;var Wt=function(t,e,r){var n=e(t);return Gt(t)?n:Ut(n,r(t))};var Yt=function(t,e){for(var r=-1,n=null==t?0:t.length,a=0,o=[];++r<n;){var i=t[r];e(i,r,t)&&(o[a++]=i)}return o};var Ht=function(){return[]},Jt=Object.prototype.propertyIsEnumerable,Qt=Object.getOwnPropertySymbols,Xt=Qt?function(t){return null==t?[]:(t=Object(t),Yt(Qt(t),(function(e){return Jt.call(t,e)})))}:Ht;var Zt=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var qt=function(t){return m(t)&&"[object Arguments]"==b(t)},Kt=Object.prototype,te=Kt.hasOwnProperty,ee=Kt.propertyIsEnumerable,re=qt(function(){return arguments}())?qt:function(t){return m(t)&&te.call(t,"callee")&&!ee.call(t,"callee")};var ne=function(){return!1},ae=a((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,a=n&&n.exports===r?s.Buffer:void 0,o=(a?a.isBuffer:void 0)||ne;t.exports=o})),oe=/^(?:0|[1-9]\d*)$/;var ie=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&oe.test(t))&&t>-1&&t%1==0&&t<e};var se=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},ue={};ue["[object Float32Array]"]=ue["[object Float64Array]"]=ue["[object Int8Array]"]=ue["[object Int16Array]"]=ue["[object Int32Array]"]=ue["[object Uint8Array]"]=ue["[object Uint8ClampedArray]"]=ue["[object Uint16Array]"]=ue["[object Uint32Array]"]=!0,ue["[object Arguments]"]=ue["[object Array]"]=ue["[object ArrayBuffer]"]=ue["[object Boolean]"]=ue["[object DataView]"]=ue["[object Date]"]=ue["[object Error]"]=ue["[object Function]"]=ue["[object Map]"]=ue["[object Number]"]=ue["[object Object]"]=ue["[object RegExp]"]=ue["[object Set]"]=ue["[object String]"]=ue["[object WeakMap]"]=!1;var ce=function(t){return m(t)&&se(t.length)&&!!ue[b(t)]};var le=function(t){return function(e){return t(e)}},de=a((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,a=n&&n.exports===r&&o.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=i})),fe=de&&de.isTypedArray,pe=fe?le(fe):ce,he=Object.prototype.hasOwnProperty;var ve=function(t,e){var r=Gt(t),n=!r&&re(t),a=!r&&!n&&ae(t),o=!r&&!n&&!a&&pe(t),i=r||n||a||o,s=i?Zt(t.length,String):[],u=s.length;for(var c in t)!e&&!he.call(t,c)||i&&("length"==c||a&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ie(c,u))||s.push(c);return s},ge=Object.prototype;var be=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ge)};var me=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),ye=Object.prototype.hasOwnProperty;var _e=function(t){if(!be(t))return me(t);var e=[];for(var r in Object(t))ye.call(t,r)&&"constructor"!=r&&e.push(r);return e};var xe=function(t){return null!=t&&se(t.length)&&!Y(t)};var we=function(t){return xe(t)?ve(t):_e(t)};var je=function(t){return Wt(t,we,Xt)},Oe=Object.prototype.hasOwnProperty;var Ce=function(t,e,r,n,a,o){var i=1&r,s=je(t),u=s.length;if(u!=je(e).length&&!i)return!1;for(var c=u;c--;){var l=s[c];if(!(i?l in e:Oe.call(e,l)))return!1}var d=o.get(t),f=o.get(e);if(d&&f)return d==e&&f==t;var p=!0;o.set(t,e),o.set(e,t);for(var h=i;++c<u;){var v=t[l=s[c]],g=e[l];if(n)var b=i?n(g,v,l,e,t,o):n(v,g,l,t,e,o);if(!(void 0===b?v===g||a(v,g,r,n,o):b)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var m=t.constructor,y=e.constructor;m==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y||(p=!1)}return o.delete(t),o.delete(e),p},ke=it(s,"DataView"),Ae=it(s,"Promise"),Te=it(s,"Set"),Se=it(s,"WeakMap"),Me="[object Map]",Ee="[object Promise]",Pe="[object Set]",Ie="[object WeakMap]",$e="[object DataView]",Ne=Z(ke),ze=Z(st),Ve=Z(Ae),Be=Z(Te),Re=Z(Se),Le=b;(ke&&Le(new ke(new ArrayBuffer(1)))!=$e||st&&Le(new st)!=Me||Ae&&Le(Ae.resolve())!=Ee||Te&&Le(new Te)!=Pe||Se&&Le(new Se)!=Ie)&&(Le=function(t){var e=b(t),r="[object Object]"==e?t.constructor:void 0,n=r?Z(r):"";if(n)switch(n){case Ne:return $e;case ze:return Me;case Ve:return Ee;case Be:return Pe;case Re:return Ie}return e});var Fe=Le,De="[object Arguments]",Ue="[object Array]",Ge="[object Object]",We=Object.prototype.hasOwnProperty;var Ye=function(t,e,r,n,a,o){var i=Gt(t),s=Gt(e),u=i?Ue:Fe(t),c=s?Ue:Fe(e),l=(u=u==De?Ge:u)==Ge,d=(c=c==De?Ge:c)==Ge,f=u==c;if(f&&ae(t)){if(!ae(e))return!1;i=!0,l=!1}if(f&&!l)return o||(o=new St),i||pe(t)?zt(t,e,r,n,a,o):Dt(t,e,u,r,n,a,o);if(!(1&r)){var p=l&&We.call(t,"__wrapped__"),h=d&&We.call(e,"__wrapped__");if(p||h){var v=p?t.value():t,g=h?e.value():e;return o||(o=new St),a(v,g,r,n,o)}}return!!f&&(o||(o=new St),Ce(t,e,r,n,a,o))};var He=function t(e,r,n,a,o){return e===r||(null==e||null==r||!m(e)&&!m(r)?e!=e&&r!=r:Ye(e,r,n,a,t,o))};var Je=function(t,e){return He(t,e)},Qe=function(t,e,r,n,a,o,i,s){if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,a,o,i,s],l=0;(u=new Error(e.replace(/%s/g,(function(){return c[l++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}},Xe=Object.getOwnPropertySymbols,Ze=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable;function Ke(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var tr=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,n,a=Ke(t),o=1;o<arguments.length;o++){for(var i in r=Object(arguments[o]))Ze.call(r,i)&&(a[i]=r[i]);if(Xe){n=Xe(r);for(var s=0;s<n.length;s++)qe.call(r,n[s])&&(a[n[s]]=r[n[s]])}}return a},er=/-?\d+(\.\d+)?%?/g;var rr=function(t){return t.match(er)};var nr=function(t,e,r){return Math.min(Math.max(t,e),r)};function ar(t,e){switch(t=parseFloat(t),e){case 0:return nr(t,0,360);case 1:case 2:return nr(t,0,100);case 3:return nr(t,0,1)}}var or=function(t){return rr(t).map(ar)};var ir=function(t){4!==t.length&&5!==t.length||(t=function(t){for(var e="#",r=1;r<t.length;r++){var n=t.charAt(r);e+=n+n}return e}(t));var e=[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16)];if(9===t.length){var r=parseFloat((parseInt(t.substring(7,9),16)/255).toFixed(2));e.push(r)}return e};function sr(t,e){return e<3?-1!=t.indexOf("%")?Math.round(255*nr(parseInt(t,10),0,100)/100):nr(parseInt(t,10),0,255):nr(parseFloat(t),0,1)}var ur=function(t){return rr(t).map(sr)};var cr=function(t){var e,r,n,a,o,i=t[0]/360,s=t[1]/100,u=t[2]/100;if(0==s)return[o=255*u,o,o];e=2*u-(r=u<.5?u*(1+s):u+s-u*s),a=[0,0,0];for(var c=0;c<3;c++)(n=i+1/3*-(c-1))<0&&n++,n>1&&n--,o=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,a[c]=255*o;return a};var lr={"#":ir,hsl:function(t){var e=or(t),r=cr(e);return 4===e.length&&r.push(e[3]),r},rgb:ur};function dr(t){for(var e in lr)if(0===t.indexOf(e))return lr[e](t)}dr.rgb=ur,dr.hsl=or,dr.hex=ir;var fr=dr;var pr=function(t){var e,r,n=t[0],a=t[1],o=t[2],i=Math.min(n,a,o),s=Math.max(n,a,o),u=s-i;return r=0==s?0:u/s*1e3/10,s==i?e=0:n==s?e=(a-o)/u:a==s?e=2+(o-n)/u:o==s&&(e=4+(n-a)/u),(e=Math.min(60*e,360))<0&&(e+=360),[e,r,s/255*1e3/10]};function hr(t){var e=Math.round(nr(t,0,255)).toString(16);return 1==e.length?"0"+e:e}var vr=function(t){var e=4===t.length?hr(255*t[3]):"";return"#"+hr(t[0])+hr(t[1])+hr(t[2])+e};var gr=function(t){var e,r,n=t[0],a=t[1]/100,o=t[2]/100;return e=a*o,[n,100*(e=(e/=(r=(2-a)*o)<=1?r:2-r)||0),100*(r/=2)]};var br=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),i=255*n*(1-r),s=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,a){case 0:return[n,u,i];case 1:return[s,n,i];case 2:return[i,n,u];case 3:return[i,s,n];case 4:return[u,i,n];case 5:return[n,i,s]}};var mr=function(t,e,n){var a=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return r(n)&&(a="leading"in n?!!n.leading:a,o="trailing"in n?!!n.trailing:o),M(t,e,{leading:a,maxWait:e,trailing:o})},yr={name:"v-ctrl",abstract:!0,props:{direction:{type:String,default:"h",validator:function(t){return["v","h","vh","hv"].indexOf(t)>-1}},throttle:{type:Number,default:80},precision:{type:Number}},methods:{msdown:function(t){t.preventDefault(),document.addEventListener("mousemove",this.msmove),document.addEventListener("mouseup",this.msup),this.next(t)},msmove:function(t){t.preventDefault(),this.next(t)},msup:function(t){this.next(t),document.removeEventListener("mousemove",this.msmove),document.removeEventListener("mouseup",this.msup)},notify:function(t){!1===Je(this.memo,t)&&(this.memo=t,this.$emit("change",t))},next:function(t){void 0===t&&(t={});var e=t.clientX;void 0===e&&(e=0);var r=t.clientY;void 0===r&&(r=0);var n=this.direction,a=this.adjust,o=this.$el.getBoundingClientRect(),i=a((e-o.left)/o.width);if("h"===n)return this.notify(i);var s=a((r-o.top)/o.height);if("v"===n)return this.notify(s);this.notify([i,s])},adjust:function(t){return function(t,e){var r=0|e;return r>0?parseFloat(t.toFixed(r)):t}(k(t,0,1),this.precision)}},render:function(t){return this.$slots.default[0]},created:function(){var t=this.msdown,e=this.msmove;this.msdown=t.bind(this),this.msmove=mr(e.bind(this),this.throttle),this.memo=null},mounted:function(){this.$el.addEventListener("mousedown",this.msdown)},destroyed:function(){this.$el.removeEventListener("mousedown",this.msdown)},install:function(){Vue.component(yr.name,yr)}};"undefined"!=typeof window&&window.Vue&&Vue.use(yr);var _r={VueCtrlComponent:yr};const xr=Object.freeze({rgba:["r","g","b","a"],hsla:["h","s","l","a"],hex:["hex"]});function wr(t,e=3){return(100*t).toPrecision(0|e)+"%"}function jr(t){return t.replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3([0-9a-f]?)\4$/,"#$1$2$3$4")}var Or={name:"VColorPicker",props:{value:{type:String,default:"#ff0000"},withSuggestions:{type:Boolean,default:!0}},components:{"v-ctrl":_r.VueCtrlComponent},data(){const{value:t}=this,e={type:"number",maxlength:3},r={type:"string",maxlength:4};return{...this.digestProp(t),suggestions:[],currentMode:(n=t,"#"===n[0]?"hex":0===n.indexOf("rgb")?"rgba":0===n.indexOf("hsl")?"hsla":void Qe(!1,n+" is not valid color value!")),colorModes:xr,colorModel:{hex:"",r:"",g:"",b:"",h:"",s:"",l:"",a:""},constrains:{r:e,g:e,b:e,h:e,s:r,l:r,a:{type:"number",maxlength:4},hex:{type:"string",maxlength:9}}};var n},watch:{value:{immediate:!0,handler(t,e){t!==e&&tr(this,this.digestProp(t))}}},computed:{hsva(){const{hue:t,alpha:e,saturation:{x:r,y:n}}=this;return[360*t,100*r,100*(1-n),e]},rgba(){const{alpha:t,hsva:e}=this,[r,n,a]=br(e);return[Math.round(r),Math.round(n),Math.round(a),t]},hsla(){const{alpha:t,hsva:e}=this,[r,n,a]=gr(e);return[Math.round(r),Math.round(n)+"%",Math.round(a)+"%",t]},hex(){return vr(this.rgba)},previewBorderColor(){const[t,e,r]=this.rgba;return(t+e+r)/3>235?"rgba(160,160,160,0.8)":"transparent"},styles(){const{rgba:t,alpha:e,hue:r,saturation:n}=this,a=t.slice(0,3).join(", "),o=cr([360*r,100,50]).map((t=>Math.round(t))).join(", ");return{preview:{backgroundColor:`rgba(${t.join(", ")})`,borderColor:this.previewBorderColor},saturationPane:{backgroundColor:`rgb(${o})`},saturationThumb:{left:wr(n.x),top:wr(n.y)},alphaTrack:{backgroundImage:`linear-gradient(to right, rgba(${a}, 0) 0%, rgb(${a}) 100%)`},alphaThumb:{left:wr(e)},hueThumb:{left:wr(1-r)}}}},methods:{digestProp(t){const e=fr(t),r=null==e[3]?1:e[3],[n,a,o]=pr(e);return{alpha:parseFloat(r.toFixed(2)),hue:n/360,saturation:{x:a/100,y:1-o/100}}},onSaturationChange([t,e]){this.saturation={x:t,y:e},this.emitChange()},onHueChange(t){this.hue=1-t,this.emitChange()},onAlphaChange(t){this.alpha=parseFloat(t.toFixed(2)),this.emitChange()},emitChange(){const{hex:t,rgba:e,hsla:r,currentMode:n}=this;if(this.updateColorModel(),"hex"===n)this.updateSuggestions(t),this.$emit("input",t);else if("hsla"===n){const t=`hsla(${r.join(",")})`;this.updateSuggestions(t),this.$emit("input",t)}else if("rgba"===n){const t=`rgba(${e.join(",")})`;this.updateSuggestions(t),this.$emit("input",t)}},onClickColor(t){this.$emit("input",t,!0)},handleInput(t,e){const{currentMode:r,colorModel:n}=this,{target:{value:a}}=e;let o=Number(a),i=!1;switch(t){case"a":n[t]===o||isNaN(o)||(n[t]=k(o,0,1),i=!0);break;case"r":case"g":case"b":n[t]===o||isNaN(o)||(n[t]=0|k(o,0,255),i=!0);break;case"h":n[t]===o||isNaN(o)||(n[t]=0|k(o,0,360),i=!0);break;case"s":case"l":"%"===a.slice(-1)&&n[t]!==a&&(o=parseFloat(a),n[t]=(0|k(o,0,360))+"%",i=!0);break;case"hex":"#"===a[0]&&n[t]!==a&&fr(a).every((t=>!isNaN(t)))&&(n[t]=jr(a),i=!0)}if(!i)return;const{h:s,s:u,l:c,r:l,g:d,b:f,a:p,hex:h}=n;let v=h;"rgba"===r?v=`rgba(${[l,d,f,p]})`:"hsla"===r&&(v=`hsla(${[s,u,c,p]})`),tr(this,this.digestProp(v)),this.emitChange()},updateColorModel(){const{hsla:t,rgba:e,hex:r,alpha:n}=this,[a,o,i]=t,[s,u,c]=e,l=jr(1===n?r.slice(0,7):r);tr(this.colorModel,{r:s,g:u,b:c,h:a,s:o,l:i,a:n,hex:l})},loadSuggestions(){const t=localStorage.getItem("V_COLOR_PICKER_SUGGESTIONS");if(!t)return[];this.suggestions=JSON.parse(t)},updateSuggestions(t){if(this.suggestions.includes(t))return;let e;e=this.suggestions.length<7?this.suggestions.concat(t):this.suggestions.slice(1,7).concat(t),this.suggestions=e,localStorage.setItem("V_COLOR_PICKER_SUGGESTIONS",JSON.stringify(e))}},created(){this.handleInput=M(this.handleInput.bind(this),250),this.emitChange=M(this.emitChange.bind(this),250),this.updateColorModel(),this.loadSuggestions()}};function Cr(t,e,r,n,a,o,i,s,u,c){"boolean"!=typeof i&&(u=s,s=i,i=!1);const l="function"==typeof r?r.options:r;let d;if(t&&t.render&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,a&&(l.functional=!0)),n&&(l._scopeId=n),o?(d=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,u(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},l._ssrRegister=d):e&&(d=i?function(t){e.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),d)if(l.functional){const t=l.render;l.render=function(e,r){return d.call(r),t(e,r)}}else{const t=l.beforeCreate;l.beforeCreate=t?[].concat(t,d):[d]}return r}const kr="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function Ar(t){return(t,e)=>function(t,e){const r=kr?e.media||"default":t,n=Sr[r]||(Sr[r]={ids:new Set,styles:[]});if(!n.ids.has(t)){n.ids.add(t);let r=e.source;if(e.map&&(r+="\n/*# sourceURL="+e.map.sources[0]+" */",r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),n.element||(n.element=document.createElement("style"),n.element.type="text/css",e.media&&n.element.setAttribute("media",e.media),void 0===Tr&&(Tr=document.head||document.getElementsByTagName("head")[0]),Tr.appendChild(n.element)),"styleSheet"in n.element)n.styles.push(r),n.element.styleSheet.cssText=n.styles.filter(Boolean).join("\n");else{const t=n.ids.size-1,e=document.createTextNode(r),a=n.element.childNodes;a[t]&&n.element.removeChild(a[t]),a.length?n.element.insertBefore(e,a[t]):n.element.appendChild(e)}}}(t,e)}let Tr;const Sr={};const Mr=Cr({render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"wrapper"},[r("v-ctrl",{attrs:{direction:"vh",precision:2,throttle:80},on:{change:t.onSaturationChange}},[r("div",{staticClass:"saturation"},[r("div",{staticClass:"mask hue",style:t.styles.saturationPane}),t._v(" "),r("div",{staticClass:"mask white"}),t._v(" "),r("div",{staticClass:"mask black"}),t._v(" "),r("p",{staticClass:"thumb",style:t.styles.saturationThumb})])]),t._v(" "),r("section",{staticClass:"controls"},[r("section",{staticClass:"sliders"},[r("v-ctrl",{attrs:{direction:"h",precision:2,throttle:80},on:{change:t.onHueChange}},[r("div",{staticClass:"slider bar hue"},[r("div",{staticClass:"thumb",style:t.styles.hueThumb})])]),t._v(" "),r("v-ctrl",{attrs:{direction:"h",precision:2,throttle:80},on:{change:t.onAlphaChange}},[r("div",{staticClass:"slider alpha"},[r("div",{staticClass:"thumb",style:t.styles.alphaThumb}),t._v(" "),r("div",{staticClass:"bar",style:t.styles.alphaTrack})])])],1),t._v(" "),r("section",{staticClass:"modes"},[r("select",{directives:[{name:"model",rawName:"v-model",value:t.currentMode,expression:"currentMode"}],staticClass:"mode-input select",on:{change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.currentMode=e.target.multiple?r:r[0]}}},t._l(t.colorModes,(function(e,n){return r("option",{key:n,domProps:{value:n}},[t._v("\n "+t._s(n)+"\n ")])})),0),t._v(" "),t._l(t.colorModes[t.currentMode],(function(e){return r("input",{key:e,staticClass:"mode-input",attrs:{type:t.constrains[e].type,maxlength:t.constrains[e].maxlength},domProps:{value:t.colorModel[e]},on:{input:function(r){return t.handleInput(e,r)}}})}))],2)]),t._v(" "),t.withSuggestions&&t.suggestions.length>0?r("section",{staticClass:"suggestions"},[r("p",[t._v("Previously used colors")]),t._v(" "),r("ul",t._l(t.suggestions,(function(e){return r("li",{key:e},[r("button",{staticClass:"suggestion",style:{backgroundColor:e},attrs:{type:"button"},on:{click:function(r){return t.onClickColor(e)}}})])})),0)]):t._e()],1)},staticRenderFns:[]},(function(t){t&&t("data-v-8fc876ba_0",{source:".wrapper[data-v-8fc876ba]{width:260px;margin:0;background:#fff;border-radius:2px;box-shadow:0 0 2px rgba(0,0,0,.3),0 4px 8px rgba(0,0,0,.3);user-select:none}.slider[data-v-8fc876ba]{position:relative;margin-bottom:16px}.slider.hue[data-v-8fc876ba]{background:linear-gradient(-90deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.slider.alpha[data-v-8fc876ba]{margin-top:8px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==) left center}.bar[data-v-8fc876ba]{height:8px;border-radius:4px}.controls[data-v-8fc876ba]{padding:20px 16px;padding-bottom:16px}.modes[data-v-8fc876ba]{display:flex;align-items:center}.mode-input[data-v-8fc876ba]{width:100%;appearance:none;-webkit-appearance:none;font-size:12px;line-height:1.5;text-align:center;text-transform:uppercase;border:none;padding:0;font-family:Inter,Helvetica,Arial,sans-serif;color:#1a202c}.mode-input.select[data-v-8fc876ba]{flex:0 0 42px;margin-right:10px;background-repeat:no-repeat;background-size:6px;background-position:center right;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI2IiB2aWV3Qm94PSIwIDAgOCA2IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMSAxLjQ3MzM5TDQgNC41MjY2Nkw3IDEuNDczMzkiIHN0cm9rZT0iIzlFQjVDOCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=)}.thumb[data-v-8fc876ba]{position:absolute;width:12px;height:12px;top:0;border-radius:50%;margin-top:-1px;transform:translateX(-50%);background-color:#f8f8f8;box-shadow:0 1px 4px 0 rgba(0,0,0,.368627);cursor:default}.saturation[data-v-8fc876ba]{position:relative;width:100%;padding-bottom:55%;overflow:hidden}.saturation>div[data-v-8fc876ba]{position:absolute;top:0;left:0;right:0;bottom:0;margin:0}.saturation>.thumb[data-v-8fc876ba]{background-color:transparent;transform:translate(-50%,-50%);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4)}.mask.white[data-v-8fc876ba]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.mask.black[data-v-8fc876ba]{background:linear-gradient(0deg,#000,transparent)}.suggestions[data-v-8fc876ba]{border-top:1px solid #e2e8f0;padding:20px 16px;padding-top:16px}.suggestions p[data-v-8fc876ba]{margin-top:0;margin-bottom:10px;font-family:Inter,Helvetica,Arial,sans-serif;font-size:12px;line-height:1.5;color:#1a202c}.suggestions ul[data-v-8fc876ba]{display:flex;align-items:center;margin:0;padding:0;list-style:none}.suggestion[data-v-8fc876ba]{width:24px;height:24px;margin:4px;border:1px solid #e2e8f0;border-radius:50%}",map:void 0,media:void 0})}),Or,"data-v-8fc876ba",false,undefined,!1,Ar,void 0,void 0),Er={BOTTOM:"bottom",LEFT:"left",RIGHT:"right",TOP:"top"};const Pr=Cr({render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{ref:"root",staticClass:"popover"},[r("button",{staticClass:"trigger",attrs:{type:"button"},on:{click:t.onToggle}},[r("span",{staticClass:"preview",style:{"background-color":t.value}})]),t._v(" "),r("transition",{attrs:{name:t.currentTransitionName}},[t.isVisible?r("div",{staticClass:"frame",class:t.framePositionClass},[r("color-picker",{attrs:{value:t.value,"with-suggestions":t.withSuggestions},on:{input:t.onInput}})],1):t._e()])],1)},staticRenderFns:[]},(function(t){t&&t("data-v-65ed649e_0",{source:".popover[data-v-65ed649e]{position:relative}.trigger[data-v-65ed649e]{flex:0 0 auto;display:flex;align-items:center;padding:0;background:0 0;border:none;cursor:pointer}.preview[data-v-65ed649e]{flex:1 1 auto;display:inline-block;vertical-align:middle;width:32px;height:32px;border:1px solid #e2e8f0;border-radius:50%}.frame[data-v-65ed649e]{position:absolute;z-index:10}.frame.bottom[data-v-65ed649e]{left:0;top:calc(100% + 12px)}.frame.top[data-v-65ed649e]{left:0;bottom:calc(100% + 12px)}.frame.left[data-v-65ed649e]{right:calc(100% + 12px);top:50%;transform:translateY(-50%)}.frame.right[data-v-65ed649e]{left:calc(100% + 12px);top:50%;transform:translateY(-50%)}.slide-down-enter-active[data-v-65ed649e]{animation:slideDown-data-v-65ed649e .25s}.slide-down-leave-to[data-v-65ed649e]{animation:slideDown-data-v-65ed649e .25s reverse}@keyframes slideDown-data-v-65ed649e{from{transform:translateY(15px);opacity:0}}.slide-up-enter-active[data-v-65ed649e]{animation:slideUp-data-v-65ed649e .25s}.slide-up-leave-to[data-v-65ed649e]{animation:slideUp-data-v-65ed649e .25s reverse}@keyframes slideUp-data-v-65ed649e{from{transform:translateY(-15px);opacity:0}}.slide-left-enter-active[data-v-65ed649e]{animation:slideLeft-data-v-65ed649e .25s}.slide-left-leave-to[data-v-65ed649e]{animation:slideLeft-data-v-65ed649e .25s reverse}@keyframes slideLeft-data-v-65ed649e{from{transform:translateX(-15px) translateY(-50%);opacity:0}}.slide-right-enter-active[data-v-65ed649e]{animation:slideRight-data-v-65ed649e .25s}.slide-right-leave-to[data-v-65ed649e]{animation:slideRight-data-v-65ed649e .25s reverse}@keyframes slideRight-data-v-65ed649e{from{transform:translateX(15px) translateY(-50%);opacity:0}}",map:void 0,media:void 0})}),{name:"VColorPopover",components:{ColorPicker:Mr},props:{value:{type:String,default:"#ff0000"},withSuggestions:{type:Boolean,default:!0},position:{type:String,default:Er.BOTTOM,validator:t=>Object.values(Er).includes(t)}},data:()=>({isVisible:!1}),computed:{currentTransitionName(){switch(this.position){case Er.BOTTOM:return"slide-down";case Er.LEFT:return"slide-left";case Er.RIGHT:return"slide-right";case Er.TOP:return"slide-up"}},framePositionClass(){switch(this.position){case Er.BOTTOM:return"bottom";case Er.LEFT:return"left";case Er.RIGHT:return"right";case Er.TOP:return"top"}}},watch:{isVisible(t){t?document.body.addEventListener("click",this.onClickOutside):document.body.removeEventListener("click",this.onClickOutside)}},created(){document.addEventListener("keyup",this.onKeydown)},beforeDestroy(){document.removeEventListener("keyup",this.onKeydown)},methods:{getElementPath(t){const e=[];let r=t;for(;r!==document.body;)e.unshift(r),r=r.parentElement;return e},onToggle(){this.isVisible=!this.isVisible},onKeydown(t){this.isVisible&&"Escape"===t.code&&(this.isVisible=!1)},onClickOutside(t){(t.path||this.getElementPath(t.target)).includes(this.$refs.root)||(this.isVisible=!1)},onInput(t,e){this.$emit("input",t),e&&(this.isVisible=!1)}}},"data-v-65ed649e",false,undefined,!1,Ar,void 0,void 0);t.VColorPicker=Mr,t.VColorPopover=Pr,Object.defineProperty(t,"__esModule",{value:!0})}));

@@ -1,1 +0,1 @@

import t from"lodash/clamp";import e from"lodash/debounce";import a from"lodash/isEqual";import n from"lodash/throttle";var i=function(t,e,a,n,i,r,s,o){if(!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[a,n,i,r,s,o],c=0;(l=new Error(e.replace(/%s/g,(function(){return d[c++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}},r=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function l(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var d=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},a=0;a<10;a++)e["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var a,n,i=l(t),d=1;d<arguments.length;d++){for(var c in a=Object(arguments[d]))s.call(a,c)&&(i[c]=a[c]);if(r){n=r(a);for(var u=0;u<n.length;u++)o.call(a,n[u])&&(i[n[u]]=a[n[u]])}}return i},c=/-?\d+(\.\d+)?%?/g;var u=function(t){return t.match(c)};var h=function(t,e,a){return Math.min(Math.max(t,e),a)};function p(t,e){switch(t=parseFloat(t),e){case 0:return h(t,0,360);case 1:case 2:return h(t,0,100);case 3:return h(t,0,1)}}var f=function(t){return u(t).map(p)};var g=function(t){4!==t.length&&5!==t.length||(t=function(t){for(var e="#",a=1;a<t.length;a++){var n=t.charAt(a);e+=n+n}return e}(t));var e=[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16)];if(9===t.length){var a=parseFloat((parseInt(t.substring(7,9),16)/255).toFixed(2));e.push(a)}return e};function m(t,e){return e<3?-1!=t.indexOf("%")?Math.round(255*h(parseInt(t,10),0,100)/100):h(parseInt(t,10),0,255):h(parseFloat(t),0,1)}var v=function(t){return u(t).map(m)};var b=function(t){var e,a,n,i,r,s=t[0]/360,o=t[1]/100,l=t[2]/100;if(0==o)return[r=255*l,r,r];e=2*l-(a=l<.5?l*(1+o):l+o-l*o),i=[0,0,0];for(var d=0;d<3;d++)(n=s+1/3*-(d-1))<0&&n++,n>1&&n--,r=6*n<1?e+6*(a-e)*n:2*n<1?a:3*n<2?e+(a-e)*(2/3-n)*6:e,i[d]=255*r;return i};var x={"#":g,hsl:function(t){var e=f(t),a=b(e);return 4===e.length&&a.push(e[3]),a},rgb:v};function y(t){for(var e in x)if(0===t.indexOf(e))return x[e](t)}y.rgb=v,y.hsl=f,y.hex=g;var C=y;var w=function(t){var e,a,n=t[0],i=t[1],r=t[2],s=Math.min(n,i,r),o=Math.max(n,i,r),l=o-s;return a=0==o?0:l/o*1e3/10,o==s?e=0:n==o?e=(i-r)/l:i==o?e=2+(r-n)/l:r==o&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),[e,a,o/255*1e3/10]};function k(t){var e=Math.round(h(t,0,255)).toString(16);return 1==e.length?"0"+e:e}var O=function(t){var e=4===t.length?k(255*t[3]):"";return"#"+k(t[0])+k(t[1])+k(t[2])+e};var _=function(t){var e,a,n=t[0],i=t[1]/100,r=t[2]/100;return e=i*r,[n,100*(e=(e/=(a=(2-i)*r)<=1?a:2-a)||0),100*(a/=2)]};var A=function(t){var e=t[0]/60,a=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,r=e-Math.floor(e),s=255*n*(1-a),o=255*n*(1-a*r),l=255*n*(1-a*(1-r));switch(n*=255,i){case 0:return[n,l,s];case 1:return[o,n,s];case 2:return[s,n,l];case 3:return[s,o,n];case 4:return[l,s,n];case 5:return[n,s,o]}},M={name:"v-ctrl",abstract:!0,props:{direction:{type:String,default:"h",validator:function(t){return["v","h","vh","hv"].indexOf(t)>-1}},throttle:{type:Number,default:80},precision:{type:Number}},methods:{msdown:function(t){t.preventDefault(),document.addEventListener("mousemove",this.msmove),document.addEventListener("mouseup",this.msup),this.next(t)},msmove:function(t){t.preventDefault(),this.next(t)},msup:function(t){this.next(t),document.removeEventListener("mousemove",this.msmove),document.removeEventListener("mouseup",this.msup)},notify:function(t){!1===a(this.memo,t)&&(this.memo=t,this.$emit("change",t))},next:function(t){void 0===t&&(t={});var e=t.clientX;void 0===e&&(e=0);var a=t.clientY;void 0===a&&(a=0);var n=this.direction,i=this.adjust,r=this.$el.getBoundingClientRect(),s=i((e-r.left)/r.width);if("h"===n)return this.notify(s);var o=i((a-r.top)/r.height);if("v"===n)return this.notify(o);this.notify([s,o])},adjust:function(e){return function(t,e){var a=0|e;return a>0?parseFloat(t.toFixed(a)):t}(t(e,0,1),this.precision)}},render:function(t){return this.$slots.default[0]},created:function(){var t=this.msdown,e=this.msmove;this.msdown=t.bind(this),this.msmove=n(e.bind(this),this.throttle),this.memo=null},mounted:function(){this.$el.addEventListener("mousedown",this.msdown)},destroyed:function(){this.$el.removeEventListener("mousedown",this.msdown)},install:function(){Vue.component(M.name,M)}};"undefined"!=typeof window&&window.Vue&&Vue.use(M);var S={VueCtrlComponent:M};const I=Object.freeze({rgba:["r","g","b","a"],hsla:["h","s","l","a"],hex:["hex"]});function T(t,e=3){return(100*t).toPrecision(0|e)+"%"}function E(t){return t.replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3([0-9a-f]?)\4$/,"#$1$2$3$4")}var P={name:"VColorPicker",props:{value:{type:String,default:"#ff0000"},withSuggestions:{type:Boolean,default:!0}},components:{"v-ctrl":S.VueCtrlComponent},data(){const{value:t}=this,e={type:"number",maxlength:3},a={type:"string",maxlength:4};return{...this.digestProp(t),suggestions:[],currentMode:(n=t,"#"===n[0]?"hex":0===n.indexOf("rgb")?"rgba":0===n.indexOf("hsl")?"hsla":void i(!1,n+" is not valid color value!")),colorModes:I,colorModel:{hex:"",r:"",g:"",b:"",h:"",s:"",l:"",a:""},constrains:{r:e,g:e,b:e,h:e,s:a,l:a,a:{type:"number",maxlength:4},hex:{type:"string",maxlength:9}}};var n},watch:{value:{immediate:!0,handler(t,e){t!==e&&d(this,this.digestProp(t))}}},computed:{hsva(){const{hue:t,alpha:e,saturation:{x:a,y:n}}=this;return[360*t,100*a,100*(1-n),e]},rgba(){const{alpha:t,hsva:e}=this,[a,n,i]=A(e);return[Math.round(a),Math.round(n),Math.round(i),t]},hsla(){const{alpha:t,hsva:e}=this,[a,n,i]=_(e);return[Math.round(a),Math.round(n)+"%",Math.round(i)+"%",t]},hex(){return O(this.rgba)},previewBorderColor(){const[t,e,a]=this.rgba;return(t+e+a)/3>235?"rgba(160,160,160,0.8)":"transparent"},styles(){const{rgba:t,alpha:e,hue:a,saturation:n}=this,i=t.slice(0,3).join(", "),r=b([360*a,100,50]).map((t=>Math.round(t))).join(", ");return{preview:{backgroundColor:`rgba(${t.join(", ")})`,borderColor:this.previewBorderColor},saturationPane:{backgroundColor:`rgb(${r})`},saturationThumb:{left:T(n.x),top:T(n.y)},alphaTrack:{backgroundImage:`linear-gradient(to right, rgba(${i}, 0) 0%, rgb(${i}) 100%)`},alphaThumb:{left:T(e)},hueThumb:{left:T(1-a)}}}},methods:{digestProp(t){const e=C(t),a=null==e[3]?1:e[3],[n,i,r]=w(e);return{alpha:parseFloat(a.toFixed(2)),hue:n/360,saturation:{x:i/100,y:1-r/100}}},onSaturationChange([t,e]){this.saturation={x:t,y:e},this.emitChange()},onHueChange(t){this.hue=1-t,this.emitChange()},onAlphaChange(t){this.alpha=parseFloat(t.toFixed(2)),this.emitChange()},emitChange(){const{hex:t,rgba:e,hsla:a,currentMode:n}=this;if(this.updateColorModel(),"hex"===n)this.updateSuggestions(t),this.$emit("input",t);else if("hsla"===n){const t=`hsla(${a.join(",")})`;this.updateSuggestions(t),this.$emit("input",t)}else if("rgba"===n){const t=`rgba(${e.join(",")})`;this.updateSuggestions(t),this.$emit("input",t)}},onClickColor(t){this.$emit("input",t,!0)},handleInput(e,a){const{currentMode:n,colorModel:i}=this,{target:{value:r}}=a;let s=Number(r),o=!1;switch(e){case"a":i[e]===s||isNaN(s)||(i[e]=t(s,0,1),o=!0);break;case"r":case"g":case"b":i[e]===s||isNaN(s)||(i[e]=0|t(s,0,255),o=!0);break;case"h":i[e]===s||isNaN(s)||(i[e]=0|t(s,0,360),o=!0);break;case"s":case"l":"%"===r.slice(-1)&&i[e]!==r&&(s=parseFloat(r),i[e]=(0|t(s,0,360))+"%",o=!0);break;case"hex":"#"===r[0]&&i[e]!==r&&C(r).every((t=>!isNaN(t)))&&(i[e]=E(r),o=!0)}if(!o)return;const{h:l,s:c,l:u,r:h,g:p,b:f,a:g,hex:m}=i;let v=m;"rgba"===n?v=`rgba(${[h,p,f,g]})`:"hsla"===n&&(v=`hsla(${[l,c,u,g]})`),d(this,this.digestProp(v)),this.emitChange()},updateColorModel(){const{hsla:t,rgba:e,hex:a,alpha:n}=this,[i,r,s]=t,[o,l,c]=e,u=E(1===n?a.slice(0,7):a);d(this.colorModel,{r:o,g:l,b:c,h:i,s:r,l:s,a:n,hex:u})},loadSuggestions(){const t=localStorage.getItem("V_COLOR_PICKER_SUGGESTIONS");if(!t)return[];this.suggestions=JSON.parse(t)},updateSuggestions(t){if(this.suggestions.includes(t))return;let e;e=this.suggestions.length<7?this.suggestions.concat(t):this.suggestions.slice(1,7).concat(t),this.suggestions=e,localStorage.setItem("V_COLOR_PICKER_SUGGESTIONS",JSON.stringify(e))}},created(){this.handleInput=e(this.handleInput.bind(this),250),this.emitChange=e(this.emitChange.bind(this),250),this.updateColorModel(),this.loadSuggestions()}};function N(t,e,a,n,i,r,s,o,l,d){"boolean"!=typeof s&&(l=o,o=s,s=!1);const c="function"==typeof a?a.options:a;let u;if(t&&t.render&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,i&&(c.functional=!0)),n&&(c._scopeId=n),r?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(r)},c._ssrRegister=u):e&&(u=s?function(t){e.call(this,d(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,o(t))}),u)if(c.functional){const t=c.render;c.render=function(e,a){return u.call(a),t(e,a)}}else{const t=c.beforeCreate;c.beforeCreate=t?[].concat(t,u):[u]}return a}const j="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function $(t){return(t,e)=>function(t,e){const a=j?e.media||"default":t,n=V[a]||(V[a]={ids:new Set,styles:[]});if(!n.ids.has(t)){n.ids.add(t);let a=e.source;if(e.map&&(a+="\n/*# sourceURL="+e.map.sources[0]+" */",a+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),n.element||(n.element=document.createElement("style"),n.element.type="text/css",e.media&&n.element.setAttribute("media",e.media),void 0===R&&(R=document.head||document.getElementsByTagName("head")[0]),R.appendChild(n.element)),"styleSheet"in n.element)n.styles.push(a),n.element.styleSheet.cssText=n.styles.filter(Boolean).join("\n");else{const t=n.ids.size-1,e=document.createTextNode(a),i=n.element.childNodes;i[t]&&n.element.removeChild(i[t]),i.length?n.element.insertBefore(e,i[t]):n.element.appendChild(e)}}}(t,e)}let R;const V={};const B={BOTTOM:"bottom",LEFT:"left",RIGHT:"right",TOP:"top"};const L=N({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{ref:"root",staticClass:"popover"},[a("button",{staticClass:"trigger",attrs:{type:"button"},on:{click:t.onToggle}},[a("span",{staticClass:"preview",style:{"background-color":t.value}})]),t._v(" "),a("transition",{attrs:{name:t.currentTransitionName}},[t.isVisible?a("div",{staticClass:"frame",class:t.framePositionClass},[a("color-picker",{attrs:{value:t.value,"with-suggestions":t.withSuggestions},on:{input:t.onInput}})],1):t._e()])],1)},staticRenderFns:[]},(function(t){t&&t("data-v-0f94a0a0_0",{source:".popover[data-v-0f94a0a0]{position:relative}.trigger[data-v-0f94a0a0]{flex:0 0 auto;display:flex;align-items:center;padding:0;background:0 0;border:none;cursor:pointer}.preview[data-v-0f94a0a0]{flex:1 1 auto;display:inline-block;vertical-align:middle;width:32px;height:32px;border:1px solid #e2e8f0;border-radius:50%}.frame[data-v-0f94a0a0]{position:absolute;z-index:10}.frame.bottom[data-v-0f94a0a0]{left:0;top:calc(100% + 12px)}.frame.top[data-v-0f94a0a0]{left:0;bottom:calc(100% + 12px)}.frame.left[data-v-0f94a0a0]{right:calc(100% + 12px);top:50%;transform:translateY(-50%)}.frame.right[data-v-0f94a0a0]{left:calc(100% + 12px);top:50%;transform:translateY(-50%)}.slide-down-enter-active[data-v-0f94a0a0]{animation:slideDown-data-v-0f94a0a0 .25s}.slide-down-leave-to[data-v-0f94a0a0]{animation:slideDown-data-v-0f94a0a0 .25s reverse}@keyframes slideDown-data-v-0f94a0a0{from{transform:translateY(15px);opacity:0}}.slide-up-enter-active[data-v-0f94a0a0]{animation:slideUp-data-v-0f94a0a0 .25s}.slide-up-leave-to[data-v-0f94a0a0]{animation:slideUp-data-v-0f94a0a0 .25s reverse}@keyframes slideUp-data-v-0f94a0a0{from{transform:translateY(-15px);opacity:0}}.slide-left-enter-active[data-v-0f94a0a0]{animation:slideLeft-data-v-0f94a0a0 .25s}.slide-left-leave-to[data-v-0f94a0a0]{animation:slideLeft-data-v-0f94a0a0 .25s reverse}@keyframes slideLeft-data-v-0f94a0a0{from{transform:translateX(-15px) translateY(-50%);opacity:0}}.slide-right-enter-active[data-v-0f94a0a0]{animation:slideRight-data-v-0f94a0a0 .25s}.slide-right-leave-to[data-v-0f94a0a0]{animation:slideRight-data-v-0f94a0a0 .25s reverse}@keyframes slideRight-data-v-0f94a0a0{from{transform:translateX(15px) translateY(-50%);opacity:0}}",map:void 0,media:void 0})}),{name:"VColorPopover",components:{ColorPicker:N({render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"wrapper"},[a("v-ctrl",{attrs:{direction:"vh",precision:2,throttle:80},on:{change:t.onSaturationChange}},[a("div",{staticClass:"saturation"},[a("div",{staticClass:"mask hue",style:t.styles.saturationPane}),t._v(" "),a("div",{staticClass:"mask white"}),t._v(" "),a("div",{staticClass:"mask black"}),t._v(" "),a("p",{staticClass:"thumb",style:t.styles.saturationThumb})])]),t._v(" "),a("section",{staticClass:"controls"},[a("section",{staticClass:"sliders"},[a("v-ctrl",{attrs:{direction:"h",precision:2,throttle:80},on:{change:t.onHueChange}},[a("div",{staticClass:"slider bar hue"},[a("div",{staticClass:"thumb",style:t.styles.hueThumb})])]),t._v(" "),a("v-ctrl",{attrs:{direction:"h",precision:2,throttle:80},on:{change:t.onAlphaChange}},[a("div",{staticClass:"slider alpha"},[a("div",{staticClass:"thumb",style:t.styles.alphaThumb}),t._v(" "),a("div",{staticClass:"bar",style:t.styles.alphaTrack})])])],1),t._v(" "),a("section",{staticClass:"modes"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.currentMode,expression:"currentMode"}],staticClass:"mode-input select",on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.currentMode=e.target.multiple?a:a[0]}}},t._l(t.colorModes,(function(e,n){return a("option",{key:n,domProps:{value:n}},[t._v("\n "+t._s(n)+"\n ")])})),0),t._v(" "),t._l(t.colorModes[t.currentMode],(function(e){return a("input",{key:e,staticClass:"mode-input",attrs:{type:t.constrains[e].type,maxlength:t.constrains[e].maxlength},domProps:{value:t.colorModel[e]},on:{input:function(a){return t.handleInput(e,a)}}})}))],2)]),t._v(" "),t.withSuggestions&&t.suggestions.length>0?a("section",{staticClass:"suggestions"},[a("p",[t._v("Previously used colors")]),t._v(" "),a("ul",t._l(t.suggestions,(function(e){return a("li",{key:e},[a("button",{staticClass:"suggestion",style:{backgroundColor:e},attrs:{type:"button"},on:{click:function(a){return t.onClickColor(e)}}})])})),0)]):t._e()],1)},staticRenderFns:[]},(function(t){t&&t("data-v-8fc876ba_0",{source:".wrapper[data-v-8fc876ba]{width:260px;margin:0;background:#fff;border-radius:2px;box-shadow:0 0 2px rgba(0,0,0,.3),0 4px 8px rgba(0,0,0,.3);user-select:none}.slider[data-v-8fc876ba]{position:relative;margin-bottom:16px}.slider.hue[data-v-8fc876ba]{background:linear-gradient(-90deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.slider.alpha[data-v-8fc876ba]{margin-top:8px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==) left center}.bar[data-v-8fc876ba]{height:8px;border-radius:4px}.controls[data-v-8fc876ba]{padding:20px 16px;padding-bottom:16px}.modes[data-v-8fc876ba]{display:flex;align-items:center}.mode-input[data-v-8fc876ba]{width:100%;appearance:none;-webkit-appearance:none;font-size:12px;line-height:1.5;text-align:center;text-transform:uppercase;border:none;padding:0;font-family:Inter,Helvetica,Arial,sans-serif;color:#1a202c}.mode-input.select[data-v-8fc876ba]{flex:0 0 42px;margin-right:10px;background-repeat:no-repeat;background-size:6px;background-position:center right;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI2IiB2aWV3Qm94PSIwIDAgOCA2IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMSAxLjQ3MzM5TDQgNC41MjY2Nkw3IDEuNDczMzkiIHN0cm9rZT0iIzlFQjVDOCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=)}.thumb[data-v-8fc876ba]{position:absolute;width:12px;height:12px;top:0;border-radius:50%;margin-top:-1px;transform:translateX(-50%);background-color:#f8f8f8;box-shadow:0 1px 4px 0 rgba(0,0,0,.368627);cursor:default}.saturation[data-v-8fc876ba]{position:relative;width:100%;padding-bottom:55%;overflow:hidden}.saturation>div[data-v-8fc876ba]{position:absolute;top:0;left:0;right:0;bottom:0;margin:0}.saturation>.thumb[data-v-8fc876ba]{background-color:transparent;transform:translate(-50%,-50%);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4)}.mask.white[data-v-8fc876ba]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.mask.black[data-v-8fc876ba]{background:linear-gradient(0deg,#000,transparent)}.suggestions[data-v-8fc876ba]{border-top:1px solid #e2e8f0;padding:20px 16px;padding-top:16px}.suggestions p[data-v-8fc876ba]{margin-top:0;margin-bottom:10px;font-family:Inter,Helvetica,Arial,sans-serif;font-size:12px;line-height:1.5;color:#1a202c}.suggestions ul[data-v-8fc876ba]{display:flex;align-items:center;margin:0;padding:0;list-style:none}.suggestion[data-v-8fc876ba]{width:24px;height:24px;margin:4px;border:1px solid #e2e8f0;border-radius:50%}",map:void 0,media:void 0})}),P,"data-v-8fc876ba",false,undefined,!1,$,void 0,void 0)},props:{value:{type:String,default:"#ff0000"},withSuggestions:{type:Boolean,default:!0},position:{type:String,default:B.BOTTOM,validator:t=>Object.values(B).includes(t)}},data:()=>({isVisible:!1}),computed:{currentTransitionName(){switch(this.position){case B.BOTTOM:return"slide-down";case B.LEFT:return"slide-left";case B.RIGHT:return"slide-right";case B.TOP:return"slide-up"}},framePositionClass(){switch(this.position){case B.BOTTOM:return"bottom";case B.LEFT:return"left";case B.RIGHT:return"right";case B.TOP:return"top"}}},watch:{isVisible(t){t?document.body.addEventListener("click",this.onClickOutside):document.body.removeEventListener("click",this.onClickOutside)}},created(){window.addEventListener("keypress",this.onKeydown)},beforeDestroy(){window.removeEventListener("keypress",this.onKeydown)},methods:{getElementPath(t){const e=[];let a=t;for(;a!==document.body;)e.unshift(a),a=a.parentElement;return e},onToggle(){this.isVisible=!this.isVisible},onKeydown(t){this.isVisible&&"Escape"===t.code&&(this.isVisible=!1)},onClickOutside(t){(t.path||this.getElementPath(t.target)).includes(this.$refs.root)||(this.isVisible=!1)},onInput(t,e){this.$emit("input",t),e&&(this.isVisible=!1)}}},"data-v-0f94a0a0",false,undefined,!1,$,void 0,void 0);export default L;
import e from"lodash/clamp";import t from"lodash/debounce";import a from"lodash/isEqual";import n from"lodash/throttle";var i=function(e,t,a,n,i,r,s,o){if(!e){var d;if(void 0===t)d=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[a,n,i,r,s,o],c=0;(d=new Error(t.replace(/%s/g,(function(){return l[c++]})))).name="Invariant Violation"}throw d.framesToPop=1,d}},r=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function d(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var l=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},a=0;a<10;a++)t["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var a,n,i=d(e),l=1;l<arguments.length;l++){for(var c in a=Object(arguments[l]))s.call(a,c)&&(i[c]=a[c]);if(r){n=r(a);for(var u=0;u<n.length;u++)o.call(a,n[u])&&(i[n[u]]=a[n[u]])}}return i},c=/-?\d+(\.\d+)?%?/g;var u=function(e){return e.match(c)};var h=function(e,t,a){return Math.min(Math.max(e,t),a)};function p(e,t){switch(e=parseFloat(e),t){case 0:return h(e,0,360);case 1:case 2:return h(e,0,100);case 3:return h(e,0,1)}}var g=function(e){return u(e).map(p)};var f=function(e){4!==e.length&&5!==e.length||(e=function(e){for(var t="#",a=1;a<e.length;a++){var n=e.charAt(a);t+=n+n}return t}(e));var t=[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16)];if(9===e.length){var a=parseFloat((parseInt(e.substring(7,9),16)/255).toFixed(2));t.push(a)}return t};function m(e,t){return t<3?-1!=e.indexOf("%")?Math.round(255*h(parseInt(e,10),0,100)/100):h(parseInt(e,10),0,255):h(parseFloat(e),0,1)}var v=function(e){return u(e).map(m)};var b=function(e){var t,a,n,i,r,s=e[0]/360,o=e[1]/100,d=e[2]/100;if(0==o)return[r=255*d,r,r];t=2*d-(a=d<.5?d*(1+o):d+o-d*o),i=[0,0,0];for(var l=0;l<3;l++)(n=s+1/3*-(l-1))<0&&n++,n>1&&n--,r=6*n<1?t+6*(a-t)*n:2*n<1?a:3*n<2?t+(a-t)*(2/3-n)*6:t,i[l]=255*r;return i};var x={"#":f,hsl:function(e){var t=g(e),a=b(t);return 4===t.length&&a.push(t[3]),a},rgb:v};function y(e){for(var t in x)if(0===e.indexOf(t))return x[t](e)}y.rgb=v,y.hsl=g,y.hex=f;var C=y;var w=function(e){var t,a,n=e[0],i=e[1],r=e[2],s=Math.min(n,i,r),o=Math.max(n,i,r),d=o-s;return a=0==o?0:d/o*1e3/10,o==s?t=0:n==o?t=(i-r)/d:i==o?t=2+(r-n)/d:r==o&&(t=4+(n-i)/d),(t=Math.min(60*t,360))<0&&(t+=360),[t,a,o/255*1e3/10]};function k(e){var t=Math.round(h(e,0,255)).toString(16);return 1==t.length?"0"+t:t}var O=function(e){var t=4===e.length?k(255*e[3]):"";return"#"+k(e[0])+k(e[1])+k(e[2])+t};var _=function(e){var t,a,n=e[0],i=e[1]/100,r=e[2]/100;return t=i*r,[n,100*(t=(t/=(a=(2-i)*r)<=1?a:2-a)||0),100*(a/=2)]};var A=function(e){var t=e[0]/60,a=e[1]/100,n=e[2]/100,i=Math.floor(t)%6,r=t-Math.floor(t),s=255*n*(1-a),o=255*n*(1-a*r),d=255*n*(1-a*(1-r));switch(n*=255,i){case 0:return[n,d,s];case 1:return[o,n,s];case 2:return[s,n,d];case 3:return[s,o,n];case 4:return[d,s,n];case 5:return[n,s,o]}},M={name:"v-ctrl",abstract:!0,props:{direction:{type:String,default:"h",validator:function(e){return["v","h","vh","hv"].indexOf(e)>-1}},throttle:{type:Number,default:80},precision:{type:Number}},methods:{msdown:function(e){e.preventDefault(),document.addEventListener("mousemove",this.msmove),document.addEventListener("mouseup",this.msup),this.next(e)},msmove:function(e){e.preventDefault(),this.next(e)},msup:function(e){this.next(e),document.removeEventListener("mousemove",this.msmove),document.removeEventListener("mouseup",this.msup)},notify:function(e){!1===a(this.memo,e)&&(this.memo=e,this.$emit("change",e))},next:function(e){void 0===e&&(e={});var t=e.clientX;void 0===t&&(t=0);var a=e.clientY;void 0===a&&(a=0);var n=this.direction,i=this.adjust,r=this.$el.getBoundingClientRect(),s=i((t-r.left)/r.width);if("h"===n)return this.notify(s);var o=i((a-r.top)/r.height);if("v"===n)return this.notify(o);this.notify([s,o])},adjust:function(t){return function(e,t){var a=0|t;return a>0?parseFloat(e.toFixed(a)):e}(e(t,0,1),this.precision)}},render:function(e){return this.$slots.default[0]},created:function(){var e=this.msdown,t=this.msmove;this.msdown=e.bind(this),this.msmove=n(t.bind(this),this.throttle),this.memo=null},mounted:function(){this.$el.addEventListener("mousedown",this.msdown)},destroyed:function(){this.$el.removeEventListener("mousedown",this.msdown)},install:function(){Vue.component(M.name,M)}};"undefined"!=typeof window&&window.Vue&&Vue.use(M);var S={VueCtrlComponent:M};const I=Object.freeze({rgba:["r","g","b","a"],hsla:["h","s","l","a"],hex:["hex"]});function T(e,t=3){return(100*e).toPrecision(0|t)+"%"}function E(e){return e.replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3([0-9a-f]?)\4$/,"#$1$2$3$4")}var P={name:"VColorPicker",props:{value:{type:String,default:"#ff0000"},withSuggestions:{type:Boolean,default:!0}},components:{"v-ctrl":S.VueCtrlComponent},data(){const{value:e}=this,t={type:"number",maxlength:3},a={type:"string",maxlength:4};return{...this.digestProp(e),suggestions:[],currentMode:(n=e,"#"===n[0]?"hex":0===n.indexOf("rgb")?"rgba":0===n.indexOf("hsl")?"hsla":void i(!1,n+" is not valid color value!")),colorModes:I,colorModel:{hex:"",r:"",g:"",b:"",h:"",s:"",l:"",a:""},constrains:{r:t,g:t,b:t,h:t,s:a,l:a,a:{type:"number",maxlength:4},hex:{type:"string",maxlength:9}}};var n},watch:{value:{immediate:!0,handler(e,t){e!==t&&l(this,this.digestProp(e))}}},computed:{hsva(){const{hue:e,alpha:t,saturation:{x:a,y:n}}=this;return[360*e,100*a,100*(1-n),t]},rgba(){const{alpha:e,hsva:t}=this,[a,n,i]=A(t);return[Math.round(a),Math.round(n),Math.round(i),e]},hsla(){const{alpha:e,hsva:t}=this,[a,n,i]=_(t);return[Math.round(a),Math.round(n)+"%",Math.round(i)+"%",e]},hex(){return O(this.rgba)},previewBorderColor(){const[e,t,a]=this.rgba;return(e+t+a)/3>235?"rgba(160,160,160,0.8)":"transparent"},styles(){const{rgba:e,alpha:t,hue:a,saturation:n}=this,i=e.slice(0,3).join(", "),r=b([360*a,100,50]).map((e=>Math.round(e))).join(", ");return{preview:{backgroundColor:`rgba(${e.join(", ")})`,borderColor:this.previewBorderColor},saturationPane:{backgroundColor:`rgb(${r})`},saturationThumb:{left:T(n.x),top:T(n.y)},alphaTrack:{backgroundImage:`linear-gradient(to right, rgba(${i}, 0) 0%, rgb(${i}) 100%)`},alphaThumb:{left:T(t)},hueThumb:{left:T(1-a)}}}},methods:{digestProp(e){const t=C(e),a=null==t[3]?1:t[3],[n,i,r]=w(t);return{alpha:parseFloat(a.toFixed(2)),hue:n/360,saturation:{x:i/100,y:1-r/100}}},onSaturationChange([e,t]){this.saturation={x:e,y:t},this.emitChange()},onHueChange(e){this.hue=1-e,this.emitChange()},onAlphaChange(e){this.alpha=parseFloat(e.toFixed(2)),this.emitChange()},emitChange(){const{hex:e,rgba:t,hsla:a,currentMode:n}=this;if(this.updateColorModel(),"hex"===n)this.updateSuggestions(e),this.$emit("input",e);else if("hsla"===n){const e=`hsla(${a.join(",")})`;this.updateSuggestions(e),this.$emit("input",e)}else if("rgba"===n){const e=`rgba(${t.join(",")})`;this.updateSuggestions(e),this.$emit("input",e)}},onClickColor(e){this.$emit("input",e,!0)},handleInput(t,a){const{currentMode:n,colorModel:i}=this,{target:{value:r}}=a;let s=Number(r),o=!1;switch(t){case"a":i[t]===s||isNaN(s)||(i[t]=e(s,0,1),o=!0);break;case"r":case"g":case"b":i[t]===s||isNaN(s)||(i[t]=0|e(s,0,255),o=!0);break;case"h":i[t]===s||isNaN(s)||(i[t]=0|e(s,0,360),o=!0);break;case"s":case"l":"%"===r.slice(-1)&&i[t]!==r&&(s=parseFloat(r),i[t]=(0|e(s,0,360))+"%",o=!0);break;case"hex":"#"===r[0]&&i[t]!==r&&C(r).every((e=>!isNaN(e)))&&(i[t]=E(r),o=!0)}if(!o)return;const{h:d,s:c,l:u,r:h,g:p,b:g,a:f,hex:m}=i;let v=m;"rgba"===n?v=`rgba(${[h,p,g,f]})`:"hsla"===n&&(v=`hsla(${[d,c,u,f]})`),l(this,this.digestProp(v)),this.emitChange()},updateColorModel(){const{hsla:e,rgba:t,hex:a,alpha:n}=this,[i,r,s]=e,[o,d,c]=t,u=E(1===n?a.slice(0,7):a);l(this.colorModel,{r:o,g:d,b:c,h:i,s:r,l:s,a:n,hex:u})},loadSuggestions(){const e=localStorage.getItem("V_COLOR_PICKER_SUGGESTIONS");if(!e)return[];this.suggestions=JSON.parse(e)},updateSuggestions(e){if(this.suggestions.includes(e))return;let t;t=this.suggestions.length<7?this.suggestions.concat(e):this.suggestions.slice(1,7).concat(e),this.suggestions=t,localStorage.setItem("V_COLOR_PICKER_SUGGESTIONS",JSON.stringify(t))}},created(){this.handleInput=t(this.handleInput.bind(this),250),this.emitChange=t(this.emitChange.bind(this),250),this.updateColorModel(),this.loadSuggestions()}};function N(e,t,a,n,i,r,s,o,d,l){"boolean"!=typeof s&&(d=o,o=s,s=!1);const c="function"==typeof a?a.options:a;let u;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,i&&(c.functional=!0)),n&&(c._scopeId=n),r?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=u):t&&(u=s?function(e){t.call(this,l(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,o(e))}),u)if(c.functional){const e=c.render;c.render=function(t,a){return u.call(a),e(t,a)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,u):[u]}return a}const j="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function $(e){return(e,t)=>function(e,t){const a=j?t.media||"default":e,n=V[a]||(V[a]={ids:new Set,styles:[]});if(!n.ids.has(e)){n.ids.add(e);let a=t.source;if(t.map&&(a+="\n/*# sourceURL="+t.map.sources[0]+" */",a+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),n.element||(n.element=document.createElement("style"),n.element.type="text/css",t.media&&n.element.setAttribute("media",t.media),void 0===R&&(R=document.head||document.getElementsByTagName("head")[0]),R.appendChild(n.element)),"styleSheet"in n.element)n.styles.push(a),n.element.styleSheet.cssText=n.styles.filter(Boolean).join("\n");else{const e=n.ids.size-1,t=document.createTextNode(a),i=n.element.childNodes;i[e]&&n.element.removeChild(i[e]),i.length?n.element.insertBefore(t,i[e]):n.element.appendChild(t)}}}(e,t)}let R;const V={};const B={BOTTOM:"bottom",LEFT:"left",RIGHT:"right",TOP:"top"};const L=N({render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"root",staticClass:"popover"},[a("button",{staticClass:"trigger",attrs:{type:"button"},on:{click:e.onToggle}},[a("span",{staticClass:"preview",style:{"background-color":e.value}})]),e._v(" "),a("transition",{attrs:{name:e.currentTransitionName}},[e.isVisible?a("div",{staticClass:"frame",class:e.framePositionClass},[a("color-picker",{attrs:{value:e.value,"with-suggestions":e.withSuggestions},on:{input:e.onInput}})],1):e._e()])],1)},staticRenderFns:[]},(function(e){e&&e("data-v-65ed649e_0",{source:".popover[data-v-65ed649e]{position:relative}.trigger[data-v-65ed649e]{flex:0 0 auto;display:flex;align-items:center;padding:0;background:0 0;border:none;cursor:pointer}.preview[data-v-65ed649e]{flex:1 1 auto;display:inline-block;vertical-align:middle;width:32px;height:32px;border:1px solid #e2e8f0;border-radius:50%}.frame[data-v-65ed649e]{position:absolute;z-index:10}.frame.bottom[data-v-65ed649e]{left:0;top:calc(100% + 12px)}.frame.top[data-v-65ed649e]{left:0;bottom:calc(100% + 12px)}.frame.left[data-v-65ed649e]{right:calc(100% + 12px);top:50%;transform:translateY(-50%)}.frame.right[data-v-65ed649e]{left:calc(100% + 12px);top:50%;transform:translateY(-50%)}.slide-down-enter-active[data-v-65ed649e]{animation:slideDown-data-v-65ed649e .25s}.slide-down-leave-to[data-v-65ed649e]{animation:slideDown-data-v-65ed649e .25s reverse}@keyframes slideDown-data-v-65ed649e{from{transform:translateY(15px);opacity:0}}.slide-up-enter-active[data-v-65ed649e]{animation:slideUp-data-v-65ed649e .25s}.slide-up-leave-to[data-v-65ed649e]{animation:slideUp-data-v-65ed649e .25s reverse}@keyframes slideUp-data-v-65ed649e{from{transform:translateY(-15px);opacity:0}}.slide-left-enter-active[data-v-65ed649e]{animation:slideLeft-data-v-65ed649e .25s}.slide-left-leave-to[data-v-65ed649e]{animation:slideLeft-data-v-65ed649e .25s reverse}@keyframes slideLeft-data-v-65ed649e{from{transform:translateX(-15px) translateY(-50%);opacity:0}}.slide-right-enter-active[data-v-65ed649e]{animation:slideRight-data-v-65ed649e .25s}.slide-right-leave-to[data-v-65ed649e]{animation:slideRight-data-v-65ed649e .25s reverse}@keyframes slideRight-data-v-65ed649e{from{transform:translateX(15px) translateY(-50%);opacity:0}}",map:void 0,media:void 0})}),{name:"VColorPopover",components:{ColorPicker:N({render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"wrapper"},[a("v-ctrl",{attrs:{direction:"vh",precision:2,throttle:80},on:{change:e.onSaturationChange}},[a("div",{staticClass:"saturation"},[a("div",{staticClass:"mask hue",style:e.styles.saturationPane}),e._v(" "),a("div",{staticClass:"mask white"}),e._v(" "),a("div",{staticClass:"mask black"}),e._v(" "),a("p",{staticClass:"thumb",style:e.styles.saturationThumb})])]),e._v(" "),a("section",{staticClass:"controls"},[a("section",{staticClass:"sliders"},[a("v-ctrl",{attrs:{direction:"h",precision:2,throttle:80},on:{change:e.onHueChange}},[a("div",{staticClass:"slider bar hue"},[a("div",{staticClass:"thumb",style:e.styles.hueThumb})])]),e._v(" "),a("v-ctrl",{attrs:{direction:"h",precision:2,throttle:80},on:{change:e.onAlphaChange}},[a("div",{staticClass:"slider alpha"},[a("div",{staticClass:"thumb",style:e.styles.alphaThumb}),e._v(" "),a("div",{staticClass:"bar",style:e.styles.alphaTrack})])])],1),e._v(" "),a("section",{staticClass:"modes"},[a("select",{directives:[{name:"model",rawName:"v-model",value:e.currentMode,expression:"currentMode"}],staticClass:"mode-input select",on:{change:function(t){var a=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.currentMode=t.target.multiple?a:a[0]}}},e._l(e.colorModes,(function(t,n){return a("option",{key:n,domProps:{value:n}},[e._v("\n "+e._s(n)+"\n ")])})),0),e._v(" "),e._l(e.colorModes[e.currentMode],(function(t){return a("input",{key:t,staticClass:"mode-input",attrs:{type:e.constrains[t].type,maxlength:e.constrains[t].maxlength},domProps:{value:e.colorModel[t]},on:{input:function(a){return e.handleInput(t,a)}}})}))],2)]),e._v(" "),e.withSuggestions&&e.suggestions.length>0?a("section",{staticClass:"suggestions"},[a("p",[e._v("Previously used colors")]),e._v(" "),a("ul",e._l(e.suggestions,(function(t){return a("li",{key:t},[a("button",{staticClass:"suggestion",style:{backgroundColor:t},attrs:{type:"button"},on:{click:function(a){return e.onClickColor(t)}}})])})),0)]):e._e()],1)},staticRenderFns:[]},(function(e){e&&e("data-v-8fc876ba_0",{source:".wrapper[data-v-8fc876ba]{width:260px;margin:0;background:#fff;border-radius:2px;box-shadow:0 0 2px rgba(0,0,0,.3),0 4px 8px rgba(0,0,0,.3);user-select:none}.slider[data-v-8fc876ba]{position:relative;margin-bottom:16px}.slider.hue[data-v-8fc876ba]{background:linear-gradient(-90deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.slider.alpha[data-v-8fc876ba]{margin-top:8px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==) left center}.bar[data-v-8fc876ba]{height:8px;border-radius:4px}.controls[data-v-8fc876ba]{padding:20px 16px;padding-bottom:16px}.modes[data-v-8fc876ba]{display:flex;align-items:center}.mode-input[data-v-8fc876ba]{width:100%;appearance:none;-webkit-appearance:none;font-size:12px;line-height:1.5;text-align:center;text-transform:uppercase;border:none;padding:0;font-family:Inter,Helvetica,Arial,sans-serif;color:#1a202c}.mode-input.select[data-v-8fc876ba]{flex:0 0 42px;margin-right:10px;background-repeat:no-repeat;background-size:6px;background-position:center right;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI2IiB2aWV3Qm94PSIwIDAgOCA2IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMSAxLjQ3MzM5TDQgNC41MjY2Nkw3IDEuNDczMzkiIHN0cm9rZT0iIzlFQjVDOCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=)}.thumb[data-v-8fc876ba]{position:absolute;width:12px;height:12px;top:0;border-radius:50%;margin-top:-1px;transform:translateX(-50%);background-color:#f8f8f8;box-shadow:0 1px 4px 0 rgba(0,0,0,.368627);cursor:default}.saturation[data-v-8fc876ba]{position:relative;width:100%;padding-bottom:55%;overflow:hidden}.saturation>div[data-v-8fc876ba]{position:absolute;top:0;left:0;right:0;bottom:0;margin:0}.saturation>.thumb[data-v-8fc876ba]{background-color:transparent;transform:translate(-50%,-50%);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4)}.mask.white[data-v-8fc876ba]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.mask.black[data-v-8fc876ba]{background:linear-gradient(0deg,#000,transparent)}.suggestions[data-v-8fc876ba]{border-top:1px solid #e2e8f0;padding:20px 16px;padding-top:16px}.suggestions p[data-v-8fc876ba]{margin-top:0;margin-bottom:10px;font-family:Inter,Helvetica,Arial,sans-serif;font-size:12px;line-height:1.5;color:#1a202c}.suggestions ul[data-v-8fc876ba]{display:flex;align-items:center;margin:0;padding:0;list-style:none}.suggestion[data-v-8fc876ba]{width:24px;height:24px;margin:4px;border:1px solid #e2e8f0;border-radius:50%}",map:void 0,media:void 0})}),P,"data-v-8fc876ba",false,undefined,!1,$,void 0,void 0)},props:{value:{type:String,default:"#ff0000"},withSuggestions:{type:Boolean,default:!0},position:{type:String,default:B.BOTTOM,validator:e=>Object.values(B).includes(e)}},data:()=>({isVisible:!1}),computed:{currentTransitionName(){switch(this.position){case B.BOTTOM:return"slide-down";case B.LEFT:return"slide-left";case B.RIGHT:return"slide-right";case B.TOP:return"slide-up"}},framePositionClass(){switch(this.position){case B.BOTTOM:return"bottom";case B.LEFT:return"left";case B.RIGHT:return"right";case B.TOP:return"top"}}},watch:{isVisible(e){e?document.body.addEventListener("click",this.onClickOutside):document.body.removeEventListener("click",this.onClickOutside)}},created(){document.addEventListener("keyup",this.onKeydown)},beforeDestroy(){document.removeEventListener("keyup",this.onKeydown)},methods:{getElementPath(e){const t=[];let a=e;for(;a!==document.body;)t.unshift(a),a=a.parentElement;return t},onToggle(){this.isVisible=!this.isVisible},onKeydown(e){this.isVisible&&"Escape"===e.code&&(this.isVisible=!1)},onClickOutside(e){(e.path||this.getElementPath(e.target)).includes(this.$refs.root)||(this.isVisible=!1)},onInput(e,t){this.$emit("input",e),t&&(this.isVisible=!1)}}},"data-v-65ed649e",false,undefined,!1,$,void 0,void 0);export default L;

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).VColorPopover=e()}(this,(function(){"use strict";var t=function(t,e,r){return t==t&&(void 0!==r&&(t=t<=r?t:r),void 0!==e&&(t=t>=e?t:e)),t};var e=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var a="object"==typeof r&&r&&r.Object===Object&&r,o="object"==typeof self&&self&&self.Object===Object&&self,i=a||o||Function("return this")(),s=i.Symbol,u=Object.prototype,c=u.hasOwnProperty,l=u.toString,d=s?s.toStringTag:void 0;var f=function(t){var e=c.call(t,d),r=t[d];try{t[d]=void 0;var n=!0}catch(t){}var a=l.call(t);return n&&(e?t[d]=r:delete t[d]),a},p=Object.prototype.toString;var h=function(t){return p.call(t)},v=s?s.toStringTag:void 0;var g=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":v&&v in Object(t)?f(t):h(t)};var b=function(t){return null!=t&&"object"==typeof t};var m=function(t){return"symbol"==typeof t||b(t)&&"[object Symbol]"==g(t)},y=/^\s+|\s+$/g,_=/^[-+]0x[0-9a-f]+$/i,x=/^0b[01]+$/i,w=/^0o[0-7]+$/i,j=parseInt;var O=function(t){if("number"==typeof t)return t;if(m(t))return NaN;if(e(t)){var r="function"==typeof t.valueOf?t.valueOf():t;t=e(r)?r+"":r}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(y,"");var n=x.test(t);return n||w.test(t)?j(t.slice(2),n?2:8):_.test(t)?NaN:+t};var C=function(e,r,n){return void 0===n&&(n=r,r=void 0),void 0!==n&&(n=(n=O(n))==n?n:0),void 0!==r&&(r=(r=O(r))==r?r:0),t(O(e),r,n)},A=function(){return i.Date.now()},k=Math.max,T=Math.min;var S=function(t,r,n){var a,o,i,s,u,c,l=0,d=!1,f=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function h(e){var r=a,n=o;return a=o=void 0,l=e,s=t.apply(n,r)}function v(t){return l=t,u=setTimeout(b,r),d?h(t):s}function g(t){var e=t-c;return void 0===c||e>=r||e<0||f&&t-l>=i}function b(){var t=A();if(g(t))return m(t);u=setTimeout(b,function(t){var e=r-(t-c);return f?T(e,i-(t-l)):e}(t))}function m(t){return u=void 0,p&&a?h(t):(a=o=void 0,s)}function y(){var t=A(),e=g(t);if(a=arguments,o=this,c=t,e){if(void 0===u)return v(c);if(f)return clearTimeout(u),u=setTimeout(b,r),h(c)}return void 0===u&&(u=setTimeout(b,r)),s}return r=O(r)||0,e(n)&&(d=!!n.leading,i=(f="maxWait"in n)?k(O(n.maxWait)||0,r):i,p="trailing"in n?!!n.trailing:p),y.cancel=function(){void 0!==u&&clearTimeout(u),l=0,a=c=o=u=void 0},y.flush=function(){return void 0===u?s:m(A())},y};var M=function(){this.__data__=[],this.size=0};var E=function(t,e){return t===e||t!=t&&e!=e};var I=function(t,e){for(var r=t.length;r--;)if(E(t[r][0],e))return r;return-1},P=Array.prototype.splice;var $=function(t){var e=this.__data__,r=I(e,t);return!(r<0)&&(r==e.length-1?e.pop():P.call(e,r,1),--this.size,!0)};var N=function(t){var e=this.__data__,r=I(e,t);return r<0?void 0:e[r][1]};var z=function(t){return I(this.__data__,t)>-1};var B=function(t,e){var r=this.__data__,n=I(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function R(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}R.prototype.clear=M,R.prototype.delete=$,R.prototype.get=N,R.prototype.has=z,R.prototype.set=B;var V=R;var L=function(){this.__data__=new V,this.size=0};var F=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var D=function(t){return this.__data__.get(t)};var U=function(t){return this.__data__.has(t)};var G,W=function(t){if(!e(t))return!1;var r=g(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r},Y=i["__core-js_shared__"],H=(G=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"";var J=function(t){return!!H&&H in t},Q=Function.prototype.toString;var X=function(t){if(null!=t){try{return Q.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Z=/^\[object .+?Constructor\]$/,q=Function.prototype,K=Object.prototype,tt=q.toString,et=K.hasOwnProperty,rt=RegExp("^"+tt.call(et).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var nt=function(t){return!(!e(t)||J(t))&&(W(t)?rt:Z).test(X(t))};var at=function(t,e){return null==t?void 0:t[e]};var ot=function(t,e){var r=at(t,e);return nt(r)?r:void 0},it=ot(i,"Map"),st=ot(Object,"create");var ut=function(){this.__data__=st?st(null):{},this.size=0};var ct=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},lt=Object.prototype.hasOwnProperty;var dt=function(t){var e=this.__data__;if(st){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return lt.call(e,t)?e[t]:void 0},ft=Object.prototype.hasOwnProperty;var pt=function(t){var e=this.__data__;return st?void 0!==e[t]:ft.call(e,t)};var ht=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=st&&void 0===e?"__lodash_hash_undefined__":e,this};function vt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}vt.prototype.clear=ut,vt.prototype.delete=ct,vt.prototype.get=dt,vt.prototype.has=pt,vt.prototype.set=ht;var gt=vt;var bt=function(){this.size=0,this.__data__={hash:new gt,map:new(it||V),string:new gt}};var mt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var yt=function(t,e){var r=t.__data__;return mt(e)?r["string"==typeof e?"string":"hash"]:r.map};var _t=function(t){var e=yt(this,t).delete(t);return this.size-=e?1:0,e};var xt=function(t){return yt(this,t).get(t)};var wt=function(t){return yt(this,t).has(t)};var jt=function(t,e){var r=yt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Ot(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ot.prototype.clear=bt,Ot.prototype.delete=_t,Ot.prototype.get=xt,Ot.prototype.has=wt,Ot.prototype.set=jt;var Ct=Ot;var At=function(t,e){var r=this.__data__;if(r instanceof V){var n=r.__data__;if(!it||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Ct(n)}return r.set(t,e),this.size=r.size,this};function kt(t){var e=this.__data__=new V(t);this.size=e.size}kt.prototype.clear=L,kt.prototype.delete=F,kt.prototype.get=D,kt.prototype.has=U,kt.prototype.set=At;var Tt=kt;var St=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var Mt=function(t){return this.__data__.has(t)};function Et(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new Ct;++e<r;)this.add(t[e])}Et.prototype.add=Et.prototype.push=St,Et.prototype.has=Mt;var It=Et;var Pt=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1};var $t=function(t,e){return t.has(e)};var Nt=function(t,e,r,n,a,o){var i=1&r,s=t.length,u=e.length;if(s!=u&&!(i&&u>s))return!1;var c=o.get(t),l=o.get(e);if(c&&l)return c==e&&l==t;var d=-1,f=!0,p=2&r?new It:void 0;for(o.set(t,e),o.set(e,t);++d<s;){var h=t[d],v=e[d];if(n)var g=i?n(v,h,d,e,t,o):n(h,v,d,t,e,o);if(void 0!==g){if(g)continue;f=!1;break}if(p){if(!Pt(e,(function(t,e){if(!$t(p,e)&&(h===t||a(h,t,r,n,o)))return p.push(e)}))){f=!1;break}}else if(h!==v&&!a(h,v,r,n,o)){f=!1;break}}return o.delete(t),o.delete(e),f},zt=i.Uint8Array;var Bt=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var Rt=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},Vt=s?s.prototype:void 0,Lt=Vt?Vt.valueOf:void 0;var Ft=function(t,e,r,n,a,o,i){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new zt(t),new zt(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return E(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var s=Bt;case"[object Set]":var u=1&n;if(s||(s=Rt),t.size!=e.size&&!u)return!1;var c=i.get(t);if(c)return c==e;n|=2,i.set(t,e);var l=Nt(s(t),s(e),n,a,o,i);return i.delete(t),l;case"[object Symbol]":if(Lt)return Lt.call(t)==Lt.call(e)}return!1};var Dt=function(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t},Ut=Array.isArray;var Gt=function(t,e,r){var n=e(t);return Ut(t)?n:Dt(n,r(t))};var Wt=function(t,e){for(var r=-1,n=null==t?0:t.length,a=0,o=[];++r<n;){var i=t[r];e(i,r,t)&&(o[a++]=i)}return o};var Yt=function(){return[]},Ht=Object.prototype.propertyIsEnumerable,Jt=Object.getOwnPropertySymbols,Qt=Jt?function(t){return null==t?[]:(t=Object(t),Wt(Jt(t),(function(e){return Ht.call(t,e)})))}:Yt;var Xt=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var Zt=function(t){return b(t)&&"[object Arguments]"==g(t)},qt=Object.prototype,Kt=qt.hasOwnProperty,te=qt.propertyIsEnumerable,ee=Zt(function(){return arguments}())?Zt:function(t){return b(t)&&Kt.call(t,"callee")&&!te.call(t,"callee")};var re=function(){return!1},ne=n((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,a=n&&n.exports===r?i.Buffer:void 0,o=(a?a.isBuffer:void 0)||re;t.exports=o})),ae=/^(?:0|[1-9]\d*)$/;var oe=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&ae.test(t))&&t>-1&&t%1==0&&t<e};var ie=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},se={};se["[object Float32Array]"]=se["[object Float64Array]"]=se["[object Int8Array]"]=se["[object Int16Array]"]=se["[object Int32Array]"]=se["[object Uint8Array]"]=se["[object Uint8ClampedArray]"]=se["[object Uint16Array]"]=se["[object Uint32Array]"]=!0,se["[object Arguments]"]=se["[object Array]"]=se["[object ArrayBuffer]"]=se["[object Boolean]"]=se["[object DataView]"]=se["[object Date]"]=se["[object Error]"]=se["[object Function]"]=se["[object Map]"]=se["[object Number]"]=se["[object Object]"]=se["[object RegExp]"]=se["[object Set]"]=se["[object String]"]=se["[object WeakMap]"]=!1;var ue=function(t){return b(t)&&ie(t.length)&&!!se[g(t)]};var ce=function(t){return function(e){return t(e)}},le=n((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&a.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i})),de=le&&le.isTypedArray,fe=de?ce(de):ue,pe=Object.prototype.hasOwnProperty;var he=function(t,e){var r=Ut(t),n=!r&&ee(t),a=!r&&!n&&ne(t),o=!r&&!n&&!a&&fe(t),i=r||n||a||o,s=i?Xt(t.length,String):[],u=s.length;for(var c in t)!e&&!pe.call(t,c)||i&&("length"==c||a&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||oe(c,u))||s.push(c);return s},ve=Object.prototype;var ge=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ve)};var be=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),me=Object.prototype.hasOwnProperty;var ye=function(t){if(!ge(t))return be(t);var e=[];for(var r in Object(t))me.call(t,r)&&"constructor"!=r&&e.push(r);return e};var _e=function(t){return null!=t&&ie(t.length)&&!W(t)};var xe=function(t){return _e(t)?he(t):ye(t)};var we=function(t){return Gt(t,xe,Qt)},je=Object.prototype.hasOwnProperty;var Oe=function(t,e,r,n,a,o){var i=1&r,s=we(t),u=s.length;if(u!=we(e).length&&!i)return!1;for(var c=u;c--;){var l=s[c];if(!(i?l in e:je.call(e,l)))return!1}var d=o.get(t),f=o.get(e);if(d&&f)return d==e&&f==t;var p=!0;o.set(t,e),o.set(e,t);for(var h=i;++c<u;){var v=t[l=s[c]],g=e[l];if(n)var b=i?n(g,v,l,e,t,o):n(v,g,l,t,e,o);if(!(void 0===b?v===g||a(v,g,r,n,o):b)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var m=t.constructor,y=e.constructor;m==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y||(p=!1)}return o.delete(t),o.delete(e),p},Ce=ot(i,"DataView"),Ae=ot(i,"Promise"),ke=ot(i,"Set"),Te=ot(i,"WeakMap"),Se="[object Map]",Me="[object Promise]",Ee="[object Set]",Ie="[object WeakMap]",Pe="[object DataView]",$e=X(Ce),Ne=X(it),ze=X(Ae),Be=X(ke),Re=X(Te),Ve=g;(Ce&&Ve(new Ce(new ArrayBuffer(1)))!=Pe||it&&Ve(new it)!=Se||Ae&&Ve(Ae.resolve())!=Me||ke&&Ve(new ke)!=Ee||Te&&Ve(new Te)!=Ie)&&(Ve=function(t){var e=g(t),r="[object Object]"==e?t.constructor:void 0,n=r?X(r):"";if(n)switch(n){case $e:return Pe;case Ne:return Se;case ze:return Me;case Be:return Ee;case Re:return Ie}return e});var Le=Ve,Fe="[object Arguments]",De="[object Array]",Ue="[object Object]",Ge=Object.prototype.hasOwnProperty;var We=function(t,e,r,n,a,o){var i=Ut(t),s=Ut(e),u=i?De:Le(t),c=s?De:Le(e),l=(u=u==Fe?Ue:u)==Ue,d=(c=c==Fe?Ue:c)==Ue,f=u==c;if(f&&ne(t)){if(!ne(e))return!1;i=!0,l=!1}if(f&&!l)return o||(o=new Tt),i||fe(t)?Nt(t,e,r,n,a,o):Ft(t,e,u,r,n,a,o);if(!(1&r)){var p=l&&Ge.call(t,"__wrapped__"),h=d&&Ge.call(e,"__wrapped__");if(p||h){var v=p?t.value():t,g=h?e.value():e;return o||(o=new Tt),a(v,g,r,n,o)}}return!!f&&(o||(o=new Tt),Oe(t,e,r,n,a,o))};var Ye=function t(e,r,n,a,o){return e===r||(null==e||null==r||!b(e)&&!b(r)?e!=e&&r!=r:We(e,r,n,a,t,o))};var He=function(t,e){return Ye(t,e)},Je=function(t,e,r,n,a,o,i,s){if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,a,o,i,s],l=0;(u=new Error(e.replace(/%s/g,(function(){return c[l++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}},Qe=Object.getOwnPropertySymbols,Xe=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable;function qe(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var Ke=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,n,a=qe(t),o=1;o<arguments.length;o++){for(var i in r=Object(arguments[o]))Xe.call(r,i)&&(a[i]=r[i]);if(Qe){n=Qe(r);for(var s=0;s<n.length;s++)Ze.call(r,n[s])&&(a[n[s]]=r[n[s]])}}return a},tr=/-?\d+(\.\d+)?%?/g;var er=function(t){return t.match(tr)};var rr=function(t,e,r){return Math.min(Math.max(t,e),r)};function nr(t,e){switch(t=parseFloat(t),e){case 0:return rr(t,0,360);case 1:case 2:return rr(t,0,100);case 3:return rr(t,0,1)}}var ar=function(t){return er(t).map(nr)};var or=function(t){4!==t.length&&5!==t.length||(t=function(t){for(var e="#",r=1;r<t.length;r++){var n=t.charAt(r);e+=n+n}return e}(t));var e=[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16)];if(9===t.length){var r=parseFloat((parseInt(t.substring(7,9),16)/255).toFixed(2));e.push(r)}return e};function ir(t,e){return e<3?-1!=t.indexOf("%")?Math.round(255*rr(parseInt(t,10),0,100)/100):rr(parseInt(t,10),0,255):rr(parseFloat(t),0,1)}var sr=function(t){return er(t).map(ir)};var ur=function(t){var e,r,n,a,o,i=t[0]/360,s=t[1]/100,u=t[2]/100;if(0==s)return[o=255*u,o,o];e=2*u-(r=u<.5?u*(1+s):u+s-u*s),a=[0,0,0];for(var c=0;c<3;c++)(n=i+1/3*-(c-1))<0&&n++,n>1&&n--,o=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,a[c]=255*o;return a};var cr={"#":or,hsl:function(t){var e=ar(t),r=ur(e);return 4===e.length&&r.push(e[3]),r},rgb:sr};function lr(t){for(var e in cr)if(0===t.indexOf(e))return cr[e](t)}lr.rgb=sr,lr.hsl=ar,lr.hex=or;var dr=lr;var fr=function(t){var e,r,n=t[0],a=t[1],o=t[2],i=Math.min(n,a,o),s=Math.max(n,a,o),u=s-i;return r=0==s?0:u/s*1e3/10,s==i?e=0:n==s?e=(a-o)/u:a==s?e=2+(o-n)/u:o==s&&(e=4+(n-a)/u),(e=Math.min(60*e,360))<0&&(e+=360),[e,r,s/255*1e3/10]};function pr(t){var e=Math.round(rr(t,0,255)).toString(16);return 1==e.length?"0"+e:e}var hr=function(t){var e=4===t.length?pr(255*t[3]):"";return"#"+pr(t[0])+pr(t[1])+pr(t[2])+e};var vr=function(t){var e,r,n=t[0],a=t[1]/100,o=t[2]/100;return e=a*o,[n,100*(e=(e/=(r=(2-a)*o)<=1?r:2-r)||0),100*(r/=2)]};var gr=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),i=255*n*(1-r),s=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,a){case 0:return[n,u,i];case 1:return[s,n,i];case 2:return[i,n,u];case 3:return[i,s,n];case 4:return[u,i,n];case 5:return[n,i,s]}};var br=function(t,r,n){var a=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return e(n)&&(a="leading"in n?!!n.leading:a,o="trailing"in n?!!n.trailing:o),S(t,r,{leading:a,maxWait:r,trailing:o})},mr={name:"v-ctrl",abstract:!0,props:{direction:{type:String,default:"h",validator:function(t){return["v","h","vh","hv"].indexOf(t)>-1}},throttle:{type:Number,default:80},precision:{type:Number}},methods:{msdown:function(t){t.preventDefault(),document.addEventListener("mousemove",this.msmove),document.addEventListener("mouseup",this.msup),this.next(t)},msmove:function(t){t.preventDefault(),this.next(t)},msup:function(t){this.next(t),document.removeEventListener("mousemove",this.msmove),document.removeEventListener("mouseup",this.msup)},notify:function(t){!1===He(this.memo,t)&&(this.memo=t,this.$emit("change",t))},next:function(t){void 0===t&&(t={});var e=t.clientX;void 0===e&&(e=0);var r=t.clientY;void 0===r&&(r=0);var n=this.direction,a=this.adjust,o=this.$el.getBoundingClientRect(),i=a((e-o.left)/o.width);if("h"===n)return this.notify(i);var s=a((r-o.top)/o.height);if("v"===n)return this.notify(s);this.notify([i,s])},adjust:function(t){return function(t,e){var r=0|e;return r>0?parseFloat(t.toFixed(r)):t}(C(t,0,1),this.precision)}},render:function(t){return this.$slots.default[0]},created:function(){var t=this.msdown,e=this.msmove;this.msdown=t.bind(this),this.msmove=br(e.bind(this),this.throttle),this.memo=null},mounted:function(){this.$el.addEventListener("mousedown",this.msdown)},destroyed:function(){this.$el.removeEventListener("mousedown",this.msdown)},install:function(){Vue.component(mr.name,mr)}};"undefined"!=typeof window&&window.Vue&&Vue.use(mr);var yr={VueCtrlComponent:mr};const _r=Object.freeze({rgba:["r","g","b","a"],hsla:["h","s","l","a"],hex:["hex"]});function xr(t,e=3){return(100*t).toPrecision(0|e)+"%"}function wr(t){return t.replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3([0-9a-f]?)\4$/,"#$1$2$3$4")}var jr={name:"VColorPicker",props:{value:{type:String,default:"#ff0000"},withSuggestions:{type:Boolean,default:!0}},components:{"v-ctrl":yr.VueCtrlComponent},data(){const{value:t}=this,e={type:"number",maxlength:3},r={type:"string",maxlength:4};return{...this.digestProp(t),suggestions:[],currentMode:(n=t,"#"===n[0]?"hex":0===n.indexOf("rgb")?"rgba":0===n.indexOf("hsl")?"hsla":void Je(!1,n+" is not valid color value!")),colorModes:_r,colorModel:{hex:"",r:"",g:"",b:"",h:"",s:"",l:"",a:""},constrains:{r:e,g:e,b:e,h:e,s:r,l:r,a:{type:"number",maxlength:4},hex:{type:"string",maxlength:9}}};var n},watch:{value:{immediate:!0,handler(t,e){t!==e&&Ke(this,this.digestProp(t))}}},computed:{hsva(){const{hue:t,alpha:e,saturation:{x:r,y:n}}=this;return[360*t,100*r,100*(1-n),e]},rgba(){const{alpha:t,hsva:e}=this,[r,n,a]=gr(e);return[Math.round(r),Math.round(n),Math.round(a),t]},hsla(){const{alpha:t,hsva:e}=this,[r,n,a]=vr(e);return[Math.round(r),Math.round(n)+"%",Math.round(a)+"%",t]},hex(){return hr(this.rgba)},previewBorderColor(){const[t,e,r]=this.rgba;return(t+e+r)/3>235?"rgba(160,160,160,0.8)":"transparent"},styles(){const{rgba:t,alpha:e,hue:r,saturation:n}=this,a=t.slice(0,3).join(", "),o=ur([360*r,100,50]).map((t=>Math.round(t))).join(", ");return{preview:{backgroundColor:`rgba(${t.join(", ")})`,borderColor:this.previewBorderColor},saturationPane:{backgroundColor:`rgb(${o})`},saturationThumb:{left:xr(n.x),top:xr(n.y)},alphaTrack:{backgroundImage:`linear-gradient(to right, rgba(${a}, 0) 0%, rgb(${a}) 100%)`},alphaThumb:{left:xr(e)},hueThumb:{left:xr(1-r)}}}},methods:{digestProp(t){const e=dr(t),r=null==e[3]?1:e[3],[n,a,o]=fr(e);return{alpha:parseFloat(r.toFixed(2)),hue:n/360,saturation:{x:a/100,y:1-o/100}}},onSaturationChange([t,e]){this.saturation={x:t,y:e},this.emitChange()},onHueChange(t){this.hue=1-t,this.emitChange()},onAlphaChange(t){this.alpha=parseFloat(t.toFixed(2)),this.emitChange()},emitChange(){const{hex:t,rgba:e,hsla:r,currentMode:n}=this;if(this.updateColorModel(),"hex"===n)this.updateSuggestions(t),this.$emit("input",t);else if("hsla"===n){const t=`hsla(${r.join(",")})`;this.updateSuggestions(t),this.$emit("input",t)}else if("rgba"===n){const t=`rgba(${e.join(",")})`;this.updateSuggestions(t),this.$emit("input",t)}},onClickColor(t){this.$emit("input",t,!0)},handleInput(t,e){const{currentMode:r,colorModel:n}=this,{target:{value:a}}=e;let o=Number(a),i=!1;switch(t){case"a":n[t]===o||isNaN(o)||(n[t]=C(o,0,1),i=!0);break;case"r":case"g":case"b":n[t]===o||isNaN(o)||(n[t]=0|C(o,0,255),i=!0);break;case"h":n[t]===o||isNaN(o)||(n[t]=0|C(o,0,360),i=!0);break;case"s":case"l":"%"===a.slice(-1)&&n[t]!==a&&(o=parseFloat(a),n[t]=(0|C(o,0,360))+"%",i=!0);break;case"hex":"#"===a[0]&&n[t]!==a&&dr(a).every((t=>!isNaN(t)))&&(n[t]=wr(a),i=!0)}if(!i)return;const{h:s,s:u,l:c,r:l,g:d,b:f,a:p,hex:h}=n;let v=h;"rgba"===r?v=`rgba(${[l,d,f,p]})`:"hsla"===r&&(v=`hsla(${[s,u,c,p]})`),Ke(this,this.digestProp(v)),this.emitChange()},updateColorModel(){const{hsla:t,rgba:e,hex:r,alpha:n}=this,[a,o,i]=t,[s,u,c]=e,l=wr(1===n?r.slice(0,7):r);Ke(this.colorModel,{r:s,g:u,b:c,h:a,s:o,l:i,a:n,hex:l})},loadSuggestions(){const t=localStorage.getItem("V_COLOR_PICKER_SUGGESTIONS");if(!t)return[];this.suggestions=JSON.parse(t)},updateSuggestions(t){if(this.suggestions.includes(t))return;let e;e=this.suggestions.length<7?this.suggestions.concat(t):this.suggestions.slice(1,7).concat(t),this.suggestions=e,localStorage.setItem("V_COLOR_PICKER_SUGGESTIONS",JSON.stringify(e))}},created(){this.handleInput=S(this.handleInput.bind(this),250),this.emitChange=S(this.emitChange.bind(this),250),this.updateColorModel(),this.loadSuggestions()}};function Or(t,e,r,n,a,o,i,s,u,c){"boolean"!=typeof i&&(u=s,s=i,i=!1);const l="function"==typeof r?r.options:r;let d;if(t&&t.render&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,a&&(l.functional=!0)),n&&(l._scopeId=n),o?(d=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,u(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},l._ssrRegister=d):e&&(d=i?function(t){e.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),d)if(l.functional){const t=l.render;l.render=function(e,r){return d.call(r),t(e,r)}}else{const t=l.beforeCreate;l.beforeCreate=t?[].concat(t,d):[d]}return r}const Cr="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function Ar(t){return(t,e)=>function(t,e){const r=Cr?e.media||"default":t,n=Tr[r]||(Tr[r]={ids:new Set,styles:[]});if(!n.ids.has(t)){n.ids.add(t);let r=e.source;if(e.map&&(r+="\n/*# sourceURL="+e.map.sources[0]+" */",r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),n.element||(n.element=document.createElement("style"),n.element.type="text/css",e.media&&n.element.setAttribute("media",e.media),void 0===kr&&(kr=document.head||document.getElementsByTagName("head")[0]),kr.appendChild(n.element)),"styleSheet"in n.element)n.styles.push(r),n.element.styleSheet.cssText=n.styles.filter(Boolean).join("\n");else{const t=n.ids.size-1,e=document.createTextNode(r),a=n.element.childNodes;a[t]&&n.element.removeChild(a[t]),a.length?n.element.insertBefore(e,a[t]):n.element.appendChild(e)}}}(t,e)}let kr;const Tr={};const Sr={BOTTOM:"bottom",LEFT:"left",RIGHT:"right",TOP:"top"};return Or({render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{ref:"root",staticClass:"popover"},[r("button",{staticClass:"trigger",attrs:{type:"button"},on:{click:t.onToggle}},[r("span",{staticClass:"preview",style:{"background-color":t.value}})]),t._v(" "),r("transition",{attrs:{name:t.currentTransitionName}},[t.isVisible?r("div",{staticClass:"frame",class:t.framePositionClass},[r("color-picker",{attrs:{value:t.value,"with-suggestions":t.withSuggestions},on:{input:t.onInput}})],1):t._e()])],1)},staticRenderFns:[]},(function(t){t&&t("data-v-0f94a0a0_0",{source:".popover[data-v-0f94a0a0]{position:relative}.trigger[data-v-0f94a0a0]{flex:0 0 auto;display:flex;align-items:center;padding:0;background:0 0;border:none;cursor:pointer}.preview[data-v-0f94a0a0]{flex:1 1 auto;display:inline-block;vertical-align:middle;width:32px;height:32px;border:1px solid #e2e8f0;border-radius:50%}.frame[data-v-0f94a0a0]{position:absolute;z-index:10}.frame.bottom[data-v-0f94a0a0]{left:0;top:calc(100% + 12px)}.frame.top[data-v-0f94a0a0]{left:0;bottom:calc(100% + 12px)}.frame.left[data-v-0f94a0a0]{right:calc(100% + 12px);top:50%;transform:translateY(-50%)}.frame.right[data-v-0f94a0a0]{left:calc(100% + 12px);top:50%;transform:translateY(-50%)}.slide-down-enter-active[data-v-0f94a0a0]{animation:slideDown-data-v-0f94a0a0 .25s}.slide-down-leave-to[data-v-0f94a0a0]{animation:slideDown-data-v-0f94a0a0 .25s reverse}@keyframes slideDown-data-v-0f94a0a0{from{transform:translateY(15px);opacity:0}}.slide-up-enter-active[data-v-0f94a0a0]{animation:slideUp-data-v-0f94a0a0 .25s}.slide-up-leave-to[data-v-0f94a0a0]{animation:slideUp-data-v-0f94a0a0 .25s reverse}@keyframes slideUp-data-v-0f94a0a0{from{transform:translateY(-15px);opacity:0}}.slide-left-enter-active[data-v-0f94a0a0]{animation:slideLeft-data-v-0f94a0a0 .25s}.slide-left-leave-to[data-v-0f94a0a0]{animation:slideLeft-data-v-0f94a0a0 .25s reverse}@keyframes slideLeft-data-v-0f94a0a0{from{transform:translateX(-15px) translateY(-50%);opacity:0}}.slide-right-enter-active[data-v-0f94a0a0]{animation:slideRight-data-v-0f94a0a0 .25s}.slide-right-leave-to[data-v-0f94a0a0]{animation:slideRight-data-v-0f94a0a0 .25s reverse}@keyframes slideRight-data-v-0f94a0a0{from{transform:translateX(15px) translateY(-50%);opacity:0}}",map:void 0,media:void 0})}),{name:"VColorPopover",components:{ColorPicker:Or({render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"wrapper"},[r("v-ctrl",{attrs:{direction:"vh",precision:2,throttle:80},on:{change:t.onSaturationChange}},[r("div",{staticClass:"saturation"},[r("div",{staticClass:"mask hue",style:t.styles.saturationPane}),t._v(" "),r("div",{staticClass:"mask white"}),t._v(" "),r("div",{staticClass:"mask black"}),t._v(" "),r("p",{staticClass:"thumb",style:t.styles.saturationThumb})])]),t._v(" "),r("section",{staticClass:"controls"},[r("section",{staticClass:"sliders"},[r("v-ctrl",{attrs:{direction:"h",precision:2,throttle:80},on:{change:t.onHueChange}},[r("div",{staticClass:"slider bar hue"},[r("div",{staticClass:"thumb",style:t.styles.hueThumb})])]),t._v(" "),r("v-ctrl",{attrs:{direction:"h",precision:2,throttle:80},on:{change:t.onAlphaChange}},[r("div",{staticClass:"slider alpha"},[r("div",{staticClass:"thumb",style:t.styles.alphaThumb}),t._v(" "),r("div",{staticClass:"bar",style:t.styles.alphaTrack})])])],1),t._v(" "),r("section",{staticClass:"modes"},[r("select",{directives:[{name:"model",rawName:"v-model",value:t.currentMode,expression:"currentMode"}],staticClass:"mode-input select",on:{change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.currentMode=e.target.multiple?r:r[0]}}},t._l(t.colorModes,(function(e,n){return r("option",{key:n,domProps:{value:n}},[t._v("\n "+t._s(n)+"\n ")])})),0),t._v(" "),t._l(t.colorModes[t.currentMode],(function(e){return r("input",{key:e,staticClass:"mode-input",attrs:{type:t.constrains[e].type,maxlength:t.constrains[e].maxlength},domProps:{value:t.colorModel[e]},on:{input:function(r){return t.handleInput(e,r)}}})}))],2)]),t._v(" "),t.withSuggestions&&t.suggestions.length>0?r("section",{staticClass:"suggestions"},[r("p",[t._v("Previously used colors")]),t._v(" "),r("ul",t._l(t.suggestions,(function(e){return r("li",{key:e},[r("button",{staticClass:"suggestion",style:{backgroundColor:e},attrs:{type:"button"},on:{click:function(r){return t.onClickColor(e)}}})])})),0)]):t._e()],1)},staticRenderFns:[]},(function(t){t&&t("data-v-8fc876ba_0",{source:".wrapper[data-v-8fc876ba]{width:260px;margin:0;background:#fff;border-radius:2px;box-shadow:0 0 2px rgba(0,0,0,.3),0 4px 8px rgba(0,0,0,.3);user-select:none}.slider[data-v-8fc876ba]{position:relative;margin-bottom:16px}.slider.hue[data-v-8fc876ba]{background:linear-gradient(-90deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.slider.alpha[data-v-8fc876ba]{margin-top:8px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==) left center}.bar[data-v-8fc876ba]{height:8px;border-radius:4px}.controls[data-v-8fc876ba]{padding:20px 16px;padding-bottom:16px}.modes[data-v-8fc876ba]{display:flex;align-items:center}.mode-input[data-v-8fc876ba]{width:100%;appearance:none;-webkit-appearance:none;font-size:12px;line-height:1.5;text-align:center;text-transform:uppercase;border:none;padding:0;font-family:Inter,Helvetica,Arial,sans-serif;color:#1a202c}.mode-input.select[data-v-8fc876ba]{flex:0 0 42px;margin-right:10px;background-repeat:no-repeat;background-size:6px;background-position:center right;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI2IiB2aWV3Qm94PSIwIDAgOCA2IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMSAxLjQ3MzM5TDQgNC41MjY2Nkw3IDEuNDczMzkiIHN0cm9rZT0iIzlFQjVDOCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=)}.thumb[data-v-8fc876ba]{position:absolute;width:12px;height:12px;top:0;border-radius:50%;margin-top:-1px;transform:translateX(-50%);background-color:#f8f8f8;box-shadow:0 1px 4px 0 rgba(0,0,0,.368627);cursor:default}.saturation[data-v-8fc876ba]{position:relative;width:100%;padding-bottom:55%;overflow:hidden}.saturation>div[data-v-8fc876ba]{position:absolute;top:0;left:0;right:0;bottom:0;margin:0}.saturation>.thumb[data-v-8fc876ba]{background-color:transparent;transform:translate(-50%,-50%);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4)}.mask.white[data-v-8fc876ba]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.mask.black[data-v-8fc876ba]{background:linear-gradient(0deg,#000,transparent)}.suggestions[data-v-8fc876ba]{border-top:1px solid #e2e8f0;padding:20px 16px;padding-top:16px}.suggestions p[data-v-8fc876ba]{margin-top:0;margin-bottom:10px;font-family:Inter,Helvetica,Arial,sans-serif;font-size:12px;line-height:1.5;color:#1a202c}.suggestions ul[data-v-8fc876ba]{display:flex;align-items:center;margin:0;padding:0;list-style:none}.suggestion[data-v-8fc876ba]{width:24px;height:24px;margin:4px;border:1px solid #e2e8f0;border-radius:50%}",map:void 0,media:void 0})}),jr,"data-v-8fc876ba",false,undefined,!1,Ar,void 0,void 0)},props:{value:{type:String,default:"#ff0000"},withSuggestions:{type:Boolean,default:!0},position:{type:String,default:Sr.BOTTOM,validator:t=>Object.values(Sr).includes(t)}},data:()=>({isVisible:!1}),computed:{currentTransitionName(){switch(this.position){case Sr.BOTTOM:return"slide-down";case Sr.LEFT:return"slide-left";case Sr.RIGHT:return"slide-right";case Sr.TOP:return"slide-up"}},framePositionClass(){switch(this.position){case Sr.BOTTOM:return"bottom";case Sr.LEFT:return"left";case Sr.RIGHT:return"right";case Sr.TOP:return"top"}}},watch:{isVisible(t){t?document.body.addEventListener("click",this.onClickOutside):document.body.removeEventListener("click",this.onClickOutside)}},created(){window.addEventListener("keypress",this.onKeydown)},beforeDestroy(){window.removeEventListener("keypress",this.onKeydown)},methods:{getElementPath(t){const e=[];let r=t;for(;r!==document.body;)e.unshift(r),r=r.parentElement;return e},onToggle(){this.isVisible=!this.isVisible},onKeydown(t){this.isVisible&&"Escape"===t.code&&(this.isVisible=!1)},onClickOutside(t){(t.path||this.getElementPath(t.target)).includes(this.$refs.root)||(this.isVisible=!1)},onInput(t,e){this.$emit("input",t),e&&(this.isVisible=!1)}}},"data-v-0f94a0a0",false,undefined,!1,Ar,void 0,void 0)}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).VColorPopover=e()}(this,(function(){"use strict";var t=function(t,e,r){return t==t&&(void 0!==r&&(t=t<=r?t:r),void 0!==e&&(t=t>=e?t:e)),t};var e=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var a="object"==typeof r&&r&&r.Object===Object&&r,o="object"==typeof self&&self&&self.Object===Object&&self,i=a||o||Function("return this")(),s=i.Symbol,u=Object.prototype,c=u.hasOwnProperty,l=u.toString,d=s?s.toStringTag:void 0;var f=function(t){var e=c.call(t,d),r=t[d];try{t[d]=void 0;var n=!0}catch(t){}var a=l.call(t);return n&&(e?t[d]=r:delete t[d]),a},p=Object.prototype.toString;var h=function(t){return p.call(t)},v=s?s.toStringTag:void 0;var g=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":v&&v in Object(t)?f(t):h(t)};var b=function(t){return null!=t&&"object"==typeof t};var m=function(t){return"symbol"==typeof t||b(t)&&"[object Symbol]"==g(t)},y=/^\s+|\s+$/g,_=/^[-+]0x[0-9a-f]+$/i,x=/^0b[01]+$/i,w=/^0o[0-7]+$/i,j=parseInt;var O=function(t){if("number"==typeof t)return t;if(m(t))return NaN;if(e(t)){var r="function"==typeof t.valueOf?t.valueOf():t;t=e(r)?r+"":r}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(y,"");var n=x.test(t);return n||w.test(t)?j(t.slice(2),n?2:8):_.test(t)?NaN:+t};var C=function(e,r,n){return void 0===n&&(n=r,r=void 0),void 0!==n&&(n=(n=O(n))==n?n:0),void 0!==r&&(r=(r=O(r))==r?r:0),t(O(e),r,n)},A=function(){return i.Date.now()},k=Math.max,T=Math.min;var S=function(t,r,n){var a,o,i,s,u,c,l=0,d=!1,f=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function h(e){var r=a,n=o;return a=o=void 0,l=e,s=t.apply(n,r)}function v(t){return l=t,u=setTimeout(b,r),d?h(t):s}function g(t){var e=t-c;return void 0===c||e>=r||e<0||f&&t-l>=i}function b(){var t=A();if(g(t))return m(t);u=setTimeout(b,function(t){var e=r-(t-c);return f?T(e,i-(t-l)):e}(t))}function m(t){return u=void 0,p&&a?h(t):(a=o=void 0,s)}function y(){var t=A(),e=g(t);if(a=arguments,o=this,c=t,e){if(void 0===u)return v(c);if(f)return clearTimeout(u),u=setTimeout(b,r),h(c)}return void 0===u&&(u=setTimeout(b,r)),s}return r=O(r)||0,e(n)&&(d=!!n.leading,i=(f="maxWait"in n)?k(O(n.maxWait)||0,r):i,p="trailing"in n?!!n.trailing:p),y.cancel=function(){void 0!==u&&clearTimeout(u),l=0,a=c=o=u=void 0},y.flush=function(){return void 0===u?s:m(A())},y};var M=function(){this.__data__=[],this.size=0};var E=function(t,e){return t===e||t!=t&&e!=e};var I=function(t,e){for(var r=t.length;r--;)if(E(t[r][0],e))return r;return-1},P=Array.prototype.splice;var $=function(t){var e=this.__data__,r=I(e,t);return!(r<0)&&(r==e.length-1?e.pop():P.call(e,r,1),--this.size,!0)};var N=function(t){var e=this.__data__,r=I(e,t);return r<0?void 0:e[r][1]};var z=function(t){return I(this.__data__,t)>-1};var B=function(t,e){var r=this.__data__,n=I(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function R(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}R.prototype.clear=M,R.prototype.delete=$,R.prototype.get=N,R.prototype.has=z,R.prototype.set=B;var V=R;var L=function(){this.__data__=new V,this.size=0};var F=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var D=function(t){return this.__data__.get(t)};var U=function(t){return this.__data__.has(t)};var G,W=function(t){if(!e(t))return!1;var r=g(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r},Y=i["__core-js_shared__"],H=(G=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"";var J=function(t){return!!H&&H in t},Q=Function.prototype.toString;var X=function(t){if(null!=t){try{return Q.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Z=/^\[object .+?Constructor\]$/,q=Function.prototype,K=Object.prototype,tt=q.toString,et=K.hasOwnProperty,rt=RegExp("^"+tt.call(et).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var nt=function(t){return!(!e(t)||J(t))&&(W(t)?rt:Z).test(X(t))};var at=function(t,e){return null==t?void 0:t[e]};var ot=function(t,e){var r=at(t,e);return nt(r)?r:void 0},it=ot(i,"Map"),st=ot(Object,"create");var ut=function(){this.__data__=st?st(null):{},this.size=0};var ct=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},lt=Object.prototype.hasOwnProperty;var dt=function(t){var e=this.__data__;if(st){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return lt.call(e,t)?e[t]:void 0},ft=Object.prototype.hasOwnProperty;var pt=function(t){var e=this.__data__;return st?void 0!==e[t]:ft.call(e,t)};var ht=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=st&&void 0===e?"__lodash_hash_undefined__":e,this};function vt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}vt.prototype.clear=ut,vt.prototype.delete=ct,vt.prototype.get=dt,vt.prototype.has=pt,vt.prototype.set=ht;var gt=vt;var bt=function(){this.size=0,this.__data__={hash:new gt,map:new(it||V),string:new gt}};var mt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var yt=function(t,e){var r=t.__data__;return mt(e)?r["string"==typeof e?"string":"hash"]:r.map};var _t=function(t){var e=yt(this,t).delete(t);return this.size-=e?1:0,e};var xt=function(t){return yt(this,t).get(t)};var wt=function(t){return yt(this,t).has(t)};var jt=function(t,e){var r=yt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Ot(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ot.prototype.clear=bt,Ot.prototype.delete=_t,Ot.prototype.get=xt,Ot.prototype.has=wt,Ot.prototype.set=jt;var Ct=Ot;var At=function(t,e){var r=this.__data__;if(r instanceof V){var n=r.__data__;if(!it||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Ct(n)}return r.set(t,e),this.size=r.size,this};function kt(t){var e=this.__data__=new V(t);this.size=e.size}kt.prototype.clear=L,kt.prototype.delete=F,kt.prototype.get=D,kt.prototype.has=U,kt.prototype.set=At;var Tt=kt;var St=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var Mt=function(t){return this.__data__.has(t)};function Et(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new Ct;++e<r;)this.add(t[e])}Et.prototype.add=Et.prototype.push=St,Et.prototype.has=Mt;var It=Et;var Pt=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1};var $t=function(t,e){return t.has(e)};var Nt=function(t,e,r,n,a,o){var i=1&r,s=t.length,u=e.length;if(s!=u&&!(i&&u>s))return!1;var c=o.get(t),l=o.get(e);if(c&&l)return c==e&&l==t;var d=-1,f=!0,p=2&r?new It:void 0;for(o.set(t,e),o.set(e,t);++d<s;){var h=t[d],v=e[d];if(n)var g=i?n(v,h,d,e,t,o):n(h,v,d,t,e,o);if(void 0!==g){if(g)continue;f=!1;break}if(p){if(!Pt(e,(function(t,e){if(!$t(p,e)&&(h===t||a(h,t,r,n,o)))return p.push(e)}))){f=!1;break}}else if(h!==v&&!a(h,v,r,n,o)){f=!1;break}}return o.delete(t),o.delete(e),f},zt=i.Uint8Array;var Bt=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var Rt=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},Vt=s?s.prototype:void 0,Lt=Vt?Vt.valueOf:void 0;var Ft=function(t,e,r,n,a,o,i){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new zt(t),new zt(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return E(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var s=Bt;case"[object Set]":var u=1&n;if(s||(s=Rt),t.size!=e.size&&!u)return!1;var c=i.get(t);if(c)return c==e;n|=2,i.set(t,e);var l=Nt(s(t),s(e),n,a,o,i);return i.delete(t),l;case"[object Symbol]":if(Lt)return Lt.call(t)==Lt.call(e)}return!1};var Dt=function(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t},Ut=Array.isArray;var Gt=function(t,e,r){var n=e(t);return Ut(t)?n:Dt(n,r(t))};var Wt=function(t,e){for(var r=-1,n=null==t?0:t.length,a=0,o=[];++r<n;){var i=t[r];e(i,r,t)&&(o[a++]=i)}return o};var Yt=function(){return[]},Ht=Object.prototype.propertyIsEnumerable,Jt=Object.getOwnPropertySymbols,Qt=Jt?function(t){return null==t?[]:(t=Object(t),Wt(Jt(t),(function(e){return Ht.call(t,e)})))}:Yt;var Xt=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var Zt=function(t){return b(t)&&"[object Arguments]"==g(t)},qt=Object.prototype,Kt=qt.hasOwnProperty,te=qt.propertyIsEnumerable,ee=Zt(function(){return arguments}())?Zt:function(t){return b(t)&&Kt.call(t,"callee")&&!te.call(t,"callee")};var re=function(){return!1},ne=n((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,a=n&&n.exports===r?i.Buffer:void 0,o=(a?a.isBuffer:void 0)||re;t.exports=o})),ae=/^(?:0|[1-9]\d*)$/;var oe=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&ae.test(t))&&t>-1&&t%1==0&&t<e};var ie=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},se={};se["[object Float32Array]"]=se["[object Float64Array]"]=se["[object Int8Array]"]=se["[object Int16Array]"]=se["[object Int32Array]"]=se["[object Uint8Array]"]=se["[object Uint8ClampedArray]"]=se["[object Uint16Array]"]=se["[object Uint32Array]"]=!0,se["[object Arguments]"]=se["[object Array]"]=se["[object ArrayBuffer]"]=se["[object Boolean]"]=se["[object DataView]"]=se["[object Date]"]=se["[object Error]"]=se["[object Function]"]=se["[object Map]"]=se["[object Number]"]=se["[object Object]"]=se["[object RegExp]"]=se["[object Set]"]=se["[object String]"]=se["[object WeakMap]"]=!1;var ue=function(t){return b(t)&&ie(t.length)&&!!se[g(t)]};var ce=function(t){return function(e){return t(e)}},le=n((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&a.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i})),de=le&&le.isTypedArray,fe=de?ce(de):ue,pe=Object.prototype.hasOwnProperty;var he=function(t,e){var r=Ut(t),n=!r&&ee(t),a=!r&&!n&&ne(t),o=!r&&!n&&!a&&fe(t),i=r||n||a||o,s=i?Xt(t.length,String):[],u=s.length;for(var c in t)!e&&!pe.call(t,c)||i&&("length"==c||a&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||oe(c,u))||s.push(c);return s},ve=Object.prototype;var ge=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ve)};var be=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),me=Object.prototype.hasOwnProperty;var ye=function(t){if(!ge(t))return be(t);var e=[];for(var r in Object(t))me.call(t,r)&&"constructor"!=r&&e.push(r);return e};var _e=function(t){return null!=t&&ie(t.length)&&!W(t)};var xe=function(t){return _e(t)?he(t):ye(t)};var we=function(t){return Gt(t,xe,Qt)},je=Object.prototype.hasOwnProperty;var Oe=function(t,e,r,n,a,o){var i=1&r,s=we(t),u=s.length;if(u!=we(e).length&&!i)return!1;for(var c=u;c--;){var l=s[c];if(!(i?l in e:je.call(e,l)))return!1}var d=o.get(t),f=o.get(e);if(d&&f)return d==e&&f==t;var p=!0;o.set(t,e),o.set(e,t);for(var h=i;++c<u;){var v=t[l=s[c]],g=e[l];if(n)var b=i?n(g,v,l,e,t,o):n(v,g,l,t,e,o);if(!(void 0===b?v===g||a(v,g,r,n,o):b)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var m=t.constructor,y=e.constructor;m==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y||(p=!1)}return o.delete(t),o.delete(e),p},Ce=ot(i,"DataView"),Ae=ot(i,"Promise"),ke=ot(i,"Set"),Te=ot(i,"WeakMap"),Se="[object Map]",Me="[object Promise]",Ee="[object Set]",Ie="[object WeakMap]",Pe="[object DataView]",$e=X(Ce),Ne=X(it),ze=X(Ae),Be=X(ke),Re=X(Te),Ve=g;(Ce&&Ve(new Ce(new ArrayBuffer(1)))!=Pe||it&&Ve(new it)!=Se||Ae&&Ve(Ae.resolve())!=Me||ke&&Ve(new ke)!=Ee||Te&&Ve(new Te)!=Ie)&&(Ve=function(t){var e=g(t),r="[object Object]"==e?t.constructor:void 0,n=r?X(r):"";if(n)switch(n){case $e:return Pe;case Ne:return Se;case ze:return Me;case Be:return Ee;case Re:return Ie}return e});var Le=Ve,Fe="[object Arguments]",De="[object Array]",Ue="[object Object]",Ge=Object.prototype.hasOwnProperty;var We=function(t,e,r,n,a,o){var i=Ut(t),s=Ut(e),u=i?De:Le(t),c=s?De:Le(e),l=(u=u==Fe?Ue:u)==Ue,d=(c=c==Fe?Ue:c)==Ue,f=u==c;if(f&&ne(t)){if(!ne(e))return!1;i=!0,l=!1}if(f&&!l)return o||(o=new Tt),i||fe(t)?Nt(t,e,r,n,a,o):Ft(t,e,u,r,n,a,o);if(!(1&r)){var p=l&&Ge.call(t,"__wrapped__"),h=d&&Ge.call(e,"__wrapped__");if(p||h){var v=p?t.value():t,g=h?e.value():e;return o||(o=new Tt),a(v,g,r,n,o)}}return!!f&&(o||(o=new Tt),Oe(t,e,r,n,a,o))};var Ye=function t(e,r,n,a,o){return e===r||(null==e||null==r||!b(e)&&!b(r)?e!=e&&r!=r:We(e,r,n,a,t,o))};var He=function(t,e){return Ye(t,e)},Je=function(t,e,r,n,a,o,i,s){if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,a,o,i,s],l=0;(u=new Error(e.replace(/%s/g,(function(){return c[l++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}},Qe=Object.getOwnPropertySymbols,Xe=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable;function qe(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var Ke=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,n,a=qe(t),o=1;o<arguments.length;o++){for(var i in r=Object(arguments[o]))Xe.call(r,i)&&(a[i]=r[i]);if(Qe){n=Qe(r);for(var s=0;s<n.length;s++)Ze.call(r,n[s])&&(a[n[s]]=r[n[s]])}}return a},tr=/-?\d+(\.\d+)?%?/g;var er=function(t){return t.match(tr)};var rr=function(t,e,r){return Math.min(Math.max(t,e),r)};function nr(t,e){switch(t=parseFloat(t),e){case 0:return rr(t,0,360);case 1:case 2:return rr(t,0,100);case 3:return rr(t,0,1)}}var ar=function(t){return er(t).map(nr)};var or=function(t){4!==t.length&&5!==t.length||(t=function(t){for(var e="#",r=1;r<t.length;r++){var n=t.charAt(r);e+=n+n}return e}(t));var e=[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16)];if(9===t.length){var r=parseFloat((parseInt(t.substring(7,9),16)/255).toFixed(2));e.push(r)}return e};function ir(t,e){return e<3?-1!=t.indexOf("%")?Math.round(255*rr(parseInt(t,10),0,100)/100):rr(parseInt(t,10),0,255):rr(parseFloat(t),0,1)}var sr=function(t){return er(t).map(ir)};var ur=function(t){var e,r,n,a,o,i=t[0]/360,s=t[1]/100,u=t[2]/100;if(0==s)return[o=255*u,o,o];e=2*u-(r=u<.5?u*(1+s):u+s-u*s),a=[0,0,0];for(var c=0;c<3;c++)(n=i+1/3*-(c-1))<0&&n++,n>1&&n--,o=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,a[c]=255*o;return a};var cr={"#":or,hsl:function(t){var e=ar(t),r=ur(e);return 4===e.length&&r.push(e[3]),r},rgb:sr};function lr(t){for(var e in cr)if(0===t.indexOf(e))return cr[e](t)}lr.rgb=sr,lr.hsl=ar,lr.hex=or;var dr=lr;var fr=function(t){var e,r,n=t[0],a=t[1],o=t[2],i=Math.min(n,a,o),s=Math.max(n,a,o),u=s-i;return r=0==s?0:u/s*1e3/10,s==i?e=0:n==s?e=(a-o)/u:a==s?e=2+(o-n)/u:o==s&&(e=4+(n-a)/u),(e=Math.min(60*e,360))<0&&(e+=360),[e,r,s/255*1e3/10]};function pr(t){var e=Math.round(rr(t,0,255)).toString(16);return 1==e.length?"0"+e:e}var hr=function(t){var e=4===t.length?pr(255*t[3]):"";return"#"+pr(t[0])+pr(t[1])+pr(t[2])+e};var vr=function(t){var e,r,n=t[0],a=t[1]/100,o=t[2]/100;return e=a*o,[n,100*(e=(e/=(r=(2-a)*o)<=1?r:2-r)||0),100*(r/=2)]};var gr=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),i=255*n*(1-r),s=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,a){case 0:return[n,u,i];case 1:return[s,n,i];case 2:return[i,n,u];case 3:return[i,s,n];case 4:return[u,i,n];case 5:return[n,i,s]}};var br=function(t,r,n){var a=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return e(n)&&(a="leading"in n?!!n.leading:a,o="trailing"in n?!!n.trailing:o),S(t,r,{leading:a,maxWait:r,trailing:o})},mr={name:"v-ctrl",abstract:!0,props:{direction:{type:String,default:"h",validator:function(t){return["v","h","vh","hv"].indexOf(t)>-1}},throttle:{type:Number,default:80},precision:{type:Number}},methods:{msdown:function(t){t.preventDefault(),document.addEventListener("mousemove",this.msmove),document.addEventListener("mouseup",this.msup),this.next(t)},msmove:function(t){t.preventDefault(),this.next(t)},msup:function(t){this.next(t),document.removeEventListener("mousemove",this.msmove),document.removeEventListener("mouseup",this.msup)},notify:function(t){!1===He(this.memo,t)&&(this.memo=t,this.$emit("change",t))},next:function(t){void 0===t&&(t={});var e=t.clientX;void 0===e&&(e=0);var r=t.clientY;void 0===r&&(r=0);var n=this.direction,a=this.adjust,o=this.$el.getBoundingClientRect(),i=a((e-o.left)/o.width);if("h"===n)return this.notify(i);var s=a((r-o.top)/o.height);if("v"===n)return this.notify(s);this.notify([i,s])},adjust:function(t){return function(t,e){var r=0|e;return r>0?parseFloat(t.toFixed(r)):t}(C(t,0,1),this.precision)}},render:function(t){return this.$slots.default[0]},created:function(){var t=this.msdown,e=this.msmove;this.msdown=t.bind(this),this.msmove=br(e.bind(this),this.throttle),this.memo=null},mounted:function(){this.$el.addEventListener("mousedown",this.msdown)},destroyed:function(){this.$el.removeEventListener("mousedown",this.msdown)},install:function(){Vue.component(mr.name,mr)}};"undefined"!=typeof window&&window.Vue&&Vue.use(mr);var yr={VueCtrlComponent:mr};const _r=Object.freeze({rgba:["r","g","b","a"],hsla:["h","s","l","a"],hex:["hex"]});function xr(t,e=3){return(100*t).toPrecision(0|e)+"%"}function wr(t){return t.replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3([0-9a-f]?)\4$/,"#$1$2$3$4")}var jr={name:"VColorPicker",props:{value:{type:String,default:"#ff0000"},withSuggestions:{type:Boolean,default:!0}},components:{"v-ctrl":yr.VueCtrlComponent},data(){const{value:t}=this,e={type:"number",maxlength:3},r={type:"string",maxlength:4};return{...this.digestProp(t),suggestions:[],currentMode:(n=t,"#"===n[0]?"hex":0===n.indexOf("rgb")?"rgba":0===n.indexOf("hsl")?"hsla":void Je(!1,n+" is not valid color value!")),colorModes:_r,colorModel:{hex:"",r:"",g:"",b:"",h:"",s:"",l:"",a:""},constrains:{r:e,g:e,b:e,h:e,s:r,l:r,a:{type:"number",maxlength:4},hex:{type:"string",maxlength:9}}};var n},watch:{value:{immediate:!0,handler(t,e){t!==e&&Ke(this,this.digestProp(t))}}},computed:{hsva(){const{hue:t,alpha:e,saturation:{x:r,y:n}}=this;return[360*t,100*r,100*(1-n),e]},rgba(){const{alpha:t,hsva:e}=this,[r,n,a]=gr(e);return[Math.round(r),Math.round(n),Math.round(a),t]},hsla(){const{alpha:t,hsva:e}=this,[r,n,a]=vr(e);return[Math.round(r),Math.round(n)+"%",Math.round(a)+"%",t]},hex(){return hr(this.rgba)},previewBorderColor(){const[t,e,r]=this.rgba;return(t+e+r)/3>235?"rgba(160,160,160,0.8)":"transparent"},styles(){const{rgba:t,alpha:e,hue:r,saturation:n}=this,a=t.slice(0,3).join(", "),o=ur([360*r,100,50]).map((t=>Math.round(t))).join(", ");return{preview:{backgroundColor:`rgba(${t.join(", ")})`,borderColor:this.previewBorderColor},saturationPane:{backgroundColor:`rgb(${o})`},saturationThumb:{left:xr(n.x),top:xr(n.y)},alphaTrack:{backgroundImage:`linear-gradient(to right, rgba(${a}, 0) 0%, rgb(${a}) 100%)`},alphaThumb:{left:xr(e)},hueThumb:{left:xr(1-r)}}}},methods:{digestProp(t){const e=dr(t),r=null==e[3]?1:e[3],[n,a,o]=fr(e);return{alpha:parseFloat(r.toFixed(2)),hue:n/360,saturation:{x:a/100,y:1-o/100}}},onSaturationChange([t,e]){this.saturation={x:t,y:e},this.emitChange()},onHueChange(t){this.hue=1-t,this.emitChange()},onAlphaChange(t){this.alpha=parseFloat(t.toFixed(2)),this.emitChange()},emitChange(){const{hex:t,rgba:e,hsla:r,currentMode:n}=this;if(this.updateColorModel(),"hex"===n)this.updateSuggestions(t),this.$emit("input",t);else if("hsla"===n){const t=`hsla(${r.join(",")})`;this.updateSuggestions(t),this.$emit("input",t)}else if("rgba"===n){const t=`rgba(${e.join(",")})`;this.updateSuggestions(t),this.$emit("input",t)}},onClickColor(t){this.$emit("input",t,!0)},handleInput(t,e){const{currentMode:r,colorModel:n}=this,{target:{value:a}}=e;let o=Number(a),i=!1;switch(t){case"a":n[t]===o||isNaN(o)||(n[t]=C(o,0,1),i=!0);break;case"r":case"g":case"b":n[t]===o||isNaN(o)||(n[t]=0|C(o,0,255),i=!0);break;case"h":n[t]===o||isNaN(o)||(n[t]=0|C(o,0,360),i=!0);break;case"s":case"l":"%"===a.slice(-1)&&n[t]!==a&&(o=parseFloat(a),n[t]=(0|C(o,0,360))+"%",i=!0);break;case"hex":"#"===a[0]&&n[t]!==a&&dr(a).every((t=>!isNaN(t)))&&(n[t]=wr(a),i=!0)}if(!i)return;const{h:s,s:u,l:c,r:l,g:d,b:f,a:p,hex:h}=n;let v=h;"rgba"===r?v=`rgba(${[l,d,f,p]})`:"hsla"===r&&(v=`hsla(${[s,u,c,p]})`),Ke(this,this.digestProp(v)),this.emitChange()},updateColorModel(){const{hsla:t,rgba:e,hex:r,alpha:n}=this,[a,o,i]=t,[s,u,c]=e,l=wr(1===n?r.slice(0,7):r);Ke(this.colorModel,{r:s,g:u,b:c,h:a,s:o,l:i,a:n,hex:l})},loadSuggestions(){const t=localStorage.getItem("V_COLOR_PICKER_SUGGESTIONS");if(!t)return[];this.suggestions=JSON.parse(t)},updateSuggestions(t){if(this.suggestions.includes(t))return;let e;e=this.suggestions.length<7?this.suggestions.concat(t):this.suggestions.slice(1,7).concat(t),this.suggestions=e,localStorage.setItem("V_COLOR_PICKER_SUGGESTIONS",JSON.stringify(e))}},created(){this.handleInput=S(this.handleInput.bind(this),250),this.emitChange=S(this.emitChange.bind(this),250),this.updateColorModel(),this.loadSuggestions()}};function Or(t,e,r,n,a,o,i,s,u,c){"boolean"!=typeof i&&(u=s,s=i,i=!1);const l="function"==typeof r?r.options:r;let d;if(t&&t.render&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,a&&(l.functional=!0)),n&&(l._scopeId=n),o?(d=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,u(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},l._ssrRegister=d):e&&(d=i?function(t){e.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),d)if(l.functional){const t=l.render;l.render=function(e,r){return d.call(r),t(e,r)}}else{const t=l.beforeCreate;l.beforeCreate=t?[].concat(t,d):[d]}return r}const Cr="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function Ar(t){return(t,e)=>function(t,e){const r=Cr?e.media||"default":t,n=Tr[r]||(Tr[r]={ids:new Set,styles:[]});if(!n.ids.has(t)){n.ids.add(t);let r=e.source;if(e.map&&(r+="\n/*# sourceURL="+e.map.sources[0]+" */",r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),n.element||(n.element=document.createElement("style"),n.element.type="text/css",e.media&&n.element.setAttribute("media",e.media),void 0===kr&&(kr=document.head||document.getElementsByTagName("head")[0]),kr.appendChild(n.element)),"styleSheet"in n.element)n.styles.push(r),n.element.styleSheet.cssText=n.styles.filter(Boolean).join("\n");else{const t=n.ids.size-1,e=document.createTextNode(r),a=n.element.childNodes;a[t]&&n.element.removeChild(a[t]),a.length?n.element.insertBefore(e,a[t]):n.element.appendChild(e)}}}(t,e)}let kr;const Tr={};const Sr={BOTTOM:"bottom",LEFT:"left",RIGHT:"right",TOP:"top"};return Or({render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{ref:"root",staticClass:"popover"},[r("button",{staticClass:"trigger",attrs:{type:"button"},on:{click:t.onToggle}},[r("span",{staticClass:"preview",style:{"background-color":t.value}})]),t._v(" "),r("transition",{attrs:{name:t.currentTransitionName}},[t.isVisible?r("div",{staticClass:"frame",class:t.framePositionClass},[r("color-picker",{attrs:{value:t.value,"with-suggestions":t.withSuggestions},on:{input:t.onInput}})],1):t._e()])],1)},staticRenderFns:[]},(function(t){t&&t("data-v-65ed649e_0",{source:".popover[data-v-65ed649e]{position:relative}.trigger[data-v-65ed649e]{flex:0 0 auto;display:flex;align-items:center;padding:0;background:0 0;border:none;cursor:pointer}.preview[data-v-65ed649e]{flex:1 1 auto;display:inline-block;vertical-align:middle;width:32px;height:32px;border:1px solid #e2e8f0;border-radius:50%}.frame[data-v-65ed649e]{position:absolute;z-index:10}.frame.bottom[data-v-65ed649e]{left:0;top:calc(100% + 12px)}.frame.top[data-v-65ed649e]{left:0;bottom:calc(100% + 12px)}.frame.left[data-v-65ed649e]{right:calc(100% + 12px);top:50%;transform:translateY(-50%)}.frame.right[data-v-65ed649e]{left:calc(100% + 12px);top:50%;transform:translateY(-50%)}.slide-down-enter-active[data-v-65ed649e]{animation:slideDown-data-v-65ed649e .25s}.slide-down-leave-to[data-v-65ed649e]{animation:slideDown-data-v-65ed649e .25s reverse}@keyframes slideDown-data-v-65ed649e{from{transform:translateY(15px);opacity:0}}.slide-up-enter-active[data-v-65ed649e]{animation:slideUp-data-v-65ed649e .25s}.slide-up-leave-to[data-v-65ed649e]{animation:slideUp-data-v-65ed649e .25s reverse}@keyframes slideUp-data-v-65ed649e{from{transform:translateY(-15px);opacity:0}}.slide-left-enter-active[data-v-65ed649e]{animation:slideLeft-data-v-65ed649e .25s}.slide-left-leave-to[data-v-65ed649e]{animation:slideLeft-data-v-65ed649e .25s reverse}@keyframes slideLeft-data-v-65ed649e{from{transform:translateX(-15px) translateY(-50%);opacity:0}}.slide-right-enter-active[data-v-65ed649e]{animation:slideRight-data-v-65ed649e .25s}.slide-right-leave-to[data-v-65ed649e]{animation:slideRight-data-v-65ed649e .25s reverse}@keyframes slideRight-data-v-65ed649e{from{transform:translateX(15px) translateY(-50%);opacity:0}}",map:void 0,media:void 0})}),{name:"VColorPopover",components:{ColorPicker:Or({render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"wrapper"},[r("v-ctrl",{attrs:{direction:"vh",precision:2,throttle:80},on:{change:t.onSaturationChange}},[r("div",{staticClass:"saturation"},[r("div",{staticClass:"mask hue",style:t.styles.saturationPane}),t._v(" "),r("div",{staticClass:"mask white"}),t._v(" "),r("div",{staticClass:"mask black"}),t._v(" "),r("p",{staticClass:"thumb",style:t.styles.saturationThumb})])]),t._v(" "),r("section",{staticClass:"controls"},[r("section",{staticClass:"sliders"},[r("v-ctrl",{attrs:{direction:"h",precision:2,throttle:80},on:{change:t.onHueChange}},[r("div",{staticClass:"slider bar hue"},[r("div",{staticClass:"thumb",style:t.styles.hueThumb})])]),t._v(" "),r("v-ctrl",{attrs:{direction:"h",precision:2,throttle:80},on:{change:t.onAlphaChange}},[r("div",{staticClass:"slider alpha"},[r("div",{staticClass:"thumb",style:t.styles.alphaThumb}),t._v(" "),r("div",{staticClass:"bar",style:t.styles.alphaTrack})])])],1),t._v(" "),r("section",{staticClass:"modes"},[r("select",{directives:[{name:"model",rawName:"v-model",value:t.currentMode,expression:"currentMode"}],staticClass:"mode-input select",on:{change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.currentMode=e.target.multiple?r:r[0]}}},t._l(t.colorModes,(function(e,n){return r("option",{key:n,domProps:{value:n}},[t._v("\n "+t._s(n)+"\n ")])})),0),t._v(" "),t._l(t.colorModes[t.currentMode],(function(e){return r("input",{key:e,staticClass:"mode-input",attrs:{type:t.constrains[e].type,maxlength:t.constrains[e].maxlength},domProps:{value:t.colorModel[e]},on:{input:function(r){return t.handleInput(e,r)}}})}))],2)]),t._v(" "),t.withSuggestions&&t.suggestions.length>0?r("section",{staticClass:"suggestions"},[r("p",[t._v("Previously used colors")]),t._v(" "),r("ul",t._l(t.suggestions,(function(e){return r("li",{key:e},[r("button",{staticClass:"suggestion",style:{backgroundColor:e},attrs:{type:"button"},on:{click:function(r){return t.onClickColor(e)}}})])})),0)]):t._e()],1)},staticRenderFns:[]},(function(t){t&&t("data-v-8fc876ba_0",{source:".wrapper[data-v-8fc876ba]{width:260px;margin:0;background:#fff;border-radius:2px;box-shadow:0 0 2px rgba(0,0,0,.3),0 4px 8px rgba(0,0,0,.3);user-select:none}.slider[data-v-8fc876ba]{position:relative;margin-bottom:16px}.slider.hue[data-v-8fc876ba]{background:linear-gradient(-90deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.slider.alpha[data-v-8fc876ba]{margin-top:8px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==) left center}.bar[data-v-8fc876ba]{height:8px;border-radius:4px}.controls[data-v-8fc876ba]{padding:20px 16px;padding-bottom:16px}.modes[data-v-8fc876ba]{display:flex;align-items:center}.mode-input[data-v-8fc876ba]{width:100%;appearance:none;-webkit-appearance:none;font-size:12px;line-height:1.5;text-align:center;text-transform:uppercase;border:none;padding:0;font-family:Inter,Helvetica,Arial,sans-serif;color:#1a202c}.mode-input.select[data-v-8fc876ba]{flex:0 0 42px;margin-right:10px;background-repeat:no-repeat;background-size:6px;background-position:center right;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI2IiB2aWV3Qm94PSIwIDAgOCA2IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMSAxLjQ3MzM5TDQgNC41MjY2Nkw3IDEuNDczMzkiIHN0cm9rZT0iIzlFQjVDOCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=)}.thumb[data-v-8fc876ba]{position:absolute;width:12px;height:12px;top:0;border-radius:50%;margin-top:-1px;transform:translateX(-50%);background-color:#f8f8f8;box-shadow:0 1px 4px 0 rgba(0,0,0,.368627);cursor:default}.saturation[data-v-8fc876ba]{position:relative;width:100%;padding-bottom:55%;overflow:hidden}.saturation>div[data-v-8fc876ba]{position:absolute;top:0;left:0;right:0;bottom:0;margin:0}.saturation>.thumb[data-v-8fc876ba]{background-color:transparent;transform:translate(-50%,-50%);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4)}.mask.white[data-v-8fc876ba]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.mask.black[data-v-8fc876ba]{background:linear-gradient(0deg,#000,transparent)}.suggestions[data-v-8fc876ba]{border-top:1px solid #e2e8f0;padding:20px 16px;padding-top:16px}.suggestions p[data-v-8fc876ba]{margin-top:0;margin-bottom:10px;font-family:Inter,Helvetica,Arial,sans-serif;font-size:12px;line-height:1.5;color:#1a202c}.suggestions ul[data-v-8fc876ba]{display:flex;align-items:center;margin:0;padding:0;list-style:none}.suggestion[data-v-8fc876ba]{width:24px;height:24px;margin:4px;border:1px solid #e2e8f0;border-radius:50%}",map:void 0,media:void 0})}),jr,"data-v-8fc876ba",false,undefined,!1,Ar,void 0,void 0)},props:{value:{type:String,default:"#ff0000"},withSuggestions:{type:Boolean,default:!0},position:{type:String,default:Sr.BOTTOM,validator:t=>Object.values(Sr).includes(t)}},data:()=>({isVisible:!1}),computed:{currentTransitionName(){switch(this.position){case Sr.BOTTOM:return"slide-down";case Sr.LEFT:return"slide-left";case Sr.RIGHT:return"slide-right";case Sr.TOP:return"slide-up"}},framePositionClass(){switch(this.position){case Sr.BOTTOM:return"bottom";case Sr.LEFT:return"left";case Sr.RIGHT:return"right";case Sr.TOP:return"top"}}},watch:{isVisible(t){t?document.body.addEventListener("click",this.onClickOutside):document.body.removeEventListener("click",this.onClickOutside)}},created(){document.addEventListener("keyup",this.onKeydown)},beforeDestroy(){document.removeEventListener("keyup",this.onKeydown)},methods:{getElementPath(t){const e=[];let r=t;for(;r!==document.body;)e.unshift(r),r=r.parentElement;return e},onToggle(){this.isVisible=!this.isVisible},onKeydown(t){this.isVisible&&"Escape"===t.code&&(this.isVisible=!1)},onClickOutside(t){(t.path||this.getElementPath(t.target)).includes(this.$refs.root)||(this.isVisible=!1)},onInput(t,e){this.$emit("input",t),e&&(this.isVisible=!1)}}},"data-v-65ed649e",false,undefined,!1,Ar,void 0,void 0)}));
{
"name": "@uscreentv/v-color",
"version": "1.2.0",
"version": "1.2.1",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "module": "dist/index.esm.js",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc