From 2b8e9e300c6f5d6d326d24244515cf03e4668ba9 Mon Sep 17 00:00:00 2001 From: Tim Gates Date: Sun, 31 Oct 2021 07:28:50 +1100 Subject: [PATCH 001/313] docs: Fix a few typos There are small typos in: - docs/api/components.md - docs/modules/Commands.md - docs/modules/Components.md - src/dom_components/config/config.js - src/dom_components/index.js - src/dom_components/model/Component.js - src/navigator/config/config.js - src/storage_manager/config/config.js - src/utils/Sorter.js - test/specs/grapesjs/index.js Fixes: - Should read `return` rather than `retun`. - Should read `previously` rather than `previosly`. - Should read `definition` rather than `defintion`. - Should read `which` rather than `wich`. - Should read `scrolling` rather than `scolling`. - Should read `multiple` rather than `mutiple`. - Should read `instead` rather than `intead`. - Should read `definition` rather than `definiton`. --- docs/api/components.md | 2 +- docs/modules/Commands.md | 2 +- docs/modules/Components.md | 2 +- src/dom_components/config/config.js | 2 +- src/dom_components/index.js | 2 +- src/dom_components/model/Component.js | 2 +- src/navigator/config/config.js | 2 +- src/storage_manager/config/config.js | 2 +- src/utils/Sorter.js | 4 ++-- test/specs/grapesjs/index.js | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/api/components.md b/docs/api/components.md index 0f92b2134..80622ff9b 100644 --- a/docs/api/components.md +++ b/docs/api/components.md @@ -179,7 +179,7 @@ Read more about this in [Define New Component][17] * `type` **[string][15]** Component ID -Returns **[Object][12]** Component type defintion, eg. `{ model: ..., view: ... }` +Returns **[Object][12]** Component type definition, eg. `{ model: ..., view: ... }` ## removeType diff --git a/docs/modules/Commands.md b/docs/modules/Commands.md index 93078e8ac..697a0a0e4 100644 --- a/docs/modules/Commands.md +++ b/docs/modules/Commands.md @@ -264,7 +264,7 @@ The Commands module offers also a set of events that you can use to intercept th ### Intercept run and stop -By using our previosly created `my-command-modal` command let's see which events we can listen to +By using our previously created `my-command-modal` command let's see which events we can listen to ```js editor.on('run:my-command-modal', () => { diff --git a/docs/modules/Components.md b/docs/modules/Components.md index d84e1029d..41c5649f1 100644 --- a/docs/modules/Components.md +++ b/docs/modules/Components.md @@ -872,7 +872,7 @@ If you want to know how to create Components with javascript attached (eg. count If you're importing big chunks of HTML string into the editor (eg. defined via Blocks) JSX might be a great compromise between perfomances and code readibility as it allows you to skip the parsing and the component recognition steps by keeping the HTML syntax. By default, GrapesJS understands objects generated from React JSX preset, so, if you're working in the React app probably you're already using JSX and you don't need to do anything else, your environment is already configured to parse JSX in javascript files. -So, intead of writing this: +So, instead of writing this: ```js // I'm adding a string, so the parsing and the component recognition steps will be executed editor.addComponents(`
diff --git a/src/dom_components/config/config.js b/src/dom_components/config/config.js index a14506818..cc895ee7c 100644 --- a/src/dom_components/config/config.js +++ b/src/dom_components/config/config.js @@ -15,7 +15,7 @@ export default { storeWrapper: 0, /** - * You can setup a custom component definiton processor before adding it into the editor. + * You can setup a custom component definition processor before adding it into the editor. * It might be useful to transform custom objects (es. some framework specific JSX) to GrapesJS component one. * This custom function will be executed on ANY new added component to the editor so make smart checks/conditions * to avoid doing useless executions diff --git a/src/dom_components/index.js b/src/dom_components/index.js index 99693f173..0545a29b9 100644 --- a/src/dom_components/index.js +++ b/src/dom_components/index.js @@ -564,7 +564,7 @@ export default () => { * Get component type. * Read more about this in [Define New Component](https://grapesjs.com/docs/modules/Components.html#define-new-component) * @param {string} type Component ID - * @return {Object} Component type defintion, eg. `{ model: ..., view: ... }` + * @return {Object} Component type definition, eg. `{ model: ..., view: ... }` */ getType(type) { var df = componentTypes; diff --git a/src/dom_components/model/Component.js b/src/dom_components/model/Component.js index 9b04a0d96..b03d95d09 100644 --- a/src/dom_components/model/Component.js +++ b/src/dom_components/model/Component.js @@ -844,7 +844,7 @@ export default class Component extends Model.extend(Styleable) { addedInstances: addedInstances.map(c => c.cid), added: m.cid }); - // Here, before appending a new symbol, I have to ensure there are no previosly + // Here, before appending a new symbol, I have to ensure there are no previously // created symbols (eg. used mainly when drag components around) toUp.forEach(symb => { const symbTop = symb.__getSymbTop(); diff --git a/src/navigator/config/config.js b/src/navigator/config/config.js index 7a4992e79..36a95ae76 100644 --- a/src/navigator/config/config.js +++ b/src/navigator/config/config.js @@ -26,7 +26,7 @@ export default { // Scroll to selected component in Canvas when it's selected in Layers // true, false or `scrollIntoView`-like options, - // `block: 'nearest'` avoids the issue of window scolling + // `block: 'nearest'` avoids the issue of window scrolling scrollCanvas: { behavior: 'smooth', block: 'nearest' }, // Scroll to selected component in Layers when it's selected in Canvas diff --git a/src/storage_manager/config/config.js b/src/storage_manager/config/config.js index a2ac50f50..3f1ce08c2 100644 --- a/src/storage_manager/config/config.js +++ b/src/storage_manager/config/config.js @@ -59,7 +59,7 @@ export default { // Pass custom options to fetch API (remote storage) // You can pass a simple object: { someOption: 'someValue' } - // or a function wich returns and object to add: + // or a function which returns and object to add: // currentOpts => { // return currentOpts.method === 'post' ? { method: 'patch' } : {}; // } diff --git a/src/utils/Sorter.js b/src/utils/Sorter.js index dcc6ba5bb..b4b6c6573 100644 --- a/src/utils/Sorter.js +++ b/src/utils/Sorter.js @@ -854,7 +854,7 @@ export default Backbone.View.extend({ /** * Get children dimensions * @param {HTMLELement} el Element root - * @retun {Array} + * @return {Array} * */ getChildrenDim(trg) { const dims = []; @@ -920,7 +920,7 @@ export default Backbone.View.extend({ * @param {Array} dims Dimensions of nodes to parse * @param {number} posX X coordindate * @param {number} posY Y coordindate - * @retun {Object} + * @return {Object} * */ findPosition(dims, posX, posY) { var result = { index: 0, indexEl: 0, method: 'before' }; diff --git a/test/specs/grapesjs/index.js b/test/specs/grapesjs/index.js index bc2a09e49..7c2a3ce8c 100644 --- a/test/specs/grapesjs/index.js +++ b/test/specs/grapesjs/index.js @@ -506,7 +506,7 @@ describe('GrapesJS', () => { editor.selectToggle([el1, el2, el3]); expect(editor.getSelected()).toBe(el2); expect(editor.getSelectedAll().length).toBe(2); - // Add mutiple + // Add multiple editor.selectAdd([el2, el3]); expect(editor.getSelected()).toBe(el3); expect(editor.getSelectedAll().length).toBe(3); From 69458d42b8af510d55847a39c71c29b0875a187a Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 1 Nov 2021 15:15:52 +0100 Subject: [PATCH 002/313] Setup new properties update --- .../model/TypeableCollection.js | 6 ++-- src/style_manager/index.js | 27 +++++++++------- src/style_manager/model/Property.js | 32 ++++++++++++++++++- src/style_manager/model/PropertyComposite.js | 2 +- src/style_manager/model/PropertyInteger.js | 12 +++++-- src/style_manager/model/PropertyStack.js | 2 +- src/style_manager/model/Sector.js | 7 ++-- src/style_manager/model/Sectors.js | 10 ++++-- 8 files changed, 74 insertions(+), 24 deletions(-) diff --git a/src/domain_abstract/model/TypeableCollection.js b/src/domain_abstract/model/TypeableCollection.js index 40b43ee13..93ec965f4 100644 --- a/src/domain_abstract/model/TypeableCollection.js +++ b/src/domain_abstract/model/TypeableCollection.js @@ -7,7 +7,9 @@ const View = Backbone.View; export default { types: [], - initialize(models, opts) { + initialize(models, opts = {}) { + const { em } = opts; + this.em = em; this.model = (attrs = {}, options = {}) => { let Model, View, type; @@ -24,7 +26,7 @@ export default { attrs = typeFound.attributes; } - const model = new Model(attrs, options); + const model = new Model(attrs, { ...options, em }); model.typeView = View; return model; }; diff --git a/src/style_manager/index.js b/src/style_manager/index.js index aa6203915..5639709c7 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -95,8 +95,9 @@ export default () => { sectors = new Sectors([], c); this.model = new Model({ targets: [] }); const toListen = - 'component:toggled component:update:classes change:state change:device frame:resized selector:type'; - em.on( + 'component:toggled component:update:classes change:state change:device frame:resized selector:type styleable:change'; + this.model.listenTo( + em, toListen, debounce(() => { this.select(em.getSelectedAll()); @@ -478,19 +479,23 @@ export default () => { this.model.set({ targets, lastTarget, lastTargetParents }); // Update all property values - // if (lastTarget && em.getConfig('customUI')) { - // const style = lastTarget.getStyle(); - // sectors.map(sector => { - // sector.getProperties().map(prop => { - // const value = style[prop.getName()]; - // !isUndefined(value) && prop.setValue(value); - // }) - // }) - // } + if (lastTarget && em.getConfig('customUI')) { + const style = lastTarget.getStyle(); + sectors.map(sector => { + sector.getProperties().map(prop => { + const value = style[prop.getName()]; + prop.upValue(isUndefined(value) ? '' : value); + }); + }); + } return targets; }, + addStyleTargets(style) { + this.getSelected().map(t => t.addStyle(style)); + }, + getSelected() { return this.model.get('targets'); }, diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 1b7b8f2a6..117895ee3 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -1,9 +1,10 @@ import { Model } from 'common'; -import { isUndefined, isString, result } from 'underscore'; +import { isUndefined, isString, result, keys } from 'underscore'; import { capitalize } from 'utils/mixins'; export default class Property extends Model { initialize(props = {}, opts = {}) { + this.em = opts.em; const id = this.get('id') || ''; const name = this.get('name') || ''; !this.get('property') && @@ -11,9 +12,33 @@ export default class Property extends Model { const prop = this.get('property'); !this.get('id') && this.set('id', prop); !name && this.set('name', capitalize(prop).replace(/-/g, ' ')); + this.on('change', this.__upTargets); Property.callInit(this, props, opts); } + __upTargets() { + const { em } = this; + if (!em || !em.getConfig('customUI')) return; + const sm = em.get('StyleManager'); + const name = this.getName(); + const value = this.getFullValue(); + + const changed = this.changedAttributes(); + const previous = keys(changed).reduce((a, i) => { + a[i] = this.previous(i); + return a; + }, {}); + console.log('Update targets', { name, value, changed, previous }); + + sm.addStyleTargets({ [name]: value }); + } + + _up(props, opts = {}) { + const { preview, ...rest } = opts; + props.__p = preview; + return this.set(props, { ...rest, avoidStore: !!preview }); + } + init() {} /** @@ -57,6 +82,11 @@ export default class Property extends Model { return isUndefined(val) ? this.getDefaultValue() : val; } + upValue(value, opts) { + const parsed = this.parseValue(value); + return this._up(parsed, opts); + } + /** * Clear the value * @return {this} diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 4c2c007ef..d438f3384 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -25,7 +25,7 @@ export default Property.extend({ Property.callParentInit(Property, this, props, opts); const properties = this.get('properties') || []; const Properties = require('./Properties').default; - this.set('properties', new Properties(properties)); + this.set('properties', new Properties(properties), { silent: 1 }); this.listenTo(this, 'change:value', this.updateValues); Property.callInit(this, props, opts); }, diff --git a/src/style_manager/model/PropertyInteger.js b/src/style_manager/model/PropertyInteger.js index 795333716..096aee718 100644 --- a/src/style_manager/model/PropertyInteger.js +++ b/src/style_manager/model/PropertyInteger.js @@ -34,10 +34,18 @@ export default Property.extend({ * Get property unit value. * @returns {String} */ - getValueUnit() { + getUnit() { return this.get('unit'); }, + /** + * Update property unit value. + * @returns {String} + */ + upUnit(unit, opts) { + return this._up({ unit }, opts); + }, + initialize(props = {}, opts = {}) { Property.callParentInit(Property, this, props, opts); const unit = this.get('unit'); @@ -45,7 +53,7 @@ export default Property.extend({ this.input = hasWin() && new InputNumber({ model: this }); if (units.length && !unit) { - this.set('unit', units[0]); + this.set('unit', units[0], { silent: 1 }); } Property.callInit(this, props, opts); }, diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 021ba2a5d..858ec7e4c 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -24,7 +24,7 @@ export default Property.extend({ const layersColl = new Layers(layers); layersColl.property = this; layersColl.properties = this.get('properties'); - this.set('layers', layersColl); + this.set('layers', layersColl, { silent: true }); Property.callInit(this, props, opts); }, diff --git a/src/style_manager/model/Sector.js b/src/style_manager/model/Sector.js index 2263ec408..586c10974 100644 --- a/src/style_manager/model/Sector.js +++ b/src/style_manager/model/Sector.js @@ -24,8 +24,9 @@ export default class Sector extends Model { }; } - initialize(opts) { - const o = opts || {}; + initialize(prp, opts = {}) { + const { em } = opts; + const o = prp || {}; const builded = this.buildProperties(o.buildProps); const name = this.get('name') || ''; let props = []; @@ -34,7 +35,7 @@ export default class Sector extends Model { if (!builded) props = this.get('properties'); else props = this.extendProperties(builded); - const propsModel = new Properties(props); + const propsModel = new Properties(props, { em }); propsModel.sector = this; this.set('properties', propsModel); } diff --git a/src/style_manager/model/Sectors.js b/src/style_manager/model/Sectors.js index 298b4725e..11d9fe1af 100644 --- a/src/style_manager/model/Sectors.js +++ b/src/style_manager/model/Sectors.js @@ -2,14 +2,18 @@ import { Collection } from 'common'; import Sector from './Sector'; export default class Sectors extends Collection { - initialize() { + initialize(prop, opts = {}) { + this.em = opts.em; this.listenTo(this, 'reset', this.onReset); } + model(props, opts = {}) { + const { em } = opts.collection; + return new Sector(props, { ...opts, em }); + } + onReset(models, opts = {}) { const prev = opts.previousModels || []; prev.forEach(sect => sect.get('properties').reset()); } } - -Sectors.prototype.model = Sector; From 037eee1c28a2ace41601898ba68afc54324c45dd Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 2 Nov 2021 09:20:17 +0100 Subject: [PATCH 003/313] Update properly style properties --- src/style_manager/index.js | 4 ++-- src/style_manager/model/Property.js | 13 +++++++++---- src/style_manager/model/PropertyInteger.js | 7 +++++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 5639709c7..5d11c66a1 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -99,7 +99,7 @@ export default () => { this.model.listenTo( em, toListen, - debounce(() => { + debounce((...args) => { this.select(em.getSelectedAll()); em.trigger('style:custom'); }) @@ -484,7 +484,7 @@ export default () => { sectors.map(sector => { sector.getProperties().map(prop => { const value = style[prop.getName()]; - prop.upValue(isUndefined(value) ? '' : value); + prop.upValue(isUndefined(value) ? null : value, { __up: true }); }); }); } diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 117895ee3..ed66704e3 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -16,7 +16,7 @@ export default class Property extends Model { Property.callInit(this, props, opts); } - __upTargets() { + __upTargets(p, opts = {}) { const { em } = this; if (!em || !em.getConfig('customUI')) return; const sm = em.get('StyleManager'); @@ -28,9 +28,9 @@ export default class Property extends Model { a[i] = this.previous(i); return a; }, {}); - console.log('Update targets', { name, value, changed, previous }); + console.log('Update targets', { name, value, changed, previous, opts }); - sm.addStyleTargets({ [name]: value }); + !opts.__up && sm.addStyleTargets({ [name]: value }); } _up(props, opts = {}) { @@ -83,10 +83,15 @@ export default class Property extends Model { } upValue(value, opts) { - const parsed = this.parseValue(value); + const parsed = + value === null ? this.__getClearProps() : this.parseValue(value); return this._up(parsed, opts); } + __getClearProps() { + return { value: '', status: '' }; + } + /** * Clear the value * @return {this} diff --git a/src/style_manager/model/PropertyInteger.js b/src/style_manager/model/PropertyInteger.js index 096aee718..887186856 100644 --- a/src/style_manager/model/PropertyInteger.js +++ b/src/style_manager/model/PropertyInteger.js @@ -63,6 +63,13 @@ export default Property.extend({ return this; }, + __getClearProps() { + return { + ...Property.prototype.__getClearProps(), + unit: '' + }; + }, + parseValue(val) { const parsed = Property.prototype.parseValue.apply(this, arguments); const { value, unit } = this.input.validateInputValue(parsed.value, { From 53f0fa7a1397a773b26c7806c762c35c996a252e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 2 Nov 2021 15:52:02 +0100 Subject: [PATCH 004/313] Update sector --- src/style_manager/model/Sector.js | 42 +++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/src/style_manager/model/Sector.js b/src/style_manager/model/Sector.js index 586c10974..bf7d51e27 100644 --- a/src/style_manager/model/Sector.js +++ b/src/style_manager/model/Sector.js @@ -1,5 +1,5 @@ import { Model } from 'common'; -import { extend } from 'underscore'; +import { extend, isString } from 'underscore'; import Properties from './Properties'; import PropertyFactory from './PropertyFactory'; @@ -32,8 +32,15 @@ export default class Sector extends Model { let props = []; !this.get('id') && this.set('id', name.replace(/ /g, '_').toLowerCase()); - if (!builded) props = this.get('properties'); - else props = this.extendProperties(builded); + if (!builded) { + props = this.get('properties') + .map(prop => (isString(prop) ? this.buildProperties(prop)[0] : prop)) + .filter(Boolean); + } else { + props = this.extendProperties(builded); + } + + props = props.map(prop => this.checkExtend(prop)); const propsModel = new Properties(props, { em }); propsModel.sector = this; @@ -89,6 +96,12 @@ export default class Sector extends Model { return props.models ? [...props.models] : props; } + getProperty(id) { + return ( + this.getProperties().filter(prop => prop.get('id') === id)[0] || null + ); + } + /** * Extend properties * @param {Array} props Start properties @@ -135,6 +148,18 @@ export default class Sector extends Model { return ex ? isolated.filter(i => i) : props; } + checkExtend(prop) { + const { extend, ...rest } = prop || {}; + if (extend) { + return { + ...(this.buildProperties([extend])[0] || {}), + ...rest + }; + } else { + return prop; + } + } + /** * Build properties * @param {Array} propr Array of props as sting @@ -142,15 +167,12 @@ export default class Sector extends Model { * @private */ buildProperties(props) { - var r; - var buildP = props || []; - - if (!buildP.length) return; + const buildP = props || []; - if (!this.propFactory) this.propFactory = new PropertyFactory(); + if (!buildP.length) return []; - r = this.propFactory.build(buildP); + this.propFactory = this.propFactory || new PropertyFactory(); - return r; + return this.propFactory.build(buildP); } } From 660f7ae22ec16cebd297db33c71c78d27f9eb42c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 3 Nov 2021 12:40:35 +0100 Subject: [PATCH 005/313] Ignore tsconfig.json in npm --- .npmignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.npmignore b/.npmignore index 8e0b0d377..fa25547e8 100644 --- a/.npmignore +++ b/.npmignore @@ -27,3 +27,4 @@ test .travis.yml *.md webpack.config.js +tsconfig.json From 9431e584406f51bf222a5b05c1b3da429a773339 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 3 Nov 2021 12:52:11 +0100 Subject: [PATCH 006/313] Move cash --- package.json | 1 - src/editor/model/Editor.js | 3 +- src/index.js | 6 +- src/utils/cash-dom.js | 1436 ++++++++++++++++++++++++++++++++++++ 4 files changed, 1439 insertions(+), 7 deletions(-) create mode 100644 src/utils/cash-dom.js diff --git a/package.json b/package.json index 1a017ec1c..bd6439edb 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "dependencies": { "backbone": "1.3.3", "backbone-undo": "^0.2.5", - "cash-dom": "^2.3.9", "codemirror": "^5.63.0", "codemirror-formatting": "^1.0.0", "promise-polyfill": "^8.1.3", diff --git a/src/editor/model/Editor.js b/src/editor/model/Editor.js index 8144d9fc7..8c5c5188b 100644 --- a/src/editor/model/Editor.js +++ b/src/editor/model/Editor.js @@ -8,12 +8,11 @@ import { bindAll } from 'underscore'; import Backbone from 'backbone'; +import $ from 'utils/cash-dom'; import Extender from 'utils/extender'; import { getModel, hasWin } from 'utils/mixins'; import Selected from './Selected'; -const cash = hasWin() ? require('cash-dom') : null; -const $ = (cash && cash.default) || cash; Backbone.$ = $; const deps = [ diff --git a/src/index.js b/src/index.js index 6793e71ad..7499251f0 100644 --- a/src/index.js +++ b/src/index.js @@ -1,15 +1,13 @@ -import Editor from './editor'; import { isElement, isFunction } from 'underscore'; +import $ from 'utils/cash-dom'; +import Editor from './editor'; import polyfills from 'utils/polyfills'; import PluginManager from './plugin_manager'; -import { hasWin } from 'utils/mixins'; polyfills(); const plugins = new PluginManager(); const editors = []; -const cash = hasWin() ? require('cash-dom') : null; -const $ = (cash && cash.default) || cash; const defaultConfig = { // If true renders editor on init autorender: 1, diff --git a/src/utils/cash-dom.js b/src/utils/cash-dom.js new file mode 100644 index 000000000..3efb36fcf --- /dev/null +++ b/src/utils/cash-dom.js @@ -0,0 +1,1436 @@ +/* Adapted for headless */ +/* MIT https://github.com/kenwheeler/cash */ +'use strict'; + +var doc = typeof document !== 'undefined' ? document : null, + win = typeof window !== 'undefined' ? window : null, + _Array$prototype = Array.prototype, + filter = _Array$prototype.filter, + indexOf = _Array$prototype.indexOf, + map = _Array$prototype.map, + push = _Array$prototype.push, + reverse = _Array$prototype.reverse, + slice = _Array$prototype.slice, + splice = _Array$prototype.splice; +var idRe = /^#[\w-]*$/, + classRe = /^\.[\w-]*$/, + htmlRe = /<.+>/, + tagRe = /^\w+$/; // @require ./variables.js + +function find(selector, context) { + if (context === void 0) { + context = doc; + } + + return classRe.test(selector) + ? context.getElementsByClassName(selector.slice(1)) + : tagRe.test(selector) + ? context.getElementsByTagName(selector) + : context.querySelectorAll(selector); +} // @require ./find.js +// @require ./variables.js + +function Cash(selector, context) { + if (context === void 0) { + context = doc; + } + + if (!selector) return; + if (selector.__cash) return selector; + var eles = selector; + + if (isString(selector)) { + if (context.__cash) context = context[0]; + eles = idRe.test(selector) + ? context.getElementById(selector.slice(1)) + : htmlRe.test(selector) + ? parseHTML(selector) + : find(selector, context); + if (!eles) return; + } else if (isFunction(selector)) { + return this.ready(selector); //FIXME: `fn.ready` is not included in `core`, but it's actually a core functionality + } + + if (eles.nodeType || eles === win) eles = [eles]; + this.length = eles.length; + + for (var i = 0, l = this.length; i < l; i++) { + this[i] = eles[i]; + } +} + +function cash(selector, context) { + return new Cash(selector, context); +} +/* PROTOTYPE */ + +var fn = (cash.fn = cash.prototype = Cash.prototype = { + constructor: cash, + __cash: true, + length: 0, + splice: splice // Ensures a cash collection gets printed as array-like in Chrome +}); // @require core/cash.js +// @require core/variables.js + +fn.get = function(index) { + if (index === undefined) return slice.call(this); + return this[index < 0 ? index + this.length : index]; +}; // @require core/cash.js +// @require ./get.js + +fn.eq = function(index) { + return cash(this.get(index)); +}; // @require core/cash.js +// @require ./eq.js + +fn.first = function() { + return this.eq(0); +}; // @require core/cash.js +// @require ./eq.js + +fn.last = function() { + return this.eq(-1); +}; // @require core/cash.js +// @require core/variables.js + +fn.map = function(callback) { + return cash( + map.call(this, function(ele, i) { + return callback.call(ele, i, ele); + }) + ); +}; // @require core/cash.js +// @require core/variables.js + +fn.slice = function() { + return cash(slice.apply(this, arguments)); +}; // @require ./cash.js + +var camelCaseRe = /(?:^\w|[A-Z]|\b\w)/g, + camelCaseWhitespaceRe = /[\s-_]+/g; + +function camelCase(str) { + return str + .replace(camelCaseRe, function(letter, index) { + return letter[!index ? 'toLowerCase' : 'toUpperCase'](); + }) + .replace(camelCaseWhitespaceRe, ''); +} + +cash.camelCase = camelCase; // @require ./cash.js + +function each(arr, callback) { + for (var i = 0, l = arr.length; i < l; i++) { + if (callback.call(arr[i], arr[i], i, arr) === false) break; + } +} + +cash.each = each; // @require core/cash.js +// @require core/each.js + +fn.each = function(callback) { + each(this, function(ele, i) { + return callback.call(ele, i, ele); + }); + return this; +}; // @require core/cash.js +// @require collection/each.js + +fn.removeProp = function(prop) { + return this.each(function(i, ele) { + delete ele[prop]; + }); +}; // @require ./cash.js + +function extend(target) { + if (target === void 0) { + target = this; + } + + var args = arguments, + length = args.length; + + for (var i = length < 2 ? 0 : 1; i < length; i++) { + for (var key in args[i]) { + target[key] = args[i][key]; + } + } + + return target; +} + +cash.extend = fn.extend = extend; // @require ./cash.js + +var guid = 1; +cash.guid = guid; // @require ./cash.js + +function matches(ele, selector) { + var matches = + ele && + (ele.matches || + ele.webkitMatchesSelector || + ele.mozMatchesSelector || + ele.msMatchesSelector || + ele.oMatchesSelector); + return !!matches && matches.call(ele, selector); +} + +cash.matches = matches; // @require ./cash.js + +function isFunction(x) { + return typeof x === 'function'; +} + +cash.isFunction = isFunction; + +function isString(x) { + return typeof x === 'string'; +} + +cash.isString = isString; + +function isNumeric(x) { + return !isNaN(parseFloat(x)) && isFinite(x); +} + +cash.isNumeric = isNumeric; +var isArray = Array.isArray; +cash.isArray = isArray; // @require core/cash.js +// @require core/type_checking.js +// @require collection/each.js + +fn.prop = function(prop, value) { + if (!prop) return; + + if (isString(prop)) { + if (arguments.length < 2) return this[0] && this[0][prop]; + return this.each(function(i, ele) { + ele[prop] = value; + }); + } + + for (var key in prop) { + this.prop(key, prop[key]); + } + + return this; +}; // @require ./matches.js +// @require ./type_checking.js + +function getCompareFunction(selector) { + return isString(selector) + ? function(i, ele) { + return matches(ele, selector); + } + : selector.__cash + ? function(i, ele) { + return selector.is(ele); + } + : function(i, ele, selector) { + return ele === selector; + }; +} // @require core/cash.js +// @require core/get_compare_function.js +// @require core/type_checking.js +// @require core/variables.js +// @require collection/get.js + +fn.filter = function(selector) { + if (!selector) return cash(); + var comparator = isFunction(selector) + ? selector + : getCompareFunction(selector); + return cash( + filter.call(this, function(ele, i) { + return comparator.call(ele, i, ele, selector); + }) + ); +}; // @require ./type_checking.js + +var splitValuesRe = /\S+/g; + +function getSplitValues(str) { + return isString(str) ? str.match(splitValuesRe) || [] : []; +} // @require core/cash.js +// @require core/get_split_values.js +// @require collection/each.js + +fn.hasClass = function(cls) { + var classes = getSplitValues(cls); + var check = false; + + if (classes.length) { + this.each(function(i, ele) { + check = ele.classList.contains(classes[0]); + return !check; + }); + } + + return check; +}; // @require core/cash.js +// @require core/get_split_values.js +// @require collection/each.js + +fn.removeAttr = function(attr) { + var attrs = getSplitValues(attr); + if (!attrs.length) return this; + return this.each(function(i, ele) { + each(attrs, function(a) { + ele.removeAttribute(a); + }); + }); +}; // @require core/cash.js +// @require core/type_checking.js +// @require collection/each.js +// @require ./remove_attr.js + +fn.attr = function(attr, value) { + if (!attr) return; + + if (isString(attr)) { + if (arguments.length < 2) { + if (!this[0]) return; + + var _value = this[0].getAttribute(attr); + + return _value === null ? undefined : _value; + } + + if (value === null) return this.removeAttr(attr); + return this.each(function(i, ele) { + ele.setAttribute(attr, value); + }); + } + + for (var key in attr) { + this.attr(key, attr[key]); + } + + return this; +}; // @require core/cash.js +// @require core/each.js +// @require core/get_split_values.js +// @require collection/each.js + +fn.toggleClass = function(cls, force) { + var classes = getSplitValues(cls), + isForce = force !== undefined; + if (!classes.length) return this; + return this.each(function(i, ele) { + each(classes, function(c) { + if (isForce) { + force ? ele.classList.add(c) : ele.classList.remove(c); + } else { + ele.classList.toggle(c); + } + }); + }); +}; // @require core/cash.js +// @require ./toggle_class.js + +fn.addClass = function(cls) { + return this.toggleClass(cls, true); +}; // @require core/cash.js +// @require ./attr.js +// @require ./toggle_class.js + +fn.removeClass = function(cls) { + return !arguments.length + ? this.attr('class', '') + : this.toggleClass(cls, false); +}; // @optional ./add_class.js +// @optional ./attr.js +// @optional ./has_class.js +// @optional ./prop.js +// @optional ./remove_attr.js +// @optional ./remove_class.js +// @optional ./remove_prop.js +// @optional ./toggle_class.js +// @require ./cash.js + +function unique(arr) { + return arr.filter(function(item, index, self) { + return self.indexOf(item) === index; + }); +} + +cash.unique = unique; // @require core/cash.js +// @require core/unique.js +// @require ./get.js + +fn.add = function(selector, context) { + return cash(unique(this.get().concat(cash(selector, context).get()))); +}; // @require core/variables.js + +function computeStyle(ele, prop, isVariable) { + if (ele.nodeType !== 1) return; + var style = win.getComputedStyle(ele, null); + return prop + ? isVariable + ? style.getPropertyValue(prop) + : style[prop] + : style; +} // @require ./compute_style.js + +function computeStyleInt(ele, prop) { + return parseInt(computeStyle(ele, prop), 10) || 0; +} + +var cssVariableRe = /^--/; // @require ./variables.js + +function isCSSVariable(prop) { + return cssVariableRe.test(prop); +} // @require core/camel_case.js +// @require core/cash.js +// @require core/each.js +// @require core/variables.js +// @require ./is_css_variable.js + +var prefixedProps = {}, + docEl = doc && doc.createElement('div'), + style = docEl ? docEl.style : {}, + vendorsPrefixes = ['webkit', 'moz', 'ms', 'o']; + +function getPrefixedProp(prop, isVariable) { + if (isVariable === void 0) { + isVariable = isCSSVariable(prop); + } + + if (isVariable) return prop; + + if (!prefixedProps[prop]) { + var propCC = camelCase(prop), + propUC = '' + propCC.charAt(0).toUpperCase() + propCC.slice(1), + props = ( + propCC + + ' ' + + vendorsPrefixes.join(propUC + ' ') + + propUC + ).split(' '); + each(props, function(p) { + if (p in style) { + prefixedProps[prop] = p; + return false; + } + }); + } + + return prefixedProps[prop]; +} + +cash.prefixedProp = getPrefixedProp; // @require core/type_checking.js +// @require ./is_css_variable.js + +var numericProps = { + animationIterationCount: true, + columnCount: true, + flexGrow: true, + flexShrink: true, + fontWeight: true, + lineHeight: true, + opacity: true, + order: true, + orphans: true, + widows: true, + zIndex: true +}; + +function getSuffixedValue(prop, value, isVariable) { + if (isVariable === void 0) { + isVariable = isCSSVariable(prop); + } + + return !isVariable && !numericProps[prop] && isNumeric(value) + ? value + 'px' + : value; +} // @require core/cash.js +// @require core/type_checking.js +// @require collection/each.js +// @require ./helpers/compute_style.js +// @require ./helpers/get_prefixed_prop.js +// @require ./helpers/get_suffixed_value.js +// @require ./helpers/is_css_variable.js + +fn.css = function(prop, value) { + if (isString(prop)) { + var isVariable = isCSSVariable(prop); + prop = getPrefixedProp(prop, isVariable); + if (arguments.length < 2) + return this[0] && computeStyle(this[0], prop, isVariable); + if (!prop) return this; + value = getSuffixedValue(prop, value, isVariable); + return this.each(function(i, ele) { + if (ele.nodeType !== 1) return; + + if (isVariable) { + ele.style.setProperty(prop, value); + } else { + ele.style[prop] = value; + } + }); + } + + for (var key in prop) { + this.css(key, prop[key]); + } + + return this; +}; // @optional ./css.js + +var dataNamespace = '__cashData', + dataAttributeRe = /^data-(.*)/; // @require core/cash.js +// @require ./helpers/variables.js + +cash.hasData = function(ele) { + return dataNamespace in ele; +}; // @require ./variables.js + +function getDataCache(ele) { + return (ele[dataNamespace] = ele[dataNamespace] || {}); +} // @require attributes/attr.js +// @require ./get_data_cache.js + +function getData(ele, key) { + var cache = getDataCache(ele); + + if (key) { + if (!(key in cache)) { + var value = ele.dataset + ? ele.dataset[key] || ele.dataset[camelCase(key)] + : cash(ele).attr('data-' + key); + + if (value !== undefined) { + try { + value = JSON.parse(value); + } catch (e) {} + + cache[key] = value; + } + } + + return cache[key]; + } + + return cache; +} // @require ./variables.js +// @require ./get_data_cache.js + +function removeData(ele, key) { + if (key === undefined) { + delete ele[dataNamespace]; + } else { + delete getDataCache(ele)[key]; + } +} // @require ./get_data_cache.js + +function setData(ele, key, value) { + getDataCache(ele)[key] = value; +} // @require core/cash.js +// @require core/type_checking.js +// @require collection/each.js +// @require ./helpers/get_data.js +// @require ./helpers/set_data.js +// @require ./helpers/variables.js + +fn.data = function(name, value) { + var _this = this; + + if (!name) { + if (!this[0]) return; + each(this[0].attributes, function(attr) { + var match = attr.name.match(dataAttributeRe); + if (!match) return; + + _this.data(match[1]); + }); + return getData(this[0]); + } + + if (isString(name)) { + if (value === undefined) return this[0] && getData(this[0], name); + return this.each(function(i, ele) { + return setData(ele, name, value); + }); + } + + for (var key in name) { + this.data(key, name[key]); + } + + return this; +}; // @require core/cash.js +// @require collection/each.js +// @require ./helpers/remove_data.js + +fn.removeData = function(key) { + return this.each(function(i, ele) { + return removeData(ele, key); + }); +}; // @optional ./data.js +// @optional ./remove_data.js +// @require css/helpers/compute_style_int.js + +function getExtraSpace(ele, xAxis) { + return ( + computeStyleInt(ele, 'border' + (xAxis ? 'Left' : 'Top') + 'Width') + + computeStyleInt(ele, 'padding' + (xAxis ? 'Left' : 'Top')) + + computeStyleInt(ele, 'padding' + (xAxis ? 'Right' : 'Bottom')) + + computeStyleInt(ele, 'border' + (xAxis ? 'Right' : 'Bottom') + 'Width') + ); +} // @require core/cash.js +// @require core/each.js +// @require core/variables.js + +each(['Width', 'Height'], function(prop) { + fn['inner' + prop] = function() { + if (!this[0]) return; + if (this[0] === win) return win['inner' + prop]; + return this[0]['client' + prop]; + }; +}); // @require core/camel_case.js +// @require core/cash.js +// @require core/each.js +// @require core/variables.js +// @require css/helpers/compute_style.js +// @require css/helpers/get_suffixed_value.js +// @require ./helpers/get_extra_space.js + +each(['width', 'height'], function(prop, index) { + fn[prop] = function(value) { + if (!this[0]) return value === undefined ? undefined : this; + + if (!arguments.length) { + if (this[0] === win) return this[0][camelCase('outer-' + prop)]; + return ( + this[0].getBoundingClientRect()[prop] - getExtraSpace(this[0], !index) + ); + } + + value = parseInt(value, 10); + return this.each(function(i, ele) { + if (ele.nodeType !== 1) return; + var boxSizing = computeStyle(ele, 'boxSizing'); + ele.style[prop] = getSuffixedValue( + prop, + value + (boxSizing === 'border-box' ? getExtraSpace(ele, !index) : 0) + ); + }); + }; +}); // @require core/cash.js +// @require core/each.js +// @require core/variables.js +// @require css/helpers/compute_style_int.js + +each(['Width', 'Height'], function(prop, index) { + fn['outer' + prop] = function(includeMargins) { + if (!this[0]) return; + if (this[0] === win) return win['outer' + prop]; + return ( + this[0]['offset' + prop] + + (includeMargins + ? computeStyleInt(this[0], 'margin' + (!index ? 'Left' : 'Top')) + + computeStyleInt(this[0], 'margin' + (!index ? 'Right' : 'Bottom')) + : 0) + ); + }; +}); // @optional ./inner.js +// @optional ./normal.js +// @optional ./outer.js + +function hasNamespaces(ns1, ns2) { + for (var i = 0, l = ns2.length; i < l; i++) { + if (ns1.indexOf(ns2[i]) < 0) return false; + } + + return true; +} // @require core/each.js + +function removeEventListeners(cache, ele, name) { + each(cache[name], function(_ref) { + var namespaces = _ref[0], + callback = _ref[1]; + ele.removeEventListener(name, callback); + }); + delete cache[name]; +} + +var eventsNamespace = '__cashEvents', + eventsNamespacesSeparator = '.'; // @require ./variables.js + +function getEventsCache(ele) { + return (ele[eventsNamespace] = ele[eventsNamespace] || {}); +} // @require core/guid.js +// @require events/helpers/get_events_cache.js + +function addEvent(ele, name, namespaces, callback) { + callback.guid = callback.guid || guid++; + var eventCache = getEventsCache(ele); + eventCache[name] = eventCache[name] || []; + eventCache[name].push([namespaces, callback]); + ele.addEventListener(name, callback); +} // @require ./variables.js + +function parseEventName(eventName) { + var parts = eventName.split(eventsNamespacesSeparator); + return [parts[0], parts.slice(1).sort()]; // [name, namespaces] +} // @require core/guid.js +// @require ./get_events_cache.js +// @require ./has_namespaces.js +// @require ./parse_event_name.js +// @require ./remove_event_listeners.js + +function removeEvent(ele, name, namespaces, callback) { + var cache = getEventsCache(ele); + + if (!name) { + if (!namespaces || !namespaces.length) { + for (name in cache) { + removeEventListeners(cache, ele, name); + } + } else { + for (name in cache) { + removeEvent(ele, name, namespaces, callback); + } + } + } else { + var eventCache = cache[name]; + if (!eventCache) return; + if (callback) callback.guid = callback.guid || guid++; + cache[name] = eventCache.filter(function(_ref2) { + var ns = _ref2[0], + cb = _ref2[1]; + if ( + (callback && cb.guid !== callback.guid) || + !hasNamespaces(ns, namespaces) + ) + return true; + ele.removeEventListener(name, cb); + }); + } +} // @require core/cash.js +// @require core/each.js +// @require collection/each.js +// @require ./helpers/parse_event_name.js +// @require ./helpers/remove_event.js + +fn.off = function(eventFullName, callback) { + var _this2 = this; + + if (eventFullName === undefined) { + this.each(function(i, ele) { + return removeEvent(ele); + }); + } else { + each(getSplitValues(eventFullName), function(eventFullName) { + var _parseEventName = parseEventName(eventFullName), + name = _parseEventName[0], + namespaces = _parseEventName[1]; + + _this2.each(function(i, ele) { + return removeEvent(ele, name, namespaces, callback); + }); + }); + } + + return this; +}; // @require core/cash.js +// @require core/get_split_values.js +// @require core/guid.js +// @require core/matches.js +// @require core/type_checking.js +// @require collection/each.js +// @require ./helpers/variables.js +// @require ./helpers/add_event.js +// @require ./helpers/has_namespaces.js +// @require ./helpers/parse_event_name.js +// @require ./helpers/remove_event.js + +fn.on = function(eventFullName, selector, callback, _one) { + var _this3 = this; + + if (!isString(eventFullName)) { + for (var key in eventFullName) { + this.on(key, selector, eventFullName[key]); + } + + return this; + } + + if (isFunction(selector)) { + callback = selector; + selector = false; + } + + each(getSplitValues(eventFullName), function(eventFullName) { + var _parseEventName2 = parseEventName(eventFullName), + name = _parseEventName2[0], + namespaces = _parseEventName2[1]; + + _this3.each(function(i, ele) { + var finalCallback = function finalCallback(event) { + if ( + event.namespace && + !hasNamespaces( + namespaces, + event.namespace.split(eventsNamespacesSeparator) + ) + ) + return; + var thisArg = ele; + + if (selector) { + var target = event.target; + + while (!matches(target, selector)) { + if (target === ele) return; + target = target.parentNode; + if (!target) return; + } + + thisArg = target; + } + + event.namespace = event.namespace || ''; + var returnValue = callback.call(thisArg, event, event.data); + + if (_one) { + removeEvent(ele, name, namespaces, finalCallback); + } + + if (returnValue === false) { + event.preventDefault(); + event.stopPropagation(); + } + }; + + finalCallback.guid = callback.guid = callback.guid || guid++; + addEvent(ele, name, namespaces, finalCallback); + }); + }); + return this; +}; // @require core/cash.js +// @require ./on.js + +fn.one = function(eventFullName, delegate, callback) { + return this.on(eventFullName, delegate, callback, true); +}; // @require core/cash.js +// @require core/variables.js + +fn.ready = function(callback) { + var finalCallback = function finalCallback() { + return callback(cash); + }; + + if (doc.readyState !== 'loading') { + setTimeout(finalCallback); + } else { + doc.addEventListener('DOMContentLoaded', finalCallback); + } + + return this; +}; // @require core/cash.js +// @require core/type_checking.js +// @require core/variables.js +// @require collection/each.js +// @require ./helpers/parse_event_name.js +// @require ./helpers/variables.js + +fn.trigger = function(eventFullName, data) { + var evt = eventFullName; + + if (isString(eventFullName)) { + var _parseEventName3 = parseEventName(eventFullName), + name = _parseEventName3[0], + namespaces = _parseEventName3[1]; + + evt = doc.createEvent('HTMLEvents'); + evt.initEvent(name, true, true); + evt.namespace = namespaces.join(eventsNamespacesSeparator); + } + + evt.data = data; + return this.each(function(i, ele) { + ele.dispatchEvent(evt); + }); +}; // @optional ./off.js +// @optional ./on.js +// @optional ./one.js +// @optional ./ready.js +// @optional ./trigger.js +// @require core/each.js + +function getValueSelectMultiple(ele) { + var values = []; + each(ele.options, function(option) { + if (option.selected && !option.disabled && !option.parentNode.disabled) { + values.push(option.value); + } + }); + return values; +} + +function getValueSelectSingle(ele) { + return ele.selectedIndex < 0 ? null : ele.options[ele.selectedIndex].value; +} // @require ./get_value_select_single.js +// @require ./get_value_select_multiple.js + +var selectOneRe = /select-one/i, + selectMultipleRe = /select-multiple/i; + +function getValue(ele) { + var type = ele.type; + if (selectOneRe.test(type)) return getValueSelectSingle(ele); + if (selectMultipleRe.test(type)) return getValueSelectMultiple(ele); + return ele.value; +} + +var queryEncodeSpaceRe = /%20/g; + +function queryEncode(prop, value) { + return ( + '&' + + encodeURIComponent(prop) + + '=' + + encodeURIComponent(value).replace(queryEncodeSpaceRe, '+') + ); +} // @require core/cash.js +// @require core/each.js +// @require core/type_checking.js +// @require ./helpers/get_value.js +// @require ./helpers/query_encode.js + +var skippableRe = /file|reset|submit|button|image/i, + checkableRe = /radio|checkbox/i; + +fn.serialize = function() { + var query = ''; + this.each(function(i, ele) { + each(ele.elements || [ele], function(ele) { + if (ele.disabled || !ele.name || ele.tagName === 'FIELDSET') return; + if (skippableRe.test(ele.type)) return; + if (checkableRe.test(ele.type) && !ele.checked) return; + var value = getValue(ele); + if (value === undefined) return; + var values = isArray(value) ? value : [value]; + each(values, function(value) { + query += queryEncode(ele.name, value); + }); + }); + }); + return query.substr(1); +}; // @require core/cash.js +// @require core/each.js +// @require core/type_checking.js +// @require collection/each.js +// @require ./helpers/get_value.js + +fn.val = function(value) { + if (value === undefined) return this[0] && getValue(this[0]); + return this.each(function(i, ele) { + var isMultiple = selectMultipleRe.test(ele.type), + eleValue = value === null ? (isMultiple ? [] : '') : value; + + if (isMultiple && isArray(eleValue)) { + each(ele.options, function(option) { + option.selected = eleValue.indexOf(option.value) >= 0; + }); + } else { + ele.value = eleValue; + } + }); +}; // @optional ./serialize.js +// @optional ./val.js +// @require core/cash.js +// @require collection/map.js + +fn.clone = function() { + return this.map(function(i, ele) { + return ele.cloneNode(true); + }); +}; // @require core/cash.js +// @require collection/each.js + +fn.detach = function() { + return this.each(function(i, ele) { + if (ele.parentNode) { + ele.parentNode.removeChild(ele); + } + }); +}; // @require ./cash.js +// @require ./variables.js +// @require ./type_checking.js +// @require collection/get.js +// @require manipulation/detach.js + +var fragmentRe = /^\s*<(\w+)[^>]*>/, + singleTagRe = /^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/; +var containers; + +function initContainers() { + if (containers) return; + var table = doc.createElement('table'), + tr = doc.createElement('tr'); + containers = { + '*': doc.createElement('div'), + tr: doc.createElement('tbody'), + td: tr, + th: tr, + thead: table, + tbody: table, + tfoot: table + }; +} + +function parseHTML(html) { + initContainers(); + if (!isString(html)) return []; + if (singleTagRe.test(html)) return [doc.createElement(RegExp.$1)]; + var fragment = fragmentRe.test(html) && RegExp.$1, + container = containers[fragment] || containers['*']; + container.innerHTML = html; + return cash(container.childNodes) + .detach() + .get(); +} + +cash.parseHTML = parseHTML; // @optional ./camel_case.js +// @optional ./each.js +// @optional ./export.js +// @optional ./extend.js +// @optional ./find.js +// @optional ./get_compare_function.js +// @optional ./get_split_values.js +// @optional ./guid.js +// @optional ./matches.js +// @optional ./parse_html.js +// @optional ./unique.js +// @optional ./variables.js +// @require ./cash.js +// @require ./type_checking.js +// @require core/cash.js + +fn.empty = function() { + var ele = this[0]; + + if (ele) { + while (ele.firstChild) { + ele.removeChild(ele.firstChild); + } + } + + return this; +}; + +function insertElement(ele, child, prepend) { + if (prepend) { + ele.insertBefore(child, ele.childNodes[0]); + } else { + ele.appendChild(child); + } +} // @require core/each.js +// @require core/type_checking.js +// @require ./insert_element.js + +function insertContent(parent, child, prepend) { + if (child === undefined) return; + var isStr = isString(child); + + if (!isStr && child.length) { + each(child, function(ele) { + return insertContent(parent, ele, prepend); + }); + } else { + each( + parent, + isStr + ? function(ele) { + ele.insertAdjacentHTML(prepend ? 'afterbegin' : 'beforeend', child); + } + : function(ele, index) { + return insertElement( + ele, + !index ? child : child.cloneNode(true), + prepend + ); + } + ); + } +} // @require core/cash.js +// @require core/each.js +// @require ./helpers/insert_content.js + +fn.append = function() { + var _this4 = this; + + each(arguments, function(content) { + insertContent(_this4, content); + }); + return this; +}; // @require core/cash.js +// @require ./helpers/insert_content.js + +fn.appendTo = function(parent) { + insertContent(cash(parent), this); + return this; +}; // @require core/cash.js +// @require collection/each.js + +fn.html = function(content) { + if (content === undefined) return this[0] && this[0].innerHTML; + var source = content.nodeType ? content[0].outerHTML : content; + return this.each(function(i, ele) { + ele.innerHTML = source; + }); +}; // @require core/cash.js +// @require collection/each.js + +fn.insertAfter = function(content) { + var _this5 = this; + + cash(content).each(function(index, ele) { + var parent = ele.parentNode; + + _this5.each(function(i, e) { + parent.insertBefore(!index ? e : e.cloneNode(true), ele.nextSibling); + }); + }); + return this; +}; // @require core/cash.js +// @require core/each.js +// @require core/variables.js +// @require collection/slice.js +// @require ./insert_after.js + +fn.after = function() { + var _this6 = this; + + each(reverse.apply(arguments), function(content) { + reverse.apply(cash(content).slice()).insertAfter(_this6); + }); + return this; +}; // @require core/cash.js +// @require collection/each.js + +fn.insertBefore = function(selector) { + var _this7 = this; + + cash(selector).each(function(index, ele) { + var parent = ele.parentNode; + + _this7.each(function(i, e) { + parent.insertBefore(!index ? e : e.cloneNode(true), ele); + }); + }); + return this; +}; // @require core/cash.js +// @require core/each.js +// @require ./insert_before.js + +fn.before = function() { + var _this8 = this; + + each(arguments, function(content) { + cash(content).insertBefore(_this8); + }); + return this; +}; // @require core/cash.js +// @require core/each.js +// @require ./helpers/insert_content.js + +fn.prepend = function() { + var _this9 = this; + + each(arguments, function(content) { + insertContent(_this9, content, true); + }); + return this; +}; // @require core/cash.js +// @require core/variables.js +// @require collection/slice.js +// @require ./helpers/insert_content.js + +fn.prependTo = function(parent) { + insertContent(cash(parent), reverse.apply(this.slice()), true); + return this; +}; // @require core/cash.js +// @require events/off.js +// @require ./detach.js + +fn.remove = function() { + return this.detach().off(); +}; // @require core/cash.js +// @require collection/each.js +// @require collection/slice.js +// @require ./after.js +// @require ./remove.js + +fn.replaceWith = function(content) { + var _this10 = this; + + return this.each(function(i, ele) { + var parent = ele.parentNode; + if (!parent) return; + var $eles = i ? cash(content).clone() : cash(content); + + if (!$eles[0]) { + _this10.remove(); + + return false; + } + + parent.replaceChild($eles[0], ele); + cash($eles[0]).after($eles.slice(1)); + }); +}; // @require core/cash.js +// @require ./replace_with.js + +fn.replaceAll = function(content) { + cash(content).replaceWith(this); + return this; +}; // @require core/cash.js +// @require collection/each.js + +fn.text = function(content) { + if (content === undefined) return this[0] ? this[0].textContent : ''; + return this.each(function(i, ele) { + ele.textContent = content; + }); +}; // @optional ./after.js +// @optional ./append.js +// @optional ./append_to.js +// @optional ./before.js +// @optional ./clone.js +// @optional ./detach.js +// @optional ./empty.js +// @optional ./html.js +// @optional ./insert_after.js +// @optional ./insert_before.js +// @optional ./prepend.js +// @optional ./prepend_to.js +// @optional ./remove.js +// @optional ./replace_all.js +// @optional ./replace_with.js +// @optional ./text.js +// @require core/cash.js +// @require core/variables.js + +var docEle = doc.documentElement; + +fn.offset = function() { + var ele = this[0]; + if (!ele) return; + var rect = ele.getBoundingClientRect(); + return { + top: rect.top + win.pageYOffset - docEle.clientTop, + left: rect.left + win.pageXOffset - docEle.clientLeft + }; +}; // @require core/cash.js + +fn.offsetParent = function() { + return cash(this[0] && this[0].offsetParent); +}; // @require core/cash.js + +fn.position = function() { + var ele = this[0]; + if (!ele) return; + return { + left: ele.offsetLeft, + top: ele.offsetTop + }; +}; // @optional ./offset.js +// @optional ./offset_parent.js +// @optional ./position.js +// @require core/cash.js +// @require core/matches.js +// @require core/unique.js +// @require collection/each.js +// @require collection/filter.js + +fn.children = function(selector) { + var result = []; + this.each(function(i, ele) { + push.apply(result, ele.children); + }); + result = cash(unique(result)); + if (!selector) return result; + return result.filter(function(i, ele) { + return matches(ele, selector); + }); +}; // @require core/cash.js +// @require core/unique.js +// @require collection/each.js + +fn.contents = function() { + var result = []; + this.each(function(i, ele) { + push.apply( + result, + ele.tagName === 'IFRAME' ? [ele.contentDocument] : ele.childNodes + ); + }); + return cash(result.length && unique(result)); +}; // @require core/cash.js +// @require core/unique.js +// @require core/find.js +// @require core/variables.js + +fn.find = function(selector) { + var result = []; + + for (var i = 0, l = this.length; i < l; i++) { + var found = find(selector, this[i]); + + if (found.length) { + push.apply(result, found); + } + } + + return cash(result.length && unique(result)); +}; // @require core/cash.js +// @require core/find.js +// @require core/type_checking.js +// @require collection/filter.js + +fn.has = function(selector) { + var comparator = isString(selector) + ? function(i, ele) { + return !!find(selector, ele).length; + } + : function(i, ele) { + return ele.contains(selector); + }; + return this.filter(comparator); +}; // @require core/cash.js +// @require core/get_compare_function.js +// @require collection/each.js + +fn.is = function(selector) { + if (!selector || !this[0]) return false; + var comparator = getCompareFunction(selector); + var check = false; + this.each(function(i, ele) { + check = comparator(i, ele, selector); + return !check; + }); + return check; +}; // @require core/cash.js + +fn.next = function() { + return cash(this[0] && this[0].nextElementSibling); +}; // @require core/cash.js +// @require core/get_compare_function.js +// @require collection/filter.js + +fn.not = function(selector) { + if (!selector || !this[0]) return this; + var comparator = getCompareFunction(selector); + return this.filter(function(i, ele) { + return !comparator(i, ele, selector); + }); +}; // @require core/cash.js +// @require core/unique.js +// @require collection/each.js + +fn.parent = function() { + var result = []; + this.each(function(i, ele) { + if (ele && ele.parentNode) { + result.push(ele.parentNode); + } + }); + return cash(unique(result)); +}; // @require core/cash.js +// @require core/variables.js +// @require traversal/children.js +// @require traversal/parent.js +// @require ./get.js +//FIXME Ugly file name, is there a better option? + +fn.index = function(ele) { + var child = ele ? cash(ele)[0] : this[0], + collection = ele + ? this + : cash(child) + .parent() + .children(); + return indexOf.call(collection, child); +}; // @optional ./add.js +// @optional ./each.js +// @optional ./eq.js +// @optional ./filter.js +// @optional ./first.js +// @optional ./get.js +// @optional ./indexFn.js +// @optional ./last.js +// @optional ./map.js +// @optional ./slice.js +// @require core/cash.js +// @require collection/filter.js +// @require ./is.js +// @require ./parent.js + +fn.closest = function(selector) { + if (!selector || !this[0]) return cash(); + if (this.is(selector)) return this.filter(selector); + return this.parent().closest(selector); +}; // @require core/cash.js +// @require core/matches.js +// @require core/unique.js +// @require core/variables.js +// @require collection/each.js + +fn.parents = function(selector) { + var result = []; + var last; + this.each(function(i, ele) { + last = ele; + + while (last && last.parentNode && last !== doc.body.parentNode) { + last = last.parentNode; + + if (!selector || (selector && matches(last, selector))) { + result.push(last); + } + } + }); + return cash(unique(result)); +}; // @require core/cash.js + +fn.prev = function() { + return cash(this[0] && this[0].previousElementSibling); +}; // @require core/cash.js +// @require collection/filter.js +// @require ./children.js +// @require ./parent.js + +fn.siblings = function() { + var ele = this[0]; + return this.parent() + .children() + .filter(function(i, child) { + return child !== ele; + }); +}; // @optional ./children.js +// @optional ./closest.js +// @optional ./contents.js +// @optional ./find.js +// @optional ./has.js +// @optional ./is.js +// @optional ./next.js +// @optional ./not.js +// @optional ./parent.js +// @optional ./parents.js +// @optional ./prev.js +// @optional ./siblings.js +// @optional attributes/index.js +// @optional collection/index.js +// @optional css/index.js +// @optional data/index.js +// @optional dimensions/index.js +// @optional events/index.js +// @optional forms/index.js +// @optional manipulation/index.js +// @optional offset/index.js +// @optional traversal/index.js +// @require core/index.js +export default cash; From f87cff27e96772a34e0efc972fcd5f5331c75715 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 3 Nov 2021 12:52:38 +0100 Subject: [PATCH 007/313] Update webpack --- webpack.config.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index c67d5f3d3..f7591414f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -17,8 +17,6 @@ export default ({ config }) => ({ }, module: { rules: [ - // Disable AMD in vendors - { test: /\.js$/, parser: { amd: false } }, ...config.module.rules, ], }, From 88f31fc5b84d2d242be54f195d8b5e40d2100570 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 3 Nov 2021 13:16:18 +0100 Subject: [PATCH 008/313] Update webpack --- src/utils/cash-dom.js | 2 +- webpack.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/cash-dom.js b/src/utils/cash-dom.js index 3efb36fcf..1dbfb1d9a 100644 --- a/src/utils/cash-dom.js +++ b/src/utils/cash-dom.js @@ -1214,7 +1214,7 @@ fn.text = function(content) { // @require core/cash.js // @require core/variables.js -var docEle = doc.documentElement; +var docEle = doc && doc.documentElement; fn.offset = function() { var ele = this[0]; diff --git a/webpack.config.js b/webpack.config.js index f7591414f..211cbdae9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -23,7 +23,7 @@ export default ({ config }) => ({ resolve: { modules: ['src', 'node_modules'], alias: { - jquery: 'cash-dom', + jquery: 'utils/cash-dom', backbone: `${rootDir}/node_modules/backbone`, underscore: `${rootDir}/node_modules/underscore`, } From 2aa45f33b0494439564a335659c57e2b0cf28741 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 3 Nov 2021 13:24:18 +0100 Subject: [PATCH 009/313] Update package.json --- package.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/package.json b/package.json index bd6439edb..a758fd111 100644 --- a/package.json +++ b/package.json @@ -80,10 +80,7 @@ ], "setupFiles": [ "/test/setup.js" - ], - "moduleNameMapper": { - "^jquery$": "cash-dom" - } + ] }, "husky": { "hooks": { From 64ac23d20632d7a22f38c3a9e6c4487566d7f019 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 3 Nov 2021 13:31:29 +0100 Subject: [PATCH 010/313] Bump 0.17.29 --- dist/grapes.min.js | 4 ++-- dist/grapes.min.js.map | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/grapes.min.js b/dist/grapes.min.js index eee7934da..1214fcf5a 100644 --- a/dist/grapes.min.js +++ b/dist/grapes.min.js @@ -1,3 +1,3 @@ -/*! grapesjs - 0.17.28 */ -!function(t,e){'object'==typeof exports&&'object'==typeof module?module.exports=e():'function'==typeof define&&define.amd?define([],e):'object'==typeof exports?exports["grapesjs"]=e():t["grapesjs"]=e()}('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(t,'__esModule',{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&'object'==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,'default',{enumerable:!0,value:t}),2&e&&'string'!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t['default']}:function(){return t};return n.d(e,'a',e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=100)}([function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return kn})),n.d(e,"VERSION",(function(){return i["e"]})),n.d(e,"restArguments",(function(){return o})),n.d(e,"isObject",(function(){return a})),n.d(e,"isNull",(function(){return s})),n.d(e,"isUndefined",(function(){return c})),n.d(e,"isBoolean",(function(){return l})),n.d(e,"isElement",(function(){return u})),n.d(e,"isString",(function(){return h})),n.d(e,"isNumber",(function(){return f})),n.d(e,"isDate",(function(){return p})),n.d(e,"isRegExp",(function(){return g})),n.d(e,"isError",(function(){return v})),n.d(e,"isSymbol",(function(){return m})),n.d(e,"isArrayBuffer",(function(){return y})),n.d(e,"isDataView",(function(){return j})),n.d(e,"isArray",(function(){return T})),n.d(e,"isFunction",(function(){return O})),n.d(e,"isArguments",(function(){return _})),n.d(e,"isFinite",(function(){return M})),n.d(e,"isNaN",(function(){return D})),n.d(e,"isTypedArray",(function(){return V})),n.d(e,"isEmpty",(function(){return U})),n.d(e,"isMatch",(function(){return $})),n.d(e,"isEqual",(function(){return Y})),n.d(e,"isMap",(function(){return ot})),n.d(e,"isWeakMap",(function(){return at})),n.d(e,"isSet",(function(){return st})),n.d(e,"isWeakSet",(function(){return ct})),n.d(e,"keys",(function(){return B})),n.d(e,"allKeys",(function(){return X})),n.d(e,"values",(function(){return lt})),n.d(e,"pairs",(function(){return ut})),n.d(e,"invert",(function(){return dt})),n.d(e,"functions",(function(){return ht})),n.d(e,"methods",(function(){return ht})),n.d(e,"extend",(function(){return pt})),n.d(e,"extendOwn",(function(){return gt})),n.d(e,"assign",(function(){return gt})),n.d(e,"defaults",(function(){return vt})),n.d(e,"create",(function(){return yt})),n.d(e,"clone",(function(){return bt})),n.d(e,"tap",(function(){return wt})),n.d(e,"get",(function(){return kt})),n.d(e,"has",(function(){return St})),n.d(e,"mapObject",(function(){return At})),n.d(e,"identity",(function(){return jt})),n.d(e,"constant",(function(){return A})),n.d(e,"noop",(function(){return Lt})),n.d(e,"toPath",(function(){return Ot})),n.d(e,"property",(function(){return Pt})),n.d(e,"propertyOf",(function(){return Nt})),n.d(e,"matcher",(function(){return Tt})),n.d(e,"matches",(function(){return Tt})),n.d(e,"times",(function(){return Rt})),n.d(e,"random",(function(){return It})),n.d(e,"now",(function(){return Ft})),n.d(e,"escape",(function(){return Ht})),n.d(e,"unescape",(function(){return Bt})),n.d(e,"templateSettings",(function(){return Ut})),n.d(e,"template",(function(){return Yt})),n.d(e,"result",(function(){return Xt})),n.d(e,"uniqueId",(function(){return Zt})),n.d(e,"chain",(function(){return Qt})),n.d(e,"iteratee",(function(){return Mt})),n.d(e,"partial",(function(){return ne})),n.d(e,"bind",(function(){return re})),n.d(e,"bindAll",(function(){return ae})),n.d(e,"memoize",(function(){return se})),n.d(e,"delay",(function(){return ce})),n.d(e,"defer",(function(){return le})),n.d(e,"throttle",(function(){return ue})),n.d(e,"debounce",(function(){return de})),n.d(e,"wrap",(function(){return he})),n.d(e,"negate",(function(){return fe})),n.d(e,"compose",(function(){return pe})),n.d(e,"after",(function(){return ge})),n.d(e,"before",(function(){return ve})),n.d(e,"once",(function(){return me})),n.d(e,"findKey",(function(){return ye})),n.d(e,"findIndex",(function(){return we})),n.d(e,"findLastIndex",(function(){return Oe})),n.d(e,"sortedIndex",(function(){return xe})),n.d(e,"indexOf",(function(){return ke})),n.d(e,"lastIndexOf",(function(){return Se})),n.d(e,"find",(function(){return je})),n.d(e,"detect",(function(){return je})),n.d(e,"findWhere",(function(){return Te})),n.d(e,"each",(function(){return Pe})),n.d(e,"forEach",(function(){return Pe})),n.d(e,"map",(function(){return Ee})),n.d(e,"collect",(function(){return Ee})),n.d(e,"reduce",(function(){return Me})),n.d(e,"foldl",(function(){return Me})),n.d(e,"inject",(function(){return Me})),n.d(e,"reduceRight",(function(){return De})),n.d(e,"foldr",(function(){return De})),n.d(e,"filter",(function(){return Ae})),n.d(e,"select",(function(){return Ae})),n.d(e,"reject",(function(){return Le})),n.d(e,"every",(function(){return Ne})),n.d(e,"all",(function(){return Ne})),n.d(e,"some",(function(){return Re})),n.d(e,"any",(function(){return Re})),n.d(e,"contains",(function(){return Ie})),n.d(e,"includes",(function(){return Ie})),n.d(e,"include",(function(){return Ie})),n.d(e,"invoke",(function(){return Fe})),n.d(e,"pluck",(function(){return Ve})),n.d(e,"where",(function(){return ze})),n.d(e,"max",(function(){return He})),n.d(e,"min",(function(){return Be})),n.d(e,"shuffle",(function(){return $e})),n.d(e,"sample",(function(){return Ue})),n.d(e,"sortBy",(function(){return We})),n.d(e,"groupBy",(function(){return Ge})),n.d(e,"indexBy",(function(){return Ke})),n.d(e,"countBy",(function(){return Ye})),n.d(e,"partition",(function(){return Xe})),n.d(e,"toArray",(function(){return Ze})),n.d(e,"size",(function(){return Qe})),n.d(e,"pick",(function(){return en})),n.d(e,"omit",(function(){return nn})),n.d(e,"first",(function(){return on})),n.d(e,"head",(function(){return on})),n.d(e,"take",(function(){return on})),n.d(e,"initial",(function(){return rn})),n.d(e,"last",(function(){return sn})),n.d(e,"rest",(function(){return an})),n.d(e,"tail",(function(){return an})),n.d(e,"drop",(function(){return an})),n.d(e,"compact",(function(){return cn})),n.d(e,"flatten",(function(){return ln})),n.d(e,"without",(function(){return dn})),n.d(e,"uniq",(function(){return hn})),n.d(e,"unique",(function(){return hn})),n.d(e,"union",(function(){return fn})),n.d(e,"intersection",(function(){return pn})),n.d(e,"difference",(function(){return un})),n.d(e,"unzip",(function(){return gn})),n.d(e,"transpose",(function(){return gn})),n.d(e,"zip",(function(){return vn})),n.d(e,"object",(function(){return mn})),n.d(e,"range",(function(){return yn})),n.d(e,"chunk",(function(){return bn})),n.d(e,"mixin",(function(){return On}));var r={};n.r(r),n.d(r,"VERSION",(function(){return i["e"]})),n.d(r,"restArguments",(function(){return o})),n.d(r,"isObject",(function(){return a})),n.d(r,"isNull",(function(){return s})),n.d(r,"isUndefined",(function(){return c})),n.d(r,"isBoolean",(function(){return l})),n.d(r,"isElement",(function(){return u})),n.d(r,"isString",(function(){return h})),n.d(r,"isNumber",(function(){return f})),n.d(r,"isDate",(function(){return p})),n.d(r,"isRegExp",(function(){return g})),n.d(r,"isError",(function(){return v})),n.d(r,"isSymbol",(function(){return m})),n.d(r,"isArrayBuffer",(function(){return y})),n.d(r,"isDataView",(function(){return j})),n.d(r,"isArray",(function(){return T})),n.d(r,"isFunction",(function(){return O})),n.d(r,"isArguments",(function(){return _})),n.d(r,"isFinite",(function(){return M})),n.d(r,"isNaN",(function(){return D})),n.d(r,"isTypedArray",(function(){return V})),n.d(r,"isEmpty",(function(){return U})),n.d(r,"isMatch",(function(){return $})),n.d(r,"isEqual",(function(){return Y})),n.d(r,"isMap",(function(){return ot})),n.d(r,"isWeakMap",(function(){return at})),n.d(r,"isSet",(function(){return st})),n.d(r,"isWeakSet",(function(){return ct})),n.d(r,"keys",(function(){return B})),n.d(r,"allKeys",(function(){return X})),n.d(r,"values",(function(){return lt})),n.d(r,"pairs",(function(){return ut})),n.d(r,"invert",(function(){return dt})),n.d(r,"functions",(function(){return ht})),n.d(r,"methods",(function(){return ht})),n.d(r,"extend",(function(){return pt})),n.d(r,"extendOwn",(function(){return gt})),n.d(r,"assign",(function(){return gt})),n.d(r,"defaults",(function(){return vt})),n.d(r,"create",(function(){return yt})),n.d(r,"clone",(function(){return bt})),n.d(r,"tap",(function(){return wt})),n.d(r,"get",(function(){return kt})),n.d(r,"has",(function(){return St})),n.d(r,"mapObject",(function(){return At})),n.d(r,"identity",(function(){return jt})),n.d(r,"constant",(function(){return A})),n.d(r,"noop",(function(){return Lt})),n.d(r,"toPath",(function(){return Ot})),n.d(r,"property",(function(){return Pt})),n.d(r,"propertyOf",(function(){return Nt})),n.d(r,"matcher",(function(){return Tt})),n.d(r,"matches",(function(){return Tt})),n.d(r,"times",(function(){return Rt})),n.d(r,"random",(function(){return It})),n.d(r,"now",(function(){return Ft})),n.d(r,"escape",(function(){return Ht})),n.d(r,"unescape",(function(){return Bt})),n.d(r,"templateSettings",(function(){return Ut})),n.d(r,"template",(function(){return Yt})),n.d(r,"result",(function(){return Xt})),n.d(r,"uniqueId",(function(){return Zt})),n.d(r,"chain",(function(){return Qt})),n.d(r,"iteratee",(function(){return Mt})),n.d(r,"partial",(function(){return ne})),n.d(r,"bind",(function(){return re})),n.d(r,"bindAll",(function(){return ae})),n.d(r,"memoize",(function(){return se})),n.d(r,"delay",(function(){return ce})),n.d(r,"defer",(function(){return le})),n.d(r,"throttle",(function(){return ue})),n.d(r,"debounce",(function(){return de})),n.d(r,"wrap",(function(){return he})),n.d(r,"negate",(function(){return fe})),n.d(r,"compose",(function(){return pe})),n.d(r,"after",(function(){return ge})),n.d(r,"before",(function(){return ve})),n.d(r,"once",(function(){return me})),n.d(r,"findKey",(function(){return ye})),n.d(r,"findIndex",(function(){return we})),n.d(r,"findLastIndex",(function(){return Oe})),n.d(r,"sortedIndex",(function(){return xe})),n.d(r,"indexOf",(function(){return ke})),n.d(r,"lastIndexOf",(function(){return Se})),n.d(r,"find",(function(){return je})),n.d(r,"detect",(function(){return je})),n.d(r,"findWhere",(function(){return Te})),n.d(r,"each",(function(){return Pe})),n.d(r,"forEach",(function(){return Pe})),n.d(r,"map",(function(){return Ee})),n.d(r,"collect",(function(){return Ee})),n.d(r,"reduce",(function(){return Me})),n.d(r,"foldl",(function(){return Me})),n.d(r,"inject",(function(){return Me})),n.d(r,"reduceRight",(function(){return De})),n.d(r,"foldr",(function(){return De})),n.d(r,"filter",(function(){return Ae})),n.d(r,"select",(function(){return Ae})),n.d(r,"reject",(function(){return Le})),n.d(r,"every",(function(){return Ne})),n.d(r,"all",(function(){return Ne})),n.d(r,"some",(function(){return Re})),n.d(r,"any",(function(){return Re})),n.d(r,"contains",(function(){return Ie})),n.d(r,"includes",(function(){return Ie})),n.d(r,"include",(function(){return Ie})),n.d(r,"invoke",(function(){return Fe})),n.d(r,"pluck",(function(){return Ve})),n.d(r,"where",(function(){return ze})),n.d(r,"max",(function(){return He})),n.d(r,"min",(function(){return Be})),n.d(r,"shuffle",(function(){return $e})),n.d(r,"sample",(function(){return Ue})),n.d(r,"sortBy",(function(){return We})),n.d(r,"groupBy",(function(){return Ge})),n.d(r,"indexBy",(function(){return Ke})),n.d(r,"countBy",(function(){return Ye})),n.d(r,"partition",(function(){return Xe})),n.d(r,"toArray",(function(){return Ze})),n.d(r,"size",(function(){return Qe})),n.d(r,"pick",(function(){return en})),n.d(r,"omit",(function(){return nn})),n.d(r,"first",(function(){return on})),n.d(r,"head",(function(){return on})),n.d(r,"take",(function(){return on})),n.d(r,"initial",(function(){return rn})),n.d(r,"last",(function(){return sn})),n.d(r,"rest",(function(){return an})),n.d(r,"tail",(function(){return an})),n.d(r,"drop",(function(){return an})),n.d(r,"compact",(function(){return cn})),n.d(r,"flatten",(function(){return ln})),n.d(r,"without",(function(){return dn})),n.d(r,"uniq",(function(){return hn})),n.d(r,"unique",(function(){return hn})),n.d(r,"union",(function(){return fn})),n.d(r,"intersection",(function(){return pn})),n.d(r,"difference",(function(){return un})),n.d(r,"unzip",(function(){return gn})),n.d(r,"transpose",(function(){return gn})),n.d(r,"zip",(function(){return vn})),n.d(r,"object",(function(){return mn})),n.d(r,"range",(function(){return yn})),n.d(r,"chunk",(function(){return bn})),n.d(r,"mixin",(function(){return On})),n.d(r,"default",(function(){return xn}));var i=n(7);function o(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),i=0;i=0&&n<=i["b"]}}function N(t){return function(e){return null==e?void 0:e[t]}}var R=N('byteLength'),I=L(R),F=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var V=i["r"]?function(t){return i["l"]?Object(i["l"])(t)&&!j(t):I(t)&&F.test(i["t"].call(t))}:A(!1),z=N('length');function H(t,e){e=function(t){for(var e={},n=t.length,r=0;r':'>','"':'"',"'":''','`':'`'},Ht=Vt(zt),Bt=Vt(dt(zt)),Ut=W.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},$t=/(.)^/,Wt={"'":"'",'\\':'\\','\r':'r','\n':'n','\u2028':'u2028','\u2029':'u2029'},qt=/\\|'|\r|\n|\u2028|\u2029/g;function Gt(t){return'\\'+Wt[t]}var Kt=/^\s*(\w|\$)+\s*$/;function Yt(t,e,n){!e&&n&&(e=n),e=vt({},e,W.templateSettings);var r=RegExp([(e.escape||$t).source,(e.interpolate||$t).source,(e.evaluate||$t).source].join('|')+'|$','g'),i=0,o="__p+='";t.replace(r,(function(e,n,r,a,s){return o+=t.slice(i,s).replace(qt,Gt),i=s+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e})),o+="';\n";var a,s=e.variable;if(s){if(!Kt.test(s))throw new Error('variable is not a bare identifier: '+s)}else o='with(obj||{}){\n'+o+'}\n',s='obj';o="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+o+'return __p;\n';try{a=new Function(s,'_',o)}catch(t){throw t.source=o,t}var c=function(t){return a.call(this,t,W)};return c.source='function('+s+'){\n'+o+'}',c}function Xt(t,e,n){var r=(e=xt(e)).length;if(!r)return O(n)?n.call(t):n;for(var i=0;i1)oe(s,e-1,n,r),i=r.length;else for(var c=0,l=s.length;ce?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(c,u)),a};return l.cancel=function(){clearTimeout(r),s=0,r=i=o=null},l}function de(t,e,n){var r,i,a,s,c,l=function(){var o=Ft()-i;e>o?r=setTimeout(l,e-o):(r=null,n||(s=t.apply(c,a)),r||(a=c=null))},u=o((function(o){return c=this,a=o,i=Ft(),r||(r=setTimeout(l,e),n&&(s=t.apply(c,a))),s}));return u.cancel=function(){clearTimeout(r),r=a=c=null},u}function he(t,e){return ne(e,t)}function fe(t){return function(){return!t.apply(this,arguments)}}function pe(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function ge(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function ve(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}var me=ne(ve,2);function ye(t,e,n){e=Dt(e,n);for(var r,i=B(t),o=0,a=i.length;o0?0:i-1;o>=0&&o0?s=a>=0?a:Math.max(a+c,s):c=a>=0?Math.min(a+1,c):a+c+1;else if(n&&a&&c)return r[a=n(r,o)]===o?a:-1;if(o!=o)return(a=e(i["q"].call(r,s,c),D))>=0?a+s:-1;for(a=t>0?s:c-1;a>=0&&a0?0:a-1;for(i||(r=e[o?o[s]:s],s+=t);s>=0&&s=3;return e(t,Et(n,i,4),r,o)}}var Me=_e(1),De=_e(-1);function Ae(t,e,n){var r=[];return e=Dt(e,n),Pe(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r}function Le(t,e,n){return Ae(t,fe(Dt(e)),n)}function Ne(t,e,n){e=Dt(e,n);for(var r=!ie(t)&&B(t),i=(r||t).length,o=0;o=0}var Fe=o((function(t,e,n){var r,i;return O(e)?i=e:(e=xt(e),r=e.slice(0,-1),e=e[e.length-1]),Ee(t,(function(t){var o=i;if(!o){if(r&&r.length&&(t=Ct(t,r)),null==t)return;o=t[e]}return null==o?o:o.apply(t,n)}))}));function Ve(t,e){return Ee(t,Pt(e))}function ze(t,e){return Ae(t,Tt(e))}function He(t,e,n){var r,i,o=-1/0,a=-1/0;if(null==e||'number'==typeof e&&'object'!=typeof t[0]&&null!=t)for(var s=0,c=(t=ie(t)?t:lt(t)).length;so&&(o=r);else e=Dt(e,n),Pe(t,(function(t,n,r){((i=e(t,n,r))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)}));return o}function Be(t,e,n){var r,i,o=1/0,a=1/0;if(null==e||'number'==typeof e&&'object'!=typeof t[0]&&null!=t)for(var s=0,c=(t=ie(t)?t:lt(t)).length;sr||void 0===n)return 1;if(n1&&(r=Et(r,e[1])),e=X(t)):(r=tn,e=oe(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i1&&(n=e[1])):(e=Ee(oe(e,!1,!1),String),r=function(t,n){return!Ie(e,n)}),en(t,r,n)}));function rn(t,e,n){return i["q"].call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function on(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[0]:rn(t,t.length-e)}function an(t,e,n){return i["q"].call(t,null==e||n?1:e)}function sn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[t.length-1]:an(t,Math.max(0,t.length-e))}function cn(t){return Ae(t,Boolean)}function ln(t,e){return oe(t,e,!1)}var un=o((function(t,e){return e=oe(e,!0,!0),Ae(t,(function(t){return!Ie(e,t)}))})),dn=o((function(t,e){return un(t,e)}));function hn(t,e,n,r){l(e)||(r=n,n=e,e=!1),null!=n&&(n=Dt(n,r));for(var i=[],o=[],a=0,s=z(t);a1&&void 0!==arguments[1]?arguments[1]:{},r=Object(s["isArray"])(e)?a()(e):[e];if(r.length){var i=r.shift();if(i&&(!n.unique||!document.querySelector("link[href=\"".concat(i,"\"]")))){var o=document,c=o.head,l=document.createElement('link');l.href=i,l.rel='stylesheet',n.prepand?c.insertBefore(l,c.firstChild):c.appendChild(l)}t(r)}},p=function(t,e){var n={},r=Object(s["keys"])(e);for(var i in t)if(t.hasOwnProperty(i)){var o=t[i],a=e[i];r.indexOf(i)>=0?o!==a&&(n[i]=a):n[i]=null}for(var c in e)e.hasOwnProperty(c)&&Object(s["isUndefined"])(t[c])&&(n[c]=e[c]);return n},g=function(t,e,n,r){e=e.split(/\s+/),t=t instanceof Array?t:[t];for(var i=function(i){t.forEach((function(t){return t&&t.addEventListener(e[i],n,r)}))},o=0;o1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=0;if(isNaN(t))return n;if(t=parseFloat(t),Math.floor(t)!==t){var i=e.toString().split('.')[1];r=i?i.length:0}return r?parseFloat(t.toFixed(r)):t},O=function(t){return'draggable'in document.createElement('i')&&(t?t.get('Config').nativeDnD:1)},x=function(t){return Object(s["isElement"])(t)||C(t)?t:t&&t.getEl?t.getEl():void 0},C=function(t){return t&&3===t.nodeType},k=function(t){return t&&8===t.nodeType},S=function(t){return t&&!C(t)&&!k(t)},j=function(t,e){var n=null;return t.some((function(r,i){return e(r,i,t)?(n=r,1):0})),n},T=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'';return"".concat(t).replace(/&/g,'&').replace(//g,'>').replace(/"/g,'"').replace(/'/g,''').replace(/`/g,'`')},P=function(t,e){var n=t;return Object(s["isElement"])(t)&&(n=e(t).data('model')),n},E=function(t){var e,n={top:0,left:0,width:0,height:0};if(!t)return n;if(C(t)){var r=document.createRange();r.selectNode(t),e=r.getBoundingClientRect(),r.detach()}return e||(t.getBoundingClientRect?t.getBoundingClientRect():n)},_=function(t){return t.touches&&t.touches[0]?t.touches[0]:t},M=function(t){return t.which||t.keyCode},D=function(t){return String.fromCharCode(M(t))},A=function(t){return 27===M(t)},L=function(t){return 13===M(t)},N=function(t){return null!==t&&!Array.isArray(t)&&'object'===i()(t)},R=function(t){return Object.keys(t).length<=0},I=function(t){return t&&t.charAt(0).toUpperCase()+t.substring(1)},F=function(t){return t&&t.toHTML},V=function(t){return t&&t.toCSS},z=function(t){return t.__gjsv},H=function(t,e){t.__gjsv=e},B=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e='',n='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',r=n.length,i=0;ithis.length&&(i=this.length),i<0&&(i+=this.length+1);var o,a,s=[],c=[],l=[],u=[],d={},h=e.add,f=e.merge,p=e.remove,g=!1,v=this.comparator&&null==i&&!1!==e.sort,m=n.isString(this.comparator)?this.comparator:null;for(a=0;a7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=('/'+this.root+'/').replace(L,'/'),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||'/';return this.location.replace(e+'#'+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement('iframe'),this.iframe.src='javascript:0',this.iframe.style.display='none',this.iframe.tabIndex=-1;var r=document.body,i=r.insertBefore(this.iframe,r.firstChild).contentWindow;i.document.open(),i.document.close(),i.location.hash='#'+this.fragment}var o=window.addEventListener||function(t,e){return attachEvent('on'+t,e)};if(this._usePushState?o('popstate',this.checkUrl,!1):this._useHashChange&&!this.iframe?o('hashchange',this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent('on'+t,e)};this._usePushState?t('popstate',this.checkUrl,!1):this._useHashChange&&!this.iframe&&t('hashchange',this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),D.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),n.some(this.handlers,(function(e){if(e.route.test(t))return e.callback(t),!0})))},navigate:function(t,e){if(!D.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||'');var n=this.root;''!==t&&'?'!==t.charAt(0)||(n=n.slice(0,-1)||'/');var r=n+t;if(t=this.decodeFragment(t.replace(N,'')),this.fragment!==t){if(this.fragment=t,this._usePushState)this.history[e.replace?'replaceState':'pushState']({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;e.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var r=t.href.replace(/(javascript:|#).*$/,'');t.replace(r+'#'+e)}else t.hash='#'+e}}),e.history=new D;y.extend=b.extend=T.extend=C.extend=D.extend=function(t,e){var r,i=this;return r=t&&n.has(t,'constructor')?t.constructor:function(){return i.apply(this,arguments)},n.extend(r,i,e),r.prototype=n.create(i.prototype,t),r.prototype.constructor=r,r.__super__=i.prototype,r};var R=function(){throw new Error('A "url" property or function must be specified')},I=function(t,e){var n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger('error',t,r,e)}};return e}))}).call(this,n(34))},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports["default"]=t.exports,t.exports.__esModule=!0,n(e)}t.exports=n,t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e){function n(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=this.target,r=this.get('name');if(!Object(O["isUndefined"])(t)){var i=t;if('false'===t?i=!1:'true'===t&&(i=!0),this.get('changeProp'))n.set(r,i,e);else{var o=_({},n.get('attributes'));o[r]=i,n.set('attributes',o,e)}}},setValueFromInput:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={value:t};this.set(r,_(_({},n),{},{avoidStore:1})),e&&(this.set('value','',n),this.set(r,n))},getInitValue:function(){var t,e=this.target,n=this.get('name');if(e){var r=e.get('attributes');t=this.get('changeProp')?e.get(n):r[n]}return t||this.get('value')||this.get('default')}}),A=S.a.Collection.extend({model:D,initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em=e.em||'',this.listenTo(this,'add',this.handleAdd),this.listenTo(this,'reset',this.handleReset)},handleReset:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.previousModels,r=void 0===n?[]:n;r.forEach((function(t){return t.trigger('remove')}))},handleAdd:function(t){var e=this.target;e&&(t.target=e)},setTarget:function(t){this.target=t},add:function(t,e){var n=this.em;if(Object(O["isString"])(t)||Object(O["isArray"])(t)){var r=n&&n.get&&n.get('TraitManager'),i=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{build:function(e){var n=[];'string'==typeof e&&(e=[e]);for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(O["bindAll"])(this,'__upSymbProps','__upSymbCls','__upSymbComps');var i=r.em,o=this.parent(),a=o&&o.attributes;if(a&&a.propagate){var s={},c=a.propagate;c.forEach((function(t){return s[t]=o.get(t)})),s.propagate=c,s=N(N({},s),e),this.set(s)}var l=this.get('propagate');if(l&&this.set('propagate',Object(O["isArray"])(l)?l:[l]),r&&r.config&&r.config.voidElements.indexOf(this.get('tagName'))>=0&&this.set('void',!0),r.em=i,this.opt=r,this.em=i,this.frame=r.frame,this.config=r.config||{},this.set('attributes',N(N({},Object(O["result"])(this,'defaults').attributes||{}),this.get('attributes')||{})),this.ccid=n.createId(this,r),this.initClasses(),this.initTraits(),this.initComponents(),this.initToolbar(),this.initScriptProps(),this.listenTo(this,'change:script',this.scriptUpdated),this.listenTo(this,'change:tagName',this.tagUpdated),this.listenTo(this,'change:attributes',this.attrUpdated),this.listenTo(this,'change:attributes:id',this._idUpdated),this.on('change:toolbar',this.__emitUpdateTlb),this.on('change',this.__onChange),this.on($,this.__propToParent),this.set('status',''),this.views=[],['classes','traits','components'].forEach((function(e){var n="add remove ".concat('components'!==e?'change':'');t.listenTo(t.get(e),n.trim(),(function(){for(var n=arguments.length,r=new Array(n),i=0;i0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=e&&e.get('UndoManager'),r=this.components();n&&!this.__hasUm&&(n.add(r),n.add(this.getSelectors()),this.__hasUm=1),t.recursive&&r.map((function(e){return e.__postAdd(t)}))}},{key:"__postRemove",value:function(){var t=this.em,e=t&&t.get('UndoManager');e&&(e.remove(this.components()),e.remove(this.getSelectors()),delete this.__hasUm)}},{key:"__onChange",value:function(t,e){var n=this.changedAttributes();['status','open','toolbar','traits'].forEach((function(t){return delete n[t]})),Object(x["isEmptyObj"])(n)||(this.__changesUp(e),this.__propSelfToParent({component:this,changed:n,options:e}))}},{key:"__changesUp",value:function(t){var e=this.em;[this.frame,e].forEach((function(e){return e&&e.changesUp(t)}))}},{key:"__propSelfToParent",value:function(t){this.trigger(U,t),this.__propToParent(t)}},{key:"__propToParent",value:function(t){var e=this.parent();e&&e.trigger($,t)}},{key:"__emitUpdateTlb",value:function(){this.emitUpdate('toolbar')}},{key:"is",value:function(t){return!(this.get('type')!=t)}},{key:"props",value:function(){return this.attributes}},{key:"index",value:function(){var t=this.collection;return t?t.indexOf(this):0}},{key:"setDragMode",value:function(t){return this.set('dmode',t)}},{key:"find",value:function(t){var e=[],n=this.view.$el.find(t);return n.each((function(t){var r=n.eq(t).data('model');r&&e.push(r)})),e}},{key:"findType",value:function(t){var e=[];return function n(r){return r.forEach((function(r){r.is(t)&&e.push(r),n(r.components())}))}(this.components()),e}},{key:"closest",value:function(t){var e=this.view.$el.closest(t);return e.length&&e.data('model')}},{key:"closestType",value:function(t){for(var e=this.parent();e&&!e.is(t);)e=e.parent();return e}},{key:"contains",value:function(t){var e=!1;if(!t)return e;var n=function n(r){!e&&r.forEach((function(r){r===t&&(e=!0),!e&&n(r.components())}))};return n(this.components()),e}},{key:"tagUpdated",value:function(){this.trigger('rerender')}},{key:"replaceWith",value:function(t){var e=this.collection,n=e.indexOf(this);return e.remove(this),e.add(t,{at:n})}},{key:"attrUpdated",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.get('attributes'),o=i.class;o&&this.setClass(o),delete i.class;var a=i.style;a&&this.setStyle(a),delete i.style;var s=N({},this.previous('attributes')),c=Object(x["shallowDiff"])(s,this.get('attributes'));Object(O["keys"])(c).forEach((function(t){return n.trigger("change:attributes:".concat(t),n,c[t],r)}))}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.set('attributes',N({},t),e),this}},{key:"addAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.setAttributes(N(N({},this.getAttributes({noClass:1})),t),e)}},{key:"removeAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Array.isArray(t)?t:[t],r=this.getAttributes();return n.map((function(t){return delete r[t]})),this.setAttributes(r,e)}},{key:"getStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=Object(O["isString"])(t)?t:'',i=r?e:t;if(n&&n.getConfig('avoidInlineStyle')&&!i.inline){var o=n.get('state'),a=n.get('CssComposer'),s=a.getIdRule(this.getId(),N({state:o},i));if(this.rule=s,s)return s.getStyle(r)}return C["a"].getStyle.call(this,r)}},{key:"setStyle",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=this.opt;if(r&&r.getConfig('avoidInlineStyle')&&!i.temporary&&!n.inline){var o=this.get('style')||{};e=N(N({},e=Object(O["isString"])(e)?this.parseStyle(e):e),o);var a=r.get('state'),s=r.get('CssComposer'),c=this.getStyle(n);this.rule=s.setIdRule(this.getId(),e,N(N({},n),{},{state:a}));var l=Object(x["shallowDiff"])(c,e);this.set('style','',{silent:1}),Object(O["keys"])(l).forEach((function(e){return t.trigger("change:style:".concat(e))}))}else e=C["a"].setStyle.apply(this,arguments);return e}},{key:"getAttributes",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.em,r=[],i=N({},this.get('attributes')),o=n&&n.get('SelectorManager'),a=this.getId();if(e.noClass||(this.get('classes').forEach((function(t){return r.push(Object(O["isString"])(t)?t:t.get('name'))})),r.length&&(i.class=r.join(' '))),!e.noStyle){var s=this.get('style');Object(x["isObject"])(s)&&!Object(x["isEmptyObj"])(s)&&(i.style=this.styleToString({inline:1}))}Object(O["has"])(i,'id')||(F(n)?t=o&&o.get(a,o.Selector.TYPE_ID):Object(O["isEmpty"])(this.getStyle())||(t=1),(this.__getSymbol()||this.__getSymbols())&&(t=1),t&&(i.id=a));return i}},{key:"addClass",value:function(t){var e=this.em.get('SelectorManager').addClass(t);return this.get('classes').add(e)}},{key:"setClass",value:function(t){return this.get('classes').reset(),this.addClass(t)}},{key:"removeClass",value:function(t){var e=[];t=Object(O["isArray"])(t)?t:[t];var n=this.get('classes'),r=T["a"].TYPE_CLASS;return t.forEach((function(t){t.split(' ').forEach((function(t){var i=n.where({name:t,type:r})[0];i&&e.push(n.remove(i))}))})),e}},{key:"getClasses",value:function(){var t=this.getAttributes().class;return t?t.split(' '):[]}},{key:"__logSymbol",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.__getSymbol(),i=this.__getSymbols();(r||i)&&this.em.log(t,{model:this,toUp:e,context:'symbols',opts:n})}},{key:"__initSymb",value:function(){this.__symbReady||(this.on('change',this.__upSymbProps),this.__symbReady=1)}},{key:"__isSymbol",value:function(){return Object(O["isArray"])(this.get(z))}},{key:"__isSymbolOrInst",value:function(){return!(!this.__isSymbol()&&!this.get(H))}},{key:"__isSymbolTop",value:function(){var t=this.parent();return this.__isSymbolOrInst()&&(!t||t&&!t.__isSymbol()&&!t.__getSymbol())}},{key:"__isSymbolNested",value:function(){if(!this.__isSymbolOrInst()||this.__isSymbolTop())return!1;var t=(this.__isSymbol()?this:this.__getSymbol()).__getSymbTop(),e=this.__getSymbTop();return(e.__isSymbol()?e:e.__getSymbol())!==t}},{key:"__getAllById",value:function(){var t=this.em;return t?t.get('DomComponents').allById():{}}},{key:"__getSymbol",value:function(){var t=this.get(H);if(t&&Object(O["isString"])(t)){var e=this.__getAllById()[t];e?(t=e,this.set(H,e)):t=0}return t}},{key:"__getSymbols",value:function(){var t=this,e=this.get(z);return e&&Object(O["isArray"])(e)&&(e.forEach((function(n,r){n&&Object(O["isString"])(n)&&(e[r]=t.__getAllById()[n])})),e=e.filter((function(t){return t&&!Object(O["isString"])(t)}))),e}},{key:"__isSymbOvrd",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=this.get(B),n=t.split(':'),r=c()(n,1),i=r[0],o=t!==i?[t,i]:[t];return!0===e||Object(O["isArray"])(e)&&o.some((function(t){return e.indexOf(t)>=0}))}},{key:"__getSymbToUp",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[],r=this.em,i=e.changed,o=r&&r.get('symbols');if(e.fromInstance||e.noPropagate||e.fromUndo||!o||i&&this.__isSymbOvrd(i))return n;var s=this.__getSymbols()||[],c=this.__getSymbol(),l=c?[c].concat(a()(c.__getSymbols()||[])):s;return n=l.filter((function(e){return e!==t})).filter((function(t){return!(i&&t.__isSymbOvrd(i))}))}},{key:"__getSymbTop",value:function(t){for(var e=this,n=this.parent(t);n&&(n.__isSymbol()||n.__getSymbol());)e=n,n=n.parent(t);return e}},{key:"__upSymbProps",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.changedAttributes(),i=r.attributes||{};if(delete r.status,delete r.open,delete r[z],delete r[H],delete r[B],delete r.attributes,delete i.id,Object(x["isEmptyObj"])(i)||(r.attributes=i),!Object(x["isEmptyObj"])(r)){var o=this.__getSymbToUp(n);Object(O["keys"])(r).map((function(t){e.__isSymbOvrd(t)&&delete r[t]})),this.__logSymbol('props',o,{opts:n,changed:r}),o.forEach((function(t){var i=N({},r);Object(O["keys"])(i).map((function(e){t.__isSymbOvrd(e)&&delete i[e]})),t.set(i,N({fromInstance:e},n))}))}}},{key:"__upSymbCls",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.__getSymbToUp(r);this.__logSymbol('classes',i,{opts:r}),i.forEach((function(t){t.set('classes',n.get('classes'),{fromInstance:n})})),this.__changesUp(r)}},{key:"__upSymbComps",value:function(t,e,n){var r=this,i=n||e||{},o={fromInstance:i.fromInstance,fromUndo:i.fromUndo},s=t.opt.temporary;if(n)if(n.add){var c=[],l=!!this.__getSymbols(),u=this.__getSymbToUp(N(N({},o),{},{changed:'components:add'}));if(u.length){var d=t.__getSymbol();c=(d?d.__getSymbols():t.__getSymbols())||[],(c=a()(c)).push(d||t)}!s&&this.__logSymbol('add',u,{opts:n,addedInstances:c.map((function(t){return t.cid})),added:t.cid}),u.forEach((function(e){var i=e.__getSymbTop(),o=c.filter((function(t){var e=t.__getSymbTop({prev:1});return i&&e&&e===i}))[0]||t.clone({symbol:1,symbolInv:l});e.append(o,N({fromInstance:r},n))}))}else{var h=t.__getSymbol();if(h&&!n.temporary&&h.set(z,h.__getSymbols().filter((function(e){return e!==t}))),!t.__isSymbolTop()){var f='components:remove',p=n.index,g=t.parent(),v=N({fromInstance:t},n),m=t.__isSymbolNested(),y=function(t){var e=t.parent();e&&!e.__isSymbOvrd(f)&&t.remove(v)},b=g.__isSymbOvrd(f)?[]:t.__getSymbToUp(o);m&&(b=g.__getSymbToUp(N(N({},o),{},{changed:f})),y=function(t){var e=t.components().at(p);e&&e.remove(N({fromInstance:g},v))}),!s&&this.__logSymbol('remove',b,{opts:n,removed:t.cid,isSymbNested:m}),b.forEach(y)}}else{var w=this.__getSymbToUp(N(N({},o),{},{changed:'components:reset'}));this.__logSymbol('reset',w,{components:t.models}),w.forEach((function(n){var i=t.models.map((function(t){return t.clone({symbol:1})}));n.components().reset(i,N({fromInstance:r},e))}))}this.__changesUp(i)}},{key:"initClasses",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r='change:classes',i=this.get('attributes').class||[],o=[this,r,this.initClasses],a=this.get('classes')||i,s=Object(O["isString"])(a)?a.split(' '):a;this.stopListening.apply(this,o);var c=this.normalizeClasses(s),l=new P["a"]([]);return this.set('classes',l,n),l.add(c),l.on('add remove reset',this.__upSymbCls),this.listenTo.apply(this,o),this}},{key:"initComponents",value:function(){var t=[this,'change:components',this.initComponents];this.stopListening.apply(this,t);var e=new j["a"](null,this.opt);e.parent=this;var n=this.get('components'),r=!this.opt.avoidChildren;return this.set('components',e),r&&n&&e.add(Object(O["isFunction"])(n)?n(this):n,this.opt),e.on('add remove reset',this.__upSymbComps),this.listenTo.apply(this,t),this}},{key:"initTraits",value:function(t){var e=this.em,n=[this,'change:traits',this.initTraits];this.stopListening.apply(this,n),this.loadTraits();var r=N({},this.get('attributes')),i=this.get('traits');return i.each((function(t){if(!t.get('changeProp')){var e=t.get('name'),n=t.getInitValue();e&&n&&(r[e]=n)}})),i.length&&this.set('attributes',r),this.listenTo.apply(this,n),t&&e&&e.trigger('component:toggled'),this}},{key:"initScriptProps",value:function(){if(!this.opt.temporary){var t='script-props',e=["change:".concat(t),this.initScriptProps];this.off.apply(this,e);var n=this.previous(t)||[],r=this.get(t)||[],i=n.map((function(t){return"change:".concat(t)})).join(' '),o=r.map((function(t){return"change:".concat(t)})).join(' ');i&&this.off(i,this.__scriptPropsChange),o&&this.on(o,this.__scriptPropsChange),this.on.apply(this,e)}}},{key:"__scriptPropsChange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.avoidStore||this.trigger('rerender')}},{key:"append",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object(O["isArray"])(t)?t:[t],r=n.map((function(t){return Object(O["isString"])(t)||t.collection&&t.collection.remove(t,{temporary:1}),t})),i=this.components().add(r,e);return Object(O["isArray"])(i)?i:[i]}},{key:"components",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get('components');return Object(O["isUndefined"])(t)?n:(n.reset(null,e),t?this.append(t,e):[])}},{key:"getChildAt",value:function(t){return this.components().at(t||0)||null}},{key:"getLastChild",value:function(){var t=this.components();return t.at(t.length-1)||null}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.components().reset(null,t),this}},{key:"parent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.collection||t.prev&&this.prevColl;return e?e.parent:null}},{key:"scriptUpdated",value:function(){this.set('scriptUpdated',1)}},{key:"initToolbar",value:function(){var t=this.em,e=t&&t.getConfig('stylePrefix')||'';if(!this.get('toolbar')){var n=[];this.collection&&n.push({attributes:{class:'fa fa-arrow-up'},command:function(t){return t.runCommand('core:component-exit',{force:1})}}),this.get('draggable')&&n.push({attributes:{class:"fa fa-arrows ".concat(e,"no-touch-actions"),draggable:!0},command:'tlb-move'}),this.get('copyable')&&n.push({attributes:{class:'fa fa-clone'},command:'tlb-clone'}),this.get('removable')&&n.push({attributes:{class:'fa fa-trash-o'},command:'tlb-delete'}),this.set('toolbar',n)}}},{key:"loadTraits",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t=t||this.get('traits'),!((t=Object(O["isFunction"])(t)?t(this):t)instanceof A)){var n=new A([],this.opt);n.setTarget(this),t.length&&(t.forEach((function(t){return t.attributes&&delete t.attributes.value})),n.add(t)),this.set('traits',n,e)}return this}},{key:"getTrait",value:function(t){return this.get('traits').filter((function(e){return e.get('id')===t||e.get('name')===t}))[0]}},{key:"updateTrait",value:function(t,e){var n=this.em,r=this.getTrait(t);return r&&r.set(e),n&&n.trigger('component:toggled'),this}},{key:"getTraitIndex",value:function(t){var e=this.getTrait(t);return e?this.get('traits').indexOf(e):-1}},{key:"removeTrait",value:function(t){var e=this,n=this.em,r=(Object(O["isArray"])(t)?t:[t]).map((function(t){return e.getTrait(t)})),i=this.get('traits').remove(r);return n&&n.trigger('component:toggled'),i}},{key:"addTrait",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=this.get('traits').add(t,e);return n&&n.trigger('component:toggled'),r}},{key:"normalizeClasses",value:function(t){var e=[],n=this.em,r=n&&n.get('SelectorManager');if(r)return t.models?a()(t.models):(t.forEach((function(t){return e.push(r.add(t))})),e)}},{key:"clone",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=N({},this.attributes),r=N({},this.opt),i=this.getId(),o=e&&e.get('CssComposer');n.attributes=N({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],this.__isSymbolTop()&&(t.symbol=1),this.get('components').each((function(e,r){n.components[r]=e.clone(N(N({},t),{},{_inner:1}))})),this.get('traits').each((function(t,e){n.traits[e]=t.clone()})),this.get('classes').each((function(t,e){n.classes[e]=t.get('name')})),n.status='',r.collection=null;var s=new this.constructor(n,r),c="#".concat(s.getId()),l=o?o.getRules("#".concat(i)):[];l.forEach((function(t){var e=t.clone();e.set('selectors',[c]),o.getAll().add(e)})),s.set(z,0);var u=this.__getSymbol(),d=this.__getSymbols();t.symbol||!u&&!d?u?(u.set(z,[].concat(a()(u.__getSymbols()),[s])),s.__initSymb()):t.symbol&&(this.__isSymbol()?(this.set(z,[].concat(a()(d),[s])),s.set(H,this),s.__initSymb()):t.symbolInv?(this.set(z,[s]),s.set(H,this),[this,s].map((function(t){return t.__initSymb()}))):(s.set(z,[this]),[this,s].map((function(t){return t.__initSymb()})),this.set(H,s))):(s.set(H,0),s.set(z,0));var h='component:clone';return e&&e.trigger(h,s),this.trigger(h,s),s}},{key:"getName",value:function(){var t=this.em,e=this.attributes,n=e.type,r=e.tagName,i=this.get('name'),o='div'==r,a=n||(o?'box':r),s=!n&&r&&!o&&r,c='domComponents.names.',l=i&&t&&t.t("".concat(c).concat(i)),u=s&&t&&t.t("".concat(c).concat(s)),d=t&&(t.t("".concat(c).concat(n))||t.t("".concat(c).concat(r)));return this.get('custom-name')||l||i||u||Object(x["capitalize"])(s)||d||Object(x["capitalize"])(a)}},{key:"getIcon",value:function(){var t=this.get('icon');return t?t+' ':''}},{key:"toHTML",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this,n=[],r=t.tag,i=r||e.get('tagName'),o=e.get('void'),a=t.attributes,s=this.getAttrToHTML();for(var c in delete t.tag,a&&(Object(O["isFunction"])(a)?s=a(e,s)||{}:Object(x["isObject"])(a)&&(s=a)),s){var l=s[c],u=Object(O["isString"])(l)?l.replace(/"/g,'"'):l;Object(O["isUndefined"])(u)||(Object(O["isBoolean"])(u)?u&&n.push(c):n.push("".concat(c,"=\"").concat(u,"\"")))}var d=n.length?" ".concat(n.join(' ')):'',h=e.__innerHTML(t),f="<".concat(i).concat(d).concat(o?'/':'',">").concat(h);return!o&&(f+="")),f}},{key:"__innerHTML",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.components();return e.length?e.map((function(e){return e.toHTML(t)})).join(''):this.get('content')}},{key:"getAttrToHTML",value:function(){var t=this.getAttributes();return delete t.style,t}},{key:"toJSON",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=k["Model"].prototype.toJSON.call(this,t);if(e.attributes=this.getAttributes(),delete e.attributes.class,delete e.toolbar,delete e.traits,delete e.status,delete e.open,!t.fromUndo){var n=e[H],r=e[z];r&&Object(O["isArray"])(r)&&(e[z]=r.filter((function(t){return t})).map((function(t){return t.getId?t.getId():t}))),n&&!Object(O["isString"])(n)&&(e[H]=n.getId())}return this.em.getConfig('avoidDefaults')&&this.getChangedProps(e),e}},{key:"getChangedProps",value:function(t){var e=t||k["Model"].prototype.toJSON.apply(this),n=Object(O["result"])(this,'defaults');return Object(O["forEach"])(n,(function(t,n){-1===['type'].indexOf(n)&&e[n]===t&&delete e[n]})),Object(O["isEmpty"])(e.type)&&delete e.type,Object(O["forEach"])(['attributes','style'],(function(t){Object(O["isEmpty"])(n[t])&&Object(O["isEmpty"])(e[t])&&delete e[t]})),Object(O["forEach"])(['classes','components'],(function(t){(!e[t]||Object(O["isEmpty"])(n[t])&&!e[t].length)&&delete e[t]})),e}},{key:"getId",value:function(){return(this.get('attributes')||{}).id||this.ccid||this.cid}},{key:"setId",value:function(t,e){var n=N({},this.get('attributes'));return n.id=t,this.set('attributes',n,e),this}},{key:"getEl",value:function(t){var e=this.getView(t);return e&&e.el}},{key:"getView",value:function(t){var e=this.view,n=this.views;return t&&(e=n.filter((function(e){return e._getFrame()===t.view}))[0]),e}},{key:"getCurrentView",value:function(){var t=(this.em.get('currentFrame')||{}).model;return this.getView(t)}},{key:"__getScriptProps",value:function(){var t=this.props();return(this.get('script-props')||[]).reduce((function(e,n){return e[n]=t[n],e}),{})}},{key:"getScriptString",value:function(t){var e=this,n=t||this.get('script');if(!n)return n;if(this.get('script-props'))n=n.toString().trim();else{if('function'==typeof n){var r=n.toString().trim();n=(r=r.replace(/^function[\s\w]*\(\)\s?\{/,'').replace(/\}$/,'')).trim()}var o=this.em.getConfig(),a=I(o.tagVarStart||'{[ '),s=I(o.tagVarEnd||' ]}'),c=new RegExp("".concat(a,"([\\w\\d-]*)").concat(s),'g');n=n.replace(c,(function(t,n){e.scriptUpdated();var r=e.attributes[n]||'';return Object(O["isArray"])(r)||'object'==i()(r)?JSON.stringify(r):r}))}return n}},{key:"emitUpdate",value:function(t){for(var e=this.em,n=U+(t?":".concat(t):''),r=t&&this.get(t),i=arguments.length,o=new Array(i>1?i-1:0),a=1;a=0&&this.__propSelfToParent({component:this,changed:u()({},t,r),options:o[2]||o[1]||{}})}},{key:"onAll",value:function(t){return Object(O["isFunction"])(t)&&(t(this),this.components().forEach((function(e){return e.onAll(t)}))),this}},{key:"remove",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.em,r=this.collection,i=function(){r&&r.remove(t,e),e.root&&t.components('')},o=N({},e);return[this,n].map((function(e){return e.trigger('component:remove:before',t,i,o)})),!o.abort&&i(),this}},{key:"move",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.remove({temporary:1}),t&&t.append(this,e),this}},{key:"resetId",value:function(){var t=this.em,e=this.getId();if(e){var r=n.createId(this);this.setId(r);var i=t&&t.get('CssComposer').getIdRule(e),o=i&&i.get('selectors').at(0);return o&&o.set('name',r),this}}},{key:"_getStyleRule",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.id,n=this.em,r=e||this.getId();return n&&n.get('CssComposer').getIdRule(r)}},{key:"_getStyleSelector",value:function(t){var e=this._getStyleRule(t);return e&&e.get('selectors').at(0)}},{key:"_idUpdated",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!r.idUpdate){var i=this.ccid,o=this.get('attributes')||{},a=o.id,s=(this.previous('attributes')||{}).id||i,c=n.getList(this);if(c[a]||!a&&s)return this.setId(s,{idUpdate:1});delete c[s],c[a]=this,this.ccid=a;var l=this._getStyleSelector({id:s});l&&l.set({name:a,label:a})}}}]),n}(k["Model"].extend(C["a"]));W.isComponent=function(t){return{tagName:Object(x["toLowerCase"])(t.tagName)}},W.ensureInList=function(t){var e=W.getList(t),n=t.getId(),r=e[n];if(r){if(r!==t){var i=W.getIncrementId(n,e);t.setId(i),e[i]=t}}else e[n]=t;t.components().forEach((function(t){return W.ensureInList(t)}))},W.createId=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=W.getList(t),i=n.idMap,o=void 0===i?{}:i,a=t.get('attributes'),s=a.id;return s?(e=W.getIncrementId(s,r,n),t.setId(e),s!==e&&(o[s]=e)):e=W.getNewId(r),r[e]=t,e},W.getNewId=function(t){for(var e=Object.keys(t).length.toString().length+2,n=(Math.random()+1.1).toString(36).slice(-e),r="i".concat(n);t[r];)r=W.getNewId(t);return r},W.getIncrementId=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.keepIds,i=void 0===r?[]:r,o=1,a=t;if(i.indexOf(t)<0)for(;e[a];)o++,a="".concat(t,"-").concat(o);return a},W.getList=function(t){var e=t.opt,n=void 0===e?{}:e,r=n.domc,i=n.em,o=r||i&&i.get('DomComponents');return o?o.componentsById:{}},W.checkId=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=Object(O["isArray"])(t)?t:[t],o=r.keepIds,a=void 0===o?[]:o;i.forEach((function(t){var i=t.attributes,o=void 0===i?{}:i,s=t.components,c=o.id;if(c&&n[c]&&a.indexOf(c)<0){var l=W.getIncrementId(c,n);o.id=l,Object(O["isArray"])(e)&&e.forEach((function(t){var e=t.selectors;e.forEach((function(t,n){t==="#".concat(c)&&(e[n]="#".concat(l))}))}))}s&&W.checkId(s,e,n,r)}))},W.getDefaults=function(){return Object(O["result"])(this.prototype,'defaults')},W.prototype.defaults=(M={tagName:'div',type:'',name:'',removable:!0,draggable:!0,droppable:!0,badgable:!0,stylable:!0,'stylable-require':'','style-signature':'',unstylable:'',highlightable:!0,copyable:!0,resizable:!1,editable:!1,layerable:!0,selectable:!0,hoverable:!0,void:!1,state:'',status:'',content:'',icon:'',style:'',styles:'',classes:'',script:'','script-props':'','script-export':'',attributes:'',traits:['id','title'],propagate:'',dmode:'',toolbar:null},u()(M,H,0),u()(M,z,0),u()(M,B,0),u()(M,"_undo",!0),u()(M,"_undoexc",['status','open']),M)},function(t,e,n){var r=n(79),i=n(80),o=n(50),a=n(81);t.exports=function(t){return r(t)||i(t)||o(t)||a()},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r),o=n(2),a=n.n(o),s=n(0),c=n(29),l=n(41),u=n(19),d=n(13),h=n(1);function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=t.config||{},r=n.em,i=e.opt||{},o=this.$el,a=this.el;n.draggableComponents;this.opts=t,this.modelOpt=i,this.config=n,this.em=r||'',this.pfx=n.stylePrefix||'',this.ppfx=n.pStylePrefix||'',this.attr=e.get('attributes'),this.classe=this.attr.class||[],this.listenTo(e,'change:style',this.updateStyle),this.listenTo(e,'change:attributes change:_innertext',this.renderAttributes),this.listenTo(e,'change:highlightable',this.updateHighlight),this.listenTo(e,'change:status',this.updateStatus),this.listenTo(e,'change:script rerender',this.reset),this.listenTo(e,'change:content',this.updateContent),this.listenTo(e,'change',this.handleChange),this.listenTo(e,'active',this.onActive),this.listenTo(e,'disable',this.onDisable),o.data('model',e),Object(h["setViewEl"])(a,this),e.view=this,this._getFrame()&&e.views.push(this),this.initClasses(),this.initComponents({avoidRender:1}),this.events=p(p({},this.events),this.__isDraggable()&&{dragstart:'handleDragStart'}),this.delegateEvents(),!i.temporary&&this.init(this._clbObj())},__isDraggable:function(){var t=this.model,e=this.config,n=t.attributes,r=n._innertext,i=n.draggable;return e.draggableComponents&&i&&!r},_clbObj:function(){var t=this.em,e=this.model,n=this.el;return{editor:t&&t.getEditor(),model:e,el:n}},init:function(){},removed:function(){},onActive:function(){},onDisable:function(){},remove:function(){var t=this;a.a.View.prototype.remove.apply(t,arguments);var e=t.model,n=t._getFrame()||{},r=n.model;e.components().forEach((function(t){var e=t.getView(r);e&&e.remove()}));var i=t.childrenView;i&&i.remove();var o=e.views;return o.splice(o.indexOf(t),1),t.removed(t._clbObj()),t.$el.data({model:'',collection:'',view:''}),t},handleDragStart:function(t){t.preventDefault(),t.stopPropagation(),this.em.get('Commands').run('tlb-move',{target:this.model,event:t})},initClasses:function(){var t=this.model,e='change:classes',n=t.get('classes');n instanceof u["a"]&&(this.stopListening(t,e,this.initClasses),this.listenTo(t,e,this.initClasses),this.listenTo(n,'add remove change',this.updateClasses),n.length&&this.importClasses())},initComponents:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=this.$el,r=this.childrenView,i='change:components',o=e.get('components'),a=[e,i,this.initComponents];o instanceof c["a"]&&(n.data('collection',o),r&&r.remove(),this.stopListening.apply(this,a),!t.avoidRender&&this.renderChildren(),this.listenTo.apply(this,a))},handleChange:function(){var t=this.model,e=Object(s["keys"])(t.changed);if(1!==e.length||'status'!==e[0])for(var n in t.emitUpdate(),t.changed)t.emitUpdate(n)},importClasses:function(){var t=this.config.em.get('SelectorManager');t&&this.model.get('classes').each((function(e){t.add(e.get('name'))}))},updateStatus:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=e?e.get('Canvas').getConfig():{},r=n.extHl,i=this.el,o=this.model.get('status'),a=this.ppfx,s="".concat(a,"selected"),c="".concat(s,"-parent"),l="".concat(a,"freezed"),u="".concat(a,"hovered"),d=[s,c,l,u],h=r&&!t.noExtHl?'':s;this.$el.removeClass(d.join(' '));var f=i.getAttribute('class')||'',p='';switch(o){case'selected':p="".concat(f," ").concat(h);break;case'selected-parent':p="".concat(f," ").concat(c);break;case'freezed':p="".concat(f," ").concat(l);break;case'freezed-selected':p="".concat(f," ").concat(l," ").concat(h);break;case'hovered':p=t.avoidHover?'':"".concat(f," ").concat(u)}(p=p.trim())&&i.setAttribute('class',p)},updateHighlight:function(){var t=this.model.get('highlightable');this.setAttribute('data-highlightable',t?1:'')},updateStyle:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.model,i=this.em,o=this.el;if(i&&i.getConfig('avoidInlineStyle')&&!n.inline){var a=r.getStyle(),c=Object(s["isEmpty"])(a);!c&&r.setStyle(a),r.get('_innertext')&&c?o.removeAttribute('id'):o.id=r.getId()}else this.setAttribute('style',r.styleToString(n))},updateClasses:function(){var t=this.model.get('classes').pluck('name').join(' ');this.setAttribute('class',t),this.updateStatus(),this.onAttrUpdate()},setAttribute:function(t,e){var n=this.$el;e?n.attr(t,e):n.removeAttr(t)},getClasses:function(){return this.model.getClasses().join(' ')},updateAttributes:function(){var t=[],e=this.model,n=this.$el,r=this.el,i=e.attributes,o=i.highlightable,a=i.textable,c=p(p(p({'data-gjs-type':i.type||'default'},this.__isDraggable()?{draggable:!0}:{}),o?{'data-highlightable':1}:{}),a?{contenteditable:'false','data-gjs-textable':'true'}:{});Object(s["each"])(r.attributes,(function(e){return t.push(e.nodeName)})),t.forEach((function(t){return n.removeAttr(t)})),this.updateStyle();var l=p(p({},c),e.getAttributes());Object(s["keys"])(l).forEach((function(t){return!1===l[t]&&delete l[t]})),n.attr(l)},updateContent:function(){var t=this.model.get('content'),e=this.model.components().length;this.getChildrenContainer().innerHTML=e?'':t},prevDef:function(t){t.preventDefault()},updateScript:function(){var t=this.model,e=this.em;t.get('script')&&e&&e.get('Canvas').getCanvasView().updateScript(this)},getChildrenContainer:function(){var t=this.el;return'function'==typeof this.getChildrenSelector?t=this.el.querySelector(this.getChildrenSelector()):this.getTemplate,t},getOffsetRect:function(){var t={},e=this.el,n=0,r=0;return function i(o){var a=o.offsetParent;a?(n+=a.offsetTop,r+=a.offsetLeft,i(a)):(t.top=e.offsetTop+n,t.left=e.offsetLeft+r,t.bottom=t.top+e.offsetHeight,t.right=t.left+e.offsetWidth)}(e),t},isInViewport:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.rect,n=this.el,r=n.ownerDocument,i=r.body,o=r.defaultView.frameElement,a=e||this.getOffsetRect(),s=a.top,c=a.left,l=this._getFrame().getOffsetRect();return s>=l.scrollTop&&c>=l.scrollLeft&&s<=l.scrollBottom&&c<=o.offsetWidth+i.scrollLeft},scrollIntoView:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getOffsetRect(),n=this.isInViewport({rect:e});if(!n||t.force){var r=this.el;'smooth'!==t.behavior?r.ownerDocument.defaultView.scrollTo(0,e.top):r.scrollIntoView(p({behavior:'smooth',block:'nearest'},t))}},reset:function(){var t=this.el;this.el='',this._ensureElement(),this._setData(),Object(d["m"])(t,this.el),this.render()},_setData:function(){var t=this.model,e=t.components();this.$el.data({model:t,collection:e,view:this})},_getFrame:function(){return this.config.frameView},renderChildren:function(){this.updateContent();var t=this.getChildrenContainer(),e=this.childrenView||new l["a"]({collection:this.model.get('components'),config:this.config,componentTypes:this.opts.componentTypes});e.render(t),this.childrenView=e;for(var n=Array.prototype.slice.call(e.el.childNodes),r=0,i=n.length;r1&&void 0!==arguments[1]?arguments[1]:{};return t&&t.setAttribute&&Object(r["each"])(e,(function(e,n){return t.setAttribute(n,e)}))},d=function(t){return t&&!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},h=function(t,e){t.parentNode.replaceChild(e,t)},f=function(t,e,n){var i=t.childNodes,o=i.length,a=Object(r["isUndefined"])(n)?o:n;Object(r["isString"])(e)&&(t.insertAdjacentHTML('beforeEnd',e),e=t.lastChild,t.removeChild(e)),a>=o?t.appendChild(e):t.insertBefore(e,i[a])},p=function(t,e){return f(t,e)},g=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'',n=arguments.length>2?arguments[2]:void 0,i=document.createElement(t);return e&&Object(r["each"])(e,(function(t,e){return i.setAttribute(e,t)})),n&&(Object(r["isString"])(n)?i.innerHTML=n:i.appendChild(n)),i},v=function(t){return document.createTextNode(t)},m=function(t,e){var n,r=t.type;try{n=new window[e](r,t)}catch(t){(n=document.createEvent(e)).initEvent(r,!0,!0)}return n._parentEvent=t,0===r.indexOf('key')&&(n.keyCodeVal=t.keyCode,['keyCode','which'].forEach((function(t){Object.defineProperty(n,t,{get:function(){return this.keyCodeVal}})}))),n},y=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Array.isArray(e)?e:[e];n.forEach((function(e){var n=e[i]||'div',a=e[o]||{},s=document.createElement(n);Object(r["each"])(a,(function(t,e){s.setAttribute(e,t)})),t.appendChild(s)}))}},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=n=function(t){return typeof t},t.exports["default"]=t.exports,t.exports.__esModule=!0):(t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports["default"]=t.exports,t.exports.__esModule=!0),n(e)}t.exports=n,t.exports["default"]=t.exports,t.exports.__esModule=!0},,function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var r=n(5),i=n.n(r),o=n(6),a=n.n(o),s=n(8),c=n.n(s),l=n(9),u=n.n(l),d=n(4),h=n.n(d),f=n(2),p=n(0);function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=h()(t);if(e){var i=h()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}var v=1,m=2,y=function(t){c()(n,t);var e=g(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"defaults",value:function(){return{name:'',label:'',type:v,active:!0,private:!1,protected:!1,_undo:!0}}},{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.config,i=void 0===r?{}:r,o=this.get('name'),a=this.get('label');o?a||this.set('label',o):this.set('name',a);var s=this.get('name'),c=i.escapeName,l=c?c(s):n.escapeName(s);this.set('name',l),this.em=i.em}},{key:"isId",value:function(){return this.get('type')===m}},{key:"isClass",value:function(){return this.get('type')===v}},{key:"getFullName",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.escape,n=this.get('name'),r='';switch(this.get('type')){case v:r='.';break;case m:r='#'}return r+(e?e(n):n)}},{key:"toString",value:function(){return this.getFullName()}},{key:"getLabel",value:function(){return this.get('label')}},{key:"setLabel",value:function(t){return this.set('label',t)}},{key:"getActive",value:function(){return this.get('active')}},{key:"setActive",value:function(t){return this.set('active',t)}},{key:"toJSON",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=f["Model"].prototype.toJSON.call(this,[t]),r=Object(p["result"])(this,'defaults');if(e&&e.getConfig('avoidDefaults')){Object(p["forEach"])(r,(function(t,e){n[e]===t&&delete n[e]})),n.label===n.name&&delete n.label;var i=Object(p["keys"])(n).length;1===i&&n.name&&(n=n.name),2===i&&n.name&&n.type&&(n=this.getFullName())}return n}}]),n}(f["Model"]);y.prototype.idAttribute='name',y.TYPE_CLASS=v,y.TYPE_ID=m,y.escapeName=function(t){return"".concat(t).trim().replace(/([^a-z0-9\w-\:]+)/gi,'-')}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(1);function i(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:{},e=t.noDisabled;return Object(f["filter"])(this.models,(function(t){return!t.get('private')})).filter((function(t){return e?t.get('active'):1}))}},{key:"getFullString",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=t||this;return r.forEach((function(t){return n.push(t.getFullName(e))})),n.join('').trim()}}]),n}(p["Collection"]);m.prototype.model=g["a"]},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(11),a=n.n(o),s=n(0),c=n(1);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return this.all?t.array?a()(this.all.models):this.all:[]},getAllMap:function(){return this.getAll().reduce((function(t,e){return t[e.get(e.idAttribute)]=e,t}),{})},__initConfig:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=u(u({},t),e),this.em=this.config.em},__initListen:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.all,n=this.em,r=this.events;e&&n&&e.on('add',(function(t,e,i){return n.trigger(r.add,t,i)})).on('remove',(function(t,e,i){return n.trigger(r.remove,t,i)})).on('change',(function(t,e){return n.trigger(r.update,t,t.changedAttributes(),e)})).on('all',this.__catchAllEvent,this),this.cls=[e].concat(t.collections||[]),(t.propagate||[]).forEach((function(t){var r=t.entity,i=t.event;r.on('all',(function(t,r,o,a){var s=u({event:t},a||o);[n,e].map((function(t){return t.trigger(i,r,s)}))}))}))},__remove:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=Object(s["isString"])(t)?this.get(t):t,o=function(){return i&&e.all.remove(i,n),i};return!n.silent&&r&&r.trigger(this.events.removeBefore,i,o,n),!n.abort&&o()},__catchAllEvent:function(t,e,n,r){var i=this.em,o=this.events,a=r||n;i&&o.all&&i.trigger(o.all,{event:t,model:e,options:a}),this.__onAllEvent()},__appendTo:function(){var t=this.getConfig().appendTo;if(t){var e=Object(s["isElement"])(t)?t:document.querySelector(t);if(!e)return this.__logWarn('"appendTo" element not found');e.appendChild(this.render())}},__onAllEvent:function(){},__logWarn:function(t){this.em.logWarning("[".concat(this.name,"]: ").concat(t))},_createId:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,n=this.getAll(),r=n.length+e,i=this.getAllMap();do{t=Object(c["createId"])(r)}while(i[t]);return t},__destroy:function(){this.cls.forEach((function(t){t.stopListening(),t.reset()})),this.em=0}}},function(t,e,n){var r=n(82);t.exports=function(t,e){if(null==t)return{};var n,i,o=r(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.r(e);var r=n(14),i=n.n(r),o=n(3),a=n.n(o),s=n(2),c=n.n(s),l=n(0),u=n(1),d=n(13),h=n(28);function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=t.config,n=void 0===e?{}:e;this.em=n.em,this.editor=n.editor},handleClick:function(t){t.preventDefault(),t.stopPropagation();var e=this.editor,n=this.em,r=e.Canvas.getFrameEl().getBoundingClientRect(),i=r.left,o=r.top,a=p(p({},t),{},{clientX:t.clientX-i,clientY:t.clientY-o});n.trigger('toolbar:run:before'),this.execCommand(a)},execCommand:function(t){var e={event:t},n=this.model.get('command'),r=this.editor;'function'==typeof n&&n(r,null,e),'string'==typeof n&&r.runCommand(n,e)},render:function(){var t=this.editor,e=this.$el,n=this.model,r=n.get('id'),i=n.get('label'),o=t.getConfig('stylePrefix');return e.addClass("".concat(o,"toolbar-item")),r&&e.addClass("".concat(o,"toolbar-item__").concat(r)),i&&e.append(i),this}}),v=h["a"].extend({itemView:g,initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config={editor:t.editor||'',em:t.em},this.listenTo(this.collection,'reset',this.render)}}),m=c.a.Model.extend({defaults:{command:'',attributes:{}}}),y=c.a.Collection.extend({model:m});function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{},r=n.el||this.canvas.getToolsEl(e);return r&&(r.style.display=t?'':'none'),r||{}},showElementOffset:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};O&&this.editor.runCommand('show-offset',{el:t,elPos:e,view:n.view,force:1,top:0,left:0})},hideElementOffset:function(t){this.editor.stopCommand('show-offset',{view:t})},showFixedElementOffset:function(t,e){this.editor.runCommand('show-offset',{el:t,elPos:e,state:'Fixed'})},hideFixedElementOffset:function(t,e){this.editor&&this.editor.stopCommand('show-offset',{state:'Fixed'})},hideHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=0},onClick:function(t){t.stopPropagation(),t.preventDefault();var e=this.em;if(e.get('_cmpDrag'))return e.set('_cmpDrag');var n=x(t.target),r=n.data('model');if(!r)for(var i=n.parent();!r&&i.length&&!Object(d["i"])(i[0]);)r=i.data('model'),i=i.parent();if(r)if(r.get('selectable'))this.select(r,t);else{for(var o=r.parent();o&&!o.get('selectable');)o=o.parent();this.select(o,t)}},select:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&(this.editor.select(t,{scroll:{},event:e}),this.initResize(t))},updateBadge:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.canvas,i=x(t).data('model');if(i&&i.get('badgable')){var o=this.getBadge(n);if(!n.posOnly){var a=this.canvas.getConfig(),s=i.getIcon(),c=a.pStylePrefix||'',l="".concat(c,"badge"),u=a.customBadgeLabel,d="".concat(s?"
").concat(s,"
"):'',"\n
").concat(i.getName(),"
");o.innerHTML=u?u(i):d}var h='px',f=o.style;f.display='block';var p=r.getTargetToElementFixed(t,o,{pos:e}),g=p.top,v=n.leftOff<0?-n.leftOff:0;f.top=g+h,f.left=v+h}},showHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=''},initResize:function(t){var e,n=this.em,r=this.canvas,o=n?n.get('Editor'):'',a=(n?n.get('Config'):'').stylePrefix||'',s="".concat(a,"resizing"),c=!Object(l["isElement"])(t)&&Object(u["isTaggableNode"])(t)?t:n.getSelected(),d=c&&c.get('resizable'),h={},f=function(t,e,n){var r=n.docs;r&&r.forEach((function(e){var n=e.body,r=n.className||'';n.className=('add'==t?"".concat(r," ").concat(s):r.replace(s,'')).trim()}))};if(o&&d){var p=Object(l["isElement"])(t)?t:c.getEl();h={onStart:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.el,a=i.config,s=i.resizer,l=a.keyHeight,d=a.keyWidth,h=a.currentUnit,p=a.keepAutoHeight,g=a.keepAutoWidth;f('add',0,i),e=n.get('StyleManager').getModelToStyle(c),r.toggleFramesEvents();var v=getComputedStyle(o),m=e.getStyle(),y=m[d];a.autoWidth=g&&'auto'===y,isNaN(parseFloat(y))&&(y=v[d]);var b=m[l];a.autoHeight=p&&'auto'===b,isNaN(parseFloat(b))&&(b=v[l]),s.startDim.w=parseFloat(y),s.startDim.h=parseFloat(b),O=0,h&&(a.unitHeight=Object(u["getUnitFromValue"])(b),a.unitWidth=Object(u["getUnitFromValue"])(y))},onMove:function(){o.trigger('component:resize')},onEnd:function(t,e){f('remove',0,e),o.trigger('component:resize'),r.toggleFramesEvents(1),O=1},updateTarget:function(t,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e){var a=o.store,s=o.selectedHandler,c=o.config,l=c.keyHeight,u=c.keyWidth,d=c.autoHeight,h=c.autoWidth,f=c.unitWidth,p=c.unitHeight,g=['tc','bc'].indexOf(s)>=0,v=['cl','cr'].indexOf(s)>=0,m={},y=a?'':1;if(!g){var b=r.getBody().offsetWidth,O=i.w0&&void 0!==arguments[0]?arguments[0]:{};return this.canvas.getBadgeEl(t.view)},onFrameScroll:function(){this.updateTools()},updateTools:function(){this.updateLocalPos(),this.updateGlobalPos()},isCompSelected:function(t){return t&&'selected'===t.get('status')},updateToolsLocal:function(t){var e=t||this.getElHovered(),n=e.el,r=e.pos,i=e.view,o=e.component;if(n){var a=o.get('hoverable'),s=this.lastHovered!==n,c=s?{}:{posOnly:1};s&&a&&(this.lastHovered=n,this.showHighlighter(i),this.showElementOffset(n,r,{view:i})),this.isCompSelected(o)&&(this.hideHighlighter(i),this.hideElementOffset(i));var l='px',u=this.toggleToolsEl(1,i),d=u.style,h=this.canvas.canvasRectOffset(n,r),f=h.top,p=h.left;this.updateBadge(n,r,w(w({},c),{},{view:i,topOff:f,leftOff:p})),d.top=f+l,d.left=p+l,d.width=r.width+l,d.height=r.height+l,this._trgToolUp('local',{component:o,el:u,top:f,left:p,width:r.width,height:r.height})}else this.lastHovered=0},_upToolbar:Object(l["debounce"])((function(){this.updateToolsGlobal({force:1})})),_trgToolUp:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em.trigger('canvas:tools:update',w({type:t},e))},updateToolsGlobal:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getElSelected(),n=e.el,r=e.pos,i=e.component;if(!n)return this.toggleToolsEl(),void(this.lastSelected=0);var o=this.canvas,a=this.lastSelected!==n;(a||t.force)&&(this.lastSelected=n,this.updateToolbar(i));var s='px',c=this.toggleToolsEl(1),l=c.style,u=o.getTargetToElementFixed(n,o.getToolbarEl(),{pos:r}),d=u.canvasOffsetTop,h=u.canvasOffsetLeft;l.top=d+s,l.left=h+s,l.width=r.width+s,l.height=r.height+s,this.updateToolbarPos({top:u.top,left:u.left}),this._trgToolUp('global',{component:i,el:c,top:d,left:h,width:r.width,height:r.height})},updateAttached:Object(l["debounce"])((function(){this.updateGlobalPos()})),onContainerChange:Object(l["debounce"])((function(){this.em.refreshCanvas()}),150),getElementPos:function(t){return this.canvas.getCanvasView().getElementPos(t)},hideBadge:function(){this.getBadge().style.display='none'},cleanPrevious:function(t){t&&t.set({status:'',state:''})},getContentWindow:function(){return this.canvas.getWindow()},run:function(t){Object(u["hasWin"])()&&(this.editor=t&&t.get('Editor'),this.enable())},stop:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object(u["hasWin"])()){var r=this.em,i=this.editor;this.onHovered(),this.stopSelectComponent(),!n.preserveSelected&&r.setSelected(null),this.toggleToolsEl(),i&&i.stopCommand('resize')}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(3),i=n.n(r),o=n(5),a=n.n(o),s=n(6),c=n.n(s),l=n(0),u=n(1);function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return a()(this,t),this.opts={container:null,onStart:null,onDrag:null,onEnd:null,setPosition:null,getPosition:null,guidesStatic:null,guidesTarget:null,snapOffset:5,doc:0,scale:1},Object(l["bindAll"])(this,'drag','stop','keyHandle','handleScroll'),this.setOptions(e),this.delta={x:0,y:0},this}return c()(t,[{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts=h(h({},this.opts),t)}},{key:"toggleDrag",value:function(t){var e=this.getDocumentEl(),n=this.getContainerEl(),r=this.getWindowEl(),i=t?'on':'off',o={on:u["on"],off:u["off"]};o[i](n,'mousemove dragover',this.drag),o[i](e,'mouseup dragend touchend',this.stop),o[i](e,'keydown',this.keyHandle),o[i](r,'scroll',this.handleScroll)}},{key:"handleScroll",value:function(){var t=this.lastScroll,e=this.delta,n=this.getScrollInfo(),r={x:n.x-t.x,y:n.y-t.y};this.move(e.x+r.x,e.y+r.y),this.lastScrollDiff=r}},{key:"start",value:function(t){var e=this.opts,n=e.onStart;this.toggleDrag(1),this.startPointer=this.getPointerPos(t),this.guidesStatic=Object(l["result"])(e,'guidesStatic')||[],this.guidesTarget=Object(l["result"])(e,'guidesTarget')||[],Object(l["isFunction"])(n)&&n(t,this),this.startPosition=this.getStartPosition(),this.lastScrollDiff={x:0,y:0},this.globScrollDiff={x:0,y:0},this.drag(t)}},{key:"drag",value:function(t){var e=this,n=this.opts,r=this.lastScrollDiff,i=this.globScrollDiff,o=n.onDrag,a=this.startPointer,s=this.getPointerPos(t),c={x:i.x+r.x,y:i.y+r.y};this.globScrollDiff=c;var u={x:s.x-a.x+c.x,y:s.y-a.y+c.y};this.lastScrollDiff={x:0,y:0};var d=this.lockedAxis;'x'===(d=t.shiftKey?!d&&this.detectAxisLock(u.x,u.y):null)?u.x=a.x:'y'===d&&(u.y=a.y);var f=function(r){['x','y'].forEach((function(t){return r[t]=r[t]*Object(l["result"])(n,'scale')})),e.delta=r,e.move(r.x,r.y),Object(l["isFunction"])(o)&&o(t,e)},p=h({},u);if(this.currentPointer=s,this.lockedAxis=d,this.lastScroll=this.getScrollInfo(),f(u),this.guidesTarget.length){var g=this.snapGuides(p),v=g.newDelta,m=g.trgX,y=g.trgY;(m||y)&&f(v)}0===t.which&&this.stop(t)}},{key:"snapGuides",value:function(t){var e=this,n=t,r=this.trgX,i=this.trgY;return this.guidesTarget.forEach((function(n){n.x&&e.trgX||n.y&&e.trgY||(n.active=0,e.guidesStatic.forEach((function(o){if(!(n.y&&o.x||n.x&&o.y)){var a=n.y&&o.y,s=a?'y':'x',c=n[s],u=o[s],d=t[s],h=a?i:r;if(e.isPointIn(c,u)&&Object(l["isUndefined"])(h)){var f=d-(c-u);e.setGuideLock(n,f)}}})))})),r=this.trgX,i=this.trgY,['x','y'].forEach((function(r){var i=r.toUpperCase(),o=e["trg".concat(i)];o&&!e.isPointIn(t[r],o.lock)&&(e.setGuideLock(o,null),o=null),o&&!Object(l["isUndefined"])(o.lock)&&(n[r]=o.lock)})),{newDelta:n,trgX:this.trgX,trgY:this.trgY}}},{key:"isPointIn",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.offset,i=r||this.opts.snapOffset;return t>=e&&t<=e+i||t<=e&&t>=e-i}},{key:"setGuideLock",value:function(t,e){var n=Object(l["isUndefined"])(t.x)?'Y':'X',r="trg".concat(n);return null!==e?(t.active=1,t.lock=e,this[r]=t):(delete t.active,delete t.lock,delete this[r]),t}},{key:"stop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.delta,r=e.cancel,i=r?0:n.x,o=r?0:n.y;this.toggleDrag(),this.lockedAxis=null,this.move(i,o,1);var a=this.opts.onEnd;Object(l["isFunction"])(a)&&a(t,this,{cancelled:r})}},{key:"keyHandle",value:function(t){Object(u["isEscKey"])(t)&&this.stop(t,{cancel:1})}},{key:"move",value:function(t,e,n){var r=this.el,i=this.opts,o=this.startPosition;if(o){var a=i.setPosition,s=o.x+t,c=o.y+e;this.position={x:s,y:c,end:n},Object(l["isFunction"])(a)&&a(this.position),r&&(r.style.left="".concat(s,"px"),r.style.top="".concat(c,"px"))}}},{key:"getContainerEl",value:function(){var t=this.opts.container;return t?[t]:this.getDocumentEl()}},{key:"getWindowEl",value:function(){return this.getContainerEl().map((function(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow}))}},{key:"getDocumentEl",value:function(t){var e=this.opts.doc;if(t=t||this.el,!this.docs){var n=[document];t&&n.push(t.ownerDocument),e&&n.push(e),this.docs=n}return this.docs}},{key:"getPointerPos",value:function(t){var e=this.opts.getPointerPosition,n=Object(u["getPointerEvent"])(t);return e?e(t):{x:n.clientX,y:n.clientY}}},{key:"getStartPosition",value:function(){var t=this.el,e=this.opts.getPosition,n={x:0,y:0};return Object(l["isFunction"])(e)?n=e():t&&(n={x:parseFloat(t.style.left),y:parseFloat(t.style.top)}),n}},{key:"getScrollInfo",value:function(){var t=this.opts.doc,e=t&&t.body;return{y:e?e.scrollTop:0,x:e?e.scrollLeft:0}}},{key:"detectAxisLock",value:function(t,e){var n=t,r=e,i=Math.abs(n),o=Math.abs(r);return r>=i||r<=-i?'x':n>o||n<-o?'y':void 0}}]),t}()},function(t,e,n){"use strict";var r=n(2),i=n.n(r),o=i.a.$;e["a"]=i.a.View.extend({events:{change:'handleChange'},template:function(){return"")},inputClass:function(){return"".concat(this.ppfx,"field")},holderClass:function(){return"".concat(this.ppfx,"input-holder")},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.ppfx||'';this.opts=t,this.ppfx=e,this.em=t.target||{},this.listenTo(this.model,'change:value',this.handleModelChange)},elementUpdated:function(){this.model.trigger('el:change')},setValue:function(t){var e=this.model,n=t||e.get('defaults'),r=this.getInputEl();r&&(r.value=n)},handleModelChange:function(t,e,n){this.setValue(e,n)},handleChange:function(t){t.stopPropagation();var e=this.getInputEl().value;this.__onInputChange(e),this.elementUpdated()},__onInputChange:function(t){this.model.set({value:t},{fromInput:1})},getInputEl:function(){if(!this.inputEl){var t=this.model,e=this.opts.type||'text',n=t.get('placeholder')||t.get('defaults')||t.get('default')||'';this.inputEl=o(""))}return this.inputEl.get(0)},render:function(){this.inputEl=null;var t=this.$el;return t.addClass(this.inputClass()),t.html(this.template()),t.find(".".concat(this.holderClass())).append(this.getInputEl()),this}})},function(t,e,n){t.exports=n(93)},function(t,e,n){1&&(t.exports=function(){'use strict';var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),r=/MSIE \d/.test(t),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),c=!o&&/WebKit\//.test(t),l=c&&/Qt\/\d+\.\d+/.test(t),u=!o&&/Chrome\//.test(t),d=/Opera\//.test(t),h=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),p=/PhantomJS/.test(t),g=h&&(/Mobile\/\w+/.test(t)||navigator.maxTouchPoints>2),v=/Android/.test(t),m=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=g||/Mac/.test(e),b=/\bCrOS\b/.test(t),w=/win/i.test(e),O=d&&t.match(/Version\/(\d*\.\d*)/);O&&(O=Number(O[1])),O&&O>=15&&(d=!1,c=!0);var x=y&&(l||d&&(null==O||O<12.11)),C=n||a&&s>=9;function k(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var S,j=function(t,e){var n=t.className,r=k(e).exec(n);if(r){var i=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function P(t,e){return T(t).appendChild(e)}function E(t,e,n,r){var i=document.createElement(t);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o=e)return a+(e-o);a+=s-o,a+=n-a%n,o=s+1}}g?N=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:a&&(N=function(t){try{t.select()}catch(t){}});var V=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function z(t,e){for(var n=0;n=e)return r+Math.min(a,e-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=e)return r}}var G=[""];function K(t){for(;G.length<=t;)G.push(Y(G)+" ");return G[t]}function Y(t){return t[t.length-1]}function X(t,e){for(var n=[],r=0;r"€"&&(t.toUpperCase()!=t.toLowerCase()||Q.test(t))}function et(t,e){return e?!!(e.source.indexOf("\\w")>-1&&tt(t))||e.test(t):tt(t)}function nt(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var rt=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function it(t){return t.charCodeAt(0)>=768&&rt.test(t)}function ot(t,e,n){for(;(n<0?e>0:en?-1:1;;){if(e==n)return e;var i=(e+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+r}}var st=null;function ct(t,e,n){var r;st=null;for(var i=0;ie)return i;o.to==e&&(o.from!=o.to&&"before"==n?r=i:st=i),o.from==e&&(o.from!=o.to&&"before"!=n?r=i:st=i)}return null!=r?r:st}var lt=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,i=/[LRr]/,o=/[Lb1n]/,a=/[1n]/;function s(t,e,n){this.level=t,this.from=e,this.to=n}return function(c,l){var u="ltr"==l?"L":"R";if(0==c.length||"ltr"==l&&!n.test(c))return!1;for(var d,h=c.length,f=[],p=0;p-1&&(r[e]=i.slice(0,o).concat(i.slice(o+1)))}}}function gt(t,e){var n=ft(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function bt(t){t.prototype.on=function(t,e){ht(this,t,e)},t.prototype.off=function(t,e){pt(this,t,e)}}function wt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function Ot(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function xt(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Ct(t){wt(t),Ot(t)}function kt(t){return t.target||t.srcElement}function St(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var jt,Tt,Pt=function(){if(a&&s<9)return!1;var t=E('div');return"draggable"in t||"dragDrop"in t}();function Et(t){if(null==jt){var e=E("span","​");P(t,E("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(jt=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&s<8))}var n=jt?E("span","​"):E("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function _t(t){if(null!=Tt)return Tt;var e=P(t,document.createTextNode("AخA")),n=S(e,0,1).getBoundingClientRect(),r=S(e,1,2).getBoundingClientRect();return T(t),!(!n||n.left==n.right)&&(Tt=r.right-n.right<3)}var Mt,Dt=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;e<=r;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),e+=a+1):(n.push(o),e=i+1)}return n}:function(t){return t.split(/\r\n?|\n/)},At=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Lt="oncopy"in(Mt=E("div"))||(Mt.setAttribute("oncopy","return;"),"function"==typeof Mt.oncopy),Nt=null,Rt={},It={};function Ft(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Rt[t]=e}function Vt(t){if("string"==typeof t&&It.hasOwnProperty(t))t=It[t];else if(t&&"string"==typeof t.name&&It.hasOwnProperty(t.name)){var e=It[t.name];"string"==typeof e&&(e={name:e}),(t=Z(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Vt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Vt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function zt(t,e){e=Vt(e);var n=Rt[e.name];if(!n)return zt(t,"text/plain");var r=n(t,e);if(Ht.hasOwnProperty(e.name)){var i=Ht[e.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var a in e.modeProps)r[a]=e.modeProps[a];return r}var Ht={};function Bt(t,e){I(e,Ht.hasOwnProperty(t)?Ht[t]:Ht[t]={})}function Ut(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function $t(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Wt(t,e,n){return!t.startState||t.startState(e,n)}var qt=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Gt(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(e=t.first&&en?ee(n,Gt(t,n).text.length):function(t,e){var n=t.ch;return null==n||n>e?ee(t.line,e):n<0?ee(t.line,0):t}(e,Gt(t,e.line).text.length)}function le(t,e){for(var n=[],r=0;r=this.string.length},qt.prototype.sol=function(){return this.pos==this.lineStart},qt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qt.prototype.next=function(){if(this.pose},qt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},qt.prototype.skipToEnd=function(){this.pos=this.string.length},qt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},qt.prototype.backUp=function(t){this.pos-=t},qt.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var i=function(t){return n?t.toLowerCase():t};if(i(this.string.substr(this.pos,t.length))==i(t))return!1!==e&&(this.pos+=t.length),!0},qt.prototype.current=function(){return this.string.slice(this.start,this.pos)},qt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},qt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},qt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ue=function(t,e){this.state=t,this.lookAhead=e},de=function(t,e,n,r){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function he(t,e,n,r){var i=[t.state.modeGen],o={};Oe(t,e.text,t.doc.mode,n,(function(t,e){return i.push(t,e)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=t.state.overlays[r],c=1,l=0;n.state=!0,Oe(t,e.text,s.mode,n,(function(t,e){for(var n=c;lt&&i.splice(c,1,t,i[c+1],r),c+=2,l=Math.min(t,r)}if(e)if(s.opaque)i.splice(n,c-n,t,"overlay "+e),c=n+2;else for(;nt.options.maxHighlightLength&&Ut(t.doc.mode,r.state),o=he(t,e,r);i&&(r.state=i),e.stateAfter=r.save(!i),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function pe(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return new de(r,!0,e);var o=function(t,e,n){for(var r,i,o=t.doc,a=n?-1:e-(t.doc.mode.innerMode?1e3:100),s=e;s>a;--s){if(s<=o.first)return o.first;var c=Gt(o,s-1),l=c.stateAfter;if(l&&(!n||s+(l instanceof ue?l.lookAhead:0)<=o.modeFrontier))return s;var u=F(c.text,null,t.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}(t,e,n),a=o>r.first&&Gt(r,o-1).stateAfter,s=a?de.fromSaved(r,a,o):new de(r,Wt(r.mode),o);return r.iter(o,e,(function(n){ge(t,n.text,s);var r=s.line;n.stateAfter=r==e-1||r%5==0||r>=i.viewFrom&&re.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}de.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},de.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},de.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},de.fromSaved=function(t,e,n){return e instanceof ue?new de(t,Ut(t.mode,e.state),n,e.lookAhead):new de(t,Ut(t.mode,e),n)},de.prototype.save=function(t){var e=!1!==t?Ut(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ue(e,this.maxLookAhead):e};var ye=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function be(t,e,n,r){var i,o,a=t.doc,s=a.mode,c=Gt(a,(e=ce(a,e)).line),l=pe(t,e.line,n),u=new qt(c.text,t.options.tabSize,l);for(r&&(o=[]);(r||u.post.options.maxHighlightLength?(s=!1,a&&ge(t,e,r,d.pos),d.pos=e.length,c=null):c=we(me(n,d,r.state,h),o),h){var f=h[0].name;f&&(c="m-"+(c?f+" "+c:f))}if(!s||u!=c){for(;l=e:o.to>e);(r||(r=[])).push(new ke(a,o.from,s?null:o.to))}}return r}(n,i,a),c=function(t,e,n){var r;if(t)for(var i=0;i=e:o.to>e)||o.from==e&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=e:o.from0&&s)for(var b=0;be)&&(!n||Ae(n,o.marker)<0)&&(n=o.marker)}return n}function Fe(t,e,n,r,i){var o=Gt(t,e),a=Ce&&o.markedSpans;if(a)for(var s=0;s=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?ne(l.to,n)>=0:ne(l.to,n)>0)||u>=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?ne(l.from,r)<=0:ne(l.from,r)<0)))return!0}}}function Ve(t){for(var e;e=Ne(t);)t=e.find(-1,!0).line;return t}function ze(t,e){var n=Gt(t,e),r=Ve(n);return n==r?e:Jt(r)}function He(t,e){if(e>t.lastLine())return e;var n,r=Gt(t,e);if(!Be(t,r))return e;for(;n=Re(r);)r=n.find(1,!0).line;return Jt(r)+1}function Be(t,e){var n=Ce&&e.markedSpans;if(n)for(var r=void 0,i=0;ie.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var Ge=function(t,e,n){this.text=t,_e(this,e),this.height=n?n(this):1};function Ke(t){t.parent=null,Ee(t)}Ge.prototype.lineNo=function(){return Jt(this)},bt(Ge);var Ye={},Xe={};function Je(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?Xe:Ye;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function Ze(t,e){var n=_("span",null,null,c?"padding-right: .1px":null),r={pre:_("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var i=0;i<=(e.rest?e.rest.length:0);i++){var o=i?e.rest[i-1]:e.line,a=void 0;r.pos=0,r.addToken=tn,_t(t.display.measure)&&(a=ut(o,t.doc.direction))&&(r.addToken=en(r.addToken,a)),r.map=[],rn(o,r,fe(t,o,e!=t.display.externalMeasured&&Jt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=L(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=L(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Et(t.display.measure))),0==i?(e.measure.map=r.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(r.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(c){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return gt(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=L(r.pre.className,r.textClass||"")),r}function Qe(t){var e=E("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function tn(t,e,n,r,i,o,c){if(e){var l,u=t.splitSpaces?function(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,r="",i=0;il&&d.from<=l);h++);if(d.to>=u)return t(n,r,i,o,a,s,c);t(n,r.slice(0,d.to-l),i,o,null,s,c),o=null,r=r.slice(d.to-l),l=d.to}}}function nn(t,e,n,r){var i=!r&&n.widgetNode;i&&t.map.push(t.pos,t.pos+e,i),!r&&t.cm.display.input.needsContentAttribute&&(i||(i=t.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(t.cm.display.input.setUneditable(i),t.content.appendChild(i)),t.pos+=e,t.trailingSpace=!1}function rn(t,e,n){var r=t.markedSpans,i=t.text,o=0;if(r)for(var a,s,c,l,u,d,h,f=i.length,p=0,g=1,v="",m=0;;){if(m==p){c=l=u=s="",h=null,d=null,m=1/0;for(var y=[],b=void 0,w=0;wp||x.collapsed&&O.to==p&&O.from==p)){if(null!=O.to&&O.to!=p&&m>O.to&&(m=O.to,l=""),x.className&&(c+=" "+x.className),x.css&&(s=(s?s+";":"")+x.css),x.startStyle&&O.from==p&&(u+=" "+x.startStyle),x.endStyle&&O.to==m&&(b||(b=[])).push(x.endStyle,O.to),x.title&&((h||(h={})).title=x.title),x.attributes)for(var C in x.attributes)(h||(h={}))[C]=x.attributes[C];x.collapsed&&(!d||Ae(d.marker,x)<0)&&(d=O)}else O.from>p&&m>O.from&&(m=O.from)}if(b)for(var k=0;k=f)break;for(var j=Math.min(f,m);1;){if(v){var T=p+v.length;if(!d){var P=T>j?v.slice(0,j-p):v;e.addToken(e,P,a?a+c:c,u,p+P.length==m?l:"",s,h)}if(T>=j){v=v.slice(j-p),p=j;break}p=T,u=""}v=i.slice(o,o=n[g++]),a=Je(n[g++],e.cm.options)}}else for(var E=1;En)return{map:t.measure.maps[i],cache:t.measure.caches[i],before:!0}}function Mn(t,e,n,r){return Ln(t,An(t,e),n,r)}function Dn(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&e2&&o.push((c.bottom+l.top)/2-n.top)}}o.push(n.bottom-n.top)}}(t,e.view,e.rect),e.hasHeights=!0),(o=function(t,e,n,r){var i,o=In(e.map,n,r),c=o.node,l=o.start,u=o.end,d=o.collapse;if(3==c.nodeType){for(var h=0;h<4;h++){for(;l&&it(e.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+u1}(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*r,bottom:e.bottom*r}}(t.display.measure,i))}else{var f;l>0&&(d=r="right"),i=t.options.lineWrapping&&(f=c.getClientRects()).length>1?f["right"==r?f.length-1:0]:c.getBoundingClientRect()}if(a&&s<9&&!l&&(!i||!i.left&&!i.right)){var p=c.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+or(t.display),top:p.top,bottom:p.bottom}:Rn}for(var g=i.top-e.rect.top,v=i.bottom-e.rect.top,m=(g+v)/2,y=e.view.measure.heights,b=0;be)&&(i=(o=c-s)-1,e>=c&&(a="right")),null!=i){if(r=t[l+2],s==c&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;l&&t[l-2]==t[l-3]&&t[l-1].insertLeft;)r=t[(l-=3)+2],a="left";if("right"==n&&i==c-s)for(;l=0&&(n=t[i]).left==n.right;i--);return n}function Vn(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e=r.text.length?(c=r.text.length,l="before"):c<=0&&(c=0,l="after"),!s)return a("before"==l?c-1:c,"before"==l);function u(t,e,n){return a(n?t-1:t,1==s[e].level!=n)}var d=ct(s,c,l),h=st,f=u(c,d,"before"==l);return null!=h&&(f.other=u(c,h,"before"!=l)),f}function Yn(t,e){var n=0;e=ce(t.doc,e),t.options.lineWrapping||(n=or(t.display)*e.ch);var r=Gt(t.doc,e.line),i=$e(r)+kn(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Xn(t,e,n,r,i){var o=ee(t,e,n);return o.xRel=i,r&&(o.outside=r),o}function Jn(t,e,n){var r=t.doc;if((n+=t.display.viewOffset)<0)return Xn(r.first,0,null,-1,-1);var i=Zt(r,n),o=r.first+r.size-1;if(i>o)return Xn(r.first+r.size-1,Gt(r,o).text.length,null,1,1);e<0&&(e=0);for(var a=Gt(r,i);;){var s=er(t,a,i,e,n),c=Ie(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!c)return s;var l=c.find(1);if(l.line==i)return l;a=Gt(r,i=l.line)}}function Zn(t,e,n,r){r-=$n(e);var i=e.text.length,o=at((function(e){return Ln(t,n,e-1).bottom<=r}),i,0);return{begin:o,end:i=at((function(e){return Ln(t,n,e).top>r}),o,i)}}function Qn(t,e,n,r){return n||(n=An(t,e)),Zn(t,e,n,Wn(t,e,Ln(t,n,r),"line").top)}function tr(t,e,n,r){return!(t.bottom<=n)&&(t.top>n||(r?t.left:t.right)>e)}function er(t,e,n,r,i){i-=$e(e);var o=An(t,e),a=$n(e),s=0,c=e.text.length,l=!0,u=ut(e,t.doc.direction);if(u){var d=(t.options.lineWrapping?rr:nr)(t,e,n,o,u,r,i);s=(l=1!=d.level)?d.from:d.to-1,c=l?d.to:d.from-1}var h,f,p=null,g=null,v=at((function(e){var n=Ln(t,o,e);return n.top+=a,n.bottom+=a,!!tr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=e,g=n),!0)}),s,c),m=!1;if(g){var y=r-g.left=w.bottom?1:0}return Xn(n,v=ot(e.text,v,1),f,m,r-h)}function nr(t,e,n,r,i,o,a){var s=at((function(s){var c=i[s],l=1!=c.level;return tr(Kn(t,ee(n,l?c.to:c.from,l?"before":"after"),"line",e,r),o,a,!0)}),0,i.length-1),c=i[s];if(s>0){var l=1!=c.level,u=Kn(t,ee(n,l?c.from:c.to,l?"after":"before"),"line",e,r);tr(u,o,a,!0)&&u.top>a&&(c=i[s-1])}return c}function rr(t,e,n,r,i,o,a){var s=Zn(t,e,r,a),c=s.begin,l=s.end;/\s/.test(e.text.charAt(l-1))&&l--;for(var u=null,d=null,h=0;h=l||f.to<=c)){var p=Ln(t,r,1!=f.level?Math.min(l,f.to)-1:Math.max(c,f.from)).right,g=pg)&&(u=f,d=g)}}return u||(u=i[i.length-1]),u.froml&&(u={from:u.from,to:l,level:u.level}),u}function ir(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==Nn){Nn=E("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)Nn.appendChild(document.createTextNode("x")),Nn.appendChild(E("br"));Nn.appendChild(document.createTextNode("x"))}P(t.measure,Nn);var n=Nn.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),T(t.measure),n||1}function or(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=E("span","xxxxxxxxxx"),n=E("pre",[e],"CodeMirror-line-like");P(t.measure,n);var r=e.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(t.cachedCharWidth=i),i||10}function ar(t){for(var e=t.display,n={},r={},i=e.gutters.clientLeft,o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=t.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:sr(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function sr(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function cr(t){var e=ir(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/or(t.display)-3);return function(i){if(Be(t.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(c=Gt(t.doc,l.line).text).length==l.ch){var u=F(c,c.length,t.options.tabSize)-c.length;l=ee(l.line,Math.max(0,Math.round((o-jn(t.display).left)/or(t.display))-u))}return l}function dr(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,r=0;re)&&(i.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=i.viewTo)Ce&&ze(t.doc,e)i.viewFrom?pr(t):(i.viewFrom+=r,i.viewTo+=r);else if(e<=i.viewFrom&&n>=i.viewTo)pr(t);else if(e<=i.viewFrom){var o=gr(t,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):pr(t)}else if(n>=i.viewTo){var a=gr(t,e,e,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):pr(t)}else{var s=gr(t,e,e,-1),c=gr(t,n,n+r,1);s&&c?(i.view=i.view.slice(0,s.index).concat(an(t,s.lineN,c.lineN)).concat(i.view.slice(c.index)),i.viewTo+=r):pr(t)}var l=i.externalMeasured;l&&(n=i.lineN&&e=r.viewTo)){var o=r.view[dr(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==z(a,n)&&a.push(n)}}}function pr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function gr(t,e,n,r){var i,o=dr(t,e),a=t.display.view;if(!Ce||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=t.display.viewFrom,c=0;c0){if(o==a.length-1)return null;i=s+a[o].size-e,o++}else i=s-e;e+=i,n+=i}for(;ze(t.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function vr(t){for(var e=t.display.view,n=0,r=0;r=t.display.viewTo||s.to().line0&&(i.style.width=o.right-o.left+"px")}if(r.other){var a=n.appendChild(E("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function wr(t,e){return t.top-e.top||t.left-e.left}function Or(t,e,n){var r=t.display,i=t.doc,o=document.createDocumentFragment(),a=jn(t.display),s=a.left,c=Math.max(r.sizerWidth,Pn(t)-r.sizer.offsetLeft)-a.right,l="ltr"==i.direction;function u(t,e,n,r){e<0&&(e=0),e=Math.round(e),r=Math.round(r),o.appendChild(E("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?c-t:n)+"px;\n height: "+(r-e)+"px"))}function d(e,n,r){var o,a,d=Gt(i,e),h=d.text.length;function f(n,r){return Gn(t,ee(e,n),"div",d,r)}function p(e,n,r){var i=Qn(t,d,null,e),o="ltr"==n==("after"==r)?"left":"right";return f("after"==r?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1),o)[o]}var g=ut(d,i.direction);return function(t,e,n,r){if(!t)return r(e,n,"ltr",0);for(var i=!1,o=0;oe||e==n&&a.to==e)&&(r(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(e,n,"ltr")}(g,n||0,null==r?h:r,(function(t,e,i,d){var v="ltr"==i,m=f(t,v?"left":"right"),y=f(e-1,v?"right":"left"),b=null==n&&0==t,w=null==r&&e==h,O=0==d,x=!g||d==g.length-1;if(y.top-m.top<=3){var C=(l?w:b)&&x,k=(l?b:w)&&O?s:(v?m:y).left,S=C?c:(v?y:m).right;u(k,m.top,S-k,m.bottom)}else{var j,T,P,E;v?(j=l&&b&&O?s:m.left,T=l?c:p(t,i,"before"),P=l?s:p(e,i,"after"),E=l&&w&&x?c:y.right):(j=l?p(t,i,"before"):s,T=!l&&b&&O?c:m.right,P=!l&&w&&x?s:y.left,E=l?p(e,i,"after"):c),u(j,m.top,T-j,m.bottom),m.bottom0?e.blinker=setInterval((function(){t.hasFocus()||jr(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Cr(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||Sr(t))}function kr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&jr(t))}),100)}function Sr(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(gt(t,"focus",t,e),t.state.focused=!0,A(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),c&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),xr(t))}function jr(t,e){t.state.delayingBlurEvent||(t.state.focused&&(gt(t,"blur",t,e),t.state.focused=!1,j(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function Tr(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=Math.max(0,e.scroller.getBoundingClientRect().top),i=e.lineDiv.getBoundingClientRect().top,o=0,c=0;c.005||g<-.005)&&(it.display.sizerWidth){var m=Math.ceil(h/or(t.display));m>t.display.maxLineLength&&(t.display.maxLineLength=m,t.display.maxLine=l.line,t.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(e.scroller.scrollTop+=o)}function Pr(t){if(t.widgets)for(var e=0;e=a&&(o=Zt(e,$e(Gt(e,c))-t.wrapper.clientHeight),a=c)}return{from:o,to:Math.max(a,o+1)}}function _r(t,e){var n=t.display,r=ir(t.display);e.top<0&&(e.top=0);var i=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=En(t),a={};e.bottom-e.top>o&&(e.bottom=e.top+o);var s=t.doc.height+Sn(n),c=e.tops-r;if(e.topi+o){var u=Math.min(e.top,(l?s:e.bottom)-o);u!=i&&(a.scrollTop=u)}var d=t.options.fixedGutter?0:n.gutters.offsetWidth,h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-d,f=Pn(t)-n.gutters.offsetWidth,p=e.right-e.left>f;return p&&(e.right=e.left+f),e.left<10?a.scrollLeft=0:e.leftf+h-3&&(a.scrollLeft=e.right+(p?0:10)-f),a}function Mr(t,e){null!=e&&(Lr(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function Dr(t){Lr(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Ar(t,e,n){null==e&&null==n||Lr(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function Lr(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,Nr(t,Yn(t,e.from),Yn(t,e.to),e.margin))}function Nr(t,e,n,r){var i=_r(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-r,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+r});Ar(t,i.scrollLeft,i.scrollTop)}function Rr(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||li(t,{top:e}),Ir(t,e,!0),n&&li(t),ii(t,100))}function Ir(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function Fr(t,e,n,r){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!r||(t.doc.scrollLeft=e,hi(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function Vr(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+Sn(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Tn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var zr=function(t,e,n){this.cm=n;var r=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,t(r),t(i),ht(r,"scroll",(function(){r.clientHeight&&e(r.scrollTop,"vertical")})),ht(i,"scroll",(function(){i.clientWidth&&e(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};zr.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?r+"px":"0";var i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:e?r:0}},zr.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zr.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zr.prototype.zeroWidthHack=function(){var t=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new V,this.disableVert=new V},zr.prototype.enableZeroWidthBar=function(t,e,n){t.style.pointerEvents="auto",e.set(1e3,(function r(){var i=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=t?t.style.pointerEvents="none":e.set(1e3,r)}))},zr.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var Hr=function(){};function Br(t,e){e||(e=Vr(t));var n=t.display.barWidth,r=t.display.barHeight;Ur(t,e);for(var i=0;i<4&&n!=t.display.barWidth||r!=t.display.barHeight;i++)n!=t.display.barWidth&&t.options.lineWrapping&&Tr(t),Ur(t,Vr(t)),n=t.display.barWidth,r=t.display.barHeight}function Ur(t,e){var n=t.display,r=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}Hr.prototype.update=function(){return{bottom:0,right:0}},Hr.prototype.setScrollLeft=function(){},Hr.prototype.setScrollTop=function(){},Hr.prototype.clear=function(){};var $r={native:zr,null:Hr};function Wr(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&j(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new $r[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ht(e,"mousedown",(function(){t.state.focused&&setTimeout((function(){return t.display.input.focus()}),0)})),e.setAttribute("cm-not-content","true")}),(function(e,n){"horizontal"==n?Fr(t,e):Rr(t,e)}),t),t.display.scrollbars.addClass&&A(t.display.wrapper,t.display.scrollbars.addClass)}var qr=0;function Gr(t){var e;t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qr,markArrays:null},e=t.curOp,sn?sn.ops.push(e):e.ownsGroup=sn={ops:[e],delayedCallbacks:[]}}function Kr(t){var e=t.curOp;e&&function(t,e){var n=t.ownsGroup;if(n)try{!function(t){var e=t.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new ai(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Xr(t){t.updatedDisplay=t.mustUpdate&&si(t.cm,t.update)}function Jr(t){var e=t.cm,n=e.display;t.updatedDisplay&&Tr(e),t.barMeasure=Vr(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=Mn(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Tn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Pn(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Zr(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=E("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-kn(t.display))+"px;\n height: "+(e.bottom-e.top+Tn(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(i),t.display.lineSpace.removeChild(o)}}}(e,function(t,e,n,r){var i;null==r&&(r=0),t.options.lineWrapping||e!=n||(n="before"==e.sticky?ee(e.line,e.ch+1,"before"):e,e=e.ch?ee(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e);for(var o=0;o<5;o++){var a=!1,s=Kn(t,e),c=n&&n!=e?Kn(t,n):s,l=_r(t,i={left:Math.min(s.left,c.left),top:Math.min(s.top,c.top)-r,right:Math.max(s.left,c.left),bottom:Math.max(s.bottom,c.bottom)+r}),u=t.doc.scrollTop,d=t.doc.scrollLeft;if(null!=l.scrollTop&&(Rr(t,l.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(a=!0)),null!=l.scrollLeft&&(Fr(t,l.scrollLeft),Math.abs(t.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}(e,ce(r,t.scrollToPos.from),ce(r,t.scrollToPos.to),t.scrollToPos.margin));var i=t.maybeHiddenMarkers,o=t.maybeUnhiddenMarkers;if(i)for(var a=0;a=t.display.viewTo)){var n=+new Date+t.options.workTime,r=pe(t,e.highlightFrontier),i=[];e.iter(r.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(o){if(r.line>=t.display.viewFrom){var a=o.styles,s=o.text.length>t.options.maxHighlightLength?Ut(e.mode,r.state):null,c=he(t,o,r,!0);s&&(r.state=s),o.styles=c.styles;var l=o.styleClasses,u=c.classes;u?o.styleClasses=u:l&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),h=0;!d&&hn)return ii(t,t.options.workDelay),!0})),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),i.length&&ti(t,(function(){for(var e=0;e=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==vr(t))return!1;fi(t)&&(pr(t),e.dims=ar(t));var i=r.first+r.size,o=Math.max(e.visible.from-t.options.viewportMargin,r.first),a=Math.min(i,e.visible.to+t.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Ce&&(o=ze(t.doc,o),a=He(t.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;!function(t,e,n){var r=t.display;0==r.view.length||e>=r.viewTo||n<=r.viewFrom?(r.view=an(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=an(t,e,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,dr(t,n)))),r.viewTo=n}(t,o,a),n.viewOffset=$e(Gt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=vr(t);if(!s&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(t){if(t.hasFocus())return null;var e=D();if(!e||!M(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&M(t.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(t);return l>4&&(n.lineDiv.style.display="none"),function(t,e,n){var r=t.display,i=t.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(e){var n=e.nextSibling;return c&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var l=r.view,u=r.viewFrom,d=0;d-1&&(f=!1),dn(t,h,u,n)),f&&(T(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(te(t.options,u)))),a=h.node.nextSibling}else{var p=yn(t,h,u,n);o.insertBefore(p,a)}u+=h.size}for(;a;)a=s(a)}(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(t){if(t&&t.activeElt&&t.activeElt!=D()&&(t.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&M(document.body,t.anchorNode)&&M(document.body,t.focusNode))){var e=window.getSelection(),n=document.createRange();n.setEnd(t.anchorNode,t.anchorOffset),n.collapse(!1),e.removeAllRanges(),e.addRange(n),e.extend(t.focusNode,t.focusOffset)}}(u),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,ii(t,400)),n.updateLineNumbers=null,!0}function ci(t,e){for(var n=e.viewport,r=!0;;r=!1){if(r&&t.options.lineWrapping&&e.oldDisplayWidth!=Pn(t))r&&(e.visible=Er(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Sn(t.display)-En(t),n.top)}),e.visible=Er(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!si(t,e))break;Tr(t);var i=Vr(t);mr(t),Br(t,i),di(t,i),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function li(t,e){var n=new ai(t,e);if(si(t,n)){Tr(t),ci(t,n);var r=Vr(t);mr(t),Br(t,r),di(t,r),n.finish()}}function ui(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px",ln(t,"gutterChanged",t)}function di(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+Tn(t)+"px"}function hi(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=sr(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,o=r+"px",a=0;as.clientWidth,u=s.scrollHeight>s.clientHeight;if(i&&l||o&&u){if(o&&y&&c)t:for(var h=e.target,f=a.view;h!=s;h=h.parentNode)for(var p=0;p=0&&ne(t,r.to())<=0)return n}return-1};var ki=function(t,e){this.anchor=t,this.head=e};function Si(t,e,n){var r=t&&t.options.selectionsMayTouch,i=e[n];e.sort((function(t,e){return ne(t.from(),e.from())})),n=z(e,i);for(var o=1;o0:c>=0){var l=ae(s.from(),a.from()),u=oe(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,e.splice(--o,2,new ki(d?u:l,d?l:u))}}return new Ci(e,n)}function ji(t,e){return new Ci([new ki(t,e||t)],0)}function Ti(t){return t.text?ee(t.from.line+t.text.length-1,Y(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function Pi(t,e){if(ne(t,e.from)<0)return t;if(ne(t,e.to)<=0)return Ti(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;return t.line==e.to.line&&(r+=Ti(e).ch-e.to.ch),ee(n,r)}function Ei(t,e){for(var n=[],r=0;r1&&t.remove(s.line+1,p-1),t.insert(s.line+1,m)}ln(t,"change",t,e)}function Ni(t,e,n){!function t(r,i,o){if(r.linked)for(var a=0;as-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=function(t,e){return e?(zi(t.done),Y(t.done)):t.done.length&&!Y(t.done).ranges?Y(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),Y(t.done)):void 0}(i,i.lastOp==r)))a=Y(o.changes),0==ne(e.from,e.to)&&0==ne(e.from,a.to)?a.to=Ti(e):o.changes.push(Vi(t,e));else{var c=Y(i.done);for(c&&c.ranges||Ui(t.sel,i.done),o={changes:[Vi(t,e)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=e.origin,a||gt(t,"historyAdded")}function Bi(t,e,n,r){var i=t.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}(t,o,Y(i.done),e))?i.done[i.done.length-1]=e:Ui(e,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&zi(i.undone)}function Ui(t,e){var n=Y(e);n&&n.ranges&&n.equals(t)||e.push(t)}function $i(t,e,n,r){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),(function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=n.markedSpans),++o}))}function Wi(t){if(!t)return null;for(var e,n=0;n-1&&(Y(s)[d]=l[d],delete l[d])}}}return r}function Ki(t,e,n,r){if(r){var i=t.anchor;if(n){var o=ne(e,i)<0;o!=ne(n,i)<0?(i=e,e=n):o!=ne(e,n)<0&&(e=n)}return new ki(i,e)}return new ki(n||e,e)}function Yi(t,e,n,r,i){null==i&&(i=t.cm&&(t.cm.display.shift||t.extend)),to(t,new Ci([Ki(t.sel.primary(),e,n,i)],0),r)}function Xi(t,e,n){for(var r=[],i=t.cm&&(t.cm.display.shift||t.extend),o=0;o=e.ch:s.to>e.ch))){if(i&&(gt(c,"beforeCursorEnter"),c.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!c.atomic)continue;if(n){var d=c.find(r<0?1:-1),h=void 0;if((r<0?u:l)&&(d=so(t,d,-r,d&&d.line==e.line?o:null)),d&&d.line==e.line&&(h=ne(d,n))&&(r<0?h<0:h>0))return oo(t,d,e,r,i)}var f=c.find(r<0?-1:1);return(r<0?l:u)&&(f=so(t,f,r,f.line==e.line?o:null)),f?oo(t,f,e,r,i):null}}return e}function ao(t,e,n,r,i){var o=r||1,a=oo(t,e,n,o,i)||!i&&oo(t,e,n,o,!0)||oo(t,e,n,-o,i)||!i&&oo(t,e,n,-o,!0);return a||(t.cantEdit=!0,ee(t.first,0))}function so(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?ce(t,ee(e.line-1)):null:n>0&&e.ch==(r||Gt(t,e.line)).text.length?e.line0)){var u=[c,1],d=ne(l.from,s.from),h=ne(l.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:l.from,to:s.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:s.to,to:l.to}),i.splice.apply(i,u),c+=u.length-3}}return i}(t,e.from,e.to);if(r)for(var i=r.length-1;i>=0;--i)ho(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text,origin:e.origin});else ho(t,e)}}function ho(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ne(e.from,e.to)){var n=Ei(t,e);Hi(t,e,n,t.cm?t.cm.curOp.id:NaN),go(t,e,n,Te(t,e));var r=[];Ni(t,(function(t,n){n||-1!=z(r,t.history)||(bo(t.history,e),r.push(t.history)),go(t,e,null,Te(t,e))}))}}function fo(t,e,n){var r=t.cm&&t.cm.state.suppressEdits;if(!r||n){for(var i,o=t.history,a=t.sel,s="undo"==e?o.done:o.undone,c="undo"==e?o.undone:o.done,l=0;l=0;--f){var p=h(f);if(p)return p.v}}}}function po(t,e){if(0!=e&&(t.first+=e,t.sel=new Ci(X(t.sel.ranges,(function(t){return new ki(ee(t.anchor.line+e,t.anchor.ch),ee(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){hr(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;rt.lastLine())){if(e.from.lineo&&(e={from:e.from,to:ee(o,Gt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Kt(t,e.from,e.to),n||(n=Ei(t,e)),t.cm?function(t,e,n){var r=t.doc,i=t.display,o=e.from,a=e.to,s=!1,c=o.line;t.options.lineWrapping||(c=Jt(Ve(Gt(r,o.line))),r.iter(c,a.line+1,(function(t){if(t==i.maxLine)return s=!0,!0}))),r.sel.contains(e.from,e.to)>-1&&mt(t),Li(r,e,n,cr(t)),t.options.lineWrapping||(r.iter(c,o.line+e.text.length,(function(t){var e=We(t);e>i.maxLineLength&&(i.maxLine=t,i.maxLineLength=e,i.maxLineChanged=!0,s=!1)})),s&&(t.curOp.updateMaxLine=!0)),function(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;r--){var i=Gt(t,r).stateAfter;if(i&&(!(i instanceof ue)||r+i.lookAhead1||!(this.children[0]instanceof Oo))){var s=[];this.collapse(s),this.children=[new Oo(s)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e50){for(var a=i.lines.length%25+25,s=a;s10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=_("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Fe(t,e.line,e,n,o)||e.line!=n.line&&Fe(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ce=!0}o.addToHistory&&Hi(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var s,c=e.line,l=t.cm;if(t.iter(c,n.line+1,(function(r){l&&o.collapsed&&!l.options.lineWrapping&&Ve(r)==l.display.maxLine&&(s=!0),o.collapsed&&c!=e.line&&Xt(r,0),function(t,e,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&r.has(t.markedSpans)?t.markedSpans.push(e):(t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],r&&r.add(t.markedSpans)),e.marker.attachLine(t)}(r,new ke(o,c==e.line?e.ch:null,c==n.line?n.ch:null),t.cm&&t.cm.curOp),++c})),o.collapsed&&t.iter(e.line,n.line+1,(function(e){Be(t,e)&&Xt(e,0)})),o.clearOnEnter&&ht(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(xe=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++So,o.atomic=!0),l){if(s&&(l.curOp.updateMaxLine=!0),o.collapsed)hr(l,e.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=e.line;u<=n.line;u++)fr(l,u,"text");o.atomic&&ro(l.doc),ln(l,"markerAdded",l,o)}return o}jo.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Gr(t),yt(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;ot.display.maxLineLength&&(t.display.maxLine=l,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&hr(t,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&ro(t.doc)),t&&ln(t,"markerCleared",t,this,r,i),e&&Kr(t),this.parent&&this.parent.clear()}},jo.prototype.find=function(t,e){var n,r;null==t&&"bookmark"==this.type&&(t=1);for(var i=0;i=0;c--)uo(this,r[c]);s?Qi(this,s):this.cm&&Dr(this.cm)})),undo:ri((function(){fo(this,"undo")})),redo:ri((function(){fo(this,"redo")})),undoSelection:ri((function(){fo(this,"undo",!0)})),redoSelection:ri((function(){fo(this,"redo",!0)})),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,r=0;r=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=ce(this,t),e=ce(this,e);var r=[],i=t.line;return this.iter(t.line,e.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=c.to||null==c.from&&i!=t.line||null!=c.from&&i==e.line&&c.from>=e.ch||n&&!n(c.marker)||r.push(c.marker.parent||c.marker)}++i})),r},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var r=0;rt)return e=t,!0;t-=o,++n})),ce(this,ee(n,e))},indexFromPos:function(t){var e=(t=ce(this,t)).ch;if(t.linee&&(e=t.from),null!=t.to&&t.to-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var d=t.dataTransfer.getData("Text");if(d){var h;if(e.state.draggingText&&!e.state.draggingText.copy&&(h=e.listSelections()),eo(e.doc,ji(n,n)),h)for(var f=0;f=0;e--)vo(t.doc,"",r[e].from,r[e].to,"+delete");Dr(t)}))}function Qo(t,e,n){var r=ot(t.text,e+n,n);return r<0||r>t.text.length?null:r}function ta(t,e,n){var r=Qo(t,e.ch,n);return null==r?null:new ee(e.line,r,n<0?"after":"before")}function ea(t,e,n,r,i){if(t){"rtl"==e.doc.direction&&(i=-i);var o=ut(n,e.doc.direction);if(o){var a,s=i<0?Y(o):o[0],c=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var l=An(e,n);a=i<0?n.text.length-1:0;var u=Ln(e,l,a).top;a=at((function(t){return Ln(e,l,t).top==u}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==c&&(a=Qo(n,a,1))}else a=i<0?s.to:s.from;return new ee(r,a,c)}}return new ee(r,i<0?n.text.length:0,i<0?"before":"after")}$o.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},$o.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},$o.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},$o.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},$o["default"]=y?$o.macDefault:$o.pcDefault;var na={selectAll:co,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),U)},killLine:function(t){return Zo(t,(function(e){if(e.empty()){var n=Gt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0)i=new ee(i.line,i.ch+1),t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ee(i.line,i.ch-2),i,"+transpose");else if(i.line>t.doc.first){var a=Gt(t.doc,i.line-1).text;a&&(i=new ee(i.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),ee(i.line-1,a.length-1),i,"+transpose"))}n.push(new ki(i,i))}t.setSelections(n)}))},newlineAndIndent:function(t){return ti(t,(function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var r=0;r-1&&(ne((i=l.ranges[i]).from(),e)<0||e.xRel>0)&&(ne(i.to(),e)>0||e.xRel<0)?function(t,e,n,r){var i=t.display,o=!1,l=ei(t,(function(e){c&&(i.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:kr(t)),pt(i.wrapper.ownerDocument,"mouseup",l),pt(i.wrapper.ownerDocument,"mousemove",u),pt(i.scroller,"dragstart",d),pt(i.scroller,"drop",l),o||(wt(e),r.addNew||Yi(t.doc,n,null,null,r.extend),c&&!h||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},d=function(){return o=!0};c&&(i.scroller.draggable=!0),t.state.draggingText=l,l.copy=!r.moveOnDrag,ht(i.wrapper.ownerDocument,"mouseup",l),ht(i.wrapper.ownerDocument,"mousemove",u),ht(i.scroller,"dragstart",d),ht(i.scroller,"drop",l),t.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}(t,r,e,o):function(t,e,n,r){a&&kr(t);var i=t.display,o=t.doc;wt(e);var s,c,l=o.sel,u=l.ranges;if(r.addNew&&!r.extend?(c=o.sel.contains(n),s=c>-1?u[c]:new ki(n,n)):(s=o.sel.primary(),c=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new ki(n,n)),n=ur(t,e,!0,!0),c=-1;else{var d=ba(t,n,r.unit);s=r.extend?Ki(s,d.anchor,d.head,r.extend):d}r.addNew?-1==c?(c=u.length,to(o,Si(t,u.concat([s]),c),{scroll:!1,origin:"*mouse"})):u.length>1&&u[c].empty()&&"char"==r.unit&&!r.extend?(to(o,Si(t,u.slice(0,c).concat(u.slice(c+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Ji(o,c,s,$):(c=0,to(o,new Ci([s],0),$),l=o.sel);var h=n;function f(e){if(0!=ne(h,e))if(h=e,"rectangle"==r.unit){for(var i=[],a=t.options.tabSize,u=F(Gt(o,n.line).text,n.ch,a),d=F(Gt(o,e.line).text,e.ch,a),f=Math.min(u,d),p=Math.max(u,d),g=Math.min(n.line,e.line),v=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=v;g++){var m=Gt(o,g).text,y=q(m,f,a);f==p?i.push(new ki(ee(g,y),ee(g,y))):m.length>y&&i.push(new ki(ee(g,y),ee(g,q(m,p,a))))}i.length||i.push(new ki(n,n)),to(o,Si(t,l.ranges.slice(0,c).concat(i),c),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,w=s,O=ba(t,e,r.unit),x=w.anchor;ne(O.anchor,x)>0?(b=O.head,x=ae(w.from(),O.anchor)):(b=O.anchor,x=oe(w.to(),O.head));var C=l.ranges.slice(0);C[c]=function(t,e){var n=e.anchor,r=e.head,i=Gt(t.doc,n.line);if(0==ne(n,r)&&n.sticky==r.sticky)return e;var o=ut(i);if(!o)return e;var a=ct(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return e;var c,l=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==l||l==o.length)return e;if(r.line!=n.line)c=(r.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=ct(o,r.ch,r.sticky),d=u-a||(r.ch-n.ch)*(1==s.level?-1:1);c=u==l-1||u==l?d<0:d>0}var h=o[l+(c?-1:0)],f=c==(1==h.level),p=f?h.from:h.to,g=f?"after":"before";return n.ch==p&&n.sticky==g?e:new ki(new ee(n.line,p,g),r)}(t,new ki(ce(o,x),b)),to(o,Si(t,C,c),$)}}var p=i.wrapper.getBoundingClientRect(),g=0;function v(e){t.state.selectingText=!1,g=1/0,e&&(wt(e),i.input.focus()),pt(i.wrapper.ownerDocument,"mousemove",m),pt(i.wrapper.ownerDocument,"mouseup",y),o.history.lastSelOrigin=null}var m=ei(t,(function(e){0!==e.buttons&&St(e)?function e(n){var a=++g,s=ur(t,n,!0,"rectangle"==r.unit);if(s)if(0!=ne(s,h)){t.curOp.focus=D(),f(s);var c=Er(i,o);(s.line>=c.to||s.linep.bottom?20:0;l&&setTimeout(ei(t,(function(){g==a&&(i.scroller.scrollTop+=l,e(n))})),50)}}(e):v(e)})),y=ei(t,v);t.state.selectingText=y,ht(i.wrapper.ownerDocument,"mousemove",m),ht(i.wrapper.ownerDocument,"mouseup",y)}(t,r,e,o)}(e,r,o,t):kt(t)==n.scroller&&wt(t):2==i?(r&&Yi(e.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(C?e.display.input.onContextMenu(t):kr(e)))}}function ba(t,e,n){if("char"==n)return new ki(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new ki(ee(e.line,0),ce(t.doc,ee(e.line+1,0)));var r=n(t,e);return new ki(r.from,r.to)}function wa(t,e,n,r){var i,o;if(e.touches)i=e.touches[0].clientX,o=e.touches[0].clientY;else try{i=e.clientX,o=e.clientY}catch(t){return!1}if(i>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&wt(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!yt(t,n))return xt(e);o-=s.top-a.viewOffset;for(var c=0;c=i)return gt(t,n,t,Zt(t.doc,o),t.display.gutterSpecs[c].className,e),xt(e)}}function Oa(t,e){return wa(t,e,"gutterClick",!0)}function xa(t,e){Cn(t.display,e)||function(t,e){return!!yt(t,"gutterContextMenu")&&wa(t,e,"gutterContextMenu",!1)}(t,e)||vt(t,e,"contextmenu")||C||t.display.input.onContextMenu(e)}function Ca(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Hn(t)}ma.prototype.compare=function(t,e,n){return this.time+va>t&&0==ne(e,this.pos)&&n==this.button};var ka={toString:function(){return"CodeMirror.Init"}},Sa={},ja={};function Ta(t,e,n){if(!e!=!(n&&n!=ka)){var r=t.display.dragFunctions,i=e?ht:pt;i(t.display.scroller,"dragstart",r.start),i(t.display.scroller,"dragenter",r.enter),i(t.display.scroller,"dragover",r.over),i(t.display.scroller,"dragleave",r.leave),i(t.display.scroller,"drop",r.drop)}}function Pa(t){t.options.lineWrapping?(A(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(j(t.display.wrapper,"CodeMirror-wrap"),qe(t)),lr(t),hr(t),Hn(t),setTimeout((function(){return Br(t)}),100)}function Ea(t,e){var n=this;if(!(this instanceof Ea))return new Ea(t,e);this.options=e=e?I(e):{},I(Sa,e,!1);var r=e.value;"string"==typeof r?r=new Do(r,e.mode,null,e.lineSeparator,e.direction):e.mode&&(r.modeOption=e.mode),this.doc=r;var i=new Ea.inputStyles[e.inputStyle](this),o=this.display=new mi(t,r,i,e);for(var l in o.wrapper.CodeMirror=this,Ca(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new V,keySeq:null,specialChars:null},e.autofocus&&!m&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(t){var e=t.display;ht(e.scroller,"mousedown",ei(t,ya)),ht(e.scroller,"dblclick",a&&s<11?ei(t,(function(e){if(!vt(t,e)){var n=ur(t,e);if(n&&!Oa(t,e)&&!Cn(t.display,e)){wt(e);var r=t.findWordAt(n);Yi(t.doc,r.anchor,r.head)}}})):function(e){return vt(t,e)||wt(e)}),ht(e.scroller,"contextmenu",(function(e){return xa(t,e)})),ht(e.input.getField(),"contextmenu",(function(n){e.scroller.contains(n.target)||xa(t,n)}));var n,r={end:0};function i(){e.activeTouch&&(n=setTimeout((function(){return e.activeTouch=null}),1e3),(r=e.activeTouch).end=+new Date)}function o(t,e){if(null==e.left)return!0;var n=e.left-t.left,r=e.top-t.top;return n*n+r*r>20*20}ht(e.scroller,"touchstart",(function(i){if(!vt(t,i)&&!function(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}(i)&&!Oa(t,i)){e.input.ensurePolled(),clearTimeout(n);var o=+new Date;e.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(e.activeTouch.left=i.touches[0].pageX,e.activeTouch.top=i.touches[0].pageY)}})),ht(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),ht(e.scroller,"touchend",(function(n){var r=e.activeTouch;if(r&&!Cn(e,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,s=t.coordsChar(e.activeTouch,"page");a=!r.prev||o(r,r.prev)?new ki(s,s):!r.prev.prev||o(r,r.prev.prev)?t.findWordAt(s):new ki(ee(s.line,0),ce(t.doc,ee(s.line+1,0))),t.setSelection(a.anchor,a.head),t.focus(),wt(n)}i()})),ht(e.scroller,"touchcancel",i),ht(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(Rr(t,e.scroller.scrollTop),Fr(t,e.scroller.scrollLeft,!0),gt(t,"scroll",t))})),ht(e.scroller,"mousewheel",(function(e){return xi(t,e)})),ht(e.scroller,"DOMMouseScroll",(function(e){return xi(t,e)})),ht(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){vt(t,e)||Ct(e)},over:function(e){vt(t,e)||(function(t,e){var n=ur(t,e);if(n){var r=document.createDocumentFragment();br(t,n,r),t.display.dragCursor||(t.display.dragCursor=E("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),P(t.display.dragCursor,r)}}(t,e),Ct(e))},start:function(e){return function(t,e){if(a&&(!t.state.draggingText||+new Date-Ao<100))Ct(e);else if(!vt(t,e)&&!Cn(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!h)){var n=E("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}(t,e)},drop:ei(t,Lo),leave:function(e){vt(t,e)||No(t)}};var c=e.input.getField();ht(c,"keyup",(function(e){return ha.call(t,e)})),ht(c,"keydown",ei(t,da)),ht(c,"keypress",ei(t,fa)),ht(c,"focus",(function(e){return Sr(t,e)})),ht(c,"blur",(function(e){return jr(t,e)}))}(this),Fo(),Gr(this),this.curOp.forceUpdate=!0,Ri(this,r),e.autofocus&&!m||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Sr(n)}),20):jr(this),ja)ja.hasOwnProperty(l)&&ja[l](this,e[l],ka);fi(this),e.finishInit&&e.finishInit(this);for(var u=0;u<_a.length;++u)_a[u](this);Kr(this),c&&e.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Ea.defaults=Sa,Ea.optionHandlers=ja;var _a=[];function Ma(t,e,n,r){var i,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=pe(t,e).state:n="prev");var a=t.options.tabSize,s=Gt(o,e),c=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var l,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((l=o.mode.indent(i,s.text.slice(u.length),s.text))==B||l>150)){if(!r)return;n="prev"}}else l=0,n="not";"prev"==n?l=e>o.first?F(Gt(o,e-1).text,null,a):0:"add"==n?l=c+t.options.indentUnit:"subtract"==n?l=c-t.options.indentUnit:"number"==typeof n&&(l=c+n),l=Math.max(0,l);var d="",h=0;if(t.options.indentWithTabs)for(var f=Math.floor(l/a);f;--f)h+=a,d+="\t";if(ha,c=Dt(e),l=null;if(s&&r.ranges.length>1)if(Da&&Da.text.join("\n")==e){if(r.ranges.length%Da.text.length==0){l=[];for(var u=0;u=0;h--){var f=r.ranges[h],p=f.from(),g=f.to();f.empty()&&(n&&n>0?p=ee(p.line,p.ch-n):t.state.overwrite&&!s?g=ee(g.line,Math.min(Gt(o,g.line).text.length,g.ch+Y(c).length)):s&&Da&&Da.lineWise&&Da.text.join("\n")==c.join("\n")&&(p=g=ee(p.line,0)));var v={from:p,to:g,text:l?l[h%l.length]:c,origin:i||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};uo(t.doc,v),ln(t,"inputRead",t,v)}e&&!s&&Ra(t,e),Dr(t),t.curOp.updateInput<2&&(t.curOp.updateInput=d),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Na(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||ti(e,(function(){return La(e,n,0,null,"paste")})),!0}function Ra(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=t.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Ma(t,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Gt(t.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Ma(t,i.head.line,"smart"));a&&ln(t,"electricInput",t,i.head.line)}}}function Ia(t){for(var e=[],n=[],r=0;r0?0:-1));if(isNaN(u))a=null;else{var d=n>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new ee(e.line,Math.max(0,Math.min(s.text.length,e.ch+n*(d?2:1))),-n)}}else a=i?function(t,e,n,r){var i=ut(e,t.doc.direction);if(!i)return ta(e,n,r);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ct(i,n.ch,n.sticky),a=i[o];if("ltr"==t.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&h>=u.begin)){var f=d?"before":"after";return new ee(n.line,h,f)}}var p=function(t,e,r){for(var o=function(t,e){return e?new ee(n.line,c(t,1),"before"):new ee(n.line,t,"after")};t>=0&&t0==(1!=a.level),l=s?r.begin:c(r.end,-1);if(a.from<=l&&l0?u.end:c(u.begin,-1);return null==v||r>0&&v==e.text.length||!(g=p(r>0?0:i.length-1,r,l(v)))?null:g}(t.cm,s,e,n):ta(s,e,n);if(null==a){if(o||(l=e.line+c)=t.first+t.size||(e=new ee(l,e.ch,e.sticky),!(s=Gt(t,l))))return!1;e=ea(i,t.cm,s,e.line,c)}else e=a;return!0}if("char"==r||"codepoint"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var u=null,d="group"==r,h=t.cm&&t.cm.getHelper(e,"wordChars"),f=!0;!(n<0)||l(!f);f=!1){var p=s.text.charAt(e.ch)||"\n",g=et(p,h)?"w":d&&"\n"==p?"n":!d||/\s/.test(p)?null:"p";if(!d||f||g||(g="s"),u&&u!=g){n<0&&(n=1,l(),e.sticky="after");break}if(g&&(u=g),n>0&&!l(!f))break}var v=ao(t,e,o,a,!0);return re(o,v)&&(v.hitSide=!0),v}function Ha(t,e,n,r){var i,o,a=t.doc,s=e.left;if("page"==r){var c=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(c-.5*ir(t.display),3);i=(n>0?e.bottom:e.top)+n*l}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(;(o=Jn(t,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Ba=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new V,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ua(t,e){var n=Dn(t,e.line);if(!n||n.hidden)return null;var r=Gt(t.doc,e.line),i=_n(n,r,e.line),o=ut(r,t.doc.direction),a="left";o&&(a=ct(o,e.ch)%2?"right":"left");var s=In(i.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function $a(t,e){return e&&(t.bad=!0),t}function Wa(t,e,n){var r;if(e==t.display.lineDiv){if(!(r=t.display.lineDiv.childNodes[n]))return $a(t.clipPos(ee(t.display.viewTo-1)),!0);e=null,n=0}else for(r=e;;r=r.parentNode){if(!r||r==t.display.lineDiv)return null;if(r.parentNode&&r.parentNode==t.display.lineDiv)break}for(var i=0;i=e.display.viewTo||o.line=e.display.viewFrom&&Ua(e,i)||{node:c[0].measure.map[2],offset:0},u=o.liner.firstLine()&&(a=ee(a.line-1,Gt(r.doc,a.line-1).length)),s.ch==Gt(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(t=dr(r,a.line))?(e=Jt(i.view[0].line),n=i.view[0].node):(e=Jt(i.view[t].line),n=i.view[t-1].node.nextSibling);var c,l,u=dr(r,s.line);if(u==i.view.length-1?(c=i.viewTo-1,l=i.lineDiv.lastChild):(c=Jt(i.view[u+1].line)-1,l=i.view[u+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(t,e,n,r,i){var o="",a=!1,s=t.doc.lineSeparator(),c=!1;function l(){a&&(o+=s,c&&(o+=s),a=c=!1)}function u(t){t&&(l(),o+=t)}function d(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void u(n);var o,h=e.getAttribute("cm-marker");if(h){var f=t.findMarks(ee(r,0),ee(i+1,0),(v=+h,function(t){return t.id==v}));return void(f.length&&(o=f[0].find(0))&&u(Kt(t.doc,o.from,o.to).join(s)))}if("false"==e.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;p&&l();for(var g=0;g1&&h.length>1;)if(Y(d)==Y(h))d.pop(),h.pop(),c--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),e++}for(var f=0,p=0,g=d[0],v=h[0],m=Math.min(g.length,v.length);fa.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)f--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var O=ee(e,f),x=ee(c,h.length?Y(h).length-p:0);return d.length>1||d[0]||ne(O,x)?(vo(r.doc,d,O,x,"+input"),!0):void 0},Ba.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ba.prototype.reset=function(){this.forceCompositionEnd()},Ba.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ba.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()}),80))},Ba.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||ti(this.cm,(function(){return hr(t.cm)}))},Ba.prototype.setUneditable=function(t){t.contentEditable="false"},Ba.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||ei(this.cm,La)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Ba.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Ba.prototype.onContextMenu=function(){},Ba.prototype.resetPosition=function(){},Ba.prototype.needsContentAttribute=!0;var Ga=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new V,this.hasSelection=!1,this.composing=null};Ga.prototype.init=function(t){var e=this,n=this,r=this.cm;this.createField(t);var i=this.textarea;function o(t){if(!vt(r,t)){if(r.somethingSelected())Aa({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=Ia(r);Aa({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,U):(n.prevInput="",i.value=e.text.join("\n"),N(i))}"cut"==t.type&&(r.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),g&&(i.style.width="0px"),ht(i,"input",(function(){a&&s>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),ht(i,"paste",(function(t){vt(r,t)||Na(t,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),ht(i,"cut",o),ht(i,"copy",o),ht(t.scroller,"paste",(function(e){if(!Cn(t,e)&&!vt(r,e)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=e.clipboardData,i.dispatchEvent(o)}})),ht(t.lineSpace,"selectstart",(function(e){Cn(t,e)||wt(e)})),ht(i,"compositionstart",(function(){var t=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}})),ht(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Ga.prototype.createField=function(t){this.wrapper=Va(),this.textarea=this.wrapper.firstChild},Ga.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute('aria-label',t):this.textarea.removeAttribute('aria-label')},Ga.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=yr(t);if(t.options.moveInputWithCursor){var i=Kn(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Ga.prototype.showSelection=function(t){var e=this.cm.display;P(e.cursorDiv,t.cursors),P(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},Ga.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&N(this.textarea),a&&s>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},Ga.prototype.getField=function(){return this.textarea},Ga.prototype.supportsTouch=function(){return!1},Ga.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||D()!=this.textarea))try{this.textarea.focus()}catch(t){}},Ga.prototype.blur=function(){this.textarea.blur()},Ga.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ga.prototype.receivedFocus=function(){this.slowPoll()},Ga.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},Ga.prototype.fastPoll=function(){var t=!1,e=this;e.pollingFast=!0,e.polling.set(20,(function n(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}))},Ga.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||At(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var i=n.value;if(i==r&&!e.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var c=0,l=Math.min(r.length,i.length);c1e3||i.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=i,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Ga.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ga.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Ga.prototype.onContextMenu=function(t){var e=this,n=e.cm,r=n.display,i=e.textarea;e.contextMenuPending&&e.contextMenuPending();var o=ur(n,t),l=r.scroller.scrollTop;if(o&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ei(n,to)(n.doc,ji(o),U);var u,h=i.style.cssText,f=e.wrapper.style.cssText,p=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-p.top-5)+"px; left: "+(t.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",c&&(u=window.scrollY),r.input.focus(),c&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=e.prevInput=" "),e.contextMenuPending=m,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&v(),C){Ct(t);var g=function(){pt(window,"mouseup",g),setTimeout(m,20)};ht(window,"mouseup",g)}else setTimeout(m,50)}function v(){if(null!=i.selectionStart){var t=n.somethingSelected(),o="​"+(t?i.value:"");i.value="⇚",i.value=o,e.prevInput=t?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function m(){if(e.contextMenuPending==m&&(e.contextMenuPending=!1,e.wrapper.style.cssText=f,i.style.cssText=h,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),null!=i.selectionStart)){(!a||a&&s<9)&&v();var t=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==e.prevInput?ei(n,co)(n):t++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},Ga.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},Ga.prototype.setUneditable=function(){},Ga.prototype.needsContentAttribute=!1,function(t){var e=t.optionHandlers;function n(n,r,i,o){t.defaults[n]=r,i&&(e[n]=o?function(t,e,n){n!=ka&&i(t,e,n)}:i)}t.defineOption=n,t.Init=ka,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,Mi(t)}),!0),n("indentUnit",2,Mi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){Di(t),Hn(t),hr(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],r=t.doc.first;t.doc.iter((function(t){for(var i=0;;){var o=t.text.indexOf(e,i);if(-1==o)break;i=o+e.length,n.push(ee(r,o))}r++}));for(var i=n.length-1;i>=0;i--)vo(t.doc,e,n[i],ee(n[i].line,n[i].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=ka&&t.refresh()})),n("specialCharPlaceholder",Qe,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",m?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){Ca(t),vi(t)}),!0),n("keyMap","default",(function(t,e,n){var r=Jo(e),i=n!=ka&&Jo(n);i&&i.detach&&i.detach(t,r),r.attach&&r.attach(t,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Pa,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=pi(e,t.options.lineNumbers),vi(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?sr(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return Br(t)}),!0),n("scrollbarStyle","native",(function(t){Wr(t),Br(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=pi(t.options.gutters,e),vi(t)}),!0),n("firstLineNumber",1,vi,!0),n("lineNumberFormatter",(function(t){return t}),vi,!0),n("showCursorWhenSelecting",!1,mr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(jr(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=''===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,Ta),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,mr,!0),n("singleCursorHeightPerLine",!0,mr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Di,!0),n("addModeClass",!1,Di,!0),n("pollInterval",100),n("undoDepth",200,(function(t,e){return t.doc.history.undoDepth=e})),n("historyEventDelay",1250),n("viewportMargin",10,(function(t){return t.refresh()}),!0),n("maxHighlightLength",1e4,Di,!0),n("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),n("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),n("autofocus",null),n("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),n("phrases",null)}(Ea),function(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,n){var r=this.options,i=r[t];r[t]==n&&"mode"!=t||(r[t]=n,e.hasOwnProperty(t)&&ei(this,e[t])(this,n,i),gt(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](Jo(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;nn&&(Ma(this,i.head.line,t,!0),n=i.head.line,r==this.doc.sel.primIndex&&Dr(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var c=s;c0&&Ji(this.doc,r,new ki(o,l[r].to()),U)}}})),getTokenAt:function(t,e){return be(this,t,e)},getLineTokens:function(t,e){return be(this,ee(t),e,!0)},getTokenTypeAt:function(t){t=ce(this.doc,t);var e,n=fe(this,Gt(this.doc,t.line)),r=0,i=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(t=o,i=!0),r=Gt(this.doc,t)}else r=t;return Wn(this,r,{top:0,left:0},e||"page",n||i).top+(i?this.doc.height-$e(r):0)},defaultTextHeight:function(){return ir(this.display)},defaultCharWidth:function(){return or(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,i){var o,a,s,c=this.display,l=(t=Kn(this,ce(this.doc,t))).bottom,u=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),c.sizer.appendChild(e),"over"==r)l=t.top;else if("above"==r||"near"==r){var d=Math.max(c.wrapper.clientHeight,this.doc.height),h=Math.max(c.sizer.clientWidth,c.lineSpace.clientWidth);('above'==r||t.bottom+e.offsetHeight>d)&&t.top>e.offsetHeight?l=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=d&&(l=t.bottom),u+e.offsetWidth>h&&(u=h-e.offsetWidth)}e.style.top=l+"px",e.style.left=e.style.right="","right"==i?(u=c.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(c.sizer.clientWidth-e.offsetWidth)/2),e.style.left=u+"px"),n&&(o=this,a={left:u,top:l,right:u+e.offsetWidth,bottom:l+e.offsetHeight},null!=(s=_r(o,a)).scrollTop&&Rr(o,s.scrollTop),null!=s.scrollLeft&&Fr(o,s.scrollLeft))},triggerOnKeyDown:ni(da),triggerOnKeyPress:ni(fa),triggerOnKeyUp:ha,triggerOnMouseDown:ni(ya),execCommand:function(t){if(na.hasOwnProperty(t))return na[t].call(null,this)},triggerElectric:ni((function(t){Ra(this,t)})),findPosH:function(t,e,n,r){var i=1;e<0&&(i=-1,e=-e);for(var o=ce(this.doc,t),a=0;a0&&a(e.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&lr(this),gt(this,"refresh",this)})),swapDoc:ni((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),Ri(this,t),Hn(this),this.display.input.reset(),Ar(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,e),e})),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},bt(t),t.registerHelper=function(e,r,i){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][r]=i},t.registerGlobalHelper=function(e,r,i,o){t.registerHelper(e,r,o),n[e]._global.push({pred:i,val:o})}}(Ea);var Ka="iter insert remove copy getEditor constructor".split(" ");for(var Ya in Do.prototype)Do.prototype.hasOwnProperty(Ya)&&z(Ka,Ya)<0&&(Ea.prototype[Ya]=function(t){return function(){return t.apply(this.doc,arguments)}}(Do.prototype[Ya]));return bt(Do),Ea.inputStyles={textarea:Ga,contenteditable:Ba},Ea.defineMode=function(t){Ea.defaults.mode||"null"==t||(Ea.defaults.mode=t),Ft.apply(this,arguments)},Ea.defineMIME=function(t,e){It[t]=e},Ea.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Ea.defineMIME("text/plain","null"),Ea.defineExtension=function(t,e){Ea.prototype[t]=e},Ea.defineDocExtension=function(t,e){Do.prototype[t]=e},Ea.fromTextArea=function(t,e){if((e=e?I(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=D();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function r(){t.value=s.getValue()}var i;if(t.form&&(ht(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(t){}}e.finishInit=function(n){n.save=r,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,r(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(pt(t.form,"submit",r),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=i))}},t.style.display="none";var s=Ea((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return s},function(t){t.off=pt,t.on=ht,t.wheelEventPixels=Oi,t.Doc=Do,t.splitLines=Dt,t.countColumn=F,t.findColumn=q,t.isWordChar=tt,t.Pass=B,t.signal=gt,t.Line=Ge,t.changeEnd=Ti,t.scrollbarModel=$r,t.Pos=ee,t.cmpPos=ne,t.modes=Rt,t.mimeModes=It,t.resolveMode=Vt,t.getMode=zt,t.modeExtensions=Ht,t.extendMode=Bt,t.copyState=Ut,t.startState=Wt,t.innerMode=$t,t.commands=na,t.keyMap=$o,t.keyName=Xo,t.isModifierKey=Ko,t.lookupKey=Go,t.normalizeKeyMap=qo,t.StringStream=qt,t.SharedTextMarker=Po,t.TextMarker=jo,t.LineWidget=Co,t.e_preventDefault=wt,t.e_stopPropagation=Ot,t.e_stop=Ct,t.addClass=A,t.contains=M,t.rmClass=j,t.keyNames=zo}(Ea),Ea.version="5.63.0",Ea}())},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(13);e["default"]=i.a.View.extend({initialize:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix||'',this.target=t.target||{},this.propTarget=t.propTarget||{},this.onChange=t.onChange,this.onInputRender=t.onInputRender||{},this.customValue=t.customValue||{},this.properties=[];var e=this.collection;this.listenTo(e,'add',this.addTo),this.listenTo(e,'reset',this.render)},addTo:function(t,e,n){this.add(t,null,n)},add:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e||this.el,i=new t.typeView({model:t,name:t.get('name'),id:this.pfx+t.get('property'),target:this.target,propTarget:this.propTarget,onChange:this.onChange,onInputRender:this.onInputRender,config:this.config});'composite'!=t.get('type')&&(i.customValue=this.customValue),i.render();var a=i.el;this.properties.push(i),i.updateVisibility(),Object(o["b"])(r,a,n.at)},render:function(){var t=this,e=this.$el;this.clearItems();var n=document.createDocumentFragment();return this.collection.each((function(e){return t.add(e,n)})),e.empty(),e.append(n),e.attr('class',"".concat(this.pfx,"properties")),this},remove:function(){i.a.View.prototype.remove.apply(this,arguments),this.clearItems()},clearItems:function(){this.properties.forEach((function(t){return t.remove()})),this.properties=[]}})},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n.n(i);e["a"]=o.a.View.extend({itemView:'',itemsView:'',itemType:'type',autoAdd:0,initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;this.config=e||t.config||{},this.autoAdd&&this.listenTo(this.collection,'add',this.addTo),this.items=[],this.init()},init:function(){},addTo:function(t){this.add(t)},itemViewNotFound:function(t){var e=this.config,n=this.ns,r=e.em,i="".concat(n?"[".concat(n,"]: "):'',"'").concat(t,"' type not found");r&&r.logWarning(i)},add:function(t,e){var n,i=this.config,o=this.reuseView,a=this.items,s=this.itemsView,c=void 0===s?{}:s,l=e||null,u=this.itemView,d=t.get(this.itemType);c[d]?u=c[d]:!d||c[d]||Object(r["includes"])(['button','checkbox','color','date','datetime-local','email','file','hidden','image','month','number','password','radio','range','reset','search','submit','tel','text','time','url','week'],d)||this.itemViewNotFound(d),n=t.view&&o?t.view:new u({model:t,config:i},i),a&&a.push(n);var h=n.render().el;l?l.appendChild(h):this.$el.append(h)},render:function(){var t=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each((function(e){this.add(e,t)}),this),this.$el.append(t),this.onRender(),this},onRender:function(){},onRemoveBefore:function(){},onRemove:function(){},remove:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.items;this.onRemoveBefore(e,t),this.clearItems(),o.a.View.prototype.remove.apply(this,arguments),this.onRemove(e,t)},clearItems:function(){this.items}})},function(t,e,n){"use strict";var r=n(14),i=n.n(r),o=n(11),a=n.n(o),s=n(3),c=n.n(s),l=n(21),u=n.n(l),d=n(2),h=n.n(d),f=n(0),p=n(10),g=["at"];function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function m(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:[],r=e||[];return r.forEach((function(e){n.push(e.getId()),t(e.components(),n)})),n},b=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.map((function(e){n.push(e.getId()),t(e.components(),n)})),n};e["a"]=h.a.Collection.extend({initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.opt=e,this.listenTo(this,'add',this.onAdd),this.listenTo(this,'remove',this.removeChildren),this.listenTo(this,'reset',this.resetChildren);var n=e.em,r=e.config;this.config=r,this.em=n,this.domc=e.domc||n&&n.get('DomComponents')},resetChildren:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this,i=n.previousModels||[],o=i.filter((function(e){return!t.get(e.cid)})),a=b(t);n.keepIds=y(i).filter((function(t){return a.indexOf(t)>=0})),o.forEach((function(t){return e.removeChildren(t,r,n)})),t.each((function(t){return e.onAdd(t)}))},removeChildren:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t){var i=this.domc,o=this.em,a=i?i.allById():{},s=r.temporary;if(t.prevColl=this,!s){var c=t.getId(),l=o.get('SelectorManager').getAll(),u=o.get('CssComposer').getAll(),d=(r.keepIds||[]).indexOf(c)<0;delete a[c];var h=d?u.remove(u.filter((function(t){return t.getSelectors().getFullString()==="#".concat(c)})),r):[];l.remove(h.map((function(t){return t.getSelectors().at(0)}))),t.opt.temporary||(o.get('Commands').run('core:component-style-clear',{target:t}),t.removed(),t.trigger('removed'),o.trigger('component:remove',t));var f=t.components();f.forEach((function(t){return n.removeChildren(t,e,r)}))}var p=t.components();o.stopListening(p),o.stopListening(t),o.stopListening(t.get('classes')),t.__postRemove()}},model:function(t,e){var n,r=e.collection.opt,i=r.em,o=i.get('DomComponents').componentTypes;e.em=i,e.config=r.config,e.componentTypes=o,e.domc=r.domc;for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=this.domc,i=n.get('CssComposer'),o=n.get('Parser').parseHtml(t);if(p["a"].checkId(o.html,o.css,r.componentsById,e),o.css&&i&&!e.temporary){e.at;var a=u()(e,g);i.addCollection(o.css,m(m({},a),{},{extend:1}))}return o.html},add:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.parent;n.keepIds=y(n.previousModels),Object(f["isString"])(t)?t=this.parseString(t,n):Object(f["isArray"])(t)&&(t=a()(t)).forEach((function(r,i){if(Object(f["isString"])(r)){var o=e.parseString(r,n);t[i]=Object(f["isArray"])(o)&&!o.length?null:o}}));var r=Object(f["isArray"])(t);t=(r?t:[t]).filter((function(t){return t})).map((function(t){return e.processDef(t)})),t=r?Object(f["flatten"])(t,1):t[0];var i=h.a.Collection.prototype.add.apply(this,[t,n]);return this.__firstAdd=i,i},processDef:function(t){if(t.cid&&t.ccid)return t;var e=this.em,n=this.config,r=(void 0===n?{}:n).processor,o=t;if(r){var a=r(o=m({},o));a&&(Object(f["each"])(o,(function(t,e){return delete o[e]})),Object(f["extend"])(o,a))}if(o.$$typeof&&'object'==i()(o.props)){(o=m({},o)).props=m({},o.props);var s=e.get('DomComponents'),c=e.get('Parser').parserHtml;Object(f["each"])(o,(function(t,e){Object(f["includes"])(['props','type'],e)||delete o[e]}));var l=o.props,u=l.children;delete l.children,delete o.props;var d=c.splitPropsFromAttr(l);o.attributes=d.attrs,u&&(o.components=u),o.type?s.getType(o.type)||(o.tagName=o.type,delete o.type):o.type='textnode',Object(f["extend"])(o,d.props)}return o},onAdd:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.domc,i=this.em,o=t.getStyle(),a=i&&i.getConfig('avoidInlineStyle');if(r&&r.Component.ensureInList(t),!Object(f["isEmpty"])(o)&&!a&&i&&i.get&&i.getConfig('forceClass')&&!n.temporary){var s=t.cid;i.get('CssComposer').setClassRule(s,o);t.setStyle({}),t.addClass(s)}t.__postAdd({recursive:1}),this.__onAddEnd()},__onAddEnd:Object(f["debounce"])((function(){}))})},function(t,e,n){"use strict";n.r(e);var r=n(2);e["default"]=r["Model"].extend({initialize:function(t){this.config=t||{},this.editorModel=this.em=this.config.em||{},this.pfx=this.config.stylePrefix,this.ppfx=this.config.pStylePrefix,this.hoverClass=this.pfx+'hover',this.badgeClass=this.pfx+'badge',this.plhClass=this.pfx+'placeholder',this.freezClass=this.ppfx+'freezed',this.canvas=this.em.get&&this.em.get('Canvas'),this.init(this.config)},onFrameScroll:function(t){},getCanvas:function(){return this.canvas.getElement()},getCanvasBody:function(){return this.canvas.getBody()},getCanvasTools:function(){return this.canvas.getToolsEl()},offset:function(t){var e=t.getBoundingClientRect();return{top:e.top+t.ownerDocument.body.scrollTop,left:e.left+t.ownerDocument.body.scrollLeft}},init:function(t){},callRun:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.id;if(t.trigger("run:".concat(n,":before"),e),!e||!e.abort){var r=e.sender||t,i=this.run(t,r,e);return t.trigger("run:".concat(n),i,e),t.trigger('run',n,i,e),i}t.trigger("abort:".concat(n),e)},callStop:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.id,r=e.sender||t;t.trigger("stop:".concat(n,":before"),e);var i=this.stop(t,r,e);return t.trigger("stop:".concat(n),i,e),t.trigger('stop',n,i,e),i},stopCommand:function(){this.em.get('Commands').stop(this.id)},run:function(t,e){},stop:function(t,e){}})},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(0),a=n(1),s=n(43);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function l(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(o["isString"])(e)&&(e=u(e));var r=this.getStyle(n),i=l({},e);this.set('style',i,n);var s=Object(a["shallowDiff"])(r,i);return Object(o["keys"])(s).forEach((function(e){var n=t.em;t.trigger("change:style:".concat(e)),n&&(n.trigger("styleable:change",t,e),n.trigger("styleable:change:".concat(e),t,e))})),i},addStyle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'',n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};'string'==typeof t?t={prop:e}:n=e||{},t=this.extendStyle(t),this.setStyle(t,n)},removeStyle:function(t){var e=this.getStyle();delete e[t],this.setStyle(e)},styleToString:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=this.getStyle(t);for(var r in n){var i=t.important,a=Object(o["isArray"])(i)?i.indexOf(r)>=0:i,s="".concat(n[r]).concat(a?' !important':''),c='__'==r.substr(0,2);s&&!c&&e.push("".concat(r,":").concat(s,";"))}return e.join('')},getSelectors:function(){return this.get('selectors')||this.get('classes')},getSelectorsString:function(){return this.selectorsToString?this.selectorsToString():this.getSelectors().getFullString()}}},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r),o=n(2),a=n.n(o),s=n(37),c=n(5),l=n.n(c),u=n(6),d=n.n(u),h=n(8),f=n.n(h),p=n(9),g=n.n(p),v=n(4),m=n.n(v),y=n(0),b=n(1);function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function O(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.get('id')||'',i=this.get('name')||'';!this.get('property')&&this.set('property',(i||r).replace(/ /g,'-'));var o=this.get('property');!this.get('id')&&this.set('id',o),!i&&this.set('name',Object(b["capitalize"])(o).replace(/-/g,' ')),n.callInit(this,t,e)}},{key:"init",value:function(){}},{key:"getId",value:function(){return this.get('id')}},{key:"getType",value:function(){return this.get('type')}},{key:"getName",value:function(){return this.get('property')}},{key:"getLabel",value:function(){return this.get('name')}},{key:"getValue",value:function(){var t=this.get('value');return Object(y["isUndefined"])(t)?this.getDefaultValue():t}},{key:"clearValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.set({value:void 0,status:''},t),this}},{key:"setValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.parseValue(t),i=!e;!i&&this.set({value:void 0},{avoidStore:i,silent:!0}),this.set(r,O({avoidStore:i},n))}},{key:"setValueFromInput",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.setValue(t,e,O(O({},n),{},{fromInput:1}))}},{key:"parseValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={value:t},r='!important';if(Object(y["isString"])(t)&&-1!==t.indexOf(r)&&(n.value=t.replace(r,'').trim(),n.important=1),!this.get('functionName')&&!e.complete)return n;var i=[],o="".concat(n.value),a=o.indexOf('(')+1,s=o.lastIndexOf(')'),c=o.substring(0,a-1);if(c&&(n.functionName=c),i.push(a),s>=0&&i.push(s),n.value=String.prototype.substring.apply(o,i),e.numeric){var l=parseFloat(n.value);n.unit=n.value.replace(l,''),n.value=l}return n}},{key:"splitValues",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:',',n=[],r='(',i=')',o='',a=0;return(t||'').split('').forEach((function(t){t==r?(a++,o+=r):t==i&&a>0?(a--,o+=i):t===e&&0==a?(n.push(o),o=''):o+=t})),''!==o&&n.push(o),n.map((function(t){return t.trim()}))}},{key:"getDefaultValue",value:function(){return this.get('defaults')}},{key:"getFullValue",value:function(t){var e=this.get('functionName'),n=this.getDefaultValue(),r=Object(y["isUndefined"])(t)?this.get('value'):t,i=!Object(y["isUndefined"])(r)&&''!==r;if(r&&n&&r===n)return n;if(e&&i){var o='url'===e?"'".concat(r.replace(/'/g,''),"'"):r;r="".concat(e,"(").concat(o,")")}return i&&this.get('important')&&(r="".concat(r," !important")),r||''}}]),n}(o["Model"]);function k(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function S(t){for(var e=1;e3&&void 0!==arguments[3]?arguments[3]:{};t.prototype.initialize.apply(e,[n,O(O({},r),{},{skipInit:1})])},C.callInit=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!n.skipInit&&t.init(e,n)},C.getDefaults=function(){return Object(y["result"])(this.prototype,'defaults')},C.prototype.defaults={name:'',property:'',type:'',defaults:'',info:'',value:'',icon:'',functionName:'',status:'',visible:!0,fixedValues:['initial','inherit'],full:0,important:0,toRequire:0,requires:null,requiresParent:null};var j=C.extend({defaults:S(S({},C.prototype.defaults),{},{detached:0,properties:[],separator:' '}),initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};C.callParentInit(C,this,t,e);var r=this.get('properties')||[],i=n(32).default;this.set('properties',new i(r)),this.listenTo(this,'change:value',this.updateValues),C.callInit(this,t,e)},clearValue:function(){return this.get('properties').each((function(t){return t.clearValue()})),C.prototype.clearValue.apply(this,arguments)},updateValues:function(){var t=this.getFullValue().split(this.getSplitSeparator());this.get('properties').each((function(e,n){var r=t.length;t[n]||t[n%r+(1!=r&&r%2?1:0)]}))},getSplitSeparator:function(){return new RegExp("".concat(this.get('separator'),"(?![^\\(]*\\))"))},getDefaultValue:function(t){var e=this.get('defaults');return e&&!t?e:(e='',this.get('properties').each((function(t,n){return e+="".concat(t.getDefaultValue()," ")})),e.trim())},getFullValue:function(){return this.get('detached')?'':this.get('properties').getFullValue()},getPropertyAt:function(t){return this.get('properties').at(t)}}),T=a.a.Model.extend({defaults:{index:'',value:'',values:{},active:!1,preview:!1,properties:[]},initialize:function(){var t=this.get('properties'),e=this.get('value');this.set('properties',t instanceof Mt?t:new Mt(t));var n=this.get('properties');if(n.forEach(this.onPropAdd,this),this.listenTo(n,'add',this.onPropAdd),!e){var r='',i=this.get('values');for(var o in i)r+=' '+i[o];this.set('value',r.trim())}},onPropAdd:function(t){var e=this.collection;t.parent=e&&e.property},getPropertyAt:function(t){return this.get('properties').at(t)},getPropertyValue:function(t){var e='';return this.get('properties').each((function(n){n.get('property')==t&&(e=n.getFullValue())})),e},getFullValue:function(){var t=[];return this.get('properties').each((function(e){return t.push(e.getFullValue())})),t.join(' ').trim()}});function P(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function E(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};j.callParentInit(j,this,t,e);var n=this.get('layers'),r=new _(n);r.property=this,r.properties=this.get('properties'),this.set('layers',r),j.callInit(this,t,e)},getLayers:function(){return this.get('layers')},getCurrentLayer:function(){return this.getLayers().filter((function(t){return t.get('active')}))[0]},getFullValue:function(){return this.get('detached')?'':this.get('layers').getFullValue()},getValueFromStyle:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getLayers().getLayersFromStyle(t);return new _(e).getFullValue()},clearValue:function(){return this.getLayers().reset(),j.prototype.clearValue.apply(this,arguments)},getValueFromTarget:function(t){var e=this.attributes,n=e.detached,r=e.property,i=e.properties,o=t.getStyle(),a={};return i.forEach((function(t){var e=t.get('property'),n=o[e];n&&(a[e]=n)})),n?Object(y["keys"])(a).length?a:'':o[r]},getLayersFromTarget:function(t){}}),L=n(21),N=n.n(L),R=["status","value"],I=["complete"];function F(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function V(t){for(var e=1;e\n
\n ")},templateLabel:function(t){var e=this.pfx,n=this.em,r=t.parent,i=t.attributes,o=i.icon,a=void 0===o?'':o,s=i.info,c=void 0===s?'':s,l=i.id,u=i.name,d=n&&n.t("styleManager.properties.".concat(l))||u;return"\n \n ").concat(d,"\n \n ").concat(r?'':"⨯"),"\n ")},templateInput:function(t){return"\n
\n \n
\n ")},events:i()({change:'inputValueChanged'},"click [".concat(z,"]"),'clear'),initialize:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(y["bindAll"])(this,'targetUpdated','__change','__updateStyle'),this.config=e.config||{};var n=this.config.em;this.em=n,this.pfx=this.config.stylePrefix||'',this.ppfx=this.config.pStylePrefix||'',this.target=e.target||{},this.propTarget=e.propTarget||{},this.onChange=e.onChange,this.onInputRender=e.onInputRender||{},this.customValue=e.customValue||{};var r=this.model;this.property=r.get('property'),this.input=null;var i=this.pfx;if(this.inputHolderId='#'+i+'input-holder',this.sector=r.collection&&r.collection.sector,this.__destroyFn=this.destroy?this.destroy.bind(this):function(){},r.view=this,r.get('value')||r.set('value',r.getDefaultValue()),n){this.listenTo(n,"update:component:style:".concat(this.property),this.targetUpdated);var o=r.get('requires')||{};Object.keys(o).forEach((function(e){t.listenTo(n,"component:styleUpdate:".concat(e),t.targetUpdated)}))}this.listenTo(this.propTarget,'update',this.targetUpdated),this.listenTo(r,'destroy remove',this.remove),this.listenTo(r,'change:value',this.modelValueChanged),this.listenTo(r,'targetUpdated',this.targetUpdated),this.listenTo(r,'change:visible',this.updateVisibility),this.listenTo(r,'change:status',this.updateStatus),this.listenTo(r,'change:name change:className change:full',this.render);var a=this.init&&this.init.bind(this);a&&a()},remove:function(){var t=this;a.a.View.prototype.remove.apply(this,arguments),['em','target','input','$input','propTarget','sector'].forEach((function(e){return t[e]={}})),this.__destroyFn(this._getClbOpts())},updateStatus:function(){var t=this.model,e=t.get('status'),n=t.parent,r=this.pfx,i=this.ppfx,o=this.config,a="".concat(i,"four-color"),s="".concat(i,"color-warn"),c=this.$el.children(".".concat(r,"label")),l=this.getClearEl(),u=l?l.style:{};switch(c.removeClass("".concat(a," ").concat(s)),u.display='none',e){case'updated':!n&&c.addClass(a),o.clearProperties&&(u.display='inline');break;case'computed':c.addClass(s)}},clear:function(t){var e=this;t&&t.stopPropagation(),this.model.clearValue(),this.__unset(),setTimeout((function(){return e.targetUpdated()}))},getClearEl:function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat(z,"]"))),this.clearEl},getTarget:function(){return this.getTargetModel()},getTargets:function(){return this.propTarget.targets||[this.getTarget()]},getFirstTarget:function(){return this.getTargets()[0]},getTargetModel:function(){return this.propTarget&&this.propTarget.model},getHelperModel:function(){return this.propTarget&&this.propTarget.helper},inputValueChanged:function(t){t&&t.stopPropagation(),this.emit||(this.model.setValueFromInput(this.getInputValue()),this.elementUpdated())},elementUpdated:function(){this.setStatus('updated')},setStatus:function(t){this.model.set('status',t);var e=this.model.parent;e&&'updated'==t&&e.set('status',t)},emitUpdateTarget:Object(y["debounce"])((function(){var t=this.config.em;t&&t.trigger('styleManager:update:target',this.getFirstTarget())})),_getTargetData:function(){var t=this.model,e=this.config,n=this.getTargetValue({ignoreDefault:1}),r=t.getDefaultValue(),i=this.getComputedValue(),o='',a='';return n?(o=n,e.highlightChanged&&(a='updated')):i&&e.showComputed&&i!=r?(o=i,e.highlightComputed&&(a='computed')):(o=r,a=''),{value:o,status:a,targetValue:n,defaultValue:r,computedValue:i}},targetUpdated:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!this.config.fromLayer&&(this.emitUpdateTarget(),this.checkVisibility())){var r=this.config,i=r.em,o=this.model,a=o.get('property'),s=this._getTargetData(),c=s.status,l=s.value,u=N()(s,R),d=V({status:c,value:l},u);return this.setStatus(c),o.setValue(l,0,V({fromTarget:1},n)),this.__update(l),i&&(i.trigger('styleManager:change',this,a,l,d),i.trigger("styleManager:change:".concat(a),this,l,d),this._emitUpdate(d)),d}},_emitUpdate:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=this.model;if(e){var r=n.get('property'),i=V(V({},this._getEventData()),t),o=i.id;e.trigger('style:update',i),e.trigger("style:update:".concat(r),i),r!==o&&e.trigger("style:update:".concat(o),i)}},_getEventData:function(){var t=this.model;return{propertyView:this,targets:this.getTargets(),value:t.getFullValue(),property:t,id:t.get('id'),name:t.get('property')}},checkVisibility:function(){var t=1;return this.config.hideNotStylable&&(this.isTargetStylable()&&this.isComponentStylable()?this.show():(this.hide(),t=0),this.sector&&this.sector.trigger('updateVisibility')),t},getTargetValue:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.model,r=this.getFirstTarget(),i=this.customValue;if(!r)return t;if((t=r.getStyle()[n.get('property')])||e.ignoreDefault||(t=n.getDefaultValue()),'function'==typeof i&&!e.ignoreCustomValue){var o=n.collection.indexOf(n),a=i(this,o,t);a&&(t=a)}return t},getComputedValue:function(){var t=this.propTarget,e=t.computed||{},n=t.computedDefault||{},r=this.config.avoidComputed||[],i=this.model.get('property'),o=r.indexOf(i)<0,a=e[i],s=n[Object(b["camelCase"])(i)];return e&&o&&s!==a&&a||''},getInputValue:function(){var t=this.getInputEl();return t?t.value:''},modelValueChanged:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this.model,a=o.getFullValue();if(r.fromInput||this.setValue(a),!r.fromTarget){this.getTargets().forEach((function(t){return n.__updateTarget(t,r)}));var s=this.config.em;if(!s)return;var c=o.get('property'),l=i()({},c,a);s.getSelectedAll().forEach((function(t){!r.noEmit&&s.trigger('component:update',t,l,r),s.trigger(H,t,c,r),s.trigger("".concat(H,":").concat(c),t,a,r),t.trigger("change:style",t,l,r),t.trigger("change:style:".concat(c),t,a,r)}))}},__updateTarget:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model,r=n.getFullValue(),i=this.onChange;t&&this.isComponentStylable()&&(e.fromTarget||(i&&!e.fromParent?i(t,this,e):this.updateTargetStyle(r,null,V(V({},e),{},{target:t}))),this._emitUpdate())},updateTargetStyle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'',n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e||this.model.get('property'),i=n.target||this.getFirstTarget(),o=i.getStyle();t?o[r]=t:delete o[r],n.avoidStore?o.__=1:delete o.__,i.setStyle(o,n);var a=this.getHelperModel();a&&a.setStyle(o,n)},isTargetStylable:function(t){var e=t||this.getFirstTarget(),n=this.model,r=n.get('id'),i=n.get('property'),o=n.get('toRequire'),a=e.get('unstylable'),s=e.get('stylable-require'),c=n.get('requires'),l=n.get('requiresParent'),u=this.sector?this.sector.collection:null,d=this.em?this.em.getSelected():null,h=e.get('stylable');if(Object(y["isArray"])(h)&&(h=h.indexOf(i)>=0),Object(y["isArray"])(a)&&(h=a.indexOf(i)<0),o&&(h=!t||s&&(s.indexOf(r)>=0||s.indexOf(i)>=0)),u&&c){var f=Object.keys(c);u.each((function(t){t.get('properties').each((function(t){if(Object(y["includes"])(f,t.id)){var e=c[t.id];h=h&&Object(y["includes"])(e,t.get('value'))}}))}))}if(l){var p=d&&d.parent(),g=p&&p.getEl();if(g){var v=window.getComputedStyle(g);Object(y["each"])(l,(function(t,e){h=h&&v[e]&&Object(y["includes"])(t,v[e])}))}else h=!1}return h},isComponentStylable:function(){var t=this.em,e=t&&t.getSelected();return!e||this.isTargetStylable(e)},setRawValue:function(t){this.setValue(this.model.parseValue(t))},setValue:function(t){var e=this.model,n=Object(y["isUndefined"])(t)?e.getDefaultValue():t;if(this.update)return this.__update(n);var r=this.getInputEl();r&&(r.value=n)},getInputEl:function(){return this.input||(this.input=this.el.querySelector('input')),this.input},updateVisibility:function(){this.el.style.display=this.model.get('visible')?'':'none'},show:function(){this.model.set('visible',1)},hide:function(){this.model.set('visible',0)},cleanValue:function(){this.setValue('')},clearCached:function(){this.clearEl=null,this.input=null,this.$input=null},__unset:function(){var t=this.unset&&this.unset.bind(this);t&&t(this._getClbOpts())},__update:function(t){var e=this.update&&this.update.bind(this);e&&e(V(V({},this._getClbOpts()),{},{value:t}))},__change:function(){for(var t=this.emit&&this.emit.bind(this),e=arguments.length,n=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=e.complete,r=N()(e,I),i=this.em,o=this.model,a=o.get('property'),s=!1!==n;Object(b["isObject"])(t)?this.getTargets().forEach((function(e){e.addStyle(t,{avoidStore:!s}),i&&i.trigger(H,e,a,r)})):o.setValueFromInput(t,n,r),s&&this.elementUpdated()},_getClbOpts:function(){var t=this.model,e=this.el,n=this.createdEl,r=this.propTarget,i=t.get('property'),o=r.computed||{},a=r.parentRules||[],s=Object(b["find"])(a,(function(t){return!!t.getStyle()[i]}));return{el:e,createdEl:n,props:t.attributes,setProps:function(){return t.set.apply(t,arguments)},change:this.__change,updateStyle:this.__updateStyle,targets:this.getTargets(),target:this.getFirstTarget(),computed:o,parentRules:a,parentRule:s}},render:function(){this.clearCached();var t=this.pfx,e=this.model,n=this.el,r=this.$el,i=e.get('property'),o=e.get('full'),a=e.get('className')||'',s="".concat(t,"property");this.createdEl&&this.__destroyFn(this._getClbOpts()),r.empty().append(this.template(e)),r.find('[data-sm-label]').append(this.templateLabel(e));var c=this.create&&this.create.bind(this);this.createdEl=c&&c(this._getClbOpts()),r.find('[data-sm-fields]').append(this.createdEl||this.templateInput(e)),n.className="".concat(s," ").concat(t).concat(e.get('type')," ").concat(s,"__").concat(i," ").concat(a).trim(),n.className+=o?" ".concat(s,"--full"):'',this.updateStatus();var l=this.onRender&&this.onRender.bind(this);l&&l(),this.setValue(e.get('value'),{fromTarget:1})}});function U(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $(t){for(var e=1;e\n \n \n ")},inputValueChanged:function(){if(!this.model.get('detached')){for(var t=arguments.length,e=new Array(t),n=0;n'),this.input=this.$input.get(0)),this.props||(this.props=t.get('properties')),!this.$props)){this.props.each((function(e,n){e&&'composite'==e.get('type')&&(this.props.remove(e),console.warn('Nested composite types not yet allowed.')),e.parent=t}),this);var r=new(0,n(27).default)(this.getPropsConfig());this.$props=r.render().$el,this.properties=r.properties,this.$el.find("#".concat(this.pfx,"input-holder")).append(this.$props)}},getPropsConfig:function(t){var e=this,n=this.model,r={config:$($({},this.config),{},{highlightComputed:0}),collection:this.props,target:this.target,propTarget:this.propTarget,onChange:function(t,e,r){n.set('value',n.getFullValue(),r)},customValue:function(t,n){return e.valueOnIndex(n,t)}};return n.get('detached')&&delete r.onChange,r},valueOnIndex:function(t,e){var n,r=this.getTargetValue({ignoreDefault:1});r?n=r.split(this.model.getSplitSeparator())[t]:n=e&&e.getTargetValue({ignoreCustomValue:1,ignoreDefault:1});return n},clearCached:function(){B.prototype.clearCached.apply(this,arguments),this.$input=null,this.props=null,this.$props=null}}),G=n(27);function K(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Y(t){for(var e=1;e\n \n \n
").concat(i,"
\n
\n \t
\n
\n
\n ⨯\n
\n
\n
\n ")},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model;this.stackModel=t.stackModel,this.config=t.config||{},this.em=this.config.em,this.pfx=this.config.stylePrefix||'',this.ppfx=this.config.pStylePrefix||'',this.sorter=t.sorter||null,this.propsConfig=t.propsConfig||{},this.customPreview=t.onPreview,this.listenTo(e,'destroy remove',this.remove),this.listenTo(e,'change:active',this.updateVisibility),this.listenTo(e.get('properties'),'change',this.updatePreview),e.view=this,e.set({droppable:0,draggable:1}),this.$el.data('model',e)},initSorter:function(t){this.sorter&&this.sorter.startSort(this.el)},removeItem:function(t){t&&t.stopPropagation(),this.remove()},remove:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=this.props,r=e.collection,i=this.stackModel;a.a.View.prototype.remove.apply(this,arguments),r&&r.contains(e)&&r.remove(e),i&&i.set&&(i.set({stackIndex:null},{silent:!0}),!t.fromTarget&&i.trigger('updateValue')),n&&n.remove()},onPreview:function(t){var e=this.stackModel,n=e&&e.get('detached'),r=t.split(' '),i=3,o=[],a={};return this.model.get('properties').each((function(t,e){var s=t.get('property'),c=n?t.getFullValue():r[e]||'';if(c&&'integer'==t.get('type')){var l=parseInt(c,10),u=c.replace(l,'');c=(l=(l=(l=isNaN(l)?0:l)>i?i:l)<-i?-i:l)+u}o.push(c),a[s]=c})),n?a:o.join(' ')},updatePreview:function(){var t=this.stackModel,e=this.customPreview,n=this.getPreviewEl(),r=this.model.getFullValue(),i=e?e(r):this.onPreview(r);if(i&&t&&n){var o=n.style;if(Object(y["isString"])(i))o[t.get('property')]=i;else{var a=[];Object(y["each"])(i,(function(t,e){return a.push("".concat(e,":").concat(t))})),n.setAttribute('style',a.join(';'))}}},getPropertiesWrapper:function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector('[data-properties]')),this.propsWrapEl},getPreviewEl:function(){return this.previewEl||(this.previewEl=this.el.querySelector('[data-preview]')),this.previewEl},active:function(){var t=this.model,e=t.collection;e.active(e.indexOf(t))},updateVisibility:function(){var t=this.pfx,e=this.getPropertiesWrapper(),n=this.model.get('active');e.style.display=n?'':'none',this.$el[n?'addClass':'removeClass']("".concat(t,"active"))},render:function(){var t=this.propsConfig,e=this.model,n=this.el,r=this.pfx,i=e.get('preview'),o=new G["default"]({collection:e.get('properties'),config:Y(Y({},this.config),{},{fromLayer:1}),target:t.target,customValue:t.customValue,propTarget:t.propTarget,onChange:t.onChange}),a=o.render().el;return n.innerHTML=this.template(e),n.className="".concat(r,"layer").concat(i?'':" ".concat(r,"no-preview")),this.props=o,this.getPropertiesWrapper().appendChild(a),this.updateVisibility(),this.updatePreview(),this}}),J=a.a.View.extend({initialize:function(t){this.config=t.config||{},this.stackModel=t.stackModel,this.preview=t.preview,this.pfx=this.config.stylePrefix||'',this.ppfx=this.config.pStylePrefix||'',this.propsConfig=t.propsConfig;var e=this.pfx,n=this.ppfx,r=this.collection;this.className="".concat(e,"layers ").concat(n,"field"),this.listenTo(r,'add',this.addTo),this.listenTo(r,'deselectAll',this.deselectAll),this.listenTo(r,'reset',this.reset),this.items=[];var i=this.config.em||'',o=i?i.get('Utils'):'';this.sorter=o?new o.Sorter({container:this.el,ignoreViewChildren:1,containerSel:".".concat(e,"layers"),itemSel:".".concat(e,"layer"),pfx:this.config.pStylePrefix}):'',r.view=this,this.$el.data('model',r),this.$el.data('collection',r)},addTo:function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},addToCollection:function(t,e,n){var r=e||null,i=this.stackModel,o=this.config,a=this.sorter,s=this.propsConfig;void 0!==this.preview&&t.set('preview',this.preview);var c=new X({model:t,config:o,sorter:a,stackModel:i,propsConfig:s}),l=c.render().el;if(this.items.push(c),r)r.appendChild(l);else if(void 0!==n){var u='before';this.$el.children().length==n&&(n--,u='after'),n<0?this.$el.append(l):this.$el.children().eq(n)[u](l)}else this.$el.append(l);return l},deselectAll:function(){this.$el.find('.'+this.pfx+'layer').removeClass(this.pfx+'active')},reset:function(t,e){this.clearItems(e),this.render()},render:function(){var t=document.createDocumentFragment();return this.$el.empty(),this.collection.each((function(e){this.addToCollection(e,t)}),this),this.$el.append(t),this.$el.attr('class',this.className),this.sorter&&(this.sorter.plh=null),this},remove:function(){this.clearItems(),a.a.View.prototype.remove.apply(this,arguments)},clearItems:function(t){this.items.forEach((function(e){return e.remove(t)})),this.items=[]}});function Z(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var Q=new(n(38)["a"]),tt=q.extend({templateInput:function(){var t=this.pfx;this.ppfx;return"\n
\n \n
\n
\n ")},init:function(){var t=this.model;this.pfx;t.set('stackIndex',null),this.events["click [data-add-layer]"]='addLayer',this.listenTo(t,'change:stackIndex',this.indexChanged),this.listenTo(t,'updateValue',this.inputValueChanged),this.delegateEvents();var e=this.getPropsConfig();this.layers=new J({collection:this.getLayers(),stackModel:t,preview:t.get('preview'),config:this.config,propsConfig:e});var r=n(27).default;this.propsView=new r({target:this.target,collection:t.get('properties'),stackModel:t,config:this.config,onChange:e.onChange,propTarget:e.propTarget})},targetUpdated:function(){var t,e=this;if(this.model.get('detached'))t=this._getTargetData(),this.setStatus(t.status),this.checkVisibility();else{for(var n=arguments.length,r=new Array(n),i=0;i0&&void 0!==arguments[0]?arguments[0]:{},e=this.model;t.up&&this.elementUpdated(),e.get('detached')?e.get('properties').each((function(t){return t.trigger('change:value')})):e.set('value',this.getLayerValues())},setValue:function(){},getLayerValues:function(){return this.getLayers().getFullValue()},_getClassRule:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=t.skipAdd,r=void 0===n?1:n,i=e.getSelected(),o=e.get('StyleManager').getModelToStyle(i,{skipAdd:r,useClasses:1});return o!==i&&o},_getParentTarget:function(t){for(var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=this.model,o=i.get('property'),a=n.isValid||function(t){return t.getStyle()[o]},s=r.get('CssComposer').getAll().filter((function(e){return e.selectorsToString()===t.getSelectorsString()})),c=s.reduce((function(t,e){return t[e.getAtRule()]=e,t}),{}),l=Q.sortMediaObject(c),u=l.map((function(t){return t.value})),d=u.indexOf(t),h=u.splice(0,d),f=h.length-1;f>-1;f--){var p=h[f];if(a(p)){e=p;break}}return e},refreshLayers:function(){var t,e,n,r,i,o,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=[],c=this.model,l=this.em,u=this.getLayers(),d=c.get('detached'),h=c.get('property'),f=this.getFirstTarget(),p=this.getComputedValue(),g=l.getSelected(),v={fromTarget:1};if(d){e=a.targetValue||{};var m=function(t){var e=c.get('properties').at(0).get('property');return t&&!Object(y["isUndefined"])(t.getStyle()[e])};if(!Object(y["keys"])(e).length&&p&&g){var b={isValid:function(t){return m(t)}};(r=this._getParentTarget(f,b))?e=r.getStyle():(n=this._getClassRule(),r=!(i=m(n)&&n.getStyle())&&this._getParentTarget(this._getClassRule({skipAdd:0}),b),o=m(r)&&r.getStyle(),e=i||o||{})}t=e,s=u.getLayersFromStyle(e)}else{var w=this.getTargetValue({ignoreDefault:1}),O=w;!O&&p&&((r=this._getParentTarget(f))?O=r.getStyle()[h]:(o=(r=!(i=(n=this._getClassRule())&&n.getStyle()[h])&&this._getParentTarget(this._getClassRule({skipAdd:0})))&&r.getStyle()[h],O=i||o||p)),t=O=O==c.getDefaultValue()?'':O,s=u.getLayersFromValue(O)}var x=c.getLayersFromTarget(f,{resultValue:t,layersObj:s})||s;u.reset(null,v),u.add(x,v),c.set({stackIndex:null},{silent:!0})},getTargetValue:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=e.attributes.detached,r=this.getFirstTarget(),i=q.prototype.getTargetValue.call(this,t);return Object(y["isUndefined"])(i)&&!n?i=e.getValueFromStyle(r.getStyle()):n&&(i=e.getValueFromTarget(r)),i},getPropsConfig:function(){var t=this,e=t.model;return{target:t.target,propTarget:t.propTarget,onChange:function(n,r,o){var a=r.model,s=e.get('status');if(e.get('detached')){var c=a.get('property'),l=a.getDefaultValue(),u=t.getLayers(),d=u.getPropertyValues(c,l);r.updateTargetStyle(d,null,o),'background-image'!=c||o.avoidStore||'computed'!=s||e.get('properties').filter((function(t){return'__'==t.get('property').substr(0,2)})).forEach((function(e){var n=e.get('property'),r=u.getPropertyValues(n,e.getDefaultValue());t.getTargets().forEach((function(t){return t.addStyle(i()({},n,r),o)}))}))}else if('updated'==s){var h=e.getFullValue();e.set('value',h,o),!h&&r.updateTargetStyle(h,null,o)}}}},onRender:function(){var t=this.el,e=this.layers,n=this.propsView,r=t.querySelector('[data-layers-wrapper]');n.render(),r.appendChild(e.render().el)}}),et=a.a.$,nt=B.extend({templateInput:function(){var t=this.pfx,e=this.em;return"\n
\n
\n
\n \n
\n
\n
\n
\n
\n
⨯
\n
\n
\n ")},init:function(){var t=this.em;this.modal=t.get('Modal'),this.am=t.get('AssetManager'),this.events['click #'+this.pfx+'close']='removeFile',this.events['click #'+this.pfx+'images']='openAssetManager',this.delegateEvents()},onRender:function(){if(!this.$input){var t=this.model.getDefaultValue();this.$input=et(""))}this.$preview||(this.$preview=this.$el.find('#'+this.pfx+'preview-file')),this.$previewBox||(this.$previewBox=this.$el.find('#'+this.pfx+'preview-box')),this.setValue(this.componentValue,0)},clearCached:function(){B.prototype.clearCached.apply(this,arguments),this.$preview=null,this.$previewBox=null},setValue:function(t,e){B.prototype.setValue.apply(this,arguments),this.setPreviewView(t&&t!=this.model.getDefaultValue()),this.setPreview(t)},setPreviewView:function(t){var e=this.$previewBox;e&&e[t?'addClass':'removeClass']("".concat(this.pfx,"show")),e&&e.css({display:t?'block':'none'})},spreadUrl:function(t){this.model.set('value',t),this.setPreviewView(1)},setPreview:function(t){var e=this.$preview;t=t&&t.indexOf('url(')<0?"url(".concat(t,")"):t,e&&e.css('background-image',t)},cleanValue:function(){this.setPreviewView(0),this.model.set({value:''},{silent:!0})},removeFile:function(){this.model.set('value',this.model.getDefaultValue());for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};e=st(st({},e),{},{silent:1}),this.inputInst.setValue(t,e)},remove:function(){var t=this;it.prototype.remove.apply(this,arguments);var e=this.inputInst;e&&e.remove&&e.remove(),['inputInst','$color'].forEach((function(e){return t[e]={}}))},onRender:function(){if(!this.input){var t=this.ppfx,e=new ot["a"]({target:this.target,model:this.model,ppfx:t}).render();this.el.querySelector(".".concat(t,"fields")).appendChild(e.el),this.$input=e.inputEl,this.$color=e.colorEl,this.input=this.$input.get(0),this.inputInst=e}}}),lt=n(11),ut=n.n(lt);function dt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ht(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:[];return this.set('options',t),this},addOption:function(t){if(t){var e=this.getOptions();this.setOptions([].concat(ut()(e),[t]))}return this}});function pt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function gt(t){for(var e=1;e\n \n
\n
\n
\n \n ")},initialize:function(){for(var t=arguments.length,e=new Array(t),n=0;n").concat(e,"")}));var r=this.el.querySelector("#".concat(t,"input-holder"));r.innerHTML=""),this.input=r.firstChild}}})),yt=B.extend({templateInput:function(){this.pfx;var t=this.ppfx;return"\n
\n
\n ")},onRender:function(){var t=this.pfx,e=this.ppfx,n="".concat(e,"radio-item-label"),r=this.model,i=r.get('property'),o=r.get('list')||r.get('options')||[],a=r.cid,s="".concat(t,"radio ").concat(t,"radio-").concat(i);if(!this.input&&o&&o.length){var c='';o.forEach((function(r){var o=r.className?"".concat(r.className," ").concat(t,"icon ").concat(n):'',l="".concat(i,"-").concat(r.value,"-").concat(a),u=r.name||r.value,d=r.title?"title=\"".concat(r.title,"\""):'';c+="\n
\n \n \n
\n ")}));var l=this.el.querySelector(".".concat(e,"field"));l.innerHTML="
").concat(c,"
"),this.input=l.firstChild}},getInputValue:function(){var t=this.getCheckedEl();return t?t.value:''},getCheckedEl:function(){var t=this.getInputEl();return t?t.querySelector('input:checked'):''},setValue:function(t){var e=this.model,n=t||e.get('value')||e.getDefaultValue(),r=this.getInputEl(),i=r?r.querySelector("[value=\"".concat(n,"\"]")):'';if(i)i.checked=!0;else{var o=this.getCheckedEl();o&&(o.checked=!1)}}}),bt=n(39);function wt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ot(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};C.callParentInit(C,this,t,e);var n=this.get('unit'),r=this.get('units');this.input=Object(b["hasWin"])()&&new bt["a"]({model:this}),r.length&&!n&&this.set('unit',r[0]),C.callInit(this,t,e)},clearValue:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.set({value:void 0,unit:void 0},t),this},parseValue:function(t){var e=C.prototype.parseValue.apply(this,arguments),n=this.input.validateInputValue(e.value,{deepCheck:1}),r=n.value,i=n.unit;return e.value=r,e.unit=i,e},getFullValue:function(){var t=this.get('value'),e=this.get('unit');return t=Object(y["isUndefined"])(t)?'':t,e=!Object(y["isUndefined"])(e)&&t?e:'',t="".concat(t).concat(e),C.prototype.getFullValue.apply(this,[t])}});function Ct(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function kt(t){for(var e=1;e\n \n \n ")},getSliderEl:function(){return this.slider||(this.slider=this.el.querySelector('input[type=range]')),this.slider},inputValueChanged:function(){var t=this.model,e=t.get('step');this.getInputEl().value=this.getSliderEl().value;var n=this.getInputValue()-e;t.set('value',n,{avoidStore:1}).set('value',n+e),this.elementUpdated()},inputValueChangedSoft:function(){this.getInputEl().value=this.getSliderEl().value,this.model.set('value',this.getInputValue(),{avoidStore:1}),this.elementUpdated()},setValue:function(t){var e=this.model.parseValue(t);this.getSliderEl().value=parseFloat(e.value),it.prototype.setValue.apply(this,arguments)},onRender:function(){it.prototype.onRender.apply(this,arguments),this.model.get('showInput')||(this.inputInst.el.style.display='none')},clearCached:function(){it.prototype.clearCached.apply(this,arguments),this.slider=null}});function Et(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _t(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{};this.isPointed=!1;var i=this.editorModel.get('Utils'),o=t.ownerDocument.body;i&&!this.sorter&&(this.sorter=new i.Sorter({container:o,placer:this.canvas.getPlacerEl(),containerSel:'*',itemSel:'*',pfx:this.ppfx,direction:'a',document:e,wmargin:1,nested:1,em:this.editorModel,canvasRelative:1,scale:function(){return n.em.getZoomDecimal()}})),r.onStart&&(this.sorter.onStart=r.onStart),t&&this.sorter.startSort(t,{container:o})},getOffsetDim:function(){var t=this.offset(this.canvas.getFrameEl()),e=this.offset(this.canvas.getElement());return{top:t.top-e.top,left:t.left-e.left}},stopSelectPosition:function(){this.posTargetCollection=null,this.posIndex='after'==this.posMethod&&0!==this.cDim.length?this.posIndex+1:this.posIndex,this.sorter&&(this.sorter.moved=0,this.sorter.endMove()),this.cDim&&(this.posIsLastEl=0!==this.cDim.length&&'after'==this.posMethod&&this.posIndex==this.cDim.length,this.posTargetEl=0===this.cDim.length?i(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?i(this.cDim[this.posIndex][5]).parent():i(this.outsideElem),this.posTargetModel=this.posTargetEl.data('model'),this.posTargetCollection=this.posTargetEl.data('model-comp'))},enable:function(){this.startSelectPosition()},nearFloat:function(t,e,n){var r=t||0,i=e||'before',o=n.length,a=0!==o&&'after'==i&&r==o;return 0!==o&&(!a&&!n[r][4]||n[r-1]&&!n[r-1][4]||a&&!n[r-1][4])?1:0},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css('cursor',''),this.$wrapper.unbind()}}},function(t,e,n){"use strict";var r=n(45),i=n(1);Object(i["hasWin"])()&&(window.Promise=window.Promise||r["a"]),e["a"]='function'==typeof fetch?fetch.bind():function(t,e){return new r["a"]((function(n,i){var o=new XMLHttpRequest;for(var a in o.open(e.method||'get',t),o.withCredentials='include'==e.credentials,e.headers||{})o.setRequestHeader(a,e.headers[a]);o.onload=function(t){return n({status:o.status,statusText:o.statusText,text:function(){return r["a"].resolve(o.responseText)}})},o.onerror=i,o.upload&&e.onProgress&&(o.upload.onprogress=e.onProgress),e.body?o.send(e.body):o.send()}))}},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n.n(i),a=o.a.Model,s=o.a.View;e["a"]={types:[],initialize:function(t,e){var n=this;this.model=function(){var t,e,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(i&&i.type){var a=n.getBaseType();t=(r=n.getType(i.type))?r.model:a.model,e=r?r.view:a.view}else{var s=n.recognizeType(i);t=(r=s.type).model,e=r.view,i=s.attributes}var c=new t(i,o);return c.typeView=e,c};var r=this.init&&this.init.bind(this);r&&r()},recognizeType:function(t){for(var e=this.getTypes(),n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r='',i=this.em,o=i&&i.getConfig('avoidInlineStyle'),a=t.styleToString(),s=t.get('classes'),c=n.wrapperIsBody,l=t.get('wrapper');if(this.ids.push("#".concat(t.getId())),s.each((function(t){return e.compCls.push(t.getFullName())})),!o&&a){var u="#".concat(t.getId());r="".concat(u=c&&l?'body':u,"{").concat(a,"}")}var d=t.components();return d.each((function(t){return r+=e.buildFromModel(t,n)})),r},build:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.json,i=n.em||'',a=n.cssc||i&&i.get('CssComposer');this.em=i,this.compCls=[],this.ids=[],this.model=t;var s=[],c=t?this.buildFromModel(t,n):'',l=Object(o["isUndefined"])(n.clearStyles)&&i?i.getConfig('clearStyles'):n.clearStyles;if(a){var u=n.rules||a.getAll(),d={},h=[];u.forEach((function(t){var i=t.getAtRule();if(i){var o=d[i];o?o.push(t):d[i]=[t]}else{var a=e.buildFromRule(t,h,n);r?s.push(a):c+=a}})),this.sortMediaObject(d).forEach((function(t){var i='',o=t.key;t.value.forEach((function(t){var a=e.buildFromRule(t,h,n);t.get('singleAtRule')?c+="".concat(o,"{").concat(a,"}"):i+=a,r&&s.push(a)})),i&&(c+="".concat(o,"{").concat(i,"}"))})),i&&l&&u.remove&&u.remove(h)}return r?s.filter((function(t){return t})):c},buildFromRule:function(t,e){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o='',a=this.model,s=t.selectorsToString({skipAdd:1}),c=t.get('selectorsAdd'),l=t.get('singleAtRule');if(t.get('selectors').each((function(t){var e=t.getFullName();(r.compCls.indexOf(e)>=0||r.ids.indexOf(e)>=0||i.keepUnusedStyles)&&(n=1)})),s&&n||c||l||!a){var u=t.getDeclaration({body:1});u&&(i.json?o=t:o+=u)}else e.push(t);return o},getQueryLength:function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?parseFloat(e[1]):a},sortMediaObject:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[];return Object(o["each"])(e,(function(t,e){return n.push({key:e,value:t})})),n.sort((function(e,n){var r=[e.key,n.key].every((function(t){return-1!==t.indexOf('min-width')})),i=r?e.key:n.key,o=r?n.key:e.key;return t.getQueryLength(i)-t.getQueryLength(o)}))},sortRules:function(t,e){var n=function(t){return t.get('mediaText')},r=[n(t),n(e)].every((function(t){return-1!==t.indexOf('min-width')})),i=n(r?t:e),o=n(r?e:t);return this.getQueryLength(i)-this.getQueryLength(o)}})},function(t,e,n){"use strict";var r=n(2),i=n.n(r),o=n(0),a=n(1),s=n(24);i.a.$;e["a"]=s["a"].extend({events:{'change input':'handleChange','change select':'handleUnitChange','click [data-arrow-up]':'upArrowClick','click [data-arrow-down]':'downArrowClick','mousedown [data-arrows]':'downIncrement',keydown:'handleKeyDown'},template:function(){var t=this.ppfx;return"\n \n \n
\n
\n
\n
\n ")},inputClass:function(){var t=this.ppfx;return this.opts.contClass||"".concat(t,"field ").concat(t,"field-integer")},initialize:function(){s["a"].prototype.initialize.apply(this,arguments),Object(o["bindAll"])(this,'moveIncrement','upIncrement'),this.doc=document,this.listenTo(this.model,'change:unit',this.handleModelChange)},setValue:function(t,e){var n=e||{},r=this.validateInputValue(t,{deepCheck:1}),i={value:r.value};(r.unit||r.force)&&(i.unit=r.unit),this.model.set(i,n),n.silent&&this.handleModelChange()},handleChange:function(t){t.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()},handleUnitChange:function(t){t.stopPropagation();var e=this.getUnitEl().value;this.model.set('unit',e),this.elementUpdated()},handleKeyDown:function(t){'ArrowUp'===t.key&&(t.preventDefault(),this.upArrowClick()),'ArrowDown'===t.key&&(t.preventDefault(),this.downArrowClick())},elementUpdated:function(){this.model.trigger('el:change')},handleModelChange:function(){var t=this.model;this.getInputEl().value=t.get('value');var e=this.getUnitEl();e&&(e.value=t.get('unit')||'')},getUnitEl:function(){if(!this.unitEl){var t=this.model,e=t.get('units')||[];if(e.length){var n=[];e.forEach((function(e){var r=e==t.get('unit')?'selected':'';n.push(""))}));var r=document.createElement('div');r.innerHTML=""),this.unitEl=r.firstChild}}return this.unitEl},upArrowClick:function(){var t=this.model,e=t.get('step'),n=parseFloat(t.get('value'));n=this.normalizeValue(n+e);var r=this.validateInputValue(n);t.set('value',r.value),this.elementUpdated()},downArrowClick:function(){var t=this.model,e=t.get('step'),n=parseFloat(t.get('value')),r=this.normalizeValue(n-e),i=this.validateInputValue(r);t.set('value',i.value),this.elementUpdated()},downIncrement:function(t){t.preventDefault(),this.moved=0;var e=this.model.get('value');e=this.normalizeValue(e),this.current={y:t.pageY,val:e},Object(a["on"])(this.doc,'mousemove',this.moveIncrement),Object(a["on"])(this.doc,'mouseup',this.upIncrement)},moveIncrement:function(t){this.moved=1;var e=this.model,n=e.get('step'),r=this.current,i=this.normalizeValue(r.val+(r.y-t.pageY)*n);return this.prValue=this.validateInputValue(i).value,e.set('value',this.prValue,{avoidStore:1}),!1},upIncrement:function(){var t=this.model,e=t.get('step');if(Object(a["off"])(this.doc,'mouseup',this.upIncrement),Object(a["off"])(this.doc,'mousemove',this.moveIncrement),this.prValue&&this.moved){var n=this.prValue-e;t.set('value',n,{avoidStore:1}).set('value',n+e),this.elementUpdated()}},normalizeValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.model,r=n.get('step'),i=0;if(isNaN(t))return e;if(t=parseFloat(t),Math.floor(t)!==t){var o=r.toString().split('.')[1];i=o?o.length:0}return i?parseFloat(t.toFixed(i)):t},validateInputValue:function(t,e){var n=0,r=e||{},i=this.model,a='',s=Object(o["isUndefined"])(t)?a:t,c=i.get('units')||[],l=i.get('unit')||c.length&&c[0]||'',u=i.get('max'),d=i.get('min'),h=!!i.get('limitlessMax'),f=!!i.get('limitlessMin');if(r.deepCheck){var p=i.get('fixedValues')||[];if(s){var g=new RegExp('^'+p.join('|'),'g');if(p.length&&g.test(s))s=s.match(g)[0],l='',n=1;else{var v=s+'';s+='',s=parseFloat(s.replace(',','.')),s=isNaN(s)?a:s;var m=v.replace(s,'');Object(o["indexOf"])(c,m)>=0&&(l=m)}}}return h||Object(o["isUndefined"])(u)||''===u||(s=s>u?u:s),f||Object(o["isUndefined"])(d)||''===d||(s=s2&&void 0!==arguments[2]?arguments[2]:{};t.views.forEach((function(t){if(t){var e=t.childrenView,n=t.scriptContainer;e&&e.stopListening(),n&&n.remove(),t.remove.apply(t)}}));var i=t.components();i.forEach((function(t){return n.removeChildren(t,e,r)}))},addTo:function(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.config.em,r=this.collection.indexOf(t);if(this.addToCollection(t,null,r),n&&!e.temporary){var i=function t(e){n.trigger('component:add',e),e.components().forEach((function(e){return t(e)}))};i(t)}},addToCollection:function(t,e,r){this.compView||(this.compView=n(12).default);for(var i=this.config,a=this.opts,s=this.em,c=e||null,l=i.frameView,u=void 0===l?{}:l,d=u.model&&t.getView(u.model),h=a.componentTypes||s&&s.get('DomComponents').getTypes(),f=t.get('type')||'default',p=this.compView,g=0;g1&&void 0!==arguments[1]?arguments[1]:{},r=n.previousModels,i=void 0===r?[]:r;this.parentEl.innerHTML='',i.forEach((function(t){return e.removeChildren(t,e.collection)})),t.each((function(t){return e.addToCollection(t)}))},render:function(t){var e=this,n=this.el,r=document.createDocumentFragment();return this.parentEl=t||this.el,this.collection.each((function(t){return e.addToCollection(t,r)})),n.innerHTML='',n.appendChild(r),this}})},function(t,e,n){"use strict";var r=n(2),i=n.n(r),o=i.a.View.extend({tagName:'style',initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=t.config||{};var e=this.model;this.listenTo(e,'change',this.render),this.listenTo(e,'destroy remove',this.remove),this.listenTo(e.get('selectors'),'change',this.render)},render:function(){var t=this.model,e=this.el,n=t.get('important');return e.innerHTML=t.toCSS({important:n}),this}}),a=o.extend({_createElement:function(t){return document.createTextNode('')},render:function(){var t=this.model,e=t.get('important');return this.el.textContent=t.getDeclaration({important:e}),this}}),s=i.a.$,c=function(t,e){return"".concat(t).concat(e?"-".concat(parseFloat(e)):'')};e["a"]=i.a.View.extend({initialize:function(t){var e=t.config||{};this.atRules={},this.config=e,this.em=e.em,this.pfx=e.stylePrefix||'',this.className=this.pfx+'rules';var n=this.collection;this.listenTo(n,'add',this.addTo),this.listenTo(n,'reset',this.render)},addTo:function(t){this.addToCollection(t)},addToCollection:function(t,e){if(this.renderStarted){var n,r,i=e||null,s={model:t,config:this.config};if('keyframes'===t.get('atRuleType')){var l=t.getAtRule(),u=this.atRules[l];if(!u){var d=document.createElement('style');u=document.createTextNode(''),d.appendChild(document.createTextNode("".concat(l,"{"))),d.appendChild(u),d.appendChild(document.createTextNode("}")),this.atRules[l]=u,n=d}r=new a(s),u.appendData(r.render().el.textContent)}else n=(r=new o(s)).render().el;var h=this.className,f=t.get('mediaText'),p=c(h),g=p;if(f&&(g=c(h,this.getMediaWidth(f))),n){var v,m=i||this.el;try{v=m.querySelector("#".concat(g))}catch(t){}v||(v=m.querySelector("#".concat(p))),v.appendChild(n)}return n}},getMediaWidth:function(t){return t&&t.replace("(".concat(this.em.getConfig('mediaCondition'),": "),'').replace(')','')},render:function(){var t=this;this.renderStarted=1,this.atRules={};var e=this.em,n=this.$el,r=this.className,i=this.collection,o=document.createDocumentFragment();n.empty();var a=e.get('DeviceManager').getAll().pluck('priority');return a.every((function(t){return t}))&&a.unshift(0),a.forEach((function(t){return s("
")).appendTo(o)})),i.each((function(e){return t.addToCollection(e,o)})),n.append(o),n.attr('class',r),this}})},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(14),a=n.n(o),s=n(0),c='text/html',l=c,u=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new DOMParser,i=n.htmlType||l,o=i===c,a=o?t:"
".concat(t,"
"),u=r.parseFromString(a,i);if(o){var d=u.head,h=u.body,f=d.querySelectorAll('script');Object(s["each"])(f,(function(t){return h.appendChild(t)}));var p=[];Object(s["each"])(d.children,(function(t){return p.push(t)})),Object(s["each"])(p,(function(t,e){return h.insertBefore(t,h.children[e])})),e=h}else e=u.firstChild;return e};function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},r={},i={};return Object(s["each"])(e,(function(e,o){if(0===o.indexOf(t.modelAttrStart)){var a=o.replace(n,''),c=e.length,l=e&&Object(s["isString"])(e),u=l&&e.substr(0,1),d=l&&e.substr(c-1);e='false'!==(e='true'===e||e)&&e;try{e='{'==u&&'}'==d||'['==u&&']'==d?JSON.parse(e):e}catch(t){}r[a]=e}else i[o]=e})),{props:r,attrs:i}},parseStyle:function(t){for(var e={},n=t.split(';'),r=0,i=n.length;r1&&void 0!==arguments[1]?arguments[1]:{},o=[],s=r.childNodes,c=0,l=s.length;c'!=="".concat(u.outerHTML).slice(-2)||(m.void=!0);var M=m.components;if(!m.type&&M){for(var D=1,A=0,L=0;L2&&void 0!==arguments[2]?arguments[2]:{},a=e.em,c=a&&a.get('Config')||{},l={html:null,css:null},d=h(h({},t),o),f=Object(s["isFunction"])(d.parserHtml)?d.parserHtml(n,d):u(n,d),p=f.querySelectorAll('script'),g=p.length;if(!c.allowScripts)for(;g--;)p[g].parentNode.removeChild(p[g]);if(i){for(var v=f.querySelectorAll('style'),m=v.length,y='';m--;)y=v[m].innerHTML+y,v[m].parentNode.removeChild(v[m]);y&&(l.css=i.parse(y))}a&&a.trigger("".concat(r,":root"),{input:n,root:f});var b=this.parseNode(f),w=1!==b.length||e.returnArray?b:b[0];return l.html=w,a&&a.trigger(r,{input:n,output:l}),l}}}},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(2),a=n.n(o),s=n(0),c=n(14),l=n.n(c),u=n(1),d=n(24);function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f(t){for(var e=1;e","
","
▼
",''].join(''),s=function(){var t='';if(i)for(var e=1;e<=6;e++)t+="
";return["
","
","
","
","",'
','
',"
","
","
","
","
","
","
","
",'
','
','
',"
",'
',"
","
",t,'
','
',"
",'
',"
","",'
',"
","
","","",'
','
','
'].join('')}(),c='spectrum.id';t.fn.spectrum=function(e,n){if('string'==typeof e){var i=this,o=Array.prototype.slice.call(arguments,1);return this.each((function(){var n=r[t(this).data(c)];if(n){var a=n[e];if(!a)throw new Error("Spectrum: no such method: '"+e+"'");'get'==e?i=n.get():'container'==e?i=n.container:'option'==e?i=n.option.apply(n,o):'destroy'==e?(n.destroy(),t(this).removeData(c)):a.apply(n,o)}})),i}return this.spectrum('destroy').each((function(){var n=T(this,t.extend({},e,t(this).data()));t(this).data(c,n.id)}))},t.fn.spectrum.load=!0,t.fn.spectrum.loadOpts={},t.fn.spectrum.draggable=M,t.fn.spectrum.defaults=n,t.fn.spectrum.inputTypeColorSupport=function e(){if(void 0===e._cachedResult){var n=t("")[0];e._cachedResult='color'===n.type&&''!==n.value}return e._cachedResult},t.spectrum={},t.spectrum.localization={},t.spectrum.palettes={},t.fn.spectrum.processNativeColorInputs=function(){var e=t('input[type=color]');e.length&&!D()&&e.spectrum({preferredFormat:'hex6'})};var d=/^[\s,#]+/,h=/\s+$/,f=0,p=Math,g=p.round,v=p.min,m=p.max,y=p.random,b=function t(e,n){if(n=n||{},(e=e||'')instanceof t)return e;if(!(this instanceof t))return new t(e,n);var r=function(t){var e={r:0,g:0,b:0},n=1,r=!1,i=!1;'string'==typeof t&&(t=function(t){t=t.replace(d,'').replace(h,'').toLowerCase();var e,n=!1;if(C[t])t=C[t],n=!0;else if('transparent'==t)return{r:0,g:0,b:0,a:0,format:'name'};if(e=S.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=S.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=S.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=S.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=S.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=S.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=S.hex8.exec(t))return{a:(r=e[1],Q(r)/255),r:Q(e[2]),g:Q(e[3]),b:Q(e[4]),format:n?'name':'hex8'};var r;if(e=S.hex6.exec(t))return{r:Q(e[1]),g:Q(e[2]),b:Q(e[3]),format:n?'name':'hex'};if(e=S.hex3.exec(t))return{r:Q(e[1]+''+e[1]),g:Q(e[2]+''+e[2]),b:Q(e[3]+''+e[3]),format:n?'name':'hex'};return!1}(t));'object'==l()(t)&&(t.hasOwnProperty('r')&&t.hasOwnProperty('g')&&t.hasOwnProperty('b')?(o=t.r,a=t.g,s=t.b,e={r:255*J(o,255),g:255*J(a,255),b:255*J(s,255)},r=!0,i='%'===String(t.r).substr(-1)?'prgb':'rgb'):t.hasOwnProperty('h')&&t.hasOwnProperty('s')&&t.hasOwnProperty('v')?(t.s=et(t.s),t.v=et(t.v),e=function(t,e,n){t=6*J(t,360),e=J(e,100),n=J(n,100);var r=p.floor(t),i=t-r,o=n*(1-e),a=n*(1-i*e),s=n*(1-(1-i)*e),c=r%6;return{r:255*[n,a,o,o,s,n][c],g:255*[s,n,n,a,o,o][c],b:255*[o,o,s,n,n,a][c]}}(t.h,t.s,t.v),r=!0,i='hsv'):t.hasOwnProperty('h')&&t.hasOwnProperty('s')&&t.hasOwnProperty('l')&&(t.s=et(t.s),t.l=et(t.l),e=function(t,e,n){var r,i,o;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=J(t,360),e=J(e,100),n=J(n,100),0===e)r=i=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,c=2*n-s;r=a(c,s,t+1/3),i=a(c,s,t),o=a(c,s,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,t.s,t.l),r=!0,i='hsl'),t.hasOwnProperty('a')&&(n=t.a));var o,a,s;return n=X(n),{ok:r,format:t.format||i,r:v(255,m(e.r,0)),g:v(255,m(e.g,0)),b:v(255,m(e.b,0)),a:n}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=g(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=g(this._r)),this._g<1&&(this._g=g(this._g)),this._b<1&&(this._b=g(this._b)),this._ok=r.ok,this._tc_id=f++};b.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},setAlpha:function(t){return this._a=X(t),this._roundA=g(100*this._a)/100,this},toHsv:function(){var t=L(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=L(this._r,this._g,this._b),e=g(360*t.h),n=g(100*t.s),r=g(100*t.v);return 1==this._a?'hsv('+e+', '+n+'%, '+r+'%)':'hsva('+e+', '+n+'%, '+r+'%, '+this._roundA+')'},toHsl:function(){var t=A(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=A(this._r,this._g,this._b),e=g(360*t.h),n=g(100*t.s),r=g(100*t.l);return 1==this._a?'hsl('+e+', '+n+'%, '+r+'%)':'hsla('+e+', '+n+'%, '+r+'%, '+this._roundA+')'},toHex:function(t){return N(this._r,this._g,this._b,t)},toHexString:function(t){return'#'+this.toHex(t)},toHex8:function(){return R(this._r,this._g,this._b,this._a)},toHex8String:function(){return'#'+this.toHex8()},toRgb:function(){return{r:g(this._r),g:g(this._g),b:g(this._b),a:this._a}},toRgbString:function(){return 1==this._a?'rgb('+g(this._r)+', '+g(this._g)+', '+g(this._b)+')':'rgba('+g(this._r)+', '+g(this._g)+', '+g(this._b)+', '+this._roundA+')'},toPercentageRgb:function(){return{r:g(100*J(this._r,255))+'%',g:g(100*J(this._g,255))+'%',b:g(100*J(this._b,255))+'%',a:this._a}},toPercentageRgbString:function(){return 1==this._a?'rgb('+g(100*J(this._r,255))+'%, '+g(100*J(this._g,255))+'%, '+g(100*J(this._b,255))+'%)':'rgba('+g(100*J(this._r,255))+'%, '+g(100*J(this._g,255))+'%, '+g(100*J(this._b,255))+'%, '+this._roundA+')'},toName:function(){return 0===this._a?'transparent':!(this._a<1)&&(k[N(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e='#'+R(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?'GradientType = 1, ':'';t&&(n=b(t).toHex8String());return'progid:DXImageTransform.Microsoft.gradient('+r+'startColorstr='+e+',endColorstr='+n+')'},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||'hex'!==t&&'hex6'!==t&&'hex3'!==t&&'name'!==t?('rgb'===t&&(n=this.toRgbString()),'prgb'===t&&(n=this.toPercentageRgbString()),'hex'!==t&&'hex6'!==t||(n=this.toHexString()),'hex3'===t&&(n=this.toHexString(!0)),'hex8'===t&&(n=this.toHex8String()),'name'===t&&(n=this.toName()),'hsl'===t&&(n=this.toHslString()),'hsv'===t&&(n=this.toHsvString()),n||this.toHexString()):'name'===t&&0===this._a?this.toName():this.toRgbString()},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(z,arguments)},brighten:function(){return this._applyModification(H,arguments)},darken:function(){return this._applyModification(B,arguments)},desaturate:function(){return this._applyModification(I,arguments)},saturate:function(){return this._applyModification(F,arguments)},greyscale:function(){return this._applyModification(V,arguments)},spin:function(){return this._applyModification(U,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(K,arguments)},complement:function(){return this._applyCombination($,arguments)},monochromatic:function(){return this._applyCombination(Y,arguments)},splitcomplement:function(){return this._applyCombination(G,arguments)},triad:function(){return this._applyCombination(W,arguments)},tetrad:function(){return this._applyCombination(q,arguments)}},b.fromRatio=function(t,e){if('object'==l()(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]='a'===r?t[r]:et(t[r]));t=n}return b(t,e)},b.equals=function(t,e){return!(!t||!e)&&b(t).toRgbString()==b(e).toRgbString()},b.random=function(){return b.fromRatio({r:y(),g:y(),b:y()})},b.mix=function(t,e,n){n=0===n?0:n||50;var r,i=b(t).toRgb(),o=b(e).toRgb(),a=n/100,s=2*a-1,c=o.a-i.a,l=1-(r=((r=s*c==-1?s:(s+c)/(1+s*c))+1)/2),u={r:o.r*r+i.r*l,g:o.g*r+i.g*l,b:o.b*r+i.b*l,a:o.a*a+i.a*(1-a)};return b(u)},b.readability=function(t,e){var n=b(t),r=b(e),i=n.toRgb(),o=r.toRgb(),a=n.getBrightness(),s=r.getBrightness(),c=Math.max(i.r,o.r)-Math.min(i.r,o.r)+Math.max(i.g,o.g)-Math.min(i.g,o.g)+Math.max(i.b,o.b)-Math.min(i.b,o.b);return{brightness:Math.abs(a-s),color:c}},b.isReadable=function(t,e){var n=b.readability(t,e);return n.brightness>125&&n.color>500},b.mostReadable=function(t,e){for(var n=null,r=0,i=!1,o=0;o125&&a.color>500,c=3*(a.brightness/125)+a.color/500;(s&&!i||s&&i&&c>r||!s&&!i&&c>r)&&(i=s,r=c,n=b(e[o]))}return n};var w,O,x,C=b.names={aliceblue:'f0f8ff',antiquewhite:'faebd7',aqua:'0ff',aquamarine:'7fffd4',azure:'f0ffff',beige:'f5f5dc',bisque:'ffe4c4',black:'000',blanchedalmond:'ffebcd',blue:'00f',blueviolet:'8a2be2',brown:'a52a2a',burlywood:'deb887',burntsienna:'ea7e5d',cadetblue:'5f9ea0',chartreuse:'7fff00',chocolate:'d2691e',coral:'ff7f50',cornflowerblue:'6495ed',cornsilk:'fff8dc',crimson:'dc143c',cyan:'0ff',darkblue:'00008b',darkcyan:'008b8b',darkgoldenrod:'b8860b',darkgray:'a9a9a9',darkgreen:'006400',darkgrey:'a9a9a9',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:'f0f',gainsboro:'dcdcdc',ghostwhite:'f8f8ff',gold:'ffd700',goldenrod:'daa520',gray:'808080',green:'008000',greenyellow:'adff2f',grey:'808080',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',lightgreen:'90ee90',lightgrey:'d3d3d3',lightpink:'ffb6c1',lightsalmon:'ffa07a',lightseagreen:'20b2aa',lightskyblue:'87cefa',lightslategray:'789',lightslategrey:'789',lightsteelblue:'b0c4de',lightyellow:'ffffe0',lime:'0f0',limegreen:'32cd32',linen:'faf0e6',magenta:'f0f',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:'f00',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:'fff',whitesmoke:'f5f5f5',yellow:'ff0',yellowgreen:'9acd32'},k=b.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(C),S=(O='[\\s|\\(]+('+(w='(?:'+'[-\\+]?\\d*\\.\\d+%?'+')|(?:'+'[-\\+]?\\d+%?'+')')+')[,|\\s]+('+w+')[,|\\s]+('+w+')\\s*\\)?',x='[\\s|\\(]+('+w+')[,|\\s]+('+w+')[,|\\s]+('+w+')[,|\\s]+('+w+')\\s*\\)?',{rgb:new RegExp('rgb'+O),rgba:new RegExp('rgba'+x),hsl:new RegExp('hsl'+O),hsla:new RegExp('hsla'+x),hsv:new RegExp('hsv'+O),hsva:new RegExp('hsva'+x),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});window.tinycolor=b,t((function(){t.fn.spectrum.load&&t.fn.spectrum.processNativeColorInputs()}))}function j(e,n,r,i){for(var a=[],s=0;s')}else{a.push(t('
').append(t('').attr('title',i.noColorSelectedText)).html())}}return"
"+a.join('')+'
'}function T(c,l){var u,d,h,f,p=function(e,r){var i=t.extend({},n,e);return i.callbacks={move:_(i.move,r),change:_(i.change,r),show:_(i.show,r),hide:_(i.hide,r),beforeShow:_(i.beforeShow,r)},i}(l,c),g=p.flat,v=p.showSelectionPalette,m=p.localStorageKey,y=p.theme,w=p.callbacks,O=(u=Wt,d=10,function(){var t=this,e=arguments,n=function(){f=null,u.apply(t,e)};h&&clearTimeout(f),!h&&f||(f=setTimeout(n,d))}),x=!1,C=!1,k=!0,S=0,T=0,P=0,A=0,L=0,N=0,R=0,I=0,F=0,V=0,z=1,H=[],B=[],U={},$=p.selectionPalette.slice(0),W=p.maxSelectionSize,q='sp-dragging',G=null,K=c.ownerDocument,Y=(K.body,t(c)),X=!1,J=t(s,K).addClass(y),Z=J.find('.sp-picker-container'),Q=J.find('.sp-color'),tt=J.find('.sp-dragger'),et=J.find('.sp-hue'),nt=J.find('.sp-slider'),rt=J.find('.sp-alpha-inner'),it=J.find('.sp-alpha'),ot=J.find('.sp-alpha-handle'),at=J.find('.sp-input'),st=J.find('.sp-palette'),ct=J.find('.sp-initial'),lt=J.find('.sp-cancel'),ut=J.find('.sp-clear'),dt=J.find('.sp-choose'),ht=J.find('.sp-palette-toggle'),ft=Y.is('input'),pt=ft&&'color'===Y.attr('type')&&D(),gt=ft&&!g,vt=gt?t(a).addClass(y).addClass(p.className).addClass(p.replacerClassName):t([]),mt=gt?vt:Y,yt=vt.find('.sp-preview-inner'),bt=p.color||ft&&Y.val(),wt=!1,Ot=p.preferredFormat,xt=!p.showButtons||p.clickoutFiresChange,Ct=!bt,kt=p.allowEmpty&&!pt;function St(){if(p.showPaletteOnly&&(p.showPalette=!0),ht.text(p.showPaletteOnly?p.togglePaletteMoreText:p.togglePaletteLessText),p.palette){H=p.palette.slice(0),B=t.isArray(H[0])?H:[H],U={};for(var e=0;e1&&(delete window.localStorage[m],t.each(e,(function(t,e){Tt(e)})))}catch(t){}try{$=window.localStorage[m].split(';')}catch(t){}}}function Tt(e){if(v){var n=b(e).toRgbString();if(!U[n]&&-1===t.inArray(n,$))for($.push(n);$.length>W;)$.shift();if(m&&window.localStorage)try{window.localStorage[m]=$.join(';')}catch(t){}}}function Pt(){var e=zt(),n=t.map(B,(function(t,n){return j(t,e,'sp-palette-row sp-palette-row-'+n,p)}));jt(),$&&n.push(j(function(){var t=[];if(p.showPalette)for(var e=0;e<$.length;e++){var n=b($[e]).toRgbString();U[n]||t.push($[e])}return t.reverse().slice(0,p.maxSelectionSize)}(),e,'sp-palette-row sp-palette-row-selection',p)),st.html(n.join(''))}function Et(){if(p.showInitial){var t=wt,e=zt();ct.html(j([t,e],e,'sp-palette-row-initial',p))}}function _t(){(T<=0||S<=0||A<=0)&&Wt(),C=!0,J.addClass(q),G=null,Y.trigger('dragstart.spectrum',[zt()])}function Mt(){C=!1,J.removeClass(q),Y.trigger('dragstop.spectrum',[zt()])}function Dt(){var t=at.val();if(null!==t&&''!==t||!kt){var e=b(t);e.isValid()?(Vt(e),$t(!0)):at.addClass('sp-validation-error')}else Vt(null),$t(!0)}function At(){x?It():Lt()}function Lt(){var e=t.Event('beforeShow.spectrum');if(x)Wt();else if(Y.trigger('beforeShow.spectrum',[zt()]),!1!==w.beforeShow(zt())&&!e.isDefaultPrevented()){!function(){for(var t=0;tf&&f>i?Math.abs(g.left+i-f):0),g.top-=Math.min(g.top,g.top+o>p&&p>o?Math.abs(o+a-r):r),g}(J,mt))),Ut(),p.showPalette&&Pt(),Y.trigger('reflow.spectrum'))}function qt(){It(),X=!0,Y.attr('disabled',!0),mt.addClass('sp-disabled')}!function(){if(i&&J.find('*:not(input)').attr('unselectable','on'),St(),gt&&Y.after(vt).hide(),kt||ut.hide(),g)Y.after(J).hide();else{var e='parent'===p.appendTo?Y.parent():t(p.appendTo);1!==e.length&&(e=t('body')),e.append(J)}function n(e){return e.data&&e.data.ignore?(Vt(t(e.target).closest('.sp-thumb-el').data('color')),Ht()):(Vt(t(e.target).closest('.sp-thumb-el').data('color')),Ht(),$t(!0),p.hideAfterPaletteSelect&&It()),!1}jt(),mt.bind('click.spectrum touchstart.spectrum',(function(e){X||At(),e.stopPropagation(),t(e.target).is('input')||e.preventDefault()})),(Y.is(':disabled')||!0===p.disabled)&&qt(),J.click(E),at.change(Dt),at.bind('paste',(function(){setTimeout(Dt,1)})),at.keydown((function(t){13==t.keyCode&&Dt()})),lt.text(p.cancelText),lt.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),Ft(),It()})),ut.attr('title',p.clearText),ut.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),Ct=!0,Ht(),g&&$t(!0)})),dt.text(p.chooseText),dt.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),i&&at.is(':focus')&&at.trigger('change'),at.hasClass('sp-validation-error')||($t(!0),It())})),ht.text(p.showPaletteOnly?p.togglePaletteMoreText:p.togglePaletteLessText),ht.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),p.showPaletteOnly=!p.showPaletteOnly,p.showPaletteOnly||g||J.css('left','-='+(Z.outerWidth(!0)+5)),St()})),M(it,(function(t,e,n){z=t/L,Ct=!1,n.shiftKey&&(z=Math.round(10*z)/10),Ht()}),_t,Mt),M(et,(function(t,e){I=parseFloat(e/A),Ct=!1,p.showAlpha||(z=1),Ht()}),_t,Mt),M(Q,(function(t,e,n){if(n.shiftKey){if(!G){var r=F*S,i=T-V*T,o=Math.abs(t-r)>Math.abs(e-i);G=o?'x':'y'}}else G=null;var a=!G||'y'===G;(!G||'x'===G)&&(F=parseFloat(t/S)),a&&(V=parseFloat((T-e)/T)),Ct=!1,p.showAlpha||(z=1),Ht()}),_t,Mt),bt?(Vt(bt),Bt(),Ot=p.preferredFormat||b(bt).getFormat(),Tt(bt)):Bt(),g&&Lt();var r=i?'mousedown.spectrum':'click.spectrum touchstart.spectrum';st.delegate('.sp-thumb-el',r,n),ct.delegate('.sp-thumb-el:nth-child(1)',r,{ignore:!0},n)}();var Gt={show:Lt,hide:It,toggle:At,reflow:Wt,option:function(n,r){return n===e?t.extend({},p):r===e?p[n]:(p[n]=r,'preferredFormat'===n&&(Ot=p.preferredFormat),void St())},enable:function(){X=!1,Y.attr('disabled',!1),mt.removeClass('sp-disabled')},disable:qt,offset:function(t){p.offset=t,Wt()},set:function(t){Vt(t),$t()},get:zt,destroy:function(){Y.show(),mt.unbind('click.spectrum touchstart.spectrum'),J.remove(),vt.remove(),r[Gt.id]=null},container:J};return Gt.id=r.push(Gt)-1,Gt}function P(){}function E(t){t.stopPropagation()}function _(t,e){var n=Array.prototype.slice,r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}function M(e,n,r,o){n=n||function(){},r=r||function(){},o=o||function(){};var a=document,s=!1,c={},l=0,u=0,d='ontouchstart'in window,h={};function f(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}function p(t){if(s){if(i&&a.documentMode<9&&!t.button)return g();var r=t&&t.touches&&t.touches[0],o=r&&r.pageX||t.pageX,h=r&&r.pageY||t.pageY,p=Math.max(0,Math.min(o-c.left,u)),v=Math.max(0,Math.min(h-c.top,l));d&&f(t),n.apply(e,[p,v,t])}}function g(){s&&(t(a).unbind(h),t(a.body).removeClass('sp-dragging'),setTimeout((function(){o.apply(e,arguments)}),0)),s=!1}h['selectstart']=f,h['dragstart']=f,h['touchmove mousemove']=p,h['touchend mouseup']=g,t(e).bind('touchstart mousedown',(function(n){var i=n.which?3==n.which:2==n.button;i||s||!1!==r.apply(e,arguments)&&(s=!0,l=t(e).height(),u=t(e).width(),c=t(e).offset(),t(a).bind(h),t(a.body).addClass('sp-dragging'),p(n),f(n))}))}function D(){return t.fn.spectrum.inputTypeColorSupport()}function A(t,e,n){t=J(t,255),e=J(e,255),n=J(n,255);var r,i,o=m(t,e,n),a=v(t,e,n),s=(o+a)/2;if(o==a)r=i=0;else{var c=o-a;switch(i=s>.5?c/(2-o-a):c/(o+a),o){case t:r=(e-n)/c+(e>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(b(r));return o}function Y(t,e){e=e||6;for(var n=b(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(b({h:r,s:i,v:o})),o=(o+s)%1;return a}function X(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function J(t,e){(function(t){return'string'==typeof t&&-1!=t.indexOf('.')&&1===parseFloat(t)})(t)&&(t='100%');var n=function(t){return'string'==typeof t&&-1!=t.indexOf('%')}(t);return t=v(e,m(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),p.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function Z(t){return v(1,m(0,t))}function Q(t){return parseInt(t,16)}function tt(t){return 1==t.length?'0'+t:''+t}function et(t){return t<=1&&(t=100*t+'%'),t}}(p);var g=function(t){var e='name'===t.getFormat()&&t.toName(),n=1==t.getAlpha()?t.toHexString():t.toRgbString();return e||n.replace(/ /g,'')};e["a"]=d["a"].extend({template:function(){var t=this.ppfx;return"\n
\n
\n
\n
\n
\n
\n ")},inputClass:function(){var t=this.ppfx;return"".concat(t,"field ").concat(t,"field-color")},holderClass:function(){return"".concat(this.ppfx,"input-holder")},remove:function(){d["a"].prototype.remove.apply(this,arguments),this.colorEl.spectrum('destroy')},__onInputChange:function(t){var e=t,n=this.getColorEl();if(n){n.spectrum('set',e);var r=n.spectrum('get'),i=e&&g(r);i&&(e=i)}this.model.set({value:e},{fromInput:1})},setValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model,r=n.get('defaults'),i=Object(s["isUndefined"])(t)?Object(s["isUndefined"])(r)?'':r:t,o=this.getInputEl(),a=this.getColorEl(),c='none'!=i?i:'';o.value=i,a.get(0).style.backgroundColor=c,(e.fromTarget||e.fromInput&&!e.avoidStore)&&(a.spectrum('set',c),this.noneColor='none'==i)},getColorEl:function(){if(!this.colorEl){var t,e=this.em,n=this,r=this.ppfx,i=this.model,o=p("
")),a=o.get(0).style,s=e&&e.config?e.config.el:'',c=e&&e.getConfig&&e.getConfig('colorPicker')||{},l=0;this.$el.find("[data-colorp-c]").append(o),o.spectrum(f(f(f({color:i.getValue()||!1,containerClassName:"".concat(r,"one-bg ").concat(r,"two-color"),appendTo:s||'body',maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:'Ok',cancelText:'⨯',palette:[]},c),i.get('colorPicker')||{}),{},{move:function(t){var e=g(t);a.backgroundColor=e,i.setValueFromInput(e,0)},change:function(t){l=1;var e=g(t);a.backgroundColor=e,i.setValueFromInput(0,0),i.setValueFromInput(e),n.noneColor=0},show:function(e){l=0,t=g(e)},hide:function(e){!l&&t&&(n.noneColor&&(t=''),a.backgroundColor=t,o.spectrum('set',t),i.setValueFromInput(t,0))}})),e&&e.on&&this.listenTo(e,'component:selected',(function(){l=1,o.spectrum('hide')})),this.colorEl=o}return this.colorEl},render:function(){return d["a"].prototype.render.call(this),this.getColorEl(),this}})},function(t,e,n){"use strict";(function(t){var r=n(14),i=n.n(r),o=n(77),a=n(78),s=setTimeout;function c(t){return Boolean(t&&void 0!==t.length)}function l(){}function u(t){if(!(this instanceof u))throw new TypeError('Promises must be constructed via new');if('function'!=typeof t)throw new TypeError('not a function');this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],v(t,this)}function d(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,u._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void f(e.promise,t)}h(e.promise,r)}else(1===t._state?h:f)(e.promise,t._value)}))):t._deferreds.push(e)}function h(t,e){try{if(e===t)throw new TypeError('A promise cannot be resolved with itself.');if(e&&('object'===i()(e)||'function'==typeof e)){var n=e.then;if(e instanceof u)return t._state=3,t._value=e,void p(t);if('function'==typeof n)return void v((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,p(t)}catch(e){f(t,e)}var r,o}function f(t,e){t._state=2,t._value=e,p(t)}function p(t){2===t._state&&0===t._deferreds.length&&u._immediateFn((function(){t._handled||u._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e/,v=/^\w+$/;function m(t,e){return void 0===e&&(e=r),p.test(t)?e.getElementsByClassName(t.slice(1)):v.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t)}function y(t,e){if(void 0===e&&(e=r),t){if(t.__cash)return t;var n=t;if(P(t)){if(e.__cash&&(e=e[0]),!(n=f.test(t)?e.getElementById(t.slice(1)):g.test(t)?ht(t):m(t,e)))return}else if(T(t))return this.ready(t);(n.nodeType||n===i)&&(n=[n]),this.length=n.length;for(var o=0,a=this.length;o=0})):n.value=i}))},w.clone=function(){return this.map((function(t,e){return e.cloneNode(!0)}))},w.detach=function(){return this.each((function(t,e){e.parentNode&&e.parentNode.removeChild(e)}))};var lt,ut=/^\s*<(\w+)[^>]*>/,dt=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;function ht(t){if(function(){if(!lt){var t=r.createElement('table'),e=r.createElement('tr');lt={'*':r.createElement('div'),tr:r.createElement('tbody'),td:e,th:e,thead:t,tbody:t,tfoot:t}}}(),!P(t))return[];if(dt.test(t))return[r.createElement(RegExp.$1)];var e=ut.test(t)&&RegExp.$1,n=lt[e]||lt['*'];return n.innerHTML=t,b(n.childNodes).detach().get()}function ft(t,e,n){if(void 0!==e){var r=P(e);!r&&e.length?k(e,(function(e){return ft(t,e,n)})):k(t,r?function(t){t.insertAdjacentHTML(n?'afterbegin':'beforeend',e)}:function(t,r){return function(t,e,n){n?t.insertBefore(e,t.childNodes[0]):t.appendChild(e)}(t,r?e.cloneNode(!0):e,n)})}}b.parseHTML=ht,w.empty=function(){var t=this[0];if(t)for(;t.firstChild;)t.removeChild(t.firstChild);return this},w.append=function(){var t=this;return k(arguments,(function(e){ft(t,e)})),this},w.appendTo=function(t){return ft(b(t),this),this},w.html=function(t){if(void 0===t)return this[0]&&this[0].innerHTML;var e=t.nodeType?t[0].outerHTML:t;return this.each((function(t,n){n.innerHTML=e}))},w.insertAfter=function(t){var e=this;return b(t).each((function(t,n){var r=n.parentNode;e.each((function(e,i){r.insertBefore(t?i.cloneNode(!0):i,n.nextSibling)}))})),this},w.after=function(){var t=this;return k(u.apply(arguments),(function(e){u.apply(b(e).slice()).insertAfter(t)})),this},w.insertBefore=function(t){var e=this;return b(t).each((function(t,n){var r=n.parentNode;e.each((function(e,i){r.insertBefore(t?i.cloneNode(!0):i,n)}))})),this},w.before=function(){var t=this;return k(arguments,(function(e){b(e).insertBefore(t)})),this},w.prepend=function(){var t=this;return k(arguments,(function(e){ft(t,e,!0)})),this},w.prependTo=function(t){return ft(b(t),u.apply(this.slice()),!0),this},w.remove=function(){return this.detach().off()},w.replaceWith=function(t){var e=this;return this.each((function(n,r){var i=r.parentNode;if(i){var o=n?b(t).clone():b(t);if(!o[0])return e.remove(),!1;i.replaceChild(o[0],r),b(o[0]).after(o.slice(1))}}))},w.replaceAll=function(t){return b(t).replaceWith(this),this},w.text=function(t){return void 0===t?this[0]?this[0].textContent:'':this.each((function(e,n){n.textContent=t}))};var pt=r.documentElement;w.offset=function(){var t=this[0];if(t){var e=t.getBoundingClientRect();return{top:e.top+i.pageYOffset-pt.clientTop,left:e.left+i.pageXOffset-pt.clientLeft}}},w.offsetParent=function(){return b(this[0]&&this[0].offsetParent)},w.position=function(){var t=this[0];if(t)return{left:t.offsetLeft,top:t.offsetTop}},w.children=function(t){var e=[];return this.each((function(t,n){l.apply(e,n.children)})),e=b(L(e)),t?e.filter((function(e,n){return j(n,t)})):e},w.contents=function(){var t=[];return this.each((function(e,n){l.apply(t,'IFRAME'===n.tagName?[n.contentDocument]:n.childNodes)})),b(t.length&&L(t))},w.find=function(t){for(var e=[],n=0,r=this.length;n1&&void 0!==arguments[1]?arguments[1]:{},n=e.config,r=n.em,i=this.attributes,o=i.styles,a=i.component,l=r.get('DomComponents'),u=l.getConfig(),d=r.get('CssComposer').getAll(),h={};this.em=r;var f={em:r,config:u,frame:this,idMap:h};if(!Object(c["isComponent"])(a)){var p=Object(c["isObject"])(a)?a:{components:a};!p.type&&(p.type='wrapper');var g=l.getType('wrapper').model;this.set('component',new g(p,f))}if(o){if(!Object(c["isObject"])(o)){var v=Object.keys(h);v.length&&Array.isArray(o)&&o.forEach((function(t){var e=t.selectors;if(e&&1==e.length){var n=e[0],r=n.name&&2===n.type&&n;if(r&&h[r.name])r.name=h[r.name];else if(Object(s["isString"])(n)&&'#'===n[0]){var i=n.substring(1);i&&h[i]&&(e[0]="#".concat(h[i]))}}})),d.add(o),this.set('styles',d)}}else this.set('styles',d);!t.width&&this.set(C,1),!t.height&&this.set(k,1)}},{key:"onRemove",value:function(){this.getComponent().remove({root:1})}},{key:"changesUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.temporary||t.noCount||t.avoidStore||this.set('changesCount',this.get('changesCount')+1)}},{key:"getComponent",value:function(){return this.get('component')}},{key:"getStyles",value:function(){return this.get('styles')}},{key:"disable",value:function(){this.trigger('disable')}},{key:"remove",value:function(){this.view=0;var t=this.collection;return t&&t.remove(this)}},{key:"getHead",value:function(){var t=this.get('head')||[];return i()(t)}},{key:"setHead",value:function(t){return this.set('head',i()(t))}},{key:"addHeadItem",value:function(t){var e=this.getHead();e.push(t),this.setHead(e)}},{key:"getHeadByAttr",value:function(t,e,n){return this.getHead().filter((function(r){return r.attributes&&r.attributes[t]==e&&(!n||n===r.tag)}))[0]}},{key:"removeHeadByAttr",value:function(t,e,n){var r=this.getHead(),i=this.getHeadByAttr(t,e,n),o=r.indexOf(i);o>=0&&(r.splice(o,1),this.setHead(r))}},{key:"addLink",value:function(t){var e='link';!this.getHeadByAttr('href',t,e)&&this.addHeadItem({tag:e,attributes:{href:t,rel:'stylesheet'}})}},{key:"removeLink",value:function(t){this.removeHeadByAttr('href',t,'link')}},{key:"addScript",value:function(t){var e='script';!this.getHeadByAttr('src',t,e)&&this.addHeadItem({tag:e,attributes:{src:t}})}},{key:"removeScript",value:function(t){this.removeHeadByAttr('src',t,'script')}},{key:"getPage",value:function(){var t=this.collection;return t&&t.page}},{key:"_emitUpdated",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.em.trigger('frame:updated',O({frame:this},t))}},{key:"toJSON",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=l["Model"].prototype.toJSON.call(this,t),n=this.em,r=n&&n.get('StorageManager'),i=r&&r.getConfig(),o=Object(s["result"])(this,'defaults');if(i&&!t.fromUndo){var a={component:this.getComponent()};i.storeHtml&&(e.html=n.getHtml(a)),i.storeCss&&(e.css=n.getCss(a))}return t.fromUndo&&delete e.component,delete e.styles,delete e.changesCount,e[C]&&delete e.width,e[k]&&delete e.height,Object(s["forEach"])(e,(function(t,n){0===n.indexOf('_')&&delete e[n]})),Object(s["forEach"])(o,(function(t,n){e[n]===t&&delete e[n]})),Object(s["forEach"])(['attributes','head'],(function(t){Object(s["isEmpty"])(e[t])&&delete e[t]})),e}}]),n}(l["Model"]);function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function T(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};Object(s["bindAll"])(this,'itemLoaded'),this.config=e,this.on('reset',this.onReset),this.on('remove',this.onRemove)}},{key:"onReset",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.previousModels||[];r.map((function(t){return e.onRemove(t)}))}},{key:"onRemove",value:function(t){t&&t.onRemove()}},{key:"itemLoaded",value:function(){this.loadedItems++,this.loadedItems>=this.itemsToLoad&&(this.trigger('loaded:all'),this.listenToLoadItems(0))}},{key:"listenToLoad",value:function(){this.loadedItems=0,this.itemsToLoad=this.length,this.listenToLoadItems(1)}},{key:"listenToLoadItems",value:function(t){var e=this;this.forEach((function(n){return n[t?'on':'off']('loaded',e.itemLoaded)}))}},{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.config;return l["Collection"].prototype.add.call(this,t,T(T({},e),{},{config:n}))}}]),n}(l["Collection"]);function _(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=b()(t);if(e){var i=b()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return m()(this,n)}}E.prototype.model=S;var M=function(t){g()(n,t);var e=_(n);function n(){return d()(this,n),e.apply(this,arguments)}return f()(n,[{key:"defaults",value:function(){return{frames:[],_undo:!0}}},{key:"initialize",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.config,i=void 0===r?{}:r,o=i.em,a={};this.em=o,t.frames||(a.component=t.component,a.styles=t.styles,['component','styles'].map((function(t){return e.unset(t)})));var s=t.frames||[a],c=new E(s,i);c.page=this,this.set('frames',c);var l=o&&o.get('UndoManager');l&&l.add(c)}},{key:"onRemove",value:function(){this.get('frames').reset()}},{key:"getFrames",value:function(){return this.get('frames')}},{key:"getId",value:function(){return this.id}},{key:"getName",value:function(){return this.get('name')}},{key:"setName",value:function(t){return this.get({name:t})}},{key:"getAllFrames",value:function(){return this.getFrames().models||[]}},{key:"getMainFrame",value:function(){return this.getFrames().at(0)}},{key:"getMainComponent",value:function(){var t=this.getMainFrame();return t&&t.getComponent()}},{key:"toJSON",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=l["Model"].prototype.toJSON.call(this,t),n=Object(s["result"])(this,'defaults');return Object(s["forEach"])(e,(function(t,n){0===n.indexOf('_')&&delete e[n]})),Object(s["forEach"])(n,(function(t,n){e[n]===t&&delete e[n]})),e}}]),n}(l["Model"]);function D(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function A(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};this.config=e,this.on('reset',this.onReset),this.on('remove',this.onRemove)}},{key:"onReset",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.previousModels||[];r.map((function(t){return e.onRemove(t)}))}},{key:"onRemove",value:function(t){t&&t.onRemove()}},{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.config;return l["Collection"].prototype.add.call(this,t,A(A({},e),{},{config:n}))}}]),n}(l["Collection"]);function R(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function I(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};Object(s["bindAll"])(this,'_onPageChange');var n=e.em,r=I({},e);this.config=r,this.em=n;var i=new N([],r);this.pages=i;var o=new l["Model"]({_undo:!0});return this.model=o,i.on('add',(function(t,e,r){return n.trigger(U,t,r)})),i.on('remove',(function(t,e,r){return n.trigger(W,t,r)})),i.on('change',(function(t,e){n.trigger(B,t,t.changedAttributes(),e)})),i.on('reset',(function(e){return e.at(0)&&t.select(e.at(0))})),i.on('all',this.__onChange,this),o.on(G,this._onPageChange),this},__onChange:function(t,e,n,r){var i=r||n;this.em.trigger(F,{event:t,page:e,options:i})},onLoad:function(){var t=this.pages,e={silent:!0};t.add(this.config.pages||[],e);var n=t.length?this.getMain():this.add({type:K},e);this.select(n,e)},_onPageChange:function(t,e,n){var r=this.em,i=r.get('LayerManager'),o=e.getMainComponent();i&&o&&i.setRoot(o),r.trigger(z,e,t.previous('selected')),this.__onChange(G,e,n)},postLoad:function(){var t=this.em,e=this.model,n=t.get('UndoManager');n&&n.add(e),n&&n.add(this.pages)},add:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em;t.id=t.id||this._createId();var i=function(){var r=e.pages.add(t,n);return n.select&&e.select(r),r};return!n.silent&&r.trigger($,t,i,n),!n.abort&&i()},remove:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=Object(s["isString"])(t)?this.get(t):t,o=function(){return i&&e.pages.remove(i,n),i};return!n.silent&&r.trigger(q,i,o,n),!n.abort&&o()},get:function(t){return this.pages.filter((function(e){return e.get('id')===t}))[0]},getMain:function(){var t=this.pages;return t.filter((function(t){return t.get('type')===K}))[0]||t.at(0)},getAll:function(){return i()(this.pages.models)},getAllWrappers:function(){var t=this.getAll();return Object(s["unique"])(Object(s["flatten"])(t.map((function(t){return t.getAllFrames().map((function(t){return t.getComponent()}))}))))},getAllMap:function(){return this.getAll().reduce((function(t,e){return t[e.get('id')]=e,t}),{})},select:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object(s["isString"])(t)?this.get(t):t;return n&&(this.em.trigger(H,n,e),this.model.set('selected',n,e)),this},getSelected:function(){return this.model.get('selected')},destroy:function(){var t=this;this.pages.off().reset(),this.model.stopListening(),this.model.clear({silent:!0}),['selected','config','em','pages','model'].map((function(e){return t[e]=0}))},store:function(t){if(!this.em.get('hasPages'))return{};var e={},n=this.config;return e[this.storageKey]=JSON.stringify(this.getAll()),!t&&n.stm&&n.stm.store(e),e},load:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.storageKey,n=t[e]||[];if('string'==typeof n)try{n=JSON.parse(t[e])}catch(t){}return n&&n.length&&this.pages.reset(n),n},_createId:function(){var t,e=this.getAll().length+16,n=this.getAllMap();do{t=Object(c["createId"])(e)}while(n[t]);return t}}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=i.a.Model.extend({defaults:{id:'',label:'',tagName:'span',className:'',command:'',context:'',buttons:[],attributes:{},options:{},active:!1,dragDrop:!1,togglable:!0,runDefaultCommand:!0,stopDefaultCommand:!1,disable:!1},initialize:function(t){if(this.get('buttons').length){var e=n(48).default;this.set('buttons',new e(this.get('buttons')))}}});e["default"]=i.a.Collection.extend({model:o,deactivateAllExceptOne:function(t,e){this.forEach((function(n,r){n!==t&&(n.set('active',!1),e&&n.get('buttons').length&&n.get('buttons').deactivateAllExceptOne(t,e))}))},deactivateAll:function(t,e){var n=t||'';this.forEach((function(t){t.get('context')==n&&t!==e&&t.set('active',!1,{fromCollection:1})}))},disableAllButtons:function(t){var e=t||'';this.forEach((function(t,n){t.get('context')==e&&t.set('disable',!0)}))},disableAllButtonsExceptOne:function(t,e){this.forEach((function(n,r){n!==t&&(n.set('disable',!0),e&&n.get('buttons').length&&n.get('buttons').disableAllButtonsExceptOne(t,e))}))}})},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n*\/]/.test(n)?x(null,"select-op"):"."==n&&t.match(/^-?[_a-z][_a-z0-9-]*/i)?x("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?x(null,n):t.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(t.current())&&(e.tokenize=S),x("variable callee","variable")):/[\w\\\-]/.test(n)?(t.eatWhile(/[\w\\\-]/),x("property","word")):x(null,null):/[\d.]/.test(t.peek())?(t.eatWhile(/[\w.%]/),x("number","unit")):t.match(/^-[\w\\\-]*/)?(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?x("variable-2","variable-definition"):x("variable-2","variable")):t.match(/^\w+-/)?x("meta","meta"):void 0}function k(t){return function(e,n){for(var r,i=!1;null!=(r=e.next());){if(r==t&&!i){")"==t&&e.backUp(1);break}i=!i&&"\\"==r}return(r==t||!i&&")"!=t)&&(n.tokenize=null),x("string","string")}}function S(t,e){return t.next(),t.match(/^\s*[\"\')]/,!1)?e.tokenize=null:e.tokenize=k(")"),x(null,"(")}function j(t,e,n){this.type=t,this.indent=e,this.prev=n}function T(t,e,n,r){return t.context=new j(n,e.indentation()+(!1===r?0:a),t.context),n}function P(t){return t.context.prev&&(t.context=t.context.prev),t.context.type}function E(t,e,n){return D[n.context.type](t,e,n)}function _(t,e,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return E(t,e,n)}function M(t){var e=t.current().toLowerCase();o=m.hasOwnProperty(e)?"atom":v.hasOwnProperty(e)?"keyword":"variable"}var D={top:function(t,e,n){if("{"==t)return T(n,e,"block");if("}"==t&&n.context.prev)return P(n);if(w&&/@component/i.test(t))return T(n,e,"atComponentBlock");if(/^@(-moz-)?document$/i.test(t))return T(n,e,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(t))return T(n,e,"atBlock");if(/^@(font-face|counter-style)/i.test(t))return n.stateArg=t,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(t))return"keyframes";if(t&&"@"==t.charAt(0))return T(n,e,"at");if("hash"==t)o="builtin";else if("word"==t)o="tag";else{if("variable-definition"==t)return"maybeprop";if("interpolation"==t)return T(n,e,"interpolation");if(":"==t)return"pseudo";if(y&&"("==t)return T(n,e,"parens")}return n.context.type},block:function(t,e,n){if("word"==t){var r=e.current().toLowerCase();return h.hasOwnProperty(r)?(o="property","maybeprop"):f.hasOwnProperty(r)?(o=O?"string-2":"property","maybeprop"):y?(o=e.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==t?"block":y||"hash"!=t&&"qualifier"!=t?D.top(t,e,n):(o="error","block")},maybeprop:function(t,e,n){return":"==t?T(n,e,"prop"):E(t,e,n)},prop:function(t,e,n){if(";"==t)return P(n);if("{"==t&&y)return T(n,e,"propBlock");if("}"==t||"{"==t)return _(t,e,n);if("("==t)return T(n,e,"parens");if("hash"!=t||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e.current())){if("word"==t)M(e);else if("interpolation"==t)return T(n,e,"interpolation")}else o+=" error";return"prop"},propBlock:function(t,e,n){return"}"==t?P(n):"word"==t?(o="property","maybeprop"):n.context.type},parens:function(t,e,n){return"{"==t||"}"==t?_(t,e,n):")"==t?P(n):"("==t?T(n,e,"parens"):"interpolation"==t?T(n,e,"interpolation"):("word"==t&&M(e),"parens")},pseudo:function(t,e,n){return"meta"==t?"pseudo":"word"==t?(o="variable-3",n.context.type):E(t,e,n)},documentTypes:function(t,e,n){return"word"==t&&c.hasOwnProperty(e.current())?(o="tag",n.context.type):D.atBlock(t,e,n)},atBlock:function(t,e,n){if("("==t)return T(n,e,"atBlock_parens");if("}"==t||";"==t)return _(t,e,n);if("{"==t)return P(n)&&T(n,e,y?"block":"top");if("interpolation"==t)return T(n,e,"interpolation");if("word"==t){var r=e.current().toLowerCase();o="only"==r||"not"==r||"and"==r||"or"==r?"keyword":l.hasOwnProperty(r)?"attribute":u.hasOwnProperty(r)?"property":d.hasOwnProperty(r)?"keyword":h.hasOwnProperty(r)?"property":f.hasOwnProperty(r)?O?"string-2":"property":m.hasOwnProperty(r)?"atom":v.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(t,e,n){return"}"==t?_(t,e,n):"{"==t?P(n)&&T(n,e,y?"block":"top",!1):("word"==t&&(o="error"),n.context.type)},atBlock_parens:function(t,e,n){return")"==t?P(n):"{"==t||"}"==t?_(t,e,n,2):D.atBlock(t,e,n)},restricted_atBlock_before:function(t,e,n){return"{"==t?T(n,e,"restricted_atBlock"):"word"==t&&"@counter-style"==n.stateArg?(o="variable","restricted_atBlock_before"):E(t,e,n)},restricted_atBlock:function(t,e,n){return"}"==t?(n.stateArg=null,P(n)):"word"==t?(o="@font-face"==n.stateArg&&!p.hasOwnProperty(e.current().toLowerCase())||"@counter-style"==n.stateArg&&!g.hasOwnProperty(e.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(t,e,n){return"word"==t?(o="variable","keyframes"):"{"==t?T(n,e,"top"):E(t,e,n)},at:function(t,e,n){return";"==t?P(n):"{"==t||"}"==t?_(t,e,n):("word"==t?o="tag":"hash"==t&&(o="builtin"),"at")},interpolation:function(t,e,n){return"}"==t?P(n):"{"==t||";"==t?_(t,e,n):("word"==t?o="variable":"variable"!=t&&"("!=t&&")"!=t&&(o="error"),"interpolation")}};return{startState:function(t){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new j(r?"block":"top",t||0,null)}},token:function(t,e){if(!e.tokenize&&t.eatSpace())return null;var n=(e.tokenize||C)(t,e);return n&&"object"==typeof n&&(i=n[1],n=n[0]),o=n,"comment"!=i&&(e.state=D[e.state](i,t,e)),o},indent:function(t,e){var n=t.context,r=e&&e.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-a)):i=(n=n.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],r=e(n),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=e(i),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme"],s=e(a),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light"],l=e(c),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=e(u),h=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],f=e(h),p=e(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=e(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),v=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],m=e(v),y=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],b=e(y),w=n.concat(i).concat(a).concat(c).concat(u).concat(h).concat(v).concat(y);function O(t,e){for(var n,r=!1;null!=(n=t.next());){if(r&&"/"==n){e.tokenize=null;break}r="*"==n}return["comment","comment"]}t.registerHelper("hintWords","css",w),t.defineMIME("text/css",{documentTypes:r,mediaTypes:o,mediaFeatures:s,mediaValueKeywords:l,propertyKeywords:d,nonStandardPropertyKeywords:f,fontProperties:p,counterDescriptors:g,colorKeywords:m,valueKeywords:b,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=O,O(t,e))}},name:"css"}),t.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:s,mediaValueKeywords:l,propertyKeywords:d,nonStandardPropertyKeywords:f,colorKeywords:m,valueKeywords:b,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=O,O(t,e)):["operator","operator"]},":":function(t){return!!t.match(/^\s*\{/,!1)&&[null,null]},$:function(t){return t.match(/^[\w-]+/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(t){return!!t.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),t.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:s,mediaValueKeywords:l,propertyKeywords:d,nonStandardPropertyKeywords:f,colorKeywords:m,valueKeywords:b,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=O,O(t,e)):["operator","operator"]},"@":function(t){return t.eat("{")?[null,"interpolation"]:!t.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),t.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:o,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:f,fontProperties:p,counterDescriptors:g,colorKeywords:m,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=O,O(t,e))}},name:"css",helperType:"gss"})}(n(26))},function(t,e,n){"use strict";n.r(e),e["default"]={run:function(t){t.DomComponents.clear(),t.CssComposer.clear()}}},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n(1),o=n(23);e["default"]={run:function(t){Object(r["bindAll"])(this,'onKeyUp','enableDragger','disableDragger'),this.editor=t,this.canvasModel=this.canvas.getCanvasView().model,this.toggleMove(1)},stop:function(t){this.toggleMove(),this.disableDragger()},onKeyUp:function(t){' '===Object(i["getKeyChar"])(t)&&this.editor.stopCommand(this.id)},enableDragger:function(t){this.toggleDragger(1,t)},disableDragger:function(t){this.toggleDragger(0,t)},toggleDragger:function(t,e){var n=this.canvasModel,r=this.em,i=this.dragger,a=t?'add':'remove';this.getCanvas().classList[a]("".concat(this.ppfx,"is__grabbing")),i||(i=new o["a"]({getPosition:function(){return{x:n.get('x'),y:n.get('y')}},setPosition:function(t){var e=t.x,r=t.y;n.set({x:e,y:r})},onStart:function(t,e){r.trigger('canvas:move:start',e)},onDrag:function(t,e){r.trigger('canvas:move',e)},onEnd:function(t,e){r.trigger('canvas:move:end',e)}}),this.dragger=i),t?i.start(e):i.stop()},toggleMove:function(t){var e=this.ppfx,n=t?'add':'remove',r=t?'on':'off',o={on:i["on"],off:i["off"]},a=this.getCanvas(),s=["".concat(e,"is__grab")];!t&&s.push("".concat(e,"is__grabbing")),s.forEach((function(t){return a.classList[n](t)})),o[r](document,'keyup',this.onKeyUp),o[r](a,'mousedown',this.enableDragger),o[r](document,'mouseup',this.disableDragger)}}},function(t,e,n){"use strict";n.r(e);var r=n(11),i=n.n(r),o=n(0);e["default"]={run:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=[],s=r.component||t.getSelectedAll();return s=Object(o["isArray"])(s)?i()(s):[s],t.select(null),s.forEach((function(t){if(!t||!t.get('removable'))return n.em.logWarning('The element is not removable',{component:t});t.remove(),t.collection&&a.push(t)})),a.length&&t.select(a),s}}},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r),o=n(0),a=n(23);function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{};Object(o["bindAll"])(this,'setPosition','onStart','onDrag','onEnd','getPosition','getGuidesStatic','renderGuide','getGuidesTarget');var i=r.target,s=r.event,u=r.mode,d=r.dragger,h=void 0===d?{}:d,f=i.getEl(),p=c({doc:f.ownerDocument,onStart:this.onStart,onEnd:this.onEnd,onDrag:this.onDrag,getPosition:this.getPosition,setPosition:this.setPosition,guidesStatic:function(){return n.guidesStatic},guidesTarget:function(){return n.guidesTarget}},h);this.setupGuides(),this.opts=r,this.editor=t,this.em=t.getModel(),this.target=i,this.isTran='translate'==u,this.guidesContainer=this.getGuidesContainer(),this.guidesTarget=this.getGuidesTarget(),this.guidesStatic=this.getGuidesStatic();var g=this.dragger;return g?g.setOptions(p):(g=new a["a"](p),this.dragger=g),s&&g.start(s),this.toggleDrag(1),this.em.trigger("".concat(l,":start"),this.getEventOpts()),g},getEventOpts:function(){return{mode:this.opts.mode,target:this.target,guidesTarget:this.guidesTarget,guidesStatic:this.guidesStatic}},stop:function(){this.toggleDrag()},setupGuides:function(){(this.guides||[]).forEach((function(t){var e=t.guide;e&&e.parentNode.removeChild(e)})),this.guides=[]},getGuidesContainer:function(){var t=this,e=this.guidesEl;if(!e){var n=this.editor,r=this.em,i=this.opts,a=n.getConfig('stylePrefix'),s=document.createElement('div'),c=document.createElement('div'),l="
\n
\n
");(e=document.createElement('div')).className="".concat(a,"guides"),s.className="".concat(a,"guide-info ").concat(a,"guide-info__x"),c.className="".concat(a,"guide-info ").concat(a,"guide-info__y"),s.innerHTML=l,c.innerHTML=l,e.appendChild(s),e.appendChild(c),n.Canvas.getGlobalToolsEl().appendChild(e),this.guidesEl=e,this.elGuideInfoX=s,this.elGuideInfoY=c,this.elGuideInfoContentX=s.querySelector(".".concat(a,"guide-info__content")),this.elGuideInfoContentY=c.querySelector(".".concat(a,"guide-info__content")),r.on('canvas:update frame:scroll',Object(o["debounce"])((function(){t.updateGuides(),i.debug&&t.guides.forEach((function(e){return t.renderGuide(e)}))}),200))}return e},getGuidesStatic:function(){var t=this,e=[],n=this.target.getEl(),r=n.parentNode,i=void 0===r?{}:r;return Object(o["each"])(i.children,(function(r){return e=e.concat(n!==r?t.getElementGuides(r):[])})),e.concat(this.getElementGuides(i))},getGuidesTarget:function(){return this.getElementGuides(this.target.getEl())},updateGuides:function(t){var e,n,r=this;(t||this.guides).forEach((function(t){var i=t.origin,a=e===i?n:r.getElementPos(i);e=i,n=a,Object(o["each"])(r.getGuidePosUpdate(t,a),(function(e,n){return t[n]=e})),t.originRect=a}))},getGuidePosUpdate:function(t,e){var n={},r=e.top,i=e.height,o=e.left,a=e.width;switch(t.type){case't':n.y=r;break;case'b':n.y=r+i;break;case'l':n.x=o;break;case'r':n.x=o+a;break;case'x':n.x=o+a/2;break;case'y':n.y=r+i/2}return n},renderGuide:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.guide||document.createElement('div'),n='px',r=t.active?2:1,i=e.children[0];return e.style="position: absolute; background-color: ".concat(t.active?'green':'red',";"),e.children.length||((i=document.createElement('div')).style='position: absolute; color: red; padding: 5px; top: 0; left: 0;',e.appendChild(i)),t.y?(e.style.width='100%',e.style.height="".concat(r).concat(n),e.style.top="".concat(t.y).concat(n),e.style.left=0):(e.style.width="".concat(r).concat(n),e.style.height='100%',e.style.left="".concat(t.x).concat(n),e.style.top="0".concat(n)),!t.guide&&this.guidesContainer.appendChild(e),e},getElementPos:function(t){return this.editor.Canvas.getElementPos(t,{noScroll:1})},getElementGuides:function(t){var e=this,n=this.opts,r=this.getElementPos(t),i=r.top,o=r.height,a=r.left,s=r.width,l=[{type:'t',y:i},{type:'b',y:i+o},{type:'l',x:a},{type:'r',x:a+s},{type:'x',x:a+s/2},{type:'y',y:i+o/2}].map((function(i){return c(c({},i),{},{origin:t,originRect:r,guide:n.debug&&e.renderGuide(i)})}));return l.forEach((function(t){return e.guides.push(t)})),l},getTranslate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'x',n=0;return(t||'').split(' ').forEach((function(t){var r=t.trim(),i="translate".concat(e.toUpperCase(),"(");0===r.indexOf(i)&&(n=parseFloat(r.replace(i,'')))})),n},setTranslate:function(t,e,n){var r="translate".concat(e.toUpperCase(),"("),i="".concat(r).concat(n,")"),o=(t||'').split(' ').map((function(t){return 0===t.trim().indexOf(r)&&(t=i),t})).join(' ');return o.indexOf(r)<0&&(o+=" ".concat(i)),o},getPosition:function(){var t=this.target,e=this.isTran,n=t.getStyle(),r=n.left,i=n.top,o=n.transform,a=0,s=0;return e?(a=this.getTranslate(o),s=this.getTranslate(o,'y')):(a=parseFloat(r||0),s=parseFloat(i||0)),{x:a,y:s}},setPosition:function(t){var e=t.x,n=t.y,r=t.end,i=t.position,a=t.width,s=t.height,c=this.target,l=this.isTran,u=this.em,d='px',h=r?'':1,f="".concat(e).concat(d),p="".concat(n).concat(d),g={};if(l){var v=c.getStyle()['transform']||'';v=this.setTranslate(v,'x',f),g={transform:v=this.setTranslate(v,'y',p),en:h},c.addStyle(g,{avoidStore:!r})}else{var m={position:i,width:a,height:s},y={left:f,top:p,en:h};Object(o["keys"])(m).forEach((function(t){var e=m[t];e&&(y[t]=e)})),g=y,c.addStyle(g,{avoidStore:!r})}u.getSelected()&&Object(o["keys"])(g).forEach((function(t){return u.trigger("update:component:style:".concat(t))}))},_getDragData:function(){var t=this.target;return{target:t,parent:t.parent(),index:t.index()}},onStart:function(t){var e=this.target,n=this.editor,r=this.isTran,i=this.opts,o=i.center,a=i.onStart,s=n.Canvas,c=e.getStyle(),l='absolute';if(a&&a(this._getDragData()),!r&&c.position!==l){var u=s.offset(e.getEl()),d=u.left,h=u.top,f=u.width,p=u.height;if(o){var g=s.getMouseRelativeCanvas(t);d=g.x,h=g.y}this.setPosition({x:d,y:h,width:"".concat(f,"px"),height:"".concat(p,"px"),position:l})}},onDrag:function(){var t=this,e=this.guidesTarget,n=this.opts,r=n.onDrag;this.updateGuides(e),n.debug&&e.forEach((function(e){return t.renderGuide(e)})),n.guidesInfo&&this.renderGuideInfo(e.filter((function(t){return t.active}))),r&&r(this._getDragData())},onEnd:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.editor,i=this.opts,o=this.id,a=i.onEnd;a&&a(t,n,c(c({event:t},n),this._getDragData())),r.stopCommand(o),this.hideGuidesInfo(),this.em.trigger("".concat(l,":end"),this.getEventOpts())},hideGuidesInfo:function(){var t=this;['X','Y'].forEach((function(e){var n=t["elGuideInfo".concat(e)];n&&(n.style.display='none')}))},renderGuideInfo:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.guidesStatic;this.hideGuidesInfo(),e.forEach((function(e){var r=e.origin,i=e.x,a=t.getElementPos(r),s=Object(o["isUndefined"])(i)?'y':'x',u='y'===s,d=a[u?'left':'top'],h=a.rect[u?'left':'top'],f=u?d+a.width:d+a.height,p=u?h+a.rect.width:h+a.rect.height,g=t["elGuideInfo".concat(s.toUpperCase())],v=t["elGuideInfoContent".concat(s.toUpperCase())],m=g.style,y=n.filter((function(t){return t.type===e.type})).map((function(t){var e=t.originRect,n=e.left,r=e.width,i=e.top,o=e.height,a=u?n+r:i+o;return{gap:a0})).sort((function(t,e){return t.gap-e.gap})).map((function(t){return t.guide}))[0];if(y){var b=y.originRect,w=b.left,O=b.width,x=b.top,C=b.height,k=b.rect,S=u?w2&&void 0!==arguments[2]?arguments[2]:{};if(t.Canvas.hasFocus()||n.force){var r=[];t.getSelectedAll().forEach((function(t){for(var e=t.parent();e&&!e.get('selectable');)e=e.parent();e&&r.push(e)})),r.length&&t.select(r)}}}},function(t,e,n){"use strict";n.r(e),e["default"]={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var r,i=n.components().length,o=0,a=0;do{o++,r=(a=t.index()+o)<=i?n.getChildAt(a):null}while(r&&!r.get('selectable'));e.push(r||t)}})),e.length&&t.select(e)}}}},function(t,e,n){"use strict";n.r(e),e["default"]={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var r,i=0,o=0;do{i++,r=(o=t.index()-i)>=0?n.getChildAt(o):null}while(r&&!r.get('selectable'));e.push(r||t)}})),e.length&&t.select(e)}}}},function(t,e,n){"use strict";n.r(e);var r=n(0);e["default"]={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.target,o=[];if(!i.get('styles'))return o;var a=i.get('type'),s=t.Pages.getAllWrappers(),c=Object(r["flatten"])(s.map((function(t){return t.findType(a)}))).length;if(!c){var l=t.CssComposer.getAll();o=l.filter((function(t){return t.get('group')==="cmp:".concat(a)})),l.remove(o)}return o}}},function(t,e,n){"use strict";n.r(e);var r=n(11),i=n.n(r);e["default"]={run:function(t){var e=t.getModel(),n=i()(t.getSelectedAll());n.length&&e.set('clipboard',n)}}},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n(2),o=n.n(i),a=n(22),s=o.a.$;e["default"]=Object(r["extend"])({},a["default"],{init:function(t){Object(r["bindAll"])(this,'startDelete','stopDelete','onDelete'),this.hoverClass=this.pfx+'hover-delete',this.badgeClass=this.pfx+'badge-red'},enable:function(){this.$el.find('*').mouseover(this.startDelete).mouseout(this.stopDelete).click(this.onDelete)},startDelete:function(t){t.stopPropagation();var e=s(t.target);e.data('model').get('removable')&&(e.addClass(this.hoverClass),this.attachBadge(e.get(0)))},stopDelete:function(t){t.stopPropagation(),s(t.target).removeClass(this.hoverClass),this.badge&&this.badge.css({left:-1e3,top:-1e3})},onDelete:function(t){t.stopPropagation();var e=s(t.target);e.data('model').get('removable')&&(e.data('model').destroy(),this.removeBadge(),this.clean())},updateBadgeLabel:function(t){this.badge.html('Remove '+t.getName())}})},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r).a.$;e["default"]={run:function(t,e){var n=this;e&&e.set&&e.set('active',0);var r=t.getConfig(),o=t.Modal,a=r.stylePrefix;if(this.cm=t.CodeManager||null,!this.$editors){var s=this.buildEditor('htmlmixed','hopscotch','HTML'),c=this.buildEditor('css','hopscotch','CSS');this.htmlEditor=s.el,this.cssEditor=c.el;var l=i("
"));l.append(s.$el).append(c.$el),this.$editors=l}o.open({title:r.textViewCode,content:this.$editors}).getModel().once('change:open',(function(){return t.stopCommand(n.id)})),this.htmlEditor.setContent(t.getHtml()),this.cssEditor.setContent(t.getCss())},stop:function(t){var e=t.Modal;e&&e.close()},buildEditor:function(t,e,n){var r=document.createElement('textarea');!this.codeMirror&&(this.codeMirror=this.cm.getViewer('CodeMirror'));var i=this.codeMirror.clone().set({label:n,codeName:t,theme:e,input:r}),o=new this.cm.EditorView({model:i,config:this.cm.getConfig()}).render().$el;return i.init(r),{el:i,$el:o}}}},function(t,e,n){"use strict";n.r(e);var r=n(0);e["default"]={isEnabled:function(){var t=document;return t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement?1:0},enable:function(t){var e='';return t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?(e='webkit',t.webkitRequestFullscreen()):t.mozRequestFullScreen?(e='moz',t.mozRequestFullScreen()):t.msRequestFullscreen?t.msRequestFullscreen():console.warn('Fullscreen not supported'),e},disable:function(){var t=document;this.isEnabled()&&(t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen())},fsChanged:function(t,e){document;var n=(t||'')+'fullscreenchange';this.isEnabled()||(this.stop(null,this.sender),document.removeEventListener(n,this.fsChanged))},run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.sender=e;var i=n.target,o=Object(r["isElement"])(i)?i:document.querySelector(i),a=this.enable(o||t.getContainer());this.fsChanged=this.fsChanged.bind(this,a),document.addEventListener(a+'fullscreenchange',this.fsChanged),t.trigger('change:canvasOffset')},stop:function(t,e){e&&e.set&&e.set('active',!1),this.disable(),t&&t.trigger('change:canvasOffset')}}},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n(2),o=n.n(i),a=n(1),s=n(22),c=n(35),l=o.a.$;e["default"]=Object(r["extend"])({},c["default"],s["default"],{init:function(t){s["default"].init.apply(this,arguments),Object(r["bindAll"])(this,'initSorter','rollback','onEndMove'),this.opt=t,this.hoverClass=this.ppfx+'highlighter-warning',this.badgeClass=this.ppfx+'badge-warning',this.noSelClass=this.ppfx+'no-select'},enable:function(){for(var t=arguments.length,e=new Array(t),n=0;n2&&void 0!==arguments[2]?arguments[2]:{},r=t.AssetManager,o=r.getConfig(),a=n.types,s=void 0===a?[]:a,c=n.accept,l=n.select;if(this.title=n.modalTitle||t.t('assetManager.modalTitle')||'',this.editor=t,this.config=o,this.am=r,r.setTarget(n.target),r.onClick(n.onClick),r.onDblClick(n.onDblClick),r.onSelect(n.onSelect),r.__behaviour({select:l,types:s,options:n}),o.custom)this.rendered=this.rendered||Object(i["f"])('div'),this.rendered.className="".concat(o.stylePrefix,"custom-wrp"),r.__behaviour({container:this.rendered}),r.__trgCustom();else{if(!this.rendered||s){var u=r.getAll().filter((function(t){return t}));s&&s.length&&(u=u.filter((function(t){return-1!==s.indexOf(t.get('type'))}))),r.render(u),this.rendered=r.getContainer()}if(c){var d=this.rendered.querySelector("input#".concat(o.stylePrefix,"uploadFile"));d&&d.setAttribute('accept',c)}}return this.open(this.rendered),this},stop:function(t){this.editor=t,this.close(this.rendered)}}},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n(13);e["default"]={open:function(){var t=this.container,e=this.editor,n=this.bm,i=this.config,o=i.custom,a=i.appendTo;if(Object(r["isFunction"])(o.open))return o.open(n.__customData());if(this.firstRender&&!a){var s='views-container',c=e.Panels;(c.getPanel(s)||c.addPanel({id:s})).set('appendContent',t).trigger('change:appendContent'),o||t.appendChild(n.render())}t&&(t.style.display='block')},close:function(){var t=this.container,e=this.config.custom;if(Object(r["isFunction"])(e.close))return e.close(this.bm.__customData());t&&(t.style.display='none')},run:function(t){var e=t.Blocks;this.config=e.getConfig(),this.firstRender=!this.container,this.container=this.container||Object(i["f"])('div'),this.editor=t,this.bm=e;var n=this.container;e.__behaviour({container:n}),this.config.custom&&e.__trgCustom(),this.open()},stop:function(){this.close()}}},function(t,e,n){"use strict";n.r(e),e["default"]={run:function(t){var e=t.LayerManager,n=t.Panels;if(!e.getConfig().appendTo){if(!this.layers){var r='views-container',i=document.createElement('div'),o=n.getPanel(r)||n.addPanel({id:r});i.appendChild(e.render()),o.set('appendContent',i).trigger('change:appendContent'),this.layers=i}this.layers.style.display='block'}},stop:function(){var t=this.layers;t&&(t.style.display='none')}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r).a.$;e["default"]={run:function(t,e){if(this.sender=e,!this.$cn){var n=t.getConfig(),r=t.Panels,o='change:appendContent';this.$cn=i('
'),this.$cn2=i('
'),this.$cn.append(this.$cn2);var a=t.DeviceManager;if(a&&n.showDevices){var s=r.addPanel({id:'devices-c'}),c=a.render();s.set('appendContent',c).trigger(o)}var l=t.SelectorManager,u=l.getConfig();u.custom?l.__trgCustom({container:this.$cn2.get(0)}):u.appendTo||this.$cn2.append(l.render([]));var d=t.StyleManager,h=d.getConfig();if(!h.appendTo){this.$cn2.append(d.render());var f=h.stylePrefix;this.$header=i("
").concat(t.t('styleManager.empty'),"
")),this.$cn.append(this.$header)}var p='views-container';this.panel=r.getPanel(p),this.panel||(this.panel=r.addPanel({id:p})),this.panel.set('appendContent',this.$cn).trigger(o),this.target=t.editor,this.listenTo(this.target,'component:toggled',this.toggleSm)}this.toggleSm()},toggleSm:function(){var t=this.target,e=this.sender;if(!e||!e.get||e.get('active')){var n=t.get('SelectorManager').getConfig().componentFirst,r=t.getSelectedAll().length;1===r||r>1&&n?(this.$cn2&&this.$cn2.show(),this.$header&&this.$header.hide()):(this.$cn2&&this.$cn2.hide(),this.$header&&this.$header.show())}},stop:function(){this.$cn2&&this.$cn2.hide(),this.$header&&this.$header.hide()}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r).a.$;e["default"]={run:function(t,e){this.sender=e;var n=t.getModel(),r=t.Config.stylePrefix,o=t.TraitManager,a=o.getConfig();if(!a.appendTo){if(!this.$cn){this.$cn=i('
'),this.$cn2=i('
'),this.$cn.append(this.$cn2),this.$header=i('
').append("
").concat(n.t('traitManager.empty'),"
")),this.$cn.append(this.$header),this.$cn2.append("
").concat(n.t('traitManager.label'),"
")),this.$cn2.append(o.render());var s=t.Panels;(s.getPanel('views-container')?s.getPanel('views-container'):s.addPanel({id:'views-container'})).set('appendContent',this.$cn.get(0)).trigger('change:appendContent'),this.target=t.getModel(),this.listenTo(this.target,'component:toggled',this.toggleTm)}this.toggleTm()}},toggleTm:function(){var t=this.sender;t&&t.get&&!t.get('active')||(1===this.target.getSelectedAll().length?(this.$cn2.show(),this.$header.hide()):(this.$cn2.hide(),this.$header.show()))},stop:function(){this.$cn2&&this.$cn2.hide(),this.$header&&this.$header.hide()}}},function(t,e,n){"use strict";n.r(e);var r=n(0);e["default"]={run:function(t){var e=t.getModel().get('clipboard'),n=t.getSelected();e&&n&&(t.getSelectedAll().forEach((function(n){if(n){var i,o=n.collection,a=o.indexOf(n)+1,s=e.filter((function(t){return t.get('copyable')}));i=Object(r["contains"])(e,n)&&n.get('copyable')?o.add(n.clone(),{at:a}):o.add(s.map((function(t){return t.clone()})),{at:a}),(i=Object(r["isArray"])(i)?i:[i]).forEach((function(e){return t.trigger('component:paste',e)}))}})),n.emitUpdate())}}},function(t,e,n){"use strict";n.r(e);var r=n(11),i=n.n(r),o=n(0),a='sw-visibility';e["default"]={getPanels:function(t){return this.panels||(this.panels=t.Panels.getPanels()),this.panels},preventDrag:function(t){t.abort=1},tglEffects:function(t){var e=this.em,n=t?'on':'off';if(e){var r=e.get('Canvas'),i=r.getBody(),a=r.getToolbarEl();a&&(a.style.display=t?'none':'');var s=i.querySelectorAll(".".concat(this.ppfx,"no-pointer"));Object(o["each"])(s,(function(e){return e.style.pointerEvents=t?'all':''})),e[n]('run:tlb-move:before',this.preventDrag)}},run:function(t,e){var n=this;this.sender=e,this.selected=i()(t.getSelectedAll()),t.select(),this.shouldRunSwVisibility||(this.shouldRunSwVisibility=t.Commands.isActive(a)),this.shouldRunSwVisibility&&t.stopCommand(a),t.getModel().stopDefault();var r=this.getPanels(t),o=t.Canvas.getElement(),s=t.getEl(),c=t.Config.stylePrefix;if(!this.helper){var l=document.createElement('span');l.className="".concat(c,"off-prv fa fa-eye-slash"),s.appendChild(l),l.onclick=function(){return n.stopCommand()},this.helper=l}this.helper.style.display='inline-block',r.forEach((function(t){return t.set('visible',!1)}));var u=o.style;u.width='100%',u.height='100%',u.top='0',u.left='0',u.padding='0',u.margin='0',t.refresh(),this.tglEffects(1)},stop:function(t){var e=this.sender,n=void 0===e?{}:e,r=this.selected;n.set&&n.set('active',0);var i=this.getPanels(t);this.shouldRunSwVisibility&&(t.runCommand(a),this.shouldRunSwVisibility=!1),t.getModel().runDefault(),i.forEach((function(t){return t.set('visible',!0)})),t.Canvas.getElement().setAttribute('style',''),r&&t.select(r),delete this.selected,this.helper&&(this.helper.style.display='none'),t.refresh(),this.tglEffects()}}},function(t,e,n){"use strict";n.r(e),e["default"]={run:function(t,e,n){var r=n||{},i=r.el||'',o=t.Canvas,a=this.canvasResizer,s=r.options||{},c=o.getCanvasView();return s.appendTo=o.getResizerEl(),s.prefix=t.getConfig().stylePrefix,s.posFetcher=c.getElementPos.bind(c),s.mousePosFetcher=o.getMouseRelativePos,a&&!r.forceNew||(this.canvasResizer=t.Utils.Resizer.init(s),a=this.canvasResizer),a.setOptions(s),a.blur(),a.focus(i),a},stop:function(){var t=this.canvasResizer;t&&t.blur()}}},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r),o=n(2),a=n.n(o),s=n(0),c=n(1);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var u=a.a.$;e["default"]={getOffsetMethod:function(t){return'get'+(t||'')+'OffsetViewerEl'},run:function(t,e,n){var r=n||{},o=r.state||'',a=t.getConfig(),d=this.em.getZoomDecimal(),h=r.el||'';if(!a.showOffsets||Object(c["isTextNode"])(h)||!a.showOffsetsSelected&&'Fixed'==o)t.stopCommand(this.id,n);else{var f=t.Canvas,p=function(t){for(var e=1;e")).get(0),M=u("
")).get(0),D=v+E+'-el',A="".concat(v+P+'-el'," ").concat(v+P),L="".concat(D," ").concat(v+E);b=u("
")).get(0),w=u("
")).get(0),O=u("
")).get(0),x=u("
")).get(0),C=u("
")).get(0),k=u("
")).get(0),S=u("
")).get(0),j=u("
")).get(0),this['marginT'+o]=b,this['marginB'+o]=w,this['marginL'+o]=O,this['marginR'+o]=x,this['padT'+o]=C,this['padB'+o]=k,this['padL'+o]=S,this['padR'+o]=j,_.appendChild(b),_.appendChild(w),_.appendChild(O),_.appendChild(x),M.appendChild(C),M.appendChild(k),M.appendChild(S),M.appendChild(j),y.appendChild(_),y.appendChild(M),this[m]='1'}var N='px',R=parseFloat(g.marginLeft.replace(N,''))*d,I=parseFloat(g.marginRight.replace(N,''))*d,F=parseFloat(g.marginTop.replace(N,''))*d,V=parseFloat(g.marginBottom.replace(N,''))*d,z=b.style,H=w.style,B=O.style,U=x.style,$=C.style,W=k.style,q=S.style,G=j.style,K=parseFloat(p.left),Y=parseFloat(g.width)*d+N;z.height=F+N,z.width=Y,z.top=p.top-F+N,z.left=K+N,H.height=V+N,H.width=Y,H.top=p.top+p.height+N,H.left=K+N;var X=p.height+F+V+N,J=p.top-F+N;B.height=X,B.width=R+N,B.top=J,B.left=K-R+N,U.height=X,U.width=I+N,U.top=J,U.left=K+p.width+N;var Z=parseFloat(g.paddingTop)*d;$.height=Z+N;var Q=parseFloat(g.paddingBottom)*d;W.height=Q+N;var tt=p.height-Q-Z+N,et=p.top+Z+N;q.height=tt,q.width=parseFloat(g.paddingLeft)*d+N,q.top=et;var nt=parseFloat(g.paddingRight)*d;G.height=tt,G.width=nt+N,G.top=et}},stop:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n||{},i=r.state||'',o=this.getOffsetMethod(i),a=t.Canvas,s=a[o](n.view);s.style.opacity=0}}},function(t,e,n){"use strict";n.r(e);var r=n(0);e["default"]={init:function(){Object(r["bindAll"])(this,'_onFramesChange')},run:function(t){this.toggleVis(t)},stop:function(t){this.toggleVis(t,0)},toggleVis:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!t.Commands.isActive('preview')){var r=t.Canvas,i=n?'on':'off';r.getFrames().forEach((function(t){return e._upFrame(t,n)})),r.getModel()[i]('change:frames',this._onFramesChange)}},_onFramesChange:function(t,e){var n=this;e.forEach((function(t){return n._upFrame(t,1)}))},_upFrame:function(t,e){var n=e?'add':'remove';t.view.getBody().classList[n]("".concat(this.ppfx,"dashed"))}}},function(t,e,n){var r;r=function(t,e){var n=Array.prototype.slice;function r(t,e,n){return n.length<=4?t.call(e,n[0],n[1],n[2],n[3]):t.apply(e,n)}function i(t,e){return n.call(t,e)}function o(e,n){return null!=e&&(t.isArray(n)||(n=i(arguments,1)),t.all(n,(function(t){return t in e})))}var a,s,c=(a=!1,s=-1,function(){return a||(s++,a=!0,t.defer((function(){a=!1}))),s});function l(){this.registeredObjects=[],this.cidIndexes=[]}function u(e,n,r,i){for(var o,a=0,s=n.length;at.maximumStackLength&&(t.shift(),t.pointer--)}}}l.prototype={isRegistered:function(e){return e&&e.cid?this.registeredObjects[e.cid]:t.contains(this.registeredObjects,e)},register:function(t){return!this.isRegistered(t)&&(t&&t.cid?(this.registeredObjects[t.cid]=t,this.cidIndexes.push(t.cid)):this.registeredObjects.push(t),!0)},unregister:function(e){if(this.isRegistered(e)){if(e&&e.cid)delete this.registeredObjects[e.cid],this.cidIndexes.splice(t.indexOf(this.cidIndexes,e.cid),1);else{var n=t.indexOf(this.registeredObjects,e);this.registeredObjects.splice(n,1)}return!0}return!1},get:function(){return t.map(this.cidIndexes,(function(t){return this.registeredObjects[t]}),this).concat(this.registeredObjects)}};var p={add:{undo:function(t,e,n,r){t.remove(n,r)},redo:function(t,e,n,r){r.index&&(r.at=r.index),t.add(n,r)},on:function(e,n,r){return{object:n,before:void 0,after:e,options:t.clone(r)}}},remove:{undo:function(t,e,n,r){"index"in r&&(r.at=r.index),t.add(e,r)},redo:function(t,e,n,r){t.remove(e,r)},on:function(e,n,r){return{object:n,before:e,after:void 0,options:t.clone(r)}}},change:{undo:function(e,n,r,i){t.isEmpty(n)?t.each(t.keys(r),e.unset,e):(e.set(n),i&&i.unsetData&&i.unsetData.before&&i.unsetData.before.length&&t.each(i.unsetData.before,e.unset,e))},redo:function(e,n,r,i){t.isEmpty(r)?t.each(t.keys(n),e.unset,e):(e.set(r),i&&i.unsetData&&i.unsetData.after&&i.unsetData.after.length&&t.each(i.unsetData.after,e.unset,e))},on:function(e,n){var r=e.changedAttributes(),i=t.keys(r),o=t.pick(e.previousAttributes(),i),a=t.keys(o),s=(n||(n={})).unsetData={after:[],before:[]};return i.length!=a.length&&(i.length>a.length?t.each(i,(function(t){t in o||s.before.push(t)}),this):t.each(a,(function(t){t in r||s.after.push(t)}))),{object:e,before:o,after:r,options:t.clone(n)}}},reset:{undo:function(t,e,n){t.reset(e)},redo:function(t,e,n){t.reset(n)},on:function(e,n){return{object:e,before:n.previousModels,after:t.clone(e.models)}}}};function g(){}function v(e,n,r,i){if("object"==typeof n)return t.each(n,(function(t,n){2===e?v(e,t,r,i):v(e,n,t,r)}));switch(e){case 0:o(r,"undo","redo","on")&&t.all(t.pick(r,"undo","redo","on"),t.isFunction)&&(i[n]=r);break;case 1:i[n]&&t.isObject(r)&&(i[n]=t.extend({},i[n],r));break;case 2:delete i[n]}return this}g.prototype=p;var m=e.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(t){d("undo",this.attributes)},redo:function(t){d("redo",this.attributes)}}),y=e.Collection.extend({model:m,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(t){this.maximumStackLength=t}}),b=e.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(e){this.stack=new y,this.objectRegistry=new l,this.undoTypes=new g,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",(function(t,e){this.stack.setMaxLength(e)}),this),e&&e.track&&this.startTracking(),e&&e.register&&(t.isArray(e.register)||t.isArguments(e.register)?r(this.register,this,e.register):this.register(e.register))},startTracking:function(){this.set("track",!0),this.stack.track=!0},stopTracking:function(){this.set("track",!1),this.stack.track=!1},isTracking:function(){return this.get("track")},_addToStack:function(t){f(this.stack,t,i(arguments,1),this.undoTypes)},register:function(){u("on",arguments,this._addToStack,this)},unregister:function(){u("off",arguments,this._addToStack,this)},unregisterAll:function(){r(this.unregister,this,this.objectRegistry.get())},undo:function(t){h("undo",this,this.stack,t)},undoAll:function(){h("undo",this,this.stack,!1,!0)},redo:function(t){h("redo",this,this.stack,t)},redoAll:function(){h("redo",this,this.stack,!1,!0)},isAvailable:function(t){var e=this.stack,n=e.length;switch(t){case"undo":return n>0&&e.pointer>-1;case"redo":return n>0&&e.pointer=0||(i[n]=t[n]);return i},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r),o=n(76),a=n.n(o),s=n(0);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function l(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};n=l(l({},i),d),t=n.em,this.em=t;var h=!0;return(e=new a.a(l({track:!0,register:[]},n))).changeUndoType('change',{condition:function(t){var e=t.get('_undo');if(e){var n=t.get('_undoexc');if(Object(s["isArray"])(n)&&c(t).some((function(t){return n.indexOf(t)>=0})))return!1;if(Object(s["isBoolean"])(e))return!0;if(Object(s["isArray"])(e)&&c(t).some((function(t){return e.indexOf(t)>=0})))return!0}return!1},on:function(t,e,n){!r&&(r=t.previousAttributes());var i=n||e||{};if(i.noUndo&&setTimeout((function(){r=null})),!o(i)){var a=t.toJSON({fromUndo:h}),c={object:t,before:r,after:a};if(r=null,!Object(s["isEmpty"])(a))return c}}}),e.changeUndoType('add',{on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!o(n)&&u.isRegistered(e))return{object:e,before:void 0,after:t,options:l(l({},n),{},{fromUndo:h})}}}),e.changeUndoType('remove',{on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!o(n)&&u.isRegistered(e))return{object:e,before:t,after:void 0,options:l(l({},n),{},{fromUndo:h})}}}),e.on('undo redo',(function(){t.trigger('component:toggled change:canvasOffset'),t.getSelectedAll().map((function(t){return t.trigger('rerender:layer')}))})),['undo','redo'].forEach((function(n){return e.on(n,(function(){return t.trigger(n)}))})),this},postLoad:function(){n.trackSelection&&t&&this.add(t.get('selected'))},getConfig:function(){return n},add:function(t){return e.register(t),this},remove:function(t){return e.unregister(t),this},removeAll:function(){return e.unregisterAll(),this},start:function(){return e.startTracking(),this},stop:function(){return e.stopTracking(),this},undo:function(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!t.isEditing()&&e.undo(n),this},undoAll:function(){return e.undoAll(),this},redo:function(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!t.isEditing()&&e.redo(n),this},redoAll:function(){return e.redoAll(),this},hasUndo:function(){return e.isAvailable('undo')},hasRedo:function(){return e.isAvailable('redo')},isRegistered:function(t){return!!this.getInstance().objectRegistry.isRegistered(t)},getStack:function(){return e.stack},getStackGroup:function(){var t=[],e=[];return this.getStack().forEach((function(n){var r=n.get('magicFusionIndex');e.indexOf(r)<0&&(e.push(r),t.push(n))})),t},__getStackRead:function(){var t={};return this.getStack().forEach((function(e){var n=e.get('magicFusionIndex'),r=function(t){var e=t.attributes;return{type:e.type,after:e.after,before:e.before,object:e.object}}(e);t[n]?t[n].push(r):t[n]=[r]})),Object.keys(t).map((function(e){return t[e]}))},getPointer:function(){return this.getStack().pointer},clear:function(){return e.clear(),this},getInstance:function(){return e},destroy:function(){this.clear().removeAll(),[t,e,n,r].forEach((function(t){return{}})),this.em={}}}}},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(85),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(34))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,a,s,c=1,l={},u=!1,d=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},r=function(t){o.port2.postMessage(t)}):d&&"onreadystatechange"in d.createElement("script")?(i=d.documentElement,r=function(t){var e=d.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(p,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&p(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),r=function(e){t.postMessage(a+e,"*")}),h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;n","i")}function o(t,e){for(var n in t)for(var r=e[n]||(e[n]=[]),i=t[n],o=i.length-1;o>=0;o--)r.unshift(i[o])}t.defineMode("htmlmixed",(function(n,a){var s=t.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:a.multilineTagIndentFactor,multilineTagIndentPastTag:a.multilineTagIndentPastTag,allowMissingTagName:a.allowMissingTagName}),c={},l=a&&a.tags,u=a&&a.scriptTypes;if(o(e,c),l&&o(l,c),u)for(var d=u.length-1;d>=0;d--)c.script.unshift(["type",u[d].matches,u[d].mode]);function h(e,o){var a,l=s.token(e,o.htmlState),u=/\btag\b/.test(l);if(u&&!/[<>\s\/]/.test(e.current())&&(a=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&c.hasOwnProperty(a))o.inTag=a+" ";else if(o.inTag&&u&&/>$/.test(e.current())){var d=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var f=">"==e.current()&&function(t,e){for(var n=0;n-1?t.backUp(r.length-i):r.match(/<\/?$/)&&(t.backUp(r.length),t.match(e,!1)||t.match(r)),n}(t,v,e.localMode.token(t,e.localState))},o.localMode=p,o.localState=t.startState(p,s.indent(o.htmlState,"",""))}else o.inTag&&(o.inTag+=e.current(),e.eol()&&(o.inTag+=" "));return l}return{startState:function(){return{token:h,inTag:null,localMode:null,localState:null,htmlState:t.startState(s)}},copyState:function(e){var n;return e.localState&&(n=t.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:n,htmlState:t.copyState(s,e.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(e,n,r){return!e.localMode||/^\s*<\//.test(n)?s.indent(e.htmlState,n,r):e.localMode.indent?e.localMode.indent(e.localState,n,r):t.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||s}}}}),"xml","javascript","css"),t.defineMIME("text/html","htmlmixed")}(n(26),n(90),n(91),n(51))},function(t,e,n){1&&function(t){"use strict";var e={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};t.defineMode("xml",(function(r,i){var o,a,s=r.indentUnit,c={},l=i.htmlMode?e:n;for(var u in l)c[u]=l[u];for(var u in i)c[u]=i[u];function d(t,e){function n(n){return e.tokenize=n,n(t,e)}var r=t.next();return"<"==r?t.eat("!")?t.eat("[")?t.match("CDATA[")?n(f("atom","]]>")):null:t.match("--")?n(f("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(function t(e){return function(n,r){for(var i;null!=(i=n.next());){if("<"==i)return r.tokenize=t(e+1),r.tokenize(n,r);if(">"==i){if(1==e){r.tokenize=d;break}return r.tokenize=t(e-1),r.tokenize(n,r)}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=f("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",e.tokenize=h,"tag bracket"):"&"==r?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function h(t,e){var n,r,i=t.next();if(">"==i||"/"==i&&t.eat(">"))return e.tokenize=d,o=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return o="equals",null;if("<"==i){e.tokenize=d,e.state=y,e.tagName=e.tagStart=null;var a=e.tokenize(t,e);return a?a+" tag error":"tag error"}return/[\'\"]/.test(i)?(e.tokenize=(n=i,(r=function(t,e){for(;!t.eol();)if(t.next()==n){e.tokenize=h;break}return"string"}).isInAttribute=!0,r),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(t,e){return function(n,r){for(;!n.eol();){if(n.match(e)){r.tokenize=d;break}n.next()}return t}}function p(t){return t&&t.toLowerCase()}function g(t,e,n){this.prev=t.context,this.tagName=e||"",this.indent=t.indented,this.startOfLine=n,(c.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function v(t){t.context&&(t.context=t.context.prev)}function m(t,e){for(var n;1;){if(!t.context)return;if(n=t.context.tagName,!c.contextGrabbers.hasOwnProperty(p(n))||!c.contextGrabbers[p(n)].hasOwnProperty(p(e)))return;v(t)}}function y(t,e,n){return"openTag"==t?(n.tagStart=e.column(),b):"closeTag"==t?w:y}function b(t,e,n){return"word"==t?(n.tagName=e.current(),a="tag",C):c.allowMissingTagName&&"endTag"==t?(a="tag bracket",C(t,0,n)):(a="error",b)}function w(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&c.implicitlyClosed.hasOwnProperty(p(n.context.tagName))&&v(n),n.context&&n.context.tagName==r||!1===c.matchClosing?(a="tag",O):(a="tag error",x)}return c.allowMissingTagName&&"endTag"==t?(a="tag bracket",O(t,0,n)):(a="error",x)}function O(t,e,n){return"endTag"!=t?(a="error",O):(v(n),y)}function x(t,e,n){return a="error",O(t,0,n)}function C(t,e,n){if("word"==t)return a="attribute",k;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||c.autoSelfClosers.hasOwnProperty(p(r))?m(n,r):(m(n,r),n.context=new g(n,r,i==n.indented)),y}return a="error",C}function k(t,e,n){return"equals"==t?S:(c.allowMissing||(a="error"),C(t,0,n))}function S(t,e,n){return"string"==t?j:"word"==t&&c.allowUnquoted?(a="string",C):(a="error",C(t,0,n))}function j(t,e,n){return"string"==t?j:C(t,0,n)}return d.isInText=!0,{startState:function(t){var e={tokenize:d,state:y,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;o=null;var n=e.tokenize(t,e);return(n||o)&&"comment"!=n&&(a=null,e.state=e.state(o||n,t,e),a&&(n="error"==a?n+" error":a)),n},indent:function(e,n,r){var i=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+s;if(i&&i.noIndent)return t.Pass;if(e.tokenize!=h&&e.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==c.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+s*(c.multilineTagIndentFactor||1);if(c.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:c.htmlMode?"html":"xml",helperType:c.htmlMode?"html":"xml",skipAttribute:function(t){t.state==S&&(t.state=C)},xmlCurrentTag:function(t){return t.tagName?{name:t.tagName,close:"closeTag"==t.type}:null},xmlCurrentContext:function(t){for(var e=[],n=t.context;n;n=n.prev)e.push(n.tagName);return e.reverse()}}})),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(26))},function(t,e,n){1&&function(t){"use strict";t.defineMode("javascript",(function(e,n){var r,i,o=e.indentUnit,a=n.statementIndent,s=n.jsonld,c=n.json||s,l=!1!==n.trackScope,u=n.typescript,d=n.wordCharacters||/[\w$\xa1-\uffff]/,h=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),r=t("keyword c"),i=t("keyword d"),o=t("operator"),a={type:"atom",style:"atom"};return{if:t("if"),while:e,with:e,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:t("new"),delete:r,void:r,throw:r,debugger:t("debugger"),var:t("var"),const:t("var"),let:t("var"),function:t("function"),catch:t("catch"),for:t("for"),switch:t("switch"),case:t("case"),default:t("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:t("this"),class:t("class"),super:t("atom"),yield:r,export:t("export"),import:t("import"),extends:r,await:r}}(),f=/[+\-*&%=<>!?|~^@]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(t,e,n){return r=t,i=n,e}function v(t,e){var n,r=t.next();if('"'==r||"'"==r)return e.tokenize=(n=r,function(t,e){var r,i=!1;if(s&&"@"==t.peek()&&t.match(p))return e.tokenize=v,g("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=n||i);)i=!i&&"\\"==r;return i||(e.tokenize=v),g("string","string")}),e.tokenize(t,e);if("."==r&&t.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return g("number","number");if("."==r&&t.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return g(r);if("="==r&&t.eat(">"))return g("=>","operator");if("0"==r&&t.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return g("number","number");if(/\d/.test(r))return t.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),g("number","number");if("/"==r)return t.eat("*")?(e.tokenize=m,m(t,e)):t.eat("/")?(t.skipToEnd(),g("comment","comment")):Qt(t,e,1)?(function(t){for(var e,n=!1,r=!1;null!=(e=t.next());){if(!n){if("/"==e&&!r)return;"["==e?r=!0:r&&"]"==e&&(r=!1)}n=!n&&"\\"==e}}(t),t.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g("regexp","string-2")):(t.eat("="),g("operator","operator",t.current()));if("`"==r)return e.tokenize=y,y(t,e);if("#"==r&&"!"==t.peek())return t.skipToEnd(),g("meta","meta");if("#"==r&&t.eatWhile(d))return g("variable","property");if("<"==r&&t.match("!--")||"-"==r&&t.match("->")&&!/\S/.test(t.string.slice(0,t.start)))return t.skipToEnd(),g("comment","comment");if(f.test(r))return">"==r&&e.lexical&&">"==e.lexical.type||(t.eat("=")?"!"!=r&&"="!=r||t.eat("="):/[<>*+\-|&?]/.test(r)&&(t.eat(r),">"==r&&t.eat(r))),"?"==r&&t.eat(".")?g("."):g("operator","operator",t.current());if(d.test(r)){t.eatWhile(d);var i=t.current();if("."!=e.lastType){if(h.propertyIsEnumerable(i)){var o=h[i];return g(o.type,o.style,i)}if("async"==i&&t.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",i)}return g("variable","variable",i)}}function m(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=v;break}r="*"==n}return g("comment","comment")}function y(t,e){for(var n,r=!1;null!=(n=t.next());){if(!r&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=v;break}r=!r&&"\\"==n}return g("quasi","string-2",t.current())}var b="([{}])";function w(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t.string.slice(t.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=t.string.charAt(a),c=b.indexOf(s);if(c>=0&&c<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(c>=3&&c<6)++i;else if(d.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(t.string.charAt(a-1)==s&&"\\"!=t.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(e.fatArrowAt=a)}}var O={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function x(t,e,n,r,i,o){this.indented=t,this.column=e,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function C(t,e){if(!l)return!1;for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var r=t.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==e)return!0}function k(t,e,n,r,i){var o=t.cc;for(S.state=t,S.stream=i,S.marked=null,S.cc=o,S.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);1;)if((o.length?o.pop():c?B:z)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return S.marked?S.marked:"variable"==n&&C(t,r)?"variable-2":e}}var S={state:null,column:null,marked:null,cc:null};function j(){for(var t=arguments.length-1;t>=0;t--)S.cc.push(arguments[t])}function T(){return j.apply(null,arguments),!0}function P(t,e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}function E(t){var e=S.state;if(S.marked="def",l){if(e.context)if("var"==e.lexical.info&&e.context&&e.context.block){var r=function t(e,n){if(n){if(n.block){var r=t(e,n.prev);return r?r==n.prev?n:new M(r,n.vars,!0):null}return P(e,n.vars)?n:new M(n.prev,new D(e,n.vars),!1)}return null}(t,e.context);if(null!=r)return void(e.context=r)}else if(!P(t,e.localVars))return void(e.localVars=new D(t,e.localVars));n.globalVars&&!P(t,e.globalVars)&&(e.globalVars=new D(t,e.globalVars))}}function _(t){return"public"==t||"private"==t||"protected"==t||"abstract"==t||"readonly"==t}function M(t,e,n){this.prev=t,this.vars=e,this.block=n}function D(t,e){this.name=t,this.next=e}var A=new D("this",new D("arguments",null));function L(){S.state.context=new M(S.state.context,S.state.localVars,!1),S.state.localVars=A}function N(){S.state.context=new M(S.state.context,S.state.localVars,!0),S.state.localVars=null}function R(){S.state.localVars=S.state.context.vars,S.state.context=S.state.context.prev}function I(t,e){var n=function(){var n=S.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new x(r,S.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function F(){var t=S.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function V(t){return function e(n){return n==t?T():";"==t||"}"==n||")"==n||"]"==n?j():T(e)}}function z(t,e){return"var"==t?T(I("vardef",e),kt,V(";"),F):"keyword a"==t?T(I("form"),$,z,F):"keyword b"==t?T(I("form"),z,F):"keyword d"==t?S.stream.match(/^\s*$/,!1)?T():T(I("stat"),q,V(";"),F):"debugger"==t?T(V(";")):"{"==t?T(I("}"),N,ct,F,R):";"==t?T():"if"==t?("else"==S.state.lexical.info&&S.state.cc[S.state.cc.length-1]==F&&S.state.cc.pop()(),T(I("form"),$,z,F,_t)):"function"==t?T(Lt):"for"==t?T(I("form"),N,Mt,z,R,F):"class"==t||u&&"interface"==e?(S.marked="keyword",T(I("form","class"==t?t:e),Vt,F)):"variable"==t?u&&"declare"==e?(S.marked="keyword",T(z)):u&&("module"==e||"enum"==e||"type"==e)&&S.stream.match(/^\s*\w/,!1)?(S.marked="keyword","enum"==e?T(Jt):"type"==e?T(Rt,V("operator"),ft,V(";")):T(I("form"),St,V("{"),I("}"),ct,F,F)):u&&"namespace"==e?(S.marked="keyword",T(I("form"),B,z,F)):u&&"abstract"==e?(S.marked="keyword",T(z)):T(I("stat"),et):"switch"==t?T(I("form"),$,V("{"),I("}","switch"),N,ct,F,F,R):"case"==t?T(B,V(":")):"default"==t?T(V(":")):"catch"==t?T(I("form"),L,H,z,F,R):"export"==t?T(I("stat"),Ut,F):"import"==t?T(I("stat"),Wt,F):"async"==t?T(z):"@"==e?T(B,z):j(I("stat"),B,V(";"),F)}function H(t){if("("==t)return T(It,V(")"))}function B(t,e){return W(t,e,!1)}function U(t,e){return W(t,e,!0)}function $(t){return"("!=t?j():T(I(")"),q,V(")"),F)}function W(t,e,n){if(S.state.fatArrowAt==S.stream.start){var r=n?Z:J;if("("==t)return T(L,I(")"),at(It,")"),F,V("=>"),r,R);if("variable"==t)return j(L,St,V("=>"),r,R)}var i=n?K:G;return O.hasOwnProperty(t)?T(i):"function"==t?T(Lt,i):"class"==t||u&&"interface"==e?(S.marked="keyword",T(I("form"),Ft,F)):"keyword c"==t||"async"==t?T(n?U:B):"("==t?T(I(")"),q,V(")"),F,i):"operator"==t||"spread"==t?T(n?U:B):"["==t?T(I("]"),Xt,F,i):"{"==t?st(rt,"}",null,i):"quasi"==t?j(Y,i):"new"==t?T(function(t){return function(e){return"."==e?T(t?tt:Q):"variable"==e&&u?T(Ot,t?K:G):j(t?U:B)}}(n)):T()}function q(t){return t.match(/[;\}\)\],]/)?j():j(B)}function G(t,e){return","==t?T(q):K(t,e,!1)}function K(t,e,n){var r=0==n?G:K,i=0==n?B:U;return"=>"==t?T(L,n?Z:J,R):"operator"==t?/\+\+|--/.test(e)||u&&"!"==e?T(r):u&&"<"==e&&S.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?T(I(">"),at(ft,">"),F,r):"?"==e?T(B,V(":"),i):T(i):"quasi"==t?j(Y,r):";"!=t?"("==t?st(U,")","call",r):"."==t?T(nt,r):"["==t?T(I("]"),q,V("]"),F,r):u&&"as"==e?(S.marked="keyword",T(ft,r)):"regexp"==t?(S.state.lastType=S.marked="operator",S.stream.backUp(S.stream.pos-S.stream.start-1),T(i)):void 0:void 0}function Y(t,e){return"quasi"!=t?j():"${"!=e.slice(e.length-2)?T(Y):T(q,X)}function X(t){if("}"==t)return S.marked="string-2",S.state.tokenize=y,T(Y)}function J(t){return w(S.stream,S.state),j("{"==t?z:B)}function Z(t){return w(S.stream,S.state),j("{"==t?z:U)}function Q(t,e){if("target"==e)return S.marked="keyword",T(G)}function tt(t,e){if("target"==e)return S.marked="keyword",T(K)}function et(t){return":"==t?T(F,z):j(G,V(";"),F)}function nt(t){if("variable"==t)return S.marked="property",T()}function rt(t,e){return"async"==t?(S.marked="property",T(rt)):"variable"==t||"keyword"==S.style?(S.marked="property","get"==e||"set"==e?T(it):(u&&S.state.fatArrowAt==S.stream.start&&(n=S.stream.match(/^\s*:\s*/,!1))&&(S.state.fatArrowAt=S.stream.pos+n[0].length),T(ot))):"number"==t||"string"==t?(S.marked=s?"property":S.style+" property",T(ot)):"jsonld-keyword"==t?T(ot):u&&_(e)?(S.marked="keyword",T(rt)):"["==t?T(B,lt,V("]"),ot):"spread"==t?T(U,ot):"*"==e?(S.marked="keyword",T(rt)):":"==t?j(ot):void 0;var n}function it(t){return"variable"!=t?j(ot):(S.marked="property",T(Lt))}function ot(t){return":"==t?T(U):"("==t?j(Lt):void 0}function at(t,e,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=S.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),T((function(n,r){return n==e||r==e?j():j(t)}),r)}return i==e||o==e?T():n&&n.indexOf(";")>-1?j(t):T(V(e))}return function(n,i){return n==e||i==e?T():j(t,r)}}function st(t,e,n){for(var r=3;r"),ft):"quasi"==t?j(mt,wt):void 0}function pt(t){if("=>"==t)return T(ft)}function gt(t){return t.match(/[\}\)\]]/)?T():","==t||";"==t?T(gt):j(vt,gt)}function vt(t,e){return"variable"==t||"keyword"==S.style?(S.marked="property",T(vt)):"?"==e||"number"==t||"string"==t?T(vt):":"==t?T(ft):"["==t?T(V("variable"),ut,V("]"),vt):"("==t?j(Nt,vt):t.match(/[;\}\)\],]/)?void 0:T()}function mt(t,e){return"quasi"!=t?j():"${"!=e.slice(e.length-2)?T(mt):T(ft,yt)}function yt(t){if("}"==t)return S.marked="string-2",S.state.tokenize=y,T(mt)}function bt(t,e){return"variable"==t&&S.stream.match(/^\s*[?:]/,!1)||"?"==e?T(bt):":"==t?T(ft):"spread"==t?T(bt):j(ft)}function wt(t,e){return"<"==e?T(I(">"),at(ft,">"),F,wt):"|"==e||"."==t||"&"==e?T(ft):"["==t?T(ft,V("]"),wt):"extends"==e||"implements"==e?(S.marked="keyword",T(ft)):"?"==e?T(ft,V(":"),ft):void 0}function Ot(t,e){if("<"==e)return T(I(">"),at(ft,">"),F,wt)}function xt(){return j(ft,Ct)}function Ct(t,e){if("="==e)return T(ft)}function kt(t,e){return"enum"==e?(S.marked="keyword",T(Jt)):j(St,lt,Pt,Et)}function St(t,e){return u&&_(e)?(S.marked="keyword",T(St)):"variable"==t?(E(e),T()):"spread"==t?T(St):"["==t?st(Tt,"]"):"{"==t?st(jt,"}"):void 0}function jt(t,e){return"variable"!=t||S.stream.match(/^\s*:/,!1)?("variable"==t&&(S.marked="property"),"spread"==t?T(St):"}"==t?j():"["==t?T(B,V(']'),V(':'),jt):T(V(":"),St,Pt)):(E(e),T(Pt))}function Tt(){return j(St,Pt)}function Pt(t,e){if("="==e)return T(U)}function Et(t){if(","==t)return T(kt)}function _t(t,e){if("keyword b"==t&&"else"==e)return T(I("form","else"),z,F)}function Mt(t,e){return"await"==e?T(Mt):"("==t?T(I(")"),Dt,F):void 0}function Dt(t){return"var"==t?T(kt,At):"variable"==t?T(At):j(At)}function At(t,e){return")"==t?T():";"==t?T(At):"in"==e||"of"==e?(S.marked="keyword",T(B,At)):j(B,At)}function Lt(t,e){return"*"==e?(S.marked="keyword",T(Lt)):"variable"==t?(E(e),T(Lt)):"("==t?T(L,I(")"),at(It,")"),F,dt,z,R):u&&"<"==e?T(I(">"),at(xt,">"),F,Lt):void 0}function Nt(t,e){return"*"==e?(S.marked="keyword",T(Nt)):"variable"==t?(E(e),T(Nt)):"("==t?T(L,I(")"),at(It,")"),F,dt,R):u&&"<"==e?T(I(">"),at(xt,">"),F,Nt):void 0}function Rt(t,e){return"keyword"==t||"variable"==t?(S.marked="type",T(Rt)):"<"==e?T(I(">"),at(xt,">"),F):void 0}function It(t,e){return"@"==e&&T(B,It),"spread"==t?T(It):u&&_(e)?(S.marked="keyword",T(It)):u&&"this"==t?T(lt,Pt):j(St,lt,Pt)}function Ft(t,e){return"variable"==t?Vt(t,e):zt(t,e)}function Vt(t,e){if("variable"==t)return E(e),T(zt)}function zt(t,e){return"<"==e?T(I(">"),at(xt,">"),F,zt):"extends"==e||"implements"==e||u&&","==t?("implements"==e&&(S.marked="keyword"),T(u?ft:B,zt)):"{"==t?T(I("}"),Ht,F):void 0}function Ht(t,e){return"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e||u&&_(e))&&S.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(S.marked="keyword",T(Ht)):"variable"==t||"keyword"==S.style?(S.marked="property",T(Bt,Ht)):"number"==t||"string"==t?T(Bt,Ht):"["==t?T(B,lt,V("]"),Bt,Ht):"*"==e?(S.marked="keyword",T(Ht)):u&&"("==t?j(Nt,Ht):";"==t||","==t?T(Ht):"}"==t?T():"@"==e?T(B,Ht):void 0}function Bt(t,e){if("!"==e)return T(Bt);if("?"==e)return T(Bt);if(":"==t)return T(ft,Pt);if("="==e)return T(U);var n=S.state.lexical.prev;return j(n&&"interface"==n.info?Nt:Lt)}function Ut(t,e){return"*"==e?(S.marked="keyword",T(Yt,V(";"))):"default"==e?(S.marked="keyword",T(B,V(";"))):"{"==t?T(at($t,"}"),Yt,V(";")):j(z)}function $t(t,e){return"as"==e?(S.marked="keyword",T(V("variable"))):"variable"==t?j(U,$t):void 0}function Wt(t){return"string"==t?T():"("==t?j(B):"."==t?j(G):j(qt,Gt,Yt)}function qt(t,e){return"{"==t?st(qt,"}"):("variable"==t&&E(e),"*"==e&&(S.marked="keyword"),T(Kt))}function Gt(t){if(","==t)return T(qt,Gt)}function Kt(t,e){if("as"==e)return S.marked="keyword",T(qt)}function Yt(t,e){if("from"==e)return S.marked="keyword",T(B)}function Xt(t){return"]"==t?T():j(at(U,"]"))}function Jt(){return j(I("form"),St,V("{"),I("}"),at(Zt,"}"),F,F)}function Zt(){return j(St,Pt)}function Qt(t,e,n){return e.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e.lastType)||"quasi"==e.lastType&&/\{\s*$/.test(t.string.slice(0,t.pos-(n||0)))}return R.lex=!0,F.lex=!0,{startState:function(t){var e={tokenize:v,lastType:"sof",cc:[],lexical:new x((t||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new M(null,null,!1),indented:t||0};return n.globalVars&&"object"==typeof n.globalVars&&(e.globalVars=n.globalVars),e},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation(),w(t,e)),e.tokenize!=m&&t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==r?n:(e.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",k(e,n,r,i,t))},indent:function(e,r){if(e.tokenize==m||e.tokenize==y)return t.Pass;if(e.tokenize!=v)return 0;var i,s=r&&r.charAt(0),c=e.lexical;if(!/^\s*else\b/.test(r))for(var l=e.cc.length-1;l>=0;--l){var u=e.cc[l];if(u==F)c=c.prev;else if(u!=_t&&u!=R)break}for(;("stat"==c.type||"form"==c.type)&&("}"==s||(i=e.cc[e.cc.length-1])&&(i==G||i==K)&&!/^[,\.=+\-*:?[\(]/.test(r));)c=c.prev;a&&")"==c.type&&"stat"==c.prev.type&&(c=c.prev);var d=c.type,h=s==d;return"vardef"==d?c.indented+("operator"==e.lastType||","==e.lastType?c.info.length+1:0):"form"==d&&"{"==s?c.indented:"form"==d?c.indented+o:"stat"==d?c.indented+(function(t,e){return"operator"==t.lastType||","==t.lastType||f.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}(e,r)?a||o:0):"switch"!=c.info||h||0==n.doubleIndentSwitch?c.align?c.column+(h?0:1):c.indented+(h?0:o):c.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:c?null:"/*",blockCommentEnd:c?null:"*/",blockCommentContinue:c?null:" * ",lineComment:c?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:c?"json":"javascript",jsonldMode:s,jsonMode:c,expressionAllowed:Qt,skipExpression:function(e){k(e,"atom","atom","true",new t.StringStream("",2,null))}}})),t.registerHelper("wordChars","javascript",/[\w$]/),t.defineMIME("text/javascript","javascript"),t.defineMIME("text/ecmascript","javascript"),t.defineMIME("application/javascript","javascript"),t.defineMIME("application/x-javascript","javascript"),t.defineMIME("application/ecmascript","javascript"),t.defineMIME("application/json",{name:"javascript",json:!0}),t.defineMIME("application/x-json",{name:"javascript",json:!0}),t.defineMIME("application/manifest+json",{name:"javascript",json:!0}),t.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),t.defineMIME("text/typescript",{name:"javascript",typescript:!0}),t.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(26))},function(t,e,n){1&&function(t){t.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e){return/^[;{}]$/.test(e)}}),t.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e,n,r){return this.jsonMode?/^[\[,{]$/.test(e)||/^}/.test(n):(";"!=e||!r.lexical||")"!=r.lexical.type)&&/^[;{}]$/.test(e)&&!/^;/.test(n)}});var e=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;t.extendMode("xml",{commentStart:"\x3c!--",commentEnd:"--\x3e",newlineAfterToken:function(t,n,r,i){var o=!1;return"html"==this.configuration&&(o=!!i.context&&e.test(i.context.tagName)),!o&&("tag"==t&&/>$/.test(n)&&i.context||/^-1&&s>-1&&s>a&&(t=t.substr(0,a)+t.substring(a+o.commentStart.length,s)+t.substr(s+o.commentEnd.length)),i.replaceRange(t,n,r)}}))})),t.defineExtension("autoIndentRange",(function(t,e){var n=this;this.operation((function(){for(var r=t.line;r<=e.line;r++)n.indentLine(r,"smart")}))})),t.defineExtension("autoFormatRange",(function(e,n){var r=this,i=r.getMode(),o=r.getRange(e,n).split("\n"),a=t.copyState(i,r.getTokenAt(e).state),s=r.getOption("tabSize"),c="",l=0,u=0===e.ch;function d(){c+="\n",u=!0,++l}for(var h=0;h=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:E(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}(1?t.exports:void 0);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){var n=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw i}}return o}},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n(10);e["default"]=r["View"].extend({initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.items=[],this.opt=t;var e=t.config||{};this.level=t.level,this.config=e,this.preview=t.preview,this.ppfx=e.pStylePrefix||'',this.pfx=e.stylePrefix||'',this.parent=t.parent,this.parentView=t.parentView;var n=this.pfx,r=this.ppfx,o=this.parent,a=this.collection;this.listenTo(a,'add',this.addTo),this.listenTo(a,'reset resetNavigator',this.render),this.listenTo(a,'remove',this.removeChildren),this.className="".concat(n,"layers");var s=e.em;if(e.sortable&&!this.opt.sorter){var c=s.get('Utils');this.opt.sorter=new c.Sorter({container:e.sortContainer||this.el,containerSel:".".concat(this.className),itemSel:".".concat(n,"layer"),ignoreViewChildren:1,onEndMove:function(t,e,n){var r=e.getSourceModel();s.setSelected(r,{forceChange:1}),s.trigger("".concat(i["b"],":end"),n)},avoidSelectOnEnd:1,nested:1,ppfx:r,pfx:n})}this.sorter=this.opt.sorter||'',this.$el.data('collection',a),o&&this.$el.data('model',o)},removeChildren:function(t){var e=t.viewLayer;e&&(e.remove(),t.viewLayer=0)},addTo:function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},addToCollection:function(t,e,n){var r=this.level,i=this.parentView,o=this.opt.ItemView,a=e||null,s=new o({ItemView:o,level:r,model:t,parentView:i,config:this.config,sorter:this.sorter,isCountable:this.isCountable,opened:this.opt.opened}),c=s.render().el;if(a)a.appendChild(c);else if(void 0!==n){var l='before';this.$el.children().length==n&&(n--,l='after'),n<0?this.$el.append(c):this.$el.children().eq(n)[l](c)}else this.$el.append(c);return this.items.push(s),c},remove:function(){r["View"].prototype.remove.apply(this,arguments),this.items.map((function(t){return t.remove()}))},isCountable:function(t,e){var n=t.get('type'),r=t.get('tagName');return!(('textnode'==n||'br'==r)&&e||!t.get('layerable'))},render:function(){var t=this,e=document.createDocumentFragment(),n=this.el;return n.innerHTML='',this.collection.each((function(n){return t.addToCollection(n,e)})),n.appendChild(e),n.className=this.className,this}})},function(t,e,n){var r={"./CanvasClear":52,"./CanvasClear.js":52,"./CanvasMove":53,"./CanvasMove.js":53,"./CommandAbstract":30,"./CommandAbstract.js":30,"./ComponentDelete":54,"./ComponentDelete.js":54,"./ComponentDrag":55,"./ComponentDrag.js":55,"./ComponentEnter":56,"./ComponentEnter.js":56,"./ComponentExit":57,"./ComponentExit.js":57,"./ComponentNext":58,"./ComponentNext.js":58,"./ComponentPrev":59,"./ComponentPrev.js":59,"./ComponentStyleClear":60,"./ComponentStyleClear.js":60,"./CopyComponent":61,"./CopyComponent.js":61,"./DeleteComponent":62,"./DeleteComponent.js":62,"./ExportTemplate":63,"./ExportTemplate.js":63,"./Fullscreen":64,"./Fullscreen.js":64,"./MoveComponent":65,"./MoveComponent.js":65,"./OpenAssets":66,"./OpenAssets.js":66,"./OpenBlocks":67,"./OpenBlocks.js":67,"./OpenLayers":68,"./OpenLayers.js":68,"./OpenStyleManager":69,"./OpenStyleManager.js":69,"./OpenTraitManager":70,"./OpenTraitManager.js":70,"./PasteComponent":71,"./PasteComponent.js":71,"./Preview":72,"./Preview.js":72,"./Resize":73,"./Resize.js":73,"./SelectComponent":22,"./SelectComponent.js":22,"./SelectPosition":35,"./SelectPosition.js":35,"./ShowOffset":74,"./ShowOffset.js":74,"./SwitchVisibility":75,"./SwitchVisibility.js":75};function i(t){var e=o(t);return n(e)}function o(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code='MODULE_NOT_FOUND',e}return r[t]}i.keys=function(){return Object.keys(r)},i.resolve=o,t.exports=i,i.id=98},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r),o=n(14),a=n.n(o),s=(n(2),n(0)),c={stylePrefix:'comp-',components:[],draggableComponents:1,storeWrapper:0,processor:0,voidElements:['area','base','br','col','embed','hr','img','input','keygen','link','menuitem','meta','param','source','track','wbr']},l=n(10),u=n(29),d=n(12),h=n(41),f=n(1);function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function g(t){for(var e=1;e=0}}),m=d["default"].extend({});function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){for(var e=1;e\n \n "),fallback:"\n \n "),file:''}),initialize:function(t,e){l["a"].prototype.initialize.apply(this,arguments);var n=this.get('attributes'),r=n.src;r&&this.set('src',r,{silent:1})},initToolbar:function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=this.get(t.fallback?'fallback':'src')||'',n=e;return e&&'2&&void 0!==arguments[2]?arguments[2]:{};!n.fromDisable&&this.disableEditing()},onActive:function(t){var e=this;return ot()(st.a.mark((function n(){var r,i;return st.a.wrap((function(n){for(;1;)switch(n.prev=n.next){case 0:if(r=e.rte,i=e.em,!(e.rteEnabled||!e.model.get('editable')||i&&i.isEditing())){n.next=3;break}return n.abrupt("return");case 3:if(t&&t.stopPropagation&&t.stopPropagation(),!r){n.next=14;break}return n.prev=5,n.next=8,r.enable(e,e.activeRte);case 8:e.activeRte=n.sent,n.next=14;break;case 11:n.prev=11,n.t0=n["catch"](5),i.logError(n.t0);case 14:e.toggleEvents(1);case 15:case"end":return n.stop()}}),n,null,[[5,11]])})))()},onDisable:function(){this.disableEditing()},disableEditing:function(){var t=this;return ot()(st.a.mark((function e(){var n,r,i,o,a;return st.a.wrap((function(e){for(;1;)switch(e.prev=e.next){case 0:if(n=t.model,r=t.rte,i=t.activeRte,o=t.em,a=n&&n.get('editable'),!r){e.next=12;break}return e.prev=3,e.next=6,r.disable(t,i);case 6:e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](3),o.logError(e.t0);case 11:a&&t.syncContent();case 12:t.toggleEvents();case 13:case"end":return e.stop()}}),e,null,[[3,8]])})))()},getContent:function(){var t=this.activeRte;return t&&'function'==typeof t.getContent?t.getContent():this.getChildrenContainer().innerHTML},syncContent:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=this.rte,r=this.rteEnabled;if(r||t.force){var i=this.getContent(),o=e.components(),a=lt({fromDisable:1},t);if(e.set('content','',a),n.customRte)o.length&&o.reset(null,t),e.set('content',i,a);else{var s=function e(n){var r=!!n.get('textable'),i=!['text','default',''].some((function(t){return n.is(t)}))||r;n.set(lt({_innertext:!i,editable:i&&n.get('editable'),selectable:i,hoverable:i,removable:r,draggable:r,highlightable:0,copyable:r},!r&&{toolbar:''}),t),n.get('components').each((function(t){return e(t)}))};o.reset(i,t),o.each((function(t){return s(t)})),o.trigger('resetNavigator')}}},onInput:function(){var t=this.em,e='component',n=["".concat(e,":update"),"".concat(e,":input")].join(' ');t&&t.trigger(n,this.model)},disablePropagation:function(t){t.stopPropagation()},toggleEvents:function(t){var e=this.em,n=this.model,r=this.$el,i={on:f["on"],off:f["off"]},o=t?'on':'off';e.setEditing(t?this:0),this.rteEnabled=!!t;var a=[this.el.ownerDocument,document];if(i.off(a,'mousedown',this.disableEditing),i[o](a,'mousedown',this.disableEditing),e[o]('toolbar:run:before',this.disableEditing),n&&(n[o]('removed',this.disableEditing),n.trigger("rte:".concat(t?'enable':'disable'))),r&&r.off('mousedown',this.disablePropagation),r&&r[o]('mousedown',this.disablePropagation),this.config.draggableComponents)for(var s=this.el;s;)s.draggable=!t,(s=s.parentNode)&&'BODY'==s.tagName&&(s=0)}}),ht=dt.extend({render:function(){for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return!!e.inSvg}}),Ft=d["default"].extend({_createElement:function(t){return document.createElementNS('http://www.w3.org/2000/svg',t)}});function Vt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function zt(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:'',e=this.em,n='';!t&&r.stm&&(t=r.em.getCacheLoad());var i=t,o=i.components,a=i.html;if(o)if(Object(s["isObject"])(o)||Object(s["isArray"])(o))n=o;else try{n=JSON.parse(o)}catch(t){e&&e.logError(t)}else a&&(n=a);var c=n&&n.constructor===Object;return(n&&n.length||c)&&(this.clear(),c?this.getWrapper().set(n):this.getComponents().add(n)),n},store:function(t){if(!r.stm||this.em.get('hasPages'))return{};var e={},n=this.storageKey();if(n.indexOf('html')>=0&&(e.html=r.em.getHtml()),n.indexOf('components')>=0){var i=r.storeWrapper?this.getWrapper():this.getComponents();e.components=JSON.stringify(i)}return t||r.stm.store(e),e},getComponent:function(){var t=this.em.get('PageManager').getSelected(),e=t&&t.getMainFrame();return e&&e.getComponent()},getWrapper:function(){return this.getComponent()},getComponents:function(){var t=this.getWrapper();return t&&t.get('components')},addComponent:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getComponents().add(t,e)},render:function(){return n.render().el},clear:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.getComponents().map((function(t){return t})).forEach((function(e){return e.remove(t)})),this},setComponents:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.clear(e).addComponent(t,e)},addType:function(t,e){var n=this.em,r=e.model,i=void 0===r?{}:r,c=e.view,l=void 0===c?{}:c,u=e.isComponent,d=e.extend,h=e.extendView,f=e.extendFn,p=void 0===f?[]:f,g=e.extendFnView,v=void 0===g?[]:g,m=this.getType(t),y=this.getType(d),b=this.getType(h),w=y||(m||this.getType('default')),O=w.model,x=b?b.view:w.view,C=function(t,e,n){return t.reduce((function(t,r){var i=e[r],o=n.prototype[r];return i&&o&&(t[r]=function(){o.bind(this).apply(void 0,arguments),i.bind(this).apply(void 0,arguments)}),t}),{})};'object'===a()(i)&&(e.model=O.extend(ne(ne(ne({},i),C(p,i,O)),{},{defaults:ne(ne({},Object(s["result"])(O.prototype,'defaults')||{}),Object(s["result"])(i,'defaults')||{})}),{isComponent:!m||y||u?u||function(){return 0}:O.isComponent})),'object'===a()(l)&&(e.view=x.extend(ne(ne({},l),C(v,l,x)))),m?(m.model=e.model,m.view=e.view):(e.id=t,o.unshift(e));var k="component:type:".concat(m?'update':'add');return n&&n.trigger(k,m||e),this},getType:function(t){for(var e=o,n=0;n1&&void 0!==arguments[1]?arguments[1]:{};t&&(t.set({status:'selected'}),['component:selected','component:toggled'].forEach((function(r){return e.em.trigger(r,t,n)})))},selectRemove:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t){this.em;t.set({status:'',state:''}),['component:deselected','component:toggled'].forEach((function(r){return e.em.trigger(r,t,n)}))}},componentHovered:function(){var t=r.em,e=t.get('componentHovered'),n=t.previous('componentHovered'),i='hovered';n&&n.get('status')==i&&n.set({status:'',state:''}),e&&Object(s["isEmpty"])(e.get('status'))&&e.set('status',i)},allById:function(){return i},destroy:function(){var o=this.allById();Object.keys(o).forEach((function(t){return o[t]&&o[t].remove()})),n&&n.remove(),[r,t,i,e,n].forEach((function(t){return{}})),this.em={}}}}},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r),o={stylePrefix:'gjs-',components:'',style:'',fromElement:0,noticeOnUnload:!0,showOffsets:!1,showOffsetsSelected:!1,forceClass:!0,height:'900px',width:'100%',log:['warning','error'],baseCss:"\n * {\n box-sizing: border-box;\n }\n html, body, [data-gjs-type=wrapper] {\n min-height: 100%;\n }\n body {\n margin: 0;\n height: 100%;\n background-color: #fff\n }\n [data-gjs-type=wrapper] {\n overflow: auto;\n overflow-x: hidden;\n }\n\n * ::-webkit-scrollbar-track {\n background: rgba(0, 0, 0, 0.1)\n }\n\n * ::-webkit-scrollbar-thumb {\n background: rgba(255, 255, 255, 0.2)\n }\n\n * ::-webkit-scrollbar {\n width: 10px\n }\n ",protectedCss:'* { box-sizing: border-box; } body {margin: 0;}',canvasCss:'',defaultCommand:'select-comp',showToolbar:1,allowScripts:0,showDevices:1,devicePreviewMode:0,mediaCondition:'max-width',tagVarStart:'{[ ',tagVarEnd:' ]}',keepEmptyTextNodes:0,jsInHtml:!0,nativeDnD:1,multipleSelection:1,exportWrapper:0,wrapperIsBody:1,optsHtml:{},optsCss:{},avoidInlineStyle:1,avoidDefaults:1,clearStyles:0,dragMode:0,listenToEl:[],cssIcons:'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css',el:'',i18n:{},undoManager:{},assetManager:{},canvas:{},layers:{},storageManager:{},richTextEditor:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{},styleManager:{sectors:[{name:'General',open:!1,buildProps:['float','display','position','top','right','left','bottom']},{name:'Flex',open:!1,buildProps:['flex-direction','flex-wrap','justify-content','align-items','align-content','order','flex-basis','flex-grow','flex-shrink','align-self']},{name:'Dimension',open:!1,buildProps:['width','height','max-width','min-height','margin','padding']},{name:'Typography',open:!1,buildProps:['font-family','font-size','font-weight','letter-spacing','color','line-height','text-align','text-shadow'],properties:[{property:'text-align',list:[{value:'left',className:'fa fa-align-left'},{value:'center',className:'fa fa-align-center'},{value:'right',className:'fa fa-align-right'},{value:'justify',className:'fa fa-align-justify'}]}]},{name:'Decorations',open:!1,buildProps:['border-radius-c','background-color','border-radius','border','box-shadow','background']},{name:'Extra',open:!1,buildProps:['transition','perspective','transform']}]},blockManager:{},traitManager:{},textViewCode:'Code',keepUnusedStyles:0,multiFrames:0,customUI:!1},a=n(21),s=n.n(a),c=n(0),l=n(2),u=n.n(l),d=n(1),h=n(6),f=n.n(h),p=n(5),g=n.n(p),v=n(8),m=n.n(v),y=n(9),b=n.n(y),w=n(4),O=n.n(w);function x(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O()(t);if(e){var i=O()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return b()(this,n)}}var C=function(t){m()(n,t);var e=x(n);function n(){return g()(this,n),e.apply(this,arguments)}return n}(l["Model"]),k=function(t){m()(n,t);var e=x(n);function n(){return g()(this,n),e.apply(this,arguments)}return f()(n,[{key:"getByComponent",value:function(t){var e=this;return this.filter((function(n){return e.getComponent(n)===t}))[0]}},{key:"addComponent",value:function(t,e){var n=this,r=(Object(c["isArray"])(t)?t:[t]).filter((function(t){return!n.hasComponent(t)})).map((function(t){return{component:t}}));return this.push(r,e)}},{key:"getComponent",value:function(t){return t.get('component')}},{key:"hasComponent",value:function(t){var e=this.getByComponent(t);return e&&this.contains(e)}},{key:"lastComponent",value:function(){var t=this.last();return t&&this.getComponent(t)}},{key:"allComponents",value:function(){var t=this;return this.map((function(e){return t.getComponent(e)})).filter((function(t){return t}))}},{key:"removeComponent",value:function(t,e){var n=this,r=(Object(c["isArray"])(t)?t:[t]).map((function(t){return n.getByComponent(t)}));return this.remove(r,e)}}]),n}(l["Collection"]);k.prototype.model=C;var S=["unset"];function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function T(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};this.config=e,this.set('Config',e),this.set('modules',[]),this.set('toLoad',[]),this.set('storables',[]),this.set('selected',new k),this.set('dmode',e.dragMode),this.set('hasPages',!!e.pageManager);var n=e.el,r=e.log,i=!0===r?Object(c["keys"])(A):Object(c["isArray"])(r)?r:[];Object(c["bindAll"])(this,'initBaseColorPicker'),n&&e.fromElement&&(this.config.components=n.innerHTML),this.attrsOrig=n?Object(c["toArray"])(n.attributes).reduce((function(t,e){return t[e.nodeName]=e.nodeValue,t}),{}):'',D.forEach((function(e){return t.loadModule(e)})),this.on('change:componentHovered',this.componentHovered,this),this.on('change:changesCount',this.updateChanges,this),this.on('change:readyLoad change:readyCanvas',this._checkReady,this),i.forEach((function(e){return t.listenLog(e)})),[{from:'change:selectedComponent',to:'component:toggled'}].forEach((function(e){var n=e.from,r=e.to;t.listenTo(t,n,(function(){for(var e=arguments.length,i=new Array(e),o=0;o0&&void 0!==arguments[0]?arguments[0]:null,n=this.get('StorageManager');this.get('toLoad').forEach((function(t){t.onLoad()}));var r=function(){t.get('modules').forEach((function(e){return e.postLoad&&e.postLoad(t)})),t.set('readyLoad',1),e&&e()};n&&n.canAutoload()?this.load(r):setTimeout(r)},updateChanges:function(){var t=this,e=this.get('StorageManager'),n=this.get('changesCount');M&&clearTimeout(M),M=setTimeout((function(){return t.trigger('update')})),this.config.noticeOnUnload&&(window.onbeforeunload=n?function(t){return 1}:null),e.isAutosave()&&n>=e.getStepsBeforeSave()&&this.store()},loadModule:function(t){var e=this.config,n=new(t.default||t),r=n.name.charAt(0).toLowerCase()+n.name.slice(1),i=Object(c["isUndefined"])(e[r])?e[n.name]:e[r],o=!0===i?{}:i||{},a=this.get('StorageManager');if(o.pStylePrefix=e.pStylePrefix||'',Object(c["isUndefined"])(i)||i||(o._disable=1),n.storageKey&&n.store&&n.load&&a){o.stm=a;var s='domComponents'==r?'unshift':'push';this.get('storables')[s](n)}return o.em=this,n.init(T({},o)),!n.private&&this.set(n.name,n),n.onLoad&&this.get('toLoad').push(n),this.get('modules').push(n),this},init:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.destroyed&&(this.initialize(e),this.destroyed=0),this.set('Editor',t)},getEditor:function(){return this.get('Editor')},handleUpdates:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.temporary||r.noCount||r.avoidStore||!this.get('ready')||(_&&clearTimeout(_),_=setTimeout((function(){var t=n.get('changesCount')||0,e=(r.unset,s()(r,S));n.set('changesCount',t+1,e)}),0))},changesUp:function(t){this.handleUpdates(0,0,t)},componentHovered:function(t,e,n){var r=this.previous('componentHovered');r&&this.trigger('component:unhovered',r,n),e&&this.trigger('component:hovered',e,n)},getSelected:function(){return this.get('selected').lastComponent()},getSelectedAll:function(){return this.get('selected').allComponents()},setSelected:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.event,i=r&&(r.ctrlKey||r.metaKey),o=r||{},a=o.shiftKey,s=Object(c["isArray"])(t),l=(s?t:[t]).map((function(t){return Object(d["getModel"])(t,E)})),u=this.getSelectedAll(),h=this.getConfig('multipleSelection');s&&this.removeSelected(u.filter((function(t){return!Object(c["contains"])(l,t)}))),l.forEach((function(t){var r=Object(d["getModel"])(t,E);if(!r||r.get('selectable')){if(i&&h)return e.toggleSelected(r);if(a&&h){e.clearSelection(e.get('Canvas').getWindow());var o,l,f=r.collection,p=r.index();if(e.getSelectedAll().forEach((function(t){var e=t.collection,n=t.index();e===f&&(np&&(l=Object(c["isUndefined"])(l)?n:Math.min(l,n)))})),!Object(c["isUndefined"])(o))for(;o!==p;)e.addSelected(f.at(o)),o++;if(!Object(c["isUndefined"])(l))for(;l!==p;)e.addSelected(f.at(l)),l--;return e.addSelected(r)}!s&&e.removeSelected(u.filter((function(t){return t!==r}))),e.addSelected(r,n),r}}))},addSelected:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(d["getModel"])(t,E),i=Object(c["isArray"])(r)?r:[r];i.forEach((function(t){if(!t||t.get('selectable')){var r=e.get('selected');n.forceChange&&e.removeSelected(t,n),r.addComponent(t,n)}}))},removeSelected:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.get('selected').removeComponent(Object(d["getModel"])(t,E),e)},toggleSelected:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(d["getModel"])(t,E),i=Object(c["isArray"])(r)?r:[r];i.forEach((function(t){e.get('selected').hasComponent(t)?e.removeSelected(t,n):e.addSelected(t,n)}))},setHovered:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object(d["getModel"])(t,E);n&&!n.get('hoverable')||(e.forceChange&&this.set('componentHovered',''),this.set('componentHovered',n,e))},getHovered:function(){return this.get('componentHovered')},setComponents:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.get('DomComponents').setComponents(t,e)},getComponents:function(){var t=this.get('DomComponents'),e=this.get('CodeManager');if(t&&e){var n=t.getComponents();return e.getCode(n,'json')}},setStyle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get('CssComposer');return n.clear(e),n.getAll().add(t,e),this},addStyle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getStyle().add(t,e);return Object(c["isArray"])(n)?n:[n]},getStyle:function(){return this.get('CssComposer').getAll()},setState:function(t){return this.set('state',t),this},getState:function(){return this.get('state')||''},getHtml:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.config,n=e.optsHtml,r=e.exportWrapper,i=e.wrapperIsBody,o=e.jsInHtml?this.getJs(t):'',a=t.component||this.get('DomComponents').getComponent(),s=a?this.get('CodeManager').getCode(a,'html',T(T({exportWrapper:r,wrapperIsBody:i},n),t)):'';return s+=o?"` : '';\n return html;\n },\n\n /**\n * Returns CSS built inside canvas\n * @param {Object} [opts={}] Options\n * @returns {string} CSS string\n * @private\n */\n getCss(opts = {}) {\n const config = this.config;\n const { optsCss, wrapperIsBody } = config;\n const avoidProt = opts.avoidProtected;\n const keepUnusedStyles = !isUndefined(opts.keepUnusedStyles)\n ? opts.keepUnusedStyles\n : config.keepUnusedStyles;\n const cssc = this.get('CssComposer');\n const wrp = opts.component || this.get('DomComponents').getComponent();\n const protCss = !avoidProt ? config.protectedCss : '';\n const css =\n wrp &&\n this.get('CodeManager').getCode(wrp, 'css', {\n cssc,\n wrapperIsBody,\n keepUnusedStyles,\n ...optsCss,\n ...opts\n });\n return wrp ? (opts.json ? css : protCss + css) : '';\n },\n\n /**\n * Returns JS of all components\n * @return {string} JS string\n * @private\n */\n getJs(opts = {}) {\n var wrp = opts.component || this.get('DomComponents').getWrapper();\n return wrp\n ? this.get('CodeManager')\n .getCode(wrp, 'js')\n .trim()\n : '';\n },\n\n /**\n * Store data to the current storage\n * @param {Function} clb Callback function\n * @return {Object} Stored data\n * @private\n */\n store(clb) {\n const sm = this.get('StorageManager');\n if (!sm) return;\n\n const store = this.storeData();\n sm.store(store, res => {\n clb && clb(res, store);\n this.set('changesCount', 0);\n this.trigger('storage:store', store);\n });\n\n return store;\n },\n\n storeData() {\n let result = {};\n // Sync content if there is an active RTE\n const editingCmp = this.getEditing();\n editingCmp && editingCmp.trigger('sync:content', { noCount: true });\n\n this.get('storables').forEach(m => {\n result = { ...result, ...m.store(1) };\n });\n return result;\n },\n\n /**\n * Load data from the current storage\n * @param {Function} clb Callback function\n * @private\n */\n load(clb = null) {\n this.getCacheLoad(1, res => {\n this.loadData(res);\n clb && clb(res);\n });\n },\n\n loadData(data = {}) {\n const sm = this.get('StorageManager');\n const result = sm.__clearKeys(data);\n\n this.get('storables').forEach(module => {\n module.load(result);\n module.postLoad && module.postLoad(this);\n });\n\n return result;\n },\n\n /**\n * Returns cached load\n * @param {Boolean} force Force to reload\n * @param {Function} clb Callback function\n * @return {Object}\n * @private\n */\n getCacheLoad(force, clb) {\n if (this.cacheLoad && !force) return this.cacheLoad;\n const sm = this.get('StorageManager');\n const load = [];\n\n if (!sm) return {};\n\n this.get('storables').forEach(m => {\n let key = m.storageKey;\n key = isFunction(key) ? key() : key;\n const keys = isArray(key) ? key : [key];\n keys.forEach(k => load.push(k));\n });\n\n sm.load(load, res => {\n this.cacheLoad = res;\n clb && clb(res);\n setTimeout(() => this.trigger('storage:load', res));\n });\n },\n\n /**\n * Returns device model by name\n * @return {Device|null}\n * @private\n */\n getDeviceModel() {\n var name = this.get('device');\n return this.get('DeviceManager').get(name);\n },\n\n /**\n * Run default command if setted\n * @param {Object} [opts={}] Options\n * @private\n */\n runDefault(opts = {}) {\n var command = this.get('Commands').get(this.config.defaultCommand);\n if (!command || this.defaultRunning) return;\n command.stop(this, this, opts);\n command.run(this, this, opts);\n this.defaultRunning = 1;\n },\n\n /**\n * Stop default command\n * @param {Object} [opts={}] Options\n * @private\n */\n stopDefault(opts = {}) {\n const commands = this.get('Commands');\n const command = commands.get(this.config.defaultCommand);\n if (!command || !this.defaultRunning) return;\n command.stop(this, this, opts);\n this.defaultRunning = 0;\n },\n\n /**\n * Update canvas dimensions and refresh data useful for tools positioning\n * @private\n */\n refreshCanvas(opts = {}) {\n this.set('canvasOffset', null);\n this.set('canvasOffset', this.get('Canvas').getOffset());\n opts.tools && this.trigger('canvas:updateTools');\n },\n\n /**\n * Clear all selected stuf inside the window, sometimes is useful to call before\n * doing some dragging opearation\n * @param {Window} win If not passed the current one will be used\n * @private\n */\n clearSelection(win) {\n var w = win || window;\n w.getSelection().removeAllRanges();\n },\n\n /**\n * Get the current media text\n * @return {string}\n */\n getCurrentMedia() {\n const config = this.config;\n const device = this.getDeviceModel();\n const condition = config.mediaCondition;\n const preview = config.devicePreviewMode;\n const width = device && device.get('widthMedia');\n return device && width && !preview ? `(${condition}: ${width})` : '';\n },\n\n /**\n * Return the component wrapper\n * @return {Component}\n */\n getWrapper() {\n return this.get('DomComponents').getWrapper();\n },\n\n setCurrentFrame(frameView) {\n return this.set('currentFrame', frameView);\n },\n\n getCurrentFrame() {\n return this.get('currentFrame');\n },\n\n getCurrentFrameModel() {\n return (this.getCurrentFrame() || {}).model;\n },\n\n /**\n * Return the count of changes made to the content and not yet stored.\n * This count resets at any `store()`\n * @return {number}\n */\n getDirtyCount() {\n return this.get('changesCount');\n },\n\n getZoomDecimal() {\n return this.get('Canvas').getZoomDecimal();\n },\n\n getZoomMultiplier() {\n return this.get('Canvas').getZoomMultiplier();\n },\n\n setDragMode(value) {\n return this.set('dmode', value);\n },\n\n t(...args) {\n return this.get('I18n').t(...args);\n },\n\n /**\n * Returns true if the editor is in absolute mode\n * @returns {Boolean}\n */\n inAbsoluteMode() {\n return this.get('dmode') === 'absolute';\n },\n\n /**\n * Destroy editor\n */\n destroyAll() {\n const { config, view } = this;\n const editor = this.getEditor();\n const { editors = [] } = config.grapesjs || {};\n this.stopDefault();\n this.get('modules')\n .slice()\n .reverse()\n .forEach(mod => mod.destroy());\n view && view.remove();\n this.stopListening();\n this.clear({ silent: true });\n this.destroyed = 1;\n ['config', 'view', '_previousAttributes', '_events', '_listeners'].forEach(\n i => (this[i] = {})\n );\n editors.splice(editors.indexOf(editor), 1);\n hasWin() &&\n $(config.el)\n .empty()\n .attr(this.attrsOrig);\n },\n\n getEditing() {\n const res = this.get('editing');\n return (res && res.model) || null;\n },\n\n setEditing(value) {\n this.set('editing', value);\n return this;\n },\n\n isEditing() {\n return !!this.get('editing');\n },\n\n log(msg, opts = {}) {\n const { ns, level = 'debug' } = opts;\n this.trigger('log', msg, opts);\n level && this.trigger(`log:${level}`, msg, opts);\n\n if (ns) {\n const logNs = `log-${ns}`;\n this.trigger(logNs, msg, opts);\n level && this.trigger(`${logNs}:${level}`, msg, opts);\n }\n },\n\n logInfo(msg, opts) {\n this.log(msg, { ...opts, level: 'info' });\n },\n\n logWarning(msg, opts) {\n this.log(msg, { ...opts, level: 'warning' });\n },\n\n logError(msg, opts) {\n this.log(msg, { ...opts, level: 'error' });\n },\n\n initBaseColorPicker(el, opts = {}) {\n const config = this.getConfig();\n const { colorPicker = {} } = config;\n const elToAppend = config.el;\n const ppfx = config.stylePrefix;\n\n return $(el).spectrum({\n containerClassName: `${ppfx}one-bg ${ppfx}two-color`,\n appendTo: elToAppend || 'body',\n maxSelectionSize: 8,\n showPalette: true,\n palette: [],\n showAlpha: true,\n chooseText: 'Ok',\n cancelText: '⨯',\n ...opts,\n ...colorPicker\n });\n },\n\n /**\n * Set/get data from the HTMLElement\n * @param {HTMLElement} el\n * @param {string} name Data name\n * @param {any} value Date value\n * @return {any}\n * @private\n */\n data(el, name, value) {\n const varName = '_gjs-data';\n\n if (!el[varName]) {\n el[varName] = {};\n }\n\n if (isUndefined(value)) {\n return el[varName][name];\n } else {\n el[varName][name] = value;\n }\n }\n});\n","import { isObject, isString, each, isUndefined } from 'underscore';\n\nexport default ({ $ }) => {\n if ($ && $.prototype && $.prototype.constructor.name !== 'jQuery') {\n const fn = $.fn;\n\n // Additional helpers\n\n fn.hide = function() {\n return this.css('display', 'none');\n };\n\n fn.show = function() {\n return this.css('display', 'block');\n };\n\n fn.focus = function() {\n const el = this.get(0);\n el && el.focus();\n return this;\n };\n\n // For SVGs in IE\n // (fn.removeClass = function(c) {\n // if (!arguments.length) {\n // return this.attr('class', '');\n // }\n // const classes = isString(c) && c.match(/\\S+/g);\n // return classes\n // ? this.each(function(el) {\n // each(classes, function(c) {\n // if (el.classList) {\n // el.classList.remove(c);\n // } else {\n // const val = el.className;\n // const bval = el.className.baseVal;\n\n // if (!isUndefined(bval)) {\n // val.baseVal = bval.replace(c, '');\n // } else {\n // el.className = val.replace(c, '');\n // }\n // }\n // });\n // })\n // : this;\n // }),\n // (fn.remove = function() {\n // return this.each(node => {\n // return node.parentNode && node.parentNode.removeChild(node);\n // });\n // }),\n\n // For spectrum compatibility\n\n fn.bind = function(ev, h) {\n return this.on(ev, h);\n };\n\n fn.unbind = function(ev, h) {\n if (isObject(ev)) {\n for (let name in ev) {\n ev.hasOwnProperty(name) && this.off(name, ev[name]);\n }\n\n return this;\n } else {\n return this.off(ev, h);\n }\n };\n\n fn.click = function(h) {\n return h ? this.on('click', h) : this.trigger('click');\n };\n\n fn.change = function(h) {\n return h ? this.on('change', h) : this.trigger('change');\n };\n\n fn.keydown = function(h) {\n return h ? this.on('keydown', h) : this.trigger('keydown');\n };\n\n fn.delegate = function(selector, events, data, handler) {\n if (!handler) {\n handler = data;\n }\n\n return this.on(events, selector, function(e) {\n e.data = data;\n handler(e);\n });\n };\n\n fn.scrollLeft = function() {\n let el = this.get(0);\n el = el.nodeType == 9 ? el.defaultView : el;\n let win = el instanceof Window ? el : null;\n return win ? win.pageXOffset : el.scrollLeft || 0;\n };\n\n fn.scrollTop = function() {\n let el = this.get(0);\n el = el.nodeType == 9 ? el.defaultView : el;\n let win = el instanceof Window ? el : null;\n return win ? win.pageYOffset : el.scrollTop || 0;\n };\n\n const offset = $.prototype.offset;\n fn.offset = function(coords) {\n let top, left;\n\n if (coords) {\n top = coords.top;\n left = coords.left;\n }\n\n if (typeof top != 'undefined') {\n this.css('top', `${top}px`);\n }\n if (typeof left != 'undefined') {\n this.css('left', `${left}px`);\n }\n\n return offset.call(this);\n };\n\n $.map = function(items, clb) {\n const ar = [];\n\n for (var i = 0; i < items.length; i++) {\n ar.push(clb(items[i], i));\n }\n\n return ar;\n };\n\n const indexOf = Array.prototype.indexOf;\n\n $.inArray = function(val, arr, i) {\n return arr == null ? -1 : indexOf.call(arr, val, i);\n };\n\n $.Event = function(src, props) {\n if (!(this instanceof $.Event)) {\n return new $.Event(src, props);\n }\n\n this.type = src;\n this.isDefaultPrevented = () => false;\n };\n }\n};\n","import Backbone from 'backbone';\nimport { appendStyles } from 'utils/mixins';\n\nconst $ = Backbone.$;\n\nexport default Backbone.View.extend({\n initialize() {\n const { model } = this;\n model.view = this;\n this.conf = model.config;\n this.pn = model.get('Panels');\n this.cv = model.get('Canvas');\n model.once('change:ready', () => {\n this.pn.active();\n this.pn.disableButtons();\n setTimeout(() => {\n model.trigger('load', model.get('Editor'));\n model.set('changesCount', 0);\n });\n });\n },\n\n render() {\n const { model, $el, conf } = this;\n const pfx = conf.stylePrefix;\n const contEl = $(conf.el || `body ${conf.container}`);\n appendStyles(conf.cssIcons, { unique: 1, prepand: 1 });\n $el.empty();\n\n if (conf.width) contEl.css('width', conf.width);\n if (conf.height) contEl.css('height', conf.height);\n\n $el.append(this.cv.render());\n $el.append(this.pn.render());\n $el.attr('class', `${pfx}editor ${pfx}one-bg ${pfx}two-color`);\n contEl\n .addClass(`${pfx}editor-cont`)\n .empty()\n .append($el);\n\n return this;\n }\n});\n","/**\n * Editor contains the top level API which you'll probably use to customize the editor or extend it with plugins.\n * You get the Editor instance on init method and you can pass options via its [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/editor/config/config.js)\n *\n * ```js\n * const editor = grapesjs.init({\n * // options\n * });\n * ```\n *\n * ## Available Events\n *\n * You can make use of available events in this way\n * ```js\n * editor.on('EVENT-NAME', (some, argument) => {\n * // do something\n * })\n * ```\n *\n * ### Components\n * * `component:create` - Component is created (only the model, is not yet mounted in the canvas), called after the init() method\n * * `component:mount` - Component is mounted to an element and rendered in canvas\n * * `component:add` - Triggered when a new component is added to the editor, the model is passed as an argument to the callback\n * * `component:remove` - Triggered when a component is removed, the model is passed as an argument to the callback\n * * `component:remove:before` - Triggered before the remove of the component, the model, remove function (if aborted via options, with this function you can complete the remove) and options (use options.abort = true to prevent remove), are passed as arguments to the callback\n * * `component:clone` - Triggered when a component is cloned, the new model is passed as an argument to the callback\n * * `component:update` - Triggered when a component is updated (moved, styled, etc.), the model is passed as an argument to the callback\n * * `component:update:{propertyName}` - Listen any property change, the model is passed as an argument to the callback\n * * `component:styleUpdate` - Triggered when the style of the component is updated, the model is passed as an argument to the callback\n * * `component:styleUpdate:{propertyName}` - Listen for a specific style property change, the model is passed as an argument to the callback\n * * `component:selected` - New component selected, the selected model is passed as an argument to the callback\n * * `component:deselected` - Component deselected, the deselected model is passed as an argument to the callback\n * * `component:toggled` - Component selection changed, toggled model is passed as an argument to the callback\n * * `component:type:add` - New component type added, the new type is passed as an argument to the callback\n * * `component:type:update` - Component type updated, the updated type is passed as an argument to the callback\n * * `component:drag:start` - Component drag started. Passed an object, to the callback, containing the `target` (component to drag), `parent` (parent of the component) and `index` (component index in the parent)\n * * `component:drag` - During component drag. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the current pointer\n * * `component:drag:end` - Component drag ended. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the final pointer\n * ### Keymaps\n * * `keymap:add` - New keymap added. The new keyamp object is passed as an argument\n * * `keymap:remove` - Keymap removed. The removed keyamp object is passed as an argument\n * * `keymap:emit` - Some keymap emitted, in arguments you get keymapId, shortcutUsed, Event\n * * `keymap:emit:{keymapId}` - `keymapId` emitted, in arguments you get keymapId, shortcutUsed, Event\n * ### Style Manager\n * * `styleManager:update:target` - The target (Component or CSSRule) is changed\n * * `styleManager:change` - Triggered on style property change from new selected component, the view of the property is passed as an argument to the callback\n * * `styleManager:change:{propertyName}` - As above but for a specific style property\n * ### Storages\n * * `storage:start` - Before the storage request is started\n * * `storage:start:store` - Before the store request. The object to store is passed as an argumnet (which you can edit)\n * * `storage:start:load` - Before the load request. Items to load are passed as an argumnet (which you can edit)\n * * `storage:load` - Triggered when something was loaded from the storage, loaded object passed as an argumnet\n * * `storage:store` - Triggered when something is stored to the storage, stored object passed as an argumnet\n * * `storage:end` - After the storage request is ended\n * * `storage:end:store` - After the store request\n * * `storage:end:load` - After the load request\n * * `storage:error` - On any error on storage request, passes the error as an argument\n * * `storage:error:store` - Error on store request, passes the error as an argument\n * * `storage:error:load` - Error on load request, passes the error as an argument\n * ### Canvas\n * * `canvas:dragenter` - When something is dragged inside the canvas, `DataTransfer` instance passed as an argument\n * * `canvas:dragover` - When something is dragging on canvas, `DataTransfer` instance passed as an argument\n * * `canvas:drop` - Something is dropped in canvas, `DataTransfer` instance and the dropped model are passed as arguments\n * * `canvas:dragend` - When a drag operation is ended, `DataTransfer` instance passed as an argument\n * * `canvas:dragdata` - On any dataTransfer parse, `DataTransfer` instance and the `result` are passed as arguments.\n * By changing `result.content` you're able to customize what is dropped\n * ### RTE\n * * `rte:enable` - RTE enabled. The view, on which RTE is enabled, is passed as an argument\n * * `rte:disable` - RTE disabled. The view, on which RTE is disabled, is passed as an argument\n * ### Commands\n * * `run:{commandName}` - Triggered when some command is called to run (eg. editor.runCommand('preview'))\n * * `stop:{commandName}` - Triggered when some command is called to stop (eg. editor.stopCommand('preview'))\n * * `run:{commandName}:before` - Triggered before the command is called\n * * `stop:{commandName}:before` - Triggered before the command is called to stop\n * * `abort:{commandName}` - Triggered when the command execution is aborted (`editor.on(`run:preview:before`, opts => opts.abort = 1);`)\n * * `run` - Triggered on run of any command. The id and the result are passed as arguments to the callback\n * * `stop` - Triggered on stop of any command. The id and the result are passed as arguments to the callback\n * ### Selectors\n * Check the [Selectors](/api/selector_manager.html) module.\n * ### Blocks\n * Check the [Blocks](/api/block_manager.html) module.\n * ### Assets\n * Check the [Assets](/api/assets.html) module.\n * ### Modal\n * Check the [Modal](/api/modal_dialog.html) module.\n * ### Devices\n * Check the [Devices](/api/device_manager.html) module.\n * ### Parser\n * Check the [Parser](/api/parser.html) module.\n * ### Pages\n * Check the [Pages](/api/pages.html) module.\n * ### General\n * * `canvasScroll` - Canvas is scrolled\n * * `update` - The structure of the template is updated (its HTML/CSS)\n * * `undo` - Undo executed\n * * `redo` - Redo executed\n * * `load` - Editor is loaded\n *\n * @module Editor\n */\nimport defaults from './config/config';\nimport EditorModel from './model/Editor';\nimport EditorView from './view/EditorView';\nimport html from 'utils/html';\n\nexport default (config = {}, opts = {}) => {\n const { $ } = opts;\n const c = {\n ...defaults,\n ...config\n };\n\n c.pStylePrefix = c.stylePrefix;\n let em = new EditorModel(c);\n let editorView;\n\n return {\n $,\n\n /**\n * @property {EditorModel}\n * @private\n */\n editor: em,\n\n /**\n * Initialize editor model\n * @return {this}\n * @private\n */\n init(opts = {}) {\n em.init(this, { ...c, ...opts });\n\n [\n 'I18n',\n 'Utils',\n 'Config',\n 'Commands',\n 'Keymaps',\n 'Modal',\n 'Panels',\n 'Canvas',\n 'Parser',\n 'CodeManager',\n 'UndoManager',\n 'RichTextEditor',\n ['Pages', 'PageManager'],\n 'DomComponents',\n ['Components', 'DomComponents'],\n 'LayerManager',\n ['Layers', 'LayerManager'],\n 'CssComposer',\n ['Css', 'CssComposer'],\n 'StorageManager',\n ['Storage', 'StorageManager'],\n 'AssetManager',\n ['Assets', 'AssetManager'],\n 'BlockManager',\n ['Blocks', 'BlockManager'],\n 'TraitManager',\n ['Traits', 'TraitManager'],\n 'SelectorManager',\n ['Selectors', 'SelectorManager'],\n 'StyleManager',\n ['Styles', 'StyleManager'],\n 'DeviceManager',\n ['Devices', 'DeviceManager']\n ].forEach(prop => {\n if (Array.isArray(prop)) {\n this[prop[0]] = em.get(prop[1]);\n } else {\n this[prop] = em.get(prop);\n }\n });\n\n // Do post render stuff after the iframe is loaded otherwise it'll\n // be empty during tests\n em.once('change:ready', () => {\n this.UndoManager.clear();\n em.get('modules').forEach(module => {\n module.postRender && module.postRender(editorView);\n });\n });\n\n return this;\n },\n\n /**\n * Returns configuration object\n * @param {string} [prop] Property name\n * @returns {any} Returns the configuration object or\n * the value of the specified property\n */\n getConfig(prop) {\n return em.getConfig(prop);\n },\n\n /**\n * Returns HTML built inside canvas\n * @param {Object} [opts={}] Options\n * @param {Component} [opts.component] Return the HTML of a specific Component\n * @param {Boolean} [opts.cleanId=false] Remove unnecessary IDs (eg. those created automatically)\n * @returns {string} HTML string\n */\n getHtml(opts) {\n return em.getHtml(opts);\n },\n\n /**\n * Returns CSS built inside canvas\n * @param {Object} [opts={}] Options\n * @param {Component} [opts.component] Return the CSS of a specific Component\n * @param {Boolean} [opts.json=false] Return an array of CssRules instead of the CSS string\n * @param {Boolean} [opts.avoidProtected=false] Don't include protected CSS\n * @returns {String|Array} CSS string or array of CssRules\n */\n getCss(opts) {\n return em.getCss(opts);\n },\n\n /**\n * Returns JS of all components\n * @param {Object} [opts={}] Options\n * @param {Component} [opts.component] Get the JS of a specific component\n * @returns {String} JS string\n */\n getJs(opts) {\n return em.getJs(opts);\n },\n\n /**\n * Return the complete tree of components. Use `getWrapper` to include also the wrapper\n * @return {Components}\n */\n getComponents() {\n return em.get('DomComponents').getComponents();\n },\n\n /**\n * Return the wrapper and its all components\n * @return {Component}\n */\n getWrapper() {\n return em.get('DomComponents').getWrapper();\n },\n\n /**\n * Set components inside editor's canvas. This method overrides actual components\n * @param {Array|Object|string} components HTML string or components model\n * @param {Object} opt the options object to be used by the [setComponents]{@link em#setComponents} method\n * @return {this}\n * @example\n * editor.setComponents('
New component
');\n * // or\n * editor.setComponents({\n * type: 'text',\n * classes:['cls'],\n * content: 'New component'\n * });\n */\n setComponents(components, opt = {}) {\n em.setComponents(components, opt);\n return this;\n },\n\n /**\n * Add components\n * @param {Array|Object|string} components HTML string or components model\n * @param {Object} opts Options\n * @param {Boolean} [opts.avoidUpdateStyle=false] If the HTML string contains styles,\n * by default, they will be created and, if already exist, updated. When this option\n * is true, styles already created will not be updated.\n * @return {Array}\n * @example\n * editor.addComponents('
New component
');\n * // or\n * editor.addComponents({\n * type: 'text',\n * classes:['cls'],\n * content: 'New component'\n * });\n */\n addComponents(components, opts) {\n return this.getWrapper().append(components, opts);\n },\n\n /**\n * Returns style in JSON format object\n * @return {Object}\n */\n getStyle() {\n return em.get('CssComposer').getAll();\n },\n\n /**\n * Set style inside editor's canvas. This method overrides actual style\n * @param {Array|Object|string} style CSS string or style model\n * @return {this}\n * @example\n * editor.setStyle('.cls{color: red}');\n * //or\n * editor.setStyle({\n * selectors: ['cls'],\n * style: { color: 'red' }\n * });\n */\n setStyle(style, opt = {}) {\n em.setStyle(style, opt);\n return this;\n },\n\n /**\n * Add styles to the editor\n * @param {Array|Object|string} style CSS string or style model\n * @returns {Array} Array of created CssRule instances\n * @example\n * editor.addStyle('.cls{color: red}');\n */\n addStyle(style, opts = {}) {\n return em.addStyle(style, opts);\n },\n\n /**\n * Returns the last selected component, if there is one\n * @return {Model}\n */\n getSelected() {\n return em.getSelected();\n },\n\n /**\n * Returns an array of all selected components\n * @return {Array}\n */\n getSelectedAll() {\n return em.getSelectedAll();\n },\n\n /**\n * Get a stylable entity from the selected component.\n * If you select a component without classes the entity is the Component\n * itself and all changes will go inside its 'style' attribute. Otherwise,\n * if the selected component has one or more classes, the function will\n * return the corresponding CSS Rule\n * @return {Model}\n */\n getSelectedToStyle() {\n let selected = em.getSelected();\n\n if (selected) {\n return this.StyleManager.getModelToStyle(selected);\n }\n },\n\n /**\n * Select a component\n * @param {Component|HTMLElement} el Component to select\n * @param {Object} [opts] Options\n * @param {Boolean} [opts.scroll] Scroll canvas to the selected element\n * @return {this}\n * @example\n * // Select dropped block\n * editor.on('block:drag:stop', function(model) {\n * editor.select(model);\n * });\n */\n select(el, opts) {\n em.setSelected(el, opts);\n return this;\n },\n\n /**\n * Add component to selection\n * @param {Component|HTMLElement|Array} el Component to select\n * @return {this}\n * @example\n * editor.selectAdd(model);\n */\n selectAdd(el) {\n em.addSelected(el);\n return this;\n },\n\n /**\n * Remove component from selection\n * @param {Component|HTMLElement|Array} el Component to select\n * @return {this}\n * @example\n * editor.selectRemove(model);\n */\n selectRemove(el) {\n em.removeSelected(el);\n return this;\n },\n\n /**\n * Toggle component selection\n * @param {Component|HTMLElement|Array} el Component to select\n * @return {this}\n * @example\n * editor.selectToggle(model);\n */\n selectToggle(el) {\n em.toggleSelected(el);\n return this;\n },\n\n /**\n * Returns, if active, the Component enabled in rich text editing mode.\n * @returns {Component|null}\n * @example\n * const textComp = editor.getEditing();\n * if (textComp) {\n * console.log('HTML: ', textComp.toHTML());\n * }\n */\n getEditing() {\n return em.getEditing();\n },\n\n /**\n * Set device to the editor. If the device exists it will\n * change the canvas to the proper width\n * @param {string} name Name of the device\n * @return {this}\n * @example\n * editor.setDevice('Tablet');\n */\n setDevice(name) {\n em.set('device', name);\n return this;\n },\n\n /**\n * Return the actual active device\n * @return {string} Device name\n * @example\n * var device = editor.getDevice();\n * console.log(device);\n * // 'Tablet'\n */\n getDevice() {\n return em.get('device');\n },\n\n /**\n * Execute command\n * @param {string} id Command ID\n * @param {Object} options Custom options\n * @return {*} The return is defined by the command\n * @example\n * editor.runCommand('myCommand', {someValue: 1});\n */\n runCommand(id, options = {}) {\n return em.get('Commands').run(id, options);\n },\n\n /**\n * Stop the command if stop method was provided\n * @param {string} id Command ID\n * @param {Object} options Custom options\n * @return {*} The return is defined by the command\n * @example\n * editor.stopCommand('myCommand', {someValue: 1});\n */\n stopCommand(id, options = {}) {\n return em.get('Commands').stop(id, options);\n },\n\n /**\n * Store data to the current storage\n * @param {Function} clb Callback function\n * @return {Object} Stored data\n */\n store(clb) {\n return em.store(clb);\n },\n\n /**\n * Get the JSON data object, which could be stored and loaded back with `editor.loadData(json)`\n * @returns {Object}\n * @example\n * console.log(editor.storeData());\n * // { pages: [...], styles: [...], ... }\n */\n storeData() {\n return em.storeData();\n },\n\n /**\n * Load data from the current storage\n * @param {Function} clb Callback function\n * @return {Object} Stored data\n */\n load(clb) {\n return em.load(clb);\n },\n\n /**\n * Load data from the JSON data object\n * @param {Object} data Data to load\n * @return {Object} Loaded object\n * @example\n * editor.loadData({ pages: [...], styles: [...], ... })\n */\n loadData(data) {\n return em.loadData(data);\n },\n\n /**\n * Returns container element. The one which was indicated as 'container'\n * on init method\n * @return {HTMLElement}\n */\n getContainer() {\n return c.el;\n },\n\n /**\n * Return the count of changes made to the content and not yet stored.\n * This count resets at any `store()`\n * @return {number}\n */\n getDirtyCount() {\n return em.getDirtyCount();\n },\n\n /**\n * Update editor dimension offsets\n *\n * This method could be useful when you update, for example, some position\n * of the editor element (eg. canvas, panels, etc.) with CSS, where without\n * refresh you'll get misleading position of tools\n * @param {Object} [options] Options\n * @param {Boolean} [options.tools=false] Update the position of tools (eg. rich text editor, component highlighter, etc.)\n */\n refresh(opts) {\n em.refreshCanvas(opts);\n },\n\n /**\n * Replace the built-in Rich Text Editor with a custom one.\n * @param {Object} obj Custom RTE Interface\n * @example\n * editor.setCustomRte({\n * // Function for enabling custom RTE\n * // el is the HTMLElement of the double clicked Text Component\n * // rte is the same instance you have returned the first time you call\n * // enable(). This is useful if need to check if the RTE is already enabled so\n * // ion this case you'll need to return the RTE and the end of the function\n * enable: function(el, rte) {\n * rte = new MyCustomRte(el, {}); // this depends on the Custom RTE API\n * ...\n * return rte; // return the RTE instance\n * },\n *\n * // Disable the editor, called for example when you unfocus the Text Component\n * disable: function(el, rte) {\n * rte.blur(); // this depends on the Custom RTE API\n * }\n *\n * // Called when the Text Component is focused again. If you returned the RTE instance\n * // from the enable function, the enable won't be called again instead will call focus,\n * // in this case to avoid double binding of the editor\n * focus: function (el, rte) {\n * rte.focus(); // this depends on the Custom RTE API\n * }\n * });\n */\n setCustomRte(obj) {\n this.RichTextEditor.customRte = obj;\n },\n\n /**\n * Replace the default CSS parser with a custom one.\n * The parser function receives a CSS string as a parameter and expects\n * an array of CSSRule objects as a result. If you need to remove the\n * custom parser, pass `null` as the argument\n * @param {Function|null} parser Parser function\n * @return {this}\n * @example\n * editor.setCustomParserCss(css => {\n * const result = [];\n * // ... parse the CSS string\n * result.push({\n * selectors: '.someclass, div .otherclass',\n * style: { color: 'red' }\n * })\n * // ...\n * return result;\n * });\n */\n setCustomParserCss(parser) {\n this.Parser.getConfig().parserCss = parser;\n return this;\n },\n\n /**\n * Change the global drag mode of components.\n * To get more about this feature read: https://github.com/artf/grapesjs/issues/1936\n * @param {String} value Drag mode, options: 'absolute' | 'translate'\n * @returns {this}\n */\n setDragMode(value) {\n em.setDragMode(value);\n return this;\n },\n\n /**\n * Trigger event log message\n * @param {*} msg Message to log\n * @param {Object} [opts={}] Custom options\n * @param {String} [opts.ns=''] Namespace of the log (eg. to use in plugins)\n * @param {String} [opts.level='debug'] Level of the log, `debug`, `info`, `warning`, `error`\n * @return {this}\n * @example\n * editor.log('Something done!', { ns: 'from-plugin-x', level: 'info' });\n * // This will trigger following events\n * // `log`, `log:info`, `log-from-plugin-x`, `log-from-plugin-x:info`\n * // Callbacks of those events will always receive the message and\n * // options, as arguments, eg:\n * // editor.on('log:info', (msg, opts) => console.info(msg, opts))\n */\n log(msg, opts = {}) {\n em.log(msg, opts);\n return this;\n },\n\n /**\n * Translate label\n * @param {String} key Label to translate\n * @param {Object} [opts] Options for the translation\n * @param {Object} [opts.params] Params for the translation\n * @param {Boolean} [opts.noWarn] Avoid warnings in case of missing resources\n * @returns {String}\n * @example\n * editor.t('msg');\n * // use params\n * editor.t('msg2', { params: { test: 'hello' } });\n * // custom local\n * editor.t('msg2', { params: { test: 'hello' }, l: 'it' });\n */\n t(...args) {\n return em.t(...args);\n },\n\n /**\n * Attach event\n * @param {string} event Event name\n * @param {Function} callback Callback function\n * @return {this}\n */\n on(event, callback) {\n em.on(event, callback);\n return this;\n },\n\n /**\n * Attach event and detach it after the first run\n * @param {string} event Event name\n * @param {Function} callback Callback function\n * @return {this}\n */\n once(event, callback) {\n em.once(event, callback);\n return this;\n },\n\n /**\n * Detach event\n * @param {string} event Event name\n * @param {Function} callback Callback function\n * @return {this}\n */\n off(event, callback) {\n em.off(event, callback);\n return this;\n },\n\n /**\n * Trigger event\n * @param {string} event Event to trigger\n * @return {this}\n */\n trigger(event) {\n em.trigger.apply(em, arguments);\n return this;\n },\n\n /**\n * Destroy the editor\n */\n destroy() {\n return em.destroyAll();\n },\n\n /**\n * Returns editor element\n * @return {HTMLElement}\n * @private\n */\n getEl() {\n return editorView && editorView.el;\n },\n\n /**\n * Returns editor model\n * @return {Model}\n * @private\n */\n getModel() {\n return em;\n },\n\n /**\n * Render editor\n * @return {HTMLElement}\n */\n render() {\n editorView && editorView.remove();\n editorView = new EditorView({\n model: em,\n config: c\n });\n return editorView.render().el;\n },\n\n /**\n * Trigger a callback once the editor is loaded and rendered.\n * The callback will be executed immediately if the method is called on the already rendered editor.\n * @param {Function} clb Callback to trigger\n * @example\n * editor.onReady(() => {\n * // perform actions\n * });\n */\n onReady(clb) {\n em.get('ready') ? clb(this) : em.on('load', clb);\n },\n\n /**\n * Print safe HTML by using ES6 tagged template strings.\n * @param {Array} literals\n * @param {Array} substs\n * @returns {String}\n * @example\n * const unsafeStr = '';\n * const safeStr = 'Hello';\n * // Use `$${var}` to avoid escaping\n * const strHtml = editor.html`Escaped ${unsafeStr}, unescaped $${safeStr}`;\n */\n html\n };\n};\n","export default {\n plugins: []\n};\n","/**\n * File made for IE/Edge support\n * https://github.com/artf/grapesjs/issues/214\n */\nimport { hasWin } from './mixins';\n\nexport default () => {\n /**\n * Check if IE/Edge\n * @return {Boolean}\n */\n const isIE = () => {\n let match;\n const agent = window.navigator.userAgent;\n const rules = [\n ['edge', /Edge\\/([0-9\\._]+)/],\n ['ie', /MSIE\\s(7\\.0)/],\n ['ie', /MSIE\\s([0-9\\.]+);.*Trident\\/[4-7].0/],\n ['ie', /Trident\\/7\\.0.*rv\\:([0-9\\.]+).*\\).*Gecko$/]\n ];\n\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i];\n match = rule[1].exec(agent);\n if (match) break;\n }\n\n return !!match;\n };\n\n if (hasWin() && isIE()) {\n const originalCreateHTMLDocument =\n DOMImplementation.prototype.createHTMLDocument;\n DOMImplementation.prototype.createHTMLDocument = title => {\n if (!title) title = '';\n return originalCreateHTMLDocument.apply(document.implementation, [title]);\n };\n }\n};\n","import Editor from './editor';\nimport { isElement, isFunction } from 'underscore';\nimport polyfills from 'utils/polyfills';\nimport PluginManager from './plugin_manager';\nimport { hasWin } from 'utils/mixins';\n\npolyfills();\n\nconst plugins = new PluginManager();\nconst editors = [];\nconst cash = hasWin() ? require('cash-dom') : null;\nconst $ = (cash && cash.default) || cash;\nconst defaultConfig = {\n // If true renders editor on init\n autorender: 1,\n\n // Array of plugins to init\n plugins: [],\n\n // Custom options for plugins\n pluginsOpts: {}\n};\n\nexport default {\n $,\n\n editors,\n\n plugins,\n\n // Will be replaced on build\n version: __GJS_VERSION__,\n\n /**\n * Initialize the editor with passed options\n * @param {Object} config Configuration object\n * @param {string|HTMLElement} config.container Selector which indicates where render the editor\n * @param {Boolean} [config.autorender=true] If true, auto-render the content\n * @param {Array} [config.plugins=[]] Array of plugins to execute on start\n * @param {Object} [config.pluginsOpts={}] Custom options for plugins\n * @param {Boolean} [config.headless=false] Init headless editor\n * @return {Editor} Editor instance\n * @example\n * var editor = grapesjs.init({\n * container: '#myeditor',\n * components: '
Hello world
',\n * style: '.hello{color: red}',\n * })\n */\n init(config = {}) {\n const { headless } = config;\n const els = config.container;\n if (!els && !headless) throw new Error(\"'container' is required\");\n config = { ...defaultConfig, ...config, grapesjs: this };\n config.el =\n !headless && (isElement(els) ? els : document.querySelector(els));\n const editor = new Editor(config, { $ }).init();\n const em = editor.getModel();\n\n // Load plugins\n config.plugins.forEach(pluginId => {\n let plugin = plugins.get(pluginId);\n const plgOptions = config.pluginsOpts[pluginId] || {};\n\n // Try to search in global context\n if (!plugin) {\n const wplg = window[pluginId];\n plugin = wplg && wplg.default ? wplg.default : wplg;\n }\n\n if (plugin) {\n plugin(editor, plgOptions);\n } else if (isFunction(pluginId)) {\n pluginId(editor, plgOptions);\n } else {\n em.logWarning(`Plugin ${pluginId} not found`, {\n context: 'plugins',\n plugin: pluginId\n });\n }\n });\n\n // Execute `onLoad` on modules once all plugins are initialized.\n // A plugin might have extended/added some custom type so this\n // is a good point to load stuff like components, css rules, etc.\n em.loadOnStart();\n config.autorender && !headless && editor.render();\n editors.push(editor);\n\n return editor;\n }\n};\n","import defaults from './config/config';\n\nexport default config => {\n var c = config || {};\n\n // Set default options\n for (var name in defaults) {\n if (!(name in c)) c[name] = defaults[name];\n }\n\n var plugins = {};\n\n return {\n /**\n * Add new plugin. Plugins could not be overwritten\n * @param {string} id Plugin ID\n * @param {Function} plugin Function which contains all plugin logic\n * @return {Function} The plugin function\n * @example\n * PluginManager.add('some-plugin', function(editor){\n * editor.Commands.add('new-command', {\n * run: function(editor, senderBtn){\n * console.log('Executed new-command');\n * }\n * })\n * });\n */\n add(id, plugin) {\n if (plugins[id]) {\n return plugins[id];\n }\n\n plugins[id] = plugin;\n return plugin;\n },\n\n /**\n * Returns plugin by ID\n * @param {string} id Plugin ID\n * @return {Function|undefined} Plugin\n * @example\n * var plugin = PluginManager.get('some-plugin');\n * plugin(editor);\n */\n get(id) {\n return plugins[id];\n },\n\n /**\n * Returns object with all plugins\n * @return {Object}\n */\n getAll() {\n return plugins;\n }\n };\n};\n","export default {\n // Default assets\n // eg. [\n // 'https://...image1.png',\n // 'https://...image2.png',\n // {type: 'image', src: 'https://...image3.png', someOtherCustomProp: 1},\n // ..\n // ]\n assets: [],\n\n // Content to add where there is no assets to show\n // eg. 'No assets here, drag to upload'\n noAssets: '',\n\n // Style prefix\n stylePrefix: 'am-',\n\n // Upload endpoint, set `false` to disable upload\n // upload: 'https://endpoint/upload/assets',\n // upload: false,\n upload: 0,\n\n // The name used in POST to pass uploaded files\n uploadName: 'files',\n\n // Custom headers to pass with the upload request\n headers: {},\n\n // Custom parameters to pass with the upload request, eg. csrf token\n params: {},\n\n // The credentials setting for the upload request, eg. 'include', 'omit'\n credentials: 'include',\n\n // Allow uploading multiple files per request.\n // If disabled filename will not have '[]' appended\n multiUpload: true,\n\n // If true, tries to add automatically uploaded assets.\n // To make it work the server should respond with a JSON containing assets\n // in a data key, eg:\n // {\n // data: [\n // 'https://.../image.png',\n // ...\n // {src: 'https://.../image2.png'},\n // ...\n // ]\n // }\n autoAdd: true,\n\n // To upload your assets, the module uses Fetch API, with this option you\n // overwrite it with something else.\n // It should return a Promise\n // @example\n // customFetch: (url, options) => axios(url, { data: options.body }),\n customFetch: null,\n\n // Custom uploadFile function.\n // Differently from the `customFetch` option, this gives a total control\n // over the uploading process, but you also have to emit all `asset:upload:*` events\n // by yourself (if you need to use them somewhere)\n // @example\n // uploadFile: (e) => {\n // var files = e.dataTransfer ? e.dataTransfer.files : e.target.files;\n // // ...send somewhere\n // }\n uploadFile: null,\n\n // In the absence of 'uploadFile' or 'upload' assets will be embedded as Base64\n embedAsBase64: true,\n\n // Handle the image url submit from the built-in 'Add image' form\n // @example\n // handleAdd: (textFromInput) => {\n // // some check...\n // editor.AssetManager.add(textFromInput);\n // }\n handleAdd: null,\n\n // Method called before upload, on return false upload is canceled.\n // @example\n // beforeUpload: (files) => {\n // // logic...\n // var stopUpload = true;\n // if(stopUpload) return false;\n // }\n beforeUpload: null,\n\n // Toggles visiblity of assets url input\n showUrlInput: true,\n\n // Avoid rendering the default asset manager.\n custom: false,\n\n // WARNING: all the options below are considered DEPRECATED.\n // ---------------------------------------------------------------\n\n // Enable an upload dropzone on the entire editor (not document) when dragging\n // files over it\n // If active the dropzone disable/hide the upload dropzone in asset modal,\n // otherwise you will get double drops (#507)\n dropzone: false,\n\n // Open the asset manager once files are been dropped via the dropzone\n openAssetsOnDrop: 1,\n\n // Any dropzone content to append inside dropzone element\n dropzoneContent: ''\n};\n","import { result } from 'underscore';\nimport { Model } from 'common';\n\n/**\n * @property {String} type Asset type, eg. 'image'.\n * @property {String} src Asset URL, eg. 'https://.../image.png'.\n */\nexport default class Asset extends Model {\n defaults() {\n return {\n type: '',\n src: ''\n };\n }\n\n /**\n * Get asset type.\n * @returns {String}\n * @example\n * // Asset: { src: 'https://.../image.png', type: 'image' }\n * asset.getType(); // -> 'image'\n * */\n getType() {\n return this.get('type');\n }\n\n /**\n * Get asset URL.\n * @returns {String}\n * @example\n * // Asset: { src: 'https://.../image.png' }\n * asset.getSrc(); // -> 'https://.../image.png'\n * */\n getSrc() {\n return this.get('src');\n }\n\n /**\n * Get filename of the asset (based on `src`).\n * @returns {String}\n * @example\n * // Asset: { src: 'https://.../image.png' }\n * asset.getFilename(); // -> 'image.png'\n * // Asset: { src: 'https://.../image' }\n * asset.getFilename(); // -> 'image'\n * */\n getFilename() {\n return this.get('src')\n .split('/')\n .pop()\n .split('?')\n .shift();\n }\n\n /**\n * Get extension of the asset (based on `src`).\n * @returns {String}\n * @example\n * // Asset: { src: 'https://.../image.png' }\n * asset.getExtension(); // -> 'png'\n * // Asset: { src: 'https://.../image' }\n * asset.getExtension(); // -> ''\n * */\n getExtension() {\n return this.getFilename()\n .split('.')\n .pop();\n }\n}\n\nAsset.prototype.idAttribute = 'src';\n\nAsset.getDefaults = function() {\n return result(this.prototype, 'defaults');\n};\n","import Asset from './Asset';\n\nexport default class AssetImage extends Asset {\n defaults() {\n return {\n ...Asset.getDefaults(),\n type: 'image',\n unitDim: 'px',\n height: 0,\n width: 0\n };\n }\n}\n","import Backbone from 'backbone';\nimport { clone } from 'underscore';\n\nexport default Backbone.View.extend({\n initialize(o = {}) {\n this.options = o;\n this.collection = o.collection;\n const config = o.config || {};\n this.config = config;\n this.pfx = config.stylePrefix || '';\n this.ppfx = config.pStylePrefix || '';\n this.em = config.em;\n this.className = this.pfx + 'asset';\n this.listenTo(this.model, 'destroy remove', this.remove);\n this.model.view = this;\n const init = this.init && this.init.bind(this);\n init && init(o);\n },\n\n __getBhv() {\n const { em } = this;\n const am = em && em.get('AssetManager');\n return (am && am.__getBehaviour()) || {};\n },\n\n template() {\n const pfx = this.pfx;\n return `\n
\n ${this.getPreview()}\n
\n
\n ${this.getInfo()}\n
\n
\n ⨯\n
\n `;\n },\n\n /**\n * Update target if exists\n * @param {Model} target\n * @private\n * */\n updateTarget(target) {\n if (target && target.set) {\n target.set('attributes', clone(target.get('attributes')));\n target.set('src', this.model.get('src'));\n }\n },\n\n getPreview() {\n return '';\n },\n\n getInfo() {\n return '';\n },\n\n render() {\n const el = this.el;\n el.innerHTML = this.template(this, this.model);\n el.className = this.className;\n return this;\n }\n});\n","import { isFunction } from 'underscore';\nimport AssetView from './AssetView';\nimport html from 'utils/html';\n\nexport default AssetView.extend({\n events: {\n 'click [data-toggle=asset-remove]': 'onRemove',\n click: 'onClick',\n dblclick: 'onDblClick'\n },\n\n getPreview() {\n const { pfx, ppfx, model } = this;\n const src = model.get('src');\n return html`\n
\n
\n `;\n },\n\n getInfo() {\n const { pfx, model } = this;\n let name = model.get('name');\n let width = model.get('width');\n let height = model.get('height');\n let unit = model.get('unitDim');\n let dim = width && height ? `${width}x${height}${unit}` : '';\n name = name || model.getFilename();\n return html`\n
${name}
\n
${dim}
\n `;\n },\n\n init(o) {\n const pfx = this.pfx;\n this.className += ` ${pfx}asset-image`;\n },\n\n /**\n * Triggered when the asset is clicked\n * @private\n * */\n onClick() {\n const { model, pfx } = this;\n const { select } = this.__getBhv();\n const { onClick } = this.config;\n const coll = this.collection;\n coll.trigger('deselectAll');\n this.$el.addClass(pfx + 'highlight');\n\n if (isFunction(select)) {\n select(model, false);\n } else if (isFunction(onClick)) {\n onClick(model);\n } else {\n this.updateTarget(coll.target);\n }\n },\n\n /**\n * Triggered when the asset is double clicked\n * @private\n * */\n onDblClick() {\n const { em, model } = this;\n const { select } = this.__getBhv();\n const { onDblClick } = this.config;\n const { target, onSelect } = this.collection;\n\n if (isFunction(select)) {\n select(model, true);\n } else if (isFunction(onDblClick)) {\n onDblClick(model);\n } else {\n this.updateTarget(target);\n em && em.get('Modal').close();\n }\n isFunction(onSelect) && onSelect(model);\n },\n\n /**\n * Remove asset from collection\n * @private\n * */\n onRemove(e) {\n e.stopImmediatePropagation();\n this.model.collection.remove(this.model);\n }\n});\n","import Backbone from 'backbone';\nimport AssetImage from './AssetImage';\nimport AssetImageView from './../view/AssetImageView';\nimport TypeableCollection from 'domain_abstract/model/TypeableCollection';\n\nexport default Backbone.Collection.extend(TypeableCollection).extend({\n types: [\n {\n id: 'image',\n model: AssetImage,\n view: AssetImageView,\n isType(value) {\n if (typeof value == 'string') {\n return {\n type: 'image',\n src: value\n };\n }\n return value;\n }\n }\n ]\n});\n","import Backbone from 'backbone';\n\nexport default Backbone.View.extend({\n events: {\n submit: 'handleSubmit'\n },\n\n template({ pfx, ppfx, em, ...view }) {\n let form = '';\n if (this.config.showUrlInput) {\n form = `\n
\n
\n \n
\n \n
\n
\n `;\n }\n\n return `\n
\n
\n ${form}\n
\n
\n
\n
\n `;\n },\n\n initialize(o) {\n this.options = o;\n this.config = o.config;\n this.pfx = this.config.stylePrefix || '';\n this.ppfx = this.config.pStylePrefix || '';\n this.em = this.config.em;\n const coll = this.collection;\n this.listenTo(coll, 'reset', this.renderAssets);\n this.listenTo(coll, 'add', this.addToAsset);\n this.listenTo(coll, 'remove', this.removedAsset);\n this.listenTo(coll, 'deselectAll', this.deselectAll);\n },\n\n /**\n * Add new asset to the collection via string\n * @param {Event} e Event object\n * @return {this}\n * @private\n */\n handleSubmit(e) {\n e.preventDefault();\n const input = this.getAddInput();\n const url = input && input.value.trim();\n const handleAdd = this.config.handleAdd;\n\n if (!url) {\n return;\n }\n\n input.value = '';\n this.getAssetsEl().scrollTop = 0;\n\n if (handleAdd) {\n handleAdd.bind(this)(url);\n } else {\n this.options.globalCollection.add(url, { at: 0 });\n }\n },\n\n /**\n * Returns assets element\n * @return {HTMLElement}\n * @private\n */\n getAssetsEl() {\n //if(!this.assets) // Not able to cache as after the rerender it losses the ref\n return this.el.querySelector(`.${this.pfx}assets`);\n },\n\n /**\n * Returns input url element\n * @return {HTMLElement}\n * @private\n */\n getAddInput() {\n if (!this.inputUrl || !this.inputUrl.value)\n this.inputUrl = this.el.querySelector(`.${this.pfx}add-asset input`);\n return this.inputUrl;\n },\n\n /**\n * Triggered when an asset is removed\n * @param {Asset} model Removed asset\n * @private\n */\n removedAsset(model) {\n if (!this.collection.length) {\n this.toggleNoAssets();\n }\n },\n\n /**\n * Add asset to collection\n * @private\n * */\n addToAsset(model) {\n if (this.collection.length == 1) {\n this.toggleNoAssets(1);\n }\n this.addAsset(model);\n },\n\n /**\n * Add new asset to collection\n * @param Object Model\n * @param Object Fragment collection\n * @return Object Object created\n * @private\n * */\n addAsset(model, fragmentEl = null) {\n const fragment = fragmentEl;\n const collection = this.collection;\n const config = this.config;\n const rendered = new model.typeView({\n model,\n collection,\n config\n }).render().el;\n\n if (fragment) {\n fragment.appendChild(rendered);\n } else {\n const assetsEl = this.getAssetsEl();\n if (assetsEl) {\n assetsEl.insertBefore(rendered, assetsEl.firstChild);\n }\n }\n\n return rendered;\n },\n\n /**\n * Checks if to show noAssets\n * @param {Boolean} hide\n * @private\n */\n toggleNoAssets(hide) {\n const assetsEl = this.$el.find(`.${this.pfx}assets`);\n\n if (hide) {\n assetsEl.empty();\n } else {\n const noAssets = this.config.noAssets;\n noAssets && assetsEl.append(noAssets);\n }\n },\n\n /**\n * Deselect all assets\n * @private\n * */\n deselectAll() {\n const pfx = this.pfx;\n this.$el.find(`.${pfx}highlight`).removeClass(`${pfx}highlight`);\n },\n\n renderAssets() {\n const fragment = document.createDocumentFragment();\n const assets = this.$el.find(`.${this.pfx}assets`);\n assets.empty();\n this.toggleNoAssets(this.collection.length);\n this.collection.each(model => this.addAsset(model, fragment));\n assets.append(fragment);\n },\n\n render() {\n const fuRendered = this.options.fu.render().el;\n this.$el.empty();\n this.$el.append(fuRendered).append(this.template(this));\n this.el.className = `${this.ppfx}asset-manager`;\n this.renderAssets();\n return this;\n }\n});\n","import Backbone from 'backbone';\nimport fetch from 'utils/fetch';\nimport html from 'utils/html';\n\nexport default Backbone.View.extend(\n {\n template({ pfx, title, uploadId, disabled, multiUpload }) {\n return html`\n
\n
${title}
\n \n
\n \n `;\n },\n\n events: {},\n\n initialize(opts = {}) {\n this.options = opts;\n const c = opts.config || {};\n this.module = c.module;\n this.config = c;\n this.em = this.config.em;\n this.pfx = c.stylePrefix || '';\n this.ppfx = c.pStylePrefix || '';\n this.target = this.options.globalCollection || {};\n this.uploadId = this.pfx + 'uploadFile';\n this.disabled =\n c.disableUpload !== undefined\n ? c.disableUpload\n : !c.upload && !c.embedAsBase64;\n this.multiUpload = c.multiUpload !== undefined ? c.multiUpload : true;\n this.events['change #' + this.uploadId] = 'uploadFile';\n let uploadFile = c.uploadFile;\n\n if (uploadFile) {\n this.uploadFile = uploadFile.bind(this);\n } else if (!c.upload && c.embedAsBase64) {\n this.uploadFile = this.constructor.embedAsBase64;\n }\n\n this.delegateEvents();\n },\n\n /**\n * Triggered before the upload is started\n * @private\n */\n onUploadStart() {\n const { module } = this;\n module && module.__propEv('asset:upload:start');\n },\n\n /**\n * Triggered after the upload is ended\n * @param {Object|string} res End result\n * @private\n */\n onUploadEnd(res) {\n const { $el, module } = this;\n module && module.__propEv('asset:upload:end', res);\n const input = $el.find('input');\n input && input.val('');\n },\n\n /**\n * Triggered on upload error\n * @param {Object} err Error\n * @private\n */\n onUploadError(err) {\n const { module } = this;\n console.error(err);\n this.onUploadEnd(err);\n module && module.__propEv('asset:upload:error', err);\n },\n\n /**\n * Triggered on upload response\n * @param {string} text Response text\n * @private\n */\n onUploadResponse(text, clb) {\n const { module, config, target } = this;\n let json;\n try {\n json = typeof text === 'string' ? JSON.parse(text) : text;\n } catch (e) {\n json = text;\n }\n\n module && module.__propEv('asset:upload:response', json);\n\n if (config.autoAdd && target) {\n target.add(json.data, { at: 0 });\n }\n\n this.onUploadEnd(text);\n clb && clb(json);\n },\n\n /**\n * Upload files\n * @param {Object} e Event\n * @return {Promise}\n * @private\n * */\n uploadFile(e, clb) {\n const files = e.dataTransfer ? e.dataTransfer.files : e.target.files;\n const { config } = this;\n const { beforeUpload } = config;\n\n const beforeUploadResponse = beforeUpload && beforeUpload(files);\n if (beforeUploadResponse === false) return;\n\n const body = new FormData();\n const { params, customFetch } = config;\n\n for (let param in params) {\n body.append(param, params[param]);\n }\n\n if (this.multiUpload) {\n for (let i = 0; i < files.length; i++) {\n body.append(`${config.uploadName}[]`, files[i]);\n }\n } else if (files.length) {\n body.append(config.uploadName, files[0]);\n }\n\n var target = this.target;\n const url = config.upload;\n const headers = config.headers;\n const reqHead = 'X-Requested-With';\n\n if (typeof headers[reqHead] == 'undefined') {\n headers[reqHead] = 'XMLHttpRequest';\n }\n\n if (url) {\n this.onUploadStart();\n const fetchOpts = {\n method: 'post',\n credentials: config.credentials || 'include',\n headers,\n body\n };\n const fetchResult = customFetch\n ? customFetch(url, fetchOpts)\n : fetch(url, fetchOpts).then(res =>\n ((res.status / 200) | 0) == 1\n ? res.text()\n : res.text().then(text => Promise.reject(text))\n );\n return fetchResult\n .then(text => this.onUploadResponse(text, clb))\n .catch(err => this.onUploadError(err));\n }\n },\n\n /**\n * Make input file droppable\n * @private\n * */\n initDrop() {\n var that = this;\n if (!this.uploadForm) {\n this.uploadForm = this.$el.find('form').get(0);\n if ('draggable' in this.uploadForm) {\n var uploadFile = this.uploadFile;\n this.uploadForm.ondragover = function() {\n this.className = that.pfx + 'hover';\n return false;\n };\n this.uploadForm.ondragleave = function() {\n this.className = '';\n return false;\n };\n this.uploadForm.ondrop = function(e) {\n this.className = '';\n e.preventDefault();\n that.uploadFile(e);\n return;\n };\n }\n }\n },\n\n initDropzone(ev) {\n let addedCls = 0;\n const c = this.config;\n const em = ev.model;\n const edEl = ev.el;\n const editor = em.get('Editor');\n const container = em.get('Config').el;\n const frameEl = em.get('Canvas').getBody();\n const ppfx = this.ppfx;\n const updatedCls = `${ppfx}dropzone-active`;\n const dropzoneCls = `${ppfx}dropzone`;\n const cleanEditorElCls = () => {\n edEl.className = edEl.className.replace(updatedCls, '').trim();\n addedCls = 0;\n };\n const onDragOver = () => {\n if (!addedCls) {\n edEl.className += ` ${updatedCls}`;\n addedCls = 1;\n }\n return false;\n };\n const onDragLeave = () => {\n cleanEditorElCls();\n return false;\n };\n const onDrop = e => {\n cleanEditorElCls();\n e.preventDefault();\n e.stopPropagation();\n this.uploadFile(e);\n\n if (c.openAssetsOnDrop && editor) {\n const target = editor.getSelected();\n editor.runCommand('open-assets', {\n target,\n onSelect() {\n editor.Modal.close();\n editor.AssetManager.setTarget(null);\n }\n });\n }\n\n return false;\n };\n\n ev.$el.append(`
${c.dropzoneContent}
`);\n cleanEditorElCls();\n\n if ('draggable' in edEl) {\n [edEl, frameEl].forEach(item => {\n item.ondragover = onDragOver;\n item.ondragleave = onDragLeave;\n item.ondrop = onDrop;\n });\n }\n },\n\n render() {\n const { $el, pfx, em } = this;\n $el.html(\n this.template({\n title: em && em.t('assetManager.uploadTitle'),\n uploadId: this.uploadId,\n disabled: this.disabled,\n multiUpload: this.multiUpload,\n pfx\n })\n );\n this.initDrop();\n $el.attr('class', pfx + 'file-uploader');\n return this;\n }\n },\n {\n embedAsBase64: function(e, clb) {\n // List files dropped\n const files = e.dataTransfer ? e.dataTransfer.files : e.target.files;\n const response = { data: [] };\n\n // Unlikely, widely supported now\n if (!FileReader) {\n this.onUploadError(\n new Error('Unsupported platform, FileReader is not defined')\n );\n return;\n }\n\n const promises = [];\n const mimeTypeMatcher = /^(.+)\\/(.+)$/;\n\n for (const file of files) {\n // For each file a reader (to read the base64 URL)\n // and a promise (to track and merge results and errors)\n const promise = new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.addEventListener('load', event => {\n let type;\n const name = file.name;\n\n // Try to find the MIME type of the file.\n const match = mimeTypeMatcher.exec(file.type);\n if (match) {\n type = match[1]; // The first part in the MIME, \"image\" in image/png\n } else {\n type = file.type;\n }\n\n /*\n // Show local video files, http://jsfiddle.net/dsbonev/cCCZ2/embedded/result,js,html,css/\n var URL = window.URL || window.webkitURL\n var file = this.files[0]\n var type = file.type\n var videoNode = document.createElement('video');\n var canPlay = videoNode.canPlayType(type) // can use also for 'audio' types\n if (canPlay === '') canPlay = 'no'\n var message = 'Can play type \"' + type + '\": ' + canPlay\n var isError = canPlay === 'no'\n displayMessage(message, isError)\n\n if (isError) {\n return\n }\n\n var fileURL = URL.createObjectURL(file)\n videoNode.src = fileURL\n */\n\n // If it's an image, try to find its size\n if (type === 'image') {\n const data = {\n src: reader.result,\n name,\n type,\n height: 0,\n width: 0\n };\n\n const image = new Image();\n image.addEventListener('error', error => {\n reject(error);\n });\n image.addEventListener('load', () => {\n data.height = image.height;\n data.width = image.width;\n resolve(data);\n });\n image.src = data.src;\n } else if (type) {\n // Not an image, but has a type\n resolve({\n src: reader.result,\n name,\n type\n });\n } else {\n // No type found, resolve with the URL only\n resolve(reader.result);\n }\n });\n reader.addEventListener('error', error => {\n reject(error);\n });\n reader.addEventListener('abort', error => {\n reject('Aborted');\n });\n\n reader.readAsDataURL(file);\n });\n\n promises.push(promise);\n }\n\n Promise.all(promises).then(\n data => {\n response.data = data;\n this.onUploadResponse(response, clb);\n },\n error => {\n this.onUploadError(error);\n }\n );\n }\n }\n);\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/asset_manager/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * assetManager: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const assetManager = editor.AssetManager;\n * ```\n *\n * ## Available Events\n * * `asset:open` - Asset Manager opened.\n * * `asset:close` - Asset Manager closed.\n * * `asset:add` - Asset added. The [Asset] is passed as an argument to the callback.\n * * `asset:remove` - Asset removed. The [Asset] is passed as an argument to the callback.\n * * `asset:update` - Asset updated. The updated [Asset] and the object containing changes are passed as arguments to the callback.\n * * `asset:upload:start` - Before the upload is started.\n * * `asset:upload:end` - After the upload is ended.\n * * `asset:upload:error` - On any error in upload, passes the error as an argument.\n * * `asset:upload:response` - On upload response, passes the result as an argument.\n * * `asset` - Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback.\n * * `asset:custom` - Event for handling custom Asset Manager UI.\n *\n * ## Methods\n * * [open](#open)\n * * [close](#close)\n * * [isOpen](#isopen)\n * * [add](#add)\n * * [get](#get)\n * * [getAll](#getall)\n * * [getAllVisible](#getallvisible)\n * * [remove](#remove)\n * * [store](#store)\n * * [load](#load)\n * * [getContainer](#getcontainer)\n *\n * [Asset]: asset.html\n *\n * @module AssetManager\n */\n\nimport { debounce, isFunction } from 'underscore';\nimport Module from 'common/module';\nimport defaults from './config/config';\nimport Asset from './model/Assets';\nimport Assets from './model/Assets';\nimport AssetsView from './view/AssetsView';\nimport FileUpload from './view/FileUploader';\n\nexport const evAll = 'asset';\nexport const evPfx = `${evAll}:`;\nexport const evSelect = `${evPfx}select`;\nexport const evUpdate = `${evPfx}update`;\nexport const evAdd = `${evPfx}add`;\nexport const evRemove = `${evPfx}remove`;\nexport const evRemoveBefore = `${evRemove}:before`;\nexport const evCustom = `${evPfx}custom`;\nexport const evOpen = `${evPfx}open`;\nexport const evClose = `${evPfx}close`;\n\nexport default () => {\n let c = {};\n let assets, assetsVis, am, fu;\n const assetCmd = 'open-assets';\n\n return {\n ...Module,\n\n name: 'AssetManager',\n\n storageKey: 'assets',\n\n Asset,\n\n Assets,\n\n events: {\n all: evAll,\n select: evSelect,\n update: evUpdate,\n add: evAdd,\n remove: evRemove,\n removeBefore: evRemoveBefore,\n custom: evCustom,\n open: evOpen,\n close: evClose\n },\n\n init(config = {}) {\n c = { ...defaults, ...config };\n const ppfx = c.pStylePrefix;\n const { em } = c;\n this.config = c;\n this.em = em;\n\n if (ppfx) {\n c.stylePrefix = ppfx + c.stylePrefix;\n }\n\n // Global assets collection\n assets = new Assets([]);\n assetsVis = new Assets([]);\n this.all = assets;\n this.__initListen();\n\n // Setup the sync between the global and public collections\n assets.on('add', model => this.getAllVisible().add(model));\n assets.on('remove', model => this.getAllVisible().remove(model));\n\n return this;\n },\n\n __propEv(ev, ...data) {\n this.em.trigger(ev, ...data);\n this.getAll().trigger(ev, ...data);\n },\n\n __onAllEvent: debounce(function() {\n this.__trgCustom();\n }),\n\n __trgCustom() {\n const bhv = this.__getBehaviour();\n if (!bhv.container && !this.getConfig('custom').open) {\n return;\n }\n this.em.trigger(this.events.custom, this.__customData());\n },\n\n __customData() {\n const bhv = this.__getBehaviour();\n return {\n am: this,\n open: this.isOpen(),\n assets: this.getAll().models,\n types: bhv.types || [],\n container: bhv.container,\n close: () => this.close(),\n remove: (...args) => this.remove(...args),\n select: (asset, complete) => {\n const res = this.add(asset);\n isFunction(bhv.select) && bhv.select(res, complete);\n },\n // extra\n options: bhv.options || {}\n };\n },\n\n /**\n * Open the asset manager.\n * @param {Object} [options] Options for the asset manager.\n * @param {Array} [options.types=['image']] Types of assets to show.\n * @param {Function} [options.select] Type of operation to perform on asset selection. If not specified, nothing will happen.\n * @example\n * assetManager.open({\n * select(asset, complete) {\n * const selected = editor.getSelected();\n * if (selected && selected.is('image')) {\n * selected.addAttributes({ src: asset.getSrc() });\n * // The default AssetManager UI will trigger `select(asset, false)` on asset click\n * // and `select(asset, true)` on double-click\n * complete && assetManager.close();\n * }\n * }\n * });\n * // with your custom types (you should have assets with those types declared)\n * assetManager.open({ types: ['doc'], ... });\n */\n open(options = {}) {\n const cmd = this.em.get('Commands');\n cmd.run(assetCmd, {\n types: ['image'],\n select: () => {},\n ...options\n });\n },\n\n /**\n * Close the asset manager.\n * @example\n * assetManager.close();\n */\n close() {\n const cmd = this.em.get('Commands');\n cmd.stop(assetCmd);\n },\n\n /**\n * Checks if the asset manager is open\n * @returns {Boolean}\n * @example\n * assetManager.isOpen(); // true | false\n */\n isOpen() {\n const cmd = this.em.get('Commands');\n return !!(cmd && cmd.isActive(assetCmd));\n },\n\n /**\n * Add new asset/s to the collection. URLs are supposed to be unique\n * @param {String|Object|Array|Array} asset URL strings or an objects representing the resource.\n * @param {Object} [opts] Options\n * @returns {[Asset]}\n * @example\n * // As strings\n * assetManager.add('http://img.jpg');\n * assetManager.add(['http://img.jpg', './path/to/img.png']);\n *\n * // Using objects you can indicate the type and other meta informations\n * assetManager.add({\n * // type: 'image',\t// image is default\n * \tsrc: 'http://img.jpg',\n * \theight: 300,\n *\twidth: 200,\n * });\n * assetManager.add([{ src: 'img2.jpg' }, { src: 'img2.png' }]);\n */\n add(asset, opts = {}) {\n // Put the model at the beginning\n if (typeof opts.at == 'undefined') {\n opts.at = 0;\n }\n\n return assets.add(asset, opts);\n },\n\n /**\n * Return asset by URL\n * @param {String} src URL of the asset\n * @returns {[Asset]|null}\n * @example\n * const asset = assetManager.get('http://img.jpg');\n */\n get(src) {\n return assets.where({ src })[0] || null;\n },\n\n /**\n * Return the global collection, containing all the assets\n * @returns {Collection<[Asset]>}\n */\n getAll() {\n return assets;\n },\n\n /**\n * Return the visible collection, which contains assets actually rendered\n * @returns {Collection<[Asset]>}\n */\n getAllVisible() {\n return assetsVis;\n },\n\n /**\n * Remove asset\n * @param {String|[Asset]} asset Asset or asset URL\n * @returns {[Asset]} Removed asset\n * @example\n * const removed = assetManager.remove('http://img.jpg');\n * // or by passing the Asset\n * const asset = assetManager.get('http://img.jpg');\n * assetManager.remove(asset);\n */\n remove(asset, opts) {\n return this.__remove(asset, opts);\n },\n\n /**\n * Store assets data to the selected storage\n * @param {Boolean} noStore If true, won't store\n * @returns {Object} Data to store\n * @example\n * var assets = assetManager.store();\n */\n store(noStore) {\n const obj = {};\n const assets = JSON.stringify(this.getAll().toJSON());\n obj[this.storageKey] = assets;\n if (!noStore && c.stm) c.stm.store(obj);\n return obj;\n },\n\n /**\n * Load data from the passed object.\n * The fetched data will be added to the collection.\n * @param {Object} data Object of data to load\n * @returns {Object} Loaded assets\n * @example\n * var assets = assetManager.load({\n * \tassets: [...]\n * })\n *\n */\n load(data = {}) {\n const name = this.storageKey;\n let assets = data[name] || [];\n\n if (typeof assets == 'string') {\n try {\n assets = JSON.parse(data[name]);\n } catch (err) {}\n }\n\n if (assets && assets.length) {\n this.getAll().reset(assets);\n }\n\n return assets;\n },\n\n /**\n * Return the Asset Manager Container\n * @returns {HTMLElement}\n */\n getContainer() {\n const bhv = this.__getBehaviour();\n return bhv.container || (am && am.el);\n },\n\n /**\n * Get assets element container\n * @returns {HTMLElement}\n * @private\n */\n getAssetsEl() {\n return am.el.querySelector('[data-el=assets]');\n },\n\n /**\n * Render assets\n * @param {array} assets Assets to render, without the argument will render all global assets\n * @returns {HTMLElement}\n * @example\n * // Render all assets\n * assetManager.render();\n *\n * // Render some of the assets\n * const assets = assetManager.getAll();\n * assetManager.render(assets.filter(\n * asset => asset.get('category') == 'cats'\n * ));\n */\n render(assts) {\n if (this.getConfig('custom')) return;\n const toRender = assts || this.getAll().models;\n\n if (!am) {\n const obj = {\n collection: assetsVis, // Collection visible in asset manager\n globalCollection: assets,\n config: c,\n module: this\n };\n fu = new FileUpload(obj);\n obj.fu = fu;\n const el = am && am.el;\n am = new AssetsView({\n el,\n ...obj\n });\n am.render();\n }\n\n assetsVis.reset(toRender);\n return this.getContainer();\n },\n\n /**\n * Add new type. If you want to get more about type definition we suggest to read the [module's page](/modules/Assets.html)\n * @param {string} id Type ID\n * @param {Object} definition Definition of the type. Each definition contains\n * `model` (business logic), `view` (presentation logic)\n * and `isType` function which recognize the type of the\n * passed entity\n * @private\n * @example\n * assetManager.addType('my-type', {\n * model: {},\n * view: {},\n * isType: (value) => {},\n * })\n */\n addType(id, definition) {\n this.getAll().addType(id, definition);\n },\n\n /**\n * Get type\n * @param {string} id Type ID\n * @returns {Object} Type definition\n * @private\n */\n getType(id) {\n return this.getAll().getType(id);\n },\n\n /**\n * Get types\n * @returns {Array}\n * @private\n */\n getTypes() {\n return this.getAll().getTypes();\n },\n\n //-------\n\n AssetsView() {\n return am;\n },\n\n FileUploader() {\n return fu;\n },\n\n onLoad() {\n this.getAll().reset(c.assets);\n const { em, events } = this;\n em.on(`run:${assetCmd}`, () => this.__propEv(events.open));\n em.on(`stop:${assetCmd}`, () => this.__propEv(events.close));\n },\n\n postRender(editorView) {\n c.dropzone && fu && fu.initDropzone(editorView);\n },\n\n /**\n * Set new target\n * @param\t{Object}\tm Model\n * @private\n * */\n setTarget(m) {\n assetsVis.target = m;\n },\n\n /**\n * Set callback after asset was selected\n * @param\t{Object}\tf Callback function\n * @private\n * */\n onSelect(f) {\n assetsVis.onSelect = f;\n },\n\n /**\n * Set callback to fire when the asset is clicked\n * @param {function} func\n * @private\n */\n onClick(func) {\n c.onClick = func;\n },\n\n /**\n * Set callback to fire when the asset is double clicked\n * @param {function} func\n * @private\n */\n onDblClick(func) {\n c.onDblClick = func;\n },\n\n __behaviour(opts = {}) {\n return (this._bhv = {\n ...(this._bhv || {}),\n ...opts\n });\n },\n\n __getBehaviour(opts = {}) {\n return this._bhv || {};\n },\n\n destroy() {\n assets.stopListening();\n assetsVis.stopListening();\n assets.reset();\n assetsVis.reset();\n fu && fu.remove();\n am && am.remove();\n [assets, am, fu].forEach(i => (i = null));\n this._bhv = {};\n c = {};\n }\n };\n};\n","export default {\n stylePrefix: 'trt-',\n\n // Specify the element to use as a container, string (query) or HTMLElement\n // With the empty value, nothing will be rendered\n appendTo: '',\n\n // Default options for the target input\n optionsTarget: [{ value: false }, { value: '_blank' }]\n};\n","import Backbone from 'backbone';\nimport { isUndefined, isString, isFunction } from 'underscore';\nimport { capitalize } from 'utils/mixins';\n\nconst $ = Backbone.$;\n\nexport default Backbone.View.extend({\n events: {},\n eventCapture: ['change'],\n\n appendInput: 1,\n\n attributes() {\n return this.model.get('attributes');\n },\n\n templateLabel() {\n const { ppfx } = this;\n const label = this.getLabel();\n return `
${label}
`;\n },\n\n templateInput() {\n const { clsField } = this;\n return `
`;\n },\n\n initialize(o = {}) {\n const { config = {} } = o;\n const { model, eventCapture } = this;\n const { target } = model;\n const { type } = model.attributes;\n this.config = config;\n this.em = config.em;\n this.pfx = config.stylePrefix || '';\n this.ppfx = config.pStylePrefix || '';\n this.target = target;\n const { ppfx } = this;\n this.clsField = `${ppfx}field ${ppfx}field-${type}`;\n [\n ['change:value', this.onValueChange],\n ['remove', this.removeView]\n ].forEach(([event, clb]) => {\n model.off(event, clb);\n this.listenTo(model, event, clb);\n });\n model.view = this;\n this.listenTo(model, 'change:label', this.render);\n this.listenTo(model, 'change:placeholder', this.rerender);\n this.events = {};\n eventCapture.forEach(event => (this.events[event] = 'onChange'));\n this.delegateEvents();\n this.init();\n },\n\n getClbOpts() {\n return {\n component: this.target,\n trait: this.model,\n elInput: this.getInputElem()\n };\n },\n\n removeView() {\n this.remove();\n this.removed();\n },\n\n init() {},\n removed() {},\n onRender() {},\n onUpdate() {},\n onEvent() {},\n\n /**\n * Fires when the input is changed\n * @private\n */\n onChange(event) {\n const el = this.getInputElem();\n if (el && !isUndefined(el.value)) {\n this.model.set('value', el.value);\n }\n this.onEvent({\n ...this.getClbOpts(),\n event\n });\n },\n\n getValueForTarget() {\n return this.model.get('value');\n },\n\n setInputValue(value) {\n const el = this.getInputElem();\n el && (el.value = value);\n },\n\n /**\n * On change callback\n * @private\n */\n onValueChange(model, value, opts = {}) {\n if (opts.fromTarget) {\n this.setInputValue(model.get('value'));\n this.postUpdate();\n } else {\n const val = this.getValueForTarget();\n model.setTargetValue(val, opts);\n }\n },\n\n /**\n * Render label\n * @private\n */\n renderLabel() {\n const { $el, target } = this;\n const label = this.getLabel();\n let tpl = this.templateLabel(target);\n\n if (this.createLabel) {\n tpl =\n this.createLabel({\n label,\n component: target,\n trait: this\n }) || '';\n }\n\n $el.find('[data-label]').append(tpl);\n },\n\n /**\n * Returns label for the input\n * @return {string}\n * @private\n */\n getLabel() {\n const { em } = this;\n const { label, name } = this.model.attributes;\n return (\n em.t(`traitManager.traits.labels.${name}`) ||\n capitalize(label || name).replace(/-/g, ' ')\n );\n },\n\n /**\n * Returns current target component\n */\n getComponent() {\n return this.target;\n },\n\n /**\n * Returns input element\n * @return {HTMLElement}\n * @private\n */\n getInputEl() {\n if (!this.$input) {\n const { em, model } = this;\n const md = model;\n const { name } = model.attributes;\n const plh = md.get('placeholder') || md.get('default') || '';\n const type = md.get('type') || 'text';\n const min = md.get('min');\n const max = md.get('max');\n const value = this.getModelValue();\n const input = $(``);\n const i18nAttr = em.t(`traitManager.traits.attributes.${name}`) || {};\n input.attr(i18nAttr);\n\n if (!isUndefined(value)) {\n md.set({ value }, { silent: true });\n input.prop('value', value);\n }\n\n if (min) {\n input.prop('min', min);\n }\n\n if (max) {\n input.prop('max', max);\n }\n\n this.$input = input;\n }\n return this.$input.get(0);\n },\n\n getInputElem() {\n const { input, $input } = this;\n return (\n input || ($input && $input.get && $input.get(0)) || this.getElInput()\n );\n },\n\n getModelValue() {\n let value;\n const model = this.model;\n const target = this.target;\n const name = model.get('name');\n\n if (model.get('changeProp')) {\n value = target.get(name);\n } else {\n const attrs = target.get('attributes');\n value = model.get('value') || attrs[name];\n }\n\n return !isUndefined(value) ? value : '';\n },\n\n getElInput() {\n return this.elInput;\n },\n\n /**\n * Renders input\n * @private\n * */\n renderField() {\n const { $el, appendInput, model } = this;\n const inputs = $el.find('[data-input]');\n const el = inputs[inputs.length - 1];\n let tpl = model.el;\n\n if (!tpl) {\n tpl = this.createInput\n ? this.createInput(this.getClbOpts())\n : this.getInputEl();\n }\n\n if (isString(tpl)) {\n el.innerHTML = tpl;\n this.elInput = el.firstChild;\n } else {\n appendInput ? el.appendChild(tpl) : el.insertBefore(tpl, el.firstChild);\n this.elInput = tpl;\n }\n\n model.el = this.elInput;\n },\n\n hasLabel() {\n const { label } = this.model.attributes;\n return !this.noLabel && label !== false;\n },\n\n rerender() {\n this.model.el = null;\n this.render();\n },\n\n postUpdate() {\n this.onUpdate(this.getClbOpts());\n },\n\n render() {\n const { $el, pfx, ppfx, model } = this;\n const { type, id } = model.attributes;\n const hasLabel = this.hasLabel && this.hasLabel();\n const cls = `${pfx}trait`;\n this.$input = null;\n let tmpl = `
\n ${hasLabel ? `
` : ''}\n
\n ${\n this.templateInput\n ? isFunction(this.templateInput)\n ? this.templateInput(this.getClbOpts())\n : this.templateInput\n : ''\n }\n
\n
`;\n $el.empty().append(tmpl);\n hasLabel && this.renderLabel();\n this.renderField();\n this.el.className = `${cls}__wrp ${cls}__wrp-${id}`;\n this.postUpdate();\n this.onRender(this.getClbOpts());\n return this;\n }\n});\n","import DomainViews from 'domain_abstract/view/DomainViews';\nimport TraitView from './TraitView';\n\nexport default DomainViews.extend({\n ns: 'Traits',\n itemView: TraitView,\n reuseView: 1,\n\n initialize(o = {}) {\n const config = o.config || {};\n const pfx = config.stylePrefix || '';\n const em = o.editor;\n this.config = config;\n this.em = em;\n this.pfx = pfx;\n this.ppfx = config.pStylePrefix || '';\n this.className = `${pfx}traits`;\n this.listenTo(em, 'component:toggled', this.updatedCollection);\n },\n\n /**\n * Update view collection\n * @private\n */\n updatedCollection() {\n const { ppfx, className, em } = this;\n const comp = em.getSelected();\n this.el.className = `${className} ${ppfx}one-bg ${ppfx}two-color`;\n this.collection = comp ? comp.get('traits') : [];\n this.render();\n }\n});\n","import Backbone from 'backbone';\nimport { isString, isUndefined } from 'underscore';\nimport TraitView from './TraitView';\n\nconst $ = Backbone.$;\n\nexport default TraitView.extend({\n init() {\n this.listenTo(this.model, 'change:options', this.rerender);\n },\n\n templateInput() {\n const { ppfx, clsField } = this;\n return `
\n
\n
\n
\n
\n
`;\n },\n\n /**\n * Returns input element\n * @return {HTMLElement}\n * @private\n */\n getInputEl() {\n if (!this.$input) {\n const { model, em } = this;\n const propName = model.get('name');\n const opts = model.get('options') || [];\n const values = [];\n let input = '';\n this.$input = $(input);\n const val = model.getTargetValue();\n const valResult = values.indexOf(val) >= 0 ? val : model.get('default');\n !isUndefined(valResult) && this.$input.val(valResult);\n }\n\n return this.$input.get(0);\n }\n});\n","import { isUndefined } from 'underscore';\nimport TraitView from './TraitView';\n\nexport default TraitView.extend({\n appendInput: 0,\n\n templateInput() {\n const { ppfx, clsField } = this;\n return ``;\n },\n\n /**\n * Fires when the input is changed\n * @private\n */\n onChange() {\n const value = this.getInputElem().checked;\n this.model.set('value', this.getCheckedValue(value));\n },\n\n getCheckedValue(checked) {\n let result = checked;\n const { valueTrue, valueFalse } = this.model.attributes;\n\n if (result && !isUndefined(valueTrue)) {\n result = valueTrue;\n }\n\n if (!result && !isUndefined(valueFalse)) {\n result = valueFalse;\n }\n\n return result;\n },\n\n /**\n * Returns input element\n * @return {HTMLElement}\n * @private\n */\n getInputEl(...args) {\n const toInit = !this.$input;\n const el = TraitView.prototype.getInputEl.apply(this, args);\n\n if (toInit) {\n let checked, targetValue;\n const { model, target } = this;\n const { valueTrue, valueFalse } = model.attributes;\n const name = model.get('name');\n\n if (model.get('changeProp')) {\n checked = target.get(name);\n targetValue = checked;\n } else {\n targetValue = target.get('attributes')[name];\n checked = targetValue || targetValue === '' ? !0 : !1;\n }\n\n if (!isUndefined(valueFalse) && targetValue === valueFalse) {\n checked = !1;\n }\n\n el.checked = checked;\n }\n\n return el;\n }\n});\n","import TraitView from './TraitView';\nimport { isUndefined } from 'underscore';\nimport InputNumber from 'domain_abstract/ui/InputNumber';\n\nexport default TraitView.extend({\n getValueForTarget() {\n const { model } = this;\n const { value, unit } = model.attributes;\n return !isUndefined(value) && value !== ''\n ? value + unit\n : model.get('default');\n },\n\n /**\n * Returns input element\n * @return {HTMLElement}\n * @private\n */\n getInputEl() {\n if (!this.input) {\n const { ppfx, model } = this;\n const value = this.getModelValue();\n const inputNumber = new InputNumber({\n contClass: `${ppfx}field-int`,\n type: 'number',\n model: model,\n ppfx\n });\n this.input = inputNumber.render();\n this.$input = this.input.inputEl;\n this.$unit = this.input.unitEl;\n model.set('value', value, { fromTarget: 1 });\n this.$input.val(value);\n this.input = inputNumber.el;\n }\n return this.input;\n }\n});\n","import TraitView from './TraitView';\nimport InputColor from 'domain_abstract/ui/InputColor';\n\nexport default TraitView.extend({\n templateInput: '',\n\n /**\n * Returns input element\n * @return {HTMLElement}\n * @private\n */\n getInputEl() {\n if (!this.input) {\n const model = this.model;\n const value = this.getModelValue();\n const inputColor = new InputColor({\n model,\n target: this.config.em,\n contClass: this.ppfx + 'field-color',\n ppfx: this.ppfx\n });\n const input = inputColor.render();\n input.setValue(value, { fromTarget: 1 });\n this.input = input.el;\n }\n\n return this.input;\n }\n});\n","import { isString } from 'underscore';\nimport TraitView from './TraitView';\n\nexport default TraitView.extend({\n eventCapture: ['click button'],\n\n templateInput: '',\n\n onChange() {\n this.handleClick();\n },\n\n handleClick() {\n const { model, em } = this;\n const command = model.get('command');\n\n if (command) {\n if (isString(command)) {\n em.get('Commands').run(command);\n } else {\n command(em.get('Editor'), model);\n }\n }\n },\n\n renderLabel() {\n if (this.model.get('label')) {\n TraitView.prototype.renderLabel.apply(this, arguments);\n }\n },\n\n getInputEl() {\n const { model, ppfx } = this;\n const { labelButton, text, full } = model.props();\n const label = labelButton || text;\n const className = `${ppfx}btn`;\n const input = ``;\n return input;\n }\n});\n","import { defaults, isElement } from 'underscore';\nimport defaultOpts from './config/config';\nimport TraitsView from './view/TraitsView';\nimport TraitView from './view/TraitView';\nimport TraitSelectView from './view/TraitSelectView';\nimport TraitCheckboxView from './view/TraitCheckboxView';\nimport TraitNumberView from './view/TraitNumberView';\nimport TraitColorView from './view/TraitColorView';\nimport TraitButtonView from './view/TraitButtonView';\n\nexport default () => {\n let c = {};\n let TraitsViewer;\n const typesDef = {\n text: TraitView,\n number: TraitNumberView,\n select: TraitSelectView,\n checkbox: TraitCheckboxView,\n color: TraitColorView,\n button: TraitButtonView\n };\n\n return {\n TraitsView,\n\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'TraitManager',\n\n /**\n * Get configuration object\n * @return {Object}\n * @private\n */\n getConfig() {\n return c;\n },\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n */\n init(config = {}) {\n c = config;\n defaults(c, defaultOpts);\n const ppfx = c.pStylePrefix;\n this.types = { ...typesDef };\n ppfx && (c.stylePrefix = `${ppfx}${c.stylePrefix}`);\n return this;\n },\n\n postRender() {\n const elTo = this.getConfig().appendTo;\n\n if (elTo) {\n const el = isElement(elTo) ? elTo : document.querySelector(elTo);\n el.appendChild(this.render());\n }\n },\n\n /**\n *\n * Get Traits viewer\n * @private\n */\n getTraitsViewer() {\n return TraitsViewer;\n },\n\n /**\n * Add new trait type\n * @param {string} name Type name\n * @param {Object} methods Object representing the trait\n */\n addType(name, trait) {\n const baseView = this.getType('text');\n this.types[name] = baseView.extend(trait);\n },\n\n /**\n * Get trait type\n * @param {string} name Type name\n * @return {Object}\n */\n getType(name) {\n return this.getTypes()[name];\n },\n\n /**\n * Get all trait types\n * @returns {Object}\n */\n getTypes() {\n return this.types;\n },\n\n render() {\n const el = TraitsViewer && TraitsViewer.el;\n TraitsViewer = new TraitsView({\n el,\n collection: [],\n editor: c.em,\n config: c\n });\n TraitsViewer.itemsView = this.getTypes();\n TraitsViewer.updatedCollection();\n return TraitsViewer.el;\n },\n\n destroy() {\n TraitsViewer && TraitsViewer.remove();\n [c, TraitsViewer].forEach(i => (i = {}));\n }\n };\n};\n","export default {\n // Specify the element to use as a container, string (query) or HTMLElement\n // With the empty value, nothing will be rendered\n appendTo: '',\n\n // Append blocks to canvas on click.\n // With the `true` value, it will try to append the block to the selected component.\n // If there is no selected component, the block will be appened to the wrapper.\n // You can also pass a function to this option, use it as a catch-all for all block\n // clicks and implement a custom logic for each block.\n // appendOnClick: (block, editor) => {\n // if (block.get('id') === 'some-id')\n // editor.getSelected().append(block.get('content'))\n // else\n // editor.getWrapper().append(block.get('content'))\n // }\n appendOnClick: false,\n\n // Default blocks\n blocks: [],\n\n // Avoid rendering the default block manager.\n custom: false\n};\n","import { Model } from 'common';\nimport { isFunction } from 'underscore';\n\n/**\n * @property {String} label Block label, eg. `My block`\n * @property {String|Object} content The content of the block. Might be an HTML string or a [Component Defintion](/modules/Components.html#component-definition)\n * @property {String} [media=''] HTML string for the media/icon of the block, eg. ` editor.getWrapper().append(block.get('content'))`\n * @property {Object} [attributes={}] Block attributes to apply in the view element\n */\nexport default class Block extends Model {\n defaults() {\n return {\n label: '',\n content: '',\n media: '',\n category: '',\n activate: false,\n select: null,\n resetId: false,\n disable: false,\n onClick: null,\n attributes: {}\n };\n }\n\n /**\n * Get block id\n * @returns {String}\n */\n getId() {\n return this.id;\n }\n\n /**\n * Get block label\n * @returns {String}\n */\n getLabel() {\n return this.get('label');\n }\n\n /**\n * Get block media\n * @returns {String}\n */\n getMedia() {\n return this.get('media');\n }\n\n /**\n * Get block content\n * @returns {Object|String|Array} Component definition | HTML string\n */\n getContent() {\n return this.get('content');\n }\n\n /**\n * Get block category label\n * @returns {String}\n */\n getCategoryLabel() {\n const ctg = this.get('category');\n return isFunction(ctg.get) ? ctg.get('label') : ctg.label ? ctg.label : ctg;\n }\n}\n","import { Collection } from 'common';\nimport Block from './Block';\n\nexport default class Blocks extends Collection {}\n\nBlocks.prototype.model = Block;\n","import { Model } from 'common';\n\nexport default class Category extends Model {\n defaults() {\n return {\n id: '',\n label: '',\n open: true,\n attributes: {}\n };\n }\n}\n","import { Collection } from 'common';\nimport Category from './Category';\n\nexport default class Categories extends Collection {}\n\nCategories.prototype.model = Category;\n","import Backbone from 'backbone';\nimport { isFunction } from 'underscore';\nimport { on, off, hasDnd } from 'utils/mixins';\n\nexport default Backbone.View.extend({\n events: {\n click: 'handleClick',\n mousedown: 'startDrag',\n dragstart: 'handleDragStart',\n drag: 'handleDrag',\n dragend: 'handleDragEnd'\n },\n\n initialize(o, config = {}) {\n const { model } = this;\n this.em = config.em;\n this.config = config;\n this.endDrag = this.endDrag.bind(this);\n this.ppfx = config.pStylePrefix || '';\n this.listenTo(model, 'destroy remove', this.remove);\n this.listenTo(model, 'change', this.render);\n },\n\n __getModule() {\n return this.em.get('BlockManager');\n },\n\n handleClick(ev) {\n const { config, model, em } = this;\n const onClick = model.get('onClick') || config.appendOnClick;\n em.trigger('block:click', model, ev);\n if (!onClick) {\n return;\n } else if (isFunction(onClick)) {\n return onClick(model, em.getEditor(), { event: ev });\n }\n const sorter = config.getSorter();\n const content = model.get('content');\n const selected = em.getSelected();\n sorter.setDropContent(content);\n let target, valid;\n\n // If there is a selected component, try first to append\n // the block inside, otherwise, try to place it as a next sibling\n if (selected) {\n valid = sorter.validTarget(selected.getEl(), content);\n\n if (valid.valid) {\n target = selected;\n } else {\n const parent = selected.parent();\n valid = sorter.validTarget(parent.getEl(), content);\n if (valid.valid) target = parent;\n }\n }\n\n // If no target found yet, try to append the block to the wrapper\n if (!target) {\n const wrapper = em.getWrapper();\n valid = sorter.validTarget(wrapper.getEl(), content);\n if (valid.valid) target = wrapper;\n }\n\n const result = target && target.append(content)[0];\n result && em.setSelected(result, { scroll: 1 });\n },\n\n /**\n * Start block dragging\n * @private\n */\n startDrag(e) {\n const { config, em, model } = this;\n const disable = model.get('disable');\n //Right or middel click\n if (e.button !== 0 || !config.getSorter || this.el.draggable || disable)\n return;\n em.refreshCanvas();\n const sorter = config.getSorter();\n sorter.setDragHelper(this.el, e);\n sorter.setDropContent(this.model.get('content'));\n sorter.startSort(this.el);\n on(document, 'mouseup', this.endDrag);\n },\n\n handleDragStart(ev) {\n this.__getModule().__startDrag(this.model, ev);\n },\n\n handleDrag(ev) {\n this.__getModule().__drag(ev);\n },\n\n handleDragEnd() {\n this.__getModule().__endDrag();\n },\n\n /**\n * Drop block\n * @private\n */\n endDrag(e) {\n off(document, 'mouseup', this.endDrag);\n const sorter = this.config.getSorter();\n\n // After dropping the block in the canvas the mouseup event is not yet\n // triggerd on 'this.doc' and so clicking outside, the sorter, tries to move\n // things (throws false positives). As this method just need to drop away\n // the block helper I use the trick of 'moved = 0' to void those errors.\n sorter.moved = 0;\n sorter.endMove();\n },\n\n render() {\n const { em, el, $el, ppfx, model } = this;\n const disable = model.get('disable');\n const attr = model.get('attributes') || {};\n const cls = attr.class || '';\n const className = `${ppfx}block`;\n const label =\n (em && em.t(`blockManager.labels.${model.id}`)) || model.get('label');\n const render = model.get('render');\n const media = model.get('media');\n const clsAdd = disable ? `${className}--disable` : `${ppfx}four-color-h`;\n $el.attr(attr);\n el.className = `${cls} ${className} ${ppfx}one-bg ${clsAdd}`.trim();\n el.innerHTML = `\n ${media ? `
${media}
` : ''}\n
${label}
\n `;\n el.title = el.textContent.trim();\n el.setAttribute('draggable', hasDnd(em) && !disable ? true : false);\n const result = render && render({ el, model, className, prefix: ppfx });\n if (result) el.innerHTML = result;\n return this;\n }\n});\n","import { View } from 'backbone';\nimport html from 'utils/html';\n\nexport default class CategoryView extends View {\n template({ pfx, label }) {\n return html`\n
\n \n ${label}\n
\n
\n `;\n }\n\n attributes() {\n return this.model.get('attributes');\n }\n\n initialize(o = {}, config = {}) {\n this.config = config;\n const pfx = config.pStylePrefix || '';\n this.em = config.em;\n this.pfx = pfx;\n this.caretR = 'fa fa-caret-right';\n this.caretD = 'fa fa-caret-down';\n this.iconClass = `${pfx}caret-icon`;\n this.activeClass = `${pfx}open`;\n this.className = `${pfx}block-category`;\n this.events = {};\n this.events[`click .${pfx}title`] = 'toggle';\n this.listenTo(this.model, 'change:open', this.updateVisibility);\n this.delegateEvents();\n this.model.view = this;\n }\n\n updateVisibility() {\n if (this.model.get('open')) this.open();\n else this.close();\n }\n\n open() {\n this.$el.addClass(this.activeClass);\n this.getIconEl().className = `${this.iconClass} ${this.caretD}`;\n this.getBlocksEl().style.display = '';\n }\n\n close() {\n this.$el.removeClass(this.activeClass);\n this.getIconEl().className = `${this.iconClass} ${this.caretR}`;\n this.getBlocksEl().style.display = 'none';\n }\n\n toggle() {\n var model = this.model;\n model.set('open', !model.get('open'));\n }\n\n getIconEl() {\n if (!this.iconEl) {\n this.iconEl = this.el.querySelector('.' + this.iconClass);\n }\n\n return this.iconEl;\n }\n\n getBlocksEl() {\n if (!this.blocksEl) {\n this.blocksEl = this.el.querySelector('.' + this.pfx + 'blocks-c');\n }\n\n return this.blocksEl;\n }\n\n append(el) {\n this.getBlocksEl().appendChild(el);\n }\n\n render() {\n const { em, el, $el, model, pfx } = this;\n const label =\n em.t(`blockManager.categories.${model.id}`) || model.get('label');\n el.innerHTML = this.template({ pfx, label });\n $el.addClass(this.className);\n $el.css({ order: model.get('order') });\n this.updateVisibility();\n\n return this;\n }\n}\n","import Backbone from 'backbone';\nimport { isString, isObject, bindAll } from 'underscore';\nimport BlockView from './BlockView';\nimport CategoryView from './CategoryView';\n\nexport default Backbone.View.extend({\n initialize(opts, config) {\n bindAll(this, 'getSorter', 'onDrag', 'onDrop', 'onMove');\n this.config = config || {};\n this.categories = opts.categories || '';\n this.renderedCategories = [];\n var ppfx = this.config.pStylePrefix || '';\n this.ppfx = ppfx;\n this.noCatClass = `${ppfx}blocks-no-cat`;\n this.blockContClass = `${ppfx}blocks-c`;\n this.catsClass = `${ppfx}block-categories`;\n const coll = this.collection;\n this.listenTo(coll, 'add', this.addTo);\n this.listenTo(coll, 'reset', this.render);\n this.em = this.config.em;\n this.tac = 'test-tac';\n this.grabbingCls = this.ppfx + 'grabbing';\n\n if (this.em) {\n this.config.getSorter = this.getSorter;\n this.canvas = this.em.get('Canvas');\n }\n },\n\n updateConfig(opts = {}) {\n this.config = {\n ...this.config,\n ...opts\n };\n },\n\n /**\n * Get sorter\n * @private\n */\n getSorter() {\n if (!this.em) return;\n if (!this.sorter) {\n var utils = this.em.get('Utils');\n var canvas = this.canvas;\n this.sorter = new utils.Sorter({\n container: canvas.getBody(),\n placer: canvas.getPlacerEl(),\n containerSel: '*',\n itemSel: '*',\n pfx: this.ppfx,\n onStart: this.onDrag,\n onEndMove: this.onDrop,\n onMove: this.onMove,\n document: canvas.getFrameEl().contentDocument,\n direction: 'a',\n wmargin: 1,\n nested: 1,\n em: this.em,\n canvasRelative: 1\n });\n }\n return this.sorter;\n },\n\n /**\n * Callback when block is on drag\n * @private\n */\n onDrag(e) {\n this.em.stopDefault();\n this.em.trigger('block:drag:start', e);\n },\n\n onMove(e) {\n this.em.trigger('block:drag:move', e);\n },\n\n /**\n * Callback when block is dropped\n * @private\n */\n onDrop(model) {\n const { em } = this;\n em.runDefault();\n\n if (model && model.get) {\n const oldActive = 'activeOnRender';\n\n if (model.get(oldActive)) {\n model.trigger('active');\n model.unset(oldActive);\n }\n\n em.trigger('block:drag:stop', model);\n }\n },\n\n /**\n * Add new model to the collection\n * @param {Model} model\n * @private\n * */\n addTo(model) {\n this.add(model);\n },\n\n /**\n * Render new model inside the view\n * @param {Model} model\n * @param {Object} fragment Fragment collection\n * @private\n * */\n add(model, fragment) {\n const { config } = this;\n var frag = fragment || null;\n var view = new BlockView(\n {\n model,\n attributes: model.get('attributes')\n },\n config\n );\n var rendered = view.render().el;\n var category = model.get('category');\n\n // Check for categories\n if (category && this.categories && !config.ignoreCategories) {\n if (isString(category)) {\n category = {\n id: category,\n label: category\n };\n } else if (isObject(category) && !category.id) {\n category.id = category.label;\n }\n\n var catModel = this.categories.add(category);\n var catId = catModel.get('id');\n var catView = this.renderedCategories[catId];\n var categories = this.getCategoriesEl();\n model.set('category', catModel, { silent: true });\n\n if (!catView && categories) {\n catView = new CategoryView(\n {\n model: catModel\n },\n this.config\n ).render();\n this.renderedCategories[catId] = catView;\n categories.appendChild(catView.el);\n }\n\n catView && catView.append(rendered);\n return;\n }\n\n if (frag) frag.appendChild(rendered);\n else this.append(rendered);\n },\n\n getCategoriesEl() {\n if (!this.catsEl) {\n this.catsEl = this.el.querySelector(`.${this.catsClass}`);\n }\n\n return this.catsEl;\n },\n\n getBlocksEl() {\n if (!this.blocksEl) {\n this.blocksEl = this.el.querySelector(\n `.${this.noCatClass} .${this.blockContClass}`\n );\n }\n\n return this.blocksEl;\n },\n\n append(el) {\n let blocks = this.getBlocksEl();\n blocks && blocks.appendChild(el);\n },\n\n render() {\n const ppfx = this.ppfx;\n const frag = document.createDocumentFragment();\n this.catsEl = null;\n this.blocksEl = null;\n this.renderedCategories = [];\n this.el.innerHTML = `\n
\n
\n
\n
\n `;\n\n this.collection.each(model => this.add(model, frag));\n this.append(frag);\n const cls = `${this.blockContClass}s ${ppfx}one-bg ${ppfx}two-color`;\n this.$el.addClass(cls);\n this.rendered = true;\n return this;\n }\n});\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/block_manager/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * blockManager: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance.\n *\n * ```js\n * // Listen to events\n * editor.on('block:add', (block) => { ... });\n *\n * // Use the API\n * const blockManager = editor.BlockManager;\n * blockManager.add(...);\n * ```\n *\n * ## Available Events\n * * `block:add` - Block added. The [Block] is passed as an argument to the callback.\n * * `block:remove` - Block removed. The [Block] is passed as an argument to the callback.\n * * `block:update` - Block updated. The [Block] and the object containing changes are passed as arguments to the callback.\n * * `block:drag:start` - Started dragging block, the [Block] is passed as an argument.\n * * `block:drag` - Dragging block, the [Block] is passed as an argument.\n * * `block:drag:stop` - Dragging of the block is stopped. The dropped [Component] (if dropped successfully) and the [Block] are passed as arguments.\n * * `block` - Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback.\n *\n * ## Methods\n * * [add](#add)\n * * [get](#get)\n * * [getAll](#getall)\n * * [getAllVisible](#getallvisible)\n * * [remove](#remove)\n * * [getConfig](#getconfig)\n * * [getCategories](#getcategories)\n * * [getContainer](#getcontainer)\n * * [render](#render)\n *\n * [Block]: block.html\n * [Component]: component.html\n *\n * @module BlockManager\n */\nimport { isElement, isArray } from 'underscore';\nimport Module from 'common/module';\nimport defaults from './config/config';\nimport Block from './model/Block';\nimport Blocks from './model/Blocks';\nimport Category from './model/Category';\nimport Categories from './model/Categories';\nimport BlocksView from './view/BlocksView';\n\nexport const evAll = 'block';\nexport const evPfx = `${evAll}:`;\nexport const evAdd = `${evPfx}add`;\nexport const evUpdate = `${evPfx}update`;\nexport const evRemove = `${evPfx}remove`;\nexport const evRemoveBefore = `${evRemove}:before`;\nexport const evDrag = `${evPfx}drag`;\nexport const evDragStart = `${evDrag}:start`;\nexport const evDragStop = `${evDrag}:stop`;\nexport const evCustom = `${evPfx}custom`;\n\nexport default () => {\n var c = {};\n var blocks, blocksVisible, blocksView;\n var categories = [];\n\n return {\n ...Module,\n\n name: 'BlockManager',\n\n Block,\n\n Blocks,\n\n Category,\n\n Categories,\n\n events: {\n all: evAll,\n update: evUpdate,\n add: evAdd,\n remove: evRemove,\n removeBefore: evRemoveBefore,\n drag: evDrag,\n dragStart: evDragStart,\n dragEnd: evDragStop,\n custom: evCustom\n },\n\n init(config = {}) {\n c = { ...defaults, ...config };\n const { em } = c;\n this.em = em;\n\n // Global blocks collection\n blocks = new Blocks(c.blocks);\n blocksVisible = new Blocks(blocks.models);\n categories = new Categories();\n this.all = blocks;\n this.__initListen();\n\n // Setup the sync between the global and public collections\n blocks.on('add', model => blocksVisible.add(model));\n blocks.on('remove', model => blocksVisible.remove(model));\n blocks.on('reset', coll => blocksVisible.reset(coll.models));\n\n return this;\n },\n\n __trgCustom() {\n this.em.trigger(this.events.custom, this.__customData());\n },\n\n __customData() {\n const bhv = this.__getBehaviour();\n return {\n bm: this,\n blocks: this.getAll().models,\n container: bhv.container,\n dragStart: (block, ev) => this.startDrag(block, ev),\n drag: ev => this.__drag(ev),\n dragStop: cancel => this.endDrag(cancel)\n };\n },\n\n __startDrag(block, ev) {\n const { em, events } = this;\n const content = block.getContent ? block.getContent() : block;\n this._dragBlock = block;\n em.set({ dragResult: null, dragContent: content });\n [em, blocks].map(i => i.trigger(events.dragStart, block, ev));\n },\n\n __drag(ev) {\n const { em, events } = this;\n const block = this._dragBlock;\n [em, blocks].map(i => i.trigger(events.drag, block, ev));\n },\n\n __endDrag() {\n const { em, events } = this;\n const block = this._dragBlock;\n const cmp = em.get('dragResult');\n this._dragBlock = null;\n\n if (cmp) {\n const oldKey = 'activeOnRender';\n const oldActive = cmp.get && cmp.get(oldKey);\n const toActive = block.get('activate') || oldActive;\n const toSelect = block.get('select');\n const first = isArray(cmp) ? cmp[0] : cmp;\n\n if (toSelect || (toActive && toSelect !== false)) {\n em.setSelected(first);\n }\n\n if (toActive) {\n first.trigger('active');\n oldActive && first.unset(oldKey);\n }\n\n if (block.get('resetId')) {\n first.onAll(block => block.resetId());\n }\n }\n\n em.set({ dragResult: null, dragContent: null });\n [em, blocks].map(i => i.trigger(events.dragEnd, cmp, block));\n },\n\n __getFrameViews() {\n return this.em\n .get('Canvas')\n .getFrames()\n .map(frame => frame.view);\n },\n\n __behaviour(opts = {}) {\n return (this._bhv = {\n ...(this._bhv || {}),\n ...opts\n });\n },\n\n __getBehaviour() {\n return this._bhv || {};\n },\n\n startDrag(block, ev) {\n this.__startDrag(block, ev);\n this.__getFrameViews().forEach(fv => fv.droppable.startCustom());\n },\n\n endDrag(cancel) {\n this.__getFrameViews().forEach(fv => fv.droppable.endCustom(cancel));\n this.__endDrag();\n },\n\n /**\n * Get configuration object\n * @return {Object}\n */\n getConfig() {\n return c;\n },\n\n postRender() {\n const collection = blocksVisible;\n blocksView = new BlocksView({ collection, categories }, c);\n const elTo = this.getConfig().appendTo;\n\n if (elTo) {\n const el = isElement(elTo) ? elTo : document.querySelector(elTo);\n if (!el) return this.__logWarn('\"appendTo\" element not found');\n el.appendChild(this.render(blocksVisible.models));\n }\n\n this.__trgCustom();\n },\n\n /**\n * Add new block.\n * @param {String} id Block ID\n * @param {[Block]} props Block properties\n * @returns {[Block]} Added block\n * @example\n * blockManager.add('h1-block', {\n * label: 'Heading',\n * content: '

Put your title here

',\n * category: 'Basic',\n * attributes: {\n * title: 'Insert h1 block'\n * }\n * });\n */\n add(id, props, opts = {}) {\n const prp = props || {};\n prp.id = id;\n return blocks.add(prp, opts);\n },\n\n /**\n * Get the block by id.\n * @param {String} id Block id\n * @returns {[Block]}\n * @example\n * const block = blockManager.get('h1-block');\n * console.log(JSON.stringify(block));\n * // {label: 'Heading', content: '

Put your ...', ...}\n */\n get(id) {\n return blocks.get(id);\n },\n\n /**\n * Return all blocks.\n * @returns {Collection<[Block]>}\n * @example\n * const blocks = blockManager.getAll();\n * console.log(JSON.stringify(blocks));\n * // [{label: 'Heading', content: '

Put your ...'}, ...]\n */\n getAll() {\n return blocks;\n },\n\n /**\n * Return the visible collection, which containes blocks actually rendered\n * @returns {Collection<[Block]>}\n */\n getAllVisible() {\n return blocksVisible;\n },\n\n /**\n * Remove block.\n * @param {String|[Block]} block Block or block ID\n * @returns {[Block]} Removed block\n * @example\n * const removed = blockManager.remove('BLOCK_ID');\n * // or by passing the Block\n * const block = blockManager.get('BLOCK_ID');\n * blockManager.remove(block);\n */\n remove(block, opts = {}) {\n return this.__remove(block, opts);\n },\n\n /**\n * Get all available categories.\n * It's possible to add categories only within blocks via 'add()' method\n * @return {Array|Collection}\n */\n getCategories() {\n return categories;\n },\n\n /**\n * Return the Blocks container element\n * @return {HTMLElement}\n */\n getContainer() {\n return blocksView.el;\n },\n\n /**\n * Render blocks\n * @param {Array} blocks Blocks to render, without the argument will render all global blocks\n * @param {Object} [opts={}] Options\n * @param {Boolean} [opts.external] Render blocks in a new container (HTMLElement will be returned)\n * @param {Boolean} [opts.ignoreCategories] Render blocks without categories\n * @return {HTMLElement} Rendered element\n * @example\n * // Render all blocks (inside the global collection)\n * blockManager.render();\n *\n * // Render new set of blocks\n * const blocks = blockManager.getAll();\n * const filtered = blocks.filter(block => block.get('category') == 'sections')\n *\n * blockManager.render(filtered);\n * // Or a new set from an array\n * blockManager.render([\n * {label: 'Label text', content: '
Content
'}\n * ]);\n *\n * // Back to blocks from the global collection\n * blockManager.render();\n *\n * // You can also render your blocks outside of the main block container\n * const newBlocksEl = blockManager.render(filtered, { external: true });\n * document.getElementById('some-id').appendChild(newBlocksEl);\n */\n render(blocks, opts = {}) {\n const toRender = blocks || this.getAll().models;\n\n if (opts.external) {\n const collection = new Blocks(toRender);\n return new BlocksView(\n { collection, categories },\n { ...c, ...opts }\n ).render().el;\n }\n\n if (blocksView) {\n blocksView.updateConfig(opts);\n blocksView.collection.reset(toRender);\n\n if (!blocksView.rendered) {\n blocksView.render();\n blocksView.rendered = 1;\n }\n }\n\n return this.getContainer();\n },\n\n destroy() {\n const colls = [blocks, blocksVisible, categories];\n colls.map(c => c.stopListening());\n colls.map(c => c.reset());\n blocksView && blocksView.remove();\n c = {};\n }\n };\n};\n","const swv = 'sw-visibility';\nconst expt = 'export-template';\nconst osm = 'open-sm';\nconst otm = 'open-tm';\nconst ola = 'open-layers';\nconst obl = 'open-blocks';\nconst ful = 'fullscreen';\nconst prv = 'preview';\n\nexport default {\n stylePrefix: 'pn-',\n\n // Default panels fa-sliders for features\n defaults: [\n {\n id: 'commands',\n buttons: [{}]\n },\n {\n id: 'options',\n buttons: [\n {\n active: true,\n id: swv,\n className: 'fa fa-square-o',\n command: swv,\n context: swv,\n attributes: { title: 'View components' }\n },\n {\n id: prv,\n className: 'fa fa-eye',\n command: prv,\n context: prv,\n attributes: { title: 'Preview' }\n },\n {\n id: ful,\n className: 'fa fa-arrows-alt',\n command: ful,\n context: ful,\n attributes: { title: 'Fullscreen' }\n },\n {\n id: expt,\n className: 'fa fa-code',\n command: expt,\n attributes: { title: 'View code' }\n }\n ]\n },\n {\n id: 'views',\n buttons: [\n {\n id: osm,\n className: 'fa fa-paint-brush',\n command: osm,\n active: true,\n togglable: 0,\n attributes: { title: 'Open Style Manager' }\n },\n {\n id: otm,\n className: 'fa fa-cog',\n command: otm,\n togglable: 0,\n attributes: { title: 'Settings' }\n },\n {\n id: ola,\n className: 'fa fa-bars',\n command: ola,\n togglable: 0,\n attributes: { title: 'Open Layer Manager' }\n },\n {\n id: obl,\n className: 'fa fa-th-large',\n command: obl,\n togglable: 0,\n attributes: { title: 'Open Blocks' }\n }\n ]\n }\n ],\n\n // Editor model\n em: null,\n\n // Delay before show children buttons (in milliseconds)\n delayBtnsShow: 300\n};\n","import Backbone from 'backbone';\nimport Buttons from './Buttons';\n\nexport default Backbone.Model.extend({\n defaults: {\n id: '',\n content: '',\n visible: true,\n buttons: [],\n attributes: {}\n },\n\n initialize(options) {\n this.btn = this.get('buttons') || [];\n this.buttons = new Buttons(this.btn);\n this.set('buttons', this.buttons);\n }\n});\n","import Backbone from 'backbone';\nimport Panel from './Panel';\n\nexport default Backbone.Collection.extend({\n model: Panel\n});\n","import Backbone from 'backbone';\nimport { isString, isObject, isFunction } from 'underscore';\n\nconst $ = Backbone.$;\n\nexport default Backbone.View.extend({\n tagName() {\n return this.model.get('tagName');\n },\n\n events: {\n click: 'clicked'\n },\n\n initialize(o) {\n const { model } = this;\n const cls = model.get('className');\n const { command, listen } = model.attributes;\n const config = o.config || {};\n const { em } = config;\n this.config = config;\n this.em = em;\n const pfx = this.config.stylePrefix || '';\n const ppfx = this.config.pStylePrefix || '';\n this.pfx = pfx;\n this.ppfx = this.config.pStylePrefix || '';\n this.id = pfx + model.get('id');\n this.activeCls = `${pfx}active ${ppfx}four-color`;\n this.disableCls = `${ppfx}disabled`;\n this.btnsVisCls = `${pfx}visible`;\n this.className = pfx + 'btn' + (cls ? ' ' + cls : '');\n this.listenTo(model, 'change', this.render);\n this.listenTo(model, 'change:active updateActive', this.updateActive);\n this.listenTo(model, 'checkActive', this.checkActive);\n this.listenTo(model, 'change:bntsVis', this.updateBtnsVis);\n this.listenTo(model, 'change:attributes', this.updateAttributes);\n this.listenTo(model, 'change:className', this.updateClassName);\n this.listenTo(model, 'change:disable', this.updateDisable);\n\n if (em && isString(command) && listen) {\n const chnOpt = { fromListen: 1 };\n this.listenTo(em, `run:${command}`, () =>\n model.set('active', true, chnOpt)\n );\n this.listenTo(em, `stop:${command}`, () =>\n model.set('active', false, chnOpt)\n );\n }\n\n if (em && em.get) this.commands = em.get('Commands');\n },\n\n /**\n * Updates class name of the button\n *\n * @return void\n * */\n updateClassName() {\n const { model, pfx } = this;\n const cls = model.get('className');\n const attrCls = model.get('attributes').class;\n const classStr = `${attrCls ? attrCls : ''} ${pfx}btn ${cls ? cls : ''}`;\n this.$el.attr('class', classStr.trim());\n },\n\n /**\n * Updates attributes of the button\n *\n * @return void\n * */\n updateAttributes() {\n const { em, model, $el } = this;\n const attr = model.get('attributes') || {};\n const title = em && em.t && em.t(`panels.buttons.titles.${model.id}`);\n $el.attr(attr);\n title && $el.attr({ title });\n\n this.updateClassName();\n },\n\n /**\n * Updates visibility of children buttons\n *\n * @return void\n * */\n updateBtnsVis() {\n if (!this.$buttons) return;\n\n if (this.model.get('bntsVis')) this.$buttons.addClass(this.btnsVisCls);\n else this.$buttons.removeClass(this.btnsVisCls);\n },\n\n /**\n * Update active status of the button\n *\n * @return void\n * */\n updateActive(m, v, opts = {}) {\n const { model, commands, $el, activeCls } = this;\n const { fromCollection, fromListen } = opts;\n const context = model.get('context');\n const options = model.get('options');\n const commandName = model.get('command');\n let command = {};\n\n if (!commandName) return;\n\n if (commands && isString(commandName)) {\n command = commands.get(commandName) || {};\n } else if (isFunction(commandName)) {\n command = commands.create({ run: commandName });\n } else if (commandName !== null && isObject(commandName)) {\n command = commands.create(commandName);\n }\n\n if (model.get('active')) {\n !fromCollection && model.collection.deactivateAll(context, model);\n model.set('active', true, { silent: true }).trigger('checkActive');\n !fromListen &&\n commands.runCommand(command, { ...options, sender: model });\n\n // Disable button if the command has no stop method\n command.noStop && model.set('active', false);\n } else {\n $el.removeClass(activeCls);\n !fromListen &&\n commands.stopCommand(command, { ...options, sender: model, force: 1 });\n }\n },\n\n updateDisable() {\n const { disableCls, model } = this;\n const disable = model.get('disable');\n this.$el[disable ? 'addClass' : 'removeClass'](disableCls);\n },\n\n /**\n * Update active style status\n *\n * @return void\n * */\n checkActive() {\n const { model, $el, activeCls } = this;\n model.get('active') ? $el.addClass(activeCls) : $el.removeClass(activeCls);\n },\n\n /**\n * Triggered when button is clicked\n * @param {Object} e Event\n *\n * @return void\n * */\n clicked(e) {\n const { model } = this;\n\n if (model.get('bntsVis') || model.get('disable') || !model.get('command'))\n return;\n\n this.toggleActive();\n },\n\n toggleActive() {\n const { model, em } = this;\n const { active, togglable } = model.attributes;\n\n if (active && !togglable) return;\n\n model.set('active', !active);\n\n // If the stop is requested\n if (active) {\n if (model.get('runDefaultCommand')) em.runDefault();\n } else {\n if (model.get('stopDefaultCommand')) em.stopDefault();\n }\n },\n\n render() {\n const { model } = this;\n const label = model.get('label');\n const { $el } = this;\n !model.get('el') && $el.empty();\n this.updateAttributes();\n label && $el.append(label);\n this.checkActive();\n this.updateDisable();\n\n return this;\n }\n});\n","import Backbone from 'backbone';\nimport ButtonView from './ButtonView';\nimport { result } from 'underscore';\n\nexport default Backbone.View.extend({\n initialize(o) {\n this.opt = o || {};\n this.config = this.opt.config || {};\n this.pfx = this.config.stylePrefix || '';\n this.parentM = this.opt.parentM || null;\n this.listenTo(this.collection, 'add', this.addTo);\n this.listenTo(this.collection, 'reset remove', this.render);\n this.className = this.pfx + 'buttons';\n },\n\n /**\n * Add to collection\n * @param Object Model\n *\n * @return Object\n * */\n addTo(model) {\n this.addToCollection(model);\n },\n\n /**\n * Add new object to collection\n * @param Object Model\n * @param Object Fragment collection\n *\n * @return Object Object created\n * */\n addToCollection(model, fragmentEl) {\n const fragment = fragmentEl || null;\n const viewObject = ButtonView;\n const el = model.get('el');\n const view = new viewObject({\n el,\n model,\n config: this.config,\n parentM: this.parentM\n });\n const rendered = view.render().el;\n\n if (fragment) {\n fragment.appendChild(rendered);\n } else {\n this.$el.append(rendered);\n }\n\n return rendered;\n },\n\n render() {\n var fragment = document.createDocumentFragment();\n this.$el.empty();\n\n this.collection.each(function(model) {\n this.addToCollection(model, fragment);\n }, this);\n\n this.$el.append(fragment);\n this.$el.attr('class', result(this, 'className'));\n return this;\n }\n});\n","import Backbone from 'backbone';\nimport ButtonsView from './ButtonsView';\n\nexport default Backbone.View.extend({\n initialize(o) {\n const config = o.config || {};\n const model = this.model;\n this.config = config;\n this.pfx = config.stylePrefix || '';\n this.ppfx = config.pStylePrefix || '';\n this.buttons = model.get('buttons');\n this.className = this.pfx + 'panel';\n this.id = this.pfx + model.get('id');\n this.listenTo(model, 'change:appendContent', this.appendContent);\n this.listenTo(model, 'change:content', this.updateContent);\n this.listenTo(model, 'change:visible', this.toggleVisible);\n model.view = this;\n },\n\n /**\n * Append content of the panel\n * */\n appendContent() {\n this.$el.append(this.model.get('appendContent'));\n },\n\n /**\n * Update content\n * */\n updateContent() {\n this.$el.html(this.model.get('content'));\n },\n\n toggleVisible() {\n if (!this.model.get('visible')) {\n this.$el.addClass(`${this.ppfx}hidden`);\n return;\n }\n this.$el.removeClass(`${this.ppfx}hidden`);\n },\n\n attributes() {\n return this.model.get('attributes');\n },\n\n initResize() {\n const em = this.config.em;\n const editor = em ? em.get('Editor') : '';\n const resizable = this.model.get('resizable');\n\n if (editor && resizable) {\n var resz = resizable === true ? [1, 1, 1, 1] : resizable;\n var resLen = resz.length;\n var tc,\n cr,\n bc,\n cl = 0;\n\n // Choose which sides of the panel are resizable\n if (resLen == 2) {\n tc = resz[0];\n bc = resz[0];\n cr = resz[1];\n cl = resz[1];\n } else if (resLen == 4) {\n tc = resz[0];\n cr = resz[1];\n bc = resz[2];\n cl = resz[3];\n }\n\n var resizer = editor.Utils.Resizer.init({\n tc,\n cr,\n bc,\n cl,\n tl: 0,\n tr: 0,\n bl: 0,\n br: 0,\n appendTo: this.el,\n silentFrames: 1,\n avoidContainerUpdate: 1,\n prefix: editor.getConfig().stylePrefix,\n onEnd() {\n em && em.trigger('change:canvasOffset');\n },\n posFetcher: (el, { target }) => {\n const style = el.style;\n const config = resizer.getConfig();\n const keyWidth = config.keyWidth;\n const keyHeight = config.keyHeight;\n const rect = el.getBoundingClientRect();\n const forContainer = target == 'container';\n const styleWidth = style[keyWidth];\n const styleHeight = style[keyHeight];\n const width =\n styleWidth && !forContainer ? parseFloat(styleWidth) : rect.width;\n const height =\n styleHeight && !forContainer\n ? parseFloat(styleHeight)\n : rect.height;\n return {\n left: 0,\n top: 0,\n width,\n height\n };\n },\n ...resizable\n });\n resizer.blur = () => {};\n resizer.focus(this.el);\n }\n },\n\n render() {\n const $el = this.$el;\n const ppfx = this.ppfx;\n const cls = `${this.className} ${this.id} ${ppfx}one-bg ${ppfx}two-color`;\n $el.addClass(cls);\n\n this.toggleVisible();\n\n if (this.buttons.length) {\n var buttons = new ButtonsView({\n collection: this.buttons,\n config: this.config\n });\n $el.append(buttons.render().el);\n }\n\n $el.append(this.model.get('content'));\n return this;\n }\n});\n","import Backbone from 'backbone';\nimport PanelView from './PanelView';\n\nexport default Backbone.View.extend({\n initialize(o) {\n this.opt = o || {};\n this.config = this.opt.config || {};\n this.pfx = this.config.stylePrefix || '';\n const items = this.collection;\n this.listenTo(items, 'add', this.addTo);\n this.listenTo(items, 'reset', this.render);\n this.listenTo(items, 'remove', this.onRemove);\n this.className = this.pfx + 'panels';\n },\n\n onRemove(model) {\n const view = model.view;\n view && view.remove();\n },\n\n /**\n * Add to collection\n * @param Object Model\n *\n * @return Object\n * @private\n * */\n addTo(model) {\n this.addToCollection(model);\n },\n\n /**\n * Add new object to collection\n * @param Object Model\n * @param Object Fragment collection\n * @param integer Index of append\n *\n * @return Object Object created\n * @private\n * */\n addToCollection(model, fragmentEl) {\n const fragment = fragmentEl || null;\n const config = this.config;\n const el = model.get('el');\n const view = new PanelView({\n el,\n model,\n config\n });\n const rendered = view.render().el;\n const appendTo = model.get('appendTo');\n\n // Do nothing if the panel was requested to be another element\n if (el) {\n } else if (appendTo) {\n var appendEl = document.querySelector(appendTo);\n appendEl.appendChild(rendered);\n } else {\n if (fragment) {\n fragment.appendChild(rendered);\n } else {\n this.$el.append(rendered);\n }\n }\n\n view.initResize();\n return rendered;\n },\n\n render() {\n const $el = this.$el;\n const frag = document.createDocumentFragment();\n $el.empty();\n this.collection.each(model => this.addToCollection(model, frag));\n $el.append(frag);\n $el.attr('class', this.className);\n return this;\n }\n});\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/panels/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * panels: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const panelManager = editor.Panels;\n * ```\n *\n * * [addPanel](#addpanel)\n * * [addButton](#addbutton)\n * * [getButton](#getbutton)\n * * [getPanel](#getpanel)\n * * [getPanels](#getpanels)\n * * [getPanelsEl](#getpanelsel)\n * * [removePanel](#removepanel)\n * * [removeButton](#removebutton)\n *\n * @module Panels\n */\nimport defaults from './config/config';\nimport Panel from './model/Panel';\nimport Panels from './model/Panels';\nimport PanelsView from './view/PanelsView';\n\nexport default () => {\n var c = {};\n var panels, PanelsViewObj;\n\n return {\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'Panels',\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @private\n */\n init(config) {\n c = config || {};\n for (var name in defaults) {\n if (!(name in c)) c[name] = defaults[name];\n }\n\n var ppfx = c.pStylePrefix;\n if (ppfx) c.stylePrefix = ppfx + c.stylePrefix;\n\n panels = new Panels(c.defaults);\n return this;\n },\n\n /**\n * Returns the collection of panels\n * @return {Collection} Collection of panel\n */\n getPanels() {\n return panels;\n },\n\n /**\n * Returns panels element\n * @return {HTMLElement}\n */\n getPanelsEl() {\n return PanelsViewObj && PanelsViewObj.el;\n },\n\n /**\n * Add new panel to the collection\n * @param {Object|Panel} panel Object with right properties or an instance of Panel\n * @return {Panel} Added panel. Useful in case passed argument was an Object\n * @example\n * var newPanel = panelManager.addPanel({\n * id: 'myNewPanel',\n * visible : true,\n * buttons : [...],\n * });\n */\n addPanel(panel) {\n return panels.add(panel);\n },\n\n /**\n * Remove a panel from the collection\n * @param {Object|Panel|String} panel Object with right properties or an instance of Panel or Painel id\n * @return {Panel} Removed panel. Useful in case passed argument was an Object\n * @example\n * const newPanel = panelManager.removePanel({\n * id: 'myNewPanel',\n * visible : true,\n * buttons : [...],\n * });\n *\n * const newPanel = panelManager.removePanel('myNewPanel');\n *\n */\n removePanel(panel) {\n return panels.remove(panel);\n },\n\n /**\n * Get panel by ID\n * @param {string} id Id string\n * @return {Panel|null}\n * @example\n * var myPanel = panelManager.getPanel('myNewPanel');\n */\n getPanel(id) {\n var res = panels.where({ id });\n return res.length ? res[0] : null;\n },\n\n /**\n * Add button to the panel\n * @param {string} panelId Panel's ID\n * @param {Object|Button} button Button object or instance of Button\n * @return {Button|null} Added button. Useful in case passed button was an Object\n * @example\n * var newButton = panelManager.addButton('myNewPanel',{\n * id: 'myNewButton',\n * className: 'someClass',\n * command: 'someCommand',\n * attributes: { title: 'Some title'},\n * active: false,\n * });\n * // It's also possible to pass the command as an object\n * // with .run and .stop methods\n * ...\n * command: {\n * run: function(editor) {\n * ...\n * },\n * stop: function(editor) {\n * ...\n * }\n * },\n * // Or simply like a function which will be evaluated as a single .run command\n * ...\n * command: function(editor) {\n * ...\n * }\n */\n addButton(panelId, button) {\n var pn = this.getPanel(panelId);\n return pn ? pn.get('buttons').add(button) : null;\n },\n\n /**\n * Remove button from the panel\n * @param {String} panelId Panel's ID\n * @param {String} buttonId Button's ID\n * @return {Button|null} Removed button.\n * @example\n * const removedButton = panelManager.addButton('myNewPanel',{\n * id: 'myNewButton',\n * className: 'someClass',\n * command: 'someCommand',\n * attributes: { title: 'Some title'},\n * active: false,\n * });\n *\n * const removedButton = panelManager.removeButton('myNewPanel', 'myNewButton');\n *\n */\n removeButton(panelId, button) {\n var pn = this.getPanel(panelId);\n return pn && pn.get('buttons').remove(button);\n },\n\n /**\n * Get button from the panel\n * @param {string} panelId Panel's ID\n * @param {string} id Button's ID\n * @return {Button|null}\n * @example\n * var button = panelManager.getButton('myPanel','myButton');\n */\n getButton(panelId, id) {\n var pn = this.getPanel(panelId);\n if (pn) {\n var res = pn.get('buttons').where({ id });\n return res.length ? res[0] : null;\n }\n return null;\n },\n\n /**\n * Render panels and buttons\n * @return {HTMLElement}\n * @private\n */\n render() {\n PanelsViewObj && PanelsViewObj.remove();\n PanelsViewObj = new PanelsView({\n collection: panels,\n config: c\n });\n return PanelsViewObj.render().el;\n },\n\n /**\n * Active activable buttons\n * @private\n */\n active() {\n this.getPanels().each(p => {\n p.get('buttons').each(btn => {\n btn.get('active') && btn.trigger('updateActive');\n });\n });\n },\n\n /**\n * Disable buttons flagged as disabled\n * @private\n */\n disableButtons() {\n this.getPanels().each(p => {\n p.get('buttons').each(btn => {\n if (btn.get('disable')) btn.trigger('change:disable');\n });\n });\n },\n\n destroy() {\n panels.reset();\n panels.stopListening();\n PanelsViewObj && PanelsViewObj.remove();\n [c, panels, PanelsViewObj].forEach(i => (i = {}));\n },\n\n Panel\n };\n};\n","export default {\n stylePrefix: 'cv-',\n\n /*\n * Append external scripts to the `` of the iframe.\n * Be aware that these scripts will not be printed in the export code\n * @example\n * scripts: [ 'https://...1.js', 'https://...2.js' ]\n * * // or passing objects as attributes\n * scripts: [ { src: '/file.js', someattr: 'value' }, ... ]\n */\n scripts: [],\n\n /*\n * Append external styles to the `` of the iframe\n * Be aware that these styles will not be printed in the export code\n * @example\n * styles: [ 'https://...1.css', 'https://...2.css' ]\n * // or passing objects as attributes\n * styles: [ { href: '/style.css', someattr: 'value' }, ... ]\n */\n styles: [],\n\n /**\n * Add custom badge naming strategy\n * @example\n * customBadgeLabel: function(component) {\n * return component.getName();\n * }\n */\n customBadgeLabel: '',\n\n /**\n * Indicate when to start the auto scroll of the canvas on component/block dragging (value in px )\n */\n autoscrollLimit: 50,\n\n // Experimental: external highlighter box\n extHl: 0,\n\n /**\n * When some textable component is selected and focused (eg. input or text component) the editor\n * stops some commands (eg. disables the copy/paste of components with CTRL+C/V to allow the copy/paste of the text).\n * This option allows to customize, by a selector, which element should not be considered textable\n */\n notTextable: ['button', 'a', 'input[type=checkbox]', 'input[type=radio]']\n};\n","import { Model } from 'common';\nimport { evPageSelect } from 'pages';\n\nexport default class Canvas extends Model {\n defaults() {\n return {\n frame: '',\n frames: '',\n rulers: false,\n zoom: 100,\n x: 0,\n y: 0,\n // Scripts to apply on all frames\n scripts: [],\n // Styles to apply on all frames\n styles: []\n };\n }\n\n initialize(props, config = {}) {\n const { em } = config;\n this.config = config;\n this.em = em;\n this.listenTo(this, 'change:zoom', this.onZoomChange);\n this.listenTo(em, 'change:device', this.updateDevice);\n this.listenTo(em, evPageSelect, this._pageUpdated);\n }\n\n init() {\n const { em } = this;\n const mainPage = em.get('PageManager').getMain();\n const frame = mainPage.getMainFrame();\n this.set('frames', mainPage.getFrames());\n this.updateDevice({ frame });\n }\n\n _pageUpdated(page, prev) {\n const { em } = this;\n em.setSelected();\n em.get('readyCanvas') && em.stopDefault(); // We have to stop before changing current frames\n prev && prev.getFrames().map(frame => frame.disable());\n this.set('frames', page.getFrames());\n }\n\n updateDevice(opts = {}) {\n const { em } = this;\n const device = em.getDeviceModel();\n const model = opts.frame || em.getCurrentFrameModel();\n\n if (model && device) {\n const { width, height } = device.attributes;\n model.set({ width, height }, { noUndo: 1 });\n }\n }\n\n onZoomChange() {\n const zoom = this.get('zoom');\n zoom < 1 && this.set('zoom', 1);\n }\n}\n","/*\n This class makes the canvas droppable\n */\n\nimport { on, off } from 'utils/mixins';\nimport { bindAll, indexOf } from 'underscore';\n\nexport default class Droppable {\n constructor(em, rootEl) {\n this.em = em;\n const el =\n rootEl ||\n em\n .get('Canvas')\n .getFrames()\n .map(frame => frame.getComponent().getEl());\n const els = Array.isArray(el) ? el : [el];\n this.el = el;\n this.counter = 0;\n bindAll(\n this,\n 'handleDragEnter',\n 'handleDragOver',\n 'handleDrop',\n 'handleDragLeave'\n );\n els.forEach(el => this.toggleEffects(el, 1));\n\n return this;\n }\n\n toggleEffects(el, enable) {\n const methods = { on, off };\n const method = enable ? 'on' : 'off';\n methods[method](el, 'dragenter', this.handleDragEnter);\n methods[method](el, 'dragover', this.handleDragOver);\n methods[method](el, 'drop', this.handleDrop);\n methods[method](el, 'dragleave', this.handleDragLeave);\n }\n\n __customTglEff(enable) {\n const method = enable ? on : off;\n const doc = this.el.ownerDocument;\n const frameEl = doc.defaultView.frameElement;\n this.sortOpts = enable\n ? {\n onStart({ sorter }) {\n on(frameEl, 'pointermove', sorter.onMove);\n },\n onEnd({ sorter }) {\n off(frameEl, 'pointermove', sorter.onMove);\n },\n customTarget({ event }) {\n return doc.elementFromPoint(event.clientX, event.clientY);\n }\n }\n : null;\n method(frameEl, 'pointerenter', this.handleDragEnter);\n method(frameEl, 'pointermove', this.handleDragOver);\n method(document, 'pointerup', this.handleDrop);\n method(frameEl, 'pointerout', this.handleDragLeave);\n\n // Test with touche devices (seems like frameEl is not capturing pointer events).\n // on/off(document, 'pointermove', sorter.onMove); // for the sorter\n // enable && this.handleDragEnter({}); // no way to use pointerenter/pointerout\n }\n\n startCustom() {\n this.__customTglEff(true);\n }\n\n endCustom(cancel) {\n this.over ? this.endDrop(cancel) : this.__customTglEff(false);\n }\n\n endDrop(cancel, ev) {\n const { em, dragStop } = this;\n this.counter = 0;\n dragStop && dragStop(cancel);\n this.__customTglEff(false);\n em.trigger('canvas:dragend', ev);\n }\n\n handleDragLeave(ev) {\n this.updateCounter(-1, ev);\n }\n\n updateCounter(value, ev) {\n this.counter += value;\n this.counter === 0 && this.endDrop(1, ev);\n }\n\n handleDragEnter(ev) {\n const { em } = this;\n const dt = ev.dataTransfer;\n this.updateCounter(1, ev);\n if (this.over) return;\n this.over = 1;\n const utils = em.get('Utils');\n const canvas = em.get('Canvas');\n // For security reason I can't read the drag data on dragenter, but\n // as I need it for the Sorter context I will use `dragContent` or just\n // any not empty element\n let content = em.get('dragContent') || '
';\n let dragStop, dragContent;\n em.stopDefault();\n\n // Select the right drag provider\n if (em.inAbsoluteMode()) {\n const wrapper = em.get('DomComponents').getWrapper();\n const target = wrapper.append({})[0];\n const dragger = em.get('Commands').run('core:component-drag', {\n event: ev,\n guidesInfo: 1,\n center: 1,\n target,\n onEnd: (ev, dragger, { cancelled }) => {\n let comp;\n if (!cancelled) {\n comp = wrapper.append(content)[0];\n const { left, top, position } = target.getStyle();\n comp.addStyle({ left, top, position });\n }\n this.handleDragEnd(comp, dt);\n target.remove();\n }\n });\n dragStop = cancel => dragger.stop(ev, { cancel });\n dragContent = cnt => (content = cnt);\n } else {\n const sorter = new utils.Sorter({\n em,\n wmargin: 1,\n nested: 1,\n canvasRelative: 1,\n direction: 'a',\n container: this.el,\n placer: canvas.getPlacerEl(),\n containerSel: '*',\n itemSel: '*',\n pfx: 'gjs-',\n onEndMove: model => this.handleDragEnd(model, dt),\n document: this.el.ownerDocument,\n ...(this.sortOpts || {})\n });\n sorter.setDropContent(content);\n sorter.startSort();\n this.sorter = sorter;\n dragStop = cancel => {\n cancel && (sorter.moved = 0);\n sorter.endMove();\n };\n dragContent = content => sorter.setDropContent(content);\n }\n\n this.dragStop = dragStop;\n this.dragContent = dragContent;\n em.trigger('canvas:dragenter', dt, content);\n }\n\n handleDragEnd(model, dt) {\n const { em } = this;\n this.over = 0;\n if (model) {\n em.set('dragResult', model);\n em.trigger('canvas:drop', dt, model);\n }\n em.runDefault({ preserveSelected: 1 });\n }\n\n /**\n * Always need to have this handler active for enabling the drop\n * @param {Event} ev\n */\n handleDragOver(ev) {\n ev.preventDefault();\n this.em.trigger('canvas:dragover', ev);\n }\n\n /**\n * WARNING: This function might fail to run on drop, for example, when the\n * drop, accidentally, happens on some external element (DOM not inside the iframe)\n */\n handleDrop(ev) {\n ev.preventDefault();\n const { dragContent } = this;\n const dt = ev.dataTransfer;\n const content = this.getContentByData(dt).content;\n ev.target.style.border = '';\n content && dragContent && dragContent(content);\n this.endDrop(!content, ev);\n }\n\n getContentByData(dt) {\n const em = this.em;\n const types = dt && dt.types;\n const files = (dt && dt.files) || [];\n const dragContent = em.get('dragContent');\n let content = dt && dt.getData('text');\n\n if (files.length) {\n content = [];\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n const type = file.type.split('/')[0];\n\n if (type == 'image') {\n content.push({\n type,\n file,\n attributes: { alt: file.name }\n });\n }\n }\n } else if (dragContent) {\n content = dragContent;\n } else if (indexOf(types, 'text/html') >= 0) {\n content = dt && dt.getData('text/html').replace(/<\\/?meta[^>]*>/g, '');\n } else if (indexOf(types, 'text/uri-list') >= 0) {\n content = {\n type: 'link',\n attributes: { href: content },\n content: content\n };\n } else if (indexOf(types, 'text/json') >= 0) {\n const json = dt && dt.getData('text/json');\n json && (content = JSON.parse(json));\n } else if (types.length === 1 && types[0] === 'text/plain') {\n // Avoid dropping non-selectable and non-editable text nodes inside the editor\n content = `
${content}
`;\n }\n\n const result = { content };\n em.trigger('canvas:dragdata', dt, result);\n\n return result;\n }\n}\n","import Backbone from 'backbone';\nimport { bindAll, isString, debounce, isUndefined } from 'underscore';\nimport CssRulesView from 'css_composer/view/CssRulesView';\nimport ComponentView from 'dom_components/view/ComponentView';\nimport Droppable from 'utils/Droppable';\nimport {\n appendVNodes,\n empty,\n append,\n createEl,\n createCustomEvent,\n motionsEv\n} from 'utils/dom';\nimport { on, off, setViewEl, hasDnd, getPointerEvent } from 'utils/mixins';\n\nexport default Backbone.View.extend({\n tagName: 'iframe',\n\n attributes: {\n allowfullscreen: 'allowfullscreen',\n 'data-frame-el': true\n },\n\n initialize(o) {\n bindAll(\n this,\n 'updateClientY',\n 'stopAutoscroll',\n 'autoscroll',\n '_emitUpdate'\n );\n const { model, el } = this;\n this.tools = {};\n this.config = {\n ...(o.config || {}),\n frameView: this\n };\n this.ppfx = this.config.pStylePrefix || '';\n this.em = this.config.em;\n const cvModel = this.getCanvasModel();\n this.listenTo(model, 'change:head', this.updateHead);\n this.listenTo(cvModel, 'change:styles', this.renderStyles);\n model.view = this;\n setViewEl(el, this);\n },\n\n /**\n * Update `` content of the frame\n */\n updateHead() {\n const { model } = this;\n const headEl = this.getHead();\n const toRemove = [];\n const toAdd = [];\n const current = model.get('head');\n const prev = model.previous('head');\n const attrStr = (attr = {}) =>\n Object.keys(attr)\n .sort()\n .map(i => `[${i}=\"${attr[i]}\"]`)\n .join('');\n const find = (items, stack, res) => {\n items.forEach(item => {\n const { tag, attributes } = item;\n const has = stack.some(\n s => s.tag === tag && attrStr(s.attributes) === attrStr(attributes)\n );\n !has && res.push(item);\n });\n };\n find(current, prev, toAdd);\n find(prev, current, toRemove);\n toRemove.forEach(stl => {\n const el = headEl.querySelector(`${stl.tag}${attrStr(stl.attributes)}`);\n el && el.parentNode.removeChild(el);\n });\n appendVNodes(headEl, toAdd);\n },\n\n getEl() {\n return this.el;\n },\n\n getCanvasModel() {\n return this.em.get('Canvas').getModel();\n },\n\n getWindow() {\n return this.getEl().contentWindow;\n },\n\n getDoc() {\n return this.getEl().contentDocument;\n },\n\n getHead() {\n return this.getDoc().querySelector('head');\n },\n\n getBody() {\n return this.getDoc().querySelector('body');\n },\n\n getWrapper() {\n return this.getBody().querySelector('[data-gjs-type=wrapper]');\n },\n\n getJsContainer() {\n if (!this.jsContainer) {\n this.jsContainer = createEl('div', { class: `${this.ppfx}js-cont` });\n }\n\n return this.jsContainer;\n },\n\n getToolsEl() {\n const { frameWrapView } = this.config;\n return frameWrapView && frameWrapView.elTools;\n },\n\n getGlobalToolsEl() {\n return this.em.get('Canvas').getGlobalToolsEl();\n },\n\n getHighlighter() {\n return this._getTool('[data-hl]');\n },\n\n getBadgeEl() {\n return this._getTool('[data-badge]');\n },\n\n getOffsetViewerEl() {\n return this._getTool('[data-offset]');\n },\n\n getRect() {\n if (!this.rect) {\n this.rect = this.el.getBoundingClientRect();\n }\n\n return this.rect;\n },\n\n /**\n * Get rect data, not affected by the canvas zoom\n */\n getOffsetRect() {\n const { el } = this;\n const { scrollTop, scrollLeft } = this.getBody();\n const height = el.offsetHeight;\n const width = el.offsetWidth;\n\n return {\n top: el.offsetTop,\n left: el.offsetLeft,\n height,\n width,\n scrollTop,\n scrollLeft,\n scrollBottom: scrollTop + height,\n scrollRight: scrollLeft + width\n };\n },\n\n _getTool(name) {\n const { tools } = this;\n const toolsEl = this.getToolsEl();\n\n if (!tools[name]) {\n tools[name] = toolsEl.querySelector(name);\n }\n\n return tools[name];\n },\n\n remove() {\n const wrp = this.wrapper;\n this._toggleEffects();\n this.tools = {};\n wrp && wrp.remove();\n Backbone.View.prototype.remove.apply(this, arguments);\n },\n\n startAutoscroll() {\n this.lastMaxHeight = this.getWrapper().offsetHeight - this.el.offsetHeight;\n\n // By detaching those from the stack avoid browsers lags\n // Noticeable with \"fast\" drag of blocks\n setTimeout(() => {\n this._toggleAutoscrollFx(1);\n requestAnimationFrame(this.autoscroll);\n }, 0);\n },\n\n autoscroll() {\n if (this.dragging) {\n const { lastClientY } = this;\n const canvas = this.em.get('Canvas');\n const win = this.getWindow();\n const body = this.getBody();\n const actualTop = body.scrollTop;\n const clientY = lastClientY || 0;\n const limitTop = canvas.getConfig().autoscrollLimit;\n const limitBottom = this.getRect().height - limitTop;\n let nextTop = actualTop;\n\n if (clientY < limitTop) {\n nextTop -= limitTop - clientY;\n }\n\n if (clientY > limitBottom) {\n nextTop += clientY - limitBottom;\n }\n\n if (\n !isUndefined(lastClientY) && // Fixes #3134\n nextTop !== actualTop &&\n nextTop > 0 &&\n nextTop < this.lastMaxHeight\n ) {\n const toolsEl = this.getGlobalToolsEl();\n toolsEl.style.opacity = 0;\n this.showGlobalTools();\n win.scrollTo(0, nextTop);\n }\n\n requestAnimationFrame(this.autoscroll);\n }\n },\n\n updateClientY(ev) {\n ev.preventDefault();\n this.lastClientY = getPointerEvent(ev).clientY * this.em.getZoomDecimal();\n },\n\n showGlobalTools: debounce(function() {\n this.getGlobalToolsEl().style.opacity = '';\n }, 50),\n\n stopAutoscroll() {\n this.dragging && this._toggleAutoscrollFx();\n },\n\n _toggleAutoscrollFx(enable) {\n this.dragging = enable;\n const win = this.getWindow();\n const method = enable ? 'on' : 'off';\n const mt = { on, off };\n mt[method](win, 'mousemove dragover', this.updateClientY);\n mt[method](win, 'mouseup', this.stopAutoscroll);\n },\n\n render() {\n const { $el, ppfx } = this;\n $el.attr({ class: `${ppfx}frame` });\n this.renderScripts();\n return this;\n },\n\n renderScripts() {\n const { el, model, em } = this;\n const evLoad = 'frame:load';\n const evOpts = { el, model, view: this };\n const canvas = this.getCanvasModel();\n const appendScript = scripts => {\n if (scripts.length > 0) {\n const src = scripts.shift();\n const scriptEl = createEl('script', {\n type: 'text/javascript',\n ...(isString(src) ? { src } : src)\n });\n scriptEl.onerror = scriptEl.onload = appendScript.bind(null, scripts);\n el.contentDocument.head.appendChild(scriptEl);\n } else {\n this.renderBody();\n em && em.trigger(evLoad, evOpts);\n }\n };\n\n el.onload = () => {\n em && em.trigger(`${evLoad}:before`, evOpts);\n appendScript([...canvas.get('scripts')]);\n };\n },\n\n renderStyles(opts = {}) {\n const head = this.getHead();\n const canvas = this.getCanvasModel();\n const normalize = stls =>\n stls.map(href => ({\n tag: 'link',\n attributes: {\n rel: 'stylesheet',\n ...(isString(href) ? { href } : href)\n }\n }));\n const prevStyles = normalize(opts.prev || canvas.previous('styles'));\n const styles = normalize(canvas.get('styles'));\n const toRemove = [];\n const toAdd = [];\n const find = (items, stack, res) => {\n items.forEach(item => {\n const { href } = item.attributes;\n const has = stack.some(s => s.attributes.href === href);\n !has && res.push(item);\n });\n };\n find(styles, prevStyles, toAdd);\n find(prevStyles, styles, toRemove);\n toRemove.forEach(stl => {\n const el = head.querySelector(`link[href=\"${stl.attributes.href}\"]`);\n el && el.parentNode.removeChild(el);\n });\n appendVNodes(head, toAdd);\n },\n\n renderBody() {\n const { config, model, ppfx } = this;\n const { em } = config;\n const doc = this.getDoc();\n const body = this.getBody();\n const win = this.getWindow();\n const conf = em.get('Config');\n win._isEditor = true;\n this.renderStyles({ prev: [] });\n\n const colorWarn = '#ffca6f';\n\n // I need all this styles to make the editor work properly\n // Remove `html { height: 100%;}` from the baseCss as it gives jumpings\n // effects (on ENTER) with RTE like CKEditor (maybe some bug there?!?)\n // With `body {height: auto;}` jumps in CKEditor are removed but in\n // Firefox is impossible to drag stuff in empty canvas, so bring back\n // `body {height: 100%;}`.\n // For the moment I give the priority to Firefox as it might be\n // CKEditor's issue\n append(\n body,\n ``\n );\n const component = model.getComponent();\n this.wrapper = new ComponentView({\n model: component,\n config: {\n ...component.config,\n frameView: this\n }\n }).render();\n append(body, this.wrapper.el);\n append(\n body,\n new CssRulesView({\n collection: model.getStyles(),\n config: {\n ...em.get('CssComposer').getConfig(),\n frameView: this\n }\n }).render().el\n );\n append(body, this.getJsContainer());\n // em.trigger('loaded'); // I need to manage only the first one maybe\n //this.updateOffset(); // TOFIX (check if I need it)\n\n // Avoid some default behaviours\n on(\n body,\n 'click',\n ev => ev && ev.target.tagName == 'A' && ev.preventDefault()\n );\n on(body, 'submit', ev => ev && ev.preventDefault());\n\n // When the iframe is focused the event dispatcher is not the same so\n // I need to delegate all events to the parent document\n [\n { event: 'keydown keyup keypress', class: 'KeyboardEvent' },\n { event: 'mousedown mousemove mouseup', class: 'MouseEvent' },\n { event: 'pointerdown pointermove pointerup', class: 'PointerEvent' },\n { event: 'wheel', class: 'WheelEvent' }\n ].forEach(obj =>\n obj.event.split(' ').forEach(event => {\n doc.addEventListener(event, ev =>\n this.el.dispatchEvent(createCustomEvent(ev, obj.class))\n );\n })\n );\n\n this._toggleEffects(1);\n this.droppable = hasDnd(em) && new Droppable(em, this.wrapper.el);\n model.trigger('loaded');\n },\n\n _toggleEffects(enable) {\n const method = enable ? on : off;\n const win = this.getWindow();\n win && method(win, `${motionsEv} resize`, this._emitUpdate);\n },\n\n _emitUpdate() {\n this.model._emitUpdated();\n }\n});\n","import Backbone from 'backbone';\nimport FrameView from './FrameView';\nimport { bindAll, isNumber, isNull, debounce } from 'underscore';\nimport { createEl, removeEl } from 'utils/dom';\nimport Dragger from 'utils/Dragger';\n\nexport default Backbone.View.extend({\n events: {\n 'click [data-action-remove]': 'remove',\n 'mousedown [data-action-move]': 'startDrag'\n },\n\n initialize(opts = {}, conf = {}) {\n bindAll(\n this,\n 'onScroll',\n 'frameLoaded',\n 'updateOffset',\n 'remove',\n 'startDrag'\n );\n const { model } = this;\n const config = {\n ...(opts.config || conf),\n frameWrapView: this\n };\n const { canvasView, em } = config;\n this.cv = canvasView;\n this.config = config;\n this.em = em;\n this.canvas = em && em.get('Canvas');\n this.ppfx = config.pStylePrefix || '';\n this.frame = new FrameView({ model, config });\n this.classAnim = `${this.ppfx}frame-wrapper--anim`;\n this.updateOffset = debounce(this.updateOffset.bind(this));\n this.updateSize = debounce(this.updateSize.bind(this));\n this.listenTo(model, 'loaded', this.frameLoaded);\n this.listenTo(model, 'change:x change:y', this.updatePos);\n this.listenTo(model, 'change:width change:height', this.updateSize);\n this.listenTo(model, 'destroy remove', this.remove);\n this.updatePos();\n this.setupDragger();\n },\n\n setupDragger() {\n const { canvas, model } = this;\n let dragX, dragY, zoom;\n const toggleEffects = on => {\n canvas.toggleFramesEvents(on);\n };\n\n this.dragger = new Dragger({\n onStart: () => {\n const { x, y } = model.attributes;\n zoom = this.em.getZoomMultiplier();\n dragX = x;\n dragY = y;\n toggleEffects();\n },\n onEnd: () => toggleEffects(1),\n setPosition: posOpts => {\n model.set({\n x: dragX + posOpts.x * zoom,\n y: dragY + posOpts.y * zoom\n });\n }\n });\n },\n\n startDrag(ev) {\n ev && this.dragger.start(ev);\n },\n\n __clear(opts) {\n const { frame } = this;\n frame && frame.remove(opts);\n removeEl(this.elTools);\n },\n\n remove(opts) {\n this.__clear(opts);\n Backbone.View.prototype.remove.apply(this, arguments);\n ['frame', 'dragger', 'cv', 'em', 'canvas', 'elTools'].forEach(\n i => (this[i] = 0)\n );\n return this;\n },\n\n updateOffset() {\n const { em, $el, frame } = this;\n if (!em) return;\n em.runDefault({ preserveSelected: 1 });\n $el.removeClass(this.classAnim);\n frame.model._emitUpdated();\n },\n\n updatePos(md) {\n const { model, el } = this;\n const { x, y } = model.attributes;\n const { style } = el;\n this.frame.rect = 0;\n style.left = isNaN(x) ? x : `${x}px`;\n style.top = isNaN(y) ? y : `${y}px`;\n md && this.updateOffset();\n },\n\n updateSize() {\n this.updateDim();\n },\n\n /**\n * Update dimensions of the frame\n * @private\n */\n updateDim() {\n const { em, el, $el, model, classAnim, frame } = this;\n if (!frame) return;\n frame.rect = 0;\n $el.addClass(classAnim);\n const { noChanges, width, height } = this.__handleSize();\n\n // Set width and height from DOM (should be done only once)\n if (isNull(width) || isNull(height)) {\n model.set(\n {\n ...(!width ? { width: el.offsetWidth } : {}),\n ...(!height ? { height: el.offsetHeight } : {})\n },\n { silent: 1 }\n );\n }\n\n // Prevent fixed highlighting box which appears when on\n // component hover during the animation\n em.stopDefault({ preserveSelected: 1 });\n noChanges ? this.updateOffset() : setTimeout(this.updateOffset, 350);\n },\n\n onScroll() {\n const { frame, em } = this;\n em.trigger('frame:scroll', {\n frame,\n body: frame.getBody(),\n target: frame.getWindow()\n });\n },\n\n frameLoaded() {\n const { frame } = this;\n frame.getWindow().onscroll = this.onScroll;\n this.updateDim();\n },\n\n __handleSize() {\n const un = 'px';\n const { model, el } = this;\n const { style } = el;\n const { width, height } = model.attributes;\n const currW = style.width || '';\n const currH = style.height || '';\n const newW = width || '';\n const newH = height || '';\n const noChanges = currW == newW && currH == newH;\n style.width = isNumber(newW) ? `${newW}${un}` : newW;\n style.height = isNumber(newH) ? `${newH}${un}` : newH;\n return { noChanges, width, height, newW, newH };\n },\n\n render() {\n const { frame, $el, ppfx, cv, model, el } = this;\n const { onRender } = model.attributes;\n this.__clear();\n this.__handleSize();\n frame.render();\n $el\n .empty()\n .attr({ class: `${ppfx}frame-wrapper` })\n .append(\n `\n
\n
\n ${model.get('name') || ''}\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n `\n )\n .append(frame.el);\n const elTools = createEl(\n 'div',\n {\n class: `${ppfx}tools`,\n style: 'pointer-events:none; display: none'\n },\n `\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n `\n );\n this.elTools = elTools;\n const twrp = cv.toolsWrapper;\n twrp && twrp.appendChild(elTools); // TODO remove on frame remove\n onRender &&\n onRender({\n el,\n elTop: el.querySelector('[data-frame-top]'),\n elRight: el.querySelector('[data-frame-right]'),\n elBottom: el.querySelector('[data-frame-bottom]'),\n elLeft: el.querySelector('[data-frame-left]'),\n frame: model,\n frameWrapperView: this,\n remove: this.remove,\n startDrag: this.startDrag\n });\n return this;\n }\n});\n","import DomainViews from 'domain_abstract/view/DomainViews';\nimport FrameWrapView from './FrameWrapView';\n\nexport default DomainViews.extend({\n itemView: FrameWrapView,\n autoAdd: 1,\n\n init() {\n this.listenTo(this.collection, 'reset', this.render);\n },\n\n onRemoveBefore(items, opts) {\n items.forEach(item => item.remove(opts));\n },\n\n onRender() {\n const { config, $el } = this;\n const { em } = config;\n em && $el.attr({ class: `${em.getConfig('stylePrefix')}frames` });\n }\n});\n","import Backbone from 'backbone';\nimport { bindAll } from 'underscore';\nimport {\n on,\n off,\n getElement,\n getKeyChar,\n isTextNode,\n getElRect,\n getUiClass\n} from 'utils/mixins';\nimport FramesView from './FramesView';\n\nconst $ = Backbone.$;\nlet timerZoom;\n\nexport default Backbone.View.extend({\n events: {\n wheel: 'onWheel'\n },\n\n template() {\n const { pfx } = this;\n return `\n
\n
\n `;\n },\n\n initialize(o) {\n bindAll(this, 'clearOff', 'onKeyPress', 'onCanvasMove');\n const { model } = this;\n this.config = o.config || {};\n this.em = this.config.em || {};\n this.pfx = this.config.stylePrefix || '';\n this.ppfx = this.config.pStylePrefix || '';\n this.className = this.config.stylePrefix + 'canvas';\n const { em } = this;\n this._initFrames();\n this.listenTo(em, 'change:canvasOffset', this.clearOff);\n this.listenTo(em, 'component:selected', this.checkSelected);\n this.listenTo(model, 'change:zoom change:x change:y', this.updateFrames);\n this.listenTo(model, 'change:frames', this._onFramesUpdate);\n this.toggleListeners(1);\n },\n\n _onFramesUpdate() {\n this._initFrames();\n this._renderFrames();\n },\n\n _initFrames() {\n const { frames, model, config, em } = this;\n const collection = model.get('frames');\n em.set('readyCanvas', 0);\n collection.once('loaded:all', () => em.set('readyCanvas', 1));\n frames && frames.remove();\n this.frames = new FramesView({\n collection,\n config: {\n ...config,\n canvasView: this\n }\n });\n },\n\n checkSelected(component, opts = {}) {\n const { scroll } = opts;\n const currFrame = this.em.get('currentFrame');\n\n scroll &&\n component.views.forEach(view => {\n view._getFrame() !== currFrame && view.scrollIntoView(scroll);\n });\n },\n\n remove() {\n this.frames.remove();\n this.frames = {};\n Backbone.View.prototype.remove.apply(this, arguments);\n this.toggleListeners();\n },\n\n preventDefault(ev) {\n if (ev) {\n ev.preventDefault();\n ev._parentEvent && ev._parentEvent.preventDefault();\n }\n },\n\n onCanvasMove(ev) {\n // const data = { x: ev.clientX, y: ev.clientY };\n // const data2 = this.em.get('Canvas').getMouseRelativeCanvas(ev);\n // const data3 = this.em.get('Canvas').getMouseRelativePos(ev);\n // this.em.trigger('canvas:over', data, data2, data3);\n },\n\n toggleListeners(enable) {\n const { el } = this;\n const fn = enable ? on : off;\n fn(document, 'keypress', this.onKeyPress);\n fn(window, 'scroll resize', this.clearOff);\n // fn(el, 'mousemove dragover', this.onCanvasMove);\n },\n\n onKeyPress(ev) {\n const { em } = this;\n const key = getKeyChar(ev);\n\n if (\n key === ' ' &&\n em.getZoomDecimal() !== 1 &&\n !em.get('Canvas').isInputFocused()\n ) {\n this.preventDefault(ev);\n em.get('Editor').runCommand('core:canvas-move');\n }\n },\n\n onWheel(ev) {\n if ((ev.ctrlKey || ev.metaKey) && this.em.getConfig('multiFrames')) {\n this.preventDefault(ev);\n const { model } = this;\n const delta = Math.max(-1, Math.min(1, ev.wheelDelta || -ev.detail));\n const zoom = model.get('zoom');\n model.set('zoom', zoom + delta * 2);\n }\n },\n\n updateFrames(ev) {\n const { em, model } = this;\n const { x, y } = model.attributes;\n const zoom = this.getZoom();\n const defOpts = { preserveSelected: 1 };\n const mpl = zoom ? 1 / zoom : 1;\n this.framesArea.style.transform = `scale(${zoom}) translate(${x *\n mpl}px, ${y * mpl}px)`;\n this.clearOff();\n em.stopDefault(defOpts);\n em.trigger('canvas:update', ev);\n timerZoom && clearTimeout(timerZoom);\n timerZoom = setTimeout(() => em.runDefault(defOpts), 300);\n },\n\n getZoom() {\n return this.em.getZoomDecimal();\n },\n\n /**\n * Checks if the element is visible in the canvas's viewport\n * @param {HTMLElement} el\n * @return {Boolean}\n */\n isElInViewport(el) {\n const elem = getElement(el);\n const rect = getElRect(elem);\n const frameRect = this.getFrameOffset(elem);\n const rTop = rect.top;\n const rLeft = rect.left;\n return (\n rTop >= 0 &&\n rLeft >= 0 &&\n rTop <= frameRect.height &&\n rLeft <= frameRect.width\n );\n },\n\n /**\n * Get the offset of the element\n * @param {HTMLElement} el\n * @return {Object}\n */\n offset(el, opts = {}) {\n const rect = getElRect(el);\n const docBody = el.ownerDocument.body;\n const { noScroll } = opts;\n\n return {\n top: rect.top + (noScroll ? 0 : docBody.scrollTop),\n left: rect.left + (noScroll ? 0 : docBody.scrollLeft),\n width: rect.width,\n height: rect.height\n };\n },\n\n /**\n * Cleare cached offsets\n * @private\n */\n clearOff() {\n this.frmOff = null;\n this.cvsOff = null;\n },\n\n /**\n * Return frame offset\n * @return {Object}\n * @private\n */\n getFrameOffset(el) {\n if (!this.frmOff || el) {\n const frame = this.frame.el;\n const winEl = el && el.ownerDocument.defaultView;\n const frEl = winEl ? winEl.frameElement : frame;\n this.frmOff = this.offset(frEl || frame);\n }\n return this.frmOff;\n },\n\n /**\n * Return canvas offset\n * @return {Object}\n * @private\n */\n getCanvasOffset() {\n if (!this.cvsOff) this.cvsOff = this.offset(this.el);\n return this.cvsOff;\n },\n\n /**\n * Returns element's rect info\n * @param {HTMLElement} el\n * @return {Object}\n * @private\n */\n getElementPos(el, opts) {\n const zoom = this.getZoom();\n var opt = opts || {};\n var frmOff = this.getFrameOffset(el);\n var cvsOff = this.getCanvasOffset();\n var eo = this.offset(el, opts);\n\n var frmTop = opt.avoidFrameOffset ? 0 : frmOff.top;\n var frmLeft = opt.avoidFrameOffset ? 0 : frmOff.left;\n\n const top = eo.top * zoom + frmTop - cvsOff.top;\n const left = eo.left * zoom + frmLeft - cvsOff.left;\n const height = eo.height * zoom;\n const width = eo.width * zoom;\n\n return { top, left, height, width, zoom, rect: eo };\n },\n\n /**\n * Returns element's offsets like margins and paddings\n * @param {HTMLElement} el\n * @return {Object}\n * @private\n */\n getElementOffsets(el) {\n if (!el || isTextNode(el)) return {};\n const result = {};\n const styles = window.getComputedStyle(el);\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft'\n ].forEach(offset => {\n result[offset] = parseFloat(styles[offset]) * this.getZoom();\n });\n\n return result;\n },\n\n /**\n * Returns position data of the canvas element\n * @return {Object} obj Position object\n * @private\n */\n getPosition(opts = {}) {\n const doc = this.frame.el.contentDocument;\n if (!doc) return;\n const bEl = doc.body;\n const zoom = this.getZoom();\n const fo = this.getFrameOffset();\n const co = this.getCanvasOffset();\n const { noScroll } = opts;\n\n return {\n top: fo.top + (noScroll ? 0 : bEl.scrollTop) * zoom - co.top,\n left: fo.left + (noScroll ? 0 : bEl.scrollLeft) * zoom - co.left,\n width: co.width,\n height: co.height\n };\n },\n\n /**\n * Update javascript of a specific component passed by its View\n * @param {View} view Component's View\n * @private\n */\n updateScript(view) {\n const model = view.model;\n const id = model.getId();\n\n if (!view.scriptContainer) {\n view.scriptContainer = $(`
`);\n this.getJsContainer().appendChild(view.scriptContainer.get(0));\n }\n\n view.el.id = id;\n view.scriptContainer.html('');\n // In editor, I make use of setTimeout as during the append process of elements\n // those will not be available immediately, therefore 'item' variable\n const script = document.createElement('script');\n const scriptFn = model.getScriptString();\n const scriptFnStr = model.get('script-props')\n ? scriptFn\n : `function(){\\n${scriptFn}\\n;}`;\n const scriptProps = JSON.stringify(model.__getScriptProps());\n script.innerHTML = `\n setTimeout(function() {\n var item = document.getElementById('${id}');\n if (!item) return;\n (${scriptFnStr}.bind(item))(${scriptProps})\n }, 1);`;\n // #873\n // Adding setTimeout will make js components work on init of the editor\n setTimeout(() => {\n const scr = view.scriptContainer;\n scr && scr.get(0).appendChild(script);\n }, 0);\n },\n\n /**\n * Get javascript container\n * @private\n */\n getJsContainer(view) {\n const frameView = this.getFrameView(view);\n return frameView && frameView.getJsContainer();\n },\n\n getFrameView(view) {\n return (view && view._getFrame()) || this.em.get('currentFrame');\n },\n\n _renderFrames() {\n if (!this.ready) return;\n const { model, frames, em, framesArea } = this;\n const frms = model.get('frames');\n frms.listenToLoad();\n frames.render();\n const mainFrame = frms.at(0);\n const currFrame = mainFrame && mainFrame.view;\n em.setCurrentFrame(currFrame);\n framesArea && framesArea.appendChild(frames.el);\n this.frame = currFrame;\n },\n\n render() {\n const { el, $el, ppfx, config, em } = this;\n $el.html(this.template());\n const $frames = $el.find('[data-frames]');\n this.framesArea = $frames.get(0);\n\n const toolsWrp = $el.find('[data-tools]');\n this.toolsWrapper = toolsWrp.get(0);\n toolsWrp.append(`\n
\n
\n
\n
\n
\n
\n ${config.extHl ? `
` : ''}\n
\n
\n
\n
\n
\n
\n
\n `);\n const toolsEl = el.querySelector(`#${ppfx}tools`);\n this.hlEl = el.querySelector(`.${ppfx}highlighter`);\n this.badgeEl = el.querySelector(`.${ppfx}badge`);\n this.placerEl = el.querySelector(`.${ppfx}placeholder`);\n this.ghostEl = el.querySelector(`.${ppfx}ghost`);\n this.toolbarEl = el.querySelector(`.${ppfx}toolbar`);\n this.resizerEl = el.querySelector(`.${ppfx}resizer`);\n this.offsetEl = el.querySelector(`.${ppfx}offset-v`);\n this.fixedOffsetEl = el.querySelector(`.${ppfx}offset-fixed-v`);\n this.toolsGlobEl = el.querySelector(`.${ppfx}tools-gl`);\n this.toolsEl = toolsEl;\n this.el.className = getUiClass(em, this.className);\n this.ready = 1;\n this._renderFrames();\n\n return this;\n }\n});\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/canvas/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * canvas: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const canvas = editor.Canvas;\n * ```\n *\n * * [getConfig](#getconfig)\n * * [getElement](#getelement)\n * * [getFrameEl](#getframeel)\n * * [getWindow](#getwindow)\n * * [getDocument](#getdocument)\n * * [getBody](#getbody)\n * * [setCustomBadgeLabel](#setcustombadgelabel)\n * * [hasFocus](#hasfocus)\n * * [scrollTo](#scrollto)\n * * [setZoom](#setzoom)\n * * [getZoom](#getzoom)\n * * [getCoords](#getcoords)\n * * [setCoords](#setcoords)\n *\n * [Component]: component.html\n * [Frame]: frame.html\n *\n * @module Canvas\n */\n\nimport { isUndefined } from 'underscore';\nimport { getElement, getViewEl } from 'utils/mixins';\nimport defaults from './config/config';\nimport Canvas from './model/Canvas';\nimport canvasView from './view/CanvasView';\n\nexport default () => {\n let c = {};\n let canvas;\n let CanvasView;\n\n return {\n /**\n * Used inside RTE\n * @private\n */\n getCanvasView() {\n return CanvasView;\n },\n\n name: 'Canvas',\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @private\n */\n init(config = {}) {\n c = {\n ...defaults,\n ...config,\n module: this\n };\n\n this.em = c.em;\n const { scripts, styles } = c;\n const ppfx = c.pStylePrefix;\n if (ppfx) c.stylePrefix = ppfx + c.stylePrefix;\n canvas = new Canvas({ scripts, styles }, config);\n this.model = canvas;\n this.startAutoscroll = this.startAutoscroll.bind(this);\n this.stopAutoscroll = this.stopAutoscroll.bind(this);\n return this;\n },\n\n onLoad() {\n this.model.init();\n },\n\n getModel() {\n return canvas;\n },\n\n /**\n * Get the configuration object\n * @returns {Object} Configuration object\n * @example\n * console.log(canvas.getConfig())\n */\n getConfig() {\n return c;\n },\n\n /**\n * Get the canvas element\n * @returns {HTMLElement}\n */\n getElement() {\n return CanvasView.el;\n },\n\n getFrame(index) {\n return this.getFrames()[index || 0];\n },\n\n /**\n * Get the main frame element of the canvas\n * @returns {HTMLIFrameElement}\n */\n getFrameEl() {\n const { frame } = CanvasView || {};\n return frame && frame.el;\n },\n\n getFramesEl() {\n return CanvasView.framesArea;\n },\n\n /**\n * Get the main frame window instance\n * @returns {Window}\n */\n getWindow() {\n return this.getFrameEl().contentWindow;\n },\n\n /**\n * Get the main frame document element\n * @returns {HTMLDocument}\n */\n getDocument() {\n const frame = this.getFrameEl();\n return frame && frame.contentDocument;\n },\n\n /**\n * Get the main frame body element\n * @return {HTMLBodyElement}\n */\n getBody() {\n const doc = this.getDocument();\n return doc && doc.body;\n },\n\n _getCompFrame(compView) {\n return compView && compView._getFrame();\n },\n\n _getLocalEl(globalEl, compView, method) {\n let result = globalEl;\n const frameView = this._getCompFrame(compView);\n result = frameView ? frameView[method]() : result;\n\n return result;\n },\n\n /**\n * Returns element containing all global canvas tools\n * @returns {HTMLElement}\n * @private\n */\n getGlobalToolsEl() {\n return CanvasView.toolsGlobEl;\n },\n\n /**\n * Returns element containing all canvas tools\n * @returns {HTMLElement}\n * @private\n */\n getToolsEl(compView) {\n return this._getLocalEl(CanvasView.toolsEl, compView, 'getToolsEl');\n },\n\n /**\n * Returns highlighter element\n * @returns {HTMLElement}\n * @private\n */\n getHighlighter(compView) {\n return this._getLocalEl(CanvasView.hlEl, compView, 'getHighlighter');\n },\n\n /**\n * Returns badge element\n * @returns {HTMLElement}\n * @private\n */\n getBadgeEl(compView) {\n return this._getLocalEl(CanvasView.badgeEl, compView, 'getBadgeEl');\n },\n\n /**\n * Returns placer element\n * @returns {HTMLElement}\n * @private\n */\n getPlacerEl() {\n return CanvasView.placerEl;\n },\n\n /**\n * Returns ghost element\n * @returns {HTMLElement}\n * @private\n */\n getGhostEl() {\n return CanvasView.ghostEl;\n },\n\n /**\n * Returns toolbar element\n * @returns {HTMLElement}\n * @private\n */\n getToolbarEl() {\n return CanvasView.toolbarEl;\n },\n\n /**\n * Returns resizer element\n * @returns {HTMLElement}\n * @private\n */\n getResizerEl() {\n return CanvasView.resizerEl;\n },\n\n /**\n * Returns offset viewer element\n * @returns {HTMLElement}\n * @private\n */\n getOffsetViewerEl(compView) {\n return this._getLocalEl(\n CanvasView.offsetEl,\n compView,\n 'getOffsetViewerEl'\n );\n },\n\n /**\n * Returns fixed offset viewer element\n * @returns {HTMLElement}\n * @private\n */\n getFixedOffsetViewerEl() {\n return CanvasView.fixedOffsetEl;\n },\n\n render() {\n CanvasView && CanvasView.remove();\n CanvasView = new canvasView({\n model: canvas,\n config: c\n });\n return CanvasView.render().el;\n },\n\n /**\n * Get frame position\n * @returns {Object}\n * @private\n */\n getOffset() {\n var frameOff = this.offset(this.getFrameEl());\n var canvasOff = this.offset(this.getElement());\n return {\n top: frameOff.top - canvasOff.top,\n left: frameOff.left - canvasOff.left\n };\n },\n\n /**\n * Get the offset of the passed component element\n * @param {HTMLElement} el\n * @returns {Object}\n * @private\n */\n offset(el) {\n return CanvasView.offset(el);\n },\n\n /**\n * Set custom badge naming strategy\n * @param {Function} f\n * @example\n * canvas.setCustomBadgeLabel(function(component){\n * return component.getName();\n * });\n */\n setCustomBadgeLabel(f) {\n c.customBadgeLabel = f;\n },\n\n /**\n * Get element position relative to the canvas\n * @param {HTMLElement} el\n * @returns {Object}\n * @private\n */\n getElementPos(el, opts) {\n return CanvasView.getElementPos(el, opts);\n },\n\n /**\n * Returns element's offsets like margins and paddings\n * @param {HTMLElement} el\n * @returns {Object}\n * @private\n */\n getElementOffsets(el) {\n return CanvasView.getElementOffsets(el);\n },\n\n /**\n * Get canvas rectangular data\n * @returns {Object}\n */\n getRect() {\n const { top, left } = CanvasView.getPosition();\n return {\n ...CanvasView.getCanvasOffset(),\n topScroll: top,\n leftScroll: left\n };\n },\n\n /**\n * This method comes handy when you need to attach something like toolbars\n * to elements inside the canvas, dealing with all relative position,\n * offsets, etc. and returning as result the object with positions which are\n * viewable by the user (when the canvas is scrolled the top edge of the element\n * is not viewable by the user anymore so the new top edge is the one of the canvas)\n *\n * The target should be visible before being passed here as invisible elements\n * return empty string as width\n * @param {HTMLElement} target The target in this case could be the toolbar\n * @param {HTMLElement} element The element on which I'd attach the toolbar\n * @param {Object} options Custom options\n * @param {Boolean} options.toRight Set to true if you want the toolbar attached to the right\n * @return {Object}\n * @private\n */\n getTargetToElementDim(target, element, options = {}) {\n var opts = options || {};\n var canvasPos = CanvasView.getPosition();\n if (!canvasPos) return;\n var pos = opts.elPos || CanvasView.getElementPos(element);\n var toRight = options.toRight || 0;\n var targetHeight = opts.targetHeight || target.offsetHeight;\n var targetWidth = opts.targetWidth || target.offsetWidth;\n var eventToTrigger = opts.event || null;\n\n var elTop = pos.top - targetHeight;\n var elLeft = pos.left;\n elLeft += toRight ? pos.width : 0;\n elLeft = toRight ? elLeft - targetWidth : elLeft;\n\n var leftPos = elLeft < canvasPos.left ? canvasPos.left : elLeft;\n var topPos = elTop < canvasPos.top ? canvasPos.top : elTop;\n topPos = topPos > pos.top + pos.height ? pos.top + pos.height : topPos;\n\n var result = {\n top: topPos,\n left: leftPos,\n elementTop: pos.top,\n elementLeft: pos.left,\n elementWidth: pos.width,\n elementHeight: pos.height,\n targetWidth: target.offsetWidth,\n targetHeight: target.offsetHeight,\n canvasTop: canvasPos.top,\n canvasLeft: canvasPos.left,\n canvasWidth: canvasPos.width,\n canvasHeight: canvasPos.height\n };\n\n // In this way I can catch data and also change the position strategy\n if (eventToTrigger && c.em) {\n c.em.trigger(eventToTrigger, result);\n }\n\n return result;\n },\n\n canvasRectOffset(el, pos, opts = {}) {\n const getFrameElFromDoc = doc => {\n const { defaultView } = doc;\n return defaultView && defaultView.frameElement;\n };\n\n const rectOff = (el, top = 1, pos) => {\n const zoom = this.em.getZoomDecimal();\n const side = top ? 'top' : 'left';\n const doc = el.ownerDocument;\n const { offsetTop = 0, offsetLeft = 0 } = opts.offset\n ? getFrameElFromDoc(doc)\n : {};\n const { scrollTop = 0, scrollLeft = 0 } = doc.body || {};\n const scroll = top ? scrollTop : scrollLeft;\n const offset = top ? offsetTop : offsetLeft;\n\n // if (!top) {\n // console.log('LEFT', { posLeft: pos[side], scroll, offset }, el);\n // }\n\n return pos[side] - (scroll - offset) * zoom;\n };\n\n return {\n top: rectOff(el, 1, pos),\n left: rectOff(el, 0, pos)\n };\n },\n\n getTargetToElementFixed(el, elToMove, opts = {}) {\n const pos = opts.pos || this.getElementPos(el);\n const cvOff = opts.canvasOff || this.canvasRectOffset(el, pos);\n const toolbarH = elToMove.offsetHeight || 0;\n const toolbarW = elToMove.offsetWidth || 0;\n const elRight = pos.left + pos.width;\n const cv = this.getCanvasView();\n const frCvOff = cv.getPosition();\n const frameOffset = cv.getFrameOffset(el);\n const { event } = opts;\n\n let top = -toolbarH;\n let left = !isUndefined(opts.left) ? opts.left : pos.width - toolbarW;\n left = pos.left < -left ? -pos.left : left;\n left = elRight > frCvOff.width ? left - (elRight - frCvOff.width) : left;\n\n // Scroll with the window if the top edge is reached and the\n // element is bigger than the canvas\n const fullHeight = pos.height + toolbarH;\n const elIsShort = fullHeight < frameOffset.height;\n\n if (cvOff.top < toolbarH) {\n if (elIsShort) {\n top = top + fullHeight;\n } else {\n top = -cvOff.top < pos.height ? -cvOff.top : pos.height;\n }\n }\n\n const result = {\n top,\n left,\n canvasOffsetTop: cvOff.top,\n canvasOffsetLeft: cvOff.left\n };\n\n // In this way I can catch data and also change the position strategy\n event && this.em.trigger(event, result);\n\n return result;\n },\n\n /**\n * Instead of simply returning e.clientX and e.clientY this function\n * calculates also the offset based on the canvas. This is helpful when you\n * need to get X and Y position while moving between the editor area and\n * canvas area, which is in the iframe\n * @param {Event} e\n * @return {Object}\n * @private\n */\n getMouseRelativePos(e, options) {\n var opts = options || {};\n var addTop = 0;\n var addLeft = 0;\n var subWinOffset = opts.subWinOffset;\n var doc = e.target.ownerDocument;\n var win = doc.defaultView || doc.parentWindow;\n var frame = win.frameElement;\n var yOffset = subWinOffset ? win.pageYOffset : 0;\n var xOffset = subWinOffset ? win.pageXOffset : 0;\n\n if (frame) {\n var frameRect = frame.getBoundingClientRect();\n addTop = frameRect.top || 0;\n addLeft = frameRect.left || 0;\n }\n\n return {\n y: e.clientY + addTop - yOffset,\n x: e.clientX + addLeft - xOffset\n };\n },\n\n /**\n * X and Y mouse position relative to the canvas\n * @param {Event} ev\n * @return {Object}\n * @private\n */\n getMouseRelativeCanvas(ev, opts) {\n const zoom = this.getZoomDecimal();\n const { top, left } = CanvasView.getPosition(opts);\n\n return {\n y: ev.clientY * zoom + top,\n x: ev.clientX * zoom + left\n };\n },\n\n /**\n * Check if the canvas is focused\n * @returns {Boolean}\n */\n hasFocus() {\n return this.getDocument().hasFocus();\n },\n\n /**\n * Detects if some input is focused (input elements, text components, etc.)\n * @return {Boolean}\n * @private\n */\n isInputFocused() {\n const doc = this.getDocument();\n const frame = this.getFrameEl();\n const toIgnore = ['body', ...this.getConfig().notTextable];\n const docActive = frame && document.activeElement === frame;\n const focused = docActive\n ? doc && doc.activeElement\n : document.activeElement;\n\n return focused && !toIgnore.some(item => focused.matches(item));\n },\n\n /**\n * Scroll canvas to the element if it's not visible. The scrolling is\n * executed via `scrollIntoView` API and options of this method are\n * passed to it. For instance, you can scroll smoothly by using\n * `{ behavior: 'smooth' }`.\n * @param {HTMLElement|[Component]} el\n * @param {Object} [opts={}] Options, same as options for `scrollIntoView`\n * @param {Boolean} [opts.force=false] Force the scroll, even if the element is already visible\n * @example\n * const selected = editor.getSelected();\n * // Scroll smoothly (this behavior can be polyfilled)\n * canvas.scrollTo(selected, { behavior: 'smooth' });\n * // Force the scroll, even if the element is alredy visible\n * canvas.scrollTo(selected, { force: true });\n */\n scrollTo(el, opts = {}) {\n const elem = getElement(el);\n const view = elem && getViewEl(elem);\n view && view.scrollIntoView(opts);\n },\n\n /**\n * Start autoscroll\n * @private\n */\n startAutoscroll(frame) {\n const fr = (frame && frame.view) || this.em.getCurrentFrame();\n fr && fr.startAutoscroll();\n },\n\n /**\n * Stop autoscroll\n * @private\n */\n stopAutoscroll(frame) {\n const fr = (frame && frame.view) || this.em.getCurrentFrame();\n fr && fr.stopAutoscroll();\n },\n\n /**\n * Set canvas zoom value\n * @param {Number} value The zoom value, from 0 to 100\n * @returns {this}\n * @example\n * canvas.setZoom(50); // set zoom to 50%\n */\n setZoom(value) {\n canvas.set('zoom', parseFloat(value));\n return this;\n },\n\n /**\n * Get canvas zoom value\n * @returns {Number}\n * @example\n * canvas.setZoom(50); // set zoom to 50%\n * const zoom = canvas.getZoom(); // 50\n */\n getZoom() {\n return parseFloat(canvas.get('zoom'));\n },\n\n /**\n * Set canvas position coordinates\n * @param {Number} x Horizontal position\n * @param {Number} y Vertical position\n * @returns {this}\n * @example\n * canvas.setCoords(100, 100);\n */\n setCoords(x, y) {\n canvas.set({ x: parseFloat(x), y: parseFloat(y) });\n return this;\n },\n\n /**\n * Get canvas position coordinates\n * @returns {Object} Object containing coordinates\n * @example\n * canvas.setCoords(100, 100);\n * const coords = canvas.getCoords();\n * // { x: 100, y: 100 }\n */\n getCoords() {\n const { x, y } = canvas.attributes;\n return { x, y };\n },\n\n getZoomDecimal() {\n return this.getZoom() / 100;\n },\n\n getZoomMultiplier() {\n const zoom = this.getZoomDecimal();\n return zoom ? 1 / zoom : 1;\n },\n\n toggleFramesEvents(on) {\n const { style } = this.getFramesEl();\n style.pointerEvents = on ? '' : 'none';\n },\n\n getFrames() {\n return canvas.get('frames').map(item => item);\n },\n\n /**\n * Add new frame to the canvas\n * @param {Object} props Frame properties\n * @returns {[Frame]}\n * @example\n * canvas.addFrame({\n * name: 'Mobile home page',\n * x: 100, // Position in canvas\n * y: 100,\n * width: 500, // Frame dimensions\n * height: 600,\n * // device: 'DEVICE-ID',\n * components: [\n * '

Title frame

',\n * '

Paragraph frame

',\n * ],\n * styles: `\n * .testh { color: red; }\n * .testp { color: blue; }\n * `,\n * });\n */\n addFrame(props = {}, opts = {}) {\n return canvas.get('frames').add(\n {\n ...props\n },\n {\n ...opts,\n em: this.em\n }\n );\n },\n\n destroy() {\n canvas.stopListening();\n CanvasView && CanvasView.remove();\n [c, canvas, CanvasView].forEach(i => (i = {}));\n ['em', 'model', 'droppable'].forEach(i => (this[i] = {}));\n }\n };\n};\n","export default {\n stylePrefix: 'sm-',\n\n sectors: [],\n\n // Specify the element to use as a container, string (query) or HTMLElement\n // With the empty value, nothing will be rendered\n appendTo: '',\n\n // Hide the property in case it's not stylable for the\n // selected component (each component has 'stylable' property)\n hideNotStylable: true,\n\n // Highlight changed properties of the selected component\n highlightChanged: true,\n\n // Highlight computed properties of the selected component\n highlightComputed: true,\n\n // Show computed properties of the selected component, if this value\n // is set to false, highlightComputed will not take effect\n showComputed: true,\n\n // Adds the possibility to clear property value from the target style\n clearProperties: true,\n\n // Properties not to take in account for computed styles\n avoidComputed: ['width', 'height']\n};\n","export default () => ({\n /**\n * Build props object by their name\n * @param {Array|string} props Array of properties name\n * @return {Array}\n */\n build(props) {\n var objs = [];\n var dftFixedValues = ['initial', 'inherit'];\n\n if (typeof props === 'string') props = [props];\n\n for (var i = 0, len = props.length; i < len; i++) {\n var obj = {};\n var prop = props[i];\n obj.property = prop;\n\n // Property\n switch (prop) {\n case 'border-radius-c':\n obj.property = 'border-radius';\n break;\n }\n\n // Fixed values\n switch (prop) {\n case 'top':\n case 'right':\n case 'bottom':\n case 'left':\n case 'margin-top':\n case 'margin-right':\n case 'margin-bottom':\n case 'margin-left':\n case 'padding-top':\n case 'padding-right':\n case 'padding-bottom':\n case 'padding-left':\n case 'width':\n case 'max-width':\n case 'min-width':\n case 'height':\n case 'max-height':\n case 'min-height':\n case 'flex-basis':\n obj.fixedValues = ['initial', 'inherit', 'auto'];\n break;\n case 'font-size':\n obj.fixedValues = [\n 'medium',\n 'xx-small',\n 'x-small',\n 'small',\n 'large',\n 'x-large',\n 'xx-large',\n 'smaller',\n 'larger',\n 'length',\n 'initial',\n 'inherit'\n ];\n break;\n case 'letter-spacing':\n case 'line-height':\n obj.fixedValues = ['normal', 'initial', 'inherit'];\n break;\n }\n\n // Type\n switch (prop) {\n case 'float':\n case 'position':\n case 'text-align':\n obj.type = 'radio';\n break;\n case 'display':\n case 'flex-direction':\n case 'flex-wrap':\n case 'justify-content':\n case 'align-items':\n case 'align-content':\n case 'align-self':\n case 'font-family':\n case 'font-weight':\n case 'border-style':\n case 'box-shadow-type':\n case 'background-repeat':\n case 'background-position':\n case 'background-attachment':\n case 'background-size':\n case 'transition-property':\n case 'transition-timing-function':\n case 'cursor':\n case 'overflow':\n case 'overflow-x':\n case 'overflow-y':\n obj.type = 'select';\n break;\n case 'top':\n case 'right':\n case 'bottom':\n case 'left':\n case 'margin-top':\n case 'margin-right':\n case 'margin-bottom':\n case 'margin-left':\n case 'padding-top':\n case 'padding-right':\n case 'padding-bottom':\n case 'padding-left':\n case 'min-height':\n case 'min-width':\n case 'max-height':\n case 'max-width':\n case 'width':\n case 'height':\n case 'font-size':\n case 'letter-spacing':\n case 'line-height':\n case 'text-shadow-h':\n case 'text-shadow-v':\n case 'text-shadow-blur':\n case 'border-radius-c':\n case 'border-top-left-radius':\n case 'border-top-right-radius':\n case 'border-bottom-left-radius':\n case 'border-bottom-right-radius':\n case 'border-width':\n case 'box-shadow-h':\n case 'box-shadow-v':\n case 'box-shadow-blur':\n case 'box-shadow-spread':\n case 'transition-duration':\n case 'perspective':\n case 'transform-rotate-x':\n case 'transform-rotate-y':\n case 'transform-rotate-z':\n case 'transform-scale-x':\n case 'transform-scale-y':\n case 'transform-scale-z':\n case 'order':\n case 'flex-grow':\n case 'flex-shrink':\n case 'flex-basis':\n obj.type = 'integer';\n break;\n case 'margin':\n case 'padding':\n case 'border-radius':\n case 'border':\n case 'transform':\n obj.type = 'composite';\n break;\n case 'color':\n case 'text-shadow-color':\n case 'background-color':\n case 'border-color':\n case 'box-shadow-color':\n obj.type = 'color';\n break;\n case 'text-shadow':\n case 'box-shadow':\n case 'background':\n case 'transition':\n obj.type = 'stack';\n break;\n case 'background-image':\n obj.type = 'file';\n break;\n }\n\n // Defaults\n switch (prop) {\n case 'float':\n case 'background-color':\n case 'text-shadow':\n obj.defaults = 'none';\n break;\n case 'display':\n obj.defaults = 'block';\n break;\n case 'flex-direction':\n obj.defaults = 'row';\n break;\n case 'flex-wrap':\n obj.defaults = 'nowrap';\n break;\n case 'justify-content':\n obj.defaults = 'flex-start';\n break;\n case 'align-items':\n obj.defaults = 'stretch';\n break;\n case 'align-content':\n obj.defaults = 'stretch';\n break;\n case 'align-self':\n obj.defaults = 'auto';\n break;\n case 'position':\n obj.defaults = 'static';\n break;\n case 'margin-top':\n case 'margin-right':\n case 'margin-bottom':\n case 'margin-left':\n case 'padding-top':\n case 'padding-right':\n case 'padding-bottom':\n case 'padding-left':\n case 'text-shadow-h':\n case 'text-shadow-v':\n case 'text-shadow-blur':\n case 'border-radius-c':\n case 'box-shadow-h':\n case 'box-shadow-v':\n case 'box-shadow-spread':\n case 'perspective':\n case 'transform-rotate-x':\n case 'transform-rotate-y':\n case 'transform-rotate-z':\n case 'order':\n case 'flex-grow':\n obj.defaults = 0;\n break;\n case 'border-top-left-radius':\n case 'border-top-right-radius':\n case 'border-bottom-left-radius':\n case 'border-bottom-right-radius':\n obj.defaults = '0px';\n break;\n case 'transform-scale-x':\n case 'transform-scale-y':\n case 'transform-scale-z':\n case 'flex-shrink':\n obj.defaults = 1;\n break;\n case 'box-shadow-blur':\n obj.defaults = '5px';\n break;\n case 'top':\n case 'right':\n case 'bottom':\n case 'left':\n case 'min-height':\n case 'min-width':\n case 'max-height':\n case 'max-width':\n case 'width':\n case 'height':\n case 'background-size':\n case 'cursor':\n case 'flex-basis':\n obj.defaults = 'auto';\n break;\n case 'font-family':\n obj.defaults = 'Arial, Helvetica, sans-serif';\n break;\n case 'font-size':\n case 'border-width':\n obj.defaults = 'medium';\n break;\n case 'font-weight':\n obj.defaults = '400';\n break;\n case 'letter-spacing':\n case 'line-height':\n obj.defaults = 'normal';\n break;\n case 'color':\n case 'text-shadow-color':\n case 'border-color':\n case 'box-shadow-color':\n obj.defaults = 'black';\n break;\n case 'text-align':\n obj.defaults = 'left';\n break;\n case 'border-style':\n obj.defaults = 'solid';\n break;\n case 'box-shadow-type':\n obj.defaults = '';\n break;\n case 'background-repeat':\n obj.defaults = 'repeat';\n break;\n case 'background-position':\n obj.defaults = 'left top';\n break;\n case 'background-attachment':\n obj.defaults = 'scroll';\n break;\n case 'transition-property':\n obj.defaults = 'width';\n break;\n case 'transition-duration':\n obj.defaults = '2';\n break;\n case 'transition-timing-function':\n obj.defaults = 'ease';\n break;\n case 'overflow':\n case 'overflow-x':\n case 'overflow-y':\n obj.defaults = 'visible';\n break;\n }\n\n /*\n * Add styleable dependency on other properties. Allows properties to be\n * dynamically hidden or shown based on values of other properties.\n *\n * Property will be styleable if all of the properties (keys) in the\n * requires object have any of the values specified in the array.\n */\n switch (prop) {\n case 'flex-direction':\n case 'flex-wrap':\n case 'justify-content':\n case 'align-items':\n case 'align-content':\n obj.requires = { display: ['flex'] };\n break;\n case 'order':\n case 'flex-basis':\n case 'flex-grow':\n case 'flex-shrink':\n case 'align-self':\n obj.requiresParent = { display: ['flex'] };\n break;\n }\n\n // Units\n switch (prop) {\n case 'top':\n case 'bottom':\n case 'margin-top':\n case 'margin-bottom':\n case 'padding-top':\n case 'padding-bottom':\n case 'min-height':\n case 'max-height':\n case 'height':\n obj.units = ['px', '%', 'vh'];\n break;\n case 'right':\n case 'left':\n case 'margin-right':\n case 'margin-left':\n case 'padding-right':\n case 'padding-left':\n case 'min-width':\n case 'max-width':\n case 'width':\n obj.units = ['px', '%', 'vw'];\n break;\n case 'flex-basis':\n obj.units = ['px', '%', 'vw', 'vh'];\n break;\n case 'text-shadow-v':\n case 'text-shadow-h':\n case 'text-shadow-blur':\n case 'border-radius-c':\n case 'border-top-left-radius':\n case 'border-top-right-radius':\n case 'border-bottom-left-radius':\n case 'border-bottom-right-radius':\n case 'box-shadow-h':\n case 'box-shadow-v':\n obj.units = ['px', '%'];\n break;\n case 'font-size':\n case 'letter-spacing':\n case 'line-height':\n obj.units = ['px', 'em', 'rem', '%'];\n break;\n case 'border-width':\n obj.units = ['px', 'em'];\n break;\n case 'box-shadow-blur':\n case 'box-shadow-spread':\n case 'perspective':\n obj.units = ['px'];\n break;\n case 'transition-duration':\n obj.units = ['s'];\n break;\n case 'transform-rotate-x':\n case 'transform-rotate-y':\n case 'transform-rotate-z':\n obj.units = ['deg'];\n break;\n }\n\n // Min/Max\n switch (prop) {\n case 'padding-top':\n case 'padding-right':\n case 'padding-bottom':\n case 'padding-left':\n case 'min-height':\n case 'min-width':\n case 'max-height':\n case 'max-width':\n case 'width':\n case 'height':\n case 'font-size':\n case 'text-shadow-blur':\n case 'border-radius-c':\n case 'border-top-left-radius':\n case 'border-top-right-radius':\n case 'border-bottom-left-radius':\n case 'border-bottom-right-radius':\n case 'border-width':\n case 'box-shadow-blur':\n case 'transition-duration':\n case 'perspective':\n case 'flex-basis':\n obj.min = 0;\n break;\n }\n\n // Preview\n switch (prop) {\n case 'text-shadow':\n case 'box-shadow':\n case 'background':\n obj.preview = true;\n break;\n }\n\n // Detached\n switch (prop) {\n case 'background':\n obj.detached = true;\n break;\n }\n\n // Functions\n switch (prop) {\n case 'transform-rotate-x':\n obj.functionName = 'rotateX';\n break;\n case 'transform-rotate-y':\n obj.functionName = 'rotateY';\n break;\n case 'transform-rotate-z':\n obj.functionName = 'rotateZ';\n break;\n case 'transform-scale-x':\n obj.functionName = 'scaleX';\n break;\n case 'transform-scale-y':\n obj.functionName = 'scaleY';\n break;\n case 'transform-scale-z':\n obj.functionName = 'scaleZ';\n break;\n case 'background-image':\n obj.functionName = 'url';\n break;\n }\n\n // Options\n switch (prop) {\n case 'float':\n obj.list = [{ value: 'none' }, { value: 'left' }, { value: 'right' }];\n break;\n case 'display':\n obj.list = [\n { value: 'block' },\n { value: 'inline' },\n { value: 'inline-block' },\n { value: 'flex' },\n { value: 'none' }\n ];\n break;\n case 'flex-direction':\n obj.list = [\n { value: 'row' },\n { value: 'row-reverse' },\n { value: 'column' },\n { value: 'column-reverse' }\n ];\n break;\n case 'flex-wrap':\n obj.list = [\n { value: 'nowrap' },\n { value: 'wrap' },\n { value: 'wrap-reverse' }\n ];\n break;\n case 'justify-content':\n obj.list = [\n { value: 'flex-start' },\n { value: 'flex-end' },\n { value: 'center' },\n { value: 'space-between' },\n { value: 'space-around' },\n { value: 'space-evenly' }\n ];\n break;\n case 'align-items':\n obj.list = [\n { value: 'flex-start' },\n { value: 'flex-end' },\n { value: 'center' },\n { value: 'baseline' },\n { value: 'stretch' }\n ];\n break;\n case 'align-content':\n obj.list = [\n { value: 'flex-start' },\n { value: 'flex-end' },\n { value: 'center' },\n { value: 'space-between' },\n { value: 'space-around' },\n { value: 'stretch' }\n ];\n break;\n case 'align-self':\n obj.list = [\n { value: 'auto' },\n { value: 'flex-start' },\n { value: 'flex-end' },\n { value: 'center' },\n { value: 'baseline' },\n { value: 'stretch' }\n ];\n break;\n case 'position':\n obj.list = [\n { value: 'static' },\n { value: 'relative' },\n { value: 'absolute' },\n { value: 'fixed' }\n ];\n break;\n case 'font-family':\n var ss = ', sans-serif';\n var fonts = [\n 'Arial, Helvetica' + ss,\n 'Arial Black, Gadget' + ss,\n 'Brush Script MT' + ss,\n 'Comic Sans MS, cursive' + ss,\n 'Courier New, Courier, monospace',\n 'Georgia, serif',\n 'Helvetica' + ss,\n 'Impact, Charcoal' + ss,\n 'Lucida Sans Unicode, Lucida Grande' + ss,\n 'Tahoma, Geneva' + ss,\n 'Times New Roman, Times, serif',\n 'Trebuchet MS, Helvetica' + ss,\n 'Verdana, Geneva' + ss\n ];\n obj.list = [];\n for (var j = 0, l = fonts.length; j < l; j++) {\n var font = {};\n font.value = fonts[j];\n font.name = fonts[j].split(',')[0];\n obj.list.push(font);\n }\n break;\n case 'font-weight':\n obj.list = [\n { value: '100', name: 'Thin' },\n { value: '200', name: 'Extra-Light' },\n { value: '300', name: 'Light' },\n { value: '400', name: 'Normal' },\n { value: '500', name: 'Medium' },\n { value: '600', name: 'Semi-Bold' },\n { value: '700', name: 'Bold' },\n { value: '800', name: 'Extra-Bold' },\n { value: '900', name: 'Ultra-Bold' }\n ];\n break;\n case 'text-align':\n obj.list = [\n { value: 'left' },\n { value: 'center' },\n { value: 'right' },\n { value: 'justify' }\n ];\n break;\n case 'border-style':\n obj.list = [\n { value: 'none' },\n { value: 'solid' },\n { value: 'dotted' },\n { value: 'dashed' },\n { value: 'double' },\n { value: 'groove' },\n { value: 'ridge' },\n { value: 'inset' },\n { value: 'outset' }\n ];\n break;\n case 'box-shadow-type':\n obj.list = [\n { value: '', name: 'Outside' },\n { value: 'inset', name: 'Inside' }\n ];\n break;\n case 'background-repeat':\n obj.list = [\n { value: 'repeat' },\n { value: 'repeat-x' },\n { value: 'repeat-y' },\n { value: 'no-repeat' }\n ];\n break;\n case 'background-position':\n obj.list = [\n { value: 'left top' },\n { value: 'left center' },\n { value: 'left bottom' },\n { value: 'right top' },\n { value: 'right center' },\n { value: 'right bottom' },\n { value: 'center top' },\n { value: 'center center' },\n { value: 'center bottom' }\n ];\n break;\n case 'background-attachment':\n obj.list = [\n { value: 'scroll' },\n { value: 'fixed' },\n { value: 'local' }\n ];\n break;\n case 'background-size':\n obj.list = [\n { value: 'auto' },\n { value: 'cover' },\n { value: 'contain' }\n ];\n break;\n case 'transition-property':\n obj.list = [\n { value: 'all' },\n { value: 'width' },\n { value: 'height' },\n { value: 'background-color' },\n { value: 'transform' },\n { value: 'box-shadow' },\n { value: 'opacity' }\n ];\n break;\n case 'transition-timing-function':\n obj.list = [\n { value: 'linear' },\n { value: 'ease' },\n { value: 'ease-in' },\n { value: 'ease-out' },\n { value: 'ease-in-out' }\n ];\n break;\n case 'cursor':\n obj.list = [\n { value: 'auto' },\n { value: 'pointer' },\n { value: 'copy' },\n { value: 'crosshair' },\n { value: 'grab' },\n { value: 'grabbing' },\n { value: 'help' },\n { value: 'move' },\n { value: 'text' }\n ];\n break;\n case 'overflow':\n case 'overflow-x':\n case 'overflow-y':\n obj.list = [\n { value: 'visible' },\n { value: 'hidden' },\n { value: 'scroll' },\n { value: 'auto' }\n ];\n break;\n }\n\n // Properties\n switch (prop) {\n case 'margin':\n obj.properties = this.build([\n 'margin-top',\n 'margin-right',\n 'margin-bottom',\n 'margin-left'\n ]);\n break;\n case 'padding':\n obj.properties = this.build([\n 'padding-top',\n 'padding-right',\n 'padding-bottom',\n 'padding-left'\n ]);\n break;\n case 'text-shadow':\n obj.properties = this.build([\n 'text-shadow-h',\n 'text-shadow-v',\n 'text-shadow-blur',\n 'text-shadow-color'\n ]);\n break;\n case 'border':\n obj.properties = this.build([\n 'border-width',\n 'border-style',\n 'border-color'\n ]);\n break;\n case 'border-radius':\n obj.properties = this.build([\n 'border-top-left-radius',\n 'border-top-right-radius',\n 'border-bottom-right-radius',\n 'border-bottom-left-radius'\n ]);\n break;\n case 'box-shadow':\n obj.properties = this.build([\n 'box-shadow-h',\n 'box-shadow-v',\n 'box-shadow-blur',\n 'box-shadow-spread',\n 'box-shadow-color',\n 'box-shadow-type'\n ]);\n break;\n case 'background':\n obj.properties = this.build([\n 'background-image',\n 'background-repeat',\n 'background-position',\n 'background-attachment',\n 'background-size'\n ]);\n break;\n case 'transition':\n obj.properties = this.build([\n 'transition-property',\n 'transition-duration',\n 'transition-timing-function'\n ]);\n break;\n case 'transform':\n obj.properties = this.build([\n 'transform-rotate-x',\n 'transform-rotate-y',\n 'transform-rotate-z',\n 'transform-scale-x',\n 'transform-scale-y',\n 'transform-scale-z'\n ]);\n break;\n }\n\n objs.push(obj);\n }\n\n return objs;\n }\n});\n","import { Model } from 'common';\nimport { extend } from 'underscore';\nimport Properties from './Properties';\nimport PropertyFactory from './PropertyFactory';\n\n/**\n * @typedef Sector\n * @property {String} id Sector id, eg. `typography`\n * @property {String} name Sector name, eg. `Typography`\n * @property {Boolean} [open=true] Indicates the open state.\n * @property {Array} [properties=[]] Indicate an array of Property defintions\n *\n * [Property]: property.html\n */\nexport default class Sector extends Model {\n defaults() {\n return {\n id: '',\n name: '',\n open: true,\n buildProps: '',\n extendBuilded: 1,\n properties: []\n };\n }\n\n initialize(opts) {\n const o = opts || {};\n const builded = this.buildProperties(o.buildProps);\n const name = this.get('name') || '';\n let props = [];\n !this.get('id') && this.set('id', name.replace(/ /g, '_').toLowerCase());\n\n if (!builded) props = this.get('properties');\n else props = this.extendProperties(builded);\n\n const propsModel = new Properties(props);\n propsModel.sector = this;\n this.set('properties', propsModel);\n }\n\n /**\n * Get sector id.\n * @returns {String}\n */\n getId() {\n return this.get('id');\n }\n\n /**\n * Get sector name.\n * @returns {String}\n */\n getName() {\n return this.get('name');\n }\n\n /**\n * Update sector name.\n * @param {String} value New sector name\n */\n setName(value) {\n return this.set('name', value);\n }\n\n /**\n * Check if the sector is open\n * @returns {Boolean}\n */\n isOpen() {\n return !!this.get('open');\n }\n\n /**\n * Update Sector open state\n * @param {Boolean} value\n */\n setOpen(value) {\n return this.set('open', value);\n }\n\n /**\n * Get sector properties.\n * @returns {Array<[Property]>}\n */\n getProperties() {\n const props = this.get('properties');\n return props.models ? [...props.models] : props;\n }\n\n /**\n * Extend properties\n * @param {Array} props Start properties\n * @param {Array} moProps Model props\n * @param {Boolean} ex Returns the same amount of passed model props\n * @return {Array} Final props\n * @private\n */\n extendProperties(props, moProps, ex) {\n var pLen = props.length;\n var mProps = moProps || this.get('properties');\n var ext = this.get('extendBuilded');\n var isolated = [];\n\n for (var i = 0, len = mProps.length; i < len; i++) {\n var mProp = mProps[i];\n var found = 0;\n\n for (var j = 0; j < pLen; j++) {\n var prop = props[j];\n if (mProp.property == prop.property || mProp.id == prop.property) {\n // Check for nested properties\n var mPProps = mProp.properties;\n if (mPProps && mPProps.length) {\n mProp.properties = this.extendProperties(\n prop.properties || [],\n mPProps,\n 1\n );\n }\n props[j] = ext ? extend(prop, mProp) : mProp;\n isolated[j] = props[j];\n found = 1;\n continue;\n }\n }\n\n if (!found) {\n props.push(mProp);\n isolated.push(mProp);\n }\n }\n\n return ex ? isolated.filter(i => i) : props;\n }\n\n /**\n * Build properties\n * @param {Array} propr Array of props as sting\n * @return {Array}\n * @private\n */\n buildProperties(props) {\n var r;\n var buildP = props || [];\n\n if (!buildP.length) return;\n\n if (!this.propFactory) this.propFactory = new PropertyFactory();\n\n r = this.propFactory.build(buildP);\n\n return r;\n }\n}\n","import { Collection } from 'common';\nimport Sector from './Sector';\n\nexport default class Sectors extends Collection {\n initialize() {\n this.listenTo(this, 'reset', this.onReset);\n }\n\n onReset(models, opts = {}) {\n const prev = opts.previousModels || [];\n prev.forEach(sect => sect.get('properties').reset());\n }\n}\n\nSectors.prototype.model = Sector;\n","import { View } from 'backbone';\nimport html from 'utils/html';\nimport PropertiesView from './PropertiesView';\n\nexport default class SectorView extends View {\n template({ pfx, label }) {\n return html`\n
\n \n ${label}\n
\n `;\n }\n\n events() {\n return {\n 'click [data-sector-title]': 'toggle'\n };\n }\n\n initialize(o) {\n this.config = o.config || {};\n this.em = this.config.em;\n this.pfx = this.config.stylePrefix || '';\n this.target = o.target || {};\n this.propTarget = o.propTarget || {};\n this.caretR = 'fa-caret-right';\n this.caretD = 'fa-caret-down';\n const model = this.model;\n this.listenTo(model, 'change:open', this.updateOpen);\n this.listenTo(model, 'updateVisibility', this.updateVisibility);\n this.listenTo(model, 'destroy remove', this.remove);\n }\n\n /**\n * If all properties are hidden this will hide the sector\n */\n updateVisibility() {\n var show;\n this.model.get('properties').each(prop => {\n if (prop.get('visible')) {\n show = 1;\n }\n });\n this.el.style.display = show ? '' : 'none';\n }\n\n /**\n * Update visibility\n */\n updateOpen() {\n if (this.model.get('open')) this.show();\n else this.hide();\n }\n\n /**\n * Show the content of the sector\n * */\n show() {\n this.$el.addClass(this.pfx + 'open');\n this.getPropertiesEl().style.display = '';\n this.$caret.removeClass(this.caretR).addClass(this.caretD);\n }\n\n /**\n * Hide the content of the sector\n * */\n hide() {\n this.$el.removeClass(this.pfx + 'open');\n this.getPropertiesEl().style.display = 'none';\n this.$caret.removeClass(this.caretD).addClass(this.caretR);\n }\n\n getPropertiesEl() {\n return this.$el.find(`.${this.pfx}properties`).get(0);\n }\n\n /**\n * Toggle visibility\n * */\n toggle(e) {\n const { model } = this;\n const v = model.get('open') ? 0 : 1;\n model.set('open', v);\n }\n\n render() {\n const { pfx, model, em, $el } = this;\n const { id, name } = model.attributes;\n const label = (em && em.t(`styleManager.sectors.${id}`)) || name;\n $el.html(this.template({ pfx, label }));\n this.$caret = $el.find(`#${pfx}caret`);\n this.renderProperties();\n $el.attr('class', `${pfx}sector ${pfx}sector__${id} no-select`);\n this.updateOpen();\n return this;\n }\n\n renderProperties() {\n const { model, target, propTarget, config } = this;\n const objs = model.get('properties');\n\n if (objs) {\n const view = new PropertiesView({\n collection: objs,\n target,\n propTarget,\n config\n });\n this.$el.append(view.render().el);\n }\n }\n}\n","import Backbone from 'backbone';\nimport { extend, isString, isArray } from 'underscore';\nimport { isTaggableNode } from 'utils/mixins';\nimport { appendAtIndex } from 'utils/dom';\nimport SectorView from './SectorView';\n\nconst helperCls = 'hc-state';\n\nexport default Backbone.View.extend({\n initialize(o = {}) {\n const config = o.config || {};\n this.pfx = config.stylePrefix || '';\n this.ppfx = config.pStylePrefix || '';\n this.target = o.target || {};\n this.config = config;\n\n // The target that will emit events for properties\n const target = {};\n extend(target, Backbone.Events);\n const body = document.body;\n const dummy = document.createElement(`el-${new Date().getTime()}`);\n body.appendChild(dummy);\n target.computedDefault = { ...window.getComputedStyle(dummy) };\n body.removeChild(dummy);\n this.propTarget = target;\n const coll = this.collection;\n const events =\n 'component:toggled component:update:classes change:state change:device frame:resized';\n this.listenTo(coll, 'add', this.addTo);\n this.listenTo(coll, 'reset', this.render);\n this.listenTo(this.target, events, this.targetUpdated);\n },\n\n remove() {\n Backbone.View.prototype.remove.apply(this, arguments);\n ['target', 'config', 'propTarget'].forEach(i => (this[i] = {}));\n },\n\n /**\n * Add to collection\n * @param {Object} model Model\n * @return {Object}\n * @private\n * */\n addTo(model, coll, opts = {}) {\n this.addToCollection(model, null, opts);\n },\n\n toggleStateCls(targets = [], enable) {\n targets.forEach(trg => {\n const el = trg.getEl();\n el && el.classList && el.classList[enable ? 'add' : 'remove'](helperCls);\n });\n },\n\n /**\n * Fired when target is updated\n * @private\n */\n targetUpdated(trg) {\n const em = this.target;\n const pt = this.propTarget;\n const targets = em.getSelectedAll();\n let model = em.getSelected();\n const mdToClear = trg && !!trg.toHTML ? trg : model;\n\n // Clean components\n mdToClear && this.toggleStateCls([mdToClear]);\n if (!model) return;\n\n const config = em.get('Config');\n const state = !config.devicePreviewMode ? em.get('state') : '';\n const { componentFirst } = em.get('SelectorManager').getConfig();\n const el = model.getEl();\n pt.helper = null;\n pt.targets = null;\n\n // Create computed style container\n if (el && isTaggableNode(el)) {\n const stateStr = state ? `:${state}` : null;\n pt.computed = window.getComputedStyle(el, stateStr);\n }\n\n // Create a new rule for the state as a helper\n const appendStateRule = (style = {}) => {\n const cc = em.get('CssComposer');\n const rules = cc.getAll();\n let helperRule = cc.getClassRule(helperCls);\n\n if (!helperRule) {\n helperRule = cc.setClassRule(helperCls);\n } else {\n // I will make it last again, otherwise it could be overridden\n rules.remove(helperRule);\n rules.add(helperRule);\n }\n\n helperRule.set('important', 1);\n helperRule.setStyle(style);\n pt.helper = helperRule;\n };\n\n const sm = em.get('StyleManager');\n const target = sm.getModelToStyle(model);\n\n if (state) {\n appendStateRule(target.getStyle());\n this.toggleStateCls(targets, 1);\n }\n\n pt.model = target;\n pt.parentRules = sm.getParentRules(target, state);\n if (componentFirst) {\n pt.targets = targets.map(t => sm.getModelToStyle(t)).filter(Boolean);\n }\n pt.trigger('update');\n em.trigger('styleManager:update');\n },\n\n /**\n * Select different target for the Style Manager.\n * It could be a Component, CSSRule, or a string of any CSS selector\n * @param {Component|CSSRule|String|Array} target\n * @return {Array} Array of Components/CSSRules\n */\n setTarget(target, opts = {}) {\n const em = this.target;\n const trgs = isArray(target) ? target : [target];\n const { targetIsClass, stylable } = opts;\n const models = [];\n\n trgs.forEach(target => {\n let model = target;\n\n if (isString(target)) {\n let rule;\n const rules = em.get('CssComposer').getAll();\n\n if (targetIsClass) {\n rule = rules.filter(\n rule => rule.get('selectors').getFullString() === target\n )[0];\n }\n\n if (!rule) {\n rule = rules.filter(rule => rule.get('selectorsAdd') === target)[0];\n }\n\n if (!rule) {\n rule = rules.add({ selectors: [], selectorsAdd: target });\n }\n\n stylable && rule.set({ stylable });\n model = rule;\n }\n\n models.push(model);\n });\n\n const pt = this.propTarget;\n pt.targets = models;\n pt.trigger('update', { targets: models });\n return models;\n },\n\n /**\n * Add new object to collection\n * @param {Object} model Model\n * @param {Object} fragmentEl collection\n * @return {Object} Object created\n * @private\n * */\n addToCollection(model, fragmentEl, opts = {}) {\n const { pfx, target, propTarget, config, el } = this;\n const appendTo = fragmentEl || el;\n const rendered = new SectorView({\n model,\n id: `${pfx}${model.get('id')}`,\n name: model.get('name'),\n properties: model.get('properties'),\n target,\n propTarget,\n config\n }).render().el;\n appendAtIndex(appendTo, rendered, opts.at);\n\n return rendered;\n },\n\n render() {\n const frag = document.createDocumentFragment();\n const $el = this.$el;\n const pfx = this.pfx;\n const ppfx = this.ppfx;\n $el.empty();\n this.collection.each(model => this.addToCollection(model, frag));\n $el.append(frag);\n $el.addClass(`${pfx}sectors ${ppfx}one-bg ${ppfx}two-color`);\n return this;\n }\n});\n","/**\n * With Style Manager you build categories (called sectors) of CSS properties which could be used to customize the style of components.\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/style_manager/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * styleManager: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const styleManager = editor.StyleManager;\n * ```\n *\n * * [getConfig](#getconfig)\n * * [addSector](#addsector)\n * * [getSector](#getsector)\n * * [removeSector](#removesector)\n * * [getSectors](#getsectors)\n * * [addProperty](#addproperty)\n * * [getProperty](#getproperty)\n * * [removeProperty](#removeproperty)\n * * [getProperties](#getproperties)\n * * [getModelToStyle](#getmodeltostyle)\n * * [addType](#addtype)\n * * [getType](#gettype)\n * * [getTypes](#gettypes)\n * * [createType](#createtype)\n *\n * [Sector]: sector.html\n * [CssRule]: css_rule.html\n * [Component]: component.html\n *\n * @module StyleManager\n */\n\nimport {\n isElement,\n isUndefined,\n isArray,\n isString,\n debounce\n} from 'underscore';\nimport Module from 'common/module';\nimport { Model } from 'common';\nimport defaults from './config/config';\nimport Sector from './model/Sector';\nimport Sectors from './model/Sectors';\nimport Properties from './model/Properties';\nimport PropertyFactory from './model/PropertyFactory';\nimport SectorsView from './view/SectorsView';\n\nexport default () => {\n var c = {};\n let properties;\n var sectors, SectView;\n\n return {\n ...Module,\n\n Sector,\n\n PropertyFactory: PropertyFactory(),\n\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'StyleManager',\n\n /**\n * Get configuration object\n * @return {Object}\n */\n getConfig() {\n return c;\n },\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @private\n */\n init(config) {\n c = { ...defaults, ...config };\n const ppfx = c.pStylePrefix;\n const { em } = c;\n this.em = em;\n if (ppfx) c.stylePrefix = ppfx + c.stylePrefix;\n properties = new Properties();\n sectors = new Sectors([], c);\n this.model = new Model({ targets: [] });\n const toListen =\n 'component:toggled component:update:classes change:state change:device frame:resized selector:type';\n em.on(\n toListen,\n debounce(() => {\n this.select(em.getSelectedAll());\n em.trigger('style:custom');\n })\n );\n\n return this;\n },\n\n onLoad() {\n // Use silent as sectors' view will be created and rendered on StyleManager.render\n sectors.add(c.sectors, { silent: true });\n },\n\n postRender() {\n const elTo = this.getConfig().appendTo;\n\n if (elTo) {\n const el = isElement(elTo) ? elTo : document.querySelector(elTo);\n if (!el) return this.__logWarn('\"appendTo\" element not found');\n el.appendChild(this.render());\n }\n },\n\n /**\n * Add new sector to the collection. If the sector with the same id already exists,\n * that one will be returned.\n * @param {string} id Sector id\n * @param {Object} sector Object representing sector\n * @param {string} [sector.name=''] Sector's label\n * @param {Boolean} [sector.open=true] Indicates if the sector should be opened\n * @param {Array} [sector.properties=[]] Array of properties\n * @param {Object} [options={}] Options\n * @return {[Sector]} Added Sector\n * @example\n * const sector = styleManager.addSector('mySector',{\n * name: 'My sector',\n * open: true,\n * properties: [{ name: 'My property'}]\n * }, { at: 0 });\n * // With `at: 0` we place the new sector at the beginning of the collection\n * */\n addSector(id, sector, options = {}) {\n let result = this.getSector(id);\n\n if (!result) {\n sector.id = id;\n result = sectors.add(sector, options);\n }\n\n return result;\n },\n\n /**\n * Get sector by id\n * @param {string} id Sector id\n * @return {[Sector]|null}\n * @example\n * const sector = styleManager.getSector('mySector');\n * */\n getSector(id, opts = {}) {\n const res = sectors.where({ id })[0];\n !res && opts.warn && this._logNoSector(id);\n return res || null;\n },\n\n /**\n * Remove a sector by id\n * @param {string} id Sector id\n * @return {[Sector]} Removed sector\n * @example\n * const removed = styleManager.removeSector('mySector');\n */\n removeSector(id) {\n return this.getSectors().remove(this.getSector(id, { warn: 1 }));\n },\n\n /**\n * Get all sectors\n * @returns {Collection<[Sector]>} Collection of sectors\n * @example\n * const sectors = styleManager.getSectors();\n * */\n getSectors(opts = {}) {\n return sectors && sectors.models\n ? opts.array\n ? [...sectors.models]\n : sectors\n : [];\n },\n\n /**\n * Add property to the sector identified by id\n * @param {string} sectorId Sector id\n * @param {Object} property Property object\n * @param {string} [property.name=''] Name of the property\n * @param {string} [property.property=''] CSS property, eg. `min-height`\n * @param {string} [property.type=''] Type of the property: integer | radio | select | color | file | composite | stack\n * @param {Array} [property.units=[]] Unit of measure available, eg. ['px','%','em']. Only for integer type\n * @param {string} [property.unit=''] Default selected unit from `units`. Only for integer type\n * @param {number} [property.min=null] Min possible value. Only for integer type\n * @param {number} [property.max=null] Max possible value. Only for integer type\n * @param {string} [property.defaults=''] Default value\n * @param {string} [property.info=''] Some description\n * @param {string} [property.icon=''] Class name. If exists no text will be displayed\n * @param {Boolean} [property.preview=false] Show layers preview. Only for stack type\n * @param {string} [property.functionName=''] Indicates if value need to be wrapped in some function, for istance `transform: rotate(90deg)`\n * @param {Array} [property.properties=[]] Nested properties for composite and stack type\n * @param {Array} [property.layers=[]] Layers for stack properties\n * @param {Array} [property.list=[]] List of possible options for radio and select types\n * @param {Object} [options={}] Options\n * @return {Property|null} Added Property or `null` in case sector doesn't exist\n * @example\n * var property = styleManager.addProperty('mySector',{\n * name: 'Minimum height',\n * property: 'min-height',\n * type: 'select',\n * defaults: '100px',\n * list: [{\n * value: '100px',\n * name: '100',\n * },{\n * value: '200px',\n * name: '200',\n * }],\n * }, { at: 0 });\n * // With `at: 0` we place the new property at the beginning of the collection\n */\n addProperty(sectorId, property, opts = {}) {\n const sector = this.getSector(sectorId, { warn: 1 });\n let prop = null;\n if (sector) prop = sector.get('properties').add(property, opts);\n\n return prop;\n },\n\n /**\n * Get property by its CSS name and sector id\n * @param {string} sectorId Sector id\n * @param {string} name CSS property name (or id), eg. 'min-height'\n * @return {Property|null}\n * @example\n * var property = styleManager.getProperty('mySector','min-height');\n */\n getProperty(sectorId, name) {\n const sector = this.getSector(sectorId, { warn: 1 });\n let prop;\n\n if (sector) {\n prop = sector\n .get('properties')\n .filter(\n prop => prop.get('property') === name || prop.get('id') === name\n )[0];\n }\n\n return prop || null;\n },\n\n /**\n * Remove a property from the sector\n * @param {string} sectorId Sector id\n * @param {string} name CSS property name, eg. 'min-height'\n * @return {Property} Removed property\n * @example\n * const property = styleManager.removeProperty('mySector', 'min-height');\n */\n removeProperty(sectorId, name) {\n const props = this.getProperties(sectorId);\n return props && props.remove(this.getProperty(sectorId, name));\n },\n\n /**\n * Get properties of the sector\n * @param {string} sectorId Sector id\n * @return {Properties} Collection of properties\n * @example\n * var properties = styleManager.getProperties('mySector');\n */\n getProperties(sectorId) {\n let props = null;\n const sector = this.getSector(sectorId, { warn: 1 });\n if (sector) props = sector.get('properties');\n\n return props;\n },\n\n /**\n * Get what to style inside Style Manager. If you select the component\n * without classes the entity is the Component itself and all changes will\n * go inside its 'style' property. Otherwise, if the selected component has\n * one or more classes, the function will return the corresponding CSS Rule\n * @param {Model} model\n * @return {Model}\n */\n getModelToStyle(model, options = {}) {\n const em = c.em;\n const { skipAdd } = options;\n const classes = model.get('classes');\n const id = model.getId();\n\n if (em && classes) {\n const config = em.getConfig();\n const um = em.get('UndoManager');\n const cssC = em.get('CssComposer');\n const sm = em.get('SelectorManager');\n const smConf = sm ? sm.getConfig() : {};\n const state = !config.devicePreviewMode ? em.get('state') : '';\n const valid = classes.getStyleable();\n const hasClasses = valid.length;\n const useClasses = !smConf.componentFirst || options.useClasses;\n const addOpts = { noCount: 1 };\n const opts = { state, addOpts };\n let rule;\n\n // I stop undo manager here as after adding the CSSRule (generally after\n // selecting the component) and calling undo() it will remove the rule from\n // the collection, therefore updating it in style manager will not affect it\n // #268\n um.stop();\n\n if (hasClasses && useClasses) {\n const deviceW = em.getCurrentMedia();\n rule = cssC.get(valid, state, deviceW);\n\n if (!rule && !skipAdd) {\n rule = cssC.add(valid, state, deviceW, {}, addOpts);\n }\n } else if (config.avoidInlineStyle) {\n rule = cssC.getIdRule(id, opts);\n !rule && !skipAdd && (rule = cssC.setIdRule(id, {}, opts));\n if (model.is('wrapper')) rule.set('wrapper', 1, addOpts);\n }\n\n rule && (model = rule);\n um.start();\n }\n\n return model;\n },\n\n getParentRules(target, state) {\n const { em } = c;\n let result = [];\n\n if (em && target) {\n const cssC = em.get('CssComposer');\n const cssGen = em.get('CodeManager').getGenerator('css');\n const all = cssC\n .getRules(target.getSelectors().getFullString())\n .filter(rule => (state ? rule.get('state') === state : 1))\n .sort(cssGen.sortRules)\n .reverse();\n result = all.slice(all.indexOf(target) + 1);\n }\n\n return result;\n },\n\n /**\n * Add new property type\n * @param {string} id Type ID\n * @param {Object} definition Definition of the type. Each definition contains\n * `model` (business logic), `view` (presentation logic)\n * and `isType` function which recognize the type of the\n * passed entity\n *@example\n * styleManager.addType('my-custom-prop', {\n * create({ props, change }) {\n * const el = document.createElement('div');\n * el.innerHTML = '';\n * const inputEl = el.querySelector('.my-input');\n * inputEl.addEventListener('change', event => change({ event })); // change will trigger the emit\n * inputEl.addEventListener('input', event => change({ event, complete: false }));\n * return el;\n * },\n * emit({ props, updateStyle }, { event, complete }) {\n * const { value } = event.target;\n * const valueRes = value + 'px';\n * // Pass a string value for the exact CSS property or an object containing multiple properties\n * // eg. updateStyle({ [props.property]: valueRes, color: 'red' });\n * updateStyle(valueRes, { complete });\n * },\n * update({ value, el }) {\n * el.querySelector('.my-input').value = parseInt(value, 10);\n * },\n * destroy() {\n * // In order to prevent memory leaks, use this method to clean, eventually, created instances, global event listeners, etc.\n * }\n *})\n */\n addType(id, definition) {\n properties.addType(id, definition);\n },\n\n /**\n * Get type\n * @param {string} id Type ID\n * @return {Object} Type definition\n */\n getType(id) {\n return properties.getType(id);\n },\n\n /**\n * Get all types\n * @return {Array}\n */\n getTypes() {\n return properties.getTypes();\n },\n\n /**\n * Create new property from type\n * @param {string} id Type ID\n * @param {Object} [options={}] Options\n * @param {Object} [options.model={}] Custom model object\n * @param {Object} [options.view={}] Custom view object\n * @return {PropertyView}\n * @example\n * const propView = styleManager.createType('integer', {\n * model: {units: ['px', 'rem']}\n * });\n * propView.render();\n * propView.model.on('change:value', ...);\n * someContainer.appendChild(propView.el);\n */\n createType(id, { model = {}, view = {} } = {}) {\n const type = this.getType(id);\n\n if (type) {\n return new type.view({\n model: new type.model(model),\n config: c,\n ...view\n });\n }\n },\n\n setTarget(target, opts) {\n return SectView.setTarget(target, opts);\n },\n\n getTargets() {\n const { propTarget } = SectView || {};\n return (propTarget && propTarget.targets) || [];\n },\n\n /**\n * Select different target for the Style Manager.\n * It could be a Component, CSSRule, or a string of any CSS selector\n * @param {[Component]|[CSSRule]|String} target\n * @return {Array<[Component]|[CSSRule]>} Array containing selected Components or CSSRules\n * @private\n */\n select(target, opts = {}) {\n const { em } = this;\n const trgs = isArray(target) ? target : [target];\n const { stylable } = opts;\n const cssc = em.get('CssComposer');\n let targets = [];\n\n trgs.filter(Boolean).forEach(target => {\n let model = target;\n\n if (isString(target)) {\n const rule = cssc.getRule(target) || cssc.setRule(target);\n !isUndefined(stylable) && rule.set({ stylable });\n model = rule;\n }\n\n targets.push(model);\n });\n\n targets = targets.map(t => this.getModelToStyle(t));\n const lastTarget = targets.slice().reverse()[0];\n const lastTargetParents = this.getParentRules(lastTarget);\n this.model.set({ targets, lastTarget, lastTargetParents });\n\n // Update all property values\n // if (lastTarget && em.getConfig('customUI')) {\n // const style = lastTarget.getStyle();\n // sectors.map(sector => {\n // sector.getProperties().map(prop => {\n // const value = style[prop.getName()];\n // !isUndefined(value) && prop.setValue(value);\n // })\n // })\n // }\n\n return targets;\n },\n\n getSelected() {\n return this.model.get('targets');\n },\n\n getLastSelected() {\n return this.model.get('lastTarget') || null;\n },\n\n getSelectedParents() {\n return this.model.get('lastTargetParents') || [];\n },\n\n getEmitter() {\n return SectView.propTarget;\n },\n\n /**\n * Render sectors and properties\n * @return {HTMLElement}\n * @private\n * */\n render() {\n const el = SectView && SectView.el;\n SectView = new SectorsView({\n el,\n collection: sectors,\n target: c.em,\n config: c\n });\n return SectView.render().el;\n },\n\n _logNoSector(sectorId) {\n const { em } = this;\n em && em.logWarning(`'${sectorId}' sector not found`);\n },\n\n destroy() {\n [properties, sectors].forEach(coll => {\n coll.reset();\n coll.stopListening();\n });\n SectView && SectView.remove();\n [c, properties, sectors, SectView].forEach(i => (i = {}));\n this.em = {};\n }\n };\n};\n","export default {\n // Style prefix\n stylePrefix: 'cm-',\n\n inlineCss: false\n};\n","import { bindAll } from 'underscore';\nimport Backbone from 'backbone';\nimport { hasWin } from 'utils/mixins';\n\nlet CodeMirror;\n\nif (hasWin()) {\n CodeMirror = require('codemirror/lib/codemirror');\n require('codemirror/mode/htmlmixed/htmlmixed');\n require('codemirror/mode/css/css');\n require('codemirror-formatting');\n}\n\nexport default Backbone.Model.extend({\n CodeMirror,\n\n defaults: {\n input: '',\n label: '',\n codeName: '',\n theme: 'hopscotch',\n readOnly: true,\n lineNumbers: true\n },\n\n /** @inheritdoc */\n init(el) {\n bindAll(this, 'onChange');\n this.editor = CodeMirror.fromTextArea(el, {\n dragDrop: false,\n lineWrapping: true,\n mode: this.get('codeName'),\n ...this.attributes\n });\n this.element = el;\n this.editor.on('change', this.onChange);\n\n return this;\n },\n\n onChange() {\n this.trigger('update', this);\n },\n\n getEditor() {\n return this.editor;\n },\n\n /**\n * The element where the viewer is attached\n * @return {HTMLElement}\n */\n getElement() {\n return this.element;\n },\n\n /**\n * Set the element which contains the viewer attached.\n * Generally, it should be just a textarea, but some editor might require\n * a container for it some in that case this method can be used\n * @param {HTMLElement} el\n * @return {self}\n */\n setElement(el) {\n this.element = el;\n return this;\n },\n\n /**\n * Refresh the viewer\n * @return {self}\n */\n refresh() {\n this.getEditor().refresh();\n return this;\n },\n\n /**\n * Focus the viewer\n * @return {self}\n */\n focus() {\n this.getEditor().focus();\n return this;\n },\n\n getContent() {\n const ed = this.getEditor();\n return ed && ed.getValue();\n },\n\n /** @inheritdoc */\n setContent(v, opts = {}) {\n const { editor } = this;\n if (!editor) return;\n editor.setValue(v);\n\n if (editor.autoFormatRange) {\n CodeMirror.commands.selectAll(editor);\n editor.autoFormatRange(editor.getCursor(true), editor.getCursor(false));\n CodeMirror.commands.goDocStart(editor);\n }\n\n !opts.noRefresh && setTimeout(() => this.refresh());\n }\n});\n","import { Model } from 'backbone';\n\nexport default class HTMLGenerator extends Model {\n build(model, opts = {}) {\n const models = model.components();\n const htmlOpts = {};\n const { em } = opts;\n\n // Remove unnecessary IDs\n if (opts.cleanId && em) {\n const rules = em.get('CssComposer').getAll();\n const idRules = rules\n .toJSON()\n .map(rule => {\n const sels = rule.selectors;\n const sel = sels && sels.length === 1 && sels.models[0];\n return sel && sel.isId() && sel.get('name');\n })\n .filter(i => i);\n\n htmlOpts.attributes = (mod, attrs) => {\n const { id } = attrs;\n if (\n id &&\n id[0] === 'i' && // all autogenerated IDs start with 'i'\n !mod.get('script') && // if the component has script, we have to leave the ID\n !mod.get('attributes').id && // id is not intentionally in attributes\n idRules.indexOf(id) < 0 // we shouldn't have any rule with this ID\n ) {\n delete attrs.id;\n }\n return attrs;\n };\n }\n\n if (opts.exportWrapper) {\n return model.toHTML({\n ...htmlOpts,\n ...(opts.wrapperIsBody && model.is('wrapper') && { tag: 'body' })\n });\n }\n\n return this.buildModels(models, htmlOpts);\n }\n\n buildModels(models, opts = {}) {\n let code = '';\n models.forEach(mod => (code += mod.toHTML(opts)));\n return code;\n }\n}\n","import { each } from 'underscore';\nimport Backbone from 'backbone';\n\nexport default Backbone.Model.extend({\n /** @inheritdoc */\n build(model) {\n var json = model.toJSON();\n this.beforeEach(json);\n\n each(\n json,\n function(v, attr) {\n var obj = json[attr];\n if (obj instanceof Backbone.Model) {\n json[attr] = this.build(obj);\n } else if (obj instanceof Backbone.Collection) {\n var coll = obj;\n json[attr] = [];\n if (coll.length) {\n coll.each(function(el, index) {\n json[attr][index] = this.build(el);\n }, this);\n }\n }\n },\n this\n );\n\n return json;\n },\n\n /**\n * Execute on each object\n * @param {Object} obj\n */\n beforeEach(obj) {\n delete obj.status;\n }\n});\n","import { extend } from 'underscore';\nimport Backbone from 'backbone';\n\nexport default Backbone.Model.extend({\n mapModel(model) {\n var code = '';\n var script = model.get('script-export') || model.get('script');\n var type = model.get('type');\n var comps = model.get('components');\n var id = model.getId();\n\n if (script) {\n // If the component has scripts we need to expose his ID\n var attr = model.get('attributes');\n attr = extend({}, attr, { id });\n model.set('attributes', attr, { silent: 1 });\n var scrStr = model.getScriptString(script);\n const scrProps = model.get('script-props');\n\n // If the script was updated, I'll put its code in a separate container\n if (model.get('scriptUpdated') && !scrProps) {\n this.mapJs[type + '-' + id] = { ids: [id], code: scrStr };\n } else {\n let props;\n const mapType = this.mapJs[type];\n\n if (scrProps) {\n props = model.__getScriptProps();\n }\n\n if (mapType) {\n mapType.ids.push(id);\n if (props) mapType.props[id] = props;\n } else {\n const res = { ids: [id], code: scrStr };\n if (props) res.props = { [id]: props };\n this.mapJs[type] = res;\n }\n }\n }\n\n comps.each(function(model) {\n code += this.mapModel(model);\n }, this);\n\n return code;\n },\n\n build(model) {\n this.mapJs = {};\n this.mapModel(model);\n let code = '';\n\n for (let type in this.mapJs) {\n const mapType = this.mapJs[type];\n\n if (mapType.props) {\n code += `\n var props = ${JSON.stringify(mapType.props)};\n var ids = Object.keys(props).map(function(id) { return '#'+id }).join(',');\n var els = document.querySelectorAll(ids);\n for (var i = 0, len = els.length; i < len; i++) {\n var el = els[i];\n (${mapType.code}.bind(el))(props[el.id]);\n }`;\n } else {\n // Deprecated\n const ids = '#' + mapType.ids.join(', #');\n code += `\n var items = document.querySelectorAll('${ids}');\n for (var i = 0, len = items.length; i < len; i++) {\n (function(){\\n${mapType.code}\\n}.bind(items[i]))();\n }`;\n }\n }\n\n return code;\n }\n});\n","import html from 'utils/html';\nimport { View } from 'backbone';\n\nexport default class EditorView extends View {\n template({ pfx, codeName, label }) {\n return html`\n
\n
${label}
\n
\n
\n `;\n }\n\n initialize(o) {\n this.config = o.config || {};\n this.pfx = this.config.stylePrefix;\n }\n\n render() {\n const { model, pfx, $el } = this;\n const obj = model.toJSON();\n obj.pfx = pfx;\n $el.html(this.template(obj));\n $el.attr('class', `${pfx}editor-c`);\n $el.find(`#${pfx}code`).append(model.get('input'));\n return this;\n }\n}\n","/**\n * - [addGenerator](#addgenerator)\n * - [getGenerator](#getgenerator)\n * - [getGenerators](#getgenerators)\n * - [addViewer](#addviewer)\n * - [getViewer](#getviewer)\n * - [getViewers](#getviewers)\n * - [updateViewer](#updateviewer)\n * - [getCode](#getcode)\n *\n *\n * Before using methods you should get first the module from the editor instance, in this way:\n *\n * ```js\n * var codeManager = editor.CodeManager;\n * ```\n *\n * @module CodeManager\n */\nimport { isUndefined } from 'underscore';\nimport defaults from './config/config';\nimport gHtml from './model/HtmlGenerator';\nimport gCss from './model/CssGenerator';\nimport gJson from './model/JsonGenerator';\nimport gJs from './model/JsGenerator';\nimport eCM from './model/CodeMirrorEditor';\nimport editorView from './view/EditorView';\n\nexport default () => {\n var c = {};\n var generators = {},\n defGenerators = {},\n viewers = {},\n defViewers = {};\n\n const defaultViewer = 'CodeMirror';\n\n return {\n getConfig() {\n return c;\n },\n\n config: c,\n\n EditorView: editorView,\n\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'CodeManager',\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n */\n init(config) {\n c = config || {};\n for (var name in defaults) {\n if (!(name in c)) c[name] = defaults[name];\n }\n\n var ppfx = c.pStylePrefix;\n if (ppfx) c.stylePrefix = ppfx + c.stylePrefix;\n\n defGenerators.html = new gHtml();\n defGenerators.css = new gCss();\n defGenerators.json = new gJson();\n defGenerators.js = new gJs();\n defViewers.CodeMirror = new eCM();\n this.loadDefaultGenerators().loadDefaultViewers();\n\n return this;\n },\n\n /**\n * Add new code generator to the collection\n * @param {string} id Code generator ID\n * @param {Object} generator Code generator wrapper\n * @param {Function} generator.build Function that builds the code\n * @return {this}\n * @example\n * codeManager.addGenerator('html7',{\n * build: function(model){\n * return 'myCode';\n * }\n * });\n * */\n addGenerator(id, generator) {\n generators[id] = generator;\n return this;\n },\n\n /**\n * Get code generator by id\n * @param {string} id Code generator ID\n * @return {Object|null}\n * @example\n * var generator = codeManager.getGenerator('html7');\n * generator.build = function(model){\n * //extend\n * };\n * */\n getGenerator(id) {\n return generators[id] || null;\n },\n\n /**\n * Returns all code generators\n * @return {Array}\n * */\n getGenerators() {\n return generators;\n },\n\n /**\n * Add new code viewer\n * @param {string} id Code viewer ID\n * @param {Object} viewer Code viewer wrapper\n * @param {Function} viewer.init Set element on which viewer will be displayed\n * @param {Function} viewer.setContent Set content to the viewer\n * @return {this}\n * @example\n * codeManager.addViewer('ace',{\n * init: function(el){\n * var ace = require('ace-editor');\n * this.editor = ace.edit(el.id);\n * },\n * setContent: function(code){\n * this.editor.setValue(code);\n * }\n * });\n * */\n addViewer(id, viewer) {\n viewers[id] = viewer;\n return this;\n },\n\n /**\n * Get code viewer by id\n * @param {string} id Code viewer ID\n * @return {Object|null}\n * @example\n * var viewer = codeManager.getViewer('ace');\n * */\n getViewer(id) {\n return viewers[id] || null;\n },\n\n /**\n * Returns all code viewers\n * @return {Array}\n * */\n getViewers() {\n return viewers;\n },\n\n createViewer(opts = {}) {\n const type = !isUndefined(opts.type) ? opts.type : defaultViewer;\n const viewer = this.getViewer(type) && this.getViewer(type).clone();\n const cont = document.createElement('div');\n const txtarea = document.createElement('textarea');\n cont.appendChild(txtarea);\n viewer.set(opts);\n viewer.init(txtarea);\n viewer.setElement(cont);\n\n return viewer;\n },\n\n /**\n * Update code viewer content\n * @param {Object} viewer Viewer instance\n * @param {string} code Code string\n * @example\n * var AceViewer = codeManager.getViewer('ace');\n * // ...\n * var viewer = AceViewer.init(el);\n * // ...\n * codeManager.updateViewer(AceViewer, 'code');\n * */\n updateViewer(viewer, code) {\n viewer.setContent(code);\n },\n\n /**\n * Get code from model\n * @param {Object} model Any kind of model that will be passed to the build method of generator\n * @param {string} genId Code generator id\n * @param {Object} [opt] Options\n * @return {string}\n * @example\n * var codeStr = codeManager.getCode(model, 'html');\n * */\n getCode(model, genId, opt = {}) {\n opt.em = c.em;\n var generator = this.getGenerator(genId);\n return generator ? generator.build(model, opt) : '';\n },\n\n /**\n * Load default code generators\n * @return {this}\n * @private\n * */\n loadDefaultGenerators() {\n for (var id in defGenerators) this.addGenerator(id, defGenerators[id]);\n\n return this;\n },\n\n /**\n * Load default code viewers\n * @return {this}\n * @private\n * */\n loadDefaultViewers() {\n for (var id in defViewers) this.addViewer(id, defViewers[id]);\n\n return this;\n },\n\n destroy() {\n [c, generators, defGenerators, viewers, defViewers].forEach(\n i => (i = {})\n );\n }\n };\n};\n","export default {\n // The device `id` to select on start, if not indicated, the first available from `devices` will be used.\n default: null,\n\n // Default devices\n devices: [\n {\n id: 'desktop',\n name: 'Desktop',\n width: ''\n },\n {\n id: 'tablet',\n name: 'Tablet',\n width: '768px',\n widthMedia: '992px'\n },\n {\n id: 'mobileLandscape',\n name: 'Mobile landscape',\n width: '568px',\n widthMedia: '768px'\n },\n {\n id: 'mobilePortrait',\n name: 'Mobile portrait',\n width: '320px',\n widthMedia: '480px'\n }\n ]\n};\n","import { Model } from 'backbone';\n\n/**\n * @typedef Device\n * @property {String} [name=''] Device type, eg. `Mobile`\n * @property {String} [width] Width to set for the editor iframe, eg. '900px'\n * @property {String} [height=''] Height to set for the editor iframe, eg. '600px'\n * @property {String} [widthMedia=''] The width which will be used in media queries, If empty the width will be used\n * @property {Number} [priority=null] Setup the order of media queries\n */\nexport default class Device extends Model {\n defaults() {\n return {\n name: '',\n width: null,\n height: '',\n widthMedia: null,\n priority: null\n };\n }\n\n initialize() {\n this.get('widthMedia') === null &&\n this.set('widthMedia', this.get('width'));\n this.get('width') === null && this.set('width', this.get('widthMedia'));\n !this.get('priority') &&\n this.set('priority', parseFloat(this.get('widthMedia')) || 0);\n const toCheck = ['width', 'height', 'widthMedia'];\n toCheck.forEach(prop => this.checkUnit(prop));\n }\n\n checkUnit(prop) {\n const pr = this.get(prop) || '';\n const noUnit = (parseFloat(pr) || 0).toString() === pr.toString();\n noUnit && this.set(prop, `${pr}px`);\n }\n}\n","import { Collection } from 'backbone';\nimport Device from './Device';\n\nexport default class Devices extends Collection {\n comparator(left, right) {\n const max = Number.MAX_VALUE;\n return (right.get('priority') || max) - (left.get('priority') || max);\n }\n\n getSorted() {\n return this.sort();\n }\n}\n\nDevices.prototype.model = Device;\n","import { View } from 'backbone';\nimport html from 'utils/html';\n\nexport default class DevicesView extends View {\n template({ ppfx, label }) {\n return html`\n
${label}
\n
\n \n \n \n
\n
\n
\n
\n \n `;\n }\n\n events() {\n return {\n change: 'updateDevice'\n };\n }\n\n initialize(o) {\n this.config = o.config || {};\n this.em = this.config.em;\n this.ppfx = this.config.pStylePrefix || '';\n this.events['click .' + this.ppfx + 'add-trasp'] = this.startAdd;\n this.listenTo(this.em, 'change:device', this.updateSelect);\n this.delegateEvents();\n }\n\n /**\n * Start adding new device\n * @return {[type]} [description]\n * @private\n */\n startAdd() {}\n\n /**\n * Update device of the editor\n * @private\n */\n updateDevice() {\n var em = this.em;\n if (em) {\n var devEl = this.devicesEl;\n var val = devEl ? devEl.val() : '';\n em.set('device', val);\n }\n }\n\n /**\n * Update select value on device update\n * @private\n */\n updateSelect() {\n var em = this.em;\n var devEl = this.devicesEl;\n if (em && em.getDeviceModel && devEl) {\n var device = em.getDeviceModel();\n var name = device ? device.get('id') : '';\n devEl.val(name);\n }\n }\n\n /**\n * Return devices options\n * @return {string} String of options\n * @private\n */\n getOptions() {\n const { collection, em } = this;\n let result = '';\n\n collection.each(device => {\n const { name, id } = device.attributes;\n const label = (em && em.t && em.t(`deviceManager.devices.${id}`)) || name;\n result += ``;\n });\n\n return result;\n }\n\n render() {\n const { em, ppfx, $el, el } = this;\n const label = em && em.t && em.t('deviceManager.device');\n $el.html(this.template({ ppfx, label }));\n this.devicesEl = $el.find(`.${ppfx}devices`);\n this.devicesEl.append(this.getOptions());\n this.devicesEl.val(em.get('device'));\n el.className = `${ppfx}devices-c`;\n return this;\n }\n}\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/device_manager/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * deviceManager: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const deviceManager = editor.Devices;\n * ```\n * ## Available Events\n * * `device:add` - Added new device. The [Device] is passed as an argument to the callback\n * * `device:remove` - Device removed. The [Device] is passed as an argument to the callback\n * * `device:select` - New device selected. The newly selected [Device] and the previous one, are passed as arguments to the callback\n * * `device:update` - Device updated. The updated [Device] and the object containing changes are passed as arguments to the callback\n * * `device` - Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback\n *\n * ## Methods\n * * [add](#add)\n * * [get](#get)\n * * [getDevices](#getdevices)\n * * [remove](#remove)\n * * [select](#select)\n * * [getSelected](#getselected)\n *\n * [Device]: device.html\n *\n * @module Devices\n */\nimport { isString } from 'underscore';\nimport Module from 'common/module';\nimport defaults from './config/config';\nimport Device from './model/Device';\nimport Devices from './model/Devices';\nimport DevicesView from './view/DevicesView';\n\nexport const evAll = 'device';\nexport const evPfx = `${evAll}:`;\nexport const evSelect = `${evPfx}select`;\nexport const evSelectBefore = `${evSelect}:before`;\nexport const evUpdate = `${evPfx}update`;\nexport const evAdd = `${evPfx}add`;\nexport const evAddBefore = `${evAdd}:before`;\nexport const evRemove = `${evPfx}remove`;\nexport const evRemoveBefore = `${evRemove}:before`;\nconst chnSel = 'change:device';\n\nexport default () => {\n let c = {};\n let devices;\n let view;\n\n return {\n ...Module,\n\n name: 'DeviceManager',\n\n Device,\n\n Devices,\n\n events: {\n all: evAll,\n select: evSelect,\n // selectBefore: evSelectBefore,\n update: evUpdate,\n add: evAdd,\n // addBefore: evAddBefore,\n remove: evRemove,\n removeBefore: evRemoveBefore\n },\n\n init(config = {}) {\n c = { ...defaults, ...config };\n const { em } = c;\n\n devices = new Devices();\n c.devices.forEach(dv => this.add(dv));\n this.em = em;\n this.all = devices;\n this.select(c.default || devices.at(0));\n this.__initListen();\n em.on(chnSel, this._onSelect, this);\n\n return this;\n },\n\n _onSelect(m, deviceId, opts) {\n const { em, events } = this;\n const prevId = m.previous('device');\n const newDevice = this.get(deviceId);\n const ev = events.select;\n em.trigger(ev, newDevice, this.get(prevId));\n this.__catchAllEvent(ev, newDevice, opts);\n },\n\n /**\n * Add new device\n * @param {Object} props Device properties\n * @returns {[Device]} Added device\n * @example\n * const device1 = deviceManager.add({\n * // Without an explicit ID, the `name` will be taken. In case of missing `name`, a random ID will be created.\n * id: 'tablet',\n * name: 'Tablet',\n * width: '900px', // This width will be applied on the canvas frame and for the CSS media\n * });\n * const device2 = deviceManager.add({\n * id: 'tablet2',\n * name: 'Tablet 2',\n * width: '800px', // This width will be applied on the canvas frame\n * widthMedia: '810px', // This width that will be used for the CSS media\n * height: '600px', // Height will be applied on the canvas frame\n * });\n */\n add(props, options = {}) {\n let result;\n let opts = options;\n\n // Support old API\n if (isString(props)) {\n const width = options;\n opts = arguments[2] || {};\n result = {\n ...opts,\n id: props,\n name: opts.name || props,\n width\n };\n } else {\n result = props;\n }\n\n if (!result.id) {\n result.id = result.name || this._createId();\n }\n\n return devices.add(result, opts);\n },\n\n /**\n * Return device by ID\n * @param {String} id ID of the device\n * @returns {[Device]|null}\n * @example\n * const device = deviceManager.get('Tablet');\n * console.log(JSON.stringify(device));\n * // {name: 'Tablet', width: '900px'}\n */\n get(id) {\n // Support old API\n const byName = this.getAll().filter(d => d.get('name') === id)[0];\n return byName || devices.get(id) || null;\n },\n\n /**\n * Remove device\n * @param {String|[Device]} device Device or device id\n * @returns {[Device]} Removed device\n * @example\n * const removed = deviceManager.remove('device-id');\n * // or by passing the Device\n * const device = deviceManager.get('device-id');\n * deviceManager.remove(device);\n */\n remove(device, opts = {}) {\n return this.__remove(device, opts);\n },\n\n /**\n * Return all devices\n * @returns {Array<[Device]>}\n * @example\n * const devices = deviceManager.getDevices();\n * console.log(JSON.stringify(devices));\n * // [{name: 'Desktop', width: ''}, ...]\n */\n getDevices() {\n return devices.models;\n },\n\n /**\n * Change the selected device. This will update the frame in the canvas\n * @param {String|[Device]} device Device or device id\n * @example\n * deviceManager.select('some-id');\n * // or by passing the page\n * const device = deviceManager.get('some-id');\n * deviceManager.select(device);\n */\n select(device, opts = {}) {\n const md = isString(device) ? this.get(device) : device;\n md && this.em.set('device', md.get('id'), opts);\n return this;\n },\n\n /**\n * Get the selected device\n * @returns {[Device]}\n * @example\n * const selected = deviceManager.getSelected();\n */\n getSelected() {\n return this.get(this.em.get('device'));\n },\n\n getAll() {\n return devices;\n },\n\n render() {\n view && view.remove();\n view = new DevicesView({\n collection: devices,\n config: c\n });\n return view.render().el;\n },\n\n destroy() {\n devices.stopListening();\n devices.reset();\n view && view.remove();\n [devices, view].forEach(i => (i = null));\n c = {};\n }\n };\n};\n","export default {\n // Style prefix\n stylePrefix: 'clm-',\n\n // Specify the element to use as a container, string (query) or HTMLElement\n // With the empty value, nothing will be rendered\n appendTo: '',\n\n // Default selectors\n selectors: [],\n\n // Default states\n states: [{ name: 'hover' }, { name: 'active' }, { name: 'nth-of-type(2n)' }],\n\n // Custom selector name escaping strategy, eg.\n // name => name.replace(' ', '_')\n escapeName: 0,\n\n // Custom selected name strategy (the string you see after 'Selected')\n // ({ result, state, target }) => {\n // return `${result} - ID: ${target.getId()}`\n // }\n selectedName: 0,\n\n // Icon used to add new selector\n iconAdd:\n '',\n\n // Icon used to sync styles\n iconSync:\n '',\n\n // Icon to show when the selector is enabled\n iconTagOn:\n '',\n\n // Icon to show when the selector is disabled\n iconTagOff:\n '',\n\n // Icon used to remove the selector\n iconTagRemove:\n '',\n\n /**\n * Custom render function for the Selector Manager\n * @example\n * render: ({ el, labelHead, labelStates, labelInfo, }) => {\n * // You can use the default `el` to extend/edit the current\n * // DOM element of the Selector Manager\n * const someEl = document.createElement('div');\n * // ...\n * el.appendChild(someEl);\n * // no need to return anything from the function\n *\n * // Create and return a new DOM element\n * const newEl = document.createElement('div');\n * // ...\n * return newEl;\n *\n * // Return an HTML string for a completely different layout.\n * // Use `data-*` attributes to make the module recognize some elements:\n * // `data-states` - Where to append state ``;\n })\n .join('');\n\n const statesEl = this.getStates();\n statesEl &&\n statesEl.html(`${options}`);\n this.checkStates();\n },\n\n render() {\n const { em, pfx, ppfx, config, $el, el } = this;\n const { render, iconSync, iconAdd } = config;\n const tmpOpts = {\n iconSync,\n iconAdd,\n labelHead: em.t('selectorManager.label'),\n labelInfo: em.t('selectorManager.selected'),\n ppfx,\n pfx,\n el\n };\n $el.html(this.template(tmpOpts));\n const renderRes = render && render(tmpOpts);\n renderRes && renderRes !== el && $el.empty().append(renderRes);\n this.$input = $el.find('[data-input]');\n this.$addBtn = $el.find('[data-add]');\n this.$classes = $el.find('#' + pfx + 'tags-c');\n this.$btnSyncEl = $el.find('[data-sync-style]');\n this.$input.hide();\n this.renderStates();\n this.renderClasses();\n $el.attr('class', `${this.className} ${ppfx}one-bg ${ppfx}two-color`);\n return this;\n }\n});\n","/**\n * Selectors in GrapesJS are used in CSS Composer inside Rules and in Components as classes. To illustrate this concept let's take\n * a look at this code:\n *\n * ```css\n * span > #send-btn.btn{\n * ...\n * }\n * ```\n * ```html\n * \n * \n * \n * ```\n *\n * In this scenario we get:\n * * span -> selector of type `tag`\n * * send-btn -> selector of type `id`\n * * btn -> selector of type `class`\n *\n * So, for example, being `btn` the same class entity it'll be easier to refactor and track things.\n *\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/selector_manager/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * selectorManager: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance.\n *\n * ```js\n * // Listen to events\n * editor.on('selector:add', (selector) => { ... });\n *\n * // Use the API\n * const sm = editor.Selectors;\n * sm.add(...);\n * ```\n *\n * ## Available Events\n * * `selector:add` - Selector added. The [Selector] is passed as an argument to the callback.\n * * `selector:remove` - Selector removed. The [Selector] is passed as an argument to the callback.\n * * `selector:update` - Selector updated. The [Selector] and the object containing changes are passed as arguments to the callback.\n * * `selector:state` - States changed. An object containing all the available data about the triggered event is passed as an argument to the callback.\n * * `selector` - Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback.\n *\n * ## Methods\n * * [getConfig](#getconfig)\n * * [add](#add)\n * * [get](#get)\n * * [remove](#remove)\n * * [getAll](#getall)\n * * [setState](#setstate)\n * * [getState](#getstate)\n * * [getStates](#getstates)\n * * [setStates](#setstates)\n * * [getSelected](#getselected)\n * * [addSelected](#addselected)\n * * [removeSelected](#removeselected)\n * * [getSelectedTargets](#getselectedtargets)\n * * [setComponentFirst](#setcomponentfirst)\n * * [getComponentFirst](#getcomponentfirst)\n *\n * [Selector]: selector.html\n * [State]: state.html\n * [Component]: component.html\n * [CssRule]: css_rule.html\n *\n * @module SelectorManager\n */\n\nimport { isString, debounce, isObject, isArray } from 'underscore';\nimport { isComponent, isRule } from 'utils/mixins';\nimport { Model, Collection } from 'common';\nimport Module from 'common/module';\nimport defaults from './config/config';\nimport Selector from './model/Selector';\nimport Selectors from './model/Selectors';\nimport State from './model/State';\nimport ClassTagsView from './view/ClassTagsView';\n\nconst isId = str => isString(str) && str[0] == '#';\nconst isClass = str => isString(str) && str[0] == '.';\n\nexport const evAll = 'selector';\nexport const evPfx = `${evAll}:`;\nexport const evAdd = `${evPfx}add`;\nexport const evUpdate = `${evPfx}update`;\nexport const evRemove = `${evPfx}remove`;\nexport const evRemoveBefore = `${evRemove}:before`;\nexport const evCustom = `${evPfx}custom`;\nexport const evState = `${evPfx}state`;\n\nexport default () => {\n return {\n ...Module,\n\n name: 'SelectorManager',\n\n Selector,\n\n Selectors,\n\n events: {\n all: evAll,\n update: evUpdate,\n add: evAdd,\n remove: evRemove,\n removeBefore: evRemoveBefore,\n state: evState,\n custom: evCustom\n },\n\n /**\n * Get configuration object\n * @name getConfig\n * @function\n * @return {Object}\n */\n\n init(conf = {}) {\n this.__initConfig(defaults, conf);\n const config = this.getConfig();\n const em = config.em;\n const ppfx = config.pStylePrefix;\n\n if (ppfx) {\n config.stylePrefix = ppfx + config.stylePrefix;\n }\n\n // Global selectors container\n this.all = new Selectors(config.selectors);\n this.selected = new Selectors([], { em, config });\n this.states = new Collection(config.states, { model: State });\n this.model = new Model({ cFirst: config.componentFirst, _undo: true });\n this.__initListen({\n collections: [this.states, this.selected],\n propagate: [{ entity: this.states, event: this.events.state }]\n });\n em.on('change:state', (m, value) => em.trigger('selector:state', value));\n this.model.on('change:cFirst', (m, value) =>\n em.trigger('selector:type', value)\n );\n const listenTo =\n 'component:toggled component:update:classes styleManager:update selector:state selector:type';\n this.model.listenTo(em, listenTo, () => this.__update());\n\n return this;\n },\n\n __update: debounce(function() {\n this.__trgCustom();\n }),\n\n __trgCustom(opts) {\n this.em.trigger(this.events.custom, this.__customData(opts));\n },\n\n __customData(opts = {}) {\n const { container } = opts;\n return {\n states: this.getStates(),\n selected: this.getSelected(),\n container\n };\n },\n\n // postLoad() {\n // this.__postLoad();\n // const { em, model } = this;\n // const um = em.get('UndoManager');\n // um && um.add(model);\n // um && um.add(this.pages);\n // },\n\n postRender() {\n this.__appendTo();\n this.__trgCustom();\n },\n\n select(value, opts = {}) {\n const targets = Array.isArray(value) ? value : [value];\n const toSelect = this.em.get('StyleManager').setTarget(targets, opts);\n const selTags = this.selectorTags;\n const res = toSelect\n .filter(i => i)\n .map(sel =>\n isComponent(sel)\n ? sel\n : isRule(sel) && !sel.get('selectorsAdd')\n ? sel\n : sel.getSelectorsString()\n );\n selTags && selTags.componentChanged({ targets: res });\n return this;\n },\n\n addSelector(name, opts = {}, cOpts = {}) {\n let props = { ...opts };\n\n if (isObject(name)) {\n props = name;\n } else {\n props.name = name;\n }\n\n if (isId(props.name)) {\n props.name = props.name.substr(1);\n props.type = Selector.TYPE_ID;\n } else if (isClass(props.name)) {\n props.name = props.name.substr(1);\n }\n\n if (props.label && !props.name) {\n props.name = this.escapeName(props.label);\n }\n\n const cname = props.name;\n const config = this.getConfig();\n const all = this.getAll();\n const selector = cname\n ? this.get(cname, props.type)\n : all.where(props)[0];\n\n if (!selector) {\n return all.add(props, { ...cOpts, config });\n }\n\n return selector;\n },\n\n getSelector(name, type = Selector.TYPE_CLASS) {\n if (isId(name)) {\n name = name.substr(1);\n type = Selector.TYPE_ID;\n } else if (isClass(name)) {\n name = name.substr(1);\n }\n\n return this.getAll().where({ name, type })[0];\n },\n\n /**\n * Add a new selector to the collection if it does not already exist.\n * You can pass selectors properties or string identifiers.\n * @param {Object|String} props Selector properties or string identifiers, eg. `{ name: 'my-class', label: 'My class' }`, `.my-cls`\n * @param {Object} [opts] Selector options\n * @return {[Selector]}\n * @example\n * const selector = selectorManager.add({ name: 'my-class', label: 'My class' });\n * console.log(selector.toString()) // `.my-class`\n * // Same as\n * const selector = selectorManager.add('.my-class');\n * console.log(selector.toString()) // `.my-class`\n * */\n add(props, opts = {}) {\n const cOpts = isString(props) ? {} : opts;\n // Keep support for arrays but avoid it in docs\n if (isArray(props)) {\n return props.map(item => this.addSelector(item, opts, cOpts));\n } else {\n return this.addSelector(props, opts, cOpts);\n }\n },\n\n /**\n * Add class selectors\n * @param {Array|string} classes Array or string of classes\n * @return {Array} Array of added selectors\n * @private\n * @example\n * sm.addClass('class1');\n * sm.addClass('class1 class2');\n * sm.addClass(['class1', 'class2']);\n * // -> [SelectorObject, ...]\n */\n addClass(classes) {\n const added = [];\n\n if (isString(classes)) {\n classes = classes.trim().split(' ');\n }\n\n classes.forEach(name => added.push(this.addSelector(name)));\n return added;\n },\n\n /**\n * Get the selector by its name/type\n * @param {String} name Selector name or string identifier\n * @returns {[Selector]|null}\n * @example\n * const selector = selectorManager.get('.my-class');\n * // Get Id\n * const selectorId = selectorManager.get('#my-id');\n * */\n get(name, type) {\n // Keep support for arrays but avoid it in docs\n if (isArray(name)) {\n const result = [];\n const selectors = name\n .map(item => this.getSelector(item))\n .filter(item => item);\n selectors.forEach(\n item => result.indexOf(item) < 0 && result.push(item)\n );\n return result;\n } else {\n return this.getSelector(name, type) || null;\n }\n },\n\n /**\n * Remove Selector.\n * @param {String|[Selector]} selector Selector instance or Selector string identifier\n * @returns {[Selector]} Removed Selector\n * @example\n * const removed = selectorManager.remove('.myclass');\n * // or by passing the Selector\n * selectorManager.remove(selectorManager.get('.myclass'));\n */\n remove(selector, opts) {\n return this.__remove(selector, opts);\n },\n\n /**\n * Change the selector state\n * @param {String} value State value\n * @returns {this}\n * @example\n * selectorManager.setState('hover');\n */\n setState(value) {\n this.em.setState(value);\n return this;\n },\n\n /**\n * Get the current selector state value\n * @returns {String}\n */\n getState() {\n return this.em.getState();\n },\n\n /**\n * Get states\n * @returns {Array<[State]>}\n */\n getStates() {\n return [...this.states.models];\n },\n\n /**\n * Set a new collection of states\n * @param {Array} states Array of new states\n * @returns {Array<[State]>}\n * @example\n * const states = selectorManager.setStates([\n * { name: 'hover', label: 'Hover' },\n * { name: 'nth-of-type(2n)', label: 'Even/Odd' }\n * ]);\n */\n setStates(states, opts) {\n return this.states.reset(states, opts);\n },\n\n /**\n * Get commonly selected selectors, based on all selected components.\n * @returns {Array<[Selector]>}\n * @example\n * const selected = selectorManager.getSelected();\n * console.log(selected.map(s => s.toString()))\n */\n getSelected() {\n return this.__getCommon();\n },\n\n /**\n * Add new selector to all selected components.\n * @param {Object|String} props Selector properties or string identifiers, eg. `{ name: 'my-class', label: 'My class' }`, `.my-cls`\n * @example\n * selectorManager.addSelected('.new-class');\n */\n addSelected(props) {\n const added = this.add(props);\n // TODO: target should be the one from StyleManager\n this.em.getSelectedAll().forEach(target => {\n target.getSelectors().add(added);\n });\n // TODO: update selected collection\n },\n\n /**\n * Remove a common selector from all selected components.\n * @param {String|[Selector]} selector Selector instance or Selector string identifier\n * @example\n * selectorManager.removeSelected('.myclass');\n */\n removeSelected(selector) {\n this.em.getSelectedAll().forEach(trg => {\n !selector.get('protected') &&\n trg &&\n trg.getSelectors().remove(selector);\n });\n },\n\n /**\n * Get the array of currently selected targets.\n * @returns {Array<[Component]|[CssRule]>}\n * @example\n * const targetsToStyle = selectorManager.getSelectedTargets();\n * console.log(targetsToStyle.map(target => target.getSelectorsString()))\n */\n getSelectedTargets() {\n return this.em.get('StyleManager').getSelected();\n },\n\n /**\n * Update component-first option.\n * If the component-first is enabled, all the style changes will be applied on selected components (ID rules) instead\n * of selectors (which would change styles on all components with those classes).\n * @param {Boolean} value\n */\n setComponentFirst(value) {\n this.getConfig().componentFirst = value;\n this.model.set({ cFirst: value });\n },\n\n /**\n * Get the value of component-first option.\n * @return {Boolean}\n */\n getComponentFirst() {\n return this.getConfig().componentFirst;\n },\n\n /**\n * Get all selectors\n * @name getAll\n * @function\n * @return {Collection<[Selector]>}\n * */\n\n /**\n * Return escaped selector name\n * @param {String} name Selector name to escape\n * @returns {String} Escaped name\n * @private\n */\n escapeName(name) {\n const { escapeName } = this.getConfig();\n return escapeName ? escapeName(name) : Selector.escapeName(name);\n },\n\n /**\n * Render class selectors. If an array of selectors is provided a new instance of the collection will be rendered\n * @param {Array} selectors\n * @return {HTMLElement}\n * @private\n */\n render(selectors) {\n const { em, selectorTags } = this;\n const config = this.getConfig();\n const el = selectorTags && selectorTags.el;\n this.selected.reset(selectors);\n this.selectorTags = new ClassTagsView({\n el,\n collection: this.selected,\n module: this,\n config\n });\n\n return this.selectorTags.render().el;\n },\n\n destroy() {\n const { selectorTags, model } = this;\n model.stopListening();\n this.__destroy();\n selectorTags && selectorTags.remove();\n this.selectorTags = {};\n },\n\n /**\n * Get common selectors from the current selection.\n * @return {Array}\n * @private\n */\n __getCommon() {\n return this.__getCommonSelectors(this.em.getSelectedAll());\n },\n\n __getCommonSelectors(components, opts = {}) {\n const selectors = components\n .map(cmp => cmp.getSelectors && cmp.getSelectors().getValid(opts))\n .filter(Boolean);\n return this.__common(...selectors);\n },\n\n __common(...args) {\n if (!args.length) return [];\n if (args.length === 1) return args[0];\n if (args.length === 2)\n return args[0].filter(item => args[1].indexOf(item) >= 0);\n\n return args\n .slice(1)\n .reduce((acc, item) => this.__common(acc, item), args[0]);\n }\n };\n};\n","export default {\n // Prefix identifier that will be used inside storing and loading\n id: 'gjs-',\n\n // Enable/Disable autosaving\n autosave: 1,\n\n // Indicates if load data inside editor after init\n autoload: 1,\n\n // Indicates which storage to use. Available: local | remote\n type: 'local',\n\n // If autosave enabled, indicates how many steps (general changes to structure)\n // need to be done before save. Useful with remoteStorage to reduce remote calls\n stepsBeforeSave: 1,\n\n //Enable/Disable components model (JSON format)\n storeComponents: 1,\n\n //Enable/Disable styles model (JSON format)\n storeStyles: 1,\n\n //Enable/Disable saving HTML template\n storeHtml: 1,\n\n //Enable/Disable saving CSS template\n storeCss: 1,\n\n // ONLY FOR LOCAL STORAGE\n // If enabled, checks if browser supports Local Storage\n checkLocal: 1,\n\n // ONLY FOR REMOTE STORAGE\n // Custom parameters to pass with the remote storage request, eg. csrf token\n params: {},\n\n // Custom headers for the remote storage request\n headers: {},\n\n // Endpoint where to save all stuff\n urlStore: '',\n\n // Endpoint where to fetch data\n urlLoad: '',\n\n //Callback before request\n beforeSend(jqXHR, settings) {},\n\n //Callback after request\n onComplete(jqXHR, status) {},\n\n // set contentType paramater of $.ajax\n // true: application/json; charset=utf-8'\n // false: 'x-www-form-urlencoded'\n contentTypeJson: true,\n\n credentials: 'include',\n\n // Pass custom options to fetch API (remote storage)\n // You can pass a simple object: { someOption: 'someValue' }\n // or a function wich returns and object to add:\n // currentOpts => {\n // return currentOpts.method === 'post' ? { method: 'patch' } : {};\n // }\n fetchOptions: ''\n};\n","import { Model } from 'backbone';\nimport { hasWin } from 'utils/mixins';\n\nexport default Model.extend({\n defaults: {\n checkLocal: true\n },\n\n /**\n * @private\n */\n store(data, clb = () => {}) {\n if (this.hasLocal()) {\n for (let key in data) localStorage.setItem(key, data[key]);\n }\n\n clb && clb();\n },\n\n /**\n * @private\n */\n load(keys, clb = () => {}) {\n const result = {};\n\n if (this.hasLocal()) {\n for (let i = 0, len = keys.length; i < len; i++) {\n const value = localStorage.getItem(keys[i]);\n if (value) result[keys[i]] = value;\n }\n }\n\n clb && clb(result);\n\n return result;\n },\n\n /**\n * @private\n */\n remove(keys) {\n if (!this.hasLocal()) return;\n\n for (let i = 0, len = keys.length; i < len; i++)\n localStorage.removeItem(keys[i]);\n },\n\n /**\n * Check storage environment\n * @private\n * */\n hasLocal() {\n const win = hasWin();\n\n if (this.get('checkLocal') && (!win || !localStorage)) {\n win && console.warn(\"Your browser doesn't support localStorage\");\n return false;\n }\n\n return true;\n }\n});\n","import Backbone from 'backbone';\nimport fetch from 'utils/fetch';\nimport { isUndefined, isFunction } from 'underscore';\n\nexport default Backbone.Model.extend({\n fetch,\n\n defaults: {\n urlStore: '',\n urlLoad: '',\n params: {},\n beforeSend() {},\n onComplete() {},\n contentTypeJson: false,\n credentials: 'include',\n fetchOptions: ''\n },\n\n /**\n * Triggered before the request is started\n * @private\n */\n onStart() {\n const em = this.get('em');\n const before = this.get('beforeSend');\n before && before();\n },\n\n /**\n * Triggered on request error\n * @param {Object} err Error\n * @param {Function} [clbErr] Error callback\n * @private\n */\n onError(err, clbErr) {\n if (clbErr) {\n clbErr(err);\n } else {\n const em = this.get('em');\n console.error(err);\n em && em.trigger('storage:error', err);\n }\n },\n\n /**\n * Triggered on request response\n * @param {string} text Response text\n * @private\n */\n onResponse(text, clb) {\n const em = this.get('em');\n const complete = this.get('onComplete');\n const typeJson = this.get('contentTypeJson');\n const parsable = text && typeof text === 'string';\n const res = typeJson && parsable ? JSON.parse(text) : text;\n complete && complete(res);\n clb && clb(res);\n em && em.trigger('storage:response', res);\n },\n\n store(data, clb, clbErr) {\n const body = {};\n\n for (let key in data) {\n body[key] = data[key];\n }\n\n this.request(this.get('urlStore'), { body }, clb, clbErr);\n },\n\n load(keys, clb, clbErr) {\n this.request(this.get('urlLoad'), { method: 'get' }, clb, clbErr);\n },\n\n /**\n * Execute remote request\n * @param {string} url Url\n * @param {Object} [opts={}] Options\n * @param {Function} [clb=null] Callback\n * @param {Function} [clbErr=null] Error callback\n * @private\n */\n request(url, opts = {}, clb = null, clbErr = null) {\n const typeJson = this.get('contentTypeJson');\n const headers = this.get('headers') || {};\n const params = this.get('params');\n const reqHead = 'X-Requested-With';\n const typeHead = 'Content-Type';\n const bodyObj = opts.body || {};\n let fetchOptions;\n let body;\n\n for (let param in params) {\n bodyObj[param] = params[param];\n }\n\n if (isUndefined(headers[reqHead])) {\n headers[reqHead] = 'XMLHttpRequest';\n }\n\n // With `fetch`, have to send FormData without any 'Content-Type'\n // https://stackoverflow.com/questions/39280438/fetch-missing-boundary-in-multipart-form-data-post\n\n if (isUndefined(headers[typeHead]) && typeJson) {\n headers[typeHead] = 'application/json; charset=utf-8';\n }\n\n if (typeJson) {\n body = JSON.stringify(bodyObj);\n } else {\n body = new FormData();\n\n for (let bodyKey in bodyObj) {\n body.append(bodyKey, bodyObj[bodyKey]);\n }\n }\n fetchOptions = {\n method: opts.method || 'post',\n credentials: this.get('credentials'),\n headers\n };\n\n // Body should only be included on POST method\n if (fetchOptions.method === 'post') {\n fetchOptions.body = body;\n }\n\n const fetchOpts = this.get('fetchOptions') || {};\n const addOpts = isFunction(fetchOpts)\n ? fetchOpts(fetchOptions)\n : fetchOptions;\n\n this.onStart();\n this.fetch(url, {\n ...fetchOptions,\n ...(addOpts || {})\n })\n .then(res =>\n ((res.status / 200) | 0) == 1\n ? res.text()\n : res.text().then(text => Promise.reject(text))\n )\n .then(text => this.onResponse(text, clb))\n .catch(err => this.onError(err, clbErr));\n }\n});\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/storage_manager/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * storageManager: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const storageManager = editor.StorageManager;\n * ```\n *\n * * [getConfig](#getconfig)\n * * [isAutosave](#isautosave)\n * * [setAutosave](#setautosave)\n * * [getStepsBeforeSave](#getstepsbeforesave)\n * * [setStepsBeforeSave](#setstepsbeforesave)\n * * [setStepsBeforeSave](#setstepsbeforesave)\n * * [getStorages](#getstorages)\n * * [getCurrent](#getcurrent)\n * * [getCurrentStorage](#getcurrentstorage)\n * * [setCurrent](#setcurrent)\n * * [add](#add)\n * * [get](#get)\n * * [store](#store)\n * * [load](#load)\n *\n * @module StorageManager\n */\n\nimport defaults from './config/config';\nimport LocalStorage from './model/LocalStorage';\nimport RemoteStorage from './model/RemoteStorage';\n\nconst eventStart = 'storage:start';\nconst eventAfter = 'storage:after';\nconst eventEnd = 'storage:end';\nconst eventError = 'storage:error';\n\nexport default () => {\n var c = {};\n let em;\n var storages = {};\n var defaultStorages = {};\n\n return {\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'StorageManager',\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @param {string} [config.id='gjs-'] The prefix for the fields, useful to differentiate storing/loading\n * with multiple editors on the same page. For example, in local storage, the item of HTML will be saved like 'gjs-html'\n * @param {Boolean} [config.autosave=true] Indicates if autosave mode is enabled, works in conjunction with stepsBeforeSave\n * @param {number} [config.stepsBeforeSave=1] If autosave enabled, indicates how many steps/changes are necessary\n * before autosave is triggered\n * @param {string} [config.type='local'] Default storage type. Available: 'local' | 'remote' | ''(do not store)\n * @private\n * @example\n * ...\n * {\n * autosave: false,\n * type: 'remote',\n * }\n * ...\n */\n init(config = {}) {\n c = { ...defaults, ...config };\n em = c.em;\n if (c._disable) c.type = 0;\n defaultStorages.remote = new RemoteStorage(c);\n defaultStorages.local = new LocalStorage(c);\n c.currentStorage = c.type;\n this.loadDefaultProviders().setCurrent(c.type);\n return this;\n },\n\n /**\n * Get configuration object\n * @return {Object}\n * */\n getConfig() {\n return c;\n },\n\n /**\n * Checks if autosave is enabled\n * @return {Boolean}\n * */\n isAutosave() {\n return !!c.autosave;\n },\n\n /**\n * Set autosave value\n * @param {Boolean} v\n * @return {this}\n * */\n setAutosave(v) {\n c.autosave = !!v;\n return this;\n },\n\n /**\n * Returns number of steps required before trigger autosave\n * @return {number}\n * */\n getStepsBeforeSave() {\n return c.stepsBeforeSave;\n },\n\n /**\n * Set steps required before trigger autosave\n * @param {number} v\n * @return {this}\n * */\n setStepsBeforeSave(v) {\n c.stepsBeforeSave = v;\n return this;\n },\n\n /**\n * Add new storage\n * @param {string} id Storage ID\n * @param {Object} storage Storage wrapper\n * @param {Function} storage.load Load method\n * @param {Function} storage.store Store method\n * @return {this}\n * @example\n * storageManager.add('local2', {\n * load: function(keys, clb, clbErr) {\n * var res = {};\n * for (var i = 0, len = keys.length; i < len; i++){\n * var v = localStorage.getItem(keys[i]);\n * if(v) res[keys[i]] = v;\n * }\n * clb(res); // might be called inside some async method\n * // In case of errors...\n * // clbErr('Went something wrong');\n * },\n * store: function(data, clb, clbErr) {\n * for(var key in data)\n * localStorage.setItem(key, data[key]);\n * clb(); // might be called inside some async method\n * }\n * });\n * */\n add(id, storage) {\n storages[id] = storage;\n return this;\n },\n\n /**\n * Returns storage by id\n * @param {string} id Storage ID\n * @return {Object|null}\n * */\n get(id) {\n return storages[id] || null;\n },\n\n /**\n * Returns all storages\n * @return {Array}\n * */\n getStorages() {\n return storages;\n },\n\n /**\n * Returns current storage type\n * @return {string}\n * */\n getCurrent() {\n return c.currentStorage;\n },\n\n /**\n * Set current storage type\n * @param {string} id Storage ID\n * @return {this}\n * */\n setCurrent(id) {\n c.currentStorage = id;\n return this;\n },\n\n /**\n * Store key-value resources in the current storage\n * @param {Object} data Data in key-value format, eg. {item1: value1, item2: value2}\n * @param {Function} clb Callback function\n * @return {Object|null}\n * @example\n * storageManager.store({item1: value1, item2: value2});\n * */\n store(data, clb) {\n const st = this.get(this.getCurrent());\n const toStore = {};\n this.onStart('store', data);\n\n for (let key in data) {\n toStore[c.id + key] = data[key];\n }\n\n return st\n ? st.store(\n toStore,\n res => {\n this.onAfter('store', res);\n clb && clb(res);\n this.onEnd('store', res);\n },\n err => {\n this.onError('store', err);\n }\n )\n : null;\n },\n\n /**\n * Load resource from the current storage by keys\n * @param {string|Array} keys Keys to load\n * @param {Function} clb Callback function\n * @example\n * storageManager.load(['item1', 'item2'], res => {\n * // res -> {item1: value1, item2: value2}\n * });\n * storageManager.load('item1', res => {\n * // res -> {item1: value1}\n * });\n * */\n load(keys, clb) {\n const st = this.get(this.getCurrent());\n const keysF = [];\n let result = {};\n\n if (typeof keys === 'string') keys = [keys];\n this.onStart('load', keys);\n\n for (var i = 0, len = keys.length; i < len; i++) {\n keysF.push(c.id + keys[i]);\n }\n\n if (st) {\n st.load(\n keysF,\n res => {\n result = this.__clearKeys(res);\n this.onAfter('load', result);\n clb && clb(result);\n this.onEnd('load', result);\n },\n err => {\n clb && clb(result);\n this.onError('load', err);\n }\n );\n } else {\n clb && clb(result);\n }\n },\n\n /**\n * Restore key names\n * @param {Object} data\n * @returns {Object}\n * @private\n */\n __clearKeys(data = {}) {\n const result = {};\n const reg = new RegExp('^' + c.id + '');\n\n for (let itemKey in data) {\n const itemKeyR = itemKey.replace(reg, '');\n result[itemKeyR] = data[itemKey];\n }\n\n return result;\n },\n\n /**\n * Load default storages\n * @return {this}\n * @private\n * */\n loadDefaultProviders() {\n for (var id in defaultStorages) this.add(id, defaultStorages[id]);\n return this;\n },\n\n /**\n * Get current storage\n * @return {Storage}\n * */\n getCurrentStorage() {\n return this.get(this.getCurrent());\n },\n\n /**\n * On start callback\n * @private\n */\n onStart(ctx, data) {\n if (em) {\n em.trigger(eventStart);\n ctx && em.trigger(`${eventStart}:${ctx}`, data);\n }\n },\n\n /**\n * On after callback (before passing data to the callback)\n * @private\n */\n onAfter(ctx, data) {\n if (em) {\n em.trigger(eventAfter);\n ctx && em.trigger(`${eventAfter}:${ctx}`, data);\n }\n },\n\n /**\n * On end callback\n * @private\n */\n onEnd(ctx, data) {\n if (em) {\n em.trigger(eventEnd);\n ctx && em.trigger(`${eventEnd}:${ctx}`, data);\n }\n },\n\n /**\n * On error callback\n * @private\n */\n onError(ctx, data) {\n if (em) {\n em.trigger(eventError, data);\n ctx && em.trigger(`${eventError}:${ctx}`, data);\n this.onEnd(ctx, data);\n }\n },\n\n /**\n * Check if autoload is possible\n * @return {Boolean}\n * @private\n * */\n canAutoload() {\n const storage = this.getCurrentStorage();\n return storage && this.getConfig().autoload;\n },\n\n destroy() {\n [c, em, storages, defaultStorages].forEach(i => (i = {}));\n }\n };\n};\n","export default {\n textTags: ['br', 'b', 'i', 'u', 'a', 'ul', 'ol'],\n\n // Custom CSS parser\n // @see https://grapesjs.com/docs/guides/Custom-CSS-parser.html\n parserCss: null,\n\n // Custom HTML parser\n // At the moment, the custom HTML parser should rely on DOM Node instance as the result\n // @example\n // The return should be an instance of an Node as the root to traverse\n // https://developer.mozilla.org/en-US/docs/Web/API/Node\n // parserHtml: (input, opts = {}) => (new DOMParser()).parseFromString(input, 'text/xml')\n // Here the result will be XMLDocument, which extends Node\n parserHtml: null,\n\n // DOMParser mime type (default 'text/html')\n // @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString\n // If you use the `text/html` parser, it will fix the invalid syntax automatically\n htmlType: null\n};\n","import { keys } from 'underscore';\n\n// At-rules\n// https://developer.mozilla.org/it/docs/Web/API/CSSRule#Type_constants\nconst atRules = {\n 4: 'media',\n 5: 'font-face',\n 6: 'page',\n 7: 'keyframes',\n 11: 'counter-style',\n 12: 'supports',\n 13: 'document',\n 14: 'font-feature-values',\n 15: 'viewport'\n};\nconst atRuleKeys = keys(atRules);\nconst singleAtRules = ['5', '6', '11', '15'];\nconst singleAtRulesNames = ['font-face', 'page', 'counter-style', 'viewport'];\n\n/**\n * Parse selector string to array.\n * Only classe based are valid as CSS rules inside editor, not valid\n * selectors will be dropped as additional\n * It's ok with the last part of the string as state (:hover, :active)\n * @param {string} str Selectors string\n * @return {Object}\n * @example\n * var res = parseSelector('.test1, .test1.test2, .test2 .test3');\n * console.log(res);\n * // {\n * //result: [['test1'], ['test1', 'test2']],\n * //add: ['.test2 .test3']\n * //}\n */\nexport const parseSelector = (str = '') => {\n const add = [];\n const result = [];\n const sels = str.split(',');\n\n for (var i = 0, len = sels.length; i < len; i++) {\n var sel = sels[i].trim();\n\n // Will accept only concatenated classes and last\n // class might be with state (eg. :hover), nothing else.\n // Can also accept SINGLE ID selectors, eg. `#myid`, `#myid:hover`\n // Composed are not valid: `#myid.some-class`, `#myid.some-class:hover`\n if (\n /^(\\.{1}[\\w\\-]+)+(:{1,2}[\\w\\-()]+)?$/gi.test(sel) ||\n /^(#{1}[\\w\\-]+){1}(:{1,2}[\\w\\-()]+)?$/gi.test(sel)\n ) {\n var cls = sel.split('.').filter(Boolean);\n result.push(cls);\n } else {\n add.push(sel);\n }\n }\n\n return {\n result,\n add\n };\n};\n\n/**\n * Parse style declarations of the node\n * @param {CSSRule} node\n * @return {Object}\n */\nexport const parseStyle = node => {\n const stl = node.style;\n const style = {};\n\n for (var i = 0, len = stl.length; i < len; i++) {\n const propName = stl[i];\n const propValue = stl.getPropertyValue(propName);\n const important = stl.getPropertyPriority(propName);\n style[propName] = `${propValue}${important ? ` !${important}` : ''}`;\n }\n\n return style;\n};\n\n/**\n * Get the condition when possible\n * @param {CSSRule} node\n * @return {string}\n */\nexport const parseCondition = node => {\n const condition =\n node.conditionText ||\n (node.media && node.media.mediaText) ||\n node.name ||\n node.selectorText ||\n '';\n return condition.trim();\n};\n\n/**\n * Create node for the editor\n * @param {Array} selectors Array containing strings of classes\n * @param {Object} style Key-value object of style declarations\n * @return {Object}\n */\nexport const createNode = (selectors, style = {}, opts = {}) => {\n const node = {};\n const selLen = selectors.length;\n const lastClass = selectors[selLen - 1];\n const stateArr = lastClass ? lastClass.split(/:(.+)/) : [];\n const state = stateArr[1];\n const { atRule, selectorsAdd, mediaText } = opts;\n const singleAtRule = singleAtRulesNames.indexOf(atRule) >= 0;\n singleAtRule && (node.singleAtRule = 1);\n atRule && (node.atRuleType = atRule);\n selectorsAdd && (node.selectorsAdd = selectorsAdd);\n mediaText && (node.mediaText = mediaText);\n\n // Isolate the state from selectors\n if (state) {\n selectors[selLen - 1] = stateArr[0];\n node.state = state;\n stateArr.splice(stateArr.length - 1, 1);\n }\n\n node.selectors = selectors;\n node.style = style;\n\n return node;\n};\n\n/**\n * Fetch data from node\n * @param {StyleSheet|CSSRule} el\n * @return {Array}\n */\nexport const parseNode = el => {\n var result = [];\n var nodes = el.cssRules || [];\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n const node = nodes[i];\n const type = node.type.toString();\n let singleAtRule = 0;\n let atRuleType = '';\n let condition = '';\n // keyText is for CSSKeyframeRule\n let sels = node.selectorText || node.keyText;\n const isSingleAtRule = singleAtRules.indexOf(type) >= 0;\n\n // Check if the node is an at-rule\n if (isSingleAtRule) {\n singleAtRule = 1;\n atRuleType = atRules[type];\n condition = parseCondition(node);\n } else if (atRuleKeys.indexOf(type) >= 0) {\n var subRules = parseNode(node);\n condition = parseCondition(node);\n\n for (var s = 0, lens = subRules.length; s < lens; s++) {\n var subRule = subRules[s];\n condition && (subRule.mediaText = condition);\n subRule.atRuleType = atRules[type];\n }\n result = result.concat(subRules);\n }\n\n if (!sels && !isSingleAtRule) continue;\n const style = parseStyle(node);\n const selsParsed = parseSelector(sels);\n const selsAdd = selsParsed.add;\n sels = selsParsed.result;\n\n let lastRule;\n // For each group of selectors\n for (var k = 0, len3 = sels.length; k < len3; k++) {\n const model = createNode(sels[k], style, {\n atRule: atRules[type]\n });\n result.push(model);\n lastRule = model;\n }\n\n // Need to push somewhere not class-based selectors, if some rule was\n // created will push them there, otherwise will create a new rule\n if (selsAdd.length) {\n var selsAddStr = selsAdd.join(', ');\n if (lastRule) {\n lastRule.selectorsAdd = selsAddStr;\n } else {\n const model = {\n selectors: [],\n selectorsAdd: selsAddStr,\n style\n };\n singleAtRule && (model.singleAtRule = singleAtRule);\n atRuleType && (model.atRuleType = atRuleType);\n condition && (model.mediaText = condition);\n result.push(model);\n }\n }\n }\n\n return result;\n};\n\n/**\n * Parse CSS string and return the array of objects\n * @param {String} str CSS string\n * @return {Array} Array of objects for the definition of CSSRules\n */\nexport default str => {\n const el = document.createElement('style');\n el.innerHTML = str;\n\n // There is no .sheet before adding it to the \n document.head.appendChild(el);\n const sheet = el.sheet;\n document.head.removeChild(el);\n\n return parseNode(sheet);\n};\n","import { isString } from 'underscore';\nimport BrowserCssParser, {\n parseSelector,\n createNode\n} from './BrowserParserCss';\n\nexport default (config = {}) => ({\n /**\n * Parse CSS string to a desired model object\n * @param {String} str CSS string\n * @return {Array}\n */\n parse(str) {\n let result = [];\n const { parserCss, em } = config;\n const editor = em && em.get && em.get('Editor');\n const nodes = parserCss ? parserCss(str, editor) : BrowserCssParser(str);\n nodes.forEach(node => (result = result.concat(this.checkNode(node))));\n em && em.trigger('parse:css', { input: str, output: result });\n\n return result;\n },\n\n /**\n * Check the returned node from a custom parser and transforms it to\n * a valid object for the CSS composer\n * @return {[type]}\n */\n checkNode(node) {\n const { selectors, style } = node;\n\n if (isString(selectors)) {\n const nodes = [];\n const selsParsed = parseSelector(selectors);\n const classSets = selsParsed.result;\n const selectorsAdd = selsParsed.add.join(', ');\n const opts = {\n atRule: node.atRule,\n mediaText: node.params\n };\n\n if (classSets.length) {\n classSets.forEach(classSet => {\n nodes.push(createNode(classSet, style, opts));\n });\n } else {\n nodes.push(createNode([], style, opts));\n }\n\n if (selectorsAdd) {\n const lastNode = nodes[nodes.length - 1];\n lastNode.selectorsAdd = selectorsAdd;\n }\n\n node = nodes;\n }\n\n return node;\n }\n});\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/parser/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * parser: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const { Parser } = editor;\n * ```\n * ## Available Events\n * * `parse:html` - On HTML parse, an object containing the input and the output of the parser is passed as an argument\n * * `parse:css` - On CSS parse, an object containing the input and the output of the parser is passed as an argument\n *\n * ## Methods\n * * [getConfig](#getconfig)\n * * [parseHtml](#parsehtml)\n * * [parseCss](#parsecss)\n *\n * @module Parser\n */\nimport defaults from './config/config';\nimport parserCss from './model/ParserCss';\nimport parserHtml from './model/ParserHtml';\n\nexport default () => {\n let conf = {};\n let pHtml, pCss;\n\n return {\n compTypes: '',\n\n parserCss: null,\n\n parserHtml: null,\n\n name: 'Parser',\n\n init(config = {}) {\n conf = { ...defaults, ...config };\n conf.Parser = this;\n pHtml = new parserHtml(conf);\n pCss = new parserCss(conf);\n this.em = conf.em;\n this.parserCss = pCss;\n this.parserHtml = pHtml;\n return this;\n },\n\n /**\n * Get the configuration object\n * @returns {Object} Configuration object\n * @example\n * console.log(Parser.getConfig())\n */\n getConfig() {\n return conf;\n },\n\n /**\n * Parse HTML string and return the object containing the Component Definition\n * @param {String} input HTML string to parse\n * @param {Object} [options] Options\n * @param {String} [options.htmlType] [HTML mime type](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02) to parse\n * @returns {Object} Object containing the result `{ html: ..., css: ... }`\n * @example\n * const resHtml = Parser.parseHtml(`
Hi
`, {\n * htmlType: 'text/html', // default\n * });\n * // By using the `text/html`, this will fix automatically all the HTML syntax issues\n * // Indeed the final representation, in this case, will be `
Hi
`\n * const resXml = Parser.parseHtml(`
Hi
`, {\n * htmlType: 'application/xml',\n * });\n * // This will preserve the original format as, from the XML point of view, is a valid format\n */\n parseHtml(input, options = {}) {\n const { em, compTypes } = this;\n pHtml.compTypes = em ? em.get('DomComponents').getTypes() : compTypes;\n return pHtml.parse(input, pCss, options);\n },\n\n /**\n * Parse CSS string and return an array of valid definition objects for CSSRules\n * @param {String} input CSS string to parse\n * @returns {Array} Array containing the result\n * @example\n * const res = Parser.parseCss('.cls { color: red }');\n * // [{ ... }]\n */\n parseCss(input) {\n return pCss.parse(input);\n },\n\n destroy() {\n [conf, pHtml, pCss].forEach(i => (i = {}));\n ['em', 'parserCss', 'parserHtml'].forEach(i => (this[i] = {}));\n }\n };\n};\n","export default {\n stylePrefix: 'mdl-',\n\n title: '',\n\n content: '',\n\n backdrop: true,\n\n // Avoid rendering the default modal.\n custom: false,\n\n /**\n * Extend ModalView object (view/ModalView.js)\n * @example\n * extend: {\n * template() {\n * return '
...New modal template...
';\n * },\n * },\n */\n extend: {}\n};\n","import { Model } from 'backbone';\n\nexport default class Modal extends Model {\n defaults() {\n return {\n title: '',\n content: '',\n attributes: {},\n open: false\n };\n }\n\n open() {\n this.set('open', true);\n }\n\n close() {\n this.set('open', false);\n }\n}\n","import { View } from 'backbone';\n\nexport default class ModalView extends View {\n template({ pfx, ppfx, content, title }) {\n return `
\n
\n
${title}
\n
⨯
\n
\n
\n
${content}
\n
\n
\n
\n
`;\n }\n\n events() {\n return {\n click: 'onClick',\n 'click [data-close-modal]': 'hide'\n };\n }\n\n initialize(o) {\n const model = this.model;\n const config = o.config || {};\n const pfx = config.stylePrefix || '';\n this.config = config;\n this.pfx = pfx;\n this.ppfx = config.pStylePrefix || '';\n this.listenTo(model, 'change:open', this.updateOpen);\n this.listenTo(model, 'change:title', this.updateTitle);\n this.listenTo(model, 'change:content', this.updateContent);\n }\n\n onClick(e) {\n const bkd = this.config.backdrop;\n bkd && e.target === this.el && this.hide();\n }\n\n /**\n * Returns collector element\n * @return {HTMLElement}\n * @private\n */\n getCollector() {\n if (!this.$collector)\n this.$collector = this.$el.find('.' + this.pfx + 'collector');\n return this.$collector;\n }\n\n /**\n * Returns content element\n * @return {HTMLElement}\n * @private\n */\n getContent() {\n const pfx = this.pfx;\n\n if (!this.$content) {\n this.$content = this.$el.find(`.${pfx}content #${pfx}c`);\n }\n\n return this.$content;\n }\n\n /**\n * Returns title element\n * @return {HTMLElement}\n * @private\n */\n getTitle(opts = {}) {\n if (!this.$title) this.$title = this.$el.find('.' + this.pfx + 'title');\n return opts.$ ? this.$title : this.$title.get(0);\n }\n\n /**\n * Update content\n * @private\n * */\n updateContent() {\n var content = this.getContent();\n const children = content.children();\n const coll = this.getCollector();\n const body = this.model.get('content');\n children.length && coll.append(children);\n content.empty().append(body);\n }\n\n /**\n * Update title\n * @private\n * */\n updateTitle() {\n const title = this.getTitle({ $: true });\n title && title.empty().append(this.model.get('title'));\n }\n\n /**\n * Update open\n * @private\n * */\n updateOpen() {\n this.el.style.display = this.model.get('open') ? '' : 'none';\n }\n\n /**\n * Hide modal\n * @private\n * */\n hide() {\n this.model.close();\n }\n\n /**\n * Show modal\n * @private\n * */\n show() {\n this.model.open();\n }\n\n updateAttr(attr) {\n const { pfx, $el, el } = this;\n const currAttr = [].slice.call(el.attributes).map(i => i.name);\n $el.removeAttr(currAttr.join(' '));\n $el.attr({\n ...(attr || {}),\n class: `${pfx}container ${(attr && attr.class) || ''}`.trim()\n });\n }\n\n render() {\n const el = this.$el;\n const obj = this.model.toJSON();\n obj.pfx = this.pfx;\n obj.ppfx = this.ppfx;\n el.html(this.template(obj));\n this.updateAttr();\n this.updateOpen();\n return this;\n }\n}\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/modal_dialog/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * modal: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const modal = editor.Modal;\n * ```\n *\n * ## Available Events\n * * `modal:open` - Modal is opened\n * * `modal:close` - Modal is closed\n * * `modal` - Event triggered on any change related to the modal. An object containing all the available data about the triggered event is passed as an argument to the callback.\n *\n * ## Methods\n * * [open](#open)\n * * [close](#close)\n * * [isOpen](#isopen)\n * * [setTitle](#settitle)\n * * [getTitle](#gettitle)\n * * [setContent](#setcontent)\n * * [getContent](#getcontent)\n * * [onceClose](#onceclose)\n * * [onceOpen](#onceopen)\n *\n * @module Modal\n */\n\nimport { debounce, isFunction, isString } from 'underscore';\nimport { createText } from '../utils/dom';\nimport defaults from './config/config';\nimport ModalM from './model/Modal';\nimport ModalView from './view/ModalView';\n\nexport default () => {\n var c = {};\n var model, modal;\n\n const triggerEvent = (enable, em) => {\n em && em.trigger(`modal:${enable ? 'open' : 'close'}`);\n };\n\n return {\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'Modal',\n\n getConfig() {\n return c;\n },\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @private\n */\n init(config = {}) {\n c = {\n ...defaults,\n ...config\n };\n\n const em = c.em;\n this.em = em;\n var ppfx = c.pStylePrefix;\n if (ppfx) c.stylePrefix = ppfx + c.stylePrefix;\n\n model = new ModalM(c);\n model.on('change:open', (m, enb) => triggerEvent(enb, em));\n model.on(\n 'change',\n debounce(() => {\n const data = this._evData();\n const { custom } = this.getConfig();\n isFunction(custom) && custom(data);\n em.trigger('modal', data);\n })\n );\n\n return this;\n },\n\n _evData() {\n const titl = this.getTitle();\n const cnt = this.getContent();\n const { open, attributes } = model.attributes;\n return {\n open,\n attributes,\n title: isString(titl) ? createText(titl) : titl,\n content: isString(cnt) ? createText(cnt) : cnt.get ? cnt.get(0) : cnt,\n close: () => this.close()\n };\n },\n\n postRender(view) {\n const el = view.model.getConfig().el || view.el;\n const res = this.render();\n res && res.appendTo(el);\n },\n\n /**\n * Open the modal window\n * @param {Object} [opts={}] Options\n * @param {String|HTMLElement} [opts.title] Title to set for the modal\n * @param {String|HTMLElement} [opts.content] Content to set for the modal\n * @param {Object} [opts.attributes] Updates the modal wrapper with custom attributes\n * @returns {this}\n * @example\n * modal.open({\n * title: 'My title',\n * content: 'My content',\n * attributes: { class: 'my-class' },\n * });\n */\n open(opts = {}) {\n const attr = opts.attributes || {};\n opts.title && this.setTitle(opts.title);\n opts.content && this.setContent(opts.content);\n model.set('attributes', attr);\n model.open();\n modal && modal.updateAttr(attr);\n return this;\n },\n\n /**\n * Close the modal window\n * @returns {this}\n * @example\n * modal.close();\n */\n close() {\n model.close();\n return this;\n },\n\n /**\n * Execute callback when the modal will be closed.\n * The callback will be called one only time\n * @param {Function} clb Callback to call\n * @returns {this}\n * @example\n * modal.onceClose(() => {\n * console.log('The modal is closed');\n * });\n */\n onceClose(clb) {\n this.em.once('modal:close', clb);\n return this;\n },\n\n /**\n * Execute callback when the modal will be opened.\n * The callback will be called one only time\n * @param {Function} clb Callback to call\n * @returns {this}\n * @example\n * modal.onceOpen(() => {\n * console.log('The modal is opened');\n * });\n */\n onceOpen(clb) {\n this.em.once('modal:open', clb);\n return this;\n },\n\n /**\n * Checks if the modal window is open\n * @returns {Boolean}\n * @example\n * modal.isOpen(); // true | false\n */\n isOpen() {\n return !!model.get('open');\n },\n\n /**\n * Set the title to the modal window\n * @param {string | HTMLElement} title Title\n * @returns {this}\n * @example\n * // pass a string\n * modal.setTitle('Some title');\n * // or an HTMLElement\n * const el = document.createElement('div');\n * el.innerText = 'New title';\n * modal.setTitle(el);\n */\n setTitle(title) {\n model.set('title', title);\n return this;\n },\n\n /**\n * Returns the title of the modal window\n * @returns {string | HTMLElement}\n * @example\n * modal.getTitle();\n */\n getTitle() {\n return model.get('title');\n },\n\n /**\n * Set the content of the modal window\n * @param {string | HTMLElement} content Content\n * @returns {this}\n * @example\n * // pass a string\n * modal.setContent('Some content');\n * // or an HTMLElement\n * const el = document.createElement('div');\n * el.innerText = 'New content';\n * modal.setContent(el);\n */\n setContent(content) {\n model.set('content', ' ');\n model.set('content', content);\n return this;\n },\n\n /**\n * Get the content of the modal window\n * @returns {string | HTMLElement}\n * @example\n * modal.getContent();\n */\n getContent() {\n return model.get('content');\n },\n\n /**\n * Returns content element\n * @return {HTMLElement}\n * @private\n */\n getContentEl() {\n return modal.getContent().get(0);\n },\n\n /**\n * Returns modal model\n * @return {Model}\n * @private\n */\n getModel() {\n return model;\n },\n\n /**\n * Render the modal window\n * @return {HTMLElement}\n * @private\n */\n render() {\n if (this.getConfig().custom) return;\n const View = ModalView.extend(c.extend);\n const el = modal && modal.el;\n modal = new View({\n el,\n model,\n config: c\n });\n return modal.render().$el;\n },\n\n destroy() {\n modal && modal.remove();\n [c, model, modal].forEach(i => (i = {}));\n this.em = {};\n }\n };\n};\n","export default {\n // Style prefix\n stylePrefix: 'css-',\n\n // Default CSS style\n rules: []\n};\n","import { Model } from 'backbone';\nimport Styleable from 'domain_abstract/model/Styleable';\nimport { isEmpty, forEach, isString, isArray } from 'underscore';\nimport Selectors from 'selector_manager/model/Selectors';\nimport { isEmptyObj, hasWin } from 'utils/mixins';\n\nconst { CSS } = hasWin() ? window : {};\n\n/**\n * @typedef CssRule\n * @property {Array} selectors Array of selectors\n * @property {Object} style Object containing style definitions\n * @property {String} [selectorsAdd=''] Additional string css selectors\n * @property {String} [atRuleType=''] Type of at-rule, eg. `media`, 'font-face'\n * @property {String} [mediaText=''] At-rule value, eg. `(max-width: 1000px)`\n * @property {Boolean} [singleAtRule=false] This property is used only on at-rules, like 'page' or 'font-face', where the block containes only style declarations\n * @property {String} [state=''] State of the rule, eg: `hover`, `focused`\n * @property {Boolean|Array} [important=false] If true, sets `!important` on all properties. You can also pass an array to specify properties on which use important\n * @property {Boolean} [stylable=true] Indicates if the rule is stylable from the editor\n */\nexport default class CssRule extends Model.extend(Styleable) {\n defaults() {\n return {\n selectors: [],\n selectorsAdd: '',\n style: {},\n mediaText: '',\n state: '',\n stylable: true,\n atRuleType: '',\n singleAtRule: false,\n important: false,\n group: '',\n _undo: true\n };\n }\n\n initialize(c, opt = {}) {\n this.config = c || {};\n this.opt = opt;\n this.em = opt.em;\n this.ensureSelectors();\n this.on('change', this.__onChange);\n }\n\n __onChange(m, opts) {\n const { em } = this;\n const changed = this.changedAttributes();\n !isEmptyObj(changed) && em && em.changesUp(opts);\n }\n\n clone() {\n const opts = { ...this.opt };\n const attr = { ...this.attributes };\n attr.selectors = this.get('selectors').map(s => s.clone());\n return new this.constructor(attr, opts);\n }\n\n ensureSelectors(m, c, opts) {\n const { em } = this;\n const sm = em && em.get('SelectorManager');\n const toListen = [this, 'change:selectors', this.ensureSelectors];\n let sels = this.getSelectors();\n this.stopListening(...toListen);\n\n if (sels.models) {\n sels = [...sels.models];\n }\n\n sels = isString(sels) ? [sels] : sels;\n\n if (Array.isArray(sels)) {\n const res = sels.filter(i => i).map(i => (sm ? sm.add(i) : i));\n sels = new Selectors(res);\n }\n\n this.set('selectors', sels, opts);\n this.listenTo(...toListen);\n }\n\n /**\n * Returns the at-rule statement when exists, eg. `@media (...)`, `@keyframes`\n * @returns {String}\n * @example\n * const cssRule = editor.Css.setRule('.class1', { color: 'red' }, {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)'\n * });\n * cssRule.getAtRule(); // \"@media (min-width: 500px)\"\n */\n getAtRule() {\n const type = this.get('atRuleType');\n const condition = this.get('mediaText');\n // Avoid breaks with the last condition\n const typeStr = type ? `@${type}` : condition ? '@media' : '';\n\n return typeStr + (condition && typeStr ? ` ${condition}` : '');\n }\n\n /**\n * Return selectors of the rule as a string\n * @param {Object} [opts] Options\n * @param {Boolean} [opts.skipState] Skip state from the result\n * @returns {String}\n * @example\n * const cssRule = editor.Css.setRule('.class1:hover', { color: 'red' });\n * cssRule.selectorsToString(); // \".class1:hover\"\n * cssRule.selectorsToString({ skipState: true }); // \".class1\"\n */\n selectorsToString(opts = {}) {\n const result = [];\n const state = this.get('state');\n const wrapper = this.get('wrapper');\n const addSelector = this.get('selectorsAdd');\n const isBody = wrapper && opts.body;\n const selOpts = {\n escape: str => (CSS && CSS.escape ? CSS.escape(str) : str)\n };\n const selectors = isBody\n ? 'body'\n : this.get('selectors').getFullString(0, selOpts);\n const stateStr = state && !opts.skipState ? `:${state}` : '';\n selectors && result.push(`${selectors}${stateStr}`);\n addSelector && !opts.skipAdd && result.push(addSelector);\n return result.join(', ');\n }\n\n /**\n * Get declaration block (without the at-rule statement)\n * @param {Object} [opts={}] Options (same as in `selectorsToString`)\n * @returns {String}\n * @example\n * const cssRule = editor.Css.setRule('.class1', { color: 'red' }, {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)'\n * });\n * cssRule.getDeclaration() // \".class1{color:red;}\"\n */\n getDeclaration(opts = {}) {\n let result = '';\n const selectors = this.selectorsToString(opts);\n const style = this.styleToString(opts);\n const singleAtRule = this.get('singleAtRule');\n\n if ((selectors || singleAtRule) && style) {\n result = singleAtRule ? style : `${selectors}{${style}}`;\n }\n\n return result;\n }\n\n /**\n * Return the CSS string of the rule\n * @param {Object} [opts={}] Options (same as in `getDeclaration`)\n * @return {String} CSS string\n * @example\n * const cssRule = editor.Css.setRule('.class1', { color: 'red' }, {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)'\n * });\n * cssRule.toCSS() // \"@media (min-width: 500px){.class1{color:red;}}\"\n */\n toCSS(opts = {}) {\n let result = '';\n const atRule = this.getAtRule();\n const block = this.getDeclaration(opts);\n block && (result = block);\n\n if (atRule && result) {\n result = `${atRule}{${result}}`;\n }\n\n return result;\n }\n\n toJSON(...args) {\n const obj = Model.prototype.toJSON.apply(this, args);\n\n if (this.em.getConfig('avoidDefaults')) {\n const defaults = this.defaults();\n\n forEach(defaults, (value, key) => {\n if (obj[key] === value) {\n delete obj[key];\n }\n });\n\n if (isEmpty(obj.selectors)) delete obj.selectors;\n if (isEmpty(obj.style)) delete obj.style;\n }\n\n return obj;\n }\n\n /**\n * Compare the actual model with parameters\n * @param {Object} selectors Collection of selectors\n * @param {String} state Css rule state\n * @param {String} width For which device this style is oriented\n * @param {Object} ruleProps Other rule props\n * @returns {Boolean}\n * @private\n */\n compare(selectors, state, width, ruleProps = {}) {\n const st = state || '';\n const wd = width || '';\n const selAdd = ruleProps.selectorsAdd || '';\n let atRule = ruleProps.atRuleType || '';\n const sel =\n !isArray(selectors) && !selectors.models\n ? [selectors]\n : selectors.models || selectors;\n\n // Fix atRuleType in case is not specified with width\n if (wd && !atRule) atRule = 'media';\n\n const a1 = sel.map(model => model.getFullName());\n const a2 = this.get('selectors').map(model => model.getFullName());\n\n // Check selectors\n const a1S = a1.slice().sort();\n const a2S = a2.slice().sort();\n if (a1.length !== a2.length || !a1S.every((v, i) => v === a2S[i])) {\n return false;\n }\n\n // Check other properties\n if (\n this.get('state') !== st ||\n this.get('mediaText') !== wd ||\n this.get('selectorsAdd') !== selAdd ||\n this.get('atRuleType') !== atRule\n ) {\n return false;\n }\n\n return true;\n }\n}\n","import Backbone from 'backbone';\nimport CssRule from './CssRule';\n\nconst { Collection } = Backbone;\n\nexport default Collection.extend({\n model: CssRule,\n\n initialize(models, opt) {\n // Inject editor\n if (opt && opt.em) this.editor = opt.em;\n\n // This will put the listener post CssComposer.postLoad\n setTimeout(() => {\n this.on('remove', this.onRemove);\n this.on('add', this.onAdd);\n });\n },\n\n toJSON(opts) {\n const result = Collection.prototype.toJSON.call(this, opts);\n return result.filter(i => i.style);\n },\n\n onAdd(model, c, o) {\n model.ensureSelectors(model, c, o); // required for undo\n },\n\n onRemove(removed) {\n const em = this.editor;\n em.stopListening(removed);\n em.get('UndoManager').remove(removed);\n },\n\n add(models, opt = {}) {\n if (typeof models === 'string') {\n models = this.editor.get('Parser').parseCss(models);\n }\n opt.em = this.editor;\n return Collection.prototype.add.apply(this, [models, opt]);\n }\n});\n","/**\n * This module manages CSS rules in the canvas.\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/css_composer/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * cssComposer: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const css = editor.Css;\n * ```\n *\n * * [addRules](#addrules)\n * * [setRule](#setrule)\n * * [getRule](#getrule)\n * * [getRules](#getrules)\n * * [remove](#remove)\n * * [clear](#clear)\n *\n * [CssRule]: css_rule.html\n *\n * @module CssComposer\n */\n\nimport { isArray, isString, isUndefined, each } from 'underscore';\nimport { isObject } from 'utils/mixins';\nimport defaults from './config/config';\nimport CssRule from './model/CssRule';\nimport CssRules from './model/CssRules';\nimport CssRulesView from './view/CssRulesView';\nimport Selectors from 'selector_manager/model/Selectors';\nimport Selector from 'selector_manager/model/Selector';\n\nexport default () => {\n let em;\n var c = {};\n var rules, rulesView;\n\n return {\n Selectors,\n\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'CssComposer',\n\n getConfig() {\n return c;\n },\n\n /**\n * Mandatory for the storage manager\n * @type {String}\n * @private\n */\n storageKey() {\n var keys = [];\n var smc = (c.stm && c.stm.getConfig()) || {};\n if (smc.storeCss) keys.push('css');\n if (smc.storeStyles) keys.push('styles');\n return keys;\n },\n\n /**\n * Initializes module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @private\n */\n init(config) {\n c = config || {};\n for (var name in defaults) {\n if (!(name in c)) c[name] = defaults[name];\n }\n\n var ppfx = c.pStylePrefix;\n if (ppfx) c.stylePrefix = ppfx + c.stylePrefix;\n\n var elStyle = (c.em && c.em.config.style) || '';\n c.rules = elStyle || c.rules;\n\n em = c.em;\n rules = new CssRules([], c);\n return this;\n },\n\n /**\n * On load callback\n * @private\n */\n onLoad() {\n rules.add(c.rules, { silent: 1 });\n },\n\n /**\n * Do stuff after load\n * @param {Editor} em\n * @private\n */\n postLoad() {\n const um = em && em.get('UndoManager');\n um && um.add(this.getAll());\n },\n\n /**\n * Load data from the passed object, if the object is empty will try to fetch them\n * autonomously from the storage manager.\n * The fetched data will be added to the collection\n * @param {Object} data Object of data to load\n * @return {Object} Loaded rules\n * @private\n */\n load(data) {\n var d = data || '';\n\n if (!d && c.stm) {\n d = c.em.getCacheLoad();\n }\n\n var obj = d.styles || '';\n\n if (d.styles) {\n try {\n obj = JSON.parse(d.styles);\n } catch (err) {}\n } else if (d.css) {\n obj = c.em.get('Parser').parseCss(d.css);\n }\n\n if (isArray(obj)) {\n obj.length && rules.reset(obj);\n } else if (obj) {\n rules.reset(obj);\n }\n\n return obj;\n },\n\n /**\n * Store data to the selected storage\n * @param {Boolean} noStore If true, won't store\n * @return {Object} Data to store\n * @private\n */\n store(noStore) {\n if (!c.stm) return;\n const obj = {};\n const keys = this.storageKey();\n const hasPages = em && em.get('hasPages');\n if (keys.indexOf('css') >= 0 && !hasPages) obj.css = c.em.getCss();\n if (keys.indexOf('styles') >= 0) obj.styles = JSON.stringify(rules);\n if (!noStore) c.stm.store(obj);\n return obj;\n },\n\n /**\n * Add new rule to the collection, if not yet exists with the same selectors\n * @param {Array} selectors Array of selectors\n * @param {String} state Css rule state\n * @param {String} width For which device this style is oriented\n * @param {Object} props Other props for the rule\n * @param {Object} opts Options for the add of new rule\n * @return {Model}\n * @private\n * @example\n * var sm = editor.SelectorManager;\n * var sel1 = sm.add('myClass1');\n * var sel2 = sm.add('myClass2');\n * var rule = cssComposer.add([sel1, sel2], 'hover');\n * rule.set('style', {\n * width: '100px',\n * color: '#fff',\n * });\n * */\n add(selectors, state, width, opts = {}, addOpts = {}) {\n var s = state || '';\n var w = width || '';\n var opt = { ...opts };\n var rule = this.get(selectors, s, w, opt);\n\n // do not create rules that were found before\n // unless this is a single at-rule, for which multiple declarations\n // make sense (e.g. multiple `@font-type`s)\n if (rule && rule.config && !rule.config.singleAtRule) {\n return rule;\n } else {\n opt.state = s;\n opt.mediaText = w;\n opt.selectors = [];\n w && (opt.atRuleType = 'media');\n rule = new CssRule(opt, c);\n rule.get('selectors').add(selectors, addOpts);\n rules.add(rule, addOpts);\n return rule;\n }\n },\n\n /**\n * Get the rule\n * @param {String|Array} selectors Array of selectors or selector string, eg `.myClass1.myClass2`\n * @param {String} state Css rule state, eg. 'hover'\n * @param {String} width Media rule value, eg. '(max-width: 992px)'\n * @param {Object} ruleProps Other rule props\n * @return {Model|null}\n * @private\n * @example\n * const sm = editor.SelectorManager;\n * const sel1 = sm.add('myClass1');\n * const sel2 = sm.add('myClass2');\n * const rule = cssComposer.get([sel1, sel2], 'hover', '(max-width: 992px)');\n * // Update the style\n * rule.set('style', {\n * width: '300px',\n * color: '#000',\n * });\n * */\n get(selectors, state, width, ruleProps) {\n let slc = selectors;\n if (isString(selectors)) {\n const sm = em.get('SelectorManager');\n const singleSel = selectors.split(',')[0].trim();\n const node = em\n .get('Parser')\n .parserCss.checkNode({ selectors: singleSel })[0];\n slc = sm.get(node.selectors);\n }\n return (\n rules.find(rule => rule.compare(slc, state, width, ruleProps)) || null\n );\n },\n\n getAll() {\n return rules;\n },\n\n /**\n * Add a raw collection of rule objects\n * This method overrides styles, in case, of already defined rule\n * @param {String|Array} data CSS string or an array of rule objects, eg. [{selectors: ['class1'], style: {....}}, ..]\n * @param {Object} opts Options\n * @param {Object} props Additional properties to add on rules\n * @return {Array}\n * @private\n */\n addCollection(data, opts = {}, props = {}) {\n const result = [];\n\n if (isString(data)) {\n data = em.get('Parser').parseCss(data);\n }\n\n const d = data instanceof Array ? data : [data];\n\n for (var i = 0, l = d.length; i < l; i++) {\n var rule = d[i] || {};\n if (!rule.selectors) continue;\n var sm = c.em && c.em.get('SelectorManager');\n if (!sm) console.warn('Selector Manager not found');\n var sl = rule.selectors;\n var sels = sl instanceof Array ? sl : [sl];\n var newSels = [];\n\n for (var j = 0, le = sels.length; j < le; j++) {\n var selec = sm.add(sels[j]);\n newSels.push(selec);\n }\n\n var modelExists = this.get(newSels, rule.state, rule.mediaText, rule);\n var model = this.add(newSels, rule.state, rule.mediaText, rule, opts);\n var updateStyle = !modelExists || !opts.avoidUpdateStyle;\n const style = rule.style || {};\n\n isObject(props) && model.set(props, opts);\n\n if (updateStyle) {\n let styleUpdate = opts.extend\n ? { ...model.get('style'), ...style }\n : style;\n model.set('style', styleUpdate, opts);\n }\n\n result.push(model);\n }\n\n return result;\n },\n\n /**\n * Add CssRules via CSS string.\n * @param {String} css CSS string of rules to add.\n * @returns {Array<[CssRule]>} Array of rules\n * @example\n * const addedRules = css.addRules('.my-cls{ color: red } @media (max-width: 992px) { .my-cls{ color: darkred } }');\n * // Check rules\n * console.log(addedRules.map(rule => rule.toCSS()));\n */\n addRules(css) {\n return this.addCollection(css);\n },\n\n /**\n * Add/update the CssRule.\n * @param {String} selectors Selector string, eg. `.myclass`\n * @param {Object} style Style properties and values\n * @param {Object} [opts={}] Additional properties\n * @param {String} [opts.atRuleType=''] At-rule type, eg. `media`\n * @param {String} [opts.atRuleParams=''] At-rule parameters, eg. `(min-width: 500px)`\n * @returns {[CssRule]} The new/updated CssRule\n * @example\n * // Simple class-based rule\n * const rule = css.setRule('.class1.class2', { color: 'red' });\n * console.log(rule.toCSS()) // output: .class1.class2 { color: red }\n * // With state and other mixed selector\n * const rule = css.setRule('.class1.class2:hover, div#myid', { color: 'red' });\n * // output: .class1.class2:hover, div#myid { color: red }\n * // With media\n * const rule = css.setRule('.class1:hover', { color: 'red' }, {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)',\n * });\n * // output: @media (min-width: 500px) { .class1:hover { color: red } }\n */\n setRule(selectors, style, opts = {}) {\n const { atRuleType, atRuleParams } = opts;\n const node = em.get('Parser').parserCss.checkNode({\n selectors,\n style\n })[0];\n const { state, selectorsAdd } = node;\n const sm = em.get('SelectorManager');\n const selector = sm.add(node.selectors);\n const rule = this.add(selector, state, atRuleParams, {\n selectorsAdd,\n atRule: atRuleType\n });\n rule.setStyle(style, opts);\n return rule;\n },\n\n /**\n * Get the CssRule.\n * @param {String} selectors Selector string, eg. `.myclass:hover`\n * @param {Object} [opts={}] Additional properties\n * @param {String} [opts.atRuleType=''] At-rule type, eg. `media`\n * @param {String} [opts.atRuleParams=''] At-rule parameters, eg. '(min-width: 500px)'\n * @returns {[CssRule]}\n * @example\n * const rule = css.getRule('.myclass1:hover');\n * const rule2 = css.getRule('.myclass1:hover, div#myid');\n * const rule3 = css.getRule('.myclass1', {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)',\n * });\n */\n getRule(selectors, opts = {}) {\n const sm = em.get('SelectorManager');\n const node = em.get('Parser').parserCss.checkNode({ selectors })[0];\n const selector = sm.get(node.selectors);\n const { state, selectorsAdd } = node;\n const { atRuleType, atRuleParams } = opts;\n return (\n selector &&\n this.get(selector, state, atRuleParams, {\n selectorsAdd,\n atRule: atRuleType\n })\n );\n },\n\n /**\n * Get all rules or filtered by a matching selector.\n * @param {String} [selector=''] Selector, eg. `.myclass`\n * @returns {Array<[CssRule]>}\n * @example\n * // Take all the component specific rules\n * const id = someComponent.getId();\n * const rules = css.getRules(`#${id}`);\n * console.log(rules.map(rule => rule.toCSS()))\n * // All rules in the project\n * console.log(css.getRules())\n */\n getRules(selector) {\n const rules = this.getAll();\n if (!selector) return [...rules.models];\n const result = rules.filter(\n r => r.getSelectors().getFullString() === selector\n );\n return result;\n },\n\n /**\n * Add/update the CSS rule with id selector\n * @param {string} name Id selector name, eg. 'my-id'\n * @param {Object} style Style properties and values\n * @param {Object} [opts={}] Custom options, like `state` and `mediaText`\n * @return {CssRule} The new/updated rule\n * @private\n * @example\n * const rule = css.setIdRule('myid', { color: 'red' });\n * const ruleHover = css.setIdRule('myid', { color: 'blue' }, { state: 'hover' });\n * // This will add current CSS:\n * // #myid { color: red }\n * // #myid:hover { color: blue }\n */\n setIdRule(name, style = {}, opts = {}) {\n const { addOpts = {}, mediaText } = opts;\n const state = opts.state || '';\n const media = !isUndefined(mediaText) ? mediaText : em.getCurrentMedia();\n const sm = em.get('SelectorManager');\n const selector = sm.add({ name, type: Selector.TYPE_ID }, addOpts);\n const rule = this.add(selector, state, media, {}, addOpts);\n rule.setStyle(style, { ...opts, ...addOpts });\n return rule;\n },\n\n /**\n * Get the CSS rule by id selector\n * @param {string} name Id selector name, eg. 'my-id'\n * @param {Object} [opts={}] Custom options, like `state` and `mediaText`\n * @return {CssRule}\n * @private\n * @example\n * const rule = css.getIdRule('myid');\n * const ruleHover = css.setIdRule('myid', { state: 'hover' });\n */\n getIdRule(name, opts = {}) {\n const { mediaText } = opts;\n const state = opts.state || '';\n const media = !isUndefined(mediaText) ? mediaText : em.getCurrentMedia();\n const selector = em.get('SelectorManager').get(name, Selector.TYPE_ID);\n return selector && this.get(selector, state, media);\n },\n\n /**\n * Add/update the CSS rule with class selector\n * @param {string} name Class selector name, eg. 'my-class'\n * @param {Object} style Style properties and values\n * @param {Object} [opts={}] Custom options, like `state` and `mediaText`\n * @return {CssRule} The new/updated rule\n * @private\n * @example\n * const rule = css.setClassRule('myclass', { color: 'red' });\n * const ruleHover = css.setClassRule('myclass', { color: 'blue' }, { state: 'hover' });\n * // This will add current CSS:\n * // .myclass { color: red }\n * // .myclass:hover { color: blue }\n */\n setClassRule(name, style = {}, opts = {}) {\n const state = opts.state || '';\n const media = opts.mediaText || em.getCurrentMedia();\n const sm = em.get('SelectorManager');\n const selector = sm.add({ name, type: Selector.TYPE_CLASS });\n const rule = this.add(selector, state, media);\n rule.setStyle(style, opts);\n return rule;\n },\n\n /**\n * Get the CSS rule by class selector\n * @param {string} name Class selector name, eg. 'my-class'\n * @param {Object} [opts={}] Custom options, like `state` and `mediaText`\n * @return {CssRule}\n * @private\n * @example\n * const rule = css.getClassRule('myclass');\n * const ruleHover = css.getClassRule('myclass', { state: 'hover' });\n */\n getClassRule(name, opts = {}) {\n const state = opts.state || '';\n const media = opts.mediaText || em.getCurrentMedia();\n const selector = em.get('SelectorManager').get(name, Selector.TYPE_CLASS);\n return selector && this.get(selector, state, media);\n },\n\n /**\n * Remove rule, by CssRule or matching selector (eg. the selector will match also at-rules like `@media`)\n * @param {String|[CssRule]|Array<[CssRule]>} rule CssRule or matching selector.\n * @return {Array<[CssRule]>} Removed rules\n * @example\n * // Remove by CssRule\n * const toRemove = css.getRules('.my-cls');\n * css.remove(toRemove);\n * // Remove by selector\n * css.remove('.my-cls-2');\n */\n remove(rule) {\n const toRemove = isString(rule) ? this.getRules(rule) : rule;\n const result = this.getAll().remove(toRemove);\n return isArray(result) ? result : [result];\n },\n\n /**\n * Remove all rules\n * @return {this}\n */\n clear(opts = {}) {\n this.getAll().reset(null, opts);\n return this;\n },\n\n getComponentRules(cmp, opts = {}) {\n let { state, mediaText, current } = opts;\n if (current) {\n state = em.get('state') || '';\n mediaText = em.getCurrentMedia();\n }\n const id = cmp.getId();\n const rules = this.getAll().filter(r => {\n if (!isUndefined(state) && r.get('state') !== state) return;\n if (!isUndefined(mediaText) && r.get('mediaText') !== mediaText) return;\n return r.getSelectorsString() === `#${id}`;\n });\n return rules;\n },\n\n /**\n * Render the block of CSS rules\n * @return {HTMLElement}\n * @private\n */\n render() {\n rulesView && rulesView.remove();\n rulesView = new CssRulesView({\n collection: rules,\n config: c\n });\n return rulesView.render().el;\n },\n\n destroy() {\n rules.reset();\n rules.stopListening();\n rulesView && rulesView.remove();\n [em, rules, rulesView].forEach(i => (i = null));\n c = {};\n }\n };\n};\n","import Backbone from 'backbone';\nimport {\n isString,\n isFunction,\n isArray,\n result,\n each,\n bindAll\n} from 'underscore';\nimport {\n on,\n off,\n matches,\n getElement,\n getPointerEvent,\n isTextNode,\n getModel\n} from 'utils/mixins';\nconst $ = Backbone.$;\n\nexport default Backbone.View.extend({\n initialize(opt) {\n this.opt = opt || {};\n bindAll(\n this,\n 'startSort',\n 'onMove',\n 'endMove',\n 'rollback',\n 'updateOffset',\n 'moveDragHelper'\n );\n var o = opt || {};\n this.elT = 0;\n this.elL = 0;\n this.borderOffset = o.borderOffset || 10;\n\n var el = o.container;\n this.el = typeof el === 'string' ? document.querySelector(el) : el;\n this.$el = $(this.el);\n\n this.containerSel = o.containerSel || 'div';\n this.itemSel = o.itemSel || 'div';\n this.draggable = o.draggable || true;\n this.nested = o.nested || 0;\n this.pfx = o.pfx || '';\n this.ppfx = o.ppfx || '';\n this.freezeClass = o.freezeClass || this.pfx + 'freezed';\n this.onStart = o.onStart || '';\n this.onEndMove = o.onEndMove || '';\n this.customTarget = o.customTarget;\n this.onEnd = o.onEnd;\n this.direction = o.direction || 'v'; // v (vertical), h (horizontal), a (auto)\n this.onMoveClb = o.onMove || '';\n this.relative = o.relative || 0;\n this.ignoreViewChildren = o.ignoreViewChildren || 0;\n this.ignoreModels = o.ignoreModels || 0;\n this.plh = o.placer || '';\n // Frame offset\n this.wmargin = o.wmargin || 0;\n this.offTop = o.offsetTop || 0;\n this.offLeft = o.offsetLeft || 0;\n this.document = o.document || document;\n this.$document = $(this.document);\n this.dropContent = null;\n this.em = o.em || '';\n this.dragHelper = null;\n this.canvasRelative = o.canvasRelative || 0;\n this.selectOnEnd = !o.avoidSelectOnEnd;\n this.scale = o.scale;\n this.activeTextModel = null;\n\n if (this.em && this.em.on) {\n this.em.on('change:canvasOffset', this.updateOffset);\n this.updateOffset();\n }\n },\n\n getScale() {\n return result(this, scale) || 1;\n },\n\n getContainerEl(elem) {\n if (elem) this.el = elem;\n\n if (!this.el) {\n var el = this.opt.container;\n this.el = typeof el === 'string' ? document.querySelector(el) : el;\n this.$el = $(this.el);\n }\n return this.el;\n },\n\n getDocuments(el) {\n const em = this.em;\n const elDoc = el\n ? el.ownerDocument\n : em && em.get('Canvas').getBody().ownerDocument;\n const docs = [document];\n elDoc && docs.push(elDoc);\n return docs;\n },\n\n /**\n * Triggered when the offset of the editro is changed\n */\n updateOffset() {\n const offset = this.em.get('canvasOffset') || {};\n this.offTop = offset.top;\n this.offLeft = offset.left;\n },\n\n /**\n * Set content to drop\n * @param {String|Object} content\n */\n setDropContent(content) {\n this.dropModel = null;\n this.dropContent = content;\n },\n\n updateTextViewCursorPosition(e) {\n const Canvas = this.em.get('Canvas');\n const targetDoc = Canvas.getDocument();\n let range = null;\n\n if (targetDoc.caretRangeFromPoint) {\n // Chrome\n const poiner = getPointerEvent(e);\n range = targetDoc.caretRangeFromPoint(poiner.clientX, poiner.clientY);\n } else if (e.rangeParent) {\n // Firefox\n range = targetDoc.createRange();\n range.setStart(e.rangeParent, e.rangeOffset);\n }\n\n const sel = Canvas.getWindow().getSelection();\n Canvas.getFrameEl().focus();\n sel.removeAllRanges();\n range && sel.addRange(range);\n },\n\n setContentEditable(model, mode) {\n if (model) {\n const el = model.getEl();\n if (el.contentEditable != mode) el.contentEditable = mode;\n }\n },\n\n /**\n * Toggle cursor while sorting\n * @param {Boolean} active\n */\n toggleSortCursor(active) {\n const { em } = this;\n const cv = em && em.get('Canvas');\n\n // Avoid updating body className as it causes a huge repaint\n // Noticeable with \"fast\" drag of blocks\n cv && (active ? cv.startAutoscroll() : cv.stopAutoscroll());\n },\n\n /**\n * Set drag helper\n * @param {HTMLElement} el\n * @param {Event} event\n */\n setDragHelper(el, event) {\n const ev = event || '';\n const clonedEl = el.cloneNode(1);\n const rect = el.getBoundingClientRect();\n const computed = getComputedStyle(el);\n let style = '';\n\n for (var i = 0; i < computed.length; i++) {\n const prop = computed[i];\n style += `${prop}:${computed.getPropertyValue(prop)};`;\n }\n\n document.body.appendChild(clonedEl);\n clonedEl.className += ` ${this.pfx}bdrag`;\n clonedEl.setAttribute('style', style);\n this.dragHelper = clonedEl;\n clonedEl.style.width = `${rect.width}px`;\n clonedEl.style.height = `${rect.height}px`;\n ev && this.moveDragHelper(ev);\n\n // Listen mouse move events\n if (this.em) {\n $(this.em.get('Canvas').getBody().ownerDocument)\n .off('mousemove', this.moveDragHelper)\n .on('mousemove', this.moveDragHelper);\n }\n $(document)\n .off('mousemove', this.moveDragHelper)\n .on('mousemove', this.moveDragHelper);\n },\n\n /**\n * Update the position of the helper\n * @param {Event} e\n */\n moveDragHelper(e) {\n const doc = e.target.ownerDocument;\n\n if (!this.dragHelper || !doc) {\n return;\n }\n\n let posY = e.pageY;\n let posX = e.pageX;\n let addTop = 0;\n let addLeft = 0;\n const window = doc.defaultView || doc.parentWindow;\n const frame = window.frameElement;\n const dragHelperStyle = this.dragHelper.style;\n\n // If frame is present that means mouse has moved over the editor's canvas,\n // which is rendered inside the iframe and the mouse move event comes from\n // the iframe, not the parent window. Mouse position relative to the frame's\n // parent window needs to account for the frame's position relative to the\n // parent window.\n if (frame) {\n const frameRect = frame.getBoundingClientRect();\n addTop = frameRect.top + document.documentElement.scrollTop;\n addLeft = frameRect.left + document.documentElement.scrollLeft;\n posY = e.clientY;\n posX = e.clientX;\n }\n\n dragHelperStyle.top = posY + addTop + 'px';\n dragHelperStyle.left = posX + addLeft + 'px';\n },\n\n /**\n * Returns true if the element matches with selector\n * @param {Element} el\n * @param {String} selector\n * @return {Boolean}\n */\n matches(el, selector, useBody) {\n return matches.call(el, selector);\n },\n\n /**\n * Closest parent\n * @param {Element} el\n * @param {String} selector\n * @return {Element|null}\n */\n closest(el, selector) {\n if (!el) return;\n var elem = el.parentNode;\n while (elem && elem.nodeType === 1) {\n if (this.matches(elem, selector)) return elem;\n elem = elem.parentNode;\n }\n return null;\n },\n\n /**\n * Get the offset of the element\n * @param {HTMLElement} el\n * @return {Object}\n */\n offset(el) {\n var rect = el.getBoundingClientRect();\n return {\n top: rect.top + document.body.scrollTop,\n left: rect.left + document.body.scrollLeft\n };\n },\n\n /**\n * Create placeholder\n * @return {HTMLElement}\n */\n createPlaceholder() {\n var pfx = this.pfx;\n var el = document.createElement('div');\n var ins = document.createElement('div');\n el.className = pfx + 'placeholder';\n el.style.display = 'none';\n el.style['pointer-events'] = 'none';\n ins.className = pfx + 'placeholder-int';\n el.appendChild(ins);\n return el;\n },\n\n /**\n * Picking component to move\n * @param {HTMLElement} src\n * */\n startSort(src, opts = {}) {\n const em = this.em;\n const itemSel = this.itemSel;\n const contSel = this.containerSel;\n const container = this.getContainerEl(opts.container);\n const docs = this.getDocuments(src);\n const onStart = this.onStart;\n let srcModel;\n let plh = this.plh;\n this.dropModel = null;\n this.target = null;\n this.prevTarget = null;\n this.moved = 0;\n\n // Check if the start element is a valid one, if not get the\n // closest valid one\n if (src && !this.matches(src, `${itemSel}, ${contSel}`)) {\n src = this.closest(src, itemSel);\n }\n\n this.eV = src;\n\n // Create placeholder if not yet exists\n if (!plh) {\n plh = this.createPlaceholder();\n container.appendChild(plh);\n this.plh = plh;\n }\n\n if (src) {\n srcModel = this.getSourceModel(src);\n srcModel && srcModel.set && srcModel.set('status', 'freezed');\n this.srcModel = srcModel;\n }\n\n on(container, 'mousemove dragover', this.onMove);\n on(docs, 'mouseup dragend touchend', this.endMove);\n on(docs, 'keydown', this.rollback);\n onStart &&\n onStart({\n sorter: this,\n target: srcModel,\n parent: srcModel && srcModel.parent(),\n index: srcModel && srcModel.index()\n });\n\n // Avoid strange effects on dragging\n em && em.clearSelection();\n this.toggleSortCursor(1);\n\n em && em.trigger('sorter:drag:start', src, srcModel);\n },\n\n /**\n * Get the model from HTMLElement target\n * @return {Model|null}\n */\n getTargetModel(el) {\n let elem = el || this.target;\n return $(elem).data('model');\n },\n\n /**\n * Get the model of the current source element (element to drag)\n * @return {Model}\n */\n getSourceModel(source, { target, avoidChildren = 1 } = {}) {\n const { em, eV } = this;\n const src = source || eV;\n let { dropModel, dropContent } = this;\n const isTextable = src =>\n src &&\n target &&\n src.opt &&\n src.opt.avoidChildren &&\n this.isTextableActive(src, target);\n\n if (dropContent && em) {\n if (isTextable(dropModel)) {\n dropModel = null;\n }\n\n if (!dropModel) {\n const comps = em.get('DomComponents').getComponents();\n const opts = {\n avoidChildren,\n avoidStore: 1,\n avoidUpdateStyle: 1\n };\n const tempModel = comps.add(dropContent, { ...opts, temporary: 1 });\n dropModel = comps.remove(tempModel, opts);\n dropModel = dropModel instanceof Array ? dropModel[0] : dropModel;\n this.dropModel = dropModel;\n\n if (isTextable(dropModel)) {\n return this.getSourceModel(src, { target, avoidChildren: 0 });\n }\n }\n\n return dropModel;\n }\n\n return src && $(src).data('model');\n },\n\n /**\n * Highlight target\n * @param {Model|null} model\n */\n selectTargetModel(model, source) {\n if (model instanceof Backbone.Collection) {\n return;\n }\n\n // Prevents loops in Firefox\n // https://github.com/artf/grapesjs/issues/2911\n if (source && source === model) return;\n\n const { targetModel } = this;\n\n // Reset the previous model but not if it's the same as the source\n // https://github.com/artf/grapesjs/issues/2478#issuecomment-570314736\n if (targetModel && targetModel !== this.srcModel) {\n targetModel.set('status', '');\n }\n\n if (model && model.set) {\n model.set('status', 'selected-parent');\n this.targetModel = model;\n }\n },\n\n /**\n * During move\n * @param {Event} e\n * */\n onMove(e) {\n const ev = e;\n const { em, onMoveClb, plh, customTarget } = this;\n this.moved = 1;\n\n // Turn placeholder visibile\n var dsp = plh.style.display;\n if (!dsp || dsp === 'none') plh.style.display = 'block';\n\n // Cache all necessary positions\n var eO = this.offset(this.el);\n this.elT = this.wmargin ? Math.abs(eO.top) : eO.top;\n this.elL = this.wmargin ? Math.abs(eO.left) : eO.left;\n var rY = e.pageY - this.elT + this.el.scrollTop;\n var rX = e.pageX - this.elL + this.el.scrollLeft;\n\n if (this.canvasRelative && em) {\n const mousePos = em\n .get('Canvas')\n .getMouseRelativeCanvas(e, { noScroll: 1 });\n rX = mousePos.x;\n rY = mousePos.y;\n }\n\n this.rX = rX;\n this.rY = rY;\n this.eventMove = e;\n\n //var targetNew = this.getTargetFromEl(e.target);\n const sourceModel = this.getSourceModel();\n const targetEl = customTarget\n ? customTarget({ sorter: this, event: e })\n : e.target;\n const dims = this.dimsFromTarget(targetEl, rX, rY);\n const target = this.target;\n const targetModel = target && this.getTargetModel(target);\n this.selectTargetModel(targetModel, sourceModel);\n if (!targetModel) plh.style.display = 'none';\n if (!target) return;\n this.lastDims = dims;\n const pos = this.findPosition(dims, rX, rY);\n\n if (this.isTextableActive(sourceModel, targetModel)) {\n this.activeTextModel = targetModel;\n this.setContentEditable(targetModel, true);\n\n plh.style.display = 'none';\n this.lastPos = pos;\n this.updateTextViewCursorPosition(ev);\n } else {\n this.disableTextable();\n this.activeTextModel = null;\n\n // If there is a significant changes with the pointer\n if (\n !this.lastPos ||\n this.lastPos.index != pos.index ||\n this.lastPos.method != pos.method\n ) {\n this.movePlaceholder(this.plh, dims, pos, this.prevTargetDim);\n if (!this.$plh) this.$plh = $(this.plh);\n\n // With canvasRelative the offset is calculated automatically for\n // each element\n if (!this.canvasRelative) {\n if (this.offTop) this.$plh.css('top', '+=' + this.offTop + 'px');\n if (this.offLeft) this.$plh.css('left', '+=' + this.offLeft + 'px');\n }\n\n this.lastPos = pos;\n }\n }\n\n isFunction(onMoveClb) &&\n onMoveClb({\n event: e,\n target: sourceModel,\n parent: targetModel,\n index: pos.index + (pos.method == 'after' ? 1 : 0)\n });\n\n em &&\n em.trigger('sorter:drag', {\n target,\n targetModel,\n sourceModel,\n dims,\n pos,\n x: rX,\n y: rY\n });\n },\n\n isTextableActive(src, trg) {\n return src && src.get && src.get('textable') && trg && trg.is('text');\n },\n\n disableTextable() {\n const { activeTextModel } = this;\n activeTextModel && activeTextModel.getView().disableEditing();\n },\n\n /**\n * Returns true if the elements is in flow, so is not in flow where\n * for example the component is with float:left\n * @param {HTMLElement} el\n * @param {HTMLElement} parent\n * @return {Boolean}\n * @private\n * */\n isInFlow(el, parent) {\n if (!el) return false;\n\n parent = parent || document.body;\n var ch = -1,\n h;\n var elem = el;\n h = elem.offsetHeight;\n if (/*h < ch || */ !this.styleInFlow(elem, parent)) return false;\n else return true;\n },\n\n /**\n * Check if el has style to be in flow\n * @param {HTMLElement} el\n * @param {HTMLElement} parent\n * @return {Boolean}\n * @private\n */\n styleInFlow(el, parent) {\n if (isTextNode(el)) return;\n const style = el.style || {};\n const $el = $(el);\n const $parent = parent && $(parent);\n\n if (style.overflow && style.overflow !== 'visible') return;\n const propFloat = $el.css('float');\n if (propFloat && propFloat !== 'none') return;\n if (\n $parent &&\n $parent.css('display') == 'flex' &&\n $parent.css('flex-direction') !== 'column'\n )\n return;\n switch (style.position) {\n case 'static':\n case 'relative':\n case '':\n break;\n default:\n return;\n }\n switch (el.tagName) {\n case 'TR':\n case 'TBODY':\n case 'THEAD':\n case 'TFOOT':\n return true;\n }\n switch ($el.css('display')) {\n case 'block':\n case 'list-item':\n case 'table':\n case 'flex':\n return true;\n }\n return;\n },\n\n /**\n * Check if the target is valid with the actual source\n * @param {HTMLElement} trg\n * @return {Boolean}\n */\n validTarget(trg, src) {\n const trgModel = this.getTargetModel(trg);\n const srcModel = this.getSourceModel(src, { target: trgModel });\n src = srcModel && srcModel.view && srcModel.view.el;\n trg = trgModel && trgModel.view && trgModel.view.el;\n let result = {\n valid: true,\n src,\n srcModel,\n trg,\n trgModel\n };\n\n if (!src || !trg) {\n result.valid = false;\n return result;\n }\n\n // check if the source is draggable in target\n let draggable = srcModel.get('draggable');\n draggable = draggable instanceof Array ? draggable.join(', ') : draggable;\n result.dragInfo = draggable;\n draggable = isString(draggable) ? this.matches(trg, draggable) : draggable;\n result.draggable = draggable;\n\n // Check if the target could accept the source\n let droppable = trgModel.get('droppable');\n\n if (isFunction(droppable)) {\n const res = droppable(srcModel, trgModel);\n result.droppable = res;\n result.dropInfo = res;\n droppable = res;\n } else {\n droppable = droppable instanceof Backbone.Collection ? 1 : droppable;\n droppable = droppable instanceof Array ? droppable.join(', ') : droppable;\n result.dropInfo = droppable;\n droppable = isString(droppable)\n ? this.matches(src, droppable)\n : droppable;\n droppable =\n draggable && this.isTextableActive(srcModel, trgModel) ? 1 : droppable;\n result.droppable = droppable;\n }\n\n if (!droppable || !draggable) {\n result.valid = false;\n }\n\n return result;\n },\n\n /**\n * Get dimensions of nodes relative to the coordinates\n * @param {HTMLElement} target\n * @param {number} rX Relative X position\n * @param {number} rY Relative Y position\n * @return {Array}\n */\n dimsFromTarget(target, rX, rY) {\n const em = this.em;\n var dims = [];\n\n if (!target) {\n return dims;\n }\n\n // Select the first valuable target\n if (!this.matches(target, `${this.itemSel}, ${this.containerSel}`)) {\n target = this.closest(target, this.itemSel);\n }\n\n // If draggable is an array the target will be one of those\n if (this.draggable instanceof Array) {\n target = this.closest(target, this.draggable.join(','));\n }\n\n if (!target) {\n return dims;\n }\n\n // Check if the target is different from the previous one\n if (this.prevTarget && this.prevTarget != target) {\n this.prevTarget = null;\n }\n\n // New target found\n if (!this.prevTarget) {\n this.targetP = this.closest(target, this.containerSel);\n\n // Check if the source is valid with the target\n let validResult = this.validTarget(target);\n em && em.trigger('sorter:drag:validation', validResult);\n\n if (!validResult.valid && this.targetP) {\n return this.dimsFromTarget(this.targetP, rX, rY);\n }\n\n this.prevTarget = target;\n this.prevTargetDim = this.getDim(target);\n this.cacheDimsP = this.getChildrenDim(this.targetP);\n this.cacheDims = this.getChildrenDim(target);\n }\n\n // If the target is the previous one will return the cached dims\n if (this.prevTarget == target) dims = this.cacheDims;\n\n // Target when I will drop element to sort\n this.target = this.prevTarget;\n\n // Generally, on any new target the poiner enters inside its area and\n // triggers nearBorders(), so have to take care of this\n if (\n this.nearBorders(this.prevTargetDim, rX, rY) ||\n (!this.nested && !this.cacheDims.length)\n ) {\n const targetParent = this.targetP;\n\n if (targetParent && this.validTarget(targetParent).valid) {\n dims = this.cacheDimsP;\n this.target = targetParent;\n }\n }\n\n this.lastPos = null;\n return dims;\n },\n\n /**\n * Get valid target from element\n * This method should replace dimsFromTarget()\n * @param {HTMLElement} el\n * @return {HTMLElement}\n */\n getTargetFromEl(el) {\n let target = el;\n let targetParent;\n let targetPrev = this.targetPrev;\n const em = this.em;\n const containerSel = this.containerSel;\n const itemSel = this.itemSel;\n\n // Select the first valuable target\n if (!this.matches(target, `${itemSel}, ${containerSel}`)) {\n target = this.closest(target, itemSel);\n }\n\n // If draggable is an array the target will be one of those\n // TODO check if this options is used somewhere\n if (this.draggable instanceof Array) {\n target = this.closest(target, this.draggable.join(','));\n }\n\n // Check if the target is different from the previous one\n if (targetPrev && targetPrev != target) {\n this.targetPrev = '';\n }\n\n // New target found\n if (!this.targetPrev) {\n targetParent = this.closest(target, containerSel);\n\n // If the current target is not valid (src/trg reasons) try with\n // the parent one (if exists)\n const validResult = this.validTarget(target);\n em && em.trigger('sorter:drag:validation', validResult);\n\n if (!validResult.valid && targetParent) {\n return this.getTargetFromEl(targetParent);\n }\n\n this.targetPrev = target;\n }\n\n // Generally, on any new target the poiner enters inside its area and\n // triggers nearBorders(), so have to take care of this\n if (this.nearElBorders(target)) {\n targetParent = this.closest(target, containerSel);\n\n if (targetParent && this.validTarget(targetParent).valid) {\n target = targetParent;\n }\n }\n\n return target;\n },\n\n /**\n * Check if the current pointer is neare to element borders\n * @return {Boolen}\n */\n nearElBorders(el) {\n const off = 10;\n const rect = el.getBoundingClientRect();\n const body = el.ownerDocument.body;\n const { x, y } = this.getCurrentPos();\n const top = rect.top + body.scrollTop;\n const left = rect.left + body.scrollLeft;\n const width = rect.width;\n const height = rect.height;\n\n if (\n y < top + off || // near top edge\n y > top + height - off || // near bottom edge\n x < left + off || // near left edge\n x > left + width - off // near right edge\n ) {\n return 1;\n }\n },\n\n getCurrentPos() {\n const ev = this.eventMove;\n const x = ev.pageX || 0;\n const y = ev.pageY || 0;\n return { x, y };\n },\n\n /**\n * Returns dimensions and positions about the element\n * @param {HTMLElement} el\n * @return {Array}\n */\n getDim(el) {\n const { em, canvasRelative } = this;\n const canvas = em && em.get('Canvas');\n const offsets = canvas ? canvas.getElementOffsets(el) : {};\n let top, left, height, width;\n\n if (canvasRelative && em) {\n const pos = canvas.getElementPos(el, { noScroll: 1 });\n top = pos.top; // - offsets.marginTop;\n left = pos.left; // - offsets.marginLeft;\n height = pos.height; // + offsets.marginTop + offsets.marginBottom;\n width = pos.width; // + offsets.marginLeft + offsets.marginRight;\n } else {\n var o = this.offset(el);\n top = this.relative\n ? el.offsetTop\n : o.top - (this.wmargin ? -1 : 1) * this.elT;\n left = this.relative\n ? el.offsetLeft\n : o.left - (this.wmargin ? -1 : 1) * this.elL;\n height = el.offsetHeight;\n width = el.offsetWidth;\n }\n\n return { top, left, height, width, offsets };\n },\n\n /**\n * Get children dimensions\n * @param {HTMLELement} el Element root\n * @retun {Array}\n * */\n getChildrenDim(trg) {\n const dims = [];\n if (!trg) return dims;\n\n // Get children based on getChildrenContainer\n const trgModel = this.getTargetModel(trg);\n if (trgModel && trgModel.view && !this.ignoreViewChildren) {\n const view = trgModel.getCurrentView\n ? trgModel.getCurrentView()\n : trgModel.view;\n trg = view.getChildrenContainer();\n }\n\n each(trg.children, (el, i) => {\n const model = getModel(el, $);\n const elIndex = model && model.index ? model.index() : i;\n\n if (!isTextNode(el) && !this.matches(el, this.itemSel)) {\n return;\n }\n\n const dim = this.getDim(el);\n let dir = this.direction;\n\n if (dir == 'v') dir = true;\n else if (dir == 'h') dir = false;\n else dir = this.isInFlow(el, trg);\n\n dim.dir = dir;\n dim.el = el;\n dim.indexEl = elIndex;\n dims.push(dim);\n });\n\n return dims;\n },\n\n /**\n * Check if the coordinates are near to the borders\n * @param {Array} dim\n * @param {number} rX Relative X position\n * @param {number} rY Relative Y position\n * @return {Boolean}\n * */\n nearBorders(dim, rX, rY) {\n var result = 0;\n var off = this.borderOffset;\n var x = rX || 0;\n var y = rY || 0;\n var t = dim.top;\n var l = dim.left;\n var h = dim.height;\n var w = dim.width;\n if (t + off > y || y > t + h - off || l + off > x || x > l + w - off)\n result = 1;\n\n return !!result;\n },\n\n /**\n * Find the position based on passed dimensions and coordinates\n * @param {Array} dims Dimensions of nodes to parse\n * @param {number} posX X coordindate\n * @param {number} posY Y coordindate\n * @retun {Object}\n * */\n findPosition(dims, posX, posY) {\n var result = { index: 0, indexEl: 0, method: 'before' };\n var leftLimit = 0,\n xLimit = 0,\n dimRight = 0,\n yLimit = 0,\n xCenter = 0,\n yCenter = 0,\n dimDown = 0,\n dim = 0;\n // Each dim is: Top, Left, Height, Width\n for (var i = 0, len = dims.length; i < len; i++) {\n dim = dims[i];\n const { top, left, height, width } = dim;\n // Right position of the element. Left + Width\n dimRight = left + width;\n // Bottom position of the element. Top + Height\n dimDown = top + height;\n // X center position of the element. Left + (Width / 2)\n xCenter = left + width / 2;\n // Y center position of the element. Top + (Height / 2)\n yCenter = top + height / 2;\n // Skip if over the limits\n if (\n (xLimit && left > xLimit) ||\n (yLimit && yCenter >= yLimit) || // >= avoid issue with clearfixes\n (leftLimit && dimRight < leftLimit)\n )\n continue;\n result.index = i;\n result.indexEl = dim.indexEl;\n // If it's not in flow (like 'float' element)\n if (!dim.dir) {\n if (posY < dimDown) yLimit = dimDown;\n //If x lefter than center\n if (posX < xCenter) {\n xLimit = xCenter;\n result.method = 'before';\n } else {\n leftLimit = xCenter;\n result.method = 'after';\n }\n } else {\n // If y upper than center\n if (posY < yCenter) {\n result.method = 'before';\n break;\n } else result.method = 'after'; // After last element\n }\n }\n return result;\n },\n\n /**\n * Updates the position of the placeholder\n * @param {HTMLElement} phl\n * @param {Array} dims\n * @param {Object} pos Position object\n * @param {Array} trgDim target dimensions ([top, left, height, width])\n * */\n movePlaceholder(plh, dims, pos, trgDim) {\n var marg = 0,\n t = 0,\n l = 0,\n w = 0,\n h = 0,\n un = 'px',\n margI = 5,\n method = pos.method;\n const elDim = dims[pos.index];\n\n // Placeholder orientation\n plh.classList.remove('vertical');\n plh.classList.add('horizontal');\n\n if (elDim) {\n // If it's not in flow (like 'float' element)\n const { top, left, height, width } = elDim;\n if (!elDim.dir) {\n w = 'auto';\n h = height - marg * 2 + un;\n t = top + marg;\n l = method == 'before' ? left - marg : left + width - marg;\n\n plh.classList.remove('horizontal');\n plh.classList.add('vertical');\n } else {\n w = width + un;\n h = 'auto';\n t = method == 'before' ? top - marg : top + height - marg;\n l = left;\n }\n } else {\n // Placeholder inside the component\n if (!this.nested) {\n plh.style.display = 'none';\n return;\n }\n if (trgDim) {\n const offset = trgDim.offsets || {};\n const pT = offset.paddingTop || margI;\n const pL = offset.paddingLeft || margI;\n t = trgDim.top + pT;\n l = trgDim.left + pL;\n w = parseInt(trgDim.width) - pL * 2 + un;\n h = 'auto';\n }\n }\n plh.style.top = t + un;\n plh.style.left = l + un;\n if (w) plh.style.width = w;\n if (h) plh.style.height = h;\n },\n\n /**\n * Leave item\n * @param event\n *\n * @return void\n * */\n endMove(e) {\n const src = this.eV;\n const moved = [];\n const docs = this.getDocuments();\n const container = this.getContainerEl();\n const onEndMove = this.onEndMove;\n const onEnd = this.onEnd;\n const { target, lastPos } = this;\n let srcModel;\n off(container, 'mousemove dragover', this.onMove);\n off(docs, 'mouseup dragend touchend', this.endMove);\n off(docs, 'keydown', this.rollback);\n this.plh.style.display = 'none';\n\n if (src) {\n srcModel = this.getSourceModel();\n if (this.selectOnEnd && srcModel && srcModel.set) {\n srcModel.set('status', '');\n srcModel.set('status', 'selected');\n }\n }\n\n if (this.moved && target) {\n const toMove = this.toMove;\n const toMoveArr = isArray(toMove) ? toMove : toMove ? [toMove] : [src];\n toMoveArr.forEach(model => {\n moved.push(this.move(target, model, lastPos));\n });\n }\n\n if (this.plh) this.plh.style.display = 'none';\n var dragHelper = this.dragHelper;\n\n if (dragHelper) {\n dragHelper.parentNode.removeChild(dragHelper);\n this.dragHelper = null;\n }\n\n this.disableTextable();\n this.selectTargetModel();\n this.toggleSortCursor();\n\n this.toMove = null;\n this.eventMove = 0;\n this.dropModel = null;\n\n if (isFunction(onEndMove)) {\n const data = {\n target: srcModel,\n parent: srcModel && srcModel.parent(),\n index: srcModel && srcModel.index()\n };\n moved.length\n ? moved.forEach(m => onEndMove(m, this, data))\n : onEndMove(null, this, { ...data, cancelled: 1 });\n }\n\n isFunction(onEnd) && onEnd({ sorter: this });\n },\n\n /**\n * Move component to new position\n * @param {HTMLElement} dst Destination target\n * @param {HTMLElement} src Element to move\n * @param {Object} pos Object with position coordinates\n * */\n move(dst, src, pos) {\n const { em, activeTextModel, dropContent } = this;\n const srcEl = getElement(src);\n em && em.trigger('component:dragEnd:before', dst, srcEl, pos); // @depricated\n let index = pos.indexEl;\n let modelToDrop, modelTemp, created;\n const warns = [];\n const validResult = this.validTarget(dst, srcEl);\n const targetCollection = $(dst).data('collection');\n const model = validResult.srcModel;\n let { droppable } = validResult;\n const { trgModel, draggable } = validResult;\n const dropInfo =\n validResult.dropInfo || (trgModel && trgModel.get('droppable'));\n const dragInfo = validResult.dragInfo || (model && model.get('draggable'));\n droppable = trgModel instanceof Backbone.Collection ? 1 : droppable;\n const isTextableActive = this.isTextableActive(model, trgModel);\n\n if (targetCollection && droppable && draggable) {\n index = pos.method === 'after' ? index + 1 : index;\n var opts = { at: index, noIncrement: 1 };\n\n if (!dropContent) {\n // Putting `avoidStore` here will make the UndoManager behave wrong\n opts.temporary = 1;\n modelTemp = targetCollection.add({}, { ...opts });\n\n if (model.collection) {\n modelToDrop = model.collection.remove(model, { temporary: 1 });\n }\n } else {\n modelToDrop = isFunction(dropContent) ? dropContent() : dropContent;\n opts.silent = false;\n opts.avoidUpdateStyle = 1;\n }\n\n if (isTextableActive) {\n const viewActive = activeTextModel.getView();\n activeTextModel.trigger('active');\n const { activeRte } = viewActive;\n const modelEl = model.getEl();\n delete model.opt.temporary;\n model.getView().render();\n modelEl.setAttribute('data-gjs-textable', 'true');\n const { outerHTML } = modelEl;\n activeRte.insertHTML && activeRte.insertHTML(outerHTML);\n } else {\n created = targetCollection.add(modelToDrop, opts);\n }\n\n if (!dropContent) {\n targetCollection.remove(modelTemp);\n } else {\n this.dropContent = null;\n }\n\n // This will cause to recalculate children dimensions\n this.prevTarget = null;\n } else if (em) {\n !targetCollection && warns.push('Target collection not found');\n !droppable &&\n dropInfo &&\n warns.push(`Target is not droppable, accepts [${dropInfo}]`);\n !draggable &&\n dragInfo &&\n warns.push(`Component not draggable, acceptable by [${dragInfo}]`);\n em.logWarning('Invalid target position', {\n errors: warns,\n model,\n context: 'sorter',\n target: trgModel\n });\n }\n\n if (em) {\n em.trigger('component:dragEnd', targetCollection, modelToDrop, warns); // @deprecated\n em.trigger('sorter:drag:end', {\n targetCollection,\n modelToDrop,\n warns,\n validResult,\n dst,\n srcEl\n });\n }\n\n return created;\n },\n\n /**\n * Rollback to previous situation\n * @param {Event}\n * @param {Bool} Indicates if rollback in anycase\n * */\n rollback(e) {\n off(this.getDocuments(), 'keydown', this.rollback);\n const key = e.which || e.keyCode;\n\n if (key == 27) {\n this.moved = 0;\n this.endMove();\n }\n }\n});\n","import { bindAll, defaults, isFunction, each } from 'underscore';\nimport { on, off, normalizeFloat } from 'utils/mixins';\n\nvar defaultOpts = {\n // Function which returns custom X and Y coordinates of the mouse\n mousePosFetcher: null,\n // Indicates custom target updating strategy\n updateTarget: null,\n // Function which gets HTMLElement as an arg and returns it relative position\n ratioDefault: 0,\n posFetcher: null,\n onStart: null,\n onMove: null,\n onEnd: null,\n onUpdateContainer: () => {},\n\n // Resize unit step\n step: 1,\n\n // Minimum dimension\n minDim: 10,\n\n // Maximum dimension\n maxDim: '',\n\n // Unit used for height resizing\n unitHeight: 'px',\n\n // Unit used for width resizing\n unitWidth: 'px',\n\n // The key used for height resizing\n keyHeight: 'height',\n\n // The key used for width resizing\n keyWidth: 'width',\n\n // If true, will override unitHeight and unitWidth, on start, with units\n // from the current focused element (currently used only in SelectComponent)\n currentUnit: 1,\n\n // With this option active the mousemove event won't be altered when\n // the pointer comes over iframes\n silentFrames: 0,\n\n // If true the container of handlers won't be updated\n avoidContainerUpdate: 0,\n\n // If height is 'auto', this setting will preserve it and only update width\n keepAutoHeight: false,\n\n // If width is 'auto', this setting will preserve it and only update height\n keepAutoWidth: false,\n\n // When keepAutoHeight is true and the height has the value 'auto', this is set to true and height isn't updated\n autoHeight: false,\n\n // When keepAutoWidth is true and the width has the value 'auto', this is set to true and width isn't updated\n autoWidth: false,\n\n // Handlers\n tl: 1, // Top left\n tc: 1, // Top center\n tr: 1, // Top right\n cl: 1, // Center left\n cr: 1, // Center right\n bl: 1, // Bottom left\n bc: 1, // Bottom center\n br: 1 // Bottom right\n};\n\nvar createHandler = (name, opts) => {\n var pfx = opts.prefix || '';\n var el = document.createElement('i');\n el.className = pfx + 'resizer-h ' + pfx + 'resizer-h-' + name;\n el.setAttribute('data-' + pfx + 'handler', name);\n return el;\n};\n\nvar getBoundingRect = (el, win) => {\n var w = win || window;\n var rect = el.getBoundingClientRect();\n return {\n left: rect.left + w.pageXOffset,\n top: rect.top + w.pageYOffset,\n width: rect.width,\n height: rect.height\n };\n};\n\nclass Resizer {\n /**\n * Init the Resizer with options\n * @param {Object} options\n */\n constructor(opts = {}) {\n this.setOptions(opts);\n bindAll(this, 'handleKeyDown', 'handleMouseDown', 'move', 'stop');\n return this;\n }\n\n /**\n * Get current connfiguration options\n * @return {Object}\n */\n getConfig() {\n return this.opts;\n }\n\n /**\n * Setup options\n * @param {Object} options\n */\n setOptions(options = {}) {\n this.opts = defaults(options, defaultOpts);\n this.setup();\n }\n\n /**\n * Setup resizer\n */\n setup() {\n const opts = this.opts;\n const pfx = opts.prefix || '';\n const appendTo = opts.appendTo || document.body;\n let container = this.container;\n\n // Create container if not yet exist\n if (!container) {\n container = document.createElement('div');\n container.className = `${pfx}resizer-c`;\n appendTo.appendChild(container);\n this.container = container;\n }\n\n while (container.firstChild) {\n container.removeChild(container.firstChild);\n }\n\n // Create handlers\n const handlers = {};\n ['tl', 'tc', 'tr', 'cl', 'cr', 'bl', 'bc', 'br'].forEach(\n hdl => (handlers[hdl] = opts[hdl] ? createHandler(hdl, opts) : '')\n );\n\n for (let n in handlers) {\n const handler = handlers[n];\n handler && container.appendChild(handler);\n }\n\n this.handlers = handlers;\n this.mousePosFetcher = opts.mousePosFetcher;\n this.updateTarget = opts.updateTarget;\n this.posFetcher = opts.posFetcher;\n this.onStart = opts.onStart;\n this.onMove = opts.onMove;\n this.onEnd = opts.onEnd;\n this.onUpdateContainer = opts.onUpdateContainer;\n }\n\n /**\n * Toggle iframes pointer event\n * @param {Boolean} silent If true, iframes will be silented\n */\n toggleFrames(silent) {\n if (this.opts.silentFrames) {\n const frames = document.querySelectorAll('iframe');\n each(frames, frame => (frame.style.pointerEvents = silent ? 'none' : ''));\n }\n }\n\n /**\n * Detects if the passed element is a resize handler\n * @param {HTMLElement} el\n * @return {Boolean}\n */\n isHandler(el) {\n var handlers = this.handlers;\n\n for (var n in handlers) {\n if (handlers[n] === el) return true;\n }\n\n return false;\n }\n\n /**\n * Returns the focused element\n * @return {HTMLElement}\n */\n getFocusedEl() {\n return this.el;\n }\n\n /**\n * Returns the parent of the focused element\n * @return {HTMLElement}\n */\n getParentEl() {\n return this.el.parentElement;\n }\n\n /**\n * Returns documents\n */\n getDocumentEl() {\n return [this.el.ownerDocument, document];\n }\n\n /**\n * Return element position\n * @param {HTMLElement} el\n * @param {Object} opts Custom options\n * @return {Object}\n */\n getElementPos(el, opts = {}) {\n var posFetcher = this.posFetcher || '';\n return posFetcher ? posFetcher(el, opts) : getBoundingRect(el);\n }\n\n /**\n * Focus resizer on the element, attaches handlers to it\n * @param {HTMLElement} el\n */\n focus(el) {\n // Avoid focusing on already focused element\n if (el && el === this.el) {\n return;\n }\n\n this.el = el;\n this.updateContainer({ forceShow: 1 });\n on(this.getDocumentEl(), 'mousedown', this.handleMouseDown);\n }\n\n /**\n * Blur from element\n */\n blur() {\n this.container.style.display = 'none';\n\n if (this.el) {\n off(this.getDocumentEl(), 'mousedown', this.handleMouseDown);\n this.el = null;\n }\n }\n\n /**\n * Start resizing\n * @param {Event} e\n */\n start(e) {\n //Right or middel click\n if (e.button !== 0) return;\n e.preventDefault();\n e.stopPropagation();\n const el = this.el;\n const parentEl = this.getParentEl();\n const resizer = this;\n const config = this.opts || {};\n var attrName = 'data-' + config.prefix + 'handler';\n var rect = this.getElementPos(el, { target: 'el' });\n var parentRect = this.getElementPos(parentEl);\n this.handlerAttr = e.target.getAttribute(attrName);\n this.clickedHandler = e.target;\n this.startDim = {\n t: rect.top,\n l: rect.left,\n w: rect.width,\n h: rect.height\n };\n this.rectDim = {\n t: rect.top,\n l: rect.left,\n w: rect.width,\n h: rect.height\n };\n this.startPos = {\n x: e.clientX,\n y: e.clientY\n };\n this.parentDim = {\n t: parentRect.top,\n l: parentRect.left,\n w: parentRect.width,\n h: parentRect.height\n };\n\n // Listen events\n var doc = this.getDocumentEl();\n on(doc, 'mousemove', this.move);\n on(doc, 'keydown', this.handleKeyDown);\n on(doc, 'mouseup', this.stop);\n isFunction(this.onStart) &&\n this.onStart(e, { docs: doc, config, el, resizer });\n this.toggleFrames(1);\n this.move(e);\n }\n\n /**\n * While resizing\n * @param {Event} e\n */\n move(e) {\n const onMove = this.onMove;\n var mouseFetch = this.mousePosFetcher;\n var currentPos = mouseFetch\n ? mouseFetch(e)\n : {\n x: e.clientX,\n y: e.clientY\n };\n\n this.currentPos = currentPos;\n this.delta = {\n x: currentPos.x - this.startPos.x,\n y: currentPos.y - this.startPos.y\n };\n this.keys = {\n shift: e.shiftKey,\n ctrl: e.ctrlKey,\n alt: e.altKey\n };\n\n this.rectDim = this.calc(this);\n this.updateRect(0);\n\n // Move callback\n onMove && onMove(e);\n\n // In case the mouse button was released outside of the window\n if (e.which === 0) {\n this.stop(e);\n }\n }\n\n /**\n * Stop resizing\n * @param {Event} e\n */\n stop(e) {\n const config = this.opts;\n var doc = this.getDocumentEl();\n off(doc, 'mousemove', this.move);\n off(doc, 'keydown', this.handleKeyDown);\n off(doc, 'mouseup', this.stop);\n this.updateRect(1);\n this.toggleFrames();\n isFunction(this.onEnd) && this.onEnd(e, { docs: doc, config });\n }\n\n /**\n * Update rect\n */\n updateRect(store) {\n const el = this.el;\n const resizer = this;\n const config = this.opts;\n const rect = this.rectDim;\n const updateTarget = this.updateTarget;\n const selectedHandler = this.getSelectedHandler();\n const { unitHeight, unitWidth, keyWidth, keyHeight } = config;\n\n // Use custom updating strategy if requested\n if (isFunction(updateTarget)) {\n updateTarget(el, rect, {\n store,\n selectedHandler,\n resizer,\n config\n });\n } else {\n const elStyle = el.style;\n elStyle[keyWidth] = rect.w + unitWidth;\n elStyle[keyHeight] = rect.h + unitHeight;\n }\n\n this.updateContainer();\n }\n\n updateContainer(opt = {}) {\n const { opts, container, el } = this;\n const { style } = container;\n\n if (!opts.avoidContainerUpdate && el) {\n // On component resize container fits the tool,\n // to check if this update is required somewhere else point\n // const toUpdate = ['left', 'top', 'width', 'height'];\n // const rectEl = this.getElementPos(el, { target: 'container' });\n // toUpdate.forEach(pos => (style[pos] = `${rectEl[pos]}px`));\n if (opt.forceShow) style.display = 'block';\n }\n\n this.onUpdateContainer({\n el: container,\n resizer: this,\n opts: {\n ...opts,\n ...opt\n }\n });\n }\n\n /**\n * Get selected handler name\n * @return {string}\n */\n getSelectedHandler() {\n var handlers = this.handlers;\n\n if (!this.selectedHandler) {\n return;\n }\n\n for (let n in handlers) {\n if (handlers[n] === this.selectedHandler) return n;\n }\n }\n\n /**\n * Handle ESC key\n * @param {Event} e\n */\n handleKeyDown(e) {\n if (e.keyCode === 27) {\n // Rollback to initial dimensions\n this.rectDim = this.startDim;\n this.stop(e);\n }\n }\n\n /**\n * Handle mousedown to check if it's possible to start resizing\n * @param {Event} e\n */\n handleMouseDown(e) {\n var el = e.target;\n if (this.isHandler(el)) {\n this.selectedHandler = el;\n this.start(e);\n } else if (el !== this.el) {\n this.selectedHandler = '';\n this.blur();\n }\n }\n\n /**\n * All positioning logic\n * @return {Object}\n */\n calc(data) {\n let value;\n const opts = this.opts || {};\n const step = opts.step;\n const startDim = this.startDim;\n const minDim = opts.minDim;\n const maxDim = opts.maxDim;\n const deltaX = data.delta.x;\n const deltaY = data.delta.y;\n const parentW = this.parentDim.w;\n const parentH = this.parentDim.h;\n const unitWidth = this.opts.unitWidth;\n const unitHeight = this.opts.unitHeight;\n const startW =\n unitWidth === '%' ? (startDim.w / 100) * parentW : startDim.w;\n const startH =\n unitHeight === '%' ? (startDim.h / 100) * parentH : startDim.h;\n var box = {\n t: 0,\n l: 0,\n w: startW,\n h: startH\n };\n\n if (!data) return;\n\n var attr = data.handlerAttr;\n if (~attr.indexOf('r')) {\n value =\n unitWidth === '%'\n ? normalizeFloat(((startW + deltaX * step) / parentW) * 100, 0.01)\n : normalizeFloat(startW + deltaX * step, step);\n value = Math.max(minDim, value);\n maxDim && (value = Math.min(maxDim, value));\n box.w = value;\n }\n if (~attr.indexOf('b')) {\n value =\n unitHeight === '%'\n ? normalizeFloat(((startH + deltaY * step) / parentH) * 100, 0.01)\n : normalizeFloat(startH + deltaY * step, step);\n value = Math.max(minDim, value);\n maxDim && (value = Math.min(maxDim, value));\n box.h = value;\n }\n if (~attr.indexOf('l')) {\n value =\n unitWidth === '%'\n ? normalizeFloat(((startW - deltaX * step) / parentW) * 100, 0.01)\n : normalizeFloat(startW - deltaX * step, step);\n value = Math.max(minDim, value);\n maxDim && (value = Math.min(maxDim, value));\n box.w = value;\n }\n if (~attr.indexOf('t')) {\n value =\n unitHeight === '%'\n ? normalizeFloat(((startH - deltaY * step) / parentH) * 100, 0.01)\n : normalizeFloat(startH - deltaY * step, step);\n value = Math.max(minDim, value);\n maxDim && (value = Math.min(maxDim, value));\n box.h = value;\n }\n\n // Enforce aspect ratio (unless shift key is being held)\n var ratioActive = opts.ratioDefault ? !data.keys.shift : data.keys.shift;\n if (attr.indexOf('c') < 0 && ratioActive) {\n var ratio = startDim.w / startDim.h;\n if (box.w / box.h > ratio) {\n box.h = Math.round(box.w / ratio);\n } else {\n box.w = Math.round(box.h * ratio);\n }\n }\n\n if (~attr.indexOf('l')) {\n box.l = startDim.w - box.w;\n }\n if (~attr.indexOf('t')) {\n box.t = startDim.h - box.h;\n }\n\n return box;\n }\n}\n\nexport default {\n init(opts) {\n return new Resizer(opts);\n }\n};\n","import Dragger from './Dragger';\nimport Sorter from './Sorter';\nimport Resizer from './Resizer';\nimport * as mixins from './mixins';\n\nexport default () => {\n return {\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'Utils',\n\n /**\n * Initialize module\n */\n init() {\n return this;\n },\n\n destroy() {},\n\n Sorter,\n Resizer,\n Dragger,\n helpers: { ...mixins }\n };\n};\n","const traitInputAttr = { placeholder: 'eg. Text here' };\n\nexport default {\n assetManager: {\n addButton: 'Add image',\n inputPlh: 'http://path/to/the/image.jpg',\n modalTitle: 'Select Image',\n uploadTitle: 'Drop files here or click to upload'\n },\n // Here just as a reference, GrapesJS core doesn't contain any block,\n // so this should be omitted from other local files\n blockManager: {\n labels: {\n // 'block-id': 'Block Label',\n },\n categories: {\n // 'category-id': 'Category Label',\n }\n },\n domComponents: {\n names: {\n '': 'Box',\n wrapper: 'Body',\n text: 'Text',\n comment: 'Comment',\n image: 'Image',\n video: 'Video',\n label: 'Label',\n link: 'Link',\n map: 'Map',\n tfoot: 'Table foot',\n tbody: 'Table body',\n thead: 'Table head',\n table: 'Table',\n row: 'Table row',\n cell: 'Table cell'\n }\n },\n deviceManager: {\n device: 'Device',\n devices: {\n desktop: 'Desktop',\n tablet: 'Tablet',\n mobileLandscape: 'Mobile Landscape',\n mobilePortrait: 'Mobile Portrait'\n }\n },\n panels: {\n buttons: {\n titles: {\n preview: 'Preview',\n fullscreen: 'Fullscreen',\n 'sw-visibility': 'View components',\n 'export-template': 'View code',\n 'open-sm': 'Open Style Manager',\n 'open-tm': 'Settings',\n 'open-layers': 'Open Layer Manager',\n 'open-blocks': 'Open Blocks'\n }\n }\n },\n selectorManager: {\n label: 'Classes',\n selected: 'Selected',\n emptyState: '- State -',\n states: {\n hover: 'Hover',\n active: 'Click',\n 'nth-of-type(2n)': 'Even/Odd'\n }\n },\n styleManager: {\n empty: 'Select an element before using Style Manager',\n layer: 'Layer',\n fileButton: 'Images',\n sectors: {\n general: 'General',\n layout: 'Layout',\n typography: 'Typography',\n decorations: 'Decorations',\n extra: 'Extra',\n flex: 'Flex',\n dimension: 'Dimension'\n },\n // The core library generates the name by their `property` name\n properties: {\n // float: 'Float',\n }\n },\n traitManager: {\n empty: 'Select an element before using Trait Manager',\n label: 'Component settings',\n traits: {\n // The core library generates the name by their `name` property\n labels: {\n // id: 'Id',\n // alt: 'Alt',\n // title: 'Title',\n // href: 'Href',\n },\n // In a simple trait, like text input, these are used on input attributes\n attributes: {\n id: traitInputAttr,\n alt: traitInputAttr,\n title: traitInputAttr,\n href: { placeholder: 'eg. https://google.com' }\n },\n // In a trait like select, these are used to translate option names\n options: {\n target: {\n false: 'This window',\n _blank: 'New window'\n }\n }\n }\n }\n};\n","import en from './locale/en';\n\nexport default {\n // Locale value\n locale: 'en',\n\n // Fallback locale\n localeFallback: 'en',\n\n // Detect locale by checking browser language\n detectLocale: 1,\n\n // Show warnings when some of the i18n resources are missing\n debug: 0,\n\n // Messages to translate\n messages: {\n en\n }\n};\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/i18n/config.js)\n * ```js\n * const editor = grapesjs.init({\n * i18n: {\n * locale: 'en',\n * localeFallback: 'en',\n * messages: {\n * it: { hello: 'Ciao', ... },\n * ...\n * }\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const i18n = editor.I18n;\n * ```\n *\n * ### Events\n * * `i18n:add` - New set of messages is added\n * * `i18n:update` - The set of messages is updated\n * * `i18n:locale` - Locale changed\n *\n * @module I18n\n */\nimport { isUndefined, isString } from 'underscore';\nimport { hasWin } from 'utils/mixins';\nimport config from './config';\n\nconst isObj = el => !Array.isArray(el) && el !== null && typeof el === 'object';\n\nconst deepAssign = (...args) => {\n const target = { ...args[0] };\n\n for (let i = 1; i < args.length; i++) {\n const source = { ...args[i] };\n\n for (let key in source) {\n const targValue = target[key];\n const srcValue = source[key];\n\n if (isObj(targValue) && isObj(srcValue)) {\n target[key] = deepAssign(targValue, srcValue);\n } else {\n target[key] = srcValue;\n }\n }\n }\n\n return target;\n};\n\nexport default () => {\n return {\n name: 'I18n',\n\n config,\n\n /**\n * Initialize module\n * @param {Object} config Configurations\n * @private\n */\n init(opts = {}) {\n this.config = {\n ...config,\n ...opts,\n messages: {\n ...config.messages,\n ...(opts.messages || {})\n }\n };\n\n if (this.config.detectLocale) {\n this.config.locale = this._localLang();\n }\n\n this.em = opts.em;\n return this;\n },\n\n /**\n * Get module configurations\n * @returns {Object} Configuration object\n */\n getConfig() {\n return this.config;\n },\n\n /**\n * Update current locale\n * @param {String} locale Locale value\n * @returns {this}\n * @example\n * i18n.setLocale('it');\n */\n setLocale(locale) {\n const { em, config } = this;\n const evObj = { value: locale, valuePrev: config.locale };\n em && em.trigger('i18n:locale', evObj);\n config.locale = locale;\n return this;\n },\n\n /**\n * Get current locale\n * @returns {String} Current locale value\n */\n getLocale() {\n return this.config.locale;\n },\n\n /**\n * Get all messages\n * @param {String} [lang] Specify the language of messages to return\n * @param {Object} [opts] Options\n * @param {Boolean} [opts.debug] Show warnings in case of missing language\n * @returns {Object}\n * @example\n * i18n.getMessages();\n * // -> { en: { hello: '...' }, ... }\n * i18n.getMessages('en');\n * // -> { hello: '...' }\n */\n getMessages(lang, opts = {}) {\n const { messages } = this.config;\n lang &&\n !messages[lang] &&\n this._debug(`'${lang}' i18n lang not found`, opts);\n return lang ? messages[lang] : messages;\n },\n\n /**\n * Set new set of messages\n * @param {Object} msg Set of messages\n * @returns {this}\n * @example\n * i18n.getMessages();\n * // -> { en: { msg1: 'Msg 1', msg2: 'Msg 2', } }\n * i18n.setMessages({ en: { msg2: 'Msg 2 up', msg3: 'Msg 3', } });\n * // Set replaced\n * i18n.getMessages();\n * // -> { en: { msg2: 'Msg 2 up', msg3: 'Msg 3', } }\n */\n setMessages(msg) {\n const { em, config } = this;\n config.messages = msg;\n em && em.trigger('i18n:update', msg);\n return this;\n },\n\n /**\n * Update messages\n * @param {Object} msg Set of messages to add\n * @returns {this}\n * @example\n * i18n.getMessages();\n * // -> { en: { msg1: 'Msg 1', msg2: 'Msg 2', } }\n * i18n.addMessages({ en: { msg2: 'Msg 2 up', msg3: 'Msg 3', } });\n * // Set updated\n * i18n.getMessages();\n * // -> { en: { msg1: 'Msg 1', msg2: 'Msg 2 up', msg3: 'Msg 3', } }\n */\n addMessages(msg) {\n const { em } = this;\n const { messages } = this.config;\n em && em.trigger('i18n:add', msg);\n this.setMessages(deepAssign(messages, msg));\n\n return this;\n },\n\n /**\n * Translate the locale message\n * @param {String} key Label to translate\n * @param {Object} [opts] Options for the translation\n * @param {Object} [opts.params] Params for the translation\n * @param {Boolean} [opts.debug] Show warnings in case of missing resources\n * @returns {String}\n * @example\n * obj.setMessages({\n * en: { msg: 'Msg', msg2: 'Msg {test}'},\n * it: { msg2: 'Msg {test} it'},\n * });\n * obj.t('msg');\n * // -> outputs `Msg`\n * obj.t('msg2', { params: { test: 'hello' } }); // use params\n * // -> outputs `Msg hello`\n * obj.t('msg2', { l: 'it', params: { test: 'hello' } }); // custom local\n * // -> outputs `Msg hello it`\n */\n t(key, opts = {}) {\n const { config } = this;\n const param = opts.params || {};\n const locale = opts.l || this.getLocale();\n const localeFlb = opts.lFlb || config.localeFallback;\n let result = this._getMsg(key, locale, opts);\n\n // Try with fallback\n if (!result) result = this._getMsg(key, localeFlb, opts);\n\n !result &&\n this._debug(`'${key}' i18n key not found in '${locale}' lang`, opts);\n result =\n result && isString(result) ? this._addParams(result, param) : result;\n\n return result;\n },\n\n _localLang() {\n const nav = (hasWin() && window.navigator) || {};\n const lang = nav.language || nav.userLanguage;\n return lang ? lang.split('-')[0] : 'en';\n },\n\n _addParams(str, params) {\n const reg = new RegExp(`\\{([\\\\w\\\\d-]*)\\}`, 'g');\n return str.replace(reg, (m, val) => params[val] || '').trim();\n },\n\n _getMsg(key, locale, opts = {}) {\n const msgSet = this.getMessages(locale, opts);\n\n // Lang set is missing\n if (!msgSet) return;\n\n let result = msgSet[key];\n\n // Check for nested getter\n if (!result && key.indexOf('.') > 0) {\n result = key.split('.').reduce((lang, key) => {\n if (isUndefined(lang)) return;\n return lang[key];\n }, msgSet);\n }\n\n return result;\n },\n\n _debug(str, opts = {}) {\n const { em, config } = this;\n (opts.debug || config.debug) && em && em.logWarning(str);\n },\n\n destroy() {\n this.config = config;\n this.em = {};\n }\n };\n};\n","// The initial version of this RTE was borrowed from https://github.com/jaredreich/pell\n// and adapted to the GrapesJS's need\n\nimport { on, off } from 'utils/mixins';\n\nconst RTE_KEY = '_rte';\n\nconst btnState = {\n ACTIVE: 1,\n INACTIVE: 0,\n DISABLED: -1\n};\nconst isValidAnchor = rte => {\n const anchor = rte.selection().anchorNode;\n const parentNode = anchor && anchor.parentNode;\n const nextSibling = anchor && anchor.nextSibling;\n return (\n (parentNode && parentNode.nodeName == 'A') ||\n (nextSibling && nextSibling.nodeName == 'A')\n );\n};\nconst defActions = {\n bold: {\n name: 'bold',\n icon: 'B',\n attributes: { title: 'Bold' },\n result: rte => rte.exec('bold')\n },\n italic: {\n name: 'italic',\n icon: 'I',\n attributes: { title: 'Italic' },\n result: rte => rte.exec('italic')\n },\n underline: {\n name: 'underline',\n icon: 'U',\n attributes: { title: 'Underline' },\n result: rte => rte.exec('underline')\n },\n strikethrough: {\n name: 'strikethrough',\n icon: 'S',\n attributes: { title: 'Strike-through' },\n result: rte => rte.exec('strikeThrough')\n },\n link: {\n icon: `⫘`,\n name: 'link',\n attributes: {\n style: 'font-size:1.4rem;padding:0 4px 2px;',\n title: 'Link'\n },\n state: (rte, doc) => {\n if (rte && rte.selection()) {\n return isValidAnchor(rte) ? btnState.ACTIVE : btnState.INACTIVE;\n } else {\n return btnState.INACTIVE;\n }\n },\n result: rte => {\n if (isValidAnchor(rte)) {\n rte.exec('unlink');\n } else {\n rte.insertHTML(`${rte.selection()}`);\n }\n }\n }\n};\n\nexport default class RichTextEditor {\n constructor(settings = {}) {\n const el = settings.el;\n\n if (el[RTE_KEY]) {\n return el[RTE_KEY];\n }\n\n el[RTE_KEY] = this;\n this.setEl(el);\n this.updateActiveActions = this.updateActiveActions.bind(this);\n\n const acts = (settings.actions || []).map(action => {\n let result = action;\n if (typeof action === 'string') {\n result = { ...defActions[action] };\n } else if (defActions[action.name]) {\n result = { ...defActions[action.name], ...action };\n }\n return result;\n });\n const actions = acts.length\n ? acts\n : Object.keys(defActions).map(a => defActions[a]);\n\n settings.classes = {\n ...{\n actionbar: 'actionbar',\n button: 'action',\n active: 'active',\n disabled: 'disabled',\n inactive: 'inactive'\n },\n ...settings.classes\n };\n\n const classes = settings.classes;\n let actionbar = settings.actionbar;\n this.actionbar = actionbar;\n this.settings = settings;\n this.classes = classes;\n this.actions = actions;\n\n if (!actionbar) {\n const actionbarCont = settings.actionbarContainer;\n actionbar = document.createElement('div');\n actionbar.className = classes.actionbar;\n actionbarCont.appendChild(actionbar);\n this.actionbar = actionbar;\n actions.forEach(action => this.addAction(action));\n }\n\n settings.styleWithCSS && this.exec('styleWithCSS');\n this.syncActions();\n\n return this;\n }\n\n destroy() {\n this.el = 0;\n this.doc = 0;\n this.actionbar = 0;\n this.settings = {};\n this.classes = {};\n this.actions = [];\n }\n\n setEl(el) {\n this.el = el;\n this.doc = el.ownerDocument;\n }\n\n updateActiveActions() {\n this.getActions().forEach(action => {\n const btn = action.btn;\n const update = action.update;\n const { active, inactive, disabled } = { ...this.classes };\n const state = action.state;\n const name = action.name;\n const doc = this.doc;\n btn.className = btn.className.replace(active, '').trim();\n btn.className = btn.className.replace(inactive, '').trim();\n btn.className = btn.className.replace(disabled, '').trim();\n\n // if there is a state function, which depicts the state,\n // i.e. `active`, `disabled`, then call it\n if (state) {\n switch (state(this, doc)) {\n case btnState.ACTIVE:\n btn.className += ` ${active}`;\n break;\n case btnState.INACTIVE:\n btn.className += ` ${inactive}`;\n break;\n case btnState.DISABLED:\n btn.className += ` ${disabled}`;\n break;\n }\n } else {\n // otherwise default to checking if the name command is supported & enabled\n if (doc.queryCommandSupported(name) && doc.queryCommandState(name)) {\n btn.className += ` ${active}`;\n }\n }\n update && update(this, action);\n });\n }\n\n enable() {\n if (this.enabled) {\n return this;\n }\n\n this.actionbarEl().style.display = '';\n this.el.contentEditable = true;\n on(this.el, 'mouseup keyup', this.updateActiveActions);\n this.syncActions();\n this.updateActiveActions();\n this.el.focus();\n this.enabled = 1;\n return this;\n }\n\n disable() {\n this.actionbarEl().style.display = 'none';\n this.el.contentEditable = false;\n off(this.el, 'mouseup keyup', this.updateActiveActions);\n this.enabled = 0;\n return this;\n }\n\n /**\n * Sync actions with the current RTE\n */\n syncActions() {\n this.getActions().forEach(action => {\n if (this.settings.actionbar) {\n if (\n !action.state ||\n (action.state && action.state(this, this.doc) >= 0)\n ) {\n const event = action.event || 'click';\n action.btn[`on${event}`] = e => {\n action.result(this, action);\n this.updateActiveActions();\n };\n }\n }\n });\n }\n\n /**\n * Add new action to the actionbar\n * @param {Object} action\n * @param {Object} [opts={}]\n */\n addAction(action, opts = {}) {\n const sync = opts.sync;\n const btn = document.createElement('span');\n const icon = action.icon;\n const attr = action.attributes || {};\n btn.className = this.classes.button;\n action.btn = btn;\n\n for (let key in attr) {\n btn.setAttribute(key, attr[key]);\n }\n\n if (typeof icon == 'string') {\n btn.innerHTML = icon;\n } else {\n btn.appendChild(icon);\n }\n\n this.actionbarEl().appendChild(btn);\n\n if (sync) {\n this.actions.push(action);\n this.syncActions();\n }\n }\n\n /**\n * Get the array of current actions\n * @return {Array}\n */\n getActions() {\n return this.actions;\n }\n\n /**\n * Returns the Selection instance\n * @return {Selection}\n */\n selection() {\n return this.doc.getSelection();\n }\n\n /**\n * Execute the command\n * @param {string} command Command name\n * @param {any} [value=null Command's arguments\n */\n exec(command, value = null) {\n this.doc.execCommand(command, false, value);\n }\n\n /**\n * Get the actionbar element\n * @return {HTMLElement}\n */\n actionbarEl() {\n return this.actionbar;\n }\n\n /**\n * Set custom HTML to the selection, useful as the default 'insertHTML' command\n * doesn't work in the same way on all browsers\n * @param {string} value HTML string\n */\n insertHTML(value) {\n let lastNode;\n const doc = this.doc;\n const sel = doc.getSelection();\n\n if (sel && sel.rangeCount) {\n const node = doc.createElement('div');\n const range = sel.getRangeAt(0);\n range.deleteContents();\n node.innerHTML = value;\n Array.prototype.slice.call(node.childNodes).forEach(nd => {\n range.insertNode(nd);\n lastNode = nd;\n });\n\n sel.removeAllRanges();\n sel.addRange(range);\n this.el.focus();\n }\n }\n}\n","export default {\n stylePrefix: 'rte-',\n\n // If true, moves the toolbar below the element when the top canvas\n // edge is reached\n adjustToolbar: 1,\n\n // Default RTE actions\n actions: ['bold', 'italic', 'underline', 'strikethrough', 'link']\n};\n","/**\n * This module allows to customize the built-in toolbar of the Rich Text Editor and use commands from the [HTML Editing APIs](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand).\n * It's highly recommended to keep this toolbar as small as possible, especially from styling commands (eg. 'fontSize') and leave this task to the Style Manager\n *\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/rich_text_editor/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * richTextEditor: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const rte = editor.RichTextEditor;\n * ```\n *\n * * [add](#add)\n * * [get](#get)\n * * [getAll](#getall)\n * * [remove](#remove)\n * * [getToolbarEl](#gettoolbarel)\n *\n * @module RichTextEditor\n */\n\nimport RichTextEditor from './model/RichTextEditor';\nimport { on, hasWin } from 'utils/mixins';\nimport defaults from './config/config';\n\nexport default () => {\n let config = {};\n let toolbar, actions, lastEl, lastElPos, globalRte;\n const eventsUp =\n 'change:canvasOffset canvasScroll frame:scroll component:update';\n const hideToolbar = () => {\n const style = toolbar.style;\n const size = '-1000px';\n style.top = size;\n style.left = size;\n style.display = 'none';\n };\n\n return {\n customRte: null,\n\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'RichTextEditor',\n\n getConfig() {\n return config;\n },\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} opts Options\n * @private\n */\n init(opts = {}) {\n config = {\n ...defaults,\n ...opts\n };\n const ppfx = config.pStylePrefix;\n\n if (ppfx) {\n config.stylePrefix = ppfx + config.stylePrefix;\n }\n\n this.pfx = config.stylePrefix;\n actions = config.actions || [];\n if (!hasWin()) return this;\n toolbar = document.createElement('div');\n toolbar.className = `${ppfx}rte-toolbar ${ppfx}one-bg`;\n globalRte = this.initRte(document.createElement('div'));\n\n //Avoid closing on toolbar clicking\n on(toolbar, 'mousedown', e => e.stopPropagation());\n return this;\n },\n\n destroy() {\n const { customRte } = this;\n globalRte && globalRte.destroy();\n customRte && customRte.destroy && customRte.destroy();\n this.actionbar = 0;\n this.actions = 0;\n [config, toolbar, actions, lastEl, lastElPos, globalRte].forEach(\n i => (i = {})\n );\n },\n\n /**\n * Post render callback\n * @param {View} ev\n * @private\n */\n postRender(ev) {\n const canvas = ev.model.get('Canvas');\n toolbar.style.pointerEvents = 'all';\n hideToolbar();\n canvas.getToolsEl().appendChild(toolbar);\n },\n\n /**\n * Init the built-in RTE\n * @param {HTMLElement} el\n * @return {RichTextEditor}\n * @private\n */\n initRte(el) {\n const pfx = this.pfx;\n const actionbarContainer = toolbar;\n const actionbar = this.actionbar;\n const actions = this.actions || [...config.actions];\n const classes = {\n actionbar: `${pfx}actionbar`,\n button: `${pfx}action`,\n active: `${pfx}active`,\n inactive: `${pfx}inactive`,\n disabled: `${pfx}disabled`\n };\n const rte = new RichTextEditor({\n el,\n classes,\n actions,\n actionbar,\n actionbarContainer\n });\n globalRte && globalRte.setEl(el);\n\n if (rte.actionbar) {\n this.actionbar = rte.actionbar;\n }\n\n if (rte.actions) {\n this.actions = rte.actions;\n }\n\n return rte;\n },\n\n /**\n * Add a new action to the built-in RTE toolbar\n * @param {string} name Action name\n * @param {Object} action Action options\n * @example\n * rte.add('bold', {\n * icon: 'B',\n * attributes: {title: 'Bold'},\n * result: rte => rte.exec('bold')\n * });\n * rte.add('link', {\n * icon: document.getElementById('t'),\n * attributes: {title: 'Link',}\n * // Example on it's easy to wrap a selected content\n * result: rte => rte.insertHTML(`${rte.selection()}`)\n * });\n * // An example with fontSize\n * rte.add('fontSize', {\n * icon: ``,\n * // Bind the 'result' on 'change' listener\n * event: 'change',\n * result: (rte, action) => rte.exec('fontSize', action.btn.firstChild.value),\n * // Callback on any input change (mousedown, keydown, etc..)\n * update: (rte, action) => {\n * const value = rte.doc.queryCommandValue(action.name);\n * if (value != 'false') { // value is a string\n * action.btn.firstChild.value = value;\n * }\n * }\n * })\n * // An example with state\n * const isValidAnchor = (rte) => {\n * // a utility function to help determine if the selected is a valid anchor node\n * const anchor = rte.selection().anchorNode;\n * const parentNode = anchor && anchor.parentNode;\n * const nextSibling = anchor && anchor.nextSibling;\n * return (parentNode && parentNode.nodeName == 'A') || (nextSibling && nextSibling.nodeName == 'A')\n * }\n * rte.add('toggleAnchor', {\n * icon: `⫘`,\n * state: (rte, doc) => {\n * if (rte && rte.selection()) {\n * // `btnState` is a integer, -1 for disabled, 0 for inactive, 1 for active\n * return isValidAnchor(rte) ? btnState.ACTIVE : btnState.INACTIVE;\n * } else {\n * return btnState.INACTIVE;\n * }\n * },\n * result: (rte, action) => {\n * if (isValidAnchor(rte)) {\n * rte.exec('unlink');\n * } else {\n * rte.insertHTML(`${rte.selection()}`);\n * }\n * }\n * })\n */\n add(name, action = {}) {\n action.name = name;\n globalRte.addAction(action, { sync: 1 });\n },\n\n /**\n * Get the action by its name\n * @param {string} name Action name\n * @return {Object}\n * @example\n * const action = rte.get('bold');\n * // {name: 'bold', ...}\n */\n get(name) {\n let result;\n globalRte.getActions().forEach(action => {\n if (action.name == name) {\n result = action;\n }\n });\n return result;\n },\n\n /**\n * Get all actions\n * @return {Array}\n */\n getAll() {\n return globalRte.getActions();\n },\n\n /**\n * Remove the action from the toolbar\n * @param {string} name\n * @return {Object} Removed action\n * @example\n * const action = rte.remove('bold');\n * // {name: 'bold', ...}\n */\n remove(name) {\n const actions = this.getAll();\n const action = this.get(name);\n\n if (action) {\n const btn = action.btn;\n const index = actions.indexOf(action);\n btn.parentNode.removeChild(btn);\n actions.splice(index, 1);\n }\n\n return action;\n },\n\n /**\n * Get the toolbar element\n * @return {HTMLElement}\n */\n getToolbarEl() {\n return toolbar;\n },\n\n /**\n * Triggered when the offset of the editor is changed\n * @private\n */\n updatePosition() {\n const un = 'px';\n const canvas = config.em.get('Canvas');\n const { style } = toolbar;\n const pos = canvas.getTargetToElementFixed(lastEl, toolbar, {\n event: 'rteToolbarPosUpdate',\n left: 0\n });\n style.top = (pos.top || 0) + un;\n style.left = (pos.left || 0) + un;\n },\n\n /**\n * Enable rich text editor on the element\n * @param {View} view Component view\n * @param {Object} rte The instance of already defined RTE\n * @private\n * */\n async enable(view, rte) {\n lastEl = view.el;\n const { customRte } = this;\n const canvas = config.em.get('Canvas');\n const em = config.em;\n const el = view.getChildrenContainer();\n lastElPos = canvas.getElementPos(lastEl);\n\n toolbar.style.display = '';\n const rteInst = await (customRte\n ? customRte.enable(el, rte)\n : this.initRte(el).enable());\n\n if (em) {\n setTimeout(this.updatePosition.bind(this), 0);\n em.off(eventsUp, this.updatePosition, this);\n em.on(eventsUp, this.updatePosition, this);\n em.trigger('rte:enable', view, rteInst);\n }\n\n return rteInst;\n },\n\n /**\n * Unbind rich text editor from the element\n * @param {View} view\n * @param {Object} rte The instance of already defined RTE\n * @private\n * */\n disable(view, rte) {\n const em = config.em;\n const customRte = this.customRte;\n var el = view.getChildrenContainer();\n\n if (customRte) {\n customRte.disable(el, rte);\n } else {\n rte && rte.disable();\n }\n\n hideToolbar();\n if (em) {\n em.off(eventsUp, this.updatePosition, this);\n em.trigger('rte:disable', view, rte);\n }\n }\n };\n};\n","import { isUndefined, isString, bindAll } from 'underscore';\nimport { getModel, isEscKey, isEnterKey } from 'utils/mixins';\nimport Backbone from 'backbone';\nimport ComponentView from 'dom_components/view/ComponentView';\nimport { eventDrag } from 'dom_components/model/Component';\n\nconst inputProp = 'contentEditable';\nconst styleOpts = { mediaText: '' };\nconst $ = Backbone.$;\nlet ItemsView;\n\nexport default Backbone.View.extend({\n events: {\n 'mousedown [data-toggle-move]': 'startSort',\n 'touchstart [data-toggle-move]': 'startSort',\n 'click [data-toggle-visible]': 'toggleVisibility',\n 'click [data-toggle-open]': 'toggleOpening',\n 'click [data-toggle-select]': 'handleSelect',\n 'mouseover [data-toggle-select]': 'handleHover',\n 'mouseout [data-toggle-select]': 'handleHoverOut',\n 'dblclick [data-name]': 'handleEdit',\n 'keydown [data-name]': 'handleEditKey',\n 'focusout [data-name]': 'handleEditEnd'\n },\n\n template(model) {\n const { pfx, ppfx, config, clsNoEdit } = this;\n const { hidable } = config;\n const count = this.countChildren(model);\n const addClass = !count ? this.clsNoChild : '';\n const clsTitle = `${this.clsTitle} ${addClass}`;\n const clsTitleC = `${this.clsTitleC} ${ppfx}one-bg`;\n const clsCaret = `${this.clsCaret} fa fa-chevron-right`;\n const clsInput = `${this.inputNameCls} ${clsNoEdit} ${ppfx}no-app`;\n const level = this.level + 1;\n const gut = `${30 + level * 10}px`;\n const name = model.getName();\n const icon = model.getIcon();\n const clsBase = `${pfx}layer`;\n\n return `\n ${\n hidable\n ? ``\n : ''\n }\n
\n
\n
\n \n ${icon ? `${icon}` : ''}\n ${name}\n
\n
\n
\n
${count || ''}
\n
\n \n
\n
`;\n },\n\n initialize(o = {}) {\n bindAll(this, '__render');\n this.opt = o;\n this.level = o.level;\n const config = o.config || {};\n const { onInit } = config;\n this.config = config;\n this.em = o.config.em;\n this.ppfx = this.em.get('Config').stylePrefix;\n this.sorter = o.sorter || '';\n this.pfx = this.config.stylePrefix;\n this.parentView = o.parentView;\n const pfx = this.pfx;\n const ppfx = this.ppfx;\n const model = this.model;\n const components = model.get('components');\n const type = model.get('type') || 'default';\n model.set('open', false);\n this.listenTo(components, 'remove add reset', this.checkChildren);\n [\n ['change:status', this.updateStatus],\n ['change:open', this.updateOpening],\n ['change:layerable', this.updateLayerable],\n ['change:style:display', this.updateVisibility],\n ['rerender:layer', this.render]\n ].forEach(item => this.listenTo(model, item[0], item[1]));\n this.className = `${pfx}layer ${pfx}layer__t-${type} no-select ${ppfx}two-color`;\n this.inputNameCls = `${ppfx}layer-name`;\n this.clsTitleC = `${pfx}layer-title-c`;\n this.clsTitle = `${pfx}layer-title`;\n this.clsCaret = `${pfx}layer-caret`;\n this.clsCount = `${pfx}layer-count`;\n this.clsMove = `${pfx}layer-move`;\n this.clsChildren = `${pfx}layer-children`;\n this.clsNoChild = `${pfx}layer-no-chld`;\n this.clsEdit = `${this.inputNameCls}--edit`;\n this.clsNoEdit = `${this.inputNameCls}--no-edit`;\n this.$el.data('model', model);\n this.$el.data('collection', components);\n model.viewLayer = this;\n onInit.bind(this)({\n component: model,\n render: this.__render,\n listenTo: this.listenTo\n });\n },\n\n getVisibilityEl() {\n if (!this.eyeEl) {\n this.eyeEl = this.$el.children(`.${this.pfx}layer-vis`);\n }\n\n return this.eyeEl;\n },\n\n updateVisibility() {\n const pfx = this.pfx;\n const model = this.model;\n const hClass = `${pfx}layer-hidden`;\n const hideIcon = 'fa-eye-slash';\n const hidden = model.getStyle(styleOpts).display === 'none';\n const method = hidden ? 'addClass' : 'removeClass';\n this.$el[method](hClass);\n this.getVisibilityEl()[method](hideIcon);\n },\n\n /**\n * Toggle visibility\n * @param\tEvent\n *\n * @return \tvoid\n * */\n toggleVisibility(e) {\n e && e.stopPropagation();\n const { model, em } = this;\n const prevDspKey = '__prev-display';\n const prevDisplay = model.get(prevDspKey);\n const style = model.getStyle(styleOpts);\n const { display } = style;\n const hidden = display == 'none';\n\n if (hidden) {\n delete style.display;\n\n if (prevDisplay) {\n style.display = prevDisplay;\n model.unset(prevDspKey);\n }\n } else {\n display && model.set(prevDspKey, display);\n style.display = 'none';\n }\n\n model.setStyle(style, styleOpts);\n em && em.trigger('component:toggled'); // Updates Style Manager #2938\n },\n\n /**\n * Handle the edit of the component name\n */\n handleEdit(e) {\n e && e.stopPropagation();\n const { em, $el, clsNoEdit, clsEdit } = this;\n const inputEl = this.getInputName();\n inputEl[inputProp] = true;\n inputEl.focus();\n document.execCommand('selectAll', false, null);\n em && em.setEditing(1);\n $el\n .find(`.${this.inputNameCls}`)\n .removeClass(clsNoEdit)\n .addClass(clsEdit);\n },\n\n handleEditKey(ev) {\n ev.stopPropagation();\n (isEscKey(ev) || isEnterKey(ev)) && this.handleEditEnd(ev);\n },\n\n /**\n * Handle with the end of editing of the component name\n */\n handleEditEnd(e) {\n e && e.stopPropagation();\n const { em, $el, clsNoEdit, clsEdit } = this;\n const inputEl = this.getInputName();\n const name = inputEl.textContent;\n inputEl.scrollLeft = 0;\n inputEl[inputProp] = false;\n this.setName(name, { component: this.model, propName: 'custom-name' });\n em && em.setEditing(0);\n $el\n .find(`.${this.inputNameCls}`)\n .addClass(clsNoEdit)\n .removeClass(clsEdit);\n },\n\n setName(name, { propName }) {\n this.model.set(propName, name);\n },\n\n /**\n * Get the input containing the name of the component\n * @return {HTMLElement}\n */\n getInputName() {\n if (!this.inputName) {\n this.inputName = this.el.querySelector(`.${this.inputNameCls}`);\n }\n return this.inputName;\n },\n\n /**\n * Update item opening\n *\n * @return void\n * */\n updateOpening() {\n var opened = this.opt.opened || {};\n var model = this.model;\n const chvDown = 'fa-chevron-down';\n\n if (model.get('open')) {\n this.$el.addClass('open');\n this.getCaret().addClass(chvDown);\n opened[model.cid] = model;\n } else {\n this.$el.removeClass('open');\n this.getCaret().removeClass(chvDown);\n delete opened[model.cid];\n }\n },\n\n /**\n * Toggle item opening\n * @param {Object}\te\n *\n * @return void\n * */\n toggleOpening(e) {\n const { model } = this;\n e.stopImmediatePropagation();\n\n if (!model.get('components').length) return;\n\n model.set('open', !model.get('open'));\n },\n\n /**\n * Handle component selection\n */\n handleSelect(e) {\n e.stopPropagation();\n const { em, config, model } = this;\n\n if (em) {\n em.setSelected(model, { fromLayers: 1, event: e });\n const scroll = config.scrollCanvas;\n scroll && model.views.forEach(view => view.scrollIntoView(scroll));\n }\n },\n\n /**\n * Handle component selection\n */\n handleHover(e) {\n e.stopPropagation();\n const { em, config, model } = this;\n em && config.showHover && em.setHovered(model, { fromLayers: 1 });\n },\n\n handleHoverOut(ev) {\n ev.stopPropagation();\n const { em, config } = this;\n em && config.showHover && em.setHovered(0, { fromLayers: 1 });\n },\n\n /**\n * Delegate to sorter\n * @param\tEvent\n * */\n startSort(e) {\n e.stopPropagation();\n const { em, sorter } = this;\n // Right or middel click\n if (e.button && e.button !== 0) return;\n\n if (sorter) {\n sorter.onStart = data => em.trigger(`${eventDrag}:start`, data);\n sorter.onMoveClb = data => em.trigger(eventDrag, data);\n sorter.startSort(e.target);\n }\n },\n\n /**\n * Freeze item\n * @return\tvoid\n * */\n freeze() {\n this.$el.addClass(this.pfx + 'opac50');\n this.model.set('open', 0);\n },\n\n /**\n * Unfreeze item\n * @return\tvoid\n * */\n unfreeze() {\n this.$el.removeClass(this.pfx + 'opac50');\n },\n\n /**\n * Update item on status change\n * @param\tEvent\n * */\n updateStatus(e) {\n ComponentView.prototype.updateStatus.apply(this, [\n {\n avoidHover: !this.config.highlightHover,\n noExtHl: 1\n }\n ]);\n },\n\n /**\n * Check if component is visible\n *\n * @return boolean\n * */\n isVisible() {\n const { display } = this.model.getStyle();\n\n return !(display && display === 'none');\n },\n\n /**\n * Update item aspect after children changes\n *\n * @return void\n * */\n checkChildren() {\n const { model, clsNoChild } = this;\n const count = this.countChildren(model);\n const title = this.$el\n .children(`.${this.clsTitleC}`)\n .children(`.${this.clsTitle}`);\n let { cnt } = this;\n\n if (!cnt) {\n cnt = this.$el.children('[data-count]').get(0);\n this.cnt = cnt;\n }\n\n title[count ? 'removeClass' : 'addClass'](clsNoChild);\n if (cnt) cnt.innerHTML = count || '';\n !count && model.set('open', 0);\n },\n\n /**\n * Count children inside model\n * @param {Object} model\n * @return {number}\n * @private\n */\n countChildren(model) {\n var count = 0;\n model.get('components').each(function(m) {\n var isCountable = this.opt.isCountable;\n var hide = this.config.hideTextnode;\n if (isCountable && !isCountable(m, hide)) return;\n count++;\n }, this);\n return count;\n },\n\n getCaret() {\n if (!this.caret || !this.caret.length) {\n const pfx = this.pfx;\n this.caret = this.$el\n .children(`.${this.clsTitleC}`)\n .find(`.${this.clsCaret}`);\n }\n\n return this.caret;\n },\n\n setRoot(el) {\n el = isString(el) ? this.em.getWrapper().find(el)[0] : el;\n const model = getModel(el, $);\n if (!model) return;\n this.stopListening();\n this.model = model;\n this.initialize(this.opt);\n this._rendered && this.render();\n },\n\n updateLayerable() {\n const { parentView } = this;\n const toRerender = parentView || this;\n toRerender.render();\n },\n\n __clearItems() {\n const { items } = this;\n items && items.remove();\n },\n\n remove() {\n Backbone.View.prototype.remove.apply(this, arguments);\n this.__clearItems();\n },\n\n render() {\n const { model, config, pfx, ppfx, opt } = this;\n this.__clearItems();\n const { isCountable } = opt;\n const hidden = isCountable && !isCountable(model, config.hideTextnode);\n const vis = this.isVisible();\n const el = this.$el.empty();\n const level = this.level + 1;\n this.inputName = 0;\n\n if (isUndefined(ItemsView)) {\n ItemsView = require('./ItemsView').default;\n }\n\n this.items = new ItemsView({\n ItemView: opt.ItemView,\n collection: model.get('components'),\n config: this.config,\n sorter: this.sorter,\n opened: this.opt.opened,\n parentView: this,\n parent: model,\n level\n });\n const children = this.items.render().$el;\n\n if (!this.config.showWrapper && level === 1) {\n el.append(children);\n } else {\n el.html(this.template(model));\n el.find(`.${this.clsChildren}`).append(children);\n }\n\n if (!model.get('draggable') || !this.config.sortable) {\n el.children(`.${this.clsMove}`).remove();\n }\n\n !vis && (this.className += ` ${pfx}hide`);\n hidden && (this.className += ` ${ppfx}hidden`);\n el.attr('class', this.className);\n this.updateOpening();\n this.updateStatus();\n this.updateVisibility();\n this.__render();\n this._rendered = 1;\n return this;\n },\n\n __render() {\n const { model, config, el } = this;\n const { onRender } = config;\n const opt = { component: model, el };\n onRender.bind(this)(opt);\n this.em.trigger('layer:render', opt);\n }\n});\n","export default {\n stylePrefix: '',\n\n // Specify the element to use as a container, string (query) or HTMLElement\n // With the empty value, nothing will be rendered\n appendTo: '',\n\n // Enable/Disable globally the possibility to sort layers\n sortable: 1,\n\n // Enable/Disable globally the possibility to hide layers\n hidable: 1,\n\n // Hide textnodes\n hideTextnode: 1,\n\n // Indicate a query string of the element to be selected as the root of layers.\n // By default the root is the wrapper\n root: '',\n\n // Indicates if the wrapper is visible in layers\n showWrapper: 1,\n\n // Show hovered components in canvas\n showHover: 1,\n\n // Scroll to selected component in Canvas when it's selected in Layers\n // true, false or `scrollIntoView`-like options,\n // `block: 'nearest'` avoids the issue of window scolling\n scrollCanvas: { behavior: 'smooth', block: 'nearest' },\n\n // Scroll to selected component in Layers when it's selected in Canvas\n // true, false or `scrollIntoView`-like options\n scrollLayers: { behavior: 'auto', block: 'nearest' },\n\n // Highlight when a layer component is hovered\n highlightHover: 1,\n\n /**\n * WARNING: Experimental option\n * A callback triggered once the component layer is initialized.\n * Useful to trigger updates on some component prop change.\n * @example\n * onInit({ component, render, listenTo }) {\n * listenTo(component, 'change:some-prop', render);\n * };\n */\n onInit: () => {},\n\n /**\n * WARNING: Experimental option\n * A callback triggered once the component layer is rendered.\n * A callback useful to update the layer DOM on some component change\n * @example\n * onRender({ component, el }) { // el is the DOM of the layer\n * if (component.get('some-prop')) {\n * // do changes using the `el` DOM\n * }\n * }\n */\n onRender: () => {},\n\n /**\n * Extend Layer view object (view/ItemView.js)\n * @example\n * extend: {\n * setName(name) {\n * // this.model is the component of the layer\n * this.model.set('another-prop-for-name', name);\n * },\n * },\n */\n extend: {}\n};\n","import defaults from './config/config';\nimport View from './view/ItemView';\nimport { isElement } from 'underscore';\n\nexport default () => {\n let em;\n let layers;\n let config = {};\n\n return {\n name: 'LayerManager',\n\n init(opts = {}) {\n config = { ...defaults, ...opts };\n config.stylePrefix = opts.pStylePrefix;\n em = config.em;\n return this;\n },\n\n getConfig() {\n return config;\n },\n\n onLoad() {\n em && em.on('component:selected', this.componentChanged);\n this.componentChanged();\n },\n\n postRender() {\n const elTo = config.appendTo;\n const root = config.root;\n root && this.setRoot(root);\n\n if (elTo) {\n const el = isElement(elTo) ? elTo : document.querySelector(elTo);\n el.appendChild(this.render());\n }\n },\n\n /**\n * Set new root for layers\n * @param {HTMLElement|Component|String} el Component to be set as the root\n * @return {self}\n */\n setRoot(el) {\n layers && layers.setRoot(el);\n return this;\n },\n\n /**\n * Get the root of layers\n * @return {Component}\n */\n getRoot() {\n return layers && layers.model;\n },\n\n /**\n * Return the view of layers\n * @return {View}\n */\n getAll() {\n return layers;\n },\n\n /**\n * Triggered when the selected component is changed\n * @private\n */\n componentChanged(selected, opts = {}) {\n if (opts.fromLayers) return;\n const opened = em.get('opened');\n const model = em.getSelected();\n const scroll = config.scrollLayers;\n let parent = model && model.collection ? model.collection.parent : null;\n for (let cid in opened) opened[cid].set('open', 0);\n\n while (parent) {\n parent.set('open', 1);\n opened[parent.cid] = parent;\n parent = parent.collection ? parent.collection.parent : null;\n }\n\n if (model && scroll) {\n const el = model.viewLayer && model.viewLayer.el;\n el && el.scrollIntoView(scroll);\n }\n },\n\n render() {\n const ItemView = View.extend(config.extend);\n layers && layers.remove();\n layers = new ItemView({\n ItemView,\n level: 0,\n config,\n opened: config.opened || {},\n model: em.get('DomComponents').getWrapper()\n });\n return layers.render().el;\n },\n\n destroy() {\n layers && layers.remove();\n [em, layers, config].forEach(i => (i = {}));\n }\n };\n};\n","// The initial version of this library was borrowed from https://github.com/madrobby/keymaster\n// and adapted to the GrapesJS's need\n\nvar k,\n _handlers = {},\n _mods = {\n 16: false,\n 18: false,\n 17: false,\n 91: false\n },\n _scope = 'all',\n // modifier keys\n _MODIFIERS = {\n '⇧': 16,\n shift: 16,\n '⌥': 18,\n alt: 18,\n option: 18,\n '⌃': 17,\n ctrl: 17,\n control: 17,\n '⌘': 91,\n command: 91\n },\n // special keys\n _MAP = {\n backspace: 8,\n tab: 9,\n clear: 12,\n enter: 13,\n return: 13,\n esc: 27,\n escape: 27,\n space: 32,\n left: 37,\n up: 38,\n right: 39,\n down: 40,\n del: 46,\n delete: 46,\n home: 36,\n end: 35,\n pageup: 33,\n pagedown: 34,\n ',': 188,\n '.': 190,\n '/': 191,\n '`': 192,\n '-': 189,\n '=': 187,\n ';': 186,\n \"'\": 222,\n '[': 219,\n ']': 221,\n '\\\\': 220\n },\n code = function(x) {\n return _MAP[x] || x.toUpperCase().charCodeAt(0);\n },\n _downKeys = [];\n\nfor (k = 1; k < 20; k++) _MAP['f' + k] = 111 + k;\n\n// IE doesn't support Array#indexOf, so have a simple replacement\nfunction index(array, item) {\n var i = array.length;\n while (i--) if (array[i] === item) return i;\n return -1;\n}\n\n// for comparing mods before unassignment\nfunction compareArray(a1, a2) {\n if (a1.length != a2.length) return false;\n for (var i = 0; i < a1.length; i++) {\n if (a1[i] !== a2[i]) return false;\n }\n return true;\n}\n\nvar modifierMap = {\n 16: 'shiftKey',\n 18: 'altKey',\n 17: 'ctrlKey',\n 91: 'metaKey'\n};\n\nfunction updateModifierKey(event) {\n for (k in _mods) _mods[k] = event[modifierMap[k]];\n}\n\n// handle keydown event\nfunction dispatch(event) {\n var key, handler, k, i, modifiersMatch, scope;\n key = event.keyCode;\n\n if (index(_downKeys, key) == -1) {\n _downKeys.push(key);\n }\n\n // if a modifier key, set the key. property to true and return\n if (key == 93 || key == 224) key = 91; // right command on webkit, command on Gecko\n if (key in _mods) {\n _mods[key] = true;\n // 'assignKey' from inside this closure is exported to window.key\n for (k in _MODIFIERS) if (_MODIFIERS[k] == key) assignKey[k] = true;\n return;\n }\n updateModifierKey(event);\n\n // see if we need to ignore the keypress (filter() can can be overridden)\n // by default ignore key presses if a select, textarea, or input is focused\n if (!assignKey.filter.call(this, event)) return;\n\n // abort if no potentially matching shortcuts found\n if (!(key in _handlers)) return;\n\n scope = getScope();\n\n // for each potential shortcut\n for (i = 0; i < _handlers[key].length; i++) {\n handler = _handlers[key][i];\n\n // see if it's in the current scope\n if (handler.scope == scope || handler.scope == 'all') {\n // check if modifiers match if any\n modifiersMatch = handler.mods.length > 0;\n for (k in _mods)\n if (\n (!_mods[k] && index(handler.mods, +k) > -1) ||\n (_mods[k] && index(handler.mods, +k) == -1)\n )\n modifiersMatch = false;\n // call the handler and stop the event if neccessary\n if (\n (handler.mods.length == 0 &&\n !_mods[16] &&\n !_mods[18] &&\n !_mods[17] &&\n !_mods[91]) ||\n modifiersMatch\n ) {\n if (handler.method(event, handler) === false) {\n if (event.preventDefault) event.preventDefault();\n else event.returnValue = false;\n if (event.stopPropagation) event.stopPropagation();\n if (event.cancelBubble) event.cancelBubble = true;\n }\n }\n }\n }\n}\n\n// unset modifier keys on keyup\nfunction clearModifier(event) {\n var key = event.keyCode,\n k,\n i = index(_downKeys, key);\n\n // remove key from _downKeys\n if (i >= 0) {\n _downKeys.splice(i, 1);\n }\n\n if (key == 93 || key == 224) key = 91;\n if (key in _mods) {\n _mods[key] = false;\n for (k in _MODIFIERS) if (_MODIFIERS[k] == key) assignKey[k] = false;\n }\n}\n\nfunction resetModifiers() {\n for (k in _mods) _mods[k] = false;\n for (k in _MODIFIERS) assignKey[k] = false;\n}\n\n// parse and assign shortcut\nfunction assignKey(key, scope, method) {\n var keys, mods;\n keys = getKeys(key);\n if (method === undefined) {\n method = scope;\n scope = 'all';\n }\n\n // for each shortcut\n for (var i = 0; i < keys.length; i++) {\n // set modifier keys if any\n mods = [];\n key = keys[i].split('+');\n if (key.length > 1) {\n mods = getMods(key);\n key = [key[key.length - 1]];\n }\n // convert to keycode and...\n key = key[0];\n key = code(key);\n // ...store handler\n if (!(key in _handlers)) _handlers[key] = [];\n _handlers[key].push({\n shortcut: keys[i],\n scope: scope,\n method: method,\n key: keys[i],\n mods: mods\n });\n }\n}\n\n// unbind all handlers for given key in current scope\nfunction unbindKey(key, scope) {\n var multipleKeys,\n keys,\n mods = [],\n i,\n j,\n obj;\n\n multipleKeys = getKeys(key);\n\n for (j = 0; j < multipleKeys.length; j++) {\n keys = multipleKeys[j].split('+');\n\n if (keys.length > 1) {\n mods = getMods(keys);\n }\n\n key = keys[keys.length - 1];\n key = code(key);\n\n if (scope === undefined) {\n scope = getScope();\n }\n if (!_handlers[key]) {\n return;\n }\n for (i = 0; i < _handlers[key].length; i++) {\n obj = _handlers[key][i];\n // only clear handlers if correct scope and mods match\n if (obj.scope === scope && compareArray(obj.mods, mods)) {\n _handlers[key][i] = {};\n }\n }\n }\n}\n\n// Returns true if the key with code 'keyCode' is currently down\n// Converts strings into key codes.\nfunction isPressed(keyCode) {\n if (typeof keyCode == 'string') {\n keyCode = code(keyCode);\n }\n return index(_downKeys, keyCode) != -1;\n}\n\nfunction getPressedKeyCodes() {\n return _downKeys.slice(0);\n}\n\nfunction filter(event) {\n var tagName = (event.target || event.srcElement).tagName;\n // ignore keypressed in any elements that support keyboard data input\n return !(tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA');\n}\n\n// initialize key. to false\nfor (k in _MODIFIERS) assignKey[k] = false;\n\n// set current scope (default 'all')\nfunction setScope(scope) {\n _scope = scope || 'all';\n}\n\nfunction getScope() {\n return _scope || 'all';\n}\n\n// delete all handlers for a given scope\nfunction deleteScope(scope) {\n var key, handlers, i;\n\n for (key in _handlers) {\n handlers = _handlers[key];\n for (i = 0; i < handlers.length; ) {\n if (handlers[i].scope === scope) handlers.splice(i, 1);\n else i++;\n }\n }\n}\n\n// abstract key logic for assign and unassign\nfunction getKeys(key) {\n var keys;\n key = key.replace(/\\s/g, '');\n keys = key.split(',');\n if (keys[keys.length - 1] == '') {\n keys[keys.length - 2] += ',';\n }\n return keys;\n}\n\n// abstract mods logic for assign and unassign\nfunction getMods(key) {\n var mods = key.slice(0, key.length - 1);\n for (var mi = 0; mi < mods.length; mi++) mods[mi] = _MODIFIERS[mods[mi]];\n return mods;\n}\n\n// cross-browser events\nfunction addEvent(object, event, method) {\n if (object.addEventListener) object.addEventListener(event, method, false);\n else if (object.attachEvent)\n object.attachEvent('on' + event, function() {\n method(window.event);\n });\n}\n\n// set window.key and window.key.set/get/deleteScope, and the default filter\nassignKey.setScope = setScope;\nassignKey.getScope = getScope;\nassignKey.deleteScope = deleteScope;\nassignKey.filter = filter;\nassignKey.isPressed = isPressed;\nassignKey.getPressedKeyCodes = getPressedKeyCodes;\nassignKey.unbind = unbindKey;\nassignKey.init = win => {\n // set the handlers globally on document\n // Passing _scope to a callback to ensure it remains the same by execution. Fixes #48\n addEvent(win.document, 'keydown', function(event) {\n dispatch(event);\n });\n addEvent(win.document, 'keyup', clearModifier);\n addEvent(win, 'focus', resetModifiers);\n};\n\nexport default assignKey;\n","/**\n * You can customize the initial state of the module from the editor initialization\n * ```js\n * const editor = grapesjs.init({\n * keymaps: {\n * // Object of keymaps\n * defaults: {\n * 'your-namespace:keymap-name' {\n * keys: '⌘+z, ctrl+z',\n * handler: 'some-command-id'\n * },\n * ...\n * }\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const keymaps = editor.Keymaps;\n * ```\n *\n * * [getConfig](#getconfig)\n * * [add](#add)\n * * [get](#get)\n * * [getAll](#getAll)\n * * [remove](#remove)\n * * [removeAll](#removeall)\n *\n * @module Keymaps\n */\n\nimport { isString } from 'underscore';\nimport { hasWin } from 'utils/mixins';\nimport keymaster from 'utils/keymaster';\n\nhasWin() && keymaster.init(window);\n\nexport default () => {\n let em;\n let config;\n const keymaps = {};\n const configDef = {\n defaults: {\n 'core:undo': {\n keys: '⌘+z, ctrl+z',\n handler: 'core:undo'\n },\n 'core:redo': {\n keys: '⌘+shift+z, ctrl+shift+z',\n handler: 'core:redo'\n },\n 'core:copy': {\n keys: '⌘+c, ctrl+c',\n handler: 'core:copy'\n },\n 'core:paste': {\n keys: '⌘+v, ctrl+v',\n handler: 'core:paste'\n },\n 'core:component-next': {\n keys: 's',\n handler: 'core:component-next'\n },\n 'core:component-prev': {\n keys: 'w',\n handler: 'core:component-prev'\n },\n 'core:component-enter': {\n keys: 'd',\n handler: 'core:component-enter'\n },\n 'core:component-exit': {\n keys: 'a',\n handler: 'core:component-exit'\n },\n 'core:component-delete': {\n keys: 'backspace, delete',\n handler: 'core:component-delete',\n opts: { prevent: 1 }\n }\n }\n };\n\n return {\n keymaster,\n\n name: 'Keymaps',\n\n /**\n * Get module configurations\n * @return {Object} Configuration object\n */\n getConfig() {\n return config;\n },\n\n /**\n * Initialize module\n * @param {Object} config Configurations\n * @private\n */\n init(opts = {}) {\n config = { ...configDef, ...opts };\n em = config.em;\n this.em = em;\n return this;\n },\n\n onLoad() {\n const defKeys = config.defaults;\n\n for (let id in defKeys) {\n const value = defKeys[id];\n this.add(id, value.keys, value.handler, value.opts || {});\n }\n },\n\n /**\n * Add new keymap\n * @param {string} id Keymap id\n * @param {string} keys Keymap keys, eg. `ctrl+a`, `⌘+z, ctrl+z`\n * @param {Function|string} handler Keymap handler, might be a function\n * @param {Object} [opts={}] Options\n * @return {Object} Added keymap\n * or just a command id as a string\n * @example\n * // 'ns' is just a custom namespace\n * keymaps.add('ns:my-keymap', '⌘+j, ⌘+u, ctrl+j, alt+u', editor => {\n * console.log('do stuff');\n * });\n * // or\n * keymaps.add('ns:my-keymap', '⌘+s, ctrl+s', 'some-gjs-command');\n *\n * // listen to events\n * editor.on('keymap:emit', (id, shortcut, e) => {\n * // ...\n * })\n */\n add(id, keys, handler, opts = {}) {\n const { em } = this;\n const cmd = em.get('Commands');\n const editor = em.getEditor();\n const canvas = em.get('Canvas');\n const keymap = { id, keys, handler };\n const pk = keymaps[id];\n pk && this.remove(id);\n keymaps[id] = keymap;\n keymaster(keys, (e, h) => {\n // It's safer putting handlers resolution inside the callback\n const opt = { event: e, h };\n handler = isString(handler) ? cmd.get(handler) : handler;\n const ableTorun = !em.isEditing() && !editor.Canvas.isInputFocused();\n if (ableTorun || opts.force) {\n opts.prevent && canvas.getCanvasView().preventDefault(e);\n typeof handler == 'object'\n ? cmd.runCommand(handler, opt)\n : handler(editor, 0, opt);\n const args = [id, h.shortcut, e];\n em.trigger('keymap:emit', ...args);\n em.trigger(`keymap:emit:${id}`, ...args);\n }\n });\n em.trigger('keymap:add', keymap);\n return keymap;\n },\n\n /**\n * Get the keymap by id\n * @param {string} id Keymap id\n * @return {Object} Keymap object\n * @example\n * keymaps.get('ns:my-keymap');\n * // -> {keys, handler};\n */\n get(id) {\n return keymaps[id];\n },\n\n /**\n * Get all keymaps\n * @return {Object}\n * @example\n * keymaps.getAll();\n * // -> {id1: {}, id2: {}};\n */\n getAll() {\n return keymaps;\n },\n\n /**\n * Remove the keymap by id\n * @param {string} id Keymap id\n * @return {Object} Removed keymap\n * @example\n * keymaps.remove('ns:my-keymap');\n * // -> {keys, handler};\n */\n remove(id) {\n const em = this.em;\n const keymap = this.get(id);\n\n if (keymap) {\n delete keymaps[id];\n keymap.keys.split(', ').forEach(k => keymaster.unbind(k.trim()));\n em && em.trigger('keymap:remove', keymap);\n return keymap;\n }\n },\n\n /**\n * Remove all binded keymaps\n * @return {this}\n */\n removeAll() {\n Object.keys(keymaps).forEach(keymap => this.remove(keymap));\n return this;\n },\n\n destroy() {\n this.removeAll();\n [em, config, keymaps].forEach(i => (i = {}));\n this.em = {};\n }\n };\n};\n","export default {\n stylePrefix: 'com-',\n\n // Default array of commands\n defaults: [],\n\n // If true, stateful commands (with `run` and `stop` methods) can't be runned multiple times.\n // So, if the command is already active, running it again will not execute the `run` method\n strict: 1\n};\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/commands/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * commands: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const commands = editor.Commands;\n * ```\n *\n * * [add](#add)\n * * [get](#get)\n * * [getAll](#getall)\n * * [extend](#extend)\n * * [has](#has)\n * * [run](#run)\n * * [stop](#stop)\n * * [isActive](#isactive)\n * * [getActive](#getactive)\n *\n * @module Commands\n */\n\nimport { isFunction, includes } from 'underscore';\nimport CommandAbstract from './view/CommandAbstract';\nimport defaults from './config/config';\nimport { eventDrag } from 'dom_components/model/Component';\n\nconst commandsDef = [\n ['preview', 'Preview', 'preview'],\n ['resize', 'Resize', 'resize'],\n ['fullscreen', 'Fullscreen', 'fullscreen'],\n ['copy', 'CopyComponent'],\n ['paste', 'PasteComponent'],\n ['canvas-move', 'CanvasMove'],\n ['canvas-clear', 'CanvasClear'],\n ['open-code', 'ExportTemplate', 'export-template'],\n ['open-layers', 'OpenLayers', 'open-layers'],\n ['open-styles', 'OpenStyleManager', 'open-sm'],\n ['open-traits', 'OpenTraitManager', 'open-tm'],\n ['open-blocks', 'OpenBlocks', 'open-blocks'],\n ['open-assets', 'OpenAssets', 'open-assets'],\n ['component-select', 'SelectComponent', 'select-comp'],\n ['component-outline', 'SwitchVisibility', 'sw-visibility'],\n ['component-offset', 'ShowOffset', 'show-offset'],\n ['component-move', 'MoveComponent', 'move-comp'],\n ['component-next', 'ComponentNext'],\n ['component-prev', 'ComponentPrev'],\n ['component-enter', 'ComponentEnter'],\n ['component-exit', 'ComponentExit', 'select-parent'],\n ['component-delete', 'ComponentDelete'],\n ['component-style-clear', 'ComponentStyleClear'],\n ['component-drag', 'ComponentDrag']\n];\n\nexport default () => {\n let em;\n let c = {};\n const commands = {};\n const defaultCommands = {};\n const active = {};\n\n // Need it here as it would be used below\n const add = function(id, obj) {\n if (isFunction(obj)) obj = { run: obj };\n if (!obj.stop) obj.noStop = 1;\n delete obj.initialize;\n obj.id = id;\n commands[id] = CommandAbstract.extend(obj);\n return this;\n };\n\n return {\n CommandAbstract,\n\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'Commands',\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @private\n */\n init(config = {}) {\n c = {\n ...defaults,\n ...config\n };\n em = c.em;\n const ppfx = c.pStylePrefix;\n if (ppfx) c.stylePrefix = ppfx + c.stylePrefix;\n\n // Load commands passed via configuration\n Object.keys(c.defaults).forEach(k => {\n const obj = c.defaults[k];\n if (obj.id) this.add(obj.id, obj);\n });\n\n defaultCommands['tlb-delete'] = {\n run(ed) {\n return ed.runCommand('core:component-delete');\n }\n };\n\n defaultCommands['tlb-clone'] = {\n run(ed) {\n ed.runCommand('core:copy');\n ed.runCommand('core:paste');\n }\n };\n\n defaultCommands['tlb-move'] = {\n run(ed, sender, opts = {}) {\n let dragger;\n const em = ed.getModel();\n const event = opts && opts.event;\n const { target } = opts;\n const sel = target || ed.getSelected();\n const selAll = target ? [target] : [...ed.getSelectedAll()];\n const nativeDrag = event && event.type == 'dragstart';\n const defComOptions = { preserveSelected: 1 };\n const modes = ['absolute', 'translate'];\n\n if (!sel || !sel.get('draggable')) {\n return em.logWarning('The element is not draggable');\n }\n\n const mode = sel.get('dmode') || em.get('dmode');\n const hideTlb = () => em.stopDefault(defComOptions);\n const altMode = includes(modes, mode);\n selAll.forEach(sel => sel.trigger('disable'));\n\n // Without setTimeout the ghost image disappears\n nativeDrag ? setTimeout(hideTlb, 0) : hideTlb();\n\n const onStart = data => {\n em.trigger(`${eventDrag}:start`, data);\n };\n const onDrag = data => {\n em.trigger(eventDrag, data);\n };\n const onEnd = (e, opts, data) => {\n selAll.forEach(sel => sel.set('status', 'selected'));\n ed.select(selAll);\n sel.emitUpdate();\n em.trigger(`${eventDrag}:end`, data);\n\n // Defer selectComponent in order to prevent canvas \"freeze\" #2692\n setTimeout(() => em.runDefault(defComOptions));\n\n // Dirty patch to prevent parent selection on drop\n (altMode || data.cancelled) && em.set('_cmpDrag', 1);\n };\n\n if (altMode) {\n // TODO move grabbing func in editor/canvas from the Sorter\n dragger = ed.runCommand('core:component-drag', {\n guidesInfo: 1,\n mode,\n target: sel,\n onStart,\n onDrag,\n onEnd,\n event\n });\n } else {\n if (nativeDrag) {\n event.dataTransfer.setDragImage(sel.view.el, 0, 0);\n //sel.set('status', 'freezed');\n }\n\n const cmdMove = ed.Commands.get('move-comp');\n cmdMove.onStart = onStart;\n cmdMove.onDrag = onDrag;\n cmdMove.onEndMoveFromModel = onEnd;\n cmdMove.initSorterFromModels(selAll);\n }\n\n selAll.forEach(sel => sel.set('status', 'freezed-selected'));\n }\n };\n\n // Core commands\n defaultCommands['core:undo'] = e => e.UndoManager.undo();\n defaultCommands['core:redo'] = e => e.UndoManager.redo();\n commandsDef.forEach(item => {\n const oldCmd = item[2];\n const cmd = require(`./view/${item[1]}`).default;\n const cmdName = `core:${item[0]}`;\n defaultCommands[cmdName] = cmd;\n if (oldCmd) {\n defaultCommands[oldCmd] = cmd;\n // Propogate old commands (can be removed once we stop to call old commands)\n ['run', 'stop'].forEach(name => {\n em.on(`${name}:${oldCmd}`, (...args) =>\n em.trigger(`${name}:${cmdName}`, ...args)\n );\n });\n }\n });\n\n if (c.em) c.model = c.em.get('Canvas');\n\n this.loadDefaultCommands();\n\n return this;\n },\n\n /**\n * Add new command to the collection\n * @param\t{string} id Command's ID\n * @param\t{Object|Function} command Object representing your command,\n * By passing just a function it's intended as a stateless command\n * (just like passing an object with only `run` method).\n * @return {this}\n * @example\n * commands.add('myCommand', {\n * \trun(editor, sender) {\n * \t\talert('Hello world!');\n * \t},\n * \tstop(editor, sender) {\n * \t},\n * });\n * // As a function\n * commands.add('myCommand2', editor => { ... });\n * */\n add,\n\n /**\n * Get command by ID\n * @param\t{string}\tid Command's ID\n * @return {Object} Object representing the command\n * @example\n * var myCommand = commands.get('myCommand');\n * myCommand.run();\n * */\n get(id) {\n let el = commands[id];\n\n if (isFunction(el)) {\n el = new el(c);\n commands[id] = el;\n } else if (!el) {\n em.logWarning(`'${id}' command not found`);\n }\n\n return el;\n },\n\n /**\n * Extend the command. The command to extend should be defined as an object\n * @param\t{string}\tid Command's ID\n * @param {Object} Object with the new command functions\n * @returns {this}\n * @example\n * commands.extend('old-command', {\n * someInnerFunction() {\n * // ...\n * }\n * });\n * */\n extend(id, cmd = {}) {\n const command = this.get(id);\n if (command) {\n const cmdObj = {\n ...command.constructor.prototype,\n ...cmd\n };\n this.add(id, cmdObj);\n // Extend also old name commands if exist\n const oldCmd = commandsDef.filter(\n cmd => `core:${cmd[0]}` === id && cmd[2]\n )[0];\n oldCmd && this.add(oldCmd[2], cmdObj);\n }\n return this;\n },\n\n /**\n * Check if command exists\n * @param\t{string}\tid Command's ID\n * @return {Boolean}\n * */\n has(id) {\n return !!commands[id];\n },\n\n /**\n * Get an object containing all the commands\n * @return {Object}\n */\n getAll() {\n return commands;\n },\n\n /**\n * Execute the command\n * @param {String} id Command ID\n * @param {Object} [options={}] Options\n * @return {*} The return is defined by the command\n * @example\n * commands.run('myCommand', { someOption: 1 });\n */\n run(id, options = {}) {\n return this.runCommand(this.get(id), options);\n },\n\n /**\n * Stop the command\n * @param {String} id Command ID\n * @param {Object} [options={}] Options\n * @return {*} The return is defined by the command\n * @example\n * commands.stop('myCommand', { someOption: 1 });\n */\n stop(id, options = {}) {\n return this.stopCommand(this.get(id), options);\n },\n\n /**\n * Check if the command is active. You activate commands with `run`\n * and disable them with `stop`. If the command was created without `stop`\n * method it can't be registered as active\n * @param {String} id Command id\n * @return {Boolean}\n * @example\n * const cId = 'some-command';\n * commands.run(cId);\n * commands.isActive(cId);\n * // -> true\n * commands.stop(cId);\n * commands.isActive(cId);\n * // -> false\n */\n isActive(id) {\n return this.getActive().hasOwnProperty(id);\n },\n\n /**\n * Get all active commands\n * @return {Object}\n * @example\n * console.log(commands.getActive());\n * // -> { someCommand: itsLastReturn, anotherOne: ... };\n */\n getActive() {\n return active;\n },\n\n /**\n * Load default commands\n * @return {this}\n * @private\n * */\n loadDefaultCommands() {\n for (var id in defaultCommands) {\n this.add(id, defaultCommands[id]);\n }\n\n return this;\n },\n\n /**\n * Run command via its object\n * @param {Object} command\n * @param {Object} options\n * @return {*} Result of the command\n * @private\n */\n runCommand(command, options = {}) {\n let result;\n\n if (command && command.run) {\n const id = command.id;\n const editor = em.get('Editor');\n\n if (!this.isActive(id) || options.force || !c.strict) {\n result = editor && command.callRun(editor, options);\n if (id && command.stop && !command.noStop && !options.abort) {\n active[id] = result;\n }\n }\n }\n\n return result;\n },\n\n /**\n * Stop the command\n * @param {Object} command\n * @param {Object} options\n * @return {*} Result of the command\n * @private\n */\n stopCommand(command, options = {}) {\n let result;\n\n if (command && command.run) {\n const id = command.id;\n const editor = em.get('Editor');\n\n if (this.isActive(id) || options.force || !c.strict) {\n if (id) delete active[id];\n result = command.callStop(editor, options);\n }\n }\n\n return result;\n },\n\n /**\n * Create anonymous Command instance\n * @param {Object} command Command object\n * @return {Command}\n * @private\n * */\n create(command) {\n if (!command.stop) command.noStop = 1;\n const cmd = CommandAbstract.extend(command);\n return new cmd(c);\n },\n\n destroy() {\n [em, c, commands, defaultCommands, active].forEach(i => (i = {}));\n }\n };\n};\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://grapesjs/webpack/universalModuleDefinition","webpack://grapesjs/webpack/bootstrap","webpack://grapesjs/./node_modules/underscore/modules/restArguments.js","webpack://grapesjs/./node_modules/underscore/modules/isObject.js","webpack://grapesjs/./node_modules/underscore/modules/isNull.js","webpack://grapesjs/./node_modules/underscore/modules/isUndefined.js","webpack://grapesjs/./node_modules/underscore/modules/isBoolean.js","webpack://grapesjs/./node_modules/underscore/modules/isElement.js","webpack://grapesjs/./node_modules/underscore/modules/_tagTester.js","webpack://grapesjs/./node_modules/underscore/modules/isString.js","webpack://grapesjs/./node_modules/underscore/modules/isNumber.js","webpack://grapesjs/./node_modules/underscore/modules/isDate.js","webpack://grapesjs/./node_modules/underscore/modules/isRegExp.js","webpack://grapesjs/./node_modules/underscore/modules/isError.js","webpack://grapesjs/./node_modules/underscore/modules/isSymbol.js","webpack://grapesjs/./node_modules/underscore/modules/isArrayBuffer.js","webpack://grapesjs/./node_modules/underscore/modules/isFunction.js","webpack://grapesjs/./node_modules/underscore/modules/_hasObjectTag.js","webpack://grapesjs/./node_modules/underscore/modules/_stringTagBug.js","webpack://grapesjs/./node_modules/underscore/modules/isDataView.js","webpack://grapesjs/./node_modules/underscore/modules/isArray.js","webpack://grapesjs/./node_modules/underscore/modules/_has.js","webpack://grapesjs/./node_modules/underscore/modules/isArguments.js","webpack://grapesjs/./node_modules/underscore/modules/isFinite.js","webpack://grapesjs/./node_modules/underscore/modules/isNaN.js","webpack://grapesjs/./node_modules/underscore/modules/constant.js","webpack://grapesjs/./node_modules/underscore/modules/_createSizePropertyCheck.js","webpack://grapesjs/./node_modules/underscore/modules/_shallowProperty.js","webpack://grapesjs/./node_modules/underscore/modules/_getByteLength.js","webpack://grapesjs/./node_modules/underscore/modules/_isBufferLike.js","webpack://grapesjs/./node_modules/underscore/modules/isTypedArray.js","webpack://grapesjs/./node_modules/underscore/modules/_getLength.js","webpack://grapesjs/./node_modules/underscore/modules/_collectNonEnumProps.js","webpack://grapesjs/./node_modules/underscore/modules/keys.js","webpack://grapesjs/./node_modules/underscore/modules/isEmpty.js","webpack://grapesjs/./node_modules/underscore/modules/isMatch.js","webpack://grapesjs/./node_modules/underscore/modules/underscore.js","webpack://grapesjs/./node_modules/underscore/modules/_toBufferView.js","webpack://grapesjs/./node_modules/underscore/modules/isEqual.js","webpack://grapesjs/./node_modules/underscore/modules/allKeys.js","webpack://grapesjs/./node_modules/underscore/modules/_methodFingerprint.js","webpack://grapesjs/./node_modules/underscore/modules/isMap.js","webpack://grapesjs/./node_modules/underscore/modules/isWeakMap.js","webpack://grapesjs/./node_modules/underscore/modules/isSet.js","webpack://grapesjs/./node_modules/underscore/modules/isWeakSet.js","webpack://grapesjs/./node_modules/underscore/modules/values.js","webpack://grapesjs/./node_modules/underscore/modules/pairs.js","webpack://grapesjs/./node_modules/underscore/modules/invert.js","webpack://grapesjs/./node_modules/underscore/modules/functions.js","webpack://grapesjs/./node_modules/underscore/modules/_createAssigner.js","webpack://grapesjs/./node_modules/underscore/modules/extend.js","webpack://grapesjs/./node_modules/underscore/modules/extendOwn.js","webpack://grapesjs/./node_modules/underscore/modules/defaults.js","webpack://grapesjs/./node_modules/underscore/modules/_baseCreate.js","webpack://grapesjs/./node_modules/underscore/modules/create.js","webpack://grapesjs/./node_modules/underscore/modules/clone.js","webpack://grapesjs/./node_modules/underscore/modules/tap.js","webpack://grapesjs/./node_modules/underscore/modules/toPath.js","webpack://grapesjs/./node_modules/underscore/modules/_toPath.js","webpack://grapesjs/./node_modules/underscore/modules/_deepGet.js","webpack://grapesjs/./node_modules/underscore/modules/get.js","webpack://grapesjs/./node_modules/underscore/modules/has.js","webpack://grapesjs/./node_modules/underscore/modules/identity.js","webpack://grapesjs/./node_modules/underscore/modules/matcher.js","webpack://grapesjs/./node_modules/underscore/modules/property.js","webpack://grapesjs/./node_modules/underscore/modules/_optimizeCb.js","webpack://grapesjs/./node_modules/underscore/modules/_baseIteratee.js","webpack://grapesjs/./node_modules/underscore/modules/iteratee.js","webpack://grapesjs/./node_modules/underscore/modules/_cb.js","webpack://grapesjs/./node_modules/underscore/modules/mapObject.js","webpack://grapesjs/./node_modules/underscore/modules/noop.js","webpack://grapesjs/./node_modules/underscore/modules/propertyOf.js","webpack://grapesjs/./node_modules/underscore/modules/times.js","webpack://grapesjs/./node_modules/underscore/modules/random.js","webpack://grapesjs/./node_modules/underscore/modules/now.js","webpack://grapesjs/./node_modules/underscore/modules/_createEscaper.js","webpack://grapesjs/./node_modules/underscore/modules/_escapeMap.js","webpack://grapesjs/./node_modules/underscore/modules/escape.js","webpack://grapesjs/./node_modules/underscore/modules/unescape.js","webpack://grapesjs/./node_modules/underscore/modules/_unescapeMap.js","webpack://grapesjs/./node_modules/underscore/modules/templateSettings.js","webpack://grapesjs/./node_modules/underscore/modules/template.js","webpack://grapesjs/./node_modules/underscore/modules/result.js","webpack://grapesjs/./node_modules/underscore/modules/uniqueId.js","webpack://grapesjs/./node_modules/underscore/modules/chain.js","webpack://grapesjs/./node_modules/underscore/modules/_executeBound.js","webpack://grapesjs/./node_modules/underscore/modules/partial.js","webpack://grapesjs/./node_modules/underscore/modules/bind.js","webpack://grapesjs/./node_modules/underscore/modules/_isArrayLike.js","webpack://grapesjs/./node_modules/underscore/modules/_flatten.js","webpack://grapesjs/./node_modules/underscore/modules/bindAll.js","webpack://grapesjs/./node_modules/underscore/modules/memoize.js","webpack://grapesjs/./node_modules/underscore/modules/delay.js","webpack://grapesjs/./node_modules/underscore/modules/defer.js","webpack://grapesjs/./node_modules/underscore/modules/throttle.js","webpack://grapesjs/./node_modules/underscore/modules/debounce.js","webpack://grapesjs/./node_modules/underscore/modules/wrap.js","webpack://grapesjs/./node_modules/underscore/modules/negate.js","webpack://grapesjs/./node_modules/underscore/modules/compose.js","webpack://grapesjs/./node_modules/underscore/modules/after.js","webpack://grapesjs/./node_modules/underscore/modules/before.js","webpack://grapesjs/./node_modules/underscore/modules/once.js","webpack://grapesjs/./node_modules/underscore/modules/findKey.js","webpack://grapesjs/./node_modules/underscore/modules/_createPredicateIndexFinder.js","webpack://grapesjs/./node_modules/underscore/modules/findIndex.js","webpack://grapesjs/./node_modules/underscore/modules/findLastIndex.js","webpack://grapesjs/./node_modules/underscore/modules/sortedIndex.js","webpack://grapesjs/./node_modules/underscore/modules/_createIndexFinder.js","webpack://grapesjs/./node_modules/underscore/modules/indexOf.js","webpack://grapesjs/./node_modules/underscore/modules/lastIndexOf.js","webpack://grapesjs/./node_modules/underscore/modules/find.js","webpack://grapesjs/./node_modules/underscore/modules/findWhere.js","webpack://grapesjs/./node_modules/underscore/modules/each.js","webpack://grapesjs/./node_modules/underscore/modules/map.js","webpack://grapesjs/./node_modules/underscore/modules/_createReduce.js","webpack://grapesjs/./node_modules/underscore/modules/reduce.js","webpack://grapesjs/./node_modules/underscore/modules/reduceRight.js","webpack://grapesjs/./node_modules/underscore/modules/filter.js","webpack://grapesjs/./node_modules/underscore/modules/reject.js","webpack://grapesjs/./node_modules/underscore/modules/every.js","webpack://grapesjs/./node_modules/underscore/modules/some.js","webpack://grapesjs/./node_modules/underscore/modules/contains.js","webpack://grapesjs/./node_modules/underscore/modules/invoke.js","webpack://grapesjs/./node_modules/underscore/modules/pluck.js","webpack://grapesjs/./node_modules/underscore/modules/where.js","webpack://grapesjs/./node_modules/underscore/modules/max.js","webpack://grapesjs/./node_modules/underscore/modules/min.js","webpack://grapesjs/./node_modules/underscore/modules/sample.js","webpack://grapesjs/./node_modules/underscore/modules/shuffle.js","webpack://grapesjs/./node_modules/underscore/modules/sortBy.js","webpack://grapesjs/./node_modules/underscore/modules/_group.js","webpack://grapesjs/./node_modules/underscore/modules/groupBy.js","webpack://grapesjs/./node_modules/underscore/modules/indexBy.js","webpack://grapesjs/./node_modules/underscore/modules/countBy.js","webpack://grapesjs/./node_modules/underscore/modules/partition.js","webpack://grapesjs/./node_modules/underscore/modules/toArray.js","webpack://grapesjs/./node_modules/underscore/modules/size.js","webpack://grapesjs/./node_modules/underscore/modules/_keyInObj.js","webpack://grapesjs/./node_modules/underscore/modules/pick.js","webpack://grapesjs/./node_modules/underscore/modules/omit.js","webpack://grapesjs/./node_modules/underscore/modules/initial.js","webpack://grapesjs/./node_modules/underscore/modules/first.js","webpack://grapesjs/./node_modules/underscore/modules/rest.js","webpack://grapesjs/./node_modules/underscore/modules/last.js","webpack://grapesjs/./node_modules/underscore/modules/compact.js","webpack://grapesjs/./node_modules/underscore/modules/flatten.js","webpack://grapesjs/./node_modules/underscore/modules/difference.js","webpack://grapesjs/./node_modules/underscore/modules/without.js","webpack://grapesjs/./node_modules/underscore/modules/uniq.js","webpack://grapesjs/./node_modules/underscore/modules/union.js","webpack://grapesjs/./node_modules/underscore/modules/intersection.js","webpack://grapesjs/./node_modules/underscore/modules/unzip.js","webpack://grapesjs/./node_modules/underscore/modules/zip.js","webpack://grapesjs/./node_modules/underscore/modules/object.js","webpack://grapesjs/./node_modules/underscore/modules/range.js","webpack://grapesjs/./node_modules/underscore/modules/chunk.js","webpack://grapesjs/./node_modules/underscore/modules/_chainResult.js","webpack://grapesjs/./node_modules/underscore/modules/mixin.js","webpack://grapesjs/./node_modules/underscore/modules/underscore-array-methods.js","webpack://grapesjs/./node_modules/underscore/modules/index-default.js","webpack://grapesjs/./src/utils/mixins.js","webpack://grapesjs/./node_modules/backbone/backbone.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/defineProperty.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/getPrototypeOf.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/classCallCheck.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/createClass.js","webpack://grapesjs/./node_modules/underscore/modules/_setup.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/inherits.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","webpack://grapesjs/./src/trait_manager/model/Trait.js","webpack://grapesjs/./src/trait_manager/model/Traits.js","webpack://grapesjs/./src/trait_manager/model/TraitFactory.js","webpack://grapesjs/./src/dom_components/model/Component.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/toConsumableArray.js","webpack://grapesjs/./src/dom_components/view/ComponentView.js","webpack://grapesjs/./src/utils/dom.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/typeof.js","webpack://grapesjs/./src/selector_manager/model/Selector.js","webpack://grapesjs/./src/utils/html.js","webpack://grapesjs/./src/utils/cash-dom.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js","webpack://grapesjs/./src/selector_manager/model/Selectors.js","webpack://grapesjs/./src/common/module.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/objectWithoutProperties.js","webpack://grapesjs/./src/dom_components/view/ToolbarButtonView.js","webpack://grapesjs/./src/dom_components/view/ToolbarView.js","webpack://grapesjs/./src/dom_components/model/ToolbarButton.js","webpack://grapesjs/./src/dom_components/model/Toolbar.js","webpack://grapesjs/./src/commands/view/SelectComponent.js","webpack://grapesjs/./src/utils/Dragger.js","webpack://grapesjs/./src/domain_abstract/ui/Input.js","webpack://grapesjs/./node_modules/@babel/runtime/regenerator/index.js","webpack://grapesjs/./node_modules/codemirror/lib/codemirror.js","webpack://grapesjs/./src/style_manager/view/PropertiesView.js","webpack://grapesjs/./src/domain_abstract/view/DomainViews.js","webpack://grapesjs/./src/dom_components/model/Components.js","webpack://grapesjs/./src/commands/view/CommandAbstract.js","webpack://grapesjs/./src/domain_abstract/model/Styleable.js","webpack://grapesjs/./src/style_manager/model/Property.js","webpack://grapesjs/./src/style_manager/model/PropertyComposite.js","webpack://grapesjs/./src/style_manager/model/Layer.js","webpack://grapesjs/./src/style_manager/model/Layers.js","webpack://grapesjs/./src/style_manager/model/PropertyStack.js","webpack://grapesjs/./src/style_manager/view/PropertyView.js","webpack://grapesjs/./src/style_manager/view/PropertyCompositeView.js","webpack://grapesjs/./src/style_manager/view/LayerView.js","webpack://grapesjs/./src/style_manager/view/LayersView.js","webpack://grapesjs/./src/style_manager/view/PropertyStackView.js","webpack://grapesjs/./src/style_manager/view/PropertyFileView.js","webpack://grapesjs/./src/style_manager/view/PropertyIntegerView.js","webpack://grapesjs/./src/style_manager/view/PropertyColorView.js","webpack://grapesjs/./src/style_manager/model/PropertyRadio.js","webpack://grapesjs/./src/style_manager/model/PropertySelect.js","webpack://grapesjs/./src/style_manager/view/PropertySelectView.js","webpack://grapesjs/./src/style_manager/view/PropertyRadioView.js","webpack://grapesjs/./src/style_manager/model/PropertyInteger.js","webpack://grapesjs/./src/style_manager/model/PropertySlider.js","webpack://grapesjs/./src/style_manager/view/PropertySliderView.js","webpack://grapesjs/./src/style_manager/model/Properties.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/asyncToGenerator.js","webpack://grapesjs/(webpack)/buildin/global.js","webpack://grapesjs/./src/commands/view/SelectPosition.js","webpack://grapesjs/./src/utils/fetch.js","webpack://grapesjs/./src/domain_abstract/model/TypeableCollection.js","webpack://grapesjs/./src/code_manager/model/CssGenerator.js","webpack://grapesjs/./src/domain_abstract/ui/InputNumber.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/slicedToArray.js","webpack://grapesjs/./src/dom_components/view/ComponentsView.js","webpack://grapesjs/./src/css_composer/view/CssRuleView.js","webpack://grapesjs/./src/css_composer/view/CssGroupRuleView.js","webpack://grapesjs/./src/css_composer/view/CssRulesView.js","webpack://grapesjs/./src/parser/model/BrowserParserHtml.js","webpack://grapesjs/./src/parser/model/ParserHtml.js","webpack://grapesjs/./src/domain_abstract/ui/InputColor.js","webpack://grapesjs/./src/utils/ColorPicker.js","webpack://grapesjs/./node_modules/promise-polyfill/src/index.js","webpack://grapesjs/./src/canvas/model/Frame.js","webpack://grapesjs/./src/canvas/model/Frames.js","webpack://grapesjs/./src/pages/model/Page.js","webpack://grapesjs/./src/pages/model/Pages.js","webpack://grapesjs/./src/pages/index.js","webpack://grapesjs/./src/panels/model/Button.js","webpack://grapesjs/./src/panels/model/Buttons.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/arrayLikeToArray.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","webpack://grapesjs/./node_modules/codemirror/mode/css/css.js","webpack://grapesjs/./src/commands/view/CanvasClear.js","webpack://grapesjs/./src/commands/view/CanvasMove.js","webpack://grapesjs/./src/commands/view/ComponentDelete.js","webpack://grapesjs/./src/commands/view/ComponentDrag.js","webpack://grapesjs/./src/commands/view/ComponentEnter.js","webpack://grapesjs/./src/commands/view/ComponentExit.js","webpack://grapesjs/./src/commands/view/ComponentNext.js","webpack://grapesjs/./src/commands/view/ComponentPrev.js","webpack://grapesjs/./src/commands/view/ComponentStyleClear.js","webpack://grapesjs/./src/commands/view/CopyComponent.js","webpack://grapesjs/./src/commands/view/DeleteComponent.js","webpack://grapesjs/./src/commands/view/ExportTemplate.js","webpack://grapesjs/./src/commands/view/Fullscreen.js","webpack://grapesjs/./src/commands/view/MoveComponent.js","webpack://grapesjs/./src/commands/view/OpenAssets.js","webpack://grapesjs/./src/commands/view/OpenBlocks.js","webpack://grapesjs/./src/commands/view/OpenLayers.js","webpack://grapesjs/./src/commands/view/OpenStyleManager.js","webpack://grapesjs/./src/commands/view/OpenTraitManager.js","webpack://grapesjs/./src/commands/view/PasteComponent.js","webpack://grapesjs/./src/commands/view/Preview.js","webpack://grapesjs/./src/commands/view/Resize.js","webpack://grapesjs/./src/commands/view/ShowOffset.js","webpack://grapesjs/./src/commands/view/SwitchVisibility.js","webpack://grapesjs/./node_modules/backbone-undo/Backbone.Undo.js","webpack://grapesjs/./node_modules/promise-polyfill/src/finally.js","webpack://grapesjs/./node_modules/promise-polyfill/src/allSettled.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/iterableToArray.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/nonIterableSpread.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","webpack://grapesjs/./src/undo_manager/index.js","webpack://grapesjs/./node_modules/timers-browserify/main.js","webpack://grapesjs/./node_modules/setimmediate/setImmediate.js","webpack://grapesjs/./node_modules/process/browser.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack://grapesjs/./node_modules/codemirror/mode/htmlmixed/htmlmixed.js","webpack://grapesjs/./node_modules/codemirror/mode/xml/xml.js","webpack://grapesjs/./node_modules/codemirror/mode/javascript/javascript.js","webpack://grapesjs/./node_modules/codemirror-formatting/formatting.js","webpack://grapesjs/./node_modules/regenerator-runtime/runtime.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/arrayWithHoles.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","webpack://grapesjs/./node_modules/@babel/runtime/helpers/nonIterableRest.js","webpack://grapesjs/./src/navigator/view/ItemsView.js","webpack://grapesjs/./src/commands/view sync ^\\.\\/.*$","webpack://grapesjs/./src/dom_components/config/config.js","webpack://grapesjs/./src/dom_components/model/ComponentTableCell.js","webpack://grapesjs/./src/dom_components/view/ComponentTableCellView.js","webpack://grapesjs/./src/dom_components/model/ComponentTableRow.js","webpack://grapesjs/./src/dom_components/view/ComponentTableRowView.js","webpack://grapesjs/./src/dom_components/model/ComponentTable.js","webpack://grapesjs/./src/dom_components/view/ComponentTableView.js","webpack://grapesjs/./src/dom_components/model/ComponentTableBody.js","webpack://grapesjs/./src/dom_components/model/ComponentTableHead.js","webpack://grapesjs/./src/dom_components/view/ComponentTableHeadView.js","webpack://grapesjs/./src/dom_components/view/ComponentTableBodyView.js","webpack://grapesjs/./src/dom_components/model/ComponentTableFoot.js","webpack://grapesjs/./src/dom_components/view/ComponentTableFootView.js","webpack://grapesjs/./src/dom_components/model/ComponentImage.js","webpack://grapesjs/./src/dom_components/model/ComponentMap.js","webpack://grapesjs/./src/dom_components/view/ComponentImageView.js","webpack://grapesjs/./src/dom_components/view/ComponentMapView.js","webpack://grapesjs/./src/dom_components/model/ComponentText.js","webpack://grapesjs/./src/dom_components/model/ComponentLink.js","webpack://grapesjs/./src/dom_components/view/ComponentTextView.js","webpack://grapesjs/./src/dom_components/view/ComponentLinkView.js","webpack://grapesjs/./src/dom_components/model/ComponentLabel.js","webpack://grapesjs/./src/dom_components/view/ComponentLabelView.js","webpack://grapesjs/./src/dom_components/model/ComponentVideo.js","webpack://grapesjs/./src/dom_components/view/ComponentVideoView.js","webpack://grapesjs/./src/dom_components/model/ComponentScript.js","webpack://grapesjs/./src/dom_components/view/ComponentScriptView.js","webpack://grapesjs/./src/dom_components/model/ComponentSvg.js","webpack://grapesjs/./src/dom_components/model/ComponentSvgIn.js","webpack://grapesjs/./src/dom_components/view/ComponentSvgView.js","webpack://grapesjs/./src/dom_components/model/ComponentTextNode.js","webpack://grapesjs/./src/dom_components/model/ComponentComment.js","webpack://grapesjs/./src/dom_components/view/ComponentTextNodeView.js","webpack://grapesjs/./src/dom_components/view/ComponentCommentView.js","webpack://grapesjs/./src/dom_components/model/ComponentWrapper.js","webpack://grapesjs/./src/dom_components/model/ComponentFrame.js","webpack://grapesjs/./src/dom_components/view/ComponentFrameView.js","webpack://grapesjs/./src/dom_components/index.js","webpack://grapesjs/./src/editor/config/config.js","webpack://grapesjs/./src/editor/model/Selected.js","webpack://grapesjs/./src/editor/model/Editor.js","webpack://grapesjs/./src/utils/extender.js","webpack://grapesjs/./src/editor/view/EditorView.js","webpack://grapesjs/./src/editor/index.js","webpack://grapesjs/./src/plugin_manager/config/config.js","webpack://grapesjs/./src/utils/polyfills.js","webpack://grapesjs/./src/index.js","webpack://grapesjs/./src/plugin_manager/index.js","webpack://grapesjs/./src/asset_manager/config/config.js","webpack://grapesjs/./src/asset_manager/model/Asset.js","webpack://grapesjs/./src/asset_manager/model/AssetImage.js","webpack://grapesjs/./src/asset_manager/view/AssetView.js","webpack://grapesjs/./src/asset_manager/view/AssetImageView.js","webpack://grapesjs/./src/asset_manager/model/Assets.js","webpack://grapesjs/./src/asset_manager/view/AssetsView.js","webpack://grapesjs/./src/asset_manager/view/FileUploader.js","webpack://grapesjs/./src/asset_manager/index.js","webpack://grapesjs/./src/trait_manager/config/config.js","webpack://grapesjs/./src/trait_manager/view/TraitView.js","webpack://grapesjs/./src/trait_manager/view/TraitsView.js","webpack://grapesjs/./src/trait_manager/view/TraitSelectView.js","webpack://grapesjs/./src/trait_manager/view/TraitCheckboxView.js","webpack://grapesjs/./src/trait_manager/view/TraitNumberView.js","webpack://grapesjs/./src/trait_manager/view/TraitColorView.js","webpack://grapesjs/./src/trait_manager/view/TraitButtonView.js","webpack://grapesjs/./src/trait_manager/index.js","webpack://grapesjs/./src/block_manager/config/config.js","webpack://grapesjs/./src/block_manager/model/Block.js","webpack://grapesjs/./src/block_manager/model/Blocks.js","webpack://grapesjs/./src/block_manager/model/Category.js","webpack://grapesjs/./src/block_manager/model/Categories.js","webpack://grapesjs/./src/block_manager/view/BlockView.js","webpack://grapesjs/./src/block_manager/view/CategoryView.js","webpack://grapesjs/./src/block_manager/view/BlocksView.js","webpack://grapesjs/./src/block_manager/index.js","webpack://grapesjs/./src/panels/config/config.js","webpack://grapesjs/./src/panels/model/Panel.js","webpack://grapesjs/./src/panels/model/Panels.js","webpack://grapesjs/./src/panels/view/ButtonView.js","webpack://grapesjs/./src/panels/view/ButtonsView.js","webpack://grapesjs/./src/panels/view/PanelView.js","webpack://grapesjs/./src/panels/view/PanelsView.js","webpack://grapesjs/./src/panels/index.js","webpack://grapesjs/./src/canvas/config/config.js","webpack://grapesjs/./src/canvas/model/Canvas.js","webpack://grapesjs/./src/utils/Droppable.js","webpack://grapesjs/./src/canvas/view/FrameView.js","webpack://grapesjs/./src/canvas/view/FrameWrapView.js","webpack://grapesjs/./src/canvas/view/FramesView.js","webpack://grapesjs/./src/canvas/view/CanvasView.js","webpack://grapesjs/./src/canvas/index.js","webpack://grapesjs/./src/style_manager/config/config.js","webpack://grapesjs/./src/style_manager/model/PropertyFactory.js","webpack://grapesjs/./src/style_manager/model/Sector.js","webpack://grapesjs/./src/style_manager/model/Sectors.js","webpack://grapesjs/./src/style_manager/view/SectorView.js","webpack://grapesjs/./src/style_manager/view/SectorsView.js","webpack://grapesjs/./src/style_manager/index.js","webpack://grapesjs/./src/code_manager/config/config.js","webpack://grapesjs/./src/code_manager/model/CodeMirrorEditor.js","webpack://grapesjs/./src/code_manager/model/HtmlGenerator.js","webpack://grapesjs/./src/code_manager/model/JsonGenerator.js","webpack://grapesjs/./src/code_manager/model/JsGenerator.js","webpack://grapesjs/./src/code_manager/view/EditorView.js","webpack://grapesjs/./src/code_manager/index.js","webpack://grapesjs/./src/device_manager/config/config.js","webpack://grapesjs/./src/device_manager/model/Device.js","webpack://grapesjs/./src/device_manager/model/Devices.js","webpack://grapesjs/./src/device_manager/view/DevicesView.js","webpack://grapesjs/./src/device_manager/index.js","webpack://grapesjs/./src/selector_manager/config/config.js","webpack://grapesjs/./src/selector_manager/model/State.js","webpack://grapesjs/./src/selector_manager/view/ClassTagView.js","webpack://grapesjs/./src/selector_manager/view/ClassTagsView.js","webpack://grapesjs/./src/selector_manager/index.js","webpack://grapesjs/./src/storage_manager/config/config.js","webpack://grapesjs/./src/storage_manager/model/LocalStorage.js","webpack://grapesjs/./src/storage_manager/model/RemoteStorage.js","webpack://grapesjs/./src/storage_manager/index.js","webpack://grapesjs/./src/parser/config/config.js","webpack://grapesjs/./src/parser/model/BrowserParserCss.js","webpack://grapesjs/./src/parser/model/ParserCss.js","webpack://grapesjs/./src/parser/index.js","webpack://grapesjs/./src/modal_dialog/config/config.js","webpack://grapesjs/./src/modal_dialog/model/Modal.js","webpack://grapesjs/./src/modal_dialog/view/ModalView.js","webpack://grapesjs/./src/modal_dialog/index.js","webpack://grapesjs/./src/css_composer/config/config.js","webpack://grapesjs/./src/css_composer/model/CssRule.js","webpack://grapesjs/./src/css_composer/model/CssRules.js","webpack://grapesjs/./src/css_composer/index.js","webpack://grapesjs/./src/utils/Sorter.js","webpack://grapesjs/./src/utils/Resizer.js","webpack://grapesjs/./src/utils/index.js","webpack://grapesjs/./src/i18n/locale/en.js","webpack://grapesjs/./src/i18n/config.js","webpack://grapesjs/./src/i18n/index.js","webpack://grapesjs/./src/rich_text_editor/model/RichTextEditor.js","webpack://grapesjs/./src/rich_text_editor/config/config.js","webpack://grapesjs/./src/rich_text_editor/index.js","webpack://grapesjs/./src/navigator/view/ItemView.js","webpack://grapesjs/./src/navigator/config/config.js","webpack://grapesjs/./src/navigator/index.js","webpack://grapesjs/./src/utils/keymaster.js","webpack://grapesjs/./src/keymaps/index.js","webpack://grapesjs/./src/commands/config/config.js","webpack://grapesjs/./src/commands/index.js"],"names":["root","factory","exports","module","define","amd","globalThis","window","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","restArguments","func","startIndex","length","Math","max","arguments","rest","Array","index","args","apply","isObject","obj","type","isNull","isUndefined","isBoolean","isElement","nodeType","tagTester","tag","isFunction","nodelist","document","childNodes","Int8Array","hasStringTagBug","DataView","ArrayBuffer","isIE11","Map","isDataView","getInt8","isArrayBuffer","buffer","has","isArguments","isSymbol","isNaN","parseFloat","isNumber","constant","createSizePropertyCheck","getSizeProperty","collection","sizeProperty","shallowProperty","typedArrayPattern","test","collectNonEnumProps","keys","hash","contains","push","emulatedSet","nonEnumIdx","constructor","proto","prop","isEmpty","isArray","isString","isMatch","attrs","_keys","_","_wrapped","toBufferView","bufferSource","Uint8Array","byteOffset","VERSION","valueOf","toJSON","toString","String","tagDataView","eq","a","b","aStack","bStack","deepEq","className","areArrays","aCtor","bCtor","pop","isEqual","allKeys","ie11fingerprint","methods","weakMapMethods","forEachName","hasName","commonInit","mapTail","mapMethods","concat","setMethods","values","pairs","invert","result","functions","names","sort","createAssigner","keysFunc","defaults","source","baseCreate","Ctor","props","extendOwn","clone","slice","extend","tap","interceptor","toPath","path","deepGet","defaultValue","identity","optimizeCb","context","argCount","accumulator","baseIteratee","Infinity","cb","iteratee","mapObject","results","currentKey","noop","propertyOf","times","accum","random","min","floor","Date","getTime","createEscaper","map","escaper","match","join","testRegexp","RegExp","replaceRegexp","string","replace","templateSettings","evaluate","interpolate","escape","noMatch","escapes","escapeRegExp","escapeChar","bareIdentifier","text","settings","oldSettings","matcher","offset","render","argument","variable","Error","Function","e","template","data","fallback","idCounter","uniqueId","prefix","id","chain","instance","_chain","executeBound","sourceFunc","boundFunc","callingContext","self","partial","boundArgs","placeholder","bound","position","TypeError","callArgs","flatten","input","depth","strict","output","idx","j","len","hasher","memoize","cache","address","wait","setTimeout","delay","throttle","options","timeout","previous","later","leading","now","throttled","_now","remaining","clearTimeout","trailing","cancel","debounce","immediate","passed","debounced","_args","wrap","wrapper","negate","predicate","compose","start","after","before","memo","findKey","createPredicateIndexFinder","dir","array","low","high","mid","createIndexFinder","predicateFind","sortedIndex","item","findIndex","findLastIndex","find","findWhere","each","createReduce","reducer","initial","filter","list","reject","every","some","fromIndex","guard","indexOf","contextPath","method","pluck","where","computed","lastComputed","v","sample","last","rand","temp","shuffle","sortBy","criteria","left","right","group","behavior","partition","pass","reStrSymbol","toArray","size","keyInObj","pick","first","compact","Boolean","otherArrays","difference","uniq","isSorted","seen","arrays","intersection","argsLength","unzip","range","stop","step","ceil","chunk","count","chainResult","mixin","hasWin","toLowerCase","str","elProt","Element","matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","getUiClass","em","defCls","getConfig","stylePrefix","customUI","appendStyles","styles","opts","stls","href","shift","unique","querySelector","head","link","createElement","rel","prepand","insertBefore","firstChild","appendChild","shallowDiff","objOrig","objNew","keysNew","origValue","newValue","on","el","ev","fn","split","forEach","elem","addEventListener","off","removeEventListener","getUnitFromValue","upFirst","toUpperCase","camelCase","normalizeFloat","valueDef","stepDecimals","side","toFixed","hasDnd","nativeDnD","getElement","isTextNode","getEl","isCommentNode","isTaggableNode","arr","getModel","$","model","getElRect","rectText","def","top","width","height","createRange","selectNode","getBoundingClientRect","detach","getPointerEvent","touches","getKeyCode","which","keyCode","getKeyChar","fromCharCode","isEscKey","isEnterKey","val","isEmptyObj","capitalize","charAt","substring","isComponent","toHTML","isRule","toCSS","getViewEl","__gjsv","setViewEl","view","createId","chars","global","Backbone","previousBackbone","noConflict","emulateHTTP","emulateJSON","addUnderscoreMethods","Class","attribute","defaultVal","unshift","addMethod","_isModel","modelMatcher","attributes","Events","eventSplitter","eventsApi","events","callback","internalOn","listening","_events","onApi","ctx","_listeners","listenTo","_listenId","listeningTo","_listeningTo","thisId","objId","handlers","offApi","listeners","stopListening","ids","handler","_callback","once","onceMap","listenToOnce","offer","trigger","triggerApi","objEvents","allEvents","all","triggerEvents","a1","a2","a3","unbind","Model","cid","cidPrefix","parse","set","changed","initialize","validationError","idAttribute","sync","attr","_validate","unset","silent","changes","changing","_changing","_previousAttributes","current","prev","_pending","clear","hasChanged","changedAttributes","diff","old","previousAttributes","fetch","success","resp","serverAttrs","wrapError","save","validate","isNew","patch","xhr","destroy","defer","url","base","urlError","encodeURIComponent","isValid","error","omit","Collection","models","comparator","_reset","reset","setOptions","add","remove","merge","addOptions","splice","insert","at","tail","singular","removed","_removeModels","added","merged","toAdd","toMerge","toRemove","modelMap","sortable","sortAttr","existing","_prepareModel","_addReference","orderChanged","_removeReference","previousModels","_byId","modelId","callbackOpts","_onModelEvent","event","prevId","collect","reduce","foldl","inject","reduceRight","foldr","detect","select","any","include","includes","invoke","take","drop","without","lastIndexOf","groupBy","countBy","indexBy","View","viewOptions","_ensureElement","delegateEventSplitter","tagName","selector","$el","_removeElement","setElement","element","undelegateEvents","_setElement","delegateEvents","delegate","eventName","listener","undelegate","_createElement","_setAttributes","methodMap","params","dataType","contentType","JSON","stringify","_method","beforeSend","setRequestHeader","processData","textStatus","errorThrown","ajax","Router","routes","_bindRoutes","optionalParam","namedParam","splatParam","route","isRegExp","_routeToRegExp","router","history","fragment","_extractParameters","execute","navigate","optional","exec","param","decodeURIComponent","History","checkUrl","location","routeStripper","rootStripper","pathStripper","started","interval","atRoot","pathname","getSearch","matchRoot","decodeFragment","decodeURI","getHash","getPath","getFragment","_usePushState","_wantsHashChange","hashChange","_hasHashChange","documentMode","_useHashChange","_wantsPushState","pushState","_hasPushState","rootPath","iframe","src","style","display","tabIndex","body","iWindow","contentWindow","open","close","attachEvent","_checkUrlInterval","setInterval","loadUrl","detachEvent","removeChild","clearInterval","title","assign","_updateHash","protoProps","staticProps","child","parent","__super__","configurable","writable","_getPrototypeOf","setPrototypeOf","getPrototypeOf","__proto__","Constructor","_defineProperties","target","descriptor","ArrayProto","ObjProto","SymbolProto","supportsArrayBuffer","supportsDataView","nativeIsArray","nativeKeys","nativeCreate","nativeIsView","isView","_isNaN","_isFinite","isFinite","hasEnumBug","propertyIsEnumerable","nonEnumerableProps","MAX_ARRAY_INDEX","pow","subClass","superClass","_typeof","assertThisInitialized","label","unit","default","changeProp","targetEvent","targetUpdated","getTargetValue","fromTarget","getAttributes","setTargetValue","valueToSet","setValueFromInput","final","toSet","avoidStore","getInitValue","Trait","coll","handleAdd","handleReset","setTarget","opt","tm","tf","config","build","objs","optionsTarget","TraitFactory","avoidInline","eventDrag","keySymbols","keySymbol","keySymbolOvrd","keyUpdate","keyUpdateInside","Component","bindAll","parentAttr","propagate","newAttr","toPropagate","voidElements","frame","ccid","initClasses","initTraits","initComponents","initToolbar","initScriptProps","scriptUpdated","tagUpdated","attrUpdated","_idUpdated","__emitUpdateTlb","__onChange","__propToParent","views","trim","emitUpdate","temporary","cssc","addCollection","__postAdd","init","__isSymbolOrInst","__initSymb","um","comps","components","__hasUm","getSelectors","recursive","__changesUp","__propSelfToParent","component","md","changesUp","query","$els","is","closest","classes","class","setClass","setStyle","attrPrev","pr","setAttributes","noClass","attrArr","compAttr","optsAdd","inline","state","cc","rule","getIdRule","getId","getStyle","Styleable","parseStyle","propOrig","setIdRule","addId","sm","cls","noStyle","styleToString","Selector","TYPE_ID","__getSymbol","__getSymbols","addClass","selectors","TYPE_CLASS","classe","classStr","toUp","symbol","symbols","log","__symbReady","__upSymbProps","__isSymbol","__isSymbolTop","symbTopSelf","__getSymbTop","symbTop","allById","symb","ref","__getAllById","symbs","ovrd","prp","symbEnabled","fromInstance","noPropagate","fromUndo","__isSymbOvrd","status","__getSymbToUp","__logSymbol","propsChanged","optUp","toUpOpts","isTemp","addedInstances","isMainSymb","addSymb","toAppend","addedInst","addedTop","symbolInv","append","isSymbNested","__isSymbolNested","toUpFn","symbPrnt","newMods","mod","attrCls","toListen","clsArr","normalizeClasses","Selectors","__upSymbCls","Components","addChild","avoidChildren","__upSymbComps","loadTraits","traits","trait","prevProps","newProps","prevPropsEv","newPropsEv","__scriptPropsChange","compArr","comp","children","prevColl","ppfx","tb","command","ed","runCommand","force","draggable","Traits","trt","tr","getTrait","res","clm","_inner","cloned","newId","rulesToClone","getRules","newRule","getAll","cName","isDiv","defName","nameTag","i18nPfx","i18nName","i18nNameTag","i18nDefName","icon","customTag","sTag","customAttr","getAttrToHTML","attrString","inner","__innerHTML","code","cmps","toolbar","getChangedProps","getView","_getFrame","modelProps","acc","script","scr","scrStr","tagVarStart","tagVarEnd","reg","updated","clb","onAll","rmOpts","abort","oldId","setId","idS","_getStyleRule","idUpdate","idPrev","getList","_getStyleSelector","ensureInList","nextId","getIncrementId","idMap","getNewId","ilen","uid","keepIds","counter","domc","dm","componentsById","checkId","sel","getDefaults","removable","droppable","badgable","stylable","unstylable","highlightable","copyable","resizable","editable","layerable","selectable","hoverable","void","content","dmode","arrayWithoutHoles","iterableToArray","unsupportedIterableToArray","nonIterableSpread","getClasses","modelOpt","draggableComponents","pfx","pStylePrefix","updateStyle","renderAttributes","updateHighlight","updateStatus","updateContent","handleChange","onActive","onDisable","avoidRender","__isDraggable","dragstart","_clbObj","_innertext","editor","getEditor","frameM","cv","childrenView","handleDragStart","preventDefault","stopPropagation","run","updateClasses","importClasses","renderChildren","chgArr","extHl","selectedCls","selectedParentCls","freezedCls","hoveredCls","selCls","noExtHl","removeClass","actualCls","getAttribute","avoidHover","setAttribute","hl","empty","removeAttribute","onAttrUpdate","removeAttr","updateAttributes","textable","defaultAttr","contenteditable","nodeName","hasComps","getChildrenContainer","innerHTML","prevDef","updateScript","getCanvasView","container","getChildrenSelector","getTemplate","getOffsetRect","rect","gtop","gleft","assignRect","offsetParent","offsetTop","offsetLeft","bottom","offsetHeight","offsetWidth","isInViewport","elDoc","ownerDocument","frameElement","defaultView","scrollTop","scrollLeft","scrollBottom","scrollIntoView","scrollTo","block","_setData","replaceWith","frameView","ComponentsView","componentTypes","postRender","onRender","KEY_TAG","KEY_ATTR","motionsEv","isDoc","removeEl","parentNode","querySelectorAll","attrUp","isVisible","getClientRects","oldEl","newEl","replaceChild","appendAtIndex","total","insertAdjacentHTML","lastChild","createEl","createText","createTextNode","createCustomEvent","oEvent","err","createEvent","initEvent","_parentEvent","keyCodeVal","appendVNodes","node","vNodes","vNodesArr","vnode","iterator","active","private","protected","_undo","namePreEsc","escapeName","nameEsc","getFullName","objLen","html","literals","substs","raw","lit","subst","doc","win","_Array$prototype","reverse","idRe","classRe","htmlRe","tagRe","getElementsByClassName","getElementsByTagName","Cash","__cash","eles","getElementById","parseHTML","ready","cash","undefined","ele","camelCaseRe","camelCaseWhitespaceRe","letter","removeProp","guid","oMatchesSelector","x","isNumeric","getCompareFunction","splitValuesRe","getSplitValues","computeStyle","isVariable","getComputedStyle","getPropertyValue","computeStyleInt","parseInt","hasClass","check","classList","_value","toggleClass","isForce","toggle","cssVariableRe","isCSSVariable","prefixedProps","docEl","vendorsPrefixes","getPrefixedProp","propCC","propUC","prefixedProp","numericProps","animationIterationCount","columnCount","flexGrow","flexShrink","fontWeight","lineHeight","opacity","order","orphans","widows","zIndex","getSuffixedValue","css","setProperty","dataNamespace","dataAttributeRe","getDataCache","getData","dataset","getExtraSpace","xAxis","hasNamespaces","ns1","ns2","removeEventListeners","_ref","hasData","_this","setData","removeData","boxSizing","includeMargins","eventsNamespace","eventsNamespacesSeparator","getEventsCache","parseEventName","parts","removeEvent","namespaces","eventCache","_ref2","eventFullName","_this2","_parseEventName","_one","_this3","_parseEventName2","finalCallback","namespace","thisArg","returnValue","addEvent","one","readyState","evt","_parseEventName3","dispatchEvent","selectOneRe","selectMultipleRe","getValue","selectedIndex","getValueSelectSingle","option","selected","disabled","getValueSelectMultiple","queryEncodeSpaceRe","skippableRe","checkableRe","serialize","elements","checked","queryEncode","substr","isMultiple","eleValue","cloneNode","containers","fragmentRe","singleTagRe","table","td","th","thead","tbody","tfoot","initContainers","$1","insertContent","prepend","isStr","insertElement","_this4","appendTo","outerHTML","insertAfter","_this5","nextSibling","_this6","_this7","_this8","_this9","prependTo","_this10","$eles","replaceAll","textContent","docEle","documentElement","pageYOffset","clientTop","pageXOffset","clientLeft","contents","contentDocument","found","next","nextElementSibling","not","parents","previousElementSibling","siblings","strings","freeze","defineProperties","noDisabled","__getConfig","getAllMap","__initConfig","conf","__initListen","update","__catchAllEvent","collections","entity","__remove","rm","removeBefore","__onAllEvent","__appendTo","elTo","__logWarn","logWarning","_createId","ln","allMap","__destroy","objectWithoutPropertiesLoose","excluded","getOwnPropertySymbols","sourceSymbolKeys","mousedown","handleClick","Canvas","getFrameEl","calibrated","clientX","clientY","execCommand","DomainViews","itemView","ToolbarButtonView","ToolbarButton","showOffsets","enable","frameOff","canvasOff","adjScroll","startSelectComponent","toggleSelectComponent","getSelected","onSelect","stopSelectComponent","listenToEl","getContainer","onFrameUpdated","onContainerChange","onHovered","updateGlobalPos","_upToolbar","updateAttached","getFrames","getWindow","getBody","onHover","onOut","onClick","onFrameScroll","trg","currentDoc","setHovered","updateLocalPos","pos","getElementPos","updateToolsLocal","elHovered","canvas","getToolsEl","toggleToolsEl","currentFrame","elSelected","updateToolsGlobal","initResize","getElSelected","getElHovered","showElementOffset","elPos","hideElementOffset","stopCommand","showFixedElementOffset","hideFixedElementOffset","hideHighlighter","getHighlighter","scroll","updateBadge","badge","getBadge","posOnly","getIcon","clsBadge","customeLabel","customBadgeLabel","badgeLabel","getName","un","bStyle","targetToElem","getTargetToElementFixed","leftOff","showHighlighter","modelToStyle","resizeClass","toggleBodyClass","docs","onStart","resizer","keyHeight","keyWidth","currentUnit","keepAutoHeight","keepAutoWidth","getModelToStyle","toggleFramesEvents","computedStyle","modelStyle","currentWidth","autoWidth","currentHeight","autoHeight","startDim","w","h","unitHeight","unitWidth","onMove","onEnd","updateTarget","store","selectedHandler","onlyHeight","onlyWidth","en","bodyw","addStyle","updateEvent","eventToListen","noEmit","updateToolbar","toolbarEl","getToolbarEl","toolbarStyle","showToolbar","Toolbar","toolbarView","ToolbarView","updateToolbarPos","getCanvasPosition","getPosition","getBadgeEl","updateTools","isCompSelected","isHoverEn","isNewEl","lastHovered","badgeOpts","toolsEl","canvasRectOffset","topOff","_trgToolUp","lastSelected","canvasOffsetTop","canvasOffsetLeft","refreshCanvas","hideBadge","cleanPrevious","getContentWindow","sender","preserveSelected","setSelected","Dragger","onDrag","setPosition","guidesStatic","guidesTarget","snapOffset","scale","delta","y","getDocumentEl","getContainerEl","getWindowEl","drag","keyHandle","handleScroll","lastScroll","actualScroll","getScrollInfo","scrollDiff","move","lastScrollDiff","toggleDrag","startPointer","getPointerPos","startPosition","getStartPosition","globScrollDiff","currentPos","glDiff","lockedAxis","shiftKey","detectAxisLock","moveDelta","co","deltaPre","currentPointer","snapGuides","newDelta","trgX","trgY","stat","isY","axs","trgPoint","statPoint","deltaPoint","trgGuide","isPointIn","trgValue","setGuideLock","axis","lock","ofst","guide","trgName","cancelled","end","xPos","yPos","parentWindow","getPos","getPointerPosition","pEv","relX","relY","absX","abs","absY","change","holderClass","inputClass","handleModelChange","elementUpdated","setValue","getInputEl","__onInputChange","fromInput","inputEl","plh","userAgent","navigator","platform","gecko","ie_upto10","ie_11up","edge","ie","ie_version","webkit","qtwebkit","chrome","presto","safari","vendor","mac_geMountainLion","phantom","ios","maxTouchPoints","android","mobile","mac","chromeOS","windows","presto_version","Number","flipCtrlCmd","captureRightClick","classTest","rmClass","removeChildren","removeChildrenAndAdd","elt","cssText","eltP","host","activeElt","activeElement","shadowRoot","joinClasses","as","endNode","setEnd","setStart","createTextRange","moveToElementText","collapse","moveEnd","moveStart","selectInput","f","copyObj","overwrite","countColumn","tabSize","startValue","search","nextTab","selectionStart","selectionEnd","_e","Delayed","time","onTimeout","ms","scrollerGap","Pass","sel_dontScroll","sel_mouse","origin","sel_move","findColumn","goal","col","skipped","spaceStrs","spaceStr","lst","out","nothing","createObj","inst","nonASCIISingleCaseWordChar","isWordCharBasic","ch","isWordChar","helper","extendingChars","isExtendingChar","charCodeAt","skipExtendingChars","findFirst","pred","from","to","midF","bidiOther","getBidiPartAt","sticky","cur","bidiOrdering","lowTypes","arabicTypes","bidiRE","isNeutral","isStrong","countsAsLeft","countsAsNum","BidiSpan","level","direction","outerType","types","i$1","i$2","type$1","i$3","prev$1","type$2","i$4","type$3","i$5","cur$1","type$4","i$6","end$1","replace$1","j$1","i$7","isRTL","j$2","nstart","getOrder","line","noHandlers","emitter","_handlers","getHandlers","signal","signalDOMEvent","cm","override","defaultPrevented","e_defaultPrevented","codemirrorIgnore","signalCursorActivity","cursorActivity","curOp","cursorActivityHandlers","hasHandler","eventMixin","ctor","e_preventDefault","e_stopPropagation","cancelBubble","e_stop","e_target","srcElement","e_button","button","ctrlKey","zwspSupported","badBidiRects","dragAndDrop","div","zeroWidthElement","measure","hasBadBidiRects","txt","r0","r1","splitLinesAuto","nl","rt","hasSelection","getSelection","te","selection","parentElement","compareEndPoints","hasCopyEvent","oncopy","badZoomedRects","modes","mimeModes","defineMode","dependencies","resolveMode","spec","getMode","mfactory","modeObj","modeExtensions","exts","helperType","modeProps","prop$1","extendMode","properties","copyState","nstate","innerMode","info","startState","StringStream","lineOracle","lastColumnPos","lastColumnValue","lineStart","getLine","lines","sz","chunkSize","getBetween","iter","getLines","updateLineHeight","lineNo","no","lineAtHeight","outer","lh","isLine","lineNumberFor","lineNumberFormatter","firstLineNumber","Pos","cmp","equalCursorPos","copyPos","maxPos","minPos","clipLine","clipPos","linelen","clipToLen","clipPosArray","eol","sol","peek","eat","eatWhile","eatSpace","skipToEnd","skipTo","backUp","column","indentation","pattern","consume","caseInsensitive","cased","hideFirstChars","lookAhead","oracle","baseToken","SavedContext","Context","maxLookAhead","baseTokens","baseTokenPos","highlightLine","forceToEnd","st","modeGen","lineClasses","runMode","loop","overlay","overlays","i_end","opaque","bgClass","textClass","getLineStyles","updateFrontier","getContextBefore","resetState","maxHighlightLength","stateAfter","styleClasses","highlightFrontier","modeFrontier","precise","minindent","minline","lim","indented","findStartLine","saved","fromSaved","processLine","viewFrom","viewTo","nextLine","startAt","stream","callBlankLine","readToken","blankLine","token","copy","Token","takeToken","asArray","tokens","extractLineClasses","lineClass","flattenSpans","curStart","curStyle","addModeClass","mName","sawReadOnlySpans","sawCollapsedSpans","MarkedSpan","marker","getMarkedSpanFor","spans","span","removeMarkedSpan","stretchSpansOverChange","full","oldFirst","markedSpans","oldLast","startCh","endCh","isInsert","nw","inclusiveLeft","insertLeft","endsAfter","inclusiveRight","markedSpansBefore","startsBefore","markedSpansAfter","sameLine","span$1","clearEmptySpans","newMarkers","gapMarkers","gap","clearWhenEmpty","detachMarkedSpans","detachLine","attachMarkedSpans","attachLine","extraLeft","extraRight","compareCollapsedMarkers","lenDiff","aPos","bPos","fromCmp","toCmp","collapsedSpanAtSide","sps","sp","collapsed","collapsedSpanAtStart","collapsedSpanAtEnd","collapsedSpanAround","conflictingCollapsedRange","visualLine","visualLineNo","lineN","vis","visualLineEndNo","lastLine","lineIsHidden","widgetNode","lineIsHiddenInner","heightAtLine","lineObj","lineLength","found$1","findMaxLine","maxLine","maxLineLength","maxLineChanged","Line","estimateHeight","cleanUpLine","styleToClassCache","styleToClassCacheWithMode","interpretTokenStyle","buildLineContent","lineView","builder","pre","trailingSpace","splitSpaces","getOption","addToken","buildToken","buildTokenBadBidi","insertLineContent","externalMeasured","maps","caches","defaultSpecialCharPlaceholder","startStyle","endStyle","displayText","trailingBefore","spaceBefore","special","specialChars","mustWrap","createDocumentFragment","lastIndex","txt$1","tabWidth","specialCharPlaceholder","fullStyle","part","buildCollapsedSpan","ignoreWidget","widget","needsContentAttribute","setUneditable","allText","spanStyle","spanEndStyle","spanStartStyle","nextChange","foundBookmarks","endStyles","upto","tokenText","LineView","visualLineContinued","hidden","buildViewArray","nextPos","operationGroup","orphanDelayedCallbacks","signalLater","delayedCallbacks","fireOrphanDelayed","delayed","updateLineForChanges","dims","updateLineText","updateLineGutter","updateLineClasses","updateLineWidgets","ensureLineWrapped","getLineContent","ext","built","background","updateLineBackground","wrapClass","gutter","gutterBackground","gutterClass","fixedGutter","fixedPos","gutterTotalWidth","markers","gutterMarkers","lineNumbers","wrap$1","gutterWrap","lineNumber","gutterLeft","k","gutterSpecs","gutterWidth","alignable","isWidget","insertLineWidgets","buildLineElement","insertLineWidgetsFor","allowAbove","widgets","ws","handleMouseEvents","positionLineWidget","above","noHScroll","wrapperWidth","coverGutter","paddingLeft","marginLeft","widgetHeight","parentStyle","gutters","clientWidth","eventInWidget","sizer","mover","paddingTop","lineSpace","paddingVert","paddingH","cachedPaddingH","currentStyle","paddingRight","scrollGap","nativeBarWidth","displayWidth","scroller","barWidth","displayHeight","clientHeight","barHeight","mapFromLineView","measureChar","bias","measureCharPrepared","prepareMeasureForLine","findViewForLine","findViewIndex","getDimensions","forceUpdate","lineMeasure","updateExternalMeasurement","hasHeights","prepared","varHeight","wrapping","lineWrapping","curWidth","heights","rects","ensureLineHeights","place","nodeAndOffsetInLineMap","coverStart","coverEnd","getUsefulRect","screen","logicalXDPI","deviceXDPI","normal","fromRange","hasBadZoomedRects","scaleX","scaleY","logicalYDPI","deviceYDPI","maybeUpdateRectForZooming","rSpan","charWidth","nullRect","rtop","rbot","bot","bogus","singleCursorHeightPerLine","rbottom","measureCharInner","measureText","mStart","mEnd","clearLineMeasurementCacheFor","clearLineMeasurementCache","externalMeasure","clearCaches","cachedCharWidth","cachedTextHeight","lineNumChars","pageScrollX","pageScrollY","marginTop","widgetTopHeight","intoCoordSystem","includeWidgets","yOff","viewOffset","lOff","xOff","fromCoordSystem","coords","localBox","lineSpaceBox","charCoords","cursorCoords","preparedMeasure","getBidi","partPos","other","estimateCoords","PosWithInfo","outside","xRel","coordsChar","coordsCharInner","rangeEnd","wrappedLineExtent","begin","wrappedLineExtentChar","boxIsAfter","box","ltr","coordsBidiPartWrapped","coordsBidiPart","baseX","chAround","boxAround","atLeft","atStart","_lineNo","closestDist","endX","dist","textHeight","anchor","compensateForHScroll","perLine","widgetsHeight","estimateLineHeights","est","estHeight","posFromMouse","liberal","forRect","space","e$1","colDiff","round","regChange","lendiff","updateLineNumbers","viewChanged","resetView","cut","viewCuttingPoint","cut$1","cutTop","cutBot","regLineChange","oldN","newN","countDirtyView","dirty","updateSelection","showSelection","prepareSelection","primary","curFragment","cursors","selFragment","ranges","primIndex","showCursorWhenSelecting","drawSelectionCursor","drawSelectionRange","cursor","cursorHeight","getWrapperElement","charPos","otherCursor","cmpCoords","padding","leftSide","rightSide","sizerWidth","docLTR","drawForLine","fromArg","toArg","lineLen","wrapX","extent","iterateBidiSections","fromPos","toPos","openStart","openEnd","openRight","topLeft","topRight","botLeft","botRight","sFrom","sTo","fromLine","toLine","singleVLine","leftEnd","rightStart","restartBlink","focused","blinker","cursorDiv","visibility","cursorBlinkRate","hasFocus","onBlur","ensureFocus","focus","onFocus","delayBlurEvent","delayingBlurEvent","draggingText","readOnly","selForContextMenu","receivedFocus","updateHeightsInViewport","prevBottom","lineDiv","viewTop","oldHeight","mustScroll","updateWidgetHeight","chWidth","visibleLines","viewport","ensure","ensureFrom","ensureTo","calculateScrollPos","snapMargin","screentop","docBottom","atTop","atBottom","newTop","gutterSpace","screenleft","screenw","tooWide","addToScrollTop","resolveScrollToPos","ensureCursorVisible","getCursor","scrollToPos","margin","cursorScrollMargin","scrollToCoords","scrollToCoordsRange","sPos","updateScrollTop","updateDisplaySimple","setScrollTop","startWorker","forceScroll","scrollHeight","scrollbars","setScrollLeft","isScroller","scrollWidth","alignHorizontally","measureForScrollbars","gutterW","docH","viewHeight","viewWidth","barLeft","docHeight","NativeScrollbars","vert","horiz","checkedZeroWidth","minHeight","minWidth","needsH","needsV","sWidth","totalHeight","totalWidth","zeroWidthHack","disableHoriz","enableZeroWidthBar","disableVert","pointerEvents","bar","maybeDisable","elementFromPoint","NullScrollbars","updateScrollbars","startWidth","startHeight","updateScrollbarsInner","sizes","paddingBottom","heightForcer","borderBottom","scrollbarFiller","coverGutterNextToScrollbar","gutterFiller","scrollbarModel","initScrollbars","scrollbarStyle","nextOpId","startOperation","op","updateInput","typing","changeObjs","cursorActivityCalled","selectionChanged","updateMaxLine","markArrays","ops","ownsGroup","endOperation","endCb","callbacks","fireCallbacksForOps","finishOperation","endOperation_R1","endOperation_W1","endOperation_R2","endOperation_W2","endOperation_finish","endOperations","scrollbarsClipped","marginBottom","borderRightWidth","maybeClipScrollbars","mustUpdate","DisplayUpdate","updatedDisplay","updateDisplayIfNeeded","barMeasure","adjustWidthTo","maxScrollLeft","preparedSelection","takeFocus","setDocumentHeight","postUpdateDisplay","wheelStartX","wheelStartY","doScroll","innerHeight","scrollNode","maybeScrollWindow","limit","endCoords","scrollPos","startTop","startLeft","scrollPosIntoView","maybeHiddenMarkers","unhidden","maybeUnhiddenMarkers","finish","runInOp","operation","methodOp","docMethodOp","highlight","highlightWorker","workTime","changedLines","oldStyles","highlighted","oldCls","newCls","ischange","workDelay","visible","editorIsHidden","wrapperHeight","oldDisplayWidth","renderedView","maybeUpdateLineNumberWidth","viewportMargin","different","lastWrapHeight","lastWrapWidth","adjustView","toUpdate","selSnapshot","anchorNode","anchorOffset","focusNode","focusOffset","selectionSnapshot","updateNumbersFrom","currentWheelTarget","updateNumber","patchDisplay","snapshot","removeAllRanges","addRange","restoreSelection","selectionDiv","reportedViewFrom","reportedViewTo","updateGutterSpace","alignWidgets","align","innerW","lineGutter","lineNumInnerWidth","lineNumWidth","getGutters","sawLineNumbers","renderGutters","specs","gElt","updateGutters","Display","wheelDX","wheelDY","activeTouch","wheelSamples","wheelPixelsPerUnit","wheelEventDelta","dx","wheelDeltaX","dy","wheelDeltaY","detail","HORIZONTAL_AXIS","VERTICAL_AXIS","wheelDelta","wheelEventPixels","onScrollWheel","canScrollX","canScrollY","pixels","movedX","movedY","Selection","equals","here","there","deepCopy","Range","somethingSelected","normalizeSelection","mayTouch","selectionsMayTouch","prim","inv","simpleSelection","changeEnd","adjustForChange","computeSelAfterChange","offsetPos","loadMode","modeOption","resetModeState","isWholeLineUpdate","wholeLineUpdateBefore","updateDoc","spansFor","updateLine","linesFor","firstLine","lastText","lastSpans","nlines","added$1","added$2","linkedDocs","sharedHistOnly","skip","sharedHist","linked","shared","attachDoc","setDirectionClass","done","undone","undoDepth","lastModTime","lastSelTime","lastOp","lastSelOp","lastOrigin","lastSelOrigin","generation","maxGeneration","historyChangeFromChange","histChange","attachLocalSpans","clearSelectionEvents","addChangeToHistory","selAfter","opId","hist","historyEventDelay","lastChangeEvent","pushSelectionToHistory","addSelectionToHistory","selectionEventCanBeMerged","clearRedo","dest","removeClearedSpans","explicitlyCleared","mergeOldSpans","getOldSpans","stretched","oldCur","stretchCur","copyHistoryArray","newGroup","instantiateSel","newChanges","extendRange","posBefore","extendSelection","setSelection","extendSelections","heads","replaceOneSelection","setSimpleSelection","setSelectionReplaceHistory","setSelectionNoUndo","NaN","filterSelectionChange","setSelectionInner","skipAtomicInSelection","reCheckSelection","mayClear","newAnchor","skipAtomic","newHead","skipAtomicInner","oldPos","preventCursorLeft","selectLeft","preventCursorRight","selectRight","atomic","near","movePos","far","cantEdit","selectAll","filterChange","canceled","makeChange","ignoreReadOnly","suppressEdits","mark","mk","newParts","dfrom","dto","removeReadOnlyRanges","makeChangeInner","makeChangeSingleDoc","rebased","rebaseHist","makeChangeFromHistory","allowSelectionOnly","suppress","antiChanges","returned","shiftDoc","distance","recomputeMaxLength","checkWidthStart","retreatFrontier","changesHandler","changeHandler","makeChangeSingleDocInEditor","replaceRange","splitLines","rebaseHistSelSingle","rebaseHistArray","sub","ok","copied","changeLine","handle","changeType","LeafChunk","BranchChunk","removeInner","insertInner","iterN","leaf","maybeSpill","me","sibling","myIndex","used","LineWidget","adjustScrollWhenAboveVisible","this$1","oldH","nextMarkerId","TextMarker","markText","isParent","SharedTextMarker","markTextShared","replacedWith","addToHistory","curLine","inThisOp","WeakSet","addMarkedSpan","clearOnEnter","clearHistory","withOp","visual","dHeight","findSharedMarkers","findMarks","detachSharedMarkers","subMarker","nextDocId","Doc","lineSep","cleanGeneration","lineSeparator","getRange","getLineHandle","getLineNumber","getLineHandleVisualStart","lineCount","listSelections","setCursor","extendSelectionsBy","setSelections","addSelection","getSelections","replaceSelection","dup","replaceSelections","newSel","hint","oldPrev","newPrev","computeReplacedSel","undo","redo","undoSelection","redoSelection","setExtending","getExtending","historySize","markClean","changeGeneration","forceSplit","isClean","gen","getHistory","setHistory","histData","setGutterMarker","gutterID","clearGutter","lineInfo","addLineClass","removeLineClass","addLineWidget","insertAt","aboveVisible","removeLineWidget","setBookmark","realOpts","findMarksAt","getAllMarks","posFromIndex","sepSize","indexFromPos","copyHistory","linkedDoc","mFrom","mTo","subMark","copySharedMarkers","unlinkDoc","CodeMirror","splitIds","iterLinkedDocs","setDirection","eachLine","lastDrop","onDrop","clearDragCursor","files","dataTransfer","isReadOnly","FileReader","File","read","markAsReadAndPasteIfAllFilesAreRead","readTextFromFile","file","allowDropFileTypes","reader","onerror","onload","readAsText","text$1","dragCursor","forEachCodeMirror","byClass","editors","globalsRegistered","ensureGlobalHandlers","resizeTimer","onResize","setSize","keyNames","3","8","9","13","16","17","18","19","20","27","32","33","34","35","36","37","38","39","40","44","45","46","59","61","91","92","93","106","107","109","110","111","145","173","186","187","188","189","190","191","192","219","220","221","222","224","63232","63233","63234","63235","63272","63273","63275","63276","63277","63302","keyMap","normalizeKeyName","alt","ctrl","cmd","normalizeKeyMap","keymap","keyname","lookupKey","getKeyMap","fallthrough","isModifierKey","addModifierNames","noShift","altKey","metaKey","keyName","altGraphKey","deleteNearSelection","compute","kill","toKill","replaced","moveCharLogically","moveLogically","endOfLine","visually","prep","targetTop","basic","pcDefault","emacsy","macDefault","commands","singleSelection","killLine","deleteLine","delLineLeft","delWrappedLineLeft","delWrappedLineRight","rightPos","goDocStart","goDocEnd","goLineStart","goLineStartSmart","lineStartSmart","goLineEnd","visualLineEnd","lineEnd","goLineRight","goLineLeft","goLineLeftSmart","goLineUp","moveV","goLineDown","goPageUp","goPageDown","goCharLeft","moveH","goCharRight","goColumnLeft","goColumnRight","goWordLeft","goGroupRight","goGroupLeft","goWordRight","delCharBefore","deleteH","delCharAfter","delWordBefore","delWordAfter","delGroupBefore","delGroupAfter","indentAuto","indentSelection","indentMore","indentLess","insertTab","insertSoftTab","spaces","defaultTab","transposeChars","newlineAndIndent","sels","indentLine","openLine","toggleOverwrite","firstNonWS","inWS","doHandleBinding","dropShift","ensurePolled","prevShift","stopSeq","dispatchKey","seq","keySeq","dispatchKeyInner","keyMaps","extraKeys","lookupKeyForEditor","handleKeyBinding","motion","lastStoppedKey","onKeyDown","getField","handled","up","showCrossHair","onKeyUp","onKeyPress","charCode","handleCharBinding","lastClick","lastDoubleClick","DOUBLECLICK_DELAY","PastClick","onMouseDown","supportsTouch","clickInGutter","repeat","compare","clickRepeat","selectingText","handleMappedButton","contained","addNew","moveOnDrag","configureMouse","dragDrop","moved","dragEnd","mouseMove","dragStart","preventScroll","e2","leftButtonStartDrag","ourRange","ourIndex","startSel","rangeForUnit","lastPos","extendTo","startCol","posCol","leftPos","oldRange","ranges$1","anchorLine","boundary","headIndex","usePart","bidiSimplify","editorSize","buttons","curCount","leftButtonSelect","leftButtonDown","onContextMenu","findWordAt","gutterEvent","prevent","mX","mY","lineBox","g","contextMenuInGutter","themeChanged","theme","Init","optionHandlers","dragDropChanged","funcs","dragFunctions","enter","over","leave","wrappingChanged","inputStyles","inputStyle","pasteIncoming","cutIncoming","autofocus","word","touchFinished","prevTouch","finishTouch","farAway","touch","radiusX","radiusY","isMouseLikeTouchEvent","pageX","pageY","frag","onDragOver","effectAllowed","setDragImage","img","_top","onDragStart","inp","registerEventHandlers","finishInit","initHooks","textRendering","how","aggressive","indent","curSpace","curSpaceString","indentUnit","indentString","indentWithTabs","pos$1","defineInitHook","lastCopied","setLastCopied","newLastCopied","applyTextInput","inserted","deleted","recent","paste","textLines","multiPaste","pasteLinesPerSelection","lineWise","changeEvent","triggerElectric","handlePaste","pasted","clipboardData","disableInput","electricChars","smartIndent","getModeAt","electricInput","copyableRanges","lineRange","disableBrowserMagic","field","spellcheck","autocorrect","autocapitalize","hiddenTextarea","border","findPosH","origDir","lineDir","moveOnce","boundToLine","astral","bidi","mv","getWrappedLineExtent","moveInStorageOrder","searchInVisualLine","getRes","nextCh","moveVisually","sawType","getHelper","hitSide","findPosV","pageSize","moveAmount","ContentEditableInput","lastAnchorNode","lastAnchorOffset","lastFocusNode","lastFocusOffset","polling","composing","gracePeriod","readDOMTimeout","posToDOM","badPos","bad","domToPos","lineNode","locateNodeInLineView","textNode","topNode","nodeValue","curNode","previousSibling","dist$1","belongsToInput","onCopyCut","lineWiseCopyCut","clearData","kludge","hadFocus","showPrimarySelection","contentEditable","updateFromDOM","readFromDOMSoon","forceCompositionEnd","screenReaderLabelChanged","showMultipleSelections","curAnchor","curFocus","rng","rangeCount","getRangeAt","startGracePeriod","rememberSelection","selectionInEditor","commonAncestorContainer","blur","pollSelection","pollInterval","poll","scan","isInGutter","triggerOnKeyDown","pollContent","fromNode","toNode","toIndex","newText","closing","extraLinebreak","addText","walk","cmText","markerID","isBlock","domTextBetween","oldText","cutFront","cutEnd","oldTop","maxCutFront","newBot","oldBot","maxCutEnd","chFrom","chTo","readOnlyChanged","resetPosition","TextareaInput","prevInput","pollingFast","createField","textarea","prepareCopyCut","fastPoll","Event","_display","moveInputWithCursor","headPos","wrapOff","lineOff","teTop","teLeft","drawn","contextMenuPending","slowPoll","missed","same","resetSelectionOnContextMenu","oldScrollY","oldCSS","oldWrapperCSS","wrapperBox","scrollY","rehide","detectingSelectAll","prepareSelectAllHack","mouseup","extval","deflt","notOnInit","defineOption","newBreaks","refresh","getInputField","attach","integer","defineOptions","helpers","setOption","getDoc","addKeyMap","removeKeyMap","addOverlay","score","priority","insertSorted","modeSpec","removeOverlay","newRanges","getTokenAt","getLineTokens","getTokenTypeAt","getHelpers","help","_global","getStateAfter","defaultTextHeight","defaultCharWidth","getViewport","addWidget","vspace","hspace","triggerOnKeyPress","triggerOnKeyUp","triggerOnMouseDown","amount","rtlMoveVisually","goalColumn","goals","startChar","scrollToRange","interpret","swapDoc","phrase","phraseText","phrases","getScrollerElement","getGutterElement","registerHelper","registerGlobalHelper","addEditorMethods","dontDelegate","defineMIME","mime","defineExtension","defineDocExtension","fromTextArea","tabindex","realSubmit","form","leaveSubmitMethodAlone","submit","wrappedSubmit","getTextArea","toTextArea","cmpPos","addLegacyProps","version","propTarget","onChange","onInputRender","customValue","addTo","typeView","rendered","updateVisibility","clearItems","itemsView","itemType","autoAdd","items","itemViewNotFound","warn","reuseView","typeField","onRemoveBefore","onRemove","getIdsToKeep","getNewIds","onAdd","resetChildren","newIds","allByID","rules","canRemoveStyle","rulesRemoved","getFullString","it","__postRemove","df","parseString","parsed","parseHtml","optsToPass","nodes","isMult","processDef","__firstAdd","mdl","processor","modelPr","$$typeof","parserHtml","splitPropsFromAttr","getType","setClassRule","__onAddEnd","editorModel","hoverClass","badgeClass","plhClass","freezClass","getCanvas","getCanvasBody","getCanvasTools","callRun","callStop","ParserHtml","extendStyle","propNew","removeStyle","imp","important","propPrv","getSelectorsString","selectorsToString","Property","callInit","getDefaultValue","complete","parseValue","valueStr","functionName","numeric","num","separator","cl","curr","hasValue","fnParameter","callParentInit","skipInit","fixedValues","toRequire","requires","requiresParent","detached","Properties","require","updateValues","clearValue","getFullValue","getSplitSeparator","defaultProps","getPropertyAt","preview","onPropAdd","Layer","onReset","noIncrement","getSeparator","getLayersFromValue","layers","cleaned","layerValue","getLayersFromStyle","styleObj","propModel","layer","propertyObj","layerProprs","propertyName","getPropertyValues","defValue","layerSeparator","layersColl","Layers","getLayers","getCurrentLayer","getValueFromStyle","getValueFromTarget","validStyles","getLayersFromTarget","clearProp","evStyleUp","templateLabel","templateInput","inputHolderId","sector","__destroyFn","modelValueChanged","_getClbOpts","updatedCls","computedCls","labelEl","clearStyleEl","getClearEl","clearStyle","clearProperties","__unset","clearEl","getTarget","getTargetModel","getTargets","targets","getFirstTarget","getHelperModel","inputValueChanged","emit","getInputValue","setStatus","emitUpdateTarget","_getTargetData","targetValue","ignoreDefault","computedValue","getComputedValue","highlightChanged","showComputed","highlightComputed","fromLayer","checkVisibility","targetData","__update","_emitUpdate","addData","_getEventData","propertyView","hideNotStylable","isTargetStylable","isComponentStylable","show","hide","customFetchValue","ignoreCustomValue","computedDef","computedDefault","avoid","avoidComputed","notToSkip","__updateTarget","getSelectedAll","fromParent","updateTargetStyle","__","stylableReq","sectors","parentEl","setRawValue","cleanValue","clearCached","$input","__change","__updateStyle","createdEl","parentRules","parentRule","setProps","PropertyView","propView","$props","console","propsView","PropertiesView","getPropsConfig","that","mIndex","valueOnIndex","click","stackModel","sorter","propsConfig","customPreview","onPreview","updatePreview","initSorter","startSort","removeItem","stackIndex","resultObj","valueInt","previewEl","getPreviewEl","prvStr","getPropertiesWrapper","propsWrapEl","wrapEl","propsEl","deselectAll","utils","Sorter","ignoreViewChildren","containerSel","itemSel","addToCollection","fragmentEl","LayerView","cssGen","CssGenerator","PropertyCompositeView","indexChanged","LayersView","refreshLayers","addLayer","deepClone","getLayerValues","_getClassRule","skipAdd","targetAlt","useClasses","_getParentTarget","targetsDevice","getAtRule","mapSorted","sortMediaObject","sortedRules","currIndex","rulesToCheck","resultValue","targetAltDevice","valueTargetAlt","valueTrgAltDvc","layersObj","valueComput","updateOpts","hasDetachedStyle","parentOpts","valueTrg","subModel","subProp","defVal","fieldEl","modal","am","$preview","$previewBox","componentValue","setPreviewView","setPreview","pv","spreadUrl","removeFile","openAssetManager","asset","accept","inputInst","unitEl","$unit","PropertyIntegerView","InputColor","$color","colorEl","onOptionChange","getOptions","addOption","updateOptions","optionsStr","styleAttr","inputH","itemCls","clsInput","inputStr","labelTxt","titleAttr","inputHld","inputChk","getCheckedEl","inputIn","units","getUnits","getValueUnit","InputNumber","validateInputValue","deepCheck","showInput","getSliderEl","slider","inputValueChangedSoft","TypeableCollection","extendViewApi","PropertyStack","PropertyStackView","isType","PropertyComposite","PropertyFileView","PropertyColorView","PropertySelect","PropertySelectView","PropertyRadio","PropertyRadioView","PropertySlider","PropertySliderView","PropertyInteger","asyncGeneratorStep","resolve","_next","_throw","arg","Promise","then","startSelectPosition","isPointed","placer","getPlacerEl","wmargin","nested","canvasRelative","getZoomDecimal","getOffsetDim","stopSelectPosition","posTargetCollection","posIndex","posMethod","cDim","endMove","posIsLastEl","posTargetEl","outsideElem","posTargetModel","nearFloat","isLast","$wrapper","rej","req","XMLHttpRequest","withCredentials","credentials","headers","statusText","responseText","upload","onProgress","onprogress","send","baseType","getBaseType","typeFound","recognizeType","getTypes","addType","definition","ModelInst","ViewInst","maxValue","MAX_VALUE","compCls","buildFromModel","wrapperIsBody","isWrapper","json","codeJson","clearStyles","atRules","dump","atRule","mRules","buildFromRule","rulesStr","ruleStr","selectorStrNoAdd","selectorsAdd","singleAtRule","keepUnusedStyles","getDeclaration","getQueryLength","mediaQuery","itemsArr","isMobFirst","mquery","sortRules","getKey","q","Input","keydown","contClass","valid","validObj","handleUnitChange","getUnitEl","handleKeyDown","upArrowClick","downArrowClick","normalizeValue","downIncrement","moveIncrement","upIncrement","prValue","limitlessMax","limitlessMin","fixed","regFixed","valCopy","uN","arrayWithHoles","iterableToArrayLimit","nonIterableRest","scriptContainer","triggerAdd","compView","sameFrameView","dt","viewObject","logError","CssRuleView","getBlockId","renderStarted","atRuleEl","styleEl","CssGroupRuleView","appendData","clsName","mediaText","defaultBlockId","blockId","getMediaWidth","contRules","prs","htmlType","defaultType","parser","DOMParser","mimeType","strF","parseFromString","scripts","hEls","modelAttrStart","compTypes","modelAttr","valueLen","valStr","firstChar","lastChar","decls","decl","parseClass","parseNode","attrsLen","nodePrev","nodeChild","ct","compType","inSvg","keepEmptyTextNodes","allTxt","foundTextNode","ci","cType","textTags","parserCss","cf","BrowserParserHtml","allowScripts","styleStr","resHtml","returnArray","defaultOpts","beforeShow","color","flat","allowEmpty","showButtons","clickoutFiresChange","showInitial","showPalette","showPaletteOnly","hideAfterPaletteSelect","togglePaletteOnly","showSelectionPalette","localStorageKey","maxSelectionSize","cancelText","chooseText","togglePaletteMoreText","togglePaletteLessText","clearText","noColorSelectedText","preferredFormat","containerClassName","replacerClassName","showAlpha","palette","selectionPalette","spectrums","IE","rgbaSupport","backgroundColor","replaceInput","markup","gradientFix","dataID","spectrum","extra","spect","load","loadOpts","inputTypeColorSupport","_cachedResult","colorInput","localization","palettes","processNativeColorInputs","colorInputs","trimLeft","trimRight","tinyCounter","math","mathRound","mathMin","mathMax","mathRandom","tinycolor","rgb","format","named","matchers","rgba","hsl","hsla","hsv","hsva","hex8","parseIntFromHex","hex6","hex3","stringInputToObject","bound01","convertToPercentage","hsvToRgb","hue2rgb","hslToRgb","boundAlpha","inputToRGB","_originalInput","_r","_g","_b","_a","_roundA","_format","_gradientType","gradientType","_ok","_tc_id","isDark","getBrightness","isLight","getOriginalInput","getFormat","getAlpha","toRgb","setAlpha","toHsv","rgbToHsv","toHsvString","toHsl","rgbToHsl","toHslString","toHex","allow3Char","rgbToHex","toHexString","toHex8","rgbaToHex","toHex8String","toRgbString","toPercentageRgb","toPercentageRgbString","toName","hexNames","toFilter","secondColor","hex8String","secondHex8String","formatSet","formattedString","hasAlpha","_applyModification","lighten","brighten","darken","desaturate","saturate","greyscale","spin","_applyCombination","analogous","complement","monochromatic","splitcomplement","triad","tetrad","fromRatio","newColor","color1","color2","mix","w1","rgb1","rgb2","w2","readability","c1","c2","brightnessA","brightnessB","colorDiff","brightness","isReadable","mostReadable","baseColor","colorList","bestColor","bestScore","bestIsReadable","readable","CSS_UNIT","PERMISSIVE_MATCH3","PERMISSIVE_MATCH4","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","burntsienna","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","flipped","flip","paletteTemplate","tiny","swatchStyle","callbackContext","instanceOptions","resize","reflow","throttler","isDragging","isDefault","dragWidth","dragHeight","dragHelperHeight","slideHeight","alphaWidth","alphaSlideHelperWidth","slideHelperHeight","currentHue","currentSaturation","currentValue","currentAlpha","paletteArray","paletteLookup","draggingClass","shiftMovementDirection","boundElement","pickerContainer","dragger","dragHelper","slideHelper","alphaSliderInner","alphaSlider","alphaSlideHelper","textInput","paletteContainer","initialColorContainer","cancelButton","clearButton","chooseButton","toggleButton","isInput","isInputTypeColor","shouldReplace","replacer","offsetElement","previewElement","initialColor","colorOnShow","currentPreferredFormat","applyOptions","updateSelectionPaletteFromStorage","localStorage","oldPalette","addColorToSelectionPalette","inArray","drawPalette","currentColor","getUniqueSelectionPalette","drawInitial","dragStop","setFromTextInput","updateOriginalInput","isDefaultPrevented","hideAll","$doc","onkeydown","clickout","updateUI","revert","ignoreFormatChange","newHsv","updateHelperLocations","flatColor","realColor","displayColor","realHex","realRgb","alpha","realAlpha","gradient","dragX","dragY","alphaX","slideY","fireCallback","picker","extraY","dpWidth","outerWidth","dpHeight","outerHeight","inputHeight","docElem","cW","cH","scL","scT","getOffset","disable","paletteElementClick","ignore","oldDragX","oldDragY","furtherFromX","paletteEvent","optionName","optionValue","coord","onmove","onstart","onstop","dragging","maxHeight","maxWidth","hasTouch","duringDragEvents","t0","rightclick","hex","pad2","clamp01","hue","slices","ret","modification","isOnePointZero","processPercent","isPercentage","ColorPicker","getColor","getColorEl","tc","valueClr","noneColor","previousColor","cpStyle","elToAppend","colorPickerConfig","setTimeoutFunc","_state","_handled","_deferreds","doResolve","deferred","_immediateFn","onFulfilled","onRejected","promise","finale","_unhandledRejectionFn","Handler","reason","ex","prom","promiseFinally","allSettled","race","setImmediate","keyAutoW","keyAutoH","Frame","changesCount","_undoexc","allRules","modOpts","wrp","Wrapper","idMapKeys","sSel","idSel","getComponent","noCount","getHead","setHead","getHeadByAttr","addHeadItem","removeHeadByAttr","page","smc","storeHtml","getHtml","storeCss","getCss","Frames","loadedItems","itemsToLoad","listenToLoadItems","itemLoaded","Page","frames","defFrame","frms","getMainFrame","Pages","evAll","evPfx","evPageSelect","evPageSelectBefore","evPageUpdate","evPageAdd","evPageAddBefore","evPageRemove","evPageRemoveBefore","chnSel","typeMain","storageKey","selectBefore","addBefore","cnf","pages","_onPageChange","onLoad","mainPage","getMain","lm","mainComp","getMainComponent","setRoot","postLoad","pg","getAllWrappers","getAllFrames","noStore","stm","pagesMap","togglable","runDefaultCommand","stopDefaultCommand","Buttons","Button","deactivateAllExceptOne","except","deactivateAll","fromCollection","disableAllButtons","disableAllButtonsExceptOne","arr2","arrayLikeToArray","minLen","keySet","parserConfig","propertyKeywords","tokenHooks","documentTypes","mediaTypes","mediaFeatures","mediaValueKeywords","nonStandardPropertyKeywords","fontProperties","counterDescriptors","colorKeywords","valueKeywords","allowNested","lineComment","supportsAtComponent","highlightNonStandardPropertyKeywords","tp","tokenBase","tokenize","tokenString","tokenParenthesized","quote","escaped","pushContext","popContext","states","popAndPass","wordAsValue","stateArg","_stream","atBlock","textAfter","cx","blockCommentStart","blockCommentEnd","blockCommentContinue","fold","documentTypes_","mediaTypes_","mediaFeatures_","mediaValueKeywords_","propertyKeywords_","nonStandardPropertyKeywords_","colorKeywords_","valueKeywords_","allWords","tokenCComment","maybeEnd","DomComponents","CssComposer","canvasModel","toggleMove","disableDragger","enableDragger","toggleDragger","methodCls","methodEv","methodsEv","toSelect","evName","setupGuides","isTran","guidesContainer","getGuidesContainer","getGuidesTarget","getGuidesStatic","drg","getEventOpts","guides","guidesEl","elInfoX","elInfoY","guideContent","getGlobalToolsEl","elGuideInfoX","elGuideInfoY","elGuideInfoContentX","elGuideInfoContentY","updateGuides","debug","renderGuide","getElementGuides","lastEl","getGuidePosUpdate","originRect","guideSize","numEl","noScroll","getTranslate","transform","itemStr","setTranslate","styleUp","adds","_getDragData","center","getMouseRelativeCanvas","guidesInfo","renderGuideInfo","hideGuidesInfo","rectOrigin","origEdge1","origEdge1Raw","origEdge2","origEdge2Raw","elGuideInfo","elGuideInfoCnt","guideInfoStyle","statEdge2","isEdge1","statEdge1","statEdge1Raw","statEdge2Raw","posFirst","posSecond","pos2","sizeRaw","matched","snd","incr","getChildAt","wrappers","findType","SelectComponent","mouseover","startDelete","mouseout","stopDelete","onDelete","$this","attachBadge","removeBadge","clean","updateBadgeLabel","Modal","CodeManager","$editors","oHtmlEd","buildEditor","oCsslEd","htmlEditor","cssEditor","textViewCode","setContent","codeName","codeMirror","getViewer","EditorView","isEnabled","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen","exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen","fsChanged","targetEl","SelectPosition","noSelClass","getHighlighterEl","wp","toggleClipboard","cacheEl","frameEl","onEndMove","rollback","initSorterFromModel","onEndMoveFromModel","initSorterFromModels","lastModel","toMove","onMoveClb","$badge","$hl","custom","__customData","onceClose","AssetManager","modalTitle","onDblClick","__behaviour","__trgCustom","assets","uploadEl","bm","firstRender","pn","Panels","getPanel","addPanel","Blocks","LayerManager","panels","$cn","trgEvCnt","$cn2","dvm","DeviceManager","showDevices","devicePanel","dvEl","slm","SelectorManager","slmConfig","StyleManager","smConfig","$header","pnCnt","panel","toggleSm","componentFirst","selectedAll","Config","TraitManager","confTm","toggleTm","clp","cop","cmdVis","getPanels","preventDrag","tglEffects","mthEv","tlb","elP","shouldRunSwVisibility","Commands","isActive","stopDefault","editorEl","onclick","canvasS","runDefault","canvasResizer","canvasView","getResizerEl","posFetcher","mousePosFetcher","getMouseRelativePos","forceNew","Utils","Resizer","getOffsetMethod","zoom","showOffsetsSelected","stateVar","offsetViewer","marginT","marginB","marginL","marginR","padT","padB","padL","padR","stateLow","marginName","paddingName","marginV","paddingV","paddingEls","fullMargName","fullPadName","marginLeftSt","marginRightSt","marginRight","marginTopSt","marginBottomSt","mtStyle","mbStyle","mlStyle","mrStyle","ptStyle","pbStyle","plStyle","prStyle","posLeft","widthEl","marginSideH","marginSideT","padTop","padBot","padSideH","padSideT","padRight","toggleVis","mth","_upFrame","_onFramesChange","core_slice","hasKeys","callstackWasIndexed","magicFusionIndex","getMagicFusionIndex","ObjectRegistry","registeredObjects","cidIndexes","onoff","objects","objectRegistry","register","unregister","actionUndoRedo","action","undoTypes","managerUndoRedo","manager","stack","magic","everything","isCurrentlyUndoRedoing","pointer","actions","isUndo","addToStack","track","undoTypesType","condition","validateUndoActionCreation","maximumStackLength","isRegistered","UndoTypes","unsetData","afterAttributes","keysAfter","keysPrevious","OwnedUndoTypes","manipulateUndoType","manipType","undoType","fns","undoTypesInstance","Action","UndoStack","setMaxLength","UndoManager","startTracking","stopTracking","isTracking","_addToStack","unregisterAll","undoAll","redoAll","isAvailable","undoManager","addUndoType","changeUndoType","removeUndoType","defaultAttributes","finallyConstructor","sourceKeys","beforeCache","configDef","trackSelection","hasSkip","noUndo","getChanged","hasUndo","undoExc","chn","removeAll","isEditing","hasRedo","getInstance","getStack","getStackGroup","__getStackRead","createItem","getPointer","Timeout","clearFn","_id","_clearFn","scope","unref","enroll","msecs","_idleTimeoutId","_idleTimeout","unenroll","_unrefActive","_onTimeout","clearImmediate","registerImmediate","channel","messagePrefix","onGlobalMessage","nextHandle","tasksByHandle","currentlyRunningATask","attachTo","process","nextTick","runIfPresent","postMessage","importScripts","postMessageIsAsynchronous","oldOnMessage","onmessage","canUsePostMessage","MessageChannel","port1","port2","onreadystatechange","task","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","runClearTimeout","Item","browser","env","argv","versions","addListener","removeListener","removeAllListeners","prependListener","prependOnceListener","binding","cwd","chdir","umask","_setPrototypeOf","ReferenceError","defaultTags","attrRegexpCache","getAttrValue","regexp","getAttrRegexp","getTagRegexp","anchored","addTags","htmlMode","multilineTagIndentFactor","multilineTagIndentPastTag","allowMissingTagName","tags","configTags","configScript","scriptTypes","htmlState","inTag","tagInfo","tagText","findMatchingMode","endTagA","endTag","localState","localMode","pat","maybeBackup","local","htmlConfig","autoSelfClosers","implicitlyClosed","contextGrabbers","doNotIndent","allowUnquoted","allowMissing","caseFold","xmlConfig","editorConf","config_","inText","inBlock","doctype","closure","baseState","tagStart","isInAttribute","stringStartCol","terminator","lower","startOfLine","noIndent","maybePopContext","nextTagName","parentTagName","tagNameState","closeTagNameState","attrState","matchClosing","closeState","closeStateErr","attrEqState","attrValueState","attrContinuedState","isInText","baseIndent","fullLine","alignCDATA","tagAfter","grabbers","configuration","skipAttribute","xmlCurrentTag","xmlCurrentContext","statementIndent","jsonldMode","jsonld","jsonMode","trackScope","isTS","typescript","wordRE","wordCharacters","keywords","kw","A","B","C","D","operator","atom","isOperatorChar","isJsonldKeyword","cont","tokenComment","expressionAllowed","inSet","readRegexp","tokenQuasi","lexical","lastType","brackets","findFatArrow","fatArrowAt","arrow","sawSomething","bracket","atomicTypes","JSLexical","inScope","varname","localVars","vars","parseJS","marked","expression","statement","lex","inList","newContext","registerVarScoped","Var","globalVars","isModifier","defaultVars","pushcontext","pushblockcontext","popcontext","pushlex","poplex","expect","wanted","exp","vardef","parenExpr","maybeexpression","maybeelse","functiondef","forspec","enumdef","typename","typeexpr","maybelabel","maybeCatchBinding","afterExport","afterImport","funarg","expressionInner","expressionNoComma","noComma","arrowBodyNoComma","arrowBody","commasep","maybeop","maybeoperatorNoComma","maybeoperatorComma","classExpression","arrayLiteral","contCommasep","objprop","quasi","targetNoComma","maybeTypeArgs","maybeTarget","expr","continueQuasi","getterSetter","afterprop","maybetype","what","sep","proceed","maybetypeOrIn","mayberettype","isKW","afterType","typeprops","typearg","maybeReturnType","quasiType","typeprop","functiondecl","continueQuasiType","typeparam","maybeTypeDefault","maybeAssign","vardefCont","eltpattern","proppattern","_type","forspec1","forspec2","classNameAfter","classBody","classfield","maybeFrom","exportField","importSpec","maybeMoreImports","maybeAs","enummember","basecolumn","isContinuedStatement","doubleIndentSwitch","closeBrackets","skipExpression","commentStart","commentEnd","newlineAfterToken","inlineElements","isComment","curMode","selText","endIndex","cmInstance","atSol","newline","runtime","Op","hasOwn","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","_invoke","GenStateSuspendedStart","GenStateExecuting","GenStateCompleted","doneResult","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","GenStateSuspendedYield","makeInvokeMethod","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","NativeIteratorPrototype","Gp","defineIteratorMethods","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","__await","unwrapped","resultName","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","iterable","iteratorMethod","displayName","isGeneratorFunction","genFun","awrap","async","skipTempReset","rootRecord","rval","exception","loc","caught","hasCatch","hasFinally","finallyEntry","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","_i","_s","_arr","_n","_d","parentView","sortContainer","created","srcModel","getSourceModel","forceChange","avoidSelectOnEnd","viewLayer","ItemView","isCountable","opened","webpackContext","webpackContextResolve","storeWrapper","ComponentView","columns","rows","rowsToAdd","columnsToAdd","ComponentTableBody","svgAttrs","ratioDefault","cmdName","hasButtonBool","getSrcResult","btoa","isDefaultSrc","parseUri","uri","qrs","pair","hostname","protocol","port","mapUrl","mapType","frameborder","OComponent","parseFromSrc","updateSrc","getMapUrl","addr","qr","z","dblclick","classEmpty","fetchFile","FileUploader","uploadFile","srcExists","addAttributes","getSrc","onError","noDrag","getIframe","ifrm","frameBorder","onmousedown","compProt","disableEditing","updateContentText","syncContent","rte","fromDisable","rteEnabled","activeRte","toggleEvents","getContent","contentOpt","customRte","onInput","disablePropagation","mixins","setEditing","elDocs","ComponentLinkView","yt","vi","ytnc","videoId","provider","ytUrl","ytncUrl","viUrl","poster","muted","autoplay","controls","modestbranding","sources","allowfullscreen","updateTraits","getYoutubeTraits","getVimeoTraits","getSourceTraits","prov","getYoutubeSrc","getYoutubeNoCookieSrc","getVimeoSrc","getProviderTrait","getAutoplayTrait","getLoopTrait","getControlsTrait","isYtProv","isYtncProv","isViProv","isExtProv","OComponentView","updateProvider","updateVideo","renderByProvider","videoEl","renderYoutube","renderYoutubeNoCookie","renderVimeo","renderSource","initVideoEl","scrCnt","scriptCount","svar","svarNext","svarFn","svarNextFn","customName","createElementNS","cnt","createComment","__wrapper","__getSrc","componentView","ComponentTableCell","ComponentTableCellView","ComponentTableRow","ComponentTableRowView","ComponentTable","ComponentTableView","ComponentTableHead","ComponentTableHeadView","ComponentTableBodyView","ComponentTableFoot","ComponentTableFootView","ComponentMap","ComponentMapView","ComponentLink","ComponentLabel","ComponentLabelView","ComponentVideo","ComponentVideoView","ComponentImage","ComponentImageView","ComponentScript","ComponentScriptView","ComponentSvgIn","ComponentSvgView","ComponentSvg","ComponentFrame","ComponentFrameView","ComponentComment","ComponentCommentView","ComponentTextNode","ComponentTextNodeView","ComponentText","ComponentTextView","ComponentWrapper","storeComponents","componentHovered","selectAdd","selectRemove","setComponents","getCacheLoad","isObj","getWrapper","getComponents","toStore","addComponent","extendView","extendFn","extendFnView","extendType","extendViewType","typeToExtend","modelToExt","viewToExt","getExtendedObj","srcToExt","parentFn","removeType","fromElement","noticeOnUnload","forceClass","baseCss","protectedCss","canvasCss","defaultCommand","devicePreviewMode","mediaCondition","jsInHtml","multipleSelection","exportWrapper","optsHtml","optsCss","avoidInlineStyle","avoidDefaults","dragMode","cssIcons","i18n","assetManager","storageManager","richTextEditor","domComponents","codeManager","cssComposer","selectorManager","deviceManager","styleManager","buildProps","blockManager","traitManager","multiFrames","Selectable","Selected","hasComponent","getByComponent","timedInterval","updateItr","deps","Window","ar","Extender","logs","warning","editing","clipboard","previousModel","storables","toLoad","device","pageManager","toLog","attrsOrig","loadModule","updateChanges","_checkReady","listenLog","eventFrom","eventTo","loadOnStart","canAutoload","onbeforeunload","isAutosave","getStepsBeforeSave","moduleName","Mod","cfgParent","cfg","_disable","destroyed","handleUpdates","lastComponent","allComponents","multiple","els","mltSel","removeSelected","toggleSelected","clearSelection","selColl","selIndex","addSelected","removeComponent","getHovered","getCode","setState","getState","js","getJs","avoidProt","avoidProtected","protCss","storeData","editingCmp","getEditing","loadData","__clearKeys","cacheLoad","getDeviceModel","defaultRunning","tools","getCurrentMedia","setCurrentFrame","getCurrentFrame","getCurrentFrameModel","getDirtyCount","getZoomMultiplier","setDragMode","inAbsoluteMode","destroyAll","grapesjs","msg","logNs","logInfo","initBaseColorPicker","colorPicker","varName","disableButtons","contEl","editorView","EditorModel","addComponents","getSelectedToStyle","selectToggle","setDevice","getDevice","setCustomRte","RichTextEditor","setCustomParserCss","Parser","onReady","plugins","agent","isIE","originalCreateHTMLDocument","DOMImplementation","createHTMLDocument","implementation","polyfills","plugin","defaultConfig","autorender","pluginsOpts","__GJS_VERSION__","headless","Editor","pluginId","plgOptions","wplg","noAssets","uploadName","multiUpload","customFetch","embedAsBase64","beforeUpload","showUrlInput","dropzone","openAssetsOnDrop","dropzoneContent","Asset","getFilename","AssetImage","unitDim","__getBhv","__getBehaviour","getPreview","getInfo","AssetView","dim","stopImmediatePropagation","AssetImageView","renderAssets","addToAsset","removedAsset","handleSubmit","getAddInput","getAssetsEl","globalCollection","inputUrl","toggleNoAssets","addAsset","assetsEl","fuRendered","fu","uploadId","disableUpload","onUploadStart","__propEv","onUploadEnd","onUploadError","onUploadResponse","FormData","reqHead","fetchOpts","catch","initDrop","uploadForm","ondragover","ondragleave","ondrop","initDropzone","addedCls","edEl","dropzoneCls","cleanEditorElCls","onDragLeave","response","promises","mimeTypeMatcher","image","Image","readAsDataURL","evSelect","evUpdate","evAdd","evRemove","evRemoveBefore","evCustom","evOpen","evClose","assetsVis","assetCmd","Module","Assets","getAllVisible","bhv","isOpen","assts","toRender","FileUpload","AssetsView","_bhv","eventCapture","appendInput","getLabel","clsField","onValueChange","removeView","rerender","getClbOpts","elInput","getInputElem","onUpdate","onEvent","getValueForTarget","setInputValue","postUpdate","renderLabel","tpl","createLabel","getModelValue","i18nAttr","getElInput","renderField","inputs","createInput","hasLabel","noLabel","tmpl","TraitView","updatedCollection","propName","valResult","getCheckedValue","valueTrue","valueFalse","toInit","inputNumber","labelButton","TraitsViewer","typesDef","number","TraitNumberView","TraitSelectView","checkbox","TraitCheckboxView","TraitColorView","TraitButtonView","TraitsView","getTraitsViewer","baseView","appendOnClick","blocks","Block","media","category","activate","resetId","ctg","Category","Categories","dragend","endDrag","__getModule","getSorter","setDropContent","validTarget","startDrag","setDragHelper","__startDrag","handleDrag","__drag","handleDragEnd","__endDrag","clsAdd","CategoryView","caretR","caretD","iconClass","activeClass","getIconEl","getBlocksEl","iconEl","blocksEl","categories","renderedCategories","noCatClass","blockContClass","catsClass","tac","grabbingCls","updateConfig","oldActive","BlockView","ignoreCategories","catModel","catId","catView","getCategoriesEl","catsEl","evDrag","evDragStart","evDragStop","blocksVisible","blocksView","_dragBlock","dragResult","dragContent","oldKey","toActive","__getFrameViews","fv","startCustom","endCustom","BlocksView","getCategories","external","colls","swv","expt","osm","otm","ola","obl","ful","prv","delayBtnsShow","btn","Panel","listen","activeCls","disableCls","btnsVisCls","updateActive","checkActive","updateBtnsVis","updateClassName","updateDisable","chnOpt","fromListen","$buttons","commandName","noStop","clicked","toggleActive","parentM","ButtonView","appendContent","toggleVisible","cr","bc","resz","resLen","tl","bl","br","silentFrames","avoidContainerUpdate","forContainer","styleWidth","styleHeight","ButtonsView","PanelView","PanelsViewObj","getPanelsEl","removePanel","addButton","panelId","removeButton","getButton","PanelsView","autoscrollLimit","notTextable","rulers","onZoomChange","updateDevice","_pageUpdated","Droppable","rootEl","toggleEffects","handleDragEnter","handleDragOver","handleDrop","handleDragLeave","sortOpts","customTarget","__customTglEff","endDrop","updateCounter","getContentByData","cvModel","getCanvasModel","updateHead","renderStyles","headEl","attrStr","stl","getJsContainer","jsContainer","frameWrapView","elTools","_getTool","getOffsetViewerEl","getRect","scrollRight","_toggleEffects","startAutoscroll","lastMaxHeight","_toggleAutoscrollFx","requestAnimationFrame","autoscroll","lastClientY","actualTop","limitTop","limitBottom","nextTop","showGlobalTools","updateClientY","stopAutoscroll","mt","renderScripts","evLoad","evOpts","appendScript","scriptEl","renderBody","normalize","prevStyles","_isEditor","CssRulesView","getStyles","_emitUpdated","FrameView","classAnim","updateOffset","updateSize","frameLoaded","updatePos","setupDragger","posOpts","__clear","updateDim","__handleSize","noChanges","onScroll","onscroll","currW","currH","newW","newH","twrp","toolsWrapper","elTop","elRight","elBottom","elLeft","frameWrapperView","FrameWrapView","timerZoom","wheel","_initFrames","clearOff","checkSelected","updateFrames","_onFramesUpdate","toggleListeners","_renderFrames","FramesView","currFrame","onCanvasMove","isInputFocused","onWheel","getZoom","defOpts","mpl","framesArea","isElInViewport","frameRect","getFrameOffset","rTop","rLeft","docBody","frmOff","cvsOff","winEl","frEl","getCanvasOffset","eo","frmTop","avoidFrameOffset","frmLeft","getElementOffsets","bEl","fo","scriptFn","getScriptString","scriptFnStr","scriptProps","__getScriptProps","getFrameView","listenToLoad","mainFrame","$frames","toolsWrp","hlEl","badgeEl","placerEl","ghostEl","resizerEl","offsetEl","fixedOffsetEl","toolsGlobEl","CanvasView","getFrame","getFramesEl","getDocument","_getCompFrame","_getLocalEl","globalEl","getGhostEl","getFixedOffsetViewerEl","setCustomBadgeLabel","topScroll","leftScroll","getTargetToElementDim","canvasPos","toRight","targetHeight","targetWidth","eventToTrigger","topPos","elementTop","elementLeft","elementWidth","elementHeight","canvasTop","canvasLeft","canvasWidth","canvasHeight","getFrameElFromDoc","rectOff","elToMove","cvOff","toolbarH","toolbarW","frCvOff","frameOffset","fullHeight","elIsShort","addTop","addLeft","subWinOffset","yOffset","xOffset","toIgnore","fr","setZoom","setCoords","getCoords","addFrame","ss","fonts","font","Sector","extendBuilded","builded","buildProperties","extendProperties","propsModel","moProps","pLen","mProps","isolated","mProp","mPProps","buildP","propFactory","PropertyFactory","Sectors","sect","SectorView","updateOpen","getPropertiesEl","$caret","renderProperties","helperCls","dummy","toggleStateCls","pt","mdToClear","stateStr","helperRule","getClassRule","appendStateRule","getParentRules","trgs","targetIsClass","SectView","addSector","getSector","_logNoSector","removeSector","getSectors","addProperty","sectorId","getProperty","removeProperty","getProperties","cssC","smConf","getStyleable","hasClasses","addOpts","deviceW","getGenerator","createType","getRule","setRule","lastTarget","lastTargetParents","getLastSelected","getSelectedParents","getEmitter","SectorsView","inlineCss","HTMLGenerator","htmlOpts","cleanId","idRules","isId","buildModels","beforeEach","mapModel","scrProps","mapJs","autoFormatRange","noRefresh","generators","defGenerators","viewers","defViewers","defaultViewer","gHtml","gCss","gJson","gJs","eCM","loadDefaultGenerators","loadDefaultViewers","addGenerator","getGenerators","addViewer","viewer","getViewers","createViewer","txtarea","updateViewer","genId","devices","widthMedia","Device","checkUnit","Devices","DevicesView","startAdd","updateSelect","devEl","devicesEl","evSelectBefore","evAddBefore","dv","_onSelect","deviceId","newDevice","getDevices","selectedName","iconAdd","iconSync","iconTagOn","iconTagOff","iconTagRemove","State","inputProp","startEditTag","endEditTag","innerText","changeStatus","removeTag","$chk","labelInfo","labelHead","stateInputId","stateInputC","toList","toListCls","componentChanged","__handleStateChange","checkSync","renderClasses","tagRemoved","renderStates","syncStyle","getCommonSelectors","ruleComponents","ruleComponent","updateStateVis","addToClasses","startNewTag","$addBtn","endNewTag","onInputKeyUp","addNewTag","checkStates","statesEl","getStates","validSelectors","__getCommonSelectors","_commonSelectors","__common","hasStyle","$btnSyncEl","getStatesC","updateSelector","elSel","__getName","idRes","stateChanged","ClassTagView","$states","$statesC","labelStates","tmpOpts","renderRes","$classes","isClass","evState","cFirst","selTags","selectorTags","addSelector","cOpts","cname","getSelector","setStates","__getCommon","getSelectedTargets","setComponentFirst","getComponentFirst","ClassTagsView","getValid","autosave","autoload","stepsBeforeSave","storeStyles","checkLocal","urlStore","urlLoad","jqXHR","onComplete","contentTypeJson","fetchOptions","hasLocal","setItem","getItem","clbErr","onResponse","request","typeJson","typeHead","bodyObj","bodyKey","eventStart","eventAfter","eventEnd","eventError","storages","defaultStorages","remote","RemoteStorage","LocalStorage","currentStorage","loadDefaultProviders","setCurrent","setAutosave","setStepsBeforeSave","storage","getStorages","getCurrent","onAfter","keysF","itemKey","itemKeyR","getCurrentStorage","4","5","6","7","11","12","14","15","atRuleKeys","singleAtRules","singleAtRulesNames","parseSelector","propValue","getPropertyPriority","parseCondition","conditionText","selectorText","createNode","selLen","lastClass","stateArr","atRuleType","sheet","cssRules","keyText","isSingleAtRule","subRules","lens","subRule","selsParsed","selsAdd","lastRule","len3","selsAddStr","BrowserCssParser","checkNode","classSets","classSet","pHtml","pCss","parseCss","backdrop","ModalView","updateTitle","$collector","$content","$title","getCollector","getTitle","currAttr","updateAttr","triggerEvent","ModalM","enb","_evData","titl","setTitle","onceOpen","getContentEl","CSS","CssRule","ensureSelectors","typeStr","isBody","selOpts","skipState","ruleProps","wd","selAdd","a1S","a2S","rulesView","elStyle","CssRules","hasPages","slc","singleSel","sl","newSels","le","selec","modelExists","avoidUpdateStyle","styleUpdate","addRules","atRuleParams","getComponentRules","elT","elL","borderOffset","freezeClass","relative","ignoreModels","offTop","offLeft","$document","dropContent","selectOnEnd","activeTextModel","getScale","getDocuments","dropModel","updateTextViewCursorPosition","targetDoc","caretRangeFromPoint","poiner","rangeParent","rangeOffset","setContentEditable","toggleSortCursor","clonedEl","moveDragHelper","posY","posX","dragHelperStyle","useBody","createPlaceholder","ins","contSel","prevTarget","eV","isTextable","isTextableActive","tempModel","selectTargetModel","targetModel","dsp","eO","rY","rX","mousePos","eventMove","sourceModel","dimsFromTarget","lastDims","findPosition","disableTextable","movePlaceholder","prevTargetDim","$plh","isInFlow","styleInFlow","$parent","overflow","propFloat","trgModel","dragInfo","dropInfo","targetP","validResult","getDim","cacheDimsP","getChildrenDim","cacheDims","nearBorders","targetParent","getTargetFromEl","targetPrev","nearElBorders","getCurrentPos","offsets","getCurrentView","elIndex","indexEl","leftLimit","xLimit","yLimit","xCenter","yCenter","dimDown","trgDim","marg","margI","elDim","pT","pL","dst","srcEl","modelToDrop","modelTemp","warns","targetCollection","viewActive","modelEl","insertHTML","errors","onUpdateContainer","minDim","maxDim","getBoundingRect","setup","hdl","createHandler","updateContainer","forceShow","handleMouseDown","getParentEl","attrName","parentRect","handlerAttr","clickedHandler","rectDim","startPos","parentDim","toggleFrames","mouseFetch","calc","updateRect","getSelectedHandler","isHandler","deltaX","deltaY","parentW","parentH","startW","startH","ratioActive","ratio","traitInputAttr","locale","localeFallback","detectLocale","messages","inputPlh","uploadTitle","labels","comment","video","row","cell","desktop","tablet","mobileLandscape","mobilePortrait","titles","fullscreen","emptyState","hover","fileButton","general","layout","typography","decorations","flex","dimension","false","_blank","_localLang","setLocale","evObj","valuePrev","getLocale","getMessages","lang","_debug","setMessages","addMessages","deepAssign","targValue","srcValue","localeFlb","lFlb","_getMsg","_addParams","nav","language","userLanguage","msgSet","RTE_KEY","btnState","isValidAnchor","defActions","bold","italic","underline","strikethrough","setEl","updateActiveActions","acts","actionbar","inactive","actionbarCont","actionbarContainer","addAction","styleWithCSS","syncActions","getActions","queryCommandSupported","queryCommandState","enabled","actionbarEl","deleteContents","nd","insertNode","adjustToolbar","lastElPos","globalRte","eventsUp","hideToolbar","initRte","updatePosition","rteInst","ItemsView","hidable","hideTextnode","showWrapper","showHover","scrollCanvas","scrollLayers","highlightHover","onInit","styleOpts","clsNoEdit","countChildren","clsNoChild","clsTitle","clsTitleC","clsCaret","inputNameCls","gut","clsBase","clsCount","clsMove","clsChildren","checkChildren","updateOpening","updateLayerable","clsEdit","__render","getVisibilityEl","eyeEl","hClass","toggleVisibility","prevDspKey","prevDisplay","handleEdit","getInputName","handleEditKey","handleEditEnd","setName","inputName","chvDown","getCaret","toggleOpening","handleSelect","fromLayers","handleHover","handleHoverOut","unfreeze","caret","_rendered","__clearItems","getRoot","_mods","_scope","_MODIFIERS","control","_MAP","backspace","tab","return","esc","down","del","delete","home","pageup","pagedown","_downKeys","compareArray","modifierMap","dispatch","modifiersMatch","assignKey","updateModifierKey","getScope","mods","clearModifier","resetModifiers","getKeys","getMods","shortcut","mi","setScope","deleteScope","isPressed","getPressedKeyCodes","multipleKeys","keymaster","keymaps","defKeys","pk","commandsDef","defaultCommands","CommandAbstract","selAll","nativeDrag","defComOptions","hideTlb","altMode","cmdMove","oldCmd","loadDefaultCommands","cmdObj","getActive"],"mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAQ,YAAcD,IAEtBD,EAAK,YAAcC,IARrB,CASyB,oBAAfK,WAA6BA,WAAgC,oBAAXC,OAAyBA,OAASC,MAAO,WACrG,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,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GACbozB,EAASxqB,EAAGrV,IAAI,WAElBjB,KAAK29I,SAASjwI,IAAOgC,EAAQsqB,QAAUv5B,EAAEoO,UACvCnB,UAAW85B,EAAO95B,GACtB9E,EAASixB,EAAQo3E,SAASnwE,EAAQpxB,IAItC,OAAO9G,GASTlH,OA5VK,SA4VEm4B,GAGL,OAFKA,EAAQxkB,OAAMwkB,EAAQomJ,OAAS,GAE7B,IADK60B,aAAgBprM,OAAOmwB,GAC5B,CAAQp5B,IAGjBkhB,QAlWK,WAmWH,CAACrL,EAAI7V,EAAGozF,EAAUghH,EAAiBrtK,GAAQlvB,SAAQ,SAAAlY,GAAC,MAAS,Y","file":"grapes.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"grapesjs\"] = factory();\n\telse\n\t\troot[\"grapesjs\"] = factory();\n})(typeof globalThis !== 'undefined' ? globalThis : (typeof window !== 'undefined' ? window : this), function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 100);\n","// Some functions take a variable number of arguments, or a few expected\n// arguments at the beginning and then a variable number of values to operate\n// on. This helper accumulates all remaining arguments past the function’s\n// argument length (or an explicit `startIndex`), into an array that becomes\n// the last argument. Similar to ES6’s \"rest parameter\".\nexport default function restArguments(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0),\n rest = Array(length),\n index = 0;\n for (; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n case 2: return func.call(this, arguments[0], arguments[1], rest);\n }\n var args = Array(startIndex + 1);\n for (index = 0; index < startIndex; index++) {\n args[index] = arguments[index];\n }\n args[startIndex] = rest;\n return func.apply(this, args);\n };\n}\n","// Is a given variable an object?\nexport default function isObject(obj) {\n var type = typeof obj;\n return type === 'function' || type === 'object' && !!obj;\n}\n","// Is a given value equal to null?\nexport default function isNull(obj) {\n return obj === null;\n}\n","// Is a given variable undefined?\nexport default function isUndefined(obj) {\n return obj === void 0;\n}\n","import { toString } from './_setup.js';\n\n// Is a given value a boolean?\nexport default function isBoolean(obj) {\n return obj === true || obj === false || toString.call(obj) === '[object Boolean]';\n}\n","// Is a given value a DOM element?\nexport default function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n}\n","import { toString } from './_setup.js';\n\n// Internal function for creating a `toString`-based type tester.\nexport default function tagTester(name) {\n var tag = '[object ' + name + ']';\n return function(obj) {\n return toString.call(obj) === tag;\n };\n}\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('String');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('Number');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('Date');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('RegExp');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('Error');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('Symbol');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('ArrayBuffer');\n","import tagTester from './_tagTester.js';\nimport { root } from './_setup.js';\n\nvar isFunction = tagTester('Function');\n\n// Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old\n// v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).\nvar nodelist = root.document && root.document.childNodes;\nif (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {\n isFunction = function(obj) {\n return typeof obj == 'function' || false;\n };\n}\n\nexport default isFunction;\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('Object');\n","import { supportsDataView } from './_setup.js';\nimport hasObjectTag from './_hasObjectTag.js';\n\n// In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`.\n// In IE 11, the most common among them, this problem also applies to\n// `Map`, `WeakMap` and `Set`.\nexport var hasStringTagBug = (\n supportsDataView && hasObjectTag(new DataView(new ArrayBuffer(8)))\n ),\n isIE11 = (typeof Map !== 'undefined' && hasObjectTag(new Map));\n","import tagTester from './_tagTester.js';\nimport isFunction from './isFunction.js';\nimport isArrayBuffer from './isArrayBuffer.js';\nimport { hasStringTagBug } from './_stringTagBug.js';\n\nvar isDataView = tagTester('DataView');\n\n// In IE 10 - Edge 13, we need a different heuristic\n// to determine whether an object is a `DataView`.\nfunction ie10IsDataView(obj) {\n return obj != null && isFunction(obj.getInt8) && isArrayBuffer(obj.buffer);\n}\n\nexport default (hasStringTagBug ? ie10IsDataView : isDataView);\n","import { nativeIsArray } from './_setup.js';\nimport tagTester from './_tagTester.js';\n\n// Is a given value an array?\n// Delegates to ECMA5's native `Array.isArray`.\nexport default nativeIsArray || tagTester('Array');\n","import { hasOwnProperty } from './_setup.js';\n\n// Internal function to check whether `key` is an own property name of `obj`.\nexport default function has(obj, key) {\n return obj != null && hasOwnProperty.call(obj, key);\n}\n","import tagTester from './_tagTester.js';\nimport has from './_has.js';\n\nvar isArguments = tagTester('Arguments');\n\n// Define a fallback version of the method in browsers (ahem, IE < 9), where\n// there isn't any inspectable \"Arguments\" type.\n(function() {\n if (!isArguments(arguments)) {\n isArguments = function(obj) {\n return has(obj, 'callee');\n };\n }\n}());\n\nexport default isArguments;\n","import { _isFinite } from './_setup.js';\nimport isSymbol from './isSymbol.js';\n\n// Is a given object a finite number?\nexport default function isFinite(obj) {\n return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj));\n}\n","import { _isNaN } from './_setup.js';\nimport isNumber from './isNumber.js';\n\n// Is the given value `NaN`?\nexport default function isNaN(obj) {\n return isNumber(obj) && _isNaN(obj);\n}\n","// Predicate-generating function. Often useful outside of Underscore.\nexport default function constant(value) {\n return function() {\n return value;\n };\n}\n","import { MAX_ARRAY_INDEX } from './_setup.js';\n\n// Common internal logic for `isArrayLike` and `isBufferLike`.\nexport default function createSizePropertyCheck(getSizeProperty) {\n return function(collection) {\n var sizeProperty = getSizeProperty(collection);\n return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX;\n }\n}\n","// Internal helper to generate a function to obtain property `key` from `obj`.\nexport default function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n}\n","import shallowProperty from './_shallowProperty.js';\n\n// Internal helper to obtain the `byteLength` property of an object.\nexport default shallowProperty('byteLength');\n","import createSizePropertyCheck from './_createSizePropertyCheck.js';\nimport getByteLength from './_getByteLength.js';\n\n// Internal helper to determine whether we should spend extensive checks against\n// `ArrayBuffer` et al.\nexport default createSizePropertyCheck(getByteLength);\n","import { supportsArrayBuffer, nativeIsView, toString } from './_setup.js';\nimport isDataView from './isDataView.js';\nimport constant from './constant.js';\nimport isBufferLike from './_isBufferLike.js';\n\n// Is a given value a typed array?\nvar typedArrayPattern = /\\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\\]/;\nfunction isTypedArray(obj) {\n // `ArrayBuffer.isView` is the most future-proof, so use it when available.\n // Otherwise, fall back on the above regular expression.\n return nativeIsView ? (nativeIsView(obj) && !isDataView(obj)) :\n isBufferLike(obj) && typedArrayPattern.test(toString.call(obj));\n}\n\nexport default supportsArrayBuffer ? isTypedArray : constant(false);\n","import shallowProperty from './_shallowProperty.js';\n\n// Internal helper to obtain the `length` property of an object.\nexport default shallowProperty('length');\n","import { nonEnumerableProps, ObjProto } from './_setup.js';\nimport isFunction from './isFunction.js';\nimport has from './_has.js';\n\n// Internal helper to create a simple lookup structure.\n// `collectNonEnumProps` used to depend on `_.contains`, but this led to\n// circular imports. `emulatedSet` is a one-off solution that only works for\n// arrays of strings.\nfunction emulatedSet(keys) {\n var hash = {};\n for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;\n return {\n contains: function(key) { return hash[key]; },\n push: function(key) {\n hash[key] = true;\n return keys.push(key);\n }\n };\n}\n\n// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't\n// be iterated by `for key in ...` and thus missed. Extends `keys` in place if\n// needed.\nexport default function collectNonEnumProps(obj, keys) {\n keys = emulatedSet(keys);\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = isFunction(constructor) && constructor.prototype || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {\n keys.push(prop);\n }\n }\n}\n","import isObject from './isObject.js';\nimport { nativeKeys, hasEnumBug } from './_setup.js';\nimport has from './_has.js';\nimport collectNonEnumProps from './_collectNonEnumProps.js';\n\n// Retrieve the names of an object's own properties.\n// Delegates to **ECMAScript 5**'s native `Object.keys`.\nexport default function keys(obj) {\n if (!isObject(obj)) return [];\n if (nativeKeys) return nativeKeys(obj);\n var keys = [];\n for (var key in obj) if (has(obj, key)) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n}\n","import getLength from './_getLength.js';\nimport isArray from './isArray.js';\nimport isString from './isString.js';\nimport isArguments from './isArguments.js';\nimport keys from './keys.js';\n\n// Is a given array, string, or object empty?\n// An \"empty\" object has no enumerable own-properties.\nexport default function isEmpty(obj) {\n if (obj == null) return true;\n // Skip the more expensive `toString`-based type checks if `obj` has no\n // `.length`.\n var length = getLength(obj);\n if (typeof length == 'number' && (\n isArray(obj) || isString(obj) || isArguments(obj)\n )) return length === 0;\n return getLength(keys(obj)) === 0;\n}\n","import keys from './keys.js';\n\n// Returns whether an object has a given set of `key:value` pairs.\nexport default function isMatch(object, attrs) {\n var _keys = keys(attrs), length = _keys.length;\n if (object == null) return !length;\n var obj = Object(object);\n for (var i = 0; i < length; i++) {\n var key = _keys[i];\n if (attrs[key] !== obj[key] || !(key in obj)) return false;\n }\n return true;\n}\n","import { VERSION } from './_setup.js';\n\n// If Underscore is called as a function, it returns a wrapped object that can\n// be used OO-style. This wrapper holds altered versions of all functions added\n// through `_.mixin`. Wrapped objects may be chained.\nexport default function _(obj) {\n if (obj instanceof _) return obj;\n if (!(this instanceof _)) return new _(obj);\n this._wrapped = obj;\n}\n\n_.VERSION = VERSION;\n\n// Extracts the result from a wrapped and chained object.\n_.prototype.value = function() {\n return this._wrapped;\n};\n\n// Provide unwrapping proxies for some methods used in engine operations\n// such as arithmetic and JSON stringification.\n_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;\n\n_.prototype.toString = function() {\n return String(this._wrapped);\n};\n","import getByteLength from './_getByteLength.js';\n\n// Internal function to wrap or shallow-copy an ArrayBuffer,\n// typed array or DataView to a new view, reusing the buffer.\nexport default function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n getByteLength(bufferSource)\n );\n}\n","import _ from './underscore.js';\nimport { toString, SymbolProto } from './_setup.js';\nimport getByteLength from './_getByteLength.js';\nimport isTypedArray from './isTypedArray.js';\nimport isFunction from './isFunction.js';\nimport { hasStringTagBug } from './_stringTagBug.js';\nimport isDataView from './isDataView.js';\nimport keys from './keys.js';\nimport has from './_has.js';\nimport toBufferView from './_toBufferView.js';\n\n// We use this string twice, so give it a name for minification.\nvar tagDataView = '[object DataView]';\n\n// Internal recursive comparison function for `_.isEqual`.\nfunction eq(a, b, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) return a !== 0 || 1 / a === 1 / b;\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) return false;\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) return b !== b;\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;\n return deepEq(a, b, aStack, bStack);\n}\n\n// Internal recursive comparison function for `_.isEqual`.\nfunction deepEq(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n // Work around a bug in IE 10 - Edge 13.\n if (hasStringTagBug && className == '[object Object]' && isDataView(a)) {\n if (!isDataView(b)) return false;\n className = tagDataView;\n }\n switch (className) {\n // These types are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case '[object Symbol]':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n case '[object ArrayBuffer]':\n case tagDataView:\n // Coerce to typed array so we can fall through.\n return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays && isTypedArray(a)) {\n var byteLength = getByteLength(a);\n if (byteLength !== getByteLength(b)) return false;\n if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;\n areArrays = true;\n }\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor &&\n isFunction(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var _keys = keys(a), key;\n length = _keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = _keys[length];\n if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\n\n// Perform a deep comparison to check if two objects are equal.\nexport default function isEqual(a, b) {\n return eq(a, b);\n}\n","import isObject from './isObject.js';\nimport { hasEnumBug } from './_setup.js';\nimport collectNonEnumProps from './_collectNonEnumProps.js';\n\n// Retrieve all the enumerable property names of an object.\nexport default function allKeys(obj) {\n if (!isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n}\n","import getLength from './_getLength.js';\nimport isFunction from './isFunction.js';\nimport allKeys from './allKeys.js';\n\n// Since the regular `Object.prototype.toString` type tests don't work for\n// some types in IE 11, we use a fingerprinting heuristic instead, based\n// on the methods. It's not great, but it's the best we got.\n// The fingerprint method lists are defined below.\nexport function ie11fingerprint(methods) {\n var length = getLength(methods);\n return function(obj) {\n if (obj == null) return false;\n // `Map`, `WeakMap` and `Set` have no enumerable keys.\n var keys = allKeys(obj);\n if (getLength(keys)) return false;\n for (var i = 0; i < length; i++) {\n if (!isFunction(obj[methods[i]])) return false;\n }\n // If we are testing against `WeakMap`, we need to ensure that\n // `obj` doesn't have a `forEach` method in order to distinguish\n // it from a regular `Map`.\n return methods !== weakMapMethods || !isFunction(obj[forEachName]);\n };\n}\n\n// In the interest of compact minification, we write\n// each string in the fingerprints only once.\nvar forEachName = 'forEach',\n hasName = 'has',\n commonInit = ['clear', 'delete'],\n mapTail = ['get', hasName, 'set'];\n\n// `Map`, `WeakMap` and `Set` each have slightly different\n// combinations of the above sublists.\nexport var mapMethods = commonInit.concat(forEachName, mapTail),\n weakMapMethods = commonInit.concat(mapTail),\n setMethods = ['add'].concat(commonInit, forEachName, hasName);\n","import tagTester from './_tagTester.js';\nimport { isIE11 } from './_stringTagBug.js';\nimport { ie11fingerprint, mapMethods } from './_methodFingerprint.js';\n\nexport default isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map');\n","import tagTester from './_tagTester.js';\nimport { isIE11 } from './_stringTagBug.js';\nimport { ie11fingerprint, weakMapMethods } from './_methodFingerprint.js';\n\nexport default isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap');\n","import tagTester from './_tagTester.js';\nimport { isIE11 } from './_stringTagBug.js';\nimport { ie11fingerprint, setMethods } from './_methodFingerprint.js';\n\nexport default isIE11 ? ie11fingerprint(setMethods) : tagTester('Set');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('WeakSet');\n","import keys from './keys.js';\n\n// Retrieve the values of an object's properties.\nexport default function values(obj) {\n var _keys = keys(obj);\n var length = _keys.length;\n var values = Array(length);\n for (var i = 0; i < length; i++) {\n values[i] = obj[_keys[i]];\n }\n return values;\n}\n","import keys from './keys.js';\n\n// Convert an object into a list of `[key, value]` pairs.\n// The opposite of `_.object` with one argument.\nexport default function pairs(obj) {\n var _keys = keys(obj);\n var length = _keys.length;\n var pairs = Array(length);\n for (var i = 0; i < length; i++) {\n pairs[i] = [_keys[i], obj[_keys[i]]];\n }\n return pairs;\n}\n","import keys from './keys.js';\n\n// Invert the keys and values of an object. The values must be serializable.\nexport default function invert(obj) {\n var result = {};\n var _keys = keys(obj);\n for (var i = 0, length = _keys.length; i < length; i++) {\n result[obj[_keys[i]]] = _keys[i];\n }\n return result;\n}\n","import isFunction from './isFunction.js';\n\n// Return a sorted list of the function names available on the object.\nexport default function functions(obj) {\n var names = [];\n for (var key in obj) {\n if (isFunction(obj[key])) names.push(key);\n }\n return names.sort();\n}\n","// An internal function for creating assigner functions.\nexport default function createAssigner(keysFunc, defaults) {\n return function(obj) {\n var length = arguments.length;\n if (defaults) obj = Object(obj);\n if (length < 2 || obj == null) return obj;\n for (var index = 1; index < length; index++) {\n var source = arguments[index],\n keys = keysFunc(source),\n l = keys.length;\n for (var i = 0; i < l; i++) {\n var key = keys[i];\n if (!defaults || obj[key] === void 0) obj[key] = source[key];\n }\n }\n return obj;\n };\n}\n","import createAssigner from './_createAssigner.js';\nimport allKeys from './allKeys.js';\n\n// Extend a given object with all the properties in passed-in object(s).\nexport default createAssigner(allKeys);\n","import createAssigner from './_createAssigner.js';\nimport keys from './keys.js';\n\n// Assigns a given object with all the own properties in the passed-in\n// object(s).\n// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\nexport default createAssigner(keys);\n","import createAssigner from './_createAssigner.js';\nimport allKeys from './allKeys.js';\n\n// Fill in a given object with default properties.\nexport default createAssigner(allKeys, true);\n","import isObject from './isObject.js';\nimport { nativeCreate } from './_setup.js';\n\n// Create a naked function reference for surrogate-prototype-swapping.\nfunction ctor() {\n return function(){};\n}\n\n// An internal function for creating a new object that inherits from another.\nexport default function baseCreate(prototype) {\n if (!isObject(prototype)) return {};\n if (nativeCreate) return nativeCreate(prototype);\n var Ctor = ctor();\n Ctor.prototype = prototype;\n var result = new Ctor;\n Ctor.prototype = null;\n return result;\n}\n","import baseCreate from './_baseCreate.js';\nimport extendOwn from './extendOwn.js';\n\n// Creates an object that inherits from the given prototype object.\n// If additional properties are provided then they will be added to the\n// created object.\nexport default function create(prototype, props) {\n var result = baseCreate(prototype);\n if (props) extendOwn(result, props);\n return result;\n}\n","import isObject from './isObject.js';\nimport isArray from './isArray.js';\nimport extend from './extend.js';\n\n// Create a (shallow-cloned) duplicate of an object.\nexport default function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n}\n","// Invokes `interceptor` with the `obj` and then returns `obj`.\n// The primary purpose of this method is to \"tap into\" a method chain, in\n// order to perform operations on intermediate results within the chain.\nexport default function tap(obj, interceptor) {\n interceptor(obj);\n return obj;\n}\n","import _ from './underscore.js';\nimport isArray from './isArray.js';\n\n// Normalize a (deep) property `path` to array.\n// Like `_.iteratee`, this function can be customized.\nexport default function toPath(path) {\n return isArray(path) ? path : [path];\n}\n_.toPath = toPath;\n","import _ from './underscore.js';\nimport './toPath.js';\n\n// Internal wrapper for `_.toPath` to enable minification.\n// Similar to `cb` for `_.iteratee`.\nexport default function toPath(path) {\n return _.toPath(path);\n}\n","// Internal function to obtain a nested property in `obj` along `path`.\nexport default function deepGet(obj, path) {\n var length = path.length;\n for (var i = 0; i < length; i++) {\n if (obj == null) return void 0;\n obj = obj[path[i]];\n }\n return length ? obj : void 0;\n}\n","import toPath from './_toPath.js';\nimport deepGet from './_deepGet.js';\nimport isUndefined from './isUndefined.js';\n\n// Get the value of the (deep) property on `path` from `object`.\n// If any property in `path` does not exist or if the value is\n// `undefined`, return `defaultValue` instead.\n// The `path` is normalized through `_.toPath`.\nexport default function get(object, path, defaultValue) {\n var value = deepGet(object, toPath(path));\n return isUndefined(value) ? defaultValue : value;\n}\n","import _has from './_has.js';\nimport toPath from './_toPath.js';\n\n// Shortcut function for checking if an object has a given property directly on\n// itself (in other words, not on a prototype). Unlike the internal `has`\n// function, this public version can also traverse nested properties.\nexport default function has(obj, path) {\n path = toPath(path);\n var length = path.length;\n for (var i = 0; i < length; i++) {\n var key = path[i];\n if (!_has(obj, key)) return false;\n obj = obj[key];\n }\n return !!length;\n}\n","// Keep the identity function around for default iteratees.\nexport default function identity(value) {\n return value;\n}\n","import extendOwn from './extendOwn.js';\nimport isMatch from './isMatch.js';\n\n// Returns a predicate for checking whether an object has a given set of\n// `key:value` pairs.\nexport default function matcher(attrs) {\n attrs = extendOwn({}, attrs);\n return function(obj) {\n return isMatch(obj, attrs);\n };\n}\n","import deepGet from './_deepGet.js';\nimport toPath from './_toPath.js';\n\n// Creates a function that, when passed an object, will traverse that object’s\n// properties down the given `path`, specified as an array of keys or indices.\nexport default function property(path) {\n path = toPath(path);\n return function(obj) {\n return deepGet(obj, path);\n };\n}\n","// Internal function that returns an efficient (for current engines) version\n// of the passed-in callback, to be repeatedly applied in other Underscore\n// functions.\nexport default function optimizeCb(func, context, argCount) {\n if (context === void 0) return func;\n switch (argCount == null ? 3 : argCount) {\n case 1: return function(value) {\n return func.call(context, value);\n };\n // The 2-argument case is omitted because we’re not using it.\n case 3: return function(value, index, collection) {\n return func.call(context, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(context, accumulator, value, index, collection);\n };\n }\n return function() {\n return func.apply(context, arguments);\n };\n}\n","import identity from './identity.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isArray from './isArray.js';\nimport matcher from './matcher.js';\nimport property from './property.js';\nimport optimizeCb from './_optimizeCb.js';\n\n// An internal function to generate callbacks that can be applied to each\n// element in a collection, returning the desired result — either `_.identity`,\n// an arbitrary callback, a property matcher, or a property accessor.\nexport default function baseIteratee(value, context, argCount) {\n if (value == null) return identity;\n if (isFunction(value)) return optimizeCb(value, context, argCount);\n if (isObject(value) && !isArray(value)) return matcher(value);\n return property(value);\n}\n","import _ from './underscore.js';\nimport baseIteratee from './_baseIteratee.js';\n\n// External wrapper for our callback generator. Users may customize\n// `_.iteratee` if they want additional predicate/iteratee shorthand styles.\n// This abstraction hides the internal-only `argCount` argument.\nexport default function iteratee(value, context) {\n return baseIteratee(value, context, Infinity);\n}\n_.iteratee = iteratee;\n","import _ from './underscore.js';\nimport baseIteratee from './_baseIteratee.js';\nimport iteratee from './iteratee.js';\n\n// The function we call internally to generate a callback. It invokes\n// `_.iteratee` if overridden, otherwise `baseIteratee`.\nexport default function cb(value, context, argCount) {\n if (_.iteratee !== iteratee) return _.iteratee(value, context);\n return baseIteratee(value, context, argCount);\n}\n","import cb from './_cb.js';\nimport keys from './keys.js';\n\n// Returns the results of applying the `iteratee` to each element of `obj`.\n// In contrast to `_.map` it returns an object.\nexport default function mapObject(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var _keys = keys(obj),\n length = _keys.length,\n results = {};\n for (var index = 0; index < length; index++) {\n var currentKey = _keys[index];\n results[currentKey] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n}\n","// Predicate-generating function. Often useful outside of Underscore.\nexport default function noop(){}\n","import noop from './noop.js';\nimport get from './get.js';\n\n// Generates a function for a given object that returns a given property.\nexport default function propertyOf(obj) {\n if (obj == null) return noop;\n return function(path) {\n return get(obj, path);\n };\n}\n","import optimizeCb from './_optimizeCb.js';\n\n// Run a function **n** times.\nexport default function times(n, iteratee, context) {\n var accum = Array(Math.max(0, n));\n iteratee = optimizeCb(iteratee, context, 1);\n for (var i = 0; i < n; i++) accum[i] = iteratee(i);\n return accum;\n}\n","// Return a random integer between `min` and `max` (inclusive).\nexport default function random(min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n return min + Math.floor(Math.random() * (max - min + 1));\n}\n","// A (possibly faster) way to get the current timestamp as an integer.\nexport default Date.now || function() {\n return new Date().getTime();\n};\n","import keys from './keys.js';\n\n// Internal helper to generate functions for escaping and unescaping strings\n// to/from HTML interpolation.\nexport default function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n}\n","// Internal list of HTML entities for escaping.\nexport default {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n};\n","import createEscaper from './_createEscaper.js';\nimport escapeMap from './_escapeMap.js';\n\n// Function for escaping strings to HTML interpolation.\nexport default createEscaper(escapeMap);\n","import createEscaper from './_createEscaper.js';\nimport unescapeMap from './_unescapeMap.js';\n\n// Function for unescaping strings from HTML interpolation.\nexport default createEscaper(unescapeMap);\n","import invert from './invert.js';\nimport escapeMap from './_escapeMap.js';\n\n// Internal list of HTML entities for unescaping.\nexport default invert(escapeMap);\n","import _ from './underscore.js';\n\n// By default, Underscore uses ERB-style template delimiters. Change the\n// following template settings to use alternative delimiters.\nexport default _.templateSettings = {\n evaluate: /<%([\\s\\S]+?)%>/g,\n interpolate: /<%=([\\s\\S]+?)%>/g,\n escape: /<%-([\\s\\S]+?)%>/g\n};\n","import defaults from './defaults.js';\nimport _ from './underscore.js';\nimport './templateSettings.js';\n\n// When customizing `_.templateSettings`, if you don't want to define an\n// interpolation, evaluation or escaping regex, we need one that is\n// guaranteed not to match.\nvar noMatch = /(.)^/;\n\n// Certain characters need to be escaped so that they can be put into a\n// string literal.\nvar escapes = {\n \"'\": \"'\",\n '\\\\': '\\\\',\n '\\r': 'r',\n '\\n': 'n',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n};\n\nvar escapeRegExp = /\\\\|'|\\r|\\n|\\u2028|\\u2029/g;\n\nfunction escapeChar(match) {\n return '\\\\' + escapes[match];\n}\n\n// In order to prevent third-party code injection through\n// `_.templateSettings.variable`, we test it against the following regular\n// expression. It is intentionally a bit more liberal than just matching valid\n// identifiers, but still prevents possible loopholes through defaults or\n// destructuring assignment.\nvar bareIdentifier = /^\\s*(\\w|\\$)+\\s*$/;\n\n// JavaScript micro-templating, similar to John Resig's implementation.\n// Underscore templating handles arbitrary delimiters, preserves whitespace,\n// and correctly escapes quotes within interpolated code.\n// NB: `oldSettings` only exists for backwards compatibility.\nexport default function template(text, settings, oldSettings) {\n if (!settings && oldSettings) settings = oldSettings;\n settings = defaults({}, settings, _.templateSettings);\n\n // Combine delimiters into one regular expression via alternation.\n var matcher = RegExp([\n (settings.escape || noMatch).source,\n (settings.interpolate || noMatch).source,\n (settings.evaluate || noMatch).source\n ].join('|') + '|$', 'g');\n\n // Compile the template source, escaping string literals appropriately.\n var index = 0;\n var source = \"__p+='\";\n text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n source += text.slice(index, offset).replace(escapeRegExp, escapeChar);\n index = offset + match.length;\n\n if (escape) {\n source += \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\";\n } else if (interpolate) {\n source += \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\";\n } else if (evaluate) {\n source += \"';\\n\" + evaluate + \"\\n__p+='\";\n }\n\n // Adobe VMs need the match returned to produce the correct offset.\n return match;\n });\n source += \"';\\n\";\n\n var argument = settings.variable;\n if (argument) {\n // Insure against third-party code injection. (CVE-2021-23358)\n if (!bareIdentifier.test(argument)) throw new Error(\n 'variable is not a bare identifier: ' + argument\n );\n } else {\n // If a variable is not specified, place data values in local scope.\n source = 'with(obj||{}){\\n' + source + '}\\n';\n argument = 'obj';\n }\n\n source = \"var __t,__p='',__j=Array.prototype.join,\" +\n \"print=function(){__p+=__j.call(arguments,'');};\\n\" +\n source + 'return __p;\\n';\n\n var render;\n try {\n render = new Function(argument, '_', source);\n } catch (e) {\n e.source = source;\n throw e;\n }\n\n var template = function(data) {\n return render.call(this, data, _);\n };\n\n // Provide the compiled source as a convenience for precompilation.\n template.source = 'function(' + argument + '){\\n' + source + '}';\n\n return template;\n}\n","import isFunction from './isFunction.js';\nimport toPath from './_toPath.js';\n\n// Traverses the children of `obj` along `path`. If a child is a function, it\n// is invoked with its parent as context. Returns the value of the final\n// child, or `fallback` if any child is undefined.\nexport default function result(obj, path, fallback) {\n path = toPath(path);\n var length = path.length;\n if (!length) {\n return isFunction(fallback) ? fallback.call(obj) : fallback;\n }\n for (var i = 0; i < length; i++) {\n var prop = obj == null ? void 0 : obj[path[i]];\n if (prop === void 0) {\n prop = fallback;\n i = length; // Ensure we don't continue iterating.\n }\n obj = isFunction(prop) ? prop.call(obj) : prop;\n }\n return obj;\n}\n","// Generate a unique integer id (unique within the entire client session).\n// Useful for temporary DOM ids.\nvar idCounter = 0;\nexport default function uniqueId(prefix) {\n var id = ++idCounter + '';\n return prefix ? prefix + id : id;\n}\n","import _ from './underscore.js';\n\n// Start chaining a wrapped Underscore object.\nexport default function chain(obj) {\n var instance = _(obj);\n instance._chain = true;\n return instance;\n}\n","import baseCreate from './_baseCreate.js';\nimport isObject from './isObject.js';\n\n// Internal function to execute `sourceFunc` bound to `context` with optional\n// `args`. Determines whether to execute a function as a constructor or as a\n// normal function.\nexport default function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n}\n","import restArguments from './restArguments.js';\nimport executeBound from './_executeBound.js';\nimport _ from './underscore.js';\n\n// Partially apply a function by creating a version that has had some of its\n// arguments pre-filled, without changing its dynamic `this` context. `_` acts\n// as a placeholder by default, allowing any combination of arguments to be\n// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.\nvar partial = restArguments(function(func, boundArgs) {\n var placeholder = partial.placeholder;\n var bound = function() {\n var position = 0, length = boundArgs.length;\n var args = Array(length);\n for (var i = 0; i < length; i++) {\n args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];\n }\n while (position < arguments.length) args.push(arguments[position++]);\n return executeBound(func, bound, this, this, args);\n };\n return bound;\n});\n\npartial.placeholder = _;\nexport default partial;\n","import restArguments from './restArguments.js';\nimport isFunction from './isFunction.js';\nimport executeBound from './_executeBound.js';\n\n// Create a function bound to a given object (assigning `this`, and arguments,\n// optionally).\nexport default restArguments(function(func, context, args) {\n if (!isFunction(func)) throw new TypeError('Bind must be called on a function');\n var bound = restArguments(function(callArgs) {\n return executeBound(func, bound, context, this, args.concat(callArgs));\n });\n return bound;\n});\n","import createSizePropertyCheck from './_createSizePropertyCheck.js';\nimport getLength from './_getLength.js';\n\n// Internal helper for collection methods to determine whether a collection\n// should be iterated as an array or as an object.\n// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength\n// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094\nexport default createSizePropertyCheck(getLength);\n","import getLength from './_getLength.js';\nimport isArrayLike from './_isArrayLike.js';\nimport isArray from './isArray.js';\nimport isArguments from './isArguments.js';\n\n// Internal implementation of a recursive `flatten` function.\nexport default function flatten(input, depth, strict, output) {\n output = output || [];\n if (!depth && depth !== 0) {\n depth = Infinity;\n } else if (depth <= 0) {\n return output.concat(input);\n }\n var idx = output.length;\n for (var i = 0, length = getLength(input); i < length; i++) {\n var value = input[i];\n if (isArrayLike(value) && (isArray(value) || isArguments(value))) {\n // Flatten current level of array or arguments object.\n if (depth > 1) {\n flatten(value, depth - 1, strict, output);\n idx = output.length;\n } else {\n var j = 0, len = value.length;\n while (j < len) output[idx++] = value[j++];\n }\n } else if (!strict) {\n output[idx++] = value;\n }\n }\n return output;\n}\n","import restArguments from './restArguments.js';\nimport flatten from './_flatten.js';\nimport bind from './bind.js';\n\n// Bind a number of an object's methods to that object. Remaining arguments\n// are the method names to be bound. Useful for ensuring that all callbacks\n// defined on an object belong to it.\nexport default restArguments(function(obj, keys) {\n keys = flatten(keys, false, false);\n var index = keys.length;\n if (index < 1) throw new Error('bindAll must be passed function names');\n while (index--) {\n var key = keys[index];\n obj[key] = bind(obj[key], obj);\n }\n return obj;\n});\n","import has from './_has.js';\n\n// Memoize an expensive function by storing its results.\nexport default function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n}\n","import restArguments from './restArguments.js';\n\n// Delays a function for the given number of milliseconds, and then calls\n// it with the arguments supplied.\nexport default restArguments(function(func, wait, args) {\n return setTimeout(function() {\n return func.apply(null, args);\n }, wait);\n});\n","import partial from './partial.js';\nimport delay from './delay.js';\nimport _ from './underscore.js';\n\n// Defers a function, scheduling it to run after the current call stack has\n// cleared.\nexport default partial(delay, _, 1);\n","import now from './now.js';\n\n// Returns a function, that, when invoked, will only be triggered at most once\n// during a given window of time. Normally, the throttled function will run\n// as much as it can, without ever going more than once per `wait` duration;\n// but if you'd like to disable the execution on the leading edge, pass\n// `{leading: false}`. To disable execution on the trailing edge, ditto.\nexport default function throttle(func, wait, options) {\n var timeout, context, args, result;\n var previous = 0;\n if (!options) options = {};\n\n var later = function() {\n previous = options.leading === false ? 0 : now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n };\n\n var throttled = function() {\n var _now = now();\n if (!previous && options.leading === false) previous = _now;\n var remaining = wait - (_now - previous);\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = _now;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n\n throttled.cancel = function() {\n clearTimeout(timeout);\n previous = 0;\n timeout = context = args = null;\n };\n\n return throttled;\n}\n","import restArguments from './restArguments.js';\nimport now from './now.js';\n\n// When a sequence of calls of the returned function ends, the argument\n// function is triggered. The end of a sequence is defined by the `wait`\n// parameter. If `immediate` is passed, the argument function will be\n// triggered at the beginning of the sequence instead of at the end.\nexport default function debounce(func, wait, immediate) {\n var timeout, previous, args, result, context;\n\n var later = function() {\n var passed = now() - previous;\n if (wait > passed) {\n timeout = setTimeout(later, wait - passed);\n } else {\n timeout = null;\n if (!immediate) result = func.apply(context, args);\n // This check is needed because `func` can recursively invoke `debounced`.\n if (!timeout) args = context = null;\n }\n };\n\n var debounced = restArguments(function(_args) {\n context = this;\n args = _args;\n previous = now();\n if (!timeout) {\n timeout = setTimeout(later, wait);\n if (immediate) result = func.apply(context, args);\n }\n return result;\n });\n\n debounced.cancel = function() {\n clearTimeout(timeout);\n timeout = args = context = null;\n };\n\n return debounced;\n}\n","import partial from './partial.js';\n\n// Returns the first function passed as an argument to the second,\n// allowing you to adjust arguments, run code before and after, and\n// conditionally execute the original function.\nexport default function wrap(func, wrapper) {\n return partial(wrapper, func);\n}\n","// Returns a negated version of the passed-in predicate.\nexport default function negate(predicate) {\n return function() {\n return !predicate.apply(this, arguments);\n };\n}\n","// Returns a function that is the composition of a list of functions, each\n// consuming the return value of the function that follows.\nexport default function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n}\n","// Returns a function that will only be executed on and after the Nth call.\nexport default function after(times, func) {\n return function() {\n if (--times < 1) {\n return func.apply(this, arguments);\n }\n };\n}\n","// Returns a function that will only be executed up to (but not including) the\n// Nth call.\nexport default function before(times, func) {\n var memo;\n return function() {\n if (--times > 0) {\n memo = func.apply(this, arguments);\n }\n if (times <= 1) func = null;\n return memo;\n };\n}\n","import partial from './partial.js';\nimport before from './before.js';\n\n// Returns a function that will be executed at most one time, no matter how\n// often you call it. Useful for lazy initialization.\nexport default partial(before, 2);\n","import cb from './_cb.js';\nimport keys from './keys.js';\n\n// Returns the first key on an object that passes a truth test.\nexport default function findKey(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = keys(obj), key;\n for (var i = 0, length = _keys.length; i < length; i++) {\n key = _keys[i];\n if (predicate(obj[key], key, obj)) return key;\n }\n}\n","import cb from './_cb.js';\nimport getLength from './_getLength.js';\n\n// Internal function to generate `_.findIndex` and `_.findLastIndex`.\nexport default function createPredicateIndexFinder(dir) {\n return function(array, predicate, context) {\n predicate = cb(predicate, context);\n var length = getLength(array);\n var index = dir > 0 ? 0 : length - 1;\n for (; index >= 0 && index < length; index += dir) {\n if (predicate(array[index], index, array)) return index;\n }\n return -1;\n };\n}\n","import createPredicateIndexFinder from './_createPredicateIndexFinder.js';\n\n// Returns the first index on an array-like that passes a truth test.\nexport default createPredicateIndexFinder(1);\n","import createPredicateIndexFinder from './_createPredicateIndexFinder.js';\n\n// Returns the last index on an array-like that passes a truth test.\nexport default createPredicateIndexFinder(-1);\n","import cb from './_cb.js';\nimport getLength from './_getLength.js';\n\n// Use a comparator function to figure out the smallest index at which\n// an object should be inserted so as to maintain order. Uses binary search.\nexport default function sortedIndex(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n}\n","import getLength from './_getLength.js';\nimport { slice } from './_setup.js';\nimport isNaN from './isNaN.js';\n\n// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.\nexport default function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n}\n","import sortedIndex from './sortedIndex.js';\nimport findIndex from './findIndex.js';\nimport createIndexFinder from './_createIndexFinder.js';\n\n// Return the position of the first occurrence of an item in an array,\n// or -1 if the item is not included in the array.\n// If the array is large and already in sort order, pass `true`\n// for **isSorted** to use binary search.\nexport default createIndexFinder(1, findIndex, sortedIndex);\n","import findLastIndex from './findLastIndex.js';\nimport createIndexFinder from './_createIndexFinder.js';\n\n// Return the position of the last occurrence of an item in an array,\n// or -1 if the item is not included in the array.\nexport default createIndexFinder(-1, findLastIndex);\n","import isArrayLike from './_isArrayLike.js';\nimport findIndex from './findIndex.js';\nimport findKey from './findKey.js';\n\n// Return the first value which passes a truth test.\nexport default function find(obj, predicate, context) {\n var keyFinder = isArrayLike(obj) ? findIndex : findKey;\n var key = keyFinder(obj, predicate, context);\n if (key !== void 0 && key !== -1) return obj[key];\n}\n","import find from './find.js';\nimport matcher from './matcher.js';\n\n// Convenience version of a common use case of `_.find`: getting the first\n// object containing specific `key:value` pairs.\nexport default function findWhere(obj, attrs) {\n return find(obj, matcher(attrs));\n}\n","import optimizeCb from './_optimizeCb.js';\nimport isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// The cornerstone for collection functions, an `each`\n// implementation, aka `forEach`.\n// Handles raw objects in addition to array-likes. Treats all\n// sparse array-likes as if they were dense.\nexport default function each(obj, iteratee, context) {\n iteratee = optimizeCb(iteratee, context);\n var i, length;\n if (isArrayLike(obj)) {\n for (i = 0, length = obj.length; i < length; i++) {\n iteratee(obj[i], i, obj);\n }\n } else {\n var _keys = keys(obj);\n for (i = 0, length = _keys.length; i < length; i++) {\n iteratee(obj[_keys[i]], _keys[i], obj);\n }\n }\n return obj;\n}\n","import cb from './_cb.js';\nimport isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// Return the results of applying the iteratee to each element.\nexport default function map(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n results = Array(length);\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n results[index] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n}\n","import isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\nimport optimizeCb from './_optimizeCb.js';\n\n// Internal helper to create a reducing function, iterating left or right.\nexport default function createReduce(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[_keys ? _keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = _keys ? _keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n}\n","import createReduce from './_createReduce.js';\n\n// **Reduce** builds up a single result from a list of values, aka `inject`,\n// or `foldl`.\nexport default createReduce(1);\n","import createReduce from './_createReduce.js';\n\n// The right-associative version of reduce, also known as `foldr`.\nexport default createReduce(-1);\n","import cb from './_cb.js';\nimport each from './each.js';\n\n// Return all the elements that pass a truth test.\nexport default function filter(obj, predicate, context) {\n var results = [];\n predicate = cb(predicate, context);\n each(obj, function(value, index, list) {\n if (predicate(value, index, list)) results.push(value);\n });\n return results;\n}\n","import filter from './filter.js';\nimport negate from './negate.js';\nimport cb from './_cb.js';\n\n// Return all the elements for which a truth test fails.\nexport default function reject(obj, predicate, context) {\n return filter(obj, negate(cb(predicate)), context);\n}\n","import cb from './_cb.js';\nimport isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// Determine whether all of the elements pass a truth test.\nexport default function every(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n if (!predicate(obj[currentKey], currentKey, obj)) return false;\n }\n return true;\n}\n","import cb from './_cb.js';\nimport isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// Determine if at least one element in the object passes a truth test.\nexport default function some(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n if (predicate(obj[currentKey], currentKey, obj)) return true;\n }\n return false;\n}\n","import isArrayLike from './_isArrayLike.js';\nimport values from './values.js';\nimport indexOf from './indexOf.js';\n\n// Determine if the array or object contains a given item (using `===`).\nexport default function contains(obj, item, fromIndex, guard) {\n if (!isArrayLike(obj)) obj = values(obj);\n if (typeof fromIndex != 'number' || guard) fromIndex = 0;\n return indexOf(obj, item, fromIndex) >= 0;\n}\n","import restArguments from './restArguments.js';\nimport isFunction from './isFunction.js';\nimport map from './map.js';\nimport deepGet from './_deepGet.js';\nimport toPath from './_toPath.js';\n\n// Invoke a method (with arguments) on every item in a collection.\nexport default restArguments(function(obj, path, args) {\n var contextPath, func;\n if (isFunction(path)) {\n func = path;\n } else {\n path = toPath(path);\n contextPath = path.slice(0, -1);\n path = path[path.length - 1];\n }\n return map(obj, function(context) {\n var method = func;\n if (!method) {\n if (contextPath && contextPath.length) {\n context = deepGet(context, contextPath);\n }\n if (context == null) return void 0;\n method = context[path];\n }\n return method == null ? method : method.apply(context, args);\n });\n});\n","import map from './map.js';\nimport property from './property.js';\n\n// Convenience version of a common use case of `_.map`: fetching a property.\nexport default function pluck(obj, key) {\n return map(obj, property(key));\n}\n","import filter from './filter.js';\nimport matcher from './matcher.js';\n\n// Convenience version of a common use case of `_.filter`: selecting only\n// objects containing specific `key:value` pairs.\nexport default function where(obj, attrs) {\n return filter(obj, matcher(attrs));\n}\n","import isArrayLike from './_isArrayLike.js';\nimport values from './values.js';\nimport cb from './_cb.js';\nimport each from './each.js';\n\n// Return the maximum element (or element-based computation).\nexport default function max(obj, iteratee, context) {\n var result = -Infinity, lastComputed = -Infinity,\n value, computed;\n if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {\n obj = isArrayLike(obj) ? obj : values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value != null && value > result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n each(obj, function(v, index, list) {\n computed = iteratee(v, index, list);\n if (computed > lastComputed || computed === -Infinity && result === -Infinity) {\n result = v;\n lastComputed = computed;\n }\n });\n }\n return result;\n}\n","import isArrayLike from './_isArrayLike.js';\nimport values from './values.js';\nimport cb from './_cb.js';\nimport each from './each.js';\n\n// Return the minimum element (or element-based computation).\nexport default function min(obj, iteratee, context) {\n var result = Infinity, lastComputed = Infinity,\n value, computed;\n if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {\n obj = isArrayLike(obj) ? obj : values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value != null && value < result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n each(obj, function(v, index, list) {\n computed = iteratee(v, index, list);\n if (computed < lastComputed || computed === Infinity && result === Infinity) {\n result = v;\n lastComputed = computed;\n }\n });\n }\n return result;\n}\n","import isArrayLike from './_isArrayLike.js';\nimport clone from './clone.js';\nimport values from './values.js';\nimport getLength from './_getLength.js';\nimport random from './random.js';\n\n// Sample **n** random values from a collection using the modern version of the\n// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).\n// If **n** is not specified, returns a single random element.\n// The internal `guard` argument allows it to work with `_.map`.\nexport default function sample(obj, n, guard) {\n if (n == null || guard) {\n if (!isArrayLike(obj)) obj = values(obj);\n return obj[random(obj.length - 1)];\n }\n var sample = isArrayLike(obj) ? clone(obj) : values(obj);\n var length = getLength(sample);\n n = Math.max(Math.min(n, length), 0);\n var last = length - 1;\n for (var index = 0; index < n; index++) {\n var rand = random(index, last);\n var temp = sample[index];\n sample[index] = sample[rand];\n sample[rand] = temp;\n }\n return sample.slice(0, n);\n}\n","import sample from './sample.js';\n\n// Shuffle a collection.\nexport default function shuffle(obj) {\n return sample(obj, Infinity);\n}\n","import cb from './_cb.js';\nimport pluck from './pluck.js';\nimport map from './map.js';\n\n// Sort the object's values by a criterion produced by an iteratee.\nexport default function sortBy(obj, iteratee, context) {\n var index = 0;\n iteratee = cb(iteratee, context);\n return pluck(map(obj, function(value, key, list) {\n return {\n value: value,\n index: index++,\n criteria: iteratee(value, key, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index - right.index;\n }), 'value');\n}\n","import cb from './_cb.js';\nimport each from './each.js';\n\n// An internal function used for aggregate \"group by\" operations.\nexport default function group(behavior, partition) {\n return function(obj, iteratee, context) {\n var result = partition ? [[], []] : {};\n iteratee = cb(iteratee, context);\n each(obj, function(value, index) {\n var key = iteratee(value, index, obj);\n behavior(result, value, key);\n });\n return result;\n };\n}\n","import group from './_group.js';\nimport has from './_has.js';\n\n// Groups the object's values by a criterion. Pass either a string attribute\n// to group by, or a function that returns the criterion.\nexport default group(function(result, value, key) {\n if (has(result, key)) result[key].push(value); else result[key] = [value];\n});\n","import group from './_group.js';\n\n// Indexes the object's values by a criterion, similar to `_.groupBy`, but for\n// when you know that your index values will be unique.\nexport default group(function(result, value, key) {\n result[key] = value;\n});\n","import group from './_group.js';\nimport has from './_has.js';\n\n// Counts instances of an object that group by a certain criterion. Pass\n// either a string attribute to count by, or a function that returns the\n// criterion.\nexport default group(function(result, value, key) {\n if (has(result, key)) result[key]++; else result[key] = 1;\n});\n","import group from './_group.js';\n\n// Split a collection into two arrays: one whose elements all pass the given\n// truth test, and one whose elements all do not pass the truth test.\nexport default group(function(result, value, pass) {\n result[pass ? 0 : 1].push(value);\n}, true);\n","import isArray from './isArray.js';\nimport { slice } from './_setup.js';\nimport isString from './isString.js';\nimport isArrayLike from './_isArrayLike.js';\nimport map from './map.js';\nimport identity from './identity.js';\nimport values from './values.js';\n\n// Safely create a real, live array from anything iterable.\nvar reStrSymbol = /[^\\ud800-\\udfff]|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff]/g;\nexport default function toArray(obj) {\n if (!obj) return [];\n if (isArray(obj)) return slice.call(obj);\n if (isString(obj)) {\n // Keep surrogate pair characters together.\n return obj.match(reStrSymbol);\n }\n if (isArrayLike(obj)) return map(obj, identity);\n return values(obj);\n}\n","import isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// Return the number of elements in a collection.\nexport default function size(obj) {\n if (obj == null) return 0;\n return isArrayLike(obj) ? obj.length : keys(obj).length;\n}\n","// Internal `_.pick` helper function to determine whether `key` is an enumerable\n// property name of `obj`.\nexport default function keyInObj(value, key, obj) {\n return key in obj;\n}\n","import restArguments from './restArguments.js';\nimport isFunction from './isFunction.js';\nimport optimizeCb from './_optimizeCb.js';\nimport allKeys from './allKeys.js';\nimport keyInObj from './_keyInObj.js';\nimport flatten from './_flatten.js';\n\n// Return a copy of the object only containing the allowed properties.\nexport default restArguments(function(obj, keys) {\n var result = {}, iteratee = keys[0];\n if (obj == null) return result;\n if (isFunction(iteratee)) {\n if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]);\n keys = allKeys(obj);\n } else {\n iteratee = keyInObj;\n keys = flatten(keys, false, false);\n obj = Object(obj);\n }\n for (var i = 0, length = keys.length; i < length; i++) {\n var key = keys[i];\n var value = obj[key];\n if (iteratee(value, key, obj)) result[key] = value;\n }\n return result;\n});\n","import restArguments from './restArguments.js';\nimport isFunction from './isFunction.js';\nimport negate from './negate.js';\nimport map from './map.js';\nimport flatten from './_flatten.js';\nimport contains from './contains.js';\nimport pick from './pick.js';\n\n// Return a copy of the object without the disallowed properties.\nexport default restArguments(function(obj, keys) {\n var iteratee = keys[0], context;\n if (isFunction(iteratee)) {\n iteratee = negate(iteratee);\n if (keys.length > 1) context = keys[1];\n } else {\n keys = map(flatten(keys, false, false), String);\n iteratee = function(value, key) {\n return !contains(keys, key);\n };\n }\n return pick(obj, iteratee, context);\n});\n","import { slice } from './_setup.js';\n\n// Returns everything but the last entry of the array. Especially useful on\n// the arguments object. Passing **n** will return all the values in\n// the array, excluding the last N.\nexport default function initial(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n}\n","import initial from './initial.js';\n\n// Get the first element of an array. Passing **n** will return the first N\n// values in the array. The **guard** check allows it to work with `_.map`.\nexport default function first(array, n, guard) {\n if (array == null || array.length < 1) return n == null || guard ? void 0 : [];\n if (n == null || guard) return array[0];\n return initial(array, array.length - n);\n}\n","import { slice } from './_setup.js';\n\n// Returns everything but the first entry of the `array`. Especially useful on\n// the `arguments` object. Passing an **n** will return the rest N values in the\n// `array`.\nexport default function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}\n","import rest from './rest.js';\n\n// Get the last element of an array. Passing **n** will return the last N\n// values in the array.\nexport default function last(array, n, guard) {\n if (array == null || array.length < 1) return n == null || guard ? void 0 : [];\n if (n == null || guard) return array[array.length - 1];\n return rest(array, Math.max(0, array.length - n));\n}\n","import filter from './filter.js';\n\n// Trim out all falsy values from an array.\nexport default function compact(array) {\n return filter(array, Boolean);\n}\n","import _flatten from './_flatten.js';\n\n// Flatten out an array, either recursively (by default), or up to `depth`.\n// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.\nexport default function flatten(array, depth) {\n return _flatten(array, depth, false);\n}\n","import restArguments from './restArguments.js';\nimport flatten from './_flatten.js';\nimport filter from './filter.js';\nimport contains from './contains.js';\n\n// Take the difference between one array and a number of other arrays.\n// Only the elements present in just the first array will remain.\nexport default restArguments(function(array, rest) {\n rest = flatten(rest, true, true);\n return filter(array, function(value){\n return !contains(rest, value);\n });\n});\n","import restArguments from './restArguments.js';\nimport difference from './difference.js';\n\n// Return a version of the array that does not contain the specified value(s).\nexport default restArguments(function(array, otherArrays) {\n return difference(array, otherArrays);\n});\n","import isBoolean from './isBoolean.js';\nimport cb from './_cb.js';\nimport getLength from './_getLength.js';\nimport contains from './contains.js';\n\n// Produce a duplicate-free version of the array. If the array has already\n// been sorted, you have the option of using a faster algorithm.\n// The faster algorithm will not work with an iteratee if the iteratee\n// is not a one-to-one function, so providing an iteratee will disable\n// the faster algorithm.\nexport default function uniq(array, isSorted, iteratee, context) {\n if (!isBoolean(isSorted)) {\n context = iteratee;\n iteratee = isSorted;\n isSorted = false;\n }\n if (iteratee != null) iteratee = cb(iteratee, context);\n var result = [];\n var seen = [];\n for (var i = 0, length = getLength(array); i < length; i++) {\n var value = array[i],\n computed = iteratee ? iteratee(value, i, array) : value;\n if (isSorted && !iteratee) {\n if (!i || seen !== computed) result.push(value);\n seen = computed;\n } else if (iteratee) {\n if (!contains(seen, computed)) {\n seen.push(computed);\n result.push(value);\n }\n } else if (!contains(result, value)) {\n result.push(value);\n }\n }\n return result;\n}\n","import restArguments from './restArguments.js';\nimport uniq from './uniq.js';\nimport flatten from './_flatten.js';\n\n// Produce an array that contains the union: each distinct element from all of\n// the passed-in arrays.\nexport default restArguments(function(arrays) {\n return uniq(flatten(arrays, true, true));\n});\n","import getLength from './_getLength.js';\nimport contains from './contains.js';\n\n// Produce an array that contains every item shared between all the\n// passed-in arrays.\nexport default function intersection(array) {\n var result = [];\n var argsLength = arguments.length;\n for (var i = 0, length = getLength(array); i < length; i++) {\n var item = array[i];\n if (contains(result, item)) continue;\n var j;\n for (j = 1; j < argsLength; j++) {\n if (!contains(arguments[j], item)) break;\n }\n if (j === argsLength) result.push(item);\n }\n return result;\n}\n","import max from './max.js';\nimport getLength from './_getLength.js';\nimport pluck from './pluck.js';\n\n// Complement of zip. Unzip accepts an array of arrays and groups\n// each array's elements on shared indices.\nexport default function unzip(array) {\n var length = array && max(array, getLength).length || 0;\n var result = Array(length);\n\n for (var index = 0; index < length; index++) {\n result[index] = pluck(array, index);\n }\n return result;\n}\n","import restArguments from './restArguments.js';\nimport unzip from './unzip.js';\n\n// Zip together multiple lists into a single array -- elements that share\n// an index go together.\nexport default restArguments(unzip);\n","import getLength from './_getLength.js';\n\n// Converts lists into objects. Pass either a single array of `[key, value]`\n// pairs, or two parallel arrays of the same length -- one of keys, and one of\n// the corresponding values. Passing by pairs is the reverse of `_.pairs`.\nexport default function object(list, values) {\n var result = {};\n for (var i = 0, length = getLength(list); i < length; i++) {\n if (values) {\n result[list[i]] = values[i];\n } else {\n result[list[i][0]] = list[i][1];\n }\n }\n return result;\n}\n","// Generate an integer Array containing an arithmetic progression. A port of\n// the native Python `range()` function. See\n// [the Python documentation](https://docs.python.org/library/functions.html#range).\nexport default function range(start, stop, step) {\n if (stop == null) {\n stop = start || 0;\n start = 0;\n }\n if (!step) {\n step = stop < start ? -1 : 1;\n }\n\n var length = Math.max(Math.ceil((stop - start) / step), 0);\n var range = Array(length);\n\n for (var idx = 0; idx < length; idx++, start += step) {\n range[idx] = start;\n }\n\n return range;\n}\n","import { slice } from './_setup.js';\n\n// Chunk a single array into multiple arrays, each containing `count` or fewer\n// items.\nexport default function chunk(array, count) {\n if (count == null || count < 1) return [];\n var result = [];\n var i = 0, length = array.length;\n while (i < length) {\n result.push(slice.call(array, i, i += count));\n }\n return result;\n}\n","import _ from './underscore.js';\n\n// Helper function to continue chaining intermediate results.\nexport default function chainResult(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n}\n","import _ from './underscore.js';\nimport each from './each.js';\nimport functions from './functions.js';\nimport { push } from './_setup.js';\nimport chainResult from './_chainResult.js';\n\n// Add your own custom functions to the Underscore object.\nexport default function mixin(obj) {\n each(functions(obj), function(name) {\n var func = _[name] = obj[name];\n _.prototype[name] = function() {\n var args = [this._wrapped];\n push.apply(args, arguments);\n return chainResult(this, func.apply(_, args));\n };\n });\n return _;\n}\n","import _ from './underscore.js';\nimport each from './each.js';\nimport { ArrayProto } from './_setup.js';\nimport chainResult from './_chainResult.js';\n\n// Add all mutator `Array` functions to the wrapper.\neach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n if (obj != null) {\n method.apply(obj, arguments);\n if ((name === 'shift' || name === 'splice') && obj.length === 0) {\n delete obj[0];\n }\n }\n return chainResult(this, obj);\n };\n});\n\n// Add all accessor `Array` functions to the wrapper.\neach(['concat', 'join', 'slice'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n if (obj != null) obj = method.apply(obj, arguments);\n return chainResult(this, obj);\n };\n});\n\nexport default _;\n","// Default Export\n// ==============\n// In this module, we mix our bundled exports into the `_` object and export\n// the result. This is analogous to setting `module.exports = _` in CommonJS.\n// Hence, this module is also the entry point of our UMD bundle and the package\n// entry point for CommonJS and AMD users. In other words, this is (the source\n// of) the module you are interfacing with when you do any of the following:\n//\n// ```js\n// // CommonJS\n// var _ = require('underscore');\n//\n// // AMD\n// define(['underscore'], function(_) {...});\n//\n// // UMD in the browser\n// // _ is available as a global variable\n// ```\nimport * as allExports from './index.js';\nimport { mixin } from './index.js';\n\n// Add all of the Underscore functions to the wrapper object.\nvar _ = mixin(allExports);\n// Legacy Node.js API.\n_._ = _;\n// Export the Underscore API.\nexport default _;\n","import { keys, isUndefined, isElement, isArray } from 'underscore';\n\nexport const hasWin = () => typeof window !== 'undefined';\n\nexport const toLowerCase = str => (str || '').toLowerCase();\n\nconst elProt = hasWin() ? window.Element.prototype : {};\nconst matches =\n elProt.matches ||\n elProt.webkitMatchesSelector ||\n elProt.mozMatchesSelector ||\n elProt.msMatchesSelector;\n\nexport const getUiClass = (em, defCls) => {\n const { stylePrefix, customUI } = em.getConfig();\n return [customUI && `${stylePrefix}cui`, defCls].filter(i => i).join(' ');\n};\n\n/**\n * Import styles asynchronously\n * @param {String|Array} styles\n */\nconst appendStyles = (styles, opts = {}) => {\n const stls = isArray(styles) ? [...styles] : [styles];\n\n if (stls.length) {\n const href = stls.shift();\n\n if (\n href &&\n (!opts.unique || !document.querySelector(`link[href=\"${href}\"]`))\n ) {\n const { head } = document;\n const link = document.createElement('link');\n link.href = href;\n link.rel = 'stylesheet';\n\n if (opts.prepand) {\n head.insertBefore(link, head.firstChild);\n } else {\n head.appendChild(link);\n }\n }\n\n appendStyles(stls);\n }\n};\n\n/**\n * Returns shallow diff between 2 objects\n * @param {Object} objOrig\n * @param {Objec} objNew\n * @return {Object}\n * @example\n * var a = {foo: 'bar', baz: 1, faz: 'sop'};\n * var b = {foo: 'bar', baz: 2, bar: ''};\n * shallowDiff(a, b);\n * // -> {baz: 2, faz: null, bar: ''};\n */\nconst shallowDiff = (objOrig, objNew) => {\n const result = {};\n const keysNew = keys(objNew);\n\n for (let prop in objOrig) {\n if (objOrig.hasOwnProperty(prop)) {\n const origValue = objOrig[prop];\n const newValue = objNew[prop];\n\n if (keysNew.indexOf(prop) >= 0) {\n if (origValue !== newValue) {\n result[prop] = newValue;\n }\n } else {\n result[prop] = null;\n }\n }\n }\n\n for (let prop in objNew) {\n if (objNew.hasOwnProperty(prop)) {\n if (isUndefined(objOrig[prop])) {\n result[prop] = objNew[prop];\n }\n }\n }\n\n return result;\n};\n\nconst on = (el, ev, fn, opts) => {\n ev = ev.split(/\\s+/);\n el = el instanceof Array ? el : [el];\n\n for (let i = 0; i < ev.length; ++i) {\n el.forEach(elem => elem && elem.addEventListener(ev[i], fn, opts));\n }\n};\n\nconst off = (el, ev, fn, opts) => {\n ev = ev.split(/\\s+/);\n el = el instanceof Array ? el : [el];\n\n for (let i = 0; i < ev.length; ++i) {\n el.forEach(elem => elem && elem.removeEventListener(ev[i], fn, opts));\n }\n};\n\nconst getUnitFromValue = value => {\n return value.replace(parseFloat(value), '');\n};\n\nconst upFirst = value => value[0].toUpperCase() + value.toLowerCase().slice(1);\n\nconst camelCase = value => {\n const values = value.split('-').filter(String);\n return values[0].toLowerCase() + values.slice(1).map(upFirst);\n};\n\nconst normalizeFloat = (value, step = 1, valueDef = 0) => {\n let stepDecimals = 0;\n if (isNaN(value)) return valueDef;\n value = parseFloat(value);\n\n if (Math.floor(value) !== value) {\n const side = step.toString().split('.')[1];\n stepDecimals = side ? side.length : 0;\n }\n\n return stepDecimals ? parseFloat(value.toFixed(stepDecimals)) : value;\n};\n\nconst hasDnd = em => {\n return (\n 'draggable' in document.createElement('i') &&\n (em ? em.get('Config').nativeDnD : 1)\n );\n};\n\n/**\n * Ensure to fetch the element from the input argument\n * @param {HTMLElement|Component} el Component or HTML element\n * @return {HTMLElement}\n */\nconst getElement = el => {\n if (isElement(el) || isTextNode(el)) {\n return el;\n } else if (el && el.getEl) {\n return el.getEl();\n }\n};\n\n/**\n * Check if element is a text node\n * @param {HTMLElement} el\n * @return {Boolean}\n */\nconst isTextNode = el => el && el.nodeType === 3;\n\n/**\n * Check if element is a comment node\n * @param {HTMLElement} el\n * @return {Boolean}\n */\nexport const isCommentNode = el => el && el.nodeType === 8;\n\n/**\n * Check if element is a comment node\n * @param {HTMLElement} el\n * @return {Boolean}\n */\nexport const isTaggableNode = el => el && !isTextNode(el) && !isCommentNode(el);\n\nexport const find = (arr, test) => {\n let result = null;\n arr.some((el, i) => (test(el, i, arr) ? ((result = el), 1) : 0));\n return result;\n};\n\nexport const escape = (str = '') => {\n return `${str}`\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(/`/g, '`');\n};\n\n/**\n * Ensure to fetch the model from the input argument\n * @param {HTMLElement|Component} el Component or HTML element\n * @return {Component}\n */\nconst getModel = (el, $) => {\n let model = el;\n isElement(el) && (model = $(el).data('model'));\n return model;\n};\n\nconst getElRect = el => {\n const def = {\n top: 0,\n left: 0,\n width: 0,\n height: 0\n };\n if (!el) return def;\n let rectText;\n\n if (isTextNode(el)) {\n const range = document.createRange();\n range.selectNode(el);\n rectText = range.getBoundingClientRect();\n range.detach();\n }\n\n return (\n rectText || (el.getBoundingClientRect ? el.getBoundingClientRect() : def)\n );\n};\n\n/**\n * Get cross-device pointer event\n * @param {Event} ev\n * @return {Event}\n */\nconst getPointerEvent = ev =>\n ev.touches && ev.touches[0] ? ev.touches[0] : ev;\n\n/**\n * Get cross-browser keycode\n * @param {Event} ev\n * @return {Number}\n */\nconst getKeyCode = ev => ev.which || ev.keyCode;\nconst getKeyChar = ev => String.fromCharCode(getKeyCode(ev));\nconst isEscKey = ev => getKeyCode(ev) === 27;\nconst isEnterKey = ev => getKeyCode(ev) === 13;\nconst isObject = val =>\n val !== null && !Array.isArray(val) && typeof val === 'object';\nconst isEmptyObj = val => Object.keys(val).length <= 0;\n\nconst capitalize = str => str && str.charAt(0).toUpperCase() + str.substring(1);\nconst isComponent = obj => obj && obj.toHTML;\nconst isRule = obj => obj && obj.toCSS;\n\nconst getViewEl = el => el.__gjsv;\nconst setViewEl = (el, view) => {\n el.__gjsv = view;\n};\n\nconst createId = (length = 16) => {\n let result = '';\n const chars =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const len = chars.length;\n for (let i = 0; i < length; i++) {\n result += chars.charAt(Math.floor(Math.random() * len));\n }\n return result;\n};\n\nexport {\n on,\n off,\n hasDnd,\n upFirst,\n matches,\n getModel,\n getElRect,\n camelCase,\n isTextNode,\n getKeyCode,\n getKeyChar,\n isEscKey,\n isEnterKey,\n getElement,\n shallowDiff,\n normalizeFloat,\n getPointerEvent,\n getUnitFromValue,\n capitalize,\n getViewEl,\n setViewEl,\n appendStyles,\n isObject,\n isEmptyObj,\n isComponent,\n createId,\n isRule\n};\n","// Backbone.js 1.3.3\n\n// (c) 2010-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n// Backbone may be freely distributed under the MIT license.\n// For all details and documentation:\n// http://backbonejs.org\n\n(function(factory) {\n\n // Establish the root object, `window` (`self`) in the browser, or `global` on the server.\n // We use `self` instead of `window` for `WebWorker` support.\n var root = (typeof self == 'object' && self.self === self && self) ||\n (typeof global == 'object' && global.global === global && global);\n\n // Set up Backbone appropriately for the environment. Start with AMD.\n if (typeof define === 'function' && define.amd) {\n define(['underscore', 'jquery', 'exports'], function(_, $, exports) {\n // Export global even in AMD case in case this script is loaded with\n // others that may still expect a global Backbone.\n root.Backbone = factory(root, exports, _, $);\n });\n\n // Next for Node.js or CommonJS. jQuery may not be needed as a module.\n } else if (typeof exports !== 'undefined') {\n var _ = require('underscore'), $;\n try { $ = require('jquery'); } catch (e) {}\n factory(root, exports, _, $);\n\n // Finally, as a browser global.\n } else {\n root.Backbone = factory(root, {}, root._, (root.jQuery || root.Zepto || root.ender || root.$));\n }\n\n})(function(root, Backbone, _, $) {\n\n // Initial Setup\n // -------------\n\n // Save the previous value of the `Backbone` variable, so that it can be\n // restored later on, if `noConflict` is used.\n var previousBackbone = root.Backbone;\n\n // Create a local reference to a common array method we'll want to use later.\n var slice = Array.prototype.slice;\n\n // Current version of the library. Keep in sync with `package.json`.\n Backbone.VERSION = '1.3.3';\n\n // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns\n // the `$` variable.\n Backbone.$ = $;\n\n // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable\n // to its previous owner. Returns a reference to this Backbone object.\n Backbone.noConflict = function() {\n root.Backbone = previousBackbone;\n return this;\n };\n\n // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option\n // will fake `\"PATCH\"`, `\"PUT\"` and `\"DELETE\"` requests via the `_method` parameter and\n // set a `X-Http-Method-Override` header.\n Backbone.emulateHTTP = false;\n\n // Turn on `emulateJSON` to support legacy servers that can't deal with direct\n // `application/json` requests ... this will encode the body as\n // `application/x-www-form-urlencoded` instead and will send the model in a\n // form param named `model`.\n Backbone.emulateJSON = false;\n\n // Proxy Backbone class methods to Underscore functions, wrapping the model's\n // `attributes` object or collection's `models` array behind the scenes.\n //\n // collection.filter(function(model) { return model.get('age') > 10 });\n // collection.each(this.addView);\n //\n // `Function#apply` can be slow so we use the method's arg count, if we know it.\n var addMethod = function(length, method, attribute) {\n switch (length) {\n case 1: return function() {\n return _[method](this[attribute]);\n };\n case 2: return function(value) {\n return _[method](this[attribute], value);\n };\n case 3: return function(iteratee, context) {\n return _[method](this[attribute], cb(iteratee, this), context);\n };\n case 4: return function(iteratee, defaultVal, context) {\n return _[method](this[attribute], cb(iteratee, this), defaultVal, context);\n };\n default: return function() {\n var args = slice.call(arguments);\n args.unshift(this[attribute]);\n return _[method].apply(_, args);\n };\n }\n };\n var addUnderscoreMethods = function(Class, methods, attribute) {\n _.each(methods, function(length, method) {\n if (_[method]) Class.prototype[method] = addMethod(length, method, attribute);\n });\n };\n\n // Support `collection.sortBy('attr')` and `collection.findWhere({id: 1})`.\n var cb = function(iteratee, instance) {\n if (_.isFunction(iteratee)) return iteratee;\n if (_.isObject(iteratee) && !instance._isModel(iteratee)) return modelMatcher(iteratee);\n if (_.isString(iteratee)) return function(model) { return model.get(iteratee); };\n return iteratee;\n };\n var modelMatcher = function(attrs) {\n var matcher = _.matches(attrs);\n return function(model) {\n return matcher(model.attributes);\n };\n };\n\n // Backbone.Events\n // ---------------\n\n // A module that can be mixed in to *any object* in order to provide it with\n // a custom event channel. You may bind a callback to an event with `on` or\n // remove with `off`; `trigger`-ing an event fires all callbacks in\n // succession.\n //\n // var object = {};\n // _.extend(object, Backbone.Events);\n // object.on('expand', function(){ alert('expanded'); });\n // object.trigger('expand');\n //\n var Events = Backbone.Events = {};\n\n // Regular expression used to split event strings.\n var eventSplitter = /\\s+/;\n\n // Iterates over the standard `event, callback` (as well as the fancy multiple\n // space-separated events `\"change blur\", callback` and jQuery-style event\n // maps `{event: callback}`).\n var eventsApi = function(iteratee, events, name, callback, opts) {\n var i = 0, names;\n if (name && typeof name === 'object') {\n // Handle event maps.\n if (callback !== void 0 && 'context' in opts && opts.context === void 0) opts.context = callback;\n for (names = _.keys(name); i < names.length ; i++) {\n events = eventsApi(iteratee, events, names[i], name[names[i]], opts);\n }\n } else if (name && eventSplitter.test(name)) {\n // Handle space-separated event names by delegating them individually.\n for (names = name.split(eventSplitter); i < names.length; i++) {\n events = iteratee(events, names[i], callback, opts);\n }\n } else {\n // Finally, standard events.\n events = iteratee(events, name, callback, opts);\n }\n return events;\n };\n\n // Bind an event to a `callback` function. Passing `\"all\"` will bind\n // the callback to all events fired.\n Events.on = function(name, callback, context) {\n return internalOn(this, name, callback, context);\n };\n\n // Guard the `listening` argument from the public API.\n var internalOn = function(obj, name, callback, context, listening) {\n obj._events = eventsApi(onApi, obj._events || {}, name, callback, {\n context: context,\n ctx: obj,\n listening: listening\n });\n\n if (listening) {\n var listeners = obj._listeners || (obj._listeners = {});\n listeners[listening.id] = listening;\n }\n\n return obj;\n };\n\n // Inversion-of-control versions of `on`. Tell *this* object to listen to\n // an event in another object... keeping track of what it's listening to\n // for easier unbinding later.\n Events.listenTo = function(obj, name, callback) {\n if (!obj) return this;\n var id = obj._listenId || (obj._listenId = _.uniqueId('l'));\n var listeningTo = this._listeningTo || (this._listeningTo = {});\n var listening = listeningTo[id];\n\n // This object is not listening to any other events on `obj` yet.\n // Setup the necessary references to track the listening callbacks.\n if (!listening) {\n var thisId = this._listenId || (this._listenId = _.uniqueId('l'));\n listening = listeningTo[id] = {obj: obj, objId: id, id: thisId, listeningTo: listeningTo, count: 0};\n }\n\n // Bind callbacks on obj, and keep track of them on listening.\n internalOn(obj, name, callback, this, listening);\n return this;\n };\n\n // The reducing API that adds a callback to the `events` object.\n var onApi = function(events, name, callback, options) {\n if (callback) {\n var handlers = events[name] || (events[name] = []);\n var context = options.context, ctx = options.ctx, listening = options.listening;\n if (listening) listening.count++;\n\n handlers.push({callback: callback, context: context, ctx: context || ctx, listening: listening});\n }\n return events;\n };\n\n // Remove one or many callbacks. If `context` is null, removes all\n // callbacks with that function. If `callback` is null, removes all\n // callbacks for the event. If `name` is null, removes all bound\n // callbacks for all events.\n Events.off = function(name, callback, context) {\n if (!this._events) return this;\n this._events = eventsApi(offApi, this._events, name, callback, {\n context: context,\n listeners: this._listeners\n });\n return this;\n };\n\n // Tell this object to stop listening to either specific events ... or\n // to every object it's currently listening to.\n Events.stopListening = function(obj, name, callback) {\n var listeningTo = this._listeningTo;\n if (!listeningTo) return this;\n\n var ids = obj ? [obj._listenId] : _.keys(listeningTo);\n\n for (var i = 0; i < ids.length; i++) {\n var listening = listeningTo[ids[i]];\n\n // If listening doesn't exist, this object is not currently\n // listening to obj. Break out early.\n if (!listening) break;\n\n listening.obj.off(name, callback, this);\n }\n\n return this;\n };\n\n // The reducing API that removes a callback from the `events` object.\n var offApi = function(events, name, callback, options) {\n if (!events) return;\n\n var i = 0, listening;\n var context = options.context, listeners = options.listeners;\n\n // Delete all events listeners and \"drop\" events.\n if (!name && !callback && !context) {\n var ids = _.keys(listeners);\n for (; i < ids.length; i++) {\n listening = listeners[ids[i]];\n delete listeners[listening.id];\n delete listening.listeningTo[listening.objId];\n }\n return;\n }\n\n var names = name ? [name] : _.keys(events);\n for (; i < names.length; i++) {\n name = names[i];\n var handlers = events[name];\n\n // Bail out if there are no events stored.\n if (!handlers) break;\n\n // Replace events if there are any remaining. Otherwise, clean up.\n var remaining = [];\n for (var j = 0; j < handlers.length; j++) {\n var handler = handlers[j];\n if (\n callback && callback !== handler.callback &&\n callback !== handler.callback._callback ||\n context && context !== handler.context\n ) {\n remaining.push(handler);\n } else {\n listening = handler.listening;\n if (listening && --listening.count === 0) {\n delete listeners[listening.id];\n delete listening.listeningTo[listening.objId];\n }\n }\n }\n\n // Update tail event if the list has any events. Otherwise, clean up.\n if (remaining.length) {\n events[name] = remaining;\n } else {\n delete events[name];\n }\n }\n return events;\n };\n\n // Bind an event to only be triggered a single time. After the first time\n // the callback is invoked, its listener will be removed. If multiple events\n // are passed in using the space-separated syntax, the handler will fire\n // once for each event, not once for a combination of all events.\n Events.once = function(name, callback, context) {\n // Map the event into a `{event: once}` object.\n var events = eventsApi(onceMap, {}, name, callback, _.bind(this.off, this));\n if (typeof name === 'string' && context == null) callback = void 0;\n return this.on(events, callback, context);\n };\n\n // Inversion-of-control versions of `once`.\n Events.listenToOnce = function(obj, name, callback) {\n // Map the event into a `{event: once}` object.\n var events = eventsApi(onceMap, {}, name, callback, _.bind(this.stopListening, this, obj));\n return this.listenTo(obj, events);\n };\n\n // Reduces the event callbacks into a map of `{event: onceWrapper}`.\n // `offer` unbinds the `onceWrapper` after it has been called.\n var onceMap = function(map, name, callback, offer) {\n if (callback) {\n var once = map[name] = _.once(function() {\n offer(name, once);\n callback.apply(this, arguments);\n });\n once._callback = callback;\n }\n return map;\n };\n\n // Trigger one or many events, firing all bound callbacks. Callbacks are\n // passed the same arguments as `trigger` is, apart from the event name\n // (unless you're listening on `\"all\"`, which will cause your callback to\n // receive the true name of the event as the first argument).\n Events.trigger = function(name) {\n if (!this._events) return this;\n\n var length = Math.max(0, arguments.length - 1);\n var args = Array(length);\n for (var i = 0; i < length; i++) args[i] = arguments[i + 1];\n\n eventsApi(triggerApi, this._events, name, void 0, args);\n return this;\n };\n\n // Handles triggering the appropriate event callbacks.\n var triggerApi = function(objEvents, name, callback, args) {\n if (objEvents) {\n var events = objEvents[name];\n var allEvents = objEvents.all;\n if (events && allEvents) allEvents = allEvents.slice();\n if (events) triggerEvents(events, args);\n if (allEvents) triggerEvents(allEvents, [name].concat(args));\n }\n return objEvents;\n };\n\n // A difficult-to-believe, but optimized internal dispatch function for\n // triggering events. Tries to keep the usual cases speedy (most internal\n // Backbone events have 3 arguments).\n var triggerEvents = function(events, args) {\n var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];\n switch (args.length) {\n case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;\n case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;\n case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;\n case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;\n default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return;\n }\n };\n\n // Aliases for backwards compatibility.\n Events.bind = Events.on;\n Events.unbind = Events.off;\n\n // Allow the `Backbone` object to serve as a global event bus, for folks who\n // want global \"pubsub\" in a convenient place.\n _.extend(Backbone, Events);\n\n // Backbone.Model\n // --------------\n\n // Backbone **Models** are the basic data object in the framework --\n // frequently representing a row in a table in a database on your server.\n // A discrete chunk of data and a bunch of useful, related methods for\n // performing computations and transformations on that data.\n\n // Create a new model with the specified attributes. A client id (`cid`)\n // is automatically generated and assigned for you.\n var Model = Backbone.Model = function(attributes, options) {\n var attrs = attributes || {};\n options || (options = {});\n this.cid = _.uniqueId(this.cidPrefix);\n this.attributes = {};\n if (options.collection) this.collection = options.collection;\n if (options.parse) attrs = this.parse(attrs, options) || {};\n var defaults = _.result(this, 'defaults');\n attrs = _.defaults(_.extend({}, defaults, attrs), defaults);\n this.set(attrs, options);\n this.changed = {};\n this.initialize.apply(this, arguments);\n };\n\n // Attach all inheritable methods to the Model prototype.\n _.extend(Model.prototype, Events, {\n\n // A hash of attributes whose current and previous value differ.\n changed: null,\n\n // The value returned during the last failed validation.\n validationError: null,\n\n // The default name for the JSON `id` attribute is `\"id\"`. MongoDB and\n // CouchDB users may want to set this to `\"_id\"`.\n idAttribute: 'id',\n\n // The prefix is used to create the client id which is used to identify models locally.\n // You may want to override this if you're experiencing name clashes with model ids.\n cidPrefix: 'c',\n\n // Initialize is an empty function by default. Override it with your own\n // initialization logic.\n initialize: function(){},\n\n // Return a copy of the model's `attributes` object.\n toJSON: function(options) {\n return _.clone(this.attributes);\n },\n\n // Proxy `Backbone.sync` by default -- but override this if you need\n // custom syncing semantics for *this* particular model.\n sync: function() {\n return Backbone.sync.apply(this, arguments);\n },\n\n // Get the value of an attribute.\n get: function(attr) {\n return this.attributes[attr];\n },\n\n // Get the HTML-escaped value of an attribute.\n escape: function(attr) {\n return _.escape(this.get(attr));\n },\n\n // Returns `true` if the attribute contains a value that is not null\n // or undefined.\n has: function(attr) {\n return this.get(attr) != null;\n },\n\n // Special-cased proxy to underscore's `_.matches` method.\n matches: function(attrs) {\n return !!_.iteratee(attrs, this)(this.attributes);\n },\n\n // Set a hash of model attributes on the object, firing `\"change\"`. This is\n // the core primitive operation of a model, updating the data and notifying\n // anyone who needs to know about the change in state. The heart of the beast.\n set: function(key, val, options) {\n if (key == null) return this;\n\n // Handle both `\"key\", value` and `{key: value}` -style arguments.\n var attrs;\n if (typeof key === 'object') {\n attrs = key;\n options = val;\n } else {\n (attrs = {})[key] = val;\n }\n\n options || (options = {});\n\n // Run validation.\n if (!this._validate(attrs, options)) return false;\n\n // Extract attributes and options.\n var unset = options.unset;\n var silent = options.silent;\n var changes = [];\n var changing = this._changing;\n this._changing = true;\n\n if (!changing) {\n this._previousAttributes = _.clone(this.attributes);\n this.changed = {};\n }\n\n var current = this.attributes;\n var changed = this.changed;\n var prev = this._previousAttributes;\n\n // For each `set` attribute, update or delete the current value.\n for (var attr in attrs) {\n val = attrs[attr];\n if (!_.isEqual(current[attr], val)) changes.push(attr);\n if (!_.isEqual(prev[attr], val)) {\n changed[attr] = val;\n } else {\n delete changed[attr];\n }\n unset ? delete current[attr] : current[attr] = val;\n }\n\n // Update the `id`.\n if (this.idAttribute in attrs) this.id = this.get(this.idAttribute);\n\n // Trigger all relevant attribute changes.\n if (!silent) {\n if (changes.length) this._pending = options;\n for (var i = 0; i < changes.length; i++) {\n this.trigger('change:' + changes[i], this, current[changes[i]], options);\n }\n }\n\n // You might be wondering why there's a `while` loop here. Changes can\n // be recursively nested within `\"change\"` events.\n if (changing) return this;\n if (!silent) {\n while (this._pending) {\n options = this._pending;\n this._pending = false;\n this.trigger('change', this, options);\n }\n }\n this._pending = false;\n this._changing = false;\n return this;\n },\n\n // Remove an attribute from the model, firing `\"change\"`. `unset` is a noop\n // if the attribute doesn't exist.\n unset: function(attr, options) {\n return this.set(attr, void 0, _.extend({}, options, {unset: true}));\n },\n\n // Clear all attributes on the model, firing `\"change\"`.\n clear: function(options) {\n var attrs = {};\n for (var key in this.attributes) attrs[key] = void 0;\n return this.set(attrs, _.extend({}, options, {unset: true}));\n },\n\n // Determine if the model has changed since the last `\"change\"` event.\n // If you specify an attribute name, determine if that attribute has changed.\n hasChanged: function(attr) {\n if (attr == null) return !_.isEmpty(this.changed);\n return _.has(this.changed, attr);\n },\n\n // Return an object containing all the attributes that have changed, or\n // false if there are no changed attributes. Useful for determining what\n // parts of a view need to be updated and/or what attributes need to be\n // persisted to the server. Unset attributes will be set to undefined.\n // You can also pass an attributes object to diff against the model,\n // determining if there *would be* a change.\n changedAttributes: function(diff) {\n if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;\n var old = this._changing ? this._previousAttributes : this.attributes;\n var changed = {};\n for (var attr in diff) {\n var val = diff[attr];\n if (_.isEqual(old[attr], val)) continue;\n changed[attr] = val;\n }\n return _.size(changed) ? changed : false;\n },\n\n // Get the previous value of an attribute, recorded at the time the last\n // `\"change\"` event was fired.\n previous: function(attr) {\n if (attr == null || !this._previousAttributes) return null;\n return this._previousAttributes[attr];\n },\n\n // Get all of the attributes of the model at the time of the previous\n // `\"change\"` event.\n previousAttributes: function() {\n return _.clone(this._previousAttributes);\n },\n\n // Fetch the model from the server, merging the response with the model's\n // local attributes. Any changed attributes will trigger a \"change\" event.\n fetch: function(options) {\n options = _.extend({parse: true}, options);\n var model = this;\n var success = options.success;\n options.success = function(resp) {\n var serverAttrs = options.parse ? model.parse(resp, options) : resp;\n if (!model.set(serverAttrs, options)) return false;\n if (success) success.call(options.context, model, resp, options);\n model.trigger('sync', model, resp, options);\n };\n wrapError(this, options);\n return this.sync('read', this, options);\n },\n\n // Set a hash of model attributes, and sync the model to the server.\n // If the server returns an attributes hash that differs, the model's\n // state will be `set` again.\n save: function(key, val, options) {\n // Handle both `\"key\", value` and `{key: value}` -style arguments.\n var attrs;\n if (key == null || typeof key === 'object') {\n attrs = key;\n options = val;\n } else {\n (attrs = {})[key] = val;\n }\n\n options = _.extend({validate: true, parse: true}, options);\n var wait = options.wait;\n\n // If we're not waiting and attributes exist, save acts as\n // `set(attr).save(null, opts)` with validation. Otherwise, check if\n // the model will be valid when the attributes, if any, are set.\n if (attrs && !wait) {\n if (!this.set(attrs, options)) return false;\n } else if (!this._validate(attrs, options)) {\n return false;\n }\n\n // After a successful server-side save, the client is (optionally)\n // updated with the server-side state.\n var model = this;\n var success = options.success;\n var attributes = this.attributes;\n options.success = function(resp) {\n // Ensure attributes are restored during synchronous saves.\n model.attributes = attributes;\n var serverAttrs = options.parse ? model.parse(resp, options) : resp;\n if (wait) serverAttrs = _.extend({}, attrs, serverAttrs);\n if (serverAttrs && !model.set(serverAttrs, options)) return false;\n if (success) success.call(options.context, model, resp, options);\n model.trigger('sync', model, resp, options);\n };\n wrapError(this, options);\n\n // Set temporary attributes if `{wait: true}` to properly find new ids.\n if (attrs && wait) this.attributes = _.extend({}, attributes, attrs);\n\n var method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');\n if (method === 'patch' && !options.attrs) options.attrs = attrs;\n var xhr = this.sync(method, this, options);\n\n // Restore attributes.\n this.attributes = attributes;\n\n return xhr;\n },\n\n // Destroy this model on the server if it was already persisted.\n // Optimistically removes the model from its collection, if it has one.\n // If `wait: true` is passed, waits for the server to respond before removal.\n destroy: function(options) {\n options = options ? _.clone(options) : {};\n var model = this;\n var success = options.success;\n var wait = options.wait;\n\n var destroy = function() {\n model.stopListening();\n model.trigger('destroy', model, model.collection, options);\n };\n\n options.success = function(resp) {\n if (wait) destroy();\n if (success) success.call(options.context, model, resp, options);\n if (!model.isNew()) model.trigger('sync', model, resp, options);\n };\n\n var xhr = false;\n if (this.isNew()) {\n _.defer(options.success);\n } else {\n wrapError(this, options);\n xhr = this.sync('delete', this, options);\n }\n if (!wait) destroy();\n return xhr;\n },\n\n // Default URL for the model's representation on the server -- if you're\n // using Backbone's restful methods, override this to change the endpoint\n // that will be called.\n url: function() {\n var base =\n _.result(this, 'urlRoot') ||\n _.result(this.collection, 'url') ||\n urlError();\n if (this.isNew()) return base;\n var id = this.get(this.idAttribute);\n return base.replace(/[^\\/]$/, '$&/') + encodeURIComponent(id);\n },\n\n // **parse** converts a response into the hash of attributes to be `set` on\n // the model. The default implementation is just to pass the response along.\n parse: function(resp, options) {\n return resp;\n },\n\n // Create a new model with identical attributes to this one.\n clone: function() {\n return new this.constructor(this.attributes);\n },\n\n // A model is new if it has never been saved to the server, and lacks an id.\n isNew: function() {\n return !this.has(this.idAttribute);\n },\n\n // Check if the model is currently in a valid state.\n isValid: function(options) {\n return this._validate({}, _.extend({}, options, {validate: true}));\n },\n\n // Run validation against the next complete set of model attributes,\n // returning `true` if all is well. Otherwise, fire an `\"invalid\"` event.\n _validate: function(attrs, options) {\n if (!options.validate || !this.validate) return true;\n attrs = _.extend({}, this.attributes, attrs);\n var error = this.validationError = this.validate(attrs, options) || null;\n if (!error) return true;\n this.trigger('invalid', this, error, _.extend(options, {validationError: error}));\n return false;\n }\n\n });\n\n // Underscore methods that we want to implement on the Model, mapped to the\n // number of arguments they take.\n var modelMethods = {keys: 1, values: 1, pairs: 1, invert: 1, pick: 0,\n omit: 0, chain: 1, isEmpty: 1};\n\n // Mix in each Underscore method as a proxy to `Model#attributes`.\n addUnderscoreMethods(Model, modelMethods, 'attributes');\n\n // Backbone.Collection\n // -------------------\n\n // If models tend to represent a single row of data, a Backbone Collection is\n // more analogous to a table full of data ... or a small slice or page of that\n // table, or a collection of rows that belong together for a particular reason\n // -- all of the messages in this particular folder, all of the documents\n // belonging to this particular author, and so on. Collections maintain\n // indexes of their models, both in order, and for lookup by `id`.\n\n // Create a new **Collection**, perhaps to contain a specific type of `model`.\n // If a `comparator` is specified, the Collection will maintain\n // its models in sort order, as they're added and removed.\n var Collection = Backbone.Collection = function(models, options) {\n options || (options = {});\n if (options.model) this.model = options.model;\n if (options.comparator !== void 0) this.comparator = options.comparator;\n this._reset();\n this.initialize.apply(this, arguments);\n if (models) this.reset(models, _.extend({silent: true}, options));\n };\n\n // Default options for `Collection#set`.\n var setOptions = {add: true, remove: true, merge: true};\n var addOptions = {add: true, remove: false};\n\n // Splices `insert` into `array` at index `at`.\n var splice = function(array, insert, at) {\n at = Math.min(Math.max(at, 0), array.length);\n var tail = Array(array.length - at);\n var length = insert.length;\n var i;\n for (i = 0; i < tail.length; i++) tail[i] = array[i + at];\n for (i = 0; i < length; i++) array[i + at] = insert[i];\n for (i = 0; i < tail.length; i++) array[i + length + at] = tail[i];\n };\n\n // Define the Collection's inheritable methods.\n _.extend(Collection.prototype, Events, {\n\n // The default model for a collection is just a **Backbone.Model**.\n // This should be overridden in most cases.\n model: Model,\n\n // Initialize is an empty function by default. Override it with your own\n // initialization logic.\n initialize: function(){},\n\n // The JSON representation of a Collection is an array of the\n // models' attributes.\n toJSON: function(options) {\n return this.map(function(model) { return model.toJSON(options); });\n },\n\n // Proxy `Backbone.sync` by default.\n sync: function() {\n return Backbone.sync.apply(this, arguments);\n },\n\n // Add a model, or list of models to the set. `models` may be Backbone\n // Models or raw JavaScript objects to be converted to Models, or any\n // combination of the two.\n add: function(models, options) {\n return this.set(models, _.extend({merge: false}, options, addOptions));\n },\n\n // Remove a model, or a list of models from the set.\n remove: function(models, options) {\n options = _.extend({}, options);\n var singular = !_.isArray(models);\n models = singular ? [models] : models.slice();\n var removed = this._removeModels(models, options);\n if (!options.silent && removed.length) {\n options.changes = {added: [], merged: [], removed: removed};\n this.trigger('update', this, options);\n }\n return singular ? removed[0] : removed;\n },\n\n // Update a collection by `set`-ing a new list of models, adding new ones,\n // removing models that are no longer present, and merging models that\n // already exist in the collection, as necessary. Similar to **Model#set**,\n // the core operation for updating the data contained by the collection.\n set: function(models, options) {\n if (models == null) return;\n\n options = _.extend({}, setOptions, options);\n if (options.parse && !this._isModel(models)) {\n models = this.parse(models, options) || [];\n }\n\n var singular = !_.isArray(models);\n models = singular ? [models] : models.slice();\n\n var at = options.at;\n if (at != null) at = +at;\n if (at > this.length) at = this.length;\n if (at < 0) at += this.length + 1;\n\n var set = [];\n var toAdd = [];\n var toMerge = [];\n var toRemove = [];\n var modelMap = {};\n\n var add = options.add;\n var merge = options.merge;\n var remove = options.remove;\n\n var sort = false;\n var sortable = this.comparator && at == null && options.sort !== false;\n var sortAttr = _.isString(this.comparator) ? this.comparator : null;\n\n // Turn bare objects into model references, and prevent invalid models\n // from being added.\n var model, i;\n for (i = 0; i < models.length; i++) {\n model = models[i];\n\n // If a duplicate is found, prevent it from being added and\n // optionally merge it into the existing model.\n var existing = this.get(model);\n if (existing) {\n if (merge && model !== existing) {\n var attrs = this._isModel(model) ? model.attributes : model;\n if (options.parse) attrs = existing.parse(attrs, options);\n existing.set(attrs, options);\n toMerge.push(existing);\n if (sortable && !sort) sort = existing.hasChanged(sortAttr);\n }\n if (!modelMap[existing.cid]) {\n modelMap[existing.cid] = true;\n set.push(existing);\n }\n models[i] = existing;\n\n // If this is a new, valid model, push it to the `toAdd` list.\n } else if (add) {\n model = models[i] = this._prepareModel(model, options);\n if (model) {\n toAdd.push(model);\n this._addReference(model, options);\n modelMap[model.cid] = true;\n set.push(model);\n }\n }\n }\n\n // Remove stale models.\n if (remove) {\n for (i = 0; i < this.length; i++) {\n model = this.models[i];\n if (!modelMap[model.cid]) toRemove.push(model);\n }\n if (toRemove.length) this._removeModels(toRemove, options);\n }\n\n // See if sorting is needed, update `length` and splice in new models.\n var orderChanged = false;\n var replace = !sortable && add && remove;\n if (set.length && replace) {\n orderChanged = this.length !== set.length || _.some(this.models, function(m, index) {\n return m !== set[index];\n });\n this.models.length = 0;\n splice(this.models, set, 0);\n this.length = this.models.length;\n } else if (toAdd.length) {\n if (sortable) sort = true;\n splice(this.models, toAdd, at == null ? this.length : at);\n this.length = this.models.length;\n }\n\n // Silently sort the collection if appropriate.\n if (sort) this.sort({silent: true});\n\n // Unless silenced, it's time to fire all appropriate add/sort/update events.\n if (!options.silent) {\n for (i = 0; i < toAdd.length; i++) {\n if (at != null) options.index = at + i;\n model = toAdd[i];\n model.trigger('add', model, this, options);\n }\n if (sort || orderChanged) this.trigger('sort', this, options);\n if (toAdd.length || toRemove.length || toMerge.length) {\n options.changes = {\n added: toAdd,\n removed: toRemove,\n merged: toMerge\n };\n this.trigger('update', this, options);\n }\n }\n\n // Return the added (or merged) model (or models).\n return singular ? models[0] : models;\n },\n\n // When you have more items than you want to add or remove individually,\n // you can reset the entire set with a new list of models, without firing\n // any granular `add` or `remove` events. Fires `reset` when finished.\n // Useful for bulk operations and optimizations.\n reset: function(models, options) {\n options = options ? _.clone(options) : {};\n for (var i = 0; i < this.models.length; i++) {\n this._removeReference(this.models[i], options);\n }\n options.previousModels = this.models;\n this._reset();\n models = this.add(models, _.extend({silent: true}, options));\n if (!options.silent) this.trigger('reset', this, options);\n return models;\n },\n\n // Add a model to the end of the collection.\n push: function(model, options) {\n return this.add(model, _.extend({at: this.length}, options));\n },\n\n // Remove a model from the end of the collection.\n pop: function(options) {\n var model = this.at(this.length - 1);\n return this.remove(model, options);\n },\n\n // Add a model to the beginning of the collection.\n unshift: function(model, options) {\n return this.add(model, _.extend({at: 0}, options));\n },\n\n // Remove a model from the beginning of the collection.\n shift: function(options) {\n var model = this.at(0);\n return this.remove(model, options);\n },\n\n // Slice out a sub-array of models from the collection.\n slice: function() {\n return slice.apply(this.models, arguments);\n },\n\n // Get a model from the set by id, cid, model object with id or cid\n // properties, or an attributes object that is transformed through modelId.\n get: function(obj) {\n if (obj == null) return void 0;\n return this._byId[obj] ||\n this._byId[this.modelId(obj.attributes || obj)] ||\n obj.cid && this._byId[obj.cid];\n },\n\n // Returns `true` if the model is in the collection.\n has: function(obj) {\n return this.get(obj) != null;\n },\n\n // Get the model at the given index.\n at: function(index) {\n if (index < 0) index += this.length;\n return this.models[index];\n },\n\n // Return models with matching attributes. Useful for simple cases of\n // `filter`.\n where: function(attrs, first) {\n return this[first ? 'find' : 'filter'](attrs);\n },\n\n // Return the first model with matching attributes. Useful for simple cases\n // of `find`.\n findWhere: function(attrs) {\n return this.where(attrs, true);\n },\n\n // Force the collection to re-sort itself. You don't need to call this under\n // normal circumstances, as the set will maintain sort order as each item\n // is added.\n sort: function(options) {\n var comparator = this.comparator;\n if (!comparator) throw new Error('Cannot sort a set without a comparator');\n options || (options = {});\n\n var length = comparator.length;\n if (_.isFunction(comparator)) comparator = _.bind(comparator, this);\n\n // Run sort based on type of `comparator`.\n if (length === 1 || _.isString(comparator)) {\n this.models = this.sortBy(comparator);\n } else {\n this.models.sort(comparator);\n }\n if (!options.silent) this.trigger('sort', this, options);\n return this;\n },\n\n // Pluck an attribute from each model in the collection.\n pluck: function(attr) {\n return this.map(attr + '');\n },\n\n // Fetch the default set of models for this collection, resetting the\n // collection when they arrive. If `reset: true` is passed, the response\n // data will be passed through the `reset` method instead of `set`.\n fetch: function(options) {\n options = _.extend({parse: true}, options);\n var success = options.success;\n var collection = this;\n options.success = function(resp) {\n var method = options.reset ? 'reset' : 'set';\n collection[method](resp, options);\n if (success) success.call(options.context, collection, resp, options);\n collection.trigger('sync', collection, resp, options);\n };\n wrapError(this, options);\n return this.sync('read', this, options);\n },\n\n // Create a new instance of a model in this collection. Add the model to the\n // collection immediately, unless `wait: true` is passed, in which case we\n // wait for the server to agree.\n create: function(model, options) {\n options = options ? _.clone(options) : {};\n var wait = options.wait;\n model = this._prepareModel(model, options);\n if (!model) return false;\n if (!wait) this.add(model, options);\n var collection = this;\n var success = options.success;\n options.success = function(m, resp, callbackOpts) {\n if (wait) collection.add(m, callbackOpts);\n if (success) success.call(callbackOpts.context, m, resp, callbackOpts);\n };\n model.save(null, options);\n return model;\n },\n\n // **parse** converts a response into a list of models to be added to the\n // collection. The default implementation is just to pass it through.\n parse: function(resp, options) {\n return resp;\n },\n\n // Create a new collection with an identical list of models as this one.\n clone: function() {\n return new this.constructor(this.models, {\n model: this.model,\n comparator: this.comparator\n });\n },\n\n // Define how to uniquely identify models in the collection.\n modelId: function(attrs) {\n return attrs[this.model.prototype.idAttribute || 'id'];\n },\n\n // Private method to reset all internal state. Called when the collection\n // is first initialized or reset.\n _reset: function() {\n this.length = 0;\n this.models = [];\n this._byId = {};\n },\n\n // Prepare a hash of attributes (or other model) to be added to this\n // collection.\n _prepareModel: function(attrs, options) {\n if (this._isModel(attrs)) {\n if (!attrs.collection) attrs.collection = this;\n return attrs;\n }\n options = options ? _.clone(options) : {};\n options.collection = this;\n var model = new this.model(attrs, options);\n if (!model.validationError) return model;\n this.trigger('invalid', this, model.validationError, options);\n return false;\n },\n\n // Internal method called by both remove and set.\n _removeModels: function(models, options) {\n var removed = [];\n for (var i = 0; i < models.length; i++) {\n var model = this.get(models[i]);\n if (!model) continue;\n\n var index = this.indexOf(model);\n this.models.splice(index, 1);\n this.length--;\n\n // Remove references before triggering 'remove' event to prevent an\n // infinite loop. #3693\n delete this._byId[model.cid];\n var id = this.modelId(model.attributes);\n if (id != null) delete this._byId[id];\n\n if (!options.silent) {\n options.index = index;\n model.trigger('remove', model, this, options);\n }\n\n removed.push(model);\n this._removeReference(model, options);\n }\n return removed;\n },\n\n // Method for checking whether an object should be considered a model for\n // the purposes of adding to the collection.\n _isModel: function(model) {\n return model instanceof Model;\n },\n\n // Internal method to create a model's ties to a collection.\n _addReference: function(model, options) {\n this._byId[model.cid] = model;\n var id = this.modelId(model.attributes);\n if (id != null) this._byId[id] = model;\n model.on('all', this._onModelEvent, this);\n },\n\n // Internal method to sever a model's ties to a collection.\n _removeReference: function(model, options) {\n delete this._byId[model.cid];\n var id = this.modelId(model.attributes);\n if (id != null) delete this._byId[id];\n if (this === model.collection) delete model.collection;\n model.off('all', this._onModelEvent, this);\n },\n\n // Internal method called every time a model in the set fires an event.\n // Sets need to update their indexes when models change ids. All other\n // events simply proxy through. \"add\" and \"remove\" events that originate\n // in other collections are ignored.\n _onModelEvent: function(event, model, collection, options) {\n if (model) {\n if ((event === 'add' || event === 'remove') && collection !== this) return;\n if (event === 'destroy') this.remove(model, options);\n if (event === 'change') {\n var prevId = this.modelId(model.previousAttributes());\n var id = this.modelId(model.attributes);\n if (prevId !== id) {\n if (prevId != null) delete this._byId[prevId];\n if (id != null) this._byId[id] = model;\n }\n }\n }\n this.trigger.apply(this, arguments);\n }\n\n });\n\n // Underscore methods that we want to implement on the Collection.\n // 90% of the core usefulness of Backbone Collections is actually implemented\n // right here:\n var collectionMethods = {forEach: 3, each: 3, map: 3, collect: 3, reduce: 0,\n foldl: 0, inject: 0, reduceRight: 0, foldr: 0, find: 3, detect: 3, filter: 3,\n select: 3, reject: 3, every: 3, all: 3, some: 3, any: 3, include: 3, includes: 3,\n contains: 3, invoke: 0, max: 3, min: 3, toArray: 1, size: 1, first: 3,\n head: 3, take: 3, initial: 3, rest: 3, tail: 3, drop: 3, last: 3,\n without: 0, difference: 0, indexOf: 3, shuffle: 1, lastIndexOf: 3,\n isEmpty: 1, chain: 1, sample: 3, partition: 3, groupBy: 3, countBy: 3,\n sortBy: 3, indexBy: 3, findIndex: 3, findLastIndex: 3};\n\n // Mix in each Underscore method as a proxy to `Collection#models`.\n addUnderscoreMethods(Collection, collectionMethods, 'models');\n\n // Backbone.View\n // -------------\n\n // Backbone Views are almost more convention than they are actual code. A View\n // is simply a JavaScript object that represents a logical chunk of UI in the\n // DOM. This might be a single item, an entire list, a sidebar or panel, or\n // even the surrounding frame which wraps your whole app. Defining a chunk of\n // UI as a **View** allows you to define your DOM events declaratively, without\n // having to worry about render order ... and makes it easy for the view to\n // react to specific changes in the state of your models.\n\n // Creating a Backbone.View creates its initial element outside of the DOM,\n // if an existing element is not provided...\n var View = Backbone.View = function(options) {\n this.cid = _.uniqueId('view');\n _.extend(this, _.pick(options, viewOptions));\n this._ensureElement();\n this.initialize.apply(this, arguments);\n };\n\n // Cached regex to split keys for `delegate`.\n var delegateEventSplitter = /^(\\S+)\\s*(.*)$/;\n\n // List of view options to be set as properties.\n var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];\n\n // Set up all inheritable **Backbone.View** properties and methods.\n _.extend(View.prototype, Events, {\n\n // The default `tagName` of a View's element is `\"div\"`.\n tagName: 'div',\n\n // jQuery delegate for element lookup, scoped to DOM elements within the\n // current view. This should be preferred to global lookups where possible.\n $: function(selector) {\n return this.$el.find(selector);\n },\n\n // Initialize is an empty function by default. Override it with your own\n // initialization logic.\n initialize: function(){},\n\n // **render** is the core function that your view should override, in order\n // to populate its element (`this.el`), with the appropriate HTML. The\n // convention is for **render** to always return `this`.\n render: function() {\n return this;\n },\n\n // Remove this view by taking the element out of the DOM, and removing any\n // applicable Backbone.Events listeners.\n remove: function() {\n this._removeElement();\n this.stopListening();\n return this;\n },\n\n // Remove this view's element from the document and all event listeners\n // attached to it. Exposed for subclasses using an alternative DOM\n // manipulation API.\n _removeElement: function() {\n this.$el.remove();\n },\n\n // Change the view's element (`this.el` property) and re-delegate the\n // view's events on the new element.\n setElement: function(element) {\n this.undelegateEvents();\n this._setElement(element);\n this.delegateEvents();\n return this;\n },\n\n // Creates the `this.el` and `this.$el` references for this view using the\n // given `el`. `el` can be a CSS selector or an HTML string, a jQuery\n // context or an element. Subclasses can override this to utilize an\n // alternative DOM manipulation API and are only required to set the\n // `this.el` property.\n _setElement: function(el) {\n this.$el = el instanceof Backbone.$ ? el : Backbone.$(el);\n this.el = this.$el[0];\n },\n\n // Set callbacks, where `this.events` is a hash of\n //\n // *{\"event selector\": \"callback\"}*\n //\n // {\n // 'mousedown .title': 'edit',\n // 'click .button': 'save',\n // 'click .open': function(e) { ... }\n // }\n //\n // pairs. Callbacks will be bound to the view, with `this` set properly.\n // Uses event delegation for efficiency.\n // Omitting the selector binds the event to `this.el`.\n delegateEvents: function(events) {\n events || (events = _.result(this, 'events'));\n if (!events) return this;\n this.undelegateEvents();\n for (var key in events) {\n var method = events[key];\n if (!_.isFunction(method)) method = this[method];\n if (!method) continue;\n var match = key.match(delegateEventSplitter);\n this.delegate(match[1], match[2], _.bind(method, this));\n }\n return this;\n },\n\n // Add a single event listener to the view's element (or a child element\n // using `selector`). This only works for delegate-able events: not `focus`,\n // `blur`, and not `change`, `submit`, and `reset` in Internet Explorer.\n delegate: function(eventName, selector, listener) {\n this.$el.on(eventName + '.delegateEvents' + this.cid, selector, listener);\n return this;\n },\n\n // Clears all callbacks previously bound to the view by `delegateEvents`.\n // You usually don't need to use this, but may wish to if you have multiple\n // Backbone views attached to the same DOM element.\n undelegateEvents: function() {\n if (this.$el) this.$el.off('.delegateEvents' + this.cid);\n return this;\n },\n\n // A finer-grained `undelegateEvents` for removing a single delegated event.\n // `selector` and `listener` are both optional.\n undelegate: function(eventName, selector, listener) {\n this.$el.off(eventName + '.delegateEvents' + this.cid, selector, listener);\n return this;\n },\n\n // Produces a DOM element to be assigned to your view. Exposed for\n // subclasses using an alternative DOM manipulation API.\n _createElement: function(tagName) {\n return document.createElement(tagName);\n },\n\n // Ensure that the View has a DOM element to render into.\n // If `this.el` is a string, pass it through `$()`, take the first\n // matching element, and re-assign it to `el`. Otherwise, create\n // an element from the `id`, `className` and `tagName` properties.\n _ensureElement: function() {\n if (!this.el) {\n var attrs = _.extend({}, _.result(this, 'attributes'));\n if (this.id) attrs.id = _.result(this, 'id');\n if (this.className) attrs['class'] = _.result(this, 'className');\n this.setElement(this._createElement(_.result(this, 'tagName')));\n this._setAttributes(attrs);\n } else {\n this.setElement(_.result(this, 'el'));\n }\n },\n\n // Set attributes from a hash on this view's element. Exposed for\n // subclasses using an alternative DOM manipulation API.\n _setAttributes: function(attributes) {\n this.$el.attr(attributes);\n }\n\n });\n\n // Backbone.sync\n // -------------\n\n // Override this function to change the manner in which Backbone persists\n // models to the server. You will be passed the type of request, and the\n // model in question. By default, makes a RESTful Ajax request\n // to the model's `url()`. Some possible customizations could be:\n //\n // * Use `setTimeout` to batch rapid-fire updates into a single request.\n // * Send up the models as XML instead of JSON.\n // * Persist models via WebSockets instead of Ajax.\n //\n // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests\n // as `POST`, with a `_method` parameter containing the true HTTP method,\n // as well as all requests with the body as `application/x-www-form-urlencoded`\n // instead of `application/json` with the model in a param named `model`.\n // Useful when interfacing with server-side languages like **PHP** that make\n // it difficult to read the body of `PUT` requests.\n Backbone.sync = function(method, model, options) {\n var type = methodMap[method];\n\n // Default options, unless specified.\n _.defaults(options || (options = {}), {\n emulateHTTP: Backbone.emulateHTTP,\n emulateJSON: Backbone.emulateJSON\n });\n\n // Default JSON-request options.\n var params = {type: type, dataType: 'json'};\n\n // Ensure that we have a URL.\n if (!options.url) {\n params.url = _.result(model, 'url') || urlError();\n }\n\n // Ensure that we have the appropriate request data.\n if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {\n params.contentType = 'application/json';\n params.data = JSON.stringify(options.attrs || model.toJSON(options));\n }\n\n // For older servers, emulate JSON by encoding the request into an HTML-form.\n if (options.emulateJSON) {\n params.contentType = 'application/x-www-form-urlencoded';\n params.data = params.data ? {model: params.data} : {};\n }\n\n // For older servers, emulate HTTP by mimicking the HTTP method with `_method`\n // And an `X-HTTP-Method-Override` header.\n if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {\n params.type = 'POST';\n if (options.emulateJSON) params.data._method = type;\n var beforeSend = options.beforeSend;\n options.beforeSend = function(xhr) {\n xhr.setRequestHeader('X-HTTP-Method-Override', type);\n if (beforeSend) return beforeSend.apply(this, arguments);\n };\n }\n\n // Don't process data on a non-GET request.\n if (params.type !== 'GET' && !options.emulateJSON) {\n params.processData = false;\n }\n\n // Pass along `textStatus` and `errorThrown` from jQuery.\n var error = options.error;\n options.error = function(xhr, textStatus, errorThrown) {\n options.textStatus = textStatus;\n options.errorThrown = errorThrown;\n if (error) error.call(options.context, xhr, textStatus, errorThrown);\n };\n\n // Make the request, allowing the user to override any Ajax options.\n var xhr = options.xhr = Backbone.ajax(_.extend(params, options));\n model.trigger('request', model, xhr, options);\n return xhr;\n };\n\n // Map from CRUD to HTTP for our default `Backbone.sync` implementation.\n var methodMap = {\n 'create': 'POST',\n 'update': 'PUT',\n 'patch': 'PATCH',\n 'delete': 'DELETE',\n 'read': 'GET'\n };\n\n // Set the default implementation of `Backbone.ajax` to proxy through to `$`.\n // Override this if you'd like to use a different library.\n Backbone.ajax = function() {\n return Backbone.$.ajax.apply(Backbone.$, arguments);\n };\n\n // Backbone.Router\n // ---------------\n\n // Routers map faux-URLs to actions, and fire events when routes are\n // matched. Creating a new one sets its `routes` hash, if not set statically.\n var Router = Backbone.Router = function(options) {\n options || (options = {});\n if (options.routes) this.routes = options.routes;\n this._bindRoutes();\n this.initialize.apply(this, arguments);\n };\n\n // Cached regular expressions for matching named param parts and splatted\n // parts of route strings.\n var optionalParam = /\\((.*?)\\)/g;\n var namedParam = /(\\(\\?)?:\\w+/g;\n var splatParam = /\\*\\w+/g;\n var escapeRegExp = /[\\-{}\\[\\]+?.,\\\\\\^$|#\\s]/g;\n\n // Set up all inheritable **Backbone.Router** properties and methods.\n _.extend(Router.prototype, Events, {\n\n // Initialize is an empty function by default. Override it with your own\n // initialization logic.\n initialize: function(){},\n\n // Manually bind a single named route to a callback. For example:\n //\n // this.route('search/:query/p:num', 'search', function(query, num) {\n // ...\n // });\n //\n route: function(route, name, callback) {\n if (!_.isRegExp(route)) route = this._routeToRegExp(route);\n if (_.isFunction(name)) {\n callback = name;\n name = '';\n }\n if (!callback) callback = this[name];\n var router = this;\n Backbone.history.route(route, function(fragment) {\n var args = router._extractParameters(route, fragment);\n if (router.execute(callback, args, name) !== false) {\n router.trigger.apply(router, ['route:' + name].concat(args));\n router.trigger('route', name, args);\n Backbone.history.trigger('route', router, name, args);\n }\n });\n return this;\n },\n\n // Execute a route handler with the provided parameters. This is an\n // excellent place to do pre-route setup or post-route cleanup.\n execute: function(callback, args, name) {\n if (callback) callback.apply(this, args);\n },\n\n // Simple proxy to `Backbone.history` to save a fragment into the history.\n navigate: function(fragment, options) {\n Backbone.history.navigate(fragment, options);\n return this;\n },\n\n // Bind all defined routes to `Backbone.history`. We have to reverse the\n // order of the routes here to support behavior where the most general\n // routes can be defined at the bottom of the route map.\n _bindRoutes: function() {\n if (!this.routes) return;\n this.routes = _.result(this, 'routes');\n var route, routes = _.keys(this.routes);\n while ((route = routes.pop()) != null) {\n this.route(route, this.routes[route]);\n }\n },\n\n // Convert a route string into a regular expression, suitable for matching\n // against the current location hash.\n _routeToRegExp: function(route) {\n route = route.replace(escapeRegExp, '\\\\$&')\n .replace(optionalParam, '(?:$1)?')\n .replace(namedParam, function(match, optional) {\n return optional ? match : '([^/?]+)';\n })\n .replace(splatParam, '([^?]*?)');\n return new RegExp('^' + route + '(?:\\\\?([\\\\s\\\\S]*))?$');\n },\n\n // Given a route, and a URL fragment that it matches, return the array of\n // extracted decoded parameters. Empty or unmatched parameters will be\n // treated as `null` to normalize cross-browser behavior.\n _extractParameters: function(route, fragment) {\n var params = route.exec(fragment).slice(1);\n return _.map(params, function(param, i) {\n // Don't decode the search params.\n if (i === params.length - 1) return param || null;\n return param ? decodeURIComponent(param) : null;\n });\n }\n\n });\n\n // Backbone.History\n // ----------------\n\n // Handles cross-browser history management, based on either\n // [pushState](http://diveintohtml5.info/history.html) and real URLs, or\n // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)\n // and URL fragments. If the browser supports neither (old IE, natch),\n // falls back to polling.\n var History = Backbone.History = function() {\n this.handlers = [];\n this.checkUrl = _.bind(this.checkUrl, this);\n\n // Ensure that `History` can be used outside of the browser.\n if (typeof window !== 'undefined') {\n this.location = window.location;\n this.history = window.history;\n }\n };\n\n // Cached regex for stripping a leading hash/slash and trailing space.\n var routeStripper = /^[#\\/]|\\s+$/g;\n\n // Cached regex for stripping leading and trailing slashes.\n var rootStripper = /^\\/+|\\/+$/g;\n\n // Cached regex for stripping urls of hash.\n var pathStripper = /#.*$/;\n\n // Has the history handling already been started?\n History.started = false;\n\n // Set up all inheritable **Backbone.History** properties and methods.\n _.extend(History.prototype, Events, {\n\n // The default interval to poll for hash changes, if necessary, is\n // twenty times a second.\n interval: 50,\n\n // Are we at the app root?\n atRoot: function() {\n var path = this.location.pathname.replace(/[^\\/]$/, '$&/');\n return path === this.root && !this.getSearch();\n },\n\n // Does the pathname match the root?\n matchRoot: function() {\n var path = this.decodeFragment(this.location.pathname);\n var rootPath = path.slice(0, this.root.length - 1) + '/';\n return rootPath === this.root;\n },\n\n // Unicode characters in `location.pathname` are percent encoded so they're\n // decoded for comparison. `%25` should not be decoded since it may be part\n // of an encoded parameter.\n decodeFragment: function(fragment) {\n return decodeURI(fragment.replace(/%25/g, '%2525'));\n },\n\n // In IE6, the hash fragment and search params are incorrect if the\n // fragment contains `?`.\n getSearch: function() {\n var match = this.location.href.replace(/#.*/, '').match(/\\?.+/);\n return match ? match[0] : '';\n },\n\n // Gets the true hash value. Cannot use location.hash directly due to bug\n // in Firefox where location.hash will always be decoded.\n getHash: function(window) {\n var match = (window || this).location.href.match(/#(.*)$/);\n return match ? match[1] : '';\n },\n\n // Get the pathname and search params, without the root.\n getPath: function() {\n var path = this.decodeFragment(\n this.location.pathname + this.getSearch()\n ).slice(this.root.length - 1);\n return path.charAt(0) === '/' ? path.slice(1) : path;\n },\n\n // Get the cross-browser normalized URL fragment from the path or hash.\n getFragment: function(fragment) {\n if (fragment == null) {\n if (this._usePushState || !this._wantsHashChange) {\n fragment = this.getPath();\n } else {\n fragment = this.getHash();\n }\n }\n return fragment.replace(routeStripper, '');\n },\n\n // Start the hash change handling, returning `true` if the current URL matches\n // an existing route, and `false` otherwise.\n start: function(options) {\n if (History.started) throw new Error('Backbone.history has already been started');\n History.started = true;\n\n // Figure out the initial configuration. Do we need an iframe?\n // Is pushState desired ... is it available?\n this.options = _.extend({root: '/'}, this.options, options);\n this.root = this.options.root;\n this._wantsHashChange = this.options.hashChange !== false;\n this._hasHashChange = 'onhashchange' in window && (document.documentMode === void 0 || document.documentMode > 7);\n this._useHashChange = this._wantsHashChange && this._hasHashChange;\n this._wantsPushState = !!this.options.pushState;\n this._hasPushState = !!(this.history && this.history.pushState);\n this._usePushState = this._wantsPushState && this._hasPushState;\n this.fragment = this.getFragment();\n\n // Normalize root to always include a leading and trailing slash.\n this.root = ('/' + this.root + '/').replace(rootStripper, '/');\n\n // Transition from hashChange to pushState or vice versa if both are\n // requested.\n if (this._wantsHashChange && this._wantsPushState) {\n\n // If we've started off with a route from a `pushState`-enabled\n // browser, but we're currently in a browser that doesn't support it...\n if (!this._hasPushState && !this.atRoot()) {\n var rootPath = this.root.slice(0, -1) || '/';\n this.location.replace(rootPath + '#' + this.getPath());\n // Return immediately as browser will do redirect to new url\n return true;\n\n // Or if we've started out with a hash-based route, but we're currently\n // in a browser where it could be `pushState`-based instead...\n } else if (this._hasPushState && this.atRoot()) {\n this.navigate(this.getHash(), {replace: true});\n }\n\n }\n\n // Proxy an iframe to handle location events if the browser doesn't\n // support the `hashchange` event, HTML5 history, or the user wants\n // `hashChange` but not `pushState`.\n if (!this._hasHashChange && this._wantsHashChange && !this._usePushState) {\n this.iframe = document.createElement('iframe');\n this.iframe.src = 'javascript:0';\n this.iframe.style.display = 'none';\n this.iframe.tabIndex = -1;\n var body = document.body;\n // Using `appendChild` will throw on IE < 9 if the document is not ready.\n var iWindow = body.insertBefore(this.iframe, body.firstChild).contentWindow;\n iWindow.document.open();\n iWindow.document.close();\n iWindow.location.hash = '#' + this.fragment;\n }\n\n // Add a cross-platform `addEventListener` shim for older browsers.\n var addEventListener = window.addEventListener || function(eventName, listener) {\n return attachEvent('on' + eventName, listener);\n };\n\n // Depending on whether we're using pushState or hashes, and whether\n // 'onhashchange' is supported, determine how we check the URL state.\n if (this._usePushState) {\n addEventListener('popstate', this.checkUrl, false);\n } else if (this._useHashChange && !this.iframe) {\n addEventListener('hashchange', this.checkUrl, false);\n } else if (this._wantsHashChange) {\n this._checkUrlInterval = setInterval(this.checkUrl, this.interval);\n }\n\n if (!this.options.silent) return this.loadUrl();\n },\n\n // Disable Backbone.history, perhaps temporarily. Not useful in a real app,\n // but possibly useful for unit testing Routers.\n stop: function() {\n // Add a cross-platform `removeEventListener` shim for older browsers.\n var removeEventListener = window.removeEventListener || function(eventName, listener) {\n return detachEvent('on' + eventName, listener);\n };\n\n // Remove window listeners.\n if (this._usePushState) {\n removeEventListener('popstate', this.checkUrl, false);\n } else if (this._useHashChange && !this.iframe) {\n removeEventListener('hashchange', this.checkUrl, false);\n }\n\n // Clean up the iframe if necessary.\n if (this.iframe) {\n document.body.removeChild(this.iframe);\n this.iframe = null;\n }\n\n // Some environments will throw when clearing an undefined interval.\n if (this._checkUrlInterval) clearInterval(this._checkUrlInterval);\n History.started = false;\n },\n\n // Add a route to be tested when the fragment changes. Routes added later\n // may override previous routes.\n route: function(route, callback) {\n this.handlers.unshift({route: route, callback: callback});\n },\n\n // Checks the current URL to see if it has changed, and if it has,\n // calls `loadUrl`, normalizing across the hidden iframe.\n checkUrl: function(e) {\n var current = this.getFragment();\n\n // If the user pressed the back button, the iframe's hash will have\n // changed and we should use that for comparison.\n if (current === this.fragment && this.iframe) {\n current = this.getHash(this.iframe.contentWindow);\n }\n\n if (current === this.fragment) return false;\n if (this.iframe) this.navigate(current);\n this.loadUrl();\n },\n\n // Attempt to load the current URL fragment. If a route succeeds with a\n // match, returns `true`. If no defined routes matches the fragment,\n // returns `false`.\n loadUrl: function(fragment) {\n // If the root doesn't match, no routes can match either.\n if (!this.matchRoot()) return false;\n fragment = this.fragment = this.getFragment(fragment);\n return _.some(this.handlers, function(handler) {\n if (handler.route.test(fragment)) {\n handler.callback(fragment);\n return true;\n }\n });\n },\n\n // Save a fragment into the hash history, or replace the URL state if the\n // 'replace' option is passed. You are responsible for properly URL-encoding\n // the fragment in advance.\n //\n // The options object can contain `trigger: true` if you wish to have the\n // route callback be fired (not usually desirable), or `replace: true`, if\n // you wish to modify the current URL without adding an entry to the history.\n navigate: function(fragment, options) {\n if (!History.started) return false;\n if (!options || options === true) options = {trigger: !!options};\n\n // Normalize the fragment.\n fragment = this.getFragment(fragment || '');\n\n // Don't include a trailing slash on the root.\n var rootPath = this.root;\n if (fragment === '' || fragment.charAt(0) === '?') {\n rootPath = rootPath.slice(0, -1) || '/';\n }\n var url = rootPath + fragment;\n\n // Strip the hash and decode for matching.\n fragment = this.decodeFragment(fragment.replace(pathStripper, ''));\n\n if (this.fragment === fragment) return;\n this.fragment = fragment;\n\n // If pushState is available, we use it to set the fragment as a real URL.\n if (this._usePushState) {\n this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);\n\n // If hash changes haven't been explicitly disabled, update the hash\n // fragment to store history.\n } else if (this._wantsHashChange) {\n this._updateHash(this.location, fragment, options.replace);\n if (this.iframe && fragment !== this.getHash(this.iframe.contentWindow)) {\n var iWindow = this.iframe.contentWindow;\n\n // Opening and closing the iframe tricks IE7 and earlier to push a\n // history entry on hash-tag change. When replace is true, we don't\n // want this.\n if (!options.replace) {\n iWindow.document.open();\n iWindow.document.close();\n }\n\n this._updateHash(iWindow.location, fragment, options.replace);\n }\n\n // If you've told us that you explicitly don't want fallback hashchange-\n // based history, then `navigate` becomes a page refresh.\n } else {\n return this.location.assign(url);\n }\n if (options.trigger) return this.loadUrl(fragment);\n },\n\n // Update the hash location, either replacing the current entry, or adding\n // a new one to the browser history.\n _updateHash: function(location, fragment, replace) {\n if (replace) {\n var href = location.href.replace(/(javascript:|#).*$/, '');\n location.replace(href + '#' + fragment);\n } else {\n // Some browsers require that `hash` contains a leading #.\n location.hash = '#' + fragment;\n }\n }\n\n });\n\n // Create the default Backbone.history.\n Backbone.history = new History;\n\n // Helpers\n // -------\n\n // Helper function to correctly set up the prototype chain for subclasses.\n // Similar to `goog.inherits`, but uses a hash of prototype properties and\n // class properties to be extended.\n var extend = function(protoProps, staticProps) {\n var parent = this;\n var child;\n\n // The constructor function for the new subclass is either defined by you\n // (the \"constructor\" property in your `extend` definition), or defaulted\n // by us to simply call the parent constructor.\n if (protoProps && _.has(protoProps, 'constructor')) {\n child = protoProps.constructor;\n } else {\n child = function(){ return parent.apply(this, arguments); };\n }\n\n // Add static properties to the constructor function, if supplied.\n _.extend(child, parent, staticProps);\n\n // Set the prototype chain to inherit from `parent`, without calling\n // `parent`'s constructor function and add the prototype properties.\n child.prototype = _.create(parent.prototype, protoProps);\n child.prototype.constructor = child;\n\n // Set a convenience property in case the parent's prototype is needed\n // later.\n child.__super__ = parent.prototype;\n\n return child;\n };\n\n // Set up inheritance for the model, collection, router, view and history.\n Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;\n\n // Throw an error when a URL is needed, and none is supplied.\n var urlError = function() {\n throw new Error('A \"url\" property or function must be specified');\n };\n\n // Wrap an optional error callback with a fallback error event.\n var wrapError = function(model, options) {\n var error = options.error;\n options.error = function(resp) {\n if (error) error.call(options.context, model, resp, options);\n model.trigger('error', model, resp, options);\n };\n };\n\n return Backbone;\n});\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","// Current version.\nexport var VERSION = '1.13.1';\n\n// Establish the root object, `window` (`self`) in the browser, `global`\n// on the server, or `this` in some virtual machines. We use `self`\n// instead of `window` for `WebWorker` support.\nexport var root = typeof self == 'object' && self.self === self && self ||\n typeof global == 'object' && global.global === global && global ||\n Function('return this')() ||\n {};\n\n// Save bytes in the minified (but not gzipped) version:\nexport var ArrayProto = Array.prototype, ObjProto = Object.prototype;\nexport var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;\n\n// Create quick reference variables for speed access to core prototypes.\nexport var push = ArrayProto.push,\n slice = ArrayProto.slice,\n toString = ObjProto.toString,\n hasOwnProperty = ObjProto.hasOwnProperty;\n\n// Modern feature detection.\nexport var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',\n supportsDataView = typeof DataView !== 'undefined';\n\n// All **ECMAScript 5+** native function implementations that we hope to use\n// are declared here.\nexport var nativeIsArray = Array.isArray,\n nativeKeys = Object.keys,\n nativeCreate = Object.create,\n nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;\n\n// Create references to these builtin functions because we override them.\nexport var _isNaN = isNaN,\n _isFinite = isFinite;\n\n// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.\nexport var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');\nexport var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',\n 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n\n// The largest integer that can be represented exactly.\nexport var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;\n","var setPrototypeOf = require(\"./setPrototypeOf.js\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var _typeof = require(\"@babel/runtime/helpers/typeof\")[\"default\"];\n\nvar assertThisInitialized = require(\"./assertThisInitialized.js\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","import Backbone from 'backbone';\nimport { isUndefined } from 'underscore';\n\nexport default Backbone.Model.extend({\n defaults: {\n type: 'text', // text, number, range, select\n label: '',\n name: '',\n min: '',\n max: '',\n unit: '',\n step: 1,\n value: '',\n target: '',\n default: '',\n placeholder: '',\n changeProp: 0,\n options: []\n },\n\n initialize() {\n const target = this.get('target');\n const name = this.get('name');\n const changeProp = this.get('changeProp');\n !this.get('id') && this.set('id', name);\n\n if (target) {\n this.target = target;\n this.unset('target');\n const targetEvent = changeProp\n ? `change:${name}`\n : `change:attributes:${name}`;\n this.listenTo(target, targetEvent, this.targetUpdated);\n }\n },\n\n /**\n * Return all the propeties\n * @returns {Object}\n */\n props() {\n return this.attributes;\n },\n\n targetUpdated() {\n const value = this.getTargetValue();\n this.set({ value }, { fromTarget: 1 });\n },\n\n getTargetValue() {\n const name = this.get('name');\n const target = this.target;\n let value;\n\n if (this.get('changeProp')) {\n value = target.get(name);\n } else {\n value = target.getAttributes()[name];\n }\n\n return !isUndefined(value) ? value : '';\n },\n\n setTargetValue(value, opts = {}) {\n const target = this.target;\n const name = this.get('name');\n if (isUndefined(value)) return;\n let valueToSet = value;\n\n if (value === 'false') {\n valueToSet = false;\n } else if (value === 'true') {\n valueToSet = true;\n }\n\n if (this.get('changeProp')) {\n target.set(name, valueToSet, opts);\n } else {\n const attrs = { ...target.get('attributes') };\n attrs[name] = valueToSet;\n target.set('attributes', attrs, opts);\n }\n },\n\n setValueFromInput(value, final = 1, opts = {}) {\n const toSet = { value };\n this.set(toSet, { ...opts, avoidStore: 1 });\n\n // Have to trigger the change\n if (final) {\n this.set('value', '', opts);\n this.set(toSet, opts);\n }\n },\n\n /**\n * Get the initial value of the trait\n * @return {string}\n */\n getInitValue() {\n const target = this.target;\n const name = this.get('name');\n let value;\n\n if (target) {\n const attrs = target.get('attributes');\n value = this.get('changeProp') ? target.get(name) : attrs[name];\n }\n\n return value || this.get('value') || this.get('default');\n }\n});\n","import Backbone from 'backbone';\nimport { isString, isArray } from 'underscore';\nimport Trait from './Trait';\nimport TraitFactory from './TraitFactory';\n\nexport default Backbone.Collection.extend({\n model: Trait,\n\n initialize(coll, options = {}) {\n this.em = options.em || '';\n this.listenTo(this, 'add', this.handleAdd);\n this.listenTo(this, 'reset', this.handleReset);\n },\n\n handleReset(coll, { previousModels = [] } = {}) {\n previousModels.forEach(model => model.trigger('remove'));\n },\n\n handleAdd(model) {\n const target = this.target;\n\n if (target) {\n model.target = target;\n }\n },\n\n setTarget(target) {\n this.target = target;\n },\n\n add(models, opt) {\n const em = this.em;\n\n // Use TraitFactory if necessary\n if (isString(models) || isArray(models)) {\n const tm = em && em.get && em.get('TraitManager');\n const tmOpts = tm && tm.getConfig();\n const tf = TraitFactory(tmOpts);\n\n if (isString(models)) {\n models = [models];\n }\n\n for (var i = 0, len = models.length; i < len; i++) {\n const str = models[i];\n const model = isString(str) ? tf.build(str)[0] : str;\n model.target = this.target;\n models[i] = model;\n }\n }\n\n return Backbone.Collection.prototype.add.apply(this, [models, opt]);\n }\n});\n","export default (config = {}) => ({\n /**\n * Build props object by their name\n * @param {Array|string} props Array of properties name\n * @return {Array}\n */\n build(props) {\n const objs = [];\n\n if (typeof props === 'string') props = [props];\n\n for (let i = 0; i < props.length; i++) {\n const obj = {};\n const prop = props[i];\n obj.name = prop;\n\n switch (prop) {\n case 'target':\n obj.type = 'select';\n obj.default = false;\n obj.options = config.optionsTarget;\n break;\n }\n\n objs.push(obj);\n }\n\n return objs;\n }\n});\n","import {\n isUndefined,\n isFunction,\n isArray,\n isEmpty,\n isBoolean,\n has,\n isString,\n forEach,\n result,\n bindAll,\n keys\n} from 'underscore';\nimport {\n shallowDiff,\n capitalize,\n isEmptyObj,\n isObject,\n toLowerCase\n} from 'utils/mixins';\nimport Styleable from 'domain_abstract/model/Styleable';\nimport { Model } from 'backbone';\nimport Components from './Components';\nimport Selector from 'selector_manager/model/Selector';\nimport Selectors from 'selector_manager/model/Selectors';\nimport Traits from 'trait_manager/model/Traits';\n\nconst escapeRegExp = str => {\n return str.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n};\n\nconst avoidInline = em => em && em.getConfig('avoidInlineStyle');\n\nexport const eventDrag = 'component:drag';\nexport const keySymbols = '__symbols';\nexport const keySymbol = '__symbol';\nexport const keySymbolOvrd = '__symbol_ovrd';\nexport const keyUpdate = 'component:update';\nexport const keyUpdateInside = `${keyUpdate}-inside`;\n\n/**\n * The Component object represents a single node of our template structure, so when you update its properties the changes are\n * immediately reflected on the canvas and in the code to export (indeed, when you ask to export the code we just go through all\n * the tree of nodes).\n * An example on how to update properties:\n * ```js\n * component.set({\n * tagName: 'span',\n * attributes: { ... },\n * removable: false,\n * });\n * component.get('tagName');\n * // -> 'span'\n * ```\n *\n * [Component]: component.html\n *\n * @typedef Component\n * @property {String} [type=''] Component type, eg. `text`, `image`, `video`, etc.\n * @property {String} [tagName='div'] HTML tag of the component, eg. `span`. Default: `div`\n * @property {Object} [attributes={}] Key-value object of the component's attributes, eg. `{ title: 'Hello' }` Default: `{}`\n * @property {String} [name=''] Name of the component. Will be used, for example, in Layers and badges\n * @property {Boolean} [removable=true] When `true` the component is removable from the canvas, default: `true`\n * @property {Boolean|String} [draggable=true] Indicates if it's possible to drag the component inside others.\n * You can also specify a query string to indentify elements,\n * eg. `'.some-class[title=Hello], [data-gjs-type=column]'` means you can drag the component only inside elements\n * containing `some-class` class and `Hello` title, and `column` components. Default: `true`\n * @property {Boolean|String|Function} [droppable=true] Indicates if it's possible to drop other components inside. You can use\n * a query string as with `draggable`. In the case of a function, target and destination components are passed as arguments, return a Boolean to indicate if the drop is possible. Default: `true`\n * @property {Boolean} [badgable=true] Set to false if you don't want to see the badge (with the name) over the component. Default: `true`\n * @property {Boolean|Array} [stylable=true] True if it's possible to style the component.\n * You can also indicate an array of CSS properties which is possible to style, eg. `['color', 'width']`, all other properties\n * will be hidden from the style manager. Default: `true`\n * @property {Array} [stylable-require=[]] Indicate an array of style properties to show up which has been marked as `toRequire`. Default: `[]`\n * @property {Array} [unstylable=[]] Indicate an array of style properties which should be hidden from the style manager. Default: `[]`\n * @property {Boolean} [highlightable=true] It can be highlighted with 'dotted' borders if true. Default: `true`\n * @property {Boolean} [copyable=true] True if it's possible to clone the component. Default: `true`\n * @property {Boolean} [resizable=false] Indicates if it's possible to resize the component. It's also possible to pass an object as [options for the Resizer](https://github.com/artf/grapesjs/blob/master/src/utils/Resizer.js). Default: `false`\n * @property {Boolean} [editable=false] Allow to edit the content of the component (used on Text components). Default: `false`\n * @property {Boolean} [layerable=true] Set to `false` if you need to hide the component inside Layers. Default: `true`\n * @property {Boolean} [selectable=true] Allow component to be selected when clicked. Default: `true`\n * @property {Boolean} [hoverable=true] Shows a highlight outline when hovering on the element if `true`. Default: `true`\n * @property {Boolean} [void=false] This property is used by the HTML exporter as void elements don't have closing tags, eg. `
`, `
`, etc. Default: `false`\n * @property {String} [styles=''] Component related styles, eg. `.my-component-class { color: red }`\n * @property {String} [content=''] Content of the component (not escaped) which will be appended before children rendering. Default: `''`\n * @property {String} [icon=''] Component's icon, this string will be inserted before the name (in Layers and badge), eg. it can be an HTML string ''. Default: `''`\n * @property {String|Function} [script=''] Component's javascript. More about it [here](/modules/Components-js.html). Default: `''`\n * @property {String|Function} [script-export=''] You can specify javascript available only in export functions (eg. when you get the HTML).\n * If this property is defined it will overwrite the `script` one (in export functions). Default: `''`\n * @property {Array} [traits=''] Component's traits. More about it [here](/modules/Traits.html). Default: `['id', 'title']`\n * @property {Array} [propagate=[]] Indicates an array of properties which will be inhereted by all NEW appended children.\n * For example if you create a component likes this: `{ removable: false, draggable: false, propagate: ['removable', 'draggable'] }`\n * and append some new component inside, the new added component will get the exact same properties indicated in the `propagate` array (and the `propagate` property itself). Default: `[]`\n * @property {Array} [toolbar=null] Set an array of items to show up inside the toolbar when the component is selected (move, clone, delete).\n * Eg. `toolbar: [ { attributes: {class: 'fa fa-arrows'}, command: 'tlb-move' }, ... ]`.\n * By default, when `toolbar` property is falsy the editor will add automatically commands like `move`, `delete`, etc. based on its properties.\n * @property {Collection} [components=null] Children components. Default: `null`\n */\nexport default class Component extends Model.extend(Styleable) {\n /**\n * Hook method, called once the model is created\n */\n init() {}\n\n /**\n * Hook method, called when the model has been updated (eg. updated some model's property)\n * @param {String} property Property name, if triggered after some property update\n * @param {*} value Property value, if triggered after some property update\n * @param {*} previous Property previous value, if triggered after some property update\n */\n updated(property, value, previous) {}\n\n /**\n * Hook method, called once the model has been removed\n */\n removed() {}\n\n initialize(props = {}, opt = {}) {\n bindAll(this, '__upSymbProps', '__upSymbCls', '__upSymbComps');\n const em = opt.em;\n\n // Propagate properties from parent if indicated\n const parent = this.parent();\n const parentAttr = parent && parent.attributes;\n\n if (parentAttr && parentAttr.propagate) {\n let newAttr = {};\n const toPropagate = parentAttr.propagate;\n toPropagate.forEach(prop => (newAttr[prop] = parent.get(prop)));\n newAttr.propagate = toPropagate;\n newAttr = { ...newAttr, ...props };\n this.set(newAttr);\n }\n\n const propagate = this.get('propagate');\n propagate &&\n this.set('propagate', isArray(propagate) ? propagate : [propagate]);\n\n // Check void elements\n if (\n opt &&\n opt.config &&\n opt.config.voidElements.indexOf(this.get('tagName')) >= 0\n ) {\n this.set('void', true);\n }\n\n opt.em = em;\n this.opt = opt;\n this.em = em;\n this.frame = opt.frame;\n this.config = opt.config || {};\n this.set('attributes', {\n ...(result(this, 'defaults').attributes || {}),\n ...(this.get('attributes') || {})\n });\n this.ccid = Component.createId(this, opt);\n this.initClasses();\n this.initTraits();\n this.initComponents();\n this.initToolbar();\n this.initScriptProps();\n this.listenTo(this, 'change:script', this.scriptUpdated);\n this.listenTo(this, 'change:tagName', this.tagUpdated);\n this.listenTo(this, 'change:attributes', this.attrUpdated);\n this.listenTo(this, 'change:attributes:id', this._idUpdated);\n this.on('change:toolbar', this.__emitUpdateTlb);\n this.on('change', this.__onChange);\n this.on(keyUpdateInside, this.__propToParent);\n this.set('status', '');\n this.views = [];\n\n // Register global updates for collection properties\n ['classes', 'traits', 'components'].forEach(name => {\n const events = `add remove ${name !== 'components' ? 'change' : ''}`;\n this.listenTo(this.get(name), events.trim(), (...args) =>\n this.emitUpdate(name, ...args)\n );\n });\n\n if (!opt.temporary) {\n // Add component styles\n const cssc = em && em.get('CssComposer');\n const { styles, type } = this.attributes;\n if (styles && cssc) {\n cssc.addCollection(styles, {}, { group: `cmp:${type}` });\n }\n\n this.__postAdd();\n this.init();\n this.__isSymbolOrInst() && this.__initSymb();\n em && em.trigger('component:create', this);\n }\n }\n\n __postAdd(opts = {}) {\n const { em } = this;\n const um = em && em.get('UndoManager');\n const comps = this.components();\n if (um && !this.__hasUm) {\n um.add(comps);\n um.add(this.getSelectors());\n this.__hasUm = 1;\n }\n opts.recursive && comps.map(c => c.__postAdd(opts));\n }\n\n __postRemove() {\n const { em } = this;\n const um = em && em.get('UndoManager');\n if (um) {\n um.remove(this.components());\n um.remove(this.getSelectors());\n delete this.__hasUm;\n }\n }\n\n __onChange(m, opts) {\n const changed = this.changedAttributes();\n ['status', 'open', 'toolbar', 'traits'].forEach(\n name => delete changed[name]\n );\n // Propagate component prop changes\n if (!isEmptyObj(changed)) {\n this.__changesUp(opts);\n this.__propSelfToParent({ component: this, changed, options: opts });\n }\n }\n\n __changesUp(opts) {\n const { em, frame } = this;\n [frame, em].forEach(md => md && md.changesUp(opts));\n }\n\n __propSelfToParent(props) {\n this.trigger(keyUpdate, props);\n this.__propToParent(props);\n }\n\n __propToParent(props) {\n const parent = this.parent();\n parent && parent.trigger(keyUpdateInside, props);\n }\n\n __emitUpdateTlb() {\n this.emitUpdate('toolbar');\n }\n\n /**\n * Check component's type\n * @param {string} type Component type\n * @return {Boolean}\n * @example\n * component.is('image')\n * // -> false\n */\n is(type) {\n return !!(this.get('type') == type);\n }\n\n /**\n * Return all the propeties\n * @returns {Object}\n */\n props() {\n return this.attributes;\n }\n\n /**\n * Get the index of the component in the parent collection.\n * @return {Number}\n */\n index() {\n const { collection } = this;\n return collection ? collection.indexOf(this) : 0;\n }\n\n /**\n * Change the drag mode of the component.\n * To get more about this feature read: https://github.com/artf/grapesjs/issues/1936\n * @param {String} value Drag mode, options: 'absolute' | 'translate'\n * @returns {this}\n */\n setDragMode(value) {\n return this.set('dmode', value);\n }\n\n /**\n * Find inner components by query string.\n * **ATTENTION**: this method works only with already rendered component\n * @param {String} query Query string\n * @return {Array} Array of components\n * @example\n * component.find('div > .class');\n * // -> [Component, Component, ...]\n */\n find(query) {\n const result = [];\n const $els = this.view.$el.find(query);\n $els.each(i => {\n const $el = $els.eq(i);\n const model = $el.data('model');\n model && result.push(model);\n });\n\n return result;\n }\n\n /**\n * Find all inner components by component type.\n * The advantage of this method over `find` is that you can use it\n * also before rendering the component\n * @param {String} type Component type\n * @returns {Array}\n * @example\n * const allImages = component.findType('image');\n * console.log(allImages[0]) // prints the first found component\n */\n findType(type) {\n const result = [];\n const find = components =>\n components.forEach(item => {\n item.is(type) && result.push(item);\n find(item.components());\n });\n find(this.components());\n return result;\n }\n\n /**\n * Find the closest parent component by query string.\n * **ATTENTION**: this method works only with already rendered component\n * @param {string} query Query string\n * @return {Component}\n * @example\n * component.closest('div.some-class');\n * // -> Component\n */\n closest(query) {\n const result = this.view.$el.closest(query);\n return result.length && result.data('model');\n }\n\n /**\n * Find the closest parent component by its type.\n * The advantage of this method over `closest` is that you can use it\n * also before rendering the component\n * @param {String} type Component type\n * @returns {Component} Found component, otherwise `undefined`\n * @example\n * const Section = component.closestType('section');\n * console.log(Section);\n */\n closestType(type) {\n let parent = this.parent();\n\n while (parent && !parent.is(type)) {\n parent = parent.parent();\n }\n\n return parent;\n }\n\n /**\n * The method returns a Boolean value indicating whether the passed\n * component is a descendant of a given component\n * @param {Component} component Component to check\n * @returns {Boolean}\n */\n contains(component) {\n let result = !1;\n if (!component) return result;\n const contains = components => {\n !result &&\n components.forEach(item => {\n if (item === component) result = !0;\n !result && contains(item.components());\n });\n };\n contains(this.components());\n return result;\n }\n\n /**\n * Once the tag is updated I have to rerender the element\n * @private\n */\n tagUpdated() {\n this.trigger('rerender');\n }\n\n /**\n * Replace a component with another one\n * @param {String|Component} el Component or HTML string\n * @return {Component|Array} New added component/s\n * @example\n * component.replaceWith('
Some new content
');\n * // -> Component\n */\n replaceWith(el) {\n const coll = this.collection;\n const at = coll.indexOf(this);\n coll.remove(this);\n return coll.add(el, { at });\n }\n\n /**\n * Emit changes for each updated attribute\n * @private\n */\n attrUpdated(m, v, opts = {}) {\n const attrs = this.get('attributes');\n // Handle classes\n const classes = attrs.class;\n classes && this.setClass(classes);\n delete attrs.class;\n\n // Handle style\n const style = attrs.style;\n style && this.setStyle(style);\n delete attrs.style;\n\n const attrPrev = { ...this.previous('attributes') };\n const diff = shallowDiff(attrPrev, this.get('attributes'));\n keys(diff).forEach(pr =>\n this.trigger(`change:attributes:${pr}`, this, diff[pr], opts)\n );\n }\n\n /**\n * Update attributes of the component\n * @param {Object} attrs Key value attributes\n * @param {Object} options Options for the model update\n * @return {this}\n * @example\n * component.setAttributes({ id: 'test', 'data-key': 'value' });\n */\n setAttributes(attrs, opts = {}) {\n this.set('attributes', { ...attrs }, opts);\n return this;\n }\n\n /**\n * Add attributes to the component\n * @param {Object} attrs Key value attributes\n * @param {Object} options Options for the model update\n * @return {this}\n * @example\n * component.addAttributes({ 'data-key': 'value' });\n */\n addAttributes(attrs, opts = {}) {\n return this.setAttributes(\n {\n ...this.getAttributes({ noClass: 1 }),\n ...attrs\n },\n opts\n );\n }\n\n /**\n * Remove attributes from the component\n * @param {String|Array} attrs Array of attributes to remove\n * @param {Object} options Options for the model update\n * @return {this}\n * @example\n * component.removeAttributes('some-attr');\n * component.removeAttributes(['some-attr1', 'some-attr2']);\n */\n removeAttributes(attrs = [], opts = {}) {\n const attrArr = Array.isArray(attrs) ? attrs : [attrs];\n const compAttr = this.getAttributes();\n attrArr.map(i => delete compAttr[i]);\n return this.setAttributes(compAttr, opts);\n }\n\n /**\n * Get the style of the component\n * @return {Object}\n */\n getStyle(options = {}, optsAdd = {}) {\n const em = this.em;\n const prop = isString(options) ? options : '';\n const opts = prop ? optsAdd : options;\n\n if (em && em.getConfig('avoidInlineStyle') && !opts.inline) {\n const state = em.get('state');\n const cc = em.get('CssComposer');\n const rule = cc.getIdRule(this.getId(), { state, ...opts });\n this.rule = rule;\n\n if (rule) {\n return rule.getStyle(prop);\n }\n }\n\n return Styleable.getStyle.call(this, prop);\n }\n\n /**\n * Set the style on the component\n * @param {Object} prop Key value style object\n * @return {Object}\n * @example\n * component.setStyle({ color: 'red' });\n */\n setStyle(prop = {}, opts = {}) {\n const em = this.em;\n const { opt } = this;\n\n if (\n em &&\n em.getConfig('avoidInlineStyle') &&\n !opt.temporary &&\n !opts.inline\n ) {\n const style = this.get('style') || {};\n prop = isString(prop) ? this.parseStyle(prop) : prop;\n prop = { ...prop, ...style };\n const state = em.get('state');\n const cc = em.get('CssComposer');\n const propOrig = this.getStyle(opts);\n this.rule = cc.setIdRule(this.getId(), prop, { ...opts, state });\n const diff = shallowDiff(propOrig, prop);\n this.set('style', '', { silent: 1 });\n keys(diff).forEach(pr => this.trigger(`change:style:${pr}`));\n } else {\n prop = Styleable.setStyle.apply(this, arguments);\n }\n\n return prop;\n }\n\n /**\n * Return all component's attributes\n * @return {Object}\n */\n getAttributes(opts = {}) {\n const { em } = this;\n const classes = [];\n const attributes = { ...this.get('attributes') };\n const sm = em && em.get('SelectorManager');\n const id = this.getId();\n\n // Add classes\n if (!opts.noClass) {\n this.get('classes').forEach(cls =>\n classes.push(isString(cls) ? cls : cls.get('name'))\n );\n classes.length && (attributes.class = classes.join(' '));\n }\n\n // Add style\n if (!opts.noStyle) {\n const style = this.get('style');\n if (isObject(style) && !isEmptyObj(style)) {\n attributes.style = this.styleToString({ inline: 1 });\n }\n }\n\n // Check if we need an ID on the component\n if (!has(attributes, 'id')) {\n let addId;\n\n // If we don't rely on inline styling we have to check\n // for the ID selector\n if (avoidInline(em)) {\n addId = sm && sm.get(id, sm.Selector.TYPE_ID);\n } else if (!isEmpty(this.getStyle())) {\n addId = 1;\n }\n\n // Symbols should always have an id\n if (this.__getSymbol() || this.__getSymbols()) {\n addId = 1;\n }\n\n if (addId) {\n attributes.id = id;\n }\n }\n\n return attributes;\n }\n\n /**\n * Add classes\n * @param {Array|String} classes Array or string of classes\n * @return {Array} Array of added selectors\n * @example\n * model.addClass('class1');\n * model.addClass('class1 class2');\n * model.addClass(['class1', 'class2']);\n * // -> [SelectorObject, ...]\n */\n addClass(classes) {\n const added = this.em.get('SelectorManager').addClass(classes);\n return this.get('classes').add(added);\n }\n\n /**\n * Set classes (resets current collection)\n * @param {Array|String} classes Array or string of classes\n * @return {Array} Array of added selectors\n * @example\n * model.setClass('class1');\n * model.setClass('class1 class2');\n * model.setClass(['class1', 'class2']);\n * // -> [SelectorObject, ...]\n */\n setClass(classes) {\n this.get('classes').reset();\n return this.addClass(classes);\n }\n\n /**\n * Remove classes\n * @param {Array|String} classes Array or string of classes\n * @return {Array} Array of removed selectors\n * @example\n * model.removeClass('class1');\n * model.removeClass('class1 class2');\n * model.removeClass(['class1', 'class2']);\n * // -> [SelectorObject, ...]\n */\n removeClass(classes) {\n const removed = [];\n classes = isArray(classes) ? classes : [classes];\n const selectors = this.get('classes');\n const type = Selector.TYPE_CLASS;\n\n classes.forEach(classe => {\n const classes = classe.split(' ');\n classes.forEach(name => {\n const selector = selectors.where({ name, type })[0];\n selector && removed.push(selectors.remove(selector));\n });\n });\n\n return removed;\n }\n\n /**\n * Returns component's classes as an array of strings\n * @return {Array}\n */\n getClasses() {\n const attr = this.getAttributes();\n const classStr = attr.class;\n return classStr ? classStr.split(' ') : [];\n }\n\n __logSymbol(type, toUp, opts = {}) {\n const symbol = this.__getSymbol();\n const symbols = this.__getSymbols();\n if (!symbol && !symbols) return;\n this.em.log(type, { model: this, toUp, context: 'symbols', opts });\n }\n\n __initSymb() {\n if (this.__symbReady) return;\n this.on('change', this.__upSymbProps);\n this.__symbReady = 1;\n }\n\n __isSymbol() {\n return isArray(this.get(keySymbols));\n }\n\n __isSymbolOrInst() {\n return !!(this.__isSymbol() || this.get(keySymbol));\n }\n\n __isSymbolTop() {\n const parent = this.parent();\n const symb = this.__isSymbolOrInst();\n return (\n symb &&\n (!parent || (parent && !parent.__isSymbol() && !parent.__getSymbol()))\n );\n }\n\n __isSymbolNested() {\n if (!this.__isSymbolOrInst() || this.__isSymbolTop()) return false;\n const symbTopSelf = (this.__isSymbol()\n ? this\n : this.__getSymbol()\n ).__getSymbTop();\n const symbTop = this.__getSymbTop();\n const symbTopMain = symbTop.__isSymbol() ? symbTop : symbTop.__getSymbol();\n return symbTopMain !== symbTopSelf;\n }\n\n __getAllById() {\n const { em } = this;\n return em ? em.get('DomComponents').allById() : {};\n }\n\n __getSymbol() {\n let symb = this.get(keySymbol);\n if (symb && isString(symb)) {\n const ref = this.__getAllById()[symb];\n if (ref) {\n symb = ref;\n this.set(keySymbol, ref);\n } else {\n symb = 0;\n }\n }\n return symb;\n }\n\n __getSymbols() {\n let symbs = this.get(keySymbols);\n if (symbs && isArray(symbs)) {\n symbs.forEach((symb, idx) => {\n if (symb && isString(symb)) {\n symbs[idx] = this.__getAllById()[symb];\n }\n });\n symbs = symbs.filter(symb => symb && !isString(symb));\n }\n return symbs;\n }\n\n __isSymbOvrd(prop = '') {\n const ovrd = this.get(keySymbolOvrd);\n const [prp] = prop.split(':');\n const props = prop !== prp ? [prop, prp] : [prop];\n return (\n ovrd === true || (isArray(ovrd) && props.some(p => ovrd.indexOf(p) >= 0))\n );\n }\n\n __getSymbToUp(opts = {}) {\n let result = [];\n const { em } = this;\n const { changed } = opts;\n const symbEnabled = em && em.get('symbols');\n\n if (\n opts.fromInstance ||\n opts.noPropagate ||\n opts.fromUndo ||\n !symbEnabled ||\n // Avoid updating others if the current component has override\n (changed && this.__isSymbOvrd(changed))\n ) {\n return result;\n }\n\n const symbols = this.__getSymbols() || [];\n const symbol = this.__getSymbol();\n const all = symbol ? [symbol, ...(symbol.__getSymbols() || [])] : symbols;\n result = all\n .filter(s => s !== this)\n // Avoid updating those with override\n .filter(s => !(changed && s.__isSymbOvrd(changed)));\n\n return result;\n }\n\n __getSymbTop(opts) {\n let result = this;\n let parent = this.parent(opts);\n\n while (parent && (parent.__isSymbol() || parent.__getSymbol())) {\n result = parent;\n parent = parent.parent(opts);\n }\n\n return result;\n }\n\n __upSymbProps(m, opts = {}) {\n const changed = this.changedAttributes();\n const attrs = changed.attributes || {};\n delete changed.status;\n delete changed.open;\n delete changed[keySymbols];\n delete changed[keySymbol];\n delete changed[keySymbolOvrd];\n delete changed.attributes;\n delete attrs.id;\n if (!isEmptyObj(attrs)) changed.attributes = attrs;\n if (!isEmptyObj(changed)) {\n const toUp = this.__getSymbToUp(opts);\n // Avoid propagating overrides to other symbols\n keys(changed).map(prop => {\n if (this.__isSymbOvrd(prop)) delete changed[prop];\n });\n\n this.__logSymbol('props', toUp, { opts, changed });\n toUp.forEach(child => {\n const propsChanged = { ...changed };\n // Avoid updating those with override\n keys(propsChanged).map(prop => {\n if (child.__isSymbOvrd(prop)) delete propsChanged[prop];\n });\n child.set(propsChanged, { fromInstance: this, ...opts });\n });\n }\n }\n\n __upSymbCls(m, c, opts = {}) {\n const toUp = this.__getSymbToUp(opts);\n this.__logSymbol('classes', toUp, { opts });\n toUp.forEach(child => {\n // This will propagate the change up to __upSymbProps\n child.set('classes', this.get('classes'), { fromInstance: this });\n });\n this.__changesUp(opts);\n }\n\n __upSymbComps(m, c, o) {\n const optUp = o || c || {};\n const { fromInstance, fromUndo } = optUp;\n const toUpOpts = { fromInstance, fromUndo };\n const isTemp = m.opt.temporary;\n\n // Reset\n if (!o) {\n const toUp = this.__getSymbToUp({\n ...toUpOpts,\n changed: 'components:reset'\n });\n this.__logSymbol('reset', toUp, { components: m.models });\n toUp.forEach(symb => {\n const newMods = m.models.map(mod => mod.clone({ symbol: 1 }));\n symb.components().reset(newMods, { fromInstance: this, ...c });\n });\n // Add\n } else if (o.add) {\n let addedInstances = [];\n const isMainSymb = !!this.__getSymbols();\n const toUp = this.__getSymbToUp({\n ...toUpOpts,\n changed: 'components:add'\n });\n if (toUp.length) {\n const addSymb = m.__getSymbol();\n addedInstances =\n (addSymb ? addSymb.__getSymbols() : m.__getSymbols()) || [];\n addedInstances = [...addedInstances];\n addedInstances.push(addSymb ? addSymb : m);\n }\n !isTemp &&\n this.__logSymbol('add', toUp, {\n opts: o,\n addedInstances: addedInstances.map(c => c.cid),\n added: m.cid\n });\n // Here, before appending a new symbol, I have to ensure there are no previosly\n // created symbols (eg. used mainly when drag components around)\n toUp.forEach(symb => {\n const symbTop = symb.__getSymbTop();\n const symbPrev = addedInstances.filter(addedInst => {\n const addedTop = addedInst.__getSymbTop({ prev: 1 });\n return symbTop && addedTop && addedTop === symbTop;\n })[0];\n const toAppend =\n symbPrev || m.clone({ symbol: 1, symbolInv: isMainSymb });\n symb.append(toAppend, { fromInstance: this, ...o });\n });\n // Remove\n } else {\n // Remove instance reference from the symbol\n const symb = m.__getSymbol();\n symb &&\n !o.temporary &&\n symb.set(\n keySymbols,\n symb.__getSymbols().filter(i => i !== m)\n );\n\n // Propagate remove only if the component is an inner symbol\n if (!m.__isSymbolTop()) {\n const changed = 'components:remove';\n const { index } = o;\n const parent = m.parent();\n const opts = { fromInstance: m, ...o };\n const isSymbNested = m.__isSymbolNested();\n let toUpFn = symb => {\n const symbPrnt = symb.parent();\n symbPrnt && !symbPrnt.__isSymbOvrd(changed) && symb.remove(opts);\n };\n // Check if the parent allows the removing\n let toUp = !parent.__isSymbOvrd(changed)\n ? m.__getSymbToUp(toUpOpts)\n : [];\n\n if (isSymbNested) {\n toUp = parent.__getSymbToUp({ ...toUpOpts, changed });\n toUpFn = symb => {\n const toRemove = symb.components().at(index);\n toRemove && toRemove.remove({ fromInstance: parent, ...opts });\n };\n }\n\n !isTemp &&\n this.__logSymbol('remove', toUp, {\n opts: o,\n removed: m.cid,\n isSymbNested\n });\n toUp.forEach(toUpFn);\n }\n }\n\n this.__changesUp(optUp);\n }\n\n initClasses(m, c, opts = {}) {\n const event = 'change:classes';\n const attrCls = this.get('attributes').class || [];\n const toListen = [this, event, this.initClasses];\n const cls = this.get('classes') || attrCls;\n const clsArr = isString(cls) ? cls.split(' ') : cls;\n this.stopListening(...toListen);\n const classes = this.normalizeClasses(clsArr);\n const selectors = new Selectors([]);\n this.set('classes', selectors, opts);\n selectors.add(classes);\n selectors.on('add remove reset', this.__upSymbCls);\n this.listenTo(...toListen);\n return this;\n }\n\n initComponents() {\n const event = 'change:components';\n const toListen = [this, event, this.initComponents];\n this.stopListening(...toListen);\n // Have to add components after the init, otherwise the parent\n // is not visible\n const comps = new Components(null, this.opt);\n comps.parent = this;\n const components = this.get('components');\n const addChild = !this.opt.avoidChildren;\n this.set('components', comps);\n addChild &&\n components &&\n comps.add(\n isFunction(components) ? components(this) : components,\n this.opt\n );\n comps.on('add remove reset', this.__upSymbComps);\n this.listenTo(...toListen);\n return this;\n }\n\n initTraits(changed) {\n const { em } = this;\n const event = 'change:traits';\n const toListen = [this, event, this.initTraits];\n this.stopListening(...toListen);\n this.loadTraits();\n const attrs = { ...this.get('attributes') };\n const traits = this.get('traits');\n traits.each(trait => {\n if (!trait.get('changeProp')) {\n const name = trait.get('name');\n const value = trait.getInitValue();\n if (name && value) attrs[name] = value;\n }\n });\n traits.length && this.set('attributes', attrs);\n this.listenTo(...toListen);\n changed && em && em.trigger('component:toggled');\n return this;\n }\n\n initScriptProps() {\n if (this.opt.temporary) return;\n const prop = 'script-props';\n const toListen = [`change:${prop}`, this.initScriptProps];\n this.off(...toListen);\n const prevProps = this.previous(prop) || [];\n const newProps = this.get(prop) || [];\n const prevPropsEv = prevProps.map(e => `change:${e}`).join(' ');\n const newPropsEv = newProps.map(e => `change:${e}`).join(' ');\n prevPropsEv && this.off(prevPropsEv, this.__scriptPropsChange);\n newPropsEv && this.on(newPropsEv, this.__scriptPropsChange);\n this.on(...toListen);\n }\n\n __scriptPropsChange(m, v, opts = {}) {\n if (opts.avoidStore) return;\n this.trigger('rerender');\n }\n\n /**\n * Add new component children\n * @param {Component|String} components Component to add\n * @param {Object} [opts={}] Options for the append action\n * @return {Array} Array of appended components\n * @example\n * someComponent.get('components').length // -> 0\n * const videoComponent = someComponent.append('
')[0];\n * // This will add 2 components (`video` and `div`) to your `someComponent`\n * someComponent.get('components').length // -> 2\n * // You can pass components directly\n * otherComponent.append(otherComponent2);\n * otherComponent.append([otherComponent3, otherComponent4]);\n * // append at specific index (eg. at the beginning)\n * someComponent.append(otherComponent, { at: 0 });\n */\n append(components, opts = {}) {\n const compArr = isArray(components) ? components : [components];\n const toAppend = compArr.map(comp => {\n if (isString(comp)) {\n return comp;\n } else {\n // I have to remove components from the old container before adding them to a new one\n comp.collection && comp.collection.remove(comp, { temporary: 1 });\n return comp;\n }\n });\n const result = this.components().add(toAppend, opts);\n return isArray(result) ? result : [result];\n }\n\n /**\n * Set new collection if `components` are provided, otherwise the\n * current collection is returned\n * @param {Component|String} [components] Component Definitions or HTML string\n * @param {Object} [opts={}] Options, same as in `Component.append()`\n * @returns {Collection|Array<[Component]>}\n * @example\n * // Set new collection\n * component.components('
');\n * // Get current collection\n * const collection = component.components();\n * console.log(collection.length);\n * // -> 2\n */\n components(components, opts = {}) {\n const coll = this.get('components');\n\n if (isUndefined(components)) {\n return coll;\n } else {\n coll.reset(null, opts);\n return components ? this.append(components, opts) : [];\n }\n }\n\n /**\n * If exists, returns the child component at specific index.\n * @param {Number} index Index of the component to return\n * @returns {[Component]|null}\n * @example\n * // Return first child\n * component.getChildAt(0);\n * // Return second child\n * component.getChildAt(1);\n */\n getChildAt(index) {\n return this.components().at(index || 0) || null;\n }\n\n /**\n * If exists, returns the last child component.\n * @returns {[Component]|null}\n * @example\n * const lastChild = component.getLastChild();\n */\n getLastChild() {\n const children = this.components();\n return children.at(children.length - 1) || null;\n }\n\n /**\n * Remove all inner components\n * * @return {this}\n */\n empty(opts = {}) {\n this.components().reset(null, opts);\n return this;\n }\n\n /**\n * Get the parent component, if exists\n * @return {Component|null}\n * @example\n * component.parent();\n * // -> Component\n */\n parent(opts = {}) {\n const coll = this.collection || (opts.prev && this.prevColl);\n return coll ? coll.parent : null;\n }\n\n /**\n * Script updated\n * @private\n */\n scriptUpdated() {\n this.set('scriptUpdated', 1);\n }\n\n /**\n * Init toolbar\n * @private\n */\n initToolbar() {\n const { em } = this;\n const model = this;\n const ppfx = (em && em.getConfig('stylePrefix')) || '';\n\n if (!model.get('toolbar')) {\n var tb = [];\n if (model.collection) {\n tb.push({\n attributes: { class: 'fa fa-arrow-up' },\n command: ed => ed.runCommand('core:component-exit', { force: 1 })\n });\n }\n if (model.get('draggable')) {\n tb.push({\n attributes: {\n class: `fa fa-arrows ${ppfx}no-touch-actions`,\n draggable: true\n },\n //events: hasDnd(this.em) ? { dragstart: 'execCommand' } : '',\n command: 'tlb-move'\n });\n }\n if (model.get('copyable')) {\n tb.push({\n attributes: { class: 'fa fa-clone' },\n command: 'tlb-clone'\n });\n }\n if (model.get('removable')) {\n tb.push({\n attributes: { class: 'fa fa-trash-o' },\n command: 'tlb-delete'\n });\n }\n model.set('toolbar', tb);\n }\n }\n\n /**\n * Load traits\n * @param {Array} traits\n * @private\n */\n loadTraits(traits, opts = {}) {\n traits = traits || this.get('traits');\n traits = isFunction(traits) ? traits(this) : traits;\n\n if (!(traits instanceof Traits)) {\n const trt = new Traits([], this.opt);\n trt.setTarget(this);\n\n if (traits.length) {\n traits.forEach(tr => tr.attributes && delete tr.attributes.value);\n trt.add(traits);\n }\n\n this.set('traits', trt, opts);\n }\n\n return this;\n }\n\n /**\n * Get the trait by id/name\n * @param {String} id The `id` or `name` of the trait\n * @return {Trait} Trait model\n * @example\n * const traitTitle = component.getTrait('title');\n * traitTitle && traitTitle.set('label', 'New label');\n */\n getTrait(id) {\n return this.get('traits').filter(trait => {\n return trait.get('id') === id || trait.get('name') === id;\n })[0];\n }\n\n /**\n * Update a trait\n * @param {String} id The `id` or `name` of the trait\n * @param {Object} props Object with the props to update\n * @return {this}\n * @example\n * component.updateTrait('title', {\n * type: 'select',\n * options: [ 'Option 1', 'Option 2' ],\n * });\n */\n updateTrait(id, props) {\n const { em } = this;\n const trait = this.getTrait(id);\n trait && trait.set(props);\n em && em.trigger('component:toggled');\n return this;\n }\n\n /**\n * Get the trait position index by id/name. Useful in case you want to\n * replace some trait, at runtime, with something else.\n * @param {String} id The `id` or `name` of the trait\n * @return {Number} Index position of the current trait\n * @example\n * const traitTitle = component.getTraitIndex('title');\n * console.log(traitTitle); // 1\n */\n getTraitIndex(id) {\n const trait = this.getTrait(id);\n return trait ? this.get('traits').indexOf(trait) : -1;\n }\n\n /**\n * Remove trait/s by id/s.\n * @param {String|Array} id The `id`/`name` of the trait (or an array)\n * @return {Array} Array of removed traits\n * @example\n * component.removeTrait('title');\n * component.removeTrait(['title', 'id']);\n */\n removeTrait(id) {\n const { em } = this;\n const ids = isArray(id) ? id : [id];\n const toRemove = ids.map(id => this.getTrait(id));\n const removed = this.get('traits').remove(toRemove);\n em && em.trigger('component:toggled');\n return removed;\n }\n\n /**\n * Add trait/s by id/s.\n * @param {String|Object|Array} trait Trait to add (or an array of traits)\n * @param {Options} opts Options for the add\n * @return {Array} Array of added traits\n * @example\n * component.addTrait('title', { at: 1 }); // Add title trait (`at` option is the position index)\n * component.addTrait({\n * type: 'checkbox',\n * name: 'disabled',\n * });\n * component.addTrait(['title', {...}, ...]);\n */\n addTrait(trait, opts = {}) {\n const { em } = this;\n const added = this.get('traits').add(trait, opts);\n em && em.trigger('component:toggled');\n return added;\n }\n\n /**\n * Normalize input classes from array to array of objects\n * @param {Array} arr\n * @return {Array}\n * @private\n */\n normalizeClasses(arr) {\n const res = [];\n const { em } = this;\n const clm = em && em.get('SelectorManager');\n if (!clm) return;\n if (arr.models) return [...arr.models];\n arr.forEach(val => res.push(clm.add(val)));\n return res;\n }\n\n /**\n * Override original clone method\n * @private\n */\n clone(opt = {}) {\n const em = this.em;\n const attr = { ...this.attributes };\n const opts = { ...this.opt };\n const id = this.getId();\n const cssc = em && em.get('CssComposer');\n attr.attributes = { ...attr.attributes };\n delete attr.attributes.id;\n attr.components = [];\n attr.classes = [];\n attr.traits = [];\n\n if (this.__isSymbolTop()) {\n opt.symbol = 1;\n }\n\n this.get('components').each((md, i) => {\n attr.components[i] = md.clone({ ...opt, _inner: 1 });\n });\n this.get('traits').each((md, i) => {\n attr.traits[i] = md.clone();\n });\n this.get('classes').each((md, i) => {\n attr.classes[i] = md.get('name');\n });\n\n attr.status = '';\n opts.collection = null;\n\n const cloned = new this.constructor(attr, opts);\n\n // Clone component specific rules\n const newId = `#${cloned.getId()}`;\n const rulesToClone = cssc ? cssc.getRules(`#${id}`) : [];\n rulesToClone.forEach(rule => {\n const newRule = rule.clone();\n newRule.set('selectors', [newId]);\n cssc.getAll().add(newRule);\n });\n\n // Symbols\n // If I clone an inner symbol, I have to reset it\n cloned.set(keySymbols, 0);\n const symbol = this.__getSymbol();\n const symbols = this.__getSymbols();\n\n if (!opt.symbol && (symbol || symbols)) {\n cloned.set(keySymbol, 0);\n cloned.set(keySymbols, 0);\n } else if (symbol) {\n // Contains already a reference to a symbol\n symbol.set(keySymbols, [...symbol.__getSymbols(), cloned]);\n cloned.__initSymb();\n } else if (opt.symbol) {\n // Request to create a symbol\n if (this.__isSymbol()) {\n // Already a symbol, cloned should be an instance\n this.set(keySymbols, [...symbols, cloned]);\n cloned.set(keySymbol, this);\n cloned.__initSymb();\n } else if (opt.symbolInv) {\n // Inverted, cloned is the instance, the origin is the main symbol\n this.set(keySymbols, [cloned]);\n cloned.set(keySymbol, this);\n [this, cloned].map(i => i.__initSymb());\n } else {\n // Cloned becomes the main symbol\n cloned.set(keySymbols, [this]);\n [this, cloned].map(i => i.__initSymb());\n this.set(keySymbol, cloned);\n }\n }\n\n const event = 'component:clone';\n em && em.trigger(event, cloned);\n this.trigger(event, cloned);\n\n return cloned;\n }\n\n /**\n * Get the name of the component\n * @return {String}\n * */\n getName() {\n const { em } = this;\n const { type, tagName } = this.attributes;\n const cName = this.get('name');\n const isDiv = tagName == 'div';\n const tag = isDiv ? 'box' : tagName;\n const defName = type || tag;\n const nameTag = !type && tagName && !isDiv && tagName;\n const i18nPfx = 'domComponents.names.';\n const i18nName = cName && em && em.t(`${i18nPfx}${cName}`);\n const i18nNameTag = nameTag && em && em.t(`${i18nPfx}${nameTag}`);\n const i18nDefName =\n em && (em.t(`${i18nPfx}${type}`) || em.t(`${i18nPfx}${tagName}`));\n return (\n this.get('custom-name') || // Used in Layers (when the user changes the name)\n i18nName ||\n cName || // Component name (check if there is a i18n string for it)\n i18nNameTag ||\n capitalize(nameTag) || // Try name by tag if there is no valid type\n i18nDefName ||\n capitalize(defName) // Use the default name\n );\n }\n\n /**\n * Get the icon string\n * @return {String}\n */\n getIcon() {\n let icon = this.get('icon');\n return icon ? icon + ' ' : '';\n }\n\n /**\n * Return HTML string of the component\n * @param {Object} [opts={}] Options\n * @param {String} [opts.tag] Custom tagName\n * @param {Object|Function} [opts.attributes=null] You can pass an object of custom attributes to replace\n * with the current one or you can even pass a function to generate attributes dynamically\n * @return {String} HTML string\n * @example\n * // Simple HTML return\n * component.set({ tagName: 'span' });\n * component.setAttributes({ title: 'Hello' });\n * component.toHTML();\n * // -> \n *\n * // Custom attributes\n * component.toHTML({ attributes: { 'data-test': 'Hello' } });\n * // -> \n *\n * // Custom dynamic attributes\n * component.toHTML({\n * attributes(component, attributes) {\n * if (component.get('tagName') == 'span') {\n * attributes.title = 'Custom attribute';\n * }\n * return attributes;\n * },\n * });\n * // -> \n */\n toHTML(opts = {}) {\n const model = this;\n const attrs = [];\n const customTag = opts.tag;\n const tag = customTag || model.get('tagName');\n const sTag = model.get('void');\n const customAttr = opts.attributes;\n let attributes = this.getAttrToHTML();\n delete opts.tag;\n\n // Get custom attributes if requested\n if (customAttr) {\n if (isFunction(customAttr)) {\n attributes = customAttr(model, attributes) || {};\n } else if (isObject(customAttr)) {\n attributes = customAttr;\n }\n }\n\n for (let attr in attributes) {\n const val = attributes[attr];\n const value = isString(val) ? val.replace(/\"/g, '"') : val;\n\n if (!isUndefined(value)) {\n if (isBoolean(value)) {\n value && attrs.push(attr);\n } else {\n attrs.push(`${attr}=\"${value}\"`);\n }\n }\n }\n\n const attrString = attrs.length ? ` ${attrs.join(' ')}` : '';\n const inner = model.__innerHTML(opts);\n let code = `<${tag}${attrString}${sTag ? '/' : ''}>${inner}`;\n !sTag && (code += ``);\n\n return code;\n }\n\n __innerHTML(opts = {}) {\n const cmps = this.components();\n return !cmps.length\n ? this.get('content')\n : cmps.map(c => c.toHTML(opts)).join('');\n }\n\n /**\n * Returns object of attributes for HTML\n * @return {Object}\n * @private\n */\n getAttrToHTML() {\n var attr = this.getAttributes();\n delete attr.style;\n return attr;\n }\n\n /**\n * Return a shallow copy of the model's attributes for JSON\n * stringification.\n * @return {Object}\n * @private\n */\n toJSON(opts = {}) {\n const obj = Model.prototype.toJSON.call(this, opts);\n obj.attributes = this.getAttributes();\n delete obj.attributes.class;\n delete obj.toolbar;\n delete obj.traits;\n delete obj.status;\n delete obj.open; // used in Layers\n\n if (!opts.fromUndo) {\n const symbol = obj[keySymbol];\n const symbols = obj[keySymbols];\n if (symbols && isArray(symbols)) {\n obj[keySymbols] = symbols\n .filter(i => i)\n .map(i => (i.getId ? i.getId() : i));\n }\n if (symbol && !isString(symbol)) {\n obj[keySymbol] = symbol.getId();\n }\n }\n\n if (this.em.getConfig('avoidDefaults')) {\n this.getChangedProps(obj);\n }\n\n return obj;\n }\n\n /**\n * Return an object containing only changed props\n */\n getChangedProps(res) {\n const obj = res || Model.prototype.toJSON.apply(this);\n const defaults = result(this, 'defaults');\n\n forEach(defaults, (value, key) => {\n if (['type'].indexOf(key) === -1 && obj[key] === value) {\n delete obj[key];\n }\n });\n\n if (isEmpty(obj.type)) {\n delete obj.type;\n }\n\n forEach(['attributes', 'style'], prop => {\n if (isEmpty(defaults[prop]) && isEmpty(obj[prop])) {\n delete obj[prop];\n }\n });\n\n forEach(['classes', 'components'], prop => {\n if (!obj[prop] || (isEmpty(defaults[prop]) && !obj[prop].length)) {\n delete obj[prop];\n }\n });\n\n return obj;\n }\n\n /**\n * Return the component id\n * @return {String}\n */\n getId() {\n let attrs = this.get('attributes') || {};\n return attrs.id || this.ccid || this.cid;\n }\n\n /**\n * Set new id on the component\n * @param {String} id\n * @return {this}\n */\n setId(id, opts) {\n const attrs = { ...this.get('attributes') };\n attrs.id = id;\n this.set('attributes', attrs, opts);\n return this;\n }\n\n /**\n * Get the DOM element of the component.\n * This works only if the component is already rendered\n * @param {Frame} frame Specific frame from which taking the element\n * @return {HTMLElement}\n */\n getEl(frame) {\n const view = this.getView(frame);\n return view && view.el;\n }\n\n /**\n * Get the View of the component.\n * This works only if the component is already rendered\n * @param {Frame} frame Get View of a specific frame\n * @return {ComponentView}\n */\n getView(frame) {\n let { view, views } = this;\n\n if (frame) {\n view = views.filter(view => view._getFrame() === frame.view)[0];\n }\n\n return view;\n }\n\n getCurrentView() {\n const frame = (this.em.get('currentFrame') || {}).model;\n return this.getView(frame);\n }\n\n __getScriptProps() {\n const modelProps = this.props();\n const scrProps = this.get('script-props') || [];\n return scrProps.reduce((acc, prop) => {\n acc[prop] = modelProps[prop];\n return acc;\n }, {});\n }\n\n /**\n * Return script in string format, cleans 'function() {..' from scripts\n * if it's a function\n * @param {string|Function} script\n * @return {string}\n * @private\n */\n getScriptString(script) {\n let scr = script || this.get('script');\n\n if (!scr) {\n return scr;\n }\n\n if (this.get('script-props')) {\n scr = scr.toString().trim();\n } else {\n // Deprecated\n // Need to convert script functions to strings\n if (typeof scr == 'function') {\n var scrStr = scr.toString().trim();\n scrStr = scrStr\n .replace(/^function[\\s\\w]*\\(\\)\\s?\\{/, '')\n .replace(/\\}$/, '');\n scr = scrStr.trim();\n }\n\n var config = this.em.getConfig();\n var tagVarStart = escapeRegExp(config.tagVarStart || '{[ ');\n var tagVarEnd = escapeRegExp(config.tagVarEnd || ' ]}');\n var reg = new RegExp(`${tagVarStart}([\\\\w\\\\d-]*)${tagVarEnd}`, 'g');\n scr = scr.replace(reg, (match, v) => {\n // If at least one match is found I have to track this change for a\n // better optimization inside JS generator\n this.scriptUpdated();\n const result = this.attributes[v] || '';\n return isArray(result) || typeof result == 'object'\n ? JSON.stringify(result)\n : result;\n });\n }\n return scr;\n }\n\n emitUpdate(property, ...args) {\n const { em } = this;\n const event = keyUpdate + (property ? `:${property}` : '');\n const item = property && this.get(property);\n property &&\n this.updated(\n property,\n item,\n property && this.previous(property),\n ...args\n );\n this.trigger(event, ...args);\n em && em.trigger(event, this, ...args);\n ['components', 'classes'].indexOf(property) >= 0 &&\n this.__propSelfToParent({\n component: this,\n changed: { [property]: item },\n options: args[2] || args[1] || {}\n });\n }\n\n /**\n * Execute callback function on itself and all inner components\n * @param {Function} clb Callback function, the model is passed as an argument\n * @return {this}\n * @example\n * component.onAll(component => {\n * // do something with component\n * })\n */\n onAll(clb) {\n if (isFunction(clb)) {\n clb(this);\n this.components().forEach(model => model.onAll(clb));\n }\n return this;\n }\n\n /**\n * Remove the component\n * @return {this}\n */\n remove(opts = {}) {\n const { em } = this;\n const coll = this.collection;\n const remove = () => {\n coll && coll.remove(this, opts);\n opts.root && this.components('');\n };\n const rmOpts = { ...opts };\n [this, em].map(i =>\n i.trigger('component:remove:before', this, remove, rmOpts)\n );\n !rmOpts.abort && remove();\n return this;\n }\n\n /**\n * Move the component to another destination component\n * @param {Component} component Destination component (so the current one will be appended as a child)\n * @param {Object} opts Options for the append action\n * @returns {this}\n * @example\n * // Move the selected component on top of the wrapper\n * const dest = editor.getWrapper();\n * editor.getSelected().move(dest, { at: 0 });\n */\n move(component, opts = {}) {\n this.remove({ temporary: 1 });\n component && component.append(this, opts);\n return this;\n }\n\n /**\n * Reset id of the component and any of its style rule\n * @param {Object} [opts={}] Options\n * @return {this}\n * @private\n */\n resetId(opts = {}) {\n const { em } = this;\n const oldId = this.getId();\n if (!oldId) return;\n const newId = Component.createId(this);\n this.setId(newId);\n const rule = em && em.get('CssComposer').getIdRule(oldId);\n const selector = rule && rule.get('selectors').at(0);\n selector && selector.set('name', newId);\n return this;\n }\n\n _getStyleRule({ id } = {}) {\n const { em } = this;\n const idS = id || this.getId();\n return em && em.get('CssComposer').getIdRule(idS);\n }\n\n _getStyleSelector(opts) {\n const rule = this._getStyleRule(opts);\n return rule && rule.get('selectors').at(0);\n }\n\n _idUpdated(m, v, opts = {}) {\n if (opts.idUpdate) return;\n\n const { ccid } = this;\n const { id } = this.get('attributes') || {};\n const idPrev = (this.previous('attributes') || {}).id || ccid;\n const list = Component.getList(this);\n\n // If the ID already exists I need to rollback to the old one\n if (list[id] || (!id && idPrev)) {\n return this.setId(idPrev, { idUpdate: 1 });\n }\n\n // Remove the old ID reference and add the new one\n delete list[idPrev];\n list[id] = this;\n this.ccid = id;\n\n // Update the style selector name\n const selector = this._getStyleSelector({ id: idPrev });\n selector && selector.set({ name: id, label: id });\n }\n}\n\n/**\n * Detect if the passed element is a valid component.\n * In case the element is valid an object abstracted\n * from the element will be returned\n * @param {HTMLElement}\n * @return {Object}\n * @private\n */\nComponent.isComponent = el => {\n return { tagName: toLowerCase(el.tagName) };\n};\n\nComponent.ensureInList = model => {\n const list = Component.getList(model);\n const id = model.getId();\n const current = list[id];\n\n if (!current) {\n // Insert in list\n list[id] = model;\n } else if (current !== model) {\n // Create new ID\n const nextId = Component.getIncrementId(id, list);\n model.setId(nextId);\n list[nextId] = model;\n }\n\n model.components().forEach(i => Component.ensureInList(i));\n};\n\n/**\n * Relying simply on the number of components becomes a problem when you\n * store and load them back, you might hit collisions with new components\n * @param {Model} model\n * @return {string}\n * @private\n */\nComponent.createId = (model, opts = {}) => {\n const list = Component.getList(model);\n const { idMap = {} } = opts;\n let { id } = model.get('attributes');\n let nextId;\n\n if (id) {\n nextId = Component.getIncrementId(id, list, opts);\n model.setId(nextId);\n if (id !== nextId) idMap[id] = nextId;\n } else {\n nextId = Component.getNewId(list);\n }\n\n list[nextId] = model;\n return nextId;\n};\n\nComponent.getNewId = list => {\n const count = Object.keys(list).length;\n // Testing 1000000 components with `+ 2` returns 0 collisions\n const ilen = count.toString().length + 2;\n const uid = (Math.random() + 1.1).toString(36).slice(-ilen);\n let newId = `i${uid}`;\n\n while (list[newId]) {\n newId = Component.getNewId(list);\n }\n\n return newId;\n};\n\nComponent.getIncrementId = (id, list, opts = {}) => {\n const { keepIds = [] } = opts;\n let counter = 1;\n let newId = id;\n\n if (keepIds.indexOf(id) < 0) {\n while (list[newId]) {\n counter++;\n newId = `${id}-${counter}`;\n }\n }\n\n return newId;\n};\n\n/**\n * The list of components is taken from the Components module.\n * Initially, the list, was set statically on the Component object but it was\n * not ok, as it was shared between multiple editor instances\n */\nComponent.getList = model => {\n const { opt = {} } = model;\n const { domc, em } = opt;\n const dm = domc || (em && em.get('DomComponents'));\n return dm ? dm.componentsById : {};\n};\n\n/**\n * This method checks, for each parsed component and style object\n * (are not Components/CSSRules yet), for duplicated id and fixes them\n * This method is used in Components.js just after the parsing\n */\nComponent.checkId = (components, styles = [], list = {}, opts = {}) => {\n const comps = isArray(components) ? components : [components];\n const { keepIds = [] } = opts;\n comps.forEach(comp => {\n const { attributes = {}, components } = comp;\n const { id } = attributes;\n\n // Check if we have collisions with current components\n if (id && list[id] && keepIds.indexOf(id) < 0) {\n const newId = Component.getIncrementId(id, list);\n attributes.id = newId;\n // Update passed styles\n isArray(styles) &&\n styles.forEach(style => {\n const { selectors } = style;\n selectors.forEach((sel, idx) => {\n if (sel === `#${id}`) selectors[idx] = `#${newId}`;\n });\n });\n }\n\n components && Component.checkId(components, styles, list, opts);\n });\n};\n\nComponent.getDefaults = function() {\n return result(this.prototype, 'defaults');\n};\n\nComponent.prototype.defaults = {\n tagName: 'div',\n type: '',\n name: '',\n removable: true,\n draggable: true,\n droppable: true,\n badgable: true,\n stylable: true,\n 'stylable-require': '',\n 'style-signature': '',\n unstylable: '',\n highlightable: true,\n copyable: true,\n resizable: false,\n editable: false,\n layerable: true,\n selectable: true,\n hoverable: true,\n void: false,\n state: '', // Indicates if the component is in some CSS state like ':hover', ':active', etc.\n status: '', // State, eg. 'selected'\n content: '',\n icon: '',\n style: '',\n styles: '', // Component related styles\n classes: '', // Array of classes\n script: '',\n 'script-props': '',\n 'script-export': '',\n attributes: '',\n traits: ['id', 'title'],\n propagate: '',\n dmode: '',\n toolbar: null,\n [keySymbol]: 0,\n [keySymbols]: 0,\n [keySymbolOvrd]: 0,\n _undo: true,\n _undoexc: ['status', 'open']\n};\n","var arrayWithoutHoles = require(\"./arrayWithoutHoles.js\");\n\nvar iterableToArray = require(\"./iterableToArray.js\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread.js\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","import Backbone from 'backbone';\nimport { isEmpty, each, keys } from 'underscore';\nimport Components from '../model/Components';\nimport ComponentsView from './ComponentsView';\nimport Selectors from 'selector_manager/model/Selectors';\nimport { replaceWith } from 'utils/dom';\nimport { setViewEl } from 'utils/mixins';\n\nexport default Backbone.View.extend({\n className() {\n return this.getClasses();\n },\n\n tagName() {\n return this.model.get('tagName');\n },\n\n initialize(opt = {}) {\n const model = this.model;\n const config = opt.config || {};\n const em = config.em;\n const modelOpt = model.opt || {};\n const { $el, el } = this;\n const { draggableComponents } = config;\n this.opts = opt;\n this.modelOpt = modelOpt;\n this.config = config;\n this.em = em || '';\n this.pfx = config.stylePrefix || '';\n this.ppfx = config.pStylePrefix || '';\n this.attr = model.get('attributes');\n this.classe = this.attr.class || [];\n this.listenTo(model, 'change:style', this.updateStyle);\n this.listenTo(\n model,\n 'change:attributes change:_innertext',\n this.renderAttributes\n );\n this.listenTo(model, 'change:highlightable', this.updateHighlight);\n this.listenTo(model, 'change:status', this.updateStatus);\n this.listenTo(model, 'change:script rerender', this.reset);\n this.listenTo(model, 'change:content', this.updateContent);\n this.listenTo(model, 'change', this.handleChange);\n this.listenTo(model, 'active', this.onActive);\n this.listenTo(model, 'disable', this.onDisable);\n $el.data('model', model);\n setViewEl(el, this);\n model.view = this;\n this._getFrame() && model.views.push(this);\n this.initClasses();\n this.initComponents({ avoidRender: 1 });\n this.events = {\n ...this.events,\n ...(this.__isDraggable() && { dragstart: 'handleDragStart' })\n };\n this.delegateEvents();\n !modelOpt.temporary && this.init(this._clbObj());\n },\n\n __isDraggable() {\n const { model, config } = this;\n const { _innertext, draggable } = model.attributes;\n return config.draggableComponents && draggable && !_innertext;\n },\n\n _clbObj() {\n const { em, model, el } = this;\n return {\n editor: em && em.getEditor(),\n model,\n el\n };\n },\n\n /**\n * Initialize callback\n */\n init() {},\n\n /**\n * Remove callback\n */\n removed() {},\n\n /**\n * Callback executed when the `active` event is triggered on component\n */\n onActive() {},\n\n /**\n * Callback executed when the `disable` event is triggered on component\n */\n onDisable() {},\n\n remove() {\n const view = this;\n Backbone.View.prototype.remove.apply(view, arguments);\n const { model } = view;\n const frame = view._getFrame() || {};\n const frameM = frame.model;\n model.components().forEach(comp => {\n const view = comp.getView(frameM);\n view && view.remove();\n });\n const cv = view.childrenView;\n cv && cv.remove();\n const { views } = model;\n views.splice(views.indexOf(view), 1);\n view.removed(view._clbObj());\n view.$el.data({ model: '', collection: '', view: '' });\n return view;\n },\n\n handleDragStart(event) {\n event.preventDefault();\n event.stopPropagation();\n this.em.get('Commands').run('tlb-move', {\n target: this.model,\n event\n });\n },\n\n initClasses() {\n const { model } = this;\n const event = 'change:classes';\n const classes = model.get('classes');\n\n if (classes instanceof Selectors) {\n this.stopListening(model, event, this.initClasses);\n this.listenTo(model, event, this.initClasses);\n this.listenTo(classes, 'add remove change', this.updateClasses);\n classes.length && this.importClasses();\n }\n },\n\n initComponents(opts = {}) {\n const { model, $el, childrenView } = this;\n const event = 'change:components';\n const comps = model.get('components');\n const toListen = [model, event, this.initComponents];\n\n if (comps instanceof Components) {\n $el.data('collection', comps);\n childrenView && childrenView.remove();\n this.stopListening(...toListen);\n !opts.avoidRender && this.renderChildren();\n this.listenTo(...toListen);\n }\n },\n\n /**\n * Handle any property change\n * @private\n */\n handleChange() {\n const { model } = this;\n const chgArr = keys(model.changed);\n if (chgArr.length === 1 && chgArr[0] === 'status') return;\n model.emitUpdate();\n\n for (let prop in model.changed) {\n model.emitUpdate(prop);\n }\n },\n\n /**\n * Import, if possible, classes inside main container\n * @private\n * */\n importClasses() {\n var clm = this.config.em.get('SelectorManager');\n\n if (clm) {\n this.model.get('classes').each(m => {\n clm.add(m.get('name'));\n });\n }\n },\n\n /**\n * Update item on status change\n * @param {Event} e\n * @private\n * */\n updateStatus(opts = {}) {\n const { em } = this;\n const { extHl } = em ? em.get('Canvas').getConfig() : {};\n const el = this.el;\n const status = this.model.get('status');\n const ppfx = this.ppfx;\n const selectedCls = `${ppfx}selected`;\n const selectedParentCls = `${selectedCls}-parent`;\n const freezedCls = `${ppfx}freezed`;\n const hoveredCls = `${ppfx}hovered`;\n const toRemove = [selectedCls, selectedParentCls, freezedCls, hoveredCls];\n const selCls = extHl && !opts.noExtHl ? '' : selectedCls;\n this.$el.removeClass(toRemove.join(' '));\n var actualCls = el.getAttribute('class') || '';\n var cls = '';\n\n switch (status) {\n case 'selected':\n cls = `${actualCls} ${selCls}`;\n break;\n case 'selected-parent':\n cls = `${actualCls} ${selectedParentCls}`;\n break;\n case 'freezed':\n cls = `${actualCls} ${freezedCls}`;\n break;\n case 'freezed-selected':\n cls = `${actualCls} ${freezedCls} ${selCls}`;\n break;\n case 'hovered':\n cls = !opts.avoidHover ? `${actualCls} ${hoveredCls}` : '';\n break;\n }\n\n cls = cls.trim();\n cls && el.setAttribute('class', cls);\n },\n\n /**\n * Update highlight attribute\n * @private\n * */\n updateHighlight() {\n const hl = this.model.get('highlightable');\n this.setAttribute('data-highlightable', hl ? 1 : '');\n },\n\n /**\n * Update style attribute\n * @private\n * */\n updateStyle(m, v, opts = {}) {\n const { model, em, el } = this;\n\n if (em && em.getConfig('avoidInlineStyle') && !opts.inline) {\n const style = model.getStyle();\n const empty = isEmpty(style);\n !empty && model.setStyle(style);\n if (model.get('_innertext') && empty) {\n el.removeAttribute('id');\n } else {\n el.id = model.getId();\n }\n } else {\n this.setAttribute('style', model.styleToString(opts));\n }\n },\n\n /**\n * Update classe attribute\n * @private\n * */\n updateClasses() {\n const str = this.model\n .get('classes')\n .pluck('name')\n .join(' ');\n this.setAttribute('class', str);\n\n // Regenerate status class\n this.updateStatus();\n this.onAttrUpdate();\n },\n\n /**\n * Update single attribute\n * @param {[type]} name [description]\n * @param {[type]} value [description]\n */\n setAttribute(name, value) {\n const el = this.$el;\n value ? el.attr(name, value) : el.removeAttr(name);\n },\n\n /**\n * Get classes from attributes.\n * This method is called before initialize\n *\n * @return {Array}|null\n * @private\n * */\n getClasses() {\n return this.model.getClasses().join(' ');\n },\n\n /**\n * Update attributes\n * @private\n * */\n updateAttributes() {\n const attrs = [];\n const { model, $el, el } = this;\n const { highlightable, textable, type } = model.attributes;\n\n const defaultAttr = {\n 'data-gjs-type': type || 'default',\n ...(this.__isDraggable() ? { draggable: true } : {}),\n ...(highlightable ? { 'data-highlightable': 1 } : {}),\n ...(textable\n ? {\n contenteditable: 'false',\n 'data-gjs-textable': 'true'\n }\n : {})\n };\n\n // Remove all current attributes\n each(el.attributes, attr => attrs.push(attr.nodeName));\n attrs.forEach(attr => $el.removeAttr(attr));\n this.updateStyle();\n const attr = {\n ...defaultAttr,\n ...model.getAttributes()\n };\n\n // Remove all `false` attributes\n keys(attr).forEach(key => attr[key] === false && delete attr[key]);\n\n $el.attr(attr);\n },\n\n /**\n * Update component content\n * @private\n * */\n updateContent() {\n const content = this.model.get('content');\n const hasComps = this.model.components().length;\n this.getChildrenContainer().innerHTML = hasComps ? '' : content;\n },\n\n /**\n * Prevent default helper\n * @param {Event} e\n * @private\n */\n prevDef(e) {\n e.preventDefault();\n },\n\n /**\n * Render component's script\n * @private\n */\n updateScript() {\n const { model, em } = this;\n if (!model.get('script')) return;\n em &&\n em\n .get('Canvas')\n .getCanvasView()\n .updateScript(this);\n },\n\n /**\n * Return children container\n * Differently from a simple component where children container is the\n * component itself\n * \n * \n * \n * You could have the children container more deeper\n * \n *
\n *
\n *
\n *
\n * \n *
\n *
\n *
\n * @return HTMLElement\n * @private\n */\n getChildrenContainer() {\n var container = this.el;\n\n if (typeof this.getChildrenSelector == 'function') {\n container = this.el.querySelector(this.getChildrenSelector());\n } else if (typeof this.getTemplate == 'function') {\n // Need to find deepest first child\n }\n\n return container;\n },\n\n /**\n * This returns rect informations not affected by the canvas zoom.\n * The method `getBoundingClientRect` doesn't work here and we\n * have to take in account offsetParent\n */\n getOffsetRect() {\n const rect = {};\n const target = this.el;\n let gtop = 0;\n let gleft = 0;\n\n const assignRect = el => {\n const { offsetParent } = el;\n\n if (offsetParent) {\n gtop += offsetParent.offsetTop;\n gleft += offsetParent.offsetLeft;\n assignRect(offsetParent);\n } else {\n rect.top = target.offsetTop + gtop;\n rect.left = target.offsetLeft + gleft;\n rect.bottom = rect.top + target.offsetHeight;\n rect.right = rect.left + target.offsetWidth;\n }\n };\n assignRect(target);\n\n return rect;\n },\n\n isInViewport({ rect } = {}) {\n const { el } = this;\n const elDoc = el.ownerDocument;\n const { body } = elDoc;\n const { frameElement } = elDoc.defaultView;\n const { top, left } = rect || this.getOffsetRect();\n const frame = this._getFrame().getOffsetRect();\n\n return (\n top >= frame.scrollTop &&\n left >= frame.scrollLeft &&\n top <= frame.scrollBottom &&\n left <= frameElement.offsetWidth + body.scrollLeft\n );\n },\n\n scrollIntoView(opts = {}) {\n const rect = this.getOffsetRect();\n const isInViewport = this.isInViewport({ rect });\n\n if (!isInViewport || opts.force) {\n const { el } = this;\n\n // PATCH: scrollIntoView won't work with multiple requests from iframes\n if (opts.behavior !== 'smooth') {\n el.ownerDocument.defaultView.scrollTo(0, rect.top);\n } else {\n el.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n ...opts\n });\n }\n }\n },\n\n /**\n * Recreate the element of the view\n */\n reset() {\n const { el } = this;\n this.el = '';\n this._ensureElement();\n this._setData();\n replaceWith(el, this.el);\n this.render();\n },\n\n _setData() {\n const { model } = this;\n const collection = model.components();\n const view = this;\n this.$el.data({ model, collection, view });\n },\n\n _getFrame() {\n return this.config.frameView;\n },\n\n /**\n * Render children components\n * @private\n */\n renderChildren() {\n this.updateContent();\n const container = this.getChildrenContainer();\n const view =\n this.childrenView ||\n new ComponentsView({\n collection: this.model.get('components'),\n config: this.config,\n componentTypes: this.opts.componentTypes\n });\n\n view.render(container);\n this.childrenView = view;\n const childNodes = Array.prototype.slice.call(view.el.childNodes);\n\n for (var i = 0, len = childNodes.length; i < len; i++) {\n container.appendChild(childNodes.shift());\n }\n },\n\n renderAttributes() {\n this.updateAttributes();\n this.updateClasses();\n },\n\n onAttrUpdate() {},\n\n render() {\n this.renderAttributes();\n if (this.modelOpt.temporary) return this;\n this.renderChildren();\n this.updateScript();\n setViewEl(this.el, this);\n this.postRender();\n\n return this;\n },\n\n postRender() {\n const { em, model, modelOpt } = this;\n\n if (!modelOpt.temporary) {\n this.onRender(this._clbObj());\n em && em.trigger('component:mount', model);\n }\n },\n\n onRender() {}\n});\n","// DOM helpers\nimport { each, isUndefined, isString } from 'underscore';\n\nconst KEY_TAG = 'tag';\nconst KEY_ATTR = 'attributes';\nconst KEY_CHILD = 'children';\n\nexport const motionsEv =\n 'transitionend oTransitionEnd transitionend webkitTransitionEnd';\n\nexport const isDoc = el => el && el.nodeType === 9;\n\nexport const removeEl = el => {\n const parent = el && el.parentNode;\n parent && parent.removeChild(el);\n};\n\nexport const find = (el, query) => el.querySelectorAll(query);\n\nexport const attrUp = (el, attrs = {}) =>\n el &&\n el.setAttribute &&\n each(attrs, (value, key) => el.setAttribute(key, value));\n\nexport const isVisible = el => {\n return (\n el && !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length)\n );\n};\n\nexport const empty = node => {\n while (node.firstChild) node.removeChild(node.firstChild);\n};\n\nexport const replaceWith = (oldEl, newEl) => {\n oldEl.parentNode.replaceChild(newEl, oldEl);\n};\n\nexport const appendAtIndex = (parent, child, index) => {\n const { childNodes } = parent;\n const total = childNodes.length;\n const at = isUndefined(index) ? total : index;\n\n if (isString(child)) {\n parent.insertAdjacentHTML('beforeEnd', child);\n child = parent.lastChild;\n parent.removeChild(child);\n }\n\n if (at >= total) {\n parent.appendChild(child);\n } else {\n parent.insertBefore(child, childNodes[at]);\n }\n};\n\nexport const append = (parent, child) => appendAtIndex(parent, child);\n\nexport const createEl = (tag, attrs = '', child) => {\n const el = document.createElement(tag);\n attrs && each(attrs, (value, key) => el.setAttribute(key, value));\n\n if (child) {\n if (isString(child)) el.innerHTML = child;\n else el.appendChild(child);\n }\n\n return el;\n};\n\nexport const createText = str => document.createTextNode(str);\n\n// Unfortunately just creating `KeyboardEvent(e.type, e)` is not enough,\n// the keyCode/which will be always `0`. Even if it's an old/deprecated\n// property keymaster (and many others) still use it... using `defineProperty`\n// hack seems the only way\nexport const createCustomEvent = (e, cls) => {\n let oEvent;\n const { type } = e;\n try {\n oEvent = new window[cls](type, e);\n } catch (err) {\n oEvent = document.createEvent(cls);\n oEvent.initEvent(type, true, true);\n }\n oEvent._parentEvent = e;\n if (type.indexOf('key') === 0) {\n oEvent.keyCodeVal = e.keyCode;\n ['keyCode', 'which'].forEach(prop => {\n Object.defineProperty(oEvent, prop, {\n get() {\n return this.keyCodeVal;\n }\n });\n });\n }\n return oEvent;\n};\n\n/**\n * Append an array of vNodes to an element\n * @param {HTMLElement} node HTML element\n * @param {Array} vNodes Array of node objects\n */\nexport const appendVNodes = (node, vNodes = []) => {\n const vNodesArr = Array.isArray(vNodes) ? vNodes : [vNodes];\n vNodesArr.forEach(vnode => {\n const tag = vnode[KEY_TAG] || 'div';\n const attr = vnode[KEY_ATTR] || {};\n const el = document.createElement(tag);\n\n each(attr, (value, key) => {\n el.setAttribute(key, value);\n });\n\n node.appendChild(el);\n });\n};\n","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","import { Model } from 'common';\nimport { result, forEach, keys } from 'underscore';\n\nconst TYPE_CLASS = 1;\nconst TYPE_ID = 2;\n\n/**\n * @typedef Selector\n * @property {String} name Selector name, eg. `my-class`\n * @property {String} label Selector label, eg. `My Class`\n * @property {Number} [type=1] Type of the selector. 1 (class) | 2 (id)\n * @property {Boolean} [active=true] If not active, it's not selectable by the Style Manager.\n * @property {Boolean} [private=false] If true, it can't be seen by the Style Manager, but it will be rendered in the canvas and in export code.\n * @property {Boolean} [protected=false] If true, it can't be removed from the attacched component.\n */\nexport default class Selector extends Model {\n defaults() {\n return {\n name: '',\n label: '',\n type: TYPE_CLASS,\n active: true,\n private: false,\n protected: false,\n _undo: true\n };\n }\n\n initialize(props, opts = {}) {\n const { config = {} } = opts;\n const name = this.get('name');\n const label = this.get('label');\n\n if (!name) {\n this.set('name', label);\n } else if (!label) {\n this.set('label', name);\n }\n\n const namePreEsc = this.get('name');\n const { escapeName } = config;\n const nameEsc = escapeName\n ? escapeName(namePreEsc)\n : Selector.escapeName(namePreEsc);\n this.set('name', nameEsc);\n this.em = config.em;\n }\n\n isId() {\n return this.get('type') === TYPE_ID;\n }\n\n isClass() {\n return this.get('type') === TYPE_CLASS;\n }\n\n getFullName(opts = {}) {\n const { escape } = opts;\n const name = this.get('name');\n let pfx = '';\n\n switch (this.get('type')) {\n case TYPE_CLASS:\n pfx = '.';\n break;\n case TYPE_ID:\n pfx = '#';\n break;\n }\n\n return pfx + (escape ? escape(name) : name);\n }\n\n /**\n * Get selector as a string.\n * @returns {String}\n * @example\n * // Given such selector: { name: 'my-selector', type: 2 }\n * console.log(selector.toString());\n * // -> `#my-selector`\n */\n toString() {\n return this.getFullName();\n }\n\n /**\n * Get selector label.\n * @returns {String}\n * @example\n * // Given such selector: { name: 'my-selector', label: 'My selector' }\n * console.log(selector.getLabel());\n * // -> `My selector`\n */\n getLabel() {\n return this.get('label');\n }\n\n /**\n * Update selector label.\n * @param {String} label New label\n * @example\n * // Given such selector: { name: 'my-selector', label: 'My selector' }\n * selector.setLabel('New Label')\n * console.log(selector.getLabel());\n * // -> `New Label`\n */\n setLabel(label) {\n return this.set('label', label);\n }\n\n /**\n * Get selector active state.\n * @returns {Boolean}\n */\n getActive() {\n return this.get('active');\n }\n\n /**\n * Update selector active state.\n * @param {Boolean} value New active state\n */\n setActive(value) {\n return this.set('active', value);\n }\n\n toJSON(opts = {}) {\n const { em } = this;\n let obj = Model.prototype.toJSON.call(this, [opts]);\n const defaults = result(this, 'defaults');\n\n if (em && em.getConfig('avoidDefaults')) {\n forEach(defaults, (value, key) => {\n if (obj[key] === value) {\n delete obj[key];\n }\n });\n\n if (obj.label === obj.name) {\n delete obj.label;\n }\n\n const objLen = keys(obj).length;\n\n if (objLen === 1 && obj.name) {\n obj = obj.name;\n }\n\n if (objLen === 2 && obj.name && obj.type) {\n obj = this.getFullName();\n }\n }\n\n return obj;\n }\n}\n\nSelector.prototype.idAttribute = 'name';\n\n// Type selectors: https://developer.mozilla.org/it/docs/Web/CSS/CSS_Selectors\nSelector.TYPE_CLASS = TYPE_CLASS;\nSelector.TYPE_ID = TYPE_ID;\n\n/**\n * Escape string\n * @param {string} name\n * @return {string}\n * @private\n */\nSelector.escapeName = name => {\n return `${name}`.trim().replace(/([^a-z0-9\\w-\\:]+)/gi, '-');\n};\n","import { escape } from './mixins';\n\n/**\n * Safe ES6 tagged template strings\n * @param {Array} literals\n * @param {Array} substs\n * @returns {String}\n * @example\n * const str = 'Hello';\n * const strHtml = html`Escaped ${str}, unescaped $${str}`;\n */\nexport default function html(literals, ...substs) {\n const { raw } = literals;\n\n return raw.reduce((acc, lit, i) => {\n let subst = substs[i - 1];\n const last = raw[i - 1];\n\n if (Array.isArray(subst)) {\n subst = subst.join('');\n } else if (last && last.slice(-1) === '$') {\n // If the interpolation is preceded by a dollar sign, it won't be escaped\n acc = acc.slice(0, -1);\n } else {\n subst = escape(subst);\n }\n\n return acc + subst + lit;\n });\n}\n","/* Adapted for headless */\n/* MIT https://github.com/kenwheeler/cash */\n'use strict';\n\nvar doc = typeof document !== 'undefined' ? document : null,\n win = typeof window !== 'undefined' ? window : null,\n _Array$prototype = Array.prototype,\n filter = _Array$prototype.filter,\n indexOf = _Array$prototype.indexOf,\n map = _Array$prototype.map,\n push = _Array$prototype.push,\n reverse = _Array$prototype.reverse,\n slice = _Array$prototype.slice,\n splice = _Array$prototype.splice;\nvar idRe = /^#[\\w-]*$/,\n classRe = /^\\.[\\w-]*$/,\n htmlRe = /<.+>/,\n tagRe = /^\\w+$/; // @require ./variables.js\n\nfunction find(selector, context) {\n if (context === void 0) {\n context = doc;\n }\n\n return classRe.test(selector)\n ? context.getElementsByClassName(selector.slice(1))\n : tagRe.test(selector)\n ? context.getElementsByTagName(selector)\n : context.querySelectorAll(selector);\n} // @require ./find.js\n// @require ./variables.js\n\nfunction Cash(selector, context) {\n if (context === void 0) {\n context = doc;\n }\n\n if (!selector) return;\n if (selector.__cash) return selector;\n var eles = selector;\n\n if (isString(selector)) {\n if (context.__cash) context = context[0];\n eles = idRe.test(selector)\n ? context.getElementById(selector.slice(1))\n : htmlRe.test(selector)\n ? parseHTML(selector)\n : find(selector, context);\n if (!eles) return;\n } else if (isFunction(selector)) {\n return this.ready(selector); //FIXME: `fn.ready` is not included in `core`, but it's actually a core functionality\n }\n\n if (eles.nodeType || eles === win) eles = [eles];\n this.length = eles.length;\n\n for (var i = 0, l = this.length; i < l; i++) {\n this[i] = eles[i];\n }\n}\n\nfunction cash(selector, context) {\n return new Cash(selector, context);\n}\n/* PROTOTYPE */\n\nvar fn = (cash.fn = cash.prototype = Cash.prototype = {\n constructor: cash,\n __cash: true,\n length: 0,\n splice: splice // Ensures a cash collection gets printed as array-like in Chrome\n}); // @require core/cash.js\n// @require core/variables.js\n\nfn.get = function(index) {\n if (index === undefined) return slice.call(this);\n return this[index < 0 ? index + this.length : index];\n}; // @require core/cash.js\n// @require ./get.js\n\nfn.eq = function(index) {\n return cash(this.get(index));\n}; // @require core/cash.js\n// @require ./eq.js\n\nfn.first = function() {\n return this.eq(0);\n}; // @require core/cash.js\n// @require ./eq.js\n\nfn.last = function() {\n return this.eq(-1);\n}; // @require core/cash.js\n// @require core/variables.js\n\nfn.map = function(callback) {\n return cash(\n map.call(this, function(ele, i) {\n return callback.call(ele, i, ele);\n })\n );\n}; // @require core/cash.js\n// @require core/variables.js\n\nfn.slice = function() {\n return cash(slice.apply(this, arguments));\n}; // @require ./cash.js\n\nvar camelCaseRe = /(?:^\\w|[A-Z]|\\b\\w)/g,\n camelCaseWhitespaceRe = /[\\s-_]+/g;\n\nfunction camelCase(str) {\n return str\n .replace(camelCaseRe, function(letter, index) {\n return letter[!index ? 'toLowerCase' : 'toUpperCase']();\n })\n .replace(camelCaseWhitespaceRe, '');\n}\n\ncash.camelCase = camelCase; // @require ./cash.js\n\nfunction each(arr, callback) {\n for (var i = 0, l = arr.length; i < l; i++) {\n if (callback.call(arr[i], arr[i], i, arr) === false) break;\n }\n}\n\ncash.each = each; // @require core/cash.js\n// @require core/each.js\n\nfn.each = function(callback) {\n each(this, function(ele, i) {\n return callback.call(ele, i, ele);\n });\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.removeProp = function(prop) {\n return this.each(function(i, ele) {\n delete ele[prop];\n });\n}; // @require ./cash.js\n\nfunction extend(target) {\n if (target === void 0) {\n target = this;\n }\n\n var args = arguments,\n length = args.length;\n\n for (var i = length < 2 ? 0 : 1; i < length; i++) {\n for (var key in args[i]) {\n target[key] = args[i][key];\n }\n }\n\n return target;\n}\n\ncash.extend = fn.extend = extend; // @require ./cash.js\n\nvar guid = 1;\ncash.guid = guid; // @require ./cash.js\n\nfunction matches(ele, selector) {\n var matches =\n ele &&\n (ele.matches ||\n ele.webkitMatchesSelector ||\n ele.mozMatchesSelector ||\n ele.msMatchesSelector ||\n ele.oMatchesSelector);\n return !!matches && matches.call(ele, selector);\n}\n\ncash.matches = matches; // @require ./cash.js\n\nfunction isFunction(x) {\n return typeof x === 'function';\n}\n\ncash.isFunction = isFunction;\n\nfunction isString(x) {\n return typeof x === 'string';\n}\n\ncash.isString = isString;\n\nfunction isNumeric(x) {\n return !isNaN(parseFloat(x)) && isFinite(x);\n}\n\ncash.isNumeric = isNumeric;\nvar isArray = Array.isArray;\ncash.isArray = isArray; // @require core/cash.js\n// @require core/type_checking.js\n// @require collection/each.js\n\nfn.prop = function(prop, value) {\n if (!prop) return;\n\n if (isString(prop)) {\n if (arguments.length < 2) return this[0] && this[0][prop];\n return this.each(function(i, ele) {\n ele[prop] = value;\n });\n }\n\n for (var key in prop) {\n this.prop(key, prop[key]);\n }\n\n return this;\n}; // @require ./matches.js\n// @require ./type_checking.js\n\nfunction getCompareFunction(selector) {\n return isString(selector)\n ? function(i, ele) {\n return matches(ele, selector);\n }\n : selector.__cash\n ? function(i, ele) {\n return selector.is(ele);\n }\n : function(i, ele, selector) {\n return ele === selector;\n };\n} // @require core/cash.js\n// @require core/get_compare_function.js\n// @require core/type_checking.js\n// @require core/variables.js\n// @require collection/get.js\n\nfn.filter = function(selector) {\n if (!selector) return cash();\n var comparator = isFunction(selector)\n ? selector\n : getCompareFunction(selector);\n return cash(\n filter.call(this, function(ele, i) {\n return comparator.call(ele, i, ele, selector);\n })\n );\n}; // @require ./type_checking.js\n\nvar splitValuesRe = /\\S+/g;\n\nfunction getSplitValues(str) {\n return isString(str) ? str.match(splitValuesRe) || [] : [];\n} // @require core/cash.js\n// @require core/get_split_values.js\n// @require collection/each.js\n\nfn.hasClass = function(cls) {\n var classes = getSplitValues(cls);\n var check = false;\n\n if (classes.length) {\n this.each(function(i, ele) {\n check = ele.classList.contains(classes[0]);\n return !check;\n });\n }\n\n return check;\n}; // @require core/cash.js\n// @require core/get_split_values.js\n// @require collection/each.js\n\nfn.removeAttr = function(attr) {\n var attrs = getSplitValues(attr);\n if (!attrs.length) return this;\n return this.each(function(i, ele) {\n each(attrs, function(a) {\n ele.removeAttribute(a);\n });\n });\n}; // @require core/cash.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./remove_attr.js\n\nfn.attr = function(attr, value) {\n if (!attr) return;\n\n if (isString(attr)) {\n if (arguments.length < 2) {\n if (!this[0]) return;\n\n var _value = this[0].getAttribute(attr);\n\n return _value === null ? undefined : _value;\n }\n\n if (value === null) return this.removeAttr(attr);\n return this.each(function(i, ele) {\n ele.setAttribute(attr, value);\n });\n }\n\n for (var key in attr) {\n this.attr(key, attr[key]);\n }\n\n return this;\n}; // @require core/cash.js\n// @require core/each.js\n// @require core/get_split_values.js\n// @require collection/each.js\n\nfn.toggleClass = function(cls, force) {\n var classes = getSplitValues(cls),\n isForce = force !== undefined;\n if (!classes.length) return this;\n return this.each(function(i, ele) {\n each(classes, function(c) {\n if (isForce) {\n force ? ele.classList.add(c) : ele.classList.remove(c);\n } else {\n ele.classList.toggle(c);\n }\n });\n });\n}; // @require core/cash.js\n// @require ./toggle_class.js\n\nfn.addClass = function(cls) {\n return this.toggleClass(cls, true);\n}; // @require core/cash.js\n// @require ./attr.js\n// @require ./toggle_class.js\n\nfn.removeClass = function(cls) {\n return !arguments.length\n ? this.attr('class', '')\n : this.toggleClass(cls, false);\n}; // @optional ./add_class.js\n// @optional ./attr.js\n// @optional ./has_class.js\n// @optional ./prop.js\n// @optional ./remove_attr.js\n// @optional ./remove_class.js\n// @optional ./remove_prop.js\n// @optional ./toggle_class.js\n// @require ./cash.js\n\nfunction unique(arr) {\n return arr.filter(function(item, index, self) {\n return self.indexOf(item) === index;\n });\n}\n\ncash.unique = unique; // @require core/cash.js\n// @require core/unique.js\n// @require ./get.js\n\nfn.add = function(selector, context) {\n return cash(unique(this.get().concat(cash(selector, context).get())));\n}; // @require core/variables.js\n\nfunction computeStyle(ele, prop, isVariable) {\n if (ele.nodeType !== 1) return;\n var style = win.getComputedStyle(ele, null);\n return prop\n ? isVariable\n ? style.getPropertyValue(prop)\n : style[prop]\n : style;\n} // @require ./compute_style.js\n\nfunction computeStyleInt(ele, prop) {\n return parseInt(computeStyle(ele, prop), 10) || 0;\n}\n\nvar cssVariableRe = /^--/; // @require ./variables.js\n\nfunction isCSSVariable(prop) {\n return cssVariableRe.test(prop);\n} // @require core/camel_case.js\n// @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n// @require ./is_css_variable.js\n\nvar prefixedProps = {},\n docEl = doc && doc.createElement('div'),\n style = docEl ? docEl.style : {},\n vendorsPrefixes = ['webkit', 'moz', 'ms', 'o'];\n\nfunction getPrefixedProp(prop, isVariable) {\n if (isVariable === void 0) {\n isVariable = isCSSVariable(prop);\n }\n\n if (isVariable) return prop;\n\n if (!prefixedProps[prop]) {\n var propCC = camelCase(prop),\n propUC = '' + propCC.charAt(0).toUpperCase() + propCC.slice(1),\n props = (\n propCC +\n ' ' +\n vendorsPrefixes.join(propUC + ' ') +\n propUC\n ).split(' ');\n each(props, function(p) {\n if (p in style) {\n prefixedProps[prop] = p;\n return false;\n }\n });\n }\n\n return prefixedProps[prop];\n}\n\ncash.prefixedProp = getPrefixedProp; // @require core/type_checking.js\n// @require ./is_css_variable.js\n\nvar numericProps = {\n animationIterationCount: true,\n columnCount: true,\n flexGrow: true,\n flexShrink: true,\n fontWeight: true,\n lineHeight: true,\n opacity: true,\n order: true,\n orphans: true,\n widows: true,\n zIndex: true\n};\n\nfunction getSuffixedValue(prop, value, isVariable) {\n if (isVariable === void 0) {\n isVariable = isCSSVariable(prop);\n }\n\n return !isVariable && !numericProps[prop] && isNumeric(value)\n ? value + 'px'\n : value;\n} // @require core/cash.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./helpers/compute_style.js\n// @require ./helpers/get_prefixed_prop.js\n// @require ./helpers/get_suffixed_value.js\n// @require ./helpers/is_css_variable.js\n\nfn.css = function(prop, value) {\n if (isString(prop)) {\n var isVariable = isCSSVariable(prop);\n prop = getPrefixedProp(prop, isVariable);\n if (arguments.length < 2)\n return this[0] && computeStyle(this[0], prop, isVariable);\n if (!prop) return this;\n value = getSuffixedValue(prop, value, isVariable);\n return this.each(function(i, ele) {\n if (ele.nodeType !== 1) return;\n\n if (isVariable) {\n ele.style.setProperty(prop, value);\n } else {\n ele.style[prop] = value;\n }\n });\n }\n\n for (var key in prop) {\n this.css(key, prop[key]);\n }\n\n return this;\n}; // @optional ./css.js\n\nvar dataNamespace = '__cashData',\n dataAttributeRe = /^data-(.*)/; // @require core/cash.js\n// @require ./helpers/variables.js\n\ncash.hasData = function(ele) {\n return dataNamespace in ele;\n}; // @require ./variables.js\n\nfunction getDataCache(ele) {\n return (ele[dataNamespace] = ele[dataNamespace] || {});\n} // @require attributes/attr.js\n// @require ./get_data_cache.js\n\nfunction getData(ele, key) {\n var cache = getDataCache(ele);\n\n if (key) {\n if (!(key in cache)) {\n var value = ele.dataset\n ? ele.dataset[key] || ele.dataset[camelCase(key)]\n : cash(ele).attr('data-' + key);\n\n if (value !== undefined) {\n try {\n value = JSON.parse(value);\n } catch (e) {}\n\n cache[key] = value;\n }\n }\n\n return cache[key];\n }\n\n return cache;\n} // @require ./variables.js\n// @require ./get_data_cache.js\n\nfunction removeData(ele, key) {\n if (key === undefined) {\n delete ele[dataNamespace];\n } else {\n delete getDataCache(ele)[key];\n }\n} // @require ./get_data_cache.js\n\nfunction setData(ele, key, value) {\n getDataCache(ele)[key] = value;\n} // @require core/cash.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./helpers/get_data.js\n// @require ./helpers/set_data.js\n// @require ./helpers/variables.js\n\nfn.data = function(name, value) {\n var _this = this;\n\n if (!name) {\n if (!this[0]) return;\n each(this[0].attributes, function(attr) {\n var match = attr.name.match(dataAttributeRe);\n if (!match) return;\n\n _this.data(match[1]);\n });\n return getData(this[0]);\n }\n\n if (isString(name)) {\n if (value === undefined) return this[0] && getData(this[0], name);\n return this.each(function(i, ele) {\n return setData(ele, name, value);\n });\n }\n\n for (var key in name) {\n this.data(key, name[key]);\n }\n\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n// @require ./helpers/remove_data.js\n\nfn.removeData = function(key) {\n return this.each(function(i, ele) {\n return removeData(ele, key);\n });\n}; // @optional ./data.js\n// @optional ./remove_data.js\n// @require css/helpers/compute_style_int.js\n\nfunction getExtraSpace(ele, xAxis) {\n return (\n computeStyleInt(ele, 'border' + (xAxis ? 'Left' : 'Top') + 'Width') +\n computeStyleInt(ele, 'padding' + (xAxis ? 'Left' : 'Top')) +\n computeStyleInt(ele, 'padding' + (xAxis ? 'Right' : 'Bottom')) +\n computeStyleInt(ele, 'border' + (xAxis ? 'Right' : 'Bottom') + 'Width')\n );\n} // @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n\neach(['Width', 'Height'], function(prop) {\n fn['inner' + prop] = function() {\n if (!this[0]) return;\n if (this[0] === win) return win['inner' + prop];\n return this[0]['client' + prop];\n };\n}); // @require core/camel_case.js\n// @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n// @require css/helpers/compute_style.js\n// @require css/helpers/get_suffixed_value.js\n// @require ./helpers/get_extra_space.js\n\neach(['width', 'height'], function(prop, index) {\n fn[prop] = function(value) {\n if (!this[0]) return value === undefined ? undefined : this;\n\n if (!arguments.length) {\n if (this[0] === win) return this[0][camelCase('outer-' + prop)];\n return (\n this[0].getBoundingClientRect()[prop] - getExtraSpace(this[0], !index)\n );\n }\n\n value = parseInt(value, 10);\n return this.each(function(i, ele) {\n if (ele.nodeType !== 1) return;\n var boxSizing = computeStyle(ele, 'boxSizing');\n ele.style[prop] = getSuffixedValue(\n prop,\n value + (boxSizing === 'border-box' ? getExtraSpace(ele, !index) : 0)\n );\n });\n };\n}); // @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n// @require css/helpers/compute_style_int.js\n\neach(['Width', 'Height'], function(prop, index) {\n fn['outer' + prop] = function(includeMargins) {\n if (!this[0]) return;\n if (this[0] === win) return win['outer' + prop];\n return (\n this[0]['offset' + prop] +\n (includeMargins\n ? computeStyleInt(this[0], 'margin' + (!index ? 'Left' : 'Top')) +\n computeStyleInt(this[0], 'margin' + (!index ? 'Right' : 'Bottom'))\n : 0)\n );\n };\n}); // @optional ./inner.js\n// @optional ./normal.js\n// @optional ./outer.js\n\nfunction hasNamespaces(ns1, ns2) {\n for (var i = 0, l = ns2.length; i < l; i++) {\n if (ns1.indexOf(ns2[i]) < 0) return false;\n }\n\n return true;\n} // @require core/each.js\n\nfunction removeEventListeners(cache, ele, name) {\n each(cache[name], function(_ref) {\n var namespaces = _ref[0],\n callback = _ref[1];\n ele.removeEventListener(name, callback);\n });\n delete cache[name];\n}\n\nvar eventsNamespace = '__cashEvents',\n eventsNamespacesSeparator = '.'; // @require ./variables.js\n\nfunction getEventsCache(ele) {\n return (ele[eventsNamespace] = ele[eventsNamespace] || {});\n} // @require core/guid.js\n// @require events/helpers/get_events_cache.js\n\nfunction addEvent(ele, name, namespaces, callback) {\n callback.guid = callback.guid || guid++;\n var eventCache = getEventsCache(ele);\n eventCache[name] = eventCache[name] || [];\n eventCache[name].push([namespaces, callback]);\n ele.addEventListener(name, callback);\n} // @require ./variables.js\n\nfunction parseEventName(eventName) {\n var parts = eventName.split(eventsNamespacesSeparator);\n return [parts[0], parts.slice(1).sort()]; // [name, namespaces]\n} // @require core/guid.js\n// @require ./get_events_cache.js\n// @require ./has_namespaces.js\n// @require ./parse_event_name.js\n// @require ./remove_event_listeners.js\n\nfunction removeEvent(ele, name, namespaces, callback) {\n var cache = getEventsCache(ele);\n\n if (!name) {\n if (!namespaces || !namespaces.length) {\n for (name in cache) {\n removeEventListeners(cache, ele, name);\n }\n } else {\n for (name in cache) {\n removeEvent(ele, name, namespaces, callback);\n }\n }\n } else {\n var eventCache = cache[name];\n if (!eventCache) return;\n if (callback) callback.guid = callback.guid || guid++;\n cache[name] = eventCache.filter(function(_ref2) {\n var ns = _ref2[0],\n cb = _ref2[1];\n if (\n (callback && cb.guid !== callback.guid) ||\n !hasNamespaces(ns, namespaces)\n )\n return true;\n ele.removeEventListener(name, cb);\n });\n }\n} // @require core/cash.js\n// @require core/each.js\n// @require collection/each.js\n// @require ./helpers/parse_event_name.js\n// @require ./helpers/remove_event.js\n\nfn.off = function(eventFullName, callback) {\n var _this2 = this;\n\n if (eventFullName === undefined) {\n this.each(function(i, ele) {\n return removeEvent(ele);\n });\n } else {\n each(getSplitValues(eventFullName), function(eventFullName) {\n var _parseEventName = parseEventName(eventFullName),\n name = _parseEventName[0],\n namespaces = _parseEventName[1];\n\n _this2.each(function(i, ele) {\n return removeEvent(ele, name, namespaces, callback);\n });\n });\n }\n\n return this;\n}; // @require core/cash.js\n// @require core/get_split_values.js\n// @require core/guid.js\n// @require core/matches.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./helpers/variables.js\n// @require ./helpers/add_event.js\n// @require ./helpers/has_namespaces.js\n// @require ./helpers/parse_event_name.js\n// @require ./helpers/remove_event.js\n\nfn.on = function(eventFullName, selector, callback, _one) {\n var _this3 = this;\n\n if (!isString(eventFullName)) {\n for (var key in eventFullName) {\n this.on(key, selector, eventFullName[key]);\n }\n\n return this;\n }\n\n if (isFunction(selector)) {\n callback = selector;\n selector = false;\n }\n\n each(getSplitValues(eventFullName), function(eventFullName) {\n var _parseEventName2 = parseEventName(eventFullName),\n name = _parseEventName2[0],\n namespaces = _parseEventName2[1];\n\n _this3.each(function(i, ele) {\n var finalCallback = function finalCallback(event) {\n if (\n event.namespace &&\n !hasNamespaces(\n namespaces,\n event.namespace.split(eventsNamespacesSeparator)\n )\n )\n return;\n var thisArg = ele;\n\n if (selector) {\n var target = event.target;\n\n while (!matches(target, selector)) {\n if (target === ele) return;\n target = target.parentNode;\n if (!target) return;\n }\n\n thisArg = target;\n }\n\n event.namespace = event.namespace || '';\n var returnValue = callback.call(thisArg, event, event.data);\n\n if (_one) {\n removeEvent(ele, name, namespaces, finalCallback);\n }\n\n if (returnValue === false) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n finalCallback.guid = callback.guid = callback.guid || guid++;\n addEvent(ele, name, namespaces, finalCallback);\n });\n });\n return this;\n}; // @require core/cash.js\n// @require ./on.js\n\nfn.one = function(eventFullName, delegate, callback) {\n return this.on(eventFullName, delegate, callback, true);\n}; // @require core/cash.js\n// @require core/variables.js\n\nfn.ready = function(callback) {\n var finalCallback = function finalCallback() {\n return callback(cash);\n };\n\n if (doc.readyState !== 'loading') {\n setTimeout(finalCallback);\n } else {\n doc.addEventListener('DOMContentLoaded', finalCallback);\n }\n\n return this;\n}; // @require core/cash.js\n// @require core/type_checking.js\n// @require core/variables.js\n// @require collection/each.js\n// @require ./helpers/parse_event_name.js\n// @require ./helpers/variables.js\n\nfn.trigger = function(eventFullName, data) {\n var evt = eventFullName;\n\n if (isString(eventFullName)) {\n var _parseEventName3 = parseEventName(eventFullName),\n name = _parseEventName3[0],\n namespaces = _parseEventName3[1];\n\n evt = doc.createEvent('HTMLEvents');\n evt.initEvent(name, true, true);\n evt.namespace = namespaces.join(eventsNamespacesSeparator);\n }\n\n evt.data = data;\n return this.each(function(i, ele) {\n ele.dispatchEvent(evt);\n });\n}; // @optional ./off.js\n// @optional ./on.js\n// @optional ./one.js\n// @optional ./ready.js\n// @optional ./trigger.js\n// @require core/each.js\n\nfunction getValueSelectMultiple(ele) {\n var values = [];\n each(ele.options, function(option) {\n if (option.selected && !option.disabled && !option.parentNode.disabled) {\n values.push(option.value);\n }\n });\n return values;\n}\n\nfunction getValueSelectSingle(ele) {\n return ele.selectedIndex < 0 ? null : ele.options[ele.selectedIndex].value;\n} // @require ./get_value_select_single.js\n// @require ./get_value_select_multiple.js\n\nvar selectOneRe = /select-one/i,\n selectMultipleRe = /select-multiple/i;\n\nfunction getValue(ele) {\n var type = ele.type;\n if (selectOneRe.test(type)) return getValueSelectSingle(ele);\n if (selectMultipleRe.test(type)) return getValueSelectMultiple(ele);\n return ele.value;\n}\n\nvar queryEncodeSpaceRe = /%20/g;\n\nfunction queryEncode(prop, value) {\n return (\n '&' +\n encodeURIComponent(prop) +\n '=' +\n encodeURIComponent(value).replace(queryEncodeSpaceRe, '+')\n );\n} // @require core/cash.js\n// @require core/each.js\n// @require core/type_checking.js\n// @require ./helpers/get_value.js\n// @require ./helpers/query_encode.js\n\nvar skippableRe = /file|reset|submit|button|image/i,\n checkableRe = /radio|checkbox/i;\n\nfn.serialize = function() {\n var query = '';\n this.each(function(i, ele) {\n each(ele.elements || [ele], function(ele) {\n if (ele.disabled || !ele.name || ele.tagName === 'FIELDSET') return;\n if (skippableRe.test(ele.type)) return;\n if (checkableRe.test(ele.type) && !ele.checked) return;\n var value = getValue(ele);\n if (value === undefined) return;\n var values = isArray(value) ? value : [value];\n each(values, function(value) {\n query += queryEncode(ele.name, value);\n });\n });\n });\n return query.substr(1);\n}; // @require core/cash.js\n// @require core/each.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./helpers/get_value.js\n\nfn.val = function(value) {\n if (value === undefined) return this[0] && getValue(this[0]);\n return this.each(function(i, ele) {\n var isMultiple = selectMultipleRe.test(ele.type),\n eleValue = value === null ? (isMultiple ? [] : '') : value;\n\n if (isMultiple && isArray(eleValue)) {\n each(ele.options, function(option) {\n option.selected = eleValue.indexOf(option.value) >= 0;\n });\n } else {\n ele.value = eleValue;\n }\n });\n}; // @optional ./serialize.js\n// @optional ./val.js\n// @require core/cash.js\n// @require collection/map.js\n\nfn.clone = function() {\n return this.map(function(i, ele) {\n return ele.cloneNode(true);\n });\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.detach = function() {\n return this.each(function(i, ele) {\n if (ele.parentNode) {\n ele.parentNode.removeChild(ele);\n }\n });\n}; // @require ./cash.js\n// @require ./variables.js\n// @require ./type_checking.js\n// @require collection/get.js\n// @require manipulation/detach.js\n\nvar fragmentRe = /^\\s*<(\\w+)[^>]*>/,\n singleTagRe = /^\\s*<(\\w+)\\s*\\/?>(?:<\\/\\1>)?\\s*$/;\nvar containers;\n\nfunction initContainers() {\n if (containers) return;\n var table = doc.createElement('table'),\n tr = doc.createElement('tr');\n containers = {\n '*': doc.createElement('div'),\n tr: doc.createElement('tbody'),\n td: tr,\n th: tr,\n thead: table,\n tbody: table,\n tfoot: table\n };\n}\n\nfunction parseHTML(html) {\n initContainers();\n if (!isString(html)) return [];\n if (singleTagRe.test(html)) return [doc.createElement(RegExp.$1)];\n var fragment = fragmentRe.test(html) && RegExp.$1,\n container = containers[fragment] || containers['*'];\n container.innerHTML = html;\n return cash(container.childNodes)\n .detach()\n .get();\n}\n\ncash.parseHTML = parseHTML; // @optional ./camel_case.js\n// @optional ./each.js\n// @optional ./export.js\n// @optional ./extend.js\n// @optional ./find.js\n// @optional ./get_compare_function.js\n// @optional ./get_split_values.js\n// @optional ./guid.js\n// @optional ./matches.js\n// @optional ./parse_html.js\n// @optional ./unique.js\n// @optional ./variables.js\n// @require ./cash.js\n// @require ./type_checking.js\n// @require core/cash.js\n\nfn.empty = function() {\n var ele = this[0];\n\n if (ele) {\n while (ele.firstChild) {\n ele.removeChild(ele.firstChild);\n }\n }\n\n return this;\n};\n\nfunction insertElement(ele, child, prepend) {\n if (prepend) {\n ele.insertBefore(child, ele.childNodes[0]);\n } else {\n ele.appendChild(child);\n }\n} // @require core/each.js\n// @require core/type_checking.js\n// @require ./insert_element.js\n\nfunction insertContent(parent, child, prepend) {\n if (child === undefined) return;\n var isStr = isString(child);\n\n if (!isStr && child.length) {\n each(child, function(ele) {\n return insertContent(parent, ele, prepend);\n });\n } else {\n each(\n parent,\n isStr\n ? function(ele) {\n ele.insertAdjacentHTML(prepend ? 'afterbegin' : 'beforeend', child);\n }\n : function(ele, index) {\n return insertElement(\n ele,\n !index ? child : child.cloneNode(true),\n prepend\n );\n }\n );\n }\n} // @require core/cash.js\n// @require core/each.js\n// @require ./helpers/insert_content.js\n\nfn.append = function() {\n var _this4 = this;\n\n each(arguments, function(content) {\n insertContent(_this4, content);\n });\n return this;\n}; // @require core/cash.js\n// @require ./helpers/insert_content.js\n\nfn.appendTo = function(parent) {\n insertContent(cash(parent), this);\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.html = function(content) {\n if (content === undefined) return this[0] && this[0].innerHTML;\n var source = content.nodeType ? content[0].outerHTML : content;\n return this.each(function(i, ele) {\n ele.innerHTML = source;\n });\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.insertAfter = function(content) {\n var _this5 = this;\n\n cash(content).each(function(index, ele) {\n var parent = ele.parentNode;\n\n _this5.each(function(i, e) {\n parent.insertBefore(!index ? e : e.cloneNode(true), ele.nextSibling);\n });\n });\n return this;\n}; // @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n// @require collection/slice.js\n// @require ./insert_after.js\n\nfn.after = function() {\n var _this6 = this;\n\n each(reverse.apply(arguments), function(content) {\n reverse.apply(cash(content).slice()).insertAfter(_this6);\n });\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.insertBefore = function(selector) {\n var _this7 = this;\n\n cash(selector).each(function(index, ele) {\n var parent = ele.parentNode;\n\n _this7.each(function(i, e) {\n parent.insertBefore(!index ? e : e.cloneNode(true), ele);\n });\n });\n return this;\n}; // @require core/cash.js\n// @require core/each.js\n// @require ./insert_before.js\n\nfn.before = function() {\n var _this8 = this;\n\n each(arguments, function(content) {\n cash(content).insertBefore(_this8);\n });\n return this;\n}; // @require core/cash.js\n// @require core/each.js\n// @require ./helpers/insert_content.js\n\nfn.prepend = function() {\n var _this9 = this;\n\n each(arguments, function(content) {\n insertContent(_this9, content, true);\n });\n return this;\n}; // @require core/cash.js\n// @require core/variables.js\n// @require collection/slice.js\n// @require ./helpers/insert_content.js\n\nfn.prependTo = function(parent) {\n insertContent(cash(parent), reverse.apply(this.slice()), true);\n return this;\n}; // @require core/cash.js\n// @require events/off.js\n// @require ./detach.js\n\nfn.remove = function() {\n return this.detach().off();\n}; // @require core/cash.js\n// @require collection/each.js\n// @require collection/slice.js\n// @require ./after.js\n// @require ./remove.js\n\nfn.replaceWith = function(content) {\n var _this10 = this;\n\n return this.each(function(i, ele) {\n var parent = ele.parentNode;\n if (!parent) return;\n var $eles = i ? cash(content).clone() : cash(content);\n\n if (!$eles[0]) {\n _this10.remove();\n\n return false;\n }\n\n parent.replaceChild($eles[0], ele);\n cash($eles[0]).after($eles.slice(1));\n });\n}; // @require core/cash.js\n// @require ./replace_with.js\n\nfn.replaceAll = function(content) {\n cash(content).replaceWith(this);\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.text = function(content) {\n if (content === undefined) return this[0] ? this[0].textContent : '';\n return this.each(function(i, ele) {\n ele.textContent = content;\n });\n}; // @optional ./after.js\n// @optional ./append.js\n// @optional ./append_to.js\n// @optional ./before.js\n// @optional ./clone.js\n// @optional ./detach.js\n// @optional ./empty.js\n// @optional ./html.js\n// @optional ./insert_after.js\n// @optional ./insert_before.js\n// @optional ./prepend.js\n// @optional ./prepend_to.js\n// @optional ./remove.js\n// @optional ./replace_all.js\n// @optional ./replace_with.js\n// @optional ./text.js\n// @require core/cash.js\n// @require core/variables.js\n\nvar docEle = doc && doc.documentElement;\n\nfn.offset = function() {\n var ele = this[0];\n if (!ele) return;\n var rect = ele.getBoundingClientRect();\n return {\n top: rect.top + win.pageYOffset - docEle.clientTop,\n left: rect.left + win.pageXOffset - docEle.clientLeft\n };\n}; // @require core/cash.js\n\nfn.offsetParent = function() {\n return cash(this[0] && this[0].offsetParent);\n}; // @require core/cash.js\n\nfn.position = function() {\n var ele = this[0];\n if (!ele) return;\n return {\n left: ele.offsetLeft,\n top: ele.offsetTop\n };\n}; // @optional ./offset.js\n// @optional ./offset_parent.js\n// @optional ./position.js\n// @require core/cash.js\n// @require core/matches.js\n// @require core/unique.js\n// @require collection/each.js\n// @require collection/filter.js\n\nfn.children = function(selector) {\n var result = [];\n this.each(function(i, ele) {\n push.apply(result, ele.children);\n });\n result = cash(unique(result));\n if (!selector) return result;\n return result.filter(function(i, ele) {\n return matches(ele, selector);\n });\n}; // @require core/cash.js\n// @require core/unique.js\n// @require collection/each.js\n\nfn.contents = function() {\n var result = [];\n this.each(function(i, ele) {\n push.apply(\n result,\n ele.tagName === 'IFRAME' ? [ele.contentDocument] : ele.childNodes\n );\n });\n return cash(result.length && unique(result));\n}; // @require core/cash.js\n// @require core/unique.js\n// @require core/find.js\n// @require core/variables.js\n\nfn.find = function(selector) {\n var result = [];\n\n for (var i = 0, l = this.length; i < l; i++) {\n var found = find(selector, this[i]);\n\n if (found.length) {\n push.apply(result, found);\n }\n }\n\n return cash(result.length && unique(result));\n}; // @require core/cash.js\n// @require core/find.js\n// @require core/type_checking.js\n// @require collection/filter.js\n\nfn.has = function(selector) {\n var comparator = isString(selector)\n ? function(i, ele) {\n return !!find(selector, ele).length;\n }\n : function(i, ele) {\n return ele.contains(selector);\n };\n return this.filter(comparator);\n}; // @require core/cash.js\n// @require core/get_compare_function.js\n// @require collection/each.js\n\nfn.is = function(selector) {\n if (!selector || !this[0]) return false;\n var comparator = getCompareFunction(selector);\n var check = false;\n this.each(function(i, ele) {\n check = comparator(i, ele, selector);\n return !check;\n });\n return check;\n}; // @require core/cash.js\n\nfn.next = function() {\n return cash(this[0] && this[0].nextElementSibling);\n}; // @require core/cash.js\n// @require core/get_compare_function.js\n// @require collection/filter.js\n\nfn.not = function(selector) {\n if (!selector || !this[0]) return this;\n var comparator = getCompareFunction(selector);\n return this.filter(function(i, ele) {\n return !comparator(i, ele, selector);\n });\n}; // @require core/cash.js\n// @require core/unique.js\n// @require collection/each.js\n\nfn.parent = function() {\n var result = [];\n this.each(function(i, ele) {\n if (ele && ele.parentNode) {\n result.push(ele.parentNode);\n }\n });\n return cash(unique(result));\n}; // @require core/cash.js\n// @require core/variables.js\n// @require traversal/children.js\n// @require traversal/parent.js\n// @require ./get.js\n//FIXME Ugly file name, is there a better option?\n\nfn.index = function(ele) {\n var child = ele ? cash(ele)[0] : this[0],\n collection = ele\n ? this\n : cash(child)\n .parent()\n .children();\n return indexOf.call(collection, child);\n}; // @optional ./add.js\n// @optional ./each.js\n// @optional ./eq.js\n// @optional ./filter.js\n// @optional ./first.js\n// @optional ./get.js\n// @optional ./indexFn.js\n// @optional ./last.js\n// @optional ./map.js\n// @optional ./slice.js\n// @require core/cash.js\n// @require collection/filter.js\n// @require ./is.js\n// @require ./parent.js\n\nfn.closest = function(selector) {\n if (!selector || !this[0]) return cash();\n if (this.is(selector)) return this.filter(selector);\n return this.parent().closest(selector);\n}; // @require core/cash.js\n// @require core/matches.js\n// @require core/unique.js\n// @require core/variables.js\n// @require collection/each.js\n\nfn.parents = function(selector) {\n var result = [];\n var last;\n this.each(function(i, ele) {\n last = ele;\n\n while (last && last.parentNode && last !== doc.body.parentNode) {\n last = last.parentNode;\n\n if (!selector || (selector && matches(last, selector))) {\n result.push(last);\n }\n }\n });\n return cash(unique(result));\n}; // @require core/cash.js\n\nfn.prev = function() {\n return cash(this[0] && this[0].previousElementSibling);\n}; // @require core/cash.js\n// @require collection/filter.js\n// @require ./children.js\n// @require ./parent.js\n\nfn.siblings = function() {\n var ele = this[0];\n return this.parent()\n .children()\n .filter(function(i, child) {\n return child !== ele;\n });\n}; // @optional ./children.js\n// @optional ./closest.js\n// @optional ./contents.js\n// @optional ./find.js\n// @optional ./has.js\n// @optional ./is.js\n// @optional ./next.js\n// @optional ./not.js\n// @optional ./parent.js\n// @optional ./parents.js\n// @optional ./prev.js\n// @optional ./siblings.js\n// @optional attributes/index.js\n// @optional collection/index.js\n// @optional css/index.js\n// @optional data/index.js\n// @optional dimensions/index.js\n// @optional events/index.js\n// @optional forms/index.js\n// @optional manipulation/index.js\n// @optional offset/index.js\n// @optional traversal/index.js\n// @require core/index.js\nexport default cash;\n","function _taggedTemplateLiteral(strings, raw) {\n if (!raw) {\n raw = strings.slice(0);\n }\n\n return Object.freeze(Object.defineProperties(strings, {\n raw: {\n value: Object.freeze(raw)\n }\n }));\n}\n\nmodule.exports = _taggedTemplateLiteral;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","import { filter } from 'underscore';\nimport { Collection } from 'common';\nimport Selector from './Selector';\n\nexport default class Selectors extends Collection {\n modelId(attr) {\n return `${attr.name}_${attr.type || Selector.TYPE_CLASS}`;\n }\n\n getStyleable() {\n return filter(\n this.models,\n item => item.get('active') && !item.get('private')\n );\n }\n\n getValid({ noDisabled } = {}) {\n return filter(this.models, item => !item.get('private')).filter(item =>\n noDisabled ? item.get('active') : 1\n );\n }\n\n getFullString(collection, opts = {}) {\n const result = [];\n const coll = collection || this;\n coll.forEach(selector => result.push(selector.getFullName(opts)));\n return result.join('').trim();\n }\n}\n\nSelectors.prototype.model = Selector;\n","import { isString, isElement } from 'underscore';\nimport { createId } from 'utils/mixins';\n\nexport default {\n getConfig(name) {\n return this.__getConfig(name);\n },\n\n __getConfig(name) {\n const res = this.config || {};\n return name ? res[name] : res;\n },\n\n getAll(opts = {}) {\n return this.all ? (opts.array ? [...this.all.models] : this.all) : [];\n },\n\n getAllMap() {\n return this.getAll().reduce((acc, i) => {\n acc[i.get(i.idAttribute)] = i;\n return acc;\n }, {});\n },\n\n __initConfig(def = {}, conf = {}) {\n this.config = {\n ...def,\n ...conf\n };\n this.em = this.config.em;\n },\n\n __initListen(opts = {}) {\n const { all, em, events } = this;\n all &&\n em &&\n all\n .on('add', (m, c, o) => em.trigger(events.add, m, o))\n .on('remove', (m, c, o) => em.trigger(events.remove, m, o))\n .on('change', (p, c) =>\n em.trigger(events.update, p, p.changedAttributes(), c)\n )\n .on('all', this.__catchAllEvent, this);\n // Register collections\n this.cls = [all].concat(opts.collections || []);\n // Propagate events\n (opts.propagate || []).forEach(({ entity, event }) => {\n entity.on('all', (ev, model, coll, opts) => {\n const options = opts || coll;\n const opt = { event: ev, ...options };\n [em, all].map(md => md.trigger(event, model, opt));\n });\n });\n },\n\n __remove(model, opts = {}) {\n const { em } = this;\n const md = isString(model) ? this.get(model) : model;\n const rm = () => {\n md && this.all.remove(md, opts);\n return md;\n };\n !opts.silent && em && em.trigger(this.events.removeBefore, md, rm, opts);\n return !opts.abort && rm();\n },\n\n __catchAllEvent(event, model, coll, opts) {\n const { em, events } = this;\n const options = opts || coll;\n em && events.all && em.trigger(events.all, { event, model, options });\n this.__onAllEvent();\n },\n\n __appendTo() {\n const elTo = this.getConfig().appendTo;\n\n if (elTo) {\n const el = isElement(elTo) ? elTo : document.querySelector(elTo);\n if (!el) return this.__logWarn('\"appendTo\" element not found');\n el.appendChild(this.render());\n }\n },\n\n __onAllEvent() {},\n\n __logWarn(str) {\n this.em.logWarning(`[${this.name}]: ${str}`);\n },\n\n _createId(len = 16) {\n const all = this.getAll();\n const ln = all.length + len;\n const allMap = this.getAllMap();\n let id;\n\n do {\n id = createId(ln);\n } while (allMap[id]);\n\n return id;\n },\n\n __destroy() {\n this.cls.forEach(coll => {\n coll.stopListening();\n coll.reset();\n });\n this.em = 0;\n }\n};\n","var objectWithoutPropertiesLoose = require(\"./objectWithoutPropertiesLoose.js\");\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutProperties;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","import Backbone from 'backbone';\n\nexport default Backbone.View.extend({\n events() {\n return (\n this.model.get('events') || {\n mousedown: 'handleClick'\n }\n );\n },\n\n attributes() {\n return this.model.get('attributes');\n },\n\n initialize(opts = {}) {\n const { config = {} } = opts;\n this.em = config.em;\n this.editor = config.editor;\n },\n\n handleClick(event) {\n event.preventDefault();\n event.stopPropagation();\n\n /*\n * Since the toolbar lives outside the canvas frame, the event's\n * generated on it have clientX and clientY relative to the page.\n *\n * This causes issues during events like dragging, where they depend\n * on the clientX and clientY.\n *\n * This makes sure the offsets are calculated.\n *\n * More information on\n * https://github.com/artf/grapesjs/issues/2372\n * https://github.com/artf/grapesjs/issues/2207\n */\n\n const { editor, em } = this;\n const { left, top } = editor.Canvas.getFrameEl().getBoundingClientRect();\n\n const calibrated = {\n ...event,\n clientX: event.clientX - left,\n clientY: event.clientY - top\n };\n\n em.trigger('toolbar:run:before');\n this.execCommand(calibrated);\n },\n\n execCommand(event) {\n const opts = { event };\n const command = this.model.get('command');\n const editor = this.editor;\n\n if (typeof command === 'function') {\n command(editor, null, opts);\n }\n\n if (typeof command === 'string') {\n editor.runCommand(command, opts);\n }\n },\n\n render() {\n const { editor, $el, model } = this;\n const id = model.get('id');\n const label = model.get('label');\n const pfx = editor.getConfig('stylePrefix');\n $el.addClass(`${pfx}toolbar-item`);\n id && $el.addClass(`${pfx}toolbar-item__${id}`);\n label && $el.append(label);\n return this;\n }\n});\n","import DomainViews from 'domain_abstract/view/DomainViews';\nimport ToolbarButtonView from './ToolbarButtonView';\n\nexport default DomainViews.extend({\n itemView: ToolbarButtonView,\n\n initialize(opts = {}) {\n this.config = { editor: opts.editor || '', em: opts.em };\n this.listenTo(this.collection, 'reset', this.render);\n }\n});\n","import Backbone from 'backbone';\n\nexport default Backbone.Model.extend({\n defaults: {\n command: '',\n attributes: {}\n }\n});\n","import Backbone from 'backbone';\nimport ToolbarButton from './ToolbarButton';\n\nexport default Backbone.Collection.extend({ model: ToolbarButton });\n","import Backbone from 'backbone';\nimport { bindAll, isElement, isUndefined, debounce } from 'underscore';\nimport {\n on,\n off,\n getUnitFromValue,\n isTaggableNode,\n getViewEl,\n hasWin\n} from 'utils/mixins';\nimport { isVisible, isDoc } from 'utils/dom';\nimport ToolbarView from 'dom_components/view/ToolbarView';\nimport Toolbar from 'dom_components/model/Toolbar';\n\nconst $ = Backbone.$;\nlet showOffsets;\n/**\n * This command is responsible for show selecting components and displaying\n * all the necessary tools around (component toolbar, badge, highlight box, etc.)\n *\n * The command manages different boxes to display tools and when something in\n * the canvas is updated, the command triggers the appropriate method to update\n * their position (across multiple frames/components):\n * - Global Tools (updateToolsGlobal/updateGlobalPos)\n * This box contains tools intended to be displayed only on ONE component per time,\n * like Component Toolbar (updated by updateToolbar/updateToolbarPos), this means\n * you won't be able to see more than one Component Toolbar (even with multiple\n * frames or multiple selected components)\n * - Local Tools (updateToolsLocal/updateLocalPos)\n * Each frame in the canvas has its own local box, so we're able to see more than\n * one active container at the same time. When you put a mouse over an element\n * you can see stuff like the highlight box, badge, margins/paddings offsets, etc.\n * so those elements are inside the Local Tools box\n *\n *\n */\nexport default {\n init(o) {\n bindAll(\n this,\n 'onHover',\n 'onOut',\n 'onClick',\n 'onFrameScroll',\n 'onFrameUpdated',\n 'onContainerChange'\n );\n },\n\n enable() {\n this.frameOff = this.canvasOff = this.adjScroll = null;\n this.startSelectComponent();\n showOffsets = 1;\n },\n\n /**\n * Start select component event\n * @private\n * */\n startSelectComponent() {\n this.toggleSelectComponent(1);\n this.em.getSelected() && this.onSelect();\n },\n\n /**\n * Stop select component event\n * @private\n * */\n stopSelectComponent() {\n this.toggleSelectComponent();\n },\n\n /**\n * Toggle select component event\n * @private\n * */\n toggleSelectComponent(enable) {\n const { em } = this;\n const listenToEl = em.getConfig('listenToEl');\n const { parentNode } = em.getContainer();\n const method = enable ? 'on' : 'off';\n const methods = { on, off };\n !listenToEl.length && parentNode && listenToEl.push(parentNode);\n const trigger = (win, body) => {\n methods[method](body, 'mouseover', this.onHover);\n methods[method](body, 'mouseleave', this.onOut);\n methods[method](body, 'click touchend', this.onClick);\n methods[method](win, 'scroll', this.onFrameScroll, true);\n };\n methods[method](window, 'resize', this.onFrameUpdated);\n methods[method](listenToEl, 'scroll', this.onContainerChange);\n em[method]('component:toggled component:update', this.onSelect, this);\n em[method]('change:componentHovered', this.onHovered, this);\n em[method](\n 'component:resize component:styleUpdate component:input',\n this.updateGlobalPos,\n this\n );\n em[method]('component:update:toolbar', this._upToolbar, this);\n em[method]('change:canvasOffset', this.updateAttached, this);\n em[method]('frame:updated', this.onFrameUpdated, this);\n em[method]('canvas:updateTools', this.onFrameUpdated, this);\n em.get('Canvas')\n .getFrames()\n .forEach(frame => {\n const { view } = frame;\n view && trigger(view.getWindow(), view.getBody());\n });\n },\n\n /**\n * Hover command\n * @param {Object} e\n * @private\n */\n onHover(e) {\n e.stopPropagation();\n const trg = e.target;\n const view = getViewEl(trg);\n const frameView = view && view._getFrame();\n const $el = $(trg);\n let model = $el.data('model');\n\n // Get first valid model\n if (!model) {\n let parent = $el.parent();\n while (!model && parent.length && !isDoc(parent[0])) {\n model = parent.data('model');\n parent = parent.parent();\n }\n }\n\n // Get first valid hoverable model\n if (model && !model.get('hoverable')) {\n let parent = model && model.parent();\n while (parent && !parent.get('hoverable')) parent = parent.parent();\n model = parent;\n }\n\n this.currentDoc = trg.ownerDocument;\n this.em.setHovered(model);\n frameView && this.em.set('currentFrame', frameView);\n },\n\n onFrameUpdated() {\n this.updateLocalPos();\n this.updateGlobalPos();\n },\n\n onHovered(em, component) {\n let result = {};\n\n if (component) {\n component.views.forEach(view => {\n const el = view.el;\n const pos = this.getElementPos(el);\n result = { el, pos, component, view: getViewEl(el) };\n this.updateToolsLocal(result);\n\n if (el.ownerDocument === this.currentDoc) this.elHovered = result;\n });\n } else {\n this.currentDoc = null;\n this.elHovered = 0;\n this.updateToolsLocal();\n this.canvas.getFrames().forEach(frame => {\n const { view } = frame;\n const el = view && view.getToolsEl();\n el && this.toggleToolsEl(0, 0, { el });\n });\n }\n },\n\n /**\n * Say what to do after the component was selected\n * @param {Object} e\n * @param {Object} el\n * @private\n * */\n onSelect: debounce(function() {\n const { em } = this;\n const component = em.getSelected();\n const currentFrame = em.get('currentFrame') || {};\n const view = component && component.getView(currentFrame.model);\n let el = view && view.el;\n let result = {};\n\n if (el && isVisible(el)) {\n const pos = this.getElementPos(el);\n result = { el, pos, component, view: getViewEl(el) };\n }\n\n this.elSelected = result;\n this.updateToolsGlobal();\n // This will hide some elements from the select component\n this.updateLocalPos(result);\n this.initResize(component);\n }),\n\n updateGlobalPos() {\n const sel = this.getElSelected();\n if (!sel.el) return;\n sel.pos = this.getElementPos(sel.el);\n this.updateToolsGlobal();\n },\n\n updateLocalPos(data) {\n const sel = this.getElHovered();\n if (!sel.el) return;\n sel.pos = this.getElementPos(sel.el);\n this.updateToolsLocal(data);\n },\n\n getElHovered() {\n return this.elHovered || {};\n },\n\n getElSelected() {\n return this.elSelected || {};\n },\n\n onOut() {\n this.em.setHovered(0);\n },\n\n toggleToolsEl(on, view, opts = {}) {\n const el = opts.el || this.canvas.getToolsEl(view);\n el && (el.style.display = on ? '' : 'none');\n return el || {};\n },\n\n /**\n * Show element offset viewer\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n showElementOffset(el, pos, opts = {}) {\n if (!showOffsets) return;\n this.editor.runCommand('show-offset', {\n el,\n elPos: pos,\n view: opts.view,\n force: 1,\n top: 0,\n left: 0\n });\n },\n\n /**\n * Hide element offset viewer\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n hideElementOffset(view) {\n this.editor.stopCommand('show-offset', {\n view\n });\n },\n\n /**\n * Show fixed element offset viewer\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n showFixedElementOffset(el, pos) {\n this.editor.runCommand('show-offset', {\n el,\n elPos: pos,\n state: 'Fixed'\n });\n },\n\n /**\n * Hide fixed element offset viewer\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n hideFixedElementOffset(el, pos) {\n if (this.editor) this.editor.stopCommand('show-offset', { state: 'Fixed' });\n },\n\n /**\n * Hide Highlighter element\n */\n hideHighlighter(view) {\n this.canvas.getHighlighter(view).style.opacity = 0;\n },\n\n /**\n * On element click\n * @param {Event} e\n * @private\n */\n onClick(ev) {\n ev.stopPropagation();\n ev.preventDefault();\n const { em } = this;\n if (em.get('_cmpDrag')) return em.set('_cmpDrag');\n const $el = $(ev.target);\n let model = $el.data('model');\n\n if (!model) {\n let parent = $el.parent();\n while (!model && parent.length && !isDoc(parent[0])) {\n model = parent.data('model');\n parent = parent.parent();\n }\n }\n\n if (model) {\n if (model.get('selectable')) {\n this.select(model, ev);\n } else {\n let parent = model.parent();\n while (parent && !parent.get('selectable')) parent = parent.parent();\n this.select(parent, ev);\n }\n }\n },\n\n /**\n * Select component\n * @param {Component} model\n * @param {Event} event\n */\n select(model, event = {}) {\n if (!model) return;\n this.editor.select(model, { scroll: {}, event });\n this.initResize(model);\n },\n\n /**\n * Update badge for the component\n * @param {Object} Component\n * @param {Object} pos Position object\n * @private\n * */\n updateBadge(el, pos, opts = {}) {\n const { canvas } = this;\n const model = $(el).data('model');\n if (!model || !model.get('badgable')) return;\n const badge = this.getBadge(opts);\n\n if (!opts.posOnly) {\n const config = this.canvas.getConfig();\n const icon = model.getIcon();\n const ppfx = config.pStylePrefix || '';\n const clsBadge = `${ppfx}badge`;\n const customeLabel = config.customBadgeLabel;\n const badgeLabel = `${\n icon ? `
${icon}
` : ''\n }\n
${model.getName()}
`;\n badge.innerHTML = customeLabel ? customeLabel(model) : badgeLabel;\n }\n\n const un = 'px';\n const bStyle = badge.style;\n bStyle.display = 'block';\n\n const targetToElem = canvas.getTargetToElementFixed(el, badge, {\n pos: pos\n });\n\n const top = targetToElem.top; //opts.topOff - badgeH < 0 ? -opts.topOff : posTop;\n const left = opts.leftOff < 0 ? -opts.leftOff : 0;\n\n bStyle.top = top + un;\n bStyle.left = left + un;\n },\n\n /**\n * Update highlighter element\n * @param {HTMLElement} el\n * @param {Object} pos Position object\n * @private\n */\n showHighlighter(view) {\n this.canvas.getHighlighter(view).style.opacity = '';\n },\n\n /**\n * Init resizer on the element if possible\n * @param {HTMLElement|Component} elem\n * @private\n */\n initResize(elem) {\n const { em, canvas } = this;\n const editor = em ? em.get('Editor') : '';\n const config = em ? em.get('Config') : '';\n const pfx = config.stylePrefix || '';\n const resizeClass = `${pfx}resizing`;\n const model =\n !isElement(elem) && isTaggableNode(elem) ? elem : em.getSelected();\n const resizable = model && model.get('resizable');\n let options = {};\n let modelToStyle;\n\n var toggleBodyClass = (method, e, opts) => {\n const docs = opts.docs;\n docs &&\n docs.forEach(doc => {\n const body = doc.body;\n const cls = body.className || '';\n body.className = (method == 'add'\n ? `${cls} ${resizeClass}`\n : cls.replace(resizeClass, '')\n ).trim();\n });\n };\n\n if (editor && resizable) {\n const el = isElement(elem) ? elem : model.getEl();\n options = {\n // Here the resizer is updated with the current element height and width\n onStart(e, opts = {}) {\n const { el, config, resizer } = opts;\n const {\n keyHeight,\n keyWidth,\n currentUnit,\n keepAutoHeight,\n keepAutoWidth\n } = config;\n toggleBodyClass('add', e, opts);\n modelToStyle = em.get('StyleManager').getModelToStyle(model);\n canvas.toggleFramesEvents();\n const computedStyle = getComputedStyle(el);\n const modelStyle = modelToStyle.getStyle();\n\n let currentWidth = modelStyle[keyWidth];\n config.autoWidth = keepAutoWidth && currentWidth === 'auto';\n if (isNaN(parseFloat(currentWidth))) {\n currentWidth = computedStyle[keyWidth];\n }\n\n let currentHeight = modelStyle[keyHeight];\n config.autoHeight = keepAutoHeight && currentHeight === 'auto';\n if (isNaN(parseFloat(currentHeight))) {\n currentHeight = computedStyle[keyHeight];\n }\n\n resizer.startDim.w = parseFloat(currentWidth);\n resizer.startDim.h = parseFloat(currentHeight);\n showOffsets = 0;\n\n if (currentUnit) {\n config.unitHeight = getUnitFromValue(currentHeight);\n config.unitWidth = getUnitFromValue(currentWidth);\n }\n },\n\n // Update all positioned elements (eg. component toolbar)\n onMove() {\n editor.trigger('component:resize');\n },\n\n onEnd(e, opts) {\n toggleBodyClass('remove', e, opts);\n editor.trigger('component:resize');\n canvas.toggleFramesEvents(1);\n showOffsets = 1;\n },\n\n updateTarget(el, rect, options = {}) {\n if (!modelToStyle) {\n return;\n }\n\n const { store, selectedHandler, config } = options;\n const {\n keyHeight,\n keyWidth,\n autoHeight,\n autoWidth,\n unitWidth,\n unitHeight\n } = config;\n const onlyHeight = ['tc', 'bc'].indexOf(selectedHandler) >= 0;\n const onlyWidth = ['cl', 'cr'].indexOf(selectedHandler) >= 0;\n const style = {};\n const en = !store ? 1 : ''; // this will trigger the final change\n\n if (!onlyHeight) {\n const bodyw = canvas.getBody().offsetWidth;\n const width = rect.w < bodyw ? rect.w : bodyw;\n style[keyWidth] = autoWidth ? 'auto' : `${width}${unitWidth}`;\n }\n\n if (!onlyWidth) {\n style[keyHeight] = autoHeight ? 'auto' : `${rect.h}${unitHeight}`;\n }\n\n modelToStyle.addStyle({ ...style, en }, { avoidStore: !store });\n const updateEvent = `update:component:style`;\n const eventToListen = `${updateEvent}:${keyHeight} ${updateEvent}:${keyWidth}`;\n em && em.trigger(eventToListen, null, null, { noEmit: 1 });\n }\n };\n\n if (typeof resizable == 'object') {\n options = { ...options, ...resizable, parent: options };\n }\n\n this.resizer = editor.runCommand('resize', { el, options, force: 1 });\n } else {\n editor.stopCommand('resize');\n this.resizer = null;\n }\n },\n\n /**\n * Update toolbar if the component has one\n * @param {Object} mod\n */\n updateToolbar(mod) {\n const { em } = this.config;\n const model = mod == em ? em.getSelected() : mod;\n const toolbarEl = this.canvas.getToolbarEl();\n const toolbarStyle = toolbarEl.style;\n const toolbar = model.get('toolbar');\n const showToolbar = em.get('Config').showToolbar;\n\n if (model && showToolbar && toolbar && toolbar.length) {\n toolbarStyle.display = '';\n if (!this.toolbar) {\n toolbarEl.innerHTML = '';\n this.toolbar = new Toolbar(toolbar);\n const toolbarView = new ToolbarView({\n collection: this.toolbar,\n editor: this.editor,\n em\n });\n toolbarEl.appendChild(toolbarView.render().el);\n }\n\n this.toolbar.reset(toolbar);\n toolbarStyle.top = '-100px';\n toolbarStyle.left = 0;\n } else {\n toolbarStyle.display = 'none';\n }\n },\n\n /**\n * Update toolbar positions\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n updateToolbarPos(pos) {\n const unit = 'px';\n const { style } = this.canvas.getToolbarEl();\n style.top = `${pos.top}${unit}`;\n style.left = `${pos.left}${unit}`;\n style.opacity = '';\n },\n\n /**\n * Return canvas dimensions and positions\n * @return {Object}\n */\n getCanvasPosition() {\n return this.canvas.getCanvasView().getPosition();\n },\n\n /**\n * Returns badge element\n * @return {HTMLElement}\n * @private\n */\n getBadge(opts = {}) {\n return this.canvas.getBadgeEl(opts.view);\n },\n\n /**\n * On frame scroll callback\n * @private\n */\n onFrameScroll() {\n this.updateTools();\n },\n\n updateTools() {\n this.updateLocalPos();\n this.updateGlobalPos();\n },\n\n isCompSelected(comp) {\n return comp && comp.get('status') === 'selected';\n },\n\n /**\n * Update tools visible on hover\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n updateToolsLocal(data) {\n const { el, pos, view, component } = data || this.getElHovered();\n\n if (!el) {\n this.lastHovered = 0;\n return;\n }\n\n const isHoverEn = component.get('hoverable');\n const isNewEl = this.lastHovered !== el;\n const badgeOpts = isNewEl ? {} : { posOnly: 1 };\n\n if (isNewEl && isHoverEn) {\n this.lastHovered = el;\n this.showHighlighter(view);\n this.showElementOffset(el, pos, { view });\n }\n\n if (this.isCompSelected(component)) {\n this.hideHighlighter(view);\n this.hideElementOffset(view);\n }\n\n const unit = 'px';\n const toolsEl = this.toggleToolsEl(1, view);\n const { style } = toolsEl;\n const frameOff = this.canvas.canvasRectOffset(el, pos);\n const topOff = frameOff.top;\n const leftOff = frameOff.left;\n\n this.updateBadge(el, pos, {\n ...badgeOpts,\n view,\n topOff,\n leftOff\n });\n\n style.top = topOff + unit;\n style.left = leftOff + unit;\n style.width = pos.width + unit;\n style.height = pos.height + unit;\n\n this._trgToolUp('local', {\n component,\n el: toolsEl,\n top: topOff,\n left: leftOff,\n width: pos.width,\n height: pos.height\n });\n },\n\n _upToolbar: debounce(function() {\n this.updateToolsGlobal({ force: 1 });\n }),\n\n _trgToolUp(type, opts = {}) {\n this.em.trigger('canvas:tools:update', {\n type,\n ...opts\n });\n },\n\n updateToolsGlobal(opts = {}) {\n const { el, pos, component } = this.getElSelected();\n\n if (!el) {\n this.toggleToolsEl(); // Hides toolbar\n this.lastSelected = 0;\n return;\n }\n\n const { canvas } = this;\n const isNewEl = this.lastSelected !== el;\n\n if (isNewEl || opts.force) {\n this.lastSelected = el;\n this.updateToolbar(component);\n }\n\n const unit = 'px';\n const toolsEl = this.toggleToolsEl(1);\n const { style } = toolsEl;\n const targetToElem = canvas.getTargetToElementFixed(\n el,\n canvas.getToolbarEl(),\n { pos }\n );\n const topOff = targetToElem.canvasOffsetTop;\n const leftOff = targetToElem.canvasOffsetLeft;\n style.top = topOff + unit;\n style.left = leftOff + unit;\n style.width = pos.width + unit;\n style.height = pos.height + unit;\n\n this.updateToolbarPos({ top: targetToElem.top, left: targetToElem.left });\n this._trgToolUp('global', {\n component,\n el: toolsEl,\n top: topOff,\n left: leftOff,\n width: pos.width,\n height: pos.height\n });\n },\n\n /**\n * Update attached elements, eg. component toolbar\n */\n updateAttached: debounce(function() {\n this.updateGlobalPos();\n }),\n\n onContainerChange: debounce(function() {\n this.em.refreshCanvas();\n }, 150),\n\n /**\n * Returns element's data info\n * @param {HTMLElement} el\n * @return {Object}\n * @private\n */\n getElementPos(el) {\n return this.canvas.getCanvasView().getElementPos(el);\n },\n\n /**\n * Hide badge\n * @private\n * */\n hideBadge() {\n this.getBadge().style.display = 'none';\n },\n\n /**\n * Clean previous model from different states\n * @param {Component} model\n * @private\n */\n cleanPrevious(model) {\n model &&\n model.set({\n status: '',\n state: ''\n });\n },\n\n /**\n * Returns content window\n * @private\n */\n getContentWindow() {\n return this.canvas.getWindow();\n },\n\n run(editor) {\n if (!hasWin()) return;\n this.editor = editor && editor.get('Editor');\n this.enable();\n },\n\n stop(ed, sender, opts = {}) {\n if (!hasWin()) return;\n const { em, editor } = this;\n this.onHovered(); // force to hide toolbar\n this.stopSelectComponent();\n !opts.preserveSelected && em.setSelected(null);\n this.toggleToolsEl();\n editor && editor.stopCommand('resize');\n }\n};\n","import { bindAll, isFunction, result, isUndefined } from 'underscore';\nimport { on, off, isEscKey, getPointerEvent } from 'utils/mixins';\n\nconst resetPos = () => ({ x: 0, y: 0 });\n\nexport default class Dragger {\n /**\n * Init the dragger\n * @param {Object} opts\n */\n constructor(opts = {}) {\n this.opts = {\n /**\n * Element on which the drag will be executed. By default, the document will be used\n */\n container: null,\n /**\n * Callback on start\n * onStart(ev, dragger) {\n * console.log('pointer start', dragger.startPointer, 'position start', dragger.startPosition);\n * },\n */\n onStart: null,\n /**\n * Callback on drag\n * onDrag(ev, dragger) {\n * console.log('pointer', dragger.currentPointer, 'position', dragger.position, 'delta', dragger.delta);\n * },\n */\n onDrag: null,\n /**\n * Callback on drag\n * onEnd(ev, dragger) {\n * console.log('pointer', dragger.currentPointer, 'position', dragger.position, 'delta', dragger.delta);\n * },\n */\n onEnd: null,\n /**\n * Indicate a callback where to pass an object with new coordinates\n */\n setPosition: null,\n /**\n * Indicate a callback where to get initial coordinates.\n * getPosition: () => {\n * ...\n * return { x: 10, y: 100 }\n * }\n */\n getPosition: null,\n\n // Static guides to be snapped\n guidesStatic: null,\n\n // Target guides that will snap to static one\n guidesTarget: null,\n\n // Offset before snap to guides\n snapOffset: 5,\n\n // Document on which listen to pointer events\n doc: 0,\n\n // Scale result points, can also be a function\n scale: 1\n };\n bindAll(this, 'drag', 'stop', 'keyHandle', 'handleScroll');\n this.setOptions(opts);\n this.delta = resetPos();\n return this;\n }\n\n /**\n * Update options\n * @param {Object} options\n */\n setOptions(opts = {}) {\n this.opts = {\n ...this.opts,\n ...opts\n };\n }\n\n toggleDrag(enable) {\n const docs = this.getDocumentEl();\n const container = this.getContainerEl();\n const win = this.getWindowEl();\n const method = enable ? 'on' : 'off';\n const methods = { on, off };\n methods[method](container, 'mousemove dragover', this.drag);\n methods[method](docs, 'mouseup dragend touchend', this.stop);\n methods[method](docs, 'keydown', this.keyHandle);\n methods[method](win, 'scroll', this.handleScroll);\n }\n\n handleScroll() {\n const { lastScroll, delta } = this;\n const actualScroll = this.getScrollInfo();\n const scrollDiff = {\n x: actualScroll.x - lastScroll.x,\n y: actualScroll.y - lastScroll.y\n };\n this.move(delta.x + scrollDiff.x, delta.y + scrollDiff.y);\n this.lastScrollDiff = scrollDiff;\n }\n\n /**\n * Start dragging\n * @param {Event} e\n */\n start(ev) {\n const { opts } = this;\n const { onStart } = opts;\n this.toggleDrag(1);\n this.startPointer = this.getPointerPos(ev);\n this.guidesStatic = result(opts, 'guidesStatic') || [];\n this.guidesTarget = result(opts, 'guidesTarget') || [];\n isFunction(onStart) && onStart(ev, this);\n this.startPosition = this.getStartPosition();\n this.lastScrollDiff = resetPos();\n this.globScrollDiff = resetPos();\n this.drag(ev);\n }\n\n /**\n * Drag event\n * @param {Event} event\n */\n drag(ev) {\n const { opts, lastScrollDiff, globScrollDiff } = this;\n const { onDrag } = opts;\n const { startPointer } = this;\n const currentPos = this.getPointerPos(ev);\n const glDiff = {\n x: globScrollDiff.x + lastScrollDiff.x,\n y: globScrollDiff.y + lastScrollDiff.y\n };\n this.globScrollDiff = glDiff;\n const delta = {\n x: currentPos.x - startPointer.x + glDiff.x,\n y: currentPos.y - startPointer.y + glDiff.y\n };\n this.lastScrollDiff = resetPos();\n let { lockedAxis } = this;\n\n // Lock one axis\n if (ev.shiftKey) {\n lockedAxis = !lockedAxis && this.detectAxisLock(delta.x, delta.y);\n } else {\n lockedAxis = null;\n }\n\n if (lockedAxis === 'x') {\n delta.x = startPointer.x;\n } else if (lockedAxis === 'y') {\n delta.y = startPointer.y;\n }\n\n const moveDelta = delta => {\n ['x', 'y'].forEach(co => (delta[co] = delta[co] * result(opts, 'scale')));\n this.delta = delta;\n this.move(delta.x, delta.y);\n isFunction(onDrag) && onDrag(ev, this);\n };\n const deltaPre = { ...delta };\n this.currentPointer = currentPos;\n this.lockedAxis = lockedAxis;\n this.lastScroll = this.getScrollInfo();\n moveDelta(delta);\n\n if (this.guidesTarget.length) {\n const { newDelta, trgX, trgY } = this.snapGuides(deltaPre);\n (trgX || trgY) && moveDelta(newDelta);\n }\n\n // In case the mouse button was released outside of the window\n ev.which === 0 && this.stop(ev);\n }\n\n /**\n * Check if the delta hits some guide\n */\n snapGuides(delta) {\n const newDelta = delta;\n let { trgX, trgY } = this;\n\n this.guidesTarget.forEach(trg => {\n // Skip the guide if its locked axis already exists\n if ((trg.x && this.trgX) || (trg.y && this.trgY)) return;\n trg.active = 0;\n\n this.guidesStatic.forEach(stat => {\n if ((trg.y && stat.x) || (trg.x && stat.y)) return;\n const isY = trg.y && stat.y;\n const axs = isY ? 'y' : 'x';\n const trgPoint = trg[axs];\n const statPoint = stat[axs];\n const deltaPoint = delta[axs];\n const trgGuide = isY ? trgY : trgX;\n\n if (this.isPointIn(trgPoint, statPoint)) {\n if (isUndefined(trgGuide)) {\n const trgValue = deltaPoint - (trgPoint - statPoint);\n this.setGuideLock(trg, trgValue);\n }\n }\n });\n });\n\n trgX = this.trgX;\n trgY = this.trgY;\n\n ['x', 'y'].forEach(co => {\n const axis = co.toUpperCase();\n let trg = this[`trg${axis}`];\n\n if (trg && !this.isPointIn(delta[co], trg.lock)) {\n this.setGuideLock(trg, null);\n trg = null;\n }\n\n if (trg && !isUndefined(trg.lock)) {\n newDelta[co] = trg.lock;\n }\n });\n\n return {\n newDelta,\n trgX: this.trgX,\n trgY: this.trgY\n };\n }\n\n isPointIn(src, trg, { offset } = {}) {\n const ofst = offset || this.opts.snapOffset;\n return (\n (src >= trg && src <= trg + ofst) || (src <= trg && src >= trg - ofst)\n );\n }\n\n setGuideLock(guide, value) {\n const axis = !isUndefined(guide.x) ? 'X' : 'Y';\n const trgName = `trg${axis}`;\n\n if (value !== null) {\n guide.active = 1;\n guide.lock = value;\n this[trgName] = guide;\n } else {\n delete guide.active;\n delete guide.lock;\n delete this[trgName];\n }\n\n return guide;\n }\n\n /**\n * Stop dragging\n */\n stop(ev, opts = {}) {\n const { delta } = this;\n const cancelled = opts.cancel;\n const x = cancelled ? 0 : delta.x;\n const y = cancelled ? 0 : delta.y;\n this.toggleDrag();\n this.lockedAxis = null;\n this.move(x, y, 1);\n const { onEnd } = this.opts;\n isFunction(onEnd) && onEnd(ev, this, { cancelled });\n }\n\n keyHandle(ev) {\n if (isEscKey(ev)) {\n this.stop(ev, { cancel: 1 });\n }\n }\n\n /**\n * Move the element\n * @param {integer} x\n * @param {integer} y\n */\n move(x, y, end) {\n const { el, opts } = this;\n const pos = this.startPosition;\n if (!pos) return;\n const { setPosition } = opts;\n const xPos = pos.x + x;\n const yPos = pos.y + y;\n this.position = {\n x: xPos,\n y: yPos,\n end\n };\n\n isFunction(setPosition) && setPosition(this.position);\n\n if (el) {\n el.style.left = `${xPos}px`;\n el.style.top = `${yPos}px`;\n }\n }\n\n getContainerEl() {\n const { container } = this.opts;\n return container ? [container] : this.getDocumentEl();\n }\n\n getWindowEl() {\n const cont = this.getContainerEl();\n return cont.map(item => {\n const doc = item.ownerDocument || item;\n return doc.defaultView || doc.parentWindow;\n });\n }\n\n /**\n * Returns documents\n */\n getDocumentEl(el) {\n const { doc } = this.opts;\n el = el || this.el;\n\n if (!this.docs) {\n const docs = [document];\n el && docs.push(el.ownerDocument);\n doc && docs.push(doc);\n this.docs = docs;\n }\n\n return this.docs;\n }\n\n /**\n * Get mouse coordinates\n * @param {Event} event\n * @return {Object}\n */\n getPointerPos(ev) {\n const getPos = this.opts.getPointerPosition;\n const pEv = getPointerEvent(ev);\n\n return getPos\n ? getPos(ev)\n : {\n x: pEv.clientX,\n y: pEv.clientY\n };\n }\n\n getStartPosition() {\n const { el, opts } = this;\n const getPos = opts.getPosition;\n let result = resetPos();\n\n if (isFunction(getPos)) {\n result = getPos();\n } else if (el) {\n result = {\n x: parseFloat(el.style.left),\n y: parseFloat(el.style.top)\n };\n }\n\n return result;\n }\n\n getScrollInfo() {\n const { doc } = this.opts;\n const body = doc && doc.body;\n\n return {\n y: body ? body.scrollTop : 0,\n x: body ? body.scrollLeft : 0\n };\n }\n\n detectAxisLock(x, y) {\n const relX = x;\n const relY = y;\n const absX = Math.abs(relX);\n const absY = Math.abs(relY);\n\n // Vertical or Horizontal lock\n if (relY >= absX || relY <= -absX) {\n return 'x';\n } else if (relX > absY || relX < -absY) {\n return 'y';\n }\n }\n}\n","import Backbone from 'backbone';\n\nconst $ = Backbone.$;\n\nexport default Backbone.View.extend({\n events: {\n change: 'handleChange'\n },\n\n template() {\n return ``;\n },\n\n inputClass() {\n return `${this.ppfx}field`;\n },\n\n holderClass() {\n return `${this.ppfx}input-holder`;\n },\n\n initialize(opts = {}) {\n const ppfx = opts.ppfx || '';\n this.opts = opts;\n this.ppfx = ppfx;\n this.em = opts.target || {};\n this.listenTo(this.model, 'change:value', this.handleModelChange);\n },\n\n /**\n * Fired when the element of the property is updated\n */\n elementUpdated() {\n this.model.trigger('el:change');\n },\n\n /**\n * Set value to the input element\n * @param {string} value\n */\n setValue(value) {\n const model = this.model;\n let val = value || model.get('defaults');\n const input = this.getInputEl();\n input && (input.value = val);\n },\n\n /**\n * Updates the view when the model is changed\n * */\n handleModelChange(model, value, opts) {\n this.setValue(value, opts);\n },\n\n /**\n * Handled when the view is changed\n */\n handleChange(e) {\n e.stopPropagation();\n const value = this.getInputEl().value;\n this.__onInputChange(value);\n this.elementUpdated();\n },\n\n __onInputChange(value) {\n this.model.set({ value }, { fromInput: 1 });\n },\n\n /**\n * Get the input element\n * @return {HTMLElement}\n */\n getInputEl() {\n if (!this.inputEl) {\n const { model, opts } = this;\n const type = opts.type || 'text';\n const plh =\n model.get('placeholder') ||\n model.get('defaults') ||\n model.get('default') ||\n '';\n this.inputEl = $(``);\n }\n\n return this.inputEl.get(0);\n },\n\n render() {\n this.inputEl = null;\n const el = this.$el;\n el.addClass(this.inputClass());\n el.html(this.template());\n el.find(`.${this.holderClass()}`).append(this.getInputEl());\n return this;\n }\n});\n","module.exports = require(\"regenerator-runtime\");\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// This is CodeMirror (https://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\//.test(userAgent);\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = safari && (/Mobile\\/\\w+/.test(userAgent) || navigator.maxTouchPoints > 2);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = document.activeElement;\n } catch(e) {\n activeElement = document.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {\n this.id = null;\n this.f = null;\n this.time = 0;\n this.handler = bind(this.onTimeout, this);\n };\n Delayed.prototype.onTimeout = function (self) {\n self.id = 0;\n if (self.time <= +new Date) {\n self.f();\n } else {\n setTimeout(self.handler, self.time - +new Date);\n }\n };\n Delayed.prototype.set = function (ms, f) {\n this.f = f;\n var time = +new Date + ms;\n if (!this.id || time < this.time) {\n clearTimeout(this.id);\n this.id = setTimeout(this.handler, ms);\n this.time = time;\n }\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 50;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\u0300-\\u036f\\u0483-\\u0489\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u065e\\u0670\\u06d6-\\u06dc\\u06de-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07eb-\\u07f3\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0900-\\u0902\\u093c\\u0941-\\u0948\\u094d\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09bc\\u09be\\u09c1-\\u09c4\\u09cd\\u09d7\\u09e2\\u09e3\\u0a01\\u0a02\\u0a3c\\u0a41\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a70\\u0a71\\u0a75\\u0a81\\u0a82\\u0abc\\u0ac1-\\u0ac5\\u0ac7\\u0ac8\\u0acd\\u0ae2\\u0ae3\\u0b01\\u0b3c\\u0b3e\\u0b3f\\u0b41-\\u0b44\\u0b4d\\u0b56\\u0b57\\u0b62\\u0b63\\u0b82\\u0bbe\\u0bc0\\u0bcd\\u0bd7\\u0c3e-\\u0c40\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0cbc\\u0cbf\\u0cc2\\u0cc6\\u0ccc\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0d3e\\u0d41-\\u0d44\\u0d4d\\u0d57\\u0d62\\u0d63\\u0dca\\u0dcf\\u0dd2-\\u0dd4\\u0dd6\\u0ddf\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0eb1\\u0eb4-\\u0eb9\\u0ebb\\u0ebc\\u0ec8-\\u0ecd\\u0f18\\u0f19\\u0f35\\u0f37\\u0f39\\u0f71-\\u0f7e\\u0f80-\\u0f84\\u0f86\\u0f87\\u0f90-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102d-\\u1030\\u1032-\\u1037\\u1039\\u103a\\u103d\\u103e\\u1058\\u1059\\u105e-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108d\\u109d\\u135f\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b7-\\u17bd\\u17c6\\u17c9-\\u17d3\\u17dd\\u180b-\\u180d\\u18a9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193b\\u1a17\\u1a18\\u1a56\\u1a58-\\u1a5e\\u1a60\\u1a62\\u1a65-\\u1a6c\\u1a73-\\u1a7c\\u1a7f\\u1b00-\\u1b03\\u1b34\\u1b36-\\u1b3a\\u1b3c\\u1b42\\u1b6b-\\u1b73\\u1b80\\u1b81\\u1ba2-\\u1ba5\\u1ba8\\u1ba9\\u1c2c-\\u1c33\\u1c36\\u1c37\\u1cd0-\\u1cd2\\u1cd4-\\u1ce0\\u1ce2-\\u1ce8\\u1ced\\u1dc0-\\u1de6\\u1dfd-\\u1dff\\u200c\\u200d\\u20d0-\\u20f0\\u2cef-\\u2cf1\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua66f-\\ua672\\ua67c\\ua67d\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua825\\ua826\\ua8c4\\ua8e0-\\ua8f1\\ua926-\\ua92d\\ua947-\\ua951\\ua980-\\ua982\\ua9b3\\ua9b6-\\ua9b9\\ua9bc\\uaa29-\\uaa2e\\uaa31\\uaa32\\uaa35\\uaa36\\uaa43\\uaa4c\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uabe5\\uabe8\\uabed\\udc00-\\udfff\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe26\\uff9e\\uff9f]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length, isRTL = direction == \"rtl\" ? 1 : 0;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n at += isRTL;\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers || (emitter._handlers = {});\n map[type] = (map[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers, arr = map && map[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range;\n try {range = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range || range.parentElement() != te) { return false }\n return range.compareEndPoints(\"StartToEnd\", range) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\\\s)\" + lineClass[2] + \"(?:$|\\\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n\n // Add a span to a line.\n function addMarkedSpan(line, span, op) {\n var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n if (inThisOp && inThisOp.has(line.markedSpans)) {\n line.markedSpans.push(span);\n } else {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n if (inThisOp) { inThisOp.add(line.markedSpans); }\n }\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n gutterWrap.setAttribute(\"aria-hidden\", \"true\");\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) {\n var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n var isWidget = classTest(\"CodeMirror-linewidget\");\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (isWidget.test(node.className)) { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\" + (widget.className ? \" \" + widget.className : \"\"));\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\", \"CodeMirror-line-like\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n mStart = map[i];\n mEnd = map[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX() {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n }\n function pageScrollY() {\n if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n return window.pageYOffset || (document.documentElement || document.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var height = 0;\n if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)\n { height += widgetHeight(lineObj.widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = outside; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight; box.bottom += widgetHeight;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range = doc.sel.ranges[i];\n if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }\n var collapsed = range.empty();\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range.head, curFragment); }\n if (!collapsed)\n { drawSelectionRange(cm, range, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n var charPos = charCoords(cm, head, \"div\", null, null);\n if (charPos.right - charPos.left > 0) {\n cursor.style.width = (charPos.right - charPos.left) + \"px\";\n }\n }\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () {\n if (!cm.hasFocus()) { onBlur(cm); }\n display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\";\n }, cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.hasFocus()) {\n cm.display.input.focus();\n if (!cm.state.focused) { onFocus(cm); }\n }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n if (cm.state.focused) { onBlur(cm); }\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);\n var oldHeight = display.lineDiv.getBoundingClientRect().top;\n var mustScroll = 0;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n oldHeight += cur.line.height;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n if (oldHeight < viewTop) { mustScroll -= diff; }\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val));\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth));\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.pointerEvents = \"auto\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt != bar) { bar.style.pointerEvents = \"none\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId, // Unique ID\n markArrays: null // Used by addMarkedSpan\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt();\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt();\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = window.getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n snapshot.activeElt.focus();\n if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&\n snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var sel = window.getSelection(), range = document.createRange();\n range.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n } else if (first) {\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(display) {\n var width = display.gutters.offsetWidth;\n display.sizer.style.marginLeft = width + \"px\";\n // Send an event to consumers responding to changes in gutter width.\n signalLater(display, \"gutterChanged\", display);\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }\n\n function getGutters(gutters, lineNumbers) {\n var result = [], sawLineNumbers = false;\n for (var i = 0; i < gutters.length; i++) {\n var name = gutters[i], style = null;\n if (typeof name != \"string\") { style = name.style; name = name.className; }\n if (name == \"CodeMirror-linenumbers\") {\n if (!lineNumbers) { continue }\n else { sawLineNumbers = true; }\n }\n result.push({className: name, style: style});\n }\n if (lineNumbers && !sawLineNumbers) { result.push({className: \"CodeMirror-linenumbers\", style: null}); }\n return result\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }\n\n function updateGutters(cm) {\n renderGutters(cm.display);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input, options) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // This attribute is respected by automatic translation systems such as Google Translate,\n // and may also be respected by tools used by human translators.\n d.wrapper.setAttribute('translate', 'no');\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n d.gutterSpecs = getGutters(options.gutters, options.lineNumbers);\n renderGutters(d);\n\n input.init(d);\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n cm.options.direction = doc.direction;\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(prev) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = prev ? prev.undoDepth : Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption(\"readOnly\") != \"nocursor\")\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n\n // Determine if we should prevent the cursor being placed to the left/right of an atomic marker\n // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it\n // is with selectLeft/Right\n var preventCursorLeft = (\"selectLeft\" in m) ? !m.selectLeft : m.inclusiveLeft;\n var preventCursorRight = (\"selectRight\" in m) ? !m.selectRight : m.inclusiveRight;\n\n if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? preventCursorRight : preventCursorLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? preventCursorLeft : preventCursorRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n\n if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0)))\n { doc.cantEdit = false; }\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this.lines[i];\n this.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n for (var e = at + n; at < e; ++at)\n { if (op(this.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this.height -= oldHeight - child.height;\n if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n for (var i = 0; i < this.children.length; ++i) { this.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this.children.splice(++i, 0, leaf);\n leaf.parent = this;\n }\n child.lines = child.lines.slice(0, remaining);\n this.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (cm && !this.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp);\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n if (lineSep === '') { return lines.join('') }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range.head; }\n else if (start == \"anchor\") { pos = range.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range.to(); }\n else { pos = range.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this, ranges[i].anchor),\n clipPos(this, ranges[i].head || ranges[i].anchor)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {\n var this$1 = this;\n\n this.history = new History(this.history);\n linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true);\n },\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||\n span.from == null && lineNo != from.line ||\n span.from != null && lineNo == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo;\n });\n return clipPos(this, Pos(lineNo, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this.linked[i];\n if (link.doc != other) { continue }\n this.linked.splice(i, 1);\n other.unlinkDoc(this);\n detachSharedMarkers(findSharedMarkers(this));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var markAsReadAndPasteIfAllFilesAreRead = function () {\n if (++read == n) {\n operation(cm, function () {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(\n text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change))));\n })();\n }\n };\n var readTextFromFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n var reader = new FileReader;\n reader.onerror = function () { return markAsReadAndPasteIfAllFilesAreRead(); };\n reader.onload = function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n text[i] = content;\n markAsReadAndPasteIfAllFilesAreRead();\n };\n reader.readAsText(file);\n };\n for (var i = 0; i < files.length; i++) { readTextFromFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e$1){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 224: \"Mod\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\", \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\",\n \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\",\n \"Ctrl-T\": \"transposeChars\", \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map, handle, context) {\n map = getKeyMap(map);\n var found = map.call ? map.call(key, context) : map[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map.fallthrough) {\n if (Object.prototype.toString.call(map.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map.fallthrough, handle, context) }\n for (var i = 0; i < map.fallthrough.length; i++) {\n var result = lookupKey(key, map.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Mod\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n if (cm.doc.direction == \"rtl\") { dir = -dir; }\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"codepoint\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(start.ch, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n cm.curOp.focus = activeElt();\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand)\n { document.execCommand(\"cut\"); }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n if (cm.state.delayingBlurEvent) {\n if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; }\n else { delayBlurEvent(cm); }\n }\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if ((webkit && !safari) || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { return display.input.focus(); }, 20);\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n if (ie) { delayBlurEvent(cm); }\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); }\n else\n { ourRange = range; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n // If e is null or undefined we interpret this as someone trying\n // to explicitly cancel the selection rather than the user\n // letting go of the mouse button.\n if (e) {\n e_preventDefault(e);\n display.input.focus();\n }\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e$1) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.display.gutterSpecs.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.display.gutterSpecs[i];\n signal(cm, type, cm, line, gutter.className, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b\\u200e\\u200f\\u2028\\u2029\\ufeff\\ufff9-\\ufffc]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n updateGutters(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm, val) {\n cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers);\n updateGutters(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm, val) {\n cm.display.gutterSpecs = getGutters(cm.options.gutters, val);\n updateGutters(cm);\n }, true);\n option(\"firstLineNumber\", 1, updateGutters, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, updateGutters, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n\n option(\"screenReaderLabel\", null, function (cm, val) {\n val = (val === '') ? null : val;\n cm.display.input.screenReaderLabelChanged(val);\n });\n\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input, options);\n display.wrapper.CodeMirror = this;\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(function () {\n if (this$1.hasFocus() && !this$1.state.focused) { onFocus(this$1); }\n }, 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range = sel.ranges[i$1];\n var from = range.from(), to = range.to();\n if (range.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == textLines.join(\"\\n\"))\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range = sel.ranges[i];\n if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }\n var mode = cm.getModeAt(range.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))\n { indented = indentLine(cm, range.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", autocorrect ? \"\" : \"off\");\n field.setAttribute(\"autocapitalize\", autocapitalize ? \"\" : \"off\");\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n disableBrowserMagic(te);\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"codepoint\", \"char\", \"column\" (like char, but\n // doesn't cross line boundaries), \"word\" (across next word), or\n // \"group\" (to the start of next group of word or\n // non-word-non-whitespace chars). The visually param controls\n // whether, in right-to-left text, direction 1 means to move towards\n // the next index in the string, or towards the character to the right\n // of the current position. The resulting position will have a\n // hitSide=true property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n var lineDir = visually && doc.direction == \"rtl\" ? -dir : dir;\n function findNextLine() {\n var l = pos.line + lineDir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (unit == \"codepoint\") {\n var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1));\n if (isNaN(ch)) {\n next = null;\n } else {\n var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF;\n next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir);\n }\n } else if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\" || unit == \"codepoint\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n div.contentEditable = true;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n function belongsToInput(e) {\n for (var t = e.target; t; t = t.parentNode) {\n if (t == div) { return true }\n if (/\\bCodeMirror-(?:line)?widget\\b/.test(t.className)) { break }\n }\n return false\n }\n\n on(div, \"paste\", function (e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = activeElt();\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.div.setAttribute('aria-label', label);\n } else {\n this.div.removeAttribute('aria-label');\n }\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = activeElt() == this.div;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor() || activeElt() != this.div)\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var this$1 = this;\n\n var input = this;\n if (this.selectionInEditor())\n { setTimeout(function () { return this$1.pollSelection(); }, 20); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range = found[0].find(0)))\n { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map.length; j += 3) {\n var curNode = map[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n };\n\n TextareaInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.textarea.setAttribute('aria-label', label);\n } else {\n this.textarea.removeAttribute('aria-label');\n }\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing) { return }\n var cm = this.cm;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { window.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n this.textarea.readOnly = !!val;\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt();\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.63.0\";\n\n return CodeMirror;\n\n})));\n","import Backbone from 'backbone';\nimport { appendAtIndex } from 'utils/dom';\n\nexport default Backbone.View.extend({\n initialize(o) {\n this.config = o.config || {};\n this.pfx = this.config.stylePrefix || '';\n this.target = o.target || {};\n this.propTarget = o.propTarget || {};\n this.onChange = o.onChange;\n this.onInputRender = o.onInputRender || {};\n this.customValue = o.customValue || {};\n this.properties = [];\n const coll = this.collection;\n this.listenTo(coll, 'add', this.addTo);\n this.listenTo(coll, 'reset', this.render);\n },\n\n addTo(model, coll, opts) {\n this.add(model, null, opts);\n },\n\n add(model, frag, opts = {}) {\n const appendTo = frag || this.el;\n const view = new model.typeView({\n model,\n name: model.get('name'),\n id: this.pfx + model.get('property'),\n target: this.target,\n propTarget: this.propTarget,\n onChange: this.onChange,\n onInputRender: this.onInputRender,\n config: this.config\n });\n\n if (model.get('type') != 'composite') {\n view.customValue = this.customValue;\n }\n\n view.render();\n const rendered = view.el;\n this.properties.push(view);\n view.updateVisibility();\n\n appendAtIndex(appendTo, rendered, opts.at);\n },\n\n render() {\n const { $el } = this;\n this.clearItems();\n const fragment = document.createDocumentFragment();\n this.collection.each(model => this.add(model, fragment));\n $el.empty();\n $el.append(fragment);\n $el.attr('class', `${this.pfx}properties`);\n return this;\n },\n\n remove() {\n Backbone.View.prototype.remove.apply(this, arguments);\n this.clearItems();\n },\n\n clearItems() {\n this.properties.forEach(item => item.remove());\n this.properties = [];\n }\n});\n","import { includes } from 'underscore';\nimport Backbone from 'backbone';\n\nexport default Backbone.View.extend({\n // Default view\n itemView: '',\n\n // Defines the View per type\n itemsView: '',\n\n itemType: 'type',\n\n autoAdd: 0,\n\n initialize(opts = {}, config) {\n this.config = config || opts.config || {};\n this.autoAdd && this.listenTo(this.collection, 'add', this.addTo);\n this.items = [];\n this.init();\n },\n\n init() {},\n\n /**\n * Add new model to the collection\n * @param {Model} model\n * @private\n * */\n addTo(model) {\n this.add(model);\n },\n\n itemViewNotFound(type) {\n const { config, ns } = this;\n const { em } = config;\n const warn = `${ns ? `[${ns}]: ` : ''}'${type}' type not found`;\n em && em.logWarning(warn);\n },\n\n /**\n * Render new model inside the view\n * @param {Model} model\n * @param {Object} fragment Fragment collection\n * @private\n * */\n add(model, fragment) {\n const { config, reuseView, items, itemsView = {} } = this;\n const inputTypes = [\n 'button',\n 'checkbox',\n 'color',\n 'date',\n 'datetime-local',\n 'email',\n 'file',\n 'hidden',\n 'image',\n 'month',\n 'number',\n 'password',\n 'radio',\n 'range',\n 'reset',\n 'search',\n 'submit',\n 'tel',\n 'text',\n 'time',\n 'url',\n 'week'\n ];\n var frag = fragment || null;\n var itemView = this.itemView;\n var typeField = model.get(this.itemType);\n let view;\n\n if (itemsView[typeField]) {\n itemView = itemsView[typeField];\n } else if (\n typeField &&\n !itemsView[typeField] &&\n !includes(inputTypes, typeField)\n ) {\n this.itemViewNotFound(typeField);\n }\n\n if (model.view && reuseView) {\n view = model.view;\n } else {\n view = new itemView({ model, config }, config);\n }\n\n items && items.push(view);\n const rendered = view.render().el;\n\n if (frag) frag.appendChild(rendered);\n else this.$el.append(rendered);\n },\n\n render() {\n var frag = document.createDocumentFragment();\n this.clearItems();\n this.$el.empty();\n\n if (this.collection.length)\n this.collection.each(function(model) {\n this.add(model, frag);\n }, this);\n\n this.$el.append(frag);\n this.onRender();\n return this;\n },\n\n onRender() {},\n\n onRemoveBefore() {},\n onRemove() {},\n\n remove(opts = {}) {\n const { items } = this;\n this.onRemoveBefore(items, opts);\n this.clearItems();\n Backbone.View.prototype.remove.apply(this, arguments);\n this.onRemove(items, opts);\n },\n\n clearItems() {\n const items = this.items || [];\n // TODO Traits do not update the target anymore\n // items.forEach(item => item.remove());\n // this.items = [];\n }\n});\n","import Backbone from 'backbone';\nimport {\n isEmpty,\n isArray,\n isString,\n each,\n includes,\n extend,\n flatten,\n debounce\n} from 'underscore';\nimport Component, { keySymbol, keySymbols } from './Component';\n\nconst getIdsToKeep = (prev, res = []) => {\n const pr = prev || [];\n pr.forEach(comp => {\n res.push(comp.getId());\n getIdsToKeep(comp.components(), res);\n });\n return res;\n};\n\nconst getNewIds = (items, res = []) => {\n items.map(item => {\n res.push(item.getId());\n getNewIds(item.components(), res);\n });\n return res;\n};\n\nexport default Backbone.Collection.extend({\n initialize(models, opt = {}) {\n this.opt = opt;\n this.listenTo(this, 'add', this.onAdd);\n this.listenTo(this, 'remove', this.removeChildren);\n this.listenTo(this, 'reset', this.resetChildren);\n const { em, config } = opt;\n this.config = config;\n this.em = em;\n this.domc = opt.domc || (em && em.get('DomComponents'));\n },\n\n resetChildren(models, opts = {}) {\n const coll = this;\n const prev = opts.previousModels || [];\n const toRemove = prev.filter(prev => !models.get(prev.cid));\n const newIds = getNewIds(models);\n opts.keepIds = getIdsToKeep(prev).filter(pr => newIds.indexOf(pr) >= 0);\n toRemove.forEach(md => this.removeChildren(md, coll, opts));\n models.each(model => this.onAdd(model));\n },\n\n removeChildren(removed, coll, opts = {}) {\n // Removing a parent component can cause this function\n // to be called with an already removed child element\n if (!removed) {\n return;\n }\n\n const { domc, em } = this;\n const allByID = domc ? domc.allById() : {};\n const isTemp = opts.temporary;\n removed.prevColl = this; // This one is required for symbols\n\n if (!isTemp) {\n // Remove the component from the global list\n const id = removed.getId();\n const sels = em.get('SelectorManager').getAll();\n const rules = em.get('CssComposer').getAll();\n const canRemoveStyle = (opts.keepIds || []).indexOf(id) < 0;\n delete allByID[id];\n\n // Remove all component related styles\n const rulesRemoved = canRemoveStyle\n ? rules.remove(\n rules.filter(r => r.getSelectors().getFullString() === `#${id}`),\n opts\n )\n : [];\n\n // Clean selectors\n sels.remove(rulesRemoved.map(rule => rule.getSelectors().at(0)));\n\n if (!removed.opt.temporary) {\n em.get('Commands').run('core:component-style-clear', {\n target: removed\n });\n removed.removed();\n removed.trigger('removed');\n em.trigger('component:remove', removed);\n }\n\n const inner = removed.components();\n inner.forEach(it => this.removeChildren(it, coll, opts));\n // removed.empty(opts);\n }\n\n // Remove stuff registered in DomComponents.handleChanges\n const inner = removed.components();\n em.stopListening(inner);\n em.stopListening(removed);\n em.stopListening(removed.get('classes'));\n removed.__postRemove();\n },\n\n model(attrs, options) {\n const { opt } = options.collection;\n const { em } = opt;\n let model;\n const df = em.get('DomComponents').componentTypes;\n options.em = em;\n options.config = opt.config;\n options.componentTypes = df;\n options.domc = opt.domc;\n\n for (let it = 0; it < df.length; it++) {\n const dfId = df[it].id;\n if (dfId == attrs.type) {\n model = df[it].model;\n break;\n }\n }\n\n // If no model found, get the default one\n if (!model) {\n model = df[df.length - 1].model;\n em &&\n attrs.type &&\n em.logWarning(`Component type '${attrs.type}' not found`, {\n attrs,\n options\n });\n }\n\n return new model(attrs, options);\n },\n\n parseString(value, opt = {}) {\n const { em, domc } = this;\n const cssc = em.get('CssComposer');\n const parsed = em.get('Parser').parseHtml(value);\n // We need this to avoid duplicate IDs\n Component.checkId(parsed.html, parsed.css, domc.componentsById, opt);\n\n if (parsed.css && cssc && !opt.temporary) {\n const { at, ...optsToPass } = opt;\n cssc.addCollection(parsed.css, {\n ...optsToPass,\n extend: 1\n });\n }\n\n return parsed.html;\n },\n\n add(models, opt = {}) {\n const { parent } = this;\n opt.keepIds = getIdsToKeep(opt.previousModels);\n\n if (isString(models)) {\n models = this.parseString(models, opt);\n } else if (isArray(models)) {\n models = [...models];\n models.forEach((item, index) => {\n if (isString(item)) {\n const nodes = this.parseString(item, opt);\n models[index] = isArray(nodes) && !nodes.length ? null : nodes;\n }\n });\n }\n\n const isMult = isArray(models);\n models = (isMult ? models : [models])\n .filter(i => i)\n .map(model => this.processDef(model));\n models = isMult ? flatten(models, 1) : models[0];\n\n const result = Backbone.Collection.prototype.add.apply(this, [models, opt]);\n this.__firstAdd = result;\n return result;\n },\n\n /**\n * Process component definition.\n */\n processDef(mdl) {\n // Avoid processing Models\n if (mdl.cid && mdl.ccid) return mdl;\n const { em, config = {} } = this;\n const { processor } = config;\n let model = mdl;\n\n if (processor) {\n model = { ...model }; // Avoid 'Cannot delete property ...'\n const modelPr = processor(model);\n if (modelPr) {\n each(model, (val, key) => delete model[key]);\n extend(model, modelPr);\n }\n }\n\n // React JSX preset\n if (model.$$typeof && typeof model.props == 'object') {\n model = { ...model };\n model.props = { ...model.props };\n const domc = em.get('DomComponents');\n const parser = em.get('Parser');\n const { parserHtml } = parser;\n\n each(model, (value, key) => {\n if (!includes(['props', 'type'], key)) delete model[key];\n });\n const { props } = model;\n const comps = props.children;\n delete props.children;\n delete model.props;\n const res = parserHtml.splitPropsFromAttr(props);\n model.attributes = res.attrs;\n\n if (comps) {\n model.components = comps;\n }\n if (!model.type) {\n model.type = 'textnode';\n } else if (!domc.getType(model.type)) {\n model.tagName = model.type;\n delete model.type;\n }\n\n extend(model, res.props);\n }\n\n return model;\n },\n\n onAdd(model, c, opts = {}) {\n const { domc, em } = this;\n const style = model.getStyle();\n const avoidInline = em && em.getConfig('avoidInlineStyle');\n domc && domc.Component.ensureInList(model);\n\n if (\n !isEmpty(style) &&\n !avoidInline &&\n em &&\n em.get &&\n em.getConfig('forceClass') &&\n !opts.temporary\n ) {\n const name = model.cid;\n const rule = em.get('CssComposer').setClassRule(name, style);\n model.setStyle({});\n model.addClass(name);\n }\n\n model.__postAdd({ recursive: 1 });\n this.__onAddEnd();\n },\n\n __onAddEnd: debounce(function() {\n // TODO to check symbols on load, probably this might be removed as symbols\n // are always recovered from the model\n // const { domc } = this;\n // const allComp = (domc && domc.allById()) || {};\n // const firstAdd = this.__firstAdd;\n // const toCheck = isArray(firstAdd) ? firstAdd : [firstAdd];\n // const silent = { silent: true };\n // const onAll = comps => {\n // comps.forEach(comp => {\n // const symbol = comp.get(keySymbols);\n // const symbolOf = comp.get(keySymbol);\n // if (symbol && isArray(symbol) && isString(symbol[0])) {\n // comp.set(\n // keySymbols,\n // symbol.map(smb => allComp[smb]).filter(i => i),\n // silent\n // );\n // }\n // if (isString(symbolOf)) {\n // comp.set(keySymbol, allComp[symbolOf], silent);\n // }\n // onAll(comp.components());\n // });\n // };\n // onAll(toCheck);\n })\n});\n","import { Model } from 'backbone';\n\nexport default Model.extend({\n /**\n * Initialize method that can't be removed\n * @param {Object} o Options\n * @private\n * */\n initialize(o) {\n this.config = o || {};\n this.editorModel = this.em = this.config.em || {};\n this.pfx = this.config.stylePrefix;\n this.ppfx = this.config.pStylePrefix;\n this.hoverClass = this.pfx + 'hover';\n this.badgeClass = this.pfx + 'badge';\n this.plhClass = this.pfx + 'placeholder';\n this.freezClass = this.ppfx + 'freezed';\n\n this.canvas = this.em.get && this.em.get('Canvas');\n this.init(this.config);\n },\n\n /**\n * On frame scroll callback\n * @param {[type]} e [description]\n * @return {[type]} [description]\n */\n onFrameScroll(e) {},\n\n /**\n * Returns canval element\n * @return {HTMLElement}\n */\n getCanvas() {\n return this.canvas.getElement();\n },\n\n /**\n * Get canvas body element\n * @return {HTMLElement}\n */\n getCanvasBody() {\n return this.canvas.getBody();\n },\n\n /**\n * Get canvas wrapper element\n * @return {HTMLElement}\n */\n getCanvasTools() {\n return this.canvas.getToolsEl();\n },\n\n /**\n * Get the offset of the element\n * @param {HTMLElement} el\n * @return {Object}\n */\n offset(el) {\n var rect = el.getBoundingClientRect();\n return {\n top: rect.top + el.ownerDocument.body.scrollTop,\n left: rect.left + el.ownerDocument.body.scrollLeft\n };\n },\n\n /**\n * Callback triggered after initialize\n * @param {Object} o Options\n * @private\n * */\n init(o) {},\n\n /**\n * Method that run command\n * @param {Object} editor Editor instance\n * @param {Object} [options={}] Options\n * @private\n * */\n callRun(editor, options = {}) {\n const id = this.id;\n editor.trigger(`run:${id}:before`, options);\n\n if (options && options.abort) {\n editor.trigger(`abort:${id}`, options);\n return;\n }\n\n const sender = options.sender || editor;\n const result = this.run(editor, sender, options);\n editor.trigger(`run:${id}`, result, options);\n editor.trigger('run', id, result, options);\n return result;\n },\n\n /**\n * Method that run command\n * @param {Object} editor Editor instance\n * @param {Object} [options={}] Options\n * @private\n * */\n callStop(editor, options = {}) {\n const id = this.id;\n const sender = options.sender || editor;\n editor.trigger(`stop:${id}:before`, options);\n const result = this.stop(editor, sender, options);\n editor.trigger(`stop:${id}`, result, options);\n editor.trigger('stop', id, result, options);\n return result;\n },\n\n /**\n * Stop current command\n */\n stopCommand() {\n this.em.get('Commands').stop(this.id);\n },\n\n /**\n * Method that run command\n * @param {Object} em Editor model\n * @param {Object} sender Button sender\n * @private\n * */\n run(em, sender) {},\n\n /**\n * Method that stop command\n * @param {Object} em Editor model\n * @param {Object} sender Button sender\n * @private\n * */\n stop(em, sender) {}\n});\n","import { isString, isArray, keys } from 'underscore';\nimport { shallowDiff } from 'utils/mixins';\nimport ParserHtml from 'parser/model/ParserHtml';\n\nconst parseStyle = ParserHtml().parseStyle;\n\nexport default {\n parseStyle,\n\n /**\n * To trigger the style change event on models I have to\n * pass a new object instance\n * @param {Object} prop\n * @return {Object}\n */\n extendStyle(prop) {\n return { ...this.getStyle(), ...prop };\n },\n\n /**\n * Get style object\n * @return {Object}\n */\n getStyle(prop) {\n const style = this.get('style') || {};\n const result = { ...style };\n return prop && isString(prop) ? result[prop] : result;\n },\n\n /**\n * Set new style object\n * @param {Object|string} prop\n * @param {Object} opts\n * @return {Object} Applied properties\n */\n setStyle(prop = {}, opts = {}) {\n if (isString(prop)) {\n prop = parseStyle(prop);\n }\n\n const propOrig = this.getStyle(opts);\n const propNew = { ...prop };\n this.set('style', propNew, opts);\n const diff = shallowDiff(propOrig, propNew);\n keys(diff).forEach(pr => {\n const em = this.em;\n this.trigger(`change:style:${pr}`);\n if (em) {\n em.trigger(`styleable:change`, this, pr);\n em.trigger(`styleable:change:${pr}`, this, pr);\n }\n });\n\n return propNew;\n },\n\n /**\n * Add style property\n * @param {Object|string} prop\n * @param {string} value\n * @example\n * this.addStyle({color: 'red'});\n * this.addStyle('color', 'blue');\n */\n addStyle(prop, value = '', opts = {}) {\n if (typeof prop == 'string') {\n prop = {\n prop: value\n };\n } else {\n opts = value || {};\n }\n\n prop = this.extendStyle(prop);\n this.setStyle(prop, opts);\n },\n\n /**\n * Remove style property\n * @param {string} prop\n */\n removeStyle(prop) {\n let style = this.getStyle();\n delete style[prop];\n this.setStyle(style);\n },\n\n /**\n * Returns string of style properties\n * @param {Object} [opts={}] Options\n * @return {String}\n */\n styleToString(opts = {}) {\n const result = [];\n const style = this.getStyle(opts);\n\n for (let prop in style) {\n const imp = opts.important;\n const important = isArray(imp) ? imp.indexOf(prop) >= 0 : imp;\n const value = `${style[prop]}${important ? ' !important' : ''}`;\n const propPrv = prop.substr(0, 2) == '__';\n value && !propPrv && result.push(`${prop}:${value};`);\n }\n\n return result.join('');\n },\n\n getSelectors() {\n return this.get('selectors') || this.get('classes');\n },\n\n getSelectorsString() {\n return this.selectorsToString\n ? this.selectorsToString()\n : this.getSelectors().getFullString();\n }\n};\n","import { Model } from 'common';\nimport { isUndefined, isString, result } from 'underscore';\nimport { capitalize } from 'utils/mixins';\n\nexport default class Property extends Model {\n initialize(props = {}, opts = {}) {\n const id = this.get('id') || '';\n const name = this.get('name') || '';\n !this.get('property') &&\n this.set('property', (name || id).replace(/ /g, '-'));\n const prop = this.get('property');\n !this.get('id') && this.set('id', prop);\n !name && this.set('name', capitalize(prop).replace(/-/g, ' '));\n Property.callInit(this, props, opts);\n }\n\n init() {}\n\n /**\n * Get property id.\n * @returns {String}\n */\n getId() {\n return this.get('id');\n }\n\n /**\n * Get property type.\n * @returns {String}\n */\n getType() {\n return this.get('type');\n }\n\n /**\n * Get property name (usually is the CSS property name).\n * @returns {String}\n */\n getName() {\n return this.get('property');\n }\n\n /**\n * Get property label.\n * @returns {String}\n */\n getLabel() {\n return this.get('name');\n }\n\n /**\n * Get property value.\n * @returns {String}\n */\n getValue() {\n const val = this.get('value');\n return isUndefined(val) ? this.getDefaultValue() : val;\n }\n\n /**\n * Clear the value\n * @return {this}\n * @private\n */\n clearValue(opts = {}) {\n this.set({ value: undefined, status: '' }, opts);\n return this;\n }\n\n /**\n * Update value\n * @param {any} value\n * @param {Boolen} [complete=true] Indicates if it's a final state\n * @param {Object} [opts={}] Options\n * @private\n */\n setValue(value, complete = 1, opts = {}) {\n const parsed = this.parseValue(value);\n const avoidStore = !complete;\n !avoidStore && this.set({ value: undefined }, { avoidStore, silent: true });\n this.set(parsed, { avoidStore, ...opts });\n }\n\n /**\n * Like `setValue` but, in addition, prevents the update of the input element\n * as the changes should come from the input itself.\n * This method is useful with the definition of custom properties\n * @param {any} value\n * @param {Boolen} [complete=true] Indicates if it's a final state\n * @param {Object} [opts={}] Options\n */\n setValueFromInput(value, complete, opts = {}) {\n this.setValue(value, complete, { ...opts, fromInput: 1 });\n }\n\n /**\n * Parse a raw value, generally fetched from the target, for this property\n * @param {string} value Raw value string\n * @return {Object}\n * @private\n * @example\n * // example with an Input type\n * prop.parseValue('translateX(10deg)');\n * // -> { value: 10, unit: 'deg', functionName: 'translateX' }\n *\n */\n parseValue(value, opts = {}) {\n const result = { value };\n const imp = '!important';\n\n if (isString(value) && value.indexOf(imp) !== -1) {\n result.value = value.replace(imp, '').trim();\n result.important = 1;\n }\n\n if (!this.get('functionName') && !opts.complete) {\n return result;\n }\n\n const args = [];\n let valueStr = `${result.value}`;\n let start = valueStr.indexOf('(') + 1;\n let end = valueStr.lastIndexOf(')');\n const functionName = valueStr.substring(0, start - 1);\n if (functionName) result.functionName = functionName;\n args.push(start);\n\n // Will try even if the last closing parentheses is not found\n if (end >= 0) {\n args.push(end);\n }\n\n result.value = String.prototype.substring.apply(valueStr, args);\n\n if (opts.numeric) {\n const num = parseFloat(result.value);\n result.unit = result.value.replace(num, '');\n result.value = num;\n }\n\n return result;\n }\n\n /**\n * Helper function to safely split a string of values.\n * Useful when style values are inside functions\n * eg:\n * -> input: 'value(1,2,4), 123, value(4,5)' -- default separator: ','\n * -> output: ['value(1,2,4)', '123', 'value(4,5)']\n * @param {String} values Values to split\n * @param {String} [separator] Separator\n * @private\n */\n splitValues(values, separator = ',') {\n const res = [];\n const op = '(';\n const cl = ')';\n let curr = '';\n let acc = 0;\n\n (values || '').split('').forEach(str => {\n if (str == op) {\n acc++;\n curr = curr + op;\n } else if (str == cl && acc > 0) {\n acc--;\n curr = curr + cl;\n } else if (str === separator && acc == 0) {\n res.push(curr);\n curr = '';\n } else {\n curr = curr + str;\n }\n });\n\n curr !== '' && res.push(curr);\n\n return res.map(i => i.trim());\n }\n\n /**\n * Get the default value\n * @return {string}\n * @private\n */\n getDefaultValue() {\n return this.get('defaults');\n }\n\n /**\n * Get a complete value of the property.\n * This probably will replace the getValue when all\n * properties models will be splitted\n * @param {string} val Custom value to replace the one on the model\n * @return {string}\n * @private\n */\n getFullValue(val) {\n const fn = this.get('functionName');\n const def = this.getDefaultValue();\n let value = isUndefined(val) ? this.get('value') : val;\n const hasValue = !isUndefined(value) && value !== '';\n\n if (value && def && value === def) {\n return def;\n }\n\n if (fn && hasValue) {\n const fnParameter = fn === 'url' ? `'${value.replace(/'/g, '')}'` : value;\n value = `${fn}(${fnParameter})`;\n }\n\n if (hasValue && this.get('important')) {\n value = `${value} !important`;\n }\n\n return value || '';\n }\n}\n\nProperty.callParentInit = function(property, ctx, props, opts = {}) {\n property.prototype.initialize.apply(ctx, [\n props,\n {\n ...opts,\n skipInit: 1\n }\n ]);\n};\n\nProperty.callInit = function(context, props, opts = {}) {\n !opts.skipInit && context.init(props, opts);\n};\n\nProperty.getDefaults = function() {\n return result(this.prototype, 'defaults');\n};\n\nProperty.prototype.defaults = {\n name: '',\n property: '',\n type: '',\n defaults: '',\n info: '',\n value: '',\n icon: '',\n functionName: '',\n status: '',\n visible: true,\n fixedValues: ['initial', 'inherit'],\n\n // If true, the property will be forced to be full width\n full: 0,\n\n // If true to the value will be added '!important'\n important: 0,\n\n // If true, will be hidden by default and will show up only for targets\n // which require this property (via `stylable-require`)\n // Use case:\n // you can add all SVG CSS properties with toRequire as true\n // and then require them on SVG Components\n toRequire: 0,\n\n // Specifies dependency on other properties of the selected object.\n // Property is shown only when all conditions are matched.\n //\n // example: { display: ['flex', 'block'], position: ['absolute'] };\n // in this case the property is only shown when display is\n // of value 'flex' or 'block' AND position is 'absolute'\n requires: null,\n\n // Specifies dependency on properties of the parent of the selected object.\n // Property is shown only when all conditions are matched.\n requiresParent: null\n};\n","import Property from './Property';\n\nexport default Property.extend({\n defaults: {\n ...Property.prototype.defaults,\n // 'background' is a good example where to make a difference\n // between detached and not\n //\n // - NOT detached (default)\n // background: url(..) no-repeat center ...;\n // - Detached\n // background-image: url();\n // background-repeat: repeat;\n // ...\n detached: 0,\n\n // Array of sub properties\n properties: [],\n\n // Separator between properties\n separator: ' '\n },\n\n initialize(props = {}, opts = {}) {\n Property.callParentInit(Property, this, props, opts);\n const properties = this.get('properties') || [];\n const Properties = require('./Properties').default;\n this.set('properties', new Properties(properties));\n this.listenTo(this, 'change:value', this.updateValues);\n Property.callInit(this, props, opts);\n },\n\n /**\n * Clear the value\n * @return {this}\n */\n clearValue(opts = {}) {\n this.get('properties').each(property => property.clearValue());\n return Property.prototype.clearValue.apply(this, arguments);\n },\n\n /**\n * Update property values\n */\n updateValues() {\n const values = this.getFullValue().split(this.getSplitSeparator());\n this.get('properties').each((property, i) => {\n const len = values.length;\n // Try to get value from a shorthand:\n // 11px -> 11px 11px 11px 11xp\n // 11px 22px -> 11px 22px 11px 22xp\n const value =\n values[i] || values[(i % len) + (len != 1 && len % 2 ? 1 : 0)];\n // There some issue with UndoManager\n //property.setValue(value, 0, {fromParent: 1});\n });\n },\n\n /**\n * Split by sperator but avoid it inside parenthesis\n * @return {RegExp}\n */\n getSplitSeparator() {\n return new RegExp(`${this.get('separator')}(?![^\\\\(]*\\\\))`);\n },\n\n /**\n * Returns default value\n * @param {Boolean} defaultProps Force to get defaults from properties\n * @return {string}\n */\n getDefaultValue(defaultProps) {\n let value = this.get('defaults');\n\n if (value && !defaultProps) {\n return value;\n }\n\n value = '';\n const properties = this.get('properties');\n properties.each((prop, index) => (value += `${prop.getDefaultValue()} `));\n return value.trim();\n },\n\n getFullValue() {\n if (this.get('detached')) {\n return '';\n }\n\n return this.get('properties').getFullValue();\n },\n\n /**\n * Get property at some index\n * @param {Number} index\n * @return {Object}\n */\n getPropertyAt(index) {\n return this.get('properties').at(index);\n }\n});\n","import Backbone from 'backbone';\nimport Properties from './Properties';\n\nexport default Backbone.Model.extend({\n defaults: {\n index: '',\n value: '',\n values: {},\n active: false,\n preview: false,\n properties: []\n },\n\n initialize() {\n const prp = this.get('properties');\n var value = this.get('value');\n this.set(\n 'properties',\n prp instanceof Properties ? prp : new Properties(prp)\n );\n const props = this.get('properties');\n props.forEach(this.onPropAdd, this);\n this.listenTo(props, 'add', this.onPropAdd);\n\n // If there is no value I'll try to get it from values\n // I need value setted to make preview working\n if (!value) {\n var val = '';\n var values = this.get('values');\n\n for (var prop in values) {\n val += ' ' + values[prop];\n }\n\n this.set('value', val.trim());\n }\n },\n\n onPropAdd(prop) {\n const coll = this.collection;\n prop.parent = coll && coll.property;\n },\n\n /**\n * Get property at some index\n * @param {Number} index\n * @return {Object}\n */\n getPropertyAt(index) {\n return this.get('properties').at(index);\n },\n\n getPropertyValue(property) {\n let result = '';\n this.get('properties').each(prop => {\n if (prop.get('property') == property) {\n result = prop.getFullValue();\n }\n });\n return result;\n },\n\n getFullValue() {\n let result = [];\n this.get('properties').each(prop => result.push(prop.getFullValue()));\n return result.join(' ').trim();\n }\n});\n","import { isUndefined } from 'underscore';\nimport Backbone from 'backbone';\nimport Layer from './Layer';\n\nexport default Backbone.Collection.extend({\n model: Layer,\n\n initialize() {\n this.idx = 1;\n this.on('add', this.onAdd);\n this.on('reset', this.onReset);\n },\n\n onAdd(model, c, opts) {\n if (!opts.noIncrement) model.set('index', this.idx++);\n opts.active && this.active(this.indexOf(model));\n },\n\n onReset() {\n this.idx = 1;\n },\n\n getSeparator() {\n const { property } = this;\n return property ? property.get('layerSeparator') : ', ';\n },\n\n /**\n * Get layers from a value string (for not detached properties),\n * example of input:\n * `layer1Value, layer2Value, layer3Value, ...`\n * @param {string} value\n * @return {Array}\n * @private\n */\n getLayersFromValue(value) {\n const layers = [];\n // Remove spaces inside functions, eg:\n // From: 1px 1px rgba(2px, 2px, 2px), 2px 2px rgba(3px, 3px, 3px)\n // To: 1px 1px rgba(2px,2px,2px), 2px 2px rgba(3px,3px,3px)\n value.replace(/\\(([\\w\\s,.]*)\\)/g, match => {\n var cleaned = match.replace(/,\\s*/g, ',');\n value = value.replace(match, cleaned);\n });\n const layerValues = value ? value.split(this.getSeparator()) : [];\n layerValues.forEach(layerValue => {\n layers.push({ properties: this.properties.parseValue(layerValue) });\n });\n return layers;\n },\n\n /**\n * Get layers from a style object (for detached properties),\n * example of input:\n * {\n * subPropname1: sub-propvalue11, sub-propvalue12, sub-propvalue13, ...\n * subPropname2: sub-propvalue21, sub-propvalue22, sub-propvalue23, ...\n * subPropname3: sub-propvalue31, sub-propvalue32, sub-propvalue33, ...\n * }\n * @param {Object} styleObj\n * @return {Array}\n * @private\n */\n getLayersFromStyle(styleObj) {\n const layers = [];\n const properties = this.properties;\n\n properties.each(propModel => {\n const style = styleObj[propModel.get('property')];\n const values = style ? style.split(', ') : [];\n values.forEach((value, i) => {\n value = propModel.parseValue(value.trim()).value;\n const layer = layers[i];\n const propertyObj = { ...propModel.attributes, ...{ value } };\n\n if (layer) {\n layer.properties.push(propertyObj);\n } else {\n layers[i] = {\n properties: [propertyObj]\n };\n }\n });\n });\n\n // Now whit all layers in, will check missing properties\n layers.forEach(layer => {\n const layerProprs = layer.properties.map(prop => prop.property);\n properties.each(propModel => {\n const propertyName = propModel.get('property');\n\n if (layerProprs.indexOf(propertyName) < 0) {\n layer.properties.push({ ...propModel.attributes });\n }\n });\n });\n\n return layers;\n },\n\n active(index) {\n this.each(layer => layer.set('active', 0));\n const layer = this.at(index);\n layer && layer.set('active', 1);\n },\n\n getFullValue() {\n let result = [];\n this.each(layer => result.push(layer.getFullValue()));\n return result.join(this.getSeparator());\n },\n\n getPropertyValues(property, defValue) {\n const result = [];\n this.each(layer => {\n const value = layer.getPropertyValue(property);\n value\n ? result.push(value)\n : !isUndefined(defValue) && result.push(defValue);\n });\n return result.join(', ');\n }\n});\n","import { keys } from 'underscore';\nimport Property from './PropertyComposite';\nimport Layers from './Layers';\n\nexport default Property.extend({\n defaults: {\n ...Property.prototype.defaults,\n // Array of layers (which contain properties)\n layers: [],\n\n // The separator used to join layer values\n layerSeparator: ', ',\n\n // Prepend new layers in the list\n prepend: 0,\n\n // Layer preview\n preview: 0\n },\n\n initialize(props = {}, opts = {}) {\n Property.callParentInit(Property, this, props, opts);\n const layers = this.get('layers');\n const layersColl = new Layers(layers);\n layersColl.property = this;\n layersColl.properties = this.get('properties');\n this.set('layers', layersColl);\n Property.callInit(this, props, opts);\n },\n\n getLayers() {\n return this.get('layers');\n },\n\n getCurrentLayer() {\n return this.getLayers().filter(layer => layer.get('active'))[0];\n },\n\n getFullValue() {\n return this.get('detached') ? '' : this.get('layers').getFullValue();\n },\n\n getValueFromStyle(styles = {}) {\n const layers = this.getLayers().getLayersFromStyle(styles);\n return new Layers(layers).getFullValue();\n },\n\n clearValue() {\n this.getLayers().reset();\n return Property.prototype.clearValue.apply(this, arguments);\n },\n\n getValueFromTarget(target) {\n const { detached, property, properties } = this.attributes;\n const style = target.getStyle();\n const validStyles = {};\n\n properties.forEach(prop => {\n const name = prop.get('property');\n const value = style[name];\n if (value) validStyles[name] = value;\n });\n\n return !detached\n ? style[property]\n : keys(validStyles).length\n ? validStyles\n : '';\n },\n\n /**\n * This method allows to customize layers returned from the target\n * @param {Object} target\n * @return {Array} Should return an array of layers\n * @example\n * // return example\n * [\n * {\n * properties: [\n * { property: 'width', ... }\n * { property: 'height', ... }\n * ]\n * }\n * ]\n */\n getLayersFromTarget(target) {\n return;\n }\n});\n","import Backbone from 'backbone';\nimport { bindAll, isArray, isUndefined, debounce } from 'underscore';\nimport { camelCase, isObject, find } from 'utils/mixins';\nimport { includes, each } from 'underscore';\n\nconst clearProp = 'data-clear-style';\nconst evStyleUp = 'component:styleUpdate';\n\nexport default Backbone.View.extend({\n template() {\n const { pfx, ppfx } = this;\n return `\n
\n
\n `;\n },\n\n templateLabel(model) {\n const { pfx, em } = this;\n const { parent } = model;\n const { icon = '', info = '', id, name } = model.attributes;\n const label = (em && em.t(`styleManager.properties.${id}`)) || name;\n\n return `\n \n ${label}\n \n ${!parent ? `⨯` : ''}\n `;\n },\n\n templateInput(model) {\n return `\n
\n \n
\n `;\n },\n\n events: {\n change: 'inputValueChanged',\n [`click [${clearProp}]`]: 'clear'\n },\n\n initialize(o = {}) {\n bindAll(this, 'targetUpdated', '__change', '__updateStyle');\n this.config = o.config || {};\n const em = this.config.em;\n this.em = em;\n this.pfx = this.config.stylePrefix || '';\n this.ppfx = this.config.pStylePrefix || '';\n this.target = o.target || {};\n this.propTarget = o.propTarget || {};\n this.onChange = o.onChange;\n this.onInputRender = o.onInputRender || {};\n this.customValue = o.customValue || {};\n const model = this.model;\n this.property = model.get('property');\n this.input = null;\n const pfx = this.pfx;\n this.inputHolderId = '#' + pfx + 'input-holder';\n this.sector = model.collection && model.collection.sector;\n this.__destroyFn = this.destroy ? this.destroy.bind(this) : () => {};\n model.view = this;\n\n if (!model.get('value')) {\n model.set('value', model.getDefaultValue());\n }\n\n if (em) {\n this.listenTo(\n em,\n `update:component:style:${this.property}`,\n this.targetUpdated\n );\n //this.listenTo(em, `styleable:change:${this.property}`, this.targetUpdated);\n\n // Listening to changes of properties in this.requires, so that styleable\n // changes based on other properties are propagated\n const requires = model.get('requires') || {};\n Object.keys(requires).forEach(property => {\n this.listenTo(\n em,\n `component:styleUpdate:${property}`,\n this.targetUpdated\n );\n });\n }\n\n this.listenTo(this.propTarget, 'update', this.targetUpdated);\n this.listenTo(model, 'destroy remove', this.remove);\n this.listenTo(model, 'change:value', this.modelValueChanged);\n this.listenTo(model, 'targetUpdated', this.targetUpdated);\n this.listenTo(model, 'change:visible', this.updateVisibility);\n this.listenTo(model, 'change:status', this.updateStatus);\n this.listenTo(\n model,\n 'change:name change:className change:full',\n this.render\n );\n\n const init = this.init && this.init.bind(this);\n init && init();\n },\n\n remove() {\n Backbone.View.prototype.remove.apply(this, arguments);\n ['em', 'target', 'input', '$input', 'propTarget', 'sector'].forEach(\n i => (this[i] = {})\n );\n this.__destroyFn(this._getClbOpts());\n },\n\n /**\n * Triggers when the status changes. The status indicates if the value of\n * the proprerty is changed or inherited\n * @private\n */\n updateStatus() {\n const { model } = this;\n const status = model.get('status');\n const parent = model.parent;\n const pfx = this.pfx;\n const ppfx = this.ppfx;\n const config = this.config;\n const updatedCls = `${ppfx}four-color`;\n const computedCls = `${ppfx}color-warn`;\n const labelEl = this.$el.children(`.${pfx}label`);\n const clearStyleEl = this.getClearEl();\n const clearStyle = clearStyleEl ? clearStyleEl.style : {};\n labelEl.removeClass(`${updatedCls} ${computedCls}`);\n clearStyle.display = 'none';\n\n switch (status) {\n case 'updated':\n !parent && labelEl.addClass(updatedCls);\n\n if (config.clearProperties) {\n clearStyle.display = 'inline';\n }\n break;\n case 'computed':\n labelEl.addClass(computedCls);\n break;\n }\n },\n\n /**\n * Clear the property from the target\n */\n clear(ev) {\n ev && ev.stopPropagation();\n this.model.clearValue();\n this.__unset();\n // Skip one stack with setTimeout to avoid inconsistencies (eg. visible on padding composite clear)\n setTimeout(() => this.targetUpdated());\n },\n\n /**\n * Get clear element\n * @return {HTMLElement}\n */\n getClearEl() {\n if (!this.clearEl) {\n this.clearEl = this.el.querySelector(`[${clearProp}]`);\n }\n\n return this.clearEl;\n },\n\n /**\n * Returns selected target which should have 'style' property\n * @return {Model|null}\n */\n getTarget() {\n return this.getTargetModel();\n },\n\n getTargets() {\n const { targets } = this.propTarget;\n return targets || [this.getTarget()];\n },\n\n getFirstTarget() {\n return this.getTargets()[0];\n },\n\n /**\n * Returns Styleable model\n * @return {Model|null}\n */\n getTargetModel() {\n return this.propTarget && this.propTarget.model;\n },\n\n /**\n * Returns helper Styleable model\n * @return {Model|null}\n */\n getHelperModel() {\n return this.propTarget && this.propTarget.helper;\n },\n\n /**\n * Triggers when the value of element input/s is changed, so have to update\n * the value of the model which will propogate those changes to the target\n */\n inputValueChanged(ev) {\n ev && ev.stopPropagation();\n if (this.emit) return;\n this.model.setValueFromInput(this.getInputValue());\n this.elementUpdated();\n },\n\n /**\n * Fired when the element of the property is updated\n */\n elementUpdated() {\n this.setStatus('updated');\n },\n\n setStatus(value) {\n this.model.set('status', value);\n const parent = this.model.parent;\n parent && value == 'updated' && parent.set('status', value);\n },\n\n emitUpdateTarget: debounce(function() {\n const em = this.config.em;\n em && em.trigger('styleManager:update:target', this.getFirstTarget());\n }),\n\n _getTargetData() {\n const { model, config } = this;\n const targetValue = this.getTargetValue({ ignoreDefault: 1 });\n const defaultValue = model.getDefaultValue();\n const computedValue = this.getComputedValue();\n let value = '';\n let status = '';\n\n if (targetValue) {\n value = targetValue;\n\n if (config.highlightChanged) {\n status = 'updated';\n }\n } else if (\n computedValue &&\n config.showComputed &&\n computedValue != defaultValue\n ) {\n value = computedValue;\n\n if (config.highlightComputed) {\n status = 'computed';\n }\n } else {\n value = defaultValue;\n status = '';\n }\n\n return {\n value,\n status,\n targetValue,\n defaultValue,\n computedValue\n };\n },\n\n /**\n * Fired when the target is changed\n * */\n targetUpdated(mod, val, opts = {}) {\n // Skip properties rendered in Stack Layers\n if (this.config.fromLayer) return;\n\n this.emitUpdateTarget();\n\n if (!this.checkVisibility()) {\n return;\n }\n\n const config = this.config;\n const em = config.em;\n const { model } = this;\n const property = model.get('property');\n const { status, value, ...targetData } = this._getTargetData();\n const data = {\n status,\n value,\n ...targetData\n };\n\n this.setStatus(status);\n model.setValue(value, 0, { fromTarget: 1, ...opts });\n this.__update(value);\n\n if (em) {\n em.trigger('styleManager:change', this, property, value, data);\n em.trigger(`styleManager:change:${property}`, this, value, data);\n this._emitUpdate(data);\n }\n\n return data;\n },\n\n _emitUpdate(addData = {}) {\n const { em, model } = this;\n if (!em) return;\n const property = model.get('property');\n const data = { ...this._getEventData(), ...addData };\n const { id } = data;\n\n em.trigger('style:update', data);\n em.trigger(`style:update:${property}`, data);\n property !== id && em.trigger(`style:update:${id}`, data);\n },\n\n _getEventData() {\n const { model } = this;\n\n return {\n propertyView: this,\n targets: this.getTargets(),\n value: model.getFullValue(),\n property: model,\n id: model.get('id'),\n name: model.get('property')\n };\n },\n\n checkVisibility() {\n var result = 1;\n\n // Check if need to hide the property\n if (this.config.hideNotStylable) {\n if (!this.isTargetStylable() || !this.isComponentStylable()) {\n this.hide();\n result = 0;\n } else {\n this.show();\n }\n // Sector is not passed to Composite and Stack types\n if (this.sector) {\n this.sector.trigger('updateVisibility');\n }\n }\n\n return result;\n },\n\n /**\n * Get the value of this property from the target (eg, Component, CSSRule)\n * @param {Object} [opts] Options\n * @param {Boolean} [options.fetchFromFunction]\n * @param {Boolean} [options.ignoreDefault]\n * @return string\n * @private\n */\n getTargetValue(opts = {}) {\n let result;\n const { model } = this;\n const target = this.getFirstTarget();\n const customFetchValue = this.customValue;\n\n if (!target) {\n return result;\n }\n\n result = target.getStyle()[model.get('property')];\n\n if (!result && !opts.ignoreDefault) {\n result = model.getDefaultValue();\n }\n\n if (typeof customFetchValue == 'function' && !opts.ignoreCustomValue) {\n let index = model.collection.indexOf(model);\n let customValue = customFetchValue(this, index, result);\n\n if (customValue) {\n result = customValue;\n }\n }\n\n return result;\n },\n\n /**\n * Returns computed value\n * @return {String}\n * @private\n */\n getComputedValue() {\n const target = this.propTarget;\n const computed = target.computed || {};\n const computedDef = target.computedDefault || {};\n const avoid = this.config.avoidComputed || [];\n const property = this.model.get('property');\n const notToSkip = avoid.indexOf(property) < 0;\n const value = computed[property];\n const valueDef = computedDef[camelCase(property)];\n return (computed && notToSkip && valueDef !== value && value) || '';\n },\n\n /**\n * Returns value from input\n * @return {string}\n */\n getInputValue() {\n const input = this.getInputEl();\n return input ? input.value : '';\n },\n\n /**\n * Triggers when the `value` of the model changes, so the target and\n * the input element should be updated\n * @param {Object} e Event\n * @param {Mixed} val Value\n * @param {Object} opt Options\n * */\n modelValueChanged(e, val, opt = {}) {\n const { model } = this;\n const value = model.getFullValue();\n\n // Avoid element update if the change comes from it\n if (!opt.fromInput) {\n this.setValue(value);\n }\n\n // Avoid target update if the changes comes from it\n if (!opt.fromTarget) {\n this.getTargets().forEach(target => this.__updateTarget(target, opt));\n\n // Update the editor and selected components about the change\n const { em } = this.config;\n if (!em) return;\n const prop = model.get('property');\n const updated = { [prop]: value };\n em.getSelectedAll().forEach(component => {\n !opt.noEmit && em.trigger('component:update', component, updated, opt);\n em.trigger(evStyleUp, component, prop, opt);\n em.trigger(`${evStyleUp}:${prop}`, component, value, opt);\n component.trigger(`change:style`, component, updated, opt);\n component.trigger(`change:style:${prop}`, component, value, opt);\n });\n }\n },\n\n __updateTarget(target, opt = {}) {\n const { model } = this;\n const value = model.getFullValue();\n const onChange = this.onChange;\n\n // Check if component is allowed to be styled\n if (!target || !this.isComponentStylable()) {\n return;\n }\n\n // Avoid target update if the changes comes from it\n if (!opt.fromTarget) {\n // The onChange is used by Composite/Stack properties, so I'd avoid sending\n // it back if the change comes from one of those\n if (onChange && !opt.fromParent) {\n onChange(target, this, opt);\n } else {\n this.updateTargetStyle(value, null, { ...opt, target });\n }\n }\n\n this._emitUpdate();\n },\n\n /**\n * Update target style\n * @param {string} value\n * @param {string} name\n * @param {Object} opts\n */\n updateTargetStyle(value, name = '', opts = {}) {\n const property = name || this.model.get('property');\n const target = opts.target || this.getFirstTarget();\n const style = target.getStyle();\n\n if (value) {\n style[property] = value;\n } else {\n delete style[property];\n }\n\n // Forces to trigger the change (for UndoManager)\n if (opts.avoidStore) {\n style.__ = 1;\n } else {\n delete style.__;\n }\n\n target.setStyle(style, opts);\n\n // Helper is used by `states` like ':hover' to show its preview\n const helper = this.getHelperModel();\n helper && helper.setStyle(style, opts);\n },\n\n /**\n * Check if target is stylable with this property\n * The target could be the Component as the CSS Rule\n * @return {Boolean}\n */\n isTargetStylable(target) {\n const trg = target || this.getFirstTarget();\n const model = this.model;\n const id = model.get('id');\n const property = model.get('property');\n const toRequire = model.get('toRequire');\n const unstylable = trg.get('unstylable');\n const stylableReq = trg.get('stylable-require');\n const requires = model.get('requires');\n const requiresParent = model.get('requiresParent');\n const sectors = this.sector ? this.sector.collection : null;\n const selected = this.em ? this.em.getSelected() : null;\n let stylable = trg.get('stylable');\n\n // Stylable could also be an array indicating with which property\n // the target could be styled\n if (isArray(stylable)) {\n stylable = stylable.indexOf(property) >= 0;\n }\n\n // Check if the property was signed as unstylable\n if (isArray(unstylable)) {\n stylable = unstylable.indexOf(property) < 0;\n }\n\n // Check if the property is available only if requested\n if (toRequire) {\n stylable =\n !target ||\n (stylableReq &&\n (stylableReq.indexOf(id) >= 0 || stylableReq.indexOf(property) >= 0));\n }\n\n // Check if the property is available based on other property's values\n if (sectors && requires) {\n const properties = Object.keys(requires);\n sectors.each(sector => {\n sector.get('properties').each(model => {\n if (includes(properties, model.id)) {\n const values = requires[model.id];\n stylable = stylable && includes(values, model.get('value'));\n }\n });\n });\n }\n\n // Check if the property is available based on parent's property values\n if (requiresParent) {\n const parent = selected && selected.parent();\n const parentEl = parent && parent.getEl();\n if (parentEl) {\n const styles = window.getComputedStyle(parentEl);\n each(requiresParent, (values, property) => {\n stylable =\n stylable && styles[property] && includes(values, styles[property]);\n });\n } else {\n stylable = false;\n }\n }\n\n return stylable;\n },\n\n /**\n * Check if the selected component is stylable with this property\n * The target could be the Component as the CSS Rule\n * @return {Boolean}\n */\n isComponentStylable() {\n const em = this.em;\n const component = em && em.getSelected();\n\n if (!component) {\n return true;\n }\n\n return this.isTargetStylable(component);\n },\n\n /**\n * Passed a raw value you have to update the input element, generally\n * is the value fetched from targets, so you can receive values with\n * functions, units, etc. (eg. `rotateY(45deg)`)\n * get also\n * @param {string} value\n * @private\n */\n setRawValue(value) {\n this.setValue(this.model.parseValue(value));\n },\n\n /**\n * Update the element input.\n * Usually the value is a result of `model.getFullValue()`\n * @param {String} value The value from the model\n * */\n setValue(value) {\n const model = this.model;\n let val = isUndefined(value) ? model.getDefaultValue() : value;\n if (this.update) return this.__update(val);\n const input = this.getInputEl();\n input && (input.value = val);\n },\n\n getInputEl() {\n if (!this.input) {\n this.input = this.el.querySelector('input');\n }\n\n return this.input;\n },\n\n updateVisibility() {\n this.el.style.display = this.model.get('visible') ? '' : 'none';\n },\n\n show() {\n this.model.set('visible', 1);\n },\n\n hide() {\n this.model.set('visible', 0);\n },\n\n /**\n * Clean input\n * */\n cleanValue() {\n this.setValue('');\n },\n\n clearCached() {\n this.clearEl = null;\n this.input = null;\n this.$input = null;\n },\n\n __unset() {\n const unset = this.unset && this.unset.bind(this);\n unset && unset(this._getClbOpts());\n },\n\n __update(value) {\n const update = this.update && this.update.bind(this);\n update &&\n update({\n ...this._getClbOpts(),\n value\n });\n },\n\n __change(...args) {\n const emit = this.emit && this.emit.bind(this);\n emit && emit(this._getClbOpts(), ...args);\n },\n\n __updateStyle(value, { complete, ...opts } = {}) {\n const { em, model } = this;\n const prop = model.get('property');\n const final = complete !== false;\n\n if (isObject(value)) {\n this.getTargets().forEach(target => {\n target.addStyle(value, { avoidStore: !final });\n em && em.trigger(evStyleUp, target, prop, opts);\n });\n } else {\n model.setValueFromInput(value, complete, opts);\n }\n\n final && this.elementUpdated();\n },\n\n _getClbOpts() {\n const { model, el, createdEl, propTarget } = this;\n const prop = model.get('property');\n const computed = propTarget.computed || {};\n const parentRules = propTarget.parentRules || [];\n const parentRule = find(parentRules, rule => !!rule.getStyle()[prop]);\n return {\n el,\n createdEl,\n props: model.attributes,\n setProps: (...args) => model.set(...args),\n change: this.__change,\n updateStyle: this.__updateStyle,\n targets: this.getTargets(), // Used to update selected targets\n target: this.getFirstTarget(), // Used to update custom UI\n computed,\n parentRules, // All parent rules\n parentRule // First parent rule containing the same property\n };\n },\n\n render() {\n this.clearCached();\n const { pfx, model, el, $el } = this;\n const property = model.get('property');\n const full = model.get('full');\n const cls = model.get('className') || '';\n const className = `${pfx}property`;\n\n this.createdEl && this.__destroyFn(this._getClbOpts());\n $el.empty().append(this.template(model));\n $el.find('[data-sm-label]').append(this.templateLabel(model));\n const create = this.create && this.create.bind(this);\n this.createdEl = create && create(this._getClbOpts());\n $el\n .find('[data-sm-fields]')\n .append(this.createdEl || this.templateInput(model));\n\n el.className = `${className} ${pfx}${model.get(\n 'type'\n )} ${className}__${property} ${cls}`.trim();\n el.className += full ? ` ${className}--full` : '';\n this.updateStatus();\n\n const onRender = this.onRender && this.onRender.bind(this);\n onRender && onRender();\n this.setValue(model.get('value'), { fromTarget: 1 });\n }\n});\n","import Backbone from 'backbone';\nimport PropertyView from './PropertyView';\n\nconst $ = Backbone.$;\n\nexport default PropertyView.extend({\n templateInput() {\n const pfx = this.pfx;\n return `\n
\n \n
\n `;\n },\n\n inputValueChanged(...args) {\n // If it's not detached (eg. 'padding: 1px 2px 3px 4px;') it will follow\n // the same flow of PropertyView\n if (!this.model.get('detached')) {\n PropertyView.prototype.inputValueChanged.apply(this, args);\n }\n },\n\n clear(e) {\n const props = this.properties;\n props && props.forEach(propView => propView.clear());\n PropertyView.prototype.clear.apply(this, arguments);\n },\n\n remove() {\n this.model.get('properties').reset();\n PropertyView.prototype.remove.apply(this, arguments);\n ['properties', 'props', '$props'].forEach(i => (this[i] = {}));\n },\n\n /**\n * Renders input\n * */\n onRender() {\n var model = this.model;\n var props = model.get('properties') || [];\n var self = this;\n this.properties = [];\n\n if (props.length) {\n if (!this.$input) {\n this.$input = $('');\n this.input = this.$input.get(0);\n }\n\n if (!this.props) {\n this.props = model.get('properties');\n }\n\n if (!this.$props) {\n //Not yet supported nested composite\n this.props.each(function(prop, index) {\n if (prop && prop.get('type') == 'composite') {\n this.props.remove(prop);\n console.warn('Nested composite types not yet allowed.');\n }\n prop.parent = model;\n }, this);\n\n var PropertiesView = require('./PropertiesView').default;\n var propsView = new PropertiesView(this.getPropsConfig());\n this.$props = propsView.render().$el;\n this.properties = propsView.properties;\n this.$el.find(`#${this.pfx}input-holder`).append(this.$props);\n }\n }\n },\n\n /**\n * Returns configurations that should be past to properties\n * @param {Object} opts\n * @return {Object}\n */\n getPropsConfig(opts) {\n var that = this;\n const model = this.model;\n\n var result = {\n config: { ...this.config, highlightComputed: 0 },\n collection: this.props,\n target: this.target,\n propTarget: this.propTarget,\n // On any change made to children I need to update composite value\n onChange(el, view, opts) {\n model.set('value', model.getFullValue(), opts);\n },\n // Each child property will receive a full composite string, eg. '0px 0px 10px 0px'\n // I need to extract from that string the corresponding one to that property.\n customValue(property, mIndex) {\n return that.valueOnIndex(mIndex, property);\n }\n };\n\n // If detached let follow its standard flow\n if (model.get('detached')) {\n delete result.onChange;\n }\n\n return result;\n },\n\n /**\n * Extract string from composite value\n * @param {number} index Index\n * @param {Object} view Property view\n * @return {string}\n * */\n valueOnIndex(index, view) {\n let value;\n const targetValue = this.getTargetValue({ ignoreDefault: 1 });\n\n // If the target value of the composite is not empty I'll fetch\n // the corresponding value from the requested index, otherwise try\n // to get the value of the sub-property\n if (targetValue) {\n const values = targetValue.split(this.model.getSplitSeparator());\n value = values[index];\n } else {\n value =\n view && view.getTargetValue({ ignoreCustomValue: 1, ignoreDefault: 1 });\n }\n\n return value;\n },\n\n clearCached() {\n PropertyView.prototype.clearCached.apply(this, arguments);\n this.$input = null;\n this.props = null;\n this.$props = null;\n }\n});\n","import { isString, each } from 'underscore';\nimport Backbone from 'backbone';\nimport PropertiesView from './PropertiesView';\n\nexport default Backbone.View.extend({\n events: {\n click: 'active',\n 'click [data-close-layer]': 'removeItem',\n 'mousedown [data-move-layer]': 'initSorter',\n 'touchstart [data-move-layer]': 'initSorter'\n },\n\n template(model) {\n const { pfx, ppfx, em } = this;\n const label = `${em && em.t('styleManager.layer')} ${model.get('index')}`;\n\n return `\n
\n \n
\n
${label}
\n
\n \t
\n
\n
\n ⨯\n
\n
\n
\n `;\n },\n\n initialize(o = {}) {\n let model = this.model;\n this.stackModel = o.stackModel;\n this.config = o.config || {};\n this.em = this.config.em;\n this.pfx = this.config.stylePrefix || '';\n this.ppfx = this.config.pStylePrefix || '';\n this.sorter = o.sorter || null;\n this.propsConfig = o.propsConfig || {};\n this.customPreview = o.onPreview;\n this.listenTo(model, 'destroy remove', this.remove);\n this.listenTo(model, 'change:active', this.updateVisibility);\n this.listenTo(model.get('properties'), 'change', this.updatePreview);\n\n // For the sorter\n model.view = this;\n model.set({ droppable: 0, draggable: 1 });\n this.$el.data('model', model);\n },\n\n /**\n * Delegate sorting\n * @param {Event} e\n * */\n initSorter(e) {\n if (this.sorter) this.sorter.startSort(this.el);\n },\n\n removeItem(ev) {\n ev && ev.stopPropagation();\n this.remove();\n },\n\n remove(opts = {}) {\n const { model, props } = this;\n const coll = model.collection;\n const stackModel = this.stackModel;\n\n Backbone.View.prototype.remove.apply(this, arguments);\n coll && coll.contains(model) && coll.remove(model);\n\n if (stackModel && stackModel.set) {\n stackModel.set({ stackIndex: null }, { silent: true });\n !opts.fromTarget && stackModel.trigger('updateValue');\n }\n\n props && props.remove();\n },\n\n /**\n * Default method for changing preview box\n * @param {Collection} props\n * @param {Element} $el\n */\n onPreview(value) {\n const { stackModel } = this;\n const detach = stackModel && stackModel.get('detached');\n const values = value.split(' ');\n const lim = 3;\n const result = [];\n const resultObj = {};\n\n this.model.get('properties').each((prop, index) => {\n const property = prop.get('property');\n let value = detach ? prop.getFullValue() : values[index] || '';\n\n if (value) {\n if (prop.get('type') == 'integer') {\n let valueInt = parseInt(value, 10);\n let unit = value.replace(valueInt, '');\n valueInt = !isNaN(valueInt) ? valueInt : 0;\n valueInt = valueInt > lim ? lim : valueInt;\n valueInt = valueInt < -lim ? -lim : valueInt;\n value = valueInt + unit;\n }\n }\n\n result.push(value);\n resultObj[property] = value;\n });\n\n return detach ? resultObj : result.join(' ');\n },\n\n updatePreview() {\n const stackModel = this.stackModel;\n const customPreview = this.customPreview;\n const previewEl = this.getPreviewEl();\n const value = this.model.getFullValue();\n const preview = customPreview\n ? customPreview(value)\n : this.onPreview(value);\n\n if (preview && stackModel && previewEl) {\n const { style } = previewEl;\n if (isString(preview)) {\n style[stackModel.get('property')] = preview;\n } else {\n let prvStr = [];\n each(preview, (val, prop) => prvStr.push(`${prop}:${val}`));\n previewEl.setAttribute('style', prvStr.join(';'));\n }\n }\n },\n\n getPropertiesWrapper() {\n if (!this.propsWrapEl) {\n this.propsWrapEl = this.el.querySelector('[data-properties]');\n }\n return this.propsWrapEl;\n },\n\n getPreviewEl() {\n if (!this.previewEl) {\n this.previewEl = this.el.querySelector('[data-preview]');\n }\n return this.previewEl;\n },\n\n active() {\n const model = this.model;\n const collection = model.collection;\n collection.active(collection.indexOf(model));\n },\n\n updateVisibility() {\n const pfx = this.pfx;\n const wrapEl = this.getPropertiesWrapper();\n const active = this.model.get('active');\n wrapEl.style.display = active ? '' : 'none';\n this.$el[active ? 'addClass' : 'removeClass'](`${pfx}active`);\n },\n\n render() {\n const propsConfig = this.propsConfig;\n const { model, el, pfx } = this;\n const preview = model.get('preview');\n const properties = new PropertiesView({\n collection: model.get('properties'),\n config: { ...this.config, fromLayer: 1 },\n target: propsConfig.target,\n customValue: propsConfig.customValue,\n propTarget: propsConfig.propTarget,\n onChange: propsConfig.onChange\n });\n const propsEl = properties.render().el;\n\n el.innerHTML = this.template(model);\n el.className = `${pfx}layer${!preview ? ` ${pfx}no-preview` : ''}`;\n this.props = properties;\n this.getPropertiesWrapper().appendChild(propsEl);\n this.updateVisibility();\n this.updatePreview();\n return this;\n }\n});\n","import Backbone from 'backbone';\nimport LayerView from './LayerView';\n\nexport default Backbone.View.extend({\n initialize(o) {\n this.config = o.config || {};\n this.stackModel = o.stackModel;\n this.preview = o.preview;\n this.pfx = this.config.stylePrefix || '';\n this.ppfx = this.config.pStylePrefix || '';\n this.propsConfig = o.propsConfig;\n let pfx = this.pfx;\n let ppfx = this.ppfx;\n let collection = this.collection;\n this.className = `${pfx}layers ${ppfx}field`;\n this.listenTo(collection, 'add', this.addTo);\n this.listenTo(collection, 'deselectAll', this.deselectAll);\n this.listenTo(collection, 'reset', this.reset);\n this.items = [];\n\n var em = this.config.em || '';\n var utils = em ? em.get('Utils') : '';\n\n this.sorter = utils\n ? new utils.Sorter({\n container: this.el,\n ignoreViewChildren: 1,\n containerSel: `.${pfx}layers`,\n itemSel: `.${pfx}layer`,\n pfx: this.config.pStylePrefix\n })\n : '';\n\n // For the Sorter\n collection.view = this;\n this.$el.data('model', collection);\n this.$el.data('collection', collection);\n },\n\n /**\n * Add to collection\n * @param Object Model\n *\n * @return Object\n * */\n addTo(model) {\n var i = this.collection.indexOf(model);\n this.addToCollection(model, null, i);\n },\n\n /**\n * Add new object to collection\n * @param Object Model\n * @param Object Fragment collection\n * @param {number} index Index of append\n *\n * @return Object Object created\n * */\n addToCollection(model, fragmentEl, index) {\n var fragment = fragmentEl || null;\n const stackModel = this.stackModel;\n const config = this.config;\n const sorter = this.sorter;\n const propsConfig = this.propsConfig;\n\n if (typeof this.preview !== 'undefined') {\n model.set('preview', this.preview);\n }\n\n const view = new LayerView({\n model,\n config,\n sorter,\n stackModel,\n propsConfig\n });\n const rendered = view.render().el;\n this.items.push(view);\n\n if (fragment) {\n fragment.appendChild(rendered);\n } else {\n if (typeof index != 'undefined') {\n var method = 'before';\n // If the added model is the last of collection\n // need to change the logic of append\n if (this.$el.children().length == index) {\n index--;\n method = 'after';\n }\n // In case the added is new in the collection index will be -1\n if (index < 0) {\n this.$el.append(rendered);\n } else\n this.$el\n .children()\n .eq(index)\n [method](rendered);\n } else this.$el.append(rendered);\n }\n\n return rendered;\n },\n\n /**\n * Deselect all\n *\n * @return void\n * */\n deselectAll() {\n this.$el.find('.' + this.pfx + 'layer').removeClass(this.pfx + 'active');\n },\n\n reset(coll, opts) {\n this.clearItems(opts);\n this.render();\n },\n\n render() {\n var fragment = document.createDocumentFragment();\n this.$el.empty();\n\n this.collection.each(function(model) {\n this.addToCollection(model, fragment);\n }, this);\n\n this.$el.append(fragment);\n this.$el.attr('class', this.className);\n\n if (this.sorter) this.sorter.plh = null;\n\n return this;\n },\n\n remove() {\n this.clearItems();\n Backbone.View.prototype.remove.apply(this, arguments);\n },\n\n clearItems(opts) {\n this.items.forEach(item => item.remove(opts));\n this.items = [];\n }\n});\n","import { isUndefined, keys } from 'underscore';\nimport PropertyCompositeView from './PropertyCompositeView';\nimport LayersView from './LayersView';\nimport CssGenerator from 'code_manager/model/CssGenerator';\n\nconst cssGen = new CssGenerator();\n\nexport default PropertyCompositeView.extend({\n templateInput() {\n const pfx = this.pfx;\n const ppfx = this.ppfx;\n return `\n
\n \n
\n
\n `;\n },\n\n init() {\n const model = this.model;\n const pfx = this.pfx;\n model.set('stackIndex', null);\n this.events[`click [data-add-layer]`] = 'addLayer';\n this.listenTo(model, 'change:stackIndex', this.indexChanged);\n this.listenTo(model, 'updateValue', this.inputValueChanged);\n this.delegateEvents();\n\n const propsConfig = this.getPropsConfig();\n this.layers = new LayersView({\n collection: this.getLayers(),\n stackModel: model,\n preview: model.get('preview'),\n config: this.config,\n propsConfig\n });\n // For detached properties, used in inputValueChanged (eg. clear all)\n const PropertiesView = require('./PropertiesView').default;\n this.propsView = new PropertiesView({\n target: this.target,\n collection: model.get('properties'),\n stackModel: model,\n config: this.config,\n onChange: propsConfig.onChange,\n propTarget: propsConfig.propTarget\n });\n },\n\n /**\n * Fired when the target is updated.\n * With detached mode the component will be always empty as its value\n * so we gonna check all props and find if it has any difference\n * */\n targetUpdated(...args) {\n let data;\n if (!this.model.get('detached')) {\n data = PropertyCompositeView.prototype.targetUpdated.apply(this, args);\n } else {\n data = this._getTargetData();\n this.setStatus(data.status);\n this.checkVisibility();\n }\n\n // I have to wait the update of inner properites (like visibility)\n // before render layers\n setTimeout(() => this.refreshLayers(data));\n },\n\n /**\n * Returns the collection of layers\n * @return {Collection}\n */\n getLayers() {\n return this.model.get('layers');\n },\n\n /**\n * Triggered when another layer has been selected.\n * This allow to move all rendered properties to a new\n * selected layer\n * @param {Event}\n *\n * @return {Object}\n * */\n indexChanged(e) {\n const model = this.model;\n this.getLayers().active(model.get('stackIndex'));\n },\n\n addLayer() {\n const model = this.model;\n const layers = this.getLayers();\n const prepend = model.get('prepend');\n const properties = model.get('properties').deepClone();\n properties.each(property => property.set('value', ''));\n const layer = layers.add(\n { properties },\n {\n active: 1,\n ...(prepend && { at: 0 })\n }\n );\n\n // In detached mode inputValueChanged will add new 'layer value'\n // to all subprops\n this.inputValueChanged({ up: 1 });\n\n // This will set subprops with a new default values\n model.set('stackIndex', layers.indexOf(layer));\n },\n\n inputValueChanged(opts = {}) {\n const model = this.model;\n opts.up && this.elementUpdated();\n\n // If not detached I'll just put all the values from layers to property\n // eg. background: layer1Value, layer2Value, layer3Value, ...\n if (!model.get('detached')) {\n model.set('value', this.getLayerValues());\n } else {\n model.get('properties').each(prop => prop.trigger('change:value'));\n }\n },\n\n /**\n * There is no need to handle input update by the property itself,\n * this will be done by layers\n * @private\n */\n setValue() {},\n\n /**\n * Create value by layers\n * @return string\n * */\n getLayerValues() {\n return this.getLayers().getFullValue();\n },\n\n _getClassRule(opts = {}) {\n const { em } = this;\n const { skipAdd = 1 } = opts;\n const selected = em.getSelected();\n const targetAlt = em.get('StyleManager').getModelToStyle(selected, {\n skipAdd,\n useClasses: 1\n });\n return targetAlt !== selected && targetAlt;\n },\n\n /**\n * Return the parent style rule of the passed one\n * @private\n */\n _getParentTarget(target, opts = {}) {\n const { em, model } = this;\n const property = model.get('property');\n const isValid = opts.isValid || (rule => rule.getStyle()[property]);\n const targetsDevice = em\n .get('CssComposer')\n .getAll()\n .filter(rule => rule.selectorsToString() === target.getSelectorsString());\n const map = targetsDevice.reduce((acc, rule) => {\n acc[rule.getAtRule()] = rule;\n return acc;\n }, {});\n const mapSorted = cssGen.sortMediaObject(map);\n const sortedRules = mapSorted.map(item => item.value);\n const currIndex = sortedRules.indexOf(target);\n const rulesToCheck = sortedRules.splice(0, currIndex);\n let result;\n\n for (let i = rulesToCheck.length - 1; i > -1; i--) {\n const rule = rulesToCheck[i];\n if (isValid(rule)) {\n // only for not detached\n result = rule;\n break;\n }\n }\n\n return result;\n },\n\n /**\n * Refresh layers\n * */\n refreshLayers(opts = {}) {\n let layersObj = [];\n const { model, em } = this;\n const layers = this.getLayers();\n const detached = model.get('detached');\n const property = model.get('property');\n const target = this.getFirstTarget();\n const valueComput = this.getComputedValue();\n const selected = em.getSelected();\n const updateOpts = { fromTarget: 1 };\n let resultValue,\n style,\n targetAlt,\n targetAltDevice,\n valueTargetAlt,\n valueTrgAltDvc;\n\n // With detached layers values will be assigned to their properties\n if (detached) {\n style = opts.targetValue || {};\n const hasDetachedStyle = rule => {\n const name = model\n .get('properties')\n .at(0)\n .get('property');\n return rule && !isUndefined(rule.getStyle()[name]);\n };\n\n // If the style object is empty but the target has a computed value,\n // that means the style might exist in some other place\n if (!keys(style).length && valueComput && selected) {\n // Styles of the same target but with a higher rule\n const parentOpts = { isValid: rule => hasDetachedStyle(rule) };\n targetAltDevice = this._getParentTarget(target, parentOpts);\n\n if (targetAltDevice) {\n style = targetAltDevice.getStyle();\n } else {\n // The target is a component but the style is in the class rules\n targetAlt = this._getClassRule();\n valueTargetAlt = hasDetachedStyle(targetAlt) && targetAlt.getStyle();\n targetAltDevice =\n !valueTargetAlt &&\n this._getParentTarget(\n this._getClassRule({ skipAdd: 0 }),\n parentOpts\n );\n valueTrgAltDvc =\n hasDetachedStyle(targetAltDevice) && targetAltDevice.getStyle();\n style = valueTargetAlt || valueTrgAltDvc || {};\n }\n }\n\n resultValue = style;\n layersObj = layers.getLayersFromStyle(style);\n } else {\n const valueTrg = this.getTargetValue({ ignoreDefault: 1 });\n let value = valueTrg;\n\n // Try to check if the style is in another rule\n if (!value && valueComput) {\n // Styles of the same target but with a higher rule\n targetAltDevice = this._getParentTarget(target);\n\n if (targetAltDevice) {\n value = targetAltDevice.getStyle()[property];\n } else {\n // Computed value is not always reliable due to the browser's CSSOM parser\n // here we try to look for the style in class rules\n targetAlt = this._getClassRule();\n valueTargetAlt = targetAlt && targetAlt.getStyle()[property];\n targetAltDevice =\n !valueTargetAlt &&\n this._getParentTarget(this._getClassRule({ skipAdd: 0 }));\n valueTrgAltDvc =\n targetAltDevice && targetAltDevice.getStyle()[property];\n value = valueTargetAlt || valueTrgAltDvc || valueComput;\n }\n }\n\n value = value == model.getDefaultValue() ? '' : value;\n resultValue = value;\n layersObj = layers.getLayersFromValue(value);\n }\n\n const toAdd =\n model.getLayersFromTarget(target, { resultValue, layersObj }) ||\n layersObj;\n layers.reset(null, updateOpts);\n layers.add(toAdd, updateOpts);\n model.set({ stackIndex: null }, { silent: true });\n },\n\n getTargetValue(opts = {}) {\n const { model } = this;\n const { detached } = model.attributes;\n const target = this.getFirstTarget();\n let result = PropertyCompositeView.prototype.getTargetValue.call(\n this,\n opts\n );\n\n // It might happen that the browser split properties on CSSOM parse\n if (isUndefined(result) && !detached) {\n result = model.getValueFromStyle(target.getStyle());\n } else if (detached) {\n result = model.getValueFromTarget(target);\n }\n\n return result;\n },\n\n getPropsConfig() {\n const self = this;\n const { model } = self;\n\n return {\n target: self.target,\n propTarget: self.propTarget,\n\n // Things to do when a single sub-property is changed\n onChange(el, view, opt) {\n const subModel = view.model;\n const status = model.get('status');\n\n if (model.get('detached')) {\n const subProp = subModel.get('property');\n const defVal = subModel.getDefaultValue();\n const layers = self.getLayers();\n const values = layers.getPropertyValues(subProp, defVal);\n view.updateTargetStyle(values, null, opt);\n // Update also the target with values of special hidden properties.\n // This fixes the case of update with computed layers\n if (\n subProp == 'background-image' &&\n !opt.avoidStore &&\n status == 'computed'\n ) {\n model\n .get('properties')\n .filter(prop => prop.get('property').substr(0, 2) == '__')\n .forEach(prop => {\n const name = prop.get('property');\n const value = layers.getPropertyValues(\n name,\n prop.getDefaultValue()\n );\n self\n .getTargets()\n .forEach(tr => tr.addStyle({ [name]: value }, opt));\n });\n }\n } else {\n // Update only if there is an actual update (to avoid changes for computed styles)\n // ps: status is calculated in `targetUpdated` method\n if (status == 'updated') {\n const value = model.getFullValue();\n model.set('value', value, opt);\n // Try to remove detached properties\n !value && view.updateTargetStyle(value, null, opt);\n }\n }\n }\n };\n },\n\n onRender() {\n const { el, layers, propsView } = this;\n const fieldEl = el.querySelector('[data-layers-wrapper]');\n propsView.render(); // Will use it to propogate changes\n fieldEl.appendChild(layers.render().el);\n }\n});\n","import { isString } from 'underscore';\nimport Backbone from 'backbone';\nimport PropertyView from './PropertyView';\n\nconst $ = Backbone.$;\n\nexport default PropertyView.extend({\n templateInput() {\n const { pfx, em } = this;\n\n return `\n
\n
\n
\n \n
\n
\n
\n
\n
\n
⨯
\n
\n
\n `;\n },\n\n init() {\n const em = this.em;\n this.modal = em.get('Modal');\n this.am = em.get('AssetManager');\n this.events['click #' + this.pfx + 'close'] = 'removeFile';\n this.events['click #' + this.pfx + 'images'] = 'openAssetManager';\n this.delegateEvents();\n },\n\n onRender() {\n if (!this.$input) {\n const plh = this.model.getDefaultValue();\n this.$input = $(``);\n }\n\n if (!this.$preview) {\n this.$preview = this.$el.find('#' + this.pfx + 'preview-file');\n }\n\n if (!this.$previewBox) {\n this.$previewBox = this.$el.find('#' + this.pfx + 'preview-box');\n }\n\n this.setValue(this.componentValue, 0);\n },\n\n clearCached() {\n PropertyView.prototype.clearCached.apply(this, arguments);\n this.$preview = null;\n this.$previewBox = null;\n },\n\n setValue(value, f) {\n PropertyView.prototype.setValue.apply(this, arguments);\n this.setPreviewView(value && value != this.model.getDefaultValue());\n this.setPreview(value);\n },\n\n /**\n * Change visibility of the preview box\n * @param bool Visibility\n *\n * @return void\n * */\n setPreviewView(v) {\n const pv = this.$previewBox;\n pv && pv[v ? 'addClass' : 'removeClass'](`${this.pfx}show`);\n pv && pv.css({ display: v ? 'block' : 'none' });\n },\n\n /**\n * Spread url\n * @param string Url\n *\n * @return void\n * */\n spreadUrl(url) {\n this.model.set('value', url);\n this.setPreviewView(1);\n },\n\n /**\n * Shows file preview\n * @param string Value\n * */\n setPreview(value) {\n const preview = this.$preview;\n value = value && value.indexOf('url(') < 0 ? `url(${value})` : value;\n preview && preview.css('background-image', value);\n },\n\n /** @inheritdoc */\n cleanValue() {\n this.setPreviewView(0);\n this.model.set({ value: '' }, { silent: true });\n },\n\n /**\n * Remove file from input\n *\n * @return void\n * */\n removeFile(...args) {\n this.model.set('value', this.model.getDefaultValue());\n PropertyView.prototype.cleanValue.apply(this, args);\n this.setPreviewView(0);\n },\n\n /**\n * Open dialog for image selecting\n * @param {Object} e Event\n *\n * @return void\n * */\n openAssetManager() {\n const { em } = this;\n const am = em && em.get('AssetManager');\n const handleAsset = a => this.spreadUrl(isString(a) ? a : a.get('src'));\n\n am &&\n am.open({\n select(asset, complete) {\n handleAsset(asset);\n complete && am.close();\n },\n target: this.getTargetModel(),\n types: ['image'],\n accept: 'image/*'\n });\n }\n});\n","import Backbone from 'backbone';\nimport PropertyView from './PropertyView';\n\nconst $ = Backbone.$;\n\nexport default PropertyView.extend({\n templateInput() {\n return '';\n },\n\n init() {\n const model = this.model;\n this.listenTo(model, 'change:unit', this.modelValueChanged);\n this.listenTo(model, 'el:change', this.elementUpdated);\n this.listenTo(model, 'change:units', this.render);\n },\n\n setValue(value) {\n const parsed = this.model.parseValue(value);\n value = `${parsed.value}${parsed.unit}`;\n this.inputInst.setValue(value, { silent: 1 });\n },\n\n onRender() {\n const ppfx = this.ppfx;\n\n if (!this.input) {\n const input = this.model.input;\n input.ppfx = ppfx;\n input.render();\n const fields = this.el.querySelector(`.${ppfx}fields`);\n fields.appendChild(input.el);\n this.$input = input.inputEl;\n this.unit = input.unitEl;\n this.$unit = $(this.unit);\n this.input = this.$input.get(0);\n this.inputInst = input;\n }\n },\n\n clearCached() {\n PropertyView.prototype.clearCached.apply(this, arguments);\n this.unit = null;\n this.$unit = null;\n }\n});\n","import PropertyIntegerView from './PropertyIntegerView';\nimport InputColor from 'domain_abstract/ui/InputColor';\n\nexport default PropertyIntegerView.extend({\n setValue(value, opts = {}) {\n opts = { ...opts, silent: 1 };\n this.inputInst.setValue(value, opts);\n },\n\n remove() {\n PropertyIntegerView.prototype.remove.apply(this, arguments);\n const inp = this.inputInst;\n inp && inp.remove && inp.remove();\n ['inputInst', '$color'].forEach(i => (this[i] = {}));\n },\n\n onRender() {\n if (!this.input) {\n const ppfx = this.ppfx;\n const inputColor = new InputColor({\n target: this.target,\n model: this.model,\n ppfx\n });\n const input = inputColor.render();\n this.el.querySelector(`.${ppfx}fields`).appendChild(input.el);\n this.$input = input.inputEl;\n this.$color = input.colorEl;\n this.input = this.$input.get(0);\n this.inputInst = input;\n }\n }\n});\n","import Property from './Property';\n\nexport default Property.extend({\n defaults: () => ({\n ...Property.prototype.defaults,\n // Array of options, eg. [{name: 'Label ', value: '100'}]\n options: [],\n full: 1\n }),\n\n initialize(...args) {\n Property.prototype.initialize.apply(this, args);\n this.listenTo(this, 'change:options', this.onOptionChange);\n },\n\n onOptionChange() {\n this.set('list', this.get('options'));\n },\n\n getOptions() {\n const { options, list } = this.attributes;\n return options && options.length ? options : list;\n },\n\n setOptions(opts = []) {\n this.set('options', opts);\n return this;\n },\n\n addOption(opt) {\n if (opt) {\n const opts = this.getOptions();\n this.setOptions([...opts, opt]);\n }\n return this;\n }\n});\n","import Property from './PropertyRadio';\n\nexport default Property.extend({\n defaults: () => ({\n ...Property.prototype.defaults(),\n full: 0\n })\n});\n","import Backbone from 'backbone';\nimport PropertyView from './PropertyView';\n\nconst $ = Backbone.$;\n\nexport default PropertyView.extend({\n templateInput() {\n const pfx = this.pfx;\n const ppfx = this.ppfx;\n return `\n
\n \n
\n
\n
\n
\n `;\n },\n\n initialize(...args) {\n PropertyView.prototype.initialize.apply(this, args);\n this.listenTo(this.model, 'change:options', this.updateOptions);\n },\n\n updateOptions() {\n this.input = null;\n this.onRender();\n },\n\n onRender() {\n var pfx = this.pfx;\n const options = this.model.getOptions();\n\n if (!this.input) {\n let optionsStr = '';\n\n options.forEach(option => {\n let name = option.name || option.value;\n let style = option.style ? option.style.replace(/\"/g, '"') : '';\n let styleAttr = style ? `style=\"${style}\"` : '';\n let value = option.value.replace(/\"/g, '"');\n optionsStr += ``;\n });\n\n const inputH = this.el.querySelector(`#${pfx}input-holder`);\n inputH.innerHTML = ``;\n this.input = inputH.firstChild;\n }\n }\n});\n","import PropertyView from './PropertyView';\n\nexport default PropertyView.extend({\n templateInput() {\n const pfx = this.pfx;\n const ppfx = this.ppfx;\n return `\n
\n
\n `;\n },\n\n onRender() {\n const pfx = this.pfx;\n const ppfx = this.ppfx;\n const itemCls = `${ppfx}radio-item-label`;\n const model = this.model;\n const prop = model.get('property');\n const options = model.get('list') || model.get('options') || [];\n const { cid } = model;\n const clsInput = `${pfx}radio ${pfx}radio-${prop}`;\n\n if (!this.input) {\n if (options && options.length) {\n let inputStr = '';\n\n options.forEach(el => {\n let cl = el.className ? `${el.className} ${pfx}icon ${itemCls}` : '';\n let id = `${prop}-${el.value}-${cid}`;\n let labelTxt = el.name || el.value;\n let titleAttr = el.title ? `title=\"${el.title}\"` : '';\n inputStr += `\n
\n \n \n
\n `;\n });\n\n const inputHld = this.el.querySelector(`.${ppfx}field`);\n inputHld.innerHTML = `
${inputStr}
`;\n this.input = inputHld.firstChild;\n }\n }\n },\n\n getInputValue() {\n const inputChk = this.getCheckedEl();\n return inputChk ? inputChk.value : '';\n },\n\n getCheckedEl() {\n const input = this.getInputEl();\n return input ? input.querySelector('input:checked') : '';\n },\n\n setValue(value) {\n const model = this.model;\n let val = value || model.get('value') || model.getDefaultValue();\n const input = this.getInputEl();\n const inputIn = input ? input.querySelector(`[value=\"${val}\"]`) : '';\n\n if (inputIn) {\n inputIn.checked = true;\n } else {\n const inputChk = this.getCheckedEl();\n inputChk && (inputChk.checked = false);\n }\n }\n});\n","import { isUndefined } from 'underscore';\nimport Property from './Property';\nimport InputNumber from 'domain_abstract/ui/InputNumber';\nimport { hasWin } from 'utils/mixins';\n\nexport default Property.extend({\n defaults: {\n ...Property.prototype.defaults,\n // Array of units, eg. ['px', '%']\n units: [],\n\n // Selected unit, eg. 'px'\n unit: '',\n\n // Integer value steps\n step: 1,\n\n // Minimum value\n min: '',\n\n // Maximum value\n max: ''\n },\n\n /**\n * Get property units.\n * @returns {Array}\n */\n getUnits() {\n return this.get('units') || [];\n },\n\n /**\n * Get property unit value.\n * @returns {String}\n */\n getValueUnit() {\n return this.get('unit');\n },\n\n initialize(props = {}, opts = {}) {\n Property.callParentInit(Property, this, props, opts);\n const unit = this.get('unit');\n const units = this.get('units');\n this.input = hasWin() && new InputNumber({ model: this });\n\n if (units.length && !unit) {\n this.set('unit', units[0]);\n }\n Property.callInit(this, props, opts);\n },\n\n clearValue(opts = {}) {\n this.set({ value: undefined, unit: undefined }, opts);\n return this;\n },\n\n parseValue(val) {\n const parsed = Property.prototype.parseValue.apply(this, arguments);\n const { value, unit } = this.input.validateInputValue(parsed.value, {\n deepCheck: 1\n });\n parsed.value = value;\n parsed.unit = unit;\n return parsed;\n },\n\n getFullValue() {\n let value = this.get('value');\n let unit = this.get('unit');\n value = !isUndefined(value) ? value : '';\n unit = !isUndefined(unit) && value ? unit : '';\n value = `${value}${unit}`;\n return Property.prototype.getFullValue.apply(this, [value]);\n }\n});\n","import Property from './PropertyInteger';\n\nexport default Property.extend({\n defaults: {\n ...Property.prototype.defaults,\n showInput: 1\n }\n});\n","import Property from './PropertyIntegerView';\n\nexport default Property.extend({\n events() {\n return {\n ...Property.prototype.events,\n 'change [type=range]': 'inputValueChanged',\n 'input [type=range]': 'inputValueChangedSoft',\n change: ''\n };\n },\n\n templateInput(model) {\n const ppfx = this.ppfx;\n return `\n
\n \n
\n `;\n },\n\n getSliderEl() {\n if (!this.slider) {\n this.slider = this.el.querySelector('input[type=range]');\n }\n\n return this.slider;\n },\n\n inputValueChanged() {\n const model = this.model;\n const step = model.get('step');\n this.getInputEl().value = this.getSliderEl().value;\n const value = this.getInputValue() - step;\n model.set('value', value, { avoidStore: 1 }).set('value', value + step);\n this.elementUpdated();\n },\n\n inputValueChangedSoft() {\n this.getInputEl().value = this.getSliderEl().value;\n this.model.set('value', this.getInputValue(), { avoidStore: 1 });\n this.elementUpdated();\n },\n\n setValue(value) {\n const parsed = this.model.parseValue(value);\n this.getSliderEl().value = parseFloat(parsed.value);\n Property.prototype.setValue.apply(this, arguments);\n },\n\n onRender() {\n Property.prototype.onRender.apply(this, arguments);\n\n if (!this.model.get('showInput')) {\n this.inputInst.el.style.display = 'none';\n }\n },\n\n clearCached() {\n Property.prototype.clearCached.apply(this, arguments);\n this.slider = null;\n }\n});\n","import Backbone from 'backbone';\nimport TypeableCollection from 'domain_abstract/model/TypeableCollection';\nimport Property from './Property';\nimport PropertyStack from './PropertyStack';\nimport PropertyStackView from './../view/PropertyStackView';\nimport PropertyComposite from './PropertyComposite';\nimport PropertyCompositeView from './../view/PropertyCompositeView';\nimport PropertyFileView from './../view/PropertyFileView';\nimport PropertyColorView from './../view/PropertyColorView';\nimport PropertySelect from './PropertySelect';\nimport PropertySelectView from './../view/PropertySelectView';\nimport PropertyRadio from './PropertyRadio';\nimport PropertyRadioView from './../view/PropertyRadioView';\nimport PropertySlider from './PropertySlider';\nimport PropertySliderView from './../view/PropertySliderView';\nimport PropertyInteger from './PropertyInteger';\nimport PropertyIntegerView from './../view/PropertyIntegerView';\nimport PropertyView from './../view/PropertyView';\n\nexport default Backbone.Collection.extend(TypeableCollection).extend({\n extendViewApi: 1,\n\n types: [\n {\n id: 'stack',\n model: PropertyStack,\n view: PropertyStackView,\n isType(value) {\n if (value && value.type == 'stack') {\n return value;\n }\n }\n },\n {\n id: 'composite',\n model: PropertyComposite,\n view: PropertyCompositeView,\n isType(value) {\n if (value && value.type == 'composite') {\n return value;\n }\n }\n },\n {\n id: 'file',\n model: Property,\n view: PropertyFileView,\n isType(value) {\n if (value && value.type == 'file') {\n return value;\n }\n }\n },\n {\n id: 'color',\n model: Property,\n view: PropertyColorView,\n isType(value) {\n if (value && value.type == 'color') {\n return value;\n }\n }\n },\n {\n id: 'select',\n model: PropertySelect,\n view: PropertySelectView,\n isType(value) {\n if (value && value.type == 'select') {\n return value;\n }\n }\n },\n {\n id: 'radio',\n model: PropertyRadio,\n view: PropertyRadioView,\n isType(value) {\n if (value && value.type == 'radio') {\n return value;\n }\n }\n },\n {\n id: 'slider',\n model: PropertySlider,\n view: PropertySliderView,\n isType(value) {\n if (value && value.type == 'slider') {\n return value;\n }\n }\n },\n {\n id: 'integer',\n model: PropertyInteger,\n view: PropertyIntegerView,\n isType(value) {\n if (value && value.type == 'integer') {\n return value;\n }\n }\n },\n {\n id: 'base',\n model: Property,\n view: PropertyView,\n isType(value) {\n value.type = 'base';\n return value;\n }\n }\n ],\n\n deepClone() {\n const collection = this.clone();\n collection.reset(\n collection.map(model => {\n const cloned = model.clone();\n cloned.typeView = model.typeView;\n return cloned;\n })\n );\n return collection;\n },\n\n /**\n * Parse a value and return an array splitted by properties\n * @param {string} value\n * @return {Array}\n * @return\n */\n parseValue(value) {\n const properties = [];\n const values = value.split(' ');\n values.forEach((value, i) => {\n const property = this.at(i);\n if (!property) return;\n properties.push({ ...property.attributes, ...{ value } });\n });\n return properties;\n },\n\n getFullValue() {\n let result = '';\n this.each(model => (result += `${model.getFullValue()} `));\n return result.trim();\n }\n});\n","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","import Backbone from 'backbone';\nconst $ = Backbone.$;\n\nexport default {\n /**\n * Start select position event\n * @param {HTMLElement} trg\n * @private\n * */\n startSelectPosition(trg, doc, opts = {}) {\n this.isPointed = false;\n var utils = this.editorModel.get('Utils');\n const container = trg.ownerDocument.body;\n\n if (utils && !this.sorter)\n this.sorter = new utils.Sorter({\n container,\n placer: this.canvas.getPlacerEl(),\n containerSel: '*',\n itemSel: '*',\n pfx: this.ppfx,\n direction: 'a',\n document: doc,\n wmargin: 1,\n nested: 1,\n em: this.editorModel,\n canvasRelative: 1,\n scale: () => this.em.getZoomDecimal()\n });\n\n if (opts.onStart) this.sorter.onStart = opts.onStart;\n trg && this.sorter.startSort(trg, { container });\n },\n\n /**\n * Get frame position\n * @return {Object}\n * @private\n */\n getOffsetDim() {\n var frameOff = this.offset(this.canvas.getFrameEl());\n var canvasOff = this.offset(this.canvas.getElement());\n var top = frameOff.top - canvasOff.top;\n var left = frameOff.left - canvasOff.left;\n return { top, left };\n },\n\n /**\n * Stop select position event\n * @private\n * */\n stopSelectPosition() {\n this.posTargetCollection = null;\n this.posIndex =\n this.posMethod == 'after' && this.cDim.length !== 0\n ? this.posIndex + 1\n : this.posIndex; //Normalize\n if (this.sorter) {\n this.sorter.moved = 0;\n this.sorter.endMove();\n }\n if (this.cDim) {\n this.posIsLastEl =\n this.cDim.length !== 0 &&\n this.posMethod == 'after' &&\n this.posIndex == this.cDim.length;\n this.posTargetEl =\n this.cDim.length === 0\n ? $(this.outsideElem)\n : !this.posIsLastEl && this.cDim[this.posIndex]\n ? $(this.cDim[this.posIndex][5]).parent()\n : $(this.outsideElem);\n this.posTargetModel = this.posTargetEl.data('model');\n this.posTargetCollection = this.posTargetEl.data('model-comp');\n }\n },\n\n /**\n * Enabel select position\n * @private\n */\n enable() {\n this.startSelectPosition();\n },\n\n /**\n * Check if the pointer is near to the float component\n * @param {number} index\n * @param {string} method\n * @param {Array} dims\n * @return {Boolean}\n * @private\n * */\n nearFloat(index, method, dims) {\n var i = index || 0;\n var m = method || 'before';\n var len = dims.length;\n var isLast = len !== 0 && m == 'after' && i == len;\n if (\n len !== 0 &&\n ((!isLast && !dims[i][4]) ||\n (dims[i - 1] && !dims[i - 1][4]) ||\n (isLast && !dims[i - 1][4]))\n )\n return 1;\n return 0;\n },\n\n run() {\n this.enable();\n },\n\n stop() {\n this.stopSelectPosition();\n this.$wrapper.css('cursor', '');\n this.$wrapper.unbind();\n }\n};\n","import Promise from 'promise-polyfill';\nimport { hasWin } from 'utils/mixins';\n\nif (hasWin()) {\n window.Promise = window.Promise || Promise;\n}\n\nexport default typeof fetch == 'function'\n ? fetch.bind()\n : (url, options) => {\n return new Promise((res, rej) => {\n const req = new XMLHttpRequest();\n req.open(options.method || 'get', url);\n req.withCredentials = options.credentials == 'include';\n\n for (let k in options.headers || {}) {\n req.setRequestHeader(k, options.headers[k]);\n }\n\n req.onload = e =>\n res({\n status: req.status,\n statusText: req.statusText,\n text: () => Promise.resolve(req.responseText)\n });\n req.onerror = rej;\n\n // Actually, fetch doesn't support onProgress feature\n if (req.upload && options.onProgress) {\n req.upload.onprogress = options.onProgress;\n }\n\n // Include body only if present\n options.body ? req.send(options.body) : req.send();\n });\n };\n","import { isFunction } from 'underscore';\nimport Backbone from 'backbone';\n\nconst Model = Backbone.Model;\nconst View = Backbone.View;\n\nexport default {\n types: [],\n\n initialize(models, opts) {\n this.model = (attrs = {}, options = {}) => {\n let Model, View, type;\n\n if (attrs && attrs.type) {\n const baseType = this.getBaseType();\n type = this.getType(attrs.type);\n Model = type ? type.model : baseType.model;\n View = type ? type.view : baseType.view;\n } else {\n const typeFound = this.recognizeType(attrs);\n type = typeFound.type;\n Model = type.model;\n View = type.view;\n attrs = typeFound.attributes;\n }\n\n const model = new Model(attrs, options);\n model.typeView = View;\n return model;\n };\n const init = this.init && this.init.bind(this);\n init && init();\n },\n\n /**\n * Recognize type by any value\n * @param {mixed} value\n * @return {Object} Found type\n */\n recognizeType(value) {\n const types = this.getTypes();\n\n for (let i = 0; i < types.length; i++) {\n const type = types[i];\n let typeFound = type.isType(value);\n typeFound =\n typeof typeFound == 'boolean' && typeFound\n ? { type: type.id }\n : typeFound;\n\n if (typeFound) {\n return {\n type,\n attributes: typeFound\n };\n }\n }\n\n // If, for any reason, the type is not found it'll return the base one\n return {\n type: this.getBaseType(),\n attributes: value\n };\n },\n\n /**\n * Returns the base type (last object in the stack)\n * @return {Object}\n */\n getBaseType() {\n const types = this.getTypes();\n return types[types.length - 1];\n },\n\n /**\n * Get types\n * @return {Array}\n */\n getTypes() {\n return this.types;\n },\n\n /**\n * Get type\n * @param {string} id Type ID\n * @return {Object} Type definition\n */\n getType(id) {\n const types = this.getTypes();\n\n for (let i = 0; i < types.length; i++) {\n const type = types[i];\n if (type.id === id) {\n return type;\n }\n }\n },\n\n /**\n * Add new type\n * @param {string} id Type ID\n * @param {Object} definition Definition of the type. Each definition contains\n * `model` (business logic), `view` (presentation logic)\n * and `isType` function which recognize the type of the\n * passed entity\n * addType('my-type', {\n * model: {},\n * view: {},\n * isType: (value) => {},\n * })\n */\n addType(id, definition) {\n const type = this.getType(id);\n const baseType = this.getBaseType();\n const ModelInst = type ? type.model : baseType.model;\n const ViewInst = type ? type.view : baseType.view;\n let { model, view, isType } = definition;\n model =\n model instanceof Model || isFunction(model)\n ? model\n : ModelInst.extend(model || {});\n view =\n view instanceof View || isFunction(view)\n ? view\n : ViewInst.extend(view || {});\n\n // New API\n if (this.extendViewApi && !definition.model && !definition.view) {\n view = view.extend(definition);\n }\n\n if (type) {\n type.model = model;\n type.view = view;\n type.isType = isType || type.isType;\n } else {\n definition.id = id;\n definition.model = model;\n definition.view = view;\n definition.isType =\n isType ||\n function(value) {\n if (value && value.type == id) {\n return true;\n }\n };\n this.getTypes().unshift(definition);\n }\n }\n};\n","import Backbone from 'backbone';\nimport { bindAll, isUndefined, each } from 'underscore';\n\nconst maxValue = Number.MAX_VALUE;\n\nexport default Backbone.Model.extend({\n initialize() {\n bindAll(this, 'sortRules');\n this.compCls = [];\n this.ids = [];\n },\n\n /**\n * Get CSS from a component\n * @param {Model} model\n * @return {String}\n */\n buildFromModel(model, opts = {}) {\n let code = '';\n const em = this.em;\n const avoidInline = em && em.getConfig('avoidInlineStyle');\n const style = model.styleToString();\n const classes = model.get('classes');\n const wrapperIsBody = opts.wrapperIsBody;\n const isWrapper = model.get('wrapper');\n this.ids.push(`#${model.getId()}`);\n\n // Let's know what classes I've found\n classes.each(model => this.compCls.push(model.getFullName()));\n\n if (!avoidInline && style) {\n let selector = `#${model.getId()}`;\n selector = wrapperIsBody && isWrapper ? 'body' : selector;\n code = `${selector}{${style}}`;\n }\n\n const components = model.components();\n components.each(model => (code += this.buildFromModel(model, opts)));\n return code;\n },\n\n build(model, opts = {}) {\n const { json } = opts;\n const em = opts.em || '';\n const cssc = opts.cssc || (em && em.get('CssComposer'));\n this.em = em;\n this.compCls = [];\n this.ids = [];\n this.model = model;\n const codeJson = [];\n let code = model ? this.buildFromModel(model, opts) : '';\n const clearStyles =\n isUndefined(opts.clearStyles) && em\n ? em.getConfig('clearStyles')\n : opts.clearStyles;\n\n if (cssc) {\n const rules = opts.rules || cssc.getAll();\n const atRules = {};\n const dump = [];\n\n rules.forEach(rule => {\n const atRule = rule.getAtRule();\n\n if (atRule) {\n const mRules = atRules[atRule];\n if (mRules) {\n mRules.push(rule);\n } else {\n atRules[atRule] = [rule];\n }\n return;\n }\n\n const res = this.buildFromRule(rule, dump, opts);\n\n if (json) {\n codeJson.push(res);\n } else {\n code += res;\n }\n });\n\n this.sortMediaObject(atRules).forEach(item => {\n let rulesStr = '';\n const atRule = item.key;\n const mRules = item.value;\n\n mRules.forEach(rule => {\n const ruleStr = this.buildFromRule(rule, dump, opts);\n\n if (rule.get('singleAtRule')) {\n code += `${atRule}{${ruleStr}}`;\n } else {\n rulesStr += ruleStr;\n }\n\n json && codeJson.push(ruleStr);\n });\n\n if (rulesStr) {\n code += `${atRule}{${rulesStr}}`;\n }\n });\n\n em && clearStyles && rules.remove && rules.remove(dump);\n }\n\n return json ? codeJson.filter(r => r) : code;\n },\n\n /**\n * Get CSS from the rule model\n * @param {Model} rule\n * @return {string} CSS string\n */\n buildFromRule(rule, dump, opts = {}) {\n let result = '';\n const { model } = this;\n const selectorStrNoAdd = rule.selectorsToString({ skipAdd: 1 });\n const selectorsAdd = rule.get('selectorsAdd');\n const singleAtRule = rule.get('singleAtRule');\n let found;\n\n // This will not render a rule if there is no its component\n rule.get('selectors').each(selector => {\n const name = selector.getFullName();\n if (\n this.compCls.indexOf(name) >= 0 ||\n this.ids.indexOf(name) >= 0 ||\n opts.keepUnusedStyles\n ) {\n found = 1;\n }\n });\n\n if ((selectorStrNoAdd && found) || selectorsAdd || singleAtRule || !model) {\n const block = rule.getDeclaration({ body: 1 });\n block && (opts.json ? (result = rule) : (result += block));\n } else {\n dump.push(rule);\n }\n\n return result;\n },\n\n /**\n * Get the numeric length of the media query string\n * @param {String} mediaQuery Media query string\n * @return {Number}\n */\n getQueryLength(mediaQuery) {\n const length = /(-?\\d*\\.?\\d+)\\w{0,}/.exec(mediaQuery);\n if (!length) return maxValue;\n\n return parseFloat(length[1]);\n },\n\n /**\n * Return a sorted array from media query object\n * @param {Object} items\n * @return {Array}\n */\n sortMediaObject(items = {}) {\n const itemsArr = [];\n each(items, (value, key) => itemsArr.push({ key, value }));\n return itemsArr.sort((a, b) => {\n const isMobFirst = [a.key, b.key].every(\n mquery => mquery.indexOf('min-width') !== -1\n );\n const left = isMobFirst ? a.key : b.key;\n const right = isMobFirst ? b.key : a.key;\n return this.getQueryLength(left) - this.getQueryLength(right);\n });\n },\n\n sortRules(a, b) {\n const getKey = rule => rule.get('mediaText');\n const isMobFirst = [getKey(a), getKey(b)].every(\n q => q.indexOf('min-width') !== -1\n );\n const left = isMobFirst ? getKey(a) : getKey(b);\n const right = isMobFirst ? getKey(b) : getKey(a);\n return this.getQueryLength(left) - this.getQueryLength(right);\n }\n});\n","import Backbone from 'backbone';\nimport { bindAll, isUndefined, indexOf } from 'underscore';\nimport { on, off } from 'utils/mixins';\nimport Input from './Input';\n\nconst $ = Backbone.$;\n\nexport default Input.extend({\n events: {\n 'change input': 'handleChange',\n 'change select': 'handleUnitChange',\n 'click [data-arrow-up]': 'upArrowClick',\n 'click [data-arrow-down]': 'downArrowClick',\n 'mousedown [data-arrows]': 'downIncrement',\n keydown: 'handleKeyDown'\n },\n\n template() {\n const ppfx = this.ppfx;\n return `\n \n \n
\n
\n
\n
\n `;\n },\n\n inputClass() {\n const ppfx = this.ppfx;\n return this.opts.contClass || `${ppfx}field ${ppfx}field-integer`;\n },\n\n initialize(opts = {}) {\n Input.prototype.initialize.apply(this, arguments);\n bindAll(this, 'moveIncrement', 'upIncrement');\n this.doc = document;\n this.listenTo(this.model, 'change:unit', this.handleModelChange);\n },\n\n /**\n * Set value to the model\n * @param {string} value\n * @param {Object} opts\n */\n setValue(value, opts) {\n var opt = opts || {};\n var valid = this.validateInputValue(value, { deepCheck: 1 });\n var validObj = { value: valid.value };\n\n // If found some unit value\n if (valid.unit || valid.force) {\n validObj.unit = valid.unit;\n }\n\n this.model.set(validObj, opt);\n\n // Generally I get silent when I need to reflect data to view without\n // reupdating the target\n if (opt.silent) {\n this.handleModelChange();\n }\n },\n\n /**\n * Handled when the view is changed\n */\n handleChange(e) {\n e.stopPropagation();\n this.setValue(this.getInputEl().value);\n this.elementUpdated();\n },\n\n /**\n * Handled when the view is changed\n */\n handleUnitChange(e) {\n e.stopPropagation();\n var value = this.getUnitEl().value;\n this.model.set('unit', value);\n this.elementUpdated();\n },\n\n /**\n * Handled when user uses keyboard\n */\n handleKeyDown(e) {\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n this.upArrowClick();\n }\n\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n this.downArrowClick();\n }\n },\n\n /**\n * Fired when the element of the property is updated\n */\n elementUpdated() {\n this.model.trigger('el:change');\n },\n\n /**\n * Updates the view when the model is changed\n * */\n handleModelChange() {\n const model = this.model;\n this.getInputEl().value = model.get('value');\n const unitEl = this.getUnitEl();\n unitEl && (unitEl.value = model.get('unit') || '');\n },\n\n /**\n * Get the unit element\n * @return {HTMLElement}\n */\n getUnitEl() {\n if (!this.unitEl) {\n const model = this.model;\n const units = model.get('units') || [];\n\n if (units.length) {\n const options = [];\n\n units.forEach(unit => {\n const selected = unit == model.get('unit') ? 'selected' : '';\n options.push(``);\n });\n\n const temp = document.createElement('div');\n temp.innerHTML = ``;\n this.unitEl = temp.firstChild;\n }\n }\n\n return this.unitEl;\n },\n\n /**\n * Invoked when the up arrow is clicked\n * */\n upArrowClick() {\n const model = this.model;\n const step = model.get('step');\n let value = parseFloat(model.get('value'));\n value = this.normalizeValue(value + step);\n var valid = this.validateInputValue(value);\n model.set('value', valid.value);\n this.elementUpdated();\n },\n\n /**\n * Invoked when the down arrow is clicked\n * */\n downArrowClick() {\n const model = this.model;\n const step = model.get('step');\n const value = parseFloat(model.get('value'));\n const val = this.normalizeValue(value - step);\n var valid = this.validateInputValue(val);\n model.set('value', valid.value);\n this.elementUpdated();\n },\n\n /**\n * Change easily integer input value with click&drag method\n * @param Event\n *\n * @return void\n * */\n downIncrement(e) {\n e.preventDefault();\n this.moved = 0;\n var value = this.model.get('value');\n value = this.normalizeValue(value);\n this.current = { y: e.pageY, val: value };\n on(this.doc, 'mousemove', this.moveIncrement);\n on(this.doc, 'mouseup', this.upIncrement);\n },\n\n /** While the increment is clicked, moving the mouse will update input value\n * @param Object\n *\n * @return bool\n * */\n moveIncrement(ev) {\n this.moved = 1;\n const model = this.model;\n const step = model.get('step');\n const data = this.current;\n var pos = this.normalizeValue(data.val + (data.y - ev.pageY) * step);\n this.prValue = this.validateInputValue(pos).value;\n model.set('value', this.prValue, { avoidStore: 1 });\n return false;\n },\n\n /**\n * Stop moveIncrement method\n * */\n upIncrement() {\n const model = this.model;\n const step = model.get('step');\n off(this.doc, 'mouseup', this.upIncrement);\n off(this.doc, 'mousemove', this.moveIncrement);\n\n if (this.prValue && this.moved) {\n var value = this.prValue - step;\n model.set('value', value, { avoidStore: 1 }).set('value', value + step);\n this.elementUpdated();\n }\n },\n\n normalizeValue(value, defValue = 0) {\n const model = this.model;\n const step = model.get('step');\n let stepDecimals = 0;\n\n if (isNaN(value)) {\n return defValue;\n }\n\n value = parseFloat(value);\n\n if (Math.floor(value) !== value) {\n const side = step.toString().split('.')[1];\n stepDecimals = side ? side.length : 0;\n }\n\n return stepDecimals ? parseFloat(value.toFixed(stepDecimals)) : value;\n },\n\n /**\n * Validate input value\n * @param {String} value Raw value\n * @param {Object} opts Options\n * @return {Object} Validated string\n */\n validateInputValue(value, opts) {\n var force = 0;\n var opt = opts || {};\n var model = this.model;\n const defValue = ''; //model.get('defaults');\n var val = !isUndefined(value) ? value : defValue;\n var units = model.get('units') || [];\n var unit = model.get('unit') || (units.length && units[0]) || '';\n var max = model.get('max');\n var min = model.get('min');\n var limitlessMax = !!model.get('limitlessMax');\n var limitlessMin = !!model.get('limitlessMin');\n\n if (opt.deepCheck) {\n var fixed = model.get('fixedValues') || [];\n\n if (val) {\n // If the value is one of the fixed values I leave it as it is\n var regFixed = new RegExp('^' + fixed.join('|'), 'g');\n if (fixed.length && regFixed.test(val)) {\n val = val.match(regFixed)[0];\n unit = '';\n force = 1;\n } else {\n var valCopy = val + '';\n val += ''; // Make it suitable for replace\n val = parseFloat(val.replace(',', '.'));\n val = !isNaN(val) ? val : defValue;\n var uN = valCopy.replace(val, '');\n // Check if exists as unit\n if (indexOf(units, uN) >= 0) unit = uN;\n }\n }\n }\n\n if (!limitlessMax && !isUndefined(max) && max !== '')\n val = val > max ? max : val;\n if (!limitlessMin && !isUndefined(min) && min !== '')\n val = val < min ? min : val;\n\n return {\n force,\n value: val,\n unit\n };\n },\n\n render() {\n Input.prototype.render.call(this);\n this.unitEl = null;\n const unit = this.getUnitEl();\n unit &&\n this.$el\n .find(`.${this.ppfx}field-units`)\n .get(0)\n .appendChild(unit);\n return this;\n }\n});\n","var arrayWithHoles = require(\"./arrayWithHoles.js\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit.js\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\n\nvar nonIterableRest = require(\"./nonIterableRest.js\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","import Backbone from 'backbone';\nimport { isUndefined } from 'underscore';\n\nexport default Backbone.View.extend({\n initialize(o) {\n this.opts = o || {};\n this.config = o.config || {};\n this.em = this.config.em;\n const coll = this.collection;\n this.listenTo(coll, 'add', this.addTo);\n this.listenTo(coll, 'reset', this.resetChildren);\n this.listenTo(coll, 'remove', this.removeChildren);\n },\n\n removeChildren(removed, coll, opts = {}) {\n removed.views.forEach(view => {\n if (!view) return;\n const { childrenView, scriptContainer } = view;\n childrenView && childrenView.stopListening();\n scriptContainer && scriptContainer.remove();\n view.remove.apply(view);\n });\n\n const inner = removed.components();\n inner.forEach(it => this.removeChildren(it, coll, opts));\n },\n\n /**\n * Add to collection\n * @param {Model} model\n * @param {Collection} coll\n * @param {Object} opts\n * @private\n * */\n addTo(model, coll = {}, opts = {}) {\n const em = this.config.em;\n const i = this.collection.indexOf(model);\n this.addToCollection(model, null, i);\n\n if (em && !opts.temporary) {\n const triggerAdd = model => {\n em.trigger('component:add', model);\n model.components().forEach(comp => triggerAdd(comp));\n };\n triggerAdd(model);\n }\n },\n\n /**\n * Add new object to collection\n * @param {Object} Model\n * @param {Object} Fragment collection\n * @param {Integer} Index of append\n *\n * @return {Object} Object rendered\n * @private\n * */\n addToCollection(model, fragmentEl, index) {\n if (!this.compView) this.compView = require('./ComponentView').default;\n const { config, opts, em } = this;\n const fragment = fragmentEl || null;\n const { frameView = {} } = config;\n const sameFrameView = frameView.model && model.getView(frameView.model);\n const dt =\n opts.componentTypes || (em && em.get('DomComponents').getTypes());\n const type = model.get('type') || 'default';\n let viewObject = this.compView;\n\n for (let it = 0; it < dt.length; it++) {\n if (dt[it].id == type) {\n viewObject = dt[it].view;\n break;\n }\n }\n const view =\n sameFrameView ||\n new viewObject({\n model,\n config,\n componentTypes: dt\n });\n let rendered;\n\n try {\n // Avoid breaking on DOM rendering (eg. invalid attribute name)\n rendered = view.render().el;\n } catch (error) {\n rendered = document.createTextNode('');\n em.logError(error);\n }\n\n if (fragment) {\n fragment.appendChild(rendered);\n } else {\n const parent = this.parentEl;\n const children = parent.childNodes;\n\n if (!isUndefined(index)) {\n const lastIndex = children.length == index;\n\n // If the added model is the last of collection\n // need to change the logic of append\n if (lastIndex) {\n index--;\n }\n\n // In case the added is new in the collection index will be -1\n if (lastIndex || !children.length) {\n parent.appendChild(rendered);\n } else {\n parent.insertBefore(rendered, children[index]);\n }\n } else {\n parent.appendChild(rendered);\n }\n }\n\n return rendered;\n },\n\n resetChildren(models, { previousModels = [] } = {}) {\n this.parentEl.innerHTML = '';\n previousModels.forEach(md => this.removeChildren(md, this.collection));\n models.each(model => this.addToCollection(model));\n },\n\n render(parent) {\n const el = this.el;\n const frag = document.createDocumentFragment();\n this.parentEl = parent || this.el;\n this.collection.each(model => this.addToCollection(model, frag));\n el.innerHTML = '';\n el.appendChild(frag);\n return this;\n }\n});\n","import Backbone from 'backbone';\n\nexport default Backbone.View.extend({\n tagName: 'style',\n\n initialize(o = {}) {\n this.config = o.config || {};\n const { model } = this;\n this.listenTo(model, 'change', this.render);\n this.listenTo(model, 'destroy remove', this.remove);\n this.listenTo(model.get('selectors'), 'change', this.render);\n },\n\n render() {\n const { model, el } = this;\n const important = model.get('important');\n el.innerHTML = model.toCSS({ important });\n return this;\n }\n});\n","import CssRuleView from './CssRuleView';\n\nexport default CssRuleView.extend({\n _createElement: function(tagName) {\n return document.createTextNode('');\n },\n\n render() {\n const model = this.model;\n const important = model.get('important');\n this.el.textContent = model.getDeclaration({ important });\n return this;\n }\n});\n","import Backbone from 'backbone';\nimport CssRuleView from './CssRuleView';\nimport CssGroupRuleView from './CssGroupRuleView';\n\nconst $ = Backbone.$;\n\nconst getBlockId = (pfx, order) =>\n `${pfx}${order ? `-${parseFloat(order)}` : ''}`;\n\nexport default Backbone.View.extend({\n initialize(o) {\n const config = o.config || {};\n this.atRules = {};\n this.config = config;\n this.em = config.em;\n this.pfx = config.stylePrefix || '';\n this.className = this.pfx + 'rules';\n const coll = this.collection;\n this.listenTo(coll, 'add', this.addTo);\n this.listenTo(coll, 'reset', this.render);\n },\n\n /**\n * Add to collection\n * @param {Object} model\n * @private\n * */\n addTo(model) {\n this.addToCollection(model);\n },\n\n /**\n * Add new object to collection\n * @param {Object} model\n * @param {Object} fragmentEl\n * @return {Object}\n * @private\n * */\n addToCollection(model, fragmentEl) {\n // If the render is not yet started\n if (!this.renderStarted) {\n return;\n }\n\n const fragment = fragmentEl || null;\n const { config } = this;\n const opts = { model, config };\n let rendered, view;\n\n // I have to render keyframes of the same name together\n // Unfortunately at the moment I didn't find the way of appending them\n // if not staticly, via appendData\n if (model.get('atRuleType') === 'keyframes') {\n const atRule = model.getAtRule();\n let atRuleEl = this.atRules[atRule];\n\n if (!atRuleEl) {\n const styleEl = document.createElement('style');\n atRuleEl = document.createTextNode('');\n styleEl.appendChild(document.createTextNode(`${atRule}{`));\n styleEl.appendChild(atRuleEl);\n styleEl.appendChild(document.createTextNode(`}`));\n this.atRules[atRule] = atRuleEl;\n rendered = styleEl;\n }\n\n view = new CssGroupRuleView(opts);\n atRuleEl.appendData(view.render().el.textContent);\n } else {\n view = new CssRuleView(opts);\n rendered = view.render().el;\n }\n\n const clsName = this.className;\n const mediaText = model.get('mediaText');\n const defaultBlockId = getBlockId(clsName);\n let blockId = defaultBlockId;\n\n // If the rule contains a media query it might have a different container\n // for it (eg. rules created with Device Manager)\n if (mediaText) {\n blockId = getBlockId(clsName, this.getMediaWidth(mediaText));\n }\n\n if (rendered) {\n const container = fragment || this.el;\n let contRules;\n\n // Try to find a specific container for the rule (if it\n // containes a media query), otherwise get the default one\n try {\n contRules = container.querySelector(`#${blockId}`);\n } catch (e) {}\n\n if (!contRules) {\n contRules = container.querySelector(`#${defaultBlockId}`);\n }\n\n contRules.appendChild(rendered);\n }\n\n return rendered;\n },\n\n getMediaWidth(mediaText) {\n return (\n mediaText &&\n mediaText\n .replace(`(${this.em.getConfig('mediaCondition')}: `, '')\n .replace(')', '')\n );\n },\n\n render() {\n this.renderStarted = 1;\n this.atRules = {};\n const { em, $el, className, collection } = this;\n const frag = document.createDocumentFragment();\n $el.empty();\n\n // Create devices related DOM structure, ensure also to have a default container\n const prs = em\n .get('DeviceManager')\n .getAll()\n .pluck('priority');\n prs.every(pr => pr) && prs.unshift(0);\n prs.forEach(pr =>\n $(`
`).appendTo(frag)\n );\n\n collection.each(model => this.addToCollection(model, frag));\n $el.append(frag);\n $el.attr('class', className);\n return this;\n }\n});\n","import { each } from 'underscore';\n\nconst htmlType = 'text/html';\nconst defaultType = htmlType; // 'application/xml';\n\nexport default (str, config = {}) => {\n const parser = new DOMParser();\n const mimeType = config.htmlType || defaultType;\n const toHTML = mimeType === htmlType;\n const strF = toHTML ? str : `
${str}
`;\n const doc = parser.parseFromString(strF, mimeType);\n let res;\n\n if (toHTML) {\n // Replicate the old parser in order to avoid breaking changes\n const { head, body } = doc;\n // Move all scripts at the bottom of the page\n const scripts = head.querySelectorAll('script');\n each(scripts, node => body.appendChild(node));\n // Move inside body all head children\n const hEls = [];\n each(head.children, n => hEls.push(n));\n each(hEls, (node, i) => body.insertBefore(node, body.children[i]));\n res = body;\n } else {\n res = doc.firstChild;\n }\n\n return res;\n};\n\n/**\n * POC, custom html parser specs\n * Parse an HTML string to an array of nodes\n * example\n * parse(`
Hello
World example`)\n * // result\n * [\n * {\n * tagName: 'div',\n * attributes: { class: 'mycls', 'data-test': '' },\n * childNodes: ['Hello'],\n * },{\n * tagName: 'span',\n * childNodes: [\n * 'World ',\n * {\n * tagName: 'b',\n * childNodes: ['example'],\n * }\n * ],\n * }\n * ]\n *\n\nexport const parseNodes = nodes => {\n const result = [];\n\n for (let i = 0; i < nodes.length; i++) {\n result.push(parseNode(nodes[i]));\n }\n\n return result;\n};\n\nexport const parseAttributes = attrs => {\n const result = {};\n\n for (let j = 0; j < attrs.length; j++) {\n const attr = attrs[j];\n const nodeName = attr.nodeName;\n const nodeValue = attr.nodeValue;\n result[nodeName] = nodeValue;\n }\n\n return result;\n};\n\nexport const parseNode = el => {\n // Return the string of the textnode element\n if (el.nodeType === 3) {\n return el.nodeValue;\n }\n\n const tagName = node.tagName ? node.tagName.toLowerCase() : '';\n const attrs = el.attributes || [];\n const nodes = el.childNodes || [];\n\n return {\n ...(tagName && { tagName }),\n ...(attrs.length && {\n attributes: parseAttributes(attrs)\n }),\n ...(nodes.length && {\n childNodes: parseNodes(nodes)\n })\n };\n};\n\nexport default (str, config = {}) => {\n const result = [];\n const el = document.createElement('div');\n el.innerHTML = str;\n const nodes = el.childNodes;\n const len = nodes.length;\n\n for (let i = 0; i < len; i++) {\n result.push(parseNode(nodes[i]));\n }\n\n return result;\n};\n */\n","import { each, isString, isFunction } from 'underscore';\nimport BrowserParserHtml from './BrowserParserHtml';\n\nexport default config => {\n let c = config;\n const modelAttrStart = 'data-gjs-';\n const event = 'parse:html';\n\n return {\n compTypes: '',\n\n modelAttrStart,\n\n /**\n * Extract component props from an attribute object\n * @param {Object} attr\n * @returns {Object} An object containing props and attributes without them\n */\n splitPropsFromAttr(attr = {}) {\n const props = {};\n const attrs = {};\n\n each(attr, (value, key) => {\n if (key.indexOf(this.modelAttrStart) === 0) {\n const modelAttr = key.replace(modelAttrStart, '');\n const valueLen = value.length;\n const valStr = value && isString(value);\n const firstChar = valStr && value.substr(0, 1);\n const lastChar = valStr && value.substr(valueLen - 1);\n value = value === 'true' ? true : value;\n value = value === 'false' ? false : value;\n\n // Try to parse JSON where it's possible\n // I can get false positive here (eg. a selector '[data-attr]')\n // so put it under try/catch and let fail silently\n try {\n value =\n (firstChar == '{' && lastChar == '}') ||\n (firstChar == '[' && lastChar == ']')\n ? JSON.parse(value)\n : value;\n } catch (e) {}\n\n props[modelAttr] = value;\n } else {\n attrs[key] = value;\n }\n });\n\n return {\n props,\n attrs\n };\n },\n\n /**\n * Parse style string to object\n * @param {string} str\n * @return {Object}\n * @example\n * var stl = ParserHtml.parseStyle('color:black; width:100px; test:value;');\n * console.log(stl);\n * // {color: 'black', width: '100px', test: 'value'}\n */\n parseStyle(str) {\n var result = {};\n var decls = str.split(';');\n for (var i = 0, len = decls.length; i < len; i++) {\n var decl = decls[i].trim();\n if (!decl) continue;\n var prop = decl.split(':');\n result[prop[0].trim()] = prop\n .slice(1)\n .join(':')\n .trim();\n }\n return result;\n },\n\n /**\n * Parse class string to array\n * @param {string} str\n * @return {Array}\n * @example\n * var res = ParserHtml.parseClass('test1 test2 test3');\n * console.log(res);\n * // ['test1', 'test2', 'test3']\n */\n parseClass(str) {\n const result = [];\n const cls = str.split(' ');\n for (let i = 0, len = cls.length; i < len; i++) {\n const cl = cls[i].trim();\n if (!cl) continue;\n result.push(cl);\n }\n return result;\n },\n\n /**\n * Get data from the node element\n * @param {HTMLElement} el DOM element to traverse\n * @return {Array}\n */\n parseNode(el, opts = {}) {\n const result = [];\n const nodes = el.childNodes;\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n const node = nodes[i];\n const attrs = node.attributes || [];\n const attrsLen = attrs.length;\n const nodePrev = result[result.length - 1];\n const nodeChild = node.childNodes.length;\n const ct = this.compTypes;\n let model = {};\n\n // Start with understanding what kind of component it is\n if (ct) {\n let obj = '';\n let type =\n node.getAttribute && node.getAttribute(`${modelAttrStart}type`);\n\n // If the type is already defined, use it\n if (type) {\n model = { type };\n } else {\n // Iterate over all available Component Types and\n // the first with a valid result will be that component\n for (let it = 0; it < ct.length; it++) {\n const compType = ct[it];\n obj = compType.model.isComponent(node, opts);\n\n if (obj) {\n if (typeof obj !== 'object') {\n obj = { type: compType.id };\n }\n break;\n }\n }\n\n model = obj;\n }\n }\n\n // Set tag name if not yet done\n if (!model.tagName) {\n model.tagName = node.tagName ? node.tagName.toLowerCase() : '';\n }\n\n if (attrsLen) {\n model.attributes = {};\n }\n\n // Parse attributes\n for (let j = 0; j < attrsLen; j++) {\n const nodeName = attrs[j].nodeName;\n let nodeValue = attrs[j].nodeValue;\n\n // Isolate attributes\n if (nodeName == 'style') {\n model.style = this.parseStyle(nodeValue);\n } else if (nodeName == 'class') {\n model.classes = this.parseClass(nodeValue);\n } else if (nodeName == 'contenteditable') {\n continue;\n } else if (nodeName.indexOf(modelAttrStart) === 0) {\n const modelAttr = nodeName.replace(modelAttrStart, '');\n const valueLen = nodeValue.length;\n const firstChar = nodeValue && nodeValue.substr(0, 1);\n const lastChar = nodeValue && nodeValue.substr(valueLen - 1);\n nodeValue = nodeValue === 'true' ? true : nodeValue;\n nodeValue = nodeValue === 'false' ? false : nodeValue;\n\n // Try to parse JSON where it's possible\n // I can get false positive here (eg. a selector '[data-attr]')\n // so put it under try/catch and let fail silently\n try {\n nodeValue =\n (firstChar == '{' && lastChar == '}') ||\n (firstChar == '[' && lastChar == ']')\n ? JSON.parse(nodeValue)\n : nodeValue;\n } catch (e) {}\n\n model[modelAttr] = nodeValue;\n } else {\n // Check for attributes from props (eg. required, disabled)\n if (nodeValue === '' && node[nodeName] === true) {\n nodeValue = true;\n }\n\n model.attributes[nodeName] = nodeValue;\n }\n }\n\n // Check for nested elements but avoid it if already provided\n if (nodeChild && !model.components) {\n // Avoid infinite nested text nodes\n const firstChild = node.childNodes[0];\n\n // If there is only one child and it's a TEXTNODE\n // just make it content of the current node\n if (nodeChild === 1 && firstChild.nodeType === 3) {\n !model.type && (model.type = 'text');\n model.components = {\n type: 'textnode',\n content: firstChild.nodeValue\n };\n } else {\n model.components = this.parseNode(node, {\n ...opts,\n inSvg: opts.inSvg || model.type === 'svg'\n });\n }\n }\n\n // Check if it's a text node and if could be moved to the prevous model\n if (model.type == 'textnode') {\n if (nodePrev && nodePrev.type == 'textnode') {\n nodePrev.content += model.content;\n continue;\n }\n\n // Throw away empty nodes (keep spaces)\n if (!config.keepEmptyTextNodes) {\n const content = node.nodeValue;\n if (content != ' ' && !content.trim()) {\n continue;\n }\n }\n }\n\n // Check for custom void elements (valid in XML)\n if (!nodeChild && `${node.outerHTML}`.slice(-2) === '/>') {\n model.void = true;\n }\n\n // If all children are texts and there is some textnode the parent should\n // be text too otherwise I'm unable to edit texnodes\n const comps = model.components;\n if (!model.type && comps) {\n let allTxt = 1;\n let foundTextNode = 0;\n\n for (let ci = 0; ci < comps.length; ci++) {\n const comp = comps[ci];\n const cType = comp.type;\n\n if (\n ['text', 'textnode'].indexOf(cType) < 0 &&\n c.textTags.indexOf(comp.tagName) < 0\n ) {\n allTxt = 0;\n break;\n }\n\n if (cType == 'textnode') {\n foundTextNode = 1;\n }\n }\n\n if (allTxt && foundTextNode) {\n model.type = 'text';\n }\n }\n\n // If tagName is still empty and is not a textnode, do not push it\n if (!model.tagName && model.type != 'textnode') {\n continue;\n }\n\n result.push(model);\n }\n\n return result;\n },\n\n /**\n * Parse HTML string to a desired model object\n * @param {string} str HTML string\n * @param {ParserCss} parserCss In case there is style tags inside HTML\n * @return {Object}\n */\n parse(str, parserCss, opts = {}) {\n const { em } = c;\n const conf = (em && em.get('Config')) || {};\n const res = { html: null, css: null };\n const cf = { ...config, ...opts };\n const el = isFunction(cf.parserHtml)\n ? cf.parserHtml(str, cf)\n : BrowserParserHtml(str, cf);\n const scripts = el.querySelectorAll('script');\n let i = scripts.length;\n\n // Remove all scripts\n if (!conf.allowScripts) {\n while (i--) scripts[i].parentNode.removeChild(scripts[i]);\n }\n\n // Detach style tags and parse them\n if (parserCss) {\n const styles = el.querySelectorAll('style');\n let j = styles.length;\n let styleStr = '';\n\n while (j--) {\n styleStr = styles[j].innerHTML + styleStr;\n styles[j].parentNode.removeChild(styles[j]);\n }\n\n if (styleStr) res.css = parserCss.parse(styleStr);\n }\n\n em && em.trigger(`${event}:root`, { input: str, root: el });\n const result = this.parseNode(el);\n // I have to keep it otherwise it breaks the DomComponents.addComponent (returns always array)\n const resHtml =\n result.length === 1 && !c.returnArray ? result[0] : result;\n res.html = resHtml;\n em && em.trigger(event, { input: str, output: res });\n\n return res;\n }\n };\n};\n","import Backbone from 'backbone';\nimport { isUndefined } from 'underscore';\nimport ColorPicker from 'utils/ColorPicker';\nimport Input from './Input';\n\nconst { $ } = Backbone;\n$ && ColorPicker($);\n\nconst getColor = color => {\n const name = color.getFormat() === 'name' && color.toName();\n const cl = color.getAlpha() == 1 ? color.toHexString() : color.toRgbString();\n return name || cl.replace(/ /g, '');\n};\n\nexport default Input.extend({\n template() {\n const ppfx = this.ppfx;\n return `\n
\n
\n
\n
\n
\n
\n `;\n },\n\n inputClass() {\n const ppfx = this.ppfx;\n return `${ppfx}field ${ppfx}field-color`;\n },\n\n holderClass() {\n return `${this.ppfx}input-holder`;\n },\n\n remove() {\n Input.prototype.remove.apply(this, arguments);\n this.colorEl.spectrum('destroy');\n },\n\n __onInputChange(val) {\n let value = val;\n const colorEl = this.getColorEl();\n\n // Check the color by using the ColorPicker's parser\n if (colorEl) {\n colorEl.spectrum('set', value);\n const tc = colorEl.spectrum('get');\n const color = value && getColor(tc);\n color && (value = color);\n }\n\n this.model.set({ value }, { fromInput: 1 });\n },\n\n /**\n * Set value to the model\n * @param {string} val\n * @param {Object} opts\n */\n setValue(val, opts = {}) {\n const model = this.model;\n const def = model.get('defaults');\n const value = !isUndefined(val) ? val : !isUndefined(def) ? def : '';\n const inputEl = this.getInputEl();\n const colorEl = this.getColorEl();\n const valueClr = value != 'none' ? value : '';\n inputEl.value = value;\n colorEl.get(0).style.backgroundColor = valueClr;\n\n // This prevents from adding multiple thumbs in spectrum\n if (opts.fromTarget || (opts.fromInput && !opts.avoidStore)) {\n colorEl.spectrum('set', valueClr);\n this.noneColor = value == 'none';\n }\n },\n\n /**\n * Get the color input element\n * @return {HTMLElement}\n */\n getColorEl() {\n if (!this.colorEl) {\n const { em } = this;\n const self = this;\n const ppfx = this.ppfx;\n var model = this.model;\n\n var colorEl = $(`
`);\n var cpStyle = colorEl.get(0).style;\n var elToAppend = em && em.config ? em.config.el : '';\n var colorPickerConfig =\n (em && em.getConfig && em.getConfig('colorPicker')) || {};\n\n let changed = 0;\n let previousColor;\n this.$el.find(`[data-colorp-c]`).append(colorEl);\n colorEl.spectrum({\n color: model.getValue() || false,\n containerClassName: `${ppfx}one-bg ${ppfx}two-color`,\n appendTo: elToAppend || 'body',\n maxSelectionSize: 8,\n showPalette: true,\n showAlpha: true,\n chooseText: 'Ok',\n cancelText: '⨯',\n palette: [],\n\n // config expanded here so that the functions below are not overridden\n ...colorPickerConfig,\n ...(model.get('colorPicker') || {}),\n\n move(color) {\n const cl = getColor(color);\n cpStyle.backgroundColor = cl;\n model.setValueFromInput(cl, 0);\n },\n change(color) {\n changed = 1;\n const cl = getColor(color);\n cpStyle.backgroundColor = cl;\n model.setValueFromInput(0, 0); // for UndoManager\n model.setValueFromInput(cl);\n self.noneColor = 0;\n },\n show(color) {\n changed = 0;\n previousColor = getColor(color);\n },\n hide(color) {\n if (!changed && previousColor) {\n if (self.noneColor) {\n previousColor = '';\n }\n cpStyle.backgroundColor = previousColor;\n colorEl.spectrum('set', previousColor);\n model.setValueFromInput(previousColor, 0);\n }\n }\n });\n\n if (em && em.on) {\n this.listenTo(em, 'component:selected', () => {\n changed = 1;\n colorEl.spectrum('hide');\n });\n }\n\n this.colorEl = colorEl;\n }\n return this.colorEl;\n },\n\n render() {\n Input.prototype.render.call(this);\n // This will make the color input available on render\n this.getColorEl();\n return this;\n }\n});\n","// Without jquery I have to update few stuff\n//\n// Spectrum Colorpicker v1.8.0\n// https://github.com/bgrins/spectrum\n// Author: Brian Grinstead\n// License: MIT\nimport { hasWin } from 'utils/mixins';\n\nexport default function($, undefined) {\n 'use strict';\n if (!hasWin()) return;\n\n var defaultOpts = {\n // Callbacks\n beforeShow: noop,\n move: noop,\n change: noop,\n show: noop,\n hide: noop,\n\n // Options\n color: false,\n flat: false,\n showInput: false,\n allowEmpty: false,\n showButtons: true,\n clickoutFiresChange: true,\n showInitial: false,\n showPalette: false,\n showPaletteOnly: false,\n hideAfterPaletteSelect: false,\n togglePaletteOnly: false,\n showSelectionPalette: true,\n localStorageKey: false,\n appendTo: 'body',\n maxSelectionSize: 7,\n cancelText: 'cancel',\n chooseText: 'choose',\n togglePaletteMoreText: 'more',\n togglePaletteLessText: 'less',\n clearText: 'Clear Color Selection',\n noColorSelectedText: 'No Color Selected',\n preferredFormat: false,\n className: '', // Deprecated - use containerClassName and replacerClassName instead.\n containerClassName: '',\n replacerClassName: '',\n showAlpha: false,\n theme: 'sp-light',\n palette: [\n [\n '#ffffff',\n '#000000',\n '#ff0000',\n '#ff8000',\n '#ffff00',\n '#008000',\n '#0000ff',\n '#4b0082',\n '#9400d3'\n ]\n ],\n selectionPalette: [],\n disabled: false,\n offset: null\n },\n spectrums = [],\n IE = !!/msie/i.exec(window.navigator.userAgent),\n rgbaSupport = (function() {\n function contains(str, substr) {\n return !!~('' + str).indexOf(substr);\n }\n\n var elem = document.createElement('div');\n var style = elem.style;\n style.cssText = 'background-color:rgba(0,0,0,.5)';\n return (\n contains(style.backgroundColor, 'rgba') ||\n contains(style.backgroundColor, 'hsla')\n );\n })(),\n replaceInput = [\n \"
\",\n \"
\",\n \"
▼
\",\n '
'\n ].join(''),\n markup = (function() {\n // IE does not support gradients with multiple stops, so we need to simulate\n // that for the rainbow slider with 8 divs that each have a single gradient\n var gradientFix = '';\n if (IE) {\n for (var i = 1; i <= 6; i++) {\n gradientFix += \"
\";\n }\n }\n\n return [\n \"
\",\n \"
\",\n \"
\",\n \"
\",\n \"\",\n '
',\n '
',\n \"
\",\n \"
\",\n \"
\",\n \"
\",\n \"
\",\n \"
\",\n \"
\",\n \"
\",\n '
',\n '
',\n '
',\n \"
\",\n '
',\n \"
\",\n \"
\",\n gradientFix,\n '
',\n '
',\n \"
\",\n '
',\n \"
\",\n \"\",\n '
',\n \"
\",\n \"
\",\n \"\",\n \"\",\n '
',\n '
',\n '
'\n ].join('');\n })();\n\n function paletteTemplate(p, color, className, opts) {\n var html = [];\n for (var i = 0; i < p.length; i++) {\n var current = p[i];\n if (current) {\n var tiny = tinycolor(current);\n var c =\n tiny.toHsl().l < 0.5\n ? 'sp-thumb-el sp-thumb-dark'\n : 'sp-thumb-el sp-thumb-light';\n c += tinycolor.equals(color, current) ? ' sp-thumb-active' : '';\n var formattedString = tiny.toString(opts.preferredFormat || 'rgb');\n var swatchStyle = rgbaSupport\n ? 'background-color:' + tiny.toRgbString()\n : 'filter:' + tiny.toFilter();\n html.push(\n ''\n );\n } else {\n var cls = 'sp-clear-display';\n html.push(\n $('
')\n .append(\n $(\n ''\n ).attr('title', opts.noColorSelectedText)\n )\n .html()\n );\n }\n }\n return \"
\" + html.join('') + '
';\n }\n\n function hideAll() {\n for (var i = 0; i < spectrums.length; i++) {\n if (spectrums[i]) {\n spectrums[i].hide();\n }\n }\n }\n\n function instanceOptions(o, callbackContext) {\n var opts = $.extend({}, defaultOpts, o);\n opts.callbacks = {\n move: bind(opts.move, callbackContext),\n change: bind(opts.change, callbackContext),\n show: bind(opts.show, callbackContext),\n hide: bind(opts.hide, callbackContext),\n beforeShow: bind(opts.beforeShow, callbackContext)\n };\n return opts;\n }\n\n function spectrum(element, o) {\n var opts = instanceOptions(o, element),\n flat = opts.flat,\n showSelectionPalette = opts.showSelectionPalette,\n localStorageKey = opts.localStorageKey,\n theme = opts.theme,\n callbacks = opts.callbacks,\n resize = throttle(reflow, 10),\n visible = false,\n isDragging = false,\n isDefault = true,\n dragWidth = 0,\n dragHeight = 0,\n dragHelperHeight = 0,\n slideHeight = 0,\n slideWidth = 0,\n alphaWidth = 0,\n alphaSlideHelperWidth = 0,\n slideHelperHeight = 0,\n currentHue = 0,\n currentSaturation = 0,\n currentValue = 0,\n currentAlpha = 1,\n palette = [],\n paletteArray = [],\n paletteLookup = {},\n selectionPalette = opts.selectionPalette.slice(0),\n maxSelectionSize = opts.maxSelectionSize,\n draggingClass = 'sp-dragging',\n shiftMovementDirection = null;\n\n var doc = element.ownerDocument,\n body = doc.body,\n boundElement = $(element),\n disabled = false,\n container = $(markup, doc).addClass(theme),\n pickerContainer = container.find('.sp-picker-container'),\n dragger = container.find('.sp-color'),\n dragHelper = container.find('.sp-dragger'),\n slider = container.find('.sp-hue'),\n slideHelper = container.find('.sp-slider'),\n alphaSliderInner = container.find('.sp-alpha-inner'),\n alphaSlider = container.find('.sp-alpha'),\n alphaSlideHelper = container.find('.sp-alpha-handle'),\n textInput = container.find('.sp-input'),\n paletteContainer = container.find('.sp-palette'),\n initialColorContainer = container.find('.sp-initial'),\n cancelButton = container.find('.sp-cancel'),\n clearButton = container.find('.sp-clear'),\n chooseButton = container.find('.sp-choose'),\n toggleButton = container.find('.sp-palette-toggle'),\n isInput = boundElement.is('input'),\n isInputTypeColor =\n isInput &&\n boundElement.attr('type') === 'color' &&\n inputTypeColorSupport(),\n shouldReplace = isInput && !flat,\n replacer = shouldReplace\n ? $(replaceInput)\n .addClass(theme)\n .addClass(opts.className)\n .addClass(opts.replacerClassName)\n : $([]),\n offsetElement = shouldReplace ? replacer : boundElement,\n previewElement = replacer.find('.sp-preview-inner'),\n initialColor = opts.color || (isInput && boundElement.val()),\n colorOnShow = false,\n currentPreferredFormat = opts.preferredFormat,\n clickoutFiresChange = !opts.showButtons || opts.clickoutFiresChange,\n isEmpty = !initialColor,\n allowEmpty = opts.allowEmpty && !isInputTypeColor;\n\n function applyOptions() {\n if (opts.showPaletteOnly) {\n opts.showPalette = true;\n }\n\n toggleButton.text(\n opts.showPaletteOnly\n ? opts.togglePaletteMoreText\n : opts.togglePaletteLessText\n );\n\n if (opts.palette) {\n palette = opts.palette.slice(0);\n paletteArray = $.isArray(palette[0]) ? palette : [palette];\n paletteLookup = {};\n for (var i = 0; i < paletteArray.length; i++) {\n for (var j = 0; j < paletteArray[i].length; j++) {\n var rgb = tinycolor(paletteArray[i][j]).toRgbString();\n paletteLookup[rgb] = true;\n }\n }\n }\n\n container.toggleClass('sp-flat', flat);\n container.toggleClass('sp-input-disabled', !opts.showInput);\n container.toggleClass('sp-alpha-enabled', opts.showAlpha);\n container.toggleClass('sp-clear-enabled', allowEmpty);\n container.toggleClass('sp-buttons-disabled', !opts.showButtons);\n container.toggleClass(\n 'sp-palette-buttons-disabled',\n !opts.togglePaletteOnly\n );\n container.toggleClass('sp-palette-disabled', !opts.showPalette);\n container.toggleClass('sp-palette-only', opts.showPaletteOnly);\n container.toggleClass('sp-initial-disabled', !opts.showInitial);\n container.addClass(opts.className).addClass(opts.containerClassName);\n\n reflow();\n }\n\n function initialize() {\n if (IE) {\n container.find('*:not(input)').attr('unselectable', 'on');\n }\n\n applyOptions();\n\n if (shouldReplace) {\n boundElement.after(replacer).hide();\n }\n\n if (!allowEmpty) {\n clearButton.hide();\n }\n\n if (flat) {\n boundElement.after(container).hide();\n } else {\n var appendTo =\n opts.appendTo === 'parent' ? boundElement.parent() : $(opts.appendTo);\n if (appendTo.length !== 1) {\n appendTo = $('body');\n }\n\n appendTo.append(container);\n }\n\n updateSelectionPaletteFromStorage();\n\n offsetElement.bind('click.spectrum touchstart.spectrum', function(e) {\n if (!disabled) {\n toggle();\n }\n\n e.stopPropagation();\n\n if (!$(e.target).is('input')) {\n e.preventDefault();\n }\n });\n\n if (boundElement.is(':disabled') || opts.disabled === true) {\n disable();\n }\n\n // Prevent clicks from bubbling up to document. This would cause it to be hidden.\n container.click(stopPropagation);\n\n // Handle user typed input\n textInput.change(setFromTextInput);\n textInput.bind('paste', function() {\n setTimeout(setFromTextInput, 1);\n });\n textInput.keydown(function(e) {\n if (e.keyCode == 13) {\n setFromTextInput();\n }\n });\n\n cancelButton.text(opts.cancelText);\n cancelButton.bind('click.spectrum', function(e) {\n e.stopPropagation();\n e.preventDefault();\n revert();\n hide();\n });\n\n clearButton.attr('title', opts.clearText);\n clearButton.bind('click.spectrum', function(e) {\n e.stopPropagation();\n e.preventDefault();\n isEmpty = true;\n move();\n\n if (flat) {\n //for the flat style, this is a change event\n updateOriginalInput(true);\n }\n });\n\n chooseButton.text(opts.chooseText);\n chooseButton.bind('click.spectrum', function(e) {\n e.stopPropagation();\n e.preventDefault();\n\n if (IE && textInput.is(':focus')) {\n textInput.trigger('change');\n }\n\n if (isValid()) {\n updateOriginalInput(true);\n hide();\n }\n });\n\n toggleButton.text(\n opts.showPaletteOnly\n ? opts.togglePaletteMoreText\n : opts.togglePaletteLessText\n );\n toggleButton.bind('click.spectrum', function(e) {\n e.stopPropagation();\n e.preventDefault();\n\n opts.showPaletteOnly = !opts.showPaletteOnly;\n\n // To make sure the Picker area is drawn on the right, next to the\n // Palette area (and not below the palette), first move the Palette\n // to the left to make space for the picker, plus 5px extra.\n // The 'applyOptions' function puts the whole container back into place\n // and takes care of the button-text and the sp-palette-only CSS class.\n if (!opts.showPaletteOnly && !flat) {\n container.css('left', '-=' + (pickerContainer.outerWidth(true) + 5));\n }\n applyOptions();\n });\n\n draggable(\n alphaSlider,\n function(dragX, dragY, e) {\n currentAlpha = dragX / alphaWidth;\n isEmpty = false;\n if (e.shiftKey) {\n currentAlpha = Math.round(currentAlpha * 10) / 10;\n }\n\n move();\n },\n dragStart,\n dragStop\n );\n\n draggable(\n slider,\n function(dragX, dragY) {\n currentHue = parseFloat(dragY / slideHeight);\n isEmpty = false;\n if (!opts.showAlpha) {\n currentAlpha = 1;\n }\n move();\n },\n dragStart,\n dragStop\n );\n\n draggable(\n dragger,\n function(dragX, dragY, e) {\n // shift+drag should snap the movement to either the x or y axis.\n if (!e.shiftKey) {\n shiftMovementDirection = null;\n } else if (!shiftMovementDirection) {\n var oldDragX = currentSaturation * dragWidth;\n var oldDragY = dragHeight - currentValue * dragHeight;\n var furtherFromX =\n Math.abs(dragX - oldDragX) > Math.abs(dragY - oldDragY);\n\n shiftMovementDirection = furtherFromX ? 'x' : 'y';\n }\n\n var setSaturation =\n !shiftMovementDirection || shiftMovementDirection === 'x';\n var setValue =\n !shiftMovementDirection || shiftMovementDirection === 'y';\n\n if (setSaturation) {\n currentSaturation = parseFloat(dragX / dragWidth);\n }\n if (setValue) {\n currentValue = parseFloat((dragHeight - dragY) / dragHeight);\n }\n\n isEmpty = false;\n if (!opts.showAlpha) {\n currentAlpha = 1;\n }\n\n move();\n },\n dragStart,\n dragStop\n );\n\n if (!!initialColor) {\n set(initialColor);\n\n // In case color was black - update the preview UI and set the format\n // since the set function will not run (default color is black).\n updateUI();\n currentPreferredFormat =\n opts.preferredFormat || tinycolor(initialColor).getFormat();\n\n addColorToSelectionPalette(initialColor);\n } else {\n updateUI();\n }\n\n if (flat) {\n show();\n }\n\n function paletteElementClick(e) {\n if (e.data && e.data.ignore) {\n set(\n $(e.target)\n .closest('.sp-thumb-el')\n .data('color')\n );\n move();\n } else {\n set(\n $(e.target)\n .closest('.sp-thumb-el')\n .data('color')\n );\n move();\n updateOriginalInput(true);\n if (opts.hideAfterPaletteSelect) {\n hide();\n }\n }\n\n return false;\n }\n\n var paletteEvent = IE\n ? 'mousedown.spectrum'\n : 'click.spectrum touchstart.spectrum';\n paletteContainer.delegate(\n '.sp-thumb-el',\n paletteEvent,\n paletteElementClick\n );\n initialColorContainer.delegate(\n '.sp-thumb-el:nth-child(1)',\n paletteEvent,\n { ignore: true },\n paletteElementClick\n );\n }\n\n function updateSelectionPaletteFromStorage() {\n if (localStorageKey && window.localStorage) {\n // Migrate old palettes over to new format. May want to remove this eventually.\n try {\n var oldPalette = window.localStorage[localStorageKey].split(',#');\n if (oldPalette.length > 1) {\n delete window.localStorage[localStorageKey];\n $.each(oldPalette, function(i, c) {\n addColorToSelectionPalette(c);\n });\n }\n } catch (e) {}\n\n try {\n selectionPalette = window.localStorage[localStorageKey].split(';');\n } catch (e) {}\n }\n }\n\n function addColorToSelectionPalette(color) {\n if (showSelectionPalette) {\n var rgb = tinycolor(color).toRgbString();\n if (!paletteLookup[rgb] && $.inArray(rgb, selectionPalette) === -1) {\n selectionPalette.push(rgb);\n while (selectionPalette.length > maxSelectionSize) {\n selectionPalette.shift();\n }\n }\n\n if (localStorageKey && window.localStorage) {\n try {\n window.localStorage[localStorageKey] = selectionPalette.join(';');\n } catch (e) {}\n }\n }\n }\n\n function getUniqueSelectionPalette() {\n var unique = [];\n if (opts.showPalette) {\n for (var i = 0; i < selectionPalette.length; i++) {\n var rgb = tinycolor(selectionPalette[i]).toRgbString();\n\n if (!paletteLookup[rgb]) {\n unique.push(selectionPalette[i]);\n }\n }\n }\n\n return unique.reverse().slice(0, opts.maxSelectionSize);\n }\n\n function drawPalette() {\n var currentColor = get();\n\n var html = $.map(paletteArray, function(palette, i) {\n return paletteTemplate(\n palette,\n currentColor,\n 'sp-palette-row sp-palette-row-' + i,\n opts\n );\n });\n\n updateSelectionPaletteFromStorage();\n\n if (selectionPalette) {\n html.push(\n paletteTemplate(\n getUniqueSelectionPalette(),\n currentColor,\n 'sp-palette-row sp-palette-row-selection',\n opts\n )\n );\n }\n\n paletteContainer.html(html.join(''));\n }\n\n function drawInitial() {\n if (opts.showInitial) {\n var initial = colorOnShow;\n var current = get();\n initialColorContainer.html(\n paletteTemplate(\n [initial, current],\n current,\n 'sp-palette-row-initial',\n opts\n )\n );\n }\n }\n\n function dragStart() {\n if (dragHeight <= 0 || dragWidth <= 0 || slideHeight <= 0) {\n reflow();\n }\n isDragging = true;\n container.addClass(draggingClass);\n shiftMovementDirection = null;\n boundElement.trigger('dragstart.spectrum', [get()]);\n }\n\n function dragStop() {\n isDragging = false;\n container.removeClass(draggingClass);\n boundElement.trigger('dragstop.spectrum', [get()]);\n }\n\n function setFromTextInput() {\n var value = textInput.val();\n\n if ((value === null || value === '') && allowEmpty) {\n set(null);\n updateOriginalInput(true);\n } else {\n var tiny = tinycolor(value);\n if (tiny.isValid()) {\n set(tiny);\n updateOriginalInput(true);\n } else {\n textInput.addClass('sp-validation-error');\n }\n }\n }\n\n function toggle() {\n if (visible) {\n hide();\n } else {\n show();\n }\n }\n\n function show() {\n var event = $.Event('beforeShow.spectrum');\n\n if (visible) {\n reflow();\n return;\n }\n\n boundElement.trigger('beforeShow.spectrum', [get()]);\n\n if (callbacks.beforeShow(get()) === false || event.isDefaultPrevented()) {\n return;\n }\n\n hideAll();\n visible = true;\n\n var $doc = $(doc);\n $doc.bind('keydown.spectrum', onkeydown);\n $doc.bind('click.spectrum', clickout);\n $(window).bind('resize.spectrum', resize);\n replacer.addClass('sp-active');\n container.removeClass('sp-hidden');\n\n reflow();\n updateUI();\n\n colorOnShow = get();\n\n drawInitial();\n callbacks.show(colorOnShow);\n boundElement.trigger('show.spectrum', [colorOnShow]);\n }\n\n function onkeydown(e) {\n // Close on ESC\n if (e.keyCode === 27) {\n hide();\n }\n }\n\n function clickout(e) {\n // Return on right click.\n if (e.button == 2) {\n return;\n }\n\n // If a drag event was happening during the mouseup, don't hide\n // on click.\n if (isDragging) {\n return;\n }\n\n if (clickoutFiresChange) {\n updateOriginalInput(true);\n } else {\n revert();\n }\n hide();\n }\n\n function hide() {\n // Return if hiding is unnecessary\n if (!visible || flat) {\n return;\n }\n visible = false;\n\n $(doc).unbind('keydown.spectrum', onkeydown);\n $(doc).unbind('click.spectrum', clickout);\n $(window).unbind('resize.spectrum', resize);\n\n replacer.removeClass('sp-active');\n container.addClass('sp-hidden');\n\n callbacks.hide(get());\n boundElement.trigger('hide.spectrum', [get()]);\n }\n\n function revert() {\n set(colorOnShow, true);\n }\n\n function set(color, ignoreFormatChange) {\n if (tinycolor.equals(color, get())) {\n // Update UI just in case a validation error needs\n // to be cleared.\n updateUI();\n return;\n }\n\n var newColor, newHsv;\n if (!color && allowEmpty) {\n isEmpty = true;\n } else {\n isEmpty = false;\n isDefault = !color; // if no color is available an empty string will be passed. tinycolor will then set it to #000\n newColor = tinycolor(color);\n newHsv = newColor.toHsv();\n\n currentHue = (newHsv.h % 360) / 360;\n currentSaturation = newHsv.s;\n currentValue = newHsv.v;\n currentAlpha = newHsv.a;\n }\n updateUI();\n\n if (newColor && newColor.isValid() && !ignoreFormatChange) {\n currentPreferredFormat = opts.preferredFormat || newColor.getFormat();\n }\n }\n\n function get(opts) {\n opts = opts || {};\n\n if (allowEmpty && isEmpty) {\n return null;\n }\n\n return tinycolor.fromRatio(\n {\n h: currentHue,\n s: currentSaturation,\n v: currentValue,\n a: Math.round(currentAlpha * 100) / 100\n },\n { format: opts.format || currentPreferredFormat }\n );\n }\n\n function isValid() {\n return !textInput.hasClass('sp-validation-error');\n }\n\n function move() {\n updateUI();\n\n callbacks.move(get());\n boundElement.trigger('move.spectrum', [get()]);\n }\n\n function updateUI() {\n textInput.removeClass('sp-validation-error');\n\n updateHelperLocations();\n\n // Update dragger background color (gradients take care of saturation and value).\n var flatColor = tinycolor.fromRatio({ h: currentHue, s: 1, v: 1 });\n dragger.css('background-color', flatColor.toHexString());\n\n // Get a format that alpha will be included in (hex and names ignore alpha)\n var format = currentPreferredFormat;\n if (currentAlpha < 1 && !(currentAlpha === 0 && format === 'name')) {\n if (\n format === 'hex' ||\n format === 'hex3' ||\n format === 'hex6' ||\n format === 'name'\n ) {\n format = 'rgb';\n }\n }\n\n var realColor = get({ format: format }),\n displayColor = '';\n\n //reset background info for preview element\n previewElement.removeClass('sp-clear-display');\n previewElement.css('background-color', 'transparent');\n\n if (!realColor && allowEmpty) {\n // Update the replaced elements background with icon indicating no color selection\n previewElement.addClass('sp-clear-display');\n } else {\n var realHex = realColor.toHexString(),\n realRgb = realColor.toRgbString();\n\n // Update the replaced elements background color (with actual selected color)\n if (rgbaSupport || realColor.alpha === 1) {\n previewElement.css('background-color', realRgb);\n } else {\n previewElement.css('background-color', 'transparent');\n previewElement.css('filter', realColor.toFilter());\n }\n\n if (opts.showAlpha) {\n var rgb = realColor.toRgb();\n rgb.a = 0;\n var realAlpha = tinycolor(rgb).toRgbString();\n var gradient =\n 'linear-gradient(left, ' + realAlpha + ', ' + realHex + ')';\n\n if (IE) {\n alphaSliderInner.css(\n 'filter',\n tinycolor(realAlpha).toFilter({ gradientType: 1 }, realHex)\n );\n } else {\n alphaSliderInner.css('background', '-webkit-' + gradient);\n alphaSliderInner.css('background', '-moz-' + gradient);\n alphaSliderInner.css('background', '-ms-' + gradient);\n // Use current syntax gradient on unprefixed property.\n alphaSliderInner.css(\n 'background',\n 'linear-gradient(to right, ' + realAlpha + ', ' + realHex + ')'\n );\n }\n }\n\n displayColor = realColor.toString(format);\n }\n\n // Update the text entry input as it changes happen\n if (opts.showInput) {\n textInput.val(displayColor);\n }\n\n if (opts.showPalette) {\n drawPalette();\n }\n\n drawInitial();\n }\n\n function updateHelperLocations() {\n var s = currentSaturation;\n var v = currentValue;\n\n if (allowEmpty && isEmpty) {\n //if selected color is empty, hide the helpers\n alphaSlideHelper.hide();\n slideHelper.hide();\n dragHelper.hide();\n } else {\n //make sure helpers are visible\n alphaSlideHelper.show();\n slideHelper.show();\n dragHelper.show();\n\n // Where to show the little circle in that displays your current selected color\n var dragX = s * dragWidth;\n var dragY = dragHeight - v * dragHeight;\n dragX = Math.max(\n -dragHelperHeight,\n Math.min(dragWidth - dragHelperHeight, dragX - dragHelperHeight)\n );\n dragY = Math.max(\n -dragHelperHeight,\n Math.min(dragHeight - dragHelperHeight, dragY - dragHelperHeight)\n );\n dragHelper.css({\n top: dragY + 'px',\n left: dragX + 'px'\n });\n\n var alphaX = currentAlpha * alphaWidth;\n alphaSlideHelper.css({\n left: alphaX - alphaSlideHelperWidth / 2 + 'px'\n });\n\n // Where to show the bar that displays your current selected hue\n var slideY = currentHue * slideHeight;\n slideHelper.css({\n top: slideY - slideHelperHeight + 'px'\n });\n }\n }\n\n function updateOriginalInput(fireCallback) {\n var color = get(),\n displayColor = '',\n hasChanged = isDefault ? true : !tinycolor.equals(color, colorOnShow);\n\n if (color) {\n displayColor = color.toString(currentPreferredFormat);\n // Update the selection palette with the current color\n addColorToSelectionPalette(color);\n }\n\n if (isInput) {\n boundElement.val(displayColor);\n }\n\n if (fireCallback && hasChanged) {\n callbacks.change(color);\n boundElement.trigger('change', [color]);\n }\n }\n\n function reflow() {\n if (!visible) {\n return; // Calculations would be useless and wouldn't be reliable anyways\n }\n dragWidth = dragger.width();\n dragHeight = dragger.height();\n dragHelperHeight = dragHelper.height();\n slideWidth = slider.width();\n slideHeight = slider.height();\n slideHelperHeight = slideHelper.height();\n alphaWidth = alphaSlider.width();\n alphaSlideHelperWidth = alphaSlideHelper.width();\n\n if (!flat) {\n container.css('position', 'absolute');\n if (opts.offset) {\n container.offset(opts.offset);\n } else {\n container.offset(getOffset(container, offsetElement));\n }\n }\n\n updateHelperLocations();\n\n if (opts.showPalette) {\n drawPalette();\n }\n\n boundElement.trigger('reflow.spectrum');\n }\n\n function destroy() {\n boundElement.show();\n offsetElement.unbind('click.spectrum touchstart.spectrum');\n container.remove();\n replacer.remove();\n spectrums[spect.id] = null;\n }\n\n function option(optionName, optionValue) {\n if (optionName === undefined) {\n return $.extend({}, opts);\n }\n if (optionValue === undefined) {\n return opts[optionName];\n }\n\n opts[optionName] = optionValue;\n\n if (optionName === 'preferredFormat') {\n currentPreferredFormat = opts.preferredFormat;\n }\n applyOptions();\n }\n\n function enable() {\n disabled = false;\n boundElement.attr('disabled', false);\n offsetElement.removeClass('sp-disabled');\n }\n\n function disable() {\n hide();\n disabled = true;\n boundElement.attr('disabled', true);\n offsetElement.addClass('sp-disabled');\n }\n\n function setOffset(coord) {\n opts.offset = coord;\n reflow();\n }\n\n initialize();\n\n var spect = {\n show: show,\n hide: hide,\n toggle: toggle,\n reflow: reflow,\n option: option,\n enable: enable,\n disable: disable,\n offset: setOffset,\n set: function(c) {\n set(c);\n updateOriginalInput();\n },\n get: get,\n destroy: destroy,\n container: container\n };\n\n spect.id = spectrums.push(spect) - 1;\n\n return spect;\n }\n\n /**\n * checkOffset - get the offset below/above and left/right element depending on screen position\n * Thanks https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.datepicker.js\n */\n function getOffset(picker, input) {\n var extraY = 0;\n var dpWidth = picker.outerWidth();\n var dpHeight = picker.outerHeight();\n var inputHeight = input.outerHeight();\n var doc = picker[0].ownerDocument;\n var docElem = doc.documentElement;\n var cW = docElem.clientWidth;\n var cH = docElem.clientHeight;\n var scL = $(doc).scrollLeft();\n var scT = $(doc).scrollTop();\n var viewWidth = cW + scL;\n var viewHeight = cH + scT;\n var offset = input.offset();\n\n offset.top += inputHeight;\n\n offset.left -= Math.min(\n offset.left,\n offset.left + dpWidth > viewWidth && viewWidth > dpWidth\n ? Math.abs(offset.left + dpWidth - viewWidth)\n : 0\n );\n\n offset.top -= Math.min(\n offset.top,\n offset.top + dpHeight > viewHeight && viewHeight > dpHeight\n ? Math.abs(dpHeight + inputHeight - extraY)\n : extraY\n );\n\n return offset;\n }\n\n /**\n * noop - do nothing\n */\n function noop() {}\n\n /**\n * stopPropagation - makes the code only doing this a little easier to read in line\n */\n function stopPropagation(e) {\n e.stopPropagation();\n }\n\n /**\n * Create a function bound to a given object\n * Thanks to underscore.js\n */\n function bind(func, obj) {\n var slice = Array.prototype.slice;\n var args = slice.call(arguments, 2);\n return function() {\n return func.apply(obj, args.concat(slice.call(arguments)));\n };\n }\n\n /**\n * Lightweight drag helper. Handles containment within the element, so that\n * when dragging, the x is within [0,element.width] and y is within [0,element.height]\n */\n function draggable(element, onmove, onstart, onstop) {\n onmove = onmove || function() {};\n onstart = onstart || function() {};\n onstop = onstop || function() {};\n var doc = document;\n var dragging = false;\n var offset = {};\n var maxHeight = 0;\n var maxWidth = 0;\n var hasTouch = 'ontouchstart' in window;\n\n var duringDragEvents = {};\n duringDragEvents['selectstart'] = prevent;\n duringDragEvents['dragstart'] = prevent;\n duringDragEvents['touchmove mousemove'] = move;\n duringDragEvents['touchend mouseup'] = stop;\n\n function prevent(e) {\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n if (e.preventDefault) {\n e.preventDefault();\n }\n e.returnValue = false;\n }\n\n function move(e) {\n if (dragging) {\n // Mouseup happened outside of window\n if (IE && doc.documentMode < 9 && !e.button) {\n return stop();\n }\n\n var t0 = e && e.touches && e.touches[0];\n var pageX = (t0 && t0.pageX) || e.pageX;\n var pageY = (t0 && t0.pageY) || e.pageY;\n\n var dragX = Math.max(0, Math.min(pageX - offset.left, maxWidth));\n var dragY = Math.max(0, Math.min(pageY - offset.top, maxHeight));\n\n if (hasTouch) {\n // Stop scrolling in iOS\n prevent(e);\n }\n\n onmove.apply(element, [dragX, dragY, e]);\n }\n }\n\n function start(e) {\n var rightclick = e.which ? e.which == 3 : e.button == 2;\n\n if (!rightclick && !dragging) {\n if (onstart.apply(element, arguments) !== false) {\n dragging = true;\n maxHeight = $(element).height();\n maxWidth = $(element).width();\n offset = $(element).offset();\n\n $(doc).bind(duringDragEvents);\n $(doc.body).addClass('sp-dragging');\n\n move(e);\n\n prevent(e);\n }\n }\n }\n\n function stop() {\n if (dragging) {\n $(doc).unbind(duringDragEvents);\n $(doc.body).removeClass('sp-dragging');\n\n // Wait a tick before notifying observers to allow the click event\n // to fire in Chrome.\n setTimeout(function() {\n onstop.apply(element, arguments);\n }, 0);\n }\n dragging = false;\n }\n\n $(element).bind('touchstart mousedown', start);\n }\n\n function throttle(func, wait, debounce) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var throttler = function() {\n timeout = null;\n func.apply(context, args);\n };\n if (debounce) clearTimeout(timeout);\n if (debounce || !timeout) timeout = setTimeout(throttler, wait);\n };\n }\n\n function inputTypeColorSupport() {\n return $.fn.spectrum.inputTypeColorSupport();\n }\n\n /**\n * Define a jQuery plugin\n */\n var dataID = 'spectrum.id';\n $.fn.spectrum = function(opts, extra) {\n if (typeof opts == 'string') {\n var returnValue = this;\n var args = Array.prototype.slice.call(arguments, 1);\n\n this.each(function() {\n var spect = spectrums[$(this).data(dataID)];\n if (spect) {\n var method = spect[opts];\n if (!method) {\n throw new Error(\"Spectrum: no such method: '\" + opts + \"'\");\n }\n\n if (opts == 'get') {\n returnValue = spect.get();\n } else if (opts == 'container') {\n returnValue = spect.container;\n } else if (opts == 'option') {\n returnValue = spect.option.apply(spect, args);\n } else if (opts == 'destroy') {\n spect.destroy();\n $(this).removeData(dataID);\n } else {\n method.apply(spect, args);\n }\n }\n });\n\n return returnValue;\n }\n\n // Initializing a new instance of spectrum\n return this.spectrum('destroy').each(function() {\n var options = $.extend({}, opts, $(this).data());\n var spect = spectrum(this, options);\n $(this).data(dataID, spect.id);\n });\n };\n\n $.fn.spectrum.load = true;\n $.fn.spectrum.loadOpts = {};\n $.fn.spectrum.draggable = draggable;\n $.fn.spectrum.defaults = defaultOpts;\n $.fn.spectrum.inputTypeColorSupport = function inputTypeColorSupport() {\n if (typeof inputTypeColorSupport._cachedResult === 'undefined') {\n var colorInput = $(\"\")[0]; // if color element is supported, value will default to not null\n inputTypeColorSupport._cachedResult =\n colorInput.type === 'color' && colorInput.value !== '';\n }\n return inputTypeColorSupport._cachedResult;\n };\n\n $.spectrum = {};\n $.spectrum.localization = {};\n $.spectrum.palettes = {};\n\n $.fn.spectrum.processNativeColorInputs = function() {\n var colorInputs = $('input[type=color]');\n if (colorInputs.length && !inputTypeColorSupport()) {\n colorInputs.spectrum({\n preferredFormat: 'hex6'\n });\n }\n };\n\n // TinyColor v1.1.2\n // https://github.com/bgrins/TinyColor\n // Brian Grinstead, MIT License\n\n //(function() {\n\n var trimLeft = /^[\\s,#]+/,\n trimRight = /\\s+$/,\n tinyCounter = 0,\n math = Math,\n mathRound = math.round,\n mathMin = math.min,\n mathMax = math.max,\n mathRandom = math.random;\n\n var tinycolor = function(color, opts) {\n color = color ? color : '';\n opts = opts || {};\n\n // If input is already a tinycolor, return itself\n if (color instanceof tinycolor) {\n return color;\n }\n // If we are called as a function, call using new instead\n if (!(this instanceof tinycolor)) {\n return new tinycolor(color, opts);\n }\n\n var rgb = inputToRGB(color);\n (this._originalInput = color),\n (this._r = rgb.r),\n (this._g = rgb.g),\n (this._b = rgb.b),\n (this._a = rgb.a),\n (this._roundA = mathRound(100 * this._a) / 100),\n (this._format = opts.format || rgb.format);\n this._gradientType = opts.gradientType;\n\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this._r < 1) {\n this._r = mathRound(this._r);\n }\n if (this._g < 1) {\n this._g = mathRound(this._g);\n }\n if (this._b < 1) {\n this._b = mathRound(this._b);\n }\n\n this._ok = rgb.ok;\n this._tc_id = tinyCounter++;\n };\n\n tinycolor.prototype = {\n isDark: function() {\n return this.getBrightness() < 128;\n },\n isLight: function() {\n return !this.isDark();\n },\n isValid: function() {\n return this._ok;\n },\n getOriginalInput: function() {\n return this._originalInput;\n },\n getFormat: function() {\n return this._format;\n },\n getAlpha: function() {\n return this._a;\n },\n getBrightness: function() {\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n },\n setAlpha: function(value) {\n this._a = boundAlpha(value);\n this._roundA = mathRound(100 * this._a) / 100;\n return this;\n },\n toHsv: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };\n },\n toHsvString: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n var h = mathRound(hsv.h * 360),\n s = mathRound(hsv.s * 100),\n v = mathRound(hsv.v * 100);\n return this._a == 1\n ? 'hsv(' + h + ', ' + s + '%, ' + v + '%)'\n : 'hsva(' + h + ', ' + s + '%, ' + v + '%, ' + this._roundA + ')';\n },\n toHsl: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };\n },\n toHslString: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n var h = mathRound(hsl.h * 360),\n s = mathRound(hsl.s * 100),\n l = mathRound(hsl.l * 100);\n return this._a == 1\n ? 'hsl(' + h + ', ' + s + '%, ' + l + '%)'\n : 'hsla(' + h + ', ' + s + '%, ' + l + '%, ' + this._roundA + ')';\n },\n toHex: function(allow3Char) {\n return rgbToHex(this._r, this._g, this._b, allow3Char);\n },\n toHexString: function(allow3Char) {\n return '#' + this.toHex(allow3Char);\n },\n toHex8: function() {\n return rgbaToHex(this._r, this._g, this._b, this._a);\n },\n toHex8String: function() {\n return '#' + this.toHex8();\n },\n toRgb: function() {\n return {\n r: mathRound(this._r),\n g: mathRound(this._g),\n b: mathRound(this._b),\n a: this._a\n };\n },\n toRgbString: function() {\n return this._a == 1\n ? 'rgb(' +\n mathRound(this._r) +\n ', ' +\n mathRound(this._g) +\n ', ' +\n mathRound(this._b) +\n ')'\n : 'rgba(' +\n mathRound(this._r) +\n ', ' +\n mathRound(this._g) +\n ', ' +\n mathRound(this._b) +\n ', ' +\n this._roundA +\n ')';\n },\n toPercentageRgb: function() {\n return {\n r: mathRound(bound01(this._r, 255) * 100) + '%',\n g: mathRound(bound01(this._g, 255) * 100) + '%',\n b: mathRound(bound01(this._b, 255) * 100) + '%',\n a: this._a\n };\n },\n toPercentageRgbString: function() {\n return this._a == 1\n ? 'rgb(' +\n mathRound(bound01(this._r, 255) * 100) +\n '%, ' +\n mathRound(bound01(this._g, 255) * 100) +\n '%, ' +\n mathRound(bound01(this._b, 255) * 100) +\n '%)'\n : 'rgba(' +\n mathRound(bound01(this._r, 255) * 100) +\n '%, ' +\n mathRound(bound01(this._g, 255) * 100) +\n '%, ' +\n mathRound(bound01(this._b, 255) * 100) +\n '%, ' +\n this._roundA +\n ')';\n },\n toName: function() {\n if (this._a === 0) {\n return 'transparent';\n }\n\n if (this._a < 1) {\n return false;\n }\n\n return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;\n },\n toFilter: function(secondColor) {\n var hex8String = '#' + rgbaToHex(this._r, this._g, this._b, this._a);\n var secondHex8String = hex8String;\n var gradientType = this._gradientType ? 'GradientType = 1, ' : '';\n\n if (secondColor) {\n var s = tinycolor(secondColor);\n secondHex8String = s.toHex8String();\n }\n\n return (\n 'progid:DXImageTransform.Microsoft.gradient(' +\n gradientType +\n 'startColorstr=' +\n hex8String +\n ',endColorstr=' +\n secondHex8String +\n ')'\n );\n },\n toString: function(format) {\n var formatSet = !!format;\n format = format || this._format;\n\n var formattedString = false;\n var hasAlpha = this._a < 1 && this._a >= 0;\n var needsAlphaFormat =\n !formatSet &&\n hasAlpha &&\n (format === 'hex' ||\n format === 'hex6' ||\n format === 'hex3' ||\n format === 'name');\n\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === 'name' && this._a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === 'rgb') {\n formattedString = this.toRgbString();\n }\n if (format === 'prgb') {\n formattedString = this.toPercentageRgbString();\n }\n if (format === 'hex' || format === 'hex6') {\n formattedString = this.toHexString();\n }\n if (format === 'hex3') {\n formattedString = this.toHexString(true);\n }\n if (format === 'hex8') {\n formattedString = this.toHex8String();\n }\n if (format === 'name') {\n formattedString = this.toName();\n }\n if (format === 'hsl') {\n formattedString = this.toHslString();\n }\n if (format === 'hsv') {\n formattedString = this.toHsvString();\n }\n\n return formattedString || this.toHexString();\n },\n\n _applyModification: function(fn, args) {\n var color = fn.apply(null, [this].concat([].slice.call(args)));\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this.setAlpha(color._a);\n return this;\n },\n lighten: function() {\n return this._applyModification(lighten, arguments);\n },\n brighten: function() {\n return this._applyModification(brighten, arguments);\n },\n darken: function() {\n return this._applyModification(darken, arguments);\n },\n desaturate: function() {\n return this._applyModification(desaturate, arguments);\n },\n saturate: function() {\n return this._applyModification(saturate, arguments);\n },\n greyscale: function() {\n return this._applyModification(greyscale, arguments);\n },\n spin: function() {\n return this._applyModification(spin, arguments);\n },\n\n _applyCombination: function(fn, args) {\n return fn.apply(null, [this].concat([].slice.call(args)));\n },\n analogous: function() {\n return this._applyCombination(analogous, arguments);\n },\n complement: function() {\n return this._applyCombination(complement, arguments);\n },\n monochromatic: function() {\n return this._applyCombination(monochromatic, arguments);\n },\n splitcomplement: function() {\n return this._applyCombination(splitcomplement, arguments);\n },\n triad: function() {\n return this._applyCombination(triad, arguments);\n },\n tetrad: function() {\n return this._applyCombination(tetrad, arguments);\n }\n };\n\n // If input is an object, force 1 into \"1.0\" to handle ratios properly\n // String input requires \"1.0\" as input, so 1 will be treated as 1\n tinycolor.fromRatio = function(color, opts) {\n if (typeof color == 'object') {\n var newColor = {};\n for (var i in color) {\n if (color.hasOwnProperty(i)) {\n if (i === 'a') {\n newColor[i] = color[i];\n } else {\n newColor[i] = convertToPercentage(color[i]);\n }\n }\n }\n color = newColor;\n }\n\n return tinycolor(color, opts);\n };\n\n // Given a string or object, convert that input to RGB\n // Possible string inputs:\n //\n // \"red\"\n // \"#f00\" or \"f00\"\n // \"#ff0000\" or \"ff0000\"\n // \"#ff000000\" or \"ff000000\"\n // \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n // \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n // \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n // \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n // \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n // \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n // \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n //\n function inputToRGB(color) {\n var rgb = { r: 0, g: 0, b: 0 };\n var a = 1;\n var ok = false;\n var format = false;\n\n if (typeof color == 'string') {\n color = stringInputToObject(color);\n }\n\n if (typeof color == 'object') {\n if (\n color.hasOwnProperty('r') &&\n color.hasOwnProperty('g') &&\n color.hasOwnProperty('b')\n ) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';\n } else if (\n color.hasOwnProperty('h') &&\n color.hasOwnProperty('s') &&\n color.hasOwnProperty('v')\n ) {\n color.s = convertToPercentage(color.s);\n color.v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, color.s, color.v);\n ok = true;\n format = 'hsv';\n } else if (\n color.hasOwnProperty('h') &&\n color.hasOwnProperty('s') &&\n color.hasOwnProperty('l')\n ) {\n color.s = convertToPercentage(color.s);\n color.l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, color.s, color.l);\n ok = true;\n format = 'hsl';\n }\n\n if (color.hasOwnProperty('a')) {\n a = color.a;\n }\n }\n\n a = boundAlpha(a);\n\n return {\n ok: ok,\n format: color.format || format,\n r: mathMin(255, mathMax(rgb.r, 0)),\n g: mathMin(255, mathMax(rgb.g, 0)),\n b: mathMin(255, mathMax(rgb.b, 0)),\n a: a\n };\n }\n\n // Conversion Functions\n // --------------------\n\n // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n // \n\n // `rgbToRgb`\n // Handle bounds / percentage checking to conform to CSS color spec\n // \n // *Assumes:* r, g, b in [0, 255] or [0, 1]\n // *Returns:* { r, g, b } in [0, 255]\n function rgbToRgb(r, g, b) {\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255\n };\n }\n\n // `rgbToHsl`\n // Converts an RGB color value to HSL.\n // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n // *Returns:* { h, s, l } in [0,1]\n function rgbToHsl(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b),\n min = mathMin(r, g, b);\n var h,\n s,\n l = (max + min) / 2;\n\n if (max == min) {\n h = s = 0; // achromatic\n } else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n\n h /= 6;\n }\n\n return { h: h, s: s, l: l };\n }\n\n // `hslToRgb`\n // Converts an HSL color value to RGB.\n // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n // *Returns:* { r, g, b } in the set [0, 255]\n function hslToRgb(h, s, l) {\n var r, g, b;\n\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n\n function hue2rgb(p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n }\n\n if (s === 0) {\n r = g = b = l; // achromatic\n } else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n }\n\n // `rgbToHsv`\n // Converts an RGB color value to HSV\n // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n // *Returns:* { h, s, v } in [0,1]\n function rgbToHsv(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b),\n min = mathMin(r, g, b);\n var h,\n s,\n v = max;\n\n var d = max - min;\n s = max === 0 ? 0 : d / max;\n\n if (max == min) {\n h = 0; // achromatic\n } else {\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n return { h: h, s: s, v: v };\n }\n\n // `hsvToRgb`\n // Converts an HSV color value to RGB.\n // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n // *Returns:* { r, g, b } in the set [0, 255]\n function hsvToRgb(h, s, v) {\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n\n var i = math.floor(h),\n f = h - i,\n p = v * (1 - s),\n q = v * (1 - f * s),\n t = v * (1 - (1 - f) * s),\n mod = i % 6,\n r = [v, q, p, p, t, v][mod],\n g = [t, v, v, q, p, p][mod],\n b = [p, p, t, v, v, q][mod];\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n }\n\n // `rgbToHex`\n // Converts an RGB color to hex\n // Assumes r, g, and b are contained in the set [0, 255]\n // Returns a 3 or 6 character hex\n function rgbToHex(r, g, b, allow3Char) {\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n // Return a 3 character hex if possible\n if (\n allow3Char &&\n hex[0].charAt(0) == hex[0].charAt(1) &&\n hex[1].charAt(0) == hex[1].charAt(1) &&\n hex[2].charAt(0) == hex[2].charAt(1)\n ) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n\n return hex.join('');\n }\n // `rgbaToHex`\n // Converts an RGBA color plus alpha transparency to hex\n // Assumes r, g, b and a are contained in the set [0, 255]\n // Returns an 8 character hex\n function rgbaToHex(r, g, b, a) {\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join('');\n }\n\n // `equals`\n // Can be called with any tinycolor input\n tinycolor.equals = function(color1, color2) {\n if (!color1 || !color2) {\n return false;\n }\n return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();\n };\n tinycolor.random = function() {\n return tinycolor.fromRatio({\n r: mathRandom(),\n g: mathRandom(),\n b: mathRandom()\n });\n };\n\n // Modification Functions\n // ----------------------\n // Thanks to less.js for some of the basics here\n // \n\n function desaturate(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n }\n\n function saturate(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n }\n\n function greyscale(color) {\n return tinycolor(color).desaturate(100);\n }\n\n function lighten(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n }\n\n function brighten(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var rgb = tinycolor(color).toRgb();\n rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * -(amount / 100))));\n rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * -(amount / 100))));\n rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * -(amount / 100))));\n return tinycolor(rgb);\n }\n\n function darken(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n }\n\n // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n // Values outside of this range will be wrapped into this range.\n function spin(color, amount) {\n var hsl = tinycolor(color).toHsl();\n var hue = (mathRound(hsl.h) + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return tinycolor(hsl);\n }\n\n // Combination Functions\n // ---------------------\n // Thanks to jQuery xColor for some of the ideas behind these\n // \n\n function complement(color) {\n var hsl = tinycolor(color).toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return tinycolor(hsl);\n }\n\n function triad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })\n ];\n }\n\n function tetrad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })\n ];\n }\n\n function splitcomplement(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l })\n ];\n }\n\n function analogous(color, results, slices) {\n results = results || 6;\n slices = slices || 30;\n\n var hsl = tinycolor(color).toHsl();\n var part = 360 / slices;\n var ret = [tinycolor(color)];\n\n for (hsl.h = (hsl.h - ((part * results) >> 1) + 720) % 360; --results; ) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(tinycolor(hsl));\n }\n return ret;\n }\n\n function monochromatic(color, results) {\n results = results || 6;\n var hsv = tinycolor(color).toHsv();\n var h = hsv.h,\n s = hsv.s,\n v = hsv.v;\n var ret = [];\n var modification = 1 / results;\n\n while (results--) {\n ret.push(tinycolor({ h: h, s: s, v: v }));\n v = (v + modification) % 1;\n }\n\n return ret;\n }\n\n // Utility Functions\n // ---------------------\n\n tinycolor.mix = function(color1, color2, amount) {\n amount = amount === 0 ? 0 : amount || 50;\n\n var rgb1 = tinycolor(color1).toRgb();\n var rgb2 = tinycolor(color2).toRgb();\n\n var p = amount / 100;\n var w = p * 2 - 1;\n var a = rgb2.a - rgb1.a;\n\n var w1;\n\n if (w * a == -1) {\n w1 = w;\n } else {\n w1 = (w + a) / (1 + w * a);\n }\n\n w1 = (w1 + 1) / 2;\n\n var w2 = 1 - w1;\n\n var rgba = {\n r: rgb2.r * w1 + rgb1.r * w2,\n g: rgb2.g * w1 + rgb1.g * w2,\n b: rgb2.b * w1 + rgb1.b * w2,\n a: rgb2.a * p + rgb1.a * (1 - p)\n };\n\n return tinycolor(rgba);\n };\n\n // Readability Functions\n // ---------------------\n // \n\n // `readability`\n // Analyze the 2 colors and returns an object with the following properties:\n // `brightness`: difference in brightness between the two colors\n // `color`: difference in color/hue between the two colors\n tinycolor.readability = function(color1, color2) {\n var c1 = tinycolor(color1);\n var c2 = tinycolor(color2);\n var rgb1 = c1.toRgb();\n var rgb2 = c2.toRgb();\n var brightnessA = c1.getBrightness();\n var brightnessB = c2.getBrightness();\n var colorDiff =\n Math.max(rgb1.r, rgb2.r) -\n Math.min(rgb1.r, rgb2.r) +\n Math.max(rgb1.g, rgb2.g) -\n Math.min(rgb1.g, rgb2.g) +\n Math.max(rgb1.b, rgb2.b) -\n Math.min(rgb1.b, rgb2.b);\n\n return {\n brightness: Math.abs(brightnessA - brightnessB),\n color: colorDiff\n };\n };\n\n // `readable`\n // http://www.w3.org/TR/AERT#color-contrast\n // Ensure that foreground and background color combinations provide sufficient contrast.\n // *Example*\n // tinycolor.isReadable(\"#000\", \"#111\") => false\n tinycolor.isReadable = function(color1, color2) {\n var readability = tinycolor.readability(color1, color2);\n return readability.brightness > 125 && readability.color > 500;\n };\n\n // `mostReadable`\n // Given a base color and a list of possible foreground or background\n // colors for that base, returns the most readable color.\n // *Example*\n // tinycolor.mostReadable(\"#123\", [\"#fff\", \"#000\"]) => \"#000\"\n tinycolor.mostReadable = function(baseColor, colorList) {\n var bestColor = null;\n var bestScore = 0;\n var bestIsReadable = false;\n for (var i = 0; i < colorList.length; i++) {\n // We normalize both around the \"acceptable\" breaking point,\n // but rank brightness constrast higher than hue.\n\n var readability = tinycolor.readability(baseColor, colorList[i]);\n var readable = readability.brightness > 125 && readability.color > 500;\n var score = 3 * (readability.brightness / 125) + readability.color / 500;\n\n if (\n (readable && !bestIsReadable) ||\n (readable && bestIsReadable && score > bestScore) ||\n (!readable && !bestIsReadable && score > bestScore)\n ) {\n bestIsReadable = readable;\n bestScore = score;\n bestColor = tinycolor(colorList[i]);\n }\n }\n return bestColor;\n };\n\n // Big List of Colors\n // ------------------\n // \n var names = (tinycolor.names = {\n aliceblue: 'f0f8ff',\n antiquewhite: 'faebd7',\n aqua: '0ff',\n aquamarine: '7fffd4',\n azure: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '000',\n blanchedalmond: 'ffebcd',\n blue: '00f',\n blueviolet: '8a2be2',\n brown: 'a52a2a',\n burlywood: 'deb887',\n burntsienna: 'ea7e5d',\n cadetblue: '5f9ea0',\n chartreuse: '7fff00',\n chocolate: 'd2691e',\n coral: 'ff7f50',\n cornflowerblue: '6495ed',\n cornsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: '0ff',\n darkblue: '00008b',\n darkcyan: '008b8b',\n darkgoldenrod: 'b8860b',\n darkgray: 'a9a9a9',\n darkgreen: '006400',\n darkgrey: 'a9a9a9',\n darkkhaki: 'bdb76b',\n darkmagenta: '8b008b',\n darkolivegreen: '556b2f',\n darkorange: 'ff8c00',\n darkorchid: '9932cc',\n darkred: '8b0000',\n darksalmon: 'e9967a',\n darkseagreen: '8fbc8f',\n darkslateblue: '483d8b',\n darkslategray: '2f4f4f',\n darkslategrey: '2f4f4f',\n darkturquoise: '00ced1',\n darkviolet: '9400d3',\n deeppink: 'ff1493',\n deepskyblue: '00bfff',\n dimgray: '696969',\n dimgrey: '696969',\n dodgerblue: '1e90ff',\n firebrick: 'b22222',\n floralwhite: 'fffaf0',\n forestgreen: '228b22',\n fuchsia: 'f0f',\n gainsboro: 'dcdcdc',\n ghostwhite: 'f8f8ff',\n gold: 'ffd700',\n goldenrod: 'daa520',\n gray: '808080',\n green: '008000',\n greenyellow: 'adff2f',\n grey: '808080',\n honeydew: 'f0fff0',\n hotpink: 'ff69b4',\n indianred: 'cd5c5c',\n indigo: '4b0082',\n ivory: 'fffff0',\n khaki: 'f0e68c',\n lavender: 'e6e6fa',\n lavenderblush: 'fff0f5',\n lawngreen: '7cfc00',\n lemonchiffon: 'fffacd',\n lightblue: 'add8e6',\n lightcoral: 'f08080',\n lightcyan: 'e0ffff',\n lightgoldenrodyellow: 'fafad2',\n lightgray: 'd3d3d3',\n lightgreen: '90ee90',\n lightgrey: 'd3d3d3',\n lightpink: 'ffb6c1',\n lightsalmon: 'ffa07a',\n lightseagreen: '20b2aa',\n lightskyblue: '87cefa',\n lightslategray: '789',\n lightslategrey: '789',\n lightsteelblue: 'b0c4de',\n lightyellow: 'ffffe0',\n lime: '0f0',\n limegreen: '32cd32',\n linen: 'faf0e6',\n magenta: 'f0f',\n maroon: '800000',\n mediumaquamarine: '66cdaa',\n mediumblue: '0000cd',\n mediumorchid: 'ba55d3',\n mediumpurple: '9370db',\n mediumseagreen: '3cb371',\n mediumslateblue: '7b68ee',\n mediumspringgreen: '00fa9a',\n mediumturquoise: '48d1cc',\n mediumvioletred: 'c71585',\n midnightblue: '191970',\n mintcream: 'f5fffa',\n mistyrose: 'ffe4e1',\n moccasin: 'ffe4b5',\n navajowhite: 'ffdead',\n navy: '000080',\n oldlace: 'fdf5e6',\n olive: '808000',\n olivedrab: '6b8e23',\n orange: 'ffa500',\n orangered: 'ff4500',\n orchid: 'da70d6',\n palegoldenrod: 'eee8aa',\n palegreen: '98fb98',\n paleturquoise: 'afeeee',\n palevioletred: 'db7093',\n papayawhip: 'ffefd5',\n peachpuff: 'ffdab9',\n peru: 'cd853f',\n pink: 'ffc0cb',\n plum: 'dda0dd',\n powderblue: 'b0e0e6',\n purple: '800080',\n rebeccapurple: '663399',\n red: 'f00',\n rosybrown: 'bc8f8f',\n royalblue: '4169e1',\n saddlebrown: '8b4513',\n salmon: 'fa8072',\n sandybrown: 'f4a460',\n seagreen: '2e8b57',\n seashell: 'fff5ee',\n sienna: 'a0522d',\n silver: 'c0c0c0',\n skyblue: '87ceeb',\n slateblue: '6a5acd',\n slategray: '708090',\n slategrey: '708090',\n snow: 'fffafa',\n springgreen: '00ff7f',\n steelblue: '4682b4',\n tan: 'd2b48c',\n teal: '008080',\n thistle: 'd8bfd8',\n tomato: 'ff6347',\n turquoise: '40e0d0',\n violet: 'ee82ee',\n wheat: 'f5deb3',\n white: 'fff',\n whitesmoke: 'f5f5f5',\n yellow: 'ff0',\n yellowgreen: '9acd32'\n });\n\n // Make it easy to access colors via `hexNames[hex]`\n var hexNames = (tinycolor.hexNames = flip(names));\n\n // Utilities\n // ---------\n\n // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`\n function flip(o) {\n var flipped = {};\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n flipped[o[i]] = i;\n }\n }\n return flipped;\n }\n\n // Return a valid alpha value [0,1] with all invalid values being set to 1\n function boundAlpha(a) {\n a = parseFloat(a);\n\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n\n return a;\n }\n\n // Take input from [0, n] and return it as [0, 1]\n function bound01(n, max) {\n if (isOnePointZero(n)) {\n n = '100%';\n }\n\n var processPercent = isPercentage(n);\n n = mathMin(max, mathMax(0, parseFloat(n)));\n\n // Automatically convert percentage into number\n if (processPercent) {\n n = parseInt(n * max, 10) / 100;\n }\n\n // Handle floating point rounding errors\n if (math.abs(n - max) < 0.000001) {\n return 1;\n }\n\n // Convert into [0, 1] range if it isn't already\n return (n % max) / parseFloat(max);\n }\n\n // Force a number between 0 and 1\n function clamp01(val) {\n return mathMin(1, mathMax(0, val));\n }\n\n // Parse a base-16 hex value into a base-10 integer\n function parseIntFromHex(val) {\n return parseInt(val, 16);\n }\n\n // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n // \n function isOnePointZero(n) {\n return typeof n == 'string' && n.indexOf('.') != -1 && parseFloat(n) === 1;\n }\n\n // Check to see if string passed in is a percentage\n function isPercentage(n) {\n return typeof n === 'string' && n.indexOf('%') != -1;\n }\n\n // Force a hex value to have 2 characters\n function pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n }\n\n // Replace a decimal with it's percentage value\n function convertToPercentage(n) {\n if (n <= 1) {\n n = n * 100 + '%';\n }\n\n return n;\n }\n\n // Converts a decimal to a hex value\n function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }\n // Converts a hex value to a decimal\n function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n }\n\n var matchers = (function() {\n // \n var CSS_INTEGER = '[-\\\\+]?\\\\d+%?';\n\n // \n var CSS_NUMBER = '[-\\\\+]?\\\\d*\\\\.\\\\d+%?';\n\n // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\n var CSS_UNIT = '(?:' + CSS_NUMBER + ')|(?:' + CSS_INTEGER + ')';\n\n // Actual matching.\n // Parentheses and commas are optional, but not required.\n // Whitespace can take the place of commas or opening paren\n var PERMISSIVE_MATCH3 =\n '[\\\\s|\\\\(]+(' +\n CSS_UNIT +\n ')[,|\\\\s]+(' +\n CSS_UNIT +\n ')[,|\\\\s]+(' +\n CSS_UNIT +\n ')\\\\s*\\\\)?';\n var PERMISSIVE_MATCH4 =\n '[\\\\s|\\\\(]+(' +\n CSS_UNIT +\n ')[,|\\\\s]+(' +\n CSS_UNIT +\n ')[,|\\\\s]+(' +\n CSS_UNIT +\n ')[,|\\\\s]+(' +\n CSS_UNIT +\n ')\\\\s*\\\\)?';\n\n return {\n rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),\n rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),\n hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),\n hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),\n hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),\n hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),\n hex3: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex8: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n };\n })();\n\n // `stringInputToObject`\n // Permissive string parsing. Take in a number of formats, and output an object\n // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\n function stringInputToObject(color) {\n color = color\n .replace(trimLeft, '')\n .replace(trimRight, '')\n .toLowerCase();\n var named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n } else if (color == 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0, format: 'name' };\n }\n\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n var match;\n if ((match = matchers.rgb.exec(color))) {\n return { r: match[1], g: match[2], b: match[3] };\n }\n if ((match = matchers.rgba.exec(color))) {\n return { r: match[1], g: match[2], b: match[3], a: match[4] };\n }\n if ((match = matchers.hsl.exec(color))) {\n return { h: match[1], s: match[2], l: match[3] };\n }\n if ((match = matchers.hsla.exec(color))) {\n return { h: match[1], s: match[2], l: match[3], a: match[4] };\n }\n if ((match = matchers.hsv.exec(color))) {\n return { h: match[1], s: match[2], v: match[3] };\n }\n if ((match = matchers.hsva.exec(color))) {\n return { h: match[1], s: match[2], v: match[3], a: match[4] };\n }\n if ((match = matchers.hex8.exec(color))) {\n return {\n a: convertHexToDecimal(match[1]),\n r: parseIntFromHex(match[2]),\n g: parseIntFromHex(match[3]),\n b: parseIntFromHex(match[4]),\n format: named ? 'name' : 'hex8'\n };\n }\n if ((match = matchers.hex6.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n format: named ? 'name' : 'hex'\n };\n }\n if ((match = matchers.hex3.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n format: named ? 'name' : 'hex'\n };\n }\n\n return false;\n }\n\n window.tinycolor = tinycolor;\n //})();\n\n $(function() {\n if ($.fn.spectrum.load) {\n $.fn.spectrum.processNativeColorInputs();\n }\n });\n}\n","import promiseFinally from './finally';\nimport allSettled from './allSettled';\n\n// Store setTimeout reference so promise-polyfill will be unaffected by\n// other code modifying setTimeout (like sinon.useFakeTimers())\nvar setTimeoutFunc = setTimeout;\n\nfunction isArray(x) {\n return Boolean(x && typeof x.length !== 'undefined');\n}\n\nfunction noop() {}\n\n// Polyfill for Function.prototype.bind\nfunction bind(fn, thisArg) {\n return function() {\n fn.apply(thisArg, arguments);\n };\n}\n\n/**\n * @constructor\n * @param {Function} fn\n */\nfunction Promise(fn) {\n if (!(this instanceof Promise))\n throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function') throw new TypeError('not a function');\n /** @type {!number} */\n this._state = 0;\n /** @type {!boolean} */\n this._handled = false;\n /** @type {Promise|undefined} */\n this._value = undefined;\n /** @type {!Array} */\n this._deferreds = [];\n\n doResolve(fn, this);\n}\n\nfunction handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function() {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n}\n\nfunction resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n}\n\nfunction reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n}\n\nfunction finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function() {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n}\n\n/**\n * @constructor\n */\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n // @ts-ignore\n var prom = new this.constructor(noop);\n\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n};\n\nPromise.prototype['finally'] = promiseFinally;\n\nPromise.all = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.all accepts an array'));\n }\n\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n reject\n );\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.allSettled = allSettled;\n\nPromise.resolve = function(value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n\n return new Promise(function(resolve) {\n resolve(value);\n });\n};\n\nPromise.reject = function(value) {\n return new Promise(function(resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.race accepts an array'));\n }\n\n for (var i = 0, len = arr.length; i < len; i++) {\n Promise.resolve(arr[i]).then(resolve, reject);\n }\n });\n};\n\n// Use polyfill for setImmediate for performance gains\nPromise._immediateFn =\n // @ts-ignore\n (typeof setImmediate === 'function' &&\n function(fn) {\n // @ts-ignore\n setImmediate(fn);\n }) ||\n function(fn) {\n setTimeoutFunc(fn, 0);\n };\n\nPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n};\n\nexport default Promise;\n","import { Model } from 'common';\nimport { result, forEach, isEmpty, isString } from 'underscore';\nimport { isComponent, isObject } from 'utils/mixins';\n\nconst keyAutoW = '__aw';\nconst keyAutoH = '__ah';\n\n/**\n * @property {Object|String} component Wrapper component definition. You can also pass an HTML string as components of the default wrapper component.\n * @property {String} [width=''] Width of the frame. By default, the canvas width will be taken.\n * @property {String} [height=''] Height of the frame. By default, the canvas height will be taken.\n * @property {Number} [x=0] Horizontal position of the frame in the canvas.\n * @property {Number} [y=0] Vertical position of the frame in the canvas.\n *\n */\nexport default class Frame extends Model {\n defaults() {\n return {\n x: 0,\n y: 0,\n changesCount: 0,\n attributes: {},\n width: null,\n height: null,\n head: [],\n component: '',\n styles: '',\n _undo: true,\n _undoexc: ['changesCount']\n };\n }\n\n initialize(props, opts = {}) {\n const { config } = opts;\n const { em } = config;\n const { styles, component } = this.attributes;\n const domc = em.get('DomComponents');\n const conf = domc.getConfig();\n const allRules = em.get('CssComposer').getAll();\n const idMap = {};\n this.em = em;\n const modOpts = { em, config: conf, frame: this, idMap };\n\n if (!isComponent(component)) {\n const wrp = isObject(component) ? component : { components: component };\n !wrp.type && (wrp.type = 'wrapper');\n const Wrapper = domc.getType('wrapper').model;\n this.set('component', new Wrapper(wrp, modOpts));\n }\n\n if (!styles) {\n this.set('styles', allRules);\n } else if (!isObject(styles)) {\n // Avoid losing styles on remapped components\n const idMapKeys = Object.keys(idMap);\n if (idMapKeys.length && Array.isArray(styles)) {\n styles.forEach(style => {\n const sel = style.selectors;\n if (sel && sel.length == 1) {\n const sSel = sel[0];\n const idSel = sSel.name && sSel.type === 2 && sSel;\n if (idSel && idMap[idSel.name]) {\n idSel.name = idMap[idSel.name];\n } else if (isString(sSel) && sSel[0] === '#') {\n const prevId = sSel.substring(1);\n if (prevId && idMap[prevId]) {\n sel[0] = `#${idMap[prevId]}`;\n }\n }\n }\n });\n }\n\n allRules.add(styles);\n this.set('styles', allRules);\n }\n\n !props.width && this.set(keyAutoW, 1);\n !props.height && this.set(keyAutoH, 1);\n }\n\n onRemove() {\n this.getComponent().remove({ root: 1 });\n }\n\n changesUp(opt = {}) {\n if (opt.temporary || opt.noCount || opt.avoidStore) {\n return;\n }\n this.set('changesCount', this.get('changesCount') + 1);\n }\n\n getComponent() {\n return this.get('component');\n }\n\n getStyles() {\n return this.get('styles');\n }\n\n disable() {\n this.trigger('disable');\n }\n\n remove() {\n this.view = 0;\n const coll = this.collection;\n return coll && coll.remove(this);\n }\n\n getHead() {\n const head = this.get('head') || [];\n return [...head];\n }\n\n setHead(value) {\n return this.set('head', [...value]);\n }\n\n addHeadItem(item) {\n const head = this.getHead();\n head.push(item);\n this.setHead(head);\n }\n\n getHeadByAttr(attr, value, tag) {\n const head = this.getHead();\n return head.filter(\n item =>\n item.attributes &&\n item.attributes[attr] == value &&\n (!tag || tag === item.tag)\n )[0];\n }\n\n removeHeadByAttr(attr, value, tag) {\n const head = this.getHead();\n const item = this.getHeadByAttr(attr, value, tag);\n const index = head.indexOf(item);\n\n if (index >= 0) {\n head.splice(index, 1);\n this.setHead(head);\n }\n }\n\n addLink(href) {\n const tag = 'link';\n !this.getHeadByAttr('href', href, tag) &&\n this.addHeadItem({\n tag,\n attributes: {\n href,\n rel: 'stylesheet'\n }\n });\n }\n\n removeLink(href) {\n this.removeHeadByAttr('href', href, 'link');\n }\n\n addScript(src) {\n const tag = 'script';\n !this.getHeadByAttr('src', src, tag) &&\n this.addHeadItem({\n tag,\n attributes: { src }\n });\n }\n\n removeScript(src) {\n this.removeHeadByAttr('src', src, 'script');\n }\n\n getPage() {\n const coll = this.collection;\n return coll && coll.page;\n }\n\n _emitUpdated(data = {}) {\n this.em.trigger('frame:updated', { frame: this, ...data });\n }\n\n toJSON(opts = {}) {\n const obj = Model.prototype.toJSON.call(this, opts);\n const { em } = this;\n const sm = em && em.get('StorageManager');\n const smc = sm && sm.getConfig();\n const defaults = result(this, 'defaults');\n\n if (smc && !opts.fromUndo) {\n const opts = { component: this.getComponent() };\n if (smc.storeHtml) obj.html = em.getHtml(opts);\n if (smc.storeCss) obj.css = em.getCss(opts);\n }\n\n if (opts.fromUndo) delete obj.component;\n delete obj.styles;\n delete obj.changesCount;\n obj[keyAutoW] && delete obj.width;\n obj[keyAutoH] && delete obj.height;\n\n // Remove private keys\n forEach(obj, (value, key) => {\n key.indexOf('_') === 0 && delete obj[key];\n });\n\n forEach(defaults, (value, key) => {\n if (obj[key] === value) delete obj[key];\n });\n\n forEach(['attributes', 'head'], prop => {\n if (isEmpty(obj[prop])) delete obj[prop];\n });\n\n return obj;\n }\n}\n","import { bindAll } from 'underscore';\nimport { Collection } from 'common';\nimport model from './Frame';\n\nexport default class Frames extends Collection {\n initialize(models, config = {}) {\n bindAll(this, 'itemLoaded');\n this.config = config;\n this.on('reset', this.onReset);\n this.on('remove', this.onRemove);\n }\n\n onReset(m, opts = {}) {\n const prev = opts.previousModels || [];\n prev.map(p => this.onRemove(p));\n }\n\n onRemove(removed) {\n removed && removed.onRemove();\n }\n\n itemLoaded() {\n this.loadedItems++;\n\n if (this.loadedItems >= this.itemsToLoad) {\n this.trigger('loaded:all');\n this.listenToLoadItems(0);\n }\n }\n\n listenToLoad() {\n this.loadedItems = 0;\n this.itemsToLoad = this.length;\n this.listenToLoadItems(1);\n }\n\n listenToLoadItems(on) {\n this.forEach(item => item[on ? 'on' : 'off']('loaded', this.itemLoaded));\n }\n\n add(m, o = {}) {\n const { config } = this;\n return Collection.prototype.add.call(this, m, { ...o, config });\n }\n}\n\nFrames.prototype.model = model;\n","import { Model } from 'common';\nimport { result, forEach } from 'underscore';\nimport Frames from 'canvas/model/Frames';\n\nexport default class Page extends Model {\n defaults() {\n return {\n frames: [],\n _undo: true\n };\n }\n\n initialize(props, opts = {}) {\n const { config = {} } = opts;\n const { em } = config;\n const defFrame = {};\n this.em = em;\n if (!props.frames) {\n defFrame.component = props.component;\n defFrame.styles = props.styles;\n ['component', 'styles'].map(i => this.unset(i));\n }\n const frms = props.frames || [defFrame];\n const frames = new Frames(frms, config);\n frames.page = this;\n this.set('frames', frames);\n const um = em && em.get('UndoManager');\n um && um.add(frames);\n }\n\n onRemove() {\n this.get('frames').reset();\n }\n\n getFrames() {\n return this.get('frames');\n }\n\n /**\n * Get page id\n * @returns {String}\n */\n getId() {\n return this.id;\n }\n\n /**\n * Get page name\n * @returns {String}\n */\n getName() {\n return this.get('name');\n }\n\n /**\n * Update page name\n * @param {String} name New page name\n * @example\n * page.setName('New name');\n */\n setName(name) {\n return this.get({ name });\n }\n\n /**\n * Get all frames\n * @returns {Array}\n * @example\n * const arrayOfFrames = page.getAllFrames();\n */\n getAllFrames() {\n return this.getFrames().models || [];\n }\n\n /**\n * Get the first frame of the page (identified always as the main one)\n * @returns {Frame}\n * @example\n * const mainFrame = page.getMainFrame();\n */\n getMainFrame() {\n return this.getFrames().at(0);\n }\n\n /**\n * Get the root component (usually is the `wrapper` component) from the main frame\n * @returns {Component}\n * @example\n * const rootComponent = page.getMainComponent();\n * console.log(rootComponent.toHTML());\n */\n getMainComponent() {\n const frame = this.getMainFrame();\n return frame && frame.getComponent();\n }\n\n toJSON(opts = {}) {\n const obj = Model.prototype.toJSON.call(this, opts);\n const defaults = result(this, 'defaults');\n\n // Remove private keys\n forEach(obj, (value, key) => {\n key.indexOf('_') === 0 && delete obj[key];\n });\n\n forEach(defaults, (value, key) => {\n if (obj[key] === value) delete obj[key];\n });\n\n return obj;\n }\n}\n","import { Collection } from 'backbone';\nimport Page from './Page';\n\nexport default class Pages extends Collection {\n initialize(models, config = {}) {\n this.config = config;\n this.on('reset', this.onReset);\n this.on('remove', this.onRemove);\n }\n\n onReset(m, opts = {}) {\n const prev = opts.previousModels || [];\n prev.map(p => this.onRemove(p));\n }\n\n onRemove(removed) {\n removed && removed.onRemove();\n }\n\n add(m, o = {}) {\n const { config } = this;\n return Collection.prototype.add.call(this, m, { ...o, config });\n }\n}\n\nPages.prototype.model = Page;\n","/**\n * You can customize the initial state of the module from the editor initialization\n * ```js\n * const editor = grapesjs.init({\n * ....\n * pageManager: {\n * pages: [\n * {\n * id: 'page-id',\n * styles: `.my-class { color: red }`, // or a JSON of styles\n * component: '
My element
', // or a JSON of components\n * }\n * ]\n * },\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const pageManager = editor.Pages;\n * ```\n *\n * ## Available Events\n * * `page:add` - Added new page. The page is passed as an argument to the callback\n * * `page:remove` - Page removed. The page is passed as an argument to the callback\n * * `page:select` - New page selected. The newly selected page and the previous one, are passed as arguments to the callback\n * * `page:update` - Page updated. The updated page and the object containing changes are passed as arguments to the callback\n * * `page` - Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback\n *\n * ## Methods\n * * [add](#add)\n * * [get](#get)\n * * [getAll](#getall)\n * * [getAllWrappers](#getallwrappers)\n * * [getMain](#getmain)\n * * [remove](#remove)\n * * [select](#select)\n * * [getSelected](#getselected)\n *\n * [Page]: page.html\n * [Component]: component.html\n *\n * @module Pages\n */\n\nimport { isString, bindAll, unique, flatten } from 'underscore';\nimport { createId } from 'utils/mixins';\nimport { Model } from 'backbone';\nimport Pages from './model/Pages';\nimport Page from './model/Page';\n\nexport const evAll = 'page';\nexport const evPfx = `${evAll}:`;\nexport const evPageSelect = `${evPfx}select`;\nexport const evPageSelectBefore = `${evPageSelect}:before`;\nexport const evPageUpdate = `${evPfx}update`;\nexport const evPageAdd = `${evPfx}add`;\nexport const evPageAddBefore = `${evPageAdd}:before`;\nexport const evPageRemove = `${evPfx}remove`;\nexport const evPageRemoveBefore = `${evPageRemove}:before`;\nconst chnSel = 'change:selected';\nconst typeMain = 'main';\n\nexport default () => {\n return {\n name: 'PageManager',\n\n storageKey: 'pages',\n\n Page,\n\n Pages,\n\n events: {\n all: evAll,\n select: evPageSelect,\n selectBefore: evPageSelectBefore,\n update: evPageUpdate,\n add: evPageAdd,\n addBefore: evPageAddBefore,\n remove: evPageRemove,\n removeBefore: evPageRemoveBefore\n },\n\n /**\n * Initialize module\n * @param {Object} config Configurations\n * @private\n */\n init(opts = {}) {\n bindAll(this, '_onPageChange');\n const { em } = opts;\n const cnf = { ...opts };\n this.config = cnf;\n this.em = em;\n const pages = new Pages([], cnf);\n this.pages = pages;\n const model = new Model({ _undo: true });\n this.model = model;\n pages.on('add', (p, c, o) => em.trigger(evPageAdd, p, o));\n pages.on('remove', (p, c, o) => em.trigger(evPageRemove, p, o));\n pages.on('change', (p, c) => {\n em.trigger(evPageUpdate, p, p.changedAttributes(), c);\n });\n pages.on('reset', coll => coll.at(0) && this.select(coll.at(0)));\n pages.on('all', this.__onChange, this);\n model.on(chnSel, this._onPageChange);\n\n return this;\n },\n\n __onChange(event, page, coll, opts) {\n const options = opts || coll;\n this.em.trigger(evAll, { event, page, options });\n },\n\n onLoad() {\n const { pages } = this;\n const opt = { silent: true };\n pages.add(this.config.pages || [], opt);\n const mainPage = !pages.length\n ? this.add({ type: typeMain }, opt)\n : this.getMain();\n this.select(mainPage, opt);\n },\n\n _onPageChange(m, page, opts) {\n const { em } = this;\n const lm = em.get('LayerManager');\n const mainComp = page.getMainComponent();\n lm && mainComp && lm.setRoot(mainComp);\n em.trigger(evPageSelect, page, m.previous('selected'));\n this.__onChange(chnSel, page, opts);\n },\n\n postLoad() {\n const { em, model } = this;\n const um = em.get('UndoManager');\n um && um.add(model);\n um && um.add(this.pages);\n },\n\n /**\n * Add new page\n * @param {Object} props Page properties\n * @param {Object} [opts] Options\n * @returns {[Page]}\n * @example\n * const newPage = pageManager.add({\n * id: 'new-page-id', // without an explicit ID, a random one will be created\n * styles: `.my-class { color: red }`, // or a JSON of styles\n * component: '
My element
', // or a JSON of components\n * });\n */\n add(props, opts = {}) {\n const { em } = this;\n props.id = props.id || this._createId();\n const add = () => {\n const page = this.pages.add(props, opts);\n opts.select && this.select(page);\n return page;\n };\n !opts.silent && em.trigger(evPageAddBefore, props, add, opts);\n return !opts.abort && add();\n },\n\n /**\n * Remove page\n * @param {String|[Page]} page Page or page id\n * @returns {[Page]} Removed Page\n * @example\n * const removedPage = pageManager.remove('page-id');\n * // or by passing the page\n * const somePage = pageManager.get('page-id');\n * pageManager.remove(somePage);\n */\n remove(page, opts = {}) {\n const { em } = this;\n const pg = isString(page) ? this.get(page) : page;\n const rm = () => {\n pg && this.pages.remove(pg, opts);\n return pg;\n };\n !opts.silent && em.trigger(evPageRemoveBefore, pg, rm, opts);\n return !opts.abort && rm();\n },\n\n /**\n * Get page by id\n * @param {String} id Page id\n * @returns {[Page]}\n * @example\n * const somePage = pageManager.get('page-id');\n */\n get(id) {\n return this.pages.filter(p => p.get('id') === id)[0];\n },\n\n /**\n * Get main page (the first one available)\n * @returns {[Page]}\n * @example\n * const mainPage = pageManager.getMain();\n */\n getMain() {\n const { pages } = this;\n return pages.filter(p => p.get('type') === typeMain)[0] || pages.at(0);\n },\n\n /**\n * Get all pages\n * @returns {Array<[Page]>}\n * @example\n * const arrayOfPages = pageManager.getAll();\n */\n getAll() {\n return [...this.pages.models];\n },\n\n /**\n * Get wrapper components (aka body) from all pages and frames.\n * @returns {Array<[Component]>}\n * @example\n * const wrappers = pageManager.getAllWrappers();\n * // Get all `image` components from the project\n * const allImages = wrappers.map(wrp => wrp.findType('image')).flat();\n */\n getAllWrappers() {\n const pages = this.getAll();\n return unique(\n flatten(\n pages.map(page =>\n page.getAllFrames().map(frame => frame.getComponent())\n )\n )\n );\n },\n\n getAllMap() {\n return this.getAll().reduce((acc, i) => {\n acc[i.get('id')] = i;\n return acc;\n }, {});\n },\n\n /**\n * Change the selected page. This will switch the page rendered in canvas\n * @param {String|[Page]} page Page or page id\n * @returns {this}\n * @example\n * pageManager.select('page-id');\n * // or by passing the page\n * const somePage = pageManager.get('page-id');\n * pageManager.select(somePage);\n */\n select(page, opts = {}) {\n const pg = isString(page) ? this.get(page) : page;\n if (pg) {\n this.em.trigger(evPageSelectBefore, pg, opts);\n this.model.set('selected', pg, opts);\n }\n return this;\n },\n\n /**\n * Get the selected page\n * @returns {[Page]}\n * @example\n * const selectedPage = pageManager.getSelected();\n */\n getSelected() {\n return this.model.get('selected');\n },\n\n destroy() {\n this.pages.off().reset();\n this.model.stopListening();\n this.model.clear({ silent: true });\n ['selected', 'config', 'em', 'pages', 'model'].map(i => (this[i] = 0));\n },\n\n store(noStore) {\n if (!this.em.get('hasPages')) return {};\n const obj = {};\n const cnf = this.config;\n obj[this.storageKey] = JSON.stringify(this.getAll());\n if (!noStore && cnf.stm) cnf.stm.store(obj);\n return obj;\n },\n\n load(data = {}) {\n const key = this.storageKey;\n let res = data[key] || [];\n\n if (typeof res == 'string') {\n try {\n res = JSON.parse(data[key]);\n } catch (err) {}\n }\n\n res && res.length && this.pages.reset(res);\n\n return res;\n },\n\n _createId() {\n const pages = this.getAll();\n const len = pages.length + 16;\n const pagesMap = this.getAllMap();\n let id;\n\n do {\n id = createId(len);\n } while (pagesMap[id]);\n\n return id;\n }\n };\n};\n","import Backbone from 'backbone';\n\nexport default Backbone.Model.extend({\n defaults: {\n id: '',\n label: '',\n tagName: 'span',\n className: '',\n command: '',\n context: '',\n buttons: [],\n attributes: {},\n options: {},\n active: false,\n dragDrop: false,\n togglable: true,\n runDefaultCommand: true,\n stopDefaultCommand: false,\n disable: false\n },\n\n initialize(options) {\n if (this.get('buttons').length) {\n var Buttons = require('./Buttons').default;\n this.set('buttons', new Buttons(this.get('buttons')));\n }\n }\n});\n","import Backbone from 'backbone';\nimport Button from './Button';\n\nexport default Backbone.Collection.extend({\n model: Button,\n\n /**\n * Deactivate all buttons, except one passed\n * @param {Object} except Model to ignore\n * @param {Boolean} r Recursive flag\n *\n * @return void\n * */\n deactivateAllExceptOne(except, r) {\n this.forEach((model, index) => {\n if (model !== except) {\n model.set('active', false);\n if (r && model.get('buttons').length)\n model.get('buttons').deactivateAllExceptOne(except, r);\n }\n });\n },\n\n /**\n * Deactivate all buttons\n * @param {String} ctx Context string\n *\n * @return void\n * */\n deactivateAll(ctx, sender) {\n const context = ctx || '';\n this.forEach(model => {\n if (model.get('context') == context && model !== sender) {\n model.set('active', false, { fromCollection: 1 });\n }\n });\n },\n\n /**\n * Disables all buttons\n * @param {String} ctx Context string\n *\n * @return void\n * */\n disableAllButtons(ctx) {\n var context = ctx || '';\n this.forEach((model, index) => {\n if (model.get('context') == context) {\n model.set('disable', true);\n }\n });\n },\n\n /**\n * Disables all buttons, except one passed\n * @param {Object} except Model to ignore\n * @param {Boolean} r Recursive flag\n *\n * @return void\n * */\n disableAllButtonsExceptOne(except, r) {\n this.forEach((model, index) => {\n if (model !== except) {\n model.set('disable', true);\n if (r && model.get('buttons').length)\n model.get('buttons').disableAllButtonsExceptOne(except, r);\n }\n });\n }\n});\n","function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"css\", function(config, parserConfig) {\n var inline = parserConfig.inline\n if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode(\"text/css\");\n\n var indentUnit = config.indentUnit,\n tokenHooks = parserConfig.tokenHooks,\n documentTypes = parserConfig.documentTypes || {},\n mediaTypes = parserConfig.mediaTypes || {},\n mediaFeatures = parserConfig.mediaFeatures || {},\n mediaValueKeywords = parserConfig.mediaValueKeywords || {},\n propertyKeywords = parserConfig.propertyKeywords || {},\n nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {},\n fontProperties = parserConfig.fontProperties || {},\n counterDescriptors = parserConfig.counterDescriptors || {},\n colorKeywords = parserConfig.colorKeywords || {},\n valueKeywords = parserConfig.valueKeywords || {},\n allowNested = parserConfig.allowNested,\n lineComment = parserConfig.lineComment,\n supportsAtComponent = parserConfig.supportsAtComponent === true,\n highlightNonStandardPropertyKeywords = config.highlightNonStandardPropertyKeywords !== false;\n\n var type, override;\n function ret(style, tp) { type = tp; return style; }\n\n // Tokenizers\n\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (tokenHooks[ch]) {\n var result = tokenHooks[ch](stream, state);\n if (result !== false) return result;\n }\n if (ch == \"@\") {\n stream.eatWhile(/[\\w\\\\\\-]/);\n return ret(\"def\", stream.current());\n } else if (ch == \"=\" || (ch == \"~\" || ch == \"|\") && stream.eat(\"=\")) {\n return ret(null, \"compare\");\n } else if (ch == \"\\\"\" || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n } else if (ch == \"#\") {\n stream.eatWhile(/[\\w\\\\\\-]/);\n return ret(\"atom\", \"hash\");\n } else if (ch == \"!\") {\n stream.match(/^\\s*\\w*/);\n return ret(\"keyword\", \"important\");\n } else if (/\\d/.test(ch) || ch == \".\" && stream.eat(/\\d/)) {\n stream.eatWhile(/[\\w.%]/);\n return ret(\"number\", \"unit\");\n } else if (ch === \"-\") {\n if (/[\\d.]/.test(stream.peek())) {\n stream.eatWhile(/[\\w.%]/);\n return ret(\"number\", \"unit\");\n } else if (stream.match(/^-[\\w\\\\\\-]*/)) {\n stream.eatWhile(/[\\w\\\\\\-]/);\n if (stream.match(/^\\s*:/, false))\n return ret(\"variable-2\", \"variable-definition\");\n return ret(\"variable-2\", \"variable\");\n } else if (stream.match(/^\\w+-/)) {\n return ret(\"meta\", \"meta\");\n }\n } else if (/[,+>*\\/]/.test(ch)) {\n return ret(null, \"select-op\");\n } else if (ch == \".\" && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {\n return ret(\"qualifier\", \"qualifier\");\n } else if (/[:;{}\\[\\]\\(\\)]/.test(ch)) {\n return ret(null, ch);\n } else if (stream.match(/^[\\w-.]+(?=\\()/)) {\n if (/^(url(-prefix)?|domain|regexp)$/i.test(stream.current())) {\n state.tokenize = tokenParenthesized;\n }\n return ret(\"variable callee\", \"variable\");\n } else if (/[\\w\\\\\\-]/.test(ch)) {\n stream.eatWhile(/[\\w\\\\\\-]/);\n return ret(\"property\", \"word\");\n } else {\n return ret(null, null);\n }\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, ch;\n while ((ch = stream.next()) != null) {\n if (ch == quote && !escaped) {\n if (quote == \")\") stream.backUp(1);\n break;\n }\n escaped = !escaped && ch == \"\\\\\";\n }\n if (ch == quote || !escaped && quote != \")\") state.tokenize = null;\n return ret(\"string\", \"string\");\n };\n }\n\n function tokenParenthesized(stream, state) {\n stream.next(); // Must be '('\n if (!stream.match(/^\\s*[\\\"\\')]/, false))\n state.tokenize = tokenString(\")\");\n else\n state.tokenize = null;\n return ret(null, \"(\");\n }\n\n // Context management\n\n function Context(type, indent, prev) {\n this.type = type;\n this.indent = indent;\n this.prev = prev;\n }\n\n function pushContext(state, stream, type, indent) {\n state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context);\n return type;\n }\n\n function popContext(state) {\n if (state.context.prev)\n state.context = state.context.prev;\n return state.context.type;\n }\n\n function pass(type, stream, state) {\n return states[state.context.type](type, stream, state);\n }\n function popAndPass(type, stream, state, n) {\n for (var i = n || 1; i > 0; i--)\n state.context = state.context.prev;\n return pass(type, stream, state);\n }\n\n // Parser\n\n function wordAsValue(stream) {\n var word = stream.current().toLowerCase();\n if (valueKeywords.hasOwnProperty(word))\n override = \"atom\";\n else if (colorKeywords.hasOwnProperty(word))\n override = \"keyword\";\n else\n override = \"variable\";\n }\n\n var states = {};\n\n states.top = function(type, stream, state) {\n if (type == \"{\") {\n return pushContext(state, stream, \"block\");\n } else if (type == \"}\" && state.context.prev) {\n return popContext(state);\n } else if (supportsAtComponent && /@component/i.test(type)) {\n return pushContext(state, stream, \"atComponentBlock\");\n } else if (/^@(-moz-)?document$/i.test(type)) {\n return pushContext(state, stream, \"documentTypes\");\n } else if (/^@(media|supports|(-moz-)?document|import)$/i.test(type)) {\n return pushContext(state, stream, \"atBlock\");\n } else if (/^@(font-face|counter-style)/i.test(type)) {\n state.stateArg = type;\n return \"restricted_atBlock_before\";\n } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(type)) {\n return \"keyframes\";\n } else if (type && type.charAt(0) == \"@\") {\n return pushContext(state, stream, \"at\");\n } else if (type == \"hash\") {\n override = \"builtin\";\n } else if (type == \"word\") {\n override = \"tag\";\n } else if (type == \"variable-definition\") {\n return \"maybeprop\";\n } else if (type == \"interpolation\") {\n return pushContext(state, stream, \"interpolation\");\n } else if (type == \":\") {\n return \"pseudo\";\n } else if (allowNested && type == \"(\") {\n return pushContext(state, stream, \"parens\");\n }\n return state.context.type;\n };\n\n states.block = function(type, stream, state) {\n if (type == \"word\") {\n var word = stream.current().toLowerCase();\n if (propertyKeywords.hasOwnProperty(word)) {\n override = \"property\";\n return \"maybeprop\";\n } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) {\n override = highlightNonStandardPropertyKeywords ? \"string-2\" : \"property\";\n return \"maybeprop\";\n } else if (allowNested) {\n override = stream.match(/^\\s*:(?:\\s|$)/, false) ? \"property\" : \"tag\";\n return \"block\";\n } else {\n override += \" error\";\n return \"maybeprop\";\n }\n } else if (type == \"meta\") {\n return \"block\";\n } else if (!allowNested && (type == \"hash\" || type == \"qualifier\")) {\n override = \"error\";\n return \"block\";\n } else {\n return states.top(type, stream, state);\n }\n };\n\n states.maybeprop = function(type, stream, state) {\n if (type == \":\") return pushContext(state, stream, \"prop\");\n return pass(type, stream, state);\n };\n\n states.prop = function(type, stream, state) {\n if (type == \";\") return popContext(state);\n if (type == \"{\" && allowNested) return pushContext(state, stream, \"propBlock\");\n if (type == \"}\" || type == \"{\") return popAndPass(type, stream, state);\n if (type == \"(\") return pushContext(state, stream, \"parens\");\n\n if (type == \"hash\" && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) {\n override += \" error\";\n } else if (type == \"word\") {\n wordAsValue(stream);\n } else if (type == \"interpolation\") {\n return pushContext(state, stream, \"interpolation\");\n }\n return \"prop\";\n };\n\n states.propBlock = function(type, _stream, state) {\n if (type == \"}\") return popContext(state);\n if (type == \"word\") { override = \"property\"; return \"maybeprop\"; }\n return state.context.type;\n };\n\n states.parens = function(type, stream, state) {\n if (type == \"{\" || type == \"}\") return popAndPass(type, stream, state);\n if (type == \")\") return popContext(state);\n if (type == \"(\") return pushContext(state, stream, \"parens\");\n if (type == \"interpolation\") return pushContext(state, stream, \"interpolation\");\n if (type == \"word\") wordAsValue(stream);\n return \"parens\";\n };\n\n states.pseudo = function(type, stream, state) {\n if (type == \"meta\") return \"pseudo\";\n\n if (type == \"word\") {\n override = \"variable-3\";\n return state.context.type;\n }\n return pass(type, stream, state);\n };\n\n states.documentTypes = function(type, stream, state) {\n if (type == \"word\" && documentTypes.hasOwnProperty(stream.current())) {\n override = \"tag\";\n return state.context.type;\n } else {\n return states.atBlock(type, stream, state);\n }\n };\n\n states.atBlock = function(type, stream, state) {\n if (type == \"(\") return pushContext(state, stream, \"atBlock_parens\");\n if (type == \"}\" || type == \";\") return popAndPass(type, stream, state);\n if (type == \"{\") return popContext(state) && pushContext(state, stream, allowNested ? \"block\" : \"top\");\n\n if (type == \"interpolation\") return pushContext(state, stream, \"interpolation\");\n\n if (type == \"word\") {\n var word = stream.current().toLowerCase();\n if (word == \"only\" || word == \"not\" || word == \"and\" || word == \"or\")\n override = \"keyword\";\n else if (mediaTypes.hasOwnProperty(word))\n override = \"attribute\";\n else if (mediaFeatures.hasOwnProperty(word))\n override = \"property\";\n else if (mediaValueKeywords.hasOwnProperty(word))\n override = \"keyword\";\n else if (propertyKeywords.hasOwnProperty(word))\n override = \"property\";\n else if (nonStandardPropertyKeywords.hasOwnProperty(word))\n override = highlightNonStandardPropertyKeywords ? \"string-2\" : \"property\";\n else if (valueKeywords.hasOwnProperty(word))\n override = \"atom\";\n else if (colorKeywords.hasOwnProperty(word))\n override = \"keyword\";\n else\n override = \"error\";\n }\n return state.context.type;\n };\n\n states.atComponentBlock = function(type, stream, state) {\n if (type == \"}\")\n return popAndPass(type, stream, state);\n if (type == \"{\")\n return popContext(state) && pushContext(state, stream, allowNested ? \"block\" : \"top\", false);\n if (type == \"word\")\n override = \"error\";\n return state.context.type;\n };\n\n states.atBlock_parens = function(type, stream, state) {\n if (type == \")\") return popContext(state);\n if (type == \"{\" || type == \"}\") return popAndPass(type, stream, state, 2);\n return states.atBlock(type, stream, state);\n };\n\n states.restricted_atBlock_before = function(type, stream, state) {\n if (type == \"{\")\n return pushContext(state, stream, \"restricted_atBlock\");\n if (type == \"word\" && state.stateArg == \"@counter-style\") {\n override = \"variable\";\n return \"restricted_atBlock_before\";\n }\n return pass(type, stream, state);\n };\n\n states.restricted_atBlock = function(type, stream, state) {\n if (type == \"}\") {\n state.stateArg = null;\n return popContext(state);\n }\n if (type == \"word\") {\n if ((state.stateArg == \"@font-face\" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) ||\n (state.stateArg == \"@counter-style\" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase())))\n override = \"error\";\n else\n override = \"property\";\n return \"maybeprop\";\n }\n return \"restricted_atBlock\";\n };\n\n states.keyframes = function(type, stream, state) {\n if (type == \"word\") { override = \"variable\"; return \"keyframes\"; }\n if (type == \"{\") return pushContext(state, stream, \"top\");\n return pass(type, stream, state);\n };\n\n states.at = function(type, stream, state) {\n if (type == \";\") return popContext(state);\n if (type == \"{\" || type == \"}\") return popAndPass(type, stream, state);\n if (type == \"word\") override = \"tag\";\n else if (type == \"hash\") override = \"builtin\";\n return \"at\";\n };\n\n states.interpolation = function(type, stream, state) {\n if (type == \"}\") return popContext(state);\n if (type == \"{\" || type == \";\") return popAndPass(type, stream, state);\n if (type == \"word\") override = \"variable\";\n else if (type != \"variable\" && type != \"(\" && type != \")\") override = \"error\";\n return \"interpolation\";\n };\n\n return {\n startState: function(base) {\n return {tokenize: null,\n state: inline ? \"block\" : \"top\",\n stateArg: null,\n context: new Context(inline ? \"block\" : \"top\", base || 0, null)};\n },\n\n token: function(stream, state) {\n if (!state.tokenize && stream.eatSpace()) return null;\n var style = (state.tokenize || tokenBase)(stream, state);\n if (style && typeof style == \"object\") {\n type = style[1];\n style = style[0];\n }\n override = style;\n if (type != \"comment\")\n state.state = states[state.state](type, stream, state);\n return override;\n },\n\n indent: function(state, textAfter) {\n var cx = state.context, ch = textAfter && textAfter.charAt(0);\n var indent = cx.indent;\n if (cx.type == \"prop\" && (ch == \"}\" || ch == \")\")) cx = cx.prev;\n if (cx.prev) {\n if (ch == \"}\" && (cx.type == \"block\" || cx.type == \"top\" ||\n cx.type == \"interpolation\" || cx.type == \"restricted_atBlock\")) {\n // Resume indentation from parent context.\n cx = cx.prev;\n indent = cx.indent;\n } else if (ch == \")\" && (cx.type == \"parens\" || cx.type == \"atBlock_parens\") ||\n ch == \"{\" && (cx.type == \"at\" || cx.type == \"atBlock\")) {\n // Dedent relative to current context.\n indent = Math.max(0, cx.indent - indentUnit);\n }\n }\n return indent;\n },\n\n electricChars: \"}\",\n blockCommentStart: \"/*\",\n blockCommentEnd: \"*/\",\n blockCommentContinue: \" * \",\n lineComment: lineComment,\n fold: \"brace\"\n };\n});\n\n function keySet(array) {\n var keys = {};\n for (var i = 0; i < array.length; ++i) {\n keys[array[i].toLowerCase()] = true;\n }\n return keys;\n }\n\n var documentTypes_ = [\n \"domain\", \"regexp\", \"url\", \"url-prefix\"\n ], documentTypes = keySet(documentTypes_);\n\n var mediaTypes_ = [\n \"all\", \"aural\", \"braille\", \"handheld\", \"print\", \"projection\", \"screen\",\n \"tty\", \"tv\", \"embossed\"\n ], mediaTypes = keySet(mediaTypes_);\n\n var mediaFeatures_ = [\n \"width\", \"min-width\", \"max-width\", \"height\", \"min-height\", \"max-height\",\n \"device-width\", \"min-device-width\", \"max-device-width\", \"device-height\",\n \"min-device-height\", \"max-device-height\", \"aspect-ratio\",\n \"min-aspect-ratio\", \"max-aspect-ratio\", \"device-aspect-ratio\",\n \"min-device-aspect-ratio\", \"max-device-aspect-ratio\", \"color\", \"min-color\",\n \"max-color\", \"color-index\", \"min-color-index\", \"max-color-index\",\n \"monochrome\", \"min-monochrome\", \"max-monochrome\", \"resolution\",\n \"min-resolution\", \"max-resolution\", \"scan\", \"grid\", \"orientation\",\n \"device-pixel-ratio\", \"min-device-pixel-ratio\", \"max-device-pixel-ratio\",\n \"pointer\", \"any-pointer\", \"hover\", \"any-hover\", \"prefers-color-scheme\"\n ], mediaFeatures = keySet(mediaFeatures_);\n\n var mediaValueKeywords_ = [\n \"landscape\", \"portrait\", \"none\", \"coarse\", \"fine\", \"on-demand\", \"hover\",\n \"interlace\", \"progressive\",\n \"dark\", \"light\"\n ], mediaValueKeywords = keySet(mediaValueKeywords_);\n\n var propertyKeywords_ = [\n \"align-content\", \"align-items\", \"align-self\", \"alignment-adjust\",\n \"alignment-baseline\", \"all\", \"anchor-point\", \"animation\", \"animation-delay\",\n \"animation-direction\", \"animation-duration\", \"animation-fill-mode\",\n \"animation-iteration-count\", \"animation-name\", \"animation-play-state\",\n \"animation-timing-function\", \"appearance\", \"azimuth\", \"backdrop-filter\",\n \"backface-visibility\", \"background\", \"background-attachment\",\n \"background-blend-mode\", \"background-clip\", \"background-color\",\n \"background-image\", \"background-origin\", \"background-position\",\n \"background-position-x\", \"background-position-y\", \"background-repeat\",\n \"background-size\", \"baseline-shift\", \"binding\", \"bleed\", \"block-size\",\n \"bookmark-label\", \"bookmark-level\", \"bookmark-state\", \"bookmark-target\",\n \"border\", \"border-bottom\", \"border-bottom-color\", \"border-bottom-left-radius\",\n \"border-bottom-right-radius\", \"border-bottom-style\", \"border-bottom-width\",\n \"border-collapse\", \"border-color\", \"border-image\", \"border-image-outset\",\n \"border-image-repeat\", \"border-image-slice\", \"border-image-source\",\n \"border-image-width\", \"border-left\", \"border-left-color\", \"border-left-style\",\n \"border-left-width\", \"border-radius\", \"border-right\", \"border-right-color\",\n \"border-right-style\", \"border-right-width\", \"border-spacing\", \"border-style\",\n \"border-top\", \"border-top-color\", \"border-top-left-radius\",\n \"border-top-right-radius\", \"border-top-style\", \"border-top-width\",\n \"border-width\", \"bottom\", \"box-decoration-break\", \"box-shadow\", \"box-sizing\",\n \"break-after\", \"break-before\", \"break-inside\", \"caption-side\", \"caret-color\",\n \"clear\", \"clip\", \"color\", \"color-profile\", \"column-count\", \"column-fill\",\n \"column-gap\", \"column-rule\", \"column-rule-color\", \"column-rule-style\",\n \"column-rule-width\", \"column-span\", \"column-width\", \"columns\", \"contain\",\n \"content\", \"counter-increment\", \"counter-reset\", \"crop\", \"cue\", \"cue-after\",\n \"cue-before\", \"cursor\", \"direction\", \"display\", \"dominant-baseline\",\n \"drop-initial-after-adjust\", \"drop-initial-after-align\",\n \"drop-initial-before-adjust\", \"drop-initial-before-align\", \"drop-initial-size\",\n \"drop-initial-value\", \"elevation\", \"empty-cells\", \"fit\", \"fit-content\", \"fit-position\",\n \"flex\", \"flex-basis\", \"flex-direction\", \"flex-flow\", \"flex-grow\",\n \"flex-shrink\", \"flex-wrap\", \"float\", \"float-offset\", \"flow-from\", \"flow-into\",\n \"font\", \"font-family\", \"font-feature-settings\", \"font-kerning\",\n \"font-language-override\", \"font-optical-sizing\", \"font-size\",\n \"font-size-adjust\", \"font-stretch\", \"font-style\", \"font-synthesis\",\n \"font-variant\", \"font-variant-alternates\", \"font-variant-caps\",\n \"font-variant-east-asian\", \"font-variant-ligatures\", \"font-variant-numeric\",\n \"font-variant-position\", \"font-variation-settings\", \"font-weight\", \"gap\",\n \"grid\", \"grid-area\", \"grid-auto-columns\", \"grid-auto-flow\", \"grid-auto-rows\",\n \"grid-column\", \"grid-column-end\", \"grid-column-gap\", \"grid-column-start\",\n \"grid-gap\", \"grid-row\", \"grid-row-end\", \"grid-row-gap\", \"grid-row-start\",\n \"grid-template\", \"grid-template-areas\", \"grid-template-columns\",\n \"grid-template-rows\", \"hanging-punctuation\", \"height\", \"hyphens\", \"icon\",\n \"image-orientation\", \"image-rendering\", \"image-resolution\", \"inline-box-align\",\n \"inset\", \"inset-block\", \"inset-block-end\", \"inset-block-start\", \"inset-inline\",\n \"inset-inline-end\", \"inset-inline-start\", \"isolation\", \"justify-content\",\n \"justify-items\", \"justify-self\", \"left\", \"letter-spacing\", \"line-break\",\n \"line-height\", \"line-height-step\", \"line-stacking\", \"line-stacking-ruby\",\n \"line-stacking-shift\", \"line-stacking-strategy\", \"list-style\",\n \"list-style-image\", \"list-style-position\", \"list-style-type\", \"margin\",\n \"margin-bottom\", \"margin-left\", \"margin-right\", \"margin-top\", \"marks\",\n \"marquee-direction\", \"marquee-loop\", \"marquee-play-count\", \"marquee-speed\",\n \"marquee-style\", \"mask-clip\", \"mask-composite\", \"mask-image\", \"mask-mode\",\n \"mask-origin\", \"mask-position\", \"mask-repeat\", \"mask-size\",\"mask-type\",\n \"max-block-size\", \"max-height\", \"max-inline-size\",\n \"max-width\", \"min-block-size\", \"min-height\", \"min-inline-size\", \"min-width\",\n \"mix-blend-mode\", \"move-to\", \"nav-down\", \"nav-index\", \"nav-left\", \"nav-right\",\n \"nav-up\", \"object-fit\", \"object-position\", \"offset\", \"offset-anchor\",\n \"offset-distance\", \"offset-path\", \"offset-position\", \"offset-rotate\",\n \"opacity\", \"order\", \"orphans\", \"outline\", \"outline-color\", \"outline-offset\",\n \"outline-style\", \"outline-width\", \"overflow\", \"overflow-style\",\n \"overflow-wrap\", \"overflow-x\", \"overflow-y\", \"padding\", \"padding-bottom\",\n \"padding-left\", \"padding-right\", \"padding-top\", \"page\", \"page-break-after\",\n \"page-break-before\", \"page-break-inside\", \"page-policy\", \"pause\",\n \"pause-after\", \"pause-before\", \"perspective\", \"perspective-origin\", \"pitch\",\n \"pitch-range\", \"place-content\", \"place-items\", \"place-self\", \"play-during\",\n \"position\", \"presentation-level\", \"punctuation-trim\", \"quotes\",\n \"region-break-after\", \"region-break-before\", \"region-break-inside\",\n \"region-fragment\", \"rendering-intent\", \"resize\", \"rest\", \"rest-after\",\n \"rest-before\", \"richness\", \"right\", \"rotate\", \"rotation\", \"rotation-point\",\n \"row-gap\", \"ruby-align\", \"ruby-overhang\", \"ruby-position\", \"ruby-span\",\n \"scale\", \"scroll-behavior\", \"scroll-margin\", \"scroll-margin-block\",\n \"scroll-margin-block-end\", \"scroll-margin-block-start\", \"scroll-margin-bottom\",\n \"scroll-margin-inline\", \"scroll-margin-inline-end\",\n \"scroll-margin-inline-start\", \"scroll-margin-left\", \"scroll-margin-right\",\n \"scroll-margin-top\", \"scroll-padding\", \"scroll-padding-block\",\n \"scroll-padding-block-end\", \"scroll-padding-block-start\",\n \"scroll-padding-bottom\", \"scroll-padding-inline\", \"scroll-padding-inline-end\",\n \"scroll-padding-inline-start\", \"scroll-padding-left\", \"scroll-padding-right\",\n \"scroll-padding-top\", \"scroll-snap-align\", \"scroll-snap-type\",\n \"shape-image-threshold\", \"shape-inside\", \"shape-margin\", \"shape-outside\",\n \"size\", \"speak\", \"speak-as\", \"speak-header\", \"speak-numeral\",\n \"speak-punctuation\", \"speech-rate\", \"stress\", \"string-set\", \"tab-size\",\n \"table-layout\", \"target\", \"target-name\", \"target-new\", \"target-position\",\n \"text-align\", \"text-align-last\", \"text-combine-upright\", \"text-decoration\",\n \"text-decoration-color\", \"text-decoration-line\", \"text-decoration-skip\",\n \"text-decoration-skip-ink\", \"text-decoration-style\", \"text-emphasis\",\n \"text-emphasis-color\", \"text-emphasis-position\", \"text-emphasis-style\",\n \"text-height\", \"text-indent\", \"text-justify\", \"text-orientation\",\n \"text-outline\", \"text-overflow\", \"text-rendering\", \"text-shadow\",\n \"text-size-adjust\", \"text-space-collapse\", \"text-transform\",\n \"text-underline-position\", \"text-wrap\", \"top\", \"touch-action\", \"transform\", \"transform-origin\",\n \"transform-style\", \"transition\", \"transition-delay\", \"transition-duration\",\n \"transition-property\", \"transition-timing-function\", \"translate\",\n \"unicode-bidi\", \"user-select\", \"vertical-align\", \"visibility\", \"voice-balance\",\n \"voice-duration\", \"voice-family\", \"voice-pitch\", \"voice-range\", \"voice-rate\",\n \"voice-stress\", \"voice-volume\", \"volume\", \"white-space\", \"widows\", \"width\",\n \"will-change\", \"word-break\", \"word-spacing\", \"word-wrap\", \"writing-mode\", \"z-index\",\n // SVG-specific\n \"clip-path\", \"clip-rule\", \"mask\", \"enable-background\", \"filter\", \"flood-color\",\n \"flood-opacity\", \"lighting-color\", \"stop-color\", \"stop-opacity\", \"pointer-events\",\n \"color-interpolation\", \"color-interpolation-filters\",\n \"color-rendering\", \"fill\", \"fill-opacity\", \"fill-rule\", \"image-rendering\",\n \"marker\", \"marker-end\", \"marker-mid\", \"marker-start\", \"paint-order\", \"shape-rendering\", \"stroke\",\n \"stroke-dasharray\", \"stroke-dashoffset\", \"stroke-linecap\", \"stroke-linejoin\",\n \"stroke-miterlimit\", \"stroke-opacity\", \"stroke-width\", \"text-rendering\",\n \"baseline-shift\", \"dominant-baseline\", \"glyph-orientation-horizontal\",\n \"glyph-orientation-vertical\", \"text-anchor\", \"writing-mode\",\n ], propertyKeywords = keySet(propertyKeywords_);\n\n var nonStandardPropertyKeywords_ = [\n \"accent-color\", \"aspect-ratio\", \"border-block\", \"border-block-color\", \"border-block-end\",\n \"border-block-end-color\", \"border-block-end-style\", \"border-block-end-width\",\n \"border-block-start\", \"border-block-start-color\", \"border-block-start-style\",\n \"border-block-start-width\", \"border-block-style\", \"border-block-width\",\n \"border-inline\", \"border-inline-color\", \"border-inline-end\",\n \"border-inline-end-color\", \"border-inline-end-style\",\n \"border-inline-end-width\", \"border-inline-start\", \"border-inline-start-color\",\n \"border-inline-start-style\", \"border-inline-start-width\",\n \"border-inline-style\", \"border-inline-width\", \"content-visibility\", \"margin-block\",\n \"margin-block-end\", \"margin-block-start\", \"margin-inline\", \"margin-inline-end\",\n \"margin-inline-start\", \"overflow-anchor\", \"overscroll-behavior\", \"padding-block\", \"padding-block-end\",\n \"padding-block-start\", \"padding-inline\", \"padding-inline-end\",\n \"padding-inline-start\", \"scroll-snap-stop\", \"scrollbar-3d-light-color\",\n \"scrollbar-arrow-color\", \"scrollbar-base-color\", \"scrollbar-dark-shadow-color\",\n \"scrollbar-face-color\", \"scrollbar-highlight-color\", \"scrollbar-shadow-color\",\n \"scrollbar-track-color\", \"searchfield-cancel-button\", \"searchfield-decoration\",\n \"searchfield-results-button\", \"searchfield-results-decoration\", \"shape-inside\", \"zoom\"\n ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);\n\n var fontProperties_ = [\n \"font-display\", \"font-family\", \"src\", \"unicode-range\", \"font-variant\",\n \"font-feature-settings\", \"font-stretch\", \"font-weight\", \"font-style\"\n ], fontProperties = keySet(fontProperties_);\n\n var counterDescriptors_ = [\n \"additive-symbols\", \"fallback\", \"negative\", \"pad\", \"prefix\", \"range\",\n \"speak-as\", \"suffix\", \"symbols\", \"system\"\n ], counterDescriptors = keySet(counterDescriptors_);\n\n var colorKeywords_ = [\n \"aliceblue\", \"antiquewhite\", \"aqua\", \"aquamarine\", \"azure\", \"beige\",\n \"bisque\", \"black\", \"blanchedalmond\", \"blue\", \"blueviolet\", \"brown\",\n \"burlywood\", \"cadetblue\", \"chartreuse\", \"chocolate\", \"coral\", \"cornflowerblue\",\n \"cornsilk\", \"crimson\", \"cyan\", \"darkblue\", \"darkcyan\", \"darkgoldenrod\",\n \"darkgray\", \"darkgreen\", \"darkgrey\", \"darkkhaki\", \"darkmagenta\", \"darkolivegreen\",\n \"darkorange\", \"darkorchid\", \"darkred\", \"darksalmon\", \"darkseagreen\",\n \"darkslateblue\", \"darkslategray\", \"darkslategrey\", \"darkturquoise\", \"darkviolet\",\n \"deeppink\", \"deepskyblue\", \"dimgray\", \"dimgrey\", \"dodgerblue\", \"firebrick\",\n \"floralwhite\", \"forestgreen\", \"fuchsia\", \"gainsboro\", \"ghostwhite\",\n \"gold\", \"goldenrod\", \"gray\", \"grey\", \"green\", \"greenyellow\", \"honeydew\",\n \"hotpink\", \"indianred\", \"indigo\", \"ivory\", \"khaki\", \"lavender\",\n \"lavenderblush\", \"lawngreen\", \"lemonchiffon\", \"lightblue\", \"lightcoral\",\n \"lightcyan\", \"lightgoldenrodyellow\", \"lightgray\", \"lightgreen\", \"lightgrey\", \"lightpink\",\n \"lightsalmon\", \"lightseagreen\", \"lightskyblue\", \"lightslategray\", \"lightslategrey\",\n \"lightsteelblue\", \"lightyellow\", \"lime\", \"limegreen\", \"linen\", \"magenta\",\n \"maroon\", \"mediumaquamarine\", \"mediumblue\", \"mediumorchid\", \"mediumpurple\",\n \"mediumseagreen\", \"mediumslateblue\", \"mediumspringgreen\", \"mediumturquoise\",\n \"mediumvioletred\", \"midnightblue\", \"mintcream\", \"mistyrose\", \"moccasin\",\n \"navajowhite\", \"navy\", \"oldlace\", \"olive\", \"olivedrab\", \"orange\", \"orangered\",\n \"orchid\", \"palegoldenrod\", \"palegreen\", \"paleturquoise\", \"palevioletred\",\n \"papayawhip\", \"peachpuff\", \"peru\", \"pink\", \"plum\", \"powderblue\",\n \"purple\", \"rebeccapurple\", \"red\", \"rosybrown\", \"royalblue\", \"saddlebrown\",\n \"salmon\", \"sandybrown\", \"seagreen\", \"seashell\", \"sienna\", \"silver\", \"skyblue\",\n \"slateblue\", \"slategray\", \"slategrey\", \"snow\", \"springgreen\", \"steelblue\", \"tan\",\n \"teal\", \"thistle\", \"tomato\", \"turquoise\", \"violet\", \"wheat\", \"white\",\n \"whitesmoke\", \"yellow\", \"yellowgreen\"\n ], colorKeywords = keySet(colorKeywords_);\n\n var valueKeywords_ = [\n \"above\", \"absolute\", \"activeborder\", \"additive\", \"activecaption\", \"afar\",\n \"after-white-space\", \"ahead\", \"alias\", \"all\", \"all-scroll\", \"alphabetic\", \"alternate\",\n \"always\", \"amharic\", \"amharic-abegede\", \"antialiased\", \"appworkspace\",\n \"arabic-indic\", \"armenian\", \"asterisks\", \"attr\", \"auto\", \"auto-flow\", \"avoid\", \"avoid-column\", \"avoid-page\",\n \"avoid-region\", \"axis-pan\", \"background\", \"backwards\", \"baseline\", \"below\", \"bidi-override\", \"binary\",\n \"bengali\", \"blink\", \"block\", \"block-axis\", \"blur\", \"bold\", \"bolder\", \"border\", \"border-box\",\n \"both\", \"bottom\", \"break\", \"break-all\", \"break-word\", \"brightness\", \"bullets\", \"button\", \"button-bevel\",\n \"buttonface\", \"buttonhighlight\", \"buttonshadow\", \"buttontext\", \"calc\", \"cambodian\",\n \"capitalize\", \"caps-lock-indicator\", \"caption\", \"captiontext\", \"caret\",\n \"cell\", \"center\", \"checkbox\", \"circle\", \"cjk-decimal\", \"cjk-earthly-branch\",\n \"cjk-heavenly-stem\", \"cjk-ideographic\", \"clear\", \"clip\", \"close-quote\",\n \"col-resize\", \"collapse\", \"color\", \"color-burn\", \"color-dodge\", \"column\", \"column-reverse\",\n \"compact\", \"condensed\", \"contain\", \"content\", \"contents\",\n \"content-box\", \"context-menu\", \"continuous\", \"contrast\", \"copy\", \"counter\", \"counters\", \"cover\", \"crop\",\n \"cross\", \"crosshair\", \"cubic-bezier\", \"currentcolor\", \"cursive\", \"cyclic\", \"darken\", \"dashed\", \"decimal\",\n \"decimal-leading-zero\", \"default\", \"default-button\", \"dense\", \"destination-atop\",\n \"destination-in\", \"destination-out\", \"destination-over\", \"devanagari\", \"difference\",\n \"disc\", \"discard\", \"disclosure-closed\", \"disclosure-open\", \"document\",\n \"dot-dash\", \"dot-dot-dash\",\n \"dotted\", \"double\", \"down\", \"drop-shadow\", \"e-resize\", \"ease\", \"ease-in\", \"ease-in-out\", \"ease-out\",\n \"element\", \"ellipse\", \"ellipsis\", \"embed\", \"end\", \"ethiopic\", \"ethiopic-abegede\",\n \"ethiopic-abegede-am-et\", \"ethiopic-abegede-gez\", \"ethiopic-abegede-ti-er\",\n \"ethiopic-abegede-ti-et\", \"ethiopic-halehame-aa-er\",\n \"ethiopic-halehame-aa-et\", \"ethiopic-halehame-am-et\",\n \"ethiopic-halehame-gez\", \"ethiopic-halehame-om-et\",\n \"ethiopic-halehame-sid-et\", \"ethiopic-halehame-so-et\",\n \"ethiopic-halehame-ti-er\", \"ethiopic-halehame-ti-et\", \"ethiopic-halehame-tig\",\n \"ethiopic-numeric\", \"ew-resize\", \"exclusion\", \"expanded\", \"extends\", \"extra-condensed\",\n \"extra-expanded\", \"fantasy\", \"fast\", \"fill\", \"fill-box\", \"fixed\", \"flat\", \"flex\", \"flex-end\", \"flex-start\", \"footnotes\",\n \"forwards\", \"from\", \"geometricPrecision\", \"georgian\", \"grayscale\", \"graytext\", \"grid\", \"groove\",\n \"gujarati\", \"gurmukhi\", \"hand\", \"hangul\", \"hangul-consonant\", \"hard-light\", \"hebrew\",\n \"help\", \"hidden\", \"hide\", \"higher\", \"highlight\", \"highlighttext\",\n \"hiragana\", \"hiragana-iroha\", \"horizontal\", \"hsl\", \"hsla\", \"hue\", \"hue-rotate\", \"icon\", \"ignore\",\n \"inactiveborder\", \"inactivecaption\", \"inactivecaptiontext\", \"infinite\",\n \"infobackground\", \"infotext\", \"inherit\", \"initial\", \"inline\", \"inline-axis\",\n \"inline-block\", \"inline-flex\", \"inline-grid\", \"inline-table\", \"inset\", \"inside\", \"intrinsic\", \"invert\",\n \"italic\", \"japanese-formal\", \"japanese-informal\", \"justify\", \"kannada\",\n \"katakana\", \"katakana-iroha\", \"keep-all\", \"khmer\",\n \"korean-hangul-formal\", \"korean-hanja-formal\", \"korean-hanja-informal\",\n \"landscape\", \"lao\", \"large\", \"larger\", \"left\", \"level\", \"lighter\", \"lighten\",\n \"line-through\", \"linear\", \"linear-gradient\", \"lines\", \"list-item\", \"listbox\", \"listitem\",\n \"local\", \"logical\", \"loud\", \"lower\", \"lower-alpha\", \"lower-armenian\",\n \"lower-greek\", \"lower-hexadecimal\", \"lower-latin\", \"lower-norwegian\",\n \"lower-roman\", \"lowercase\", \"ltr\", \"luminosity\", \"malayalam\", \"manipulation\", \"match\", \"matrix\", \"matrix3d\",\n \"media-controls-background\", \"media-current-time-display\",\n \"media-fullscreen-button\", \"media-mute-button\", \"media-play-button\",\n \"media-return-to-realtime-button\", \"media-rewind-button\",\n \"media-seek-back-button\", \"media-seek-forward-button\", \"media-slider\",\n \"media-sliderthumb\", \"media-time-remaining-display\", \"media-volume-slider\",\n \"media-volume-slider-container\", \"media-volume-sliderthumb\", \"medium\",\n \"menu\", \"menulist\", \"menulist-button\", \"menulist-text\",\n \"menulist-textfield\", \"menutext\", \"message-box\", \"middle\", \"min-intrinsic\",\n \"mix\", \"mongolian\", \"monospace\", \"move\", \"multiple\", \"multiple_mask_images\", \"multiply\", \"myanmar\", \"n-resize\",\n \"narrower\", \"ne-resize\", \"nesw-resize\", \"no-close-quote\", \"no-drop\",\n \"no-open-quote\", \"no-repeat\", \"none\", \"normal\", \"not-allowed\", \"nowrap\",\n \"ns-resize\", \"numbers\", \"numeric\", \"nw-resize\", \"nwse-resize\", \"oblique\", \"octal\", \"opacity\", \"open-quote\",\n \"optimizeLegibility\", \"optimizeSpeed\", \"oriya\", \"oromo\", \"outset\",\n \"outside\", \"outside-shape\", \"overlay\", \"overline\", \"padding\", \"padding-box\",\n \"painted\", \"page\", \"paused\", \"persian\", \"perspective\", \"pinch-zoom\", \"plus-darker\", \"plus-lighter\",\n \"pointer\", \"polygon\", \"portrait\", \"pre\", \"pre-line\", \"pre-wrap\", \"preserve-3d\",\n \"progress\", \"push-button\", \"radial-gradient\", \"radio\", \"read-only\",\n \"read-write\", \"read-write-plaintext-only\", \"rectangle\", \"region\",\n \"relative\", \"repeat\", \"repeating-linear-gradient\",\n \"repeating-radial-gradient\", \"repeat-x\", \"repeat-y\", \"reset\", \"reverse\",\n \"rgb\", \"rgba\", \"ridge\", \"right\", \"rotate\", \"rotate3d\", \"rotateX\", \"rotateY\",\n \"rotateZ\", \"round\", \"row\", \"row-resize\", \"row-reverse\", \"rtl\", \"run-in\", \"running\",\n \"s-resize\", \"sans-serif\", \"saturate\", \"saturation\", \"scale\", \"scale3d\", \"scaleX\", \"scaleY\", \"scaleZ\", \"screen\",\n \"scroll\", \"scrollbar\", \"scroll-position\", \"se-resize\", \"searchfield\",\n \"searchfield-cancel-button\", \"searchfield-decoration\",\n \"searchfield-results-button\", \"searchfield-results-decoration\", \"self-start\", \"self-end\",\n \"semi-condensed\", \"semi-expanded\", \"separate\", \"sepia\", \"serif\", \"show\", \"sidama\",\n \"simp-chinese-formal\", \"simp-chinese-informal\", \"single\",\n \"skew\", \"skewX\", \"skewY\", \"skip-white-space\", \"slide\", \"slider-horizontal\",\n \"slider-vertical\", \"sliderthumb-horizontal\", \"sliderthumb-vertical\", \"slow\",\n \"small\", \"small-caps\", \"small-caption\", \"smaller\", \"soft-light\", \"solid\", \"somali\",\n \"source-atop\", \"source-in\", \"source-out\", \"source-over\", \"space\", \"space-around\", \"space-between\", \"space-evenly\", \"spell-out\", \"square\",\n \"square-button\", \"start\", \"static\", \"status-bar\", \"stretch\", \"stroke\", \"stroke-box\", \"sub\",\n \"subpixel-antialiased\", \"svg_masks\", \"super\", \"sw-resize\", \"symbolic\", \"symbols\", \"system-ui\", \"table\",\n \"table-caption\", \"table-cell\", \"table-column\", \"table-column-group\",\n \"table-footer-group\", \"table-header-group\", \"table-row\", \"table-row-group\",\n \"tamil\",\n \"telugu\", \"text\", \"text-bottom\", \"text-top\", \"textarea\", \"textfield\", \"thai\",\n \"thick\", \"thin\", \"threeddarkshadow\", \"threedface\", \"threedhighlight\",\n \"threedlightshadow\", \"threedshadow\", \"tibetan\", \"tigre\", \"tigrinya-er\",\n \"tigrinya-er-abegede\", \"tigrinya-et\", \"tigrinya-et-abegede\", \"to\", \"top\",\n \"trad-chinese-formal\", \"trad-chinese-informal\", \"transform\",\n \"translate\", \"translate3d\", \"translateX\", \"translateY\", \"translateZ\",\n \"transparent\", \"ultra-condensed\", \"ultra-expanded\", \"underline\", \"unidirectional-pan\", \"unset\", \"up\",\n \"upper-alpha\", \"upper-armenian\", \"upper-greek\", \"upper-hexadecimal\",\n \"upper-latin\", \"upper-norwegian\", \"upper-roman\", \"uppercase\", \"urdu\", \"url\",\n \"var\", \"vertical\", \"vertical-text\", \"view-box\", \"visible\", \"visibleFill\", \"visiblePainted\",\n \"visibleStroke\", \"visual\", \"w-resize\", \"wait\", \"wave\", \"wider\",\n \"window\", \"windowframe\", \"windowtext\", \"words\", \"wrap\", \"wrap-reverse\", \"x-large\", \"x-small\", \"xor\",\n \"xx-large\", \"xx-small\"\n ], valueKeywords = keySet(valueKeywords_);\n\n var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_)\n .concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_)\n .concat(valueKeywords_);\n CodeMirror.registerHelper(\"hintWords\", \"css\", allWords);\n\n function tokenCComment(stream, state) {\n var maybeEnd = false, ch;\n while ((ch = stream.next()) != null) {\n if (maybeEnd && ch == \"/\") {\n state.tokenize = null;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return [\"comment\", \"comment\"];\n }\n\n CodeMirror.defineMIME(\"text/css\", {\n documentTypes: documentTypes,\n mediaTypes: mediaTypes,\n mediaFeatures: mediaFeatures,\n mediaValueKeywords: mediaValueKeywords,\n propertyKeywords: propertyKeywords,\n nonStandardPropertyKeywords: nonStandardPropertyKeywords,\n fontProperties: fontProperties,\n counterDescriptors: counterDescriptors,\n colorKeywords: colorKeywords,\n valueKeywords: valueKeywords,\n tokenHooks: {\n \"/\": function(stream, state) {\n if (!stream.eat(\"*\")) return false;\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n }\n },\n name: \"css\"\n });\n\n CodeMirror.defineMIME(\"text/x-scss\", {\n mediaTypes: mediaTypes,\n mediaFeatures: mediaFeatures,\n mediaValueKeywords: mediaValueKeywords,\n propertyKeywords: propertyKeywords,\n nonStandardPropertyKeywords: nonStandardPropertyKeywords,\n colorKeywords: colorKeywords,\n valueKeywords: valueKeywords,\n fontProperties: fontProperties,\n allowNested: true,\n lineComment: \"//\",\n tokenHooks: {\n \"/\": function(stream, state) {\n if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return [\"comment\", \"comment\"];\n } else if (stream.eat(\"*\")) {\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n } else {\n return [\"operator\", \"operator\"];\n }\n },\n \":\": function(stream) {\n if (stream.match(/^\\s*\\{/, false))\n return [null, null]\n return false;\n },\n \"$\": function(stream) {\n stream.match(/^[\\w-]+/);\n if (stream.match(/^\\s*:/, false))\n return [\"variable-2\", \"variable-definition\"];\n return [\"variable-2\", \"variable\"];\n },\n \"#\": function(stream) {\n if (!stream.eat(\"{\")) return false;\n return [null, \"interpolation\"];\n }\n },\n name: \"css\",\n helperType: \"scss\"\n });\n\n CodeMirror.defineMIME(\"text/x-less\", {\n mediaTypes: mediaTypes,\n mediaFeatures: mediaFeatures,\n mediaValueKeywords: mediaValueKeywords,\n propertyKeywords: propertyKeywords,\n nonStandardPropertyKeywords: nonStandardPropertyKeywords,\n colorKeywords: colorKeywords,\n valueKeywords: valueKeywords,\n fontProperties: fontProperties,\n allowNested: true,\n lineComment: \"//\",\n tokenHooks: {\n \"/\": function(stream, state) {\n if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return [\"comment\", \"comment\"];\n } else if (stream.eat(\"*\")) {\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n } else {\n return [\"operator\", \"operator\"];\n }\n },\n \"@\": function(stream) {\n if (stream.eat(\"{\")) return [null, \"interpolation\"];\n if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\\b/i, false)) return false;\n stream.eatWhile(/[\\w\\\\\\-]/);\n if (stream.match(/^\\s*:/, false))\n return [\"variable-2\", \"variable-definition\"];\n return [\"variable-2\", \"variable\"];\n },\n \"&\": function() {\n return [\"atom\", \"atom\"];\n }\n },\n name: \"css\",\n helperType: \"less\"\n });\n\n CodeMirror.defineMIME(\"text/x-gss\", {\n documentTypes: documentTypes,\n mediaTypes: mediaTypes,\n mediaFeatures: mediaFeatures,\n propertyKeywords: propertyKeywords,\n nonStandardPropertyKeywords: nonStandardPropertyKeywords,\n fontProperties: fontProperties,\n counterDescriptors: counterDescriptors,\n colorKeywords: colorKeywords,\n valueKeywords: valueKeywords,\n supportsAtComponent: true,\n tokenHooks: {\n \"/\": function(stream, state) {\n if (!stream.eat(\"*\")) return false;\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n }\n },\n name: \"css\",\n helperType: \"gss\"\n });\n\n});\n","export default {\n run(ed) {\n ed.DomComponents.clear();\n ed.CssComposer.clear();\n }\n};\n","import { bindAll } from 'underscore';\nimport { on, off, getKeyChar } from 'utils/mixins';\nimport Dragger from 'utils/Dragger';\n\nexport default {\n run(ed) {\n bindAll(this, 'onKeyUp', 'enableDragger', 'disableDragger');\n this.editor = ed;\n this.canvasModel = this.canvas.getCanvasView().model;\n this.toggleMove(1);\n },\n stop(ed) {\n this.toggleMove();\n this.disableDragger();\n },\n\n onKeyUp(ev) {\n if (getKeyChar(ev) === ' ') {\n this.editor.stopCommand(this.id);\n }\n },\n\n enableDragger(ev) {\n this.toggleDragger(1, ev);\n },\n\n disableDragger(ev) {\n this.toggleDragger(0, ev);\n },\n\n toggleDragger(enable, ev) {\n const { canvasModel, em } = this;\n let { dragger } = this;\n const methodCls = enable ? 'add' : 'remove';\n this.getCanvas().classList[methodCls](`${this.ppfx}is__grabbing`);\n\n if (!dragger) {\n dragger = new Dragger({\n getPosition() {\n return {\n x: canvasModel.get('x'),\n y: canvasModel.get('y')\n };\n },\n setPosition({ x, y }) {\n canvasModel.set({ x, y });\n },\n onStart(ev, dragger) {\n em.trigger('canvas:move:start', dragger);\n },\n onDrag(ev, dragger) {\n em.trigger('canvas:move', dragger);\n },\n onEnd(ev, dragger) {\n em.trigger('canvas:move:end', dragger);\n }\n });\n this.dragger = dragger;\n }\n\n enable ? dragger.start(ev) : dragger.stop();\n },\n\n toggleMove(enable) {\n const { ppfx } = this;\n const methodCls = enable ? 'add' : 'remove';\n const methodEv = enable ? 'on' : 'off';\n const methodsEv = { on, off };\n const canvas = this.getCanvas();\n const classes = [`${ppfx}is__grab`];\n !enable && classes.push(`${ppfx}is__grabbing`);\n classes.forEach(cls => canvas.classList[methodCls](cls));\n methodsEv[methodEv](document, 'keyup', this.onKeyUp);\n methodsEv[methodEv](canvas, 'mousedown', this.enableDragger);\n methodsEv[methodEv](document, 'mouseup', this.disableDragger);\n }\n};\n","import { isArray } from 'underscore';\n\nexport default {\n run(ed, sender, opts = {}) {\n const toSelect = [];\n let components = opts.component || ed.getSelectedAll();\n components = isArray(components) ? [...components] : [components];\n\n // It's important to deselect components first otherwise,\n // with undo, the component will be set with the wrong `collection`\n ed.select(null);\n\n components.forEach(component => {\n if (!component || !component.get('removable')) {\n return this.em.logWarning('The element is not removable', {\n component\n });\n }\n component.remove();\n component.collection && toSelect.push(component);\n });\n\n toSelect.length && ed.select(toSelect);\n\n return components;\n }\n};\n","import { keys, bindAll, each, isUndefined, debounce } from 'underscore';\nimport Dragger from 'utils/Dragger';\n\nconst evName = 'dmode';\n\nexport default {\n run(editor, sender, opts = {}) {\n bindAll(\n this,\n 'setPosition',\n 'onStart',\n 'onDrag',\n 'onEnd',\n 'getPosition',\n 'getGuidesStatic',\n 'renderGuide',\n 'getGuidesTarget'\n );\n const { target, event, mode, dragger = {} } = opts;\n const el = target.getEl();\n const config = {\n doc: el.ownerDocument,\n onStart: this.onStart,\n onEnd: this.onEnd,\n onDrag: this.onDrag,\n getPosition: this.getPosition,\n setPosition: this.setPosition,\n guidesStatic: () => this.guidesStatic,\n guidesTarget: () => this.guidesTarget,\n ...dragger\n };\n this.setupGuides();\n this.opts = opts;\n this.editor = editor;\n this.em = editor.getModel();\n this.target = target;\n this.isTran = mode == 'translate';\n this.guidesContainer = this.getGuidesContainer();\n this.guidesTarget = this.getGuidesTarget();\n this.guidesStatic = this.getGuidesStatic();\n let drg = this.dragger;\n\n if (!drg) {\n drg = new Dragger(config);\n this.dragger = drg;\n } else {\n drg.setOptions(config);\n }\n\n event && drg.start(event);\n this.toggleDrag(1);\n this.em.trigger(`${evName}:start`, this.getEventOpts());\n\n return drg;\n },\n\n getEventOpts() {\n return {\n mode: this.opts.mode,\n target: this.target,\n guidesTarget: this.guidesTarget,\n guidesStatic: this.guidesStatic\n };\n },\n\n stop() {\n this.toggleDrag();\n },\n\n setupGuides() {\n (this.guides || []).forEach(item => {\n const { guide } = item;\n guide && guide.parentNode.removeChild(guide);\n });\n this.guides = [];\n },\n\n getGuidesContainer() {\n let { guidesEl } = this;\n\n if (!guidesEl) {\n const { editor, em, opts } = this;\n const pfx = editor.getConfig('stylePrefix');\n const elInfoX = document.createElement('div');\n const elInfoY = document.createElement('div');\n const guideContent = `
\n
\n
`;\n guidesEl = document.createElement('div');\n guidesEl.className = `${pfx}guides`;\n elInfoX.className = `${pfx}guide-info ${pfx}guide-info__x`;\n elInfoY.className = `${pfx}guide-info ${pfx}guide-info__y`;\n elInfoX.innerHTML = guideContent;\n elInfoY.innerHTML = guideContent;\n guidesEl.appendChild(elInfoX);\n guidesEl.appendChild(elInfoY);\n editor.Canvas.getGlobalToolsEl().appendChild(guidesEl);\n this.guidesEl = guidesEl;\n this.elGuideInfoX = elInfoX;\n this.elGuideInfoY = elInfoY;\n this.elGuideInfoContentX = elInfoX.querySelector(\n `.${pfx}guide-info__content`\n );\n this.elGuideInfoContentY = elInfoY.querySelector(\n `.${pfx}guide-info__content`\n );\n\n em.on(\n 'canvas:update frame:scroll',\n debounce(() => {\n this.updateGuides();\n opts.debug && this.guides.forEach(item => this.renderGuide(item));\n }, 200)\n );\n }\n\n return guidesEl;\n },\n\n getGuidesStatic() {\n let result = [];\n const el = this.target.getEl();\n const { parentNode = {} } = el;\n each(\n parentNode.children,\n item =>\n (result = result.concat(el !== item ? this.getElementGuides(item) : []))\n );\n\n return result.concat(this.getElementGuides(parentNode));\n },\n\n getGuidesTarget() {\n return this.getElementGuides(this.target.getEl());\n },\n\n updateGuides(guides) {\n let lastEl, lastPos;\n (guides || this.guides).forEach(item => {\n const { origin } = item;\n const pos = lastEl === origin ? lastPos : this.getElementPos(origin);\n lastEl = origin;\n lastPos = pos;\n each(this.getGuidePosUpdate(item, pos), (val, key) => (item[key] = val));\n item.originRect = pos;\n });\n },\n\n getGuidePosUpdate(item, rect) {\n const result = {};\n const { top, height, left, width } = rect;\n\n switch (item.type) {\n case 't':\n result.y = top;\n break;\n case 'b':\n result.y = top + height;\n break;\n case 'l':\n result.x = left;\n break;\n case 'r':\n result.x = left + width;\n break;\n case 'x':\n result.x = left + width / 2;\n break;\n case 'y':\n result.y = top + height / 2;\n break;\n }\n\n return result;\n },\n\n renderGuide(item = {}) {\n const el = item.guide || document.createElement('div');\n const un = 'px';\n const guideSize = item.active ? 2 : 1;\n let numEl = el.children[0];\n el.style = `position: absolute; background-color: ${\n item.active ? 'green' : 'red'\n };`;\n\n if (!el.children.length) {\n numEl = document.createElement('div');\n numEl.style =\n 'position: absolute; color: red; padding: 5px; top: 0; left: 0;';\n el.appendChild(numEl);\n }\n\n if (item.y) {\n el.style.width = '100%';\n el.style.height = `${guideSize}${un}`;\n el.style.top = `${item.y}${un}`;\n el.style.left = 0;\n } else {\n el.style.width = `${guideSize}${un}`;\n el.style.height = '100%';\n el.style.left = `${item.x}${un}`;\n el.style.top = `0${un}`;\n }\n\n !item.guide && this.guidesContainer.appendChild(el);\n return el;\n },\n\n getElementPos(el) {\n return this.editor.Canvas.getElementPos(el, { noScroll: 1 });\n },\n\n getElementGuides(el) {\n const { opts } = this;\n const originRect = this.getElementPos(el);\n const { top, height, left, width } = originRect;\n const guides = [\n { type: 't', y: top }, // Top\n { type: 'b', y: top + height }, // Bottom\n { type: 'l', x: left }, // Left\n { type: 'r', x: left + width }, // Right\n { type: 'x', x: left + width / 2 }, // Mid x\n { type: 'y', y: top + height / 2 } // Mid y\n ].map(item => ({\n ...item,\n origin: el,\n originRect,\n guide: opts.debug && this.renderGuide(item)\n }));\n guides.forEach(item => this.guides.push(item));\n\n return guides;\n },\n\n getTranslate(transform, axis = 'x') {\n let result = 0;\n (transform || '').split(' ').forEach(item => {\n const itemStr = item.trim();\n const fn = `translate${axis.toUpperCase()}(`;\n if (itemStr.indexOf(fn) === 0)\n result = parseFloat(itemStr.replace(fn, ''));\n });\n return result;\n },\n\n setTranslate(transform, axis, value) {\n const fn = `translate${axis.toUpperCase()}(`;\n const val = `${fn}${value})`;\n let result = (transform || '')\n .split(' ')\n .map(item => {\n const itemStr = item.trim();\n if (itemStr.indexOf(fn) === 0) item = val;\n return item;\n })\n .join(' ');\n if (result.indexOf(fn) < 0) result += ` ${val}`;\n\n return result;\n },\n\n getPosition() {\n const { target, isTran } = this;\n const { left, top, transform } = target.getStyle();\n let x = 0;\n let y = 0;\n\n if (isTran) {\n x = this.getTranslate(transform);\n y = this.getTranslate(transform, 'y');\n } else {\n x = parseFloat(left || 0);\n y = parseFloat(top || 0);\n }\n\n return { x, y };\n },\n\n setPosition({ x, y, end, position, width, height }) {\n const { target, isTran, em } = this;\n const unit = 'px';\n const en = !end ? 1 : ''; // this will trigger the final change\n const left = `${x}${unit}`;\n const top = `${y}${unit}`;\n let styleUp = {};\n\n if (isTran) {\n let transform = target.getStyle()['transform'] || '';\n transform = this.setTranslate(transform, 'x', left);\n transform = this.setTranslate(transform, 'y', top);\n styleUp = { transform, en };\n target.addStyle(styleUp, { avoidStore: !end });\n } else {\n const adds = { position, width, height };\n const style = { left, top, en };\n keys(adds).forEach(add => {\n const prop = adds[add];\n if (prop) style[add] = prop;\n });\n styleUp = style;\n target.addStyle(styleUp, { avoidStore: !end });\n }\n\n // Update StyleManager properties\n em.getSelected() &&\n keys(styleUp).forEach(i => em.trigger(`update:component:style:${i}`));\n },\n\n _getDragData() {\n const { target } = this;\n return {\n target,\n parent: target.parent(),\n index: target.index()\n };\n },\n\n onStart(event) {\n const { target, editor, isTran, opts } = this;\n const { center, onStart } = opts;\n const { Canvas } = editor;\n const style = target.getStyle();\n const position = 'absolute';\n onStart && onStart(this._getDragData());\n if (isTran) return;\n\n if (style.position !== position) {\n let { left, top, width, height } = Canvas.offset(target.getEl());\n\n // Check if to center the target to the pointer position\n if (center) {\n const { x, y } = Canvas.getMouseRelativeCanvas(event);\n left = x;\n top = y;\n }\n\n this.setPosition({\n x: left,\n y: top,\n width: `${width}px`,\n height: `${height}px`,\n position\n });\n }\n },\n\n onDrag(...args) {\n const { guidesTarget, opts } = this;\n const { onDrag } = opts;\n this.updateGuides(guidesTarget);\n opts.debug && guidesTarget.forEach(item => this.renderGuide(item));\n opts.guidesInfo &&\n this.renderGuideInfo(guidesTarget.filter(item => item.active));\n onDrag && onDrag(this._getDragData());\n },\n\n onEnd(ev, dragger, opt = {}) {\n const { editor, opts, id } = this;\n const { onEnd } = opts;\n onEnd && onEnd(ev, opt, { event: ev, ...opt, ...this._getDragData() });\n editor.stopCommand(id);\n this.hideGuidesInfo();\n this.em.trigger(`${evName}:end`, this.getEventOpts());\n },\n\n hideGuidesInfo() {\n ['X', 'Y'].forEach(item => {\n const guide = this[`elGuideInfo${item}`];\n if (guide) guide.style.display = 'none';\n });\n },\n\n /**\n * Render guides with spacing information\n */\n renderGuideInfo(guides = []) {\n const { guidesStatic } = this;\n this.hideGuidesInfo();\n guides.forEach(item => {\n const { origin, x } = item;\n const rectOrigin = this.getElementPos(origin);\n const axis = isUndefined(x) ? 'y' : 'x';\n const isY = axis === 'y';\n const origEdge1 = rectOrigin[isY ? 'left' : 'top'];\n const origEdge1Raw = rectOrigin.rect[isY ? 'left' : 'top'];\n const origEdge2 = isY\n ? origEdge1 + rectOrigin.width\n : origEdge1 + rectOrigin.height;\n const origEdge2Raw = isY\n ? origEdge1Raw + rectOrigin.rect.width\n : origEdge1Raw + rectOrigin.rect.height;\n const elGuideInfo = this[`elGuideInfo${axis.toUpperCase()}`];\n const elGuideInfoCnt = this[`elGuideInfoContent${axis.toUpperCase()}`];\n const guideInfoStyle = elGuideInfo.style;\n\n // Find the nearest element\n const res = guidesStatic\n .filter(stat => stat.type === item.type)\n .map(stat => {\n const { left, width, top, height } = stat.originRect;\n const statEdge1 = isY ? left : top;\n const statEdge2 = isY ? left + width : top + height;\n return {\n gap:\n statEdge2 < origEdge1\n ? origEdge1 - statEdge2\n : statEdge1 - origEdge2,\n guide: stat\n };\n })\n .filter(item => item.gap > 0)\n .sort((a, b) => a.gap - b.gap)\n .map(item => item.guide)[0];\n\n if (res) {\n const { left, width, top, height, rect } = res.originRect;\n const isEdge1 = isY ? left < rectOrigin.left : top < rectOrigin.top;\n const statEdge1 = isY ? left : top;\n const statEdge1Raw = isY ? rect.left : rect.top;\n const statEdge2 = isY ? left + width : top + height;\n const statEdge2Raw = isY\n ? rect.left + rect.width\n : rect.top + rect.height;\n const posFirst = isY ? item.y : item.x;\n const posSecond = isEdge1 ? statEdge2 : origEdge2;\n const pos2 = `${posFirst}px`;\n const size = isEdge1 ? origEdge1 - statEdge2 : statEdge1 - origEdge2;\n const sizeRaw = isEdge1\n ? origEdge1Raw - statEdge2Raw\n : statEdge1Raw - origEdge2Raw;\n guideInfoStyle.display = '';\n guideInfoStyle[isY ? 'top' : 'left'] = pos2;\n guideInfoStyle[isY ? 'left' : 'top'] = `${posSecond}px`;\n guideInfoStyle[isY ? 'width' : 'height'] = `${size}px`;\n elGuideInfoCnt.innerHTML = `${Math.round(sizeRaw)}px`;\n this.em.trigger(`${evName}:active`, {\n ...this.getEventOpts(),\n guide: item,\n guidesStatic,\n matched: res,\n posFirst,\n posSecond,\n size,\n sizeRaw,\n elGuideInfo,\n elGuideInfoCnt\n });\n }\n });\n },\n\n toggleDrag(enable) {\n const { ppfx, editor } = this;\n const methodCls = enable ? 'add' : 'remove';\n const classes = [`${ppfx}is__grabbing`];\n const { Canvas } = editor;\n const body = Canvas.getBody();\n classes.forEach(cls => body.classList[methodCls](cls));\n Canvas[enable ? 'startAutoscroll' : 'stopAutoscroll']();\n }\n};\n","export default {\n run(ed) {\n if (!ed.Canvas.hasFocus()) return;\n const toSelect = [];\n\n ed.getSelectedAll().forEach(component => {\n const coll = component.components();\n const next = coll && coll.filter(c => c.get('selectable'))[0];\n next && toSelect.push(next);\n });\n\n toSelect.length && ed.select(toSelect);\n }\n};\n","export default {\n run(ed, snd, opts = {}) {\n if (!ed.Canvas.hasFocus() && !opts.force) return;\n const toSelect = [];\n\n ed.getSelectedAll().forEach(component => {\n let next = component.parent();\n\n // Recurse through the parent() chain until a selectable parent is found\n while (next && !next.get('selectable')) {\n next = next.parent();\n }\n\n next && toSelect.push(next);\n });\n\n toSelect.length && ed.select(toSelect);\n }\n};\n","export default {\n run(ed) {\n if (!ed.Canvas.hasFocus()) return;\n const toSelect = [];\n\n ed.getSelectedAll().forEach(cmp => {\n const parent = cmp.parent();\n if (!parent) return;\n\n const len = parent.components().length;\n let incr = 0;\n let at = 0;\n let next;\n\n // Get the next selectable component\n do {\n incr++;\n at = cmp.index() + incr;\n next = at <= len ? parent.getChildAt(at) : null;\n } while (next && !next.get('selectable'));\n\n toSelect.push(next || cmp);\n });\n\n toSelect.length && ed.select(toSelect);\n }\n};\n","export default {\n run(ed) {\n if (!ed.Canvas.hasFocus()) return;\n const toSelect = [];\n\n ed.getSelectedAll().forEach(cmp => {\n const parent = cmp.parent();\n if (!parent) return;\n\n let incr = 0;\n let at = 0;\n let next;\n\n // Get the first selectable component\n do {\n incr++;\n at = cmp.index() - incr;\n next = at >= 0 ? parent.getChildAt(at) : null;\n } while (next && !next.get('selectable'));\n\n toSelect.push(next || cmp);\n });\n\n toSelect.length && ed.select(toSelect);\n }\n};\n","import { isArray, flatten } from 'underscore';\n\nexport default {\n run(ed, s, opts = {}) {\n const { target } = opts;\n let toRemove = [];\n\n if (!target.get('styles')) return toRemove;\n\n // Find all components in the project, of the target component type\n const type = target.get('type');\n const wrappers = ed.Pages.getAllWrappers();\n const len = flatten(wrappers.map(wrp => wrp.findType(type))).length;\n\n // Remove component related styles only if there are no more components\n // of that type in the project\n if (!len) {\n const rules = ed.CssComposer.getAll();\n toRemove = rules.filter(rule => rule.get('group') === `cmp:${type}`);\n rules.remove(toRemove);\n }\n\n return toRemove;\n }\n};\n","export default {\n run(ed) {\n const em = ed.getModel();\n const models = [...ed.getSelectedAll()];\n models.length && em.set('clipboard', models);\n }\n};\n","import { extend, bindAll } from 'underscore';\nimport Backbone from 'backbone';\nimport SelectComponent from './SelectComponent';\n\nconst $ = Backbone.$;\n\nexport default extend({}, SelectComponent, {\n init(o) {\n bindAll(this, 'startDelete', 'stopDelete', 'onDelete');\n this.hoverClass = this.pfx + 'hover-delete';\n this.badgeClass = this.pfx + 'badge-red';\n },\n\n enable() {\n var that = this;\n this.$el\n .find('*')\n .mouseover(this.startDelete)\n .mouseout(this.stopDelete)\n .click(this.onDelete);\n },\n\n /**\n * Start command\n * @param {Object} e\n * @private\n */\n startDelete(e) {\n e.stopPropagation();\n var $this = $(e.target);\n\n // Show badge if possible\n if ($this.data('model').get('removable')) {\n $this.addClass(this.hoverClass);\n this.attachBadge($this.get(0));\n }\n },\n\n /**\n * Stop command\n * @param {Object} e\n * @private\n */\n stopDelete(e) {\n e.stopPropagation();\n var $this = $(e.target);\n $this.removeClass(this.hoverClass);\n\n // Hide badge if possible\n if (this.badge) this.badge.css({ left: -1000, top: -1000 });\n },\n\n /**\n * Delete command\n * @param {Object} e\n * @private\n */\n onDelete(e) {\n e.stopPropagation();\n var $this = $(e.target);\n\n // Do nothing in case can't remove\n if (!$this.data('model').get('removable')) return;\n\n $this.data('model').destroy();\n this.removeBadge();\n this.clean();\n },\n\n /**\n * Updates badge label\n * @param {Object} model\n * @private\n * */\n updateBadgeLabel(model) {\n this.badge.html('Remove ' + model.getName());\n }\n});\n","import Backbone from 'backbone';\nconst $ = Backbone.$;\n\nexport default {\n run(editor, sender, opts = {}) {\n sender && sender.set && sender.set('active', 0);\n const config = editor.getConfig();\n const modal = editor.Modal;\n const pfx = config.stylePrefix;\n this.cm = editor.CodeManager || null;\n\n if (!this.$editors) {\n const oHtmlEd = this.buildEditor('htmlmixed', 'hopscotch', 'HTML');\n const oCsslEd = this.buildEditor('css', 'hopscotch', 'CSS');\n this.htmlEditor = oHtmlEd.el;\n this.cssEditor = oCsslEd.el;\n const $editors = $(`
`);\n $editors.append(oHtmlEd.$el).append(oCsslEd.$el);\n this.$editors = $editors;\n }\n\n modal\n .open({\n title: config.textViewCode,\n content: this.$editors\n })\n .getModel()\n .once('change:open', () => editor.stopCommand(this.id));\n this.htmlEditor.setContent(editor.getHtml());\n this.cssEditor.setContent(editor.getCss());\n },\n\n stop(editor) {\n const modal = editor.Modal;\n modal && modal.close();\n },\n\n buildEditor(codeName, theme, label) {\n const input = document.createElement('textarea');\n !this.codeMirror && (this.codeMirror = this.cm.getViewer('CodeMirror'));\n\n const el = this.codeMirror.clone().set({\n label,\n codeName,\n theme,\n input\n });\n\n const $el = new this.cm.EditorView({\n model: el,\n config: this.cm.getConfig()\n }).render().$el;\n\n el.init(input);\n\n return { el, $el };\n }\n};\n","import { isElement } from 'underscore';\n\nexport default {\n /**\n * Check if fullscreen mode is enabled\n * @return {Boolean}\n */\n isEnabled() {\n var d = document;\n if (\n d.fullscreenElement ||\n d.webkitFullscreenElement ||\n d.mozFullScreenElement\n )\n return 1;\n else return 0;\n },\n\n /**\n * Enable fullscreen mode and return browser prefix\n * @param {HTMLElement} el\n * @return {string}\n */\n enable(el) {\n var pfx = '';\n if (el.requestFullscreen) el.requestFullscreen();\n else if (el.webkitRequestFullscreen) {\n pfx = 'webkit';\n el.webkitRequestFullscreen();\n } else if (el.mozRequestFullScreen) {\n pfx = 'moz';\n el.mozRequestFullScreen();\n } else if (el.msRequestFullscreen) el.msRequestFullscreen();\n else console.warn('Fullscreen not supported');\n return pfx;\n },\n\n /**\n * Disable fullscreen mode\n */\n disable() {\n const d = document;\n if (this.isEnabled()) {\n if (d.exitFullscreen) d.exitFullscreen();\n else if (d.webkitExitFullscreen) d.webkitExitFullscreen();\n else if (d.mozCancelFullScreen) d.mozCancelFullScreen();\n else if (d.msExitFullscreen) d.msExitFullscreen();\n }\n },\n\n /**\n * Triggered when the state of the fullscreen is changed. Inside detects if\n * it's enabled\n * @param {strinf} pfx Browser prefix\n * @param {Event} e\n */\n fsChanged(pfx, e) {\n var d = document;\n var ev = (pfx || '') + 'fullscreenchange';\n if (!this.isEnabled()) {\n this.stop(null, this.sender);\n document.removeEventListener(ev, this.fsChanged);\n }\n },\n\n run(editor, sender, opts = {}) {\n this.sender = sender;\n const { target } = opts;\n const targetEl = isElement(target)\n ? target\n : document.querySelector(target);\n const pfx = this.enable(targetEl || editor.getContainer());\n this.fsChanged = this.fsChanged.bind(this, pfx);\n document.addEventListener(pfx + 'fullscreenchange', this.fsChanged);\n editor.trigger('change:canvasOffset');\n },\n\n stop(editor, sender) {\n if (sender && sender.set) sender.set('active', false);\n this.disable();\n if (editor) editor.trigger('change:canvasOffset');\n }\n};\n","import { extend, bindAll } from 'underscore';\nimport Backbone from 'backbone';\nimport { on, off } from 'utils/mixins';\nimport SelectComponent from './SelectComponent';\nimport SelectPosition from './SelectPosition';\n\nconst $ = Backbone.$;\n\nexport default extend({}, SelectPosition, SelectComponent, {\n init(o) {\n SelectComponent.init.apply(this, arguments);\n bindAll(this, 'initSorter', 'rollback', 'onEndMove');\n this.opt = o;\n this.hoverClass = this.ppfx + 'highlighter-warning';\n this.badgeClass = this.ppfx + 'badge-warning';\n this.noSelClass = this.ppfx + 'no-select';\n },\n\n enable(...args) {\n SelectComponent.enable.apply(this, args);\n this.getBadgeEl().addClass(this.badgeClass);\n this.getHighlighterEl().addClass(this.hoverClass);\n var wp = this.$wrapper;\n wp.css('cursor', 'move');\n wp.on('mousedown', this.initSorter);\n\n // Avoid strange moving behavior\n wp.addClass(this.noSelClass);\n },\n\n /**\n * Overwrite for doing nothing\n * @private\n */\n toggleClipboard() {},\n\n /**\n * Delegate sorting\n * @param {Event} e\n * @private\n * */\n initSorter(e) {\n var el = $(e.target).data('model');\n var drag = el.get('draggable');\n if (!drag) return;\n\n // Avoid badge showing on move\n this.cacheEl = null;\n this.startSelectPosition(e.target, this.frameEl.contentDocument);\n this.sorter.draggable = drag;\n this.sorter.onEndMove = this.onEndMove.bind(this);\n this.stopSelectComponent();\n this.$wrapper.off('mousedown', this.initSorter);\n on(this.getContentWindow(), 'keydown', this.rollback);\n },\n\n /**\n * Init sorter from model\n * @param {Object} model\n * @private\n */\n initSorterFromModel(model) {\n var drag = model.get('draggable');\n if (!drag) return;\n // Avoid badge showing on move\n this.cacheEl = null;\n var el = model.view.el;\n this.startSelectPosition(el, this.frameEl.contentDocument);\n this.sorter.draggable = drag;\n this.sorter.onEndMove = this.onEndMoveFromModel.bind(this);\n\n /*\n this.sorter.setDragHelper(el);\n var dragHelper = this.sorter.dragHelper;\n dragHelper.className = this.ppfx + 'drag-helper';\n dragHelper.innerHTML = '';\n dragHelper.backgroundColor = 'white';\n */\n\n this.stopSelectComponent();\n on(this.getContentWindow(), 'keydown', this.rollback);\n },\n\n /**\n * Init sorter from models\n * @param {Object} model\n * @private\n */\n initSorterFromModels(models) {\n // TODO: if one only check for `draggable`\n // Avoid badge showing on move\n this.cacheEl = null;\n const lastModel = models[models.length - 1];\n const frame = (this.em.get('currentFrame') || {}).model;\n const el = lastModel.getEl(frame);\n const doc = el.ownerDocument;\n this.startSelectPosition(el, doc, { onStart: this.onStart });\n this.sorter.draggable = lastModel.get('draggable');\n this.sorter.toMove = models;\n this.sorter.onMoveClb = this.onDrag;\n this.sorter.onEndMove = this.onEndMoveFromModel.bind(this);\n this.stopSelectComponent();\n on(this.getContentWindow(), 'keydown', this.rollback);\n },\n\n onEndMoveFromModel() {\n off(this.getContentWindow(), 'keydown', this.rollback);\n },\n\n /**\n * Callback after sorting\n * @private\n */\n onEndMove() {\n this.enable();\n off(this.getContentWindow(), 'keydown', this.rollback);\n },\n\n /**\n * Say what to do after the component was selected (selectComponent)\n * @param {Event} e\n * @param {Object} Selected element\n * @private\n * */\n onSelect(e, el) {},\n\n /**\n * Used to bring the previous situation before start moving the component\n * @param {Event} e\n * @param {Boolean} Indicates if rollback in anycase\n * @private\n * */\n rollback(e, force) {\n var key = e.which || e.keyCode;\n if (key == 27 || force) {\n this.sorter.moved = false;\n this.sorter.endMove();\n }\n return;\n },\n\n /**\n * Returns badge element\n * @return {HTMLElement}\n * @private\n */\n getBadgeEl() {\n if (!this.$badge) this.$badge = $(this.getBadge());\n return this.$badge;\n },\n\n /**\n * Returns highlighter element\n * @return {HTMLElement}\n * @private\n */\n getHighlighterEl() {\n if (!this.$hl) this.$hl = $(this.canvas.getHighlighter());\n return this.$hl;\n },\n\n stop(...args) {\n SelectComponent.stop.apply(this, args);\n this.getBadgeEl().removeClass(this.badgeClass);\n this.getHighlighterEl().removeClass(this.hoverClass);\n var wp = this.$wrapper;\n wp.css('cursor', '')\n .unbind()\n .removeClass(this.noSelClass);\n }\n});\n","import { isFunction } from 'underscore';\nimport { createEl } from '../../utils/dom';\n\nexport default {\n open(content) {\n const { editor, title, config, am } = this;\n const { custom } = config;\n if (isFunction(custom.open)) {\n return custom.open(am.__customData());\n }\n const { Modal } = editor;\n Modal.open({ title, content }).onceClose(() => editor.stopCommand(this.id));\n },\n\n close() {\n const { custom } = this.config;\n if (isFunction(custom.close)) {\n return custom.close(this.am.__customData());\n }\n const { Modal } = this.editor;\n Modal && Modal.close();\n },\n\n run(editor, sender, opts = {}) {\n const am = editor.AssetManager;\n const config = am.getConfig();\n const { types = [], accept, select } = opts;\n this.title = opts.modalTitle || editor.t('assetManager.modalTitle') || '';\n this.editor = editor;\n this.config = config;\n this.am = am;\n\n am.setTarget(opts.target);\n am.onClick(opts.onClick);\n am.onDblClick(opts.onDblClick);\n am.onSelect(opts.onSelect);\n am.__behaviour({\n select,\n types,\n options: opts\n });\n\n if (config.custom) {\n this.rendered = this.rendered || createEl('div');\n this.rendered.className = `${config.stylePrefix}custom-wrp`;\n am.__behaviour({ container: this.rendered });\n am.__trgCustom();\n } else {\n if (!this.rendered || types) {\n let assets = am.getAll().filter(i => i);\n\n if (types && types.length) {\n assets = assets.filter(a => types.indexOf(a.get('type')) !== -1);\n }\n\n am.render(assets);\n this.rendered = am.getContainer();\n }\n\n if (accept) {\n const uploadEl = this.rendered.querySelector(\n `input#${config.stylePrefix}uploadFile`\n );\n uploadEl && uploadEl.setAttribute('accept', accept);\n }\n }\n\n this.open(this.rendered);\n return this;\n },\n\n stop(editor) {\n this.editor = editor;\n this.close(this.rendered);\n }\n};\n","import { isFunction } from 'underscore';\nimport { createEl } from '../../utils/dom';\n\nexport default {\n open() {\n const { container, editor, bm, config } = this;\n const { custom, appendTo } = config;\n\n if (isFunction(custom.open)) {\n return custom.open(bm.__customData());\n }\n\n if (this.firstRender && !appendTo) {\n const id = 'views-container';\n const pn = editor.Panels;\n const panels = pn.getPanel(id) || pn.addPanel({ id });\n panels.set('appendContent', container).trigger('change:appendContent');\n if (!custom) container.appendChild(bm.render());\n }\n\n if (container) container.style.display = 'block';\n },\n\n close() {\n const { container, config } = this;\n const { custom } = config;\n\n if (isFunction(custom.close)) {\n return custom.close(this.bm.__customData());\n }\n\n if (container) container.style.display = 'none';\n },\n\n run(editor) {\n const bm = editor.Blocks;\n this.config = bm.getConfig();\n this.firstRender = !this.container;\n this.container = this.container || createEl('div');\n this.editor = editor;\n this.bm = bm;\n const { container } = this;\n bm.__behaviour({\n container\n });\n\n if (this.config.custom) {\n bm.__trgCustom();\n }\n\n this.open();\n },\n\n stop() {\n this.close();\n }\n};\n","export default {\n run(editor) {\n const lm = editor.LayerManager;\n const pn = editor.Panels;\n\n if (lm.getConfig().appendTo) return;\n\n if (!this.layers) {\n const id = 'views-container';\n const layers = document.createElement('div');\n const panels = pn.getPanel(id) || pn.addPanel({ id });\n layers.appendChild(lm.render());\n panels.set('appendContent', layers).trigger('change:appendContent');\n this.layers = layers;\n }\n\n this.layers.style.display = 'block';\n },\n\n stop() {\n const { layers } = this;\n layers && (layers.style.display = 'none');\n }\n};\n","import Backbone from 'backbone';\nconst $ = Backbone.$;\n\nexport default {\n run(em, sender) {\n this.sender = sender;\n\n if (!this.$cn) {\n const config = em.getConfig();\n const panels = em.Panels;\n const trgEvCnt = 'change:appendContent';\n this.$cn = $('
');\n this.$cn2 = $('
');\n this.$cn.append(this.$cn2);\n\n // Device Manager\n const dvm = em.DeviceManager;\n if (dvm && config.showDevices) {\n const devicePanel = panels.addPanel({ id: 'devices-c' });\n const dvEl = dvm.render();\n devicePanel.set('appendContent', dvEl).trigger(trgEvCnt);\n }\n\n // Selector Manager container\n const slm = em.SelectorManager;\n const slmConfig = slm.getConfig();\n if (slmConfig.custom) {\n slm.__trgCustom({ container: this.$cn2.get(0) });\n } else if (!slmConfig.appendTo) {\n this.$cn2.append(slm.render([]));\n }\n\n // Style Manager\n const sm = em.StyleManager;\n const smConfig = sm.getConfig();\n if (!smConfig.appendTo) {\n this.$cn2.append(sm.render());\n const pfx = smConfig.stylePrefix;\n this.$header = $(\n `
${em.t('styleManager.empty')}
`\n );\n this.$cn.append(this.$header);\n }\n\n // Create panel if not exists\n const pnCnt = 'views-container';\n this.panel = panels.getPanel(pnCnt);\n if (!this.panel) this.panel = panels.addPanel({ id: pnCnt });\n\n // Add all containers to the panel\n this.panel.set('appendContent', this.$cn).trigger(trgEvCnt);\n\n this.target = em.editor;\n this.listenTo(this.target, 'component:toggled', this.toggleSm);\n }\n\n this.toggleSm();\n },\n\n /**\n * Toggle Style Manager visibility\n * @private\n */\n toggleSm() {\n const { target, sender } = this;\n if (sender && sender.get && !sender.get('active')) return;\n const { componentFirst } = target.get('SelectorManager').getConfig();\n const selectedAll = target.getSelectedAll().length;\n\n if (selectedAll === 1 || (selectedAll > 1 && componentFirst)) {\n this.$cn2 && this.$cn2.show();\n this.$header && this.$header.hide();\n } else {\n this.$cn2 && this.$cn2.hide();\n this.$header && this.$header.show();\n }\n },\n\n stop() {\n this.$cn2 && this.$cn2.hide();\n this.$header && this.$header.hide();\n }\n};\n","import Backbone from 'backbone';\n\nconst $ = Backbone.$;\n\nexport default {\n run(editor, sender) {\n this.sender = sender;\n const em = editor.getModel();\n\n const config = editor.Config;\n const pfx = config.stylePrefix;\n const tm = editor.TraitManager;\n const confTm = tm.getConfig();\n let panelC;\n\n if (confTm.appendTo) return;\n\n if (!this.$cn) {\n this.$cn = $('
');\n this.$cn2 = $('
');\n this.$cn.append(this.$cn2);\n this.$header = $('
').append(\n `
${em.t(\n 'traitManager.empty'\n )}
`\n );\n this.$cn.append(this.$header);\n this.$cn2.append(\n `
${em.t('traitManager.label')}
`\n );\n this.$cn2.append(tm.render());\n var panels = editor.Panels;\n\n if (!panels.getPanel('views-container'))\n panelC = panels.addPanel({ id: 'views-container' });\n else panelC = panels.getPanel('views-container');\n\n panelC\n .set('appendContent', this.$cn.get(0))\n .trigger('change:appendContent');\n\n this.target = editor.getModel();\n this.listenTo(this.target, 'component:toggled', this.toggleTm);\n }\n\n this.toggleTm();\n },\n\n /**\n * Toggle Trait Manager visibility\n * @private\n */\n toggleTm() {\n const sender = this.sender;\n if (sender && sender.get && !sender.get('active')) return;\n\n if (this.target.getSelectedAll().length === 1) {\n this.$cn2.show();\n this.$header.hide();\n } else {\n this.$cn2.hide();\n this.$header.show();\n }\n },\n\n stop() {\n this.$cn2 && this.$cn2.hide();\n this.$header && this.$header.hide();\n }\n};\n","import { isArray, contains } from 'underscore';\n\nexport default {\n run(ed) {\n const em = ed.getModel();\n const clp = em.get('clipboard');\n const selected = ed.getSelected();\n\n if (clp && selected) {\n ed.getSelectedAll().forEach(comp => {\n if (!comp) return;\n const coll = comp.collection;\n const at = coll.indexOf(comp) + 1;\n const copyable = clp.filter(cop => cop.get('copyable'));\n let added;\n\n if (contains(clp, comp) && comp.get('copyable')) {\n added = coll.add(comp.clone(), { at });\n } else {\n added = coll.add(copyable.map(cop => cop.clone()), { at });\n }\n\n added = isArray(added) ? added : [added];\n added.forEach(add => ed.trigger('component:paste', add));\n });\n\n selected.emitUpdate();\n }\n }\n};\n","import { each } from 'underscore';\n\nconst cmdVis = 'sw-visibility';\n\nexport default {\n getPanels(editor) {\n if (!this.panels) {\n this.panels = editor.Panels.getPanels();\n }\n\n return this.panels;\n },\n\n preventDrag(opts) {\n opts.abort = 1;\n },\n\n tglEffects(on) {\n const { em } = this;\n const mthEv = on ? 'on' : 'off';\n if (em) {\n const canvas = em.get('Canvas');\n const body = canvas.getBody();\n const tlb = canvas.getToolbarEl();\n tlb && (tlb.style.display = on ? 'none' : '');\n const elP = body.querySelectorAll(`.${this.ppfx}no-pointer`);\n each(elP, item => (item.style.pointerEvents = on ? 'all' : ''));\n em[mthEv]('run:tlb-move:before', this.preventDrag);\n }\n },\n\n run(editor, sender) {\n this.sender = sender;\n this.selected = [...editor.getSelectedAll()];\n editor.select();\n\n if (!this.shouldRunSwVisibility) {\n this.shouldRunSwVisibility = editor.Commands.isActive(cmdVis);\n }\n\n this.shouldRunSwVisibility && editor.stopCommand(cmdVis);\n editor.getModel().stopDefault();\n\n const panels = this.getPanels(editor);\n const canvas = editor.Canvas.getElement();\n const editorEl = editor.getEl();\n const pfx = editor.Config.stylePrefix;\n\n if (!this.helper) {\n const helper = document.createElement('span');\n helper.className = `${pfx}off-prv fa fa-eye-slash`;\n editorEl.appendChild(helper);\n helper.onclick = () => this.stopCommand();\n this.helper = helper;\n }\n\n this.helper.style.display = 'inline-block';\n\n panels.forEach(panel => panel.set('visible', false));\n\n const canvasS = canvas.style;\n canvasS.width = '100%';\n canvasS.height = '100%';\n canvasS.top = '0';\n canvasS.left = '0';\n canvasS.padding = '0';\n canvasS.margin = '0';\n editor.refresh();\n this.tglEffects(1);\n },\n\n stop(editor) {\n const { sender = {}, selected } = this;\n sender.set && sender.set('active', 0);\n const panels = this.getPanels(editor);\n\n if (this.shouldRunSwVisibility) {\n editor.runCommand(cmdVis);\n this.shouldRunSwVisibility = false;\n }\n\n editor.getModel().runDefault();\n panels.forEach(panel => panel.set('visible', true));\n\n const canvas = editor.Canvas.getElement();\n canvas.setAttribute('style', '');\n selected && editor.select(selected);\n delete this.selected;\n\n if (this.helper) {\n this.helper.style.display = 'none';\n }\n\n editor.refresh();\n this.tglEffects();\n }\n};\n","export default {\n run(editor, sender, opts) {\n var opt = opts || {};\n var el = opt.el || '';\n var canvas = editor.Canvas;\n var canvasResizer = this.canvasResizer;\n var options = opt.options || {};\n var canvasView = canvas.getCanvasView();\n options.appendTo = canvas.getResizerEl();\n options.prefix = editor.getConfig().stylePrefix;\n options.posFetcher = canvasView.getElementPos.bind(canvasView);\n options.mousePosFetcher = canvas.getMouseRelativePos;\n\n // Create the resizer for the canvas if not yet created\n if (!canvasResizer || opt.forceNew) {\n this.canvasResizer = editor.Utils.Resizer.init(options);\n canvasResizer = this.canvasResizer;\n }\n\n canvasResizer.setOptions(options);\n canvasResizer.blur();\n canvasResizer.focus(el);\n return canvasResizer;\n },\n\n stop() {\n const resizer = this.canvasResizer;\n resizer && resizer.blur();\n }\n};\n","import Backbone from 'backbone';\nimport { isUndefined } from 'underscore';\nimport { isTextNode } from 'utils/mixins';\nconst $ = Backbone.$;\n\nexport default {\n getOffsetMethod(state) {\n var method = state || '';\n return 'get' + method + 'OffsetViewerEl';\n },\n\n run(editor, sender, opts) {\n var opt = opts || {};\n var state = opt.state || '';\n var config = editor.getConfig();\n const zoom = this.em.getZoomDecimal();\n const el = opt.el || '';\n\n if (\n !config.showOffsets ||\n isTextNode(el) ||\n (!config.showOffsetsSelected && state == 'Fixed')\n ) {\n editor.stopCommand(this.id, opts);\n return;\n }\n\n var canvas = editor.Canvas;\n var pos = { ...(opt.elPos || canvas.getElementPos(el)) };\n\n if (!isUndefined(opt.top)) {\n pos.top = opt.top;\n }\n if (!isUndefined(opt.left)) {\n pos.left = opt.left;\n }\n\n var style = window.getComputedStyle(el);\n var ppfx = this.ppfx;\n var stateVar = state + 'State';\n var method = this.getOffsetMethod(state);\n var offsetViewer = canvas[method](opts.view);\n offsetViewer.style.opacity = '';\n\n let marginT = this['marginT' + state];\n let marginB = this['marginB' + state];\n let marginL = this['marginL' + state];\n let marginR = this['marginR' + state];\n let padT = this['padT' + state];\n let padB = this['padB' + state];\n let padL = this['padL' + state];\n let padR = this['padR' + state];\n\n if (offsetViewer.childNodes.length) {\n this[stateVar] = '1';\n marginT = offsetViewer.querySelector('[data-offset-m-t]');\n marginB = offsetViewer.querySelector('[data-offset-m-b]');\n marginL = offsetViewer.querySelector('[data-offset-m-l]');\n marginR = offsetViewer.querySelector('[data-offset-m-r]');\n padT = offsetViewer.querySelector('[data-offset-p-t]');\n padB = offsetViewer.querySelector('[data-offset-p-b]');\n padL = offsetViewer.querySelector('[data-offset-p-l]');\n padR = offsetViewer.querySelector('[data-offset-p-r]');\n }\n\n if (!this[stateVar]) {\n var stateLow = state.toLowerCase();\n var marginName = stateLow + 'margin-v';\n var paddingName = stateLow + 'padding-v';\n var marginV = $(`
`).get(0);\n var paddingV = $(`
`).get(0);\n var marginEls = ppfx + marginName + '-el';\n var paddingEls = ppfx + paddingName + '-el';\n const fullMargName = `${marginEls} ${ppfx + marginName}`;\n const fullPadName = `${paddingEls} ${ppfx + paddingName}`;\n marginT = $(`
`).get(0);\n marginB = $(`
`).get(0);\n marginL = $(`
`).get(0);\n marginR = $(`
`).get(0);\n padT = $(`
`).get(0);\n padB = $(`
`).get(0);\n padL = $(`
`).get(0);\n padR = $(`
`).get(0);\n this['marginT' + state] = marginT;\n this['marginB' + state] = marginB;\n this['marginL' + state] = marginL;\n this['marginR' + state] = marginR;\n this['padT' + state] = padT;\n this['padB' + state] = padB;\n this['padL' + state] = padL;\n this['padR' + state] = padR;\n marginV.appendChild(marginT);\n marginV.appendChild(marginB);\n marginV.appendChild(marginL);\n marginV.appendChild(marginR);\n paddingV.appendChild(padT);\n paddingV.appendChild(padB);\n paddingV.appendChild(padL);\n paddingV.appendChild(padR);\n offsetViewer.appendChild(marginV);\n offsetViewer.appendChild(paddingV);\n this[stateVar] = '1';\n }\n\n var unit = 'px';\n var marginLeftSt = parseFloat(style.marginLeft.replace(unit, '')) * zoom;\n var marginRightSt = parseFloat(style.marginRight.replace(unit, '')) * zoom;\n var marginTopSt = parseFloat(style.marginTop.replace(unit, '')) * zoom;\n var marginBottomSt =\n parseFloat(style.marginBottom.replace(unit, '')) * zoom;\n var mtStyle = marginT.style;\n var mbStyle = marginB.style;\n var mlStyle = marginL.style;\n var mrStyle = marginR.style;\n var ptStyle = padT.style;\n var pbStyle = padB.style;\n var plStyle = padL.style;\n var prStyle = padR.style;\n var posLeft = parseFloat(pos.left);\n var widthEl = parseFloat(style.width) * zoom + unit;\n\n // Margin style\n mtStyle.height = marginTopSt + unit;\n mtStyle.width = widthEl;\n mtStyle.top = pos.top - marginTopSt + unit;\n mtStyle.left = posLeft + unit;\n\n mbStyle.height = marginBottomSt + unit;\n mbStyle.width = widthEl;\n mbStyle.top = pos.top + pos.height + unit;\n mbStyle.left = posLeft + unit;\n\n var marginSideH = pos.height + marginTopSt + marginBottomSt + unit;\n var marginSideT = pos.top - marginTopSt + unit;\n mlStyle.height = marginSideH;\n mlStyle.width = marginLeftSt + unit;\n mlStyle.top = marginSideT;\n mlStyle.left = posLeft - marginLeftSt + unit;\n\n mrStyle.height = marginSideH;\n mrStyle.width = marginRightSt + unit;\n mrStyle.top = marginSideT;\n mrStyle.left = posLeft + pos.width + unit;\n\n // Padding style\n var padTop = parseFloat(style.paddingTop) * zoom;\n ptStyle.height = padTop + unit;\n // ptStyle.width = widthEl;\n // ptStyle.top = pos.top + unit;\n // ptStyle.left = posLeft + unit;\n\n var padBot = parseFloat(style.paddingBottom) * zoom;\n pbStyle.height = padBot + unit;\n // pbStyle.width = widthEl;\n // pbStyle.top = pos.top + pos.height - padBot + unit;\n // pbStyle.left = posLeft + unit;\n\n var padSideH = pos.height - padBot - padTop + unit;\n var padSideT = pos.top + padTop + unit;\n plStyle.height = padSideH;\n plStyle.width = parseFloat(style.paddingLeft) * zoom + unit;\n plStyle.top = padSideT;\n // plStyle.left = pos.left + unit;\n // plStyle.right = 0;\n\n var padRight = parseFloat(style.paddingRight) * zoom;\n prStyle.height = padSideH;\n prStyle.width = padRight + unit;\n prStyle.top = padSideT;\n // prStyle.left = pos.left + pos.width - padRight + unit;\n // prStyle.left = 0;\n },\n\n stop(editor, sender, opts = {}) {\n var opt = opts || {};\n var state = opt.state || '';\n var method = this.getOffsetMethod(state);\n var canvas = editor.Canvas;\n var offsetViewer = canvas[method](opts.view);\n offsetViewer.style.opacity = 0;\n }\n};\n","import { bindAll } from 'underscore';\n\nexport default {\n init() {\n bindAll(this, '_onFramesChange');\n },\n\n run(ed) {\n this.toggleVis(ed);\n },\n\n stop(ed) {\n this.toggleVis(ed, 0);\n },\n\n toggleVis(ed, active = 1) {\n if (!ed.Commands.isActive('preview')) {\n const cv = ed.Canvas;\n const mth = active ? 'on' : 'off';\n cv.getFrames().forEach(frame => this._upFrame(frame, active));\n cv.getModel()[mth]('change:frames', this._onFramesChange);\n }\n },\n\n _onFramesChange(m, frames) {\n frames.forEach(frame => this._upFrame(frame, 1));\n },\n\n _upFrame(frame, active) {\n const method = active ? 'add' : 'remove';\n frame.view.getBody().classList[method](`${this.ppfx}dashed`);\n }\n};\n","/*!\n * Backbone.Undo.js v0.2\n * \n * Copyright (c)2013 Oliver Sartun\n * Released under the MIT License\n *\n * Documentation and full license available at\n * https://github.com/osartun/Backbone.Undo.js\n */\n\n\n(function (factory) {\n\tif (typeof define === \"function\" && define.amd) {\n\t\t// AMD support\n\t\tdefine([\"underscore\", \"backbone\"], factory);\n\t} else if (typeof exports !== 'undefined') {\n\t\t// CommonJS support\n\t\tmodule.exports = factory(\n\t\t\trequire(\"underscore\"),\n\t\t\trequire(\"backbone\")\n\t\t);\n\t} else {\n\t\t// Non-modular execution\n\t\tfactory(_, Backbone);\n }\n})(function (_, Backbone) {\n\n\tvar core_slice = Array.prototype.slice;\n\n\t/**\n\t * As call is faster than apply, this is a faster version of apply as it uses call.\n\t * \n\t * @param {Function} fn \tThe function to execute \n\t * @param {Object} ctx \tThe context the function should be called in\n\t * @param {Array} args \tThe array of arguments that should be applied to the function\n\t * @return Forwards whatever the called function returns\n\t */\n\tfunction apply (fn, ctx, args) {\n\t\treturn args.length <= 4 ?\n\t\t\tfn.call(ctx, args[0], args[1], args[2], args[3]) :\n\t\t\tfn.apply(ctx, args);\n\t}\n\n\t/**\n\t * Uses slice on an array or an array-like object.\n\t * \n\t * @param {Array|Object} \tarr \tThe array or array-like object.\n\t * @param {Number} \t\t[index]\tThe index from where the array should be sliced. Default is 0.\n\t * @return {Array} The sliced array\n\t */\n\tfunction slice (arr, index) {\n\t\treturn core_slice.call(arr, index);\n\t}\n\n\t/**\n\t * Checks if an object has one or more specific keys. The keys \n\t * don't have to be an owned property.\n\t * You can call this function either this way:\n\t * hasKeys(obj, [\"a\", \"b\", \"c\"])\n\t * or this way:\n\t * hasKeys(obj, \"a\", \"b\", \"c\")\n\t * \n\t * @param {Object} \tobj \tThe object to check on\n\t * @param {Array} \tkeys \tThe keys to check for\n\t * @return {Boolean} True, if the object has all those keys\n\t */\n\tfunction hasKeys (obj, keys) {\n\t\tif (obj == null) return false;\n\t\tif (!_.isArray(keys)) {\n\t\t\tkeys = slice(arguments, 1);\n\t\t}\n\t\treturn _.all(keys, function (key) {\n\t\t\treturn key in obj;\n\t\t});\n\t}\n\n\t/**\n\t * Returns a number that is unique per call stack. The number gets \n\t * changed after the call stack has been completely processed.\n\t * \n\t * @return {number} MagicFusionIndex\n\t */\n\tvar getMagicFusionIndex = (function () {\n\t\t// If you add several models to a collection or set several\n\t\t// attributes on a model all in sequence and yet all for\n\t\t// example in one function, then several Undo-Actions are\n\t\t// generated.\n\t\t// If you want to undo your last action only the last model\n\t\t// would be removed from the collection or the last set\n\t\t// attribute would be changed back to its previous value.\n\t\t// To prevent that we have to figure out a way to combine\n\t\t// all those actions that happened \"at the same time\". \n\t\t// Timestamps aren't exact enough. A complex routine could \n\t\t// run several milliseconds and in that time produce a lot \n\t\t// of actions with different timestamps.\n\t\t// Instead we take advantage of the single-threadedness of\n\t\t// JavaScript:\n\n\t\tvar callstackWasIndexed = false, magicFusionIndex = -1;\n\t\tfunction indexCycle() {\n\t\t\tmagicFusionIndex++;\n\t\t\tcallstackWasIndexed = true;\n\t\t\t_.defer(function () {\n\t\t\t\t// Here comes the magic. With a Timeout of 0 \n\t\t\t\t// milliseconds this function gets called whenever\n\t\t\t\t// the current callstack is completed\n\t\t\t\tcallstackWasIndexed = false;\n\t\t\t})\n\t\t}\n\t\treturn function () {\n\t\t\tif (!callstackWasIndexed) {\n\t\t\t\tindexCycle();\n\t\t\t}\n\t\t\treturn magicFusionIndex;\n\t\t}\n\t})();\n\n\t/**\n\t * To prevent binding a listener several times to one \n\t * object, we register the objects in an ObjectRegistry\n\t *\n\t * @constructor\n\t */\n\tfunction ObjectRegistry () {\n\t\t// This uses two different ways of storing\n\t\t// objects: In case the object has a cid\n\t\t// (which Backbone objects typically have)\n\t\t// it uses this cid as an index. That way\n\t\t// the Array's length attribute doesn't \n\t\t// change and the object isn't an item \n\t\t// in the array, but an object-property.\n\t\t// Otherwise it's added to the Array as an\n\t\t// item.\n\t\t// That way we can use the fast property-\n\t\t// lookup and only have to fall back to \n\t\t// iterating over the array in case \n\t\t// non-Backbone-objects are registered.\n\t\tthis.registeredObjects = [];\n\t\t// To return a list of all registered \n\t\t// objects in the 'get' method we have to\n\t\t// store the objects that have a cid in\n\t\t// an additional array. \n\t\tthis.cidIndexes = [];\n\t}\n\tObjectRegistry.prototype = {\n\t\t/**\n\t\t * Returns whether the object is already registered in this ObjectRegistry or not.\n\t\t * \n\t\t * @this \t{ObjectRegistry}\n\t\t * @param \t{Object} \t\t obj \tThe object to check\n\t\t * @return \t{Boolean} True if the object is already registered\n\t\t */\n\t\tisRegistered: function (obj) {\n\t\t\t// This is where we get a performance boost \n\t\t\t// by using the two different ways of storing \n\t\t\t// objects.\n\t\t\treturn obj && obj.cid ? this.registeredObjects[obj.cid] : _.contains(this.registeredObjects, obj);\n\t\t},\n\t\t/**\n\t\t * Registers an object in this ObjectRegistry.\n\t\t * \n\t\t * @this \t{ObjectRegistry}\n\t\t * @param \t{Object} \t\t obj \tThe object to register\n\t\t * @return \t{undefined}\n\t\t */\n\t\tregister: function (obj) {\n\t\t\tif (!this.isRegistered(obj)) {\n\t\t\t\tif (obj && obj.cid) {\n\t\t\t\t\tthis.registeredObjects[obj.cid] = obj;\n\t\t\t\t\tthis.cidIndexes.push(obj.cid);\n\t\t\t\t} else {\n\t\t\t\t\tthis.registeredObjects.push(obj);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\t/**\n\t\t * Unregisters an object from this ObjectRegistry.\n\t\t * \n\t\t * @this {ObjectRegistry}\n\t\t * @param {Object} obj The object to unregister\n\t\t * @return {undefined}\n\t\t */\n\t\tunregister: function (obj) {\n\t\t\tif (this.isRegistered(obj)) {\n\t\t\t\tif (obj && obj.cid) {\n\t\t\t\t\tdelete this.registeredObjects[obj.cid];\n\t\t\t\t\tthis.cidIndexes.splice(_.indexOf(this.cidIndexes, obj.cid), 1);\n\t\t\t\t} else {\n\t\t\t\t\tvar i = _.indexOf(this.registeredObjects, obj);\n\t\t\t\t\tthis.registeredObjects.splice(i, 1);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\t/**\n\t\t * Returns an array of all objects that are currently in this ObjectRegistry.\n\t\t * \n\t\t * @return {Array} An array of all the objects which are currently in the ObjectRegistry\n\t\t */\n\t\tget: function () {\n\t\t\treturn (_.map(this.cidIndexes, function (cid) {return this.registeredObjects[cid];}, this)).concat(this.registeredObjects);\n\t\t}\n\t}\n\n\t/**\n\t * Binds or unbinds the \"all\"-listener for one or more objects.\n\t * \n\t * @param {String} which \tEither \"on\" or \"off\"\n\t * @param {Object[]} objects \tArray of the objects on which the \"all\"-listener should be bound / unbound to\n\t * @param {Function} [fn] \t\tThe function that should be bound / unbound. Optional in case of \"off\"\n\t * @param {Object} [ctx] \tThe context the function should be called in\n\t * @return {undefined}\n\t */\n\tfunction onoff(which, objects, fn, ctx) {\n\t\tfor (var i = 0, l = objects.length, obj; i < l; i++) {\n\t\t\tobj = objects[i];\n\t\t\tif (!obj) continue;\n\t\t\tif (which === \"on\") {\n\t\t\t\tif (!ctx.objectRegistry.register(obj)) {\n\t\t\t\t\t// register returned false, so obj was already registered\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!ctx.objectRegistry.unregister(obj)) {\n\t\t\t\t\t// unregister returned false, so obj wasn't registered\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (_.isFunction(obj[which])) {\n\t\t\t\tobj[which](\"all\", fn, ctx);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Calls the undo/redo-function for a specific action.\n\t * \n\t * @param {String} which \tEither \"undo\" or \"redo\"\n\t * @param {Object} action \tThe Action's attributes\n\t * @return {undefined}\n\t */\n\tfunction actionUndoRedo (which, action) {\n\t\tvar type = action.type, undoTypes = action.undoTypes, fn = !undoTypes[type] || undoTypes[type][which];\n\t\tif (_.isFunction(fn)) {\n\t\t\tfn(action.object, action.before, action.after, action.options);\n\t\t}\n\t}\n\n\t/**\n\t * The main undo/redo function.\n\t *\n\t * @param {String} \t\twhich \t Either \"undo\" or \"redo\"\n\t * @param {UndoManager} \tmanager\t The UndoManager-instance on which an \"undo\"/\"redo\"-Event is triggered afterwards\n\t * @param {UndoStack} \t\tstack \t The UndoStack on which we perform\n\t * @param {Boolean} \t\tmagic \t If true, undoes / redoes all actions with the same magicFusionIndex\n\t * @param {Boolean} \t\teverything If true, undoes / redoes every action that had been tracked\n\t * @return {undefined}\n\t */\n\tfunction managerUndoRedo (which, manager, stack, magic, everything) {\n\t\tif (stack.isCurrentlyUndoRedoing || \n\t\t\t(which === \"undo\" && stack.pointer === -1) ||\n\t\t\t(which === \"redo\" && stack.pointer === stack.length - 1)) {\n\t\t\t// We're either currently in an undo- / redo-process or \n\t\t\t// we reached the end of the stack\n\t\t\treturn;\n\t\t}\n\t\tstack.isCurrentlyUndoRedoing = true;\n\t\tvar action, actions, isUndo = which === \"undo\";\n\t\tif (everything) {\n\t\t\t// Undo / Redo all steps until you reach the stack's beginning / end\n\t\t\tactions = isUndo && stack.pointer === stack.length - 1 || // If at the stack's end calling undo\n\t\t\t\t\t !isUndo && stack.pointer === -1 ? // or at the stack's beginning calling redo\n\t\t\t\t\t _.clone(stack.models) : // => Take all the models. Otherwise:\n\t\t\t\t\t core_slice.apply(stack.models, isUndo ? [0, stack.pointer] : [stack.pointer, stack.length - 1]);\n\t\t} else {\n\t\t\t// Undo / Redo only one step\n\t\t\taction = stack.at(isUndo ? stack.pointer : stack.pointer + 1);\n\t\t\tactions = magic ? stack.where({\"magicFusionIndex\": action.get(\"magicFusionIndex\")}) : [action];\n\t\t}\n\t\t\n\t\tstack.pointer += (isUndo ? -1 : 1) * actions.length;\n\t\twhile (action = isUndo ? actions.pop() : actions.shift()) {\n\t\t\t// Here we're calling the Action's undo / redo method\n\t\t\taction[which]();\n\t\t}\n\t\tstack.isCurrentlyUndoRedoing = false;\n\n\t\tmanager.trigger(which, manager);\n\t}\n\n\t/**\n\t * Checks whether an UndoAction should be created or not. Therefore it checks\n\t * whether a \"condition\" property is set in the undoTypes-object of the specific\n\t * event type. If not, it returns true. If it's set and a boolean, it returns it.\n\t * If it's a function, it returns its result, converting it into a boolean. \n\t * Otherwise it returns true.\n\t * \n\t * @param {Object} \tundoTypesType \tThe object within the UndoTypes that holds the function for this event type (i.e. \"change\")\n\t * @param {Arguments} \targs \t\tThe arguments the \"condition\" function is called with\n\t * @return {Boolean} \tTrue, if an UndoAction should be created\n\t */\n\tfunction validateUndoActionCreation (undoTypesType, args) {\n\t\tvar condition = undoTypesType.condition, type = typeof condition;\n\t\treturn type === \"function\" ? !!apply(condition, undoTypesType, args) :\n\t\t\ttype === \"boolean\" ? condition : true;\n\t}\n\n\t/**\n\t * Adds an Undo-Action to the stack.\n\t * \n\t * @param {UndoStack} \t\tstack \t\tThe undostack the action should be added to.\n\t * @param {String} \t\t\ttype \t\tThe event type (i.e. \"change\")\n\t * @param {Arguments} \t\targs \t\tThe arguments passed to the undoTypes' \"on\"-handler\n\t * @param {OwnedUndoTypes} \tundoTypes \tThe undoTypes-object which has the \"on\"-handler\n\t * @return {undefined}\n\t */\n\tfunction addToStack(stack, type, args, undoTypes) {\n\t\tif (stack.track && !stack.isCurrentlyUndoRedoing && type in undoTypes &&\n\t\t\tvalidateUndoActionCreation(undoTypes[type], args)) {\n\t\t\t// An UndoAction should be created\n\t\t\tvar res = apply(undoTypes[type][\"on\"], undoTypes[type], args), diff;\n\t\t\tif (hasKeys(res, \"object\", \"before\", \"after\")) {\n\t\t\t\tres.type = type;\n\t\t\t\tres.magicFusionIndex = getMagicFusionIndex();\n\t\t\t\tres.undoTypes = undoTypes;\n\t\t\t\tif (stack.pointer < stack.length - 1) {\n\t\t\t\t\t// New Actions must always be added to the end of the stack.\n\t\t\t\t\t// If the pointer is not pointed to the last action in the\n\t\t\t\t\t// stack, presumably because actions were undone before, then\n\t\t\t\t\t// all following actions must be discarded\n\t\t\t\t\tvar diff = stack.length - stack.pointer - 1;\n\t\t\t\t\twhile (diff--) {\n\t\t\t\t\t\tstack.pop();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstack.pointer = stack.length;\n\t\t\t\tstack.add(res);\n\t\t\t\tif (stack.length > stack.maximumStackLength) {\n\t\t\t\t\tstack.shift();\n\t\t\t\t\tstack.pointer--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\t/**\n\t * Predefined UndoTypes object with default handlers for the most common events.\n\t * @type {Object}\n\t */\n\tvar UndoTypes = {\n\t\t\"add\": {\n\t\t\t\"undo\": function (collection, ignore, model, options) {\n\t\t\t\t// Undo add = remove\n\t\t\t\tcollection.remove(model, options);\n\t\t\t},\n\t\t\t\"redo\": function (collection, ignore, model, options) {\n\t\t\t\t// Redo add = add\n\t\t\t\tif (options.index) {\n\t\t\t\t\toptions.at = options.index;\n\t\t\t\t}\n\t\t\t\tcollection.add(model, options);\n\t\t\t},\n\t\t\t\"on\": function (model, collection, options) {\n\t\t\t\treturn {\n\t\t\t\t\tobject: collection,\n\t\t\t\t\tbefore: undefined,\n\t\t\t\t\tafter: model,\n\t\t\t\t\toptions: _.clone(options)\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\t\"remove\": {\n\t\t\t\"undo\": function (collection, model, ignore, options) {\n\t\t\t\tif (\"index\" in options) {\n\t\t\t\t\toptions.at = options.index;\n\t\t\t\t}\n\t\t\t\tcollection.add(model, options);\n\t\t\t},\n\t\t\t\"redo\": function (collection, model, ignore, options) {\n\t\t\t\tcollection.remove(model, options);\n\t\t\t},\n\t\t\t\"on\": function (model, collection, options) {\n\t\t\t\treturn {\n\t\t\t\t\tobject: collection,\n\t\t\t\t\tbefore: model,\n\t\t\t\t\tafter: undefined,\n\t\t\t\t\toptions: _.clone(options)\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\t\"change\": {\n\t\t\t\"undo\": function (model, before, after, options) {\n\t\t\t\tif (_.isEmpty(before)) {\n\t\t\t\t\t_.each(_.keys(after), model.unset, model);\n\t\t\t\t} else {\n\t\t\t\t\tmodel.set(before);\n\t\t\t\t\tif (options && options.unsetData && options.unsetData.before && options.unsetData.before.length) {\n\t\t\t\t\t\t_.each(options.unsetData.before, model.unset, model);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"redo\": function (model, before, after, options) {\n\t\t\t\tif (_.isEmpty(after)) {\n\t\t\t\t\t_.each(_.keys(before), model.unset, model);\n\t\t\t\t} else {\n\t\t\t\t\tmodel.set(after);\n\t\t\t\t\tif (options && options.unsetData && options.unsetData.after && options.unsetData.after.length) {\n\t\t\t\t\t\t_.each(options.unsetData.after, model.unset, model);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"on\": function (model, options) {\n\t\t\t\tvar\n\t\t\t\tafterAttributes = model.changedAttributes(),\n\t\t\t\tkeysAfter = _.keys(afterAttributes),\n\t\t\t\tpreviousAttributes = _.pick(model.previousAttributes(), keysAfter),\n\t\t\t\tkeysPrevious = _.keys(previousAttributes),\n\t\t\t\tunsetData = (options || (options = {})).unsetData = {\n\t\t\t\t\tafter: [],\n\t\t\t\t\tbefore: []\n\t\t\t\t};\n\n\t\t\t\tif (keysAfter.length != keysPrevious.length) {\n\t\t\t\t\t// There are new attributes or old attributes have been unset\n\t\t\t\t\tif (keysAfter.length > keysPrevious.length) {\n\t\t\t\t\t\t// New attributes have been added\n\t\t\t\t\t\t_.each(keysAfter, function (val) {\n\t\t\t\t\t\t\tif (!(val in previousAttributes)) {\n\t\t\t\t\t\t\t\tunsetData.before.push(val);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Old attributes have been unset\n\t\t\t\t\t\t_.each(keysPrevious, function (val) {\n\t\t\t\t\t\t\tif (!(val in afterAttributes)) {\n\t\t\t\t\t\t\t\tunsetData.after.push(val);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tobject: model,\n\t\t\t\t\tbefore: previousAttributes,\n\t\t\t\t\tafter: afterAttributes,\n\t\t\t\t\toptions: _.clone(options)\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\t\"reset\": {\n\t\t\t\"undo\": function (collection, before, after) {\n\t\t\t\tcollection.reset(before);\n\t\t\t},\n\t\t\t\"redo\": function (collection, before, after) {\n\t\t\t\tcollection.reset(after);\n\t\t\t},\n\t\t\t\"on\": function (collection, options) {\n\t\t\t\treturn {\n\t\t\t\t\tobject: collection,\n\t\t\t\t\tbefore: options.previousModels,\n\t\t\t\t\tafter: _.clone(collection.models)\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * Every UndoManager instance has an own undoTypes object\n\t * which is an instance of OwnedUndoTypes. OwnedUndoTypes' \n\t * prototype is the global UndoTypes object. Changes to the \n\t * global UndoTypes object take effect on every instance of\n\t * UndoManager as the object is its prototype. And yet every \n\t * local UndoTypes object can be changed individually.\n\t *\n\t * @constructor\n\t */\n\tfunction OwnedUndoTypes () {}\n\tOwnedUndoTypes.prototype = UndoTypes;\n\n\t/**\n\t * Adds, changes or removes an undo-type from an UndoTypes-object.\n\t * You can call it this way:\n\t * manipulateUndoType (1, \"reset\", {\"on\": function () {}}, undoTypes)\n\t * or this way to perform bulk actions:\n\t * manipulateUndoType (1, {\"reset\": {\"on\": function () {}}}, undoTypes)\n\t * In case of removing undo-types you can pass an Array for performing\n\t * bulk actions:\n\t * manipulateUndoType(2, [\"reset\", \"change\"], undoTypes)\n\t * \n\t * @param {Number} \t\t\t\t manipType \t\tIndicates the kind of action to execute: 0 for add, 1 for change, 2 for remove\n\t * @param {String|Object|Array} \t undoType \t\t\tThe type of undoType that should be added/changed/removed. Can be an object / array to perform bulk actions\n\t * @param {Object} \t\t\t\t [fns] \t\t\tObject with the functions to add / change. Is optional in case you passed an object as undoType that contains these functions\n\t * @param {OwnedUndoTypes|UndoTypes} undoTypesInstance The undoTypes object to act on\n\t * @return {undefined}\n\t */\n\tfunction manipulateUndoType (manipType, undoType, fns, undoTypesInstance) {\n\t\t// manipType, passed by the calling function\n\t\t// 0: add\n\t\t// 1: change\n\t\t// 2: remove\n\t\tif (typeof undoType === \"object\") {\n\t\t\t// bulk action. Iterate over this data.\n\t\t\treturn _.each(undoType, function (val, key) {\n\t\t\t\t\tif (manipType === 2) { // remove\n\t\t\t\t\t\t// undoType is an array\n\t\t\t\t\t\tmanipulateUndoType (manipType, val, fns, undoTypesInstance);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// undoType is an object\n\t\t\t\t\t\tmanipulateUndoType (manipType, key, val, fns);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t}\n\n\t\tswitch (manipType) {\n\t\t\tcase 0: // add\n\t\t\t\tif (hasKeys(fns, \"undo\", \"redo\", \"on\") && _.all(_.pick(fns, \"undo\", \"redo\", \"on\"), _.isFunction)) {\n\t\t\t\t\tundoTypesInstance[undoType] = fns;\n\t\t\t\t} \n\t\t\tbreak;\n\t\t\tcase 1: // change\n\t\t\t\tif (undoTypesInstance[undoType] && _.isObject(fns)) {\n\t\t\t\t\t// undoTypeInstance[undoType] may be a prototype's property\n\t\t\t\t\t// So, if we did this _.extend(undoTypeInstance[undoType], fns)\n\t\t\t\t\t// we would extend the object on the prototype which means\n\t\t\t\t\t// that this change would have a global effect\n\t\t\t\t\t// Instead we just want to manipulate this instance. That's why\n\t\t\t\t\t// we're doing this:\n\t\t\t\t\tundoTypesInstance[undoType] = _.extend({}, undoTypesInstance[undoType], fns);\n\t\t\t\t} \n\t\t\tbreak;\n\t\t\tcase 2: // remove\n\t\t\t\tdelete undoTypesInstance[undoType]; \n\t\t\tbreak;\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * Instantiating \"Action\" creates the UndoActions that \n\t * are collected in an UndoStack. It holds all relevant \n\t * data to undo / redo an action and has an undo / redo \n\t * method.\n\t */\n\tvar Action = Backbone.Model.extend({\n\t\tdefaults: {\n\t\t\ttype: null, // \"add\", \"change\", \"reset\", etc.\n\t\t\tobject: null, // The object on which the action occurred\n\t\t\tbefore: null, // The previous values which were changed with this action\n\t\t\tafter: null, // The values after this action\n\t\t\tmagicFusionIndex: null // The magicFusionIndex helps to combine \n\t\t\t// all actions that occurred \"at the same time\" to undo/redo them altogether\n\t\t},\n\t\t/**\n\t\t * Undoes this action.\n\t\t * @param {OwnedUndoTypes|UndoTypes} undoTypes The undoTypes object which contains the \"undo\"-handler that should be used\n\t\t * @return {undefined}\n\t\t */\n\t\tundo: function (undoTypes) {\n\t\t\tactionUndoRedo(\"undo\", this.attributes);\n\t\t},\n\t\t/**\n\t\t * Redoes this action.\n\t\t * @param {OwnedUndoTypes|UndoTypes} undoTypes The undoTypes object which contains the \"redo\"-handler that should be used\n\t\t * @return {undefined}\n\t\t */\n\t\tredo: function (undoTypes) {\n\t\t\tactionUndoRedo(\"redo\", this.attributes);\n\t\t}\n\t}),\n\t/**\n\t * An UndoStack is a collection of UndoActions in \n\t * chronological order.\n\t */\n\tUndoStack = Backbone.Collection.extend({\n\t\tmodel: Action,\n\t\tpointer: -1, // The pointer indicates the index where we are located within the stack. We start at -1\n\t\ttrack: false,\n\t\tisCurrentlyUndoRedoing: false,\n\t\tmaximumStackLength: Infinity,\n\t\tsetMaxLength: function (val) {\n\t\t\tthis.maximumStackLength = val;\n\t\t}\n\t}),\n\t/**\n\t * An instance of UndoManager can keep track of \n\t * changes to objects and helps to undo them.\n\t */\n\tUndoManager = Backbone.Model.extend({\n\t\tdefaults: {\n\t\t\tmaximumStackLength: Infinity,\n\t\t\ttrack: false\n\t\t},\n\t\t/**\n\t\t * The constructor function.\n\t\t * @param {attr} \t\t[attr] Object with parameters. The available parameters are:\n\t\t * \t - maximumStackLength {number} \tSet the undo-stack's maximum size\n\t\t * - track \t\t\t\t{boolean}\tStart tracking changes right away\n\t\t * @return {undefined}\n\t\t */\n\t\tinitialize: function (attr) {\n\t\t\tthis.stack = new UndoStack;\n\t\t\tthis.objectRegistry = new ObjectRegistry();\n\t\t\tthis.undoTypes = new OwnedUndoTypes();\n\n\t\t\t// sync the maximumStackLength attribute with our stack\n\t\t\tthis.stack.setMaxLength(this.get(\"maximumStackLength\"));\n\t\t\tthis.on(\"change:maximumStackLength\", function (model, value) {\n\t\t\t\tthis.stack.setMaxLength(value);\n\t\t\t}, this);\n\n\t\t\t// Start tracking, if attr.track == true\n\t\t\tif (attr && attr.track) {\n\t\t\t\tthis.startTracking();\n\t\t\t}\n\n\t\t\t// Register objects passed in the \"register\" attribute\n\t\t\tif (attr && attr.register) {\n\t\t\t\tif (_.isArray(attr.register) || _.isArguments(attr.register)) {\n\t\t\t\t\tapply(this.register, this, attr.register);\n\t\t\t\t} else {\n\t\t\t\t\tthis.register(attr.register);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Starts tracking. Changes of registered objects won't be processed until you've called this function\n\t\t * @return {undefined}\n\t\t */\n\t\tstartTracking: function () {\n\t\t\tthis.set(\"track\", true);\n\t\t\tthis.stack.track = true;\n\t\t},\n\t\t/**\n\t\t * Stops tracking. Afterwards changes of registered objects won't be processed.\n\t\t * @return {undefined}\n\t\t */\n\t\tstopTracking: function () {\n\t\t\tthis.set(\"track\", false);\n\t\t\tthis.stack.track = false;\n\t\t},\n\t\t/**\n\t\t * Return the state of the tracking\n\t\t * @return {boolean}\n\t\t */\n\t\tisTracking: function () {\n\t\t\treturn this.get(\"track\");\n\t\t},\n\t\t/**\n\t\t * This is the \"all\"-handler which is bound to registered \n\t\t * objects. It creates an UndoAction from the event and adds \n\t\t * it to the stack.\n\t\t * \n\t\t * @param {String} \ttype \tThe event type\n\t\t * @return {undefined}\n\t\t */\n\t\t_addToStack: function (type) {\n\t\t\taddToStack(this.stack, type, slice(arguments, 1), this.undoTypes);\n\t\t},\n\t\t/**\n\t\t * Registers one or more objects to track their changes.\n\t\t * @param {...Object} \tobj \tThe object or objects of which changes should be tracked\n\t\t * @return {undefined}\n\t\t */\n\t\tregister: function () {\n\t\t\tonoff(\"on\", arguments, this._addToStack, this);\n\t\t},\n\t\t/**\n\t\t * Unregisters one or more objects.\n\t\t * @param {...Object} \tobj \tThe object or objects of which changes shouldn't be tracked any longer\n\t\t * @return {undefined}\n\t\t */\n\t\tunregister: function () {\n\t\t\tonoff(\"off\", arguments, this._addToStack, this);\n\t\t},\n\t\t/**\n\t\t * Unregisters all previously registered objects.\n\t\t * @return {undefined}\n\t\t */\n\t\tunregisterAll: function () {\n\t\t\tapply(this.unregister, this, this.objectRegistry.get());\n\t\t},\n\t\t/**\n\t\t * Undoes the last action or the last set of actions in case 'magic' is true.\n\t\t * @param {Boolean} \t[magic] \tIf true, all actions that happened basically at the same time are undone together\n\t\t * @return {undefined}\n\t\t */\n\t\tundo: function (magic) {\n\t\t\tmanagerUndoRedo(\"undo\", this, this.stack, magic);\n\t\t},\n\n\t\t/**\n\t\t * Undoes all actions ever tracked by the undo manager\n\t\t * @return {undefined}\n\t\t */\n\t\tundoAll: function () {\n\t\t\tmanagerUndoRedo(\"undo\", this, this.stack, false, true);\n\t\t},\n\n\t\t/**\n\t\t * Redoes a previously undone action or a set of actions.\n\t\t * @param {Boolean} \t[magic] \tIf true, all actions that happened basically at the same time are redone together\n\t\t * @return {undefined}\n\t\t */\n\t\tredo: function (magic) {\n\t\t\tmanagerUndoRedo(\"redo\", this, this.stack, magic);\n\t\t},\n\n\t\t/**\n\t\t * Redoes all actions ever tracked by the undo manager\n\t\t * @return {undefined}\n\t\t */\n\t\tredoAll: function () {\n\t\t\tmanagerUndoRedo(\"redo\", this, this.stack, false, true);\n\t\t},\n\t\t/**\n\t\t * Checks if there's an action in the stack that can be undone / redone\n\t\t * @param {String} \ttype \tEither \"undo\" or \"redo\"\n\t\t * @return {Boolean} True if there is a set of actions which can be undone / redone\n\t\t */\n\t\tisAvailable: function (type) {\n\t\t\tvar s = this.stack, l = s.length;\n\n\t\t\tswitch (type) {\n\t\t\t\tcase \"undo\": return l > 0 && s.pointer > -1;\n\t\t\t\tcase \"redo\": return l > 0 && s.pointer < l - 1;\n\t\t\t\tdefault: return false;\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Sets the stack-reference to the stack of another undoManager.\n\t\t * @param {UndoManager} \tundoManager \tThe undoManager whose stack-reference is set to this stack\n\t\t * @return {undefined}\n\t\t */\n\t\tmerge: function (undoManager) {\n\t\t\t// This sets the stack-reference to the stack of another \n\t\t\t// undoManager so that the stack of this other undoManager \n\t\t\t// is used by two different managers.\n\t\t\t// This enables to set up a main-undoManager and besides it\n\t\t\t// several others for special, exceptional cases (by using\n\t\t\t// instance-based custom UndoTypes). Models / collections \n\t\t\t// which need this special treatment are only registered at \n\t\t\t// those special undoManagers. Those special ones are then \n\t\t\t// merged into the main-undoManager to write on its stack. \n\t\t\t// That way it's easier to manage exceptional cases.\n\t\t\tvar args = _.isArray(undoManager) ? undoManager : slice(arguments), manager;\n\t\t\twhile (manager = args.pop()) {\n\t\t\t\tif (manager instanceof UndoManager &&\n\t\t\t\t\tmanager.stack instanceof UndoStack) {\n\t\t\t\t\t// set the stack reference to our stack\n\t\t\t\t\tmanager.stack = this.stack;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Add an UndoType to this specific UndoManager-instance.\n\t\t * @param {String} type The event this UndoType is made for\n\t\t * @param {Object} fns An object of functions that are called to generate the data for an UndoAction or to process it. Must have the properties \"undo\", \"redo\" and \"on\". Can have the property \"condition\".\n\t\t * @return {undefined}\n\t\t */\n\t\taddUndoType: function (type, fns) {\n\t\t\tmanipulateUndoType(0, type, fns, this.undoTypes);\n\t\t},\n\t\t/**\n\t\t * Overwrite properties of an existing UndoType for this specific UndoManager-instance.\n\t\t * @param {String} type The event the UndoType is made for\n\t\t * @param {Object} fns An object of functions that are called to generate the data for an UndoAction or to process it. It extends the existing object.\n\t\t * @return {undefined}\n\t\t */\n\t\tchangeUndoType: function (type, fns) {\n\t\t\tmanipulateUndoType(1, type, fns, this.undoTypes);\n\t\t},\n\t\t/**\n\t\t * Remove one or more UndoTypes of this specific UndoManager-instance to fall back to the global UndoTypes.\n\t\t * @param {String|Array} type The event the UndoType that should be removed is made for. You can also pass an array of events.\n\t\t * @return {undefined}\n\t\t */\n\t\tremoveUndoType: function (type) {\n\t\t\tmanipulateUndoType(2, type, undefined, this.undoTypes);\n\t\t},\n\n\t\t/**\n\t\t * Removes all actions from the stack.\n\t\t * @return {undefined}\n\t\t */\n\t\tclear: function() {\n\t\t\tthis.stack.reset();\n\t\t\tthis.stack.pointer = -1;\n\t\t}\n\t});\n\n\t_.extend(UndoManager, {\n\t\t/**\n\t\t * Change the UndoManager's default attributes\n\t\t * @param {Object} defaultAttributes An object with the new default values.\n\t\t * @return {undefined}\n\t\t */\n\t\tdefaults: function (defaultAttributes) {\n\t\t\t_.extend(UndoManager.prototype.defaults, defaultAttributes);\n\t\t},\n\t\t/**\n\t\t * Add an UndoType to the global UndoTypes-object.\n\t\t * @param {String} type The event this UndoType is made for\n\t\t * @param {Object} fns An object of functions that are called to generate the data for an UndoAction or to process it. Must have the properties \"undo\", \"redo\" and \"on\". Can have the property \"condition\".\n\t\t * @return {undefined}\n\t\t */\n\t\t\"addUndoType\": function (type, fns) {\n\t\t\tmanipulateUndoType(0, type, fns, UndoTypes);\n\t\t},\n\t\t/**\n\t\t * Overwrite properties of an existing UndoType in the global UndoTypes-object.\n\t\t * @param {String} type The event the UndoType is made for\n\t\t * @param {Object} fns An object of functions that are called to generate the data for an UndoAction or to process it. It extends the existing object.\n\t\t * @return {undefined}\n\t\t */\n\t\t\"changeUndoType\": function (type, fns) {\n\t\t\tmanipulateUndoType(1, type, fns, UndoTypes)\n\t\t},\n\t\t/**\n\t\t * Remove one or more UndoTypes of this specific UndoManager-instance to fall back to the global UndoTypes.\n\t\t * @param {String|Array} type The event the UndoType that should be removed is made for. You can also pass an array of events.\n\t\t * @return {undefined}\n\t\t */\n\t\t\"removeUndoType\": function (type) {\n\t\t\tmanipulateUndoType(2, type, undefined, UndoTypes);\n\t\t}\n\t})\n\n\treturn Backbone.UndoManager = UndoManager;\n\n});\n","/**\n * @this {Promise}\n */\nfunction finallyConstructor(callback) {\n var constructor = this.constructor;\n return this.then(\n function(value) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n return value;\n });\n },\n function(reason) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n // @ts-ignore\n return constructor.reject(reason);\n });\n }\n );\n}\n\nexport default finallyConstructor;\n","function allSettled(arr) {\n var P = this;\n return new P(function(resolve, reject) {\n if (!(arr && typeof arr.length !== 'undefined')) {\n return reject(\n new TypeError(\n typeof arr +\n ' ' +\n arr +\n ' is not iterable(cannot read property Symbol(Symbol.iterator))'\n )\n );\n }\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n function(e) {\n args[i] = { status: 'rejected', reason: e };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n );\n return;\n }\n }\n args[i] = { status: 'fulfilled', value: val };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n}\n\nexport default allSettled;\n","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\n\nmodule.exports = _arrayWithoutHoles;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableSpread;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutPropertiesLoose;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","/**\n * This module allows to manage the stack of changes applied in canvas.\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const um = editor.UndoManager;\n * ```\n *\n * * [getConfig](#getconfig)\n * * [add](#add)\n * * [remove](#remove)\n * * [removeAll](#removeall)\n * * [start](#start)\n * * [stop](#stop)\n * * [undo](#undo)\n * * [undoAll](#undoall)\n * * [redo](#redo)\n * * [redoAll](#redoall)\n * * [hasUndo](#hasundo)\n * * [hasRedo](#hasredo)\n * * [getStack](#getstack)\n * * [clear](#clear)\n *\n * @module UndoManager\n */\n\nimport UndoManager from 'backbone-undo';\nimport { isArray, isBoolean, isEmpty } from 'underscore';\n\nexport default () => {\n let em;\n let um;\n let config;\n let beforeCache;\n const configDef = {\n maximumStackLength: 500,\n trackSelection: 1\n };\n const hasSkip = opts => opts.avoidStore || opts.noUndo;\n const getChanged = obj => Object.keys(obj.changedAttributes());\n\n return {\n name: 'UndoManager',\n\n /**\n * Initialize module\n * @param {Object} config Configurations\n * @private\n */\n init(opts = {}) {\n config = { ...configDef, ...opts };\n em = config.em;\n this.em = em;\n const fromUndo = true;\n um = new UndoManager({ track: true, register: [], ...config });\n um.changeUndoType('change', {\n condition: object => {\n const hasUndo = object.get('_undo');\n if (hasUndo) {\n const undoExc = object.get('_undoexc');\n if (isArray(undoExc)) {\n if (getChanged(object).some(chn => undoExc.indexOf(chn) >= 0))\n return false;\n }\n if (isBoolean(hasUndo)) return true;\n if (isArray(hasUndo)) {\n if (getChanged(object).some(chn => hasUndo.indexOf(chn) >= 0))\n return true;\n }\n }\n return false;\n },\n on(object, v, opts) {\n !beforeCache && (beforeCache = object.previousAttributes());\n const opt = opts || v || {};\n opt.noUndo &&\n setTimeout(() => {\n beforeCache = null;\n });\n if (hasSkip(opt)) {\n return;\n } else {\n const after = object.toJSON({ fromUndo });\n const result = {\n object,\n before: beforeCache,\n after\n };\n beforeCache = null;\n // Skip undo in case of empty changes\n if (isEmpty(after)) return;\n\n return result;\n }\n }\n });\n um.changeUndoType('add', {\n on: (model, collection, options = {}) => {\n if (hasSkip(options) || !this.isRegistered(collection)) return;\n return {\n object: collection,\n before: undefined,\n after: model,\n options: { ...options, fromUndo }\n };\n }\n });\n um.changeUndoType('remove', {\n on: (model, collection, options = {}) => {\n if (hasSkip(options) || !this.isRegistered(collection)) return;\n return {\n object: collection,\n before: model,\n after: undefined,\n options: { ...options, fromUndo }\n };\n }\n });\n\n um.on('undo redo', () => {\n em.trigger('component:toggled change:canvasOffset');\n em.getSelectedAll().map(c => c.trigger('rerender:layer'));\n });\n ['undo', 'redo'].forEach(ev => um.on(ev, () => em.trigger(ev)));\n\n return this;\n },\n\n postLoad() {\n config.trackSelection && em && this.add(em.get('selected'));\n },\n\n /**\n * Get module configurations\n * @return {Object} Configuration object\n * @example\n * const config = um.getConfig();\n * // { ... }\n */\n getConfig() {\n return config;\n },\n\n /**\n * Add an entity (Model/Collection) to track\n * Note: New Components and CSSRules will be added automatically\n * @param {Model|Collection} entity Entity to track\n * @return {this}\n * @example\n * um.add(someModelOrCollection);\n */\n add(entity) {\n um.register(entity);\n return this;\n },\n\n /**\n * Remove and stop tracking the entity (Model/Collection)\n * @param {Model|Collection} entity Entity to remove\n * @return {this}\n * @example\n * um.remove(someModelOrCollection);\n */\n remove(entity) {\n um.unregister(entity);\n return this;\n },\n\n /**\n * Remove all entities\n * @return {this}\n * @example\n * um.removeAll();\n */\n removeAll() {\n um.unregisterAll();\n return this;\n },\n\n /**\n * Start/resume tracking changes\n * @return {this}\n * @example\n * um.start();\n */\n start() {\n um.startTracking();\n return this;\n },\n\n /**\n * Stop tracking changes\n * @return {this}\n * @example\n * um.stop();\n */\n stop() {\n um.stopTracking();\n return this;\n },\n\n /**\n * Undo last change\n * @return {this}\n * @example\n * um.undo();\n */\n undo(all = true) {\n !em.isEditing() && um.undo(all);\n return this;\n },\n\n /**\n * Undo all changes\n * @return {this}\n * @example\n * um.undoAll();\n */\n undoAll() {\n um.undoAll();\n return this;\n },\n\n /**\n * Redo last change\n * @return {this}\n * @example\n * um.redo();\n */\n redo(all = true) {\n !em.isEditing() && um.redo(all);\n return this;\n },\n\n /**\n * Redo all changes\n * @return {this}\n * @example\n * um.redoAll();\n */\n redoAll() {\n um.redoAll();\n return this;\n },\n\n /**\n * Checks if exists an available undo\n * @return {Boolean}\n * @example\n * um.hasUndo();\n */\n hasUndo() {\n return um.isAvailable('undo');\n },\n\n /**\n * Checks if exists an available redo\n * @return {Boolean}\n * @example\n * um.hasRedo();\n */\n hasRedo() {\n return um.isAvailable('redo');\n },\n\n /**\n * Check if the entity (Model/Collection) to tracked\n * Note: New Components and CSSRules will be added automatically\n * @param {Model|Collection} entity Entity to track\n * @returns {Boolean}\n */\n isRegistered(obj) {\n return !!this.getInstance().objectRegistry.isRegistered(obj);\n },\n\n /**\n * Get stack of changes\n * @return {Collection}\n * @example\n * const stack = um.getStack();\n * stack.each(item => ...);\n */\n getStack() {\n return um.stack;\n },\n\n /**\n * Get grouped undo manager stack.\n * The difference between `getStack` is when you do multiple operations at a time,\n * like appending multiple components:\n * `editor.getWrapper().append(`
C1
C2
`);`\n * `getStack` will return a collection length of 2.\n * `getStackGroup` instead will group them as a single operation (the first\n * inserted component will be returned in the list) by returning an array length of 1.\n * @return {Array}\n */\n getStackGroup() {\n const result = [];\n const inserted = [];\n\n this.getStack().forEach(item => {\n const index = item.get('magicFusionIndex');\n if (inserted.indexOf(index) < 0) {\n inserted.push(index);\n result.push(item);\n }\n });\n\n return result;\n },\n\n __getStackRead() {\n const result = {};\n const createItem = item => {\n const { type, after, before, object } = item.attributes;\n return {\n type,\n after,\n before,\n object\n };\n };\n this.getStack().forEach(item => {\n const index = item.get('magicFusionIndex');\n const value = createItem(item);\n if (!result[index]) result[index] = [value];\n else result[index].push(value);\n });\n return Object.keys(result).map(i => result[i]);\n },\n\n getPointer() {\n return this.getStack().pointer;\n },\n\n /**\n * Clear the stack\n * @return {this}\n * @example\n * um.clear();\n */\n clear() {\n um.clear();\n return this;\n },\n\n getInstance() {\n return um;\n },\n\n destroy() {\n this.clear().removeAll();\n [em, um, config, beforeCache].forEach(i => (i = {}));\n this.em = {};\n }\n };\n};\n","var scope = (typeof global !== \"undefined\" && global) ||\n (typeof self !== \"undefined\" && self) ||\n window;\nvar apply = Function.prototype.apply;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) {\n if (timeout) {\n timeout.close();\n }\n};\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(scope, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// setimmediate attaches itself to the global object\nrequire(\"setimmediate\");\n// On some exotic environments, it's not clear which object `setimmediate` was\n// able to install onto. Search each possibility in the same order as the\n// `setimmediate` library.\nexports.setImmediate = (typeof self !== \"undefined\" && self.setImmediate) ||\n (typeof global !== \"undefined\" && global.setImmediate) ||\n (this && this.setImmediate);\nexports.clearImmediate = (typeof self !== \"undefined\" && self.clearImmediate) ||\n (typeof global !== \"undefined\" && global.clearImmediate) ||\n (this && this.clearImmediate);\n","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a ` : '';\n return html;\n },\n\n /**\n * Returns CSS built inside canvas\n * @param {Object} [opts={}] Options\n * @returns {string} CSS string\n * @private\n */\n getCss(opts = {}) {\n const config = this.config;\n const { optsCss, wrapperIsBody } = config;\n const avoidProt = opts.avoidProtected;\n const keepUnusedStyles = !isUndefined(opts.keepUnusedStyles)\n ? opts.keepUnusedStyles\n : config.keepUnusedStyles;\n const cssc = this.get('CssComposer');\n const wrp = opts.component || this.get('DomComponents').getComponent();\n const protCss = !avoidProt ? config.protectedCss : '';\n const css =\n wrp &&\n this.get('CodeManager').getCode(wrp, 'css', {\n cssc,\n wrapperIsBody,\n keepUnusedStyles,\n ...optsCss,\n ...opts\n });\n return wrp ? (opts.json ? css : protCss + css) : '';\n },\n\n /**\n * Returns JS of all components\n * @return {string} JS string\n * @private\n */\n getJs(opts = {}) {\n var wrp = opts.component || this.get('DomComponents').getWrapper();\n return wrp\n ? this.get('CodeManager')\n .getCode(wrp, 'js')\n .trim()\n : '';\n },\n\n /**\n * Store data to the current storage\n * @param {Function} clb Callback function\n * @return {Object} Stored data\n * @private\n */\n store(clb) {\n const sm = this.get('StorageManager');\n if (!sm) return;\n\n const store = this.storeData();\n sm.store(store, res => {\n clb && clb(res, store);\n this.set('changesCount', 0);\n this.trigger('storage:store', store);\n });\n\n return store;\n },\n\n storeData() {\n let result = {};\n // Sync content if there is an active RTE\n const editingCmp = this.getEditing();\n editingCmp && editingCmp.trigger('sync:content', { noCount: true });\n\n this.get('storables').forEach(m => {\n result = { ...result, ...m.store(1) };\n });\n return result;\n },\n\n /**\n * Load data from the current storage\n * @param {Function} clb Callback function\n * @private\n */\n load(clb = null) {\n this.getCacheLoad(1, res => {\n this.loadData(res);\n clb && clb(res);\n });\n },\n\n loadData(data = {}) {\n const sm = this.get('StorageManager');\n const result = sm.__clearKeys(data);\n\n this.get('storables').forEach(module => {\n module.load(result);\n module.postLoad && module.postLoad(this);\n });\n\n return result;\n },\n\n /**\n * Returns cached load\n * @param {Boolean} force Force to reload\n * @param {Function} clb Callback function\n * @return {Object}\n * @private\n */\n getCacheLoad(force, clb) {\n if (this.cacheLoad && !force) return this.cacheLoad;\n const sm = this.get('StorageManager');\n const load = [];\n\n if (!sm) return {};\n\n this.get('storables').forEach(m => {\n let key = m.storageKey;\n key = isFunction(key) ? key() : key;\n const keys = isArray(key) ? key : [key];\n keys.forEach(k => load.push(k));\n });\n\n sm.load(load, res => {\n this.cacheLoad = res;\n clb && clb(res);\n setTimeout(() => this.trigger('storage:load', res));\n });\n },\n\n /**\n * Returns device model by name\n * @return {Device|null}\n * @private\n */\n getDeviceModel() {\n var name = this.get('device');\n return this.get('DeviceManager').get(name);\n },\n\n /**\n * Run default command if setted\n * @param {Object} [opts={}] Options\n * @private\n */\n runDefault(opts = {}) {\n var command = this.get('Commands').get(this.config.defaultCommand);\n if (!command || this.defaultRunning) return;\n command.stop(this, this, opts);\n command.run(this, this, opts);\n this.defaultRunning = 1;\n },\n\n /**\n * Stop default command\n * @param {Object} [opts={}] Options\n * @private\n */\n stopDefault(opts = {}) {\n const commands = this.get('Commands');\n const command = commands.get(this.config.defaultCommand);\n if (!command || !this.defaultRunning) return;\n command.stop(this, this, opts);\n this.defaultRunning = 0;\n },\n\n /**\n * Update canvas dimensions and refresh data useful for tools positioning\n * @private\n */\n refreshCanvas(opts = {}) {\n this.set('canvasOffset', null);\n this.set('canvasOffset', this.get('Canvas').getOffset());\n opts.tools && this.trigger('canvas:updateTools');\n },\n\n /**\n * Clear all selected stuf inside the window, sometimes is useful to call before\n * doing some dragging opearation\n * @param {Window} win If not passed the current one will be used\n * @private\n */\n clearSelection(win) {\n var w = win || window;\n w.getSelection().removeAllRanges();\n },\n\n /**\n * Get the current media text\n * @return {string}\n */\n getCurrentMedia() {\n const config = this.config;\n const device = this.getDeviceModel();\n const condition = config.mediaCondition;\n const preview = config.devicePreviewMode;\n const width = device && device.get('widthMedia');\n return device && width && !preview ? `(${condition}: ${width})` : '';\n },\n\n /**\n * Return the component wrapper\n * @return {Component}\n */\n getWrapper() {\n return this.get('DomComponents').getWrapper();\n },\n\n setCurrentFrame(frameView) {\n return this.set('currentFrame', frameView);\n },\n\n getCurrentFrame() {\n return this.get('currentFrame');\n },\n\n getCurrentFrameModel() {\n return (this.getCurrentFrame() || {}).model;\n },\n\n /**\n * Return the count of changes made to the content and not yet stored.\n * This count resets at any `store()`\n * @return {number}\n */\n getDirtyCount() {\n return this.get('changesCount');\n },\n\n getZoomDecimal() {\n return this.get('Canvas').getZoomDecimal();\n },\n\n getZoomMultiplier() {\n return this.get('Canvas').getZoomMultiplier();\n },\n\n setDragMode(value) {\n return this.set('dmode', value);\n },\n\n t(...args) {\n return this.get('I18n').t(...args);\n },\n\n /**\n * Returns true if the editor is in absolute mode\n * @returns {Boolean}\n */\n inAbsoluteMode() {\n return this.get('dmode') === 'absolute';\n },\n\n /**\n * Destroy editor\n */\n destroyAll() {\n const { config, view } = this;\n const editor = this.getEditor();\n const { editors = [] } = config.grapesjs || {};\n this.stopDefault();\n this.get('modules')\n .slice()\n .reverse()\n .forEach(mod => mod.destroy());\n view && view.remove();\n this.stopListening();\n this.clear({ silent: true });\n this.destroyed = 1;\n ['config', 'view', '_previousAttributes', '_events', '_listeners'].forEach(\n i => (this[i] = {})\n );\n editors.splice(editors.indexOf(editor), 1);\n hasWin() &&\n $(config.el)\n .empty()\n .attr(this.attrsOrig);\n },\n\n getEditing() {\n const res = this.get('editing');\n return (res && res.model) || null;\n },\n\n setEditing(value) {\n this.set('editing', value);\n return this;\n },\n\n isEditing() {\n return !!this.get('editing');\n },\n\n log(msg, opts = {}) {\n const { ns, level = 'debug' } = opts;\n this.trigger('log', msg, opts);\n level && this.trigger(`log:${level}`, msg, opts);\n\n if (ns) {\n const logNs = `log-${ns}`;\n this.trigger(logNs, msg, opts);\n level && this.trigger(`${logNs}:${level}`, msg, opts);\n }\n },\n\n logInfo(msg, opts) {\n this.log(msg, { ...opts, level: 'info' });\n },\n\n logWarning(msg, opts) {\n this.log(msg, { ...opts, level: 'warning' });\n },\n\n logError(msg, opts) {\n this.log(msg, { ...opts, level: 'error' });\n },\n\n initBaseColorPicker(el, opts = {}) {\n const config = this.getConfig();\n const { colorPicker = {} } = config;\n const elToAppend = config.el;\n const ppfx = config.stylePrefix;\n\n return $(el).spectrum({\n containerClassName: `${ppfx}one-bg ${ppfx}two-color`,\n appendTo: elToAppend || 'body',\n maxSelectionSize: 8,\n showPalette: true,\n palette: [],\n showAlpha: true,\n chooseText: 'Ok',\n cancelText: '⨯',\n ...opts,\n ...colorPicker\n });\n },\n\n /**\n * Set/get data from the HTMLElement\n * @param {HTMLElement} el\n * @param {string} name Data name\n * @param {any} value Date value\n * @return {any}\n * @private\n */\n data(el, name, value) {\n const varName = '_gjs-data';\n\n if (!el[varName]) {\n el[varName] = {};\n }\n\n if (isUndefined(value)) {\n return el[varName][name];\n } else {\n el[varName][name] = value;\n }\n }\n});\n","import { isObject, isString, each, isUndefined } from 'underscore';\n\nexport default ({ $ }) => {\n if ($ && $.prototype && $.prototype.constructor.name !== 'jQuery') {\n const fn = $.fn;\n\n // Additional helpers\n\n fn.hide = function() {\n return this.css('display', 'none');\n };\n\n fn.show = function() {\n return this.css('display', 'block');\n };\n\n fn.focus = function() {\n const el = this.get(0);\n el && el.focus();\n return this;\n };\n\n // For SVGs in IE\n // (fn.removeClass = function(c) {\n // if (!arguments.length) {\n // return this.attr('class', '');\n // }\n // const classes = isString(c) && c.match(/\\S+/g);\n // return classes\n // ? this.each(function(el) {\n // each(classes, function(c) {\n // if (el.classList) {\n // el.classList.remove(c);\n // } else {\n // const val = el.className;\n // const bval = el.className.baseVal;\n\n // if (!isUndefined(bval)) {\n // val.baseVal = bval.replace(c, '');\n // } else {\n // el.className = val.replace(c, '');\n // }\n // }\n // });\n // })\n // : this;\n // }),\n // (fn.remove = function() {\n // return this.each(node => {\n // return node.parentNode && node.parentNode.removeChild(node);\n // });\n // }),\n\n // For spectrum compatibility\n\n fn.bind = function(ev, h) {\n return this.on(ev, h);\n };\n\n fn.unbind = function(ev, h) {\n if (isObject(ev)) {\n for (let name in ev) {\n ev.hasOwnProperty(name) && this.off(name, ev[name]);\n }\n\n return this;\n } else {\n return this.off(ev, h);\n }\n };\n\n fn.click = function(h) {\n return h ? this.on('click', h) : this.trigger('click');\n };\n\n fn.change = function(h) {\n return h ? this.on('change', h) : this.trigger('change');\n };\n\n fn.keydown = function(h) {\n return h ? this.on('keydown', h) : this.trigger('keydown');\n };\n\n fn.delegate = function(selector, events, data, handler) {\n if (!handler) {\n handler = data;\n }\n\n return this.on(events, selector, function(e) {\n e.data = data;\n handler(e);\n });\n };\n\n fn.scrollLeft = function() {\n let el = this.get(0);\n el = el.nodeType == 9 ? el.defaultView : el;\n let win = el instanceof Window ? el : null;\n return win ? win.pageXOffset : el.scrollLeft || 0;\n };\n\n fn.scrollTop = function() {\n let el = this.get(0);\n el = el.nodeType == 9 ? el.defaultView : el;\n let win = el instanceof Window ? el : null;\n return win ? win.pageYOffset : el.scrollTop || 0;\n };\n\n const offset = $.prototype.offset;\n fn.offset = function(coords) {\n let top, left;\n\n if (coords) {\n top = coords.top;\n left = coords.left;\n }\n\n if (typeof top != 'undefined') {\n this.css('top', `${top}px`);\n }\n if (typeof left != 'undefined') {\n this.css('left', `${left}px`);\n }\n\n return offset.call(this);\n };\n\n $.map = function(items, clb) {\n const ar = [];\n\n for (var i = 0; i < items.length; i++) {\n ar.push(clb(items[i], i));\n }\n\n return ar;\n };\n\n const indexOf = Array.prototype.indexOf;\n\n $.inArray = function(val, arr, i) {\n return arr == null ? -1 : indexOf.call(arr, val, i);\n };\n\n $.Event = function(src, props) {\n if (!(this instanceof $.Event)) {\n return new $.Event(src, props);\n }\n\n this.type = src;\n this.isDefaultPrevented = () => false;\n };\n }\n};\n","import Backbone from 'backbone';\nimport { appendStyles } from 'utils/mixins';\n\nconst $ = Backbone.$;\n\nexport default Backbone.View.extend({\n initialize() {\n const { model } = this;\n model.view = this;\n this.conf = model.config;\n this.pn = model.get('Panels');\n this.cv = model.get('Canvas');\n model.once('change:ready', () => {\n this.pn.active();\n this.pn.disableButtons();\n setTimeout(() => {\n model.trigger('load', model.get('Editor'));\n model.set('changesCount', 0);\n });\n });\n },\n\n render() {\n const { model, $el, conf } = this;\n const pfx = conf.stylePrefix;\n const contEl = $(conf.el || `body ${conf.container}`);\n appendStyles(conf.cssIcons, { unique: 1, prepand: 1 });\n $el.empty();\n\n if (conf.width) contEl.css('width', conf.width);\n if (conf.height) contEl.css('height', conf.height);\n\n $el.append(this.cv.render());\n $el.append(this.pn.render());\n $el.attr('class', `${pfx}editor ${pfx}one-bg ${pfx}two-color`);\n contEl\n .addClass(`${pfx}editor-cont`)\n .empty()\n .append($el);\n\n return this;\n }\n});\n","/**\n * Editor contains the top level API which you'll probably use to customize the editor or extend it with plugins.\n * You get the Editor instance on init method and you can pass options via its [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/editor/config/config.js)\n *\n * ```js\n * const editor = grapesjs.init({\n * // options\n * });\n * ```\n *\n * ## Available Events\n *\n * You can make use of available events in this way\n * ```js\n * editor.on('EVENT-NAME', (some, argument) => {\n * // do something\n * })\n * ```\n *\n * ### Components\n * * `component:create` - Component is created (only the model, is not yet mounted in the canvas), called after the init() method\n * * `component:mount` - Component is mounted to an element and rendered in canvas\n * * `component:add` - Triggered when a new component is added to the editor, the model is passed as an argument to the callback\n * * `component:remove` - Triggered when a component is removed, the model is passed as an argument to the callback\n * * `component:remove:before` - Triggered before the remove of the component, the model, remove function (if aborted via options, with this function you can complete the remove) and options (use options.abort = true to prevent remove), are passed as arguments to the callback\n * * `component:clone` - Triggered when a component is cloned, the new model is passed as an argument to the callback\n * * `component:update` - Triggered when a component is updated (moved, styled, etc.), the model is passed as an argument to the callback\n * * `component:update:{propertyName}` - Listen any property change, the model is passed as an argument to the callback\n * * `component:styleUpdate` - Triggered when the style of the component is updated, the model is passed as an argument to the callback\n * * `component:styleUpdate:{propertyName}` - Listen for a specific style property change, the model is passed as an argument to the callback\n * * `component:selected` - New component selected, the selected model is passed as an argument to the callback\n * * `component:deselected` - Component deselected, the deselected model is passed as an argument to the callback\n * * `component:toggled` - Component selection changed, toggled model is passed as an argument to the callback\n * * `component:type:add` - New component type added, the new type is passed as an argument to the callback\n * * `component:type:update` - Component type updated, the updated type is passed as an argument to the callback\n * * `component:drag:start` - Component drag started. Passed an object, to the callback, containing the `target` (component to drag), `parent` (parent of the component) and `index` (component index in the parent)\n * * `component:drag` - During component drag. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the current pointer\n * * `component:drag:end` - Component drag ended. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the final pointer\n * ### Keymaps\n * * `keymap:add` - New keymap added. The new keyamp object is passed as an argument\n * * `keymap:remove` - Keymap removed. The removed keyamp object is passed as an argument\n * * `keymap:emit` - Some keymap emitted, in arguments you get keymapId, shortcutUsed, Event\n * * `keymap:emit:{keymapId}` - `keymapId` emitted, in arguments you get keymapId, shortcutUsed, Event\n * ### Style Manager\n * * `styleManager:update:target` - The target (Component or CSSRule) is changed\n * * `styleManager:change` - Triggered on style property change from new selected component, the view of the property is passed as an argument to the callback\n * * `styleManager:change:{propertyName}` - As above but for a specific style property\n * ### Storages\n * * `storage:start` - Before the storage request is started\n * * `storage:start:store` - Before the store request. The object to store is passed as an argumnet (which you can edit)\n * * `storage:start:load` - Before the load request. Items to load are passed as an argumnet (which you can edit)\n * * `storage:load` - Triggered when something was loaded from the storage, loaded object passed as an argumnet\n * * `storage:store` - Triggered when something is stored to the storage, stored object passed as an argumnet\n * * `storage:end` - After the storage request is ended\n * * `storage:end:store` - After the store request\n * * `storage:end:load` - After the load request\n * * `storage:error` - On any error on storage request, passes the error as an argument\n * * `storage:error:store` - Error on store request, passes the error as an argument\n * * `storage:error:load` - Error on load request, passes the error as an argument\n * ### Canvas\n * * `canvas:dragenter` - When something is dragged inside the canvas, `DataTransfer` instance passed as an argument\n * * `canvas:dragover` - When something is dragging on canvas, `DataTransfer` instance passed as an argument\n * * `canvas:drop` - Something is dropped in canvas, `DataTransfer` instance and the dropped model are passed as arguments\n * * `canvas:dragend` - When a drag operation is ended, `DataTransfer` instance passed as an argument\n * * `canvas:dragdata` - On any dataTransfer parse, `DataTransfer` instance and the `result` are passed as arguments.\n * By changing `result.content` you're able to customize what is dropped\n * ### RTE\n * * `rte:enable` - RTE enabled. The view, on which RTE is enabled, is passed as an argument\n * * `rte:disable` - RTE disabled. The view, on which RTE is disabled, is passed as an argument\n * ### Commands\n * * `run:{commandName}` - Triggered when some command is called to run (eg. editor.runCommand('preview'))\n * * `stop:{commandName}` - Triggered when some command is called to stop (eg. editor.stopCommand('preview'))\n * * `run:{commandName}:before` - Triggered before the command is called\n * * `stop:{commandName}:before` - Triggered before the command is called to stop\n * * `abort:{commandName}` - Triggered when the command execution is aborted (`editor.on(`run:preview:before`, opts => opts.abort = 1);`)\n * * `run` - Triggered on run of any command. The id and the result are passed as arguments to the callback\n * * `stop` - Triggered on stop of any command. The id and the result are passed as arguments to the callback\n * ### Selectors\n * Check the [Selectors](/api/selector_manager.html) module.\n * ### Blocks\n * Check the [Blocks](/api/block_manager.html) module.\n * ### Assets\n * Check the [Assets](/api/assets.html) module.\n * ### Modal\n * Check the [Modal](/api/modal_dialog.html) module.\n * ### Devices\n * Check the [Devices](/api/device_manager.html) module.\n * ### Parser\n * Check the [Parser](/api/parser.html) module.\n * ### Pages\n * Check the [Pages](/api/pages.html) module.\n * ### General\n * * `canvasScroll` - Canvas is scrolled\n * * `update` - The structure of the template is updated (its HTML/CSS)\n * * `undo` - Undo executed\n * * `redo` - Redo executed\n * * `load` - Editor is loaded\n *\n * @module Editor\n */\nimport defaults from './config/config';\nimport EditorModel from './model/Editor';\nimport EditorView from './view/EditorView';\nimport html from 'utils/html';\n\nexport default (config = {}, opts = {}) => {\n const { $ } = opts;\n const c = {\n ...defaults,\n ...config\n };\n\n c.pStylePrefix = c.stylePrefix;\n let em = new EditorModel(c);\n let editorView;\n\n return {\n $,\n\n /**\n * @property {EditorModel}\n * @private\n */\n editor: em,\n\n /**\n * Initialize editor model\n * @return {this}\n * @private\n */\n init(opts = {}) {\n em.init(this, { ...c, ...opts });\n\n [\n 'I18n',\n 'Utils',\n 'Config',\n 'Commands',\n 'Keymaps',\n 'Modal',\n 'Panels',\n 'Canvas',\n 'Parser',\n 'CodeManager',\n 'UndoManager',\n 'RichTextEditor',\n ['Pages', 'PageManager'],\n 'DomComponents',\n ['Components', 'DomComponents'],\n 'LayerManager',\n ['Layers', 'LayerManager'],\n 'CssComposer',\n ['Css', 'CssComposer'],\n 'StorageManager',\n ['Storage', 'StorageManager'],\n 'AssetManager',\n ['Assets', 'AssetManager'],\n 'BlockManager',\n ['Blocks', 'BlockManager'],\n 'TraitManager',\n ['Traits', 'TraitManager'],\n 'SelectorManager',\n ['Selectors', 'SelectorManager'],\n 'StyleManager',\n ['Styles', 'StyleManager'],\n 'DeviceManager',\n ['Devices', 'DeviceManager']\n ].forEach(prop => {\n if (Array.isArray(prop)) {\n this[prop[0]] = em.get(prop[1]);\n } else {\n this[prop] = em.get(prop);\n }\n });\n\n // Do post render stuff after the iframe is loaded otherwise it'll\n // be empty during tests\n em.once('change:ready', () => {\n this.UndoManager.clear();\n em.get('modules').forEach(module => {\n module.postRender && module.postRender(editorView);\n });\n });\n\n return this;\n },\n\n /**\n * Returns configuration object\n * @param {string} [prop] Property name\n * @returns {any} Returns the configuration object or\n * the value of the specified property\n */\n getConfig(prop) {\n return em.getConfig(prop);\n },\n\n /**\n * Returns HTML built inside canvas\n * @param {Object} [opts={}] Options\n * @param {Component} [opts.component] Return the HTML of a specific Component\n * @param {Boolean} [opts.cleanId=false] Remove unnecessary IDs (eg. those created automatically)\n * @returns {string} HTML string\n */\n getHtml(opts) {\n return em.getHtml(opts);\n },\n\n /**\n * Returns CSS built inside canvas\n * @param {Object} [opts={}] Options\n * @param {Component} [opts.component] Return the CSS of a specific Component\n * @param {Boolean} [opts.json=false] Return an array of CssRules instead of the CSS string\n * @param {Boolean} [opts.avoidProtected=false] Don't include protected CSS\n * @returns {String|Array} CSS string or array of CssRules\n */\n getCss(opts) {\n return em.getCss(opts);\n },\n\n /**\n * Returns JS of all components\n * @param {Object} [opts={}] Options\n * @param {Component} [opts.component] Get the JS of a specific component\n * @returns {String} JS string\n */\n getJs(opts) {\n return em.getJs(opts);\n },\n\n /**\n * Return the complete tree of components. Use `getWrapper` to include also the wrapper\n * @return {Components}\n */\n getComponents() {\n return em.get('DomComponents').getComponents();\n },\n\n /**\n * Return the wrapper and its all components\n * @return {Component}\n */\n getWrapper() {\n return em.get('DomComponents').getWrapper();\n },\n\n /**\n * Set components inside editor's canvas. This method overrides actual components\n * @param {Array|Object|string} components HTML string or components model\n * @param {Object} opt the options object to be used by the [setComponents]{@link em#setComponents} method\n * @return {this}\n * @example\n * editor.setComponents('
New component
');\n * // or\n * editor.setComponents({\n * type: 'text',\n * classes:['cls'],\n * content: 'New component'\n * });\n */\n setComponents(components, opt = {}) {\n em.setComponents(components, opt);\n return this;\n },\n\n /**\n * Add components\n * @param {Array|Object|string} components HTML string or components model\n * @param {Object} opts Options\n * @param {Boolean} [opts.avoidUpdateStyle=false] If the HTML string contains styles,\n * by default, they will be created and, if already exist, updated. When this option\n * is true, styles already created will not be updated.\n * @return {Array}\n * @example\n * editor.addComponents('
New component
');\n * // or\n * editor.addComponents({\n * type: 'text',\n * classes:['cls'],\n * content: 'New component'\n * });\n */\n addComponents(components, opts) {\n return this.getWrapper().append(components, opts);\n },\n\n /**\n * Returns style in JSON format object\n * @return {Object}\n */\n getStyle() {\n return em.get('CssComposer').getAll();\n },\n\n /**\n * Set style inside editor's canvas. This method overrides actual style\n * @param {Array|Object|string} style CSS string or style model\n * @return {this}\n * @example\n * editor.setStyle('.cls{color: red}');\n * //or\n * editor.setStyle({\n * selectors: ['cls'],\n * style: { color: 'red' }\n * });\n */\n setStyle(style, opt = {}) {\n em.setStyle(style, opt);\n return this;\n },\n\n /**\n * Add styles to the editor\n * @param {Array|Object|string} style CSS string or style model\n * @returns {Array} Array of created CssRule instances\n * @example\n * editor.addStyle('.cls{color: red}');\n */\n addStyle(style, opts = {}) {\n return em.addStyle(style, opts);\n },\n\n /**\n * Returns the last selected component, if there is one\n * @return {Model}\n */\n getSelected() {\n return em.getSelected();\n },\n\n /**\n * Returns an array of all selected components\n * @return {Array}\n */\n getSelectedAll() {\n return em.getSelectedAll();\n },\n\n /**\n * Get a stylable entity from the selected component.\n * If you select a component without classes the entity is the Component\n * itself and all changes will go inside its 'style' attribute. Otherwise,\n * if the selected component has one or more classes, the function will\n * return the corresponding CSS Rule\n * @return {Model}\n */\n getSelectedToStyle() {\n let selected = em.getSelected();\n\n if (selected) {\n return this.StyleManager.getModelToStyle(selected);\n }\n },\n\n /**\n * Select a component\n * @param {Component|HTMLElement} el Component to select\n * @param {Object} [opts] Options\n * @param {Boolean} [opts.scroll] Scroll canvas to the selected element\n * @return {this}\n * @example\n * // Select dropped block\n * editor.on('block:drag:stop', function(model) {\n * editor.select(model);\n * });\n */\n select(el, opts) {\n em.setSelected(el, opts);\n return this;\n },\n\n /**\n * Add component to selection\n * @param {Component|HTMLElement|Array} el Component to select\n * @return {this}\n * @example\n * editor.selectAdd(model);\n */\n selectAdd(el) {\n em.addSelected(el);\n return this;\n },\n\n /**\n * Remove component from selection\n * @param {Component|HTMLElement|Array} el Component to select\n * @return {this}\n * @example\n * editor.selectRemove(model);\n */\n selectRemove(el) {\n em.removeSelected(el);\n return this;\n },\n\n /**\n * Toggle component selection\n * @param {Component|HTMLElement|Array} el Component to select\n * @return {this}\n * @example\n * editor.selectToggle(model);\n */\n selectToggle(el) {\n em.toggleSelected(el);\n return this;\n },\n\n /**\n * Returns, if active, the Component enabled in rich text editing mode.\n * @returns {Component|null}\n * @example\n * const textComp = editor.getEditing();\n * if (textComp) {\n * console.log('HTML: ', textComp.toHTML());\n * }\n */\n getEditing() {\n return em.getEditing();\n },\n\n /**\n * Set device to the editor. If the device exists it will\n * change the canvas to the proper width\n * @param {string} name Name of the device\n * @return {this}\n * @example\n * editor.setDevice('Tablet');\n */\n setDevice(name) {\n em.set('device', name);\n return this;\n },\n\n /**\n * Return the actual active device\n * @return {string} Device name\n * @example\n * var device = editor.getDevice();\n * console.log(device);\n * // 'Tablet'\n */\n getDevice() {\n return em.get('device');\n },\n\n /**\n * Execute command\n * @param {string} id Command ID\n * @param {Object} options Custom options\n * @return {*} The return is defined by the command\n * @example\n * editor.runCommand('myCommand', {someValue: 1});\n */\n runCommand(id, options = {}) {\n return em.get('Commands').run(id, options);\n },\n\n /**\n * Stop the command if stop method was provided\n * @param {string} id Command ID\n * @param {Object} options Custom options\n * @return {*} The return is defined by the command\n * @example\n * editor.stopCommand('myCommand', {someValue: 1});\n */\n stopCommand(id, options = {}) {\n return em.get('Commands').stop(id, options);\n },\n\n /**\n * Store data to the current storage\n * @param {Function} clb Callback function\n * @return {Object} Stored data\n */\n store(clb) {\n return em.store(clb);\n },\n\n /**\n * Get the JSON data object, which could be stored and loaded back with `editor.loadData(json)`\n * @returns {Object}\n * @example\n * console.log(editor.storeData());\n * // { pages: [...], styles: [...], ... }\n */\n storeData() {\n return em.storeData();\n },\n\n /**\n * Load data from the current storage\n * @param {Function} clb Callback function\n * @return {Object} Stored data\n */\n load(clb) {\n return em.load(clb);\n },\n\n /**\n * Load data from the JSON data object\n * @param {Object} data Data to load\n * @return {Object} Loaded object\n * @example\n * editor.loadData({ pages: [...], styles: [...], ... })\n */\n loadData(data) {\n return em.loadData(data);\n },\n\n /**\n * Returns container element. The one which was indicated as 'container'\n * on init method\n * @return {HTMLElement}\n */\n getContainer() {\n return c.el;\n },\n\n /**\n * Return the count of changes made to the content and not yet stored.\n * This count resets at any `store()`\n * @return {number}\n */\n getDirtyCount() {\n return em.getDirtyCount();\n },\n\n /**\n * Update editor dimension offsets\n *\n * This method could be useful when you update, for example, some position\n * of the editor element (eg. canvas, panels, etc.) with CSS, where without\n * refresh you'll get misleading position of tools\n * @param {Object} [options] Options\n * @param {Boolean} [options.tools=false] Update the position of tools (eg. rich text editor, component highlighter, etc.)\n */\n refresh(opts) {\n em.refreshCanvas(opts);\n },\n\n /**\n * Replace the built-in Rich Text Editor with a custom one.\n * @param {Object} obj Custom RTE Interface\n * @example\n * editor.setCustomRte({\n * // Function for enabling custom RTE\n * // el is the HTMLElement of the double clicked Text Component\n * // rte is the same instance you have returned the first time you call\n * // enable(). This is useful if need to check if the RTE is already enabled so\n * // ion this case you'll need to return the RTE and the end of the function\n * enable: function(el, rte) {\n * rte = new MyCustomRte(el, {}); // this depends on the Custom RTE API\n * ...\n * return rte; // return the RTE instance\n * },\n *\n * // Disable the editor, called for example when you unfocus the Text Component\n * disable: function(el, rte) {\n * rte.blur(); // this depends on the Custom RTE API\n * }\n *\n * // Called when the Text Component is focused again. If you returned the RTE instance\n * // from the enable function, the enable won't be called again instead will call focus,\n * // in this case to avoid double binding of the editor\n * focus: function (el, rte) {\n * rte.focus(); // this depends on the Custom RTE API\n * }\n * });\n */\n setCustomRte(obj) {\n this.RichTextEditor.customRte = obj;\n },\n\n /**\n * Replace the default CSS parser with a custom one.\n * The parser function receives a CSS string as a parameter and expects\n * an array of CSSRule objects as a result. If you need to remove the\n * custom parser, pass `null` as the argument\n * @param {Function|null} parser Parser function\n * @return {this}\n * @example\n * editor.setCustomParserCss(css => {\n * const result = [];\n * // ... parse the CSS string\n * result.push({\n * selectors: '.someclass, div .otherclass',\n * style: { color: 'red' }\n * })\n * // ...\n * return result;\n * });\n */\n setCustomParserCss(parser) {\n this.Parser.getConfig().parserCss = parser;\n return this;\n },\n\n /**\n * Change the global drag mode of components.\n * To get more about this feature read: https://github.com/artf/grapesjs/issues/1936\n * @param {String} value Drag mode, options: 'absolute' | 'translate'\n * @returns {this}\n */\n setDragMode(value) {\n em.setDragMode(value);\n return this;\n },\n\n /**\n * Trigger event log message\n * @param {*} msg Message to log\n * @param {Object} [opts={}] Custom options\n * @param {String} [opts.ns=''] Namespace of the log (eg. to use in plugins)\n * @param {String} [opts.level='debug'] Level of the log, `debug`, `info`, `warning`, `error`\n * @return {this}\n * @example\n * editor.log('Something done!', { ns: 'from-plugin-x', level: 'info' });\n * // This will trigger following events\n * // `log`, `log:info`, `log-from-plugin-x`, `log-from-plugin-x:info`\n * // Callbacks of those events will always receive the message and\n * // options, as arguments, eg:\n * // editor.on('log:info', (msg, opts) => console.info(msg, opts))\n */\n log(msg, opts = {}) {\n em.log(msg, opts);\n return this;\n },\n\n /**\n * Translate label\n * @param {String} key Label to translate\n * @param {Object} [opts] Options for the translation\n * @param {Object} [opts.params] Params for the translation\n * @param {Boolean} [opts.noWarn] Avoid warnings in case of missing resources\n * @returns {String}\n * @example\n * editor.t('msg');\n * // use params\n * editor.t('msg2', { params: { test: 'hello' } });\n * // custom local\n * editor.t('msg2', { params: { test: 'hello' }, l: 'it' });\n */\n t(...args) {\n return em.t(...args);\n },\n\n /**\n * Attach event\n * @param {string} event Event name\n * @param {Function} callback Callback function\n * @return {this}\n */\n on(event, callback) {\n em.on(event, callback);\n return this;\n },\n\n /**\n * Attach event and detach it after the first run\n * @param {string} event Event name\n * @param {Function} callback Callback function\n * @return {this}\n */\n once(event, callback) {\n em.once(event, callback);\n return this;\n },\n\n /**\n * Detach event\n * @param {string} event Event name\n * @param {Function} callback Callback function\n * @return {this}\n */\n off(event, callback) {\n em.off(event, callback);\n return this;\n },\n\n /**\n * Trigger event\n * @param {string} event Event to trigger\n * @return {this}\n */\n trigger(event) {\n em.trigger.apply(em, arguments);\n return this;\n },\n\n /**\n * Destroy the editor\n */\n destroy() {\n return em.destroyAll();\n },\n\n /**\n * Returns editor element\n * @return {HTMLElement}\n * @private\n */\n getEl() {\n return editorView && editorView.el;\n },\n\n /**\n * Returns editor model\n * @return {Model}\n * @private\n */\n getModel() {\n return em;\n },\n\n /**\n * Render editor\n * @return {HTMLElement}\n */\n render() {\n editorView && editorView.remove();\n editorView = new EditorView({\n model: em,\n config: c\n });\n return editorView.render().el;\n },\n\n /**\n * Trigger a callback once the editor is loaded and rendered.\n * The callback will be executed immediately if the method is called on the already rendered editor.\n * @param {Function} clb Callback to trigger\n * @example\n * editor.onReady(() => {\n * // perform actions\n * });\n */\n onReady(clb) {\n em.get('ready') ? clb(this) : em.on('load', clb);\n },\n\n /**\n * Print safe HTML by using ES6 tagged template strings.\n * @param {Array} literals\n * @param {Array} substs\n * @returns {String}\n * @example\n * const unsafeStr = '';\n * const safeStr = 'Hello';\n * // Use `$${var}` to avoid escaping\n * const strHtml = editor.html`Escaped ${unsafeStr}, unescaped $${safeStr}`;\n */\n html\n };\n};\n","export default {\n plugins: []\n};\n","/**\n * File made for IE/Edge support\n * https://github.com/artf/grapesjs/issues/214\n */\nimport { hasWin } from './mixins';\n\nexport default () => {\n /**\n * Check if IE/Edge\n * @return {Boolean}\n */\n const isIE = () => {\n let match;\n const agent = window.navigator.userAgent;\n const rules = [\n ['edge', /Edge\\/([0-9\\._]+)/],\n ['ie', /MSIE\\s(7\\.0)/],\n ['ie', /MSIE\\s([0-9\\.]+);.*Trident\\/[4-7].0/],\n ['ie', /Trident\\/7\\.0.*rv\\:([0-9\\.]+).*\\).*Gecko$/]\n ];\n\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i];\n match = rule[1].exec(agent);\n if (match) break;\n }\n\n return !!match;\n };\n\n if (hasWin() && isIE()) {\n const originalCreateHTMLDocument =\n DOMImplementation.prototype.createHTMLDocument;\n DOMImplementation.prototype.createHTMLDocument = title => {\n if (!title) title = '';\n return originalCreateHTMLDocument.apply(document.implementation, [title]);\n };\n }\n};\n","import { isElement, isFunction } from 'underscore';\nimport $ from 'utils/cash-dom';\nimport Editor from './editor';\nimport polyfills from 'utils/polyfills';\nimport PluginManager from './plugin_manager';\n\npolyfills();\n\nconst plugins = new PluginManager();\nconst editors = [];\nconst defaultConfig = {\n // If true renders editor on init\n autorender: 1,\n\n // Array of plugins to init\n plugins: [],\n\n // Custom options for plugins\n pluginsOpts: {}\n};\n\nexport default {\n $,\n\n editors,\n\n plugins,\n\n // Will be replaced on build\n version: __GJS_VERSION__,\n\n /**\n * Initialize the editor with passed options\n * @param {Object} config Configuration object\n * @param {string|HTMLElement} config.container Selector which indicates where render the editor\n * @param {Boolean} [config.autorender=true] If true, auto-render the content\n * @param {Array} [config.plugins=[]] Array of plugins to execute on start\n * @param {Object} [config.pluginsOpts={}] Custom options for plugins\n * @param {Boolean} [config.headless=false] Init headless editor\n * @return {Editor} Editor instance\n * @example\n * var editor = grapesjs.init({\n * container: '#myeditor',\n * components: '
Hello world
',\n * style: '.hello{color: red}',\n * })\n */\n init(config = {}) {\n const { headless } = config;\n const els = config.container;\n if (!els && !headless) throw new Error(\"'container' is required\");\n config = { ...defaultConfig, ...config, grapesjs: this };\n config.el =\n !headless && (isElement(els) ? els : document.querySelector(els));\n const editor = new Editor(config, { $ }).init();\n const em = editor.getModel();\n\n // Load plugins\n config.plugins.forEach(pluginId => {\n let plugin = plugins.get(pluginId);\n const plgOptions = config.pluginsOpts[pluginId] || {};\n\n // Try to search in global context\n if (!plugin) {\n const wplg = window[pluginId];\n plugin = wplg && wplg.default ? wplg.default : wplg;\n }\n\n if (plugin) {\n plugin(editor, plgOptions);\n } else if (isFunction(pluginId)) {\n pluginId(editor, plgOptions);\n } else {\n em.logWarning(`Plugin ${pluginId} not found`, {\n context: 'plugins',\n plugin: pluginId\n });\n }\n });\n\n // Execute `onLoad` on modules once all plugins are initialized.\n // A plugin might have extended/added some custom type so this\n // is a good point to load stuff like components, css rules, etc.\n em.loadOnStart();\n config.autorender && !headless && editor.render();\n editors.push(editor);\n\n return editor;\n }\n};\n","import defaults from './config/config';\n\nexport default config => {\n var c = config || {};\n\n // Set default options\n for (var name in defaults) {\n if (!(name in c)) c[name] = defaults[name];\n }\n\n var plugins = {};\n\n return {\n /**\n * Add new plugin. Plugins could not be overwritten\n * @param {string} id Plugin ID\n * @param {Function} plugin Function which contains all plugin logic\n * @return {Function} The plugin function\n * @example\n * PluginManager.add('some-plugin', function(editor){\n * editor.Commands.add('new-command', {\n * run: function(editor, senderBtn){\n * console.log('Executed new-command');\n * }\n * })\n * });\n */\n add(id, plugin) {\n if (plugins[id]) {\n return plugins[id];\n }\n\n plugins[id] = plugin;\n return plugin;\n },\n\n /**\n * Returns plugin by ID\n * @param {string} id Plugin ID\n * @return {Function|undefined} Plugin\n * @example\n * var plugin = PluginManager.get('some-plugin');\n * plugin(editor);\n */\n get(id) {\n return plugins[id];\n },\n\n /**\n * Returns object with all plugins\n * @return {Object}\n */\n getAll() {\n return plugins;\n }\n };\n};\n","export default {\n // Default assets\n // eg. [\n // 'https://...image1.png',\n // 'https://...image2.png',\n // {type: 'image', src: 'https://...image3.png', someOtherCustomProp: 1},\n // ..\n // ]\n assets: [],\n\n // Content to add where there is no assets to show\n // eg. 'No assets here, drag to upload'\n noAssets: '',\n\n // Style prefix\n stylePrefix: 'am-',\n\n // Upload endpoint, set `false` to disable upload\n // upload: 'https://endpoint/upload/assets',\n // upload: false,\n upload: 0,\n\n // The name used in POST to pass uploaded files\n uploadName: 'files',\n\n // Custom headers to pass with the upload request\n headers: {},\n\n // Custom parameters to pass with the upload request, eg. csrf token\n params: {},\n\n // The credentials setting for the upload request, eg. 'include', 'omit'\n credentials: 'include',\n\n // Allow uploading multiple files per request.\n // If disabled filename will not have '[]' appended\n multiUpload: true,\n\n // If true, tries to add automatically uploaded assets.\n // To make it work the server should respond with a JSON containing assets\n // in a data key, eg:\n // {\n // data: [\n // 'https://.../image.png',\n // ...\n // {src: 'https://.../image2.png'},\n // ...\n // ]\n // }\n autoAdd: true,\n\n // To upload your assets, the module uses Fetch API, with this option you\n // overwrite it with something else.\n // It should return a Promise\n // @example\n // customFetch: (url, options) => axios(url, { data: options.body }),\n customFetch: null,\n\n // Custom uploadFile function.\n // Differently from the `customFetch` option, this gives a total control\n // over the uploading process, but you also have to emit all `asset:upload:*` events\n // by yourself (if you need to use them somewhere)\n // @example\n // uploadFile: (e) => {\n // var files = e.dataTransfer ? e.dataTransfer.files : e.target.files;\n // // ...send somewhere\n // }\n uploadFile: null,\n\n // In the absence of 'uploadFile' or 'upload' assets will be embedded as Base64\n embedAsBase64: true,\n\n // Handle the image url submit from the built-in 'Add image' form\n // @example\n // handleAdd: (textFromInput) => {\n // // some check...\n // editor.AssetManager.add(textFromInput);\n // }\n handleAdd: null,\n\n // Method called before upload, on return false upload is canceled.\n // @example\n // beforeUpload: (files) => {\n // // logic...\n // var stopUpload = true;\n // if(stopUpload) return false;\n // }\n beforeUpload: null,\n\n // Toggles visiblity of assets url input\n showUrlInput: true,\n\n // Avoid rendering the default asset manager.\n custom: false,\n\n // WARNING: all the options below are considered DEPRECATED.\n // ---------------------------------------------------------------\n\n // Enable an upload dropzone on the entire editor (not document) when dragging\n // files over it\n // If active the dropzone disable/hide the upload dropzone in asset modal,\n // otherwise you will get double drops (#507)\n dropzone: false,\n\n // Open the asset manager once files are been dropped via the dropzone\n openAssetsOnDrop: 1,\n\n // Any dropzone content to append inside dropzone element\n dropzoneContent: ''\n};\n","import { result } from 'underscore';\nimport { Model } from 'common';\n\n/**\n * @property {String} type Asset type, eg. 'image'.\n * @property {String} src Asset URL, eg. 'https://.../image.png'.\n */\nexport default class Asset extends Model {\n defaults() {\n return {\n type: '',\n src: ''\n };\n }\n\n /**\n * Get asset type.\n * @returns {String}\n * @example\n * // Asset: { src: 'https://.../image.png', type: 'image' }\n * asset.getType(); // -> 'image'\n * */\n getType() {\n return this.get('type');\n }\n\n /**\n * Get asset URL.\n * @returns {String}\n * @example\n * // Asset: { src: 'https://.../image.png' }\n * asset.getSrc(); // -> 'https://.../image.png'\n * */\n getSrc() {\n return this.get('src');\n }\n\n /**\n * Get filename of the asset (based on `src`).\n * @returns {String}\n * @example\n * // Asset: { src: 'https://.../image.png' }\n * asset.getFilename(); // -> 'image.png'\n * // Asset: { src: 'https://.../image' }\n * asset.getFilename(); // -> 'image'\n * */\n getFilename() {\n return this.get('src')\n .split('/')\n .pop()\n .split('?')\n .shift();\n }\n\n /**\n * Get extension of the asset (based on `src`).\n * @returns {String}\n * @example\n * // Asset: { src: 'https://.../image.png' }\n * asset.getExtension(); // -> 'png'\n * // Asset: { src: 'https://.../image' }\n * asset.getExtension(); // -> ''\n * */\n getExtension() {\n return this.getFilename()\n .split('.')\n .pop();\n }\n}\n\nAsset.prototype.idAttribute = 'src';\n\nAsset.getDefaults = function() {\n return result(this.prototype, 'defaults');\n};\n","import Asset from './Asset';\n\nexport default class AssetImage extends Asset {\n defaults() {\n return {\n ...Asset.getDefaults(),\n type: 'image',\n unitDim: 'px',\n height: 0,\n width: 0\n };\n }\n}\n","import Backbone from 'backbone';\nimport { clone } from 'underscore';\n\nexport default Backbone.View.extend({\n initialize(o = {}) {\n this.options = o;\n this.collection = o.collection;\n const config = o.config || {};\n this.config = config;\n this.pfx = config.stylePrefix || '';\n this.ppfx = config.pStylePrefix || '';\n this.em = config.em;\n this.className = this.pfx + 'asset';\n this.listenTo(this.model, 'destroy remove', this.remove);\n this.model.view = this;\n const init = this.init && this.init.bind(this);\n init && init(o);\n },\n\n __getBhv() {\n const { em } = this;\n const am = em && em.get('AssetManager');\n return (am && am.__getBehaviour()) || {};\n },\n\n template() {\n const pfx = this.pfx;\n return `\n
\n ${this.getPreview()}\n
\n
\n ${this.getInfo()}\n
\n
\n ⨯\n
\n `;\n },\n\n /**\n * Update target if exists\n * @param {Model} target\n * @private\n * */\n updateTarget(target) {\n if (target && target.set) {\n target.set('attributes', clone(target.get('attributes')));\n target.set('src', this.model.get('src'));\n }\n },\n\n getPreview() {\n return '';\n },\n\n getInfo() {\n return '';\n },\n\n render() {\n const el = this.el;\n el.innerHTML = this.template(this, this.model);\n el.className = this.className;\n return this;\n }\n});\n","import { isFunction } from 'underscore';\nimport AssetView from './AssetView';\nimport html from 'utils/html';\n\nexport default AssetView.extend({\n events: {\n 'click [data-toggle=asset-remove]': 'onRemove',\n click: 'onClick',\n dblclick: 'onDblClick'\n },\n\n getPreview() {\n const { pfx, ppfx, model } = this;\n const src = model.get('src');\n return html`\n
\n
\n `;\n },\n\n getInfo() {\n const { pfx, model } = this;\n let name = model.get('name');\n let width = model.get('width');\n let height = model.get('height');\n let unit = model.get('unitDim');\n let dim = width && height ? `${width}x${height}${unit}` : '';\n name = name || model.getFilename();\n return html`\n
${name}
\n
${dim}
\n `;\n },\n\n init(o) {\n const pfx = this.pfx;\n this.className += ` ${pfx}asset-image`;\n },\n\n /**\n * Triggered when the asset is clicked\n * @private\n * */\n onClick() {\n const { model, pfx } = this;\n const { select } = this.__getBhv();\n const { onClick } = this.config;\n const coll = this.collection;\n coll.trigger('deselectAll');\n this.$el.addClass(pfx + 'highlight');\n\n if (isFunction(select)) {\n select(model, false);\n } else if (isFunction(onClick)) {\n onClick(model);\n } else {\n this.updateTarget(coll.target);\n }\n },\n\n /**\n * Triggered when the asset is double clicked\n * @private\n * */\n onDblClick() {\n const { em, model } = this;\n const { select } = this.__getBhv();\n const { onDblClick } = this.config;\n const { target, onSelect } = this.collection;\n\n if (isFunction(select)) {\n select(model, true);\n } else if (isFunction(onDblClick)) {\n onDblClick(model);\n } else {\n this.updateTarget(target);\n em && em.get('Modal').close();\n }\n isFunction(onSelect) && onSelect(model);\n },\n\n /**\n * Remove asset from collection\n * @private\n * */\n onRemove(e) {\n e.stopImmediatePropagation();\n this.model.collection.remove(this.model);\n }\n});\n","import Backbone from 'backbone';\nimport AssetImage from './AssetImage';\nimport AssetImageView from './../view/AssetImageView';\nimport TypeableCollection from 'domain_abstract/model/TypeableCollection';\n\nexport default Backbone.Collection.extend(TypeableCollection).extend({\n types: [\n {\n id: 'image',\n model: AssetImage,\n view: AssetImageView,\n isType(value) {\n if (typeof value == 'string') {\n return {\n type: 'image',\n src: value\n };\n }\n return value;\n }\n }\n ]\n});\n","import Backbone from 'backbone';\n\nexport default Backbone.View.extend({\n events: {\n submit: 'handleSubmit'\n },\n\n template({ pfx, ppfx, em, ...view }) {\n let form = '';\n if (this.config.showUrlInput) {\n form = `\n
\n
\n \n
\n \n
\n
\n `;\n }\n\n return `\n
\n
\n ${form}\n
\n
\n
\n
\n `;\n },\n\n initialize(o) {\n this.options = o;\n this.config = o.config;\n this.pfx = this.config.stylePrefix || '';\n this.ppfx = this.config.pStylePrefix || '';\n this.em = this.config.em;\n const coll = this.collection;\n this.listenTo(coll, 'reset', this.renderAssets);\n this.listenTo(coll, 'add', this.addToAsset);\n this.listenTo(coll, 'remove', this.removedAsset);\n this.listenTo(coll, 'deselectAll', this.deselectAll);\n },\n\n /**\n * Add new asset to the collection via string\n * @param {Event} e Event object\n * @return {this}\n * @private\n */\n handleSubmit(e) {\n e.preventDefault();\n const input = this.getAddInput();\n const url = input && input.value.trim();\n const handleAdd = this.config.handleAdd;\n\n if (!url) {\n return;\n }\n\n input.value = '';\n this.getAssetsEl().scrollTop = 0;\n\n if (handleAdd) {\n handleAdd.bind(this)(url);\n } else {\n this.options.globalCollection.add(url, { at: 0 });\n }\n },\n\n /**\n * Returns assets element\n * @return {HTMLElement}\n * @private\n */\n getAssetsEl() {\n //if(!this.assets) // Not able to cache as after the rerender it losses the ref\n return this.el.querySelector(`.${this.pfx}assets`);\n },\n\n /**\n * Returns input url element\n * @return {HTMLElement}\n * @private\n */\n getAddInput() {\n if (!this.inputUrl || !this.inputUrl.value)\n this.inputUrl = this.el.querySelector(`.${this.pfx}add-asset input`);\n return this.inputUrl;\n },\n\n /**\n * Triggered when an asset is removed\n * @param {Asset} model Removed asset\n * @private\n */\n removedAsset(model) {\n if (!this.collection.length) {\n this.toggleNoAssets();\n }\n },\n\n /**\n * Add asset to collection\n * @private\n * */\n addToAsset(model) {\n if (this.collection.length == 1) {\n this.toggleNoAssets(1);\n }\n this.addAsset(model);\n },\n\n /**\n * Add new asset to collection\n * @param Object Model\n * @param Object Fragment collection\n * @return Object Object created\n * @private\n * */\n addAsset(model, fragmentEl = null) {\n const fragment = fragmentEl;\n const collection = this.collection;\n const config = this.config;\n const rendered = new model.typeView({\n model,\n collection,\n config\n }).render().el;\n\n if (fragment) {\n fragment.appendChild(rendered);\n } else {\n const assetsEl = this.getAssetsEl();\n if (assetsEl) {\n assetsEl.insertBefore(rendered, assetsEl.firstChild);\n }\n }\n\n return rendered;\n },\n\n /**\n * Checks if to show noAssets\n * @param {Boolean} hide\n * @private\n */\n toggleNoAssets(hide) {\n const assetsEl = this.$el.find(`.${this.pfx}assets`);\n\n if (hide) {\n assetsEl.empty();\n } else {\n const noAssets = this.config.noAssets;\n noAssets && assetsEl.append(noAssets);\n }\n },\n\n /**\n * Deselect all assets\n * @private\n * */\n deselectAll() {\n const pfx = this.pfx;\n this.$el.find(`.${pfx}highlight`).removeClass(`${pfx}highlight`);\n },\n\n renderAssets() {\n const fragment = document.createDocumentFragment();\n const assets = this.$el.find(`.${this.pfx}assets`);\n assets.empty();\n this.toggleNoAssets(this.collection.length);\n this.collection.each(model => this.addAsset(model, fragment));\n assets.append(fragment);\n },\n\n render() {\n const fuRendered = this.options.fu.render().el;\n this.$el.empty();\n this.$el.append(fuRendered).append(this.template(this));\n this.el.className = `${this.ppfx}asset-manager`;\n this.renderAssets();\n return this;\n }\n});\n","import Backbone from 'backbone';\nimport fetch from 'utils/fetch';\nimport html from 'utils/html';\n\nexport default Backbone.View.extend(\n {\n template({ pfx, title, uploadId, disabled, multiUpload }) {\n return html`\n
\n
${title}
\n \n
\n \n `;\n },\n\n events: {},\n\n initialize(opts = {}) {\n this.options = opts;\n const c = opts.config || {};\n this.module = c.module;\n this.config = c;\n this.em = this.config.em;\n this.pfx = c.stylePrefix || '';\n this.ppfx = c.pStylePrefix || '';\n this.target = this.options.globalCollection || {};\n this.uploadId = this.pfx + 'uploadFile';\n this.disabled =\n c.disableUpload !== undefined\n ? c.disableUpload\n : !c.upload && !c.embedAsBase64;\n this.multiUpload = c.multiUpload !== undefined ? c.multiUpload : true;\n this.events['change #' + this.uploadId] = 'uploadFile';\n let uploadFile = c.uploadFile;\n\n if (uploadFile) {\n this.uploadFile = uploadFile.bind(this);\n } else if (!c.upload && c.embedAsBase64) {\n this.uploadFile = this.constructor.embedAsBase64;\n }\n\n this.delegateEvents();\n },\n\n /**\n * Triggered before the upload is started\n * @private\n */\n onUploadStart() {\n const { module } = this;\n module && module.__propEv('asset:upload:start');\n },\n\n /**\n * Triggered after the upload is ended\n * @param {Object|string} res End result\n * @private\n */\n onUploadEnd(res) {\n const { $el, module } = this;\n module && module.__propEv('asset:upload:end', res);\n const input = $el.find('input');\n input && input.val('');\n },\n\n /**\n * Triggered on upload error\n * @param {Object} err Error\n * @private\n */\n onUploadError(err) {\n const { module } = this;\n console.error(err);\n this.onUploadEnd(err);\n module && module.__propEv('asset:upload:error', err);\n },\n\n /**\n * Triggered on upload response\n * @param {string} text Response text\n * @private\n */\n onUploadResponse(text, clb) {\n const { module, config, target } = this;\n let json;\n try {\n json = typeof text === 'string' ? JSON.parse(text) : text;\n } catch (e) {\n json = text;\n }\n\n module && module.__propEv('asset:upload:response', json);\n\n if (config.autoAdd && target) {\n target.add(json.data, { at: 0 });\n }\n\n this.onUploadEnd(text);\n clb && clb(json);\n },\n\n /**\n * Upload files\n * @param {Object} e Event\n * @return {Promise}\n * @private\n * */\n uploadFile(e, clb) {\n const files = e.dataTransfer ? e.dataTransfer.files : e.target.files;\n const { config } = this;\n const { beforeUpload } = config;\n\n const beforeUploadResponse = beforeUpload && beforeUpload(files);\n if (beforeUploadResponse === false) return;\n\n const body = new FormData();\n const { params, customFetch } = config;\n\n for (let param in params) {\n body.append(param, params[param]);\n }\n\n if (this.multiUpload) {\n for (let i = 0; i < files.length; i++) {\n body.append(`${config.uploadName}[]`, files[i]);\n }\n } else if (files.length) {\n body.append(config.uploadName, files[0]);\n }\n\n var target = this.target;\n const url = config.upload;\n const headers = config.headers;\n const reqHead = 'X-Requested-With';\n\n if (typeof headers[reqHead] == 'undefined') {\n headers[reqHead] = 'XMLHttpRequest';\n }\n\n if (url) {\n this.onUploadStart();\n const fetchOpts = {\n method: 'post',\n credentials: config.credentials || 'include',\n headers,\n body\n };\n const fetchResult = customFetch\n ? customFetch(url, fetchOpts)\n : fetch(url, fetchOpts).then(res =>\n ((res.status / 200) | 0) == 1\n ? res.text()\n : res.text().then(text => Promise.reject(text))\n );\n return fetchResult\n .then(text => this.onUploadResponse(text, clb))\n .catch(err => this.onUploadError(err));\n }\n },\n\n /**\n * Make input file droppable\n * @private\n * */\n initDrop() {\n var that = this;\n if (!this.uploadForm) {\n this.uploadForm = this.$el.find('form').get(0);\n if ('draggable' in this.uploadForm) {\n var uploadFile = this.uploadFile;\n this.uploadForm.ondragover = function() {\n this.className = that.pfx + 'hover';\n return false;\n };\n this.uploadForm.ondragleave = function() {\n this.className = '';\n return false;\n };\n this.uploadForm.ondrop = function(e) {\n this.className = '';\n e.preventDefault();\n that.uploadFile(e);\n return;\n };\n }\n }\n },\n\n initDropzone(ev) {\n let addedCls = 0;\n const c = this.config;\n const em = ev.model;\n const edEl = ev.el;\n const editor = em.get('Editor');\n const container = em.get('Config').el;\n const frameEl = em.get('Canvas').getBody();\n const ppfx = this.ppfx;\n const updatedCls = `${ppfx}dropzone-active`;\n const dropzoneCls = `${ppfx}dropzone`;\n const cleanEditorElCls = () => {\n edEl.className = edEl.className.replace(updatedCls, '').trim();\n addedCls = 0;\n };\n const onDragOver = () => {\n if (!addedCls) {\n edEl.className += ` ${updatedCls}`;\n addedCls = 1;\n }\n return false;\n };\n const onDragLeave = () => {\n cleanEditorElCls();\n return false;\n };\n const onDrop = e => {\n cleanEditorElCls();\n e.preventDefault();\n e.stopPropagation();\n this.uploadFile(e);\n\n if (c.openAssetsOnDrop && editor) {\n const target = editor.getSelected();\n editor.runCommand('open-assets', {\n target,\n onSelect() {\n editor.Modal.close();\n editor.AssetManager.setTarget(null);\n }\n });\n }\n\n return false;\n };\n\n ev.$el.append(`
${c.dropzoneContent}
`);\n cleanEditorElCls();\n\n if ('draggable' in edEl) {\n [edEl, frameEl].forEach(item => {\n item.ondragover = onDragOver;\n item.ondragleave = onDragLeave;\n item.ondrop = onDrop;\n });\n }\n },\n\n render() {\n const { $el, pfx, em } = this;\n $el.html(\n this.template({\n title: em && em.t('assetManager.uploadTitle'),\n uploadId: this.uploadId,\n disabled: this.disabled,\n multiUpload: this.multiUpload,\n pfx\n })\n );\n this.initDrop();\n $el.attr('class', pfx + 'file-uploader');\n return this;\n }\n },\n {\n embedAsBase64: function(e, clb) {\n // List files dropped\n const files = e.dataTransfer ? e.dataTransfer.files : e.target.files;\n const response = { data: [] };\n\n // Unlikely, widely supported now\n if (!FileReader) {\n this.onUploadError(\n new Error('Unsupported platform, FileReader is not defined')\n );\n return;\n }\n\n const promises = [];\n const mimeTypeMatcher = /^(.+)\\/(.+)$/;\n\n for (const file of files) {\n // For each file a reader (to read the base64 URL)\n // and a promise (to track and merge results and errors)\n const promise = new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.addEventListener('load', event => {\n let type;\n const name = file.name;\n\n // Try to find the MIME type of the file.\n const match = mimeTypeMatcher.exec(file.type);\n if (match) {\n type = match[1]; // The first part in the MIME, \"image\" in image/png\n } else {\n type = file.type;\n }\n\n /*\n // Show local video files, http://jsfiddle.net/dsbonev/cCCZ2/embedded/result,js,html,css/\n var URL = window.URL || window.webkitURL\n var file = this.files[0]\n var type = file.type\n var videoNode = document.createElement('video');\n var canPlay = videoNode.canPlayType(type) // can use also for 'audio' types\n if (canPlay === '') canPlay = 'no'\n var message = 'Can play type \"' + type + '\": ' + canPlay\n var isError = canPlay === 'no'\n displayMessage(message, isError)\n\n if (isError) {\n return\n }\n\n var fileURL = URL.createObjectURL(file)\n videoNode.src = fileURL\n */\n\n // If it's an image, try to find its size\n if (type === 'image') {\n const data = {\n src: reader.result,\n name,\n type,\n height: 0,\n width: 0\n };\n\n const image = new Image();\n image.addEventListener('error', error => {\n reject(error);\n });\n image.addEventListener('load', () => {\n data.height = image.height;\n data.width = image.width;\n resolve(data);\n });\n image.src = data.src;\n } else if (type) {\n // Not an image, but has a type\n resolve({\n src: reader.result,\n name,\n type\n });\n } else {\n // No type found, resolve with the URL only\n resolve(reader.result);\n }\n });\n reader.addEventListener('error', error => {\n reject(error);\n });\n reader.addEventListener('abort', error => {\n reject('Aborted');\n });\n\n reader.readAsDataURL(file);\n });\n\n promises.push(promise);\n }\n\n Promise.all(promises).then(\n data => {\n response.data = data;\n this.onUploadResponse(response, clb);\n },\n error => {\n this.onUploadError(error);\n }\n );\n }\n }\n);\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/asset_manager/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * assetManager: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const assetManager = editor.AssetManager;\n * ```\n *\n * ## Available Events\n * * `asset:open` - Asset Manager opened.\n * * `asset:close` - Asset Manager closed.\n * * `asset:add` - Asset added. The [Asset] is passed as an argument to the callback.\n * * `asset:remove` - Asset removed. The [Asset] is passed as an argument to the callback.\n * * `asset:update` - Asset updated. The updated [Asset] and the object containing changes are passed as arguments to the callback.\n * * `asset:upload:start` - Before the upload is started.\n * * `asset:upload:end` - After the upload is ended.\n * * `asset:upload:error` - On any error in upload, passes the error as an argument.\n * * `asset:upload:response` - On upload response, passes the result as an argument.\n * * `asset` - Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback.\n * * `asset:custom` - Event for handling custom Asset Manager UI.\n *\n * ## Methods\n * * [open](#open)\n * * [close](#close)\n * * [isOpen](#isopen)\n * * [add](#add)\n * * [get](#get)\n * * [getAll](#getall)\n * * [getAllVisible](#getallvisible)\n * * [remove](#remove)\n * * [store](#store)\n * * [load](#load)\n * * [getContainer](#getcontainer)\n *\n * [Asset]: asset.html\n *\n * @module AssetManager\n */\n\nimport { debounce, isFunction } from 'underscore';\nimport Module from 'common/module';\nimport defaults from './config/config';\nimport Asset from './model/Assets';\nimport Assets from './model/Assets';\nimport AssetsView from './view/AssetsView';\nimport FileUpload from './view/FileUploader';\n\nexport const evAll = 'asset';\nexport const evPfx = `${evAll}:`;\nexport const evSelect = `${evPfx}select`;\nexport const evUpdate = `${evPfx}update`;\nexport const evAdd = `${evPfx}add`;\nexport const evRemove = `${evPfx}remove`;\nexport const evRemoveBefore = `${evRemove}:before`;\nexport const evCustom = `${evPfx}custom`;\nexport const evOpen = `${evPfx}open`;\nexport const evClose = `${evPfx}close`;\n\nexport default () => {\n let c = {};\n let assets, assetsVis, am, fu;\n const assetCmd = 'open-assets';\n\n return {\n ...Module,\n\n name: 'AssetManager',\n\n storageKey: 'assets',\n\n Asset,\n\n Assets,\n\n events: {\n all: evAll,\n select: evSelect,\n update: evUpdate,\n add: evAdd,\n remove: evRemove,\n removeBefore: evRemoveBefore,\n custom: evCustom,\n open: evOpen,\n close: evClose\n },\n\n init(config = {}) {\n c = { ...defaults, ...config };\n const ppfx = c.pStylePrefix;\n const { em } = c;\n this.config = c;\n this.em = em;\n\n if (ppfx) {\n c.stylePrefix = ppfx + c.stylePrefix;\n }\n\n // Global assets collection\n assets = new Assets([]);\n assetsVis = new Assets([]);\n this.all = assets;\n this.__initListen();\n\n // Setup the sync between the global and public collections\n assets.on('add', model => this.getAllVisible().add(model));\n assets.on('remove', model => this.getAllVisible().remove(model));\n\n return this;\n },\n\n __propEv(ev, ...data) {\n this.em.trigger(ev, ...data);\n this.getAll().trigger(ev, ...data);\n },\n\n __onAllEvent: debounce(function() {\n this.__trgCustom();\n }),\n\n __trgCustom() {\n const bhv = this.__getBehaviour();\n if (!bhv.container && !this.getConfig('custom').open) {\n return;\n }\n this.em.trigger(this.events.custom, this.__customData());\n },\n\n __customData() {\n const bhv = this.__getBehaviour();\n return {\n am: this,\n open: this.isOpen(),\n assets: this.getAll().models,\n types: bhv.types || [],\n container: bhv.container,\n close: () => this.close(),\n remove: (...args) => this.remove(...args),\n select: (asset, complete) => {\n const res = this.add(asset);\n isFunction(bhv.select) && bhv.select(res, complete);\n },\n // extra\n options: bhv.options || {}\n };\n },\n\n /**\n * Open the asset manager.\n * @param {Object} [options] Options for the asset manager.\n * @param {Array} [options.types=['image']] Types of assets to show.\n * @param {Function} [options.select] Type of operation to perform on asset selection. If not specified, nothing will happen.\n * @example\n * assetManager.open({\n * select(asset, complete) {\n * const selected = editor.getSelected();\n * if (selected && selected.is('image')) {\n * selected.addAttributes({ src: asset.getSrc() });\n * // The default AssetManager UI will trigger `select(asset, false)` on asset click\n * // and `select(asset, true)` on double-click\n * complete && assetManager.close();\n * }\n * }\n * });\n * // with your custom types (you should have assets with those types declared)\n * assetManager.open({ types: ['doc'], ... });\n */\n open(options = {}) {\n const cmd = this.em.get('Commands');\n cmd.run(assetCmd, {\n types: ['image'],\n select: () => {},\n ...options\n });\n },\n\n /**\n * Close the asset manager.\n * @example\n * assetManager.close();\n */\n close() {\n const cmd = this.em.get('Commands');\n cmd.stop(assetCmd);\n },\n\n /**\n * Checks if the asset manager is open\n * @returns {Boolean}\n * @example\n * assetManager.isOpen(); // true | false\n */\n isOpen() {\n const cmd = this.em.get('Commands');\n return !!(cmd && cmd.isActive(assetCmd));\n },\n\n /**\n * Add new asset/s to the collection. URLs are supposed to be unique\n * @param {String|Object|Array|Array} asset URL strings or an objects representing the resource.\n * @param {Object} [opts] Options\n * @returns {[Asset]}\n * @example\n * // As strings\n * assetManager.add('http://img.jpg');\n * assetManager.add(['http://img.jpg', './path/to/img.png']);\n *\n * // Using objects you can indicate the type and other meta informations\n * assetManager.add({\n * // type: 'image',\t// image is default\n * \tsrc: 'http://img.jpg',\n * \theight: 300,\n *\twidth: 200,\n * });\n * assetManager.add([{ src: 'img2.jpg' }, { src: 'img2.png' }]);\n */\n add(asset, opts = {}) {\n // Put the model at the beginning\n if (typeof opts.at == 'undefined') {\n opts.at = 0;\n }\n\n return assets.add(asset, opts);\n },\n\n /**\n * Return asset by URL\n * @param {String} src URL of the asset\n * @returns {[Asset]|null}\n * @example\n * const asset = assetManager.get('http://img.jpg');\n */\n get(src) {\n return assets.where({ src })[0] || null;\n },\n\n /**\n * Return the global collection, containing all the assets\n * @returns {Collection<[Asset]>}\n */\n getAll() {\n return assets;\n },\n\n /**\n * Return the visible collection, which contains assets actually rendered\n * @returns {Collection<[Asset]>}\n */\n getAllVisible() {\n return assetsVis;\n },\n\n /**\n * Remove asset\n * @param {String|[Asset]} asset Asset or asset URL\n * @returns {[Asset]} Removed asset\n * @example\n * const removed = assetManager.remove('http://img.jpg');\n * // or by passing the Asset\n * const asset = assetManager.get('http://img.jpg');\n * assetManager.remove(asset);\n */\n remove(asset, opts) {\n return this.__remove(asset, opts);\n },\n\n /**\n * Store assets data to the selected storage\n * @param {Boolean} noStore If true, won't store\n * @returns {Object} Data to store\n * @example\n * var assets = assetManager.store();\n */\n store(noStore) {\n const obj = {};\n const assets = JSON.stringify(this.getAll().toJSON());\n obj[this.storageKey] = assets;\n if (!noStore && c.stm) c.stm.store(obj);\n return obj;\n },\n\n /**\n * Load data from the passed object.\n * The fetched data will be added to the collection.\n * @param {Object} data Object of data to load\n * @returns {Object} Loaded assets\n * @example\n * var assets = assetManager.load({\n * \tassets: [...]\n * })\n *\n */\n load(data = {}) {\n const name = this.storageKey;\n let assets = data[name] || [];\n\n if (typeof assets == 'string') {\n try {\n assets = JSON.parse(data[name]);\n } catch (err) {}\n }\n\n if (assets && assets.length) {\n this.getAll().reset(assets);\n }\n\n return assets;\n },\n\n /**\n * Return the Asset Manager Container\n * @returns {HTMLElement}\n */\n getContainer() {\n const bhv = this.__getBehaviour();\n return bhv.container || (am && am.el);\n },\n\n /**\n * Get assets element container\n * @returns {HTMLElement}\n * @private\n */\n getAssetsEl() {\n return am.el.querySelector('[data-el=assets]');\n },\n\n /**\n * Render assets\n * @param {array} assets Assets to render, without the argument will render all global assets\n * @returns {HTMLElement}\n * @example\n * // Render all assets\n * assetManager.render();\n *\n * // Render some of the assets\n * const assets = assetManager.getAll();\n * assetManager.render(assets.filter(\n * asset => asset.get('category') == 'cats'\n * ));\n */\n render(assts) {\n if (this.getConfig('custom')) return;\n const toRender = assts || this.getAll().models;\n\n if (!am) {\n const obj = {\n collection: assetsVis, // Collection visible in asset manager\n globalCollection: assets,\n config: c,\n module: this\n };\n fu = new FileUpload(obj);\n obj.fu = fu;\n const el = am && am.el;\n am = new AssetsView({\n el,\n ...obj\n });\n am.render();\n }\n\n assetsVis.reset(toRender);\n return this.getContainer();\n },\n\n /**\n * Add new type. If you want to get more about type definition we suggest to read the [module's page](/modules/Assets.html)\n * @param {string} id Type ID\n * @param {Object} definition Definition of the type. Each definition contains\n * `model` (business logic), `view` (presentation logic)\n * and `isType` function which recognize the type of the\n * passed entity\n * @private\n * @example\n * assetManager.addType('my-type', {\n * model: {},\n * view: {},\n * isType: (value) => {},\n * })\n */\n addType(id, definition) {\n this.getAll().addType(id, definition);\n },\n\n /**\n * Get type\n * @param {string} id Type ID\n * @returns {Object} Type definition\n * @private\n */\n getType(id) {\n return this.getAll().getType(id);\n },\n\n /**\n * Get types\n * @returns {Array}\n * @private\n */\n getTypes() {\n return this.getAll().getTypes();\n },\n\n //-------\n\n AssetsView() {\n return am;\n },\n\n FileUploader() {\n return fu;\n },\n\n onLoad() {\n this.getAll().reset(c.assets);\n const { em, events } = this;\n em.on(`run:${assetCmd}`, () => this.__propEv(events.open));\n em.on(`stop:${assetCmd}`, () => this.__propEv(events.close));\n },\n\n postRender(editorView) {\n c.dropzone && fu && fu.initDropzone(editorView);\n },\n\n /**\n * Set new target\n * @param\t{Object}\tm Model\n * @private\n * */\n setTarget(m) {\n assetsVis.target = m;\n },\n\n /**\n * Set callback after asset was selected\n * @param\t{Object}\tf Callback function\n * @private\n * */\n onSelect(f) {\n assetsVis.onSelect = f;\n },\n\n /**\n * Set callback to fire when the asset is clicked\n * @param {function} func\n * @private\n */\n onClick(func) {\n c.onClick = func;\n },\n\n /**\n * Set callback to fire when the asset is double clicked\n * @param {function} func\n * @private\n */\n onDblClick(func) {\n c.onDblClick = func;\n },\n\n __behaviour(opts = {}) {\n return (this._bhv = {\n ...(this._bhv || {}),\n ...opts\n });\n },\n\n __getBehaviour(opts = {}) {\n return this._bhv || {};\n },\n\n destroy() {\n assets.stopListening();\n assetsVis.stopListening();\n assets.reset();\n assetsVis.reset();\n fu && fu.remove();\n am && am.remove();\n [assets, am, fu].forEach(i => (i = null));\n this._bhv = {};\n c = {};\n }\n };\n};\n","export default {\n stylePrefix: 'trt-',\n\n // Specify the element to use as a container, string (query) or HTMLElement\n // With the empty value, nothing will be rendered\n appendTo: '',\n\n // Default options for the target input\n optionsTarget: [{ value: false }, { value: '_blank' }]\n};\n","import Backbone from 'backbone';\nimport { isUndefined, isString, isFunction } from 'underscore';\nimport { capitalize } from 'utils/mixins';\n\nconst $ = Backbone.$;\n\nexport default Backbone.View.extend({\n events: {},\n eventCapture: ['change'],\n\n appendInput: 1,\n\n attributes() {\n return this.model.get('attributes');\n },\n\n templateLabel() {\n const { ppfx } = this;\n const label = this.getLabel();\n return `
${label}
`;\n },\n\n templateInput() {\n const { clsField } = this;\n return `
`;\n },\n\n initialize(o = {}) {\n const { config = {} } = o;\n const { model, eventCapture } = this;\n const { target } = model;\n const { type } = model.attributes;\n this.config = config;\n this.em = config.em;\n this.pfx = config.stylePrefix || '';\n this.ppfx = config.pStylePrefix || '';\n this.target = target;\n const { ppfx } = this;\n this.clsField = `${ppfx}field ${ppfx}field-${type}`;\n [\n ['change:value', this.onValueChange],\n ['remove', this.removeView]\n ].forEach(([event, clb]) => {\n model.off(event, clb);\n this.listenTo(model, event, clb);\n });\n model.view = this;\n this.listenTo(model, 'change:label', this.render);\n this.listenTo(model, 'change:placeholder', this.rerender);\n this.events = {};\n eventCapture.forEach(event => (this.events[event] = 'onChange'));\n this.delegateEvents();\n this.init();\n },\n\n getClbOpts() {\n return {\n component: this.target,\n trait: this.model,\n elInput: this.getInputElem()\n };\n },\n\n removeView() {\n this.remove();\n this.removed();\n },\n\n init() {},\n removed() {},\n onRender() {},\n onUpdate() {},\n onEvent() {},\n\n /**\n * Fires when the input is changed\n * @private\n */\n onChange(event) {\n const el = this.getInputElem();\n if (el && !isUndefined(el.value)) {\n this.model.set('value', el.value);\n }\n this.onEvent({\n ...this.getClbOpts(),\n event\n });\n },\n\n getValueForTarget() {\n return this.model.get('value');\n },\n\n setInputValue(value) {\n const el = this.getInputElem();\n el && (el.value = value);\n },\n\n /**\n * On change callback\n * @private\n */\n onValueChange(model, value, opts = {}) {\n if (opts.fromTarget) {\n this.setInputValue(model.get('value'));\n this.postUpdate();\n } else {\n const val = this.getValueForTarget();\n model.setTargetValue(val, opts);\n }\n },\n\n /**\n * Render label\n * @private\n */\n renderLabel() {\n const { $el, target } = this;\n const label = this.getLabel();\n let tpl = this.templateLabel(target);\n\n if (this.createLabel) {\n tpl =\n this.createLabel({\n label,\n component: target,\n trait: this\n }) || '';\n }\n\n $el.find('[data-label]').append(tpl);\n },\n\n /**\n * Returns label for the input\n * @return {string}\n * @private\n */\n getLabel() {\n const { em } = this;\n const { label, name } = this.model.attributes;\n return (\n em.t(`traitManager.traits.labels.${name}`) ||\n capitalize(label || name).replace(/-/g, ' ')\n );\n },\n\n /**\n * Returns current target component\n */\n getComponent() {\n return this.target;\n },\n\n /**\n * Returns input element\n * @return {HTMLElement}\n * @private\n */\n getInputEl() {\n if (!this.$input) {\n const { em, model } = this;\n const md = model;\n const { name } = model.attributes;\n const plh = md.get('placeholder') || md.get('default') || '';\n const type = md.get('type') || 'text';\n const min = md.get('min');\n const max = md.get('max');\n const value = this.getModelValue();\n const input = $(``);\n const i18nAttr = em.t(`traitManager.traits.attributes.${name}`) || {};\n input.attr(i18nAttr);\n\n if (!isUndefined(value)) {\n md.set({ value }, { silent: true });\n input.prop('value', value);\n }\n\n if (min) {\n input.prop('min', min);\n }\n\n if (max) {\n input.prop('max', max);\n }\n\n this.$input = input;\n }\n return this.$input.get(0);\n },\n\n getInputElem() {\n const { input, $input } = this;\n return (\n input || ($input && $input.get && $input.get(0)) || this.getElInput()\n );\n },\n\n getModelValue() {\n let value;\n const model = this.model;\n const target = this.target;\n const name = model.get('name');\n\n if (model.get('changeProp')) {\n value = target.get(name);\n } else {\n const attrs = target.get('attributes');\n value = model.get('value') || attrs[name];\n }\n\n return !isUndefined(value) ? value : '';\n },\n\n getElInput() {\n return this.elInput;\n },\n\n /**\n * Renders input\n * @private\n * */\n renderField() {\n const { $el, appendInput, model } = this;\n const inputs = $el.find('[data-input]');\n const el = inputs[inputs.length - 1];\n let tpl = model.el;\n\n if (!tpl) {\n tpl = this.createInput\n ? this.createInput(this.getClbOpts())\n : this.getInputEl();\n }\n\n if (isString(tpl)) {\n el.innerHTML = tpl;\n this.elInput = el.firstChild;\n } else {\n appendInput ? el.appendChild(tpl) : el.insertBefore(tpl, el.firstChild);\n this.elInput = tpl;\n }\n\n model.el = this.elInput;\n },\n\n hasLabel() {\n const { label } = this.model.attributes;\n return !this.noLabel && label !== false;\n },\n\n rerender() {\n this.model.el = null;\n this.render();\n },\n\n postUpdate() {\n this.onUpdate(this.getClbOpts());\n },\n\n render() {\n const { $el, pfx, ppfx, model } = this;\n const { type, id } = model.attributes;\n const hasLabel = this.hasLabel && this.hasLabel();\n const cls = `${pfx}trait`;\n this.$input = null;\n let tmpl = `
\n ${hasLabel ? `
` : ''}\n
\n ${\n this.templateInput\n ? isFunction(this.templateInput)\n ? this.templateInput(this.getClbOpts())\n : this.templateInput\n : ''\n }\n
\n
`;\n $el.empty().append(tmpl);\n hasLabel && this.renderLabel();\n this.renderField();\n this.el.className = `${cls}__wrp ${cls}__wrp-${id}`;\n this.postUpdate();\n this.onRender(this.getClbOpts());\n return this;\n }\n});\n","import DomainViews from 'domain_abstract/view/DomainViews';\nimport TraitView from './TraitView';\n\nexport default DomainViews.extend({\n ns: 'Traits',\n itemView: TraitView,\n reuseView: 1,\n\n initialize(o = {}) {\n const config = o.config || {};\n const pfx = config.stylePrefix || '';\n const em = o.editor;\n this.config = config;\n this.em = em;\n this.pfx = pfx;\n this.ppfx = config.pStylePrefix || '';\n this.className = `${pfx}traits`;\n this.listenTo(em, 'component:toggled', this.updatedCollection);\n },\n\n /**\n * Update view collection\n * @private\n */\n updatedCollection() {\n const { ppfx, className, em } = this;\n const comp = em.getSelected();\n this.el.className = `${className} ${ppfx}one-bg ${ppfx}two-color`;\n this.collection = comp ? comp.get('traits') : [];\n this.render();\n }\n});\n","import Backbone from 'backbone';\nimport { isString, isUndefined } from 'underscore';\nimport TraitView from './TraitView';\n\nconst $ = Backbone.$;\n\nexport default TraitView.extend({\n init() {\n this.listenTo(this.model, 'change:options', this.rerender);\n },\n\n templateInput() {\n const { ppfx, clsField } = this;\n return `
\n
\n
\n
\n
\n
`;\n },\n\n /**\n * Returns input element\n * @return {HTMLElement}\n * @private\n */\n getInputEl() {\n if (!this.$input) {\n const { model, em } = this;\n const propName = model.get('name');\n const opts = model.get('options') || [];\n const values = [];\n let input = '';\n this.$input = $(input);\n const val = model.getTargetValue();\n const valResult = values.indexOf(val) >= 0 ? val : model.get('default');\n !isUndefined(valResult) && this.$input.val(valResult);\n }\n\n return this.$input.get(0);\n }\n});\n","import { isUndefined } from 'underscore';\nimport TraitView from './TraitView';\n\nexport default TraitView.extend({\n appendInput: 0,\n\n templateInput() {\n const { ppfx, clsField } = this;\n return ``;\n },\n\n /**\n * Fires when the input is changed\n * @private\n */\n onChange() {\n const value = this.getInputElem().checked;\n this.model.set('value', this.getCheckedValue(value));\n },\n\n getCheckedValue(checked) {\n let result = checked;\n const { valueTrue, valueFalse } = this.model.attributes;\n\n if (result && !isUndefined(valueTrue)) {\n result = valueTrue;\n }\n\n if (!result && !isUndefined(valueFalse)) {\n result = valueFalse;\n }\n\n return result;\n },\n\n /**\n * Returns input element\n * @return {HTMLElement}\n * @private\n */\n getInputEl(...args) {\n const toInit = !this.$input;\n const el = TraitView.prototype.getInputEl.apply(this, args);\n\n if (toInit) {\n let checked, targetValue;\n const { model, target } = this;\n const { valueTrue, valueFalse } = model.attributes;\n const name = model.get('name');\n\n if (model.get('changeProp')) {\n checked = target.get(name);\n targetValue = checked;\n } else {\n targetValue = target.get('attributes')[name];\n checked = targetValue || targetValue === '' ? !0 : !1;\n }\n\n if (!isUndefined(valueFalse) && targetValue === valueFalse) {\n checked = !1;\n }\n\n el.checked = checked;\n }\n\n return el;\n }\n});\n","import TraitView from './TraitView';\nimport { isUndefined } from 'underscore';\nimport InputNumber from 'domain_abstract/ui/InputNumber';\n\nexport default TraitView.extend({\n getValueForTarget() {\n const { model } = this;\n const { value, unit } = model.attributes;\n return !isUndefined(value) && value !== ''\n ? value + unit\n : model.get('default');\n },\n\n /**\n * Returns input element\n * @return {HTMLElement}\n * @private\n */\n getInputEl() {\n if (!this.input) {\n const { ppfx, model } = this;\n const value = this.getModelValue();\n const inputNumber = new InputNumber({\n contClass: `${ppfx}field-int`,\n type: 'number',\n model: model,\n ppfx\n });\n this.input = inputNumber.render();\n this.$input = this.input.inputEl;\n this.$unit = this.input.unitEl;\n model.set('value', value, { fromTarget: 1 });\n this.$input.val(value);\n this.input = inputNumber.el;\n }\n return this.input;\n }\n});\n","import TraitView from './TraitView';\nimport InputColor from 'domain_abstract/ui/InputColor';\n\nexport default TraitView.extend({\n templateInput: '',\n\n /**\n * Returns input element\n * @return {HTMLElement}\n * @private\n */\n getInputEl() {\n if (!this.input) {\n const model = this.model;\n const value = this.getModelValue();\n const inputColor = new InputColor({\n model,\n target: this.config.em,\n contClass: this.ppfx + 'field-color',\n ppfx: this.ppfx\n });\n const input = inputColor.render();\n input.setValue(value, { fromTarget: 1 });\n this.input = input.el;\n }\n\n return this.input;\n }\n});\n","import { isString } from 'underscore';\nimport TraitView from './TraitView';\n\nexport default TraitView.extend({\n eventCapture: ['click button'],\n\n templateInput: '',\n\n onChange() {\n this.handleClick();\n },\n\n handleClick() {\n const { model, em } = this;\n const command = model.get('command');\n\n if (command) {\n if (isString(command)) {\n em.get('Commands').run(command);\n } else {\n command(em.get('Editor'), model);\n }\n }\n },\n\n renderLabel() {\n if (this.model.get('label')) {\n TraitView.prototype.renderLabel.apply(this, arguments);\n }\n },\n\n getInputEl() {\n const { model, ppfx } = this;\n const { labelButton, text, full } = model.props();\n const label = labelButton || text;\n const className = `${ppfx}btn`;\n const input = ``;\n return input;\n }\n});\n","import { defaults, isElement } from 'underscore';\nimport defaultOpts from './config/config';\nimport TraitsView from './view/TraitsView';\nimport TraitView from './view/TraitView';\nimport TraitSelectView from './view/TraitSelectView';\nimport TraitCheckboxView from './view/TraitCheckboxView';\nimport TraitNumberView from './view/TraitNumberView';\nimport TraitColorView from './view/TraitColorView';\nimport TraitButtonView from './view/TraitButtonView';\n\nexport default () => {\n let c = {};\n let TraitsViewer;\n const typesDef = {\n text: TraitView,\n number: TraitNumberView,\n select: TraitSelectView,\n checkbox: TraitCheckboxView,\n color: TraitColorView,\n button: TraitButtonView\n };\n\n return {\n TraitsView,\n\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'TraitManager',\n\n /**\n * Get configuration object\n * @return {Object}\n * @private\n */\n getConfig() {\n return c;\n },\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n */\n init(config = {}) {\n c = config;\n defaults(c, defaultOpts);\n const ppfx = c.pStylePrefix;\n this.types = { ...typesDef };\n ppfx && (c.stylePrefix = `${ppfx}${c.stylePrefix}`);\n return this;\n },\n\n postRender() {\n const elTo = this.getConfig().appendTo;\n\n if (elTo) {\n const el = isElement(elTo) ? elTo : document.querySelector(elTo);\n el.appendChild(this.render());\n }\n },\n\n /**\n *\n * Get Traits viewer\n * @private\n */\n getTraitsViewer() {\n return TraitsViewer;\n },\n\n /**\n * Add new trait type\n * @param {string} name Type name\n * @param {Object} methods Object representing the trait\n */\n addType(name, trait) {\n const baseView = this.getType('text');\n this.types[name] = baseView.extend(trait);\n },\n\n /**\n * Get trait type\n * @param {string} name Type name\n * @return {Object}\n */\n getType(name) {\n return this.getTypes()[name];\n },\n\n /**\n * Get all trait types\n * @returns {Object}\n */\n getTypes() {\n return this.types;\n },\n\n render() {\n const el = TraitsViewer && TraitsViewer.el;\n TraitsViewer = new TraitsView({\n el,\n collection: [],\n editor: c.em,\n config: c\n });\n TraitsViewer.itemsView = this.getTypes();\n TraitsViewer.updatedCollection();\n return TraitsViewer.el;\n },\n\n destroy() {\n TraitsViewer && TraitsViewer.remove();\n [c, TraitsViewer].forEach(i => (i = {}));\n }\n };\n};\n","export default {\n // Specify the element to use as a container, string (query) or HTMLElement\n // With the empty value, nothing will be rendered\n appendTo: '',\n\n // Append blocks to canvas on click.\n // With the `true` value, it will try to append the block to the selected component.\n // If there is no selected component, the block will be appened to the wrapper.\n // You can also pass a function to this option, use it as a catch-all for all block\n // clicks and implement a custom logic for each block.\n // appendOnClick: (block, editor) => {\n // if (block.get('id') === 'some-id')\n // editor.getSelected().append(block.get('content'))\n // else\n // editor.getWrapper().append(block.get('content'))\n // }\n appendOnClick: false,\n\n // Default blocks\n blocks: [],\n\n // Avoid rendering the default block manager.\n custom: false\n};\n","import { Model } from 'common';\nimport { isFunction } from 'underscore';\n\n/**\n * @property {String} label Block label, eg. `My block`\n * @property {String|Object} content The content of the block. Might be an HTML string or a [Component Defintion](/modules/Components.html#component-definition)\n * @property {String} [media=''] HTML string for the media/icon of the block, eg. ` editor.getWrapper().append(block.get('content'))`\n * @property {Object} [attributes={}] Block attributes to apply in the view element\n */\nexport default class Block extends Model {\n defaults() {\n return {\n label: '',\n content: '',\n media: '',\n category: '',\n activate: false,\n select: null,\n resetId: false,\n disable: false,\n onClick: null,\n attributes: {}\n };\n }\n\n /**\n * Get block id\n * @returns {String}\n */\n getId() {\n return this.id;\n }\n\n /**\n * Get block label\n * @returns {String}\n */\n getLabel() {\n return this.get('label');\n }\n\n /**\n * Get block media\n * @returns {String}\n */\n getMedia() {\n return this.get('media');\n }\n\n /**\n * Get block content\n * @returns {Object|String|Array} Component definition | HTML string\n */\n getContent() {\n return this.get('content');\n }\n\n /**\n * Get block category label\n * @returns {String}\n */\n getCategoryLabel() {\n const ctg = this.get('category');\n return isFunction(ctg.get) ? ctg.get('label') : ctg.label ? ctg.label : ctg;\n }\n}\n","import { Collection } from 'common';\nimport Block from './Block';\n\nexport default class Blocks extends Collection {}\n\nBlocks.prototype.model = Block;\n","import { Model } from 'common';\n\nexport default class Category extends Model {\n defaults() {\n return {\n id: '',\n label: '',\n open: true,\n attributes: {}\n };\n }\n}\n","import { Collection } from 'common';\nimport Category from './Category';\n\nexport default class Categories extends Collection {}\n\nCategories.prototype.model = Category;\n","import Backbone from 'backbone';\nimport { isFunction } from 'underscore';\nimport { on, off, hasDnd } from 'utils/mixins';\n\nexport default Backbone.View.extend({\n events: {\n click: 'handleClick',\n mousedown: 'startDrag',\n dragstart: 'handleDragStart',\n drag: 'handleDrag',\n dragend: 'handleDragEnd'\n },\n\n initialize(o, config = {}) {\n const { model } = this;\n this.em = config.em;\n this.config = config;\n this.endDrag = this.endDrag.bind(this);\n this.ppfx = config.pStylePrefix || '';\n this.listenTo(model, 'destroy remove', this.remove);\n this.listenTo(model, 'change', this.render);\n },\n\n __getModule() {\n return this.em.get('BlockManager');\n },\n\n handleClick(ev) {\n const { config, model, em } = this;\n const onClick = model.get('onClick') || config.appendOnClick;\n em.trigger('block:click', model, ev);\n if (!onClick) {\n return;\n } else if (isFunction(onClick)) {\n return onClick(model, em.getEditor(), { event: ev });\n }\n const sorter = config.getSorter();\n const content = model.get('content');\n const selected = em.getSelected();\n sorter.setDropContent(content);\n let target, valid;\n\n // If there is a selected component, try first to append\n // the block inside, otherwise, try to place it as a next sibling\n if (selected) {\n valid = sorter.validTarget(selected.getEl(), content);\n\n if (valid.valid) {\n target = selected;\n } else {\n const parent = selected.parent();\n valid = sorter.validTarget(parent.getEl(), content);\n if (valid.valid) target = parent;\n }\n }\n\n // If no target found yet, try to append the block to the wrapper\n if (!target) {\n const wrapper = em.getWrapper();\n valid = sorter.validTarget(wrapper.getEl(), content);\n if (valid.valid) target = wrapper;\n }\n\n const result = target && target.append(content)[0];\n result && em.setSelected(result, { scroll: 1 });\n },\n\n /**\n * Start block dragging\n * @private\n */\n startDrag(e) {\n const { config, em, model } = this;\n const disable = model.get('disable');\n //Right or middel click\n if (e.button !== 0 || !config.getSorter || this.el.draggable || disable)\n return;\n em.refreshCanvas();\n const sorter = config.getSorter();\n sorter.setDragHelper(this.el, e);\n sorter.setDropContent(this.model.get('content'));\n sorter.startSort(this.el);\n on(document, 'mouseup', this.endDrag);\n },\n\n handleDragStart(ev) {\n this.__getModule().__startDrag(this.model, ev);\n },\n\n handleDrag(ev) {\n this.__getModule().__drag(ev);\n },\n\n handleDragEnd() {\n this.__getModule().__endDrag();\n },\n\n /**\n * Drop block\n * @private\n */\n endDrag(e) {\n off(document, 'mouseup', this.endDrag);\n const sorter = this.config.getSorter();\n\n // After dropping the block in the canvas the mouseup event is not yet\n // triggerd on 'this.doc' and so clicking outside, the sorter, tries to move\n // things (throws false positives). As this method just need to drop away\n // the block helper I use the trick of 'moved = 0' to void those errors.\n sorter.moved = 0;\n sorter.endMove();\n },\n\n render() {\n const { em, el, $el, ppfx, model } = this;\n const disable = model.get('disable');\n const attr = model.get('attributes') || {};\n const cls = attr.class || '';\n const className = `${ppfx}block`;\n const label =\n (em && em.t(`blockManager.labels.${model.id}`)) || model.get('label');\n const render = model.get('render');\n const media = model.get('media');\n const clsAdd = disable ? `${className}--disable` : `${ppfx}four-color-h`;\n $el.attr(attr);\n el.className = `${cls} ${className} ${ppfx}one-bg ${clsAdd}`.trim();\n el.innerHTML = `\n ${media ? `
${media}
` : ''}\n
${label}
\n `;\n el.title = el.textContent.trim();\n el.setAttribute('draggable', hasDnd(em) && !disable ? true : false);\n const result = render && render({ el, model, className, prefix: ppfx });\n if (result) el.innerHTML = result;\n return this;\n }\n});\n","import { View } from 'backbone';\nimport html from 'utils/html';\n\nexport default class CategoryView extends View {\n template({ pfx, label }) {\n return html`\n
\n \n ${label}\n
\n
\n `;\n }\n\n attributes() {\n return this.model.get('attributes');\n }\n\n initialize(o = {}, config = {}) {\n this.config = config;\n const pfx = config.pStylePrefix || '';\n this.em = config.em;\n this.pfx = pfx;\n this.caretR = 'fa fa-caret-right';\n this.caretD = 'fa fa-caret-down';\n this.iconClass = `${pfx}caret-icon`;\n this.activeClass = `${pfx}open`;\n this.className = `${pfx}block-category`;\n this.events = {};\n this.events[`click .${pfx}title`] = 'toggle';\n this.listenTo(this.model, 'change:open', this.updateVisibility);\n this.delegateEvents();\n this.model.view = this;\n }\n\n updateVisibility() {\n if (this.model.get('open')) this.open();\n else this.close();\n }\n\n open() {\n this.$el.addClass(this.activeClass);\n this.getIconEl().className = `${this.iconClass} ${this.caretD}`;\n this.getBlocksEl().style.display = '';\n }\n\n close() {\n this.$el.removeClass(this.activeClass);\n this.getIconEl().className = `${this.iconClass} ${this.caretR}`;\n this.getBlocksEl().style.display = 'none';\n }\n\n toggle() {\n var model = this.model;\n model.set('open', !model.get('open'));\n }\n\n getIconEl() {\n if (!this.iconEl) {\n this.iconEl = this.el.querySelector('.' + this.iconClass);\n }\n\n return this.iconEl;\n }\n\n getBlocksEl() {\n if (!this.blocksEl) {\n this.blocksEl = this.el.querySelector('.' + this.pfx + 'blocks-c');\n }\n\n return this.blocksEl;\n }\n\n append(el) {\n this.getBlocksEl().appendChild(el);\n }\n\n render() {\n const { em, el, $el, model, pfx } = this;\n const label =\n em.t(`blockManager.categories.${model.id}`) || model.get('label');\n el.innerHTML = this.template({ pfx, label });\n $el.addClass(this.className);\n $el.css({ order: model.get('order') });\n this.updateVisibility();\n\n return this;\n }\n}\n","import Backbone from 'backbone';\nimport { isString, isObject, bindAll } from 'underscore';\nimport BlockView from './BlockView';\nimport CategoryView from './CategoryView';\n\nexport default Backbone.View.extend({\n initialize(opts, config) {\n bindAll(this, 'getSorter', 'onDrag', 'onDrop', 'onMove');\n this.config = config || {};\n this.categories = opts.categories || '';\n this.renderedCategories = [];\n var ppfx = this.config.pStylePrefix || '';\n this.ppfx = ppfx;\n this.noCatClass = `${ppfx}blocks-no-cat`;\n this.blockContClass = `${ppfx}blocks-c`;\n this.catsClass = `${ppfx}block-categories`;\n const coll = this.collection;\n this.listenTo(coll, 'add', this.addTo);\n this.listenTo(coll, 'reset', this.render);\n this.em = this.config.em;\n this.tac = 'test-tac';\n this.grabbingCls = this.ppfx + 'grabbing';\n\n if (this.em) {\n this.config.getSorter = this.getSorter;\n this.canvas = this.em.get('Canvas');\n }\n },\n\n updateConfig(opts = {}) {\n this.config = {\n ...this.config,\n ...opts\n };\n },\n\n /**\n * Get sorter\n * @private\n */\n getSorter() {\n if (!this.em) return;\n if (!this.sorter) {\n var utils = this.em.get('Utils');\n var canvas = this.canvas;\n this.sorter = new utils.Sorter({\n container: canvas.getBody(),\n placer: canvas.getPlacerEl(),\n containerSel: '*',\n itemSel: '*',\n pfx: this.ppfx,\n onStart: this.onDrag,\n onEndMove: this.onDrop,\n onMove: this.onMove,\n document: canvas.getFrameEl().contentDocument,\n direction: 'a',\n wmargin: 1,\n nested: 1,\n em: this.em,\n canvasRelative: 1\n });\n }\n return this.sorter;\n },\n\n /**\n * Callback when block is on drag\n * @private\n */\n onDrag(e) {\n this.em.stopDefault();\n this.em.trigger('block:drag:start', e);\n },\n\n onMove(e) {\n this.em.trigger('block:drag:move', e);\n },\n\n /**\n * Callback when block is dropped\n * @private\n */\n onDrop(model) {\n const { em } = this;\n em.runDefault();\n\n if (model && model.get) {\n const oldActive = 'activeOnRender';\n\n if (model.get(oldActive)) {\n model.trigger('active');\n model.unset(oldActive);\n }\n\n em.trigger('block:drag:stop', model);\n }\n },\n\n /**\n * Add new model to the collection\n * @param {Model} model\n * @private\n * */\n addTo(model) {\n this.add(model);\n },\n\n /**\n * Render new model inside the view\n * @param {Model} model\n * @param {Object} fragment Fragment collection\n * @private\n * */\n add(model, fragment) {\n const { config } = this;\n var frag = fragment || null;\n var view = new BlockView(\n {\n model,\n attributes: model.get('attributes')\n },\n config\n );\n var rendered = view.render().el;\n var category = model.get('category');\n\n // Check for categories\n if (category && this.categories && !config.ignoreCategories) {\n if (isString(category)) {\n category = {\n id: category,\n label: category\n };\n } else if (isObject(category) && !category.id) {\n category.id = category.label;\n }\n\n var catModel = this.categories.add(category);\n var catId = catModel.get('id');\n var catView = this.renderedCategories[catId];\n var categories = this.getCategoriesEl();\n model.set('category', catModel, { silent: true });\n\n if (!catView && categories) {\n catView = new CategoryView(\n {\n model: catModel\n },\n this.config\n ).render();\n this.renderedCategories[catId] = catView;\n categories.appendChild(catView.el);\n }\n\n catView && catView.append(rendered);\n return;\n }\n\n if (frag) frag.appendChild(rendered);\n else this.append(rendered);\n },\n\n getCategoriesEl() {\n if (!this.catsEl) {\n this.catsEl = this.el.querySelector(`.${this.catsClass}`);\n }\n\n return this.catsEl;\n },\n\n getBlocksEl() {\n if (!this.blocksEl) {\n this.blocksEl = this.el.querySelector(\n `.${this.noCatClass} .${this.blockContClass}`\n );\n }\n\n return this.blocksEl;\n },\n\n append(el) {\n let blocks = this.getBlocksEl();\n blocks && blocks.appendChild(el);\n },\n\n render() {\n const ppfx = this.ppfx;\n const frag = document.createDocumentFragment();\n this.catsEl = null;\n this.blocksEl = null;\n this.renderedCategories = [];\n this.el.innerHTML = `\n
\n
\n
\n
\n `;\n\n this.collection.each(model => this.add(model, frag));\n this.append(frag);\n const cls = `${this.blockContClass}s ${ppfx}one-bg ${ppfx}two-color`;\n this.$el.addClass(cls);\n this.rendered = true;\n return this;\n }\n});\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/block_manager/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * blockManager: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance.\n *\n * ```js\n * // Listen to events\n * editor.on('block:add', (block) => { ... });\n *\n * // Use the API\n * const blockManager = editor.BlockManager;\n * blockManager.add(...);\n * ```\n *\n * ## Available Events\n * * `block:add` - Block added. The [Block] is passed as an argument to the callback.\n * * `block:remove` - Block removed. The [Block] is passed as an argument to the callback.\n * * `block:update` - Block updated. The [Block] and the object containing changes are passed as arguments to the callback.\n * * `block:drag:start` - Started dragging block, the [Block] is passed as an argument.\n * * `block:drag` - Dragging block, the [Block] is passed as an argument.\n * * `block:drag:stop` - Dragging of the block is stopped. The dropped [Component] (if dropped successfully) and the [Block] are passed as arguments.\n * * `block` - Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback.\n *\n * ## Methods\n * * [add](#add)\n * * [get](#get)\n * * [getAll](#getall)\n * * [getAllVisible](#getallvisible)\n * * [remove](#remove)\n * * [getConfig](#getconfig)\n * * [getCategories](#getcategories)\n * * [getContainer](#getcontainer)\n * * [render](#render)\n *\n * [Block]: block.html\n * [Component]: component.html\n *\n * @module BlockManager\n */\nimport { isElement, isArray } from 'underscore';\nimport Module from 'common/module';\nimport defaults from './config/config';\nimport Block from './model/Block';\nimport Blocks from './model/Blocks';\nimport Category from './model/Category';\nimport Categories from './model/Categories';\nimport BlocksView from './view/BlocksView';\n\nexport const evAll = 'block';\nexport const evPfx = `${evAll}:`;\nexport const evAdd = `${evPfx}add`;\nexport const evUpdate = `${evPfx}update`;\nexport const evRemove = `${evPfx}remove`;\nexport const evRemoveBefore = `${evRemove}:before`;\nexport const evDrag = `${evPfx}drag`;\nexport const evDragStart = `${evDrag}:start`;\nexport const evDragStop = `${evDrag}:stop`;\nexport const evCustom = `${evPfx}custom`;\n\nexport default () => {\n var c = {};\n var blocks, blocksVisible, blocksView;\n var categories = [];\n\n return {\n ...Module,\n\n name: 'BlockManager',\n\n Block,\n\n Blocks,\n\n Category,\n\n Categories,\n\n events: {\n all: evAll,\n update: evUpdate,\n add: evAdd,\n remove: evRemove,\n removeBefore: evRemoveBefore,\n drag: evDrag,\n dragStart: evDragStart,\n dragEnd: evDragStop,\n custom: evCustom\n },\n\n init(config = {}) {\n c = { ...defaults, ...config };\n const { em } = c;\n this.em = em;\n\n // Global blocks collection\n blocks = new Blocks(c.blocks);\n blocksVisible = new Blocks(blocks.models);\n categories = new Categories();\n this.all = blocks;\n this.__initListen();\n\n // Setup the sync between the global and public collections\n blocks.on('add', model => blocksVisible.add(model));\n blocks.on('remove', model => blocksVisible.remove(model));\n blocks.on('reset', coll => blocksVisible.reset(coll.models));\n\n return this;\n },\n\n __trgCustom() {\n this.em.trigger(this.events.custom, this.__customData());\n },\n\n __customData() {\n const bhv = this.__getBehaviour();\n return {\n bm: this,\n blocks: this.getAll().models,\n container: bhv.container,\n dragStart: (block, ev) => this.startDrag(block, ev),\n drag: ev => this.__drag(ev),\n dragStop: cancel => this.endDrag(cancel)\n };\n },\n\n __startDrag(block, ev) {\n const { em, events } = this;\n const content = block.getContent ? block.getContent() : block;\n this._dragBlock = block;\n em.set({ dragResult: null, dragContent: content });\n [em, blocks].map(i => i.trigger(events.dragStart, block, ev));\n },\n\n __drag(ev) {\n const { em, events } = this;\n const block = this._dragBlock;\n [em, blocks].map(i => i.trigger(events.drag, block, ev));\n },\n\n __endDrag() {\n const { em, events } = this;\n const block = this._dragBlock;\n const cmp = em.get('dragResult');\n this._dragBlock = null;\n\n if (cmp) {\n const oldKey = 'activeOnRender';\n const oldActive = cmp.get && cmp.get(oldKey);\n const toActive = block.get('activate') || oldActive;\n const toSelect = block.get('select');\n const first = isArray(cmp) ? cmp[0] : cmp;\n\n if (toSelect || (toActive && toSelect !== false)) {\n em.setSelected(first);\n }\n\n if (toActive) {\n first.trigger('active');\n oldActive && first.unset(oldKey);\n }\n\n if (block.get('resetId')) {\n first.onAll(block => block.resetId());\n }\n }\n\n em.set({ dragResult: null, dragContent: null });\n [em, blocks].map(i => i.trigger(events.dragEnd, cmp, block));\n },\n\n __getFrameViews() {\n return this.em\n .get('Canvas')\n .getFrames()\n .map(frame => frame.view);\n },\n\n __behaviour(opts = {}) {\n return (this._bhv = {\n ...(this._bhv || {}),\n ...opts\n });\n },\n\n __getBehaviour() {\n return this._bhv || {};\n },\n\n startDrag(block, ev) {\n this.__startDrag(block, ev);\n this.__getFrameViews().forEach(fv => fv.droppable.startCustom());\n },\n\n endDrag(cancel) {\n this.__getFrameViews().forEach(fv => fv.droppable.endCustom(cancel));\n this.__endDrag();\n },\n\n /**\n * Get configuration object\n * @return {Object}\n */\n getConfig() {\n return c;\n },\n\n postRender() {\n const collection = blocksVisible;\n blocksView = new BlocksView({ collection, categories }, c);\n const elTo = this.getConfig().appendTo;\n\n if (elTo) {\n const el = isElement(elTo) ? elTo : document.querySelector(elTo);\n if (!el) return this.__logWarn('\"appendTo\" element not found');\n el.appendChild(this.render(blocksVisible.models));\n }\n\n this.__trgCustom();\n },\n\n /**\n * Add new block.\n * @param {String} id Block ID\n * @param {[Block]} props Block properties\n * @returns {[Block]} Added block\n * @example\n * blockManager.add('h1-block', {\n * label: 'Heading',\n * content: '

Put your title here

',\n * category: 'Basic',\n * attributes: {\n * title: 'Insert h1 block'\n * }\n * });\n */\n add(id, props, opts = {}) {\n const prp = props || {};\n prp.id = id;\n return blocks.add(prp, opts);\n },\n\n /**\n * Get the block by id.\n * @param {String} id Block id\n * @returns {[Block]}\n * @example\n * const block = blockManager.get('h1-block');\n * console.log(JSON.stringify(block));\n * // {label: 'Heading', content: '

Put your ...', ...}\n */\n get(id) {\n return blocks.get(id);\n },\n\n /**\n * Return all blocks.\n * @returns {Collection<[Block]>}\n * @example\n * const blocks = blockManager.getAll();\n * console.log(JSON.stringify(blocks));\n * // [{label: 'Heading', content: '

Put your ...'}, ...]\n */\n getAll() {\n return blocks;\n },\n\n /**\n * Return the visible collection, which containes blocks actually rendered\n * @returns {Collection<[Block]>}\n */\n getAllVisible() {\n return blocksVisible;\n },\n\n /**\n * Remove block.\n * @param {String|[Block]} block Block or block ID\n * @returns {[Block]} Removed block\n * @example\n * const removed = blockManager.remove('BLOCK_ID');\n * // or by passing the Block\n * const block = blockManager.get('BLOCK_ID');\n * blockManager.remove(block);\n */\n remove(block, opts = {}) {\n return this.__remove(block, opts);\n },\n\n /**\n * Get all available categories.\n * It's possible to add categories only within blocks via 'add()' method\n * @return {Array|Collection}\n */\n getCategories() {\n return categories;\n },\n\n /**\n * Return the Blocks container element\n * @return {HTMLElement}\n */\n getContainer() {\n return blocksView.el;\n },\n\n /**\n * Render blocks\n * @param {Array} blocks Blocks to render, without the argument will render all global blocks\n * @param {Object} [opts={}] Options\n * @param {Boolean} [opts.external] Render blocks in a new container (HTMLElement will be returned)\n * @param {Boolean} [opts.ignoreCategories] Render blocks without categories\n * @return {HTMLElement} Rendered element\n * @example\n * // Render all blocks (inside the global collection)\n * blockManager.render();\n *\n * // Render new set of blocks\n * const blocks = blockManager.getAll();\n * const filtered = blocks.filter(block => block.get('category') == 'sections')\n *\n * blockManager.render(filtered);\n * // Or a new set from an array\n * blockManager.render([\n * {label: 'Label text', content: '
Content
'}\n * ]);\n *\n * // Back to blocks from the global collection\n * blockManager.render();\n *\n * // You can also render your blocks outside of the main block container\n * const newBlocksEl = blockManager.render(filtered, { external: true });\n * document.getElementById('some-id').appendChild(newBlocksEl);\n */\n render(blocks, opts = {}) {\n const toRender = blocks || this.getAll().models;\n\n if (opts.external) {\n const collection = new Blocks(toRender);\n return new BlocksView(\n { collection, categories },\n { ...c, ...opts }\n ).render().el;\n }\n\n if (blocksView) {\n blocksView.updateConfig(opts);\n blocksView.collection.reset(toRender);\n\n if (!blocksView.rendered) {\n blocksView.render();\n blocksView.rendered = 1;\n }\n }\n\n return this.getContainer();\n },\n\n destroy() {\n const colls = [blocks, blocksVisible, categories];\n colls.map(c => c.stopListening());\n colls.map(c => c.reset());\n blocksView && blocksView.remove();\n c = {};\n }\n };\n};\n","const swv = 'sw-visibility';\nconst expt = 'export-template';\nconst osm = 'open-sm';\nconst otm = 'open-tm';\nconst ola = 'open-layers';\nconst obl = 'open-blocks';\nconst ful = 'fullscreen';\nconst prv = 'preview';\n\nexport default {\n stylePrefix: 'pn-',\n\n // Default panels fa-sliders for features\n defaults: [\n {\n id: 'commands',\n buttons: [{}]\n },\n {\n id: 'options',\n buttons: [\n {\n active: true,\n id: swv,\n className: 'fa fa-square-o',\n command: swv,\n context: swv,\n attributes: { title: 'View components' }\n },\n {\n id: prv,\n className: 'fa fa-eye',\n command: prv,\n context: prv,\n attributes: { title: 'Preview' }\n },\n {\n id: ful,\n className: 'fa fa-arrows-alt',\n command: ful,\n context: ful,\n attributes: { title: 'Fullscreen' }\n },\n {\n id: expt,\n className: 'fa fa-code',\n command: expt,\n attributes: { title: 'View code' }\n }\n ]\n },\n {\n id: 'views',\n buttons: [\n {\n id: osm,\n className: 'fa fa-paint-brush',\n command: osm,\n active: true,\n togglable: 0,\n attributes: { title: 'Open Style Manager' }\n },\n {\n id: otm,\n className: 'fa fa-cog',\n command: otm,\n togglable: 0,\n attributes: { title: 'Settings' }\n },\n {\n id: ola,\n className: 'fa fa-bars',\n command: ola,\n togglable: 0,\n attributes: { title: 'Open Layer Manager' }\n },\n {\n id: obl,\n className: 'fa fa-th-large',\n command: obl,\n togglable: 0,\n attributes: { title: 'Open Blocks' }\n }\n ]\n }\n ],\n\n // Editor model\n em: null,\n\n // Delay before show children buttons (in milliseconds)\n delayBtnsShow: 300\n};\n","import Backbone from 'backbone';\nimport Buttons from './Buttons';\n\nexport default Backbone.Model.extend({\n defaults: {\n id: '',\n content: '',\n visible: true,\n buttons: [],\n attributes: {}\n },\n\n initialize(options) {\n this.btn = this.get('buttons') || [];\n this.buttons = new Buttons(this.btn);\n this.set('buttons', this.buttons);\n }\n});\n","import Backbone from 'backbone';\nimport Panel from './Panel';\n\nexport default Backbone.Collection.extend({\n model: Panel\n});\n","import Backbone from 'backbone';\nimport { isString, isObject, isFunction } from 'underscore';\n\nconst $ = Backbone.$;\n\nexport default Backbone.View.extend({\n tagName() {\n return this.model.get('tagName');\n },\n\n events: {\n click: 'clicked'\n },\n\n initialize(o) {\n const { model } = this;\n const cls = model.get('className');\n const { command, listen } = model.attributes;\n const config = o.config || {};\n const { em } = config;\n this.config = config;\n this.em = em;\n const pfx = this.config.stylePrefix || '';\n const ppfx = this.config.pStylePrefix || '';\n this.pfx = pfx;\n this.ppfx = this.config.pStylePrefix || '';\n this.id = pfx + model.get('id');\n this.activeCls = `${pfx}active ${ppfx}four-color`;\n this.disableCls = `${ppfx}disabled`;\n this.btnsVisCls = `${pfx}visible`;\n this.className = pfx + 'btn' + (cls ? ' ' + cls : '');\n this.listenTo(model, 'change', this.render);\n this.listenTo(model, 'change:active updateActive', this.updateActive);\n this.listenTo(model, 'checkActive', this.checkActive);\n this.listenTo(model, 'change:bntsVis', this.updateBtnsVis);\n this.listenTo(model, 'change:attributes', this.updateAttributes);\n this.listenTo(model, 'change:className', this.updateClassName);\n this.listenTo(model, 'change:disable', this.updateDisable);\n\n if (em && isString(command) && listen) {\n const chnOpt = { fromListen: 1 };\n this.listenTo(em, `run:${command}`, () =>\n model.set('active', true, chnOpt)\n );\n this.listenTo(em, `stop:${command}`, () =>\n model.set('active', false, chnOpt)\n );\n }\n\n if (em && em.get) this.commands = em.get('Commands');\n },\n\n /**\n * Updates class name of the button\n *\n * @return void\n * */\n updateClassName() {\n const { model, pfx } = this;\n const cls = model.get('className');\n const attrCls = model.get('attributes').class;\n const classStr = `${attrCls ? attrCls : ''} ${pfx}btn ${cls ? cls : ''}`;\n this.$el.attr('class', classStr.trim());\n },\n\n /**\n * Updates attributes of the button\n *\n * @return void\n * */\n updateAttributes() {\n const { em, model, $el } = this;\n const attr = model.get('attributes') || {};\n const title = em && em.t && em.t(`panels.buttons.titles.${model.id}`);\n $el.attr(attr);\n title && $el.attr({ title });\n\n this.updateClassName();\n },\n\n /**\n * Updates visibility of children buttons\n *\n * @return void\n * */\n updateBtnsVis() {\n if (!this.$buttons) return;\n\n if (this.model.get('bntsVis')) this.$buttons.addClass(this.btnsVisCls);\n else this.$buttons.removeClass(this.btnsVisCls);\n },\n\n /**\n * Update active status of the button\n *\n * @return void\n * */\n updateActive(m, v, opts = {}) {\n const { model, commands, $el, activeCls } = this;\n const { fromCollection, fromListen } = opts;\n const context = model.get('context');\n const options = model.get('options');\n const commandName = model.get('command');\n let command = {};\n\n if (!commandName) return;\n\n if (commands && isString(commandName)) {\n command = commands.get(commandName) || {};\n } else if (isFunction(commandName)) {\n command = commands.create({ run: commandName });\n } else if (commandName !== null && isObject(commandName)) {\n command = commands.create(commandName);\n }\n\n if (model.get('active')) {\n !fromCollection && model.collection.deactivateAll(context, model);\n model.set('active', true, { silent: true }).trigger('checkActive');\n !fromListen &&\n commands.runCommand(command, { ...options, sender: model });\n\n // Disable button if the command has no stop method\n command.noStop && model.set('active', false);\n } else {\n $el.removeClass(activeCls);\n !fromListen &&\n commands.stopCommand(command, { ...options, sender: model, force: 1 });\n }\n },\n\n updateDisable() {\n const { disableCls, model } = this;\n const disable = model.get('disable');\n this.$el[disable ? 'addClass' : 'removeClass'](disableCls);\n },\n\n /**\n * Update active style status\n *\n * @return void\n * */\n checkActive() {\n const { model, $el, activeCls } = this;\n model.get('active') ? $el.addClass(activeCls) : $el.removeClass(activeCls);\n },\n\n /**\n * Triggered when button is clicked\n * @param {Object} e Event\n *\n * @return void\n * */\n clicked(e) {\n const { model } = this;\n\n if (model.get('bntsVis') || model.get('disable') || !model.get('command'))\n return;\n\n this.toggleActive();\n },\n\n toggleActive() {\n const { model, em } = this;\n const { active, togglable } = model.attributes;\n\n if (active && !togglable) return;\n\n model.set('active', !active);\n\n // If the stop is requested\n if (active) {\n if (model.get('runDefaultCommand')) em.runDefault();\n } else {\n if (model.get('stopDefaultCommand')) em.stopDefault();\n }\n },\n\n render() {\n const { model } = this;\n const label = model.get('label');\n const { $el } = this;\n !model.get('el') && $el.empty();\n this.updateAttributes();\n label && $el.append(label);\n this.checkActive();\n this.updateDisable();\n\n return this;\n }\n});\n","import Backbone from 'backbone';\nimport ButtonView from './ButtonView';\nimport { result } from 'underscore';\n\nexport default Backbone.View.extend({\n initialize(o) {\n this.opt = o || {};\n this.config = this.opt.config || {};\n this.pfx = this.config.stylePrefix || '';\n this.parentM = this.opt.parentM || null;\n this.listenTo(this.collection, 'add', this.addTo);\n this.listenTo(this.collection, 'reset remove', this.render);\n this.className = this.pfx + 'buttons';\n },\n\n /**\n * Add to collection\n * @param Object Model\n *\n * @return Object\n * */\n addTo(model) {\n this.addToCollection(model);\n },\n\n /**\n * Add new object to collection\n * @param Object Model\n * @param Object Fragment collection\n *\n * @return Object Object created\n * */\n addToCollection(model, fragmentEl) {\n const fragment = fragmentEl || null;\n const viewObject = ButtonView;\n const el = model.get('el');\n const view = new viewObject({\n el,\n model,\n config: this.config,\n parentM: this.parentM\n });\n const rendered = view.render().el;\n\n if (fragment) {\n fragment.appendChild(rendered);\n } else {\n this.$el.append(rendered);\n }\n\n return rendered;\n },\n\n render() {\n var fragment = document.createDocumentFragment();\n this.$el.empty();\n\n this.collection.each(function(model) {\n this.addToCollection(model, fragment);\n }, this);\n\n this.$el.append(fragment);\n this.$el.attr('class', result(this, 'className'));\n return this;\n }\n});\n","import Backbone from 'backbone';\nimport ButtonsView from './ButtonsView';\n\nexport default Backbone.View.extend({\n initialize(o) {\n const config = o.config || {};\n const model = this.model;\n this.config = config;\n this.pfx = config.stylePrefix || '';\n this.ppfx = config.pStylePrefix || '';\n this.buttons = model.get('buttons');\n this.className = this.pfx + 'panel';\n this.id = this.pfx + model.get('id');\n this.listenTo(model, 'change:appendContent', this.appendContent);\n this.listenTo(model, 'change:content', this.updateContent);\n this.listenTo(model, 'change:visible', this.toggleVisible);\n model.view = this;\n },\n\n /**\n * Append content of the panel\n * */\n appendContent() {\n this.$el.append(this.model.get('appendContent'));\n },\n\n /**\n * Update content\n * */\n updateContent() {\n this.$el.html(this.model.get('content'));\n },\n\n toggleVisible() {\n if (!this.model.get('visible')) {\n this.$el.addClass(`${this.ppfx}hidden`);\n return;\n }\n this.$el.removeClass(`${this.ppfx}hidden`);\n },\n\n attributes() {\n return this.model.get('attributes');\n },\n\n initResize() {\n const em = this.config.em;\n const editor = em ? em.get('Editor') : '';\n const resizable = this.model.get('resizable');\n\n if (editor && resizable) {\n var resz = resizable === true ? [1, 1, 1, 1] : resizable;\n var resLen = resz.length;\n var tc,\n cr,\n bc,\n cl = 0;\n\n // Choose which sides of the panel are resizable\n if (resLen == 2) {\n tc = resz[0];\n bc = resz[0];\n cr = resz[1];\n cl = resz[1];\n } else if (resLen == 4) {\n tc = resz[0];\n cr = resz[1];\n bc = resz[2];\n cl = resz[3];\n }\n\n var resizer = editor.Utils.Resizer.init({\n tc,\n cr,\n bc,\n cl,\n tl: 0,\n tr: 0,\n bl: 0,\n br: 0,\n appendTo: this.el,\n silentFrames: 1,\n avoidContainerUpdate: 1,\n prefix: editor.getConfig().stylePrefix,\n onEnd() {\n em && em.trigger('change:canvasOffset');\n },\n posFetcher: (el, { target }) => {\n const style = el.style;\n const config = resizer.getConfig();\n const keyWidth = config.keyWidth;\n const keyHeight = config.keyHeight;\n const rect = el.getBoundingClientRect();\n const forContainer = target == 'container';\n const styleWidth = style[keyWidth];\n const styleHeight = style[keyHeight];\n const width =\n styleWidth && !forContainer ? parseFloat(styleWidth) : rect.width;\n const height =\n styleHeight && !forContainer\n ? parseFloat(styleHeight)\n : rect.height;\n return {\n left: 0,\n top: 0,\n width,\n height\n };\n },\n ...resizable\n });\n resizer.blur = () => {};\n resizer.focus(this.el);\n }\n },\n\n render() {\n const $el = this.$el;\n const ppfx = this.ppfx;\n const cls = `${this.className} ${this.id} ${ppfx}one-bg ${ppfx}two-color`;\n $el.addClass(cls);\n\n this.toggleVisible();\n\n if (this.buttons.length) {\n var buttons = new ButtonsView({\n collection: this.buttons,\n config: this.config\n });\n $el.append(buttons.render().el);\n }\n\n $el.append(this.model.get('content'));\n return this;\n }\n});\n","import Backbone from 'backbone';\nimport PanelView from './PanelView';\n\nexport default Backbone.View.extend({\n initialize(o) {\n this.opt = o || {};\n this.config = this.opt.config || {};\n this.pfx = this.config.stylePrefix || '';\n const items = this.collection;\n this.listenTo(items, 'add', this.addTo);\n this.listenTo(items, 'reset', this.render);\n this.listenTo(items, 'remove', this.onRemove);\n this.className = this.pfx + 'panels';\n },\n\n onRemove(model) {\n const view = model.view;\n view && view.remove();\n },\n\n /**\n * Add to collection\n * @param Object Model\n *\n * @return Object\n * @private\n * */\n addTo(model) {\n this.addToCollection(model);\n },\n\n /**\n * Add new object to collection\n * @param Object Model\n * @param Object Fragment collection\n * @param integer Index of append\n *\n * @return Object Object created\n * @private\n * */\n addToCollection(model, fragmentEl) {\n const fragment = fragmentEl || null;\n const config = this.config;\n const el = model.get('el');\n const view = new PanelView({\n el,\n model,\n config\n });\n const rendered = view.render().el;\n const appendTo = model.get('appendTo');\n\n // Do nothing if the panel was requested to be another element\n if (el) {\n } else if (appendTo) {\n var appendEl = document.querySelector(appendTo);\n appendEl.appendChild(rendered);\n } else {\n if (fragment) {\n fragment.appendChild(rendered);\n } else {\n this.$el.append(rendered);\n }\n }\n\n view.initResize();\n return rendered;\n },\n\n render() {\n const $el = this.$el;\n const frag = document.createDocumentFragment();\n $el.empty();\n this.collection.each(model => this.addToCollection(model, frag));\n $el.append(frag);\n $el.attr('class', this.className);\n return this;\n }\n});\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/panels/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * panels: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const panelManager = editor.Panels;\n * ```\n *\n * * [addPanel](#addpanel)\n * * [addButton](#addbutton)\n * * [getButton](#getbutton)\n * * [getPanel](#getpanel)\n * * [getPanels](#getpanels)\n * * [getPanelsEl](#getpanelsel)\n * * [removePanel](#removepanel)\n * * [removeButton](#removebutton)\n *\n * @module Panels\n */\nimport defaults from './config/config';\nimport Panel from './model/Panel';\nimport Panels from './model/Panels';\nimport PanelsView from './view/PanelsView';\n\nexport default () => {\n var c = {};\n var panels, PanelsViewObj;\n\n return {\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'Panels',\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @private\n */\n init(config) {\n c = config || {};\n for (var name in defaults) {\n if (!(name in c)) c[name] = defaults[name];\n }\n\n var ppfx = c.pStylePrefix;\n if (ppfx) c.stylePrefix = ppfx + c.stylePrefix;\n\n panels = new Panels(c.defaults);\n return this;\n },\n\n /**\n * Returns the collection of panels\n * @return {Collection} Collection of panel\n */\n getPanels() {\n return panels;\n },\n\n /**\n * Returns panels element\n * @return {HTMLElement}\n */\n getPanelsEl() {\n return PanelsViewObj && PanelsViewObj.el;\n },\n\n /**\n * Add new panel to the collection\n * @param {Object|Panel} panel Object with right properties or an instance of Panel\n * @return {Panel} Added panel. Useful in case passed argument was an Object\n * @example\n * var newPanel = panelManager.addPanel({\n * id: 'myNewPanel',\n * visible : true,\n * buttons : [...],\n * });\n */\n addPanel(panel) {\n return panels.add(panel);\n },\n\n /**\n * Remove a panel from the collection\n * @param {Object|Panel|String} panel Object with right properties or an instance of Panel or Painel id\n * @return {Panel} Removed panel. Useful in case passed argument was an Object\n * @example\n * const newPanel = panelManager.removePanel({\n * id: 'myNewPanel',\n * visible : true,\n * buttons : [...],\n * });\n *\n * const newPanel = panelManager.removePanel('myNewPanel');\n *\n */\n removePanel(panel) {\n return panels.remove(panel);\n },\n\n /**\n * Get panel by ID\n * @param {string} id Id string\n * @return {Panel|null}\n * @example\n * var myPanel = panelManager.getPanel('myNewPanel');\n */\n getPanel(id) {\n var res = panels.where({ id });\n return res.length ? res[0] : null;\n },\n\n /**\n * Add button to the panel\n * @param {string} panelId Panel's ID\n * @param {Object|Button} button Button object or instance of Button\n * @return {Button|null} Added button. Useful in case passed button was an Object\n * @example\n * var newButton = panelManager.addButton('myNewPanel',{\n * id: 'myNewButton',\n * className: 'someClass',\n * command: 'someCommand',\n * attributes: { title: 'Some title'},\n * active: false,\n * });\n * // It's also possible to pass the command as an object\n * // with .run and .stop methods\n * ...\n * command: {\n * run: function(editor) {\n * ...\n * },\n * stop: function(editor) {\n * ...\n * }\n * },\n * // Or simply like a function which will be evaluated as a single .run command\n * ...\n * command: function(editor) {\n * ...\n * }\n */\n addButton(panelId, button) {\n var pn = this.getPanel(panelId);\n return pn ? pn.get('buttons').add(button) : null;\n },\n\n /**\n * Remove button from the panel\n * @param {String} panelId Panel's ID\n * @param {String} buttonId Button's ID\n * @return {Button|null} Removed button.\n * @example\n * const removedButton = panelManager.addButton('myNewPanel',{\n * id: 'myNewButton',\n * className: 'someClass',\n * command: 'someCommand',\n * attributes: { title: 'Some title'},\n * active: false,\n * });\n *\n * const removedButton = panelManager.removeButton('myNewPanel', 'myNewButton');\n *\n */\n removeButton(panelId, button) {\n var pn = this.getPanel(panelId);\n return pn && pn.get('buttons').remove(button);\n },\n\n /**\n * Get button from the panel\n * @param {string} panelId Panel's ID\n * @param {string} id Button's ID\n * @return {Button|null}\n * @example\n * var button = panelManager.getButton('myPanel','myButton');\n */\n getButton(panelId, id) {\n var pn = this.getPanel(panelId);\n if (pn) {\n var res = pn.get('buttons').where({ id });\n return res.length ? res[0] : null;\n }\n return null;\n },\n\n /**\n * Render panels and buttons\n * @return {HTMLElement}\n * @private\n */\n render() {\n PanelsViewObj && PanelsViewObj.remove();\n PanelsViewObj = new PanelsView({\n collection: panels,\n config: c\n });\n return PanelsViewObj.render().el;\n },\n\n /**\n * Active activable buttons\n * @private\n */\n active() {\n this.getPanels().each(p => {\n p.get('buttons').each(btn => {\n btn.get('active') && btn.trigger('updateActive');\n });\n });\n },\n\n /**\n * Disable buttons flagged as disabled\n * @private\n */\n disableButtons() {\n this.getPanels().each(p => {\n p.get('buttons').each(btn => {\n if (btn.get('disable')) btn.trigger('change:disable');\n });\n });\n },\n\n destroy() {\n panels.reset();\n panels.stopListening();\n PanelsViewObj && PanelsViewObj.remove();\n [c, panels, PanelsViewObj].forEach(i => (i = {}));\n },\n\n Panel\n };\n};\n","export default {\n stylePrefix: 'cv-',\n\n /*\n * Append external scripts to the `` of the iframe.\n * Be aware that these scripts will not be printed in the export code\n * @example\n * scripts: [ 'https://...1.js', 'https://...2.js' ]\n * * // or passing objects as attributes\n * scripts: [ { src: '/file.js', someattr: 'value' }, ... ]\n */\n scripts: [],\n\n /*\n * Append external styles to the `` of the iframe\n * Be aware that these styles will not be printed in the export code\n * @example\n * styles: [ 'https://...1.css', 'https://...2.css' ]\n * // or passing objects as attributes\n * styles: [ { href: '/style.css', someattr: 'value' }, ... ]\n */\n styles: [],\n\n /**\n * Add custom badge naming strategy\n * @example\n * customBadgeLabel: function(component) {\n * return component.getName();\n * }\n */\n customBadgeLabel: '',\n\n /**\n * Indicate when to start the auto scroll of the canvas on component/block dragging (value in px )\n */\n autoscrollLimit: 50,\n\n // Experimental: external highlighter box\n extHl: 0,\n\n /**\n * When some textable component is selected and focused (eg. input or text component) the editor\n * stops some commands (eg. disables the copy/paste of components with CTRL+C/V to allow the copy/paste of the text).\n * This option allows to customize, by a selector, which element should not be considered textable\n */\n notTextable: ['button', 'a', 'input[type=checkbox]', 'input[type=radio]']\n};\n","import { Model } from 'common';\nimport { evPageSelect } from 'pages';\n\nexport default class Canvas extends Model {\n defaults() {\n return {\n frame: '',\n frames: '',\n rulers: false,\n zoom: 100,\n x: 0,\n y: 0,\n // Scripts to apply on all frames\n scripts: [],\n // Styles to apply on all frames\n styles: []\n };\n }\n\n initialize(props, config = {}) {\n const { em } = config;\n this.config = config;\n this.em = em;\n this.listenTo(this, 'change:zoom', this.onZoomChange);\n this.listenTo(em, 'change:device', this.updateDevice);\n this.listenTo(em, evPageSelect, this._pageUpdated);\n }\n\n init() {\n const { em } = this;\n const mainPage = em.get('PageManager').getMain();\n const frame = mainPage.getMainFrame();\n this.set('frames', mainPage.getFrames());\n this.updateDevice({ frame });\n }\n\n _pageUpdated(page, prev) {\n const { em } = this;\n em.setSelected();\n em.get('readyCanvas') && em.stopDefault(); // We have to stop before changing current frames\n prev && prev.getFrames().map(frame => frame.disable());\n this.set('frames', page.getFrames());\n }\n\n updateDevice(opts = {}) {\n const { em } = this;\n const device = em.getDeviceModel();\n const model = opts.frame || em.getCurrentFrameModel();\n\n if (model && device) {\n const { width, height } = device.attributes;\n model.set({ width, height }, { noUndo: 1 });\n }\n }\n\n onZoomChange() {\n const zoom = this.get('zoom');\n zoom < 1 && this.set('zoom', 1);\n }\n}\n","/*\n This class makes the canvas droppable\n */\n\nimport { on, off } from 'utils/mixins';\nimport { bindAll, indexOf } from 'underscore';\n\nexport default class Droppable {\n constructor(em, rootEl) {\n this.em = em;\n const el =\n rootEl ||\n em\n .get('Canvas')\n .getFrames()\n .map(frame => frame.getComponent().getEl());\n const els = Array.isArray(el) ? el : [el];\n this.el = el;\n this.counter = 0;\n bindAll(\n this,\n 'handleDragEnter',\n 'handleDragOver',\n 'handleDrop',\n 'handleDragLeave'\n );\n els.forEach(el => this.toggleEffects(el, 1));\n\n return this;\n }\n\n toggleEffects(el, enable) {\n const methods = { on, off };\n const method = enable ? 'on' : 'off';\n methods[method](el, 'dragenter', this.handleDragEnter);\n methods[method](el, 'dragover', this.handleDragOver);\n methods[method](el, 'drop', this.handleDrop);\n methods[method](el, 'dragleave', this.handleDragLeave);\n }\n\n __customTglEff(enable) {\n const method = enable ? on : off;\n const doc = this.el.ownerDocument;\n const frameEl = doc.defaultView.frameElement;\n this.sortOpts = enable\n ? {\n onStart({ sorter }) {\n on(frameEl, 'pointermove', sorter.onMove);\n },\n onEnd({ sorter }) {\n off(frameEl, 'pointermove', sorter.onMove);\n },\n customTarget({ event }) {\n return doc.elementFromPoint(event.clientX, event.clientY);\n }\n }\n : null;\n method(frameEl, 'pointerenter', this.handleDragEnter);\n method(frameEl, 'pointermove', this.handleDragOver);\n method(document, 'pointerup', this.handleDrop);\n method(frameEl, 'pointerout', this.handleDragLeave);\n\n // Test with touche devices (seems like frameEl is not capturing pointer events).\n // on/off(document, 'pointermove', sorter.onMove); // for the sorter\n // enable && this.handleDragEnter({}); // no way to use pointerenter/pointerout\n }\n\n startCustom() {\n this.__customTglEff(true);\n }\n\n endCustom(cancel) {\n this.over ? this.endDrop(cancel) : this.__customTglEff(false);\n }\n\n endDrop(cancel, ev) {\n const { em, dragStop } = this;\n this.counter = 0;\n dragStop && dragStop(cancel);\n this.__customTglEff(false);\n em.trigger('canvas:dragend', ev);\n }\n\n handleDragLeave(ev) {\n this.updateCounter(-1, ev);\n }\n\n updateCounter(value, ev) {\n this.counter += value;\n this.counter === 0 && this.endDrop(1, ev);\n }\n\n handleDragEnter(ev) {\n const { em } = this;\n const dt = ev.dataTransfer;\n this.updateCounter(1, ev);\n if (this.over) return;\n this.over = 1;\n const utils = em.get('Utils');\n const canvas = em.get('Canvas');\n // For security reason I can't read the drag data on dragenter, but\n // as I need it for the Sorter context I will use `dragContent` or just\n // any not empty element\n let content = em.get('dragContent') || '
';\n let dragStop, dragContent;\n em.stopDefault();\n\n // Select the right drag provider\n if (em.inAbsoluteMode()) {\n const wrapper = em.get('DomComponents').getWrapper();\n const target = wrapper.append({})[0];\n const dragger = em.get('Commands').run('core:component-drag', {\n event: ev,\n guidesInfo: 1,\n center: 1,\n target,\n onEnd: (ev, dragger, { cancelled }) => {\n let comp;\n if (!cancelled) {\n comp = wrapper.append(content)[0];\n const { left, top, position } = target.getStyle();\n comp.addStyle({ left, top, position });\n }\n this.handleDragEnd(comp, dt);\n target.remove();\n }\n });\n dragStop = cancel => dragger.stop(ev, { cancel });\n dragContent = cnt => (content = cnt);\n } else {\n const sorter = new utils.Sorter({\n em,\n wmargin: 1,\n nested: 1,\n canvasRelative: 1,\n direction: 'a',\n container: this.el,\n placer: canvas.getPlacerEl(),\n containerSel: '*',\n itemSel: '*',\n pfx: 'gjs-',\n onEndMove: model => this.handleDragEnd(model, dt),\n document: this.el.ownerDocument,\n ...(this.sortOpts || {})\n });\n sorter.setDropContent(content);\n sorter.startSort();\n this.sorter = sorter;\n dragStop = cancel => {\n cancel && (sorter.moved = 0);\n sorter.endMove();\n };\n dragContent = content => sorter.setDropContent(content);\n }\n\n this.dragStop = dragStop;\n this.dragContent = dragContent;\n em.trigger('canvas:dragenter', dt, content);\n }\n\n handleDragEnd(model, dt) {\n const { em } = this;\n this.over = 0;\n if (model) {\n em.set('dragResult', model);\n em.trigger('canvas:drop', dt, model);\n }\n em.runDefault({ preserveSelected: 1 });\n }\n\n /**\n * Always need to have this handler active for enabling the drop\n * @param {Event} ev\n */\n handleDragOver(ev) {\n ev.preventDefault();\n this.em.trigger('canvas:dragover', ev);\n }\n\n /**\n * WARNING: This function might fail to run on drop, for example, when the\n * drop, accidentally, happens on some external element (DOM not inside the iframe)\n */\n handleDrop(ev) {\n ev.preventDefault();\n const { dragContent } = this;\n const dt = ev.dataTransfer;\n const content = this.getContentByData(dt).content;\n ev.target.style.border = '';\n content && dragContent && dragContent(content);\n this.endDrop(!content, ev);\n }\n\n getContentByData(dt) {\n const em = this.em;\n const types = dt && dt.types;\n const files = (dt && dt.files) || [];\n const dragContent = em.get('dragContent');\n let content = dt && dt.getData('text');\n\n if (files.length) {\n content = [];\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n const type = file.type.split('/')[0];\n\n if (type == 'image') {\n content.push({\n type,\n file,\n attributes: { alt: file.name }\n });\n }\n }\n } else if (dragContent) {\n content = dragContent;\n } else if (indexOf(types, 'text/html') >= 0) {\n content = dt && dt.getData('text/html').replace(/<\\/?meta[^>]*>/g, '');\n } else if (indexOf(types, 'text/uri-list') >= 0) {\n content = {\n type: 'link',\n attributes: { href: content },\n content: content\n };\n } else if (indexOf(types, 'text/json') >= 0) {\n const json = dt && dt.getData('text/json');\n json && (content = JSON.parse(json));\n } else if (types.length === 1 && types[0] === 'text/plain') {\n // Avoid dropping non-selectable and non-editable text nodes inside the editor\n content = `
${content}
`;\n }\n\n const result = { content };\n em.trigger('canvas:dragdata', dt, result);\n\n return result;\n }\n}\n","import Backbone from 'backbone';\nimport { bindAll, isString, debounce, isUndefined } from 'underscore';\nimport CssRulesView from 'css_composer/view/CssRulesView';\nimport ComponentView from 'dom_components/view/ComponentView';\nimport Droppable from 'utils/Droppable';\nimport {\n appendVNodes,\n empty,\n append,\n createEl,\n createCustomEvent,\n motionsEv\n} from 'utils/dom';\nimport { on, off, setViewEl, hasDnd, getPointerEvent } from 'utils/mixins';\n\nexport default Backbone.View.extend({\n tagName: 'iframe',\n\n attributes: {\n allowfullscreen: 'allowfullscreen',\n 'data-frame-el': true\n },\n\n initialize(o) {\n bindAll(\n this,\n 'updateClientY',\n 'stopAutoscroll',\n 'autoscroll',\n '_emitUpdate'\n );\n const { model, el } = this;\n this.tools = {};\n this.config = {\n ...(o.config || {}),\n frameView: this\n };\n this.ppfx = this.config.pStylePrefix || '';\n this.em = this.config.em;\n const cvModel = this.getCanvasModel();\n this.listenTo(model, 'change:head', this.updateHead);\n this.listenTo(cvModel, 'change:styles', this.renderStyles);\n model.view = this;\n setViewEl(el, this);\n },\n\n /**\n * Update `` content of the frame\n */\n updateHead() {\n const { model } = this;\n const headEl = this.getHead();\n const toRemove = [];\n const toAdd = [];\n const current = model.get('head');\n const prev = model.previous('head');\n const attrStr = (attr = {}) =>\n Object.keys(attr)\n .sort()\n .map(i => `[${i}=\"${attr[i]}\"]`)\n .join('');\n const find = (items, stack, res) => {\n items.forEach(item => {\n const { tag, attributes } = item;\n const has = stack.some(\n s => s.tag === tag && attrStr(s.attributes) === attrStr(attributes)\n );\n !has && res.push(item);\n });\n };\n find(current, prev, toAdd);\n find(prev, current, toRemove);\n toRemove.forEach(stl => {\n const el = headEl.querySelector(`${stl.tag}${attrStr(stl.attributes)}`);\n el && el.parentNode.removeChild(el);\n });\n appendVNodes(headEl, toAdd);\n },\n\n getEl() {\n return this.el;\n },\n\n getCanvasModel() {\n return this.em.get('Canvas').getModel();\n },\n\n getWindow() {\n return this.getEl().contentWindow;\n },\n\n getDoc() {\n return this.getEl().contentDocument;\n },\n\n getHead() {\n return this.getDoc().querySelector('head');\n },\n\n getBody() {\n return this.getDoc().querySelector('body');\n },\n\n getWrapper() {\n return this.getBody().querySelector('[data-gjs-type=wrapper]');\n },\n\n getJsContainer() {\n if (!this.jsContainer) {\n this.jsContainer = createEl('div', { class: `${this.ppfx}js-cont` });\n }\n\n return this.jsContainer;\n },\n\n getToolsEl() {\n const { frameWrapView } = this.config;\n return frameWrapView && frameWrapView.elTools;\n },\n\n getGlobalToolsEl() {\n return this.em.get('Canvas').getGlobalToolsEl();\n },\n\n getHighlighter() {\n return this._getTool('[data-hl]');\n },\n\n getBadgeEl() {\n return this._getTool('[data-badge]');\n },\n\n getOffsetViewerEl() {\n return this._getTool('[data-offset]');\n },\n\n getRect() {\n if (!this.rect) {\n this.rect = this.el.getBoundingClientRect();\n }\n\n return this.rect;\n },\n\n /**\n * Get rect data, not affected by the canvas zoom\n */\n getOffsetRect() {\n const { el } = this;\n const { scrollTop, scrollLeft } = this.getBody();\n const height = el.offsetHeight;\n const width = el.offsetWidth;\n\n return {\n top: el.offsetTop,\n left: el.offsetLeft,\n height,\n width,\n scrollTop,\n scrollLeft,\n scrollBottom: scrollTop + height,\n scrollRight: scrollLeft + width\n };\n },\n\n _getTool(name) {\n const { tools } = this;\n const toolsEl = this.getToolsEl();\n\n if (!tools[name]) {\n tools[name] = toolsEl.querySelector(name);\n }\n\n return tools[name];\n },\n\n remove() {\n const wrp = this.wrapper;\n this._toggleEffects();\n this.tools = {};\n wrp && wrp.remove();\n Backbone.View.prototype.remove.apply(this, arguments);\n },\n\n startAutoscroll() {\n this.lastMaxHeight = this.getWrapper().offsetHeight - this.el.offsetHeight;\n\n // By detaching those from the stack avoid browsers lags\n // Noticeable with \"fast\" drag of blocks\n setTimeout(() => {\n this._toggleAutoscrollFx(1);\n requestAnimationFrame(this.autoscroll);\n }, 0);\n },\n\n autoscroll() {\n if (this.dragging) {\n const { lastClientY } = this;\n const canvas = this.em.get('Canvas');\n const win = this.getWindow();\n const body = this.getBody();\n const actualTop = body.scrollTop;\n const clientY = lastClientY || 0;\n const limitTop = canvas.getConfig().autoscrollLimit;\n const limitBottom = this.getRect().height - limitTop;\n let nextTop = actualTop;\n\n if (clientY < limitTop) {\n nextTop -= limitTop - clientY;\n }\n\n if (clientY > limitBottom) {\n nextTop += clientY - limitBottom;\n }\n\n if (\n !isUndefined(lastClientY) && // Fixes #3134\n nextTop !== actualTop &&\n nextTop > 0 &&\n nextTop < this.lastMaxHeight\n ) {\n const toolsEl = this.getGlobalToolsEl();\n toolsEl.style.opacity = 0;\n this.showGlobalTools();\n win.scrollTo(0, nextTop);\n }\n\n requestAnimationFrame(this.autoscroll);\n }\n },\n\n updateClientY(ev) {\n ev.preventDefault();\n this.lastClientY = getPointerEvent(ev).clientY * this.em.getZoomDecimal();\n },\n\n showGlobalTools: debounce(function() {\n this.getGlobalToolsEl().style.opacity = '';\n }, 50),\n\n stopAutoscroll() {\n this.dragging && this._toggleAutoscrollFx();\n },\n\n _toggleAutoscrollFx(enable) {\n this.dragging = enable;\n const win = this.getWindow();\n const method = enable ? 'on' : 'off';\n const mt = { on, off };\n mt[method](win, 'mousemove dragover', this.updateClientY);\n mt[method](win, 'mouseup', this.stopAutoscroll);\n },\n\n render() {\n const { $el, ppfx } = this;\n $el.attr({ class: `${ppfx}frame` });\n this.renderScripts();\n return this;\n },\n\n renderScripts() {\n const { el, model, em } = this;\n const evLoad = 'frame:load';\n const evOpts = { el, model, view: this };\n const canvas = this.getCanvasModel();\n const appendScript = scripts => {\n if (scripts.length > 0) {\n const src = scripts.shift();\n const scriptEl = createEl('script', {\n type: 'text/javascript',\n ...(isString(src) ? { src } : src)\n });\n scriptEl.onerror = scriptEl.onload = appendScript.bind(null, scripts);\n el.contentDocument.head.appendChild(scriptEl);\n } else {\n this.renderBody();\n em && em.trigger(evLoad, evOpts);\n }\n };\n\n el.onload = () => {\n em && em.trigger(`${evLoad}:before`, evOpts);\n appendScript([...canvas.get('scripts')]);\n };\n },\n\n renderStyles(opts = {}) {\n const head = this.getHead();\n const canvas = this.getCanvasModel();\n const normalize = stls =>\n stls.map(href => ({\n tag: 'link',\n attributes: {\n rel: 'stylesheet',\n ...(isString(href) ? { href } : href)\n }\n }));\n const prevStyles = normalize(opts.prev || canvas.previous('styles'));\n const styles = normalize(canvas.get('styles'));\n const toRemove = [];\n const toAdd = [];\n const find = (items, stack, res) => {\n items.forEach(item => {\n const { href } = item.attributes;\n const has = stack.some(s => s.attributes.href === href);\n !has && res.push(item);\n });\n };\n find(styles, prevStyles, toAdd);\n find(prevStyles, styles, toRemove);\n toRemove.forEach(stl => {\n const el = head.querySelector(`link[href=\"${stl.attributes.href}\"]`);\n el && el.parentNode.removeChild(el);\n });\n appendVNodes(head, toAdd);\n },\n\n renderBody() {\n const { config, model, ppfx } = this;\n const { em } = config;\n const doc = this.getDoc();\n const body = this.getBody();\n const win = this.getWindow();\n const conf = em.get('Config');\n win._isEditor = true;\n this.renderStyles({ prev: [] });\n\n const colorWarn = '#ffca6f';\n\n // I need all this styles to make the editor work properly\n // Remove `html { height: 100%;}` from the baseCss as it gives jumpings\n // effects (on ENTER) with RTE like CKEditor (maybe some bug there?!?)\n // With `body {height: auto;}` jumps in CKEditor are removed but in\n // Firefox is impossible to drag stuff in empty canvas, so bring back\n // `body {height: 100%;}`.\n // For the moment I give the priority to Firefox as it might be\n // CKEditor's issue\n append(\n body,\n ``\n );\n const component = model.getComponent();\n this.wrapper = new ComponentView({\n model: component,\n config: {\n ...component.config,\n frameView: this\n }\n }).render();\n append(body, this.wrapper.el);\n append(\n body,\n new CssRulesView({\n collection: model.getStyles(),\n config: {\n ...em.get('CssComposer').getConfig(),\n frameView: this\n }\n }).render().el\n );\n append(body, this.getJsContainer());\n // em.trigger('loaded'); // I need to manage only the first one maybe\n //this.updateOffset(); // TOFIX (check if I need it)\n\n // Avoid some default behaviours\n on(\n body,\n 'click',\n ev => ev && ev.target.tagName == 'A' && ev.preventDefault()\n );\n on(body, 'submit', ev => ev && ev.preventDefault());\n\n // When the iframe is focused the event dispatcher is not the same so\n // I need to delegate all events to the parent document\n [\n { event: 'keydown keyup keypress', class: 'KeyboardEvent' },\n { event: 'mousedown mousemove mouseup', class: 'MouseEvent' },\n { event: 'pointerdown pointermove pointerup', class: 'PointerEvent' },\n { event: 'wheel', class: 'WheelEvent' }\n ].forEach(obj =>\n obj.event.split(' ').forEach(event => {\n doc.addEventListener(event, ev =>\n this.el.dispatchEvent(createCustomEvent(ev, obj.class))\n );\n })\n );\n\n this._toggleEffects(1);\n this.droppable = hasDnd(em) && new Droppable(em, this.wrapper.el);\n model.trigger('loaded');\n },\n\n _toggleEffects(enable) {\n const method = enable ? on : off;\n const win = this.getWindow();\n win && method(win, `${motionsEv} resize`, this._emitUpdate);\n },\n\n _emitUpdate() {\n this.model._emitUpdated();\n }\n});\n","import Backbone from 'backbone';\nimport FrameView from './FrameView';\nimport { bindAll, isNumber, isNull, debounce } from 'underscore';\nimport { createEl, removeEl } from 'utils/dom';\nimport Dragger from 'utils/Dragger';\n\nexport default Backbone.View.extend({\n events: {\n 'click [data-action-remove]': 'remove',\n 'mousedown [data-action-move]': 'startDrag'\n },\n\n initialize(opts = {}, conf = {}) {\n bindAll(\n this,\n 'onScroll',\n 'frameLoaded',\n 'updateOffset',\n 'remove',\n 'startDrag'\n );\n const { model } = this;\n const config = {\n ...(opts.config || conf),\n frameWrapView: this\n };\n const { canvasView, em } = config;\n this.cv = canvasView;\n this.config = config;\n this.em = em;\n this.canvas = em && em.get('Canvas');\n this.ppfx = config.pStylePrefix || '';\n this.frame = new FrameView({ model, config });\n this.classAnim = `${this.ppfx}frame-wrapper--anim`;\n this.updateOffset = debounce(this.updateOffset.bind(this));\n this.updateSize = debounce(this.updateSize.bind(this));\n this.listenTo(model, 'loaded', this.frameLoaded);\n this.listenTo(model, 'change:x change:y', this.updatePos);\n this.listenTo(model, 'change:width change:height', this.updateSize);\n this.listenTo(model, 'destroy remove', this.remove);\n this.updatePos();\n this.setupDragger();\n },\n\n setupDragger() {\n const { canvas, model } = this;\n let dragX, dragY, zoom;\n const toggleEffects = on => {\n canvas.toggleFramesEvents(on);\n };\n\n this.dragger = new Dragger({\n onStart: () => {\n const { x, y } = model.attributes;\n zoom = this.em.getZoomMultiplier();\n dragX = x;\n dragY = y;\n toggleEffects();\n },\n onEnd: () => toggleEffects(1),\n setPosition: posOpts => {\n model.set({\n x: dragX + posOpts.x * zoom,\n y: dragY + posOpts.y * zoom\n });\n }\n });\n },\n\n startDrag(ev) {\n ev && this.dragger.start(ev);\n },\n\n __clear(opts) {\n const { frame } = this;\n frame && frame.remove(opts);\n removeEl(this.elTools);\n },\n\n remove(opts) {\n this.__clear(opts);\n Backbone.View.prototype.remove.apply(this, arguments);\n ['frame', 'dragger', 'cv', 'em', 'canvas', 'elTools'].forEach(\n i => (this[i] = 0)\n );\n return this;\n },\n\n updateOffset() {\n const { em, $el, frame } = this;\n if (!em) return;\n em.runDefault({ preserveSelected: 1 });\n $el.removeClass(this.classAnim);\n frame.model._emitUpdated();\n },\n\n updatePos(md) {\n const { model, el } = this;\n const { x, y } = model.attributes;\n const { style } = el;\n this.frame.rect = 0;\n style.left = isNaN(x) ? x : `${x}px`;\n style.top = isNaN(y) ? y : `${y}px`;\n md && this.updateOffset();\n },\n\n updateSize() {\n this.updateDim();\n },\n\n /**\n * Update dimensions of the frame\n * @private\n */\n updateDim() {\n const { em, el, $el, model, classAnim, frame } = this;\n if (!frame) return;\n frame.rect = 0;\n $el.addClass(classAnim);\n const { noChanges, width, height } = this.__handleSize();\n\n // Set width and height from DOM (should be done only once)\n if (isNull(width) || isNull(height)) {\n model.set(\n {\n ...(!width ? { width: el.offsetWidth } : {}),\n ...(!height ? { height: el.offsetHeight } : {})\n },\n { silent: 1 }\n );\n }\n\n // Prevent fixed highlighting box which appears when on\n // component hover during the animation\n em.stopDefault({ preserveSelected: 1 });\n noChanges ? this.updateOffset() : setTimeout(this.updateOffset, 350);\n },\n\n onScroll() {\n const { frame, em } = this;\n em.trigger('frame:scroll', {\n frame,\n body: frame.getBody(),\n target: frame.getWindow()\n });\n },\n\n frameLoaded() {\n const { frame } = this;\n frame.getWindow().onscroll = this.onScroll;\n this.updateDim();\n },\n\n __handleSize() {\n const un = 'px';\n const { model, el } = this;\n const { style } = el;\n const { width, height } = model.attributes;\n const currW = style.width || '';\n const currH = style.height || '';\n const newW = width || '';\n const newH = height || '';\n const noChanges = currW == newW && currH == newH;\n style.width = isNumber(newW) ? `${newW}${un}` : newW;\n style.height = isNumber(newH) ? `${newH}${un}` : newH;\n return { noChanges, width, height, newW, newH };\n },\n\n render() {\n const { frame, $el, ppfx, cv, model, el } = this;\n const { onRender } = model.attributes;\n this.__clear();\n this.__handleSize();\n frame.render();\n $el\n .empty()\n .attr({ class: `${ppfx}frame-wrapper` })\n .append(\n `\n
\n
\n ${model.get('name') || ''}\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n `\n )\n .append(frame.el);\n const elTools = createEl(\n 'div',\n {\n class: `${ppfx}tools`,\n style: 'pointer-events:none; display: none'\n },\n `\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n `\n );\n this.elTools = elTools;\n const twrp = cv.toolsWrapper;\n twrp && twrp.appendChild(elTools); // TODO remove on frame remove\n onRender &&\n onRender({\n el,\n elTop: el.querySelector('[data-frame-top]'),\n elRight: el.querySelector('[data-frame-right]'),\n elBottom: el.querySelector('[data-frame-bottom]'),\n elLeft: el.querySelector('[data-frame-left]'),\n frame: model,\n frameWrapperView: this,\n remove: this.remove,\n startDrag: this.startDrag\n });\n return this;\n }\n});\n","import DomainViews from 'domain_abstract/view/DomainViews';\nimport FrameWrapView from './FrameWrapView';\n\nexport default DomainViews.extend({\n itemView: FrameWrapView,\n autoAdd: 1,\n\n init() {\n this.listenTo(this.collection, 'reset', this.render);\n },\n\n onRemoveBefore(items, opts) {\n items.forEach(item => item.remove(opts));\n },\n\n onRender() {\n const { config, $el } = this;\n const { em } = config;\n em && $el.attr({ class: `${em.getConfig('stylePrefix')}frames` });\n }\n});\n","import Backbone from 'backbone';\nimport { bindAll } from 'underscore';\nimport {\n on,\n off,\n getElement,\n getKeyChar,\n isTextNode,\n getElRect,\n getUiClass\n} from 'utils/mixins';\nimport FramesView from './FramesView';\n\nconst $ = Backbone.$;\nlet timerZoom;\n\nexport default Backbone.View.extend({\n events: {\n wheel: 'onWheel'\n },\n\n template() {\n const { pfx } = this;\n return `\n
\n
\n `;\n },\n\n initialize(o) {\n bindAll(this, 'clearOff', 'onKeyPress', 'onCanvasMove');\n const { model } = this;\n this.config = o.config || {};\n this.em = this.config.em || {};\n this.pfx = this.config.stylePrefix || '';\n this.ppfx = this.config.pStylePrefix || '';\n this.className = this.config.stylePrefix + 'canvas';\n const { em } = this;\n this._initFrames();\n this.listenTo(em, 'change:canvasOffset', this.clearOff);\n this.listenTo(em, 'component:selected', this.checkSelected);\n this.listenTo(model, 'change:zoom change:x change:y', this.updateFrames);\n this.listenTo(model, 'change:frames', this._onFramesUpdate);\n this.toggleListeners(1);\n },\n\n _onFramesUpdate() {\n this._initFrames();\n this._renderFrames();\n },\n\n _initFrames() {\n const { frames, model, config, em } = this;\n const collection = model.get('frames');\n em.set('readyCanvas', 0);\n collection.once('loaded:all', () => em.set('readyCanvas', 1));\n frames && frames.remove();\n this.frames = new FramesView({\n collection,\n config: {\n ...config,\n canvasView: this\n }\n });\n },\n\n checkSelected(component, opts = {}) {\n const { scroll } = opts;\n const currFrame = this.em.get('currentFrame');\n\n scroll &&\n component.views.forEach(view => {\n view._getFrame() !== currFrame && view.scrollIntoView(scroll);\n });\n },\n\n remove() {\n this.frames.remove();\n this.frames = {};\n Backbone.View.prototype.remove.apply(this, arguments);\n this.toggleListeners();\n },\n\n preventDefault(ev) {\n if (ev) {\n ev.preventDefault();\n ev._parentEvent && ev._parentEvent.preventDefault();\n }\n },\n\n onCanvasMove(ev) {\n // const data = { x: ev.clientX, y: ev.clientY };\n // const data2 = this.em.get('Canvas').getMouseRelativeCanvas(ev);\n // const data3 = this.em.get('Canvas').getMouseRelativePos(ev);\n // this.em.trigger('canvas:over', data, data2, data3);\n },\n\n toggleListeners(enable) {\n const { el } = this;\n const fn = enable ? on : off;\n fn(document, 'keypress', this.onKeyPress);\n fn(window, 'scroll resize', this.clearOff);\n // fn(el, 'mousemove dragover', this.onCanvasMove);\n },\n\n onKeyPress(ev) {\n const { em } = this;\n const key = getKeyChar(ev);\n\n if (\n key === ' ' &&\n em.getZoomDecimal() !== 1 &&\n !em.get('Canvas').isInputFocused()\n ) {\n this.preventDefault(ev);\n em.get('Editor').runCommand('core:canvas-move');\n }\n },\n\n onWheel(ev) {\n if ((ev.ctrlKey || ev.metaKey) && this.em.getConfig('multiFrames')) {\n this.preventDefault(ev);\n const { model } = this;\n const delta = Math.max(-1, Math.min(1, ev.wheelDelta || -ev.detail));\n const zoom = model.get('zoom');\n model.set('zoom', zoom + delta * 2);\n }\n },\n\n updateFrames(ev) {\n const { em, model } = this;\n const { x, y } = model.attributes;\n const zoom = this.getZoom();\n const defOpts = { preserveSelected: 1 };\n const mpl = zoom ? 1 / zoom : 1;\n this.framesArea.style.transform = `scale(${zoom}) translate(${x *\n mpl}px, ${y * mpl}px)`;\n this.clearOff();\n em.stopDefault(defOpts);\n em.trigger('canvas:update', ev);\n timerZoom && clearTimeout(timerZoom);\n timerZoom = setTimeout(() => em.runDefault(defOpts), 300);\n },\n\n getZoom() {\n return this.em.getZoomDecimal();\n },\n\n /**\n * Checks if the element is visible in the canvas's viewport\n * @param {HTMLElement} el\n * @return {Boolean}\n */\n isElInViewport(el) {\n const elem = getElement(el);\n const rect = getElRect(elem);\n const frameRect = this.getFrameOffset(elem);\n const rTop = rect.top;\n const rLeft = rect.left;\n return (\n rTop >= 0 &&\n rLeft >= 0 &&\n rTop <= frameRect.height &&\n rLeft <= frameRect.width\n );\n },\n\n /**\n * Get the offset of the element\n * @param {HTMLElement} el\n * @return {Object}\n */\n offset(el, opts = {}) {\n const rect = getElRect(el);\n const docBody = el.ownerDocument.body;\n const { noScroll } = opts;\n\n return {\n top: rect.top + (noScroll ? 0 : docBody.scrollTop),\n left: rect.left + (noScroll ? 0 : docBody.scrollLeft),\n width: rect.width,\n height: rect.height\n };\n },\n\n /**\n * Cleare cached offsets\n * @private\n */\n clearOff() {\n this.frmOff = null;\n this.cvsOff = null;\n },\n\n /**\n * Return frame offset\n * @return {Object}\n * @private\n */\n getFrameOffset(el) {\n if (!this.frmOff || el) {\n const frame = this.frame.el;\n const winEl = el && el.ownerDocument.defaultView;\n const frEl = winEl ? winEl.frameElement : frame;\n this.frmOff = this.offset(frEl || frame);\n }\n return this.frmOff;\n },\n\n /**\n * Return canvas offset\n * @return {Object}\n * @private\n */\n getCanvasOffset() {\n if (!this.cvsOff) this.cvsOff = this.offset(this.el);\n return this.cvsOff;\n },\n\n /**\n * Returns element's rect info\n * @param {HTMLElement} el\n * @return {Object}\n * @private\n */\n getElementPos(el, opts) {\n const zoom = this.getZoom();\n var opt = opts || {};\n var frmOff = this.getFrameOffset(el);\n var cvsOff = this.getCanvasOffset();\n var eo = this.offset(el, opts);\n\n var frmTop = opt.avoidFrameOffset ? 0 : frmOff.top;\n var frmLeft = opt.avoidFrameOffset ? 0 : frmOff.left;\n\n const top = eo.top * zoom + frmTop - cvsOff.top;\n const left = eo.left * zoom + frmLeft - cvsOff.left;\n const height = eo.height * zoom;\n const width = eo.width * zoom;\n\n return { top, left, height, width, zoom, rect: eo };\n },\n\n /**\n * Returns element's offsets like margins and paddings\n * @param {HTMLElement} el\n * @return {Object}\n * @private\n */\n getElementOffsets(el) {\n if (!el || isTextNode(el)) return {};\n const result = {};\n const styles = window.getComputedStyle(el);\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft'\n ].forEach(offset => {\n result[offset] = parseFloat(styles[offset]) * this.getZoom();\n });\n\n return result;\n },\n\n /**\n * Returns position data of the canvas element\n * @return {Object} obj Position object\n * @private\n */\n getPosition(opts = {}) {\n const doc = this.frame.el.contentDocument;\n if (!doc) return;\n const bEl = doc.body;\n const zoom = this.getZoom();\n const fo = this.getFrameOffset();\n const co = this.getCanvasOffset();\n const { noScroll } = opts;\n\n return {\n top: fo.top + (noScroll ? 0 : bEl.scrollTop) * zoom - co.top,\n left: fo.left + (noScroll ? 0 : bEl.scrollLeft) * zoom - co.left,\n width: co.width,\n height: co.height\n };\n },\n\n /**\n * Update javascript of a specific component passed by its View\n * @param {View} view Component's View\n * @private\n */\n updateScript(view) {\n const model = view.model;\n const id = model.getId();\n\n if (!view.scriptContainer) {\n view.scriptContainer = $(`
`);\n this.getJsContainer().appendChild(view.scriptContainer.get(0));\n }\n\n view.el.id = id;\n view.scriptContainer.html('');\n // In editor, I make use of setTimeout as during the append process of elements\n // those will not be available immediately, therefore 'item' variable\n const script = document.createElement('script');\n const scriptFn = model.getScriptString();\n const scriptFnStr = model.get('script-props')\n ? scriptFn\n : `function(){\\n${scriptFn}\\n;}`;\n const scriptProps = JSON.stringify(model.__getScriptProps());\n script.innerHTML = `\n setTimeout(function() {\n var item = document.getElementById('${id}');\n if (!item) return;\n (${scriptFnStr}.bind(item))(${scriptProps})\n }, 1);`;\n // #873\n // Adding setTimeout will make js components work on init of the editor\n setTimeout(() => {\n const scr = view.scriptContainer;\n scr && scr.get(0).appendChild(script);\n }, 0);\n },\n\n /**\n * Get javascript container\n * @private\n */\n getJsContainer(view) {\n const frameView = this.getFrameView(view);\n return frameView && frameView.getJsContainer();\n },\n\n getFrameView(view) {\n return (view && view._getFrame()) || this.em.get('currentFrame');\n },\n\n _renderFrames() {\n if (!this.ready) return;\n const { model, frames, em, framesArea } = this;\n const frms = model.get('frames');\n frms.listenToLoad();\n frames.render();\n const mainFrame = frms.at(0);\n const currFrame = mainFrame && mainFrame.view;\n em.setCurrentFrame(currFrame);\n framesArea && framesArea.appendChild(frames.el);\n this.frame = currFrame;\n },\n\n render() {\n const { el, $el, ppfx, config, em } = this;\n $el.html(this.template());\n const $frames = $el.find('[data-frames]');\n this.framesArea = $frames.get(0);\n\n const toolsWrp = $el.find('[data-tools]');\n this.toolsWrapper = toolsWrp.get(0);\n toolsWrp.append(`\n
\n
\n
\n
\n
\n
\n ${config.extHl ? `
` : ''}\n
\n
\n
\n
\n
\n
\n
\n `);\n const toolsEl = el.querySelector(`#${ppfx}tools`);\n this.hlEl = el.querySelector(`.${ppfx}highlighter`);\n this.badgeEl = el.querySelector(`.${ppfx}badge`);\n this.placerEl = el.querySelector(`.${ppfx}placeholder`);\n this.ghostEl = el.querySelector(`.${ppfx}ghost`);\n this.toolbarEl = el.querySelector(`.${ppfx}toolbar`);\n this.resizerEl = el.querySelector(`.${ppfx}resizer`);\n this.offsetEl = el.querySelector(`.${ppfx}offset-v`);\n this.fixedOffsetEl = el.querySelector(`.${ppfx}offset-fixed-v`);\n this.toolsGlobEl = el.querySelector(`.${ppfx}tools-gl`);\n this.toolsEl = toolsEl;\n this.el.className = getUiClass(em, this.className);\n this.ready = 1;\n this._renderFrames();\n\n return this;\n }\n});\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/canvas/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * canvas: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const canvas = editor.Canvas;\n * ```\n *\n * * [getConfig](#getconfig)\n * * [getElement](#getelement)\n * * [getFrameEl](#getframeel)\n * * [getWindow](#getwindow)\n * * [getDocument](#getdocument)\n * * [getBody](#getbody)\n * * [setCustomBadgeLabel](#setcustombadgelabel)\n * * [hasFocus](#hasfocus)\n * * [scrollTo](#scrollto)\n * * [setZoom](#setzoom)\n * * [getZoom](#getzoom)\n * * [getCoords](#getcoords)\n * * [setCoords](#setcoords)\n *\n * [Component]: component.html\n * [Frame]: frame.html\n *\n * @module Canvas\n */\n\nimport { isUndefined } from 'underscore';\nimport { getElement, getViewEl } from 'utils/mixins';\nimport defaults from './config/config';\nimport Canvas from './model/Canvas';\nimport canvasView from './view/CanvasView';\n\nexport default () => {\n let c = {};\n let canvas;\n let CanvasView;\n\n return {\n /**\n * Used inside RTE\n * @private\n */\n getCanvasView() {\n return CanvasView;\n },\n\n name: 'Canvas',\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @private\n */\n init(config = {}) {\n c = {\n ...defaults,\n ...config,\n module: this\n };\n\n this.em = c.em;\n const { scripts, styles } = c;\n const ppfx = c.pStylePrefix;\n if (ppfx) c.stylePrefix = ppfx + c.stylePrefix;\n canvas = new Canvas({ scripts, styles }, config);\n this.model = canvas;\n this.startAutoscroll = this.startAutoscroll.bind(this);\n this.stopAutoscroll = this.stopAutoscroll.bind(this);\n return this;\n },\n\n onLoad() {\n this.model.init();\n },\n\n getModel() {\n return canvas;\n },\n\n /**\n * Get the configuration object\n * @returns {Object} Configuration object\n * @example\n * console.log(canvas.getConfig())\n */\n getConfig() {\n return c;\n },\n\n /**\n * Get the canvas element\n * @returns {HTMLElement}\n */\n getElement() {\n return CanvasView.el;\n },\n\n getFrame(index) {\n return this.getFrames()[index || 0];\n },\n\n /**\n * Get the main frame element of the canvas\n * @returns {HTMLIFrameElement}\n */\n getFrameEl() {\n const { frame } = CanvasView || {};\n return frame && frame.el;\n },\n\n getFramesEl() {\n return CanvasView.framesArea;\n },\n\n /**\n * Get the main frame window instance\n * @returns {Window}\n */\n getWindow() {\n return this.getFrameEl().contentWindow;\n },\n\n /**\n * Get the main frame document element\n * @returns {HTMLDocument}\n */\n getDocument() {\n const frame = this.getFrameEl();\n return frame && frame.contentDocument;\n },\n\n /**\n * Get the main frame body element\n * @return {HTMLBodyElement}\n */\n getBody() {\n const doc = this.getDocument();\n return doc && doc.body;\n },\n\n _getCompFrame(compView) {\n return compView && compView._getFrame();\n },\n\n _getLocalEl(globalEl, compView, method) {\n let result = globalEl;\n const frameView = this._getCompFrame(compView);\n result = frameView ? frameView[method]() : result;\n\n return result;\n },\n\n /**\n * Returns element containing all global canvas tools\n * @returns {HTMLElement}\n * @private\n */\n getGlobalToolsEl() {\n return CanvasView.toolsGlobEl;\n },\n\n /**\n * Returns element containing all canvas tools\n * @returns {HTMLElement}\n * @private\n */\n getToolsEl(compView) {\n return this._getLocalEl(CanvasView.toolsEl, compView, 'getToolsEl');\n },\n\n /**\n * Returns highlighter element\n * @returns {HTMLElement}\n * @private\n */\n getHighlighter(compView) {\n return this._getLocalEl(CanvasView.hlEl, compView, 'getHighlighter');\n },\n\n /**\n * Returns badge element\n * @returns {HTMLElement}\n * @private\n */\n getBadgeEl(compView) {\n return this._getLocalEl(CanvasView.badgeEl, compView, 'getBadgeEl');\n },\n\n /**\n * Returns placer element\n * @returns {HTMLElement}\n * @private\n */\n getPlacerEl() {\n return CanvasView.placerEl;\n },\n\n /**\n * Returns ghost element\n * @returns {HTMLElement}\n * @private\n */\n getGhostEl() {\n return CanvasView.ghostEl;\n },\n\n /**\n * Returns toolbar element\n * @returns {HTMLElement}\n * @private\n */\n getToolbarEl() {\n return CanvasView.toolbarEl;\n },\n\n /**\n * Returns resizer element\n * @returns {HTMLElement}\n * @private\n */\n getResizerEl() {\n return CanvasView.resizerEl;\n },\n\n /**\n * Returns offset viewer element\n * @returns {HTMLElement}\n * @private\n */\n getOffsetViewerEl(compView) {\n return this._getLocalEl(\n CanvasView.offsetEl,\n compView,\n 'getOffsetViewerEl'\n );\n },\n\n /**\n * Returns fixed offset viewer element\n * @returns {HTMLElement}\n * @private\n */\n getFixedOffsetViewerEl() {\n return CanvasView.fixedOffsetEl;\n },\n\n render() {\n CanvasView && CanvasView.remove();\n CanvasView = new canvasView({\n model: canvas,\n config: c\n });\n return CanvasView.render().el;\n },\n\n /**\n * Get frame position\n * @returns {Object}\n * @private\n */\n getOffset() {\n var frameOff = this.offset(this.getFrameEl());\n var canvasOff = this.offset(this.getElement());\n return {\n top: frameOff.top - canvasOff.top,\n left: frameOff.left - canvasOff.left\n };\n },\n\n /**\n * Get the offset of the passed component element\n * @param {HTMLElement} el\n * @returns {Object}\n * @private\n */\n offset(el) {\n return CanvasView.offset(el);\n },\n\n /**\n * Set custom badge naming strategy\n * @param {Function} f\n * @example\n * canvas.setCustomBadgeLabel(function(component){\n * return component.getName();\n * });\n */\n setCustomBadgeLabel(f) {\n c.customBadgeLabel = f;\n },\n\n /**\n * Get element position relative to the canvas\n * @param {HTMLElement} el\n * @returns {Object}\n * @private\n */\n getElementPos(el, opts) {\n return CanvasView.getElementPos(el, opts);\n },\n\n /**\n * Returns element's offsets like margins and paddings\n * @param {HTMLElement} el\n * @returns {Object}\n * @private\n */\n getElementOffsets(el) {\n return CanvasView.getElementOffsets(el);\n },\n\n /**\n * Get canvas rectangular data\n * @returns {Object}\n */\n getRect() {\n const { top, left } = CanvasView.getPosition();\n return {\n ...CanvasView.getCanvasOffset(),\n topScroll: top,\n leftScroll: left\n };\n },\n\n /**\n * This method comes handy when you need to attach something like toolbars\n * to elements inside the canvas, dealing with all relative position,\n * offsets, etc. and returning as result the object with positions which are\n * viewable by the user (when the canvas is scrolled the top edge of the element\n * is not viewable by the user anymore so the new top edge is the one of the canvas)\n *\n * The target should be visible before being passed here as invisible elements\n * return empty string as width\n * @param {HTMLElement} target The target in this case could be the toolbar\n * @param {HTMLElement} element The element on which I'd attach the toolbar\n * @param {Object} options Custom options\n * @param {Boolean} options.toRight Set to true if you want the toolbar attached to the right\n * @return {Object}\n * @private\n */\n getTargetToElementDim(target, element, options = {}) {\n var opts = options || {};\n var canvasPos = CanvasView.getPosition();\n if (!canvasPos) return;\n var pos = opts.elPos || CanvasView.getElementPos(element);\n var toRight = options.toRight || 0;\n var targetHeight = opts.targetHeight || target.offsetHeight;\n var targetWidth = opts.targetWidth || target.offsetWidth;\n var eventToTrigger = opts.event || null;\n\n var elTop = pos.top - targetHeight;\n var elLeft = pos.left;\n elLeft += toRight ? pos.width : 0;\n elLeft = toRight ? elLeft - targetWidth : elLeft;\n\n var leftPos = elLeft < canvasPos.left ? canvasPos.left : elLeft;\n var topPos = elTop < canvasPos.top ? canvasPos.top : elTop;\n topPos = topPos > pos.top + pos.height ? pos.top + pos.height : topPos;\n\n var result = {\n top: topPos,\n left: leftPos,\n elementTop: pos.top,\n elementLeft: pos.left,\n elementWidth: pos.width,\n elementHeight: pos.height,\n targetWidth: target.offsetWidth,\n targetHeight: target.offsetHeight,\n canvasTop: canvasPos.top,\n canvasLeft: canvasPos.left,\n canvasWidth: canvasPos.width,\n canvasHeight: canvasPos.height\n };\n\n // In this way I can catch data and also change the position strategy\n if (eventToTrigger && c.em) {\n c.em.trigger(eventToTrigger, result);\n }\n\n return result;\n },\n\n canvasRectOffset(el, pos, opts = {}) {\n const getFrameElFromDoc = doc => {\n const { defaultView } = doc;\n return defaultView && defaultView.frameElement;\n };\n\n const rectOff = (el, top = 1, pos) => {\n const zoom = this.em.getZoomDecimal();\n const side = top ? 'top' : 'left';\n const doc = el.ownerDocument;\n const { offsetTop = 0, offsetLeft = 0 } = opts.offset\n ? getFrameElFromDoc(doc)\n : {};\n const { scrollTop = 0, scrollLeft = 0 } = doc.body || {};\n const scroll = top ? scrollTop : scrollLeft;\n const offset = top ? offsetTop : offsetLeft;\n\n // if (!top) {\n // console.log('LEFT', { posLeft: pos[side], scroll, offset }, el);\n // }\n\n return pos[side] - (scroll - offset) * zoom;\n };\n\n return {\n top: rectOff(el, 1, pos),\n left: rectOff(el, 0, pos)\n };\n },\n\n getTargetToElementFixed(el, elToMove, opts = {}) {\n const pos = opts.pos || this.getElementPos(el);\n const cvOff = opts.canvasOff || this.canvasRectOffset(el, pos);\n const toolbarH = elToMove.offsetHeight || 0;\n const toolbarW = elToMove.offsetWidth || 0;\n const elRight = pos.left + pos.width;\n const cv = this.getCanvasView();\n const frCvOff = cv.getPosition();\n const frameOffset = cv.getFrameOffset(el);\n const { event } = opts;\n\n let top = -toolbarH;\n let left = !isUndefined(opts.left) ? opts.left : pos.width - toolbarW;\n left = pos.left < -left ? -pos.left : left;\n left = elRight > frCvOff.width ? left - (elRight - frCvOff.width) : left;\n\n // Scroll with the window if the top edge is reached and the\n // element is bigger than the canvas\n const fullHeight = pos.height + toolbarH;\n const elIsShort = fullHeight < frameOffset.height;\n\n if (cvOff.top < toolbarH) {\n if (elIsShort) {\n top = top + fullHeight;\n } else {\n top = -cvOff.top < pos.height ? -cvOff.top : pos.height;\n }\n }\n\n const result = {\n top,\n left,\n canvasOffsetTop: cvOff.top,\n canvasOffsetLeft: cvOff.left\n };\n\n // In this way I can catch data and also change the position strategy\n event && this.em.trigger(event, result);\n\n return result;\n },\n\n /**\n * Instead of simply returning e.clientX and e.clientY this function\n * calculates also the offset based on the canvas. This is helpful when you\n * need to get X and Y position while moving between the editor area and\n * canvas area, which is in the iframe\n * @param {Event} e\n * @return {Object}\n * @private\n */\n getMouseRelativePos(e, options) {\n var opts = options || {};\n var addTop = 0;\n var addLeft = 0;\n var subWinOffset = opts.subWinOffset;\n var doc = e.target.ownerDocument;\n var win = doc.defaultView || doc.parentWindow;\n var frame = win.frameElement;\n var yOffset = subWinOffset ? win.pageYOffset : 0;\n var xOffset = subWinOffset ? win.pageXOffset : 0;\n\n if (frame) {\n var frameRect = frame.getBoundingClientRect();\n addTop = frameRect.top || 0;\n addLeft = frameRect.left || 0;\n }\n\n return {\n y: e.clientY + addTop - yOffset,\n x: e.clientX + addLeft - xOffset\n };\n },\n\n /**\n * X and Y mouse position relative to the canvas\n * @param {Event} ev\n * @return {Object}\n * @private\n */\n getMouseRelativeCanvas(ev, opts) {\n const zoom = this.getZoomDecimal();\n const { top, left } = CanvasView.getPosition(opts);\n\n return {\n y: ev.clientY * zoom + top,\n x: ev.clientX * zoom + left\n };\n },\n\n /**\n * Check if the canvas is focused\n * @returns {Boolean}\n */\n hasFocus() {\n return this.getDocument().hasFocus();\n },\n\n /**\n * Detects if some input is focused (input elements, text components, etc.)\n * @return {Boolean}\n * @private\n */\n isInputFocused() {\n const doc = this.getDocument();\n const frame = this.getFrameEl();\n const toIgnore = ['body', ...this.getConfig().notTextable];\n const docActive = frame && document.activeElement === frame;\n const focused = docActive\n ? doc && doc.activeElement\n : document.activeElement;\n\n return focused && !toIgnore.some(item => focused.matches(item));\n },\n\n /**\n * Scroll canvas to the element if it's not visible. The scrolling is\n * executed via `scrollIntoView` API and options of this method are\n * passed to it. For instance, you can scroll smoothly by using\n * `{ behavior: 'smooth' }`.\n * @param {HTMLElement|[Component]} el\n * @param {Object} [opts={}] Options, same as options for `scrollIntoView`\n * @param {Boolean} [opts.force=false] Force the scroll, even if the element is already visible\n * @example\n * const selected = editor.getSelected();\n * // Scroll smoothly (this behavior can be polyfilled)\n * canvas.scrollTo(selected, { behavior: 'smooth' });\n * // Force the scroll, even if the element is alredy visible\n * canvas.scrollTo(selected, { force: true });\n */\n scrollTo(el, opts = {}) {\n const elem = getElement(el);\n const view = elem && getViewEl(elem);\n view && view.scrollIntoView(opts);\n },\n\n /**\n * Start autoscroll\n * @private\n */\n startAutoscroll(frame) {\n const fr = (frame && frame.view) || this.em.getCurrentFrame();\n fr && fr.startAutoscroll();\n },\n\n /**\n * Stop autoscroll\n * @private\n */\n stopAutoscroll(frame) {\n const fr = (frame && frame.view) || this.em.getCurrentFrame();\n fr && fr.stopAutoscroll();\n },\n\n /**\n * Set canvas zoom value\n * @param {Number} value The zoom value, from 0 to 100\n * @returns {this}\n * @example\n * canvas.setZoom(50); // set zoom to 50%\n */\n setZoom(value) {\n canvas.set('zoom', parseFloat(value));\n return this;\n },\n\n /**\n * Get canvas zoom value\n * @returns {Number}\n * @example\n * canvas.setZoom(50); // set zoom to 50%\n * const zoom = canvas.getZoom(); // 50\n */\n getZoom() {\n return parseFloat(canvas.get('zoom'));\n },\n\n /**\n * Set canvas position coordinates\n * @param {Number} x Horizontal position\n * @param {Number} y Vertical position\n * @returns {this}\n * @example\n * canvas.setCoords(100, 100);\n */\n setCoords(x, y) {\n canvas.set({ x: parseFloat(x), y: parseFloat(y) });\n return this;\n },\n\n /**\n * Get canvas position coordinates\n * @returns {Object} Object containing coordinates\n * @example\n * canvas.setCoords(100, 100);\n * const coords = canvas.getCoords();\n * // { x: 100, y: 100 }\n */\n getCoords() {\n const { x, y } = canvas.attributes;\n return { x, y };\n },\n\n getZoomDecimal() {\n return this.getZoom() / 100;\n },\n\n getZoomMultiplier() {\n const zoom = this.getZoomDecimal();\n return zoom ? 1 / zoom : 1;\n },\n\n toggleFramesEvents(on) {\n const { style } = this.getFramesEl();\n style.pointerEvents = on ? '' : 'none';\n },\n\n getFrames() {\n return canvas.get('frames').map(item => item);\n },\n\n /**\n * Add new frame to the canvas\n * @param {Object} props Frame properties\n * @returns {[Frame]}\n * @example\n * canvas.addFrame({\n * name: 'Mobile home page',\n * x: 100, // Position in canvas\n * y: 100,\n * width: 500, // Frame dimensions\n * height: 600,\n * // device: 'DEVICE-ID',\n * components: [\n * '

Title frame

',\n * '

Paragraph frame

',\n * ],\n * styles: `\n * .testh { color: red; }\n * .testp { color: blue; }\n * `,\n * });\n */\n addFrame(props = {}, opts = {}) {\n return canvas.get('frames').add(\n {\n ...props\n },\n {\n ...opts,\n em: this.em\n }\n );\n },\n\n destroy() {\n canvas.stopListening();\n CanvasView && CanvasView.remove();\n [c, canvas, CanvasView].forEach(i => (i = {}));\n ['em', 'model', 'droppable'].forEach(i => (this[i] = {}));\n }\n };\n};\n","export default {\n stylePrefix: 'sm-',\n\n sectors: [],\n\n // Specify the element to use as a container, string (query) or HTMLElement\n // With the empty value, nothing will be rendered\n appendTo: '',\n\n // Hide the property in case it's not stylable for the\n // selected component (each component has 'stylable' property)\n hideNotStylable: true,\n\n // Highlight changed properties of the selected component\n highlightChanged: true,\n\n // Highlight computed properties of the selected component\n highlightComputed: true,\n\n // Show computed properties of the selected component, if this value\n // is set to false, highlightComputed will not take effect\n showComputed: true,\n\n // Adds the possibility to clear property value from the target style\n clearProperties: true,\n\n // Properties not to take in account for computed styles\n avoidComputed: ['width', 'height']\n};\n","export default () => ({\n /**\n * Build props object by their name\n * @param {Array|string} props Array of properties name\n * @return {Array}\n */\n build(props) {\n var objs = [];\n var dftFixedValues = ['initial', 'inherit'];\n\n if (typeof props === 'string') props = [props];\n\n for (var i = 0, len = props.length; i < len; i++) {\n var obj = {};\n var prop = props[i];\n obj.property = prop;\n\n // Property\n switch (prop) {\n case 'border-radius-c':\n obj.property = 'border-radius';\n break;\n }\n\n // Fixed values\n switch (prop) {\n case 'top':\n case 'right':\n case 'bottom':\n case 'left':\n case 'margin-top':\n case 'margin-right':\n case 'margin-bottom':\n case 'margin-left':\n case 'padding-top':\n case 'padding-right':\n case 'padding-bottom':\n case 'padding-left':\n case 'width':\n case 'max-width':\n case 'min-width':\n case 'height':\n case 'max-height':\n case 'min-height':\n case 'flex-basis':\n obj.fixedValues = ['initial', 'inherit', 'auto'];\n break;\n case 'font-size':\n obj.fixedValues = [\n 'medium',\n 'xx-small',\n 'x-small',\n 'small',\n 'large',\n 'x-large',\n 'xx-large',\n 'smaller',\n 'larger',\n 'length',\n 'initial',\n 'inherit'\n ];\n break;\n case 'letter-spacing':\n case 'line-height':\n obj.fixedValues = ['normal', 'initial', 'inherit'];\n break;\n }\n\n // Type\n switch (prop) {\n case 'float':\n case 'position':\n case 'text-align':\n obj.type = 'radio';\n break;\n case 'display':\n case 'flex-direction':\n case 'flex-wrap':\n case 'justify-content':\n case 'align-items':\n case 'align-content':\n case 'align-self':\n case 'font-family':\n case 'font-weight':\n case 'border-style':\n case 'box-shadow-type':\n case 'background-repeat':\n case 'background-position':\n case 'background-attachment':\n case 'background-size':\n case 'transition-property':\n case 'transition-timing-function':\n case 'cursor':\n case 'overflow':\n case 'overflow-x':\n case 'overflow-y':\n obj.type = 'select';\n break;\n case 'top':\n case 'right':\n case 'bottom':\n case 'left':\n case 'margin-top':\n case 'margin-right':\n case 'margin-bottom':\n case 'margin-left':\n case 'padding-top':\n case 'padding-right':\n case 'padding-bottom':\n case 'padding-left':\n case 'min-height':\n case 'min-width':\n case 'max-height':\n case 'max-width':\n case 'width':\n case 'height':\n case 'font-size':\n case 'letter-spacing':\n case 'line-height':\n case 'text-shadow-h':\n case 'text-shadow-v':\n case 'text-shadow-blur':\n case 'border-radius-c':\n case 'border-top-left-radius':\n case 'border-top-right-radius':\n case 'border-bottom-left-radius':\n case 'border-bottom-right-radius':\n case 'border-width':\n case 'box-shadow-h':\n case 'box-shadow-v':\n case 'box-shadow-blur':\n case 'box-shadow-spread':\n case 'transition-duration':\n case 'perspective':\n case 'transform-rotate-x':\n case 'transform-rotate-y':\n case 'transform-rotate-z':\n case 'transform-scale-x':\n case 'transform-scale-y':\n case 'transform-scale-z':\n case 'order':\n case 'flex-grow':\n case 'flex-shrink':\n case 'flex-basis':\n obj.type = 'integer';\n break;\n case 'margin':\n case 'padding':\n case 'border-radius':\n case 'border':\n case 'transform':\n obj.type = 'composite';\n break;\n case 'color':\n case 'text-shadow-color':\n case 'background-color':\n case 'border-color':\n case 'box-shadow-color':\n obj.type = 'color';\n break;\n case 'text-shadow':\n case 'box-shadow':\n case 'background':\n case 'transition':\n obj.type = 'stack';\n break;\n case 'background-image':\n obj.type = 'file';\n break;\n }\n\n // Defaults\n switch (prop) {\n case 'float':\n case 'background-color':\n case 'text-shadow':\n obj.defaults = 'none';\n break;\n case 'display':\n obj.defaults = 'block';\n break;\n case 'flex-direction':\n obj.defaults = 'row';\n break;\n case 'flex-wrap':\n obj.defaults = 'nowrap';\n break;\n case 'justify-content':\n obj.defaults = 'flex-start';\n break;\n case 'align-items':\n obj.defaults = 'stretch';\n break;\n case 'align-content':\n obj.defaults = 'stretch';\n break;\n case 'align-self':\n obj.defaults = 'auto';\n break;\n case 'position':\n obj.defaults = 'static';\n break;\n case 'margin-top':\n case 'margin-right':\n case 'margin-bottom':\n case 'margin-left':\n case 'padding-top':\n case 'padding-right':\n case 'padding-bottom':\n case 'padding-left':\n case 'text-shadow-h':\n case 'text-shadow-v':\n case 'text-shadow-blur':\n case 'border-radius-c':\n case 'box-shadow-h':\n case 'box-shadow-v':\n case 'box-shadow-spread':\n case 'perspective':\n case 'transform-rotate-x':\n case 'transform-rotate-y':\n case 'transform-rotate-z':\n case 'order':\n case 'flex-grow':\n obj.defaults = 0;\n break;\n case 'border-top-left-radius':\n case 'border-top-right-radius':\n case 'border-bottom-left-radius':\n case 'border-bottom-right-radius':\n obj.defaults = '0px';\n break;\n case 'transform-scale-x':\n case 'transform-scale-y':\n case 'transform-scale-z':\n case 'flex-shrink':\n obj.defaults = 1;\n break;\n case 'box-shadow-blur':\n obj.defaults = '5px';\n break;\n case 'top':\n case 'right':\n case 'bottom':\n case 'left':\n case 'min-height':\n case 'min-width':\n case 'max-height':\n case 'max-width':\n case 'width':\n case 'height':\n case 'background-size':\n case 'cursor':\n case 'flex-basis':\n obj.defaults = 'auto';\n break;\n case 'font-family':\n obj.defaults = 'Arial, Helvetica, sans-serif';\n break;\n case 'font-size':\n case 'border-width':\n obj.defaults = 'medium';\n break;\n case 'font-weight':\n obj.defaults = '400';\n break;\n case 'letter-spacing':\n case 'line-height':\n obj.defaults = 'normal';\n break;\n case 'color':\n case 'text-shadow-color':\n case 'border-color':\n case 'box-shadow-color':\n obj.defaults = 'black';\n break;\n case 'text-align':\n obj.defaults = 'left';\n break;\n case 'border-style':\n obj.defaults = 'solid';\n break;\n case 'box-shadow-type':\n obj.defaults = '';\n break;\n case 'background-repeat':\n obj.defaults = 'repeat';\n break;\n case 'background-position':\n obj.defaults = 'left top';\n break;\n case 'background-attachment':\n obj.defaults = 'scroll';\n break;\n case 'transition-property':\n obj.defaults = 'width';\n break;\n case 'transition-duration':\n obj.defaults = '2';\n break;\n case 'transition-timing-function':\n obj.defaults = 'ease';\n break;\n case 'overflow':\n case 'overflow-x':\n case 'overflow-y':\n obj.defaults = 'visible';\n break;\n }\n\n /*\n * Add styleable dependency on other properties. Allows properties to be\n * dynamically hidden or shown based on values of other properties.\n *\n * Property will be styleable if all of the properties (keys) in the\n * requires object have any of the values specified in the array.\n */\n switch (prop) {\n case 'flex-direction':\n case 'flex-wrap':\n case 'justify-content':\n case 'align-items':\n case 'align-content':\n obj.requires = { display: ['flex'] };\n break;\n case 'order':\n case 'flex-basis':\n case 'flex-grow':\n case 'flex-shrink':\n case 'align-self':\n obj.requiresParent = { display: ['flex'] };\n break;\n }\n\n // Units\n switch (prop) {\n case 'top':\n case 'bottom':\n case 'margin-top':\n case 'margin-bottom':\n case 'padding-top':\n case 'padding-bottom':\n case 'min-height':\n case 'max-height':\n case 'height':\n obj.units = ['px', '%', 'vh'];\n break;\n case 'right':\n case 'left':\n case 'margin-right':\n case 'margin-left':\n case 'padding-right':\n case 'padding-left':\n case 'min-width':\n case 'max-width':\n case 'width':\n obj.units = ['px', '%', 'vw'];\n break;\n case 'flex-basis':\n obj.units = ['px', '%', 'vw', 'vh'];\n break;\n case 'text-shadow-v':\n case 'text-shadow-h':\n case 'text-shadow-blur':\n case 'border-radius-c':\n case 'border-top-left-radius':\n case 'border-top-right-radius':\n case 'border-bottom-left-radius':\n case 'border-bottom-right-radius':\n case 'box-shadow-h':\n case 'box-shadow-v':\n obj.units = ['px', '%'];\n break;\n case 'font-size':\n case 'letter-spacing':\n case 'line-height':\n obj.units = ['px', 'em', 'rem', '%'];\n break;\n case 'border-width':\n obj.units = ['px', 'em'];\n break;\n case 'box-shadow-blur':\n case 'box-shadow-spread':\n case 'perspective':\n obj.units = ['px'];\n break;\n case 'transition-duration':\n obj.units = ['s'];\n break;\n case 'transform-rotate-x':\n case 'transform-rotate-y':\n case 'transform-rotate-z':\n obj.units = ['deg'];\n break;\n }\n\n // Min/Max\n switch (prop) {\n case 'padding-top':\n case 'padding-right':\n case 'padding-bottom':\n case 'padding-left':\n case 'min-height':\n case 'min-width':\n case 'max-height':\n case 'max-width':\n case 'width':\n case 'height':\n case 'font-size':\n case 'text-shadow-blur':\n case 'border-radius-c':\n case 'border-top-left-radius':\n case 'border-top-right-radius':\n case 'border-bottom-left-radius':\n case 'border-bottom-right-radius':\n case 'border-width':\n case 'box-shadow-blur':\n case 'transition-duration':\n case 'perspective':\n case 'flex-basis':\n obj.min = 0;\n break;\n }\n\n // Preview\n switch (prop) {\n case 'text-shadow':\n case 'box-shadow':\n case 'background':\n obj.preview = true;\n break;\n }\n\n // Detached\n switch (prop) {\n case 'background':\n obj.detached = true;\n break;\n }\n\n // Functions\n switch (prop) {\n case 'transform-rotate-x':\n obj.functionName = 'rotateX';\n break;\n case 'transform-rotate-y':\n obj.functionName = 'rotateY';\n break;\n case 'transform-rotate-z':\n obj.functionName = 'rotateZ';\n break;\n case 'transform-scale-x':\n obj.functionName = 'scaleX';\n break;\n case 'transform-scale-y':\n obj.functionName = 'scaleY';\n break;\n case 'transform-scale-z':\n obj.functionName = 'scaleZ';\n break;\n case 'background-image':\n obj.functionName = 'url';\n break;\n }\n\n // Options\n switch (prop) {\n case 'float':\n obj.list = [{ value: 'none' }, { value: 'left' }, { value: 'right' }];\n break;\n case 'display':\n obj.list = [\n { value: 'block' },\n { value: 'inline' },\n { value: 'inline-block' },\n { value: 'flex' },\n { value: 'none' }\n ];\n break;\n case 'flex-direction':\n obj.list = [\n { value: 'row' },\n { value: 'row-reverse' },\n { value: 'column' },\n { value: 'column-reverse' }\n ];\n break;\n case 'flex-wrap':\n obj.list = [\n { value: 'nowrap' },\n { value: 'wrap' },\n { value: 'wrap-reverse' }\n ];\n break;\n case 'justify-content':\n obj.list = [\n { value: 'flex-start' },\n { value: 'flex-end' },\n { value: 'center' },\n { value: 'space-between' },\n { value: 'space-around' },\n { value: 'space-evenly' }\n ];\n break;\n case 'align-items':\n obj.list = [\n { value: 'flex-start' },\n { value: 'flex-end' },\n { value: 'center' },\n { value: 'baseline' },\n { value: 'stretch' }\n ];\n break;\n case 'align-content':\n obj.list = [\n { value: 'flex-start' },\n { value: 'flex-end' },\n { value: 'center' },\n { value: 'space-between' },\n { value: 'space-around' },\n { value: 'stretch' }\n ];\n break;\n case 'align-self':\n obj.list = [\n { value: 'auto' },\n { value: 'flex-start' },\n { value: 'flex-end' },\n { value: 'center' },\n { value: 'baseline' },\n { value: 'stretch' }\n ];\n break;\n case 'position':\n obj.list = [\n { value: 'static' },\n { value: 'relative' },\n { value: 'absolute' },\n { value: 'fixed' }\n ];\n break;\n case 'font-family':\n var ss = ', sans-serif';\n var fonts = [\n 'Arial, Helvetica' + ss,\n 'Arial Black, Gadget' + ss,\n 'Brush Script MT' + ss,\n 'Comic Sans MS, cursive' + ss,\n 'Courier New, Courier, monospace',\n 'Georgia, serif',\n 'Helvetica' + ss,\n 'Impact, Charcoal' + ss,\n 'Lucida Sans Unicode, Lucida Grande' + ss,\n 'Tahoma, Geneva' + ss,\n 'Times New Roman, Times, serif',\n 'Trebuchet MS, Helvetica' + ss,\n 'Verdana, Geneva' + ss\n ];\n obj.list = [];\n for (var j = 0, l = fonts.length; j < l; j++) {\n var font = {};\n font.value = fonts[j];\n font.name = fonts[j].split(',')[0];\n obj.list.push(font);\n }\n break;\n case 'font-weight':\n obj.list = [\n { value: '100', name: 'Thin' },\n { value: '200', name: 'Extra-Light' },\n { value: '300', name: 'Light' },\n { value: '400', name: 'Normal' },\n { value: '500', name: 'Medium' },\n { value: '600', name: 'Semi-Bold' },\n { value: '700', name: 'Bold' },\n { value: '800', name: 'Extra-Bold' },\n { value: '900', name: 'Ultra-Bold' }\n ];\n break;\n case 'text-align':\n obj.list = [\n { value: 'left' },\n { value: 'center' },\n { value: 'right' },\n { value: 'justify' }\n ];\n break;\n case 'border-style':\n obj.list = [\n { value: 'none' },\n { value: 'solid' },\n { value: 'dotted' },\n { value: 'dashed' },\n { value: 'double' },\n { value: 'groove' },\n { value: 'ridge' },\n { value: 'inset' },\n { value: 'outset' }\n ];\n break;\n case 'box-shadow-type':\n obj.list = [\n { value: '', name: 'Outside' },\n { value: 'inset', name: 'Inside' }\n ];\n break;\n case 'background-repeat':\n obj.list = [\n { value: 'repeat' },\n { value: 'repeat-x' },\n { value: 'repeat-y' },\n { value: 'no-repeat' }\n ];\n break;\n case 'background-position':\n obj.list = [\n { value: 'left top' },\n { value: 'left center' },\n { value: 'left bottom' },\n { value: 'right top' },\n { value: 'right center' },\n { value: 'right bottom' },\n { value: 'center top' },\n { value: 'center center' },\n { value: 'center bottom' }\n ];\n break;\n case 'background-attachment':\n obj.list = [\n { value: 'scroll' },\n { value: 'fixed' },\n { value: 'local' }\n ];\n break;\n case 'background-size':\n obj.list = [\n { value: 'auto' },\n { value: 'cover' },\n { value: 'contain' }\n ];\n break;\n case 'transition-property':\n obj.list = [\n { value: 'all' },\n { value: 'width' },\n { value: 'height' },\n { value: 'background-color' },\n { value: 'transform' },\n { value: 'box-shadow' },\n { value: 'opacity' }\n ];\n break;\n case 'transition-timing-function':\n obj.list = [\n { value: 'linear' },\n { value: 'ease' },\n { value: 'ease-in' },\n { value: 'ease-out' },\n { value: 'ease-in-out' }\n ];\n break;\n case 'cursor':\n obj.list = [\n { value: 'auto' },\n { value: 'pointer' },\n { value: 'copy' },\n { value: 'crosshair' },\n { value: 'grab' },\n { value: 'grabbing' },\n { value: 'help' },\n { value: 'move' },\n { value: 'text' }\n ];\n break;\n case 'overflow':\n case 'overflow-x':\n case 'overflow-y':\n obj.list = [\n { value: 'visible' },\n { value: 'hidden' },\n { value: 'scroll' },\n { value: 'auto' }\n ];\n break;\n }\n\n // Properties\n switch (prop) {\n case 'margin':\n obj.properties = this.build([\n 'margin-top',\n 'margin-right',\n 'margin-bottom',\n 'margin-left'\n ]);\n break;\n case 'padding':\n obj.properties = this.build([\n 'padding-top',\n 'padding-right',\n 'padding-bottom',\n 'padding-left'\n ]);\n break;\n case 'text-shadow':\n obj.properties = this.build([\n 'text-shadow-h',\n 'text-shadow-v',\n 'text-shadow-blur',\n 'text-shadow-color'\n ]);\n break;\n case 'border':\n obj.properties = this.build([\n 'border-width',\n 'border-style',\n 'border-color'\n ]);\n break;\n case 'border-radius':\n obj.properties = this.build([\n 'border-top-left-radius',\n 'border-top-right-radius',\n 'border-bottom-right-radius',\n 'border-bottom-left-radius'\n ]);\n break;\n case 'box-shadow':\n obj.properties = this.build([\n 'box-shadow-h',\n 'box-shadow-v',\n 'box-shadow-blur',\n 'box-shadow-spread',\n 'box-shadow-color',\n 'box-shadow-type'\n ]);\n break;\n case 'background':\n obj.properties = this.build([\n 'background-image',\n 'background-repeat',\n 'background-position',\n 'background-attachment',\n 'background-size'\n ]);\n break;\n case 'transition':\n obj.properties = this.build([\n 'transition-property',\n 'transition-duration',\n 'transition-timing-function'\n ]);\n break;\n case 'transform':\n obj.properties = this.build([\n 'transform-rotate-x',\n 'transform-rotate-y',\n 'transform-rotate-z',\n 'transform-scale-x',\n 'transform-scale-y',\n 'transform-scale-z'\n ]);\n break;\n }\n\n objs.push(obj);\n }\n\n return objs;\n }\n});\n","import { Model } from 'common';\nimport { extend } from 'underscore';\nimport Properties from './Properties';\nimport PropertyFactory from './PropertyFactory';\n\n/**\n * @typedef Sector\n * @property {String} id Sector id, eg. `typography`\n * @property {String} name Sector name, eg. `Typography`\n * @property {Boolean} [open=true] Indicates the open state.\n * @property {Array} [properties=[]] Indicate an array of Property defintions\n *\n * [Property]: property.html\n */\nexport default class Sector extends Model {\n defaults() {\n return {\n id: '',\n name: '',\n open: true,\n buildProps: '',\n extendBuilded: 1,\n properties: []\n };\n }\n\n initialize(opts) {\n const o = opts || {};\n const builded = this.buildProperties(o.buildProps);\n const name = this.get('name') || '';\n let props = [];\n !this.get('id') && this.set('id', name.replace(/ /g, '_').toLowerCase());\n\n if (!builded) props = this.get('properties');\n else props = this.extendProperties(builded);\n\n const propsModel = new Properties(props);\n propsModel.sector = this;\n this.set('properties', propsModel);\n }\n\n /**\n * Get sector id.\n * @returns {String}\n */\n getId() {\n return this.get('id');\n }\n\n /**\n * Get sector name.\n * @returns {String}\n */\n getName() {\n return this.get('name');\n }\n\n /**\n * Update sector name.\n * @param {String} value New sector name\n */\n setName(value) {\n return this.set('name', value);\n }\n\n /**\n * Check if the sector is open\n * @returns {Boolean}\n */\n isOpen() {\n return !!this.get('open');\n }\n\n /**\n * Update Sector open state\n * @param {Boolean} value\n */\n setOpen(value) {\n return this.set('open', value);\n }\n\n /**\n * Get sector properties.\n * @returns {Array<[Property]>}\n */\n getProperties() {\n const props = this.get('properties');\n return props.models ? [...props.models] : props;\n }\n\n /**\n * Extend properties\n * @param {Array} props Start properties\n * @param {Array} moProps Model props\n * @param {Boolean} ex Returns the same amount of passed model props\n * @return {Array} Final props\n * @private\n */\n extendProperties(props, moProps, ex) {\n var pLen = props.length;\n var mProps = moProps || this.get('properties');\n var ext = this.get('extendBuilded');\n var isolated = [];\n\n for (var i = 0, len = mProps.length; i < len; i++) {\n var mProp = mProps[i];\n var found = 0;\n\n for (var j = 0; j < pLen; j++) {\n var prop = props[j];\n if (mProp.property == prop.property || mProp.id == prop.property) {\n // Check for nested properties\n var mPProps = mProp.properties;\n if (mPProps && mPProps.length) {\n mProp.properties = this.extendProperties(\n prop.properties || [],\n mPProps,\n 1\n );\n }\n props[j] = ext ? extend(prop, mProp) : mProp;\n isolated[j] = props[j];\n found = 1;\n continue;\n }\n }\n\n if (!found) {\n props.push(mProp);\n isolated.push(mProp);\n }\n }\n\n return ex ? isolated.filter(i => i) : props;\n }\n\n /**\n * Build properties\n * @param {Array} propr Array of props as sting\n * @return {Array}\n * @private\n */\n buildProperties(props) {\n var r;\n var buildP = props || [];\n\n if (!buildP.length) return;\n\n if (!this.propFactory) this.propFactory = new PropertyFactory();\n\n r = this.propFactory.build(buildP);\n\n return r;\n }\n}\n","import { Collection } from 'common';\nimport Sector from './Sector';\n\nexport default class Sectors extends Collection {\n initialize() {\n this.listenTo(this, 'reset', this.onReset);\n }\n\n onReset(models, opts = {}) {\n const prev = opts.previousModels || [];\n prev.forEach(sect => sect.get('properties').reset());\n }\n}\n\nSectors.prototype.model = Sector;\n","import { View } from 'backbone';\nimport html from 'utils/html';\nimport PropertiesView from './PropertiesView';\n\nexport default class SectorView extends View {\n template({ pfx, label }) {\n return html`\n
\n \n ${label}\n
\n `;\n }\n\n events() {\n return {\n 'click [data-sector-title]': 'toggle'\n };\n }\n\n initialize(o) {\n this.config = o.config || {};\n this.em = this.config.em;\n this.pfx = this.config.stylePrefix || '';\n this.target = o.target || {};\n this.propTarget = o.propTarget || {};\n this.caretR = 'fa-caret-right';\n this.caretD = 'fa-caret-down';\n const model = this.model;\n this.listenTo(model, 'change:open', this.updateOpen);\n this.listenTo(model, 'updateVisibility', this.updateVisibility);\n this.listenTo(model, 'destroy remove', this.remove);\n }\n\n /**\n * If all properties are hidden this will hide the sector\n */\n updateVisibility() {\n var show;\n this.model.get('properties').each(prop => {\n if (prop.get('visible')) {\n show = 1;\n }\n });\n this.el.style.display = show ? '' : 'none';\n }\n\n /**\n * Update visibility\n */\n updateOpen() {\n if (this.model.get('open')) this.show();\n else this.hide();\n }\n\n /**\n * Show the content of the sector\n * */\n show() {\n this.$el.addClass(this.pfx + 'open');\n this.getPropertiesEl().style.display = '';\n this.$caret.removeClass(this.caretR).addClass(this.caretD);\n }\n\n /**\n * Hide the content of the sector\n * */\n hide() {\n this.$el.removeClass(this.pfx + 'open');\n this.getPropertiesEl().style.display = 'none';\n this.$caret.removeClass(this.caretD).addClass(this.caretR);\n }\n\n getPropertiesEl() {\n return this.$el.find(`.${this.pfx}properties`).get(0);\n }\n\n /**\n * Toggle visibility\n * */\n toggle(e) {\n const { model } = this;\n const v = model.get('open') ? 0 : 1;\n model.set('open', v);\n }\n\n render() {\n const { pfx, model, em, $el } = this;\n const { id, name } = model.attributes;\n const label = (em && em.t(`styleManager.sectors.${id}`)) || name;\n $el.html(this.template({ pfx, label }));\n this.$caret = $el.find(`#${pfx}caret`);\n this.renderProperties();\n $el.attr('class', `${pfx}sector ${pfx}sector__${id} no-select`);\n this.updateOpen();\n return this;\n }\n\n renderProperties() {\n const { model, target, propTarget, config } = this;\n const objs = model.get('properties');\n\n if (objs) {\n const view = new PropertiesView({\n collection: objs,\n target,\n propTarget,\n config\n });\n this.$el.append(view.render().el);\n }\n }\n}\n","import Backbone from 'backbone';\nimport { extend, isString, isArray } from 'underscore';\nimport { isTaggableNode } from 'utils/mixins';\nimport { appendAtIndex } from 'utils/dom';\nimport SectorView from './SectorView';\n\nconst helperCls = 'hc-state';\n\nexport default Backbone.View.extend({\n initialize(o = {}) {\n const config = o.config || {};\n this.pfx = config.stylePrefix || '';\n this.ppfx = config.pStylePrefix || '';\n this.target = o.target || {};\n this.config = config;\n\n // The target that will emit events for properties\n const target = {};\n extend(target, Backbone.Events);\n const body = document.body;\n const dummy = document.createElement(`el-${new Date().getTime()}`);\n body.appendChild(dummy);\n target.computedDefault = { ...window.getComputedStyle(dummy) };\n body.removeChild(dummy);\n this.propTarget = target;\n const coll = this.collection;\n const events =\n 'component:toggled component:update:classes change:state change:device frame:resized';\n this.listenTo(coll, 'add', this.addTo);\n this.listenTo(coll, 'reset', this.render);\n this.listenTo(this.target, events, this.targetUpdated);\n },\n\n remove() {\n Backbone.View.prototype.remove.apply(this, arguments);\n ['target', 'config', 'propTarget'].forEach(i => (this[i] = {}));\n },\n\n /**\n * Add to collection\n * @param {Object} model Model\n * @return {Object}\n * @private\n * */\n addTo(model, coll, opts = {}) {\n this.addToCollection(model, null, opts);\n },\n\n toggleStateCls(targets = [], enable) {\n targets.forEach(trg => {\n const el = trg.getEl();\n el && el.classList && el.classList[enable ? 'add' : 'remove'](helperCls);\n });\n },\n\n /**\n * Fired when target is updated\n * @private\n */\n targetUpdated(trg) {\n const em = this.target;\n const pt = this.propTarget;\n const targets = em.getSelectedAll();\n let model = em.getSelected();\n const mdToClear = trg && !!trg.toHTML ? trg : model;\n\n // Clean components\n mdToClear && this.toggleStateCls([mdToClear]);\n if (!model) return;\n\n const config = em.get('Config');\n const state = !config.devicePreviewMode ? em.get('state') : '';\n const { componentFirst } = em.get('SelectorManager').getConfig();\n const el = model.getEl();\n pt.helper = null;\n pt.targets = null;\n\n // Create computed style container\n if (el && isTaggableNode(el)) {\n const stateStr = state ? `:${state}` : null;\n pt.computed = window.getComputedStyle(el, stateStr);\n }\n\n // Create a new rule for the state as a helper\n const appendStateRule = (style = {}) => {\n const cc = em.get('CssComposer');\n const rules = cc.getAll();\n let helperRule = cc.getClassRule(helperCls);\n\n if (!helperRule) {\n helperRule = cc.setClassRule(helperCls);\n } else {\n // I will make it last again, otherwise it could be overridden\n rules.remove(helperRule);\n rules.add(helperRule);\n }\n\n helperRule.set('important', 1);\n helperRule.setStyle(style);\n pt.helper = helperRule;\n };\n\n const sm = em.get('StyleManager');\n const target = sm.getModelToStyle(model);\n\n if (state) {\n appendStateRule(target.getStyle());\n this.toggleStateCls(targets, 1);\n }\n\n pt.model = target;\n pt.parentRules = sm.getParentRules(target, state);\n if (componentFirst) {\n pt.targets = targets.map(t => sm.getModelToStyle(t)).filter(Boolean);\n }\n pt.trigger('update');\n em.trigger('styleManager:update');\n },\n\n /**\n * Select different target for the Style Manager.\n * It could be a Component, CSSRule, or a string of any CSS selector\n * @param {Component|CSSRule|String|Array} target\n * @return {Array} Array of Components/CSSRules\n */\n setTarget(target, opts = {}) {\n const em = this.target;\n const trgs = isArray(target) ? target : [target];\n const { targetIsClass, stylable } = opts;\n const models = [];\n\n trgs.forEach(target => {\n let model = target;\n\n if (isString(target)) {\n let rule;\n const rules = em.get('CssComposer').getAll();\n\n if (targetIsClass) {\n rule = rules.filter(\n rule => rule.get('selectors').getFullString() === target\n )[0];\n }\n\n if (!rule) {\n rule = rules.filter(rule => rule.get('selectorsAdd') === target)[0];\n }\n\n if (!rule) {\n rule = rules.add({ selectors: [], selectorsAdd: target });\n }\n\n stylable && rule.set({ stylable });\n model = rule;\n }\n\n models.push(model);\n });\n\n const pt = this.propTarget;\n pt.targets = models;\n pt.trigger('update', { targets: models });\n return models;\n },\n\n /**\n * Add new object to collection\n * @param {Object} model Model\n * @param {Object} fragmentEl collection\n * @return {Object} Object created\n * @private\n * */\n addToCollection(model, fragmentEl, opts = {}) {\n const { pfx, target, propTarget, config, el } = this;\n const appendTo = fragmentEl || el;\n const rendered = new SectorView({\n model,\n id: `${pfx}${model.get('id')}`,\n name: model.get('name'),\n properties: model.get('properties'),\n target,\n propTarget,\n config\n }).render().el;\n appendAtIndex(appendTo, rendered, opts.at);\n\n return rendered;\n },\n\n render() {\n const frag = document.createDocumentFragment();\n const $el = this.$el;\n const pfx = this.pfx;\n const ppfx = this.ppfx;\n $el.empty();\n this.collection.each(model => this.addToCollection(model, frag));\n $el.append(frag);\n $el.addClass(`${pfx}sectors ${ppfx}one-bg ${ppfx}two-color`);\n return this;\n }\n});\n","/**\n * With Style Manager you build categories (called sectors) of CSS properties which could be used to customize the style of components.\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/style_manager/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * styleManager: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const styleManager = editor.StyleManager;\n * ```\n *\n * * [getConfig](#getconfig)\n * * [addSector](#addsector)\n * * [getSector](#getsector)\n * * [removeSector](#removesector)\n * * [getSectors](#getsectors)\n * * [addProperty](#addproperty)\n * * [getProperty](#getproperty)\n * * [removeProperty](#removeproperty)\n * * [getProperties](#getproperties)\n * * [getModelToStyle](#getmodeltostyle)\n * * [addType](#addtype)\n * * [getType](#gettype)\n * * [getTypes](#gettypes)\n * * [createType](#createtype)\n *\n * [Sector]: sector.html\n * [CssRule]: css_rule.html\n * [Component]: component.html\n *\n * @module StyleManager\n */\n\nimport {\n isElement,\n isUndefined,\n isArray,\n isString,\n debounce\n} from 'underscore';\nimport Module from 'common/module';\nimport { Model } from 'common';\nimport defaults from './config/config';\nimport Sector from './model/Sector';\nimport Sectors from './model/Sectors';\nimport Properties from './model/Properties';\nimport PropertyFactory from './model/PropertyFactory';\nimport SectorsView from './view/SectorsView';\n\nexport default () => {\n var c = {};\n let properties;\n var sectors, SectView;\n\n return {\n ...Module,\n\n Sector,\n\n PropertyFactory: PropertyFactory(),\n\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'StyleManager',\n\n /**\n * Get configuration object\n * @return {Object}\n */\n getConfig() {\n return c;\n },\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @private\n */\n init(config) {\n c = { ...defaults, ...config };\n const ppfx = c.pStylePrefix;\n const { em } = c;\n this.em = em;\n if (ppfx) c.stylePrefix = ppfx + c.stylePrefix;\n properties = new Properties();\n sectors = new Sectors([], c);\n this.model = new Model({ targets: [] });\n const toListen =\n 'component:toggled component:update:classes change:state change:device frame:resized selector:type';\n em.on(\n toListen,\n debounce(() => {\n this.select(em.getSelectedAll());\n em.trigger('style:custom');\n })\n );\n\n return this;\n },\n\n onLoad() {\n // Use silent as sectors' view will be created and rendered on StyleManager.render\n sectors.add(c.sectors, { silent: true });\n },\n\n postRender() {\n const elTo = this.getConfig().appendTo;\n\n if (elTo) {\n const el = isElement(elTo) ? elTo : document.querySelector(elTo);\n if (!el) return this.__logWarn('\"appendTo\" element not found');\n el.appendChild(this.render());\n }\n },\n\n /**\n * Add new sector to the collection. If the sector with the same id already exists,\n * that one will be returned.\n * @param {string} id Sector id\n * @param {Object} sector Object representing sector\n * @param {string} [sector.name=''] Sector's label\n * @param {Boolean} [sector.open=true] Indicates if the sector should be opened\n * @param {Array} [sector.properties=[]] Array of properties\n * @param {Object} [options={}] Options\n * @return {[Sector]} Added Sector\n * @example\n * const sector = styleManager.addSector('mySector',{\n * name: 'My sector',\n * open: true,\n * properties: [{ name: 'My property'}]\n * }, { at: 0 });\n * // With `at: 0` we place the new sector at the beginning of the collection\n * */\n addSector(id, sector, options = {}) {\n let result = this.getSector(id);\n\n if (!result) {\n sector.id = id;\n result = sectors.add(sector, options);\n }\n\n return result;\n },\n\n /**\n * Get sector by id\n * @param {string} id Sector id\n * @return {[Sector]|null}\n * @example\n * const sector = styleManager.getSector('mySector');\n * */\n getSector(id, opts = {}) {\n const res = sectors.where({ id })[0];\n !res && opts.warn && this._logNoSector(id);\n return res || null;\n },\n\n /**\n * Remove a sector by id\n * @param {string} id Sector id\n * @return {[Sector]} Removed sector\n * @example\n * const removed = styleManager.removeSector('mySector');\n */\n removeSector(id) {\n return this.getSectors().remove(this.getSector(id, { warn: 1 }));\n },\n\n /**\n * Get all sectors\n * @returns {Collection<[Sector]>} Collection of sectors\n * @example\n * const sectors = styleManager.getSectors();\n * */\n getSectors(opts = {}) {\n return sectors && sectors.models\n ? opts.array\n ? [...sectors.models]\n : sectors\n : [];\n },\n\n /**\n * Add property to the sector identified by id\n * @param {string} sectorId Sector id\n * @param {Object} property Property object\n * @param {string} [property.name=''] Name of the property\n * @param {string} [property.property=''] CSS property, eg. `min-height`\n * @param {string} [property.type=''] Type of the property: integer | radio | select | color | file | composite | stack\n * @param {Array} [property.units=[]] Unit of measure available, eg. ['px','%','em']. Only for integer type\n * @param {string} [property.unit=''] Default selected unit from `units`. Only for integer type\n * @param {number} [property.min=null] Min possible value. Only for integer type\n * @param {number} [property.max=null] Max possible value. Only for integer type\n * @param {string} [property.defaults=''] Default value\n * @param {string} [property.info=''] Some description\n * @param {string} [property.icon=''] Class name. If exists no text will be displayed\n * @param {Boolean} [property.preview=false] Show layers preview. Only for stack type\n * @param {string} [property.functionName=''] Indicates if value need to be wrapped in some function, for istance `transform: rotate(90deg)`\n * @param {Array} [property.properties=[]] Nested properties for composite and stack type\n * @param {Array} [property.layers=[]] Layers for stack properties\n * @param {Array} [property.list=[]] List of possible options for radio and select types\n * @param {Object} [options={}] Options\n * @return {Property|null} Added Property or `null` in case sector doesn't exist\n * @example\n * var property = styleManager.addProperty('mySector',{\n * name: 'Minimum height',\n * property: 'min-height',\n * type: 'select',\n * defaults: '100px',\n * list: [{\n * value: '100px',\n * name: '100',\n * },{\n * value: '200px',\n * name: '200',\n * }],\n * }, { at: 0 });\n * // With `at: 0` we place the new property at the beginning of the collection\n */\n addProperty(sectorId, property, opts = {}) {\n const sector = this.getSector(sectorId, { warn: 1 });\n let prop = null;\n if (sector) prop = sector.get('properties').add(property, opts);\n\n return prop;\n },\n\n /**\n * Get property by its CSS name and sector id\n * @param {string} sectorId Sector id\n * @param {string} name CSS property name (or id), eg. 'min-height'\n * @return {Property|null}\n * @example\n * var property = styleManager.getProperty('mySector','min-height');\n */\n getProperty(sectorId, name) {\n const sector = this.getSector(sectorId, { warn: 1 });\n let prop;\n\n if (sector) {\n prop = sector\n .get('properties')\n .filter(\n prop => prop.get('property') === name || prop.get('id') === name\n )[0];\n }\n\n return prop || null;\n },\n\n /**\n * Remove a property from the sector\n * @param {string} sectorId Sector id\n * @param {string} name CSS property name, eg. 'min-height'\n * @return {Property} Removed property\n * @example\n * const property = styleManager.removeProperty('mySector', 'min-height');\n */\n removeProperty(sectorId, name) {\n const props = this.getProperties(sectorId);\n return props && props.remove(this.getProperty(sectorId, name));\n },\n\n /**\n * Get properties of the sector\n * @param {string} sectorId Sector id\n * @return {Properties} Collection of properties\n * @example\n * var properties = styleManager.getProperties('mySector');\n */\n getProperties(sectorId) {\n let props = null;\n const sector = this.getSector(sectorId, { warn: 1 });\n if (sector) props = sector.get('properties');\n\n return props;\n },\n\n /**\n * Get what to style inside Style Manager. If you select the component\n * without classes the entity is the Component itself and all changes will\n * go inside its 'style' property. Otherwise, if the selected component has\n * one or more classes, the function will return the corresponding CSS Rule\n * @param {Model} model\n * @return {Model}\n */\n getModelToStyle(model, options = {}) {\n const em = c.em;\n const { skipAdd } = options;\n const classes = model.get('classes');\n const id = model.getId();\n\n if (em && classes) {\n const config = em.getConfig();\n const um = em.get('UndoManager');\n const cssC = em.get('CssComposer');\n const sm = em.get('SelectorManager');\n const smConf = sm ? sm.getConfig() : {};\n const state = !config.devicePreviewMode ? em.get('state') : '';\n const valid = classes.getStyleable();\n const hasClasses = valid.length;\n const useClasses = !smConf.componentFirst || options.useClasses;\n const addOpts = { noCount: 1 };\n const opts = { state, addOpts };\n let rule;\n\n // I stop undo manager here as after adding the CSSRule (generally after\n // selecting the component) and calling undo() it will remove the rule from\n // the collection, therefore updating it in style manager will not affect it\n // #268\n um.stop();\n\n if (hasClasses && useClasses) {\n const deviceW = em.getCurrentMedia();\n rule = cssC.get(valid, state, deviceW);\n\n if (!rule && !skipAdd) {\n rule = cssC.add(valid, state, deviceW, {}, addOpts);\n }\n } else if (config.avoidInlineStyle) {\n rule = cssC.getIdRule(id, opts);\n !rule && !skipAdd && (rule = cssC.setIdRule(id, {}, opts));\n if (model.is('wrapper')) rule.set('wrapper', 1, addOpts);\n }\n\n rule && (model = rule);\n um.start();\n }\n\n return model;\n },\n\n getParentRules(target, state) {\n const { em } = c;\n let result = [];\n\n if (em && target) {\n const cssC = em.get('CssComposer');\n const cssGen = em.get('CodeManager').getGenerator('css');\n const all = cssC\n .getRules(target.getSelectors().getFullString())\n .filter(rule => (state ? rule.get('state') === state : 1))\n .sort(cssGen.sortRules)\n .reverse();\n result = all.slice(all.indexOf(target) + 1);\n }\n\n return result;\n },\n\n /**\n * Add new property type\n * @param {string} id Type ID\n * @param {Object} definition Definition of the type. Each definition contains\n * `model` (business logic), `view` (presentation logic)\n * and `isType` function which recognize the type of the\n * passed entity\n *@example\n * styleManager.addType('my-custom-prop', {\n * create({ props, change }) {\n * const el = document.createElement('div');\n * el.innerHTML = '';\n * const inputEl = el.querySelector('.my-input');\n * inputEl.addEventListener('change', event => change({ event })); // change will trigger the emit\n * inputEl.addEventListener('input', event => change({ event, complete: false }));\n * return el;\n * },\n * emit({ props, updateStyle }, { event, complete }) {\n * const { value } = event.target;\n * const valueRes = value + 'px';\n * // Pass a string value for the exact CSS property or an object containing multiple properties\n * // eg. updateStyle({ [props.property]: valueRes, color: 'red' });\n * updateStyle(valueRes, { complete });\n * },\n * update({ value, el }) {\n * el.querySelector('.my-input').value = parseInt(value, 10);\n * },\n * destroy() {\n * // In order to prevent memory leaks, use this method to clean, eventually, created instances, global event listeners, etc.\n * }\n *})\n */\n addType(id, definition) {\n properties.addType(id, definition);\n },\n\n /**\n * Get type\n * @param {string} id Type ID\n * @return {Object} Type definition\n */\n getType(id) {\n return properties.getType(id);\n },\n\n /**\n * Get all types\n * @return {Array}\n */\n getTypes() {\n return properties.getTypes();\n },\n\n /**\n * Create new property from type\n * @param {string} id Type ID\n * @param {Object} [options={}] Options\n * @param {Object} [options.model={}] Custom model object\n * @param {Object} [options.view={}] Custom view object\n * @return {PropertyView}\n * @example\n * const propView = styleManager.createType('integer', {\n * model: {units: ['px', 'rem']}\n * });\n * propView.render();\n * propView.model.on('change:value', ...);\n * someContainer.appendChild(propView.el);\n */\n createType(id, { model = {}, view = {} } = {}) {\n const type = this.getType(id);\n\n if (type) {\n return new type.view({\n model: new type.model(model),\n config: c,\n ...view\n });\n }\n },\n\n setTarget(target, opts) {\n return SectView.setTarget(target, opts);\n },\n\n getTargets() {\n const { propTarget } = SectView || {};\n return (propTarget && propTarget.targets) || [];\n },\n\n /**\n * Select different target for the Style Manager.\n * It could be a Component, CSSRule, or a string of any CSS selector\n * @param {[Component]|[CSSRule]|String} target\n * @return {Array<[Component]|[CSSRule]>} Array containing selected Components or CSSRules\n * @private\n */\n select(target, opts = {}) {\n const { em } = this;\n const trgs = isArray(target) ? target : [target];\n const { stylable } = opts;\n const cssc = em.get('CssComposer');\n let targets = [];\n\n trgs.filter(Boolean).forEach(target => {\n let model = target;\n\n if (isString(target)) {\n const rule = cssc.getRule(target) || cssc.setRule(target);\n !isUndefined(stylable) && rule.set({ stylable });\n model = rule;\n }\n\n targets.push(model);\n });\n\n targets = targets.map(t => this.getModelToStyle(t));\n const lastTarget = targets.slice().reverse()[0];\n const lastTargetParents = this.getParentRules(lastTarget);\n this.model.set({ targets, lastTarget, lastTargetParents });\n\n // Update all property values\n // if (lastTarget && em.getConfig('customUI')) {\n // const style = lastTarget.getStyle();\n // sectors.map(sector => {\n // sector.getProperties().map(prop => {\n // const value = style[prop.getName()];\n // !isUndefined(value) && prop.setValue(value);\n // })\n // })\n // }\n\n return targets;\n },\n\n getSelected() {\n return this.model.get('targets');\n },\n\n getLastSelected() {\n return this.model.get('lastTarget') || null;\n },\n\n getSelectedParents() {\n return this.model.get('lastTargetParents') || [];\n },\n\n getEmitter() {\n return SectView.propTarget;\n },\n\n /**\n * Render sectors and properties\n * @return {HTMLElement}\n * @private\n * */\n render() {\n const el = SectView && SectView.el;\n SectView = new SectorsView({\n el,\n collection: sectors,\n target: c.em,\n config: c\n });\n return SectView.render().el;\n },\n\n _logNoSector(sectorId) {\n const { em } = this;\n em && em.logWarning(`'${sectorId}' sector not found`);\n },\n\n destroy() {\n [properties, sectors].forEach(coll => {\n coll.reset();\n coll.stopListening();\n });\n SectView && SectView.remove();\n [c, properties, sectors, SectView].forEach(i => (i = {}));\n this.em = {};\n }\n };\n};\n","export default {\n // Style prefix\n stylePrefix: 'cm-',\n\n inlineCss: false\n};\n","import { bindAll } from 'underscore';\nimport Backbone from 'backbone';\nimport { hasWin } from 'utils/mixins';\n\nlet CodeMirror;\n\nif (hasWin()) {\n CodeMirror = require('codemirror/lib/codemirror');\n require('codemirror/mode/htmlmixed/htmlmixed');\n require('codemirror/mode/css/css');\n require('codemirror-formatting');\n}\n\nexport default Backbone.Model.extend({\n CodeMirror,\n\n defaults: {\n input: '',\n label: '',\n codeName: '',\n theme: 'hopscotch',\n readOnly: true,\n lineNumbers: true\n },\n\n /** @inheritdoc */\n init(el) {\n bindAll(this, 'onChange');\n this.editor = CodeMirror.fromTextArea(el, {\n dragDrop: false,\n lineWrapping: true,\n mode: this.get('codeName'),\n ...this.attributes\n });\n this.element = el;\n this.editor.on('change', this.onChange);\n\n return this;\n },\n\n onChange() {\n this.trigger('update', this);\n },\n\n getEditor() {\n return this.editor;\n },\n\n /**\n * The element where the viewer is attached\n * @return {HTMLElement}\n */\n getElement() {\n return this.element;\n },\n\n /**\n * Set the element which contains the viewer attached.\n * Generally, it should be just a textarea, but some editor might require\n * a container for it some in that case this method can be used\n * @param {HTMLElement} el\n * @return {self}\n */\n setElement(el) {\n this.element = el;\n return this;\n },\n\n /**\n * Refresh the viewer\n * @return {self}\n */\n refresh() {\n this.getEditor().refresh();\n return this;\n },\n\n /**\n * Focus the viewer\n * @return {self}\n */\n focus() {\n this.getEditor().focus();\n return this;\n },\n\n getContent() {\n const ed = this.getEditor();\n return ed && ed.getValue();\n },\n\n /** @inheritdoc */\n setContent(v, opts = {}) {\n const { editor } = this;\n if (!editor) return;\n editor.setValue(v);\n\n if (editor.autoFormatRange) {\n CodeMirror.commands.selectAll(editor);\n editor.autoFormatRange(editor.getCursor(true), editor.getCursor(false));\n CodeMirror.commands.goDocStart(editor);\n }\n\n !opts.noRefresh && setTimeout(() => this.refresh());\n }\n});\n","import { Model } from 'backbone';\n\nexport default class HTMLGenerator extends Model {\n build(model, opts = {}) {\n const models = model.components();\n const htmlOpts = {};\n const { em } = opts;\n\n // Remove unnecessary IDs\n if (opts.cleanId && em) {\n const rules = em.get('CssComposer').getAll();\n const idRules = rules\n .toJSON()\n .map(rule => {\n const sels = rule.selectors;\n const sel = sels && sels.length === 1 && sels.models[0];\n return sel && sel.isId() && sel.get('name');\n })\n .filter(i => i);\n\n htmlOpts.attributes = (mod, attrs) => {\n const { id } = attrs;\n if (\n id &&\n id[0] === 'i' && // all autogenerated IDs start with 'i'\n !mod.get('script') && // if the component has script, we have to leave the ID\n !mod.get('attributes').id && // id is not intentionally in attributes\n idRules.indexOf(id) < 0 // we shouldn't have any rule with this ID\n ) {\n delete attrs.id;\n }\n return attrs;\n };\n }\n\n if (opts.exportWrapper) {\n return model.toHTML({\n ...htmlOpts,\n ...(opts.wrapperIsBody && model.is('wrapper') && { tag: 'body' })\n });\n }\n\n return this.buildModels(models, htmlOpts);\n }\n\n buildModels(models, opts = {}) {\n let code = '';\n models.forEach(mod => (code += mod.toHTML(opts)));\n return code;\n }\n}\n","import { each } from 'underscore';\nimport Backbone from 'backbone';\n\nexport default Backbone.Model.extend({\n /** @inheritdoc */\n build(model) {\n var json = model.toJSON();\n this.beforeEach(json);\n\n each(\n json,\n function(v, attr) {\n var obj = json[attr];\n if (obj instanceof Backbone.Model) {\n json[attr] = this.build(obj);\n } else if (obj instanceof Backbone.Collection) {\n var coll = obj;\n json[attr] = [];\n if (coll.length) {\n coll.each(function(el, index) {\n json[attr][index] = this.build(el);\n }, this);\n }\n }\n },\n this\n );\n\n return json;\n },\n\n /**\n * Execute on each object\n * @param {Object} obj\n */\n beforeEach(obj) {\n delete obj.status;\n }\n});\n","import { extend } from 'underscore';\nimport Backbone from 'backbone';\n\nexport default Backbone.Model.extend({\n mapModel(model) {\n var code = '';\n var script = model.get('script-export') || model.get('script');\n var type = model.get('type');\n var comps = model.get('components');\n var id = model.getId();\n\n if (script) {\n // If the component has scripts we need to expose his ID\n var attr = model.get('attributes');\n attr = extend({}, attr, { id });\n model.set('attributes', attr, { silent: 1 });\n var scrStr = model.getScriptString(script);\n const scrProps = model.get('script-props');\n\n // If the script was updated, I'll put its code in a separate container\n if (model.get('scriptUpdated') && !scrProps) {\n this.mapJs[type + '-' + id] = { ids: [id], code: scrStr };\n } else {\n let props;\n const mapType = this.mapJs[type];\n\n if (scrProps) {\n props = model.__getScriptProps();\n }\n\n if (mapType) {\n mapType.ids.push(id);\n if (props) mapType.props[id] = props;\n } else {\n const res = { ids: [id], code: scrStr };\n if (props) res.props = { [id]: props };\n this.mapJs[type] = res;\n }\n }\n }\n\n comps.each(function(model) {\n code += this.mapModel(model);\n }, this);\n\n return code;\n },\n\n build(model) {\n this.mapJs = {};\n this.mapModel(model);\n let code = '';\n\n for (let type in this.mapJs) {\n const mapType = this.mapJs[type];\n\n if (mapType.props) {\n code += `\n var props = ${JSON.stringify(mapType.props)};\n var ids = Object.keys(props).map(function(id) { return '#'+id }).join(',');\n var els = document.querySelectorAll(ids);\n for (var i = 0, len = els.length; i < len; i++) {\n var el = els[i];\n (${mapType.code}.bind(el))(props[el.id]);\n }`;\n } else {\n // Deprecated\n const ids = '#' + mapType.ids.join(', #');\n code += `\n var items = document.querySelectorAll('${ids}');\n for (var i = 0, len = items.length; i < len; i++) {\n (function(){\\n${mapType.code}\\n}.bind(items[i]))();\n }`;\n }\n }\n\n return code;\n }\n});\n","import html from 'utils/html';\nimport { View } from 'backbone';\n\nexport default class EditorView extends View {\n template({ pfx, codeName, label }) {\n return html`\n
\n
${label}
\n
\n
\n `;\n }\n\n initialize(o) {\n this.config = o.config || {};\n this.pfx = this.config.stylePrefix;\n }\n\n render() {\n const { model, pfx, $el } = this;\n const obj = model.toJSON();\n obj.pfx = pfx;\n $el.html(this.template(obj));\n $el.attr('class', `${pfx}editor-c`);\n $el.find(`#${pfx}code`).append(model.get('input'));\n return this;\n }\n}\n","/**\n * - [addGenerator](#addgenerator)\n * - [getGenerator](#getgenerator)\n * - [getGenerators](#getgenerators)\n * - [addViewer](#addviewer)\n * - [getViewer](#getviewer)\n * - [getViewers](#getviewers)\n * - [updateViewer](#updateviewer)\n * - [getCode](#getcode)\n *\n *\n * Before using methods you should get first the module from the editor instance, in this way:\n *\n * ```js\n * var codeManager = editor.CodeManager;\n * ```\n *\n * @module CodeManager\n */\nimport { isUndefined } from 'underscore';\nimport defaults from './config/config';\nimport gHtml from './model/HtmlGenerator';\nimport gCss from './model/CssGenerator';\nimport gJson from './model/JsonGenerator';\nimport gJs from './model/JsGenerator';\nimport eCM from './model/CodeMirrorEditor';\nimport editorView from './view/EditorView';\n\nexport default () => {\n var c = {};\n var generators = {},\n defGenerators = {},\n viewers = {},\n defViewers = {};\n\n const defaultViewer = 'CodeMirror';\n\n return {\n getConfig() {\n return c;\n },\n\n config: c,\n\n EditorView: editorView,\n\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'CodeManager',\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n */\n init(config) {\n c = config || {};\n for (var name in defaults) {\n if (!(name in c)) c[name] = defaults[name];\n }\n\n var ppfx = c.pStylePrefix;\n if (ppfx) c.stylePrefix = ppfx + c.stylePrefix;\n\n defGenerators.html = new gHtml();\n defGenerators.css = new gCss();\n defGenerators.json = new gJson();\n defGenerators.js = new gJs();\n defViewers.CodeMirror = new eCM();\n this.loadDefaultGenerators().loadDefaultViewers();\n\n return this;\n },\n\n /**\n * Add new code generator to the collection\n * @param {string} id Code generator ID\n * @param {Object} generator Code generator wrapper\n * @param {Function} generator.build Function that builds the code\n * @return {this}\n * @example\n * codeManager.addGenerator('html7',{\n * build: function(model){\n * return 'myCode';\n * }\n * });\n * */\n addGenerator(id, generator) {\n generators[id] = generator;\n return this;\n },\n\n /**\n * Get code generator by id\n * @param {string} id Code generator ID\n * @return {Object|null}\n * @example\n * var generator = codeManager.getGenerator('html7');\n * generator.build = function(model){\n * //extend\n * };\n * */\n getGenerator(id) {\n return generators[id] || null;\n },\n\n /**\n * Returns all code generators\n * @return {Array}\n * */\n getGenerators() {\n return generators;\n },\n\n /**\n * Add new code viewer\n * @param {string} id Code viewer ID\n * @param {Object} viewer Code viewer wrapper\n * @param {Function} viewer.init Set element on which viewer will be displayed\n * @param {Function} viewer.setContent Set content to the viewer\n * @return {this}\n * @example\n * codeManager.addViewer('ace',{\n * init: function(el){\n * var ace = require('ace-editor');\n * this.editor = ace.edit(el.id);\n * },\n * setContent: function(code){\n * this.editor.setValue(code);\n * }\n * });\n * */\n addViewer(id, viewer) {\n viewers[id] = viewer;\n return this;\n },\n\n /**\n * Get code viewer by id\n * @param {string} id Code viewer ID\n * @return {Object|null}\n * @example\n * var viewer = codeManager.getViewer('ace');\n * */\n getViewer(id) {\n return viewers[id] || null;\n },\n\n /**\n * Returns all code viewers\n * @return {Array}\n * */\n getViewers() {\n return viewers;\n },\n\n createViewer(opts = {}) {\n const type = !isUndefined(opts.type) ? opts.type : defaultViewer;\n const viewer = this.getViewer(type) && this.getViewer(type).clone();\n const cont = document.createElement('div');\n const txtarea = document.createElement('textarea');\n cont.appendChild(txtarea);\n viewer.set(opts);\n viewer.init(txtarea);\n viewer.setElement(cont);\n\n return viewer;\n },\n\n /**\n * Update code viewer content\n * @param {Object} viewer Viewer instance\n * @param {string} code Code string\n * @example\n * var AceViewer = codeManager.getViewer('ace');\n * // ...\n * var viewer = AceViewer.init(el);\n * // ...\n * codeManager.updateViewer(AceViewer, 'code');\n * */\n updateViewer(viewer, code) {\n viewer.setContent(code);\n },\n\n /**\n * Get code from model\n * @param {Object} model Any kind of model that will be passed to the build method of generator\n * @param {string} genId Code generator id\n * @param {Object} [opt] Options\n * @return {string}\n * @example\n * var codeStr = codeManager.getCode(model, 'html');\n * */\n getCode(model, genId, opt = {}) {\n opt.em = c.em;\n var generator = this.getGenerator(genId);\n return generator ? generator.build(model, opt) : '';\n },\n\n /**\n * Load default code generators\n * @return {this}\n * @private\n * */\n loadDefaultGenerators() {\n for (var id in defGenerators) this.addGenerator(id, defGenerators[id]);\n\n return this;\n },\n\n /**\n * Load default code viewers\n * @return {this}\n * @private\n * */\n loadDefaultViewers() {\n for (var id in defViewers) this.addViewer(id, defViewers[id]);\n\n return this;\n },\n\n destroy() {\n [c, generators, defGenerators, viewers, defViewers].forEach(\n i => (i = {})\n );\n }\n };\n};\n","export default {\n // The device `id` to select on start, if not indicated, the first available from `devices` will be used.\n default: null,\n\n // Default devices\n devices: [\n {\n id: 'desktop',\n name: 'Desktop',\n width: ''\n },\n {\n id: 'tablet',\n name: 'Tablet',\n width: '768px',\n widthMedia: '992px'\n },\n {\n id: 'mobileLandscape',\n name: 'Mobile landscape',\n width: '568px',\n widthMedia: '768px'\n },\n {\n id: 'mobilePortrait',\n name: 'Mobile portrait',\n width: '320px',\n widthMedia: '480px'\n }\n ]\n};\n","import { Model } from 'backbone';\n\n/**\n * @typedef Device\n * @property {String} [name=''] Device type, eg. `Mobile`\n * @property {String} [width] Width to set for the editor iframe, eg. '900px'\n * @property {String} [height=''] Height to set for the editor iframe, eg. '600px'\n * @property {String} [widthMedia=''] The width which will be used in media queries, If empty the width will be used\n * @property {Number} [priority=null] Setup the order of media queries\n */\nexport default class Device extends Model {\n defaults() {\n return {\n name: '',\n width: null,\n height: '',\n widthMedia: null,\n priority: null\n };\n }\n\n initialize() {\n this.get('widthMedia') === null &&\n this.set('widthMedia', this.get('width'));\n this.get('width') === null && this.set('width', this.get('widthMedia'));\n !this.get('priority') &&\n this.set('priority', parseFloat(this.get('widthMedia')) || 0);\n const toCheck = ['width', 'height', 'widthMedia'];\n toCheck.forEach(prop => this.checkUnit(prop));\n }\n\n checkUnit(prop) {\n const pr = this.get(prop) || '';\n const noUnit = (parseFloat(pr) || 0).toString() === pr.toString();\n noUnit && this.set(prop, `${pr}px`);\n }\n}\n","import { Collection } from 'backbone';\nimport Device from './Device';\n\nexport default class Devices extends Collection {\n comparator(left, right) {\n const max = Number.MAX_VALUE;\n return (right.get('priority') || max) - (left.get('priority') || max);\n }\n\n getSorted() {\n return this.sort();\n }\n}\n\nDevices.prototype.model = Device;\n","import { View } from 'backbone';\nimport html from 'utils/html';\n\nexport default class DevicesView extends View {\n template({ ppfx, label }) {\n return html`\n
${label}
\n
\n \n \n \n
\n
\n
\n
\n \n `;\n }\n\n events() {\n return {\n change: 'updateDevice'\n };\n }\n\n initialize(o) {\n this.config = o.config || {};\n this.em = this.config.em;\n this.ppfx = this.config.pStylePrefix || '';\n this.events['click .' + this.ppfx + 'add-trasp'] = this.startAdd;\n this.listenTo(this.em, 'change:device', this.updateSelect);\n this.delegateEvents();\n }\n\n /**\n * Start adding new device\n * @return {[type]} [description]\n * @private\n */\n startAdd() {}\n\n /**\n * Update device of the editor\n * @private\n */\n updateDevice() {\n var em = this.em;\n if (em) {\n var devEl = this.devicesEl;\n var val = devEl ? devEl.val() : '';\n em.set('device', val);\n }\n }\n\n /**\n * Update select value on device update\n * @private\n */\n updateSelect() {\n var em = this.em;\n var devEl = this.devicesEl;\n if (em && em.getDeviceModel && devEl) {\n var device = em.getDeviceModel();\n var name = device ? device.get('id') : '';\n devEl.val(name);\n }\n }\n\n /**\n * Return devices options\n * @return {string} String of options\n * @private\n */\n getOptions() {\n const { collection, em } = this;\n let result = '';\n\n collection.each(device => {\n const { name, id } = device.attributes;\n const label = (em && em.t && em.t(`deviceManager.devices.${id}`)) || name;\n result += ``;\n });\n\n return result;\n }\n\n render() {\n const { em, ppfx, $el, el } = this;\n const label = em && em.t && em.t('deviceManager.device');\n $el.html(this.template({ ppfx, label }));\n this.devicesEl = $el.find(`.${ppfx}devices`);\n this.devicesEl.append(this.getOptions());\n this.devicesEl.val(em.get('device'));\n el.className = `${ppfx}devices-c`;\n return this;\n }\n}\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/device_manager/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * deviceManager: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const deviceManager = editor.Devices;\n * ```\n * ## Available Events\n * * `device:add` - Added new device. The [Device] is passed as an argument to the callback\n * * `device:remove` - Device removed. The [Device] is passed as an argument to the callback\n * * `device:select` - New device selected. The newly selected [Device] and the previous one, are passed as arguments to the callback\n * * `device:update` - Device updated. The updated [Device] and the object containing changes are passed as arguments to the callback\n * * `device` - Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback\n *\n * ## Methods\n * * [add](#add)\n * * [get](#get)\n * * [getDevices](#getdevices)\n * * [remove](#remove)\n * * [select](#select)\n * * [getSelected](#getselected)\n *\n * [Device]: device.html\n *\n * @module Devices\n */\nimport { isString } from 'underscore';\nimport Module from 'common/module';\nimport defaults from './config/config';\nimport Device from './model/Device';\nimport Devices from './model/Devices';\nimport DevicesView from './view/DevicesView';\n\nexport const evAll = 'device';\nexport const evPfx = `${evAll}:`;\nexport const evSelect = `${evPfx}select`;\nexport const evSelectBefore = `${evSelect}:before`;\nexport const evUpdate = `${evPfx}update`;\nexport const evAdd = `${evPfx}add`;\nexport const evAddBefore = `${evAdd}:before`;\nexport const evRemove = `${evPfx}remove`;\nexport const evRemoveBefore = `${evRemove}:before`;\nconst chnSel = 'change:device';\n\nexport default () => {\n let c = {};\n let devices;\n let view;\n\n return {\n ...Module,\n\n name: 'DeviceManager',\n\n Device,\n\n Devices,\n\n events: {\n all: evAll,\n select: evSelect,\n // selectBefore: evSelectBefore,\n update: evUpdate,\n add: evAdd,\n // addBefore: evAddBefore,\n remove: evRemove,\n removeBefore: evRemoveBefore\n },\n\n init(config = {}) {\n c = { ...defaults, ...config };\n const { em } = c;\n\n devices = new Devices();\n c.devices.forEach(dv => this.add(dv));\n this.em = em;\n this.all = devices;\n this.select(c.default || devices.at(0));\n this.__initListen();\n em.on(chnSel, this._onSelect, this);\n\n return this;\n },\n\n _onSelect(m, deviceId, opts) {\n const { em, events } = this;\n const prevId = m.previous('device');\n const newDevice = this.get(deviceId);\n const ev = events.select;\n em.trigger(ev, newDevice, this.get(prevId));\n this.__catchAllEvent(ev, newDevice, opts);\n },\n\n /**\n * Add new device\n * @param {Object} props Device properties\n * @returns {[Device]} Added device\n * @example\n * const device1 = deviceManager.add({\n * // Without an explicit ID, the `name` will be taken. In case of missing `name`, a random ID will be created.\n * id: 'tablet',\n * name: 'Tablet',\n * width: '900px', // This width will be applied on the canvas frame and for the CSS media\n * });\n * const device2 = deviceManager.add({\n * id: 'tablet2',\n * name: 'Tablet 2',\n * width: '800px', // This width will be applied on the canvas frame\n * widthMedia: '810px', // This width that will be used for the CSS media\n * height: '600px', // Height will be applied on the canvas frame\n * });\n */\n add(props, options = {}) {\n let result;\n let opts = options;\n\n // Support old API\n if (isString(props)) {\n const width = options;\n opts = arguments[2] || {};\n result = {\n ...opts,\n id: props,\n name: opts.name || props,\n width\n };\n } else {\n result = props;\n }\n\n if (!result.id) {\n result.id = result.name || this._createId();\n }\n\n return devices.add(result, opts);\n },\n\n /**\n * Return device by ID\n * @param {String} id ID of the device\n * @returns {[Device]|null}\n * @example\n * const device = deviceManager.get('Tablet');\n * console.log(JSON.stringify(device));\n * // {name: 'Tablet', width: '900px'}\n */\n get(id) {\n // Support old API\n const byName = this.getAll().filter(d => d.get('name') === id)[0];\n return byName || devices.get(id) || null;\n },\n\n /**\n * Remove device\n * @param {String|[Device]} device Device or device id\n * @returns {[Device]} Removed device\n * @example\n * const removed = deviceManager.remove('device-id');\n * // or by passing the Device\n * const device = deviceManager.get('device-id');\n * deviceManager.remove(device);\n */\n remove(device, opts = {}) {\n return this.__remove(device, opts);\n },\n\n /**\n * Return all devices\n * @returns {Array<[Device]>}\n * @example\n * const devices = deviceManager.getDevices();\n * console.log(JSON.stringify(devices));\n * // [{name: 'Desktop', width: ''}, ...]\n */\n getDevices() {\n return devices.models;\n },\n\n /**\n * Change the selected device. This will update the frame in the canvas\n * @param {String|[Device]} device Device or device id\n * @example\n * deviceManager.select('some-id');\n * // or by passing the page\n * const device = deviceManager.get('some-id');\n * deviceManager.select(device);\n */\n select(device, opts = {}) {\n const md = isString(device) ? this.get(device) : device;\n md && this.em.set('device', md.get('id'), opts);\n return this;\n },\n\n /**\n * Get the selected device\n * @returns {[Device]}\n * @example\n * const selected = deviceManager.getSelected();\n */\n getSelected() {\n return this.get(this.em.get('device'));\n },\n\n getAll() {\n return devices;\n },\n\n render() {\n view && view.remove();\n view = new DevicesView({\n collection: devices,\n config: c\n });\n return view.render().el;\n },\n\n destroy() {\n devices.stopListening();\n devices.reset();\n view && view.remove();\n [devices, view].forEach(i => (i = null));\n c = {};\n }\n };\n};\n","export default {\n // Style prefix\n stylePrefix: 'clm-',\n\n // Specify the element to use as a container, string (query) or HTMLElement\n // With the empty value, nothing will be rendered\n appendTo: '',\n\n // Default selectors\n selectors: [],\n\n // Default states\n states: [{ name: 'hover' }, { name: 'active' }, { name: 'nth-of-type(2n)' }],\n\n // Custom selector name escaping strategy, eg.\n // name => name.replace(' ', '_')\n escapeName: 0,\n\n // Custom selected name strategy (the string you see after 'Selected')\n // ({ result, state, target }) => {\n // return `${result} - ID: ${target.getId()}`\n // }\n selectedName: 0,\n\n // Icon used to add new selector\n iconAdd:\n '',\n\n // Icon used to sync styles\n iconSync:\n '',\n\n // Icon to show when the selector is enabled\n iconTagOn:\n '',\n\n // Icon to show when the selector is disabled\n iconTagOff:\n '',\n\n // Icon used to remove the selector\n iconTagRemove:\n '',\n\n /**\n * Custom render function for the Selector Manager\n * @example\n * render: ({ el, labelHead, labelStates, labelInfo, }) => {\n * // You can use the default `el` to extend/edit the current\n * // DOM element of the Selector Manager\n * const someEl = document.createElement('div');\n * // ...\n * el.appendChild(someEl);\n * // no need to return anything from the function\n *\n * // Create and return a new DOM element\n * const newEl = document.createElement('div');\n * // ...\n * return newEl;\n *\n * // Return an HTML string for a completely different layout.\n * // Use `data-*` attributes to make the module recognize some elements:\n * // `data-states` - Where to append state ``;\n })\n .join('');\n\n const statesEl = this.getStates();\n statesEl &&\n statesEl.html(`${options}`);\n this.checkStates();\n },\n\n render() {\n const { em, pfx, ppfx, config, $el, el } = this;\n const { render, iconSync, iconAdd } = config;\n const tmpOpts = {\n iconSync,\n iconAdd,\n labelHead: em.t('selectorManager.label'),\n labelInfo: em.t('selectorManager.selected'),\n ppfx,\n pfx,\n el\n };\n $el.html(this.template(tmpOpts));\n const renderRes = render && render(tmpOpts);\n renderRes && renderRes !== el && $el.empty().append(renderRes);\n this.$input = $el.find('[data-input]');\n this.$addBtn = $el.find('[data-add]');\n this.$classes = $el.find('#' + pfx + 'tags-c');\n this.$btnSyncEl = $el.find('[data-sync-style]');\n this.$input.hide();\n this.renderStates();\n this.renderClasses();\n $el.attr('class', `${this.className} ${ppfx}one-bg ${ppfx}two-color`);\n return this;\n }\n});\n","/**\n * Selectors in GrapesJS are used in CSS Composer inside Rules and in Components as classes. To illustrate this concept let's take\n * a look at this code:\n *\n * ```css\n * span > #send-btn.btn{\n * ...\n * }\n * ```\n * ```html\n * \n * \n * \n * ```\n *\n * In this scenario we get:\n * * span -> selector of type `tag`\n * * send-btn -> selector of type `id`\n * * btn -> selector of type `class`\n *\n * So, for example, being `btn` the same class entity it'll be easier to refactor and track things.\n *\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/selector_manager/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * selectorManager: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance.\n *\n * ```js\n * // Listen to events\n * editor.on('selector:add', (selector) => { ... });\n *\n * // Use the API\n * const sm = editor.Selectors;\n * sm.add(...);\n * ```\n *\n * ## Available Events\n * * `selector:add` - Selector added. The [Selector] is passed as an argument to the callback.\n * * `selector:remove` - Selector removed. The [Selector] is passed as an argument to the callback.\n * * `selector:update` - Selector updated. The [Selector] and the object containing changes are passed as arguments to the callback.\n * * `selector:state` - States changed. An object containing all the available data about the triggered event is passed as an argument to the callback.\n * * `selector` - Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback.\n *\n * ## Methods\n * * [getConfig](#getconfig)\n * * [add](#add)\n * * [get](#get)\n * * [remove](#remove)\n * * [getAll](#getall)\n * * [setState](#setstate)\n * * [getState](#getstate)\n * * [getStates](#getstates)\n * * [setStates](#setstates)\n * * [getSelected](#getselected)\n * * [addSelected](#addselected)\n * * [removeSelected](#removeselected)\n * * [getSelectedTargets](#getselectedtargets)\n * * [setComponentFirst](#setcomponentfirst)\n * * [getComponentFirst](#getcomponentfirst)\n *\n * [Selector]: selector.html\n * [State]: state.html\n * [Component]: component.html\n * [CssRule]: css_rule.html\n *\n * @module SelectorManager\n */\n\nimport { isString, debounce, isObject, isArray } from 'underscore';\nimport { isComponent, isRule } from 'utils/mixins';\nimport { Model, Collection } from 'common';\nimport Module from 'common/module';\nimport defaults from './config/config';\nimport Selector from './model/Selector';\nimport Selectors from './model/Selectors';\nimport State from './model/State';\nimport ClassTagsView from './view/ClassTagsView';\n\nconst isId = str => isString(str) && str[0] == '#';\nconst isClass = str => isString(str) && str[0] == '.';\n\nexport const evAll = 'selector';\nexport const evPfx = `${evAll}:`;\nexport const evAdd = `${evPfx}add`;\nexport const evUpdate = `${evPfx}update`;\nexport const evRemove = `${evPfx}remove`;\nexport const evRemoveBefore = `${evRemove}:before`;\nexport const evCustom = `${evPfx}custom`;\nexport const evState = `${evPfx}state`;\n\nexport default () => {\n return {\n ...Module,\n\n name: 'SelectorManager',\n\n Selector,\n\n Selectors,\n\n events: {\n all: evAll,\n update: evUpdate,\n add: evAdd,\n remove: evRemove,\n removeBefore: evRemoveBefore,\n state: evState,\n custom: evCustom\n },\n\n /**\n * Get configuration object\n * @name getConfig\n * @function\n * @return {Object}\n */\n\n init(conf = {}) {\n this.__initConfig(defaults, conf);\n const config = this.getConfig();\n const em = config.em;\n const ppfx = config.pStylePrefix;\n\n if (ppfx) {\n config.stylePrefix = ppfx + config.stylePrefix;\n }\n\n // Global selectors container\n this.all = new Selectors(config.selectors);\n this.selected = new Selectors([], { em, config });\n this.states = new Collection(config.states, { model: State });\n this.model = new Model({ cFirst: config.componentFirst, _undo: true });\n this.__initListen({\n collections: [this.states, this.selected],\n propagate: [{ entity: this.states, event: this.events.state }]\n });\n em.on('change:state', (m, value) => em.trigger('selector:state', value));\n this.model.on('change:cFirst', (m, value) =>\n em.trigger('selector:type', value)\n );\n const listenTo =\n 'component:toggled component:update:classes styleManager:update selector:state selector:type';\n this.model.listenTo(em, listenTo, () => this.__update());\n\n return this;\n },\n\n __update: debounce(function() {\n this.__trgCustom();\n }),\n\n __trgCustom(opts) {\n this.em.trigger(this.events.custom, this.__customData(opts));\n },\n\n __customData(opts = {}) {\n const { container } = opts;\n return {\n states: this.getStates(),\n selected: this.getSelected(),\n container\n };\n },\n\n // postLoad() {\n // this.__postLoad();\n // const { em, model } = this;\n // const um = em.get('UndoManager');\n // um && um.add(model);\n // um && um.add(this.pages);\n // },\n\n postRender() {\n this.__appendTo();\n this.__trgCustom();\n },\n\n select(value, opts = {}) {\n const targets = Array.isArray(value) ? value : [value];\n const toSelect = this.em.get('StyleManager').setTarget(targets, opts);\n const selTags = this.selectorTags;\n const res = toSelect\n .filter(i => i)\n .map(sel =>\n isComponent(sel)\n ? sel\n : isRule(sel) && !sel.get('selectorsAdd')\n ? sel\n : sel.getSelectorsString()\n );\n selTags && selTags.componentChanged({ targets: res });\n return this;\n },\n\n addSelector(name, opts = {}, cOpts = {}) {\n let props = { ...opts };\n\n if (isObject(name)) {\n props = name;\n } else {\n props.name = name;\n }\n\n if (isId(props.name)) {\n props.name = props.name.substr(1);\n props.type = Selector.TYPE_ID;\n } else if (isClass(props.name)) {\n props.name = props.name.substr(1);\n }\n\n if (props.label && !props.name) {\n props.name = this.escapeName(props.label);\n }\n\n const cname = props.name;\n const config = this.getConfig();\n const all = this.getAll();\n const selector = cname\n ? this.get(cname, props.type)\n : all.where(props)[0];\n\n if (!selector) {\n return all.add(props, { ...cOpts, config });\n }\n\n return selector;\n },\n\n getSelector(name, type = Selector.TYPE_CLASS) {\n if (isId(name)) {\n name = name.substr(1);\n type = Selector.TYPE_ID;\n } else if (isClass(name)) {\n name = name.substr(1);\n }\n\n return this.getAll().where({ name, type })[0];\n },\n\n /**\n * Add a new selector to the collection if it does not already exist.\n * You can pass selectors properties or string identifiers.\n * @param {Object|String} props Selector properties or string identifiers, eg. `{ name: 'my-class', label: 'My class' }`, `.my-cls`\n * @param {Object} [opts] Selector options\n * @return {[Selector]}\n * @example\n * const selector = selectorManager.add({ name: 'my-class', label: 'My class' });\n * console.log(selector.toString()) // `.my-class`\n * // Same as\n * const selector = selectorManager.add('.my-class');\n * console.log(selector.toString()) // `.my-class`\n * */\n add(props, opts = {}) {\n const cOpts = isString(props) ? {} : opts;\n // Keep support for arrays but avoid it in docs\n if (isArray(props)) {\n return props.map(item => this.addSelector(item, opts, cOpts));\n } else {\n return this.addSelector(props, opts, cOpts);\n }\n },\n\n /**\n * Add class selectors\n * @param {Array|string} classes Array or string of classes\n * @return {Array} Array of added selectors\n * @private\n * @example\n * sm.addClass('class1');\n * sm.addClass('class1 class2');\n * sm.addClass(['class1', 'class2']);\n * // -> [SelectorObject, ...]\n */\n addClass(classes) {\n const added = [];\n\n if (isString(classes)) {\n classes = classes.trim().split(' ');\n }\n\n classes.forEach(name => added.push(this.addSelector(name)));\n return added;\n },\n\n /**\n * Get the selector by its name/type\n * @param {String} name Selector name or string identifier\n * @returns {[Selector]|null}\n * @example\n * const selector = selectorManager.get('.my-class');\n * // Get Id\n * const selectorId = selectorManager.get('#my-id');\n * */\n get(name, type) {\n // Keep support for arrays but avoid it in docs\n if (isArray(name)) {\n const result = [];\n const selectors = name\n .map(item => this.getSelector(item))\n .filter(item => item);\n selectors.forEach(\n item => result.indexOf(item) < 0 && result.push(item)\n );\n return result;\n } else {\n return this.getSelector(name, type) || null;\n }\n },\n\n /**\n * Remove Selector.\n * @param {String|[Selector]} selector Selector instance or Selector string identifier\n * @returns {[Selector]} Removed Selector\n * @example\n * const removed = selectorManager.remove('.myclass');\n * // or by passing the Selector\n * selectorManager.remove(selectorManager.get('.myclass'));\n */\n remove(selector, opts) {\n return this.__remove(selector, opts);\n },\n\n /**\n * Change the selector state\n * @param {String} value State value\n * @returns {this}\n * @example\n * selectorManager.setState('hover');\n */\n setState(value) {\n this.em.setState(value);\n return this;\n },\n\n /**\n * Get the current selector state value\n * @returns {String}\n */\n getState() {\n return this.em.getState();\n },\n\n /**\n * Get states\n * @returns {Array<[State]>}\n */\n getStates() {\n return [...this.states.models];\n },\n\n /**\n * Set a new collection of states\n * @param {Array} states Array of new states\n * @returns {Array<[State]>}\n * @example\n * const states = selectorManager.setStates([\n * { name: 'hover', label: 'Hover' },\n * { name: 'nth-of-type(2n)', label: 'Even/Odd' }\n * ]);\n */\n setStates(states, opts) {\n return this.states.reset(states, opts);\n },\n\n /**\n * Get commonly selected selectors, based on all selected components.\n * @returns {Array<[Selector]>}\n * @example\n * const selected = selectorManager.getSelected();\n * console.log(selected.map(s => s.toString()))\n */\n getSelected() {\n return this.__getCommon();\n },\n\n /**\n * Add new selector to all selected components.\n * @param {Object|String} props Selector properties or string identifiers, eg. `{ name: 'my-class', label: 'My class' }`, `.my-cls`\n * @example\n * selectorManager.addSelected('.new-class');\n */\n addSelected(props) {\n const added = this.add(props);\n // TODO: target should be the one from StyleManager\n this.em.getSelectedAll().forEach(target => {\n target.getSelectors().add(added);\n });\n // TODO: update selected collection\n },\n\n /**\n * Remove a common selector from all selected components.\n * @param {String|[Selector]} selector Selector instance or Selector string identifier\n * @example\n * selectorManager.removeSelected('.myclass');\n */\n removeSelected(selector) {\n this.em.getSelectedAll().forEach(trg => {\n !selector.get('protected') &&\n trg &&\n trg.getSelectors().remove(selector);\n });\n },\n\n /**\n * Get the array of currently selected targets.\n * @returns {Array<[Component]|[CssRule]>}\n * @example\n * const targetsToStyle = selectorManager.getSelectedTargets();\n * console.log(targetsToStyle.map(target => target.getSelectorsString()))\n */\n getSelectedTargets() {\n return this.em.get('StyleManager').getSelected();\n },\n\n /**\n * Update component-first option.\n * If the component-first is enabled, all the style changes will be applied on selected components (ID rules) instead\n * of selectors (which would change styles on all components with those classes).\n * @param {Boolean} value\n */\n setComponentFirst(value) {\n this.getConfig().componentFirst = value;\n this.model.set({ cFirst: value });\n },\n\n /**\n * Get the value of component-first option.\n * @return {Boolean}\n */\n getComponentFirst() {\n return this.getConfig().componentFirst;\n },\n\n /**\n * Get all selectors\n * @name getAll\n * @function\n * @return {Collection<[Selector]>}\n * */\n\n /**\n * Return escaped selector name\n * @param {String} name Selector name to escape\n * @returns {String} Escaped name\n * @private\n */\n escapeName(name) {\n const { escapeName } = this.getConfig();\n return escapeName ? escapeName(name) : Selector.escapeName(name);\n },\n\n /**\n * Render class selectors. If an array of selectors is provided a new instance of the collection will be rendered\n * @param {Array} selectors\n * @return {HTMLElement}\n * @private\n */\n render(selectors) {\n const { em, selectorTags } = this;\n const config = this.getConfig();\n const el = selectorTags && selectorTags.el;\n this.selected.reset(selectors);\n this.selectorTags = new ClassTagsView({\n el,\n collection: this.selected,\n module: this,\n config\n });\n\n return this.selectorTags.render().el;\n },\n\n destroy() {\n const { selectorTags, model } = this;\n model.stopListening();\n this.__destroy();\n selectorTags && selectorTags.remove();\n this.selectorTags = {};\n },\n\n /**\n * Get common selectors from the current selection.\n * @return {Array}\n * @private\n */\n __getCommon() {\n return this.__getCommonSelectors(this.em.getSelectedAll());\n },\n\n __getCommonSelectors(components, opts = {}) {\n const selectors = components\n .map(cmp => cmp.getSelectors && cmp.getSelectors().getValid(opts))\n .filter(Boolean);\n return this.__common(...selectors);\n },\n\n __common(...args) {\n if (!args.length) return [];\n if (args.length === 1) return args[0];\n if (args.length === 2)\n return args[0].filter(item => args[1].indexOf(item) >= 0);\n\n return args\n .slice(1)\n .reduce((acc, item) => this.__common(acc, item), args[0]);\n }\n };\n};\n","export default {\n // Prefix identifier that will be used inside storing and loading\n id: 'gjs-',\n\n // Enable/Disable autosaving\n autosave: 1,\n\n // Indicates if load data inside editor after init\n autoload: 1,\n\n // Indicates which storage to use. Available: local | remote\n type: 'local',\n\n // If autosave enabled, indicates how many steps (general changes to structure)\n // need to be done before save. Useful with remoteStorage to reduce remote calls\n stepsBeforeSave: 1,\n\n //Enable/Disable components model (JSON format)\n storeComponents: 1,\n\n //Enable/Disable styles model (JSON format)\n storeStyles: 1,\n\n //Enable/Disable saving HTML template\n storeHtml: 1,\n\n //Enable/Disable saving CSS template\n storeCss: 1,\n\n // ONLY FOR LOCAL STORAGE\n // If enabled, checks if browser supports Local Storage\n checkLocal: 1,\n\n // ONLY FOR REMOTE STORAGE\n // Custom parameters to pass with the remote storage request, eg. csrf token\n params: {},\n\n // Custom headers for the remote storage request\n headers: {},\n\n // Endpoint where to save all stuff\n urlStore: '',\n\n // Endpoint where to fetch data\n urlLoad: '',\n\n //Callback before request\n beforeSend(jqXHR, settings) {},\n\n //Callback after request\n onComplete(jqXHR, status) {},\n\n // set contentType paramater of $.ajax\n // true: application/json; charset=utf-8'\n // false: 'x-www-form-urlencoded'\n contentTypeJson: true,\n\n credentials: 'include',\n\n // Pass custom options to fetch API (remote storage)\n // You can pass a simple object: { someOption: 'someValue' }\n // or a function wich returns and object to add:\n // currentOpts => {\n // return currentOpts.method === 'post' ? { method: 'patch' } : {};\n // }\n fetchOptions: ''\n};\n","import { Model } from 'backbone';\nimport { hasWin } from 'utils/mixins';\n\nexport default Model.extend({\n defaults: {\n checkLocal: true\n },\n\n /**\n * @private\n */\n store(data, clb = () => {}) {\n if (this.hasLocal()) {\n for (let key in data) localStorage.setItem(key, data[key]);\n }\n\n clb && clb();\n },\n\n /**\n * @private\n */\n load(keys, clb = () => {}) {\n const result = {};\n\n if (this.hasLocal()) {\n for (let i = 0, len = keys.length; i < len; i++) {\n const value = localStorage.getItem(keys[i]);\n if (value) result[keys[i]] = value;\n }\n }\n\n clb && clb(result);\n\n return result;\n },\n\n /**\n * @private\n */\n remove(keys) {\n if (!this.hasLocal()) return;\n\n for (let i = 0, len = keys.length; i < len; i++)\n localStorage.removeItem(keys[i]);\n },\n\n /**\n * Check storage environment\n * @private\n * */\n hasLocal() {\n const win = hasWin();\n\n if (this.get('checkLocal') && (!win || !localStorage)) {\n win && console.warn(\"Your browser doesn't support localStorage\");\n return false;\n }\n\n return true;\n }\n});\n","import Backbone from 'backbone';\nimport fetch from 'utils/fetch';\nimport { isUndefined, isFunction } from 'underscore';\n\nexport default Backbone.Model.extend({\n fetch,\n\n defaults: {\n urlStore: '',\n urlLoad: '',\n params: {},\n beforeSend() {},\n onComplete() {},\n contentTypeJson: false,\n credentials: 'include',\n fetchOptions: ''\n },\n\n /**\n * Triggered before the request is started\n * @private\n */\n onStart() {\n const em = this.get('em');\n const before = this.get('beforeSend');\n before && before();\n },\n\n /**\n * Triggered on request error\n * @param {Object} err Error\n * @param {Function} [clbErr] Error callback\n * @private\n */\n onError(err, clbErr) {\n if (clbErr) {\n clbErr(err);\n } else {\n const em = this.get('em');\n console.error(err);\n em && em.trigger('storage:error', err);\n }\n },\n\n /**\n * Triggered on request response\n * @param {string} text Response text\n * @private\n */\n onResponse(text, clb) {\n const em = this.get('em');\n const complete = this.get('onComplete');\n const typeJson = this.get('contentTypeJson');\n const parsable = text && typeof text === 'string';\n const res = typeJson && parsable ? JSON.parse(text) : text;\n complete && complete(res);\n clb && clb(res);\n em && em.trigger('storage:response', res);\n },\n\n store(data, clb, clbErr) {\n const body = {};\n\n for (let key in data) {\n body[key] = data[key];\n }\n\n this.request(this.get('urlStore'), { body }, clb, clbErr);\n },\n\n load(keys, clb, clbErr) {\n this.request(this.get('urlLoad'), { method: 'get' }, clb, clbErr);\n },\n\n /**\n * Execute remote request\n * @param {string} url Url\n * @param {Object} [opts={}] Options\n * @param {Function} [clb=null] Callback\n * @param {Function} [clbErr=null] Error callback\n * @private\n */\n request(url, opts = {}, clb = null, clbErr = null) {\n const typeJson = this.get('contentTypeJson');\n const headers = this.get('headers') || {};\n const params = this.get('params');\n const reqHead = 'X-Requested-With';\n const typeHead = 'Content-Type';\n const bodyObj = opts.body || {};\n let fetchOptions;\n let body;\n\n for (let param in params) {\n bodyObj[param] = params[param];\n }\n\n if (isUndefined(headers[reqHead])) {\n headers[reqHead] = 'XMLHttpRequest';\n }\n\n // With `fetch`, have to send FormData without any 'Content-Type'\n // https://stackoverflow.com/questions/39280438/fetch-missing-boundary-in-multipart-form-data-post\n\n if (isUndefined(headers[typeHead]) && typeJson) {\n headers[typeHead] = 'application/json; charset=utf-8';\n }\n\n if (typeJson) {\n body = JSON.stringify(bodyObj);\n } else {\n body = new FormData();\n\n for (let bodyKey in bodyObj) {\n body.append(bodyKey, bodyObj[bodyKey]);\n }\n }\n fetchOptions = {\n method: opts.method || 'post',\n credentials: this.get('credentials'),\n headers\n };\n\n // Body should only be included on POST method\n if (fetchOptions.method === 'post') {\n fetchOptions.body = body;\n }\n\n const fetchOpts = this.get('fetchOptions') || {};\n const addOpts = isFunction(fetchOpts)\n ? fetchOpts(fetchOptions)\n : fetchOptions;\n\n this.onStart();\n this.fetch(url, {\n ...fetchOptions,\n ...(addOpts || {})\n })\n .then(res =>\n ((res.status / 200) | 0) == 1\n ? res.text()\n : res.text().then(text => Promise.reject(text))\n )\n .then(text => this.onResponse(text, clb))\n .catch(err => this.onError(err, clbErr));\n }\n});\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/storage_manager/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * storageManager: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const storageManager = editor.StorageManager;\n * ```\n *\n * * [getConfig](#getconfig)\n * * [isAutosave](#isautosave)\n * * [setAutosave](#setautosave)\n * * [getStepsBeforeSave](#getstepsbeforesave)\n * * [setStepsBeforeSave](#setstepsbeforesave)\n * * [setStepsBeforeSave](#setstepsbeforesave)\n * * [getStorages](#getstorages)\n * * [getCurrent](#getcurrent)\n * * [getCurrentStorage](#getcurrentstorage)\n * * [setCurrent](#setcurrent)\n * * [add](#add)\n * * [get](#get)\n * * [store](#store)\n * * [load](#load)\n *\n * @module StorageManager\n */\n\nimport defaults from './config/config';\nimport LocalStorage from './model/LocalStorage';\nimport RemoteStorage from './model/RemoteStorage';\n\nconst eventStart = 'storage:start';\nconst eventAfter = 'storage:after';\nconst eventEnd = 'storage:end';\nconst eventError = 'storage:error';\n\nexport default () => {\n var c = {};\n let em;\n var storages = {};\n var defaultStorages = {};\n\n return {\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'StorageManager',\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @param {string} [config.id='gjs-'] The prefix for the fields, useful to differentiate storing/loading\n * with multiple editors on the same page. For example, in local storage, the item of HTML will be saved like 'gjs-html'\n * @param {Boolean} [config.autosave=true] Indicates if autosave mode is enabled, works in conjunction with stepsBeforeSave\n * @param {number} [config.stepsBeforeSave=1] If autosave enabled, indicates how many steps/changes are necessary\n * before autosave is triggered\n * @param {string} [config.type='local'] Default storage type. Available: 'local' | 'remote' | ''(do not store)\n * @private\n * @example\n * ...\n * {\n * autosave: false,\n * type: 'remote',\n * }\n * ...\n */\n init(config = {}) {\n c = { ...defaults, ...config };\n em = c.em;\n if (c._disable) c.type = 0;\n defaultStorages.remote = new RemoteStorage(c);\n defaultStorages.local = new LocalStorage(c);\n c.currentStorage = c.type;\n this.loadDefaultProviders().setCurrent(c.type);\n return this;\n },\n\n /**\n * Get configuration object\n * @return {Object}\n * */\n getConfig() {\n return c;\n },\n\n /**\n * Checks if autosave is enabled\n * @return {Boolean}\n * */\n isAutosave() {\n return !!c.autosave;\n },\n\n /**\n * Set autosave value\n * @param {Boolean} v\n * @return {this}\n * */\n setAutosave(v) {\n c.autosave = !!v;\n return this;\n },\n\n /**\n * Returns number of steps required before trigger autosave\n * @return {number}\n * */\n getStepsBeforeSave() {\n return c.stepsBeforeSave;\n },\n\n /**\n * Set steps required before trigger autosave\n * @param {number} v\n * @return {this}\n * */\n setStepsBeforeSave(v) {\n c.stepsBeforeSave = v;\n return this;\n },\n\n /**\n * Add new storage\n * @param {string} id Storage ID\n * @param {Object} storage Storage wrapper\n * @param {Function} storage.load Load method\n * @param {Function} storage.store Store method\n * @return {this}\n * @example\n * storageManager.add('local2', {\n * load: function(keys, clb, clbErr) {\n * var res = {};\n * for (var i = 0, len = keys.length; i < len; i++){\n * var v = localStorage.getItem(keys[i]);\n * if(v) res[keys[i]] = v;\n * }\n * clb(res); // might be called inside some async method\n * // In case of errors...\n * // clbErr('Went something wrong');\n * },\n * store: function(data, clb, clbErr) {\n * for(var key in data)\n * localStorage.setItem(key, data[key]);\n * clb(); // might be called inside some async method\n * }\n * });\n * */\n add(id, storage) {\n storages[id] = storage;\n return this;\n },\n\n /**\n * Returns storage by id\n * @param {string} id Storage ID\n * @return {Object|null}\n * */\n get(id) {\n return storages[id] || null;\n },\n\n /**\n * Returns all storages\n * @return {Array}\n * */\n getStorages() {\n return storages;\n },\n\n /**\n * Returns current storage type\n * @return {string}\n * */\n getCurrent() {\n return c.currentStorage;\n },\n\n /**\n * Set current storage type\n * @param {string} id Storage ID\n * @return {this}\n * */\n setCurrent(id) {\n c.currentStorage = id;\n return this;\n },\n\n /**\n * Store key-value resources in the current storage\n * @param {Object} data Data in key-value format, eg. {item1: value1, item2: value2}\n * @param {Function} clb Callback function\n * @return {Object|null}\n * @example\n * storageManager.store({item1: value1, item2: value2});\n * */\n store(data, clb) {\n const st = this.get(this.getCurrent());\n const toStore = {};\n this.onStart('store', data);\n\n for (let key in data) {\n toStore[c.id + key] = data[key];\n }\n\n return st\n ? st.store(\n toStore,\n res => {\n this.onAfter('store', res);\n clb && clb(res);\n this.onEnd('store', res);\n },\n err => {\n this.onError('store', err);\n }\n )\n : null;\n },\n\n /**\n * Load resource from the current storage by keys\n * @param {string|Array} keys Keys to load\n * @param {Function} clb Callback function\n * @example\n * storageManager.load(['item1', 'item2'], res => {\n * // res -> {item1: value1, item2: value2}\n * });\n * storageManager.load('item1', res => {\n * // res -> {item1: value1}\n * });\n * */\n load(keys, clb) {\n const st = this.get(this.getCurrent());\n const keysF = [];\n let result = {};\n\n if (typeof keys === 'string') keys = [keys];\n this.onStart('load', keys);\n\n for (var i = 0, len = keys.length; i < len; i++) {\n keysF.push(c.id + keys[i]);\n }\n\n if (st) {\n st.load(\n keysF,\n res => {\n result = this.__clearKeys(res);\n this.onAfter('load', result);\n clb && clb(result);\n this.onEnd('load', result);\n },\n err => {\n clb && clb(result);\n this.onError('load', err);\n }\n );\n } else {\n clb && clb(result);\n }\n },\n\n /**\n * Restore key names\n * @param {Object} data\n * @returns {Object}\n * @private\n */\n __clearKeys(data = {}) {\n const result = {};\n const reg = new RegExp('^' + c.id + '');\n\n for (let itemKey in data) {\n const itemKeyR = itemKey.replace(reg, '');\n result[itemKeyR] = data[itemKey];\n }\n\n return result;\n },\n\n /**\n * Load default storages\n * @return {this}\n * @private\n * */\n loadDefaultProviders() {\n for (var id in defaultStorages) this.add(id, defaultStorages[id]);\n return this;\n },\n\n /**\n * Get current storage\n * @return {Storage}\n * */\n getCurrentStorage() {\n return this.get(this.getCurrent());\n },\n\n /**\n * On start callback\n * @private\n */\n onStart(ctx, data) {\n if (em) {\n em.trigger(eventStart);\n ctx && em.trigger(`${eventStart}:${ctx}`, data);\n }\n },\n\n /**\n * On after callback (before passing data to the callback)\n * @private\n */\n onAfter(ctx, data) {\n if (em) {\n em.trigger(eventAfter);\n ctx && em.trigger(`${eventAfter}:${ctx}`, data);\n }\n },\n\n /**\n * On end callback\n * @private\n */\n onEnd(ctx, data) {\n if (em) {\n em.trigger(eventEnd);\n ctx && em.trigger(`${eventEnd}:${ctx}`, data);\n }\n },\n\n /**\n * On error callback\n * @private\n */\n onError(ctx, data) {\n if (em) {\n em.trigger(eventError, data);\n ctx && em.trigger(`${eventError}:${ctx}`, data);\n this.onEnd(ctx, data);\n }\n },\n\n /**\n * Check if autoload is possible\n * @return {Boolean}\n * @private\n * */\n canAutoload() {\n const storage = this.getCurrentStorage();\n return storage && this.getConfig().autoload;\n },\n\n destroy() {\n [c, em, storages, defaultStorages].forEach(i => (i = {}));\n }\n };\n};\n","export default {\n textTags: ['br', 'b', 'i', 'u', 'a', 'ul', 'ol'],\n\n // Custom CSS parser\n // @see https://grapesjs.com/docs/guides/Custom-CSS-parser.html\n parserCss: null,\n\n // Custom HTML parser\n // At the moment, the custom HTML parser should rely on DOM Node instance as the result\n // @example\n // The return should be an instance of an Node as the root to traverse\n // https://developer.mozilla.org/en-US/docs/Web/API/Node\n // parserHtml: (input, opts = {}) => (new DOMParser()).parseFromString(input, 'text/xml')\n // Here the result will be XMLDocument, which extends Node\n parserHtml: null,\n\n // DOMParser mime type (default 'text/html')\n // @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString\n // If you use the `text/html` parser, it will fix the invalid syntax automatically\n htmlType: null\n};\n","import { keys } from 'underscore';\n\n// At-rules\n// https://developer.mozilla.org/it/docs/Web/API/CSSRule#Type_constants\nconst atRules = {\n 4: 'media',\n 5: 'font-face',\n 6: 'page',\n 7: 'keyframes',\n 11: 'counter-style',\n 12: 'supports',\n 13: 'document',\n 14: 'font-feature-values',\n 15: 'viewport'\n};\nconst atRuleKeys = keys(atRules);\nconst singleAtRules = ['5', '6', '11', '15'];\nconst singleAtRulesNames = ['font-face', 'page', 'counter-style', 'viewport'];\n\n/**\n * Parse selector string to array.\n * Only classe based are valid as CSS rules inside editor, not valid\n * selectors will be dropped as additional\n * It's ok with the last part of the string as state (:hover, :active)\n * @param {string} str Selectors string\n * @return {Object}\n * @example\n * var res = parseSelector('.test1, .test1.test2, .test2 .test3');\n * console.log(res);\n * // {\n * //result: [['test1'], ['test1', 'test2']],\n * //add: ['.test2 .test3']\n * //}\n */\nexport const parseSelector = (str = '') => {\n const add = [];\n const result = [];\n const sels = str.split(',');\n\n for (var i = 0, len = sels.length; i < len; i++) {\n var sel = sels[i].trim();\n\n // Will accept only concatenated classes and last\n // class might be with state (eg. :hover), nothing else.\n // Can also accept SINGLE ID selectors, eg. `#myid`, `#myid:hover`\n // Composed are not valid: `#myid.some-class`, `#myid.some-class:hover`\n if (\n /^(\\.{1}[\\w\\-]+)+(:{1,2}[\\w\\-()]+)?$/gi.test(sel) ||\n /^(#{1}[\\w\\-]+){1}(:{1,2}[\\w\\-()]+)?$/gi.test(sel)\n ) {\n var cls = sel.split('.').filter(Boolean);\n result.push(cls);\n } else {\n add.push(sel);\n }\n }\n\n return {\n result,\n add\n };\n};\n\n/**\n * Parse style declarations of the node\n * @param {CSSRule} node\n * @return {Object}\n */\nexport const parseStyle = node => {\n const stl = node.style;\n const style = {};\n\n for (var i = 0, len = stl.length; i < len; i++) {\n const propName = stl[i];\n const propValue = stl.getPropertyValue(propName);\n const important = stl.getPropertyPriority(propName);\n style[propName] = `${propValue}${important ? ` !${important}` : ''}`;\n }\n\n return style;\n};\n\n/**\n * Get the condition when possible\n * @param {CSSRule} node\n * @return {string}\n */\nexport const parseCondition = node => {\n const condition =\n node.conditionText ||\n (node.media && node.media.mediaText) ||\n node.name ||\n node.selectorText ||\n '';\n return condition.trim();\n};\n\n/**\n * Create node for the editor\n * @param {Array} selectors Array containing strings of classes\n * @param {Object} style Key-value object of style declarations\n * @return {Object}\n */\nexport const createNode = (selectors, style = {}, opts = {}) => {\n const node = {};\n const selLen = selectors.length;\n const lastClass = selectors[selLen - 1];\n const stateArr = lastClass ? lastClass.split(/:(.+)/) : [];\n const state = stateArr[1];\n const { atRule, selectorsAdd, mediaText } = opts;\n const singleAtRule = singleAtRulesNames.indexOf(atRule) >= 0;\n singleAtRule && (node.singleAtRule = 1);\n atRule && (node.atRuleType = atRule);\n selectorsAdd && (node.selectorsAdd = selectorsAdd);\n mediaText && (node.mediaText = mediaText);\n\n // Isolate the state from selectors\n if (state) {\n selectors[selLen - 1] = stateArr[0];\n node.state = state;\n stateArr.splice(stateArr.length - 1, 1);\n }\n\n node.selectors = selectors;\n node.style = style;\n\n return node;\n};\n\n/**\n * Fetch data from node\n * @param {StyleSheet|CSSRule} el\n * @return {Array}\n */\nexport const parseNode = el => {\n var result = [];\n var nodes = el.cssRules || [];\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n const node = nodes[i];\n const type = node.type.toString();\n let singleAtRule = 0;\n let atRuleType = '';\n let condition = '';\n // keyText is for CSSKeyframeRule\n let sels = node.selectorText || node.keyText;\n const isSingleAtRule = singleAtRules.indexOf(type) >= 0;\n\n // Check if the node is an at-rule\n if (isSingleAtRule) {\n singleAtRule = 1;\n atRuleType = atRules[type];\n condition = parseCondition(node);\n } else if (atRuleKeys.indexOf(type) >= 0) {\n var subRules = parseNode(node);\n condition = parseCondition(node);\n\n for (var s = 0, lens = subRules.length; s < lens; s++) {\n var subRule = subRules[s];\n condition && (subRule.mediaText = condition);\n subRule.atRuleType = atRules[type];\n }\n result = result.concat(subRules);\n }\n\n if (!sels && !isSingleAtRule) continue;\n const style = parseStyle(node);\n const selsParsed = parseSelector(sels);\n const selsAdd = selsParsed.add;\n sels = selsParsed.result;\n\n let lastRule;\n // For each group of selectors\n for (var k = 0, len3 = sels.length; k < len3; k++) {\n const model = createNode(sels[k], style, {\n atRule: atRules[type]\n });\n result.push(model);\n lastRule = model;\n }\n\n // Need to push somewhere not class-based selectors, if some rule was\n // created will push them there, otherwise will create a new rule\n if (selsAdd.length) {\n var selsAddStr = selsAdd.join(', ');\n if (lastRule) {\n lastRule.selectorsAdd = selsAddStr;\n } else {\n const model = {\n selectors: [],\n selectorsAdd: selsAddStr,\n style\n };\n singleAtRule && (model.singleAtRule = singleAtRule);\n atRuleType && (model.atRuleType = atRuleType);\n condition && (model.mediaText = condition);\n result.push(model);\n }\n }\n }\n\n return result;\n};\n\n/**\n * Parse CSS string and return the array of objects\n * @param {String} str CSS string\n * @return {Array} Array of objects for the definition of CSSRules\n */\nexport default str => {\n const el = document.createElement('style');\n el.innerHTML = str;\n\n // There is no .sheet before adding it to the \n document.head.appendChild(el);\n const sheet = el.sheet;\n document.head.removeChild(el);\n\n return parseNode(sheet);\n};\n","import { isString } from 'underscore';\nimport BrowserCssParser, {\n parseSelector,\n createNode\n} from './BrowserParserCss';\n\nexport default (config = {}) => ({\n /**\n * Parse CSS string to a desired model object\n * @param {String} str CSS string\n * @return {Array}\n */\n parse(str) {\n let result = [];\n const { parserCss, em } = config;\n const editor = em && em.get && em.get('Editor');\n const nodes = parserCss ? parserCss(str, editor) : BrowserCssParser(str);\n nodes.forEach(node => (result = result.concat(this.checkNode(node))));\n em && em.trigger('parse:css', { input: str, output: result });\n\n return result;\n },\n\n /**\n * Check the returned node from a custom parser and transforms it to\n * a valid object for the CSS composer\n * @return {[type]}\n */\n checkNode(node) {\n const { selectors, style } = node;\n\n if (isString(selectors)) {\n const nodes = [];\n const selsParsed = parseSelector(selectors);\n const classSets = selsParsed.result;\n const selectorsAdd = selsParsed.add.join(', ');\n const opts = {\n atRule: node.atRule,\n mediaText: node.params\n };\n\n if (classSets.length) {\n classSets.forEach(classSet => {\n nodes.push(createNode(classSet, style, opts));\n });\n } else {\n nodes.push(createNode([], style, opts));\n }\n\n if (selectorsAdd) {\n const lastNode = nodes[nodes.length - 1];\n lastNode.selectorsAdd = selectorsAdd;\n }\n\n node = nodes;\n }\n\n return node;\n }\n});\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/parser/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * parser: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const { Parser } = editor;\n * ```\n * ## Available Events\n * * `parse:html` - On HTML parse, an object containing the input and the output of the parser is passed as an argument\n * * `parse:css` - On CSS parse, an object containing the input and the output of the parser is passed as an argument\n *\n * ## Methods\n * * [getConfig](#getconfig)\n * * [parseHtml](#parsehtml)\n * * [parseCss](#parsecss)\n *\n * @module Parser\n */\nimport defaults from './config/config';\nimport parserCss from './model/ParserCss';\nimport parserHtml from './model/ParserHtml';\n\nexport default () => {\n let conf = {};\n let pHtml, pCss;\n\n return {\n compTypes: '',\n\n parserCss: null,\n\n parserHtml: null,\n\n name: 'Parser',\n\n init(config = {}) {\n conf = { ...defaults, ...config };\n conf.Parser = this;\n pHtml = new parserHtml(conf);\n pCss = new parserCss(conf);\n this.em = conf.em;\n this.parserCss = pCss;\n this.parserHtml = pHtml;\n return this;\n },\n\n /**\n * Get the configuration object\n * @returns {Object} Configuration object\n * @example\n * console.log(Parser.getConfig())\n */\n getConfig() {\n return conf;\n },\n\n /**\n * Parse HTML string and return the object containing the Component Definition\n * @param {String} input HTML string to parse\n * @param {Object} [options] Options\n * @param {String} [options.htmlType] [HTML mime type](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02) to parse\n * @returns {Object} Object containing the result `{ html: ..., css: ... }`\n * @example\n * const resHtml = Parser.parseHtml(`
Hi
`, {\n * htmlType: 'text/html', // default\n * });\n * // By using the `text/html`, this will fix automatically all the HTML syntax issues\n * // Indeed the final representation, in this case, will be `
Hi
`\n * const resXml = Parser.parseHtml(`
Hi
`, {\n * htmlType: 'application/xml',\n * });\n * // This will preserve the original format as, from the XML point of view, is a valid format\n */\n parseHtml(input, options = {}) {\n const { em, compTypes } = this;\n pHtml.compTypes = em ? em.get('DomComponents').getTypes() : compTypes;\n return pHtml.parse(input, pCss, options);\n },\n\n /**\n * Parse CSS string and return an array of valid definition objects for CSSRules\n * @param {String} input CSS string to parse\n * @returns {Array} Array containing the result\n * @example\n * const res = Parser.parseCss('.cls { color: red }');\n * // [{ ... }]\n */\n parseCss(input) {\n return pCss.parse(input);\n },\n\n destroy() {\n [conf, pHtml, pCss].forEach(i => (i = {}));\n ['em', 'parserCss', 'parserHtml'].forEach(i => (this[i] = {}));\n }\n };\n};\n","export default {\n stylePrefix: 'mdl-',\n\n title: '',\n\n content: '',\n\n backdrop: true,\n\n // Avoid rendering the default modal.\n custom: false,\n\n /**\n * Extend ModalView object (view/ModalView.js)\n * @example\n * extend: {\n * template() {\n * return '
...New modal template...
';\n * },\n * },\n */\n extend: {}\n};\n","import { Model } from 'backbone';\n\nexport default class Modal extends Model {\n defaults() {\n return {\n title: '',\n content: '',\n attributes: {},\n open: false\n };\n }\n\n open() {\n this.set('open', true);\n }\n\n close() {\n this.set('open', false);\n }\n}\n","import { View } from 'backbone';\n\nexport default class ModalView extends View {\n template({ pfx, ppfx, content, title }) {\n return `
\n
\n
${title}
\n
⨯
\n
\n
\n
${content}
\n
\n
\n
\n
`;\n }\n\n events() {\n return {\n click: 'onClick',\n 'click [data-close-modal]': 'hide'\n };\n }\n\n initialize(o) {\n const model = this.model;\n const config = o.config || {};\n const pfx = config.stylePrefix || '';\n this.config = config;\n this.pfx = pfx;\n this.ppfx = config.pStylePrefix || '';\n this.listenTo(model, 'change:open', this.updateOpen);\n this.listenTo(model, 'change:title', this.updateTitle);\n this.listenTo(model, 'change:content', this.updateContent);\n }\n\n onClick(e) {\n const bkd = this.config.backdrop;\n bkd && e.target === this.el && this.hide();\n }\n\n /**\n * Returns collector element\n * @return {HTMLElement}\n * @private\n */\n getCollector() {\n if (!this.$collector)\n this.$collector = this.$el.find('.' + this.pfx + 'collector');\n return this.$collector;\n }\n\n /**\n * Returns content element\n * @return {HTMLElement}\n * @private\n */\n getContent() {\n const pfx = this.pfx;\n\n if (!this.$content) {\n this.$content = this.$el.find(`.${pfx}content #${pfx}c`);\n }\n\n return this.$content;\n }\n\n /**\n * Returns title element\n * @return {HTMLElement}\n * @private\n */\n getTitle(opts = {}) {\n if (!this.$title) this.$title = this.$el.find('.' + this.pfx + 'title');\n return opts.$ ? this.$title : this.$title.get(0);\n }\n\n /**\n * Update content\n * @private\n * */\n updateContent() {\n var content = this.getContent();\n const children = content.children();\n const coll = this.getCollector();\n const body = this.model.get('content');\n children.length && coll.append(children);\n content.empty().append(body);\n }\n\n /**\n * Update title\n * @private\n * */\n updateTitle() {\n const title = this.getTitle({ $: true });\n title && title.empty().append(this.model.get('title'));\n }\n\n /**\n * Update open\n * @private\n * */\n updateOpen() {\n this.el.style.display = this.model.get('open') ? '' : 'none';\n }\n\n /**\n * Hide modal\n * @private\n * */\n hide() {\n this.model.close();\n }\n\n /**\n * Show modal\n * @private\n * */\n show() {\n this.model.open();\n }\n\n updateAttr(attr) {\n const { pfx, $el, el } = this;\n const currAttr = [].slice.call(el.attributes).map(i => i.name);\n $el.removeAttr(currAttr.join(' '));\n $el.attr({\n ...(attr || {}),\n class: `${pfx}container ${(attr && attr.class) || ''}`.trim()\n });\n }\n\n render() {\n const el = this.$el;\n const obj = this.model.toJSON();\n obj.pfx = this.pfx;\n obj.ppfx = this.ppfx;\n el.html(this.template(obj));\n this.updateAttr();\n this.updateOpen();\n return this;\n }\n}\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/modal_dialog/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * modal: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const modal = editor.Modal;\n * ```\n *\n * ## Available Events\n * * `modal:open` - Modal is opened\n * * `modal:close` - Modal is closed\n * * `modal` - Event triggered on any change related to the modal. An object containing all the available data about the triggered event is passed as an argument to the callback.\n *\n * ## Methods\n * * [open](#open)\n * * [close](#close)\n * * [isOpen](#isopen)\n * * [setTitle](#settitle)\n * * [getTitle](#gettitle)\n * * [setContent](#setcontent)\n * * [getContent](#getcontent)\n * * [onceClose](#onceclose)\n * * [onceOpen](#onceopen)\n *\n * @module Modal\n */\n\nimport { debounce, isFunction, isString } from 'underscore';\nimport { createText } from '../utils/dom';\nimport defaults from './config/config';\nimport ModalM from './model/Modal';\nimport ModalView from './view/ModalView';\n\nexport default () => {\n var c = {};\n var model, modal;\n\n const triggerEvent = (enable, em) => {\n em && em.trigger(`modal:${enable ? 'open' : 'close'}`);\n };\n\n return {\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'Modal',\n\n getConfig() {\n return c;\n },\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @private\n */\n init(config = {}) {\n c = {\n ...defaults,\n ...config\n };\n\n const em = c.em;\n this.em = em;\n var ppfx = c.pStylePrefix;\n if (ppfx) c.stylePrefix = ppfx + c.stylePrefix;\n\n model = new ModalM(c);\n model.on('change:open', (m, enb) => triggerEvent(enb, em));\n model.on(\n 'change',\n debounce(() => {\n const data = this._evData();\n const { custom } = this.getConfig();\n isFunction(custom) && custom(data);\n em.trigger('modal', data);\n })\n );\n\n return this;\n },\n\n _evData() {\n const titl = this.getTitle();\n const cnt = this.getContent();\n const { open, attributes } = model.attributes;\n return {\n open,\n attributes,\n title: isString(titl) ? createText(titl) : titl,\n content: isString(cnt) ? createText(cnt) : cnt.get ? cnt.get(0) : cnt,\n close: () => this.close()\n };\n },\n\n postRender(view) {\n const el = view.model.getConfig().el || view.el;\n const res = this.render();\n res && res.appendTo(el);\n },\n\n /**\n * Open the modal window\n * @param {Object} [opts={}] Options\n * @param {String|HTMLElement} [opts.title] Title to set for the modal\n * @param {String|HTMLElement} [opts.content] Content to set for the modal\n * @param {Object} [opts.attributes] Updates the modal wrapper with custom attributes\n * @returns {this}\n * @example\n * modal.open({\n * title: 'My title',\n * content: 'My content',\n * attributes: { class: 'my-class' },\n * });\n */\n open(opts = {}) {\n const attr = opts.attributes || {};\n opts.title && this.setTitle(opts.title);\n opts.content && this.setContent(opts.content);\n model.set('attributes', attr);\n model.open();\n modal && modal.updateAttr(attr);\n return this;\n },\n\n /**\n * Close the modal window\n * @returns {this}\n * @example\n * modal.close();\n */\n close() {\n model.close();\n return this;\n },\n\n /**\n * Execute callback when the modal will be closed.\n * The callback will be called one only time\n * @param {Function} clb Callback to call\n * @returns {this}\n * @example\n * modal.onceClose(() => {\n * console.log('The modal is closed');\n * });\n */\n onceClose(clb) {\n this.em.once('modal:close', clb);\n return this;\n },\n\n /**\n * Execute callback when the modal will be opened.\n * The callback will be called one only time\n * @param {Function} clb Callback to call\n * @returns {this}\n * @example\n * modal.onceOpen(() => {\n * console.log('The modal is opened');\n * });\n */\n onceOpen(clb) {\n this.em.once('modal:open', clb);\n return this;\n },\n\n /**\n * Checks if the modal window is open\n * @returns {Boolean}\n * @example\n * modal.isOpen(); // true | false\n */\n isOpen() {\n return !!model.get('open');\n },\n\n /**\n * Set the title to the modal window\n * @param {string | HTMLElement} title Title\n * @returns {this}\n * @example\n * // pass a string\n * modal.setTitle('Some title');\n * // or an HTMLElement\n * const el = document.createElement('div');\n * el.innerText = 'New title';\n * modal.setTitle(el);\n */\n setTitle(title) {\n model.set('title', title);\n return this;\n },\n\n /**\n * Returns the title of the modal window\n * @returns {string | HTMLElement}\n * @example\n * modal.getTitle();\n */\n getTitle() {\n return model.get('title');\n },\n\n /**\n * Set the content of the modal window\n * @param {string | HTMLElement} content Content\n * @returns {this}\n * @example\n * // pass a string\n * modal.setContent('Some content');\n * // or an HTMLElement\n * const el = document.createElement('div');\n * el.innerText = 'New content';\n * modal.setContent(el);\n */\n setContent(content) {\n model.set('content', ' ');\n model.set('content', content);\n return this;\n },\n\n /**\n * Get the content of the modal window\n * @returns {string | HTMLElement}\n * @example\n * modal.getContent();\n */\n getContent() {\n return model.get('content');\n },\n\n /**\n * Returns content element\n * @return {HTMLElement}\n * @private\n */\n getContentEl() {\n return modal.getContent().get(0);\n },\n\n /**\n * Returns modal model\n * @return {Model}\n * @private\n */\n getModel() {\n return model;\n },\n\n /**\n * Render the modal window\n * @return {HTMLElement}\n * @private\n */\n render() {\n if (this.getConfig().custom) return;\n const View = ModalView.extend(c.extend);\n const el = modal && modal.el;\n modal = new View({\n el,\n model,\n config: c\n });\n return modal.render().$el;\n },\n\n destroy() {\n modal && modal.remove();\n [c, model, modal].forEach(i => (i = {}));\n this.em = {};\n }\n };\n};\n","export default {\n // Style prefix\n stylePrefix: 'css-',\n\n // Default CSS style\n rules: []\n};\n","import { Model } from 'backbone';\nimport Styleable from 'domain_abstract/model/Styleable';\nimport { isEmpty, forEach, isString, isArray } from 'underscore';\nimport Selectors from 'selector_manager/model/Selectors';\nimport { isEmptyObj, hasWin } from 'utils/mixins';\n\nconst { CSS } = hasWin() ? window : {};\n\n/**\n * @typedef CssRule\n * @property {Array} selectors Array of selectors\n * @property {Object} style Object containing style definitions\n * @property {String} [selectorsAdd=''] Additional string css selectors\n * @property {String} [atRuleType=''] Type of at-rule, eg. `media`, 'font-face'\n * @property {String} [mediaText=''] At-rule value, eg. `(max-width: 1000px)`\n * @property {Boolean} [singleAtRule=false] This property is used only on at-rules, like 'page' or 'font-face', where the block containes only style declarations\n * @property {String} [state=''] State of the rule, eg: `hover`, `focused`\n * @property {Boolean|Array} [important=false] If true, sets `!important` on all properties. You can also pass an array to specify properties on which use important\n * @property {Boolean} [stylable=true] Indicates if the rule is stylable from the editor\n */\nexport default class CssRule extends Model.extend(Styleable) {\n defaults() {\n return {\n selectors: [],\n selectorsAdd: '',\n style: {},\n mediaText: '',\n state: '',\n stylable: true,\n atRuleType: '',\n singleAtRule: false,\n important: false,\n group: '',\n _undo: true\n };\n }\n\n initialize(c, opt = {}) {\n this.config = c || {};\n this.opt = opt;\n this.em = opt.em;\n this.ensureSelectors();\n this.on('change', this.__onChange);\n }\n\n __onChange(m, opts) {\n const { em } = this;\n const changed = this.changedAttributes();\n !isEmptyObj(changed) && em && em.changesUp(opts);\n }\n\n clone() {\n const opts = { ...this.opt };\n const attr = { ...this.attributes };\n attr.selectors = this.get('selectors').map(s => s.clone());\n return new this.constructor(attr, opts);\n }\n\n ensureSelectors(m, c, opts) {\n const { em } = this;\n const sm = em && em.get('SelectorManager');\n const toListen = [this, 'change:selectors', this.ensureSelectors];\n let sels = this.getSelectors();\n this.stopListening(...toListen);\n\n if (sels.models) {\n sels = [...sels.models];\n }\n\n sels = isString(sels) ? [sels] : sels;\n\n if (Array.isArray(sels)) {\n const res = sels.filter(i => i).map(i => (sm ? sm.add(i) : i));\n sels = new Selectors(res);\n }\n\n this.set('selectors', sels, opts);\n this.listenTo(...toListen);\n }\n\n /**\n * Returns the at-rule statement when exists, eg. `@media (...)`, `@keyframes`\n * @returns {String}\n * @example\n * const cssRule = editor.Css.setRule('.class1', { color: 'red' }, {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)'\n * });\n * cssRule.getAtRule(); // \"@media (min-width: 500px)\"\n */\n getAtRule() {\n const type = this.get('atRuleType');\n const condition = this.get('mediaText');\n // Avoid breaks with the last condition\n const typeStr = type ? `@${type}` : condition ? '@media' : '';\n\n return typeStr + (condition && typeStr ? ` ${condition}` : '');\n }\n\n /**\n * Return selectors of the rule as a string\n * @param {Object} [opts] Options\n * @param {Boolean} [opts.skipState] Skip state from the result\n * @returns {String}\n * @example\n * const cssRule = editor.Css.setRule('.class1:hover', { color: 'red' });\n * cssRule.selectorsToString(); // \".class1:hover\"\n * cssRule.selectorsToString({ skipState: true }); // \".class1\"\n */\n selectorsToString(opts = {}) {\n const result = [];\n const state = this.get('state');\n const wrapper = this.get('wrapper');\n const addSelector = this.get('selectorsAdd');\n const isBody = wrapper && opts.body;\n const selOpts = {\n escape: str => (CSS && CSS.escape ? CSS.escape(str) : str)\n };\n const selectors = isBody\n ? 'body'\n : this.get('selectors').getFullString(0, selOpts);\n const stateStr = state && !opts.skipState ? `:${state}` : '';\n selectors && result.push(`${selectors}${stateStr}`);\n addSelector && !opts.skipAdd && result.push(addSelector);\n return result.join(', ');\n }\n\n /**\n * Get declaration block (without the at-rule statement)\n * @param {Object} [opts={}] Options (same as in `selectorsToString`)\n * @returns {String}\n * @example\n * const cssRule = editor.Css.setRule('.class1', { color: 'red' }, {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)'\n * });\n * cssRule.getDeclaration() // \".class1{color:red;}\"\n */\n getDeclaration(opts = {}) {\n let result = '';\n const selectors = this.selectorsToString(opts);\n const style = this.styleToString(opts);\n const singleAtRule = this.get('singleAtRule');\n\n if ((selectors || singleAtRule) && style) {\n result = singleAtRule ? style : `${selectors}{${style}}`;\n }\n\n return result;\n }\n\n /**\n * Return the CSS string of the rule\n * @param {Object} [opts={}] Options (same as in `getDeclaration`)\n * @return {String} CSS string\n * @example\n * const cssRule = editor.Css.setRule('.class1', { color: 'red' }, {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)'\n * });\n * cssRule.toCSS() // \"@media (min-width: 500px){.class1{color:red;}}\"\n */\n toCSS(opts = {}) {\n let result = '';\n const atRule = this.getAtRule();\n const block = this.getDeclaration(opts);\n block && (result = block);\n\n if (atRule && result) {\n result = `${atRule}{${result}}`;\n }\n\n return result;\n }\n\n toJSON(...args) {\n const obj = Model.prototype.toJSON.apply(this, args);\n\n if (this.em.getConfig('avoidDefaults')) {\n const defaults = this.defaults();\n\n forEach(defaults, (value, key) => {\n if (obj[key] === value) {\n delete obj[key];\n }\n });\n\n if (isEmpty(obj.selectors)) delete obj.selectors;\n if (isEmpty(obj.style)) delete obj.style;\n }\n\n return obj;\n }\n\n /**\n * Compare the actual model with parameters\n * @param {Object} selectors Collection of selectors\n * @param {String} state Css rule state\n * @param {String} width For which device this style is oriented\n * @param {Object} ruleProps Other rule props\n * @returns {Boolean}\n * @private\n */\n compare(selectors, state, width, ruleProps = {}) {\n const st = state || '';\n const wd = width || '';\n const selAdd = ruleProps.selectorsAdd || '';\n let atRule = ruleProps.atRuleType || '';\n const sel =\n !isArray(selectors) && !selectors.models\n ? [selectors]\n : selectors.models || selectors;\n\n // Fix atRuleType in case is not specified with width\n if (wd && !atRule) atRule = 'media';\n\n const a1 = sel.map(model => model.getFullName());\n const a2 = this.get('selectors').map(model => model.getFullName());\n\n // Check selectors\n const a1S = a1.slice().sort();\n const a2S = a2.slice().sort();\n if (a1.length !== a2.length || !a1S.every((v, i) => v === a2S[i])) {\n return false;\n }\n\n // Check other properties\n if (\n this.get('state') !== st ||\n this.get('mediaText') !== wd ||\n this.get('selectorsAdd') !== selAdd ||\n this.get('atRuleType') !== atRule\n ) {\n return false;\n }\n\n return true;\n }\n}\n","import Backbone from 'backbone';\nimport CssRule from './CssRule';\n\nconst { Collection } = Backbone;\n\nexport default Collection.extend({\n model: CssRule,\n\n initialize(models, opt) {\n // Inject editor\n if (opt && opt.em) this.editor = opt.em;\n\n // This will put the listener post CssComposer.postLoad\n setTimeout(() => {\n this.on('remove', this.onRemove);\n this.on('add', this.onAdd);\n });\n },\n\n toJSON(opts) {\n const result = Collection.prototype.toJSON.call(this, opts);\n return result.filter(i => i.style);\n },\n\n onAdd(model, c, o) {\n model.ensureSelectors(model, c, o); // required for undo\n },\n\n onRemove(removed) {\n const em = this.editor;\n em.stopListening(removed);\n em.get('UndoManager').remove(removed);\n },\n\n add(models, opt = {}) {\n if (typeof models === 'string') {\n models = this.editor.get('Parser').parseCss(models);\n }\n opt.em = this.editor;\n return Collection.prototype.add.apply(this, [models, opt]);\n }\n});\n","/**\n * This module manages CSS rules in the canvas.\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/css_composer/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * cssComposer: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const css = editor.Css;\n * ```\n *\n * * [addRules](#addrules)\n * * [setRule](#setrule)\n * * [getRule](#getrule)\n * * [getRules](#getrules)\n * * [remove](#remove)\n * * [clear](#clear)\n *\n * [CssRule]: css_rule.html\n *\n * @module CssComposer\n */\n\nimport { isArray, isString, isUndefined, each } from 'underscore';\nimport { isObject } from 'utils/mixins';\nimport defaults from './config/config';\nimport CssRule from './model/CssRule';\nimport CssRules from './model/CssRules';\nimport CssRulesView from './view/CssRulesView';\nimport Selectors from 'selector_manager/model/Selectors';\nimport Selector from 'selector_manager/model/Selector';\n\nexport default () => {\n let em;\n var c = {};\n var rules, rulesView;\n\n return {\n Selectors,\n\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'CssComposer',\n\n getConfig() {\n return c;\n },\n\n /**\n * Mandatory for the storage manager\n * @type {String}\n * @private\n */\n storageKey() {\n var keys = [];\n var smc = (c.stm && c.stm.getConfig()) || {};\n if (smc.storeCss) keys.push('css');\n if (smc.storeStyles) keys.push('styles');\n return keys;\n },\n\n /**\n * Initializes module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @private\n */\n init(config) {\n c = config || {};\n for (var name in defaults) {\n if (!(name in c)) c[name] = defaults[name];\n }\n\n var ppfx = c.pStylePrefix;\n if (ppfx) c.stylePrefix = ppfx + c.stylePrefix;\n\n var elStyle = (c.em && c.em.config.style) || '';\n c.rules = elStyle || c.rules;\n\n em = c.em;\n rules = new CssRules([], c);\n return this;\n },\n\n /**\n * On load callback\n * @private\n */\n onLoad() {\n rules.add(c.rules, { silent: 1 });\n },\n\n /**\n * Do stuff after load\n * @param {Editor} em\n * @private\n */\n postLoad() {\n const um = em && em.get('UndoManager');\n um && um.add(this.getAll());\n },\n\n /**\n * Load data from the passed object, if the object is empty will try to fetch them\n * autonomously from the storage manager.\n * The fetched data will be added to the collection\n * @param {Object} data Object of data to load\n * @return {Object} Loaded rules\n * @private\n */\n load(data) {\n var d = data || '';\n\n if (!d && c.stm) {\n d = c.em.getCacheLoad();\n }\n\n var obj = d.styles || '';\n\n if (d.styles) {\n try {\n obj = JSON.parse(d.styles);\n } catch (err) {}\n } else if (d.css) {\n obj = c.em.get('Parser').parseCss(d.css);\n }\n\n if (isArray(obj)) {\n obj.length && rules.reset(obj);\n } else if (obj) {\n rules.reset(obj);\n }\n\n return obj;\n },\n\n /**\n * Store data to the selected storage\n * @param {Boolean} noStore If true, won't store\n * @return {Object} Data to store\n * @private\n */\n store(noStore) {\n if (!c.stm) return;\n const obj = {};\n const keys = this.storageKey();\n const hasPages = em && em.get('hasPages');\n if (keys.indexOf('css') >= 0 && !hasPages) obj.css = c.em.getCss();\n if (keys.indexOf('styles') >= 0) obj.styles = JSON.stringify(rules);\n if (!noStore) c.stm.store(obj);\n return obj;\n },\n\n /**\n * Add new rule to the collection, if not yet exists with the same selectors\n * @param {Array} selectors Array of selectors\n * @param {String} state Css rule state\n * @param {String} width For which device this style is oriented\n * @param {Object} props Other props for the rule\n * @param {Object} opts Options for the add of new rule\n * @return {Model}\n * @private\n * @example\n * var sm = editor.SelectorManager;\n * var sel1 = sm.add('myClass1');\n * var sel2 = sm.add('myClass2');\n * var rule = cssComposer.add([sel1, sel2], 'hover');\n * rule.set('style', {\n * width: '100px',\n * color: '#fff',\n * });\n * */\n add(selectors, state, width, opts = {}, addOpts = {}) {\n var s = state || '';\n var w = width || '';\n var opt = { ...opts };\n var rule = this.get(selectors, s, w, opt);\n\n // do not create rules that were found before\n // unless this is a single at-rule, for which multiple declarations\n // make sense (e.g. multiple `@font-type`s)\n if (rule && rule.config && !rule.config.singleAtRule) {\n return rule;\n } else {\n opt.state = s;\n opt.mediaText = w;\n opt.selectors = [];\n w && (opt.atRuleType = 'media');\n rule = new CssRule(opt, c);\n rule.get('selectors').add(selectors, addOpts);\n rules.add(rule, addOpts);\n return rule;\n }\n },\n\n /**\n * Get the rule\n * @param {String|Array} selectors Array of selectors or selector string, eg `.myClass1.myClass2`\n * @param {String} state Css rule state, eg. 'hover'\n * @param {String} width Media rule value, eg. '(max-width: 992px)'\n * @param {Object} ruleProps Other rule props\n * @return {Model|null}\n * @private\n * @example\n * const sm = editor.SelectorManager;\n * const sel1 = sm.add('myClass1');\n * const sel2 = sm.add('myClass2');\n * const rule = cssComposer.get([sel1, sel2], 'hover', '(max-width: 992px)');\n * // Update the style\n * rule.set('style', {\n * width: '300px',\n * color: '#000',\n * });\n * */\n get(selectors, state, width, ruleProps) {\n let slc = selectors;\n if (isString(selectors)) {\n const sm = em.get('SelectorManager');\n const singleSel = selectors.split(',')[0].trim();\n const node = em\n .get('Parser')\n .parserCss.checkNode({ selectors: singleSel })[0];\n slc = sm.get(node.selectors);\n }\n return (\n rules.find(rule => rule.compare(slc, state, width, ruleProps)) || null\n );\n },\n\n getAll() {\n return rules;\n },\n\n /**\n * Add a raw collection of rule objects\n * This method overrides styles, in case, of already defined rule\n * @param {String|Array} data CSS string or an array of rule objects, eg. [{selectors: ['class1'], style: {....}}, ..]\n * @param {Object} opts Options\n * @param {Object} props Additional properties to add on rules\n * @return {Array}\n * @private\n */\n addCollection(data, opts = {}, props = {}) {\n const result = [];\n\n if (isString(data)) {\n data = em.get('Parser').parseCss(data);\n }\n\n const d = data instanceof Array ? data : [data];\n\n for (var i = 0, l = d.length; i < l; i++) {\n var rule = d[i] || {};\n if (!rule.selectors) continue;\n var sm = c.em && c.em.get('SelectorManager');\n if (!sm) console.warn('Selector Manager not found');\n var sl = rule.selectors;\n var sels = sl instanceof Array ? sl : [sl];\n var newSels = [];\n\n for (var j = 0, le = sels.length; j < le; j++) {\n var selec = sm.add(sels[j]);\n newSels.push(selec);\n }\n\n var modelExists = this.get(newSels, rule.state, rule.mediaText, rule);\n var model = this.add(newSels, rule.state, rule.mediaText, rule, opts);\n var updateStyle = !modelExists || !opts.avoidUpdateStyle;\n const style = rule.style || {};\n\n isObject(props) && model.set(props, opts);\n\n if (updateStyle) {\n let styleUpdate = opts.extend\n ? { ...model.get('style'), ...style }\n : style;\n model.set('style', styleUpdate, opts);\n }\n\n result.push(model);\n }\n\n return result;\n },\n\n /**\n * Add CssRules via CSS string.\n * @param {String} css CSS string of rules to add.\n * @returns {Array<[CssRule]>} Array of rules\n * @example\n * const addedRules = css.addRules('.my-cls{ color: red } @media (max-width: 992px) { .my-cls{ color: darkred } }');\n * // Check rules\n * console.log(addedRules.map(rule => rule.toCSS()));\n */\n addRules(css) {\n return this.addCollection(css);\n },\n\n /**\n * Add/update the CssRule.\n * @param {String} selectors Selector string, eg. `.myclass`\n * @param {Object} style Style properties and values\n * @param {Object} [opts={}] Additional properties\n * @param {String} [opts.atRuleType=''] At-rule type, eg. `media`\n * @param {String} [opts.atRuleParams=''] At-rule parameters, eg. `(min-width: 500px)`\n * @returns {[CssRule]} The new/updated CssRule\n * @example\n * // Simple class-based rule\n * const rule = css.setRule('.class1.class2', { color: 'red' });\n * console.log(rule.toCSS()) // output: .class1.class2 { color: red }\n * // With state and other mixed selector\n * const rule = css.setRule('.class1.class2:hover, div#myid', { color: 'red' });\n * // output: .class1.class2:hover, div#myid { color: red }\n * // With media\n * const rule = css.setRule('.class1:hover', { color: 'red' }, {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)',\n * });\n * // output: @media (min-width: 500px) { .class1:hover { color: red } }\n */\n setRule(selectors, style, opts = {}) {\n const { atRuleType, atRuleParams } = opts;\n const node = em.get('Parser').parserCss.checkNode({\n selectors,\n style\n })[0];\n const { state, selectorsAdd } = node;\n const sm = em.get('SelectorManager');\n const selector = sm.add(node.selectors);\n const rule = this.add(selector, state, atRuleParams, {\n selectorsAdd,\n atRule: atRuleType\n });\n rule.setStyle(style, opts);\n return rule;\n },\n\n /**\n * Get the CssRule.\n * @param {String} selectors Selector string, eg. `.myclass:hover`\n * @param {Object} [opts={}] Additional properties\n * @param {String} [opts.atRuleType=''] At-rule type, eg. `media`\n * @param {String} [opts.atRuleParams=''] At-rule parameters, eg. '(min-width: 500px)'\n * @returns {[CssRule]}\n * @example\n * const rule = css.getRule('.myclass1:hover');\n * const rule2 = css.getRule('.myclass1:hover, div#myid');\n * const rule3 = css.getRule('.myclass1', {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)',\n * });\n */\n getRule(selectors, opts = {}) {\n const sm = em.get('SelectorManager');\n const node = em.get('Parser').parserCss.checkNode({ selectors })[0];\n const selector = sm.get(node.selectors);\n const { state, selectorsAdd } = node;\n const { atRuleType, atRuleParams } = opts;\n return (\n selector &&\n this.get(selector, state, atRuleParams, {\n selectorsAdd,\n atRule: atRuleType\n })\n );\n },\n\n /**\n * Get all rules or filtered by a matching selector.\n * @param {String} [selector=''] Selector, eg. `.myclass`\n * @returns {Array<[CssRule]>}\n * @example\n * // Take all the component specific rules\n * const id = someComponent.getId();\n * const rules = css.getRules(`#${id}`);\n * console.log(rules.map(rule => rule.toCSS()))\n * // All rules in the project\n * console.log(css.getRules())\n */\n getRules(selector) {\n const rules = this.getAll();\n if (!selector) return [...rules.models];\n const result = rules.filter(\n r => r.getSelectors().getFullString() === selector\n );\n return result;\n },\n\n /**\n * Add/update the CSS rule with id selector\n * @param {string} name Id selector name, eg. 'my-id'\n * @param {Object} style Style properties and values\n * @param {Object} [opts={}] Custom options, like `state` and `mediaText`\n * @return {CssRule} The new/updated rule\n * @private\n * @example\n * const rule = css.setIdRule('myid', { color: 'red' });\n * const ruleHover = css.setIdRule('myid', { color: 'blue' }, { state: 'hover' });\n * // This will add current CSS:\n * // #myid { color: red }\n * // #myid:hover { color: blue }\n */\n setIdRule(name, style = {}, opts = {}) {\n const { addOpts = {}, mediaText } = opts;\n const state = opts.state || '';\n const media = !isUndefined(mediaText) ? mediaText : em.getCurrentMedia();\n const sm = em.get('SelectorManager');\n const selector = sm.add({ name, type: Selector.TYPE_ID }, addOpts);\n const rule = this.add(selector, state, media, {}, addOpts);\n rule.setStyle(style, { ...opts, ...addOpts });\n return rule;\n },\n\n /**\n * Get the CSS rule by id selector\n * @param {string} name Id selector name, eg. 'my-id'\n * @param {Object} [opts={}] Custom options, like `state` and `mediaText`\n * @return {CssRule}\n * @private\n * @example\n * const rule = css.getIdRule('myid');\n * const ruleHover = css.setIdRule('myid', { state: 'hover' });\n */\n getIdRule(name, opts = {}) {\n const { mediaText } = opts;\n const state = opts.state || '';\n const media = !isUndefined(mediaText) ? mediaText : em.getCurrentMedia();\n const selector = em.get('SelectorManager').get(name, Selector.TYPE_ID);\n return selector && this.get(selector, state, media);\n },\n\n /**\n * Add/update the CSS rule with class selector\n * @param {string} name Class selector name, eg. 'my-class'\n * @param {Object} style Style properties and values\n * @param {Object} [opts={}] Custom options, like `state` and `mediaText`\n * @return {CssRule} The new/updated rule\n * @private\n * @example\n * const rule = css.setClassRule('myclass', { color: 'red' });\n * const ruleHover = css.setClassRule('myclass', { color: 'blue' }, { state: 'hover' });\n * // This will add current CSS:\n * // .myclass { color: red }\n * // .myclass:hover { color: blue }\n */\n setClassRule(name, style = {}, opts = {}) {\n const state = opts.state || '';\n const media = opts.mediaText || em.getCurrentMedia();\n const sm = em.get('SelectorManager');\n const selector = sm.add({ name, type: Selector.TYPE_CLASS });\n const rule = this.add(selector, state, media);\n rule.setStyle(style, opts);\n return rule;\n },\n\n /**\n * Get the CSS rule by class selector\n * @param {string} name Class selector name, eg. 'my-class'\n * @param {Object} [opts={}] Custom options, like `state` and `mediaText`\n * @return {CssRule}\n * @private\n * @example\n * const rule = css.getClassRule('myclass');\n * const ruleHover = css.getClassRule('myclass', { state: 'hover' });\n */\n getClassRule(name, opts = {}) {\n const state = opts.state || '';\n const media = opts.mediaText || em.getCurrentMedia();\n const selector = em.get('SelectorManager').get(name, Selector.TYPE_CLASS);\n return selector && this.get(selector, state, media);\n },\n\n /**\n * Remove rule, by CssRule or matching selector (eg. the selector will match also at-rules like `@media`)\n * @param {String|[CssRule]|Array<[CssRule]>} rule CssRule or matching selector.\n * @return {Array<[CssRule]>} Removed rules\n * @example\n * // Remove by CssRule\n * const toRemove = css.getRules('.my-cls');\n * css.remove(toRemove);\n * // Remove by selector\n * css.remove('.my-cls-2');\n */\n remove(rule) {\n const toRemove = isString(rule) ? this.getRules(rule) : rule;\n const result = this.getAll().remove(toRemove);\n return isArray(result) ? result : [result];\n },\n\n /**\n * Remove all rules\n * @return {this}\n */\n clear(opts = {}) {\n this.getAll().reset(null, opts);\n return this;\n },\n\n getComponentRules(cmp, opts = {}) {\n let { state, mediaText, current } = opts;\n if (current) {\n state = em.get('state') || '';\n mediaText = em.getCurrentMedia();\n }\n const id = cmp.getId();\n const rules = this.getAll().filter(r => {\n if (!isUndefined(state) && r.get('state') !== state) return;\n if (!isUndefined(mediaText) && r.get('mediaText') !== mediaText) return;\n return r.getSelectorsString() === `#${id}`;\n });\n return rules;\n },\n\n /**\n * Render the block of CSS rules\n * @return {HTMLElement}\n * @private\n */\n render() {\n rulesView && rulesView.remove();\n rulesView = new CssRulesView({\n collection: rules,\n config: c\n });\n return rulesView.render().el;\n },\n\n destroy() {\n rules.reset();\n rules.stopListening();\n rulesView && rulesView.remove();\n [em, rules, rulesView].forEach(i => (i = null));\n c = {};\n }\n };\n};\n","import Backbone from 'backbone';\nimport {\n isString,\n isFunction,\n isArray,\n result,\n each,\n bindAll\n} from 'underscore';\nimport {\n on,\n off,\n matches,\n getElement,\n getPointerEvent,\n isTextNode,\n getModel\n} from 'utils/mixins';\nconst $ = Backbone.$;\n\nexport default Backbone.View.extend({\n initialize(opt) {\n this.opt = opt || {};\n bindAll(\n this,\n 'startSort',\n 'onMove',\n 'endMove',\n 'rollback',\n 'updateOffset',\n 'moveDragHelper'\n );\n var o = opt || {};\n this.elT = 0;\n this.elL = 0;\n this.borderOffset = o.borderOffset || 10;\n\n var el = o.container;\n this.el = typeof el === 'string' ? document.querySelector(el) : el;\n this.$el = $(this.el);\n\n this.containerSel = o.containerSel || 'div';\n this.itemSel = o.itemSel || 'div';\n this.draggable = o.draggable || true;\n this.nested = o.nested || 0;\n this.pfx = o.pfx || '';\n this.ppfx = o.ppfx || '';\n this.freezeClass = o.freezeClass || this.pfx + 'freezed';\n this.onStart = o.onStart || '';\n this.onEndMove = o.onEndMove || '';\n this.customTarget = o.customTarget;\n this.onEnd = o.onEnd;\n this.direction = o.direction || 'v'; // v (vertical), h (horizontal), a (auto)\n this.onMoveClb = o.onMove || '';\n this.relative = o.relative || 0;\n this.ignoreViewChildren = o.ignoreViewChildren || 0;\n this.ignoreModels = o.ignoreModels || 0;\n this.plh = o.placer || '';\n // Frame offset\n this.wmargin = o.wmargin || 0;\n this.offTop = o.offsetTop || 0;\n this.offLeft = o.offsetLeft || 0;\n this.document = o.document || document;\n this.$document = $(this.document);\n this.dropContent = null;\n this.em = o.em || '';\n this.dragHelper = null;\n this.canvasRelative = o.canvasRelative || 0;\n this.selectOnEnd = !o.avoidSelectOnEnd;\n this.scale = o.scale;\n this.activeTextModel = null;\n\n if (this.em && this.em.on) {\n this.em.on('change:canvasOffset', this.updateOffset);\n this.updateOffset();\n }\n },\n\n getScale() {\n return result(this, scale) || 1;\n },\n\n getContainerEl(elem) {\n if (elem) this.el = elem;\n\n if (!this.el) {\n var el = this.opt.container;\n this.el = typeof el === 'string' ? document.querySelector(el) : el;\n this.$el = $(this.el);\n }\n return this.el;\n },\n\n getDocuments(el) {\n const em = this.em;\n const elDoc = el\n ? el.ownerDocument\n : em && em.get('Canvas').getBody().ownerDocument;\n const docs = [document];\n elDoc && docs.push(elDoc);\n return docs;\n },\n\n /**\n * Triggered when the offset of the editro is changed\n */\n updateOffset() {\n const offset = this.em.get('canvasOffset') || {};\n this.offTop = offset.top;\n this.offLeft = offset.left;\n },\n\n /**\n * Set content to drop\n * @param {String|Object} content\n */\n setDropContent(content) {\n this.dropModel = null;\n this.dropContent = content;\n },\n\n updateTextViewCursorPosition(e) {\n const Canvas = this.em.get('Canvas');\n const targetDoc = Canvas.getDocument();\n let range = null;\n\n if (targetDoc.caretRangeFromPoint) {\n // Chrome\n const poiner = getPointerEvent(e);\n range = targetDoc.caretRangeFromPoint(poiner.clientX, poiner.clientY);\n } else if (e.rangeParent) {\n // Firefox\n range = targetDoc.createRange();\n range.setStart(e.rangeParent, e.rangeOffset);\n }\n\n const sel = Canvas.getWindow().getSelection();\n Canvas.getFrameEl().focus();\n sel.removeAllRanges();\n range && sel.addRange(range);\n },\n\n setContentEditable(model, mode) {\n if (model) {\n const el = model.getEl();\n if (el.contentEditable != mode) el.contentEditable = mode;\n }\n },\n\n /**\n * Toggle cursor while sorting\n * @param {Boolean} active\n */\n toggleSortCursor(active) {\n const { em } = this;\n const cv = em && em.get('Canvas');\n\n // Avoid updating body className as it causes a huge repaint\n // Noticeable with \"fast\" drag of blocks\n cv && (active ? cv.startAutoscroll() : cv.stopAutoscroll());\n },\n\n /**\n * Set drag helper\n * @param {HTMLElement} el\n * @param {Event} event\n */\n setDragHelper(el, event) {\n const ev = event || '';\n const clonedEl = el.cloneNode(1);\n const rect = el.getBoundingClientRect();\n const computed = getComputedStyle(el);\n let style = '';\n\n for (var i = 0; i < computed.length; i++) {\n const prop = computed[i];\n style += `${prop}:${computed.getPropertyValue(prop)};`;\n }\n\n document.body.appendChild(clonedEl);\n clonedEl.className += ` ${this.pfx}bdrag`;\n clonedEl.setAttribute('style', style);\n this.dragHelper = clonedEl;\n clonedEl.style.width = `${rect.width}px`;\n clonedEl.style.height = `${rect.height}px`;\n ev && this.moveDragHelper(ev);\n\n // Listen mouse move events\n if (this.em) {\n $(this.em.get('Canvas').getBody().ownerDocument)\n .off('mousemove', this.moveDragHelper)\n .on('mousemove', this.moveDragHelper);\n }\n $(document)\n .off('mousemove', this.moveDragHelper)\n .on('mousemove', this.moveDragHelper);\n },\n\n /**\n * Update the position of the helper\n * @param {Event} e\n */\n moveDragHelper(e) {\n const doc = e.target.ownerDocument;\n\n if (!this.dragHelper || !doc) {\n return;\n }\n\n let posY = e.pageY;\n let posX = e.pageX;\n let addTop = 0;\n let addLeft = 0;\n const window = doc.defaultView || doc.parentWindow;\n const frame = window.frameElement;\n const dragHelperStyle = this.dragHelper.style;\n\n // If frame is present that means mouse has moved over the editor's canvas,\n // which is rendered inside the iframe and the mouse move event comes from\n // the iframe, not the parent window. Mouse position relative to the frame's\n // parent window needs to account for the frame's position relative to the\n // parent window.\n if (frame) {\n const frameRect = frame.getBoundingClientRect();\n addTop = frameRect.top + document.documentElement.scrollTop;\n addLeft = frameRect.left + document.documentElement.scrollLeft;\n posY = e.clientY;\n posX = e.clientX;\n }\n\n dragHelperStyle.top = posY + addTop + 'px';\n dragHelperStyle.left = posX + addLeft + 'px';\n },\n\n /**\n * Returns true if the element matches with selector\n * @param {Element} el\n * @param {String} selector\n * @return {Boolean}\n */\n matches(el, selector, useBody) {\n return matches.call(el, selector);\n },\n\n /**\n * Closest parent\n * @param {Element} el\n * @param {String} selector\n * @return {Element|null}\n */\n closest(el, selector) {\n if (!el) return;\n var elem = el.parentNode;\n while (elem && elem.nodeType === 1) {\n if (this.matches(elem, selector)) return elem;\n elem = elem.parentNode;\n }\n return null;\n },\n\n /**\n * Get the offset of the element\n * @param {HTMLElement} el\n * @return {Object}\n */\n offset(el) {\n var rect = el.getBoundingClientRect();\n return {\n top: rect.top + document.body.scrollTop,\n left: rect.left + document.body.scrollLeft\n };\n },\n\n /**\n * Create placeholder\n * @return {HTMLElement}\n */\n createPlaceholder() {\n var pfx = this.pfx;\n var el = document.createElement('div');\n var ins = document.createElement('div');\n el.className = pfx + 'placeholder';\n el.style.display = 'none';\n el.style['pointer-events'] = 'none';\n ins.className = pfx + 'placeholder-int';\n el.appendChild(ins);\n return el;\n },\n\n /**\n * Picking component to move\n * @param {HTMLElement} src\n * */\n startSort(src, opts = {}) {\n const em = this.em;\n const itemSel = this.itemSel;\n const contSel = this.containerSel;\n const container = this.getContainerEl(opts.container);\n const docs = this.getDocuments(src);\n const onStart = this.onStart;\n let srcModel;\n let plh = this.plh;\n this.dropModel = null;\n this.target = null;\n this.prevTarget = null;\n this.moved = 0;\n\n // Check if the start element is a valid one, if not get the\n // closest valid one\n if (src && !this.matches(src, `${itemSel}, ${contSel}`)) {\n src = this.closest(src, itemSel);\n }\n\n this.eV = src;\n\n // Create placeholder if not yet exists\n if (!plh) {\n plh = this.createPlaceholder();\n container.appendChild(plh);\n this.plh = plh;\n }\n\n if (src) {\n srcModel = this.getSourceModel(src);\n srcModel && srcModel.set && srcModel.set('status', 'freezed');\n this.srcModel = srcModel;\n }\n\n on(container, 'mousemove dragover', this.onMove);\n on(docs, 'mouseup dragend touchend', this.endMove);\n on(docs, 'keydown', this.rollback);\n onStart &&\n onStart({\n sorter: this,\n target: srcModel,\n parent: srcModel && srcModel.parent(),\n index: srcModel && srcModel.index()\n });\n\n // Avoid strange effects on dragging\n em && em.clearSelection();\n this.toggleSortCursor(1);\n\n em && em.trigger('sorter:drag:start', src, srcModel);\n },\n\n /**\n * Get the model from HTMLElement target\n * @return {Model|null}\n */\n getTargetModel(el) {\n let elem = el || this.target;\n return $(elem).data('model');\n },\n\n /**\n * Get the model of the current source element (element to drag)\n * @return {Model}\n */\n getSourceModel(source, { target, avoidChildren = 1 } = {}) {\n const { em, eV } = this;\n const src = source || eV;\n let { dropModel, dropContent } = this;\n const isTextable = src =>\n src &&\n target &&\n src.opt &&\n src.opt.avoidChildren &&\n this.isTextableActive(src, target);\n\n if (dropContent && em) {\n if (isTextable(dropModel)) {\n dropModel = null;\n }\n\n if (!dropModel) {\n const comps = em.get('DomComponents').getComponents();\n const opts = {\n avoidChildren,\n avoidStore: 1,\n avoidUpdateStyle: 1\n };\n const tempModel = comps.add(dropContent, { ...opts, temporary: 1 });\n dropModel = comps.remove(tempModel, opts);\n dropModel = dropModel instanceof Array ? dropModel[0] : dropModel;\n this.dropModel = dropModel;\n\n if (isTextable(dropModel)) {\n return this.getSourceModel(src, { target, avoidChildren: 0 });\n }\n }\n\n return dropModel;\n }\n\n return src && $(src).data('model');\n },\n\n /**\n * Highlight target\n * @param {Model|null} model\n */\n selectTargetModel(model, source) {\n if (model instanceof Backbone.Collection) {\n return;\n }\n\n // Prevents loops in Firefox\n // https://github.com/artf/grapesjs/issues/2911\n if (source && source === model) return;\n\n const { targetModel } = this;\n\n // Reset the previous model but not if it's the same as the source\n // https://github.com/artf/grapesjs/issues/2478#issuecomment-570314736\n if (targetModel && targetModel !== this.srcModel) {\n targetModel.set('status', '');\n }\n\n if (model && model.set) {\n model.set('status', 'selected-parent');\n this.targetModel = model;\n }\n },\n\n /**\n * During move\n * @param {Event} e\n * */\n onMove(e) {\n const ev = e;\n const { em, onMoveClb, plh, customTarget } = this;\n this.moved = 1;\n\n // Turn placeholder visibile\n var dsp = plh.style.display;\n if (!dsp || dsp === 'none') plh.style.display = 'block';\n\n // Cache all necessary positions\n var eO = this.offset(this.el);\n this.elT = this.wmargin ? Math.abs(eO.top) : eO.top;\n this.elL = this.wmargin ? Math.abs(eO.left) : eO.left;\n var rY = e.pageY - this.elT + this.el.scrollTop;\n var rX = e.pageX - this.elL + this.el.scrollLeft;\n\n if (this.canvasRelative && em) {\n const mousePos = em\n .get('Canvas')\n .getMouseRelativeCanvas(e, { noScroll: 1 });\n rX = mousePos.x;\n rY = mousePos.y;\n }\n\n this.rX = rX;\n this.rY = rY;\n this.eventMove = e;\n\n //var targetNew = this.getTargetFromEl(e.target);\n const sourceModel = this.getSourceModel();\n const targetEl = customTarget\n ? customTarget({ sorter: this, event: e })\n : e.target;\n const dims = this.dimsFromTarget(targetEl, rX, rY);\n const target = this.target;\n const targetModel = target && this.getTargetModel(target);\n this.selectTargetModel(targetModel, sourceModel);\n if (!targetModel) plh.style.display = 'none';\n if (!target) return;\n this.lastDims = dims;\n const pos = this.findPosition(dims, rX, rY);\n\n if (this.isTextableActive(sourceModel, targetModel)) {\n this.activeTextModel = targetModel;\n this.setContentEditable(targetModel, true);\n\n plh.style.display = 'none';\n this.lastPos = pos;\n this.updateTextViewCursorPosition(ev);\n } else {\n this.disableTextable();\n this.activeTextModel = null;\n\n // If there is a significant changes with the pointer\n if (\n !this.lastPos ||\n this.lastPos.index != pos.index ||\n this.lastPos.method != pos.method\n ) {\n this.movePlaceholder(this.plh, dims, pos, this.prevTargetDim);\n if (!this.$plh) this.$plh = $(this.plh);\n\n // With canvasRelative the offset is calculated automatically for\n // each element\n if (!this.canvasRelative) {\n if (this.offTop) this.$plh.css('top', '+=' + this.offTop + 'px');\n if (this.offLeft) this.$plh.css('left', '+=' + this.offLeft + 'px');\n }\n\n this.lastPos = pos;\n }\n }\n\n isFunction(onMoveClb) &&\n onMoveClb({\n event: e,\n target: sourceModel,\n parent: targetModel,\n index: pos.index + (pos.method == 'after' ? 1 : 0)\n });\n\n em &&\n em.trigger('sorter:drag', {\n target,\n targetModel,\n sourceModel,\n dims,\n pos,\n x: rX,\n y: rY\n });\n },\n\n isTextableActive(src, trg) {\n return src && src.get && src.get('textable') && trg && trg.is('text');\n },\n\n disableTextable() {\n const { activeTextModel } = this;\n activeTextModel && activeTextModel.getView().disableEditing();\n },\n\n /**\n * Returns true if the elements is in flow, so is not in flow where\n * for example the component is with float:left\n * @param {HTMLElement} el\n * @param {HTMLElement} parent\n * @return {Boolean}\n * @private\n * */\n isInFlow(el, parent) {\n if (!el) return false;\n\n parent = parent || document.body;\n var ch = -1,\n h;\n var elem = el;\n h = elem.offsetHeight;\n if (/*h < ch || */ !this.styleInFlow(elem, parent)) return false;\n else return true;\n },\n\n /**\n * Check if el has style to be in flow\n * @param {HTMLElement} el\n * @param {HTMLElement} parent\n * @return {Boolean}\n * @private\n */\n styleInFlow(el, parent) {\n if (isTextNode(el)) return;\n const style = el.style || {};\n const $el = $(el);\n const $parent = parent && $(parent);\n\n if (style.overflow && style.overflow !== 'visible') return;\n const propFloat = $el.css('float');\n if (propFloat && propFloat !== 'none') return;\n if (\n $parent &&\n $parent.css('display') == 'flex' &&\n $parent.css('flex-direction') !== 'column'\n )\n return;\n switch (style.position) {\n case 'static':\n case 'relative':\n case '':\n break;\n default:\n return;\n }\n switch (el.tagName) {\n case 'TR':\n case 'TBODY':\n case 'THEAD':\n case 'TFOOT':\n return true;\n }\n switch ($el.css('display')) {\n case 'block':\n case 'list-item':\n case 'table':\n case 'flex':\n return true;\n }\n return;\n },\n\n /**\n * Check if the target is valid with the actual source\n * @param {HTMLElement} trg\n * @return {Boolean}\n */\n validTarget(trg, src) {\n const trgModel = this.getTargetModel(trg);\n const srcModel = this.getSourceModel(src, { target: trgModel });\n src = srcModel && srcModel.view && srcModel.view.el;\n trg = trgModel && trgModel.view && trgModel.view.el;\n let result = {\n valid: true,\n src,\n srcModel,\n trg,\n trgModel\n };\n\n if (!src || !trg) {\n result.valid = false;\n return result;\n }\n\n // check if the source is draggable in target\n let draggable = srcModel.get('draggable');\n draggable = draggable instanceof Array ? draggable.join(', ') : draggable;\n result.dragInfo = draggable;\n draggable = isString(draggable) ? this.matches(trg, draggable) : draggable;\n result.draggable = draggable;\n\n // Check if the target could accept the source\n let droppable = trgModel.get('droppable');\n\n if (isFunction(droppable)) {\n const res = droppable(srcModel, trgModel);\n result.droppable = res;\n result.dropInfo = res;\n droppable = res;\n } else {\n droppable = droppable instanceof Backbone.Collection ? 1 : droppable;\n droppable = droppable instanceof Array ? droppable.join(', ') : droppable;\n result.dropInfo = droppable;\n droppable = isString(droppable)\n ? this.matches(src, droppable)\n : droppable;\n droppable =\n draggable && this.isTextableActive(srcModel, trgModel) ? 1 : droppable;\n result.droppable = droppable;\n }\n\n if (!droppable || !draggable) {\n result.valid = false;\n }\n\n return result;\n },\n\n /**\n * Get dimensions of nodes relative to the coordinates\n * @param {HTMLElement} target\n * @param {number} rX Relative X position\n * @param {number} rY Relative Y position\n * @return {Array}\n */\n dimsFromTarget(target, rX, rY) {\n const em = this.em;\n var dims = [];\n\n if (!target) {\n return dims;\n }\n\n // Select the first valuable target\n if (!this.matches(target, `${this.itemSel}, ${this.containerSel}`)) {\n target = this.closest(target, this.itemSel);\n }\n\n // If draggable is an array the target will be one of those\n if (this.draggable instanceof Array) {\n target = this.closest(target, this.draggable.join(','));\n }\n\n if (!target) {\n return dims;\n }\n\n // Check if the target is different from the previous one\n if (this.prevTarget && this.prevTarget != target) {\n this.prevTarget = null;\n }\n\n // New target found\n if (!this.prevTarget) {\n this.targetP = this.closest(target, this.containerSel);\n\n // Check if the source is valid with the target\n let validResult = this.validTarget(target);\n em && em.trigger('sorter:drag:validation', validResult);\n\n if (!validResult.valid && this.targetP) {\n return this.dimsFromTarget(this.targetP, rX, rY);\n }\n\n this.prevTarget = target;\n this.prevTargetDim = this.getDim(target);\n this.cacheDimsP = this.getChildrenDim(this.targetP);\n this.cacheDims = this.getChildrenDim(target);\n }\n\n // If the target is the previous one will return the cached dims\n if (this.prevTarget == target) dims = this.cacheDims;\n\n // Target when I will drop element to sort\n this.target = this.prevTarget;\n\n // Generally, on any new target the poiner enters inside its area and\n // triggers nearBorders(), so have to take care of this\n if (\n this.nearBorders(this.prevTargetDim, rX, rY) ||\n (!this.nested && !this.cacheDims.length)\n ) {\n const targetParent = this.targetP;\n\n if (targetParent && this.validTarget(targetParent).valid) {\n dims = this.cacheDimsP;\n this.target = targetParent;\n }\n }\n\n this.lastPos = null;\n return dims;\n },\n\n /**\n * Get valid target from element\n * This method should replace dimsFromTarget()\n * @param {HTMLElement} el\n * @return {HTMLElement}\n */\n getTargetFromEl(el) {\n let target = el;\n let targetParent;\n let targetPrev = this.targetPrev;\n const em = this.em;\n const containerSel = this.containerSel;\n const itemSel = this.itemSel;\n\n // Select the first valuable target\n if (!this.matches(target, `${itemSel}, ${containerSel}`)) {\n target = this.closest(target, itemSel);\n }\n\n // If draggable is an array the target will be one of those\n // TODO check if this options is used somewhere\n if (this.draggable instanceof Array) {\n target = this.closest(target, this.draggable.join(','));\n }\n\n // Check if the target is different from the previous one\n if (targetPrev && targetPrev != target) {\n this.targetPrev = '';\n }\n\n // New target found\n if (!this.targetPrev) {\n targetParent = this.closest(target, containerSel);\n\n // If the current target is not valid (src/trg reasons) try with\n // the parent one (if exists)\n const validResult = this.validTarget(target);\n em && em.trigger('sorter:drag:validation', validResult);\n\n if (!validResult.valid && targetParent) {\n return this.getTargetFromEl(targetParent);\n }\n\n this.targetPrev = target;\n }\n\n // Generally, on any new target the poiner enters inside its area and\n // triggers nearBorders(), so have to take care of this\n if (this.nearElBorders(target)) {\n targetParent = this.closest(target, containerSel);\n\n if (targetParent && this.validTarget(targetParent).valid) {\n target = targetParent;\n }\n }\n\n return target;\n },\n\n /**\n * Check if the current pointer is neare to element borders\n * @return {Boolen}\n */\n nearElBorders(el) {\n const off = 10;\n const rect = el.getBoundingClientRect();\n const body = el.ownerDocument.body;\n const { x, y } = this.getCurrentPos();\n const top = rect.top + body.scrollTop;\n const left = rect.left + body.scrollLeft;\n const width = rect.width;\n const height = rect.height;\n\n if (\n y < top + off || // near top edge\n y > top + height - off || // near bottom edge\n x < left + off || // near left edge\n x > left + width - off // near right edge\n ) {\n return 1;\n }\n },\n\n getCurrentPos() {\n const ev = this.eventMove;\n const x = ev.pageX || 0;\n const y = ev.pageY || 0;\n return { x, y };\n },\n\n /**\n * Returns dimensions and positions about the element\n * @param {HTMLElement} el\n * @return {Array}\n */\n getDim(el) {\n const { em, canvasRelative } = this;\n const canvas = em && em.get('Canvas');\n const offsets = canvas ? canvas.getElementOffsets(el) : {};\n let top, left, height, width;\n\n if (canvasRelative && em) {\n const pos = canvas.getElementPos(el, { noScroll: 1 });\n top = pos.top; // - offsets.marginTop;\n left = pos.left; // - offsets.marginLeft;\n height = pos.height; // + offsets.marginTop + offsets.marginBottom;\n width = pos.width; // + offsets.marginLeft + offsets.marginRight;\n } else {\n var o = this.offset(el);\n top = this.relative\n ? el.offsetTop\n : o.top - (this.wmargin ? -1 : 1) * this.elT;\n left = this.relative\n ? el.offsetLeft\n : o.left - (this.wmargin ? -1 : 1) * this.elL;\n height = el.offsetHeight;\n width = el.offsetWidth;\n }\n\n return { top, left, height, width, offsets };\n },\n\n /**\n * Get children dimensions\n * @param {HTMLELement} el Element root\n * @retun {Array}\n * */\n getChildrenDim(trg) {\n const dims = [];\n if (!trg) return dims;\n\n // Get children based on getChildrenContainer\n const trgModel = this.getTargetModel(trg);\n if (trgModel && trgModel.view && !this.ignoreViewChildren) {\n const view = trgModel.getCurrentView\n ? trgModel.getCurrentView()\n : trgModel.view;\n trg = view.getChildrenContainer();\n }\n\n each(trg.children, (el, i) => {\n const model = getModel(el, $);\n const elIndex = model && model.index ? model.index() : i;\n\n if (!isTextNode(el) && !this.matches(el, this.itemSel)) {\n return;\n }\n\n const dim = this.getDim(el);\n let dir = this.direction;\n\n if (dir == 'v') dir = true;\n else if (dir == 'h') dir = false;\n else dir = this.isInFlow(el, trg);\n\n dim.dir = dir;\n dim.el = el;\n dim.indexEl = elIndex;\n dims.push(dim);\n });\n\n return dims;\n },\n\n /**\n * Check if the coordinates are near to the borders\n * @param {Array} dim\n * @param {number} rX Relative X position\n * @param {number} rY Relative Y position\n * @return {Boolean}\n * */\n nearBorders(dim, rX, rY) {\n var result = 0;\n var off = this.borderOffset;\n var x = rX || 0;\n var y = rY || 0;\n var t = dim.top;\n var l = dim.left;\n var h = dim.height;\n var w = dim.width;\n if (t + off > y || y > t + h - off || l + off > x || x > l + w - off)\n result = 1;\n\n return !!result;\n },\n\n /**\n * Find the position based on passed dimensions and coordinates\n * @param {Array} dims Dimensions of nodes to parse\n * @param {number} posX X coordindate\n * @param {number} posY Y coordindate\n * @retun {Object}\n * */\n findPosition(dims, posX, posY) {\n var result = { index: 0, indexEl: 0, method: 'before' };\n var leftLimit = 0,\n xLimit = 0,\n dimRight = 0,\n yLimit = 0,\n xCenter = 0,\n yCenter = 0,\n dimDown = 0,\n dim = 0;\n // Each dim is: Top, Left, Height, Width\n for (var i = 0, len = dims.length; i < len; i++) {\n dim = dims[i];\n const { top, left, height, width } = dim;\n // Right position of the element. Left + Width\n dimRight = left + width;\n // Bottom position of the element. Top + Height\n dimDown = top + height;\n // X center position of the element. Left + (Width / 2)\n xCenter = left + width / 2;\n // Y center position of the element. Top + (Height / 2)\n yCenter = top + height / 2;\n // Skip if over the limits\n if (\n (xLimit && left > xLimit) ||\n (yLimit && yCenter >= yLimit) || // >= avoid issue with clearfixes\n (leftLimit && dimRight < leftLimit)\n )\n continue;\n result.index = i;\n result.indexEl = dim.indexEl;\n // If it's not in flow (like 'float' element)\n if (!dim.dir) {\n if (posY < dimDown) yLimit = dimDown;\n //If x lefter than center\n if (posX < xCenter) {\n xLimit = xCenter;\n result.method = 'before';\n } else {\n leftLimit = xCenter;\n result.method = 'after';\n }\n } else {\n // If y upper than center\n if (posY < yCenter) {\n result.method = 'before';\n break;\n } else result.method = 'after'; // After last element\n }\n }\n return result;\n },\n\n /**\n * Updates the position of the placeholder\n * @param {HTMLElement} phl\n * @param {Array} dims\n * @param {Object} pos Position object\n * @param {Array} trgDim target dimensions ([top, left, height, width])\n * */\n movePlaceholder(plh, dims, pos, trgDim) {\n var marg = 0,\n t = 0,\n l = 0,\n w = 0,\n h = 0,\n un = 'px',\n margI = 5,\n method = pos.method;\n const elDim = dims[pos.index];\n\n // Placeholder orientation\n plh.classList.remove('vertical');\n plh.classList.add('horizontal');\n\n if (elDim) {\n // If it's not in flow (like 'float' element)\n const { top, left, height, width } = elDim;\n if (!elDim.dir) {\n w = 'auto';\n h = height - marg * 2 + un;\n t = top + marg;\n l = method == 'before' ? left - marg : left + width - marg;\n\n plh.classList.remove('horizontal');\n plh.classList.add('vertical');\n } else {\n w = width + un;\n h = 'auto';\n t = method == 'before' ? top - marg : top + height - marg;\n l = left;\n }\n } else {\n // Placeholder inside the component\n if (!this.nested) {\n plh.style.display = 'none';\n return;\n }\n if (trgDim) {\n const offset = trgDim.offsets || {};\n const pT = offset.paddingTop || margI;\n const pL = offset.paddingLeft || margI;\n t = trgDim.top + pT;\n l = trgDim.left + pL;\n w = parseInt(trgDim.width) - pL * 2 + un;\n h = 'auto';\n }\n }\n plh.style.top = t + un;\n plh.style.left = l + un;\n if (w) plh.style.width = w;\n if (h) plh.style.height = h;\n },\n\n /**\n * Leave item\n * @param event\n *\n * @return void\n * */\n endMove(e) {\n const src = this.eV;\n const moved = [];\n const docs = this.getDocuments();\n const container = this.getContainerEl();\n const onEndMove = this.onEndMove;\n const onEnd = this.onEnd;\n const { target, lastPos } = this;\n let srcModel;\n off(container, 'mousemove dragover', this.onMove);\n off(docs, 'mouseup dragend touchend', this.endMove);\n off(docs, 'keydown', this.rollback);\n this.plh.style.display = 'none';\n\n if (src) {\n srcModel = this.getSourceModel();\n if (this.selectOnEnd && srcModel && srcModel.set) {\n srcModel.set('status', '');\n srcModel.set('status', 'selected');\n }\n }\n\n if (this.moved && target) {\n const toMove = this.toMove;\n const toMoveArr = isArray(toMove) ? toMove : toMove ? [toMove] : [src];\n toMoveArr.forEach(model => {\n moved.push(this.move(target, model, lastPos));\n });\n }\n\n if (this.plh) this.plh.style.display = 'none';\n var dragHelper = this.dragHelper;\n\n if (dragHelper) {\n dragHelper.parentNode.removeChild(dragHelper);\n this.dragHelper = null;\n }\n\n this.disableTextable();\n this.selectTargetModel();\n this.toggleSortCursor();\n\n this.toMove = null;\n this.eventMove = 0;\n this.dropModel = null;\n\n if (isFunction(onEndMove)) {\n const data = {\n target: srcModel,\n parent: srcModel && srcModel.parent(),\n index: srcModel && srcModel.index()\n };\n moved.length\n ? moved.forEach(m => onEndMove(m, this, data))\n : onEndMove(null, this, { ...data, cancelled: 1 });\n }\n\n isFunction(onEnd) && onEnd({ sorter: this });\n },\n\n /**\n * Move component to new position\n * @param {HTMLElement} dst Destination target\n * @param {HTMLElement} src Element to move\n * @param {Object} pos Object with position coordinates\n * */\n move(dst, src, pos) {\n const { em, activeTextModel, dropContent } = this;\n const srcEl = getElement(src);\n em && em.trigger('component:dragEnd:before', dst, srcEl, pos); // @depricated\n let index = pos.indexEl;\n let modelToDrop, modelTemp, created;\n const warns = [];\n const validResult = this.validTarget(dst, srcEl);\n const targetCollection = $(dst).data('collection');\n const model = validResult.srcModel;\n let { droppable } = validResult;\n const { trgModel, draggable } = validResult;\n const dropInfo =\n validResult.dropInfo || (trgModel && trgModel.get('droppable'));\n const dragInfo = validResult.dragInfo || (model && model.get('draggable'));\n droppable = trgModel instanceof Backbone.Collection ? 1 : droppable;\n const isTextableActive = this.isTextableActive(model, trgModel);\n\n if (targetCollection && droppable && draggable) {\n index = pos.method === 'after' ? index + 1 : index;\n var opts = { at: index, noIncrement: 1 };\n\n if (!dropContent) {\n // Putting `avoidStore` here will make the UndoManager behave wrong\n opts.temporary = 1;\n modelTemp = targetCollection.add({}, { ...opts });\n\n if (model.collection) {\n modelToDrop = model.collection.remove(model, { temporary: 1 });\n }\n } else {\n modelToDrop = isFunction(dropContent) ? dropContent() : dropContent;\n opts.silent = false;\n opts.avoidUpdateStyle = 1;\n }\n\n if (isTextableActive) {\n const viewActive = activeTextModel.getView();\n activeTextModel.trigger('active');\n const { activeRte } = viewActive;\n const modelEl = model.getEl();\n delete model.opt.temporary;\n model.getView().render();\n modelEl.setAttribute('data-gjs-textable', 'true');\n const { outerHTML } = modelEl;\n activeRte.insertHTML && activeRte.insertHTML(outerHTML);\n } else {\n created = targetCollection.add(modelToDrop, opts);\n }\n\n if (!dropContent) {\n targetCollection.remove(modelTemp);\n } else {\n this.dropContent = null;\n }\n\n // This will cause to recalculate children dimensions\n this.prevTarget = null;\n } else if (em) {\n !targetCollection && warns.push('Target collection not found');\n !droppable &&\n dropInfo &&\n warns.push(`Target is not droppable, accepts [${dropInfo}]`);\n !draggable &&\n dragInfo &&\n warns.push(`Component not draggable, acceptable by [${dragInfo}]`);\n em.logWarning('Invalid target position', {\n errors: warns,\n model,\n context: 'sorter',\n target: trgModel\n });\n }\n\n if (em) {\n em.trigger('component:dragEnd', targetCollection, modelToDrop, warns); // @deprecated\n em.trigger('sorter:drag:end', {\n targetCollection,\n modelToDrop,\n warns,\n validResult,\n dst,\n srcEl\n });\n }\n\n return created;\n },\n\n /**\n * Rollback to previous situation\n * @param {Event}\n * @param {Bool} Indicates if rollback in anycase\n * */\n rollback(e) {\n off(this.getDocuments(), 'keydown', this.rollback);\n const key = e.which || e.keyCode;\n\n if (key == 27) {\n this.moved = 0;\n this.endMove();\n }\n }\n});\n","import { bindAll, defaults, isFunction, each } from 'underscore';\nimport { on, off, normalizeFloat } from 'utils/mixins';\n\nvar defaultOpts = {\n // Function which returns custom X and Y coordinates of the mouse\n mousePosFetcher: null,\n // Indicates custom target updating strategy\n updateTarget: null,\n // Function which gets HTMLElement as an arg and returns it relative position\n ratioDefault: 0,\n posFetcher: null,\n onStart: null,\n onMove: null,\n onEnd: null,\n onUpdateContainer: () => {},\n\n // Resize unit step\n step: 1,\n\n // Minimum dimension\n minDim: 10,\n\n // Maximum dimension\n maxDim: '',\n\n // Unit used for height resizing\n unitHeight: 'px',\n\n // Unit used for width resizing\n unitWidth: 'px',\n\n // The key used for height resizing\n keyHeight: 'height',\n\n // The key used for width resizing\n keyWidth: 'width',\n\n // If true, will override unitHeight and unitWidth, on start, with units\n // from the current focused element (currently used only in SelectComponent)\n currentUnit: 1,\n\n // With this option active the mousemove event won't be altered when\n // the pointer comes over iframes\n silentFrames: 0,\n\n // If true the container of handlers won't be updated\n avoidContainerUpdate: 0,\n\n // If height is 'auto', this setting will preserve it and only update width\n keepAutoHeight: false,\n\n // If width is 'auto', this setting will preserve it and only update height\n keepAutoWidth: false,\n\n // When keepAutoHeight is true and the height has the value 'auto', this is set to true and height isn't updated\n autoHeight: false,\n\n // When keepAutoWidth is true and the width has the value 'auto', this is set to true and width isn't updated\n autoWidth: false,\n\n // Handlers\n tl: 1, // Top left\n tc: 1, // Top center\n tr: 1, // Top right\n cl: 1, // Center left\n cr: 1, // Center right\n bl: 1, // Bottom left\n bc: 1, // Bottom center\n br: 1 // Bottom right\n};\n\nvar createHandler = (name, opts) => {\n var pfx = opts.prefix || '';\n var el = document.createElement('i');\n el.className = pfx + 'resizer-h ' + pfx + 'resizer-h-' + name;\n el.setAttribute('data-' + pfx + 'handler', name);\n return el;\n};\n\nvar getBoundingRect = (el, win) => {\n var w = win || window;\n var rect = el.getBoundingClientRect();\n return {\n left: rect.left + w.pageXOffset,\n top: rect.top + w.pageYOffset,\n width: rect.width,\n height: rect.height\n };\n};\n\nclass Resizer {\n /**\n * Init the Resizer with options\n * @param {Object} options\n */\n constructor(opts = {}) {\n this.setOptions(opts);\n bindAll(this, 'handleKeyDown', 'handleMouseDown', 'move', 'stop');\n return this;\n }\n\n /**\n * Get current connfiguration options\n * @return {Object}\n */\n getConfig() {\n return this.opts;\n }\n\n /**\n * Setup options\n * @param {Object} options\n */\n setOptions(options = {}) {\n this.opts = defaults(options, defaultOpts);\n this.setup();\n }\n\n /**\n * Setup resizer\n */\n setup() {\n const opts = this.opts;\n const pfx = opts.prefix || '';\n const appendTo = opts.appendTo || document.body;\n let container = this.container;\n\n // Create container if not yet exist\n if (!container) {\n container = document.createElement('div');\n container.className = `${pfx}resizer-c`;\n appendTo.appendChild(container);\n this.container = container;\n }\n\n while (container.firstChild) {\n container.removeChild(container.firstChild);\n }\n\n // Create handlers\n const handlers = {};\n ['tl', 'tc', 'tr', 'cl', 'cr', 'bl', 'bc', 'br'].forEach(\n hdl => (handlers[hdl] = opts[hdl] ? createHandler(hdl, opts) : '')\n );\n\n for (let n in handlers) {\n const handler = handlers[n];\n handler && container.appendChild(handler);\n }\n\n this.handlers = handlers;\n this.mousePosFetcher = opts.mousePosFetcher;\n this.updateTarget = opts.updateTarget;\n this.posFetcher = opts.posFetcher;\n this.onStart = opts.onStart;\n this.onMove = opts.onMove;\n this.onEnd = opts.onEnd;\n this.onUpdateContainer = opts.onUpdateContainer;\n }\n\n /**\n * Toggle iframes pointer event\n * @param {Boolean} silent If true, iframes will be silented\n */\n toggleFrames(silent) {\n if (this.opts.silentFrames) {\n const frames = document.querySelectorAll('iframe');\n each(frames, frame => (frame.style.pointerEvents = silent ? 'none' : ''));\n }\n }\n\n /**\n * Detects if the passed element is a resize handler\n * @param {HTMLElement} el\n * @return {Boolean}\n */\n isHandler(el) {\n var handlers = this.handlers;\n\n for (var n in handlers) {\n if (handlers[n] === el) return true;\n }\n\n return false;\n }\n\n /**\n * Returns the focused element\n * @return {HTMLElement}\n */\n getFocusedEl() {\n return this.el;\n }\n\n /**\n * Returns the parent of the focused element\n * @return {HTMLElement}\n */\n getParentEl() {\n return this.el.parentElement;\n }\n\n /**\n * Returns documents\n */\n getDocumentEl() {\n return [this.el.ownerDocument, document];\n }\n\n /**\n * Return element position\n * @param {HTMLElement} el\n * @param {Object} opts Custom options\n * @return {Object}\n */\n getElementPos(el, opts = {}) {\n var posFetcher = this.posFetcher || '';\n return posFetcher ? posFetcher(el, opts) : getBoundingRect(el);\n }\n\n /**\n * Focus resizer on the element, attaches handlers to it\n * @param {HTMLElement} el\n */\n focus(el) {\n // Avoid focusing on already focused element\n if (el && el === this.el) {\n return;\n }\n\n this.el = el;\n this.updateContainer({ forceShow: 1 });\n on(this.getDocumentEl(), 'mousedown', this.handleMouseDown);\n }\n\n /**\n * Blur from element\n */\n blur() {\n this.container.style.display = 'none';\n\n if (this.el) {\n off(this.getDocumentEl(), 'mousedown', this.handleMouseDown);\n this.el = null;\n }\n }\n\n /**\n * Start resizing\n * @param {Event} e\n */\n start(e) {\n //Right or middel click\n if (e.button !== 0) return;\n e.preventDefault();\n e.stopPropagation();\n const el = this.el;\n const parentEl = this.getParentEl();\n const resizer = this;\n const config = this.opts || {};\n var attrName = 'data-' + config.prefix + 'handler';\n var rect = this.getElementPos(el, { target: 'el' });\n var parentRect = this.getElementPos(parentEl);\n this.handlerAttr = e.target.getAttribute(attrName);\n this.clickedHandler = e.target;\n this.startDim = {\n t: rect.top,\n l: rect.left,\n w: rect.width,\n h: rect.height\n };\n this.rectDim = {\n t: rect.top,\n l: rect.left,\n w: rect.width,\n h: rect.height\n };\n this.startPos = {\n x: e.clientX,\n y: e.clientY\n };\n this.parentDim = {\n t: parentRect.top,\n l: parentRect.left,\n w: parentRect.width,\n h: parentRect.height\n };\n\n // Listen events\n var doc = this.getDocumentEl();\n on(doc, 'mousemove', this.move);\n on(doc, 'keydown', this.handleKeyDown);\n on(doc, 'mouseup', this.stop);\n isFunction(this.onStart) &&\n this.onStart(e, { docs: doc, config, el, resizer });\n this.toggleFrames(1);\n this.move(e);\n }\n\n /**\n * While resizing\n * @param {Event} e\n */\n move(e) {\n const onMove = this.onMove;\n var mouseFetch = this.mousePosFetcher;\n var currentPos = mouseFetch\n ? mouseFetch(e)\n : {\n x: e.clientX,\n y: e.clientY\n };\n\n this.currentPos = currentPos;\n this.delta = {\n x: currentPos.x - this.startPos.x,\n y: currentPos.y - this.startPos.y\n };\n this.keys = {\n shift: e.shiftKey,\n ctrl: e.ctrlKey,\n alt: e.altKey\n };\n\n this.rectDim = this.calc(this);\n this.updateRect(0);\n\n // Move callback\n onMove && onMove(e);\n\n // In case the mouse button was released outside of the window\n if (e.which === 0) {\n this.stop(e);\n }\n }\n\n /**\n * Stop resizing\n * @param {Event} e\n */\n stop(e) {\n const config = this.opts;\n var doc = this.getDocumentEl();\n off(doc, 'mousemove', this.move);\n off(doc, 'keydown', this.handleKeyDown);\n off(doc, 'mouseup', this.stop);\n this.updateRect(1);\n this.toggleFrames();\n isFunction(this.onEnd) && this.onEnd(e, { docs: doc, config });\n }\n\n /**\n * Update rect\n */\n updateRect(store) {\n const el = this.el;\n const resizer = this;\n const config = this.opts;\n const rect = this.rectDim;\n const updateTarget = this.updateTarget;\n const selectedHandler = this.getSelectedHandler();\n const { unitHeight, unitWidth, keyWidth, keyHeight } = config;\n\n // Use custom updating strategy if requested\n if (isFunction(updateTarget)) {\n updateTarget(el, rect, {\n store,\n selectedHandler,\n resizer,\n config\n });\n } else {\n const elStyle = el.style;\n elStyle[keyWidth] = rect.w + unitWidth;\n elStyle[keyHeight] = rect.h + unitHeight;\n }\n\n this.updateContainer();\n }\n\n updateContainer(opt = {}) {\n const { opts, container, el } = this;\n const { style } = container;\n\n if (!opts.avoidContainerUpdate && el) {\n // On component resize container fits the tool,\n // to check if this update is required somewhere else point\n // const toUpdate = ['left', 'top', 'width', 'height'];\n // const rectEl = this.getElementPos(el, { target: 'container' });\n // toUpdate.forEach(pos => (style[pos] = `${rectEl[pos]}px`));\n if (opt.forceShow) style.display = 'block';\n }\n\n this.onUpdateContainer({\n el: container,\n resizer: this,\n opts: {\n ...opts,\n ...opt\n }\n });\n }\n\n /**\n * Get selected handler name\n * @return {string}\n */\n getSelectedHandler() {\n var handlers = this.handlers;\n\n if (!this.selectedHandler) {\n return;\n }\n\n for (let n in handlers) {\n if (handlers[n] === this.selectedHandler) return n;\n }\n }\n\n /**\n * Handle ESC key\n * @param {Event} e\n */\n handleKeyDown(e) {\n if (e.keyCode === 27) {\n // Rollback to initial dimensions\n this.rectDim = this.startDim;\n this.stop(e);\n }\n }\n\n /**\n * Handle mousedown to check if it's possible to start resizing\n * @param {Event} e\n */\n handleMouseDown(e) {\n var el = e.target;\n if (this.isHandler(el)) {\n this.selectedHandler = el;\n this.start(e);\n } else if (el !== this.el) {\n this.selectedHandler = '';\n this.blur();\n }\n }\n\n /**\n * All positioning logic\n * @return {Object}\n */\n calc(data) {\n let value;\n const opts = this.opts || {};\n const step = opts.step;\n const startDim = this.startDim;\n const minDim = opts.minDim;\n const maxDim = opts.maxDim;\n const deltaX = data.delta.x;\n const deltaY = data.delta.y;\n const parentW = this.parentDim.w;\n const parentH = this.parentDim.h;\n const unitWidth = this.opts.unitWidth;\n const unitHeight = this.opts.unitHeight;\n const startW =\n unitWidth === '%' ? (startDim.w / 100) * parentW : startDim.w;\n const startH =\n unitHeight === '%' ? (startDim.h / 100) * parentH : startDim.h;\n var box = {\n t: 0,\n l: 0,\n w: startW,\n h: startH\n };\n\n if (!data) return;\n\n var attr = data.handlerAttr;\n if (~attr.indexOf('r')) {\n value =\n unitWidth === '%'\n ? normalizeFloat(((startW + deltaX * step) / parentW) * 100, 0.01)\n : normalizeFloat(startW + deltaX * step, step);\n value = Math.max(minDim, value);\n maxDim && (value = Math.min(maxDim, value));\n box.w = value;\n }\n if (~attr.indexOf('b')) {\n value =\n unitHeight === '%'\n ? normalizeFloat(((startH + deltaY * step) / parentH) * 100, 0.01)\n : normalizeFloat(startH + deltaY * step, step);\n value = Math.max(minDim, value);\n maxDim && (value = Math.min(maxDim, value));\n box.h = value;\n }\n if (~attr.indexOf('l')) {\n value =\n unitWidth === '%'\n ? normalizeFloat(((startW - deltaX * step) / parentW) * 100, 0.01)\n : normalizeFloat(startW - deltaX * step, step);\n value = Math.max(minDim, value);\n maxDim && (value = Math.min(maxDim, value));\n box.w = value;\n }\n if (~attr.indexOf('t')) {\n value =\n unitHeight === '%'\n ? normalizeFloat(((startH - deltaY * step) / parentH) * 100, 0.01)\n : normalizeFloat(startH - deltaY * step, step);\n value = Math.max(minDim, value);\n maxDim && (value = Math.min(maxDim, value));\n box.h = value;\n }\n\n // Enforce aspect ratio (unless shift key is being held)\n var ratioActive = opts.ratioDefault ? !data.keys.shift : data.keys.shift;\n if (attr.indexOf('c') < 0 && ratioActive) {\n var ratio = startDim.w / startDim.h;\n if (box.w / box.h > ratio) {\n box.h = Math.round(box.w / ratio);\n } else {\n box.w = Math.round(box.h * ratio);\n }\n }\n\n if (~attr.indexOf('l')) {\n box.l = startDim.w - box.w;\n }\n if (~attr.indexOf('t')) {\n box.t = startDim.h - box.h;\n }\n\n return box;\n }\n}\n\nexport default {\n init(opts) {\n return new Resizer(opts);\n }\n};\n","import Dragger from './Dragger';\nimport Sorter from './Sorter';\nimport Resizer from './Resizer';\nimport * as mixins from './mixins';\n\nexport default () => {\n return {\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'Utils',\n\n /**\n * Initialize module\n */\n init() {\n return this;\n },\n\n destroy() {},\n\n Sorter,\n Resizer,\n Dragger,\n helpers: { ...mixins }\n };\n};\n","const traitInputAttr = { placeholder: 'eg. Text here' };\n\nexport default {\n assetManager: {\n addButton: 'Add image',\n inputPlh: 'http://path/to/the/image.jpg',\n modalTitle: 'Select Image',\n uploadTitle: 'Drop files here or click to upload'\n },\n // Here just as a reference, GrapesJS core doesn't contain any block,\n // so this should be omitted from other local files\n blockManager: {\n labels: {\n // 'block-id': 'Block Label',\n },\n categories: {\n // 'category-id': 'Category Label',\n }\n },\n domComponents: {\n names: {\n '': 'Box',\n wrapper: 'Body',\n text: 'Text',\n comment: 'Comment',\n image: 'Image',\n video: 'Video',\n label: 'Label',\n link: 'Link',\n map: 'Map',\n tfoot: 'Table foot',\n tbody: 'Table body',\n thead: 'Table head',\n table: 'Table',\n row: 'Table row',\n cell: 'Table cell'\n }\n },\n deviceManager: {\n device: 'Device',\n devices: {\n desktop: 'Desktop',\n tablet: 'Tablet',\n mobileLandscape: 'Mobile Landscape',\n mobilePortrait: 'Mobile Portrait'\n }\n },\n panels: {\n buttons: {\n titles: {\n preview: 'Preview',\n fullscreen: 'Fullscreen',\n 'sw-visibility': 'View components',\n 'export-template': 'View code',\n 'open-sm': 'Open Style Manager',\n 'open-tm': 'Settings',\n 'open-layers': 'Open Layer Manager',\n 'open-blocks': 'Open Blocks'\n }\n }\n },\n selectorManager: {\n label: 'Classes',\n selected: 'Selected',\n emptyState: '- State -',\n states: {\n hover: 'Hover',\n active: 'Click',\n 'nth-of-type(2n)': 'Even/Odd'\n }\n },\n styleManager: {\n empty: 'Select an element before using Style Manager',\n layer: 'Layer',\n fileButton: 'Images',\n sectors: {\n general: 'General',\n layout: 'Layout',\n typography: 'Typography',\n decorations: 'Decorations',\n extra: 'Extra',\n flex: 'Flex',\n dimension: 'Dimension'\n },\n // The core library generates the name by their `property` name\n properties: {\n // float: 'Float',\n }\n },\n traitManager: {\n empty: 'Select an element before using Trait Manager',\n label: 'Component settings',\n traits: {\n // The core library generates the name by their `name` property\n labels: {\n // id: 'Id',\n // alt: 'Alt',\n // title: 'Title',\n // href: 'Href',\n },\n // In a simple trait, like text input, these are used on input attributes\n attributes: {\n id: traitInputAttr,\n alt: traitInputAttr,\n title: traitInputAttr,\n href: { placeholder: 'eg. https://google.com' }\n },\n // In a trait like select, these are used to translate option names\n options: {\n target: {\n false: 'This window',\n _blank: 'New window'\n }\n }\n }\n }\n};\n","import en from './locale/en';\n\nexport default {\n // Locale value\n locale: 'en',\n\n // Fallback locale\n localeFallback: 'en',\n\n // Detect locale by checking browser language\n detectLocale: 1,\n\n // Show warnings when some of the i18n resources are missing\n debug: 0,\n\n // Messages to translate\n messages: {\n en\n }\n};\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/i18n/config.js)\n * ```js\n * const editor = grapesjs.init({\n * i18n: {\n * locale: 'en',\n * localeFallback: 'en',\n * messages: {\n * it: { hello: 'Ciao', ... },\n * ...\n * }\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const i18n = editor.I18n;\n * ```\n *\n * ### Events\n * * `i18n:add` - New set of messages is added\n * * `i18n:update` - The set of messages is updated\n * * `i18n:locale` - Locale changed\n *\n * @module I18n\n */\nimport { isUndefined, isString } from 'underscore';\nimport { hasWin } from 'utils/mixins';\nimport config from './config';\n\nconst isObj = el => !Array.isArray(el) && el !== null && typeof el === 'object';\n\nconst deepAssign = (...args) => {\n const target = { ...args[0] };\n\n for (let i = 1; i < args.length; i++) {\n const source = { ...args[i] };\n\n for (let key in source) {\n const targValue = target[key];\n const srcValue = source[key];\n\n if (isObj(targValue) && isObj(srcValue)) {\n target[key] = deepAssign(targValue, srcValue);\n } else {\n target[key] = srcValue;\n }\n }\n }\n\n return target;\n};\n\nexport default () => {\n return {\n name: 'I18n',\n\n config,\n\n /**\n * Initialize module\n * @param {Object} config Configurations\n * @private\n */\n init(opts = {}) {\n this.config = {\n ...config,\n ...opts,\n messages: {\n ...config.messages,\n ...(opts.messages || {})\n }\n };\n\n if (this.config.detectLocale) {\n this.config.locale = this._localLang();\n }\n\n this.em = opts.em;\n return this;\n },\n\n /**\n * Get module configurations\n * @returns {Object} Configuration object\n */\n getConfig() {\n return this.config;\n },\n\n /**\n * Update current locale\n * @param {String} locale Locale value\n * @returns {this}\n * @example\n * i18n.setLocale('it');\n */\n setLocale(locale) {\n const { em, config } = this;\n const evObj = { value: locale, valuePrev: config.locale };\n em && em.trigger('i18n:locale', evObj);\n config.locale = locale;\n return this;\n },\n\n /**\n * Get current locale\n * @returns {String} Current locale value\n */\n getLocale() {\n return this.config.locale;\n },\n\n /**\n * Get all messages\n * @param {String} [lang] Specify the language of messages to return\n * @param {Object} [opts] Options\n * @param {Boolean} [opts.debug] Show warnings in case of missing language\n * @returns {Object}\n * @example\n * i18n.getMessages();\n * // -> { en: { hello: '...' }, ... }\n * i18n.getMessages('en');\n * // -> { hello: '...' }\n */\n getMessages(lang, opts = {}) {\n const { messages } = this.config;\n lang &&\n !messages[lang] &&\n this._debug(`'${lang}' i18n lang not found`, opts);\n return lang ? messages[lang] : messages;\n },\n\n /**\n * Set new set of messages\n * @param {Object} msg Set of messages\n * @returns {this}\n * @example\n * i18n.getMessages();\n * // -> { en: { msg1: 'Msg 1', msg2: 'Msg 2', } }\n * i18n.setMessages({ en: { msg2: 'Msg 2 up', msg3: 'Msg 3', } });\n * // Set replaced\n * i18n.getMessages();\n * // -> { en: { msg2: 'Msg 2 up', msg3: 'Msg 3', } }\n */\n setMessages(msg) {\n const { em, config } = this;\n config.messages = msg;\n em && em.trigger('i18n:update', msg);\n return this;\n },\n\n /**\n * Update messages\n * @param {Object} msg Set of messages to add\n * @returns {this}\n * @example\n * i18n.getMessages();\n * // -> { en: { msg1: 'Msg 1', msg2: 'Msg 2', } }\n * i18n.addMessages({ en: { msg2: 'Msg 2 up', msg3: 'Msg 3', } });\n * // Set updated\n * i18n.getMessages();\n * // -> { en: { msg1: 'Msg 1', msg2: 'Msg 2 up', msg3: 'Msg 3', } }\n */\n addMessages(msg) {\n const { em } = this;\n const { messages } = this.config;\n em && em.trigger('i18n:add', msg);\n this.setMessages(deepAssign(messages, msg));\n\n return this;\n },\n\n /**\n * Translate the locale message\n * @param {String} key Label to translate\n * @param {Object} [opts] Options for the translation\n * @param {Object} [opts.params] Params for the translation\n * @param {Boolean} [opts.debug] Show warnings in case of missing resources\n * @returns {String}\n * @example\n * obj.setMessages({\n * en: { msg: 'Msg', msg2: 'Msg {test}'},\n * it: { msg2: 'Msg {test} it'},\n * });\n * obj.t('msg');\n * // -> outputs `Msg`\n * obj.t('msg2', { params: { test: 'hello' } }); // use params\n * // -> outputs `Msg hello`\n * obj.t('msg2', { l: 'it', params: { test: 'hello' } }); // custom local\n * // -> outputs `Msg hello it`\n */\n t(key, opts = {}) {\n const { config } = this;\n const param = opts.params || {};\n const locale = opts.l || this.getLocale();\n const localeFlb = opts.lFlb || config.localeFallback;\n let result = this._getMsg(key, locale, opts);\n\n // Try with fallback\n if (!result) result = this._getMsg(key, localeFlb, opts);\n\n !result &&\n this._debug(`'${key}' i18n key not found in '${locale}' lang`, opts);\n result =\n result && isString(result) ? this._addParams(result, param) : result;\n\n return result;\n },\n\n _localLang() {\n const nav = (hasWin() && window.navigator) || {};\n const lang = nav.language || nav.userLanguage;\n return lang ? lang.split('-')[0] : 'en';\n },\n\n _addParams(str, params) {\n const reg = new RegExp(`\\{([\\\\w\\\\d-]*)\\}`, 'g');\n return str.replace(reg, (m, val) => params[val] || '').trim();\n },\n\n _getMsg(key, locale, opts = {}) {\n const msgSet = this.getMessages(locale, opts);\n\n // Lang set is missing\n if (!msgSet) return;\n\n let result = msgSet[key];\n\n // Check for nested getter\n if (!result && key.indexOf('.') > 0) {\n result = key.split('.').reduce((lang, key) => {\n if (isUndefined(lang)) return;\n return lang[key];\n }, msgSet);\n }\n\n return result;\n },\n\n _debug(str, opts = {}) {\n const { em, config } = this;\n (opts.debug || config.debug) && em && em.logWarning(str);\n },\n\n destroy() {\n this.config = config;\n this.em = {};\n }\n };\n};\n","// The initial version of this RTE was borrowed from https://github.com/jaredreich/pell\n// and adapted to the GrapesJS's need\n\nimport { on, off } from 'utils/mixins';\n\nconst RTE_KEY = '_rte';\n\nconst btnState = {\n ACTIVE: 1,\n INACTIVE: 0,\n DISABLED: -1\n};\nconst isValidAnchor = rte => {\n const anchor = rte.selection().anchorNode;\n const parentNode = anchor && anchor.parentNode;\n const nextSibling = anchor && anchor.nextSibling;\n return (\n (parentNode && parentNode.nodeName == 'A') ||\n (nextSibling && nextSibling.nodeName == 'A')\n );\n};\nconst defActions = {\n bold: {\n name: 'bold',\n icon: 'B',\n attributes: { title: 'Bold' },\n result: rte => rte.exec('bold')\n },\n italic: {\n name: 'italic',\n icon: 'I',\n attributes: { title: 'Italic' },\n result: rte => rte.exec('italic')\n },\n underline: {\n name: 'underline',\n icon: 'U',\n attributes: { title: 'Underline' },\n result: rte => rte.exec('underline')\n },\n strikethrough: {\n name: 'strikethrough',\n icon: 'S',\n attributes: { title: 'Strike-through' },\n result: rte => rte.exec('strikeThrough')\n },\n link: {\n icon: `⫘`,\n name: 'link',\n attributes: {\n style: 'font-size:1.4rem;padding:0 4px 2px;',\n title: 'Link'\n },\n state: (rte, doc) => {\n if (rte && rte.selection()) {\n return isValidAnchor(rte) ? btnState.ACTIVE : btnState.INACTIVE;\n } else {\n return btnState.INACTIVE;\n }\n },\n result: rte => {\n if (isValidAnchor(rte)) {\n rte.exec('unlink');\n } else {\n rte.insertHTML(`${rte.selection()}`);\n }\n }\n }\n};\n\nexport default class RichTextEditor {\n constructor(settings = {}) {\n const el = settings.el;\n\n if (el[RTE_KEY]) {\n return el[RTE_KEY];\n }\n\n el[RTE_KEY] = this;\n this.setEl(el);\n this.updateActiveActions = this.updateActiveActions.bind(this);\n\n const acts = (settings.actions || []).map(action => {\n let result = action;\n if (typeof action === 'string') {\n result = { ...defActions[action] };\n } else if (defActions[action.name]) {\n result = { ...defActions[action.name], ...action };\n }\n return result;\n });\n const actions = acts.length\n ? acts\n : Object.keys(defActions).map(a => defActions[a]);\n\n settings.classes = {\n ...{\n actionbar: 'actionbar',\n button: 'action',\n active: 'active',\n disabled: 'disabled',\n inactive: 'inactive'\n },\n ...settings.classes\n };\n\n const classes = settings.classes;\n let actionbar = settings.actionbar;\n this.actionbar = actionbar;\n this.settings = settings;\n this.classes = classes;\n this.actions = actions;\n\n if (!actionbar) {\n const actionbarCont = settings.actionbarContainer;\n actionbar = document.createElement('div');\n actionbar.className = classes.actionbar;\n actionbarCont.appendChild(actionbar);\n this.actionbar = actionbar;\n actions.forEach(action => this.addAction(action));\n }\n\n settings.styleWithCSS && this.exec('styleWithCSS');\n this.syncActions();\n\n return this;\n }\n\n destroy() {\n this.el = 0;\n this.doc = 0;\n this.actionbar = 0;\n this.settings = {};\n this.classes = {};\n this.actions = [];\n }\n\n setEl(el) {\n this.el = el;\n this.doc = el.ownerDocument;\n }\n\n updateActiveActions() {\n this.getActions().forEach(action => {\n const btn = action.btn;\n const update = action.update;\n const { active, inactive, disabled } = { ...this.classes };\n const state = action.state;\n const name = action.name;\n const doc = this.doc;\n btn.className = btn.className.replace(active, '').trim();\n btn.className = btn.className.replace(inactive, '').trim();\n btn.className = btn.className.replace(disabled, '').trim();\n\n // if there is a state function, which depicts the state,\n // i.e. `active`, `disabled`, then call it\n if (state) {\n switch (state(this, doc)) {\n case btnState.ACTIVE:\n btn.className += ` ${active}`;\n break;\n case btnState.INACTIVE:\n btn.className += ` ${inactive}`;\n break;\n case btnState.DISABLED:\n btn.className += ` ${disabled}`;\n break;\n }\n } else {\n // otherwise default to checking if the name command is supported & enabled\n if (doc.queryCommandSupported(name) && doc.queryCommandState(name)) {\n btn.className += ` ${active}`;\n }\n }\n update && update(this, action);\n });\n }\n\n enable() {\n if (this.enabled) {\n return this;\n }\n\n this.actionbarEl().style.display = '';\n this.el.contentEditable = true;\n on(this.el, 'mouseup keyup', this.updateActiveActions);\n this.syncActions();\n this.updateActiveActions();\n this.el.focus();\n this.enabled = 1;\n return this;\n }\n\n disable() {\n this.actionbarEl().style.display = 'none';\n this.el.contentEditable = false;\n off(this.el, 'mouseup keyup', this.updateActiveActions);\n this.enabled = 0;\n return this;\n }\n\n /**\n * Sync actions with the current RTE\n */\n syncActions() {\n this.getActions().forEach(action => {\n if (this.settings.actionbar) {\n if (\n !action.state ||\n (action.state && action.state(this, this.doc) >= 0)\n ) {\n const event = action.event || 'click';\n action.btn[`on${event}`] = e => {\n action.result(this, action);\n this.updateActiveActions();\n };\n }\n }\n });\n }\n\n /**\n * Add new action to the actionbar\n * @param {Object} action\n * @param {Object} [opts={}]\n */\n addAction(action, opts = {}) {\n const sync = opts.sync;\n const btn = document.createElement('span');\n const icon = action.icon;\n const attr = action.attributes || {};\n btn.className = this.classes.button;\n action.btn = btn;\n\n for (let key in attr) {\n btn.setAttribute(key, attr[key]);\n }\n\n if (typeof icon == 'string') {\n btn.innerHTML = icon;\n } else {\n btn.appendChild(icon);\n }\n\n this.actionbarEl().appendChild(btn);\n\n if (sync) {\n this.actions.push(action);\n this.syncActions();\n }\n }\n\n /**\n * Get the array of current actions\n * @return {Array}\n */\n getActions() {\n return this.actions;\n }\n\n /**\n * Returns the Selection instance\n * @return {Selection}\n */\n selection() {\n return this.doc.getSelection();\n }\n\n /**\n * Execute the command\n * @param {string} command Command name\n * @param {any} [value=null Command's arguments\n */\n exec(command, value = null) {\n this.doc.execCommand(command, false, value);\n }\n\n /**\n * Get the actionbar element\n * @return {HTMLElement}\n */\n actionbarEl() {\n return this.actionbar;\n }\n\n /**\n * Set custom HTML to the selection, useful as the default 'insertHTML' command\n * doesn't work in the same way on all browsers\n * @param {string} value HTML string\n */\n insertHTML(value) {\n let lastNode;\n const doc = this.doc;\n const sel = doc.getSelection();\n\n if (sel && sel.rangeCount) {\n const node = doc.createElement('div');\n const range = sel.getRangeAt(0);\n range.deleteContents();\n node.innerHTML = value;\n Array.prototype.slice.call(node.childNodes).forEach(nd => {\n range.insertNode(nd);\n lastNode = nd;\n });\n\n sel.removeAllRanges();\n sel.addRange(range);\n this.el.focus();\n }\n }\n}\n","export default {\n stylePrefix: 'rte-',\n\n // If true, moves the toolbar below the element when the top canvas\n // edge is reached\n adjustToolbar: 1,\n\n // Default RTE actions\n actions: ['bold', 'italic', 'underline', 'strikethrough', 'link']\n};\n","/**\n * This module allows to customize the built-in toolbar of the Rich Text Editor and use commands from the [HTML Editing APIs](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand).\n * It's highly recommended to keep this toolbar as small as possible, especially from styling commands (eg. 'fontSize') and leave this task to the Style Manager\n *\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/rich_text_editor/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * richTextEditor: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const rte = editor.RichTextEditor;\n * ```\n *\n * * [add](#add)\n * * [get](#get)\n * * [getAll](#getall)\n * * [remove](#remove)\n * * [getToolbarEl](#gettoolbarel)\n *\n * @module RichTextEditor\n */\n\nimport RichTextEditor from './model/RichTextEditor';\nimport { on, hasWin } from 'utils/mixins';\nimport defaults from './config/config';\n\nexport default () => {\n let config = {};\n let toolbar, actions, lastEl, lastElPos, globalRte;\n const eventsUp =\n 'change:canvasOffset canvasScroll frame:scroll component:update';\n const hideToolbar = () => {\n const style = toolbar.style;\n const size = '-1000px';\n style.top = size;\n style.left = size;\n style.display = 'none';\n };\n\n return {\n customRte: null,\n\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'RichTextEditor',\n\n getConfig() {\n return config;\n },\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} opts Options\n * @private\n */\n init(opts = {}) {\n config = {\n ...defaults,\n ...opts\n };\n const ppfx = config.pStylePrefix;\n\n if (ppfx) {\n config.stylePrefix = ppfx + config.stylePrefix;\n }\n\n this.pfx = config.stylePrefix;\n actions = config.actions || [];\n if (!hasWin()) return this;\n toolbar = document.createElement('div');\n toolbar.className = `${ppfx}rte-toolbar ${ppfx}one-bg`;\n globalRte = this.initRte(document.createElement('div'));\n\n //Avoid closing on toolbar clicking\n on(toolbar, 'mousedown', e => e.stopPropagation());\n return this;\n },\n\n destroy() {\n const { customRte } = this;\n globalRte && globalRte.destroy();\n customRte && customRte.destroy && customRte.destroy();\n this.actionbar = 0;\n this.actions = 0;\n [config, toolbar, actions, lastEl, lastElPos, globalRte].forEach(\n i => (i = {})\n );\n },\n\n /**\n * Post render callback\n * @param {View} ev\n * @private\n */\n postRender(ev) {\n const canvas = ev.model.get('Canvas');\n toolbar.style.pointerEvents = 'all';\n hideToolbar();\n canvas.getToolsEl().appendChild(toolbar);\n },\n\n /**\n * Init the built-in RTE\n * @param {HTMLElement} el\n * @return {RichTextEditor}\n * @private\n */\n initRte(el) {\n const pfx = this.pfx;\n const actionbarContainer = toolbar;\n const actionbar = this.actionbar;\n const actions = this.actions || [...config.actions];\n const classes = {\n actionbar: `${pfx}actionbar`,\n button: `${pfx}action`,\n active: `${pfx}active`,\n inactive: `${pfx}inactive`,\n disabled: `${pfx}disabled`\n };\n const rte = new RichTextEditor({\n el,\n classes,\n actions,\n actionbar,\n actionbarContainer\n });\n globalRte && globalRte.setEl(el);\n\n if (rte.actionbar) {\n this.actionbar = rte.actionbar;\n }\n\n if (rte.actions) {\n this.actions = rte.actions;\n }\n\n return rte;\n },\n\n /**\n * Add a new action to the built-in RTE toolbar\n * @param {string} name Action name\n * @param {Object} action Action options\n * @example\n * rte.add('bold', {\n * icon: 'B',\n * attributes: {title: 'Bold'},\n * result: rte => rte.exec('bold')\n * });\n * rte.add('link', {\n * icon: document.getElementById('t'),\n * attributes: {title: 'Link',}\n * // Example on it's easy to wrap a selected content\n * result: rte => rte.insertHTML(`${rte.selection()}`)\n * });\n * // An example with fontSize\n * rte.add('fontSize', {\n * icon: ``,\n * // Bind the 'result' on 'change' listener\n * event: 'change',\n * result: (rte, action) => rte.exec('fontSize', action.btn.firstChild.value),\n * // Callback on any input change (mousedown, keydown, etc..)\n * update: (rte, action) => {\n * const value = rte.doc.queryCommandValue(action.name);\n * if (value != 'false') { // value is a string\n * action.btn.firstChild.value = value;\n * }\n * }\n * })\n * // An example with state\n * const isValidAnchor = (rte) => {\n * // a utility function to help determine if the selected is a valid anchor node\n * const anchor = rte.selection().anchorNode;\n * const parentNode = anchor && anchor.parentNode;\n * const nextSibling = anchor && anchor.nextSibling;\n * return (parentNode && parentNode.nodeName == 'A') || (nextSibling && nextSibling.nodeName == 'A')\n * }\n * rte.add('toggleAnchor', {\n * icon: `⫘`,\n * state: (rte, doc) => {\n * if (rte && rte.selection()) {\n * // `btnState` is a integer, -1 for disabled, 0 for inactive, 1 for active\n * return isValidAnchor(rte) ? btnState.ACTIVE : btnState.INACTIVE;\n * } else {\n * return btnState.INACTIVE;\n * }\n * },\n * result: (rte, action) => {\n * if (isValidAnchor(rte)) {\n * rte.exec('unlink');\n * } else {\n * rte.insertHTML(`${rte.selection()}`);\n * }\n * }\n * })\n */\n add(name, action = {}) {\n action.name = name;\n globalRte.addAction(action, { sync: 1 });\n },\n\n /**\n * Get the action by its name\n * @param {string} name Action name\n * @return {Object}\n * @example\n * const action = rte.get('bold');\n * // {name: 'bold', ...}\n */\n get(name) {\n let result;\n globalRte.getActions().forEach(action => {\n if (action.name == name) {\n result = action;\n }\n });\n return result;\n },\n\n /**\n * Get all actions\n * @return {Array}\n */\n getAll() {\n return globalRte.getActions();\n },\n\n /**\n * Remove the action from the toolbar\n * @param {string} name\n * @return {Object} Removed action\n * @example\n * const action = rte.remove('bold');\n * // {name: 'bold', ...}\n */\n remove(name) {\n const actions = this.getAll();\n const action = this.get(name);\n\n if (action) {\n const btn = action.btn;\n const index = actions.indexOf(action);\n btn.parentNode.removeChild(btn);\n actions.splice(index, 1);\n }\n\n return action;\n },\n\n /**\n * Get the toolbar element\n * @return {HTMLElement}\n */\n getToolbarEl() {\n return toolbar;\n },\n\n /**\n * Triggered when the offset of the editor is changed\n * @private\n */\n updatePosition() {\n const un = 'px';\n const canvas = config.em.get('Canvas');\n const { style } = toolbar;\n const pos = canvas.getTargetToElementFixed(lastEl, toolbar, {\n event: 'rteToolbarPosUpdate',\n left: 0\n });\n style.top = (pos.top || 0) + un;\n style.left = (pos.left || 0) + un;\n },\n\n /**\n * Enable rich text editor on the element\n * @param {View} view Component view\n * @param {Object} rte The instance of already defined RTE\n * @private\n * */\n async enable(view, rte) {\n lastEl = view.el;\n const { customRte } = this;\n const canvas = config.em.get('Canvas');\n const em = config.em;\n const el = view.getChildrenContainer();\n lastElPos = canvas.getElementPos(lastEl);\n\n toolbar.style.display = '';\n const rteInst = await (customRte\n ? customRte.enable(el, rte)\n : this.initRte(el).enable());\n\n if (em) {\n setTimeout(this.updatePosition.bind(this), 0);\n em.off(eventsUp, this.updatePosition, this);\n em.on(eventsUp, this.updatePosition, this);\n em.trigger('rte:enable', view, rteInst);\n }\n\n return rteInst;\n },\n\n /**\n * Unbind rich text editor from the element\n * @param {View} view\n * @param {Object} rte The instance of already defined RTE\n * @private\n * */\n disable(view, rte) {\n const em = config.em;\n const customRte = this.customRte;\n var el = view.getChildrenContainer();\n\n if (customRte) {\n customRte.disable(el, rte);\n } else {\n rte && rte.disable();\n }\n\n hideToolbar();\n if (em) {\n em.off(eventsUp, this.updatePosition, this);\n em.trigger('rte:disable', view, rte);\n }\n }\n };\n};\n","import { isUndefined, isString, bindAll } from 'underscore';\nimport { getModel, isEscKey, isEnterKey } from 'utils/mixins';\nimport Backbone from 'backbone';\nimport ComponentView from 'dom_components/view/ComponentView';\nimport { eventDrag } from 'dom_components/model/Component';\n\nconst inputProp = 'contentEditable';\nconst styleOpts = { mediaText: '' };\nconst $ = Backbone.$;\nlet ItemsView;\n\nexport default Backbone.View.extend({\n events: {\n 'mousedown [data-toggle-move]': 'startSort',\n 'touchstart [data-toggle-move]': 'startSort',\n 'click [data-toggle-visible]': 'toggleVisibility',\n 'click [data-toggle-open]': 'toggleOpening',\n 'click [data-toggle-select]': 'handleSelect',\n 'mouseover [data-toggle-select]': 'handleHover',\n 'mouseout [data-toggle-select]': 'handleHoverOut',\n 'dblclick [data-name]': 'handleEdit',\n 'keydown [data-name]': 'handleEditKey',\n 'focusout [data-name]': 'handleEditEnd'\n },\n\n template(model) {\n const { pfx, ppfx, config, clsNoEdit } = this;\n const { hidable } = config;\n const count = this.countChildren(model);\n const addClass = !count ? this.clsNoChild : '';\n const clsTitle = `${this.clsTitle} ${addClass}`;\n const clsTitleC = `${this.clsTitleC} ${ppfx}one-bg`;\n const clsCaret = `${this.clsCaret} fa fa-chevron-right`;\n const clsInput = `${this.inputNameCls} ${clsNoEdit} ${ppfx}no-app`;\n const level = this.level + 1;\n const gut = `${30 + level * 10}px`;\n const name = model.getName();\n const icon = model.getIcon();\n const clsBase = `${pfx}layer`;\n\n return `\n ${\n hidable\n ? ``\n : ''\n }\n
\n
\n
\n \n ${icon ? `${icon}` : ''}\n ${name}\n
\n
\n
\n
${count || ''}
\n
\n \n
\n
`;\n },\n\n initialize(o = {}) {\n bindAll(this, '__render');\n this.opt = o;\n this.level = o.level;\n const config = o.config || {};\n const { onInit } = config;\n this.config = config;\n this.em = o.config.em;\n this.ppfx = this.em.get('Config').stylePrefix;\n this.sorter = o.sorter || '';\n this.pfx = this.config.stylePrefix;\n this.parentView = o.parentView;\n const pfx = this.pfx;\n const ppfx = this.ppfx;\n const model = this.model;\n const components = model.get('components');\n const type = model.get('type') || 'default';\n model.set('open', false);\n this.listenTo(components, 'remove add reset', this.checkChildren);\n [\n ['change:status', this.updateStatus],\n ['change:open', this.updateOpening],\n ['change:layerable', this.updateLayerable],\n ['change:style:display', this.updateVisibility],\n ['rerender:layer', this.render]\n ].forEach(item => this.listenTo(model, item[0], item[1]));\n this.className = `${pfx}layer ${pfx}layer__t-${type} no-select ${ppfx}two-color`;\n this.inputNameCls = `${ppfx}layer-name`;\n this.clsTitleC = `${pfx}layer-title-c`;\n this.clsTitle = `${pfx}layer-title`;\n this.clsCaret = `${pfx}layer-caret`;\n this.clsCount = `${pfx}layer-count`;\n this.clsMove = `${pfx}layer-move`;\n this.clsChildren = `${pfx}layer-children`;\n this.clsNoChild = `${pfx}layer-no-chld`;\n this.clsEdit = `${this.inputNameCls}--edit`;\n this.clsNoEdit = `${this.inputNameCls}--no-edit`;\n this.$el.data('model', model);\n this.$el.data('collection', components);\n model.viewLayer = this;\n onInit.bind(this)({\n component: model,\n render: this.__render,\n listenTo: this.listenTo\n });\n },\n\n getVisibilityEl() {\n if (!this.eyeEl) {\n this.eyeEl = this.$el.children(`.${this.pfx}layer-vis`);\n }\n\n return this.eyeEl;\n },\n\n updateVisibility() {\n const pfx = this.pfx;\n const model = this.model;\n const hClass = `${pfx}layer-hidden`;\n const hideIcon = 'fa-eye-slash';\n const hidden = model.getStyle(styleOpts).display === 'none';\n const method = hidden ? 'addClass' : 'removeClass';\n this.$el[method](hClass);\n this.getVisibilityEl()[method](hideIcon);\n },\n\n /**\n * Toggle visibility\n * @param\tEvent\n *\n * @return \tvoid\n * */\n toggleVisibility(e) {\n e && e.stopPropagation();\n const { model, em } = this;\n const prevDspKey = '__prev-display';\n const prevDisplay = model.get(prevDspKey);\n const style = model.getStyle(styleOpts);\n const { display } = style;\n const hidden = display == 'none';\n\n if (hidden) {\n delete style.display;\n\n if (prevDisplay) {\n style.display = prevDisplay;\n model.unset(prevDspKey);\n }\n } else {\n display && model.set(prevDspKey, display);\n style.display = 'none';\n }\n\n model.setStyle(style, styleOpts);\n em && em.trigger('component:toggled'); // Updates Style Manager #2938\n },\n\n /**\n * Handle the edit of the component name\n */\n handleEdit(e) {\n e && e.stopPropagation();\n const { em, $el, clsNoEdit, clsEdit } = this;\n const inputEl = this.getInputName();\n inputEl[inputProp] = true;\n inputEl.focus();\n document.execCommand('selectAll', false, null);\n em && em.setEditing(1);\n $el\n .find(`.${this.inputNameCls}`)\n .removeClass(clsNoEdit)\n .addClass(clsEdit);\n },\n\n handleEditKey(ev) {\n ev.stopPropagation();\n (isEscKey(ev) || isEnterKey(ev)) && this.handleEditEnd(ev);\n },\n\n /**\n * Handle with the end of editing of the component name\n */\n handleEditEnd(e) {\n e && e.stopPropagation();\n const { em, $el, clsNoEdit, clsEdit } = this;\n const inputEl = this.getInputName();\n const name = inputEl.textContent;\n inputEl.scrollLeft = 0;\n inputEl[inputProp] = false;\n this.setName(name, { component: this.model, propName: 'custom-name' });\n em && em.setEditing(0);\n $el\n .find(`.${this.inputNameCls}`)\n .addClass(clsNoEdit)\n .removeClass(clsEdit);\n },\n\n setName(name, { propName }) {\n this.model.set(propName, name);\n },\n\n /**\n * Get the input containing the name of the component\n * @return {HTMLElement}\n */\n getInputName() {\n if (!this.inputName) {\n this.inputName = this.el.querySelector(`.${this.inputNameCls}`);\n }\n return this.inputName;\n },\n\n /**\n * Update item opening\n *\n * @return void\n * */\n updateOpening() {\n var opened = this.opt.opened || {};\n var model = this.model;\n const chvDown = 'fa-chevron-down';\n\n if (model.get('open')) {\n this.$el.addClass('open');\n this.getCaret().addClass(chvDown);\n opened[model.cid] = model;\n } else {\n this.$el.removeClass('open');\n this.getCaret().removeClass(chvDown);\n delete opened[model.cid];\n }\n },\n\n /**\n * Toggle item opening\n * @param {Object}\te\n *\n * @return void\n * */\n toggleOpening(e) {\n const { model } = this;\n e.stopImmediatePropagation();\n\n if (!model.get('components').length) return;\n\n model.set('open', !model.get('open'));\n },\n\n /**\n * Handle component selection\n */\n handleSelect(e) {\n e.stopPropagation();\n const { em, config, model } = this;\n\n if (em) {\n em.setSelected(model, { fromLayers: 1, event: e });\n const scroll = config.scrollCanvas;\n scroll && model.views.forEach(view => view.scrollIntoView(scroll));\n }\n },\n\n /**\n * Handle component selection\n */\n handleHover(e) {\n e.stopPropagation();\n const { em, config, model } = this;\n em && config.showHover && em.setHovered(model, { fromLayers: 1 });\n },\n\n handleHoverOut(ev) {\n ev.stopPropagation();\n const { em, config } = this;\n em && config.showHover && em.setHovered(0, { fromLayers: 1 });\n },\n\n /**\n * Delegate to sorter\n * @param\tEvent\n * */\n startSort(e) {\n e.stopPropagation();\n const { em, sorter } = this;\n // Right or middel click\n if (e.button && e.button !== 0) return;\n\n if (sorter) {\n sorter.onStart = data => em.trigger(`${eventDrag}:start`, data);\n sorter.onMoveClb = data => em.trigger(eventDrag, data);\n sorter.startSort(e.target);\n }\n },\n\n /**\n * Freeze item\n * @return\tvoid\n * */\n freeze() {\n this.$el.addClass(this.pfx + 'opac50');\n this.model.set('open', 0);\n },\n\n /**\n * Unfreeze item\n * @return\tvoid\n * */\n unfreeze() {\n this.$el.removeClass(this.pfx + 'opac50');\n },\n\n /**\n * Update item on status change\n * @param\tEvent\n * */\n updateStatus(e) {\n ComponentView.prototype.updateStatus.apply(this, [\n {\n avoidHover: !this.config.highlightHover,\n noExtHl: 1\n }\n ]);\n },\n\n /**\n * Check if component is visible\n *\n * @return boolean\n * */\n isVisible() {\n const { display } = this.model.getStyle();\n\n return !(display && display === 'none');\n },\n\n /**\n * Update item aspect after children changes\n *\n * @return void\n * */\n checkChildren() {\n const { model, clsNoChild } = this;\n const count = this.countChildren(model);\n const title = this.$el\n .children(`.${this.clsTitleC}`)\n .children(`.${this.clsTitle}`);\n let { cnt } = this;\n\n if (!cnt) {\n cnt = this.$el.children('[data-count]').get(0);\n this.cnt = cnt;\n }\n\n title[count ? 'removeClass' : 'addClass'](clsNoChild);\n if (cnt) cnt.innerHTML = count || '';\n !count && model.set('open', 0);\n },\n\n /**\n * Count children inside model\n * @param {Object} model\n * @return {number}\n * @private\n */\n countChildren(model) {\n var count = 0;\n model.get('components').each(function(m) {\n var isCountable = this.opt.isCountable;\n var hide = this.config.hideTextnode;\n if (isCountable && !isCountable(m, hide)) return;\n count++;\n }, this);\n return count;\n },\n\n getCaret() {\n if (!this.caret || !this.caret.length) {\n const pfx = this.pfx;\n this.caret = this.$el\n .children(`.${this.clsTitleC}`)\n .find(`.${this.clsCaret}`);\n }\n\n return this.caret;\n },\n\n setRoot(el) {\n el = isString(el) ? this.em.getWrapper().find(el)[0] : el;\n const model = getModel(el, $);\n if (!model) return;\n this.stopListening();\n this.model = model;\n this.initialize(this.opt);\n this._rendered && this.render();\n },\n\n updateLayerable() {\n const { parentView } = this;\n const toRerender = parentView || this;\n toRerender.render();\n },\n\n __clearItems() {\n const { items } = this;\n items && items.remove();\n },\n\n remove() {\n Backbone.View.prototype.remove.apply(this, arguments);\n this.__clearItems();\n },\n\n render() {\n const { model, config, pfx, ppfx, opt } = this;\n this.__clearItems();\n const { isCountable } = opt;\n const hidden = isCountable && !isCountable(model, config.hideTextnode);\n const vis = this.isVisible();\n const el = this.$el.empty();\n const level = this.level + 1;\n this.inputName = 0;\n\n if (isUndefined(ItemsView)) {\n ItemsView = require('./ItemsView').default;\n }\n\n this.items = new ItemsView({\n ItemView: opt.ItemView,\n collection: model.get('components'),\n config: this.config,\n sorter: this.sorter,\n opened: this.opt.opened,\n parentView: this,\n parent: model,\n level\n });\n const children = this.items.render().$el;\n\n if (!this.config.showWrapper && level === 1) {\n el.append(children);\n } else {\n el.html(this.template(model));\n el.find(`.${this.clsChildren}`).append(children);\n }\n\n if (!model.get('draggable') || !this.config.sortable) {\n el.children(`.${this.clsMove}`).remove();\n }\n\n !vis && (this.className += ` ${pfx}hide`);\n hidden && (this.className += ` ${ppfx}hidden`);\n el.attr('class', this.className);\n this.updateOpening();\n this.updateStatus();\n this.updateVisibility();\n this.__render();\n this._rendered = 1;\n return this;\n },\n\n __render() {\n const { model, config, el } = this;\n const { onRender } = config;\n const opt = { component: model, el };\n onRender.bind(this)(opt);\n this.em.trigger('layer:render', opt);\n }\n});\n","export default {\n stylePrefix: '',\n\n // Specify the element to use as a container, string (query) or HTMLElement\n // With the empty value, nothing will be rendered\n appendTo: '',\n\n // Enable/Disable globally the possibility to sort layers\n sortable: 1,\n\n // Enable/Disable globally the possibility to hide layers\n hidable: 1,\n\n // Hide textnodes\n hideTextnode: 1,\n\n // Indicate a query string of the element to be selected as the root of layers.\n // By default the root is the wrapper\n root: '',\n\n // Indicates if the wrapper is visible in layers\n showWrapper: 1,\n\n // Show hovered components in canvas\n showHover: 1,\n\n // Scroll to selected component in Canvas when it's selected in Layers\n // true, false or `scrollIntoView`-like options,\n // `block: 'nearest'` avoids the issue of window scolling\n scrollCanvas: { behavior: 'smooth', block: 'nearest' },\n\n // Scroll to selected component in Layers when it's selected in Canvas\n // true, false or `scrollIntoView`-like options\n scrollLayers: { behavior: 'auto', block: 'nearest' },\n\n // Highlight when a layer component is hovered\n highlightHover: 1,\n\n /**\n * WARNING: Experimental option\n * A callback triggered once the component layer is initialized.\n * Useful to trigger updates on some component prop change.\n * @example\n * onInit({ component, render, listenTo }) {\n * listenTo(component, 'change:some-prop', render);\n * };\n */\n onInit: () => {},\n\n /**\n * WARNING: Experimental option\n * A callback triggered once the component layer is rendered.\n * A callback useful to update the layer DOM on some component change\n * @example\n * onRender({ component, el }) { // el is the DOM of the layer\n * if (component.get('some-prop')) {\n * // do changes using the `el` DOM\n * }\n * }\n */\n onRender: () => {},\n\n /**\n * Extend Layer view object (view/ItemView.js)\n * @example\n * extend: {\n * setName(name) {\n * // this.model is the component of the layer\n * this.model.set('another-prop-for-name', name);\n * },\n * },\n */\n extend: {}\n};\n","import defaults from './config/config';\nimport View from './view/ItemView';\nimport { isElement } from 'underscore';\n\nexport default () => {\n let em;\n let layers;\n let config = {};\n\n return {\n name: 'LayerManager',\n\n init(opts = {}) {\n config = { ...defaults, ...opts };\n config.stylePrefix = opts.pStylePrefix;\n em = config.em;\n return this;\n },\n\n getConfig() {\n return config;\n },\n\n onLoad() {\n em && em.on('component:selected', this.componentChanged);\n this.componentChanged();\n },\n\n postRender() {\n const elTo = config.appendTo;\n const root = config.root;\n root && this.setRoot(root);\n\n if (elTo) {\n const el = isElement(elTo) ? elTo : document.querySelector(elTo);\n el.appendChild(this.render());\n }\n },\n\n /**\n * Set new root for layers\n * @param {HTMLElement|Component|String} el Component to be set as the root\n * @return {self}\n */\n setRoot(el) {\n layers && layers.setRoot(el);\n return this;\n },\n\n /**\n * Get the root of layers\n * @return {Component}\n */\n getRoot() {\n return layers && layers.model;\n },\n\n /**\n * Return the view of layers\n * @return {View}\n */\n getAll() {\n return layers;\n },\n\n /**\n * Triggered when the selected component is changed\n * @private\n */\n componentChanged(selected, opts = {}) {\n if (opts.fromLayers) return;\n const opened = em.get('opened');\n const model = em.getSelected();\n const scroll = config.scrollLayers;\n let parent = model && model.collection ? model.collection.parent : null;\n for (let cid in opened) opened[cid].set('open', 0);\n\n while (parent) {\n parent.set('open', 1);\n opened[parent.cid] = parent;\n parent = parent.collection ? parent.collection.parent : null;\n }\n\n if (model && scroll) {\n const el = model.viewLayer && model.viewLayer.el;\n el && el.scrollIntoView(scroll);\n }\n },\n\n render() {\n const ItemView = View.extend(config.extend);\n layers && layers.remove();\n layers = new ItemView({\n ItemView,\n level: 0,\n config,\n opened: config.opened || {},\n model: em.get('DomComponents').getWrapper()\n });\n return layers.render().el;\n },\n\n destroy() {\n layers && layers.remove();\n [em, layers, config].forEach(i => (i = {}));\n }\n };\n};\n","// The initial version of this library was borrowed from https://github.com/madrobby/keymaster\n// and adapted to the GrapesJS's need\n\nvar k,\n _handlers = {},\n _mods = {\n 16: false,\n 18: false,\n 17: false,\n 91: false\n },\n _scope = 'all',\n // modifier keys\n _MODIFIERS = {\n '⇧': 16,\n shift: 16,\n '⌥': 18,\n alt: 18,\n option: 18,\n '⌃': 17,\n ctrl: 17,\n control: 17,\n '⌘': 91,\n command: 91\n },\n // special keys\n _MAP = {\n backspace: 8,\n tab: 9,\n clear: 12,\n enter: 13,\n return: 13,\n esc: 27,\n escape: 27,\n space: 32,\n left: 37,\n up: 38,\n right: 39,\n down: 40,\n del: 46,\n delete: 46,\n home: 36,\n end: 35,\n pageup: 33,\n pagedown: 34,\n ',': 188,\n '.': 190,\n '/': 191,\n '`': 192,\n '-': 189,\n '=': 187,\n ';': 186,\n \"'\": 222,\n '[': 219,\n ']': 221,\n '\\\\': 220\n },\n code = function(x) {\n return _MAP[x] || x.toUpperCase().charCodeAt(0);\n },\n _downKeys = [];\n\nfor (k = 1; k < 20; k++) _MAP['f' + k] = 111 + k;\n\n// IE doesn't support Array#indexOf, so have a simple replacement\nfunction index(array, item) {\n var i = array.length;\n while (i--) if (array[i] === item) return i;\n return -1;\n}\n\n// for comparing mods before unassignment\nfunction compareArray(a1, a2) {\n if (a1.length != a2.length) return false;\n for (var i = 0; i < a1.length; i++) {\n if (a1[i] !== a2[i]) return false;\n }\n return true;\n}\n\nvar modifierMap = {\n 16: 'shiftKey',\n 18: 'altKey',\n 17: 'ctrlKey',\n 91: 'metaKey'\n};\n\nfunction updateModifierKey(event) {\n for (k in _mods) _mods[k] = event[modifierMap[k]];\n}\n\n// handle keydown event\nfunction dispatch(event) {\n var key, handler, k, i, modifiersMatch, scope;\n key = event.keyCode;\n\n if (index(_downKeys, key) == -1) {\n _downKeys.push(key);\n }\n\n // if a modifier key, set the key. property to true and return\n if (key == 93 || key == 224) key = 91; // right command on webkit, command on Gecko\n if (key in _mods) {\n _mods[key] = true;\n // 'assignKey' from inside this closure is exported to window.key\n for (k in _MODIFIERS) if (_MODIFIERS[k] == key) assignKey[k] = true;\n return;\n }\n updateModifierKey(event);\n\n // see if we need to ignore the keypress (filter() can can be overridden)\n // by default ignore key presses if a select, textarea, or input is focused\n if (!assignKey.filter.call(this, event)) return;\n\n // abort if no potentially matching shortcuts found\n if (!(key in _handlers)) return;\n\n scope = getScope();\n\n // for each potential shortcut\n for (i = 0; i < _handlers[key].length; i++) {\n handler = _handlers[key][i];\n\n // see if it's in the current scope\n if (handler.scope == scope || handler.scope == 'all') {\n // check if modifiers match if any\n modifiersMatch = handler.mods.length > 0;\n for (k in _mods)\n if (\n (!_mods[k] && index(handler.mods, +k) > -1) ||\n (_mods[k] && index(handler.mods, +k) == -1)\n )\n modifiersMatch = false;\n // call the handler and stop the event if neccessary\n if (\n (handler.mods.length == 0 &&\n !_mods[16] &&\n !_mods[18] &&\n !_mods[17] &&\n !_mods[91]) ||\n modifiersMatch\n ) {\n if (handler.method(event, handler) === false) {\n if (event.preventDefault) event.preventDefault();\n else event.returnValue = false;\n if (event.stopPropagation) event.stopPropagation();\n if (event.cancelBubble) event.cancelBubble = true;\n }\n }\n }\n }\n}\n\n// unset modifier keys on keyup\nfunction clearModifier(event) {\n var key = event.keyCode,\n k,\n i = index(_downKeys, key);\n\n // remove key from _downKeys\n if (i >= 0) {\n _downKeys.splice(i, 1);\n }\n\n if (key == 93 || key == 224) key = 91;\n if (key in _mods) {\n _mods[key] = false;\n for (k in _MODIFIERS) if (_MODIFIERS[k] == key) assignKey[k] = false;\n }\n}\n\nfunction resetModifiers() {\n for (k in _mods) _mods[k] = false;\n for (k in _MODIFIERS) assignKey[k] = false;\n}\n\n// parse and assign shortcut\nfunction assignKey(key, scope, method) {\n var keys, mods;\n keys = getKeys(key);\n if (method === undefined) {\n method = scope;\n scope = 'all';\n }\n\n // for each shortcut\n for (var i = 0; i < keys.length; i++) {\n // set modifier keys if any\n mods = [];\n key = keys[i].split('+');\n if (key.length > 1) {\n mods = getMods(key);\n key = [key[key.length - 1]];\n }\n // convert to keycode and...\n key = key[0];\n key = code(key);\n // ...store handler\n if (!(key in _handlers)) _handlers[key] = [];\n _handlers[key].push({\n shortcut: keys[i],\n scope: scope,\n method: method,\n key: keys[i],\n mods: mods\n });\n }\n}\n\n// unbind all handlers for given key in current scope\nfunction unbindKey(key, scope) {\n var multipleKeys,\n keys,\n mods = [],\n i,\n j,\n obj;\n\n multipleKeys = getKeys(key);\n\n for (j = 0; j < multipleKeys.length; j++) {\n keys = multipleKeys[j].split('+');\n\n if (keys.length > 1) {\n mods = getMods(keys);\n }\n\n key = keys[keys.length - 1];\n key = code(key);\n\n if (scope === undefined) {\n scope = getScope();\n }\n if (!_handlers[key]) {\n return;\n }\n for (i = 0; i < _handlers[key].length; i++) {\n obj = _handlers[key][i];\n // only clear handlers if correct scope and mods match\n if (obj.scope === scope && compareArray(obj.mods, mods)) {\n _handlers[key][i] = {};\n }\n }\n }\n}\n\n// Returns true if the key with code 'keyCode' is currently down\n// Converts strings into key codes.\nfunction isPressed(keyCode) {\n if (typeof keyCode == 'string') {\n keyCode = code(keyCode);\n }\n return index(_downKeys, keyCode) != -1;\n}\n\nfunction getPressedKeyCodes() {\n return _downKeys.slice(0);\n}\n\nfunction filter(event) {\n var tagName = (event.target || event.srcElement).tagName;\n // ignore keypressed in any elements that support keyboard data input\n return !(tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA');\n}\n\n// initialize key. to false\nfor (k in _MODIFIERS) assignKey[k] = false;\n\n// set current scope (default 'all')\nfunction setScope(scope) {\n _scope = scope || 'all';\n}\n\nfunction getScope() {\n return _scope || 'all';\n}\n\n// delete all handlers for a given scope\nfunction deleteScope(scope) {\n var key, handlers, i;\n\n for (key in _handlers) {\n handlers = _handlers[key];\n for (i = 0; i < handlers.length; ) {\n if (handlers[i].scope === scope) handlers.splice(i, 1);\n else i++;\n }\n }\n}\n\n// abstract key logic for assign and unassign\nfunction getKeys(key) {\n var keys;\n key = key.replace(/\\s/g, '');\n keys = key.split(',');\n if (keys[keys.length - 1] == '') {\n keys[keys.length - 2] += ',';\n }\n return keys;\n}\n\n// abstract mods logic for assign and unassign\nfunction getMods(key) {\n var mods = key.slice(0, key.length - 1);\n for (var mi = 0; mi < mods.length; mi++) mods[mi] = _MODIFIERS[mods[mi]];\n return mods;\n}\n\n// cross-browser events\nfunction addEvent(object, event, method) {\n if (object.addEventListener) object.addEventListener(event, method, false);\n else if (object.attachEvent)\n object.attachEvent('on' + event, function() {\n method(window.event);\n });\n}\n\n// set window.key and window.key.set/get/deleteScope, and the default filter\nassignKey.setScope = setScope;\nassignKey.getScope = getScope;\nassignKey.deleteScope = deleteScope;\nassignKey.filter = filter;\nassignKey.isPressed = isPressed;\nassignKey.getPressedKeyCodes = getPressedKeyCodes;\nassignKey.unbind = unbindKey;\nassignKey.init = win => {\n // set the handlers globally on document\n // Passing _scope to a callback to ensure it remains the same by execution. Fixes #48\n addEvent(win.document, 'keydown', function(event) {\n dispatch(event);\n });\n addEvent(win.document, 'keyup', clearModifier);\n addEvent(win, 'focus', resetModifiers);\n};\n\nexport default assignKey;\n","/**\n * You can customize the initial state of the module from the editor initialization\n * ```js\n * const editor = grapesjs.init({\n * keymaps: {\n * // Object of keymaps\n * defaults: {\n * 'your-namespace:keymap-name' {\n * keys: '⌘+z, ctrl+z',\n * handler: 'some-command-id'\n * },\n * ...\n * }\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const keymaps = editor.Keymaps;\n * ```\n *\n * * [getConfig](#getconfig)\n * * [add](#add)\n * * [get](#get)\n * * [getAll](#getAll)\n * * [remove](#remove)\n * * [removeAll](#removeall)\n *\n * @module Keymaps\n */\n\nimport { isString } from 'underscore';\nimport { hasWin } from 'utils/mixins';\nimport keymaster from 'utils/keymaster';\n\nhasWin() && keymaster.init(window);\n\nexport default () => {\n let em;\n let config;\n const keymaps = {};\n const configDef = {\n defaults: {\n 'core:undo': {\n keys: '⌘+z, ctrl+z',\n handler: 'core:undo'\n },\n 'core:redo': {\n keys: '⌘+shift+z, ctrl+shift+z',\n handler: 'core:redo'\n },\n 'core:copy': {\n keys: '⌘+c, ctrl+c',\n handler: 'core:copy'\n },\n 'core:paste': {\n keys: '⌘+v, ctrl+v',\n handler: 'core:paste'\n },\n 'core:component-next': {\n keys: 's',\n handler: 'core:component-next'\n },\n 'core:component-prev': {\n keys: 'w',\n handler: 'core:component-prev'\n },\n 'core:component-enter': {\n keys: 'd',\n handler: 'core:component-enter'\n },\n 'core:component-exit': {\n keys: 'a',\n handler: 'core:component-exit'\n },\n 'core:component-delete': {\n keys: 'backspace, delete',\n handler: 'core:component-delete',\n opts: { prevent: 1 }\n }\n }\n };\n\n return {\n keymaster,\n\n name: 'Keymaps',\n\n /**\n * Get module configurations\n * @return {Object} Configuration object\n */\n getConfig() {\n return config;\n },\n\n /**\n * Initialize module\n * @param {Object} config Configurations\n * @private\n */\n init(opts = {}) {\n config = { ...configDef, ...opts };\n em = config.em;\n this.em = em;\n return this;\n },\n\n onLoad() {\n const defKeys = config.defaults;\n\n for (let id in defKeys) {\n const value = defKeys[id];\n this.add(id, value.keys, value.handler, value.opts || {});\n }\n },\n\n /**\n * Add new keymap\n * @param {string} id Keymap id\n * @param {string} keys Keymap keys, eg. `ctrl+a`, `⌘+z, ctrl+z`\n * @param {Function|string} handler Keymap handler, might be a function\n * @param {Object} [opts={}] Options\n * @return {Object} Added keymap\n * or just a command id as a string\n * @example\n * // 'ns' is just a custom namespace\n * keymaps.add('ns:my-keymap', '⌘+j, ⌘+u, ctrl+j, alt+u', editor => {\n * console.log('do stuff');\n * });\n * // or\n * keymaps.add('ns:my-keymap', '⌘+s, ctrl+s', 'some-gjs-command');\n *\n * // listen to events\n * editor.on('keymap:emit', (id, shortcut, e) => {\n * // ...\n * })\n */\n add(id, keys, handler, opts = {}) {\n const { em } = this;\n const cmd = em.get('Commands');\n const editor = em.getEditor();\n const canvas = em.get('Canvas');\n const keymap = { id, keys, handler };\n const pk = keymaps[id];\n pk && this.remove(id);\n keymaps[id] = keymap;\n keymaster(keys, (e, h) => {\n // It's safer putting handlers resolution inside the callback\n const opt = { event: e, h };\n handler = isString(handler) ? cmd.get(handler) : handler;\n const ableTorun = !em.isEditing() && !editor.Canvas.isInputFocused();\n if (ableTorun || opts.force) {\n opts.prevent && canvas.getCanvasView().preventDefault(e);\n typeof handler == 'object'\n ? cmd.runCommand(handler, opt)\n : handler(editor, 0, opt);\n const args = [id, h.shortcut, e];\n em.trigger('keymap:emit', ...args);\n em.trigger(`keymap:emit:${id}`, ...args);\n }\n });\n em.trigger('keymap:add', keymap);\n return keymap;\n },\n\n /**\n * Get the keymap by id\n * @param {string} id Keymap id\n * @return {Object} Keymap object\n * @example\n * keymaps.get('ns:my-keymap');\n * // -> {keys, handler};\n */\n get(id) {\n return keymaps[id];\n },\n\n /**\n * Get all keymaps\n * @return {Object}\n * @example\n * keymaps.getAll();\n * // -> {id1: {}, id2: {}};\n */\n getAll() {\n return keymaps;\n },\n\n /**\n * Remove the keymap by id\n * @param {string} id Keymap id\n * @return {Object} Removed keymap\n * @example\n * keymaps.remove('ns:my-keymap');\n * // -> {keys, handler};\n */\n remove(id) {\n const em = this.em;\n const keymap = this.get(id);\n\n if (keymap) {\n delete keymaps[id];\n keymap.keys.split(', ').forEach(k => keymaster.unbind(k.trim()));\n em && em.trigger('keymap:remove', keymap);\n return keymap;\n }\n },\n\n /**\n * Remove all binded keymaps\n * @return {this}\n */\n removeAll() {\n Object.keys(keymaps).forEach(keymap => this.remove(keymap));\n return this;\n },\n\n destroy() {\n this.removeAll();\n [em, config, keymaps].forEach(i => (i = {}));\n this.em = {};\n }\n };\n};\n","export default {\n stylePrefix: 'com-',\n\n // Default array of commands\n defaults: [],\n\n // If true, stateful commands (with `run` and `stop` methods) can't be runned multiple times.\n // So, if the command is already active, running it again will not execute the `run` method\n strict: 1\n};\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/commands/config/config.js)\n * ```js\n * const editor = grapesjs.init({\n * commands: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const commands = editor.Commands;\n * ```\n *\n * * [add](#add)\n * * [get](#get)\n * * [getAll](#getall)\n * * [extend](#extend)\n * * [has](#has)\n * * [run](#run)\n * * [stop](#stop)\n * * [isActive](#isactive)\n * * [getActive](#getactive)\n *\n * @module Commands\n */\n\nimport { isFunction, includes } from 'underscore';\nimport CommandAbstract from './view/CommandAbstract';\nimport defaults from './config/config';\nimport { eventDrag } from 'dom_components/model/Component';\n\nconst commandsDef = [\n ['preview', 'Preview', 'preview'],\n ['resize', 'Resize', 'resize'],\n ['fullscreen', 'Fullscreen', 'fullscreen'],\n ['copy', 'CopyComponent'],\n ['paste', 'PasteComponent'],\n ['canvas-move', 'CanvasMove'],\n ['canvas-clear', 'CanvasClear'],\n ['open-code', 'ExportTemplate', 'export-template'],\n ['open-layers', 'OpenLayers', 'open-layers'],\n ['open-styles', 'OpenStyleManager', 'open-sm'],\n ['open-traits', 'OpenTraitManager', 'open-tm'],\n ['open-blocks', 'OpenBlocks', 'open-blocks'],\n ['open-assets', 'OpenAssets', 'open-assets'],\n ['component-select', 'SelectComponent', 'select-comp'],\n ['component-outline', 'SwitchVisibility', 'sw-visibility'],\n ['component-offset', 'ShowOffset', 'show-offset'],\n ['component-move', 'MoveComponent', 'move-comp'],\n ['component-next', 'ComponentNext'],\n ['component-prev', 'ComponentPrev'],\n ['component-enter', 'ComponentEnter'],\n ['component-exit', 'ComponentExit', 'select-parent'],\n ['component-delete', 'ComponentDelete'],\n ['component-style-clear', 'ComponentStyleClear'],\n ['component-drag', 'ComponentDrag']\n];\n\nexport default () => {\n let em;\n let c = {};\n const commands = {};\n const defaultCommands = {};\n const active = {};\n\n // Need it here as it would be used below\n const add = function(id, obj) {\n if (isFunction(obj)) obj = { run: obj };\n if (!obj.stop) obj.noStop = 1;\n delete obj.initialize;\n obj.id = id;\n commands[id] = CommandAbstract.extend(obj);\n return this;\n };\n\n return {\n CommandAbstract,\n\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n name: 'Commands',\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @private\n */\n init(config = {}) {\n c = {\n ...defaults,\n ...config\n };\n em = c.em;\n const ppfx = c.pStylePrefix;\n if (ppfx) c.stylePrefix = ppfx + c.stylePrefix;\n\n // Load commands passed via configuration\n Object.keys(c.defaults).forEach(k => {\n const obj = c.defaults[k];\n if (obj.id) this.add(obj.id, obj);\n });\n\n defaultCommands['tlb-delete'] = {\n run(ed) {\n return ed.runCommand('core:component-delete');\n }\n };\n\n defaultCommands['tlb-clone'] = {\n run(ed) {\n ed.runCommand('core:copy');\n ed.runCommand('core:paste');\n }\n };\n\n defaultCommands['tlb-move'] = {\n run(ed, sender, opts = {}) {\n let dragger;\n const em = ed.getModel();\n const event = opts && opts.event;\n const { target } = opts;\n const sel = target || ed.getSelected();\n const selAll = target ? [target] : [...ed.getSelectedAll()];\n const nativeDrag = event && event.type == 'dragstart';\n const defComOptions = { preserveSelected: 1 };\n const modes = ['absolute', 'translate'];\n\n if (!sel || !sel.get('draggable')) {\n return em.logWarning('The element is not draggable');\n }\n\n const mode = sel.get('dmode') || em.get('dmode');\n const hideTlb = () => em.stopDefault(defComOptions);\n const altMode = includes(modes, mode);\n selAll.forEach(sel => sel.trigger('disable'));\n\n // Without setTimeout the ghost image disappears\n nativeDrag ? setTimeout(hideTlb, 0) : hideTlb();\n\n const onStart = data => {\n em.trigger(`${eventDrag}:start`, data);\n };\n const onDrag = data => {\n em.trigger(eventDrag, data);\n };\n const onEnd = (e, opts, data) => {\n selAll.forEach(sel => sel.set('status', 'selected'));\n ed.select(selAll);\n sel.emitUpdate();\n em.trigger(`${eventDrag}:end`, data);\n\n // Defer selectComponent in order to prevent canvas \"freeze\" #2692\n setTimeout(() => em.runDefault(defComOptions));\n\n // Dirty patch to prevent parent selection on drop\n (altMode || data.cancelled) && em.set('_cmpDrag', 1);\n };\n\n if (altMode) {\n // TODO move grabbing func in editor/canvas from the Sorter\n dragger = ed.runCommand('core:component-drag', {\n guidesInfo: 1,\n mode,\n target: sel,\n onStart,\n onDrag,\n onEnd,\n event\n });\n } else {\n if (nativeDrag) {\n event.dataTransfer.setDragImage(sel.view.el, 0, 0);\n //sel.set('status', 'freezed');\n }\n\n const cmdMove = ed.Commands.get('move-comp');\n cmdMove.onStart = onStart;\n cmdMove.onDrag = onDrag;\n cmdMove.onEndMoveFromModel = onEnd;\n cmdMove.initSorterFromModels(selAll);\n }\n\n selAll.forEach(sel => sel.set('status', 'freezed-selected'));\n }\n };\n\n // Core commands\n defaultCommands['core:undo'] = e => e.UndoManager.undo();\n defaultCommands['core:redo'] = e => e.UndoManager.redo();\n commandsDef.forEach(item => {\n const oldCmd = item[2];\n const cmd = require(`./view/${item[1]}`).default;\n const cmdName = `core:${item[0]}`;\n defaultCommands[cmdName] = cmd;\n if (oldCmd) {\n defaultCommands[oldCmd] = cmd;\n // Propogate old commands (can be removed once we stop to call old commands)\n ['run', 'stop'].forEach(name => {\n em.on(`${name}:${oldCmd}`, (...args) =>\n em.trigger(`${name}:${cmdName}`, ...args)\n );\n });\n }\n });\n\n if (c.em) c.model = c.em.get('Canvas');\n\n this.loadDefaultCommands();\n\n return this;\n },\n\n /**\n * Add new command to the collection\n * @param\t{string} id Command's ID\n * @param\t{Object|Function} command Object representing your command,\n * By passing just a function it's intended as a stateless command\n * (just like passing an object with only `run` method).\n * @return {this}\n * @example\n * commands.add('myCommand', {\n * \trun(editor, sender) {\n * \t\talert('Hello world!');\n * \t},\n * \tstop(editor, sender) {\n * \t},\n * });\n * // As a function\n * commands.add('myCommand2', editor => { ... });\n * */\n add,\n\n /**\n * Get command by ID\n * @param\t{string}\tid Command's ID\n * @return {Object} Object representing the command\n * @example\n * var myCommand = commands.get('myCommand');\n * myCommand.run();\n * */\n get(id) {\n let el = commands[id];\n\n if (isFunction(el)) {\n el = new el(c);\n commands[id] = el;\n } else if (!el) {\n em.logWarning(`'${id}' command not found`);\n }\n\n return el;\n },\n\n /**\n * Extend the command. The command to extend should be defined as an object\n * @param\t{string}\tid Command's ID\n * @param {Object} Object with the new command functions\n * @returns {this}\n * @example\n * commands.extend('old-command', {\n * someInnerFunction() {\n * // ...\n * }\n * });\n * */\n extend(id, cmd = {}) {\n const command = this.get(id);\n if (command) {\n const cmdObj = {\n ...command.constructor.prototype,\n ...cmd\n };\n this.add(id, cmdObj);\n // Extend also old name commands if exist\n const oldCmd = commandsDef.filter(\n cmd => `core:${cmd[0]}` === id && cmd[2]\n )[0];\n oldCmd && this.add(oldCmd[2], cmdObj);\n }\n return this;\n },\n\n /**\n * Check if command exists\n * @param\t{string}\tid Command's ID\n * @return {Boolean}\n * */\n has(id) {\n return !!commands[id];\n },\n\n /**\n * Get an object containing all the commands\n * @return {Object}\n */\n getAll() {\n return commands;\n },\n\n /**\n * Execute the command\n * @param {String} id Command ID\n * @param {Object} [options={}] Options\n * @return {*} The return is defined by the command\n * @example\n * commands.run('myCommand', { someOption: 1 });\n */\n run(id, options = {}) {\n return this.runCommand(this.get(id), options);\n },\n\n /**\n * Stop the command\n * @param {String} id Command ID\n * @param {Object} [options={}] Options\n * @return {*} The return is defined by the command\n * @example\n * commands.stop('myCommand', { someOption: 1 });\n */\n stop(id, options = {}) {\n return this.stopCommand(this.get(id), options);\n },\n\n /**\n * Check if the command is active. You activate commands with `run`\n * and disable them with `stop`. If the command was created without `stop`\n * method it can't be registered as active\n * @param {String} id Command id\n * @return {Boolean}\n * @example\n * const cId = 'some-command';\n * commands.run(cId);\n * commands.isActive(cId);\n * // -> true\n * commands.stop(cId);\n * commands.isActive(cId);\n * // -> false\n */\n isActive(id) {\n return this.getActive().hasOwnProperty(id);\n },\n\n /**\n * Get all active commands\n * @return {Object}\n * @example\n * console.log(commands.getActive());\n * // -> { someCommand: itsLastReturn, anotherOne: ... };\n */\n getActive() {\n return active;\n },\n\n /**\n * Load default commands\n * @return {this}\n * @private\n * */\n loadDefaultCommands() {\n for (var id in defaultCommands) {\n this.add(id, defaultCommands[id]);\n }\n\n return this;\n },\n\n /**\n * Run command via its object\n * @param {Object} command\n * @param {Object} options\n * @return {*} Result of the command\n * @private\n */\n runCommand(command, options = {}) {\n let result;\n\n if (command && command.run) {\n const id = command.id;\n const editor = em.get('Editor');\n\n if (!this.isActive(id) || options.force || !c.strict) {\n result = editor && command.callRun(editor, options);\n if (id && command.stop && !command.noStop && !options.abort) {\n active[id] = result;\n }\n }\n }\n\n return result;\n },\n\n /**\n * Stop the command\n * @param {Object} command\n * @param {Object} options\n * @return {*} Result of the command\n * @private\n */\n stopCommand(command, options = {}) {\n let result;\n\n if (command && command.run) {\n const id = command.id;\n const editor = em.get('Editor');\n\n if (this.isActive(id) || options.force || !c.strict) {\n if (id) delete active[id];\n result = command.callStop(editor, options);\n }\n }\n\n return result;\n },\n\n /**\n * Create anonymous Command instance\n * @param {Object} command Command object\n * @return {Command}\n * @private\n * */\n create(command) {\n if (!command.stop) command.noStop = 1;\n const cmd = CommandAbstract.extend(command);\n return new cmd(c);\n },\n\n destroy() {\n [em, c, commands, defaultCommands, active].forEach(i => (i = {}));\n }\n };\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index a758fd111..1e34bed15 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "grapesjs", "description": "Free and Open Source Web Builder Framework", - "version": "0.17.28", + "version": "0.17.29", "author": "Artur Arseniev", "license": "BSD-3-Clause", "homepage": "http://grapesjs.com", From 3f02dfcebc1747672733e14a4c5c61c835e8aa2a Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 9 Nov 2021 15:35:33 +0100 Subject: [PATCH 011/313] Update PropertyRadio --- .eslintrc | 2 +- src/i18n/locale/en.js | 7 ++ src/style_manager/model/PropertyRadio.js | 80 ++++++++++++++------- src/style_manager/view/PropertyRadioView.js | 29 ++++---- 4 files changed, 77 insertions(+), 41 deletions(-) diff --git a/.eslintrc b/.eslintrc index d00afacfb..534a1109a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -4,7 +4,7 @@ "node": true }, "parserOptions": { - "ecmaVersion": 2018, + "ecmaVersion": 2020, "sourceType": "module" }, "rules": { diff --git a/src/i18n/locale/en.js b/src/i18n/locale/en.js index d06c799f2..0e99bd056 100644 --- a/src/i18n/locale/en.js +++ b/src/i18n/locale/en.js @@ -86,6 +86,13 @@ export default { properties: { // float: 'Float', } + // Translate options in style properties + // options: { + // float: { // Id of the property + // ... + // left: 'Left', // {option id}: {Option label} + // } + // } }, traitManager: { empty: 'Select an element before using Trait Manager', diff --git a/src/style_manager/model/PropertyRadio.js b/src/style_manager/model/PropertyRadio.js index c99414229..5b3099578 100644 --- a/src/style_manager/model/PropertyRadio.js +++ b/src/style_manager/model/PropertyRadio.js @@ -1,37 +1,69 @@ import Property from './Property'; -export default Property.extend({ - defaults: () => ({ - ...Property.prototype.defaults, - // Array of options, eg. [{name: 'Label ', value: '100'}] - options: [], - full: 1 - }), - - initialize(...args) { - Property.prototype.initialize.apply(this, args); - this.listenTo(this, 'change:options', this.onOptionChange); - }, - - onOptionChange() { - this.set('list', this.get('options')); - }, +export default class PropertyRadio extends Property { + defaults() { + return { + ...Property.prototype.defaults, + options: [], // Array of options, eg. [{ id: '100', label: 'Set 100' }] + full: 1 + }; + } + /** + * Get available options. + * @returns {Array} Array of options + */ getOptions() { + // support old list property const { options, list } = this.attributes; return options && options.length ? options : list; - }, + } - setOptions(opts = []) { - this.set('options', opts); + /** + * Update options. + * @param {Array} value Array of options, eg. `[{ id: 'val-1', label: 'Value 1' }]` + */ + setOptions(value = []) { + this.set('options', value); return this; - }, + } - addOption(opt) { - if (opt) { + /** + * Add new option. + * @param {Object} value Option object, eg. `{ id: 'val-1', label: 'Value 1' }` + */ + addOption(value) { + if (value) { const opts = this.getOptions(); - this.setOptions([...opts, opt]); + this.setOptions([...opts, value]); } return this; } -}); + + /** + * Get option label. + * @param {String} id Option id + * @param {Object} [opts={}] Options + * @param {Boolean} [opts.locale=true] Use the locale string from i18n module + * @returns {String} Option label + */ + getOptionLabel(id, opts = {}) { + const { locale = true } = opts; + const options = this.getOptions(); + const option = options.filter(o => o.id === id || o.value === id)[0] || {}; + const label = option.label || option.name || id; + const propId = this.getId(); + return ( + (locale && this.em?.t(`styleManager.options.${propId}.${id}`)) || label + ); + } + + initialize(...args) { + Property.prototype.initialize.apply(this, args); + this.listenTo(this, 'change:options', this.__onOptionChange); + } + + __onOptionChange() { + this.set('list', this.get('options')); + } +} diff --git a/src/style_manager/view/PropertyRadioView.js b/src/style_manager/view/PropertyRadioView.js index 0958b4ace..90961a28c 100644 --- a/src/style_manager/view/PropertyRadioView.js +++ b/src/style_manager/view/PropertyRadioView.js @@ -2,7 +2,6 @@ import PropertyView from './PropertyView'; export default PropertyView.extend({ templateInput() { - const pfx = this.pfx; const ppfx = this.ppfx; return `
@@ -11,32 +10,30 @@ export default PropertyView.extend({ }, onRender() { - const pfx = this.pfx; - const ppfx = this.ppfx; + const { pfx, ppfx, model } = this; const itemCls = `${ppfx}radio-item-label`; - const model = this.model; const prop = model.get('property'); const options = model.get('list') || model.get('options') || []; - const { cid } = model; const clsInput = `${pfx}radio ${pfx}radio-${prop}`; + const { cid } = model; if (!this.input) { if (options && options.length) { let inputStr = ''; - options.forEach(el => { - let cl = el.className ? `${el.className} ${pfx}icon ${itemCls}` : ''; - let id = `${prop}-${el.value}-${cid}`; - let labelTxt = el.name || el.value; - let titleAttr = el.title ? `title="${el.title}"` : ''; + options.forEach(opt => { + const cls = opt.className + ? `${opt.className} ${pfx}icon ${itemCls}` + : ''; + const id = opt.id || opt.value; + const elId = `${prop}-${id}-${cid}`; + const labelEl = cls ? '' : model.getOptionLabel(id); + const titleAttr = opt.title ? `title="${opt.title}"` : ''; inputStr += `
- - + +
`; }); From da5b5fda1da28477041bdb52ad2a0c88a4a99955 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 9 Nov 2021 15:39:10 +0100 Subject: [PATCH 012/313] Add getOptionId --- src/style_manager/model/PropertyRadio.js | 11 ++++++++++- src/style_manager/view/PropertyRadioView.js | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/style_manager/model/PropertyRadio.js b/src/style_manager/model/PropertyRadio.js index 5b3099578..a89f4f065 100644 --- a/src/style_manager/model/PropertyRadio.js +++ b/src/style_manager/model/PropertyRadio.js @@ -40,6 +40,15 @@ export default class PropertyRadio extends Property { return this; } + /** + * Get the option id from the option object. + * @param {Object} option Option object + * @returns {String} Option id + */ + getOptionId(option) { + return option.id || option.value; + } + /** * Get option label. * @param {String} id Option id @@ -50,7 +59,7 @@ export default class PropertyRadio extends Property { getOptionLabel(id, opts = {}) { const { locale = true } = opts; const options = this.getOptions(); - const option = options.filter(o => o.id === id || o.value === id)[0] || {}; + const option = options.filter(o => this.getOptionId(o) === id)[0] || {}; const label = option.label || option.name || id; const propId = this.getId(); return ( diff --git a/src/style_manager/view/PropertyRadioView.js b/src/style_manager/view/PropertyRadioView.js index 90961a28c..0bf6bc49c 100644 --- a/src/style_manager/view/PropertyRadioView.js +++ b/src/style_manager/view/PropertyRadioView.js @@ -25,7 +25,7 @@ export default PropertyView.extend({ const cls = opt.className ? `${opt.className} ${pfx}icon ${itemCls}` : ''; - const id = opt.id || opt.value; + const id = model.getOptionId(opt); const elId = `${prop}-${id}-${cid}`; const labelEl = cls ? '' : model.getOptionLabel(id); const titleAttr = opt.title ? `title="${opt.title}"` : ''; From 17faf095e9e7aead575b873050bbbe633aa70ee3 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 9 Nov 2021 15:44:35 +0100 Subject: [PATCH 013/313] Update getLabel with locale option --- src/style_manager/model/Property.js | 9 +++++++-- src/style_manager/view/PropertyView.js | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index ed66704e3..9ade14085 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -67,10 +67,15 @@ export default class Property extends Model { /** * Get property label. + * @param {Object} [opts={}] Options + * @param {Boolean} [opts.locale=true] Use the locale string from i18n module * @returns {String} */ - getLabel() { - return this.get('name'); + getLabel(opts = {}) { + const { locale = true } = opts; + const id = this.getId(); + const name = this.get('name'); + return (locale && this.em?.t(`styleManager.properties.${id}`)) || name; } /** diff --git a/src/style_manager/view/PropertyView.js b/src/style_manager/view/PropertyView.js index 560d97bcd..0a0f20be9 100644 --- a/src/style_manager/view/PropertyView.js +++ b/src/style_manager/view/PropertyView.js @@ -16,10 +16,10 @@ export default Backbone.View.extend({ }, templateLabel(model) { - const { pfx, em } = this; + const { pfx } = this; const { parent } = model; - const { icon = '', info = '', id, name } = model.attributes; - const label = (em && em.t(`styleManager.properties.${id}`)) || name; + const { icon = '', info = '' } = model.attributes; + const label = model.getLabel(); return ` From 83159de8c2118888cbb8613ca7f94567642c168b Mon Sep 17 00:00:00 2001 From: ymx Date: Wed, 10 Nov 2021 10:30:02 +0800 Subject: [PATCH 014/313] fix assert upload issue --- src/asset_manager/view/FileUploader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/asset_manager/view/FileUploader.js b/src/asset_manager/view/FileUploader.js index 694eb49c7..1a60ff27b 100644 --- a/src/asset_manager/view/FileUploader.js +++ b/src/asset_manager/view/FileUploader.js @@ -26,7 +26,7 @@ export default Backbone.View.extend( initialize(opts = {}) { this.options = opts; const c = opts.config || {}; - this.module = c.module; + this.module = opts.module; this.config = c; this.em = this.config.em; this.pfx = c.stylePrefix || ''; From d3752d979aec2fa0b1ea2ba46d52ea4b35d46d4d Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 11 Nov 2021 19:04:38 +0100 Subject: [PATCH 015/313] Add clear method to Property --- src/style_manager/model/Property.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 9ade14085..d008ec34f 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -84,7 +84,14 @@ export default class Property extends Model { */ getValue() { const val = this.get('value'); - return isUndefined(val) ? this.getDefaultValue() : val; + return isUndefined(val) || val === '' ? this.getDefaultValue() : val; + } + + /** + * Clear value + */ + clear() { + this._up(this.__getClearProps()); } upValue(value, opts) { @@ -224,7 +231,8 @@ export default class Property extends Model { * @private */ getDefaultValue() { - return this.get('defaults'); + const def = this.get('default'); + return !isUndefined(def) ? def : this.get('defaults'); } /** From 83fa7205bc39681ca209b3d1c1f4ef390434d24a Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 11 Nov 2021 19:06:30 +0100 Subject: [PATCH 016/313] Add hasValue method to Property --- src/style_manager/model/Property.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index d008ec34f..78dd71eaf 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -84,7 +84,16 @@ export default class Property extends Model { */ getValue() { const val = this.get('value'); - return isUndefined(val) || val === '' ? this.getDefaultValue() : val; + return !this.hasValue() ? this.getDefaultValue() : val; + } + + /** + * Check if the property has value + * @returns {Boolean} + */ + hasValue() { + const val = this.get('value'); + return !isUndefined(val) && val !== ''; } /** From 843a161de5a7319d792ec42eff1758bc1af23f78 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 12 Nov 2021 13:06:52 +0100 Subject: [PATCH 017/313] Propagate property update --- src/style_manager/index.js | 26 ++++++++++++++++++++------ src/style_manager/model/Property.js | 6 +++--- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 5d11c66a1..06269eda9 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -53,6 +53,11 @@ import Properties from './model/Properties'; import PropertyFactory from './model/PropertyFactory'; import SectorsView from './view/SectorsView'; +export const evAll = 'style'; +export const evPfx = `${evAll}:`; +export const evPropUp = `${evPfx}property:update`; +export const evCustom = `${evPfx}custom`; + export default () => { var c = {}; let properties; @@ -65,11 +70,12 @@ export default () => { PropertyFactory: PropertyFactory(), - /** - * Name of the module - * @type {String} - * @private - */ + events: { + all: evAll, + propertyUpdate: evPropUp, + custom: evCustom + }, + name: 'StyleManager', /** @@ -101,13 +107,21 @@ export default () => { toListen, debounce((...args) => { this.select(em.getSelectedAll()); - em.trigger('style:custom'); + this.__trgCustom(); }) ); return this; }, + __trgCustom() { + this.em.trigger(this.events.custom); + }, + + __trgEv(event, ...data) { + this.em.trigger(event, ...data); + }, + onLoad() { // Use silent as sectors' view will be created and rendered on StyleManager.render sectors.add(c.sectors, { silent: true }); diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 78dd71eaf..61e02b61a 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -23,13 +23,13 @@ export default class Property extends Model { const name = this.getName(); const value = this.getFullValue(); - const changed = this.changedAttributes(); - const previous = keys(changed).reduce((a, i) => { + const to = this.changedAttributes(); + const from = keys(to).reduce((a, i) => { a[i] = this.previous(i); return a; }, {}); - console.log('Update targets', { name, value, changed, previous, opts }); + sm.__trgEv(sm.events.propertyUpdate, { property: this, from, to }); !opts.__up && sm.addStyleTargets({ [name]: value }); } From 86cc86f90449033bbb0fc1239a3ff95a9d0de349 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 12 Nov 2021 13:22:55 +0100 Subject: [PATCH 018/313] Update Property --- src/style_manager/model/Property.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 61e02b61a..1b14934b8 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -82,9 +82,10 @@ export default class Property extends Model { * Get property value. * @returns {String} */ - getValue() { + getValue(opts = {}) { + const { noDefault } = opts; const val = this.get('value'); - return !this.hasValue() ? this.getDefaultValue() : val; + return !this.hasValue() && !noDefault ? this.getDefaultValue() : val; } /** @@ -105,7 +106,9 @@ export default class Property extends Model { upValue(value, opts) { const parsed = - value === null ? this.__getClearProps() : this.parseValue(value); + value === null || value === '' + ? this.__getClearProps() + : this.parseValue(value); return this._up(parsed, opts); } From 1c69d15e41a5967d96a5120c32f7efbdd40be242 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sun, 14 Nov 2021 15:28:04 +0100 Subject: [PATCH 019/313] Add onBeforeStyle option to CssComposer --- src/css_composer/config/config.js | 17 ++++++++++++++++- src/domain_abstract/model/Styleable.js | 22 +++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/css_composer/config/config.js b/src/css_composer/config/config.js index f5a8839d4..568ff190d 100644 --- a/src/css_composer/config/config.js +++ b/src/css_composer/config/config.js @@ -3,5 +3,20 @@ export default { stylePrefix: 'css-', // Default CSS style - rules: [] + rules: [], + + /** + * Adjust style object before creation/update. + * @example + * onBeforeStyle(style) { + * const padValue = style.padding; + * if (padValue === '10px') { + * delete style.padding; + * style['padding-top'] = padValue; + * // ... + * } + * return style; + * } + */ + onBeforeStyle: null }; diff --git a/src/domain_abstract/model/Styleable.js b/src/domain_abstract/model/Styleable.js index a67554e21..25dbaf77a 100644 --- a/src/domain_abstract/model/Styleable.js +++ b/src/domain_abstract/model/Styleable.js @@ -1,4 +1,4 @@ -import { isString, isArray, keys } from 'underscore'; +import { isString, isArray, keys, isUndefined } from 'underscore'; import { shallowDiff } from 'utils/mixins'; import ParserHtml from 'parser/model/ParserHtml'; @@ -113,5 +113,25 @@ export default { return this.selectorsToString ? this.selectorsToString() : this.getSelectors().getFullString(); + }, + + _validate(attr, opts) { + const { style } = attr; + const em = this.em || opts.em; + const onBeforeStyle = em?.get('CssComposer')?.getConfig().onBeforeStyle; + + if (style && onBeforeStyle) { + const newStyle = onBeforeStyle({ ...style }); + newStyle && + keys(style).map(prop => { + if (isUndefined(newStyle[prop])) delete attr.style[prop]; + }); + newStyle && + keys(newStyle).map(prop => { + attr.style[prop] = newStyle[prop]; + }); + } + + return true; } }; From 9b57a4452b0b8ea1447f6334b0a072999a1d0cc5 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sun, 14 Nov 2021 19:20:34 +0100 Subject: [PATCH 020/313] Add parent target to properties --- src/style_manager/index.js | 29 +++++++++++++++++++++++++++-- src/style_manager/model/Property.js | 8 ++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 06269eda9..439d9db0c 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -58,6 +58,8 @@ export const evPfx = `${evAll}:`; export const evPropUp = `${evPfx}property:update`; export const evCustom = `${evPfx}custom`; +const propDef = value => value || value === 0; + export default () => { var c = {}; let properties; @@ -495,10 +497,33 @@ export default () => { // Update all property values if (lastTarget && em.getConfig('customUI')) { const style = lastTarget.getStyle(); + const parentStyles = lastTargetParents.map(p => ({ + target: p, + style: p.getStyle() + })); + sectors.map(sector => { sector.getProperties().map(prop => { - const value = style[prop.getName()]; - prop.upValue(isUndefined(value) ? null : value, { __up: true }); + const name = prop.getName(); + const value = style[name]; + const hasVal = propDef(value); + let newValue = hasVal ? value : null; + let parentTarget = null; + + if (!hasVal) { + newValue = null; + const parentItem = parentStyles.filter(p => + propDef(p.style[name]) + )[0]; + + if (parentItem) { + newValue = parentItem.style[name]; + parentTarget = parentItem.target; + } + } + + prop.__setParentTarget(parentTarget); + prop.upValue(newValue, { __up: true }); }); }); } diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 1b14934b8..a6f80b3ee 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -276,6 +276,14 @@ export default class Property extends Model { return value || ''; } + + __setParentTarget(value) { + this.__parentTarget = value; + } + + getParentTarget() { + return this.__parentTarget || null; + } } Property.callParentInit = function(property, ctx, props, opts = {}) { From b4799697441bf790a831640f0adb9f9b3668226e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 15 Nov 2021 14:52:09 +0100 Subject: [PATCH 021/313] Add `CssRule.getDevice` method. --- src/code_manager/model/CssGenerator.js | 5 +++++ src/css_composer/model/CssRule.js | 24 ++++++++++++++++++++++++ src/device_manager/model/Device.js | 8 ++++++++ 3 files changed, 37 insertions(+) diff --git a/src/code_manager/model/CssGenerator.js b/src/code_manager/model/CssGenerator.js index bcc6743f8..b801488e3 100644 --- a/src/code_manager/model/CssGenerator.js +++ b/src/code_manager/model/CssGenerator.js @@ -3,6 +3,11 @@ import { bindAll, isUndefined, each } from 'underscore'; const maxValue = Number.MAX_VALUE; +export const getMediaLength = mediaQuery => { + const length = /(-?\d*\.?\d+)\w{0,}/.exec(mediaQuery); + return !length ? '' : length[0]; +}; + export default Backbone.Model.extend({ initialize() { bindAll(this, 'sortRules'); diff --git a/src/css_composer/model/CssRule.js b/src/css_composer/model/CssRule.js index 4941a2ca6..a4a4b5d85 100644 --- a/src/css_composer/model/CssRule.js +++ b/src/css_composer/model/CssRule.js @@ -2,6 +2,7 @@ import { Model } from 'backbone'; import Styleable from 'domain_abstract/model/Styleable'; import { isEmpty, forEach, isString, isArray } from 'underscore'; import Selectors from 'selector_manager/model/Selectors'; +import { getMediaLength } from 'code_manager/model/CssGenerator'; import { isEmptyObj, hasWin } from 'utils/mixins'; const { CSS } = hasWin() ? window : {}; @@ -17,6 +18,8 @@ const { CSS } = hasWin() ? window : {}; * @property {String} [state=''] State of the rule, eg: `hover`, `focused` * @property {Boolean|Array} [important=false] If true, sets `!important` on all properties. You can also pass an array to specify properties on which use important * @property {Boolean} [stylable=true] Indicates if the rule is stylable from the editor + * + * [Device]: device.html */ export default class CssRule extends Model.extend(Styleable) { defaults() { @@ -149,6 +152,27 @@ export default class CssRule extends Model.extend(Styleable) { return result; } + /** + * Get the Device the rule is related to. + * @returns {[Device]|null} + * @example + * const device = rule.getDevice(); + * console.log(device?.getName()); + */ + getDevice() { + const { em } = this; + const { atRuleType, mediaText } = this.attributes; + const devices = em?.get('DeviceManager').getDevices() || []; + const deviceDefault = devices.filter(d => d.getWidthMedia() === '')[0]; + if (atRuleType !== 'media' || !mediaText) { + return deviceDefault || null; + } + return ( + devices.filter(d => d.getWidthMedia() === getMediaLength(mediaText))[0] || + null + ); + } + /** * Return the CSS string of the rule * @param {Object} [opts={}] Options (same as in `getDeclaration`) diff --git a/src/device_manager/model/Device.js b/src/device_manager/model/Device.js index 0fc2aa7ce..662292676 100644 --- a/src/device_manager/model/Device.js +++ b/src/device_manager/model/Device.js @@ -34,4 +34,12 @@ export default class Device extends Model { const noUnit = (parseFloat(pr) || 0).toString() === pr.toString(); noUnit && this.set(prop, `${pr}px`); } + + getName() { + return this.get('name') || this.get('id'); + } + + getWidthMedia() { + return this.get('widthMedia') || ''; + } } From 6b8fe249d8e8bc0fcd921572b65989e747e9ac93 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 15 Nov 2021 14:54:52 +0100 Subject: [PATCH 022/313] Trigger custom event on device change in Sector Manager --- src/selector_manager/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/selector_manager/index.js b/src/selector_manager/index.js index 221c5c6ab..9768096da 100644 --- a/src/selector_manager/index.js +++ b/src/selector_manager/index.js @@ -145,7 +145,7 @@ export default () => { em.trigger('selector:type', value) ); const listenTo = - 'component:toggled component:update:classes styleManager:update selector:state selector:type'; + 'component:toggled component:update:classes change:device styleManager:update selector:state selector:type'; this.model.listenTo(em, listenTo, () => this.__update()); return this; From 8e79759740d4a4fe06e670667305baa317b62d89 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 15 Nov 2021 15:05:39 +0100 Subject: [PATCH 023/313] Add `CssRule.getState` method --- src/css_composer/model/CssRule.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/css_composer/model/CssRule.js b/src/css_composer/model/CssRule.js index a4a4b5d85..ea8fcd43e 100644 --- a/src/css_composer/model/CssRule.js +++ b/src/css_composer/model/CssRule.js @@ -20,6 +20,7 @@ const { CSS } = hasWin() ? window : {}; * @property {Boolean} [stylable=true] Indicates if the rule is stylable from the editor * * [Device]: device.html + * [State]: state.html */ export default class CssRule extends Model.extend(Styleable) { defaults() { @@ -173,6 +174,20 @@ export default class CssRule extends Model.extend(Styleable) { ); } + /** + * Get the State the rule is related to. + * @returns {[State]|null} + * @example + * const state = rule.getState(); + * console.log(state?.getLabel()); + */ + getState() { + const { em } = this; + const stateValue = this.get('state'); + const states = em.get('SelectorManager').getStates() || []; + return states.filter(s => s.getName() === stateValue)[0] || null; + } + /** * Return the CSS string of the rule * @param {Object} [opts={}] Options (same as in `getDeclaration`) From f7b58ba5ae513b783bfc44e0e111a5af7fd43874 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 15 Nov 2021 15:20:14 +0100 Subject: [PATCH 024/313] Pass options in getSelectorsString --- src/domain_abstract/model/Styleable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/domain_abstract/model/Styleable.js b/src/domain_abstract/model/Styleable.js index 25dbaf77a..fc12aabc2 100644 --- a/src/domain_abstract/model/Styleable.js +++ b/src/domain_abstract/model/Styleable.js @@ -109,9 +109,9 @@ export default { return this.get('selectors') || this.get('classes'); }, - getSelectorsString() { + getSelectorsString(opts) { return this.selectorsToString - ? this.selectorsToString() + ? this.selectorsToString(opts) : this.getSelectors().getFullString(); }, From 2e93a989411f19f4ee14d5958aa607ba0da75831 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 16 Nov 2021 14:58:05 +0100 Subject: [PATCH 025/313] Update Property --- src/style_manager/model/Property.js | 8 ++++++-- src/style_manager/model/PropertyRadio.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index a6f80b3ee..0883e777b 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -90,11 +90,15 @@ export default class Property extends Model { /** * Check if the property has value + * @param {Object} [opts={}] Options + * @param {Boolean} [opts.noParent=false] Ignore the value if from parent target. * @returns {Boolean} */ - hasValue() { + hasValue(opts = {}) { + const { noParent } = opts; + const parentValue = noParent && this.getParentTarget(); const val = this.get('value'); - return !isUndefined(val) && val !== ''; + return !isUndefined(val) && val !== '' && !parentValue; } /** diff --git a/src/style_manager/model/PropertyRadio.js b/src/style_manager/model/PropertyRadio.js index a89f4f065..be7aed166 100644 --- a/src/style_manager/model/PropertyRadio.js +++ b/src/style_manager/model/PropertyRadio.js @@ -16,7 +16,7 @@ export default class PropertyRadio extends Property { getOptions() { // support old list property const { options, list } = this.attributes; - return options && options.length ? options : list; + return (options && options.length ? options : list) || []; } /** From 25d70ac03b4e80c92602a4a36b347ddaa6743897 Mon Sep 17 00:00:00 2001 From: Eugene Barandon Date: Wed, 17 Nov 2021 15:30:12 +0800 Subject: [PATCH 026/313] Adjust draggable property to accept function. Adjust test script. --- src/dom_components/model/Component.js | 4 +- src/utils/Sorter.js | 20 +++-- test/specs/utils/Sorter.js | 118 ++++++++++++++++++-------- 3 files changed, 97 insertions(+), 45 deletions(-) diff --git a/src/dom_components/model/Component.js b/src/dom_components/model/Component.js index 03d980dce..bfe7ccf50 100644 --- a/src/dom_components/model/Component.js +++ b/src/dom_components/model/Component.js @@ -61,10 +61,10 @@ export const keyUpdateInside = `${keyUpdate}-inside`; * @property {Object} [attributes={}] Key-value object of the component's attributes, eg. `{ title: 'Hello' }` Default: `{}` * @property {String} [name=''] Name of the component. Will be used, for example, in Layers and badges * @property {Boolean} [removable=true] When `true` the component is removable from the canvas, default: `true` - * @property {Boolean|String} [draggable=true] Indicates if it's possible to drag the component inside others. + * @property {Boolean|String|Function} [draggable=true] Indicates if it's possible to drag the component inside others. * You can also specify a query string to indentify elements, * eg. `'.some-class[title=Hello], [data-gjs-type=column]'` means you can drag the component only inside elements - * containing `some-class` class and `Hello` title, and `column` components. Default: `true` + * containing `some-class` class and `Hello` title, and `column` components. In the case of a function, target and destination components are passed as arguments, return a Boolean to indicate if the drag is possible. Default: `true` * @property {Boolean|String|Function} [droppable=true] Indicates if it's possible to drop other components inside. You can use * a query string as with `draggable`. In the case of a function, target and destination components are passed as arguments, return a Boolean to indicate if the drop is possible. Default: `true` * @property {Boolean} [badgable=true] Set to false if you don't want to see the badge (with the name) over the component. Default: `true` diff --git a/src/utils/Sorter.js b/src/utils/Sorter.js index b4b6c6573..3aec19472 100644 --- a/src/utils/Sorter.js +++ b/src/utils/Sorter.js @@ -619,16 +619,24 @@ export default Backbone.View.extend({ return result; } - // check if the source is draggable in target + // Check if the source is draggable in target let draggable = srcModel.get('draggable'); - draggable = draggable instanceof Array ? draggable.join(', ') : draggable; - result.dragInfo = draggable; - draggable = isString(draggable) ? this.matches(trg, draggable) : draggable; - result.draggable = draggable; + if (isFunction(draggable)) { + const res = draggable(srcModel, trgModel); + result.dragInfo = res; + result.draggable = res; + draggable = res; + } else { + draggable = draggable instanceof Array ? draggable.join(', ') : draggable; + result.dragInfo = draggable; + draggable = isString(draggable) + ? this.matches(trg, draggable) + : draggable; + result.draggable = draggable; + } // Check if the target could accept the source let droppable = trgModel.get('droppable'); - if (isFunction(droppable)) { const res = droppable(srcModel, trgModel); result.droppable = res; diff --git a/test/specs/utils/Sorter.js b/test/specs/utils/Sorter.js index 3b6459b6b..5ccf2e344 100644 --- a/test/specs/utils/Sorter.js +++ b/test/specs/utils/Sorter.js @@ -436,56 +436,100 @@ describe('Sorter', () => { }); describe('Valid Target with components', () => { - var parentModel; - var parentView; - var sorter; + describe('Droppable', () => { + var parentModel; + var parentView; - beforeEach(() => { - parentModel = new Component({ - droppable: (srcModel, trgModel) => { - if (srcModel.getEl().className === 'canDrop') { - return true; + beforeEach(() => { + parentModel = new Component({ + droppable: (srcModel, trgModel) => { + return srcModel.getEl().className === 'canDrop'; } - return false; - } + }); + parentView = new ComponentTextView({ + model: parentModel + }); }); - parentView = new ComponentTextView({ - model: parentModel + + afterEach(() => { + parentView.remove(); }); - sorter = new Sorter({ container: parentView.el }); - }); + test('Droppable function', () => { + var srcModel = new Component({ + tagName: 'div', + draggable: true, // Can't move it + content: 'Content text', // Text inside component + attributes: { class: 'canDrop' } + }); + var srcView = new ComponentTextView({ + model: srcModel + }); + + expect(obj.validTarget(parentView.el, srcView.el).valid).toEqual(true); + }); - afterEach(() => { - parentView.remove(); + test('Not droppable function', () => { + var srcModel = new Component({ + tagName: 'div', + draggable: true, + content: 'Content text', + attributes: { class: 'cannotDrop' } + }); + var srcView = new ComponentTextView({ + model: srcModel + }); + + expect(obj.validTarget(parentView.el, srcView.el).valid).toEqual(false); + }); }); - test('Droppable function', () => { - var srcModel = new Component({ - tagName: 'div', - draggable: true, // Can't move it - content: 'Content text', // Text inside component - attributes: { class: 'canDrop' } - }); - var srcView = new ComponentTextView({ - model: srcModel - }); + describe('Draggable', () => { + var srcModel; + var srcView; - expect(obj.validTarget(parentView.el, srcView.el).valid).toEqual(true); - }); + beforeEach(() => { + srcModel = new Component({ + draggable: (srcModel, trgModel) => { + return trgModel.getEl().className === 'canDrag'; + } + }); + srcView = new ComponentTextView({ + model: srcModel + }); + }); - test('Not droppable function', () => { - var srcModel = new Component({ - tagName: 'div', - draggable: true, - content: 'Content text', - attributes: { class: 'cannotDrop' } + afterEach(() => { + srcView.remove(); }); - var srcView = new ComponentTextView({ - model: srcModel + + test('Draggable function', () => { + var parentModel = new Component({ + tagName: 'div', + droppable: true, + content: 'Content text', + attributes: { class: 'canDrag' } + }); + var parentView = new ComponentTextView({ + model: parentModel + }); + + expect(obj.validTarget(parentView.el, srcView.el).valid).toEqual(true); }); - expect(obj.validTarget(parentView.el, srcView.el).valid).toEqual(false); + test('Not draggable function', () => { + var parentModel = new Component({ + tagName: 'div', + droppable: true, + content: 'Content text', + attributes: { class: 'cannotDrag' } + }); + var parentView = new ComponentTextView({ + model: parentModel + }); + + expect(obj.validTarget(parentView.el, srcView.el).valid).toEqual(false); + }); }); }); }); From 7059c157b720cc993cabdc2e5e8598ad5f9eaa27 Mon Sep 17 00:00:00 2001 From: Eugene Barandon Date: Wed, 17 Nov 2021 15:43:17 +0800 Subject: [PATCH 027/313] Remove comment. --- test/specs/utils/Sorter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/specs/utils/Sorter.js b/test/specs/utils/Sorter.js index 5ccf2e344..d4f32ecee 100644 --- a/test/specs/utils/Sorter.js +++ b/test/specs/utils/Sorter.js @@ -458,8 +458,8 @@ describe('Sorter', () => { test('Droppable function', () => { var srcModel = new Component({ tagName: 'div', - draggable: true, // Can't move it - content: 'Content text', // Text inside component + draggable: true, + content: 'Content text', attributes: { class: 'canDrop' } }); var srcView = new ComponentTextView({ From 04d7999404aba7402b62b34d19c95dc115b85c63 Mon Sep 17 00:00:00 2001 From: Bernhard Miller Date: Wed, 17 Nov 2021 10:46:58 +0100 Subject: [PATCH 028/313] remove traces of removed canvasScroll event --- docs/api/editor.md | 1 - src/editor/index.js | 1 - src/rich_text_editor/index.js | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/api/editor.md b/docs/api/editor.md index 087ac2f4d..74582561f 100644 --- a/docs/api/editor.md +++ b/docs/api/editor.md @@ -124,7 +124,6 @@ Check the [Pages][8] module. ### General -* `canvasScroll` - Canvas is scrolled * `update` - The structure of the template is updated (its HTML/CSS) * `undo` - Undo executed * `redo` - Redo executed diff --git a/src/editor/index.js b/src/editor/index.js index 0e1065a1e..a65ca87df 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -90,7 +90,6 @@ * ### Pages * Check the [Pages](/api/pages.html) module. * ### General - * * `canvasScroll` - Canvas is scrolled * * `update` - The structure of the template is updated (its HTML/CSS) * * `undo` - Undo executed * * `redo` - Redo executed diff --git a/src/rich_text_editor/index.js b/src/rich_text_editor/index.js index 13c656964..7e6375724 100644 --- a/src/rich_text_editor/index.js +++ b/src/rich_text_editor/index.js @@ -34,7 +34,7 @@ export default () => { let config = {}; let toolbar, actions, lastEl, lastElPos, globalRte; const eventsUp = - 'change:canvasOffset canvasScroll frame:scroll component:update'; + 'change:canvasOffset frame:scroll component:update'; const hideToolbar = () => { const style = toolbar.style; const size = '-1000px'; From cef42658cab9a530b1f8ce006b0c2ef1983cac93 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 18 Nov 2021 06:34:30 +0100 Subject: [PATCH 029/313] Support partial in properties --- src/domain_abstract/model/Styleable.js | 4 +- src/style_manager/index.js | 83 ++++++++++++++------------ src/style_manager/model/Property.js | 9 +-- 3 files changed, 51 insertions(+), 45 deletions(-) diff --git a/src/domain_abstract/model/Styleable.js b/src/domain_abstract/model/Styleable.js index fc12aabc2..80a5e636d 100644 --- a/src/domain_abstract/model/Styleable.js +++ b/src/domain_abstract/model/Styleable.js @@ -46,8 +46,8 @@ export default { const em = this.em; this.trigger(`change:style:${pr}`); if (em) { - em.trigger(`styleable:change`, this, pr); - em.trigger(`styleable:change:${pr}`, this, pr); + em.trigger(`styleable:change`, this, pr, opts); + em.trigger(`styleable:change:${pr}`, this, pr, opts); } }); diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 439d9db0c..6e914d686 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -102,12 +102,12 @@ export default () => { properties = new Properties(); sectors = new Sectors([], c); this.model = new Model({ targets: [] }); - const toListen = + const ev = 'component:toggled component:update:classes change:state change:device frame:resized selector:type styleable:change'; this.model.listenTo( em, - toListen, - debounce((...args) => { + ev, + debounce(() => { this.select(em.getSelectedAll()); this.__trgCustom(); }) @@ -493,46 +493,13 @@ export default () => { const lastTarget = targets.slice().reverse()[0]; const lastTargetParents = this.getParentRules(lastTarget); this.model.set({ targets, lastTarget, lastTargetParents }); - - // Update all property values - if (lastTarget && em.getConfig('customUI')) { - const style = lastTarget.getStyle(); - const parentStyles = lastTargetParents.map(p => ({ - target: p, - style: p.getStyle() - })); - - sectors.map(sector => { - sector.getProperties().map(prop => { - const name = prop.getName(); - const value = style[name]; - const hasVal = propDef(value); - let newValue = hasVal ? value : null; - let parentTarget = null; - - if (!hasVal) { - newValue = null; - const parentItem = parentStyles.filter(p => - propDef(p.style[name]) - )[0]; - - if (parentItem) { - newValue = parentItem.style[name]; - parentTarget = parentItem.target; - } - } - - prop.__setParentTarget(parentTarget); - prop.upValue(newValue, { __up: true }); - }); - }); - } + this.__upProps(opts); return targets; }, - addStyleTargets(style) { - this.getSelected().map(t => t.addStyle(style)); + addStyleTargets(style, opts) { + this.getSelected().map(t => t.addStyle(style, opts)); }, getSelected() { @@ -572,6 +539,44 @@ export default () => { em && em.logWarning(`'${sectorId}' sector not found`); }, + __upProps(opts) { + const lastTarget = this.getLastSelected(); + if (!lastTarget || !this.em.getConfig('customUI')) return; + + const lastTargetParents = this.getSelectedParents(); + const style = lastTarget.getStyle(); + const parentStyles = lastTargetParents.map(p => ({ + target: p, + style: p.getStyle() + })); + + sectors.map(sector => { + sector.getProperties().map(prop => { + const name = prop.getName(); + const value = style[name]; + const hasVal = propDef(value); + let newValue = hasVal ? value : null; + let parentTarget = null; + + if (!hasVal) { + newValue = null; + const parentItem = parentStyles.filter(p => + propDef(p.style[name]) + )[0]; + + if (parentItem) { + newValue = parentItem.style[name]; + parentTarget = parentItem.target; + } + } + + prop.__setParentTarget(parentTarget); + prop.getFullValue() !== newValue && + prop.upValue(newValue, { ...opts, __up: true }); + }); + }); + }, + destroy() { [properties, sectors].forEach(coll => { coll.reset(); diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 0883e777b..2a943bc4c 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -30,13 +30,14 @@ export default class Property extends Model { }, {}); sm.__trgEv(sm.events.propertyUpdate, { property: this, from, to }); - !opts.__up && sm.addStyleTargets({ [name]: value }); + !opts.__up && + sm.addStyleTargets({ [name]: value, __p: !!opts.avoidStore }, opts); } _up(props, opts = {}) { - const { preview, ...rest } = opts; - props.__p = preview; - return this.set(props, { ...rest, avoidStore: !!preview }); + const { partial, ...rest } = opts; + props.__p = !!partial; + return this.set(props, { ...rest, avoidStore: !!partial }); } init() {} From 32eb6e7e1f173fbf3de271e3ae974487298db10a Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 18 Nov 2021 07:55:28 +0100 Subject: [PATCH 030/313] Add getComponent to CssRule for component-specific rules --- src/css_composer/model/CssRule.js | 15 +++++++++++++++ src/dom_components/index.js | 4 ++++ src/style_manager/index.js | 2 ++ 3 files changed, 21 insertions(+) diff --git a/src/css_composer/model/CssRule.js b/src/css_composer/model/CssRule.js index ea8fcd43e..f3847273c 100644 --- a/src/css_composer/model/CssRule.js +++ b/src/css_composer/model/CssRule.js @@ -21,6 +21,7 @@ const { CSS } = hasWin() ? window : {}; * * [Device]: device.html * [State]: state.html + * [Component]: component.html */ export default class CssRule extends Model.extend(Styleable) { defaults() { @@ -188,6 +189,20 @@ export default class CssRule extends Model.extend(Styleable) { return states.filter(s => s.getName() === stateValue)[0] || null; } + /** + * Returns the related Component (valid only for component-specific rules). + * @returns {[Component]|null} + * @example + * const cmp = rule.getComponent(); + * console.log(cmp?.toHTML()); + */ + getComponent() { + const sel = this.getSelectors(); + const sngl = sel.length == 1 && sel.at(0); + const cmpId = sngl && sngl.isId() && sngl.get('name'); + return (cmpId && this.em?.get('DomComponents').getById(cmpId)) || null; + } + /** * Return the CSS string of the rule * @param {Object} [opts={}] Options (same as in `getDeclaration`) diff --git a/src/dom_components/index.js b/src/dom_components/index.js index 0545a29b9..22af4c81c 100644 --- a/src/dom_components/index.js +++ b/src/dom_components/index.js @@ -649,6 +649,10 @@ export default () => { return componentsById; }, + getById(id) { + return componentsById[id] || null; + }, + destroy() { const all = this.allById(); Object.keys(all).forEach(id => all[id] && all[id].remove()); diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 6e914d686..08a1d8400 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -363,6 +363,8 @@ export default () => { if (em && target) { const cssC = em.get('CssComposer'); const cssGen = em.get('CodeManager').getGenerator('css'); + const cmp = target.toHTML ? true : target.getComponent(); + console.log({ cmp }); const all = cssC .getRules(target.getSelectors().getFullString()) .filter(rule => (state ? rule.get('state') === state : 1)) From 8e4fba774ea5f3443e52647f46e69c44bc938dc3 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 18 Nov 2021 11:35:30 +0100 Subject: [PATCH 031/313] Update getParentRules in StyleManager --- src/css_composer/model/CssRule.js | 6 ++++-- src/style_manager/index.js | 22 ++++++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/css_composer/model/CssRule.js b/src/css_composer/model/CssRule.js index f3847273c..b0e9f6fb3 100644 --- a/src/css_composer/model/CssRule.js +++ b/src/css_composer/model/CssRule.js @@ -147,7 +147,7 @@ export default class CssRule extends Model.extend(Styleable) { const style = this.styleToString(opts); const singleAtRule = this.get('singleAtRule'); - if ((selectors || singleAtRule) && style) { + if ((selectors || singleAtRule) && (style || opts.allowEmpty)) { result = singleAtRule ? style : `${selectors}{${style}}`; } @@ -218,7 +218,9 @@ export default class CssRule extends Model.extend(Styleable) { let result = ''; const atRule = this.getAtRule(); const block = this.getDeclaration(opts); - block && (result = block); + if (block || opts.allowEmpty) { + result = block; + } if (atRule && result) { result = `${atRule}{${result}}`; diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 08a1d8400..9571deafb 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -363,13 +363,27 @@ export default () => { if (em && target) { const cssC = em.get('CssComposer'); const cssGen = em.get('CodeManager').getGenerator('css'); - const cmp = target.toHTML ? true : target.getComponent(); - console.log({ cmp }); - const all = cssC - .getRules(target.getSelectors().getFullString()) + const cmp = target.toHTML ? target : target.getComponent(); + const sel = em.getSelected(); + let cmpRules = []; + let otherRules = []; + + // Componente related rule + if (cmp) { + cmpRules = cssC.getRules(`#${cmp.getId()}`); + otherRules = cssC.getRules(sel.getSelectors().getFullString()); + } else { + cmpRules = cssC.getRules(`#${sel.getId()}`); + otherRules = cssC.getRules(target.getSelectors().getFullString()); + } + + const all = otherRules + .concat(cmpRules) .filter(rule => (state ? rule.get('state') === state : 1)) .sort(cssGen.sortRules) .reverse(); + + // Slice removes rules not related to the current device result = all.slice(all.indexOf(target) + 1); } From 4cd3173454317bf8d1b2a87f9a3f0cfaf2d097bf Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 18 Nov 2021 12:01:29 +0100 Subject: [PATCH 032/313] Use state in getParentRules --- src/style_manager/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 9571deafb..e7f4cb737 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -379,7 +379,9 @@ export default () => { const all = otherRules .concat(cmpRules) - .filter(rule => (state ? rule.get('state') === state : 1)) + .filter(rule => + !isUndefined(state) ? rule.get('state') === state : 1 + ) .sort(cssGen.sortRules) .reverse(); @@ -507,7 +509,7 @@ export default () => { targets = targets.map(t => this.getModelToStyle(t)); const lastTarget = targets.slice().reverse()[0]; - const lastTargetParents = this.getParentRules(lastTarget); + const lastTargetParents = this.getParentRules(lastTarget, em.getState()); this.model.set({ targets, lastTarget, lastTargetParents }); this.__upProps(opts); From a7c42bb97727452bccf6fc1c5c9bb9080f2ab109 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 18 Nov 2021 13:03:27 +0100 Subject: [PATCH 033/313] Update plugin loading for headless option --- .eslintrc | 2 +- src/index.js | 7 ++++--- src/utils/mixins.js | 9 +++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.eslintrc b/.eslintrc index d00afacfb..534a1109a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -4,7 +4,7 @@ "node": true }, "parserOptions": { - "ecmaVersion": 2018, + "ecmaVersion": 2020, "sourceType": "module" }, "rules": { diff --git a/src/index.js b/src/index.js index 7499251f0..6fa13e930 100644 --- a/src/index.js +++ b/src/index.js @@ -2,6 +2,7 @@ import { isElement, isFunction } from 'underscore'; import $ from 'utils/cash-dom'; import Editor from './editor'; import polyfills from 'utils/polyfills'; +import { getGlobal } from 'utils/mixins'; import PluginManager from './plugin_manager'; polyfills(); @@ -57,13 +58,13 @@ export default { // Load plugins config.plugins.forEach(pluginId => { - let plugin = plugins.get(pluginId); + let plugin = isFunction(pluginId) ? pluginId : plugins.get(pluginId); const plgOptions = config.pluginsOpts[pluginId] || {}; // Try to search in global context if (!plugin) { - const wplg = window[pluginId]; - plugin = wplg && wplg.default ? wplg.default : wplg; + const wplg = getGlobal()[pluginId]; + plugin = wplg?.default || wplg; } if (plugin) { diff --git a/src/utils/mixins.js b/src/utils/mixins.js index 80ebc7b7d..56da04885 100644 --- a/src/utils/mixins.js +++ b/src/utils/mixins.js @@ -1,7 +1,16 @@ import { keys, isUndefined, isElement, isArray } from 'underscore'; +export const isDef = value => typeof value !== 'undefined'; + export const hasWin = () => typeof window !== 'undefined'; +export const getGlobal = () => + typeof globalThis !== 'undefined' + ? globalThis + : typeof window !== 'undefined' + ? window + : global; + export const toLowerCase = str => (str || '').toLowerCase(); const elProt = hasWin() ? window.Element.prototype : {}; From 24e80e0938d27cbf014d14afa9c982f87182e2d7 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 19 Nov 2021 15:19:24 +0100 Subject: [PATCH 034/313] Adjust position in Absolute Mode for children #3770 --- src/commands/view/ComponentDrag.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/commands/view/ComponentDrag.js b/src/commands/view/ComponentDrag.js index 3ebbdd189..0c5aa1836 100644 --- a/src/commands/view/ComponentDrag.js +++ b/src/commands/view/ComponentDrag.js @@ -321,17 +321,31 @@ export default { const { Canvas } = editor; const style = target.getStyle(); const position = 'absolute'; + const relPos = [position, 'relative']; onStart && onStart(this._getDragData()); if (isTran) return; if (style.position !== position) { let { left, top, width, height } = Canvas.offset(target.getEl()); + let parent = target.parent(); + let parentRel; - // Check if to center the target to the pointer position + // Check for the relative parent + do { + const pStyle = parent.getStyle(); + parentRel = relPos.indexOf(pStyle.position) >= 0 ? parent : null; + parent = parent.parent(); + } while (parent && !parentRel); + + // Center the target to the pointer position (used in Droppable for Blocks) if (center) { const { x, y } = Canvas.getMouseRelativeCanvas(event); left = x; top = y; + } else if (parentRel) { + const offsetP = Canvas.offset(parentRel.getEl()); + left = left - offsetP.left; + top = top - offsetP.top; } this.setPosition({ From 23b8b1c88ba1447b9ff53c116e27886f9dbee7a9 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 19 Nov 2021 15:49:11 +0100 Subject: [PATCH 035/313] Fix color input trait. Closes #3931 --- src/domain_abstract/ui/InputColor.js | 3 +-- src/trait_manager/model/Trait.js | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/domain_abstract/ui/InputColor.js b/src/domain_abstract/ui/InputColor.js index c691ba1d3..5b5fc11c6 100644 --- a/src/domain_abstract/ui/InputColor.js +++ b/src/domain_abstract/ui/InputColor.js @@ -82,10 +82,9 @@ export default Input.extend({ */ getColorEl() { if (!this.colorEl) { - const { em } = this; + const { em, model } = this; const self = this; const ppfx = this.ppfx; - var model = this.model; var colorEl = $(`
`); var cpStyle = colorEl.get(0).style; diff --git a/src/trait_manager/model/Trait.js b/src/trait_manager/model/Trait.js index 1621afbe3..d1cbae5d7 100644 --- a/src/trait_manager/model/Trait.js +++ b/src/trait_manager/model/Trait.js @@ -47,6 +47,10 @@ export default Backbone.Model.extend({ this.set({ value }, { fromTarget: 1 }); }, + getValue() { + return this.getTargetValue(); + }, + getTargetValue() { const name = this.get('name'); const target = this.target; From 71b65c0df060bd9e39cb84b4f09862508f4d5dd4 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 20 Nov 2021 01:21:03 +0100 Subject: [PATCH 036/313] Make traits API in Component more reliable. Closes #3932 --- src/dom_components/model/Component.js | 97 +++++++++++++++++---------- 1 file changed, 60 insertions(+), 37 deletions(-) diff --git a/src/dom_components/model/Component.js b/src/dom_components/model/Component.js index 03d980dce..fbd649d4d 100644 --- a/src/dom_components/model/Component.js +++ b/src/dom_components/model/Component.js @@ -951,9 +951,8 @@ export default class Component extends Model.extend(Styleable) { initTraits(changed) { const { em } = this; const event = 'change:traits'; - const toListen = [this, event, this.initTraits]; - this.stopListening(...toListen); - this.loadTraits(); + this.off(event, this.initTraits); + this.__loadTraits(); const attrs = { ...this.get('attributes') }; const traits = this.get('traits'); traits.each(trait => { @@ -964,7 +963,7 @@ export default class Component extends Model.extend(Styleable) { } }); traits.length && this.set('attributes', attrs); - this.listenTo(...toListen); + this.on(event, this.initTraits); changed && em && em.trigger('component:toggled'); return this; } @@ -1141,46 +1140,71 @@ export default class Component extends Model.extend(Styleable) { } } - /** - * Load traits - * @param {Array} traits - * @private - */ - loadTraits(traits, opts = {}) { - traits = traits || this.get('traits'); - traits = isFunction(traits) ? traits(this) : traits; + __loadTraits(tr, opts = {}) { + let traitsI = tr || this.get('traits'); - if (!(traits instanceof Traits)) { - const trt = new Traits([], this.opt); - trt.setTarget(this); + if (!(traitsI instanceof Traits)) { + traitsI = isFunction(traitsI) ? traitsI(this) : traitsI; + const traits = new Traits([], this.opt); + traits.setTarget(this); - if (traits.length) { - traits.forEach(tr => tr.attributes && delete tr.attributes.value); - trt.add(traits); + if (traitsI.length) { + traitsI.forEach(tr => tr.attributes && delete tr.attributes.value); + traits.add(traitsI); } - this.set('traits', trt, opts); + this.set({ traits }, opts); } return this; } /** - * Get the trait by id/name + * Get traits. + * @returns {Array} + * @example + * const traits = component.getTraits(); + * console.log(traits); + * // [Trait, Trait, Trait, ...] + */ + getTraits() { + this.__loadTraits(); + return [...this.get('traits').models]; + } + + /** + * Replace current collection of traits with a new one. + * @param {Array} traits Array of trait definitions + * @returns {Array} + * @example + * const traits = component.setTraits([{ type: 'checkbox', name: 'disabled'}, ...]); + * console.log(traits); + * // [Trait, ...] + */ + setTraits(traits) { + const tr = isArray(traits) ? traits : [traits]; + this.set({ traits: tr }); + return this.getTraits(); + } + + /** + * Get the trait by id/name. * @param {String} id The `id` or `name` of the trait - * @return {Trait} Trait model + * @return {Trait|null} Trait getModelToStyle * @example * const traitTitle = component.getTrait('title'); * traitTitle && traitTitle.set('label', 'New label'); */ getTrait(id) { - return this.get('traits').filter(trait => { - return trait.get('id') === id || trait.get('name') === id; - })[0]; + return ( + this.getTraits().filter(trait => { + return trait.get('id') === id || trait.get('name') === id; + })[0] || null + ); } /** - * Update a trait + * Update a trait. * @param {String} id The `id` or `name` of the trait * @param {Object} props Object with the props to update * @return {this} @@ -1191,10 +1215,9 @@ export default class Component extends Model.extend(Styleable) { * }); */ updateTrait(id, props) { - const { em } = this; const trait = this.getTrait(id); trait && trait.set(props); - em && em.trigger('component:toggled'); + this.em?.trigger('component:toggled'); return this; } @@ -1215,25 +1238,25 @@ export default class Component extends Model.extend(Styleable) { /** * Remove trait/s by id/s. * @param {String|Array} id The `id`/`name` of the trait (or an array) - * @return {Array} Array of removed traits + * @return {Array} Array of removed traits * @example * component.removeTrait('title'); * component.removeTrait(['title', 'id']); */ removeTrait(id) { - const { em } = this; const ids = isArray(id) ? id : [id]; const toRemove = ids.map(id => this.getTrait(id)); - const removed = this.get('traits').remove(toRemove); - em && em.trigger('component:toggled'); - return removed; + const traits = this.get('traits'); + const removed = toRemove.length ? traits.remove(toRemove) : []; + this.em?.trigger('component:toggled'); + return isArray(removed) ? removed : [removed]; } /** - * Add trait/s by id/s. + * Add new trait/s. * @param {String|Object|Array} trait Trait to add (or an array of traits) * @param {Options} opts Options for the add - * @return {Array} Array of added traits + * @return {Array} Array of added traits * @example * component.addTrait('title', { at: 1 }); // Add title trait (`at` option is the position index) * component.addTrait({ @@ -1243,10 +1266,10 @@ export default class Component extends Model.extend(Styleable) { * component.addTrait(['title', {...}, ...]); */ addTrait(trait, opts = {}) { - const { em } = this; + this.__loadTraits(); const added = this.get('traits').add(trait, opts); - em && em.trigger('component:toggled'); - return added; + this.em?.trigger('component:toggled'); + return isArray(added) ? added : [added]; } /** From 18a7fd8fa9dd8c0d6c78f6eb9799245ff9ee53a5 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 22 Nov 2021 15:23:45 +0100 Subject: [PATCH 037/313] Enable scroll option for current frame. Fixes #3938 --- src/canvas/view/CanvasView.js | 2 +- src/commands/view/SelectComponent.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/canvas/view/CanvasView.js b/src/canvas/view/CanvasView.js index ac37fee7e..f70411c44 100644 --- a/src/canvas/view/CanvasView.js +++ b/src/canvas/view/CanvasView.js @@ -70,7 +70,7 @@ export default Backbone.View.extend({ scroll && component.views.forEach(view => { - view._getFrame() !== currFrame && view.scrollIntoView(scroll); + view._getFrame() === currFrame && view.scrollIntoView(scroll); }); }, diff --git a/src/commands/view/SelectComponent.js b/src/commands/view/SelectComponent.js index e31521f38..46ee3f195 100644 --- a/src/commands/view/SelectComponent.js +++ b/src/commands/view/SelectComponent.js @@ -325,7 +325,7 @@ export default { */ select(model, event = {}) { if (!model) return; - this.editor.select(model, { scroll: {}, event }); + this.editor.select(model, { event }); this.initResize(model); }, From 18d4fe06200c09e315dc2b7b4efb18cbff3aaa68 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 23 Nov 2021 16:44:14 +0100 Subject: [PATCH 038/313] Add getFullName to Selectors --- src/selector_manager/model/Selectors.js | 25 ++++++ .../selector_manager/model/SelectorModels.js | 50 +++++++++++ test/specs/style_manager/index.js | 87 ++++++++++++++++++- 3 files changed, 161 insertions(+), 1 deletion(-) diff --git a/src/selector_manager/model/Selectors.js b/src/selector_manager/model/Selectors.js index 9d2fa91ce..98143525b 100644 --- a/src/selector_manager/model/Selectors.js +++ b/src/selector_manager/model/Selectors.js @@ -2,6 +2,15 @@ import { filter } from 'underscore'; import { Collection } from 'common'; import Selector from './Selector'; +const combine = (tail, curr) => { + return tail.reduce( + (acc, item, n) => { + return acc.concat(combine(tail.slice(n + 1), `${curr}${item}`)); + }, + [curr] + ); +}; + export default class Selectors extends Collection { modelId(attr) { return `${attr.name}_${attr.type || Selector.TYPE_CLASS}`; @@ -26,6 +35,22 @@ export default class Selectors extends Collection { coll.forEach(selector => result.push(selector.getFullName(opts))); return result.join('').trim(); } + + getFullName(opts = {}) { + const { combination, array } = opts; + let result = []; + const sels = this.map(s => s.getFullName(opts)).sort(); + + if (combination) { + sels.forEach((sel, n) => { + result = result.concat(combine(sels.slice(n + 1), sel)); + }); + } else { + result = sels; + } + + return array ? result : combination ? result.join(',') : result.join(''); + } } Selectors.prototype.model = Selector; diff --git a/test/specs/selector_manager/model/SelectorModels.js b/test/specs/selector_manager/model/SelectorModels.js index b261c0926..74c2ec486 100644 --- a/test/specs/selector_manager/model/SelectorModels.js +++ b/test/specs/selector_manager/model/SelectorModels.js @@ -61,4 +61,54 @@ describe('Selectors', () => { obj.add([{ name: 'test' }, { name: 'test2', type: Selector.TYPE_ID }]); expect(obj.getFullString()).toEqual('.test#test2'); }); + + test('getFullName with combination of 2 classes', () => { + obj.add([{ name: 'a' }, { name: 'b' }]); + expect( + obj.getFullName({ + combination: true, + array: true + }) + ).toEqual(['.a', '.a.b', '.b']); + + expect(obj.getFullName({ combination: true })).toEqual('.a,.a.b,.b'); + expect(obj.getFullName({ array: true })).toEqual(['.a', '.b']); + expect(obj.getFullName()).toEqual('.a.b'); + }); + + test('getFullName with combination of 3 classes', () => { + obj.add([{ name: 'c' }, { name: 'b' }, { name: 'a' }]); + expect( + obj.getFullName({ + combination: true, + array: true + }) + ).toEqual(['.a', '.a.b', '.a.b.c', '.a.c', '.b', '.b.c', '.c']); + }); + + test('getFullName with combination of 4 classes', () => { + obj.add([{ name: 'd' }, { name: 'c' }, { name: 'b' }, { name: 'a' }]); + expect( + obj.getFullName({ + combination: true, + array: true + }) + ).toEqual([ + '.a', + '.a.b', + '.a.b.c', + '.a.b.c.d', + '.a.b.d', + '.a.c', + '.a.c.d', + '.a.d', + '.b', + '.b.c', + '.b.c.d', + '.b.d', + '.c', + '.c.d', + '.d' + ]); + }); }); diff --git a/test/specs/style_manager/index.js b/test/specs/style_manager/index.js index 6e5926c33..90d18330f 100644 --- a/test/specs/style_manager/index.js +++ b/test/specs/style_manager/index.js @@ -4,10 +4,22 @@ describe('StyleManager', () => { describe('Main', () => { let obj; let em; + let domc; + let dv; + let cssc; + let sm; beforeEach(() => { - em = new Editor({}); + em = new Editor({ + mediaCondition: 'max-width', + avoidInlineStyle: true + }); + domc = em.get('DomComponents'); + cssc = em.get('CssComposer'); + dv = em.get('DeviceManager'); + sm = em.get('SelectorManager'); obj = em.get('StyleManager'); + em.get('PageManager').onLoad(); }); afterEach(() => { @@ -115,6 +127,79 @@ describe('StyleManager', () => { expect(obj.render()).toBeTruthy(); }); + describe.only('Parent rules', () => { + test('No parents without selection', () => { + expect(obj.getSelectedParents()).toEqual([]); + }); + + test('Single class, multiple devices', done => { + const cmp = domc.addComponent(`
`); + const [rule1, rule2] = cssc.addRules(` + .cls { color: red; } + @media (max-width: 992px) { + .cls { color: blue; } + } + `); + dv.select('tablet'); + em.setSelected(cmp); + setTimeout(() => { + expect(obj.getLastSelected()).toBe(rule2); + expect(obj.getSelectedParents()).toEqual([rule1]); + done(); + }); + }); + + test('With ID, multiple devices', done => { + sm.setComponentFirst(true); + const cmp = domc.addComponent(`
`); + const [rule1, rule2] = cssc.addRules(` + #id-test { color: red; } + @media (max-width: 992px) { + #id-test { color: blue; } + } + `); + dv.select('tablet'); + em.setSelected(cmp); + setTimeout(() => { + expect(obj.getLastSelected()).toBe(rule2); + expect(obj.getSelectedParents()).toEqual([rule1]); + done(); + }); + }); + + test('With ID + class, multiple devices', done => { + sm.setComponentFirst(true); + const cmp = domc.addComponent(`
`); + const [rule1, rule2] = cssc.addRules(` + .cls { color: red; } + @media (max-width: 992px) { + #id-test { color: blue; } + } + `); + dv.select('tablet'); + em.setSelected(cmp); + setTimeout(() => { + expect(obj.getLastSelected()).toBe(rule2); + expect(obj.getSelectedParents()).toEqual([rule1]); + done(); + }); + }); + + test('Mixed classes', done => { + const cmp = domc.addComponent(`
`); + const [rule1, rule2] = cssc.addRules(` + .cls1 { color: red; } + .cls1.cls2 { color: blue; } + `); + em.setSelected(cmp); + setTimeout(() => { + // expect(obj.getLastSelected()).toBe(rule2); + // expect(obj.getSelectedParents()).toEqual([rule1]); + done(); + }); + }); + }); + describe('Init with configuration', () => { beforeEach(() => { em = new Editor({ From 2e77d948ced66421ff4aaac15ebd74a8c2032d4f Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 23 Nov 2021 16:54:15 +0100 Subject: [PATCH 039/313] Get parent styles by class combination --- src/css_composer/index.js | 5 ++++- src/style_manager/index.js | 7 +++++-- test/specs/style_manager/index.js | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/css_composer/index.js b/src/css_composer/index.js index 6f5bce0ab..4ab15f10b 100644 --- a/src/css_composer/index.js +++ b/src/css_composer/index.js @@ -388,8 +388,11 @@ export default () => { getRules(selector) { const rules = this.getAll(); if (!selector) return [...rules.models]; + const sels = isString(selector) + ? selector.split(',').map(s => s.trim()) + : selector; const result = rules.filter( - r => r.getSelectors().getFullString() === selector + r => sels.indexOf(r.getSelectors().getFullString()) >= 0 ); return result; }, diff --git a/src/style_manager/index.js b/src/style_manager/index.js index e7f4cb737..8d6759da6 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -365,16 +365,19 @@ export default () => { const cssGen = em.get('CodeManager').getGenerator('css'); const cmp = target.toHTML ? target : target.getComponent(); const sel = em.getSelected(); + const optsSel = { combination: true, array: true }; let cmpRules = []; let otherRules = []; // Componente related rule if (cmp) { cmpRules = cssC.getRules(`#${cmp.getId()}`); - otherRules = cssC.getRules(sel.getSelectors().getFullString()); + otherRules = cssC.getRules(sel.getSelectors().getFullName(optsSel)); } else { cmpRules = cssC.getRules(`#${sel.getId()}`); - otherRules = cssC.getRules(target.getSelectors().getFullString()); + otherRules = cssC.getRules( + target.getSelectors().getFullName(optsSel) + ); } const all = otherRules diff --git a/test/specs/style_manager/index.js b/test/specs/style_manager/index.js index 90d18330f..c6e4b8966 100644 --- a/test/specs/style_manager/index.js +++ b/test/specs/style_manager/index.js @@ -193,8 +193,8 @@ describe('StyleManager', () => { `); em.setSelected(cmp); setTimeout(() => { - // expect(obj.getLastSelected()).toBe(rule2); - // expect(obj.getSelectedParents()).toEqual([rule1]); + expect(obj.getLastSelected()).toBe(rule2); + expect(obj.getSelectedParents()).toEqual([rule1]); done(); }); }); From e3a43d31feb5d44ce507b8cb551f27ddd9ecf5b7 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 23 Nov 2021 17:01:19 +0100 Subject: [PATCH 040/313] Up styles tests --- test/specs/style_manager/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/specs/style_manager/index.js b/test/specs/style_manager/index.js index c6e4b8966..b27c5400b 100644 --- a/test/specs/style_manager/index.js +++ b/test/specs/style_manager/index.js @@ -190,9 +190,12 @@ describe('StyleManager', () => { const [rule1, rule2] = cssc.addRules(` .cls1 { color: red; } .cls1.cls2 { color: blue; } + .cls2 { color: green; } + .cls1.cls3 { color: green; } `); em.setSelected(cmp); setTimeout(() => { + expect(obj.getSelectedParents().length).toBe(1); expect(obj.getLastSelected()).toBe(rule2); expect(obj.getSelectedParents()).toEqual([rule1]); done(); From 9ee5c824840995420c8503f51b29373b9a90137e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 24 Nov 2021 12:13:39 +0100 Subject: [PATCH 041/313] Up style tests --- src/style_manager/index.js | 19 ++++++++----- test/specs/style_manager/index.js | 44 ++++++++++++++++++------------- 2 files changed, 38 insertions(+), 25 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 8d6759da6..be207fc3d 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -107,15 +107,17 @@ export default () => { this.model.listenTo( em, ev, - debounce(() => { - this.select(em.getSelectedAll()); - this.__trgCustom(); - }) + debounce(() => this.__upSel()) ); return this; }, + __upSel() { + this.select(this.em.getSelectedAll()); + this.__trgCustom(); + }, + __trgCustom() { this.em.trigger(this.events.custom); }, @@ -380,8 +382,8 @@ export default () => { ); } - const all = otherRules - .concat(cmpRules) + const all = cmpRules + .concat(otherRules) .filter(rule => !isUndefined(state) ? rule.get('state') === state : 1 ) @@ -390,6 +392,11 @@ export default () => { // Slice removes rules not related to the current device result = all.slice(all.indexOf(target) + 1); + console.log({ + target: target.toCSS(), + all: all.map(r => r.toCSS()), + result: result.map(r => r.toCSS()) + }); } return result; diff --git a/test/specs/style_manager/index.js b/test/specs/style_manager/index.js index b27c5400b..573cf061e 100644 --- a/test/specs/style_manager/index.js +++ b/test/specs/style_manager/index.js @@ -149,7 +149,7 @@ describe('StyleManager', () => { }); }); - test('With ID, multiple devices', done => { + test('With ID, multiple devices', () => { sm.setComponentFirst(true); const cmp = domc.addComponent(`
`); const [rule1, rule2] = cssc.addRules(` @@ -160,14 +160,24 @@ describe('StyleManager', () => { `); dv.select('tablet'); em.setSelected(cmp); - setTimeout(() => { - expect(obj.getLastSelected()).toBe(rule2); - expect(obj.getSelectedParents()).toEqual([rule1]); - done(); - }); + obj.__upSel(); + expect(obj.getLastSelected()).toBe(rule2); + expect(obj.getSelectedParents()).toEqual([rule1]); + }); + + test('With ID + class, class first', () => { + const cmp = domc.addComponent(`
`); + const [rule1, rule2] = cssc.addRules(` + .cls { color: red; } + #id-test { color: blue; } + `); + em.setSelected(cmp); + obj.__upSel(); + expect(obj.getLastSelected()).toBe(rule1); + expect(obj.getSelectedParents()).toEqual([rule2]); }); - test('With ID + class, multiple devices', done => { + test('With ID + class, multiple devices', () => { sm.setComponentFirst(true); const cmp = domc.addComponent(`
`); const [rule1, rule2] = cssc.addRules(` @@ -178,14 +188,12 @@ describe('StyleManager', () => { `); dv.select('tablet'); em.setSelected(cmp); - setTimeout(() => { - expect(obj.getLastSelected()).toBe(rule2); - expect(obj.getSelectedParents()).toEqual([rule1]); - done(); - }); + obj.__upSel(); + expect(obj.getLastSelected()).toBe(rule2); + expect(obj.getSelectedParents()).toEqual([rule1]); }); - test('Mixed classes', done => { + test('Mixed classes', () => { const cmp = domc.addComponent(`
`); const [rule1, rule2] = cssc.addRules(` .cls1 { color: red; } @@ -194,12 +202,10 @@ describe('StyleManager', () => { .cls1.cls3 { color: green; } `); em.setSelected(cmp); - setTimeout(() => { - expect(obj.getSelectedParents().length).toBe(1); - expect(obj.getLastSelected()).toBe(rule2); - expect(obj.getSelectedParents()).toEqual([rule1]); - done(); - }); + obj.__upSel(); + expect(obj.getSelectedParents().length).toBe(1); + expect(obj.getLastSelected()).toBe(rule2); + expect(obj.getSelectedParents()).toEqual([rule1]); }); }); From e02d4b25575d23cd3f9c03320016e053dfddb94c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 24 Nov 2021 12:35:51 +0100 Subject: [PATCH 042/313] Update rule ordering --- src/style_manager/index.js | 11 ++++------- test/specs/style_manager/index.js | 13 +++++++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index be207fc3d..160f391b7 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -370,20 +370,22 @@ export default () => { const optsSel = { combination: true, array: true }; let cmpRules = []; let otherRules = []; + let rules = []; // Componente related rule if (cmp) { cmpRules = cssC.getRules(`#${cmp.getId()}`); otherRules = cssC.getRules(sel.getSelectors().getFullName(optsSel)); + rules = otherRules.concat(cmpRules); } else { cmpRules = cssC.getRules(`#${sel.getId()}`); otherRules = cssC.getRules( target.getSelectors().getFullName(optsSel) ); + rules = cmpRules.concat(otherRules); } - const all = cmpRules - .concat(otherRules) + const all = rules .filter(rule => !isUndefined(state) ? rule.get('state') === state : 1 ) @@ -392,11 +394,6 @@ export default () => { // Slice removes rules not related to the current device result = all.slice(all.indexOf(target) + 1); - console.log({ - target: target.toCSS(), - all: all.map(r => r.toCSS()), - result: result.map(r => r.toCSS()) - }); } return result; diff --git a/test/specs/style_manager/index.js b/test/specs/style_manager/index.js index 573cf061e..0e20f5ed5 100644 --- a/test/specs/style_manager/index.js +++ b/test/specs/style_manager/index.js @@ -177,6 +177,19 @@ describe('StyleManager', () => { expect(obj.getSelectedParents()).toEqual([rule2]); }); + test('With ID + class, component first', () => { + sm.setComponentFirst(true); + const cmp = domc.addComponent(`
`); + const [rule1, rule2] = cssc.addRules(` + .cls { color: red; } + #id-test { color: blue; } + `); + em.setSelected(cmp); + obj.__upSel(); + expect(obj.getLastSelected()).toBe(rule2); + expect(obj.getSelectedParents()).toEqual([rule1]); + }); + test('With ID + class, multiple devices', () => { sm.setComponentFirst(true); const cmp = domc.addComponent(`
`); From 0d313b7f2b224c2309b4c1198a0acc96c605f124 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 24 Nov 2021 12:37:10 +0100 Subject: [PATCH 043/313] Up tests --- test/specs/style_manager/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/specs/style_manager/index.js b/test/specs/style_manager/index.js index 0e20f5ed5..14a4bc894 100644 --- a/test/specs/style_manager/index.js +++ b/test/specs/style_manager/index.js @@ -127,7 +127,7 @@ describe('StyleManager', () => { expect(obj.render()).toBeTruthy(); }); - describe.only('Parent rules', () => { + describe('Parent rules', () => { test('No parents without selection', () => { expect(obj.getSelectedParents()).toEqual([]); }); From 0183432b57cf24ccf1c3a071055666d41ed69356 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 24 Nov 2021 13:00:13 +0100 Subject: [PATCH 044/313] Move style manager updare for styleable:change --- package.json | 2 +- src/style_manager/index.js | 43 ++++++++++++++------------------------ 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 1e34bed15..a88f7a57b 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ }, "lint-staged": { "{src,test}/**/*.js": [ - "prettier --single-quote --write", + "prettier --single-quote --print-width 100 --write", "git add" ] }, diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 160f391b7..7eafd21fc 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -37,13 +37,7 @@ * @module StyleManager */ -import { - isElement, - isUndefined, - isArray, - isString, - debounce -} from 'underscore'; +import { isElement, isUndefined, isArray, isString, debounce } from 'underscore'; import Module from 'common/module'; import { Model } from 'common'; import defaults from './config/config'; @@ -103,12 +97,20 @@ export default () => { sectors = new Sectors([], c); this.model = new Model({ targets: [] }); const ev = - 'component:toggled component:update:classes change:state change:device frame:resized selector:type styleable:change'; + 'component:toggled component:update:classes change:state change:device frame:resized selector:type'; this.model.listenTo( em, ev, debounce(() => this.__upSel()) ); + this.model.listenTo( + em, + 'styleable:change', + debounce(() => { + this.__upProps(); + this.__trgCustom(); + }) + ); return this; }, @@ -201,11 +203,7 @@ export default () => { * const sectors = styleManager.getSectors(); * */ getSectors(opts = {}) { - return sectors && sectors.models - ? opts.array - ? [...sectors.models] - : sectors - : []; + return sectors && sectors.models ? (opts.array ? [...sectors.models] : sectors) : []; }, /** @@ -268,9 +266,7 @@ export default () => { if (sector) { prop = sector .get('properties') - .filter( - prop => prop.get('property') === name || prop.get('id') === name - )[0]; + .filter(prop => prop.get('property') === name || prop.get('id') === name)[0]; } return prop || null; @@ -379,16 +375,12 @@ export default () => { rules = otherRules.concat(cmpRules); } else { cmpRules = cssC.getRules(`#${sel.getId()}`); - otherRules = cssC.getRules( - target.getSelectors().getFullName(optsSel) - ); + otherRules = cssC.getRules(target.getSelectors().getFullName(optsSel)); rules = cmpRules.concat(otherRules); } const all = rules - .filter(rule => - !isUndefined(state) ? rule.get('state') === state : 1 - ) + .filter(rule => (!isUndefined(state) ? rule.get('state') === state : 1)) .sort(cssGen.sortRules) .reverse(); @@ -585,9 +577,7 @@ export default () => { if (!hasVal) { newValue = null; - const parentItem = parentStyles.filter(p => - propDef(p.style[name]) - )[0]; + const parentItem = parentStyles.filter(p => propDef(p.style[name]))[0]; if (parentItem) { newValue = parentItem.style[name]; @@ -596,8 +586,7 @@ export default () => { } prop.__setParentTarget(parentTarget); - prop.getFullValue() !== newValue && - prop.upValue(newValue, { ...opts, __up: true }); + prop.getFullValue() !== newValue && prop.upValue(newValue, { ...opts, __up: true }); }); }); }, From ec6e81099e4cf119a84475e52f0f3c347c0da016 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 24 Nov 2021 13:59:15 +0100 Subject: [PATCH 045/313] Update prettier --- package.json | 4 ++-- src/style_manager/index.js | 37 ++++++++++++++----------------------- yarn.lock | 15 ++++----------- 3 files changed, 20 insertions(+), 36 deletions(-) diff --git a/package.json b/package.json index a88f7a57b..9b65fb20b 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "jest": "^24.9.0", "lint-staged": "^8.2.1", "npm-run-all": "^4.1.5", - "prettier": "^1.18.2", + "prettier": "^2.4.1", "sass": "^1.42.1", "sinon": "^7.5.0", "vuepress": "^1.8.2", @@ -66,7 +66,7 @@ }, "lint-staged": { "{src,test}/**/*.js": [ - "prettier --single-quote --print-width 100 --write", + "prettier --single-quote --print-width 120 --arrow-parens avoid --write", "git add" ] }, diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 7eafd21fc..56457868e 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -69,7 +69,7 @@ export default () => { events: { all: evAll, propertyUpdate: evPropUp, - custom: evCustom + custom: evCustom, }, name: 'StyleManager', @@ -96,21 +96,14 @@ export default () => { properties = new Properties(); sectors = new Sectors([], c); this.model = new Model({ targets: [] }); - const ev = - 'component:toggled component:update:classes change:state change:device frame:resized selector:type'; - this.model.listenTo( - em, - ev, - debounce(() => this.__upSel()) - ); - this.model.listenTo( - em, - 'styleable:change', - debounce(() => { - this.__upProps(); - this.__trgCustom(); - }) - ); + const ev = 'component:toggled component:update:classes change:state change:device frame:resized selector:type'; + const upAll = debounce(() => this.__upSel()); + const upProps = debounce(() => { + this.__upProps(); + this.__trgCustom(); + }); + this.model.listenTo(em, ev, upAll); + this.model.listenTo(em, 'styleable:change', upProps); return this; }, @@ -264,9 +257,7 @@ export default () => { let prop; if (sector) { - prop = sector - .get('properties') - .filter(prop => prop.get('property') === name || prop.get('id') === name)[0]; + prop = sector.get('properties').filter(prop => prop.get('property') === name || prop.get('id') === name)[0]; } return prop || null; @@ -466,7 +457,7 @@ export default () => { return new type.view({ model: new type.model(model), config: c, - ...view + ...view, }); } }, @@ -546,7 +537,7 @@ export default () => { el, collection: sectors, target: c.em, - config: c + config: c, }); return SectView.render().el; }, @@ -564,7 +555,7 @@ export default () => { const style = lastTarget.getStyle(); const parentStyles = lastTargetParents.map(p => ({ target: p, - style: p.getStyle() + style: p.getStyle(), })); sectors.map(sector => { @@ -599,6 +590,6 @@ export default () => { SectView && SectView.remove(); [c, properties, sectors, SectView].forEach(i => (i = {})); this.em = {}; - } + }, }; }; diff --git a/yarn.lock b/yarn.lock index a1869b0fb..65c5a06a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2975,10 +2975,6 @@ caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" -cash-dom@^2.3.9: - version "2.3.9" - resolved "https://registry.yarnpkg.com/cash-dom/-/cash-dom-2.3.9.tgz#ff2e29cf3b3202e62596e1e8bb52edb95ea79fec" - ccount@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043" @@ -9002,6 +8998,10 @@ prettier@^1.18.2: version "1.19.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" +prettier@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" + pretty-error@^2.0.2, pretty-error@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.2.tgz#be89f82d81b1c86ec8fdfbc385045882727f93b6" @@ -10348,13 +10348,6 @@ string-length@^2.0.0: astral-regex "^1.0.0" strip-ansi "^4.0.0" -string-replace-loader@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/string-replace-loader/-/string-replace-loader-2.3.0.tgz#7f29be7d73c94dd92eccd5c5a15651181d7ecd3d" - dependencies: - loader-utils "^1.2.3" - schema-utils "^2.6.5" - string-template@~0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" From 4dfc78d434cb0a309eb1fce1c315bb302408a74c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 25 Nov 2021 17:41:30 +0100 Subject: [PATCH 046/313] Update Stack property --- src/style_manager/model/Layer.js | 17 +++-- src/style_manager/model/Property.js | 27 ++++---- src/style_manager/model/PropertyComposite.js | 15 +++-- src/style_manager/model/PropertyStack.js | 71 +++++++++++++++++--- 4 files changed, 98 insertions(+), 32 deletions(-) diff --git a/src/style_manager/model/Layer.js b/src/style_manager/model/Layer.js index 082d0f106..1a9cc4c67 100644 --- a/src/style_manager/model/Layer.js +++ b/src/style_manager/model/Layer.js @@ -8,16 +8,13 @@ export default Backbone.Model.extend({ values: {}, active: false, preview: false, - properties: [] + properties: [], }, initialize() { const prp = this.get('properties'); var value = this.get('value'); - this.set( - 'properties', - prp instanceof Properties ? prp : new Properties(prp) - ); + this.set('properties', prp instanceof Properties ? prp : new Properties(prp)); const props = this.get('properties'); props.forEach(this.onPropAdd, this); this.listenTo(props, 'add', this.onPropAdd); @@ -36,6 +33,14 @@ export default Backbone.Model.extend({ } }, + getValues() { + return this.get('values'); + }, + + getIndex() { + return this.collection.indexOf(this); + }, + onPropAdd(prop) { const coll = this.collection; prop.parent = coll && coll.property; @@ -64,5 +69,5 @@ export default Backbone.Model.extend({ let result = []; this.get('properties').each(prop => result.push(prop.getFullValue())); return result.join(' ').trim(); - } + }, }); diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 2a943bc4c..a0e91fa11 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -7,8 +7,7 @@ export default class Property extends Model { this.em = opts.em; const id = this.get('id') || ''; const name = this.get('name') || ''; - !this.get('property') && - this.set('property', (name || id).replace(/ /g, '-')); + !this.get('property') && this.set('property', (name || id).replace(/ /g, '-')); const prop = this.get('property'); !this.get('id') && this.set('id', prop); !name && this.set('name', capitalize(prop).replace(/-/g, ' ')); @@ -30,8 +29,7 @@ export default class Property extends Model { }, {}); sm.__trgEv(sm.events.propertyUpdate, { property: this, from, to }); - !opts.__up && - sm.addStyleTargets({ [name]: value, __p: !!opts.avoidStore }, opts); + !opts.__up && sm.addStyleTargets({ [name]: value, __p: !!opts.avoidStore }, opts); } _up(props, opts = {}) { @@ -110,13 +108,14 @@ export default class Property extends Model { } upValue(value, opts) { - const parsed = - value === null || value === '' - ? this.__getClearProps() - : this.parseValue(value); + const parsed = value === null || value === '' ? this.__getClearProps() : this.__parseValue(value); return this._up(parsed, opts); } + __parseValue(value) { + return this.parseValue(value); + } + __getClearProps() { return { value: '', status: '' }; } @@ -291,21 +290,21 @@ export default class Property extends Model { } } -Property.callParentInit = function(property, ctx, props, opts = {}) { +Property.callParentInit = function (property, ctx, props, opts = {}) { property.prototype.initialize.apply(ctx, [ props, { ...opts, - skipInit: 1 - } + skipInit: 1, + }, ]); }; -Property.callInit = function(context, props, opts = {}) { +Property.callInit = function (context, props, opts = {}) { !opts.skipInit && context.init(props, opts); }; -Property.getDefaults = function() { +Property.getDefaults = function () { return result(this.prototype, 'defaults'); }; @@ -345,5 +344,5 @@ Property.prototype.defaults = { // Specifies dependency on properties of the parent of the selected object. // Property is shown only when all conditions are matched. - requiresParent: null + requiresParent: null, }; diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index d438f3384..212641f53 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -18,7 +18,7 @@ export default Property.extend({ properties: [], // Separator between properties - separator: ' ' + separator: ' ', }, initialize(props = {}, opts = {}) { @@ -49,8 +49,7 @@ export default Property.extend({ // Try to get value from a shorthand: // 11px -> 11px 11px 11px 11xp // 11px 22px -> 11px 22px 11px 22xp - const value = - values[i] || values[(i % len) + (len != 1 && len % 2 ? 1 : 0)]; + const value = values[i] || values[(i % len) + (len != 1 && len % 2 ? 1 : 0)]; // There some issue with UndoManager //property.setValue(value, 0, {fromParent: 1}); }); @@ -97,5 +96,13 @@ export default Property.extend({ */ getPropertyAt(index) { return this.get('properties').at(index); - } + }, + + getProperties() { + return [...this.get('properties').models]; + }, + + getProperty(id) { + return this.get('properties').filter(prop => prop.get('id') === id)[0] || null; + }, }); diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 858ec7e4c..a21e9bcee 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -1,7 +1,10 @@ -import { keys } from 'underscore'; +import { keys, isUndefined } from 'underscore'; import Property from './PropertyComposite'; import Layers from './Layers'; +const VALUES_REG = /,(?![^\(]*\))/; +const PARTS_REG = /\s(?![^(]*\))/; + export default Property.extend({ defaults: { ...Property.prototype.defaults, @@ -15,7 +18,10 @@ export default Property.extend({ prepend: 0, // Layer preview - preview: 0 + preview: 0, + + // Parse single layer value string + parseLayer: null, }, initialize(props = {}, opts = {}) { @@ -28,6 +34,59 @@ export default Property.extend({ Property.callInit(this, props, opts); }, + _up(props, opts = {}) { + const { __layers = [], ...rest } = props; + const layers = __layers.map(values => ({ values })); + this.getLayers().reset(layers); + console.log('_up from stack', this.get('property'), { layers, rest, opts }); + return Property.prototype._up.call(this, rest, opts); + }, + + __parseValue(value) { + const result = this.parseValue(value); + result.__layers = value + .split(VALUES_REG) + .map(v => v.trim()) + .map(v => this.__parseLayer(v)) + .filter(Boolean); + + return result; + }, + + __parseLayer(value) { + const parseFn = this.get('parseLayer'); + const values = value.split(PARTS_REG); + return parseFn ? parseFn({ value, values }) : values; + }, + + addLayer(props = {}) { + return this.get('layers').push({ properties: [] }); + }, + + /** + * Get style object from layer values + * @param {[Layer]} layer + */ + getStyleFromLayer(layer) { + const sep = this.get('separator'); + const values = layer.getValues(); + const result = this.getProperties().map(prop => { + const name = prop.getName(); + const val = values[name]; + const value = isUndefined(val) ? prop.getDefaultValue() : val; + return { name, value }; + }); + + return this.get('detached') + ? result.reduce((acc, item) => { + acc[item.name] = item.value; + return acc; + }, {}) + : { + [this.getName()]: result.map(r => r.value).join(sep), + }; + }, + getLayers() { return this.get('layers'); }, @@ -61,11 +120,7 @@ export default Property.extend({ if (value) validStyles[name] = value; }); - return !detached - ? style[property] - : keys(validStyles).length - ? validStyles - : ''; + return !detached ? style[property] : keys(validStyles).length ? validStyles : ''; }, /** @@ -85,5 +140,5 @@ export default Property.extend({ */ getLayersFromTarget(target) { return; - } + }, }); From 7e33e3d2dba8e75544559d2c6b8b255e591fde52 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 25 Nov 2021 19:31:31 +0100 Subject: [PATCH 047/313] Trigger change on layer select --- src/style_manager/index.js | 12 +++++-- src/style_manager/model/Layer.js | 3 +- src/style_manager/model/Property.js | 12 +++++-- src/style_manager/model/PropertyStack.js | 40 +++++++++++++++++++++++- 4 files changed, 60 insertions(+), 7 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 56457868e..35778296c 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -50,6 +50,7 @@ import SectorsView from './view/SectorsView'; export const evAll = 'style'; export const evPfx = `${evAll}:`; export const evPropUp = `${evPfx}property:update`; +export const evLayerSelect = `${evPfx}layer:select`; export const evCustom = `${evPfx}custom`; const propDef = value => value || value === 0; @@ -69,6 +70,7 @@ export default () => { events: { all: evAll, propertyUpdate: evPropUp, + layerSelect: evLayerSelect, custom: evCustom, }, @@ -96,14 +98,18 @@ export default () => { properties = new Properties(); sectors = new Sectors([], c); this.model = new Model({ targets: [] }); + + // Triggers for the selection refresh and properties const ev = 'component:toggled component:update:classes change:state change:device frame:resized selector:type'; const upAll = debounce(() => this.__upSel()); + this.model.listenTo(em, ev, upAll); + + // Triggers only for properties (avoid selection refresh) const upProps = debounce(() => { this.__upProps(); this.__trgCustom(); }); - this.model.listenTo(em, ev, upAll); - this.model.listenTo(em, 'styleable:change', upProps); + this.model.listenTo(em, `styleable:change ${evLayerSelect}`, upProps); return this; }, @@ -577,7 +583,7 @@ export default () => { } prop.__setParentTarget(parentTarget); - prop.getFullValue() !== newValue && prop.upValue(newValue, { ...opts, __up: true }); + prop.__getFullValue() !== newValue && prop.upValue(newValue, { ...opts, __up: true }); }); }); }, diff --git a/src/style_manager/model/Layer.js b/src/style_manager/model/Layer.js index 1a9cc4c67..b9bdf6c4b 100644 --- a/src/style_manager/model/Layer.js +++ b/src/style_manager/model/Layer.js @@ -38,7 +38,8 @@ export default Backbone.Model.extend({ }, getIndex() { - return this.collection.indexOf(this); + const coll = this.collection; + return coll ? coll.indexOf(this) : -1; }, onPropAdd(prop) { diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index a0e91fa11..2bb01e45f 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -15,12 +15,16 @@ export default class Property extends Model { Property.callInit(this, props, opts); } + __hasCustom() { + return !!this.em?.getConfig('customUI'); + } + __upTargets(p, opts = {}) { + if (!this.__hasCustom()) return; const { em } = this; - if (!em || !em.getConfig('customUI')) return; const sm = em.get('StyleManager'); const name = this.getName(); - const value = this.getFullValue(); + const value = this.__getFullValue(); const to = this.changedAttributes(); const from = keys(to).reduce((a, i) => { @@ -251,6 +255,10 @@ export default class Property extends Model { return !isUndefined(def) ? def : this.get('defaults'); } + __getFullValue() { + return this.getFullValue(); + } + /** * Get a complete value of the property. * This probably will replace the getValue when all diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index a21e9bcee..11bd257f2 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -22,6 +22,9 @@ export default Property.extend({ // Parse single layer value string parseLayer: null, + + // Current selected layer + selectedLayer: null, }, initialize(props = {}, opts = {}) { @@ -31,14 +34,21 @@ export default Property.extend({ layersColl.property = this; layersColl.properties = this.get('properties'); this.set('layers', layersColl, { silent: true }); + this.on('change:selectedLayer', this.__upSelected); Property.callInit(this, props, opts); }, + __upSelected() { + if (!this.__hasCustom()) return; + const sm = this.em.get('StyleManager'); + sm.__trgEv(sm.events.layerSelect, { property: this }); + }, + _up(props, opts = {}) { const { __layers = [], ...rest } = props; const layers = __layers.map(values => ({ values })); this.getLayers().reset(layers); - console.log('_up from stack', this.get('property'), { layers, rest, opts }); + console.log('_up from stack', this.get('property'), { layers, rest, opts, currValue: this.getFullValue() }); return Property.prototype._up.call(this, rest, opts); }, @@ -63,6 +73,22 @@ export default Property.extend({ return this.get('layers').push({ properties: [] }); }, + /** + * Select layer + * @param {[Layer]} layer + */ + selectLayer(layer) { + return this.set('selectedLayer', layer); + }, + + /** + * Get selected layer + * @returns {[Layer] | null} + */ + getSelectLayer() { + return this.get('selectedLayer'); + }, + /** * Get style object from layer values * @param {[Layer]} layer @@ -87,6 +113,18 @@ export default Property.extend({ }; }, + __getFullValue() { + if (this.get('detached')) return ''; + const name = this.getName(); + + return this.getLayers() + .map(l => this.getStyleFromLayer(l)) + .map(s => s[name]) + .filter(Boolean) + .map(v => v?.trim()) + .join(this.get('layerSeparator')); + }, + getLayers() { return this.get('layers'); }, From 77c85ead5e8e76ea677a075d54fc8858e973acbe Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 25 Nov 2021 19:39:39 +0100 Subject: [PATCH 048/313] Update properties on layer change --- src/style_manager/model/PropertyStack.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 11bd257f2..b8cae2be1 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -41,6 +41,17 @@ export default Property.extend({ __upSelected() { if (!this.__hasCustom()) return; const sm = this.em.get('StyleManager'); + const selected = this.getSelectLayer(); + const values = selected?.getValues(); + + // Update properties by layer value + values && + this.getProperties().forEach(prop => { + const name = prop.getName(); + const value = values[name]; + !isUndefined(value) && prop.upValue(value, { __up: true }); + }); + sm.__trgEv(sm.events.layerSelect, { property: this }); }, From f8e74b81e5037414fc1ead4051b264226cad8368 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 25 Nov 2021 20:48:25 +0100 Subject: [PATCH 049/313] Propagate layer changes --- src/style_manager/model/Layer.js | 7 +++++++ src/style_manager/model/PropertyComposite.js | 3 ++- src/style_manager/model/PropertyStack.js | 14 +++++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/style_manager/model/Layer.js b/src/style_manager/model/Layer.js index b9bdf6c4b..f07f94f5b 100644 --- a/src/style_manager/model/Layer.js +++ b/src/style_manager/model/Layer.js @@ -37,6 +37,13 @@ export default Backbone.Model.extend({ return this.get('values'); }, + upValues(props = {}) { + return this.set('values', { + ...this.getValues(), + ...props, + }); + }, + getIndex() { const coll = this.collection; return coll ? coll.indexOf(this) : -1; diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 212641f53..815b051eb 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -23,9 +23,10 @@ export default Property.extend({ initialize(props = {}, opts = {}) { Property.callParentInit(Property, this, props, opts); + const { em } = this; const properties = this.get('properties') || []; const Properties = require('./Properties').default; - this.set('properties', new Properties(properties), { silent: 1 }); + this.set('properties', new Properties(properties, { em }), { silent: 1 }); this.listenTo(this, 'change:value', this.updateValues); Property.callInit(this, props, opts); }, diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index b8cae2be1..9741b5221 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -35,9 +35,20 @@ export default Property.extend({ layersColl.properties = this.get('properties'); this.set('layers', layersColl, { silent: true }); this.on('change:selectedLayer', this.__upSelected); + this.listenTo(this.get('properties'), 'change', this.__upProperties); Property.callInit(this, props, opts); }, + __upProperties(prop, opts = {}) { + const layer = this.getSelectLayer(); + if (opts.__up || !layer) return; + const name = prop.getName(); + layer.upValues({ [name]: prop.__getFullValue() }); + const value = this.__getFullValue(); + console.log('__upProperties', prop.getName(), { value }); + this.upValue(value, opts); + }, + __upSelected() { if (!this.__hasCustom()) return; const sm = this.em.get('StyleManager'); @@ -97,7 +108,8 @@ export default Property.extend({ * @returns {[Layer] | null} */ getSelectLayer() { - return this.get('selectedLayer'); + const layer = this.get('selectedLayer'); + return layer?.getIndex() >= 0 ? layer : null; }, /** From d5d7b8cc8f0f9e38ecfa9a08da8746a0ce14d91a Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 26 Nov 2021 11:49:24 +0100 Subject: [PATCH 050/313] Update layers --- src/style_manager/model/PropertyStack.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 9741b5221..caa6aa53c 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -45,7 +45,6 @@ export default Property.extend({ const name = prop.getName(); layer.upValues({ [name]: prop.__getFullValue() }); const value = this.__getFullValue(); - console.log('__upProperties', prop.getName(), { value }); this.upValue(value, opts); }, @@ -68,9 +67,18 @@ export default Property.extend({ _up(props, opts = {}) { const { __layers = [], ...rest } = props; - const layers = __layers.map(values => ({ values })); - this.getLayers().reset(layers); - console.log('_up from stack', this.get('property'), { layers, rest, opts, currValue: this.getFullValue() }); + const layers = this.getLayers(); + const layersNew = __layers.map(values => ({ values })); + + if (layers.length === layersNew.length) { + layersNew.map((layer, n) => { + layers.at(n)?.upValues(layer.value); + }); + } else { + this.getLayers().reset(layersNew); + } + + console.log('_up from stack', this.get('property'), { layersNew, rest, opts, currValue: this.getFullValue() }); return Property.prototype._up.call(this, rest, opts); }, From 52ebe2162af6715312c5927b76f2fa41b686d933 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 26 Nov 2021 12:12:16 +0100 Subject: [PATCH 051/313] Update partial update --- src/style_manager/model/Property.js | 4 ++-- src/style_manager/model/PropertyStack.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 2bb01e45f..896ffe8db 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -38,8 +38,8 @@ export default class Property extends Model { _up(props, opts = {}) { const { partial, ...rest } = opts; - props.__p = !!partial; - return this.set(props, { ...rest, avoidStore: !!partial }); + props.__p = !!(rest.avoidStore || partial); + return this.set(props, { ...rest, avoidStore: props.__p }); } init() {} diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index caa6aa53c..b7ca8575c 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -78,7 +78,7 @@ export default Property.extend({ this.getLayers().reset(layersNew); } - console.log('_up from stack', this.get('property'), { layersNew, rest, opts, currValue: this.getFullValue() }); + console.log('_up from stack', this.get('property'), { layersNew, rest, opts }); return Property.prototype._up.call(this, rest, opts); }, From e3d616f748a75f9f8cf6b7cfc502ab3c0a39b69f Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 26 Nov 2021 12:52:24 +0100 Subject: [PATCH 052/313] Check for parent prop --- .../model/TypeableCollection.js | 24 +++++++------------ src/style_manager/model/Property.js | 8 ++++++- src/style_manager/model/PropertyComposite.js | 2 +- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/domain_abstract/model/TypeableCollection.js b/src/domain_abstract/model/TypeableCollection.js index 93ec965f4..a4dcc2b1a 100644 --- a/src/domain_abstract/model/TypeableCollection.js +++ b/src/domain_abstract/model/TypeableCollection.js @@ -10,6 +10,7 @@ export default { initialize(models, opts = {}) { const { em } = opts; this.em = em; + this.opts = opts; this.model = (attrs = {}, options = {}) => { let Model, View, type; @@ -45,15 +46,12 @@ export default { for (let i = 0; i < types.length; i++) { const type = types[i]; let typeFound = type.isType(value); - typeFound = - typeof typeFound == 'boolean' && typeFound - ? { type: type.id } - : typeFound; + typeFound = typeof typeFound == 'boolean' && typeFound ? { type: type.id } : typeFound; if (typeFound) { return { type, - attributes: typeFound + attributes: typeFound, }; } } @@ -61,7 +59,7 @@ export default { // If, for any reason, the type is not found it'll return the base one return { type: this.getBaseType(), - attributes: value + attributes: value, }; }, @@ -117,14 +115,8 @@ export default { const ModelInst = type ? type.model : baseType.model; const ViewInst = type ? type.view : baseType.view; let { model, view, isType } = definition; - model = - model instanceof Model || isFunction(model) - ? model - : ModelInst.extend(model || {}); - view = - view instanceof View || isFunction(view) - ? view - : ViewInst.extend(view || {}); + model = model instanceof Model || isFunction(model) ? model : ModelInst.extend(model || {}); + view = view instanceof View || isFunction(view) ? view : ViewInst.extend(view || {}); // New API if (this.extendViewApi && !definition.model && !definition.view) { @@ -141,12 +133,12 @@ export default { definition.view = view; definition.isType = isType || - function(value) { + function (value) { if (value && value.type == id) { return true; } }; this.getTypes().unshift(definition); } - } + }, }; diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 896ffe8db..40e01ef3d 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -19,12 +19,18 @@ export default class Property extends Model { return !!this.em?.getConfig('customUI'); } + __getParentProp() { + return this.collection?.opts?.parentProp; + } + __upTargets(p, opts = {}) { if (!this.__hasCustom()) return; const { em } = this; const sm = em.get('StyleManager'); const name = this.getName(); const value = this.__getFullValue(); + const parentProp = this.__getParentProp(); + const applyStyle = !opts.__up && !parentProp; const to = this.changedAttributes(); const from = keys(to).reduce((a, i) => { @@ -33,7 +39,7 @@ export default class Property extends Model { }, {}); sm.__trgEv(sm.events.propertyUpdate, { property: this, from, to }); - !opts.__up && sm.addStyleTargets({ [name]: value, __p: !!opts.avoidStore }, opts); + applyStyle && sm.addStyleTargets({ [name]: value, __p: !!opts.avoidStore }, opts); } _up(props, opts = {}) { diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 815b051eb..72be45a71 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -26,7 +26,7 @@ export default Property.extend({ const { em } = this; const properties = this.get('properties') || []; const Properties = require('./Properties').default; - this.set('properties', new Properties(properties, { em }), { silent: 1 }); + this.set('properties', new Properties(properties, { em, parentProp: this }), { silent: 1 }); this.listenTo(this, 'change:value', this.updateValues); Property.callInit(this, props, opts); }, From c18ff4b1293dfa6d176dcb2596f08cdf2624f507 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 26 Nov 2021 13:08:24 +0100 Subject: [PATCH 053/313] Update inner props on change --- src/style_manager/model/PropertyStack.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index b7ca8575c..f399a8174 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -48,7 +48,7 @@ export default Property.extend({ this.upValue(value, opts); }, - __upSelected() { + __upSelected({ noEvent } = {}) { if (!this.__hasCustom()) return; const sm = this.em.get('StyleManager'); const selected = this.getSelectLayer(); @@ -62,7 +62,7 @@ export default Property.extend({ !isUndefined(value) && prop.upValue(value, { __up: true }); }); - sm.__trgEv(sm.events.layerSelect, { property: this }); + !noEvent && sm.__trgEv(sm.events.layerSelect, { property: this }); }, _up(props, opts = {}) { @@ -72,13 +72,14 @@ export default Property.extend({ if (layers.length === layersNew.length) { layersNew.map((layer, n) => { - layers.at(n)?.upValues(layer.value); + layers.at(n)?.upValues(layer.values); }); } else { this.getLayers().reset(layersNew); } console.log('_up from stack', this.get('property'), { layersNew, rest, opts }); + this.__upSelected({ noEvent: true }); return Property.prototype._up.call(this, rest, opts); }, From 8e8560abbdb31fbfd9c1a0b12013a2956651d496 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 26 Nov 2021 14:02:28 +0100 Subject: [PATCH 054/313] Propagate options to inner props --- src/style_manager/model/PropertyStack.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index f399a8174..e7fe0ed74 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -48,7 +48,7 @@ export default Property.extend({ this.upValue(value, opts); }, - __upSelected({ noEvent } = {}) { + __upSelected({ noEvent } = {}, opts = {}) { if (!this.__hasCustom()) return; const sm = this.em.get('StyleManager'); const selected = this.getSelectLayer(); @@ -59,7 +59,7 @@ export default Property.extend({ this.getProperties().forEach(prop => { const name = prop.getName(); const value = values[name]; - !isUndefined(value) && prop.upValue(value, { __up: true }); + !isUndefined(value) && prop.upValue(value, { ...opts, __up: true }); }); !noEvent && sm.__trgEv(sm.events.layerSelect, { property: this }); @@ -79,7 +79,7 @@ export default Property.extend({ } console.log('_up from stack', this.get('property'), { layersNew, rest, opts }); - this.__upSelected({ noEvent: true }); + this.__upSelected({ noEvent: true }, opts); return Property.prototype._up.call(this, rest, opts); }, From 63961419a183f69475ef397dde007d63acb2344e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 27 Nov 2021 13:51:19 +0100 Subject: [PATCH 055/313] Add camelCase option --- src/style_manager/model/Layer.js | 12 +++++-- src/style_manager/model/PropertyStack.js | 13 ++++++-- src/utils/mixins.js | 42 +++++++----------------- 3 files changed, 31 insertions(+), 36 deletions(-) diff --git a/src/style_manager/model/Layer.js b/src/style_manager/model/Layer.js index f07f94f5b..5c6b206a9 100644 --- a/src/style_manager/model/Layer.js +++ b/src/style_manager/model/Layer.js @@ -1,5 +1,6 @@ import Backbone from 'backbone'; import Properties from './Properties'; +import { camelCase } from 'utils/mixins'; export default Backbone.Model.extend({ defaults: { @@ -33,8 +34,15 @@ export default Backbone.Model.extend({ } }, - getValues() { - return this.get('values'); + getValues(opts = {}) { + const values = this.get('values'); + + return opts.camelCase + ? Object.keys(values).reduce((res, key) => { + res[camelCase(key)] = values[key]; + return res; + }, {}) + : values; }, upValues(props = {}) { diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index e7fe0ed74..a3f1b05db 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -1,6 +1,7 @@ import { keys, isUndefined } from 'underscore'; import Property from './PropertyComposite'; import Layers from './Layers'; +import { camelCase } from 'utils/mixins'; const VALUES_REG = /,(?![^\(]*\))/; const PARTS_REG = /\s(?![^(]*\))/; @@ -125,7 +126,7 @@ export default Property.extend({ * Get style object from layer values * @param {[Layer]} layer */ - getStyleFromLayer(layer) { + getStyleFromLayer(layer, opts = {}) { const sep = this.get('separator'); const values = layer.getValues(); const result = this.getProperties().map(prop => { @@ -134,8 +135,7 @@ export default Property.extend({ const value = isUndefined(val) ? prop.getDefaultValue() : val; return { name, value }; }); - - return this.get('detached') + const style = this.get('detached') ? result.reduce((acc, item) => { acc[item.name] = item.value; return acc; @@ -143,6 +143,13 @@ export default Property.extend({ : { [this.getName()]: result.map(r => r.value).join(sep), }; + + return opts.camelCase + ? Object.keys(style).reduce((res, key) => { + res[camelCase(key)] = style[key]; + return res; + }, {}) + : style; }, __getFullValue() { diff --git a/src/utils/mixins.js b/src/utils/mixins.js index 56da04885..ee9ebb120 100644 --- a/src/utils/mixins.js +++ b/src/utils/mixins.js @@ -5,20 +5,12 @@ export const isDef = value => typeof value !== 'undefined'; export const hasWin = () => typeof window !== 'undefined'; export const getGlobal = () => - typeof globalThis !== 'undefined' - ? globalThis - : typeof window !== 'undefined' - ? window - : global; + typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : global; export const toLowerCase = str => (str || '').toLowerCase(); const elProt = hasWin() ? window.Element.prototype : {}; -const matches = - elProt.matches || - elProt.webkitMatchesSelector || - elProt.mozMatchesSelector || - elProt.msMatchesSelector; +const matches = elProt.matches || elProt.webkitMatchesSelector || elProt.mozMatchesSelector || elProt.msMatchesSelector; export const getUiClass = (em, defCls) => { const { stylePrefix, customUI } = em.getConfig(); @@ -35,10 +27,7 @@ const appendStyles = (styles, opts = {}) => { if (stls.length) { const href = stls.shift(); - if ( - href && - (!opts.unique || !document.querySelector(`link[href="${href}"]`)) - ) { + if (href && (!opts.unique || !document.querySelector(`link[href="${href}"]`))) { const { head } = document; const link = document.createElement('link'); link.href = href; @@ -121,8 +110,7 @@ const getUnitFromValue = value => { const upFirst = value => value[0].toUpperCase() + value.toLowerCase().slice(1); const camelCase = value => { - const values = value.split('-').filter(String); - return values[0].toLowerCase() + values.slice(1).map(upFirst); + return value.replace(/-./g, x => x[1].toUpperCase()); }; const normalizeFloat = (value, step = 1, valueDef = 0) => { @@ -139,10 +127,7 @@ const normalizeFloat = (value, step = 1, valueDef = 0) => { }; const hasDnd = em => { - return ( - 'draggable' in document.createElement('i') && - (em ? em.get('Config').nativeDnD : 1) - ); + return 'draggable' in document.createElement('i') && (em ? em.get('Config').nativeDnD : 1); }; /** @@ -211,7 +196,7 @@ const getElRect = el => { top: 0, left: 0, width: 0, - height: 0 + height: 0, }; if (!el) return def; let rectText; @@ -223,9 +208,7 @@ const getElRect = el => { range.detach(); } - return ( - rectText || (el.getBoundingClientRect ? el.getBoundingClientRect() : def) - ); + return rectText || (el.getBoundingClientRect ? el.getBoundingClientRect() : def); }; /** @@ -233,8 +216,7 @@ const getElRect = el => { * @param {Event} ev * @return {Event} */ -const getPointerEvent = ev => - ev.touches && ev.touches[0] ? ev.touches[0] : ev; +const getPointerEvent = ev => (ev.touches && ev.touches[0] ? ev.touches[0] : ev); /** * Get cross-browser keycode @@ -245,8 +227,7 @@ const getKeyCode = ev => ev.which || ev.keyCode; const getKeyChar = ev => String.fromCharCode(getKeyCode(ev)); const isEscKey = ev => getKeyCode(ev) === 27; const isEnterKey = ev => getKeyCode(ev) === 13; -const isObject = val => - val !== null && !Array.isArray(val) && typeof val === 'object'; +const isObject = val => val !== null && !Array.isArray(val) && typeof val === 'object'; const isEmptyObj = val => Object.keys(val).length <= 0; const capitalize = str => str && str.charAt(0).toUpperCase() + str.substring(1); @@ -260,8 +241,7 @@ const setViewEl = (el, view) => { const createId = (length = 16) => { let result = ''; - const chars = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; const len = chars.length; for (let i = 0; i < length; i++) { result += chars.charAt(Math.floor(Math.random() * len)); @@ -296,5 +276,5 @@ export { isEmptyObj, isComponent, createId, - isRule + isRule, }; From fe5e28d3c8438aede50936d81f2fb1b14476fda6 Mon Sep 17 00:00:00 2001 From: Goodness Ezeh <88127727+GoodnessEzeh@users.noreply.github.com> Date: Sun, 28 Nov 2021 20:45:02 +0900 Subject: [PATCH 056/313] Fix typo --- docs/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/README.md b/docs/README.md index 4b54d2daf..7dafe32a2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,7 +3,7 @@ [[toc]] ## What is GrapesJS? -At first glance might think this is just another page/HTML builder, but it's something more. GrapesJS is a multi-purpose, Web Builder Framework, which means it allows you to easily create a drag & drop enabled builder of "things". By "things" we mean anything with HTML-like structure, which entails much more than web pages. We use HTML-like structure basically everywhere: Newsletters (eg. [MJML](https://mjml.io/)), Native Mobile Applications (eg. [React Native](https://github.com/facebook/react-native)), Native Desktop Applications (eg. [Vuido](https://vuido.mimec.org)), PDFs (eg. [React PDF](https://github.com/diegomura/react-pdf)), etc. So, for everything you can imagine as a set of elements like `... other nested elements ...` you can create easily a GrapesJS builder around it and then use it independently your applications. +At first glance one might think this is just another page/HTML builder, but it's something more. GrapesJS is a multi-purpose, Web Builder Framework, which means it allows you to easily create a drag & drop enabled builder of "things". By "things" we mean anything with HTML-like structure, which entails much more than web pages. We use HTML-like structure basically everywhere: Newsletters (eg. [MJML](https://mjml.io/)), Native Mobile Applications (eg. [React Native](https://github.com/facebook/react-native)), Native Desktop Applications (eg. [Vuido](https://vuido.mimec.org)), PDFs (eg. [React PDF](https://github.com/diegomura/react-pdf)), etc. So, for everything you can imagine as a set of elements like `... other nested elements ...` you can create easily a GrapesJS builder around it and then use it independently your applications. GrapesJS ships with features and tools that enable you to craft easy to use builders. Which allows your users to create complex HTML-like templates without any knowledge of coding. @@ -11,7 +11,7 @@ GrapesJS ships with features and tools that enable you to craft easy to use buil ## Why GrapesJS? -GrapesJS was designed primarily for use inside Content Management Systems to speed up the creation of dynamic templates and replace common WYSIWYG editors. Which are good for content editing, but inappropriate for creating HTML structures. Instead of creating an application we decided to create an extensible framework that could be used by anyone for any purpose. +GrapesJS was designed primarily for use inside Content Management Systems to speed up the creation of dynamic templates and replace common WYSIWYG editors, which are good for content editing, but inappropriate for creating HTML structures. Instead of creating an application we decided to create an extensible framework that could be used by anyone for any purpose. From 44b9d7defa5f19be54512027ce578b501d03fe9c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sun, 28 Nov 2021 23:29:18 +0100 Subject: [PATCH 057/313] Listen to layers change --- src/style_manager/model/PropertyStack.js | 32 ++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index a3f1b05db..1b64f8cad 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -37,6 +37,7 @@ export default Property.extend({ this.set('layers', layersColl, { silent: true }); this.on('change:selectedLayer', this.__upSelected); this.listenTo(this.get('properties'), 'change', this.__upProperties); + this.listenTo(layersColl, 'add remove', this.__upLayers); Property.callInit(this, props, opts); }, @@ -49,6 +50,11 @@ export default Property.extend({ this.upValue(value, opts); }, + __upLayers(m, c, o) { + const value = this.__getFullValue(); + this.upValue(value); + }, + __upSelected({ noEvent } = {}, opts = {}) { if (!this.__hasCustom()) return; const sm = this.em.get('StyleManager'); @@ -101,8 +107,30 @@ export default Property.extend({ return parseFn ? parseFn({ value, values }) : values; }, - addLayer(props = {}) { - return this.get('layers').push({ properties: [] }); + /** + * Add new layer to the stack + * @param {Object} [props={}] Layer props + * @param {Object} [opts={}] Options + * @returns {[Layer]} + */ + addLayer(props = {}, opts = {}) { + const values = {}; + this.getProperties().forEach(prop => { + const name = prop.getName(); + const value = props[name]; + values[name] = isUndefined(value) ? prop.getDefaultValue() : value; + }); + const layer = this.get('layers').push({ values }, opts); + + return layer; + }, + + /** + * Remove layer + * @param {[Layer]} layer + */ + removeLayer(layer) { + this.get('layers').remove(layer); }, /** From f4b9e3a09396af1ff833dd784a5c4fcb2df8a646 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 29 Nov 2021 05:37:34 +0100 Subject: [PATCH 058/313] Rename getSelectedLayer method --- src/style_manager/model/PropertyStack.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 1b64f8cad..5c7f592b2 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -42,7 +42,7 @@ export default Property.extend({ }, __upProperties(prop, opts = {}) { - const layer = this.getSelectLayer(); + const layer = this.getSelectedLayer(); if (opts.__up || !layer) return; const name = prop.getName(); layer.upValues({ [name]: prop.__getFullValue() }); @@ -58,7 +58,7 @@ export default Property.extend({ __upSelected({ noEvent } = {}, opts = {}) { if (!this.__hasCustom()) return; const sm = this.em.get('StyleManager'); - const selected = this.getSelectLayer(); + const selected = this.getSelectedLayer(); const values = selected?.getValues(); // Update properties by layer value @@ -145,9 +145,9 @@ export default Property.extend({ * Get selected layer * @returns {[Layer] | null} */ - getSelectLayer() { + getSelectedLayer() { const layer = this.get('selectedLayer'); - return layer?.getIndex() >= 0 ? layer : null; + return layer && layer.getIndex() >= 0 ? layer : null; }, /** From c40b53d7efc56ece365068d473c9830c962455a7 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 29 Nov 2021 15:41:33 +0100 Subject: [PATCH 059/313] Update composite type --- src/style_manager/model/PropertyComposite.js | 22 ++++++++++++++++++-- src/style_manager/model/PropertyStack.js | 1 - 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 72be45a71..a9da7647b 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -24,13 +24,31 @@ export default Property.extend({ initialize(props = {}, opts = {}) { Property.callParentInit(Property, this, props, opts); const { em } = this; - const properties = this.get('properties') || []; const Properties = require('./Properties').default; - this.set('properties', new Properties(properties, { em, parentProp: this }), { silent: 1 }); + const properties = new Properties(this.get('properties') || [], { em, parentProp: this }); + this.set('properties', properties, { silent: 1 }); + this.listenTo(properties, 'change', this.__upProperties); this.listenTo(this, 'change:value', this.updateValues); Property.callInit(this, props, opts); }, + __upProperties(prop, opts = {}) { + if (!this.__hasCustom()) return; + // if [detached] -> sm.addStyleTargets({ [prop.getName()]: prop.__getFullValue(), __p: !!opts.avoidStore }, opts) + // else -> sm.addStyleTargets({ [this.getName()]: this.__getFullValue(), __p: !!opts.avoidStore }, opts) + }, + + __getFullValue() { + if (this.get('detached')) return ''; + + return this.getProperties() + .map(p => p.__getFullValue()) + .join(this.get('separator')); + }, + + // TODO + // in Property -> __upTargetsStyle({ [name]: value }, opt); + /** * Clear the value * @return {this} diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 5c7f592b2..a7f17ae81 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -36,7 +36,6 @@ export default Property.extend({ layersColl.properties = this.get('properties'); this.set('layers', layersColl, { silent: true }); this.on('change:selectedLayer', this.__upSelected); - this.listenTo(this.get('properties'), 'change', this.__upProperties); this.listenTo(layersColl, 'add remove', this.__upLayers); Property.callInit(this, props, opts); }, From 91f8b30b7b0d2dbbed6ae725c95b4b7c268b5ae0 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 30 Nov 2021 12:13:39 +0100 Subject: [PATCH 060/313] Add __upTargetsStyle --- src/style_manager/model/Property.js | 7 ++++++- src/style_manager/model/PropertyStack.js | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 40e01ef3d..db48f83e6 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -39,7 +39,12 @@ export default class Property extends Model { }, {}); sm.__trgEv(sm.events.propertyUpdate, { property: this, from, to }); - applyStyle && sm.addStyleTargets({ [name]: value, __p: !!opts.avoidStore }, opts); + applyStyle && this.__upTargetsStyle({ [name]: value }, opts); + } + + __upTargetsStyle(style, opts) { + const sm = this.em?.get('StyleManager'); + sm?.addStyleTargets({ ...style, __p: !!opts.avoidStore }, opts); } _up(props, opts = {}) { diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index a7f17ae81..ad0e31f51 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -84,7 +84,6 @@ export default Property.extend({ this.getLayers().reset(layersNew); } - console.log('_up from stack', this.get('property'), { layersNew, rest, opts }); this.__upSelected({ noEvent: true }, opts); return Property.prototype._up.call(this, rest, opts); }, From f8b49ae23cb934a44c754b2e148b4016ae6b0d39 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 30 Nov 2021 12:17:43 +0100 Subject: [PATCH 061/313] Add __upProperties in Composite --- src/style_manager/model/PropertyComposite.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index a9da7647b..b100bae5e 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -34,8 +34,12 @@ export default Property.extend({ __upProperties(prop, opts = {}) { if (!this.__hasCustom()) return; - // if [detached] -> sm.addStyleTargets({ [prop.getName()]: prop.__getFullValue(), __p: !!opts.avoidStore }, opts) - // else -> sm.addStyleTargets({ [this.getName()]: this.__getFullValue(), __p: !!opts.avoidStore }, opts) + + if (this.get('detached')) { + this.__upTargetsStyle({ [prop.getName()]: prop.__getFullValue() }, opts); + } else { + this.upValue(this.__getFullValue(), opts); + } }, __getFullValue() { @@ -46,9 +50,6 @@ export default Property.extend({ .join(this.get('separator')); }, - // TODO - // in Property -> __upTargetsStyle({ [name]: value }, opt); - /** * Clear the value * @return {this} From 40cb1663f73db92eba1489de839994001874ed3b Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 30 Nov 2021 12:31:21 +0100 Subject: [PATCH 062/313] Move update property logic --- src/style_manager/index.js | 40 +++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 35778296c..8eb7c4e94 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -566,28 +566,32 @@ export default () => { sectors.map(sector => { sector.getProperties().map(prop => { - const name = prop.getName(); - const value = style[name]; - const hasVal = propDef(value); - let newValue = hasVal ? value : null; - let parentTarget = null; - - if (!hasVal) { - newValue = null; - const parentItem = parentStyles.filter(p => propDef(p.style[name]))[0]; - - if (parentItem) { - newValue = parentItem.style[name]; - parentTarget = parentItem.target; - } - } - - prop.__setParentTarget(parentTarget); - prop.__getFullValue() !== newValue && prop.upValue(newValue, { ...opts, __up: true }); + this.__upProp(prop, style, parentStyles, opts); }); }); }, + __upProp(prop, style, parentStyles, opts) { + const name = prop.getName(); + const value = style[name]; + const hasVal = propDef(value); + let newValue = hasVal ? value : null; + let parentTarget = null; + + if (!hasVal) { + newValue = null; + const parentItem = parentStyles.filter(p => propDef(p.style[name]))[0]; + + if (parentItem) { + newValue = parentItem.style[name]; + parentTarget = parentItem.target; + } + } + + prop.__setParentTarget(parentTarget); + prop.__getFullValue() !== newValue && prop.upValue(newValue, { ...opts, __up: true }); + }, + destroy() { [properties, sectors].forEach(coll => { coll.reset(); From f94d01c93dcb5cdd4e76abcd9229940b7578a9a2 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 30 Nov 2021 13:11:26 +0100 Subject: [PATCH 063/313] Split values in multiple props --- src/style_manager/index.js | 10 +++++++++- src/style_manager/model/PropertyComposite.js | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 8eb7c4e94..9f236ebc8 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -566,7 +566,15 @@ export default () => { sectors.map(sector => { sector.getProperties().map(prop => { - this.__upProp(prop, style, parentStyles, opts); + const props = prop.getProperties?.(); + if (props /*&& prop.isDetached?.()*/) { + const fromStyle = prop.get('fromStyle'); + // TODO parentStyles should be as newStyle + const newStyle = fromStyle ? fromStyle(style) : style; + props.forEach(prop => this.__upProp(prop, newStyle, parentStyles, opts)); + } else { + this.__upProp(prop, style, parentStyles, opts); + } }); }); }, diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index b100bae5e..0d78ba3f7 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -118,6 +118,10 @@ export default Property.extend({ return this.get('properties').at(index); }, + isDetached() { + return !!this.get('detached'); + }, + getProperties() { return [...this.get('properties').models]; }, From e9d9f5cba152f6011389f3404a23a5ad72f7384c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 30 Nov 2021 16:52:24 +0100 Subject: [PATCH 064/313] Add getValues to composite --- src/style_manager/model/PropertyComposite.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 0d78ba3f7..d90d6ef52 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -44,12 +44,28 @@ export default Property.extend({ __getFullValue() { if (this.get('detached')) return ''; + // TODO custom build of the value (eg. toValue({ values }), toStyle({ values, name }) ) return this.getProperties() .map(p => p.__getFullValue()) .join(this.get('separator')); }, + /** + * Get current values of properties + * @param {Object} [opts={}] Options + * @param {Boolean} [opts.byName=false] Use property name as key instead of ID + * @returns {Object} + */ + getValues({ byName } = {}) { + return this.getProperties().reduce((res, prop) => { + const key = byName ? prop.getName() : prop.getId(); + const value = prop.hasValue() ? prop.__getFullValue() : prop.getDefaultValue(); + res[key] = `${value}`; + return res; + }, {}); + }, + /** * Clear the value * @return {this} From dd46d9785bfb571533435045cdb24b7083d04c66 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 30 Nov 2021 17:13:06 +0100 Subject: [PATCH 065/313] Join composite properties --- src/style_manager/model/Property.js | 6 +++--- src/style_manager/model/PropertyComposite.js | 20 +++++++++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index db48f83e6..615a5f76f 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -263,11 +263,11 @@ export default class Property extends Model { */ getDefaultValue() { const def = this.get('default'); - return !isUndefined(def) ? def : this.get('defaults'); + return `${!isUndefined(def) ? def : this.get('defaults')}`; } - __getFullValue() { - return this.getFullValue(); + __getFullValue({ withDefault } = {}) { + return !this.hasValue() && withDefault ? this.getDefaultValue() : this.getFullValue(); } /** diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index d90d6ef52..6ad4580e4 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -1,3 +1,4 @@ +import { isString } from 'underscore'; import Property from './Property'; export default Property.extend({ @@ -17,8 +18,11 @@ export default Property.extend({ // Array of sub properties properties: [], - // Separator between properties + // Separator to use to split property values (only for not detached properties) separator: ' ', + + // Separator to use to join property values (only for not detached properties) + join: null, }, initialize(props = {}, opts = {}) { @@ -45,10 +49,17 @@ export default Property.extend({ __getFullValue() { if (this.get('detached')) return ''; // TODO custom build of the value (eg. toValue({ values }), toStyle({ values, name }) ) + // const values = this.getValues(); return this.getProperties() - .map(p => p.__getFullValue()) - .join(this.get('separator')); + .map(p => p.__getFullValue({ withDefault: 1 })) + .filter(Boolean) + .join(this.__getJoin()); + }, + + __getJoin() { + const join = this.get('join'); + return isString(join) ? join : this.get('separator'); }, /** @@ -60,8 +71,7 @@ export default Property.extend({ getValues({ byName } = {}) { return this.getProperties().reduce((res, prop) => { const key = byName ? prop.getName() : prop.getId(); - const value = prop.hasValue() ? prop.__getFullValue() : prop.getDefaultValue(); - res[key] = `${value}`; + res[key] = `${prop.__getFullValue({ withDefault: 1 })}`; return res; }, {}); }, From 0ec8624d721a9fc55e67398dd46116435254b9c8 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 30 Nov 2021 17:37:33 +0100 Subject: [PATCH 066/313] Add new clear method to Composite --- src/style_manager/model/PropertyComposite.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 6ad4580e4..231ee69f4 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -62,6 +62,11 @@ export default Property.extend({ return isString(join) ? join : this.get('separator'); }, + clear() { + this.getProperties().map(p => p.clear()); + return Property.prototype.clear.apply(this, arguments); + }, + /** * Get current values of properties * @param {Object} [opts={}] Options From 2cdb0b45dfc1124c0c765751bcfcaa14da6accf8 Mon Sep 17 00:00:00 2001 From: Koen Deschacht Date: Fri, 3 Dec 2021 11:24:35 +0100 Subject: [PATCH 067/313] Allow for the title of a block to be passed as an attribute --- src/block_manager/view/BlockView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/block_manager/view/BlockView.js b/src/block_manager/view/BlockView.js index 5a332f566..4adee76f7 100644 --- a/src/block_manager/view/BlockView.js +++ b/src/block_manager/view/BlockView.js @@ -128,7 +128,7 @@ export default Backbone.View.extend({ ${media ? `
${media}
` : ''}
${label}
`; - el.title = el.textContent.trim(); + el.title = attr.title || el.textContent.trim(); el.setAttribute('draggable', hasDnd(em) && !disable ? true : false); const result = render && render({ el, model, className, prefix: ppfx }); if (result) el.innerHTML = result; From 50ed6541fa411c6ab5a7cb00c87801cf69c4c196 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 9 Dec 2021 13:48:59 +0100 Subject: [PATCH 068/313] Update PropertyComposite clear --- src/style_manager/model/Property.js | 8 ++-- src/style_manager/model/PropertyComposite.js | 40 +++++++++++++++++--- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 615a5f76f..15f389ad0 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -28,7 +28,7 @@ export default class Property extends Model { const { em } = this; const sm = em.get('StyleManager'); const name = this.getName(); - const value = this.__getFullValue(); + const value = this.__getFullValue(opts); const parentProp = this.__getParentProp(); const applyStyle = !opts.__up && !parentProp; @@ -38,7 +38,7 @@ export default class Property extends Model { return a; }, {}); - sm.__trgEv(sm.events.propertyUpdate, { property: this, from, to }); + sm.__trgEv(sm.events.propertyUpdate, { property: this, from, to, value, opts }); applyStyle && this.__upTargetsStyle({ [name]: value }, opts); } @@ -118,8 +118,8 @@ export default class Property extends Model { /** * Clear value */ - clear() { - this._up(this.__getClearProps()); + clear(opts = {}) { + this._up(this.__getClearProps(), opts); } upValue(value, opts) { diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 231ee69f4..d54fb68f9 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -23,6 +23,10 @@ export default Property.extend({ // Separator to use to join property values (only for not detached properties) join: null, + + fromStyle: null, + + toStyle: null, }, initialize(props = {}, opts = {}) { @@ -37,19 +41,41 @@ export default Property.extend({ }, __upProperties(prop, opts = {}) { - if (!this.__hasCustom()) return; + if (!this.__hasCustom() || opts.__up) return; - if (this.get('detached')) { + if (this.isDetached()) { this.__upTargetsStyle({ [prop.getName()]: prop.__getFullValue() }, opts); } else { this.upValue(this.__getFullValue(), opts); } }, - __getFullValue() { - if (this.get('detached')) return ''; + __upTargetsStyle(style, opts) { + // const sm = this.em?.get('StyleManager'); + // sm?.addStyleTargets({ ...style, __p: !!opts.avoidStore }, opts); + const toStyle = this.get('toStyle'); + let newStyle = style; + + if (toStyle) { + const values = this.getValues(); + newStyle = toStyle({ values, style, opts }); + } + + return Property.prototype.__upTargetsStyle.call(this, newStyle, opts); + }, + + // TODO? upValue -> if not detached, update properties + + __getFullValue(opts = {}) { + if (this.isDetached() || opts.__clear) { + return ''; + } + // TODO custom build of the value (eg. toValue({ values }), toStyle({ values, name }) ) - // const values = this.getValues(); + + // if (this.get('toStyle')) { + // const values = this.getValues(); + // } return this.getProperties() .map(p => p.__getFullValue({ withDefault: 1 })) @@ -64,7 +90,7 @@ export default Property.extend({ clear() { this.getProperties().map(p => p.clear()); - return Property.prototype.clear.apply(this, arguments); + return Property.prototype.clear.call(this, { __clear: true }); }, /** @@ -84,6 +110,7 @@ export default Property.extend({ /** * Clear the value * @return {this} + * @deprecated */ clearValue(opts = {}) { this.get('properties').each(property => property.clearValue()); @@ -92,6 +119,7 @@ export default Property.extend({ /** * Update property values + * @deprecated */ updateValues() { const values = this.getFullValue().split(this.getSplitSeparator()); From 828e64b235b835ce5a42d50ee8565e9f4da7839a Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 9 Dec 2021 16:57:17 +0100 Subject: [PATCH 069/313] Disable pointer events from blocks --- dist/css/grapes.min.css | 2 +- src/styles/scss/_gjs_blocks.scss | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/css/grapes.min.css b/dist/css/grapes.min.css index a1939e377..489f893f5 100644 --- a/dist/css/grapes.min.css +++ b/dist/css/grapes.min.css @@ -1 +1 @@ -.sp-container{position:absolute;top:0;left:0;display:inline-block;*display:inline;*zoom:1;z-index:9999994;overflow:hidden}.sp-container.sp-flat{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{position:relative;width:100%;display:inline-block}.sp-top-inner{position:absolute;top:0;left:0;bottom:0;right:0}.sp-color{position:absolute;top:0;left:0;bottom:0;right:20%}.sp-hue{position:absolute;top:0;right:0;bottom:0;left:84%;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{position:absolute;top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{position:absolute;top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid black;background:white;opacity:.8}.sp-alpha{display:none;position:absolute;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:solid 1px #333}.sp-clear{display:none}.sp-clear.sp-clear-display{background-position:center}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0px;right:0;bottom:0;left:84%;height:28px}.sp-container,.sp-replacer,.sp-preview,.sp-dragger,.sp-slider,.sp-alpha,.sp-clear,.sp-alpha-handle,.sp-container.sp-dragging .sp-input,.sp-container button{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-input-disabled .sp-input-container{display:none}.sp-container.sp-buttons-disabled .sp-button-container{display:none}.sp-container.sp-palette-buttons-disabled .sp-palette-button-container{display:none}.sp-palette-only .sp-picker-container{display:none}.sp-palette-disabled .sp-palette-container{display:none}.sp-initial-disabled .sp-initial{display:none}.sp-sat{background-image:-webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:linear-gradient(to right, #fff, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr="#FFFFFFFF", endColorstr="#00CC9A81")}.sp-val{background-image:-webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:linear-gradient(to top, #000, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00CC9A81", endColorstr="#FF000000")}.sp-hue{background:-moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));background:-webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff0000", endColorstr="#ffff00")}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffff00", endColorstr="#00ff00")}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ff00", endColorstr="#00ffff")}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffff", endColorstr="#0000ff")}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0000ff", endColorstr="#ff00ff")}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff00ff", endColorstr="#ff0000")}.sp-hidden{display:none !important}.sp-cf:before,.sp-cf:after{content:"";display:table}.sp-cf:after{clear:both}.sp-cf{*zoom:1}@media(max-device-width: 480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;cursor:pointer;position:absolute;top:0;left:0}.sp-slider{position:absolute;top:0;cursor:pointer;height:3px;left:-1px;right:-1px;border:1px solid #000;background:white;opacity:.8}.sp-container{border-radius:0;background-color:#ececec;border:solid 1px #f0c49b;padding:0}.sp-container,.sp-container button,.sp-container input,.sp-color,.sp-hue,.sp-clear{font:normal 12px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-color,.sp-hue,.sp-clear{border:solid 1px #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container{width:100%}.sp-input{font-size:12px !important;border:1px inset;padding:4px 5px;margin:0;width:100%;background:transparent;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-picker-container,.sp-palette-container{float:left;position:relative;padding:10px;padding-bottom:300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:solid 1px #fff}.sp-palette-container{border-right:solid 1px #ccc}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;width:24px;height:15px;margin:3px;cursor:pointer;border:solid 2px transparent}.sp-palette .sp-thumb-el:hover,.sp-palette .sp-thumb-el.sp-thumb-active{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:solid 1px #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:center}.sp-palette-button-container,.sp-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;*zoom:1;*display:inline;border:solid 1px #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer:hover,.sp-replacer.sp-active{border-color:#f0c49b;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px}.sp-preview{position:relative;width:25px;height:20px;border:solid 1px #222;margin-right:5px;float:left;z-index:0}.sp-palette{*width:220px;max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:solid 1px #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top, #eeeeee, #cccccc);background-image:-moz-linear-gradient(top, #eeeeee, #cccccc);background-image:-ms-linear-gradient(top, #eeeeee, #cccccc);background-image:-o-linear-gradient(top, #eeeeee, #cccccc);background-image:linear-gradient(to bottom, #eeeeee, #cccccc);border:1px solid #ccc;border-bottom:1px solid #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top, #dddddd, #bbbbbb);background-image:-moz-linear-gradient(top, #dddddd, #bbbbbb);background-image:-ms-linear-gradient(top, #dddddd, #bbbbbb);background-image:-o-linear-gradient(top, #dddddd, #bbbbbb);background-image:linear-gradient(to bottom, #dddddd, #bbbbbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid #aaa;border-bottom:1px solid #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f !important;margin:0;padding:2px;margin-right:5px;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f !important;text-decoration:underline}.sp-palette span:hover,.sp-palette span.sp-thumb-active{border-color:#000}.sp-preview,.sp-alpha,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-preview-inner,.sp-alpha-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=)}.sp-clear-display{background-repeat:no-repeat;background-position:center;background-image:url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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sITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==)}.CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20, 255, 20, 0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:blue}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, 0.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, 0.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-hopscotch.CodeMirror{background:#322931;color:#d5d3d5}.cm-s-hopscotch div.CodeMirror-selected{background:#433b42 !important}.cm-s-hopscotch .CodeMirror-gutters{background:#322931;border-right:0px}.cm-s-hopscotch .CodeMirror-linenumber{color:#797379}.cm-s-hopscotch .CodeMirror-cursor{border-left:1px solid #989498 !important}.cm-s-hopscotch span.cm-comment{color:#b33508}.cm-s-hopscotch span.cm-atom{color:#c85e7c}.cm-s-hopscotch span.cm-number{color:#c85e7c}.cm-s-hopscotch span.cm-property,.cm-s-hopscotch span.cm-attribute{color:#8fc13e}.cm-s-hopscotch span.cm-keyword{color:#dd464c}.cm-s-hopscotch span.cm-string{color:#fdcc59}.cm-s-hopscotch span.cm-variable{color:#8fc13e}.cm-s-hopscotch span.cm-variable-2{color:#1290bf}.cm-s-hopscotch span.cm-def{color:#fd8b19}.cm-s-hopscotch span.cm-error{background:#dd464c;color:#989498}.cm-s-hopscotch span.cm-bracket{color:#d5d3d5}.cm-s-hopscotch span.cm-tag{color:#dd464c}.cm-s-hopscotch span.cm-link{color:#c85e7c}.cm-s-hopscotch .CodeMirror-matchingbracket{text-decoration:underline;color:white !important}.cm-s-hopscotch .CodeMirror-activeline-background{background:#302020}@font-face{font-family:"font3336";src:url("../fonts/main-fonts.eot?v=20");src:url("../fonts/main-fonts.woff?v=20") format("woff"),url("../fonts/main-fonts.ttf?v=20") format("truetype"),url("../fonts/main-fonts.svg?v=20") format("svg"),url("../fonts/main-fonts.eot?v=20") format("embedded-opentype");font-weight:normal;font-style:normal}.gjs-is__grab,.gjs-is__grab *{cursor:grab !important}.gjs-is__grabbing,.gjs-is__grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:grabbing !important}.gjs-one-bg{background-color:#444}.gjs-one-color{color:#444}.gjs-one-color-h:hover{color:#444}.gjs-two-bg{background-color:#ddd}.gjs-two-color{color:#ddd}.gjs-two-color-h:hover{color:#ddd}.gjs-three-bg{background-color:#804f7b}.gjs-three-color{color:#804f7b}.gjs-three-color-h:hover{color:#804f7b}.gjs-four-bg{background-color:#d278c9}.gjs-four-color{color:#d278c9}.gjs-four-color-h:hover{color:#d278c9}.gjs-danger-bg{background-color:#dd3636}.gjs-danger-color{color:#dd3636}.gjs-danger-color-h:hover{color:#dd3636}.gjs-bg-main,.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c,.gjs-off-prv{background-color:#444}.gjs-color-main,.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add,.gjs-off-prv{color:#ddd;fill:#ddd}.gjs-color-active{color:#f8f8f8;fill:#f8f8f8}.gjs-color-warn{color:#ffca6f;fill:#ffca6f}.gjs-color-hl{color:#71b7f1;fill:#71b7f1}.gjs-fonts::before{display:block;font:normal normal normal 14px font3336;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:5em}.gjs-f-b1::before{content:"Q"}.gjs-f-b2::before{content:"W"}.gjs-f-b3::before{content:"E"}.gjs-f-b37::before{content:"R"}.gjs-f-hero::before{content:"T"}.gjs-f-h1p::before{content:"y"}.gjs-f-3ba::before{content:"u"}.gjs-f-image::before{content:"I"}.gjs-f-text::before{content:"o"}.gjs-f-quo::before{content:"p"}.gjs-f-button::before{content:"B"}.gjs-f-divider::before{content:"D"}.gjs-invis-invis,.gjs-clm-tags #gjs-clm-new,.gjs-no-app{background-color:transparent;border:none;color:inherit}.gjs-no-app{height:10px}.gjs-test::btn{color:"#fff"}.opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-checker-bg,.gjs-field-colorp-c,.checker-bg,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==")}.gjs-no-user-select,.gjs-rte-toolbar,.gjs-layer-name,.gjs-grabbing,.gjs-grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-pointer-events,.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el,.gjs-resizer-c{pointer-events:none}.gjs-bdrag{pointer-events:none !important;position:absolute !important;z-index:10 !important;width:auto}.gjs-drag-helper{background-color:#3b97e3 !important;pointer-events:none !important;position:absolute !important;z-index:10 !important;transform:scale(0.3) !important;transform-origin:top left !important;-webkit-transform-origin:top left !important;margin:15px !important;transition:none !important;outline:none !important}.gjs-grabbing,.gjs-grabbing *{cursor:grabbing !important;cursor:-webkit-grabbing !important}.gjs-grabbing{overflow:hidden}.gjs-off-prv{position:relative;z-index:10;padding:5px;cursor:pointer}.gjs-editor-cont ::-webkit-scrollbar-track{background:rgba(0,0,0,.1)}.gjs-editor-cont ::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.2)}.gjs-editor-cont ::-webkit-scrollbar{width:8px}.clear{clear:both}.no-select,.gjs-clm-tags #gjs-clm-close,.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title,.gjs-com-no-select,.gjs-com-no-select img{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-touch-actions{touch-action:none}.gjs-disabled{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;opacity:.5;filter:alpha(opacity=50)}.gjs-editor{font-family:Helvetica,sans-serif;font-size:.75rem;position:relative;box-sizing:border-box;height:100%}.gjs-freezed,.gjs-freezed{opacity:.5;filter:alpha(opacity=50);pointer-events:none}.gjs-traits-label{border-bottom:1px solid rgba(0,0,0,.2);font-weight:lighter;margin-bottom:5px;padding:10px;text-align:left}.gjs-label-wrp{width:30%;min-width:30%}.gjs-field-wrp{flex-grow:1}.gjs-trt-header{font-weight:lighter;padding:10px}.gjs-trt-trait{display:flex;justify-content:flex-start;padding:5px 10px;font-weight:lighter;align-items:center;text-align:left}.gjs-trt-traits{font-size:.75rem}.gjs-trt-trait .gjs-label{text-align:left;text-overflow:ellipsis;overflow:hidden}.gjs-guide-info{position:absolute}.gjs-guide-info__content{position:absolute;height:100%;display:flex;width:100%;padding:5px}.gjs-guide-info__line{position:relative;margin:auto}.gjs-guide-info__line::before,.gjs-guide-info__line::after{content:"";display:block;position:absolute;background-color:inherit}.gjs-guide-info__y{padding:0 5px}.gjs-guide-info__y .gjs-guide-info__content{justify-content:center}.gjs-guide-info__y .gjs-guide-info__line{width:100%;height:1px}.gjs-guide-info__y .gjs-guide-info__line::before,.gjs-guide-info__y .gjs-guide-info__line::after{width:1px;height:10px;top:0;bottom:0;left:0;margin:auto}.gjs-guide-info__y .gjs-guide-info__line::after{left:auto;right:0}.gjs-guide-info__x{padding:5px 0}.gjs-guide-info__x .gjs-guide-info__content{align-items:center}.gjs-guide-info__x .gjs-guide-info__line{height:100%;width:1px}.gjs-guide-info__x .gjs-guide-info__line::before,.gjs-guide-info__x .gjs-guide-info__line::after{width:10px;height:1px;left:0;right:0;top:0;margin:auto;transform:translateX(-50%)}.gjs-guide-info__x .gjs-guide-info__line::after{top:auto;bottom:0}.gjs-badge{white-space:nowrap}.gjs-badge__icon{vertical-align:middle;display:inline-block;width:15px;height:15px}.gjs-badge__icon svg{fill:currentColor}.gjs-badge__name{display:inline-block;vertical-align:middle}.gjs-frame-wrapper{position:absolute;width:100%;height:100%;left:0;right:0;margin:auto}.gjs-frame-wrapper--anim{transition:width .35s ease,height .35s ease}.gjs-frame-wrapper__top{transform:translateY(-100%) translateX(-50%);display:flex;padding:5px 0;position:absolute;width:100%;left:50%;top:0}.gjs-frame-wrapper__top-r{margin-left:auto}.gjs-frame-wrapper__left{position:absolute;left:0;transform:translateX(-100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__bottom{position:absolute;bottom:0;transform:translateY(100%) translateX(-50%);width:100%;left:50%}.gjs-frame-wrapper__right{position:absolute;right:0;transform:translateX(100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__icon{width:24px;cursor:pointer}.gjs-frame-wrapper__icon>svg{fill:currentColor}.gjs-padding-v-top,.gjs-fixedpadding-v-top{width:100%;top:0;left:0}.gjs-padding-v-right,.gjs-fixedpadding-v-right{right:0}.gjs-padding-v-bottom,.gjs-fixedpadding-v-bottom{width:100%;left:0;bottom:0}.gjs-padding-v-left,.gjs-fixedpadding-v-left{left:0}.gjs-cv-canvas{background-color:rgba(0,0,0,.15);box-sizing:border-box;width:85%;height:calc(100% - 40px);bottom:0;overflow:hidden;z-index:1;position:absolute;left:0;top:40px}.gjs-cv-canvas.gjs-cui{width:100%;height:100%;top:0}.gjs-cv-canvas.gjs-is__grab .gjs-cv-canvas__frames,.gjs-cv-canvas.gjs-is__grabbing .gjs-cv-canvas__frames{pointer-events:none}.gjs-cv-canvas__frames{position:absolute;top:0;left:0;width:100%;height:100%}.gjs-cv-canvas .gjs-ghost{display:none;pointer-events:none;background-color:#5b5b5b;border:2px dashed #ccc;position:absolute;z-index:10;opacity:.55;filter:alpha(opacity=55)}.gjs-cv-canvas .gjs-highlighter,.gjs-cv-canvas .gjs-highlighter-sel{position:absolute;outline:1px solid #3b97e3;outline-offset:-1px;pointer-events:none;width:100%;height:100%}.gjs-cv-canvas .gjs-highlighter-warning{outline:3px solid #ffca6f}.gjs-cv-canvas .gjs-highlighter-sel{outline:2px solid #3b97e3;outline-offset:-2px}.gjs-cv-canvas #gjs-tools,.gjs-cv-canvas .gjs-tools{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;z-index:1}.gjs-cv-canvas *{box-sizing:border-box}.gjs-frame{outline:medium none;height:100%;width:100%;border:none;margin:auto;display:block;transition:width .35s ease,height .35s ease;position:absolute;top:0;bottom:0;left:0;right:0}.gjs-toolbar{position:absolute;background-color:#3b97e3;white-space:nowrap;color:#fff;z-index:10;top:0;left:0}.gjs-toolbar-item{padding:5px 7px;font-size:.8rem;cursor:pointer;width:26px;vertical-align:middle;display:inline-block}.gjs-toolbar-item svg{fill:currentColor;vertical-align:middle}.gjs-resizer-c{position:absolute;left:0;top:0;width:100%;height:100%;z-index:9}.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.1;filter:alpha(opacity=10);position:absolute;background-color:#ff0}.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.2;filter:alpha(opacity=20)}.gjs-padding-v-el,.gjs-fixedpadding-v-el{background-color:navy}.gjs-resizer-h{pointer-events:all;position:absolute;border:3px solid #3b97e3;width:10px;height:10px;background-color:#fff;margin:-5px}.gjs-resizer-h-tl{top:0;left:0;cursor:nwse-resize}.gjs-resizer-h-tr{top:0;right:0;cursor:nesw-resize}.gjs-resizer-h-tc{top:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-cl{left:0;margin:auto -5px;top:0;bottom:0;cursor:ew-resize}.gjs-resizer-h-cr{margin:auto -5px;top:0;bottom:0;right:0;cursor:ew-resize}.gjs-resizer-h-bl{bottom:0;left:0;cursor:nesw-resize}.gjs-resizer-h-bc{bottom:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-br{bottom:0;right:0;cursor:nwse-resize}.gjs-pn-panel .gjs-resizer-h{background-color:rgba(0,0,0,.2);border:none;opacity:0;transition:opacity .25s}.gjs-pn-panel .gjs-resizer-h:hover{opacity:1}.gjs-pn-panel .gjs-resizer-h-tc,.gjs-pn-panel .gjs-resizer-h-bc{margin:0 auto;width:100%}.gjs-pn-panel .gjs-resizer-h-cr,.gjs-pn-panel .gjs-resizer-h-cl{margin:auto 0;height:100%}.gjs-resizing .gjs-highlighter,.gjs-resizing .gjs-badge{display:none !important}.gjs-resizing-tl *{cursor:nwse-resize !important}.gjs-resizing-tr *{cursor:nesw-resize !important}.gjs-resizing-tc *{cursor:ns-resize !important}.gjs-resizing-cl *{cursor:ew-resize !important}.gjs-resizing-cr *{cursor:ew-resize !important}.gjs-resizing-bl *{cursor:nesw-resize !important}.gjs-resizing-bc *{cursor:ns-resize !important}.gjs-resizing-br *{cursor:nwse-resize !important}.btn-cl,.gjs-am-close,.gjs-mdl-btn-close{opacity:.3;filter:alpha(opacity=30);font-size:25px;cursor:pointer}.btn-cl:hover,.gjs-am-close:hover,.gjs-mdl-btn-close:hover{opacity:.7;filter:alpha(opacity=70)}.no-dots,.ui-resizable-handle{border:none !important;margin:0 !important;outline:none !important}.gjs-com-dashed *{outline:1px dashed #888;outline-offset:-2px;box-sizing:border-box}.gjs-cv-canvas .gjs-comp-selected{outline:3px solid #3b97e3 !important}*.gjs-com-hover,div.gjs-com-hover{outline:1px solid #3b97e3}*.gjs-com-hover-delete,div.gjs-com-hover-delete{outline:2px solid #dd3636;opacity:.5;filter:alpha(opacity=50)}*.gjs-com-hover-move,div.gjs-com-hover-move{outline:3px solid #ffca6f}.gjs-com-badge,.gjs-com-badge-red,.gjs-badge{pointer-events:none;background-color:#3b97e3;color:#fff;padding:2px 5px;position:absolute;z-index:1;font-size:12px;outline:none;display:none}.gjs-com-badge-red{background-color:#dd3636}.gjs-badge-warning{background-color:#ffca6f}.gjs-placeholder,.gjs-com-placeholder,.gjs-placeholder{position:absolute;z-index:10;pointer-events:none;display:none}.gjs-placeholder,.gjs-placeholder{border-style:solid !important;outline:none;box-sizing:border-box;transition:top .2s,left .2s,width .2s,height .2s}.gjs-placeholder.horizontal,.gjs-com-placeholder.horizontal,.gjs-placeholder.horizontal{border-color:transparent #62c462;border-width:3px 5px;margin:-3px 0 0}.gjs-placeholder.vertical,.gjs-com-placeholder.vertical,.gjs-placeholder.vertical{border-color:#62c462 transparent;border-width:5px 3px;margin:0 0 0 -3px}.gjs-placeholder-int,.gjs-com-placeholder-int,.gjs-placeholder-int{background-color:#62c462;box-shadow:0 0 3px rgba(0,0,0,.2);height:100%;width:100%;pointer-events:none;padding:1.5px;outline:none}.gjs-pn-panel{display:inline-block;position:absolute;box-sizing:border-box;text-align:center;padding:5px;z-index:3}.gjs-pn-panel .icon-undo,.gjs-pn-panel .icon-redo{font-size:20px;height:30px;width:25px}.gjs-pn-commands{width:85%;left:0;top:0;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-options{right:15%;top:0}.gjs-pn-views{border-bottom:2px solid rgba(0,0,0,.2);right:0;width:15%;z-index:4}.gjs-pn-views-container{height:100%;padding:42px 0 0;right:0;width:15%;overflow:auto;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-buttons{align-items:center;display:flex;justify-content:space-between}.gjs-pn-btn{box-sizing:border-box;min-height:30px;min-width:30px;line-height:21px;background-color:transparent;border:none;font-size:18px;margin-right:5px;border-radius:2px;padding:4px;position:relative;cursor:pointer}.gjs-pn-btn.gjs-pn-active{background-color:rgba(0,0,0,.15);box-shadow:0 0 3px rgba(0,0,0,.25) inset}.gjs-pn-btn svg{fill:currentColor}.gjs-comp-image-placeholder{display:block;background-color:#f5f5f5;color:#777;height:50px;width:50px;line-height:50px;outline:3px solid #ffca6f;outline-offset:-3px;text-align:center;font-size:16.6666666667px;cursor:pointer}.gjs-comp-image-placeholder.fa-picture-o::after{content:""}.gjs-label{line-height:18px}.gjs-fields{display:flex}.gjs-select{padding:0;width:100%}.gjs-select select{padding-right:10px}.gjs-select:-moz-focusring,.gjs-select select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-input:focus,.gjs-button:focus,.gjs-btn-prim:focus,.gjs-select:focus,.gjs-select select:focus{outline:none}.gjs-field input,.gjs-field select,.gjs-field textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:inherit;border:none;background-color:transparent;box-sizing:border-box;width:100%;position:relative;padding:5px;z-index:1}.gjs-field input:focus,.gjs-field select:focus,.gjs-field textarea:focus{outline:none}.gjs-field input[type=number]{-moz-appearance:textfield}.gjs-field input[type=number]::-webkit-outer-spin-button,.gjs-field input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gjs-field-range{flex:9 1 auto}.gjs-field-integer input{padding-right:30px}.gjs-select option,.gjs-field-select option,.gjs-clm-select option,.gjs-sm-select option,.gjs-fields option,.gjs-sm-unit option{background-color:#444;color:#ddd}.gjs-field{background-color:rgba(0,0,0,.2);border:none;box-shadow:none;border-radius:2px;box-sizing:border-box;padding:0;position:relative}.gjs-field textarea{resize:vertical}.gjs-field .gjs-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;z-index:0}.gjs-field .gjs-d-s-arrow{bottom:0;top:0;margin:auto;right:5px;border-top:4px solid rgba(255,255,255,.7);position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-field-arrows{position:absolute;cursor:ns-resize;margin:auto;height:20px;width:9px;z-index:10;bottom:0;right:3px;top:0}.gjs-field-color,.gjs-field-radio{width:100%}.gjs-field-color input{padding-right:22px;box-sizing:border-box}.gjs-field-colorp{border-left:1px solid rgba(0,0,0,.2);box-sizing:border-box;height:100%;padding:2px;position:absolute;right:0;top:0;width:22px;z-index:10}.gjs-field-colorp .gjs-checker-bg,.gjs-field-colorp .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-field-colorp-c{height:100%;position:relative;width:100%}.gjs-field-color-picker{background-color:#ddd;cursor:pointer;height:100%;width:100%;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px;position:absolute;top:0}.gjs-field-checkbox{padding:0;width:17px;height:17px;display:block;cursor:pointer}.gjs-field-checkbox input{display:none}.gjs-field-checkbox input:checked+.gjs-chk-icon{border-color:rgba(255,255,255,.5);border-width:0 2px 2px 0;border-style:solid}.gjs-radio-item{flex:1 1 auto;text-align:center;border-left:1px solid rgba(0,0,0,.2)}.gjs-radio-item:first-child{border:none}.gjs-radio-item:hover{background:rgba(0,0,0,.2)}.gjs-radio-item input{display:none}.gjs-radio-item input:checked+.gjs-radio-item-label{background-color:rgba(255,255,255,.2)}.gjs-radio-items{display:flex}.gjs-radio-item-label{cursor:pointer;display:block;padding:5px}.gjs-field-units{position:absolute;margin:auto;right:10px;bottom:0;top:0}.gjs-field-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-field-arrow-u,.gjs-field-arrow-d{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(255,255,255,.7);bottom:4px;cursor:pointer}.gjs-field-arrow-u{border-bottom:4px solid rgba(255,255,255,.7);border-top:none;top:4px}.gjs-field-select{padding:0}.gjs-field-range{background-color:transparent;border:none;box-shadow:none;padding:0}.gjs-field-range input{margin:0;height:100%}.gjs-field-range input:focus{outline:none}.gjs-field-range input::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-ms-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-webkit-slider-runnable-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-ms-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-btn-prim{color:inherit;background-color:rgba(255,255,255,.1);border-radius:2px;padding:3px 6px;padding:5px;cursor:pointer;border:none}.gjs-btn-prim:active{background-color:rgba(255,255,255,.1)}.gjs-btn--full{width:100%}.gjs-chk-icon{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);box-sizing:border-box;display:block;height:14px;margin:0 5px;width:6px}.gjs-add-trasp{background:none;border:none;color:#ddd;cursor:pointer;font-size:1em;border-radius:2px;opacity:.75;filter:alpha(opacity=75)}.gjs-add-trasp:hover{opacity:1;filter:alpha(opacity=100)}.gjs-add-trasp:active{background-color:rgba(0,0,0,.2)}.gjs-devices-c{display:flex;align-items:center;padding:3px}.gjs-devices-c .gjs-device-label{flex-grow:2;text-align:left;margin-right:10px}.gjs-devices-c .gjs-select{flex-grow:20}.gjs-devices-c .gjs-add-trasp{flex-grow:1;margin-left:5px}.gjs-category-open,.gjs-block-category.gjs-open,.gjs-sm-sector.gjs-sm-open,.gjs-sm-open.gjs-clm-tags{border-bottom:1px solid rgba(0,0,0,.25)}.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title{font-weight:lighter;background-color:rgba(0,0,0,.1);letter-spacing:1px;padding:9px 10px 9px 20px;border-bottom:1px solid rgba(0,0,0,.25);text-align:left;position:relative;cursor:pointer}.gjs-sm-clear{line-height:0;cursor:pointer}.gjs-sm-header{font-weight:lighter;padding:10px}.gjs-sm-properties{font-size:.75rem;padding:10px 5px;display:flex;flex-wrap:wrap;align-items:flex-end;box-sizing:border-box;width:100%}.gjs-sm-label{margin:5px 5px 3px 0}.gjs-sm-close-btn,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.2;filter:alpha(opacity=20)}.gjs-sm-close-btn:hover,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover{opacity:.7;filter:alpha(opacity=70)}.gjs-sm-sector,.gjs-clm-tags{clear:both;font-weight:lighter;text-align:left}.gjs-sm-sector #gjs-sm-caret,.gjs-clm-tags #gjs-sm-caret{padding-right:5px;font-size:11px}.gjs-sm-sector .gjs-sm-field,.gjs-clm-tags .gjs-sm-field,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-clm-field,.gjs-clm-tags .gjs-clm-field{width:100%;position:relative}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input,.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{background-color:transparent;color:rgba(255,255,255,.7);border:none;width:100%}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input{box-sizing:border-box}.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gjs-sm-sector .gjs-sm-field select::-ms-expand,.gjs-clm-tags .gjs-sm-field select::-ms-expand,.gjs-sm-sector .gjs-clm-select select::-ms-expand,.gjs-clm-tags .gjs-clm-select select::-ms-expand,.gjs-sm-sector .gjs-clm-field select::-ms-expand,.gjs-clm-tags .gjs-clm-field select::-ms-expand{display:none}.gjs-sm-sector .gjs-sm-field select:-moz-focusring,.gjs-clm-tags .gjs-sm-field select:-moz-focusring,.gjs-sm-sector .gjs-clm-select select:-moz-focusring,.gjs-clm-tags .gjs-clm-select select:-moz-focusring,.gjs-sm-sector .gjs-clm-field select:-moz-focusring,.gjs-clm-tags .gjs-clm-field select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-sm-sector .gjs-sm-field input:focus,.gjs-clm-tags .gjs-sm-field input:focus,.gjs-sm-sector .gjs-clm-select input:focus,.gjs-clm-tags .gjs-clm-select input:focus,.gjs-sm-sector .gjs-clm-field input:focus,.gjs-clm-tags .gjs-clm-field input:focus,.gjs-sm-sector .gjs-sm-field select:focus,.gjs-clm-tags .gjs-sm-field select:focus,.gjs-sm-sector .gjs-clm-select select:focus,.gjs-clm-tags .gjs-clm-select select:focus,.gjs-sm-sector .gjs-clm-field select:focus,.gjs-clm-tags .gjs-clm-field select:focus{outline:none}.gjs-sm-sector .gjs-sm-field .gjs-sm-unit,.gjs-clm-tags .gjs-sm-field .gjs-sm-unit,.gjs-sm-sector .gjs-clm-select .gjs-sm-unit,.gjs-clm-tags .gjs-clm-select .gjs-sm-unit,.gjs-sm-sector .gjs-clm-field .gjs-sm-unit,.gjs-clm-tags .gjs-clm-field .gjs-sm-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-sm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-select .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-select .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;cursor:ns-resize}.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{border-bottom:4px solid rgba(255,255,255,.7);top:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{border-top:4px solid rgba(255,255,255,.7);bottom:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{bottom:7px}.gjs-sm-sector .gjs-sm-field.gjs-sm-color,.gjs-clm-tags .gjs-sm-field.gjs-sm-color,.gjs-sm-sector .gjs-sm-color.gjs-clm-field,.gjs-clm-tags .gjs-sm-color.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-input,.gjs-clm-tags .gjs-sm-field.gjs-sm-input,.gjs-sm-sector .gjs-sm-input.gjs-clm-field,.gjs-clm-tags .gjs-sm-input.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-integer,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{background-color:rgba(0,0,0,.2);border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 0 rgba(255,255,255,.1);color:rgba(255,255,255,.7);border-radius:2px;box-sizing:border-box;padding:0 5px}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{border-radius:2px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{padding:0}.gjs-sm-sector .gjs-sm-field.gjs-sm-select select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field select,.gjs-clm-tags .gjs-sm-select.gjs-clm-field select{height:20px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select option,.gjs-clm-tags .gjs-sm-field.gjs-sm-select option,.gjs-sm-sector .gjs-clm-select option,.gjs-clm-tags .gjs-clm-select option,.gjs-sm-sector .gjs-sm-select.gjs-clm-field option,.gjs-clm-tags .gjs-sm-select.gjs-clm-field option{padding:3px 0}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{background-color:rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.25)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-select,.gjs-clm-tags .gjs-sm-list.gjs-clm-select,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field{width:auto;padding:0;overflow:hidden;float:left}.gjs-sm-sector .gjs-sm-field.gjs-sm-list input,.gjs-clm-tags .gjs-sm-field.gjs-sm-list input,.gjs-sm-sector .gjs-sm-list.gjs-clm-select input,.gjs-clm-tags .gjs-sm-list.gjs-clm-select input,.gjs-sm-sector .gjs-sm-list.gjs-clm-field input,.gjs-clm-tags .gjs-sm-list.gjs-clm-field input{display:none}.gjs-sm-sector .gjs-sm-field.gjs-sm-list label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field label{cursor:pointer;padding:5px;display:block}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label{background-color:rgba(255,255,255,.2)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-icon{background-repeat:no-repeat;background-position:center;text-shadow:none;line-height:normal}.gjs-sm-sector .gjs-sm-field.gjs-sm-integer select,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-select select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-select select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field select{width:auto;padding:0}.gjs-sm-sector .gjs-sm-list .gjs-sm-el,.gjs-clm-tags .gjs-sm-list .gjs-sm-el{float:left;border-left:1px solid rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:first-child,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:first-child{border:none}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:hover,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:hover{background:rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-slider .gjs-field-integer,.gjs-clm-tags .gjs-sm-slider .gjs-field-integer{flex:1 1 65px}.gjs-sm-sector .gjs-sm-property,.gjs-clm-tags .gjs-sm-property{box-sizing:border-box;float:left;width:50%;margin-bottom:5px;padding:0 5px}.gjs-sm-sector .gjs-sm-property--full,.gjs-clm-tags .gjs-sm-property--full,.gjs-sm-sector .gjs-sm-property.gjs-sm-composite,.gjs-clm-tags .gjs-sm-property.gjs-sm-composite,.gjs-sm-sector .gjs-sm-property.gjs-sm-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file,.gjs-sm-sector .gjs-sm-property.gjs-sm-list,.gjs-clm-tags .gjs-sm-property.gjs-sm-list,.gjs-sm-sector .gjs-sm-property.gjs-sm-stack,.gjs-clm-tags .gjs-sm-property.gjs-sm-stack,.gjs-sm-sector .gjs-sm-property.gjs-sm-slider,.gjs-clm-tags .gjs-sm-property.gjs-sm-slider,.gjs-sm-sector .gjs-sm-property.gjs-sm-color,.gjs-clm-tags .gjs-sm-property.gjs-sm-color{width:100%}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn{background-color:rgba(33,33,33,.2);border-radius:2px;box-shadow:1px 1px 0 rgba(5,5,5,.2),1px 1px 0 rgba(43,43,43,.2) inset;padding:5px;position:relative;text-align:center;height:auto;width:100%;cursor:pointer;color:#ddd;box-sizing:border-box;text-shadow:-1px -1px 0 rgba(0,0,0,.2);border:none;opacity:.85;filter:alpha(opacity=85)}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn-c,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn-c{box-sizing:border-box;float:left;width:100%}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box{background-color:rgba(255,255,255,.05);border-radius:2px;margin-top:5px;position:relative;overflow:hidden}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show{border:1px solid rgba(252,252,252,.05);padding:3px 20px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{top:-5px;display:block}.gjs-sm-sector .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file{height:50px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file{background-size:auto 100%;background-repeat:no-repeat;background-position:center center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layers,.gjs-clm-tags .gjs-sm-property .gjs-sm-layers{margin-top:5px;padding:1px 3px;min-height:30px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer{background-color:rgba(255,255,255,.055);border-radius:2px;margin:2px 0;padding:7px;position:relative;cursor:pointer}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box{height:15px;position:absolute;right:27px;top:6px;width:15px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{border-radius:2px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.5;filter:alpha(opacity=50)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover{opacity:.8;filter:alpha(opacity=80)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box #gjs-sm-preview{background-color:#fff;height:100%;width:100%;background-size:cover !important}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer.gjs-sm-active,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer.gjs-sm-active{background-color:rgba(255,255,255,.12)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer.gjs-sm-no-preview #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer.gjs-sm-no-preview #gjs-sm-preview-box{display:none}.gjs-sm-sector #gjs-sm-text-shadow #gjs-sm-preview::after,.gjs-clm-tags #gjs-sm-text-shadow #gjs-sm-preview::after{color:#000;content:"T";font-weight:900;line-height:17px;padding:0 4px}.gjs-sm-sector .gjs-sm-stack .gjs-sm-properties,.gjs-clm-tags .gjs-sm-stack .gjs-sm-properties{padding:5px 0 0}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add{background:none;border:none;cursor:pointer;outline:none;font-size:22px;line-height:10px;position:absolute;right:0;top:-17px;opacity:.75}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add:hover,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add:hover{opacity:1;filter:alpha(opacity=100)}.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c{height:100%;width:20px;position:absolute;right:0;top:0;box-sizing:border-box;border-radius:2px;padding:2px}.gjs-sm-sector .gjs-sm-colorp-c .gjs-checker-bg,.gjs-clm-tags .gjs-sm-colorp-c .gjs-checker-bg,.gjs-sm-sector .gjs-sm-colorp-c .gjs-field-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-sm-sector .gjs-sm-color-picker,.gjs-clm-tags .gjs-sm-color-picker{background-color:#ddd;cursor:pointer;height:16px;width:100%;margin-top:-16px;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-upload,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-upload{left:0;top:0;position:absolute;width:100%;opacity:0;cursor:pointer}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-label,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-label{padding:2px 0}.gjs-sm-layer>#gjs-sm-move{opacity:.7;filter:alpha(opacity=70);cursor:move;font-size:12px;float:left;margin:0 5px 0 0}.gjs-sm-layer>#gjs-sm-move:hover{opacity:.9;filter:alpha(opacity=90)}.gjs-blocks-c{display:flex;flex-wrap:wrap;justify-content:flex-start}.gjs-block-categories{display:flex;flex-direction:column}.gjs-block-category{width:100%}.gjs-block-category .gjs-caret-icon{margin-right:5px}.gjs-block{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;width:45%;min-width:45px;padding:1em;box-sizing:border-box;min-height:90px;cursor:all-scroll;font-size:11px;font-weight:lighter;text-align:center;display:flex;flex-direction:column;justify-content:space-between;border:1px solid rgba(0,0,0,.2);border-radius:3px;margin:10px 2.5% 5px;box-shadow:0 1px 0 0 rgba(0,0,0,.15);transition:all .2s ease 0s;transition-property:box-shadow,color}.gjs-block:hover{box-shadow:0 3px 4px 0 rgba(0,0,0,.15)}.gjs-block svg{fill:currentColor}.gjs-block__media{margin-bottom:10px}.gjs-block-svg{width:54px;fill:currentColor}.gjs-block-svg-path{fill:currentColor}.gjs-block.fa{font-size:2em;line-height:2em;padding:11px}.gjs-block-label{line-height:normal;font-size:.65rem;font-weight:normal;font-family:Helvetica,sans-serif;overflow:hidden;text-overflow:ellipsis}.gjs-block.gjs-bdrag{width:auto;padding:0}.gjs-selected-parent{border:1px solid #ffca6f}.gjs-opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-layer{font-weight:lighter;text-align:left;position:relative;background-color:rgba(0,0,0,.1);font-size:.75rem;display:grid}.gjs-layer-hidden{opacity:.55;filter:alpha(opacity=55)}.gjs-layer-count{position:absolute;right:27px;top:9px}.gjs-layer-vis{height:auto !important;width:auto !important;left:0;top:0;padding:7px 5px 7px 10px;position:absolute;cursor:pointer;z-index:1}.gjs-layer-caret{font-size:.5rem;width:8px;padding:2px;cursor:pointer;position:absolute;left:-9px;top:6px;opacity:.7;filter:alpha(opacity=70)}.gjs-layer-caret:hover{opacity:1;filter:alpha(opacity=100)}.gjs-layer-title{padding:3px 10px 5px 30px;display:flex;align-items:center}.gjs-layer-title-inn{align-items:center;position:relative;display:flex;width:100%}.gjs-layer__icon{display:block;width:100%;max-width:15px;max-height:15px;padding-left:5px}.gjs-layer__icon svg{fill:currentColor}.gjs-layer-name{padding:5px 0;display:inline-block;box-sizing:content-box;overflow:hidden;white-space:nowrap;margin:0 30px 0 5px}.gjs-layer-name--no-edit{text-overflow:ellipsis}.gjs-layer>.gjs-layer-children{display:none}.gjs-layer.open>.gjs-layer-children{display:block}.gjs-layer-no-chld>.gjs-layer-title-inn>.gjs-layer-caret{display:none}.gjs-layer-move{padding:7px 10px 7px 5px;position:absolute;font-size:12px;cursor:move;right:0;top:0}.gjs-layer.gjs-hovered .gjs-layer-title{background-color:rgba(255,255,255,.015)}.gjs-layer.gjs-selected .gjs-layer-title{background-color:rgba(255,255,255,.1)}.gjs-layers{position:relative;height:100%}.gjs-layers #gjs-placeholder{width:100%;position:absolute}.gjs-layers #gjs-placeholder #gjs-plh-int{height:100%;padding:1px}.gjs-layers #gjs-placeholder #gjs-plh-int.gjs-insert{background-color:#62c462}#gjs-clm-add-tag,.gjs-clm-tags-btn{background-color:rgba(255,255,255,.15);border-radius:2px;padding:3px;margin-right:3px;border:1px solid rgba(0,0,0,.15);width:24px;height:24px;box-sizing:border-box;cursor:pointer}.gjs-clm-tags-btn svg{fill:currentColor;display:block}.gjs-clm-header{display:flex;align-items:center;margin:7px 0}.gjs-clm-header-status{flex-shrink:1;margin-left:auto}.gjs-clm-tag{display:flex;overflow:hidden;align-items:center;border-radius:3px;margin:0 3px 3px 0;padding:5px;cursor:default}.gjs-clm-tag-status,.gjs-clm-tag-close{width:12px;height:12px;flex-shrink:1}.gjs-clm-tag-status svg,.gjs-clm-tag-close svg{vertical-align:middle;fill:currentColor}.gjs-clm-sels-info{margin:7px 0}.gjs-clm-sel-id{font-size:.9em;opacity:.5;filter:alpha(opacity=50)}.gjs-clm-label-sel{float:left;padding-right:5px}.gjs-clm-tags{font-size:.75rem;padding:10px 5px}.gjs-clm-tags #gjs-clm-sel{padding:7px 0;float:left}.gjs-clm-tags #gjs-clm-sel{font-style:italic;margin-left:5px}.gjs-clm-tags #gjs-clm-tags-field{clear:both;padding:5px;margin-bottom:5px;display:flex;flex-wrap:wrap}.gjs-clm-tags #gjs-clm-tags-c{display:flex;flex-wrap:wrap;vertical-align:top;overflow:hidden}.gjs-clm-tags #gjs-clm-new{color:#ddd;padding:5px 6px;display:none}.gjs-clm-tags #gjs-clm-close{opacity:.85;filter:alpha(opacity=85);font-size:20px;line-height:0;cursor:pointer;color:rgba(255,255,255,.9)}.gjs-clm-tags #gjs-clm-close:hover{opacity:1;filter:alpha(opacity=100)}.gjs-clm-tags #gjs-clm-checkbox{color:rgba(255,255,255,.9);vertical-align:middle;cursor:pointer;font-size:9px}.gjs-clm-tags #gjs-clm-tag-label{flex-grow:1;text-overflow:ellipsis;overflow:hidden;padding:0 3px;cursor:text}.gjs-mdl-container{font-family:Helvetica,sans-serif;overflow-y:auto;position:fixed;background-color:rgba(0,0,0,.5);display:flex;top:0;left:0;right:0;bottom:0;z-index:100}.gjs-mdl-dialog{text-shadow:-1px -1px 0 rgba(0,0,0,.05);animation:gjs-slide-down .215s;margin:auto;max-width:850px;width:90%;border-radius:3px;font-weight:lighter;position:relative;z-index:2}.gjs-mdl-title{font-size:1rem}.gjs-mdl-btn-close{position:absolute;right:15px;top:5px}.gjs-mdl-active .gjs-mdl-dialog{animation:gjs-mdl-slide-down .216s}.gjs-mdl-header,.gjs-mdl-content{padding:10px 15px;clear:both}.gjs-mdl-header{position:relative;border-bottom:1px solid rgba(0,0,0,.2);padding:15px 15px 7px}.gjs-export-dl::after{content:"";clear:both;display:block;margin-bottom:10px}.gjs-dropzone{display:none;opacity:0;position:absolute;top:0;left:0;z-index:11;width:100%;height:100%;transition:opacity .25s;pointer-events:none}.gjs-dropzone-active .gjs-dropzone{display:block;opacity:1}.gjs-am-assets{height:290px;overflow:auto;clear:both;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:flex-start}.gjs-am-assets-header{padding:5px}.gjs-am-add-asset .gjs-am-add-field{width:70%;float:left}.gjs-am-add-asset button{width:25%;float:right}.gjs-am-preview-cont{position:relative;height:70px;width:30%;background-color:#444;border-radius:2px;float:left;overflow:hidden}.gjs-am-preview{position:absolute;background-position:center center;background-size:cover;background-repeat:no-repeat;height:100%;width:100%;z-index:1}.gjs-am-preview-bg{opacity:.5;filter:alpha(opacity=50);position:absolute;height:100%;width:100%;z-index:0}.gjs-am-dimensions{opacity:.5;filter:alpha(opacity=50);font-size:10px}.gjs-am-meta{width:70%;float:left;font-size:12px;padding:5px 0 0 5px;box-sizing:border-box}.gjs-am-meta>div{margin-bottom:5px}.gjs-am-close{cursor:pointer;position:absolute;right:5px;top:0;display:none}.gjs-am-asset{border-bottom:1px solid rgba(0,0,0,.2);padding:5px;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.gjs-am-asset:hover .gjs-am-close{display:block}.gjs-am-highlight{background-color:rgba(255,255,255,.1)}.gjs-am-assets-cont{background-color:rgba(0,0,0,.1);border-radius:3px;box-sizing:border-box;padding:10px;width:45%;float:right;height:325px;overflow:hidden}.gjs-am-file-uploader{width:55%;float:left}.gjs-am-file-uploader>form{background-color:rgba(0,0,0,.1);border:2px dashed;border-radius:3px;position:relative;text-align:center;margin-bottom:15px}.gjs-am-file-uploader>form.gjs-am-hover{border:2px solid #62c462;color:#75cb75}.gjs-am-file-uploader>form.gjs-am-disabled{border-color:red}.gjs-am-file-uploader>form #gjs-am-uploadFile{opacity:0;filter:alpha(opacity=0);padding:150px 10px;width:100%;box-sizing:border-box}.gjs-am-file-uploader #gjs-am-title{position:absolute;padding:150px 10px;width:100%}.gjs-cm-editor-c{float:left;box-sizing:border-box;width:50%}.gjs-cm-editor-c .CodeMirror{height:450px}.gjs-cm-editor{font-size:12px}.gjs-cm-editor#gjs-cm-htmlmixed{padding-right:10px;border-right:1px solid rgba(0,0,0,.2)}.gjs-cm-editor#gjs-cm-htmlmixed #gjs-cm-title{color:#a97d44}.gjs-cm-editor#gjs-cm-css{padding-left:10px}.gjs-cm-editor#gjs-cm-css #gjs-cm-title{color:#ddca7e}.gjs-cm-editor #gjs-cm-title{background-color:rgba(0,0,0,.2);font-size:12px;padding:5px 10px 3px;text-align:right}.gjs-rte-toolbar{border:1px solid rgba(0,0,0,.2);position:absolute;border-radius:3px;z-index:10}.gjs-rte-actionbar{display:flex}.gjs-rte-action{display:flex;align-items:center;justify-content:center;padding:5px;min-width:25px;border-right:1px solid rgba(0,0,0,.2);text-align:center;cursor:pointer;outline:none}.gjs-rte-action:last-child{border-right:none}.gjs-rte-action:hover{background-color:rgba(255,255,255,.1)}.gjs-rte-active{background-color:rgba(255,255,255,.1)}.gjs-rte-disabled{color:rgba(255,255,255,.1);cursor:not-allowed}.gjs-rte-disabled:hover{background-color:unset}.gjs-editor-cont .sp-hue,.gjs-editor-cont .sp-slider{cursor:row-resize}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-dragger{cursor:crosshair}.gjs-editor-cont .sp-alpha-inner,.gjs-editor-cont .sp-alpha-handle{cursor:col-resize}.gjs-editor-cont .sp-hue{left:90%}.gjs-editor-cont .sp-color{right:15%}.gjs-editor-cont .sp-container{border:1px solid rgba(0,0,0,.2);box-shadow:0 0 7px rgba(0,0,0,.2);border-radius:3px}.gjs-editor-cont .sp-picker-container{border:none}.gjs-editor-cont .colpick_dark .colpick_color{outline:1px solid rgba(0,0,0,.2)}.gjs-editor-cont .sp-cancel,.gjs-editor-cont .sp-cancel:hover{bottom:-8px;color:#777 !important;font-size:25px;left:0;position:absolute;text-decoration:none}.gjs-editor-cont .sp-alpha-handle{background-color:#ccc;border:1px solid #555;width:4px}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-hue{border:1px solid #333}.gjs-editor-cont .sp-slider{background-color:#ccc;border:1px solid #555;height:3px;left:-4px;width:22px}.gjs-editor-cont .sp-dragger{background:transparent;box-shadow:0 0 0 1px #111}.gjs-editor-cont .sp-button-container{float:none;width:100%;position:relative;text-align:right}.gjs-editor-cont .sp-container button,.gjs-editor-cont .sp-container button:hover,.gjs-editor-cont .sp-container button:active{background:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2);color:#ddd;text-shadow:none;box-shadow:none;padding:3px 5px}.gjs-editor-cont .sp-palette-container{border:none;float:none;margin:0;padding:5px 10px 0}.gjs-editor-cont .sp-palette .sp-thumb-el,.gjs-editor-cont .sp-palette .sp-thumb-el:hover{border:1px solid rgba(0,0,0,.9)}.gjs-editor-cont .sp-palette .sp-thumb-el:hover,.gjs-editor-cont .sp-palette .sp-thumb-el.sp-thumb-active{border-color:rgba(0,0,0,.9)}.gjs-hidden{display:none}@keyframes gjs-slide-down{0%{transform:translate(0, -3rem);opacity:0}100%{transform:translate(0, 0);opacity:1}}@keyframes gjs-slide-up{0%{transform:translate(0, 0);opacity:1}100%{transform:translate(0, -3rem);opacity:0}}.cm-s-hopscotch span.cm-error{color:#fff} +.sp-container{position:absolute;top:0;left:0;display:inline-block;*display:inline;*zoom:1;z-index:9999994;overflow:hidden}.sp-container.sp-flat{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{position:relative;width:100%;display:inline-block}.sp-top-inner{position:absolute;top:0;left:0;bottom:0;right:0}.sp-color{position:absolute;top:0;left:0;bottom:0;right:20%}.sp-hue{position:absolute;top:0;right:0;bottom:0;left:84%;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{position:absolute;top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{position:absolute;top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid black;background:white;opacity:.8}.sp-alpha{display:none;position:absolute;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:solid 1px #333}.sp-clear{display:none}.sp-clear.sp-clear-display{background-position:center}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0px;right:0;bottom:0;left:84%;height:28px}.sp-container,.sp-replacer,.sp-preview,.sp-dragger,.sp-slider,.sp-alpha,.sp-clear,.sp-alpha-handle,.sp-container.sp-dragging .sp-input,.sp-container button{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-input-disabled .sp-input-container{display:none}.sp-container.sp-buttons-disabled .sp-button-container{display:none}.sp-container.sp-palette-buttons-disabled .sp-palette-button-container{display:none}.sp-palette-only .sp-picker-container{display:none}.sp-palette-disabled .sp-palette-container{display:none}.sp-initial-disabled .sp-initial{display:none}.sp-sat{background-image:-webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:linear-gradient(to right, #fff, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr="#FFFFFFFF", endColorstr="#00CC9A81")}.sp-val{background-image:-webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:linear-gradient(to top, #000, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00CC9A81", endColorstr="#FF000000")}.sp-hue{background:-moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));background:-webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff0000", endColorstr="#ffff00")}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffff00", endColorstr="#00ff00")}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ff00", endColorstr="#00ffff")}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffff", endColorstr="#0000ff")}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0000ff", endColorstr="#ff00ff")}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff00ff", endColorstr="#ff0000")}.sp-hidden{display:none !important}.sp-cf:before,.sp-cf:after{content:"";display:table}.sp-cf:after{clear:both}.sp-cf{*zoom:1}@media(max-device-width: 480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;cursor:pointer;position:absolute;top:0;left:0}.sp-slider{position:absolute;top:0;cursor:pointer;height:3px;left:-1px;right:-1px;border:1px solid #000;background:white;opacity:.8}.sp-container{border-radius:0;background-color:#ececec;border:solid 1px #f0c49b;padding:0}.sp-container,.sp-container button,.sp-container input,.sp-color,.sp-hue,.sp-clear{font:normal 12px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-color,.sp-hue,.sp-clear{border:solid 1px #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container{width:100%}.sp-input{font-size:12px !important;border:1px inset;padding:4px 5px;margin:0;width:100%;background:transparent;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-picker-container,.sp-palette-container{float:left;position:relative;padding:10px;padding-bottom:300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:solid 1px #fff}.sp-palette-container{border-right:solid 1px #ccc}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;width:24px;height:15px;margin:3px;cursor:pointer;border:solid 2px transparent}.sp-palette .sp-thumb-el:hover,.sp-palette .sp-thumb-el.sp-thumb-active{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:solid 1px #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:center}.sp-palette-button-container,.sp-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;*zoom:1;*display:inline;border:solid 1px #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer:hover,.sp-replacer.sp-active{border-color:#f0c49b;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px}.sp-preview{position:relative;width:25px;height:20px;border:solid 1px #222;margin-right:5px;float:left;z-index:0}.sp-palette{*width:220px;max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:solid 1px #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top, #eeeeee, #cccccc);background-image:-moz-linear-gradient(top, #eeeeee, #cccccc);background-image:-ms-linear-gradient(top, #eeeeee, #cccccc);background-image:-o-linear-gradient(top, #eeeeee, #cccccc);background-image:linear-gradient(to bottom, #eeeeee, #cccccc);border:1px solid #ccc;border-bottom:1px solid #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top, #dddddd, #bbbbbb);background-image:-moz-linear-gradient(top, #dddddd, #bbbbbb);background-image:-ms-linear-gradient(top, #dddddd, #bbbbbb);background-image:-o-linear-gradient(top, #dddddd, #bbbbbb);background-image:linear-gradient(to bottom, #dddddd, #bbbbbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid #aaa;border-bottom:1px solid #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f !important;margin:0;padding:2px;margin-right:5px;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f !important;text-decoration:underline}.sp-palette span:hover,.sp-palette span.sp-thumb-active{border-color:#000}.sp-preview,.sp-alpha,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-preview-inner,.sp-alpha-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==)}.CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20, 255, 20, 0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:blue}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, 0.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, 0.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-hopscotch.CodeMirror{background:#322931;color:#d5d3d5}.cm-s-hopscotch div.CodeMirror-selected{background:#433b42 !important}.cm-s-hopscotch .CodeMirror-gutters{background:#322931;border-right:0px}.cm-s-hopscotch .CodeMirror-linenumber{color:#797379}.cm-s-hopscotch .CodeMirror-cursor{border-left:1px solid #989498 !important}.cm-s-hopscotch span.cm-comment{color:#b33508}.cm-s-hopscotch span.cm-atom{color:#c85e7c}.cm-s-hopscotch span.cm-number{color:#c85e7c}.cm-s-hopscotch span.cm-property,.cm-s-hopscotch span.cm-attribute{color:#8fc13e}.cm-s-hopscotch span.cm-keyword{color:#dd464c}.cm-s-hopscotch span.cm-string{color:#fdcc59}.cm-s-hopscotch span.cm-variable{color:#8fc13e}.cm-s-hopscotch span.cm-variable-2{color:#1290bf}.cm-s-hopscotch span.cm-def{color:#fd8b19}.cm-s-hopscotch span.cm-error{background:#dd464c;color:#989498}.cm-s-hopscotch span.cm-bracket{color:#d5d3d5}.cm-s-hopscotch span.cm-tag{color:#dd464c}.cm-s-hopscotch span.cm-link{color:#c85e7c}.cm-s-hopscotch .CodeMirror-matchingbracket{text-decoration:underline;color:white !important}.cm-s-hopscotch .CodeMirror-activeline-background{background:#302020}@font-face{font-family:"font3336";src:url("../fonts/main-fonts.eot?v=20");src:url("../fonts/main-fonts.woff?v=20") format("woff"),url("../fonts/main-fonts.ttf?v=20") format("truetype"),url("../fonts/main-fonts.svg?v=20") format("svg"),url("../fonts/main-fonts.eot?v=20") format("embedded-opentype");font-weight:normal;font-style:normal}.gjs-is__grab,.gjs-is__grab *{cursor:grab !important}.gjs-is__grabbing,.gjs-is__grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:grabbing !important}.gjs-one-bg{background-color:#444}.gjs-one-color{color:#444}.gjs-one-color-h:hover{color:#444}.gjs-two-bg{background-color:#ddd}.gjs-two-color{color:#ddd}.gjs-two-color-h:hover{color:#ddd}.gjs-three-bg{background-color:#804f7b}.gjs-three-color{color:#804f7b}.gjs-three-color-h:hover{color:#804f7b}.gjs-four-bg{background-color:#d278c9}.gjs-four-color{color:#d278c9}.gjs-four-color-h:hover{color:#d278c9}.gjs-danger-bg{background-color:#dd3636}.gjs-danger-color{color:#dd3636}.gjs-danger-color-h:hover{color:#dd3636}.gjs-bg-main,.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c,.gjs-off-prv{background-color:#444}.gjs-color-main,.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add,.gjs-off-prv{color:#ddd;fill:#ddd}.gjs-color-active{color:#f8f8f8;fill:#f8f8f8}.gjs-color-warn{color:#ffca6f;fill:#ffca6f}.gjs-color-hl{color:#71b7f1;fill:#71b7f1}.gjs-fonts::before{display:block;font:normal normal normal 14px font3336;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:5em}.gjs-f-b1::before{content:"Q"}.gjs-f-b2::before{content:"W"}.gjs-f-b3::before{content:"E"}.gjs-f-b37::before{content:"R"}.gjs-f-hero::before{content:"T"}.gjs-f-h1p::before{content:"y"}.gjs-f-3ba::before{content:"u"}.gjs-f-image::before{content:"I"}.gjs-f-text::before{content:"o"}.gjs-f-quo::before{content:"p"}.gjs-f-button::before{content:"B"}.gjs-f-divider::before{content:"D"}.gjs-invis-invis,.gjs-clm-tags #gjs-clm-new,.gjs-no-app{background-color:transparent;border:none;color:inherit}.gjs-no-app{height:10px}.gjs-test::btn{color:"#fff"}.opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-checker-bg,.gjs-field-colorp-c,.checker-bg,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==")}.gjs-no-user-select,.gjs-rte-toolbar,.gjs-layer-name,.gjs-grabbing,.gjs-grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-pointer-events,.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el,.gjs-resizer-c{pointer-events:none}.gjs-bdrag{pointer-events:none !important;position:absolute !important;z-index:10 !important;width:auto}.gjs-drag-helper{background-color:#3b97e3 !important;pointer-events:none !important;position:absolute !important;z-index:10 !important;transform:scale(0.3) !important;transform-origin:top left !important;-webkit-transform-origin:top left !important;margin:15px !important;transition:none !important;outline:none !important}.gjs-grabbing,.gjs-grabbing *{cursor:grabbing !important;cursor:-webkit-grabbing !important}.gjs-grabbing{overflow:hidden}.gjs-off-prv{position:relative;z-index:10;padding:5px;cursor:pointer}.gjs-editor-cont ::-webkit-scrollbar-track{background:rgba(0,0,0,.1)}.gjs-editor-cont ::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.2)}.gjs-editor-cont ::-webkit-scrollbar{width:8px}.clear{clear:both}.no-select,.gjs-clm-tags #gjs-clm-close,.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title,.gjs-com-no-select,.gjs-com-no-select img{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-touch-actions{touch-action:none}.gjs-disabled{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;opacity:.5;filter:alpha(opacity=50)}.gjs-editor{font-family:Helvetica,sans-serif;font-size:.75rem;position:relative;box-sizing:border-box;height:100%}.gjs-freezed,.gjs-freezed{opacity:.5;filter:alpha(opacity=50);pointer-events:none}.gjs-traits-label{border-bottom:1px solid rgba(0,0,0,.2);font-weight:lighter;margin-bottom:5px;padding:10px;text-align:left}.gjs-label-wrp{width:30%;min-width:30%}.gjs-field-wrp{flex-grow:1}.gjs-trt-header{font-weight:lighter;padding:10px}.gjs-trt-trait{display:flex;justify-content:flex-start;padding:5px 10px;font-weight:lighter;align-items:center;text-align:left}.gjs-trt-traits{font-size:.75rem}.gjs-trt-trait .gjs-label{text-align:left;text-overflow:ellipsis;overflow:hidden}.gjs-guide-info{position:absolute}.gjs-guide-info__content{position:absolute;height:100%;display:flex;width:100%;padding:5px}.gjs-guide-info__line{position:relative;margin:auto}.gjs-guide-info__line::before,.gjs-guide-info__line::after{content:"";display:block;position:absolute;background-color:inherit}.gjs-guide-info__y{padding:0 5px}.gjs-guide-info__y .gjs-guide-info__content{justify-content:center}.gjs-guide-info__y .gjs-guide-info__line{width:100%;height:1px}.gjs-guide-info__y .gjs-guide-info__line::before,.gjs-guide-info__y .gjs-guide-info__line::after{width:1px;height:10px;top:0;bottom:0;left:0;margin:auto}.gjs-guide-info__y .gjs-guide-info__line::after{left:auto;right:0}.gjs-guide-info__x{padding:5px 0}.gjs-guide-info__x .gjs-guide-info__content{align-items:center}.gjs-guide-info__x .gjs-guide-info__line{height:100%;width:1px}.gjs-guide-info__x .gjs-guide-info__line::before,.gjs-guide-info__x .gjs-guide-info__line::after{width:10px;height:1px;left:0;right:0;top:0;margin:auto;transform:translateX(-50%)}.gjs-guide-info__x .gjs-guide-info__line::after{top:auto;bottom:0}.gjs-badge{white-space:nowrap}.gjs-badge__icon{vertical-align:middle;display:inline-block;width:15px;height:15px}.gjs-badge__icon svg{fill:currentColor}.gjs-badge__name{display:inline-block;vertical-align:middle}.gjs-frame-wrapper{position:absolute;width:100%;height:100%;left:0;right:0;margin:auto}.gjs-frame-wrapper--anim{transition:width .35s ease,height .35s ease}.gjs-frame-wrapper__top{transform:translateY(-100%) translateX(-50%);display:flex;padding:5px 0;position:absolute;width:100%;left:50%;top:0}.gjs-frame-wrapper__top-r{margin-left:auto}.gjs-frame-wrapper__left{position:absolute;left:0;transform:translateX(-100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__bottom{position:absolute;bottom:0;transform:translateY(100%) translateX(-50%);width:100%;left:50%}.gjs-frame-wrapper__right{position:absolute;right:0;transform:translateX(100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__icon{width:24px;cursor:pointer}.gjs-frame-wrapper__icon>svg{fill:currentColor}.gjs-padding-v-top,.gjs-fixedpadding-v-top{width:100%;top:0;left:0}.gjs-padding-v-right,.gjs-fixedpadding-v-right{right:0}.gjs-padding-v-bottom,.gjs-fixedpadding-v-bottom{width:100%;left:0;bottom:0}.gjs-padding-v-left,.gjs-fixedpadding-v-left{left:0}.gjs-cv-canvas{background-color:rgba(0,0,0,.15);box-sizing:border-box;width:85%;height:calc(100% - 40px);bottom:0;overflow:hidden;z-index:1;position:absolute;left:0;top:40px}.gjs-cv-canvas.gjs-cui{width:100%;height:100%;top:0}.gjs-cv-canvas.gjs-is__grab .gjs-cv-canvas__frames,.gjs-cv-canvas.gjs-is__grabbing .gjs-cv-canvas__frames{pointer-events:none}.gjs-cv-canvas__frames{position:absolute;top:0;left:0;width:100%;height:100%}.gjs-cv-canvas .gjs-ghost{display:none;pointer-events:none;background-color:#5b5b5b;border:2px dashed #ccc;position:absolute;z-index:10;opacity:.55;filter:alpha(opacity=55)}.gjs-cv-canvas .gjs-highlighter,.gjs-cv-canvas .gjs-highlighter-sel{position:absolute;outline:1px solid #3b97e3;outline-offset:-1px;pointer-events:none;width:100%;height:100%}.gjs-cv-canvas .gjs-highlighter-warning{outline:3px solid #ffca6f}.gjs-cv-canvas .gjs-highlighter-sel{outline:2px solid #3b97e3;outline-offset:-2px}.gjs-cv-canvas #gjs-tools,.gjs-cv-canvas .gjs-tools{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;z-index:1}.gjs-cv-canvas *{box-sizing:border-box}.gjs-frame{outline:medium none;height:100%;width:100%;border:none;margin:auto;display:block;transition:width .35s ease,height .35s ease;position:absolute;top:0;bottom:0;left:0;right:0}.gjs-toolbar{position:absolute;background-color:#3b97e3;white-space:nowrap;color:#fff;z-index:10;top:0;left:0}.gjs-toolbar-item{padding:5px 7px;font-size:.8rem;cursor:pointer;width:26px;vertical-align:middle;display:inline-block}.gjs-toolbar-item svg{fill:currentColor;vertical-align:middle}.gjs-resizer-c{position:absolute;left:0;top:0;width:100%;height:100%;z-index:9}.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.1;filter:alpha(opacity=10);position:absolute;background-color:#ff0}.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.2;filter:alpha(opacity=20)}.gjs-padding-v-el,.gjs-fixedpadding-v-el{background-color:navy}.gjs-resizer-h{pointer-events:all;position:absolute;border:3px solid #3b97e3;width:10px;height:10px;background-color:#fff;margin:-5px}.gjs-resizer-h-tl{top:0;left:0;cursor:nwse-resize}.gjs-resizer-h-tr{top:0;right:0;cursor:nesw-resize}.gjs-resizer-h-tc{top:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-cl{left:0;margin:auto -5px;top:0;bottom:0;cursor:ew-resize}.gjs-resizer-h-cr{margin:auto -5px;top:0;bottom:0;right:0;cursor:ew-resize}.gjs-resizer-h-bl{bottom:0;left:0;cursor:nesw-resize}.gjs-resizer-h-bc{bottom:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-br{bottom:0;right:0;cursor:nwse-resize}.gjs-pn-panel .gjs-resizer-h{background-color:rgba(0,0,0,.2);border:none;opacity:0;transition:opacity .25s}.gjs-pn-panel .gjs-resizer-h:hover{opacity:1}.gjs-pn-panel .gjs-resizer-h-tc,.gjs-pn-panel .gjs-resizer-h-bc{margin:0 auto;width:100%}.gjs-pn-panel .gjs-resizer-h-cr,.gjs-pn-panel .gjs-resizer-h-cl{margin:auto 0;height:100%}.gjs-resizing .gjs-highlighter,.gjs-resizing .gjs-badge{display:none !important}.gjs-resizing-tl *{cursor:nwse-resize !important}.gjs-resizing-tr *{cursor:nesw-resize !important}.gjs-resizing-tc *{cursor:ns-resize !important}.gjs-resizing-cl *{cursor:ew-resize !important}.gjs-resizing-cr *{cursor:ew-resize !important}.gjs-resizing-bl *{cursor:nesw-resize !important}.gjs-resizing-bc *{cursor:ns-resize !important}.gjs-resizing-br *{cursor:nwse-resize !important}.btn-cl,.gjs-am-close,.gjs-mdl-btn-close{opacity:.3;filter:alpha(opacity=30);font-size:25px;cursor:pointer}.btn-cl:hover,.gjs-am-close:hover,.gjs-mdl-btn-close:hover{opacity:.7;filter:alpha(opacity=70)}.no-dots,.ui-resizable-handle{border:none !important;margin:0 !important;outline:none !important}.gjs-com-dashed *{outline:1px dashed #888;outline-offset:-2px;box-sizing:border-box}.gjs-cv-canvas .gjs-comp-selected{outline:3px solid #3b97e3 !important}*.gjs-com-hover,div.gjs-com-hover{outline:1px solid #3b97e3}*.gjs-com-hover-delete,div.gjs-com-hover-delete{outline:2px solid #dd3636;opacity:.5;filter:alpha(opacity=50)}*.gjs-com-hover-move,div.gjs-com-hover-move{outline:3px solid #ffca6f}.gjs-com-badge,.gjs-com-badge-red,.gjs-badge{pointer-events:none;background-color:#3b97e3;color:#fff;padding:2px 5px;position:absolute;z-index:1;font-size:12px;outline:none;display:none}.gjs-com-badge-red{background-color:#dd3636}.gjs-badge-warning{background-color:#ffca6f}.gjs-placeholder,.gjs-com-placeholder,.gjs-placeholder{position:absolute;z-index:10;pointer-events:none;display:none}.gjs-placeholder,.gjs-placeholder{border-style:solid !important;outline:none;box-sizing:border-box;transition:top .2s,left .2s,width .2s,height .2s}.gjs-placeholder.horizontal,.gjs-com-placeholder.horizontal,.gjs-placeholder.horizontal{border-color:transparent #62c462;border-width:3px 5px;margin:-3px 0 0}.gjs-placeholder.vertical,.gjs-com-placeholder.vertical,.gjs-placeholder.vertical{border-color:#62c462 transparent;border-width:5px 3px;margin:0 0 0 -3px}.gjs-placeholder-int,.gjs-com-placeholder-int,.gjs-placeholder-int{background-color:#62c462;box-shadow:0 0 3px rgba(0,0,0,.2);height:100%;width:100%;pointer-events:none;padding:1.5px;outline:none}.gjs-pn-panel{display:inline-block;position:absolute;box-sizing:border-box;text-align:center;padding:5px;z-index:3}.gjs-pn-panel .icon-undo,.gjs-pn-panel .icon-redo{font-size:20px;height:30px;width:25px}.gjs-pn-commands{width:85%;left:0;top:0;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-options{right:15%;top:0}.gjs-pn-views{border-bottom:2px solid rgba(0,0,0,.2);right:0;width:15%;z-index:4}.gjs-pn-views-container{height:100%;padding:42px 0 0;right:0;width:15%;overflow:auto;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-buttons{align-items:center;display:flex;justify-content:space-between}.gjs-pn-btn{box-sizing:border-box;min-height:30px;min-width:30px;line-height:21px;background-color:transparent;border:none;font-size:18px;margin-right:5px;border-radius:2px;padding:4px;position:relative;cursor:pointer}.gjs-pn-btn.gjs-pn-active{background-color:rgba(0,0,0,.15);box-shadow:0 0 3px rgba(0,0,0,.25) inset}.gjs-pn-btn svg{fill:currentColor}.gjs-comp-image-placeholder{display:block;background-color:#f5f5f5;color:#777;height:50px;width:50px;line-height:50px;outline:3px solid #ffca6f;outline-offset:-3px;text-align:center;font-size:16.6666666667px;cursor:pointer}.gjs-comp-image-placeholder.fa-picture-o::after{content:""}.gjs-label{line-height:18px}.gjs-fields{display:flex}.gjs-select{padding:0;width:100%}.gjs-select select{padding-right:10px}.gjs-select:-moz-focusring,.gjs-select select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-input:focus,.gjs-button:focus,.gjs-btn-prim:focus,.gjs-select:focus,.gjs-select select:focus{outline:none}.gjs-field input,.gjs-field select,.gjs-field textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:inherit;border:none;background-color:transparent;box-sizing:border-box;width:100%;position:relative;padding:5px;z-index:1}.gjs-field input:focus,.gjs-field select:focus,.gjs-field textarea:focus{outline:none}.gjs-field input[type=number]{-moz-appearance:textfield}.gjs-field input[type=number]::-webkit-outer-spin-button,.gjs-field input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gjs-field-range{flex:9 1 auto}.gjs-field-integer input{padding-right:30px}.gjs-select option,.gjs-field-select option,.gjs-clm-select option,.gjs-sm-select option,.gjs-fields option,.gjs-sm-unit option{background-color:#444;color:#ddd}.gjs-field{background-color:rgba(0,0,0,.2);border:none;box-shadow:none;border-radius:2px;box-sizing:border-box;padding:0;position:relative}.gjs-field textarea{resize:vertical}.gjs-field .gjs-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;z-index:0}.gjs-field .gjs-d-s-arrow{bottom:0;top:0;margin:auto;right:5px;border-top:4px solid rgba(255,255,255,.7);position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-field-arrows{position:absolute;cursor:ns-resize;margin:auto;height:20px;width:9px;z-index:10;bottom:0;right:3px;top:0}.gjs-field-color,.gjs-field-radio{width:100%}.gjs-field-color input{padding-right:22px;box-sizing:border-box}.gjs-field-colorp{border-left:1px solid rgba(0,0,0,.2);box-sizing:border-box;height:100%;padding:2px;position:absolute;right:0;top:0;width:22px;z-index:10}.gjs-field-colorp .gjs-checker-bg,.gjs-field-colorp .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-field-colorp-c{height:100%;position:relative;width:100%}.gjs-field-color-picker{background-color:#ddd;cursor:pointer;height:100%;width:100%;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px;position:absolute;top:0}.gjs-field-checkbox{padding:0;width:17px;height:17px;display:block;cursor:pointer}.gjs-field-checkbox input{display:none}.gjs-field-checkbox input:checked+.gjs-chk-icon{border-color:rgba(255,255,255,.5);border-width:0 2px 2px 0;border-style:solid}.gjs-radio-item{flex:1 1 auto;text-align:center;border-left:1px solid rgba(0,0,0,.2)}.gjs-radio-item:first-child{border:none}.gjs-radio-item:hover{background:rgba(0,0,0,.2)}.gjs-radio-item input{display:none}.gjs-radio-item input:checked+.gjs-radio-item-label{background-color:rgba(255,255,255,.2)}.gjs-radio-items{display:flex}.gjs-radio-item-label{cursor:pointer;display:block;padding:5px}.gjs-field-units{position:absolute;margin:auto;right:10px;bottom:0;top:0}.gjs-field-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-field-arrow-u,.gjs-field-arrow-d{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(255,255,255,.7);bottom:4px;cursor:pointer}.gjs-field-arrow-u{border-bottom:4px solid rgba(255,255,255,.7);border-top:none;top:4px}.gjs-field-select{padding:0}.gjs-field-range{background-color:transparent;border:none;box-shadow:none;padding:0}.gjs-field-range input{margin:0;height:100%}.gjs-field-range input:focus{outline:none}.gjs-field-range input::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-ms-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-webkit-slider-runnable-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-ms-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-btn-prim{color:inherit;background-color:rgba(255,255,255,.1);border-radius:2px;padding:3px 6px;padding:5px;cursor:pointer;border:none}.gjs-btn-prim:active{background-color:rgba(255,255,255,.1)}.gjs-btn--full{width:100%}.gjs-chk-icon{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);box-sizing:border-box;display:block;height:14px;margin:0 5px;width:6px}.gjs-add-trasp{background:none;border:none;color:#ddd;cursor:pointer;font-size:1em;border-radius:2px;opacity:.75;filter:alpha(opacity=75)}.gjs-add-trasp:hover{opacity:1;filter:alpha(opacity=100)}.gjs-add-trasp:active{background-color:rgba(0,0,0,.2)}.gjs-devices-c{display:flex;align-items:center;padding:3px}.gjs-devices-c .gjs-device-label{flex-grow:2;text-align:left;margin-right:10px}.gjs-devices-c .gjs-select{flex-grow:20}.gjs-devices-c .gjs-add-trasp{flex-grow:1;margin-left:5px}.gjs-category-open,.gjs-block-category.gjs-open,.gjs-sm-sector.gjs-sm-open,.gjs-sm-open.gjs-clm-tags{border-bottom:1px solid rgba(0,0,0,.25)}.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title{font-weight:lighter;background-color:rgba(0,0,0,.1);letter-spacing:1px;padding:9px 10px 9px 20px;border-bottom:1px solid rgba(0,0,0,.25);text-align:left;position:relative;cursor:pointer}.gjs-sm-clear{line-height:0;cursor:pointer}.gjs-sm-header{font-weight:lighter;padding:10px}.gjs-sm-properties{font-size:.75rem;padding:10px 5px;display:flex;flex-wrap:wrap;align-items:flex-end;box-sizing:border-box;width:100%}.gjs-sm-label{margin:5px 5px 3px 0}.gjs-sm-close-btn,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.2;filter:alpha(opacity=20)}.gjs-sm-close-btn:hover,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover{opacity:.7;filter:alpha(opacity=70)}.gjs-sm-sector,.gjs-clm-tags{clear:both;font-weight:lighter;text-align:left}.gjs-sm-sector #gjs-sm-caret,.gjs-clm-tags #gjs-sm-caret{padding-right:5px;font-size:11px}.gjs-sm-sector .gjs-sm-field,.gjs-clm-tags .gjs-sm-field,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-clm-field,.gjs-clm-tags .gjs-clm-field{width:100%;position:relative}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input,.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{background-color:transparent;color:rgba(255,255,255,.7);border:none;width:100%}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input{box-sizing:border-box}.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gjs-sm-sector .gjs-sm-field select::-ms-expand,.gjs-clm-tags .gjs-sm-field select::-ms-expand,.gjs-sm-sector .gjs-clm-select select::-ms-expand,.gjs-clm-tags .gjs-clm-select select::-ms-expand,.gjs-sm-sector .gjs-clm-field select::-ms-expand,.gjs-clm-tags .gjs-clm-field select::-ms-expand{display:none}.gjs-sm-sector .gjs-sm-field select:-moz-focusring,.gjs-clm-tags .gjs-sm-field select:-moz-focusring,.gjs-sm-sector .gjs-clm-select select:-moz-focusring,.gjs-clm-tags .gjs-clm-select select:-moz-focusring,.gjs-sm-sector .gjs-clm-field select:-moz-focusring,.gjs-clm-tags .gjs-clm-field select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-sm-sector .gjs-sm-field input:focus,.gjs-clm-tags .gjs-sm-field input:focus,.gjs-sm-sector .gjs-clm-select input:focus,.gjs-clm-tags .gjs-clm-select input:focus,.gjs-sm-sector .gjs-clm-field input:focus,.gjs-clm-tags .gjs-clm-field input:focus,.gjs-sm-sector .gjs-sm-field select:focus,.gjs-clm-tags .gjs-sm-field select:focus,.gjs-sm-sector .gjs-clm-select select:focus,.gjs-clm-tags .gjs-clm-select select:focus,.gjs-sm-sector .gjs-clm-field select:focus,.gjs-clm-tags .gjs-clm-field select:focus{outline:none}.gjs-sm-sector .gjs-sm-field .gjs-sm-unit,.gjs-clm-tags .gjs-sm-field .gjs-sm-unit,.gjs-sm-sector .gjs-clm-select .gjs-sm-unit,.gjs-clm-tags .gjs-clm-select .gjs-sm-unit,.gjs-sm-sector .gjs-clm-field .gjs-sm-unit,.gjs-clm-tags .gjs-clm-field .gjs-sm-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-sm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-select .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-select .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;cursor:ns-resize}.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{border-bottom:4px solid rgba(255,255,255,.7);top:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{border-top:4px solid rgba(255,255,255,.7);bottom:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{bottom:7px}.gjs-sm-sector .gjs-sm-field.gjs-sm-color,.gjs-clm-tags .gjs-sm-field.gjs-sm-color,.gjs-sm-sector .gjs-sm-color.gjs-clm-field,.gjs-clm-tags .gjs-sm-color.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-input,.gjs-clm-tags .gjs-sm-field.gjs-sm-input,.gjs-sm-sector .gjs-sm-input.gjs-clm-field,.gjs-clm-tags .gjs-sm-input.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-integer,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{background-color:rgba(0,0,0,.2);border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 0 rgba(255,255,255,.1);color:rgba(255,255,255,.7);border-radius:2px;box-sizing:border-box;padding:0 5px}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{border-radius:2px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{padding:0}.gjs-sm-sector .gjs-sm-field.gjs-sm-select select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field select,.gjs-clm-tags .gjs-sm-select.gjs-clm-field select{height:20px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select option,.gjs-clm-tags .gjs-sm-field.gjs-sm-select option,.gjs-sm-sector .gjs-clm-select option,.gjs-clm-tags .gjs-clm-select option,.gjs-sm-sector .gjs-sm-select.gjs-clm-field option,.gjs-clm-tags .gjs-sm-select.gjs-clm-field option{padding:3px 0}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{background-color:rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.25)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-select,.gjs-clm-tags .gjs-sm-list.gjs-clm-select,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field{width:auto;padding:0;overflow:hidden;float:left}.gjs-sm-sector .gjs-sm-field.gjs-sm-list input,.gjs-clm-tags .gjs-sm-field.gjs-sm-list input,.gjs-sm-sector .gjs-sm-list.gjs-clm-select input,.gjs-clm-tags .gjs-sm-list.gjs-clm-select input,.gjs-sm-sector .gjs-sm-list.gjs-clm-field input,.gjs-clm-tags .gjs-sm-list.gjs-clm-field input{display:none}.gjs-sm-sector .gjs-sm-field.gjs-sm-list label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field label{cursor:pointer;padding:5px;display:block}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label{background-color:rgba(255,255,255,.2)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-icon{background-repeat:no-repeat;background-position:center;text-shadow:none;line-height:normal}.gjs-sm-sector .gjs-sm-field.gjs-sm-integer select,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-select select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-select select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field select{width:auto;padding:0}.gjs-sm-sector .gjs-sm-list .gjs-sm-el,.gjs-clm-tags .gjs-sm-list .gjs-sm-el{float:left;border-left:1px solid rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:first-child,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:first-child{border:none}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:hover,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:hover{background:rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-slider .gjs-field-integer,.gjs-clm-tags .gjs-sm-slider .gjs-field-integer{flex:1 1 65px}.gjs-sm-sector .gjs-sm-property,.gjs-clm-tags .gjs-sm-property{box-sizing:border-box;float:left;width:50%;margin-bottom:5px;padding:0 5px}.gjs-sm-sector .gjs-sm-property--full,.gjs-clm-tags .gjs-sm-property--full,.gjs-sm-sector .gjs-sm-property.gjs-sm-composite,.gjs-clm-tags .gjs-sm-property.gjs-sm-composite,.gjs-sm-sector .gjs-sm-property.gjs-sm-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file,.gjs-sm-sector .gjs-sm-property.gjs-sm-list,.gjs-clm-tags .gjs-sm-property.gjs-sm-list,.gjs-sm-sector .gjs-sm-property.gjs-sm-stack,.gjs-clm-tags .gjs-sm-property.gjs-sm-stack,.gjs-sm-sector .gjs-sm-property.gjs-sm-slider,.gjs-clm-tags .gjs-sm-property.gjs-sm-slider,.gjs-sm-sector .gjs-sm-property.gjs-sm-color,.gjs-clm-tags .gjs-sm-property.gjs-sm-color{width:100%}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn{background-color:rgba(33,33,33,.2);border-radius:2px;box-shadow:1px 1px 0 rgba(5,5,5,.2),1px 1px 0 rgba(43,43,43,.2) inset;padding:5px;position:relative;text-align:center;height:auto;width:100%;cursor:pointer;color:#ddd;box-sizing:border-box;text-shadow:-1px -1px 0 rgba(0,0,0,.2);border:none;opacity:.85;filter:alpha(opacity=85)}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn-c,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn-c{box-sizing:border-box;float:left;width:100%}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box{background-color:rgba(255,255,255,.05);border-radius:2px;margin-top:5px;position:relative;overflow:hidden}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show{border:1px solid rgba(252,252,252,.05);padding:3px 20px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{top:-5px;display:block}.gjs-sm-sector .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file{height:50px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file{background-size:auto 100%;background-repeat:no-repeat;background-position:center center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layers,.gjs-clm-tags .gjs-sm-property .gjs-sm-layers{margin-top:5px;padding:1px 3px;min-height:30px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer{background-color:rgba(255,255,255,.055);border-radius:2px;margin:2px 0;padding:7px;position:relative;cursor:pointer}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box{height:15px;position:absolute;right:27px;top:6px;width:15px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{border-radius:2px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.5;filter:alpha(opacity=50)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover{opacity:.8;filter:alpha(opacity=80)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box #gjs-sm-preview{background-color:#fff;height:100%;width:100%;background-size:cover !important}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer.gjs-sm-active,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer.gjs-sm-active{background-color:rgba(255,255,255,.12)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer.gjs-sm-no-preview #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer.gjs-sm-no-preview #gjs-sm-preview-box{display:none}.gjs-sm-sector #gjs-sm-text-shadow #gjs-sm-preview::after,.gjs-clm-tags #gjs-sm-text-shadow #gjs-sm-preview::after{color:#000;content:"T";font-weight:900;line-height:17px;padding:0 4px}.gjs-sm-sector .gjs-sm-stack .gjs-sm-properties,.gjs-clm-tags .gjs-sm-stack .gjs-sm-properties{padding:5px 0 0}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add{background:none;border:none;cursor:pointer;outline:none;font-size:22px;line-height:10px;position:absolute;right:0;top:-17px;opacity:.75}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add:hover,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add:hover{opacity:1;filter:alpha(opacity=100)}.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c{height:100%;width:20px;position:absolute;right:0;top:0;box-sizing:border-box;border-radius:2px;padding:2px}.gjs-sm-sector .gjs-sm-colorp-c .gjs-checker-bg,.gjs-clm-tags .gjs-sm-colorp-c .gjs-checker-bg,.gjs-sm-sector .gjs-sm-colorp-c .gjs-field-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-sm-sector .gjs-sm-color-picker,.gjs-clm-tags .gjs-sm-color-picker{background-color:#ddd;cursor:pointer;height:16px;width:100%;margin-top:-16px;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-upload,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-upload{left:0;top:0;position:absolute;width:100%;opacity:0;cursor:pointer}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-label,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-label{padding:2px 0}.gjs-sm-layer>#gjs-sm-move{opacity:.7;filter:alpha(opacity=70);cursor:move;font-size:12px;float:left;margin:0 5px 0 0}.gjs-sm-layer>#gjs-sm-move:hover{opacity:.9;filter:alpha(opacity=90)}.gjs-blocks-c{display:flex;flex-wrap:wrap;justify-content:flex-start}.gjs-block-categories{display:flex;flex-direction:column}.gjs-block-category{width:100%}.gjs-block-category .gjs-caret-icon{margin-right:5px}.gjs-block{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;width:45%;min-width:45px;padding:1em;box-sizing:border-box;min-height:90px;cursor:all-scroll;font-size:11px;font-weight:lighter;text-align:center;display:flex;flex-direction:column;justify-content:space-between;border:1px solid rgba(0,0,0,.2);border-radius:3px;margin:10px 2.5% 5px;box-shadow:0 1px 0 0 rgba(0,0,0,.15);transition:all .2s ease 0s;transition-property:box-shadow,color}.gjs-block:hover{box-shadow:0 3px 4px 0 rgba(0,0,0,.15)}.gjs-block svg{fill:currentColor}.gjs-block__media{margin-bottom:10px;pointer-events:none}.gjs-block-svg{width:54px;fill:currentColor}.gjs-block-svg-path{fill:currentColor}.gjs-block.fa{font-size:2em;line-height:2em;padding:11px}.gjs-block-label{line-height:normal;font-size:.65rem;font-weight:normal;font-family:Helvetica,sans-serif;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.gjs-block.gjs-bdrag{width:auto;padding:0}.gjs-selected-parent{border:1px solid #ffca6f}.gjs-opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-layer{font-weight:lighter;text-align:left;position:relative;background-color:rgba(0,0,0,.1);font-size:.75rem;display:grid}.gjs-layer-hidden{opacity:.55;filter:alpha(opacity=55)}.gjs-layer-count{position:absolute;right:27px;top:9px}.gjs-layer-vis{height:auto !important;width:auto !important;left:0;top:0;padding:7px 5px 7px 10px;position:absolute;cursor:pointer;z-index:1}.gjs-layer-caret{font-size:.5rem;width:8px;padding:2px;cursor:pointer;position:absolute;left:-9px;top:6px;opacity:.7;filter:alpha(opacity=70)}.gjs-layer-caret:hover{opacity:1;filter:alpha(opacity=100)}.gjs-layer-title{padding:3px 10px 5px 30px;display:flex;align-items:center}.gjs-layer-title-inn{align-items:center;position:relative;display:flex;width:100%}.gjs-layer__icon{display:block;width:100%;max-width:15px;max-height:15px;padding-left:5px}.gjs-layer__icon svg{fill:currentColor}.gjs-layer-name{padding:5px 0;display:inline-block;box-sizing:content-box;overflow:hidden;white-space:nowrap;margin:0 30px 0 5px}.gjs-layer-name--no-edit{text-overflow:ellipsis}.gjs-layer>.gjs-layer-children{display:none}.gjs-layer.open>.gjs-layer-children{display:block}.gjs-layer-no-chld>.gjs-layer-title-inn>.gjs-layer-caret{display:none}.gjs-layer-move{padding:7px 10px 7px 5px;position:absolute;font-size:12px;cursor:move;right:0;top:0}.gjs-layer.gjs-hovered .gjs-layer-title{background-color:rgba(255,255,255,.015)}.gjs-layer.gjs-selected .gjs-layer-title{background-color:rgba(255,255,255,.1)}.gjs-layers{position:relative;height:100%}.gjs-layers #gjs-placeholder{width:100%;position:absolute}.gjs-layers #gjs-placeholder #gjs-plh-int{height:100%;padding:1px}.gjs-layers #gjs-placeholder #gjs-plh-int.gjs-insert{background-color:#62c462}#gjs-clm-add-tag,.gjs-clm-tags-btn{background-color:rgba(255,255,255,.15);border-radius:2px;padding:3px;margin-right:3px;border:1px solid rgba(0,0,0,.15);width:24px;height:24px;box-sizing:border-box;cursor:pointer}.gjs-clm-tags-btn svg{fill:currentColor;display:block}.gjs-clm-header{display:flex;align-items:center;margin:7px 0}.gjs-clm-header-status{flex-shrink:1;margin-left:auto}.gjs-clm-tag{display:flex;overflow:hidden;align-items:center;border-radius:3px;margin:0 3px 3px 0;padding:5px;cursor:default}.gjs-clm-tag-status,.gjs-clm-tag-close{width:12px;height:12px;flex-shrink:1}.gjs-clm-tag-status svg,.gjs-clm-tag-close svg{vertical-align:middle;fill:currentColor}.gjs-clm-sels-info{margin:7px 0}.gjs-clm-sel-id{font-size:.9em;opacity:.5;filter:alpha(opacity=50)}.gjs-clm-label-sel{float:left;padding-right:5px}.gjs-clm-tags{font-size:.75rem;padding:10px 5px}.gjs-clm-tags #gjs-clm-sel{padding:7px 0;float:left}.gjs-clm-tags #gjs-clm-sel{font-style:italic;margin-left:5px}.gjs-clm-tags #gjs-clm-tags-field{clear:both;padding:5px;margin-bottom:5px;display:flex;flex-wrap:wrap}.gjs-clm-tags #gjs-clm-tags-c{display:flex;flex-wrap:wrap;vertical-align:top;overflow:hidden}.gjs-clm-tags #gjs-clm-new{color:#ddd;padding:5px 6px;display:none}.gjs-clm-tags #gjs-clm-close{opacity:.85;filter:alpha(opacity=85);font-size:20px;line-height:0;cursor:pointer;color:rgba(255,255,255,.9)}.gjs-clm-tags #gjs-clm-close:hover{opacity:1;filter:alpha(opacity=100)}.gjs-clm-tags #gjs-clm-checkbox{color:rgba(255,255,255,.9);vertical-align:middle;cursor:pointer;font-size:9px}.gjs-clm-tags #gjs-clm-tag-label{flex-grow:1;text-overflow:ellipsis;overflow:hidden;padding:0 3px;cursor:text}.gjs-mdl-container{font-family:Helvetica,sans-serif;overflow-y:auto;position:fixed;background-color:rgba(0,0,0,.5);display:flex;top:0;left:0;right:0;bottom:0;z-index:100}.gjs-mdl-dialog{text-shadow:-1px -1px 0 rgba(0,0,0,.05);animation:gjs-slide-down .215s;margin:auto;max-width:850px;width:90%;border-radius:3px;font-weight:lighter;position:relative;z-index:2}.gjs-mdl-title{font-size:1rem}.gjs-mdl-btn-close{position:absolute;right:15px;top:5px}.gjs-mdl-active .gjs-mdl-dialog{animation:gjs-mdl-slide-down .216s}.gjs-mdl-header,.gjs-mdl-content{padding:10px 15px;clear:both}.gjs-mdl-header{position:relative;border-bottom:1px solid rgba(0,0,0,.2);padding:15px 15px 7px}.gjs-export-dl::after{content:"";clear:both;display:block;margin-bottom:10px}.gjs-dropzone{display:none;opacity:0;position:absolute;top:0;left:0;z-index:11;width:100%;height:100%;transition:opacity .25s;pointer-events:none}.gjs-dropzone-active .gjs-dropzone{display:block;opacity:1}.gjs-am-assets{height:290px;overflow:auto;clear:both;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:flex-start}.gjs-am-assets-header{padding:5px}.gjs-am-add-asset .gjs-am-add-field{width:70%;float:left}.gjs-am-add-asset button{width:25%;float:right}.gjs-am-preview-cont{position:relative;height:70px;width:30%;background-color:#444;border-radius:2px;float:left;overflow:hidden}.gjs-am-preview{position:absolute;background-position:center center;background-size:cover;background-repeat:no-repeat;height:100%;width:100%;z-index:1}.gjs-am-preview-bg{opacity:.5;filter:alpha(opacity=50);position:absolute;height:100%;width:100%;z-index:0}.gjs-am-dimensions{opacity:.5;filter:alpha(opacity=50);font-size:10px}.gjs-am-meta{width:70%;float:left;font-size:12px;padding:5px 0 0 5px;box-sizing:border-box}.gjs-am-meta>div{margin-bottom:5px}.gjs-am-close{cursor:pointer;position:absolute;right:5px;top:0;display:none}.gjs-am-asset{border-bottom:1px solid rgba(0,0,0,.2);padding:5px;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.gjs-am-asset:hover .gjs-am-close{display:block}.gjs-am-highlight{background-color:rgba(255,255,255,.1)}.gjs-am-assets-cont{background-color:rgba(0,0,0,.1);border-radius:3px;box-sizing:border-box;padding:10px;width:45%;float:right;height:325px;overflow:hidden}.gjs-am-file-uploader{width:55%;float:left}.gjs-am-file-uploader>form{background-color:rgba(0,0,0,.1);border:2px dashed;border-radius:3px;position:relative;text-align:center;margin-bottom:15px}.gjs-am-file-uploader>form.gjs-am-hover{border:2px solid #62c462;color:#75cb75}.gjs-am-file-uploader>form.gjs-am-disabled{border-color:red}.gjs-am-file-uploader>form #gjs-am-uploadFile{opacity:0;filter:alpha(opacity=0);padding:150px 10px;width:100%;box-sizing:border-box}.gjs-am-file-uploader #gjs-am-title{position:absolute;padding:150px 10px;width:100%}.gjs-cm-editor-c{float:left;box-sizing:border-box;width:50%}.gjs-cm-editor-c .CodeMirror{height:450px}.gjs-cm-editor{font-size:12px}.gjs-cm-editor#gjs-cm-htmlmixed{padding-right:10px;border-right:1px solid rgba(0,0,0,.2)}.gjs-cm-editor#gjs-cm-htmlmixed #gjs-cm-title{color:#a97d44}.gjs-cm-editor#gjs-cm-css{padding-left:10px}.gjs-cm-editor#gjs-cm-css #gjs-cm-title{color:#ddca7e}.gjs-cm-editor #gjs-cm-title{background-color:rgba(0,0,0,.2);font-size:12px;padding:5px 10px 3px;text-align:right}.gjs-rte-toolbar{border:1px solid rgba(0,0,0,.2);position:absolute;border-radius:3px;z-index:10}.gjs-rte-actionbar{display:flex}.gjs-rte-action{display:flex;align-items:center;justify-content:center;padding:5px;min-width:25px;border-right:1px solid rgba(0,0,0,.2);text-align:center;cursor:pointer;outline:none}.gjs-rte-action:last-child{border-right:none}.gjs-rte-action:hover{background-color:rgba(255,255,255,.1)}.gjs-rte-active{background-color:rgba(255,255,255,.1)}.gjs-rte-disabled{color:rgba(255,255,255,.1);cursor:not-allowed}.gjs-rte-disabled:hover{background-color:unset}.gjs-editor-cont .sp-hue,.gjs-editor-cont .sp-slider{cursor:row-resize}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-dragger{cursor:crosshair}.gjs-editor-cont .sp-alpha-inner,.gjs-editor-cont .sp-alpha-handle{cursor:col-resize}.gjs-editor-cont .sp-hue{left:90%}.gjs-editor-cont .sp-color{right:15%}.gjs-editor-cont .sp-container{border:1px solid rgba(0,0,0,.2);box-shadow:0 0 7px rgba(0,0,0,.2);border-radius:3px}.gjs-editor-cont .sp-picker-container{border:none}.gjs-editor-cont .colpick_dark .colpick_color{outline:1px solid rgba(0,0,0,.2)}.gjs-editor-cont .sp-cancel,.gjs-editor-cont .sp-cancel:hover{bottom:-8px;color:#777 !important;font-size:25px;left:0;position:absolute;text-decoration:none}.gjs-editor-cont .sp-alpha-handle{background-color:#ccc;border:1px solid #555;width:4px}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-hue{border:1px solid #333}.gjs-editor-cont .sp-slider{background-color:#ccc;border:1px solid #555;height:3px;left:-4px;width:22px}.gjs-editor-cont .sp-dragger{background:transparent;box-shadow:0 0 0 1px #111}.gjs-editor-cont .sp-button-container{float:none;width:100%;position:relative;text-align:right}.gjs-editor-cont .sp-container button,.gjs-editor-cont .sp-container button:hover,.gjs-editor-cont .sp-container button:active{background:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2);color:#ddd;text-shadow:none;box-shadow:none;padding:3px 5px}.gjs-editor-cont .sp-palette-container{border:none;float:none;margin:0;padding:5px 10px 0}.gjs-editor-cont .sp-palette .sp-thumb-el,.gjs-editor-cont .sp-palette .sp-thumb-el:hover{border:1px solid rgba(0,0,0,.9)}.gjs-editor-cont .sp-palette .sp-thumb-el:hover,.gjs-editor-cont .sp-palette .sp-thumb-el.sp-thumb-active{border-color:rgba(0,0,0,.9)}.gjs-hidden{display:none}@keyframes gjs-slide-down{0%{transform:translate(0, -3rem);opacity:0}100%{transform:translate(0, 0);opacity:1}}@keyframes gjs-slide-up{0%{transform:translate(0, 0);opacity:1}100%{transform:translate(0, -3rem);opacity:0}}.cm-s-hopscotch span.cm-error{color:#fff} diff --git a/src/styles/scss/_gjs_blocks.scss b/src/styles/scss/_gjs_blocks.scss index e7b7b81ae..46e44d9be 100644 --- a/src/styles/scss/_gjs_blocks.scss +++ b/src/styles/scss/_gjs_blocks.scss @@ -57,6 +57,7 @@ &__media { margin-bottom: 10px; + pointer-events: none; } } @@ -82,6 +83,7 @@ font-family: Helvetica, sans-serif; overflow: hidden; text-overflow: ellipsis; + pointer-events: none; } .#{$app-prefix}block.#{$app-prefix}bdrag { From 6c2fa380675941766f74f701a4411c773050d833 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 10 Dec 2021 11:33:13 +0100 Subject: [PATCH 070/313] Update property clear --- src/style_manager/model/Property.js | 4 ++-- src/style_manager/model/PropertyComposite.js | 18 ++++-------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 15f389ad0..1f0b8fffe 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -28,7 +28,7 @@ export default class Property extends Model { const { em } = this; const sm = em.get('StyleManager'); const name = this.getName(); - const value = this.__getFullValue(opts); + const value = opts.__clear ? '' : this.__getFullValue(opts); const parentProp = this.__getParentProp(); const applyStyle = !opts.__up && !parentProp; @@ -119,7 +119,7 @@ export default class Property extends Model { * Clear value */ clear(opts = {}) { - this._up(this.__getClearProps(), opts); + this._up(this.__getClearProps(), { ...opts, __clear: true }); } upValue(value, opts) { diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index d54fb68f9..742f4efed 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -41,7 +41,7 @@ export default Property.extend({ }, __upProperties(prop, opts = {}) { - if (!this.__hasCustom() || opts.__up) return; + if (!this.__hasCustom() || opts.__up || opts.__clearIn) return; if (this.isDetached()) { this.__upTargetsStyle({ [prop.getName()]: prop.__getFullValue() }, opts); @@ -51,12 +51,10 @@ export default Property.extend({ }, __upTargetsStyle(style, opts) { - // const sm = this.em?.get('StyleManager'); - // sm?.addStyleTargets({ ...style, __p: !!opts.avoidStore }, opts); const toStyle = this.get('toStyle'); let newStyle = style; - if (toStyle) { + if (toStyle && !opts.__clear) { const values = this.getValues(); newStyle = toStyle({ values, style, opts }); } @@ -64,19 +62,11 @@ export default Property.extend({ return Property.prototype.__upTargetsStyle.call(this, newStyle, opts); }, - // TODO? upValue -> if not detached, update properties - __getFullValue(opts = {}) { if (this.isDetached() || opts.__clear) { return ''; } - // TODO custom build of the value (eg. toValue({ values }), toStyle({ values, name }) ) - - // if (this.get('toStyle')) { - // const values = this.getValues(); - // } - return this.getProperties() .map(p => p.__getFullValue({ withDefault: 1 })) .filter(Boolean) @@ -89,8 +79,8 @@ export default Property.extend({ }, clear() { - this.getProperties().map(p => p.clear()); - return Property.prototype.clear.call(this, { __clear: true }); + this.getProperties().map(p => p.clear({ __clearIn: true })); + return Property.prototype.clear.call(this); }, /** From adad45128ed44bb6cd09975419b7a7b824ec17b0 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 10 Dec 2021 12:00:56 +0100 Subject: [PATCH 071/313] Update toStyle prop --- src/style_manager/model/PropertyComposite.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 742f4efed..64761e2d8 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -46,7 +46,8 @@ export default Property.extend({ if (this.isDetached()) { this.__upTargetsStyle({ [prop.getName()]: prop.__getFullValue() }, opts); } else { - this.upValue(this.__getFullValue(), opts); + const { __clear, ...rest } = opts; + this.upValue(this.__getFullValue(), rest); } }, @@ -56,7 +57,7 @@ export default Property.extend({ if (toStyle && !opts.__clear) { const values = this.getValues(); - newStyle = toStyle({ values, style, opts }); + newStyle = toStyle(values, { ...opts, style }); } return Property.prototype.__upTargetsStyle.call(this, newStyle, opts); From 0fe9012f3d1ab8b321f4ec4df66b0feddf827f0d Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 10 Dec 2021 12:26:39 +0100 Subject: [PATCH 072/313] Clear undetached properties in composite types --- src/style_manager/model/PropertyComposite.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 64761e2d8..9f79d12d7 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -60,6 +60,12 @@ export default Property.extend({ newStyle = toStyle(values, { ...opts, style }); } + if (!this.isDetached()) { + this.getProperties().map(prop => { + newStyle[prop.getName()] = ''; + }); + } + return Property.prototype.__upTargetsStyle.call(this, newStyle, opts); }, From ccc772b7bb4e90f3ecd62f2d228d23f2d18f6506 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 10 Dec 2021 12:35:30 +0100 Subject: [PATCH 073/313] Update always current style --- src/style_manager/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 9f236ebc8..fc2c177c0 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -566,14 +566,14 @@ export default () => { sectors.map(sector => { sector.getProperties().map(prop => { + this.__upProp(prop, style, parentStyles, opts); const props = prop.getProperties?.(); - if (props /*&& prop.isDetached?.()*/) { + + if (props) { const fromStyle = prop.get('fromStyle'); // TODO parentStyles should be as newStyle const newStyle = fromStyle ? fromStyle(style) : style; props.forEach(prop => this.__upProp(prop, newStyle, parentStyles, opts)); - } else { - this.__upProp(prop, style, parentStyles, opts); } }); }); From fdae944ca77c029931ff98b9eac718193be62525 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 10 Dec 2021 12:47:37 +0100 Subject: [PATCH 074/313] Apply fromStyle to parentStyles --- src/style_manager/index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index fc2c177c0..b47898a36 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -571,9 +571,16 @@ export default () => { if (props) { const fromStyle = prop.get('fromStyle'); - // TODO parentStyles should be as newStyle - const newStyle = fromStyle ? fromStyle(style) : style; - props.forEach(prop => this.__upProp(prop, newStyle, parentStyles, opts)); + let newStyle = style; + let newParentStyles = parentStyles; + if (fromStyle) { + newStyle = fromStyle(style); + newParentStyles = parentStyles.map(p => ({ + ...p, + style: fromStyle(p.style), + })); + } + props.forEach(prop => this.__upProp(prop, newStyle, newParentStyles, opts)); } }); }); From 52c6e628aef122ffbf4de050e6988b03aa5f51b1 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 10 Dec 2021 15:20:58 +0100 Subject: [PATCH 075/313] Add __getFromStyle --- src/style_manager/index.js | 15 ++++------- src/style_manager/model/PropertyComposite.js | 27 ++++++++++++++++++++ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index b47898a36..45015a7b5 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -570,16 +570,11 @@ export default () => { const props = prop.getProperties?.(); if (props) { - const fromStyle = prop.get('fromStyle'); - let newStyle = style; - let newParentStyles = parentStyles; - if (fromStyle) { - newStyle = fromStyle(style); - newParentStyles = parentStyles.map(p => ({ - ...p, - style: fromStyle(p.style), - })); - } + const newStyle = prop.__getFromStyle(style); + const newParentStyles = parentStyles.map(p => ({ + ...p, + style: prop.__getFromStyle(p.style), + })); props.forEach(prop => this.__upProp(prop, newStyle, newParentStyles, opts)); } }); diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 9f79d12d7..bea41bfa4 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -85,6 +85,33 @@ export default Property.extend({ return isString(join) ? join : this.get('separator'); }, + __getFromStyle(style = {}) { + let result = {}; + const fromStyle = this.get('fromStyle'); + + if (fromStyle) { + result = fromStyle(style); + } else if (!this.isDetached()) { + const name = this.getName(); + const value = style[name]; + if (value) { + const values = value.split(this.getSplitSeparator()); + this.getProperties().forEach((prop, i) => { + const len = values.length; + // Try to get value from a shorthand: + // 11px -> 11px 11px 11px 11xp + // 11px 22px -> 11px 22px 11px 22xp + const value = values[i] || values[(i % len) + (len != 1 && len % 2 ? 1 : 0)]; + result[prop.getId()] = value || ''; + }); + } + } else { + result = style; + } + + return result; + }, + clear() { this.getProperties().map(p => p.clear({ __clearIn: true })); return Property.prototype.clear.call(this); From 84c616b3230dd289b3de670fa163fbd20455b106 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 10 Dec 2021 15:38:09 +0100 Subject: [PATCH 076/313] Update __getFromStyle --- src/style_manager/model/PropertyComposite.js | 10 ++++++---- src/style_manager/model/PropertyStack.js | 6 ++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index bea41bfa4..79a4a5190 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -86,12 +86,12 @@ export default Property.extend({ }, __getFromStyle(style = {}) { - let result = {}; + let result = style; const fromStyle = this.get('fromStyle'); if (fromStyle) { result = fromStyle(style); - } else if (!this.isDetached()) { + } else { const name = this.getName(); const value = style[name]; if (value) { @@ -104,9 +104,11 @@ export default Property.extend({ const value = values[i] || values[(i % len) + (len != 1 && len % 2 ? 1 : 0)]; result[prop.getId()] = value || ''; }); + result = { + ...style, + ...result, + }; } - } else { - result = style; } return result; diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index ad0e31f51..28dae473b 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -105,6 +105,12 @@ export default Property.extend({ return parseFn ? parseFn({ value, values }) : values; }, + __getFromStyle(style = {}) { + const fromStyle = this.get('fromStyle'); + + return fromStyle ? fromStyle(style) : style; + }, + /** * Add new layer to the stack * @param {Object} [props={}] Layer props From 642cde64546b15cdabb84e1a4f504f55da3efe0f Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 10 Dec 2021 17:36:19 +0100 Subject: [PATCH 077/313] Update __upTargetsStyle --- src/style_manager/model/PropertyComposite.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 79a4a5190..6de822065 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -44,7 +44,11 @@ export default Property.extend({ if (!this.__hasCustom() || opts.__up || opts.__clearIn) return; if (this.isDetached()) { - this.__upTargetsStyle({ [prop.getName()]: prop.__getFullValue() }, opts); + const style = this.getProperties().reduce((acc, prop) => { + acc[prop.getName()] = prop.hasValue({ noParent: true }) ? prop.__getFullValue() : ''; + return acc; + }, {}); + this.__upTargetsStyle({ ...style, [prop.getName()]: prop.__getFullValue() }, opts); } else { const { __clear, ...rest } = opts; this.upValue(this.__getFullValue(), rest); @@ -60,7 +64,9 @@ export default Property.extend({ newStyle = toStyle(values, { ...opts, style }); } - if (!this.isDetached()) { + if (this.isDetached()) { + newStyle[this.getName()] = ''; + } else { this.getProperties().map(prop => { newStyle[prop.getName()] = ''; }); From 1949aa18018706ac93b58b3afb3a296c82b6a899 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 10 Dec 2021 17:59:17 +0100 Subject: [PATCH 078/313] Update clear for detached properties --- src/style_manager/model/PropertyComposite.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 6de822065..56255e6b2 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -55,11 +55,12 @@ export default Property.extend({ } }, - __upTargetsStyle(style, opts) { + __upTargetsStyle(style, opts = {}) { const toStyle = this.get('toStyle'); + const { __clear } = opts; let newStyle = style; - if (toStyle && !opts.__clear) { + if (toStyle && !__clear) { const values = this.getValues(); newStyle = toStyle(values, { ...opts, style }); } @@ -121,10 +122,14 @@ export default Property.extend({ }, clear() { - this.getProperties().map(p => p.clear({ __clearIn: true })); + this.getProperties().map(p => p.clear({ __clearIn: !this.isDetached() })); return Property.prototype.clear.call(this); }, + hasValue(opts) { + return this.getProperties().some(prop => prop.hasValue(opts)); + }, + /** * Get current values of properties * @param {Object} [opts={}] Options From 33d3e934ca907eeac61897cbc78088178118bbc8 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 10 Dec 2021 18:29:23 +0100 Subject: [PATCH 079/313] Update v --- src/style_manager/model/PropertyComposite.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 56255e6b2..4cb1cd6fd 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -93,7 +93,7 @@ export default Property.extend({ }, __getFromStyle(style = {}) { - let result = style; + let result = {}; const fromStyle = this.get('fromStyle'); if (fromStyle) { @@ -112,9 +112,11 @@ export default Property.extend({ result[prop.getId()] = value || ''; }); result = { - ...style, ...result, + ...style, }; + } else { + result = style; } } From 8662913bdd4e8e0296b2e659e255e4f9e6c69bb5 Mon Sep 17 00:00:00 2001 From: zachsnoek Date: Fri, 10 Dec 2021 10:08:55 -0800 Subject: [PATCH 080/313] Add guard to prevent TypeError during paste --- src/commands/view/PasteComponent.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/commands/view/PasteComponent.js b/src/commands/view/PasteComponent.js index 039be8784..1f451f299 100644 --- a/src/commands/view/PasteComponent.js +++ b/src/commands/view/PasteComponent.js @@ -9,7 +9,10 @@ export default { if (clp && selected) { ed.getSelectedAll().forEach(comp => { if (!comp) return; + const coll = comp.collection; + if (!coll) return; + const at = coll.indexOf(comp) + 1; const copyable = clp.filter(cop => cop.get('copyable')); let added; @@ -17,7 +20,10 @@ export default { if (contains(clp, comp) && comp.get('copyable')) { added = coll.add(comp.clone(), { at }); } else { - added = coll.add(copyable.map(cop => cop.clone()), { at }); + added = coll.add( + copyable.map(cop => cop.clone()), + { at } + ); } added = isArray(added) ? added : [added]; From 83971b26748c9a9d390fccd2db84a00e44233993 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 11 Dec 2021 00:15:54 +0100 Subject: [PATCH 081/313] Add messagesAdd in i18n init --- src/i18n/index.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/i18n/index.js b/src/i18n/index.js index 26e327901..e9f5773ee 100644 --- a/src/i18n/index.js +++ b/src/i18n/index.js @@ -70,9 +70,11 @@ export default () => { ...opts, messages: { ...config.messages, - ...(opts.messages || {}) - } + ...(opts.messages || {}), + }, }; + const add = this.config.messagesAdd; + add && this.addMessages(add); if (this.config.detectLocale) { this.config.locale = this._localLang(); @@ -127,9 +129,7 @@ export default () => { */ getMessages(lang, opts = {}) { const { messages } = this.config; - lang && - !messages[lang] && - this._debug(`'${lang}' i18n lang not found`, opts); + lang && !messages[lang] && this._debug(`'${lang}' i18n lang not found`, opts); return lang ? messages[lang] : messages; }, @@ -202,10 +202,8 @@ export default () => { // Try with fallback if (!result) result = this._getMsg(key, localeFlb, opts); - !result && - this._debug(`'${key}' i18n key not found in '${locale}' lang`, opts); - result = - result && isString(result) ? this._addParams(result, param) : result; + !result && this._debug(`'${key}' i18n key not found in '${locale}' lang`, opts); + result = result && isString(result) ? this._addParams(result, param) : result; return result; }, @@ -248,6 +246,6 @@ export default () => { destroy() { this.config = config; this.em = {}; - } + }, }; }; From ac3fdbcb6b0539dd414912ffa159de211166f062 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 11 Dec 2021 01:40:38 +0100 Subject: [PATCH 082/313] Add getBuiltIn --- src/style_manager/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 45015a7b5..cc0ee9abc 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -581,6 +581,10 @@ export default () => { }); }, + getBuiltIn(prop = '') { + return this.PropertyFactory.build(prop); + }, + __upProp(prop, style, parentStyles, opts) { const name = prop.getName(); const value = style[name]; From eee4f648efd97a77c49d71f64f1d7f43ab29db3c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 11 Dec 2021 11:31:19 +0100 Subject: [PATCH 083/313] Move PropertyFactory tests --- test/specs/style_manager/model/Models.js | 893 +----------------- .../style_manager/model/PropertyFactory.js | 808 ++++++++++++++++ 2 files changed, 826 insertions(+), 875 deletions(-) create mode 100644 test/specs/style_manager/model/PropertyFactory.js diff --git a/test/specs/style_manager/model/Models.js b/test/specs/style_manager/model/Models.js index 8c5058141..03e646618 100644 --- a/test/specs/style_manager/model/Models.js +++ b/test/specs/style_manager/model/Models.js @@ -5,7 +5,6 @@ import PropertyInteger from 'style_manager/model/PropertyInteger'; import Properties from 'style_manager/model/Properties'; import Layer from 'style_manager/model/Layer'; import Layers from 'style_manager/model/Layers'; -import PropertyFactory from 'style_manager/model/PropertyFactory'; describe('Sector', () => { var obj; @@ -17,13 +16,13 @@ describe('Sector', () => { properties: [ { property: 'display', - type: 'radio' + type: 'radio', }, { property: 'color', - type: 'color' - } - ] + type: 'color', + }, + ], }; obj = new Sector(); }); @@ -42,7 +41,7 @@ describe('Sector', () => { test('Init with properties', () => { obj = new Sector({ - properties: [{}, {}] + properties: [{}, {}], }); expect(obj.get('properties').length).toEqual(2); }); @@ -54,13 +53,7 @@ describe('Sector', () => { property: 'display', type: 'select', defaults: 'block', - list: [ - { value: 'block' }, - { value: 'inline' }, - { value: 'inline-block' }, - { value: 'flex' }, - { value: 'none' } - ] + list: [{ value: 'block' }, { value: 'inline' }, { value: 'inline-block' }, { value: 'flex' }, { value: 'none' }], }); }); @@ -90,14 +83,14 @@ describe('Sector', () => { properties: [ { name: 'Top', - property: 'margin-top' + property: 'margin-top', }, { - property: 'margin-right' - } - ] - } - ] + property: 'margin-right', + }, + ], + }, + ], }); var sectProps = obj.get('properties'); expect(sectProps.length).toEqual(2); @@ -191,7 +184,7 @@ describe('PropertyInteger', () => { test('parse input value with function', () => { obj = new PropertyInteger({ units: ['px', 'deg'], - functionName: 'test' + functionName: 'test', }); const result = { value: 55, unit: 'deg', functionName: 'test' }; expect(obj.parseValue('test(55deg)')).toEqual(result); @@ -233,7 +226,7 @@ describe('Layer', () => { var properties = [ { value: 'val1', property: 'prop1' }, { value: 'val2', property: 'prop2' }, - { value: 'val3', property: 'prop3', functionName: 'test' } + { value: 'val3', property: 'prop3', functionName: 'test' }, ]; beforeEach(() => { @@ -258,7 +251,7 @@ describe('Layer', () => { test('Get correct values from properties', () => { obj = new Layer({ - properties + properties, }); expect(obj.getFullValue()).toEqual('val1 val2 test(val3)'); }); @@ -276,7 +269,7 @@ describe('Layers', () => { var properties = [ { value: 'val1', property: 'prop1' }, { value: 'val2', property: 'prop2' }, - { value: 'val3', property: 'prop3', functionName: 'test' } + { value: 'val3', property: 'prop3', functionName: 'test' }, ]; beforeEach(() => { @@ -319,861 +312,11 @@ describe('Layers', () => { test('getFullValue from layers', () => { obj = new Layers([{ properties }, { properties }, { properties }]); - expect(obj.getFullValue()).toEqual( - 'val1 val2 test(val3), val1 val2 test(val3), val1 val2 test(val3)' - ); + expect(obj.getFullValue()).toEqual('val1 val2 test(val3), val1 val2 test(val3), val1 val2 test(val3)'); }); test('getPropertyValues from layers', () => { obj = new Layers([{ properties }, { properties }, { properties }]); - expect(obj.getPropertyValues('prop3')).toEqual( - 'test(val3), test(val3), test(val3)' - ); - }); -}); - -describe('PropertyFactory', () => { - var obj; - - beforeEach(() => { - obj = new PropertyFactory(); - }); - - afterEach(() => { - obj = null; - }); - - test('Object exists', () => { - expect(obj).toBeTruthy(); - }); - - test('Build single prop', () => { - expect(obj.build('float')).toEqual([ - { - property: 'float', - type: 'radio', - defaults: 'none', - list: [{ value: 'none' }, { value: 'left' }, { value: 'right' }] - } - ]); - }); - - test('Build display', () => { - expect(obj.build('display')).toEqual([ - { - property: 'display', - type: 'select', - defaults: 'block', - list: [ - { value: 'block' }, - { value: 'inline' }, - { value: 'inline-block' }, - { value: 'flex' }, - { value: 'none' } - ] - } - ]); - }); - - test('Build flex-direction', () => { - expect(obj.build('flex-direction')).toEqual([ - { - property: 'flex-direction', - type: 'select', - defaults: 'row', - list: [ - { value: 'row' }, - { value: 'row-reverse' }, - { value: 'column' }, - { value: 'column-reverse' } - ], - requires: { display: ['flex'] } - } - ]); - }); - - test('Build flex-wrap', () => { - expect(obj.build('flex-wrap')).toEqual([ - { - property: 'flex-wrap', - type: 'select', - defaults: 'nowrap', - list: [ - { value: 'nowrap' }, - { value: 'wrap' }, - { value: 'wrap-reverse' } - ], - requires: { display: ['flex'] } - } - ]); - }); - - test('Build justify-content', () => { - expect(obj.build('justify-content')).toEqual([ - { - property: 'justify-content', - type: 'select', - defaults: 'flex-start', - list: [ - { value: 'flex-start' }, - { value: 'flex-end' }, - { value: 'center' }, - { value: 'space-between' }, - { value: 'space-around' }, - { value: 'space-evenly' } - ], - requires: { display: ['flex'] } - } - ]); - }); - - test('Build align-items', () => { - expect(obj.build('align-items')).toEqual([ - { - property: 'align-items', - type: 'select', - defaults: 'stretch', - list: [ - { value: 'flex-start' }, - { value: 'flex-end' }, - { value: 'center' }, - { value: 'baseline' }, - { value: 'stretch' } - ], - requires: { display: ['flex'] } - } - ]); - }); - - test('Build align-content', () => { - expect(obj.build('align-content')).toEqual([ - { - property: 'align-content', - type: 'select', - defaults: 'stretch', - list: [ - { value: 'flex-start' }, - { value: 'flex-end' }, - { value: 'center' }, - { value: 'space-between' }, - { value: 'space-around' }, - { value: 'stretch' } - ], - requires: { display: ['flex'] } - } - ]); - }); - - test('Build align-self', () => { - expect(obj.build('align-self')).toEqual([ - { - property: 'align-self', - type: 'select', - defaults: 'auto', - list: [ - { value: 'auto' }, - { value: 'flex-start' }, - { value: 'flex-end' }, - { value: 'center' }, - { value: 'baseline' }, - { value: 'stretch' } - ], - requiresParent: { display: ['flex'] } - } - ]); - }); - - test('Build position', () => { - expect(obj.build('position')).toEqual([ - { - property: 'position', - type: 'radio', - defaults: 'static', - list: [ - { value: 'static' }, - { value: 'relative' }, - { value: 'absolute' }, - { value: 'fixed' } - ] - } - ]); - }); - - test('Build left, right', () => { - var res = { - type: 'integer', - units: ['px', '%', 'vw'], - defaults: 'auto', - fixedValues: ['initial', 'inherit', 'auto'] - }; - res.property = 'right'; - expect(obj.build('right')).toEqual([res]); - res.property = 'left'; - expect(obj.build('left')).toEqual([res]); - }); - - test('Build top, bottom', () => { - var res = { - type: 'integer', - units: ['px', '%', 'vh'], - defaults: 'auto', - fixedValues: ['initial', 'inherit', 'auto'] - }; - res.property = 'top'; - expect(obj.build('top')).toEqual([res]); - res.property = 'bottom'; - expect(obj.build('bottom')).toEqual([res]); - }); - - test('Build width family', () => { - var res = { - type: 'integer', - units: ['px', '%', 'vw'], - defaults: 'auto', - fixedValues: ['initial', 'inherit', 'auto'], - min: 0 - }; - res.property = 'width'; - expect(obj.build('width')).toEqual([res]); - res.property = 'min-width'; - expect(obj.build('min-width')).toEqual([res]); - res.property = 'max-width'; - expect(obj.build('max-width')).toEqual([res]); - }); - - test('Build flex-basis', () => { - var res = { - type: 'integer', - units: ['px', '%', 'vw', 'vh'], - defaults: 'auto', - fixedValues: ['initial', 'inherit', 'auto'], - requiresParent: { display: ['flex'] }, - min: 0 - }; - res.property = 'flex-basis'; - expect(obj.build('flex-basis')).toEqual([res]); - }); - - test('Build height family', () => { - var res = { - type: 'integer', - units: ['px', '%', 'vh'], - defaults: 'auto', - fixedValues: ['initial', 'inherit', 'auto'], - min: 0 - }; - res.property = 'height'; - expect(obj.build('height')).toEqual([res]); - res.property = 'min-height'; - expect(obj.build('min-height')).toEqual([res]); - res.property = 'max-height'; - expect(obj.build('max-height')).toEqual([res]); - }); - - test('Build margin', () => { - var res = { - property: 'margin', - type: 'composite', - properties: [ - { - fixedValues: ['initial', 'inherit', 'auto'], - property: 'margin-top', - type: 'integer', - units: ['px', '%', 'vh'], - defaults: 0 - }, - { - fixedValues: ['initial', 'inherit', 'auto'], - property: 'margin-right', - type: 'integer', - units: ['px', '%', 'vw'], - defaults: 0 - }, - { - fixedValues: ['initial', 'inherit', 'auto'], - property: 'margin-bottom', - type: 'integer', - units: ['px', '%', 'vh'], - defaults: 0 - }, - { - fixedValues: ['initial', 'inherit', 'auto'], - property: 'margin-left', - type: 'integer', - units: ['px', '%', 'vw'], - defaults: 0 - } - ] - }; - expect(obj.build('margin')).toEqual([res]); - }); - - test('Build padding', () => { - var res = { - property: 'padding', - type: 'composite', - properties: [ - { - property: 'padding-top', - fixedValues: ['initial', 'inherit', 'auto'], - type: 'integer', - units: ['px', '%', 'vh'], - defaults: 0, - min: 0 - }, - { - property: 'padding-right', - fixedValues: ['initial', 'inherit', 'auto'], - type: 'integer', - units: ['px', '%', 'vw'], - defaults: 0, - min: 0 - }, - { - property: 'padding-bottom', - fixedValues: ['initial', 'inherit', 'auto'], - type: 'integer', - units: ['px', '%', 'vh'], - defaults: 0, - min: 0 - }, - { - property: 'padding-left', - fixedValues: ['initial', 'inherit', 'auto'], - type: 'integer', - units: ['px', '%', 'vw'], - defaults: 0, - min: 0 - } - ] - }; - expect(obj.build('padding')).toEqual([res]); - }); - - test('Build font-family', () => { - var ss = ', sans-serif'; - var ms = ', monospace'; - var res = { - property: 'font-family', - type: 'select', - defaults: 'Arial, Helvetica' + ss, - list: [ - { name: 'Arial', value: 'Arial, Helvetica' + ss }, - { name: 'Arial Black', value: 'Arial Black, Gadget' + ss }, - { name: 'Brush Script MT', value: 'Brush Script MT' + ss }, - { name: 'Comic Sans MS', value: 'Comic Sans MS, cursive' + ss }, - { name: 'Courier New', value: 'Courier New, Courier' + ms }, - { name: 'Georgia', value: 'Georgia, serif' }, - { name: 'Helvetica', value: 'Helvetica' + ss }, - { name: 'Impact', value: 'Impact, Charcoal' + ss }, - { - name: 'Lucida Sans Unicode', - value: 'Lucida Sans Unicode, Lucida Grande' + ss - }, - { name: 'Tahoma', value: 'Tahoma, Geneva' + ss }, - { name: 'Times New Roman', value: 'Times New Roman, Times, serif' }, - { name: 'Trebuchet MS', value: 'Trebuchet MS, Helvetica' + ss }, - { name: 'Verdana', value: 'Verdana, Geneva' + ss } - ] - }; - expect(obj.build('font-family')).toEqual([res]); - }); - - test('Build font-size', () => { - var res = { - type: 'integer', - units: ['px', 'em', 'rem', '%'], - defaults: 'medium', - min: 0, - fixedValues: [ - 'medium', - 'xx-small', - 'x-small', - 'small', - 'large', - 'x-large', - 'xx-large', - 'smaller', - 'larger', - 'length', - 'initial', - 'inherit' - ] - }; - res.property = 'font-size'; - expect(obj.build('font-size')).toEqual([res]); - }); - - test('Build letter-spacing', () => { - var res = { - type: 'integer', - units: ['px', 'em', 'rem', '%'], - defaults: 'normal', - fixedValues: ['normal', 'initial', 'inherit'] - }; - res.property = 'letter-spacing'; - expect(obj.build('letter-spacing')).toEqual([res]); - }); - - test('Build font-weight', () => { - var res = { - type: 'select', - defaults: '400', - list: [ - { value: '100', name: 'Thin' }, - { value: '200', name: 'Extra-Light' }, - { value: '300', name: 'Light' }, - { value: '400', name: 'Normal' }, - { value: '500', name: 'Medium' }, - { value: '600', name: 'Semi-Bold' }, - { value: '700', name: 'Bold' }, - { value: '800', name: 'Extra-Bold' }, - { value: '900', name: 'Ultra-Bold' } - ] - }; - res.property = 'font-weight'; - expect(obj.build('font-weight')).toEqual([res]); - }); - - test('Build color', () => { - var res = { - property: 'color', - type: 'color', - defaults: 'black' - }; - expect(obj.build('color')).toEqual([res]); - }); - - test('Build line-height', () => { - var res = { - type: 'integer', - units: ['px', 'em', 'rem', '%'], - defaults: 'normal', - fixedValues: ['normal', 'initial', 'inherit'] - }; - res.property = 'line-height'; - expect(obj.build('line-height')).toEqual([res]); - }); - - test('Build text-align', () => { - var res = { - type: 'radio', - defaults: 'left', - list: [ - { value: 'left' }, - { value: 'center' }, - { value: 'right' }, - { value: 'justify' } - ] - }; - res.property = 'text-align'; - expect(obj.build('text-align')).toEqual([res]); - }); - - test('Build text-shadow', () => { - var res = { - type: 'stack', - preview: true, - defaults: 'none', - properties: [ - { - property: 'text-shadow-h', - type: 'integer', - units: ['px', '%'], - defaults: 0 - }, - { - property: 'text-shadow-v', - type: 'integer', - units: ['px', '%'], - defaults: 0 - }, - { - property: 'text-shadow-blur', - type: 'integer', - units: ['px', '%'], - defaults: 0, - min: 0 - }, - { - property: 'text-shadow-color', - type: 'color', - defaults: 'black' - } - ] - }; - res.property = 'text-shadow'; - expect(obj.build('text-shadow')).toEqual([res]); - }); - - test('Build border-radius-c', () => { - var res = { - type: 'integer', - units: ['px', '%'], - defaults: 0, - min: 0 - }; - res.property = 'border-radius'; - expect(obj.build('border-radius-c')).toEqual([res]); - }); - - test('Build border-radius', () => { - var res = { - property: 'border-radius', - type: 'composite', - properties: [ - { - property: 'border-top-left-radius', - type: 'integer', - units: ['px', '%'], - defaults: '0px', - min: 0 - }, - { - property: 'border-top-right-radius', - type: 'integer', - units: ['px', '%'], - min: 0, - defaults: '0px' - }, - { - property: 'border-bottom-right-radius', - type: 'integer', - units: ['px', '%'], - min: 0, - defaults: '0px' - }, - { - property: 'border-bottom-left-radius', - type: 'integer', - units: ['px', '%'], - min: 0, - defaults: '0px' - } - ] - }; - res.property = 'border-radius'; - expect(obj.build('border-radius')).toEqual([res]); - }); - - test('Build background-color', () => { - var res = { - type: 'color', - defaults: 'none' - }; - res.property = 'background-color'; - expect(obj.build('background-color')).toEqual([res]); - }); - - test('Build border', () => { - var res = { - property: 'border', - type: 'composite', - properties: [ - { - property: 'border-width', - type: 'integer', - units: ['px', 'em'], - defaults: 'medium', - min: 0 - }, - { - property: 'border-style', - type: 'select', - defaults: 'solid', - list: [ - { value: 'none' }, - { value: 'solid' }, - { value: 'dotted' }, - { value: 'dashed' }, - { value: 'double' }, - { value: 'groove' }, - { value: 'ridge' }, - { value: 'inset' }, - { value: 'outset' } - ] - }, - { - property: 'border-color', - type: 'color', - defaults: 'black' - } - ] - }; - expect(obj.build('border')).toEqual([res]); - }); - - test('Build box-shadow', () => { - var res = { - property: 'box-shadow', - type: 'stack', - preview: true, - properties: [ - { - property: 'box-shadow-h', - type: 'integer', - units: ['px', '%'], - defaults: 0 - }, - { - property: 'box-shadow-v', - type: 'integer', - units: ['px', '%'], - defaults: 0 - }, - { - property: 'box-shadow-blur', - type: 'integer', - units: ['px'], - defaults: '5px', - min: 0 - }, - { - property: 'box-shadow-spread', - type: 'integer', - units: ['px'], - defaults: 0 - }, - { - property: 'box-shadow-color', - type: 'color', - defaults: 'black' - }, - { - property: 'box-shadow-type', - type: 'select', - defaults: '', - list: [ - { value: '', name: 'Outside' }, - { value: 'inset', name: 'Inside' } - ] - } - ] - }; - expect(obj.build('box-shadow')).toEqual([res]); - }); - - test('Build background', () => { - var res = { - property: 'background', - type: 'stack', - preview: true, - detached: true, - properties: [ - { - property: 'background-image', - type: 'file', - functionName: 'url' - }, - { - property: 'background-repeat', - type: 'select', - defaults: 'repeat', - list: [ - { value: 'repeat' }, - { value: 'repeat-x' }, - { value: 'repeat-y' }, - { value: 'no-repeat' } - ] - }, - { - property: 'background-position', - type: 'select', - defaults: 'left top', - list: [ - { value: 'left top' }, - { value: 'left center' }, - { value: 'left bottom' }, - { value: 'right top' }, - { value: 'right center' }, - { value: 'right bottom' }, - { value: 'center top' }, - { value: 'center center' }, - { value: 'center bottom' } - ] - }, - { - property: 'background-attachment', - type: 'select', - defaults: 'scroll', - list: [{ value: 'scroll' }, { value: 'fixed' }, { value: 'local' }] - }, - { - property: 'background-size', - type: 'select', - defaults: 'auto', - list: [{ value: 'auto' }, { value: 'cover' }, { value: 'contain' }] - } - ] - }; - expect(obj.build('background')).toEqual([res]); - }); - - test('Build transition', () => { - var res = { - property: 'transition', - type: 'stack', - properties: [ - { - property: 'transition-property', - type: 'select', - defaults: 'width', - list: [ - { value: 'all' }, - { value: 'width' }, - { value: 'height' }, - { value: 'background-color' }, - { value: 'transform' }, - { value: 'box-shadow' }, - { value: 'opacity' } - ] - }, - { - property: 'transition-duration', - type: 'integer', - units: ['s'], - defaults: '2', - min: 0 - }, - { - property: 'transition-timing-function', - type: 'select', - defaults: 'ease', - list: [ - { value: 'linear' }, - { value: 'ease' }, - { value: 'ease-in' }, - { value: 'ease-out' }, - { value: 'ease-in-out' } - ] - } - ] - }; - expect(obj.build('transition')).toEqual([res]); - }); - - test('Build perspective', () => { - var res = { - property: 'perspective', - type: 'integer', - units: ['px'], - defaults: 0, - min: 0 - }; - expect(obj.build('perspective')).toEqual([res]); - }); - - test('Build transform', () => { - var res = { - property: 'transform', - type: 'composite', - properties: [ - { - property: 'transform-rotate-x', - type: 'integer', - units: ['deg'], - defaults: 0, - functionName: 'rotateX' - }, - { - property: 'transform-rotate-y', - type: 'integer', - units: ['deg'], - defaults: 0, - functionName: 'rotateY' - }, - { - property: 'transform-rotate-z', - type: 'integer', - units: ['deg'], - defaults: 0, - functionName: 'rotateZ' - }, - { - property: 'transform-scale-x', - type: 'integer', - defaults: 1, - functionName: 'scaleX' - }, - { - property: 'transform-scale-y', - type: 'integer', - defaults: 1, - functionName: 'scaleY' - }, - { - property: 'transform-scale-z', - type: 'integer', - defaults: 1, - functionName: 'scaleZ' - } - ] - }; - expect(obj.build('transform')).toEqual([res]); - }); - - test('Build cursor', () => { - var res = { - type: 'select', - property: 'cursor', - defaults: 'auto', - list: [ - { value: 'auto' }, - { value: 'pointer' }, - { value: 'copy' }, - { value: 'crosshair' }, - { value: 'grab' }, - { value: 'grabbing' }, - { value: 'help' }, - { value: 'move' }, - { value: 'text' } - ] - }; - expect(obj.build('cursor')).toEqual([res]); - }); - - test('Build overflow', () => { - var res = { - type: 'select', - property: 'overflow', - defaults: 'visible', - list: [ - { value: 'visible' }, - { value: 'hidden' }, - { value: 'scroll' }, - { value: 'auto' } - ] - }; - expect(obj.build('overflow')).toEqual([res]); - }); - - test('Build overflow-x', () => { - var res = { - type: 'select', - property: 'overflow-x', - defaults: 'visible', - list: [ - { value: 'visible' }, - { value: 'hidden' }, - { value: 'scroll' }, - { value: 'auto' } - ] - }; - expect(obj.build('overflow-x')).toEqual([res]); - }); - - test('Build overflow-y', () => { - var res = { - type: 'select', - property: 'overflow-y', - defaults: 'visible', - list: [ - { value: 'visible' }, - { value: 'hidden' }, - { value: 'scroll' }, - { value: 'auto' } - ] - }; - expect(obj.build('overflow-y')).toEqual([res]); + expect(obj.getPropertyValues('prop3')).toEqual('test(val3), test(val3), test(val3)'); }); }); diff --git a/test/specs/style_manager/model/PropertyFactory.js b/test/specs/style_manager/model/PropertyFactory.js new file mode 100644 index 000000000..16090f445 --- /dev/null +++ b/test/specs/style_manager/model/PropertyFactory.js @@ -0,0 +1,808 @@ +import PropertyFactory from 'style_manager/model/PropertyFactory'; + +describe('PropertyFactory', () => { + var obj; + + beforeEach(() => { + obj = new PropertyFactory(); + }); + + afterEach(() => { + obj = null; + }); + + test('Object exists', () => { + expect(obj).toBeTruthy(); + }); + + test('Build single prop', () => { + expect(obj.build('float')).toEqual([ + { + property: 'float', + type: 'radio', + defaults: 'none', + list: [{ value: 'none' }, { value: 'left' }, { value: 'right' }], + }, + ]); + }); + + test('Build display', () => { + expect(obj.build('display')).toEqual([ + { + property: 'display', + type: 'select', + defaults: 'block', + list: [ + { value: 'block' }, + { value: 'inline' }, + { value: 'inline-block' }, + { value: 'flex' }, + { value: 'none' }, + ], + }, + ]); + }); + + test('Build flex-direction', () => { + expect(obj.build('flex-direction')).toEqual([ + { + property: 'flex-direction', + type: 'select', + defaults: 'row', + list: [{ value: 'row' }, { value: 'row-reverse' }, { value: 'column' }, { value: 'column-reverse' }], + requires: { display: ['flex'] }, + }, + ]); + }); + + test('Build flex-wrap', () => { + expect(obj.build('flex-wrap')).toEqual([ + { + property: 'flex-wrap', + type: 'select', + defaults: 'nowrap', + list: [{ value: 'nowrap' }, { value: 'wrap' }, { value: 'wrap-reverse' }], + requires: { display: ['flex'] }, + }, + ]); + }); + + test('Build justify-content', () => { + expect(obj.build('justify-content')).toEqual([ + { + property: 'justify-content', + type: 'select', + defaults: 'flex-start', + list: [ + { value: 'flex-start' }, + { value: 'flex-end' }, + { value: 'center' }, + { value: 'space-between' }, + { value: 'space-around' }, + { value: 'space-evenly' }, + ], + requires: { display: ['flex'] }, + }, + ]); + }); + + test('Build align-items', () => { + expect(obj.build('align-items')).toEqual([ + { + property: 'align-items', + type: 'select', + defaults: 'stretch', + list: [ + { value: 'flex-start' }, + { value: 'flex-end' }, + { value: 'center' }, + { value: 'baseline' }, + { value: 'stretch' }, + ], + requires: { display: ['flex'] }, + }, + ]); + }); + + test('Build align-content', () => { + expect(obj.build('align-content')).toEqual([ + { + property: 'align-content', + type: 'select', + defaults: 'stretch', + list: [ + { value: 'flex-start' }, + { value: 'flex-end' }, + { value: 'center' }, + { value: 'space-between' }, + { value: 'space-around' }, + { value: 'stretch' }, + ], + requires: { display: ['flex'] }, + }, + ]); + }); + + test('Build align-self', () => { + expect(obj.build('align-self')).toEqual([ + { + property: 'align-self', + type: 'select', + defaults: 'auto', + list: [ + { value: 'auto' }, + { value: 'flex-start' }, + { value: 'flex-end' }, + { value: 'center' }, + { value: 'baseline' }, + { value: 'stretch' }, + ], + requiresParent: { display: ['flex'] }, + }, + ]); + }); + + test('Build position', () => { + expect(obj.build('position')).toEqual([ + { + property: 'position', + type: 'radio', + defaults: 'static', + list: [{ value: 'static' }, { value: 'relative' }, { value: 'absolute' }, { value: 'fixed' }], + }, + ]); + }); + + test('Build left, right', () => { + var res = { + type: 'integer', + units: ['px', '%', 'vw'], + defaults: 'auto', + fixedValues: ['initial', 'inherit', 'auto'], + }; + res.property = 'right'; + expect(obj.build('right')).toEqual([res]); + res.property = 'left'; + expect(obj.build('left')).toEqual([res]); + }); + + test('Build top, bottom', () => { + var res = { + type: 'integer', + units: ['px', '%', 'vh'], + defaults: 'auto', + fixedValues: ['initial', 'inherit', 'auto'], + }; + res.property = 'top'; + expect(obj.build('top')).toEqual([res]); + res.property = 'bottom'; + expect(obj.build('bottom')).toEqual([res]); + }); + + test('Build width family', () => { + var res = { + type: 'integer', + units: ['px', '%', 'vw'], + defaults: 'auto', + fixedValues: ['initial', 'inherit', 'auto'], + min: 0, + }; + res.property = 'width'; + expect(obj.build('width')).toEqual([res]); + res.property = 'min-width'; + expect(obj.build('min-width')).toEqual([res]); + res.property = 'max-width'; + expect(obj.build('max-width')).toEqual([res]); + }); + + test('Build flex-basis', () => { + var res = { + type: 'integer', + units: ['px', '%', 'vw', 'vh'], + defaults: 'auto', + fixedValues: ['initial', 'inherit', 'auto'], + requiresParent: { display: ['flex'] }, + min: 0, + }; + res.property = 'flex-basis'; + expect(obj.build('flex-basis')).toEqual([res]); + }); + + test('Build height family', () => { + var res = { + type: 'integer', + units: ['px', '%', 'vh'], + defaults: 'auto', + fixedValues: ['initial', 'inherit', 'auto'], + min: 0, + }; + res.property = 'height'; + expect(obj.build('height')).toEqual([res]); + res.property = 'min-height'; + expect(obj.build('min-height')).toEqual([res]); + res.property = 'max-height'; + expect(obj.build('max-height')).toEqual([res]); + }); + + test('Build margin', () => { + var res = { + property: 'margin', + type: 'composite', + properties: [ + { + fixedValues: ['initial', 'inherit', 'auto'], + property: 'margin-top', + type: 'integer', + units: ['px', '%', 'vh'], + defaults: 0, + }, + { + fixedValues: ['initial', 'inherit', 'auto'], + property: 'margin-right', + type: 'integer', + units: ['px', '%', 'vw'], + defaults: 0, + }, + { + fixedValues: ['initial', 'inherit', 'auto'], + property: 'margin-bottom', + type: 'integer', + units: ['px', '%', 'vh'], + defaults: 0, + }, + { + fixedValues: ['initial', 'inherit', 'auto'], + property: 'margin-left', + type: 'integer', + units: ['px', '%', 'vw'], + defaults: 0, + }, + ], + }; + expect(obj.build('margin')).toEqual([res]); + }); + + test('Build padding', () => { + var res = { + property: 'padding', + type: 'composite', + properties: [ + { + property: 'padding-top', + fixedValues: ['initial', 'inherit', 'auto'], + type: 'integer', + units: ['px', '%', 'vh'], + defaults: 0, + min: 0, + }, + { + property: 'padding-right', + fixedValues: ['initial', 'inherit', 'auto'], + type: 'integer', + units: ['px', '%', 'vw'], + defaults: 0, + min: 0, + }, + { + property: 'padding-bottom', + fixedValues: ['initial', 'inherit', 'auto'], + type: 'integer', + units: ['px', '%', 'vh'], + defaults: 0, + min: 0, + }, + { + property: 'padding-left', + fixedValues: ['initial', 'inherit', 'auto'], + type: 'integer', + units: ['px', '%', 'vw'], + defaults: 0, + min: 0, + }, + ], + }; + expect(obj.build('padding')).toEqual([res]); + }); + + test('Build font-family', () => { + var ss = ', sans-serif'; + var ms = ', monospace'; + var res = { + property: 'font-family', + type: 'select', + defaults: 'Arial, Helvetica' + ss, + list: [ + { name: 'Arial', value: 'Arial, Helvetica' + ss }, + { name: 'Arial Black', value: 'Arial Black, Gadget' + ss }, + { name: 'Brush Script MT', value: 'Brush Script MT' + ss }, + { name: 'Comic Sans MS', value: 'Comic Sans MS, cursive' + ss }, + { name: 'Courier New', value: 'Courier New, Courier' + ms }, + { name: 'Georgia', value: 'Georgia, serif' }, + { name: 'Helvetica', value: 'Helvetica' + ss }, + { name: 'Impact', value: 'Impact, Charcoal' + ss }, + { + name: 'Lucida Sans Unicode', + value: 'Lucida Sans Unicode, Lucida Grande' + ss, + }, + { name: 'Tahoma', value: 'Tahoma, Geneva' + ss }, + { name: 'Times New Roman', value: 'Times New Roman, Times, serif' }, + { name: 'Trebuchet MS', value: 'Trebuchet MS, Helvetica' + ss }, + { name: 'Verdana', value: 'Verdana, Geneva' + ss }, + ], + }; + expect(obj.build('font-family')).toEqual([res]); + }); + + test('Build font-size', () => { + var res = { + type: 'integer', + units: ['px', 'em', 'rem', '%'], + defaults: 'medium', + min: 0, + fixedValues: [ + 'medium', + 'xx-small', + 'x-small', + 'small', + 'large', + 'x-large', + 'xx-large', + 'smaller', + 'larger', + 'length', + 'initial', + 'inherit', + ], + }; + res.property = 'font-size'; + expect(obj.build('font-size')).toEqual([res]); + }); + + test('Build letter-spacing', () => { + var res = { + type: 'integer', + units: ['px', 'em', 'rem', '%'], + defaults: 'normal', + fixedValues: ['normal', 'initial', 'inherit'], + }; + res.property = 'letter-spacing'; + expect(obj.build('letter-spacing')).toEqual([res]); + }); + + test('Build font-weight', () => { + var res = { + type: 'select', + defaults: '400', + list: [ + { value: '100', name: 'Thin' }, + { value: '200', name: 'Extra-Light' }, + { value: '300', name: 'Light' }, + { value: '400', name: 'Normal' }, + { value: '500', name: 'Medium' }, + { value: '600', name: 'Semi-Bold' }, + { value: '700', name: 'Bold' }, + { value: '800', name: 'Extra-Bold' }, + { value: '900', name: 'Ultra-Bold' }, + ], + }; + res.property = 'font-weight'; + expect(obj.build('font-weight')).toEqual([res]); + }); + + test('Build color', () => { + var res = { + property: 'color', + type: 'color', + defaults: 'black', + }; + expect(obj.build('color')).toEqual([res]); + }); + + test('Build line-height', () => { + var res = { + type: 'integer', + units: ['px', 'em', 'rem', '%'], + defaults: 'normal', + fixedValues: ['normal', 'initial', 'inherit'], + }; + res.property = 'line-height'; + expect(obj.build('line-height')).toEqual([res]); + }); + + test('Build text-align', () => { + var res = { + type: 'radio', + defaults: 'left', + list: [{ value: 'left' }, { value: 'center' }, { value: 'right' }, { value: 'justify' }], + }; + res.property = 'text-align'; + expect(obj.build('text-align')).toEqual([res]); + }); + + test('Build text-shadow', () => { + var res = { + type: 'stack', + preview: true, + defaults: 'none', + properties: [ + { + property: 'text-shadow-h', + type: 'integer', + units: ['px', '%'], + defaults: 0, + }, + { + property: 'text-shadow-v', + type: 'integer', + units: ['px', '%'], + defaults: 0, + }, + { + property: 'text-shadow-blur', + type: 'integer', + units: ['px', '%'], + defaults: 0, + min: 0, + }, + { + property: 'text-shadow-color', + type: 'color', + defaults: 'black', + }, + ], + }; + res.property = 'text-shadow'; + expect(obj.build('text-shadow')).toEqual([res]); + }); + + test('Build border-radius-c', () => { + var res = { + type: 'integer', + units: ['px', '%'], + defaults: 0, + min: 0, + }; + res.property = 'border-radius'; + expect(obj.build('border-radius-c')).toEqual([res]); + }); + + test('Build border-radius', () => { + var res = { + property: 'border-radius', + type: 'composite', + properties: [ + { + property: 'border-top-left-radius', + type: 'integer', + units: ['px', '%'], + defaults: '0px', + min: 0, + }, + { + property: 'border-top-right-radius', + type: 'integer', + units: ['px', '%'], + min: 0, + defaults: '0px', + }, + { + property: 'border-bottom-right-radius', + type: 'integer', + units: ['px', '%'], + min: 0, + defaults: '0px', + }, + { + property: 'border-bottom-left-radius', + type: 'integer', + units: ['px', '%'], + min: 0, + defaults: '0px', + }, + ], + }; + res.property = 'border-radius'; + expect(obj.build('border-radius')).toEqual([res]); + }); + + test('Build background-color', () => { + var res = { + type: 'color', + defaults: 'none', + }; + res.property = 'background-color'; + expect(obj.build('background-color')).toEqual([res]); + }); + + test('Build border', () => { + var res = { + property: 'border', + type: 'composite', + properties: [ + { + property: 'border-width', + type: 'integer', + units: ['px', 'em'], + defaults: 'medium', + min: 0, + }, + { + property: 'border-style', + type: 'select', + defaults: 'solid', + list: [ + { value: 'none' }, + { value: 'solid' }, + { value: 'dotted' }, + { value: 'dashed' }, + { value: 'double' }, + { value: 'groove' }, + { value: 'ridge' }, + { value: 'inset' }, + { value: 'outset' }, + ], + }, + { + property: 'border-color', + type: 'color', + defaults: 'black', + }, + ], + }; + expect(obj.build('border')).toEqual([res]); + }); + + test('Build box-shadow', () => { + var res = { + property: 'box-shadow', + type: 'stack', + preview: true, + properties: [ + { + property: 'box-shadow-h', + type: 'integer', + units: ['px', '%'], + defaults: 0, + }, + { + property: 'box-shadow-v', + type: 'integer', + units: ['px', '%'], + defaults: 0, + }, + { + property: 'box-shadow-blur', + type: 'integer', + units: ['px'], + defaults: '5px', + min: 0, + }, + { + property: 'box-shadow-spread', + type: 'integer', + units: ['px'], + defaults: 0, + }, + { + property: 'box-shadow-color', + type: 'color', + defaults: 'black', + }, + { + property: 'box-shadow-type', + type: 'select', + defaults: '', + list: [ + { value: '', name: 'Outside' }, + { value: 'inset', name: 'Inside' }, + ], + }, + ], + }; + expect(obj.build('box-shadow')).toEqual([res]); + }); + + test('Build background', () => { + var res = { + property: 'background', + type: 'stack', + preview: true, + detached: true, + properties: [ + { + property: 'background-image', + type: 'file', + functionName: 'url', + }, + { + property: 'background-repeat', + type: 'select', + defaults: 'repeat', + list: [{ value: 'repeat' }, { value: 'repeat-x' }, { value: 'repeat-y' }, { value: 'no-repeat' }], + }, + { + property: 'background-position', + type: 'select', + defaults: 'left top', + list: [ + { value: 'left top' }, + { value: 'left center' }, + { value: 'left bottom' }, + { value: 'right top' }, + { value: 'right center' }, + { value: 'right bottom' }, + { value: 'center top' }, + { value: 'center center' }, + { value: 'center bottom' }, + ], + }, + { + property: 'background-attachment', + type: 'select', + defaults: 'scroll', + list: [{ value: 'scroll' }, { value: 'fixed' }, { value: 'local' }], + }, + { + property: 'background-size', + type: 'select', + defaults: 'auto', + list: [{ value: 'auto' }, { value: 'cover' }, { value: 'contain' }], + }, + ], + }; + expect(obj.build('background')).toEqual([res]); + }); + + test('Build transition', () => { + var res = { + property: 'transition', + type: 'stack', + properties: [ + { + property: 'transition-property', + type: 'select', + defaults: 'width', + list: [ + { value: 'all' }, + { value: 'width' }, + { value: 'height' }, + { value: 'background-color' }, + { value: 'transform' }, + { value: 'box-shadow' }, + { value: 'opacity' }, + ], + }, + { + property: 'transition-duration', + type: 'integer', + units: ['s'], + defaults: '2', + min: 0, + }, + { + property: 'transition-timing-function', + type: 'select', + defaults: 'ease', + list: [ + { value: 'linear' }, + { value: 'ease' }, + { value: 'ease-in' }, + { value: 'ease-out' }, + { value: 'ease-in-out' }, + ], + }, + ], + }; + expect(obj.build('transition')).toEqual([res]); + }); + + test('Build perspective', () => { + var res = { + property: 'perspective', + type: 'integer', + units: ['px'], + defaults: 0, + min: 0, + }; + expect(obj.build('perspective')).toEqual([res]); + }); + + test('Build transform', () => { + var res = { + property: 'transform', + type: 'composite', + properties: [ + { + property: 'transform-rotate-x', + type: 'integer', + units: ['deg'], + defaults: 0, + functionName: 'rotateX', + }, + { + property: 'transform-rotate-y', + type: 'integer', + units: ['deg'], + defaults: 0, + functionName: 'rotateY', + }, + { + property: 'transform-rotate-z', + type: 'integer', + units: ['deg'], + defaults: 0, + functionName: 'rotateZ', + }, + { + property: 'transform-scale-x', + type: 'integer', + defaults: 1, + functionName: 'scaleX', + }, + { + property: 'transform-scale-y', + type: 'integer', + defaults: 1, + functionName: 'scaleY', + }, + { + property: 'transform-scale-z', + type: 'integer', + defaults: 1, + functionName: 'scaleZ', + }, + ], + }; + expect(obj.build('transform')).toEqual([res]); + }); + + test('Build cursor', () => { + var res = { + type: 'select', + property: 'cursor', + defaults: 'auto', + list: [ + { value: 'auto' }, + { value: 'pointer' }, + { value: 'copy' }, + { value: 'crosshair' }, + { value: 'grab' }, + { value: 'grabbing' }, + { value: 'help' }, + { value: 'move' }, + { value: 'text' }, + ], + }; + expect(obj.build('cursor')).toEqual([res]); + }); + + test('Build overflow', () => { + var res = { + type: 'select', + property: 'overflow', + defaults: 'visible', + list: [{ value: 'visible' }, { value: 'hidden' }, { value: 'scroll' }, { value: 'auto' }], + }; + expect(obj.build('overflow')).toEqual([res]); + }); + + test('Build overflow-x', () => { + var res = { + type: 'select', + property: 'overflow-x', + defaults: 'visible', + list: [{ value: 'visible' }, { value: 'hidden' }, { value: 'scroll' }, { value: 'auto' }], + }; + expect(obj.build('overflow-x')).toEqual([res]); + }); + + test('Build overflow-y', () => { + var res = { + type: 'select', + property: 'overflow-y', + defaults: 'visible', + list: [{ value: 'visible' }, { value: 'hidden' }, { value: 'scroll' }, { value: 'auto' }], + }; + expect(obj.build('overflow-y')).toEqual([res]); + }); +}); From b40e7074ebd0d736402e93c2350eb6d6189ff8ea Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 11 Dec 2021 11:43:39 +0100 Subject: [PATCH 084/313] Start Properties tests --- test/specs/style_manager/model/Properties.js | 50 ++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 test/specs/style_manager/model/Properties.js diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js new file mode 100644 index 000000000..267da85f0 --- /dev/null +++ b/test/specs/style_manager/model/Properties.js @@ -0,0 +1,50 @@ +import Editor from 'editor/model/Editor'; + +describe('StyleManager properties logic', () => { + let obj; + let em; + let domc; + let dv; + let cssc; + let sm; + + beforeEach(() => { + em = new Editor({ + mediaCondition: 'max-width', + avoidInlineStyle: true, + }); + domc = em.get('DomComponents'); + cssc = em.get('CssComposer'); + dv = em.get('DeviceManager'); + sm = em.get('SelectorManager'); + obj = em.get('StyleManager'); + em.get('PageManager').onLoad(); + }); + + afterEach(() => { + obj = null; + em.destroy(); + }); + + describe('Composite type', () => { + const sectorTest = 'sector-test'; + const propTest = 'padding'; + let compTypeProp; + + beforeEach(() => { + obj.addSector(sectorTest, { + properties: [ + { + extend: propTest, + detached: true, + }, + ], + }); + compTypeProp = obj.getProperty(sectorTest, propTest); + }); + + test('Property exists', () => { + expect(compTypeProp).toBeTruthy(); + }); + }); +}); From 5320c05d5cfbe88a62c48b40c72e1a820f139493 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 11 Dec 2021 12:13:16 +0100 Subject: [PATCH 085/313] Add custom option to StyleManager --- src/style_manager/config/config.js | 5 +++- src/style_manager/index.js | 2 +- src/style_manager/model/Property.js | 2 +- test/specs/style_manager/model/Properties.js | 30 ++++++++++++++++++++ 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/style_manager/config/config.js b/src/style_manager/config/config.js index 25dae7d8e..8980c843a 100644 --- a/src/style_manager/config/config.js +++ b/src/style_manager/config/config.js @@ -25,5 +25,8 @@ export default { clearProperties: true, // Properties not to take in account for computed styles - avoidComputed: ['width', 'height'] + avoidComputed: ['width', 'height'], + + // Avoid rendering the default style manager. + custom: false, }; diff --git a/src/style_manager/index.js b/src/style_manager/index.js index cc0ee9abc..10a95d930 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -555,7 +555,7 @@ export default () => { __upProps(opts) { const lastTarget = this.getLastSelected(); - if (!lastTarget || !this.em.getConfig('customUI')) return; + if (!lastTarget || !this.getConfig().custom) return; const lastTargetParents = this.getSelectedParents(); const style = lastTarget.getStyle(); diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 1f0b8fffe..52a16b016 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -16,7 +16,7 @@ export default class Property extends Model { } __hasCustom() { - return !!this.em?.getConfig('customUI'); + return !!this.em?.get('StyleManager').getConfig().custom; } __getParentProp() { diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 267da85f0..ac756d6b2 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -7,11 +7,15 @@ describe('StyleManager properties logic', () => { let dv; let cssc; let sm; + let cmp; + let rule1; + let rule2; beforeEach(() => { em = new Editor({ mediaCondition: 'max-width', avoidInlineStyle: true, + styleManager: { custom: true }, }); domc = em.get('DomComponents'); cssc = em.get('CssComposer'); @@ -19,6 +23,13 @@ describe('StyleManager properties logic', () => { sm = em.get('SelectorManager'); obj = em.get('StyleManager'); em.get('PageManager').onLoad(); + cmp = domc.addComponent(`
`); + [rule1, rule2] = cssc.addRules(` + .cls { color: red; } + @media (max-width: 992px) { + .cls { color: blue; } + } + `); }); afterEach(() => { @@ -29,7 +40,9 @@ describe('StyleManager properties logic', () => { describe('Composite type', () => { const sectorTest = 'sector-test'; const propTest = 'padding'; + const propInTest = 'padding-top'; let compTypeProp; + let compTypePropInn; beforeEach(() => { obj.addSector(sectorTest, { @@ -41,10 +54,27 @@ describe('StyleManager properties logic', () => { ], }); compTypeProp = obj.getProperty(sectorTest, propTest); + compTypePropInn = compTypeProp.getProperty(propInTest); + em.setSelected(cmp); + obj.__upSel(); }); test('Property exists', () => { expect(compTypeProp).toBeTruthy(); + expect(compTypeProp.getProperties().length).toBe(4); + }); + + test('Has inner property', () => { + expect(compTypePropInn).toBeTruthy(); + }); + + test('Rule selected', () => { + expect(obj.getLastSelected()).toBe(rule1); + }); + + test('Updating inner property, it reflects on the rule', () => { + compTypePropInn.upValue('55'); + expect(rule1.getStyle()).toBe(1); }); }); }); From 396df55f1b2652b96e89330f931bd9d6ef925bac Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 11 Dec 2021 12:22:30 +0100 Subject: [PATCH 086/313] Add composite property tests --- test/specs/style_manager/model/Properties.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index ac756d6b2..f09b632da 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -68,13 +68,23 @@ describe('StyleManager properties logic', () => { expect(compTypePropInn).toBeTruthy(); }); + test('Inner property has no value', () => { + expect(compTypeProp.hasValue()).toBe(false); + expect(compTypePropInn.hasValue()).toBe(false); + }); + test('Rule selected', () => { expect(obj.getLastSelected()).toBe(rule1); }); test('Updating inner property, it reflects on the rule', () => { - compTypePropInn.upValue('55'); - expect(rule1.getStyle()).toBe(1); + compTypePropInn.upValue('55%'); + const style = rule1.getStyle(); + const otherProps = Object.keys(style).filter(p => p.indexOf('padding') >= 0 && p !== propInTest); + expect(style[propInTest]).toBe('55%'); + expect(compTypeProp.hasValue()).toBe(true); + expect(compTypePropInn.hasValue()).toBe(true); + otherProps.forEach(prop => expect(style[prop]).toBe('')); }); }); }); From 1b9de49b794f201f78cf1ae1b017cf4defcfe1a3 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 11 Dec 2021 12:27:23 +0100 Subject: [PATCH 087/313] Update tests --- test/specs/style_manager/model/Properties.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index f09b632da..2985628de 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -84,7 +84,12 @@ describe('StyleManager properties logic', () => { expect(style[propInTest]).toBe('55%'); expect(compTypeProp.hasValue()).toBe(true); expect(compTypePropInn.hasValue()).toBe(true); - otherProps.forEach(prop => expect(style[prop]).toBe('')); + otherProps.forEach(prop => { + expect(style[prop]).toBe(''); + if (prop !== propTest) { + expect(compTypeProp.getProperty(prop).hasValue()).toBe(false); + } + }); }); }); }); From b2c669a6d77146802caebf4cf71904959fe0f8bd Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 11 Dec 2021 12:32:09 +0100 Subject: [PATCH 088/313] Add hasValue to stack property --- src/style_manager/model/PropertyStack.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 28dae473b..073e353c4 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -1,5 +1,6 @@ import { keys, isUndefined } from 'underscore'; import Property from './PropertyComposite'; +import PropertyBase from './Property'; import Layers from './Layers'; import { camelCase } from 'utils/mixins'; @@ -111,6 +112,10 @@ export default Property.extend({ return fromStyle ? fromStyle(style) : style; }, + hasValue(opts) { + return PropertyBase.prototype.hasValue.call(this, opts); + }, + /** * Add new layer to the stack * @param {Object} [props={}] Layer props From e80c8fec74744504a49023a89b73a566e0a57161 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 11 Dec 2021 12:43:41 +0100 Subject: [PATCH 089/313] Don't update stack properties on layer select --- src/style_manager/model/PropertyStack.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 073e353c4..2bd3b32c2 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -50,6 +50,11 @@ export default Property.extend({ this.upValue(value, opts); }, + __upTargets(p, opts = {}) { + if (opts.__select) return; + return PropertyBase.prototype._up.call(this, p, opts); + }, + __upLayers(m, c, o) { const value = this.__getFullValue(); this.upValue(value); @@ -147,7 +152,7 @@ export default Property.extend({ * @param {[Layer]} layer */ selectLayer(layer) { - return this.set('selectedLayer', layer); + return this.set('selectedLayer', layer, { __select: true }); }, /** From 95757cecbed5a9d536cb4552012d3867649cccc9 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 11 Dec 2021 13:47:12 +0100 Subject: [PATCH 090/313] Fix stack type update --- src/style_manager/index.js | 2 +- src/style_manager/model/PropertyStack.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 10a95d930..43a01e0e9 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -569,7 +569,7 @@ export default () => { this.__upProp(prop, style, parentStyles, opts); const props = prop.getProperties?.(); - if (props) { + if (props && prop.getType() !== 'stack') { const newStyle = prop.__getFromStyle(style); const newParentStyles = parentStyles.map(p => ({ ...p, diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 2bd3b32c2..f8eff73f7 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -52,7 +52,11 @@ export default Property.extend({ __upTargets(p, opts = {}) { if (opts.__select) return; - return PropertyBase.prototype._up.call(this, p, opts); + return PropertyBase.prototype.__upTargets.call(this, p, opts); + }, + + __upTargetsStyle(style, opts) { + return PropertyBase.prototype.__upTargetsStyle.call(this, style, opts); }, __upLayers(m, c, o) { From b4a6ab4331a5598192f0e3ec885520c28439045e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sun, 12 Dec 2021 10:10:37 +0100 Subject: [PATCH 091/313] Update getBuiltIn --- src/style_manager/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 43a01e0e9..9450b7338 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -582,7 +582,7 @@ export default () => { }, getBuiltIn(prop = '') { - return this.PropertyFactory.build(prop); + return this.PropertyFactory.build(prop)[0] || null; }, __upProp(prop, style, parentStyles, opts) { From 6b2de1dfb383bd1e30ba8c169ce3053cd2e0b2fe Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 13 Dec 2021 12:00:43 +0100 Subject: [PATCH 092/313] Update layers parser --- src/style_manager/model/PropertyStack.js | 13 +++- test/specs/style_manager/model/Properties.js | 62 +++++++++++++++++--- 2 files changed, 67 insertions(+), 8 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index f8eff73f7..89057440e 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -112,7 +112,14 @@ export default Property.extend({ __parseLayer(value) { const parseFn = this.get('parseLayer'); const values = value.split(PARTS_REG); - return parseFn ? parseFn({ value, values }) : values; + const properties = this.getProperties(); + return parseFn + ? parseFn({ value, values }) + : properties.reduce((acc, prop, i) => { + const value = values[i]; + acc[prop.getId()] = !isUndefined(value) ? value : prop.getDefaultValue(); + return acc; + }, {}); }, __getFromStyle(style = {}) { @@ -214,6 +221,10 @@ export default Property.extend({ return this.get('layers'); }, + getLayer(index = 0) { + return this.getLayers().at(index); + }, + getCurrentLayer() { return this.getLayers().filter(layer => layer.get('active'))[0]; }, diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 2985628de..87772eeda 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -10,6 +10,7 @@ describe('StyleManager properties logic', () => { let cmp; let rule1; let rule2; + const sectorTest = 'sector-test'; beforeEach(() => { em = new Editor({ @@ -24,12 +25,6 @@ describe('StyleManager properties logic', () => { obj = em.get('StyleManager'); em.get('PageManager').onLoad(); cmp = domc.addComponent(`
`); - [rule1, rule2] = cssc.addRules(` - .cls { color: red; } - @media (max-width: 992px) { - .cls { color: blue; } - } - `); }); afterEach(() => { @@ -38,13 +33,13 @@ describe('StyleManager properties logic', () => { }); describe('Composite type', () => { - const sectorTest = 'sector-test'; const propTest = 'padding'; const propInTest = 'padding-top'; let compTypeProp; let compTypePropInn; beforeEach(() => { + rule1 = cssc.addRules(`.cls { color: red; }`)[0]; obj.addSector(sectorTest, { properties: [ { @@ -92,4 +87,57 @@ describe('StyleManager properties logic', () => { }); }); }); + + describe('Stack type (not detached)', () => { + const propTest = 'stack-prop'; + const propATest = `${propTest}-a`; + const propBTest = `${propTest}-b`; + const propCTest = `${propTest}-c`; + let compTypeProp; + let compTypePropInn; + + beforeEach(() => { + rule1 = cssc.addRules(` + .cls { + ${propTest}: valueA-1 valueB-1 valueC-1, valueA-2 valueB-2 valueC-2; + } + `)[0]; + obj.addSector(sectorTest, { + properties: [ + { + type: 'stack', + property: propTest, + properties: [{ property: propATest }, { property: propBTest }, { property: propCTest }], + }, + ], + }); + compTypeProp = obj.getProperty(sectorTest, propTest); + compTypePropInn = compTypeProp.getProperty(propATest); + em.setSelected(cmp); + obj.__upSel(); + }); + + test('Property exists', () => { + expect(compTypeProp).toBeTruthy(); + expect(compTypePropInn).toBeTruthy(); + expect(compTypeProp.getProperties().length).toBe(3); + }); + + test('Has the right number of layers', () => { + expect(compTypeProp.getLayers().length).toBe(2); + }); + + test('Layers has the right values', () => { + expect(compTypeProp.getLayer(0).getValues()).toEqual({ + [propATest]: 'valueA-1', + [propBTest]: 'valueB-1', + [propCTest]: 'valueC-1', + }); + expect(compTypeProp.getLayer(1).getValues()).toEqual({ + [propATest]: 'valueA-2', + [propBTest]: 'valueB-2', + [propCTest]: 'valueC-2', + }); + }); + }); }); From b185efc32a7362c7ae893753c0ac3f4dd624159b Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 13 Dec 2021 12:29:15 +0100 Subject: [PATCH 093/313] Add stack test for update --- src/style_manager/model/PropertyStack.js | 11 ++++++++++- test/specs/style_manager/model/Properties.js | 19 ++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 89057440e..5ba998321 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -166,6 +166,15 @@ export default Property.extend({ return this.set('selectedLayer', layer, { __select: true }); }, + /** + * Select layer at index + * @param {Number} index Index of the layer to select + */ + selectLayerAt(index = 0) { + const layer = this.getLayer(index); + return layer && this.selectLayer(layer); + }, + /** * Get selected layer * @returns {[Layer] | null} @@ -222,7 +231,7 @@ export default Property.extend({ }, getLayer(index = 0) { - return this.getLayers().at(index); + return this.getLayers().at(index) || null; }, getCurrentLayer() { diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 87772eeda..3521d4758 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -93,13 +93,14 @@ describe('StyleManager properties logic', () => { const propATest = `${propTest}-a`; const propBTest = `${propTest}-b`; const propCTest = `${propTest}-c`; + const propStyleValue = 'valueA-1 valueB-1 valueC-1, valueA-2 valueB-2 valueC-2'; let compTypeProp; let compTypePropInn; beforeEach(() => { rule1 = cssc.addRules(` .cls { - ${propTest}: valueA-1 valueB-1 valueC-1, valueA-2 valueB-2 valueC-2; + ${propTest}: ${propStyleValue}; } `)[0]; obj.addSector(sectorTest, { @@ -127,6 +128,10 @@ describe('StyleManager properties logic', () => { expect(compTypeProp.getLayers().length).toBe(2); }); + test('Has no selected layer', () => { + expect(compTypeProp.getSelectedLayer()).toBe(null); + }); + test('Layers has the right values', () => { expect(compTypeProp.getLayer(0).getValues()).toEqual({ [propATest]: 'valueA-1', @@ -139,5 +144,17 @@ describe('StyleManager properties logic', () => { [propCTest]: 'valueC-2', }); }); + + test('Updating inner property, it reflects on the rule', () => { + expect(rule1.getStyle()).toEqual({ [propTest]: propStyleValue }); + compTypeProp.selectLayerAt(0); + compTypeProp.getProperty(propBTest).upValue('valueB-1-mod'); + compTypeProp.selectLayerAt(1); + compTypeProp.getProperty(propCTest).upValue('valueC-2-mod'); + expect(rule1.getStyle()).toEqual({ + __p: false, + [propTest]: 'valueA-1 valueB-1-mod valueC-1, valueA-2 valueB-2 valueC-2-mod', + }); + }); }); }); From 29b42d7ef9abc5ee13e47403575ee518f479f5ba Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 13 Dec 2021 12:33:54 +0100 Subject: [PATCH 094/313] Test removeLayerAt --- src/style_manager/model/PropertyStack.js | 13 ++++++++++++- test/specs/style_manager/model/Properties.js | 8 ++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 5ba998321..99f7e7b82 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -153,9 +153,20 @@ export default Property.extend({ /** * Remove layer * @param {[Layer]} layer + * @returns {[Layer]} Removed layer */ removeLayer(layer) { - this.get('layers').remove(layer); + return this.get('layers').remove(layer); + }, + + /** + * Remove layer at index + * @param {Number} index Index of the layer to remove + * @returns {[Layer] | null} Removed layer + */ + removeLayerAt(index = 0) { + const layer = this.getLayer(index); + return layer ? this.removeLayer(layer) : null; }, /** diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 3521d4758..cfcfbb35f 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -156,5 +156,13 @@ describe('StyleManager properties logic', () => { [propTest]: 'valueA-1 valueB-1-mod valueC-1, valueA-2 valueB-2 valueC-2-mod', }); }); + + test('Removing layer, updates the rule', () => { + compTypeProp.removeLayerAt(1); + expect(rule1.getStyle()).toEqual({ + __p: false, + [propTest]: 'valueA-1 valueB-1 valueC-1', + }); + }); }); }); From a2b1935acd94dcc4ede11e797e12a1fc9d639547 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 13 Dec 2021 14:13:01 +0100 Subject: [PATCH 095/313] Add __getLayersFromStyle to stack property --- src/style_manager/index.js | 3 +- src/style_manager/model/PropertyStack.js | 70 +++++++++++++++++++- test/specs/style_manager/model/Properties.js | 16 +++-- 3 files changed, 82 insertions(+), 7 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 9450b7338..955a2307c 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -568,8 +568,9 @@ export default () => { sector.getProperties().map(prop => { this.__upProp(prop, style, parentStyles, opts); const props = prop.getProperties?.(); + const isStack = prop.getType() === 'stack'; - if (props && prop.getType() !== 'stack') { + if (props && !isStack) { const newStyle = prop.__getFromStyle(style); const newParentStyles = parentStyles.map(p => ({ ...p, diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 99f7e7b82..14081851d 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -1,4 +1,4 @@ -import { keys, isUndefined } from 'underscore'; +import { keys, isUndefined, isArray, isString } from 'underscore'; import Property from './PropertyComposite'; import PropertyBase from './Property'; import Layers from './Layers'; @@ -7,6 +7,13 @@ import { camelCase } from 'utils/mixins'; const VALUES_REG = /,(?![^\(]*\))/; const PARTS_REG = /\s(?![^(]*\))/; +const splitStyleName = (style, name, sep) => { + return (style[name] || '') + .split(sep) + .map(value => value.trim()) + .filter(Boolean); +}; + export default Property.extend({ defaults: { ...Property.prototype.defaults, @@ -128,6 +135,49 @@ export default Property.extend({ return fromStyle ? fromStyle(style) : style; }, + __getLayersFromStyle(style = {}) { + const name = this.getName(); + const props = this.getProperties(); + const nameProps = props.map(prop => prop.getName()); + const allNameProps = [name, ...nameProps]; + const hasProps = allNameProps.some(prop => !isUndefined(style[prop])); + + if (!hasProps) { + return []; + } else { + const fromStyle = this.get('fromStyle'); + let result = fromStyle ? fromStyle(style, { property: this }) : []; + + if (!fromStyle) { + const sep = this.getLayerSeparator(); + const sepParts = this.getPartsSeparator(); + // Get layers from the main property + const layers = splitStyleName(style, name, sep) + .map(value => value.split(sepParts)) + .map(parts => { + const result = {}; + props.forEach((prop, i) => { + const value = parts[i]; + result[prop.getId()] = !isUndefined(value) ? value : prop.getDefaultValue(); + }); + return result; + }); + // Get layers from the inner properties + props.forEach(prop => { + const id = prop.getId(); + splitStyleName(style, prop.getName(), sep) + .map(value => ({ [id]: value || prop.getDefaultValue() })) + .forEach((inLayer, i) => { + layers[i] = layers[i] ? { ...layers[i], ...inLayer } : inLayer; + }); + }); + result = layers; + } + + return isArray(result) ? result : [result]; + } + }, + hasValue(opts) { return PropertyBase.prototype.hasValue.call(this, opts); }, @@ -237,6 +287,24 @@ export default Property.extend({ .join(this.get('layerSeparator')); }, + /** + * Get layer sperator + * @return {RegExp} + */ + getLayerSeparator() { + const sep = this.get('layerSeparator'); + return isString(sep) ? new RegExp(`${sep}(?![^\\(]*\\))`) : sep; + }, + + /** + * Get layer parts sperator + * @return {RegExp} + */ + getPartsSeparator() { + const sep = this.get('partsSeparator') || ' '; + return isString(sep) ? new RegExp(`${sep}(?![^\\(]*\\))`) : sep; + }, + getLayers() { return this.get('layers'); }, diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index cfcfbb35f..72db09ce5 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -93,7 +93,9 @@ describe('StyleManager properties logic', () => { const propATest = `${propTest}-a`; const propBTest = `${propTest}-b`; const propCTest = `${propTest}-c`; + const propsTest = [propATest, propBTest, propCTest]; const propStyleValue = 'valueA-1 valueB-1 valueC-1, valueA-2 valueB-2 valueC-2'; + const propStyleExtValue = 'valueC-1-ext, valueC-2-ext'; let compTypeProp; let compTypePropInn; @@ -101,6 +103,7 @@ describe('StyleManager properties logic', () => { rule1 = cssc.addRules(` .cls { ${propTest}: ${propStyleValue}; + ${propCTest}: ${propStyleExtValue}; } `)[0]; obj.addSector(sectorTest, { @@ -108,7 +111,7 @@ describe('StyleManager properties logic', () => { { type: 'stack', property: propTest, - properties: [{ property: propATest }, { property: propBTest }, { property: propCTest }], + properties: propsTest.map(property => ({ property })), }, ], }); @@ -132,21 +135,24 @@ describe('StyleManager properties logic', () => { expect(compTypeProp.getSelectedLayer()).toBe(null); }); - test('Layers has the right values', () => { + test.only('Layers has the right values', () => { expect(compTypeProp.getLayer(0).getValues()).toEqual({ [propATest]: 'valueA-1', [propBTest]: 'valueB-1', - [propCTest]: 'valueC-1', + [propCTest]: 'valueC-1-ext', }); expect(compTypeProp.getLayer(1).getValues()).toEqual({ [propATest]: 'valueA-2', [propBTest]: 'valueB-2', - [propCTest]: 'valueC-2', + [propCTest]: 'valueC-2-ext', }); }); test('Updating inner property, it reflects on the rule', () => { - expect(rule1.getStyle()).toEqual({ [propTest]: propStyleValue }); + expect(rule1.getStyle()).toEqual({ + [propTest]: propStyleValue, + [propCTest]: propStyleExtValue, + }); compTypeProp.selectLayerAt(0); compTypeProp.getProperty(propBTest).upValue('valueB-1-mod'); compTypeProp.selectLayerAt(1); From 6bcc1ade1a808d6c0873e73dddb5f1cf04c86dba Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 13 Dec 2021 14:42:41 +0100 Subject: [PATCH 096/313] Test getLayersFromStyle --- test/specs/style_manager/model/Properties.js | 26 +++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 72db09ce5..2514b8c18 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -135,7 +135,31 @@ describe('StyleManager properties logic', () => { expect(compTypeProp.getSelectedLayer()).toBe(null); }); - test.only('Layers has the right values', () => { + test('getLayersFromStyle returns correct values', () => { + expect( + compTypeProp.__getLayersFromStyle({ + [propTest]: 'valueA-1 valueB-1 valueC-1, valueA-2 valueB-2 valueC-2', + [propCTest]: 'valueC-1-ext, valueC-2-ext, valueC-3-ext', + [propBTest]: 'valueB-1-ext', + }) + ).toEqual([ + { + [propATest]: 'valueA-1', + [propBTest]: 'valueB-1-ext', + [propCTest]: 'valueC-1-ext', + }, + { + [propATest]: 'valueA-2', + [propBTest]: 'valueB-2', + [propCTest]: 'valueC-2-ext', + }, + { + [propCTest]: 'valueC-3-ext', + }, + ]); + }); + + test('Layers has the right values', () => { expect(compTypeProp.getLayer(0).getValues()).toEqual({ [propATest]: 'valueA-1', [propBTest]: 'valueB-1', From 0ee09e756db4e25118452e92fa809620a0c0f176 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 13 Dec 2021 14:50:34 +0100 Subject: [PATCH 097/313] Update stack layers --- src/style_manager/index.js | 21 +++++++++++--------- src/style_manager/model/PropertyStack.js | 11 ++++++++++ test/specs/style_manager/model/Properties.js | 2 +- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 955a2307c..2137e46ef 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -568,15 +568,18 @@ export default () => { sector.getProperties().map(prop => { this.__upProp(prop, style, parentStyles, opts); const props = prop.getProperties?.(); - const isStack = prop.getType() === 'stack'; - - if (props && !isStack) { - const newStyle = prop.__getFromStyle(style); - const newParentStyles = parentStyles.map(p => ({ - ...p, - style: prop.__getFromStyle(p.style), - })); - props.forEach(prop => this.__upProp(prop, newStyle, newParentStyles, opts)); + + if (props) { + if (prop.getType() === 'stack') { + prop.__setLayers(prop.__getLayersFromStyle(style)); + } else { + const newStyle = prop.__getFromStyle(style); + const newParentStyles = parentStyles.map(p => ({ + ...p, + style: prop.__getFromStyle(p.style), + })); + props.forEach(prop => this.__upProp(prop, newStyle, newParentStyles, opts)); + } } }); }); diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 14081851d..d995e9033 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -105,6 +105,17 @@ export default Property.extend({ return Property.prototype._up.call(this, rest, opts); }, + __setLayers(newLayers = []) { + const layers = this.getLayers(); + const layersNew = newLayers.map(values => ({ values })); + + if (layers.length === layersNew.length) { + layersNew.map((layer, n) => layers.at(n)?.upValues(layer.values)); + } else { + this.getLayers().reset(layersNew); + } + }, + __parseValue(value) { const result = this.parseValue(value); result.__layers = value diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 2514b8c18..cd31d3580 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -183,7 +183,7 @@ describe('StyleManager properties logic', () => { compTypeProp.getProperty(propCTest).upValue('valueC-2-mod'); expect(rule1.getStyle()).toEqual({ __p: false, - [propTest]: 'valueA-1 valueB-1-mod valueC-1, valueA-2 valueB-2 valueC-2-mod', + [propTest]: 'valueA-1 valueB-1-mod valueC-1-ext, valueA-2 valueB-2 valueC-2-mod', }); }); From afa319544a800fe5795fcde5114963166de1060e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 13 Dec 2021 15:02:30 +0100 Subject: [PATCH 098/313] Update style properly on layers change --- src/style_manager/model/PropertyStack.js | 18 +++++++++++++++--- test/specs/style_manager/model/Properties.js | 8 +++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index d995e9033..37ba9a937 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -55,6 +55,13 @@ export default Property.extend({ layer.upValues({ [name]: prop.__getFullValue() }); const value = this.__getFullValue(); this.upValue(value, opts); + this.__upTargetsStyleProps(opts); + }, + + __upLayers(m, c, o) { + const value = this.__getFullValue(); + this.upValue(value); + this.__upTargetsStyleProps(o || c); }, __upTargets(p, opts = {}) { @@ -66,9 +73,14 @@ export default Property.extend({ return PropertyBase.prototype.__upTargetsStyle.call(this, style, opts); }, - __upLayers(m, c, o) { - const value = this.__getFullValue(); - this.upValue(value); + __upTargetsStyleProps(opts = {}) { + if (!this.isDetached()) { + const style = this.getProperties().reduce((acc, prop) => { + acc[prop.getName()] = ''; + return acc; + }, {}); + this.__upTargetsStyle(style, opts); + } }, __upSelected({ noEvent } = {}, opts = {}) { diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index cd31d3580..4139ed915 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -184,6 +184,9 @@ describe('StyleManager properties logic', () => { expect(rule1.getStyle()).toEqual({ __p: false, [propTest]: 'valueA-1 valueB-1-mod valueC-1-ext, valueA-2 valueB-2 valueC-2-mod', + [propATest]: '', + [propBTest]: '', + [propCTest]: '', }); }); @@ -191,7 +194,10 @@ describe('StyleManager properties logic', () => { compTypeProp.removeLayerAt(1); expect(rule1.getStyle()).toEqual({ __p: false, - [propTest]: 'valueA-1 valueB-1 valueC-1', + [propTest]: 'valueA-1 valueB-1 valueC-1-ext', + [propATest]: '', + [propBTest]: '', + [propCTest]: '', }); }); }); From 8c859d3694a71ecfa9723347ac4f00bebefa4bcf Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 13 Dec 2021 15:20:29 +0100 Subject: [PATCH 099/313] Test add new layer --- test/specs/style_manager/model/Properties.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 4139ed915..711de73cf 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -200,5 +200,23 @@ describe('StyleManager properties logic', () => { [propCTest]: '', }); }); + + test('Adding new layer, updates the rule', () => { + compTypeProp.addLayer( + { + [propATest]: 'valueA-new', + [propBTest]: 'valueB-new', + [propCTest]: 'valueC-new', + }, + { at: 0 } + ); + expect(rule1.getStyle()).toEqual({ + __p: false, + [propTest]: `valueA-new valueB-new valueC-new, valueA-1 valueB-1 valueC-1-ext, valueA-2 valueB-2 valueC-2-ext`, + [propATest]: '', + [propBTest]: '', + [propCTest]: '', + }); + }); }); }); From 5ce84d4876245cc0c906d4ccae41bb706c09da67 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 13 Dec 2021 16:23:26 +0100 Subject: [PATCH 100/313] Test custom fromStyle --- src/style_manager/model/PropertyStack.js | 6 +++--- test/specs/style_manager/model/Properties.js | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 37ba9a937..1b346c2e4 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -168,12 +168,12 @@ export default Property.extend({ if (!hasProps) { return []; } else { + const sep = this.getLayerSeparator(); + const sepParts = this.getPartsSeparator(); const fromStyle = this.get('fromStyle'); - let result = fromStyle ? fromStyle(style, { property: this }) : []; + let result = fromStyle ? fromStyle(style, { property: this, separatorLayers: sep }) : []; if (!fromStyle) { - const sep = this.getLayerSeparator(); - const sepParts = this.getPartsSeparator(); // Get layers from the main property const layers = splitStyleName(style, name, sep) .map(value => value.split(sepParts)) diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 711de73cf..0546fb8e7 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -159,6 +159,25 @@ describe('StyleManager properties logic', () => { ]); }); + test('Custom fromStyle', () => { + compTypeProp.set('fromStyle', (style, { separatorLayers }) => { + const layerValues = style[propTest].split(separatorLayers); + return layerValues.map(value => ({ value })); + }); + expect( + compTypeProp.__getLayersFromStyle({ + [propTest]: 'rgba(valueA-1, valueB-1), rgba(valueA-2, valueB-2)', + }) + ).toEqual([ + { + value: 'rgba(valueA-1, valueB-1)', + }, + { + value: 'rgba(valueA-2, valueB-2)', + }, + ]); + }); + test('Layers has the right values', () => { expect(compTypeProp.getLayer(0).getValues()).toEqual({ [propATest]: 'valueA-1', From 84c1375ddeef4a493094fea4b88c79025d974d4b Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 13 Dec 2021 16:42:28 +0100 Subject: [PATCH 101/313] Add and test getStyleFromLayers --- src/style_manager/model/PropertyStack.js | 42 +++++++++++++++++++- test/specs/style_manager/model/Properties.js | 9 +++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 1b346c2e4..e09255120 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -20,9 +20,12 @@ export default Property.extend({ // Array of layers (which contain properties) layers: [], - // The separator used to join layer values + // The separator used to split layer values layerSeparator: ', ', + // The separator used to join layer values + layerJoin: ', ', + // Prepend new layers in the list prepend: 0, @@ -74,6 +77,7 @@ export default Property.extend({ }, __upTargetsStyleProps(opts = {}) { + // TODO same as getStyleFromLayers if (!this.isDetached()) { const style = this.getProperties().reduce((acc, prop) => { acc[prop.getName()] = ''; @@ -269,8 +273,9 @@ export default Property.extend({ }, /** - * Get style object from layer values + * Get style object from layer * @param {[Layer]} layer + * @returns {Object} Style object */ getStyleFromLayer(layer, opts = {}) { const sep = this.get('separator'); @@ -298,6 +303,39 @@ export default Property.extend({ : style; }, + /** + * Get style object from current layers + * @returns {Object} Style object + */ + getStyleFromLayers() { + let result = {}; + const layers = this.getLayers(); + const styles = layers.map(l => this.getStyleFromLayer(l)); + styles.forEach(style => { + keys(style).map(key => { + if (!result[key]) result[key] = []; + result[key].push(style[key]); + }); + }); + keys(result).map(key => { + result[key] = result[key].join(this.__getJoinLayers()); + }); + + if (!this.isDetached()) { + const style = this.getProperties().reduce((acc, prop) => { + acc[prop.getName()] = ''; + return acc; + }, {}); + result = { ...result, ...style }; + } + + return result; + }, + + __getJoinLayers() { + return this.get('layerJoin'); + }, + __getFullValue() { if (this.get('detached')) return ''; const name = this.getName(); diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 0546fb8e7..0ffc984c8 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -178,6 +178,15 @@ describe('StyleManager properties logic', () => { ]); }); + test('getStyleFromLayers', () => { + expect(compTypeProp.getStyleFromLayers()).toEqual({ + [propTest]: 'valueA-1 valueB-1 valueC-1-ext, valueA-2 valueB-2 valueC-2-ext', + [propATest]: '', + [propBTest]: '', + [propCTest]: '', + }); + }); + test('Layers has the right values', () => { expect(compTypeProp.getLayer(0).getValues()).toEqual({ [propATest]: 'valueA-1', From 48ac5fc348b242704fea8f7190a3377ee1a02ce7 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 13 Dec 2021 16:46:12 +0100 Subject: [PATCH 102/313] Test detached getStyleFromLayers --- src/style_manager/model/PropertyStack.js | 4 +++- test/specs/style_manager/model/Properties.js | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index e09255120..60a302a99 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -321,7 +321,9 @@ export default Property.extend({ result[key] = result[key].join(this.__getJoinLayers()); }); - if (!this.isDetached()) { + if (this.isDetached()) { + result[this.getName()] = ''; + } else { const style = this.getProperties().reduce((acc, prop) => { acc[prop.getName()] = ''; return acc; diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 0ffc984c8..0f23f80f9 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -187,6 +187,16 @@ describe('StyleManager properties logic', () => { }); }); + test('getStyleFromLayers detached', () => { + compTypeProp.set('detached', true); + expect(compTypeProp.getStyleFromLayers()).toEqual({ + [propTest]: '', + [propATest]: 'valueA-1, valueA-2', + [propBTest]: 'valueB-1, valueB-2', + [propCTest]: 'valueC-1-ext, valueC-2-ext', + }); + }); + test('Layers has the right values', () => { expect(compTypeProp.getLayer(0).getValues()).toEqual({ [propATest]: 'valueA-1', From cdec46f8a46c89b96986b255b6f16c164093095a Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 14 Dec 2021 11:04:44 +0100 Subject: [PATCH 103/313] Use custom toStyle in Stack --- src/style_manager/model/PropertyStack.js | 38 ++++++++++++-------- test/specs/style_manager/model/Properties.js | 14 ++++++++ 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 60a302a99..5b52bc954 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -278,22 +278,30 @@ export default Property.extend({ * @returns {Object} Style object */ getStyleFromLayer(layer, opts = {}) { - const sep = this.get('separator'); + const join = this.__getJoin(); + const joinLayers = this.__getJoinLayers(); + const toStyle = this.get('toStyle'); const values = layer.getValues(); - const result = this.getProperties().map(prop => { - const name = prop.getName(); - const val = values[name]; - const value = isUndefined(val) ? prop.getDefaultValue() : val; - return { name, value }; - }); - const style = this.get('detached') - ? result.reduce((acc, item) => { - acc[item.name] = item.value; - return acc; - }, {}) - : { - [this.getName()]: result.map(r => r.value).join(sep), - }; + let style; + + if (toStyle) { + style = toStyle(values, { join, joinLayers }); + } else { + const result = this.getProperties().map(prop => { + const name = prop.getName(); + const val = values[name]; + const value = isUndefined(val) ? prop.getDefaultValue() : val; + return { name, value }; + }); + style = this.get('detached') + ? result.reduce((acc, item) => { + acc[item.name] = item.value; + return acc; + }, {}) + : { + [this.getName()]: result.map(r => r.value).join(join), + }; + } return opts.camelCase ? Object.keys(style).reduce((res, key) => { diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 0f23f80f9..2cd193bbe 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -197,6 +197,20 @@ describe('StyleManager properties logic', () => { }); }); + test('Custom toStyle', () => { + compTypeProp.set('toStyle', values => { + return { + [propTest]: `rgba(${values[propATest]}, ${values[propBTest]}, ${values[propCTest]})`, + }; + }); + expect(compTypeProp.getStyleFromLayers()).toEqual({ + [propTest]: 'rgba(valueA-1, valueB-1, valueC-1-ext), rgba(valueA-2, valueB-2, valueC-2-ext)', + [propATest]: '', + [propBTest]: '', + [propCTest]: '', + }); + }); + test('Layers has the right values', () => { expect(compTypeProp.getLayer(0).getValues()).toEqual({ [propATest]: 'valueA-1', From 391c1aecc88a4e5fe598083716c69b8653b8c0fc Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 14 Dec 2021 11:12:18 +0100 Subject: [PATCH 104/313] Test for rule update --- test/specs/style_manager/model/Properties.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 2cd193bbe..193d6aff6 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -224,6 +224,25 @@ describe('StyleManager properties logic', () => { }); }); + test('Updating the rule reflects in layers', () => { + rule1.setStyle({ + [propTest]: 'valueAa-1 valueBb-1 valueCc-1, valueAa-2 valueBb-2 valueCc-2', + [propBTest]: 'valueB-1-ext, valueB-2-ext', + }); + obj.__upSel(); + expect(compTypeProp.getLayers().length).toBe(2); + expect(compTypeProp.getLayer(0).getValues()).toEqual({ + [propATest]: 'valueAa-1', + [propBTest]: 'valueB-1-ext', + [propCTest]: 'valueCc-1', + }); + expect(compTypeProp.getLayer(1).getValues()).toEqual({ + [propATest]: 'valueAa-2', + [propBTest]: 'valueB-2-ext', + [propCTest]: 'valueCc-2', + }); + }); + test('Updating inner property, it reflects on the rule', () => { expect(rule1.getStyle()).toEqual({ [propTest]: propStyleValue, From fbc608c26c783c3ab1554dd750a9893273b9a99f Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 14 Dec 2021 11:30:08 +0100 Subject: [PATCH 105/313] Up Stack --- src/style_manager/model/PropertyStack.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 5b52bc954..1a4c21c7b 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -173,14 +173,13 @@ export default Property.extend({ return []; } else { const sep = this.getLayerSeparator(); - const sepParts = this.getPartsSeparator(); const fromStyle = this.get('fromStyle'); let result = fromStyle ? fromStyle(style, { property: this, separatorLayers: sep }) : []; if (!fromStyle) { // Get layers from the main property const layers = splitStyleName(style, name, sep) - .map(value => value.split(sepParts)) + .map(value => value.split(this.getSplitSeparator())) .map(parts => { const result = {}; props.forEach((prop, i) => { @@ -281,11 +280,12 @@ export default Property.extend({ const join = this.__getJoin(); const joinLayers = this.__getJoinLayers(); const toStyle = this.get('toStyle'); + const name = this.getName(); const values = layer.getValues(); let style; if (toStyle) { - style = toStyle(values, { join, joinLayers }); + style = toStyle(values, { join, joinLayers, name, property: this }); } else { const result = this.getProperties().map(prop => { const name = prop.getName(); @@ -367,15 +367,6 @@ export default Property.extend({ return isString(sep) ? new RegExp(`${sep}(?![^\\(]*\\))`) : sep; }, - /** - * Get layer parts sperator - * @return {RegExp} - */ - getPartsSeparator() { - const sep = this.get('partsSeparator') || ' '; - return isString(sep) ? new RegExp(`${sep}(?![^\\(]*\\))`) : sep; - }, - getLayers() { return this.get('layers'); }, From 37cc28e86d40be45af9e69b2f19a9d53a961f1f9 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 14 Dec 2021 12:29:38 +0100 Subject: [PATCH 106/313] Update stack _up --- src/style_manager/model/PropertyStack.js | 29 ++++-------------------- 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 1a4c21c7b..36020b632 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -62,8 +62,6 @@ export default Property.extend({ }, __upLayers(m, c, o) { - const value = this.__getFullValue(); - this.upValue(value); this.__upTargetsStyleProps(o || c); }, @@ -72,19 +70,12 @@ export default Property.extend({ return PropertyBase.prototype.__upTargets.call(this, p, opts); }, - __upTargetsStyle(style, opts) { - return PropertyBase.prototype.__upTargetsStyle.call(this, style, opts); + __upTargetsStyleProps(opts = {}) { + this.__upTargetsStyle(this.getStyleFromLayers(), opts); }, - __upTargetsStyleProps(opts = {}) { - // TODO same as getStyleFromLayers - if (!this.isDetached()) { - const style = this.getProperties().reduce((acc, prop) => { - acc[prop.getName()] = ''; - return acc; - }, {}); - this.__upTargetsStyle(style, opts); - } + __upTargetsStyle(style, opts) { + return PropertyBase.prototype.__upTargetsStyle.call(this, style, opts); }, __upSelected({ noEvent } = {}, opts = {}) { @@ -106,17 +97,7 @@ export default Property.extend({ _up(props, opts = {}) { const { __layers = [], ...rest } = props; - const layers = this.getLayers(); - const layersNew = __layers.map(values => ({ values })); - - if (layers.length === layersNew.length) { - layersNew.map((layer, n) => { - layers.at(n)?.upValues(layer.values); - }); - } else { - this.getLayers().reset(layersNew); - } - + this.__setLayers(__layers); this.__upSelected({ noEvent: true }, opts); return Property.prototype._up.call(this, rest, opts); }, From 5c004ee546da7bfa3314c579326997f48d9fbfd6 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 14 Dec 2021 12:40:57 +0100 Subject: [PATCH 107/313] Update __getFullValue in stack --- src/style_manager/model/PropertyStack.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 36020b632..ed0c7162f 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -56,8 +56,8 @@ export default Property.extend({ if (opts.__up || !layer) return; const name = prop.getName(); layer.upValues({ [name]: prop.__getFullValue() }); - const value = this.__getFullValue(); - this.upValue(value, opts); + // const value = this.__getFullValue(); + // this.upValue(value, opts); this.__upTargetsStyleProps(opts); }, @@ -329,14 +329,9 @@ export default Property.extend({ __getFullValue() { if (this.get('detached')) return ''; - const name = this.getName(); + const style = this.getStyleFromLayers(); - return this.getLayers() - .map(l => this.getStyleFromLayer(l)) - .map(s => s[name]) - .filter(Boolean) - .map(v => v?.trim()) - .join(this.get('layerSeparator')); + return style[this.getName()]; }, /** From 8f7d3b7db6acd807781ca57ffcbe06f2ec731d10 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 14 Dec 2021 12:50:23 +0100 Subject: [PATCH 108/313] Add getLayerLabel to Stack --- src/style_manager/model/PropertyStack.js | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index ed0c7162f..540e1eca9 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -35,6 +35,9 @@ export default Property.extend({ // Parse single layer value string parseLayer: null, + // Custom layer label function + layerLabel: null, + // Current selected layer selectedLayer: null, }, @@ -243,6 +246,33 @@ export default Property.extend({ return layer && this.selectLayer(layer); }, + /** + * Get layer label + * @param {[Layer]} layer + * @returns {String} + */ + getLayerLabel(layer) { + let result = ''; + + if (layer) { + const layerLabel = this.get('layerLabel'); + const values = layer.getValues(); + const index = layer.getIndex(); + + if (layerLabel) { + result = layerLabel(layer, { index, values }); + } else { + const parts = []; + this.getProperties().map(prop => { + parts.push(values[prop.getId()]); + }); + result = parts.filter(Boolean).join(' '); + } + } + + return result; + }, + /** * Get selected layer * @returns {[Layer] | null} From d5b3bf1ec41af8103ab0acacf51da5ec49d60020 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 14 Dec 2021 13:32:00 +0100 Subject: [PATCH 109/313] Fix getStyleFromLayers with no layers --- src/style_manager/model/PropertyStack.js | 11 ++++++++--- test/specs/style_manager/model/Properties.js | 13 +++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 540e1eca9..a575f5b36 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -24,7 +24,7 @@ export default Property.extend({ layerSeparator: ', ', // The separator used to join layer values - layerJoin: ', ', + layerJoin: '', // Prepend new layers in the list prepend: 0, @@ -328,6 +328,7 @@ export default Property.extend({ */ getStyleFromLayers() { let result = {}; + const name = this.getName(); const layers = this.getLayers(); const styles = layers.map(l => this.getStyleFromLayer(l)); styles.forEach(style => { @@ -341,12 +342,13 @@ export default Property.extend({ }); if (this.isDetached()) { - result[this.getName()] = ''; + result[name] = ''; } else { const style = this.getProperties().reduce((acc, prop) => { acc[prop.getName()] = ''; return acc; }, {}); + result[name] = result[name] || ''; result = { ...result, ...style }; } @@ -354,7 +356,10 @@ export default Property.extend({ }, __getJoinLayers() { - return this.get('layerJoin'); + const join = this.get('layerJoin'); + const sep = this.get('layerSeparator'); + + return join || (isString(sep) ? sep : join); }, __getFullValue() { diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 193d6aff6..8082d2390 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -272,6 +272,19 @@ describe('StyleManager properties logic', () => { }); }); + test('Removing all layers', () => { + compTypeProp.removeLayerAt(1); + compTypeProp.removeLayerAt(0); + expect(compTypeProp.getLayers().length).toBe(0); + expect(rule1.getStyle()).toEqual({ + __p: false, + [propTest]: '', + [propATest]: '', + [propBTest]: '', + [propCTest]: '', + }); + }); + test('Adding new layer, updates the rule', () => { compTypeProp.addLayer( { From 1d6843daa0e1a8afa7aaacf384a1fe27e167b9a8 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 14 Dec 2021 13:50:12 +0100 Subject: [PATCH 110/313] Update stack hasValue --- src/style_manager/model/PropertyStack.js | 10 ++++++++++ test/specs/style_manager/model/Properties.js | 21 ++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index a575f5b36..4b7a8f8f7 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -418,6 +418,16 @@ export default Property.extend({ return !detached ? style[property] : keys(validStyles).length ? validStyles : ''; }, + /** + * Extended + * @private + */ + hasValue(opts = {}) { + const { noParent } = opts; + const parentValue = noParent && this.getParentTarget(); + return this.getLayers().length > 0 && !parentValue; + }, + /** * This method allows to customize layers returned from the target * @param {Object} target diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 8082d2390..4b9b3b9c6 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -63,7 +63,7 @@ describe('StyleManager properties logic', () => { expect(compTypePropInn).toBeTruthy(); }); - test('Inner property has no value', () => { + test('Property has no value', () => { expect(compTypeProp.hasValue()).toBe(false); expect(compTypePropInn.hasValue()).toBe(false); }); @@ -88,7 +88,7 @@ describe('StyleManager properties logic', () => { }); }); - describe('Stack type (not detached)', () => { + describe('Stack type', () => { const propTest = 'stack-prop'; const propATest = `${propTest}-a`; const propBTest = `${propTest}-b`; @@ -131,6 +131,10 @@ describe('StyleManager properties logic', () => { expect(compTypeProp.getLayers().length).toBe(2); }); + test('Property has no value', () => { + expect(compTypeProp.hasValue()).toBe(true); + }); + test('Has no selected layer', () => { expect(compTypeProp.getSelectedLayer()).toBe(null); }); @@ -285,6 +289,19 @@ describe('StyleManager properties logic', () => { }); }); + test.skip('On clear removes all values', () => { + compTypeProp.clear(); + expect(compTypeProp.hasValue()).toBe(false); + expect(compTypeProp.getLayers().length).toBe(0); + expect(rule1.getStyle()).toEqual({ + __p: false, + [propTest]: '', + [propATest]: '', + [propBTest]: '', + [propCTest]: '', + }); + }); + test('Adding new layer, updates the rule', () => { compTypeProp.addLayer( { From 00dd2456dad5c2b0f5626fe5e1cf262f11c355ca Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 14 Dec 2021 14:04:39 +0100 Subject: [PATCH 111/313] Update clear in Stack --- src/style_manager/model/PropertyStack.js | 10 ++++++++++ test/specs/style_manager/model/Properties.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 4b7a8f8f7..4b330de10 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -428,6 +428,16 @@ export default Property.extend({ return this.getLayers().length > 0 && !parentValue; }, + /** + * Extended + * @private + */ + clear(opts = {}) { + this.getLayers().reset(); + this.__upTargetsStyleProps(opts); + return PropertyBase.prototype.clear.call(this); + }, + /** * This method allows to customize layers returned from the target * @param {Object} target diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 4b9b3b9c6..7737d4221 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -289,7 +289,7 @@ describe('StyleManager properties logic', () => { }); }); - test.skip('On clear removes all values', () => { + test('On clear removes all values', () => { compTypeProp.clear(); expect(compTypeProp.hasValue()).toBe(false); expect(compTypeProp.getLayers().length).toBe(0); From 70cabce324f50beffddf08ad0b43d66a8e6da573 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 14 Dec 2021 14:39:07 +0100 Subject: [PATCH 112/313] Update __upProp in order to support Stack with parent targets --- src/style_manager/index.js | 31 ++++++++++++-------- src/style_manager/model/PropertyStack.js | 4 +-- test/specs/style_manager/model/Properties.js | 21 +++++++++++++ 3 files changed, 42 insertions(+), 14 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 2137e46ef..21372cf0e 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -569,17 +569,13 @@ export default () => { this.__upProp(prop, style, parentStyles, opts); const props = prop.getProperties?.(); - if (props) { - if (prop.getType() === 'stack') { - prop.__setLayers(prop.__getLayersFromStyle(style)); - } else { - const newStyle = prop.__getFromStyle(style); - const newParentStyles = parentStyles.map(p => ({ - ...p, - style: prop.__getFromStyle(p.style), - })); - props.forEach(prop => this.__upProp(prop, newStyle, newParentStyles, opts)); - } + if (props && prop.getType() !== 'stack') { + const newStyle = prop.__getFromStyle(style); + const newParentStyles = parentStyles.map(p => ({ + ...p, + style: prop.__getFromStyle(p.style), + })); + props.forEach(prop => this.__upProp(prop, newStyle, newParentStyles, opts)); } }); }); @@ -593,10 +589,20 @@ export default () => { const name = prop.getName(); const value = style[name]; const hasVal = propDef(value); + const isStack = prop.getType() === 'stack'; + let newLayers = isStack ? prop.__getLayersFromStyle(style) : []; let newValue = hasVal ? value : null; let parentTarget = null; - if (!hasVal) { + if (isStack && newLayers === null) { + const parentItem = parentStyles.filter(p => prop.__getLayersFromStyle(p.style) !== null)[0]; + + if (parentItem) { + newValue = parentItem.style[name]; + parentTarget = parentItem.target; + newLayers = prop.__getLayersFromStyle(parentItem.style); + } + } else if (!hasVal) { newValue = null; const parentItem = parentStyles.filter(p => propDef(p.style[name]))[0]; @@ -608,6 +614,7 @@ export default () => { prop.__setParentTarget(parentTarget); prop.__getFullValue() !== newValue && prop.upValue(newValue, { ...opts, __up: true }); + isStack && prop.__setLayers(newLayers || []); }, destroy() { diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 4b330de10..0cefc13fd 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -151,10 +151,10 @@ export default Property.extend({ const props = this.getProperties(); const nameProps = props.map(prop => prop.getName()); const allNameProps = [name, ...nameProps]; - const hasProps = allNameProps.some(prop => !isUndefined(style[prop])); + const hasProps = allNameProps.some(prop => !isUndefined(style[prop]) && style[prop] !== ''); if (!hasProps) { - return []; + return null; } else { const sep = this.getLayerSeparator(); const fromStyle = this.get('fromStyle'); diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 7737d4221..e798cfed5 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -163,6 +163,11 @@ describe('StyleManager properties logic', () => { ]); }); + test('getLayersFromStyle with empty values', () => { + expect(compTypeProp.__getLayersFromStyle({ [propTest]: '' })).toBe(null); + expect(compTypeProp.__getLayersFromStyle({ color: 'red' })).toBe(null); + }); + test('Custom fromStyle', () => { compTypeProp.set('fromStyle', (style, { separatorLayers }) => { const layerValues = style[propTest].split(separatorLayers); @@ -302,6 +307,22 @@ describe('StyleManager properties logic', () => { }); }); + test('Get the values from parent style', () => { + const rule2 = cssc.addRules(` + @media (max-width: 992px) { + .cls { color: red; } + } + `)[0]; + dv.select('tablet'); + obj.__upSel(); + expect(obj.getLastSelected()).toBe(rule2); + expect(obj.getSelectedParents()).toEqual([rule1]); + + expect(compTypeProp.hasValue()).toBe(true); + expect(compTypeProp.hasValue({ noParent: true })).toBe(false); + expect(compTypeProp.getLayers().length).toBe(2); + }); + test('Adding new layer, updates the rule', () => { compTypeProp.addLayer( { From dd3dd3e066f293cc2ac5a586cc48576c71efdec4 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 14 Dec 2021 15:20:23 +0100 Subject: [PATCH 113/313] Add getOption to radio property --- src/style_manager/model/PropertyRadio.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/style_manager/model/PropertyRadio.js b/src/style_manager/model/PropertyRadio.js index be7aed166..d3fe7886d 100644 --- a/src/style_manager/model/PropertyRadio.js +++ b/src/style_manager/model/PropertyRadio.js @@ -5,7 +5,7 @@ export default class PropertyRadio extends Property { return { ...Property.prototype.defaults, options: [], // Array of options, eg. [{ id: '100', label: 'Set 100' }] - full: 1 + full: 1, }; } @@ -19,6 +19,15 @@ export default class PropertyRadio extends Property { return (options && options.length ? options : list) || []; } + /** + * Get current selected option. + * @returns {Object | null} + */ + getOption() { + const id = this.getValue(); + return this.getOptions().filter(o => this.getOptionId(o) === id)[0] || null; + } + /** * Update options. * @param {Array} value Array of options, eg. `[{ id: 'val-1', label: 'Value 1' }]` @@ -62,9 +71,7 @@ export default class PropertyRadio extends Property { const option = options.filter(o => this.getOptionId(o) === id)[0] || {}; const label = option.label || option.name || id; const propId = this.getId(); - return ( - (locale && this.em?.t(`styleManager.options.${propId}.${id}`)) || label - ); + return (locale && this.em?.t(`styleManager.options.${propId}.${id}`)) || label; } initialize(...args) { From 3d385a2755dd82b20fb7b5c4deeea078ced769dd Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 14 Dec 2021 15:50:30 +0100 Subject: [PATCH 114/313] Pass min max options to number --- src/domain_abstract/ui/InputNumber.js | 28 ++++++++-------------- src/style_manager/model/Property.js | 6 ++--- src/style_manager/model/PropertyInteger.js | 11 +++++---- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/src/domain_abstract/ui/InputNumber.js b/src/domain_abstract/ui/InputNumber.js index 0e028b318..4492d8991 100644 --- a/src/domain_abstract/ui/InputNumber.js +++ b/src/domain_abstract/ui/InputNumber.js @@ -12,7 +12,7 @@ export default Input.extend({ 'click [data-arrow-up]': 'upArrowClick', 'click [data-arrow-down]': 'downArrowClick', 'mousedown [data-arrows]': 'downIncrement', - keydown: 'handleKeyDown' + keydown: 'handleKeyDown', }, template() { @@ -132,9 +132,7 @@ export default Input.extend({ }); const temp = document.createElement('div'); - temp.innerHTML = ``; + temp.innerHTML = ``; this.unitEl = temp.firstChild; } } @@ -241,7 +239,7 @@ export default Input.extend({ * @param {Object} opts Options * @return {Object} Validated string */ - validateInputValue(value, opts) { + validateInputValue(value, opts = {}) { var force = 0; var opt = opts || {}; var model = this.model; @@ -249,8 +247,8 @@ export default Input.extend({ var val = !isUndefined(value) ? value : defValue; var units = model.get('units') || []; var unit = model.get('unit') || (units.length && units[0]) || ''; - var max = model.get('max'); - var min = model.get('min'); + var max = !isUndefined(opts.max) ? opts.max : model.get('max'); + var min = !isUndefined(opts.min) ? opts.min : model.get('min'); var limitlessMax = !!model.get('limitlessMax'); var limitlessMin = !!model.get('limitlessMin'); @@ -276,15 +274,13 @@ export default Input.extend({ } } - if (!limitlessMax && !isUndefined(max) && max !== '') - val = val > max ? max : val; - if (!limitlessMin && !isUndefined(min) && min !== '') - val = val < min ? min : val; + if (!limitlessMax && !isUndefined(max) && max !== '') val = val > max ? max : val; + if (!limitlessMin && !isUndefined(min) && min !== '') val = val < min ? min : val; return { force, value: val, - unit + unit, }; }, @@ -292,11 +288,7 @@ export default Input.extend({ Input.prototype.render.call(this); this.unitEl = null; const unit = this.getUnitEl(); - unit && - this.$el - .find(`.${this.ppfx}field-units`) - .get(0) - .appendChild(unit); + unit && this.$el.find(`.${this.ppfx}field-units`).get(0).appendChild(unit); return this; - } + }, }); diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 52a16b016..f44b9988a 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -123,12 +123,12 @@ export default class Property extends Model { } upValue(value, opts) { - const parsed = value === null || value === '' ? this.__getClearProps() : this.__parseValue(value); + const parsed = value === null || value === '' ? this.__getClearProps() : this.__parseValue(value, opts); return this._up(parsed, opts); } - __parseValue(value) { - return this.parseValue(value); + __parseValue(value, opts) { + return this.parseValue(value, opts); } __getClearProps() { diff --git a/src/style_manager/model/PropertyInteger.js b/src/style_manager/model/PropertyInteger.js index 887186856..223a69801 100644 --- a/src/style_manager/model/PropertyInteger.js +++ b/src/style_manager/model/PropertyInteger.js @@ -19,7 +19,7 @@ export default Property.extend({ min: '', // Maximum value - max: '' + max: '', }, /** @@ -66,14 +66,15 @@ export default Property.extend({ __getClearProps() { return { ...Property.prototype.__getClearProps(), - unit: '' + unit: '', }; }, - parseValue(val) { + parseValue(val, opts = {}) { const parsed = Property.prototype.parseValue.apply(this, arguments); const { value, unit } = this.input.validateInputValue(parsed.value, { - deepCheck: 1 + deepCheck: 1, + ...opts, }); parsed.value = value; parsed.unit = unit; @@ -87,5 +88,5 @@ export default Property.extend({ unit = !isUndefined(unit) && value ? unit : ''; value = `${value}${unit}`; return Property.prototype.getFullValue.apply(this, [value]); - } + }, }); From 21be13652f91dcea8f13f1206ed43aa1d9e5e7b6 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 14 Dec 2021 16:36:38 +0100 Subject: [PATCH 115/313] Trigger only the custom event for layer change --- src/style_manager/index.js | 6 +++++- src/style_manager/model/PropertyStack.js | 8 +------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 21372cf0e..98d311b10 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -109,7 +109,11 @@ export default () => { this.__upProps(); this.__trgCustom(); }); - this.model.listenTo(em, `styleable:change ${evLayerSelect}`, upProps); + this.model.listenTo(em, 'styleable:change', upProps); + + // Triggers only custom event + const trgCustom = debounce(() => this.__trgCustom()); + this.model.listenTo(em, evLayerSelect, trgCustom); return this; }, diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 0cefc13fd..8b09efb2e 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -32,9 +32,6 @@ export default Property.extend({ // Layer preview preview: 0, - // Parse single layer value string - parseLayer: null, - // Custom layer label function layerLabel: null, @@ -59,8 +56,6 @@ export default Property.extend({ if (opts.__up || !layer) return; const name = prop.getName(); layer.upValues({ [name]: prop.__getFullValue() }); - // const value = this.__getFullValue(); - // this.upValue(value, opts); this.__upTargetsStyleProps(opts); }, @@ -90,8 +85,7 @@ export default Property.extend({ // Update properties by layer value values && this.getProperties().forEach(prop => { - const name = prop.getName(); - const value = values[name]; + const value = values[prop.getId()]; !isUndefined(value) && prop.upValue(value, { ...opts, __up: true }); }); From 9b560f56398e4ae2b157e7dafad0f0d605b29c7f Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 15 Dec 2021 14:49:04 +0100 Subject: [PATCH 116/313] Update layerLabel --- src/style_manager/model/PropertyStack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 8b09efb2e..93c6c9292 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -254,7 +254,7 @@ export default Property.extend({ const index = layer.getIndex(); if (layerLabel) { - result = layerLabel(layer, { index, values }); + result = layerLabel(layer, { index, values, property: this }); } else { const parts = []; this.getProperties().map(prop => { From a5fc79b4afb4aff8dfa8ff140ebd53e182c8c9d6 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 15 Dec 2021 15:19:29 +0100 Subject: [PATCH 117/313] Parse number with custom units --- src/domain_abstract/ui/InputNumber.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/domain_abstract/ui/InputNumber.js b/src/domain_abstract/ui/InputNumber.js index 4492d8991..b3a7a8c91 100644 --- a/src/domain_abstract/ui/InputNumber.js +++ b/src/domain_abstract/ui/InputNumber.js @@ -245,7 +245,7 @@ export default Input.extend({ var model = this.model; const defValue = ''; //model.get('defaults'); var val = !isUndefined(value) ? value : defValue; - var units = model.get('units') || []; + var units = opts.units || model.get('units') || []; var unit = model.get('unit') || (units.length && units[0]) || ''; var max = !isUndefined(opts.max) ? opts.max : model.get('max'); var min = !isUndefined(opts.min) ? opts.min : model.get('min'); From f16db52120477c51af2bad4314a97b671bc3d9ef Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 16 Dec 2021 15:47:13 +0100 Subject: [PATCH 118/313] Add __getPropsFromStyle to composite type --- src/style_manager/index.js | 2 + src/style_manager/model/PropertyComposite.js | 63 +++++++++++++- src/style_manager/model/PropertyStack.js | 69 +++++++--------- test/specs/style_manager/model/Properties.js | 86 +++++++++++++++++++- 4 files changed, 171 insertions(+), 49 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 98d311b10..72b62bc63 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -594,7 +594,9 @@ export default () => { const value = style[name]; const hasVal = propDef(value); const isStack = prop.getType() === 'stack'; + const isComposite = prop.getType() === 'composite'; let newLayers = isStack ? prop.__getLayersFromStyle(style) : []; + // let newProps = isComposite ? prop.__getPropsFromStyle(style) : {}; let newValue = hasVal ? value : null; let parentTarget = null; diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 4cb1cd6fd..adc08f30b 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -1,4 +1,4 @@ -import { isString } from 'underscore'; +import { isString, isUndefined } from 'underscore'; import Property from './Property'; export default Property.extend({ @@ -92,17 +92,19 @@ export default Property.extend({ return isString(join) ? join : this.get('separator'); }, + // TODO remove __getFromStyle(style = {}) { let result = {}; const fromStyle = this.get('fromStyle'); + const sep = this.getSplitSeparator(); + const name = this.getName(); if (fromStyle) { - result = fromStyle(style); + result = fromStyle(style, { property: this, separator: sep }); } else { - const name = this.getName(); const value = style[name]; if (value) { - const values = value.split(this.getSplitSeparator()); + const values = value.split(sep); this.getProperties().forEach((prop, i) => { const len = values.length; // Try to get value from a shorthand: @@ -123,6 +125,59 @@ export default Property.extend({ return result; }, + __styleHasProps(style = {}) { + const name = this.getName(); + const props = this.getProperties(); + const nameProps = props.map(prop => prop.getName()); + const allNameProps = [name, ...nameProps]; + return allNameProps.some(prop => !isUndefined(style[prop]) && style[prop] !== ''); + }, + + __splitStyleName(style, name, sep) { + return (style[name] || '') + .split(sep) + .map(value => value.trim()) + .filter(Boolean); + }, + + __getPropsFromStyle(style = {}) { + if (!this.__styleHasProps(style)) return null; + + const props = this.getProperties(); + const sep = this.getSplitSeparator(); + const fromStyle = this.get('fromStyle'); + let result = fromStyle ? fromStyle(style, { property: this, separator: sep }) : {}; + + if (!fromStyle) { + const props4Nums = props.length === 4 && props.every(prop => prop.getType() === 'integer'); + + // Get props from the main property + const values = this.__splitStyleName(style, this.getName(), sep); + props.forEach((prop, i) => { + const value = values[i]; + let res = !isUndefined(value) ? value : prop.getDefaultValue(); + + if (props4Nums) { + // Try to get value from a shorthand: + // 11px -> 11px 11px 11px 11xp + // 11px 22px -> 11px 22px 11px 22xp + const len = values.length; + res = values[i] || values[(i % len) + (len != 1 && len % 2 ? 1 : 0)] || res; + } + + result[prop.getId()] = res || ''; + }); + + // Get props from the inner properties + props.forEach(prop => { + const value = style[prop.getName()]; + if (!isUndefined(value) && value !== '') result[prop.getId()] = value; + }); + } + + return result; + }, + clear() { this.getProperties().map(p => p.clear({ __clearIn: !this.isDetached() })); return Property.prototype.clear.call(this); diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 93c6c9292..fd8236984 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -7,13 +7,6 @@ import { camelCase } from 'utils/mixins'; const VALUES_REG = /,(?![^\(]*\))/; const PARTS_REG = /\s(?![^(]*\))/; -const splitStyleName = (style, name, sep) => { - return (style[name] || '') - .split(sep) - .map(value => value.trim()) - .filter(Boolean); -}; - export default Property.extend({ defaults: { ...Property.prototype.defaults, @@ -141,45 +134,39 @@ export default Property.extend({ }, __getLayersFromStyle(style = {}) { + if (!this.__styleHasProps(style)) return null; + const name = this.getName(); const props = this.getProperties(); - const nameProps = props.map(prop => prop.getName()); - const allNameProps = [name, ...nameProps]; - const hasProps = allNameProps.some(prop => !isUndefined(style[prop]) && style[prop] !== ''); - - if (!hasProps) { - return null; - } else { - const sep = this.getLayerSeparator(); - const fromStyle = this.get('fromStyle'); - let result = fromStyle ? fromStyle(style, { property: this, separatorLayers: sep }) : []; - - if (!fromStyle) { - // Get layers from the main property - const layers = splitStyleName(style, name, sep) - .map(value => value.split(this.getSplitSeparator())) - .map(parts => { - const result = {}; - props.forEach((prop, i) => { - const value = parts[i]; - result[prop.getId()] = !isUndefined(value) ? value : prop.getDefaultValue(); - }); - return result; + const sep = this.getLayerSeparator(); + const fromStyle = this.get('fromStyle'); + let result = fromStyle ? fromStyle(style, { property: this, separatorLayers: sep }) : []; + + if (!fromStyle) { + // Get layers from the main property + const layers = this.__splitStyleName(style, name, sep) + .map(value => value.split(this.getSplitSeparator())) + .map(parts => { + const result = {}; + props.forEach((prop, i) => { + const value = parts[i]; + result[prop.getId()] = !isUndefined(value) ? value : prop.getDefaultValue(); }); - // Get layers from the inner properties - props.forEach(prop => { - const id = prop.getId(); - splitStyleName(style, prop.getName(), sep) - .map(value => ({ [id]: value || prop.getDefaultValue() })) - .forEach((inLayer, i) => { - layers[i] = layers[i] ? { ...layers[i], ...inLayer } : inLayer; - }); + return result; }); - result = layers; - } - - return isArray(result) ? result : [result]; + // Get layers from the inner properties + props.forEach(prop => { + const id = prop.getId(); + this.__splitStyleName(style, prop.getName(), sep) + .map(value => ({ [id]: value || prop.getDefaultValue() })) + .forEach((inLayer, i) => { + layers[i] = layers[i] ? { ...layers[i], ...inLayer } : inLayer; + }); + }); + result = layers; } + + return isArray(result) ? result : [result]; }, hasValue(opts) { diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index e798cfed5..b29a2c2c9 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -34,7 +34,10 @@ describe('StyleManager properties logic', () => { describe('Composite type', () => { const propTest = 'padding'; - const propInTest = 'padding-top'; + const propATest = `${propTest}-top`; + const propBTest = `${propTest}-right`; + const propCTest = `${propTest}-bottom`; + const propDTest = `${propTest}-left`; let compTypeProp; let compTypePropInn; @@ -49,7 +52,7 @@ describe('StyleManager properties logic', () => { ], }); compTypeProp = obj.getProperty(sectorTest, propTest); - compTypePropInn = compTypeProp.getProperty(propInTest); + compTypePropInn = compTypeProp.getProperty(propATest); em.setSelected(cmp); obj.__upSel(); }); @@ -72,11 +75,86 @@ describe('StyleManager properties logic', () => { expect(obj.getLastSelected()).toBe(rule1); }); + test('Properties correctly reflect on rule update', () => { + compTypeProp.set('detached', false); + rule1.setStyle({ padding: '1px 2px 3px 4px' }); + obj.__upSel(); + [ + [propATest, '1px'], + [propBTest, '2px'], + [propCTest, '3px'], + [propDTest, '4px'], + ].forEach(item => { + expect(compTypeProp.getProperty(item[0]).getFullValue()).toBe(item[1]); + }); + }); + + test('getPropsFromStyle returns correct values', () => { + expect( + compTypeProp.__getPropsFromStyle({ + [propTest]: '1px 2px 3px 4px', + [propCTest]: '33px', + [propBTest]: '22%', + }) + ).toEqual({ + [propATest]: '1px', + [propBTest]: '22%', + [propCTest]: '33px', + [propDTest]: '4px', + }); + + // Split correctly props in 4 numeric values + expect( + compTypeProp.__getPropsFromStyle({ + [propTest]: '111px', + [propCTest]: '33px', + [propBTest]: '22%', + }) + ).toEqual({ + [propATest]: '111px', + [propBTest]: '22%', + [propCTest]: '33px', + [propDTest]: '111px', + }); + + // Resolves correctly with values from inner properties + expect( + compTypeProp.__getPropsFromStyle({ + color: 'red', + [propCTest]: '33px', + }) + ).toEqual({ + [propATest]: '0', + [propBTest]: '0', + [propCTest]: '33px', + [propDTest]: '0', + }); + + // null if no properties are found + expect(compTypeProp.__getPropsFromStyle({ color: 'red' })).toEqual(null); + }); + + test('Update on properties reflects to the rule correctly', () => { + compTypeProp.set('detached', false); + rule1.setStyle({ padding: '1px 2px 3px 4px' }); + obj.__upSel(); + compTypeProp.getProperty(propCTest).upValue('50%'); + obj.__upSel(); + expect(rule1.getStyle()).toEqual({ + __p: false, + padding: '1px 2px 50% 4px', + [propATest]: '', + [propBTest]: '', + [propCTest]: '', + [propDTest]: '', + }); + }); + test('Updating inner property, it reflects on the rule', () => { compTypePropInn.upValue('55%'); const style = rule1.getStyle(); - const otherProps = Object.keys(style).filter(p => p.indexOf('padding') >= 0 && p !== propInTest); - expect(style[propInTest]).toBe('55%'); + const otherProps = Object.keys(style).filter(p => p.indexOf('padding') >= 0 && p !== propATest); + expect(style[propATest]).toBe('55%'); expect(compTypeProp.hasValue()).toBe(true); expect(compTypePropInn.hasValue()).toBe(true); otherProps.forEach(prop => { From 8179e8df734718631521fe052f93e945720e4f8f Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 16 Dec 2021 16:10:25 +0100 Subject: [PATCH 119/313] Refactor upProp --- src/style_manager/index.js | 25 +++++++++----------- src/style_manager/model/PropertyComposite.js | 7 ++++++ src/style_manager/model/PropertyStack.js | 6 ----- test/specs/style_manager/model/Properties.js | 18 ++++++++++++++ 4 files changed, 36 insertions(+), 20 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 72b62bc63..df9dfdd52 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -571,16 +571,6 @@ export default () => { sectors.map(sector => { sector.getProperties().map(prop => { this.__upProp(prop, style, parentStyles, opts); - const props = prop.getProperties?.(); - - if (props && prop.getType() !== 'stack') { - const newStyle = prop.__getFromStyle(style); - const newParentStyles = parentStyles.map(p => ({ - ...p, - style: prop.__getFromStyle(p.style), - })); - props.forEach(prop => this.__upProp(prop, newStyle, newParentStyles, opts)); - } }); }); }, @@ -596,17 +586,23 @@ export default () => { const isStack = prop.getType() === 'stack'; const isComposite = prop.getType() === 'composite'; let newLayers = isStack ? prop.__getLayersFromStyle(style) : []; - // let newProps = isComposite ? prop.__getPropsFromStyle(style) : {}; + let newProps = isComposite ? prop.__getPropsFromStyle(style) : {}; let newValue = hasVal ? value : null; let parentTarget = null; - if (isStack && newLayers === null) { - const parentItem = parentStyles.filter(p => prop.__getLayersFromStyle(p.style) !== null)[0]; + if ((isStack && newLayers === null) || (isComposite && newProps === null)) { + const method = isStack ? '__getLayersFromStyle' : '__getPropsFromStyle'; + const parentItem = parentStyles.filter(p => prop[method](p.style) !== null)[0]; if (parentItem) { newValue = parentItem.style[name]; parentTarget = parentItem.target; - newLayers = prop.__getLayersFromStyle(parentItem.style); + const val = prop[method](parentItem.style); + if (isStack) { + newLayers = val; + } else { + newProps = val; + } } } else if (!hasVal) { newValue = null; @@ -621,6 +617,7 @@ export default () => { prop.__setParentTarget(parentTarget); prop.__getFullValue() !== newValue && prop.upValue(newValue, { ...opts, __up: true }); isStack && prop.__setLayers(newLayers || []); + isComposite && prop.__setProperties(newProps || {}); }, destroy() { diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index adc08f30b..d635033c3 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -178,6 +178,13 @@ export default Property.extend({ return result; }, + __setProperties(values = {}, opts = {}) { + this.getProperties().forEach(prop => { + const value = values[prop.getId()]; + !isUndefined(value) && prop.upValue(value, { ...opts, __up: true }); + }); + }, + clear() { this.getProperties().map(p => p.clear({ __clearIn: !this.isDetached() })); return Property.prototype.clear.call(this); diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index fd8236984..803af5944 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -127,12 +127,6 @@ export default Property.extend({ }, {}); }, - __getFromStyle(style = {}) { - const fromStyle = this.get('fromStyle'); - - return fromStyle ? fromStyle(style) : style; - }, - __getLayersFromStyle(style = {}) { if (!this.__styleHasProps(style)) return null; diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index b29a2c2c9..96e929732 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -134,6 +134,24 @@ describe('StyleManager properties logic', () => { expect(compTypeProp.__getPropsFromStyle({ color: 'red' })).toEqual(null); }); + test('Custom fromStyle', () => { + compTypeProp.set('fromStyle', (style, { separator }) => { + const values = style[propTest].split(separator); + return { + [propATest]: values[0], + [propBTest]: values[1], + }; + }); + expect( + compTypeProp.__getPropsFromStyle({ + [propTest]: 'rgba(valueA 1) rgba(value B)', + }) + ).toEqual({ + [propATest]: 'rgba(valueA 1)', + [propBTest]: 'rgba(value B)', + }); + }); + test('Update on properties reflects to the rule correctly', () => { compTypeProp.set('detached', false); rule1.setStyle({ padding: '1px 2px 3px 4px' }); From 114d987453e4e3e2c60a9893810b012a3f8697d7 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 16 Dec 2021 16:39:08 +0100 Subject: [PATCH 120/313] Add getStyleFromProps to Composite type --- src/style_manager/model/PropertyComposite.js | 83 ++++++++++---------- test/specs/style_manager/model/Properties.js | 20 +++++ 2 files changed, 63 insertions(+), 40 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index d635033c3..f98e61172 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -76,53 +76,56 @@ export default Property.extend({ return Property.prototype.__upTargetsStyle.call(this, newStyle, opts); }, - __getFullValue(opts = {}) { - if (this.isDetached() || opts.__clear) { - return ''; - } - - return this.getProperties() - .map(p => p.__getFullValue({ withDefault: 1 })) - .filter(Boolean) - .join(this.__getJoin()); - }, - - __getJoin() { - const join = this.get('join'); - return isString(join) ? join : this.get('separator'); - }, - - // TODO remove - __getFromStyle(style = {}) { - let result = {}; - const fromStyle = this.get('fromStyle'); - const sep = this.getSplitSeparator(); + /** + * Get style object from current properties + * @returns {Object} Style object + */ + getStyleFromProps(opts = {}) { const name = this.getName(); + const join = this.__getJoin(); + const toStyle = this.get('toStyle'); + let values = this.getValues(); + let style = {}; - if (fromStyle) { - result = fromStyle(style, { property: this, separator: sep }); + if (toStyle) { + style = toStyle(values, { join, name, property: this }); } else { - const value = style[name]; - if (value) { - const values = value.split(sep); - this.getProperties().forEach((prop, i) => { - const len = values.length; - // Try to get value from a shorthand: - // 11px -> 11px 11px 11px 11xp - // 11px 22px -> 11px 22px 11px 22xp - const value = values[i] || values[(i % len) + (len != 1 && len % 2 ? 1 : 0)]; - result[prop.getId()] = value || ''; - }); - result = { - ...result, - ...style, - }; + values = this.getValues({ byName: true }); + + if (this.isDetached()) { + style = { [name]: '', ...values }; } else { - result = style; + const value = this.getProperties() + .map(p => p.__getFullValue({ withDefault: 1 })) + .filter(Boolean) + .join(join); + style = { + [name]: value, + ...Object.keys(values).reduce((acc, prop) => { + acc[prop] = ''; + return acc; + }, {}), + }; } } - return result; + return opts.camelCase + ? Object.keys(style).reduce((res, key) => { + res[camelCase(key)] = style[key]; + return res; + }, {}) + : style; + }, + + __getFullValue(opts = {}) { + if (this.isDetached() || opts.__clear) return ''; + + return this.getStyleFromProps()[this.getName()] || ''; + }, + + __getJoin() { + const join = this.get('join'); + return isString(join) ? join : this.get('separator'); }, __styleHasProps(style = {}) { diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 96e929732..90aba02a9 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -152,6 +152,26 @@ describe('StyleManager properties logic', () => { }); }); + test('getStyleFromProps', () => { + rule1.setStyle({ padding: '1px 2px 3px 4px' }); + obj.__upSel(); + expect(compTypeProp.getStyleFromProps()).toEqual({ + [propTest]: '', + [propATest]: '1px', + [propBTest]: '2px', + [propCTest]: '3px', + [propDTest]: '4px', + }); + compTypeProp.set('detached', false); + expect(compTypeProp.getStyleFromProps()).toEqual({ + [propTest]: '1px 2px 3px 4px', + [propATest]: '', + [propBTest]: '', + [propCTest]: '', + [propDTest]: '', + }); + }); + test('Update on properties reflects to the rule correctly', () => { compTypeProp.set('detached', false); rule1.setStyle({ padding: '1px 2px 3px 4px' }); From 0721e83320a0ab7e60be8df7cd9914c6b078588d Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 16 Dec 2021 16:49:09 +0100 Subject: [PATCH 121/313] Update compTypeProp.getStyleFromProps --- src/style_manager/model/PropertyComposite.js | 23 +++++++++++++------- test/specs/style_manager/model/Properties.js | 18 +++++++++++++++ 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index f98e61172..17079be48 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -93,22 +93,29 @@ export default Property.extend({ values = this.getValues({ byName: true }); if (this.isDetached()) { - style = { [name]: '', ...values }; + style = values; } else { const value = this.getProperties() .map(p => p.__getFullValue({ withDefault: 1 })) .filter(Boolean) .join(join); - style = { - [name]: value, - ...Object.keys(values).reduce((acc, prop) => { - acc[prop] = ''; - return acc; - }, {}), - }; + style = { [name]: value }; } } + if (this.isDetached()) { + style[name] = ''; + } else { + style[name] = style[name] || ''; + style = { + ...style, + ...this.getProperties().reduce((acc, prop) => { + acc[prop.getName()] = ''; + return acc; + }, {}), + }; + } + return opts.camelCase ? Object.keys(style).reduce((res, key) => { res[camelCase(key)] = style[key]; diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 90aba02a9..a89b7d0c1 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -172,6 +172,24 @@ describe('StyleManager properties logic', () => { }); }); + test('getStyleFromProps with custom toStyle', () => { + rule1.setStyle({ padding: '1px 2px 3px 4px' }); + obj.__upSel(); + compTypeProp.set('toStyle', values => { + return { + [propTest]: `rgba(${values[propATest]}, ${values[propBTest]}, ${values[propDTest]})`, + }; + }); + compTypeProp.set('detached', false); + expect(compTypeProp.getStyleFromProps()).toEqual({ + [propTest]: 'rgba(1px, 2px, 4px)', + [propATest]: '', + [propBTest]: '', + [propCTest]: '', + [propDTest]: '', + }); + }); + test('Update on properties reflects to the rule correctly', () => { compTypeProp.set('detached', false); rule1.setStyle({ padding: '1px 2px 3px 4px' }); From 6997fd0c4790a2b7a94f32b96da81eaf69a9401a Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 16 Dec 2021 17:34:59 +0100 Subject: [PATCH 122/313] Update Composite props --- src/style_manager/model/PropertyComposite.js | 64 +++++++++++--------- test/specs/style_manager/model/Properties.js | 18 +++++- 2 files changed, 50 insertions(+), 32 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 17079be48..23fc4ce87 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -43,38 +43,44 @@ export default Property.extend({ __upProperties(prop, opts = {}) { if (!this.__hasCustom() || opts.__up || opts.__clearIn) return; - if (this.isDetached()) { - const style = this.getProperties().reduce((acc, prop) => { - acc[prop.getName()] = prop.hasValue({ noParent: true }) ? prop.__getFullValue() : ''; - return acc; - }, {}); - this.__upTargetsStyle({ ...style, [prop.getName()]: prop.__getFullValue() }, opts); - } else { - const { __clear, ...rest } = opts; - this.upValue(this.__getFullValue(), rest); - } + // if (this.isDetached()) { + // const style = this.getProperties().reduce((acc, prop) => { + // acc[prop.getName()] = prop.hasValue({ noParent: true }) ? prop.__getFullValue() : ''; + // return acc; + // }, {}); + // this.__upTargetsStyle({ ...style, [prop.getName()]: prop.__getFullValue() }, opts); + // } else { + // const { __clear, ...rest } = opts; + // this.upValue(this.__getFullValue(), rest); + // } + + this.__upTargetsStyleProps(opts); }, - __upTargetsStyle(style, opts = {}) { - const toStyle = this.get('toStyle'); - const { __clear } = opts; - let newStyle = style; + __upTargetsStyleProps(opts = {}) { + this.__upTargetsStyle(this.getStyleFromProps(), opts); + }, - if (toStyle && !__clear) { - const values = this.getValues(); - newStyle = toStyle(values, { ...opts, style }); - } + // __upTargetsStyle(style, opts = {}) { + // const toStyle = this.get('toStyle'); + // const { __clear } = opts; + // let newStyle = style; - if (this.isDetached()) { - newStyle[this.getName()] = ''; - } else { - this.getProperties().map(prop => { - newStyle[prop.getName()] = ''; - }); - } + // if (toStyle && !__clear) { + // const values = this.getValues(); + // newStyle = toStyle(values, { ...opts, style }); + // } - return Property.prototype.__upTargetsStyle.call(this, newStyle, opts); - }, + // if (this.isDetached()) { + // newStyle[this.getName()] = ''; + // } else { + // this.getProperties().map(prop => { + // newStyle[prop.getName()] = ''; + // }); + // } + + // return Property.prototype.__upTargetsStyle.call(this, newStyle, opts); + // }, /** * Get style object from current properties @@ -165,7 +171,7 @@ export default Property.extend({ const values = this.__splitStyleName(style, this.getName(), sep); props.forEach((prop, i) => { const value = values[i]; - let res = !isUndefined(value) ? value : prop.getDefaultValue(); + let res = !isUndefined(value) ? value : ''; // : prop.getDefaultValue(); if (props4Nums) { // Try to get value from a shorthand: @@ -213,7 +219,7 @@ export default Property.extend({ getValues({ byName } = {}) { return this.getProperties().reduce((res, prop) => { const key = byName ? prop.getName() : prop.getId(); - res[key] = `${prop.__getFullValue({ withDefault: 1 })}`; + res[key] = `${prop.__getFullValue()}`; return res; }, {}); }, diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index a89b7d0c1..0d643adbe 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -124,10 +124,10 @@ describe('StyleManager properties logic', () => { [propCTest]: '33px', }) ).toEqual({ - [propATest]: '0', - [propBTest]: '0', + [propATest]: '', + [propBTest]: '', [propCTest]: '33px', - [propDTest]: '0', + [propDTest]: '', }); // null if no properties are found @@ -162,6 +162,7 @@ describe('StyleManager properties logic', () => { [propCTest]: '3px', [propDTest]: '4px', }); + compTypeProp.set('detached', false); expect(compTypeProp.getStyleFromProps()).toEqual({ [propTest]: '1px 2px 3px 4px', @@ -170,6 +171,17 @@ describe('StyleManager properties logic', () => { [propCTest]: '', [propDTest]: '', }); + + compTypeProp.set('detached', true); + rule1.setStyle({ [propATest]: '10px', [propBTest]: '20px' }); + obj.__upSel(); + expect(compTypeProp.getStyleFromProps()).toEqual({ + [propTest]: '', + [propATest]: '10px', + [propBTest]: '20px', + [propCTest]: '', + [propDTest]: '', + }); }); test('getStyleFromProps with custom toStyle', () => { From ff7569a89330e650de3155494b0845d26996848e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 16 Dec 2021 17:54:29 +0100 Subject: [PATCH 123/313] Test more composite type --- src/style_manager/index.js | 5 ++- src/style_manager/model/PropertyStack.js | 4 -- test/specs/style_manager/model/Properties.js | 47 ++++++++++++++++++++ 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index df9dfdd52..233e37dc8 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -617,7 +617,10 @@ export default () => { prop.__setParentTarget(parentTarget); prop.__getFullValue() !== newValue && prop.upValue(newValue, { ...opts, __up: true }); isStack && prop.__setLayers(newLayers || []); - isComposite && prop.__setProperties(newProps || {}); + if (isComposite) { + prop.__setProperties(newProps || {}); + prop.getProperties().map(pr => pr.__setParentTarget(parentTarget)); + } }, destroy() { diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 803af5944..a12397492 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -163,10 +163,6 @@ export default Property.extend({ return isArray(result) ? result : [result]; }, - hasValue(opts) { - return PropertyBase.prototype.hasValue.call(this, opts); - }, - /** * Add new layer to the stack * @param {Object} [props={}] Layer props diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 0d643adbe..bd31414bf 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -184,6 +184,53 @@ describe('StyleManager properties logic', () => { }); }); + test('On clear removes all values', () => { + rule1.setStyle({ padding: '1px 2px 3px 4px' }); + obj.__upSel(); + expect(compTypeProp.hasValue()).toBe(true); + + compTypeProp.clear(); + expect(compTypeProp.hasValue()).toBe(false); + expect(rule1.getStyle()).toEqual({ + __p: false, + [propTest]: '', + [propATest]: '', + [propBTest]: '', + [propCTest]: '', + [propDTest]: '', + }); + }); + + test('Get the values from parent style', () => { + rule1.setStyle({ + padding: '11px 22px', + 'padding-left': '44px', + }); + const rule2 = cssc.addRules(` + @media (max-width: 992px) { + .cls { color: red; } + } + `)[0]; + dv.select('tablet'); + obj.__upSel(); + expect(obj.getLastSelected()).toBe(rule2); + expect(obj.getSelectedParents()).toEqual([rule1]); + + expect(compTypeProp.hasValue()).toBe(true); + expect(compTypeProp.hasValue({ noParent: true })).toBe(false); + [ + [propATest, '11px'], + [propBTest, '22px'], + [propCTest, '11px'], + [propDTest, '44px'], + ].forEach(item => { + const prop = compTypeProp.getProperty(item[0]); + expect(prop.hasValue()).toBe(true); + expect(prop.hasValue({ noParent: true })).toBe(false); + expect(prop.getFullValue()).toBe(item[1]); + }); + }); + test('getStyleFromProps with custom toStyle', () => { rule1.setStyle({ padding: '1px 2px 3px 4px' }); obj.__upSel(); From 863aea431306b3d6ff23acc076d824019497c92e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 16 Dec 2021 17:55:33 +0100 Subject: [PATCH 124/313] Clear composite --- src/style_manager/model/PropertyComposite.js | 35 +------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 23fc4ce87..2974aa7f1 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -40,20 +40,8 @@ export default Property.extend({ Property.callInit(this, props, opts); }, - __upProperties(prop, opts = {}) { + __upProperties(p, opts = {}) { if (!this.__hasCustom() || opts.__up || opts.__clearIn) return; - - // if (this.isDetached()) { - // const style = this.getProperties().reduce((acc, prop) => { - // acc[prop.getName()] = prop.hasValue({ noParent: true }) ? prop.__getFullValue() : ''; - // return acc; - // }, {}); - // this.__upTargetsStyle({ ...style, [prop.getName()]: prop.__getFullValue() }, opts); - // } else { - // const { __clear, ...rest } = opts; - // this.upValue(this.__getFullValue(), rest); - // } - this.__upTargetsStyleProps(opts); }, @@ -61,27 +49,6 @@ export default Property.extend({ this.__upTargetsStyle(this.getStyleFromProps(), opts); }, - // __upTargetsStyle(style, opts = {}) { - // const toStyle = this.get('toStyle'); - // const { __clear } = opts; - // let newStyle = style; - - // if (toStyle && !__clear) { - // const values = this.getValues(); - // newStyle = toStyle(values, { ...opts, style }); - // } - - // if (this.isDetached()) { - // newStyle[this.getName()] = ''; - // } else { - // this.getProperties().map(prop => { - // newStyle[prop.getName()] = ''; - // }); - // } - - // return Property.prototype.__upTargetsStyle.call(this, newStyle, opts); - // }, - /** * Get style object from current properties * @returns {Object} Style object From 4ba723c3de96e87d625950d725c9172f1a0be023 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 17 Dec 2021 13:28:39 +0100 Subject: [PATCH 125/313] Fix undo in composite types --- src/style_manager/index.js | 5 +++-- src/style_manager/model/PropertyComposite.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 233e37dc8..6681434ea 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -585,6 +585,7 @@ export default () => { const hasVal = propDef(value); const isStack = prop.getType() === 'stack'; const isComposite = prop.getType() === 'composite'; + const opt = { ...opts, __up: true }; let newLayers = isStack ? prop.__getLayersFromStyle(style) : []; let newProps = isComposite ? prop.__getPropsFromStyle(style) : {}; let newValue = hasVal ? value : null; @@ -615,10 +616,10 @@ export default () => { } prop.__setParentTarget(parentTarget); - prop.__getFullValue() !== newValue && prop.upValue(newValue, { ...opts, __up: true }); + prop.__getFullValue() !== newValue && prop.upValue(newValue, opt); isStack && prop.__setLayers(newLayers || []); if (isComposite) { - prop.__setProperties(newProps || {}); + prop.__setProperties(newProps || {}, opt); prop.getProperties().map(pr => pr.__setParentTarget(parentTarget)); } }, diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 2974aa7f1..6cf271056 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -164,7 +164,7 @@ export default Property.extend({ __setProperties(values = {}, opts = {}) { this.getProperties().forEach(prop => { const value = values[prop.getId()]; - !isUndefined(value) && prop.upValue(value, { ...opts, __up: true }); + !isUndefined(value) && prop.__getFullValue() !== value && prop.upValue(value, opts); }); }, From 0f85416587f2ab5b60333d10df89173606ef24e4 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 17 Dec 2021 17:13:20 +0100 Subject: [PATCH 126/313] Improve getProperties in Sector --- src/style_manager/model/Sector.js | 35 ++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/src/style_manager/model/Sector.js b/src/style_manager/model/Sector.js index bf7d51e27..4d5b27741 100644 --- a/src/style_manager/model/Sector.js +++ b/src/style_manager/model/Sector.js @@ -20,7 +20,7 @@ export default class Sector extends Model { open: true, buildProps: '', extendBuilded: 1, - properties: [] + properties: [], }; } @@ -89,17 +89,32 @@ export default class Sector extends Model { /** * Get sector properties. + * @param {Object} [opts={}] Options + * @param {Boolean} [opts.withValue=false] Get only properties with value + * @param {Boolean} [opts.withParentValue=false] Get only properties with parent value * @returns {Array<[Property]>} */ - getProperties() { + getProperties(opts = {}) { const props = this.get('properties'); - return props.models ? [...props.models] : props; + const res = props.models ? [...props.models] : props; + return res.filter(prop => { + let result = true; + + if (opts.withValue) { + result = prop.hasValue({ noParent: true }); + } + + if (opts.withParentValue) { + const hasVal = prop.hasValue({ noParent: true }); + result = !hasVal && prop.hasValue(); + } + + return result; + }); } getProperty(id) { - return ( - this.getProperties().filter(prop => prop.get('id') === id)[0] || null - ); + return this.getProperties().filter(prop => prop.get('id') === id)[0] || null; } /** @@ -126,11 +141,7 @@ export default class Sector extends Model { // Check for nested properties var mPProps = mProp.properties; if (mPProps && mPProps.length) { - mProp.properties = this.extendProperties( - prop.properties || [], - mPProps, - 1 - ); + mProp.properties = this.extendProperties(prop.properties || [], mPProps, 1); } props[j] = ext ? extend(prop, mProp) : mProp; isolated[j] = props[j]; @@ -153,7 +164,7 @@ export default class Sector extends Model { if (extend) { return { ...(this.buildProperties([extend])[0] || {}), - ...rest + ...rest, }; } else { return prop; From fccf521d1b59d3d8bd547dd6d32ab9bfd5305c44 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 17 Dec 2021 18:01:20 +0100 Subject: [PATCH 127/313] Fix __setProperties --- src/style_manager/model/PropertyComposite.js | 2 +- test/specs/style_manager/model/Properties.js | 39 ++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 6cf271056..450dfd23b 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -164,7 +164,7 @@ export default Property.extend({ __setProperties(values = {}, opts = {}) { this.getProperties().forEach(prop => { const value = values[prop.getId()]; - !isUndefined(value) && prop.__getFullValue() !== value && prop.upValue(value, opts); + prop.__getFullValue() !== value && prop.upValue(value, opts); }); }, diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index bd31414bf..2ed69d873 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -231,6 +231,45 @@ describe('StyleManager properties logic', () => { }); }); + test('Parent styles are ignored if on the lower device', () => { + const rule2 = cssc.addRules(` + @media (max-width: 992px) { + .cls { + padding: 11px 22px; + padding-left: 44px; + } + } + `)[0]; + dv.select('tablet'); + obj.__upSel(); + expect(obj.getLastSelected()).toBe(rule2); + expect(compTypeProp.hasValue({ noParent: true })).toBe(true); + [ + [propATest, '11px'], + [propBTest, '22px'], + [propCTest, '11px'], + [propDTest, '44px'], + ].forEach(item => { + const prop = compTypeProp.getProperty(item[0]); + expect(prop.getFullValue()).toBe(item[1]); + }); + + dv.select('desktop'); + obj.__upSel(); + expect(obj.getLastSelected()).toBe(rule1); + expect(obj.getSelectedParents()).toEqual([]); + [ + [propATest, ''], + [propBTest, ''], + [propCTest, ''], + [propDTest, ''], + ].forEach(item => { + const prop = compTypeProp.getProperty(item[0]); + expect(prop.hasValue()).toBe(false); + expect(prop.getFullValue()).toBe(item[1]); + }); + }); + test('getStyleFromProps with custom toStyle', () => { rule1.setStyle({ padding: '1px 2px 3px 4px' }); obj.__upSel(); From 6e19ff36078e667e2436b1a377bb26861f7b4f2f Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 18 Dec 2021 12:48:55 +0100 Subject: [PATCH 128/313] Fix update composite detached rules --- src/style_manager/index.js | 16 ++++++- src/style_manager/model/PropertyComposite.js | 13 ++++-- test/specs/style_manager/model/Properties.js | 46 ++++++++++++++++++++ 3 files changed, 70 insertions(+), 5 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 6681434ea..9225d34d8 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -619,8 +619,20 @@ export default () => { prop.__getFullValue() !== newValue && prop.upValue(newValue, opt); isStack && prop.__setLayers(newLayers || []); if (isComposite) { - prop.__setProperties(newProps || {}, opt); - prop.getProperties().map(pr => pr.__setParentTarget(parentTarget)); + const props = prop.getProperties(); + + // Detached has to be treathed as separate properties + if (prop.isDetached()) { + const newStyle = prop.__getPropsFromStyle(style) || {}; + const newParentStyles = parentStyles.map(p => ({ + ...p, + style: prop.__getPropsFromStyle(p.style) || {}, + })); + props.map(pr => this.__upProp(pr, newStyle, newParentStyles, opts)); + } else { + prop.__setProperties(newProps || {}, opt); + prop.getProperties().map(pr => pr.__setParentTarget(parentTarget)); + } } }, diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 450dfd23b..939075b0a 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -42,11 +42,18 @@ export default Property.extend({ __upProperties(p, opts = {}) { if (!this.__hasCustom() || opts.__up || opts.__clearIn) return; - this.__upTargetsStyleProps(opts); + this.__upTargetsStyleProps(p, opts); }, - __upTargetsStyleProps(opts = {}) { - this.__upTargetsStyle(this.getStyleFromProps(), opts); + __upTargetsStyleProps(prop, opts = {}) { + let style = this.getStyleFromProps(); + + if (this.isDetached()) { + const name = prop.getName(); + style = { [name]: style[name] }; + } + + this.__upTargetsStyle(style, opts); }, /** diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 2ed69d873..4d357e8f8 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -270,6 +270,52 @@ describe('StyleManager properties logic', () => { }); }); + test("Changing one inner rule (detached property) doesn't affect others", () => { + rule1.setStyle({ + padding: '1px 2px', + 'padding-left': '4px', + }); + const rule2 = cssc.addRules(` + @media (max-width: 992px) { + .cls { padding-left: 44px } + } + `)[0]; + dv.select('tablet'); + obj.__upSel(); + [ + [propATest, '1px'], + [propBTest, '2px'], + [propCTest, '1px'], + ].forEach(item => { + const prop = compTypeProp.getProperty(item[0]); + expect(prop.hasValue({ noParent: true })).toBe(false); + expect(prop.getFullValue()).toBe(item[1]); + }); + + const propD = compTypeProp.getProperty(propDTest); + expect(propD.hasValue({ noParent: true })).toBe(true); + expect(propD.getFullValue()).toBe('44px'); + + // By editing the last one, the rule should not take other values + propD.upValue('45px'); + compTypeProp.getProperty(propATest).upValue('11px'); + obj.__upSel(); + expect(rule2.getStyle()).toEqual({ + __p: false, + [propATest]: '11px', + [propDTest]: '45px', + }); + // Other properties shouldn't change + [ + [propBTest, '2px'], + [propCTest, '1px'], + ].forEach(item => { + const prop = compTypeProp.getProperty(item[0]); + expect(prop.hasValue({ noParent: true })).toBe(false); + expect(prop.getFullValue()).toBe(item[1]); + }); + }); + test('getStyleFromProps with custom toStyle', () => { rule1.setStyle({ padding: '1px 2px 3px 4px' }); obj.__upSel(); From c20744443dd3c6f2a29a77839eb994decde5adfb Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 20 Dec 2021 17:51:45 +0100 Subject: [PATCH 129/313] Fix clear on detached stack properties --- src/style_manager/model/PropertyStack.js | 9 +++++++-- test/specs/style_manager/model/Properties.js | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index a12397492..f67f96d2d 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -275,7 +275,7 @@ export default Property.extend({ const value = isUndefined(val) ? prop.getDefaultValue() : val; return { name, value }; }); - style = this.get('detached') + style = this.isDetached() ? result.reduce((acc, item) => { acc[item.name] = item.value; return acc; @@ -301,6 +301,7 @@ export default Property.extend({ let result = {}; const name = this.getName(); const layers = this.getLayers(); + const props = this.getProperties(); const styles = layers.map(l => this.getStyleFromLayer(l)); styles.forEach(style => { keys(style).map(key => { @@ -314,8 +315,12 @@ export default Property.extend({ if (this.isDetached()) { result[name] = ''; + !layers.length && + props.map(prop => { + result[prop.getName()] = ''; + }); } else { - const style = this.getProperties().reduce((acc, prop) => { + const style = props.reduce((acc, prop) => { acc[prop.getName()] = ''; return acc; }, {}); diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 4d357e8f8..698f10132 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -585,6 +585,20 @@ describe('StyleManager properties logic', () => { }); }); + test('On clear removes all values (detached)', () => { + compTypeProp.set('detached', true); + compTypeProp.clear(); + expect(compTypeProp.hasValue()).toBe(false); + expect(compTypeProp.getLayers().length).toBe(0); + expect(rule1.getStyle()).toEqual({ + __p: false, + [propTest]: '', + [propATest]: '', + [propBTest]: '', + [propCTest]: '', + }); + }); + test('Get the values from parent style', () => { const rule2 = cssc.addRules(` @media (max-width: 992px) { From df71b9c6bd625364aced0d42c4aad7cc779d11ae Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 20 Dec 2021 18:00:11 +0100 Subject: [PATCH 130/313] Fix _up in detached stack props --- src/style_manager/model/PropertyStack.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index f67f96d2d..e7442a570 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -87,7 +87,8 @@ export default Property.extend({ _up(props, opts = {}) { const { __layers = [], ...rest } = props; - this.__setLayers(__layers); + // Detached props will update their layers later in sm.__upProp + !this.isDetached() && this.__setLayers(__layers); this.__upSelected({ noEvent: true }, opts); return Property.prototype._up.call(this, rest, opts); }, From 5e74e22c5638ee3b92ede99a172efddc815eeb3e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 21 Dec 2021 13:22:05 +0100 Subject: [PATCH 131/313] Update _up in composite type --- src/style_manager/model/PropertyComposite.js | 57 +++++++++++++------- src/style_manager/model/PropertyStack.js | 2 +- test/specs/style_manager/model/Properties.js | 52 ++++++++++++++++++ 3 files changed, 91 insertions(+), 20 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 939075b0a..549840106 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -56,6 +56,13 @@ export default Property.extend({ this.__upTargetsStyle(style, opts); }, + _up(props, opts = {}) { + if (this.isDetached() && props.value) { + this.__setProperties(this.__getSplitValue(props.value), opts); + } + return Property.prototype._up.call(this, props, opts); + }, + /** * Get style object from current properties * @returns {Object} Style object @@ -123,13 +130,41 @@ export default Property.extend({ return allNameProps.some(prop => !isUndefined(style[prop]) && style[prop] !== ''); }, - __splitStyleName(style, name, sep) { - return (style[name] || '') + __splitValue(value, sep) { + return value .split(sep) .map(value => value.trim()) .filter(Boolean); }, + __splitStyleName(style, name, sep) { + return this.__splitValue(style[name] || '', sep); + }, + + __getSplitValue(value = '') { + const props = this.getProperties(); + const props4Nums = props.length === 4 && props.every(prop => prop.getType() === 'integer'); + const values = this.__splitValue(value, this.getSplitSeparator()); + const result = {}; + + props.forEach((prop, i) => { + const value = values[i]; + let res = !isUndefined(value) ? value : ''; // : prop.getDefaultValue(); + + if (props4Nums) { + // Try to get value from a shorthand: + // 11px -> 11px 11px 11px 11xp + // 11px 22px -> 11px 22px 11px 22xp + const len = values.length; + res = values[i] || values[(i % len) + (len != 1 && len % 2 ? 1 : 0)] || res; + } + + result[prop.getId()] = res || ''; + }); + + return result; + }, + __getPropsFromStyle(style = {}) { if (!this.__styleHasProps(style)) return null; @@ -139,24 +174,8 @@ export default Property.extend({ let result = fromStyle ? fromStyle(style, { property: this, separator: sep }) : {}; if (!fromStyle) { - const props4Nums = props.length === 4 && props.every(prop => prop.getType() === 'integer'); - // Get props from the main property - const values = this.__splitStyleName(style, this.getName(), sep); - props.forEach((prop, i) => { - const value = values[i]; - let res = !isUndefined(value) ? value : ''; // : prop.getDefaultValue(); - - if (props4Nums) { - // Try to get value from a shorthand: - // 11px -> 11px 11px 11px 11xp - // 11px 22px -> 11px 22px 11px 22xp - const len = values.length; - res = values[i] || values[(i % len) + (len != 1 && len % 2 ? 1 : 0)] || res; - } - - result[prop.getId()] = res || ''; - }); + result = this.__getSplitValue(style[this.getName()] || ''); // Get props from the inner properties props.forEach(prop => { diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index e7442a570..0b976e989 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -90,7 +90,7 @@ export default Property.extend({ // Detached props will update their layers later in sm.__upProp !this.isDetached() && this.__setLayers(__layers); this.__upSelected({ noEvent: true }, opts); - return Property.prototype._up.call(this, rest, opts); + return PropertyBase.prototype._up.call(this, rest, opts); }, __setLayers(newLayers = []) { diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 698f10132..ac3959bab 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -89,6 +89,58 @@ describe('StyleManager properties logic', () => { }); }); + test('Split value properly', () => { + expect(compTypeProp.__getSplitValue('1px 2px 3px 4px')).toEqual({ + [propATest]: '1px', + [propBTest]: '2px', + [propCTest]: '3px', + [propDTest]: '4px', + }); + expect(compTypeProp.__getSplitValue('1px 2px')).toEqual({ + [propATest]: '1px', + [propBTest]: '2px', + [propCTest]: '1px', + [propDTest]: '2px', + }); + expect(compTypeProp.__getSplitValue('100%')).toEqual({ + [propATest]: '100%', + [propBTest]: '100%', + [propCTest]: '100%', + [propDTest]: '100%', + }); + }); + + test('Updating the main property, the value is splitted properly', () => { + compTypeProp.upValue('1px 2px 3px 4px'); + [ + [propATest, '1px'], + [propBTest, '2px'], + [propCTest, '3px'], + [propDTest, '4px'], + ].forEach(item => { + expect(compTypeProp.getProperty(item[0]).getFullValue()).toBe(item[1]); + }); + compTypeProp.upValue('11px'); + [ + [propATest, '11px'], + [propBTest, '11px'], + [propCTest, '11px'], + [propDTest, '11px'], + ].forEach(item => { + expect(compTypeProp.getProperty(item[0]).getFullValue()).toBe(item[1]); + }); + obj.__upSel(); + expect(rule1.getStyle()).toEqual({ + __p: false, + color: 'red', + [propTest]: '', + [propATest]: '11px', + [propBTest]: '11px', + [propCTest]: '11px', + [propDTest]: '11px', + }); + }); + test('getPropsFromStyle returns correct values', () => { expect( compTypeProp.__getPropsFromStyle({ From f190fbe4f976f8870cba2e6a3497a961340eca35 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 21 Dec 2021 13:32:53 +0100 Subject: [PATCH 132/313] Split properties in composite --- src/style_manager/model/PropertyComposite.js | 4 +--- test/specs/style_manager/model/Properties.js | 9 +++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 549840106..0db7c3dbf 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -57,9 +57,7 @@ export default Property.extend({ }, _up(props, opts = {}) { - if (this.isDetached() && props.value) { - this.__setProperties(this.__getSplitValue(props.value), opts); - } + this.__setProperties(this.__getSplitValue(props.value), opts); return Property.prototype._up.call(this, props, opts); }, diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index ac3959bab..dc0e66933 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -139,6 +139,15 @@ describe('StyleManager properties logic', () => { [propCTest]: '11px', [propDTest]: '11px', }); + compTypeProp.upValue(''); + [ + [propATest, ''], + [propBTest, ''], + [propCTest, ''], + [propDTest, ''], + ].forEach(item => { + expect(compTypeProp.getProperty(item[0]).getFullValue()).toBe(item[1]); + }); }); test('getPropsFromStyle returns correct values', () => { From 5110a0c4c667d37b29ffcb91bfd6c2a17f3b0d41 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 21 Dec 2021 14:13:35 +0100 Subject: [PATCH 133/313] Don't update main prop on change of composite --- src/style_manager/index.js | 3 ++- test/specs/style_manager/model/Properties.js | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 9225d34d8..41f4bc9ec 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -586,6 +586,7 @@ export default () => { const isStack = prop.getType() === 'stack'; const isComposite = prop.getType() === 'composite'; const opt = { ...opts, __up: true }; + const canUpdate = !isComposite; let newLayers = isStack ? prop.__getLayersFromStyle(style) : []; let newProps = isComposite ? prop.__getPropsFromStyle(style) : {}; let newValue = hasVal ? value : null; @@ -616,7 +617,7 @@ export default () => { } prop.__setParentTarget(parentTarget); - prop.__getFullValue() !== newValue && prop.upValue(newValue, opt); + canUpdate && prop.__getFullValue() !== newValue && prop.upValue(newValue, opt); isStack && prop.__setLayers(newLayers || []); if (isComposite) { const props = prop.getProperties(); diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index dc0e66933..625353b6c 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -395,6 +395,21 @@ describe('StyleManager properties logic', () => { }); }); + test('Update on the rule reflects to the property correctly', () => { + rule1.setStyle({ padding: '1px 2px 3px 4px' }); + obj.__upSel(); + compTypeProp.getProperty(propCTest).upValue('50%'); + [ + [propATest, '1px'], + [propBTest, '2px'], + [propCTest, '50%'], + [propDTest, '4px'], + ].forEach(item => { + const prop = compTypeProp.getProperty(item[0]); + expect(prop.getFullValue()).toBe(item[1]); + }); + }); + test('Update on properties reflects to the rule correctly', () => { compTypeProp.set('detached', false); rule1.setStyle({ padding: '1px 2px 3px 4px' }); From fd468ce132a13b99d4100747cbc49b8dd36699e4 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 21 Dec 2021 14:17:28 +0100 Subject: [PATCH 134/313] Up test --- test/specs/style_manager/model/Properties.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 625353b6c..56039cb2f 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -624,6 +624,21 @@ describe('StyleManager properties logic', () => { }); }); + test('Updating inner property (detached), it reflects on the rule', () => { + compTypeProp.set('detached', true); + compTypeProp.selectLayerAt(0); + compTypeProp.getProperty(propBTest).upValue('valueB-1-mod'); + compTypeProp.selectLayerAt(1); + compTypeProp.getProperty(propCTest).upValue('valueC-2-mod'); + expect(rule1.getStyle()).toEqual({ + __p: false, + [propTest]: '', + [propATest]: 'valueA-1, valueA-2', + [propBTest]: 'valueB-1-mod, valueB-2', + [propCTest]: 'valueC-1-ext, valueC-2-mod', + }); + }); + test('Removing layer, updates the rule', () => { compTypeProp.removeLayerAt(1); expect(rule1.getStyle()).toEqual({ From 6b0d5a5a63bb2fdd53644298c0b494e1365e3ead Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 21 Dec 2021 14:37:40 +0100 Subject: [PATCH 135/313] Add getStyle property --- src/style_manager/model/Property.js | 8 ++++++++ src/style_manager/model/PropertyComposite.js | 4 ++++ src/style_manager/model/PropertyStack.js | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index f44b9988a..be6545f59 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -122,6 +122,14 @@ export default class Property extends Model { this._up(this.__getClearProps(), { ...opts, __clear: true }); } + /** + * Get CSS style object of the propeprty + * @return {Object} + */ + getStyle(opts = {}) { + return { [this.getName()]: this.__getFullValue(opts) }; + } + upValue(value, opts) { const parsed = value === null || value === '' ? this.__getClearProps() : this.__parseValue(value, opts); return this._up(parsed, opts); diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 0db7c3dbf..fe568aad9 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -61,6 +61,10 @@ export default Property.extend({ return Property.prototype._up.call(this, props, opts); }, + getStyle(opts) { + return this.getStyleFromProps(opts); + }, + /** * Get style object from current properties * @returns {Object} Style object diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 0b976e989..50150f8ef 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -254,6 +254,10 @@ export default Property.extend({ return layer && layer.getIndex() >= 0 ? layer : null; }, + getStyle(opts) { + return this.getStyleFromLayers(opts); + }, + /** * Get style object from layer * @param {[Layer]} layer From b0033b4e1f8f2adc6582a081d01dbf4fca77dc6c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 21 Dec 2021 14:53:45 +0100 Subject: [PATCH 136/313] Propagate nested composite types --- src/style_manager/model/PropertyComposite.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index fe568aad9..b08a4d542 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -42,13 +42,17 @@ export default Property.extend({ __upProperties(p, opts = {}) { if (!this.__hasCustom() || opts.__up || opts.__clearIn) return; - this.__upTargetsStyleProps(p, opts); + + const parentProp = this.__getParentProp(); + if (parentProp) return parentProp.__upProperties(this, opts); + + this.__upTargetsStyleProps(opts, p); }, - __upTargetsStyleProps(prop, opts = {}) { + __upTargetsStyleProps(opts = {}, prop) { let style = this.getStyleFromProps(); - if (this.isDetached()) { + if (this.isDetached() && prop) { const name = prop.getName(); style = { [name]: style[name] }; } From 42321604d58c0c9917507683f2bdb2a3b0b83245 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 21 Dec 2021 17:05:00 +0100 Subject: [PATCH 137/313] Up stack --- src/style_manager/model/PropertyStack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 50150f8ef..d33dfbbc5 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -272,7 +272,7 @@ export default Property.extend({ let style; if (toStyle) { - style = toStyle(values, { join, joinLayers, name, property: this }); + style = toStyle(values, { join, joinLayers, name, layer, property: this }); } else { const result = this.getProperties().map(prop => { const name = prop.getName(); From 54f302072b4ab7505839a63e308e10b92a23f9ab Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 21 Dec 2021 18:41:30 +0100 Subject: [PATCH 138/313] Improve check for layer visibility. Fixes #4010 --- src/navigator/view/ItemView.js | 45 +++++++++++++++------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/src/navigator/view/ItemView.js b/src/navigator/view/ItemView.js index 167c2ae0b..aef9c3368 100644 --- a/src/navigator/view/ItemView.js +++ b/src/navigator/view/ItemView.js @@ -7,6 +7,9 @@ import { eventDrag } from 'dom_components/model/Component'; const inputProp = 'contentEditable'; const styleOpts = { mediaText: '' }; const $ = Backbone.$; +const isStyleHidden = (style = {}) => { + return (style.display || '').trim().indexOf('none') === 0; +}; let ItemsView; export default Backbone.View.extend({ @@ -20,7 +23,7 @@ export default Backbone.View.extend({ 'mouseout [data-toggle-select]': 'handleHoverOut', 'dblclick [data-name]': 'handleEdit', 'keydown [data-name]': 'handleEditKey', - 'focusout [data-name]': 'handleEditEnd' + 'focusout [data-name]': 'handleEditEnd', }, template(model) { @@ -86,8 +89,8 @@ export default Backbone.View.extend({ ['change:open', this.updateOpening], ['change:layerable', this.updateLayerable], ['change:style:display', this.updateVisibility], - ['rerender:layer', this.render] - ].forEach(item => this.listenTo(model, item[0], item[1])); + ['rerender:layer', this.render], + ].forEach((item) => this.listenTo(model, item[0], item[1])); this.className = `${pfx}layer ${pfx}layer__t-${type} no-select ${ppfx}two-color`; this.inputNameCls = `${ppfx}layer-name`; this.clsTitleC = `${pfx}layer-title-c`; @@ -105,7 +108,7 @@ export default Backbone.View.extend({ onInit.bind(this)({ component: model, render: this.__render, - listenTo: this.listenTo + listenTo: this.listenTo, }); }, @@ -122,7 +125,7 @@ export default Backbone.View.extend({ const model = this.model; const hClass = `${pfx}layer-hidden`; const hideIcon = 'fa-eye-slash'; - const hidden = model.getStyle(styleOpts).display === 'none'; + const hidden = isStyleHidden(model.getStyle(styleOpts)); const method = hidden ? 'addClass' : 'removeClass'; this.$el[method](hClass); this.getVisibilityEl()[method](hideIcon); @@ -141,7 +144,7 @@ export default Backbone.View.extend({ const prevDisplay = model.get(prevDspKey); const style = model.getStyle(styleOpts); const { display } = style; - const hidden = display == 'none'; + const hidden = isStyleHidden(style); if (hidden) { delete style.display; @@ -170,10 +173,7 @@ export default Backbone.View.extend({ inputEl.focus(); document.execCommand('selectAll', false, null); em && em.setEditing(1); - $el - .find(`.${this.inputNameCls}`) - .removeClass(clsNoEdit) - .addClass(clsEdit); + $el.find(`.${this.inputNameCls}`).removeClass(clsNoEdit).addClass(clsEdit); }, handleEditKey(ev) { @@ -193,10 +193,7 @@ export default Backbone.View.extend({ inputEl[inputProp] = false; this.setName(name, { component: this.model, propName: 'custom-name' }); em && em.setEditing(0); - $el - .find(`.${this.inputNameCls}`) - .addClass(clsNoEdit) - .removeClass(clsEdit); + $el.find(`.${this.inputNameCls}`).addClass(clsNoEdit).removeClass(clsEdit); }, setName(name, { propName }) { @@ -260,7 +257,7 @@ export default Backbone.View.extend({ if (em) { em.setSelected(model, { fromLayers: 1, event: e }); const scroll = config.scrollCanvas; - scroll && model.views.forEach(view => view.scrollIntoView(scroll)); + scroll && model.views.forEach((view) => view.scrollIntoView(scroll)); } }, @@ -290,8 +287,8 @@ export default Backbone.View.extend({ if (e.button && e.button !== 0) return; if (sorter) { - sorter.onStart = data => em.trigger(`${eventDrag}:start`, data); - sorter.onMoveClb = data => em.trigger(eventDrag, data); + sorter.onStart = (data) => em.trigger(`${eventDrag}:start`, data); + sorter.onMoveClb = (data) => em.trigger(eventDrag, data); sorter.startSort(e.target); } }, @@ -321,8 +318,8 @@ export default Backbone.View.extend({ ComponentView.prototype.updateStatus.apply(this, [ { avoidHover: !this.config.highlightHover, - noExtHl: 1 - } + noExtHl: 1, + }, ]); }, @@ -332,9 +329,7 @@ export default Backbone.View.extend({ * @return boolean * */ isVisible() { - const { display } = this.model.getStyle(); - - return !(display && display === 'none'); + return !isStyleHidden(this.model.getStyle()); }, /** @@ -368,7 +363,7 @@ export default Backbone.View.extend({ */ countChildren(model) { var count = 0; - model.get('components').each(function(m) { + model.get('components').each(function (m) { var isCountable = this.opt.isCountable; var hide = this.config.hideTextnode; if (isCountable && !isCountable(m, hide)) return; @@ -436,7 +431,7 @@ export default Backbone.View.extend({ opened: this.opt.opened, parentView: this, parent: model, - level + level, }); const children = this.items.render().$el; @@ -468,5 +463,5 @@ export default Backbone.View.extend({ const opt = { component: model, el }; onRender.bind(this)(opt); this.em.trigger('layer:render', opt); - } + }, }); From bfcabcc97697f44cf7c9bec3b9864e744e370a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Wed, 22 Dec 2021 10:09:07 +0000 Subject: [PATCH 139/313] Update _gjs_devices.scss As reported in https://github.com/artf/grapesjs/issues/4026 --- src/styles/scss/_gjs_devices.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/scss/_gjs_devices.scss b/src/styles/scss/_gjs_devices.scss index 27a438c89..1e31c64dd 100644 --- a/src/styles/scss/_gjs_devices.scss +++ b/src/styles/scss/_gjs_devices.scss @@ -1,7 +1,7 @@ .#{$app-prefix}devices-c { display: flex; align-items: center; - padding: 3px; + padding: padding: 2px 3px 3px 3px; .#{$app-prefix}device-label { flex-grow: 2; From 8da6f62edb0f246612c8aeddd64e338abb7e5088 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 22 Dec 2021 16:40:05 +0100 Subject: [PATCH 140/313] Update radio --- src/style_manager/model/PropertyRadio.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/style_manager/model/PropertyRadio.js b/src/style_manager/model/PropertyRadio.js index d3fe7886d..1b3721b36 100644 --- a/src/style_manager/model/PropertyRadio.js +++ b/src/style_manager/model/PropertyRadio.js @@ -23,9 +23,9 @@ export default class PropertyRadio extends Property { * Get current selected option. * @returns {Object | null} */ - getOption() { - const id = this.getValue(); - return this.getOptions().filter(o => this.getOptionId(o) === id)[0] || null; + getOption(id) { + const idSel = id || this.getValue(); + return this.getOptions().filter(o => this.getOptionId(o) === idSel)[0] || null; } /** From b7556b6f5b6a75d54c68fa9185ef41232a215431 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 22 Dec 2021 18:45:52 +0100 Subject: [PATCH 141/313] More tests --- test/specs/style_manager/model/Properties.js | 39 ++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/test/specs/style_manager/model/Properties.js b/test/specs/style_manager/model/Properties.js index 56039cb2f..3127bea42 100644 --- a/test/specs/style_manager/model/Properties.js +++ b/test/specs/style_manager/model/Properties.js @@ -723,5 +723,44 @@ describe('StyleManager properties logic', () => { [propCTest]: '', }); }); + + test('Adding new layer, updates the rule (detached)', () => { + compTypeProp.set('detached', true); + compTypeProp.addLayer( + { + [propATest]: 'valueA-new AA', + [propBTest]: 'valueB-new BB', + [propCTest]: 'valueC-new CC', + }, + { at: 0 } + ); + obj.__upSel(); + expect(rule1.getStyle()).toEqual({ + __p: false, + [propTest]: '', + [propATest]: 'valueA-new AA, valueA-1, valueA-2', + [propBTest]: 'valueB-new BB, valueB-1, valueB-2', + [propCTest]: 'valueC-new CC, valueC-1-ext, valueC-2-ext', + }); + // Check also the layers + const layers = compTypeProp.getLayers().models; + expect(layers.length).toBe(3); + const [layer1, layer2, layer3] = layers; + expect(layer1.getValues()).toEqual({ + [propATest]: 'valueA-new AA', + [propBTest]: 'valueB-new BB', + [propCTest]: 'valueC-new CC', + }); + expect(layer2.getValues()).toEqual({ + [propATest]: 'valueA-1', + [propBTest]: 'valueB-1', + [propCTest]: 'valueC-1-ext', + }); + expect(layer3.getValues()).toEqual({ + [propATest]: 'valueA-2', + [propBTest]: 'valueB-2', + [propCTest]: 'valueC-2-ext', + }); + }); }); }); From c8df0bb18880cc767353345a61646d3f44921a10 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 13:35:23 +0100 Subject: [PATCH 142/313] Update and add Property doc --- docs/.vuepress/config.js | 1 + docs/api.js | 1 + docs/api/component.md | 48 +++++++++-- docs/api/css_rule.md | 41 +++++++++- docs/api/property.md | 122 ++++++++++++++++++++++++++++ docs/api/sector.md | 7 ++ src/style_manager/index.js | 1 + src/style_manager/model/Property.js | 77 ++++++++++++------ 8 files changed, 265 insertions(+), 33 deletions(-) create mode 100644 docs/api/property.md diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 9efef9b3c..7435821a5 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -73,6 +73,7 @@ module.exports = { ['/api/page', `${subDivider}Page`], ['/api/style_manager', 'Style Manager'], ['/api/sector', `${subDivider}Sector`], + ['/api/property', `${subDivider}Property`], ['/api/storage_manager', 'Storage Manager'], ['/api/device_manager', 'Device Manager'], ['/api/device', `${subDivider}Device`], diff --git a/docs/api.js b/docs/api.js index 988498f4b..797bdabe6 100644 --- a/docs/api.js +++ b/docs/api.js @@ -22,6 +22,7 @@ async function generateDocs () { ['panels/index.js', 'panels.md'], ['style_manager/index.js', 'style_manager.md'], ['style_manager/model/Sector.js', 'sector.md'], + ['style_manager/model/Property.js', 'property.md'], ['storage_manager/index.js', 'storage_manager.md'], ['device_manager/index.js', 'device_manager.md'], ['device_manager/model/Device.js', 'device.md'], diff --git a/docs/api/component.md b/docs/api/component.md index 89efdf8d5..1c8e1df6b 100644 --- a/docs/api/component.md +++ b/docs/api/component.md @@ -28,10 +28,10 @@ component.get('tagName'); * `attributes` **[Object][2]?** Key-value object of the component's attributes, eg. `{ title: 'Hello' }` Default: `{}` * `name` **[String][1]?** Name of the component. Will be used, for example, in Layers and badges * `removable` **[Boolean][3]?** When `true` the component is removable from the canvas, default: `true` -* `draggable` **([Boolean][3] | [String][1])?** Indicates if it's possible to drag the component inside others. +* `draggable` **([Boolean][3] | [String][1] | [Function][4])?** Indicates if it's possible to drag the component inside others. You can also specify a query string to indentify elements, eg. `'.some-class[title=Hello], [data-gjs-type=column]'` means you can drag the component only inside elements - containing `some-class` class and `Hello` title, and `column` components. Default: `true` + containing `some-class` class and `Hello` title, and `column` components. In the case of a function, target and destination components are passed as arguments, return a Boolean to indicate if the drag is possible. Default: `true` * `droppable` **([Boolean][3] | [String][1] | [Function][4])?** Indicates if it's possible to drop other components inside. You can use a query string as with `draggable`. In the case of a function, target and destination components are passed as arguments, return a Boolean to indicate if the drop is possible. Default: `true` * `badgable` **[Boolean][3]?** Set to false if you don't want to see the badge (with the name) over the component. Default: `true` @@ -485,9 +485,41 @@ component.parent(); Returns **([Component][9] | null)** +### getTraits + +Get traits. + +#### Examples + +```javascript +const traits = component.getTraits(); +console.log(traits); +// [Trait, Trait, Trait, ...] +``` + +Returns **[Array][5]\** + +### setTraits + +Replace current collection of traits with a new one. + +#### Parameters + +* `traits` **[Array][5]<[Object][2]>** Array of trait definitions + +#### Examples + +```javascript +const traits = component.setTraits([{ type: 'checkbox', name: 'disabled'}, ...]); +console.log(traits); +// [Trait, ...] +``` + +Returns **[Array][5]\** + ### getTrait -Get the trait by id/name +Get the trait by id/name. #### Parameters @@ -500,11 +532,11 @@ const traitTitle = component.getTrait('title'); traitTitle && traitTitle.set('label', 'New label'); ``` -Returns **Trait** Trait model +Returns **(Trait | null)** Trait getModelToStyle ### updateTrait -Update a trait +Update a trait. #### Parameters @@ -555,11 +587,11 @@ component.removeTrait('title'); component.removeTrait(['title', 'id']); ``` -Returns **[Array][5]** Array of removed traits +Returns **[Array][5]\** Array of removed traits ### addTrait -Add trait/s by id/s. +Add new trait/s. #### Parameters @@ -577,7 +609,7 @@ component.addTrait({ component.addTrait(['title', {...}, ...]); ``` -Returns **[Array][5]** Array of added traits +Returns **[Array][5]\** Array of added traits ### getName diff --git a/docs/api/css_rule.md b/docs/api/css_rule.md index fcc791e43..fddfae028 100644 --- a/docs/api/css_rule.md +++ b/docs/api/css_rule.md @@ -14,7 +14,7 @@ * `singleAtRule` **[Boolean][4]?** This property is used only on at-rules, like 'page' or 'font-face', where the block containes only style declarations * `state` **[String][3]?** State of the rule, eg: `hover`, `focused` * `important` **([Boolean][4] | [Array][1]<[String][3]>)?** If true, sets `!important` on all properties. You can also pass an array to specify properties on which use important -* `stylable` **[Boolean][4]?** Indicates if the rule is stylable from the editor +* `stylable` **[Boolean][4]?** Indicates if the rule is stylable from the editor[Device]: device.html[State]: state.html[Component]: component.html ### getAtRule @@ -72,6 +72,45 @@ cssRule.getDeclaration() // ".class1{color:red;}" Returns **[String][3]** +### getDevice + +Get the Device the rule is related to. + +#### Examples + +```javascript +const device = rule.getDevice(); +console.log(device?.getName()); +``` + +Returns **([Device] | null)** + +### getState + +Get the State the rule is related to. + +#### Examples + +```javascript +const state = rule.getState(); +console.log(state?.getLabel()); +``` + +Returns **([State] | null)** + +### getComponent + +Returns the related Component (valid only for component-specific rules). + +#### Examples + +```javascript +const cmp = rule.getComponent(); +console.log(cmp?.toHTML()); +``` + +Returns **([Component] | null)** + ### toCSS Return the CSS string of the rule diff --git a/docs/api/property.md b/docs/api/property.md new file mode 100644 index 000000000..8ba102c93 --- /dev/null +++ b/docs/api/property.md @@ -0,0 +1,122 @@ + + +## Property + + + +### Properties + +* `id` **[String][1]** Property id, eg. `my-property-id`. +* `property` **[String][1]** Related CSS property name, eg. `text-align`. +* `label` **[String][1]** Label to use in UI, eg. `Text Align`. +* `default` **[String][1]** Defaul value of the property. + +### getId + +Get property id. + +Returns **[String][1]** + +### getType + +Get the property type. +The type of the property is defined on property creation and based on its value the proper Property class is assigned. +The default type is `base`. + +Returns **[String][1]** + +### getName + +Get name (the CSS property name). + +Returns **[String][1]** + +### getLabel + +Get property label. + +#### Parameters + +* `opts` **[Object][2]** Options (optional, default `{}`) + + * `opts.locale` **[Boolean][3]** Use the locale string from i18n module (optional, default `true`) + +Returns **[String][1]** + +### getValue + +Get property value. + +#### Parameters + +* `opts` **[Object][2]** Options (optional, default `{}`) + + * `opts.noDefault` **[Boolean][3]** Avoid returning the default value (optional, default `false`) + +Returns **[String][1]** + +### hasValue + +Check if the property has value. + +#### Parameters + +* `opts` **[Object][2]** Options (optional, default `{}`) + + * `opts.noParent` **[Boolean][3]** Ignore the value if it comes from the parent target. (optional, default `false`) + +Returns **[Boolean][3]** + +### getStyle + +Get the CSS style object of the property. + +#### Parameters + +* `opts` (optional, default `{}`) + +#### Examples + +```javascript +// In case the property is `color` with a value of `red`. +console.log(property.getStyle()); +// { color: 'red' }; +``` + +Returns **[Object][2]** + +### getDefaultValue + +Get the default value. + +Returns **[string][1]** + +### upValue + +Update the value. +The change is also propagated to the selected targets (eg. CSS rule). + +#### Parameters + +* `value` **[String][1]** New value +* `opts` **[Object][2]** Options (optional, default `{}`) + + * `opts.partial` **[Boolean][3]** If `true` the update on targets won't be considered complete (not stored in UndoManager) (optional, default `false`) + * `opts.noTarget` **[Boolean][3]** If `true` the change won't be propagated to selected targets. (optional, default `false`) + +### clear + +Clear the value. +The change is also propagated to the selected targets (eg. the css property is cleared). + +#### Parameters + +* `opts` **[Object][2]** Options (optional, default `{}`) + + * `opts.noTarget` **[Boolean][3]** If `true` the change won't be propagated to selected targets. (optional, default `false`) + +[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String + +[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean diff --git a/docs/api/sector.md b/docs/api/sector.md index 77069fc88..4d652fd7d 100644 --- a/docs/api/sector.md +++ b/docs/api/sector.md @@ -49,6 +49,13 @@ Update Sector open state Get sector properties. +#### Parameters + +* `opts` **[Object][4]** Options (optional, default `{}`) + + * `opts.withValue` **[Boolean][2]** Get only properties with value (optional, default `false`) + * `opts.withParentValue` **[Boolean][2]** Get only properties with parent value (optional, default `false`) + Returns **[Array][3]<[Property]>** [1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 41f4bc9ec..9bac0a58d 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -33,6 +33,7 @@ * [Sector]: sector.html * [CssRule]: css_rule.html * [Component]: component.html + * [Property]: property.html * * @module StyleManager */ diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index be6545f59..6ce06e0b2 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -2,11 +2,19 @@ import { Model } from 'common'; import { isUndefined, isString, result, keys } from 'underscore'; import { capitalize } from 'utils/mixins'; +/** + * @typedef Property + * @property {String} id Property id, eg. `my-property-id`. + * @property {String} property Related CSS property name, eg. `text-align`. + * @property {String} label Label to use in UI, eg. `Text Align`. + * @property {String} default Defaul value of the property. + * + */ export default class Property extends Model { initialize(props = {}, opts = {}) { this.em = opts.em; const id = this.get('id') || ''; - const name = this.get('name') || ''; + const name = this.get('name') || this.get('label') || ''; !this.get('property') && this.set('property', (name || id).replace(/ /g, '-')); const prop = this.get('property'); !this.get('id') && this.set('id', prop); @@ -64,7 +72,9 @@ export default class Property extends Model { } /** - * Get property type. + * Get the property type. + * The type of the property is defined on property creation and based on its value the proper Property class is assigned. + * The default type is `base`. * @returns {String} */ getType() { @@ -72,7 +82,7 @@ export default class Property extends Model { } /** - * Get property name (usually is the CSS property name). + * Get name (the CSS property name). * @returns {String} */ getName() { @@ -88,12 +98,14 @@ export default class Property extends Model { getLabel(opts = {}) { const { locale = true } = opts; const id = this.getId(); - const name = this.get('name'); + const name = this.get('name') || this.get('label'); return (locale && this.em?.t(`styleManager.properties.${id}`)) || name; } /** * Get property value. + * @param {Object} [opts={}] Options + * @param {Boolean} [opts.noDefault=false] Avoid returning the default value * @returns {String} */ getValue(opts = {}) { @@ -103,9 +115,9 @@ export default class Property extends Model { } /** - * Check if the property has value + * Check if the property has value. * @param {Object} [opts={}] Options - * @param {Boolean} [opts.noParent=false] Ignore the value if from parent target. + * @param {Boolean} [opts.noParent=false] Ignore the value if it comes from the parent target. * @returns {Boolean} */ hasValue(opts = {}) { @@ -116,25 +128,51 @@ export default class Property extends Model { } /** - * Clear value + * Get the CSS style object of the property. + * @return {Object} + * @example + * // In case the property is `color` with a value of `red`. + * console.log(property.getStyle()); + * // { color: 'red' }; */ - clear(opts = {}) { - this._up(this.__getClearProps(), { ...opts, __clear: true }); + getStyle(opts = {}) { + return { [this.getName()]: this.__getFullValue(opts) }; } /** - * Get CSS style object of the propeprty - * @return {Object} + * Get the default value. + * @return {string} */ - getStyle(opts = {}) { - return { [this.getName()]: this.__getFullValue(opts) }; + getDefaultValue() { + const def = this.get('default'); + return `${!isUndefined(def) ? def : this.get('defaults')}`; } - upValue(value, opts) { + /** + * Update the value. + * The change is also propagated to the selected targets (eg. CSS rule). + * @param {String} value New value + * @param {Object} [opts={}] Options + * @param {Boolean} [opts.partial=false] If `true` the update on targets won't be considered complete (not stored in UndoManager) + * @param {Boolean} [opts.noTarget=false] If `true` the change won't be propagated to selected targets. + */ + upValue(value, opts = {}) { + if (opts.noTarget) opts.__up = true; const parsed = value === null || value === '' ? this.__getClearProps() : this.__parseValue(value, opts); return this._up(parsed, opts); } + /** + * Clear the value. + * The change is also propagated to the selected targets (eg. the css property is cleared). + * @param {Object} [opts={}] Options + * @param {Boolean} [opts.noTarget=false] If `true` the change won't be propagated to selected targets. + */ + clear(opts = {}) { + if (opts.noTarget) opts.__up = true; + this._up(this.__getClearProps(), { ...opts, __clear: true }); + } + __parseValue(value, opts) { return this.parseValue(value, opts); } @@ -174,6 +212,7 @@ export default class Property extends Model { * @param {any} value * @param {Boolen} [complete=true] Indicates if it's a final state * @param {Object} [opts={}] Options + * @private */ setValueFromInput(value, complete, opts = {}) { this.setValue(value, complete, { ...opts, fromInput: 1 }); @@ -264,16 +303,6 @@ export default class Property extends Model { return res.map(i => i.trim()); } - /** - * Get the default value - * @return {string} - * @private - */ - getDefaultValue() { - const def = this.get('default'); - return `${!isUndefined(def) ? def : this.get('defaults')}`; - } - __getFullValue({ withDefault } = {}) { return !this.hasValue() && withDefault ? this.getDefaultValue() : this.getFullValue(); } From 31cdd01ee844be4b3d848d4cab8d52dcbf9795bd Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 13:47:09 +0100 Subject: [PATCH 143/313] Up sector doc --- docs/api/sector.md | 6 +++++- docs/api/style_manager.md | 2 ++ src/style_manager/model/Sector.js | 7 ++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/api/sector.md b/docs/api/sector.md index 4d652fd7d..7d4ca2f64 100644 --- a/docs/api/sector.md +++ b/docs/api/sector.md @@ -9,7 +9,7 @@ * `id` **[String][1]** Sector id, eg. `typography` * `name` **[String][1]** Sector name, eg. `Typography` * `open` **[Boolean][2]?** Indicates the open state. -* `properties` **[Array][3]<[Object][4]>?** Indicate an array of Property defintions[Property]: property.html +* `properties` **[Array][3]<[Object][4]>?** Indicate an array of Property defintions. ### getId @@ -58,6 +58,10 @@ Get sector properties. Returns **[Array][3]<[Property]>** +## + +[Property]: property.html + [1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String [2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean diff --git a/docs/api/style_manager.md b/docs/api/style_manager.md index 7589ddca0..0e6e1c9e4 100644 --- a/docs/api/style_manager.md +++ b/docs/api/style_manager.md @@ -40,6 +40,8 @@ const styleManager = editor.StyleManager; [Component]: component.html +[Property]: property.html + ## getConfig Get configuration object diff --git a/src/style_manager/model/Sector.js b/src/style_manager/model/Sector.js index 4d5b27741..faf75e996 100644 --- a/src/style_manager/model/Sector.js +++ b/src/style_manager/model/Sector.js @@ -8,9 +8,7 @@ import PropertyFactory from './PropertyFactory'; * @property {String} id Sector id, eg. `typography` * @property {String} name Sector name, eg. `Typography` * @property {Boolean} [open=true] Indicates the open state. - * @property {Array} [properties=[]] Indicate an array of Property defintions - * - * [Property]: property.html + * @property {Array} [properties=[]] Indicate an array of Property defintions. */ export default class Sector extends Model { defaults() { @@ -187,3 +185,6 @@ export default class Sector extends Model { return this.propFactory.build(buildP); } } +/** + * [Property]: property.html + */ From 774b6345d1ee2733238ff962ae38641fa67a5ff6 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 14:33:30 +0100 Subject: [PATCH 144/313] Refactor PropertyInteger --- src/style_manager/model/PropertyInteger.js | 48 +++++++++++----------- src/style_manager/model/PropertySlider.js | 6 +-- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/style_manager/model/PropertyInteger.js b/src/style_manager/model/PropertyInteger.js index 223a69801..9fd58ad7e 100644 --- a/src/style_manager/model/PropertyInteger.js +++ b/src/style_manager/model/PropertyInteger.js @@ -3,24 +3,26 @@ import Property from './Property'; import InputNumber from 'domain_abstract/ui/InputNumber'; import { hasWin } from 'utils/mixins'; -export default Property.extend({ - defaults: { - ...Property.prototype.defaults, - // Array of units, eg. ['px', '%'] - units: [], +export default class PropertyNumber extends Property { + defaults() { + return { + ...Property.getDefaults(), + // Array of units, eg. ['px', '%'] + units: [], - // Selected unit, eg. 'px' - unit: '', + // Selected unit, eg. 'px' + unit: '', - // Integer value steps - step: 1, + // Integer value steps + step: 1, - // Minimum value - min: '', + // Minimum value + min: '', - // Maximum value - max: '', - }, + // Maximum value + max: '', + }; + } /** * Get property units. @@ -28,7 +30,7 @@ export default Property.extend({ */ getUnits() { return this.get('units') || []; - }, + } /** * Get property unit value. @@ -36,7 +38,7 @@ export default Property.extend({ */ getUnit() { return this.get('unit'); - }, + } /** * Update property unit value. @@ -44,7 +46,7 @@ export default Property.extend({ */ upUnit(unit, opts) { return this._up({ unit }, opts); - }, + } initialize(props = {}, opts = {}) { Property.callParentInit(Property, this, props, opts); @@ -56,19 +58,19 @@ export default Property.extend({ this.set('unit', units[0], { silent: 1 }); } Property.callInit(this, props, opts); - }, + } clearValue(opts = {}) { this.set({ value: undefined, unit: undefined }, opts); return this; - }, + } __getClearProps() { return { ...Property.prototype.__getClearProps(), unit: '', }; - }, + } parseValue(val, opts = {}) { const parsed = Property.prototype.parseValue.apply(this, arguments); @@ -79,7 +81,7 @@ export default Property.extend({ parsed.value = value; parsed.unit = unit; return parsed; - }, + } getFullValue() { let value = this.get('value'); @@ -88,5 +90,5 @@ export default Property.extend({ unit = !isUndefined(unit) && value ? unit : ''; value = `${value}${unit}`; return Property.prototype.getFullValue.apply(this, [value]); - }, -}); + } +} diff --git a/src/style_manager/model/PropertySlider.js b/src/style_manager/model/PropertySlider.js index 2b34537fd..fc9359893 100644 --- a/src/style_manager/model/PropertySlider.js +++ b/src/style_manager/model/PropertySlider.js @@ -2,7 +2,7 @@ import Property from './PropertyInteger'; export default Property.extend({ defaults: { - ...Property.prototype.defaults, - showInput: 1 - } + ...Property.getDefaults(), + showInput: 1, + }, }); From 5a766884f24d1f15ac7b486189d27a8239f64a4a Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 14:46:00 +0100 Subject: [PATCH 145/313] Rename PropertyInteger > PropertyNumber --- src/style_manager/model/Properties.js | 30 +++++++++---------- .../{PropertyInteger.js => PropertyNumber.js} | 19 ++++++------ src/style_manager/model/PropertySlider.js | 2 +- src/style_manager/view/PropertyColorView.js | 10 +++---- ...tyIntegerView.js => PropertyNumberView.js} | 2 +- src/style_manager/view/PropertySliderView.js | 6 ++-- test/specs/style_manager/model/Models.js | 12 ++++---- .../style_manager/view/PropertyIntegerView.js | 26 ++++++++-------- 8 files changed, 53 insertions(+), 54 deletions(-) rename src/style_manager/model/{PropertyInteger.js => PropertyNumber.js} (89%) rename src/style_manager/view/{PropertyIntegerView.js => PropertyNumberView.js} (99%) diff --git a/src/style_manager/model/Properties.js b/src/style_manager/model/Properties.js index b2fbda89b..337791a66 100644 --- a/src/style_manager/model/Properties.js +++ b/src/style_manager/model/Properties.js @@ -13,8 +13,8 @@ import PropertyRadio from './PropertyRadio'; import PropertyRadioView from './../view/PropertyRadioView'; import PropertySlider from './PropertySlider'; import PropertySliderView from './../view/PropertySliderView'; -import PropertyInteger from './PropertyInteger'; -import PropertyIntegerView from './../view/PropertyIntegerView'; +import PropertyNumber from './PropertyNumber'; +import PropertyNumberView from './../view/PropertyNumberView'; import PropertyView from './../view/PropertyView'; export default Backbone.Collection.extend(TypeableCollection).extend({ @@ -29,7 +29,7 @@ export default Backbone.Collection.extend(TypeableCollection).extend({ if (value && value.type == 'stack') { return value; } - } + }, }, { id: 'composite', @@ -39,7 +39,7 @@ export default Backbone.Collection.extend(TypeableCollection).extend({ if (value && value.type == 'composite') { return value; } - } + }, }, { id: 'file', @@ -49,7 +49,7 @@ export default Backbone.Collection.extend(TypeableCollection).extend({ if (value && value.type == 'file') { return value; } - } + }, }, { id: 'color', @@ -59,7 +59,7 @@ export default Backbone.Collection.extend(TypeableCollection).extend({ if (value && value.type == 'color') { return value; } - } + }, }, { id: 'select', @@ -69,7 +69,7 @@ export default Backbone.Collection.extend(TypeableCollection).extend({ if (value && value.type == 'select') { return value; } - } + }, }, { id: 'radio', @@ -79,7 +79,7 @@ export default Backbone.Collection.extend(TypeableCollection).extend({ if (value && value.type == 'radio') { return value; } - } + }, }, { id: 'slider', @@ -89,17 +89,17 @@ export default Backbone.Collection.extend(TypeableCollection).extend({ if (value && value.type == 'slider') { return value; } - } + }, }, { id: 'integer', - model: PropertyInteger, - view: PropertyIntegerView, + model: PropertyNumber, + view: PropertyNumberView, isType(value) { if (value && value.type == 'integer') { return value; } - } + }, }, { id: 'base', @@ -108,8 +108,8 @@ export default Backbone.Collection.extend(TypeableCollection).extend({ isType(value) { value.type = 'base'; return value; - } - } + }, + }, ], deepClone() { @@ -145,5 +145,5 @@ export default Backbone.Collection.extend(TypeableCollection).extend({ let result = ''; this.each(model => (result += `${model.getFullValue()} `)); return result.trim(); - } + }, }); diff --git a/src/style_manager/model/PropertyInteger.js b/src/style_manager/model/PropertyNumber.js similarity index 89% rename from src/style_manager/model/PropertyInteger.js rename to src/style_manager/model/PropertyNumber.js index 9fd58ad7e..4ba4e0896 100644 --- a/src/style_manager/model/PropertyInteger.js +++ b/src/style_manager/model/PropertyNumber.js @@ -3,24 +3,23 @@ import Property from './Property'; import InputNumber from 'domain_abstract/ui/InputNumber'; import { hasWin } from 'utils/mixins'; +/** + * @typedef PropertyNumber + * @property {Array} units Array of units, eg. ['px', '%'] + * @property {Number} min Minimum value. + * @property {Number} max Maximum value. + * @property {Number} step Step value. + * + */ export default class PropertyNumber extends Property { defaults() { return { ...Property.getDefaults(), - // Array of units, eg. ['px', '%'] units: [], - - // Selected unit, eg. 'px' unit: '', - - // Integer value steps - step: 1, - - // Minimum value min: '', - - // Maximum value max: '', + step: 1, }; } diff --git a/src/style_manager/model/PropertySlider.js b/src/style_manager/model/PropertySlider.js index fc9359893..a6bfc6d54 100644 --- a/src/style_manager/model/PropertySlider.js +++ b/src/style_manager/model/PropertySlider.js @@ -1,4 +1,4 @@ -import Property from './PropertyInteger'; +import Property from './PropertyNumber'; export default Property.extend({ defaults: { diff --git a/src/style_manager/view/PropertyColorView.js b/src/style_manager/view/PropertyColorView.js index 98b4ffccc..45e20ff54 100644 --- a/src/style_manager/view/PropertyColorView.js +++ b/src/style_manager/view/PropertyColorView.js @@ -1,14 +1,14 @@ -import PropertyIntegerView from './PropertyIntegerView'; +import PropertyNumberView from './PropertyNumberView'; import InputColor from 'domain_abstract/ui/InputColor'; -export default PropertyIntegerView.extend({ +export default PropertyNumberView.extend({ setValue(value, opts = {}) { opts = { ...opts, silent: 1 }; this.inputInst.setValue(value, opts); }, remove() { - PropertyIntegerView.prototype.remove.apply(this, arguments); + PropertyNumberView.prototype.remove.apply(this, arguments); const inp = this.inputInst; inp && inp.remove && inp.remove(); ['inputInst', '$color'].forEach(i => (this[i] = {})); @@ -20,7 +20,7 @@ export default PropertyIntegerView.extend({ const inputColor = new InputColor({ target: this.target, model: this.model, - ppfx + ppfx, }); const input = inputColor.render(); this.el.querySelector(`.${ppfx}fields`).appendChild(input.el); @@ -29,5 +29,5 @@ export default PropertyIntegerView.extend({ this.input = this.$input.get(0); this.inputInst = input; } - } + }, }); diff --git a/src/style_manager/view/PropertyIntegerView.js b/src/style_manager/view/PropertyNumberView.js similarity index 99% rename from src/style_manager/view/PropertyIntegerView.js rename to src/style_manager/view/PropertyNumberView.js index 1038be526..d4f9faa42 100644 --- a/src/style_manager/view/PropertyIntegerView.js +++ b/src/style_manager/view/PropertyNumberView.js @@ -42,5 +42,5 @@ export default PropertyView.extend({ PropertyView.prototype.clearCached.apply(this, arguments); this.unit = null; this.$unit = null; - } + }, }); diff --git a/src/style_manager/view/PropertySliderView.js b/src/style_manager/view/PropertySliderView.js index 0c090638e..9d681b2f6 100644 --- a/src/style_manager/view/PropertySliderView.js +++ b/src/style_manager/view/PropertySliderView.js @@ -1,4 +1,4 @@ -import Property from './PropertyIntegerView'; +import Property from './PropertyNumberView'; export default Property.extend({ events() { @@ -6,7 +6,7 @@ export default Property.extend({ ...Property.prototype.events, 'change [type=range]': 'inputValueChanged', 'input [type=range]': 'inputValueChangedSoft', - change: '' + change: '', }; }, @@ -62,5 +62,5 @@ export default Property.extend({ clearCached() { Property.prototype.clearCached.apply(this, arguments); this.slider = null; - } + }, }); diff --git a/test/specs/style_manager/model/Models.js b/test/specs/style_manager/model/Models.js index 03e646618..1f9c01788 100644 --- a/test/specs/style_manager/model/Models.js +++ b/test/specs/style_manager/model/Models.js @@ -1,7 +1,7 @@ import Sector from 'style_manager/model/Sector'; import Sectors from 'style_manager/model/Sectors'; import Property from 'style_manager/model/Property'; -import PropertyInteger from 'style_manager/model/PropertyInteger'; +import PropertyNumber from 'style_manager/model/PropertyNumber'; import Properties from 'style_manager/model/Properties'; import Layer from 'style_manager/model/Layer'; import Layers from 'style_manager/model/Layers'; @@ -165,11 +165,11 @@ describe('Property', () => { }); }); -describe('PropertyInteger', () => { +describe('PropertyNumber', () => { var obj; beforeEach(() => { - obj = new PropertyInteger({ units: ['px', 'deg'] }); + obj = new PropertyNumber({ units: ['px', 'deg'] }); }); afterEach(() => { @@ -182,7 +182,7 @@ describe('PropertyInteger', () => { }); test('parse input value with function', () => { - obj = new PropertyInteger({ + obj = new PropertyNumber({ units: ['px', 'deg'], functionName: 'test', }); @@ -191,14 +191,14 @@ describe('PropertyInteger', () => { }); test('parse input value with min', () => { - obj = new PropertyInteger({ units: ['px'], min: 10 }); + obj = new PropertyNumber({ units: ['px'], min: 10 }); const result = { value: 10, unit: 'px' }; expect(obj.parseValue('1px')).toEqual(result); expect(obj.parseValue('15px')).toEqual({ value: 15, unit: 'px' }); }); test('parse input value with max', () => { - obj = new PropertyInteger({ units: ['px'], max: 100 }); + obj = new PropertyNumber({ units: ['px'], max: 100 }); const result = { value: 100, unit: 'px' }; expect(obj.parseValue('200px')).toEqual(result); expect(obj.parseValue('95px')).toEqual({ value: 95, unit: 'px' }); diff --git a/test/specs/style_manager/view/PropertyIntegerView.js b/test/specs/style_manager/view/PropertyIntegerView.js index 0daa3c9a7..44cfb0f0d 100644 --- a/test/specs/style_manager/view/PropertyIntegerView.js +++ b/test/specs/style_manager/view/PropertyIntegerView.js @@ -1,11 +1,11 @@ import Backbone from 'backbone'; -import PropertyIntegerView from 'style_manager/view/PropertyIntegerView'; -import PropertyInteger from 'style_manager/model/PropertyInteger'; +import PropertyNumberView from 'style_manager/view/PropertyNumberView'; +import PropertyNumber from 'style_manager/model/PropertyNumber'; import Component from 'dom_components/model/Component'; import Editor from 'editor/model/Editor'; import DomComponents from 'dom_components'; -describe('PropertyIntegerView', () => { +describe('PropertyNumberView', () => { let em; let dcomp; let compOpts; @@ -32,14 +32,14 @@ describe('PropertyIntegerView', () => { propTarget = { ...Backbone.Events }; target = new Component({}, compOpts); component = new Component({}, compOpts); - model = new PropertyInteger({ + model = new PropertyNumber({ units, - property: propName + property: propName, }); propTarget.model = component; - view = new PropertyIntegerView({ + view = new PropertyNumberView({ model, - propTarget + propTarget, }); document.body.innerHTML = '
'; fixtures = document.body.firstChild; @@ -123,9 +123,9 @@ describe('PropertyIntegerView', () => { describe('With target setted', () => { beforeEach(() => { target.model = component; - view = new PropertyIntegerView({ + view = new PropertyNumberView({ model, - propTarget: target + propTarget: target, }); fixtures.innerHTML = ''; view.render(); @@ -159,16 +159,16 @@ describe('PropertyIntegerView', () => { describe('Init property', () => { beforeEach(() => { component = new Component(); - model = new PropertyInteger({ + model = new PropertyNumber({ units, property: propName, defaults: intValue, min: minValue, max: maxValue, - unit: units[1] + unit: units[1], }); - view = new PropertyIntegerView({ - model + view = new PropertyNumberView({ + model, }); fixtures.innerHTML = ''; view.render(); From 0bfcd3bb6ee4b63cd1d291341c9982bb734f17b5 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 14:59:10 +0100 Subject: [PATCH 146/313] Update PropertyNumber API --- docs/.vuepress/config.js | 1 + docs/api.js | 1 + docs/api/property_number.md | 48 +++++++++++++++++++++++ src/style_manager/model/Property.js | 5 +-- src/style_manager/model/PropertyNumber.js | 30 +++++++++++++- 5 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 docs/api/property_number.md diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 7435821a5..6c3e06714 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -74,6 +74,7 @@ module.exports = { ['/api/style_manager', 'Style Manager'], ['/api/sector', `${subDivider}Sector`], ['/api/property', `${subDivider}Property`], + ['/api/property_number', `${subDivider}PropertyNumber`], ['/api/storage_manager', 'Storage Manager'], ['/api/device_manager', 'Device Manager'], ['/api/device', `${subDivider}Device`], diff --git a/docs/api.js b/docs/api.js index 797bdabe6..cf00bbf06 100644 --- a/docs/api.js +++ b/docs/api.js @@ -23,6 +23,7 @@ async function generateDocs () { ['style_manager/index.js', 'style_manager.md'], ['style_manager/model/Sector.js', 'sector.md'], ['style_manager/model/Property.js', 'property.md'], + ['style_manager/model/PropertyNumber.js', 'property_number.md'], ['storage_manager/index.js', 'storage_manager.md'], ['device_manager/index.js', 'device_manager.md'], ['device_manager/model/Device.js', 'device.md'], diff --git a/docs/api/property_number.md b/docs/api/property_number.md new file mode 100644 index 000000000..a966f9aaf --- /dev/null +++ b/docs/api/property_number.md @@ -0,0 +1,48 @@ + + +## PropertyNumber + +**Extends Property** + +### Properties + +* `units` **[Array][1]<[String][2]>** Array of units, eg. `['px', '%']` +* `min` **[Number][3]** Minimum value. +* `max` **[Number][3]** Maximum value. +* `step` **[Number][3]** Step value. + +### getUnits + +Get property units. + +Returns **[Array][1]<[String][2]>** + +### getUnit + +Get property unit value. + +Returns **[String][2]** + +### upUnit + +Update property unit value. +The change is also propagated to the selected targets. + +#### Parameters + +* `unit` **[String][2]** New unit value +* `opts` **[Object][4]** Options (optional, default `{}`) + + * `opts.noTarget` **[Boolean][5]** If `true` the change won't be propagated to selected targets. (optional, default `false`) + +Returns **[String][2]** + +[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array + +[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String + +[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number + +[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 6ce06e0b2..367a1840b 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -56,6 +56,7 @@ export default class Property extends Model { } _up(props, opts = {}) { + if (opts.noTarget) opts.__up = true; const { partial, ...rest } = opts; props.__p = !!(rest.avoidStore || partial); return this.set(props, { ...rest, avoidStore: props.__p }); @@ -157,7 +158,6 @@ export default class Property extends Model { * @param {Boolean} [opts.noTarget=false] If `true` the change won't be propagated to selected targets. */ upValue(value, opts = {}) { - if (opts.noTarget) opts.__up = true; const parsed = value === null || value === '' ? this.__getClearProps() : this.__parseValue(value, opts); return this._up(parsed, opts); } @@ -169,7 +169,6 @@ export default class Property extends Model { * @param {Boolean} [opts.noTarget=false] If `true` the change won't be propagated to selected targets. */ clear(opts = {}) { - if (opts.noTarget) opts.__up = true; this._up(this.__getClearProps(), { ...opts, __clear: true }); } @@ -311,7 +310,7 @@ export default class Property extends Model { * Get a complete value of the property. * This probably will replace the getValue when all * properties models will be splitted - * @param {string} val Custom value to replace the one on the model + * @param {String} val Custom value to replace the one on the model * @return {string} * @private */ diff --git a/src/style_manager/model/PropertyNumber.js b/src/style_manager/model/PropertyNumber.js index 4ba4e0896..76bbaa755 100644 --- a/src/style_manager/model/PropertyNumber.js +++ b/src/style_manager/model/PropertyNumber.js @@ -5,7 +5,7 @@ import { hasWin } from 'utils/mixins'; /** * @typedef PropertyNumber - * @property {Array} units Array of units, eg. ['px', '%'] + * @property {Array} units Array of units, eg. `['px', '%']` * @property {Number} min Minimum value. * @property {Number} max Maximum value. * @property {Number} step Step value. @@ -39,8 +39,36 @@ export default class PropertyNumber extends Property { return this.get('unit'); } + /** + * Get min value. + * @returns {Number} + */ + getMin() { + return this.get('min'); + } + + /** + * Get max value. + * @returns {Number} + */ + getMax() { + return this.get('max'); + } + + /** + * Get step value. + * @returns {Number} + */ + getStep() { + return this.get('step'); + } + /** * Update property unit value. + * The change is also propagated to the selected targets. + * @param {String} unit New unit value + * @param {Object} [opts={}] Options + * @param {Boolean} [opts.noTarget=false] If `true` the change won't be propagated to selected targets. * @returns {String} */ upUnit(unit, opts) { From e6e59b735cf255fdce4ff0904100a5b055441103 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 15:39:34 +0100 Subject: [PATCH 147/313] Switch PropertySelect with PropertyRadio --- docs/api/property_number.md | 18 +++++ src/style_manager/model/PropertyRadio.js | 79 +------------------ src/style_manager/model/PropertySelect.js | 93 +++++++++++++++++++++-- 3 files changed, 105 insertions(+), 85 deletions(-) diff --git a/docs/api/property_number.md b/docs/api/property_number.md index a966f9aaf..d6093dc92 100644 --- a/docs/api/property_number.md +++ b/docs/api/property_number.md @@ -23,6 +23,24 @@ Get property unit value. Returns **[String][2]** +### getMin + +Get min value. + +Returns **[Number][3]** + +### getMax + +Get max value. + +Returns **[Number][3]** + +### getStep + +Get step value. + +Returns **[Number][3]** + ### upUnit Update property unit value. diff --git a/src/style_manager/model/PropertyRadio.js b/src/style_manager/model/PropertyRadio.js index 1b3721b36..809f2b9a1 100644 --- a/src/style_manager/model/PropertyRadio.js +++ b/src/style_manager/model/PropertyRadio.js @@ -1,85 +1,10 @@ -import Property from './Property'; +import Property from './PropertySelect'; export default class PropertyRadio extends Property { defaults() { return { - ...Property.prototype.defaults, - options: [], // Array of options, eg. [{ id: '100', label: 'Set 100' }] + ...Property.getDefaults(), full: 1, }; } - - /** - * Get available options. - * @returns {Array} Array of options - */ - getOptions() { - // support old list property - const { options, list } = this.attributes; - return (options && options.length ? options : list) || []; - } - - /** - * Get current selected option. - * @returns {Object | null} - */ - getOption(id) { - const idSel = id || this.getValue(); - return this.getOptions().filter(o => this.getOptionId(o) === idSel)[0] || null; - } - - /** - * Update options. - * @param {Array} value Array of options, eg. `[{ id: 'val-1', label: 'Value 1' }]` - */ - setOptions(value = []) { - this.set('options', value); - return this; - } - - /** - * Add new option. - * @param {Object} value Option object, eg. `{ id: 'val-1', label: 'Value 1' }` - */ - addOption(value) { - if (value) { - const opts = this.getOptions(); - this.setOptions([...opts, value]); - } - return this; - } - - /** - * Get the option id from the option object. - * @param {Object} option Option object - * @returns {String} Option id - */ - getOptionId(option) { - return option.id || option.value; - } - - /** - * Get option label. - * @param {String} id Option id - * @param {Object} [opts={}] Options - * @param {Boolean} [opts.locale=true] Use the locale string from i18n module - * @returns {String} Option label - */ - getOptionLabel(id, opts = {}) { - const { locale = true } = opts; - const options = this.getOptions(); - const option = options.filter(o => this.getOptionId(o) === id)[0] || {}; - const label = option.label || option.name || id; - const propId = this.getId(); - return (locale && this.em?.t(`styleManager.options.${propId}.${id}`)) || label; - } - - initialize(...args) { - Property.prototype.initialize.apply(this, args); - this.listenTo(this, 'change:options', this.__onOptionChange); - } - - __onOptionChange() { - this.set('list', this.get('options')); - } } diff --git a/src/style_manager/model/PropertySelect.js b/src/style_manager/model/PropertySelect.js index 9e87193f6..8be5d9442 100644 --- a/src/style_manager/model/PropertySelect.js +++ b/src/style_manager/model/PropertySelect.js @@ -1,8 +1,85 @@ -import Property from './PropertyRadio'; - -export default Property.extend({ - defaults: () => ({ - ...Property.prototype.defaults(), - full: 0 - }) -}); +import Property from './Property'; + +export default class PropertySelect extends Property { + defaults() { + return { + ...Property.getDefaults(), + options: [], // Array of options, eg. [{ id: '100', label: 'Set 100' }] + full: 0, + }; + } + + /** + * Get available options. + * @returns {Array} Array of options + */ + getOptions() { + // support old list property + const { options, list } = this.attributes; + return (options && options.length ? options : list) || []; + } + + /** + * Get current selected option. + * @returns {Object | null} + */ + getOption(id) { + const idSel = id || this.getValue(); + return this.getOptions().filter(o => this.getOptionId(o) === idSel)[0] || null; + } + + /** + * Update options. + * @param {Array} value Array of options, eg. `[{ id: 'val-1', label: 'Value 1' }]` + */ + setOptions(value = []) { + this.set('options', value); + return this; + } + + /** + * Add new option. + * @param {Object} value Option object, eg. `{ id: 'val-1', label: 'Value 1' }` + */ + addOption(value) { + if (value) { + const opts = this.getOptions(); + this.setOptions([...opts, value]); + } + return this; + } + + /** + * Get the option id from the option object. + * @param {Object} option Option object + * @returns {String} Option id + */ + getOptionId(option) { + return option.id || option.value; + } + + /** + * Get option label. + * @param {String} id Option id + * @param {Object} [opts={}] Options + * @param {Boolean} [opts.locale=true] Use the locale string from i18n module + * @returns {String} Option label + */ + getOptionLabel(id, opts = {}) { + const { locale = true } = opts; + const options = this.getOptions(); + const option = options.filter(o => this.getOptionId(o) === id)[0] || {}; + const label = option.label || option.name || id; + const propId = this.getId(); + return (locale && this.em?.t(`styleManager.options.${propId}.${id}`)) || label; + } + + initialize(...args) { + Property.prototype.initialize.apply(this, args); + this.listenTo(this, 'change:options', this.__onOptionChange); + } + + __onOptionChange() { + this.set('list', this.get('options')); + } +} From d1f48a036265c09e2bb13f8cbd5012f28c5d64ba Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 15:43:12 +0100 Subject: [PATCH 148/313] Update PropertySelect docs --- src/style_manager/model/PropertySelect.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/style_manager/model/PropertySelect.js b/src/style_manager/model/PropertySelect.js index 8be5d9442..364377452 100644 --- a/src/style_manager/model/PropertySelect.js +++ b/src/style_manager/model/PropertySelect.js @@ -1,10 +1,14 @@ import Property from './Property'; +/** + * @typedef PropertySelect + * @property {Array} options Array of option definitions, eg `[{ id: '100', label: 'Set 100' }]` + */ export default class PropertySelect extends Property { defaults() { return { ...Property.getDefaults(), - options: [], // Array of options, eg. [{ id: '100', label: 'Set 100' }] + options: [], full: 0, }; } @@ -20,7 +24,8 @@ export default class PropertySelect extends Property { } /** - * Get current selected option. + * Get current selected option or by id. + * @param {String} id Option id. * @returns {Object | null} */ getOption(id) { @@ -30,7 +35,7 @@ export default class PropertySelect extends Property { /** * Update options. - * @param {Array} value Array of options, eg. `[{ id: 'val-1', label: 'Value 1' }]` + * @param {Array} value New array of options, eg. `[{ id: 'val-1', label: 'Value 1' }]` */ setOptions(value = []) { this.set('options', value); From 27f5e6e545326e35115d22721c1a29c7b1716cb0 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 15:46:19 +0100 Subject: [PATCH 149/313] Add PropertySelect in docs --- docs/.vuepress/config.js | 1 + docs/api.js | 1 + docs/api/property_select.md | 72 +++++++++++++++++++++++ src/style_manager/model/PropertySelect.js | 2 +- 4 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 docs/api/property_select.md diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 6c3e06714..19ef6498e 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -75,6 +75,7 @@ module.exports = { ['/api/sector', `${subDivider}Sector`], ['/api/property', `${subDivider}Property`], ['/api/property_number', `${subDivider}PropertyNumber`], + ['/api/property_select', `${subDivider}PropertySelect`], ['/api/storage_manager', 'Storage Manager'], ['/api/device_manager', 'Device Manager'], ['/api/device', `${subDivider}Device`], diff --git a/docs/api.js b/docs/api.js index cf00bbf06..d3c0698ed 100644 --- a/docs/api.js +++ b/docs/api.js @@ -24,6 +24,7 @@ async function generateDocs () { ['style_manager/model/Sector.js', 'sector.md'], ['style_manager/model/Property.js', 'property.md'], ['style_manager/model/PropertyNumber.js', 'property_number.md'], + ['style_manager/model/PropertySelect.js', 'property_select.md'], ['storage_manager/index.js', 'storage_manager.md'], ['device_manager/index.js', 'device_manager.md'], ['device_manager/model/Device.js', 'device.md'], diff --git a/docs/api/property_select.md b/docs/api/property_select.md new file mode 100644 index 000000000..750a78f22 --- /dev/null +++ b/docs/api/property_select.md @@ -0,0 +1,72 @@ + + +## PropertySelect + +**Extends Property** + +### Properties + +* `options` **[Array][1]<[Object][2]>** Array of option definitions, eg `[{ id: '100', label: 'Set 100' }]` + +### getOptions + +Get available options. + +Returns **[Array][1]<[Object][2]>** Array of options + +### getOption + +Get current selected option or by id. + +#### Parameters + +* `id` **[String][3]** Option id. + +Returns **([Object][2] | null)** + +### setOptions + +Update options. + +#### Parameters + +* `value` **[Array][1]<[Object][2]>** New array of options, eg. `[{ id: 'val-1', label: 'Value 1' }]` (optional, default `[]`) + +### addOption + +Add new option. + +#### Parameters + +* `value` **[Object][2]** Option object, eg. `{ id: 'val-1', label: 'Value 1' }` + +### getOptionId + +Get the option id from the option object. + +#### Parameters + +* `option` **[Object][2]** Option object + +Returns **[String][3]** Option id + +### getOptionLabel + +Get option label. + +#### Parameters + +* `id` **[String][3]** Option id +* `opts` **[Object][2]** Options (optional, default `{}`) + + * `opts.locale` **[Boolean][4]** Use the locale string from i18n module (optional, default `true`) + +Returns **[String][3]** Option label + +[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array + +[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String + +[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean diff --git a/src/style_manager/model/PropertySelect.js b/src/style_manager/model/PropertySelect.js index 364377452..7b50f9b9a 100644 --- a/src/style_manager/model/PropertySelect.js +++ b/src/style_manager/model/PropertySelect.js @@ -25,7 +25,7 @@ export default class PropertySelect extends Property { /** * Get current selected option or by id. - * @param {String} id Option id. + * @param {String} [id] Option id. * @returns {Object | null} */ getOption(id) { From 397f9fc1793cd843172982e0bea43494c4bc8c54 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 15:51:31 +0100 Subject: [PATCH 150/313] Refactor PropertyComposite in class --- src/style_manager/model/PropertyComposite.js | 110 ++++++++++--------- 1 file changed, 56 insertions(+), 54 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index b08a4d542..10551a6b2 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -1,33 +1,35 @@ import { isString, isUndefined } from 'underscore'; import Property from './Property'; -export default Property.extend({ - defaults: { - ...Property.prototype.defaults, - // 'background' is a good example where to make a difference - // between detached and not - // - // - NOT detached (default) - // background: url(..) no-repeat center ...; - // - Detached - // background-image: url(); - // background-repeat: repeat; - // ... - detached: 0, - - // Array of sub properties - properties: [], - - // Separator to use to split property values (only for not detached properties) - separator: ' ', - - // Separator to use to join property values (only for not detached properties) - join: null, - - fromStyle: null, - - toStyle: null, - }, +export default class PropertyComposite extends Property { + defaults() { + return { + ...Property.getDefaults(), + // 'background' is a good example where to make a difference + // between detached and not + // + // - NOT detached (default) + // background: url(..) no-repeat center ...; + // - Detached + // background-image: url(); + // background-repeat: repeat; + // ... + detached: 0, + + // Array of sub properties + properties: [], + + // Separator to use to split property values (only for not detached properties) + separator: ' ', + + // Separator to use to join property values (only for not detached properties) + join: null, + + fromStyle: null, + + toStyle: null, + }; + } initialize(props = {}, opts = {}) { Property.callParentInit(Property, this, props, opts); @@ -38,7 +40,7 @@ export default Property.extend({ this.listenTo(properties, 'change', this.__upProperties); this.listenTo(this, 'change:value', this.updateValues); Property.callInit(this, props, opts); - }, + } __upProperties(p, opts = {}) { if (!this.__hasCustom() || opts.__up || opts.__clearIn) return; @@ -47,7 +49,7 @@ export default Property.extend({ if (parentProp) return parentProp.__upProperties(this, opts); this.__upTargetsStyleProps(opts, p); - }, + } __upTargetsStyleProps(opts = {}, prop) { let style = this.getStyleFromProps(); @@ -58,16 +60,16 @@ export default Property.extend({ } this.__upTargetsStyle(style, opts); - }, + } _up(props, opts = {}) { this.__setProperties(this.__getSplitValue(props.value), opts); return Property.prototype._up.call(this, props, opts); - }, + } getStyle(opts) { return this.getStyleFromProps(opts); - }, + } /** * Get style object from current properties @@ -115,18 +117,18 @@ export default Property.extend({ return res; }, {}) : style; - }, + } __getFullValue(opts = {}) { if (this.isDetached() || opts.__clear) return ''; return this.getStyleFromProps()[this.getName()] || ''; - }, + } __getJoin() { const join = this.get('join'); return isString(join) ? join : this.get('separator'); - }, + } __styleHasProps(style = {}) { const name = this.getName(); @@ -134,18 +136,18 @@ export default Property.extend({ const nameProps = props.map(prop => prop.getName()); const allNameProps = [name, ...nameProps]; return allNameProps.some(prop => !isUndefined(style[prop]) && style[prop] !== ''); - }, + } __splitValue(value, sep) { return value .split(sep) .map(value => value.trim()) .filter(Boolean); - }, + } __splitStyleName(style, name, sep) { return this.__splitValue(style[name] || '', sep); - }, + } __getSplitValue(value = '') { const props = this.getProperties(); @@ -169,7 +171,7 @@ export default Property.extend({ }); return result; - }, + } __getPropsFromStyle(style = {}) { if (!this.__styleHasProps(style)) return null; @@ -191,23 +193,23 @@ export default Property.extend({ } return result; - }, + } __setProperties(values = {}, opts = {}) { this.getProperties().forEach(prop => { const value = values[prop.getId()]; prop.__getFullValue() !== value && prop.upValue(value, opts); }); - }, + } clear() { this.getProperties().map(p => p.clear({ __clearIn: !this.isDetached() })); return Property.prototype.clear.call(this); - }, + } hasValue(opts) { return this.getProperties().some(prop => prop.hasValue(opts)); - }, + } /** * Get current values of properties @@ -221,7 +223,7 @@ export default Property.extend({ res[key] = `${prop.__getFullValue()}`; return res; }, {}); - }, + } /** * Clear the value @@ -231,7 +233,7 @@ export default Property.extend({ clearValue(opts = {}) { this.get('properties').each(property => property.clearValue()); return Property.prototype.clearValue.apply(this, arguments); - }, + } /** * Update property values @@ -248,7 +250,7 @@ export default Property.extend({ // There some issue with UndoManager //property.setValue(value, 0, {fromParent: 1}); }); - }, + } /** * Split by sperator but avoid it inside parenthesis @@ -256,7 +258,7 @@ export default Property.extend({ */ getSplitSeparator() { return new RegExp(`${this.get('separator')}(?![^\\(]*\\))`); - }, + } /** * Returns default value @@ -274,7 +276,7 @@ export default Property.extend({ const properties = this.get('properties'); properties.each((prop, index) => (value += `${prop.getDefaultValue()} `)); return value.trim(); - }, + } getFullValue() { if (this.get('detached')) { @@ -282,7 +284,7 @@ export default Property.extend({ } return this.get('properties').getFullValue(); - }, + } /** * Get property at some index @@ -291,17 +293,17 @@ export default Property.extend({ */ getPropertyAt(index) { return this.get('properties').at(index); - }, + } isDetached() { return !!this.get('detached'); - }, + } getProperties() { return [...this.get('properties').models]; - }, + } getProperty(id) { return this.get('properties').filter(prop => prop.get('id') === id)[0] || null; - }, -}); + } +} From 781674f377501fc91c14518e93dbe621fb8dff75 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 16:13:05 +0100 Subject: [PATCH 151/313] Update PropertyComposite --- src/style_manager/model/PropertyComposite.js | 134 ++++++++++--------- 1 file changed, 73 insertions(+), 61 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 10551a6b2..d9015cd95 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -1,36 +1,87 @@ import { isString, isUndefined } from 'underscore'; import Property from './Property'; +/** + * @typedef PropertyComposite + * @property {Array} properties Array of sub properties, eg. `[{ type: 'number', property: 'margin-top' }, ...]` + * @property {Boolean} [detached=false] Indicate if the final CSS property is splitted (detached: `margin-top: X; margin-right: Y; ...`) or combined (not detached: `margin: X Y ...;`) + * @property {String|RegExp} [separator=' '] Separator to use to split property values. + * @property {String} [join=' '] Value used to join property values + * @property {Function} [fromStyle] Custom logic for getting property values from the target style object, eg. + * ` + * fromStyle(style) => { + * return {}; + * } + * ` + * @property {Function} [toStyle] Custom logic for creating the CSS style object to apply on selected targets. + * + * [Property]: property.html + */ export default class PropertyComposite extends Property { defaults() { return { ...Property.getDefaults(), - // 'background' is a good example where to make a difference - // between detached and not - // - // - NOT detached (default) - // background: url(..) no-repeat center ...; - // - Detached - // background-image: url(); - // background-repeat: repeat; - // ... - detached: 0, - - // Array of sub properties + detached: false, properties: [], - - // Separator to use to split property values (only for not detached properties) separator: ' ', - - // Separator to use to join property values (only for not detached properties) join: null, - fromStyle: null, - toStyle: null, }; } + /** + * Get properties. + * @returns {Array<[Property]>} + */ + getProperties() { + return [...this.get('properties').models]; + } + + /** + * Get property by id. + * @param {String} id Property id. + * @returns {[Property]|null>} + */ + getProperty(id) { + return this.get('properties').filter(prop => prop.get('id') === id)[0] || null; + } + + /** + * Get property at index. + * @param {Number} index + * @returns {[Property]|null} + */ + getPropertyAt(index) { + return this.get('properties').at(index); + } + + /** + * Check if the property is detached. + * @returns {Boolean} + */ + isDetached() { + return !!this.get('detached'); + } + + /** + * Get current values of properties + * @param {Object} [opts={}] Options + * @param {Boolean} [opts.byName=false] Use property name as key instead of ID + * @returns {Object} + */ + getValues({ byName } = {}) { + return this.getProperties().reduce((res, prop) => { + const key = byName ? prop.getName() : prop.getId(); + res[key] = `${prop.__getFullValue()}`; + return res; + }, {}); + } + + getSplitSeparator() { + return new RegExp(`${this.get('separator')}(?![^\\(]*\\))`); + } + initialize(props = {}, opts = {}) { Property.callParentInit(Property, this, props, opts); const { em } = this; @@ -74,6 +125,7 @@ export default class PropertyComposite extends Property { /** * Get style object from current properties * @returns {Object} Style object + * @private */ getStyleFromProps(opts = {}) { const name = this.getName(); @@ -211,23 +263,10 @@ export default class PropertyComposite extends Property { return this.getProperties().some(prop => prop.hasValue(opts)); } - /** - * Get current values of properties - * @param {Object} [opts={}] Options - * @param {Boolean} [opts.byName=false] Use property name as key instead of ID - * @returns {Object} - */ - getValues({ byName } = {}) { - return this.getProperties().reduce((res, prop) => { - const key = byName ? prop.getName() : prop.getId(); - res[key] = `${prop.__getFullValue()}`; - return res; - }, {}); - } - /** * Clear the value * @return {this} + * @private * @deprecated */ clearValue(opts = {}) { @@ -237,6 +276,7 @@ export default class PropertyComposite extends Property { /** * Update property values + * @private * @deprecated */ updateValues() { @@ -252,18 +292,11 @@ export default class PropertyComposite extends Property { }); } - /** - * Split by sperator but avoid it inside parenthesis - * @return {RegExp} - */ - getSplitSeparator() { - return new RegExp(`${this.get('separator')}(?![^\\(]*\\))`); - } - /** * Returns default value * @param {Boolean} defaultProps Force to get defaults from properties * @return {string} + * @private */ getDefaultValue(defaultProps) { let value = this.get('defaults'); @@ -285,25 +318,4 @@ export default class PropertyComposite extends Property { return this.get('properties').getFullValue(); } - - /** - * Get property at some index - * @param {Number} index - * @return {Object} - */ - getPropertyAt(index) { - return this.get('properties').at(index); - } - - isDetached() { - return !!this.get('detached'); - } - - getProperties() { - return [...this.get('properties').models]; - } - - getProperty(id) { - return this.get('properties').filter(prop => prop.get('id') === id)[0] || null; - } } From 4873f1addb605981a09f3e07b35460025bbb8bf3 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 17:11:00 +0100 Subject: [PATCH 152/313] Add PropertyComposite in docs --- docs/.vuepress/config.js | 1 + docs/api.js | 1 + docs/api/property_composite.md | 99 ++++++++++++++++++++ docs/api/property_select.md | 2 +- src/style_manager/model/PropertyComposite.js | 31 +++++- 5 files changed, 128 insertions(+), 6 deletions(-) create mode 100644 docs/api/property_composite.md diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 19ef6498e..829c5159f 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -76,6 +76,7 @@ module.exports = { ['/api/property', `${subDivider}Property`], ['/api/property_number', `${subDivider}PropertyNumber`], ['/api/property_select', `${subDivider}PropertySelect`], + ['/api/property_composite', `${subDivider}PropertyComposite`], ['/api/storage_manager', 'Storage Manager'], ['/api/device_manager', 'Device Manager'], ['/api/device', `${subDivider}Device`], diff --git a/docs/api.js b/docs/api.js index d3c0698ed..6f2b71d56 100644 --- a/docs/api.js +++ b/docs/api.js @@ -25,6 +25,7 @@ async function generateDocs () { ['style_manager/model/Property.js', 'property.md'], ['style_manager/model/PropertyNumber.js', 'property_number.md'], ['style_manager/model/PropertySelect.js', 'property_select.md'], + ['style_manager/model/PropertyComposite.js', 'property_composite.md'], ['storage_manager/index.js', 'storage_manager.md'], ['device_manager/index.js', 'device_manager.md'], ['device_manager/model/Device.js', 'device.md'], diff --git a/docs/api/property_composite.md b/docs/api/property_composite.md new file mode 100644 index 000000000..c2106f714 --- /dev/null +++ b/docs/api/property_composite.md @@ -0,0 +1,99 @@ + + +## PropertyComposite + +**Extends Property** + +### Properties + +* `properties` **[Array][1]<[Object][2]>** Array of sub properties, eg. `[{ type: 'number', property: 'margin-top' }, ...]` +* `detached` **[Boolean][3]?** Indicate if the final CSS property is splitted (detached: `margin-top: X; margin-right: Y; ...`) or combined (not detached: `margin: X Y ...;`) +* `separator` **([String][4] | [RegExp][5])?** Separator to use to split property values. +* `join` **[String][4]?** Value used to join property values +* `fromStyle` **[Function][6]?** Custom logic for getting property values from the target style object, eg. + ` fromStyle(style) => { + return {}; + } ` +* `toStyle` **[Function][6]?** Custom logic for creating the CSS style object to apply on selected targets. + +### getProperties + +Get properties. + +Returns **[Array][1]<[Property]>** + +### getProperty + +Get property by id. + +#### Parameters + +* `id` **[String][4]** Property id. + +Returns **([Property] | null)** + +### getPropertyAt + +Get property at index. + +#### Parameters + +* `index` **[Number][7]** + +Returns **([Property] | null)** + +### isDetached + +Check if the property is detached. + +Returns **[Boolean][3]** + +### getValues + +Get current values of properties. + +#### Parameters + +* `opts` **[Object][2]** Options (optional, default `{}`) + + * `opts.byName` **[Boolean][3]** Use property names as a key instead of the id. (optional, default `false`) + +#### Examples + +```javascript +// In case the property is `margin` with sub properties like `margin-top`, `margin-right`, etc. +console.log(property.getValues()); +// { 'margin-top': '10px', 'margin-right': '20px', ... }; +``` + +Returns **[Object][2]** + +### getSeparator + +Get property separator. + +Returns **[RegExp][5]** + +### getJoin + +Get the join value. + +Returns **[String][4]** + +## + +[Property]: property.html + +[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array + +[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean + +[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String + +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp + +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function + +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number diff --git a/docs/api/property_select.md b/docs/api/property_select.md index 750a78f22..c1a707b54 100644 --- a/docs/api/property_select.md +++ b/docs/api/property_select.md @@ -20,7 +20,7 @@ Get current selected option or by id. #### Parameters -* `id` **[String][3]** Option id. +* `id` **[String][3]?** Option id. Returns **([Object][2] | null)** diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index d9015cd95..204a46f86 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -14,8 +14,6 @@ import Property from './Property'; * } * ` * @property {Function} [toStyle] Custom logic for creating the CSS style object to apply on selected targets. - * - * [Property]: property.html */ export default class PropertyComposite extends Property { defaults() { @@ -41,7 +39,7 @@ export default class PropertyComposite extends Property { /** * Get property by id. * @param {String} id Property id. - * @returns {[Property]|null>} + * @returns {[Property]|null} */ getProperty(id) { return this.get('properties').filter(prop => prop.get('id') === id)[0] || null; @@ -65,10 +63,14 @@ export default class PropertyComposite extends Property { } /** - * Get current values of properties + * Get current values of properties. * @param {Object} [opts={}] Options - * @param {Boolean} [opts.byName=false] Use property name as key instead of ID + * @param {Boolean} [opts.byName=false] Use property names as a key instead of the id. * @returns {Object} + * @example + * // In case the property is `margin` with sub properties like `margin-top`, `margin-right`, etc. + * console.log(property.getValues()); + * // { 'margin-top': '10px', 'margin-right': '20px', ... }; */ getValues({ byName } = {}) { return this.getProperties().reduce((res, prop) => { @@ -78,6 +80,22 @@ export default class PropertyComposite extends Property { }, {}); } + /** + * Get property separator. + * @returns {RegExp} + */ + getSeparator() { + return this.getSplitSeparator(); + } + + /** + * Get the join value. + * @returns {String} + */ + getJoin() { + return this.__getJoin(); + } + getSplitSeparator() { return new RegExp(`${this.get('separator')}(?![^\\(]*\\))`); } @@ -319,3 +337,6 @@ export default class PropertyComposite extends Property { return this.get('properties').getFullValue(); } } +/** + * [Property]: property.html + */ From fa0475ca1118173b8c04ccd4493eb7c956d86665 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 17:18:01 +0100 Subject: [PATCH 153/313] Refactor PropertyStack --- src/style_manager/model/PropertyStack.js | 118 ++++++++++++----------- 1 file changed, 60 insertions(+), 58 deletions(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index d33dfbbc5..b0e3e51f7 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -1,5 +1,5 @@ import { keys, isUndefined, isArray, isString } from 'underscore'; -import Property from './PropertyComposite'; +import PropertyComposite from './PropertyComposite'; import PropertyBase from './Property'; import Layers from './Layers'; import { camelCase } from 'utils/mixins'; @@ -7,33 +7,35 @@ import { camelCase } from 'utils/mixins'; const VALUES_REG = /,(?![^\(]*\))/; const PARTS_REG = /\s(?![^(]*\))/; -export default Property.extend({ - defaults: { - ...Property.prototype.defaults, - // Array of layers (which contain properties) - layers: [], +export default class PropertyStack extends PropertyComposite { + defaults() { + return { + ...PropertyComposite.getDefaults(), + // Array of layers (which contain properties) + layers: [], - // The separator used to split layer values - layerSeparator: ', ', + // The separator used to split layer values + layerSeparator: ', ', - // The separator used to join layer values - layerJoin: '', + // The separator used to join layer values + layerJoin: '', - // Prepend new layers in the list - prepend: 0, + // Prepend new layers in the list + prepend: 0, - // Layer preview - preview: 0, + // Layer preview + preview: 0, - // Custom layer label function - layerLabel: null, + // Custom layer label function + layerLabel: null, - // Current selected layer - selectedLayer: null, - }, + // Current selected layer + selectedLayer: null, + }; + } initialize(props = {}, opts = {}) { - Property.callParentInit(Property, this, props, opts); + PropertyComposite.callParentInit(PropertyComposite, this, props, opts); const layers = this.get('layers'); const layersColl = new Layers(layers); layersColl.property = this; @@ -41,8 +43,8 @@ export default Property.extend({ this.set('layers', layersColl, { silent: true }); this.on('change:selectedLayer', this.__upSelected); this.listenTo(layersColl, 'add remove', this.__upLayers); - Property.callInit(this, props, opts); - }, + PropertyComposite.callInit(this, props, opts); + } __upProperties(prop, opts = {}) { const layer = this.getSelectedLayer(); @@ -50,24 +52,24 @@ export default Property.extend({ const name = prop.getName(); layer.upValues({ [name]: prop.__getFullValue() }); this.__upTargetsStyleProps(opts); - }, + } __upLayers(m, c, o) { this.__upTargetsStyleProps(o || c); - }, + } __upTargets(p, opts = {}) { if (opts.__select) return; return PropertyBase.prototype.__upTargets.call(this, p, opts); - }, + } __upTargetsStyleProps(opts = {}) { this.__upTargetsStyle(this.getStyleFromLayers(), opts); - }, + } __upTargetsStyle(style, opts) { return PropertyBase.prototype.__upTargetsStyle.call(this, style, opts); - }, + } __upSelected({ noEvent } = {}, opts = {}) { if (!this.__hasCustom()) return; @@ -83,7 +85,7 @@ export default Property.extend({ }); !noEvent && sm.__trgEv(sm.events.layerSelect, { property: this }); - }, + } _up(props, opts = {}) { const { __layers = [], ...rest } = props; @@ -91,7 +93,7 @@ export default Property.extend({ !this.isDetached() && this.__setLayers(__layers); this.__upSelected({ noEvent: true }, opts); return PropertyBase.prototype._up.call(this, rest, opts); - }, + } __setLayers(newLayers = []) { const layers = this.getLayers(); @@ -102,7 +104,7 @@ export default Property.extend({ } else { this.getLayers().reset(layersNew); } - }, + } __parseValue(value) { const result = this.parseValue(value); @@ -113,7 +115,7 @@ export default Property.extend({ .filter(Boolean); return result; - }, + } __parseLayer(value) { const parseFn = this.get('parseLayer'); @@ -126,7 +128,7 @@ export default Property.extend({ acc[prop.getId()] = !isUndefined(value) ? value : prop.getDefaultValue(); return acc; }, {}); - }, + } __getLayersFromStyle(style = {}) { if (!this.__styleHasProps(style)) return null; @@ -162,7 +164,7 @@ export default Property.extend({ } return isArray(result) ? result : [result]; - }, + } /** * Add new layer to the stack @@ -180,7 +182,7 @@ export default Property.extend({ const layer = this.get('layers').push({ values }, opts); return layer; - }, + } /** * Remove layer @@ -189,7 +191,7 @@ export default Property.extend({ */ removeLayer(layer) { return this.get('layers').remove(layer); - }, + } /** * Remove layer at index @@ -199,7 +201,7 @@ export default Property.extend({ removeLayerAt(index = 0) { const layer = this.getLayer(index); return layer ? this.removeLayer(layer) : null; - }, + } /** * Select layer @@ -207,7 +209,7 @@ export default Property.extend({ */ selectLayer(layer) { return this.set('selectedLayer', layer, { __select: true }); - }, + } /** * Select layer at index @@ -216,7 +218,7 @@ export default Property.extend({ selectLayerAt(index = 0) { const layer = this.getLayer(index); return layer && this.selectLayer(layer); - }, + } /** * Get layer label @@ -243,7 +245,7 @@ export default Property.extend({ } return result; - }, + } /** * Get selected layer @@ -252,11 +254,11 @@ export default Property.extend({ getSelectedLayer() { const layer = this.get('selectedLayer'); return layer && layer.getIndex() >= 0 ? layer : null; - }, + } getStyle(opts) { return this.getStyleFromLayers(opts); - }, + } /** * Get style object from layer @@ -296,7 +298,7 @@ export default Property.extend({ return res; }, {}) : style; - }, + } /** * Get style object from current layers @@ -334,21 +336,21 @@ export default Property.extend({ } return result; - }, + } __getJoinLayers() { const join = this.get('layerJoin'); const sep = this.get('layerSeparator'); return join || (isString(sep) ? sep : join); - }, + } __getFullValue() { if (this.get('detached')) return ''; const style = this.getStyleFromLayers(); return style[this.getName()]; - }, + } /** * Get layer sperator @@ -357,33 +359,33 @@ export default Property.extend({ getLayerSeparator() { const sep = this.get('layerSeparator'); return isString(sep) ? new RegExp(`${sep}(?![^\\(]*\\))`) : sep; - }, + } getLayers() { return this.get('layers'); - }, + } getLayer(index = 0) { return this.getLayers().at(index) || null; - }, + } getCurrentLayer() { return this.getLayers().filter(layer => layer.get('active'))[0]; - }, + } getFullValue() { return this.get('detached') ? '' : this.get('layers').getFullValue(); - }, + } getValueFromStyle(styles = {}) { const layers = this.getLayers().getLayersFromStyle(styles); return new Layers(layers).getFullValue(); - }, + } clearValue() { this.getLayers().reset(); - return Property.prototype.clearValue.apply(this, arguments); - }, + return PropertyComposite.prototype.clearValue.apply(this, arguments); + } getValueFromTarget(target) { const { detached, property, properties } = this.attributes; @@ -397,7 +399,7 @@ export default Property.extend({ }); return !detached ? style[property] : keys(validStyles).length ? validStyles : ''; - }, + } /** * Extended @@ -407,7 +409,7 @@ export default Property.extend({ const { noParent } = opts; const parentValue = noParent && this.getParentTarget(); return this.getLayers().length > 0 && !parentValue; - }, + } /** * Extended @@ -417,7 +419,7 @@ export default Property.extend({ this.getLayers().reset(); this.__upTargetsStyleProps(opts); return PropertyBase.prototype.clear.call(this); - }, + } /** * This method allows to customize layers returned from the target @@ -436,5 +438,5 @@ export default Property.extend({ */ getLayersFromTarget(target) { return; - }, -}); + } +} From 8e3e600bd08d49bdc3783c8442e0a669d796dd59 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 18:00:04 +0100 Subject: [PATCH 154/313] Update PropertyStack --- src/style_manager/model/Property.js | 8 +- src/style_manager/model/PropertyComposite.js | 2 + src/style_manager/model/PropertyStack.js | 365 ++++++++++--------- 3 files changed, 203 insertions(+), 172 deletions(-) diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 367a1840b..c27e60931 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -1,6 +1,6 @@ import { Model } from 'common'; import { isUndefined, isString, result, keys } from 'underscore'; -import { capitalize } from 'utils/mixins'; +import { capitalize, camelCase } from 'utils/mixins'; /** * @typedef Property @@ -130,6 +130,8 @@ export default class Property extends Model { /** * Get the CSS style object of the property. + * @param {Object} [opts={}] Options + * @param {Boolean} [opts.camelCase] Return property name in camelCase. * @return {Object} * @example * // In case the property is `color` with a value of `red`. @@ -137,7 +139,9 @@ export default class Property extends Model { * // { color: 'red' }; */ getStyle(opts = {}) { - return { [this.getName()]: this.__getFullValue(opts) }; + const name = this.getName(); + const key = opts.camelCase ? camelCase(name) : name; + return { [key]: this.__getFullValue(opts) }; } /** diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 204a46f86..e236ccb85 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -142,6 +142,8 @@ export default class PropertyComposite extends Property { /** * Get style object from current properties + * @param {Object} [opts={}] Options + * @param {Boolean} [opts.camelCase] Return property names in camelCase. * @returns {Object} Style object * @private */ diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index b0e3e51f7..19c543b8e 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -7,33 +7,208 @@ import { camelCase } from 'utils/mixins'; const VALUES_REG = /,(?![^\(]*\))/; const PARTS_REG = /\s(?![^(]*\))/; +/** + * @typedef PropertyStack + * @property {String|RegExp} [layerSeparator=', '] The separator used to split layer values. + * @property {String} [layerJoin=', '] Value used to join layer values. + * @property {Function} [layerLabel] Custom logic for creating the layer value. + */ export default class PropertyStack extends PropertyComposite { defaults() { return { ...PropertyComposite.getDefaults(), - // Array of layers (which contain properties) layers: [], - - // The separator used to split layer values layerSeparator: ', ', - - // The separator used to join layer values layerJoin: '', - - // Prepend new layers in the list prepend: 0, - - // Layer preview preview: 0, - - // Custom layer label function layerLabel: null, - - // Current selected layer selectedLayer: null, }; } + /** + * Get all available layers. + * @returns {Collection<[Layer]>} + */ + getLayers() { + return this.get('layers'); + } + + /** + * Get layer by index. + * @param {Number} [index=0] Layer index position. + * @returns {[Layer]|null} + * @example + * // Get the first layer + * const layerFirst = property.getLayer(0); + * // Get the last layer + * const layers = this.getLayers(); + * const layerLast = property.getLayer(layers.length - 1); + */ + getLayer(index = 0) { + return this.getLayers().at(index) || null; + } + + /** + * Get selected layer. + * @returns {[Layer] | null} + */ + getSelectedLayer() { + const layer = this.get('selectedLayer'); + return layer && layer.getIndex() >= 0 ? layer : null; + } + + /** + * Select layer. + * Without a selected layer any update made on inner properties has no effect. + * @param {[Layer]} layer Layer to select + * @example + * const layer = property.getLayer(0); + * property.selectLayer(layer); + */ + selectLayer(layer) { + return this.set('selectedLayer', layer, { __select: true }); + } + + /** + * Select layer by index. + * @param {Number} index Index of the layer to select. + * @example + * property.selectLayerAt(1); + */ + selectLayerAt(index = 0) { + const layer = this.getLayer(index); + return layer && this.selectLayer(layer); + } + + /** + * Add new layer to the stack. + * @param {Object} [props={}] Custom property values to use in a new layer. + * @param {Object} [opts={}] Options + * @param {Number} [opts.at] Position index (by default the layer will be appended at the end). + * @returns {[Layer]} Added layer. + * @example + * // Add new layer at the beginning of the stack with custom values + * property.addLayer({ 'sub-prop1': 'value1', 'sub-prop2': 'value2' }, { at: 0 }); + */ + addLayer(props = {}, opts = {}) { + const values = {}; + this.getProperties().forEach(prop => { + const name = prop.getName(); + const value = props[name]; + values[name] = isUndefined(value) ? prop.getDefaultValue() : value; + }); + const layer = this.get('layers').push({ values }, opts); + + return layer; + } + + /** + * Remove layer. + * @param {[Layer]} layer Layer to remove. + * @returns {[Layer]} Removed layer + * @example + * const layer = property.getLayer(0); + * property.removeLayer(layer); + */ + removeLayer(layer) { + return this.get('layers').remove(layer); + } + + /** + * Remove layer by index. + * @param {Number} index Index of the layer to remove + * @returns {[Layer]|null} Removed layer + * @example + * property.removeLayerAt(0); + */ + removeLayerAt(index = 0) { + const layer = this.getLayer(index); + return layer ? this.removeLayer(layer) : null; + } + + /** + * Get layer label. + * @param {[Layer]} layer + * @returns {String} + * @example + * const layer = this.getLayer(1); + * const label = this.getLayerLabel(layer); + */ + getLayerLabel(layer) { + let result = ''; + + if (layer) { + const layerLabel = this.get('layerLabel'); + const values = layer.getValues(); + const index = layer.getIndex(); + + if (layerLabel) { + result = layerLabel(layer, { index, values, property: this }); + } else { + const parts = []; + this.getProperties().map(prop => { + parts.push(values[prop.getId()]); + }); + result = parts.filter(Boolean).join(' '); + } + } + + return result; + } + + /** + * Get style object from the layer. + * @param {[Layer]} layer + * @param {Object} [opts={}] Options + * @param {Boolean} [opts.camelCase] Return property names in camelCase. + * @returns {Object} Style object + */ + getStyleFromLayer(layer, opts = {}) { + const join = this.__getJoin(); + const joinLayers = this.__getJoinLayers(); + const toStyle = this.get('toStyle'); + const name = this.getName(); + const values = layer.getValues(); + let style; + + if (toStyle) { + style = toStyle(values, { join, joinLayers, name, layer, property: this }); + } else { + const result = this.getProperties().map(prop => { + const name = prop.getName(); + const val = values[name]; + const value = isUndefined(val) ? prop.getDefaultValue() : val; + return { name, value }; + }); + style = this.isDetached() + ? result.reduce((acc, item) => { + acc[item.name] = item.value; + return acc; + }, {}) + : { + [this.getName()]: result.map(r => r.value).join(join), + }; + } + + return opts.camelCase + ? Object.keys(style).reduce((res, key) => { + res[camelCase(key)] = style[key]; + return res; + }, {}) + : style; + } + + /** + * Get layer separator. + * @return {RegExp} + */ + getLayerSeparator() { + const sep = this.get('layerSeparator'); + return isString(sep) ? new RegExp(`${sep}(?![^\\(]*\\))`) : sep; + } + initialize(props = {}, opts = {}) { PropertyComposite.callParentInit(PropertyComposite, this, props, opts); const layers = this.get('layers'); @@ -166,150 +341,16 @@ export default class PropertyStack extends PropertyComposite { return isArray(result) ? result : [result]; } - /** - * Add new layer to the stack - * @param {Object} [props={}] Layer props - * @param {Object} [opts={}] Options - * @returns {[Layer]} - */ - addLayer(props = {}, opts = {}) { - const values = {}; - this.getProperties().forEach(prop => { - const name = prop.getName(); - const value = props[name]; - values[name] = isUndefined(value) ? prop.getDefaultValue() : value; - }); - const layer = this.get('layers').push({ values }, opts); - - return layer; - } - - /** - * Remove layer - * @param {[Layer]} layer - * @returns {[Layer]} Removed layer - */ - removeLayer(layer) { - return this.get('layers').remove(layer); - } - - /** - * Remove layer at index - * @param {Number} index Index of the layer to remove - * @returns {[Layer] | null} Removed layer - */ - removeLayerAt(index = 0) { - const layer = this.getLayer(index); - return layer ? this.removeLayer(layer) : null; - } - - /** - * Select layer - * @param {[Layer]} layer - */ - selectLayer(layer) { - return this.set('selectedLayer', layer, { __select: true }); - } - - /** - * Select layer at index - * @param {Number} index Index of the layer to select - */ - selectLayerAt(index = 0) { - const layer = this.getLayer(index); - return layer && this.selectLayer(layer); - } - - /** - * Get layer label - * @param {[Layer]} layer - * @returns {String} - */ - getLayerLabel(layer) { - let result = ''; - - if (layer) { - const layerLabel = this.get('layerLabel'); - const values = layer.getValues(); - const index = layer.getIndex(); - - if (layerLabel) { - result = layerLabel(layer, { index, values, property: this }); - } else { - const parts = []; - this.getProperties().map(prop => { - parts.push(values[prop.getId()]); - }); - result = parts.filter(Boolean).join(' '); - } - } - - return result; - } - - /** - * Get selected layer - * @returns {[Layer] | null} - */ - getSelectedLayer() { - const layer = this.get('selectedLayer'); - return layer && layer.getIndex() >= 0 ? layer : null; - } - getStyle(opts) { return this.getStyleFromLayers(opts); } - /** - * Get style object from layer - * @param {[Layer]} layer - * @returns {Object} Style object - */ - getStyleFromLayer(layer, opts = {}) { - const join = this.__getJoin(); - const joinLayers = this.__getJoinLayers(); - const toStyle = this.get('toStyle'); - const name = this.getName(); - const values = layer.getValues(); - let style; - - if (toStyle) { - style = toStyle(values, { join, joinLayers, name, layer, property: this }); - } else { - const result = this.getProperties().map(prop => { - const name = prop.getName(); - const val = values[name]; - const value = isUndefined(val) ? prop.getDefaultValue() : val; - return { name, value }; - }); - style = this.isDetached() - ? result.reduce((acc, item) => { - acc[item.name] = item.value; - return acc; - }, {}) - : { - [this.getName()]: result.map(r => r.value).join(join), - }; - } - - return opts.camelCase - ? Object.keys(style).reduce((res, key) => { - res[camelCase(key)] = style[key]; - return res; - }, {}) - : style; - } - - /** - * Get style object from current layers - * @returns {Object} Style object - */ - getStyleFromLayers() { + getStyleFromLayers(opts) { let result = {}; const name = this.getName(); const layers = this.getLayers(); const props = this.getProperties(); - const styles = layers.map(l => this.getStyleFromLayer(l)); + const styles = layers.map(l => this.getStyleFromLayer(l, opts)); styles.forEach(style => { keys(style).map(key => { if (!result[key]) result[key] = []; @@ -352,27 +393,6 @@ export default class PropertyStack extends PropertyComposite { return style[this.getName()]; } - /** - * Get layer sperator - * @return {RegExp} - */ - getLayerSeparator() { - const sep = this.get('layerSeparator'); - return isString(sep) ? new RegExp(`${sep}(?![^\\(]*\\))`) : sep; - } - - getLayers() { - return this.get('layers'); - } - - getLayer(index = 0) { - return this.getLayers().at(index) || null; - } - - getCurrentLayer() { - return this.getLayers().filter(layer => layer.get('active'))[0]; - } - getFullValue() { return this.get('detached') ? '' : this.get('layers').getFullValue(); } @@ -421,10 +441,15 @@ export default class PropertyStack extends PropertyComposite { return PropertyBase.prototype.clear.call(this); } + getCurrentLayer() { + return this.getLayers().filter(layer => layer.get('active'))[0]; + } + /** * This method allows to customize layers returned from the target * @param {Object} target * @return {Array} Should return an array of layers + * @private * @example * // return example * [ From c1fc87875d1b6942ce6457160d57dcb71e786452 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 18:07:01 +0100 Subject: [PATCH 155/313] Add PropertyStack in docs --- docs/.vuepress/config.js | 1 + docs/api.js | 1 + docs/api/property.md | 4 +- docs/api/property_stack.md | 174 +++++++++++++++++++++++++++++++++++++ 4 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 docs/api/property_stack.md diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 829c5159f..e2649764b 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -77,6 +77,7 @@ module.exports = { ['/api/property_number', `${subDivider}PropertyNumber`], ['/api/property_select', `${subDivider}PropertySelect`], ['/api/property_composite', `${subDivider}PropertyComposite`], + ['/api/property_stack', `${subDivider}PropertyStack`], ['/api/storage_manager', 'Storage Manager'], ['/api/device_manager', 'Device Manager'], ['/api/device', `${subDivider}Device`], diff --git a/docs/api.js b/docs/api.js index 6f2b71d56..ca9e81726 100644 --- a/docs/api.js +++ b/docs/api.js @@ -26,6 +26,7 @@ async function generateDocs () { ['style_manager/model/PropertyNumber.js', 'property_number.md'], ['style_manager/model/PropertySelect.js', 'property_select.md'], ['style_manager/model/PropertyComposite.js', 'property_composite.md'], + ['style_manager/model/PropertyStack.js', 'property_stack.md'], ['storage_manager/index.js', 'storage_manager.md'], ['device_manager/index.js', 'device_manager.md'], ['device_manager/model/Device.js', 'device.md'], diff --git a/docs/api/property.md b/docs/api/property.md index 8ba102c93..228d263c6 100644 --- a/docs/api/property.md +++ b/docs/api/property.md @@ -73,7 +73,9 @@ Get the CSS style object of the property. #### Parameters -* `opts` (optional, default `{}`) +* `opts` **[Object][2]** Options (optional, default `{}`) + + * `opts.camelCase` **[Boolean][3]?** Return property name in camelCase. #### Examples diff --git a/docs/api/property_stack.md b/docs/api/property_stack.md new file mode 100644 index 000000000..3937f0012 --- /dev/null +++ b/docs/api/property_stack.md @@ -0,0 +1,174 @@ + + +## PropertyStack + +**Extends PropertyComposite** + +### Properties + +* `layerSeparator` **([String][1] | [RegExp][2])?** The separator used to split layer values. +* `layerJoin` **[String][1]?** Value used to join layer values. +* `layerLabel` **[Function][3]?** Custom logic for creating the layer value. + +### getLayers + +Get all available layers. + +Returns **Collection<[Layer]>** + +### getLayer + +Get layer by index. + +#### Parameters + +* `index` **[Number][4]** Layer index position. (optional, default `0`) + +#### Examples + +```javascript +// Get the first layer +const layerFirst = property.getLayer(0); +// Get the last layer +const layers = this.getLayers(); +const layerLast = property.getLayer(layers.length - 1); +``` + +Returns **([Layer] | null)** + +### getSelectedLayer + +Get selected layer. + +Returns **([Layer] | null)** + +### selectLayer + +Select layer. +Without a selected layer any update made on inner properties has no effect. + +#### Parameters + +* `layer` **[Layer]** Layer to select + +#### Examples + +```javascript +const layer = property.getLayer(0); +property.selectLayer(layer); +``` + +### selectLayerAt + +Select layer by index. + +#### Parameters + +* `index` **[Number][4]** Index of the layer to select. (optional, default `0`) + +#### Examples + +```javascript +property.selectLayerAt(1); +``` + +### addLayer + +Add new layer to the stack. + +#### Parameters + +* `props` **[Object][5]** Custom property values to use in a new layer. (optional, default `{}`) +* `opts` **[Object][5]** Options (optional, default `{}`) + + * `opts.at` **[Number][4]?** Position index (by default the layer will be appended at the end). + +#### Examples + +```javascript +// Add new layer at the beginning of the stack with custom values +property.addLayer({ 'sub-prop1': 'value1', 'sub-prop2': 'value2' }, { at: 0 }); +``` + +Returns **[Layer]** Added layer. + +### removeLayer + +Remove layer. + +#### Parameters + +* `layer` **[Layer]** Layer to remove. + +#### Examples + +```javascript +const layer = property.getLayer(0); +property.removeLayer(layer); +``` + +Returns **[Layer]** Removed layer + +### removeLayerAt + +Remove layer by index. + +#### Parameters + +* `index` **[Number][4]** Index of the layer to remove (optional, default `0`) + +#### Examples + +```javascript +property.removeLayerAt(0); +``` + +Returns **([Layer] | null)** Removed layer + +### getLayerLabel + +Get layer label. + +#### Parameters + +* `layer` **[Layer]** + +#### Examples + +```javascript +const layer = this.getLayer(1); +const label = this.getLayerLabel(layer); +``` + +Returns **[String][1]** + +### getStyleFromLayer + +Get style object from the layer. + +#### Parameters + +* `layer` **[Layer]** +* `opts` **[Object][5]** Options (optional, default `{}`) + + * `opts.camelCase` **[Boolean][6]?** Return property names in camelCase. + +Returns **[Object][5]** Style object + +### getLayerSeparator + +Get layer separator. + +Returns **[RegExp][2]** + +[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String + +[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp + +[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function + +[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number + +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean From 44de77d2fa3210463ddff38f9262366183e96959 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 18:14:18 +0100 Subject: [PATCH 156/313] Refactor Layer --- src/style_manager/model/Layer.js | 85 +++++++++++++----------- src/style_manager/model/PropertyStack.js | 2 +- 2 files changed, 47 insertions(+), 40 deletions(-) diff --git a/src/style_manager/model/Layer.js b/src/style_manager/model/Layer.js index 5c6b206a9..26b2abee7 100644 --- a/src/style_manager/model/Layer.js +++ b/src/style_manager/model/Layer.js @@ -1,16 +1,44 @@ -import Backbone from 'backbone'; -import Properties from './Properties'; +import { Model } from 'common'; import { camelCase } from 'utils/mixins'; +import Properties from './Properties'; + +export default class Layer extends Model { + defaults() { + return { + index: '', + value: '', + values: {}, + active: false, + preview: false, + properties: [], + }; + } + + /** + * Get layer index. + * @returns {Number} + */ + getIndex() { + const coll = this.collection; + return coll ? coll.indexOf(this) : -1; + } -export default Backbone.Model.extend({ - defaults: { - index: '', - value: '', - values: {}, - active: false, - preview: false, - properties: [], - }, + /** + * Get layer values. + * @param {Object} [opts={}] Options + * @param {Boolean} [opts.camelCase] Return property names in camelCase. + * @returns {Object} + */ + getValues(opts = {}) { + const values = this.get('values'); + + return opts.camelCase + ? Object.keys(values).reduce((res, key) => { + res[camelCase(key)] = values[key]; + return res; + }, {}) + : values; + } initialize() { const prp = this.get('properties'); @@ -32,44 +60,23 @@ export default Backbone.Model.extend({ this.set('value', val.trim()); } - }, - - getValues(opts = {}) { - const values = this.get('values'); - - return opts.camelCase - ? Object.keys(values).reduce((res, key) => { - res[camelCase(key)] = values[key]; - return res; - }, {}) - : values; - }, + } upValues(props = {}) { return this.set('values', { ...this.getValues(), ...props, }); - }, - - getIndex() { - const coll = this.collection; - return coll ? coll.indexOf(this) : -1; - }, + } onPropAdd(prop) { const coll = this.collection; prop.parent = coll && coll.property; - }, + } - /** - * Get property at some index - * @param {Number} index - * @return {Object} - */ getPropertyAt(index) { return this.get('properties').at(index); - }, + } getPropertyValue(property) { let result = ''; @@ -79,11 +86,11 @@ export default Backbone.Model.extend({ } }); return result; - }, + } getFullValue() { let result = []; this.get('properties').each(prop => result.push(prop.getFullValue())); return result.join(' ').trim(); - }, -}); + } +} diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 19c543b8e..bb19f1ac9 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -129,7 +129,7 @@ export default class PropertyStack extends PropertyComposite { } /** - * Get layer label. + * Get the layer label. The label can be customized with the `layerLabel` property. * @param {[Layer]} layer * @returns {String} * @example From 71e6103762ebb4a63d06bdcb551fcec414c02439 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 18:19:50 +0100 Subject: [PATCH 157/313] Add Layer in docs --- docs/.vuepress/config.js | 1 + docs/api.js | 1 + docs/api/layer.md | 25 ++++++++++++++++++++++++ docs/api/property_stack.md | 4 +++- src/style_manager/model/PropertyStack.js | 5 +++++ 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 docs/api/layer.md diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index e2649764b..e643142aa 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -78,6 +78,7 @@ module.exports = { ['/api/property_select', `${subDivider}PropertySelect`], ['/api/property_composite', `${subDivider}PropertyComposite`], ['/api/property_stack', `${subDivider}PropertyStack`], + ['/api/layer', `${subDivider}Layer`], ['/api/storage_manager', 'Storage Manager'], ['/api/device_manager', 'Device Manager'], ['/api/device', `${subDivider}Device`], diff --git a/docs/api.js b/docs/api.js index ca9e81726..a2cc6bdb9 100644 --- a/docs/api.js +++ b/docs/api.js @@ -27,6 +27,7 @@ async function generateDocs () { ['style_manager/model/PropertySelect.js', 'property_select.md'], ['style_manager/model/PropertyComposite.js', 'property_composite.md'], ['style_manager/model/PropertyStack.js', 'property_stack.md'], + ['style_manager/model/Layer.js', 'layer.md'], ['storage_manager/index.js', 'storage_manager.md'], ['device_manager/index.js', 'device_manager.md'], ['device_manager/model/Device.js', 'device.md'], diff --git a/docs/api/layer.md b/docs/api/layer.md new file mode 100644 index 000000000..f682d2226 --- /dev/null +++ b/docs/api/layer.md @@ -0,0 +1,25 @@ + + +## getIndex + +Get layer index. + +Returns **[Number][1]** + +## getValues + +Get layer values. + +### Parameters + +* `opts` **[Object][2]** Options (optional, default `{}`) + + * `opts.camelCase` **[Boolean][3]?** Return property names in camelCase. + +Returns **[Object][2]** + +[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number + +[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean diff --git a/docs/api/property_stack.md b/docs/api/property_stack.md index 3937f0012..e96544873 100644 --- a/docs/api/property_stack.md +++ b/docs/api/property_stack.md @@ -4,6 +4,8 @@ **Extends PropertyComposite** +[Layer]: layer.html + ### Properties * `layerSeparator` **([String][1] | [RegExp][2])?** The separator used to split layer values. @@ -127,7 +129,7 @@ Returns **([Layer] | null)** Removed layer ### getLayerLabel -Get layer label. +Get the layer label. The label can be customized with the `layerLabel` property. #### Parameters diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index bb19f1ac9..44421576a 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -8,10 +8,15 @@ const VALUES_REG = /,(?![^\(]*\))/; const PARTS_REG = /\s(?![^(]*\))/; /** + * + * [Layer]: layer.html + * + * * @typedef PropertyStack * @property {String|RegExp} [layerSeparator=', '] The separator used to split layer values. * @property {String} [layerJoin=', '] Value used to join layer values. * @property {Function} [layerLabel] Custom logic for creating the layer value. + * */ export default class PropertyStack extends PropertyComposite { defaults() { From 2d05d25d7d625280cf63c35dca3494a62bf90995 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 23 Dec 2021 18:34:13 +0100 Subject: [PATCH 158/313] Update StyleManager --- src/style_manager/index.js | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 9bac0a58d..a5dd3aebf 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -57,7 +57,6 @@ export const evCustom = `${evPfx}custom`; const propDef = value => value || value === 0; export default () => { - var c = {}; let properties; var sectors, SectView; @@ -79,22 +78,21 @@ export default () => { /** * Get configuration object + * @name getConfig + * @function * @return {Object} */ - getConfig() { - return c; - }, /** * Initialize module. Automatically called with a new instance of the editor * @param {Object} config Configurations * @private */ - init(config) { - c = { ...defaults, ...config }; - const ppfx = c.pStylePrefix; + init(config = {}) { + this.__initConfig(defaults, config); + const c = this.config; const { em } = c; - this.em = em; + const ppfx = c.pStylePrefix; if (ppfx) c.stylePrefix = ppfx + c.stylePrefix; properties = new Properties(); sectors = new Sectors([], c); @@ -134,7 +132,7 @@ export default () => { onLoad() { // Use silent as sectors' view will be created and rendered on StyleManager.render - sectors.add(c.sectors, { silent: true }); + sectors.add(this.config.sectors, { silent: true }); }, postRender() { @@ -311,7 +309,7 @@ export default () => { * @return {Model} */ getModelToStyle(model, options = {}) { - const em = c.em; + const { em } = this; const { skipAdd } = options; const classes = model.get('classes'); const id = model.getId(); @@ -357,7 +355,7 @@ export default () => { }, getParentRules(target, state) { - const { em } = c; + const { em } = this; let result = []; if (em && target) { @@ -462,12 +460,13 @@ export default () => { * someContainer.appendChild(propView.el); */ createType(id, { model = {}, view = {} } = {}) { + const { config } = this; const type = this.getType(id); if (type) { return new type.view({ model: new type.model(model), - config: c, + config, ...view, }); } @@ -543,12 +542,13 @@ export default () => { * @private * */ render() { + const { config, em } = this; const el = SectView && SectView.el; SectView = new SectorsView({ el, collection: sectors, - target: c.em, - config: c, + target: em, + config, }); return SectView.render().el; }, @@ -644,8 +644,9 @@ export default () => { coll.stopListening(); }); SectView && SectView.remove(); - [c, properties, sectors, SectView].forEach(i => (i = {})); + [properties, sectors, SectView].forEach(i => (i = {})); this.em = {}; + this.config = {}; }, }; }; From 99a107dbc9ad36e34ef4fffb5af6541a6073531d Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 24 Dec 2021 17:57:46 +0100 Subject: [PATCH 159/313] Refactor PropertyFactory --- src/style_manager/index.js | 9 + src/style_manager/model/PropertyFactory.js | 1931 ++++++++++++-------- 2 files changed, 1183 insertions(+), 757 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index a5dd3aebf..dbeb06a63 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -576,10 +576,19 @@ export default () => { }); }, + /** + * Return built-in property definition + * @param {String} prop + * @returns {Object} Property definition + */ getBuiltIn(prop = '') { return this.PropertyFactory.build(prop)[0] || null; }, + getBuiltInAll() {}, + + addBuiltIn(prop, def = {}) {}, + __upProp(prop, style, parentStyles, opts) { const name = prop.getName(); const value = style[name]; diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index 35b433a94..7b142b56a 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -1,771 +1,1188 @@ -export default () => ({ - /** - * Build props object by their name - * @param {Array|string} props Array of properties name - * @return {Array} - */ - build(props) { - var objs = []; - var dftFixedValues = ['initial', 'inherit']; - - if (typeof props === 'string') props = [props]; - - for (var i = 0, len = props.length; i < len; i++) { - var obj = {}; - var prop = props[i]; - obj.property = prop; - - // Property - switch (prop) { - case 'border-radius-c': - obj.property = 'border-radius'; - break; - } +import { isFunction } from 'underscore'; - // Fixed values - switch (prop) { - case 'top': - case 'right': - case 'bottom': - case 'left': - case 'margin-top': - case 'margin-right': - case 'margin-bottom': - case 'margin-left': - case 'padding-top': - case 'padding-right': - case 'padding-bottom': - case 'padding-left': - case 'width': - case 'max-width': - case 'min-width': - case 'height': - case 'max-height': - case 'min-height': - case 'flex-basis': - obj.fixedValues = ['initial', 'inherit', 'auto']; - break; - case 'font-size': - obj.fixedValues = [ - 'medium', - 'xx-small', - 'x-small', - 'small', - 'large', - 'x-large', - 'xx-large', - 'smaller', - 'larger', - 'length', - 'initial', - 'inherit' - ]; - break; - case 'letter-spacing': - case 'line-height': - obj.fixedValues = ['normal', 'initial', 'inherit']; - break; - } +const getOptions = items => items.map(item => ({ id: item })); - // Type - switch (prop) { - case 'float': - case 'position': - case 'text-align': - obj.type = 'radio'; - break; - case 'display': - case 'flex-direction': - case 'flex-wrap': - case 'justify-content': - case 'align-items': - case 'align-content': - case 'align-self': - case 'font-family': - case 'font-weight': - case 'border-style': - case 'box-shadow-type': - case 'background-repeat': - case 'background-position': - case 'background-attachment': - case 'background-size': - case 'transition-property': - case 'transition-timing-function': - case 'cursor': - case 'overflow': - case 'overflow-x': - case 'overflow-y': - obj.type = 'select'; - break; - case 'top': - case 'right': - case 'bottom': - case 'left': - case 'margin-top': - case 'margin-right': - case 'margin-bottom': - case 'margin-left': - case 'padding-top': - case 'padding-right': - case 'padding-bottom': - case 'padding-left': - case 'min-height': - case 'min-width': - case 'max-height': - case 'max-width': - case 'width': - case 'height': - case 'font-size': - case 'letter-spacing': - case 'line-height': - case 'text-shadow-h': - case 'text-shadow-v': - case 'text-shadow-blur': - case 'border-radius-c': - case 'border-top-left-radius': - case 'border-top-right-radius': - case 'border-bottom-left-radius': - case 'border-bottom-right-radius': - case 'border-width': - case 'box-shadow-h': - case 'box-shadow-v': - case 'box-shadow-blur': - case 'box-shadow-spread': - case 'transition-duration': - case 'perspective': - case 'transform-rotate-x': - case 'transform-rotate-y': - case 'transform-rotate-z': - case 'transform-scale-x': - case 'transform-scale-y': - case 'transform-scale-z': - case 'order': - case 'flex-grow': - case 'flex-shrink': - case 'flex-basis': - obj.type = 'integer'; - break; - case 'margin': - case 'padding': - case 'border-radius': - case 'border': - case 'transform': - obj.type = 'composite'; - break; - case 'color': - case 'text-shadow-color': - case 'background-color': - case 'border-color': - case 'box-shadow-color': - obj.type = 'color'; - break; - case 'text-shadow': - case 'box-shadow': - case 'background': - case 'transition': - obj.type = 'stack'; - break; - case 'background-image': - obj.type = 'file'; - break; - } +export default () => { + return { + constructor() { + this.typeNumber = 'integer'; // TODO change + this.typeColor = 'color'; + this.typeRadio = 'radio'; + this.typeSelect = 'select'; + this.typeFile = 'file'; + this.typeComposite = 'composite'; + this.typeStack = 'stack'; + this.unitsSize = ['px', '%', 'em', 'rem', 'vh', 'vw']; + this.unitsSizeNoPerc = ['px', 'em', 'rem', 'vh', 'vw']; + this.unitsTime = ['s', 'ms']; + this.unitsAngle = ['deg', 'rad', 'grad']; + this.fixedValues = ['initial', 'inherit', 'auto']; + const ss = ', sans-serif'; - // Defaults - switch (prop) { - case 'float': - case 'background-color': - case 'text-shadow': - obj.defaults = 'none'; - break; - case 'display': - obj.defaults = 'block'; - break; - case 'flex-direction': - obj.defaults = 'row'; - break; - case 'flex-wrap': - obj.defaults = 'nowrap'; - break; - case 'justify-content': - obj.defaults = 'flex-start'; - break; - case 'align-items': - obj.defaults = 'stretch'; - break; - case 'align-content': - obj.defaults = 'stretch'; - break; - case 'align-self': - obj.defaults = 'auto'; - break; - case 'position': - obj.defaults = 'static'; - break; - case 'margin-top': - case 'margin-right': - case 'margin-bottom': - case 'margin-left': - case 'padding-top': - case 'padding-right': - case 'padding-bottom': - case 'padding-left': - case 'text-shadow-h': - case 'text-shadow-v': - case 'text-shadow-blur': - case 'border-radius-c': - case 'box-shadow-h': - case 'box-shadow-v': - case 'box-shadow-spread': - case 'perspective': - case 'transform-rotate-x': - case 'transform-rotate-y': - case 'transform-rotate-z': - case 'order': - case 'flex-grow': - obj.defaults = 0; - break; - case 'border-top-left-radius': - case 'border-top-right-radius': - case 'border-bottom-left-radius': - case 'border-bottom-right-radius': - obj.defaults = '0px'; - break; - case 'transform-scale-x': - case 'transform-scale-y': - case 'transform-scale-z': - case 'flex-shrink': - obj.defaults = 1; - break; - case 'box-shadow-blur': - obj.defaults = '5px'; - break; - case 'top': - case 'right': - case 'bottom': - case 'left': - case 'min-height': - case 'min-width': - case 'max-height': - case 'max-width': - case 'width': - case 'height': - case 'background-size': - case 'cursor': - case 'flex-basis': - obj.defaults = 'auto'; - break; - case 'font-family': - obj.defaults = 'Arial, Helvetica, sans-serif'; - break; - case 'font-size': - case 'border-width': - obj.defaults = 'medium'; - break; - case 'font-weight': - obj.defaults = '400'; - break; - case 'letter-spacing': - case 'line-height': - obj.defaults = 'normal'; - break; - case 'color': - case 'text-shadow-color': - case 'border-color': - case 'box-shadow-color': - obj.defaults = 'black'; - break; - case 'text-align': - obj.defaults = 'left'; - break; - case 'border-style': - obj.defaults = 'solid'; - break; - case 'box-shadow-type': - obj.defaults = ''; - break; - case 'background-repeat': - obj.defaults = 'repeat'; - break; - case 'background-position': - obj.defaults = 'left top'; - break; - case 'background-attachment': - obj.defaults = 'scroll'; - break; - case 'transition-property': - obj.defaults = 'width'; - break; - case 'transition-duration': - obj.defaults = '2'; - break; - case 'transition-timing-function': - obj.defaults = 'ease'; - break; - case 'overflow': - case 'overflow-x': - case 'overflow-y': - obj.defaults = 'visible'; - break; - } + this.optsBgSize = getOptions(['auto', 'cover', 'contain']); + this.optsBgAttach = getOptions(['scroll', 'fixed', 'local']); + this.optsBgRepeat = getOptions(['repeat', 'repeat-x', 'repeat-y', 'no-repeat']); + this.optsWrap = getOptions(['nowrap', 'wrap', 'wrap-reverse']); + this.optsOverflow = getOptions(['visible', 'hidden', 'scroll', 'auto']); + this.optsDir = getOptions(['row', 'row-reverse', 'column', 'column-reverse']); + this.opstDisplay = getOptions(['block', 'inline', 'inline-block', 'flex', 'none']); + this.optsTransitFn = getOptions(['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out']); + this.optsCursor = getOptions([ + 'auto', + 'pointer', + 'copy', + 'crosshair', + 'grab', + 'grabbing', + 'help', + 'move', + 'text', + ]); + this.optsTransitProp = getOptions([ + 'all', + 'width', + 'height', + 'background-color', + 'transform', + 'box-shadow', + 'opacity', + ]); + this.optsBorderStyle = getOptions([ + 'none', + 'solid', + 'dotted', + 'dashed', + 'double', + 'groove', + 'ridge', + 'inset', + 'outset', + ]); + this.optsBgPos = getOptions([ + 'left top', + 'left center', + 'left bottom', + 'right top', + 'right center', + 'right bottom', + 'center top', + 'center center', + 'center bottom', + ]); + this.optsWeight = [ + { id: '100', label: 'Thin' }, + { id: '200', label: 'Extra-Light' }, + { id: '300', label: 'Light' }, + { id: '400', label: 'Normal' }, + { id: '500', label: 'Medium' }, + { id: '600', label: 'Semi-Bold' }, + { id: '700', label: 'Bold' }, + { id: '800', label: 'Extra-Bold' }, + { id: '900', label: 'Ultra-Bold' }, + ]; + this.optsFonts = [ + 'Arial, Helvetica' + ss, + 'Arial Black, Gadget' + ss, + 'Brush Script MT' + ss, + 'Comic Sans MS, cursive' + ss, + 'Courier New, Courier, monospace', + 'Georgia, serif', + 'Helvetica' + ss, + 'Impact, Charcoal' + ss, + 'Lucida Sans Unicode, Lucida Grande' + ss, + 'Tahoma, Geneva' + ss, + 'Times New Roman, Times, serif', + 'Trebuchet MS, Helvetica' + ss, + 'Verdana, Geneva' + ss, + ].map(font => { + return { id: font, label: font.split(',')[0] }; + }); - /* - * Add styleable dependency on other properties. Allows properties to be - * dynamically hidden or shown based on values of other properties. - * - * Property will be styleable if all of the properties (keys) in the - * requires object have any of the values specified in the array. - */ - switch (prop) { - case 'flex-direction': - case 'flex-wrap': - case 'justify-content': - case 'align-items': - case 'align-content': - obj.requires = { display: ['flex'] }; - break; - case 'order': - case 'flex-basis': - case 'flex-grow': - case 'flex-shrink': - case 'align-self': - obj.requiresParent = { display: ['flex'] }; - break; - } + this.init(); + }, - // Units - switch (prop) { - case 'top': - case 'bottom': - case 'margin-top': - case 'margin-bottom': - case 'padding-top': - case 'padding-bottom': - case 'min-height': - case 'max-height': - case 'height': - obj.units = ['px', '%', 'vh']; - break; - case 'right': - case 'left': - case 'margin-right': - case 'margin-left': - case 'padding-right': - case 'padding-left': - case 'min-width': - case 'max-width': - case 'width': - obj.units = ['px', '%', 'vw']; - break; - case 'flex-basis': - obj.units = ['px', '%', 'vw', 'vh']; - break; - case 'text-shadow-v': - case 'text-shadow-h': - case 'text-shadow-blur': - case 'border-radius-c': - case 'border-top-left-radius': - case 'border-top-right-radius': - case 'border-bottom-left-radius': - case 'border-bottom-right-radius': - case 'box-shadow-h': - case 'box-shadow-v': - obj.units = ['px', '%']; - break; - case 'font-size': - case 'letter-spacing': - case 'line-height': - obj.units = ['px', 'em', 'rem', '%']; - break; - case 'border-width': - obj.units = ['px', 'em']; - break; - case 'box-shadow-blur': - case 'box-shadow-spread': - case 'perspective': - obj.units = ['px']; - break; - case 'transition-duration': - obj.units = ['s']; - break; - case 'transform-rotate-x': - case 'transform-rotate-y': - case 'transform-rotate-z': - obj.units = ['deg']; - break; - } + __sub(items) { + return () => items.map(p => this.get(p)); + }, - // Min/Max - switch (prop) { - case 'padding-top': - case 'padding-right': - case 'padding-bottom': - case 'padding-left': - case 'min-height': - case 'min-width': - case 'max-height': - case 'max-width': - case 'width': - case 'height': - case 'font-size': - case 'text-shadow-blur': - case 'border-radius-c': - case 'border-top-left-radius': - case 'border-top-right-radius': - case 'border-bottom-left-radius': - case 'border-bottom-right-radius': - case 'border-width': - case 'box-shadow-blur': - case 'transition-duration': - case 'perspective': - case 'flex-basis': - obj.min = 0; - break; - } + init() { + this.props = {}; + const requireFlex = { display: ['flex'] }; + const optsFlex = [{ id: 'flex-start' }, { id: 'flex-end' }, { id: 'center' }]; + const optsFlexAlign = [...optsFlex, { id: 'baseline' }, { id: 'stretch' }]; - // Preview - switch (prop) { - case 'text-shadow': - case 'box-shadow': - case 'background': - obj.preview = true; - break; - } + // Build default built-in properties (the order, in the array here below, matters) + // [propertyName, propertyDefinition, extendFromProperty] + [ + // Number types + [ + 'top', + { + type: this.typeNumber, + default: 'auto', + units: this.unitsSize, + fixedValues: this.fixedValues, + }, + ], + ['right', {}, 'top'], + ['bottom', {}, 'top'], + ['margin-top', { default: '0' }, 'top'], + ['margin-right', {}, 'margin-top'], + ['margin-bottom', {}, 'margin-top'], + ['margin-left', {}, 'margin-top'], + ['padding-top', { min: 0 }, 'margin-top'], + ['padding-right', {}, 'padding-top'], + ['padding-bottom', {}, 'padding-top'], + ['padding-left', {}, 'padding-top'], + ['width', { min: 0 }, 'top'], + ['min-width', {}, 'width'], + ['max-width', {}, 'width'], + ['height', {}, 'width'], + ['min-height', {}, 'width'], + ['max-height', {}, 'width'], + ['flex-basis', { requiresParent: requireFlex }, 'width'], + [ + 'font-size', + { + defaults: 'medium', + fixedValues: [ + 'medium', + 'xx-small', + 'x-small', + 'small', + 'large', + 'x-large', + 'xx-large', + 'smaller', + 'larger', + 'length', + 'initial', + 'inherit', + ], + }, + 'width', + ], + [ + 'letter-spacing', + { + defaults: 'normal', + fixedValues: ['normal', 'initial', 'inherit'], + }, + 'top', + ], + ['line-height', {}, 'letter-spacing'], + [ + 'float', + { + type: this.typeRadio, + default: 'none', + options: [{ id: 'none' }, { id: 'left' }, { id: 'right' }], + }, + ], + [ + 'position', + { + default: 'static', + options: [{ id: 'static' }, { id: 'relative' }, { id: 'absolute' }, { id: 'fixed' }], // TODO sticky + }, + 'float', + ], + [ + 'text-align', + { + default: 'left', + options: [{ id: 'left' }, { id: 'center' }, { id: 'right' }, { id: 'justify' }], + }, + 'float', + ], + ['text-shadow-h', { default: '0', units: this.unitsSizeNoPerc }, 'top'], + ['text-shadow-v', {}, 'text-shadow-h'], + ['text-shadow-blur', { min: 0 }, 'text-shadow-h'], + ['border-radius-c', {}, 'padding-top'], + ['border-top-left-radius', {}, 'padding-top'], + ['border-top-right-radius', {}, 'padding-top'], + ['border-bottom-left-radius', {}, 'padding-top'], + ['border-bottom-right-radius', {}, 'padding-top'], + ['border-width', { default: '0', units: this.unitsSizeNoPerc }, 'padding-top'], + ['box-shadow-h', {}, 'text-shadow-h'], + ['box-shadow-v', {}, 'text-shadow-h'], + ['box-shadow-blur', { default: '5px' }, 'text-shadow-blur'], + ['box-shadow-spread', {}, 'text-shadow-h'], + ['transition-duration', { default: '2', units: this.unitsTime }, 'padding-top'], + ['perspective', {}, 'padding-top'], + ['transform-rotate-x', { functionName: 'rotateX', units: this.unitsAngle }, 'margin-top'], + ['transform-rotate-y', { functionName: 'rotateY' }, 'transform-rotate-x'], + ['transform-rotate-z', { functionName: 'rotateZ' }, 'transform-rotate-x'], + ['transform-scale-x', { default: '1', functionName: 'scaleX', units: [] }, 'transform-rotate-x'], + ['transform-scale-y', { functionName: 'scaleY' }, 'transform-scale-x'], + ['transform-scale-z', { functionName: 'scaleZ' }, 'transform-scale-x'], + ['order', { type: this.typeNumber, default: '0', requiresParent: requireFlex }], + ['flex-grow', {}, 'order'], + ['flex-shrink', { default: '1' }, 'order'], - // Detached - switch (prop) { - case 'background': - obj.detached = true; - break; - } + // Color types + ['color', { type: this.typeColor, default: 'black' }], + ['text-shadow-color', {}, 'color'], + ['border-color', {}, 'color'], + ['box-shadow-color', {}, 'color'], + ['background-color', { default: 'none' }, 'color'], - // Functions - switch (prop) { - case 'transform-rotate-x': - obj.functionName = 'rotateX'; - break; - case 'transform-rotate-y': - obj.functionName = 'rotateY'; - break; - case 'transform-rotate-z': - obj.functionName = 'rotateZ'; - break; - case 'transform-scale-x': - obj.functionName = 'scaleX'; - break; - case 'transform-scale-y': - obj.functionName = 'scaleY'; - break; - case 'transform-scale-z': - obj.functionName = 'scaleZ'; - break; - case 'background-image': - obj.functionName = 'url'; - break; - } + // File type + ['background-image', { type: this.typeFile, functionName: 'url' }], - // Options - switch (prop) { - case 'float': - obj.list = [{ value: 'none' }, { value: 'left' }, { value: 'right' }]; - break; - case 'display': - obj.list = [ - { value: 'block' }, - { value: 'inline' }, - { value: 'inline-block' }, - { value: 'flex' }, - { value: 'none' } - ]; - break; - case 'flex-direction': - obj.list = [ - { value: 'row' }, - { value: 'row-reverse' }, - { value: 'column' }, - { value: 'column-reverse' } - ]; - break; - case 'flex-wrap': - obj.list = [ - { value: 'nowrap' }, - { value: 'wrap' }, - { value: 'wrap-reverse' } - ]; - break; - case 'justify-content': - obj.list = [ - { value: 'flex-start' }, - { value: 'flex-end' }, - { value: 'center' }, - { value: 'space-between' }, - { value: 'space-around' }, - { value: 'space-evenly' } - ]; - break; - case 'align-items': - obj.list = [ - { value: 'flex-start' }, - { value: 'flex-end' }, - { value: 'center' }, - { value: 'baseline' }, - { value: 'stretch' } - ]; - break; - case 'align-content': - obj.list = [ - { value: 'flex-start' }, - { value: 'flex-end' }, - { value: 'center' }, - { value: 'space-between' }, - { value: 'space-around' }, - { value: 'stretch' } - ]; - break; - case 'align-self': - obj.list = [ - { value: 'auto' }, - { value: 'flex-start' }, - { value: 'flex-end' }, - { value: 'center' }, - { value: 'baseline' }, - { value: 'stretch' } - ]; - break; - case 'position': - obj.list = [ - { value: 'static' }, - { value: 'relative' }, - { value: 'absolute' }, - { value: 'fixed' } - ]; - break; - case 'font-family': - var ss = ', sans-serif'; - var fonts = [ - 'Arial, Helvetica' + ss, - 'Arial Black, Gadget' + ss, - 'Brush Script MT' + ss, - 'Comic Sans MS, cursive' + ss, - 'Courier New, Courier, monospace', - 'Georgia, serif', - 'Helvetica' + ss, - 'Impact, Charcoal' + ss, - 'Lucida Sans Unicode, Lucida Grande' + ss, - 'Tahoma, Geneva' + ss, - 'Times New Roman, Times, serif', - 'Trebuchet MS, Helvetica' + ss, - 'Verdana, Geneva' + ss - ]; - obj.list = []; - for (var j = 0, l = fonts.length; j < l; j++) { - var font = {}; - font.value = fonts[j]; - font.name = fonts[j].split(',')[0]; - obj.list.push(font); - } - break; - case 'font-weight': - obj.list = [ - { value: '100', name: 'Thin' }, - { value: '200', name: 'Extra-Light' }, - { value: '300', name: 'Light' }, - { value: '400', name: 'Normal' }, - { value: '500', name: 'Medium' }, - { value: '600', name: 'Semi-Bold' }, - { value: '700', name: 'Bold' }, - { value: '800', name: 'Extra-Bold' }, - { value: '900', name: 'Ultra-Bold' } - ]; - break; - case 'text-align': - obj.list = [ - { value: 'left' }, - { value: 'center' }, - { value: 'right' }, - { value: 'justify' } - ]; - break; - case 'border-style': - obj.list = [ - { value: 'none' }, - { value: 'solid' }, - { value: 'dotted' }, - { value: 'dashed' }, - { value: 'double' }, - { value: 'groove' }, - { value: 'ridge' }, - { value: 'inset' }, - { value: 'outset' } - ]; - break; - case 'box-shadow-type': - obj.list = [ - { value: '', name: 'Outside' }, - { value: 'inset', name: 'Inside' } - ]; - break; - case 'background-repeat': - obj.list = [ - { value: 'repeat' }, - { value: 'repeat-x' }, - { value: 'repeat-y' }, - { value: 'no-repeat' } - ]; - break; - case 'background-position': - obj.list = [ - { value: 'left top' }, - { value: 'left center' }, - { value: 'left bottom' }, - { value: 'right top' }, - { value: 'right center' }, - { value: 'right bottom' }, - { value: 'center top' }, - { value: 'center center' }, - { value: 'center bottom' } - ]; - break; - case 'background-attachment': - obj.list = [ - { value: 'scroll' }, - { value: 'fixed' }, - { value: 'local' } - ]; - break; - case 'background-size': - obj.list = [ - { value: 'auto' }, - { value: 'cover' }, - { value: 'contain' } - ]; - break; - case 'transition-property': - obj.list = [ - { value: 'all' }, - { value: 'width' }, - { value: 'height' }, - { value: 'background-color' }, - { value: 'transform' }, - { value: 'box-shadow' }, - { value: 'opacity' } - ]; - break; - case 'transition-timing-function': - obj.list = [ - { value: 'linear' }, - { value: 'ease' }, - { value: 'ease-in' }, - { value: 'ease-out' }, - { value: 'ease-in-out' } - ]; - break; - case 'cursor': - obj.list = [ - { value: 'auto' }, - { value: 'pointer' }, - { value: 'copy' }, - { value: 'crosshair' }, - { value: 'grab' }, - { value: 'grabbing' }, - { value: 'help' }, - { value: 'move' }, - { value: 'text' } - ]; - break; - case 'overflow': - case 'overflow-x': - case 'overflow-y': - obj.list = [ - { value: 'visible' }, - { value: 'hidden' }, - { value: 'scroll' }, - { value: 'auto' } - ]; - break; - } + // Select types + [ + 'display', + { + type: this.typeSelect, + default: 'block', + options: this.opstDisplay, + }, + ], + ['flex-direction', { default: 'row', options: this.optsDir, requires: requireFlex }, 'display'], + ['flex-wrap', { default: 'nowrap', options: this.optsWrap }, 'flex-direction'], + [ + 'justify-content', + { + default: 'flex-start', + options: [...optsFlex, { id: 'space-between' }, { id: 'space-around' }, { id: 'space-evenly' }], + }, + 'flex-wrap', + ], + ['align-items', { default: 'stretch', options: optsFlexAlign }, 'flex-wrap'], + [ + 'align-content', + { + options: [...optsFlex, { id: 'space-between' }, { id: 'space-around' }, { id: 'stretch' }], + }, + 'align-items', + ], + [ + 'align-self', + { + default: 'auto', + options: [{ id: 'auto' }, ...optsFlexAlign], + requiresParent: requireFlex, + }, + 'align-items', + ], + ['font-family', { default: 'Arial, Helvetica, sans-serif', options: this.optsFonts }, 'display'], + ['font-weight', { default: '400', options: this.optsWeight }, 'display'], + ['border-style', { default: 'solid', options: this.optsBorderStyle }, 'display'], + [ + 'box-shadow-type', + { + default: '', + options: [ + { id: '', label: 'Outside' }, + { id: 'inset', label: 'Inside' }, + ], + }, + 'display', + ], + ['background-repeat', { default: 'repeat', options: this.optsBgRepeat }, 'display'], + ['background-position', { default: 'left top', options: this.optsBgPos }, 'display'], + ['background-attachment', { default: 'scroll', options: this.optsBgAttach }, 'display'], + ['background-size', { default: 'auto', options: this.optsBgSize }, 'display'], + ['transition-property', { default: 'width', options: this.optsTransitProp }, 'display'], + ['transition-timing-function', { default: 'ease', options: this.optsTransitFn }, 'display'], + ['cursor', { default: 'auto', options: this.optsCursor }, 'display'], + ['overflow', { default: 'visible', options: this.optsOverflow }, 'display'], + ['overflow-x', {}, 'overflow'], + ['overflow-y', {}, 'overflow'], + + // Composite types + [ + 'margin', + { + type: this.typeComposite, + properties: this.__sub(['margin-top', 'margin-right', 'margin-bottom', 'margin-left']), + }, + ], + [ + 'padding', + { + properties: this.__sub(['padding-top', 'padding-right', 'padding-bottom', 'padding-left']), + }, + 'margin', + ], + [ + 'border', + { + properties: this.__sub(['border-width', 'border-style', 'border-color']), + }, + 'margin', + ], + [ + 'border-radius', + { + properties: this.__sub([ + 'border-top-left-radius', + 'border-top-right-radius', + 'border-bottom-right-radius', + 'border-bottom-left-radius', + ]), + }, + 'margin', + ], + [ + 'transform', + { + properties: this.__sub([ + 'transform-rotate-x', + 'transform-rotate-y', + 'transform-rotate-z', + 'transform-scale-x', + 'transform-scale-y', + 'transform-scale-z', + ]), + }, + 'margin', + ], - // Properties - switch (prop) { - case 'margin': - obj.properties = this.build([ - 'margin-top', - 'margin-right', - 'margin-bottom', - 'margin-left' - ]); - break; - case 'padding': - obj.properties = this.build([ - 'padding-top', - 'padding-right', - 'padding-bottom', - 'padding-left' - ]); - break; - case 'text-shadow': - obj.properties = this.build([ - 'text-shadow-h', - 'text-shadow-v', - 'text-shadow-blur', - 'text-shadow-color' - ]); - break; - case 'border': - obj.properties = this.build([ - 'border-width', - 'border-style', - 'border-color' - ]); - break; - case 'border-radius': - obj.properties = this.build([ - 'border-top-left-radius', - 'border-top-right-radius', - 'border-bottom-right-radius', - 'border-bottom-left-radius' - ]); - break; - case 'box-shadow': - obj.properties = this.build([ - 'box-shadow-h', - 'box-shadow-v', - 'box-shadow-blur', - 'box-shadow-spread', - 'box-shadow-color', - 'box-shadow-type' - ]); - break; - case 'background': - obj.properties = this.build([ - 'background-image', - 'background-repeat', - 'background-position', - 'background-attachment', - 'background-size' - ]); - break; - case 'transition': - obj.properties = this.build([ - 'transition-property', - 'transition-duration', - 'transition-timing-function' - ]); - break; - case 'transform': - obj.properties = this.build([ - 'transform-rotate-x', - 'transform-rotate-y', - 'transform-rotate-z', - 'transform-scale-x', - 'transform-scale-y', - 'transform-scale-z' - ]); - break; + // Stack types + [ + 'transition', + { + type: this.typeStack, + properties: this.__sub(['transition-property', 'transition-duration', 'transition-timing-function']), + }, + ], + [ + 'box-shadow', + { + preview: true, + properties: this.__sub([ + 'box-shadow-h', + 'box-shadow-v', + 'box-shadow-blur', + 'box-shadow-spread', + 'box-shadow-color', + 'box-shadow-type', + ]), + }, + 'transition', + ], + [ + 'text-shadow', + { + default: 'none', + properties: this.__sub(['text-shadow-h', 'text-shadow-v', 'text-shadow-blur', 'text-shadow-color']), + }, + 'box-shadow', + ], + [ + 'background', + { + detached: true, + properties: this.__sub([ + 'background-image', + 'background-repeat', + 'background-position', + 'background-attachment', + 'background-size', + ]), + }, + 'box-shadow', + ], + ].forEach(([prop, def, from]) => { + this.add(prop, def || {}, { from }); + }); + + return this; + }, + + add(property, def = {}, opts = {}) { + const from = opts.from || ''; + const fromRes = this.props[from || property] || {}; + const result = { ...fromRes, property, ...def }; + if (result.properties && isFunction(result.properties)) { + result.properties = result.properties(); } + this.props[property] = result; + }, + + get(prop) { + return this.props[prop] || null; + }, + + /** + * Build props object by their name + * @param {Array|string} props Array of properties name + * @return {Array} + */ + build(props) { + var objs = []; + // var dftFixedValues = ['initial', 'inherit']; - objs.push(obj); - } + if (typeof props === 'string') props = [props]; + + for (var i = 0, len = props.length; i < len; i++) { + var obj = {}; + var prop = props[i]; + obj.property = prop; + + // Property + // switch (prop) { + // // case 'border-radius-c': + // // obj.property = 'border-radius'; + // // break; + // } + + // Fixed values + // switch (prop) { + // // case 'top': + // // case 'right': + // // case 'bottom': + // // case 'left': + // // case 'margin-top': + // // case 'margin-right': + // // case 'margin-bottom': + // // case 'margin-left': + // // case 'padding-top': + // // case 'padding-right': + // // case 'padding-bottom': + // // case 'padding-left': + // // case 'width': + // // case 'max-width': + // // case 'min-width': + // // case 'height': + // // case 'max-height': + // // case 'min-height': + // // case 'flex-basis': + // case 'n': + // obj.fixedValues = ['initial', 'inherit', 'auto']; + // break; + // // case 'font-size': + // case 'n': + // obj.fixedValues = [ + // 'medium', + // 'xx-small', + // 'x-small', + // 'small', + // 'large', + // 'x-large', + // 'xx-large', + // 'smaller', + // 'larger', + // 'length', + // 'initial', + // 'inherit' + // ]; + // break; + // // case 'letter-spacing': + // // case 'line-height': + // case 'n': + // obj.fixedValues = ['normal', 'initial', 'inherit']; + // break; + // } + + // Type + switch ( + prop + // case 'float': + // case 'position': + // case 'text-align': + // obj.type = 'radio'; + // break; + // case 'display': + // case 'flex-direction': + // case 'flex-wrap': + // case 'justify-content': + // case 'align-items': + // case 'align-content': + // case 'align-self': + // case 'font-family': + // case 'font-weight': + // case 'border-style': + // case 'box-shadow-type': + // case 'background-repeat': + // case 'background-position': + // case 'background-attachment': + // case 'background-size': + // case 'transition-property': + // case 'transition-timing-function': + // case 'cursor': + // case 'overflow': + // case 'overflow-x': + // case 'overflow-y': + // obj.type = 'select'; + // break; + // case 'top': + // case 'right': + // case 'bottom': + // case 'left': + // case 'margin-top': + // case 'margin-right': + // case 'margin-bottom': + // case 'margin-left': + // case 'padding-top': + // case 'padding-right': + // case 'padding-bottom': + // case 'padding-left': + // case 'min-height': + // case 'min-width': + // case 'max-height': + // case 'max-width': + // case 'width': + // case 'height': + // case 'font-size': + // case 'letter-spacing': + // case 'line-height': + // case 'text-shadow-h': + // case 'text-shadow-v': + // case 'text-shadow-blur': + // case 'border-radius-c': + // case 'border-top-left-radius': + // case 'border-top-right-radius': + // case 'border-bottom-left-radius': + // case 'border-bottom-right-radius': + // case 'border-width': + // case 'box-shadow-h': + // case 'box-shadow-v': + // case 'box-shadow-blur': + // case 'box-shadow-spread': + // case 'transition-duration': + // case 'perspective': + // case 'transform-rotate-x': + // case 'transform-rotate-y': + // case 'transform-rotate-z': + // case 'transform-scale-x': + // case 'transform-scale-y': + // case 'transform-scale-z': + // case 'order': + // case 'flex-grow': + // case 'flex-shrink': + // case 'flex-basis': + // obj.type = 'integer'; + // break; + // case 'margin': + // case 'padding': + // case 'border-radius': + // case 'border': + // case 'transform': + // obj.type = 'composite'; + // break; + // case 'color': + // case 'text-shadow-color': + // case 'background-color': + // case 'border-color': + // case 'box-shadow-color': + // obj.type = 'color'; + // break; + // case 'text-shadow': + // case 'box-shadow': + // case 'background': + // case 'transition': + // obj.type = 'stack'; + // break; + // case 'background-image': + // obj.type = 'file'; + // break; + ) { + } + + // Defaults + switch ( + prop + // case 'float': + // case 'background-color': + // case 'text-shadow': + // obj.defaults = 'none'; + // break; + // // case 'display': + // obj.defaults = 'block'; + // break; + // // case 'flex-direction': + // obj.defaults = 'row'; + // break; + // // case 'flex-wrap': + // obj.defaults = 'nowrap'; + // break; + // // case 'justify-content': + // obj.defaults = 'flex-start'; + // break; + // // case 'align-items': + // obj.defaults = 'stretch'; + // break; + // // case 'align-content': + // obj.defaults = 'stretch'; + // break; + // // case 'align-self': + // obj.defaults = 'auto'; + // break; + // // case 'position': + // obj.defaults = 'static'; + // break; + // case 'margin-top': + // case 'margin-right': + // case 'margin-bottom': + // case 'margin-left': + // case 'padding-top': + // case 'padding-right': + // case 'padding-bottom': + // case 'padding-left': + // case 'text-shadow-h': + // case 'text-shadow-v': + // case 'text-shadow-blur': + // case 'border-radius-c': + // case 'box-shadow-h': + // case 'box-shadow-v': + // case 'box-shadow-spread': + // case 'perspective': + // case 'transform-rotate-x': + // case 'transform-rotate-y': + // case 'transform-rotate-z': + // case 'order': + // case 'flex-grow': + // obj.defaults = 0; + // break; + // case 'border-top-left-radius': + // case 'border-top-right-radius': + // case 'border-bottom-left-radius': + // case 'border-bottom-right-radius': + // obj.defaults = '0px'; + // break; + // case 'transform-scale-x': + // case 'transform-scale-y': + // case 'transform-scale-z': + // case 'flex-shrink': + // obj.defaults = 1; + // break; + // case 'box-shadow-blur': + // obj.defaults = '5px'; + // break; + // case 'top': + // case 'right': + // case 'bottom': + // case 'left': + // case 'min-height': + // case 'min-width': + // case 'max-height': + // case 'max-width': + // case 'width': + // case 'height': + // case 'background-size': + // case 'cursor': + // case 'flex-basis': + // obj.defaults = 'auto'; + // break; + // // case 'font-family': + // obj.defaults = 'Arial, Helvetica, sans-serif'; + // break; + // // case 'font-size': + // // case 'border-width': + // obj.defaults = 'medium'; + // break; + // // case 'font-weight': + // obj.defaults = '400'; + // break; + // // case 'letter-spacing': + // // case 'line-height': + // obj.defaults = 'normal'; + // break; + // case 'color': + // case 'text-shadow-color': + // case 'border-color': + // case 'box-shadow-color': + // obj.defaults = 'black'; + // break; + // case 'text-align': + // obj.defaults = 'left'; + // break; + // case 'border-style': + // obj.defaults = 'solid'; + // break; + // // case 'box-shadow-type': + // obj.defaults = ''; + // break; + // // case 'background-repeat': + // obj.defaults = 'repeat'; + // break; + // // case 'background-position': + // obj.defaults = 'left top'; + // break; + // // case 'background-attachment': + // obj.defaults = 'scroll'; + // break; + // // case 'transition-property': + // obj.defaults = 'width'; + // break; + // // case 'transition-duration': + // obj.defaults = '2'; + // break; + // // case 'transition-timing-function': + // obj.defaults = 'ease'; + // break; + // // case 'overflow': + // // case 'overflow-x': + // // case 'overflow-y': + // obj.defaults = 'visible'; + // break; + ) { + } + + /* + * Add styleable dependency on other properties. Allows properties to be + * dynamically hidden or shown based on values of other properties. + * + * Property will be styleable if all of the properties (keys) in the + * requires object have any of the values specified in the array. + */ + // switch (prop) { + // // case 'flex-direction': + // // case 'flex-wrap': + // // case 'justify-content': + // // case 'align-items': + // // case 'align-content': + // // obj.requires = { display: ['flex'] }; + // // break; + // // case 'order': + // // case 'flex-basis': + // // case 'flex-grow': + // // case 'flex-shrink': + // // case 'align-self': + // // obj.requiresParent = { display: ['flex'] }; + // // break; + // } + + // Units + // switch (prop) { + // case 'top': + // case 'bottom': + // case 'margin-top': + // case 'margin-bottom': + // case 'padding-top': + // case 'padding-bottom': + // case 'min-height': + // case 'max-height': + // case 'height': + // obj.units = ['px', '%', 'vh']; + // break; + // case 'right': + // case 'left': + // case 'margin-right': + // case 'margin-left': + // case 'padding-right': + // case 'padding-left': + // case 'min-width': + // case 'max-width': + // case 'width': + // obj.units = ['px', '%', 'vw']; + // break; + // case 'flex-basis': + // obj.units = ['px', '%', 'vw', 'vh']; + // break; + // case 'text-shadow-v': + // case 'text-shadow-h': + // case 'text-shadow-blur': + // case 'border-radius-c': + // case 'border-top-left-radius': + // case 'border-top-right-radius': + // case 'border-bottom-left-radius': + // case 'border-bottom-right-radius': + // case 'box-shadow-h': + // case 'box-shadow-v': + // obj.units = ['px', '%']; + // break; + // case 'font-size': + // case 'letter-spacing': + // case 'line-height': + // obj.units = ['px', 'em', 'rem', '%']; + // break; + // case 'border-width': + // obj.units = ['px', 'em']; + // break; + // case 'box-shadow-blur': + // case 'box-shadow-spread': + // case 'perspective': + // obj.units = ['px']; + // break; + // case 'transition-duration': + // obj.units = ['s']; + // break; + // case 'transform-rotate-x': + // case 'transform-rotate-y': + // case 'transform-rotate-z': + // obj.units = ['deg']; + // break; + // } + + // Min/Max + // switch (prop) { + // case 'padding-top': + // case 'padding-right': + // case 'padding-bottom': + // case 'padding-left': + // case 'min-height': + // case 'min-width': + // case 'max-height': + // case 'max-width': + // case 'width': + // case 'height': + // case 'font-size': + // case 'text-shadow-blur': + // case 'border-radius-c': + // case 'border-top-left-radius': + // case 'border-top-right-radius': + // case 'border-bottom-left-radius': + // case 'border-bottom-right-radius': + // case 'border-width': + // case 'box-shadow-blur': + // case 'transition-duration': + // case 'perspective': + // case 'flex-basis': + // obj.min = 0; + // break; + // } + + // Preview + // switch (prop) { + // case 'text-shadow': + // case 'box-shadow': + // case 'background': + // obj.preview = true; + // break; + // } + + // Detached + // switch (prop) { + // case 'background': + // obj.detached = true; + // break; + // } + + // Functions + // switch (prop) { + // // // case 'transform-rotate-x': + // // obj.functionName = 'rotateX'; + // // break; + // // // case 'transform-rotate-y': + // // obj.functionName = 'rotateY'; + // // break; + // // // case 'transform-rotate-z': + // // obj.functionName = 'rotateZ'; + // // break; + // // // case 'transform-scale-x': + // // obj.functionName = 'scaleX'; + // // break; + // // // case 'transform-scale-y': + // // obj.functionName = 'scaleY'; + // // break; + // // // case 'transform-scale-z': + // // obj.functionName = 'scaleZ'; + // // break; + // // case 'background-image': + // // obj.functionName = 'url'; + // // break; + // } + + // Options + // switch (prop) { + // case 'float': + // obj.list = [{ value: 'none' }, { value: 'left' }, { value: 'right' }]; + // break; + // case 'display': + // obj.list = [ + // { value: 'block' }, + // { value: 'inline' }, + // { value: 'inline-block' }, + // { value: 'flex' }, + // { value: 'none' } + // ]; + // break; + // case 'flex-direction': + // obj.list = [ + // { value: 'row' }, + // { value: 'row-reverse' }, + // { value: 'column' }, + // { value: 'column-reverse' } + // ]; + // break; + // case 'flex-wrap': + // obj.list = [ + // { value: 'nowrap' }, + // { value: 'wrap' }, + // { value: 'wrap-reverse' } + // ]; + // break; + // case 'justify-content': + // obj.list = [ + // { value: 'flex-start' }, + // { value: 'flex-end' }, + // { value: 'center' }, + // { value: 'space-between' }, + // { value: 'space-around' }, + // { value: 'space-evenly' } + // ]; + // break; + // case 'align-items': + // obj.list = [ + // { value: 'flex-start' }, + // { value: 'flex-end' }, + // { value: 'center' }, + // { value: 'baseline' }, + // { value: 'stretch' } + // ]; + // break; + // case 'align-content': + // obj.list = [ + // { value: 'flex-start' }, + // { value: 'flex-end' }, + // { value: 'center' }, + // { value: 'space-between' }, + // { value: 'space-around' }, + // { value: 'stretch' } + // ]; + // break; + // case 'align-self': + // obj.list = [ + // { value: 'auto' }, + // { value: 'flex-start' }, + // { value: 'flex-end' }, + // { value: 'center' }, + // { value: 'baseline' }, + // { value: 'stretch' } + // ]; + // break; + // case 'position': + // obj.list = [ + // { value: 'static' }, + // { value: 'relative' }, + // { value: 'absolute' }, + // { value: 'fixed' } + // ]; + // break; + // case 'font-family': + // var ss = ', sans-serif'; + // var fonts = [ + // 'Arial, Helvetica' + ss, + // 'Arial Black, Gadget' + ss, + // 'Brush Script MT' + ss, + // 'Comic Sans MS, cursive' + ss, + // 'Courier New, Courier, monospace', + // 'Georgia, serif', + // 'Helvetica' + ss, + // 'Impact, Charcoal' + ss, + // 'Lucida Sans Unicode, Lucida Grande' + ss, + // 'Tahoma, Geneva' + ss, + // 'Times New Roman, Times, serif', + // 'Trebuchet MS, Helvetica' + ss, + // 'Verdana, Geneva' + ss + // ]; + // obj.list = []; + // for (var j = 0, l = fonts.length; j < l; j++) { + // var font = {}; + // font.value = fonts[j]; + // font.name = fonts[j].split(',')[0]; + // obj.list.push(font); + // } + // break; + // case 'font-weight': + // obj.list = [ + // { value: '100', name: 'Thin' }, + // { value: '200', name: 'Extra-Light' }, + // { value: '300', name: 'Light' }, + // { value: '400', name: 'Normal' }, + // { value: '500', name: 'Medium' }, + // { value: '600', name: 'Semi-Bold' }, + // { value: '700', name: 'Bold' }, + // { value: '800', name: 'Extra-Bold' }, + // { value: '900', name: 'Ultra-Bold' } + // ]; + // break; + // case 'text-align': + // obj.list = [ + // { value: 'left' }, + // { value: 'center' }, + // { value: 'right' }, + // { value: 'justify' } + // ]; + // break; + // case 'border-style': + // obj.list = [ + // { value: 'none' }, + // { value: 'solid' }, + // { value: 'dotted' }, + // { value: 'dashed' }, + // { value: 'double' }, + // { value: 'groove' }, + // { value: 'ridge' }, + // { value: 'inset' }, + // { value: 'outset' } + // ]; + // break; + // case 'box-shadow-type': + // obj.list = [ + // { value: '', name: 'Outside' }, + // { value: 'inset', name: 'Inside' } + // ]; + // break; + // case 'background-repeat': + // obj.list = [ + // { value: 'repeat' }, + // { value: 'repeat-x' }, + // { value: 'repeat-y' }, + // { value: 'no-repeat' } + // ]; + // break; + // case 'background-position': + // obj.list = [ + // { value: 'left top' }, + // { value: 'left center' }, + // { value: 'left bottom' }, + // { value: 'right top' }, + // { value: 'right center' }, + // { value: 'right bottom' }, + // { value: 'center top' }, + // { value: 'center center' }, + // { value: 'center bottom' } + // ]; + // break; + // case 'background-attachment': + // obj.list = [ + // { value: 'scroll' }, + // { value: 'fixed' }, + // { value: 'local' } + // ]; + // break; + // case 'background-size': + // obj.list = [ + // { value: 'auto' }, + // { value: 'cover' }, + // { value: 'contain' } + // ]; + // break; + // case 'transition-property': + // obj.list = [ + // { value: 'all' }, + // { value: 'width' }, + // { value: 'height' }, + // { value: 'background-color' }, + // { value: 'transform' }, + // { value: 'box-shadow' }, + // { value: 'opacity' } + // ]; + // break; + // case 'transition-timing-function': + // obj.list = [ + // { value: 'linear' }, + // { value: 'ease' }, + // { value: 'ease-in' }, + // { value: 'ease-out' }, + // { value: 'ease-in-out' } + // ]; + // break; + // case 'cursor': + // obj.list = [ + // { value: 'auto' }, + // { value: 'pointer' }, + // { value: 'copy' }, + // { value: 'crosshair' }, + // { value: 'grab' }, + // { value: 'grabbing' }, + // { value: 'help' }, + // { value: 'move' }, + // { value: 'text' } + // ]; + // break; + // case 'overflow': + // case 'overflow-x': + // case 'overflow-y': + // obj.list = [ + // { value: 'visible' }, + // { value: 'hidden' }, + // { value: 'scroll' }, + // { value: 'auto' } + // ]; + // break; + // } + + // Properties + switch ( + prop + // // case 'margin': + // obj.properties = this.build([ + // 'margin-top', + // 'margin-right', + // 'margin-bottom', + // 'margin-left' + // ]); + // break; + // // case 'padding': + // obj.properties = this.build([ + // 'padding-top', + // 'padding-right', + // 'padding-bottom', + // 'padding-left' + // ]); + // break; + // case 'text-shadow': + // obj.properties = this.build([ + // 'text-shadow-h', + // 'text-shadow-v', + // 'text-shadow-blur', + // 'text-shadow-color' + // ]); + // break; + // // case 'border': + // obj.properties = this.build([ + // 'border-width', + // 'border-style', + // 'border-color' + // ]); + // break; + // // case 'border-radius': + // obj.properties = this.build([ + // 'border-top-left-radius', + // 'border-top-right-radius', + // 'border-bottom-right-radius', + // 'border-bottom-left-radius' + // ]); + // break; + // case 'box-shadow': + // obj.properties = this.build([ + // 'box-shadow-h', + // 'box-shadow-v', + // 'box-shadow-blur', + // 'box-shadow-spread', + // 'box-shadow-color', + // 'box-shadow-type' + // ]); + // break; + // case 'background': + // obj.properties = this.build([ + // 'background-image', + // 'background-repeat', + // 'background-position', + // 'background-attachment', + // 'background-size' + // ]); + // break; + // case 'transition': + // obj.properties = this.build([ + // 'transition-property', + // 'transition-duration', + // 'transition-timing-function' + // ]); + // break; + // case 'transform': + // obj.properties = this.build([ + // 'transform-rotate-x', + // 'transform-rotate-y', + // 'transform-rotate-z', + // 'transform-scale-x', + // 'transform-scale-y', + // 'transform-scale-z' + // ]); + // break; + ) { + } + + objs.push(obj); + } - return objs; - } -}); + return objs; + }, + }; +}; From f959d6685c94e1a6ac22d4bb038f6c0b098ad808 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 24 Dec 2021 18:34:20 +0100 Subject: [PATCH 160/313] Update builtin properties --- src/style_manager/index.js | 5 +- src/style_manager/model/PropertyFactory.js | 2225 +++++++++--------- src/style_manager/model/PropertySelect.js | 3 +- src/style_manager/model/Sector.js | 5 +- src/style_manager/view/PropertySelectView.js | 22 +- 5 files changed, 1128 insertions(+), 1132 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index dbeb06a63..b4eb542fd 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -65,8 +65,6 @@ export default () => { Sector, - PropertyFactory: PropertyFactory(), - events: { all: evAll, propertyUpdate: evPropUp, @@ -94,6 +92,7 @@ export default () => { const { em } = c; const ppfx = c.pStylePrefix; if (ppfx) c.stylePrefix = ppfx + c.stylePrefix; + this.builtIn = new PropertyFactory(); properties = new Properties(); sectors = new Sectors([], c); this.model = new Model({ targets: [] }); @@ -582,7 +581,7 @@ export default () => { * @returns {Object} Property definition */ getBuiltIn(prop = '') { - return this.PropertyFactory.build(prop)[0] || null; + return this.builtIn.get(prop); }, getBuiltInAll() {}, diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index 7b142b56a..4d12bc3f2 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -1,1188 +1,1181 @@ -import { isFunction } from 'underscore'; +import { isFunction, isString } from 'underscore'; const getOptions = items => items.map(item => ({ id: item })); -export default () => { - return { - constructor() { - this.typeNumber = 'integer'; // TODO change - this.typeColor = 'color'; - this.typeRadio = 'radio'; - this.typeSelect = 'select'; - this.typeFile = 'file'; - this.typeComposite = 'composite'; - this.typeStack = 'stack'; - this.unitsSize = ['px', '%', 'em', 'rem', 'vh', 'vw']; - this.unitsSizeNoPerc = ['px', 'em', 'rem', 'vh', 'vw']; - this.unitsTime = ['s', 'ms']; - this.unitsAngle = ['deg', 'rad', 'grad']; - this.fixedValues = ['initial', 'inherit', 'auto']; - const ss = ', sans-serif'; +export default class PropertyFactory { + constructor() { + this.typeNumber = 'integer'; // TODO change + this.typeColor = 'color'; + this.typeRadio = 'radio'; + this.typeSelect = 'select'; + this.typeFile = 'file'; + this.typeComposite = 'composite'; + this.typeStack = 'stack'; + this.unitsSize = ['px', '%', 'em', 'rem', 'vh', 'vw']; + this.unitsSizeNoPerc = ['px', 'em', 'rem', 'vh', 'vw']; + this.unitsTime = ['s', 'ms']; + this.unitsAngle = ['deg', 'rad', 'grad']; + this.fixedValues = ['initial', 'inherit', 'auto']; + const ss = ', sans-serif'; - this.optsBgSize = getOptions(['auto', 'cover', 'contain']); - this.optsBgAttach = getOptions(['scroll', 'fixed', 'local']); - this.optsBgRepeat = getOptions(['repeat', 'repeat-x', 'repeat-y', 'no-repeat']); - this.optsWrap = getOptions(['nowrap', 'wrap', 'wrap-reverse']); - this.optsOverflow = getOptions(['visible', 'hidden', 'scroll', 'auto']); - this.optsDir = getOptions(['row', 'row-reverse', 'column', 'column-reverse']); - this.opstDisplay = getOptions(['block', 'inline', 'inline-block', 'flex', 'none']); - this.optsTransitFn = getOptions(['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out']); - this.optsCursor = getOptions([ - 'auto', - 'pointer', - 'copy', - 'crosshair', - 'grab', - 'grabbing', - 'help', - 'move', - 'text', - ]); - this.optsTransitProp = getOptions([ - 'all', - 'width', - 'height', - 'background-color', - 'transform', - 'box-shadow', - 'opacity', - ]); - this.optsBorderStyle = getOptions([ - 'none', - 'solid', - 'dotted', - 'dashed', - 'double', - 'groove', - 'ridge', - 'inset', - 'outset', - ]); - this.optsBgPos = getOptions([ - 'left top', - 'left center', - 'left bottom', - 'right top', - 'right center', - 'right bottom', - 'center top', - 'center center', - 'center bottom', - ]); - this.optsWeight = [ - { id: '100', label: 'Thin' }, - { id: '200', label: 'Extra-Light' }, - { id: '300', label: 'Light' }, - { id: '400', label: 'Normal' }, - { id: '500', label: 'Medium' }, - { id: '600', label: 'Semi-Bold' }, - { id: '700', label: 'Bold' }, - { id: '800', label: 'Extra-Bold' }, - { id: '900', label: 'Ultra-Bold' }, - ]; - this.optsFonts = [ - 'Arial, Helvetica' + ss, - 'Arial Black, Gadget' + ss, - 'Brush Script MT' + ss, - 'Comic Sans MS, cursive' + ss, - 'Courier New, Courier, monospace', - 'Georgia, serif', - 'Helvetica' + ss, - 'Impact, Charcoal' + ss, - 'Lucida Sans Unicode, Lucida Grande' + ss, - 'Tahoma, Geneva' + ss, - 'Times New Roman, Times, serif', - 'Trebuchet MS, Helvetica' + ss, - 'Verdana, Geneva' + ss, - ].map(font => { - return { id: font, label: font.split(',')[0] }; - }); + this.optsBgSize = getOptions(['auto', 'cover', 'contain']); + this.optsBgAttach = getOptions(['scroll', 'fixed', 'local']); + this.optsBgRepeat = getOptions(['repeat', 'repeat-x', 'repeat-y', 'no-repeat']); + this.optsWrap = getOptions(['nowrap', 'wrap', 'wrap-reverse']); + this.optsOverflow = getOptions(['visible', 'hidden', 'scroll', 'auto']); + this.optsDir = getOptions(['row', 'row-reverse', 'column', 'column-reverse']); + this.opstDisplay = getOptions(['block', 'inline', 'inline-block', 'flex', 'none']); + this.optsTransitFn = getOptions(['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out']); + this.optsCursor = getOptions(['auto', 'pointer', 'copy', 'crosshair', 'grab', 'grabbing', 'help', 'move', 'text']); + this.optsTransitProp = getOptions([ + 'all', + 'width', + 'height', + 'background-color', + 'transform', + 'box-shadow', + 'opacity', + ]); + this.optsBorderStyle = getOptions([ + 'none', + 'solid', + 'dotted', + 'dashed', + 'double', + 'groove', + 'ridge', + 'inset', + 'outset', + ]); + this.optsBgPos = getOptions([ + 'left top', + 'left center', + 'left bottom', + 'right top', + 'right center', + 'right bottom', + 'center top', + 'center center', + 'center bottom', + ]); + this.optsWeight = [ + { id: '100', label: 'Thin' }, + { id: '200', label: 'Extra-Light' }, + { id: '300', label: 'Light' }, + { id: '400', label: 'Normal' }, + { id: '500', label: 'Medium' }, + { id: '600', label: 'Semi-Bold' }, + { id: '700', label: 'Bold' }, + { id: '800', label: 'Extra-Bold' }, + { id: '900', label: 'Ultra-Bold' }, + ]; + this.optsFonts = [ + 'Arial, Helvetica' + ss, + 'Arial Black, Gadget' + ss, + 'Brush Script MT' + ss, + 'Comic Sans MS, cursive' + ss, + 'Courier New, Courier, monospace', + 'Georgia, serif', + 'Helvetica' + ss, + 'Impact, Charcoal' + ss, + 'Lucida Sans Unicode, Lucida Grande' + ss, + 'Tahoma, Geneva' + ss, + 'Times New Roman, Times, serif', + 'Trebuchet MS, Helvetica' + ss, + 'Verdana, Geneva' + ss, + ].map(font => { + return { id: font, label: font.split(',')[0] }; + }); - this.init(); - }, + this.init(); + } - __sub(items) { - return () => items.map(p => this.get(p)); - }, + __sub(items) { + return () => items.map(p => this.get(p)); + } - init() { - this.props = {}; - const requireFlex = { display: ['flex'] }; - const optsFlex = [{ id: 'flex-start' }, { id: 'flex-end' }, { id: 'center' }]; - const optsFlexAlign = [...optsFlex, { id: 'baseline' }, { id: 'stretch' }]; + init() { + this.props = {}; + const requireFlex = { display: ['flex'] }; + const optsFlex = [{ id: 'flex-start' }, { id: 'flex-end' }, { id: 'center' }]; + const optsFlexAlign = [...optsFlex, { id: 'baseline' }, { id: 'stretch' }]; - // Build default built-in properties (the order, in the array here below, matters) - // [propertyName, propertyDefinition, extendFromProperty] + // Build default built-in properties (the order, in the array here below, matters) + // [propertyName, propertyDefinition, extendFromProperty] + [ + // Number types [ - // Number types - [ - 'top', - { - type: this.typeNumber, - default: 'auto', - units: this.unitsSize, - fixedValues: this.fixedValues, - }, - ], - ['right', {}, 'top'], - ['bottom', {}, 'top'], - ['margin-top', { default: '0' }, 'top'], - ['margin-right', {}, 'margin-top'], - ['margin-bottom', {}, 'margin-top'], - ['margin-left', {}, 'margin-top'], - ['padding-top', { min: 0 }, 'margin-top'], - ['padding-right', {}, 'padding-top'], - ['padding-bottom', {}, 'padding-top'], - ['padding-left', {}, 'padding-top'], - ['width', { min: 0 }, 'top'], - ['min-width', {}, 'width'], - ['max-width', {}, 'width'], - ['height', {}, 'width'], - ['min-height', {}, 'width'], - ['max-height', {}, 'width'], - ['flex-basis', { requiresParent: requireFlex }, 'width'], - [ - 'font-size', - { - defaults: 'medium', - fixedValues: [ - 'medium', - 'xx-small', - 'x-small', - 'small', - 'large', - 'x-large', - 'xx-large', - 'smaller', - 'larger', - 'length', - 'initial', - 'inherit', - ], - }, - 'width', - ], - [ - 'letter-spacing', - { - defaults: 'normal', - fixedValues: ['normal', 'initial', 'inherit'], - }, - 'top', - ], - ['line-height', {}, 'letter-spacing'], - [ - 'float', - { - type: this.typeRadio, - default: 'none', - options: [{ id: 'none' }, { id: 'left' }, { id: 'right' }], - }, - ], - [ - 'position', - { - default: 'static', - options: [{ id: 'static' }, { id: 'relative' }, { id: 'absolute' }, { id: 'fixed' }], // TODO sticky - }, - 'float', - ], - [ - 'text-align', - { - default: 'left', - options: [{ id: 'left' }, { id: 'center' }, { id: 'right' }, { id: 'justify' }], - }, - 'float', - ], - ['text-shadow-h', { default: '0', units: this.unitsSizeNoPerc }, 'top'], - ['text-shadow-v', {}, 'text-shadow-h'], - ['text-shadow-blur', { min: 0 }, 'text-shadow-h'], - ['border-radius-c', {}, 'padding-top'], - ['border-top-left-radius', {}, 'padding-top'], - ['border-top-right-radius', {}, 'padding-top'], - ['border-bottom-left-radius', {}, 'padding-top'], - ['border-bottom-right-radius', {}, 'padding-top'], - ['border-width', { default: '0', units: this.unitsSizeNoPerc }, 'padding-top'], - ['box-shadow-h', {}, 'text-shadow-h'], - ['box-shadow-v', {}, 'text-shadow-h'], - ['box-shadow-blur', { default: '5px' }, 'text-shadow-blur'], - ['box-shadow-spread', {}, 'text-shadow-h'], - ['transition-duration', { default: '2', units: this.unitsTime }, 'padding-top'], - ['perspective', {}, 'padding-top'], - ['transform-rotate-x', { functionName: 'rotateX', units: this.unitsAngle }, 'margin-top'], - ['transform-rotate-y', { functionName: 'rotateY' }, 'transform-rotate-x'], - ['transform-rotate-z', { functionName: 'rotateZ' }, 'transform-rotate-x'], - ['transform-scale-x', { default: '1', functionName: 'scaleX', units: [] }, 'transform-rotate-x'], - ['transform-scale-y', { functionName: 'scaleY' }, 'transform-scale-x'], - ['transform-scale-z', { functionName: 'scaleZ' }, 'transform-scale-x'], - ['order', { type: this.typeNumber, default: '0', requiresParent: requireFlex }], - ['flex-grow', {}, 'order'], - ['flex-shrink', { default: '1' }, 'order'], - - // Color types - ['color', { type: this.typeColor, default: 'black' }], - ['text-shadow-color', {}, 'color'], - ['border-color', {}, 'color'], - ['box-shadow-color', {}, 'color'], - ['background-color', { default: 'none' }, 'color'], - - // File type - ['background-image', { type: this.typeFile, functionName: 'url' }], + 'top', + { + type: this.typeNumber, + default: 'auto', + units: this.unitsSize, + fixedValues: this.fixedValues, + }, + ], + ['right', {}, 'top'], + ['bottom', {}, 'top'], + ['left', {}, 'top'], + ['margin-top', { default: '0' }, 'top'], + ['margin-right', {}, 'margin-top'], + ['margin-bottom', {}, 'margin-top'], + ['margin-left', {}, 'margin-top'], + ['padding-top', { min: 0 }, 'margin-top'], + ['padding-right', {}, 'padding-top'], + ['padding-bottom', {}, 'padding-top'], + ['padding-left', {}, 'padding-top'], + ['width', { min: 0 }, 'top'], + ['min-width', {}, 'width'], + ['max-width', {}, 'width'], + ['height', {}, 'width'], + ['min-height', {}, 'width'], + ['max-height', {}, 'width'], + ['flex-basis', { requiresParent: requireFlex }, 'width'], + [ + 'font-size', + { + defaults: 'medium', + fixedValues: [ + 'medium', + 'xx-small', + 'x-small', + 'small', + 'large', + 'x-large', + 'xx-large', + 'smaller', + 'larger', + 'length', + 'initial', + 'inherit', + ], + }, + 'width', + ], + [ + 'letter-spacing', + { + defaults: 'normal', + fixedValues: ['normal', 'initial', 'inherit'], + }, + 'top', + ], + ['line-height', {}, 'letter-spacing'], + [ + 'float', + { + type: this.typeRadio, + default: 'none', + options: [{ id: 'none' }, { id: 'left' }, { id: 'right' }], + }, + ], + [ + 'position', + { + default: 'static', + options: [{ id: 'static' }, { id: 'relative' }, { id: 'absolute' }, { id: 'fixed' }], // TODO sticky + }, + 'float', + ], + [ + 'text-align', + { + default: 'left', + options: [{ id: 'left' }, { id: 'center' }, { id: 'right' }, { id: 'justify' }], + }, + 'float', + ], + ['text-shadow-h', { default: '0', units: this.unitsSizeNoPerc }, 'top'], + ['text-shadow-v', {}, 'text-shadow-h'], + ['text-shadow-blur', { min: 0 }, 'text-shadow-h'], + ['border-radius-c', {}, 'padding-top'], + ['border-top-left-radius', {}, 'padding-top'], + ['border-top-right-radius', {}, 'padding-top'], + ['border-bottom-left-radius', {}, 'padding-top'], + ['border-bottom-right-radius', {}, 'padding-top'], + ['border-width', { default: '0', units: this.unitsSizeNoPerc }, 'padding-top'], + ['box-shadow-h', {}, 'text-shadow-h'], + ['box-shadow-v', {}, 'text-shadow-h'], + ['box-shadow-blur', { default: '5px' }, 'text-shadow-blur'], + ['box-shadow-spread', {}, 'text-shadow-h'], + ['transition-duration', { default: '2', units: this.unitsTime }, 'padding-top'], + ['perspective', {}, 'padding-top'], + ['transform-rotate-x', { functionName: 'rotateX', units: this.unitsAngle }, 'margin-top'], + ['transform-rotate-y', { functionName: 'rotateY' }, 'transform-rotate-x'], + ['transform-rotate-z', { functionName: 'rotateZ' }, 'transform-rotate-x'], + ['transform-scale-x', { default: '1', functionName: 'scaleX', units: [] }, 'transform-rotate-x'], + ['transform-scale-y', { functionName: 'scaleY' }, 'transform-scale-x'], + ['transform-scale-z', { functionName: 'scaleZ' }, 'transform-scale-x'], + ['order', { type: this.typeNumber, default: '0', requiresParent: requireFlex }], + ['flex-grow', {}, 'order'], + ['flex-shrink', { default: '1' }, 'order'], - // Select types - [ - 'display', - { - type: this.typeSelect, - default: 'block', - options: this.opstDisplay, - }, - ], - ['flex-direction', { default: 'row', options: this.optsDir, requires: requireFlex }, 'display'], - ['flex-wrap', { default: 'nowrap', options: this.optsWrap }, 'flex-direction'], - [ - 'justify-content', - { - default: 'flex-start', - options: [...optsFlex, { id: 'space-between' }, { id: 'space-around' }, { id: 'space-evenly' }], - }, - 'flex-wrap', - ], - ['align-items', { default: 'stretch', options: optsFlexAlign }, 'flex-wrap'], - [ - 'align-content', - { - options: [...optsFlex, { id: 'space-between' }, { id: 'space-around' }, { id: 'stretch' }], - }, - 'align-items', - ], - [ - 'align-self', - { - default: 'auto', - options: [{ id: 'auto' }, ...optsFlexAlign], - requiresParent: requireFlex, - }, - 'align-items', - ], - ['font-family', { default: 'Arial, Helvetica, sans-serif', options: this.optsFonts }, 'display'], - ['font-weight', { default: '400', options: this.optsWeight }, 'display'], - ['border-style', { default: 'solid', options: this.optsBorderStyle }, 'display'], - [ - 'box-shadow-type', - { - default: '', - options: [ - { id: '', label: 'Outside' }, - { id: 'inset', label: 'Inside' }, - ], - }, - 'display', - ], - ['background-repeat', { default: 'repeat', options: this.optsBgRepeat }, 'display'], - ['background-position', { default: 'left top', options: this.optsBgPos }, 'display'], - ['background-attachment', { default: 'scroll', options: this.optsBgAttach }, 'display'], - ['background-size', { default: 'auto', options: this.optsBgSize }, 'display'], - ['transition-property', { default: 'width', options: this.optsTransitProp }, 'display'], - ['transition-timing-function', { default: 'ease', options: this.optsTransitFn }, 'display'], - ['cursor', { default: 'auto', options: this.optsCursor }, 'display'], - ['overflow', { default: 'visible', options: this.optsOverflow }, 'display'], - ['overflow-x', {}, 'overflow'], - ['overflow-y', {}, 'overflow'], + // Color types + ['color', { type: this.typeColor, default: 'black' }], + ['text-shadow-color', {}, 'color'], + ['border-color', {}, 'color'], + ['box-shadow-color', {}, 'color'], + ['background-color', { default: 'none' }, 'color'], - // Composite types - [ - 'margin', - { - type: this.typeComposite, - properties: this.__sub(['margin-top', 'margin-right', 'margin-bottom', 'margin-left']), - }, - ], - [ - 'padding', - { - properties: this.__sub(['padding-top', 'padding-right', 'padding-bottom', 'padding-left']), - }, - 'margin', - ], - [ - 'border', - { - properties: this.__sub(['border-width', 'border-style', 'border-color']), - }, - 'margin', - ], - [ - 'border-radius', - { - properties: this.__sub([ - 'border-top-left-radius', - 'border-top-right-radius', - 'border-bottom-right-radius', - 'border-bottom-left-radius', - ]), - }, - 'margin', - ], - [ - 'transform', - { - properties: this.__sub([ - 'transform-rotate-x', - 'transform-rotate-y', - 'transform-rotate-z', - 'transform-scale-x', - 'transform-scale-y', - 'transform-scale-z', - ]), - }, - 'margin', - ], + // File type + ['background-image', { type: this.typeFile, functionName: 'url' }], - // Stack types - [ - 'transition', - { - type: this.typeStack, - properties: this.__sub(['transition-property', 'transition-duration', 'transition-timing-function']), - }, - ], - [ - 'box-shadow', - { - preview: true, - properties: this.__sub([ - 'box-shadow-h', - 'box-shadow-v', - 'box-shadow-blur', - 'box-shadow-spread', - 'box-shadow-color', - 'box-shadow-type', - ]), - }, - 'transition', - ], - [ - 'text-shadow', - { - default: 'none', - properties: this.__sub(['text-shadow-h', 'text-shadow-v', 'text-shadow-blur', 'text-shadow-color']), - }, - 'box-shadow', - ], - [ - 'background', - { - detached: true, - properties: this.__sub([ - 'background-image', - 'background-repeat', - 'background-position', - 'background-attachment', - 'background-size', - ]), - }, - 'box-shadow', - ], - ].forEach(([prop, def, from]) => { - this.add(prop, def || {}, { from }); - }); + // Select types + [ + 'display', + { + type: this.typeSelect, + default: 'block', + options: this.opstDisplay, + }, + ], + ['flex-direction', { default: 'row', options: this.optsDir, requires: requireFlex }, 'display'], + ['flex-wrap', { default: 'nowrap', options: this.optsWrap }, 'flex-direction'], + [ + 'justify-content', + { + default: 'flex-start', + options: [...optsFlex, { id: 'space-between' }, { id: 'space-around' }, { id: 'space-evenly' }], + }, + 'flex-wrap', + ], + ['align-items', { default: 'stretch', options: optsFlexAlign }, 'flex-wrap'], + [ + 'align-content', + { + options: [...optsFlex, { id: 'space-between' }, { id: 'space-around' }, { id: 'stretch' }], + }, + 'align-items', + ], + [ + 'align-self', + { + default: 'auto', + options: [{ id: 'auto' }, ...optsFlexAlign], + requiresParent: requireFlex, + }, + 'align-items', + ], + ['font-family', { default: 'Arial, Helvetica, sans-serif', options: this.optsFonts }, 'display'], + ['font-weight', { default: '400', options: this.optsWeight }, 'display'], + ['border-style', { default: 'solid', options: this.optsBorderStyle }, 'display'], + [ + 'box-shadow-type', + { + default: '', + options: [ + { id: '', label: 'Outside' }, + { id: 'inset', label: 'Inside' }, + ], + }, + 'display', + ], + ['background-repeat', { default: 'repeat', options: this.optsBgRepeat }, 'display'], + ['background-position', { default: 'left top', options: this.optsBgPos }, 'display'], + ['background-attachment', { default: 'scroll', options: this.optsBgAttach }, 'display'], + ['background-size', { default: 'auto', options: this.optsBgSize }, 'display'], + ['transition-property', { default: 'width', options: this.optsTransitProp }, 'display'], + ['transition-timing-function', { default: 'ease', options: this.optsTransitFn }, 'display'], + ['cursor', { default: 'auto', options: this.optsCursor }, 'display'], + ['overflow', { default: 'visible', options: this.optsOverflow }, 'display'], + ['overflow-x', {}, 'overflow'], + ['overflow-y', {}, 'overflow'], - return this; - }, + // Composite types + [ + 'margin', + { + type: this.typeComposite, + properties: this.__sub(['margin-top', 'margin-right', 'margin-bottom', 'margin-left']), + }, + ], + [ + 'padding', + { + properties: this.__sub(['padding-top', 'padding-right', 'padding-bottom', 'padding-left']), + }, + 'margin', + ], + [ + 'border', + { + properties: this.__sub(['border-width', 'border-style', 'border-color']), + }, + 'margin', + ], + [ + 'border-radius', + { + properties: this.__sub([ + 'border-top-left-radius', + 'border-top-right-radius', + 'border-bottom-right-radius', + 'border-bottom-left-radius', + ]), + }, + 'margin', + ], + [ + 'transform', + { + properties: this.__sub([ + 'transform-rotate-x', + 'transform-rotate-y', + 'transform-rotate-z', + 'transform-scale-x', + 'transform-scale-y', + 'transform-scale-z', + ]), + }, + 'margin', + ], - add(property, def = {}, opts = {}) { - const from = opts.from || ''; - const fromRes = this.props[from || property] || {}; - const result = { ...fromRes, property, ...def }; - if (result.properties && isFunction(result.properties)) { - result.properties = result.properties(); - } - this.props[property] = result; - }, + // Stack types + [ + 'transition', + { + type: this.typeStack, + properties: this.__sub(['transition-property', 'transition-duration', 'transition-timing-function']), + }, + ], + [ + 'box-shadow', + { + preview: true, + properties: this.__sub([ + 'box-shadow-h', + 'box-shadow-v', + 'box-shadow-blur', + 'box-shadow-spread', + 'box-shadow-color', + 'box-shadow-type', + ]), + }, + 'transition', + ], + [ + 'text-shadow', + { + default: 'none', + properties: this.__sub(['text-shadow-h', 'text-shadow-v', 'text-shadow-blur', 'text-shadow-color']), + }, + 'box-shadow', + ], + [ + 'background', + { + detached: true, + properties: this.__sub([ + 'background-image', + 'background-repeat', + 'background-position', + 'background-attachment', + 'background-size', + ]), + }, + 'box-shadow', + ], + ].forEach(([prop, def, from]) => { + this.add(prop, def || {}, { from }); + }); - get(prop) { - return this.props[prop] || null; - }, + return this; + } - /** - * Build props object by their name - * @param {Array|string} props Array of properties name - * @return {Array} - */ - build(props) { - var objs = []; - // var dftFixedValues = ['initial', 'inherit']; + add(property, def = {}, opts = {}) { + const from = opts.from || ''; + const fromRes = this.props[from || property] || {}; + const result = { ...fromRes, property, ...def }; + if (result.properties && isFunction(result.properties)) { + result.properties = result.properties(); + } + this.props[property] = result; + } - if (typeof props === 'string') props = [props]; + get(prop) { + return this.props[prop] || null; + } - for (var i = 0, len = props.length; i < len; i++) { - var obj = {}; - var prop = props[i]; - obj.property = prop; + /** + * Build props object by their name + * @param {Array|string} props Array of properties name + * @return {Array} + */ + build(props) { + const result = []; + const propsArr = isString(props) ? [props] : props; - // Property - // switch (prop) { - // // case 'border-radius-c': - // // obj.property = 'border-radius'; - // // break; - // } + propsArr.forEach(prop => { + result.push(this.get(prop) || { property: prop }); + }); - // Fixed values - // switch (prop) { - // // case 'top': - // // case 'right': - // // case 'bottom': - // // case 'left': - // // case 'margin-top': - // // case 'margin-right': - // // case 'margin-bottom': - // // case 'margin-left': - // // case 'padding-top': - // // case 'padding-right': - // // case 'padding-bottom': - // // case 'padding-left': - // // case 'width': - // // case 'max-width': - // // case 'min-width': - // // case 'height': - // // case 'max-height': - // // case 'min-height': - // // case 'flex-basis': - // case 'n': - // obj.fixedValues = ['initial', 'inherit', 'auto']; - // break; - // // case 'font-size': - // case 'n': - // obj.fixedValues = [ - // 'medium', - // 'xx-small', - // 'x-small', - // 'small', - // 'large', - // 'x-large', - // 'xx-large', - // 'smaller', - // 'larger', - // 'length', - // 'initial', - // 'inherit' - // ]; - // break; - // // case 'letter-spacing': - // // case 'line-height': - // case 'n': - // obj.fixedValues = ['normal', 'initial', 'inherit']; - // break; - // } + return result; - // Type - switch ( - prop - // case 'float': - // case 'position': - // case 'text-align': - // obj.type = 'radio'; - // break; - // case 'display': - // case 'flex-direction': - // case 'flex-wrap': - // case 'justify-content': - // case 'align-items': - // case 'align-content': - // case 'align-self': - // case 'font-family': - // case 'font-weight': - // case 'border-style': - // case 'box-shadow-type': - // case 'background-repeat': - // case 'background-position': - // case 'background-attachment': - // case 'background-size': - // case 'transition-property': - // case 'transition-timing-function': - // case 'cursor': - // case 'overflow': - // case 'overflow-x': - // case 'overflow-y': - // obj.type = 'select'; - // break; - // case 'top': - // case 'right': - // case 'bottom': - // case 'left': - // case 'margin-top': - // case 'margin-right': - // case 'margin-bottom': - // case 'margin-left': - // case 'padding-top': - // case 'padding-right': - // case 'padding-bottom': - // case 'padding-left': - // case 'min-height': - // case 'min-width': - // case 'max-height': - // case 'max-width': - // case 'width': - // case 'height': - // case 'font-size': - // case 'letter-spacing': - // case 'line-height': - // case 'text-shadow-h': - // case 'text-shadow-v': - // case 'text-shadow-blur': - // case 'border-radius-c': - // case 'border-top-left-radius': - // case 'border-top-right-radius': - // case 'border-bottom-left-radius': - // case 'border-bottom-right-radius': - // case 'border-width': - // case 'box-shadow-h': - // case 'box-shadow-v': - // case 'box-shadow-blur': - // case 'box-shadow-spread': - // case 'transition-duration': - // case 'perspective': - // case 'transform-rotate-x': - // case 'transform-rotate-y': - // case 'transform-rotate-z': - // case 'transform-scale-x': - // case 'transform-scale-y': - // case 'transform-scale-z': - // case 'order': - // case 'flex-grow': - // case 'flex-shrink': - // case 'flex-basis': - // obj.type = 'integer'; - // break; - // case 'margin': - // case 'padding': - // case 'border-radius': - // case 'border': - // case 'transform': - // obj.type = 'composite'; - // break; - // case 'color': - // case 'text-shadow-color': - // case 'background-color': - // case 'border-color': - // case 'box-shadow-color': - // obj.type = 'color'; - // break; - // case 'text-shadow': - // case 'box-shadow': - // case 'background': - // case 'transition': - // obj.type = 'stack'; - // break; - // case 'background-image': - // obj.type = 'file'; - // break; - ) { - } + for (var i = 0, len = props.length; i < len; i++) { + var obj = {}; + var prop = props[i]; + obj.property = prop; - // Defaults - switch ( - prop - // case 'float': - // case 'background-color': - // case 'text-shadow': - // obj.defaults = 'none'; - // break; - // // case 'display': - // obj.defaults = 'block'; - // break; - // // case 'flex-direction': - // obj.defaults = 'row'; - // break; - // // case 'flex-wrap': - // obj.defaults = 'nowrap'; - // break; - // // case 'justify-content': - // obj.defaults = 'flex-start'; - // break; - // // case 'align-items': - // obj.defaults = 'stretch'; - // break; - // // case 'align-content': - // obj.defaults = 'stretch'; - // break; - // // case 'align-self': - // obj.defaults = 'auto'; - // break; - // // case 'position': - // obj.defaults = 'static'; - // break; - // case 'margin-top': - // case 'margin-right': - // case 'margin-bottom': - // case 'margin-left': - // case 'padding-top': - // case 'padding-right': - // case 'padding-bottom': - // case 'padding-left': - // case 'text-shadow-h': - // case 'text-shadow-v': - // case 'text-shadow-blur': - // case 'border-radius-c': - // case 'box-shadow-h': - // case 'box-shadow-v': - // case 'box-shadow-spread': - // case 'perspective': - // case 'transform-rotate-x': - // case 'transform-rotate-y': - // case 'transform-rotate-z': - // case 'order': - // case 'flex-grow': - // obj.defaults = 0; - // break; - // case 'border-top-left-radius': - // case 'border-top-right-radius': - // case 'border-bottom-left-radius': - // case 'border-bottom-right-radius': - // obj.defaults = '0px'; - // break; - // case 'transform-scale-x': - // case 'transform-scale-y': - // case 'transform-scale-z': - // case 'flex-shrink': - // obj.defaults = 1; - // break; - // case 'box-shadow-blur': - // obj.defaults = '5px'; - // break; - // case 'top': - // case 'right': - // case 'bottom': - // case 'left': - // case 'min-height': - // case 'min-width': - // case 'max-height': - // case 'max-width': - // case 'width': - // case 'height': - // case 'background-size': - // case 'cursor': - // case 'flex-basis': - // obj.defaults = 'auto'; - // break; - // // case 'font-family': - // obj.defaults = 'Arial, Helvetica, sans-serif'; - // break; - // // case 'font-size': - // // case 'border-width': - // obj.defaults = 'medium'; - // break; - // // case 'font-weight': - // obj.defaults = '400'; - // break; - // // case 'letter-spacing': - // // case 'line-height': - // obj.defaults = 'normal'; - // break; - // case 'color': - // case 'text-shadow-color': - // case 'border-color': - // case 'box-shadow-color': - // obj.defaults = 'black'; - // break; - // case 'text-align': - // obj.defaults = 'left'; - // break; - // case 'border-style': - // obj.defaults = 'solid'; - // break; - // // case 'box-shadow-type': - // obj.defaults = ''; - // break; - // // case 'background-repeat': - // obj.defaults = 'repeat'; - // break; - // // case 'background-position': - // obj.defaults = 'left top'; - // break; - // // case 'background-attachment': - // obj.defaults = 'scroll'; - // break; - // // case 'transition-property': - // obj.defaults = 'width'; - // break; - // // case 'transition-duration': - // obj.defaults = '2'; - // break; - // // case 'transition-timing-function': - // obj.defaults = 'ease'; - // break; - // // case 'overflow': - // // case 'overflow-x': - // // case 'overflow-y': - // obj.defaults = 'visible'; - // break; - ) { - } + // Property + // switch (prop) { + // // case 'border-radius-c': + // // obj.property = 'border-radius'; + // // break; + // } - /* - * Add styleable dependency on other properties. Allows properties to be - * dynamically hidden or shown based on values of other properties. - * - * Property will be styleable if all of the properties (keys) in the - * requires object have any of the values specified in the array. - */ - // switch (prop) { - // // case 'flex-direction': - // // case 'flex-wrap': - // // case 'justify-content': - // // case 'align-items': - // // case 'align-content': - // // obj.requires = { display: ['flex'] }; - // // break; - // // case 'order': - // // case 'flex-basis': - // // case 'flex-grow': - // // case 'flex-shrink': - // // case 'align-self': - // // obj.requiresParent = { display: ['flex'] }; - // // break; - // } + // Fixed values + // switch (prop) { + // // case 'top': + // // case 'right': + // // case 'bottom': + // // case 'left': + // // case 'margin-top': + // // case 'margin-right': + // // case 'margin-bottom': + // // case 'margin-left': + // // case 'padding-top': + // // case 'padding-right': + // // case 'padding-bottom': + // // case 'padding-left': + // // case 'width': + // // case 'max-width': + // // case 'min-width': + // // case 'height': + // // case 'max-height': + // // case 'min-height': + // // case 'flex-basis': + // case 'n': + // obj.fixedValues = ['initial', 'inherit', 'auto']; + // break; + // // case 'font-size': + // case 'n': + // obj.fixedValues = [ + // 'medium', + // 'xx-small', + // 'x-small', + // 'small', + // 'large', + // 'x-large', + // 'xx-large', + // 'smaller', + // 'larger', + // 'length', + // 'initial', + // 'inherit' + // ]; + // break; + // // case 'letter-spacing': + // // case 'line-height': + // case 'n': + // obj.fixedValues = ['normal', 'initial', 'inherit']; + // break; + // } - // Units - // switch (prop) { - // case 'top': - // case 'bottom': - // case 'margin-top': - // case 'margin-bottom': - // case 'padding-top': - // case 'padding-bottom': - // case 'min-height': - // case 'max-height': - // case 'height': - // obj.units = ['px', '%', 'vh']; + // Type + switch ( + prop + // case 'float': + // case 'position': + // case 'text-align': + // obj.type = 'radio'; + // break; + // case 'display': + // case 'flex-direction': + // case 'flex-wrap': + // case 'justify-content': + // case 'align-items': + // case 'align-content': + // case 'align-self': + // case 'font-family': + // case 'font-weight': + // case 'border-style': + // case 'box-shadow-type': + // case 'background-repeat': + // case 'background-position': + // case 'background-attachment': + // case 'background-size': + // case 'transition-property': + // case 'transition-timing-function': + // case 'cursor': + // case 'overflow': + // case 'overflow-x': + // case 'overflow-y': + // obj.type = 'select'; // break; + // case 'top': // case 'right': + // case 'bottom': // case 'left': + // case 'margin-top': // case 'margin-right': + // case 'margin-bottom': // case 'margin-left': + // case 'padding-top': // case 'padding-right': + // case 'padding-bottom': // case 'padding-left': + // case 'min-height': // case 'min-width': + // case 'max-height': // case 'max-width': // case 'width': - // obj.units = ['px', '%', 'vw']; - // break; - // case 'flex-basis': - // obj.units = ['px', '%', 'vw', 'vh']; - // break; - // case 'text-shadow-v': + // case 'height': + // case 'font-size': + // case 'letter-spacing': + // case 'line-height': // case 'text-shadow-h': + // case 'text-shadow-v': // case 'text-shadow-blur': // case 'border-radius-c': // case 'border-top-left-radius': // case 'border-top-right-radius': // case 'border-bottom-left-radius': // case 'border-bottom-right-radius': + // case 'border-width': // case 'box-shadow-h': // case 'box-shadow-v': - // obj.units = ['px', '%']; - // break; - // case 'font-size': - // case 'letter-spacing': - // case 'line-height': - // obj.units = ['px', 'em', 'rem', '%']; - // break; - // case 'border-width': - // obj.units = ['px', 'em']; - // break; // case 'box-shadow-blur': // case 'box-shadow-spread': - // case 'perspective': - // obj.units = ['px']; - // break; // case 'transition-duration': - // obj.units = ['s']; - // break; + // case 'perspective': // case 'transform-rotate-x': // case 'transform-rotate-y': // case 'transform-rotate-z': - // obj.units = ['deg']; + // case 'transform-scale-x': + // case 'transform-scale-y': + // case 'transform-scale-z': + // case 'order': + // case 'flex-grow': + // case 'flex-shrink': + // case 'flex-basis': + // obj.type = 'integer'; + // break; + // case 'margin': + // case 'padding': + // case 'border-radius': + // case 'border': + // case 'transform': + // obj.type = 'composite'; + // break; + // case 'color': + // case 'text-shadow-color': + // case 'background-color': + // case 'border-color': + // case 'box-shadow-color': + // obj.type = 'color'; + // break; + // case 'text-shadow': + // case 'box-shadow': + // case 'background': + // case 'transition': + // obj.type = 'stack'; + // break; + // case 'background-image': + // obj.type = 'file'; // break; - // } + ) { + } - // Min/Max - // switch (prop) { + // Defaults + switch ( + prop + // case 'float': + // case 'background-color': + // case 'text-shadow': + // obj.defaults = 'none'; + // break; + // // case 'display': + // obj.defaults = 'block'; + // break; + // // case 'flex-direction': + // obj.defaults = 'row'; + // break; + // // case 'flex-wrap': + // obj.defaults = 'nowrap'; + // break; + // // case 'justify-content': + // obj.defaults = 'flex-start'; + // break; + // // case 'align-items': + // obj.defaults = 'stretch'; + // break; + // // case 'align-content': + // obj.defaults = 'stretch'; + // break; + // // case 'align-self': + // obj.defaults = 'auto'; + // break; + // // case 'position': + // obj.defaults = 'static'; + // break; + // case 'margin-top': + // case 'margin-right': + // case 'margin-bottom': + // case 'margin-left': // case 'padding-top': // case 'padding-right': // case 'padding-bottom': // case 'padding-left': - // case 'min-height': - // case 'min-width': - // case 'max-height': - // case 'max-width': - // case 'width': - // case 'height': - // case 'font-size': + // case 'text-shadow-h': + // case 'text-shadow-v': // case 'text-shadow-blur': // case 'border-radius-c': + // case 'box-shadow-h': + // case 'box-shadow-v': + // case 'box-shadow-spread': + // case 'perspective': + // case 'transform-rotate-x': + // case 'transform-rotate-y': + // case 'transform-rotate-z': + // case 'order': + // case 'flex-grow': + // obj.defaults = 0; + // break; // case 'border-top-left-radius': // case 'border-top-right-radius': // case 'border-bottom-left-radius': // case 'border-bottom-right-radius': - // case 'border-width': + // obj.defaults = '0px'; + // break; + // case 'transform-scale-x': + // case 'transform-scale-y': + // case 'transform-scale-z': + // case 'flex-shrink': + // obj.defaults = 1; + // break; // case 'box-shadow-blur': - // case 'transition-duration': - // case 'perspective': + // obj.defaults = '5px'; + // break; + // case 'top': + // case 'right': + // case 'bottom': + // case 'left': + // case 'min-height': + // case 'min-width': + // case 'max-height': + // case 'max-width': + // case 'width': + // case 'height': + // case 'background-size': + // case 'cursor': // case 'flex-basis': - // obj.min = 0; + // obj.defaults = 'auto'; + // break; + // // case 'font-family': + // obj.defaults = 'Arial, Helvetica, sans-serif'; + // break; + // // case 'font-size': + // // case 'border-width': + // obj.defaults = 'medium'; + // break; + // // case 'font-weight': + // obj.defaults = '400'; + // break; + // // case 'letter-spacing': + // // case 'line-height': + // obj.defaults = 'normal'; + // break; + // case 'color': + // case 'text-shadow-color': + // case 'border-color': + // case 'box-shadow-color': + // obj.defaults = 'black'; // break; - // } + // case 'text-align': + // obj.defaults = 'left'; + // break; + // case 'border-style': + // obj.defaults = 'solid'; + // break; + // // case 'box-shadow-type': + // obj.defaults = ''; + // break; + // // case 'background-repeat': + // obj.defaults = 'repeat'; + // break; + // // case 'background-position': + // obj.defaults = 'left top'; + // break; + // // case 'background-attachment': + // obj.defaults = 'scroll'; + // break; + // // case 'transition-property': + // obj.defaults = 'width'; + // break; + // // case 'transition-duration': + // obj.defaults = '2'; + // break; + // // case 'transition-timing-function': + // obj.defaults = 'ease'; + // break; + // // case 'overflow': + // // case 'overflow-x': + // // case 'overflow-y': + // obj.defaults = 'visible'; + // break; + ) { + } - // Preview - // switch (prop) { - // case 'text-shadow': - // case 'box-shadow': - // case 'background': - // obj.preview = true; - // break; - // } + /* + * Add styleable dependency on other properties. Allows properties to be + * dynamically hidden or shown based on values of other properties. + * + * Property will be styleable if all of the properties (keys) in the + * requires object have any of the values specified in the array. + */ + // switch (prop) { + // // case 'flex-direction': + // // case 'flex-wrap': + // // case 'justify-content': + // // case 'align-items': + // // case 'align-content': + // // obj.requires = { display: ['flex'] }; + // // break; + // // case 'order': + // // case 'flex-basis': + // // case 'flex-grow': + // // case 'flex-shrink': + // // case 'align-self': + // // obj.requiresParent = { display: ['flex'] }; + // // break; + // } - // Detached - // switch (prop) { - // case 'background': - // obj.detached = true; - // break; - // } + // Units + // switch (prop) { + // case 'top': + // case 'bottom': + // case 'margin-top': + // case 'margin-bottom': + // case 'padding-top': + // case 'padding-bottom': + // case 'min-height': + // case 'max-height': + // case 'height': + // obj.units = ['px', '%', 'vh']; + // break; + // case 'right': + // case 'left': + // case 'margin-right': + // case 'margin-left': + // case 'padding-right': + // case 'padding-left': + // case 'min-width': + // case 'max-width': + // case 'width': + // obj.units = ['px', '%', 'vw']; + // break; + // case 'flex-basis': + // obj.units = ['px', '%', 'vw', 'vh']; + // break; + // case 'text-shadow-v': + // case 'text-shadow-h': + // case 'text-shadow-blur': + // case 'border-radius-c': + // case 'border-top-left-radius': + // case 'border-top-right-radius': + // case 'border-bottom-left-radius': + // case 'border-bottom-right-radius': + // case 'box-shadow-h': + // case 'box-shadow-v': + // obj.units = ['px', '%']; + // break; + // case 'font-size': + // case 'letter-spacing': + // case 'line-height': + // obj.units = ['px', 'em', 'rem', '%']; + // break; + // case 'border-width': + // obj.units = ['px', 'em']; + // break; + // case 'box-shadow-blur': + // case 'box-shadow-spread': + // case 'perspective': + // obj.units = ['px']; + // break; + // case 'transition-duration': + // obj.units = ['s']; + // break; + // case 'transform-rotate-x': + // case 'transform-rotate-y': + // case 'transform-rotate-z': + // obj.units = ['deg']; + // break; + // } - // Functions - // switch (prop) { - // // // case 'transform-rotate-x': - // // obj.functionName = 'rotateX'; - // // break; - // // // case 'transform-rotate-y': - // // obj.functionName = 'rotateY'; - // // break; - // // // case 'transform-rotate-z': - // // obj.functionName = 'rotateZ'; - // // break; - // // // case 'transform-scale-x': - // // obj.functionName = 'scaleX'; - // // break; - // // // case 'transform-scale-y': - // // obj.functionName = 'scaleY'; - // // break; - // // // case 'transform-scale-z': - // // obj.functionName = 'scaleZ'; - // // break; - // // case 'background-image': - // // obj.functionName = 'url'; - // // break; - // } + // Min/Max + // switch (prop) { + // case 'padding-top': + // case 'padding-right': + // case 'padding-bottom': + // case 'padding-left': + // case 'min-height': + // case 'min-width': + // case 'max-height': + // case 'max-width': + // case 'width': + // case 'height': + // case 'font-size': + // case 'text-shadow-blur': + // case 'border-radius-c': + // case 'border-top-left-radius': + // case 'border-top-right-radius': + // case 'border-bottom-left-radius': + // case 'border-bottom-right-radius': + // case 'border-width': + // case 'box-shadow-blur': + // case 'transition-duration': + // case 'perspective': + // case 'flex-basis': + // obj.min = 0; + // break; + // } - // Options - // switch (prop) { - // case 'float': - // obj.list = [{ value: 'none' }, { value: 'left' }, { value: 'right' }]; - // break; - // case 'display': - // obj.list = [ - // { value: 'block' }, - // { value: 'inline' }, - // { value: 'inline-block' }, - // { value: 'flex' }, - // { value: 'none' } - // ]; - // break; - // case 'flex-direction': - // obj.list = [ - // { value: 'row' }, - // { value: 'row-reverse' }, - // { value: 'column' }, - // { value: 'column-reverse' } - // ]; - // break; - // case 'flex-wrap': - // obj.list = [ - // { value: 'nowrap' }, - // { value: 'wrap' }, - // { value: 'wrap-reverse' } - // ]; - // break; - // case 'justify-content': - // obj.list = [ - // { value: 'flex-start' }, - // { value: 'flex-end' }, - // { value: 'center' }, - // { value: 'space-between' }, - // { value: 'space-around' }, - // { value: 'space-evenly' } - // ]; - // break; - // case 'align-items': - // obj.list = [ - // { value: 'flex-start' }, - // { value: 'flex-end' }, - // { value: 'center' }, - // { value: 'baseline' }, - // { value: 'stretch' } - // ]; - // break; - // case 'align-content': - // obj.list = [ - // { value: 'flex-start' }, - // { value: 'flex-end' }, - // { value: 'center' }, - // { value: 'space-between' }, - // { value: 'space-around' }, - // { value: 'stretch' } - // ]; - // break; - // case 'align-self': - // obj.list = [ - // { value: 'auto' }, - // { value: 'flex-start' }, - // { value: 'flex-end' }, - // { value: 'center' }, - // { value: 'baseline' }, - // { value: 'stretch' } - // ]; - // break; - // case 'position': - // obj.list = [ - // { value: 'static' }, - // { value: 'relative' }, - // { value: 'absolute' }, - // { value: 'fixed' } - // ]; - // break; - // case 'font-family': - // var ss = ', sans-serif'; - // var fonts = [ - // 'Arial, Helvetica' + ss, - // 'Arial Black, Gadget' + ss, - // 'Brush Script MT' + ss, - // 'Comic Sans MS, cursive' + ss, - // 'Courier New, Courier, monospace', - // 'Georgia, serif', - // 'Helvetica' + ss, - // 'Impact, Charcoal' + ss, - // 'Lucida Sans Unicode, Lucida Grande' + ss, - // 'Tahoma, Geneva' + ss, - // 'Times New Roman, Times, serif', - // 'Trebuchet MS, Helvetica' + ss, - // 'Verdana, Geneva' + ss - // ]; - // obj.list = []; - // for (var j = 0, l = fonts.length; j < l; j++) { - // var font = {}; - // font.value = fonts[j]; - // font.name = fonts[j].split(',')[0]; - // obj.list.push(font); - // } - // break; - // case 'font-weight': - // obj.list = [ - // { value: '100', name: 'Thin' }, - // { value: '200', name: 'Extra-Light' }, - // { value: '300', name: 'Light' }, - // { value: '400', name: 'Normal' }, - // { value: '500', name: 'Medium' }, - // { value: '600', name: 'Semi-Bold' }, - // { value: '700', name: 'Bold' }, - // { value: '800', name: 'Extra-Bold' }, - // { value: '900', name: 'Ultra-Bold' } - // ]; - // break; - // case 'text-align': - // obj.list = [ - // { value: 'left' }, - // { value: 'center' }, - // { value: 'right' }, - // { value: 'justify' } - // ]; - // break; - // case 'border-style': - // obj.list = [ - // { value: 'none' }, - // { value: 'solid' }, - // { value: 'dotted' }, - // { value: 'dashed' }, - // { value: 'double' }, - // { value: 'groove' }, - // { value: 'ridge' }, - // { value: 'inset' }, - // { value: 'outset' } - // ]; - // break; - // case 'box-shadow-type': - // obj.list = [ - // { value: '', name: 'Outside' }, - // { value: 'inset', name: 'Inside' } - // ]; - // break; - // case 'background-repeat': - // obj.list = [ - // { value: 'repeat' }, - // { value: 'repeat-x' }, - // { value: 'repeat-y' }, - // { value: 'no-repeat' } - // ]; - // break; - // case 'background-position': - // obj.list = [ - // { value: 'left top' }, - // { value: 'left center' }, - // { value: 'left bottom' }, - // { value: 'right top' }, - // { value: 'right center' }, - // { value: 'right bottom' }, - // { value: 'center top' }, - // { value: 'center center' }, - // { value: 'center bottom' } - // ]; - // break; - // case 'background-attachment': - // obj.list = [ - // { value: 'scroll' }, - // { value: 'fixed' }, - // { value: 'local' } - // ]; - // break; - // case 'background-size': - // obj.list = [ - // { value: 'auto' }, - // { value: 'cover' }, - // { value: 'contain' } - // ]; - // break; - // case 'transition-property': - // obj.list = [ - // { value: 'all' }, - // { value: 'width' }, - // { value: 'height' }, - // { value: 'background-color' }, - // { value: 'transform' }, - // { value: 'box-shadow' }, - // { value: 'opacity' } - // ]; - // break; - // case 'transition-timing-function': - // obj.list = [ - // { value: 'linear' }, - // { value: 'ease' }, - // { value: 'ease-in' }, - // { value: 'ease-out' }, - // { value: 'ease-in-out' } - // ]; - // break; - // case 'cursor': - // obj.list = [ - // { value: 'auto' }, - // { value: 'pointer' }, - // { value: 'copy' }, - // { value: 'crosshair' }, - // { value: 'grab' }, - // { value: 'grabbing' }, - // { value: 'help' }, - // { value: 'move' }, - // { value: 'text' } - // ]; - // break; - // case 'overflow': - // case 'overflow-x': - // case 'overflow-y': - // obj.list = [ - // { value: 'visible' }, - // { value: 'hidden' }, - // { value: 'scroll' }, - // { value: 'auto' } - // ]; - // break; - // } + // Preview + // switch (prop) { + // case 'text-shadow': + // case 'box-shadow': + // case 'background': + // obj.preview = true; + // break; + // } + + // Detached + // switch (prop) { + // case 'background': + // obj.detached = true; + // break; + // } + + // Functions + // switch (prop) { + // // // case 'transform-rotate-x': + // // obj.functionName = 'rotateX'; + // // break; + // // // case 'transform-rotate-y': + // // obj.functionName = 'rotateY'; + // // break; + // // // case 'transform-rotate-z': + // // obj.functionName = 'rotateZ'; + // // break; + // // // case 'transform-scale-x': + // // obj.functionName = 'scaleX'; + // // break; + // // // case 'transform-scale-y': + // // obj.functionName = 'scaleY'; + // // break; + // // // case 'transform-scale-z': + // // obj.functionName = 'scaleZ'; + // // break; + // // case 'background-image': + // // obj.functionName = 'url'; + // // break; + // } - // Properties - switch ( - prop - // // case 'margin': - // obj.properties = this.build([ - // 'margin-top', - // 'margin-right', - // 'margin-bottom', - // 'margin-left' - // ]); - // break; - // // case 'padding': - // obj.properties = this.build([ - // 'padding-top', - // 'padding-right', - // 'padding-bottom', - // 'padding-left' - // ]); - // break; - // case 'text-shadow': - // obj.properties = this.build([ - // 'text-shadow-h', - // 'text-shadow-v', - // 'text-shadow-blur', - // 'text-shadow-color' - // ]); - // break; - // // case 'border': - // obj.properties = this.build([ - // 'border-width', - // 'border-style', - // 'border-color' - // ]); - // break; - // // case 'border-radius': - // obj.properties = this.build([ - // 'border-top-left-radius', - // 'border-top-right-radius', - // 'border-bottom-right-radius', - // 'border-bottom-left-radius' - // ]); - // break; - // case 'box-shadow': - // obj.properties = this.build([ - // 'box-shadow-h', - // 'box-shadow-v', - // 'box-shadow-blur', - // 'box-shadow-spread', - // 'box-shadow-color', - // 'box-shadow-type' - // ]); - // break; - // case 'background': - // obj.properties = this.build([ - // 'background-image', - // 'background-repeat', - // 'background-position', - // 'background-attachment', - // 'background-size' - // ]); - // break; - // case 'transition': - // obj.properties = this.build([ - // 'transition-property', - // 'transition-duration', - // 'transition-timing-function' - // ]); - // break; - // case 'transform': - // obj.properties = this.build([ - // 'transform-rotate-x', - // 'transform-rotate-y', - // 'transform-rotate-z', - // 'transform-scale-x', - // 'transform-scale-y', - // 'transform-scale-z' - // ]); - // break; - ) { - } + // Options + // switch (prop) { + // case 'float': + // obj.list = [{ value: 'none' }, { value: 'left' }, { value: 'right' }]; + // break; + // case 'display': + // obj.list = [ + // { value: 'block' }, + // { value: 'inline' }, + // { value: 'inline-block' }, + // { value: 'flex' }, + // { value: 'none' } + // ]; + // break; + // case 'flex-direction': + // obj.list = [ + // { value: 'row' }, + // { value: 'row-reverse' }, + // { value: 'column' }, + // { value: 'column-reverse' } + // ]; + // break; + // case 'flex-wrap': + // obj.list = [ + // { value: 'nowrap' }, + // { value: 'wrap' }, + // { value: 'wrap-reverse' } + // ]; + // break; + // case 'justify-content': + // obj.list = [ + // { value: 'flex-start' }, + // { value: 'flex-end' }, + // { value: 'center' }, + // { value: 'space-between' }, + // { value: 'space-around' }, + // { value: 'space-evenly' } + // ]; + // break; + // case 'align-items': + // obj.list = [ + // { value: 'flex-start' }, + // { value: 'flex-end' }, + // { value: 'center' }, + // { value: 'baseline' }, + // { value: 'stretch' } + // ]; + // break; + // case 'align-content': + // obj.list = [ + // { value: 'flex-start' }, + // { value: 'flex-end' }, + // { value: 'center' }, + // { value: 'space-between' }, + // { value: 'space-around' }, + // { value: 'stretch' } + // ]; + // break; + // case 'align-self': + // obj.list = [ + // { value: 'auto' }, + // { value: 'flex-start' }, + // { value: 'flex-end' }, + // { value: 'center' }, + // { value: 'baseline' }, + // { value: 'stretch' } + // ]; + // break; + // case 'position': + // obj.list = [ + // { value: 'static' }, + // { value: 'relative' }, + // { value: 'absolute' }, + // { value: 'fixed' } + // ]; + // break; + // case 'font-family': + // var ss = ', sans-serif'; + // var fonts = [ + // 'Arial, Helvetica' + ss, + // 'Arial Black, Gadget' + ss, + // 'Brush Script MT' + ss, + // 'Comic Sans MS, cursive' + ss, + // 'Courier New, Courier, monospace', + // 'Georgia, serif', + // 'Helvetica' + ss, + // 'Impact, Charcoal' + ss, + // 'Lucida Sans Unicode, Lucida Grande' + ss, + // 'Tahoma, Geneva' + ss, + // 'Times New Roman, Times, serif', + // 'Trebuchet MS, Helvetica' + ss, + // 'Verdana, Geneva' + ss + // ]; + // obj.list = []; + // for (var j = 0, l = fonts.length; j < l; j++) { + // var font = {}; + // font.value = fonts[j]; + // font.name = fonts[j].split(',')[0]; + // obj.list.push(font); + // } + // break; + // case 'font-weight': + // obj.list = [ + // { value: '100', name: 'Thin' }, + // { value: '200', name: 'Extra-Light' }, + // { value: '300', name: 'Light' }, + // { value: '400', name: 'Normal' }, + // { value: '500', name: 'Medium' }, + // { value: '600', name: 'Semi-Bold' }, + // { value: '700', name: 'Bold' }, + // { value: '800', name: 'Extra-Bold' }, + // { value: '900', name: 'Ultra-Bold' } + // ]; + // break; + // case 'text-align': + // obj.list = [ + // { value: 'left' }, + // { value: 'center' }, + // { value: 'right' }, + // { value: 'justify' } + // ]; + // break; + // case 'border-style': + // obj.list = [ + // { value: 'none' }, + // { value: 'solid' }, + // { value: 'dotted' }, + // { value: 'dashed' }, + // { value: 'double' }, + // { value: 'groove' }, + // { value: 'ridge' }, + // { value: 'inset' }, + // { value: 'outset' } + // ]; + // break; + // case 'box-shadow-type': + // obj.list = [ + // { value: '', name: 'Outside' }, + // { value: 'inset', name: 'Inside' } + // ]; + // break; + // case 'background-repeat': + // obj.list = [ + // { value: 'repeat' }, + // { value: 'repeat-x' }, + // { value: 'repeat-y' }, + // { value: 'no-repeat' } + // ]; + // break; + // case 'background-position': + // obj.list = [ + // { value: 'left top' }, + // { value: 'left center' }, + // { value: 'left bottom' }, + // { value: 'right top' }, + // { value: 'right center' }, + // { value: 'right bottom' }, + // { value: 'center top' }, + // { value: 'center center' }, + // { value: 'center bottom' } + // ]; + // break; + // case 'background-attachment': + // obj.list = [ + // { value: 'scroll' }, + // { value: 'fixed' }, + // { value: 'local' } + // ]; + // break; + // case 'background-size': + // obj.list = [ + // { value: 'auto' }, + // { value: 'cover' }, + // { value: 'contain' } + // ]; + // break; + // case 'transition-property': + // obj.list = [ + // { value: 'all' }, + // { value: 'width' }, + // { value: 'height' }, + // { value: 'background-color' }, + // { value: 'transform' }, + // { value: 'box-shadow' }, + // { value: 'opacity' } + // ]; + // break; + // case 'transition-timing-function': + // obj.list = [ + // { value: 'linear' }, + // { value: 'ease' }, + // { value: 'ease-in' }, + // { value: 'ease-out' }, + // { value: 'ease-in-out' } + // ]; + // break; + // case 'cursor': + // obj.list = [ + // { value: 'auto' }, + // { value: 'pointer' }, + // { value: 'copy' }, + // { value: 'crosshair' }, + // { value: 'grab' }, + // { value: 'grabbing' }, + // { value: 'help' }, + // { value: 'move' }, + // { value: 'text' } + // ]; + // break; + // case 'overflow': + // case 'overflow-x': + // case 'overflow-y': + // obj.list = [ + // { value: 'visible' }, + // { value: 'hidden' }, + // { value: 'scroll' }, + // { value: 'auto' } + // ]; + // break; + // } - objs.push(obj); + // Properties + switch ( + prop + // // case 'margin': + // obj.properties = this.build([ + // 'margin-top', + // 'margin-right', + // 'margin-bottom', + // 'margin-left' + // ]); + // break; + // // case 'padding': + // obj.properties = this.build([ + // 'padding-top', + // 'padding-right', + // 'padding-bottom', + // 'padding-left' + // ]); + // break; + // case 'text-shadow': + // obj.properties = this.build([ + // 'text-shadow-h', + // 'text-shadow-v', + // 'text-shadow-blur', + // 'text-shadow-color' + // ]); + // break; + // // case 'border': + // obj.properties = this.build([ + // 'border-width', + // 'border-style', + // 'border-color' + // ]); + // break; + // // case 'border-radius': + // obj.properties = this.build([ + // 'border-top-left-radius', + // 'border-top-right-radius', + // 'border-bottom-right-radius', + // 'border-bottom-left-radius' + // ]); + // break; + // case 'box-shadow': + // obj.properties = this.build([ + // 'box-shadow-h', + // 'box-shadow-v', + // 'box-shadow-blur', + // 'box-shadow-spread', + // 'box-shadow-color', + // 'box-shadow-type' + // ]); + // break; + // case 'background': + // obj.properties = this.build([ + // 'background-image', + // 'background-repeat', + // 'background-position', + // 'background-attachment', + // 'background-size' + // ]); + // break; + // case 'transition': + // obj.properties = this.build([ + // 'transition-property', + // 'transition-duration', + // 'transition-timing-function' + // ]); + // break; + // case 'transform': + // obj.properties = this.build([ + // 'transform-rotate-x', + // 'transform-rotate-y', + // 'transform-rotate-z', + // 'transform-scale-x', + // 'transform-scale-y', + // 'transform-scale-z' + // ]); + // break; + ) { } - return objs; - }, - }; -}; + objs.push(obj); + } + + return objs; + } +} diff --git a/src/style_manager/model/PropertySelect.js b/src/style_manager/model/PropertySelect.js index 7b50f9b9a..4964d288c 100644 --- a/src/style_manager/model/PropertySelect.js +++ b/src/style_manager/model/PropertySelect.js @@ -1,4 +1,5 @@ import Property from './Property'; +import { isDef } from 'utils/mixins'; /** * @typedef PropertySelect @@ -60,7 +61,7 @@ export default class PropertySelect extends Property { * @returns {String} Option id */ getOptionId(option) { - return option.id || option.value; + return isDef(option.id) ? option.id : option.value; } /** diff --git a/src/style_manager/model/Sector.js b/src/style_manager/model/Sector.js index faf75e996..6a13f97e7 100644 --- a/src/style_manager/model/Sector.js +++ b/src/style_manager/model/Sector.js @@ -24,6 +24,7 @@ export default class Sector extends Model { initialize(prp, opts = {}) { const { em } = opts; + this.em = em; const o = prp || {}; const builded = this.buildProperties(o.buildProps); const name = this.get('name') || ''; @@ -180,9 +181,9 @@ export default class Sector extends Model { if (!buildP.length) return []; - this.propFactory = this.propFactory || new PropertyFactory(); + const builtIn = this.em?.get('StyleManager').builtIn; - return this.propFactory.build(buildP); + return builtIn?.build(buildP); } } /** diff --git a/src/style_manager/view/PropertySelectView.js b/src/style_manager/view/PropertySelectView.js index 001c86816..4cc47b153 100644 --- a/src/style_manager/view/PropertySelectView.js +++ b/src/style_manager/view/PropertySelectView.js @@ -28,23 +28,25 @@ export default PropertyView.extend({ }, onRender() { - var pfx = this.pfx; - const options = this.model.getOptions(); + const { model, pfx } = this; + const options = model.getOptions(); if (!this.input) { - let optionsStr = ''; + const optionsRes = []; options.forEach(option => { - let name = option.name || option.value; - let style = option.style ? option.style.replace(/"/g, '"') : ''; - let styleAttr = style ? `style="${style}"` : ''; - let value = option.value.replace(/"/g, '"'); - optionsStr += ``; + const id = model.getOptionId(option); + const name = model.getOptionLabel(id); + const style = option.style ? option.style.replace(/"/g, '"') : ''; + const styleAttr = style ? `style="${style}"` : ''; + console.log({ option, id }); + const value = id.replace(/"/g, '"'); + optionsRes.push(``); }); const inputH = this.el.querySelector(`#${pfx}input-holder`); - inputH.innerHTML = ``; + inputH.innerHTML = ``; this.input = inputH.firstChild; } - } + }, }); From f80f2faa00d96a87faba2a6d084615894f83326e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 24 Dec 2021 19:19:14 +0100 Subject: [PATCH 161/313] Up property factory --- src/style_manager/model/PropertyFactory.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index 4d12bc3f2..d80c1e7dc 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -188,7 +188,7 @@ export default class PropertyFactory { ['text-shadow-h', { default: '0', units: this.unitsSizeNoPerc }, 'top'], ['text-shadow-v', {}, 'text-shadow-h'], ['text-shadow-blur', { min: 0 }, 'text-shadow-h'], - ['border-radius-c', {}, 'padding-top'], + ['border-radius-c', { property: 'border-radius' }, 'padding-top'], ['border-top-left-radius', {}, 'padding-top'], ['border-top-right-radius', {}, 'padding-top'], ['border-bottom-left-radius', {}, 'padding-top'], From 27543c924dfc683984cecc10d3cef9856137c0a3 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 24 Dec 2021 19:26:51 +0100 Subject: [PATCH 162/313] Add new methods for builtin props --- src/style_manager/index.js | 31 ++++++++++++++++++---- src/style_manager/model/PropertyFactory.js | 1 + 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index b4eb542fd..11ab15d7f 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -577,16 +577,37 @@ export default () => { /** * Return built-in property definition - * @param {String} prop - * @returns {Object} Property definition + * @param {String} prop Property name. + * @returns {Object|null} Property definition. */ - getBuiltIn(prop = '') { + getBuiltIn(prop) { return this.builtIn.get(prop); }, - getBuiltInAll() {}, + /** + * Get all the available built-in property definitions. + * @returns {Object} + */ + getBuiltInAll() { + return this.builtIn.props; + }, - addBuiltIn(prop, def = {}) {}, + /** + * Add built-in property definition. + * If the property exists already, it will extend it. + * @param {String} prop Property name. + * @param {Object} definition Property definition. + * @returns {Object} Added property definition. + * @example + * const sector = styleManager.addBuiltIn('new-property', { + * type: 'select', + * default: 'value1', + * options: [{ id: 'value1', label: 'Some label' }, ...], + * }) + */ + addBuiltIn(prop, definition) { + return this.builtIn.add(prop, definition); + }, __upProp(prop, style, parentStyles, opts) { const name = prop.getName(); diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index d80c1e7dc..81ca01b15 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -390,6 +390,7 @@ export default class PropertyFactory { result.properties = result.properties(); } this.props[property] = result; + return result; } get(prop) { From 84ac3540ad6bf2a5fa46b466f361994594a91723 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 24 Dec 2021 19:56:12 +0100 Subject: [PATCH 163/313] Update PropertyFactory tests --- src/style_manager/model/PropertyFactory.js | 10 +- .../style_manager/model/PropertyFactory.js | 426 +++++++++--------- 2 files changed, 209 insertions(+), 227 deletions(-) diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index 81ca01b15..d95173202 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -134,7 +134,7 @@ export default class PropertyFactory { [ 'font-size', { - defaults: 'medium', + default: 'medium', fixedValues: [ 'medium', 'xx-small', @@ -155,7 +155,7 @@ export default class PropertyFactory { [ 'letter-spacing', { - defaults: 'normal', + default: 'normal', fixedValues: ['normal', 'initial', 'inherit'], }, 'top', @@ -193,17 +193,17 @@ export default class PropertyFactory { ['border-top-right-radius', {}, 'padding-top'], ['border-bottom-left-radius', {}, 'padding-top'], ['border-bottom-right-radius', {}, 'padding-top'], - ['border-width', { default: '0', units: this.unitsSizeNoPerc }, 'padding-top'], + ['border-width', { default: 'medium', units: this.unitsSizeNoPerc }, 'padding-top'], ['box-shadow-h', {}, 'text-shadow-h'], ['box-shadow-v', {}, 'text-shadow-h'], ['box-shadow-blur', { default: '5px' }, 'text-shadow-blur'], ['box-shadow-spread', {}, 'text-shadow-h'], ['transition-duration', { default: '2', units: this.unitsTime }, 'padding-top'], ['perspective', {}, 'padding-top'], - ['transform-rotate-x', { functionName: 'rotateX', units: this.unitsAngle }, 'margin-top'], + ['transform-rotate-x', { functionName: 'rotateX', units: this.unitsAngle, default: '0', type: this.typeNumber }], ['transform-rotate-y', { functionName: 'rotateY' }, 'transform-rotate-x'], ['transform-rotate-z', { functionName: 'rotateZ' }, 'transform-rotate-x'], - ['transform-scale-x', { default: '1', functionName: 'scaleX', units: [] }, 'transform-rotate-x'], + ['transform-scale-x', { default: '1', functionName: 'scaleX', units: undefined }, 'transform-rotate-x'], ['transform-scale-y', { functionName: 'scaleY' }, 'transform-scale-x'], ['transform-scale-z', { functionName: 'scaleZ' }, 'transform-scale-x'], ['order', { type: this.typeNumber, default: '0', requiresParent: requireFlex }], diff --git a/test/specs/style_manager/model/PropertyFactory.js b/test/specs/style_manager/model/PropertyFactory.js index 16090f445..5ce54f89c 100644 --- a/test/specs/style_manager/model/PropertyFactory.js +++ b/test/specs/style_manager/model/PropertyFactory.js @@ -20,8 +20,8 @@ describe('PropertyFactory', () => { { property: 'float', type: 'radio', - defaults: 'none', - list: [{ value: 'none' }, { value: 'left' }, { value: 'right' }], + default: 'none', + options: [{ id: 'none' }, { id: 'left' }, { id: 'right' }], }, ]); }); @@ -31,14 +31,8 @@ describe('PropertyFactory', () => { { property: 'display', type: 'select', - defaults: 'block', - list: [ - { value: 'block' }, - { value: 'inline' }, - { value: 'inline-block' }, - { value: 'flex' }, - { value: 'none' }, - ], + default: 'block', + options: [{ id: 'block' }, { id: 'inline' }, { id: 'inline-block' }, { id: 'flex' }, { id: 'none' }], }, ]); }); @@ -48,8 +42,8 @@ describe('PropertyFactory', () => { { property: 'flex-direction', type: 'select', - defaults: 'row', - list: [{ value: 'row' }, { value: 'row-reverse' }, { value: 'column' }, { value: 'column-reverse' }], + default: 'row', + options: [{ id: 'row' }, { id: 'row-reverse' }, { id: 'column' }, { id: 'column-reverse' }], requires: { display: ['flex'] }, }, ]); @@ -60,8 +54,8 @@ describe('PropertyFactory', () => { { property: 'flex-wrap', type: 'select', - defaults: 'nowrap', - list: [{ value: 'nowrap' }, { value: 'wrap' }, { value: 'wrap-reverse' }], + default: 'nowrap', + options: [{ id: 'nowrap' }, { id: 'wrap' }, { id: 'wrap-reverse' }], requires: { display: ['flex'] }, }, ]); @@ -72,14 +66,14 @@ describe('PropertyFactory', () => { { property: 'justify-content', type: 'select', - defaults: 'flex-start', - list: [ - { value: 'flex-start' }, - { value: 'flex-end' }, - { value: 'center' }, - { value: 'space-between' }, - { value: 'space-around' }, - { value: 'space-evenly' }, + default: 'flex-start', + options: [ + { id: 'flex-start' }, + { id: 'flex-end' }, + { id: 'center' }, + { id: 'space-between' }, + { id: 'space-around' }, + { id: 'space-evenly' }, ], requires: { display: ['flex'] }, }, @@ -91,14 +85,8 @@ describe('PropertyFactory', () => { { property: 'align-items', type: 'select', - defaults: 'stretch', - list: [ - { value: 'flex-start' }, - { value: 'flex-end' }, - { value: 'center' }, - { value: 'baseline' }, - { value: 'stretch' }, - ], + default: 'stretch', + options: [{ id: 'flex-start' }, { id: 'flex-end' }, { id: 'center' }, { id: 'baseline' }, { id: 'stretch' }], requires: { display: ['flex'] }, }, ]); @@ -109,14 +97,14 @@ describe('PropertyFactory', () => { { property: 'align-content', type: 'select', - defaults: 'stretch', - list: [ - { value: 'flex-start' }, - { value: 'flex-end' }, - { value: 'center' }, - { value: 'space-between' }, - { value: 'space-around' }, - { value: 'stretch' }, + default: 'stretch', + options: [ + { id: 'flex-start' }, + { id: 'flex-end' }, + { id: 'center' }, + { id: 'space-between' }, + { id: 'space-around' }, + { id: 'stretch' }, ], requires: { display: ['flex'] }, }, @@ -128,14 +116,14 @@ describe('PropertyFactory', () => { { property: 'align-self', type: 'select', - defaults: 'auto', - list: [ - { value: 'auto' }, - { value: 'flex-start' }, - { value: 'flex-end' }, - { value: 'center' }, - { value: 'baseline' }, - { value: 'stretch' }, + default: 'auto', + options: [ + { id: 'auto' }, + { id: 'flex-start' }, + { id: 'flex-end' }, + { id: 'center' }, + { id: 'baseline' }, + { id: 'stretch' }, ], requiresParent: { display: ['flex'] }, }, @@ -147,8 +135,8 @@ describe('PropertyFactory', () => { { property: 'position', type: 'radio', - defaults: 'static', - list: [{ value: 'static' }, { value: 'relative' }, { value: 'absolute' }, { value: 'fixed' }], + default: 'static', + options: [{ id: 'static' }, { id: 'relative' }, { id: 'absolute' }, { id: 'fixed' }], }, ]); }); @@ -156,8 +144,8 @@ describe('PropertyFactory', () => { test('Build left, right', () => { var res = { type: 'integer', - units: ['px', '%', 'vw'], - defaults: 'auto', + units: obj.unitsSize, + default: 'auto', fixedValues: ['initial', 'inherit', 'auto'], }; res.property = 'right'; @@ -169,8 +157,8 @@ describe('PropertyFactory', () => { test('Build top, bottom', () => { var res = { type: 'integer', - units: ['px', '%', 'vh'], - defaults: 'auto', + units: obj.unitsSize, + default: 'auto', fixedValues: ['initial', 'inherit', 'auto'], }; res.property = 'top'; @@ -182,8 +170,8 @@ describe('PropertyFactory', () => { test('Build width family', () => { var res = { type: 'integer', - units: ['px', '%', 'vw'], - defaults: 'auto', + units: obj.unitsSize, + default: 'auto', fixedValues: ['initial', 'inherit', 'auto'], min: 0, }; @@ -198,8 +186,8 @@ describe('PropertyFactory', () => { test('Build flex-basis', () => { var res = { type: 'integer', - units: ['px', '%', 'vw', 'vh'], - defaults: 'auto', + units: obj.unitsSize, + default: 'auto', fixedValues: ['initial', 'inherit', 'auto'], requiresParent: { display: ['flex'] }, min: 0, @@ -211,8 +199,8 @@ describe('PropertyFactory', () => { test('Build height family', () => { var res = { type: 'integer', - units: ['px', '%', 'vh'], - defaults: 'auto', + units: obj.unitsSize, + default: 'auto', fixedValues: ['initial', 'inherit', 'auto'], min: 0, }; @@ -233,29 +221,29 @@ describe('PropertyFactory', () => { fixedValues: ['initial', 'inherit', 'auto'], property: 'margin-top', type: 'integer', - units: ['px', '%', 'vh'], - defaults: 0, + units: obj.unitsSize, + default: '0', }, { fixedValues: ['initial', 'inherit', 'auto'], property: 'margin-right', type: 'integer', - units: ['px', '%', 'vw'], - defaults: 0, + units: obj.unitsSize, + default: '0', }, { fixedValues: ['initial', 'inherit', 'auto'], property: 'margin-bottom', type: 'integer', - units: ['px', '%', 'vh'], - defaults: 0, + units: obj.unitsSize, + default: '0', }, { fixedValues: ['initial', 'inherit', 'auto'], property: 'margin-left', type: 'integer', - units: ['px', '%', 'vw'], - defaults: 0, + units: obj.unitsSize, + default: '0', }, ], }; @@ -271,32 +259,32 @@ describe('PropertyFactory', () => { property: 'padding-top', fixedValues: ['initial', 'inherit', 'auto'], type: 'integer', - units: ['px', '%', 'vh'], - defaults: 0, + units: obj.unitsSize, + default: '0', min: 0, }, { property: 'padding-right', fixedValues: ['initial', 'inherit', 'auto'], type: 'integer', - units: ['px', '%', 'vw'], - defaults: 0, + units: obj.unitsSize, + default: '0', min: 0, }, { property: 'padding-bottom', fixedValues: ['initial', 'inherit', 'auto'], type: 'integer', - units: ['px', '%', 'vh'], - defaults: 0, + units: obj.unitsSize, + default: '0', min: 0, }, { property: 'padding-left', fixedValues: ['initial', 'inherit', 'auto'], type: 'integer', - units: ['px', '%', 'vw'], - defaults: 0, + units: obj.unitsSize, + default: '0', min: 0, }, ], @@ -310,24 +298,24 @@ describe('PropertyFactory', () => { var res = { property: 'font-family', type: 'select', - defaults: 'Arial, Helvetica' + ss, - list: [ - { name: 'Arial', value: 'Arial, Helvetica' + ss }, - { name: 'Arial Black', value: 'Arial Black, Gadget' + ss }, - { name: 'Brush Script MT', value: 'Brush Script MT' + ss }, - { name: 'Comic Sans MS', value: 'Comic Sans MS, cursive' + ss }, - { name: 'Courier New', value: 'Courier New, Courier' + ms }, - { name: 'Georgia', value: 'Georgia, serif' }, - { name: 'Helvetica', value: 'Helvetica' + ss }, - { name: 'Impact', value: 'Impact, Charcoal' + ss }, - { - name: 'Lucida Sans Unicode', - value: 'Lucida Sans Unicode, Lucida Grande' + ss, - }, - { name: 'Tahoma', value: 'Tahoma, Geneva' + ss }, - { name: 'Times New Roman', value: 'Times New Roman, Times, serif' }, - { name: 'Trebuchet MS', value: 'Trebuchet MS, Helvetica' + ss }, - { name: 'Verdana', value: 'Verdana, Geneva' + ss }, + default: 'Arial, Helvetica' + ss, + options: [ + { label: 'Arial', id: 'Arial, Helvetica' + ss }, + { label: 'Arial Black', id: 'Arial Black, Gadget' + ss }, + { label: 'Brush Script MT', id: 'Brush Script MT' + ss }, + { label: 'Comic Sans MS', id: 'Comic Sans MS, cursive' + ss }, + { label: 'Courier New', id: 'Courier New, Courier' + ms }, + { label: 'Georgia', id: 'Georgia, serif' }, + { label: 'Helvetica', id: 'Helvetica' + ss }, + { label: 'Impact', id: 'Impact, Charcoal' + ss }, + { + label: 'Lucida Sans Unicode', + id: 'Lucida Sans Unicode, Lucida Grande' + ss, + }, + { label: 'Tahoma', id: 'Tahoma, Geneva' + ss }, + { label: 'Times New Roman', id: 'Times New Roman, Times, serif' }, + { label: 'Trebuchet MS', id: 'Trebuchet MS, Helvetica' + ss }, + { label: 'Verdana', id: 'Verdana, Geneva' + ss }, ], }; expect(obj.build('font-family')).toEqual([res]); @@ -336,8 +324,8 @@ describe('PropertyFactory', () => { test('Build font-size', () => { var res = { type: 'integer', - units: ['px', 'em', 'rem', '%'], - defaults: 'medium', + units: obj.unitsSize, + default: 'medium', min: 0, fixedValues: [ 'medium', @@ -361,8 +349,8 @@ describe('PropertyFactory', () => { test('Build letter-spacing', () => { var res = { type: 'integer', - units: ['px', 'em', 'rem', '%'], - defaults: 'normal', + units: obj.unitsSize, + default: 'normal', fixedValues: ['normal', 'initial', 'inherit'], }; res.property = 'letter-spacing'; @@ -372,17 +360,17 @@ describe('PropertyFactory', () => { test('Build font-weight', () => { var res = { type: 'select', - defaults: '400', - list: [ - { value: '100', name: 'Thin' }, - { value: '200', name: 'Extra-Light' }, - { value: '300', name: 'Light' }, - { value: '400', name: 'Normal' }, - { value: '500', name: 'Medium' }, - { value: '600', name: 'Semi-Bold' }, - { value: '700', name: 'Bold' }, - { value: '800', name: 'Extra-Bold' }, - { value: '900', name: 'Ultra-Bold' }, + default: '400', + options: [ + { id: '100', label: 'Thin' }, + { id: '200', label: 'Extra-Light' }, + { id: '300', label: 'Light' }, + { id: '400', label: 'Normal' }, + { id: '500', label: 'Medium' }, + { id: '600', label: 'Semi-Bold' }, + { id: '700', label: 'Bold' }, + { id: '800', label: 'Extra-Bold' }, + { id: '900', label: 'Ultra-Bold' }, ], }; res.property = 'font-weight'; @@ -393,7 +381,7 @@ describe('PropertyFactory', () => { var res = { property: 'color', type: 'color', - defaults: 'black', + default: 'black', }; expect(obj.build('color')).toEqual([res]); }); @@ -401,8 +389,8 @@ describe('PropertyFactory', () => { test('Build line-height', () => { var res = { type: 'integer', - units: ['px', 'em', 'rem', '%'], - defaults: 'normal', + units: obj.unitsSize, + default: 'normal', fixedValues: ['normal', 'initial', 'inherit'], }; res.property = 'line-height'; @@ -412,8 +400,8 @@ describe('PropertyFactory', () => { test('Build text-align', () => { var res = { type: 'radio', - defaults: 'left', - list: [{ value: 'left' }, { value: 'center' }, { value: 'right' }, { value: 'justify' }], + default: 'left', + options: [{ id: 'left' }, { id: 'center' }, { id: 'right' }, { id: 'justify' }], }; res.property = 'text-align'; expect(obj.build('text-align')).toEqual([res]); @@ -423,31 +411,31 @@ describe('PropertyFactory', () => { var res = { type: 'stack', preview: true, - defaults: 'none', + default: 'none', properties: [ { property: 'text-shadow-h', type: 'integer', - units: ['px', '%'], - defaults: 0, + units: obj.unitsSizeNoPerc, + default: '0', }, { property: 'text-shadow-v', type: 'integer', - units: ['px', '%'], - defaults: 0, + units: obj.unitsSizeNoPerc, + default: '0', }, { property: 'text-shadow-blur', type: 'integer', - units: ['px', '%'], - defaults: 0, + units: obj.unitsSizeNoPerc, + default: '0', min: 0, }, { property: 'text-shadow-color', type: 'color', - defaults: 'black', + default: 'black', }, ], }; @@ -458,8 +446,8 @@ describe('PropertyFactory', () => { test('Build border-radius-c', () => { var res = { type: 'integer', - units: ['px', '%'], - defaults: 0, + units: obj.unitsSize, + default: '0', min: 0, }; res.property = 'border-radius'; @@ -474,30 +462,30 @@ describe('PropertyFactory', () => { { property: 'border-top-left-radius', type: 'integer', - units: ['px', '%'], - defaults: '0px', + units: obj.unitsSize, + default: '0', min: 0, }, { property: 'border-top-right-radius', type: 'integer', - units: ['px', '%'], + units: obj.unitsSize, min: 0, - defaults: '0px', + default: '0', }, { property: 'border-bottom-right-radius', type: 'integer', - units: ['px', '%'], + units: obj.unitsSize, min: 0, - defaults: '0px', + default: '0', }, { property: 'border-bottom-left-radius', type: 'integer', - units: ['px', '%'], + units: obj.unitsSize, min: 0, - defaults: '0px', + default: '0', }, ], }; @@ -508,7 +496,7 @@ describe('PropertyFactory', () => { test('Build background-color', () => { var res = { type: 'color', - defaults: 'none', + default: 'none', }; res.property = 'background-color'; expect(obj.build('background-color')).toEqual([res]); @@ -522,30 +510,30 @@ describe('PropertyFactory', () => { { property: 'border-width', type: 'integer', - units: ['px', 'em'], - defaults: 'medium', + units: obj.unitsSizeNoPerc, + default: 'medium', min: 0, }, { property: 'border-style', type: 'select', - defaults: 'solid', - list: [ - { value: 'none' }, - { value: 'solid' }, - { value: 'dotted' }, - { value: 'dashed' }, - { value: 'double' }, - { value: 'groove' }, - { value: 'ridge' }, - { value: 'inset' }, - { value: 'outset' }, + default: 'solid', + options: [ + { id: 'none' }, + { id: 'solid' }, + { id: 'dotted' }, + { id: 'dashed' }, + { id: 'double' }, + { id: 'groove' }, + { id: 'ridge' }, + { id: 'inset' }, + { id: 'outset' }, ], }, { property: 'border-color', type: 'color', - defaults: 'black', + default: 'black', }, ], }; @@ -561,40 +549,40 @@ describe('PropertyFactory', () => { { property: 'box-shadow-h', type: 'integer', - units: ['px', '%'], - defaults: 0, + units: obj.unitsSizeNoPerc, + default: '0', }, { property: 'box-shadow-v', type: 'integer', - units: ['px', '%'], - defaults: 0, + units: obj.unitsSizeNoPerc, + default: '0', }, { property: 'box-shadow-blur', type: 'integer', - units: ['px'], - defaults: '5px', + units: obj.unitsSizeNoPerc, + default: '5px', min: 0, }, { property: 'box-shadow-spread', type: 'integer', - units: ['px'], - defaults: 0, + units: obj.unitsSizeNoPerc, + default: '0', }, { property: 'box-shadow-color', type: 'color', - defaults: 'black', + default: 'black', }, { property: 'box-shadow-type', type: 'select', - defaults: '', - list: [ - { value: '', name: 'Outside' }, - { value: 'inset', name: 'Inside' }, + default: '', + options: [ + { id: '', label: 'Outside' }, + { id: 'inset', label: 'Inside' }, ], }, ], @@ -617,36 +605,36 @@ describe('PropertyFactory', () => { { property: 'background-repeat', type: 'select', - defaults: 'repeat', - list: [{ value: 'repeat' }, { value: 'repeat-x' }, { value: 'repeat-y' }, { value: 'no-repeat' }], + default: 'repeat', + options: [{ id: 'repeat' }, { id: 'repeat-x' }, { id: 'repeat-y' }, { id: 'no-repeat' }], }, { property: 'background-position', type: 'select', - defaults: 'left top', - list: [ - { value: 'left top' }, - { value: 'left center' }, - { value: 'left bottom' }, - { value: 'right top' }, - { value: 'right center' }, - { value: 'right bottom' }, - { value: 'center top' }, - { value: 'center center' }, - { value: 'center bottom' }, + default: 'left top', + options: [ + { id: 'left top' }, + { id: 'left center' }, + { id: 'left bottom' }, + { id: 'right top' }, + { id: 'right center' }, + { id: 'right bottom' }, + { id: 'center top' }, + { id: 'center center' }, + { id: 'center bottom' }, ], }, { property: 'background-attachment', type: 'select', - defaults: 'scroll', - list: [{ value: 'scroll' }, { value: 'fixed' }, { value: 'local' }], + default: 'scroll', + options: [{ id: 'scroll' }, { id: 'fixed' }, { id: 'local' }], }, { property: 'background-size', type: 'select', - defaults: 'auto', - list: [{ value: 'auto' }, { value: 'cover' }, { value: 'contain' }], + default: 'auto', + options: [{ id: 'auto' }, { id: 'cover' }, { id: 'contain' }], }, ], }; @@ -661,35 +649,29 @@ describe('PropertyFactory', () => { { property: 'transition-property', type: 'select', - defaults: 'width', - list: [ - { value: 'all' }, - { value: 'width' }, - { value: 'height' }, - { value: 'background-color' }, - { value: 'transform' }, - { value: 'box-shadow' }, - { value: 'opacity' }, + default: 'width', + options: [ + { id: 'all' }, + { id: 'width' }, + { id: 'height' }, + { id: 'background-color' }, + { id: 'transform' }, + { id: 'box-shadow' }, + { id: 'opacity' }, ], }, { property: 'transition-duration', type: 'integer', - units: ['s'], - defaults: '2', + units: obj.unitsTime, + default: '2', min: 0, }, { property: 'transition-timing-function', type: 'select', - defaults: 'ease', - list: [ - { value: 'linear' }, - { value: 'ease' }, - { value: 'ease-in' }, - { value: 'ease-out' }, - { value: 'ease-in-out' }, - ], + default: 'ease', + options: [{ id: 'linear' }, { id: 'ease' }, { id: 'ease-in' }, { id: 'ease-out' }, { id: 'ease-in-out' }], }, ], }; @@ -700,8 +682,8 @@ describe('PropertyFactory', () => { var res = { property: 'perspective', type: 'integer', - units: ['px'], - defaults: 0, + units: obj.unitsSize, + default: '0', min: 0, }; expect(obj.build('perspective')).toEqual([res]); @@ -715,40 +697,40 @@ describe('PropertyFactory', () => { { property: 'transform-rotate-x', type: 'integer', - units: ['deg'], - defaults: 0, + units: obj.unitsAngle, + default: '0', functionName: 'rotateX', }, { property: 'transform-rotate-y', type: 'integer', - units: ['deg'], - defaults: 0, + units: obj.unitsAngle, + default: '0', functionName: 'rotateY', }, { property: 'transform-rotate-z', type: 'integer', - units: ['deg'], - defaults: 0, + units: obj.unitsAngle, + default: '0', functionName: 'rotateZ', }, { property: 'transform-scale-x', type: 'integer', - defaults: 1, + default: '1', functionName: 'scaleX', }, { property: 'transform-scale-y', type: 'integer', - defaults: 1, + default: '1', functionName: 'scaleY', }, { property: 'transform-scale-z', type: 'integer', - defaults: 1, + default: '1', functionName: 'scaleZ', }, ], @@ -760,17 +742,17 @@ describe('PropertyFactory', () => { var res = { type: 'select', property: 'cursor', - defaults: 'auto', - list: [ - { value: 'auto' }, - { value: 'pointer' }, - { value: 'copy' }, - { value: 'crosshair' }, - { value: 'grab' }, - { value: 'grabbing' }, - { value: 'help' }, - { value: 'move' }, - { value: 'text' }, + default: 'auto', + options: [ + { id: 'auto' }, + { id: 'pointer' }, + { id: 'copy' }, + { id: 'crosshair' }, + { id: 'grab' }, + { id: 'grabbing' }, + { id: 'help' }, + { id: 'move' }, + { id: 'text' }, ], }; expect(obj.build('cursor')).toEqual([res]); @@ -780,8 +762,8 @@ describe('PropertyFactory', () => { var res = { type: 'select', property: 'overflow', - defaults: 'visible', - list: [{ value: 'visible' }, { value: 'hidden' }, { value: 'scroll' }, { value: 'auto' }], + default: 'visible', + options: [{ id: 'visible' }, { id: 'hidden' }, { id: 'scroll' }, { id: 'auto' }], }; expect(obj.build('overflow')).toEqual([res]); }); @@ -790,8 +772,8 @@ describe('PropertyFactory', () => { var res = { type: 'select', property: 'overflow-x', - defaults: 'visible', - list: [{ value: 'visible' }, { value: 'hidden' }, { value: 'scroll' }, { value: 'auto' }], + default: 'visible', + options: [{ id: 'visible' }, { id: 'hidden' }, { id: 'scroll' }, { id: 'auto' }], }; expect(obj.build('overflow-x')).toEqual([res]); }); @@ -800,8 +782,8 @@ describe('PropertyFactory', () => { var res = { type: 'select', property: 'overflow-y', - defaults: 'visible', - list: [{ value: 'visible' }, { value: 'hidden' }, { value: 'scroll' }, { value: 'auto' }], + default: 'visible', + options: [{ id: 'visible' }, { id: 'hidden' }, { id: 'scroll' }, { id: 'auto' }], }; expect(obj.build('overflow-y')).toEqual([res]); }); From 487e60db8b93b8b33f9152566441175d3021e855 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 25 Dec 2021 13:00:45 +0100 Subject: [PATCH 164/313] Fix PropertyFactory tests --- src/style_manager/model/PropertyFactory.js | 27 ++++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index d95173202..584a45dbb 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -185,21 +185,28 @@ export default class PropertyFactory { }, 'float', ], - ['text-shadow-h', { default: '0', units: this.unitsSizeNoPerc }, 'top'], + [ + 'text-shadow-h', + { + type: this.typeNumber, + default: '0', + units: this.unitsSizeNoPerc, + }, + ], ['text-shadow-v', {}, 'text-shadow-h'], ['text-shadow-blur', { min: 0 }, 'text-shadow-h'], - ['border-radius-c', { property: 'border-radius' }, 'padding-top'], - ['border-top-left-radius', {}, 'padding-top'], - ['border-top-right-radius', {}, 'padding-top'], - ['border-bottom-left-radius', {}, 'padding-top'], - ['border-bottom-right-radius', {}, 'padding-top'], - ['border-width', { default: 'medium', units: this.unitsSizeNoPerc }, 'padding-top'], + ['border-radius-c', { property: 'border-radius', fixedValues: undefined }, 'padding-top'], + ['border-top-left-radius', {}, 'border-radius-c'], + ['border-top-right-radius', {}, 'border-radius-c'], + ['border-bottom-left-radius', {}, 'border-radius-c'], + ['border-bottom-right-radius', {}, 'border-radius-c'], + ['border-width', { default: 'medium', units: this.unitsSizeNoPerc }, 'border-radius-c'], ['box-shadow-h', {}, 'text-shadow-h'], ['box-shadow-v', {}, 'text-shadow-h'], ['box-shadow-blur', { default: '5px' }, 'text-shadow-blur'], ['box-shadow-spread', {}, 'text-shadow-h'], - ['transition-duration', { default: '2', units: this.unitsTime }, 'padding-top'], - ['perspective', {}, 'padding-top'], + ['transition-duration', { default: '2', units: this.unitsTime }, 'border-radius-c'], + ['perspective', {}, 'border-radius-c'], ['transform-rotate-x', { functionName: 'rotateX', units: this.unitsAngle, default: '0', type: this.typeNumber }], ['transform-rotate-y', { functionName: 'rotateY' }, 'transform-rotate-x'], ['transform-rotate-z', { functionName: 'rotateZ' }, 'transform-rotate-x'], @@ -254,7 +261,7 @@ export default class PropertyFactory { options: [{ id: 'auto' }, ...optsFlexAlign], requiresParent: requireFlex, }, - 'align-items', + 'display', ], ['font-family', { default: 'Arial, Helvetica, sans-serif', options: this.optsFonts }, 'display'], ['font-weight', { default: '400', options: this.optsWeight }, 'display'], From a616aa7f504c84784e1fb132de18c341c6764721 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 25 Dec 2021 13:12:56 +0100 Subject: [PATCH 165/313] Up property factory --- src/style_manager/model/PropertyFactory.js | 100 +++++++-------------- 1 file changed, 30 insertions(+), 70 deletions(-) diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index 584a45dbb..b72904c71 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -27,6 +27,9 @@ export default class PropertyFactory { this.opstDisplay = getOptions(['block', 'inline', 'inline-block', 'flex', 'none']); this.optsTransitFn = getOptions(['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out']); this.optsCursor = getOptions(['auto', 'pointer', 'copy', 'crosshair', 'grab', 'grabbing', 'help', 'move', 'text']); + this.optsFloat = getOptions(['none', 'left', 'right']); + this.optsPos = getOptions(['static', 'relative', 'absolute', 'fixed']); + this.optsTextAlign = getOptions(['left', 'center', 'right', 'justify']); this.optsTransitProp = getOptions([ 'all', 'width', @@ -87,6 +90,23 @@ export default class PropertyFactory { return { id: font, label: font.split(',')[0] }; }); + // Fixed values + this.fixedFontSizes = [ + 'medium', + 'xx-small', + 'x-small', + 'small', + 'large', + 'x-large', + 'xx-large', + 'smaller', + 'larger', + 'length', + 'initial', + 'inherit', + ]; + this.fixedLetSpace = ['normal', 'initial', 'inherit']; + this.init(); } @@ -99,20 +119,14 @@ export default class PropertyFactory { const requireFlex = { display: ['flex'] }; const optsFlex = [{ id: 'flex-start' }, { id: 'flex-end' }, { id: 'center' }]; const optsFlexAlign = [...optsFlex, { id: 'baseline' }, { id: 'stretch' }]; + const { fixedValues } = this; // Build default built-in properties (the order, in the array here below, matters) // [propertyName, propertyDefinition, extendFromProperty] [ // Number types - [ - 'top', - { - type: this.typeNumber, - default: 'auto', - units: this.unitsSize, - fixedValues: this.fixedValues, - }, - ], + ['text-shadow-h', { type: this.typeNumber, default: '0', units: this.unitsSizeNoPerc }], + ['top', { default: 'auto', units: this.unitsSize, fixedValues }, 'text-shadow-h'], ['right', {}, 'top'], ['bottom', {}, 'top'], ['left', {}, 'top'], @@ -131,68 +145,9 @@ export default class PropertyFactory { ['min-height', {}, 'width'], ['max-height', {}, 'width'], ['flex-basis', { requiresParent: requireFlex }, 'width'], - [ - 'font-size', - { - default: 'medium', - fixedValues: [ - 'medium', - 'xx-small', - 'x-small', - 'small', - 'large', - 'x-large', - 'xx-large', - 'smaller', - 'larger', - 'length', - 'initial', - 'inherit', - ], - }, - 'width', - ], - [ - 'letter-spacing', - { - default: 'normal', - fixedValues: ['normal', 'initial', 'inherit'], - }, - 'top', - ], + ['font-size', { default: 'medium', fixedValues: this.fixedFontSizes }, 'width'], + ['letter-spacing', { default: 'normal', fixedValues: this.fixedLetSpace }, 'top'], ['line-height', {}, 'letter-spacing'], - [ - 'float', - { - type: this.typeRadio, - default: 'none', - options: [{ id: 'none' }, { id: 'left' }, { id: 'right' }], - }, - ], - [ - 'position', - { - default: 'static', - options: [{ id: 'static' }, { id: 'relative' }, { id: 'absolute' }, { id: 'fixed' }], // TODO sticky - }, - 'float', - ], - [ - 'text-align', - { - default: 'left', - options: [{ id: 'left' }, { id: 'center' }, { id: 'right' }, { id: 'justify' }], - }, - 'float', - ], - [ - 'text-shadow-h', - { - type: this.typeNumber, - default: '0', - units: this.unitsSizeNoPerc, - }, - ], ['text-shadow-v', {}, 'text-shadow-h'], ['text-shadow-blur', { min: 0 }, 'text-shadow-h'], ['border-radius-c', { property: 'border-radius', fixedValues: undefined }, 'padding-top'], @@ -217,6 +172,11 @@ export default class PropertyFactory { ['flex-grow', {}, 'order'], ['flex-shrink', { default: '1' }, 'order'], + // Radio types + ['float', { type: this.typeRadio, default: 'none', options: this.optsFloat }], + ['position', { default: 'static', options: this.optsPos }, 'float'], + ['text-align', { default: 'left', options: this.optsTextAlign }, 'float'], + // Color types ['color', { type: this.typeColor, default: 'black' }], ['text-shadow-color', {}, 'color'], From b797f360ca0920ad491158015b12be176e5f52a0 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 25 Dec 2021 13:24:51 +0100 Subject: [PATCH 166/313] Update property factory --- src/style_manager/model/PropertyFactory.js | 839 +-------------------- 1 file changed, 21 insertions(+), 818 deletions(-) diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index b72904c71..37483eb20 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -17,6 +17,8 @@ export default class PropertyFactory { this.unitsAngle = ['deg', 'rad', 'grad']; this.fixedValues = ['initial', 'inherit', 'auto']; const ss = ', sans-serif'; + const optsFlex = ['flex-start', 'flex-end', 'center']; + const optsFlexAlign = [...optsFlex, 'baseline', 'stretch']; this.optsBgSize = getOptions(['auto', 'cover', 'contain']); this.optsBgAttach = getOptions(['scroll', 'fixed', 'local']); @@ -30,6 +32,10 @@ export default class PropertyFactory { this.optsFloat = getOptions(['none', 'left', 'right']); this.optsPos = getOptions(['static', 'relative', 'absolute', 'fixed']); this.optsTextAlign = getOptions(['left', 'center', 'right', 'justify']); + this.optsFlexAlign = getOptions(optsFlexAlign); + this.optsJustCont = getOptions([...optsFlex, 'space-between', 'space-around', 'space-evenly']); + this.optsAlignCont = getOptions([...optsFlex, 'space-between', 'space-around', 'stretch']); + this.optsAlignSelf = getOptions(['auto', ...optsFlexAlign]); this.optsTransitProp = getOptions([ 'all', 'width', @@ -72,6 +78,10 @@ export default class PropertyFactory { { id: '800', label: 'Extra-Bold' }, { id: '900', label: 'Ultra-Bold' }, ]; + this.optsShadowType = [ + { id: '', label: 'Outside' }, + { id: 'inset', label: 'Inside' }, + ]; this.optsFonts = [ 'Arial, Helvetica' + ss, 'Arial Black, Gadget' + ss, @@ -106,6 +116,7 @@ export default class PropertyFactory { 'inherit', ]; this.fixedLetSpace = ['normal', 'initial', 'inherit']; + this.requireFlex = { display: ['flex'] }; this.init(); } @@ -115,17 +126,14 @@ export default class PropertyFactory { } init() { + const { fixedValues, requireFlex, typeNumber } = this; this.props = {}; - const requireFlex = { display: ['flex'] }; - const optsFlex = [{ id: 'flex-start' }, { id: 'flex-end' }, { id: 'center' }]; - const optsFlexAlign = [...optsFlex, { id: 'baseline' }, { id: 'stretch' }]; - const { fixedValues } = this; // Build default built-in properties (the order, in the array here below, matters) // [propertyName, propertyDefinition, extendFromProperty] [ // Number types - ['text-shadow-h', { type: this.typeNumber, default: '0', units: this.unitsSizeNoPerc }], + ['text-shadow-h', { type: typeNumber, default: '0', units: this.unitsSizeNoPerc }], ['top', { default: 'auto', units: this.unitsSize, fixedValues }, 'text-shadow-h'], ['right', {}, 'top'], ['bottom', {}, 'top'], @@ -162,13 +170,13 @@ export default class PropertyFactory { ['box-shadow-spread', {}, 'text-shadow-h'], ['transition-duration', { default: '2', units: this.unitsTime }, 'border-radius-c'], ['perspective', {}, 'border-radius-c'], - ['transform-rotate-x', { functionName: 'rotateX', units: this.unitsAngle, default: '0', type: this.typeNumber }], + ['transform-rotate-x', { functionName: 'rotateX', units: this.unitsAngle, default: '0', type: typeNumber }], ['transform-rotate-y', { functionName: 'rotateY' }, 'transform-rotate-x'], ['transform-rotate-z', { functionName: 'rotateZ' }, 'transform-rotate-x'], ['transform-scale-x', { default: '1', functionName: 'scaleX', units: undefined }, 'transform-rotate-x'], ['transform-scale-y', { functionName: 'scaleY' }, 'transform-scale-x'], ['transform-scale-z', { functionName: 'scaleZ' }, 'transform-scale-x'], - ['order', { type: this.typeNumber, default: '0', requiresParent: requireFlex }], + ['order', { type: typeNumber, default: '0', requiresParent: requireFlex }], ['flex-grow', {}, 'order'], ['flex-shrink', { default: '1' }, 'order'], @@ -188,55 +196,17 @@ export default class PropertyFactory { ['background-image', { type: this.typeFile, functionName: 'url' }], // Select types - [ - 'display', - { - type: this.typeSelect, - default: 'block', - options: this.opstDisplay, - }, - ], + ['display', { type: this.typeSelect, default: 'block', options: this.opstDisplay }], ['flex-direction', { default: 'row', options: this.optsDir, requires: requireFlex }, 'display'], ['flex-wrap', { default: 'nowrap', options: this.optsWrap }, 'flex-direction'], - [ - 'justify-content', - { - default: 'flex-start', - options: [...optsFlex, { id: 'space-between' }, { id: 'space-around' }, { id: 'space-evenly' }], - }, - 'flex-wrap', - ], - ['align-items', { default: 'stretch', options: optsFlexAlign }, 'flex-wrap'], - [ - 'align-content', - { - options: [...optsFlex, { id: 'space-between' }, { id: 'space-around' }, { id: 'stretch' }], - }, - 'align-items', - ], - [ - 'align-self', - { - default: 'auto', - options: [{ id: 'auto' }, ...optsFlexAlign], - requiresParent: requireFlex, - }, - 'display', - ], + ['justify-content', { default: 'flex-start', options: this.optsJustCont }, 'flex-wrap'], + ['align-items', { default: 'stretch', options: this.optsFlexAlign }, 'flex-wrap'], + ['align-content', { options: this.optsAlignCont }, 'align-items'], + ['align-self', { default: 'auto', options: this.optsAlignSelf, requiresParent: requireFlex }, 'display'], ['font-family', { default: 'Arial, Helvetica, sans-serif', options: this.optsFonts }, 'display'], ['font-weight', { default: '400', options: this.optsWeight }, 'display'], ['border-style', { default: 'solid', options: this.optsBorderStyle }, 'display'], - [ - 'box-shadow-type', - { - default: '', - options: [ - { id: '', label: 'Outside' }, - { id: 'inset', label: 'Inside' }, - ], - }, - 'display', - ], + ['box-shadow-type', { default: '', options: this.optsShadowType }, 'display'], ['background-repeat', { default: 'repeat', options: this.optsBgRepeat }, 'display'], ['background-position', { default: 'left top', options: this.optsBgPos }, 'display'], ['background-attachment', { default: 'scroll', options: this.optsBgAttach }, 'display'], @@ -378,772 +348,5 @@ export default class PropertyFactory { }); return result; - - for (var i = 0, len = props.length; i < len; i++) { - var obj = {}; - var prop = props[i]; - obj.property = prop; - - // Property - // switch (prop) { - // // case 'border-radius-c': - // // obj.property = 'border-radius'; - // // break; - // } - - // Fixed values - // switch (prop) { - // // case 'top': - // // case 'right': - // // case 'bottom': - // // case 'left': - // // case 'margin-top': - // // case 'margin-right': - // // case 'margin-bottom': - // // case 'margin-left': - // // case 'padding-top': - // // case 'padding-right': - // // case 'padding-bottom': - // // case 'padding-left': - // // case 'width': - // // case 'max-width': - // // case 'min-width': - // // case 'height': - // // case 'max-height': - // // case 'min-height': - // // case 'flex-basis': - // case 'n': - // obj.fixedValues = ['initial', 'inherit', 'auto']; - // break; - // // case 'font-size': - // case 'n': - // obj.fixedValues = [ - // 'medium', - // 'xx-small', - // 'x-small', - // 'small', - // 'large', - // 'x-large', - // 'xx-large', - // 'smaller', - // 'larger', - // 'length', - // 'initial', - // 'inherit' - // ]; - // break; - // // case 'letter-spacing': - // // case 'line-height': - // case 'n': - // obj.fixedValues = ['normal', 'initial', 'inherit']; - // break; - // } - - // Type - switch ( - prop - // case 'float': - // case 'position': - // case 'text-align': - // obj.type = 'radio'; - // break; - // case 'display': - // case 'flex-direction': - // case 'flex-wrap': - // case 'justify-content': - // case 'align-items': - // case 'align-content': - // case 'align-self': - // case 'font-family': - // case 'font-weight': - // case 'border-style': - // case 'box-shadow-type': - // case 'background-repeat': - // case 'background-position': - // case 'background-attachment': - // case 'background-size': - // case 'transition-property': - // case 'transition-timing-function': - // case 'cursor': - // case 'overflow': - // case 'overflow-x': - // case 'overflow-y': - // obj.type = 'select'; - // break; - // case 'top': - // case 'right': - // case 'bottom': - // case 'left': - // case 'margin-top': - // case 'margin-right': - // case 'margin-bottom': - // case 'margin-left': - // case 'padding-top': - // case 'padding-right': - // case 'padding-bottom': - // case 'padding-left': - // case 'min-height': - // case 'min-width': - // case 'max-height': - // case 'max-width': - // case 'width': - // case 'height': - // case 'font-size': - // case 'letter-spacing': - // case 'line-height': - // case 'text-shadow-h': - // case 'text-shadow-v': - // case 'text-shadow-blur': - // case 'border-radius-c': - // case 'border-top-left-radius': - // case 'border-top-right-radius': - // case 'border-bottom-left-radius': - // case 'border-bottom-right-radius': - // case 'border-width': - // case 'box-shadow-h': - // case 'box-shadow-v': - // case 'box-shadow-blur': - // case 'box-shadow-spread': - // case 'transition-duration': - // case 'perspective': - // case 'transform-rotate-x': - // case 'transform-rotate-y': - // case 'transform-rotate-z': - // case 'transform-scale-x': - // case 'transform-scale-y': - // case 'transform-scale-z': - // case 'order': - // case 'flex-grow': - // case 'flex-shrink': - // case 'flex-basis': - // obj.type = 'integer'; - // break; - // case 'margin': - // case 'padding': - // case 'border-radius': - // case 'border': - // case 'transform': - // obj.type = 'composite'; - // break; - // case 'color': - // case 'text-shadow-color': - // case 'background-color': - // case 'border-color': - // case 'box-shadow-color': - // obj.type = 'color'; - // break; - // case 'text-shadow': - // case 'box-shadow': - // case 'background': - // case 'transition': - // obj.type = 'stack'; - // break; - // case 'background-image': - // obj.type = 'file'; - // break; - ) { - } - - // Defaults - switch ( - prop - // case 'float': - // case 'background-color': - // case 'text-shadow': - // obj.defaults = 'none'; - // break; - // // case 'display': - // obj.defaults = 'block'; - // break; - // // case 'flex-direction': - // obj.defaults = 'row'; - // break; - // // case 'flex-wrap': - // obj.defaults = 'nowrap'; - // break; - // // case 'justify-content': - // obj.defaults = 'flex-start'; - // break; - // // case 'align-items': - // obj.defaults = 'stretch'; - // break; - // // case 'align-content': - // obj.defaults = 'stretch'; - // break; - // // case 'align-self': - // obj.defaults = 'auto'; - // break; - // // case 'position': - // obj.defaults = 'static'; - // break; - // case 'margin-top': - // case 'margin-right': - // case 'margin-bottom': - // case 'margin-left': - // case 'padding-top': - // case 'padding-right': - // case 'padding-bottom': - // case 'padding-left': - // case 'text-shadow-h': - // case 'text-shadow-v': - // case 'text-shadow-blur': - // case 'border-radius-c': - // case 'box-shadow-h': - // case 'box-shadow-v': - // case 'box-shadow-spread': - // case 'perspective': - // case 'transform-rotate-x': - // case 'transform-rotate-y': - // case 'transform-rotate-z': - // case 'order': - // case 'flex-grow': - // obj.defaults = 0; - // break; - // case 'border-top-left-radius': - // case 'border-top-right-radius': - // case 'border-bottom-left-radius': - // case 'border-bottom-right-radius': - // obj.defaults = '0px'; - // break; - // case 'transform-scale-x': - // case 'transform-scale-y': - // case 'transform-scale-z': - // case 'flex-shrink': - // obj.defaults = 1; - // break; - // case 'box-shadow-blur': - // obj.defaults = '5px'; - // break; - // case 'top': - // case 'right': - // case 'bottom': - // case 'left': - // case 'min-height': - // case 'min-width': - // case 'max-height': - // case 'max-width': - // case 'width': - // case 'height': - // case 'background-size': - // case 'cursor': - // case 'flex-basis': - // obj.defaults = 'auto'; - // break; - // // case 'font-family': - // obj.defaults = 'Arial, Helvetica, sans-serif'; - // break; - // // case 'font-size': - // // case 'border-width': - // obj.defaults = 'medium'; - // break; - // // case 'font-weight': - // obj.defaults = '400'; - // break; - // // case 'letter-spacing': - // // case 'line-height': - // obj.defaults = 'normal'; - // break; - // case 'color': - // case 'text-shadow-color': - // case 'border-color': - // case 'box-shadow-color': - // obj.defaults = 'black'; - // break; - // case 'text-align': - // obj.defaults = 'left'; - // break; - // case 'border-style': - // obj.defaults = 'solid'; - // break; - // // case 'box-shadow-type': - // obj.defaults = ''; - // break; - // // case 'background-repeat': - // obj.defaults = 'repeat'; - // break; - // // case 'background-position': - // obj.defaults = 'left top'; - // break; - // // case 'background-attachment': - // obj.defaults = 'scroll'; - // break; - // // case 'transition-property': - // obj.defaults = 'width'; - // break; - // // case 'transition-duration': - // obj.defaults = '2'; - // break; - // // case 'transition-timing-function': - // obj.defaults = 'ease'; - // break; - // // case 'overflow': - // // case 'overflow-x': - // // case 'overflow-y': - // obj.defaults = 'visible'; - // break; - ) { - } - - /* - * Add styleable dependency on other properties. Allows properties to be - * dynamically hidden or shown based on values of other properties. - * - * Property will be styleable if all of the properties (keys) in the - * requires object have any of the values specified in the array. - */ - // switch (prop) { - // // case 'flex-direction': - // // case 'flex-wrap': - // // case 'justify-content': - // // case 'align-items': - // // case 'align-content': - // // obj.requires = { display: ['flex'] }; - // // break; - // // case 'order': - // // case 'flex-basis': - // // case 'flex-grow': - // // case 'flex-shrink': - // // case 'align-self': - // // obj.requiresParent = { display: ['flex'] }; - // // break; - // } - - // Units - // switch (prop) { - // case 'top': - // case 'bottom': - // case 'margin-top': - // case 'margin-bottom': - // case 'padding-top': - // case 'padding-bottom': - // case 'min-height': - // case 'max-height': - // case 'height': - // obj.units = ['px', '%', 'vh']; - // break; - // case 'right': - // case 'left': - // case 'margin-right': - // case 'margin-left': - // case 'padding-right': - // case 'padding-left': - // case 'min-width': - // case 'max-width': - // case 'width': - // obj.units = ['px', '%', 'vw']; - // break; - // case 'flex-basis': - // obj.units = ['px', '%', 'vw', 'vh']; - // break; - // case 'text-shadow-v': - // case 'text-shadow-h': - // case 'text-shadow-blur': - // case 'border-radius-c': - // case 'border-top-left-radius': - // case 'border-top-right-radius': - // case 'border-bottom-left-radius': - // case 'border-bottom-right-radius': - // case 'box-shadow-h': - // case 'box-shadow-v': - // obj.units = ['px', '%']; - // break; - // case 'font-size': - // case 'letter-spacing': - // case 'line-height': - // obj.units = ['px', 'em', 'rem', '%']; - // break; - // case 'border-width': - // obj.units = ['px', 'em']; - // break; - // case 'box-shadow-blur': - // case 'box-shadow-spread': - // case 'perspective': - // obj.units = ['px']; - // break; - // case 'transition-duration': - // obj.units = ['s']; - // break; - // case 'transform-rotate-x': - // case 'transform-rotate-y': - // case 'transform-rotate-z': - // obj.units = ['deg']; - // break; - // } - - // Min/Max - // switch (prop) { - // case 'padding-top': - // case 'padding-right': - // case 'padding-bottom': - // case 'padding-left': - // case 'min-height': - // case 'min-width': - // case 'max-height': - // case 'max-width': - // case 'width': - // case 'height': - // case 'font-size': - // case 'text-shadow-blur': - // case 'border-radius-c': - // case 'border-top-left-radius': - // case 'border-top-right-radius': - // case 'border-bottom-left-radius': - // case 'border-bottom-right-radius': - // case 'border-width': - // case 'box-shadow-blur': - // case 'transition-duration': - // case 'perspective': - // case 'flex-basis': - // obj.min = 0; - // break; - // } - - // Preview - // switch (prop) { - // case 'text-shadow': - // case 'box-shadow': - // case 'background': - // obj.preview = true; - // break; - // } - - // Detached - // switch (prop) { - // case 'background': - // obj.detached = true; - // break; - // } - - // Functions - // switch (prop) { - // // // case 'transform-rotate-x': - // // obj.functionName = 'rotateX'; - // // break; - // // // case 'transform-rotate-y': - // // obj.functionName = 'rotateY'; - // // break; - // // // case 'transform-rotate-z': - // // obj.functionName = 'rotateZ'; - // // break; - // // // case 'transform-scale-x': - // // obj.functionName = 'scaleX'; - // // break; - // // // case 'transform-scale-y': - // // obj.functionName = 'scaleY'; - // // break; - // // // case 'transform-scale-z': - // // obj.functionName = 'scaleZ'; - // // break; - // // case 'background-image': - // // obj.functionName = 'url'; - // // break; - // } - - // Options - // switch (prop) { - // case 'float': - // obj.list = [{ value: 'none' }, { value: 'left' }, { value: 'right' }]; - // break; - // case 'display': - // obj.list = [ - // { value: 'block' }, - // { value: 'inline' }, - // { value: 'inline-block' }, - // { value: 'flex' }, - // { value: 'none' } - // ]; - // break; - // case 'flex-direction': - // obj.list = [ - // { value: 'row' }, - // { value: 'row-reverse' }, - // { value: 'column' }, - // { value: 'column-reverse' } - // ]; - // break; - // case 'flex-wrap': - // obj.list = [ - // { value: 'nowrap' }, - // { value: 'wrap' }, - // { value: 'wrap-reverse' } - // ]; - // break; - // case 'justify-content': - // obj.list = [ - // { value: 'flex-start' }, - // { value: 'flex-end' }, - // { value: 'center' }, - // { value: 'space-between' }, - // { value: 'space-around' }, - // { value: 'space-evenly' } - // ]; - // break; - // case 'align-items': - // obj.list = [ - // { value: 'flex-start' }, - // { value: 'flex-end' }, - // { value: 'center' }, - // { value: 'baseline' }, - // { value: 'stretch' } - // ]; - // break; - // case 'align-content': - // obj.list = [ - // { value: 'flex-start' }, - // { value: 'flex-end' }, - // { value: 'center' }, - // { value: 'space-between' }, - // { value: 'space-around' }, - // { value: 'stretch' } - // ]; - // break; - // case 'align-self': - // obj.list = [ - // { value: 'auto' }, - // { value: 'flex-start' }, - // { value: 'flex-end' }, - // { value: 'center' }, - // { value: 'baseline' }, - // { value: 'stretch' } - // ]; - // break; - // case 'position': - // obj.list = [ - // { value: 'static' }, - // { value: 'relative' }, - // { value: 'absolute' }, - // { value: 'fixed' } - // ]; - // break; - // case 'font-family': - // var ss = ', sans-serif'; - // var fonts = [ - // 'Arial, Helvetica' + ss, - // 'Arial Black, Gadget' + ss, - // 'Brush Script MT' + ss, - // 'Comic Sans MS, cursive' + ss, - // 'Courier New, Courier, monospace', - // 'Georgia, serif', - // 'Helvetica' + ss, - // 'Impact, Charcoal' + ss, - // 'Lucida Sans Unicode, Lucida Grande' + ss, - // 'Tahoma, Geneva' + ss, - // 'Times New Roman, Times, serif', - // 'Trebuchet MS, Helvetica' + ss, - // 'Verdana, Geneva' + ss - // ]; - // obj.list = []; - // for (var j = 0, l = fonts.length; j < l; j++) { - // var font = {}; - // font.value = fonts[j]; - // font.name = fonts[j].split(',')[0]; - // obj.list.push(font); - // } - // break; - // case 'font-weight': - // obj.list = [ - // { value: '100', name: 'Thin' }, - // { value: '200', name: 'Extra-Light' }, - // { value: '300', name: 'Light' }, - // { value: '400', name: 'Normal' }, - // { value: '500', name: 'Medium' }, - // { value: '600', name: 'Semi-Bold' }, - // { value: '700', name: 'Bold' }, - // { value: '800', name: 'Extra-Bold' }, - // { value: '900', name: 'Ultra-Bold' } - // ]; - // break; - // case 'text-align': - // obj.list = [ - // { value: 'left' }, - // { value: 'center' }, - // { value: 'right' }, - // { value: 'justify' } - // ]; - // break; - // case 'border-style': - // obj.list = [ - // { value: 'none' }, - // { value: 'solid' }, - // { value: 'dotted' }, - // { value: 'dashed' }, - // { value: 'double' }, - // { value: 'groove' }, - // { value: 'ridge' }, - // { value: 'inset' }, - // { value: 'outset' } - // ]; - // break; - // case 'box-shadow-type': - // obj.list = [ - // { value: '', name: 'Outside' }, - // { value: 'inset', name: 'Inside' } - // ]; - // break; - // case 'background-repeat': - // obj.list = [ - // { value: 'repeat' }, - // { value: 'repeat-x' }, - // { value: 'repeat-y' }, - // { value: 'no-repeat' } - // ]; - // break; - // case 'background-position': - // obj.list = [ - // { value: 'left top' }, - // { value: 'left center' }, - // { value: 'left bottom' }, - // { value: 'right top' }, - // { value: 'right center' }, - // { value: 'right bottom' }, - // { value: 'center top' }, - // { value: 'center center' }, - // { value: 'center bottom' } - // ]; - // break; - // case 'background-attachment': - // obj.list = [ - // { value: 'scroll' }, - // { value: 'fixed' }, - // { value: 'local' } - // ]; - // break; - // case 'background-size': - // obj.list = [ - // { value: 'auto' }, - // { value: 'cover' }, - // { value: 'contain' } - // ]; - // break; - // case 'transition-property': - // obj.list = [ - // { value: 'all' }, - // { value: 'width' }, - // { value: 'height' }, - // { value: 'background-color' }, - // { value: 'transform' }, - // { value: 'box-shadow' }, - // { value: 'opacity' } - // ]; - // break; - // case 'transition-timing-function': - // obj.list = [ - // { value: 'linear' }, - // { value: 'ease' }, - // { value: 'ease-in' }, - // { value: 'ease-out' }, - // { value: 'ease-in-out' } - // ]; - // break; - // case 'cursor': - // obj.list = [ - // { value: 'auto' }, - // { value: 'pointer' }, - // { value: 'copy' }, - // { value: 'crosshair' }, - // { value: 'grab' }, - // { value: 'grabbing' }, - // { value: 'help' }, - // { value: 'move' }, - // { value: 'text' } - // ]; - // break; - // case 'overflow': - // case 'overflow-x': - // case 'overflow-y': - // obj.list = [ - // { value: 'visible' }, - // { value: 'hidden' }, - // { value: 'scroll' }, - // { value: 'auto' } - // ]; - // break; - // } - - // Properties - switch ( - prop - // // case 'margin': - // obj.properties = this.build([ - // 'margin-top', - // 'margin-right', - // 'margin-bottom', - // 'margin-left' - // ]); - // break; - // // case 'padding': - // obj.properties = this.build([ - // 'padding-top', - // 'padding-right', - // 'padding-bottom', - // 'padding-left' - // ]); - // break; - // case 'text-shadow': - // obj.properties = this.build([ - // 'text-shadow-h', - // 'text-shadow-v', - // 'text-shadow-blur', - // 'text-shadow-color' - // ]); - // break; - // // case 'border': - // obj.properties = this.build([ - // 'border-width', - // 'border-style', - // 'border-color' - // ]); - // break; - // // case 'border-radius': - // obj.properties = this.build([ - // 'border-top-left-radius', - // 'border-top-right-radius', - // 'border-bottom-right-radius', - // 'border-bottom-left-radius' - // ]); - // break; - // case 'box-shadow': - // obj.properties = this.build([ - // 'box-shadow-h', - // 'box-shadow-v', - // 'box-shadow-blur', - // 'box-shadow-spread', - // 'box-shadow-color', - // 'box-shadow-type' - // ]); - // break; - // case 'background': - // obj.properties = this.build([ - // 'background-image', - // 'background-repeat', - // 'background-position', - // 'background-attachment', - // 'background-size' - // ]); - // break; - // case 'transition': - // obj.properties = this.build([ - // 'transition-property', - // 'transition-duration', - // 'transition-timing-function' - // ]); - // break; - // case 'transform': - // obj.properties = this.build([ - // 'transform-rotate-x', - // 'transform-rotate-y', - // 'transform-rotate-z', - // 'transform-scale-x', - // 'transform-scale-y', - // 'transform-scale-z' - // ]); - // break; - ) { - } - - objs.push(obj); - } - - return objs; } } From 8e95adfe35964fb9fa8c5849880d73d0ea4684ab Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 25 Dec 2021 13:27:11 +0100 Subject: [PATCH 167/313] Clean console --- src/style_manager/view/PropertySelectView.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/style_manager/view/PropertySelectView.js b/src/style_manager/view/PropertySelectView.js index 4cc47b153..34a84a78b 100644 --- a/src/style_manager/view/PropertySelectView.js +++ b/src/style_manager/view/PropertySelectView.js @@ -39,7 +39,6 @@ export default PropertyView.extend({ const name = model.getOptionLabel(id); const style = option.style ? option.style.replace(/"/g, '"') : ''; const styleAttr = style ? `style="${style}"` : ''; - console.log({ option, id }); const value = id.replace(/"/g, '"'); optionsRes.push(``); }); From 4acc17bee402c667c63734d153ecc4d1869a2e2a Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 25 Dec 2021 14:32:30 +0100 Subject: [PATCH 168/313] Support properties as text on init --- src/style_manager/model/Sector.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/style_manager/model/Sector.js b/src/style_manager/model/Sector.js index 6a13f97e7..022aee7ff 100644 --- a/src/style_manager/model/Sector.js +++ b/src/style_manager/model/Sector.js @@ -1,7 +1,6 @@ import { Model } from 'common'; import { extend, isString } from 'underscore'; import Properties from './Properties'; -import PropertyFactory from './PropertyFactory'; /** * @typedef Sector @@ -159,7 +158,7 @@ export default class Sector extends Model { } checkExtend(prop) { - const { extend, ...rest } = prop || {}; + const { extend, ...rest } = (isString(prop) ? { extend: prop } : prop) || {}; if (extend) { return { ...(this.buildProperties([extend])[0] || {}), From 176c10210de514a159e271e0d5b28e4d60f75c39 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 25 Dec 2021 15:01:27 +0100 Subject: [PATCH 169/313] Update prop clone in layers --- src/i18n/locale/en.js | 43 ++++++++++++++------------- src/style_manager/model/Properties.js | 3 ++ 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/i18n/locale/en.js b/src/i18n/locale/en.js index 0e99bd056..86d4697c4 100644 --- a/src/i18n/locale/en.js +++ b/src/i18n/locale/en.js @@ -5,7 +5,7 @@ export default { addButton: 'Add image', inputPlh: 'http://path/to/the/image.jpg', modalTitle: 'Select Image', - uploadTitle: 'Drop files here or click to upload' + uploadTitle: 'Drop files here or click to upload', }, // Here just as a reference, GrapesJS core doesn't contain any block, // so this should be omitted from other local files @@ -15,7 +15,7 @@ export default { }, categories: { // 'category-id': 'Category Label', - } + }, }, domComponents: { names: { @@ -33,8 +33,8 @@ export default { thead: 'Table head', table: 'Table', row: 'Table row', - cell: 'Table cell' - } + cell: 'Table cell', + }, }, deviceManager: { device: 'Device', @@ -42,8 +42,8 @@ export default { desktop: 'Desktop', tablet: 'Tablet', mobileLandscape: 'Mobile Landscape', - mobilePortrait: 'Mobile Portrait' - } + mobilePortrait: 'Mobile Portrait', + }, }, panels: { buttons: { @@ -55,9 +55,9 @@ export default { 'open-sm': 'Open Style Manager', 'open-tm': 'Settings', 'open-layers': 'Open Layer Manager', - 'open-blocks': 'Open Blocks' - } - } + 'open-blocks': 'Open Blocks', + }, + }, }, selectorManager: { label: 'Classes', @@ -66,8 +66,8 @@ export default { states: { hover: 'Hover', active: 'Click', - 'nth-of-type(2n)': 'Even/Odd' - } + 'nth-of-type(2n)': 'Even/Odd', + }, }, styleManager: { empty: 'Select an element before using Style Manager', @@ -80,12 +80,15 @@ export default { decorations: 'Decorations', extra: 'Extra', flex: 'Flex', - dimension: 'Dimension' + dimension: 'Dimension', }, // The core library generates the name by their `property` name properties: { - // float: 'Float', - } + 'text-shadow-h': 'X', + 'text-shadow-v': 'Y', + 'text-shadow-blur': 'Blur', + 'text-shadow-color': 'Color', + }, // Translate options in style properties // options: { // float: { // Id of the property @@ -110,15 +113,15 @@ export default { id: traitInputAttr, alt: traitInputAttr, title: traitInputAttr, - href: { placeholder: 'eg. https://google.com' } + href: { placeholder: 'eg. https://google.com' }, }, // In a trait like select, these are used to translate option names options: { target: { false: 'This window', - _blank: 'New window' - } - } - } - } + _blank: 'New window', + }, + }, + }, + }, }; diff --git a/src/style_manager/model/Properties.js b/src/style_manager/model/Properties.js index 337791a66..411672133 100644 --- a/src/style_manager/model/Properties.js +++ b/src/style_manager/model/Properties.js @@ -113,11 +113,14 @@ export default Backbone.Collection.extend(TypeableCollection).extend({ ], deepClone() { + const { em } = this; const collection = this.clone(); + collection.em = em; collection.reset( collection.map(model => { const cloned = model.clone(); cloned.typeView = model.typeView; + cloned.em = em; return cloned; }) ); From 942dfceae7ef8f5d35649c3c2df5d14413bb5baf Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 25 Dec 2021 16:21:17 +0100 Subject: [PATCH 170/313] Move StyleManager default config --- docs/modules/Style-manager.md | 49 +++++++++++++++- src/editor/config/config.js | 93 +----------------------------- src/style_manager/config/config.js | 70 +++++++++++++++++++++- 3 files changed, 117 insertions(+), 95 deletions(-) diff --git a/docs/modules/Style-manager.md b/docs/modules/Style-manager.md index 7cc961fad..0222d727c 100644 --- a/docs/modules/Style-manager.md +++ b/docs/modules/Style-manager.md @@ -4,12 +4,53 @@ title: Style Manager # Style Manager -Coming soon +::: danger TODO +Hero image + +::: + +The Style Manager module is responsible to show and update style properties on your [Components]. In this guide, you will see how to setup and take full advantage of the built-in Style Manager UI in GrapesJS. +The default UI is a lightweight component with built-in properties, but as you'll see next in this guide, it's easy to extend with your own elements or even create the Style Manager UI from scratch by using the [Style Manager API]. + +::: warning +To get a better understanding of the content in this guide, we recommend reading [Components] first +::: +::: warning +This guide is referring to GrapesJS v0.17.30 or higher +::: [[toc]] +## Configuration + +To change the default configurations you have to pass the `styleManager` property with the main configuration object. + +```js +const editor = grapesjs.init({ + ... + styleManager: { + sectors: [...], + ... + } +}); +``` + +Check the full list of available options here: [Style Manager Config](https://github.com/artf/grapesjs/blob/master/src/style_manager/config/config.js) + + + + + +## Initialization + +### Built-in properties + +## Programmatic usage + +## Customization + +## Events -## Built-in properties Here you can find all the available built-in properties that you can use inside Style Manager via `buildProps`: @@ -29,3 +70,7 @@ Example usage: } ... ``` + + +[Components]: +[Style Manager API]: \ No newline at end of file diff --git a/src/editor/config/config.js b/src/editor/config/config.js index 26ec27ec6..5573ac16f 100644 --- a/src/editor/config/config.js +++ b/src/editor/config/config.js @@ -163,8 +163,7 @@ export default { listenToEl: [], // Import asynchronously CSS to use as icons - cssIcons: - 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', + cssIcons: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', // Dom element el: '', @@ -215,93 +214,7 @@ export default { deviceManager: {}, //Configurations for Style Manager - styleManager: { - sectors: [ - { - name: 'General', - open: false, - buildProps: [ - 'float', - 'display', - 'position', - 'top', - 'right', - 'left', - 'bottom' - ] - }, - { - name: 'Flex', - open: false, - buildProps: [ - 'flex-direction', - 'flex-wrap', - 'justify-content', - 'align-items', - 'align-content', - 'order', - 'flex-basis', - 'flex-grow', - 'flex-shrink', - 'align-self' - ] - }, - { - name: 'Dimension', - open: false, - buildProps: [ - 'width', - 'height', - 'max-width', - 'min-height', - 'margin', - 'padding' - ] - }, - { - name: 'Typography', - open: false, - buildProps: [ - 'font-family', - 'font-size', - 'font-weight', - 'letter-spacing', - 'color', - 'line-height', - 'text-align', - 'text-shadow' - ], - properties: [ - { - property: 'text-align', - list: [ - { value: 'left', className: 'fa fa-align-left' }, - { value: 'center', className: 'fa fa-align-center' }, - { value: 'right', className: 'fa fa-align-right' }, - { value: 'justify', className: 'fa fa-align-justify' } - ] - } - ] - }, - { - name: 'Decorations', - open: false, - buildProps: [ - 'border-radius-c', - 'background-color', - 'border-radius', - 'border', - 'box-shadow', - 'background' - ] - }, - { - name: 'Extra', - open: false, - buildProps: ['transition', 'perspective', 'transform'] - } - ] - }, + styleManager: {}, // Configurations for Block Manager blockManager: {}, @@ -320,5 +233,5 @@ export default { // Experimental: don't use. // Avoid default UI styles - customUI: false + customUI: false, }; diff --git a/src/style_manager/config/config.js b/src/style_manager/config/config.js index 8980c843a..9f10fea5c 100644 --- a/src/style_manager/config/config.js +++ b/src/style_manager/config/config.js @@ -1,7 +1,68 @@ export default { - stylePrefix: 'sm-', - - sectors: [], + // Default sectors and properties + sectors: [ + { + name: 'General', + open: false, + buildProps: ['float', 'display', 'position', 'top', 'right', 'left', 'bottom'], + }, + { + name: 'Flex', + open: false, + buildProps: [ + 'flex-direction', + 'flex-wrap', + 'justify-content', + 'align-items', + 'align-content', + 'order', + 'flex-basis', + 'flex-grow', + 'flex-shrink', + 'align-self', + ], + }, + { + name: 'Dimension', + open: false, + buildProps: ['width', 'height', 'max-width', 'min-height', 'margin', 'padding'], + }, + { + name: 'Typography', + open: false, + buildProps: [ + 'font-family', + 'font-size', + 'font-weight', + 'letter-spacing', + 'color', + 'line-height', + 'text-align', + 'text-shadow', + ], + properties: [ + { + property: 'text-align', + list: [ + { value: 'left', className: 'fa fa-align-left' }, + { value: 'center', className: 'fa fa-align-center' }, + { value: 'right', className: 'fa fa-align-right' }, + { value: 'justify', className: 'fa fa-align-justify' }, + ], + }, + ], + }, + { + name: 'Decorations', + open: false, + buildProps: ['border-radius-c', 'background-color', 'border-radius', 'border', 'box-shadow', 'background'], + }, + { + name: 'Extra', + open: false, + buildProps: ['transition', 'perspective', 'transform'], + }, + ], // Specify the element to use as a container, string (query) or HTMLElement // With the empty value, nothing will be rendered @@ -27,6 +88,9 @@ export default { // Properties not to take in account for computed styles avoidComputed: ['width', 'height'], + // Style prefix + stylePrefix: 'sm-', + // Avoid rendering the default style manager. custom: false, }; From 2b925f3ab67f73a66802fc4016a4dd8c1f9f2f58 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 25 Dec 2021 16:25:12 +0100 Subject: [PATCH 171/313] Update style manager config --- src/style_manager/config/config.js | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/style_manager/config/config.js b/src/style_manager/config/config.js index 9f10fea5c..0ccc9f26a 100644 --- a/src/style_manager/config/config.js +++ b/src/style_manager/config/config.js @@ -4,12 +4,12 @@ export default { { name: 'General', open: false, - buildProps: ['float', 'display', 'position', 'top', 'right', 'left', 'bottom'], + properties: ['float', 'display', 'position', 'top', 'right', 'left', 'bottom'], }, { name: 'Flex', open: false, - buildProps: [ + properties: [ 'flex-direction', 'flex-wrap', 'justify-content', @@ -25,12 +25,12 @@ export default { { name: 'Dimension', open: false, - buildProps: ['width', 'height', 'max-width', 'min-height', 'margin', 'padding'], + properties: ['width', 'height', 'max-width', 'min-height', 'margin', 'padding'], }, { name: 'Typography', open: false, - buildProps: [ + properties: [ 'font-family', 'font-size', 'font-weight', @@ -40,27 +40,16 @@ export default { 'text-align', 'text-shadow', ], - properties: [ - { - property: 'text-align', - list: [ - { value: 'left', className: 'fa fa-align-left' }, - { value: 'center', className: 'fa fa-align-center' }, - { value: 'right', className: 'fa fa-align-right' }, - { value: 'justify', className: 'fa fa-align-justify' }, - ], - }, - ], }, { name: 'Decorations', open: false, - buildProps: ['border-radius-c', 'background-color', 'border-radius', 'border', 'box-shadow', 'background'], + properties: ['border-radius-c', 'background-color', 'border-radius', 'border', 'box-shadow', 'background'], }, { name: 'Extra', open: false, - buildProps: ['transition', 'perspective', 'transform'], + properties: ['transition', 'perspective', 'transform'], }, ], From 8c5d9e0bb225d2e270915463d8a6d7ab7077b4f4 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 25 Dec 2021 16:52:27 +0100 Subject: [PATCH 172/313] Update Style Manager module doc --- docs/modules/Style-manager.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/modules/Style-manager.md b/docs/modules/Style-manager.md index 0222d727c..23a85bdb7 100644 --- a/docs/modules/Style-manager.md +++ b/docs/modules/Style-manager.md @@ -43,7 +43,32 @@ Check the full list of available options here: [Style Manager Config](https://gi ## Initialization -### Built-in properties +The Style Manager module is organized in sectors where each sector contains a list of properties to display. The default Style Manager configuration contains already a list of common property styles and you can see them by simply skipping the `styleManagerConfig.sectors` option. + +```js +grapesjs.init({ + ... + styleManager: { + // With no defined sectors, the default list will be loaded + // sectors: [...], + ... + }, +}); +``` + +::: danger +It makes sense to show the Style Manager UI only when you have at least one component selected, so by default the Style Manager is hidden if there are no selected components. +::: + +### Sector defintions + +Define sectors + label i18n + +### Property defintions + +#### Built-in properties + +## Orchestration by Components ## Programmatic usage From 264ad3f1ce9780872d8bc8ebddb820da05af0298 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 27 Dec 2021 11:58:29 +0100 Subject: [PATCH 173/313] Add sector definitions --- docs/modules/Style-manager.md | 55 +++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/docs/modules/Style-manager.md b/docs/modules/Style-manager.md index 23a85bdb7..cc98a96de 100644 --- a/docs/modules/Style-manager.md +++ b/docs/modules/Style-manager.md @@ -43,7 +43,7 @@ Check the full list of available options here: [Style Manager Config](https://gi ## Initialization -The Style Manager module is organized in sectors where each sector contains a list of properties to display. The default Style Manager configuration contains already a list of common property styles and you can see them by simply skipping the `styleManagerConfig.sectors` option. +The Style Manager module is organized in sectors where each sector contains a list of properties to display. The default Style Manager configuration contains already a list of default common property styles and you can use them by simply skipping the `styleManagerConfig.sectors` option. ```js grapesjs.init({ @@ -62,7 +62,57 @@ It makes sense to show the Style Manager UI only when you have at least one comp ### Sector defintions -Define sectors + label i18n +Each sector is identified by its `name` and a list of `properties` to display. You can also specify the `id` in order to access the sector via API (if not indicated it will be generated from the `name`) and the default `open` state. + +```js +grapesjs.init({ + // ... + styleManager: { + sectors: [ + { + name: 'First sector', + properties: [], + // id: 'first-sector', // Id generated from the name + // open: true, // The sector is open by default + }, + { + open: false, // render it closed by default + name: 'Second sector', + properties: [], + }, + ], + }, +}); +``` +The label of the sector you see in the editor is using directly the `name` but you can also rely on the [I18n] module via sector's `id` in case you plan to have a multi-language editor. + +```js +grapesjs.init({ + i18n: { + // Use `messagesAdd` in order to extend the default set + messagesAdd: { + en: { + styleManager: { + sectors: { + 'first-sector-id': 'First sector EN' + } + } + } + } + }, + // ... + styleManager: { + sectors: [ + { + id: 'first-sector-id', + // You can leave the name as a fallback in case the i18n definition is missing + name: 'First sector', + }, + // ... + ], + }, +}); +``` ### Property defintions @@ -98,4 +148,5 @@ Example usage: [Components]: +[I18n]: [Style Manager API]: \ No newline at end of file From 4a912d4400696dfcdcf749c4eecc04a5ec1c0da9 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 27 Dec 2021 12:02:10 +0100 Subject: [PATCH 174/313] Update i18n config --- src/i18n/config.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/i18n/config.js b/src/i18n/config.js index 2d5112b21..8ba6a96e0 100644 --- a/src/i18n/config.js +++ b/src/i18n/config.js @@ -8,13 +8,16 @@ export default { localeFallback: 'en', // Detect locale by checking browser language - detectLocale: 1, + detectLocale: true, // Show warnings when some of the i18n resources are missing - debug: 0, + debug: false, // Messages to translate messages: { - en - } + en, + }, + + // Additional messages. This allows extending the default `messages` set directly from the configuration. + messagesAdd: null, }; From f2695711c0cb477e7aeaebf065596a11f3ef4059 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 27 Dec 2021 15:23:29 +0100 Subject: [PATCH 175/313] Update Style Manager docs --- docs/modules/Style-manager.md | 63 +++++++++++++++++++++++++++ src/style_manager/model/Properties.js | 10 +++++ 2 files changed, 73 insertions(+) diff --git a/docs/modules/Style-manager.md b/docs/modules/Style-manager.md index cc98a96de..38c1e7067 100644 --- a/docs/modules/Style-manager.md +++ b/docs/modules/Style-manager.md @@ -116,6 +116,69 @@ grapesjs.init({ ### Property defintions +Once you have defined your sector you can start adding property definitions inside `properties`. Each property has a common set of options (`label`, `default`, etc.) and others specific by their `type`. + +Let's see below a simple definition for controlling the padding style. + +```js +sectors: [ + { + name: 'First sector', + properties: [ + { + type: 'number', + label: 'Padding', // Label for the property + property: 'padding', // CSS property to change + default: '0', // Default value to display + units: ['px', '%'], // Units (available only for the 'number' type) + min: 0, // Min value (available only for the 'number' type) + } + ], + }, +] +``` +This will render the number input UI and will change the `padding` CSS property on the selected component. + +The flexibility of the definition allows you to create easily different UI inputs for any possible CSS property. You're free to decide what will be the best UI for your users. If you take for example a numeric property like `font-size`, you can follow its CSS specification and define it as a `number` + +```js +{ + type: 'number', + label: 'Font size', + property: 'font-size', + units: ['px', '%', 'em', 'rem', 'vh', 'vw'], + min: 0, +} +``` +or you can decide to show it as a `select` and make available only a defined set of values (eg. based on your Design System tokens). + +```js +{ + type: 'select', + label: 'Font size', + property: 'font-size', + default: '1rem', + options: [ + { id: '0.7rem', label: 'small' }, + { id: '1rem', label: 'medium' }, + { id: '1.2rem', label: 'large' }, + ] +} +``` + + +### Default types + +* `base` - The base type, renders as a simple input field +* `number` - Property model: PropertyNumber +* `slider` - +* `select` - +* `radio` - +* `color` - +* `file` - +* `composite` - +* `stack` - + #### Built-in properties ## Orchestration by Components diff --git a/src/style_manager/model/Properties.js b/src/style_manager/model/Properties.js index 411672133..661cc80ec 100644 --- a/src/style_manager/model/Properties.js +++ b/src/style_manager/model/Properties.js @@ -101,6 +101,16 @@ export default Backbone.Collection.extend(TypeableCollection).extend({ } }, }, + { + id: 'number', + model: PropertyNumber, + view: PropertyNumberView, + isType(value) { + if (value && value.type == 'number') { + return value; + } + }, + }, { id: 'base', model: Property, From 5670c4bdc3ff9ff13b06a3ef123412645ba5c0a6 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 27 Dec 2021 19:23:08 +0100 Subject: [PATCH 176/313] Start default types doc --- docs/.vuepress/public/sm-base-type.jpg | Bin 0 -> 6281 bytes docs/.vuepress/public/sm-type-number.jpg | Bin 0 -> 5666 bytes docs/modules/Style-manager.md | 36 +++++++++++++++++++++-- 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 docs/.vuepress/public/sm-base-type.jpg create mode 100644 docs/.vuepress/public/sm-type-number.jpg diff --git a/docs/.vuepress/public/sm-base-type.jpg b/docs/.vuepress/public/sm-base-type.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2c2c4931715f643602ae104e988f286d6abe5575 GIT binary patch literal 6281 zcmd6rcT^Nvv%qgp28J*UQ3(Tx-1X)2;g0O-_ z35qBNL_t6$Nd`#*N>+Ho?m4dS?b+{p@B8c3IaB91b*s8=*S+0c-8&z4MgW&yIN1XL zBO`Hu0e{KP9Kan8A^JoB2q0)?eE@bwvB!*bb)79N&Gn5;^#B9`fHgEF`}xCI0HF8< zQ!Nd22*>Ol2>CywuxnqWF`JvuF2i=ugN;g?AdR_p+4E19{KMx@ z*4||j#g9bu*`0F$i9*`tRvMoR4RNP2+?2)%p=9?k8h6uppKl0-OyhMLvr*h#g8)Ea zckRLML@yf4(ils%w$!DuIsh1~=P&H`3kSQ0)8+|)u75xTmF(#iOb{iC5#&@Nmff z56A9)@d^$OP?eDh3k#DbyA!2%3;I+3t;0{xe}-T3N$=+SSv$gEcMsPP-(bRSQHlP( z{vlLCP=G7Zogno;H}QWQ_{+3@nTMpMyN5f~-H(>ambS~tex9`D_9Kyl$^L!>vfn?g z@P8Qg%N%y`&wWh;{H<-k<}3|Z-mn4qd^c44#2k;4SC@{a_eO zfLX8zR>2koL1>5(!b98;KO_uEKnEaYNE6b7Od(6i9&&*^AwMVtih|BS7oapK3%Usv zLHD6L=rQyH>V!T*BhY7P8QO%wVOSU&j2E^aCIeH39fFy_tYODtp0GezBrG150=ovw zhn2#rVUJ<2U_G#5*eq-X4&V%M4!8hZ3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>T zp=Q@>Y4;VJ8{6LxmbQ(F#L1){AoBVtC`CWRB9rfE4Bx!TsWVwlMF)7!!r(Xo3&S1tE0IBy9p-!ichJ#yp6=mP zHqmkouO1HfE1^ujO~GE)ZzJj}&qc43Qz)q=GMX;%zOHd=v&#KMc*vqBpGjVI^s*3} zvVq~!;jQ`Qo{w@I&rU@)U%zmTPp0COui;vxqH5w*4$bP`_nW|L!-pmI@1M0E@xJ0u z<*%g;fA<@?J)pXg+#aNv(-b!v=CTQT)@!C4r?sm$Mz5)PH!NN{tW@8W{V1*RWLs-$ zdo52HbuRwfA`lwGC2epLUmm`MGhK?-a5(cvcBMU=Z4n3tQE`)XS6 z&xbwqB~K^>w=X2YEUw#g`bSCfq$h4Fv*JfmUolDRQ=~B_Wj#mnyyJ&xgJ4yM-q6qC zzE355(tkYBc$wNBR%Pwf*IgtRcWmQgwdRBPDEXwSi{EnM2iwTr?_MohWi_Tg8M~f7 zYO|Nf`XK7Fi| zw=L@KTd>v9r2>zQWd z1S<9J)lNT~tUK&;y&-mq)^IxZYwBWdNh&SScjSzWpF|(=lig~F!04T5<>7`mC9^|K ziL*nuA{+WopFGDDWtH=XHjm7c`sF77h^tbIRkahno4~9}$8!A3t;}A?_(i8y?Uj(7 zUa6LUm{Q*v8am&**W?%x!>8-=cMF3NoXLvOrpUa{bKS?=tJrU7JLqceUL#JC5dXmi Y=2e17v>__*b63~#XaD}G0NNb + + ```js + // Example + { + // type: 'base', // Omitting the type in definition will fallback to the 'base' + property: 'some-css-property', + label: 'Base type', + default: 'Default value', + }, + ``` + +* `number` - Number input field for numeric values. Model: [PropertyNumber](/api/property_number.html) + + + + ```js + // Example + { + type: 'number', + property: 'width', + label: 'Number type', + default: '0%', + units: ['px', '%'], + min: 0, + max: 100, + }, + ``` * `slider` - * `select` - * `radio` - From 261105367a0cd7093798c1ff9b22831d60c74b21 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 27 Dec 2021 19:49:22 +0100 Subject: [PATCH 177/313] Add more default types in docs --- docs/.vuepress/public/sm-type-color.jpg | Bin 0 -> 5627 bytes docs/.vuepress/public/sm-type-select.jpg | Bin 0 -> 5410 bytes docs/.vuepress/public/sm-type-slider.jpg | Bin 0 -> 5596 bytes docs/modules/Style-manager.md | 33 ++++++++++++++++++++--- 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 docs/.vuepress/public/sm-type-color.jpg create mode 100644 docs/.vuepress/public/sm-type-select.jpg create mode 100644 docs/.vuepress/public/sm-type-slider.jpg diff --git a/docs/.vuepress/public/sm-type-color.jpg b/docs/.vuepress/public/sm-type-color.jpg new file mode 100644 index 0000000000000000000000000000000000000000..bec57c64426f72a55e6660a581a337884b69b96a GIT binary patch literal 5627 zcmchacT`l#wukFfE>HzW3&j_gky?`p&Lhr*`eCb58Zn_|7!oGC4@`1;E@~ z3Shub?W_R2aWp9~4nP1wb(;dPGlO$BH!||HwX-obw=w|`1OU#=iV_kEV+J5NBr3vg zw;|El#g&MD3}Ao`pnw7ZUZlt{>wTv7v|F2-7!f0>K|hC~(Z(os4624@%xsB78vP%H zCxt~s0RY)j`zZO4BS};~Lgk>?s4$v;jmm7^fi#BE=D`+0O_0i5H1_+Gcl{CbC+pML zCpg518bixD%qQ4~#ywQdh>0ds8E!@8^cV^`mda15ED{tQOri2;DzgQXy&?fX;As9R zGRdFH@>Iq}*xMOVSsMTh&hHoY{)MB+2dQ}iU=$h_7eVp!k0MHtB#8Pe zDoV!IixlV;;X^bE4G!}Pi38xzIn#Op7FunI)FP`YXsD{nD9TdH|3m+=@ki8u2HM*G z8S!!NA8Q72^!@bx?EBLfS`C2uI<+<@e)_yi0BHLS0IugheIjQ7U^)Uo>%cGb;h^mo z|EQ=iO*y&P*jQN#nIuaq=nwsm0Y4)D9)1~5mNwpx+7XS(zFyHmQAAo%NufcZ(GkSR zFfS6BDD&@|_#b!tC9Plb*kwodB}b4$s6#nYcNrzbkGk9;K9nd*Xb6!K@^>rz54-)6 z0}cP&*HmDw`3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%SnH|_ z@5KY88Ufkb4&6I1pnl`Et%y~1hm4&#y=&ne^e+1Q9ZsCt_0OeKZzf($d9mZHaA)dk z7YtNph#9InnmUA)RV)#Wu_X)Fq|@_TRru`1Cv%lGbGp1}$=w~~B=oFXnVH(?Td5I`pYG!tt)#OPmS&6l3@YB4?C2qRvg9RheIl55IcH*StF|aC zN!PVX>fr)Ovm(rO=!#LBUn)s4!Q_p-dheztC4&E8^Xhn1c~Zw}97U{r)G2+aHB2>A zdH2%J;0}lQxt0+=qHu|*%%rwOjE6>Rt=203%d)0$_CWCdMK&3p>rdDE_5B(uDff3* zCap$9pYx8Q#*PsMI?E&^OWPLCr}duN05`hTiG@z_<$1F_nH4w$)BVb zj^4<0Djw65sv$fWZMac#JtcQY@OzG(-jG-=aay!@ zs@t;!mvK^Hs;Q-BZMY%MeP@gC+00MPO8477oep@`_GYe5;c)6BWtx?n%AjtkbR+4& z_^tcXbD8Wy>iY6|oyxB5@h&Onr-a6v@^7CsnBu=i(OfPrvA6eYi6JK_?P7juNJ!4m z1$@2EJjd(j6~d>q+EHP9)l1_7wIajo%&ael9CnWvv3D5QntyPmU|sezM(V_mE&OH3 zIWlOw;nr%SY2OgrF~>tM^7^As6-D`e8J&_7$-S)^V}<^=2D(b{>8E?*tj$JA$MwZg Mv9SNYI5%GW13w|J;{X5v literal 0 HcmV?d00001 diff --git a/docs/.vuepress/public/sm-type-slider.jpg b/docs/.vuepress/public/sm-type-slider.jpg new file mode 100644 index 0000000000000000000000000000000000000000..be440b76e67e35f466416c24dcf2c8bdc8a92be7 GIT binary patch literal 5596 zcmbW42|SeR+sE%`c8p~VqAX(@`G-OFx-~GNl{eaXa>JxutZQ~FqOe84CV>;^$rIBfo0kw zd`bQcR%S4k?&N67U_AgZSjsQ#^9x7##xUvxz%(TE0G&$lk03~sWC$wS+FArF-{>IU zhzJD-Z&IK)olGzd2@dt99RT3ZIWwaGH?y|{Mw2yEv^6voR23QR|Dk_-@rT#H2j<%T z>9M%$k2Q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 b/docs/modules/Style-manager.md @@ -126,6 +126,7 @@ sectors: [ name: 'First sector', properties: [ { + // id: 'padding', // The id of the property, if missing, will be the same as `property` value type: 'number', label: 'Padding', // Label for the property property: 'padding', // CSS property to change @@ -185,6 +186,10 @@ Let's see below the list of all available default types with their relative UI a }, ``` +* `color` - Same props as `base` but the UI is a color picker. Model: [Property](/api/property.html) + + + * `number` - Number input field for numeric values. Model: [PropertyNumber](/api/property_number.html) @@ -196,16 +201,36 @@ Let's see below the list of all available default types with their relative UI a property: 'width', label: 'Number type', default: '0%', + // Additional props units: ['px', '%'], min: 0, max: 100, }, ``` -* `slider` - -* `select` - +* `slider` - Same props as `number` but the UI is a slider. Model: [PropertyNumber](/api/property_number.html) + + + +* `select` - Select input with options. Model: [PropertySelect](/api/property_select.html) + + + + ```js + // Example + { + type: 'select', + property: 'display', + label: 'Select type', + default: 'block', + options: [ + {id: 'block', label: 'Block'}, + {id: 'inline', label: 'Inline'}, + {id: 'none', label: 'None'}, + ] + }, + ``` + * `radio` - -* `color` - -* `file` - * `composite` - * `stack` - From c2aabb325948ce9dc2592cbdd323accbf2104f3f Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 27 Dec 2021 20:40:21 +0100 Subject: [PATCH 178/313] Add style manager default types doc --- docs/.vuepress/public/sm-type-composite.jpg | Bin 0 -> 13144 bytes docs/.vuepress/public/sm-type-radio.jpg | Bin 0 -> 6789 bytes docs/.vuepress/public/sm-type-stack.jpg | Bin 0 -> 12744 bytes docs/modules/Style-manager.md | 58 +++++++++++++++++--- src/style_manager/model/PropertyStack.js | 2 +- 5 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 docs/.vuepress/public/sm-type-composite.jpg create mode 100644 docs/.vuepress/public/sm-type-radio.jpg create mode 100644 docs/.vuepress/public/sm-type-stack.jpg diff --git a/docs/.vuepress/public/sm-type-composite.jpg b/docs/.vuepress/public/sm-type-composite.jpg new file mode 100644 index 0000000000000000000000000000000000000000..35822e8269226022d961facaef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N;S?_=V}+I z+MHg1RtGmEi%QH2sn4{c^UWvWEyht6-G9y{iz~F7ugN#)(XC&5^&@9gwCSUry|kFU z_E$WyFHht5pNG=t(LSv^r15OjrnUU-KSJ>RU#%I8DCI4OMNONHE?V;yU zi$BN4rZvq*7J@5zwTl~-5cqN1R2X&>Fth>v zEWAIhI(x=fA6&jpzSN32(@Wn_N81VQdEP8XIP9Waw|YXlZydZI|2CVUe~`n;j>1gV zy*YOC7TCbF$CHR#dQs;p<-@HBS~>ptZ{{DK4t-|NGqxz(#?x}K3J-#V+1GO^l^4&?4f~`-k~@wLYm&l!n1j|ajV+~3LIqOrv06YX#?ErLIhXeIKkNN3%|f zWrp|q&j|iMd>r(TxitnYxvDiyBvwRZWVuRoX%16Lu4Djj2gwcmj0K&^Fn_7qq8nK6 z|7m(UFq2F1#v&%PHHZk3%s%Qq&21eHw+rOF+}PE^Q>&5hH0y{4^`(4o-bt&K68`_H h2~6m`L538gJbO}A8<$+g&3C+p|JF%=6TrWn{eJ*7*lYj* literal 0 HcmV?d00001 diff --git a/docs/.vuepress/public/sm-type-radio.jpg b/docs/.vuepress/public/sm-type-radio.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a75bdcc1a23bbfa128edddf092e76fa60ab50607 GIT binary patch literal 6789 zcmd6qbyQT__rUL+q;n{#p^+4n?vyTJNF{~=MqubhR0I@IT0lWSIs~LaQIrq`MClX> z5do=(fC|EIc&_F17w=nt{q|aO?q~Md`|N%8IcME-kH(MY0A{UVybA#6>IwlQz+ZCo z8KBh+z`BP3AOIt(wE^I0p2A93L&M(0%vf93Knnmt0HDw@z!SV6Gyvd9@b@)4tB$s^ zwm~EN0SG_}AOHyfaK!p~8=liPKOS0FO9SmkH2N#dG3|~LV-RIXRL2C3KBj*|XtCbD z{r~`)5PeQN;ijmv@LS-qpmdmXMQ^MeE>#JaGR0 zq9%@5cSm1mw1$_bw<9400DjK-*bAULt}U8aWN8UGX=zbOF=F|D$v^D;W%ZBYcx``L zY@7b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-manager.md index c3a54fb27..16ddb0408 100644 --- a/docs/modules/Style-manager.md +++ b/docs/modules/Style-manager.md @@ -126,11 +126,13 @@ sectors: [ name: 'First sector', properties: [ { + // Default options // id: 'padding', // The id of the property, if missing, will be the same as `property` value type: 'number', label: 'Padding', // Label for the property property: 'padding', // CSS property to change default: '0', // Default value to display + // Additonal `number` options units: ['px', '%'], // Units (available only for the 'number' type) min: 0, // Min value (available only for the 'number' type) } @@ -172,7 +174,7 @@ Let's see below the list of all available default types with their relative UI a #### Default types -* `base` - The base type, renders as a simple text input field. Model: [Property](/api/property.html) +* `base` - The base type, renders as a simple text input field. **Model**: [Property](/api/property.html) @@ -186,11 +188,11 @@ Let's see below the list of all available default types with their relative UI a }, ``` -* `color` - Same props as `base` but the UI is a color picker. Model: [Property](/api/property.html) +* `color` - Same props as `base` but the UI is a color picker. **Model**: [Property](/api/property.html) -* `number` - Number input field for numeric values. Model: [PropertyNumber](/api/property_number.html) +* `number` - Number input field for numeric values. **Model**: [PropertyNumber](/api/property_number.html) @@ -207,11 +209,11 @@ Let's see below the list of all available default types with their relative UI a max: 100, }, ``` -* `slider` - Same props as `number` but the UI is a slider. Model: [PropertyNumber](/api/property_number.html) +* `slider` - Same props as `number` but the UI is a slider. **Model**: [PropertyNumber](/api/property_number.html) -* `select` - Select input with options. Model: [PropertySelect](/api/property_select.html) +* `select` - Select input with options. **Model**: [PropertySelect](/api/property_select.html) @@ -222,6 +224,7 @@ Let's see below the list of all available default types with their relative UI a property: 'display', label: 'Select type', default: 'block', + // Additional props options: [ {id: 'block', label: 'Block'}, {id: 'inline', label: 'Inline'}, @@ -230,9 +233,48 @@ Let's see below the list of all available default types with their relative UI a }, ``` -* `radio` - -* `composite` - -* `stack` - +* `radio` - Same props as `select` but the UI is a radio button. **Model**: [PropertySelect](/api/property_select.html) + + + +* `composite` - This type is great for CSS shorthand properties, where the final value is a composition of multiple sub properties. **Model**: [PropertyComposite](/api/property_composite.html) + + + + ```js + // Example + { + type: 'composite', + property: 'margin', + label: 'Composite type', + // Additional props + properties: [ + { type: 'number', units: ['px'], default: '0', property: 'margin-top' }, + { type: 'number', units: ['px'], default: '0', property: 'margin-right' }, + { type: 'number', units: ['px'], default: '0', property: 'margin-bottom' }, + { type: 'number', units: ['px'], default: '0', property: 'margin-left' }, + ] + }, + ``` +* `stack` - This type is great for CSS multiple properties like `text-shadow`, `box-shadow`, etc. **Model**: [PropertyStack](/api/property_stack.html) + + + + ```js + // Example + { + type: 'stack', + property: 'text-shadow', + label: 'Stack type', + // Additional props + properties: [ + { type: 'number', units: ['px'], default: '0', property: 'x' }, + { type: 'number', units: ['px'], default: '0', property: 'y' }, + { type: 'number', units: ['px'], default: '0', property: 'blur' }, + { type: 'color', default: 'black', property: 'color' }, + ] + }, + ``` #### Built-in properties diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 44421576a..bdb987fe3 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -15,7 +15,7 @@ const PARTS_REG = /\s(?![^(]*\))/; * @typedef PropertyStack * @property {String|RegExp} [layerSeparator=', '] The separator used to split layer values. * @property {String} [layerJoin=', '] Value used to join layer values. - * @property {Function} [layerLabel] Custom logic for creating the layer value. + * @property {Function} [layerLabel] Custom logic for creating the layer label. * */ export default class PropertyStack extends PropertyComposite { From 935f91bc832ad56190bc5f7b803e395296d3919e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 28 Dec 2021 15:36:20 +0100 Subject: [PATCH 179/313] Update StyleManager docs --- docs/modules/Style-manager.md | 39 +++++++++++++++++++++- src/style_manager/model/PropertyFactory.js | 2 +- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/docs/modules/Style-manager.md b/docs/modules/Style-manager.md index 16ddb0408..05ae18f19 100644 --- a/docs/modules/Style-manager.md +++ b/docs/modules/Style-manager.md @@ -174,6 +174,10 @@ Let's see below the list of all available default types with their relative UI a #### Default types +::: tip +Each **Model** describes more in detail available props and their usage. +::: + * `base` - The base type, renders as a simple text input field. **Model**: [Property](/api/property.html) @@ -256,7 +260,7 @@ Let's see below the list of all available default types with their relative UI a ] }, ``` -* `stack` - This type is great for CSS multiple properties like `text-shadow`, `box-shadow`, etc. **Model**: [PropertyStack](/api/property_stack.html) +* `stack` - This type is great for CSS multiple properties like `text-shadow`, `box-shadow`, `transform`, etc. **Model**: [PropertyStack](/api/property_stack.html) @@ -278,6 +282,39 @@ Let's see below the list of all available default types with their relative UI a #### Built-in properties +In order to speed up the Style Manager configuration, GrapesJS is shipped with a set of already defined common CSS properties which you can reuse and extend. + +```js +sectors: [ + { + name: 'First sector', + properties: [ + // Pass the built-in CSS property as a string + 'width', + 'min-width', + // Extend the built-in property with your props + { + extend: 'max-width', + units: ['px', '%'], + }, + // If the property doesn't exist it will be converted to a base type + 'unknown-property' // -> { type: 'base', property: 'unknown-property' } + ], + }, +] +``` + +::: tip +You can check if the property is available by running +```js +editor.StyleManager.getBuiltIn('property-name'); +``` +or get the list of all available properties with +```js +editor.StyleManager.getBuiltInAll(); +``` +::: + ## Orchestration by Components ## Programmatic usage diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index 37483eb20..dd6ad6849 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -163,7 +163,7 @@ export default class PropertyFactory { ['border-top-right-radius', {}, 'border-radius-c'], ['border-bottom-left-radius', {}, 'border-radius-c'], ['border-bottom-right-radius', {}, 'border-radius-c'], - ['border-width', { default: 'medium', units: this.unitsSizeNoPerc }, 'border-radius-c'], + ['border-width', { units: this.unitsSizeNoPerc }, 'border-radius-c'], ['box-shadow-h', {}, 'text-shadow-h'], ['box-shadow-v', {}, 'text-shadow-h'], ['box-shadow-blur', { default: '5px' }, 'text-shadow-blur'], From 1497765408b03ac9f3dd033c9648ae684882ac2d Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 28 Dec 2021 16:08:24 +0100 Subject: [PATCH 180/313] Update margin and padding sub properties --- src/i18n/locale/en.js | 16 +++++++++++++ src/style_manager/model/PropertyFactory.js | 24 ++++++++++++++++--- .../style_manager/model/PropertyFactory.js | 10 +++++++- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/src/i18n/locale/en.js b/src/i18n/locale/en.js index 86d4697c4..00c237358 100644 --- a/src/i18n/locale/en.js +++ b/src/i18n/locale/en.js @@ -88,6 +88,22 @@ export default { 'text-shadow-v': 'Y', 'text-shadow-blur': 'Blur', 'text-shadow-color': 'Color', + 'box-shadow-h': 'X', + 'box-shadow-v': 'Y', + 'box-shadow-blur': 'Blur', + 'box-shadow-spread': 'Spread', + 'box-shadow-color': 'Color', + 'box-shadow-type': 'Type', + + // Default names for sub properties in Composite and Stack types + 'margin-top-sub': 'Top', + 'margin-right-sub': 'Right', + 'margin-bottom-sub': 'Bottom', + 'margin-left-sub': 'Left', + 'padding-top-sub': 'Top', + 'padding-right-sub': 'Right', + 'padding-bottom-sub': 'Bottom', + 'padding-left-sub': 'Left', }, // Translate options in style properties // options: { diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index dd6ad6849..231d7e075 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -122,7 +122,15 @@ export default class PropertyFactory { } __sub(items) { - return () => items.map(p => this.get(p)); + return () => + items.map(p => { + if (isString(p)) return this.get(p); + const { extend, ...rest } = p; + return { + ...this.get(extend), + ...rest, + }; + }); } init() { @@ -223,13 +231,23 @@ export default class PropertyFactory { 'margin', { type: this.typeComposite, - properties: this.__sub(['margin-top', 'margin-right', 'margin-bottom', 'margin-left']), + properties: this.__sub([ + { extend: 'margin-top', id: 'margin-top-sub' }, + { extend: 'margin-right', id: 'margin-right-sub' }, + { extend: 'margin-bottom', id: 'margin-bottom-sub' }, + { extend: 'margin-left', id: 'margin-left-sub' }, + ]), }, ], [ 'padding', { - properties: this.__sub(['padding-top', 'padding-right', 'padding-bottom', 'padding-left']), + properties: this.__sub([ + { extend: 'padding-top', id: 'padding-top-sub' }, + { extend: 'padding-right', id: 'padding-right-sub' }, + { extend: 'padding-bottom', id: 'padding-bottom-sub' }, + { extend: 'padding-left', id: 'padding-left-sub' }, + ]), }, 'margin', ], diff --git a/test/specs/style_manager/model/PropertyFactory.js b/test/specs/style_manager/model/PropertyFactory.js index 5ce54f89c..d5f3f83bf 100644 --- a/test/specs/style_manager/model/PropertyFactory.js +++ b/test/specs/style_manager/model/PropertyFactory.js @@ -220,6 +220,7 @@ describe('PropertyFactory', () => { { fixedValues: ['initial', 'inherit', 'auto'], property: 'margin-top', + id: 'margin-top-sub', type: 'integer', units: obj.unitsSize, default: '0', @@ -227,6 +228,7 @@ describe('PropertyFactory', () => { { fixedValues: ['initial', 'inherit', 'auto'], property: 'margin-right', + id: 'margin-right-sub', type: 'integer', units: obj.unitsSize, default: '0', @@ -234,6 +236,7 @@ describe('PropertyFactory', () => { { fixedValues: ['initial', 'inherit', 'auto'], property: 'margin-bottom', + id: 'margin-bottom-sub', type: 'integer', units: obj.unitsSize, default: '0', @@ -241,6 +244,7 @@ describe('PropertyFactory', () => { { fixedValues: ['initial', 'inherit', 'auto'], property: 'margin-left', + id: 'margin-left-sub', type: 'integer', units: obj.unitsSize, default: '0', @@ -257,6 +261,7 @@ describe('PropertyFactory', () => { properties: [ { property: 'padding-top', + id: 'padding-top-sub', fixedValues: ['initial', 'inherit', 'auto'], type: 'integer', units: obj.unitsSize, @@ -265,6 +270,7 @@ describe('PropertyFactory', () => { }, { property: 'padding-right', + id: 'padding-right-sub', fixedValues: ['initial', 'inherit', 'auto'], type: 'integer', units: obj.unitsSize, @@ -273,6 +279,7 @@ describe('PropertyFactory', () => { }, { property: 'padding-bottom', + id: 'padding-bottom-sub', fixedValues: ['initial', 'inherit', 'auto'], type: 'integer', units: obj.unitsSize, @@ -281,6 +288,7 @@ describe('PropertyFactory', () => { }, { property: 'padding-left', + id: 'padding-left-sub', fixedValues: ['initial', 'inherit', 'auto'], type: 'integer', units: obj.unitsSize, @@ -511,7 +519,7 @@ describe('PropertyFactory', () => { property: 'border-width', type: 'integer', units: obj.unitsSizeNoPerc, - default: 'medium', + default: '0', min: 0, }, { From 5e16a8c612104bc5b6677128a08614913189c48e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 28 Dec 2021 16:20:26 +0100 Subject: [PATCH 181/313] Update sub properties labels --- src/i18n/locale/en.js | 16 ++++++++++++++-- src/style_manager/model/PropertyFactory.js | 14 +++++++++----- .../specs/style_manager/model/PropertyFactory.js | 7 +++++++ 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/i18n/locale/en.js b/src/i18n/locale/en.js index 00c237358..0edae1bd1 100644 --- a/src/i18n/locale/en.js +++ b/src/i18n/locale/en.js @@ -84,6 +84,7 @@ export default { }, // The core library generates the name by their `property` name properties: { + // Default names for sub properties in Composite and Stack types 'text-shadow-h': 'X', 'text-shadow-v': 'Y', 'text-shadow-blur': 'Blur', @@ -94,8 +95,6 @@ export default { 'box-shadow-spread': 'Spread', 'box-shadow-color': 'Color', 'box-shadow-type': 'Type', - - // Default names for sub properties in Composite and Stack types 'margin-top-sub': 'Top', 'margin-right-sub': 'Right', 'margin-bottom-sub': 'Bottom', @@ -104,6 +103,19 @@ export default { 'padding-right-sub': 'Right', 'padding-bottom-sub': 'Bottom', 'padding-left-sub': 'Left', + 'border-width-sub': 'Width', + 'border-style-sub': 'Style', + 'border-color-sub': 'Color', + 'border-top-left-radius-sub': 'Top Left', + 'border-top-right-radius-sub': 'Top Right', + 'border-bottom-right-radius-sub': 'Bottom Right', + 'border-bottom-left-radius-sub': 'Bottom Left', + 'transform-rotate-x': 'Rotate X', + 'transform-rotate-y': 'Rotate Y', + 'transform-rotate-z': 'Rotate Z', + 'transform-scale-x': 'Scale X', + 'transform-scale-y': 'Scale Y', + 'transform-scale-z': 'Scale Z', }, // Translate options in style properties // options: { diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index 231d7e075..794c7a05e 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -254,7 +254,11 @@ export default class PropertyFactory { [ 'border', { - properties: this.__sub(['border-width', 'border-style', 'border-color']), + properties: this.__sub([ + { extend: 'border-width', id: 'border-width-sub' }, + { extend: 'border-style', id: 'border-style-sub' }, + { extend: 'border-color', id: 'border-color-sub' }, + ]), }, 'margin', ], @@ -262,10 +266,10 @@ export default class PropertyFactory { 'border-radius', { properties: this.__sub([ - 'border-top-left-radius', - 'border-top-right-radius', - 'border-bottom-right-radius', - 'border-bottom-left-radius', + { extend: 'border-top-left-radius', id: 'border-top-left-radius-sub' }, + { extend: 'border-top-right-radius', id: 'border-top-right-radius-sub' }, + { extend: 'border-bottom-right-radius', id: 'border-bottom-right-radius-sub' }, + { extend: 'border-bottom-left-radius', id: 'border-bottom-left-radius-sub' }, ]), }, 'margin', diff --git a/test/specs/style_manager/model/PropertyFactory.js b/test/specs/style_manager/model/PropertyFactory.js index d5f3f83bf..b71d22561 100644 --- a/test/specs/style_manager/model/PropertyFactory.js +++ b/test/specs/style_manager/model/PropertyFactory.js @@ -469,6 +469,7 @@ describe('PropertyFactory', () => { properties: [ { property: 'border-top-left-radius', + id: 'border-top-left-radius-sub', type: 'integer', units: obj.unitsSize, default: '0', @@ -476,6 +477,7 @@ describe('PropertyFactory', () => { }, { property: 'border-top-right-radius', + id: 'border-top-right-radius-sub', type: 'integer', units: obj.unitsSize, min: 0, @@ -483,6 +485,7 @@ describe('PropertyFactory', () => { }, { property: 'border-bottom-right-radius', + id: 'border-bottom-right-radius-sub', type: 'integer', units: obj.unitsSize, min: 0, @@ -490,6 +493,7 @@ describe('PropertyFactory', () => { }, { property: 'border-bottom-left-radius', + id: 'border-bottom-left-radius-sub', type: 'integer', units: obj.unitsSize, min: 0, @@ -517,6 +521,7 @@ describe('PropertyFactory', () => { properties: [ { property: 'border-width', + id: 'border-width-sub', type: 'integer', units: obj.unitsSizeNoPerc, default: '0', @@ -524,6 +529,7 @@ describe('PropertyFactory', () => { }, { property: 'border-style', + id: 'border-style-sub', type: 'select', default: 'solid', options: [ @@ -540,6 +546,7 @@ describe('PropertyFactory', () => { }, { property: 'border-color', + id: 'border-color-sub', type: 'color', default: 'black', }, From 6e69ac8d87ba0de35ad99ad0658833b1b977074b Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 28 Dec 2021 16:23:06 +0100 Subject: [PATCH 182/313] Update docs --- docs/modules/Style-manager.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/modules/Style-manager.md b/docs/modules/Style-manager.md index 05ae18f19..008fbc97d 100644 --- a/docs/modules/Style-manager.md +++ b/docs/modules/Style-manager.md @@ -315,10 +315,15 @@ editor.StyleManager.getBuiltInAll(); ``` ::: -## Orchestration by Components +## Components constraints + +* Components constraint props ## Programmatic usage +* Change target +* Get current selected target + ## Customization ## Events From 0fab3897381cf88b25a7c51776643daf9ce2cccb Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 29 Dec 2021 08:53:07 +0100 Subject: [PATCH 183/313] Update property labels --- src/i18n/locale/en.js | 12 ++++++++++-- src/style_manager/model/PropertyFactory.js | 16 ++++++++++------ .../specs/style_manager/model/PropertyFactory.js | 8 ++++++++ 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/i18n/locale/en.js b/src/i18n/locale/en.js index 0edae1bd1..2d6659016 100644 --- a/src/i18n/locale/en.js +++ b/src/i18n/locale/en.js @@ -82,9 +82,9 @@ export default { flex: 'Flex', dimension: 'Dimension', }, - // The core library generates the name by their `property` name + // Default names for sub properties in Composite and Stack types. + // Other labels are generated directly from their property names (eg. 'font-size' will be 'Font size'). properties: { - // Default names for sub properties in Composite and Stack types 'text-shadow-h': 'X', 'text-shadow-v': 'Y', 'text-shadow-blur': 'Blur', @@ -116,6 +116,14 @@ export default { 'transform-scale-x': 'Scale X', 'transform-scale-y': 'Scale Y', 'transform-scale-z': 'Scale Z', + 'transition-property-sub': 'Property', + 'transition-duration-sub': 'Duration', + 'transition-timing-function-sub': 'Timing', + 'background-image-sub': 'Image', + 'background-repeat-sub': 'Repeat', + 'background-position-sub': 'Position', + 'background-attachment-sub': 'Attachment', + 'background-size-sub': 'Size', }, // Translate options in style properties // options: { diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index 794c7a05e..fa9916108 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -294,7 +294,11 @@ export default class PropertyFactory { 'transition', { type: this.typeStack, - properties: this.__sub(['transition-property', 'transition-duration', 'transition-timing-function']), + properties: this.__sub([ + { extend: 'transition-property', id: 'transition-property-sub' }, + { extend: 'transition-duration', id: 'transition-duration-sub' }, + { extend: 'transition-timing-function', id: 'transition-timing-function-sub' }, + ]), }, ], [ @@ -325,11 +329,11 @@ export default class PropertyFactory { { detached: true, properties: this.__sub([ - 'background-image', - 'background-repeat', - 'background-position', - 'background-attachment', - 'background-size', + { extend: 'background-image', id: 'background-image-sub' }, + { extend: 'background-repeat', id: 'background-repeat-sub' }, + { extend: 'background-position', id: 'background-position-sub' }, + { extend: 'background-attachment', id: 'background-attachment-sub' }, + { extend: 'background-size', id: 'background-size-sub' }, ]), }, 'box-shadow', diff --git a/test/specs/style_manager/model/PropertyFactory.js b/test/specs/style_manager/model/PropertyFactory.js index b71d22561..773d9db77 100644 --- a/test/specs/style_manager/model/PropertyFactory.js +++ b/test/specs/style_manager/model/PropertyFactory.js @@ -614,17 +614,20 @@ describe('PropertyFactory', () => { properties: [ { property: 'background-image', + id: 'background-image-sub', type: 'file', functionName: 'url', }, { property: 'background-repeat', + id: 'background-repeat-sub', type: 'select', default: 'repeat', options: [{ id: 'repeat' }, { id: 'repeat-x' }, { id: 'repeat-y' }, { id: 'no-repeat' }], }, { property: 'background-position', + id: 'background-position-sub', type: 'select', default: 'left top', options: [ @@ -641,12 +644,14 @@ describe('PropertyFactory', () => { }, { property: 'background-attachment', + id: 'background-attachment-sub', type: 'select', default: 'scroll', options: [{ id: 'scroll' }, { id: 'fixed' }, { id: 'local' }], }, { property: 'background-size', + id: 'background-size-sub', type: 'select', default: 'auto', options: [{ id: 'auto' }, { id: 'cover' }, { id: 'contain' }], @@ -663,6 +668,7 @@ describe('PropertyFactory', () => { properties: [ { property: 'transition-property', + id: 'transition-property-sub', type: 'select', default: 'width', options: [ @@ -677,6 +683,7 @@ describe('PropertyFactory', () => { }, { property: 'transition-duration', + id: 'transition-duration-sub', type: 'integer', units: obj.unitsTime, default: '2', @@ -684,6 +691,7 @@ describe('PropertyFactory', () => { }, { property: 'transition-timing-function', + id: 'transition-timing-function-sub', type: 'select', default: 'ease', options: [{ id: 'linear' }, { id: 'ease' }, { id: 'ease-in' }, { id: 'ease-out' }, { id: 'ease-in-out' }], From 853ba2ebdd9600f2ea412414aac377c64ae1fe92 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 29 Dec 2021 09:08:57 +0100 Subject: [PATCH 184/313] Add I18n section --- docs/modules/Style-manager.md | 86 +++++++++++++++++++++++------------ 1 file changed, 57 insertions(+), 29 deletions(-) diff --git a/docs/modules/Style-manager.md b/docs/modules/Style-manager.md index 008fbc97d..99836061d 100644 --- a/docs/modules/Style-manager.md +++ b/docs/modules/Style-manager.md @@ -84,35 +84,6 @@ grapesjs.init({ }, }); ``` -The label of the sector you see in the editor is using directly the `name` but you can also rely on the [I18n] module via sector's `id` in case you plan to have a multi-language editor. - -```js -grapesjs.init({ - i18n: { - // Use `messagesAdd` in order to extend the default set - messagesAdd: { - en: { - styleManager: { - sectors: { - 'first-sector-id': 'First sector EN' - } - } - } - } - }, - // ... - styleManager: { - sectors: [ - { - id: 'first-sector-id', - // You can leave the name as a fallback in case the i18n definition is missing - name: 'First sector', - }, - // ... - ], - }, -}); -``` ### Property defintions @@ -315,6 +286,63 @@ editor.StyleManager.getBuiltInAll(); ``` ::: +## I18n + +If you're planning to have a multi-language editor you can easily connect sector and property labels to the [I18n] module via their IDs. + +```js +grapesjs.init({ + styleManager: { + sectors: [ + { + id: 'first-sector-id', + // You can leave the name as a fallback in case the i18n definition is missing + name: 'First sector', + properties: [ + 'width', + { + id: 'display-prop-id', // By default the id is the same as its property name + label: 'Display', + type: 'select', + property: 'display', + default: 'block', + options: [ + {id: 'block', label: 'Block'}, + {id: 'inline', label: 'Inline'}, + {id: 'none', label: 'None'}, + ] + }, + ], + }, + // ... + ], + }, + i18n: { + // Use `messagesAdd` in order to extend the default set + messagesAdd: { + en: { + styleManager: { + sectors: { + 'first-sector-id': 'First sector EN' + }, + properties: { + width: 'Width EN', + 'display-prop-id': 'Display EN', + }, + options: { + 'display-prop-id': { + block: 'Block EN', + inline: 'Inline EN', + none: 'None EN', + } + } + } + } + } + }, +}); +``` + ## Components constraints * Components constraint props From a38ba46743680bb35ea6cc49d896c8f6b7e0aa08 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 29 Dec 2021 11:15:38 +0100 Subject: [PATCH 185/313] Add Components constraints in Style Manager docs --- docs/modules/Style-manager.md | 51 ++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/docs/modules/Style-manager.md b/docs/modules/Style-manager.md index 99836061d..bef313c18 100644 --- a/docs/modules/Style-manager.md +++ b/docs/modules/Style-manager.md @@ -345,7 +345,56 @@ grapesjs.init({ ## Components constraints -* Components constraint props +When you define custom components you can also indicate, via `stylable` and `unstylable` props, which CSS properties should be available for styling. In that case, the Style Manager will only show the available properties. If the sector doesn't contain any available property, it won't be shown. + +```js +const customComponents = (editor) => { + // Component A + editor.Components.addType('cmp-a', { + model: { + defaults: { + // When this component is selected, the Style Manager will show only the following properties + stylable: ['width', 'height'] + } + } + }); + // Component B + editor.Components.addType('cmp-b', { + model: { + defaults: { + // When this component is selected, the Style Manager will hide the following properties + unstylable: ['color'] + } + } + }); +}; + +grapesjs.init({ + // ... + plugins: [customComponents], + components: [ + { type: 'cmp-a', components: 'Component A' }, + { type: 'cmp-b', components: 'Component B' }, + ], + styleManager: { + sectors: [ + { + name: 'First sector', + properties: [ + 'width', 'min-width', + 'height', 'min-height', + ], + }, + { + name: 'Second sector', + properties: [ + 'color', 'font-size', + ], + }, + ], + }, +}); +``` ## Programmatic usage From 760b1d96208b7a3d268409847b5a6fb602f1ca4f Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 29 Dec 2021 12:06:21 +0100 Subject: [PATCH 186/313] Start programmatic usage --- docs/api/property_stack.md | 2 +- docs/api/style_manager.md | 117 ++++++++++++++++++++-------------- docs/modules/Style-manager.md | 56 +++++++++++----- src/style_manager/index.js | 73 ++++++++------------- 4 files changed, 134 insertions(+), 114 deletions(-) diff --git a/docs/api/property_stack.md b/docs/api/property_stack.md index e96544873..3e13419ae 100644 --- a/docs/api/property_stack.md +++ b/docs/api/property_stack.md @@ -10,7 +10,7 @@ * `layerSeparator` **([String][1] | [RegExp][2])?** The separator used to split layer values. * `layerJoin` **[String][1]?** Value used to join layer values. -* `layerLabel` **[Function][3]?** Custom logic for creating the layer value. +* `layerLabel` **[Function][3]?** Custom logic for creating the layer label. ### getLayers diff --git a/docs/api/style_manager.md b/docs/api/style_manager.md index 0e6e1c9e4..95ecd8483 100644 --- a/docs/api/style_manager.md +++ b/docs/api/style_manager.md @@ -50,19 +50,16 @@ Returns **[Object][16]** ## addSector -Add new sector to the collection. If the sector with the same id already exists, -that one will be returned. +Add new sector. If the sector with the same id already exists, that one will be returned. ### Parameters -* `id` **[string][17]** Sector id -* `sector` **[Object][16]** Object representing sector - - * `sector.name` **[string][17]** Sector's label (optional, default `''`) - * `sector.open` **[Boolean][18]** Indicates if the sector should be opened (optional, default `true`) - * `sector.properties` **[Array][19]<[Object][16]>** Array of properties (optional, default `[]`) +* `id` **[String][17]** Sector id +* `sector` **[Object][16]** Sector definition. Check the [available properties][18] * `options` **[Object][16]** Options (optional, default `{}`) + * `options.at` **[Number][19]?** Position index (by default, will be appended at the end). + ### Examples ```javascript @@ -71,18 +68,18 @@ const sector = styleManager.addSector('mySector',{ open: true, properties: [{ name: 'My property'}] }, { at: 0 }); -// With `at: 0` we place the new sector at the beginning of the collection +// With `at: 0` we place the new sector at the beginning of the list ``` Returns **[Sector]** Added Sector ## getSector -Get sector by id +Get sector by id. ### Parameters -* `id` **[string][17]** Sector id +* `id` **[String][17]** Sector id * `opts` (optional, default `{}`) ### Examples @@ -95,11 +92,11 @@ Returns **([Sector] | null)** ## removeSector -Remove a sector by id +Remove sector by id. ### Parameters -* `id` **[string][17]** Sector id +* `id` **[String][17]** Sector id ### Examples @@ -111,7 +108,7 @@ Returns **[Sector]** Removed sector ## getSectors -Get all sectors +Get all sectors. ### Parameters @@ -127,51 +124,33 @@ Returns **Collection<[Sector]>** Collection of sectors ## addProperty -Add property to the sector identified by id +Add new property to the sector. ### Parameters -* `sectorId` **[string][17]** Sector id -* `property` **[Object][16]** Property object - - * `property.name` **[string][17]** Name of the property (optional, default `''`) - * `property.property` **[string][17]** CSS property, eg. `min-height` (optional, default `''`) - * `property.type` **[string][17]** Type of the property: integer | radio | select | color | file | composite | stack (optional, default `''`) - * `property.units` **[Array][19]<[string][17]>** Unit of measure available, eg. \['px','%','em']. Only for integer type (optional, default `[]`) - * `property.unit` **[string][17]** Default selected unit from `units`. Only for integer type (optional, default `''`) - * `property.min` **[number][20]** Min possible value. Only for integer type (optional, default `null`) - * `property.max` **[number][20]** Max possible value. Only for integer type (optional, default `null`) - * `property.defaults` **[string][17]** Default value (optional, default `''`) - * `property.info` **[string][17]** Some description (optional, default `''`) - * `property.icon` **[string][17]** Class name. If exists no text will be displayed (optional, default `''`) - * `property.preview` **[Boolean][18]** Show layers preview. Only for stack type (optional, default `false`) - * `property.functionName` **[string][17]** Indicates if value need to be wrapped in some function, for istance `transform: rotate(90deg)` (optional, default `''`) - * `property.properties` **[Array][19]<[Object][16]>** Nested properties for composite and stack type (optional, default `[]`) - * `property.layers` **[Array][19]<[Object][16]>** Layers for stack properties (optional, default `[]`) - * `property.list` **[Array][19]<[Object][16]>** List of possible options for radio and select types (optional, default `[]`) +* `sectorId` **[String][17]** Sector id. +* `property` **[Object][16]** Property definition. Check the [base available properties][20] + others based on the `type` of your property. * `opts` (optional, default `{}`) * `options` **[Object][16]** Options (optional, default `{}`) + * `options.at` **[Number][19]?** Position index (by default, will be appended at the end). + ### Examples ```javascript -var property = styleManager.addProperty('mySector',{ - name: 'Minimum height', +const property = styleManager.addProperty('mySector', { + label: 'Minimum height', property: 'min-height', type: 'select', - defaults: '100px', - list: [{ - value: '100px', - name: '100', - },{ - value: '200px', - name: '200', - }], + default: '100px', + options: [ + { id: '100px', label: '100' }, + { id: '200px', label: '200' }, + ], }, { at: 0 }); -// With `at: 0` we place the new property at the beginning of the collection ``` -Returns **(Property | null)** Added Property or `null` in case sector doesn't exist +Returns **([Property] | null)** Added property or `null` in case the sector doesn't exist. ## getProperty @@ -291,7 +270,7 @@ Returns **[Object][16]** Type definition Get all types -Returns **[Array][19]** +Returns **[Array][21]** ## createType @@ -318,6 +297,44 @@ someContainer.appendChild(propView.el); Returns **PropertyView** +## getBuiltIn + +Return built-in property definition + +### Parameters + +* `prop` **[String][17]** Property name. + +Returns **([Object][16] | null)** Property definition. + +## getBuiltInAll + +Get all the available built-in property definitions. + +Returns **[Object][16]** + +## addBuiltIn + +Add built-in property definition. +If the property exists already, it will extend it. + +### Parameters + +* `prop` **[String][17]** Property name. +* `definition` **[Object][16]** Property definition. + +### Examples + +```javascript +const sector = styleManager.addBuiltIn('new-property', { + type: 'select', + default: 'value1', + options: [{ id: 'value1', label: 'Some label' }, ...], +}) +``` + +Returns **[Object][16]** Added property definition. + [1]: https://github.com/artf/grapesjs/blob/master/src/style_manager/config/config.js [2]: #getconfig @@ -352,8 +369,10 @@ Returns **PropertyView** [17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[18]: sector.html#properties + +[19]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[19]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array +[20]: property.html#properties -[20]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[21]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array diff --git a/docs/modules/Style-manager.md b/docs/modules/Style-manager.md index bef313c18..85251799a 100644 --- a/docs/modules/Style-manager.md +++ b/docs/modules/Style-manager.md @@ -286,6 +286,10 @@ editor.StyleManager.getBuiltInAll(); ``` ::: + + + + ## I18n If you're planning to have a multi-language editor you can easily connect sector and property labels to the [I18n] module via their IDs. @@ -343,6 +347,10 @@ grapesjs.init({ }); ``` + + + + ## Components constraints When you define custom components you can also indicate, via `stylable` and `unstylable` props, which CSS properties should be available for styling. In that case, the Style Manager will only show the available properties. If the sector doesn't contain any available property, it won't be shown. @@ -396,34 +404,48 @@ grapesjs.init({ }); ``` + + + + ## Programmatic usage +For a more advanced usage you can rely on the [Style Manager API] to perform different kind of actions related to the module. + +* Managing sectors/properties post-initialization. + ```js + // Get the module from the editor instance + const sm = editor.StyleManager; + + // Add new sector + const newSector = sm.addSector('sector-id', { + name: 'New sector', + open: true, + properties: ['width'], + }); + + // Add new property to the sector + sm.addProperty('sector-id', { + type: 'number', + property: 'min-width', + }); + + // Remove sector + sm.removeSector('sector-id'); + ``` + * Change target * Get current selected target ## Customization -## Events -Here you can find all the available built-in properties that you can use inside Style Manager via `buildProps`: -`float`, `position`, `text-align`, `display`, `font-family`, `font-weight`, `border`, `border-style`, `border-color`, `border-width`, `box-shadow`, `background-repeat`, `background-position`, `background-attachment`, `background-size`, `transition`, `transition-duration`, `transition-property`, `transition-timing-function`, `top`, `right`, `bottom`, `left`, `margin`, `margin-top`, `margin-right`, `margin-bottom`, `margin-left`, `padding`, `padding-top`, `padding-right`, `padding-bottom`, `padding-left`, `width`, `height`, `min-width`, `min-height`, `max-width`, `max-height`, `font-size`, `letter-spacing`, `line-height`, `text-shadow`, `border-radius`, `border-top-left-radius`, `border-top-right-radius`, `border-bottom-left-radius`, `border-bottom-right-radius`, `perspective`, `transform`, `transform-rotate-x`, `transform-rotate-y`, `transform-rotate-z`, `transform-scale-x`, `transform-scale-y`, `transform-scale-z`, `color`, `background-color`, `background`, `background-image`, `cursor`, `flex-direction`, `flex-wrap`, `justify-content`, `align-items`, `align-content`, `order`, `flex-basis`, `flex-grow`, `flex-shrink`, `align-self`, `overflow`, `overflow-x`, `overflow-y` -Example usage: -```js -... - styleManager : { - sectors: [{ - name: 'Dimension', - buildProps: ['width', 'min-height'] - },{ - name: 'Extra', - buildProps: ['background-color', 'box-shadow'] - }] - } -... -``` +## Events + +For a complete list of available events, you can check it [here](/api/style_manager.html#available-events). [Components]: diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 11ab15d7f..d7d317995 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -145,22 +145,19 @@ export default () => { }, /** - * Add new sector to the collection. If the sector with the same id already exists, - * that one will be returned. - * @param {string} id Sector id - * @param {Object} sector Object representing sector - * @param {string} [sector.name=''] Sector's label - * @param {Boolean} [sector.open=true] Indicates if the sector should be opened - * @param {Array} [sector.properties=[]] Array of properties - * @param {Object} [options={}] Options - * @return {[Sector]} Added Sector + * Add new sector. If the sector with the same id already exists, that one will be returned. + * @param {String} id Sector id + * @param {Object} sector Sector definition. Check the [available properties](sector.html#properties) + * @param {Object} [options={}] Options + * @param {Number} [options.at] Position index (by default, will be appended at the end). + * @returns {[Sector]} Added Sector * @example * const sector = styleManager.addSector('mySector',{ * name: 'My sector', * open: true, * properties: [{ name: 'My property'}] * }, { at: 0 }); - * // With `at: 0` we place the new sector at the beginning of the collection + * // With `at: 0` we place the new sector at the beginning of the list * */ addSector(id, sector, options = {}) { let result = this.getSector(id); @@ -174,9 +171,9 @@ export default () => { }, /** - * Get sector by id - * @param {string} id Sector id - * @return {[Sector]|null} + * Get sector by id. + * @param {String} id Sector id + * @returns {[Sector]|null} * @example * const sector = styleManager.getSector('mySector'); * */ @@ -187,9 +184,9 @@ export default () => { }, /** - * Remove a sector by id - * @param {string} id Sector id - * @return {[Sector]} Removed sector + * Remove sector by id. + * @param {String} id Sector id + * @returns {[Sector]} Removed sector * @example * const removed = styleManager.removeSector('mySector'); */ @@ -198,7 +195,7 @@ export default () => { }, /** - * Get all sectors + * Get all sectors. * @returns {Collection<[Sector]>} Collection of sectors * @example * const sectors = styleManager.getSectors(); @@ -208,41 +205,23 @@ export default () => { }, /** - * Add property to the sector identified by id - * @param {string} sectorId Sector id - * @param {Object} property Property object - * @param {string} [property.name=''] Name of the property - * @param {string} [property.property=''] CSS property, eg. `min-height` - * @param {string} [property.type=''] Type of the property: integer | radio | select | color | file | composite | stack - * @param {Array} [property.units=[]] Unit of measure available, eg. ['px','%','em']. Only for integer type - * @param {string} [property.unit=''] Default selected unit from `units`. Only for integer type - * @param {number} [property.min=null] Min possible value. Only for integer type - * @param {number} [property.max=null] Max possible value. Only for integer type - * @param {string} [property.defaults=''] Default value - * @param {string} [property.info=''] Some description - * @param {string} [property.icon=''] Class name. If exists no text will be displayed - * @param {Boolean} [property.preview=false] Show layers preview. Only for stack type - * @param {string} [property.functionName=''] Indicates if value need to be wrapped in some function, for istance `transform: rotate(90deg)` - * @param {Array} [property.properties=[]] Nested properties for composite and stack type - * @param {Array} [property.layers=[]] Layers for stack properties - * @param {Array} [property.list=[]] List of possible options for radio and select types + * Add new property to the sector. + * @param {String} sectorId Sector id. + * @param {Object} property Property definition. Check the [base available properties](property.html#properties) + others based on the `type` of your property. * @param {Object} [options={}] Options - * @return {Property|null} Added Property or `null` in case sector doesn't exist + * @param {Number} [options.at] Position index (by default, will be appended at the end). + * @returns {[Property]|null} Added property or `null` in case the sector doesn't exist. * @example - * var property = styleManager.addProperty('mySector',{ - * name: 'Minimum height', + * const property = styleManager.addProperty('mySector', { + * label: 'Minimum height', * property: 'min-height', * type: 'select', - * defaults: '100px', - * list: [{ - * value: '100px', - * name: '100', - * },{ - * value: '200px', - * name: '200', - * }], + * default: '100px', + * options: [ + * { id: '100px', label: '100' }, + * { id: '200px', label: '200' }, + * ], * }, { at: 0 }); - * // With `at: 0` we place the new property at the beginning of the collection */ addProperty(sectorId, property, opts = {}) { const sector = this.getSector(sectorId, { warn: 1 }); From a415f9be0eb2783b3ee67048952ed5cb8602682b Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 29 Dec 2021 12:21:33 +0100 Subject: [PATCH 187/313] Update StyleManager API docs --- docs/api/style_manager.md | 79 ++++++++++++++++++++------------------ src/style_manager/index.js | 79 ++++++++++++++++++++------------------ 2 files changed, 83 insertions(+), 75 deletions(-) diff --git a/docs/api/style_manager.md b/docs/api/style_manager.md index 95ecd8483..d5fc91033 100644 --- a/docs/api/style_manager.md +++ b/docs/api/style_manager.md @@ -19,15 +19,21 @@ Once the editor is instantiated you can use its API. Before using these methods const styleManager = editor.StyleManager; ``` +## Available Events + +* `style:sector:add` - Sector added. The [Sector] is passed as an argument to the callback. + +## Methods + * [getConfig][2] * [addSector][3] * [getSector][4] -* [removeSector][5] -* [getSectors][6] +* [getSectors][5] +* [removeSector][6] * [addProperty][7] * [getProperty][8] -* [removeProperty][9] -* [getProperties][10] +* [getProperties][9] +* [removeProperty][10] * [getModelToStyle][11] * [addType][12] * [getType][13] @@ -90,37 +96,37 @@ const sector = styleManager.getSector('mySector'); Returns **([Sector] | null)** -## removeSector +## getSectors -Remove sector by id. +Get all sectors. ### Parameters -* `id` **[String][17]** Sector id +* `opts` (optional, default `{}`) ### Examples ```javascript -const removed = styleManager.removeSector('mySector'); +const sectors = styleManager.getSectors(); ``` -Returns **[Sector]** Removed sector +Returns **Collection<[Sector]>** Collection of sectors -## getSectors +## removeSector -Get all sectors. +Remove sector by id. ### Parameters -* `opts` (optional, default `{}`) +* `id` **[String][17]** Sector id ### Examples ```javascript -const sectors = styleManager.getSectors(); +const removed = styleManager.removeSector('mySector'); ``` -Returns **Collection<[Sector]>** Collection of sectors +Returns **[Sector]** Removed sector ## addProperty @@ -130,10 +136,9 @@ Add new property to the sector. * `sectorId` **[String][17]** Sector id. * `property` **[Object][16]** Property definition. Check the [base available properties][20] + others based on the `type` of your property. -* `opts` (optional, default `{}`) -* `options` **[Object][16]** Options (optional, default `{}`) +* `opts` **[Object][16]** Options (optional, default `{}`) - * `options.at` **[Number][19]?** Position index (by default, will be appended at the end). + * `opts.at` **[Number][19]?** Position index (by default, will be appended at the end). ### Examples @@ -154,53 +159,53 @@ Returns **([Property] | null)** Added property or `null` in case the sector does ## getProperty -Get property by its CSS name and sector id +Get the property. ### Parameters -* `sectorId` **[string][17]** Sector id -* `name` **[string][17]** CSS property name (or id), eg. 'min-height' +* `sectorId` **[String][17]** Sector id. +* `id` **[String][17]** Property id. ### Examples ```javascript -var property = styleManager.getProperty('mySector','min-height'); +const property = styleManager.getProperty('mySector', 'min-height'); ``` -Returns **(Property | null)** +Returns **([Property] | null)** -## removeProperty +## getProperties -Remove a property from the sector +Get all properties of the sector. ### Parameters -* `sectorId` **[string][17]** Sector id -* `name` **[string][17]** CSS property name, eg. 'min-height' +* `sectorId` **[String][17]** Sector id. ### Examples ```javascript -const property = styleManager.removeProperty('mySector', 'min-height'); +const properties = styleManager.getProperties('mySector'); ``` -Returns **Property** Removed property +Returns **(Collection<[Property]> | null)** Collection of properties -## getProperties +## removeProperty -Get properties of the sector +Remove the property. ### Parameters -* `sectorId` **[string][17]** Sector id +* `sectorId` **[String][17]** Sector id. +* `id` **[String][17]** Property id. ### Examples ```javascript -var properties = styleManager.getProperties('mySector'); +const property = styleManager.removeProperty('mySector', 'min-height'); ``` -Returns **Properties** Collection of properties +Returns **([Property] | null)** Removed property ## getModelToStyle @@ -343,17 +348,17 @@ Returns **[Object][16]** Added property definition. [4]: #getsector -[5]: #removesector +[5]: #getsectors -[6]: #getsectors +[6]: #removesector [7]: #addproperty [8]: #getproperty -[9]: #removeproperty +[9]: #getproperties -[10]: #getproperties +[10]: #removeproperty [11]: #getmodeltostyle diff --git a/src/style_manager/index.js b/src/style_manager/index.js index d7d317995..445aaab69 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -14,16 +14,19 @@ * ```js * const styleManager = editor.StyleManager; * ``` + * ## Available Events + * * `style:sector:add` - Sector added. The [Sector] is passed as an argument to the callback. * + * ## Methods * * [getConfig](#getconfig) * * [addSector](#addsector) * * [getSector](#getsector) - * * [removeSector](#removesector) * * [getSectors](#getsectors) + * * [removeSector](#removesector) * * [addProperty](#addproperty) * * [getProperty](#getproperty) - * * [removeProperty](#removeproperty) * * [getProperties](#getproperties) + * * [removeProperty](#removeproperty) * * [getModelToStyle](#getmodeltostyle) * * [addType](#addtype) * * [getType](#gettype) @@ -183,6 +186,16 @@ export default () => { return res || null; }, + /** + * Get all sectors. + * @returns {Collection<[Sector]>} Collection of sectors + * @example + * const sectors = styleManager.getSectors(); + * */ + getSectors(opts = {}) { + return sectors && sectors.models ? (opts.array ? [...sectors.models] : sectors) : []; + }, + /** * Remove sector by id. * @param {String} id Sector id @@ -194,22 +207,12 @@ export default () => { return this.getSectors().remove(this.getSector(id, { warn: 1 })); }, - /** - * Get all sectors. - * @returns {Collection<[Sector]>} Collection of sectors - * @example - * const sectors = styleManager.getSectors(); - * */ - getSectors(opts = {}) { - return sectors && sectors.models ? (opts.array ? [...sectors.models] : sectors) : []; - }, - /** * Add new property to the sector. * @param {String} sectorId Sector id. * @param {Object} property Property definition. Check the [base available properties](property.html#properties) + others based on the `type` of your property. - * @param {Object} [options={}] Options - * @param {Number} [options.at] Position index (by default, will be appended at the end). + * @param {Object} [opts={}] Options + * @param {Number} [opts.at] Position index (by default, will be appended at the end). * @returns {[Property]|null} Added property or `null` in case the sector doesn't exist. * @example * const property = styleManager.addProperty('mySector', { @@ -232,43 +235,30 @@ export default () => { }, /** - * Get property by its CSS name and sector id - * @param {string} sectorId Sector id - * @param {string} name CSS property name (or id), eg. 'min-height' - * @return {Property|null} + * Get the property. + * @param {String} sectorId Sector id. + * @param {String} id Property id. + * @returns {[Property]|null} * @example - * var property = styleManager.getProperty('mySector','min-height'); + * const property = styleManager.getProperty('mySector', 'min-height'); */ - getProperty(sectorId, name) { + getProperty(sectorId, id) { const sector = this.getSector(sectorId, { warn: 1 }); let prop; if (sector) { - prop = sector.get('properties').filter(prop => prop.get('property') === name || prop.get('id') === name)[0]; + prop = sector.get('properties').filter(prop => prop.get('property') === id || prop.get('id') === id)[0]; } return prop || null; }, /** - * Remove a property from the sector - * @param {string} sectorId Sector id - * @param {string} name CSS property name, eg. 'min-height' - * @return {Property} Removed property - * @example - * const property = styleManager.removeProperty('mySector', 'min-height'); - */ - removeProperty(sectorId, name) { - const props = this.getProperties(sectorId); - return props && props.remove(this.getProperty(sectorId, name)); - }, - - /** - * Get properties of the sector - * @param {string} sectorId Sector id - * @return {Properties} Collection of properties + * Get all properties of the sector. + * @param {String} sectorId Sector id. + * @returns {Collection<[Property]>|null} Collection of properties * @example - * var properties = styleManager.getProperties('mySector'); + * const properties = styleManager.getProperties('mySector'); */ getProperties(sectorId) { let props = null; @@ -278,6 +268,19 @@ export default () => { return props; }, + /** + * Remove the property. + * @param {String} sectorId Sector id. + * @param {String} id Property id. + * @returns {[Property]|null} Removed property + * @example + * const property = styleManager.removeProperty('mySector', 'min-height'); + */ + removeProperty(sectorId, id) { + const props = this.getProperties(sectorId); + return props ? props.remove(this.getProperty(sectorId, id)) : null; + }, + /** * Get what to style inside Style Manager. If you select the component * without classes the entity is the Component itself and all changes will From d0f6a7c366f11ad241aca40bf869a5ea3e05d0ad Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 29 Dec 2021 13:41:12 +0100 Subject: [PATCH 188/313] Update style sectors on target change --- docs/modules/Style-manager.md | 21 ++++- src/style_manager/index.js | 123 +++++++++++++++----------- src/style_manager/view/SectorsView.js | 15 ++-- 3 files changed, 98 insertions(+), 61 deletions(-) diff --git a/docs/modules/Style-manager.md b/docs/modules/Style-manager.md index 85251799a..feac9fea9 100644 --- a/docs/modules/Style-manager.md +++ b/docs/modules/Style-manager.md @@ -434,8 +434,25 @@ For a more advanced usage you can rely on the [Style Manager API] to perform dif sm.removeSector('sector-id'); ``` -* Change target -* Get current selected target +* Managing the selected target, + ```js + // Select the first button in the current page + const btnCmp = editor.Pages.getSelected().getMainComponent().findType('button')[0]; + btnCmp && sm.select(btnCmp); + + // Add new property to the sector + sm.addProperty('sector-id', { + type: 'number', + property: 'min-width', + }); + + // Remove sector + sm.removeSector('sector-id'); + ``` + + + + ## Customization diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 445aaab69..8ce886e6c 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -16,6 +16,7 @@ * ``` * ## Available Events * * `style:sector:add` - Sector added. The [Sector] is passed as an argument to the callback. + * * `style:target` - Target selection changed. The target (or `null` in case the target is deselected) is passed as an argument to the callback. * * ## Methods * * [getConfig](#getconfig) @@ -27,7 +28,9 @@ * * [getProperty](#getproperty) * * [getProperties](#getproperties) * * [removeProperty](#removeproperty) - * * [getModelToStyle](#getmodeltostyle) + * * [select](#select) + * * [getSelected](#getselected) + * * [getLastSelected](#getlastselected) * * [addType](#addtype) * * [getType](#gettype) * * [getTypes](#gettypes) @@ -55,6 +58,7 @@ export const evAll = 'style'; export const evPfx = `${evAll}:`; export const evPropUp = `${evPfx}property:update`; export const evLayerSelect = `${evPfx}layer:select`; +export const evTarget = `${evPfx}target`; export const evCustom = `${evPfx}custom`; const propDef = value => value || value === 0; @@ -72,6 +76,7 @@ export default () => { all: evAll, propertyUpdate: evPropUp, layerSelect: evLayerSelect, + target: evTarget, custom: evCustom, }, @@ -98,23 +103,27 @@ export default () => { this.builtIn = new PropertyFactory(); properties = new Properties(); sectors = new Sectors([], c); - this.model = new Model({ targets: [] }); + const model = new Model({ targets: [] }); + this.model = model; // Triggers for the selection refresh and properties const ev = 'component:toggled component:update:classes change:state change:device frame:resized selector:type'; const upAll = debounce(() => this.__upSel()); - this.model.listenTo(em, ev, upAll); + model.listenTo(em, ev, upAll); // Triggers only for properties (avoid selection refresh) const upProps = debounce(() => { this.__upProps(); this.__trgCustom(); }); - this.model.listenTo(em, 'styleable:change', upProps); + model.listenTo(em, 'styleable:change', upProps); // Triggers only custom event const trgCustom = debounce(() => this.__trgCustom()); - this.model.listenTo(em, evLayerSelect, trgCustom); + model.listenTo(em, evLayerSelect, trgCustom); + + // Other listeners + model.on('change:lastTarget', () => em.trigger(evTarget, this.getLastSelected())); return this; }, @@ -281,6 +290,58 @@ export default () => { return props ? props.remove(this.getProperty(sectorId, id)) : null; }, + /** + * Select new target. + * The target could be a Component, CSSRule, or a CSS selector string. + * @param {[Component]|[CSSRule]|String} target + * @returns {Array<[Component]|[CSSRule]>} Array containing selected Components or CSSRules + */ + select(target, opts = {}) { + const { em } = this; + const trgs = isArray(target) ? target : [target]; + const { stylable } = opts; + const cssc = em.get('CssComposer'); + let targets = []; + + trgs.filter(Boolean).forEach(target => { + let model = target; + + if (isString(target)) { + const rule = cssc.getRule(target) || cssc.setRule(target); + !isUndefined(stylable) && rule.set({ stylable }); + model = rule; + } + + targets.push(model); + }); + + targets = targets.map(t => this.getModelToStyle(t)); + const lastTarget = targets.slice().reverse()[0]; + const lastTargetParents = this.getParentRules(lastTarget, em.getState()); + this.model.set({ targets, lastTarget, lastTargetParents }); + // lastTarget && this.setTarget(lastTarget); // TODO to refactor + this.__upProps(opts); + + return targets; + }, + + /** + * Get the array of selected targets. + * @returns {Array<[Component]|[CSSRule]>} + */ + getSelected() { + return this.model.get('targets'); + }, + + /** + * Get the last selected target. + * By default, the Style Manager shows styles of the last selected target. + * @returns {[Component]|[CSSRule]|null} + */ + getLastSelected() { + return this.model.get('lastTarget') || null; + }, + /** * Get what to style inside Style Manager. If you select the component * without classes the entity is the Component itself and all changes will @@ -288,6 +349,7 @@ export default () => { * one or more classes, the function will return the corresponding CSS Rule * @param {Model} model * @return {Model} + * @private */ getModelToStyle(model, options = {}) { const { em } = this; @@ -352,10 +414,10 @@ export default () => { // Componente related rule if (cmp) { cmpRules = cssC.getRules(`#${cmp.getId()}`); - otherRules = cssC.getRules(sel.getSelectors().getFullName(optsSel)); + otherRules = sel ? cssC.getRules(sel.getSelectors().getFullName(optsSel)) : []; rules = otherRules.concat(cmpRules); } else { - cmpRules = cssC.getRules(`#${sel.getId()}`); + cmpRules = sel ? cssC.getRules(`#${sel.getId()}`) : []; otherRules = cssC.getRules(target.getSelectors().getFullName(optsSel)); rules = cmpRules.concat(otherRules); } @@ -454,7 +516,7 @@ export default () => { }, setTarget(target, opts) { - return SectView.setTarget(target, opts); + return SectView?.setTarget(target, opts); }, getTargets() { @@ -462,53 +524,10 @@ export default () => { return (propTarget && propTarget.targets) || []; }, - /** - * Select different target for the Style Manager. - * It could be a Component, CSSRule, or a string of any CSS selector - * @param {[Component]|[CSSRule]|String} target - * @return {Array<[Component]|[CSSRule]>} Array containing selected Components or CSSRules - * @private - */ - select(target, opts = {}) { - const { em } = this; - const trgs = isArray(target) ? target : [target]; - const { stylable } = opts; - const cssc = em.get('CssComposer'); - let targets = []; - - trgs.filter(Boolean).forEach(target => { - let model = target; - - if (isString(target)) { - const rule = cssc.getRule(target) || cssc.setRule(target); - !isUndefined(stylable) && rule.set({ stylable }); - model = rule; - } - - targets.push(model); - }); - - targets = targets.map(t => this.getModelToStyle(t)); - const lastTarget = targets.slice().reverse()[0]; - const lastTargetParents = this.getParentRules(lastTarget, em.getState()); - this.model.set({ targets, lastTarget, lastTargetParents }); - this.__upProps(opts); - - return targets; - }, - addStyleTargets(style, opts) { this.getSelected().map(t => t.addStyle(style, opts)); }, - getSelected() { - return this.model.get('targets'); - }, - - getLastSelected() { - return this.model.get('lastTarget') || null; - }, - getSelectedParents() { return this.model.get('lastTargetParents') || []; }, @@ -529,7 +548,9 @@ export default () => { el, collection: sectors, target: em, + em, config, + module: this, }); return SectView.render().el; }, diff --git a/src/style_manager/view/SectorsView.js b/src/style_manager/view/SectorsView.js index 57928d93f..f75f28a4f 100644 --- a/src/style_manager/view/SectorsView.js +++ b/src/style_manager/view/SectorsView.js @@ -13,6 +13,9 @@ export default Backbone.View.extend({ this.ppfx = config.pStylePrefix || ''; this.target = o.target || {}; this.config = config; + const { module, em } = o; + this.module = module; + this.em = em; // The target that will emit events for properties const target = {}; @@ -24,11 +27,9 @@ export default Backbone.View.extend({ body.removeChild(dummy); this.propTarget = target; const coll = this.collection; - const events = - 'component:toggled component:update:classes change:state change:device frame:resized'; this.listenTo(coll, 'add', this.addTo); this.listenTo(coll, 'reset', this.render); - this.listenTo(this.target, events, this.targetUpdated); + this.listenTo(em, module.events.target, this.targetUpdated); }, remove() { @@ -137,9 +138,7 @@ export default Backbone.View.extend({ const rules = em.get('CssComposer').getAll(); if (targetIsClass) { - rule = rules.filter( - rule => rule.get('selectors').getFullString() === target - )[0]; + rule = rules.filter(rule => rule.get('selectors').getFullString() === target)[0]; } if (!rule) { @@ -180,7 +179,7 @@ export default Backbone.View.extend({ properties: model.get('properties'), target, propTarget, - config + config, }).render().el; appendAtIndex(appendTo, rendered, opts.at); @@ -197,5 +196,5 @@ export default Backbone.View.extend({ $el.append(frag); $el.addClass(`${pfx}sectors ${ppfx}one-bg ${ppfx}two-color`); return this; - } + }, }); From 8463980e18be9165cf4fd1c406785ae297268ace Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 29 Dec 2021 13:46:58 +0100 Subject: [PATCH 189/313] Update open style manager --- src/commands/view/OpenStyleManager.js | 19 +++++++++---------- src/style_manager/index.js | 1 - 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/commands/view/OpenStyleManager.js b/src/commands/view/OpenStyleManager.js index 47685d647..f1c1d527b 100644 --- a/src/commands/view/OpenStyleManager.js +++ b/src/commands/view/OpenStyleManager.js @@ -36,9 +36,7 @@ export default { if (!smConfig.appendTo) { this.$cn2.append(sm.render()); const pfx = smConfig.stylePrefix; - this.$header = $( - `
${em.t('styleManager.empty')}
` - ); + this.$header = $(`
${em.t('styleManager.empty')}
`); this.$cn.append(this.$header); } @@ -50,8 +48,9 @@ export default { // Add all containers to the panel this.panel.set('appendContent', this.$cn).trigger(trgEvCnt); - this.target = em.editor; - this.listenTo(this.target, 'component:toggled', this.toggleSm); + // Toggle Style Manager on target selection + this.em = em.getModel(); + this.listenTo(this.em, sm.events.target, this.toggleSm); } this.toggleSm(); @@ -62,10 +61,10 @@ export default { * @private */ toggleSm() { - const { target, sender } = this; - if (sender && sender.get && !sender.get('active')) return; - const { componentFirst } = target.get('SelectorManager').getConfig(); - const selectedAll = target.getSelectedAll().length; + const { em, sender } = this; + if ((sender && sender.get && !sender.get('active')) || !em) return; + const { componentFirst } = em.get('SelectorManager').getConfig(); + const selectedAll = em.getSelectedAll().length; if (selectedAll === 1 || (selectedAll > 1 && componentFirst)) { this.$cn2 && this.$cn2.show(); @@ -79,5 +78,5 @@ export default { stop() { this.$cn2 && this.$cn2.hide(); this.$header && this.$header.hide(); - } + }, }; diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 8ce886e6c..c3c2a80b8 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -319,7 +319,6 @@ export default () => { const lastTarget = targets.slice().reverse()[0]; const lastTargetParents = this.getParentRules(lastTarget, em.getState()); this.model.set({ targets, lastTarget, lastTargetParents }); - // lastTarget && this.setTarget(lastTarget); // TODO to refactor this.__upProps(opts); return targets; From 29e98dfac199ba4352db8d058a409fe27af117a6 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 29 Dec 2021 14:00:39 +0100 Subject: [PATCH 190/313] Update OpenStyleManager --- src/commands/view/OpenStyleManager.js | 38 +++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/commands/view/OpenStyleManager.js b/src/commands/view/OpenStyleManager.js index f1c1d527b..03e1db5cb 100644 --- a/src/commands/view/OpenStyleManager.js +++ b/src/commands/view/OpenStyleManager.js @@ -2,19 +2,19 @@ import Backbone from 'backbone'; const $ = Backbone.$; export default { - run(em, sender) { + run(editor, sender) { this.sender = sender; if (!this.$cn) { - const config = em.getConfig(); - const panels = em.Panels; + const config = editor.getConfig(); + const panels = editor.Panels; const trgEvCnt = 'change:appendContent'; this.$cn = $('
'); this.$cn2 = $('
'); this.$cn.append(this.$cn2); // Device Manager - const dvm = em.DeviceManager; + const dvm = editor.DeviceManager; if (dvm && config.showDevices) { const devicePanel = panels.addPanel({ id: 'devices-c' }); const dvEl = dvm.render(); @@ -22,7 +22,8 @@ export default { } // Selector Manager container - const slm = em.SelectorManager; + const slm = editor.SelectorManager; + this.slm = slm; const slmConfig = slm.getConfig(); if (slmConfig.custom) { slm.__trgCustom({ container: this.$cn2.get(0) }); @@ -31,12 +32,13 @@ export default { } // Style Manager - const sm = em.StyleManager; + const sm = editor.StyleManager; + this.sm = sm; const smConfig = sm.getConfig(); if (!smConfig.appendTo) { this.$cn2.append(sm.render()); const pfx = smConfig.stylePrefix; - this.$header = $(`
${em.t('styleManager.empty')}
`); + this.$header = $(`
${editor.t('styleManager.empty')}
`); this.$cn.append(this.$header); } @@ -49,7 +51,7 @@ export default { this.panel.set('appendContent', this.$cn).trigger(trgEvCnt); // Toggle Style Manager on target selection - this.em = em.getModel(); + this.em = editor.getModel(); this.listenTo(this.em, sm.events.target, this.toggleSm); } @@ -61,22 +63,20 @@ export default { * @private */ toggleSm() { - const { em, sender } = this; - if ((sender && sender.get && !sender.get('active')) || !em) return; - const { componentFirst } = em.get('SelectorManager').getConfig(); - const selectedAll = em.getSelectedAll().length; + const { sender, sm } = this; + if ((sender && sender.get && !sender.get('active')) || !sm) return; - if (selectedAll === 1 || (selectedAll > 1 && componentFirst)) { - this.$cn2 && this.$cn2.show(); - this.$header && this.$header.hide(); + if (sm.getLastSelected()) { + this.$cn2?.show(); + this.$header?.hide(); } else { - this.$cn2 && this.$cn2.hide(); - this.$header && this.$header.show(); + this.$cn2?.hide(); + this.$header?.show(); } }, stop() { - this.$cn2 && this.$cn2.hide(); - this.$header && this.$header.hide(); + this.$cn2?.hide(); + this.$header?.hide(); }, }; From 3dd5ff70f60f27b1c4f50fd6a010395d7c2499bc Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 29 Dec 2021 14:20:34 +0100 Subject: [PATCH 191/313] Update SectorsView --- src/style_manager/view/SectorsView.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/style_manager/view/SectorsView.js b/src/style_manager/view/SectorsView.js index f75f28a4f..973f05e51 100644 --- a/src/style_manager/view/SectorsView.js +++ b/src/style_manager/view/SectorsView.js @@ -49,7 +49,7 @@ export default Backbone.View.extend({ toggleStateCls(targets = [], enable) { targets.forEach(trg => { - const el = trg.getEl(); + const el = trg?.getEl?.(); el && el.classList && el.classList[enable ? 'add' : 'remove'](helperCls); }); }, @@ -61,22 +61,24 @@ export default Backbone.View.extend({ targetUpdated(trg) { const em = this.target; const pt = this.propTarget; - const targets = em.getSelectedAll(); - let model = em.getSelected(); - const mdToClear = trg && !!trg.toHTML ? trg : model; + const sm = this.module; + const cmp = em.getSelected(); + const cmps = em.getSelectedAll(); + const mdToClear = trg && !!trg.toHTML ? trg : cmp; + const target = sm.getLastSelected(); // Clean components mdToClear && this.toggleStateCls([mdToClear]); - if (!model) return; + if (!target) return; const config = em.get('Config'); const state = !config.devicePreviewMode ? em.get('state') : ''; const { componentFirst } = em.get('SelectorManager').getConfig(); - const el = model.getEl(); pt.helper = null; pt.targets = null; // Create computed style container + const el = cmp?.getEl(); if (el && isTaggableNode(el)) { const stateStr = state ? `:${state}` : null; pt.computed = window.getComputedStyle(el, stateStr); @@ -101,18 +103,15 @@ export default Backbone.View.extend({ pt.helper = helperRule; }; - const sm = em.get('StyleManager'); - const target = sm.getModelToStyle(model); - if (state) { appendStateRule(target.getStyle()); - this.toggleStateCls(targets, 1); + this.toggleStateCls(cmps, 1); } pt.model = target; pt.parentRules = sm.getParentRules(target, state); if (componentFirst) { - pt.targets = targets.map(t => sm.getModelToStyle(t)).filter(Boolean); + pt.targets = sm.getSelected(); } pt.trigger('update'); em.trigger('styleManager:update'); From b826f27fdd85d972ff7b7142ec3138c43144af27 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 29 Dec 2021 20:21:24 +0100 Subject: [PATCH 192/313] Update getModelToStyle --- docs/modules/Style-manager.md | 15 +++++---------- src/style_manager/index.js | 14 +++++++++++--- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/docs/modules/Style-manager.md b/docs/modules/Style-manager.md index feac9fea9..1fa0a7c5c 100644 --- a/docs/modules/Style-manager.md +++ b/docs/modules/Style-manager.md @@ -434,20 +434,15 @@ For a more advanced usage you can rely on the [Style Manager API] to perform dif sm.removeSector('sector-id'); ``` -* Managing the selected target, +* Managing the selected target. ```js // Select the first button in the current page - const btnCmp = editor.Pages.getSelected().getMainComponent().findType('button')[0]; + const wrapperCmp = editor.Pages.getSelected().getMainComponent(); + const btnCmp = wrapperCmp.find('button')[0]; btnCmp && sm.select(btnCmp); - // Add new property to the sector - sm.addProperty('sector-id', { - type: 'number', - property: 'min-width', - }); - - // Remove sector - sm.removeSector('sector-id'); + // Set as a target the CSS selector (the relative CSSRule will be created if doesn't exist yet) + sm.select('.btn > span'); ``` diff --git a/src/style_manager/index.js b/src/style_manager/index.js index c3c2a80b8..059d2ae85 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -295,6 +295,14 @@ export default () => { * The target could be a Component, CSSRule, or a CSS selector string. * @param {[Component]|[CSSRule]|String} target * @returns {Array<[Component]|[CSSRule]>} Array containing selected Components or CSSRules + * @example + * // Select the first button in the current page + * const wrapperCmp = editor.Pages.getSelected().getMainComponent(); + * const btnCmp = wrapperCmp.find('button')[0]; + * btnCmp && styleManager.select(btnCmp); + * + * // Set as a target the CSS selector + * styleManager.select('.btn > span'); */ select(target, opts = {}) { const { em } = this; @@ -353,16 +361,15 @@ export default () => { getModelToStyle(model, options = {}) { const { em } = this; const { skipAdd } = options; - const classes = model.get('classes'); - const id = model.getId(); - if (em && classes) { + if (em && model?.toHTML) { const config = em.getConfig(); const um = em.get('UndoManager'); const cssC = em.get('CssComposer'); const sm = em.get('SelectorManager'); const smConf = sm ? sm.getConfig() : {}; const state = !config.devicePreviewMode ? em.get('state') : ''; + const classes = model.get('classes'); const valid = classes.getStyleable(); const hasClasses = valid.length; const useClasses = !smConf.componentFirst || options.useClasses; @@ -384,6 +391,7 @@ export default () => { rule = cssC.add(valid, state, deviceW, {}, addOpts); } } else if (config.avoidInlineStyle) { + const id = model.getId(); rule = cssC.getIdRule(id, opts); !rule && !skipAdd && (rule = cssC.setIdRule(id, {}, opts)); if (model.is('wrapper')) rule.set('wrapper', 1, addOpts); From 72c8bab8822522a512eac36baf6c3ff800e16a1f Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 29 Dec 2021 21:03:45 +0100 Subject: [PATCH 193/313] Update styleManager docs --- docs/modules/Style-manager.md | 7 +++++++ src/style_manager/index.js | 29 +++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/docs/modules/Style-manager.md b/docs/modules/Style-manager.md index 1fa0a7c5c..4aeee09f5 100644 --- a/docs/modules/Style-manager.md +++ b/docs/modules/Style-manager.md @@ -443,7 +443,14 @@ For a more advanced usage you can rely on the [Style Manager API] to perform dif // Set as a target the CSS selector (the relative CSSRule will be created if doesn't exist yet) sm.select('.btn > span'); + // Get the last selected target + const lastTarget = sm.getLastSelected(); + lastTarget?.toCSS && console.log(lastTarget.toCSS()); + + // Update selected targets with a custom style + sm.addStyleTargets({ color: 'red' }); ``` +* Adding new types. diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 059d2ae85..b1b00921c 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -31,6 +31,8 @@ * * [select](#select) * * [getSelected](#getselected) * * [getLastSelected](#getlastselected) + * * [getSelectedParents](#getselectedparents) + * * [addStyleTargets](#addstyletargets) * * [addType](#addtype) * * [getType](#gettype) * * [getTypes](#gettypes) @@ -349,6 +351,25 @@ export default () => { return this.model.get('lastTarget') || null; }, + /** + * Get parent rules of the last selected target. + * @returns {Array<[CSSRule]>} + */ + getSelectedParents() { + return this.model.get('lastTargetParents') || []; + }, + + /** + * Update selected targets with a custom style. + * @param {Object} style Style object + * @param {Object} [opts={}] Options + * @example + * styleManager.addStyleTargets({ color: 'red' }); + */ + addStyleTargets(style, opts) { + this.getSelected().map(t => t.addStyle(style, opts)); + }, + /** * Get what to style inside Style Manager. If you select the component * without classes the entity is the Component itself and all changes will @@ -531,14 +552,6 @@ export default () => { return (propTarget && propTarget.targets) || []; }, - addStyleTargets(style, opts) { - this.getSelected().map(t => t.addStyle(style, opts)); - }, - - getSelectedParents() { - return this.model.get('lastTargetParents') || []; - }, - getEmitter() { return SectView.propTarget; }, From f53f7cadf80c885bc0fd816cd5fb77ddb94507eb Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 29 Dec 2021 21:14:40 +0100 Subject: [PATCH 194/313] Update StyleManager API docs --- docs/api/style_manager.md | 246 ++++++++++++++++++++++------------ docs/modules/Style-manager.md | 1 + src/style_manager/index.js | 73 +++++----- 3 files changed, 199 insertions(+), 121 deletions(-) diff --git a/docs/api/style_manager.md b/docs/api/style_manager.md index d5fc91033..0b20d3cc5 100644 --- a/docs/api/style_manager.md +++ b/docs/api/style_manager.md @@ -22,6 +22,7 @@ const styleManager = editor.StyleManager; ## Available Events * `style:sector:add` - Sector added. The [Sector] is passed as an argument to the callback. +* `style:target` - Target selection changed. The target (or `null` in case the target is deselected) is passed as an argument to the callback. ## Methods @@ -34,11 +35,18 @@ const styleManager = editor.StyleManager; * [getProperty][8] * [getProperties][9] * [removeProperty][10] -* [getModelToStyle][11] -* [addType][12] -* [getType][13] -* [getTypes][14] -* [createType][15] +* [select][11] +* [getSelected][12] +* [getLastSelected][13] +* [getSelectedParents][14] +* [addStyleTargets][15] +* [getBuiltIn][16] +* [getBuiltInAll][17] +* [addBuiltIn][18] +* [addType][19] +* [getType][20] +* [getTypes][21] +* [createType][22] [Sector]: sector.html @@ -52,7 +60,7 @@ const styleManager = editor.StyleManager; Get configuration object -Returns **[Object][16]** +Returns **[Object][23]** ## addSector @@ -60,11 +68,11 @@ Add new sector. If the sector with the same id already exists, that one will be ### Parameters -* `id` **[String][17]** Sector id -* `sector` **[Object][16]** Sector definition. Check the [available properties][18] -* `options` **[Object][16]** Options (optional, default `{}`) +* `id` **[String][24]** Sector id +* `sector` **[Object][23]** Sector definition. Check the [available properties][25] +* `options` **[Object][23]** Options (optional, default `{}`) - * `options.at` **[Number][19]?** Position index (by default, will be appended at the end). + * `options.at` **[Number][26]?** Position index (by default, will be appended at the end). ### Examples @@ -85,7 +93,7 @@ Get sector by id. ### Parameters -* `id` **[String][17]** Sector id +* `id` **[String][24]** Sector id * `opts` (optional, default `{}`) ### Examples @@ -118,7 +126,7 @@ Remove sector by id. ### Parameters -* `id` **[String][17]** Sector id +* `id` **[String][24]** Sector id ### Examples @@ -134,11 +142,11 @@ Add new property to the sector. ### Parameters -* `sectorId` **[String][17]** Sector id. -* `property` **[Object][16]** Property definition. Check the [base available properties][20] + others based on the `type` of your property. -* `opts` **[Object][16]** Options (optional, default `{}`) +* `sectorId` **[String][24]** Sector id. +* `property` **[Object][23]** Property definition. Check the [base available properties][27] + others based on the `type` of your property. +* `opts` **[Object][23]** Options (optional, default `{}`) - * `opts.at` **[Number][19]?** Position index (by default, will be appended at the end). + * `opts.at` **[Number][26]?** Position index (by default, will be appended at the end). ### Examples @@ -163,8 +171,8 @@ Get the property. ### Parameters -* `sectorId` **[String][17]** Sector id. -* `id` **[String][17]** Property id. +* `sectorId` **[String][24]** Sector id. +* `id` **[String][24]** Property id. ### Examples @@ -180,7 +188,7 @@ Get all properties of the sector. ### Parameters -* `sectorId` **[String][17]** Sector id. +* `sectorId` **[String][24]** Sector id. ### Examples @@ -196,8 +204,8 @@ Remove the property. ### Parameters -* `sectorId` **[String][17]** Sector id. -* `id` **[String][17]** Property id. +* `sectorId` **[String][24]** Sector id. +* `id` **[String][24]** Property id. ### Examples @@ -207,19 +215,107 @@ const property = styleManager.removeProperty('mySector', 'min-height'); Returns **([Property] | null)** Removed property -## getModelToStyle +## select -Get what to style inside Style Manager. If you select the component -without classes the entity is the Component itself and all changes will -go inside its 'style' property. Otherwise, if the selected component has -one or more classes, the function will return the corresponding CSS Rule +Select new target. +The target could be a Component, CSSRule, or a CSS selector string. ### Parameters -* `model` **Model** -* `options` (optional, default `{}`) +* `target` **([Component] | [CSSRule] | [String][24])** +* `opts` (optional, default `{}`) + +### Examples + +```javascript +// Select the first button in the current page +const wrapperCmp = editor.Pages.getSelected().getMainComponent(); +const btnCmp = wrapperCmp.find('button')[0]; +btnCmp && styleManager.select(btnCmp); + +// Set as a target the CSS selector +styleManager.select('.btn > span'); +``` + +Returns **[Array][28]<([Component] | [CSSRule])>** Array containing selected Components or CSSRules + +## getSelected + +Get the array of selected targets. + +Returns **[Array][28]<([Component] | [CSSRule])>** + +## getLastSelected + +Get the last selected target. +By default, the Style Manager shows styles of the last selected target. + +Returns **([Component] | [CSSRule] | null)** + +## getSelectedParents + +Get parent rules of the last selected target. + +Returns **[Array][28]<[CSSRule]>** + +## addStyleTargets + +Update selected targets with a custom style. + +### Parameters + +* `style` **[Object][23]** Style object +* `opts` **[Object][23]** Options (optional, default `{}`) + +### Examples + +```javascript +styleManager.addStyleTargets({ color: 'red' }); +``` + +## getBuiltIn + +Return built-in property definition + +### Parameters + +* `prop` **[String][24]** Property name. + +### Examples + +```javascript +const widthPropDefinition = styleManager.getBuiltIn('width'); +``` + +Returns **([Object][23] | null)** Property definition. + +## getBuiltInAll + +Get all the available built-in property definitions. + +Returns **[Object][23]** + +## addBuiltIn + +Add built-in property definition. +If the property exists already, it will extend it. + +### Parameters + +* `prop` **[String][24]** Property name. +* `definition` **[Object][23]** Property definition. -Returns **Model** +### Examples + +```javascript +const sector = styleManager.addBuiltIn('new-property', { + type: 'select', + default: 'value1', + options: [{ id: 'value1', label: 'Some label' }, ...], +}) +``` + +Returns **[Object][23]** Added property definition. ## addType @@ -227,8 +323,8 @@ Add new property type ### Parameters -* `id` **[string][17]** Type ID -* `definition` **[Object][16]** Definition of the type. Each definition contains +* `id` **[string][24]** Type ID +* `definition` **[Object][23]** Definition of the type. Each definition contains `model` (business logic), `view` (presentation logic) and `isType` function which recognize the type of the passed entity @@ -267,15 +363,15 @@ Get type ### Parameters -* `id` **[string][17]** Type ID +* `id` **[string][24]** Type ID -Returns **[Object][16]** Type definition +Returns **[Object][23]** Type definition ## getTypes Get all types -Returns **[Array][21]** +Returns **[Array][28]** ## createType @@ -283,11 +379,11 @@ Create new property from type ### Parameters -* `id` **[string][17]** Type ID -* `options` **[Object][16]** Options (optional, default `{}`) +* `id` **[string][24]** Type ID +* `options` **[Object][23]** Options (optional, default `{}`) - * `options.model` **[Object][16]** Custom model object (optional, default `{}`) - * `options.view` **[Object][16]** Custom view object (optional, default `{}`) + * `options.model` **[Object][23]** Custom model object (optional, default `{}`) + * `options.view` **[Object][23]** Custom view object (optional, default `{}`) ### Examples @@ -302,44 +398,6 @@ someContainer.appendChild(propView.el); Returns **PropertyView** -## getBuiltIn - -Return built-in property definition - -### Parameters - -* `prop` **[String][17]** Property name. - -Returns **([Object][16] | null)** Property definition. - -## getBuiltInAll - -Get all the available built-in property definitions. - -Returns **[Object][16]** - -## addBuiltIn - -Add built-in property definition. -If the property exists already, it will extend it. - -### Parameters - -* `prop` **[String][17]** Property name. -* `definition` **[Object][16]** Property definition. - -### Examples - -```javascript -const sector = styleManager.addBuiltIn('new-property', { - type: 'select', - default: 'value1', - options: [{ id: 'value1', label: 'Some label' }, ...], -}) -``` - -Returns **[Object][16]** Added property definition. - [1]: https://github.com/artf/grapesjs/blob/master/src/style_manager/config/config.js [2]: #getconfig @@ -360,24 +418,38 @@ Returns **[Object][16]** Added property definition. [10]: #removeproperty -[11]: #getmodeltostyle +[11]: #select + +[12]: #getselected + +[13]: #getlastselected + +[14]: #getselectedparents + +[15]: #addstyletargets + +[16]: #getbuiltin + +[17]: #getbuiltinall + +[18]: #addbuiltin -[12]: #addtype +[19]: #addtype -[13]: #gettype +[20]: #gettype -[14]: #gettypes +[21]: #gettypes -[15]: #createtype +[22]: #createtype -[16]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[23]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[24]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[18]: sector.html#properties +[25]: sector.html#properties -[19]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[26]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[20]: property.html#properties +[27]: property.html#properties -[21]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array +[28]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array diff --git a/docs/modules/Style-manager.md b/docs/modules/Style-manager.md index 4aeee09f5..664149394 100644 --- a/docs/modules/Style-manager.md +++ b/docs/modules/Style-manager.md @@ -450,6 +450,7 @@ For a more advanced usage you can rely on the [Style Manager API] to perform dif // Update selected targets with a custom style sm.addStyleTargets({ color: 'red' }); ``` +* Adding new built-in property definitions. * Adding new types. diff --git a/src/style_manager/index.js b/src/style_manager/index.js index b1b00921c..1dfec465c 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -33,6 +33,9 @@ * * [getLastSelected](#getlastselected) * * [getSelectedParents](#getselectedparents) * * [addStyleTargets](#addstyletargets) + * * [getBuiltIn](#getbuiltin) + * * [getBuiltInAll](#getbuiltinall) + * * [addBuiltIn](#addbuiltin) * * [addType](#addtype) * * [getType](#gettype) * * [getTypes](#gettypes) @@ -370,6 +373,42 @@ export default () => { this.getSelected().map(t => t.addStyle(style, opts)); }, + /** + * Return built-in property definition + * @param {String} prop Property name. + * @returns {Object|null} Property definition. + * @example + * const widthPropDefinition = styleManager.getBuiltIn('width'); + */ + getBuiltIn(prop) { + return this.builtIn.get(prop); + }, + + /** + * Get all the available built-in property definitions. + * @returns {Object} + */ + getBuiltInAll() { + return this.builtIn.props; + }, + + /** + * Add built-in property definition. + * If the property exists already, it will extend it. + * @param {String} prop Property name. + * @param {Object} definition Property definition. + * @returns {Object} Added property definition. + * @example + * const sector = styleManager.addBuiltIn('new-property', { + * type: 'select', + * default: 'value1', + * options: [{ id: 'value1', label: 'Some label' }, ...], + * }) + */ + addBuiltIn(prop, definition) { + return this.builtIn.add(prop, definition); + }, + /** * Get what to style inside Style Manager. If you select the component * without classes the entity is the Component itself and all changes will @@ -598,40 +637,6 @@ export default () => { }); }, - /** - * Return built-in property definition - * @param {String} prop Property name. - * @returns {Object|null} Property definition. - */ - getBuiltIn(prop) { - return this.builtIn.get(prop); - }, - - /** - * Get all the available built-in property definitions. - * @returns {Object} - */ - getBuiltInAll() { - return this.builtIn.props; - }, - - /** - * Add built-in property definition. - * If the property exists already, it will extend it. - * @param {String} prop Property name. - * @param {Object} definition Property definition. - * @returns {Object} Added property definition. - * @example - * const sector = styleManager.addBuiltIn('new-property', { - * type: 'select', - * default: 'value1', - * options: [{ id: 'value1', label: 'Some label' }, ...], - * }) - */ - addBuiltIn(prop, definition) { - return this.builtIn.add(prop, definition); - }, - __upProp(prop, style, parentStyles, opts) { const name = prop.getName(); const value = style[name]; From ef19b2e829cb33e29aa52a12ab3db7ba8a01d7a0 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 30 Dec 2021 00:55:20 +0100 Subject: [PATCH 195/313] Update Style Manager doc --- docs/modules/Style-manager.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/modules/Style-manager.md b/docs/modules/Style-manager.md index 664149394..29045a1c7 100644 --- a/docs/modules/Style-manager.md +++ b/docs/modules/Style-manager.md @@ -450,7 +450,28 @@ For a more advanced usage you can rely on the [Style Manager API] to perform dif // Update selected targets with a custom style sm.addStyleTargets({ color: 'red' }); ``` -* Adding new built-in property definitions. +* Adding/extending built-in property definitions. + ```js + const myPlugin = (editor) => { + editor.StyleManager.addBuiltIn('new-prop', { + type: 'number', + label: 'New prop', + }) + }; + + grapesjs.init({ + // ... + plugins: [myPlugin], + styleManager: { + sectors: [ + { + name: 'My sector', + properties: [ 'new-prop', ... ], + }, + ], + }, + }) + ``` * Adding new types. From 3f0a49df788bfef21299bc61638fbd36ffe10bf6 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 30 Dec 2021 03:04:42 +0100 Subject: [PATCH 196/313] Start Style Manager customization --- docs/modules/Style-manager.md | 40 +++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/docs/modules/Style-manager.md b/docs/modules/Style-manager.md index 29045a1c7..9300525f9 100644 --- a/docs/modules/Style-manager.md +++ b/docs/modules/Style-manager.md @@ -434,7 +434,7 @@ For a more advanced usage you can rely on the [Style Manager API] to perform dif sm.removeSector('sector-id'); ``` -* Managing the selected target. +* Managing selected targets. ```js // Select the first button in the current page const wrapperCmp = editor.Pages.getSelected().getMainComponent(); @@ -472,7 +472,7 @@ For a more advanced usage you can rely on the [Style Manager API] to perform dif }, }) ``` -* Adding new types. +* [Adding new types](#adding-new-types). @@ -480,7 +480,43 @@ For a more advanced usage you can rely on the [Style Manager API] to perform dif ## Customization +The default types should cover most of the common styling properties but in case you need a more advanced control over styling you can define your own types or even create a completely custom Style Manager UI from scratch. +### Adding new types + +In order to add a new type you have to use the `styleManager.addType` API call and indicate all the necessary methods to make it work properly with the editor. Here an example of implementation by using the native `range` input. + +```js +styleManager.addType('my-custom-prop', { + // Create UI + create({ props, change }) { + const el = document.createElement('div'); + el.innerHTML = ''; + const inputEl = el.querySelector('.my-input'); + inputEl.addEventListener('change', event => change({ event })); // `change` will trigger the emit + inputEl.addEventListener('input', event => change({ event, complete: false })); + return el; + }, + // Propagate UI changes up to the targets + emit({ props, updateStyle }, { event, complete }) { + const { value } = event.target; + const valueRes = value + 'px'; + // Pass a string value for the current CSS property or an object containing multiple properties + updateStyle(valueRes, { complete }); + // Update target style with multiple properties + // eg. updateStyle({ [props.property]: valueRes, color: 'red' }); + }, + // Update UI (eg. when the target is changed) + update({ value, el }) { + el.querySelector('.my-input').value = parseInt(value, 10); + }, + // Clean the memory from side effects if necessary (eg. event listeners) + destroy() { + } +}) +``` + +### Custom Style Manager From 662ffa2e3e7d691f4181f3118aa859cc7cd65ea1 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 30 Dec 2021 03:07:20 +0100 Subject: [PATCH 197/313] Update api style manager docs --- src/style_manager/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 1dfec465c..324d45083 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -9,10 +9,15 @@ * }) * ``` * - * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance + * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. * * ```js + * // Listen to events + * editor.on('style:sector:add', (sector) => { ... }); + * + * // Use the API * const styleManager = editor.StyleManager; + * styleManager.addSector(...); * ``` * ## Available Events * * `style:sector:add` - Sector added. The [Sector] is passed as an argument to the callback. From ee1f4a14bfc1df1572a2c6dd4292fea19cf15264 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 30 Dec 2021 13:08:46 +0100 Subject: [PATCH 198/313] Move commands events --- src/commands/index.js | 43 +++++++++++++++++++++++++++---------------- src/editor/index.js | 16 +++++----------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/src/commands/index.js b/src/commands/index.js index 6c4d0f1f3..6bae94f33 100644 --- a/src/commands/index.js +++ b/src/commands/index.js @@ -8,12 +8,27 @@ * }) * ``` * - * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance + * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. * * ```js + * // Listen to events + * editor.on('run', () => { ... }); + * + * // Use the API * const commands = editor.Commands; + * commands.add(...); * ``` * + ** ## Available Events + * * `run:{commandName}` - Triggered when some command is called to run (eg. editor.runCommand('preview')) + * * `stop:{commandName}` - Triggered when some command is called to stop (eg. editor.stopCommand('preview')) + * * `run:{commandName}:before` - Triggered before the command is called + * * `stop:{commandName}:before` - Triggered before the command is called to stop + * * `abort:{commandName}` - Triggered when the command execution is aborted (`editor.on(`run:preview:before`, opts => opts.abort = 1);`) + * * `run` - Triggered on run of any command. The id and the result are passed as arguments to the callback + * * `stop` - Triggered on stop of any command. The id and the result are passed as arguments to the callback + * + * ## Methods * * [add](#add) * * [get](#get) * * [getAll](#getall) @@ -56,7 +71,7 @@ const commandsDef = [ ['component-exit', 'ComponentExit', 'select-parent'], ['component-delete', 'ComponentDelete'], ['component-style-clear', 'ComponentStyleClear'], - ['component-drag', 'ComponentDrag'] + ['component-drag', 'ComponentDrag'], ]; export default () => { @@ -67,7 +82,7 @@ export default () => { const active = {}; // Need it here as it would be used below - const add = function(id, obj) { + const add = function (id, obj) { if (isFunction(obj)) obj = { run: obj }; if (!obj.stop) obj.noStop = 1; delete obj.initialize; @@ -94,7 +109,7 @@ export default () => { init(config = {}) { c = { ...defaults, - ...config + ...config, }; em = c.em; const ppfx = c.pStylePrefix; @@ -109,14 +124,14 @@ export default () => { defaultCommands['tlb-delete'] = { run(ed) { return ed.runCommand('core:component-delete'); - } + }, }; defaultCommands['tlb-clone'] = { run(ed) { ed.runCommand('core:copy'); ed.runCommand('core:paste'); - } + }, }; defaultCommands['tlb-move'] = { @@ -171,7 +186,7 @@ export default () => { onStart, onDrag, onEnd, - event + event, }); } else { if (nativeDrag) { @@ -187,7 +202,7 @@ export default () => { } selAll.forEach(sel => sel.set('status', 'freezed-selected')); - } + }, }; // Core commands @@ -202,9 +217,7 @@ export default () => { defaultCommands[oldCmd] = cmd; // Propogate old commands (can be removed once we stop to call old commands) ['run', 'stop'].forEach(name => { - em.on(`${name}:${oldCmd}`, (...args) => - em.trigger(`${name}:${cmdName}`, ...args) - ); + em.on(`${name}:${oldCmd}`, (...args) => em.trigger(`${name}:${cmdName}`, ...args)); }); } }); @@ -274,13 +287,11 @@ export default () => { if (command) { const cmdObj = { ...command.constructor.prototype, - ...cmd + ...cmd, }; this.add(id, cmdObj); // Extend also old name commands if exist - const oldCmd = commandsDef.filter( - cmd => `core:${cmd[0]}` === id && cmd[2] - )[0]; + const oldCmd = commandsDef.filter(cmd => `core:${cmd[0]}` === id && cmd[2])[0]; oldCmd && this.add(oldCmd[2], cmdObj); } return this; @@ -432,6 +443,6 @@ export default () => { destroy() { [em, c, commands, defaultCommands, active].forEach(i => (i = {})); - } + }, }; }; diff --git a/src/editor/index.js b/src/editor/index.js index a65ca87df..ec28d796b 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -68,13 +68,7 @@ * * `rte:enable` - RTE enabled. The view, on which RTE is enabled, is passed as an argument * * `rte:disable` - RTE disabled. The view, on which RTE is disabled, is passed as an argument * ### Commands - * * `run:{commandName}` - Triggered when some command is called to run (eg. editor.runCommand('preview')) - * * `stop:{commandName}` - Triggered when some command is called to stop (eg. editor.stopCommand('preview')) - * * `run:{commandName}:before` - Triggered before the command is called - * * `stop:{commandName}:before` - Triggered before the command is called to stop - * * `abort:{commandName}` - Triggered when the command execution is aborted (`editor.on(`run:preview:before`, opts => opts.abort = 1);`) - * * `run` - Triggered on run of any command. The id and the result are passed as arguments to the callback - * * `stop` - Triggered on stop of any command. The id and the result are passed as arguments to the callback + * Check the [Commands](/api/commands.html) module. * ### Selectors * Check the [Selectors](/api/selector_manager.html) module. * ### Blocks @@ -106,7 +100,7 @@ export default (config = {}, opts = {}) => { const { $ } = opts; const c = { ...defaults, - ...config + ...config, }; c.pStylePrefix = c.stylePrefix; @@ -163,7 +157,7 @@ export default (config = {}, opts = {}) => { 'StyleManager', ['Styles', 'StyleManager'], 'DeviceManager', - ['Devices', 'DeviceManager'] + ['Devices', 'DeviceManager'], ].forEach(prop => { if (Array.isArray(prop)) { this[prop[0]] = em.get(prop[1]); @@ -719,7 +713,7 @@ export default (config = {}, opts = {}) => { editorView && editorView.remove(); editorView = new EditorView({ model: em, - config: c + config: c, }); return editorView.render().el; }, @@ -748,6 +742,6 @@ export default (config = {}, opts = {}) => { * // Use `$${var}` to avoid escaping * const strHtml = editor.html`Escaped ${unsafeStr}, unescaped $${safeStr}`; */ - html + html, }; }; From 329763b62d908dd630bcb92b0fd771f09af4baf0 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 30 Dec 2021 13:11:36 +0100 Subject: [PATCH 199/313] Move the Rich Text Editor events --- src/editor/index.js | 3 +-- src/rich_text_editor/index.js | 33 +++++++++++++++++++-------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/editor/index.js b/src/editor/index.js index ec28d796b..e76b52c0a 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -65,8 +65,7 @@ * * `canvas:dragdata` - On any dataTransfer parse, `DataTransfer` instance and the `result` are passed as arguments. * By changing `result.content` you're able to customize what is dropped * ### RTE - * * `rte:enable` - RTE enabled. The view, on which RTE is enabled, is passed as an argument - * * `rte:disable` - RTE disabled. The view, on which RTE is disabled, is passed as an argument + * Check the [Rich Text Editor](/api/rich_text_editor.html) module. * ### Commands * Check the [Commands](/api/commands.html) module. * ### Selectors diff --git a/src/rich_text_editor/index.js b/src/rich_text_editor/index.js index 7e6375724..7ac6c311e 100644 --- a/src/rich_text_editor/index.js +++ b/src/rich_text_editor/index.js @@ -11,12 +11,22 @@ * }) * ``` * - * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance + * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. * * ```js + * // Listen to events + * editor.on('rte:enable', () => { ... }); + * + * // Use the API * const rte = editor.RichTextEditor; + * rte.add(...); * ``` * + * ## Available Events + * * `rte:enable` - RTE enabled. The view, on which RTE is enabled, is passed as an argument + * * `rte:disable` - RTE disabled. The view, on which RTE is disabled, is passed as an argument + * + * ## Methods * * [add](#add) * * [get](#get) * * [getAll](#getall) @@ -33,8 +43,7 @@ import defaults from './config/config'; export default () => { let config = {}; let toolbar, actions, lastEl, lastElPos, globalRte; - const eventsUp = - 'change:canvasOffset frame:scroll component:update'; + const eventsUp = 'change:canvasOffset frame:scroll component:update'; const hideToolbar = () => { const style = toolbar.style; const size = '-1000px'; @@ -65,7 +74,7 @@ export default () => { init(opts = {}) { config = { ...defaults, - ...opts + ...opts, }; const ppfx = config.pStylePrefix; @@ -91,9 +100,7 @@ export default () => { customRte && customRte.destroy && customRte.destroy(); this.actionbar = 0; this.actions = 0; - [config, toolbar, actions, lastEl, lastElPos, globalRte].forEach( - i => (i = {}) - ); + [config, toolbar, actions, lastEl, lastElPos, globalRte].forEach(i => (i = {})); }, /** @@ -124,14 +131,14 @@ export default () => { button: `${pfx}action`, active: `${pfx}active`, inactive: `${pfx}inactive`, - disabled: `${pfx}disabled` + disabled: `${pfx}disabled`, }; const rte = new RichTextEditor({ el, classes, actions, actionbar, - actionbarContainer + actionbarContainer, }); globalRte && globalRte.setEl(el); @@ -278,7 +285,7 @@ export default () => { const { style } = toolbar; const pos = canvas.getTargetToElementFixed(lastEl, toolbar, { event: 'rteToolbarPosUpdate', - left: 0 + left: 0, }); style.top = (pos.top || 0) + un; style.left = (pos.left || 0) + un; @@ -299,9 +306,7 @@ export default () => { lastElPos = canvas.getElementPos(lastEl); toolbar.style.display = ''; - const rteInst = await (customRte - ? customRte.enable(el, rte) - : this.initRte(el).enable()); + const rteInst = await (customRte ? customRte.enable(el, rte) : this.initRte(el).enable()); if (em) { setTimeout(this.updatePosition.bind(this), 0); @@ -335,6 +340,6 @@ export default () => { em.off(eventsUp, this.updatePosition, this); em.trigger('rte:disable', view, rte); } - } + }, }; }; From b524bc348c818b805f8224f985cdc12eee2da5f8 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 30 Dec 2021 13:13:42 +0100 Subject: [PATCH 200/313] Move canvas events --- src/canvas/index.js | 53 +++++++++++++++++++++++++-------------------- src/editor/index.js | 7 +----- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/canvas/index.js b/src/canvas/index.js index 7f1769eac..b0e92dc84 100644 --- a/src/canvas/index.js +++ b/src/canvas/index.js @@ -8,12 +8,25 @@ * }) * ``` * - * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance + * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. * * ```js + * // Listen to events + * editor.on('canvas:drop', () => { ... }); + * + * // Use the API * const canvas = editor.Canvas; + * canvas.setCoords(...); * ``` + * ## Available Events + * * `canvas:dragenter` - When something is dragged inside the canvas, `DataTransfer` instance passed as an argument + * * `canvas:dragover` - When something is dragging on canvas, `DataTransfer` instance passed as an argument + * * `canvas:drop` - Something is dropped in canvas, `DataTransfer` instance and the dropped model are passed as arguments + * * `canvas:dragend` - When a drag operation is ended, `DataTransfer` instance passed as an argument + * * `canvas:dragdata` - On any dataTransfer parse, `DataTransfer` instance and the `result` are passed as arguments. + * By changing `result.content` you're able to customize what is dropped * + * ## Methods * * [getConfig](#getconfig) * * [getElement](#getelement) * * [getFrameEl](#getframeel) @@ -65,7 +78,7 @@ export default () => { c = { ...defaults, ...config, - module: this + module: this, }; this.em = c.em; @@ -238,11 +251,7 @@ export default () => { * @private */ getOffsetViewerEl(compView) { - return this._getLocalEl( - CanvasView.offsetEl, - compView, - 'getOffsetViewerEl' - ); + return this._getLocalEl(CanvasView.offsetEl, compView, 'getOffsetViewerEl'); }, /** @@ -258,7 +267,7 @@ export default () => { CanvasView && CanvasView.remove(); CanvasView = new canvasView({ model: canvas, - config: c + config: c, }); return CanvasView.render().el; }, @@ -273,7 +282,7 @@ export default () => { var canvasOff = this.offset(this.getElement()); return { top: frameOff.top - canvasOff.top, - left: frameOff.left - canvasOff.left + left: frameOff.left - canvasOff.left, }; }, @@ -328,7 +337,7 @@ export default () => { return { ...CanvasView.getCanvasOffset(), topScroll: top, - leftScroll: left + leftScroll: left, }; }, @@ -379,7 +388,7 @@ export default () => { canvasTop: canvasPos.top, canvasLeft: canvasPos.left, canvasWidth: canvasPos.width, - canvasHeight: canvasPos.height + canvasHeight: canvasPos.height, }; // In this way I can catch data and also change the position strategy @@ -400,9 +409,7 @@ export default () => { const zoom = this.em.getZoomDecimal(); const side = top ? 'top' : 'left'; const doc = el.ownerDocument; - const { offsetTop = 0, offsetLeft = 0 } = opts.offset - ? getFrameElFromDoc(doc) - : {}; + const { offsetTop = 0, offsetLeft = 0 } = opts.offset ? getFrameElFromDoc(doc) : {}; const { scrollTop = 0, scrollLeft = 0 } = doc.body || {}; const scroll = top ? scrollTop : scrollLeft; const offset = top ? offsetTop : offsetLeft; @@ -416,7 +423,7 @@ export default () => { return { top: rectOff(el, 1, pos), - left: rectOff(el, 0, pos) + left: rectOff(el, 0, pos), }; }, @@ -453,7 +460,7 @@ export default () => { top, left, canvasOffsetTop: cvOff.top, - canvasOffsetLeft: cvOff.left + canvasOffsetLeft: cvOff.left, }; // In this way I can catch data and also change the position strategy @@ -490,7 +497,7 @@ export default () => { return { y: e.clientY + addTop - yOffset, - x: e.clientX + addLeft - xOffset + x: e.clientX + addLeft - xOffset, }; }, @@ -506,7 +513,7 @@ export default () => { return { y: ev.clientY * zoom + top, - x: ev.clientX * zoom + left + x: ev.clientX * zoom + left, }; }, @@ -528,9 +535,7 @@ export default () => { const frame = this.getFrameEl(); const toIgnore = ['body', ...this.getConfig().notTextable]; const docActive = frame && document.activeElement === frame; - const focused = docActive - ? doc && doc.activeElement - : document.activeElement; + const focused = docActive ? doc && doc.activeElement : document.activeElement; return focused && !toIgnore.some(item => focused.matches(item)); }, @@ -666,11 +671,11 @@ export default () => { addFrame(props = {}, opts = {}) { return canvas.get('frames').add( { - ...props + ...props, }, { ...opts, - em: this.em + em: this.em, } ); }, @@ -680,6 +685,6 @@ export default () => { CanvasView && CanvasView.remove(); [c, canvas, CanvasView].forEach(i => (i = {})); ['em', 'model', 'droppable'].forEach(i => (this[i] = {})); - } + }, }; }; diff --git a/src/editor/index.js b/src/editor/index.js index e76b52c0a..cb5353998 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -58,12 +58,7 @@ * * `storage:error:store` - Error on store request, passes the error as an argument * * `storage:error:load` - Error on load request, passes the error as an argument * ### Canvas - * * `canvas:dragenter` - When something is dragged inside the canvas, `DataTransfer` instance passed as an argument - * * `canvas:dragover` - When something is dragging on canvas, `DataTransfer` instance passed as an argument - * * `canvas:drop` - Something is dropped in canvas, `DataTransfer` instance and the dropped model are passed as arguments - * * `canvas:dragend` - When a drag operation is ended, `DataTransfer` instance passed as an argument - * * `canvas:dragdata` - On any dataTransfer parse, `DataTransfer` instance and the `result` are passed as arguments. - * By changing `result.content` you're able to customize what is dropped + * Check the [Canvas](/api/canvas.html) module. * ### RTE * Check the [Rich Text Editor](/api/rich_text_editor.html) module. * ### Commands From c2502f82365584ace421fb49421b8b1151e7303d Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 30 Dec 2021 13:16:16 +0100 Subject: [PATCH 201/313] Move storage manager events --- src/editor/index.js | 14 ++------------ src/storage_manager/index.js | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/editor/index.js b/src/editor/index.js index cb5353998..cfc208253 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -45,18 +45,8 @@ * * `styleManager:update:target` - The target (Component or CSSRule) is changed * * `styleManager:change` - Triggered on style property change from new selected component, the view of the property is passed as an argument to the callback * * `styleManager:change:{propertyName}` - As above but for a specific style property - * ### Storages - * * `storage:start` - Before the storage request is started - * * `storage:start:store` - Before the store request. The object to store is passed as an argumnet (which you can edit) - * * `storage:start:load` - Before the load request. Items to load are passed as an argumnet (which you can edit) - * * `storage:load` - Triggered when something was loaded from the storage, loaded object passed as an argumnet - * * `storage:store` - Triggered when something is stored to the storage, stored object passed as an argumnet - * * `storage:end` - After the storage request is ended - * * `storage:end:store` - After the store request - * * `storage:end:load` - After the load request - * * `storage:error` - On any error on storage request, passes the error as an argument - * * `storage:error:store` - Error on store request, passes the error as an argument - * * `storage:error:load` - Error on load request, passes the error as an argument + * ### Storage + * Check the [Storage](/api/storage_manager.html) module. * ### Canvas * Check the [Canvas](/api/canvas.html) module. * ### RTE diff --git a/src/storage_manager/index.js b/src/storage_manager/index.js index 07027b95e..4936034d2 100644 --- a/src/storage_manager/index.js +++ b/src/storage_manager/index.js @@ -8,12 +8,31 @@ * }) * ``` * - * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance + * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. * * ```js + * // Listen to events + * editor.on('storage:start', () => { ... }); + * + * // Use the API * const storageManager = editor.StorageManager; + * storageManager.add(...); * ``` * + * ## Available Events + * * `storage:start` - Before the storage request is started + * * `storage:start:store` - Before the store request. The object to store is passed as an argumnet (which you can edit) + * * `storage:start:load` - Before the load request. Items to load are passed as an argumnet (which you can edit) + * * `storage:load` - Triggered when something was loaded from the storage, loaded object passed as an argumnet + * * `storage:store` - Triggered when something is stored to the storage, stored object passed as an argumnet + * * `storage:end` - After the storage request is ended + * * `storage:end:store` - After the store request + * * `storage:end:load` - After the load request + * * `storage:error` - On any error on storage request, passes the error as an argument + * * `storage:error:store` - Error on store request, passes the error as an argument + * * `storage:error:load` - Error on load request, passes the error as an argument + * + * ## Methods * * [getConfig](#getconfig) * * [isAutosave](#isautosave) * * [setAutosave](#setautosave) @@ -362,6 +381,6 @@ export default () => { destroy() { [c, em, storages, defaultStorages].forEach(i => (i = {})); - } + }, }; }; From acafaab2c6926c2d5e92ff669e10b7a30b6a1897 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 30 Dec 2021 13:17:24 +0100 Subject: [PATCH 202/313] Move style manager events --- src/editor/index.js | 4 +--- src/style_manager/index.js | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/editor/index.js b/src/editor/index.js index cfc208253..e77a7bea4 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -42,9 +42,7 @@ * * `keymap:emit` - Some keymap emitted, in arguments you get keymapId, shortcutUsed, Event * * `keymap:emit:{keymapId}` - `keymapId` emitted, in arguments you get keymapId, shortcutUsed, Event * ### Style Manager - * * `styleManager:update:target` - The target (Component or CSSRule) is changed - * * `styleManager:change` - Triggered on style property change from new selected component, the view of the property is passed as an argument to the callback - * * `styleManager:change:{propertyName}` - As above but for a specific style property + * Check the [Style Manager](/api/style_manager.html) module. * ### Storage * Check the [Storage](/api/storage_manager.html) module. * ### Canvas diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 324d45083..e13acea89 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -22,6 +22,9 @@ * ## Available Events * * `style:sector:add` - Sector added. The [Sector] is passed as an argument to the callback. * * `style:target` - Target selection changed. The target (or `null` in case the target is deselected) is passed as an argument to the callback. + * * `styleManager:update:target` - The target (Component or CSSRule) is changed + * * `styleManager:change` - Triggered on style property change from new selected component, the view of the property is passed as an argument to the callback + * * `styleManager:change:{propertyName}` - As above but for a specific style property * * ## Methods * * [getConfig](#getconfig) From a45fd53f3dea3b3f0618744d6e16e3424e9142e0 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 30 Dec 2021 13:19:58 +0100 Subject: [PATCH 203/313] Move keymaps events --- src/editor/index.js | 5 +---- src/keymaps/index.js | 42 ++++++++++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/src/editor/index.js b/src/editor/index.js index e77a7bea4..6a34360ca 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -37,10 +37,7 @@ * * `component:drag` - During component drag. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the current pointer * * `component:drag:end` - Component drag ended. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the final pointer * ### Keymaps - * * `keymap:add` - New keymap added. The new keyamp object is passed as an argument - * * `keymap:remove` - Keymap removed. The removed keyamp object is passed as an argument - * * `keymap:emit` - Some keymap emitted, in arguments you get keymapId, shortcutUsed, Event - * * `keymap:emit:{keymapId}` - `keymapId` emitted, in arguments you get keymapId, shortcutUsed, Event + * Check the [Keymaps](/api/keymaps.html) module. * ### Style Manager * Check the [Style Manager](/api/style_manager.html) module. * ### Storage diff --git a/src/keymaps/index.js b/src/keymaps/index.js index 7528b17d9..ce4fb5b77 100644 --- a/src/keymaps/index.js +++ b/src/keymaps/index.js @@ -15,12 +15,24 @@ * }) * ``` * - * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance + * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. * * ```js + * // Listen to events + * editor.on('keymap:add', () => { ... }); + * + * // Use the API * const keymaps = editor.Keymaps; + * keymaps.add(...); * ``` * + * ## Available Events + * * `keymap:add` - New keymap added. The new keyamp object is passed as an argument + * * `keymap:remove` - Keymap removed. The removed keyamp object is passed as an argument + * * `keymap:emit` - Some keymap emitted, in arguments you get keymapId, shortcutUsed, Event + * * `keymap:emit:{keymapId}` - `keymapId` emitted, in arguments you get keymapId, shortcutUsed, Event + * + * ## Methods * * [getConfig](#getconfig) * * [add](#add) * * [get](#get) @@ -45,42 +57,42 @@ export default () => { defaults: { 'core:undo': { keys: '⌘+z, ctrl+z', - handler: 'core:undo' + handler: 'core:undo', }, 'core:redo': { keys: '⌘+shift+z, ctrl+shift+z', - handler: 'core:redo' + handler: 'core:redo', }, 'core:copy': { keys: '⌘+c, ctrl+c', - handler: 'core:copy' + handler: 'core:copy', }, 'core:paste': { keys: '⌘+v, ctrl+v', - handler: 'core:paste' + handler: 'core:paste', }, 'core:component-next': { keys: 's', - handler: 'core:component-next' + handler: 'core:component-next', }, 'core:component-prev': { keys: 'w', - handler: 'core:component-prev' + handler: 'core:component-prev', }, 'core:component-enter': { keys: 'd', - handler: 'core:component-enter' + handler: 'core:component-enter', }, 'core:component-exit': { keys: 'a', - handler: 'core:component-exit' + handler: 'core:component-exit', }, 'core:component-delete': { keys: 'backspace, delete', handler: 'core:component-delete', - opts: { prevent: 1 } - } - } + opts: { prevent: 1 }, + }, + }, }; return { @@ -154,9 +166,7 @@ export default () => { const ableTorun = !em.isEditing() && !editor.Canvas.isInputFocused(); if (ableTorun || opts.force) { opts.prevent && canvas.getCanvasView().preventDefault(e); - typeof handler == 'object' - ? cmd.runCommand(handler, opt) - : handler(editor, 0, opt); + typeof handler == 'object' ? cmd.runCommand(handler, opt) : handler(editor, 0, opt); const args = [id, h.shortcut, e]; em.trigger('keymap:emit', ...args); em.trigger(`keymap:emit:${id}`, ...args); @@ -222,6 +232,6 @@ export default () => { this.removeAll(); [em, config, keymaps].forEach(i => (i = {})); this.em = {}; - } + }, }; }; From 62171083eb782013693cf5db0f0fba3bc65c34e8 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 30 Dec 2021 13:25:21 +0100 Subject: [PATCH 204/313] Move components events --- src/dom_components/index.js | 139 ++++++++++++++++++------------------ src/editor/index.js | 29 ++------ 2 files changed, 76 insertions(+), 92 deletions(-) diff --git a/src/dom_components/index.js b/src/dom_components/index.js index 22af4c81c..0aee7fa41 100644 --- a/src/dom_components/index.js +++ b/src/dom_components/index.js @@ -8,12 +8,38 @@ * }) * ``` * - * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance + * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. * * ```js - * const domComponents = editor.DomComponents; + * // Listen to events + * editor.on('component:create', () => { ... }); + * + * // Use the API + * const cmp = editor.Components; + * cmp.addType(...); * ``` * + * ## Available Events + * * `component:create` - Component is created (only the model, is not yet mounted in the canvas), called after the init() method + * * `component:mount` - Component is mounted to an element and rendered in canvas + * * `component:add` - Triggered when a new component is added to the editor, the model is passed as an argument to the callback + * * `component:remove` - Triggered when a component is removed, the model is passed as an argument to the callback + * * `component:remove:before` - Triggered before the remove of the component, the model, remove function (if aborted via options, with this function you can complete the remove) and options (use options.abort = true to prevent remove), are passed as arguments to the callback + * * `component:clone` - Triggered when a component is cloned, the new model is passed as an argument to the callback + * * `component:update` - Triggered when a component is updated (moved, styled, etc.), the model is passed as an argument to the callback + * * `component:update:{propertyName}` - Listen any property change, the model is passed as an argument to the callback + * * `component:styleUpdate` - Triggered when the style of the component is updated, the model is passed as an argument to the callback + * * `component:styleUpdate:{propertyName}` - Listen for a specific style property change, the model is passed as an argument to the callback + * * `component:selected` - New component selected, the selected model is passed as an argument to the callback + * * `component:deselected` - Component deselected, the deselected model is passed as an argument to the callback + * * `component:toggled` - Component selection changed, toggled model is passed as an argument to the callback + * * `component:type:add` - New component type added, the new type is passed as an argument to the callback + * * `component:type:update` - Component type updated, the updated type is passed as an argument to the callback + * * `component:drag:start` - Component drag started. Passed an object, to the callback, containing the `target` (component to drag), `parent` (parent of the component) and `index` (component index in the parent) + * * `component:drag` - During component drag. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the current pointer + * * `component:drag:end` - Component drag ended. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the final pointer + * + * ## Methods * * [getWrapper](#getwrapper) * * [getComponents](#getcomponents) * * [addComponent](#addcomponent) @@ -25,7 +51,7 @@ * * [getTypes](#gettypes) * * [render](#render) * - * @module DomComponents + * @module Components */ import Backbone from 'backbone'; import { isEmpty, isObject, isArray, result } from 'underscore'; @@ -81,103 +107,103 @@ export default () => { { id: 'cell', model: ComponentTableCell, - view: ComponentTableCellView + view: ComponentTableCellView, }, { id: 'row', model: ComponentTableRow, - view: ComponentTableRowView + view: ComponentTableRowView, }, { id: 'table', model: ComponentTable, - view: ComponentTableView + view: ComponentTableView, }, { id: 'thead', model: ComponentTableHead, - view: ComponentTableHeadView + view: ComponentTableHeadView, }, { id: 'tbody', model: ComponentTableBody, - view: ComponentTableBodyView + view: ComponentTableBodyView, }, { id: 'tfoot', model: ComponentTableFoot, - view: ComponentTableFootView + view: ComponentTableFootView, }, { id: 'map', model: ComponentMap, - view: ComponentMapView + view: ComponentMapView, }, { id: 'link', model: ComponentLink, - view: ComponentLinkView + view: ComponentLinkView, }, { id: 'label', model: ComponentLabel, - view: ComponentLabelView + view: ComponentLabelView, }, { id: 'video', model: ComponentVideo, - view: ComponentVideoView + view: ComponentVideoView, }, { id: 'image', model: ComponentImage, - view: ComponentImageView + view: ComponentImageView, }, { id: 'script', model: ComponentScript, - view: ComponentScriptView + view: ComponentScriptView, }, { id: 'svg-in', model: ComponentSvgIn, - view: ComponentSvgView + view: ComponentSvgView, }, { id: 'svg', model: ComponentSvg, - view: ComponentSvgView + view: ComponentSvgView, }, { id: 'iframe', model: ComponentFrame, - view: ComponentFrameView + view: ComponentFrameView, }, { id: 'comment', model: ComponentComment, - view: ComponentCommentView + view: ComponentCommentView, }, { id: 'textnode', model: ComponentTextNode, - view: ComponentTextNodeView + view: ComponentTextNodeView, }, { id: 'text', model: ComponentText, - view: ComponentTextView + view: ComponentTextView, }, { id: 'wrapper', model: ComponentWrapper, - view: ComponentView + view: ComponentView, }, { id: 'default', model: Component, - view: ComponentView - } + view: ComponentView, + }, ]; return { @@ -250,12 +276,8 @@ export default () => { em.on('change:componentHovered', this.componentHovered, this); const selected = em.get('selected'); - em.listenTo(selected, 'add', (sel, c, opts) => - this.selectAdd(selected.getComponent(sel), opts) - ); - em.listenTo(selected, 'remove', (sel, c, opts) => - this.selectRemove(selected.getComponent(sel), opts) - ); + em.listenTo(selected, 'add', (sel, c, opts) => this.selectAdd(selected.getComponent(sel), opts)); + em.listenTo(selected, 'remove', (sel, c, opts) => this.selectRemove(selected.getComponent(sel), opts)); } if (em.get('hasPages')) { @@ -368,7 +390,7 @@ export default () => { * @return {Component} Root Component * @example * // Change background of the wrapper and set some attribute - * var wrapper = domComponents.getWrapper(); + * var wrapper = cmp.getWrapper(); * wrapper.set('style', {'background-color': 'red'}); * wrapper.set('attributes', {'title': 'Hello!'}); */ @@ -383,7 +405,7 @@ export default () => { * @return {Components} Collection of components * @example * // Let's add some component - * var wrapperChildren = domComponents.getComponents(); + * var wrapperChildren = cmp.getComponents(); * var comp1 = wrapperChildren.add({ * style: { 'background-color': 'red'} * }); @@ -410,7 +432,7 @@ export default () => { /** * Add new components to the wrapper's children. It's the same - * as 'domComponents.getComponents().add(...)' + * as 'cmp.getComponents().add(...)' * @param {Object|Component|Array} component Component/s to add * @param {string} [component.tagName='div'] Tag name * @param {string} [component.type=''] Type of the component. Available: ''(default), 'text', 'image' @@ -427,7 +449,7 @@ export default () => { * @return {Component|Array} Component/s added * @example * // Example of a new component with some extra property - * var comp1 = domComponents.addComponent({ + * var comp1 = cmp.addComponent({ * tagName: 'div', * removable: true, // Can't remove it * draggable: true, // Can't move it @@ -483,27 +505,13 @@ export default () => { */ addType(type, methods) { const { em } = this; - const { - model = {}, - view = {}, - isComponent, - extend, - extendView, - extendFn = [], - extendFnView = [] - } = methods; + const { model = {}, view = {}, isComponent, extend, extendView, extendFn = [], extendFnView = [] } = methods; const compType = this.getType(type); const extendType = this.getType(extend); const extendViewType = this.getType(extendView); - const typeToExtend = extendType - ? extendType - : compType - ? compType - : this.getType('default'); + const typeToExtend = extendType ? extendType : compType ? compType : this.getType('default'); const modelToExt = typeToExtend.model; - const viewToExt = extendViewType - ? extendViewType.view - : typeToExtend.view; + const viewToExt = extendViewType ? extendViewType.view : typeToExtend.view; // Function for extending source object methods const getExtendedObj = (fns, target, srcToExt) => @@ -511,7 +519,7 @@ export default () => { const fn = target[next]; const parentFn = srcToExt.prototype[next]; if (fn && parentFn) { - res[next] = function(...args) { + res[next] = function (...args) { parentFn.bind(this)(...args); fn.bind(this)(...args); }; @@ -527,14 +535,11 @@ export default () => { ...getExtendedObj(extendFn, model, modelToExt), defaults: { ...(result(modelToExt.prototype, 'defaults') || {}), - ...(result(model, 'defaults') || {}) - } + ...(result(model, 'defaults') || {}), + }, }, { - isComponent: - compType && !extendType && !isComponent - ? modelToExt.isComponent - : isComponent || (() => 0) + isComponent: compType && !extendType && !isComponent ? modelToExt.isComponent : isComponent || (() => 0), } ); } @@ -542,7 +547,7 @@ export default () => { if (typeof view === 'object') { methods.view = viewToExt.extend({ ...view, - ...getExtendedObj(extendFnView, view, viewToExt) + ...getExtendedObj(extendFnView, view, viewToExt), }); } @@ -603,11 +608,9 @@ export default () => { selectAdd(component, opts = {}) { if (component) { component.set({ - status: 'selected' + status: 'selected', }); - ['component:selected', 'component:toggled'].forEach(event => - this.em.trigger(event, component, opts) - ); + ['component:selected', 'component:toggled'].forEach(event => this.em.trigger(event, component, opts)); } }, @@ -616,11 +619,9 @@ export default () => { const { em } = this; component.set({ status: '', - state: '' + state: '', }); - ['component:deselected', 'component:toggled'].forEach(event => - this.em.trigger(event, component, opts) - ); + ['component:deselected', 'component:toggled'].forEach(event => this.em.trigger(event, component, opts)); } }, @@ -639,7 +640,7 @@ export default () => { previous.get('status') == state && previous.set({ status: '', - state: '' + state: '', }); model && isEmpty(model.get('status')) && model.set('status', state); @@ -659,6 +660,6 @@ export default () => { componentView && componentView.remove(); [c, em, componentsById, component, componentView].forEach(i => (i = {})); this.em = {}; - } + }, }; }; diff --git a/src/editor/index.js b/src/editor/index.js index 6a34360ca..5485d6b21 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -17,25 +17,13 @@ * }) * ``` * + * * `update` - The structure of the template is updated (its HTML/CSS) + * * `undo` - Undo executed + * * `redo` - Redo executed + * * `load` - Editor is loaded + * * ### Components - * * `component:create` - Component is created (only the model, is not yet mounted in the canvas), called after the init() method - * * `component:mount` - Component is mounted to an element and rendered in canvas - * * `component:add` - Triggered when a new component is added to the editor, the model is passed as an argument to the callback - * * `component:remove` - Triggered when a component is removed, the model is passed as an argument to the callback - * * `component:remove:before` - Triggered before the remove of the component, the model, remove function (if aborted via options, with this function you can complete the remove) and options (use options.abort = true to prevent remove), are passed as arguments to the callback - * * `component:clone` - Triggered when a component is cloned, the new model is passed as an argument to the callback - * * `component:update` - Triggered when a component is updated (moved, styled, etc.), the model is passed as an argument to the callback - * * `component:update:{propertyName}` - Listen any property change, the model is passed as an argument to the callback - * * `component:styleUpdate` - Triggered when the style of the component is updated, the model is passed as an argument to the callback - * * `component:styleUpdate:{propertyName}` - Listen for a specific style property change, the model is passed as an argument to the callback - * * `component:selected` - New component selected, the selected model is passed as an argument to the callback - * * `component:deselected` - Component deselected, the deselected model is passed as an argument to the callback - * * `component:toggled` - Component selection changed, toggled model is passed as an argument to the callback - * * `component:type:add` - New component type added, the new type is passed as an argument to the callback - * * `component:type:update` - Component type updated, the updated type is passed as an argument to the callback - * * `component:drag:start` - Component drag started. Passed an object, to the callback, containing the `target` (component to drag), `parent` (parent of the component) and `index` (component index in the parent) - * * `component:drag` - During component drag. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the current pointer - * * `component:drag:end` - Component drag ended. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the final pointer + * Check the [Components](/api/components.html) module. * ### Keymaps * Check the [Keymaps](/api/keymaps.html) module. * ### Style Manager @@ -62,11 +50,6 @@ * Check the [Parser](/api/parser.html) module. * ### Pages * Check the [Pages](/api/pages.html) module. - * ### General - * * `update` - The structure of the template is updated (its HTML/CSS) - * * `undo` - Undo executed - * * `redo` - Redo executed - * * `load` - Editor is loaded * * @module Editor */ From 4ec775b4552d91165df723f343e23845def572ff Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 30 Dec 2021 13:29:27 +0100 Subject: [PATCH 205/313] Update API docs --- docs/api/canvas.md | 19 ++- docs/api/commands.md | 18 ++- docs/api/components.md | 82 +++++++---- docs/api/editor.md | 269 ++++++++++++++++------------------- docs/api/keymaps.md | 16 ++- docs/api/rich_text_editor.md | 14 +- docs/api/storage_manager.md | 23 ++- docs/api/style_manager.md | 10 +- src/editor/index.js | 1 + 9 files changed, 270 insertions(+), 182 deletions(-) diff --git a/docs/api/canvas.md b/docs/api/canvas.md index 6945c35fd..eda709a0a 100644 --- a/docs/api/canvas.md +++ b/docs/api/canvas.md @@ -12,12 +12,29 @@ const editor = grapesjs.init({ }) ``` -Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance +Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. ```js +// Listen to events +editor.on('canvas:drop', () => { ... }); + +// Use the API const canvas = editor.Canvas; +canvas.setCoords(...); ``` +## Available Events + +* `canvas:dragenter` - When something is dragged inside the canvas, `DataTransfer` instance passed as an argument +* `canvas:dragover` - When something is dragging on canvas, `DataTransfer` instance passed as an argument +* `canvas:drop` - Something is dropped in canvas, `DataTransfer` instance and the dropped model are passed as arguments +* `canvas:dragend` - When a drag operation is ended, `DataTransfer` instance passed as an argument +* `canvas:dragdata` - On any dataTransfer parse, `DataTransfer` instance and the `result` are passed as arguments. + +By changing `result.content` you're able to customize what is dropped + +## Methods + * [getConfig][2] * [getElement][3] * [getFrameEl][4] diff --git a/docs/api/commands.md b/docs/api/commands.md index ed080b3f0..5ec980581 100644 --- a/docs/api/commands.md +++ b/docs/api/commands.md @@ -12,12 +12,28 @@ const editor = grapesjs.init({ }) ``` -Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance +Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. ```js +// Listen to events +editor.on('run', () => { ... }); + +// Use the API const commands = editor.Commands; +commands.add(...); ``` +* ## Available Events +* `run:{commandName}` - Triggered when some command is called to run (eg. editor.runCommand('preview')) +* `stop:{commandName}` - Triggered when some command is called to stop (eg. editor.stopCommand('preview')) +* `run:{commandName}:before` - Triggered before the command is called +* `stop:{commandName}:before` - Triggered before the command is called to stop +* `abort:{commandName}` - Triggered when the command execution is aborted (`editor.on(`run:preview:before`, opts => opts.abort = 1);`) +* `run` - Triggered on run of any command. The id and the result are passed as arguments to the callback +* `stop` - Triggered on stop of any command. The id and the result are passed as arguments to the callback + +## Methods + * [add][2] * [get][3] * [getAll][4] diff --git a/docs/api/components.md b/docs/api/components.md index 80622ff9b..c8e348fe8 100644 --- a/docs/api/components.md +++ b/docs/api/components.md @@ -1,6 +1,6 @@ -## DomComponents +## Components With this module is possible to manage components inside the canvas. You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object][1] @@ -12,12 +12,40 @@ const editor = grapesjs.init({ }) ``` -Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance +Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. ```js -const domComponents = editor.DomComponents; +// Listen to events +editor.on('component:create', () => { ... }); + +// Use the API +const cmp = editor.Components; +cmp.addType(...); ``` +## Available Events + +* `component:create` - Component is created (only the model, is not yet mounted in the canvas), called after the init() method +* `component:mount` - Component is mounted to an element and rendered in canvas +* `component:add` - Triggered when a new component is added to the editor, the model is passed as an argument to the callback +* `component:remove` - Triggered when a component is removed, the model is passed as an argument to the callback +* `component:remove:before` - Triggered before the remove of the component, the model, remove function (if aborted via options, with this function you can complete the remove) and options (use options.abort = true to prevent remove), are passed as arguments to the callback +* `component:clone` - Triggered when a component is cloned, the new model is passed as an argument to the callback +* `component:update` - Triggered when a component is updated (moved, styled, etc.), the model is passed as an argument to the callback +* `component:update:{propertyName}` - Listen any property change, the model is passed as an argument to the callback +* `component:styleUpdate` - Triggered when the style of the component is updated, the model is passed as an argument to the callback +* `component:styleUpdate:{propertyName}` - Listen for a specific style property change, the model is passed as an argument to the callback +* `component:selected` - New component selected, the selected model is passed as an argument to the callback +* `component:deselected` - Component deselected, the deselected model is passed as an argument to the callback +* `component:toggled` - Component selection changed, toggled model is passed as an argument to the callback +* `component:type:add` - New component type added, the new type is passed as an argument to the callback +* `component:type:update` - Component type updated, the updated type is passed as an argument to the callback +* `component:drag:start` - Component drag started. Passed an object, to the callback, containing the `target` (component to drag), `parent` (parent of the component) and `index` (component index in the parent) +* `component:drag` - During component drag. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the current pointer +* `component:drag:end` - Component drag ended. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the final pointer + +## Methods + * [getWrapper][2] * [getComponents][3] * [addComponent][4] @@ -60,7 +88,7 @@ The wrapper doesn't differ from the original Component Model ```javascript // Change background of the wrapper and set some attribute -var wrapper = domComponents.getWrapper(); +var wrapper = cmp.getWrapper(); wrapper.set('style', {'background-color': 'red'}); wrapper.set('attributes', {'title': 'Hello!'}); ``` @@ -77,7 +105,7 @@ components inside and you can nest them as more as you wish. ```javascript // Let's add some component -var wrapperChildren = domComponents.getComponents(); +var wrapperChildren = cmp.getComponents(); var comp1 = wrapperChildren.add({ style: { 'background-color': 'red'} }); @@ -98,26 +126,26 @@ comp1Children.add([ wrapperChildren.remove(comp2); ``` -Returns **Components** Collection of components +Returns **[Components][14]** Collection of components ## addComponent Add new components to the wrapper's children. It's the same -as 'domComponents.getComponents().add(...)' +as 'cmp.getComponents().add(...)' ### Parameters -* `component` **([Object][12] | Component | [Array][14]<[Object][12]>)** Component/s to add +* `component` **([Object][12] | Component | [Array][15]<[Object][12]>)** Component/s to add - * `component.tagName` **[string][15]** Tag name (optional, default `'div'`) - * `component.type` **[string][15]** Type of the component. Available: ''(default), 'text', 'image' (optional, default `''`) + * `component.tagName` **[string][16]** Tag name (optional, default `'div'`) + * `component.type` **[string][16]** Type of the component. Available: ''(default), 'text', 'image' (optional, default `''`) * `component.removable` **[boolean][13]** If component is removable (optional, default `true`) * `component.draggable` **[boolean][13]** If is possible to move the component around the structure (optional, default `true`) * `component.droppable` **[boolean][13]** If is possible to drop inside other components (optional, default `true`) * `component.badgable` **[boolean][13]** If the badge is visible when the component is selected (optional, default `true`) * `component.stylable` **[boolean][13]** If is possible to style component (optional, default `true`) * `component.copyable` **[boolean][13]** If is possible to copy\&paste the component (optional, default `true`) - * `component.content` **[string][15]** String inside component (optional, default `''`) + * `component.content` **[string][16]** String inside component (optional, default `''`) * `component.style` **[Object][12]** Style object (optional, default `{}`) * `component.attributes` **[Object][12]** Attribute object (optional, default `{}`) * `opt` **[Object][12]** the options object to be used by the \[Components.add][getComponents][3] method (optional, default `{}`) @@ -126,7 +154,7 @@ as 'domComponents.getComponents().add(...)' ```javascript // Example of a new component with some extra property -var comp1 = domComponents.addComponent({ +var comp1 = cmp.addComponent({ tagName: 'div', removable: true, // Can't remove it draggable: true, // Can't move it @@ -137,7 +165,7 @@ var comp1 = domComponents.addComponent({ }); ``` -Returns **(Component | [Array][14]\)** Component/s added +Returns **(Component | [Array][15]\)** Component/s added ## render @@ -146,7 +174,7 @@ Once the wrapper is rendered, and it's what happens when you init the editor, the all new components will be added automatically and property changes are all updated immediately -Returns **[HTMLElement][16]** +Returns **[HTMLElement][17]** ## clear @@ -161,11 +189,11 @@ Returns **this** ## addType Add new component type. -Read more about this in [Define New Component][17] +Read more about this in [Define New Component][18] ### Parameters -* `type` **[string][15]** Component ID +* `type` **[string][16]** Component ID * `methods` **[Object][12]** Component methods Returns **this** @@ -173,11 +201,11 @@ Returns **this** ## getType Get component type. -Read more about this in [Define New Component][17] +Read more about this in [Define New Component][18] ### Parameters -* `type` **[string][15]** Component ID +* `type` **[string][16]** Component ID Returns **[Object][12]** Component type definition, eg. `{ model: ..., view: ... }` @@ -188,15 +216,15 @@ Remove component type ### Parameters * `id` -* `type` **[string][15]** Component ID +* `type` **[string][16]** Component ID -Returns **([Object][12] | [undefined][18])** Removed component type, undefined otherwise +Returns **([Object][12] | [undefined][19])** Removed component type, undefined otherwise ## getTypes Return the array of all types -Returns **[Array][14]** +Returns **[Array][15]** [1]: https://github.com/artf/grapesjs/blob/master/src/dom_components/config/config.js @@ -224,12 +252,14 @@ Returns **[Array][14]** [13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean -[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array +[14]: #components + +[15]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array -[15]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[16]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[16]: https://developer.mozilla.org/docs/Web/HTML/Element +[17]: https://developer.mozilla.org/docs/Web/HTML/Element -[17]: https://grapesjs.com/docs/modules/Components.html#define-new-component +[18]: https://grapesjs.com/docs/modules/Components.html#define-new-component -[18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined +[19]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined diff --git a/docs/api/editor.md b/docs/api/editor.md index 74582561f..feaf0e701 100644 --- a/docs/api/editor.md +++ b/docs/api/editor.md @@ -21,113 +21,68 @@ editor.on('EVENT-NAME', (some, argument) => { }) ``` +* `update` - The structure of the template is updated (its HTML/CSS) +* `undo` - Undo executed +* `redo` - Redo executed +* `load` - Editor is loaded + ### Components -* `component:create` - Component is created (only the model, is not yet mounted in the canvas), called after the init() method -* `component:mount` - Component is mounted to an element and rendered in canvas -* `component:add` - Triggered when a new component is added to the editor, the model is passed as an argument to the callback -* `component:remove` - Triggered when a component is removed, the model is passed as an argument to the callback -* `component:remove:before` - Triggered before the remove of the component, the model, remove function (if aborted via options, with this function you can complete the remove) and options (use options.abort = true to prevent remove), are passed as arguments to the callback -* `component:clone` - Triggered when a component is cloned, the new model is passed as an argument to the callback -* `component:update` - Triggered when a component is updated (moved, styled, etc.), the model is passed as an argument to the callback -* `component:update:{propertyName}` - Listen any property change, the model is passed as an argument to the callback -* `component:styleUpdate` - Triggered when the style of the component is updated, the model is passed as an argument to the callback -* `component:styleUpdate:{propertyName}` - Listen for a specific style property change, the model is passed as an argument to the callback -* `component:selected` - New component selected, the selected model is passed as an argument to the callback -* `component:deselected` - Component deselected, the deselected model is passed as an argument to the callback -* `component:toggled` - Component selection changed, toggled model is passed as an argument to the callback -* `component:type:add` - New component type added, the new type is passed as an argument to the callback -* `component:type:update` - Component type updated, the updated type is passed as an argument to the callback -* `component:drag:start` - Component drag started. Passed an object, to the callback, containing the `target` (component to drag), `parent` (parent of the component) and `index` (component index in the parent) -* `component:drag` - During component drag. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the current pointer -* `component:drag:end` - Component drag ended. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the final pointer +Check the [Components][2] module. ### Keymaps -* `keymap:add` - New keymap added. The new keyamp object is passed as an argument -* `keymap:remove` - Keymap removed. The removed keyamp object is passed as an argument -* `keymap:emit` - Some keymap emitted, in arguments you get keymapId, shortcutUsed, Event -* `keymap:emit:{keymapId}` - `keymapId` emitted, in arguments you get keymapId, shortcutUsed, Event +Check the [Keymaps][3] module. ### Style Manager -* `styleManager:update:target` - The target (Component or CSSRule) is changed -* `styleManager:change` - Triggered on style property change from new selected component, the view of the property is passed as an argument to the callback -* `styleManager:change:{propertyName}` - As above but for a specific style property +Check the [Style Manager][4] module. -### Storages +### Storage -* `storage:start` - Before the storage request is started -* `storage:start:store` - Before the store request. The object to store is passed as an argumnet (which you can edit) -* `storage:start:load` - Before the load request. Items to load are passed as an argumnet (which you can edit) -* `storage:load` - Triggered when something was loaded from the storage, loaded object passed as an argumnet -* `storage:store` - Triggered when something is stored to the storage, stored object passed as an argumnet -* `storage:end` - After the storage request is ended -* `storage:end:store` - After the store request -* `storage:end:load` - After the load request -* `storage:error` - On any error on storage request, passes the error as an argument -* `storage:error:store` - Error on store request, passes the error as an argument -* `storage:error:load` - Error on load request, passes the error as an argument +Check the [Storage][5] module. ### Canvas -* `canvas:dragenter` - When something is dragged inside the canvas, `DataTransfer` instance passed as an argument -* `canvas:dragover` - When something is dragging on canvas, `DataTransfer` instance passed as an argument -* `canvas:drop` - Something is dropped in canvas, `DataTransfer` instance and the dropped model are passed as arguments -* `canvas:dragend` - When a drag operation is ended, `DataTransfer` instance passed as an argument -* `canvas:dragdata` - On any dataTransfer parse, `DataTransfer` instance and the `result` are passed as arguments. - -By changing `result.content` you're able to customize what is dropped +Check the [Canvas][6] module. ### RTE -* `rte:enable` - RTE enabled. The view, on which RTE is enabled, is passed as an argument -* `rte:disable` - RTE disabled. The view, on which RTE is disabled, is passed as an argument +Check the [Rich Text Editor][7] module. ### Commands -* `run:{commandName}` - Triggered when some command is called to run (eg. editor.runCommand('preview')) -* `stop:{commandName}` - Triggered when some command is called to stop (eg. editor.stopCommand('preview')) -* `run:{commandName}:before` - Triggered before the command is called -* `stop:{commandName}:before` - Triggered before the command is called to stop -* `abort:{commandName}` - Triggered when the command execution is aborted (`editor.on(`run:preview:before`, opts => opts.abort = 1);`) -* `run` - Triggered on run of any command. The id and the result are passed as arguments to the callback -* `stop` - Triggered on stop of any command. The id and the result are passed as arguments to the callback +Check the [Commands][8] module. ### Selectors -Check the [Selectors][2] module. +Check the [Selectors][9] module. ### Blocks -Check the [Blocks][3] module. +Check the [Blocks][10] module. ### Assets -Check the [Assets][4] module. +Check the [Assets][11] module. ### Modal -Check the [Modal][5] module. +Check the [Modal][12] module. ### Devices -Check the [Devices][6] module. +Check the [Devices][13] module. ### Parser -Check the [Parser][7] module. +Check the [Parser][14] module. ### Pages -Check the [Pages][8] module. - -### General +Check the [Pages][15] module. -* `update` - The structure of the template is updated (its HTML/CSS) -* `undo` - Undo executed -* `redo` - Redo executed -* `load` - Editor is loaded +## Methods ## getConfig @@ -135,7 +90,7 @@ Returns configuration object ### Parameters -* `prop` **[string][9]?** Property name +* `prop` **[string][16]?** Property name Returns **any** Returns the configuration object or the value of the specified property @@ -146,12 +101,12 @@ Returns HTML built inside canvas ### Parameters -* `opts` **[Object][10]** Options (optional, default `{}`) +* `opts` **[Object][17]** Options (optional, default `{}`) * `opts.component` **Component?** Return the HTML of a specific Component - * `opts.cleanId` **[Boolean][11]** Remove unnecessary IDs (eg. those created automatically) (optional, default `false`) + * `opts.cleanId` **[Boolean][18]** Remove unnecessary IDs (eg. those created automatically) (optional, default `false`) -Returns **[string][9]** HTML string +Returns **[string][16]** HTML string ## getCss @@ -159,13 +114,13 @@ Returns CSS built inside canvas ### Parameters -* `opts` **[Object][10]** Options (optional, default `{}`) +* `opts` **[Object][17]** Options (optional, default `{}`) * `opts.component` **Component?** Return the CSS of a specific Component - * `opts.json` **[Boolean][11]** Return an array of CssRules instead of the CSS string (optional, default `false`) - * `opts.avoidProtected` **[Boolean][11]** Don't include protected CSS (optional, default `false`) + * `opts.json` **[Boolean][18]** Return an array of CssRules instead of the CSS string (optional, default `false`) + * `opts.avoidProtected` **[Boolean][18]** Don't include protected CSS (optional, default `false`) -Returns **([String][9] | [Array][12]\)** CSS string or array of CssRules +Returns **([String][16] | [Array][19]\)** CSS string or array of CssRules ## getJs @@ -173,11 +128,11 @@ Returns JS of all components ### Parameters -* `opts` **[Object][10]** Options (optional, default `{}`) +* `opts` **[Object][17]** Options (optional, default `{}`) * `opts.component` **Component?** Get the JS of a specific component -Returns **[String][9]** JS string +Returns **[String][16]** JS string ## getComponents @@ -197,8 +152,8 @@ Set components inside editor's canvas. This method overrides actual components ### Parameters -* `components` **([Array][12]<[Object][10]> | [Object][10] | [string][9])** HTML string or components model -* `opt` **[Object][10]** the options object to be used by the \[setComponents][em#setComponents][13] method (optional, default `{}`) +* `components` **([Array][19]<[Object][17]> | [Object][17] | [string][16])** HTML string or components model +* `opt` **[Object][17]** the options object to be used by the \[setComponents][em#setComponents][20] method (optional, default `{}`) ### Examples @@ -220,10 +175,10 @@ Add components ### Parameters -* `components` **([Array][12]<[Object][10]> | [Object][10] | [string][9])** HTML string or components model -* `opts` **[Object][10]** Options +* `components` **([Array][19]<[Object][17]> | [Object][17] | [string][16])** HTML string or components model +* `opts` **[Object][17]** Options - * `opts.avoidUpdateStyle` **[Boolean][11]** If the HTML string contains styles, + * `opts.avoidUpdateStyle` **[Boolean][18]** If the HTML string contains styles, by default, they will be created and, if already exist, updated. When this option is true, styles already created will not be updated. (optional, default `false`) @@ -239,13 +194,13 @@ editor.addComponents({ }); ``` -Returns **[Array][12]\** +Returns **[Array][19]\** ## getStyle Returns style in JSON format object -Returns **[Object][10]** +Returns **[Object][17]** ## setStyle @@ -253,7 +208,7 @@ Set style inside editor's canvas. This method overrides actual style ### Parameters -* `style` **([Array][12]<[Object][10]> | [Object][10] | [string][9])** CSS string or style model +* `style` **([Array][19]<[Object][17]> | [Object][17] | [string][16])** CSS string or style model * `opt` (optional, default `{}`) ### Examples @@ -275,7 +230,7 @@ Add styles to the editor ### Parameters -* `style` **([Array][12]<[Object][10]> | [Object][10] | [string][9])** CSS string or style model +* `style` **([Array][19]<[Object][17]> | [Object][17] | [string][16])** CSS string or style model * `opts` (optional, default `{}`) ### Examples @@ -284,7 +239,7 @@ Add styles to the editor editor.addStyle('.cls{color: red}'); ``` -Returns **[Array][12]\** Array of created CssRule instances +Returns **[Array][19]\** Array of created CssRule instances ## getSelected @@ -296,7 +251,7 @@ Returns **Model** Returns an array of all selected components -Returns **[Array][12]** +Returns **[Array][19]** ## getSelectedToStyle @@ -314,10 +269,10 @@ Select a component ### Parameters -* `el` **(Component | [HTMLElement][14])** Component to select -* `opts` **[Object][10]?** Options +* `el` **(Component | [HTMLElement][21])** Component to select +* `opts` **[Object][17]?** Options - * `opts.scroll` **[Boolean][11]?** Scroll canvas to the selected element + * `opts.scroll` **[Boolean][18]?** Scroll canvas to the selected element ### Examples @@ -336,7 +291,7 @@ Add component to selection ### Parameters -* `el` **(Component | [HTMLElement][14] | [Array][12])** Component to select +* `el` **(Component | [HTMLElement][21] | [Array][19])** Component to select ### Examples @@ -352,7 +307,7 @@ Remove component from selection ### Parameters -* `el` **(Component | [HTMLElement][14] | [Array][12])** Component to select +* `el` **(Component | [HTMLElement][21] | [Array][19])** Component to select ### Examples @@ -368,7 +323,7 @@ Toggle component selection ### Parameters -* `el` **(Component | [HTMLElement][14] | [Array][12])** Component to select +* `el` **(Component | [HTMLElement][21] | [Array][19])** Component to select ### Examples @@ -400,7 +355,7 @@ change the canvas to the proper width ### Parameters -* `name` **[string][9]** Name of the device +* `name` **[string][16]** Name of the device ### Examples @@ -422,7 +377,7 @@ console.log(device); // 'Tablet' ``` -Returns **[string][9]** Device name +Returns **[string][16]** Device name ## runCommand @@ -430,8 +385,8 @@ Execute command ### Parameters -* `id` **[string][9]** Command ID -* `options` **[Object][10]** Custom options (optional, default `{}`) +* `id` **[string][16]** Command ID +* `options` **[Object][17]** Custom options (optional, default `{}`) ### Examples @@ -447,8 +402,8 @@ Stop the command if stop method was provided ### Parameters -* `id` **[string][9]** Command ID -* `options` **[Object][10]** Custom options (optional, default `{}`) +* `id` **[string][16]** Command ID +* `options` **[Object][17]** Custom options (optional, default `{}`) ### Examples @@ -464,9 +419,9 @@ Store data to the current storage ### Parameters -* `clb` **[Function][15]** Callback function +* `clb` **[Function][22]** Callback function -Returns **[Object][10]** Stored data +Returns **[Object][17]** Stored data ## storeData @@ -479,7 +434,7 @@ console.log(editor.storeData()); // { pages: [...], styles: [...], ... } ``` -Returns **[Object][10]** +Returns **[Object][17]** ## load @@ -487,9 +442,9 @@ Load data from the current storage ### Parameters -* `clb` **[Function][15]** Callback function +* `clb` **[Function][22]** Callback function -Returns **[Object][10]** Stored data +Returns **[Object][17]** Stored data ## loadData @@ -497,7 +452,7 @@ Load data from the JSON data object ### Parameters -* `data` **[Object][10]** Data to load +* `data` **[Object][17]** Data to load ### Examples @@ -505,21 +460,21 @@ Load data from the JSON data object editor.loadData({ pages: [...], styles: [...], ... }) ``` -Returns **[Object][10]** Loaded object +Returns **[Object][17]** Loaded object ## getContainer Returns container element. The one which was indicated as 'container' on init method -Returns **[HTMLElement][14]** +Returns **[HTMLElement][21]** ## getDirtyCount Return the count of changes made to the content and not yet stored. This count resets at any `store()` -Returns **[number][16]** +Returns **[number][23]** ## refresh @@ -532,9 +487,9 @@ refresh you'll get misleading position of tools ### Parameters * `opts` -* `options` **[Object][10]?** Options +* `options` **[Object][17]?** Options - * `options.tools` **[Boolean][11]** Update the position of tools (eg. rich text editor, component highlighter, etc.) (optional, default `false`) + * `options.tools` **[Boolean][18]** Update the position of tools (eg. rich text editor, component highlighter, etc.) (optional, default `false`) ## setCustomRte @@ -542,7 +497,7 @@ Replace the built-in Rich Text Editor with a custom one. ### Parameters -* `obj` **[Object][10]** Custom RTE Interface +* `obj` **[Object][17]** Custom RTE Interface ### Examples @@ -582,7 +537,7 @@ custom parser, pass `null` as the argument ### Parameters -* `parser` **([Function][15] | null)** Parser function +* `parser` **([Function][22] | null)** Parser function ### Examples @@ -604,11 +559,11 @@ Returns **this** ## setDragMode Change the global drag mode of components. -To get more about this feature read: [https://github.com/artf/grapesjs/issues/1936][17] +To get more about this feature read: [https://github.com/artf/grapesjs/issues/1936][24] ### Parameters -* `value` **[String][9]** Drag mode, options: 'absolute' | 'translate' +* `value` **[String][16]** Drag mode, options: 'absolute' | 'translate' Returns **this** @@ -619,10 +574,10 @@ Trigger event log message ### Parameters * `msg` **any** Message to log -* `opts` **[Object][10]** Custom options (optional, default `{}`) +* `opts` **[Object][17]** Custom options (optional, default `{}`) - * `opts.ns` **[String][9]** Namespace of the log (eg. to use in plugins) (optional, default `''`) - * `opts.level` **[String][9]** Level of the log, `debug`, `info`, `warning`, `error` (optional, default `'debug'`) + * `opts.ns` **[String][16]** Namespace of the log (eg. to use in plugins) (optional, default `''`) + * `opts.level` **[String][16]** Level of the log, `debug`, `info`, `warning`, `error` (optional, default `'debug'`) ### Examples @@ -644,11 +599,11 @@ Translate label ### Parameters * `args` **...any** -* `key` **[String][9]** Label to translate -* `opts` **[Object][10]?** Options for the translation +* `key` **[String][16]** Label to translate +* `opts` **[Object][17]?** Options for the translation - * `opts.params` **[Object][10]?** Params for the translation - * `opts.noWarn` **[Boolean][11]?** Avoid warnings in case of missing resources + * `opts.params` **[Object][17]?** Params for the translation + * `opts.noWarn` **[Boolean][18]?** Avoid warnings in case of missing resources ### Examples @@ -660,7 +615,7 @@ editor.t('msg2', { params: { test: 'hello' } }); editor.t('msg2', { params: { test: 'hello' }, l: 'it' }); ``` -Returns **[String][9]** +Returns **[String][16]** ## on @@ -668,8 +623,8 @@ Attach event ### Parameters -* `event` **[string][9]** Event name -* `callback` **[Function][15]** Callback function +* `event` **[string][16]** Event name +* `callback` **[Function][22]** Callback function Returns **this** @@ -679,8 +634,8 @@ Attach event and detach it after the first run ### Parameters -* `event` **[string][9]** Event name -* `callback` **[Function][15]** Callback function +* `event` **[string][16]** Event name +* `callback` **[Function][22]** Callback function Returns **this** @@ -690,8 +645,8 @@ Detach event ### Parameters -* `event` **[string][9]** Event name -* `callback` **[Function][15]** Callback function +* `event` **[string][16]** Event name +* `callback` **[Function][22]** Callback function Returns **this** @@ -701,7 +656,7 @@ Trigger event ### Parameters -* `event` **[string][9]** Event to trigger +* `event` **[string][16]** Event to trigger Returns **this** @@ -713,7 +668,7 @@ Destroy the editor Render editor -Returns **[HTMLElement][14]** +Returns **[HTMLElement][21]** ## onReady @@ -722,7 +677,7 @@ The callback will be executed immediately if the method is called on the already ### Parameters -* `clb` **[Function][15]** Callback to trigger +* `clb` **[Function][22]** Callback to trigger ### Examples @@ -738,8 +693,8 @@ Print safe HTML by using ES6 tagged template strings. ### Parameters -* `literals` **[Array][12]<[String][9]>** -* `substs` **[Array][12]<[String][9]>** +* `literals` **[Array][19]<[String][16]>** +* `substs` **[Array][19]<[String][16]>** ### Examples @@ -750,38 +705,52 @@ const safeStr = 'Hello'; const strHtml = editor.html`Escaped ${unsafeStr}, unescaped $${safeStr}`; ``` -Returns **[String][9]** +Returns **[String][16]** [1]: https://github.com/artf/grapesjs/blob/master/src/editor/config/config.js -[2]: /api/selector_manager.html +[2]: /api/components.html + +[3]: /api/keymaps.html + +[4]: /api/style_manager.html + +[5]: /api/storage_manager.html + +[6]: /api/canvas.html + +[7]: /api/rich_text_editor.html + +[8]: /api/commands.html + +[9]: /api/selector_manager.html -[3]: /api/block_manager.html +[10]: /api/block_manager.html -[4]: /api/assets.html +[11]: /api/assets.html -[5]: /api/modal_dialog.html +[12]: /api/modal_dialog.html -[6]: /api/device_manager.html +[13]: /api/device_manager.html -[7]: /api/parser.html +[14]: /api/parser.html -[8]: /api/pages.html +[15]: /api/pages.html -[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[16]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean -[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array +[19]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array -[13]: em#setComponents +[20]: em#setComponents -[14]: https://developer.mozilla.org/docs/Web/HTML/Element +[21]: https://developer.mozilla.org/docs/Web/HTML/Element -[15]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function +[22]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function -[16]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[23]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[17]: https://github.com/artf/grapesjs/issues/1936 +[24]: https://github.com/artf/grapesjs/issues/1936 diff --git a/docs/api/keymaps.md b/docs/api/keymaps.md index add85f6d9..269c66f14 100644 --- a/docs/api/keymaps.md +++ b/docs/api/keymaps.md @@ -19,12 +19,26 @@ const editor = grapesjs.init({ }) ``` -Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance +Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. ```js +// Listen to events +editor.on('keymap:add', () => { ... }); + +// Use the API const keymaps = editor.Keymaps; +keymaps.add(...); ``` +## Available Events + +* `keymap:add` - New keymap added. The new keyamp object is passed as an argument +* `keymap:remove` - Keymap removed. The removed keyamp object is passed as an argument +* `keymap:emit` - Some keymap emitted, in arguments you get keymapId, shortcutUsed, Event +* `keymap:emit:{keymapId}` - `keymapId` emitted, in arguments you get keymapId, shortcutUsed, Event + +## Methods + * [getConfig][1] * [add][2] * [get][3] diff --git a/docs/api/rich_text_editor.md b/docs/api/rich_text_editor.md index fd31cf86d..c71634583 100644 --- a/docs/api/rich_text_editor.md +++ b/docs/api/rich_text_editor.md @@ -15,12 +15,24 @@ const editor = grapesjs.init({ }) ``` -Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance +Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. ```js +// Listen to events +editor.on('rte:enable', () => { ... }); + +// Use the API const rte = editor.RichTextEditor; +rte.add(...); ``` +## Available Events + +* `rte:enable` - RTE enabled. The view, on which RTE is enabled, is passed as an argument +* `rte:disable` - RTE disabled. The view, on which RTE is disabled, is passed as an argument + +## Methods + * [add][3] * [get][4] * [getAll][5] diff --git a/docs/api/storage_manager.md b/docs/api/storage_manager.md index 271e6c38c..efb105874 100644 --- a/docs/api/storage_manager.md +++ b/docs/api/storage_manager.md @@ -12,12 +12,33 @@ const editor = grapesjs.init({ }) ``` -Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance +Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. ```js +// Listen to events +editor.on('storage:start', () => { ... }); + +// Use the API const storageManager = editor.StorageManager; +storageManager.add(...); ``` +## Available Events + +* `storage:start` - Before the storage request is started +* `storage:start:store` - Before the store request. The object to store is passed as an argumnet (which you can edit) +* `storage:start:load` - Before the load request. Items to load are passed as an argumnet (which you can edit) +* `storage:load` - Triggered when something was loaded from the storage, loaded object passed as an argumnet +* `storage:store` - Triggered when something is stored to the storage, stored object passed as an argumnet +* `storage:end` - After the storage request is ended +* `storage:end:store` - After the store request +* `storage:end:load` - After the load request +* `storage:error` - On any error on storage request, passes the error as an argument +* `storage:error:store` - Error on store request, passes the error as an argument +* `storage:error:load` - Error on load request, passes the error as an argument + +## Methods + * [getConfig][2] * [isAutosave][3] * [setAutosave][4] diff --git a/docs/api/style_manager.md b/docs/api/style_manager.md index 0b20d3cc5..48dff409d 100644 --- a/docs/api/style_manager.md +++ b/docs/api/style_manager.md @@ -13,16 +13,24 @@ const editor = grapesjs.init({ }) ``` -Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance +Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. ```js +// Listen to events +editor.on('style:sector:add', (sector) => { ... }); + +// Use the API const styleManager = editor.StyleManager; +styleManager.addSector(...); ``` ## Available Events * `style:sector:add` - Sector added. The [Sector] is passed as an argument to the callback. * `style:target` - Target selection changed. The target (or `null` in case the target is deselected) is passed as an argument to the callback. +* `styleManager:update:target` - The target (Component or CSSRule) is changed +* `styleManager:change` - Triggered on style property change from new selected component, the view of the property is passed as an argument to the callback +* `styleManager:change:{propertyName}` - As above but for a specific style property ## Methods diff --git a/src/editor/index.js b/src/editor/index.js index 5485d6b21..d1af83e2d 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -51,6 +51,7 @@ * ### Pages * Check the [Pages](/api/pages.html) module. * + * ## Methods * @module Editor */ import defaults from './config/config'; From 8755ce30bfb1e539016028a2e389a6ebccb6957f Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 30 Dec 2021 13:43:03 +0100 Subject: [PATCH 206/313] Add style manager hero image --- docs/.vuepress/public/style-manager.jpg | Bin 0 -> 47883 bytes docs/modules/Style-manager.md | 7 ++----- 2 files changed, 2 insertions(+), 5 deletions(-) create mode 100644 docs/.vuepress/public/style-manager.jpg diff --git a/docs/.vuepress/public/style-manager.jpg b/docs/.vuepress/public/style-manager.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2db17132bbe29d182e3708c8a6b075c422ffdd91 GIT binary patch literal 47883 zcmcG#1z23mvNk+}%i!)dNPyt(Hb{T~fgpiEU}lg2gS#ZSdvKQ|5J-Xqm*DOY+})i3 zLGr`i`|NY>`S1PYKHu%-bC}6hN6lZ1ONmA03c;GD})^qJ^)~gaCUsABuB4r z@PZzF5P$^01fT(U0RU5|lfAmOqRzvsRUq>8PWM9pY~}&|oVah}K8-zA)}*I@K>rts z0BY~(3;+N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r{R5MSC-H*MJFM zwL07Cc=-gXVTzdbJH7a}wz2CBiV{q} zH6x!3+ zcW&s6wxphTvIcYpVaZ0i z#_z@@y3b(XUm{UgH2=e4$n0_If`x$#FTR+CvVABX2Az%oW57WkQZvP7oB3_@tlvFEA<*B9m$ pdES3naZywy_)Yo`lJGrapesJS - Block Manager

--> -::: +

GrapesJS - Style Manager

-The Style Manager module is responsible to show and update style properties on your [Components]. In this guide, you will see how to setup and take full advantage of the built-in Style Manager UI in GrapesJS. +The Style Manager module is responsible to show and update style properties relative to your [Components]. In this guide, you will see how to setup and take full advantage of the built-in Style Manager UI in GrapesJS. The default UI is a lightweight component with built-in properties, but as you'll see next in this guide, it's easy to extend with your own elements or even create the Style Manager UI from scratch by using the [Style Manager API]. ::: warning From 5fcd868991011bd5aa70cddc94c80106c3bd938c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 30 Dec 2021 20:46:26 +0100 Subject: [PATCH 207/313] Start refactoring property views --- src/commands/view/SelectComponent.js | 88 ++----- src/domain_abstract/ui/InputNumber.js | 4 +- src/style_manager/index.js | 3 +- src/style_manager/model/Property.js | 2 +- src/style_manager/view/PropertyNumberView.js | 3 +- src/style_manager/view/PropertyView.js | 249 +++++++++---------- src/style_manager/view/SectorsView.js | 8 +- 7 files changed, 158 insertions(+), 199 deletions(-) diff --git a/src/commands/view/SelectComponent.js b/src/commands/view/SelectComponent.js index 46ee3f195..b1bc84803 100644 --- a/src/commands/view/SelectComponent.js +++ b/src/commands/view/SelectComponent.js @@ -1,13 +1,6 @@ import Backbone from 'backbone'; import { bindAll, isElement, isUndefined, debounce } from 'underscore'; -import { - on, - off, - getUnitFromValue, - isTaggableNode, - getViewEl, - hasWin -} from 'utils/mixins'; +import { on, off, getUnitFromValue, isTaggableNode, getViewEl, hasWin } from 'utils/mixins'; import { isVisible, isDoc } from 'utils/dom'; import ToolbarView from 'dom_components/view/ToolbarView'; import Toolbar from 'dom_components/model/Toolbar'; @@ -36,15 +29,7 @@ let showOffsets; */ export default { init(o) { - bindAll( - this, - 'onHover', - 'onOut', - 'onClick', - 'onFrameScroll', - 'onFrameUpdated', - 'onContainerChange' - ); + bindAll(this, 'onHover', 'onOut', 'onClick', 'onFrameScroll', 'onFrameUpdated', 'onContainerChange'); }, enable() { @@ -92,7 +77,7 @@ export default { em[method]('component:toggled component:update', this.onSelect, this); em[method]('change:componentHovered', this.onHovered, this); em[method]( - 'component:resize component:styleUpdate component:input', + 'component:resize styleable:change component:input', // component:styleUpdate this.updateGlobalPos, this ); @@ -177,7 +162,7 @@ export default { * @param {Object} el * @private * */ - onSelect: debounce(function() { + onSelect: debounce(function () { const { em } = this; const component = em.getSelected(); const currentFrame = em.get('currentFrame') || {}; @@ -242,7 +227,7 @@ export default { view: opts.view, force: 1, top: 0, - left: 0 + left: 0, }); }, @@ -253,7 +238,7 @@ export default { */ hideElementOffset(view) { this.editor.stopCommand('show-offset', { - view + view, }); }, @@ -266,7 +251,7 @@ export default { this.editor.runCommand('show-offset', { el, elPos: pos, - state: 'Fixed' + state: 'Fixed', }); }, @@ -347,9 +332,7 @@ export default { const ppfx = config.pStylePrefix || ''; const clsBadge = `${ppfx}badge`; const customeLabel = config.customBadgeLabel; - const badgeLabel = `${ - icon ? `
${icon}
` : '' - } + const badgeLabel = `${icon ? `
${icon}
` : ''}
${model.getName()}
`; badge.innerHTML = customeLabel ? customeLabel(model) : badgeLabel; } @@ -359,7 +342,7 @@ export default { bStyle.display = 'block'; const targetToElem = canvas.getTargetToElementFixed(el, badge, { - pos: pos + pos: pos, }); const top = targetToElem.top; //opts.topOff - badgeH < 0 ? -opts.topOff : posTop; @@ -390,8 +373,7 @@ export default { const config = em ? em.get('Config') : ''; const pfx = config.stylePrefix || ''; const resizeClass = `${pfx}resizing`; - const model = - !isElement(elem) && isTaggableNode(elem) ? elem : em.getSelected(); + const model = !isElement(elem) && isTaggableNode(elem) ? elem : em.getSelected(); const resizable = model && model.get('resizable'); let options = {}; let modelToStyle; @@ -402,10 +384,7 @@ export default { docs.forEach(doc => { const body = doc.body; const cls = body.className || ''; - body.className = (method == 'add' - ? `${cls} ${resizeClass}` - : cls.replace(resizeClass, '') - ).trim(); + body.className = (method == 'add' ? `${cls} ${resizeClass}` : cls.replace(resizeClass, '')).trim(); }); }; @@ -415,13 +394,7 @@ export default { // Here the resizer is updated with the current element height and width onStart(e, opts = {}) { const { el, config, resizer } = opts; - const { - keyHeight, - keyWidth, - currentUnit, - keepAutoHeight, - keepAutoWidth - } = config; + const { keyHeight, keyWidth, currentUnit, keepAutoHeight, keepAutoWidth } = config; toggleBodyClass('add', e, opts); modelToStyle = em.get('StyleManager').getModelToStyle(model); canvas.toggleFramesEvents(); @@ -468,14 +441,7 @@ export default { } const { store, selectedHandler, config } = options; - const { - keyHeight, - keyWidth, - autoHeight, - autoWidth, - unitWidth, - unitHeight - } = config; + const { keyHeight, keyWidth, autoHeight, autoWidth, unitWidth, unitHeight } = config; const onlyHeight = ['tc', 'bc'].indexOf(selectedHandler) >= 0; const onlyWidth = ['cl', 'cr'].indexOf(selectedHandler) >= 0; const style = {}; @@ -495,7 +461,7 @@ export default { const updateEvent = `update:component:style`; const eventToListen = `${updateEvent}:${keyHeight} ${updateEvent}:${keyWidth}`; em && em.trigger(eventToListen, null, null, { noEmit: 1 }); - } + }, }; if (typeof resizable == 'object') { @@ -529,7 +495,7 @@ export default { const toolbarView = new ToolbarView({ collection: this.toolbar, editor: this.editor, - em + em, }); toolbarEl.appendChild(toolbarView.render().el); } @@ -628,7 +594,7 @@ export default { ...badgeOpts, view, topOff, - leftOff + leftOff, }); style.top = topOff + unit; @@ -642,18 +608,18 @@ export default { top: topOff, left: leftOff, width: pos.width, - height: pos.height + height: pos.height, }); }, - _upToolbar: debounce(function() { + _upToolbar: debounce(function () { this.updateToolsGlobal({ force: 1 }); }), _trgToolUp(type, opts = {}) { this.em.trigger('canvas:tools:update', { type, - ...opts + ...opts, }); }, @@ -677,11 +643,7 @@ export default { const unit = 'px'; const toolsEl = this.toggleToolsEl(1); const { style } = toolsEl; - const targetToElem = canvas.getTargetToElementFixed( - el, - canvas.getToolbarEl(), - { pos } - ); + const targetToElem = canvas.getTargetToElementFixed(el, canvas.getToolbarEl(), { pos }); const topOff = targetToElem.canvasOffsetTop; const leftOff = targetToElem.canvasOffsetLeft; style.top = topOff + unit; @@ -696,18 +658,18 @@ export default { top: topOff, left: leftOff, width: pos.width, - height: pos.height + height: pos.height, }); }, /** * Update attached elements, eg. component toolbar */ - updateAttached: debounce(function() { + updateAttached: debounce(function () { this.updateGlobalPos(); }), - onContainerChange: debounce(function() { + onContainerChange: debounce(function () { this.em.refreshCanvas(); }, 150), @@ -738,7 +700,7 @@ export default { model && model.set({ status: '', - state: '' + state: '', }); }, @@ -764,5 +726,5 @@ export default { !opts.preserveSelected && em.setSelected(null); this.toggleToolsEl(); editor && editor.stopCommand('resize'); - } + }, }; diff --git a/src/domain_abstract/ui/InputNumber.js b/src/domain_abstract/ui/InputNumber.js index b3a7a8c91..de61e27d3 100644 --- a/src/domain_abstract/ui/InputNumber.js +++ b/src/domain_abstract/ui/InputNumber.js @@ -124,7 +124,7 @@ export default Input.extend({ const units = model.get('units') || []; if (units.length) { - const options = []; + const options = ['']; units.forEach(unit => { const selected = unit == model.get('unit') ? 'selected' : ''; @@ -255,6 +255,8 @@ export default Input.extend({ if (opt.deepCheck) { var fixed = model.get('fixedValues') || []; + if (val === '') unit = ''; + if (val) { // If the value is one of the fixed values I leave it as it is var regFixed = new RegExp('^' + fixed.join('|'), 'g'); diff --git a/src/style_manager/index.js b/src/style_manager/index.js index e13acea89..ae79ed9dc 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -629,7 +629,8 @@ export default () => { __upProps(opts) { const lastTarget = this.getLastSelected(); - if (!lastTarget || !this.getConfig().custom) return; + // if (!lastTarget || !this.getConfig().custom) return; + if (!lastTarget) return; const lastTargetParents = this.getSelectedParents(); const style = lastTarget.getStyle(); diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index c27e60931..8c58ffe79 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -32,7 +32,7 @@ export default class Property extends Model { } __upTargets(p, opts = {}) { - if (!this.__hasCustom()) return; + // if (!this.__hasCustom()) return; const { em } = this; const sm = em.get('StyleManager'); const name = this.getName(); diff --git a/src/style_manager/view/PropertyNumberView.js b/src/style_manager/view/PropertyNumberView.js index d4f9faa42..9cef28277 100644 --- a/src/style_manager/view/PropertyNumberView.js +++ b/src/style_manager/view/PropertyNumberView.js @@ -10,8 +10,7 @@ export default PropertyView.extend({ init() { const model = this.model; - this.listenTo(model, 'change:unit', this.modelValueChanged); - this.listenTo(model, 'el:change', this.elementUpdated); + this.listenTo(model, 'change:unit', this.onValueChange); this.listenTo(model, 'change:units', this.render); }, diff --git a/src/style_manager/view/PropertyView.js b/src/style_manager/view/PropertyView.js index 0a0f20be9..138d52fd6 100644 --- a/src/style_manager/view/PropertyView.js +++ b/src/style_manager/view/PropertyView.js @@ -39,7 +39,7 @@ export default Backbone.View.extend({ events: { change: 'inputValueChanged', - [`click [${clearProp}]`]: 'clear' + [`click [${clearProp}]`]: 'clear', }, initialize(o = {}) { @@ -68,36 +68,28 @@ export default Backbone.View.extend({ } if (em) { - this.listenTo( - em, - `update:component:style:${this.property}`, - this.targetUpdated - ); + this.listenTo(em, `update:component:style:${this.property}`, this.targetUpdated); //this.listenTo(em, `styleable:change:${this.property}`, this.targetUpdated); // Listening to changes of properties in this.requires, so that styleable // changes based on other properties are propagated const requires = model.get('requires') || {}; Object.keys(requires).forEach(property => { - this.listenTo( - em, - `component:styleUpdate:${property}`, - this.targetUpdated - ); + this.listenTo(em, `component:styleUpdate:${property}`, this.targetUpdated); }); } - this.listenTo(this.propTarget, 'update', this.targetUpdated); + // this.listenTo(this.propTarget, 'update', this.targetUpdated); this.listenTo(model, 'destroy remove', this.remove); - this.listenTo(model, 'change:value', this.modelValueChanged); + // this.listenTo(model, 'change:value', this.modelValueChanged); this.listenTo(model, 'targetUpdated', this.targetUpdated); this.listenTo(model, 'change:visible', this.updateVisibility); - this.listenTo(model, 'change:status', this.updateStatus); - this.listenTo( - model, - 'change:name change:className change:full', - this.render - ); + // this.listenTo(model, 'change:status', this.updateStatus); + this.listenTo(model, 'change:name change:className change:full', this.render); + + // this.listenTo(this.propTarget, 'update', this.onValueChange); + this.onValueChange = debounce(this.onValueChange.bind(this)); + this.listenTo(model, 'change:value', this.onValueChange); const init = this.init && this.init.bind(this); init && init(); @@ -105,9 +97,7 @@ export default Backbone.View.extend({ remove() { Backbone.View.prototype.remove.apply(this, arguments); - ['em', 'target', 'input', '$input', 'propTarget', 'sector'].forEach( - i => (this[i] = {}) - ); + ['em', 'target', 'input', '$input', 'propTarget', 'sector'].forEach(i => (this[i] = {})); this.__destroyFn(this._getClbOpts()); }, @@ -118,8 +108,8 @@ export default Backbone.View.extend({ */ updateStatus() { const { model } = this; - const status = model.get('status'); - const parent = model.parent; + // const status = model.get('status'); + // const parent = model.parent; const pfx = this.pfx; const ppfx = this.ppfx; const config = this.config; @@ -131,18 +121,25 @@ export default Backbone.View.extend({ labelEl.removeClass(`${updatedCls} ${computedCls}`); clearStyle.display = 'none'; - switch (status) { - case 'updated': - !parent && labelEl.addClass(updatedCls); - - if (config.clearProperties) { - clearStyle.display = 'inline'; - } - break; - case 'computed': - labelEl.addClass(computedCls); - break; + if (model.hasValue({ noParent: true })) { + labelEl.addClass(updatedCls); + config.clearProperties && (clearStyle.display = ''); + } else if (model.hasValue()) { + labelEl.addClass(computedCls); } + + // switch (status) { + // case 'updated': + // !parent && labelEl.addClass(updatedCls); + + // if (config.clearProperties) { + // clearStyle.display = 'inline'; + // } + // break; + // case 'computed': + // labelEl.addClass(computedCls); + // break; + // } }, /** @@ -150,10 +147,11 @@ export default Backbone.View.extend({ */ clear(ev) { ev && ev.stopPropagation(); - this.model.clearValue(); - this.__unset(); - // Skip one stack with setTimeout to avoid inconsistencies (eg. visible on padding composite clear) - setTimeout(() => this.targetUpdated()); + this.model.clear(); + // this.model.clearValue(); + // this.__unset(); + // // Skip one stack with setTimeout to avoid inconsistencies (eg. visible on padding composite clear) + // setTimeout(() => this.targetUpdated()); }, /** @@ -207,9 +205,11 @@ export default Backbone.View.extend({ */ inputValueChanged(ev) { ev && ev.stopPropagation(); + // Skip the default update in case a custom emit method is defined if (this.emit) return; - this.model.setValueFromInput(this.getInputValue()); - this.elementUpdated(); + this.model.upValue(ev.target.value); + // this.model.setValueFromInput(this.getInputValue()); + // this.elementUpdated(); }, /** @@ -225,7 +225,7 @@ export default Backbone.View.extend({ parent && value == 'updated' && parent.set('status', value); }, - emitUpdateTarget: debounce(function() { + emitUpdateTarget: debounce(function () { const em = this.config.em; em && em.trigger('styleManager:update:target', this.getFirstTarget()); }), @@ -244,11 +244,7 @@ export default Backbone.View.extend({ if (config.highlightChanged) { status = 'updated'; } - } else if ( - computedValue && - config.showComputed && - computedValue != defaultValue - ) { + } else if (computedValue && config.showComputed && computedValue != defaultValue) { value = computedValue; if (config.highlightComputed) { @@ -264,7 +260,7 @@ export default Backbone.View.extend({ status, targetValue, defaultValue, - computedValue + computedValue, }; }, @@ -273,36 +269,30 @@ export default Backbone.View.extend({ * */ targetUpdated(mod, val, opts = {}) { // Skip properties rendered in Stack Layers - if (this.config.fromLayer) return; - - this.emitUpdateTarget(); - - if (!this.checkVisibility()) { - return; - } - - const config = this.config; - const em = config.em; - const { model } = this; - const property = model.get('property'); - const { status, value, ...targetData } = this._getTargetData(); - const data = { - status, - value, - ...targetData - }; - - this.setStatus(status); - model.setValue(value, 0, { fromTarget: 1, ...opts }); - this.__update(value); - - if (em) { - em.trigger('styleManager:change', this, property, value, data); - em.trigger(`styleManager:change:${property}`, this, value, data); - this._emitUpdate(data); - } - - return data; + // if (this.config.fromLayer) return; + // this.emitUpdateTarget(); + // if (!this.checkVisibility()) { + // return; + // } + // const config = this.config; + // const em = config.em; + // const { model } = this; + // const property = model.get('property'); + // const { status, value, ...targetData } = this._getTargetData(); + // const data = { + // status, + // value, + // ...targetData + // }; + // this.setStatus(status); + // model.setValue(value, 0, { fromTarget: 1, ...opts }); + // this.__update(value); + // if (em) { + // em.trigger('styleManager:change', this, property, value, data); + // em.trigger(`styleManager:change:${property}`, this, value, data); + // this._emitUpdate(data); + // } + // return data; }, _emitUpdate(addData = {}) { @@ -326,7 +316,7 @@ export default Backbone.View.extend({ value: model.getFullValue(), property: model, id: model.get('id'), - name: model.get('property') + name: model.get('property'), }; }, @@ -412,6 +402,13 @@ export default Backbone.View.extend({ return input ? input.value : ''; }, + onValueChange(m, val, opt = {}) { + const value = this.model.getFullValue(); + this.setValue(value); + this.updateStatus(); + console.log('onValueChange', this.model.getName(), { value }, opt); + }, + /** * Triggers when the `value` of the model changes, so the target and * the input element should be updated @@ -420,31 +417,28 @@ export default Backbone.View.extend({ * @param {Object} opt Options * */ modelValueChanged(e, val, opt = {}) { - const { model } = this; - const value = model.getFullValue(); - - // Avoid element update if the change comes from it - if (!opt.fromInput) { - this.setValue(value); - } - - // Avoid target update if the changes comes from it - if (!opt.fromTarget) { - this.getTargets().forEach(target => this.__updateTarget(target, opt)); - - // Update the editor and selected components about the change - const { em } = this.config; - if (!em) return; - const prop = model.get('property'); - const updated = { [prop]: value }; - em.getSelectedAll().forEach(component => { - !opt.noEmit && em.trigger('component:update', component, updated, opt); - em.trigger(evStyleUp, component, prop, opt); - em.trigger(`${evStyleUp}:${prop}`, component, value, opt); - component.trigger(`change:style`, component, updated, opt); - component.trigger(`change:style:${prop}`, component, value, opt); - }); - } + // const { model } = this; + // const value = model.getFullValue(); + // // Avoid element update if the change comes from it + // if (!opt.fromInput) { + // this.setValue(value); + // } + // // Avoid target update if the changes comes from it + // if (!opt.fromTarget) { + // this.getTargets().forEach(target => this.__updateTarget(target, opt)); + // // Update the editor and selected components about the change + // const { em } = this.config; + // if (!em) return; + // const prop = model.get('property'); + // const updated = { [prop]: value }; + // em.getSelectedAll().forEach(component => { + // !opt.noEmit && em.trigger('component:update', component, updated, opt); + // em.trigger(evStyleUp, component, prop, opt); + // em.trigger(`${evStyleUp}:${prop}`, component, value, opt); + // component.trigger(`change:style`, component, updated, opt); + // component.trigger(`change:style:${prop}`, component, value, opt); + // }); + // } }, __updateTarget(target, opt = {}) { @@ -534,10 +528,7 @@ export default Backbone.View.extend({ // Check if the property is available only if requested if (toRequire) { - stylable = - !target || - (stylableReq && - (stylableReq.indexOf(id) >= 0 || stylableReq.indexOf(property) >= 0)); + stylable = !target || (stylableReq && (stylableReq.indexOf(id) >= 0 || stylableReq.indexOf(property) >= 0)); } // Check if the property is available based on other property's values @@ -560,8 +551,7 @@ export default Backbone.View.extend({ if (parentEl) { const styles = window.getComputedStyle(parentEl); each(requiresParent, (values, property) => { - stylable = - stylable && styles[property] && includes(values, styles[property]); + stylable = stylable && styles[property] && includes(values, styles[property]); }); } else { stylable = false; @@ -605,11 +595,11 @@ export default Backbone.View.extend({ * @param {String} value The value from the model * */ setValue(value) { - const model = this.model; - let val = isUndefined(value) ? model.getDefaultValue() : value; - if (this.update) return this.__update(val); + const { model } = this; + const result = isUndefined(value) ? model.getDefaultValue() : value; + if (this.update) return this.__update(result); const input = this.getInputEl(); - input && (input.value = val); + input && (input.value = result); }, getInputEl() { @@ -633,8 +623,8 @@ export default Backbone.View.extend({ }, /** - * Clean input - * */ + * @deprecated + */ cleanValue() { this.setValue(''); }, @@ -655,7 +645,7 @@ export default Backbone.View.extend({ update && update({ ...this._getClbOpts(), - value + value, }); }, @@ -664,10 +654,10 @@ export default Backbone.View.extend({ emit && emit(this._getClbOpts(), ...args); }, - __updateStyle(value, { complete, ...opts } = {}) { + __updateStyle(value, { complete, partial, ...opts } = {}) { const { em, model } = this; const prop = model.get('property'); - const final = complete !== false; + const final = complete !== false && partial !== true; if (isObject(value)) { this.getTargets().forEach(target => { @@ -675,7 +665,7 @@ export default Backbone.View.extend({ em && em.trigger(evStyleUp, target, prop, opts); }); } else { - model.setValueFromInput(value, complete, opts); + model.setValueFromInput(value, final, opts); } final && this.elementUpdated(); @@ -698,7 +688,7 @@ export default Backbone.View.extend({ target: this.getFirstTarget(), // Used to update custom UI computed, parentRules, // All parent rules - parentRule // First parent rule containing the same property + parentRule, // First parent rule containing the same property }; }, @@ -706,27 +696,26 @@ export default Backbone.View.extend({ this.clearCached(); const { pfx, model, el, $el } = this; const property = model.get('property'); + const type = model.get('type'); const full = model.get('full'); const cls = model.get('className') || ''; const className = `${pfx}property`; + // Support old integer classname + const clsType = type === 'number' ? `${pfx}${type} ${pfx}integer` : `${pfx}${type}`; this.createdEl && this.__destroyFn(this._getClbOpts()); $el.empty().append(this.template(model)); $el.find('[data-sm-label]').append(this.templateLabel(model)); const create = this.create && this.create.bind(this); this.createdEl = create && create(this._getClbOpts()); - $el - .find('[data-sm-fields]') - .append(this.createdEl || this.templateInput(model)); + $el.find('[data-sm-fields]').append(this.createdEl || this.templateInput(model)); - el.className = `${className} ${pfx}${model.get( - 'type' - )} ${className}__${property} ${cls}`.trim(); + el.className = `${className} ${clsType} ${className}__${property} ${cls}`.trim(); el.className += full ? ` ${className}--full` : ''; - this.updateStatus(); + // this.updateStatus(); const onRender = this.onRender && this.onRender.bind(this); onRender && onRender(); - this.setValue(model.get('value'), { fromTarget: 1 }); - } + // this.setValue(model.get('value'), { fromTarget: 1 }); + }, }); diff --git a/src/style_manager/view/SectorsView.js b/src/style_manager/view/SectorsView.js index 973f05e51..fcf39a4be 100644 --- a/src/style_manager/view/SectorsView.js +++ b/src/style_manager/view/SectorsView.js @@ -1,5 +1,5 @@ import Backbone from 'backbone'; -import { extend, isString, isArray } from 'underscore'; +import { extend, isString, isArray, debounce } from 'underscore'; import { isTaggableNode } from 'utils/mixins'; import { appendAtIndex } from 'utils/dom'; import SectorView from './SectorView'; @@ -30,8 +30,14 @@ export default Backbone.View.extend({ this.listenTo(coll, 'add', this.addTo); this.listenTo(coll, 'reset', this.render); this.listenTo(em, module.events.target, this.targetUpdated); + // Check local/parent value on input change + this.listenTo(em, 'styleable:change', this.emitUpdate); }, + emitUpdate: debounce(function () { + this.propTarget.trigger('update'); + }), + remove() { Backbone.View.prototype.remove.apply(this, arguments); ['target', 'config', 'propTarget'].forEach(i => (this[i] = {})); From f5b37169c9037bf1f46f279c99623419a5029e60 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 30 Dec 2021 21:24:34 +0100 Subject: [PATCH 208/313] Update select property view --- src/style_manager/view/PropertySelectView.js | 11 ++++++--- src/style_manager/view/PropertyView.js | 25 ++++++++++++++++---- src/style_manager/view/SectorsView.js | 6 ++--- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/style_manager/view/PropertySelectView.js b/src/style_manager/view/PropertySelectView.js index 34a84a78b..0955b69b6 100644 --- a/src/style_manager/view/PropertySelectView.js +++ b/src/style_manager/view/PropertySelectView.js @@ -1,8 +1,5 @@ -import Backbone from 'backbone'; import PropertyView from './PropertyView'; -const $ = Backbone.$; - export default PropertyView.extend({ templateInput() { const pfx = this.pfx; @@ -48,4 +45,12 @@ export default PropertyView.extend({ this.input = inputH.firstChild; } }, + + __setValueInput(value) { + const { model } = this; + const input = this.getInputEl(); + const firstOpt = model.getOptions()[0]; + const firstId = firstOpt ? model.getOptionId(firstOpt) : ''; + input && (input.value = value || firstId); + }, }); diff --git a/src/style_manager/view/PropertyView.js b/src/style_manager/view/PropertyView.js index 138d52fd6..194b293d7 100644 --- a/src/style_manager/view/PropertyView.js +++ b/src/style_manager/view/PropertyView.js @@ -87,9 +87,12 @@ export default Backbone.View.extend({ // this.listenTo(model, 'change:status', this.updateStatus); this.listenTo(model, 'change:name change:className change:full', this.render); + // Put a sligh delay on debounce in order to execute the update + // post styleManager.__upProps trigger. + this.onValueChange = debounce(this.onValueChange.bind(this), 10); // this.listenTo(this.propTarget, 'update', this.onValueChange); - this.onValueChange = debounce(this.onValueChange.bind(this)); this.listenTo(model, 'change:value', this.onValueChange); + this.listenTo(em, 'change:device', this.onValueChange); const init = this.init && this.init.bind(this); init && init(); @@ -403,10 +406,18 @@ export default Backbone.View.extend({ }, onValueChange(m, val, opt = {}) { - const value = this.model.getFullValue(); - this.setValue(value); + this.setValue(this.model.getFullValue()); this.updateStatus(); - console.log('onValueChange', this.model.getName(), { value }, opt); + console.log( + 'onValueChange', + this.model.getName(), + { + fullValue: this.model.getFullValue(), + hasValue: this.model.hasValue(), + hasValueLocal: this.model.hasValue({ noParent: true }), + }, + opt + ); }, /** @@ -598,8 +609,12 @@ export default Backbone.View.extend({ const { model } = this; const result = isUndefined(value) ? model.getDefaultValue() : value; if (this.update) return this.__update(result); + this.__setValueInput(result); + }, + + __setValueInput(value) { const input = this.getInputEl(); - input && (input.value = result); + input && (input.value = value); }, getInputEl() { diff --git a/src/style_manager/view/SectorsView.js b/src/style_manager/view/SectorsView.js index fcf39a4be..6586573a1 100644 --- a/src/style_manager/view/SectorsView.js +++ b/src/style_manager/view/SectorsView.js @@ -29,9 +29,9 @@ export default Backbone.View.extend({ const coll = this.collection; this.listenTo(coll, 'add', this.addTo); this.listenTo(coll, 'reset', this.render); - this.listenTo(em, module.events.target, this.targetUpdated); - // Check local/parent value on input change - this.listenTo(em, 'styleable:change', this.emitUpdate); + // this.listenTo(em, module.events.target, this.targetUpdated); + // // Check local/parent value on input change + // this.listenTo(em, 'styleable:change', this.emitUpdate); }, emitUpdate: debounce(function () { From 6feacd43d22dad5f44f0c164b465514f4d4fd7f2 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 00:34:33 +0100 Subject: [PATCH 209/313] Update property slide view --- src/style_manager/view/PropertySliderView.js | 23 ++++++-------------- src/style_manager/view/PropertyView.js | 2 +- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/style_manager/view/PropertySliderView.js b/src/style_manager/view/PropertySliderView.js index 9d681b2f6..42decfe6f 100644 --- a/src/style_manager/view/PropertySliderView.js +++ b/src/style_manager/view/PropertySliderView.js @@ -11,13 +11,10 @@ export default Property.extend({ }, templateInput(model) { - const ppfx = this.ppfx; + const { ppfx } = this; return `
- +
`; }, @@ -31,23 +28,17 @@ export default Property.extend({ }, inputValueChanged() { - const model = this.model; - const step = model.get('step'); - this.getInputEl().value = this.getSliderEl().value; - const value = this.getInputValue() - step; - model.set('value', value, { avoidStore: 1 }).set('value', value + step); - this.elementUpdated(); + this.model.upValue(this.getSliderEl().value); }, inputValueChangedSoft() { - this.getInputEl().value = this.getSliderEl().value; - this.model.set('value', this.getInputValue(), { avoidStore: 1 }); - this.elementUpdated(); + this.model.upValue(this.getSliderEl().value, { partial: true }); }, setValue(value) { - const parsed = this.model.parseValue(value); - this.getSliderEl().value = parseFloat(parsed.value); + const { model } = this; + const parsed = model.parseValue(value); + this.getSliderEl().value = value === '' ? model.getDefaultValue() : parseFloat(parsed.value); Property.prototype.setValue.apply(this, arguments); }, diff --git a/src/style_manager/view/PropertyView.js b/src/style_manager/view/PropertyView.js index 194b293d7..6328ce538 100644 --- a/src/style_manager/view/PropertyView.js +++ b/src/style_manager/view/PropertyView.js @@ -25,7 +25,7 @@ export default Backbone.View.extend({ ${label} - ${!parent ? `⨯` : ''} + ${!parent ? `` : ''} `; }, From 5a4aa9b6ff42c78953793fb26961274670637591 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 01:20:47 +0100 Subject: [PATCH 210/313] Update property composite view --- src/style_manager/model/Property.js | 7 +- src/style_manager/model/PropertyComposite.js | 2 +- src/style_manager/model/PropertyStack.js | 1 - src/style_manager/view/PropertiesView.js | 6 +- .../view/PropertyCompositeView.js | 126 +++--------------- 5 files changed, 24 insertions(+), 118 deletions(-) diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 8c58ffe79..002a10889 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -23,16 +23,15 @@ export default class Property extends Model { Property.callInit(this, props, opts); } - __hasCustom() { - return !!this.em?.get('StyleManager').getConfig().custom; - } + // __hasCustom() { + // return !!this.em?.get('StyleManager').getConfig().custom; + // } __getParentProp() { return this.collection?.opts?.parentProp; } __upTargets(p, opts = {}) { - // if (!this.__hasCustom()) return; const { em } = this; const sm = em.get('StyleManager'); const name = this.getName(); diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index e236ccb85..fb57bcc6c 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -112,7 +112,7 @@ export default class PropertyComposite extends Property { } __upProperties(p, opts = {}) { - if (!this.__hasCustom() || opts.__up || opts.__clearIn) return; + if (opts.__up || opts.__clearIn) return; const parentProp = this.__getParentProp(); if (parentProp) return parentProp.__upProperties(this, opts); diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index bdb987fe3..460f773d6 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -252,7 +252,6 @@ export default class PropertyStack extends PropertyComposite { } __upSelected({ noEvent } = {}, opts = {}) { - if (!this.__hasCustom()) return; const sm = this.em.get('StyleManager'); const selected = this.getSelectedLayer(); const values = selected?.getValues(); diff --git a/src/style_manager/view/PropertiesView.js b/src/style_manager/view/PropertiesView.js index 7014d62a8..1b12f5052 100644 --- a/src/style_manager/view/PropertiesView.js +++ b/src/style_manager/view/PropertiesView.js @@ -30,7 +30,7 @@ export default Backbone.View.extend({ propTarget: this.propTarget, onChange: this.onChange, onInputRender: this.onInputRender, - config: this.config + config: this.config, }); if (model.get('type') != 'composite') { @@ -49,7 +49,7 @@ export default Backbone.View.extend({ const { $el } = this; this.clearItems(); const fragment = document.createDocumentFragment(); - this.collection.each(model => this.add(model, fragment)); + this.collection.forEach(model => this.add(model, fragment)); $el.empty(); $el.append(fragment); $el.attr('class', `${this.pfx}properties`); @@ -64,5 +64,5 @@ export default Backbone.View.extend({ clearItems() { this.properties.forEach(item => item.remove()); this.properties = []; - } + }, }); diff --git a/src/style_manager/view/PropertyCompositeView.js b/src/style_manager/view/PropertyCompositeView.js index fa49d312b..beee5a9c4 100644 --- a/src/style_manager/view/PropertyCompositeView.js +++ b/src/style_manager/view/PropertyCompositeView.js @@ -1,11 +1,9 @@ -import Backbone from 'backbone'; import PropertyView from './PropertyView'; - -const $ = Backbone.$; +import PropertiesView from './PropertiesView'; export default PropertyView.extend({ templateInput() { - const pfx = this.pfx; + const { pfx } = this; return `
@@ -14,124 +12,34 @@ export default PropertyView.extend({ }, inputValueChanged(...args) { - // If it's not detached (eg. 'padding: 1px 2px 3px 4px;') it will follow - // the same flow of PropertyView - if (!this.model.get('detached')) { + // If it's not detached (eg. 'padding: 1px 2px 3px 4px;') it will follow the same flow of the PropertyView + if (!this.model.isDetached()) { PropertyView.prototype.inputValueChanged.apply(this, args); } }, - clear(e) { - const props = this.properties; - props && props.forEach(propView => propView.clear()); - PropertyView.prototype.clear.apply(this, arguments); - }, - remove() { - this.model.get('properties').reset(); + this.props?.remove(); PropertyView.prototype.remove.apply(this, arguments); - ['properties', 'props', '$props'].forEach(i => (this[i] = {})); }, - /** - * Renders input - * */ onRender() { - var model = this.model; - var props = model.get('properties') || []; - var self = this; - this.properties = []; - - if (props.length) { - if (!this.$input) { - this.$input = $(''); - this.input = this.$input.get(0); - } - - if (!this.props) { - this.props = model.get('properties'); - } - - if (!this.$props) { - //Not yet supported nested composite - this.props.each(function(prop, index) { - if (prop && prop.get('type') == 'composite') { - this.props.remove(prop); - console.warn('Nested composite types not yet allowed.'); - } - prop.parent = model; - }, this); - - var PropertiesView = require('./PropertiesView').default; - var propsView = new PropertiesView(this.getPropsConfig()); - this.$props = propsView.render().$el; - this.properties = propsView.properties; - this.$el.find(`#${this.pfx}input-holder`).append(this.$props); - } + const { model, pfx } = this; + const props = model.getProperties(); + + if (props.length && !this.props) { + const propsView = new PropertiesView({ + config: { ...this.config, highlightComputed: 0 }, + collection: props, + }); + propsView.render(); + this.$el.find(`#${pfx}input-holder`).append(propsView.el); + this.props = propsView; } }, - /** - * Returns configurations that should be past to properties - * @param {Object} opts - * @return {Object} - */ - getPropsConfig(opts) { - var that = this; - const model = this.model; - - var result = { - config: { ...this.config, highlightComputed: 0 }, - collection: this.props, - target: this.target, - propTarget: this.propTarget, - // On any change made to children I need to update composite value - onChange(el, view, opts) { - model.set('value', model.getFullValue(), opts); - }, - // Each child property will receive a full composite string, eg. '0px 0px 10px 0px' - // I need to extract from that string the corresponding one to that property. - customValue(property, mIndex) { - return that.valueOnIndex(mIndex, property); - } - }; - - // If detached let follow its standard flow - if (model.get('detached')) { - delete result.onChange; - } - - return result; - }, - - /** - * Extract string from composite value - * @param {number} index Index - * @param {Object} view Property view - * @return {string} - * */ - valueOnIndex(index, view) { - let value; - const targetValue = this.getTargetValue({ ignoreDefault: 1 }); - - // If the target value of the composite is not empty I'll fetch - // the corresponding value from the requested index, otherwise try - // to get the value of the sub-property - if (targetValue) { - const values = targetValue.split(this.model.getSplitSeparator()); - value = values[index]; - } else { - value = - view && view.getTargetValue({ ignoreCustomValue: 1, ignoreDefault: 1 }); - } - - return value; - }, - clearCached() { PropertyView.prototype.clearCached.apply(this, arguments); - this.$input = null; this.props = null; - this.$props = null; - } + }, }); From 927fa85b10f8c79b708fe200d95afec70280069c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 01:52:33 +0100 Subject: [PATCH 211/313] Handle updateStatus for composite view --- src/style_manager/config/config.js | 18 ++++++++----- src/style_manager/view/PropertiesView.js | 3 +++ .../view/PropertyCompositeView.js | 8 +++++- src/style_manager/view/PropertyView.js | 25 ++++--------------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/style_manager/config/config.js b/src/style_manager/config/config.js index 0ccc9f26a..68452d8a2 100644 --- a/src/style_manager/config/config.js +++ b/src/style_manager/config/config.js @@ -57,29 +57,35 @@ export default { // With the empty value, nothing will be rendered appendTo: '', + // Style prefix + stylePrefix: 'sm-', + + // Avoid rendering the default style manager. + custom: false, + // Hide the property in case it's not stylable for the // selected component (each component has 'stylable' property) + // @deprecated hideNotStylable: true, // Highlight changed properties of the selected component + // @deprecated highlightChanged: true, // Highlight computed properties of the selected component + // @deprecated highlightComputed: true, // Show computed properties of the selected component, if this value // is set to false, highlightComputed will not take effect + // @deprecated showComputed: true, // Adds the possibility to clear property value from the target style + // @deprecated clearProperties: true, // Properties not to take in account for computed styles + // @deprecated avoidComputed: ['width', 'height'], - - // Style prefix - stylePrefix: 'sm-', - - // Avoid rendering the default style manager. - custom: false, }; diff --git a/src/style_manager/view/PropertiesView.js b/src/style_manager/view/PropertiesView.js index 1b12f5052..1e11b0a50 100644 --- a/src/style_manager/view/PropertiesView.js +++ b/src/style_manager/view/PropertiesView.js @@ -11,6 +11,7 @@ export default Backbone.View.extend({ this.onInputRender = o.onInputRender || {}; this.customValue = o.customValue || {}; this.properties = []; + this.parent = o.parent; const coll = this.collection; this.listenTo(coll, 'add', this.addTo); this.listenTo(coll, 'reset', this.render); @@ -21,6 +22,7 @@ export default Backbone.View.extend({ }, add(model, frag, opts = {}) { + const { parent } = this; const appendTo = frag || this.el; const view = new model.typeView({ model, @@ -32,6 +34,7 @@ export default Backbone.View.extend({ onInputRender: this.onInputRender, config: this.config, }); + parent && (view.parent = parent); if (model.get('type') != 'composite') { view.customValue = this.customValue; diff --git a/src/style_manager/view/PropertyCompositeView.js b/src/style_manager/view/PropertyCompositeView.js index beee5a9c4..6daee521c 100644 --- a/src/style_manager/view/PropertyCompositeView.js +++ b/src/style_manager/view/PropertyCompositeView.js @@ -28,9 +28,15 @@ export default PropertyView.extend({ const props = model.getProperties(); if (props.length && !this.props) { + const detached = model.isDetached(); const propsView = new PropertiesView({ - config: { ...this.config, highlightComputed: 0 }, + config: { + ...this.config, + highlightComputed: detached, + highlightChanged: detached, + }, collection: props, + parent: this, }); propsView.render(); this.$el.find(`#${pfx}input-holder`).append(propsView.el); diff --git a/src/style_manager/view/PropertyView.js b/src/style_manager/view/PropertyView.js index 6328ce538..542b75788 100644 --- a/src/style_manager/view/PropertyView.js +++ b/src/style_manager/view/PropertyView.js @@ -90,6 +90,7 @@ export default Backbone.View.extend({ // Put a sligh delay on debounce in order to execute the update // post styleManager.__upProps trigger. this.onValueChange = debounce(this.onValueChange.bind(this), 10); + this.updateStatus = debounce(this.updateStatus.bind(this)); // this.listenTo(this.propTarget, 'update', this.onValueChange); this.listenTo(model, 'change:value', this.onValueChange); this.listenTo(em, 'change:device', this.onValueChange); @@ -110,12 +111,7 @@ export default Backbone.View.extend({ * @private */ updateStatus() { - const { model } = this; - // const status = model.get('status'); - // const parent = model.parent; - const pfx = this.pfx; - const ppfx = this.ppfx; - const config = this.config; + const { model, pfx, ppfx, config } = this; const updatedCls = `${ppfx}four-color`; const computedCls = `${ppfx}color-warn`; const labelEl = this.$el.children(`.${pfx}label`); @@ -124,25 +120,14 @@ export default Backbone.View.extend({ labelEl.removeClass(`${updatedCls} ${computedCls}`); clearStyle.display = 'none'; - if (model.hasValue({ noParent: true })) { + if (model.hasValue({ noParent: true }) && config.highlightChanged) { labelEl.addClass(updatedCls); config.clearProperties && (clearStyle.display = ''); - } else if (model.hasValue()) { + } else if (model.hasValue() && config.highlightComputed) { labelEl.addClass(computedCls); } - // switch (status) { - // case 'updated': - // !parent && labelEl.addClass(updatedCls); - - // if (config.clearProperties) { - // clearStyle.display = 'inline'; - // } - // break; - // case 'computed': - // labelEl.addClass(computedCls); - // break; - // } + this.parent?.updateStatus(); }, /** From 30dd04f9cb58b740268e78048c984821c47c7c14 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 02:23:00 +0100 Subject: [PATCH 212/313] Fix Composite clear --- src/style_manager/model/PropertyComposite.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index fb57bcc6c..594aa22d0 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -129,6 +129,11 @@ export default class PropertyComposite extends Property { } this.__upTargetsStyle(style, opts); + + // Keep track of the values for the not detached properties, + // otherwise clear() will not trigger changes. + // TODO: maybe to move this logic in sm.__upProp + !this.isDetached() && this.set('value', style[this.getName()], { silent: true }); } _up(props, opts = {}) { From 74295613c87f1cad6a86ff236028a84bdc14ce11 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 02:47:30 +0100 Subject: [PATCH 213/313] Fix composite for detached --- src/style_manager/index.js | 4 ++-- src/style_manager/model/PropertyComposite.js | 17 +++++++++++------ src/style_manager/view/PropertyView.js | 20 ++++++++++---------- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index ae79ed9dc..da307339b 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -691,10 +691,10 @@ export default () => { // Detached has to be treathed as separate properties if (prop.isDetached()) { - const newStyle = prop.__getPropsFromStyle(style) || {}; + const newStyle = prop.__getPropsFromStyle(style, { byName: true }) || {}; const newParentStyles = parentStyles.map(p => ({ ...p, - style: prop.__getPropsFromStyle(p.style) || {}, + style: prop.__getPropsFromStyle(p.style, { byName: true }) || {}, })); props.map(pr => this.__upProp(pr, newStyle, newParentStyles, opts)); } else { diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 594aa22d0..bb688c279 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -1,6 +1,8 @@ import { isString, isUndefined } from 'underscore'; import Property from './Property'; +const isNumberType = type => type === 'integer' || type === 'number'; + /** * @typedef PropertyComposite * @property {Array} properties Array of sub properties, eg. `[{ type: 'number', property: 'margin-top' }, ...]` @@ -226,9 +228,9 @@ export default class PropertyComposite extends Property { return this.__splitValue(style[name] || '', sep); } - __getSplitValue(value = '') { + __getSplitValue(value = '', { byName } = {}) { const props = this.getProperties(); - const props4Nums = props.length === 4 && props.every(prop => prop.getType() === 'integer'); + const props4Nums = props.length === 4 && props.every(prop => isNumberType(prop.getType())); const values = this.__splitValue(value, this.getSplitSeparator()); const result = {}; @@ -244,15 +246,17 @@ export default class PropertyComposite extends Property { res = values[i] || values[(i % len) + (len != 1 && len % 2 ? 1 : 0)] || res; } - result[prop.getId()] = res || ''; + const key = byName ? prop.getName() : prop.getId(); + result[key] = res || ''; }); return result; } - __getPropsFromStyle(style = {}) { + __getPropsFromStyle(style = {}, opts = {}) { if (!this.__styleHasProps(style)) return null; + const { byName } = opts; const props = this.getProperties(); const sep = this.getSplitSeparator(); const fromStyle = this.get('fromStyle'); @@ -260,12 +264,13 @@ export default class PropertyComposite extends Property { if (!fromStyle) { // Get props from the main property - result = this.__getSplitValue(style[this.getName()] || ''); + result = this.__getSplitValue(style[this.getName()] || '', { byName }); // Get props from the inner properties props.forEach(prop => { const value = style[prop.getName()]; - if (!isUndefined(value) && value !== '') result[prop.getId()] = value; + const key = byName ? prop.getName() : prop.getId(); + if (!isUndefined(value) && value !== '') result[key] = value; }); } diff --git a/src/style_manager/view/PropertyView.js b/src/style_manager/view/PropertyView.js index 542b75788..ccb0c6253 100644 --- a/src/style_manager/view/PropertyView.js +++ b/src/style_manager/view/PropertyView.js @@ -393,16 +393,16 @@ export default Backbone.View.extend({ onValueChange(m, val, opt = {}) { this.setValue(this.model.getFullValue()); this.updateStatus(); - console.log( - 'onValueChange', - this.model.getName(), - { - fullValue: this.model.getFullValue(), - hasValue: this.model.hasValue(), - hasValueLocal: this.model.hasValue({ noParent: true }), - }, - opt - ); + // console.log( + // 'onValueChange', + // this.model.getName(), + // { + // fullValue: this.model.getFullValue(), + // hasValue: this.model.hasValue(), + // hasValueLocal: this.model.hasValue({ noParent: true }), + // }, + // opt + // ); }, /** From 0b25829a511d6124f8225e70ea7ba14f727bb0c9 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 11:44:16 +0100 Subject: [PATCH 214/313] Start updating stack view --- src/style_manager/view/LayerView.js | 140 ++------ src/style_manager/view/LayersView.js | 18 +- src/style_manager/view/PropertyStackView.js | 374 +++----------------- 3 files changed, 90 insertions(+), 442 deletions(-) diff --git a/src/style_manager/view/LayerView.js b/src/style_manager/view/LayerView.js index 4edbbabc2..707bd9598 100644 --- a/src/style_manager/view/LayerView.js +++ b/src/style_manager/view/LayerView.js @@ -1,24 +1,21 @@ -import { isString, each } from 'underscore'; -import Backbone from 'backbone'; -import PropertiesView from './PropertiesView'; +import { View } from 'backbone'; -export default Backbone.View.extend({ +export default View.extend({ events: { click: 'active', 'click [data-close-layer]': 'removeItem', 'mousedown [data-move-layer]': 'initSorter', - 'touchstart [data-move-layer]': 'initSorter' + 'touchstart [data-move-layer]': 'initSorter', }, - template(model) { - const { pfx, ppfx, em } = this; - const label = `${em && em.t('styleManager.layer')} ${model.get('index')}`; + template() { + const { pfx, ppfx } = this; return `
-
${label}
+
@@ -31,18 +28,19 @@ export default Backbone.View.extend({ }, initialize(o = {}) { - let model = this.model; + const { model } = this; this.stackModel = o.stackModel; + this.propertyView = o.propertyView; this.config = o.config || {}; this.em = this.config.em; this.pfx = this.config.stylePrefix || ''; this.ppfx = this.config.pStylePrefix || ''; this.sorter = o.sorter || null; this.propsConfig = o.propsConfig || {}; - this.customPreview = o.onPreview; + this.pModel = this.propertyView.model; this.listenTo(model, 'destroy remove', this.remove); this.listenTo(model, 'change:active', this.updateVisibility); - this.listenTo(model.get('properties'), 'change', this.updatePreview); + this.listenTo(model, 'change:values', this.updateLabel); // For the sorter model.view = this; @@ -63,76 +61,9 @@ export default Backbone.View.extend({ this.remove(); }, - remove(opts = {}) { - const { model, props } = this; - const coll = model.collection; - const stackModel = this.stackModel; - - Backbone.View.prototype.remove.apply(this, arguments); - coll && coll.contains(model) && coll.remove(model); - - if (stackModel && stackModel.set) { - stackModel.set({ stackIndex: null }, { silent: true }); - !opts.fromTarget && stackModel.trigger('updateValue'); - } - - props && props.remove(); - }, - - /** - * Default method for changing preview box - * @param {Collection} props - * @param {Element} $el - */ - onPreview(value) { - const { stackModel } = this; - const detach = stackModel && stackModel.get('detached'); - const values = value.split(' '); - const lim = 3; - const result = []; - const resultObj = {}; - - this.model.get('properties').each((prop, index) => { - const property = prop.get('property'); - let value = detach ? prop.getFullValue() : values[index] || ''; - - if (value) { - if (prop.get('type') == 'integer') { - let valueInt = parseInt(value, 10); - let unit = value.replace(valueInt, ''); - valueInt = !isNaN(valueInt) ? valueInt : 0; - valueInt = valueInt > lim ? lim : valueInt; - valueInt = valueInt < -lim ? -lim : valueInt; - value = valueInt + unit; - } - } - - result.push(value); - resultObj[property] = value; - }); - - return detach ? resultObj : result.join(' '); - }, - - updatePreview() { - const stackModel = this.stackModel; - const customPreview = this.customPreview; - const previewEl = this.getPreviewEl(); - const value = this.model.getFullValue(); - const preview = customPreview - ? customPreview(value) - : this.onPreview(value); - - if (preview && stackModel && previewEl) { - const { style } = previewEl; - if (isString(preview)) { - style[stackModel.get('property')] = preview; - } else { - let prvStr = []; - each(preview, (val, prop) => prvStr.push(`${prop}:${val}`)); - previewEl.setAttribute('style', prvStr.join(';')); - } - } + remove() { + this.pModel.removeLayer(this.model); + View.prototype.remove.apply(this, arguments); }, getPropertiesWrapper() { @@ -149,40 +80,43 @@ export default Backbone.View.extend({ return this.previewEl; }, + getLabelEl() { + if (!this.labelEl) { + this.labelEl = this.el.querySelector('[data-label]'); + } + return this.labelEl; + }, + active() { - const model = this.model; - const collection = model.collection; - collection.active(collection.indexOf(model)); + const { model, propertyView } = this; + const pm = propertyView.model; + if (pm.getSelectedLayer() === model) return; + pm.selectLayer(model); + model.collection.active(model.getIndex()); }, updateVisibility() { - const pfx = this.pfx; + const { pfx, model, propertyView } = this; const wrapEl = this.getPropertiesWrapper(); - const active = this.model.get('active'); + const active = model.get('active'); wrapEl.style.display = active ? '' : 'none'; this.$el[active ? 'addClass' : 'removeClass'](`${pfx}active`); + active && wrapEl.appendChild(propertyView.props.el); + }, + + updateLabel() { + const { model, propertyView } = this; + const label = propertyView.model.getLayerLabel(model); + this.getLabelEl().innerHTML = label; }, render() { - const propsConfig = this.propsConfig; const { model, el, pfx } = this; const preview = model.get('preview'); - const properties = new PropertiesView({ - collection: model.get('properties'), - config: { ...this.config, fromLayer: 1 }, - target: propsConfig.target, - customValue: propsConfig.customValue, - propTarget: propsConfig.propTarget, - onChange: propsConfig.onChange - }); - const propsEl = properties.render().el; - - el.innerHTML = this.template(model); + el.innerHTML = this.template(); el.className = `${pfx}layer${!preview ? ` ${pfx}no-preview` : ''}`; - this.props = properties; - this.getPropertiesWrapper().appendChild(propsEl); + this.updateLabel(); this.updateVisibility(); - this.updatePreview(); return this; - } + }, }); diff --git a/src/style_manager/view/LayersView.js b/src/style_manager/view/LayersView.js index 17935deef..9d33ed41f 100644 --- a/src/style_manager/view/LayersView.js +++ b/src/style_manager/view/LayersView.js @@ -5,6 +5,7 @@ export default Backbone.View.extend({ initialize(o) { this.config = o.config || {}; this.stackModel = o.stackModel; + this.propertyView = o.propertyView; this.preview = o.preview; this.pfx = this.config.stylePrefix || ''; this.ppfx = this.config.pStylePrefix || ''; @@ -27,7 +28,7 @@ export default Backbone.View.extend({ ignoreViewChildren: 1, containerSel: `.${pfx}layers`, itemSel: `.${pfx}layer`, - pfx: this.config.pStylePrefix + pfx: this.config.pStylePrefix, }) : ''; @@ -58,8 +59,8 @@ export default Backbone.View.extend({ * */ addToCollection(model, fragmentEl, index) { var fragment = fragmentEl || null; + const { propertyView, config } = this; const stackModel = this.stackModel; - const config = this.config; const sorter = this.sorter; const propsConfig = this.propsConfig; @@ -72,7 +73,8 @@ export default Backbone.View.extend({ config, sorter, stackModel, - propsConfig + propsConfig, + propertyView, }); const rendered = view.render().el; this.items.push(view); @@ -91,11 +93,7 @@ export default Backbone.View.extend({ // In case the added is new in the collection index will be -1 if (index < 0) { this.$el.append(rendered); - } else - this.$el - .children() - .eq(index) - [method](rendered); + } else this.$el.children().eq(index)[method](rendered); } else this.$el.append(rendered); } @@ -120,7 +118,7 @@ export default Backbone.View.extend({ var fragment = document.createDocumentFragment(); this.$el.empty(); - this.collection.each(function(model) { + this.collection.each(function (model) { this.addToCollection(model, fragment); }, this); @@ -140,5 +138,5 @@ export default Backbone.View.extend({ clearItems(opts) { this.items.forEach(item => item.remove(opts)); this.items = []; - } + }, }); diff --git a/src/style_manager/view/PropertyStackView.js b/src/style_manager/view/PropertyStackView.js index 446f7140a..2a6aad4a0 100644 --- a/src/style_manager/view/PropertyStackView.js +++ b/src/style_manager/view/PropertyStackView.js @@ -1,14 +1,18 @@ -import { isUndefined, keys } from 'underscore'; import PropertyCompositeView from './PropertyCompositeView'; +import PropertiesView from './PropertiesView'; import LayersView from './LayersView'; -import CssGenerator from 'code_manager/model/CssGenerator'; - -const cssGen = new CssGenerator(); export default PropertyCompositeView.extend({ + events() { + return { + ...PropertyCompositeView.prototype.events, + 'click [data-add-layer]': 'addLayer', + change: '', + }; + }, + templateInput() { - const pfx = this.pfx; - const ppfx = this.ppfx; + const { pfx } = this; return `
@@ -17,109 +21,10 @@ export default PropertyCompositeView.extend({ `; }, - init() { - const model = this.model; - const pfx = this.pfx; - model.set('stackIndex', null); - this.events[`click [data-add-layer]`] = 'addLayer'; - this.listenTo(model, 'change:stackIndex', this.indexChanged); - this.listenTo(model, 'updateValue', this.inputValueChanged); - this.delegateEvents(); - - const propsConfig = this.getPropsConfig(); - this.layers = new LayersView({ - collection: this.getLayers(), - stackModel: model, - preview: model.get('preview'), - config: this.config, - propsConfig - }); - // For detached properties, used in inputValueChanged (eg. clear all) - const PropertiesView = require('./PropertiesView').default; - this.propsView = new PropertiesView({ - target: this.target, - collection: model.get('properties'), - stackModel: model, - config: this.config, - onChange: propsConfig.onChange, - propTarget: propsConfig.propTarget - }); - }, - - /** - * Fired when the target is updated. - * With detached mode the component will be always empty as its value - * so we gonna check all props and find if it has any difference - * */ - targetUpdated(...args) { - let data; - if (!this.model.get('detached')) { - data = PropertyCompositeView.prototype.targetUpdated.apply(this, args); - } else { - data = this._getTargetData(); - this.setStatus(data.status); - this.checkVisibility(); - } - - // I have to wait the update of inner properites (like visibility) - // before render layers - setTimeout(() => this.refreshLayers(data)); - }, - - /** - * Returns the collection of layers - * @return {Collection} - */ - getLayers() { - return this.model.get('layers'); - }, - - /** - * Triggered when another layer has been selected. - * This allow to move all rendered properties to a new - * selected layer - * @param {Event} - * - * @return {Object} - * */ - indexChanged(e) { - const model = this.model; - this.getLayers().active(model.get('stackIndex')); - }, + init() {}, addLayer() { - const model = this.model; - const layers = this.getLayers(); - const prepend = model.get('prepend'); - const properties = model.get('properties').deepClone(); - properties.each(property => property.set('value', '')); - const layer = layers.add( - { properties }, - { - active: 1, - ...(prepend && { at: 0 }) - } - ); - - // In detached mode inputValueChanged will add new 'layer value' - // to all subprops - this.inputValueChanged({ up: 1 }); - - // This will set subprops with a new default values - model.set('stackIndex', layers.indexOf(layer)); - }, - - inputValueChanged(opts = {}) { - const model = this.model; - opts.up && this.elementUpdated(); - - // If not detached I'll just put all the values from layers to property - // eg. background: layer1Value, layer2Value, layer3Value, ... - if (!model.get('detached')) { - model.set('value', this.getLayerValues()); - } else { - model.get('properties').each(prop => prop.trigger('change:value')); - } + this.model.addLayer({}, { at: 0 }); }, /** @@ -129,232 +34,43 @@ export default PropertyCompositeView.extend({ */ setValue() {}, - /** - * Create value by layers - * @return string - * */ - getLayerValues() { - return this.getLayers().getFullValue(); - }, - - _getClassRule(opts = {}) { - const { em } = this; - const { skipAdd = 1 } = opts; - const selected = em.getSelected(); - const targetAlt = em.get('StyleManager').getModelToStyle(selected, { - skipAdd, - useClasses: 1 - }); - return targetAlt !== selected && targetAlt; - }, - - /** - * Return the parent style rule of the passed one - * @private - */ - _getParentTarget(target, opts = {}) { - const { em, model } = this; - const property = model.get('property'); - const isValid = opts.isValid || (rule => rule.getStyle()[property]); - const targetsDevice = em - .get('CssComposer') - .getAll() - .filter(rule => rule.selectorsToString() === target.getSelectorsString()); - const map = targetsDevice.reduce((acc, rule) => { - acc[rule.getAtRule()] = rule; - return acc; - }, {}); - const mapSorted = cssGen.sortMediaObject(map); - const sortedRules = mapSorted.map(item => item.value); - const currIndex = sortedRules.indexOf(target); - const rulesToCheck = sortedRules.splice(0, currIndex); - let result; - - for (let i = rulesToCheck.length - 1; i > -1; i--) { - const rule = rulesToCheck[i]; - if (isValid(rule)) { - // only for not detached - result = rule; - break; - } - } - - return result; + remove() { + this.layersView?.remove(); + PropertyCompositeView.prototype.remove.apply(this, arguments); }, - /** - * Refresh layers - * */ - refreshLayers(opts = {}) { - let layersObj = []; - const { model, em } = this; - const layers = this.getLayers(); - const detached = model.get('detached'); - const property = model.get('property'); - const target = this.getFirstTarget(); - const valueComput = this.getComputedValue(); - const selected = em.getSelected(); - const updateOpts = { fromTarget: 1 }; - let resultValue, - style, - targetAlt, - targetAltDevice, - valueTargetAlt, - valueTrgAltDvc; - - // With detached layers values will be assigned to their properties - if (detached) { - style = opts.targetValue || {}; - const hasDetachedStyle = rule => { - const name = model - .get('properties') - .at(0) - .get('property'); - return rule && !isUndefined(rule.getStyle()[name]); - }; - - // If the style object is empty but the target has a computed value, - // that means the style might exist in some other place - if (!keys(style).length && valueComput && selected) { - // Styles of the same target but with a higher rule - const parentOpts = { isValid: rule => hasDetachedStyle(rule) }; - targetAltDevice = this._getParentTarget(target, parentOpts); - - if (targetAltDevice) { - style = targetAltDevice.getStyle(); - } else { - // The target is a component but the style is in the class rules - targetAlt = this._getClassRule(); - valueTargetAlt = hasDetachedStyle(targetAlt) && targetAlt.getStyle(); - targetAltDevice = - !valueTargetAlt && - this._getParentTarget( - this._getClassRule({ skipAdd: 0 }), - parentOpts - ); - valueTrgAltDvc = - hasDetachedStyle(targetAltDevice) && targetAltDevice.getStyle(); - style = valueTargetAlt || valueTrgAltDvc || {}; - } - } - - resultValue = style; - layersObj = layers.getLayersFromStyle(style); - } else { - const valueTrg = this.getTargetValue({ ignoreDefault: 1 }); - let value = valueTrg; - - // Try to check if the style is in another rule - if (!value && valueComput) { - // Styles of the same target but with a higher rule - targetAltDevice = this._getParentTarget(target); - - if (targetAltDevice) { - value = targetAltDevice.getStyle()[property]; - } else { - // Computed value is not always reliable due to the browser's CSSOM parser - // here we try to look for the style in class rules - targetAlt = this._getClassRule(); - valueTargetAlt = targetAlt && targetAlt.getStyle()[property]; - targetAltDevice = - !valueTargetAlt && - this._getParentTarget(this._getClassRule({ skipAdd: 0 })); - valueTrgAltDvc = - targetAltDevice && targetAltDevice.getStyle()[property]; - value = valueTargetAlt || valueTrgAltDvc || valueComput; - } - } - - value = value == model.getDefaultValue() ? '' : value; - resultValue = value; - layersObj = layers.getLayersFromValue(value); - } - - const toAdd = - model.getLayersFromTarget(target, { resultValue, layersObj }) || - layersObj; - layers.reset(null, updateOpts); - layers.add(toAdd, updateOpts); - model.set({ stackIndex: null }, { silent: true }); + clearCached() { + PropertyCompositeView.prototype.clearCached.apply(this, arguments); + this.layersView = null; }, - getTargetValue(opts = {}) { - const { model } = this; - const { detached } = model.attributes; - const target = this.getFirstTarget(); - let result = PropertyCompositeView.prototype.getTargetValue.call( - this, - opts - ); - - // It might happen that the browser split properties on CSSOM parse - if (isUndefined(result) && !detached) { - result = model.getValueFromStyle(target.getStyle()); - } else if (detached) { - result = model.getValueFromTarget(target); + onRender() { + const { model, el } = this; + const props = model.getProperties(); + + if (props.length && !this.props) { + const propsView = new PropertiesView({ + config: { + ...this.config, + highlightComputed: false, + highlightChanged: false, + }, + collection: props, + parent: this, + }); + propsView.render(); + + const layersView = new LayersView({ + collection: model.getLayers(), + config: this.config, + propertyView: this, + }); + layersView.render(); + + const fieldEl = el.querySelector('[data-layers-wrapper]'); + fieldEl.appendChild(layersView.el); + this.props = propsView; + this.layersView = layersView; } - - return result; - }, - - getPropsConfig() { - const self = this; - const { model } = self; - - return { - target: self.target, - propTarget: self.propTarget, - - // Things to do when a single sub-property is changed - onChange(el, view, opt) { - const subModel = view.model; - const status = model.get('status'); - - if (model.get('detached')) { - const subProp = subModel.get('property'); - const defVal = subModel.getDefaultValue(); - const layers = self.getLayers(); - const values = layers.getPropertyValues(subProp, defVal); - view.updateTargetStyle(values, null, opt); - // Update also the target with values of special hidden properties. - // This fixes the case of update with computed layers - if ( - subProp == 'background-image' && - !opt.avoidStore && - status == 'computed' - ) { - model - .get('properties') - .filter(prop => prop.get('property').substr(0, 2) == '__') - .forEach(prop => { - const name = prop.get('property'); - const value = layers.getPropertyValues( - name, - prop.getDefaultValue() - ); - self - .getTargets() - .forEach(tr => tr.addStyle({ [name]: value }, opt)); - }); - } - } else { - // Update only if there is an actual update (to avoid changes for computed styles) - // ps: status is calculated in `targetUpdated` method - if (status == 'updated') { - const value = model.getFullValue(); - model.set('value', value, opt); - // Try to remove detached properties - !value && view.updateTargetStyle(value, null, opt); - } - } - } - }; }, - - onRender() { - const { el, layers, propsView } = this; - const fieldEl = el.querySelector('[data-layers-wrapper]'); - propsView.render(); // Will use it to propogate changes - fieldEl.appendChild(layers.render().el); - } }); From 8cd244fe6a0cc78425681a55dba14e4162f04250 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 12:42:42 +0100 Subject: [PATCH 215/313] Update Stack status on layer change --- src/style_manager/view/PropertyStackView.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/style_manager/view/PropertyStackView.js b/src/style_manager/view/PropertyStackView.js index 2a6aad4a0..c4f35eef2 100644 --- a/src/style_manager/view/PropertyStackView.js +++ b/src/style_manager/view/PropertyStackView.js @@ -21,7 +21,10 @@ export default PropertyCompositeView.extend({ `; }, - init() {}, + init() { + const { model } = this; + this.listenTo(model.getLayers(), 'change', this.updateStatus); + }, addLayer() { this.model.addLayer({}, { at: 0 }); From a1e6511751186e80feab75e2a36e453572359e6c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 13:26:39 +0100 Subject: [PATCH 216/313] Generate preview for layers --- src/style_manager/model/PropertyComposite.js | 2 +- src/style_manager/model/PropertyStack.js | 14 ++++++++++--- src/style_manager/view/LayerView.js | 21 ++++++++++++++------ 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index bb688c279..6567a2fdb 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -1,7 +1,7 @@ import { isString, isUndefined } from 'underscore'; import Property from './Property'; -const isNumberType = type => type === 'integer' || type === 'number'; +export const isNumberType = type => type === 'integer' || type === 'number'; /** * @typedef PropertyComposite diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index 460f773d6..fb528fd4c 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -1,5 +1,5 @@ import { keys, isUndefined, isArray, isString } from 'underscore'; -import PropertyComposite from './PropertyComposite'; +import PropertyComposite, { isNumberType } from './PropertyComposite'; import PropertyBase from './Property'; import Layers from './Layers'; import { camelCase } from 'utils/mixins'; @@ -13,6 +13,7 @@ const PARTS_REG = /\s(?![^(]*\))/; * * * @typedef PropertyStack + * @property {Boolean} [preview=false] Indicate if the layer should display a preview. * @property {String|RegExp} [layerSeparator=', '] The separator used to split layer values. * @property {String} [layerJoin=', '] Value used to join layer values. * @property {Function} [layerLabel] Custom logic for creating the layer label. @@ -26,7 +27,7 @@ export default class PropertyStack extends PropertyComposite { layerSeparator: ', ', layerJoin: '', prepend: 0, - preview: 0, + preview: false, layerLabel: null, selectedLayer: null, }; @@ -184,7 +185,14 @@ export default class PropertyStack extends PropertyComposite { const result = this.getProperties().map(prop => { const name = prop.getName(); const val = values[name]; - const value = isUndefined(val) ? prop.getDefaultValue() : val; + let value = isUndefined(val) ? prop.getDefaultValue() : val; + + // Limit number values if necessary (useful for previews) + if (opts.number && isNumberType(prop.getType())) { + const newVal = prop.parseValue(val, opts.number); + value = `${newVal.value}${newVal.unit}`; + } + return { name, value }; }); style = this.isDetached() diff --git a/src/style_manager/view/LayerView.js b/src/style_manager/view/LayerView.js index 707bd9598..bcd849fad 100644 --- a/src/style_manager/view/LayerView.js +++ b/src/style_manager/view/LayerView.js @@ -1,3 +1,4 @@ +import { keys } from 'underscore'; import { View } from 'backbone'; export default View.extend({ @@ -17,7 +18,7 @@ export default View.extend({
-
+
⨯ @@ -105,16 +106,24 @@ export default View.extend({ }, updateLabel() { - const { model, propertyView } = this; - const label = propertyView.model.getLayerLabel(model); + const { model, pModel } = this; + const label = pModel.getLayerLabel(model); this.getLabelEl().innerHTML = label; + + if (pModel.get('preview')) { + const prvEl = this.getPreviewEl(); + const style = pModel.getStyleFromLayer(model, { number: { min: -3, max: 3 } }); + const styleStr = keys(style) + .map(k => `${k}:${style[k]}`) + .join(';'); + prvEl.setAttribute('style', styleStr); + } }, render() { - const { model, el, pfx } = this; - const preview = model.get('preview'); + const { el, pfx } = this; el.innerHTML = this.template(); - el.className = `${pfx}layer${!preview ? ` ${pfx}no-preview` : ''}`; + el.className = `${pfx}layer`; this.updateLabel(); this.updateVisibility(); return this; From fa5dcc07b8f9d7fad86bf67580160d1e5518a224 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 13:34:54 +0100 Subject: [PATCH 217/313] Add getStylePreview --- src/style_manager/model/PropertyStack.js | 11 +++++++++++ src/style_manager/view/LayerView.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index fb528fd4c..be4cdb15c 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -213,6 +213,17 @@ export default class PropertyStack extends PropertyComposite { : style; } + getStylePreview(layer, opts = {}) { + let result = {}; + const preview = this.get('preview'); + + if (preview) { + result = this.getStyleFromLayer(layer, opts); + } + + return result; + } + /** * Get layer separator. * @return {RegExp} diff --git a/src/style_manager/view/LayerView.js b/src/style_manager/view/LayerView.js index bcd849fad..edb78459a 100644 --- a/src/style_manager/view/LayerView.js +++ b/src/style_manager/view/LayerView.js @@ -112,7 +112,7 @@ export default View.extend({ if (pModel.get('preview')) { const prvEl = this.getPreviewEl(); - const style = pModel.getStyleFromLayer(model, { number: { min: -3, max: 3 } }); + const style = pModel.getStylePreview(model, { number: { min: -3, max: 3 } }); const styleStr = keys(style) .map(k => `${k}:${style[k]}`) .join(';'); From a528fa656aadcfcf55cefce57485d81644aad753 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 13:40:59 +0100 Subject: [PATCH 218/313] Fix stack updateStatus --- src/style_manager/view/PropertyStackView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/style_manager/view/PropertyStackView.js b/src/style_manager/view/PropertyStackView.js index c4f35eef2..19f3ac4dc 100644 --- a/src/style_manager/view/PropertyStackView.js +++ b/src/style_manager/view/PropertyStackView.js @@ -23,7 +23,7 @@ export default PropertyCompositeView.extend({ init() { const { model } = this; - this.listenTo(model.getLayers(), 'change', this.updateStatus); + this.listenTo(model.getLayers(), 'change reset', this.updateStatus); }, addLayer() { From 1b6b3649bc0cd1b5fb71a71be83268f48bb5d0a1 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 14:24:19 +0100 Subject: [PATCH 219/313] Update style layer layout --- dist/css/grapes.min.css | 2 +- src/editor/config/config.js | 7 +++ src/style_manager/view/LayerView.js | 24 ++++++---- src/styles/scss/_gjs_style_manager.scss | 61 +++++++++++++++---------- 4 files changed, 59 insertions(+), 35 deletions(-) diff --git a/dist/css/grapes.min.css b/dist/css/grapes.min.css index 489f893f5..b5fbbebc3 100644 --- a/dist/css/grapes.min.css +++ b/dist/css/grapes.min.css @@ -1 +1 @@ -.sp-container{position:absolute;top:0;left:0;display:inline-block;*display:inline;*zoom:1;z-index:9999994;overflow:hidden}.sp-container.sp-flat{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{position:relative;width:100%;display:inline-block}.sp-top-inner{position:absolute;top:0;left:0;bottom:0;right:0}.sp-color{position:absolute;top:0;left:0;bottom:0;right:20%}.sp-hue{position:absolute;top:0;right:0;bottom:0;left:84%;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{position:absolute;top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{position:absolute;top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid black;background:white;opacity:.8}.sp-alpha{display:none;position:absolute;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:solid 1px #333}.sp-clear{display:none}.sp-clear.sp-clear-display{background-position:center}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0px;right:0;bottom:0;left:84%;height:28px}.sp-container,.sp-replacer,.sp-preview,.sp-dragger,.sp-slider,.sp-alpha,.sp-clear,.sp-alpha-handle,.sp-container.sp-dragging .sp-input,.sp-container button{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-input-disabled .sp-input-container{display:none}.sp-container.sp-buttons-disabled .sp-button-container{display:none}.sp-container.sp-palette-buttons-disabled .sp-palette-button-container{display:none}.sp-palette-only .sp-picker-container{display:none}.sp-palette-disabled .sp-palette-container{display:none}.sp-initial-disabled .sp-initial{display:none}.sp-sat{background-image:-webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:linear-gradient(to right, #fff, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr="#FFFFFFFF", endColorstr="#00CC9A81")}.sp-val{background-image:-webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:linear-gradient(to top, #000, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00CC9A81", endColorstr="#FF000000")}.sp-hue{background:-moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));background:-webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff0000", endColorstr="#ffff00")}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffff00", endColorstr="#00ff00")}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ff00", endColorstr="#00ffff")}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffff", endColorstr="#0000ff")}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0000ff", endColorstr="#ff00ff")}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff00ff", endColorstr="#ff0000")}.sp-hidden{display:none !important}.sp-cf:before,.sp-cf:after{content:"";display:table}.sp-cf:after{clear:both}.sp-cf{*zoom:1}@media(max-device-width: 480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;cursor:pointer;position:absolute;top:0;left:0}.sp-slider{position:absolute;top:0;cursor:pointer;height:3px;left:-1px;right:-1px;border:1px solid #000;background:white;opacity:.8}.sp-container{border-radius:0;background-color:#ececec;border:solid 1px #f0c49b;padding:0}.sp-container,.sp-container button,.sp-container input,.sp-color,.sp-hue,.sp-clear{font:normal 12px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-color,.sp-hue,.sp-clear{border:solid 1px #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container{width:100%}.sp-input{font-size:12px !important;border:1px inset;padding:4px 5px;margin:0;width:100%;background:transparent;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-picker-container,.sp-palette-container{float:left;position:relative;padding:10px;padding-bottom:300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:solid 1px #fff}.sp-palette-container{border-right:solid 1px #ccc}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;width:24px;height:15px;margin:3px;cursor:pointer;border:solid 2px transparent}.sp-palette .sp-thumb-el:hover,.sp-palette .sp-thumb-el.sp-thumb-active{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:solid 1px #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:center}.sp-palette-button-container,.sp-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;*zoom:1;*display:inline;border:solid 1px #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer:hover,.sp-replacer.sp-active{border-color:#f0c49b;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px}.sp-preview{position:relative;width:25px;height:20px;border:solid 1px #222;margin-right:5px;float:left;z-index:0}.sp-palette{*width:220px;max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:solid 1px #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top, #eeeeee, #cccccc);background-image:-moz-linear-gradient(top, #eeeeee, #cccccc);background-image:-ms-linear-gradient(top, #eeeeee, #cccccc);background-image:-o-linear-gradient(top, #eeeeee, #cccccc);background-image:linear-gradient(to bottom, #eeeeee, #cccccc);border:1px solid #ccc;border-bottom:1px solid #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top, #dddddd, #bbbbbb);background-image:-moz-linear-gradient(top, #dddddd, #bbbbbb);background-image:-ms-linear-gradient(top, #dddddd, #bbbbbb);background-image:-o-linear-gradient(top, #dddddd, #bbbbbb);background-image:linear-gradient(to bottom, #dddddd, #bbbbbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid #aaa;border-bottom:1px solid #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f !important;margin:0;padding:2px;margin-right:5px;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f !important;text-decoration:underline}.sp-palette span:hover,.sp-palette span.sp-thumb-active{border-color:#000}.sp-preview,.sp-alpha,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-preview-inner,.sp-alpha-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==)}.CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20, 255, 20, 0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:blue}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, 0.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, 0.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-hopscotch.CodeMirror{background:#322931;color:#d5d3d5}.cm-s-hopscotch div.CodeMirror-selected{background:#433b42 !important}.cm-s-hopscotch .CodeMirror-gutters{background:#322931;border-right:0px}.cm-s-hopscotch .CodeMirror-linenumber{color:#797379}.cm-s-hopscotch .CodeMirror-cursor{border-left:1px solid #989498 !important}.cm-s-hopscotch span.cm-comment{color:#b33508}.cm-s-hopscotch span.cm-atom{color:#c85e7c}.cm-s-hopscotch span.cm-number{color:#c85e7c}.cm-s-hopscotch span.cm-property,.cm-s-hopscotch span.cm-attribute{color:#8fc13e}.cm-s-hopscotch span.cm-keyword{color:#dd464c}.cm-s-hopscotch span.cm-string{color:#fdcc59}.cm-s-hopscotch span.cm-variable{color:#8fc13e}.cm-s-hopscotch span.cm-variable-2{color:#1290bf}.cm-s-hopscotch span.cm-def{color:#fd8b19}.cm-s-hopscotch span.cm-error{background:#dd464c;color:#989498}.cm-s-hopscotch span.cm-bracket{color:#d5d3d5}.cm-s-hopscotch span.cm-tag{color:#dd464c}.cm-s-hopscotch span.cm-link{color:#c85e7c}.cm-s-hopscotch .CodeMirror-matchingbracket{text-decoration:underline;color:white !important}.cm-s-hopscotch .CodeMirror-activeline-background{background:#302020}@font-face{font-family:"font3336";src:url("../fonts/main-fonts.eot?v=20");src:url("../fonts/main-fonts.woff?v=20") format("woff"),url("../fonts/main-fonts.ttf?v=20") format("truetype"),url("../fonts/main-fonts.svg?v=20") format("svg"),url("../fonts/main-fonts.eot?v=20") format("embedded-opentype");font-weight:normal;font-style:normal}.gjs-is__grab,.gjs-is__grab *{cursor:grab !important}.gjs-is__grabbing,.gjs-is__grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:grabbing !important}.gjs-one-bg{background-color:#444}.gjs-one-color{color:#444}.gjs-one-color-h:hover{color:#444}.gjs-two-bg{background-color:#ddd}.gjs-two-color{color:#ddd}.gjs-two-color-h:hover{color:#ddd}.gjs-three-bg{background-color:#804f7b}.gjs-three-color{color:#804f7b}.gjs-three-color-h:hover{color:#804f7b}.gjs-four-bg{background-color:#d278c9}.gjs-four-color{color:#d278c9}.gjs-four-color-h:hover{color:#d278c9}.gjs-danger-bg{background-color:#dd3636}.gjs-danger-color{color:#dd3636}.gjs-danger-color-h:hover{color:#dd3636}.gjs-bg-main,.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c,.gjs-off-prv{background-color:#444}.gjs-color-main,.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add,.gjs-off-prv{color:#ddd;fill:#ddd}.gjs-color-active{color:#f8f8f8;fill:#f8f8f8}.gjs-color-warn{color:#ffca6f;fill:#ffca6f}.gjs-color-hl{color:#71b7f1;fill:#71b7f1}.gjs-fonts::before{display:block;font:normal normal normal 14px font3336;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:5em}.gjs-f-b1::before{content:"Q"}.gjs-f-b2::before{content:"W"}.gjs-f-b3::before{content:"E"}.gjs-f-b37::before{content:"R"}.gjs-f-hero::before{content:"T"}.gjs-f-h1p::before{content:"y"}.gjs-f-3ba::before{content:"u"}.gjs-f-image::before{content:"I"}.gjs-f-text::before{content:"o"}.gjs-f-quo::before{content:"p"}.gjs-f-button::before{content:"B"}.gjs-f-divider::before{content:"D"}.gjs-invis-invis,.gjs-clm-tags #gjs-clm-new,.gjs-no-app{background-color:transparent;border:none;color:inherit}.gjs-no-app{height:10px}.gjs-test::btn{color:"#fff"}.opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-checker-bg,.gjs-field-colorp-c,.checker-bg,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==")}.gjs-no-user-select,.gjs-rte-toolbar,.gjs-layer-name,.gjs-grabbing,.gjs-grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-pointer-events,.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el,.gjs-resizer-c{pointer-events:none}.gjs-bdrag{pointer-events:none !important;position:absolute !important;z-index:10 !important;width:auto}.gjs-drag-helper{background-color:#3b97e3 !important;pointer-events:none !important;position:absolute !important;z-index:10 !important;transform:scale(0.3) !important;transform-origin:top left !important;-webkit-transform-origin:top left !important;margin:15px !important;transition:none !important;outline:none !important}.gjs-grabbing,.gjs-grabbing *{cursor:grabbing !important;cursor:-webkit-grabbing !important}.gjs-grabbing{overflow:hidden}.gjs-off-prv{position:relative;z-index:10;padding:5px;cursor:pointer}.gjs-editor-cont ::-webkit-scrollbar-track{background:rgba(0,0,0,.1)}.gjs-editor-cont ::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.2)}.gjs-editor-cont ::-webkit-scrollbar{width:8px}.clear{clear:both}.no-select,.gjs-clm-tags #gjs-clm-close,.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title,.gjs-com-no-select,.gjs-com-no-select img{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-touch-actions{touch-action:none}.gjs-disabled{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;opacity:.5;filter:alpha(opacity=50)}.gjs-editor{font-family:Helvetica,sans-serif;font-size:.75rem;position:relative;box-sizing:border-box;height:100%}.gjs-freezed,.gjs-freezed{opacity:.5;filter:alpha(opacity=50);pointer-events:none}.gjs-traits-label{border-bottom:1px solid rgba(0,0,0,.2);font-weight:lighter;margin-bottom:5px;padding:10px;text-align:left}.gjs-label-wrp{width:30%;min-width:30%}.gjs-field-wrp{flex-grow:1}.gjs-trt-header{font-weight:lighter;padding:10px}.gjs-trt-trait{display:flex;justify-content:flex-start;padding:5px 10px;font-weight:lighter;align-items:center;text-align:left}.gjs-trt-traits{font-size:.75rem}.gjs-trt-trait .gjs-label{text-align:left;text-overflow:ellipsis;overflow:hidden}.gjs-guide-info{position:absolute}.gjs-guide-info__content{position:absolute;height:100%;display:flex;width:100%;padding:5px}.gjs-guide-info__line{position:relative;margin:auto}.gjs-guide-info__line::before,.gjs-guide-info__line::after{content:"";display:block;position:absolute;background-color:inherit}.gjs-guide-info__y{padding:0 5px}.gjs-guide-info__y .gjs-guide-info__content{justify-content:center}.gjs-guide-info__y .gjs-guide-info__line{width:100%;height:1px}.gjs-guide-info__y .gjs-guide-info__line::before,.gjs-guide-info__y .gjs-guide-info__line::after{width:1px;height:10px;top:0;bottom:0;left:0;margin:auto}.gjs-guide-info__y .gjs-guide-info__line::after{left:auto;right:0}.gjs-guide-info__x{padding:5px 0}.gjs-guide-info__x .gjs-guide-info__content{align-items:center}.gjs-guide-info__x .gjs-guide-info__line{height:100%;width:1px}.gjs-guide-info__x .gjs-guide-info__line::before,.gjs-guide-info__x .gjs-guide-info__line::after{width:10px;height:1px;left:0;right:0;top:0;margin:auto;transform:translateX(-50%)}.gjs-guide-info__x .gjs-guide-info__line::after{top:auto;bottom:0}.gjs-badge{white-space:nowrap}.gjs-badge__icon{vertical-align:middle;display:inline-block;width:15px;height:15px}.gjs-badge__icon svg{fill:currentColor}.gjs-badge__name{display:inline-block;vertical-align:middle}.gjs-frame-wrapper{position:absolute;width:100%;height:100%;left:0;right:0;margin:auto}.gjs-frame-wrapper--anim{transition:width .35s ease,height .35s ease}.gjs-frame-wrapper__top{transform:translateY(-100%) translateX(-50%);display:flex;padding:5px 0;position:absolute;width:100%;left:50%;top:0}.gjs-frame-wrapper__top-r{margin-left:auto}.gjs-frame-wrapper__left{position:absolute;left:0;transform:translateX(-100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__bottom{position:absolute;bottom:0;transform:translateY(100%) translateX(-50%);width:100%;left:50%}.gjs-frame-wrapper__right{position:absolute;right:0;transform:translateX(100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__icon{width:24px;cursor:pointer}.gjs-frame-wrapper__icon>svg{fill:currentColor}.gjs-padding-v-top,.gjs-fixedpadding-v-top{width:100%;top:0;left:0}.gjs-padding-v-right,.gjs-fixedpadding-v-right{right:0}.gjs-padding-v-bottom,.gjs-fixedpadding-v-bottom{width:100%;left:0;bottom:0}.gjs-padding-v-left,.gjs-fixedpadding-v-left{left:0}.gjs-cv-canvas{background-color:rgba(0,0,0,.15);box-sizing:border-box;width:85%;height:calc(100% - 40px);bottom:0;overflow:hidden;z-index:1;position:absolute;left:0;top:40px}.gjs-cv-canvas.gjs-cui{width:100%;height:100%;top:0}.gjs-cv-canvas.gjs-is__grab .gjs-cv-canvas__frames,.gjs-cv-canvas.gjs-is__grabbing .gjs-cv-canvas__frames{pointer-events:none}.gjs-cv-canvas__frames{position:absolute;top:0;left:0;width:100%;height:100%}.gjs-cv-canvas .gjs-ghost{display:none;pointer-events:none;background-color:#5b5b5b;border:2px dashed #ccc;position:absolute;z-index:10;opacity:.55;filter:alpha(opacity=55)}.gjs-cv-canvas .gjs-highlighter,.gjs-cv-canvas .gjs-highlighter-sel{position:absolute;outline:1px solid #3b97e3;outline-offset:-1px;pointer-events:none;width:100%;height:100%}.gjs-cv-canvas .gjs-highlighter-warning{outline:3px solid #ffca6f}.gjs-cv-canvas .gjs-highlighter-sel{outline:2px solid #3b97e3;outline-offset:-2px}.gjs-cv-canvas #gjs-tools,.gjs-cv-canvas .gjs-tools{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;z-index:1}.gjs-cv-canvas *{box-sizing:border-box}.gjs-frame{outline:medium none;height:100%;width:100%;border:none;margin:auto;display:block;transition:width .35s ease,height .35s ease;position:absolute;top:0;bottom:0;left:0;right:0}.gjs-toolbar{position:absolute;background-color:#3b97e3;white-space:nowrap;color:#fff;z-index:10;top:0;left:0}.gjs-toolbar-item{padding:5px 7px;font-size:.8rem;cursor:pointer;width:26px;vertical-align:middle;display:inline-block}.gjs-toolbar-item svg{fill:currentColor;vertical-align:middle}.gjs-resizer-c{position:absolute;left:0;top:0;width:100%;height:100%;z-index:9}.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.1;filter:alpha(opacity=10);position:absolute;background-color:#ff0}.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.2;filter:alpha(opacity=20)}.gjs-padding-v-el,.gjs-fixedpadding-v-el{background-color:navy}.gjs-resizer-h{pointer-events:all;position:absolute;border:3px solid #3b97e3;width:10px;height:10px;background-color:#fff;margin:-5px}.gjs-resizer-h-tl{top:0;left:0;cursor:nwse-resize}.gjs-resizer-h-tr{top:0;right:0;cursor:nesw-resize}.gjs-resizer-h-tc{top:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-cl{left:0;margin:auto -5px;top:0;bottom:0;cursor:ew-resize}.gjs-resizer-h-cr{margin:auto -5px;top:0;bottom:0;right:0;cursor:ew-resize}.gjs-resizer-h-bl{bottom:0;left:0;cursor:nesw-resize}.gjs-resizer-h-bc{bottom:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-br{bottom:0;right:0;cursor:nwse-resize}.gjs-pn-panel .gjs-resizer-h{background-color:rgba(0,0,0,.2);border:none;opacity:0;transition:opacity .25s}.gjs-pn-panel .gjs-resizer-h:hover{opacity:1}.gjs-pn-panel .gjs-resizer-h-tc,.gjs-pn-panel .gjs-resizer-h-bc{margin:0 auto;width:100%}.gjs-pn-panel .gjs-resizer-h-cr,.gjs-pn-panel .gjs-resizer-h-cl{margin:auto 0;height:100%}.gjs-resizing .gjs-highlighter,.gjs-resizing .gjs-badge{display:none !important}.gjs-resizing-tl *{cursor:nwse-resize !important}.gjs-resizing-tr *{cursor:nesw-resize !important}.gjs-resizing-tc *{cursor:ns-resize !important}.gjs-resizing-cl *{cursor:ew-resize !important}.gjs-resizing-cr *{cursor:ew-resize !important}.gjs-resizing-bl *{cursor:nesw-resize !important}.gjs-resizing-bc *{cursor:ns-resize !important}.gjs-resizing-br *{cursor:nwse-resize !important}.btn-cl,.gjs-am-close,.gjs-mdl-btn-close{opacity:.3;filter:alpha(opacity=30);font-size:25px;cursor:pointer}.btn-cl:hover,.gjs-am-close:hover,.gjs-mdl-btn-close:hover{opacity:.7;filter:alpha(opacity=70)}.no-dots,.ui-resizable-handle{border:none !important;margin:0 !important;outline:none !important}.gjs-com-dashed *{outline:1px dashed #888;outline-offset:-2px;box-sizing:border-box}.gjs-cv-canvas .gjs-comp-selected{outline:3px solid #3b97e3 !important}*.gjs-com-hover,div.gjs-com-hover{outline:1px solid #3b97e3}*.gjs-com-hover-delete,div.gjs-com-hover-delete{outline:2px solid #dd3636;opacity:.5;filter:alpha(opacity=50)}*.gjs-com-hover-move,div.gjs-com-hover-move{outline:3px solid #ffca6f}.gjs-com-badge,.gjs-com-badge-red,.gjs-badge{pointer-events:none;background-color:#3b97e3;color:#fff;padding:2px 5px;position:absolute;z-index:1;font-size:12px;outline:none;display:none}.gjs-com-badge-red{background-color:#dd3636}.gjs-badge-warning{background-color:#ffca6f}.gjs-placeholder,.gjs-com-placeholder,.gjs-placeholder{position:absolute;z-index:10;pointer-events:none;display:none}.gjs-placeholder,.gjs-placeholder{border-style:solid !important;outline:none;box-sizing:border-box;transition:top .2s,left .2s,width .2s,height .2s}.gjs-placeholder.horizontal,.gjs-com-placeholder.horizontal,.gjs-placeholder.horizontal{border-color:transparent #62c462;border-width:3px 5px;margin:-3px 0 0}.gjs-placeholder.vertical,.gjs-com-placeholder.vertical,.gjs-placeholder.vertical{border-color:#62c462 transparent;border-width:5px 3px;margin:0 0 0 -3px}.gjs-placeholder-int,.gjs-com-placeholder-int,.gjs-placeholder-int{background-color:#62c462;box-shadow:0 0 3px rgba(0,0,0,.2);height:100%;width:100%;pointer-events:none;padding:1.5px;outline:none}.gjs-pn-panel{display:inline-block;position:absolute;box-sizing:border-box;text-align:center;padding:5px;z-index:3}.gjs-pn-panel .icon-undo,.gjs-pn-panel .icon-redo{font-size:20px;height:30px;width:25px}.gjs-pn-commands{width:85%;left:0;top:0;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-options{right:15%;top:0}.gjs-pn-views{border-bottom:2px solid rgba(0,0,0,.2);right:0;width:15%;z-index:4}.gjs-pn-views-container{height:100%;padding:42px 0 0;right:0;width:15%;overflow:auto;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-buttons{align-items:center;display:flex;justify-content:space-between}.gjs-pn-btn{box-sizing:border-box;min-height:30px;min-width:30px;line-height:21px;background-color:transparent;border:none;font-size:18px;margin-right:5px;border-radius:2px;padding:4px;position:relative;cursor:pointer}.gjs-pn-btn.gjs-pn-active{background-color:rgba(0,0,0,.15);box-shadow:0 0 3px rgba(0,0,0,.25) inset}.gjs-pn-btn svg{fill:currentColor}.gjs-comp-image-placeholder{display:block;background-color:#f5f5f5;color:#777;height:50px;width:50px;line-height:50px;outline:3px solid #ffca6f;outline-offset:-3px;text-align:center;font-size:16.6666666667px;cursor:pointer}.gjs-comp-image-placeholder.fa-picture-o::after{content:""}.gjs-label{line-height:18px}.gjs-fields{display:flex}.gjs-select{padding:0;width:100%}.gjs-select select{padding-right:10px}.gjs-select:-moz-focusring,.gjs-select select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-input:focus,.gjs-button:focus,.gjs-btn-prim:focus,.gjs-select:focus,.gjs-select select:focus{outline:none}.gjs-field input,.gjs-field select,.gjs-field textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:inherit;border:none;background-color:transparent;box-sizing:border-box;width:100%;position:relative;padding:5px;z-index:1}.gjs-field input:focus,.gjs-field select:focus,.gjs-field textarea:focus{outline:none}.gjs-field input[type=number]{-moz-appearance:textfield}.gjs-field input[type=number]::-webkit-outer-spin-button,.gjs-field input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gjs-field-range{flex:9 1 auto}.gjs-field-integer input{padding-right:30px}.gjs-select option,.gjs-field-select option,.gjs-clm-select option,.gjs-sm-select option,.gjs-fields option,.gjs-sm-unit option{background-color:#444;color:#ddd}.gjs-field{background-color:rgba(0,0,0,.2);border:none;box-shadow:none;border-radius:2px;box-sizing:border-box;padding:0;position:relative}.gjs-field textarea{resize:vertical}.gjs-field .gjs-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;z-index:0}.gjs-field .gjs-d-s-arrow{bottom:0;top:0;margin:auto;right:5px;border-top:4px solid rgba(255,255,255,.7);position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-field-arrows{position:absolute;cursor:ns-resize;margin:auto;height:20px;width:9px;z-index:10;bottom:0;right:3px;top:0}.gjs-field-color,.gjs-field-radio{width:100%}.gjs-field-color input{padding-right:22px;box-sizing:border-box}.gjs-field-colorp{border-left:1px solid rgba(0,0,0,.2);box-sizing:border-box;height:100%;padding:2px;position:absolute;right:0;top:0;width:22px;z-index:10}.gjs-field-colorp .gjs-checker-bg,.gjs-field-colorp .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-field-colorp-c{height:100%;position:relative;width:100%}.gjs-field-color-picker{background-color:#ddd;cursor:pointer;height:100%;width:100%;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px;position:absolute;top:0}.gjs-field-checkbox{padding:0;width:17px;height:17px;display:block;cursor:pointer}.gjs-field-checkbox input{display:none}.gjs-field-checkbox input:checked+.gjs-chk-icon{border-color:rgba(255,255,255,.5);border-width:0 2px 2px 0;border-style:solid}.gjs-radio-item{flex:1 1 auto;text-align:center;border-left:1px solid rgba(0,0,0,.2)}.gjs-radio-item:first-child{border:none}.gjs-radio-item:hover{background:rgba(0,0,0,.2)}.gjs-radio-item input{display:none}.gjs-radio-item input:checked+.gjs-radio-item-label{background-color:rgba(255,255,255,.2)}.gjs-radio-items{display:flex}.gjs-radio-item-label{cursor:pointer;display:block;padding:5px}.gjs-field-units{position:absolute;margin:auto;right:10px;bottom:0;top:0}.gjs-field-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-field-arrow-u,.gjs-field-arrow-d{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(255,255,255,.7);bottom:4px;cursor:pointer}.gjs-field-arrow-u{border-bottom:4px solid rgba(255,255,255,.7);border-top:none;top:4px}.gjs-field-select{padding:0}.gjs-field-range{background-color:transparent;border:none;box-shadow:none;padding:0}.gjs-field-range input{margin:0;height:100%}.gjs-field-range input:focus{outline:none}.gjs-field-range input::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-ms-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-webkit-slider-runnable-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-ms-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-btn-prim{color:inherit;background-color:rgba(255,255,255,.1);border-radius:2px;padding:3px 6px;padding:5px;cursor:pointer;border:none}.gjs-btn-prim:active{background-color:rgba(255,255,255,.1)}.gjs-btn--full{width:100%}.gjs-chk-icon{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);box-sizing:border-box;display:block;height:14px;margin:0 5px;width:6px}.gjs-add-trasp{background:none;border:none;color:#ddd;cursor:pointer;font-size:1em;border-radius:2px;opacity:.75;filter:alpha(opacity=75)}.gjs-add-trasp:hover{opacity:1;filter:alpha(opacity=100)}.gjs-add-trasp:active{background-color:rgba(0,0,0,.2)}.gjs-devices-c{display:flex;align-items:center;padding:3px}.gjs-devices-c .gjs-device-label{flex-grow:2;text-align:left;margin-right:10px}.gjs-devices-c .gjs-select{flex-grow:20}.gjs-devices-c .gjs-add-trasp{flex-grow:1;margin-left:5px}.gjs-category-open,.gjs-block-category.gjs-open,.gjs-sm-sector.gjs-sm-open,.gjs-sm-open.gjs-clm-tags{border-bottom:1px solid rgba(0,0,0,.25)}.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title{font-weight:lighter;background-color:rgba(0,0,0,.1);letter-spacing:1px;padding:9px 10px 9px 20px;border-bottom:1px solid rgba(0,0,0,.25);text-align:left;position:relative;cursor:pointer}.gjs-sm-clear{line-height:0;cursor:pointer}.gjs-sm-header{font-weight:lighter;padding:10px}.gjs-sm-properties{font-size:.75rem;padding:10px 5px;display:flex;flex-wrap:wrap;align-items:flex-end;box-sizing:border-box;width:100%}.gjs-sm-label{margin:5px 5px 3px 0}.gjs-sm-close-btn,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.2;filter:alpha(opacity=20)}.gjs-sm-close-btn:hover,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover{opacity:.7;filter:alpha(opacity=70)}.gjs-sm-sector,.gjs-clm-tags{clear:both;font-weight:lighter;text-align:left}.gjs-sm-sector #gjs-sm-caret,.gjs-clm-tags #gjs-sm-caret{padding-right:5px;font-size:11px}.gjs-sm-sector .gjs-sm-field,.gjs-clm-tags .gjs-sm-field,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-clm-field,.gjs-clm-tags .gjs-clm-field{width:100%;position:relative}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input,.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{background-color:transparent;color:rgba(255,255,255,.7);border:none;width:100%}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input{box-sizing:border-box}.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gjs-sm-sector .gjs-sm-field select::-ms-expand,.gjs-clm-tags .gjs-sm-field select::-ms-expand,.gjs-sm-sector .gjs-clm-select select::-ms-expand,.gjs-clm-tags .gjs-clm-select select::-ms-expand,.gjs-sm-sector .gjs-clm-field select::-ms-expand,.gjs-clm-tags .gjs-clm-field select::-ms-expand{display:none}.gjs-sm-sector .gjs-sm-field select:-moz-focusring,.gjs-clm-tags .gjs-sm-field select:-moz-focusring,.gjs-sm-sector .gjs-clm-select select:-moz-focusring,.gjs-clm-tags .gjs-clm-select select:-moz-focusring,.gjs-sm-sector .gjs-clm-field select:-moz-focusring,.gjs-clm-tags .gjs-clm-field select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-sm-sector .gjs-sm-field input:focus,.gjs-clm-tags .gjs-sm-field input:focus,.gjs-sm-sector .gjs-clm-select input:focus,.gjs-clm-tags .gjs-clm-select input:focus,.gjs-sm-sector .gjs-clm-field input:focus,.gjs-clm-tags .gjs-clm-field input:focus,.gjs-sm-sector .gjs-sm-field select:focus,.gjs-clm-tags .gjs-sm-field select:focus,.gjs-sm-sector .gjs-clm-select select:focus,.gjs-clm-tags .gjs-clm-select select:focus,.gjs-sm-sector .gjs-clm-field select:focus,.gjs-clm-tags .gjs-clm-field select:focus{outline:none}.gjs-sm-sector .gjs-sm-field .gjs-sm-unit,.gjs-clm-tags .gjs-sm-field .gjs-sm-unit,.gjs-sm-sector .gjs-clm-select .gjs-sm-unit,.gjs-clm-tags .gjs-clm-select .gjs-sm-unit,.gjs-sm-sector .gjs-clm-field .gjs-sm-unit,.gjs-clm-tags .gjs-clm-field .gjs-sm-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-sm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-select .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-select .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;cursor:ns-resize}.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{border-bottom:4px solid rgba(255,255,255,.7);top:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{border-top:4px solid rgba(255,255,255,.7);bottom:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{bottom:7px}.gjs-sm-sector .gjs-sm-field.gjs-sm-color,.gjs-clm-tags .gjs-sm-field.gjs-sm-color,.gjs-sm-sector .gjs-sm-color.gjs-clm-field,.gjs-clm-tags .gjs-sm-color.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-input,.gjs-clm-tags .gjs-sm-field.gjs-sm-input,.gjs-sm-sector .gjs-sm-input.gjs-clm-field,.gjs-clm-tags .gjs-sm-input.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-integer,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{background-color:rgba(0,0,0,.2);border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 0 rgba(255,255,255,.1);color:rgba(255,255,255,.7);border-radius:2px;box-sizing:border-box;padding:0 5px}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{border-radius:2px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{padding:0}.gjs-sm-sector .gjs-sm-field.gjs-sm-select select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field select,.gjs-clm-tags .gjs-sm-select.gjs-clm-field select{height:20px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select option,.gjs-clm-tags .gjs-sm-field.gjs-sm-select option,.gjs-sm-sector .gjs-clm-select option,.gjs-clm-tags .gjs-clm-select option,.gjs-sm-sector .gjs-sm-select.gjs-clm-field option,.gjs-clm-tags .gjs-sm-select.gjs-clm-field option{padding:3px 0}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{background-color:rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.25)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-select,.gjs-clm-tags .gjs-sm-list.gjs-clm-select,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field{width:auto;padding:0;overflow:hidden;float:left}.gjs-sm-sector .gjs-sm-field.gjs-sm-list input,.gjs-clm-tags .gjs-sm-field.gjs-sm-list input,.gjs-sm-sector .gjs-sm-list.gjs-clm-select input,.gjs-clm-tags .gjs-sm-list.gjs-clm-select input,.gjs-sm-sector .gjs-sm-list.gjs-clm-field input,.gjs-clm-tags .gjs-sm-list.gjs-clm-field input{display:none}.gjs-sm-sector .gjs-sm-field.gjs-sm-list label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field label{cursor:pointer;padding:5px;display:block}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label{background-color:rgba(255,255,255,.2)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-icon{background-repeat:no-repeat;background-position:center;text-shadow:none;line-height:normal}.gjs-sm-sector .gjs-sm-field.gjs-sm-integer select,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-select select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-select select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field select{width:auto;padding:0}.gjs-sm-sector .gjs-sm-list .gjs-sm-el,.gjs-clm-tags .gjs-sm-list .gjs-sm-el{float:left;border-left:1px solid rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:first-child,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:first-child{border:none}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:hover,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:hover{background:rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-slider .gjs-field-integer,.gjs-clm-tags .gjs-sm-slider .gjs-field-integer{flex:1 1 65px}.gjs-sm-sector .gjs-sm-property,.gjs-clm-tags .gjs-sm-property{box-sizing:border-box;float:left;width:50%;margin-bottom:5px;padding:0 5px}.gjs-sm-sector .gjs-sm-property--full,.gjs-clm-tags .gjs-sm-property--full,.gjs-sm-sector .gjs-sm-property.gjs-sm-composite,.gjs-clm-tags .gjs-sm-property.gjs-sm-composite,.gjs-sm-sector .gjs-sm-property.gjs-sm-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file,.gjs-sm-sector .gjs-sm-property.gjs-sm-list,.gjs-clm-tags .gjs-sm-property.gjs-sm-list,.gjs-sm-sector .gjs-sm-property.gjs-sm-stack,.gjs-clm-tags .gjs-sm-property.gjs-sm-stack,.gjs-sm-sector .gjs-sm-property.gjs-sm-slider,.gjs-clm-tags .gjs-sm-property.gjs-sm-slider,.gjs-sm-sector .gjs-sm-property.gjs-sm-color,.gjs-clm-tags .gjs-sm-property.gjs-sm-color{width:100%}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn{background-color:rgba(33,33,33,.2);border-radius:2px;box-shadow:1px 1px 0 rgba(5,5,5,.2),1px 1px 0 rgba(43,43,43,.2) inset;padding:5px;position:relative;text-align:center;height:auto;width:100%;cursor:pointer;color:#ddd;box-sizing:border-box;text-shadow:-1px -1px 0 rgba(0,0,0,.2);border:none;opacity:.85;filter:alpha(opacity=85)}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn-c,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn-c{box-sizing:border-box;float:left;width:100%}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box{background-color:rgba(255,255,255,.05);border-radius:2px;margin-top:5px;position:relative;overflow:hidden}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show{border:1px solid rgba(252,252,252,.05);padding:3px 20px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{top:-5px;display:block}.gjs-sm-sector .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file{height:50px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file{background-size:auto 100%;background-repeat:no-repeat;background-position:center center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layers,.gjs-clm-tags .gjs-sm-property .gjs-sm-layers{margin-top:5px;padding:1px 3px;min-height:30px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer{background-color:rgba(255,255,255,.055);border-radius:2px;margin:2px 0;padding:7px;position:relative;cursor:pointer}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box{height:15px;position:absolute;right:27px;top:6px;width:15px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{border-radius:2px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.5;filter:alpha(opacity=50)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover{opacity:.8;filter:alpha(opacity=80)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer>#gjs-sm-preview-box #gjs-sm-preview{background-color:#fff;height:100%;width:100%;background-size:cover !important}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer.gjs-sm-active,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer.gjs-sm-active{background-color:rgba(255,255,255,.12)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer.gjs-sm-no-preview #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer.gjs-sm-no-preview #gjs-sm-preview-box{display:none}.gjs-sm-sector #gjs-sm-text-shadow #gjs-sm-preview::after,.gjs-clm-tags #gjs-sm-text-shadow #gjs-sm-preview::after{color:#000;content:"T";font-weight:900;line-height:17px;padding:0 4px}.gjs-sm-sector .gjs-sm-stack .gjs-sm-properties,.gjs-clm-tags .gjs-sm-stack .gjs-sm-properties{padding:5px 0 0}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add{background:none;border:none;cursor:pointer;outline:none;font-size:22px;line-height:10px;position:absolute;right:0;top:-17px;opacity:.75}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add:hover,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add:hover{opacity:1;filter:alpha(opacity=100)}.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c{height:100%;width:20px;position:absolute;right:0;top:0;box-sizing:border-box;border-radius:2px;padding:2px}.gjs-sm-sector .gjs-sm-colorp-c .gjs-checker-bg,.gjs-clm-tags .gjs-sm-colorp-c .gjs-checker-bg,.gjs-sm-sector .gjs-sm-colorp-c .gjs-field-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-sm-sector .gjs-sm-color-picker,.gjs-clm-tags .gjs-sm-color-picker{background-color:#ddd;cursor:pointer;height:16px;width:100%;margin-top:-16px;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-upload,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-upload{left:0;top:0;position:absolute;width:100%;opacity:0;cursor:pointer}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-label,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-label{padding:2px 0}.gjs-sm-layer>#gjs-sm-move{opacity:.7;filter:alpha(opacity=70);cursor:move;font-size:12px;float:left;margin:0 5px 0 0}.gjs-sm-layer>#gjs-sm-move:hover{opacity:.9;filter:alpha(opacity=90)}.gjs-blocks-c{display:flex;flex-wrap:wrap;justify-content:flex-start}.gjs-block-categories{display:flex;flex-direction:column}.gjs-block-category{width:100%}.gjs-block-category .gjs-caret-icon{margin-right:5px}.gjs-block{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;width:45%;min-width:45px;padding:1em;box-sizing:border-box;min-height:90px;cursor:all-scroll;font-size:11px;font-weight:lighter;text-align:center;display:flex;flex-direction:column;justify-content:space-between;border:1px solid rgba(0,0,0,.2);border-radius:3px;margin:10px 2.5% 5px;box-shadow:0 1px 0 0 rgba(0,0,0,.15);transition:all .2s ease 0s;transition-property:box-shadow,color}.gjs-block:hover{box-shadow:0 3px 4px 0 rgba(0,0,0,.15)}.gjs-block svg{fill:currentColor}.gjs-block__media{margin-bottom:10px;pointer-events:none}.gjs-block-svg{width:54px;fill:currentColor}.gjs-block-svg-path{fill:currentColor}.gjs-block.fa{font-size:2em;line-height:2em;padding:11px}.gjs-block-label{line-height:normal;font-size:.65rem;font-weight:normal;font-family:Helvetica,sans-serif;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.gjs-block.gjs-bdrag{width:auto;padding:0}.gjs-selected-parent{border:1px solid #ffca6f}.gjs-opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-layer{font-weight:lighter;text-align:left;position:relative;background-color:rgba(0,0,0,.1);font-size:.75rem;display:grid}.gjs-layer-hidden{opacity:.55;filter:alpha(opacity=55)}.gjs-layer-count{position:absolute;right:27px;top:9px}.gjs-layer-vis{height:auto !important;width:auto !important;left:0;top:0;padding:7px 5px 7px 10px;position:absolute;cursor:pointer;z-index:1}.gjs-layer-caret{font-size:.5rem;width:8px;padding:2px;cursor:pointer;position:absolute;left:-9px;top:6px;opacity:.7;filter:alpha(opacity=70)}.gjs-layer-caret:hover{opacity:1;filter:alpha(opacity=100)}.gjs-layer-title{padding:3px 10px 5px 30px;display:flex;align-items:center}.gjs-layer-title-inn{align-items:center;position:relative;display:flex;width:100%}.gjs-layer__icon{display:block;width:100%;max-width:15px;max-height:15px;padding-left:5px}.gjs-layer__icon svg{fill:currentColor}.gjs-layer-name{padding:5px 0;display:inline-block;box-sizing:content-box;overflow:hidden;white-space:nowrap;margin:0 30px 0 5px}.gjs-layer-name--no-edit{text-overflow:ellipsis}.gjs-layer>.gjs-layer-children{display:none}.gjs-layer.open>.gjs-layer-children{display:block}.gjs-layer-no-chld>.gjs-layer-title-inn>.gjs-layer-caret{display:none}.gjs-layer-move{padding:7px 10px 7px 5px;position:absolute;font-size:12px;cursor:move;right:0;top:0}.gjs-layer.gjs-hovered .gjs-layer-title{background-color:rgba(255,255,255,.015)}.gjs-layer.gjs-selected .gjs-layer-title{background-color:rgba(255,255,255,.1)}.gjs-layers{position:relative;height:100%}.gjs-layers #gjs-placeholder{width:100%;position:absolute}.gjs-layers #gjs-placeholder #gjs-plh-int{height:100%;padding:1px}.gjs-layers #gjs-placeholder #gjs-plh-int.gjs-insert{background-color:#62c462}#gjs-clm-add-tag,.gjs-clm-tags-btn{background-color:rgba(255,255,255,.15);border-radius:2px;padding:3px;margin-right:3px;border:1px solid rgba(0,0,0,.15);width:24px;height:24px;box-sizing:border-box;cursor:pointer}.gjs-clm-tags-btn svg{fill:currentColor;display:block}.gjs-clm-header{display:flex;align-items:center;margin:7px 0}.gjs-clm-header-status{flex-shrink:1;margin-left:auto}.gjs-clm-tag{display:flex;overflow:hidden;align-items:center;border-radius:3px;margin:0 3px 3px 0;padding:5px;cursor:default}.gjs-clm-tag-status,.gjs-clm-tag-close{width:12px;height:12px;flex-shrink:1}.gjs-clm-tag-status svg,.gjs-clm-tag-close svg{vertical-align:middle;fill:currentColor}.gjs-clm-sels-info{margin:7px 0}.gjs-clm-sel-id{font-size:.9em;opacity:.5;filter:alpha(opacity=50)}.gjs-clm-label-sel{float:left;padding-right:5px}.gjs-clm-tags{font-size:.75rem;padding:10px 5px}.gjs-clm-tags #gjs-clm-sel{padding:7px 0;float:left}.gjs-clm-tags #gjs-clm-sel{font-style:italic;margin-left:5px}.gjs-clm-tags #gjs-clm-tags-field{clear:both;padding:5px;margin-bottom:5px;display:flex;flex-wrap:wrap}.gjs-clm-tags #gjs-clm-tags-c{display:flex;flex-wrap:wrap;vertical-align:top;overflow:hidden}.gjs-clm-tags #gjs-clm-new{color:#ddd;padding:5px 6px;display:none}.gjs-clm-tags #gjs-clm-close{opacity:.85;filter:alpha(opacity=85);font-size:20px;line-height:0;cursor:pointer;color:rgba(255,255,255,.9)}.gjs-clm-tags #gjs-clm-close:hover{opacity:1;filter:alpha(opacity=100)}.gjs-clm-tags #gjs-clm-checkbox{color:rgba(255,255,255,.9);vertical-align:middle;cursor:pointer;font-size:9px}.gjs-clm-tags #gjs-clm-tag-label{flex-grow:1;text-overflow:ellipsis;overflow:hidden;padding:0 3px;cursor:text}.gjs-mdl-container{font-family:Helvetica,sans-serif;overflow-y:auto;position:fixed;background-color:rgba(0,0,0,.5);display:flex;top:0;left:0;right:0;bottom:0;z-index:100}.gjs-mdl-dialog{text-shadow:-1px -1px 0 rgba(0,0,0,.05);animation:gjs-slide-down .215s;margin:auto;max-width:850px;width:90%;border-radius:3px;font-weight:lighter;position:relative;z-index:2}.gjs-mdl-title{font-size:1rem}.gjs-mdl-btn-close{position:absolute;right:15px;top:5px}.gjs-mdl-active .gjs-mdl-dialog{animation:gjs-mdl-slide-down .216s}.gjs-mdl-header,.gjs-mdl-content{padding:10px 15px;clear:both}.gjs-mdl-header{position:relative;border-bottom:1px solid rgba(0,0,0,.2);padding:15px 15px 7px}.gjs-export-dl::after{content:"";clear:both;display:block;margin-bottom:10px}.gjs-dropzone{display:none;opacity:0;position:absolute;top:0;left:0;z-index:11;width:100%;height:100%;transition:opacity .25s;pointer-events:none}.gjs-dropzone-active .gjs-dropzone{display:block;opacity:1}.gjs-am-assets{height:290px;overflow:auto;clear:both;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:flex-start}.gjs-am-assets-header{padding:5px}.gjs-am-add-asset .gjs-am-add-field{width:70%;float:left}.gjs-am-add-asset button{width:25%;float:right}.gjs-am-preview-cont{position:relative;height:70px;width:30%;background-color:#444;border-radius:2px;float:left;overflow:hidden}.gjs-am-preview{position:absolute;background-position:center center;background-size:cover;background-repeat:no-repeat;height:100%;width:100%;z-index:1}.gjs-am-preview-bg{opacity:.5;filter:alpha(opacity=50);position:absolute;height:100%;width:100%;z-index:0}.gjs-am-dimensions{opacity:.5;filter:alpha(opacity=50);font-size:10px}.gjs-am-meta{width:70%;float:left;font-size:12px;padding:5px 0 0 5px;box-sizing:border-box}.gjs-am-meta>div{margin-bottom:5px}.gjs-am-close{cursor:pointer;position:absolute;right:5px;top:0;display:none}.gjs-am-asset{border-bottom:1px solid rgba(0,0,0,.2);padding:5px;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.gjs-am-asset:hover .gjs-am-close{display:block}.gjs-am-highlight{background-color:rgba(255,255,255,.1)}.gjs-am-assets-cont{background-color:rgba(0,0,0,.1);border-radius:3px;box-sizing:border-box;padding:10px;width:45%;float:right;height:325px;overflow:hidden}.gjs-am-file-uploader{width:55%;float:left}.gjs-am-file-uploader>form{background-color:rgba(0,0,0,.1);border:2px dashed;border-radius:3px;position:relative;text-align:center;margin-bottom:15px}.gjs-am-file-uploader>form.gjs-am-hover{border:2px solid #62c462;color:#75cb75}.gjs-am-file-uploader>form.gjs-am-disabled{border-color:red}.gjs-am-file-uploader>form #gjs-am-uploadFile{opacity:0;filter:alpha(opacity=0);padding:150px 10px;width:100%;box-sizing:border-box}.gjs-am-file-uploader #gjs-am-title{position:absolute;padding:150px 10px;width:100%}.gjs-cm-editor-c{float:left;box-sizing:border-box;width:50%}.gjs-cm-editor-c .CodeMirror{height:450px}.gjs-cm-editor{font-size:12px}.gjs-cm-editor#gjs-cm-htmlmixed{padding-right:10px;border-right:1px solid rgba(0,0,0,.2)}.gjs-cm-editor#gjs-cm-htmlmixed #gjs-cm-title{color:#a97d44}.gjs-cm-editor#gjs-cm-css{padding-left:10px}.gjs-cm-editor#gjs-cm-css #gjs-cm-title{color:#ddca7e}.gjs-cm-editor #gjs-cm-title{background-color:rgba(0,0,0,.2);font-size:12px;padding:5px 10px 3px;text-align:right}.gjs-rte-toolbar{border:1px solid rgba(0,0,0,.2);position:absolute;border-radius:3px;z-index:10}.gjs-rte-actionbar{display:flex}.gjs-rte-action{display:flex;align-items:center;justify-content:center;padding:5px;min-width:25px;border-right:1px solid rgba(0,0,0,.2);text-align:center;cursor:pointer;outline:none}.gjs-rte-action:last-child{border-right:none}.gjs-rte-action:hover{background-color:rgba(255,255,255,.1)}.gjs-rte-active{background-color:rgba(255,255,255,.1)}.gjs-rte-disabled{color:rgba(255,255,255,.1);cursor:not-allowed}.gjs-rte-disabled:hover{background-color:unset}.gjs-editor-cont .sp-hue,.gjs-editor-cont .sp-slider{cursor:row-resize}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-dragger{cursor:crosshair}.gjs-editor-cont .sp-alpha-inner,.gjs-editor-cont .sp-alpha-handle{cursor:col-resize}.gjs-editor-cont .sp-hue{left:90%}.gjs-editor-cont .sp-color{right:15%}.gjs-editor-cont .sp-container{border:1px solid rgba(0,0,0,.2);box-shadow:0 0 7px rgba(0,0,0,.2);border-radius:3px}.gjs-editor-cont .sp-picker-container{border:none}.gjs-editor-cont .colpick_dark .colpick_color{outline:1px solid rgba(0,0,0,.2)}.gjs-editor-cont .sp-cancel,.gjs-editor-cont .sp-cancel:hover{bottom:-8px;color:#777 !important;font-size:25px;left:0;position:absolute;text-decoration:none}.gjs-editor-cont .sp-alpha-handle{background-color:#ccc;border:1px solid #555;width:4px}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-hue{border:1px solid #333}.gjs-editor-cont .sp-slider{background-color:#ccc;border:1px solid #555;height:3px;left:-4px;width:22px}.gjs-editor-cont .sp-dragger{background:transparent;box-shadow:0 0 0 1px #111}.gjs-editor-cont .sp-button-container{float:none;width:100%;position:relative;text-align:right}.gjs-editor-cont .sp-container button,.gjs-editor-cont .sp-container button:hover,.gjs-editor-cont .sp-container button:active{background:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2);color:#ddd;text-shadow:none;box-shadow:none;padding:3px 5px}.gjs-editor-cont .sp-palette-container{border:none;float:none;margin:0;padding:5px 10px 0}.gjs-editor-cont .sp-palette .sp-thumb-el,.gjs-editor-cont .sp-palette .sp-thumb-el:hover{border:1px solid rgba(0,0,0,.9)}.gjs-editor-cont .sp-palette .sp-thumb-el:hover,.gjs-editor-cont .sp-palette .sp-thumb-el.sp-thumb-active{border-color:rgba(0,0,0,.9)}.gjs-hidden{display:none}@keyframes gjs-slide-down{0%{transform:translate(0, -3rem);opacity:0}100%{transform:translate(0, 0);opacity:1}}@keyframes gjs-slide-up{0%{transform:translate(0, 0);opacity:1}100%{transform:translate(0, -3rem);opacity:0}}.cm-s-hopscotch span.cm-error{color:#fff} +.sp-container{position:absolute;top:0;left:0;display:inline-block;*display:inline;*zoom:1;z-index:9999994;overflow:hidden}.sp-container.sp-flat{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{position:relative;width:100%;display:inline-block}.sp-top-inner{position:absolute;top:0;left:0;bottom:0;right:0}.sp-color{position:absolute;top:0;left:0;bottom:0;right:20%}.sp-hue{position:absolute;top:0;right:0;bottom:0;left:84%;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{position:absolute;top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{position:absolute;top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid black;background:white;opacity:.8}.sp-alpha{display:none;position:absolute;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:solid 1px #333}.sp-clear{display:none}.sp-clear.sp-clear-display{background-position:center}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0px;right:0;bottom:0;left:84%;height:28px}.sp-container,.sp-replacer,.sp-preview,.sp-dragger,.sp-slider,.sp-alpha,.sp-clear,.sp-alpha-handle,.sp-container.sp-dragging .sp-input,.sp-container button{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-input-disabled .sp-input-container{display:none}.sp-container.sp-buttons-disabled .sp-button-container{display:none}.sp-container.sp-palette-buttons-disabled .sp-palette-button-container{display:none}.sp-palette-only .sp-picker-container{display:none}.sp-palette-disabled .sp-palette-container{display:none}.sp-initial-disabled .sp-initial{display:none}.sp-sat{background-image:-webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:linear-gradient(to right, #fff, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr="#FFFFFFFF", endColorstr="#00CC9A81")}.sp-val{background-image:-webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:linear-gradient(to top, #000, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00CC9A81", endColorstr="#FF000000")}.sp-hue{background:-moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));background:-webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff0000", endColorstr="#ffff00")}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffff00", endColorstr="#00ff00")}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ff00", endColorstr="#00ffff")}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffff", endColorstr="#0000ff")}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0000ff", endColorstr="#ff00ff")}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff00ff", endColorstr="#ff0000")}.sp-hidden{display:none !important}.sp-cf:before,.sp-cf:after{content:"";display:table}.sp-cf:after{clear:both}.sp-cf{*zoom:1}@media(max-device-width: 480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;cursor:pointer;position:absolute;top:0;left:0}.sp-slider{position:absolute;top:0;cursor:pointer;height:3px;left:-1px;right:-1px;border:1px solid #000;background:white;opacity:.8}.sp-container{border-radius:0;background-color:#ececec;border:solid 1px #f0c49b;padding:0}.sp-container,.sp-container button,.sp-container input,.sp-color,.sp-hue,.sp-clear{font:normal 12px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-color,.sp-hue,.sp-clear{border:solid 1px #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container{width:100%}.sp-input{font-size:12px !important;border:1px inset;padding:4px 5px;margin:0;width:100%;background:transparent;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-picker-container,.sp-palette-container{float:left;position:relative;padding:10px;padding-bottom:300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:solid 1px #fff}.sp-palette-container{border-right:solid 1px #ccc}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;width:24px;height:15px;margin:3px;cursor:pointer;border:solid 2px transparent}.sp-palette .sp-thumb-el:hover,.sp-palette .sp-thumb-el.sp-thumb-active{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:solid 1px #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:center}.sp-palette-button-container,.sp-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;*zoom:1;*display:inline;border:solid 1px #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer:hover,.sp-replacer.sp-active{border-color:#f0c49b;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px}.sp-preview{position:relative;width:25px;height:20px;border:solid 1px #222;margin-right:5px;float:left;z-index:0}.sp-palette{*width:220px;max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:solid 1px #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top, #eeeeee, #cccccc);background-image:-moz-linear-gradient(top, #eeeeee, #cccccc);background-image:-ms-linear-gradient(top, #eeeeee, #cccccc);background-image:-o-linear-gradient(top, #eeeeee, #cccccc);background-image:linear-gradient(to bottom, #eeeeee, #cccccc);border:1px solid #ccc;border-bottom:1px solid #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top, #dddddd, #bbbbbb);background-image:-moz-linear-gradient(top, #dddddd, #bbbbbb);background-image:-ms-linear-gradient(top, #dddddd, #bbbbbb);background-image:-o-linear-gradient(top, #dddddd, #bbbbbb);background-image:linear-gradient(to bottom, #dddddd, #bbbbbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid #aaa;border-bottom:1px solid #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f !important;margin:0;padding:2px;margin-right:5px;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f !important;text-decoration:underline}.sp-palette span:hover,.sp-palette span.sp-thumb-active{border-color:#000}.sp-preview,.sp-alpha,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-preview-inner,.sp-alpha-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=)}.sp-clear-display{background-repeat:no-repeat;background-position:center;background-image:url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAA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JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==)}.CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20, 255, 20, 0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:blue}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, 0.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, 0.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-hopscotch.CodeMirror{background:#322931;color:#d5d3d5}.cm-s-hopscotch div.CodeMirror-selected{background:#433b42 !important}.cm-s-hopscotch .CodeMirror-gutters{background:#322931;border-right:0px}.cm-s-hopscotch .CodeMirror-linenumber{color:#797379}.cm-s-hopscotch .CodeMirror-cursor{border-left:1px solid #989498 !important}.cm-s-hopscotch span.cm-comment{color:#b33508}.cm-s-hopscotch span.cm-atom{color:#c85e7c}.cm-s-hopscotch span.cm-number{color:#c85e7c}.cm-s-hopscotch span.cm-property,.cm-s-hopscotch span.cm-attribute{color:#8fc13e}.cm-s-hopscotch span.cm-keyword{color:#dd464c}.cm-s-hopscotch span.cm-string{color:#fdcc59}.cm-s-hopscotch span.cm-variable{color:#8fc13e}.cm-s-hopscotch span.cm-variable-2{color:#1290bf}.cm-s-hopscotch span.cm-def{color:#fd8b19}.cm-s-hopscotch span.cm-error{background:#dd464c;color:#989498}.cm-s-hopscotch span.cm-bracket{color:#d5d3d5}.cm-s-hopscotch span.cm-tag{color:#dd464c}.cm-s-hopscotch span.cm-link{color:#c85e7c}.cm-s-hopscotch .CodeMirror-matchingbracket{text-decoration:underline;color:white !important}.cm-s-hopscotch .CodeMirror-activeline-background{background:#302020}@font-face{font-family:"font3336";src:url("../fonts/main-fonts.eot?v=20");src:url("../fonts/main-fonts.woff?v=20") format("woff"),url("../fonts/main-fonts.ttf?v=20") format("truetype"),url("../fonts/main-fonts.svg?v=20") format("svg"),url("../fonts/main-fonts.eot?v=20") format("embedded-opentype");font-weight:normal;font-style:normal}.gjs-is__grab,.gjs-is__grab *{cursor:grab !important}.gjs-is__grabbing,.gjs-is__grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:grabbing !important}.gjs-one-bg{background-color:#444}.gjs-one-color{color:#444}.gjs-one-color-h:hover{color:#444}.gjs-two-bg{background-color:#ddd}.gjs-two-color{color:#ddd}.gjs-two-color-h:hover{color:#ddd}.gjs-three-bg{background-color:#804f7b}.gjs-three-color{color:#804f7b}.gjs-three-color-h:hover{color:#804f7b}.gjs-four-bg{background-color:#d278c9}.gjs-four-color{color:#d278c9}.gjs-four-color-h:hover{color:#d278c9}.gjs-danger-bg{background-color:#dd3636}.gjs-danger-color{color:#dd3636}.gjs-danger-color-h:hover{color:#dd3636}.gjs-bg-main,.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c,.gjs-off-prv{background-color:#444}.gjs-color-main,.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add,.gjs-off-prv{color:#ddd;fill:#ddd}.gjs-color-active{color:#f8f8f8;fill:#f8f8f8}.gjs-color-warn{color:#ffca6f;fill:#ffca6f}.gjs-color-hl{color:#71b7f1;fill:#71b7f1}.gjs-fonts::before{display:block;font:normal normal normal 14px font3336;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:5em}.gjs-f-b1::before{content:"Q"}.gjs-f-b2::before{content:"W"}.gjs-f-b3::before{content:"E"}.gjs-f-b37::before{content:"R"}.gjs-f-hero::before{content:"T"}.gjs-f-h1p::before{content:"y"}.gjs-f-3ba::before{content:"u"}.gjs-f-image::before{content:"I"}.gjs-f-text::before{content:"o"}.gjs-f-quo::before{content:"p"}.gjs-f-button::before{content:"B"}.gjs-f-divider::before{content:"D"}.gjs-invis-invis,.gjs-clm-tags #gjs-clm-new,.gjs-no-app{background-color:transparent;border:none;color:inherit}.gjs-no-app{height:10px}.gjs-test::btn{color:"#fff"}.opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-checker-bg,.gjs-field-colorp-c,.checker-bg,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==")}.gjs-no-user-select,.gjs-rte-toolbar,.gjs-layer-name,.gjs-grabbing,.gjs-grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-pointer-events,.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el,.gjs-resizer-c{pointer-events:none}.gjs-bdrag{pointer-events:none !important;position:absolute !important;z-index:10 !important;width:auto}.gjs-drag-helper{background-color:#3b97e3 !important;pointer-events:none !important;position:absolute !important;z-index:10 !important;transform:scale(0.3) !important;transform-origin:top left !important;-webkit-transform-origin:top left !important;margin:15px !important;transition:none !important;outline:none !important}.gjs-grabbing,.gjs-grabbing *{cursor:grabbing !important;cursor:-webkit-grabbing !important}.gjs-grabbing{overflow:hidden}.gjs-off-prv{position:relative;z-index:10;padding:5px;cursor:pointer}.gjs-editor-cont ::-webkit-scrollbar-track{background:rgba(0,0,0,.1)}.gjs-editor-cont ::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.2)}.gjs-editor-cont ::-webkit-scrollbar{width:8px}.clear{clear:both}.no-select,.gjs-clm-tags #gjs-clm-close,.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title,.gjs-com-no-select,.gjs-com-no-select img{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-touch-actions{touch-action:none}.gjs-disabled{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;opacity:.5;filter:alpha(opacity=50)}.gjs-editor{font-family:Helvetica,sans-serif;font-size:.75rem;position:relative;box-sizing:border-box;height:100%}.gjs-freezed,.gjs-freezed{opacity:.5;filter:alpha(opacity=50);pointer-events:none}.gjs-traits-label{border-bottom:1px solid rgba(0,0,0,.2);font-weight:lighter;margin-bottom:5px;padding:10px;text-align:left}.gjs-label-wrp{width:30%;min-width:30%}.gjs-field-wrp{flex-grow:1}.gjs-trt-header{font-weight:lighter;padding:10px}.gjs-trt-trait{display:flex;justify-content:flex-start;padding:5px 10px;font-weight:lighter;align-items:center;text-align:left}.gjs-trt-traits{font-size:.75rem}.gjs-trt-trait .gjs-label{text-align:left;text-overflow:ellipsis;overflow:hidden}.gjs-guide-info{position:absolute}.gjs-guide-info__content{position:absolute;height:100%;display:flex;width:100%;padding:5px}.gjs-guide-info__line{position:relative;margin:auto}.gjs-guide-info__line::before,.gjs-guide-info__line::after{content:"";display:block;position:absolute;background-color:inherit}.gjs-guide-info__y{padding:0 5px}.gjs-guide-info__y .gjs-guide-info__content{justify-content:center}.gjs-guide-info__y .gjs-guide-info__line{width:100%;height:1px}.gjs-guide-info__y .gjs-guide-info__line::before,.gjs-guide-info__y .gjs-guide-info__line::after{width:1px;height:10px;top:0;bottom:0;left:0;margin:auto}.gjs-guide-info__y .gjs-guide-info__line::after{left:auto;right:0}.gjs-guide-info__x{padding:5px 0}.gjs-guide-info__x .gjs-guide-info__content{align-items:center}.gjs-guide-info__x .gjs-guide-info__line{height:100%;width:1px}.gjs-guide-info__x .gjs-guide-info__line::before,.gjs-guide-info__x .gjs-guide-info__line::after{width:10px;height:1px;left:0;right:0;top:0;margin:auto;transform:translateX(-50%)}.gjs-guide-info__x .gjs-guide-info__line::after{top:auto;bottom:0}.gjs-badge{white-space:nowrap}.gjs-badge__icon{vertical-align:middle;display:inline-block;width:15px;height:15px}.gjs-badge__icon svg{fill:currentColor}.gjs-badge__name{display:inline-block;vertical-align:middle}.gjs-frame-wrapper{position:absolute;width:100%;height:100%;left:0;right:0;margin:auto}.gjs-frame-wrapper--anim{transition:width .35s ease,height .35s ease}.gjs-frame-wrapper__top{transform:translateY(-100%) translateX(-50%);display:flex;padding:5px 0;position:absolute;width:100%;left:50%;top:0}.gjs-frame-wrapper__top-r{margin-left:auto}.gjs-frame-wrapper__left{position:absolute;left:0;transform:translateX(-100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__bottom{position:absolute;bottom:0;transform:translateY(100%) translateX(-50%);width:100%;left:50%}.gjs-frame-wrapper__right{position:absolute;right:0;transform:translateX(100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__icon{width:24px;cursor:pointer}.gjs-frame-wrapper__icon>svg{fill:currentColor}.gjs-padding-v-top,.gjs-fixedpadding-v-top{width:100%;top:0;left:0}.gjs-padding-v-right,.gjs-fixedpadding-v-right{right:0}.gjs-padding-v-bottom,.gjs-fixedpadding-v-bottom{width:100%;left:0;bottom:0}.gjs-padding-v-left,.gjs-fixedpadding-v-left{left:0}.gjs-cv-canvas{background-color:rgba(0,0,0,.15);box-sizing:border-box;width:85%;height:calc(100% - 40px);bottom:0;overflow:hidden;z-index:1;position:absolute;left:0;top:40px}.gjs-cv-canvas.gjs-cui{width:100%;height:100%;top:0}.gjs-cv-canvas.gjs-is__grab .gjs-cv-canvas__frames,.gjs-cv-canvas.gjs-is__grabbing .gjs-cv-canvas__frames{pointer-events:none}.gjs-cv-canvas__frames{position:absolute;top:0;left:0;width:100%;height:100%}.gjs-cv-canvas .gjs-ghost{display:none;pointer-events:none;background-color:#5b5b5b;border:2px dashed #ccc;position:absolute;z-index:10;opacity:.55;filter:alpha(opacity=55)}.gjs-cv-canvas .gjs-highlighter,.gjs-cv-canvas .gjs-highlighter-sel{position:absolute;outline:1px solid #3b97e3;outline-offset:-1px;pointer-events:none;width:100%;height:100%}.gjs-cv-canvas .gjs-highlighter-warning{outline:3px solid #ffca6f}.gjs-cv-canvas .gjs-highlighter-sel{outline:2px solid #3b97e3;outline-offset:-2px}.gjs-cv-canvas #gjs-tools,.gjs-cv-canvas .gjs-tools{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;z-index:1}.gjs-cv-canvas *{box-sizing:border-box}.gjs-frame{outline:medium none;height:100%;width:100%;border:none;margin:auto;display:block;transition:width .35s ease,height .35s ease;position:absolute;top:0;bottom:0;left:0;right:0}.gjs-toolbar{position:absolute;background-color:#3b97e3;white-space:nowrap;color:#fff;z-index:10;top:0;left:0}.gjs-toolbar-item{padding:5px 7px;font-size:.8rem;cursor:pointer;width:26px;vertical-align:middle;display:inline-block}.gjs-toolbar-item svg{fill:currentColor;vertical-align:middle}.gjs-resizer-c{position:absolute;left:0;top:0;width:100%;height:100%;z-index:9}.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.1;filter:alpha(opacity=10);position:absolute;background-color:#ff0}.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.2;filter:alpha(opacity=20)}.gjs-padding-v-el,.gjs-fixedpadding-v-el{background-color:navy}.gjs-resizer-h{pointer-events:all;position:absolute;border:3px solid #3b97e3;width:10px;height:10px;background-color:#fff;margin:-5px}.gjs-resizer-h-tl{top:0;left:0;cursor:nwse-resize}.gjs-resizer-h-tr{top:0;right:0;cursor:nesw-resize}.gjs-resizer-h-tc{top:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-cl{left:0;margin:auto -5px;top:0;bottom:0;cursor:ew-resize}.gjs-resizer-h-cr{margin:auto -5px;top:0;bottom:0;right:0;cursor:ew-resize}.gjs-resizer-h-bl{bottom:0;left:0;cursor:nesw-resize}.gjs-resizer-h-bc{bottom:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-br{bottom:0;right:0;cursor:nwse-resize}.gjs-pn-panel .gjs-resizer-h{background-color:rgba(0,0,0,.2);border:none;opacity:0;transition:opacity .25s}.gjs-pn-panel .gjs-resizer-h:hover{opacity:1}.gjs-pn-panel .gjs-resizer-h-tc,.gjs-pn-panel .gjs-resizer-h-bc{margin:0 auto;width:100%}.gjs-pn-panel .gjs-resizer-h-cr,.gjs-pn-panel .gjs-resizer-h-cl{margin:auto 0;height:100%}.gjs-resizing .gjs-highlighter,.gjs-resizing .gjs-badge{display:none !important}.gjs-resizing-tl *{cursor:nwse-resize !important}.gjs-resizing-tr *{cursor:nesw-resize !important}.gjs-resizing-tc *{cursor:ns-resize !important}.gjs-resizing-cl *{cursor:ew-resize !important}.gjs-resizing-cr *{cursor:ew-resize !important}.gjs-resizing-bl *{cursor:nesw-resize !important}.gjs-resizing-bc *{cursor:ns-resize !important}.gjs-resizing-br *{cursor:nwse-resize !important}.btn-cl,.gjs-am-close,.gjs-mdl-btn-close{opacity:.3;filter:alpha(opacity=30);font-size:25px;cursor:pointer}.btn-cl:hover,.gjs-am-close:hover,.gjs-mdl-btn-close:hover{opacity:.7;filter:alpha(opacity=70)}.no-dots,.ui-resizable-handle{border:none !important;margin:0 !important;outline:none !important}.gjs-com-dashed *{outline:1px dashed #888;outline-offset:-2px;box-sizing:border-box}.gjs-cv-canvas .gjs-comp-selected{outline:3px solid #3b97e3 !important}*.gjs-com-hover,div.gjs-com-hover{outline:1px solid #3b97e3}*.gjs-com-hover-delete,div.gjs-com-hover-delete{outline:2px solid #dd3636;opacity:.5;filter:alpha(opacity=50)}*.gjs-com-hover-move,div.gjs-com-hover-move{outline:3px solid #ffca6f}.gjs-com-badge,.gjs-com-badge-red,.gjs-badge{pointer-events:none;background-color:#3b97e3;color:#fff;padding:2px 5px;position:absolute;z-index:1;font-size:12px;outline:none;display:none}.gjs-com-badge-red{background-color:#dd3636}.gjs-badge-warning{background-color:#ffca6f}.gjs-placeholder,.gjs-com-placeholder,.gjs-placeholder{position:absolute;z-index:10;pointer-events:none;display:none}.gjs-placeholder,.gjs-placeholder{border-style:solid !important;outline:none;box-sizing:border-box;transition:top .2s,left .2s,width .2s,height .2s}.gjs-placeholder.horizontal,.gjs-com-placeholder.horizontal,.gjs-placeholder.horizontal{border-color:transparent #62c462;border-width:3px 5px;margin:-3px 0 0}.gjs-placeholder.vertical,.gjs-com-placeholder.vertical,.gjs-placeholder.vertical{border-color:#62c462 transparent;border-width:5px 3px;margin:0 0 0 -3px}.gjs-placeholder-int,.gjs-com-placeholder-int,.gjs-placeholder-int{background-color:#62c462;box-shadow:0 0 3px rgba(0,0,0,.2);height:100%;width:100%;pointer-events:none;padding:1.5px;outline:none}.gjs-pn-panel{display:inline-block;position:absolute;box-sizing:border-box;text-align:center;padding:5px;z-index:3}.gjs-pn-panel .icon-undo,.gjs-pn-panel .icon-redo{font-size:20px;height:30px;width:25px}.gjs-pn-commands{width:85%;left:0;top:0;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-options{right:15%;top:0}.gjs-pn-views{border-bottom:2px solid rgba(0,0,0,.2);right:0;width:15%;z-index:4}.gjs-pn-views-container{height:100%;padding:42px 0 0;right:0;width:15%;overflow:auto;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-buttons{align-items:center;display:flex;justify-content:space-between}.gjs-pn-btn{box-sizing:border-box;min-height:30px;min-width:30px;line-height:21px;background-color:transparent;border:none;font-size:18px;margin-right:5px;border-radius:2px;padding:4px;position:relative;cursor:pointer}.gjs-pn-btn.gjs-pn-active{background-color:rgba(0,0,0,.15);box-shadow:0 0 3px rgba(0,0,0,.25) inset}.gjs-pn-btn svg{fill:currentColor}.gjs-comp-image-placeholder{display:block;background-color:#f5f5f5;color:#777;height:50px;width:50px;line-height:50px;outline:3px solid #ffca6f;outline-offset:-3px;text-align:center;font-size:16.6666666667px;cursor:pointer}.gjs-comp-image-placeholder.fa-picture-o::after{content:""}.gjs-label{line-height:18px}.gjs-fields{display:flex}.gjs-select{padding:0;width:100%}.gjs-select select{padding-right:10px}.gjs-select:-moz-focusring,.gjs-select select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-input:focus,.gjs-button:focus,.gjs-btn-prim:focus,.gjs-select:focus,.gjs-select select:focus{outline:none}.gjs-field input,.gjs-field select,.gjs-field textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:inherit;border:none;background-color:transparent;box-sizing:border-box;width:100%;position:relative;padding:5px;z-index:1}.gjs-field input:focus,.gjs-field select:focus,.gjs-field textarea:focus{outline:none}.gjs-field input[type=number]{-moz-appearance:textfield}.gjs-field input[type=number]::-webkit-outer-spin-button,.gjs-field input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gjs-field-range{flex:9 1 auto}.gjs-field-integer input{padding-right:30px}.gjs-select option,.gjs-field-select option,.gjs-clm-select option,.gjs-sm-select option,.gjs-fields option,.gjs-sm-unit option{background-color:#444;color:#ddd}.gjs-field{background-color:rgba(0,0,0,.2);border:none;box-shadow:none;border-radius:2px;box-sizing:border-box;padding:0;position:relative}.gjs-field textarea{resize:vertical}.gjs-field .gjs-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;z-index:0}.gjs-field .gjs-d-s-arrow{bottom:0;top:0;margin:auto;right:5px;border-top:4px solid rgba(255,255,255,.7);position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-field-arrows{position:absolute;cursor:ns-resize;margin:auto;height:20px;width:9px;z-index:10;bottom:0;right:3px;top:0}.gjs-field-color,.gjs-field-radio{width:100%}.gjs-field-color input{padding-right:22px;box-sizing:border-box}.gjs-field-colorp{border-left:1px solid rgba(0,0,0,.2);box-sizing:border-box;height:100%;padding:2px;position:absolute;right:0;top:0;width:22px;z-index:10}.gjs-field-colorp .gjs-checker-bg,.gjs-field-colorp .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-field-colorp-c{height:100%;position:relative;width:100%}.gjs-field-color-picker{background-color:#ddd;cursor:pointer;height:100%;width:100%;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px;position:absolute;top:0}.gjs-field-checkbox{padding:0;width:17px;height:17px;display:block;cursor:pointer}.gjs-field-checkbox input{display:none}.gjs-field-checkbox input:checked+.gjs-chk-icon{border-color:rgba(255,255,255,.5);border-width:0 2px 2px 0;border-style:solid}.gjs-radio-item{flex:1 1 auto;text-align:center;border-left:1px solid rgba(0,0,0,.2)}.gjs-radio-item:first-child{border:none}.gjs-radio-item:hover{background:rgba(0,0,0,.2)}.gjs-radio-item input{display:none}.gjs-radio-item input:checked+.gjs-radio-item-label{background-color:rgba(255,255,255,.2)}.gjs-radio-items{display:flex}.gjs-radio-item-label{cursor:pointer;display:block;padding:5px}.gjs-field-units{position:absolute;margin:auto;right:10px;bottom:0;top:0}.gjs-field-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-field-arrow-u,.gjs-field-arrow-d{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(255,255,255,.7);bottom:4px;cursor:pointer}.gjs-field-arrow-u{border-bottom:4px solid rgba(255,255,255,.7);border-top:none;top:4px}.gjs-field-select{padding:0}.gjs-field-range{background-color:transparent;border:none;box-shadow:none;padding:0}.gjs-field-range input{margin:0;height:100%}.gjs-field-range input:focus{outline:none}.gjs-field-range input::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-ms-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-webkit-slider-runnable-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-ms-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-btn-prim{color:inherit;background-color:rgba(255,255,255,.1);border-radius:2px;padding:3px 6px;padding:5px;cursor:pointer;border:none}.gjs-btn-prim:active{background-color:rgba(255,255,255,.1)}.gjs-btn--full{width:100%}.gjs-chk-icon{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);box-sizing:border-box;display:block;height:14px;margin:0 5px;width:6px}.gjs-add-trasp{background:none;border:none;color:#ddd;cursor:pointer;font-size:1em;border-radius:2px;opacity:.75;filter:alpha(opacity=75)}.gjs-add-trasp:hover{opacity:1;filter:alpha(opacity=100)}.gjs-add-trasp:active{background-color:rgba(0,0,0,.2)}.gjs-devices-c{display:flex;align-items:center;padding:3px}.gjs-devices-c .gjs-device-label{flex-grow:2;text-align:left;margin-right:10px}.gjs-devices-c .gjs-select{flex-grow:20}.gjs-devices-c .gjs-add-trasp{flex-grow:1;margin-left:5px}.gjs-category-open,.gjs-block-category.gjs-open,.gjs-sm-sector.gjs-sm-open,.gjs-sm-open.gjs-clm-tags{border-bottom:1px solid rgba(0,0,0,.25)}.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title{font-weight:lighter;background-color:rgba(0,0,0,.1);letter-spacing:1px;padding:9px 10px 9px 20px;border-bottom:1px solid rgba(0,0,0,.25);text-align:left;position:relative;cursor:pointer}.gjs-sm-clear{line-height:0;cursor:pointer}.gjs-sm-header{font-weight:lighter;padding:10px}.gjs-sm-properties{font-size:.75rem;padding:10px 5px;display:flex;flex-wrap:wrap;align-items:flex-end;box-sizing:border-box;width:100%}.gjs-sm-label{margin:5px 5px 3px 0}.gjs-sm-close-btn,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.2;filter:alpha(opacity=20)}.gjs-sm-close-btn:hover,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover{opacity:.7;filter:alpha(opacity=70)}.gjs-sm-sector,.gjs-clm-tags{clear:both;font-weight:lighter;text-align:left}.gjs-sm-sector #gjs-sm-caret,.gjs-clm-tags #gjs-sm-caret{padding-right:5px;font-size:11px}.gjs-sm-sector .gjs-sm-field,.gjs-clm-tags .gjs-sm-field,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-clm-field,.gjs-clm-tags .gjs-clm-field{width:100%;position:relative}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input,.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{background-color:transparent;color:rgba(255,255,255,.7);border:none;width:100%}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input{box-sizing:border-box}.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gjs-sm-sector .gjs-sm-field select::-ms-expand,.gjs-clm-tags .gjs-sm-field select::-ms-expand,.gjs-sm-sector .gjs-clm-select select::-ms-expand,.gjs-clm-tags .gjs-clm-select select::-ms-expand,.gjs-sm-sector .gjs-clm-field select::-ms-expand,.gjs-clm-tags .gjs-clm-field select::-ms-expand{display:none}.gjs-sm-sector .gjs-sm-field select:-moz-focusring,.gjs-clm-tags .gjs-sm-field select:-moz-focusring,.gjs-sm-sector .gjs-clm-select select:-moz-focusring,.gjs-clm-tags .gjs-clm-select select:-moz-focusring,.gjs-sm-sector .gjs-clm-field select:-moz-focusring,.gjs-clm-tags .gjs-clm-field select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-sm-sector .gjs-sm-field input:focus,.gjs-clm-tags .gjs-sm-field input:focus,.gjs-sm-sector .gjs-clm-select input:focus,.gjs-clm-tags .gjs-clm-select input:focus,.gjs-sm-sector .gjs-clm-field input:focus,.gjs-clm-tags .gjs-clm-field input:focus,.gjs-sm-sector .gjs-sm-field select:focus,.gjs-clm-tags .gjs-sm-field select:focus,.gjs-sm-sector .gjs-clm-select select:focus,.gjs-clm-tags .gjs-clm-select select:focus,.gjs-sm-sector .gjs-clm-field select:focus,.gjs-clm-tags .gjs-clm-field select:focus{outline:none}.gjs-sm-sector .gjs-sm-field .gjs-sm-unit,.gjs-clm-tags .gjs-sm-field .gjs-sm-unit,.gjs-sm-sector .gjs-clm-select .gjs-sm-unit,.gjs-clm-tags .gjs-clm-select .gjs-sm-unit,.gjs-sm-sector .gjs-clm-field .gjs-sm-unit,.gjs-clm-tags .gjs-clm-field .gjs-sm-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-sm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-select .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-select .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;cursor:ns-resize}.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{border-bottom:4px solid rgba(255,255,255,.7);top:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{border-top:4px solid rgba(255,255,255,.7);bottom:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{bottom:7px}.gjs-sm-sector .gjs-sm-field.gjs-sm-color,.gjs-clm-tags .gjs-sm-field.gjs-sm-color,.gjs-sm-sector .gjs-sm-color.gjs-clm-field,.gjs-clm-tags .gjs-sm-color.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-input,.gjs-clm-tags .gjs-sm-field.gjs-sm-input,.gjs-sm-sector .gjs-sm-input.gjs-clm-field,.gjs-clm-tags .gjs-sm-input.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-integer,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{background-color:rgba(0,0,0,.2);border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 0 rgba(255,255,255,.1);color:rgba(255,255,255,.7);border-radius:2px;box-sizing:border-box;padding:0 5px}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{border-radius:2px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{padding:0}.gjs-sm-sector .gjs-sm-field.gjs-sm-select select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field select,.gjs-clm-tags .gjs-sm-select.gjs-clm-field select{height:20px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select option,.gjs-clm-tags .gjs-sm-field.gjs-sm-select option,.gjs-sm-sector .gjs-clm-select option,.gjs-clm-tags .gjs-clm-select option,.gjs-sm-sector .gjs-sm-select.gjs-clm-field option,.gjs-clm-tags .gjs-sm-select.gjs-clm-field option{padding:3px 0}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{background-color:rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.25)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-select,.gjs-clm-tags .gjs-sm-list.gjs-clm-select,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field{width:auto;padding:0;overflow:hidden;float:left}.gjs-sm-sector .gjs-sm-field.gjs-sm-list input,.gjs-clm-tags .gjs-sm-field.gjs-sm-list input,.gjs-sm-sector .gjs-sm-list.gjs-clm-select input,.gjs-clm-tags .gjs-sm-list.gjs-clm-select input,.gjs-sm-sector .gjs-sm-list.gjs-clm-field input,.gjs-clm-tags .gjs-sm-list.gjs-clm-field input{display:none}.gjs-sm-sector .gjs-sm-field.gjs-sm-list label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field label{cursor:pointer;padding:5px;display:block}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label{background-color:rgba(255,255,255,.2)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-icon{background-repeat:no-repeat;background-position:center;text-shadow:none;line-height:normal}.gjs-sm-sector .gjs-sm-field.gjs-sm-integer select,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-select select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-select select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field select{width:auto;padding:0}.gjs-sm-sector .gjs-sm-list .gjs-sm-el,.gjs-clm-tags .gjs-sm-list .gjs-sm-el{float:left;border-left:1px solid rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:first-child,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:first-child{border:none}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:hover,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:hover{background:rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-slider .gjs-field-integer,.gjs-clm-tags .gjs-sm-slider .gjs-field-integer{flex:1 1 65px}.gjs-sm-sector .gjs-sm-property,.gjs-clm-tags .gjs-sm-property{box-sizing:border-box;float:left;width:50%;margin-bottom:5px;padding:0 5px}.gjs-sm-sector .gjs-sm-property--full,.gjs-clm-tags .gjs-sm-property--full,.gjs-sm-sector .gjs-sm-property.gjs-sm-composite,.gjs-clm-tags .gjs-sm-property.gjs-sm-composite,.gjs-sm-sector .gjs-sm-property.gjs-sm-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file,.gjs-sm-sector .gjs-sm-property.gjs-sm-list,.gjs-clm-tags .gjs-sm-property.gjs-sm-list,.gjs-sm-sector .gjs-sm-property.gjs-sm-stack,.gjs-clm-tags .gjs-sm-property.gjs-sm-stack,.gjs-sm-sector .gjs-sm-property.gjs-sm-slider,.gjs-clm-tags .gjs-sm-property.gjs-sm-slider,.gjs-sm-sector .gjs-sm-property.gjs-sm-color,.gjs-clm-tags .gjs-sm-property.gjs-sm-color{width:100%}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn{background-color:rgba(33,33,33,.2);border-radius:2px;box-shadow:1px 1px 0 rgba(5,5,5,.2),1px 1px 0 rgba(43,43,43,.2) inset;padding:5px;position:relative;text-align:center;height:auto;width:100%;cursor:pointer;color:#ddd;box-sizing:border-box;text-shadow:-1px -1px 0 rgba(0,0,0,.2);border:none;opacity:.85;filter:alpha(opacity=85)}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn-c,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn-c{box-sizing:border-box;float:left;width:100%}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box{background-color:rgba(255,255,255,.05);border-radius:2px;margin-top:5px;position:relative;overflow:hidden}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show{border:1px solid rgba(252,252,252,.05);padding:3px 20px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{top:-5px;display:block}.gjs-sm-sector .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file{height:50px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file{background-size:auto 100%;background-repeat:no-repeat;background-position:center center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layers,.gjs-clm-tags .gjs-sm-property .gjs-sm-layers{margin-top:5px;padding:1px 3px;min-height:30px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer{background-color:rgba(255,255,255,.055);border-radius:2px;margin:2px 0;padding:7px;position:relative}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer.gjs-sm-active,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer.gjs-sm-active{background-color:rgba(255,255,255,.12)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp{display:flex;align-items:center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-move,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-move{height:14px;width:14px;min-width:14px;cursor:grab}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-label,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-label{flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0 5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{height:15px;width:15px;min-width:15px;margin-right:5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview{background-color:#fff;height:100%;width:100%;background-size:cover !important}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{border-radius:2px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer{display:block;cursor:pointer;height:14px;width:14px;min-width:14px;opacity:.5;filter:alpha(opacity=50)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover{opacity:.8;filter:alpha(opacity=80)}.gjs-sm-sector #gjs-sm-text-shadow #gjs-sm-preview::after,.gjs-clm-tags #gjs-sm-text-shadow #gjs-sm-preview::after{color:#000;content:"T";font-weight:900;line-height:17px;padding:0 4px}.gjs-sm-sector .gjs-sm-stack .gjs-sm-properties,.gjs-clm-tags .gjs-sm-stack .gjs-sm-properties{padding:5px 0 0}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add{background:none;border:none;cursor:pointer;outline:none;font-size:22px;line-height:10px;position:absolute;right:0;top:-17px;opacity:.75}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add:hover,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add:hover{opacity:1;filter:alpha(opacity=100)}.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c{height:100%;width:20px;position:absolute;right:0;top:0;box-sizing:border-box;border-radius:2px;padding:2px}.gjs-sm-sector .gjs-sm-colorp-c .gjs-checker-bg,.gjs-clm-tags .gjs-sm-colorp-c .gjs-checker-bg,.gjs-sm-sector .gjs-sm-colorp-c .gjs-field-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-sm-sector .gjs-sm-color-picker,.gjs-clm-tags .gjs-sm-color-picker{background-color:#ddd;cursor:pointer;height:16px;width:100%;margin-top:-16px;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-upload,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-upload{left:0;top:0;position:absolute;width:100%;opacity:0;cursor:pointer}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-label,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-label{padding:2px 0}.gjs-sm-layer>#gjs-sm-move{opacity:.7;filter:alpha(opacity=70);cursor:move;font-size:12px;float:left;margin:0 5px 0 0}.gjs-sm-layer>#gjs-sm-move:hover{opacity:.9;filter:alpha(opacity=90)}.gjs-blocks-c{display:flex;flex-wrap:wrap;justify-content:flex-start}.gjs-block-categories{display:flex;flex-direction:column}.gjs-block-category{width:100%}.gjs-block-category .gjs-caret-icon{margin-right:5px}.gjs-block{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;width:45%;min-width:45px;padding:1em;box-sizing:border-box;min-height:90px;cursor:all-scroll;font-size:11px;font-weight:lighter;text-align:center;display:flex;flex-direction:column;justify-content:space-between;border:1px solid rgba(0,0,0,.2);border-radius:3px;margin:10px 2.5% 5px;box-shadow:0 1px 0 0 rgba(0,0,0,.15);transition:all .2s ease 0s;transition-property:box-shadow,color}.gjs-block:hover{box-shadow:0 3px 4px 0 rgba(0,0,0,.15)}.gjs-block svg{fill:currentColor}.gjs-block__media{margin-bottom:10px;pointer-events:none}.gjs-block-svg{width:54px;fill:currentColor}.gjs-block-svg-path{fill:currentColor}.gjs-block.fa{font-size:2em;line-height:2em;padding:11px}.gjs-block-label{line-height:normal;font-size:.65rem;font-weight:normal;font-family:Helvetica,sans-serif;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.gjs-block.gjs-bdrag{width:auto;padding:0}.gjs-selected-parent{border:1px solid #ffca6f}.gjs-opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-layer{font-weight:lighter;text-align:left;position:relative;background-color:rgba(0,0,0,.1);font-size:.75rem;display:grid}.gjs-layer-hidden{opacity:.55;filter:alpha(opacity=55)}.gjs-layer-count{position:absolute;right:27px;top:9px}.gjs-layer-vis{height:auto !important;width:auto !important;left:0;top:0;padding:7px 5px 7px 10px;position:absolute;cursor:pointer;z-index:1}.gjs-layer-caret{font-size:.5rem;width:8px;padding:2px;cursor:pointer;position:absolute;left:-9px;top:6px;opacity:.7;filter:alpha(opacity=70)}.gjs-layer-caret:hover{opacity:1;filter:alpha(opacity=100)}.gjs-layer-title{padding:3px 10px 5px 30px;display:flex;align-items:center}.gjs-layer-title-inn{align-items:center;position:relative;display:flex;width:100%}.gjs-layer__icon{display:block;width:100%;max-width:15px;max-height:15px;padding-left:5px}.gjs-layer__icon svg{fill:currentColor}.gjs-layer-name{padding:5px 0;display:inline-block;box-sizing:content-box;overflow:hidden;white-space:nowrap;margin:0 30px 0 5px}.gjs-layer-name--no-edit{text-overflow:ellipsis}.gjs-layer>.gjs-layer-children{display:none}.gjs-layer.open>.gjs-layer-children{display:block}.gjs-layer-no-chld>.gjs-layer-title-inn>.gjs-layer-caret{display:none}.gjs-layer-move{padding:7px 10px 7px 5px;position:absolute;font-size:12px;cursor:move;right:0;top:0}.gjs-layer.gjs-hovered .gjs-layer-title{background-color:rgba(255,255,255,.015)}.gjs-layer.gjs-selected .gjs-layer-title{background-color:rgba(255,255,255,.1)}.gjs-layers{position:relative;height:100%}.gjs-layers #gjs-placeholder{width:100%;position:absolute}.gjs-layers #gjs-placeholder #gjs-plh-int{height:100%;padding:1px}.gjs-layers #gjs-placeholder #gjs-plh-int.gjs-insert{background-color:#62c462}#gjs-clm-add-tag,.gjs-clm-tags-btn{background-color:rgba(255,255,255,.15);border-radius:2px;padding:3px;margin-right:3px;border:1px solid rgba(0,0,0,.15);width:24px;height:24px;box-sizing:border-box;cursor:pointer}.gjs-clm-tags-btn svg{fill:currentColor;display:block}.gjs-clm-header{display:flex;align-items:center;margin:7px 0}.gjs-clm-header-status{flex-shrink:1;margin-left:auto}.gjs-clm-tag{display:flex;overflow:hidden;align-items:center;border-radius:3px;margin:0 3px 3px 0;padding:5px;cursor:default}.gjs-clm-tag-status,.gjs-clm-tag-close{width:12px;height:12px;flex-shrink:1}.gjs-clm-tag-status svg,.gjs-clm-tag-close svg{vertical-align:middle;fill:currentColor}.gjs-clm-sels-info{margin:7px 0}.gjs-clm-sel-id{font-size:.9em;opacity:.5;filter:alpha(opacity=50)}.gjs-clm-label-sel{float:left;padding-right:5px}.gjs-clm-tags{font-size:.75rem;padding:10px 5px}.gjs-clm-tags #gjs-clm-sel{padding:7px 0;float:left}.gjs-clm-tags #gjs-clm-sel{font-style:italic;margin-left:5px}.gjs-clm-tags #gjs-clm-tags-field{clear:both;padding:5px;margin-bottom:5px;display:flex;flex-wrap:wrap}.gjs-clm-tags #gjs-clm-tags-c{display:flex;flex-wrap:wrap;vertical-align:top;overflow:hidden}.gjs-clm-tags #gjs-clm-new{color:#ddd;padding:5px 6px;display:none}.gjs-clm-tags #gjs-clm-close{opacity:.85;filter:alpha(opacity=85);font-size:20px;line-height:0;cursor:pointer;color:rgba(255,255,255,.9)}.gjs-clm-tags #gjs-clm-close:hover{opacity:1;filter:alpha(opacity=100)}.gjs-clm-tags #gjs-clm-checkbox{color:rgba(255,255,255,.9);vertical-align:middle;cursor:pointer;font-size:9px}.gjs-clm-tags #gjs-clm-tag-label{flex-grow:1;text-overflow:ellipsis;overflow:hidden;padding:0 3px;cursor:text}.gjs-mdl-container{font-family:Helvetica,sans-serif;overflow-y:auto;position:fixed;background-color:rgba(0,0,0,.5);display:flex;top:0;left:0;right:0;bottom:0;z-index:100}.gjs-mdl-dialog{text-shadow:-1px -1px 0 rgba(0,0,0,.05);animation:gjs-slide-down .215s;margin:auto;max-width:850px;width:90%;border-radius:3px;font-weight:lighter;position:relative;z-index:2}.gjs-mdl-title{font-size:1rem}.gjs-mdl-btn-close{position:absolute;right:15px;top:5px}.gjs-mdl-active .gjs-mdl-dialog{animation:gjs-mdl-slide-down .216s}.gjs-mdl-header,.gjs-mdl-content{padding:10px 15px;clear:both}.gjs-mdl-header{position:relative;border-bottom:1px solid rgba(0,0,0,.2);padding:15px 15px 7px}.gjs-export-dl::after{content:"";clear:both;display:block;margin-bottom:10px}.gjs-dropzone{display:none;opacity:0;position:absolute;top:0;left:0;z-index:11;width:100%;height:100%;transition:opacity .25s;pointer-events:none}.gjs-dropzone-active .gjs-dropzone{display:block;opacity:1}.gjs-am-assets{height:290px;overflow:auto;clear:both;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:flex-start}.gjs-am-assets-header{padding:5px}.gjs-am-add-asset .gjs-am-add-field{width:70%;float:left}.gjs-am-add-asset button{width:25%;float:right}.gjs-am-preview-cont{position:relative;height:70px;width:30%;background-color:#444;border-radius:2px;float:left;overflow:hidden}.gjs-am-preview{position:absolute;background-position:center center;background-size:cover;background-repeat:no-repeat;height:100%;width:100%;z-index:1}.gjs-am-preview-bg{opacity:.5;filter:alpha(opacity=50);position:absolute;height:100%;width:100%;z-index:0}.gjs-am-dimensions{opacity:.5;filter:alpha(opacity=50);font-size:10px}.gjs-am-meta{width:70%;float:left;font-size:12px;padding:5px 0 0 5px;box-sizing:border-box}.gjs-am-meta>div{margin-bottom:5px}.gjs-am-close{cursor:pointer;position:absolute;right:5px;top:0;display:none}.gjs-am-asset{border-bottom:1px solid rgba(0,0,0,.2);padding:5px;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.gjs-am-asset:hover .gjs-am-close{display:block}.gjs-am-highlight{background-color:rgba(255,255,255,.1)}.gjs-am-assets-cont{background-color:rgba(0,0,0,.1);border-radius:3px;box-sizing:border-box;padding:10px;width:45%;float:right;height:325px;overflow:hidden}.gjs-am-file-uploader{width:55%;float:left}.gjs-am-file-uploader>form{background-color:rgba(0,0,0,.1);border:2px dashed;border-radius:3px;position:relative;text-align:center;margin-bottom:15px}.gjs-am-file-uploader>form.gjs-am-hover{border:2px solid #62c462;color:#75cb75}.gjs-am-file-uploader>form.gjs-am-disabled{border-color:red}.gjs-am-file-uploader>form #gjs-am-uploadFile{opacity:0;filter:alpha(opacity=0);padding:150px 10px;width:100%;box-sizing:border-box}.gjs-am-file-uploader #gjs-am-title{position:absolute;padding:150px 10px;width:100%}.gjs-cm-editor-c{float:left;box-sizing:border-box;width:50%}.gjs-cm-editor-c .CodeMirror{height:450px}.gjs-cm-editor{font-size:12px}.gjs-cm-editor#gjs-cm-htmlmixed{padding-right:10px;border-right:1px solid rgba(0,0,0,.2)}.gjs-cm-editor#gjs-cm-htmlmixed #gjs-cm-title{color:#a97d44}.gjs-cm-editor#gjs-cm-css{padding-left:10px}.gjs-cm-editor#gjs-cm-css #gjs-cm-title{color:#ddca7e}.gjs-cm-editor #gjs-cm-title{background-color:rgba(0,0,0,.2);font-size:12px;padding:5px 10px 3px;text-align:right}.gjs-rte-toolbar{border:1px solid rgba(0,0,0,.2);position:absolute;border-radius:3px;z-index:10}.gjs-rte-actionbar{display:flex}.gjs-rte-action{display:flex;align-items:center;justify-content:center;padding:5px;min-width:25px;border-right:1px solid rgba(0,0,0,.2);text-align:center;cursor:pointer;outline:none}.gjs-rte-action:last-child{border-right:none}.gjs-rte-action:hover{background-color:rgba(255,255,255,.1)}.gjs-rte-active{background-color:rgba(255,255,255,.1)}.gjs-rte-disabled{color:rgba(255,255,255,.1);cursor:not-allowed}.gjs-rte-disabled:hover{background-color:unset}.gjs-editor-cont .sp-hue,.gjs-editor-cont .sp-slider{cursor:row-resize}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-dragger{cursor:crosshair}.gjs-editor-cont .sp-alpha-inner,.gjs-editor-cont .sp-alpha-handle{cursor:col-resize}.gjs-editor-cont .sp-hue{left:90%}.gjs-editor-cont .sp-color{right:15%}.gjs-editor-cont .sp-container{border:1px solid rgba(0,0,0,.2);box-shadow:0 0 7px rgba(0,0,0,.2);border-radius:3px}.gjs-editor-cont .sp-picker-container{border:none}.gjs-editor-cont .colpick_dark .colpick_color{outline:1px solid rgba(0,0,0,.2)}.gjs-editor-cont .sp-cancel,.gjs-editor-cont .sp-cancel:hover{bottom:-8px;color:#777 !important;font-size:25px;left:0;position:absolute;text-decoration:none}.gjs-editor-cont .sp-alpha-handle{background-color:#ccc;border:1px solid #555;width:4px}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-hue{border:1px solid #333}.gjs-editor-cont .sp-slider{background-color:#ccc;border:1px solid #555;height:3px;left:-4px;width:22px}.gjs-editor-cont .sp-dragger{background:transparent;box-shadow:0 0 0 1px #111}.gjs-editor-cont .sp-button-container{float:none;width:100%;position:relative;text-align:right}.gjs-editor-cont .sp-container button,.gjs-editor-cont .sp-container button:hover,.gjs-editor-cont .sp-container button:active{background:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2);color:#ddd;text-shadow:none;box-shadow:none;padding:3px 5px}.gjs-editor-cont .sp-palette-container{border:none;float:none;margin:0;padding:5px 10px 0}.gjs-editor-cont .sp-palette .sp-thumb-el,.gjs-editor-cont .sp-palette .sp-thumb-el:hover{border:1px solid rgba(0,0,0,.9)}.gjs-editor-cont .sp-palette .sp-thumb-el:hover,.gjs-editor-cont .sp-palette .sp-thumb-el.sp-thumb-active{border-color:rgba(0,0,0,.9)}.gjs-hidden{display:none}@keyframes gjs-slide-down{0%{transform:translate(0, -3rem);opacity:0}100%{transform:translate(0, 0);opacity:1}}@keyframes gjs-slide-up{0%{transform:translate(0, 0);opacity:1}100%{transform:translate(0, -3rem);opacity:0}}.cm-s-hopscotch span.cm-error{color:#fff} diff --git a/src/editor/config/config.js b/src/editor/config/config.js index 5573ac16f..4101414e7 100644 --- a/src/editor/config/config.js +++ b/src/editor/config/config.js @@ -165,6 +165,13 @@ export default { // Import asynchronously CSS to use as icons cssIcons: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', + // Experimental: don't use. + icons: { + close: + '', + move: '', + }, + // Dom element el: '', diff --git a/src/style_manager/view/LayerView.js b/src/style_manager/view/LayerView.js index edb78459a..0a7e17e6c 100644 --- a/src/style_manager/view/LayerView.js +++ b/src/style_manager/view/LayerView.js @@ -11,20 +11,24 @@ export default View.extend({ template() { const { pfx, ppfx } = this; + const icons = this.em?.getConfig('icons'); + const iconClose = icons?.close || '⨯'; + const iconMove = icons?.move || ''; return ` -
- -
-
-
- -
-
- ⨯ +
+
+ ${iconMove} +
+
+
+ +
+
+ ${iconClose} +
-
`; }, diff --git a/src/styles/scss/_gjs_style_manager.scss b/src/styles/scss/_gjs_style_manager.scss index 6f33d1a35..9b6f3a5da 100644 --- a/src/styles/scss/_gjs_style_manager.scss +++ b/src/styles/scss/_gjs_style_manager.scss @@ -328,16 +328,45 @@ margin: 2px 0; padding: 7px; position: relative; - cursor: pointer; - > ##{$sm-prefix}preview-box { + &.#{$sm-prefix}active { + background-color: rgba(255, 255, 255, 0.12); + } + + .#{$sm-prefix}label-wrp { + display: flex; + align-items: center; + } + + ##{$sm-prefix}move { + height: 14px; + width: 14px; + min-width: 14px; + cursor: grab; + } + + ##{$sm-prefix}label { + flex-grow: 1; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + margin: 0 5px; + } + + ##{$sm-prefix}preview-box { @extend .checker-bg; height: 15px; - position: absolute; - right: 27px; - top: 6px; width: 15px; + min-width: 15px; + margin-right: 5px; + } + + ##{$sm-prefix}preview { + background-color: white; + height: 100%; + width: 100%; + background-size: cover !important; } ##{$sm-prefix}preview, @@ -347,11 +376,10 @@ ##{$sm-prefix}close-layer { display: block; - font-size: 23px; - position: absolute; cursor: pointer; - right: 5px; - top: 0; + height: 14px; + width: 14px; + min-width: 14px; @include opacity(0.5); @@ -359,21 +387,6 @@ @include opacity(0.8); } } - - > ##{$sm-prefix}preview-box ##{$sm-prefix}preview { - background-color: white; - height: 100%; - width: 100%; - background-size: cover !important; - } - - &.#{$sm-prefix}active { - background-color: rgba(255, 255, 255, 0.12); - } - - &.#{$sm-prefix}no-preview ##{$sm-prefix}preview-box { - display: none; - } } } From 9db14da26fca1237efccfef96515f41806e31c9a Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 14:35:31 +0100 Subject: [PATCH 220/313] Update plus icon in stack view --- dist/css/grapes.min.css | 2 +- src/editor/config/config.js | 1 + src/style_manager/view/PropertyStackView.js | 8 ++++++-- src/styles/scss/_gjs_style_manager.scss | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dist/css/grapes.min.css b/dist/css/grapes.min.css index b5fbbebc3..b2edfcaad 100644 --- a/dist/css/grapes.min.css +++ b/dist/css/grapes.min.css @@ -1 +1 @@ -.sp-container{position:absolute;top:0;left:0;display:inline-block;*display:inline;*zoom:1;z-index:9999994;overflow:hidden}.sp-container.sp-flat{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{position:relative;width:100%;display:inline-block}.sp-top-inner{position:absolute;top:0;left:0;bottom:0;right:0}.sp-color{position:absolute;top:0;left:0;bottom:0;right:20%}.sp-hue{position:absolute;top:0;right:0;bottom:0;left:84%;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{position:absolute;top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{position:absolute;top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid black;background:white;opacity:.8}.sp-alpha{display:none;position:absolute;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:solid 1px #333}.sp-clear{display:none}.sp-clear.sp-clear-display{background-position:center}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0px;right:0;bottom:0;left:84%;height:28px}.sp-container,.sp-replacer,.sp-preview,.sp-dragger,.sp-slider,.sp-alpha,.sp-clear,.sp-alpha-handle,.sp-container.sp-dragging .sp-input,.sp-container button{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-input-disabled .sp-input-container{display:none}.sp-container.sp-buttons-disabled .sp-button-container{display:none}.sp-container.sp-palette-buttons-disabled .sp-palette-button-container{display:none}.sp-palette-only .sp-picker-container{display:none}.sp-palette-disabled .sp-palette-container{display:none}.sp-initial-disabled .sp-initial{display:none}.sp-sat{background-image:-webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:linear-gradient(to right, #fff, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr="#FFFFFFFF", endColorstr="#00CC9A81")}.sp-val{background-image:-webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:linear-gradient(to top, #000, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00CC9A81", endColorstr="#FF000000")}.sp-hue{background:-moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));background:-webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff0000", endColorstr="#ffff00")}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffff00", endColorstr="#00ff00")}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ff00", endColorstr="#00ffff")}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffff", endColorstr="#0000ff")}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0000ff", endColorstr="#ff00ff")}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff00ff", endColorstr="#ff0000")}.sp-hidden{display:none !important}.sp-cf:before,.sp-cf:after{content:"";display:table}.sp-cf:after{clear:both}.sp-cf{*zoom:1}@media(max-device-width: 480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;cursor:pointer;position:absolute;top:0;left:0}.sp-slider{position:absolute;top:0;cursor:pointer;height:3px;left:-1px;right:-1px;border:1px solid #000;background:white;opacity:.8}.sp-container{border-radius:0;background-color:#ececec;border:solid 1px #f0c49b;padding:0}.sp-container,.sp-container button,.sp-container input,.sp-color,.sp-hue,.sp-clear{font:normal 12px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-color,.sp-hue,.sp-clear{border:solid 1px #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container{width:100%}.sp-input{font-size:12px !important;border:1px inset;padding:4px 5px;margin:0;width:100%;background:transparent;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-picker-container,.sp-palette-container{float:left;position:relative;padding:10px;padding-bottom:300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:solid 1px #fff}.sp-palette-container{border-right:solid 1px #ccc}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;width:24px;height:15px;margin:3px;cursor:pointer;border:solid 2px transparent}.sp-palette .sp-thumb-el:hover,.sp-palette .sp-thumb-el.sp-thumb-active{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:solid 1px #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:center}.sp-palette-button-container,.sp-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;*zoom:1;*display:inline;border:solid 1px #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer:hover,.sp-replacer.sp-active{border-color:#f0c49b;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px}.sp-preview{position:relative;width:25px;height:20px;border:solid 1px #222;margin-right:5px;float:left;z-index:0}.sp-palette{*width:220px;max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:solid 1px #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top, #eeeeee, #cccccc);background-image:-moz-linear-gradient(top, #eeeeee, #cccccc);background-image:-ms-linear-gradient(top, #eeeeee, #cccccc);background-image:-o-linear-gradient(top, #eeeeee, #cccccc);background-image:linear-gradient(to bottom, #eeeeee, #cccccc);border:1px solid #ccc;border-bottom:1px solid #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top, #dddddd, #bbbbbb);background-image:-moz-linear-gradient(top, #dddddd, #bbbbbb);background-image:-ms-linear-gradient(top, #dddddd, #bbbbbb);background-image:-o-linear-gradient(top, #dddddd, #bbbbbb);background-image:linear-gradient(to bottom, #dddddd, #bbbbbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid #aaa;border-bottom:1px solid #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f !important;margin:0;padding:2px;margin-right:5px;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f !important;text-decoration:underline}.sp-palette span:hover,.sp-palette span.sp-thumb-active{border-color:#000}.sp-preview,.sp-alpha,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-preview-inner,.sp-alpha-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDh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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==)}.CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20, 255, 20, 0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:blue}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, 0.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, 0.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-hopscotch.CodeMirror{background:#322931;color:#d5d3d5}.cm-s-hopscotch div.CodeMirror-selected{background:#433b42 !important}.cm-s-hopscotch .CodeMirror-gutters{background:#322931;border-right:0px}.cm-s-hopscotch .CodeMirror-linenumber{color:#797379}.cm-s-hopscotch .CodeMirror-cursor{border-left:1px solid #989498 !important}.cm-s-hopscotch span.cm-comment{color:#b33508}.cm-s-hopscotch span.cm-atom{color:#c85e7c}.cm-s-hopscotch span.cm-number{color:#c85e7c}.cm-s-hopscotch span.cm-property,.cm-s-hopscotch span.cm-attribute{color:#8fc13e}.cm-s-hopscotch span.cm-keyword{color:#dd464c}.cm-s-hopscotch span.cm-string{color:#fdcc59}.cm-s-hopscotch span.cm-variable{color:#8fc13e}.cm-s-hopscotch span.cm-variable-2{color:#1290bf}.cm-s-hopscotch span.cm-def{color:#fd8b19}.cm-s-hopscotch span.cm-error{background:#dd464c;color:#989498}.cm-s-hopscotch span.cm-bracket{color:#d5d3d5}.cm-s-hopscotch span.cm-tag{color:#dd464c}.cm-s-hopscotch span.cm-link{color:#c85e7c}.cm-s-hopscotch .CodeMirror-matchingbracket{text-decoration:underline;color:white !important}.cm-s-hopscotch .CodeMirror-activeline-background{background:#302020}@font-face{font-family:"font3336";src:url("../fonts/main-fonts.eot?v=20");src:url("../fonts/main-fonts.woff?v=20") format("woff"),url("../fonts/main-fonts.ttf?v=20") format("truetype"),url("../fonts/main-fonts.svg?v=20") format("svg"),url("../fonts/main-fonts.eot?v=20") format("embedded-opentype");font-weight:normal;font-style:normal}.gjs-is__grab,.gjs-is__grab *{cursor:grab !important}.gjs-is__grabbing,.gjs-is__grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:grabbing !important}.gjs-one-bg{background-color:#444}.gjs-one-color{color:#444}.gjs-one-color-h:hover{color:#444}.gjs-two-bg{background-color:#ddd}.gjs-two-color{color:#ddd}.gjs-two-color-h:hover{color:#ddd}.gjs-three-bg{background-color:#804f7b}.gjs-three-color{color:#804f7b}.gjs-three-color-h:hover{color:#804f7b}.gjs-four-bg{background-color:#d278c9}.gjs-four-color{color:#d278c9}.gjs-four-color-h:hover{color:#d278c9}.gjs-danger-bg{background-color:#dd3636}.gjs-danger-color{color:#dd3636}.gjs-danger-color-h:hover{color:#dd3636}.gjs-bg-main,.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c,.gjs-off-prv{background-color:#444}.gjs-color-main,.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add,.gjs-off-prv{color:#ddd;fill:#ddd}.gjs-color-active{color:#f8f8f8;fill:#f8f8f8}.gjs-color-warn{color:#ffca6f;fill:#ffca6f}.gjs-color-hl{color:#71b7f1;fill:#71b7f1}.gjs-fonts::before{display:block;font:normal normal normal 14px font3336;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:5em}.gjs-f-b1::before{content:"Q"}.gjs-f-b2::before{content:"W"}.gjs-f-b3::before{content:"E"}.gjs-f-b37::before{content:"R"}.gjs-f-hero::before{content:"T"}.gjs-f-h1p::before{content:"y"}.gjs-f-3ba::before{content:"u"}.gjs-f-image::before{content:"I"}.gjs-f-text::before{content:"o"}.gjs-f-quo::before{content:"p"}.gjs-f-button::before{content:"B"}.gjs-f-divider::before{content:"D"}.gjs-invis-invis,.gjs-clm-tags #gjs-clm-new,.gjs-no-app{background-color:transparent;border:none;color:inherit}.gjs-no-app{height:10px}.gjs-test::btn{color:"#fff"}.opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-checker-bg,.gjs-field-colorp-c,.checker-bg,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==")}.gjs-no-user-select,.gjs-rte-toolbar,.gjs-layer-name,.gjs-grabbing,.gjs-grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-pointer-events,.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el,.gjs-resizer-c{pointer-events:none}.gjs-bdrag{pointer-events:none !important;position:absolute !important;z-index:10 !important;width:auto}.gjs-drag-helper{background-color:#3b97e3 !important;pointer-events:none !important;position:absolute !important;z-index:10 !important;transform:scale(0.3) !important;transform-origin:top left !important;-webkit-transform-origin:top left !important;margin:15px !important;transition:none !important;outline:none !important}.gjs-grabbing,.gjs-grabbing *{cursor:grabbing !important;cursor:-webkit-grabbing !important}.gjs-grabbing{overflow:hidden}.gjs-off-prv{position:relative;z-index:10;padding:5px;cursor:pointer}.gjs-editor-cont ::-webkit-scrollbar-track{background:rgba(0,0,0,.1)}.gjs-editor-cont ::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.2)}.gjs-editor-cont ::-webkit-scrollbar{width:8px}.clear{clear:both}.no-select,.gjs-clm-tags #gjs-clm-close,.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title,.gjs-com-no-select,.gjs-com-no-select img{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-touch-actions{touch-action:none}.gjs-disabled{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;opacity:.5;filter:alpha(opacity=50)}.gjs-editor{font-family:Helvetica,sans-serif;font-size:.75rem;position:relative;box-sizing:border-box;height:100%}.gjs-freezed,.gjs-freezed{opacity:.5;filter:alpha(opacity=50);pointer-events:none}.gjs-traits-label{border-bottom:1px solid rgba(0,0,0,.2);font-weight:lighter;margin-bottom:5px;padding:10px;text-align:left}.gjs-label-wrp{width:30%;min-width:30%}.gjs-field-wrp{flex-grow:1}.gjs-trt-header{font-weight:lighter;padding:10px}.gjs-trt-trait{display:flex;justify-content:flex-start;padding:5px 10px;font-weight:lighter;align-items:center;text-align:left}.gjs-trt-traits{font-size:.75rem}.gjs-trt-trait .gjs-label{text-align:left;text-overflow:ellipsis;overflow:hidden}.gjs-guide-info{position:absolute}.gjs-guide-info__content{position:absolute;height:100%;display:flex;width:100%;padding:5px}.gjs-guide-info__line{position:relative;margin:auto}.gjs-guide-info__line::before,.gjs-guide-info__line::after{content:"";display:block;position:absolute;background-color:inherit}.gjs-guide-info__y{padding:0 5px}.gjs-guide-info__y .gjs-guide-info__content{justify-content:center}.gjs-guide-info__y .gjs-guide-info__line{width:100%;height:1px}.gjs-guide-info__y .gjs-guide-info__line::before,.gjs-guide-info__y .gjs-guide-info__line::after{width:1px;height:10px;top:0;bottom:0;left:0;margin:auto}.gjs-guide-info__y .gjs-guide-info__line::after{left:auto;right:0}.gjs-guide-info__x{padding:5px 0}.gjs-guide-info__x .gjs-guide-info__content{align-items:center}.gjs-guide-info__x .gjs-guide-info__line{height:100%;width:1px}.gjs-guide-info__x .gjs-guide-info__line::before,.gjs-guide-info__x .gjs-guide-info__line::after{width:10px;height:1px;left:0;right:0;top:0;margin:auto;transform:translateX(-50%)}.gjs-guide-info__x .gjs-guide-info__line::after{top:auto;bottom:0}.gjs-badge{white-space:nowrap}.gjs-badge__icon{vertical-align:middle;display:inline-block;width:15px;height:15px}.gjs-badge__icon svg{fill:currentColor}.gjs-badge__name{display:inline-block;vertical-align:middle}.gjs-frame-wrapper{position:absolute;width:100%;height:100%;left:0;right:0;margin:auto}.gjs-frame-wrapper--anim{transition:width .35s ease,height .35s ease}.gjs-frame-wrapper__top{transform:translateY(-100%) translateX(-50%);display:flex;padding:5px 0;position:absolute;width:100%;left:50%;top:0}.gjs-frame-wrapper__top-r{margin-left:auto}.gjs-frame-wrapper__left{position:absolute;left:0;transform:translateX(-100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__bottom{position:absolute;bottom:0;transform:translateY(100%) translateX(-50%);width:100%;left:50%}.gjs-frame-wrapper__right{position:absolute;right:0;transform:translateX(100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__icon{width:24px;cursor:pointer}.gjs-frame-wrapper__icon>svg{fill:currentColor}.gjs-padding-v-top,.gjs-fixedpadding-v-top{width:100%;top:0;left:0}.gjs-padding-v-right,.gjs-fixedpadding-v-right{right:0}.gjs-padding-v-bottom,.gjs-fixedpadding-v-bottom{width:100%;left:0;bottom:0}.gjs-padding-v-left,.gjs-fixedpadding-v-left{left:0}.gjs-cv-canvas{background-color:rgba(0,0,0,.15);box-sizing:border-box;width:85%;height:calc(100% - 40px);bottom:0;overflow:hidden;z-index:1;position:absolute;left:0;top:40px}.gjs-cv-canvas.gjs-cui{width:100%;height:100%;top:0}.gjs-cv-canvas.gjs-is__grab .gjs-cv-canvas__frames,.gjs-cv-canvas.gjs-is__grabbing .gjs-cv-canvas__frames{pointer-events:none}.gjs-cv-canvas__frames{position:absolute;top:0;left:0;width:100%;height:100%}.gjs-cv-canvas .gjs-ghost{display:none;pointer-events:none;background-color:#5b5b5b;border:2px dashed #ccc;position:absolute;z-index:10;opacity:.55;filter:alpha(opacity=55)}.gjs-cv-canvas .gjs-highlighter,.gjs-cv-canvas .gjs-highlighter-sel{position:absolute;outline:1px solid #3b97e3;outline-offset:-1px;pointer-events:none;width:100%;height:100%}.gjs-cv-canvas .gjs-highlighter-warning{outline:3px solid #ffca6f}.gjs-cv-canvas .gjs-highlighter-sel{outline:2px solid #3b97e3;outline-offset:-2px}.gjs-cv-canvas #gjs-tools,.gjs-cv-canvas .gjs-tools{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;z-index:1}.gjs-cv-canvas *{box-sizing:border-box}.gjs-frame{outline:medium none;height:100%;width:100%;border:none;margin:auto;display:block;transition:width .35s ease,height .35s ease;position:absolute;top:0;bottom:0;left:0;right:0}.gjs-toolbar{position:absolute;background-color:#3b97e3;white-space:nowrap;color:#fff;z-index:10;top:0;left:0}.gjs-toolbar-item{padding:5px 7px;font-size:.8rem;cursor:pointer;width:26px;vertical-align:middle;display:inline-block}.gjs-toolbar-item svg{fill:currentColor;vertical-align:middle}.gjs-resizer-c{position:absolute;left:0;top:0;width:100%;height:100%;z-index:9}.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.1;filter:alpha(opacity=10);position:absolute;background-color:#ff0}.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.2;filter:alpha(opacity=20)}.gjs-padding-v-el,.gjs-fixedpadding-v-el{background-color:navy}.gjs-resizer-h{pointer-events:all;position:absolute;border:3px solid #3b97e3;width:10px;height:10px;background-color:#fff;margin:-5px}.gjs-resizer-h-tl{top:0;left:0;cursor:nwse-resize}.gjs-resizer-h-tr{top:0;right:0;cursor:nesw-resize}.gjs-resizer-h-tc{top:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-cl{left:0;margin:auto -5px;top:0;bottom:0;cursor:ew-resize}.gjs-resizer-h-cr{margin:auto -5px;top:0;bottom:0;right:0;cursor:ew-resize}.gjs-resizer-h-bl{bottom:0;left:0;cursor:nesw-resize}.gjs-resizer-h-bc{bottom:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-br{bottom:0;right:0;cursor:nwse-resize}.gjs-pn-panel .gjs-resizer-h{background-color:rgba(0,0,0,.2);border:none;opacity:0;transition:opacity .25s}.gjs-pn-panel .gjs-resizer-h:hover{opacity:1}.gjs-pn-panel .gjs-resizer-h-tc,.gjs-pn-panel .gjs-resizer-h-bc{margin:0 auto;width:100%}.gjs-pn-panel .gjs-resizer-h-cr,.gjs-pn-panel .gjs-resizer-h-cl{margin:auto 0;height:100%}.gjs-resizing .gjs-highlighter,.gjs-resizing .gjs-badge{display:none !important}.gjs-resizing-tl *{cursor:nwse-resize !important}.gjs-resizing-tr *{cursor:nesw-resize !important}.gjs-resizing-tc *{cursor:ns-resize !important}.gjs-resizing-cl *{cursor:ew-resize !important}.gjs-resizing-cr *{cursor:ew-resize !important}.gjs-resizing-bl *{cursor:nesw-resize !important}.gjs-resizing-bc *{cursor:ns-resize !important}.gjs-resizing-br *{cursor:nwse-resize !important}.btn-cl,.gjs-am-close,.gjs-mdl-btn-close{opacity:.3;filter:alpha(opacity=30);font-size:25px;cursor:pointer}.btn-cl:hover,.gjs-am-close:hover,.gjs-mdl-btn-close:hover{opacity:.7;filter:alpha(opacity=70)}.no-dots,.ui-resizable-handle{border:none !important;margin:0 !important;outline:none !important}.gjs-com-dashed *{outline:1px dashed #888;outline-offset:-2px;box-sizing:border-box}.gjs-cv-canvas .gjs-comp-selected{outline:3px solid #3b97e3 !important}*.gjs-com-hover,div.gjs-com-hover{outline:1px solid #3b97e3}*.gjs-com-hover-delete,div.gjs-com-hover-delete{outline:2px solid #dd3636;opacity:.5;filter:alpha(opacity=50)}*.gjs-com-hover-move,div.gjs-com-hover-move{outline:3px solid #ffca6f}.gjs-com-badge,.gjs-com-badge-red,.gjs-badge{pointer-events:none;background-color:#3b97e3;color:#fff;padding:2px 5px;position:absolute;z-index:1;font-size:12px;outline:none;display:none}.gjs-com-badge-red{background-color:#dd3636}.gjs-badge-warning{background-color:#ffca6f}.gjs-placeholder,.gjs-com-placeholder,.gjs-placeholder{position:absolute;z-index:10;pointer-events:none;display:none}.gjs-placeholder,.gjs-placeholder{border-style:solid !important;outline:none;box-sizing:border-box;transition:top .2s,left .2s,width .2s,height .2s}.gjs-placeholder.horizontal,.gjs-com-placeholder.horizontal,.gjs-placeholder.horizontal{border-color:transparent #62c462;border-width:3px 5px;margin:-3px 0 0}.gjs-placeholder.vertical,.gjs-com-placeholder.vertical,.gjs-placeholder.vertical{border-color:#62c462 transparent;border-width:5px 3px;margin:0 0 0 -3px}.gjs-placeholder-int,.gjs-com-placeholder-int,.gjs-placeholder-int{background-color:#62c462;box-shadow:0 0 3px rgba(0,0,0,.2);height:100%;width:100%;pointer-events:none;padding:1.5px;outline:none}.gjs-pn-panel{display:inline-block;position:absolute;box-sizing:border-box;text-align:center;padding:5px;z-index:3}.gjs-pn-panel .icon-undo,.gjs-pn-panel .icon-redo{font-size:20px;height:30px;width:25px}.gjs-pn-commands{width:85%;left:0;top:0;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-options{right:15%;top:0}.gjs-pn-views{border-bottom:2px solid rgba(0,0,0,.2);right:0;width:15%;z-index:4}.gjs-pn-views-container{height:100%;padding:42px 0 0;right:0;width:15%;overflow:auto;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-buttons{align-items:center;display:flex;justify-content:space-between}.gjs-pn-btn{box-sizing:border-box;min-height:30px;min-width:30px;line-height:21px;background-color:transparent;border:none;font-size:18px;margin-right:5px;border-radius:2px;padding:4px;position:relative;cursor:pointer}.gjs-pn-btn.gjs-pn-active{background-color:rgba(0,0,0,.15);box-shadow:0 0 3px rgba(0,0,0,.25) inset}.gjs-pn-btn svg{fill:currentColor}.gjs-comp-image-placeholder{display:block;background-color:#f5f5f5;color:#777;height:50px;width:50px;line-height:50px;outline:3px solid #ffca6f;outline-offset:-3px;text-align:center;font-size:16.6666666667px;cursor:pointer}.gjs-comp-image-placeholder.fa-picture-o::after{content:""}.gjs-label{line-height:18px}.gjs-fields{display:flex}.gjs-select{padding:0;width:100%}.gjs-select select{padding-right:10px}.gjs-select:-moz-focusring,.gjs-select select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-input:focus,.gjs-button:focus,.gjs-btn-prim:focus,.gjs-select:focus,.gjs-select select:focus{outline:none}.gjs-field input,.gjs-field select,.gjs-field textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:inherit;border:none;background-color:transparent;box-sizing:border-box;width:100%;position:relative;padding:5px;z-index:1}.gjs-field input:focus,.gjs-field select:focus,.gjs-field textarea:focus{outline:none}.gjs-field input[type=number]{-moz-appearance:textfield}.gjs-field input[type=number]::-webkit-outer-spin-button,.gjs-field input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gjs-field-range{flex:9 1 auto}.gjs-field-integer input{padding-right:30px}.gjs-select option,.gjs-field-select option,.gjs-clm-select option,.gjs-sm-select option,.gjs-fields option,.gjs-sm-unit option{background-color:#444;color:#ddd}.gjs-field{background-color:rgba(0,0,0,.2);border:none;box-shadow:none;border-radius:2px;box-sizing:border-box;padding:0;position:relative}.gjs-field textarea{resize:vertical}.gjs-field .gjs-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;z-index:0}.gjs-field .gjs-d-s-arrow{bottom:0;top:0;margin:auto;right:5px;border-top:4px solid rgba(255,255,255,.7);position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-field-arrows{position:absolute;cursor:ns-resize;margin:auto;height:20px;width:9px;z-index:10;bottom:0;right:3px;top:0}.gjs-field-color,.gjs-field-radio{width:100%}.gjs-field-color input{padding-right:22px;box-sizing:border-box}.gjs-field-colorp{border-left:1px solid rgba(0,0,0,.2);box-sizing:border-box;height:100%;padding:2px;position:absolute;right:0;top:0;width:22px;z-index:10}.gjs-field-colorp .gjs-checker-bg,.gjs-field-colorp .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-field-colorp-c{height:100%;position:relative;width:100%}.gjs-field-color-picker{background-color:#ddd;cursor:pointer;height:100%;width:100%;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px;position:absolute;top:0}.gjs-field-checkbox{padding:0;width:17px;height:17px;display:block;cursor:pointer}.gjs-field-checkbox input{display:none}.gjs-field-checkbox input:checked+.gjs-chk-icon{border-color:rgba(255,255,255,.5);border-width:0 2px 2px 0;border-style:solid}.gjs-radio-item{flex:1 1 auto;text-align:center;border-left:1px solid rgba(0,0,0,.2)}.gjs-radio-item:first-child{border:none}.gjs-radio-item:hover{background:rgba(0,0,0,.2)}.gjs-radio-item input{display:none}.gjs-radio-item input:checked+.gjs-radio-item-label{background-color:rgba(255,255,255,.2)}.gjs-radio-items{display:flex}.gjs-radio-item-label{cursor:pointer;display:block;padding:5px}.gjs-field-units{position:absolute;margin:auto;right:10px;bottom:0;top:0}.gjs-field-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-field-arrow-u,.gjs-field-arrow-d{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(255,255,255,.7);bottom:4px;cursor:pointer}.gjs-field-arrow-u{border-bottom:4px solid rgba(255,255,255,.7);border-top:none;top:4px}.gjs-field-select{padding:0}.gjs-field-range{background-color:transparent;border:none;box-shadow:none;padding:0}.gjs-field-range input{margin:0;height:100%}.gjs-field-range input:focus{outline:none}.gjs-field-range input::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-ms-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-webkit-slider-runnable-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-ms-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-btn-prim{color:inherit;background-color:rgba(255,255,255,.1);border-radius:2px;padding:3px 6px;padding:5px;cursor:pointer;border:none}.gjs-btn-prim:active{background-color:rgba(255,255,255,.1)}.gjs-btn--full{width:100%}.gjs-chk-icon{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);box-sizing:border-box;display:block;height:14px;margin:0 5px;width:6px}.gjs-add-trasp{background:none;border:none;color:#ddd;cursor:pointer;font-size:1em;border-radius:2px;opacity:.75;filter:alpha(opacity=75)}.gjs-add-trasp:hover{opacity:1;filter:alpha(opacity=100)}.gjs-add-trasp:active{background-color:rgba(0,0,0,.2)}.gjs-devices-c{display:flex;align-items:center;padding:3px}.gjs-devices-c .gjs-device-label{flex-grow:2;text-align:left;margin-right:10px}.gjs-devices-c .gjs-select{flex-grow:20}.gjs-devices-c .gjs-add-trasp{flex-grow:1;margin-left:5px}.gjs-category-open,.gjs-block-category.gjs-open,.gjs-sm-sector.gjs-sm-open,.gjs-sm-open.gjs-clm-tags{border-bottom:1px solid rgba(0,0,0,.25)}.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title{font-weight:lighter;background-color:rgba(0,0,0,.1);letter-spacing:1px;padding:9px 10px 9px 20px;border-bottom:1px solid rgba(0,0,0,.25);text-align:left;position:relative;cursor:pointer}.gjs-sm-clear{line-height:0;cursor:pointer}.gjs-sm-header{font-weight:lighter;padding:10px}.gjs-sm-properties{font-size:.75rem;padding:10px 5px;display:flex;flex-wrap:wrap;align-items:flex-end;box-sizing:border-box;width:100%}.gjs-sm-label{margin:5px 5px 3px 0}.gjs-sm-close-btn,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.2;filter:alpha(opacity=20)}.gjs-sm-close-btn:hover,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover{opacity:.7;filter:alpha(opacity=70)}.gjs-sm-sector,.gjs-clm-tags{clear:both;font-weight:lighter;text-align:left}.gjs-sm-sector #gjs-sm-caret,.gjs-clm-tags #gjs-sm-caret{padding-right:5px;font-size:11px}.gjs-sm-sector .gjs-sm-field,.gjs-clm-tags .gjs-sm-field,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-clm-field,.gjs-clm-tags .gjs-clm-field{width:100%;position:relative}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input,.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{background-color:transparent;color:rgba(255,255,255,.7);border:none;width:100%}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input{box-sizing:border-box}.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gjs-sm-sector .gjs-sm-field select::-ms-expand,.gjs-clm-tags .gjs-sm-field select::-ms-expand,.gjs-sm-sector .gjs-clm-select select::-ms-expand,.gjs-clm-tags .gjs-clm-select select::-ms-expand,.gjs-sm-sector .gjs-clm-field select::-ms-expand,.gjs-clm-tags .gjs-clm-field select::-ms-expand{display:none}.gjs-sm-sector .gjs-sm-field select:-moz-focusring,.gjs-clm-tags .gjs-sm-field select:-moz-focusring,.gjs-sm-sector .gjs-clm-select select:-moz-focusring,.gjs-clm-tags .gjs-clm-select select:-moz-focusring,.gjs-sm-sector .gjs-clm-field select:-moz-focusring,.gjs-clm-tags .gjs-clm-field select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-sm-sector .gjs-sm-field input:focus,.gjs-clm-tags .gjs-sm-field input:focus,.gjs-sm-sector .gjs-clm-select input:focus,.gjs-clm-tags .gjs-clm-select input:focus,.gjs-sm-sector .gjs-clm-field input:focus,.gjs-clm-tags .gjs-clm-field input:focus,.gjs-sm-sector .gjs-sm-field select:focus,.gjs-clm-tags .gjs-sm-field select:focus,.gjs-sm-sector .gjs-clm-select select:focus,.gjs-clm-tags .gjs-clm-select select:focus,.gjs-sm-sector .gjs-clm-field select:focus,.gjs-clm-tags .gjs-clm-field select:focus{outline:none}.gjs-sm-sector .gjs-sm-field .gjs-sm-unit,.gjs-clm-tags .gjs-sm-field .gjs-sm-unit,.gjs-sm-sector .gjs-clm-select .gjs-sm-unit,.gjs-clm-tags .gjs-clm-select .gjs-sm-unit,.gjs-sm-sector .gjs-clm-field .gjs-sm-unit,.gjs-clm-tags .gjs-clm-field .gjs-sm-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-sm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-select .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-select .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;cursor:ns-resize}.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{border-bottom:4px solid rgba(255,255,255,.7);top:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{border-top:4px solid rgba(255,255,255,.7);bottom:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{bottom:7px}.gjs-sm-sector .gjs-sm-field.gjs-sm-color,.gjs-clm-tags .gjs-sm-field.gjs-sm-color,.gjs-sm-sector .gjs-sm-color.gjs-clm-field,.gjs-clm-tags .gjs-sm-color.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-input,.gjs-clm-tags .gjs-sm-field.gjs-sm-input,.gjs-sm-sector .gjs-sm-input.gjs-clm-field,.gjs-clm-tags .gjs-sm-input.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-integer,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{background-color:rgba(0,0,0,.2);border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 0 rgba(255,255,255,.1);color:rgba(255,255,255,.7);border-radius:2px;box-sizing:border-box;padding:0 5px}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{border-radius:2px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{padding:0}.gjs-sm-sector .gjs-sm-field.gjs-sm-select select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field select,.gjs-clm-tags .gjs-sm-select.gjs-clm-field select{height:20px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select option,.gjs-clm-tags .gjs-sm-field.gjs-sm-select option,.gjs-sm-sector .gjs-clm-select option,.gjs-clm-tags .gjs-clm-select option,.gjs-sm-sector .gjs-sm-select.gjs-clm-field option,.gjs-clm-tags .gjs-sm-select.gjs-clm-field option{padding:3px 0}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{background-color:rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.25)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-select,.gjs-clm-tags .gjs-sm-list.gjs-clm-select,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field{width:auto;padding:0;overflow:hidden;float:left}.gjs-sm-sector .gjs-sm-field.gjs-sm-list input,.gjs-clm-tags .gjs-sm-field.gjs-sm-list input,.gjs-sm-sector .gjs-sm-list.gjs-clm-select input,.gjs-clm-tags .gjs-sm-list.gjs-clm-select input,.gjs-sm-sector .gjs-sm-list.gjs-clm-field input,.gjs-clm-tags .gjs-sm-list.gjs-clm-field input{display:none}.gjs-sm-sector .gjs-sm-field.gjs-sm-list label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field label{cursor:pointer;padding:5px;display:block}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label{background-color:rgba(255,255,255,.2)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-icon{background-repeat:no-repeat;background-position:center;text-shadow:none;line-height:normal}.gjs-sm-sector .gjs-sm-field.gjs-sm-integer select,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-select select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-select select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field select{width:auto;padding:0}.gjs-sm-sector .gjs-sm-list .gjs-sm-el,.gjs-clm-tags .gjs-sm-list .gjs-sm-el{float:left;border-left:1px solid rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:first-child,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:first-child{border:none}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:hover,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:hover{background:rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-slider .gjs-field-integer,.gjs-clm-tags .gjs-sm-slider .gjs-field-integer{flex:1 1 65px}.gjs-sm-sector .gjs-sm-property,.gjs-clm-tags .gjs-sm-property{box-sizing:border-box;float:left;width:50%;margin-bottom:5px;padding:0 5px}.gjs-sm-sector .gjs-sm-property--full,.gjs-clm-tags .gjs-sm-property--full,.gjs-sm-sector .gjs-sm-property.gjs-sm-composite,.gjs-clm-tags .gjs-sm-property.gjs-sm-composite,.gjs-sm-sector .gjs-sm-property.gjs-sm-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file,.gjs-sm-sector .gjs-sm-property.gjs-sm-list,.gjs-clm-tags .gjs-sm-property.gjs-sm-list,.gjs-sm-sector .gjs-sm-property.gjs-sm-stack,.gjs-clm-tags .gjs-sm-property.gjs-sm-stack,.gjs-sm-sector .gjs-sm-property.gjs-sm-slider,.gjs-clm-tags .gjs-sm-property.gjs-sm-slider,.gjs-sm-sector .gjs-sm-property.gjs-sm-color,.gjs-clm-tags .gjs-sm-property.gjs-sm-color{width:100%}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn{background-color:rgba(33,33,33,.2);border-radius:2px;box-shadow:1px 1px 0 rgba(5,5,5,.2),1px 1px 0 rgba(43,43,43,.2) inset;padding:5px;position:relative;text-align:center;height:auto;width:100%;cursor:pointer;color:#ddd;box-sizing:border-box;text-shadow:-1px -1px 0 rgba(0,0,0,.2);border:none;opacity:.85;filter:alpha(opacity=85)}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn-c,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn-c{box-sizing:border-box;float:left;width:100%}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box{background-color:rgba(255,255,255,.05);border-radius:2px;margin-top:5px;position:relative;overflow:hidden}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show{border:1px solid rgba(252,252,252,.05);padding:3px 20px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{top:-5px;display:block}.gjs-sm-sector .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file{height:50px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file{background-size:auto 100%;background-repeat:no-repeat;background-position:center center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layers,.gjs-clm-tags .gjs-sm-property .gjs-sm-layers{margin-top:5px;padding:1px 3px;min-height:30px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer{background-color:rgba(255,255,255,.055);border-radius:2px;margin:2px 0;padding:7px;position:relative}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer.gjs-sm-active,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer.gjs-sm-active{background-color:rgba(255,255,255,.12)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp{display:flex;align-items:center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-move,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-move{height:14px;width:14px;min-width:14px;cursor:grab}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-label,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-label{flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0 5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{height:15px;width:15px;min-width:15px;margin-right:5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview{background-color:#fff;height:100%;width:100%;background-size:cover !important}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{border-radius:2px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer{display:block;cursor:pointer;height:14px;width:14px;min-width:14px;opacity:.5;filter:alpha(opacity=50)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover{opacity:.8;filter:alpha(opacity=80)}.gjs-sm-sector #gjs-sm-text-shadow #gjs-sm-preview::after,.gjs-clm-tags #gjs-sm-text-shadow #gjs-sm-preview::after{color:#000;content:"T";font-weight:900;line-height:17px;padding:0 4px}.gjs-sm-sector .gjs-sm-stack .gjs-sm-properties,.gjs-clm-tags .gjs-sm-stack .gjs-sm-properties{padding:5px 0 0}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add{background:none;border:none;cursor:pointer;outline:none;font-size:22px;line-height:10px;position:absolute;right:0;top:-17px;opacity:.75}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add:hover,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add:hover{opacity:1;filter:alpha(opacity=100)}.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c{height:100%;width:20px;position:absolute;right:0;top:0;box-sizing:border-box;border-radius:2px;padding:2px}.gjs-sm-sector .gjs-sm-colorp-c .gjs-checker-bg,.gjs-clm-tags .gjs-sm-colorp-c .gjs-checker-bg,.gjs-sm-sector .gjs-sm-colorp-c .gjs-field-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-sm-sector .gjs-sm-color-picker,.gjs-clm-tags .gjs-sm-color-picker{background-color:#ddd;cursor:pointer;height:16px;width:100%;margin-top:-16px;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-upload,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-upload{left:0;top:0;position:absolute;width:100%;opacity:0;cursor:pointer}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-label,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-label{padding:2px 0}.gjs-sm-layer>#gjs-sm-move{opacity:.7;filter:alpha(opacity=70);cursor:move;font-size:12px;float:left;margin:0 5px 0 0}.gjs-sm-layer>#gjs-sm-move:hover{opacity:.9;filter:alpha(opacity=90)}.gjs-blocks-c{display:flex;flex-wrap:wrap;justify-content:flex-start}.gjs-block-categories{display:flex;flex-direction:column}.gjs-block-category{width:100%}.gjs-block-category .gjs-caret-icon{margin-right:5px}.gjs-block{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;width:45%;min-width:45px;padding:1em;box-sizing:border-box;min-height:90px;cursor:all-scroll;font-size:11px;font-weight:lighter;text-align:center;display:flex;flex-direction:column;justify-content:space-between;border:1px solid rgba(0,0,0,.2);border-radius:3px;margin:10px 2.5% 5px;box-shadow:0 1px 0 0 rgba(0,0,0,.15);transition:all .2s ease 0s;transition-property:box-shadow,color}.gjs-block:hover{box-shadow:0 3px 4px 0 rgba(0,0,0,.15)}.gjs-block svg{fill:currentColor}.gjs-block__media{margin-bottom:10px;pointer-events:none}.gjs-block-svg{width:54px;fill:currentColor}.gjs-block-svg-path{fill:currentColor}.gjs-block.fa{font-size:2em;line-height:2em;padding:11px}.gjs-block-label{line-height:normal;font-size:.65rem;font-weight:normal;font-family:Helvetica,sans-serif;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.gjs-block.gjs-bdrag{width:auto;padding:0}.gjs-selected-parent{border:1px solid #ffca6f}.gjs-opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-layer{font-weight:lighter;text-align:left;position:relative;background-color:rgba(0,0,0,.1);font-size:.75rem;display:grid}.gjs-layer-hidden{opacity:.55;filter:alpha(opacity=55)}.gjs-layer-count{position:absolute;right:27px;top:9px}.gjs-layer-vis{height:auto !important;width:auto !important;left:0;top:0;padding:7px 5px 7px 10px;position:absolute;cursor:pointer;z-index:1}.gjs-layer-caret{font-size:.5rem;width:8px;padding:2px;cursor:pointer;position:absolute;left:-9px;top:6px;opacity:.7;filter:alpha(opacity=70)}.gjs-layer-caret:hover{opacity:1;filter:alpha(opacity=100)}.gjs-layer-title{padding:3px 10px 5px 30px;display:flex;align-items:center}.gjs-layer-title-inn{align-items:center;position:relative;display:flex;width:100%}.gjs-layer__icon{display:block;width:100%;max-width:15px;max-height:15px;padding-left:5px}.gjs-layer__icon svg{fill:currentColor}.gjs-layer-name{padding:5px 0;display:inline-block;box-sizing:content-box;overflow:hidden;white-space:nowrap;margin:0 30px 0 5px}.gjs-layer-name--no-edit{text-overflow:ellipsis}.gjs-layer>.gjs-layer-children{display:none}.gjs-layer.open>.gjs-layer-children{display:block}.gjs-layer-no-chld>.gjs-layer-title-inn>.gjs-layer-caret{display:none}.gjs-layer-move{padding:7px 10px 7px 5px;position:absolute;font-size:12px;cursor:move;right:0;top:0}.gjs-layer.gjs-hovered .gjs-layer-title{background-color:rgba(255,255,255,.015)}.gjs-layer.gjs-selected .gjs-layer-title{background-color:rgba(255,255,255,.1)}.gjs-layers{position:relative;height:100%}.gjs-layers #gjs-placeholder{width:100%;position:absolute}.gjs-layers #gjs-placeholder #gjs-plh-int{height:100%;padding:1px}.gjs-layers #gjs-placeholder #gjs-plh-int.gjs-insert{background-color:#62c462}#gjs-clm-add-tag,.gjs-clm-tags-btn{background-color:rgba(255,255,255,.15);border-radius:2px;padding:3px;margin-right:3px;border:1px solid rgba(0,0,0,.15);width:24px;height:24px;box-sizing:border-box;cursor:pointer}.gjs-clm-tags-btn svg{fill:currentColor;display:block}.gjs-clm-header{display:flex;align-items:center;margin:7px 0}.gjs-clm-header-status{flex-shrink:1;margin-left:auto}.gjs-clm-tag{display:flex;overflow:hidden;align-items:center;border-radius:3px;margin:0 3px 3px 0;padding:5px;cursor:default}.gjs-clm-tag-status,.gjs-clm-tag-close{width:12px;height:12px;flex-shrink:1}.gjs-clm-tag-status svg,.gjs-clm-tag-close svg{vertical-align:middle;fill:currentColor}.gjs-clm-sels-info{margin:7px 0}.gjs-clm-sel-id{font-size:.9em;opacity:.5;filter:alpha(opacity=50)}.gjs-clm-label-sel{float:left;padding-right:5px}.gjs-clm-tags{font-size:.75rem;padding:10px 5px}.gjs-clm-tags #gjs-clm-sel{padding:7px 0;float:left}.gjs-clm-tags #gjs-clm-sel{font-style:italic;margin-left:5px}.gjs-clm-tags #gjs-clm-tags-field{clear:both;padding:5px;margin-bottom:5px;display:flex;flex-wrap:wrap}.gjs-clm-tags #gjs-clm-tags-c{display:flex;flex-wrap:wrap;vertical-align:top;overflow:hidden}.gjs-clm-tags #gjs-clm-new{color:#ddd;padding:5px 6px;display:none}.gjs-clm-tags #gjs-clm-close{opacity:.85;filter:alpha(opacity=85);font-size:20px;line-height:0;cursor:pointer;color:rgba(255,255,255,.9)}.gjs-clm-tags #gjs-clm-close:hover{opacity:1;filter:alpha(opacity=100)}.gjs-clm-tags #gjs-clm-checkbox{color:rgba(255,255,255,.9);vertical-align:middle;cursor:pointer;font-size:9px}.gjs-clm-tags #gjs-clm-tag-label{flex-grow:1;text-overflow:ellipsis;overflow:hidden;padding:0 3px;cursor:text}.gjs-mdl-container{font-family:Helvetica,sans-serif;overflow-y:auto;position:fixed;background-color:rgba(0,0,0,.5);display:flex;top:0;left:0;right:0;bottom:0;z-index:100}.gjs-mdl-dialog{text-shadow:-1px -1px 0 rgba(0,0,0,.05);animation:gjs-slide-down .215s;margin:auto;max-width:850px;width:90%;border-radius:3px;font-weight:lighter;position:relative;z-index:2}.gjs-mdl-title{font-size:1rem}.gjs-mdl-btn-close{position:absolute;right:15px;top:5px}.gjs-mdl-active .gjs-mdl-dialog{animation:gjs-mdl-slide-down .216s}.gjs-mdl-header,.gjs-mdl-content{padding:10px 15px;clear:both}.gjs-mdl-header{position:relative;border-bottom:1px solid rgba(0,0,0,.2);padding:15px 15px 7px}.gjs-export-dl::after{content:"";clear:both;display:block;margin-bottom:10px}.gjs-dropzone{display:none;opacity:0;position:absolute;top:0;left:0;z-index:11;width:100%;height:100%;transition:opacity .25s;pointer-events:none}.gjs-dropzone-active .gjs-dropzone{display:block;opacity:1}.gjs-am-assets{height:290px;overflow:auto;clear:both;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:flex-start}.gjs-am-assets-header{padding:5px}.gjs-am-add-asset .gjs-am-add-field{width:70%;float:left}.gjs-am-add-asset button{width:25%;float:right}.gjs-am-preview-cont{position:relative;height:70px;width:30%;background-color:#444;border-radius:2px;float:left;overflow:hidden}.gjs-am-preview{position:absolute;background-position:center center;background-size:cover;background-repeat:no-repeat;height:100%;width:100%;z-index:1}.gjs-am-preview-bg{opacity:.5;filter:alpha(opacity=50);position:absolute;height:100%;width:100%;z-index:0}.gjs-am-dimensions{opacity:.5;filter:alpha(opacity=50);font-size:10px}.gjs-am-meta{width:70%;float:left;font-size:12px;padding:5px 0 0 5px;box-sizing:border-box}.gjs-am-meta>div{margin-bottom:5px}.gjs-am-close{cursor:pointer;position:absolute;right:5px;top:0;display:none}.gjs-am-asset{border-bottom:1px solid rgba(0,0,0,.2);padding:5px;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.gjs-am-asset:hover .gjs-am-close{display:block}.gjs-am-highlight{background-color:rgba(255,255,255,.1)}.gjs-am-assets-cont{background-color:rgba(0,0,0,.1);border-radius:3px;box-sizing:border-box;padding:10px;width:45%;float:right;height:325px;overflow:hidden}.gjs-am-file-uploader{width:55%;float:left}.gjs-am-file-uploader>form{background-color:rgba(0,0,0,.1);border:2px dashed;border-radius:3px;position:relative;text-align:center;margin-bottom:15px}.gjs-am-file-uploader>form.gjs-am-hover{border:2px solid #62c462;color:#75cb75}.gjs-am-file-uploader>form.gjs-am-disabled{border-color:red}.gjs-am-file-uploader>form #gjs-am-uploadFile{opacity:0;filter:alpha(opacity=0);padding:150px 10px;width:100%;box-sizing:border-box}.gjs-am-file-uploader #gjs-am-title{position:absolute;padding:150px 10px;width:100%}.gjs-cm-editor-c{float:left;box-sizing:border-box;width:50%}.gjs-cm-editor-c .CodeMirror{height:450px}.gjs-cm-editor{font-size:12px}.gjs-cm-editor#gjs-cm-htmlmixed{padding-right:10px;border-right:1px solid rgba(0,0,0,.2)}.gjs-cm-editor#gjs-cm-htmlmixed #gjs-cm-title{color:#a97d44}.gjs-cm-editor#gjs-cm-css{padding-left:10px}.gjs-cm-editor#gjs-cm-css #gjs-cm-title{color:#ddca7e}.gjs-cm-editor #gjs-cm-title{background-color:rgba(0,0,0,.2);font-size:12px;padding:5px 10px 3px;text-align:right}.gjs-rte-toolbar{border:1px solid rgba(0,0,0,.2);position:absolute;border-radius:3px;z-index:10}.gjs-rte-actionbar{display:flex}.gjs-rte-action{display:flex;align-items:center;justify-content:center;padding:5px;min-width:25px;border-right:1px solid rgba(0,0,0,.2);text-align:center;cursor:pointer;outline:none}.gjs-rte-action:last-child{border-right:none}.gjs-rte-action:hover{background-color:rgba(255,255,255,.1)}.gjs-rte-active{background-color:rgba(255,255,255,.1)}.gjs-rte-disabled{color:rgba(255,255,255,.1);cursor:not-allowed}.gjs-rte-disabled:hover{background-color:unset}.gjs-editor-cont .sp-hue,.gjs-editor-cont .sp-slider{cursor:row-resize}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-dragger{cursor:crosshair}.gjs-editor-cont .sp-alpha-inner,.gjs-editor-cont .sp-alpha-handle{cursor:col-resize}.gjs-editor-cont .sp-hue{left:90%}.gjs-editor-cont .sp-color{right:15%}.gjs-editor-cont .sp-container{border:1px solid rgba(0,0,0,.2);box-shadow:0 0 7px rgba(0,0,0,.2);border-radius:3px}.gjs-editor-cont .sp-picker-container{border:none}.gjs-editor-cont .colpick_dark .colpick_color{outline:1px solid rgba(0,0,0,.2)}.gjs-editor-cont .sp-cancel,.gjs-editor-cont .sp-cancel:hover{bottom:-8px;color:#777 !important;font-size:25px;left:0;position:absolute;text-decoration:none}.gjs-editor-cont .sp-alpha-handle{background-color:#ccc;border:1px solid #555;width:4px}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-hue{border:1px solid #333}.gjs-editor-cont .sp-slider{background-color:#ccc;border:1px solid #555;height:3px;left:-4px;width:22px}.gjs-editor-cont .sp-dragger{background:transparent;box-shadow:0 0 0 1px #111}.gjs-editor-cont .sp-button-container{float:none;width:100%;position:relative;text-align:right}.gjs-editor-cont .sp-container button,.gjs-editor-cont .sp-container button:hover,.gjs-editor-cont .sp-container button:active{background:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2);color:#ddd;text-shadow:none;box-shadow:none;padding:3px 5px}.gjs-editor-cont .sp-palette-container{border:none;float:none;margin:0;padding:5px 10px 0}.gjs-editor-cont .sp-palette .sp-thumb-el,.gjs-editor-cont .sp-palette .sp-thumb-el:hover{border:1px solid rgba(0,0,0,.9)}.gjs-editor-cont .sp-palette .sp-thumb-el:hover,.gjs-editor-cont .sp-palette .sp-thumb-el.sp-thumb-active{border-color:rgba(0,0,0,.9)}.gjs-hidden{display:none}@keyframes gjs-slide-down{0%{transform:translate(0, -3rem);opacity:0}100%{transform:translate(0, 0);opacity:1}}@keyframes gjs-slide-up{0%{transform:translate(0, 0);opacity:1}100%{transform:translate(0, -3rem);opacity:0}}.cm-s-hopscotch span.cm-error{color:#fff} +.sp-container{position:absolute;top:0;left:0;display:inline-block;*display:inline;*zoom:1;z-index:9999994;overflow:hidden}.sp-container.sp-flat{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{position:relative;width:100%;display:inline-block}.sp-top-inner{position:absolute;top:0;left:0;bottom:0;right:0}.sp-color{position:absolute;top:0;left:0;bottom:0;right:20%}.sp-hue{position:absolute;top:0;right:0;bottom:0;left:84%;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{position:absolute;top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{position:absolute;top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid black;background:white;opacity:.8}.sp-alpha{display:none;position:absolute;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:solid 1px #333}.sp-clear{display:none}.sp-clear.sp-clear-display{background-position:center}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0px;right:0;bottom:0;left:84%;height:28px}.sp-container,.sp-replacer,.sp-preview,.sp-dragger,.sp-slider,.sp-alpha,.sp-clear,.sp-alpha-handle,.sp-container.sp-dragging .sp-input,.sp-container button{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-input-disabled .sp-input-container{display:none}.sp-container.sp-buttons-disabled .sp-button-container{display:none}.sp-container.sp-palette-buttons-disabled .sp-palette-button-container{display:none}.sp-palette-only .sp-picker-container{display:none}.sp-palette-disabled .sp-palette-container{display:none}.sp-initial-disabled .sp-initial{display:none}.sp-sat{background-image:-webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:linear-gradient(to right, #fff, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr="#FFFFFFFF", endColorstr="#00CC9A81")}.sp-val{background-image:-webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:linear-gradient(to top, #000, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00CC9A81", endColorstr="#FF000000")}.sp-hue{background:-moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));background:-webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff0000", endColorstr="#ffff00")}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffff00", endColorstr="#00ff00")}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ff00", endColorstr="#00ffff")}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffff", endColorstr="#0000ff")}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0000ff", endColorstr="#ff00ff")}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff00ff", endColorstr="#ff0000")}.sp-hidden{display:none !important}.sp-cf:before,.sp-cf:after{content:"";display:table}.sp-cf:after{clear:both}.sp-cf{*zoom:1}@media(max-device-width: 480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;cursor:pointer;position:absolute;top:0;left:0}.sp-slider{position:absolute;top:0;cursor:pointer;height:3px;left:-1px;right:-1px;border:1px solid #000;background:white;opacity:.8}.sp-container{border-radius:0;background-color:#ececec;border:solid 1px #f0c49b;padding:0}.sp-container,.sp-container button,.sp-container input,.sp-color,.sp-hue,.sp-clear{font:normal 12px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-color,.sp-hue,.sp-clear{border:solid 1px #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container{width:100%}.sp-input{font-size:12px !important;border:1px inset;padding:4px 5px;margin:0;width:100%;background:transparent;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-picker-container,.sp-palette-container{float:left;position:relative;padding:10px;padding-bottom:300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:solid 1px #fff}.sp-palette-container{border-right:solid 1px #ccc}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;width:24px;height:15px;margin:3px;cursor:pointer;border:solid 2px transparent}.sp-palette .sp-thumb-el:hover,.sp-palette .sp-thumb-el.sp-thumb-active{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:solid 1px #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:center}.sp-palette-button-container,.sp-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;*zoom:1;*display:inline;border:solid 1px #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer:hover,.sp-replacer.sp-active{border-color:#f0c49b;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px}.sp-preview{position:relative;width:25px;height:20px;border:solid 1px #222;margin-right:5px;float:left;z-index:0}.sp-palette{*width:220px;max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:solid 1px #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top, #eeeeee, #cccccc);background-image:-moz-linear-gradient(top, #eeeeee, #cccccc);background-image:-ms-linear-gradient(top, #eeeeee, #cccccc);background-image:-o-linear-gradient(top, #eeeeee, #cccccc);background-image:linear-gradient(to bottom, #eeeeee, #cccccc);border:1px solid #ccc;border-bottom:1px solid #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top, #dddddd, #bbbbbb);background-image:-moz-linear-gradient(top, #dddddd, #bbbbbb);background-image:-ms-linear-gradient(top, #dddddd, #bbbbbb);background-image:-o-linear-gradient(top, #dddddd, #bbbbbb);background-image:linear-gradient(to bottom, #dddddd, #bbbbbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid #aaa;border-bottom:1px solid #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f !important;margin:0;padding:2px;margin-right:5px;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f !important;text-decoration:underline}.sp-palette span:hover,.sp-palette span.sp-thumb-active{border-color:#000}.sp-preview,.sp-alpha,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-preview-inner,.sp-alpha-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=)}.sp-clear-display{background-repeat:no-repeat;background-position:center;background-image:url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20, 255, 20, 0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:blue}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, 0.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, 0.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-hopscotch.CodeMirror{background:#322931;color:#d5d3d5}.cm-s-hopscotch div.CodeMirror-selected{background:#433b42 !important}.cm-s-hopscotch .CodeMirror-gutters{background:#322931;border-right:0px}.cm-s-hopscotch .CodeMirror-linenumber{color:#797379}.cm-s-hopscotch .CodeMirror-cursor{border-left:1px solid #989498 !important}.cm-s-hopscotch span.cm-comment{color:#b33508}.cm-s-hopscotch span.cm-atom{color:#c85e7c}.cm-s-hopscotch span.cm-number{color:#c85e7c}.cm-s-hopscotch span.cm-property,.cm-s-hopscotch span.cm-attribute{color:#8fc13e}.cm-s-hopscotch span.cm-keyword{color:#dd464c}.cm-s-hopscotch span.cm-string{color:#fdcc59}.cm-s-hopscotch span.cm-variable{color:#8fc13e}.cm-s-hopscotch span.cm-variable-2{color:#1290bf}.cm-s-hopscotch span.cm-def{color:#fd8b19}.cm-s-hopscotch span.cm-error{background:#dd464c;color:#989498}.cm-s-hopscotch span.cm-bracket{color:#d5d3d5}.cm-s-hopscotch span.cm-tag{color:#dd464c}.cm-s-hopscotch span.cm-link{color:#c85e7c}.cm-s-hopscotch .CodeMirror-matchingbracket{text-decoration:underline;color:white !important}.cm-s-hopscotch .CodeMirror-activeline-background{background:#302020}@font-face{font-family:"font3336";src:url("../fonts/main-fonts.eot?v=20");src:url("../fonts/main-fonts.woff?v=20") format("woff"),url("../fonts/main-fonts.ttf?v=20") format("truetype"),url("../fonts/main-fonts.svg?v=20") format("svg"),url("../fonts/main-fonts.eot?v=20") format("embedded-opentype");font-weight:normal;font-style:normal}.gjs-is__grab,.gjs-is__grab *{cursor:grab !important}.gjs-is__grabbing,.gjs-is__grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:grabbing !important}.gjs-one-bg{background-color:#444}.gjs-one-color{color:#444}.gjs-one-color-h:hover{color:#444}.gjs-two-bg{background-color:#ddd}.gjs-two-color{color:#ddd}.gjs-two-color-h:hover{color:#ddd}.gjs-three-bg{background-color:#804f7b}.gjs-three-color{color:#804f7b}.gjs-three-color-h:hover{color:#804f7b}.gjs-four-bg{background-color:#d278c9}.gjs-four-color{color:#d278c9}.gjs-four-color-h:hover{color:#d278c9}.gjs-danger-bg{background-color:#dd3636}.gjs-danger-color{color:#dd3636}.gjs-danger-color-h:hover{color:#dd3636}.gjs-bg-main,.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c,.gjs-off-prv{background-color:#444}.gjs-color-main,.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add,.gjs-off-prv{color:#ddd;fill:#ddd}.gjs-color-active{color:#f8f8f8;fill:#f8f8f8}.gjs-color-warn{color:#ffca6f;fill:#ffca6f}.gjs-color-hl{color:#71b7f1;fill:#71b7f1}.gjs-fonts::before{display:block;font:normal normal normal 14px font3336;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:5em}.gjs-f-b1::before{content:"Q"}.gjs-f-b2::before{content:"W"}.gjs-f-b3::before{content:"E"}.gjs-f-b37::before{content:"R"}.gjs-f-hero::before{content:"T"}.gjs-f-h1p::before{content:"y"}.gjs-f-3ba::before{content:"u"}.gjs-f-image::before{content:"I"}.gjs-f-text::before{content:"o"}.gjs-f-quo::before{content:"p"}.gjs-f-button::before{content:"B"}.gjs-f-divider::before{content:"D"}.gjs-invis-invis,.gjs-clm-tags #gjs-clm-new,.gjs-no-app{background-color:transparent;border:none;color:inherit}.gjs-no-app{height:10px}.gjs-test::btn{color:"#fff"}.opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-checker-bg,.gjs-field-colorp-c,.checker-bg,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==")}.gjs-no-user-select,.gjs-rte-toolbar,.gjs-layer-name,.gjs-grabbing,.gjs-grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-pointer-events,.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el,.gjs-resizer-c{pointer-events:none}.gjs-bdrag{pointer-events:none !important;position:absolute !important;z-index:10 !important;width:auto}.gjs-drag-helper{background-color:#3b97e3 !important;pointer-events:none !important;position:absolute !important;z-index:10 !important;transform:scale(0.3) !important;transform-origin:top left !important;-webkit-transform-origin:top left !important;margin:15px !important;transition:none !important;outline:none !important}.gjs-grabbing,.gjs-grabbing *{cursor:grabbing !important;cursor:-webkit-grabbing !important}.gjs-grabbing{overflow:hidden}.gjs-off-prv{position:relative;z-index:10;padding:5px;cursor:pointer}.gjs-editor-cont ::-webkit-scrollbar-track{background:rgba(0,0,0,.1)}.gjs-editor-cont ::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.2)}.gjs-editor-cont ::-webkit-scrollbar{width:8px}.clear{clear:both}.no-select,.gjs-clm-tags #gjs-clm-close,.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title,.gjs-com-no-select,.gjs-com-no-select img{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-touch-actions{touch-action:none}.gjs-disabled{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;opacity:.5;filter:alpha(opacity=50)}.gjs-editor{font-family:Helvetica,sans-serif;font-size:.75rem;position:relative;box-sizing:border-box;height:100%}.gjs-freezed,.gjs-freezed{opacity:.5;filter:alpha(opacity=50);pointer-events:none}.gjs-traits-label{border-bottom:1px solid rgba(0,0,0,.2);font-weight:lighter;margin-bottom:5px;padding:10px;text-align:left}.gjs-label-wrp{width:30%;min-width:30%}.gjs-field-wrp{flex-grow:1}.gjs-trt-header{font-weight:lighter;padding:10px}.gjs-trt-trait{display:flex;justify-content:flex-start;padding:5px 10px;font-weight:lighter;align-items:center;text-align:left}.gjs-trt-traits{font-size:.75rem}.gjs-trt-trait .gjs-label{text-align:left;text-overflow:ellipsis;overflow:hidden}.gjs-guide-info{position:absolute}.gjs-guide-info__content{position:absolute;height:100%;display:flex;width:100%;padding:5px}.gjs-guide-info__line{position:relative;margin:auto}.gjs-guide-info__line::before,.gjs-guide-info__line::after{content:"";display:block;position:absolute;background-color:inherit}.gjs-guide-info__y{padding:0 5px}.gjs-guide-info__y .gjs-guide-info__content{justify-content:center}.gjs-guide-info__y .gjs-guide-info__line{width:100%;height:1px}.gjs-guide-info__y .gjs-guide-info__line::before,.gjs-guide-info__y .gjs-guide-info__line::after{width:1px;height:10px;top:0;bottom:0;left:0;margin:auto}.gjs-guide-info__y .gjs-guide-info__line::after{left:auto;right:0}.gjs-guide-info__x{padding:5px 0}.gjs-guide-info__x .gjs-guide-info__content{align-items:center}.gjs-guide-info__x .gjs-guide-info__line{height:100%;width:1px}.gjs-guide-info__x .gjs-guide-info__line::before,.gjs-guide-info__x .gjs-guide-info__line::after{width:10px;height:1px;left:0;right:0;top:0;margin:auto;transform:translateX(-50%)}.gjs-guide-info__x .gjs-guide-info__line::after{top:auto;bottom:0}.gjs-badge{white-space:nowrap}.gjs-badge__icon{vertical-align:middle;display:inline-block;width:15px;height:15px}.gjs-badge__icon svg{fill:currentColor}.gjs-badge__name{display:inline-block;vertical-align:middle}.gjs-frame-wrapper{position:absolute;width:100%;height:100%;left:0;right:0;margin:auto}.gjs-frame-wrapper--anim{transition:width .35s ease,height .35s ease}.gjs-frame-wrapper__top{transform:translateY(-100%) translateX(-50%);display:flex;padding:5px 0;position:absolute;width:100%;left:50%;top:0}.gjs-frame-wrapper__top-r{margin-left:auto}.gjs-frame-wrapper__left{position:absolute;left:0;transform:translateX(-100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__bottom{position:absolute;bottom:0;transform:translateY(100%) translateX(-50%);width:100%;left:50%}.gjs-frame-wrapper__right{position:absolute;right:0;transform:translateX(100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__icon{width:24px;cursor:pointer}.gjs-frame-wrapper__icon>svg{fill:currentColor}.gjs-padding-v-top,.gjs-fixedpadding-v-top{width:100%;top:0;left:0}.gjs-padding-v-right,.gjs-fixedpadding-v-right{right:0}.gjs-padding-v-bottom,.gjs-fixedpadding-v-bottom{width:100%;left:0;bottom:0}.gjs-padding-v-left,.gjs-fixedpadding-v-left{left:0}.gjs-cv-canvas{background-color:rgba(0,0,0,.15);box-sizing:border-box;width:85%;height:calc(100% - 40px);bottom:0;overflow:hidden;z-index:1;position:absolute;left:0;top:40px}.gjs-cv-canvas.gjs-cui{width:100%;height:100%;top:0}.gjs-cv-canvas.gjs-is__grab .gjs-cv-canvas__frames,.gjs-cv-canvas.gjs-is__grabbing .gjs-cv-canvas__frames{pointer-events:none}.gjs-cv-canvas__frames{position:absolute;top:0;left:0;width:100%;height:100%}.gjs-cv-canvas .gjs-ghost{display:none;pointer-events:none;background-color:#5b5b5b;border:2px dashed #ccc;position:absolute;z-index:10;opacity:.55;filter:alpha(opacity=55)}.gjs-cv-canvas .gjs-highlighter,.gjs-cv-canvas .gjs-highlighter-sel{position:absolute;outline:1px solid #3b97e3;outline-offset:-1px;pointer-events:none;width:100%;height:100%}.gjs-cv-canvas .gjs-highlighter-warning{outline:3px solid #ffca6f}.gjs-cv-canvas .gjs-highlighter-sel{outline:2px solid #3b97e3;outline-offset:-2px}.gjs-cv-canvas #gjs-tools,.gjs-cv-canvas .gjs-tools{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;z-index:1}.gjs-cv-canvas *{box-sizing:border-box}.gjs-frame{outline:medium none;height:100%;width:100%;border:none;margin:auto;display:block;transition:width .35s ease,height .35s ease;position:absolute;top:0;bottom:0;left:0;right:0}.gjs-toolbar{position:absolute;background-color:#3b97e3;white-space:nowrap;color:#fff;z-index:10;top:0;left:0}.gjs-toolbar-item{padding:5px 7px;font-size:.8rem;cursor:pointer;width:26px;vertical-align:middle;display:inline-block}.gjs-toolbar-item svg{fill:currentColor;vertical-align:middle}.gjs-resizer-c{position:absolute;left:0;top:0;width:100%;height:100%;z-index:9}.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.1;filter:alpha(opacity=10);position:absolute;background-color:#ff0}.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.2;filter:alpha(opacity=20)}.gjs-padding-v-el,.gjs-fixedpadding-v-el{background-color:navy}.gjs-resizer-h{pointer-events:all;position:absolute;border:3px solid #3b97e3;width:10px;height:10px;background-color:#fff;margin:-5px}.gjs-resizer-h-tl{top:0;left:0;cursor:nwse-resize}.gjs-resizer-h-tr{top:0;right:0;cursor:nesw-resize}.gjs-resizer-h-tc{top:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-cl{left:0;margin:auto -5px;top:0;bottom:0;cursor:ew-resize}.gjs-resizer-h-cr{margin:auto -5px;top:0;bottom:0;right:0;cursor:ew-resize}.gjs-resizer-h-bl{bottom:0;left:0;cursor:nesw-resize}.gjs-resizer-h-bc{bottom:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-br{bottom:0;right:0;cursor:nwse-resize}.gjs-pn-panel .gjs-resizer-h{background-color:rgba(0,0,0,.2);border:none;opacity:0;transition:opacity .25s}.gjs-pn-panel .gjs-resizer-h:hover{opacity:1}.gjs-pn-panel .gjs-resizer-h-tc,.gjs-pn-panel .gjs-resizer-h-bc{margin:0 auto;width:100%}.gjs-pn-panel .gjs-resizer-h-cr,.gjs-pn-panel .gjs-resizer-h-cl{margin:auto 0;height:100%}.gjs-resizing .gjs-highlighter,.gjs-resizing .gjs-badge{display:none !important}.gjs-resizing-tl *{cursor:nwse-resize !important}.gjs-resizing-tr *{cursor:nesw-resize !important}.gjs-resizing-tc *{cursor:ns-resize !important}.gjs-resizing-cl *{cursor:ew-resize !important}.gjs-resizing-cr *{cursor:ew-resize !important}.gjs-resizing-bl *{cursor:nesw-resize !important}.gjs-resizing-bc *{cursor:ns-resize !important}.gjs-resizing-br *{cursor:nwse-resize !important}.btn-cl,.gjs-am-close,.gjs-mdl-btn-close{opacity:.3;filter:alpha(opacity=30);font-size:25px;cursor:pointer}.btn-cl:hover,.gjs-am-close:hover,.gjs-mdl-btn-close:hover{opacity:.7;filter:alpha(opacity=70)}.no-dots,.ui-resizable-handle{border:none !important;margin:0 !important;outline:none !important}.gjs-com-dashed *{outline:1px dashed #888;outline-offset:-2px;box-sizing:border-box}.gjs-cv-canvas .gjs-comp-selected{outline:3px solid #3b97e3 !important}*.gjs-com-hover,div.gjs-com-hover{outline:1px solid #3b97e3}*.gjs-com-hover-delete,div.gjs-com-hover-delete{outline:2px solid #dd3636;opacity:.5;filter:alpha(opacity=50)}*.gjs-com-hover-move,div.gjs-com-hover-move{outline:3px solid #ffca6f}.gjs-com-badge,.gjs-com-badge-red,.gjs-badge{pointer-events:none;background-color:#3b97e3;color:#fff;padding:2px 5px;position:absolute;z-index:1;font-size:12px;outline:none;display:none}.gjs-com-badge-red{background-color:#dd3636}.gjs-badge-warning{background-color:#ffca6f}.gjs-placeholder,.gjs-com-placeholder,.gjs-placeholder{position:absolute;z-index:10;pointer-events:none;display:none}.gjs-placeholder,.gjs-placeholder{border-style:solid !important;outline:none;box-sizing:border-box;transition:top .2s,left .2s,width .2s,height .2s}.gjs-placeholder.horizontal,.gjs-com-placeholder.horizontal,.gjs-placeholder.horizontal{border-color:transparent #62c462;border-width:3px 5px;margin:-3px 0 0}.gjs-placeholder.vertical,.gjs-com-placeholder.vertical,.gjs-placeholder.vertical{border-color:#62c462 transparent;border-width:5px 3px;margin:0 0 0 -3px}.gjs-placeholder-int,.gjs-com-placeholder-int,.gjs-placeholder-int{background-color:#62c462;box-shadow:0 0 3px rgba(0,0,0,.2);height:100%;width:100%;pointer-events:none;padding:1.5px;outline:none}.gjs-pn-panel{display:inline-block;position:absolute;box-sizing:border-box;text-align:center;padding:5px;z-index:3}.gjs-pn-panel .icon-undo,.gjs-pn-panel .icon-redo{font-size:20px;height:30px;width:25px}.gjs-pn-commands{width:85%;left:0;top:0;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-options{right:15%;top:0}.gjs-pn-views{border-bottom:2px solid rgba(0,0,0,.2);right:0;width:15%;z-index:4}.gjs-pn-views-container{height:100%;padding:42px 0 0;right:0;width:15%;overflow:auto;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-buttons{align-items:center;display:flex;justify-content:space-between}.gjs-pn-btn{box-sizing:border-box;min-height:30px;min-width:30px;line-height:21px;background-color:transparent;border:none;font-size:18px;margin-right:5px;border-radius:2px;padding:4px;position:relative;cursor:pointer}.gjs-pn-btn.gjs-pn-active{background-color:rgba(0,0,0,.15);box-shadow:0 0 3px rgba(0,0,0,.25) inset}.gjs-pn-btn svg{fill:currentColor}.gjs-comp-image-placeholder{display:block;background-color:#f5f5f5;color:#777;height:50px;width:50px;line-height:50px;outline:3px solid #ffca6f;outline-offset:-3px;text-align:center;font-size:16.6666666667px;cursor:pointer}.gjs-comp-image-placeholder.fa-picture-o::after{content:""}.gjs-label{line-height:18px}.gjs-fields{display:flex}.gjs-select{padding:0;width:100%}.gjs-select select{padding-right:10px}.gjs-select:-moz-focusring,.gjs-select select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-input:focus,.gjs-button:focus,.gjs-btn-prim:focus,.gjs-select:focus,.gjs-select select:focus{outline:none}.gjs-field input,.gjs-field select,.gjs-field textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:inherit;border:none;background-color:transparent;box-sizing:border-box;width:100%;position:relative;padding:5px;z-index:1}.gjs-field input:focus,.gjs-field select:focus,.gjs-field textarea:focus{outline:none}.gjs-field input[type=number]{-moz-appearance:textfield}.gjs-field input[type=number]::-webkit-outer-spin-button,.gjs-field input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gjs-field-range{flex:9 1 auto}.gjs-field-integer input{padding-right:30px}.gjs-select option,.gjs-field-select option,.gjs-clm-select option,.gjs-sm-select option,.gjs-fields option,.gjs-sm-unit option{background-color:#444;color:#ddd}.gjs-field{background-color:rgba(0,0,0,.2);border:none;box-shadow:none;border-radius:2px;box-sizing:border-box;padding:0;position:relative}.gjs-field textarea{resize:vertical}.gjs-field .gjs-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;z-index:0}.gjs-field .gjs-d-s-arrow{bottom:0;top:0;margin:auto;right:5px;border-top:4px solid rgba(255,255,255,.7);position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-field-arrows{position:absolute;cursor:ns-resize;margin:auto;height:20px;width:9px;z-index:10;bottom:0;right:3px;top:0}.gjs-field-color,.gjs-field-radio{width:100%}.gjs-field-color input{padding-right:22px;box-sizing:border-box}.gjs-field-colorp{border-left:1px solid rgba(0,0,0,.2);box-sizing:border-box;height:100%;padding:2px;position:absolute;right:0;top:0;width:22px;z-index:10}.gjs-field-colorp .gjs-checker-bg,.gjs-field-colorp .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-field-colorp-c{height:100%;position:relative;width:100%}.gjs-field-color-picker{background-color:#ddd;cursor:pointer;height:100%;width:100%;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px;position:absolute;top:0}.gjs-field-checkbox{padding:0;width:17px;height:17px;display:block;cursor:pointer}.gjs-field-checkbox input{display:none}.gjs-field-checkbox input:checked+.gjs-chk-icon{border-color:rgba(255,255,255,.5);border-width:0 2px 2px 0;border-style:solid}.gjs-radio-item{flex:1 1 auto;text-align:center;border-left:1px solid rgba(0,0,0,.2)}.gjs-radio-item:first-child{border:none}.gjs-radio-item:hover{background:rgba(0,0,0,.2)}.gjs-radio-item input{display:none}.gjs-radio-item input:checked+.gjs-radio-item-label{background-color:rgba(255,255,255,.2)}.gjs-radio-items{display:flex}.gjs-radio-item-label{cursor:pointer;display:block;padding:5px}.gjs-field-units{position:absolute;margin:auto;right:10px;bottom:0;top:0}.gjs-field-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-field-arrow-u,.gjs-field-arrow-d{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(255,255,255,.7);bottom:4px;cursor:pointer}.gjs-field-arrow-u{border-bottom:4px solid rgba(255,255,255,.7);border-top:none;top:4px}.gjs-field-select{padding:0}.gjs-field-range{background-color:transparent;border:none;box-shadow:none;padding:0}.gjs-field-range input{margin:0;height:100%}.gjs-field-range input:focus{outline:none}.gjs-field-range input::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-ms-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-webkit-slider-runnable-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-ms-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-btn-prim{color:inherit;background-color:rgba(255,255,255,.1);border-radius:2px;padding:3px 6px;padding:5px;cursor:pointer;border:none}.gjs-btn-prim:active{background-color:rgba(255,255,255,.1)}.gjs-btn--full{width:100%}.gjs-chk-icon{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);box-sizing:border-box;display:block;height:14px;margin:0 5px;width:6px}.gjs-add-trasp{background:none;border:none;color:#ddd;cursor:pointer;font-size:1em;border-radius:2px;opacity:.75;filter:alpha(opacity=75)}.gjs-add-trasp:hover{opacity:1;filter:alpha(opacity=100)}.gjs-add-trasp:active{background-color:rgba(0,0,0,.2)}.gjs-devices-c{display:flex;align-items:center;padding:3px}.gjs-devices-c .gjs-device-label{flex-grow:2;text-align:left;margin-right:10px}.gjs-devices-c .gjs-select{flex-grow:20}.gjs-devices-c .gjs-add-trasp{flex-grow:1;margin-left:5px}.gjs-category-open,.gjs-block-category.gjs-open,.gjs-sm-sector.gjs-sm-open,.gjs-sm-open.gjs-clm-tags{border-bottom:1px solid rgba(0,0,0,.25)}.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title{font-weight:lighter;background-color:rgba(0,0,0,.1);letter-spacing:1px;padding:9px 10px 9px 20px;border-bottom:1px solid rgba(0,0,0,.25);text-align:left;position:relative;cursor:pointer}.gjs-sm-clear{line-height:0;cursor:pointer}.gjs-sm-header{font-weight:lighter;padding:10px}.gjs-sm-properties{font-size:.75rem;padding:10px 5px;display:flex;flex-wrap:wrap;align-items:flex-end;box-sizing:border-box;width:100%}.gjs-sm-label{margin:5px 5px 3px 0}.gjs-sm-close-btn,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.2;filter:alpha(opacity=20)}.gjs-sm-close-btn:hover,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover{opacity:.7;filter:alpha(opacity=70)}.gjs-sm-sector,.gjs-clm-tags{clear:both;font-weight:lighter;text-align:left}.gjs-sm-sector #gjs-sm-caret,.gjs-clm-tags #gjs-sm-caret{padding-right:5px;font-size:11px}.gjs-sm-sector .gjs-sm-field,.gjs-clm-tags .gjs-sm-field,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-clm-field,.gjs-clm-tags .gjs-clm-field{width:100%;position:relative}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input,.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{background-color:transparent;color:rgba(255,255,255,.7);border:none;width:100%}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input{box-sizing:border-box}.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gjs-sm-sector .gjs-sm-field select::-ms-expand,.gjs-clm-tags .gjs-sm-field select::-ms-expand,.gjs-sm-sector .gjs-clm-select select::-ms-expand,.gjs-clm-tags .gjs-clm-select select::-ms-expand,.gjs-sm-sector .gjs-clm-field select::-ms-expand,.gjs-clm-tags .gjs-clm-field select::-ms-expand{display:none}.gjs-sm-sector .gjs-sm-field select:-moz-focusring,.gjs-clm-tags .gjs-sm-field select:-moz-focusring,.gjs-sm-sector .gjs-clm-select select:-moz-focusring,.gjs-clm-tags .gjs-clm-select select:-moz-focusring,.gjs-sm-sector .gjs-clm-field select:-moz-focusring,.gjs-clm-tags .gjs-clm-field select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-sm-sector .gjs-sm-field input:focus,.gjs-clm-tags .gjs-sm-field input:focus,.gjs-sm-sector .gjs-clm-select input:focus,.gjs-clm-tags .gjs-clm-select input:focus,.gjs-sm-sector .gjs-clm-field input:focus,.gjs-clm-tags .gjs-clm-field input:focus,.gjs-sm-sector .gjs-sm-field select:focus,.gjs-clm-tags .gjs-sm-field select:focus,.gjs-sm-sector .gjs-clm-select select:focus,.gjs-clm-tags .gjs-clm-select select:focus,.gjs-sm-sector .gjs-clm-field select:focus,.gjs-clm-tags .gjs-clm-field select:focus{outline:none}.gjs-sm-sector .gjs-sm-field .gjs-sm-unit,.gjs-clm-tags .gjs-sm-field .gjs-sm-unit,.gjs-sm-sector .gjs-clm-select .gjs-sm-unit,.gjs-clm-tags .gjs-clm-select .gjs-sm-unit,.gjs-sm-sector .gjs-clm-field .gjs-sm-unit,.gjs-clm-tags .gjs-clm-field .gjs-sm-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-sm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-select .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-select .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;cursor:ns-resize}.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{border-bottom:4px solid rgba(255,255,255,.7);top:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{border-top:4px solid rgba(255,255,255,.7);bottom:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{bottom:7px}.gjs-sm-sector .gjs-sm-field.gjs-sm-color,.gjs-clm-tags .gjs-sm-field.gjs-sm-color,.gjs-sm-sector .gjs-sm-color.gjs-clm-field,.gjs-clm-tags .gjs-sm-color.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-input,.gjs-clm-tags .gjs-sm-field.gjs-sm-input,.gjs-sm-sector .gjs-sm-input.gjs-clm-field,.gjs-clm-tags .gjs-sm-input.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-integer,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{background-color:rgba(0,0,0,.2);border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 0 rgba(255,255,255,.1);color:rgba(255,255,255,.7);border-radius:2px;box-sizing:border-box;padding:0 5px}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{border-radius:2px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{padding:0}.gjs-sm-sector .gjs-sm-field.gjs-sm-select select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field select,.gjs-clm-tags .gjs-sm-select.gjs-clm-field select{height:20px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select option,.gjs-clm-tags .gjs-sm-field.gjs-sm-select option,.gjs-sm-sector .gjs-clm-select option,.gjs-clm-tags .gjs-clm-select option,.gjs-sm-sector .gjs-sm-select.gjs-clm-field option,.gjs-clm-tags .gjs-sm-select.gjs-clm-field option{padding:3px 0}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{background-color:rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.25)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-select,.gjs-clm-tags .gjs-sm-list.gjs-clm-select,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field{width:auto;padding:0;overflow:hidden;float:left}.gjs-sm-sector .gjs-sm-field.gjs-sm-list input,.gjs-clm-tags .gjs-sm-field.gjs-sm-list input,.gjs-sm-sector .gjs-sm-list.gjs-clm-select input,.gjs-clm-tags .gjs-sm-list.gjs-clm-select input,.gjs-sm-sector .gjs-sm-list.gjs-clm-field input,.gjs-clm-tags .gjs-sm-list.gjs-clm-field input{display:none}.gjs-sm-sector .gjs-sm-field.gjs-sm-list label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field label{cursor:pointer;padding:5px;display:block}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label{background-color:rgba(255,255,255,.2)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-icon{background-repeat:no-repeat;background-position:center;text-shadow:none;line-height:normal}.gjs-sm-sector .gjs-sm-field.gjs-sm-integer select,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-select select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-select select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field select{width:auto;padding:0}.gjs-sm-sector .gjs-sm-list .gjs-sm-el,.gjs-clm-tags .gjs-sm-list .gjs-sm-el{float:left;border-left:1px solid rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:first-child,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:first-child{border:none}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:hover,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:hover{background:rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-slider .gjs-field-integer,.gjs-clm-tags .gjs-sm-slider .gjs-field-integer{flex:1 1 65px}.gjs-sm-sector .gjs-sm-property,.gjs-clm-tags .gjs-sm-property{box-sizing:border-box;float:left;width:50%;margin-bottom:5px;padding:0 5px}.gjs-sm-sector .gjs-sm-property--full,.gjs-clm-tags .gjs-sm-property--full,.gjs-sm-sector .gjs-sm-property.gjs-sm-composite,.gjs-clm-tags .gjs-sm-property.gjs-sm-composite,.gjs-sm-sector .gjs-sm-property.gjs-sm-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file,.gjs-sm-sector .gjs-sm-property.gjs-sm-list,.gjs-clm-tags .gjs-sm-property.gjs-sm-list,.gjs-sm-sector .gjs-sm-property.gjs-sm-stack,.gjs-clm-tags .gjs-sm-property.gjs-sm-stack,.gjs-sm-sector .gjs-sm-property.gjs-sm-slider,.gjs-clm-tags .gjs-sm-property.gjs-sm-slider,.gjs-sm-sector .gjs-sm-property.gjs-sm-color,.gjs-clm-tags .gjs-sm-property.gjs-sm-color{width:100%}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn{background-color:rgba(33,33,33,.2);border-radius:2px;box-shadow:1px 1px 0 rgba(5,5,5,.2),1px 1px 0 rgba(43,43,43,.2) inset;padding:5px;position:relative;text-align:center;height:auto;width:100%;cursor:pointer;color:#ddd;box-sizing:border-box;text-shadow:-1px -1px 0 rgba(0,0,0,.2);border:none;opacity:.85;filter:alpha(opacity=85)}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn-c,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn-c{box-sizing:border-box;float:left;width:100%}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box{background-color:rgba(255,255,255,.05);border-radius:2px;margin-top:5px;position:relative;overflow:hidden}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show{border:1px solid rgba(252,252,252,.05);padding:3px 20px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{top:-5px;display:block}.gjs-sm-sector .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file{height:50px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file{background-size:auto 100%;background-repeat:no-repeat;background-position:center center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layers,.gjs-clm-tags .gjs-sm-property .gjs-sm-layers{margin-top:5px;padding:1px 3px;min-height:30px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer{background-color:rgba(255,255,255,.055);border-radius:2px;margin:2px 0;padding:7px;position:relative}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer.gjs-sm-active,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer.gjs-sm-active{background-color:rgba(255,255,255,.12)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp{display:flex;align-items:center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-move,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-move{height:14px;width:14px;min-width:14px;cursor:grab}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-label,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-label{flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0 5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{height:15px;width:15px;min-width:15px;margin-right:5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview{background-color:#fff;height:100%;width:100%;background-size:cover !important}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{border-radius:2px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer{display:block;cursor:pointer;height:14px;width:14px;min-width:14px;opacity:.5;filter:alpha(opacity=50)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover{opacity:.8;filter:alpha(opacity=80)}.gjs-sm-sector #gjs-sm-text-shadow #gjs-sm-preview::after,.gjs-clm-tags #gjs-sm-text-shadow #gjs-sm-preview::after{color:#000;content:"T";font-weight:900;line-height:17px;padding:0 4px}.gjs-sm-sector .gjs-sm-stack .gjs-sm-properties,.gjs-clm-tags .gjs-sm-stack .gjs-sm-properties{padding:5px 0 0}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add{background:none;border:none;cursor:pointer;outline:none;position:absolute;right:0;top:-17px;opacity:.75;width:18px;height:18px}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add:hover,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add:hover{opacity:1;filter:alpha(opacity=100)}.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c{height:100%;width:20px;position:absolute;right:0;top:0;box-sizing:border-box;border-radius:2px;padding:2px}.gjs-sm-sector .gjs-sm-colorp-c .gjs-checker-bg,.gjs-clm-tags .gjs-sm-colorp-c .gjs-checker-bg,.gjs-sm-sector .gjs-sm-colorp-c .gjs-field-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-sm-sector .gjs-sm-color-picker,.gjs-clm-tags .gjs-sm-color-picker{background-color:#ddd;cursor:pointer;height:16px;width:100%;margin-top:-16px;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-upload,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-upload{left:0;top:0;position:absolute;width:100%;opacity:0;cursor:pointer}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-label,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-label{padding:2px 0}.gjs-sm-layer>#gjs-sm-move{opacity:.7;filter:alpha(opacity=70);cursor:move;font-size:12px;float:left;margin:0 5px 0 0}.gjs-sm-layer>#gjs-sm-move:hover{opacity:.9;filter:alpha(opacity=90)}.gjs-blocks-c{display:flex;flex-wrap:wrap;justify-content:flex-start}.gjs-block-categories{display:flex;flex-direction:column}.gjs-block-category{width:100%}.gjs-block-category .gjs-caret-icon{margin-right:5px}.gjs-block{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;width:45%;min-width:45px;padding:1em;box-sizing:border-box;min-height:90px;cursor:all-scroll;font-size:11px;font-weight:lighter;text-align:center;display:flex;flex-direction:column;justify-content:space-between;border:1px solid rgba(0,0,0,.2);border-radius:3px;margin:10px 2.5% 5px;box-shadow:0 1px 0 0 rgba(0,0,0,.15);transition:all .2s ease 0s;transition-property:box-shadow,color}.gjs-block:hover{box-shadow:0 3px 4px 0 rgba(0,0,0,.15)}.gjs-block svg{fill:currentColor}.gjs-block__media{margin-bottom:10px;pointer-events:none}.gjs-block-svg{width:54px;fill:currentColor}.gjs-block-svg-path{fill:currentColor}.gjs-block.fa{font-size:2em;line-height:2em;padding:11px}.gjs-block-label{line-height:normal;font-size:.65rem;font-weight:normal;font-family:Helvetica,sans-serif;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.gjs-block.gjs-bdrag{width:auto;padding:0}.gjs-selected-parent{border:1px solid #ffca6f}.gjs-opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-layer{font-weight:lighter;text-align:left;position:relative;background-color:rgba(0,0,0,.1);font-size:.75rem;display:grid}.gjs-layer-hidden{opacity:.55;filter:alpha(opacity=55)}.gjs-layer-count{position:absolute;right:27px;top:9px}.gjs-layer-vis{height:auto !important;width:auto !important;left:0;top:0;padding:7px 5px 7px 10px;position:absolute;cursor:pointer;z-index:1}.gjs-layer-caret{font-size:.5rem;width:8px;padding:2px;cursor:pointer;position:absolute;left:-9px;top:6px;opacity:.7;filter:alpha(opacity=70)}.gjs-layer-caret:hover{opacity:1;filter:alpha(opacity=100)}.gjs-layer-title{padding:3px 10px 5px 30px;display:flex;align-items:center}.gjs-layer-title-inn{align-items:center;position:relative;display:flex;width:100%}.gjs-layer__icon{display:block;width:100%;max-width:15px;max-height:15px;padding-left:5px}.gjs-layer__icon svg{fill:currentColor}.gjs-layer-name{padding:5px 0;display:inline-block;box-sizing:content-box;overflow:hidden;white-space:nowrap;margin:0 30px 0 5px}.gjs-layer-name--no-edit{text-overflow:ellipsis}.gjs-layer>.gjs-layer-children{display:none}.gjs-layer.open>.gjs-layer-children{display:block}.gjs-layer-no-chld>.gjs-layer-title-inn>.gjs-layer-caret{display:none}.gjs-layer-move{padding:7px 10px 7px 5px;position:absolute;font-size:12px;cursor:move;right:0;top:0}.gjs-layer.gjs-hovered .gjs-layer-title{background-color:rgba(255,255,255,.015)}.gjs-layer.gjs-selected .gjs-layer-title{background-color:rgba(255,255,255,.1)}.gjs-layers{position:relative;height:100%}.gjs-layers #gjs-placeholder{width:100%;position:absolute}.gjs-layers #gjs-placeholder #gjs-plh-int{height:100%;padding:1px}.gjs-layers #gjs-placeholder #gjs-plh-int.gjs-insert{background-color:#62c462}#gjs-clm-add-tag,.gjs-clm-tags-btn{background-color:rgba(255,255,255,.15);border-radius:2px;padding:3px;margin-right:3px;border:1px solid rgba(0,0,0,.15);width:24px;height:24px;box-sizing:border-box;cursor:pointer}.gjs-clm-tags-btn svg{fill:currentColor;display:block}.gjs-clm-header{display:flex;align-items:center;margin:7px 0}.gjs-clm-header-status{flex-shrink:1;margin-left:auto}.gjs-clm-tag{display:flex;overflow:hidden;align-items:center;border-radius:3px;margin:0 3px 3px 0;padding:5px;cursor:default}.gjs-clm-tag-status,.gjs-clm-tag-close{width:12px;height:12px;flex-shrink:1}.gjs-clm-tag-status svg,.gjs-clm-tag-close svg{vertical-align:middle;fill:currentColor}.gjs-clm-sels-info{margin:7px 0}.gjs-clm-sel-id{font-size:.9em;opacity:.5;filter:alpha(opacity=50)}.gjs-clm-label-sel{float:left;padding-right:5px}.gjs-clm-tags{font-size:.75rem;padding:10px 5px}.gjs-clm-tags #gjs-clm-sel{padding:7px 0;float:left}.gjs-clm-tags #gjs-clm-sel{font-style:italic;margin-left:5px}.gjs-clm-tags #gjs-clm-tags-field{clear:both;padding:5px;margin-bottom:5px;display:flex;flex-wrap:wrap}.gjs-clm-tags #gjs-clm-tags-c{display:flex;flex-wrap:wrap;vertical-align:top;overflow:hidden}.gjs-clm-tags #gjs-clm-new{color:#ddd;padding:5px 6px;display:none}.gjs-clm-tags #gjs-clm-close{opacity:.85;filter:alpha(opacity=85);font-size:20px;line-height:0;cursor:pointer;color:rgba(255,255,255,.9)}.gjs-clm-tags #gjs-clm-close:hover{opacity:1;filter:alpha(opacity=100)}.gjs-clm-tags #gjs-clm-checkbox{color:rgba(255,255,255,.9);vertical-align:middle;cursor:pointer;font-size:9px}.gjs-clm-tags #gjs-clm-tag-label{flex-grow:1;text-overflow:ellipsis;overflow:hidden;padding:0 3px;cursor:text}.gjs-mdl-container{font-family:Helvetica,sans-serif;overflow-y:auto;position:fixed;background-color:rgba(0,0,0,.5);display:flex;top:0;left:0;right:0;bottom:0;z-index:100}.gjs-mdl-dialog{text-shadow:-1px -1px 0 rgba(0,0,0,.05);animation:gjs-slide-down .215s;margin:auto;max-width:850px;width:90%;border-radius:3px;font-weight:lighter;position:relative;z-index:2}.gjs-mdl-title{font-size:1rem}.gjs-mdl-btn-close{position:absolute;right:15px;top:5px}.gjs-mdl-active .gjs-mdl-dialog{animation:gjs-mdl-slide-down .216s}.gjs-mdl-header,.gjs-mdl-content{padding:10px 15px;clear:both}.gjs-mdl-header{position:relative;border-bottom:1px solid rgba(0,0,0,.2);padding:15px 15px 7px}.gjs-export-dl::after{content:"";clear:both;display:block;margin-bottom:10px}.gjs-dropzone{display:none;opacity:0;position:absolute;top:0;left:0;z-index:11;width:100%;height:100%;transition:opacity .25s;pointer-events:none}.gjs-dropzone-active .gjs-dropzone{display:block;opacity:1}.gjs-am-assets{height:290px;overflow:auto;clear:both;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:flex-start}.gjs-am-assets-header{padding:5px}.gjs-am-add-asset .gjs-am-add-field{width:70%;float:left}.gjs-am-add-asset button{width:25%;float:right}.gjs-am-preview-cont{position:relative;height:70px;width:30%;background-color:#444;border-radius:2px;float:left;overflow:hidden}.gjs-am-preview{position:absolute;background-position:center center;background-size:cover;background-repeat:no-repeat;height:100%;width:100%;z-index:1}.gjs-am-preview-bg{opacity:.5;filter:alpha(opacity=50);position:absolute;height:100%;width:100%;z-index:0}.gjs-am-dimensions{opacity:.5;filter:alpha(opacity=50);font-size:10px}.gjs-am-meta{width:70%;float:left;font-size:12px;padding:5px 0 0 5px;box-sizing:border-box}.gjs-am-meta>div{margin-bottom:5px}.gjs-am-close{cursor:pointer;position:absolute;right:5px;top:0;display:none}.gjs-am-asset{border-bottom:1px solid rgba(0,0,0,.2);padding:5px;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.gjs-am-asset:hover .gjs-am-close{display:block}.gjs-am-highlight{background-color:rgba(255,255,255,.1)}.gjs-am-assets-cont{background-color:rgba(0,0,0,.1);border-radius:3px;box-sizing:border-box;padding:10px;width:45%;float:right;height:325px;overflow:hidden}.gjs-am-file-uploader{width:55%;float:left}.gjs-am-file-uploader>form{background-color:rgba(0,0,0,.1);border:2px dashed;border-radius:3px;position:relative;text-align:center;margin-bottom:15px}.gjs-am-file-uploader>form.gjs-am-hover{border:2px solid #62c462;color:#75cb75}.gjs-am-file-uploader>form.gjs-am-disabled{border-color:red}.gjs-am-file-uploader>form #gjs-am-uploadFile{opacity:0;filter:alpha(opacity=0);padding:150px 10px;width:100%;box-sizing:border-box}.gjs-am-file-uploader #gjs-am-title{position:absolute;padding:150px 10px;width:100%}.gjs-cm-editor-c{float:left;box-sizing:border-box;width:50%}.gjs-cm-editor-c .CodeMirror{height:450px}.gjs-cm-editor{font-size:12px}.gjs-cm-editor#gjs-cm-htmlmixed{padding-right:10px;border-right:1px solid rgba(0,0,0,.2)}.gjs-cm-editor#gjs-cm-htmlmixed #gjs-cm-title{color:#a97d44}.gjs-cm-editor#gjs-cm-css{padding-left:10px}.gjs-cm-editor#gjs-cm-css #gjs-cm-title{color:#ddca7e}.gjs-cm-editor #gjs-cm-title{background-color:rgba(0,0,0,.2);font-size:12px;padding:5px 10px 3px;text-align:right}.gjs-rte-toolbar{border:1px solid rgba(0,0,0,.2);position:absolute;border-radius:3px;z-index:10}.gjs-rte-actionbar{display:flex}.gjs-rte-action{display:flex;align-items:center;justify-content:center;padding:5px;min-width:25px;border-right:1px solid rgba(0,0,0,.2);text-align:center;cursor:pointer;outline:none}.gjs-rte-action:last-child{border-right:none}.gjs-rte-action:hover{background-color:rgba(255,255,255,.1)}.gjs-rte-active{background-color:rgba(255,255,255,.1)}.gjs-rte-disabled{color:rgba(255,255,255,.1);cursor:not-allowed}.gjs-rte-disabled:hover{background-color:unset}.gjs-editor-cont .sp-hue,.gjs-editor-cont .sp-slider{cursor:row-resize}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-dragger{cursor:crosshair}.gjs-editor-cont .sp-alpha-inner,.gjs-editor-cont .sp-alpha-handle{cursor:col-resize}.gjs-editor-cont .sp-hue{left:90%}.gjs-editor-cont .sp-color{right:15%}.gjs-editor-cont .sp-container{border:1px solid rgba(0,0,0,.2);box-shadow:0 0 7px rgba(0,0,0,.2);border-radius:3px}.gjs-editor-cont .sp-picker-container{border:none}.gjs-editor-cont .colpick_dark .colpick_color{outline:1px solid rgba(0,0,0,.2)}.gjs-editor-cont .sp-cancel,.gjs-editor-cont .sp-cancel:hover{bottom:-8px;color:#777 !important;font-size:25px;left:0;position:absolute;text-decoration:none}.gjs-editor-cont .sp-alpha-handle{background-color:#ccc;border:1px solid #555;width:4px}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-hue{border:1px solid #333}.gjs-editor-cont .sp-slider{background-color:#ccc;border:1px solid #555;height:3px;left:-4px;width:22px}.gjs-editor-cont .sp-dragger{background:transparent;box-shadow:0 0 0 1px #111}.gjs-editor-cont .sp-button-container{float:none;width:100%;position:relative;text-align:right}.gjs-editor-cont .sp-container button,.gjs-editor-cont .sp-container button:hover,.gjs-editor-cont .sp-container button:active{background:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2);color:#ddd;text-shadow:none;box-shadow:none;padding:3px 5px}.gjs-editor-cont .sp-palette-container{border:none;float:none;margin:0;padding:5px 10px 0}.gjs-editor-cont .sp-palette .sp-thumb-el,.gjs-editor-cont .sp-palette .sp-thumb-el:hover{border:1px solid rgba(0,0,0,.9)}.gjs-editor-cont .sp-palette .sp-thumb-el:hover,.gjs-editor-cont .sp-palette .sp-thumb-el.sp-thumb-active{border-color:rgba(0,0,0,.9)}.gjs-hidden{display:none}@keyframes gjs-slide-down{0%{transform:translate(0, -3rem);opacity:0}100%{transform:translate(0, 0);opacity:1}}@keyframes gjs-slide-up{0%{transform:translate(0, 0);opacity:1}100%{transform:translate(0, -3rem);opacity:0}}.cm-s-hopscotch span.cm-error{color:#fff} diff --git a/src/editor/config/config.js b/src/editor/config/config.js index 4101414e7..4b8b6ec39 100644 --- a/src/editor/config/config.js +++ b/src/editor/config/config.js @@ -170,6 +170,7 @@ export default { close: '', move: '', + plus: '', }, // Dom element diff --git a/src/style_manager/view/PropertyStackView.js b/src/style_manager/view/PropertyStackView.js index 19f3ac4dc..d44ee9b5f 100644 --- a/src/style_manager/view/PropertyStackView.js +++ b/src/style_manager/view/PropertyStackView.js @@ -12,10 +12,14 @@ export default PropertyCompositeView.extend({ }, templateInput() { - const { pfx } = this; + const { pfx, em } = this; + const icons = em?.getConfig('icons'); + const iconPlus = icons?.plus || '+'; return `
- +
`; diff --git a/src/styles/scss/_gjs_style_manager.scss b/src/styles/scss/_gjs_style_manager.scss index 9b6f3a5da..9f70f8cc6 100644 --- a/src/styles/scss/_gjs_style_manager.scss +++ b/src/styles/scss/_gjs_style_manager.scss @@ -411,12 +411,12 @@ border: none; cursor: pointer; outline: none; - font-size: 22px; - line-height: 10px; position: absolute; right: 0; top: -17px; opacity: 0.75; + width: 18px; + height: 18px; &:hover { @include opacity(1); From 100a76959dc60cce851fc1b4a53ab95eff82a0e1 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 15:13:32 +0100 Subject: [PATCH 221/313] Update property label close icon --- dist/css/grapes.min.css | 2 +- src/style_manager/view/PropertyView.js | 6 ++++-- src/styles/scss/_gjs_style_manager.scss | 8 +++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dist/css/grapes.min.css b/dist/css/grapes.min.css index b2edfcaad..446320405 100644 --- a/dist/css/grapes.min.css +++ b/dist/css/grapes.min.css @@ -1 +1 @@ -.sp-container{position:absolute;top:0;left:0;display:inline-block;*display:inline;*zoom:1;z-index:9999994;overflow:hidden}.sp-container.sp-flat{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{position:relative;width:100%;display:inline-block}.sp-top-inner{position:absolute;top:0;left:0;bottom:0;right:0}.sp-color{position:absolute;top:0;left:0;bottom:0;right:20%}.sp-hue{position:absolute;top:0;right:0;bottom:0;left:84%;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{position:absolute;top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{position:absolute;top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid black;background:white;opacity:.8}.sp-alpha{display:none;position:absolute;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:solid 1px #333}.sp-clear{display:none}.sp-clear.sp-clear-display{background-position:center}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0px;right:0;bottom:0;left:84%;height:28px}.sp-container,.sp-replacer,.sp-preview,.sp-dragger,.sp-slider,.sp-alpha,.sp-clear,.sp-alpha-handle,.sp-container.sp-dragging .sp-input,.sp-container button{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-input-disabled .sp-input-container{display:none}.sp-container.sp-buttons-disabled .sp-button-container{display:none}.sp-container.sp-palette-buttons-disabled .sp-palette-button-container{display:none}.sp-palette-only .sp-picker-container{display:none}.sp-palette-disabled .sp-palette-container{display:none}.sp-initial-disabled .sp-initial{display:none}.sp-sat{background-image:-webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:linear-gradient(to right, #fff, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr="#FFFFFFFF", endColorstr="#00CC9A81")}.sp-val{background-image:-webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:linear-gradient(to top, #000, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00CC9A81", endColorstr="#FF000000")}.sp-hue{background:-moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));background:-webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff0000", endColorstr="#ffff00")}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffff00", endColorstr="#00ff00")}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ff00", endColorstr="#00ffff")}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffff", endColorstr="#0000ff")}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0000ff", endColorstr="#ff00ff")}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff00ff", endColorstr="#ff0000")}.sp-hidden{display:none !important}.sp-cf:before,.sp-cf:after{content:"";display:table}.sp-cf:after{clear:both}.sp-cf{*zoom:1}@media(max-device-width: 480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;cursor:pointer;position:absolute;top:0;left:0}.sp-slider{position:absolute;top:0;cursor:pointer;height:3px;left:-1px;right:-1px;border:1px solid #000;background:white;opacity:.8}.sp-container{border-radius:0;background-color:#ececec;border:solid 1px #f0c49b;padding:0}.sp-container,.sp-container button,.sp-container input,.sp-color,.sp-hue,.sp-clear{font:normal 12px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-color,.sp-hue,.sp-clear{border:solid 1px #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container{width:100%}.sp-input{font-size:12px !important;border:1px inset;padding:4px 5px;margin:0;width:100%;background:transparent;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-picker-container,.sp-palette-container{float:left;position:relative;padding:10px;padding-bottom:300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:solid 1px #fff}.sp-palette-container{border-right:solid 1px #ccc}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;width:24px;height:15px;margin:3px;cursor:pointer;border:solid 2px transparent}.sp-palette .sp-thumb-el:hover,.sp-palette .sp-thumb-el.sp-thumb-active{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:solid 1px #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:center}.sp-palette-button-container,.sp-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;*zoom:1;*display:inline;border:solid 1px #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer:hover,.sp-replacer.sp-active{border-color:#f0c49b;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px}.sp-preview{position:relative;width:25px;height:20px;border:solid 1px #222;margin-right:5px;float:left;z-index:0}.sp-palette{*width:220px;max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:solid 1px #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top, #eeeeee, #cccccc);background-image:-moz-linear-gradient(top, #eeeeee, #cccccc);background-image:-ms-linear-gradient(top, #eeeeee, #cccccc);background-image:-o-linear-gradient(top, #eeeeee, #cccccc);background-image:linear-gradient(to bottom, #eeeeee, #cccccc);border:1px solid #ccc;border-bottom:1px solid #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top, #dddddd, #bbbbbb);background-image:-moz-linear-gradient(top, #dddddd, #bbbbbb);background-image:-ms-linear-gradient(top, #dddddd, #bbbbbb);background-image:-o-linear-gradient(top, #dddddd, #bbbbbb);background-image:linear-gradient(to bottom, #dddddd, #bbbbbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid #aaa;border-bottom:1px solid #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f !important;margin:0;padding:2px;margin-right:5px;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f !important;text-decoration:underline}.sp-palette span:hover,.sp-palette span.sp-thumb-active{border-color:#000}.sp-preview,.sp-alpha,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-preview-inner,.sp-alpha-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0t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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==)}.CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20, 255, 20, 0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:blue}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, 0.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, 0.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-hopscotch.CodeMirror{background:#322931;color:#d5d3d5}.cm-s-hopscotch div.CodeMirror-selected{background:#433b42 !important}.cm-s-hopscotch .CodeMirror-gutters{background:#322931;border-right:0px}.cm-s-hopscotch .CodeMirror-linenumber{color:#797379}.cm-s-hopscotch .CodeMirror-cursor{border-left:1px solid #989498 !important}.cm-s-hopscotch span.cm-comment{color:#b33508}.cm-s-hopscotch span.cm-atom{color:#c85e7c}.cm-s-hopscotch span.cm-number{color:#c85e7c}.cm-s-hopscotch span.cm-property,.cm-s-hopscotch span.cm-attribute{color:#8fc13e}.cm-s-hopscotch span.cm-keyword{color:#dd464c}.cm-s-hopscotch span.cm-string{color:#fdcc59}.cm-s-hopscotch span.cm-variable{color:#8fc13e}.cm-s-hopscotch span.cm-variable-2{color:#1290bf}.cm-s-hopscotch span.cm-def{color:#fd8b19}.cm-s-hopscotch span.cm-error{background:#dd464c;color:#989498}.cm-s-hopscotch span.cm-bracket{color:#d5d3d5}.cm-s-hopscotch span.cm-tag{color:#dd464c}.cm-s-hopscotch span.cm-link{color:#c85e7c}.cm-s-hopscotch .CodeMirror-matchingbracket{text-decoration:underline;color:white !important}.cm-s-hopscotch .CodeMirror-activeline-background{background:#302020}@font-face{font-family:"font3336";src:url("../fonts/main-fonts.eot?v=20");src:url("../fonts/main-fonts.woff?v=20") format("woff"),url("../fonts/main-fonts.ttf?v=20") format("truetype"),url("../fonts/main-fonts.svg?v=20") format("svg"),url("../fonts/main-fonts.eot?v=20") format("embedded-opentype");font-weight:normal;font-style:normal}.gjs-is__grab,.gjs-is__grab *{cursor:grab !important}.gjs-is__grabbing,.gjs-is__grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:grabbing !important}.gjs-one-bg{background-color:#444}.gjs-one-color{color:#444}.gjs-one-color-h:hover{color:#444}.gjs-two-bg{background-color:#ddd}.gjs-two-color{color:#ddd}.gjs-two-color-h:hover{color:#ddd}.gjs-three-bg{background-color:#804f7b}.gjs-three-color{color:#804f7b}.gjs-three-color-h:hover{color:#804f7b}.gjs-four-bg{background-color:#d278c9}.gjs-four-color{color:#d278c9}.gjs-four-color-h:hover{color:#d278c9}.gjs-danger-bg{background-color:#dd3636}.gjs-danger-color{color:#dd3636}.gjs-danger-color-h:hover{color:#dd3636}.gjs-bg-main,.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c,.gjs-off-prv{background-color:#444}.gjs-color-main,.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add,.gjs-off-prv{color:#ddd;fill:#ddd}.gjs-color-active{color:#f8f8f8;fill:#f8f8f8}.gjs-color-warn{color:#ffca6f;fill:#ffca6f}.gjs-color-hl{color:#71b7f1;fill:#71b7f1}.gjs-fonts::before{display:block;font:normal normal normal 14px font3336;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:5em}.gjs-f-b1::before{content:"Q"}.gjs-f-b2::before{content:"W"}.gjs-f-b3::before{content:"E"}.gjs-f-b37::before{content:"R"}.gjs-f-hero::before{content:"T"}.gjs-f-h1p::before{content:"y"}.gjs-f-3ba::before{content:"u"}.gjs-f-image::before{content:"I"}.gjs-f-text::before{content:"o"}.gjs-f-quo::before{content:"p"}.gjs-f-button::before{content:"B"}.gjs-f-divider::before{content:"D"}.gjs-invis-invis,.gjs-clm-tags #gjs-clm-new,.gjs-no-app{background-color:transparent;border:none;color:inherit}.gjs-no-app{height:10px}.gjs-test::btn{color:"#fff"}.opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-checker-bg,.gjs-field-colorp-c,.checker-bg,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==")}.gjs-no-user-select,.gjs-rte-toolbar,.gjs-layer-name,.gjs-grabbing,.gjs-grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-pointer-events,.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el,.gjs-resizer-c{pointer-events:none}.gjs-bdrag{pointer-events:none !important;position:absolute !important;z-index:10 !important;width:auto}.gjs-drag-helper{background-color:#3b97e3 !important;pointer-events:none !important;position:absolute !important;z-index:10 !important;transform:scale(0.3) !important;transform-origin:top left !important;-webkit-transform-origin:top left !important;margin:15px !important;transition:none !important;outline:none !important}.gjs-grabbing,.gjs-grabbing *{cursor:grabbing !important;cursor:-webkit-grabbing !important}.gjs-grabbing{overflow:hidden}.gjs-off-prv{position:relative;z-index:10;padding:5px;cursor:pointer}.gjs-editor-cont ::-webkit-scrollbar-track{background:rgba(0,0,0,.1)}.gjs-editor-cont ::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.2)}.gjs-editor-cont ::-webkit-scrollbar{width:8px}.clear{clear:both}.no-select,.gjs-clm-tags #gjs-clm-close,.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title,.gjs-com-no-select,.gjs-com-no-select img{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-touch-actions{touch-action:none}.gjs-disabled{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;opacity:.5;filter:alpha(opacity=50)}.gjs-editor{font-family:Helvetica,sans-serif;font-size:.75rem;position:relative;box-sizing:border-box;height:100%}.gjs-freezed,.gjs-freezed{opacity:.5;filter:alpha(opacity=50);pointer-events:none}.gjs-traits-label{border-bottom:1px solid rgba(0,0,0,.2);font-weight:lighter;margin-bottom:5px;padding:10px;text-align:left}.gjs-label-wrp{width:30%;min-width:30%}.gjs-field-wrp{flex-grow:1}.gjs-trt-header{font-weight:lighter;padding:10px}.gjs-trt-trait{display:flex;justify-content:flex-start;padding:5px 10px;font-weight:lighter;align-items:center;text-align:left}.gjs-trt-traits{font-size:.75rem}.gjs-trt-trait .gjs-label{text-align:left;text-overflow:ellipsis;overflow:hidden}.gjs-guide-info{position:absolute}.gjs-guide-info__content{position:absolute;height:100%;display:flex;width:100%;padding:5px}.gjs-guide-info__line{position:relative;margin:auto}.gjs-guide-info__line::before,.gjs-guide-info__line::after{content:"";display:block;position:absolute;background-color:inherit}.gjs-guide-info__y{padding:0 5px}.gjs-guide-info__y .gjs-guide-info__content{justify-content:center}.gjs-guide-info__y .gjs-guide-info__line{width:100%;height:1px}.gjs-guide-info__y .gjs-guide-info__line::before,.gjs-guide-info__y .gjs-guide-info__line::after{width:1px;height:10px;top:0;bottom:0;left:0;margin:auto}.gjs-guide-info__y .gjs-guide-info__line::after{left:auto;right:0}.gjs-guide-info__x{padding:5px 0}.gjs-guide-info__x .gjs-guide-info__content{align-items:center}.gjs-guide-info__x .gjs-guide-info__line{height:100%;width:1px}.gjs-guide-info__x .gjs-guide-info__line::before,.gjs-guide-info__x .gjs-guide-info__line::after{width:10px;height:1px;left:0;right:0;top:0;margin:auto;transform:translateX(-50%)}.gjs-guide-info__x .gjs-guide-info__line::after{top:auto;bottom:0}.gjs-badge{white-space:nowrap}.gjs-badge__icon{vertical-align:middle;display:inline-block;width:15px;height:15px}.gjs-badge__icon svg{fill:currentColor}.gjs-badge__name{display:inline-block;vertical-align:middle}.gjs-frame-wrapper{position:absolute;width:100%;height:100%;left:0;right:0;margin:auto}.gjs-frame-wrapper--anim{transition:width .35s ease,height .35s ease}.gjs-frame-wrapper__top{transform:translateY(-100%) translateX(-50%);display:flex;padding:5px 0;position:absolute;width:100%;left:50%;top:0}.gjs-frame-wrapper__top-r{margin-left:auto}.gjs-frame-wrapper__left{position:absolute;left:0;transform:translateX(-100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__bottom{position:absolute;bottom:0;transform:translateY(100%) translateX(-50%);width:100%;left:50%}.gjs-frame-wrapper__right{position:absolute;right:0;transform:translateX(100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__icon{width:24px;cursor:pointer}.gjs-frame-wrapper__icon>svg{fill:currentColor}.gjs-padding-v-top,.gjs-fixedpadding-v-top{width:100%;top:0;left:0}.gjs-padding-v-right,.gjs-fixedpadding-v-right{right:0}.gjs-padding-v-bottom,.gjs-fixedpadding-v-bottom{width:100%;left:0;bottom:0}.gjs-padding-v-left,.gjs-fixedpadding-v-left{left:0}.gjs-cv-canvas{background-color:rgba(0,0,0,.15);box-sizing:border-box;width:85%;height:calc(100% - 40px);bottom:0;overflow:hidden;z-index:1;position:absolute;left:0;top:40px}.gjs-cv-canvas.gjs-cui{width:100%;height:100%;top:0}.gjs-cv-canvas.gjs-is__grab .gjs-cv-canvas__frames,.gjs-cv-canvas.gjs-is__grabbing .gjs-cv-canvas__frames{pointer-events:none}.gjs-cv-canvas__frames{position:absolute;top:0;left:0;width:100%;height:100%}.gjs-cv-canvas .gjs-ghost{display:none;pointer-events:none;background-color:#5b5b5b;border:2px dashed #ccc;position:absolute;z-index:10;opacity:.55;filter:alpha(opacity=55)}.gjs-cv-canvas .gjs-highlighter,.gjs-cv-canvas .gjs-highlighter-sel{position:absolute;outline:1px solid #3b97e3;outline-offset:-1px;pointer-events:none;width:100%;height:100%}.gjs-cv-canvas .gjs-highlighter-warning{outline:3px solid #ffca6f}.gjs-cv-canvas .gjs-highlighter-sel{outline:2px solid #3b97e3;outline-offset:-2px}.gjs-cv-canvas #gjs-tools,.gjs-cv-canvas .gjs-tools{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;z-index:1}.gjs-cv-canvas *{box-sizing:border-box}.gjs-frame{outline:medium none;height:100%;width:100%;border:none;margin:auto;display:block;transition:width .35s ease,height .35s ease;position:absolute;top:0;bottom:0;left:0;right:0}.gjs-toolbar{position:absolute;background-color:#3b97e3;white-space:nowrap;color:#fff;z-index:10;top:0;left:0}.gjs-toolbar-item{padding:5px 7px;font-size:.8rem;cursor:pointer;width:26px;vertical-align:middle;display:inline-block}.gjs-toolbar-item svg{fill:currentColor;vertical-align:middle}.gjs-resizer-c{position:absolute;left:0;top:0;width:100%;height:100%;z-index:9}.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.1;filter:alpha(opacity=10);position:absolute;background-color:#ff0}.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.2;filter:alpha(opacity=20)}.gjs-padding-v-el,.gjs-fixedpadding-v-el{background-color:navy}.gjs-resizer-h{pointer-events:all;position:absolute;border:3px solid #3b97e3;width:10px;height:10px;background-color:#fff;margin:-5px}.gjs-resizer-h-tl{top:0;left:0;cursor:nwse-resize}.gjs-resizer-h-tr{top:0;right:0;cursor:nesw-resize}.gjs-resizer-h-tc{top:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-cl{left:0;margin:auto -5px;top:0;bottom:0;cursor:ew-resize}.gjs-resizer-h-cr{margin:auto -5px;top:0;bottom:0;right:0;cursor:ew-resize}.gjs-resizer-h-bl{bottom:0;left:0;cursor:nesw-resize}.gjs-resizer-h-bc{bottom:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-br{bottom:0;right:0;cursor:nwse-resize}.gjs-pn-panel .gjs-resizer-h{background-color:rgba(0,0,0,.2);border:none;opacity:0;transition:opacity .25s}.gjs-pn-panel .gjs-resizer-h:hover{opacity:1}.gjs-pn-panel .gjs-resizer-h-tc,.gjs-pn-panel .gjs-resizer-h-bc{margin:0 auto;width:100%}.gjs-pn-panel .gjs-resizer-h-cr,.gjs-pn-panel .gjs-resizer-h-cl{margin:auto 0;height:100%}.gjs-resizing .gjs-highlighter,.gjs-resizing .gjs-badge{display:none !important}.gjs-resizing-tl *{cursor:nwse-resize !important}.gjs-resizing-tr *{cursor:nesw-resize !important}.gjs-resizing-tc *{cursor:ns-resize !important}.gjs-resizing-cl *{cursor:ew-resize !important}.gjs-resizing-cr *{cursor:ew-resize !important}.gjs-resizing-bl *{cursor:nesw-resize !important}.gjs-resizing-bc *{cursor:ns-resize !important}.gjs-resizing-br *{cursor:nwse-resize !important}.btn-cl,.gjs-am-close,.gjs-mdl-btn-close{opacity:.3;filter:alpha(opacity=30);font-size:25px;cursor:pointer}.btn-cl:hover,.gjs-am-close:hover,.gjs-mdl-btn-close:hover{opacity:.7;filter:alpha(opacity=70)}.no-dots,.ui-resizable-handle{border:none !important;margin:0 !important;outline:none !important}.gjs-com-dashed *{outline:1px dashed #888;outline-offset:-2px;box-sizing:border-box}.gjs-cv-canvas .gjs-comp-selected{outline:3px solid #3b97e3 !important}*.gjs-com-hover,div.gjs-com-hover{outline:1px solid #3b97e3}*.gjs-com-hover-delete,div.gjs-com-hover-delete{outline:2px solid #dd3636;opacity:.5;filter:alpha(opacity=50)}*.gjs-com-hover-move,div.gjs-com-hover-move{outline:3px solid #ffca6f}.gjs-com-badge,.gjs-com-badge-red,.gjs-badge{pointer-events:none;background-color:#3b97e3;color:#fff;padding:2px 5px;position:absolute;z-index:1;font-size:12px;outline:none;display:none}.gjs-com-badge-red{background-color:#dd3636}.gjs-badge-warning{background-color:#ffca6f}.gjs-placeholder,.gjs-com-placeholder,.gjs-placeholder{position:absolute;z-index:10;pointer-events:none;display:none}.gjs-placeholder,.gjs-placeholder{border-style:solid !important;outline:none;box-sizing:border-box;transition:top .2s,left .2s,width .2s,height .2s}.gjs-placeholder.horizontal,.gjs-com-placeholder.horizontal,.gjs-placeholder.horizontal{border-color:transparent #62c462;border-width:3px 5px;margin:-3px 0 0}.gjs-placeholder.vertical,.gjs-com-placeholder.vertical,.gjs-placeholder.vertical{border-color:#62c462 transparent;border-width:5px 3px;margin:0 0 0 -3px}.gjs-placeholder-int,.gjs-com-placeholder-int,.gjs-placeholder-int{background-color:#62c462;box-shadow:0 0 3px rgba(0,0,0,.2);height:100%;width:100%;pointer-events:none;padding:1.5px;outline:none}.gjs-pn-panel{display:inline-block;position:absolute;box-sizing:border-box;text-align:center;padding:5px;z-index:3}.gjs-pn-panel .icon-undo,.gjs-pn-panel .icon-redo{font-size:20px;height:30px;width:25px}.gjs-pn-commands{width:85%;left:0;top:0;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-options{right:15%;top:0}.gjs-pn-views{border-bottom:2px solid rgba(0,0,0,.2);right:0;width:15%;z-index:4}.gjs-pn-views-container{height:100%;padding:42px 0 0;right:0;width:15%;overflow:auto;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-buttons{align-items:center;display:flex;justify-content:space-between}.gjs-pn-btn{box-sizing:border-box;min-height:30px;min-width:30px;line-height:21px;background-color:transparent;border:none;font-size:18px;margin-right:5px;border-radius:2px;padding:4px;position:relative;cursor:pointer}.gjs-pn-btn.gjs-pn-active{background-color:rgba(0,0,0,.15);box-shadow:0 0 3px rgba(0,0,0,.25) inset}.gjs-pn-btn svg{fill:currentColor}.gjs-comp-image-placeholder{display:block;background-color:#f5f5f5;color:#777;height:50px;width:50px;line-height:50px;outline:3px solid #ffca6f;outline-offset:-3px;text-align:center;font-size:16.6666666667px;cursor:pointer}.gjs-comp-image-placeholder.fa-picture-o::after{content:""}.gjs-label{line-height:18px}.gjs-fields{display:flex}.gjs-select{padding:0;width:100%}.gjs-select select{padding-right:10px}.gjs-select:-moz-focusring,.gjs-select select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-input:focus,.gjs-button:focus,.gjs-btn-prim:focus,.gjs-select:focus,.gjs-select select:focus{outline:none}.gjs-field input,.gjs-field select,.gjs-field textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:inherit;border:none;background-color:transparent;box-sizing:border-box;width:100%;position:relative;padding:5px;z-index:1}.gjs-field input:focus,.gjs-field select:focus,.gjs-field textarea:focus{outline:none}.gjs-field input[type=number]{-moz-appearance:textfield}.gjs-field input[type=number]::-webkit-outer-spin-button,.gjs-field input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gjs-field-range{flex:9 1 auto}.gjs-field-integer input{padding-right:30px}.gjs-select option,.gjs-field-select option,.gjs-clm-select option,.gjs-sm-select option,.gjs-fields option,.gjs-sm-unit option{background-color:#444;color:#ddd}.gjs-field{background-color:rgba(0,0,0,.2);border:none;box-shadow:none;border-radius:2px;box-sizing:border-box;padding:0;position:relative}.gjs-field textarea{resize:vertical}.gjs-field .gjs-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;z-index:0}.gjs-field .gjs-d-s-arrow{bottom:0;top:0;margin:auto;right:5px;border-top:4px solid rgba(255,255,255,.7);position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-field-arrows{position:absolute;cursor:ns-resize;margin:auto;height:20px;width:9px;z-index:10;bottom:0;right:3px;top:0}.gjs-field-color,.gjs-field-radio{width:100%}.gjs-field-color input{padding-right:22px;box-sizing:border-box}.gjs-field-colorp{border-left:1px solid rgba(0,0,0,.2);box-sizing:border-box;height:100%;padding:2px;position:absolute;right:0;top:0;width:22px;z-index:10}.gjs-field-colorp .gjs-checker-bg,.gjs-field-colorp .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-field-colorp-c{height:100%;position:relative;width:100%}.gjs-field-color-picker{background-color:#ddd;cursor:pointer;height:100%;width:100%;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px;position:absolute;top:0}.gjs-field-checkbox{padding:0;width:17px;height:17px;display:block;cursor:pointer}.gjs-field-checkbox input{display:none}.gjs-field-checkbox input:checked+.gjs-chk-icon{border-color:rgba(255,255,255,.5);border-width:0 2px 2px 0;border-style:solid}.gjs-radio-item{flex:1 1 auto;text-align:center;border-left:1px solid rgba(0,0,0,.2)}.gjs-radio-item:first-child{border:none}.gjs-radio-item:hover{background:rgba(0,0,0,.2)}.gjs-radio-item input{display:none}.gjs-radio-item input:checked+.gjs-radio-item-label{background-color:rgba(255,255,255,.2)}.gjs-radio-items{display:flex}.gjs-radio-item-label{cursor:pointer;display:block;padding:5px}.gjs-field-units{position:absolute;margin:auto;right:10px;bottom:0;top:0}.gjs-field-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-field-arrow-u,.gjs-field-arrow-d{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(255,255,255,.7);bottom:4px;cursor:pointer}.gjs-field-arrow-u{border-bottom:4px solid rgba(255,255,255,.7);border-top:none;top:4px}.gjs-field-select{padding:0}.gjs-field-range{background-color:transparent;border:none;box-shadow:none;padding:0}.gjs-field-range input{margin:0;height:100%}.gjs-field-range input:focus{outline:none}.gjs-field-range input::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-ms-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-webkit-slider-runnable-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-ms-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-btn-prim{color:inherit;background-color:rgba(255,255,255,.1);border-radius:2px;padding:3px 6px;padding:5px;cursor:pointer;border:none}.gjs-btn-prim:active{background-color:rgba(255,255,255,.1)}.gjs-btn--full{width:100%}.gjs-chk-icon{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);box-sizing:border-box;display:block;height:14px;margin:0 5px;width:6px}.gjs-add-trasp{background:none;border:none;color:#ddd;cursor:pointer;font-size:1em;border-radius:2px;opacity:.75;filter:alpha(opacity=75)}.gjs-add-trasp:hover{opacity:1;filter:alpha(opacity=100)}.gjs-add-trasp:active{background-color:rgba(0,0,0,.2)}.gjs-devices-c{display:flex;align-items:center;padding:3px}.gjs-devices-c .gjs-device-label{flex-grow:2;text-align:left;margin-right:10px}.gjs-devices-c .gjs-select{flex-grow:20}.gjs-devices-c .gjs-add-trasp{flex-grow:1;margin-left:5px}.gjs-category-open,.gjs-block-category.gjs-open,.gjs-sm-sector.gjs-sm-open,.gjs-sm-open.gjs-clm-tags{border-bottom:1px solid rgba(0,0,0,.25)}.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title{font-weight:lighter;background-color:rgba(0,0,0,.1);letter-spacing:1px;padding:9px 10px 9px 20px;border-bottom:1px solid rgba(0,0,0,.25);text-align:left;position:relative;cursor:pointer}.gjs-sm-clear{line-height:0;cursor:pointer}.gjs-sm-header{font-weight:lighter;padding:10px}.gjs-sm-properties{font-size:.75rem;padding:10px 5px;display:flex;flex-wrap:wrap;align-items:flex-end;box-sizing:border-box;width:100%}.gjs-sm-label{margin:5px 5px 3px 0}.gjs-sm-close-btn,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.2;filter:alpha(opacity=20)}.gjs-sm-close-btn:hover,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover{opacity:.7;filter:alpha(opacity=70)}.gjs-sm-sector,.gjs-clm-tags{clear:both;font-weight:lighter;text-align:left}.gjs-sm-sector #gjs-sm-caret,.gjs-clm-tags #gjs-sm-caret{padding-right:5px;font-size:11px}.gjs-sm-sector .gjs-sm-field,.gjs-clm-tags .gjs-sm-field,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-clm-field,.gjs-clm-tags .gjs-clm-field{width:100%;position:relative}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input,.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{background-color:transparent;color:rgba(255,255,255,.7);border:none;width:100%}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input{box-sizing:border-box}.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gjs-sm-sector .gjs-sm-field select::-ms-expand,.gjs-clm-tags .gjs-sm-field select::-ms-expand,.gjs-sm-sector .gjs-clm-select select::-ms-expand,.gjs-clm-tags .gjs-clm-select select::-ms-expand,.gjs-sm-sector .gjs-clm-field select::-ms-expand,.gjs-clm-tags .gjs-clm-field select::-ms-expand{display:none}.gjs-sm-sector .gjs-sm-field select:-moz-focusring,.gjs-clm-tags .gjs-sm-field select:-moz-focusring,.gjs-sm-sector .gjs-clm-select select:-moz-focusring,.gjs-clm-tags .gjs-clm-select select:-moz-focusring,.gjs-sm-sector .gjs-clm-field select:-moz-focusring,.gjs-clm-tags .gjs-clm-field select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-sm-sector .gjs-sm-field input:focus,.gjs-clm-tags .gjs-sm-field input:focus,.gjs-sm-sector .gjs-clm-select input:focus,.gjs-clm-tags .gjs-clm-select input:focus,.gjs-sm-sector .gjs-clm-field input:focus,.gjs-clm-tags .gjs-clm-field input:focus,.gjs-sm-sector .gjs-sm-field select:focus,.gjs-clm-tags .gjs-sm-field select:focus,.gjs-sm-sector .gjs-clm-select select:focus,.gjs-clm-tags .gjs-clm-select select:focus,.gjs-sm-sector .gjs-clm-field select:focus,.gjs-clm-tags .gjs-clm-field select:focus{outline:none}.gjs-sm-sector .gjs-sm-field .gjs-sm-unit,.gjs-clm-tags .gjs-sm-field .gjs-sm-unit,.gjs-sm-sector .gjs-clm-select .gjs-sm-unit,.gjs-clm-tags .gjs-clm-select .gjs-sm-unit,.gjs-sm-sector .gjs-clm-field .gjs-sm-unit,.gjs-clm-tags .gjs-clm-field .gjs-sm-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-sm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-select .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-select .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;cursor:ns-resize}.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{border-bottom:4px solid rgba(255,255,255,.7);top:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{border-top:4px solid rgba(255,255,255,.7);bottom:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{bottom:7px}.gjs-sm-sector .gjs-sm-field.gjs-sm-color,.gjs-clm-tags .gjs-sm-field.gjs-sm-color,.gjs-sm-sector .gjs-sm-color.gjs-clm-field,.gjs-clm-tags .gjs-sm-color.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-input,.gjs-clm-tags .gjs-sm-field.gjs-sm-input,.gjs-sm-sector .gjs-sm-input.gjs-clm-field,.gjs-clm-tags .gjs-sm-input.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-integer,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{background-color:rgba(0,0,0,.2);border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 0 rgba(255,255,255,.1);color:rgba(255,255,255,.7);border-radius:2px;box-sizing:border-box;padding:0 5px}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{border-radius:2px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{padding:0}.gjs-sm-sector .gjs-sm-field.gjs-sm-select select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field select,.gjs-clm-tags .gjs-sm-select.gjs-clm-field select{height:20px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select option,.gjs-clm-tags .gjs-sm-field.gjs-sm-select option,.gjs-sm-sector .gjs-clm-select option,.gjs-clm-tags .gjs-clm-select option,.gjs-sm-sector .gjs-sm-select.gjs-clm-field option,.gjs-clm-tags .gjs-sm-select.gjs-clm-field option{padding:3px 0}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{background-color:rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.25)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-select,.gjs-clm-tags .gjs-sm-list.gjs-clm-select,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field{width:auto;padding:0;overflow:hidden;float:left}.gjs-sm-sector .gjs-sm-field.gjs-sm-list input,.gjs-clm-tags .gjs-sm-field.gjs-sm-list input,.gjs-sm-sector .gjs-sm-list.gjs-clm-select input,.gjs-clm-tags .gjs-sm-list.gjs-clm-select input,.gjs-sm-sector .gjs-sm-list.gjs-clm-field input,.gjs-clm-tags .gjs-sm-list.gjs-clm-field input{display:none}.gjs-sm-sector .gjs-sm-field.gjs-sm-list label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field label{cursor:pointer;padding:5px;display:block}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label{background-color:rgba(255,255,255,.2)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-icon{background-repeat:no-repeat;background-position:center;text-shadow:none;line-height:normal}.gjs-sm-sector .gjs-sm-field.gjs-sm-integer select,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-select select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-select select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field select{width:auto;padding:0}.gjs-sm-sector .gjs-sm-list .gjs-sm-el,.gjs-clm-tags .gjs-sm-list .gjs-sm-el{float:left;border-left:1px solid rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:first-child,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:first-child{border:none}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:hover,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:hover{background:rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-slider .gjs-field-integer,.gjs-clm-tags .gjs-sm-slider .gjs-field-integer{flex:1 1 65px}.gjs-sm-sector .gjs-sm-property,.gjs-clm-tags .gjs-sm-property{box-sizing:border-box;float:left;width:50%;margin-bottom:5px;padding:0 5px}.gjs-sm-sector .gjs-sm-property--full,.gjs-clm-tags .gjs-sm-property--full,.gjs-sm-sector .gjs-sm-property.gjs-sm-composite,.gjs-clm-tags .gjs-sm-property.gjs-sm-composite,.gjs-sm-sector .gjs-sm-property.gjs-sm-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file,.gjs-sm-sector .gjs-sm-property.gjs-sm-list,.gjs-clm-tags .gjs-sm-property.gjs-sm-list,.gjs-sm-sector .gjs-sm-property.gjs-sm-stack,.gjs-clm-tags .gjs-sm-property.gjs-sm-stack,.gjs-sm-sector .gjs-sm-property.gjs-sm-slider,.gjs-clm-tags .gjs-sm-property.gjs-sm-slider,.gjs-sm-sector .gjs-sm-property.gjs-sm-color,.gjs-clm-tags .gjs-sm-property.gjs-sm-color{width:100%}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn{background-color:rgba(33,33,33,.2);border-radius:2px;box-shadow:1px 1px 0 rgba(5,5,5,.2),1px 1px 0 rgba(43,43,43,.2) inset;padding:5px;position:relative;text-align:center;height:auto;width:100%;cursor:pointer;color:#ddd;box-sizing:border-box;text-shadow:-1px -1px 0 rgba(0,0,0,.2);border:none;opacity:.85;filter:alpha(opacity=85)}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn-c,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn-c{box-sizing:border-box;float:left;width:100%}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box{background-color:rgba(255,255,255,.05);border-radius:2px;margin-top:5px;position:relative;overflow:hidden}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show{border:1px solid rgba(252,252,252,.05);padding:3px 20px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{top:-5px;display:block}.gjs-sm-sector .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file{height:50px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file{background-size:auto 100%;background-repeat:no-repeat;background-position:center center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layers,.gjs-clm-tags .gjs-sm-property .gjs-sm-layers{margin-top:5px;padding:1px 3px;min-height:30px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer{background-color:rgba(255,255,255,.055);border-radius:2px;margin:2px 0;padding:7px;position:relative}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer.gjs-sm-active,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer.gjs-sm-active{background-color:rgba(255,255,255,.12)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp{display:flex;align-items:center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-move,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-move{height:14px;width:14px;min-width:14px;cursor:grab}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-label,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-label{flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0 5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{height:15px;width:15px;min-width:15px;margin-right:5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview{background-color:#fff;height:100%;width:100%;background-size:cover !important}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{border-radius:2px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer{display:block;cursor:pointer;height:14px;width:14px;min-width:14px;opacity:.5;filter:alpha(opacity=50)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover{opacity:.8;filter:alpha(opacity=80)}.gjs-sm-sector #gjs-sm-text-shadow #gjs-sm-preview::after,.gjs-clm-tags #gjs-sm-text-shadow #gjs-sm-preview::after{color:#000;content:"T";font-weight:900;line-height:17px;padding:0 4px}.gjs-sm-sector .gjs-sm-stack .gjs-sm-properties,.gjs-clm-tags .gjs-sm-stack .gjs-sm-properties{padding:5px 0 0}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add{background:none;border:none;cursor:pointer;outline:none;position:absolute;right:0;top:-17px;opacity:.75;width:18px;height:18px}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add:hover,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add:hover{opacity:1;filter:alpha(opacity=100)}.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c{height:100%;width:20px;position:absolute;right:0;top:0;box-sizing:border-box;border-radius:2px;padding:2px}.gjs-sm-sector .gjs-sm-colorp-c .gjs-checker-bg,.gjs-clm-tags .gjs-sm-colorp-c .gjs-checker-bg,.gjs-sm-sector .gjs-sm-colorp-c .gjs-field-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-sm-sector .gjs-sm-color-picker,.gjs-clm-tags .gjs-sm-color-picker{background-color:#ddd;cursor:pointer;height:16px;width:100%;margin-top:-16px;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-upload,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-upload{left:0;top:0;position:absolute;width:100%;opacity:0;cursor:pointer}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-label,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-label{padding:2px 0}.gjs-sm-layer>#gjs-sm-move{opacity:.7;filter:alpha(opacity=70);cursor:move;font-size:12px;float:left;margin:0 5px 0 0}.gjs-sm-layer>#gjs-sm-move:hover{opacity:.9;filter:alpha(opacity=90)}.gjs-blocks-c{display:flex;flex-wrap:wrap;justify-content:flex-start}.gjs-block-categories{display:flex;flex-direction:column}.gjs-block-category{width:100%}.gjs-block-category .gjs-caret-icon{margin-right:5px}.gjs-block{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;width:45%;min-width:45px;padding:1em;box-sizing:border-box;min-height:90px;cursor:all-scroll;font-size:11px;font-weight:lighter;text-align:center;display:flex;flex-direction:column;justify-content:space-between;border:1px solid rgba(0,0,0,.2);border-radius:3px;margin:10px 2.5% 5px;box-shadow:0 1px 0 0 rgba(0,0,0,.15);transition:all .2s ease 0s;transition-property:box-shadow,color}.gjs-block:hover{box-shadow:0 3px 4px 0 rgba(0,0,0,.15)}.gjs-block svg{fill:currentColor}.gjs-block__media{margin-bottom:10px;pointer-events:none}.gjs-block-svg{width:54px;fill:currentColor}.gjs-block-svg-path{fill:currentColor}.gjs-block.fa{font-size:2em;line-height:2em;padding:11px}.gjs-block-label{line-height:normal;font-size:.65rem;font-weight:normal;font-family:Helvetica,sans-serif;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.gjs-block.gjs-bdrag{width:auto;padding:0}.gjs-selected-parent{border:1px solid #ffca6f}.gjs-opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-layer{font-weight:lighter;text-align:left;position:relative;background-color:rgba(0,0,0,.1);font-size:.75rem;display:grid}.gjs-layer-hidden{opacity:.55;filter:alpha(opacity=55)}.gjs-layer-count{position:absolute;right:27px;top:9px}.gjs-layer-vis{height:auto !important;width:auto !important;left:0;top:0;padding:7px 5px 7px 10px;position:absolute;cursor:pointer;z-index:1}.gjs-layer-caret{font-size:.5rem;width:8px;padding:2px;cursor:pointer;position:absolute;left:-9px;top:6px;opacity:.7;filter:alpha(opacity=70)}.gjs-layer-caret:hover{opacity:1;filter:alpha(opacity=100)}.gjs-layer-title{padding:3px 10px 5px 30px;display:flex;align-items:center}.gjs-layer-title-inn{align-items:center;position:relative;display:flex;width:100%}.gjs-layer__icon{display:block;width:100%;max-width:15px;max-height:15px;padding-left:5px}.gjs-layer__icon svg{fill:currentColor}.gjs-layer-name{padding:5px 0;display:inline-block;box-sizing:content-box;overflow:hidden;white-space:nowrap;margin:0 30px 0 5px}.gjs-layer-name--no-edit{text-overflow:ellipsis}.gjs-layer>.gjs-layer-children{display:none}.gjs-layer.open>.gjs-layer-children{display:block}.gjs-layer-no-chld>.gjs-layer-title-inn>.gjs-layer-caret{display:none}.gjs-layer-move{padding:7px 10px 7px 5px;position:absolute;font-size:12px;cursor:move;right:0;top:0}.gjs-layer.gjs-hovered .gjs-layer-title{background-color:rgba(255,255,255,.015)}.gjs-layer.gjs-selected .gjs-layer-title{background-color:rgba(255,255,255,.1)}.gjs-layers{position:relative;height:100%}.gjs-layers #gjs-placeholder{width:100%;position:absolute}.gjs-layers #gjs-placeholder #gjs-plh-int{height:100%;padding:1px}.gjs-layers #gjs-placeholder #gjs-plh-int.gjs-insert{background-color:#62c462}#gjs-clm-add-tag,.gjs-clm-tags-btn{background-color:rgba(255,255,255,.15);border-radius:2px;padding:3px;margin-right:3px;border:1px solid rgba(0,0,0,.15);width:24px;height:24px;box-sizing:border-box;cursor:pointer}.gjs-clm-tags-btn svg{fill:currentColor;display:block}.gjs-clm-header{display:flex;align-items:center;margin:7px 0}.gjs-clm-header-status{flex-shrink:1;margin-left:auto}.gjs-clm-tag{display:flex;overflow:hidden;align-items:center;border-radius:3px;margin:0 3px 3px 0;padding:5px;cursor:default}.gjs-clm-tag-status,.gjs-clm-tag-close{width:12px;height:12px;flex-shrink:1}.gjs-clm-tag-status svg,.gjs-clm-tag-close svg{vertical-align:middle;fill:currentColor}.gjs-clm-sels-info{margin:7px 0}.gjs-clm-sel-id{font-size:.9em;opacity:.5;filter:alpha(opacity=50)}.gjs-clm-label-sel{float:left;padding-right:5px}.gjs-clm-tags{font-size:.75rem;padding:10px 5px}.gjs-clm-tags #gjs-clm-sel{padding:7px 0;float:left}.gjs-clm-tags #gjs-clm-sel{font-style:italic;margin-left:5px}.gjs-clm-tags #gjs-clm-tags-field{clear:both;padding:5px;margin-bottom:5px;display:flex;flex-wrap:wrap}.gjs-clm-tags #gjs-clm-tags-c{display:flex;flex-wrap:wrap;vertical-align:top;overflow:hidden}.gjs-clm-tags #gjs-clm-new{color:#ddd;padding:5px 6px;display:none}.gjs-clm-tags #gjs-clm-close{opacity:.85;filter:alpha(opacity=85);font-size:20px;line-height:0;cursor:pointer;color:rgba(255,255,255,.9)}.gjs-clm-tags #gjs-clm-close:hover{opacity:1;filter:alpha(opacity=100)}.gjs-clm-tags #gjs-clm-checkbox{color:rgba(255,255,255,.9);vertical-align:middle;cursor:pointer;font-size:9px}.gjs-clm-tags #gjs-clm-tag-label{flex-grow:1;text-overflow:ellipsis;overflow:hidden;padding:0 3px;cursor:text}.gjs-mdl-container{font-family:Helvetica,sans-serif;overflow-y:auto;position:fixed;background-color:rgba(0,0,0,.5);display:flex;top:0;left:0;right:0;bottom:0;z-index:100}.gjs-mdl-dialog{text-shadow:-1px -1px 0 rgba(0,0,0,.05);animation:gjs-slide-down .215s;margin:auto;max-width:850px;width:90%;border-radius:3px;font-weight:lighter;position:relative;z-index:2}.gjs-mdl-title{font-size:1rem}.gjs-mdl-btn-close{position:absolute;right:15px;top:5px}.gjs-mdl-active .gjs-mdl-dialog{animation:gjs-mdl-slide-down .216s}.gjs-mdl-header,.gjs-mdl-content{padding:10px 15px;clear:both}.gjs-mdl-header{position:relative;border-bottom:1px solid rgba(0,0,0,.2);padding:15px 15px 7px}.gjs-export-dl::after{content:"";clear:both;display:block;margin-bottom:10px}.gjs-dropzone{display:none;opacity:0;position:absolute;top:0;left:0;z-index:11;width:100%;height:100%;transition:opacity .25s;pointer-events:none}.gjs-dropzone-active .gjs-dropzone{display:block;opacity:1}.gjs-am-assets{height:290px;overflow:auto;clear:both;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:flex-start}.gjs-am-assets-header{padding:5px}.gjs-am-add-asset .gjs-am-add-field{width:70%;float:left}.gjs-am-add-asset button{width:25%;float:right}.gjs-am-preview-cont{position:relative;height:70px;width:30%;background-color:#444;border-radius:2px;float:left;overflow:hidden}.gjs-am-preview{position:absolute;background-position:center center;background-size:cover;background-repeat:no-repeat;height:100%;width:100%;z-index:1}.gjs-am-preview-bg{opacity:.5;filter:alpha(opacity=50);position:absolute;height:100%;width:100%;z-index:0}.gjs-am-dimensions{opacity:.5;filter:alpha(opacity=50);font-size:10px}.gjs-am-meta{width:70%;float:left;font-size:12px;padding:5px 0 0 5px;box-sizing:border-box}.gjs-am-meta>div{margin-bottom:5px}.gjs-am-close{cursor:pointer;position:absolute;right:5px;top:0;display:none}.gjs-am-asset{border-bottom:1px solid rgba(0,0,0,.2);padding:5px;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.gjs-am-asset:hover .gjs-am-close{display:block}.gjs-am-highlight{background-color:rgba(255,255,255,.1)}.gjs-am-assets-cont{background-color:rgba(0,0,0,.1);border-radius:3px;box-sizing:border-box;padding:10px;width:45%;float:right;height:325px;overflow:hidden}.gjs-am-file-uploader{width:55%;float:left}.gjs-am-file-uploader>form{background-color:rgba(0,0,0,.1);border:2px dashed;border-radius:3px;position:relative;text-align:center;margin-bottom:15px}.gjs-am-file-uploader>form.gjs-am-hover{border:2px solid #62c462;color:#75cb75}.gjs-am-file-uploader>form.gjs-am-disabled{border-color:red}.gjs-am-file-uploader>form #gjs-am-uploadFile{opacity:0;filter:alpha(opacity=0);padding:150px 10px;width:100%;box-sizing:border-box}.gjs-am-file-uploader #gjs-am-title{position:absolute;padding:150px 10px;width:100%}.gjs-cm-editor-c{float:left;box-sizing:border-box;width:50%}.gjs-cm-editor-c .CodeMirror{height:450px}.gjs-cm-editor{font-size:12px}.gjs-cm-editor#gjs-cm-htmlmixed{padding-right:10px;border-right:1px solid rgba(0,0,0,.2)}.gjs-cm-editor#gjs-cm-htmlmixed #gjs-cm-title{color:#a97d44}.gjs-cm-editor#gjs-cm-css{padding-left:10px}.gjs-cm-editor#gjs-cm-css #gjs-cm-title{color:#ddca7e}.gjs-cm-editor #gjs-cm-title{background-color:rgba(0,0,0,.2);font-size:12px;padding:5px 10px 3px;text-align:right}.gjs-rte-toolbar{border:1px solid rgba(0,0,0,.2);position:absolute;border-radius:3px;z-index:10}.gjs-rte-actionbar{display:flex}.gjs-rte-action{display:flex;align-items:center;justify-content:center;padding:5px;min-width:25px;border-right:1px solid rgba(0,0,0,.2);text-align:center;cursor:pointer;outline:none}.gjs-rte-action:last-child{border-right:none}.gjs-rte-action:hover{background-color:rgba(255,255,255,.1)}.gjs-rte-active{background-color:rgba(255,255,255,.1)}.gjs-rte-disabled{color:rgba(255,255,255,.1);cursor:not-allowed}.gjs-rte-disabled:hover{background-color:unset}.gjs-editor-cont .sp-hue,.gjs-editor-cont .sp-slider{cursor:row-resize}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-dragger{cursor:crosshair}.gjs-editor-cont .sp-alpha-inner,.gjs-editor-cont .sp-alpha-handle{cursor:col-resize}.gjs-editor-cont .sp-hue{left:90%}.gjs-editor-cont .sp-color{right:15%}.gjs-editor-cont .sp-container{border:1px solid rgba(0,0,0,.2);box-shadow:0 0 7px rgba(0,0,0,.2);border-radius:3px}.gjs-editor-cont .sp-picker-container{border:none}.gjs-editor-cont .colpick_dark .colpick_color{outline:1px solid rgba(0,0,0,.2)}.gjs-editor-cont .sp-cancel,.gjs-editor-cont .sp-cancel:hover{bottom:-8px;color:#777 !important;font-size:25px;left:0;position:absolute;text-decoration:none}.gjs-editor-cont .sp-alpha-handle{background-color:#ccc;border:1px solid #555;width:4px}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-hue{border:1px solid #333}.gjs-editor-cont .sp-slider{background-color:#ccc;border:1px solid #555;height:3px;left:-4px;width:22px}.gjs-editor-cont .sp-dragger{background:transparent;box-shadow:0 0 0 1px #111}.gjs-editor-cont .sp-button-container{float:none;width:100%;position:relative;text-align:right}.gjs-editor-cont .sp-container button,.gjs-editor-cont .sp-container button:hover,.gjs-editor-cont .sp-container button:active{background:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2);color:#ddd;text-shadow:none;box-shadow:none;padding:3px 5px}.gjs-editor-cont .sp-palette-container{border:none;float:none;margin:0;padding:5px 10px 0}.gjs-editor-cont .sp-palette .sp-thumb-el,.gjs-editor-cont .sp-palette .sp-thumb-el:hover{border:1px solid rgba(0,0,0,.9)}.gjs-editor-cont .sp-palette .sp-thumb-el:hover,.gjs-editor-cont .sp-palette .sp-thumb-el.sp-thumb-active{border-color:rgba(0,0,0,.9)}.gjs-hidden{display:none}@keyframes gjs-slide-down{0%{transform:translate(0, -3rem);opacity:0}100%{transform:translate(0, 0);opacity:1}}@keyframes gjs-slide-up{0%{transform:translate(0, 0);opacity:1}100%{transform:translate(0, -3rem);opacity:0}}.cm-s-hopscotch span.cm-error{color:#fff} +.sp-container{position:absolute;top:0;left:0;display:inline-block;*display:inline;*zoom:1;z-index:9999994;overflow:hidden}.sp-container.sp-flat{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{position:relative;width:100%;display:inline-block}.sp-top-inner{position:absolute;top:0;left:0;bottom:0;right:0}.sp-color{position:absolute;top:0;left:0;bottom:0;right:20%}.sp-hue{position:absolute;top:0;right:0;bottom:0;left:84%;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{position:absolute;top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{position:absolute;top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid black;background:white;opacity:.8}.sp-alpha{display:none;position:absolute;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:solid 1px #333}.sp-clear{display:none}.sp-clear.sp-clear-display{background-position:center}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0px;right:0;bottom:0;left:84%;height:28px}.sp-container,.sp-replacer,.sp-preview,.sp-dragger,.sp-slider,.sp-alpha,.sp-clear,.sp-alpha-handle,.sp-container.sp-dragging .sp-input,.sp-container button{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-input-disabled .sp-input-container{display:none}.sp-container.sp-buttons-disabled .sp-button-container{display:none}.sp-container.sp-palette-buttons-disabled .sp-palette-button-container{display:none}.sp-palette-only .sp-picker-container{display:none}.sp-palette-disabled .sp-palette-container{display:none}.sp-initial-disabled .sp-initial{display:none}.sp-sat{background-image:-webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:linear-gradient(to right, #fff, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr="#FFFFFFFF", endColorstr="#00CC9A81")}.sp-val{background-image:-webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:linear-gradient(to top, #000, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00CC9A81", endColorstr="#FF000000")}.sp-hue{background:-moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));background:-webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff0000", endColorstr="#ffff00")}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffff00", endColorstr="#00ff00")}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ff00", endColorstr="#00ffff")}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffff", endColorstr="#0000ff")}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0000ff", endColorstr="#ff00ff")}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff00ff", endColorstr="#ff0000")}.sp-hidden{display:none !important}.sp-cf:before,.sp-cf:after{content:"";display:table}.sp-cf:after{clear:both}.sp-cf{*zoom:1}@media(max-device-width: 480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;cursor:pointer;position:absolute;top:0;left:0}.sp-slider{position:absolute;top:0;cursor:pointer;height:3px;left:-1px;right:-1px;border:1px solid #000;background:white;opacity:.8}.sp-container{border-radius:0;background-color:#ececec;border:solid 1px #f0c49b;padding:0}.sp-container,.sp-container button,.sp-container input,.sp-color,.sp-hue,.sp-clear{font:normal 12px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-color,.sp-hue,.sp-clear{border:solid 1px #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container{width:100%}.sp-input{font-size:12px !important;border:1px inset;padding:4px 5px;margin:0;width:100%;background:transparent;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-picker-container,.sp-palette-container{float:left;position:relative;padding:10px;padding-bottom:300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:solid 1px #fff}.sp-palette-container{border-right:solid 1px #ccc}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;width:24px;height:15px;margin:3px;cursor:pointer;border:solid 2px transparent}.sp-palette .sp-thumb-el:hover,.sp-palette .sp-thumb-el.sp-thumb-active{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:solid 1px #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:center}.sp-palette-button-container,.sp-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;*zoom:1;*display:inline;border:solid 1px #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer:hover,.sp-replacer.sp-active{border-color:#f0c49b;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px}.sp-preview{position:relative;width:25px;height:20px;border:solid 1px #222;margin-right:5px;float:left;z-index:0}.sp-palette{*width:220px;max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:solid 1px #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top, #eeeeee, #cccccc);background-image:-moz-linear-gradient(top, #eeeeee, #cccccc);background-image:-ms-linear-gradient(top, #eeeeee, #cccccc);background-image:-o-linear-gradient(top, #eeeeee, #cccccc);background-image:linear-gradient(to bottom, #eeeeee, #cccccc);border:1px solid #ccc;border-bottom:1px solid #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top, #dddddd, #bbbbbb);background-image:-moz-linear-gradient(top, #dddddd, #bbbbbb);background-image:-ms-linear-gradient(top, #dddddd, #bbbbbb);background-image:-o-linear-gradient(top, #dddddd, #bbbbbb);background-image:linear-gradient(to bottom, #dddddd, #bbbbbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid #aaa;border-bottom:1px solid #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f !important;margin:0;padding:2px;margin-right:5px;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f !important;text-decoration:underline}.sp-palette span:hover,.sp-palette span.sp-thumb-active{border-color:#000}.sp-preview,.sp-alpha,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-preview-inner,.sp-alpha-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=)}.sp-clear-display{background-repeat:no-repeat;background-position:center;background-image:url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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sITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==)}.CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20, 255, 20, 0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:blue}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, 0.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, 0.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-hopscotch.CodeMirror{background:#322931;color:#d5d3d5}.cm-s-hopscotch div.CodeMirror-selected{background:#433b42 !important}.cm-s-hopscotch .CodeMirror-gutters{background:#322931;border-right:0px}.cm-s-hopscotch .CodeMirror-linenumber{color:#797379}.cm-s-hopscotch .CodeMirror-cursor{border-left:1px solid #989498 !important}.cm-s-hopscotch span.cm-comment{color:#b33508}.cm-s-hopscotch span.cm-atom{color:#c85e7c}.cm-s-hopscotch span.cm-number{color:#c85e7c}.cm-s-hopscotch span.cm-property,.cm-s-hopscotch span.cm-attribute{color:#8fc13e}.cm-s-hopscotch span.cm-keyword{color:#dd464c}.cm-s-hopscotch span.cm-string{color:#fdcc59}.cm-s-hopscotch span.cm-variable{color:#8fc13e}.cm-s-hopscotch span.cm-variable-2{color:#1290bf}.cm-s-hopscotch span.cm-def{color:#fd8b19}.cm-s-hopscotch span.cm-error{background:#dd464c;color:#989498}.cm-s-hopscotch span.cm-bracket{color:#d5d3d5}.cm-s-hopscotch span.cm-tag{color:#dd464c}.cm-s-hopscotch span.cm-link{color:#c85e7c}.cm-s-hopscotch .CodeMirror-matchingbracket{text-decoration:underline;color:white !important}.cm-s-hopscotch .CodeMirror-activeline-background{background:#302020}@font-face{font-family:"font3336";src:url("../fonts/main-fonts.eot?v=20");src:url("../fonts/main-fonts.woff?v=20") format("woff"),url("../fonts/main-fonts.ttf?v=20") format("truetype"),url("../fonts/main-fonts.svg?v=20") format("svg"),url("../fonts/main-fonts.eot?v=20") format("embedded-opentype");font-weight:normal;font-style:normal}.gjs-is__grab,.gjs-is__grab *{cursor:grab !important}.gjs-is__grabbing,.gjs-is__grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:grabbing !important}.gjs-one-bg{background-color:#444}.gjs-one-color{color:#444}.gjs-one-color-h:hover{color:#444}.gjs-two-bg{background-color:#ddd}.gjs-two-color{color:#ddd}.gjs-two-color-h:hover{color:#ddd}.gjs-three-bg{background-color:#804f7b}.gjs-three-color{color:#804f7b}.gjs-three-color-h:hover{color:#804f7b}.gjs-four-bg{background-color:#d278c9}.gjs-four-color{color:#d278c9}.gjs-four-color-h:hover{color:#d278c9}.gjs-danger-bg{background-color:#dd3636}.gjs-danger-color{color:#dd3636}.gjs-danger-color-h:hover{color:#dd3636}.gjs-bg-main,.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c,.gjs-off-prv{background-color:#444}.gjs-color-main,.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add,.gjs-off-prv{color:#ddd;fill:#ddd}.gjs-color-active{color:#f8f8f8;fill:#f8f8f8}.gjs-color-warn{color:#ffca6f;fill:#ffca6f}.gjs-color-hl{color:#71b7f1;fill:#71b7f1}.gjs-fonts::before{display:block;font:normal normal normal 14px font3336;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:5em}.gjs-f-b1::before{content:"Q"}.gjs-f-b2::before{content:"W"}.gjs-f-b3::before{content:"E"}.gjs-f-b37::before{content:"R"}.gjs-f-hero::before{content:"T"}.gjs-f-h1p::before{content:"y"}.gjs-f-3ba::before{content:"u"}.gjs-f-image::before{content:"I"}.gjs-f-text::before{content:"o"}.gjs-f-quo::before{content:"p"}.gjs-f-button::before{content:"B"}.gjs-f-divider::before{content:"D"}.gjs-invis-invis,.gjs-clm-tags #gjs-clm-new,.gjs-no-app{background-color:transparent;border:none;color:inherit}.gjs-no-app{height:10px}.gjs-test::btn{color:"#fff"}.opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-checker-bg,.gjs-field-colorp-c,.checker-bg,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==")}.gjs-no-user-select,.gjs-rte-toolbar,.gjs-layer-name,.gjs-grabbing,.gjs-grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-pointer-events,.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el,.gjs-resizer-c{pointer-events:none}.gjs-bdrag{pointer-events:none !important;position:absolute !important;z-index:10 !important;width:auto}.gjs-drag-helper{background-color:#3b97e3 !important;pointer-events:none !important;position:absolute !important;z-index:10 !important;transform:scale(0.3) !important;transform-origin:top left !important;-webkit-transform-origin:top left !important;margin:15px !important;transition:none !important;outline:none !important}.gjs-grabbing,.gjs-grabbing *{cursor:grabbing !important;cursor:-webkit-grabbing !important}.gjs-grabbing{overflow:hidden}.gjs-off-prv{position:relative;z-index:10;padding:5px;cursor:pointer}.gjs-editor-cont ::-webkit-scrollbar-track{background:rgba(0,0,0,.1)}.gjs-editor-cont ::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.2)}.gjs-editor-cont ::-webkit-scrollbar{width:8px}.clear{clear:both}.no-select,.gjs-clm-tags #gjs-clm-close,.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title,.gjs-com-no-select,.gjs-com-no-select img{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-touch-actions{touch-action:none}.gjs-disabled{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;opacity:.5;filter:alpha(opacity=50)}.gjs-editor{font-family:Helvetica,sans-serif;font-size:.75rem;position:relative;box-sizing:border-box;height:100%}.gjs-freezed,.gjs-freezed{opacity:.5;filter:alpha(opacity=50);pointer-events:none}.gjs-traits-label{border-bottom:1px solid rgba(0,0,0,.2);font-weight:lighter;margin-bottom:5px;padding:10px;text-align:left}.gjs-label-wrp{width:30%;min-width:30%}.gjs-field-wrp{flex-grow:1}.gjs-trt-header{font-weight:lighter;padding:10px}.gjs-trt-trait{display:flex;justify-content:flex-start;padding:5px 10px;font-weight:lighter;align-items:center;text-align:left}.gjs-trt-traits{font-size:.75rem}.gjs-trt-trait .gjs-label{text-align:left;text-overflow:ellipsis;overflow:hidden}.gjs-guide-info{position:absolute}.gjs-guide-info__content{position:absolute;height:100%;display:flex;width:100%;padding:5px}.gjs-guide-info__line{position:relative;margin:auto}.gjs-guide-info__line::before,.gjs-guide-info__line::after{content:"";display:block;position:absolute;background-color:inherit}.gjs-guide-info__y{padding:0 5px}.gjs-guide-info__y .gjs-guide-info__content{justify-content:center}.gjs-guide-info__y .gjs-guide-info__line{width:100%;height:1px}.gjs-guide-info__y .gjs-guide-info__line::before,.gjs-guide-info__y .gjs-guide-info__line::after{width:1px;height:10px;top:0;bottom:0;left:0;margin:auto}.gjs-guide-info__y .gjs-guide-info__line::after{left:auto;right:0}.gjs-guide-info__x{padding:5px 0}.gjs-guide-info__x .gjs-guide-info__content{align-items:center}.gjs-guide-info__x .gjs-guide-info__line{height:100%;width:1px}.gjs-guide-info__x .gjs-guide-info__line::before,.gjs-guide-info__x .gjs-guide-info__line::after{width:10px;height:1px;left:0;right:0;top:0;margin:auto;transform:translateX(-50%)}.gjs-guide-info__x .gjs-guide-info__line::after{top:auto;bottom:0}.gjs-badge{white-space:nowrap}.gjs-badge__icon{vertical-align:middle;display:inline-block;width:15px;height:15px}.gjs-badge__icon svg{fill:currentColor}.gjs-badge__name{display:inline-block;vertical-align:middle}.gjs-frame-wrapper{position:absolute;width:100%;height:100%;left:0;right:0;margin:auto}.gjs-frame-wrapper--anim{transition:width .35s ease,height .35s ease}.gjs-frame-wrapper__top{transform:translateY(-100%) translateX(-50%);display:flex;padding:5px 0;position:absolute;width:100%;left:50%;top:0}.gjs-frame-wrapper__top-r{margin-left:auto}.gjs-frame-wrapper__left{position:absolute;left:0;transform:translateX(-100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__bottom{position:absolute;bottom:0;transform:translateY(100%) translateX(-50%);width:100%;left:50%}.gjs-frame-wrapper__right{position:absolute;right:0;transform:translateX(100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__icon{width:24px;cursor:pointer}.gjs-frame-wrapper__icon>svg{fill:currentColor}.gjs-padding-v-top,.gjs-fixedpadding-v-top{width:100%;top:0;left:0}.gjs-padding-v-right,.gjs-fixedpadding-v-right{right:0}.gjs-padding-v-bottom,.gjs-fixedpadding-v-bottom{width:100%;left:0;bottom:0}.gjs-padding-v-left,.gjs-fixedpadding-v-left{left:0}.gjs-cv-canvas{background-color:rgba(0,0,0,.15);box-sizing:border-box;width:85%;height:calc(100% - 40px);bottom:0;overflow:hidden;z-index:1;position:absolute;left:0;top:40px}.gjs-cv-canvas.gjs-cui{width:100%;height:100%;top:0}.gjs-cv-canvas.gjs-is__grab .gjs-cv-canvas__frames,.gjs-cv-canvas.gjs-is__grabbing .gjs-cv-canvas__frames{pointer-events:none}.gjs-cv-canvas__frames{position:absolute;top:0;left:0;width:100%;height:100%}.gjs-cv-canvas .gjs-ghost{display:none;pointer-events:none;background-color:#5b5b5b;border:2px dashed #ccc;position:absolute;z-index:10;opacity:.55;filter:alpha(opacity=55)}.gjs-cv-canvas .gjs-highlighter,.gjs-cv-canvas .gjs-highlighter-sel{position:absolute;outline:1px solid #3b97e3;outline-offset:-1px;pointer-events:none;width:100%;height:100%}.gjs-cv-canvas .gjs-highlighter-warning{outline:3px solid #ffca6f}.gjs-cv-canvas .gjs-highlighter-sel{outline:2px solid #3b97e3;outline-offset:-2px}.gjs-cv-canvas #gjs-tools,.gjs-cv-canvas .gjs-tools{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;z-index:1}.gjs-cv-canvas *{box-sizing:border-box}.gjs-frame{outline:medium none;height:100%;width:100%;border:none;margin:auto;display:block;transition:width .35s ease,height .35s ease;position:absolute;top:0;bottom:0;left:0;right:0}.gjs-toolbar{position:absolute;background-color:#3b97e3;white-space:nowrap;color:#fff;z-index:10;top:0;left:0}.gjs-toolbar-item{padding:5px 7px;font-size:.8rem;cursor:pointer;width:26px;vertical-align:middle;display:inline-block}.gjs-toolbar-item svg{fill:currentColor;vertical-align:middle}.gjs-resizer-c{position:absolute;left:0;top:0;width:100%;height:100%;z-index:9}.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.1;filter:alpha(opacity=10);position:absolute;background-color:#ff0}.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.2;filter:alpha(opacity=20)}.gjs-padding-v-el,.gjs-fixedpadding-v-el{background-color:navy}.gjs-resizer-h{pointer-events:all;position:absolute;border:3px solid #3b97e3;width:10px;height:10px;background-color:#fff;margin:-5px}.gjs-resizer-h-tl{top:0;left:0;cursor:nwse-resize}.gjs-resizer-h-tr{top:0;right:0;cursor:nesw-resize}.gjs-resizer-h-tc{top:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-cl{left:0;margin:auto -5px;top:0;bottom:0;cursor:ew-resize}.gjs-resizer-h-cr{margin:auto -5px;top:0;bottom:0;right:0;cursor:ew-resize}.gjs-resizer-h-bl{bottom:0;left:0;cursor:nesw-resize}.gjs-resizer-h-bc{bottom:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-br{bottom:0;right:0;cursor:nwse-resize}.gjs-pn-panel .gjs-resizer-h{background-color:rgba(0,0,0,.2);border:none;opacity:0;transition:opacity .25s}.gjs-pn-panel .gjs-resizer-h:hover{opacity:1}.gjs-pn-panel .gjs-resizer-h-tc,.gjs-pn-panel .gjs-resizer-h-bc{margin:0 auto;width:100%}.gjs-pn-panel .gjs-resizer-h-cr,.gjs-pn-panel .gjs-resizer-h-cl{margin:auto 0;height:100%}.gjs-resizing .gjs-highlighter,.gjs-resizing .gjs-badge{display:none !important}.gjs-resizing-tl *{cursor:nwse-resize !important}.gjs-resizing-tr *{cursor:nesw-resize !important}.gjs-resizing-tc *{cursor:ns-resize !important}.gjs-resizing-cl *{cursor:ew-resize !important}.gjs-resizing-cr *{cursor:ew-resize !important}.gjs-resizing-bl *{cursor:nesw-resize !important}.gjs-resizing-bc *{cursor:ns-resize !important}.gjs-resizing-br *{cursor:nwse-resize !important}.btn-cl,.gjs-am-close,.gjs-mdl-btn-close{opacity:.3;filter:alpha(opacity=30);font-size:25px;cursor:pointer}.btn-cl:hover,.gjs-am-close:hover,.gjs-mdl-btn-close:hover{opacity:.7;filter:alpha(opacity=70)}.no-dots,.ui-resizable-handle{border:none !important;margin:0 !important;outline:none !important}.gjs-com-dashed *{outline:1px dashed #888;outline-offset:-2px;box-sizing:border-box}.gjs-cv-canvas .gjs-comp-selected{outline:3px solid #3b97e3 !important}*.gjs-com-hover,div.gjs-com-hover{outline:1px solid #3b97e3}*.gjs-com-hover-delete,div.gjs-com-hover-delete{outline:2px solid #dd3636;opacity:.5;filter:alpha(opacity=50)}*.gjs-com-hover-move,div.gjs-com-hover-move{outline:3px solid #ffca6f}.gjs-com-badge,.gjs-com-badge-red,.gjs-badge{pointer-events:none;background-color:#3b97e3;color:#fff;padding:2px 5px;position:absolute;z-index:1;font-size:12px;outline:none;display:none}.gjs-com-badge-red{background-color:#dd3636}.gjs-badge-warning{background-color:#ffca6f}.gjs-placeholder,.gjs-com-placeholder,.gjs-placeholder{position:absolute;z-index:10;pointer-events:none;display:none}.gjs-placeholder,.gjs-placeholder{border-style:solid !important;outline:none;box-sizing:border-box;transition:top .2s,left .2s,width .2s,height .2s}.gjs-placeholder.horizontal,.gjs-com-placeholder.horizontal,.gjs-placeholder.horizontal{border-color:transparent #62c462;border-width:3px 5px;margin:-3px 0 0}.gjs-placeholder.vertical,.gjs-com-placeholder.vertical,.gjs-placeholder.vertical{border-color:#62c462 transparent;border-width:5px 3px;margin:0 0 0 -3px}.gjs-placeholder-int,.gjs-com-placeholder-int,.gjs-placeholder-int{background-color:#62c462;box-shadow:0 0 3px rgba(0,0,0,.2);height:100%;width:100%;pointer-events:none;padding:1.5px;outline:none}.gjs-pn-panel{display:inline-block;position:absolute;box-sizing:border-box;text-align:center;padding:5px;z-index:3}.gjs-pn-panel .icon-undo,.gjs-pn-panel .icon-redo{font-size:20px;height:30px;width:25px}.gjs-pn-commands{width:85%;left:0;top:0;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-options{right:15%;top:0}.gjs-pn-views{border-bottom:2px solid rgba(0,0,0,.2);right:0;width:15%;z-index:4}.gjs-pn-views-container{height:100%;padding:42px 0 0;right:0;width:15%;overflow:auto;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-buttons{align-items:center;display:flex;justify-content:space-between}.gjs-pn-btn{box-sizing:border-box;min-height:30px;min-width:30px;line-height:21px;background-color:transparent;border:none;font-size:18px;margin-right:5px;border-radius:2px;padding:4px;position:relative;cursor:pointer}.gjs-pn-btn.gjs-pn-active{background-color:rgba(0,0,0,.15);box-shadow:0 0 3px rgba(0,0,0,.25) inset}.gjs-pn-btn svg{fill:currentColor}.gjs-comp-image-placeholder{display:block;background-color:#f5f5f5;color:#777;height:50px;width:50px;line-height:50px;outline:3px solid #ffca6f;outline-offset:-3px;text-align:center;font-size:16.6666666667px;cursor:pointer}.gjs-comp-image-placeholder.fa-picture-o::after{content:""}.gjs-label{line-height:18px}.gjs-fields{display:flex}.gjs-select{padding:0;width:100%}.gjs-select select{padding-right:10px}.gjs-select:-moz-focusring,.gjs-select select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-input:focus,.gjs-button:focus,.gjs-btn-prim:focus,.gjs-select:focus,.gjs-select select:focus{outline:none}.gjs-field input,.gjs-field select,.gjs-field textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:inherit;border:none;background-color:transparent;box-sizing:border-box;width:100%;position:relative;padding:5px;z-index:1}.gjs-field input:focus,.gjs-field select:focus,.gjs-field textarea:focus{outline:none}.gjs-field input[type=number]{-moz-appearance:textfield}.gjs-field input[type=number]::-webkit-outer-spin-button,.gjs-field input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gjs-field-range{flex:9 1 auto}.gjs-field-integer input{padding-right:30px}.gjs-select option,.gjs-field-select option,.gjs-clm-select option,.gjs-sm-select option,.gjs-fields option,.gjs-sm-unit option{background-color:#444;color:#ddd}.gjs-field{background-color:rgba(0,0,0,.2);border:none;box-shadow:none;border-radius:2px;box-sizing:border-box;padding:0;position:relative}.gjs-field textarea{resize:vertical}.gjs-field .gjs-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;z-index:0}.gjs-field .gjs-d-s-arrow{bottom:0;top:0;margin:auto;right:5px;border-top:4px solid rgba(255,255,255,.7);position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-field-arrows{position:absolute;cursor:ns-resize;margin:auto;height:20px;width:9px;z-index:10;bottom:0;right:3px;top:0}.gjs-field-color,.gjs-field-radio{width:100%}.gjs-field-color input{padding-right:22px;box-sizing:border-box}.gjs-field-colorp{border-left:1px solid rgba(0,0,0,.2);box-sizing:border-box;height:100%;padding:2px;position:absolute;right:0;top:0;width:22px;z-index:10}.gjs-field-colorp .gjs-checker-bg,.gjs-field-colorp .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-field-colorp-c{height:100%;position:relative;width:100%}.gjs-field-color-picker{background-color:#ddd;cursor:pointer;height:100%;width:100%;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px;position:absolute;top:0}.gjs-field-checkbox{padding:0;width:17px;height:17px;display:block;cursor:pointer}.gjs-field-checkbox input{display:none}.gjs-field-checkbox input:checked+.gjs-chk-icon{border-color:rgba(255,255,255,.5);border-width:0 2px 2px 0;border-style:solid}.gjs-radio-item{flex:1 1 auto;text-align:center;border-left:1px solid rgba(0,0,0,.2)}.gjs-radio-item:first-child{border:none}.gjs-radio-item:hover{background:rgba(0,0,0,.2)}.gjs-radio-item input{display:none}.gjs-radio-item input:checked+.gjs-radio-item-label{background-color:rgba(255,255,255,.2)}.gjs-radio-items{display:flex}.gjs-radio-item-label{cursor:pointer;display:block;padding:5px}.gjs-field-units{position:absolute;margin:auto;right:10px;bottom:0;top:0}.gjs-field-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-field-arrow-u,.gjs-field-arrow-d{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(255,255,255,.7);bottom:4px;cursor:pointer}.gjs-field-arrow-u{border-bottom:4px solid rgba(255,255,255,.7);border-top:none;top:4px}.gjs-field-select{padding:0}.gjs-field-range{background-color:transparent;border:none;box-shadow:none;padding:0}.gjs-field-range input{margin:0;height:100%}.gjs-field-range input:focus{outline:none}.gjs-field-range input::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-ms-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-webkit-slider-runnable-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-ms-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-btn-prim{color:inherit;background-color:rgba(255,255,255,.1);border-radius:2px;padding:3px 6px;padding:5px;cursor:pointer;border:none}.gjs-btn-prim:active{background-color:rgba(255,255,255,.1)}.gjs-btn--full{width:100%}.gjs-chk-icon{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);box-sizing:border-box;display:block;height:14px;margin:0 5px;width:6px}.gjs-add-trasp{background:none;border:none;color:#ddd;cursor:pointer;font-size:1em;border-radius:2px;opacity:.75;filter:alpha(opacity=75)}.gjs-add-trasp:hover{opacity:1;filter:alpha(opacity=100)}.gjs-add-trasp:active{background-color:rgba(0,0,0,.2)}.gjs-devices-c{display:flex;align-items:center;padding:3px}.gjs-devices-c .gjs-device-label{flex-grow:2;text-align:left;margin-right:10px}.gjs-devices-c .gjs-select{flex-grow:20}.gjs-devices-c .gjs-add-trasp{flex-grow:1;margin-left:5px}.gjs-category-open,.gjs-block-category.gjs-open,.gjs-sm-sector.gjs-sm-open,.gjs-sm-open.gjs-clm-tags{border-bottom:1px solid rgba(0,0,0,.25)}.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title{font-weight:lighter;background-color:rgba(0,0,0,.1);letter-spacing:1px;padding:9px 10px 9px 20px;border-bottom:1px solid rgba(0,0,0,.25);text-align:left;position:relative;cursor:pointer}.gjs-sm-clear{cursor:pointer;width:14px;min-width:14px;height:14px;margin-left:3px}.gjs-sm-header{font-weight:lighter;padding:10px}.gjs-sm-properties{font-size:.75rem;padding:10px 5px;display:flex;flex-wrap:wrap;align-items:flex-end;box-sizing:border-box;width:100%}.gjs-sm-label{margin:5px 5px 3px 0;display:flex;align-items:center}.gjs-sm-close-btn,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.2;filter:alpha(opacity=20)}.gjs-sm-close-btn:hover,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover{opacity:.7;filter:alpha(opacity=70)}.gjs-sm-sector,.gjs-clm-tags{clear:both;font-weight:lighter;text-align:left}.gjs-sm-sector #gjs-sm-caret,.gjs-clm-tags #gjs-sm-caret{padding-right:5px;font-size:11px}.gjs-sm-sector .gjs-sm-field,.gjs-clm-tags .gjs-sm-field,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-clm-field,.gjs-clm-tags .gjs-clm-field{width:100%;position:relative}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input,.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{background-color:transparent;color:rgba(255,255,255,.7);border:none;width:100%}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input{box-sizing:border-box}.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gjs-sm-sector .gjs-sm-field select::-ms-expand,.gjs-clm-tags .gjs-sm-field select::-ms-expand,.gjs-sm-sector .gjs-clm-select select::-ms-expand,.gjs-clm-tags .gjs-clm-select select::-ms-expand,.gjs-sm-sector .gjs-clm-field select::-ms-expand,.gjs-clm-tags .gjs-clm-field select::-ms-expand{display:none}.gjs-sm-sector .gjs-sm-field select:-moz-focusring,.gjs-clm-tags .gjs-sm-field select:-moz-focusring,.gjs-sm-sector .gjs-clm-select select:-moz-focusring,.gjs-clm-tags .gjs-clm-select select:-moz-focusring,.gjs-sm-sector .gjs-clm-field select:-moz-focusring,.gjs-clm-tags .gjs-clm-field select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-sm-sector .gjs-sm-field input:focus,.gjs-clm-tags .gjs-sm-field input:focus,.gjs-sm-sector .gjs-clm-select input:focus,.gjs-clm-tags .gjs-clm-select input:focus,.gjs-sm-sector .gjs-clm-field input:focus,.gjs-clm-tags .gjs-clm-field input:focus,.gjs-sm-sector .gjs-sm-field select:focus,.gjs-clm-tags .gjs-sm-field select:focus,.gjs-sm-sector .gjs-clm-select select:focus,.gjs-clm-tags .gjs-clm-select select:focus,.gjs-sm-sector .gjs-clm-field select:focus,.gjs-clm-tags .gjs-clm-field select:focus{outline:none}.gjs-sm-sector .gjs-sm-field .gjs-sm-unit,.gjs-clm-tags .gjs-sm-field .gjs-sm-unit,.gjs-sm-sector .gjs-clm-select .gjs-sm-unit,.gjs-clm-tags .gjs-clm-select .gjs-sm-unit,.gjs-sm-sector .gjs-clm-field .gjs-sm-unit,.gjs-clm-tags .gjs-clm-field .gjs-sm-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-sm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-select .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-select .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;cursor:ns-resize}.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{border-bottom:4px solid rgba(255,255,255,.7);top:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{border-top:4px solid rgba(255,255,255,.7);bottom:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{bottom:7px}.gjs-sm-sector .gjs-sm-field.gjs-sm-color,.gjs-clm-tags .gjs-sm-field.gjs-sm-color,.gjs-sm-sector .gjs-sm-color.gjs-clm-field,.gjs-clm-tags .gjs-sm-color.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-input,.gjs-clm-tags .gjs-sm-field.gjs-sm-input,.gjs-sm-sector .gjs-sm-input.gjs-clm-field,.gjs-clm-tags .gjs-sm-input.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-integer,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{background-color:rgba(0,0,0,.2);border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 0 rgba(255,255,255,.1);color:rgba(255,255,255,.7);border-radius:2px;box-sizing:border-box;padding:0 5px}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{border-radius:2px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{padding:0}.gjs-sm-sector .gjs-sm-field.gjs-sm-select select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field select,.gjs-clm-tags .gjs-sm-select.gjs-clm-field select{height:20px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select option,.gjs-clm-tags .gjs-sm-field.gjs-sm-select option,.gjs-sm-sector .gjs-clm-select option,.gjs-clm-tags .gjs-clm-select option,.gjs-sm-sector .gjs-sm-select.gjs-clm-field option,.gjs-clm-tags .gjs-sm-select.gjs-clm-field option{padding:3px 0}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{background-color:rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.25)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-select,.gjs-clm-tags .gjs-sm-list.gjs-clm-select,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field{width:auto;padding:0;overflow:hidden;float:left}.gjs-sm-sector .gjs-sm-field.gjs-sm-list input,.gjs-clm-tags .gjs-sm-field.gjs-sm-list input,.gjs-sm-sector .gjs-sm-list.gjs-clm-select input,.gjs-clm-tags .gjs-sm-list.gjs-clm-select input,.gjs-sm-sector .gjs-sm-list.gjs-clm-field input,.gjs-clm-tags .gjs-sm-list.gjs-clm-field input{display:none}.gjs-sm-sector .gjs-sm-field.gjs-sm-list label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field label{cursor:pointer;padding:5px;display:block}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label{background-color:rgba(255,255,255,.2)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-icon{background-repeat:no-repeat;background-position:center;text-shadow:none;line-height:normal}.gjs-sm-sector .gjs-sm-field.gjs-sm-integer select,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-select select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-select select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field select{width:auto;padding:0}.gjs-sm-sector .gjs-sm-list .gjs-sm-el,.gjs-clm-tags .gjs-sm-list .gjs-sm-el{float:left;border-left:1px solid rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:first-child,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:first-child{border:none}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:hover,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:hover{background:rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-slider .gjs-field-integer,.gjs-clm-tags .gjs-sm-slider .gjs-field-integer{flex:1 1 65px}.gjs-sm-sector .gjs-sm-property,.gjs-clm-tags .gjs-sm-property{box-sizing:border-box;float:left;width:50%;margin-bottom:5px;padding:0 5px}.gjs-sm-sector .gjs-sm-property--full,.gjs-clm-tags .gjs-sm-property--full,.gjs-sm-sector .gjs-sm-property.gjs-sm-composite,.gjs-clm-tags .gjs-sm-property.gjs-sm-composite,.gjs-sm-sector .gjs-sm-property.gjs-sm-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file,.gjs-sm-sector .gjs-sm-property.gjs-sm-list,.gjs-clm-tags .gjs-sm-property.gjs-sm-list,.gjs-sm-sector .gjs-sm-property.gjs-sm-stack,.gjs-clm-tags .gjs-sm-property.gjs-sm-stack,.gjs-sm-sector .gjs-sm-property.gjs-sm-slider,.gjs-clm-tags .gjs-sm-property.gjs-sm-slider,.gjs-sm-sector .gjs-sm-property.gjs-sm-color,.gjs-clm-tags .gjs-sm-property.gjs-sm-color{width:100%}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn{background-color:rgba(33,33,33,.2);border-radius:2px;box-shadow:1px 1px 0 rgba(5,5,5,.2),1px 1px 0 rgba(43,43,43,.2) inset;padding:5px;position:relative;text-align:center;height:auto;width:100%;cursor:pointer;color:#ddd;box-sizing:border-box;text-shadow:-1px -1px 0 rgba(0,0,0,.2);border:none;opacity:.85;filter:alpha(opacity=85)}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn-c,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn-c{box-sizing:border-box;float:left;width:100%}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box{background-color:rgba(255,255,255,.05);border-radius:2px;margin-top:5px;position:relative;overflow:hidden}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show{border:1px solid rgba(252,252,252,.05);padding:3px 20px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{top:-5px;display:block}.gjs-sm-sector .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file{height:50px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file{background-size:auto 100%;background-repeat:no-repeat;background-position:center center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layers,.gjs-clm-tags .gjs-sm-property .gjs-sm-layers{margin-top:5px;padding:1px 3px;min-height:30px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer{background-color:rgba(255,255,255,.055);border-radius:2px;margin:2px 0;padding:7px;position:relative}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer.gjs-sm-active,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer.gjs-sm-active{background-color:rgba(255,255,255,.12)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp{display:flex;align-items:center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-move,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-move{height:14px;width:14px;min-width:14px;cursor:grab}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-label,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-label{flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0 5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{height:15px;width:15px;min-width:15px;margin-right:5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview{background-color:#fff;height:100%;width:100%;background-size:cover !important}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{border-radius:2px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer{display:block;cursor:pointer;height:14px;width:14px;min-width:14px;opacity:.5;filter:alpha(opacity=50)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover{opacity:.8;filter:alpha(opacity=80)}.gjs-sm-sector #gjs-sm-text-shadow #gjs-sm-preview::after,.gjs-clm-tags #gjs-sm-text-shadow #gjs-sm-preview::after{color:#000;content:"T";font-weight:900;line-height:17px;padding:0 4px}.gjs-sm-sector .gjs-sm-stack .gjs-sm-properties,.gjs-clm-tags .gjs-sm-stack .gjs-sm-properties{padding:5px 0 0}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add{background:none;border:none;cursor:pointer;outline:none;position:absolute;right:0;top:-17px;opacity:.75;padding:0;width:18px;height:18px}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add:hover,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add:hover{opacity:1;filter:alpha(opacity=100)}.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c{height:100%;width:20px;position:absolute;right:0;top:0;box-sizing:border-box;border-radius:2px;padding:2px}.gjs-sm-sector .gjs-sm-colorp-c .gjs-checker-bg,.gjs-clm-tags .gjs-sm-colorp-c .gjs-checker-bg,.gjs-sm-sector .gjs-sm-colorp-c .gjs-field-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-sm-sector .gjs-sm-color-picker,.gjs-clm-tags .gjs-sm-color-picker{background-color:#ddd;cursor:pointer;height:16px;width:100%;margin-top:-16px;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-upload,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-upload{left:0;top:0;position:absolute;width:100%;opacity:0;cursor:pointer}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-label,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-label{padding:2px 0}.gjs-sm-layer>#gjs-sm-move{opacity:.7;filter:alpha(opacity=70);cursor:move;font-size:12px;float:left;margin:0 5px 0 0}.gjs-sm-layer>#gjs-sm-move:hover{opacity:.9;filter:alpha(opacity=90)}.gjs-blocks-c{display:flex;flex-wrap:wrap;justify-content:flex-start}.gjs-block-categories{display:flex;flex-direction:column}.gjs-block-category{width:100%}.gjs-block-category .gjs-caret-icon{margin-right:5px}.gjs-block{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;width:45%;min-width:45px;padding:1em;box-sizing:border-box;min-height:90px;cursor:all-scroll;font-size:11px;font-weight:lighter;text-align:center;display:flex;flex-direction:column;justify-content:space-between;border:1px solid rgba(0,0,0,.2);border-radius:3px;margin:10px 2.5% 5px;box-shadow:0 1px 0 0 rgba(0,0,0,.15);transition:all .2s ease 0s;transition-property:box-shadow,color}.gjs-block:hover{box-shadow:0 3px 4px 0 rgba(0,0,0,.15)}.gjs-block svg{fill:currentColor}.gjs-block__media{margin-bottom:10px;pointer-events:none}.gjs-block-svg{width:54px;fill:currentColor}.gjs-block-svg-path{fill:currentColor}.gjs-block.fa{font-size:2em;line-height:2em;padding:11px}.gjs-block-label{line-height:normal;font-size:.65rem;font-weight:normal;font-family:Helvetica,sans-serif;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.gjs-block.gjs-bdrag{width:auto;padding:0}.gjs-selected-parent{border:1px solid #ffca6f}.gjs-opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-layer{font-weight:lighter;text-align:left;position:relative;background-color:rgba(0,0,0,.1);font-size:.75rem;display:grid}.gjs-layer-hidden{opacity:.55;filter:alpha(opacity=55)}.gjs-layer-count{position:absolute;right:27px;top:9px}.gjs-layer-vis{height:auto !important;width:auto !important;left:0;top:0;padding:7px 5px 7px 10px;position:absolute;cursor:pointer;z-index:1}.gjs-layer-caret{font-size:.5rem;width:8px;padding:2px;cursor:pointer;position:absolute;left:-9px;top:6px;opacity:.7;filter:alpha(opacity=70)}.gjs-layer-caret:hover{opacity:1;filter:alpha(opacity=100)}.gjs-layer-title{padding:3px 10px 5px 30px;display:flex;align-items:center}.gjs-layer-title-inn{align-items:center;position:relative;display:flex;width:100%}.gjs-layer__icon{display:block;width:100%;max-width:15px;max-height:15px;padding-left:5px}.gjs-layer__icon svg{fill:currentColor}.gjs-layer-name{padding:5px 0;display:inline-block;box-sizing:content-box;overflow:hidden;white-space:nowrap;margin:0 30px 0 5px}.gjs-layer-name--no-edit{text-overflow:ellipsis}.gjs-layer>.gjs-layer-children{display:none}.gjs-layer.open>.gjs-layer-children{display:block}.gjs-layer-no-chld>.gjs-layer-title-inn>.gjs-layer-caret{display:none}.gjs-layer-move{padding:7px 10px 7px 5px;position:absolute;font-size:12px;cursor:move;right:0;top:0}.gjs-layer.gjs-hovered .gjs-layer-title{background-color:rgba(255,255,255,.015)}.gjs-layer.gjs-selected .gjs-layer-title{background-color:rgba(255,255,255,.1)}.gjs-layers{position:relative;height:100%}.gjs-layers #gjs-placeholder{width:100%;position:absolute}.gjs-layers #gjs-placeholder #gjs-plh-int{height:100%;padding:1px}.gjs-layers #gjs-placeholder #gjs-plh-int.gjs-insert{background-color:#62c462}#gjs-clm-add-tag,.gjs-clm-tags-btn{background-color:rgba(255,255,255,.15);border-radius:2px;padding:3px;margin-right:3px;border:1px solid rgba(0,0,0,.15);width:24px;height:24px;box-sizing:border-box;cursor:pointer}.gjs-clm-tags-btn svg{fill:currentColor;display:block}.gjs-clm-header{display:flex;align-items:center;margin:7px 0}.gjs-clm-header-status{flex-shrink:1;margin-left:auto}.gjs-clm-tag{display:flex;overflow:hidden;align-items:center;border-radius:3px;margin:0 3px 3px 0;padding:5px;cursor:default}.gjs-clm-tag-status,.gjs-clm-tag-close{width:12px;height:12px;flex-shrink:1}.gjs-clm-tag-status svg,.gjs-clm-tag-close svg{vertical-align:middle;fill:currentColor}.gjs-clm-sels-info{margin:7px 0}.gjs-clm-sel-id{font-size:.9em;opacity:.5;filter:alpha(opacity=50)}.gjs-clm-label-sel{float:left;padding-right:5px}.gjs-clm-tags{font-size:.75rem;padding:10px 5px}.gjs-clm-tags #gjs-clm-sel{padding:7px 0;float:left}.gjs-clm-tags #gjs-clm-sel{font-style:italic;margin-left:5px}.gjs-clm-tags #gjs-clm-tags-field{clear:both;padding:5px;margin-bottom:5px;display:flex;flex-wrap:wrap}.gjs-clm-tags #gjs-clm-tags-c{display:flex;flex-wrap:wrap;vertical-align:top;overflow:hidden}.gjs-clm-tags #gjs-clm-new{color:#ddd;padding:5px 6px;display:none}.gjs-clm-tags #gjs-clm-close{opacity:.85;filter:alpha(opacity=85);font-size:20px;line-height:0;cursor:pointer;color:rgba(255,255,255,.9)}.gjs-clm-tags #gjs-clm-close:hover{opacity:1;filter:alpha(opacity=100)}.gjs-clm-tags #gjs-clm-checkbox{color:rgba(255,255,255,.9);vertical-align:middle;cursor:pointer;font-size:9px}.gjs-clm-tags #gjs-clm-tag-label{flex-grow:1;text-overflow:ellipsis;overflow:hidden;padding:0 3px;cursor:text}.gjs-mdl-container{font-family:Helvetica,sans-serif;overflow-y:auto;position:fixed;background-color:rgba(0,0,0,.5);display:flex;top:0;left:0;right:0;bottom:0;z-index:100}.gjs-mdl-dialog{text-shadow:-1px -1px 0 rgba(0,0,0,.05);animation:gjs-slide-down .215s;margin:auto;max-width:850px;width:90%;border-radius:3px;font-weight:lighter;position:relative;z-index:2}.gjs-mdl-title{font-size:1rem}.gjs-mdl-btn-close{position:absolute;right:15px;top:5px}.gjs-mdl-active .gjs-mdl-dialog{animation:gjs-mdl-slide-down .216s}.gjs-mdl-header,.gjs-mdl-content{padding:10px 15px;clear:both}.gjs-mdl-header{position:relative;border-bottom:1px solid rgba(0,0,0,.2);padding:15px 15px 7px}.gjs-export-dl::after{content:"";clear:both;display:block;margin-bottom:10px}.gjs-dropzone{display:none;opacity:0;position:absolute;top:0;left:0;z-index:11;width:100%;height:100%;transition:opacity .25s;pointer-events:none}.gjs-dropzone-active .gjs-dropzone{display:block;opacity:1}.gjs-am-assets{height:290px;overflow:auto;clear:both;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:flex-start}.gjs-am-assets-header{padding:5px}.gjs-am-add-asset .gjs-am-add-field{width:70%;float:left}.gjs-am-add-asset button{width:25%;float:right}.gjs-am-preview-cont{position:relative;height:70px;width:30%;background-color:#444;border-radius:2px;float:left;overflow:hidden}.gjs-am-preview{position:absolute;background-position:center center;background-size:cover;background-repeat:no-repeat;height:100%;width:100%;z-index:1}.gjs-am-preview-bg{opacity:.5;filter:alpha(opacity=50);position:absolute;height:100%;width:100%;z-index:0}.gjs-am-dimensions{opacity:.5;filter:alpha(opacity=50);font-size:10px}.gjs-am-meta{width:70%;float:left;font-size:12px;padding:5px 0 0 5px;box-sizing:border-box}.gjs-am-meta>div{margin-bottom:5px}.gjs-am-close{cursor:pointer;position:absolute;right:5px;top:0;display:none}.gjs-am-asset{border-bottom:1px solid rgba(0,0,0,.2);padding:5px;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.gjs-am-asset:hover .gjs-am-close{display:block}.gjs-am-highlight{background-color:rgba(255,255,255,.1)}.gjs-am-assets-cont{background-color:rgba(0,0,0,.1);border-radius:3px;box-sizing:border-box;padding:10px;width:45%;float:right;height:325px;overflow:hidden}.gjs-am-file-uploader{width:55%;float:left}.gjs-am-file-uploader>form{background-color:rgba(0,0,0,.1);border:2px dashed;border-radius:3px;position:relative;text-align:center;margin-bottom:15px}.gjs-am-file-uploader>form.gjs-am-hover{border:2px solid #62c462;color:#75cb75}.gjs-am-file-uploader>form.gjs-am-disabled{border-color:red}.gjs-am-file-uploader>form #gjs-am-uploadFile{opacity:0;filter:alpha(opacity=0);padding:150px 10px;width:100%;box-sizing:border-box}.gjs-am-file-uploader #gjs-am-title{position:absolute;padding:150px 10px;width:100%}.gjs-cm-editor-c{float:left;box-sizing:border-box;width:50%}.gjs-cm-editor-c .CodeMirror{height:450px}.gjs-cm-editor{font-size:12px}.gjs-cm-editor#gjs-cm-htmlmixed{padding-right:10px;border-right:1px solid rgba(0,0,0,.2)}.gjs-cm-editor#gjs-cm-htmlmixed #gjs-cm-title{color:#a97d44}.gjs-cm-editor#gjs-cm-css{padding-left:10px}.gjs-cm-editor#gjs-cm-css #gjs-cm-title{color:#ddca7e}.gjs-cm-editor #gjs-cm-title{background-color:rgba(0,0,0,.2);font-size:12px;padding:5px 10px 3px;text-align:right}.gjs-rte-toolbar{border:1px solid rgba(0,0,0,.2);position:absolute;border-radius:3px;z-index:10}.gjs-rte-actionbar{display:flex}.gjs-rte-action{display:flex;align-items:center;justify-content:center;padding:5px;min-width:25px;border-right:1px solid rgba(0,0,0,.2);text-align:center;cursor:pointer;outline:none}.gjs-rte-action:last-child{border-right:none}.gjs-rte-action:hover{background-color:rgba(255,255,255,.1)}.gjs-rte-active{background-color:rgba(255,255,255,.1)}.gjs-rte-disabled{color:rgba(255,255,255,.1);cursor:not-allowed}.gjs-rte-disabled:hover{background-color:unset}.gjs-editor-cont .sp-hue,.gjs-editor-cont .sp-slider{cursor:row-resize}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-dragger{cursor:crosshair}.gjs-editor-cont .sp-alpha-inner,.gjs-editor-cont .sp-alpha-handle{cursor:col-resize}.gjs-editor-cont .sp-hue{left:90%}.gjs-editor-cont .sp-color{right:15%}.gjs-editor-cont .sp-container{border:1px solid rgba(0,0,0,.2);box-shadow:0 0 7px rgba(0,0,0,.2);border-radius:3px}.gjs-editor-cont .sp-picker-container{border:none}.gjs-editor-cont .colpick_dark .colpick_color{outline:1px solid rgba(0,0,0,.2)}.gjs-editor-cont .sp-cancel,.gjs-editor-cont .sp-cancel:hover{bottom:-8px;color:#777 !important;font-size:25px;left:0;position:absolute;text-decoration:none}.gjs-editor-cont .sp-alpha-handle{background-color:#ccc;border:1px solid #555;width:4px}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-hue{border:1px solid #333}.gjs-editor-cont .sp-slider{background-color:#ccc;border:1px solid #555;height:3px;left:-4px;width:22px}.gjs-editor-cont .sp-dragger{background:transparent;box-shadow:0 0 0 1px #111}.gjs-editor-cont .sp-button-container{float:none;width:100%;position:relative;text-align:right}.gjs-editor-cont .sp-container button,.gjs-editor-cont .sp-container button:hover,.gjs-editor-cont .sp-container button:active{background:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2);color:#ddd;text-shadow:none;box-shadow:none;padding:3px 5px}.gjs-editor-cont .sp-palette-container{border:none;float:none;margin:0;padding:5px 10px 0}.gjs-editor-cont .sp-palette .sp-thumb-el,.gjs-editor-cont .sp-palette .sp-thumb-el:hover{border:1px solid rgba(0,0,0,.9)}.gjs-editor-cont .sp-palette .sp-thumb-el:hover,.gjs-editor-cont .sp-palette .sp-thumb-el.sp-thumb-active{border-color:rgba(0,0,0,.9)}.gjs-hidden{display:none}@keyframes gjs-slide-down{0%{transform:translate(0, -3rem);opacity:0}100%{transform:translate(0, 0);opacity:1}}@keyframes gjs-slide-up{0%{transform:translate(0, 0);opacity:1}100%{transform:translate(0, -3rem);opacity:0}}.cm-s-hopscotch span.cm-error{color:#fff} diff --git a/src/style_manager/view/PropertyView.js b/src/style_manager/view/PropertyView.js index ccb0c6253..bd6561918 100644 --- a/src/style_manager/view/PropertyView.js +++ b/src/style_manager/view/PropertyView.js @@ -16,16 +16,18 @@ export default Backbone.View.extend({ }, templateLabel(model) { - const { pfx } = this; + const { pfx, em } = this; const { parent } = model; const { icon = '', info = '' } = model.attributes; const label = model.getLabel(); + const icons = em?.getConfig('icons'); + const iconClose = icons?.close || '⨯'; return ` ${label} - ${!parent ? `` : ''} + ${!parent ? `` : ''} `; }, diff --git a/src/styles/scss/_gjs_style_manager.scss b/src/styles/scss/_gjs_style_manager.scss index 9f70f8cc6..9774c4bdb 100644 --- a/src/styles/scss/_gjs_style_manager.scss +++ b/src/styles/scss/_gjs_style_manager.scss @@ -1,8 +1,11 @@ .#{$sm-prefix} { &clear { - line-height: 0; cursor: pointer; + width: 14px; + min-width: 14px; + height: 14px; + margin-left: 3px; } &header { @@ -22,6 +25,8 @@ &label { margin: 5px 5px 3px 0; + display: flex; + align-items: center; } } @@ -415,6 +420,7 @@ right: 0; top: -17px; opacity: 0.75; + padding: 0; width: 18px; height: 18px; From 0760d7ab81fbca2574364ea8c70d0a13f91aaaea Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 15:29:33 +0100 Subject: [PATCH 222/313] Update sector view layout --- dist/css/grapes.min.css | 2 +- src/editor/config/config.js | 1 + src/style_manager/view/SectorView.js | 16 +++++++--------- src/styles/scss/_gjs_style_manager.scss | 18 +++++++++++++++--- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/dist/css/grapes.min.css b/dist/css/grapes.min.css index 446320405..c77ca929e 100644 --- a/dist/css/grapes.min.css +++ b/dist/css/grapes.min.css @@ -1 +1 @@ -.sp-container{position:absolute;top:0;left:0;display:inline-block;*display:inline;*zoom:1;z-index:9999994;overflow:hidden}.sp-container.sp-flat{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{position:relative;width:100%;display:inline-block}.sp-top-inner{position:absolute;top:0;left:0;bottom:0;right:0}.sp-color{position:absolute;top:0;left:0;bottom:0;right:20%}.sp-hue{position:absolute;top:0;right:0;bottom:0;left:84%;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{position:absolute;top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{position:absolute;top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid black;background:white;opacity:.8}.sp-alpha{display:none;position:absolute;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:solid 1px #333}.sp-clear{display:none}.sp-clear.sp-clear-display{background-position:center}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0px;right:0;bottom:0;left:84%;height:28px}.sp-container,.sp-replacer,.sp-preview,.sp-dragger,.sp-slider,.sp-alpha,.sp-clear,.sp-alpha-handle,.sp-container.sp-dragging .sp-input,.sp-container button{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-input-disabled .sp-input-container{display:none}.sp-container.sp-buttons-disabled .sp-button-container{display:none}.sp-container.sp-palette-buttons-disabled .sp-palette-button-container{display:none}.sp-palette-only .sp-picker-container{display:none}.sp-palette-disabled .sp-palette-container{display:none}.sp-initial-disabled .sp-initial{display:none}.sp-sat{background-image:-webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:linear-gradient(to right, #fff, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr="#FFFFFFFF", endColorstr="#00CC9A81")}.sp-val{background-image:-webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:linear-gradient(to top, #000, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00CC9A81", endColorstr="#FF000000")}.sp-hue{background:-moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));background:-webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff0000", endColorstr="#ffff00")}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffff00", endColorstr="#00ff00")}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ff00", endColorstr="#00ffff")}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffff", endColorstr="#0000ff")}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0000ff", endColorstr="#ff00ff")}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff00ff", endColorstr="#ff0000")}.sp-hidden{display:none !important}.sp-cf:before,.sp-cf:after{content:"";display:table}.sp-cf:after{clear:both}.sp-cf{*zoom:1}@media(max-device-width: 480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;cursor:pointer;position:absolute;top:0;left:0}.sp-slider{position:absolute;top:0;cursor:pointer;height:3px;left:-1px;right:-1px;border:1px solid #000;background:white;opacity:.8}.sp-container{border-radius:0;background-color:#ececec;border:solid 1px #f0c49b;padding:0}.sp-container,.sp-container button,.sp-container input,.sp-color,.sp-hue,.sp-clear{font:normal 12px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-color,.sp-hue,.sp-clear{border:solid 1px #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container{width:100%}.sp-input{font-size:12px !important;border:1px inset;padding:4px 5px;margin:0;width:100%;background:transparent;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-picker-container,.sp-palette-container{float:left;position:relative;padding:10px;padding-bottom:300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:solid 1px #fff}.sp-palette-container{border-right:solid 1px #ccc}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;width:24px;height:15px;margin:3px;cursor:pointer;border:solid 2px transparent}.sp-palette .sp-thumb-el:hover,.sp-palette .sp-thumb-el.sp-thumb-active{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:solid 1px #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:center}.sp-palette-button-container,.sp-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;*zoom:1;*display:inline;border:solid 1px #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer:hover,.sp-replacer.sp-active{border-color:#f0c49b;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px}.sp-preview{position:relative;width:25px;height:20px;border:solid 1px #222;margin-right:5px;float:left;z-index:0}.sp-palette{*width:220px;max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:solid 1px #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top, #eeeeee, #cccccc);background-image:-moz-linear-gradient(top, #eeeeee, #cccccc);background-image:-ms-linear-gradient(top, #eeeeee, #cccccc);background-image:-o-linear-gradient(top, #eeeeee, #cccccc);background-image:linear-gradient(to bottom, #eeeeee, #cccccc);border:1px solid #ccc;border-bottom:1px solid #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top, #dddddd, #bbbbbb);background-image:-moz-linear-gradient(top, #dddddd, #bbbbbb);background-image:-ms-linear-gradient(top, #dddddd, #bbbbbb);background-image:-o-linear-gradient(top, #dddddd, #bbbbbb);background-image:linear-gradient(to bottom, #dddddd, #bbbbbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid #aaa;border-bottom:1px solid #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f !important;margin:0;padding:2px;margin-right:5px;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f !important;text-decoration:underline}.sp-palette span:hover,.sp-palette span.sp-thumb-active{border-color:#000}.sp-preview,.sp-alpha,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-preview-inner,.sp-alpha-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARn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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==)}.CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20, 255, 20, 0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:blue}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, 0.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, 0.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-hopscotch.CodeMirror{background:#322931;color:#d5d3d5}.cm-s-hopscotch div.CodeMirror-selected{background:#433b42 !important}.cm-s-hopscotch .CodeMirror-gutters{background:#322931;border-right:0px}.cm-s-hopscotch .CodeMirror-linenumber{color:#797379}.cm-s-hopscotch .CodeMirror-cursor{border-left:1px solid #989498 !important}.cm-s-hopscotch span.cm-comment{color:#b33508}.cm-s-hopscotch span.cm-atom{color:#c85e7c}.cm-s-hopscotch span.cm-number{color:#c85e7c}.cm-s-hopscotch span.cm-property,.cm-s-hopscotch span.cm-attribute{color:#8fc13e}.cm-s-hopscotch span.cm-keyword{color:#dd464c}.cm-s-hopscotch span.cm-string{color:#fdcc59}.cm-s-hopscotch span.cm-variable{color:#8fc13e}.cm-s-hopscotch span.cm-variable-2{color:#1290bf}.cm-s-hopscotch span.cm-def{color:#fd8b19}.cm-s-hopscotch span.cm-error{background:#dd464c;color:#989498}.cm-s-hopscotch span.cm-bracket{color:#d5d3d5}.cm-s-hopscotch span.cm-tag{color:#dd464c}.cm-s-hopscotch span.cm-link{color:#c85e7c}.cm-s-hopscotch .CodeMirror-matchingbracket{text-decoration:underline;color:white !important}.cm-s-hopscotch .CodeMirror-activeline-background{background:#302020}@font-face{font-family:"font3336";src:url("../fonts/main-fonts.eot?v=20");src:url("../fonts/main-fonts.woff?v=20") format("woff"),url("../fonts/main-fonts.ttf?v=20") format("truetype"),url("../fonts/main-fonts.svg?v=20") format("svg"),url("../fonts/main-fonts.eot?v=20") format("embedded-opentype");font-weight:normal;font-style:normal}.gjs-is__grab,.gjs-is__grab *{cursor:grab !important}.gjs-is__grabbing,.gjs-is__grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:grabbing !important}.gjs-one-bg{background-color:#444}.gjs-one-color{color:#444}.gjs-one-color-h:hover{color:#444}.gjs-two-bg{background-color:#ddd}.gjs-two-color{color:#ddd}.gjs-two-color-h:hover{color:#ddd}.gjs-three-bg{background-color:#804f7b}.gjs-three-color{color:#804f7b}.gjs-three-color-h:hover{color:#804f7b}.gjs-four-bg{background-color:#d278c9}.gjs-four-color{color:#d278c9}.gjs-four-color-h:hover{color:#d278c9}.gjs-danger-bg{background-color:#dd3636}.gjs-danger-color{color:#dd3636}.gjs-danger-color-h:hover{color:#dd3636}.gjs-bg-main,.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c,.gjs-off-prv{background-color:#444}.gjs-color-main,.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add,.gjs-off-prv{color:#ddd;fill:#ddd}.gjs-color-active{color:#f8f8f8;fill:#f8f8f8}.gjs-color-warn{color:#ffca6f;fill:#ffca6f}.gjs-color-hl{color:#71b7f1;fill:#71b7f1}.gjs-fonts::before{display:block;font:normal normal normal 14px font3336;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:5em}.gjs-f-b1::before{content:"Q"}.gjs-f-b2::before{content:"W"}.gjs-f-b3::before{content:"E"}.gjs-f-b37::before{content:"R"}.gjs-f-hero::before{content:"T"}.gjs-f-h1p::before{content:"y"}.gjs-f-3ba::before{content:"u"}.gjs-f-image::before{content:"I"}.gjs-f-text::before{content:"o"}.gjs-f-quo::before{content:"p"}.gjs-f-button::before{content:"B"}.gjs-f-divider::before{content:"D"}.gjs-invis-invis,.gjs-clm-tags #gjs-clm-new,.gjs-no-app{background-color:transparent;border:none;color:inherit}.gjs-no-app{height:10px}.gjs-test::btn{color:"#fff"}.opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-checker-bg,.gjs-field-colorp-c,.checker-bg,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==")}.gjs-no-user-select,.gjs-rte-toolbar,.gjs-layer-name,.gjs-grabbing,.gjs-grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-pointer-events,.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el,.gjs-resizer-c{pointer-events:none}.gjs-bdrag{pointer-events:none !important;position:absolute !important;z-index:10 !important;width:auto}.gjs-drag-helper{background-color:#3b97e3 !important;pointer-events:none !important;position:absolute !important;z-index:10 !important;transform:scale(0.3) !important;transform-origin:top left !important;-webkit-transform-origin:top left !important;margin:15px !important;transition:none !important;outline:none !important}.gjs-grabbing,.gjs-grabbing *{cursor:grabbing !important;cursor:-webkit-grabbing !important}.gjs-grabbing{overflow:hidden}.gjs-off-prv{position:relative;z-index:10;padding:5px;cursor:pointer}.gjs-editor-cont ::-webkit-scrollbar-track{background:rgba(0,0,0,.1)}.gjs-editor-cont ::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.2)}.gjs-editor-cont ::-webkit-scrollbar{width:8px}.clear{clear:both}.no-select,.gjs-clm-tags #gjs-clm-close,.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title,.gjs-com-no-select,.gjs-com-no-select img{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-touch-actions{touch-action:none}.gjs-disabled{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;opacity:.5;filter:alpha(opacity=50)}.gjs-editor{font-family:Helvetica,sans-serif;font-size:.75rem;position:relative;box-sizing:border-box;height:100%}.gjs-freezed,.gjs-freezed{opacity:.5;filter:alpha(opacity=50);pointer-events:none}.gjs-traits-label{border-bottom:1px solid rgba(0,0,0,.2);font-weight:lighter;margin-bottom:5px;padding:10px;text-align:left}.gjs-label-wrp{width:30%;min-width:30%}.gjs-field-wrp{flex-grow:1}.gjs-trt-header{font-weight:lighter;padding:10px}.gjs-trt-trait{display:flex;justify-content:flex-start;padding:5px 10px;font-weight:lighter;align-items:center;text-align:left}.gjs-trt-traits{font-size:.75rem}.gjs-trt-trait .gjs-label{text-align:left;text-overflow:ellipsis;overflow:hidden}.gjs-guide-info{position:absolute}.gjs-guide-info__content{position:absolute;height:100%;display:flex;width:100%;padding:5px}.gjs-guide-info__line{position:relative;margin:auto}.gjs-guide-info__line::before,.gjs-guide-info__line::after{content:"";display:block;position:absolute;background-color:inherit}.gjs-guide-info__y{padding:0 5px}.gjs-guide-info__y .gjs-guide-info__content{justify-content:center}.gjs-guide-info__y .gjs-guide-info__line{width:100%;height:1px}.gjs-guide-info__y .gjs-guide-info__line::before,.gjs-guide-info__y .gjs-guide-info__line::after{width:1px;height:10px;top:0;bottom:0;left:0;margin:auto}.gjs-guide-info__y .gjs-guide-info__line::after{left:auto;right:0}.gjs-guide-info__x{padding:5px 0}.gjs-guide-info__x .gjs-guide-info__content{align-items:center}.gjs-guide-info__x .gjs-guide-info__line{height:100%;width:1px}.gjs-guide-info__x .gjs-guide-info__line::before,.gjs-guide-info__x .gjs-guide-info__line::after{width:10px;height:1px;left:0;right:0;top:0;margin:auto;transform:translateX(-50%)}.gjs-guide-info__x .gjs-guide-info__line::after{top:auto;bottom:0}.gjs-badge{white-space:nowrap}.gjs-badge__icon{vertical-align:middle;display:inline-block;width:15px;height:15px}.gjs-badge__icon svg{fill:currentColor}.gjs-badge__name{display:inline-block;vertical-align:middle}.gjs-frame-wrapper{position:absolute;width:100%;height:100%;left:0;right:0;margin:auto}.gjs-frame-wrapper--anim{transition:width .35s ease,height .35s ease}.gjs-frame-wrapper__top{transform:translateY(-100%) translateX(-50%);display:flex;padding:5px 0;position:absolute;width:100%;left:50%;top:0}.gjs-frame-wrapper__top-r{margin-left:auto}.gjs-frame-wrapper__left{position:absolute;left:0;transform:translateX(-100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__bottom{position:absolute;bottom:0;transform:translateY(100%) translateX(-50%);width:100%;left:50%}.gjs-frame-wrapper__right{position:absolute;right:0;transform:translateX(100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__icon{width:24px;cursor:pointer}.gjs-frame-wrapper__icon>svg{fill:currentColor}.gjs-padding-v-top,.gjs-fixedpadding-v-top{width:100%;top:0;left:0}.gjs-padding-v-right,.gjs-fixedpadding-v-right{right:0}.gjs-padding-v-bottom,.gjs-fixedpadding-v-bottom{width:100%;left:0;bottom:0}.gjs-padding-v-left,.gjs-fixedpadding-v-left{left:0}.gjs-cv-canvas{background-color:rgba(0,0,0,.15);box-sizing:border-box;width:85%;height:calc(100% - 40px);bottom:0;overflow:hidden;z-index:1;position:absolute;left:0;top:40px}.gjs-cv-canvas.gjs-cui{width:100%;height:100%;top:0}.gjs-cv-canvas.gjs-is__grab .gjs-cv-canvas__frames,.gjs-cv-canvas.gjs-is__grabbing .gjs-cv-canvas__frames{pointer-events:none}.gjs-cv-canvas__frames{position:absolute;top:0;left:0;width:100%;height:100%}.gjs-cv-canvas .gjs-ghost{display:none;pointer-events:none;background-color:#5b5b5b;border:2px dashed #ccc;position:absolute;z-index:10;opacity:.55;filter:alpha(opacity=55)}.gjs-cv-canvas .gjs-highlighter,.gjs-cv-canvas .gjs-highlighter-sel{position:absolute;outline:1px solid #3b97e3;outline-offset:-1px;pointer-events:none;width:100%;height:100%}.gjs-cv-canvas .gjs-highlighter-warning{outline:3px solid #ffca6f}.gjs-cv-canvas .gjs-highlighter-sel{outline:2px solid #3b97e3;outline-offset:-2px}.gjs-cv-canvas #gjs-tools,.gjs-cv-canvas .gjs-tools{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;z-index:1}.gjs-cv-canvas *{box-sizing:border-box}.gjs-frame{outline:medium none;height:100%;width:100%;border:none;margin:auto;display:block;transition:width .35s ease,height .35s ease;position:absolute;top:0;bottom:0;left:0;right:0}.gjs-toolbar{position:absolute;background-color:#3b97e3;white-space:nowrap;color:#fff;z-index:10;top:0;left:0}.gjs-toolbar-item{padding:5px 7px;font-size:.8rem;cursor:pointer;width:26px;vertical-align:middle;display:inline-block}.gjs-toolbar-item svg{fill:currentColor;vertical-align:middle}.gjs-resizer-c{position:absolute;left:0;top:0;width:100%;height:100%;z-index:9}.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.1;filter:alpha(opacity=10);position:absolute;background-color:#ff0}.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.2;filter:alpha(opacity=20)}.gjs-padding-v-el,.gjs-fixedpadding-v-el{background-color:navy}.gjs-resizer-h{pointer-events:all;position:absolute;border:3px solid #3b97e3;width:10px;height:10px;background-color:#fff;margin:-5px}.gjs-resizer-h-tl{top:0;left:0;cursor:nwse-resize}.gjs-resizer-h-tr{top:0;right:0;cursor:nesw-resize}.gjs-resizer-h-tc{top:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-cl{left:0;margin:auto -5px;top:0;bottom:0;cursor:ew-resize}.gjs-resizer-h-cr{margin:auto -5px;top:0;bottom:0;right:0;cursor:ew-resize}.gjs-resizer-h-bl{bottom:0;left:0;cursor:nesw-resize}.gjs-resizer-h-bc{bottom:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-br{bottom:0;right:0;cursor:nwse-resize}.gjs-pn-panel .gjs-resizer-h{background-color:rgba(0,0,0,.2);border:none;opacity:0;transition:opacity .25s}.gjs-pn-panel .gjs-resizer-h:hover{opacity:1}.gjs-pn-panel .gjs-resizer-h-tc,.gjs-pn-panel .gjs-resizer-h-bc{margin:0 auto;width:100%}.gjs-pn-panel .gjs-resizer-h-cr,.gjs-pn-panel .gjs-resizer-h-cl{margin:auto 0;height:100%}.gjs-resizing .gjs-highlighter,.gjs-resizing .gjs-badge{display:none !important}.gjs-resizing-tl *{cursor:nwse-resize !important}.gjs-resizing-tr *{cursor:nesw-resize !important}.gjs-resizing-tc *{cursor:ns-resize !important}.gjs-resizing-cl *{cursor:ew-resize !important}.gjs-resizing-cr *{cursor:ew-resize !important}.gjs-resizing-bl *{cursor:nesw-resize !important}.gjs-resizing-bc *{cursor:ns-resize !important}.gjs-resizing-br *{cursor:nwse-resize !important}.btn-cl,.gjs-am-close,.gjs-mdl-btn-close{opacity:.3;filter:alpha(opacity=30);font-size:25px;cursor:pointer}.btn-cl:hover,.gjs-am-close:hover,.gjs-mdl-btn-close:hover{opacity:.7;filter:alpha(opacity=70)}.no-dots,.ui-resizable-handle{border:none !important;margin:0 !important;outline:none !important}.gjs-com-dashed *{outline:1px dashed #888;outline-offset:-2px;box-sizing:border-box}.gjs-cv-canvas .gjs-comp-selected{outline:3px solid #3b97e3 !important}*.gjs-com-hover,div.gjs-com-hover{outline:1px solid #3b97e3}*.gjs-com-hover-delete,div.gjs-com-hover-delete{outline:2px solid #dd3636;opacity:.5;filter:alpha(opacity=50)}*.gjs-com-hover-move,div.gjs-com-hover-move{outline:3px solid #ffca6f}.gjs-com-badge,.gjs-com-badge-red,.gjs-badge{pointer-events:none;background-color:#3b97e3;color:#fff;padding:2px 5px;position:absolute;z-index:1;font-size:12px;outline:none;display:none}.gjs-com-badge-red{background-color:#dd3636}.gjs-badge-warning{background-color:#ffca6f}.gjs-placeholder,.gjs-com-placeholder,.gjs-placeholder{position:absolute;z-index:10;pointer-events:none;display:none}.gjs-placeholder,.gjs-placeholder{border-style:solid !important;outline:none;box-sizing:border-box;transition:top .2s,left .2s,width .2s,height .2s}.gjs-placeholder.horizontal,.gjs-com-placeholder.horizontal,.gjs-placeholder.horizontal{border-color:transparent #62c462;border-width:3px 5px;margin:-3px 0 0}.gjs-placeholder.vertical,.gjs-com-placeholder.vertical,.gjs-placeholder.vertical{border-color:#62c462 transparent;border-width:5px 3px;margin:0 0 0 -3px}.gjs-placeholder-int,.gjs-com-placeholder-int,.gjs-placeholder-int{background-color:#62c462;box-shadow:0 0 3px rgba(0,0,0,.2);height:100%;width:100%;pointer-events:none;padding:1.5px;outline:none}.gjs-pn-panel{display:inline-block;position:absolute;box-sizing:border-box;text-align:center;padding:5px;z-index:3}.gjs-pn-panel .icon-undo,.gjs-pn-panel .icon-redo{font-size:20px;height:30px;width:25px}.gjs-pn-commands{width:85%;left:0;top:0;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-options{right:15%;top:0}.gjs-pn-views{border-bottom:2px solid rgba(0,0,0,.2);right:0;width:15%;z-index:4}.gjs-pn-views-container{height:100%;padding:42px 0 0;right:0;width:15%;overflow:auto;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-buttons{align-items:center;display:flex;justify-content:space-between}.gjs-pn-btn{box-sizing:border-box;min-height:30px;min-width:30px;line-height:21px;background-color:transparent;border:none;font-size:18px;margin-right:5px;border-radius:2px;padding:4px;position:relative;cursor:pointer}.gjs-pn-btn.gjs-pn-active{background-color:rgba(0,0,0,.15);box-shadow:0 0 3px rgba(0,0,0,.25) inset}.gjs-pn-btn svg{fill:currentColor}.gjs-comp-image-placeholder{display:block;background-color:#f5f5f5;color:#777;height:50px;width:50px;line-height:50px;outline:3px solid #ffca6f;outline-offset:-3px;text-align:center;font-size:16.6666666667px;cursor:pointer}.gjs-comp-image-placeholder.fa-picture-o::after{content:""}.gjs-label{line-height:18px}.gjs-fields{display:flex}.gjs-select{padding:0;width:100%}.gjs-select select{padding-right:10px}.gjs-select:-moz-focusring,.gjs-select select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-input:focus,.gjs-button:focus,.gjs-btn-prim:focus,.gjs-select:focus,.gjs-select select:focus{outline:none}.gjs-field input,.gjs-field select,.gjs-field textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:inherit;border:none;background-color:transparent;box-sizing:border-box;width:100%;position:relative;padding:5px;z-index:1}.gjs-field input:focus,.gjs-field select:focus,.gjs-field textarea:focus{outline:none}.gjs-field input[type=number]{-moz-appearance:textfield}.gjs-field input[type=number]::-webkit-outer-spin-button,.gjs-field input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gjs-field-range{flex:9 1 auto}.gjs-field-integer input{padding-right:30px}.gjs-select option,.gjs-field-select option,.gjs-clm-select option,.gjs-sm-select option,.gjs-fields option,.gjs-sm-unit option{background-color:#444;color:#ddd}.gjs-field{background-color:rgba(0,0,0,.2);border:none;box-shadow:none;border-radius:2px;box-sizing:border-box;padding:0;position:relative}.gjs-field textarea{resize:vertical}.gjs-field .gjs-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;z-index:0}.gjs-field .gjs-d-s-arrow{bottom:0;top:0;margin:auto;right:5px;border-top:4px solid rgba(255,255,255,.7);position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-field-arrows{position:absolute;cursor:ns-resize;margin:auto;height:20px;width:9px;z-index:10;bottom:0;right:3px;top:0}.gjs-field-color,.gjs-field-radio{width:100%}.gjs-field-color input{padding-right:22px;box-sizing:border-box}.gjs-field-colorp{border-left:1px solid rgba(0,0,0,.2);box-sizing:border-box;height:100%;padding:2px;position:absolute;right:0;top:0;width:22px;z-index:10}.gjs-field-colorp .gjs-checker-bg,.gjs-field-colorp .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-field-colorp-c{height:100%;position:relative;width:100%}.gjs-field-color-picker{background-color:#ddd;cursor:pointer;height:100%;width:100%;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px;position:absolute;top:0}.gjs-field-checkbox{padding:0;width:17px;height:17px;display:block;cursor:pointer}.gjs-field-checkbox input{display:none}.gjs-field-checkbox input:checked+.gjs-chk-icon{border-color:rgba(255,255,255,.5);border-width:0 2px 2px 0;border-style:solid}.gjs-radio-item{flex:1 1 auto;text-align:center;border-left:1px solid rgba(0,0,0,.2)}.gjs-radio-item:first-child{border:none}.gjs-radio-item:hover{background:rgba(0,0,0,.2)}.gjs-radio-item input{display:none}.gjs-radio-item input:checked+.gjs-radio-item-label{background-color:rgba(255,255,255,.2)}.gjs-radio-items{display:flex}.gjs-radio-item-label{cursor:pointer;display:block;padding:5px}.gjs-field-units{position:absolute;margin:auto;right:10px;bottom:0;top:0}.gjs-field-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-field-arrow-u,.gjs-field-arrow-d{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(255,255,255,.7);bottom:4px;cursor:pointer}.gjs-field-arrow-u{border-bottom:4px solid rgba(255,255,255,.7);border-top:none;top:4px}.gjs-field-select{padding:0}.gjs-field-range{background-color:transparent;border:none;box-shadow:none;padding:0}.gjs-field-range input{margin:0;height:100%}.gjs-field-range input:focus{outline:none}.gjs-field-range input::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-ms-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-webkit-slider-runnable-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-ms-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-btn-prim{color:inherit;background-color:rgba(255,255,255,.1);border-radius:2px;padding:3px 6px;padding:5px;cursor:pointer;border:none}.gjs-btn-prim:active{background-color:rgba(255,255,255,.1)}.gjs-btn--full{width:100%}.gjs-chk-icon{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);box-sizing:border-box;display:block;height:14px;margin:0 5px;width:6px}.gjs-add-trasp{background:none;border:none;color:#ddd;cursor:pointer;font-size:1em;border-radius:2px;opacity:.75;filter:alpha(opacity=75)}.gjs-add-trasp:hover{opacity:1;filter:alpha(opacity=100)}.gjs-add-trasp:active{background-color:rgba(0,0,0,.2)}.gjs-devices-c{display:flex;align-items:center;padding:3px}.gjs-devices-c .gjs-device-label{flex-grow:2;text-align:left;margin-right:10px}.gjs-devices-c .gjs-select{flex-grow:20}.gjs-devices-c .gjs-add-trasp{flex-grow:1;margin-left:5px}.gjs-category-open,.gjs-block-category.gjs-open,.gjs-sm-sector.gjs-sm-open,.gjs-sm-open.gjs-clm-tags{border-bottom:1px solid rgba(0,0,0,.25)}.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title{font-weight:lighter;background-color:rgba(0,0,0,.1);letter-spacing:1px;padding:9px 10px 9px 20px;border-bottom:1px solid rgba(0,0,0,.25);text-align:left;position:relative;cursor:pointer}.gjs-sm-clear{cursor:pointer;width:14px;min-width:14px;height:14px;margin-left:3px}.gjs-sm-header{font-weight:lighter;padding:10px}.gjs-sm-properties{font-size:.75rem;padding:10px 5px;display:flex;flex-wrap:wrap;align-items:flex-end;box-sizing:border-box;width:100%}.gjs-sm-label{margin:5px 5px 3px 0;display:flex;align-items:center}.gjs-sm-close-btn,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.2;filter:alpha(opacity=20)}.gjs-sm-close-btn:hover,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover{opacity:.7;filter:alpha(opacity=70)}.gjs-sm-sector,.gjs-clm-tags{clear:both;font-weight:lighter;text-align:left}.gjs-sm-sector #gjs-sm-caret,.gjs-clm-tags #gjs-sm-caret{padding-right:5px;font-size:11px}.gjs-sm-sector .gjs-sm-field,.gjs-clm-tags .gjs-sm-field,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-clm-field,.gjs-clm-tags .gjs-clm-field{width:100%;position:relative}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input,.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{background-color:transparent;color:rgba(255,255,255,.7);border:none;width:100%}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input{box-sizing:border-box}.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gjs-sm-sector .gjs-sm-field select::-ms-expand,.gjs-clm-tags .gjs-sm-field select::-ms-expand,.gjs-sm-sector .gjs-clm-select select::-ms-expand,.gjs-clm-tags .gjs-clm-select select::-ms-expand,.gjs-sm-sector .gjs-clm-field select::-ms-expand,.gjs-clm-tags .gjs-clm-field select::-ms-expand{display:none}.gjs-sm-sector .gjs-sm-field select:-moz-focusring,.gjs-clm-tags .gjs-sm-field select:-moz-focusring,.gjs-sm-sector .gjs-clm-select select:-moz-focusring,.gjs-clm-tags .gjs-clm-select select:-moz-focusring,.gjs-sm-sector .gjs-clm-field select:-moz-focusring,.gjs-clm-tags .gjs-clm-field select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-sm-sector .gjs-sm-field input:focus,.gjs-clm-tags .gjs-sm-field input:focus,.gjs-sm-sector .gjs-clm-select input:focus,.gjs-clm-tags .gjs-clm-select input:focus,.gjs-sm-sector .gjs-clm-field input:focus,.gjs-clm-tags .gjs-clm-field input:focus,.gjs-sm-sector .gjs-sm-field select:focus,.gjs-clm-tags .gjs-sm-field select:focus,.gjs-sm-sector .gjs-clm-select select:focus,.gjs-clm-tags .gjs-clm-select select:focus,.gjs-sm-sector .gjs-clm-field select:focus,.gjs-clm-tags .gjs-clm-field select:focus{outline:none}.gjs-sm-sector .gjs-sm-field .gjs-sm-unit,.gjs-clm-tags .gjs-sm-field .gjs-sm-unit,.gjs-sm-sector .gjs-clm-select .gjs-sm-unit,.gjs-clm-tags .gjs-clm-select .gjs-sm-unit,.gjs-sm-sector .gjs-clm-field .gjs-sm-unit,.gjs-clm-tags .gjs-clm-field .gjs-sm-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-sm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-select .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-select .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;cursor:ns-resize}.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{border-bottom:4px solid rgba(255,255,255,.7);top:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{border-top:4px solid rgba(255,255,255,.7);bottom:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{bottom:7px}.gjs-sm-sector .gjs-sm-field.gjs-sm-color,.gjs-clm-tags .gjs-sm-field.gjs-sm-color,.gjs-sm-sector .gjs-sm-color.gjs-clm-field,.gjs-clm-tags .gjs-sm-color.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-input,.gjs-clm-tags .gjs-sm-field.gjs-sm-input,.gjs-sm-sector .gjs-sm-input.gjs-clm-field,.gjs-clm-tags .gjs-sm-input.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-integer,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{background-color:rgba(0,0,0,.2);border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 0 rgba(255,255,255,.1);color:rgba(255,255,255,.7);border-radius:2px;box-sizing:border-box;padding:0 5px}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{border-radius:2px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{padding:0}.gjs-sm-sector .gjs-sm-field.gjs-sm-select select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field select,.gjs-clm-tags .gjs-sm-select.gjs-clm-field select{height:20px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select option,.gjs-clm-tags .gjs-sm-field.gjs-sm-select option,.gjs-sm-sector .gjs-clm-select option,.gjs-clm-tags .gjs-clm-select option,.gjs-sm-sector .gjs-sm-select.gjs-clm-field option,.gjs-clm-tags .gjs-sm-select.gjs-clm-field option{padding:3px 0}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{background-color:rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.25)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-select,.gjs-clm-tags .gjs-sm-list.gjs-clm-select,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field{width:auto;padding:0;overflow:hidden;float:left}.gjs-sm-sector .gjs-sm-field.gjs-sm-list input,.gjs-clm-tags .gjs-sm-field.gjs-sm-list input,.gjs-sm-sector .gjs-sm-list.gjs-clm-select input,.gjs-clm-tags .gjs-sm-list.gjs-clm-select input,.gjs-sm-sector .gjs-sm-list.gjs-clm-field input,.gjs-clm-tags .gjs-sm-list.gjs-clm-field input{display:none}.gjs-sm-sector .gjs-sm-field.gjs-sm-list label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field label{cursor:pointer;padding:5px;display:block}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label{background-color:rgba(255,255,255,.2)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-icon{background-repeat:no-repeat;background-position:center;text-shadow:none;line-height:normal}.gjs-sm-sector .gjs-sm-field.gjs-sm-integer select,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-select select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-select select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field select{width:auto;padding:0}.gjs-sm-sector .gjs-sm-list .gjs-sm-el,.gjs-clm-tags .gjs-sm-list .gjs-sm-el{float:left;border-left:1px solid rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:first-child,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:first-child{border:none}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:hover,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:hover{background:rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-slider .gjs-field-integer,.gjs-clm-tags .gjs-sm-slider .gjs-field-integer{flex:1 1 65px}.gjs-sm-sector .gjs-sm-property,.gjs-clm-tags .gjs-sm-property{box-sizing:border-box;float:left;width:50%;margin-bottom:5px;padding:0 5px}.gjs-sm-sector .gjs-sm-property--full,.gjs-clm-tags .gjs-sm-property--full,.gjs-sm-sector .gjs-sm-property.gjs-sm-composite,.gjs-clm-tags .gjs-sm-property.gjs-sm-composite,.gjs-sm-sector .gjs-sm-property.gjs-sm-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file,.gjs-sm-sector .gjs-sm-property.gjs-sm-list,.gjs-clm-tags .gjs-sm-property.gjs-sm-list,.gjs-sm-sector .gjs-sm-property.gjs-sm-stack,.gjs-clm-tags .gjs-sm-property.gjs-sm-stack,.gjs-sm-sector .gjs-sm-property.gjs-sm-slider,.gjs-clm-tags .gjs-sm-property.gjs-sm-slider,.gjs-sm-sector .gjs-sm-property.gjs-sm-color,.gjs-clm-tags .gjs-sm-property.gjs-sm-color{width:100%}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn{background-color:rgba(33,33,33,.2);border-radius:2px;box-shadow:1px 1px 0 rgba(5,5,5,.2),1px 1px 0 rgba(43,43,43,.2) inset;padding:5px;position:relative;text-align:center;height:auto;width:100%;cursor:pointer;color:#ddd;box-sizing:border-box;text-shadow:-1px -1px 0 rgba(0,0,0,.2);border:none;opacity:.85;filter:alpha(opacity=85)}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn-c,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn-c{box-sizing:border-box;float:left;width:100%}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box{background-color:rgba(255,255,255,.05);border-radius:2px;margin-top:5px;position:relative;overflow:hidden}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show{border:1px solid rgba(252,252,252,.05);padding:3px 20px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{top:-5px;display:block}.gjs-sm-sector .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file{height:50px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file{background-size:auto 100%;background-repeat:no-repeat;background-position:center center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layers,.gjs-clm-tags .gjs-sm-property .gjs-sm-layers{margin-top:5px;padding:1px 3px;min-height:30px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer{background-color:rgba(255,255,255,.055);border-radius:2px;margin:2px 0;padding:7px;position:relative}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer.gjs-sm-active,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer.gjs-sm-active{background-color:rgba(255,255,255,.12)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp{display:flex;align-items:center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-move,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-move{height:14px;width:14px;min-width:14px;cursor:grab}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-label,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-label{flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0 5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{height:15px;width:15px;min-width:15px;margin-right:5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview{background-color:#fff;height:100%;width:100%;background-size:cover !important}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{border-radius:2px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer{display:block;cursor:pointer;height:14px;width:14px;min-width:14px;opacity:.5;filter:alpha(opacity=50)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover{opacity:.8;filter:alpha(opacity=80)}.gjs-sm-sector #gjs-sm-text-shadow #gjs-sm-preview::after,.gjs-clm-tags #gjs-sm-text-shadow #gjs-sm-preview::after{color:#000;content:"T";font-weight:900;line-height:17px;padding:0 4px}.gjs-sm-sector .gjs-sm-stack .gjs-sm-properties,.gjs-clm-tags .gjs-sm-stack .gjs-sm-properties{padding:5px 0 0}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add{background:none;border:none;cursor:pointer;outline:none;position:absolute;right:0;top:-17px;opacity:.75;padding:0;width:18px;height:18px}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add:hover,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add:hover{opacity:1;filter:alpha(opacity=100)}.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c{height:100%;width:20px;position:absolute;right:0;top:0;box-sizing:border-box;border-radius:2px;padding:2px}.gjs-sm-sector .gjs-sm-colorp-c .gjs-checker-bg,.gjs-clm-tags .gjs-sm-colorp-c .gjs-checker-bg,.gjs-sm-sector .gjs-sm-colorp-c .gjs-field-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-sm-sector .gjs-sm-color-picker,.gjs-clm-tags .gjs-sm-color-picker{background-color:#ddd;cursor:pointer;height:16px;width:100%;margin-top:-16px;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-upload,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-upload{left:0;top:0;position:absolute;width:100%;opacity:0;cursor:pointer}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-label,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-label{padding:2px 0}.gjs-sm-layer>#gjs-sm-move{opacity:.7;filter:alpha(opacity=70);cursor:move;font-size:12px;float:left;margin:0 5px 0 0}.gjs-sm-layer>#gjs-sm-move:hover{opacity:.9;filter:alpha(opacity=90)}.gjs-blocks-c{display:flex;flex-wrap:wrap;justify-content:flex-start}.gjs-block-categories{display:flex;flex-direction:column}.gjs-block-category{width:100%}.gjs-block-category .gjs-caret-icon{margin-right:5px}.gjs-block{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;width:45%;min-width:45px;padding:1em;box-sizing:border-box;min-height:90px;cursor:all-scroll;font-size:11px;font-weight:lighter;text-align:center;display:flex;flex-direction:column;justify-content:space-between;border:1px solid rgba(0,0,0,.2);border-radius:3px;margin:10px 2.5% 5px;box-shadow:0 1px 0 0 rgba(0,0,0,.15);transition:all .2s ease 0s;transition-property:box-shadow,color}.gjs-block:hover{box-shadow:0 3px 4px 0 rgba(0,0,0,.15)}.gjs-block svg{fill:currentColor}.gjs-block__media{margin-bottom:10px;pointer-events:none}.gjs-block-svg{width:54px;fill:currentColor}.gjs-block-svg-path{fill:currentColor}.gjs-block.fa{font-size:2em;line-height:2em;padding:11px}.gjs-block-label{line-height:normal;font-size:.65rem;font-weight:normal;font-family:Helvetica,sans-serif;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.gjs-block.gjs-bdrag{width:auto;padding:0}.gjs-selected-parent{border:1px solid #ffca6f}.gjs-opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-layer{font-weight:lighter;text-align:left;position:relative;background-color:rgba(0,0,0,.1);font-size:.75rem;display:grid}.gjs-layer-hidden{opacity:.55;filter:alpha(opacity=55)}.gjs-layer-count{position:absolute;right:27px;top:9px}.gjs-layer-vis{height:auto !important;width:auto !important;left:0;top:0;padding:7px 5px 7px 10px;position:absolute;cursor:pointer;z-index:1}.gjs-layer-caret{font-size:.5rem;width:8px;padding:2px;cursor:pointer;position:absolute;left:-9px;top:6px;opacity:.7;filter:alpha(opacity=70)}.gjs-layer-caret:hover{opacity:1;filter:alpha(opacity=100)}.gjs-layer-title{padding:3px 10px 5px 30px;display:flex;align-items:center}.gjs-layer-title-inn{align-items:center;position:relative;display:flex;width:100%}.gjs-layer__icon{display:block;width:100%;max-width:15px;max-height:15px;padding-left:5px}.gjs-layer__icon svg{fill:currentColor}.gjs-layer-name{padding:5px 0;display:inline-block;box-sizing:content-box;overflow:hidden;white-space:nowrap;margin:0 30px 0 5px}.gjs-layer-name--no-edit{text-overflow:ellipsis}.gjs-layer>.gjs-layer-children{display:none}.gjs-layer.open>.gjs-layer-children{display:block}.gjs-layer-no-chld>.gjs-layer-title-inn>.gjs-layer-caret{display:none}.gjs-layer-move{padding:7px 10px 7px 5px;position:absolute;font-size:12px;cursor:move;right:0;top:0}.gjs-layer.gjs-hovered .gjs-layer-title{background-color:rgba(255,255,255,.015)}.gjs-layer.gjs-selected .gjs-layer-title{background-color:rgba(255,255,255,.1)}.gjs-layers{position:relative;height:100%}.gjs-layers #gjs-placeholder{width:100%;position:absolute}.gjs-layers #gjs-placeholder #gjs-plh-int{height:100%;padding:1px}.gjs-layers #gjs-placeholder #gjs-plh-int.gjs-insert{background-color:#62c462}#gjs-clm-add-tag,.gjs-clm-tags-btn{background-color:rgba(255,255,255,.15);border-radius:2px;padding:3px;margin-right:3px;border:1px solid rgba(0,0,0,.15);width:24px;height:24px;box-sizing:border-box;cursor:pointer}.gjs-clm-tags-btn svg{fill:currentColor;display:block}.gjs-clm-header{display:flex;align-items:center;margin:7px 0}.gjs-clm-header-status{flex-shrink:1;margin-left:auto}.gjs-clm-tag{display:flex;overflow:hidden;align-items:center;border-radius:3px;margin:0 3px 3px 0;padding:5px;cursor:default}.gjs-clm-tag-status,.gjs-clm-tag-close{width:12px;height:12px;flex-shrink:1}.gjs-clm-tag-status svg,.gjs-clm-tag-close svg{vertical-align:middle;fill:currentColor}.gjs-clm-sels-info{margin:7px 0}.gjs-clm-sel-id{font-size:.9em;opacity:.5;filter:alpha(opacity=50)}.gjs-clm-label-sel{float:left;padding-right:5px}.gjs-clm-tags{font-size:.75rem;padding:10px 5px}.gjs-clm-tags #gjs-clm-sel{padding:7px 0;float:left}.gjs-clm-tags #gjs-clm-sel{font-style:italic;margin-left:5px}.gjs-clm-tags #gjs-clm-tags-field{clear:both;padding:5px;margin-bottom:5px;display:flex;flex-wrap:wrap}.gjs-clm-tags #gjs-clm-tags-c{display:flex;flex-wrap:wrap;vertical-align:top;overflow:hidden}.gjs-clm-tags #gjs-clm-new{color:#ddd;padding:5px 6px;display:none}.gjs-clm-tags #gjs-clm-close{opacity:.85;filter:alpha(opacity=85);font-size:20px;line-height:0;cursor:pointer;color:rgba(255,255,255,.9)}.gjs-clm-tags #gjs-clm-close:hover{opacity:1;filter:alpha(opacity=100)}.gjs-clm-tags #gjs-clm-checkbox{color:rgba(255,255,255,.9);vertical-align:middle;cursor:pointer;font-size:9px}.gjs-clm-tags #gjs-clm-tag-label{flex-grow:1;text-overflow:ellipsis;overflow:hidden;padding:0 3px;cursor:text}.gjs-mdl-container{font-family:Helvetica,sans-serif;overflow-y:auto;position:fixed;background-color:rgba(0,0,0,.5);display:flex;top:0;left:0;right:0;bottom:0;z-index:100}.gjs-mdl-dialog{text-shadow:-1px -1px 0 rgba(0,0,0,.05);animation:gjs-slide-down .215s;margin:auto;max-width:850px;width:90%;border-radius:3px;font-weight:lighter;position:relative;z-index:2}.gjs-mdl-title{font-size:1rem}.gjs-mdl-btn-close{position:absolute;right:15px;top:5px}.gjs-mdl-active .gjs-mdl-dialog{animation:gjs-mdl-slide-down .216s}.gjs-mdl-header,.gjs-mdl-content{padding:10px 15px;clear:both}.gjs-mdl-header{position:relative;border-bottom:1px solid rgba(0,0,0,.2);padding:15px 15px 7px}.gjs-export-dl::after{content:"";clear:both;display:block;margin-bottom:10px}.gjs-dropzone{display:none;opacity:0;position:absolute;top:0;left:0;z-index:11;width:100%;height:100%;transition:opacity .25s;pointer-events:none}.gjs-dropzone-active .gjs-dropzone{display:block;opacity:1}.gjs-am-assets{height:290px;overflow:auto;clear:both;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:flex-start}.gjs-am-assets-header{padding:5px}.gjs-am-add-asset .gjs-am-add-field{width:70%;float:left}.gjs-am-add-asset button{width:25%;float:right}.gjs-am-preview-cont{position:relative;height:70px;width:30%;background-color:#444;border-radius:2px;float:left;overflow:hidden}.gjs-am-preview{position:absolute;background-position:center center;background-size:cover;background-repeat:no-repeat;height:100%;width:100%;z-index:1}.gjs-am-preview-bg{opacity:.5;filter:alpha(opacity=50);position:absolute;height:100%;width:100%;z-index:0}.gjs-am-dimensions{opacity:.5;filter:alpha(opacity=50);font-size:10px}.gjs-am-meta{width:70%;float:left;font-size:12px;padding:5px 0 0 5px;box-sizing:border-box}.gjs-am-meta>div{margin-bottom:5px}.gjs-am-close{cursor:pointer;position:absolute;right:5px;top:0;display:none}.gjs-am-asset{border-bottom:1px solid rgba(0,0,0,.2);padding:5px;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.gjs-am-asset:hover .gjs-am-close{display:block}.gjs-am-highlight{background-color:rgba(255,255,255,.1)}.gjs-am-assets-cont{background-color:rgba(0,0,0,.1);border-radius:3px;box-sizing:border-box;padding:10px;width:45%;float:right;height:325px;overflow:hidden}.gjs-am-file-uploader{width:55%;float:left}.gjs-am-file-uploader>form{background-color:rgba(0,0,0,.1);border:2px dashed;border-radius:3px;position:relative;text-align:center;margin-bottom:15px}.gjs-am-file-uploader>form.gjs-am-hover{border:2px solid #62c462;color:#75cb75}.gjs-am-file-uploader>form.gjs-am-disabled{border-color:red}.gjs-am-file-uploader>form #gjs-am-uploadFile{opacity:0;filter:alpha(opacity=0);padding:150px 10px;width:100%;box-sizing:border-box}.gjs-am-file-uploader #gjs-am-title{position:absolute;padding:150px 10px;width:100%}.gjs-cm-editor-c{float:left;box-sizing:border-box;width:50%}.gjs-cm-editor-c .CodeMirror{height:450px}.gjs-cm-editor{font-size:12px}.gjs-cm-editor#gjs-cm-htmlmixed{padding-right:10px;border-right:1px solid rgba(0,0,0,.2)}.gjs-cm-editor#gjs-cm-htmlmixed #gjs-cm-title{color:#a97d44}.gjs-cm-editor#gjs-cm-css{padding-left:10px}.gjs-cm-editor#gjs-cm-css #gjs-cm-title{color:#ddca7e}.gjs-cm-editor #gjs-cm-title{background-color:rgba(0,0,0,.2);font-size:12px;padding:5px 10px 3px;text-align:right}.gjs-rte-toolbar{border:1px solid rgba(0,0,0,.2);position:absolute;border-radius:3px;z-index:10}.gjs-rte-actionbar{display:flex}.gjs-rte-action{display:flex;align-items:center;justify-content:center;padding:5px;min-width:25px;border-right:1px solid rgba(0,0,0,.2);text-align:center;cursor:pointer;outline:none}.gjs-rte-action:last-child{border-right:none}.gjs-rte-action:hover{background-color:rgba(255,255,255,.1)}.gjs-rte-active{background-color:rgba(255,255,255,.1)}.gjs-rte-disabled{color:rgba(255,255,255,.1);cursor:not-allowed}.gjs-rte-disabled:hover{background-color:unset}.gjs-editor-cont .sp-hue,.gjs-editor-cont .sp-slider{cursor:row-resize}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-dragger{cursor:crosshair}.gjs-editor-cont .sp-alpha-inner,.gjs-editor-cont .sp-alpha-handle{cursor:col-resize}.gjs-editor-cont .sp-hue{left:90%}.gjs-editor-cont .sp-color{right:15%}.gjs-editor-cont .sp-container{border:1px solid rgba(0,0,0,.2);box-shadow:0 0 7px rgba(0,0,0,.2);border-radius:3px}.gjs-editor-cont .sp-picker-container{border:none}.gjs-editor-cont .colpick_dark .colpick_color{outline:1px solid rgba(0,0,0,.2)}.gjs-editor-cont .sp-cancel,.gjs-editor-cont .sp-cancel:hover{bottom:-8px;color:#777 !important;font-size:25px;left:0;position:absolute;text-decoration:none}.gjs-editor-cont .sp-alpha-handle{background-color:#ccc;border:1px solid #555;width:4px}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-hue{border:1px solid #333}.gjs-editor-cont .sp-slider{background-color:#ccc;border:1px solid #555;height:3px;left:-4px;width:22px}.gjs-editor-cont .sp-dragger{background:transparent;box-shadow:0 0 0 1px #111}.gjs-editor-cont .sp-button-container{float:none;width:100%;position:relative;text-align:right}.gjs-editor-cont .sp-container button,.gjs-editor-cont .sp-container button:hover,.gjs-editor-cont .sp-container button:active{background:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2);color:#ddd;text-shadow:none;box-shadow:none;padding:3px 5px}.gjs-editor-cont .sp-palette-container{border:none;float:none;margin:0;padding:5px 10px 0}.gjs-editor-cont .sp-palette .sp-thumb-el,.gjs-editor-cont .sp-palette .sp-thumb-el:hover{border:1px solid rgba(0,0,0,.9)}.gjs-editor-cont .sp-palette .sp-thumb-el:hover,.gjs-editor-cont .sp-palette .sp-thumb-el.sp-thumb-active{border-color:rgba(0,0,0,.9)}.gjs-hidden{display:none}@keyframes gjs-slide-down{0%{transform:translate(0, -3rem);opacity:0}100%{transform:translate(0, 0);opacity:1}}@keyframes gjs-slide-up{0%{transform:translate(0, 0);opacity:1}100%{transform:translate(0, -3rem);opacity:0}}.cm-s-hopscotch span.cm-error{color:#fff} +.sp-container{position:absolute;top:0;left:0;display:inline-block;*display:inline;*zoom:1;z-index:9999994;overflow:hidden}.sp-container.sp-flat{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{position:relative;width:100%;display:inline-block}.sp-top-inner{position:absolute;top:0;left:0;bottom:0;right:0}.sp-color{position:absolute;top:0;left:0;bottom:0;right:20%}.sp-hue{position:absolute;top:0;right:0;bottom:0;left:84%;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{position:absolute;top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{position:absolute;top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid black;background:white;opacity:.8}.sp-alpha{display:none;position:absolute;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:solid 1px #333}.sp-clear{display:none}.sp-clear.sp-clear-display{background-position:center}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0px;right:0;bottom:0;left:84%;height:28px}.sp-container,.sp-replacer,.sp-preview,.sp-dragger,.sp-slider,.sp-alpha,.sp-clear,.sp-alpha-handle,.sp-container.sp-dragging .sp-input,.sp-container button{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-input-disabled .sp-input-container{display:none}.sp-container.sp-buttons-disabled .sp-button-container{display:none}.sp-container.sp-palette-buttons-disabled .sp-palette-button-container{display:none}.sp-palette-only .sp-picker-container{display:none}.sp-palette-disabled .sp-palette-container{display:none}.sp-initial-disabled .sp-initial{display:none}.sp-sat{background-image:-webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:linear-gradient(to right, #fff, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr="#FFFFFFFF", endColorstr="#00CC9A81")}.sp-val{background-image:-webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:linear-gradient(to top, #000, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00CC9A81", endColorstr="#FF000000")}.sp-hue{background:-moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));background:-webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff0000", endColorstr="#ffff00")}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffff00", endColorstr="#00ff00")}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ff00", endColorstr="#00ffff")}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffff", endColorstr="#0000ff")}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0000ff", endColorstr="#ff00ff")}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff00ff", endColorstr="#ff0000")}.sp-hidden{display:none !important}.sp-cf:before,.sp-cf:after{content:"";display:table}.sp-cf:after{clear:both}.sp-cf{*zoom:1}@media(max-device-width: 480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;cursor:pointer;position:absolute;top:0;left:0}.sp-slider{position:absolute;top:0;cursor:pointer;height:3px;left:-1px;right:-1px;border:1px solid #000;background:white;opacity:.8}.sp-container{border-radius:0;background-color:#ececec;border:solid 1px #f0c49b;padding:0}.sp-container,.sp-container button,.sp-container input,.sp-color,.sp-hue,.sp-clear{font:normal 12px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-color,.sp-hue,.sp-clear{border:solid 1px #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container{width:100%}.sp-input{font-size:12px !important;border:1px inset;padding:4px 5px;margin:0;width:100%;background:transparent;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-picker-container,.sp-palette-container{float:left;position:relative;padding:10px;padding-bottom:300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:solid 1px #fff}.sp-palette-container{border-right:solid 1px #ccc}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;width:24px;height:15px;margin:3px;cursor:pointer;border:solid 2px transparent}.sp-palette .sp-thumb-el:hover,.sp-palette .sp-thumb-el.sp-thumb-active{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:solid 1px #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:center}.sp-palette-button-container,.sp-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;*zoom:1;*display:inline;border:solid 1px #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer:hover,.sp-replacer.sp-active{border-color:#f0c49b;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px}.sp-preview{position:relative;width:25px;height:20px;border:solid 1px #222;margin-right:5px;float:left;z-index:0}.sp-palette{*width:220px;max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:solid 1px #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top, #eeeeee, #cccccc);background-image:-moz-linear-gradient(top, #eeeeee, #cccccc);background-image:-ms-linear-gradient(top, #eeeeee, #cccccc);background-image:-o-linear-gradient(top, #eeeeee, #cccccc);background-image:linear-gradient(to bottom, #eeeeee, #cccccc);border:1px solid #ccc;border-bottom:1px solid #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top, #dddddd, #bbbbbb);background-image:-moz-linear-gradient(top, #dddddd, #bbbbbb);background-image:-ms-linear-gradient(top, #dddddd, #bbbbbb);background-image:-o-linear-gradient(top, #dddddd, #bbbbbb);background-image:linear-gradient(to bottom, #dddddd, #bbbbbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid #aaa;border-bottom:1px solid #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f !important;margin:0;padding:2px;margin-right:5px;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f !important;text-decoration:underline}.sp-palette span:hover,.sp-palette span.sp-thumb-active{border-color:#000}.sp-preview,.sp-alpha,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-preview-inner,.sp-alpha-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==)}.CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20, 255, 20, 0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:blue}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, 0.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, 0.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-hopscotch.CodeMirror{background:#322931;color:#d5d3d5}.cm-s-hopscotch div.CodeMirror-selected{background:#433b42 !important}.cm-s-hopscotch .CodeMirror-gutters{background:#322931;border-right:0px}.cm-s-hopscotch .CodeMirror-linenumber{color:#797379}.cm-s-hopscotch .CodeMirror-cursor{border-left:1px solid #989498 !important}.cm-s-hopscotch span.cm-comment{color:#b33508}.cm-s-hopscotch span.cm-atom{color:#c85e7c}.cm-s-hopscotch span.cm-number{color:#c85e7c}.cm-s-hopscotch span.cm-property,.cm-s-hopscotch span.cm-attribute{color:#8fc13e}.cm-s-hopscotch span.cm-keyword{color:#dd464c}.cm-s-hopscotch span.cm-string{color:#fdcc59}.cm-s-hopscotch span.cm-variable{color:#8fc13e}.cm-s-hopscotch span.cm-variable-2{color:#1290bf}.cm-s-hopscotch span.cm-def{color:#fd8b19}.cm-s-hopscotch span.cm-error{background:#dd464c;color:#989498}.cm-s-hopscotch span.cm-bracket{color:#d5d3d5}.cm-s-hopscotch span.cm-tag{color:#dd464c}.cm-s-hopscotch span.cm-link{color:#c85e7c}.cm-s-hopscotch .CodeMirror-matchingbracket{text-decoration:underline;color:white !important}.cm-s-hopscotch .CodeMirror-activeline-background{background:#302020}@font-face{font-family:"font3336";src:url("../fonts/main-fonts.eot?v=20");src:url("../fonts/main-fonts.woff?v=20") format("woff"),url("../fonts/main-fonts.ttf?v=20") format("truetype"),url("../fonts/main-fonts.svg?v=20") format("svg"),url("../fonts/main-fonts.eot?v=20") format("embedded-opentype");font-weight:normal;font-style:normal}.gjs-is__grab,.gjs-is__grab *{cursor:grab !important}.gjs-is__grabbing,.gjs-is__grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:grabbing !important}.gjs-one-bg{background-color:#444}.gjs-one-color{color:#444}.gjs-one-color-h:hover{color:#444}.gjs-two-bg{background-color:#ddd}.gjs-two-color{color:#ddd}.gjs-two-color-h:hover{color:#ddd}.gjs-three-bg{background-color:#804f7b}.gjs-three-color{color:#804f7b}.gjs-three-color-h:hover{color:#804f7b}.gjs-four-bg{background-color:#d278c9}.gjs-four-color{color:#d278c9}.gjs-four-color-h:hover{color:#d278c9}.gjs-danger-bg{background-color:#dd3636}.gjs-danger-color{color:#dd3636}.gjs-danger-color-h:hover{color:#dd3636}.gjs-bg-main,.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c,.gjs-off-prv{background-color:#444}.gjs-color-main,.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add,.gjs-off-prv{color:#ddd;fill:#ddd}.gjs-color-active{color:#f8f8f8;fill:#f8f8f8}.gjs-color-warn{color:#ffca6f;fill:#ffca6f}.gjs-color-hl{color:#71b7f1;fill:#71b7f1}.gjs-fonts::before{display:block;font:normal normal normal 14px font3336;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:5em}.gjs-f-b1::before{content:"Q"}.gjs-f-b2::before{content:"W"}.gjs-f-b3::before{content:"E"}.gjs-f-b37::before{content:"R"}.gjs-f-hero::before{content:"T"}.gjs-f-h1p::before{content:"y"}.gjs-f-3ba::before{content:"u"}.gjs-f-image::before{content:"I"}.gjs-f-text::before{content:"o"}.gjs-f-quo::before{content:"p"}.gjs-f-button::before{content:"B"}.gjs-f-divider::before{content:"D"}.gjs-invis-invis,.gjs-clm-tags #gjs-clm-new,.gjs-no-app{background-color:transparent;border:none;color:inherit}.gjs-no-app{height:10px}.gjs-test::btn{color:"#fff"}.opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-checker-bg,.gjs-field-colorp-c,.checker-bg,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==")}.gjs-no-user-select,.gjs-rte-toolbar,.gjs-layer-name,.gjs-grabbing,.gjs-grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-pointer-events,.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el,.gjs-resizer-c{pointer-events:none}.gjs-bdrag{pointer-events:none !important;position:absolute !important;z-index:10 !important;width:auto}.gjs-drag-helper{background-color:#3b97e3 !important;pointer-events:none !important;position:absolute !important;z-index:10 !important;transform:scale(0.3) !important;transform-origin:top left !important;-webkit-transform-origin:top left !important;margin:15px !important;transition:none !important;outline:none !important}.gjs-grabbing,.gjs-grabbing *{cursor:grabbing !important;cursor:-webkit-grabbing !important}.gjs-grabbing{overflow:hidden}.gjs-off-prv{position:relative;z-index:10;padding:5px;cursor:pointer}.gjs-editor-cont ::-webkit-scrollbar-track{background:rgba(0,0,0,.1)}.gjs-editor-cont ::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.2)}.gjs-editor-cont ::-webkit-scrollbar{width:8px}.clear{clear:both}.no-select,.gjs-clm-tags #gjs-clm-close,.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title,.gjs-com-no-select,.gjs-com-no-select img{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-touch-actions{touch-action:none}.gjs-disabled{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;opacity:.5;filter:alpha(opacity=50)}.gjs-editor{font-family:Helvetica,sans-serif;font-size:.75rem;position:relative;box-sizing:border-box;height:100%}.gjs-freezed,.gjs-freezed{opacity:.5;filter:alpha(opacity=50);pointer-events:none}.gjs-traits-label{border-bottom:1px solid rgba(0,0,0,.2);font-weight:lighter;margin-bottom:5px;padding:10px;text-align:left}.gjs-label-wrp{width:30%;min-width:30%}.gjs-field-wrp{flex-grow:1}.gjs-trt-header{font-weight:lighter;padding:10px}.gjs-trt-trait{display:flex;justify-content:flex-start;padding:5px 10px;font-weight:lighter;align-items:center;text-align:left}.gjs-trt-traits{font-size:.75rem}.gjs-trt-trait .gjs-label{text-align:left;text-overflow:ellipsis;overflow:hidden}.gjs-guide-info{position:absolute}.gjs-guide-info__content{position:absolute;height:100%;display:flex;width:100%;padding:5px}.gjs-guide-info__line{position:relative;margin:auto}.gjs-guide-info__line::before,.gjs-guide-info__line::after{content:"";display:block;position:absolute;background-color:inherit}.gjs-guide-info__y{padding:0 5px}.gjs-guide-info__y .gjs-guide-info__content{justify-content:center}.gjs-guide-info__y .gjs-guide-info__line{width:100%;height:1px}.gjs-guide-info__y .gjs-guide-info__line::before,.gjs-guide-info__y .gjs-guide-info__line::after{width:1px;height:10px;top:0;bottom:0;left:0;margin:auto}.gjs-guide-info__y .gjs-guide-info__line::after{left:auto;right:0}.gjs-guide-info__x{padding:5px 0}.gjs-guide-info__x .gjs-guide-info__content{align-items:center}.gjs-guide-info__x .gjs-guide-info__line{height:100%;width:1px}.gjs-guide-info__x .gjs-guide-info__line::before,.gjs-guide-info__x .gjs-guide-info__line::after{width:10px;height:1px;left:0;right:0;top:0;margin:auto;transform:translateX(-50%)}.gjs-guide-info__x .gjs-guide-info__line::after{top:auto;bottom:0}.gjs-badge{white-space:nowrap}.gjs-badge__icon{vertical-align:middle;display:inline-block;width:15px;height:15px}.gjs-badge__icon svg{fill:currentColor}.gjs-badge__name{display:inline-block;vertical-align:middle}.gjs-frame-wrapper{position:absolute;width:100%;height:100%;left:0;right:0;margin:auto}.gjs-frame-wrapper--anim{transition:width .35s ease,height .35s ease}.gjs-frame-wrapper__top{transform:translateY(-100%) translateX(-50%);display:flex;padding:5px 0;position:absolute;width:100%;left:50%;top:0}.gjs-frame-wrapper__top-r{margin-left:auto}.gjs-frame-wrapper__left{position:absolute;left:0;transform:translateX(-100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__bottom{position:absolute;bottom:0;transform:translateY(100%) translateX(-50%);width:100%;left:50%}.gjs-frame-wrapper__right{position:absolute;right:0;transform:translateX(100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__icon{width:24px;cursor:pointer}.gjs-frame-wrapper__icon>svg{fill:currentColor}.gjs-padding-v-top,.gjs-fixedpadding-v-top{width:100%;top:0;left:0}.gjs-padding-v-right,.gjs-fixedpadding-v-right{right:0}.gjs-padding-v-bottom,.gjs-fixedpadding-v-bottom{width:100%;left:0;bottom:0}.gjs-padding-v-left,.gjs-fixedpadding-v-left{left:0}.gjs-cv-canvas{background-color:rgba(0,0,0,.15);box-sizing:border-box;width:85%;height:calc(100% - 40px);bottom:0;overflow:hidden;z-index:1;position:absolute;left:0;top:40px}.gjs-cv-canvas.gjs-cui{width:100%;height:100%;top:0}.gjs-cv-canvas.gjs-is__grab .gjs-cv-canvas__frames,.gjs-cv-canvas.gjs-is__grabbing .gjs-cv-canvas__frames{pointer-events:none}.gjs-cv-canvas__frames{position:absolute;top:0;left:0;width:100%;height:100%}.gjs-cv-canvas .gjs-ghost{display:none;pointer-events:none;background-color:#5b5b5b;border:2px dashed #ccc;position:absolute;z-index:10;opacity:.55;filter:alpha(opacity=55)}.gjs-cv-canvas .gjs-highlighter,.gjs-cv-canvas .gjs-highlighter-sel{position:absolute;outline:1px solid #3b97e3;outline-offset:-1px;pointer-events:none;width:100%;height:100%}.gjs-cv-canvas .gjs-highlighter-warning{outline:3px solid #ffca6f}.gjs-cv-canvas .gjs-highlighter-sel{outline:2px solid #3b97e3;outline-offset:-2px}.gjs-cv-canvas #gjs-tools,.gjs-cv-canvas .gjs-tools{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;z-index:1}.gjs-cv-canvas *{box-sizing:border-box}.gjs-frame{outline:medium none;height:100%;width:100%;border:none;margin:auto;display:block;transition:width .35s ease,height .35s ease;position:absolute;top:0;bottom:0;left:0;right:0}.gjs-toolbar{position:absolute;background-color:#3b97e3;white-space:nowrap;color:#fff;z-index:10;top:0;left:0}.gjs-toolbar-item{padding:5px 7px;font-size:.8rem;cursor:pointer;width:26px;vertical-align:middle;display:inline-block}.gjs-toolbar-item svg{fill:currentColor;vertical-align:middle}.gjs-resizer-c{position:absolute;left:0;top:0;width:100%;height:100%;z-index:9}.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.1;filter:alpha(opacity=10);position:absolute;background-color:#ff0}.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.2;filter:alpha(opacity=20)}.gjs-padding-v-el,.gjs-fixedpadding-v-el{background-color:navy}.gjs-resizer-h{pointer-events:all;position:absolute;border:3px solid #3b97e3;width:10px;height:10px;background-color:#fff;margin:-5px}.gjs-resizer-h-tl{top:0;left:0;cursor:nwse-resize}.gjs-resizer-h-tr{top:0;right:0;cursor:nesw-resize}.gjs-resizer-h-tc{top:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-cl{left:0;margin:auto -5px;top:0;bottom:0;cursor:ew-resize}.gjs-resizer-h-cr{margin:auto -5px;top:0;bottom:0;right:0;cursor:ew-resize}.gjs-resizer-h-bl{bottom:0;left:0;cursor:nesw-resize}.gjs-resizer-h-bc{bottom:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-br{bottom:0;right:0;cursor:nwse-resize}.gjs-pn-panel .gjs-resizer-h{background-color:rgba(0,0,0,.2);border:none;opacity:0;transition:opacity .25s}.gjs-pn-panel .gjs-resizer-h:hover{opacity:1}.gjs-pn-panel .gjs-resizer-h-tc,.gjs-pn-panel .gjs-resizer-h-bc{margin:0 auto;width:100%}.gjs-pn-panel .gjs-resizer-h-cr,.gjs-pn-panel .gjs-resizer-h-cl{margin:auto 0;height:100%}.gjs-resizing .gjs-highlighter,.gjs-resizing .gjs-badge{display:none !important}.gjs-resizing-tl *{cursor:nwse-resize !important}.gjs-resizing-tr *{cursor:nesw-resize !important}.gjs-resizing-tc *{cursor:ns-resize !important}.gjs-resizing-cl *{cursor:ew-resize !important}.gjs-resizing-cr *{cursor:ew-resize !important}.gjs-resizing-bl *{cursor:nesw-resize !important}.gjs-resizing-bc *{cursor:ns-resize !important}.gjs-resizing-br *{cursor:nwse-resize !important}.btn-cl,.gjs-am-close,.gjs-mdl-btn-close{opacity:.3;filter:alpha(opacity=30);font-size:25px;cursor:pointer}.btn-cl:hover,.gjs-am-close:hover,.gjs-mdl-btn-close:hover{opacity:.7;filter:alpha(opacity=70)}.no-dots,.ui-resizable-handle{border:none !important;margin:0 !important;outline:none !important}.gjs-com-dashed *{outline:1px dashed #888;outline-offset:-2px;box-sizing:border-box}.gjs-cv-canvas .gjs-comp-selected{outline:3px solid #3b97e3 !important}*.gjs-com-hover,div.gjs-com-hover{outline:1px solid #3b97e3}*.gjs-com-hover-delete,div.gjs-com-hover-delete{outline:2px solid #dd3636;opacity:.5;filter:alpha(opacity=50)}*.gjs-com-hover-move,div.gjs-com-hover-move{outline:3px solid #ffca6f}.gjs-com-badge,.gjs-com-badge-red,.gjs-badge{pointer-events:none;background-color:#3b97e3;color:#fff;padding:2px 5px;position:absolute;z-index:1;font-size:12px;outline:none;display:none}.gjs-com-badge-red{background-color:#dd3636}.gjs-badge-warning{background-color:#ffca6f}.gjs-placeholder,.gjs-com-placeholder,.gjs-placeholder{position:absolute;z-index:10;pointer-events:none;display:none}.gjs-placeholder,.gjs-placeholder{border-style:solid !important;outline:none;box-sizing:border-box;transition:top .2s,left .2s,width .2s,height .2s}.gjs-placeholder.horizontal,.gjs-com-placeholder.horizontal,.gjs-placeholder.horizontal{border-color:transparent #62c462;border-width:3px 5px;margin:-3px 0 0}.gjs-placeholder.vertical,.gjs-com-placeholder.vertical,.gjs-placeholder.vertical{border-color:#62c462 transparent;border-width:5px 3px;margin:0 0 0 -3px}.gjs-placeholder-int,.gjs-com-placeholder-int,.gjs-placeholder-int{background-color:#62c462;box-shadow:0 0 3px rgba(0,0,0,.2);height:100%;width:100%;pointer-events:none;padding:1.5px;outline:none}.gjs-pn-panel{display:inline-block;position:absolute;box-sizing:border-box;text-align:center;padding:5px;z-index:3}.gjs-pn-panel .icon-undo,.gjs-pn-panel .icon-redo{font-size:20px;height:30px;width:25px}.gjs-pn-commands{width:85%;left:0;top:0;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-options{right:15%;top:0}.gjs-pn-views{border-bottom:2px solid rgba(0,0,0,.2);right:0;width:15%;z-index:4}.gjs-pn-views-container{height:100%;padding:42px 0 0;right:0;width:15%;overflow:auto;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-buttons{align-items:center;display:flex;justify-content:space-between}.gjs-pn-btn{box-sizing:border-box;min-height:30px;min-width:30px;line-height:21px;background-color:transparent;border:none;font-size:18px;margin-right:5px;border-radius:2px;padding:4px;position:relative;cursor:pointer}.gjs-pn-btn.gjs-pn-active{background-color:rgba(0,0,0,.15);box-shadow:0 0 3px rgba(0,0,0,.25) inset}.gjs-pn-btn svg{fill:currentColor}.gjs-comp-image-placeholder{display:block;background-color:#f5f5f5;color:#777;height:50px;width:50px;line-height:50px;outline:3px solid #ffca6f;outline-offset:-3px;text-align:center;font-size:16.6666666667px;cursor:pointer}.gjs-comp-image-placeholder.fa-picture-o::after{content:""}.gjs-label{line-height:18px}.gjs-fields{display:flex}.gjs-select{padding:0;width:100%}.gjs-select select{padding-right:10px}.gjs-select:-moz-focusring,.gjs-select select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-input:focus,.gjs-button:focus,.gjs-btn-prim:focus,.gjs-select:focus,.gjs-select select:focus{outline:none}.gjs-field input,.gjs-field select,.gjs-field textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:inherit;border:none;background-color:transparent;box-sizing:border-box;width:100%;position:relative;padding:5px;z-index:1}.gjs-field input:focus,.gjs-field select:focus,.gjs-field textarea:focus{outline:none}.gjs-field input[type=number]{-moz-appearance:textfield}.gjs-field input[type=number]::-webkit-outer-spin-button,.gjs-field input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gjs-field-range{flex:9 1 auto}.gjs-field-integer input{padding-right:30px}.gjs-select option,.gjs-field-select option,.gjs-clm-select option,.gjs-sm-select option,.gjs-fields option,.gjs-sm-unit option{background-color:#444;color:#ddd}.gjs-field{background-color:rgba(0,0,0,.2);border:none;box-shadow:none;border-radius:2px;box-sizing:border-box;padding:0;position:relative}.gjs-field textarea{resize:vertical}.gjs-field .gjs-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;z-index:0}.gjs-field .gjs-d-s-arrow{bottom:0;top:0;margin:auto;right:5px;border-top:4px solid rgba(255,255,255,.7);position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-field-arrows{position:absolute;cursor:ns-resize;margin:auto;height:20px;width:9px;z-index:10;bottom:0;right:3px;top:0}.gjs-field-color,.gjs-field-radio{width:100%}.gjs-field-color input{padding-right:22px;box-sizing:border-box}.gjs-field-colorp{border-left:1px solid rgba(0,0,0,.2);box-sizing:border-box;height:100%;padding:2px;position:absolute;right:0;top:0;width:22px;z-index:10}.gjs-field-colorp .gjs-checker-bg,.gjs-field-colorp .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-field-colorp-c{height:100%;position:relative;width:100%}.gjs-field-color-picker{background-color:#ddd;cursor:pointer;height:100%;width:100%;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px;position:absolute;top:0}.gjs-field-checkbox{padding:0;width:17px;height:17px;display:block;cursor:pointer}.gjs-field-checkbox input{display:none}.gjs-field-checkbox input:checked+.gjs-chk-icon{border-color:rgba(255,255,255,.5);border-width:0 2px 2px 0;border-style:solid}.gjs-radio-item{flex:1 1 auto;text-align:center;border-left:1px solid rgba(0,0,0,.2)}.gjs-radio-item:first-child{border:none}.gjs-radio-item:hover{background:rgba(0,0,0,.2)}.gjs-radio-item input{display:none}.gjs-radio-item input:checked+.gjs-radio-item-label{background-color:rgba(255,255,255,.2)}.gjs-radio-items{display:flex}.gjs-radio-item-label{cursor:pointer;display:block;padding:5px}.gjs-field-units{position:absolute;margin:auto;right:10px;bottom:0;top:0}.gjs-field-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-field-arrow-u,.gjs-field-arrow-d{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(255,255,255,.7);bottom:4px;cursor:pointer}.gjs-field-arrow-u{border-bottom:4px solid rgba(255,255,255,.7);border-top:none;top:4px}.gjs-field-select{padding:0}.gjs-field-range{background-color:transparent;border:none;box-shadow:none;padding:0}.gjs-field-range input{margin:0;height:100%}.gjs-field-range input:focus{outline:none}.gjs-field-range input::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-ms-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-webkit-slider-runnable-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-ms-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-btn-prim{color:inherit;background-color:rgba(255,255,255,.1);border-radius:2px;padding:3px 6px;padding:5px;cursor:pointer;border:none}.gjs-btn-prim:active{background-color:rgba(255,255,255,.1)}.gjs-btn--full{width:100%}.gjs-chk-icon{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);box-sizing:border-box;display:block;height:14px;margin:0 5px;width:6px}.gjs-add-trasp{background:none;border:none;color:#ddd;cursor:pointer;font-size:1em;border-radius:2px;opacity:.75;filter:alpha(opacity=75)}.gjs-add-trasp:hover{opacity:1;filter:alpha(opacity=100)}.gjs-add-trasp:active{background-color:rgba(0,0,0,.2)}.gjs-devices-c{display:flex;align-items:center;padding:3px}.gjs-devices-c .gjs-device-label{flex-grow:2;text-align:left;margin-right:10px}.gjs-devices-c .gjs-select{flex-grow:20}.gjs-devices-c .gjs-add-trasp{flex-grow:1;margin-left:5px}.gjs-category-open,.gjs-block-category.gjs-open,.gjs-sm-sector.gjs-sm-open,.gjs-sm-open.gjs-clm-tags{border-bottom:1px solid rgba(0,0,0,.25)}.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title{font-weight:lighter;background-color:rgba(0,0,0,.1);letter-spacing:1px;padding:9px 10px 9px 20px;border-bottom:1px solid rgba(0,0,0,.25);text-align:left;position:relative;cursor:pointer}.gjs-sm-clear{cursor:pointer;width:14px;min-width:14px;height:14px;margin-left:3px}.gjs-sm-header{font-weight:lighter;padding:10px}.gjs-sm-properties{font-size:.75rem;padding:10px 5px;display:flex;flex-wrap:wrap;align-items:flex-end;box-sizing:border-box;width:100%}.gjs-sm-label{margin:5px 5px 3px 0;display:flex;align-items:center}.gjs-sm-close-btn,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.2;filter:alpha(opacity=20)}.gjs-sm-close-btn:hover,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover{opacity:.7;filter:alpha(opacity=70)}.gjs-sm-sector,.gjs-clm-tags{clear:both;font-weight:lighter;text-align:left}.gjs-sm-sector .gjs-sm-title-caret,.gjs-clm-tags .gjs-sm-title-caret{width:17px;height:17px;min-width:17px;transform:rotate(-90deg)}.gjs-sm-sector .gjs-sm-title-label,.gjs-clm-tags .gjs-sm-title-label{margin-left:5px}.gjs-sm-sector.gjs-sm-open .gjs-sm-title-caret,.gjs-sm-open.gjs-clm-tags .gjs-sm-title-caret{transform:none}.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title{display:flex;align-items:center}.gjs-sm-sector .gjs-sm-field,.gjs-clm-tags .gjs-sm-field,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-clm-field,.gjs-clm-tags .gjs-clm-field{width:100%;position:relative}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input,.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{background-color:transparent;color:rgba(255,255,255,.7);border:none;width:100%}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input{box-sizing:border-box}.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gjs-sm-sector .gjs-sm-field select::-ms-expand,.gjs-clm-tags .gjs-sm-field select::-ms-expand,.gjs-sm-sector .gjs-clm-select select::-ms-expand,.gjs-clm-tags .gjs-clm-select select::-ms-expand,.gjs-sm-sector .gjs-clm-field select::-ms-expand,.gjs-clm-tags .gjs-clm-field select::-ms-expand{display:none}.gjs-sm-sector .gjs-sm-field select:-moz-focusring,.gjs-clm-tags .gjs-sm-field select:-moz-focusring,.gjs-sm-sector .gjs-clm-select select:-moz-focusring,.gjs-clm-tags .gjs-clm-select select:-moz-focusring,.gjs-sm-sector .gjs-clm-field select:-moz-focusring,.gjs-clm-tags .gjs-clm-field select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-sm-sector .gjs-sm-field input:focus,.gjs-clm-tags .gjs-sm-field input:focus,.gjs-sm-sector .gjs-clm-select input:focus,.gjs-clm-tags .gjs-clm-select input:focus,.gjs-sm-sector .gjs-clm-field input:focus,.gjs-clm-tags .gjs-clm-field input:focus,.gjs-sm-sector .gjs-sm-field select:focus,.gjs-clm-tags .gjs-sm-field select:focus,.gjs-sm-sector .gjs-clm-select select:focus,.gjs-clm-tags .gjs-clm-select select:focus,.gjs-sm-sector .gjs-clm-field select:focus,.gjs-clm-tags .gjs-clm-field select:focus{outline:none}.gjs-sm-sector .gjs-sm-field .gjs-sm-unit,.gjs-clm-tags .gjs-sm-field .gjs-sm-unit,.gjs-sm-sector .gjs-clm-select .gjs-sm-unit,.gjs-clm-tags .gjs-clm-select .gjs-sm-unit,.gjs-sm-sector .gjs-clm-field .gjs-sm-unit,.gjs-clm-tags .gjs-clm-field .gjs-sm-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-sm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-select .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-select .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;cursor:ns-resize}.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{border-bottom:4px solid rgba(255,255,255,.7);top:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{border-top:4px solid rgba(255,255,255,.7);bottom:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{bottom:7px}.gjs-sm-sector .gjs-sm-field.gjs-sm-color,.gjs-clm-tags .gjs-sm-field.gjs-sm-color,.gjs-sm-sector .gjs-sm-color.gjs-clm-field,.gjs-clm-tags .gjs-sm-color.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-input,.gjs-clm-tags .gjs-sm-field.gjs-sm-input,.gjs-sm-sector .gjs-sm-input.gjs-clm-field,.gjs-clm-tags .gjs-sm-input.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-integer,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{background-color:rgba(0,0,0,.2);border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 0 rgba(255,255,255,.1);color:rgba(255,255,255,.7);border-radius:2px;box-sizing:border-box;padding:0 5px}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{border-radius:2px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{padding:0}.gjs-sm-sector .gjs-sm-field.gjs-sm-select select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field select,.gjs-clm-tags .gjs-sm-select.gjs-clm-field select{height:20px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select option,.gjs-clm-tags .gjs-sm-field.gjs-sm-select option,.gjs-sm-sector .gjs-clm-select option,.gjs-clm-tags .gjs-clm-select option,.gjs-sm-sector .gjs-sm-select.gjs-clm-field option,.gjs-clm-tags .gjs-sm-select.gjs-clm-field option{padding:3px 0}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{background-color:rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.25)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-select,.gjs-clm-tags .gjs-sm-list.gjs-clm-select,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field{width:auto;padding:0;overflow:hidden;float:left}.gjs-sm-sector .gjs-sm-field.gjs-sm-list input,.gjs-clm-tags .gjs-sm-field.gjs-sm-list input,.gjs-sm-sector .gjs-sm-list.gjs-clm-select input,.gjs-clm-tags .gjs-sm-list.gjs-clm-select input,.gjs-sm-sector .gjs-sm-list.gjs-clm-field input,.gjs-clm-tags .gjs-sm-list.gjs-clm-field input{display:none}.gjs-sm-sector .gjs-sm-field.gjs-sm-list label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field label{cursor:pointer;padding:5px;display:block}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label{background-color:rgba(255,255,255,.2)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-icon{background-repeat:no-repeat;background-position:center;text-shadow:none;line-height:normal}.gjs-sm-sector .gjs-sm-field.gjs-sm-integer select,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-select select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-select select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field select{width:auto;padding:0}.gjs-sm-sector .gjs-sm-list .gjs-sm-el,.gjs-clm-tags .gjs-sm-list .gjs-sm-el{float:left;border-left:1px solid rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:first-child,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:first-child{border:none}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:hover,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:hover{background:rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-slider .gjs-field-integer,.gjs-clm-tags .gjs-sm-slider .gjs-field-integer{flex:1 1 65px}.gjs-sm-sector .gjs-sm-property,.gjs-clm-tags .gjs-sm-property{box-sizing:border-box;float:left;width:50%;margin-bottom:5px;padding:0 5px}.gjs-sm-sector .gjs-sm-property--full,.gjs-clm-tags .gjs-sm-property--full,.gjs-sm-sector .gjs-sm-property.gjs-sm-composite,.gjs-clm-tags .gjs-sm-property.gjs-sm-composite,.gjs-sm-sector .gjs-sm-property.gjs-sm-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file,.gjs-sm-sector .gjs-sm-property.gjs-sm-list,.gjs-clm-tags .gjs-sm-property.gjs-sm-list,.gjs-sm-sector .gjs-sm-property.gjs-sm-stack,.gjs-clm-tags .gjs-sm-property.gjs-sm-stack,.gjs-sm-sector .gjs-sm-property.gjs-sm-slider,.gjs-clm-tags .gjs-sm-property.gjs-sm-slider,.gjs-sm-sector .gjs-sm-property.gjs-sm-color,.gjs-clm-tags .gjs-sm-property.gjs-sm-color{width:100%}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn{background-color:rgba(33,33,33,.2);border-radius:2px;box-shadow:1px 1px 0 rgba(5,5,5,.2),1px 1px 0 rgba(43,43,43,.2) inset;padding:5px;position:relative;text-align:center;height:auto;width:100%;cursor:pointer;color:#ddd;box-sizing:border-box;text-shadow:-1px -1px 0 rgba(0,0,0,.2);border:none;opacity:.85;filter:alpha(opacity=85)}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn-c,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn-c{box-sizing:border-box;float:left;width:100%}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box{background-color:rgba(255,255,255,.05);border-radius:2px;margin-top:5px;position:relative;overflow:hidden}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show{border:1px solid rgba(252,252,252,.05);padding:3px 20px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{top:-5px;display:block}.gjs-sm-sector .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file{height:50px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file{background-size:auto 100%;background-repeat:no-repeat;background-position:center center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layers,.gjs-clm-tags .gjs-sm-property .gjs-sm-layers{margin-top:5px;padding:1px 3px;min-height:30px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer{background-color:rgba(255,255,255,.055);border-radius:2px;margin:2px 0;padding:7px;position:relative}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer.gjs-sm-active,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer.gjs-sm-active{background-color:rgba(255,255,255,.12)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp{display:flex;align-items:center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-move,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-move{height:14px;width:14px;min-width:14px;cursor:grab}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-label,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-label{flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0 5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{height:15px;width:15px;min-width:15px;margin-right:5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview{background-color:#fff;height:100%;width:100%;background-size:cover !important}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{border-radius:2px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer{display:block;cursor:pointer;height:14px;width:14px;min-width:14px;opacity:.5;filter:alpha(opacity=50)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover{opacity:.8;filter:alpha(opacity=80)}.gjs-sm-sector #gjs-sm-text-shadow #gjs-sm-preview::after,.gjs-clm-tags #gjs-sm-text-shadow #gjs-sm-preview::after{color:#000;content:"T";font-weight:900;line-height:17px;padding:0 4px}.gjs-sm-sector .gjs-sm-stack .gjs-sm-properties,.gjs-clm-tags .gjs-sm-stack .gjs-sm-properties{padding:5px 0 0}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add{background:none;border:none;cursor:pointer;outline:none;position:absolute;right:0;top:-17px;opacity:.75;padding:0;width:18px;height:18px}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add:hover,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add:hover{opacity:1;filter:alpha(opacity=100)}.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c{height:100%;width:20px;position:absolute;right:0;top:0;box-sizing:border-box;border-radius:2px;padding:2px}.gjs-sm-sector .gjs-sm-colorp-c .gjs-checker-bg,.gjs-clm-tags .gjs-sm-colorp-c .gjs-checker-bg,.gjs-sm-sector .gjs-sm-colorp-c .gjs-field-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-sm-sector .gjs-sm-color-picker,.gjs-clm-tags .gjs-sm-color-picker{background-color:#ddd;cursor:pointer;height:16px;width:100%;margin-top:-16px;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-upload,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-upload{left:0;top:0;position:absolute;width:100%;opacity:0;cursor:pointer}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-label,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-label{padding:2px 0}.gjs-sm-layer>#gjs-sm-move{opacity:.7;filter:alpha(opacity=70);cursor:move;font-size:12px;float:left;margin:0 5px 0 0}.gjs-sm-layer>#gjs-sm-move:hover{opacity:.9;filter:alpha(opacity=90)}.gjs-blocks-c{display:flex;flex-wrap:wrap;justify-content:flex-start}.gjs-block-categories{display:flex;flex-direction:column}.gjs-block-category{width:100%}.gjs-block-category .gjs-caret-icon{margin-right:5px}.gjs-block{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;width:45%;min-width:45px;padding:1em;box-sizing:border-box;min-height:90px;cursor:all-scroll;font-size:11px;font-weight:lighter;text-align:center;display:flex;flex-direction:column;justify-content:space-between;border:1px solid rgba(0,0,0,.2);border-radius:3px;margin:10px 2.5% 5px;box-shadow:0 1px 0 0 rgba(0,0,0,.15);transition:all .2s ease 0s;transition-property:box-shadow,color}.gjs-block:hover{box-shadow:0 3px 4px 0 rgba(0,0,0,.15)}.gjs-block svg{fill:currentColor}.gjs-block__media{margin-bottom:10px;pointer-events:none}.gjs-block-svg{width:54px;fill:currentColor}.gjs-block-svg-path{fill:currentColor}.gjs-block.fa{font-size:2em;line-height:2em;padding:11px}.gjs-block-label{line-height:normal;font-size:.65rem;font-weight:normal;font-family:Helvetica,sans-serif;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.gjs-block.gjs-bdrag{width:auto;padding:0}.gjs-selected-parent{border:1px solid #ffca6f}.gjs-opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-layer{font-weight:lighter;text-align:left;position:relative;background-color:rgba(0,0,0,.1);font-size:.75rem;display:grid}.gjs-layer-hidden{opacity:.55;filter:alpha(opacity=55)}.gjs-layer-count{position:absolute;right:27px;top:9px}.gjs-layer-vis{height:auto !important;width:auto !important;left:0;top:0;padding:7px 5px 7px 10px;position:absolute;cursor:pointer;z-index:1}.gjs-layer-caret{font-size:.5rem;width:8px;padding:2px;cursor:pointer;position:absolute;left:-9px;top:6px;opacity:.7;filter:alpha(opacity=70)}.gjs-layer-caret:hover{opacity:1;filter:alpha(opacity=100)}.gjs-layer-title{padding:3px 10px 5px 30px;display:flex;align-items:center}.gjs-layer-title-inn{align-items:center;position:relative;display:flex;width:100%}.gjs-layer__icon{display:block;width:100%;max-width:15px;max-height:15px;padding-left:5px}.gjs-layer__icon svg{fill:currentColor}.gjs-layer-name{padding:5px 0;display:inline-block;box-sizing:content-box;overflow:hidden;white-space:nowrap;margin:0 30px 0 5px}.gjs-layer-name--no-edit{text-overflow:ellipsis}.gjs-layer>.gjs-layer-children{display:none}.gjs-layer.open>.gjs-layer-children{display:block}.gjs-layer-no-chld>.gjs-layer-title-inn>.gjs-layer-caret{display:none}.gjs-layer-move{padding:7px 10px 7px 5px;position:absolute;font-size:12px;cursor:move;right:0;top:0}.gjs-layer.gjs-hovered .gjs-layer-title{background-color:rgba(255,255,255,.015)}.gjs-layer.gjs-selected .gjs-layer-title{background-color:rgba(255,255,255,.1)}.gjs-layers{position:relative;height:100%}.gjs-layers #gjs-placeholder{width:100%;position:absolute}.gjs-layers #gjs-placeholder #gjs-plh-int{height:100%;padding:1px}.gjs-layers #gjs-placeholder #gjs-plh-int.gjs-insert{background-color:#62c462}#gjs-clm-add-tag,.gjs-clm-tags-btn{background-color:rgba(255,255,255,.15);border-radius:2px;padding:3px;margin-right:3px;border:1px solid rgba(0,0,0,.15);width:24px;height:24px;box-sizing:border-box;cursor:pointer}.gjs-clm-tags-btn svg{fill:currentColor;display:block}.gjs-clm-header{display:flex;align-items:center;margin:7px 0}.gjs-clm-header-status{flex-shrink:1;margin-left:auto}.gjs-clm-tag{display:flex;overflow:hidden;align-items:center;border-radius:3px;margin:0 3px 3px 0;padding:5px;cursor:default}.gjs-clm-tag-status,.gjs-clm-tag-close{width:12px;height:12px;flex-shrink:1}.gjs-clm-tag-status svg,.gjs-clm-tag-close svg{vertical-align:middle;fill:currentColor}.gjs-clm-sels-info{margin:7px 0}.gjs-clm-sel-id{font-size:.9em;opacity:.5;filter:alpha(opacity=50)}.gjs-clm-label-sel{float:left;padding-right:5px}.gjs-clm-tags{font-size:.75rem;padding:10px 5px}.gjs-clm-tags #gjs-clm-sel{padding:7px 0;float:left}.gjs-clm-tags #gjs-clm-sel{font-style:italic;margin-left:5px}.gjs-clm-tags #gjs-clm-tags-field{clear:both;padding:5px;margin-bottom:5px;display:flex;flex-wrap:wrap}.gjs-clm-tags #gjs-clm-tags-c{display:flex;flex-wrap:wrap;vertical-align:top;overflow:hidden}.gjs-clm-tags #gjs-clm-new{color:#ddd;padding:5px 6px;display:none}.gjs-clm-tags #gjs-clm-close{opacity:.85;filter:alpha(opacity=85);font-size:20px;line-height:0;cursor:pointer;color:rgba(255,255,255,.9)}.gjs-clm-tags #gjs-clm-close:hover{opacity:1;filter:alpha(opacity=100)}.gjs-clm-tags #gjs-clm-checkbox{color:rgba(255,255,255,.9);vertical-align:middle;cursor:pointer;font-size:9px}.gjs-clm-tags #gjs-clm-tag-label{flex-grow:1;text-overflow:ellipsis;overflow:hidden;padding:0 3px;cursor:text}.gjs-mdl-container{font-family:Helvetica,sans-serif;overflow-y:auto;position:fixed;background-color:rgba(0,0,0,.5);display:flex;top:0;left:0;right:0;bottom:0;z-index:100}.gjs-mdl-dialog{text-shadow:-1px -1px 0 rgba(0,0,0,.05);animation:gjs-slide-down .215s;margin:auto;max-width:850px;width:90%;border-radius:3px;font-weight:lighter;position:relative;z-index:2}.gjs-mdl-title{font-size:1rem}.gjs-mdl-btn-close{position:absolute;right:15px;top:5px}.gjs-mdl-active .gjs-mdl-dialog{animation:gjs-mdl-slide-down .216s}.gjs-mdl-header,.gjs-mdl-content{padding:10px 15px;clear:both}.gjs-mdl-header{position:relative;border-bottom:1px solid rgba(0,0,0,.2);padding:15px 15px 7px}.gjs-export-dl::after{content:"";clear:both;display:block;margin-bottom:10px}.gjs-dropzone{display:none;opacity:0;position:absolute;top:0;left:0;z-index:11;width:100%;height:100%;transition:opacity .25s;pointer-events:none}.gjs-dropzone-active .gjs-dropzone{display:block;opacity:1}.gjs-am-assets{height:290px;overflow:auto;clear:both;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:flex-start}.gjs-am-assets-header{padding:5px}.gjs-am-add-asset .gjs-am-add-field{width:70%;float:left}.gjs-am-add-asset button{width:25%;float:right}.gjs-am-preview-cont{position:relative;height:70px;width:30%;background-color:#444;border-radius:2px;float:left;overflow:hidden}.gjs-am-preview{position:absolute;background-position:center center;background-size:cover;background-repeat:no-repeat;height:100%;width:100%;z-index:1}.gjs-am-preview-bg{opacity:.5;filter:alpha(opacity=50);position:absolute;height:100%;width:100%;z-index:0}.gjs-am-dimensions{opacity:.5;filter:alpha(opacity=50);font-size:10px}.gjs-am-meta{width:70%;float:left;font-size:12px;padding:5px 0 0 5px;box-sizing:border-box}.gjs-am-meta>div{margin-bottom:5px}.gjs-am-close{cursor:pointer;position:absolute;right:5px;top:0;display:none}.gjs-am-asset{border-bottom:1px solid rgba(0,0,0,.2);padding:5px;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.gjs-am-asset:hover .gjs-am-close{display:block}.gjs-am-highlight{background-color:rgba(255,255,255,.1)}.gjs-am-assets-cont{background-color:rgba(0,0,0,.1);border-radius:3px;box-sizing:border-box;padding:10px;width:45%;float:right;height:325px;overflow:hidden}.gjs-am-file-uploader{width:55%;float:left}.gjs-am-file-uploader>form{background-color:rgba(0,0,0,.1);border:2px dashed;border-radius:3px;position:relative;text-align:center;margin-bottom:15px}.gjs-am-file-uploader>form.gjs-am-hover{border:2px solid #62c462;color:#75cb75}.gjs-am-file-uploader>form.gjs-am-disabled{border-color:red}.gjs-am-file-uploader>form #gjs-am-uploadFile{opacity:0;filter:alpha(opacity=0);padding:150px 10px;width:100%;box-sizing:border-box}.gjs-am-file-uploader #gjs-am-title{position:absolute;padding:150px 10px;width:100%}.gjs-cm-editor-c{float:left;box-sizing:border-box;width:50%}.gjs-cm-editor-c .CodeMirror{height:450px}.gjs-cm-editor{font-size:12px}.gjs-cm-editor#gjs-cm-htmlmixed{padding-right:10px;border-right:1px solid rgba(0,0,0,.2)}.gjs-cm-editor#gjs-cm-htmlmixed #gjs-cm-title{color:#a97d44}.gjs-cm-editor#gjs-cm-css{padding-left:10px}.gjs-cm-editor#gjs-cm-css #gjs-cm-title{color:#ddca7e}.gjs-cm-editor #gjs-cm-title{background-color:rgba(0,0,0,.2);font-size:12px;padding:5px 10px 3px;text-align:right}.gjs-rte-toolbar{border:1px solid rgba(0,0,0,.2);position:absolute;border-radius:3px;z-index:10}.gjs-rte-actionbar{display:flex}.gjs-rte-action{display:flex;align-items:center;justify-content:center;padding:5px;min-width:25px;border-right:1px solid rgba(0,0,0,.2);text-align:center;cursor:pointer;outline:none}.gjs-rte-action:last-child{border-right:none}.gjs-rte-action:hover{background-color:rgba(255,255,255,.1)}.gjs-rte-active{background-color:rgba(255,255,255,.1)}.gjs-rte-disabled{color:rgba(255,255,255,.1);cursor:not-allowed}.gjs-rte-disabled:hover{background-color:unset}.gjs-editor-cont .sp-hue,.gjs-editor-cont .sp-slider{cursor:row-resize}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-dragger{cursor:crosshair}.gjs-editor-cont .sp-alpha-inner,.gjs-editor-cont .sp-alpha-handle{cursor:col-resize}.gjs-editor-cont .sp-hue{left:90%}.gjs-editor-cont .sp-color{right:15%}.gjs-editor-cont .sp-container{border:1px solid rgba(0,0,0,.2);box-shadow:0 0 7px rgba(0,0,0,.2);border-radius:3px}.gjs-editor-cont .sp-picker-container{border:none}.gjs-editor-cont .colpick_dark .colpick_color{outline:1px solid rgba(0,0,0,.2)}.gjs-editor-cont .sp-cancel,.gjs-editor-cont .sp-cancel:hover{bottom:-8px;color:#777 !important;font-size:25px;left:0;position:absolute;text-decoration:none}.gjs-editor-cont .sp-alpha-handle{background-color:#ccc;border:1px solid #555;width:4px}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-hue{border:1px solid #333}.gjs-editor-cont .sp-slider{background-color:#ccc;border:1px solid #555;height:3px;left:-4px;width:22px}.gjs-editor-cont .sp-dragger{background:transparent;box-shadow:0 0 0 1px #111}.gjs-editor-cont .sp-button-container{float:none;width:100%;position:relative;text-align:right}.gjs-editor-cont .sp-container button,.gjs-editor-cont .sp-container button:hover,.gjs-editor-cont .sp-container button:active{background:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2);color:#ddd;text-shadow:none;box-shadow:none;padding:3px 5px}.gjs-editor-cont .sp-palette-container{border:none;float:none;margin:0;padding:5px 10px 0}.gjs-editor-cont .sp-palette .sp-thumb-el,.gjs-editor-cont .sp-palette .sp-thumb-el:hover{border:1px solid rgba(0,0,0,.9)}.gjs-editor-cont .sp-palette .sp-thumb-el:hover,.gjs-editor-cont .sp-palette .sp-thumb-el.sp-thumb-active{border-color:rgba(0,0,0,.9)}.gjs-hidden{display:none}@keyframes gjs-slide-down{0%{transform:translate(0, -3rem);opacity:0}100%{transform:translate(0, 0);opacity:1}}@keyframes gjs-slide-up{0%{transform:translate(0, 0);opacity:1}100%{transform:translate(0, -3rem);opacity:0}}.cm-s-hopscotch span.cm-error{color:#fff} diff --git a/src/editor/config/config.js b/src/editor/config/config.js index 4b8b6ec39..af1d5cc59 100644 --- a/src/editor/config/config.js +++ b/src/editor/config/config.js @@ -171,6 +171,7 @@ export default { '', move: '', plus: '', + caret: '', }, // Dom element diff --git a/src/style_manager/view/SectorView.js b/src/style_manager/view/SectorView.js index 599a24fac..dc0d6a765 100644 --- a/src/style_manager/view/SectorView.js +++ b/src/style_manager/view/SectorView.js @@ -4,17 +4,20 @@ import PropertiesView from './PropertiesView'; export default class SectorView extends View { template({ pfx, label }) { + const icons = this.em?.getConfig('icons'); + const iconCaret = icons?.caret || ''; + return html`
- - ${label} +
$${iconCaret}
+
${label}
`; } events() { return { - 'click [data-sector-title]': 'toggle' + 'click [data-sector-title]': 'toggle', }; } @@ -24,8 +27,6 @@ export default class SectorView extends View { this.pfx = this.config.stylePrefix || ''; this.target = o.target || {}; this.propTarget = o.propTarget || {}; - this.caretR = 'fa-caret-right'; - this.caretD = 'fa-caret-down'; const model = this.model; this.listenTo(model, 'change:open', this.updateOpen); this.listenTo(model, 'updateVisibility', this.updateVisibility); @@ -59,7 +60,6 @@ export default class SectorView extends View { show() { this.$el.addClass(this.pfx + 'open'); this.getPropertiesEl().style.display = ''; - this.$caret.removeClass(this.caretR).addClass(this.caretD); } /** @@ -68,7 +68,6 @@ export default class SectorView extends View { hide() { this.$el.removeClass(this.pfx + 'open'); this.getPropertiesEl().style.display = 'none'; - this.$caret.removeClass(this.caretD).addClass(this.caretR); } getPropertiesEl() { @@ -89,7 +88,6 @@ export default class SectorView extends View { const { id, name } = model.attributes; const label = (em && em.t(`styleManager.sectors.${id}`)) || name; $el.html(this.template({ pfx, label })); - this.$caret = $el.find(`#${pfx}caret`); this.renderProperties(); $el.attr('class', `${pfx}sector ${pfx}sector__${id} no-select`); this.updateOpen(); @@ -105,7 +103,7 @@ export default class SectorView extends View { collection: objs, target, propTarget, - config + config, }); this.$el.append(view.render().el); } diff --git a/src/styles/scss/_gjs_style_manager.scss b/src/styles/scss/_gjs_style_manager.scss index 9774c4bdb..7a85ddba2 100644 --- a/src/styles/scss/_gjs_style_manager.scss +++ b/src/styles/scss/_gjs_style_manager.scss @@ -50,17 +50,29 @@ font-weight: lighter; text-align: left; - ##{$sm-prefix}caret { - padding-right: 5px; - font-size: 11px; + .#{$sm-prefix}title-caret { + width: 17px; + height: 17px; + min-width: 17px; + transform: rotate(-90deg); + } + + .#{$sm-prefix}title-label { + margin-left: 5px; } &.#{$sm-prefix}open { @extend .#{$app-prefix}category-open; + + .#{$sm-prefix}title-caret { + transform: none; + } } .#{$sm-prefix}title { @extend .#{$app-prefix}category-title; + display: flex; + align-items: center; } /* ------------------Field-------------------- */ From 67d05d1b89a7ab0f99ca07c3082e50910f708491 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 15:35:56 +0100 Subject: [PATCH 223/313] Fix color prop view --- src/style_manager/view/PropertyColorView.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/style_manager/view/PropertyColorView.js b/src/style_manager/view/PropertyColorView.js index 45e20ff54..41dc5e16b 100644 --- a/src/style_manager/view/PropertyColorView.js +++ b/src/style_manager/view/PropertyColorView.js @@ -16,12 +16,8 @@ export default PropertyNumberView.extend({ onRender() { if (!this.input) { - const ppfx = this.ppfx; - const inputColor = new InputColor({ - target: this.target, - model: this.model, - ppfx, - }); + const { ppfx, model, em } = this; + const inputColor = new InputColor({ target: em, model, ppfx }); const input = inputColor.render(); this.el.querySelector(`.${ppfx}fields`).appendChild(input.el); this.$input = input.inputEl; From d9628bb3913f3b9a5a24923aadb9f18e06103797 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 15:54:06 +0100 Subject: [PATCH 224/313] Fix number increase --- src/domain_abstract/ui/InputNumber.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/domain_abstract/ui/InputNumber.js b/src/domain_abstract/ui/InputNumber.js index de61e27d3..916626249 100644 --- a/src/domain_abstract/ui/InputNumber.js +++ b/src/domain_abstract/ui/InputNumber.js @@ -175,7 +175,7 @@ export default Input.extend({ downIncrement(e) { e.preventDefault(); this.moved = 0; - var value = this.model.get('value'); + var value = this.model.get('value') || 0; value = this.normalizeValue(value); this.current = { y: e.pageY, val: value }; on(this.doc, 'mousemove', this.moveIncrement); From ab599712003e2050fca28b115d9aef6650f21777 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 16:00:16 +0100 Subject: [PATCH 225/313] Update layer view --- src/style_manager/view/LayerView.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/style_manager/view/LayerView.js b/src/style_manager/view/LayerView.js index 0a7e17e6c..1cc73584f 100644 --- a/src/style_manager/view/LayerView.js +++ b/src/style_manager/view/LayerView.js @@ -21,8 +21,8 @@ export default View.extend({ ${iconMove}
-
- +
${iconClose} @@ -125,9 +125,12 @@ export default View.extend({ }, render() { - const { el, pfx } = this; + const { el, pfx, pModel } = this; el.innerHTML = this.template(); el.className = `${pfx}layer`; + if (pModel.get('preview')) { + el.querySelector(`[data-preview-box]`).style.display = ''; + } this.updateLabel(); this.updateVisibility(); return this; From 6a9f8640fd5f4911a2ea3b66b760aba6f42fcc15 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 17:03:51 +0100 Subject: [PATCH 226/313] Avoid default value in property view --- src/style_manager/model/PropertyFactory.js | 2 +- src/style_manager/view/PropertyView.js | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index fa9916108..4579e5fec 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -176,7 +176,7 @@ export default class PropertyFactory { ['box-shadow-v', {}, 'text-shadow-h'], ['box-shadow-blur', { default: '5px' }, 'text-shadow-blur'], ['box-shadow-spread', {}, 'text-shadow-h'], - ['transition-duration', { default: '2', units: this.unitsTime }, 'border-radius-c'], + ['transition-duration', { default: '2s', units: this.unitsTime }, 'border-radius-c'], ['perspective', {}, 'border-radius-c'], ['transform-rotate-x', { functionName: 'rotateX', units: this.unitsAngle, default: '0', type: typeNumber }], ['transform-rotate-y', { functionName: 'rotateY' }, 'transform-rotate-x'], diff --git a/src/style_manager/view/PropertyView.js b/src/style_manager/view/PropertyView.js index bd6561918..11f394fb9 100644 --- a/src/style_manager/view/PropertyView.js +++ b/src/style_manager/view/PropertyView.js @@ -65,10 +65,6 @@ export default Backbone.View.extend({ this.__destroyFn = this.destroy ? this.destroy.bind(this) : () => {}; model.view = this; - if (!model.get('value')) { - model.set('value', model.getDefaultValue()); - } - if (em) { this.listenTo(em, `update:component:style:${this.property}`, this.targetUpdated); //this.listenTo(em, `styleable:change:${this.property}`, this.targetUpdated); From 119d15e105d0ad1d370c149bcc88e76ac60cb225 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 31 Dec 2021 17:23:40 +0100 Subject: [PATCH 227/313] Fix radio type view --- src/style_manager/view/PropertyRadioView.js | 86 ++++++++------------- 1 file changed, 31 insertions(+), 55 deletions(-) diff --git a/src/style_manager/view/PropertyRadioView.js b/src/style_manager/view/PropertyRadioView.js index 0bf6bc49c..70b61f2e2 100644 --- a/src/style_manager/view/PropertyRadioView.js +++ b/src/style_manager/view/PropertyRadioView.js @@ -1,71 +1,47 @@ -import PropertyView from './PropertyView'; +import PropertySelectView from './PropertySelectView'; -export default PropertyView.extend({ +export default PropertySelectView.extend({ templateInput() { - const ppfx = this.ppfx; - return ` -
-
- `; + const { ppfx } = this; + return `
`; }, onRender() { const { pfx, ppfx, model } = this; const itemCls = `${ppfx}radio-item-label`; - const prop = model.get('property'); - const options = model.get('list') || model.get('options') || []; + const prop = model.getName(); + const options = model.getOptions(); const clsInput = `${pfx}radio ${pfx}radio-${prop}`; const { cid } = model; if (!this.input) { - if (options && options.length) { - let inputStr = ''; - - options.forEach(opt => { - const cls = opt.className - ? `${opt.className} ${pfx}icon ${itemCls}` - : ''; - const id = model.getOptionId(opt); - const elId = `${prop}-${id}-${cid}`; - const labelEl = cls ? '' : model.getOptionLabel(id); - const titleAttr = opt.title ? `title="${opt.title}"` : ''; - inputStr += ` -
- - -
- `; - }); - - const inputHld = this.el.querySelector(`.${ppfx}field`); - inputHld.innerHTML = `
${inputStr}
`; - this.input = inputHld.firstChild; - } + const optionsRes = []; + + options.forEach(opt => { + const cls = opt.className ? `${opt.className} ${pfx}icon ${itemCls}` : ''; + const id = model.getOptionId(opt); + const elId = `${prop}-${id}-${cid}`; + const labelEl = cls ? '' : model.getOptionLabel(id); + const titleAttr = opt.title ? `title="${opt.title}"` : ''; + const checked = model.getValue() === id ? 'checked' : ''; + optionsRes.push(` +
+ + +
+ `); + }); + + const inputHld = this.el.querySelector(`.${ppfx}field`); + inputHld.innerHTML = `
${optionsRes.join('')}
`; + this.input = inputHld.firstChild; } }, - getInputValue() { - const inputChk = this.getCheckedEl(); - return inputChk ? inputChk.value : ''; - }, - - getCheckedEl() { - const input = this.getInputEl(); - return input ? input.querySelector('input:checked') : ''; - }, - - setValue(value) { + __setValueInput(value) { const model = this.model; - let val = value || model.get('value') || model.getDefaultValue(); - const input = this.getInputEl(); - const inputIn = input ? input.querySelector(`[value="${val}"]`) : ''; - - if (inputIn) { - inputIn.checked = true; - } else { - const inputChk = this.getCheckedEl(); - inputChk && (inputChk.checked = false); - } - } + const id = value || model.getDefaultValue(); + const inputIn = this.getInputEl()?.querySelector(`[value="${id}"]`); + inputIn && (inputIn.checked = true); + }, }); From 93eaa15463cf56deaf439ab28d3a88ab51a42789 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 1 Jan 2022 12:56:55 +0100 Subject: [PATCH 228/313] Add layerLabel to shadow properties --- docs/api.js | 1 + docs/api/property_stack.md | 51 +++++++++++-------- src/style_manager/model/PropertyFactory.js | 13 +++++ src/style_manager/model/PropertyStack.js | 9 +++- .../style_manager/model/PropertyFactory.js | 14 +++-- 5 files changed, 63 insertions(+), 25 deletions(-) diff --git a/docs/api.js b/docs/api.js index a2cc6bdb9..63886d7a3 100644 --- a/docs/api.js +++ b/docs/api.js @@ -56,6 +56,7 @@ async function generateDocs () { .replace(/<\\\[/g, '<[') .replace(/<\(\\\[/g, '<([') .replace(/\| \\\[/g, '| [') + .replace(/\\n```js/g, "```js") .replace('**Extends Model**', ''); fs.writeFileSync(`${docRoot}/api/${file[1]}`, res); log('Created', file[1]); diff --git a/docs/api/property_stack.md b/docs/api/property_stack.md index 3e13419ae..887790f57 100644 --- a/docs/api/property_stack.md +++ b/docs/api/property_stack.md @@ -8,9 +8,20 @@ ### Properties -* `layerSeparator` **([String][1] | [RegExp][2])?** The separator used to split layer values. -* `layerJoin` **[String][1]?** Value used to join layer values. -* `layerLabel` **[Function][3]?** Custom logic for creating the layer label. +* `preview` **[Boolean][1]?** Indicate if the layer should display a preview. +* `layerSeparator` **([String][2] | [RegExp][3])?** The separator used to split layer values. +* `layerJoin` **[String][2]?** Value used to join layer values. + ```js + layerJoin: (layer, { values }) => { + return `A: ${values['prop-a']} B: ${values['prop-b']}`; + } + ``` +* `layerLabel` **[Function][4]?** Custom logic for creating layer labels. + ```js + layerLabel: (layer, { values }) => { + return `A: ${values['prop-a']} B: ${values['prop-b']}`; + } + ``` ### getLayers @@ -24,7 +35,7 @@ Get layer by index. #### Parameters -* `index` **[Number][4]** Layer index position. (optional, default `0`) +* `index` **[Number][5]** Layer index position. (optional, default `0`) #### Examples @@ -66,7 +77,7 @@ Select layer by index. #### Parameters -* `index` **[Number][4]** Index of the layer to select. (optional, default `0`) +* `index` **[Number][5]** Index of the layer to select. (optional, default `0`) #### Examples @@ -80,10 +91,10 @@ Add new layer to the stack. #### Parameters -* `props` **[Object][5]** Custom property values to use in a new layer. (optional, default `{}`) -* `opts` **[Object][5]** Options (optional, default `{}`) +* `props` **[Object][6]** Custom property values to use in a new layer. (optional, default `{}`) +* `opts` **[Object][6]** Options (optional, default `{}`) - * `opts.at` **[Number][4]?** Position index (by default the layer will be appended at the end). + * `opts.at` **[Number][5]?** Position index (by default the layer will be appended at the end). #### Examples @@ -117,7 +128,7 @@ Remove layer by index. #### Parameters -* `index` **[Number][4]** Index of the layer to remove (optional, default `0`) +* `index` **[Number][5]** Index of the layer to remove (optional, default `0`) #### Examples @@ -142,7 +153,7 @@ const layer = this.getLayer(1); const label = this.getLayerLabel(layer); ``` -Returns **[String][1]** +Returns **[String][2]** ### getStyleFromLayer @@ -151,26 +162,26 @@ Get style object from the layer. #### Parameters * `layer` **[Layer]** -* `opts` **[Object][5]** Options (optional, default `{}`) +* `opts` **[Object][6]** Options (optional, default `{}`) - * `opts.camelCase` **[Boolean][6]?** Return property names in camelCase. + * `opts.camelCase` **[Boolean][1]?** Return property names in camelCase. -Returns **[Object][5]** Style object +Returns **[Object][6]** Style object ### getLayerSeparator Get layer separator. -Returns **[RegExp][2]** +Returns **[RegExp][3]** -[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean -[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp +[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function +[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index 4579e5fec..5b42ad22e 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -305,6 +305,13 @@ export default class PropertyFactory { 'box-shadow', { preview: true, + layerLabel: (l, { values }) => { + const x = values['box-shadow-h']; + const y = values['box-shadow-v']; + const blur = values['box-shadow-blur']; + const spread = values['box-shadow-spread']; + return `${x} ${y} ${blur} ${spread}`; + }, properties: this.__sub([ 'box-shadow-h', 'box-shadow-v', @@ -320,6 +327,12 @@ export default class PropertyFactory { 'text-shadow', { default: 'none', + layerLabel: (l, { values }) => { + const x = values['text-shadow-h']; + const y = values['text-shadow-v']; + const blur = values['text-shadow-blur']; + return `${x} ${y} ${blur}`; + }, properties: this.__sub(['text-shadow-h', 'text-shadow-v', 'text-shadow-blur', 'text-shadow-color']), }, 'box-shadow', diff --git a/src/style_manager/model/PropertyStack.js b/src/style_manager/model/PropertyStack.js index be4cdb15c..ebda0a675 100644 --- a/src/style_manager/model/PropertyStack.js +++ b/src/style_manager/model/PropertyStack.js @@ -16,7 +16,14 @@ const PARTS_REG = /\s(?![^(]*\))/; * @property {Boolean} [preview=false] Indicate if the layer should display a preview. * @property {String|RegExp} [layerSeparator=', '] The separator used to split layer values. * @property {String} [layerJoin=', '] Value used to join layer values. - * @property {Function} [layerLabel] Custom logic for creating the layer label. + * @property {Function} [layerLabel] Custom logic for creating layer labels. + * \n + * ```js + * layerLabel: (layer) => { + * const values = layer.getValues(); + * return `A: ${values['prop-a']} B: ${values['prop-b']}`; + * } + * ``` * */ export default class PropertyStack extends PropertyComposite { diff --git a/test/specs/style_manager/model/PropertyFactory.js b/test/specs/style_manager/model/PropertyFactory.js index 773d9db77..55ae99295 100644 --- a/test/specs/style_manager/model/PropertyFactory.js +++ b/test/specs/style_manager/model/PropertyFactory.js @@ -448,7 +448,9 @@ describe('PropertyFactory', () => { ], }; res.property = 'text-shadow'; - expect(obj.build('text-shadow')).toEqual([res]); + const result = obj.build('text-shadow'); + delete result[0].layerLabel; + expect(result).toEqual([res]); }); test('Build border-radius-c', () => { @@ -602,7 +604,9 @@ describe('PropertyFactory', () => { }, ], }; - expect(obj.build('box-shadow')).toEqual([res]); + const result = obj.build('box-shadow'); + delete result[0].layerLabel; + expect(result).toEqual([res]); }); test('Build background', () => { @@ -658,7 +662,9 @@ describe('PropertyFactory', () => { }, ], }; - expect(obj.build('background')).toEqual([res]); + const result = obj.build('background'); + delete result[0].layerLabel; + expect(result).toEqual([res]); }); test('Build transition', () => { @@ -686,7 +692,7 @@ describe('PropertyFactory', () => { id: 'transition-duration-sub', type: 'integer', units: obj.unitsTime, - default: '2', + default: '2s', min: 0, }, { From d33fb8016a6f048940adefbcb360ba99d7b7ff21 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 1 Jan 2022 13:03:20 +0100 Subject: [PATCH 229/313] Update built-in props --- src/style_manager/model/PropertyFactory.js | 9 ++++++++- test/specs/style_manager/model/PropertyFactory.js | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index 5b42ad22e..afdfb5360 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -201,7 +201,7 @@ export default class PropertyFactory { ['background-color', { default: 'none' }, 'color'], // File type - ['background-image', { type: this.typeFile, functionName: 'url' }], + ['background-image', { type: this.typeFile, functionName: 'url', default: 'none' }], // Select types ['display', { type: this.typeSelect, default: 'block', options: this.opstDisplay }], @@ -341,6 +341,13 @@ export default class PropertyFactory { 'background', { detached: true, + layerLabel: (l, { values }) => { + const repeat = values['background-repeat-sub']; + const pos = values['background-position-sub']; + const att = values['background-attachment-sub']; + const size = values['background-size-sub']; + return `${repeat} ${pos} ${att} ${size}`; + }, properties: this.__sub([ { extend: 'background-image', id: 'background-image-sub' }, { extend: 'background-repeat', id: 'background-repeat-sub' }, diff --git a/test/specs/style_manager/model/PropertyFactory.js b/test/specs/style_manager/model/PropertyFactory.js index 55ae99295..a21ddae31 100644 --- a/test/specs/style_manager/model/PropertyFactory.js +++ b/test/specs/style_manager/model/PropertyFactory.js @@ -619,6 +619,7 @@ describe('PropertyFactory', () => { { property: 'background-image', id: 'background-image-sub', + default: 'none', type: 'file', functionName: 'url', }, From bdad988d6904ffd83a9cc7f38e873e087f1a7c18 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 1 Jan 2022 13:28:04 +0100 Subject: [PATCH 230/313] Fix file property view --- dist/css/grapes.min.css | 2 +- src/style_manager/view/LayerView.js | 4 ++-- src/style_manager/view/PropertyFileView.js | 28 +++++++++++----------- src/styles/scss/_gjs_style_manager.scss | 25 +++++++++---------- 4 files changed, 28 insertions(+), 31 deletions(-) diff --git a/dist/css/grapes.min.css b/dist/css/grapes.min.css index c77ca929e..7361f7a24 100644 --- a/dist/css/grapes.min.css +++ b/dist/css/grapes.min.css @@ -1 +1 @@ -.sp-container{position:absolute;top:0;left:0;display:inline-block;*display:inline;*zoom:1;z-index:9999994;overflow:hidden}.sp-container.sp-flat{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{position:relative;width:100%;display:inline-block}.sp-top-inner{position:absolute;top:0;left:0;bottom:0;right:0}.sp-color{position:absolute;top:0;left:0;bottom:0;right:20%}.sp-hue{position:absolute;top:0;right:0;bottom:0;left:84%;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{position:absolute;top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{position:absolute;top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid black;background:white;opacity:.8}.sp-alpha{display:none;position:absolute;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:solid 1px #333}.sp-clear{display:none}.sp-clear.sp-clear-display{background-position:center}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0px;right:0;bottom:0;left:84%;height:28px}.sp-container,.sp-replacer,.sp-preview,.sp-dragger,.sp-slider,.sp-alpha,.sp-clear,.sp-alpha-handle,.sp-container.sp-dragging .sp-input,.sp-container button{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-input-disabled .sp-input-container{display:none}.sp-container.sp-buttons-disabled .sp-button-container{display:none}.sp-container.sp-palette-buttons-disabled .sp-palette-button-container{display:none}.sp-palette-only .sp-picker-container{display:none}.sp-palette-disabled .sp-palette-container{display:none}.sp-initial-disabled .sp-initial{display:none}.sp-sat{background-image:-webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:linear-gradient(to right, #fff, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr="#FFFFFFFF", endColorstr="#00CC9A81")}.sp-val{background-image:-webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:linear-gradient(to top, #000, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00CC9A81", endColorstr="#FF000000")}.sp-hue{background:-moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));background:-webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff0000", endColorstr="#ffff00")}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffff00", endColorstr="#00ff00")}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ff00", endColorstr="#00ffff")}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffff", endColorstr="#0000ff")}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0000ff", endColorstr="#ff00ff")}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff00ff", endColorstr="#ff0000")}.sp-hidden{display:none !important}.sp-cf:before,.sp-cf:after{content:"";display:table}.sp-cf:after{clear:both}.sp-cf{*zoom:1}@media(max-device-width: 480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;cursor:pointer;position:absolute;top:0;left:0}.sp-slider{position:absolute;top:0;cursor:pointer;height:3px;left:-1px;right:-1px;border:1px solid #000;background:white;opacity:.8}.sp-container{border-radius:0;background-color:#ececec;border:solid 1px #f0c49b;padding:0}.sp-container,.sp-container button,.sp-container input,.sp-color,.sp-hue,.sp-clear{font:normal 12px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-color,.sp-hue,.sp-clear{border:solid 1px #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container{width:100%}.sp-input{font-size:12px !important;border:1px inset;padding:4px 5px;margin:0;width:100%;background:transparent;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-picker-container,.sp-palette-container{float:left;position:relative;padding:10px;padding-bottom:300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:solid 1px #fff}.sp-palette-container{border-right:solid 1px #ccc}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;width:24px;height:15px;margin:3px;cursor:pointer;border:solid 2px transparent}.sp-palette .sp-thumb-el:hover,.sp-palette .sp-thumb-el.sp-thumb-active{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:solid 1px #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:center}.sp-palette-button-container,.sp-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;*zoom:1;*display:inline;border:solid 1px #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer:hover,.sp-replacer.sp-active{border-color:#f0c49b;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px}.sp-preview{position:relative;width:25px;height:20px;border:solid 1px #222;margin-right:5px;float:left;z-index:0}.sp-palette{*width:220px;max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:solid 1px #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top, #eeeeee, #cccccc);background-image:-moz-linear-gradient(top, #eeeeee, #cccccc);background-image:-ms-linear-gradient(top, #eeeeee, #cccccc);background-image:-o-linear-gradient(top, #eeeeee, #cccccc);background-image:linear-gradient(to bottom, #eeeeee, #cccccc);border:1px solid #ccc;border-bottom:1px solid #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top, #dddddd, #bbbbbb);background-image:-moz-linear-gradient(top, #dddddd, #bbbbbb);background-image:-ms-linear-gradient(top, #dddddd, #bbbbbb);background-image:-o-linear-gradient(top, #dddddd, #bbbbbb);background-image:linear-gradient(to bottom, #dddddd, #bbbbbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid #aaa;border-bottom:1px solid #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f !important;margin:0;padding:2px;margin-right:5px;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f !important;text-decoration:underline}.sp-palette span:hover,.sp-palette span.sp-thumb-active{border-color:#000}.sp-preview,.sp-alpha,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-preview-inner,.sp-alpha-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5X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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==)}.CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20, 255, 20, 0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:blue}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, 0.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, 0.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-hopscotch.CodeMirror{background:#322931;color:#d5d3d5}.cm-s-hopscotch div.CodeMirror-selected{background:#433b42 !important}.cm-s-hopscotch .CodeMirror-gutters{background:#322931;border-right:0px}.cm-s-hopscotch .CodeMirror-linenumber{color:#797379}.cm-s-hopscotch .CodeMirror-cursor{border-left:1px solid #989498 !important}.cm-s-hopscotch span.cm-comment{color:#b33508}.cm-s-hopscotch span.cm-atom{color:#c85e7c}.cm-s-hopscotch span.cm-number{color:#c85e7c}.cm-s-hopscotch span.cm-property,.cm-s-hopscotch span.cm-attribute{color:#8fc13e}.cm-s-hopscotch span.cm-keyword{color:#dd464c}.cm-s-hopscotch span.cm-string{color:#fdcc59}.cm-s-hopscotch span.cm-variable{color:#8fc13e}.cm-s-hopscotch span.cm-variable-2{color:#1290bf}.cm-s-hopscotch span.cm-def{color:#fd8b19}.cm-s-hopscotch span.cm-error{background:#dd464c;color:#989498}.cm-s-hopscotch span.cm-bracket{color:#d5d3d5}.cm-s-hopscotch span.cm-tag{color:#dd464c}.cm-s-hopscotch span.cm-link{color:#c85e7c}.cm-s-hopscotch .CodeMirror-matchingbracket{text-decoration:underline;color:white !important}.cm-s-hopscotch .CodeMirror-activeline-background{background:#302020}@font-face{font-family:"font3336";src:url("../fonts/main-fonts.eot?v=20");src:url("../fonts/main-fonts.woff?v=20") format("woff"),url("../fonts/main-fonts.ttf?v=20") format("truetype"),url("../fonts/main-fonts.svg?v=20") format("svg"),url("../fonts/main-fonts.eot?v=20") format("embedded-opentype");font-weight:normal;font-style:normal}.gjs-is__grab,.gjs-is__grab *{cursor:grab !important}.gjs-is__grabbing,.gjs-is__grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:grabbing !important}.gjs-one-bg{background-color:#444}.gjs-one-color{color:#444}.gjs-one-color-h:hover{color:#444}.gjs-two-bg{background-color:#ddd}.gjs-two-color{color:#ddd}.gjs-two-color-h:hover{color:#ddd}.gjs-three-bg{background-color:#804f7b}.gjs-three-color{color:#804f7b}.gjs-three-color-h:hover{color:#804f7b}.gjs-four-bg{background-color:#d278c9}.gjs-four-color{color:#d278c9}.gjs-four-color-h:hover{color:#d278c9}.gjs-danger-bg{background-color:#dd3636}.gjs-danger-color{color:#dd3636}.gjs-danger-color-h:hover{color:#dd3636}.gjs-bg-main,.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c,.gjs-off-prv{background-color:#444}.gjs-color-main,.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add,.gjs-off-prv{color:#ddd;fill:#ddd}.gjs-color-active{color:#f8f8f8;fill:#f8f8f8}.gjs-color-warn{color:#ffca6f;fill:#ffca6f}.gjs-color-hl{color:#71b7f1;fill:#71b7f1}.gjs-fonts::before{display:block;font:normal normal normal 14px font3336;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:5em}.gjs-f-b1::before{content:"Q"}.gjs-f-b2::before{content:"W"}.gjs-f-b3::before{content:"E"}.gjs-f-b37::before{content:"R"}.gjs-f-hero::before{content:"T"}.gjs-f-h1p::before{content:"y"}.gjs-f-3ba::before{content:"u"}.gjs-f-image::before{content:"I"}.gjs-f-text::before{content:"o"}.gjs-f-quo::before{content:"p"}.gjs-f-button::before{content:"B"}.gjs-f-divider::before{content:"D"}.gjs-invis-invis,.gjs-clm-tags #gjs-clm-new,.gjs-no-app{background-color:transparent;border:none;color:inherit}.gjs-no-app{height:10px}.gjs-test::btn{color:"#fff"}.opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-checker-bg,.gjs-field-colorp-c,.checker-bg,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==")}.gjs-no-user-select,.gjs-rte-toolbar,.gjs-layer-name,.gjs-grabbing,.gjs-grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-pointer-events,.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el,.gjs-resizer-c{pointer-events:none}.gjs-bdrag{pointer-events:none !important;position:absolute !important;z-index:10 !important;width:auto}.gjs-drag-helper{background-color:#3b97e3 !important;pointer-events:none !important;position:absolute !important;z-index:10 !important;transform:scale(0.3) !important;transform-origin:top left !important;-webkit-transform-origin:top left !important;margin:15px !important;transition:none !important;outline:none !important}.gjs-grabbing,.gjs-grabbing *{cursor:grabbing !important;cursor:-webkit-grabbing !important}.gjs-grabbing{overflow:hidden}.gjs-off-prv{position:relative;z-index:10;padding:5px;cursor:pointer}.gjs-editor-cont ::-webkit-scrollbar-track{background:rgba(0,0,0,.1)}.gjs-editor-cont ::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.2)}.gjs-editor-cont ::-webkit-scrollbar{width:8px}.clear{clear:both}.no-select,.gjs-clm-tags #gjs-clm-close,.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title,.gjs-com-no-select,.gjs-com-no-select img{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-touch-actions{touch-action:none}.gjs-disabled{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;opacity:.5;filter:alpha(opacity=50)}.gjs-editor{font-family:Helvetica,sans-serif;font-size:.75rem;position:relative;box-sizing:border-box;height:100%}.gjs-freezed,.gjs-freezed{opacity:.5;filter:alpha(opacity=50);pointer-events:none}.gjs-traits-label{border-bottom:1px solid rgba(0,0,0,.2);font-weight:lighter;margin-bottom:5px;padding:10px;text-align:left}.gjs-label-wrp{width:30%;min-width:30%}.gjs-field-wrp{flex-grow:1}.gjs-trt-header{font-weight:lighter;padding:10px}.gjs-trt-trait{display:flex;justify-content:flex-start;padding:5px 10px;font-weight:lighter;align-items:center;text-align:left}.gjs-trt-traits{font-size:.75rem}.gjs-trt-trait .gjs-label{text-align:left;text-overflow:ellipsis;overflow:hidden}.gjs-guide-info{position:absolute}.gjs-guide-info__content{position:absolute;height:100%;display:flex;width:100%;padding:5px}.gjs-guide-info__line{position:relative;margin:auto}.gjs-guide-info__line::before,.gjs-guide-info__line::after{content:"";display:block;position:absolute;background-color:inherit}.gjs-guide-info__y{padding:0 5px}.gjs-guide-info__y .gjs-guide-info__content{justify-content:center}.gjs-guide-info__y .gjs-guide-info__line{width:100%;height:1px}.gjs-guide-info__y .gjs-guide-info__line::before,.gjs-guide-info__y .gjs-guide-info__line::after{width:1px;height:10px;top:0;bottom:0;left:0;margin:auto}.gjs-guide-info__y .gjs-guide-info__line::after{left:auto;right:0}.gjs-guide-info__x{padding:5px 0}.gjs-guide-info__x .gjs-guide-info__content{align-items:center}.gjs-guide-info__x .gjs-guide-info__line{height:100%;width:1px}.gjs-guide-info__x .gjs-guide-info__line::before,.gjs-guide-info__x .gjs-guide-info__line::after{width:10px;height:1px;left:0;right:0;top:0;margin:auto;transform:translateX(-50%)}.gjs-guide-info__x .gjs-guide-info__line::after{top:auto;bottom:0}.gjs-badge{white-space:nowrap}.gjs-badge__icon{vertical-align:middle;display:inline-block;width:15px;height:15px}.gjs-badge__icon svg{fill:currentColor}.gjs-badge__name{display:inline-block;vertical-align:middle}.gjs-frame-wrapper{position:absolute;width:100%;height:100%;left:0;right:0;margin:auto}.gjs-frame-wrapper--anim{transition:width .35s ease,height .35s ease}.gjs-frame-wrapper__top{transform:translateY(-100%) translateX(-50%);display:flex;padding:5px 0;position:absolute;width:100%;left:50%;top:0}.gjs-frame-wrapper__top-r{margin-left:auto}.gjs-frame-wrapper__left{position:absolute;left:0;transform:translateX(-100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__bottom{position:absolute;bottom:0;transform:translateY(100%) translateX(-50%);width:100%;left:50%}.gjs-frame-wrapper__right{position:absolute;right:0;transform:translateX(100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__icon{width:24px;cursor:pointer}.gjs-frame-wrapper__icon>svg{fill:currentColor}.gjs-padding-v-top,.gjs-fixedpadding-v-top{width:100%;top:0;left:0}.gjs-padding-v-right,.gjs-fixedpadding-v-right{right:0}.gjs-padding-v-bottom,.gjs-fixedpadding-v-bottom{width:100%;left:0;bottom:0}.gjs-padding-v-left,.gjs-fixedpadding-v-left{left:0}.gjs-cv-canvas{background-color:rgba(0,0,0,.15);box-sizing:border-box;width:85%;height:calc(100% - 40px);bottom:0;overflow:hidden;z-index:1;position:absolute;left:0;top:40px}.gjs-cv-canvas.gjs-cui{width:100%;height:100%;top:0}.gjs-cv-canvas.gjs-is__grab .gjs-cv-canvas__frames,.gjs-cv-canvas.gjs-is__grabbing .gjs-cv-canvas__frames{pointer-events:none}.gjs-cv-canvas__frames{position:absolute;top:0;left:0;width:100%;height:100%}.gjs-cv-canvas .gjs-ghost{display:none;pointer-events:none;background-color:#5b5b5b;border:2px dashed #ccc;position:absolute;z-index:10;opacity:.55;filter:alpha(opacity=55)}.gjs-cv-canvas .gjs-highlighter,.gjs-cv-canvas .gjs-highlighter-sel{position:absolute;outline:1px solid #3b97e3;outline-offset:-1px;pointer-events:none;width:100%;height:100%}.gjs-cv-canvas .gjs-highlighter-warning{outline:3px solid #ffca6f}.gjs-cv-canvas .gjs-highlighter-sel{outline:2px solid #3b97e3;outline-offset:-2px}.gjs-cv-canvas #gjs-tools,.gjs-cv-canvas .gjs-tools{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;z-index:1}.gjs-cv-canvas *{box-sizing:border-box}.gjs-frame{outline:medium none;height:100%;width:100%;border:none;margin:auto;display:block;transition:width .35s ease,height .35s ease;position:absolute;top:0;bottom:0;left:0;right:0}.gjs-toolbar{position:absolute;background-color:#3b97e3;white-space:nowrap;color:#fff;z-index:10;top:0;left:0}.gjs-toolbar-item{padding:5px 7px;font-size:.8rem;cursor:pointer;width:26px;vertical-align:middle;display:inline-block}.gjs-toolbar-item svg{fill:currentColor;vertical-align:middle}.gjs-resizer-c{position:absolute;left:0;top:0;width:100%;height:100%;z-index:9}.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.1;filter:alpha(opacity=10);position:absolute;background-color:#ff0}.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.2;filter:alpha(opacity=20)}.gjs-padding-v-el,.gjs-fixedpadding-v-el{background-color:navy}.gjs-resizer-h{pointer-events:all;position:absolute;border:3px solid #3b97e3;width:10px;height:10px;background-color:#fff;margin:-5px}.gjs-resizer-h-tl{top:0;left:0;cursor:nwse-resize}.gjs-resizer-h-tr{top:0;right:0;cursor:nesw-resize}.gjs-resizer-h-tc{top:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-cl{left:0;margin:auto -5px;top:0;bottom:0;cursor:ew-resize}.gjs-resizer-h-cr{margin:auto -5px;top:0;bottom:0;right:0;cursor:ew-resize}.gjs-resizer-h-bl{bottom:0;left:0;cursor:nesw-resize}.gjs-resizer-h-bc{bottom:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-br{bottom:0;right:0;cursor:nwse-resize}.gjs-pn-panel .gjs-resizer-h{background-color:rgba(0,0,0,.2);border:none;opacity:0;transition:opacity .25s}.gjs-pn-panel .gjs-resizer-h:hover{opacity:1}.gjs-pn-panel .gjs-resizer-h-tc,.gjs-pn-panel .gjs-resizer-h-bc{margin:0 auto;width:100%}.gjs-pn-panel .gjs-resizer-h-cr,.gjs-pn-panel .gjs-resizer-h-cl{margin:auto 0;height:100%}.gjs-resizing .gjs-highlighter,.gjs-resizing .gjs-badge{display:none !important}.gjs-resizing-tl *{cursor:nwse-resize !important}.gjs-resizing-tr *{cursor:nesw-resize !important}.gjs-resizing-tc *{cursor:ns-resize !important}.gjs-resizing-cl *{cursor:ew-resize !important}.gjs-resizing-cr *{cursor:ew-resize !important}.gjs-resizing-bl *{cursor:nesw-resize !important}.gjs-resizing-bc *{cursor:ns-resize !important}.gjs-resizing-br *{cursor:nwse-resize !important}.btn-cl,.gjs-am-close,.gjs-mdl-btn-close{opacity:.3;filter:alpha(opacity=30);font-size:25px;cursor:pointer}.btn-cl:hover,.gjs-am-close:hover,.gjs-mdl-btn-close:hover{opacity:.7;filter:alpha(opacity=70)}.no-dots,.ui-resizable-handle{border:none !important;margin:0 !important;outline:none !important}.gjs-com-dashed *{outline:1px dashed #888;outline-offset:-2px;box-sizing:border-box}.gjs-cv-canvas .gjs-comp-selected{outline:3px solid #3b97e3 !important}*.gjs-com-hover,div.gjs-com-hover{outline:1px solid #3b97e3}*.gjs-com-hover-delete,div.gjs-com-hover-delete{outline:2px solid #dd3636;opacity:.5;filter:alpha(opacity=50)}*.gjs-com-hover-move,div.gjs-com-hover-move{outline:3px solid #ffca6f}.gjs-com-badge,.gjs-com-badge-red,.gjs-badge{pointer-events:none;background-color:#3b97e3;color:#fff;padding:2px 5px;position:absolute;z-index:1;font-size:12px;outline:none;display:none}.gjs-com-badge-red{background-color:#dd3636}.gjs-badge-warning{background-color:#ffca6f}.gjs-placeholder,.gjs-com-placeholder,.gjs-placeholder{position:absolute;z-index:10;pointer-events:none;display:none}.gjs-placeholder,.gjs-placeholder{border-style:solid !important;outline:none;box-sizing:border-box;transition:top .2s,left .2s,width .2s,height .2s}.gjs-placeholder.horizontal,.gjs-com-placeholder.horizontal,.gjs-placeholder.horizontal{border-color:transparent #62c462;border-width:3px 5px;margin:-3px 0 0}.gjs-placeholder.vertical,.gjs-com-placeholder.vertical,.gjs-placeholder.vertical{border-color:#62c462 transparent;border-width:5px 3px;margin:0 0 0 -3px}.gjs-placeholder-int,.gjs-com-placeholder-int,.gjs-placeholder-int{background-color:#62c462;box-shadow:0 0 3px rgba(0,0,0,.2);height:100%;width:100%;pointer-events:none;padding:1.5px;outline:none}.gjs-pn-panel{display:inline-block;position:absolute;box-sizing:border-box;text-align:center;padding:5px;z-index:3}.gjs-pn-panel .icon-undo,.gjs-pn-panel .icon-redo{font-size:20px;height:30px;width:25px}.gjs-pn-commands{width:85%;left:0;top:0;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-options{right:15%;top:0}.gjs-pn-views{border-bottom:2px solid rgba(0,0,0,.2);right:0;width:15%;z-index:4}.gjs-pn-views-container{height:100%;padding:42px 0 0;right:0;width:15%;overflow:auto;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-buttons{align-items:center;display:flex;justify-content:space-between}.gjs-pn-btn{box-sizing:border-box;min-height:30px;min-width:30px;line-height:21px;background-color:transparent;border:none;font-size:18px;margin-right:5px;border-radius:2px;padding:4px;position:relative;cursor:pointer}.gjs-pn-btn.gjs-pn-active{background-color:rgba(0,0,0,.15);box-shadow:0 0 3px rgba(0,0,0,.25) inset}.gjs-pn-btn svg{fill:currentColor}.gjs-comp-image-placeholder{display:block;background-color:#f5f5f5;color:#777;height:50px;width:50px;line-height:50px;outline:3px solid #ffca6f;outline-offset:-3px;text-align:center;font-size:16.6666666667px;cursor:pointer}.gjs-comp-image-placeholder.fa-picture-o::after{content:""}.gjs-label{line-height:18px}.gjs-fields{display:flex}.gjs-select{padding:0;width:100%}.gjs-select select{padding-right:10px}.gjs-select:-moz-focusring,.gjs-select select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-input:focus,.gjs-button:focus,.gjs-btn-prim:focus,.gjs-select:focus,.gjs-select select:focus{outline:none}.gjs-field input,.gjs-field select,.gjs-field textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:inherit;border:none;background-color:transparent;box-sizing:border-box;width:100%;position:relative;padding:5px;z-index:1}.gjs-field input:focus,.gjs-field select:focus,.gjs-field textarea:focus{outline:none}.gjs-field input[type=number]{-moz-appearance:textfield}.gjs-field input[type=number]::-webkit-outer-spin-button,.gjs-field input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gjs-field-range{flex:9 1 auto}.gjs-field-integer input{padding-right:30px}.gjs-select option,.gjs-field-select option,.gjs-clm-select option,.gjs-sm-select option,.gjs-fields option,.gjs-sm-unit option{background-color:#444;color:#ddd}.gjs-field{background-color:rgba(0,0,0,.2);border:none;box-shadow:none;border-radius:2px;box-sizing:border-box;padding:0;position:relative}.gjs-field textarea{resize:vertical}.gjs-field .gjs-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;z-index:0}.gjs-field .gjs-d-s-arrow{bottom:0;top:0;margin:auto;right:5px;border-top:4px solid rgba(255,255,255,.7);position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-field-arrows{position:absolute;cursor:ns-resize;margin:auto;height:20px;width:9px;z-index:10;bottom:0;right:3px;top:0}.gjs-field-color,.gjs-field-radio{width:100%}.gjs-field-color input{padding-right:22px;box-sizing:border-box}.gjs-field-colorp{border-left:1px solid rgba(0,0,0,.2);box-sizing:border-box;height:100%;padding:2px;position:absolute;right:0;top:0;width:22px;z-index:10}.gjs-field-colorp .gjs-checker-bg,.gjs-field-colorp .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-field-colorp-c{height:100%;position:relative;width:100%}.gjs-field-color-picker{background-color:#ddd;cursor:pointer;height:100%;width:100%;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px;position:absolute;top:0}.gjs-field-checkbox{padding:0;width:17px;height:17px;display:block;cursor:pointer}.gjs-field-checkbox input{display:none}.gjs-field-checkbox input:checked+.gjs-chk-icon{border-color:rgba(255,255,255,.5);border-width:0 2px 2px 0;border-style:solid}.gjs-radio-item{flex:1 1 auto;text-align:center;border-left:1px solid rgba(0,0,0,.2)}.gjs-radio-item:first-child{border:none}.gjs-radio-item:hover{background:rgba(0,0,0,.2)}.gjs-radio-item input{display:none}.gjs-radio-item input:checked+.gjs-radio-item-label{background-color:rgba(255,255,255,.2)}.gjs-radio-items{display:flex}.gjs-radio-item-label{cursor:pointer;display:block;padding:5px}.gjs-field-units{position:absolute;margin:auto;right:10px;bottom:0;top:0}.gjs-field-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-field-arrow-u,.gjs-field-arrow-d{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(255,255,255,.7);bottom:4px;cursor:pointer}.gjs-field-arrow-u{border-bottom:4px solid rgba(255,255,255,.7);border-top:none;top:4px}.gjs-field-select{padding:0}.gjs-field-range{background-color:transparent;border:none;box-shadow:none;padding:0}.gjs-field-range input{margin:0;height:100%}.gjs-field-range input:focus{outline:none}.gjs-field-range input::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-ms-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-webkit-slider-runnable-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-ms-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-btn-prim{color:inherit;background-color:rgba(255,255,255,.1);border-radius:2px;padding:3px 6px;padding:5px;cursor:pointer;border:none}.gjs-btn-prim:active{background-color:rgba(255,255,255,.1)}.gjs-btn--full{width:100%}.gjs-chk-icon{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);box-sizing:border-box;display:block;height:14px;margin:0 5px;width:6px}.gjs-add-trasp{background:none;border:none;color:#ddd;cursor:pointer;font-size:1em;border-radius:2px;opacity:.75;filter:alpha(opacity=75)}.gjs-add-trasp:hover{opacity:1;filter:alpha(opacity=100)}.gjs-add-trasp:active{background-color:rgba(0,0,0,.2)}.gjs-devices-c{display:flex;align-items:center;padding:3px}.gjs-devices-c .gjs-device-label{flex-grow:2;text-align:left;margin-right:10px}.gjs-devices-c .gjs-select{flex-grow:20}.gjs-devices-c .gjs-add-trasp{flex-grow:1;margin-left:5px}.gjs-category-open,.gjs-block-category.gjs-open,.gjs-sm-sector.gjs-sm-open,.gjs-sm-open.gjs-clm-tags{border-bottom:1px solid rgba(0,0,0,.25)}.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title{font-weight:lighter;background-color:rgba(0,0,0,.1);letter-spacing:1px;padding:9px 10px 9px 20px;border-bottom:1px solid rgba(0,0,0,.25);text-align:left;position:relative;cursor:pointer}.gjs-sm-clear{cursor:pointer;width:14px;min-width:14px;height:14px;margin-left:3px}.gjs-sm-header{font-weight:lighter;padding:10px}.gjs-sm-properties{font-size:.75rem;padding:10px 5px;display:flex;flex-wrap:wrap;align-items:flex-end;box-sizing:border-box;width:100%}.gjs-sm-label{margin:5px 5px 3px 0;display:flex;align-items:center}.gjs-sm-close-btn,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.2;filter:alpha(opacity=20)}.gjs-sm-close-btn:hover,.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close:hover{opacity:.7;filter:alpha(opacity=70)}.gjs-sm-sector,.gjs-clm-tags{clear:both;font-weight:lighter;text-align:left}.gjs-sm-sector .gjs-sm-title-caret,.gjs-clm-tags .gjs-sm-title-caret{width:17px;height:17px;min-width:17px;transform:rotate(-90deg)}.gjs-sm-sector .gjs-sm-title-label,.gjs-clm-tags .gjs-sm-title-label{margin-left:5px}.gjs-sm-sector.gjs-sm-open .gjs-sm-title-caret,.gjs-sm-open.gjs-clm-tags .gjs-sm-title-caret{transform:none}.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title{display:flex;align-items:center}.gjs-sm-sector .gjs-sm-field,.gjs-clm-tags .gjs-sm-field,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-clm-field,.gjs-clm-tags .gjs-clm-field{width:100%;position:relative}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input,.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{background-color:transparent;color:rgba(255,255,255,.7);border:none;width:100%}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input{box-sizing:border-box}.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gjs-sm-sector .gjs-sm-field select::-ms-expand,.gjs-clm-tags .gjs-sm-field select::-ms-expand,.gjs-sm-sector .gjs-clm-select select::-ms-expand,.gjs-clm-tags .gjs-clm-select select::-ms-expand,.gjs-sm-sector .gjs-clm-field select::-ms-expand,.gjs-clm-tags .gjs-clm-field select::-ms-expand{display:none}.gjs-sm-sector .gjs-sm-field select:-moz-focusring,.gjs-clm-tags .gjs-sm-field select:-moz-focusring,.gjs-sm-sector .gjs-clm-select select:-moz-focusring,.gjs-clm-tags .gjs-clm-select select:-moz-focusring,.gjs-sm-sector .gjs-clm-field select:-moz-focusring,.gjs-clm-tags .gjs-clm-field select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-sm-sector .gjs-sm-field input:focus,.gjs-clm-tags .gjs-sm-field input:focus,.gjs-sm-sector .gjs-clm-select input:focus,.gjs-clm-tags .gjs-clm-select input:focus,.gjs-sm-sector .gjs-clm-field input:focus,.gjs-clm-tags .gjs-clm-field input:focus,.gjs-sm-sector .gjs-sm-field select:focus,.gjs-clm-tags .gjs-sm-field select:focus,.gjs-sm-sector .gjs-clm-select select:focus,.gjs-clm-tags .gjs-clm-select select:focus,.gjs-sm-sector .gjs-clm-field select:focus,.gjs-clm-tags .gjs-clm-field select:focus{outline:none}.gjs-sm-sector .gjs-sm-field .gjs-sm-unit,.gjs-clm-tags .gjs-sm-field .gjs-sm-unit,.gjs-sm-sector .gjs-clm-select .gjs-sm-unit,.gjs-clm-tags .gjs-clm-select .gjs-sm-unit,.gjs-sm-sector .gjs-clm-field .gjs-sm-unit,.gjs-clm-tags .gjs-clm-field .gjs-sm-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-sm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-select .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-select .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;cursor:ns-resize}.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{border-bottom:4px solid rgba(255,255,255,.7);top:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{border-top:4px solid rgba(255,255,255,.7);bottom:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{bottom:7px}.gjs-sm-sector .gjs-sm-field.gjs-sm-color,.gjs-clm-tags .gjs-sm-field.gjs-sm-color,.gjs-sm-sector .gjs-sm-color.gjs-clm-field,.gjs-clm-tags .gjs-sm-color.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-input,.gjs-clm-tags .gjs-sm-field.gjs-sm-input,.gjs-sm-sector .gjs-sm-input.gjs-clm-field,.gjs-clm-tags .gjs-sm-input.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-integer,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{background-color:rgba(0,0,0,.2);border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 0 rgba(255,255,255,.1);color:rgba(255,255,255,.7);border-radius:2px;box-sizing:border-box;padding:0 5px}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{border-radius:2px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{padding:0}.gjs-sm-sector .gjs-sm-field.gjs-sm-select select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field select,.gjs-clm-tags .gjs-sm-select.gjs-clm-field select{height:20px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select option,.gjs-clm-tags .gjs-sm-field.gjs-sm-select option,.gjs-sm-sector .gjs-clm-select option,.gjs-clm-tags .gjs-clm-select option,.gjs-sm-sector .gjs-sm-select.gjs-clm-field option,.gjs-clm-tags .gjs-sm-select.gjs-clm-field option{padding:3px 0}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{background-color:rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.25)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-select,.gjs-clm-tags .gjs-sm-list.gjs-clm-select,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field{width:auto;padding:0;overflow:hidden;float:left}.gjs-sm-sector .gjs-sm-field.gjs-sm-list input,.gjs-clm-tags .gjs-sm-field.gjs-sm-list input,.gjs-sm-sector .gjs-sm-list.gjs-clm-select input,.gjs-clm-tags .gjs-sm-list.gjs-clm-select input,.gjs-sm-sector .gjs-sm-list.gjs-clm-field input,.gjs-clm-tags .gjs-sm-list.gjs-clm-field input{display:none}.gjs-sm-sector .gjs-sm-field.gjs-sm-list label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field label{cursor:pointer;padding:5px;display:block}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label{background-color:rgba(255,255,255,.2)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-icon{background-repeat:no-repeat;background-position:center;text-shadow:none;line-height:normal}.gjs-sm-sector .gjs-sm-field.gjs-sm-integer select,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-select select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-select select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field select{width:auto;padding:0}.gjs-sm-sector .gjs-sm-list .gjs-sm-el,.gjs-clm-tags .gjs-sm-list .gjs-sm-el{float:left;border-left:1px solid rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:first-child,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:first-child{border:none}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:hover,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:hover{background:rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-slider .gjs-field-integer,.gjs-clm-tags .gjs-sm-slider .gjs-field-integer{flex:1 1 65px}.gjs-sm-sector .gjs-sm-property,.gjs-clm-tags .gjs-sm-property{box-sizing:border-box;float:left;width:50%;margin-bottom:5px;padding:0 5px}.gjs-sm-sector .gjs-sm-property--full,.gjs-clm-tags .gjs-sm-property--full,.gjs-sm-sector .gjs-sm-property.gjs-sm-composite,.gjs-clm-tags .gjs-sm-property.gjs-sm-composite,.gjs-sm-sector .gjs-sm-property.gjs-sm-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file,.gjs-sm-sector .gjs-sm-property.gjs-sm-list,.gjs-clm-tags .gjs-sm-property.gjs-sm-list,.gjs-sm-sector .gjs-sm-property.gjs-sm-stack,.gjs-clm-tags .gjs-sm-property.gjs-sm-stack,.gjs-sm-sector .gjs-sm-property.gjs-sm-slider,.gjs-clm-tags .gjs-sm-property.gjs-sm-slider,.gjs-sm-sector .gjs-sm-property.gjs-sm-color,.gjs-clm-tags .gjs-sm-property.gjs-sm-color{width:100%}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn{background-color:rgba(33,33,33,.2);border-radius:2px;box-shadow:1px 1px 0 rgba(5,5,5,.2),1px 1px 0 rgba(43,43,43,.2) inset;padding:5px;position:relative;text-align:center;height:auto;width:100%;cursor:pointer;color:#ddd;box-sizing:border-box;text-shadow:-1px -1px 0 rgba(0,0,0,.2);border:none;opacity:.85;filter:alpha(opacity=85)}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn-c,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn-c{box-sizing:border-box;float:left;width:100%}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box{background-color:rgba(255,255,255,.05);border-radius:2px;margin-top:5px;position:relative;overflow:hidden}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box.gjs-sm-show{border:1px solid rgba(252,252,252,.05);padding:3px 20px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-box #gjs-sm-close{top:-5px;display:block}.gjs-sm-sector .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file{height:50px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file{background-size:auto 100%;background-repeat:no-repeat;background-position:center center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layers,.gjs-clm-tags .gjs-sm-property .gjs-sm-layers{margin-top:5px;padding:1px 3px;min-height:30px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer{background-color:rgba(255,255,255,.055);border-radius:2px;margin:2px 0;padding:7px;position:relative}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer.gjs-sm-active,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer.gjs-sm-active{background-color:rgba(255,255,255,.12)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp{display:flex;align-items:center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-move,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-move{height:14px;width:14px;min-width:14px;cursor:grab}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-label,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-label{flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0 5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{height:15px;width:15px;min-width:15px;margin-right:5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview{background-color:#fff;height:100%;width:100%;background-size:cover !important}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-preview-box{border-radius:2px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer{display:block;cursor:pointer;height:14px;width:14px;min-width:14px;opacity:.5;filter:alpha(opacity=50)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover{opacity:.8;filter:alpha(opacity=80)}.gjs-sm-sector #gjs-sm-text-shadow #gjs-sm-preview::after,.gjs-clm-tags #gjs-sm-text-shadow #gjs-sm-preview::after{color:#000;content:"T";font-weight:900;line-height:17px;padding:0 4px}.gjs-sm-sector .gjs-sm-stack .gjs-sm-properties,.gjs-clm-tags .gjs-sm-stack .gjs-sm-properties{padding:5px 0 0}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add{background:none;border:none;cursor:pointer;outline:none;position:absolute;right:0;top:-17px;opacity:.75;padding:0;width:18px;height:18px}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add:hover,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add:hover{opacity:1;filter:alpha(opacity=100)}.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c{height:100%;width:20px;position:absolute;right:0;top:0;box-sizing:border-box;border-radius:2px;padding:2px}.gjs-sm-sector .gjs-sm-colorp-c .gjs-checker-bg,.gjs-clm-tags .gjs-sm-colorp-c .gjs-checker-bg,.gjs-sm-sector .gjs-sm-colorp-c .gjs-field-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-sm-sector .gjs-sm-color-picker,.gjs-clm-tags .gjs-sm-color-picker{background-color:#ddd;cursor:pointer;height:16px;width:100%;margin-top:-16px;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-upload,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-upload{left:0;top:0;position:absolute;width:100%;opacity:0;cursor:pointer}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-label,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-label{padding:2px 0}.gjs-sm-layer>#gjs-sm-move{opacity:.7;filter:alpha(opacity=70);cursor:move;font-size:12px;float:left;margin:0 5px 0 0}.gjs-sm-layer>#gjs-sm-move:hover{opacity:.9;filter:alpha(opacity=90)}.gjs-blocks-c{display:flex;flex-wrap:wrap;justify-content:flex-start}.gjs-block-categories{display:flex;flex-direction:column}.gjs-block-category{width:100%}.gjs-block-category .gjs-caret-icon{margin-right:5px}.gjs-block{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;width:45%;min-width:45px;padding:1em;box-sizing:border-box;min-height:90px;cursor:all-scroll;font-size:11px;font-weight:lighter;text-align:center;display:flex;flex-direction:column;justify-content:space-between;border:1px solid rgba(0,0,0,.2);border-radius:3px;margin:10px 2.5% 5px;box-shadow:0 1px 0 0 rgba(0,0,0,.15);transition:all .2s ease 0s;transition-property:box-shadow,color}.gjs-block:hover{box-shadow:0 3px 4px 0 rgba(0,0,0,.15)}.gjs-block svg{fill:currentColor}.gjs-block__media{margin-bottom:10px;pointer-events:none}.gjs-block-svg{width:54px;fill:currentColor}.gjs-block-svg-path{fill:currentColor}.gjs-block.fa{font-size:2em;line-height:2em;padding:11px}.gjs-block-label{line-height:normal;font-size:.65rem;font-weight:normal;font-family:Helvetica,sans-serif;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.gjs-block.gjs-bdrag{width:auto;padding:0}.gjs-selected-parent{border:1px solid #ffca6f}.gjs-opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-layer{font-weight:lighter;text-align:left;position:relative;background-color:rgba(0,0,0,.1);font-size:.75rem;display:grid}.gjs-layer-hidden{opacity:.55;filter:alpha(opacity=55)}.gjs-layer-count{position:absolute;right:27px;top:9px}.gjs-layer-vis{height:auto !important;width:auto !important;left:0;top:0;padding:7px 5px 7px 10px;position:absolute;cursor:pointer;z-index:1}.gjs-layer-caret{font-size:.5rem;width:8px;padding:2px;cursor:pointer;position:absolute;left:-9px;top:6px;opacity:.7;filter:alpha(opacity=70)}.gjs-layer-caret:hover{opacity:1;filter:alpha(opacity=100)}.gjs-layer-title{padding:3px 10px 5px 30px;display:flex;align-items:center}.gjs-layer-title-inn{align-items:center;position:relative;display:flex;width:100%}.gjs-layer__icon{display:block;width:100%;max-width:15px;max-height:15px;padding-left:5px}.gjs-layer__icon svg{fill:currentColor}.gjs-layer-name{padding:5px 0;display:inline-block;box-sizing:content-box;overflow:hidden;white-space:nowrap;margin:0 30px 0 5px}.gjs-layer-name--no-edit{text-overflow:ellipsis}.gjs-layer>.gjs-layer-children{display:none}.gjs-layer.open>.gjs-layer-children{display:block}.gjs-layer-no-chld>.gjs-layer-title-inn>.gjs-layer-caret{display:none}.gjs-layer-move{padding:7px 10px 7px 5px;position:absolute;font-size:12px;cursor:move;right:0;top:0}.gjs-layer.gjs-hovered .gjs-layer-title{background-color:rgba(255,255,255,.015)}.gjs-layer.gjs-selected .gjs-layer-title{background-color:rgba(255,255,255,.1)}.gjs-layers{position:relative;height:100%}.gjs-layers #gjs-placeholder{width:100%;position:absolute}.gjs-layers #gjs-placeholder #gjs-plh-int{height:100%;padding:1px}.gjs-layers #gjs-placeholder #gjs-plh-int.gjs-insert{background-color:#62c462}#gjs-clm-add-tag,.gjs-clm-tags-btn{background-color:rgba(255,255,255,.15);border-radius:2px;padding:3px;margin-right:3px;border:1px solid rgba(0,0,0,.15);width:24px;height:24px;box-sizing:border-box;cursor:pointer}.gjs-clm-tags-btn svg{fill:currentColor;display:block}.gjs-clm-header{display:flex;align-items:center;margin:7px 0}.gjs-clm-header-status{flex-shrink:1;margin-left:auto}.gjs-clm-tag{display:flex;overflow:hidden;align-items:center;border-radius:3px;margin:0 3px 3px 0;padding:5px;cursor:default}.gjs-clm-tag-status,.gjs-clm-tag-close{width:12px;height:12px;flex-shrink:1}.gjs-clm-tag-status svg,.gjs-clm-tag-close svg{vertical-align:middle;fill:currentColor}.gjs-clm-sels-info{margin:7px 0}.gjs-clm-sel-id{font-size:.9em;opacity:.5;filter:alpha(opacity=50)}.gjs-clm-label-sel{float:left;padding-right:5px}.gjs-clm-tags{font-size:.75rem;padding:10px 5px}.gjs-clm-tags #gjs-clm-sel{padding:7px 0;float:left}.gjs-clm-tags #gjs-clm-sel{font-style:italic;margin-left:5px}.gjs-clm-tags #gjs-clm-tags-field{clear:both;padding:5px;margin-bottom:5px;display:flex;flex-wrap:wrap}.gjs-clm-tags #gjs-clm-tags-c{display:flex;flex-wrap:wrap;vertical-align:top;overflow:hidden}.gjs-clm-tags #gjs-clm-new{color:#ddd;padding:5px 6px;display:none}.gjs-clm-tags #gjs-clm-close{opacity:.85;filter:alpha(opacity=85);font-size:20px;line-height:0;cursor:pointer;color:rgba(255,255,255,.9)}.gjs-clm-tags #gjs-clm-close:hover{opacity:1;filter:alpha(opacity=100)}.gjs-clm-tags #gjs-clm-checkbox{color:rgba(255,255,255,.9);vertical-align:middle;cursor:pointer;font-size:9px}.gjs-clm-tags #gjs-clm-tag-label{flex-grow:1;text-overflow:ellipsis;overflow:hidden;padding:0 3px;cursor:text}.gjs-mdl-container{font-family:Helvetica,sans-serif;overflow-y:auto;position:fixed;background-color:rgba(0,0,0,.5);display:flex;top:0;left:0;right:0;bottom:0;z-index:100}.gjs-mdl-dialog{text-shadow:-1px -1px 0 rgba(0,0,0,.05);animation:gjs-slide-down .215s;margin:auto;max-width:850px;width:90%;border-radius:3px;font-weight:lighter;position:relative;z-index:2}.gjs-mdl-title{font-size:1rem}.gjs-mdl-btn-close{position:absolute;right:15px;top:5px}.gjs-mdl-active .gjs-mdl-dialog{animation:gjs-mdl-slide-down .216s}.gjs-mdl-header,.gjs-mdl-content{padding:10px 15px;clear:both}.gjs-mdl-header{position:relative;border-bottom:1px solid rgba(0,0,0,.2);padding:15px 15px 7px}.gjs-export-dl::after{content:"";clear:both;display:block;margin-bottom:10px}.gjs-dropzone{display:none;opacity:0;position:absolute;top:0;left:0;z-index:11;width:100%;height:100%;transition:opacity .25s;pointer-events:none}.gjs-dropzone-active .gjs-dropzone{display:block;opacity:1}.gjs-am-assets{height:290px;overflow:auto;clear:both;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:flex-start}.gjs-am-assets-header{padding:5px}.gjs-am-add-asset .gjs-am-add-field{width:70%;float:left}.gjs-am-add-asset button{width:25%;float:right}.gjs-am-preview-cont{position:relative;height:70px;width:30%;background-color:#444;border-radius:2px;float:left;overflow:hidden}.gjs-am-preview{position:absolute;background-position:center center;background-size:cover;background-repeat:no-repeat;height:100%;width:100%;z-index:1}.gjs-am-preview-bg{opacity:.5;filter:alpha(opacity=50);position:absolute;height:100%;width:100%;z-index:0}.gjs-am-dimensions{opacity:.5;filter:alpha(opacity=50);font-size:10px}.gjs-am-meta{width:70%;float:left;font-size:12px;padding:5px 0 0 5px;box-sizing:border-box}.gjs-am-meta>div{margin-bottom:5px}.gjs-am-close{cursor:pointer;position:absolute;right:5px;top:0;display:none}.gjs-am-asset{border-bottom:1px solid rgba(0,0,0,.2);padding:5px;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.gjs-am-asset:hover .gjs-am-close{display:block}.gjs-am-highlight{background-color:rgba(255,255,255,.1)}.gjs-am-assets-cont{background-color:rgba(0,0,0,.1);border-radius:3px;box-sizing:border-box;padding:10px;width:45%;float:right;height:325px;overflow:hidden}.gjs-am-file-uploader{width:55%;float:left}.gjs-am-file-uploader>form{background-color:rgba(0,0,0,.1);border:2px dashed;border-radius:3px;position:relative;text-align:center;margin-bottom:15px}.gjs-am-file-uploader>form.gjs-am-hover{border:2px solid #62c462;color:#75cb75}.gjs-am-file-uploader>form.gjs-am-disabled{border-color:red}.gjs-am-file-uploader>form #gjs-am-uploadFile{opacity:0;filter:alpha(opacity=0);padding:150px 10px;width:100%;box-sizing:border-box}.gjs-am-file-uploader #gjs-am-title{position:absolute;padding:150px 10px;width:100%}.gjs-cm-editor-c{float:left;box-sizing:border-box;width:50%}.gjs-cm-editor-c .CodeMirror{height:450px}.gjs-cm-editor{font-size:12px}.gjs-cm-editor#gjs-cm-htmlmixed{padding-right:10px;border-right:1px solid rgba(0,0,0,.2)}.gjs-cm-editor#gjs-cm-htmlmixed #gjs-cm-title{color:#a97d44}.gjs-cm-editor#gjs-cm-css{padding-left:10px}.gjs-cm-editor#gjs-cm-css #gjs-cm-title{color:#ddca7e}.gjs-cm-editor #gjs-cm-title{background-color:rgba(0,0,0,.2);font-size:12px;padding:5px 10px 3px;text-align:right}.gjs-rte-toolbar{border:1px solid rgba(0,0,0,.2);position:absolute;border-radius:3px;z-index:10}.gjs-rte-actionbar{display:flex}.gjs-rte-action{display:flex;align-items:center;justify-content:center;padding:5px;min-width:25px;border-right:1px solid rgba(0,0,0,.2);text-align:center;cursor:pointer;outline:none}.gjs-rte-action:last-child{border-right:none}.gjs-rte-action:hover{background-color:rgba(255,255,255,.1)}.gjs-rte-active{background-color:rgba(255,255,255,.1)}.gjs-rte-disabled{color:rgba(255,255,255,.1);cursor:not-allowed}.gjs-rte-disabled:hover{background-color:unset}.gjs-editor-cont .sp-hue,.gjs-editor-cont .sp-slider{cursor:row-resize}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-dragger{cursor:crosshair}.gjs-editor-cont .sp-alpha-inner,.gjs-editor-cont .sp-alpha-handle{cursor:col-resize}.gjs-editor-cont .sp-hue{left:90%}.gjs-editor-cont .sp-color{right:15%}.gjs-editor-cont .sp-container{border:1px solid rgba(0,0,0,.2);box-shadow:0 0 7px rgba(0,0,0,.2);border-radius:3px}.gjs-editor-cont .sp-picker-container{border:none}.gjs-editor-cont .colpick_dark .colpick_color{outline:1px solid rgba(0,0,0,.2)}.gjs-editor-cont .sp-cancel,.gjs-editor-cont .sp-cancel:hover{bottom:-8px;color:#777 !important;font-size:25px;left:0;position:absolute;text-decoration:none}.gjs-editor-cont .sp-alpha-handle{background-color:#ccc;border:1px solid #555;width:4px}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-hue{border:1px solid #333}.gjs-editor-cont .sp-slider{background-color:#ccc;border:1px solid #555;height:3px;left:-4px;width:22px}.gjs-editor-cont .sp-dragger{background:transparent;box-shadow:0 0 0 1px #111}.gjs-editor-cont .sp-button-container{float:none;width:100%;position:relative;text-align:right}.gjs-editor-cont .sp-container button,.gjs-editor-cont .sp-container button:hover,.gjs-editor-cont .sp-container button:active{background:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2);color:#ddd;text-shadow:none;box-shadow:none;padding:3px 5px}.gjs-editor-cont .sp-palette-container{border:none;float:none;margin:0;padding:5px 10px 0}.gjs-editor-cont .sp-palette .sp-thumb-el,.gjs-editor-cont .sp-palette .sp-thumb-el:hover{border:1px solid rgba(0,0,0,.9)}.gjs-editor-cont .sp-palette .sp-thumb-el:hover,.gjs-editor-cont .sp-palette .sp-thumb-el.sp-thumb-active{border-color:rgba(0,0,0,.9)}.gjs-hidden{display:none}@keyframes gjs-slide-down{0%{transform:translate(0, -3rem);opacity:0}100%{transform:translate(0, 0);opacity:1}}@keyframes gjs-slide-up{0%{transform:translate(0, 0);opacity:1}100%{transform:translate(0, -3rem);opacity:0}}.cm-s-hopscotch span.cm-error{color:#fff} +.sp-container{position:absolute;top:0;left:0;display:inline-block;*display:inline;*zoom:1;z-index:9999994;overflow:hidden}.sp-container.sp-flat{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{position:relative;width:100%;display:inline-block}.sp-top-inner{position:absolute;top:0;left:0;bottom:0;right:0}.sp-color{position:absolute;top:0;left:0;bottom:0;right:20%}.sp-hue{position:absolute;top:0;right:0;bottom:0;left:84%;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{position:absolute;top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{position:absolute;top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid black;background:white;opacity:.8}.sp-alpha{display:none;position:absolute;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:solid 1px #333}.sp-clear{display:none}.sp-clear.sp-clear-display{background-position:center}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0px;right:0;bottom:0;left:84%;height:28px}.sp-container,.sp-replacer,.sp-preview,.sp-dragger,.sp-slider,.sp-alpha,.sp-clear,.sp-alpha-handle,.sp-container.sp-dragging .sp-input,.sp-container button{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-input-disabled .sp-input-container{display:none}.sp-container.sp-buttons-disabled .sp-button-container{display:none}.sp-container.sp-palette-buttons-disabled .sp-palette-button-container{display:none}.sp-palette-only .sp-picker-container{display:none}.sp-palette-disabled .sp-palette-container{display:none}.sp-initial-disabled .sp-initial{display:none}.sp-sat{background-image:-webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:linear-gradient(to right, #fff, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr="#FFFFFFFF", endColorstr="#00CC9A81")}.sp-val{background-image:-webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:linear-gradient(to top, #000, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00CC9A81", endColorstr="#FF000000")}.sp-hue{background:-moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));background:-webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff0000", endColorstr="#ffff00")}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffff00", endColorstr="#00ff00")}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ff00", endColorstr="#00ffff")}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffff", endColorstr="#0000ff")}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0000ff", endColorstr="#ff00ff")}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff00ff", endColorstr="#ff0000")}.sp-hidden{display:none !important}.sp-cf:before,.sp-cf:after{content:"";display:table}.sp-cf:after{clear:both}.sp-cf{*zoom:1}@media(max-device-width: 480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;cursor:pointer;position:absolute;top:0;left:0}.sp-slider{position:absolute;top:0;cursor:pointer;height:3px;left:-1px;right:-1px;border:1px solid #000;background:white;opacity:.8}.sp-container{border-radius:0;background-color:#ececec;border:solid 1px #f0c49b;padding:0}.sp-container,.sp-container button,.sp-container input,.sp-color,.sp-hue,.sp-clear{font:normal 12px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-color,.sp-hue,.sp-clear{border:solid 1px #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container{width:100%}.sp-input{font-size:12px !important;border:1px inset;padding:4px 5px;margin:0;width:100%;background:transparent;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-picker-container,.sp-palette-container{float:left;position:relative;padding:10px;padding-bottom:300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:solid 1px #fff}.sp-palette-container{border-right:solid 1px #ccc}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;width:24px;height:15px;margin:3px;cursor:pointer;border:solid 2px transparent}.sp-palette .sp-thumb-el:hover,.sp-palette .sp-thumb-el.sp-thumb-active{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:solid 1px #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:center}.sp-palette-button-container,.sp-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;*zoom:1;*display:inline;border:solid 1px #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer:hover,.sp-replacer.sp-active{border-color:#f0c49b;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px}.sp-preview{position:relative;width:25px;height:20px;border:solid 1px #222;margin-right:5px;float:left;z-index:0}.sp-palette{*width:220px;max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:solid 1px #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top, #eeeeee, #cccccc);background-image:-moz-linear-gradient(top, #eeeeee, #cccccc);background-image:-ms-linear-gradient(top, #eeeeee, #cccccc);background-image:-o-linear-gradient(top, #eeeeee, #cccccc);background-image:linear-gradient(to bottom, #eeeeee, #cccccc);border:1px solid #ccc;border-bottom:1px solid #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top, #dddddd, #bbbbbb);background-image:-moz-linear-gradient(top, #dddddd, #bbbbbb);background-image:-ms-linear-gradient(top, #dddddd, #bbbbbb);background-image:-o-linear-gradient(top, #dddddd, #bbbbbb);background-image:linear-gradient(to bottom, #dddddd, #bbbbbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid #aaa;border-bottom:1px solid #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f !important;margin:0;padding:2px;margin-right:5px;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f !important;text-decoration:underline}.sp-palette span:hover,.sp-palette span.sp-thumb-active{border-color:#000}.sp-preview,.sp-alpha,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-preview-inner,.sp-alpha-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==)}.CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20, 255, 20, 0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:blue}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, 0.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, 0.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-hopscotch.CodeMirror{background:#322931;color:#d5d3d5}.cm-s-hopscotch div.CodeMirror-selected{background:#433b42 !important}.cm-s-hopscotch .CodeMirror-gutters{background:#322931;border-right:0px}.cm-s-hopscotch .CodeMirror-linenumber{color:#797379}.cm-s-hopscotch .CodeMirror-cursor{border-left:1px solid #989498 !important}.cm-s-hopscotch span.cm-comment{color:#b33508}.cm-s-hopscotch span.cm-atom{color:#c85e7c}.cm-s-hopscotch span.cm-number{color:#c85e7c}.cm-s-hopscotch span.cm-property,.cm-s-hopscotch span.cm-attribute{color:#8fc13e}.cm-s-hopscotch span.cm-keyword{color:#dd464c}.cm-s-hopscotch span.cm-string{color:#fdcc59}.cm-s-hopscotch span.cm-variable{color:#8fc13e}.cm-s-hopscotch span.cm-variable-2{color:#1290bf}.cm-s-hopscotch span.cm-def{color:#fd8b19}.cm-s-hopscotch span.cm-error{background:#dd464c;color:#989498}.cm-s-hopscotch span.cm-bracket{color:#d5d3d5}.cm-s-hopscotch span.cm-tag{color:#dd464c}.cm-s-hopscotch span.cm-link{color:#c85e7c}.cm-s-hopscotch .CodeMirror-matchingbracket{text-decoration:underline;color:white !important}.cm-s-hopscotch .CodeMirror-activeline-background{background:#302020}@font-face{font-family:"font3336";src:url("../fonts/main-fonts.eot?v=20");src:url("../fonts/main-fonts.woff?v=20") format("woff"),url("../fonts/main-fonts.ttf?v=20") format("truetype"),url("../fonts/main-fonts.svg?v=20") format("svg"),url("../fonts/main-fonts.eot?v=20") format("embedded-opentype");font-weight:normal;font-style:normal}.gjs-is__grab,.gjs-is__grab *{cursor:grab !important}.gjs-is__grabbing,.gjs-is__grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:grabbing !important}.gjs-one-bg{background-color:#444}.gjs-one-color{color:#444}.gjs-one-color-h:hover{color:#444}.gjs-two-bg{background-color:#ddd}.gjs-two-color{color:#ddd}.gjs-two-color-h:hover{color:#ddd}.gjs-three-bg{background-color:#804f7b}.gjs-three-color{color:#804f7b}.gjs-three-color-h:hover{color:#804f7b}.gjs-four-bg{background-color:#d278c9}.gjs-four-color{color:#d278c9}.gjs-four-color-h:hover{color:#d278c9}.gjs-danger-bg{background-color:#dd3636}.gjs-danger-color{color:#dd3636}.gjs-danger-color-h:hover{color:#dd3636}.gjs-bg-main,.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c,.gjs-off-prv{background-color:#444}.gjs-color-main,.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add,.gjs-off-prv{color:#ddd;fill:#ddd}.gjs-color-active{color:#f8f8f8;fill:#f8f8f8}.gjs-color-warn{color:#ffca6f;fill:#ffca6f}.gjs-color-hl{color:#71b7f1;fill:#71b7f1}.gjs-fonts::before{display:block;font:normal normal normal 14px font3336;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:5em}.gjs-f-b1::before{content:"Q"}.gjs-f-b2::before{content:"W"}.gjs-f-b3::before{content:"E"}.gjs-f-b37::before{content:"R"}.gjs-f-hero::before{content:"T"}.gjs-f-h1p::before{content:"y"}.gjs-f-3ba::before{content:"u"}.gjs-f-image::before{content:"I"}.gjs-f-text::before{content:"o"}.gjs-f-quo::before{content:"p"}.gjs-f-button::before{content:"B"}.gjs-f-divider::before{content:"D"}.gjs-invis-invis,.gjs-clm-tags #gjs-clm-new,.gjs-no-app{background-color:transparent;border:none;color:inherit}.gjs-no-app{height:10px}.gjs-test::btn{color:"#fff"}.opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-checker-bg,.gjs-field-colorp-c,.checker-bg,.gjs-sm-sector .gjs-sm-property .gjs-sm-layer-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer-preview{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==")}.gjs-no-user-select,.gjs-rte-toolbar,.gjs-layer-name,.gjs-grabbing,.gjs-grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-pointer-events,.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el,.gjs-resizer-c{pointer-events:none}.gjs-bdrag{pointer-events:none !important;position:absolute !important;z-index:10 !important;width:auto}.gjs-drag-helper{background-color:#3b97e3 !important;pointer-events:none !important;position:absolute !important;z-index:10 !important;transform:scale(0.3) !important;transform-origin:top left !important;-webkit-transform-origin:top left !important;margin:15px !important;transition:none !important;outline:none !important}.gjs-grabbing,.gjs-grabbing *{cursor:grabbing !important;cursor:-webkit-grabbing !important}.gjs-grabbing{overflow:hidden}.gjs-off-prv{position:relative;z-index:10;padding:5px;cursor:pointer}.gjs-editor-cont ::-webkit-scrollbar-track{background:rgba(0,0,0,.1)}.gjs-editor-cont ::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.2)}.gjs-editor-cont ::-webkit-scrollbar{width:8px}.clear{clear:both}.no-select,.gjs-clm-tags #gjs-clm-close,.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title,.gjs-com-no-select,.gjs-com-no-select img{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-touch-actions{touch-action:none}.gjs-disabled{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;opacity:.5;filter:alpha(opacity=50)}.gjs-editor{font-family:Helvetica,sans-serif;font-size:.75rem;position:relative;box-sizing:border-box;height:100%}.gjs-freezed,.gjs-freezed{opacity:.5;filter:alpha(opacity=50);pointer-events:none}.gjs-traits-label{border-bottom:1px solid rgba(0,0,0,.2);font-weight:lighter;margin-bottom:5px;padding:10px;text-align:left}.gjs-label-wrp{width:30%;min-width:30%}.gjs-field-wrp{flex-grow:1}.gjs-trt-header{font-weight:lighter;padding:10px}.gjs-trt-trait{display:flex;justify-content:flex-start;padding:5px 10px;font-weight:lighter;align-items:center;text-align:left}.gjs-trt-traits{font-size:.75rem}.gjs-trt-trait .gjs-label{text-align:left;text-overflow:ellipsis;overflow:hidden}.gjs-guide-info{position:absolute}.gjs-guide-info__content{position:absolute;height:100%;display:flex;width:100%;padding:5px}.gjs-guide-info__line{position:relative;margin:auto}.gjs-guide-info__line::before,.gjs-guide-info__line::after{content:"";display:block;position:absolute;background-color:inherit}.gjs-guide-info__y{padding:0 5px}.gjs-guide-info__y .gjs-guide-info__content{justify-content:center}.gjs-guide-info__y .gjs-guide-info__line{width:100%;height:1px}.gjs-guide-info__y .gjs-guide-info__line::before,.gjs-guide-info__y .gjs-guide-info__line::after{width:1px;height:10px;top:0;bottom:0;left:0;margin:auto}.gjs-guide-info__y .gjs-guide-info__line::after{left:auto;right:0}.gjs-guide-info__x{padding:5px 0}.gjs-guide-info__x .gjs-guide-info__content{align-items:center}.gjs-guide-info__x .gjs-guide-info__line{height:100%;width:1px}.gjs-guide-info__x .gjs-guide-info__line::before,.gjs-guide-info__x .gjs-guide-info__line::after{width:10px;height:1px;left:0;right:0;top:0;margin:auto;transform:translateX(-50%)}.gjs-guide-info__x .gjs-guide-info__line::after{top:auto;bottom:0}.gjs-badge{white-space:nowrap}.gjs-badge__icon{vertical-align:middle;display:inline-block;width:15px;height:15px}.gjs-badge__icon svg{fill:currentColor}.gjs-badge__name{display:inline-block;vertical-align:middle}.gjs-frame-wrapper{position:absolute;width:100%;height:100%;left:0;right:0;margin:auto}.gjs-frame-wrapper--anim{transition:width .35s ease,height .35s ease}.gjs-frame-wrapper__top{transform:translateY(-100%) translateX(-50%);display:flex;padding:5px 0;position:absolute;width:100%;left:50%;top:0}.gjs-frame-wrapper__top-r{margin-left:auto}.gjs-frame-wrapper__left{position:absolute;left:0;transform:translateX(-100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__bottom{position:absolute;bottom:0;transform:translateY(100%) translateX(-50%);width:100%;left:50%}.gjs-frame-wrapper__right{position:absolute;right:0;transform:translateX(100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__icon{width:24px;cursor:pointer}.gjs-frame-wrapper__icon>svg{fill:currentColor}.gjs-padding-v-top,.gjs-fixedpadding-v-top{width:100%;top:0;left:0}.gjs-padding-v-right,.gjs-fixedpadding-v-right{right:0}.gjs-padding-v-bottom,.gjs-fixedpadding-v-bottom{width:100%;left:0;bottom:0}.gjs-padding-v-left,.gjs-fixedpadding-v-left{left:0}.gjs-cv-canvas{background-color:rgba(0,0,0,.15);box-sizing:border-box;width:85%;height:calc(100% - 40px);bottom:0;overflow:hidden;z-index:1;position:absolute;left:0;top:40px}.gjs-cv-canvas.gjs-cui{width:100%;height:100%;top:0}.gjs-cv-canvas.gjs-is__grab .gjs-cv-canvas__frames,.gjs-cv-canvas.gjs-is__grabbing .gjs-cv-canvas__frames{pointer-events:none}.gjs-cv-canvas__frames{position:absolute;top:0;left:0;width:100%;height:100%}.gjs-cv-canvas .gjs-ghost{display:none;pointer-events:none;background-color:#5b5b5b;border:2px dashed #ccc;position:absolute;z-index:10;opacity:.55;filter:alpha(opacity=55)}.gjs-cv-canvas .gjs-highlighter,.gjs-cv-canvas .gjs-highlighter-sel{position:absolute;outline:1px solid #3b97e3;outline-offset:-1px;pointer-events:none;width:100%;height:100%}.gjs-cv-canvas .gjs-highlighter-warning{outline:3px solid #ffca6f}.gjs-cv-canvas .gjs-highlighter-sel{outline:2px solid #3b97e3;outline-offset:-2px}.gjs-cv-canvas #gjs-tools,.gjs-cv-canvas .gjs-tools{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;z-index:1}.gjs-cv-canvas *{box-sizing:border-box}.gjs-frame{outline:medium none;height:100%;width:100%;border:none;margin:auto;display:block;transition:width .35s ease,height .35s ease;position:absolute;top:0;bottom:0;left:0;right:0}.gjs-toolbar{position:absolute;background-color:#3b97e3;white-space:nowrap;color:#fff;z-index:10;top:0;left:0}.gjs-toolbar-item{padding:5px 7px;font-size:.8rem;cursor:pointer;width:26px;vertical-align:middle;display:inline-block}.gjs-toolbar-item svg{fill:currentColor;vertical-align:middle}.gjs-resizer-c{position:absolute;left:0;top:0;width:100%;height:100%;z-index:9}.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.1;filter:alpha(opacity=10);position:absolute;background-color:#ff0}.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.2;filter:alpha(opacity=20)}.gjs-padding-v-el,.gjs-fixedpadding-v-el{background-color:navy}.gjs-resizer-h{pointer-events:all;position:absolute;border:3px solid #3b97e3;width:10px;height:10px;background-color:#fff;margin:-5px}.gjs-resizer-h-tl{top:0;left:0;cursor:nwse-resize}.gjs-resizer-h-tr{top:0;right:0;cursor:nesw-resize}.gjs-resizer-h-tc{top:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-cl{left:0;margin:auto -5px;top:0;bottom:0;cursor:ew-resize}.gjs-resizer-h-cr{margin:auto -5px;top:0;bottom:0;right:0;cursor:ew-resize}.gjs-resizer-h-bl{bottom:0;left:0;cursor:nesw-resize}.gjs-resizer-h-bc{bottom:0;margin:-5px auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-br{bottom:0;right:0;cursor:nwse-resize}.gjs-pn-panel .gjs-resizer-h{background-color:rgba(0,0,0,.2);border:none;opacity:0;transition:opacity .25s}.gjs-pn-panel .gjs-resizer-h:hover{opacity:1}.gjs-pn-panel .gjs-resizer-h-tc,.gjs-pn-panel .gjs-resizer-h-bc{margin:0 auto;width:100%}.gjs-pn-panel .gjs-resizer-h-cr,.gjs-pn-panel .gjs-resizer-h-cl{margin:auto 0;height:100%}.gjs-resizing .gjs-highlighter,.gjs-resizing .gjs-badge{display:none !important}.gjs-resizing-tl *{cursor:nwse-resize !important}.gjs-resizing-tr *{cursor:nesw-resize !important}.gjs-resizing-tc *{cursor:ns-resize !important}.gjs-resizing-cl *{cursor:ew-resize !important}.gjs-resizing-cr *{cursor:ew-resize !important}.gjs-resizing-bl *{cursor:nesw-resize !important}.gjs-resizing-bc *{cursor:ns-resize !important}.gjs-resizing-br *{cursor:nwse-resize !important}.btn-cl,.gjs-am-close,.gjs-mdl-btn-close{opacity:.3;filter:alpha(opacity=30);font-size:25px;cursor:pointer}.btn-cl:hover,.gjs-am-close:hover,.gjs-mdl-btn-close:hover{opacity:.7;filter:alpha(opacity=70)}.no-dots,.ui-resizable-handle{border:none !important;margin:0 !important;outline:none !important}.gjs-com-dashed *{outline:1px dashed #888;outline-offset:-2px;box-sizing:border-box}.gjs-cv-canvas .gjs-comp-selected{outline:3px solid #3b97e3 !important}*.gjs-com-hover,div.gjs-com-hover{outline:1px solid #3b97e3}*.gjs-com-hover-delete,div.gjs-com-hover-delete{outline:2px solid #dd3636;opacity:.5;filter:alpha(opacity=50)}*.gjs-com-hover-move,div.gjs-com-hover-move{outline:3px solid #ffca6f}.gjs-com-badge,.gjs-com-badge-red,.gjs-badge{pointer-events:none;background-color:#3b97e3;color:#fff;padding:2px 5px;position:absolute;z-index:1;font-size:12px;outline:none;display:none}.gjs-com-badge-red{background-color:#dd3636}.gjs-badge-warning{background-color:#ffca6f}.gjs-placeholder,.gjs-com-placeholder,.gjs-placeholder{position:absolute;z-index:10;pointer-events:none;display:none}.gjs-placeholder,.gjs-placeholder{border-style:solid !important;outline:none;box-sizing:border-box;transition:top .2s,left .2s,width .2s,height .2s}.gjs-placeholder.horizontal,.gjs-com-placeholder.horizontal,.gjs-placeholder.horizontal{border-color:transparent #62c462;border-width:3px 5px;margin:-3px 0 0}.gjs-placeholder.vertical,.gjs-com-placeholder.vertical,.gjs-placeholder.vertical{border-color:#62c462 transparent;border-width:5px 3px;margin:0 0 0 -3px}.gjs-placeholder-int,.gjs-com-placeholder-int,.gjs-placeholder-int{background-color:#62c462;box-shadow:0 0 3px rgba(0,0,0,.2);height:100%;width:100%;pointer-events:none;padding:1.5px;outline:none}.gjs-pn-panel{display:inline-block;position:absolute;box-sizing:border-box;text-align:center;padding:5px;z-index:3}.gjs-pn-panel .icon-undo,.gjs-pn-panel .icon-redo{font-size:20px;height:30px;width:25px}.gjs-pn-commands{width:85%;left:0;top:0;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-options{right:15%;top:0}.gjs-pn-views{border-bottom:2px solid rgba(0,0,0,.2);right:0;width:15%;z-index:4}.gjs-pn-views-container{height:100%;padding:42px 0 0;right:0;width:15%;overflow:auto;box-shadow:0 0 5px rgba(0,0,0,.2)}.gjs-pn-buttons{align-items:center;display:flex;justify-content:space-between}.gjs-pn-btn{box-sizing:border-box;min-height:30px;min-width:30px;line-height:21px;background-color:transparent;border:none;font-size:18px;margin-right:5px;border-radius:2px;padding:4px;position:relative;cursor:pointer}.gjs-pn-btn.gjs-pn-active{background-color:rgba(0,0,0,.15);box-shadow:0 0 3px rgba(0,0,0,.25) inset}.gjs-pn-btn svg{fill:currentColor}.gjs-comp-image-placeholder{display:block;background-color:#f5f5f5;color:#777;height:50px;width:50px;line-height:50px;outline:3px solid #ffca6f;outline-offset:-3px;text-align:center;font-size:16.6666666667px;cursor:pointer}.gjs-comp-image-placeholder.fa-picture-o::after{content:""}.gjs-label{line-height:18px}.gjs-fields{display:flex}.gjs-select{padding:0;width:100%}.gjs-select select{padding-right:10px}.gjs-select:-moz-focusring,.gjs-select select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-input:focus,.gjs-button:focus,.gjs-btn-prim:focus,.gjs-select:focus,.gjs-select select:focus{outline:none}.gjs-field input,.gjs-field select,.gjs-field textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:inherit;border:none;background-color:transparent;box-sizing:border-box;width:100%;position:relative;padding:5px;z-index:1}.gjs-field input:focus,.gjs-field select:focus,.gjs-field textarea:focus{outline:none}.gjs-field input[type=number]{-moz-appearance:textfield}.gjs-field input[type=number]::-webkit-outer-spin-button,.gjs-field input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gjs-field-range{flex:9 1 auto}.gjs-field-integer input{padding-right:30px}.gjs-select option,.gjs-field-select option,.gjs-clm-select option,.gjs-sm-select option,.gjs-fields option,.gjs-sm-unit option{background-color:#444;color:#ddd}.gjs-field{background-color:rgba(0,0,0,.2);border:none;box-shadow:none;border-radius:2px;box-sizing:border-box;padding:0;position:relative}.gjs-field textarea{resize:vertical}.gjs-field .gjs-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;z-index:0}.gjs-field .gjs-d-s-arrow{bottom:0;top:0;margin:auto;right:5px;border-top:4px solid rgba(255,255,255,.7);position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-field-arrows{position:absolute;cursor:ns-resize;margin:auto;height:20px;width:9px;z-index:10;bottom:0;right:3px;top:0}.gjs-field-color,.gjs-field-radio{width:100%}.gjs-field-color input{padding-right:22px;box-sizing:border-box}.gjs-field-colorp{border-left:1px solid rgba(0,0,0,.2);box-sizing:border-box;height:100%;padding:2px;position:absolute;right:0;top:0;width:22px;z-index:10}.gjs-field-colorp .gjs-checker-bg,.gjs-field-colorp .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-field-colorp-c{height:100%;position:relative;width:100%}.gjs-field-color-picker{background-color:#ddd;cursor:pointer;height:100%;width:100%;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px;position:absolute;top:0}.gjs-field-checkbox{padding:0;width:17px;height:17px;display:block;cursor:pointer}.gjs-field-checkbox input{display:none}.gjs-field-checkbox input:checked+.gjs-chk-icon{border-color:rgba(255,255,255,.5);border-width:0 2px 2px 0;border-style:solid}.gjs-radio-item{flex:1 1 auto;text-align:center;border-left:1px solid rgba(0,0,0,.2)}.gjs-radio-item:first-child{border:none}.gjs-radio-item:hover{background:rgba(0,0,0,.2)}.gjs-radio-item input{display:none}.gjs-radio-item input:checked+.gjs-radio-item-label{background-color:rgba(255,255,255,.2)}.gjs-radio-items{display:flex}.gjs-radio-item-label{cursor:pointer;display:block;padding:5px}.gjs-field-units{position:absolute;margin:auto;right:10px;bottom:0;top:0}.gjs-field-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-field-arrow-u,.gjs-field-arrow-d{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(255,255,255,.7);bottom:4px;cursor:pointer}.gjs-field-arrow-u{border-bottom:4px solid rgba(255,255,255,.7);border-top:none;top:4px}.gjs-field-select{padding:0}.gjs-field-range{background-color:transparent;border:none;box-shadow:none;padding:0}.gjs-field-range input{margin:0;height:100%}.gjs-field-range input:focus{outline:none}.gjs-field-range input::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-ms-thumb{height:10px;width:10px;border:1px solid rgba(0,0,0,.2);border-radius:100%;background-color:#ddd;cursor:pointer}.gjs-field-range input::-moz-range-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-webkit-slider-runnable-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-ms-track{background-color:rgba(0,0,0,.2);border-radius:1px;margin-top:3px;height:3px}.gjs-btn-prim{color:inherit;background-color:rgba(255,255,255,.1);border-radius:2px;padding:3px 6px;padding:5px;cursor:pointer;border:none}.gjs-btn-prim:active{background-color:rgba(255,255,255,.1)}.gjs-btn--full{width:100%}.gjs-chk-icon{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);box-sizing:border-box;display:block;height:14px;margin:0 5px;width:6px}.gjs-add-trasp{background:none;border:none;color:#ddd;cursor:pointer;font-size:1em;border-radius:2px;opacity:.75;filter:alpha(opacity=75)}.gjs-add-trasp:hover{opacity:1;filter:alpha(opacity=100)}.gjs-add-trasp:active{background-color:rgba(0,0,0,.2)}.gjs-devices-c{display:flex;align-items:center;padding:3px}.gjs-devices-c .gjs-device-label{flex-grow:2;text-align:left;margin-right:10px}.gjs-devices-c .gjs-select{flex-grow:20}.gjs-devices-c .gjs-add-trasp{flex-grow:1;margin-left:5px}.gjs-category-open,.gjs-block-category.gjs-open,.gjs-sm-sector.gjs-sm-open,.gjs-sm-open.gjs-clm-tags{border-bottom:1px solid rgba(0,0,0,.25)}.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title{font-weight:lighter;background-color:rgba(0,0,0,.1);letter-spacing:1px;padding:9px 10px 9px 20px;border-bottom:1px solid rgba(0,0,0,.25);text-align:left;position:relative;cursor:pointer}.gjs-sm-clear{cursor:pointer;width:14px;min-width:14px;height:14px;margin-left:3px}.gjs-sm-header{font-weight:lighter;padding:10px}.gjs-sm-properties{font-size:.75rem;padding:10px 5px;display:flex;flex-wrap:wrap;align-items:flex-end;box-sizing:border-box;width:100%}.gjs-sm-label{margin:5px 5px 3px 0;display:flex;align-items:center}.gjs-sm-close-btn,.gjs-sm-sector .gjs-sm-property .gjs-sm-preview-file-box .gjs-sm-preview-file-close,.gjs-clm-tags .gjs-sm-property .gjs-sm-preview-file-box .gjs-sm-preview-file-close{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.2;filter:alpha(opacity=20)}.gjs-sm-close-btn:hover,.gjs-sm-sector .gjs-sm-property .gjs-sm-preview-file-box .gjs-sm-preview-file-close:hover,.gjs-clm-tags .gjs-sm-property .gjs-sm-preview-file-box .gjs-sm-preview-file-close:hover{opacity:.7;filter:alpha(opacity=70)}.gjs-sm-sector,.gjs-clm-tags{clear:both;font-weight:lighter;text-align:left}.gjs-sm-sector .gjs-sm-title-caret,.gjs-clm-tags .gjs-sm-title-caret{width:17px;height:17px;min-width:17px;transform:rotate(-90deg)}.gjs-sm-sector .gjs-sm-title-label,.gjs-clm-tags .gjs-sm-title-label{margin-left:5px}.gjs-sm-sector.gjs-sm-open .gjs-sm-title-caret,.gjs-sm-open.gjs-clm-tags .gjs-sm-title-caret{transform:none}.gjs-sm-sector .gjs-sm-title,.gjs-clm-tags .gjs-sm-title{display:flex;align-items:center}.gjs-sm-sector .gjs-sm-field,.gjs-clm-tags .gjs-sm-field,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-clm-field,.gjs-clm-tags .gjs-clm-field{width:100%;position:relative}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input,.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{background-color:transparent;color:rgba(255,255,255,.7);border:none;width:100%}.gjs-sm-sector .gjs-sm-field input,.gjs-clm-tags .gjs-sm-field input,.gjs-sm-sector .gjs-clm-select input,.gjs-clm-tags .gjs-clm-select input,.gjs-sm-sector .gjs-clm-field input,.gjs-clm-tags .gjs-clm-field input{box-sizing:border-box}.gjs-sm-sector .gjs-sm-field select,.gjs-clm-tags .gjs-sm-field select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-clm-field select,.gjs-clm-tags .gjs-clm-field select{position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gjs-sm-sector .gjs-sm-field select::-ms-expand,.gjs-clm-tags .gjs-sm-field select::-ms-expand,.gjs-sm-sector .gjs-clm-select select::-ms-expand,.gjs-clm-tags .gjs-clm-select select::-ms-expand,.gjs-sm-sector .gjs-clm-field select::-ms-expand,.gjs-clm-tags .gjs-clm-field select::-ms-expand{display:none}.gjs-sm-sector .gjs-sm-field select:-moz-focusring,.gjs-clm-tags .gjs-sm-field select:-moz-focusring,.gjs-sm-sector .gjs-clm-select select:-moz-focusring,.gjs-clm-tags .gjs-clm-select select:-moz-focusring,.gjs-sm-sector .gjs-clm-field select:-moz-focusring,.gjs-clm-tags .gjs-clm-field select:-moz-focusring{color:transparent;text-shadow:0 0 0 rgba(255,255,255,.7)}.gjs-sm-sector .gjs-sm-field input:focus,.gjs-clm-tags .gjs-sm-field input:focus,.gjs-sm-sector .gjs-clm-select input:focus,.gjs-clm-tags .gjs-clm-select input:focus,.gjs-sm-sector .gjs-clm-field input:focus,.gjs-clm-tags .gjs-clm-field input:focus,.gjs-sm-sector .gjs-sm-field select:focus,.gjs-clm-tags .gjs-sm-field select:focus,.gjs-sm-sector .gjs-clm-select select:focus,.gjs-clm-tags .gjs-clm-select select:focus,.gjs-sm-sector .gjs-clm-field select:focus,.gjs-clm-tags .gjs-clm-field select:focus{outline:none}.gjs-sm-sector .gjs-sm-field .gjs-sm-unit,.gjs-clm-tags .gjs-sm-field .gjs-sm-unit,.gjs-sm-sector .gjs-clm-select .gjs-sm-unit,.gjs-clm-tags .gjs-clm-select .gjs-sm-unit,.gjs-sm-sector .gjs-clm-field .gjs-sm-unit,.gjs-clm-tags .gjs-clm-field .gjs-sm-unit{position:absolute;right:10px;top:3px;font-size:10px;color:rgba(255,255,255,.7);cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-sel-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-sm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-select .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-select .gjs-sm-int-arrows,.gjs-sm-sector .gjs-clm-field .gjs-sm-int-arrows,.gjs-clm-tags .gjs-clm-field .gjs-sm-int-arrows,.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;cursor:ns-resize}.gjs-sm-sector .gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-sel-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-sel-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-sel-arrow{cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.gjs-sm-sector .gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-u-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-u-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-u-arrow{border-bottom:4px solid rgba(255,255,255,.7);top:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{border-top:4px solid rgba(255,255,255,.7);bottom:4px}.gjs-sm-sector .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-sector .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-sm-field .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-select .gjs-sm-d-s-arrow,.gjs-sm-sector .gjs-clm-field .gjs-sm-d-s-arrow,.gjs-clm-tags .gjs-clm-field .gjs-sm-d-s-arrow{bottom:7px}.gjs-sm-sector .gjs-sm-field.gjs-sm-color,.gjs-clm-tags .gjs-sm-field.gjs-sm-color,.gjs-sm-sector .gjs-sm-color.gjs-clm-field,.gjs-clm-tags .gjs-sm-color.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-input,.gjs-clm-tags .gjs-sm-field.gjs-sm-input,.gjs-sm-sector .gjs-sm-input.gjs-clm-field,.gjs-clm-tags .gjs-sm-input.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-integer,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field,.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{background-color:rgba(0,0,0,.2);border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 0 rgba(255,255,255,.1);color:rgba(255,255,255,.7);border-radius:2px;box-sizing:border-box;padding:0 5px}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{border-radius:2px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select,.gjs-sm-sector .gjs-clm-select,.gjs-clm-tags .gjs-clm-select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field,.gjs-clm-tags .gjs-sm-select.gjs-clm-field{padding:0}.gjs-sm-sector .gjs-sm-field.gjs-sm-select select,.gjs-clm-tags .gjs-sm-field.gjs-sm-select select,.gjs-sm-sector .gjs-clm-select select,.gjs-clm-tags .gjs-clm-select select,.gjs-sm-sector .gjs-sm-select.gjs-clm-field select,.gjs-clm-tags .gjs-sm-select.gjs-clm-field select{height:20px}.gjs-sm-sector .gjs-sm-field.gjs-sm-select option,.gjs-clm-tags .gjs-sm-field.gjs-sm-select option,.gjs-sm-sector .gjs-clm-select option,.gjs-clm-tags .gjs-clm-select option,.gjs-sm-sector .gjs-sm-select.gjs-clm-field option,.gjs-clm-tags .gjs-sm-select.gjs-clm-field option{padding:3px 0}.gjs-sm-sector .gjs-sm-field.gjs-sm-composite,.gjs-clm-tags .gjs-sm-field.gjs-sm-composite,.gjs-sm-sector .gjs-sm-composite.gjs-clm-select,.gjs-clm-tags .gjs-sm-composite.gjs-clm-select,.gjs-sm-sector .gjs-sm-composite.gjs-clm-field,.gjs-clm-tags .gjs-sm-composite.gjs-clm-field{background-color:rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.25)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list,.gjs-clm-tags .gjs-sm-field.gjs-sm-list,.gjs-sm-sector .gjs-sm-list.gjs-clm-select,.gjs-clm-tags .gjs-sm-list.gjs-clm-select,.gjs-sm-sector .gjs-sm-list.gjs-clm-field,.gjs-clm-tags .gjs-sm-list.gjs-clm-field{width:auto;padding:0;overflow:hidden;float:left}.gjs-sm-sector .gjs-sm-field.gjs-sm-list input,.gjs-clm-tags .gjs-sm-field.gjs-sm-list input,.gjs-sm-sector .gjs-sm-list.gjs-clm-select input,.gjs-clm-tags .gjs-sm-list.gjs-clm-select input,.gjs-sm-sector .gjs-sm-list.gjs-clm-field input,.gjs-clm-tags .gjs-sm-list.gjs-clm-field input{display:none}.gjs-sm-sector .gjs-sm-field.gjs-sm-list label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field label{cursor:pointer;padding:5px;display:block}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label{background-color:rgba(255,255,255,.2)}.gjs-sm-sector .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-clm-tags .gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-sm-sector .gjs-sm-list.gjs-clm-field .gjs-sm-icon,.gjs-clm-tags .gjs-sm-list.gjs-clm-field .gjs-sm-icon{background-repeat:no-repeat;background-position:center;text-shadow:none;line-height:normal}.gjs-sm-sector .gjs-sm-field.gjs-sm-integer select,.gjs-clm-tags .gjs-sm-field.gjs-sm-integer select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-select select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-select select,.gjs-sm-sector .gjs-sm-integer.gjs-clm-field select,.gjs-clm-tags .gjs-sm-integer.gjs-clm-field select{width:auto;padding:0}.gjs-sm-sector .gjs-sm-list .gjs-sm-el,.gjs-clm-tags .gjs-sm-list .gjs-sm-el{float:left;border-left:1px solid rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:first-child,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:first-child{border:none}.gjs-sm-sector .gjs-sm-list .gjs-sm-el:hover,.gjs-clm-tags .gjs-sm-list .gjs-sm-el:hover{background:rgba(0,0,0,.2)}.gjs-sm-sector .gjs-sm-slider .gjs-field-integer,.gjs-clm-tags .gjs-sm-slider .gjs-field-integer{flex:1 1 65px}.gjs-sm-sector .gjs-sm-property,.gjs-clm-tags .gjs-sm-property{box-sizing:border-box;float:left;width:50%;margin-bottom:5px;padding:0 5px}.gjs-sm-sector .gjs-sm-property--full,.gjs-clm-tags .gjs-sm-property--full,.gjs-sm-sector .gjs-sm-property.gjs-sm-composite,.gjs-clm-tags .gjs-sm-property.gjs-sm-composite,.gjs-sm-sector .gjs-sm-property.gjs-sm-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file,.gjs-sm-sector .gjs-sm-property.gjs-sm-list,.gjs-clm-tags .gjs-sm-property.gjs-sm-list,.gjs-sm-sector .gjs-sm-property.gjs-sm-stack,.gjs-clm-tags .gjs-sm-property.gjs-sm-stack,.gjs-sm-sector .gjs-sm-property.gjs-sm-slider,.gjs-clm-tags .gjs-sm-property.gjs-sm-slider,.gjs-sm-sector .gjs-sm-property.gjs-sm-color,.gjs-clm-tags .gjs-sm-property.gjs-sm-color{width:100%}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn{background-color:rgba(33,33,33,.2);border-radius:2px;box-shadow:1px 1px 0 rgba(5,5,5,.2),1px 1px 0 rgba(43,43,43,.2) inset;padding:5px;position:relative;text-align:center;height:auto;width:100%;cursor:pointer;color:#ddd;box-sizing:border-box;text-shadow:-1px -1px 0 rgba(0,0,0,.2);border:none;opacity:.85;filter:alpha(opacity=85)}.gjs-sm-sector .gjs-sm-property .gjs-sm-btn-c,.gjs-clm-tags .gjs-sm-property .gjs-sm-btn-c{box-sizing:border-box;float:left;width:100%}.gjs-sm-sector .gjs-sm-property .gjs-sm-preview-file-box,.gjs-clm-tags .gjs-sm-property .gjs-sm-preview-file-box{background-color:rgba(255,255,255,.05);border-radius:2px;margin-top:5px;position:relative;overflow:hidden}.gjs-sm-sector .gjs-sm-property .gjs-sm-preview-file-box.gjs-sm-show,.gjs-clm-tags .gjs-sm-property .gjs-sm-preview-file-box.gjs-sm-show{border:1px solid rgba(252,252,252,.05);padding:3px 20px}.gjs-sm-sector .gjs-sm-property .gjs-sm-preview-file-box .gjs-sm-preview-file-close,.gjs-clm-tags .gjs-sm-property .gjs-sm-preview-file-box .gjs-sm-preview-file-close{top:-5px;display:block}.gjs-sm-sector .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file .gjs-sm-show #gjs-sm-preview-file{height:50px}.gjs-sm-sector .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file,.gjs-clm-tags .gjs-sm-property.gjs-sm-file #gjs-sm-preview-file{background-size:auto 100%;background-repeat:no-repeat;background-position:center center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layers,.gjs-clm-tags .gjs-sm-property .gjs-sm-layers{margin-top:5px;padding:1px 3px;min-height:30px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer{background-color:rgba(255,255,255,.055);border-radius:2px;margin:2px 0;padding:7px;position:relative}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer.gjs-sm-active,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer.gjs-sm-active{background-color:rgba(255,255,255,.12)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer .gjs-sm-label-wrp{display:flex;align-items:center}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-move,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-move{height:14px;width:14px;min-width:14px;cursor:grab}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-label,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-label{flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0 5px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer-preview,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer-preview{height:15px;width:15px;min-width:15px;margin-right:5px;border-radius:2px}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer-preview-cnt,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer-preview-cnt{border-radius:2px;background-color:#fff;height:100%;width:100%;background-size:cover !important}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer{display:block;cursor:pointer;height:14px;width:14px;min-width:14px;opacity:.5;filter:alpha(opacity=50)}.gjs-sm-sector .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover,.gjs-clm-tags .gjs-sm-property .gjs-sm-layer #gjs-sm-close-layer:hover{opacity:.8;filter:alpha(opacity=80)}.gjs-sm-sector #gjs-sm-text-shadow #gjs-sm-preview::after,.gjs-clm-tags #gjs-sm-text-shadow #gjs-sm-preview::after{color:#000;content:"T";font-weight:900;line-height:17px;padding:0 4px}.gjs-sm-sector .gjs-sm-stack .gjs-sm-properties,.gjs-clm-tags .gjs-sm-stack .gjs-sm-properties{padding:5px 0 0}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add{background:none;border:none;cursor:pointer;outline:none;position:absolute;right:0;top:-17px;opacity:.75;padding:0;width:18px;height:18px}.gjs-sm-sector .gjs-sm-stack #gjs-sm-add:hover,.gjs-clm-tags .gjs-sm-stack #gjs-sm-add:hover{opacity:1;filter:alpha(opacity=100)}.gjs-sm-sector .gjs-sm-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c{height:100%;width:20px;position:absolute;right:0;top:0;box-sizing:border-box;border-radius:2px;padding:2px}.gjs-sm-sector .gjs-sm-colorp-c .gjs-checker-bg,.gjs-clm-tags .gjs-sm-colorp-c .gjs-checker-bg,.gjs-sm-sector .gjs-sm-colorp-c .gjs-field-colorp-c,.gjs-clm-tags .gjs-sm-colorp-c .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-sm-sector .gjs-sm-color-picker,.gjs-clm-tags .gjs-sm-color-picker{background-color:#ddd;cursor:pointer;height:16px;width:100%;margin-top:-16px;box-shadow:0 0 1px rgba(0,0,0,.2);border-radius:1px}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-upload,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-upload{left:0;top:0;position:absolute;width:100%;opacity:0;cursor:pointer}.gjs-sm-sector .gjs-sm-btn-upload #gjs-sm-label,.gjs-clm-tags .gjs-sm-btn-upload #gjs-sm-label{padding:2px 0}.gjs-sm-layer>#gjs-sm-move{opacity:.7;filter:alpha(opacity=70);cursor:move;font-size:12px;float:left;margin:0 5px 0 0}.gjs-sm-layer>#gjs-sm-move:hover{opacity:.9;filter:alpha(opacity=90)}.gjs-blocks-c{display:flex;flex-wrap:wrap;justify-content:flex-start}.gjs-block-categories{display:flex;flex-direction:column}.gjs-block-category{width:100%}.gjs-block-category .gjs-caret-icon{margin-right:5px}.gjs-block{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;width:45%;min-width:45px;padding:1em;box-sizing:border-box;min-height:90px;cursor:all-scroll;font-size:11px;font-weight:lighter;text-align:center;display:flex;flex-direction:column;justify-content:space-between;border:1px solid rgba(0,0,0,.2);border-radius:3px;margin:10px 2.5% 5px;box-shadow:0 1px 0 0 rgba(0,0,0,.15);transition:all .2s ease 0s;transition-property:box-shadow,color}.gjs-block:hover{box-shadow:0 3px 4px 0 rgba(0,0,0,.15)}.gjs-block svg{fill:currentColor}.gjs-block__media{margin-bottom:10px;pointer-events:none}.gjs-block-svg{width:54px;fill:currentColor}.gjs-block-svg-path{fill:currentColor}.gjs-block.fa{font-size:2em;line-height:2em;padding:11px}.gjs-block-label{line-height:normal;font-size:.65rem;font-weight:normal;font-family:Helvetica,sans-serif;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.gjs-block.gjs-bdrag{width:auto;padding:0}.gjs-selected-parent{border:1px solid #ffca6f}.gjs-opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-layer{font-weight:lighter;text-align:left;position:relative;background-color:rgba(0,0,0,.1);font-size:.75rem;display:grid}.gjs-layer-hidden{opacity:.55;filter:alpha(opacity=55)}.gjs-layer-count{position:absolute;right:27px;top:9px}.gjs-layer-vis{height:auto !important;width:auto !important;left:0;top:0;padding:7px 5px 7px 10px;position:absolute;cursor:pointer;z-index:1}.gjs-layer-caret{font-size:.5rem;width:8px;padding:2px;cursor:pointer;position:absolute;left:-9px;top:6px;opacity:.7;filter:alpha(opacity=70)}.gjs-layer-caret:hover{opacity:1;filter:alpha(opacity=100)}.gjs-layer-title{padding:3px 10px 5px 30px;display:flex;align-items:center}.gjs-layer-title-inn{align-items:center;position:relative;display:flex;width:100%}.gjs-layer__icon{display:block;width:100%;max-width:15px;max-height:15px;padding-left:5px}.gjs-layer__icon svg{fill:currentColor}.gjs-layer-name{padding:5px 0;display:inline-block;box-sizing:content-box;overflow:hidden;white-space:nowrap;margin:0 30px 0 5px}.gjs-layer-name--no-edit{text-overflow:ellipsis}.gjs-layer>.gjs-layer-children{display:none}.gjs-layer.open>.gjs-layer-children{display:block}.gjs-layer-no-chld>.gjs-layer-title-inn>.gjs-layer-caret{display:none}.gjs-layer-move{padding:7px 10px 7px 5px;position:absolute;font-size:12px;cursor:move;right:0;top:0}.gjs-layer.gjs-hovered .gjs-layer-title{background-color:rgba(255,255,255,.015)}.gjs-layer.gjs-selected .gjs-layer-title{background-color:rgba(255,255,255,.1)}.gjs-layers{position:relative;height:100%}.gjs-layers #gjs-placeholder{width:100%;position:absolute}.gjs-layers #gjs-placeholder #gjs-plh-int{height:100%;padding:1px}.gjs-layers #gjs-placeholder #gjs-plh-int.gjs-insert{background-color:#62c462}#gjs-clm-add-tag,.gjs-clm-tags-btn{background-color:rgba(255,255,255,.15);border-radius:2px;padding:3px;margin-right:3px;border:1px solid rgba(0,0,0,.15);width:24px;height:24px;box-sizing:border-box;cursor:pointer}.gjs-clm-tags-btn svg{fill:currentColor;display:block}.gjs-clm-header{display:flex;align-items:center;margin:7px 0}.gjs-clm-header-status{flex-shrink:1;margin-left:auto}.gjs-clm-tag{display:flex;overflow:hidden;align-items:center;border-radius:3px;margin:0 3px 3px 0;padding:5px;cursor:default}.gjs-clm-tag-status,.gjs-clm-tag-close{width:12px;height:12px;flex-shrink:1}.gjs-clm-tag-status svg,.gjs-clm-tag-close svg{vertical-align:middle;fill:currentColor}.gjs-clm-sels-info{margin:7px 0}.gjs-clm-sel-id{font-size:.9em;opacity:.5;filter:alpha(opacity=50)}.gjs-clm-label-sel{float:left;padding-right:5px}.gjs-clm-tags{font-size:.75rem;padding:10px 5px}.gjs-clm-tags #gjs-clm-sel{padding:7px 0;float:left}.gjs-clm-tags #gjs-clm-sel{font-style:italic;margin-left:5px}.gjs-clm-tags #gjs-clm-tags-field{clear:both;padding:5px;margin-bottom:5px;display:flex;flex-wrap:wrap}.gjs-clm-tags #gjs-clm-tags-c{display:flex;flex-wrap:wrap;vertical-align:top;overflow:hidden}.gjs-clm-tags #gjs-clm-new{color:#ddd;padding:5px 6px;display:none}.gjs-clm-tags #gjs-clm-close{opacity:.85;filter:alpha(opacity=85);font-size:20px;line-height:0;cursor:pointer;color:rgba(255,255,255,.9)}.gjs-clm-tags #gjs-clm-close:hover{opacity:1;filter:alpha(opacity=100)}.gjs-clm-tags #gjs-clm-checkbox{color:rgba(255,255,255,.9);vertical-align:middle;cursor:pointer;font-size:9px}.gjs-clm-tags #gjs-clm-tag-label{flex-grow:1;text-overflow:ellipsis;overflow:hidden;padding:0 3px;cursor:text}.gjs-mdl-container{font-family:Helvetica,sans-serif;overflow-y:auto;position:fixed;background-color:rgba(0,0,0,.5);display:flex;top:0;left:0;right:0;bottom:0;z-index:100}.gjs-mdl-dialog{text-shadow:-1px -1px 0 rgba(0,0,0,.05);animation:gjs-slide-down .215s;margin:auto;max-width:850px;width:90%;border-radius:3px;font-weight:lighter;position:relative;z-index:2}.gjs-mdl-title{font-size:1rem}.gjs-mdl-btn-close{position:absolute;right:15px;top:5px}.gjs-mdl-active .gjs-mdl-dialog{animation:gjs-mdl-slide-down .216s}.gjs-mdl-header,.gjs-mdl-content{padding:10px 15px;clear:both}.gjs-mdl-header{position:relative;border-bottom:1px solid rgba(0,0,0,.2);padding:15px 15px 7px}.gjs-export-dl::after{content:"";clear:both;display:block;margin-bottom:10px}.gjs-dropzone{display:none;opacity:0;position:absolute;top:0;left:0;z-index:11;width:100%;height:100%;transition:opacity .25s;pointer-events:none}.gjs-dropzone-active .gjs-dropzone{display:block;opacity:1}.gjs-am-assets{height:290px;overflow:auto;clear:both;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:flex-start}.gjs-am-assets-header{padding:5px}.gjs-am-add-asset .gjs-am-add-field{width:70%;float:left}.gjs-am-add-asset button{width:25%;float:right}.gjs-am-preview-cont{position:relative;height:70px;width:30%;background-color:#444;border-radius:2px;float:left;overflow:hidden}.gjs-am-preview{position:absolute;background-position:center center;background-size:cover;background-repeat:no-repeat;height:100%;width:100%;z-index:1}.gjs-am-preview-bg{opacity:.5;filter:alpha(opacity=50);position:absolute;height:100%;width:100%;z-index:0}.gjs-am-dimensions{opacity:.5;filter:alpha(opacity=50);font-size:10px}.gjs-am-meta{width:70%;float:left;font-size:12px;padding:5px 0 0 5px;box-sizing:border-box}.gjs-am-meta>div{margin-bottom:5px}.gjs-am-close{cursor:pointer;position:absolute;right:5px;top:0;display:none}.gjs-am-asset{border-bottom:1px solid rgba(0,0,0,.2);padding:5px;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.gjs-am-asset:hover .gjs-am-close{display:block}.gjs-am-highlight{background-color:rgba(255,255,255,.1)}.gjs-am-assets-cont{background-color:rgba(0,0,0,.1);border-radius:3px;box-sizing:border-box;padding:10px;width:45%;float:right;height:325px;overflow:hidden}.gjs-am-file-uploader{width:55%;float:left}.gjs-am-file-uploader>form{background-color:rgba(0,0,0,.1);border:2px dashed;border-radius:3px;position:relative;text-align:center;margin-bottom:15px}.gjs-am-file-uploader>form.gjs-am-hover{border:2px solid #62c462;color:#75cb75}.gjs-am-file-uploader>form.gjs-am-disabled{border-color:red}.gjs-am-file-uploader>form #gjs-am-uploadFile{opacity:0;filter:alpha(opacity=0);padding:150px 10px;width:100%;box-sizing:border-box}.gjs-am-file-uploader #gjs-am-title{position:absolute;padding:150px 10px;width:100%}.gjs-cm-editor-c{float:left;box-sizing:border-box;width:50%}.gjs-cm-editor-c .CodeMirror{height:450px}.gjs-cm-editor{font-size:12px}.gjs-cm-editor#gjs-cm-htmlmixed{padding-right:10px;border-right:1px solid rgba(0,0,0,.2)}.gjs-cm-editor#gjs-cm-htmlmixed #gjs-cm-title{color:#a97d44}.gjs-cm-editor#gjs-cm-css{padding-left:10px}.gjs-cm-editor#gjs-cm-css #gjs-cm-title{color:#ddca7e}.gjs-cm-editor #gjs-cm-title{background-color:rgba(0,0,0,.2);font-size:12px;padding:5px 10px 3px;text-align:right}.gjs-rte-toolbar{border:1px solid rgba(0,0,0,.2);position:absolute;border-radius:3px;z-index:10}.gjs-rte-actionbar{display:flex}.gjs-rte-action{display:flex;align-items:center;justify-content:center;padding:5px;min-width:25px;border-right:1px solid rgba(0,0,0,.2);text-align:center;cursor:pointer;outline:none}.gjs-rte-action:last-child{border-right:none}.gjs-rte-action:hover{background-color:rgba(255,255,255,.1)}.gjs-rte-active{background-color:rgba(255,255,255,.1)}.gjs-rte-disabled{color:rgba(255,255,255,.1);cursor:not-allowed}.gjs-rte-disabled:hover{background-color:unset}.gjs-editor-cont .sp-hue,.gjs-editor-cont .sp-slider{cursor:row-resize}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-dragger{cursor:crosshair}.gjs-editor-cont .sp-alpha-inner,.gjs-editor-cont .sp-alpha-handle{cursor:col-resize}.gjs-editor-cont .sp-hue{left:90%}.gjs-editor-cont .sp-color{right:15%}.gjs-editor-cont .sp-container{border:1px solid rgba(0,0,0,.2);box-shadow:0 0 7px rgba(0,0,0,.2);border-radius:3px}.gjs-editor-cont .sp-picker-container{border:none}.gjs-editor-cont .colpick_dark .colpick_color{outline:1px solid rgba(0,0,0,.2)}.gjs-editor-cont .sp-cancel,.gjs-editor-cont .sp-cancel:hover{bottom:-8px;color:#777 !important;font-size:25px;left:0;position:absolute;text-decoration:none}.gjs-editor-cont .sp-alpha-handle{background-color:#ccc;border:1px solid #555;width:4px}.gjs-editor-cont .sp-color,.gjs-editor-cont .sp-hue{border:1px solid #333}.gjs-editor-cont .sp-slider{background-color:#ccc;border:1px solid #555;height:3px;left:-4px;width:22px}.gjs-editor-cont .sp-dragger{background:transparent;box-shadow:0 0 0 1px #111}.gjs-editor-cont .sp-button-container{float:none;width:100%;position:relative;text-align:right}.gjs-editor-cont .sp-container button,.gjs-editor-cont .sp-container button:hover,.gjs-editor-cont .sp-container button:active{background:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2);color:#ddd;text-shadow:none;box-shadow:none;padding:3px 5px}.gjs-editor-cont .sp-palette-container{border:none;float:none;margin:0;padding:5px 10px 0}.gjs-editor-cont .sp-palette .sp-thumb-el,.gjs-editor-cont .sp-palette .sp-thumb-el:hover{border:1px solid rgba(0,0,0,.9)}.gjs-editor-cont .sp-palette .sp-thumb-el:hover,.gjs-editor-cont .sp-palette .sp-thumb-el.sp-thumb-active{border-color:rgba(0,0,0,.9)}.gjs-hidden{display:none}@keyframes gjs-slide-down{0%{transform:translate(0, -3rem);opacity:0}100%{transform:translate(0, 0);opacity:1}}@keyframes gjs-slide-up{0%{transform:translate(0, 0);opacity:1}100%{transform:translate(0, -3rem);opacity:0}}.cm-s-hopscotch span.cm-error{color:#fff} diff --git a/src/style_manager/view/LayerView.js b/src/style_manager/view/LayerView.js index 1cc73584f..6f9a3ac44 100644 --- a/src/style_manager/view/LayerView.js +++ b/src/style_manager/view/LayerView.js @@ -21,8 +21,8 @@ export default View.extend({ ${iconMove}
-