jodit-pro
Version:
PRO Version of Jodit Editor
1 lines • 69.9 kB
JavaScript
((t,e)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var s=e();for(var r in s)("object"==typeof exports?exports:t)[r]=s[r]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[881],{43746(t){"undefined"!=typeof self&&self,t.exports=(t=>{var e={};function s(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,s),o.l=!0,o.exports}return s.m=t,s.c=e,s.d=(t,e,r)=>{s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=(t,e)=>{if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(s.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)s.d(r,o,(e=>t[e]).bind(null,o));return r},s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,"a",e),e},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s.p="",s(s.s=1)})([(t,e,s)=>{"use strict";var r=s(3);function o(t){return!0===r(t)&&"[object Object]"===Object.prototype.toString.call(t)}t.exports=t=>{var e,s;return!1!==o(t)&&"function"==typeof(e=t.constructor)&&!1!==o(s=e.prototype)&&!1!==s.hasOwnProperty("isPrototypeOf")}},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=e.PALETTE_MATERIAL_CHROME=e.PALETTE_MATERIAL_500=e.COLOR_NAMES=e.getLuminance=e.intToRgb=e.rgbToInt=e.rgbToHsv=e.rgbToHsl=e.hslToRgb=e.rgbToHex=e.parseColor=e.parseColorToHsla=e.parseColorToHsl=e.parseColorToRgba=e.parseColorToRgb=e.from=e.createPicker=void 0;var r=(()=>{function t(t,e){for(var s=0;e.length>s;s++){var r=e[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return(e,s,r)=>(s&&t(e.prototype,s),r&&t(e,r),e)})(),o=(t,e)=>{if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return((t,e)=>{var s=[],r=!0,o=!1,a=void 0;try{for(var i,n=t[Symbol.iterator]();!(r=(i=n.next()).done)&&(s.push(i.value),!e||s.length!==e);r=!0);}catch(t){o=!0,a=t}finally{try{!r&&n.return&&n.return()}finally{if(o)throw a}}return s})(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=s(2),i=l(s(0)),n=l(s(4));function l(t){return t&&t.__esModule?t:{default:t}}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t){if(Array.isArray(t)){for(var e=0,s=Array(t.length);t.length>e;e++)s[e]=t[e];return s}return Array.from(t)}var h="undefined"!=typeof window&&window.navigator.userAgent.indexOf("Edge")>-1,b="undefined"!=typeof window&&window.navigator.userAgent.indexOf("rv:")>-1,u={id:null,attachTo:"body",showHSL:!0,showRGB:!0,showHEX:!0,showAlpha:!1,color:"#ff0000",palette:null,paletteEditable:!1,useAlphaInPalette:"auto",slBarSize:[232,150],hueBarSize:[150,11],alphaBarSize:[150,11]},d="COLOR",f="RGBA_USER",x="HSLA_USER";function g(t,e,s){return t?t instanceof HTMLElement?t:t instanceof NodeList?t[0]:"string"==typeof t?document.querySelector(t):t.jquery?t.get(0):s?e:null:e}function y(t){var e=t.getContext("2d"),s=+t.width,r=+t.height,i=e.createLinearGradient(1,1,1,r-1);return i.addColorStop(0,"white"),i.addColorStop(1,"black"),{setHue(t){var o=e.createLinearGradient(1,0,s-1,0);o.addColorStop(0,"hsla("+t+", 100%, 50%, 0)"),o.addColorStop(1,"hsla("+t+", 100%, 50%, 1)"),e.fillStyle=i,e.fillRect(0,0,s,r),e.fillStyle=o,e.globalCompositeOperation="multiply",e.fillRect(0,0,s,r),e.globalCompositeOperation="source-over"},grabColor(t,s){return e.getImageData(t,s,1,1).data},findColor(t,e,i){var n=(0,a.rgbToHsv)(t,e,i),l=o(n,3);return[l[1]*s,r-l[2]*r]}}}function v(t,e,s){return null===t?e:/^\s*$/.test(t)?s:!!/true|yes|1/i.test(t)||!/false|no|0/i.test(t)&&e}function m(t,e,s){if(null===t)return e;if(/^\s*$/.test(t))return s;var r=t.split(",").map(Number);return 2===r.length&&r[0]&&r[1]?r:e}var w=function(){function t(e,s){if(p(this,t),s?(e=g(e),this.options=Object.assign({},u,s)):e&&(0,i.default)(e)?(this.options=Object.assign({},u,e),e=g(this.options.attachTo)):(this.options=Object.assign({},u),e=g((0,a.nvl)(e,this.options.attachTo))),!e)throw Error("Container not found: "+this.options.attachTo);!function(t,e){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"acp-";if(e.hasAttribute(s+"show-hsl")&&(t.showHSL=v(e.getAttribute(s+"show-hsl"),u.showHSL,!0)),e.hasAttribute(s+"show-rgb")&&(t.showRGB=v(e.getAttribute(s+"show-rgb"),u.showRGB,!0)),e.hasAttribute(s+"show-hex")&&(t.showHEX=v(e.getAttribute(s+"show-hex"),u.showHEX,!0)),e.hasAttribute(s+"show-alpha")&&(t.showAlpha=v(e.getAttribute(s+"show-alpha"),u.showAlpha,!0)),e.hasAttribute(s+"palette-editable")&&(t.paletteEditable=v(e.getAttribute(s+"palette-editable"),u.paletteEditable,!0)),e.hasAttribute(s+"sl-bar-size")&&(t.slBarSize=m(e.getAttribute(s+"sl-bar-size"),u.slBarSize,[232,150])),e.hasAttribute(s+"hue-bar-size")&&(t.hueBarSize=m(e.getAttribute(s+"hue-bar-size"),u.hueBarSize,[150,11]),t.alphaBarSize=t.hueBarSize),e.hasAttribute(s+"palette")){var r=e.getAttribute(s+"palette");switch(r){case"PALETTE_MATERIAL_500":t.palette=a.PALETTE_MATERIAL_500;break;case"PALETTE_MATERIAL_CHROME":case"":t.palette=a.PALETTE_MATERIAL_CHROME;break;default:t.palette=r.split(/[;|]/)}}e.hasAttribute(s+"color")&&(t.color=e.getAttribute(s+"color"))}(this.options,e),this.H=0,this.S=0,this.L=0,this.R=0,this.G=0,this.B=0,this.A=1,this.palette={},this.element=document.createElement("div"),this.options.id&&(this.element.id=this.options.id),this.element.className="a-color-picker",this.element.innerHTML=n.default,e.appendChild(this.element);var r=this.element.querySelector(".a-color-picker-h");this.setupHueCanvas(r),this.hueBarHelper=y(r),this.huePointer=this.element.querySelector(".a-color-picker-h+.a-color-picker-dot");var o=this.element.querySelector(".a-color-picker-sl");this.setupSlCanvas(o),this.slBarHelper=y(o),this.slPointer=this.element.querySelector(".a-color-picker-sl+.a-color-picker-dot"),this.preview=this.element.querySelector(".a-color-picker-preview"),this.setupClipboard(this.preview.querySelector(".a-color-picker-clipbaord")),this.options.showHSL?(this.setupInput(this.inputH=this.element.querySelector(".a-color-picker-hsl>input[nameref=H]")),this.setupInput(this.inputS=this.element.querySelector(".a-color-picker-hsl>input[nameref=S]")),this.setupInput(this.inputL=this.element.querySelector(".a-color-picker-hsl>input[nameref=L]"))):this.element.querySelector(".a-color-picker-hsl").remove(),this.options.showRGB?(this.setupInput(this.inputR=this.element.querySelector(".a-color-picker-rgb>input[nameref=R]")),this.setupInput(this.inputG=this.element.querySelector(".a-color-picker-rgb>input[nameref=G]")),this.setupInput(this.inputB=this.element.querySelector(".a-color-picker-rgb>input[nameref=B]"))):this.element.querySelector(".a-color-picker-rgb").remove(),this.options.showHEX?this.setupInput(this.inputRGBHEX=this.element.querySelector("input[nameref=RGBHEX]")):this.element.querySelector(".a-color-picker-rgbhex").remove(),this.options.paletteEditable||this.options.palette&&this.options.palette.length>0?this.setPalette(this.paletteRow=this.element.querySelector(".a-color-picker-palette")):(this.paletteRow=this.element.querySelector(".a-color-picker-palette"),this.paletteRow.remove()),this.options.showAlpha?(this.setupAlphaCanvas(this.element.querySelector(".a-color-picker-a")),this.alphaPointer=this.element.querySelector(".a-color-picker-a+.a-color-picker-dot")):this.element.querySelector(".a-color-picker-alpha").remove(),this.element.style.width=this.options.slBarSize[0]+"px",this.onValueChanged(d,this.options.color)}return r(t,[{key:"setupHueCanvas",value(t){var e=this;t.width=this.options.hueBarSize[0],t.height=this.options.hueBarSize[1];for(var s=t.getContext("2d"),r=s.createLinearGradient(0,0,this.options.hueBarSize[0],0),o=0;1>=o;o+=1/360)r.addColorStop(o,"hsl("+360*o+", 100%, 50%)");s.fillStyle=r,s.fillRect(0,0,this.options.hueBarSize[0],this.options.hueBarSize[1]);var i=s=>{var r=(0,a.limit)(s.clientX-t.getBoundingClientRect().left,0,e.options.hueBarSize[0]),o=Math.round(360*r/e.options.hueBarSize[0]);e.huePointer.style.left=r-7+"px",e.onValueChanged("H",o)},n=function t(){document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",t)};t.addEventListener("mousedown",(t=>{i(t),document.addEventListener("mousemove",i),document.addEventListener("mouseup",n)}))}},{key:"setupSlCanvas",value(t){var e=this;t.width=this.options.slBarSize[0],t.height=this.options.slBarSize[1];var s=s=>{var r=(0,a.limit)(s.clientX-t.getBoundingClientRect().left,0,e.options.slBarSize[0]-1),o=(0,a.limit)(s.clientY-t.getBoundingClientRect().top,0,e.options.slBarSize[1]-1),i=e.slBarHelper.grabColor(r,o);e.slPointer.style.left=r-7+"px",e.slPointer.style.top=o-7+"px",e.onValueChanged("RGB",i)},r=function t(){document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",t)};t.addEventListener("mousedown",(t=>{s(t),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r)}))}},{key:"setupAlphaCanvas",value(t){var e=this;t.width=this.options.alphaBarSize[0],t.height=this.options.alphaBarSize[1];var s=t.getContext("2d"),r=s.createLinearGradient(0,0,t.width-1,0);r.addColorStop(0,"hsla(0, 0%, 50%, 0)"),r.addColorStop(1,"hsla(0, 0%, 50%, 1)"),s.fillStyle=r,s.fillRect(0,0,this.options.alphaBarSize[0],this.options.alphaBarSize[1]);var o=s=>{var r=(0,a.limit)(s.clientX-t.getBoundingClientRect().left,0,e.options.alphaBarSize[0]),o=+(r/e.options.alphaBarSize[0]).toFixed(2);e.alphaPointer.style.left=r-7+"px",e.onValueChanged("ALPHA",o)},i=function t(){document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",t)};t.addEventListener("mousedown",(t=>{o(t),document.addEventListener("mousemove",o),document.addEventListener("mouseup",i)}))}},{key:"setupInput",value(t){var e=this,s=+t.min,r=+t.max,o=t.getAttribute("nameref");t.hasAttribute("select-on-focus")&&t.addEventListener("focus",(()=>{t.select()})),"text"===t.type?t.addEventListener("change",(()=>{e.onValueChanged(o,t.value)})):((h||b)&&t.addEventListener("keydown",(i=>{"Up"===i.key?(t.value=(0,a.limit)(+t.value+1,s,r),e.onValueChanged(o,t.value),i.returnValue=!1):"Down"===i.key&&(t.value=(0,a.limit)(+t.value-1,s,r),e.onValueChanged(o,t.value),i.returnValue=!1)})),t.addEventListener("change",(()=>{e.onValueChanged(o,(0,a.limit)(+t.value,s,r))})))}},{key:"setupClipboard",value(t){var e=this;t.title="click to copy",t.addEventListener("click",(()=>{t.value=(0,a.parseColor)([e.R,e.G,e.B,e.A],"hexcss4"),t.select(),document.execCommand("copy")}))}},{key:"setPalette",value(t){var e=this,s="auto"===this.options.useAlphaInPalette?this.options.showAlpha:this.options.useAlphaInPalette,r=null;switch(this.options.palette){case"PALETTE_MATERIAL_500":r=a.PALETTE_MATERIAL_500;break;case"PALETTE_MATERIAL_CHROME":r=a.PALETTE_MATERIAL_CHROME;break;default:r=(0,a.ensureArray)(this.options.palette)}if(this.options.paletteEditable||r.length>0){var o=(s,r,o)=>{var a=t.querySelector('.a-color-picker-palette-color[data-color="'+s+'"]')||document.createElement("div");a.className="a-color-picker-palette-color",a.style.backgroundColor=s,a.setAttribute("data-color",s),a.title=s,t.insertBefore(a,r),e.palette[s]=!0,o&&e.onPaletteColorAdd(s)},i=(s,r)=>{s?(t.removeChild(s),e.palette[s.getAttribute("data-color")]=!1,r&&e.onPaletteColorRemove(s.getAttribute("data-color"))):(t.querySelectorAll(".a-color-picker-palette-color[data-color]").forEach((e=>{t.removeChild(e)})),Object.keys(e.palette).forEach((t=>{e.palette[t]=!1})),r&&e.onPaletteColorRemove())};if(r.map((t=>(0,a.parseColor)(t,s?"rgbcss4":"hex"))).filter((t=>!!t)).forEach((t=>o(t))),this.options.paletteEditable){var n=document.createElement("div");n.className="a-color-picker-palette-color a-color-picker-palette-add",n.innerHTML="+",t.appendChild(n),t.addEventListener("click",(t=>{/a-color-picker-palette-add/.test(t.target.className)?t.shiftKey?i(null,!0):o(s?(0,a.parseColor)([e.R,e.G,e.B,e.A],"rgbcss4"):(0,a.rgbToHex)(e.R,e.G,e.B),t.target,!0):/a-color-picker-palette-color/.test(t.target.className)&&(t.shiftKey?i(t.target,!0):e.onValueChanged(d,t.target.getAttribute("data-color")))}))}else t.addEventListener("click",(t=>{/a-color-picker-palette-color/.test(t.target.className)&&e.onValueChanged(d,t.target.getAttribute("data-color"))}))}else t.style.display="none"}},{key:"updatePalette",value(t){this.paletteRow.innerHTML="",this.palette={},this.paletteRow.parentElement||this.element.appendChild(this.paletteRow),this.options.palette=t,this.setPalette(this.paletteRow)}},{key:"onValueChanged",value(t,e){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{silent:!1};switch(t){case"H":this.H=e;var r=(0,a.hslToRgb)(this.H,this.S,this.L),i=o(r,3);this.R=i[0],this.G=i[1],this.B=i[2],this.slBarHelper.setHue(e),this.updatePointerH(this.H),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"S":this.S=e;var n=(0,a.hslToRgb)(this.H,this.S,this.L),l=o(n,3);this.R=l[0],this.G=l[1],this.B=l[2],this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"L":this.L=e;var p=(0,a.hslToRgb)(this.H,this.S,this.L),c=o(p,3);this.R=c[0],this.G=c[1],this.B=c[2],this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"R":this.R=e;var h=(0,a.rgbToHsl)(this.R,this.G,this.B),b=o(h,3);this.H=b[0],this.S=b[1],this.L=b[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"G":this.G=e;var u=(0,a.rgbToHsl)(this.R,this.G,this.B),g=o(u,3);this.H=g[0],this.S=g[1],this.L=g[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"B":this.B=e;var y=(0,a.rgbToHsl)(this.R,this.G,this.B),v=o(y,3);this.H=v[0],this.S=v[1],this.L=v[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"RGB":var m=o(e,3);this.R=m[0],this.G=m[1],this.B=m[2];var w=(0,a.rgbToHsl)(this.R,this.G,this.B),S=o(w,3);this.H=S[0],this.S=S[1],this.L=S[2],this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B);break;case f:var A=o(e,4);this.R=A[0],this.G=A[1],this.B=A[2],this.A=A[3];var k=(0,a.rgbToHsl)(this.R,this.G,this.B),E=o(k,3);this.H=E[0],this.S=E[1],this.L=E[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B),this.updatePointerA(this.A);break;case x:var C=o(e,4);this.H=C[0],this.S=C[1],this.L=C[2],this.A=C[3];var F=(0,a.hslToRgb)(this.H,this.S,this.L),B=o(F,3);this.R=B[0],this.G=B[1],this.B=B[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B),this.updatePointerA(this.A);break;case"RGBHEX":var R=(0,a.cssColorToRgb)(e)||[this.R,this.G,this.B],H=o(R,3);this.R=H[0],this.G=H[1],this.B=H[2];var L=(0,a.rgbToHsl)(this.R,this.G,this.B),T=o(L,3);this.H=T[0],this.S=T[1],this.L=T[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B);break;case d:var _=(0,a.parseColor)(e,"rgba")||[0,0,0,1],I=o(_,4);this.R=I[0],this.G=I[1],this.B=I[2],this.A=I[3];var G=(0,a.rgbToHsl)(this.R,this.G,this.B),O=o(G,3);this.H=O[0],this.S=O[1],this.L=O[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B),this.updatePointerA(this.A);break;case"ALPHA":this.A=e}this.preview.style.backgroundColor=1===this.A?"rgb("+this.R+","+this.G+","+this.B+")":"rgba("+this.R+","+this.G+","+this.B+","+this.A+")",s&&s.silent||this.onchange&&this.onchange(this.preview.style.backgroundColor)}},{key:"onPaletteColorAdd",value(t){this.oncoloradd&&this.oncoloradd(t)}},{key:"onPaletteColorRemove",value(t){this.oncolorremove&&this.oncolorremove(t)}},{key:"updateInputHSL",value(t,e,s){this.options.showHSL&&(this.inputH.value=t,this.inputS.value=e,this.inputL.value=s)}},{key:"updateInputRGB",value(t,e,s){this.options.showRGB&&(this.inputR.value=t,this.inputG.value=e,this.inputB.value=s)}},{key:"updateInputRGBHEX",value(t,e,s){this.options.showHEX&&(this.inputRGBHEX.value=(0,a.rgbToHex)(t,e,s))}},{key:"updatePointerH",value(t){this.huePointer.style.left=this.options.hueBarSize[0]*t/360-7+"px"}},{key:"updatePointerSL",value(t,e,s){var r=(0,a.hslToRgb)(t,e,s),i=o(r,3),n=this.slBarHelper.findColor(i[0],i[1],i[2]),l=o(n,2),p=l[0],c=l[1];p>=0&&(this.slPointer.style.left=p-7+"px",this.slPointer.style.top=c-7+"px")}},{key:"updatePointerA",value(t){this.options.showAlpha&&(this.alphaPointer.style.left=this.options.alphaBarSize[0]*t-7+"px")}}]),t}(),S=function(){function t(e){p(this,t),this.name=e,this.listeners=[]}return r(t,[{key:"on",value(t){t&&this.listeners.push(t)}},{key:"off",value(t){this.listeners=t?this.listeners.filter((e=>e!==t)):[]}},{key:"emit",value(t,e){for(var s=this.listeners.slice(0),r=0;s.length>r;r++)s[r].apply(e,t)}}]),t}();function A(t,e){var s=new w(t,e),r={change:new S("change"),coloradd:new S("coloradd"),colorremove:new S("colorremove")},i=!0,n={},l={get element(){return s.element},get rgb(){return[s.R,s.G,s.B]},set rgb(t){var e=o(t,3),r=e[0],i=e[1],n=e[2],l=[(0,a.limit)(r,0,255),(0,a.limit)(i,0,255),(0,a.limit)(n,0,255)];s.onValueChanged(f,[r=l[0],i=l[1],n=l[2],1])},get hsl(){return[s.H,s.S,s.L]},set hsl(t){var e=o(t,3),r=e[0],i=e[1],n=e[2],l=[(0,a.limit)(r,0,360),(0,a.limit)(i,0,100),(0,a.limit)(n,0,100)];s.onValueChanged(x,[r=l[0],i=l[1],n=l[2],1])},get rgbhex(){return this.all.hex},get rgba(){return[s.R,s.G,s.B,s.A]},set rgba(t){var e=o(t,4),r=e[0],i=e[1],n=e[2],l=e[3],p=[(0,a.limit)(r,0,255),(0,a.limit)(i,0,255),(0,a.limit)(n,0,255),(0,a.limit)(l,0,1)];s.onValueChanged(f,[r=p[0],i=p[1],n=p[2],l=p[3]])},get hsla(){return[s.H,s.S,s.L,s.A]},set hsla(t){var e=o(t,4),r=e[0],i=e[1],n=e[2],l=e[3],p=[(0,a.limit)(r,0,360),(0,a.limit)(i,0,100),(0,a.limit)(n,0,100),(0,a.limit)(l,0,1)];s.onValueChanged(x,[r=p[0],i=p[1],n=p[2],l=p[3]])},get color(){return""+this.all},set color(t){s.onValueChanged(d,t)},setColor(t){s.onValueChanged(d,t,{silent:arguments.length>1&&void 0!==arguments[1]&&arguments[1]})},get all(){if(i){var t=[s.R,s.G,s.B,s.A],e=1>s.A?"rgba("+s.R+","+s.G+","+s.B+","+s.A+")":a.rgbToHex.apply(void 0,t);(n=(0,a.parseColor)(t,n)).toString=()=>e,i=!1}return Object.assign({},n)},get onchange(){return r.change&&r.change.listeners[0]},set onchange(t){this.off("change").on("change",t)},get oncoloradd(){return r.coloradd&&r.coloradd.listeners[0]},set oncoloradd(t){this.off("coloradd").on("coloradd",t)},get oncolorremove(){return r.colorremove&&r.colorremove.listeners[0]},set oncolorremove(t){this.off("colorremove").on("colorremove",t)},get palette(){return Object.keys(s.palette).filter((t=>s.palette[t]))},set palette(t){s.updatePalette(t)},show(){s.element.classList.remove("hidden")},hide(){s.element.classList.add("hidden")},toggle(){s.element.classList.toggle("hidden")},on(t,e){return t&&r[t]&&r[t].on(e),this},off(t,e){return t&&r[t]&&r[t].off(e),this},destroy(){r.change.off(),r.coloradd.off(),r.colorremove.off(),s.element.remove(),r=null,s=null}};return s.onchange=function(){for(var t=arguments.length,e=Array(t),s=0;t>s;s++)e[s]=arguments[s];i=!0,r.change.emit([l].concat(e),l)},s.oncoloradd=function(){for(var t=arguments.length,e=Array(t),s=0;t>s;s++)e[s]=arguments[s];r.coloradd.emit([l].concat(e),l)},s.oncolorremove=function(){for(var t=arguments.length,e=Array(t),s=0;t>s;s++)e[s]=arguments[s];r.colorremove.emit([l].concat(e),l)},s.element.ctrl=l,l}if("undefined"!=typeof window&&!document.querySelector('head>style[data-source="a-color-picker"]')){var k=""+s(5),E=document.createElement("style");E.setAttribute("type","text/css"),E.setAttribute("data-source","a-color-picker"),E.innerHTML=k,document.querySelector("head").appendChild(E)}e.createPicker=A,e.from=function(t,e){var s=(t=>t?Array.isArray(t)?t:t instanceof HTMLElement?[t]:t instanceof NodeList?[].concat(c(t)):"string"==typeof t?[].concat(c(document.querySelectorAll(t))):t.jquery?t.get():[]:[])(t).map(((t,s)=>{var r=A(t,e);return r.index=s,r}));return s.on=function(t,e){return s.forEach((s=>s.on(t,e))),this},s.off=function(t){return s.forEach((e=>e.off(t))),this},s},e.parseColorToRgb=a.parseColorToRgb,e.parseColorToRgba=a.parseColorToRgba,e.parseColorToHsl=a.parseColorToHsl,e.parseColorToHsla=a.parseColorToHsla,e.parseColor=a.parseColor,e.rgbToHex=a.rgbToHex,e.hslToRgb=a.hslToRgb,e.rgbToHsl=a.rgbToHsl,e.rgbToHsv=a.rgbToHsv,e.rgbToInt=a.rgbToInt,e.intToRgb=a.intToRgb,e.getLuminance=a.getLuminance,e.COLOR_NAMES=a.COLOR_NAMES,e.PALETTE_MATERIAL_500=a.PALETTE_MATERIAL_500,e.PALETTE_MATERIAL_CHROME=a.PALETTE_MATERIAL_CHROME,e.VERSION="1.2.1"},(t,e,s)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.nvl=e.ensureArray=e.limit=e.getLuminance=e.parseColor=e.parseColorToHsla=e.parseColorToHsl=e.cssHslaToHsla=e.cssHslToHsl=e.parseColorToRgba=e.parseColorToRgb=e.cssRgbaToRgba=e.cssRgbToRgb=e.cssColorToRgba=e.cssColorToRgb=e.intToRgb=e.rgbToInt=e.rgbToHsv=e.rgbToHsl=e.hslToRgb=e.rgbToHex=e.PALETTE_MATERIAL_CHROME=e.PALETTE_MATERIAL_500=e.COLOR_NAMES=void 0;var r=(t,e)=>{if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return((t,e)=>{var s=[],r=!0,o=!1,a=void 0;try{for(var i,n=t[Symbol.iterator]();!(r=(i=n.next()).done)&&(s.push(i.value),!e||s.length!==e);r=!0);}catch(t){o=!0,a=t}finally{try{!r&&n.return&&n.return()}finally{if(o)throw a}}return s})(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=(t=>t&&t.__esModule?t:{default:t})(s(0));function a(t){if(Array.isArray(t)){for(var e=0,s=Array(t.length);t.length>e;e++)s[e]=t[e];return s}return Array.from(t)}var i={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4","indianred ":"#CD5C5C","indigo ":"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"};function n(t,e,s){return isNaN(t=+t)||e>t?e:t>s?s:t}function l(t,e){return null==t?e:t}function p(t,e,s){var r=[n(t,0,255),n(e,0,255),n(s,0,255)];return"#"+("000000"+((t=r[0])<<16|(e=r[1])<<8|(s=r[2])).toString(16)).slice(-6)}function c(t,e,s){var r=void 0,o=void 0,a=void 0,i=[n(t,0,360)/360,n(e,0,100)/100,n(s,0,100)/100];if(t=i[0],s=i[2],0==(e=i[1]))r=o=a=s;else{var l=(t,e,s)=>(0>s&&(s+=1),s>1&&(s-=1),1/6>s?t+6*(e-t)*s:.5>s?e:2/3>s?t+(e-t)*(2/3-s)*6:t),p=.5>s?s*(1+e):s+e-s*e,c=2*s-p;r=l(c,p,t+1/3),o=l(c,p,t),a=l(c,p,t-1/3)}return[255*r,255*o,255*a].map(Math.round)}function h(t,e,s){var r=[n(t,0,255)/255,n(e,0,255)/255,n(s,0,255)/255],o=Math.max(t=r[0],e=r[1],s=r[2]),a=Math.min(t,e,s),i=void 0,l=void 0,p=(o+a)/2;if(o==a)i=l=0;else{var c=o-a;switch(l=p>.5?c/(2-o-a):c/(o+a),o){case t:i=(e-s)/c+(s>e?6:0);break;case e:i=(s-t)/c+2;break;case s:i=(t-e)/c+4}i/=6}return[360*i,100*l,100*p].map(Math.round)}function b(t,e,s){return t<<16|e<<8|s}function u(t){if(t){var e=/^\s*#?((([0-9A-F])([0-9A-F])([0-9A-F]))|(([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})))\s*$/i.exec(i[(""+t).toLowerCase()]||t)||[],s=r(e,10),o=s[3],a=s[4],n=s[5],l=s[7],p=s[8],c=s[9];if(void 0!==o)return[parseInt(o+o,16),parseInt(a+a,16),parseInt(n+n,16)];if(void 0!==l)return[parseInt(l,16),parseInt(p,16),parseInt(c,16)]}}function d(t){if(t){var e=/^\s*#?((([0-9A-F])([0-9A-F])([0-9A-F])([0-9A-F])?)|(([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})?))\s*$/i.exec(i[(""+t).toLowerCase()]||t)||[],s=r(e,12),o=s[3],a=s[4],n=s[5],l=s[6],p=s[8],c=s[9],h=s[10],b=s[11];if(void 0!==o)return[parseInt(o+o,16),parseInt(a+a,16),parseInt(n+n,16),l?+(parseInt(l+l,16)/255).toFixed(2):1];if(void 0!==p)return[parseInt(p,16),parseInt(c,16),parseInt(h,16),b?+(parseInt(b,16)/255).toFixed(2):1]}}function f(t){if(t){var e=/^rgb\((\d+)[\s,](\d+)[\s,](\d+)\)/i.exec(t)||[],s=r(e,4),o=s[2],a=s[3];return s[0]?[n(s[1],0,255),n(o,0,255),n(a,0,255)]:void 0}}function x(t){if(t){var e=/^rgba?\((\d+)\s*[\s,]\s*(\d+)\s*[\s,]\s*(\d+)(\s*[\s,]\s*(\d*(.\d+)?))?\)/i.exec(t)||[],s=r(e,6),o=s[2],a=s[3],i=s[5];return s[0]?[n(s[1],0,255),n(o,0,255),n(a,0,255),n(l(i,1),0,1)]:void 0}}function g(t){if(Array.isArray(t))return[n(t[0],0,255),n(t[1],0,255),n(t[2],0,255),n(l(t[3],1),0,1)];var e=d(t)||x(t);return e&&3===e.length&&e.push(1),e}function y(t){if(t){var e=/^hsl\((\d+)[\s,](\d+)[\s,](\d+)\)/i.exec(t)||[],s=r(e,4),o=s[2],a=s[3];return s[0]?[n(s[1],0,360),n(o,0,100),n(a,0,100)]:void 0}}function v(t){if(t){var e=/^hsla?\((\d+)\s*[\s,]\s*(\d+)\s*[\s,]\s*(\d+)(\s*[\s,]\s*(\d*(.\d+)?))?\)/i.exec(t)||[],s=r(e,6),o=s[2],a=s[3],i=s[5];return s[0]?[n(s[1],0,255),n(o,0,255),n(a,0,255),n(l(i,1),0,1)]:void 0}}function m(t){if(Array.isArray(t))return[n(t[0],0,360),n(t[1],0,100),n(t[2],0,100),n(l(t[3],1),0,1)];var e=v(t);return e&&3===e.length&&e.push(1),e}function w(t,e){switch(e){case"rgb":default:return t.slice(0,3);case"rgbcss":return"rgb("+t[0]+", "+t[1]+", "+t[2]+")";case"rgbcss4":return"rgb("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")";case"rgba":return t;case"rgbacss":return"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")";case"hsl":return h.apply(void 0,a(t));case"hslcss":return"hsl("+(t=h.apply(void 0,a(t)))[0]+", "+t[1]+", "+t[2]+")";case"hslcss4":var s=h.apply(void 0,a(t));return"hsl("+s[0]+", "+s[1]+", "+s[2]+", "+t[3]+")";case"hsla":return[].concat(a(h.apply(void 0,a(t))),[t[3]]);case"hslacss":var r=h.apply(void 0,a(t));return"hsla("+r[0]+", "+r[1]+", "+r[2]+", "+t[3]+")";case"hex":return p.apply(void 0,a(t));case"hexcss4":return p.apply(void 0,a(t))+("00"+parseInt(255*t[3]).toString(16)).slice(-2);case"int":return b.apply(void 0,a(t))}}e.COLOR_NAMES=i,e.PALETTE_MATERIAL_500=["#F44336","#E91E63","#E91E63","#9C27B0","#9C27B0","#673AB7","#673AB7","#3F51B5","#3F51B5","#2196F3","#2196F3","#03A9F4","#03A9F4","#00BCD4","#00BCD4","#009688","#009688","#4CAF50","#4CAF50","#8BC34A","#8BC34A","#CDDC39","#CDDC39","#FFEB3B","#FFEB3B","#FFC107","#FFC107","#FF9800","#FF9800","#FF5722","#FF5722","#795548","#795548","#9E9E9E","#9E9E9E","#607D8B","#607D8B"],e.PALETTE_MATERIAL_CHROME=["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4caf50","#8bc34a","#cddc39","#ffeb3b","#ffc107","#ff9800","#ff5722","#795548","#9e9e9e","#607d8b"],e.rgbToHex=p,e.hslToRgb=c,e.rgbToHsl=h,e.rgbToHsv=(t,e,s)=>{var r,o=[n(t,0,255)/255,n(e,0,255)/255,n(s,0,255)/255],a=Math.max(t=o[0],e=o[1],s=o[2]),i=Math.min(t,e,s),l=void 0,p=a,c=a-i;if(r=0===a?0:c/a,a==i)l=0;else{switch(a){case t:l=(e-s)/c+(s>e?6:0);break;case e:l=(s-t)/c+2;break;case s:l=(t-e)/c+4}l/=6}return[l,r,p]},e.rgbToInt=b,e.intToRgb=t=>[t>>16&255,t>>8&255,255&t],e.cssColorToRgb=u,e.cssColorToRgba=d,e.cssRgbToRgb=f,e.cssRgbaToRgba=x,e.parseColorToRgb=t=>Array.isArray(t)?t=[n(t[0],0,255),n(t[1],0,255),n(t[2],0,255)]:u(t)||f(t),e.parseColorToRgba=g,e.cssHslToHsl=y,e.cssHslaToHsla=v,e.parseColorToHsl=t=>Array.isArray(t)?t=[n(t[0],0,360),n(t[1],0,100),n(t[2],0,100)]:y(t),e.parseColorToHsla=m,e.parseColor=(t,e)=>{if(e=e||"rgb",null!=t){var s=void 0;if((s=g(t))||(s=m(t))&&(s=[].concat(a(c.apply(void 0,a(s))),[s[3]])))return(0,o.default)(e)?["rgb","rgbcss","rgbcss4","rgba","rgbacss","hsl","hslcss","hslcss4","hsla","hslacss","hex","hexcss4","int"].reduce(((t,e)=>(t[e]=w(s,e),t)),e||{}):w(s,(""+e).toLowerCase())}},e.getLuminance=(t,e,s)=>.2126*(t=.03928>(t/=255)?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e=.03928>(e/=255)?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(.03928>(s/=255)?s/12.92:Math.pow((s+.055)/1.055,2.4)),e.limit=n,e.ensureArray=t=>t?Array.from(t):[],e.nvl=l},(t,e,s)=>{"use strict";t.exports=t=>null!=t&&"object"==typeof t&&!1===Array.isArray(t)},(t,e)=>{t.exports='<div class="a-color-picker-row a-color-picker-stack a-color-picker-row-top"> <canvas class="a-color-picker-sl a-color-picker-transparent"></canvas> <div class=a-color-picker-dot></div> </div> <div class=a-color-picker-row> <div class="a-color-picker-stack a-color-picker-transparent a-color-picker-circle"> <div class=a-color-picker-preview> <input class=a-color-picker-clipbaord type=text> </div> </div> <div class=a-color-picker-column> <div class="a-color-picker-cell a-color-picker-stack"> <canvas class=a-color-picker-h></canvas> <div class=a-color-picker-dot></div> </div> <div class="a-color-picker-cell a-color-picker-alpha a-color-picker-stack" show-on-alpha> <canvas class="a-color-picker-a a-color-picker-transparent"></canvas> <div class=a-color-picker-dot></div> </div> </div> </div> <div class="a-color-picker-row a-color-picker-hsl" show-on-hsl> <label>H</label> <input nameref=H type=number maxlength=3 min=0 max=360 value=0> <label>S</label> <input nameref=S type=number maxlength=3 min=0 max=100 value=0> <label>L</label> <input nameref=L type=number maxlength=3 min=0 max=100 value=0> </div> <div class="a-color-picker-row a-color-picker-rgb" show-on-rgb> <label>R</label> <input nameref=R type=number maxlength=3 min=0 max=255 value=0> <label>G</label> <input nameref=G type=number maxlength=3 min=0 max=255 value=0> <label>B</label> <input nameref=B type=number maxlength=3 min=0 max=255 value=0> </div> <div class="a-color-picker-row a-color-picker-rgbhex a-color-picker-single-input" show-on-single-input> <label>HEX</label> <input nameref=RGBHEX type=text select-on-focus> </div> <div class="a-color-picker-row a-color-picker-palette"></div>'},(t,e,s)=>{var r=s(6);t.exports="string"==typeof r?r:""+r},(t,e,s)=>{(t.exports=s(7)(!1)).push([t.i,"/*!\n * a-color-picker\n * https://github.com/narsenico/a-color-picker\n *\n * Copyright (c) 2017-2018, Gianfranco Caldi.\n * Released under the MIT License.\n */.a-color-picker{background-color:#fff;padding:0;display:inline-flex;flex-direction:column;user-select:none;width:232px;font:400 10px Helvetica,Arial,sans-serif;border-radius:3px;box-shadow:0 0 0 1px rgba(0,0,0,.05),0 2px 4px rgba(0,0,0,.25)}.a-color-picker,.a-color-picker-row,.a-color-picker input{box-sizing:border-box}.a-color-picker-row{padding:15px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;user-select:none}.a-color-picker-row-top{padding:0}.a-color-picker-row:not(:first-child){border-top:1px solid #f5f5f5}.a-color-picker-column{display:flex;flex-direction:column}.a-color-picker-cell{flex:1 1 auto;margin-bottom:4px}.a-color-picker-cell:last-child{margin-bottom:0}.a-color-picker-stack{position:relative}.a-color-picker-dot{position:absolute;width:14px;height:14px;top:0;left:0;background:#fff;pointer-events:none;border-radius:50px;z-index:1000;box-shadow:0 1px 2px rgba(0,0,0,.75)}.a-color-picker-a,.a-color-picker-h,.a-color-picker-sl{cursor:cell}.a-color-picker-a+.a-color-picker-dot,.a-color-picker-h+.a-color-picker-dot{top:-2px}.a-color-picker-a,.a-color-picker-h{border-radius:2px}.a-color-picker-preview{box-sizing:border-box;width:30px;height:30px;user-select:none;border-radius:15px}.a-color-picker-circle{border-radius:50px;border:1px solid #eee}.a-color-picker-hsl,.a-color-picker-rgb,.a-color-picker-single-input{justify-content:space-evenly}.a-color-picker-hsl>label,.a-color-picker-rgb>label,.a-color-picker-single-input>label{padding:0 8px;flex:0 0 auto;color:#969696}.a-color-picker-hsl>input,.a-color-picker-rgb>input,.a-color-picker-single-input>input{text-align:center;padding:2px 0;width:0;flex:1 1 auto;border:1px solid #e0e0e0;line-height:20px}.a-color-picker-hsl>input::-webkit-inner-spin-button,.a-color-picker-rgb>input::-webkit-inner-spin-button,.a-color-picker-single-input>input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.a-color-picker-hsl>input:focus,.a-color-picker-rgb>input:focus,.a-color-picker-single-input>input:focus{border-color:#04a9f4;outline:none}.a-color-picker-transparent{background-image:linear-gradient(-45deg,#cdcdcd 25%,transparent 0),linear-gradient(45deg,#cdcdcd 25%,transparent 0),linear-gradient(-45deg,transparent 75%,#cdcdcd 0),linear-gradient(45deg,transparent 75%,#cdcdcd 0);background-size:11px 11px;background-position:0 0,0 -5.5px,-5.5px 5.5px,5.5px 0}.a-color-picker-sl{border-radius:3px 3px 0 0}.a-color-picker.hide-alpha [show-on-alpha],.a-color-picker.hide-hsl [show-on-hsl],.a-color-picker.hide-rgb [show-on-rgb],.a-color-picker.hide-single-input [show-on-single-input]{display:none}.a-color-picker-clipbaord{width:100%;height:100%;opacity:0;cursor:pointer}.a-color-picker-palette{flex-flow:wrap;flex-direction:row;justify-content:flex-start;padding:10px}.a-color-picker-palette-color{width:15px;height:15px;flex:0 1 15px;margin:3px;box-sizing:border-box;cursor:pointer;border-radius:3px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1)}.a-color-picker-palette-add{text-align:center;line-height:13px;color:#607d8b}.a-color-picker.hidden{display:none}",""])},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((e=>{var s=((t,e)=>{var s=t[1]||"",r=t[3];if(!r)return s;if(e&&"function"==typeof btoa){var o=(t=>"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */")(r),a=r.sources.map((t=>"/*# sourceURL="+r.sourceRoot+t+" */"));return[s].concat(a).concat([o]).join("\n")}return""+s})(e,t);return e[2]?"@media "+e[2]+"{"+s+"}":s})).join("")},e.i=function(t,s){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;this.length>o;o++){var a=this[o][0];"number"==typeof a&&(r[a]=!0)}for(o=0;t.length>o;o++){var i=t[o];"number"==typeof i[0]&&r[i[0]]||(s&&!i[2]?i[2]=s:s&&(i[2]="("+i[2]+") and ("+s+")"),e.push(i))}},e}}])},88572(t,e,s){"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t=>typeof t:t=>t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t,r(t)}function o(t,e,s){var o=s.value;if("function"!=typeof o)throw new TypeError("@boundMethod decorator can only be applied to methods not: ".concat(r(o)));var a=!1;return{configurable:!0,get(){if(a||this===t.prototype||this.hasOwnProperty(e)||"function"!=typeof o)return o;var s=o.bind(this);return a=!0,Object.defineProperty(this,e,{configurable:!0,get(){return s},set(t){o=t,delete this[e]}}),a=!1,s},set(t){o=t}}}function a(t){var e;return"undefined"!=typeof Reflect&&"function"==typeof Reflect.ownKeys?e=Reflect.ownKeys(t.prototype):(e=Object.getOwnPropertyNames(t.prototype),"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(t.prototype)))),e.forEach((e=>{if("constructor"!==e){var s=Object.getOwnPropertyDescriptor(t.prototype,e);"function"==typeof s.value&&Object.defineProperty(t.prototype,e,o(t,e,s))}})),t}function i(){return 1===arguments.length?a.apply(void 0,arguments):o.apply(void 0,arguments)}s.d(e,{ZP(){return i}})},27618(t,e,s){"use strict";s.d(e,{W(){return l}});var r=s(70655),o=s(33993),a=s(98422),i=s(16892),n=s(88572);let l=class t extends o.u3{constructor(t,e){super(t,{...e,type:"hidden"}),this.state={...o.u3.defaultState,min:0,max:100},this.startValue=0,this.startX=0,this.width=100,Object.assign(this.state,e),this.appendUIRange(),this.onChangeSelfValue()}className(){return"UIRange"}appendUIRange(){const t=this.j.create.div(this.getFullElName("slider"));this.container.appendChild(t);const e=this.j.create.div(this.getFullElName("handle"));t.appendChild(e);const s=this.j.create.div(this.getFullElName("log")),r=this.getElm("label");(0,i.assert)(null!=r,"label element does not exists"),r.appendChild(s)}onDragStart(t){this.startValue=parseFloat(this.value)||0,this.startX=t.clientX;const e=this.getElm("slider");(0,i.assert)(null!=e,"slider element does not exists"),this.width=e.offsetWidth,this.j.e.on(this.j.ow,"mousemove",this.onDrag)}onDrag(t){const{min:e,max:s}=this.state;let r=this.startValue+(t.clientX-this.startX)/this.width*(this.state.max-this.state.min);e>r&&(r=e),r>s&&(r=s),this.value=""+r}onDragEnd(){this.j.e.off(this.j.ow,"mousemove",this.onDrag)}onChangeSelfValue(){const t=this.getElm("handle"),e=parseFloat(this.value)||0;(0,i.assert)(null!=t,"Handle element does not exist"),(0,i.css)(t,{left:(e-this.state.min)/(this.state.max-this.state.min)*100+"%"});const s=this.getElm("log");(0,i.assert)(null!=s,"log element does not exist"),s.innerText=""+e}destruct(){return this.onDragEnd(),super.destruct()}};(0,r.gn)([(0,a.watch)(["handle:mousedown","handle:touchstart"])],l.prototype,"onDragStart",null),(0,r.gn)([n.ZP],l.prototype,"onDrag",null),(0,r.gn)([(0,a.watch)(["j.ow:mouseup","j.ow:touchend"])],l.prototype,"onDragEnd",null),(0,r.gn)([(0,a.watch)(":change")],l.prototype,"onChangeSelfValue",null),l=(0,r.gn)([a.component],l)},32884(t,e,s){"use strict";s.r(e),s.d(e,{buttonGenerator(){return E}});var r,o=s(70655),a=s(43464),i=s(66809),n=s(98422),l=s(48310),p=s(12815),c=s(7351),h=s(33993),b=s(16892),u=s(11228);let d=r=class t extends h.u1{constructor(t,e){super(t),this.style=e}className(){return"UIGButton"}updateStyles(){const{style:t}=this,e=this.getElm("button");(0,b.assert)(null!=e,"button element does not exist");const s=this.getElm("wrapper");(0,b.assert)(null!=s,"wrapper element does not exist"),s.style.backgroundColor=t.previewBgColor,r.applyStyle(t,e)}static applyStyle(t,e){const s=t=>(0,u.HD)(t)?t:t+"px";e.innerText=t.text||"css",e.setAttribute("href",t.href),(0,b.css)(e,{background:t.solid?null:`linear-gradient(to bottom, ${t.bgStart} 5%, ${t.bgEnd} 100%)`,backgroundColor:t.bgStart,borderRadius:s(t.borderRadius),border:`${s(t.borderSize)} solid ${t.borderColor}`,display:"inline-block",cursor:"pointer",color:t.fontColor,fontFamily:t.fontFamily,fontSize:s(t.fontSize),fontWeight:t.fontWeight?"bold":null,fontStyle:t.fontItalic?"italic":null,padding:`${s(t.paddingY)} ${s(t.paddingX)}`,textDecoration:"none"}),(0,b.css)(e,{textShadow:t.textShadow?[t.textShadowOffsetX,t.textShadowOffsetY,t.textShadowBlurRadius,t.textShadowColor].map(s).join(" "):null}),(0,b.css)(e,{boxShadow:t.boxShadow?[t.boxShadowInset?"inset":"",t.boxShadowOffsetX,t.boxShadowOffsetY,t.boxShadowBlurRadius,t.boxShadowSpreadRadius,t.boxShadowColor].map(s).join(" "):null})}update(){this.updateStyles()}render(){return"<div>\n\t\t\t<div class='&__wrapper'>\n\t\t\t\t<button class='&__button'>css</button>\n\t\t\t</div>\n\t\t</div>"}static extractStyle(t,e){var s,r,o,a;const i=(null===(s=e.ownerDocument.defaultView)||void 0===s?void 0:s.getComputedStyle(e))||{},n=(t,e,s,r)=>{const o=i[s];return!o||["none","inherit","initial","unset"].includes(o)?{[s]:!1}:(o.replace(/,\s/g,",").split(/\s+/).forEach((s=>{if(/[0-9.]+(px|pt|em|%)/.test(s)){const r=t.shift();r&&(e[r]=s)}else"inset"===s?e.boxShadowInset=!0:e[r]=s})),e[s]=!0,e)};Object.assign(t,{text:e.innerText,className:e.className,href:e.getAttribute("href")||"",...(()=>{var t,e;const s={solid:!0,bgStart:null!==(t=i.backgroundColor)&&void 0!==t?t:"#44c767",bgEnd:null!==(e=i.backgroundColor)&&void 0!==e?e:"#44c767"},r=i.backgroundImage;if(r&&/linear-gradient/.test(r)){const t=/linear-gradient\((.+)\s+[0-9]+%,\s+(.+)\s+[0-9]+%\)/.exec(r);t&&(s.solid=!1,s.bgStart=t[1]||s.bgStart,s.bgEnd=t[2]||"#5cbf2a")}return s})(),borderColor:null!==(r=null==i?void 0:i.borderColor)&&void 0!==r?r:"#18ab29",borderRadius:null!==(o=null==i?void 0:i.borderRadius)&&void 0!==o?o:0,borderSize:null!==(a=null==i?void 0:i.borderWidth)&&void 0!==a?a:1,...n(["boxShadowOffsetX","boxShadowOffsetY","boxShadowBlurRadius","boxShadowSpreadRadius"],{boxShadowBlurRadius:0,boxShadowColor:"#3dc21b",boxShadowInset:!1,boxShadowOffsetX:0,boxShadowOffsetY:0,boxShadowSpreadRadius:0},"boxShadow","boxShadowColor"),fontColor:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:"bold"===i.fontWeight,fontItalic:"italic"===i.fontStyle,paddingX:i.paddingLeft,paddingY:i.paddingTop,...n(["textShadowOffsetX","textShadowOffsetY","textShadowBlurRadius"],{textShadowBlurRadius:0,textShadowColor:"#2f6627",textShadowOffsetX:0,textShadowOffsetY:1},"textShadow","textShadowColor")})}};(0,o.gn)([(0,n.watch)("style")],d.prototype,"updateStyles",null),d=r=(0,o.gn)([n.component],d);var f=s(6626);let x=class t extends h.u1{constructor(t,e,s){super(t),this.state=e,this.updateState=s,this.button=new d(this.j,this.state),this.lockUpdate=!1,this.colors=["bgStart","bgEnd","fontColor","borderColor","boxShadowColor","textShadowColor","previewBgColor"].map((t=>new f.T(this.j,{name:t,onChange:e=>{this.lockUpdate||("bgEnd"===t&&e!==this.state.bgStart&&this.updateState("solid",!1),this.updateState(t,e))}}).setMod("slim",!0))),this.setMod("mode","default");const r=this.getElm("button");(0,b.assert)(null!=r,"button element does not exists"),r.appendChild(this.button.container);const o=this.getElm("colors");(0,b.assert)(null!=o,"colors element does not exists"),this.colors.forEach((t=>{o.appendChild(t.container)})),this.update()}className(){return"UIPreviewButtonGenerator"}render(){return"<div>\n\t\t\t<div class='&__button'></div>\n\t\t\t<div class='&__colors'></div>\n\t\t</div>"}update(){this.button.update(),this.lockUpdate=!0,this.colors.forEach((t=>{t.value!==this.state[t.state.name]&&(t.value=this.state[t.state.name])})),this.lockUpdate=!1}};x=(0,o.gn)([n.component],x);var g,y=s(62507),v=s(27618),m=s(52378);class w extends h.u1{constructor(t,e,s){super(t),this.state=e,this.updateState=s,this.onUpdates=[];const r=(t,e)=>()=>{let s=this.state[e.name];/px/.test(""+s)&&(s=(""+s).replace(/px/,"")),""+s!==t.value&&(t.value=s)};(0,y.q)(this.container.querySelectorAll("input,select")).forEach((t=>{if(p.i.isTag(t,"select")){const e=new h.Cj(this.j,{options:(0,y.q)(t.options).map((t=>({text:t.innerText,value:t.value}))),onChange:e=>{this.updateState(t.name,e)}});return p.i.replace(t,e.container,this.j.create,!1,!0),void this.onUpdates.push(r(e,t))}if(p.i.isTag(t,"input"))switch(t.type){case"range":{const e=new v.W(this.j,{label:t.placeholder,name:t.name,min:parseInt(t.min,0)||0,max:parseInt(t.max,0)||100,onChange:e=>{this.updateState(t.name,parseInt(e,10))}});return p.i.replace(t,e.container,this.j.create),void this.onUpdates.push(r(e,t))}case"text":{const e=new h.u3(this.j,{placeholder:t.placeholder,name:t.name,onChange:e=>{this.updateState(t.name,e)}});return p.i.replace(t,e.container,this.j.create),void this.onUpdates.push(r(e,t))}case"checkbox":return t.onchange=()=>this.updateState(t.name,t.checked),void this.onUpdates.push((()=>{t.checked=this.state[t.name]}))}})),this.update()}className(){return"UIFormButtonGenerator"}update(){this.onUpdates.forEach((t=>t()));const t=this.getElm("box-shadow");(0,m.assert)(null!=t,"box-shadow does not exists");const e=this.getElm("text-shadow");(0,m.assert)(null!=e,"text-shadow does not exists"),t.style.display=this.state.boxShadow?"":"none",e.style.display=this.state.textShadow?"":"none"}render(){return"<div>\n\t\t\t<div class='&__group &__text'>\n\t\t\t\t<div class='&__title'>Text</div>\n\t\t\t\t<div class='&__row'>\n\t\t\t\t\t<div class='&__col'>\n\t\t\t\t\t\t<input type='text' name='text'/>\n\t\t\t\t\t\t<input type='text' name='className' placeholder='~Class name~'/>\n\t\t\t\t\t\t<input type='text' name='href' placeholder='~URL~'/>\n\t\t\t\t\t\t<select name='fontFamily'>\n \t\t\t\t\t\t\t<option value='Arial'>Arial</option>\n \t\t\t\t\t\t\t<option value='Courier New'>Courier New</option>\n \t\t\t\t\t\t\t<option value='Georgia'>Georgia</option>\n \t\t\t\t\t\t\t<option value='Impact'>Impact</option>\n \t\t\t\t\t\t\t<option value='Times New Roman'>Times New Roman</option>\n \t\t\t\t\t\t\t<option value='Trebuchet MS'>Trebuchet MS</option>\n \t\t\t\t\t\t\t<option value='Verdana'>Verdana</option>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='&__col'>\n\t\t\t\t\t\t<input type='range' min='8' max='28' name='fontSize' placeholder='~Font Size~'/>\n\t\t\t\t\t\t<div class='&__checkboxes'>\n\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t<input type='checkbox' name='fontWeight'/> bold\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t<input type='checkbox' name='fontItalic'/> italic\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class='&__group &__sizes'>\n\t\t\t\t<div class='&__title'>~Size~</div>\n\t\t\t\t<div class='&__row'>\n\t\t\t\t\t<div class='&__col'>\n\t\t\t\t\t\t<input type='range' name='paddingX' min='0' max='32' placeholder='~Vertical size~'/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='&__col'>\n\t\t\t\t\t\t<input type='range' name='paddingY' min='0' max='76' placeholder='~Horizontal size~'/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class='&__group &__borders'>\n\t\t\t\t<div class='&__title'>~Border~</div>\n\t\t\t\t<div class='&__row'>\n\t\t\t\t\t<div class='&__col'>\n\t\t\t\t\t\t<input type='range' name='borderRadius' min='0' max='42' placeholder='~Border Radius~'/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='&__col'>\n\t\t\t\t\t\t<input type='range' name='borderSize' min='0' max='12' placeholder='~Border Size~'/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class='&__group'>\n\t\t\t\t<div class='&__title'>~Box Shadow~ <input type='checkbox' name='boxShadow'/></div>\n\t\t\t\t<div class='&__row &__box-shadow'>\n\t\t\t\t\t<div class='&__col'>\n\t\t\t\t\t\t<input type='range' name='boxShadowOffsetX' min='-50' max='50' placeholder='~Vertical Position~'/>\n\t\t\t\t\t\t<input type='range' name='boxShadowBlurRadius' min='0' max='50' placeholder='~Blur Radius~'/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='&__col'>\n\t\t\t\t\t\t<input type='range' name='boxShadowOffsetY' min='-50' max='50' placeholder='~Horizontal Position~'/>\n\t\t\t\t\t\t<input type='range' name='boxShadowSpreadRadius' min='-50' max='50' placeholder='~Spread Radius~'/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class='&__group'>\n\t\t\t\t<div class='&__title'>~Text Shadow~ <input type='checkbox' name='textShadow'/></div>\n\t\t\t\t<div class='&__row &__text-shadow'>\n\t\t\t\t\t<div class='&__col'>\n\t\t\t\t\t\t<input type='range' name='textShadowOffsetX' min='-50' max='50' placeholder='~Vertical Position~'/>\n\t\t\t\t\t\t<input type='range' name='textShadowBlurRadius' min='0' max='50' placeholder='~Blur Radius~'/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='&__col'>\n\t\t\t\t\t\t<input type='range' name='textShadowOffsetY' min='-50' max='50' placeholder='~Horizontal Position~'/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>"}}const S=s(93050);let A=g=class