/*
exclude complex objects from $.data() before pass to config
11066
function($element) {
            var data = {};
            $.each($element.data(), function(k, v) {
                if(typeof v !== 'object' || (v && typeof v === 'object' && (v.constructor === Object || v.constructor === Array))) {
                    data[k] = v;
                }
            });
            return data;
        }
1090167
function ( obj, key, value ) {
		if ( value !== undefined ) {
			obj.setAttribute( "data-" + key, regex.json_wrap.test( value ) ? json.encode( value ) : value );
			return obj;
		}
		else {
			return utility.coerce( obj.getAttribute( "data-" + key ) );
		}
	}
1032792
function strip(obj) {

    if (!obj || ! obj instanceof Object || typeof obj === 'string') {
        return undefined;
    }

    if (obj instanceof Array) {
        for (const value of obj) {
            strip(value);
        }
    } else {

        delete obj['loc'];
        delete obj['start'];
        delete obj['end'];

        Object.keys(obj).forEach(key => strip(obj[key]));
    }

    return obj;
}
445288
function _freezeConfig(config) {
    Object.freeze(config);

    for (var key in config) {
        if (typeof config[key] === "object") {
            _freezeConfig(config[key]);
        }
    }
}
739879
function transformer(data, id) {
	function checkValue(obj) {
		if (!obj || typeof obj !== 'object') {
			return;
		}

		var keys = Object.keys(obj);

		if (keys.indexOf('value') !== -1) {
			obj.values = {};
			obj.values[id] = obj.value;
			delete obj.value;
			return;
		}

		for (var i = 0; i < keys.length; i++) {
			checkValue(obj[keys[i]]);
		}
	}

	checkValue(data);

	return data;
}
802045
function handleRemovedConfigItems(_a) {
    var fileInitialState = _a.fileInitialState, memoryInitialState = _a.memoryInitialState;
    var removedItems = memoryInitialState.filter(function (bsItem) {
        var removedItem = !fileInitialState.find(function (fileItem) { return bsItem.key === fileItem.key; });
        return removedItem;
    });
    if (removedItems.length > 0) {
        console.log('REMOVED CONFIG: ', removedItems);
    }
    removedItems.forEach(function (removedItem) {
        removeItemFromBrowserStorage(removedItem);
    });
}
395516
function exclude(obj, keys) {
        var result, key;
        result = {};
        keys = keys || [];
        for (key in obj) {
            if (obj.hasOwnProperty(key)) {
                if (keys.indexOf(key) === -1) {
                    if (typeof obj[key] !== 'function') {
                        result[key] = obj[key];
                    }
                }
            }
        }
        return result;
    }
451072
function _sanitizeObject(obj) {
  if (obj === undefined) {
    return obj;
  }
  var seen = [];
  return JSON.parse((0, _stringify2.default)(obj, function (name, value) {
    if (seen.indexOf(value) !== -1) {
      return '[Circular]';
    }
    if (_lodash2.default.isObject(value)) {
      seen.push(value);
    }
    // Array of field names that should not be logged
    // add field if necessary (password, tokens etc)
    if (_lodash2.default.includes(_config.removeFields, name)) {
      return '<removed>';
    }
    if (name === 'req' && value && value.connection) {
      return {
        method: value.method,
        url: value.url,
        headers: value.headers,
        remoteAddress: value.connection.remoteAddress,
        remotePort: value.connection.remotePort
      };
    }
    if (name === 'res' && value && value.statusCode) {
      return {
        statusCode: value.statusCode,
        header: value._header
      };
    }
    if (_lodash2.default.isArray(value) && value.length > _config.maxArrayLength) {
      return 'Array(' + value.length + ')';
    }
    return value;
  }));
}
1231984
function omit(object, keysToOmit) {
  const result = {};

  Object.keys(object).forEach(key => {
    if (keysToOmit.indexOf(key) === -1) {
      result[key] = object[key];
    }
  });

  return result;
}
917072
function (name, value) {
            var result;
            if (arguments.length === 0) {
                /*  return list of keys  */
                result = [];
                for (var key in this.__config)
                    if (_cs.isown(this.__config, key))
                        result.push(key);
            }
            else if (arguments.length === 1 && typeof name === "string") {
                /*  retrieve value  */
                result = this.__config[name];
            }
            else if (arguments.length === 2 && value !== null) {
                /*  set value  */
                result = this.__config[name];
                this.__config[name] = value;
            }
            else if (arguments.length === 2) {
                /*  remove key/value pair  */
                result = this.__config[name];
                delete this.__config[name];
            }
            else
                throw _cs.exception("cfg", "invalid arguments");
            return result;
        }
