{"version":3,"sources":["webpack:///../WCC.UI/App/components/colorPicker/model.js","webpack:///../WCC.UI/App/components/colorPicker/styles.scss?dc6b","webpack:///../WCC.UI/App/components/colorPicker/template.html?1851","webpack:///../WCC.UI/App/components/colorPicker/viewmodel.js","webpack:///../WCC.UI/App/models/color.ts","webpack:///../WCC.UI/App/helpers/color.ts","webpack:///../WCC.UI/App/libraries/spectrum.js","webpack:///../WCC.UI/App/webpack/runtime/htmlExposer.js","webpack:///../WCC.UI/Content/widgets/wcc-spectrum.scss?2211","webpack:///../WCC.UI/App/components/colorPicker/styles.scss","webpack:///../WCC.UI/Content/widgets/wcc-spectrum.scss","webpack:///../WCC.UI/App/components/colorPicker/template.html"],"names":["define","jsonModel","this","value","ko","observable","unwrap","default","onPick","_","noop","onHide","api","content","__esModule","module","i","options","exports","locals","expose","Model","_ref","withEffects","colorService","require","ColorHelpers","ViewModel","model","info","mEffects","oIsActive","oSpectrumNode","cValue","oColor","register","subscribe","compare","applyBindingsToNode","element","color","spectrumNode","onInit","$anchor","$","$container","spectrum","wrapInner","$body","find","context","state","hasClass","css","onShow","width","offset","clientWidth","Math","floor","dispose","regexps","rgba","rgb","shortHex","hex","validateColorChannelValue","Error","Color","constructor","_red","_green","_blue","_alpha","test","initFromHex","initFromRGB","initFromRGBA","validateAlphaChannelValue","setRed","red","setGreen","green","setBlue","blue","setAlpha","alpha","format","type","toString","NumberHelpers","toHex","other","_toFullHex","result","length","toFullHex","parseInt","slice","match","exec","toRGBA","from","getAlpha","color1","color2","lightenDarken","amount","usePound","num","r","b","g","lightenDarkenHex","system","SystemHelpers","html","getTemplatesAndResources","forEach","node","document","head","appendChild","___CSS_LOADER_API_IMPORT___","push"],"mappings":"oIAAAA,yBAQC,KARDA,aAOI,OANA,SAAeC,GACXC,KAAKC,MAAQC,EAAGC,WAAWJ,EAAUE,OAAOG,SAASC,QAAQ,QAC7DL,KAAKM,OAASP,EAAUO,QAAUC,EAAEC,KACpCR,KAAKS,OAASV,EAAUU,Q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,4JCJjBA,EADkC,EAAQ,wDAChCyG,EAA4B,IAE9BC,KAAK,CAAC7G,EAAOC,EAAI,mwDAAswD,KAE/xDD,EAAOG,QAAUA,G,mHCHjBH,EAAOG,QAFI","file":"165.c5bb794dbe61485f491e.js","sourcesContent":["define(function () {\r\n function Model(jsonModel) {\r\n this.value = ko.observable(jsonModel.value).unwrap().default('#fff');\r\n this.onPick = jsonModel.onPick || _.noop;\r\n this.onHide = jsonModel.onHide || _.noop;\r\n }\r\n\r\n return Model;\r\n});","var api = require(\"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./styles.scss\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","define([\n \"!!../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./template.html\", \n \"!../../webpack/runtime/htmlExposer.js\"], function (content, expose) {\n content = content.__esModule ? content.default : content;\n expose(content);\n return content;\n });","define('components/colorPicker/viewmodel',\r\n [\r\n 'components/colorPicker/model',\r\n 'mixins/withEffects',\r\n 'libraries/spectrum',\r\n './template.html',\r\n './styles.scss'\r\n ],\r\n\r\n function (Model, { withEffects }) {\r\n const colorService = require('helpers/color').ColorHelpers;\r\n\r\n function ViewModel(model, info) {\r\n var mEffects = withEffects();\r\n\r\n var oIsActive = ko.observable(false),\r\n oSpectrumNode = ko.observable(null);\r\n\r\n var cValue = model.value,\r\n oColor = ko.observable('#fff');\r\n\r\n function toggle() {\r\n oIsActive(!oIsActive());\r\n }\r\n\r\n function centerSpectrum() {\r\n var width = info.element.clientWidth,\r\n offset = Math.floor(width / 2);\r\n\r\n $(oSpectrumNode())\r\n .spectrum('container')\r\n .css({ 'transform': 'translateX(-50%) translateX(' + offset + 'px) translateY(-10px)' });\r\n }\r\n\r\n function resetSpectrumPosition() {\r\n $(oSpectrumNode())\r\n .spectrum('container')\r\n .css({ 'transform': '' });\r\n }\r\n\r\n function onChange(value) {\r\n if (!colorService.compare(value, cValue()))\r\n model.onPick(value);\r\n }\r\n\r\n function onInit(element) {\r\n var $anchor = $(element),\r\n $container = $anchor.spectrum('container');\r\n\r\n $container.wrapInner('
');\r\n\r\n var $body = $container.find('.wcc-colorpicker__spectrum__body');\r\n\r\n ko.applyBindingsToNode($body[0], {\r\n 'appear': {\r\n 'visible': oIsActive,\r\n 'show-animation': 'zoomIn',\r\n 'hide-animation': 'zoomOut',\r\n 'duration': 350,\r\n 'on-start': function (context) {\r\n var isVisible = context.state;\r\n\r\n if (isVisible) {\r\n if ($container.hasClass('sp-hidden')) {\r\n resetSpectrumPosition();\r\n $anchor.spectrum('show');\r\n }\r\n } else {\r\n if (!$container.hasClass('sp-hidden'))\r\n $anchor.spectrum('hide');\r\n }\r\n }\r\n }\r\n });\r\n }\r\n\r\n function onShow() {\r\n oIsActive(true);\r\n centerSpectrum();\r\n }\r\n\r\n function onHide() {\r\n oIsActive(false);\r\n model.onHide();\r\n }\r\n\r\n mEffects.register([\r\n oColor.subscribe(onChange)\r\n ]);\r\n\r\n mEffects.register(function (value) {\r\n oColor(value);\r\n }, [cValue]);\r\n\r\n ko.applyBindingsToNode(info.element, {\r\n 'click': toggle,\r\n\r\n 'css': {\r\n 'wcc-colorpicker': true\r\n }\r\n });\r\n\r\n this.color = oColor;\r\n this.spectrumNode = oSpectrumNode;\r\n\r\n this.onInit = onInit;\r\n this.onShow = onShow;\r\n this.onHide = onHide;\r\n this.dispose = mEffects.dispose;\r\n }\r\n\r\n ViewModel.Model = Model;\r\n\r\n return ViewModel;\r\n });","import { NumberHelpers } from \"helpers/number\";\r\n\r\nexport type ColorFormat = 'hex' | 'rgb';\r\n\r\nconst regexps = {\r\n rgba: /rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*([0-9.]+)\\)/,\r\n rgb: /rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)/,\r\n shortHex: /^#[\\dabcdef]{3,4}$/,\r\n hex: /^#[\\dabcdef]{6,8}$/\r\n}\r\n\r\nfunction toFullHex(color: string) {\r\n let result = '#' + color[1] + color[1] + color[2] + color[2] + color[3] + color[3];\r\n\r\n if (color.length == 5)\r\n result += color[4] + color[4];\r\n else\r\n result += 'ff';\r\n\r\n return result;\r\n}\r\n\r\nfunction validateColorChannelValue(value: number) {\r\n if (value < 0 || value > 255)\r\n throw new Error('invalid value');\r\n}\r\n\r\nfunction validateAlphaChannelValue(value: number) {\r\n if (value < 0 || value > 1)\r\n throw new Error('invalid value');\r\n}\r\n\r\nexport default class Color {\r\n private _red = 0\r\n private _green = 0;\r\n private _blue = 0;\r\n private _alpha = 1;\r\n\r\n get red() {\r\n return this._red;\r\n }\r\n\r\n set red(value: number) {\r\n validateColorChannelValue(value);\r\n\r\n this._red = value;\r\n }\r\n\r\n get green() {\r\n return this._green;\r\n }\r\n\r\n set green(value: number) {\r\n validateColorChannelValue(value);\r\n\r\n this._green = value;\r\n }\r\n\r\n get blue() {\r\n return this._blue;\r\n }\r\n\r\n set blue(value: number) {\r\n validateColorChannelValue(value);\r\n\r\n this._blue = value;\r\n } \r\n\r\n get alpha() {\r\n return this._alpha;\r\n }\r\n\r\n set alpha(value: number) {\r\n validateAlphaChannelValue(value);\r\n\r\n this._alpha = value;\r\n }\r\n\r\n static from(color: string) {\r\n return new Color(color);\r\n }\r\n\r\n constructor(color: string) {\r\n if (regexps.shortHex.test(color) || regexps.hex.test(color))\r\n this.initFromHex(color);\r\n\r\n if (regexps.rgb.test(color))\r\n this.initFromRGB(color);\r\n\r\n if (regexps.rgba.test(color))\r\n this.initFromRGBA(color);\r\n } \r\n\r\n setRed(value: number) {\r\n this.red = value;\r\n return this;\r\n }\r\n\r\n setGreen(value: number) {\r\n this.green = value;\r\n return this;\r\n }\r\n\r\n setBlue(value: number) {\r\n this.blue = value;\r\n return this;\r\n }\r\n\r\n setAlpha(value: number) {\r\n this.alpha = value;\r\n return this;\r\n }\r\n\r\n format(type?: ColorFormat) {\r\n switch (type) {\r\n case 'rgb':\r\n if (this._alpha == 1)\r\n return `rgb(${this._red.toString()}, ${this._green.toString()}, ${this._blue.toString()})`;\r\n else\r\n return `rgba(${this._red.toString()}, ${this._green.toString()}, ${this._blue.toString()}, ${this._alpha.toString()})`;\r\n\r\n default:\r\n if (this._alpha == 1)\r\n return `#${NumberHelpers.toHex(this._red)}${NumberHelpers.toHex(this._green)}${NumberHelpers.toHex(this._blue)}`;\r\n else\r\n return `#${NumberHelpers.toHex(this._red)}${NumberHelpers.toHex(this._green)}${NumberHelpers.toHex(this._blue)}${NumberHelpers.toHex(Math.floor(this._alpha * 255))}`;\r\n }\r\n }\r\n\r\n compare(other: Color) {\r\n return this.red === other.red &&\r\n this.green === other.green &&\r\n this.blue === other.blue &&\r\n this.alpha === other.alpha;\r\n }\r\n\r\n private initFromHex(color: string) {\r\n if (regexps.shortHex.test(color))\r\n color = toFullHex(color) ?? color;\r\n\r\n this._red = parseInt(color.slice(1, 3), 16);\r\n this._green = parseInt(color.slice(3, 5), 16);\r\n this._blue = parseInt(color.slice(5, 7), 16);\r\n this._alpha = parseInt(color.slice(7, 9), 16) / 255;\r\n } \r\n\r\n private initFromRGB(color: string) {\r\n const match = regexps.rgb.exec(color);\r\n\r\n if (match) {\r\n this._red = parseInt(match[1]);\r\n this._green = parseInt(match[2]);\r\n this._blue = parseInt(match[3]);\r\n }\r\n }\r\n\r\n private initFromRGBA(color: string) {\r\n const match = regexps.rgba.exec(color);\r\n\r\n if (match) {\r\n this._red = parseInt(match[1]);\r\n this._green = parseInt(match[2]);\r\n this._blue = parseInt(match[3]);\r\n this._alpha = parseInt(match[4]);\r\n }\r\n }\r\n}","import Color from \"models/color\";\r\n\r\nexport module ColorHelpers {\r\n export function toRGBA(color: string, alpha = 1) {\r\n return Color.from(color).setAlpha(alpha).format('rgb');\r\n }\r\n\r\n export function toHex(color: string, alpha = 1) {\r\n return Color.from(color).setAlpha(alpha).format('hex');\r\n }\r\n\r\n export function getAlpha(color: string) {\r\n return Color.from(color).alpha;\r\n }\r\n\r\n export function compare(color1: string, color2: string) {\r\n return Color.from(color1).compare(Color.from(color2));\r\n }\r\n\r\n export function lightenDarken(color: string, amount: number) {\r\n return lightenDarkenHex(Color.from(color).format('hex'), amount);\r\n }\r\n\r\n function lightenDarkenHex(color: string, amount: number) {\r\n var usePound = false;\r\n\r\n if (color[0] == \"#\") {\r\n color = color.slice(1);\r\n usePound = true;\r\n }\r\n\r\n var num = parseInt(color, 16);\r\n\r\n var r = (num >> 16) + amount;\r\n\r\n if (r > 255) r = 255;\r\n else if (r < 0) r = 0;\r\n\r\n var b = ((num >> 8) & 0x00FF) + amount;\r\n\r\n if (b > 255) b = 255;\r\n else if (b < 0) b = 0;\r\n\r\n var g = (num & 0x0000FF) + amount;\r\n\r\n if (g > 255) g = 255;\r\n else if (g < 0) g = 0;\r\n\r\n return (usePound ? \"#\" : \"\") + (g | (b << 8) | (r << 16)).toString(16);\r\n }\r\n}","import 'spectrum-colorpicker';\r\nimport 'spectrum-colorpicker/spectrum.css';\r\nimport 'Content/widgets/wcc-spectrum.scss';","define(function () {\r\n const system = require('helpers/system').SystemHelpers;\r\n\r\n return function (html) {\r\n system.getTemplatesAndResources(html)\r\n .forEach(function (node) { document.head.appendChild(node) });\r\n }\r\n});","var api = require(\"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./wcc-spectrum.scss\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".wcc-colorpicker{display:inline-block}.wcc-colorpicker__spectrum .wcc-colorpicker__spectrum__body{display:flex;min-width:420px;padding:10px;background-color:rgba(38,38,38,.85);border:1px solid #a0a0a0;border-radius:4px;animation-duration:250ms}.wcc-colorpicker__spectrum .sp-palette-container,.wcc-colorpicker__spectrum .sp-picker-container{flex-grow:1;float:none;padding:0;margin-bottom:0}.wcc-colorpicker__spectrum .sp-palette-container{border-right:none;margin-right:10px}.wcc-colorpicker__spectrum .sp-palette-container .sp-palette{max-width:240px}.wcc-colorpicker__spectrum .sp-palette-container .sp-thumb-el{width:18px;height:18px;padding:1px;margin:3px 2px;border:none;border-radius:3px;overflow:hidden}.wcc-colorpicker__spectrum .sp-picker-container{border-left:none}.wcc-colorpicker__spectrum .sp-picker-container .sp-color,.wcc-colorpicker__spectrum .sp-picker-container .sp-hue,.wcc-colorpicker__spectrum .sp-picker-container .sp-clear{border:none;box-shadow:0 0 3px 0 #262626}.wcc-colorpicker__spectrum .sp-picker-container .sp-color,.wcc-colorpicker__spectrum .sp-picker-container .sp-sat,.wcc-colorpicker__spectrum .sp-picker-container .sp-val{border-radius:4px}.wcc-colorpicker__spectrum .sp-picker-container .sp-color{right:22px}.wcc-colorpicker__spectrum .sp-picker-container .sp-color .sp-dragger{height:12px;width:12px;border:none;border-radius:100%;box-shadow:0 0 2px 0 #fff;transform:translateX(calc(-50% + 12px)) translateY(calc(-50% + 12px))}.wcc-colorpicker__spectrum .sp-picker-container .sp-hue{border-radius:4px;left:calc(100% - 12px)}.wcc-colorpicker__spectrum .sp-picker-container .sp-hue .sp-slider{left:50%;right:auto;width:14px;height:14px;background-color:#fff;opacity:1;border:none;border-radius:100%;box-shadow:0 0 3px 0px #000;transform:translateX(-50%) translateY(calc(-50% + 16px));opacity:.9}.wcc-colorpicker__spectrum .sp-picker-container .sp-initial{border:none;border-radius:4px;overflow:hidden;box-shadow:0 0 2px 0 #262626}.wcc-colorpicker__spectrum .sp-picker-container .sp-input-container .sp-input{background:transparent;border:none;border-bottom:1px dotted #f8f8f7;border-radius:0;padding:4px;color:#f8f8f7}.wcc-colorpicker__spectrum .sp-picker-container .sp-input-container .sp-input:focus{outline:none}.wcc-colorpicker__spectrum .sp-picker-container .sp-button-container{margin-top:5px}.wcc-colorpicker__spectrum .sp-picker-container .sp-button-container .sp-choose{background-color:#337ab7;background-image:none;color:#fff;font-family:\\\"Helvetica Neue\\\",Helvetica,Arial,sans-serif;font-size:13px;text-shadow:none;border:1px solid #2e6da4;padding:5px 8px}.wcc-colorpicker__spectrum .sp-picker-container .sp-button-container .sp-choose:hover{background-color:#286090;border-color:#204d74}.wcc-colorpicker__spectrum .sp-picker-container .sp-button-container .sp-cancel{color:#f8f8f7 !important;font-size:13px;margin-right:15px;border-bottom:1px dotted #939393;padding:0}.wcc-colorpicker__spectrum .sp-picker-container .sp-button-container .sp-cancel:hover,.wcc-colorpicker__spectrum .sp-picker-container .sp-button-container .sp-cancel:active,.wcc-colorpicker__spectrum .sp-picker-container .sp-button-container .sp-cancel:focus{text-decoration:none;outline:none;color:#7a7a7a !important;border-bottom:1px dotted #7a7a7a}.wcc-colorpicker__spectrum .sp-picker-container .sp-alpha-handle{top:50%;bottom:auto;width:14px;height:14px;background-color:#262626;transform:translateX(calc(-50% + 7px)) translateY(-50%);border:none;border-radius:100%;opacity:.95}.wcc-colorpicker__spectrum.sp-container{background-color:transparent;border:none;padding:0;overflow:visible}.wcc-colorpicker__spectrum.sp-hidden{display:block !important}.wcc-colorpicker__spectrum.sp-alpha-enabled .sp-top{margin-bottom:24px}.wcc-colorpicker__spectrum.sp-alpha-enabled .sp-alpha{bottom:-20px;height:12px;border-radius:4px}.wcc-colorpicker__spectrum.sp-alpha-enabled .sp-alpha-inner{border-radius:4px}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".wcc-spectrum{background-color:#fff;border:none;box-shadow:0 0 10px 0px #000;border-radius:3px}.wcc-spectrum .sp-palette-container .sp-thumb-el{width:18px;height:18px;border:1px solid #c6c6c6;border-radius:3px;overflow:hidden}.wcc-spectrum .sp-picker-container .sp-color,.wcc-spectrum .sp-picker-container .sp-hue,.wcc-spectrum .sp-picker-container .sp-clear{border:none;box-shadow:0 0 3px 0 #262626}.wcc-spectrum .sp-picker-container .sp-hue .sp-slider{height:4px;background-color:#fff;opacity:1;border:none;box-shadow:0 0 3px 0px #000}.wcc-spectrum .sp-picker-container .sp-initial{border:1px solid #868686}.wcc-spectrum .sp-picker-container .sp-input-container .sp-input{background:transparent;border:none;border-bottom:1px dotted #868686;border-radius:0;padding:4px;color:#868686}.wcc-spectrum .sp-picker-container .sp-input-container .sp-input:focus{outline:none}.wcc-spectrum .sp-picker-container .sp-button-container{margin-top:5px}.wcc-spectrum .sp-picker-container .sp-button-container .sp-choose{background-color:#337ab7;background-image:none;color:#fff;font-family:\\\"Helvetica Neue\\\",Helvetica,Arial,sans-serif;font-size:13px;text-shadow:none;border:1px solid #2e6da4;padding:5px 8px}.wcc-spectrum .sp-picker-container .sp-button-container .sp-choose:hover{background-color:#286090;border-color:#204d74}.wcc-spectrum .sp-picker-container .sp-button-container .sp-cancel{color:#939393 !important;font-size:13px;margin-right:15px;border-bottom:1px dotted #939393;padding:0}.wcc-spectrum .sp-picker-container .sp-button-container .sp-cancel:hover,.wcc-spectrum .sp-picker-container .sp-button-container .sp-cancel:active,.wcc-spectrum .sp-picker-container .sp-button-container .sp-cancel:focus{text-decoration:none;outline:none;color:#7a7a7a !important;border-bottom:1px dotted #7a7a7a}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;"],"sourceRoot":""}