/**
 * Copyright 2019 Adobe
 * All Rights Reserved.
 */

define([
    'Magento_Ui/js/form/element/region'
], function (Region) {
    'use strict'; //eslint-disable-line

    return Region.extend({
        defaults: {
            regionScope: 'data.general.region'
        },

        /**
         * Set region to source form
         *
         * @param {String} value - region
         */
        setDifferedFromDefault: function (value) {
            this._super();

            if (parseFloat(value)) {
                this.source.set(this.regionScope, this.indexedOptions[value].label);
            }
        }
    });
});