340560
function setConfigObject (config, prev) {
    Object.keys(config).forEach(function (key) {
      var value = config[key]
      var fullKey = prev ? prev + '.' + key : key

      // if the value is an inner object and we have dot-notation
      // enabled, treat inner objects in config the same as
      // heavily nested dot notations (foo.bar.apple).
      if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) {
        // if the value is an object but not an array, check nested object
        setConfigObject(value, fullKey)
      } else {
        // setting arguments via CLI takes precedence over
        // values within the config file.
        if (!hasKey(argv, fullKey.split('.')) || (flags.defaulted[fullKey]) || (flags.arrays[fullKey] && configuration['combine-arrays'])) {
          setArg(fullKey, value)
        }
      }
    })
  }
1173033
function(current, next, exclude){
   var di = diff(current, next);
   var diffs = di ? di.map(function(i){
      var str = JSON.stringify(i).replace("\"__data\",", "");
      return JSON.parse(str);
   }).filter(function(i){
      return i.path.join(",").indexOf("_") === -1;
   }).filter(function(i){
      return exclude.every(function(x){return i.path.indexOf(x) === -1; });
   }) : [];
   if(diffs.length > 0){
      return diffs;
   }
   else{
      return null;
   }
}
704373
function(url, data)
	{
		var parsedUrl = url,
			matches = parsedUrl.match(/:\b\w+\b/g);
		
		if (!!matches)
		{
			matches.forEach(function(key) 
			{
				key = key.substr(1);
				
				if (!(key in data))
				{
					throw new Error('Property "'+key+'" required but not found in data');
				}
			});
		}
			
		conbo.keys(data).forEach(function(key)
		{
			var regExp = new RegExp(':\\b'+key+'\\b', 'g');
			
			if (regExp.test(parsedUrl))
			{
				parsedUrl = parsedUrl.replace(regExp, data[key]);
				delete data[key];
			}
		});
		
		return parsedUrl;
	}
378776
protected function excluded($data)
    {
        $isExcluded = false;
        //Check global exclusion in SiteConfig
        $config = SiteConfig::current_site_config();

        //IF private tags exclusion if configured and object has private tags
        if (!empty($config->HailExcludePrivateTagsIDs) && isset($data['private_tags']) && count($data['private_tags']) > 0) {
            $private_tags = json_decode($config->HailExcludePrivateTagsIDs);
            foreach ($data['private_tags'] as $tag) {
                if (in_array($tag['id'], $private_tags)) {
                    $isExcluded = true;
                    break;
                }
            }
        }
        //IF public tags exclusion if configured and object has public tags
        if (!empty($config->HailExcludePublicTagsIDs) && isset($data['tags']) && count($data['tags']) > 0) {
            $public_tags = json_decode($config->HailExcludePublicTagsIDs);
            foreach ($data['tags'] as $tag) {
                if (in_array($tag['id'], $public_tags)) {
                    $isExcluded = true;
                    break;
                }
            }
        }

        $this->extend('updateExcluded', $isExcluded, $data);

        return $isExcluded;
    }
657897
function filter(input) {
    var array = [];
    _.forEach(input, function(item) {
      if (_.isPlainObject(item)) {
        var space = parseInt(config.json.space) || config.json.space;
        array.push(timestamp(config.newline + JSON.stringify(item, null, space) + config.newline));
      } else {
        if (_.isArray(item)) {
          array.push(timestamp(stringify(item)));
        } else {
          array.push(timestamp(item.toString()));
        }
      }
    });
    return array;
  }
627195
function _getConfig() {
        var copy = {},
            property;

        for (property in _config) {
            if (_config.hasOwnProperty(property)) {
                copy[property] = _config[property];
            }
        }
 
        return copy;
    }
665648
function pruneDataSourceInfo(form) {
        if (options.includeDataSources) {
          return form;
        }

        delete form.dataSources;

        form.pages = _.map(form.pages, function(page) {
          page.fields = _.map(page.fields, function(field) {
            delete field.dataSource;
            delete field.dataSourceType;
            return field;
          });

          return page;
        });

        return form;
      }