/*eslint-disable */
define(["Magento_PageBuilder/js/config", "Magento_PageBuilder/js/utils/object"], function (_config, _object) {
    /**
     * Copyright © Magento, Inc. All rights reserved.
     * See COPYING.txt for license details.
     */

    /**
     * @api
     */
    var MappingPins =
        /*#__PURE__*/
        function () {
            "use strict";

            function MappingPins() {
            }

            var _proto = MappingPins.prototype;

            /**
             * Convert value to internal format
             *
             * @param value string
             * @returns {string | object}
             */
            _proto.fromDom = function fromDom(value) {
                if (!value) {
                    return "";
                }

                var returnObj = {};
                returnObj.mapping_pins = JSON.parse(value);

                return returnObj;
            }
            /**
             * Convert value to knockout format
             *
             * @param {string} name
             * @param {DataObject} data
             * @returns {string}
             */
            ;

            _proto.toDom = function toDom(name, data) {
                var value = (0, _object.get)(data, name);

                if (!value || !value.mapping_pins){
                    return "";
                }

                return JSON.stringify(value.mapping_pins);
            };

            return MappingPins;
        }();

    return MappingPins;
});
//# sourceMappingURL=src.js.map
