"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get getCheckboxElement () {
        return getCheckboxElement;
    },
    get getValuesIntersection () {
        return getValuesIntersection;
    },
    get includesValue () {
        return includesValue;
    },
    get parseStringifiedValue () {
        return parseStringifiedValue;
    }
});
const _array = require("../../../helpers/array");
const _object = require("../../../helpers/object");
const _string = require("../../../helpers/string");
function getCheckboxElement(itemElement) {
    return itemElement.querySelector('input[type="checkbox"]');
}
function parseStringifiedValue(value) {
    return (0, _string.isJSON)(value) ? JSON.parse(value) : value;
}
function getValuesIntersection(valuesArray, source) {
    return (0, _array.getIntersectionOfArrays)(valuesArray, source, (a, b)=>JSON.stringify(a) === JSON.stringify(b));
}
function includesValue(array, element) {
    if ((0, _object.isKeyValueObject)(element)) {
        return Array.isArray(array) && array.some((value)=>{
            return (0, _object.isKeyValueObject)(value) ? (0, _object.isObjectEqual)(value, element) : value === element;
        });
    } else {
        return array.includes(element);
    }
}
