
    
    
    
    

    ; (function () {

    // Вставка yMetrics
    var initYMetrics = function () {
        var _widgetParams = {"id":1462,"widgetCode":"7e2e68e6034ef83c726cea53508b65a7","title":"Сайт","statusCode":"active","description":"","mapType":"yandex","buttonBackgroundColor":"#18d7e4","buttonFontColor":"#ffffff","buttonSkinCode":"basic","buttonPlacement":"bottomRight","buttonCaption":"Онлайн запись","buttonTypeId":1,"logoUrl":"/organization_logo/fff/d6e/cd5/fffd6ecd5ba985439ce89758f45b55e12e5045e1.png","minisitePlacement":"windowRight","timeInterval":15,"staffSelectionTitle":"Специалист","goodSelectionTitle":"Услуги","defaultLanguageId":1,"bookingDateSelectionTitle":"Дата и время","logoId":19675,"backgroundColor":"#007aae","backgroundOpacity":1.0,"mobilePhoneConfirmationEnabled":1,"verificationCodeExpiredPeriod":600,"organizationAddress":"ул. Крупской, д.19 /17","fioFormatCode":"firstname_secondname","emailRequired":0,"typeCode":"v2","organizationName":"Салон красоты ОблакаStudio м.Университет","organizationId":677,"currencyTitle":"Российский рубль","currencyShortTitle":"руб","usePhoneMask":1,"stepOrder":"SED","primaryColor":"#ffffff","secondaryColor":"#18d7e4","ymetricCounterId":"","ymetricCounterEmbedCode":"","organizationPhone":"74952343302","organizationEmail":"info@oblakastudio.ru","organizationSite":"https://oblakastudio.ru","organizationDescription":"ОблакаStudio — салоны красоты бизнес-класса. Работаем в индустрии красоты с 2001 года. ","organizationDayStart":{"hour":10,"minute":0,"second":0,"nano":0},"organizationDayEnd":{"hour":21,"minute":0,"second":0,"nano":0},"cabinetLink":"https://widget.universe-soft.ru/v2/minisite/7e2e68e6034ef83c726cea53508b65a7#/personal-account","bookingLink":"https://widget.universe-soft.ru/v2/minisite/7e2e68e6034ef83c726cea53508b65a7#/user-booking-list","bookingIntervals":[{"widgetCode":"7e2e68e6034ef83c726cea53508b65a7","widgetId":1462,"startInterval":{"hour":10,"minute":0,"second":0,"nano":0},"endInterval":{"hour":21,"minute":0,"second":0,"nano":0}}],"allowCancellationToCustomer":1,"prohibitionCancellationType":"before_booking_starts","prohibitionCancellationTime":{"hour":23,"minute":59,"second":59,"nano":0},"isHeadOrganization":0,"phoneMask":"8 (XXX) XXX XX-XX","enableBlackListFilter":0,"yandexCatalogEnabled":1,"yandexCatalogRubricId":"184105814","hideGoodsDuration":0,"organizationScheduleDescription":"C 10:00 до 21:00 ","organizationWeekScheduleActive":1,"showMap":0,"showStaffPosition":0,"moveBookingEnabled":0};
        if (_widgetParams.ymetricCounterEmbedCode !== null && _widgetParams.ymetricCounterEmbedCode !== '' && _widgetParams.ymetricCounterEmbedCode !== undefined){
            $('head').append(_widgetParams.ymetricCounterEmbedCode);
        }
    };

    var initWidget = function () {

        initYMetrics();
        

        
        
        
        


        

        
        
        appendStyleSheet('https://widget.universe-soft.ru/v2/resources/base/scripts/plugins/universe-widget/universe-widget.css?1.2.34.41');

        /**
 * Created by Vladimir on 11.07.2017.
 */


;(function () {
    var UniverseWidget = function () {
        var _settings = {
            widgetButton:
                {
                    selectorAttr: 'universe-soft-widget-button',
                    selectorAttrValue: '000000'
                },
            baseUrl: '',
            popupWindowAttr: 'universe-popup-window',
            popupWindowBackAttr: 'universe-popup-window-back',
            popupFadeDuration: "slow",
            popupWindowAttrRight: '[universe-popup-window-placement=windowRight]'
        };

        var $ = jQuery.noConflict(true);

        // Ð Ð°Ð±Ð¾ÑÐ° Ñ Ð¾ÑÐ½Ð¾Ð²Ð½ÑÐ¼Ð¸ Ð¿Ð°ÑÐ°Ð¼ÐµÑÑÐ°Ð¼Ð¸ Ð²Ð¸Ð´Ð¶ÐµÑÐ°
        var _widgetParams;

        var _getWidgetParams = function () {
            return _widgetParams;
        };

        var _setWidgetParams = function (widgetParams) {
            _widgetParams = widgetParams;
        };
        // Ð Ð°Ð±Ð¾ÑÐ° Ñ Ð¾ÑÐ½Ð¾Ð²Ð½ÑÐ¼Ð¸ Ð¿Ð°ÑÐ°Ð¼ÐµÑÑÐ°Ð¼Ð¸ Ð²Ð¸Ð´Ð¶ÐµÑÐ°


        //ÐÐ¾Ð»ÑÑÐµÐ½Ð¸Ðµ ÑÐµÐ»ÐµÐºÑÐ¾ÑÐ° Ð´Ð»Ñ Ð²ÑÐ¿Ð»ÑÐ²Ð°ÑÑÐµÐ³Ð¾ Ð¾ÐºÐ½Ð°
        var _getPopupWindowSelector = function () {
            return '[' + _settings.popupWindowAttr + ']';
        };

        //ÐÐ¾Ð»ÑÑÐµÐ½Ð¸Ðµ ÑÐµÐ»ÐµÐºÑÐ¾ÑÐ° Ð´Ð»Ñ ÑÐ¾Ð½Ð° Ð²ÑÐ¿Ð»ÑÐ²Ð°ÑÑÐµÐ³Ð¾ Ð¾ÐºÐ½Ð°
        var _getPopupWindowBackSelector = function () {
            return '[' + _settings.popupWindowBackAttr + ']';
        };

        var _skin = {
            basic: function(){
                var _svg = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">' +
                    '<circle style="fill: {{buttonBackgroundColor}}" class="cls-1" cx="50" cy="50" r="50"/>' +
                    '<circle style="fill: {{buttonBackgroundColor}}" class="cls-4" cx="50" cy="50" r="50"/>' +
                    '<circle style="stroke: {{buttonBackgroundColor}}"  fill-opacity=".0" stroke-width="1" class="circle-1 animated" cx="50" cy="50" r="45"/>' +
                    '<circle style="stroke: {{buttonBackgroundColor}}"  fill-opacity=".0" stroke-width="1" class="circle-2 animated" cx="50" cy="50" r="40"/>' +
                    '<circle style="stroke: {{buttonBackgroundColor}}"  fill-opacity=".0" stroke-width="1" class="circle-3 animated" cx="50" cy="50" r="35"/>' +
                    '<circle class="cls-2" cx="50" cy="50" r="45"/>' +
                    '</svg>';


                var _buttonPlacement = 'button-placement={{buttonPlacement}}';
                var _buttonSkin = 'button-skin-code={{buttonSkinCode}}';
                var _pulseStyle = '<style>[button-skin-code=basic]::before{background-color: {{buttonBackgroundColor}} !important}</style>';
                return _pulseStyle +
                    '<div ' +
                    _buttonPlacement + ' ' +
                    _buttonSkin + ' ' +
                    _settings.widgetButton.selectorAttr + '=' + _settings.widgetButton.selectorAttrValue +
                    '>' + _svg +
                    '<div class="text-widget-block">' +
                    '<div class="text-widget" style="color: ' + _widgetParams.buttonFontColor + ';"><div class="text-value">' + _widgetParams.buttonCaption + '</div></div> ' +
                    '</div></div>';
            },
            circle: function(){
                var _svg = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">' +
                    '<circle style="fill: {{buttonBackgroundColor}}" class="cls-1" cx="50" cy="50" r="43"/>' +
                    '<circle style="fill: {{buttonBackgroundColor}};stroke: {{buttonBackgroundColor}}" fill-opacity=".0" stroke-width="4" cx="50" cy="50" r="48"/>' +
                    '<circle style="stroke: {{buttonBackgroundColor}}"  fill-opacity=".0" stroke-width="1" class="animated" cx="50" cy="50" r="45"/>' +
                    '<circle style="stroke: {{buttonBackgroundColor}}"  fill-opacity=".0" stroke-width="1" class="animated" cx="50" cy="50" r="40"/>' +
                    '<circle style="stroke: {{buttonBackgroundColor}}"  fill-opacity=".0" stroke-width="1" class="animated" cx="50" cy="50" r="35"/>' +
                    '</svg>';


                var _buttonPlacement = 'button-placement={{buttonPlacement}}';
                var _buttonSkin = 'button-skin-code={{buttonSkinCode}}';
                var _pulseStyle = '<style>[button-skin-code=basic]::before{background-color: {{buttonBackgroundColor}} !important}</style>';
                return _pulseStyle +
                    '<div ' +
                    _buttonPlacement + ' ' +
                    _buttonSkin + ' ' +
                    _settings.widgetButton.selectorAttr + '=' + _settings.widgetButton.selectorAttrValue +
                    '>' + _svg +
                    '<div class="text-widget-block">' +
                    '<div class="text-widget" style="color: ' + _widgetParams.buttonFontColor + ';"><div class="text-value">' + _widgetParams.buttonCaption + '</div></div> ' +
                    '</div></div>';
            },
            hexahedron: function(){
                var _svg = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="110" viewBox="0 0 103 110">' +
                    '<path fill-rule="evenodd" fill-opacity=".3"  class="animated" fill="{{buttonBackgroundColor}}"' +
                    'd="M94.818,24.206 L55.185,1.381 C51.976,-0.466 48.029,-0.465 44.824,1.382 L5.187,24.216 C1.982,26.063 0.009,29.473 0.006,33.169 L0.001,78.829 C0.002,82.523 1.975,85.934 5.181,87.782 L44.815,110.610 C48.024,112.457 51.971,112.456 55.176,110.610 L94.813,87.776 C98.018,85.929 99.992,82.519 99.993,78.823 L99.998,33.159 C99.997,29.465 98.023,26.054 94.818,24.206 Z"/>' +
                    '<path fill-rule="evenodd"   fill="{{buttonBackgroundColor}}"' +
                        'd="M94.818,24.206 L55.185,1.381 C51.976,-0.466 48.029,-0.465 44.824,1.382 L5.187,24.216 C1.982,26.063 0.009,29.473 0.006,33.169 L0.001,78.829 C0.002,82.523 1.975,85.934 5.181,87.782 L44.815,110.610 C48.024,112.457 51.971,112.456 55.176,110.610 L94.813,87.776 C98.018,85.929 99.992,82.519 99.993,78.823 L99.998,33.159 C99.997,29.465 98.023,26.054 94.818,24.206 Z"/>' +
                    '<path fill-rule="evenodd"  opacity="0.2" fill="rgb(0, 0, 0)"' +
                        'd="M91.284,27.039 L55.218,6.258 C52.299,4.576 48.707,4.577 45.790,6.258 L9.720,27.048 C6.804,28.729 5.008,31.834 5.006,35.199 L5.001,76.771 C5.002,80.134 6.798,83.239 9.715,84.922 L45.781,105.707 C48.702,107.388 52.293,107.387 55.210,105.706 L91.279,84.917 C94.196,83.235 95.993,80.130 95.994,76.765 L95.998,35.190 C95.997,31.826 94.201,28.721 91.284,27.039 Z"/>' +
                    '<path fill-rule="evenodd"  opacity="0.102" fill="rgb(255, 255, 255)"' +
                        'd="M4.212,24.287 L43.832,1.386 C47.040,-0.467 50.986,-0.466 54.190,1.386 L93.814,24.298 C97.018,26.150 98.991,29.572 98.994,33.281 L98.999,79.094 C98.998,80.837 97.766,84.001 97.766,84.001 L-0.003,28.903 C-0.003,28.903 2.335,25.374 4.212,24.287 Z"/>'+
                    '<path fill-rule="evenodd"  opacity="0.2" fill="rgb(255, 255, 255)"'+
                        'd="M94.818,24.206 L55.185,1.381 C51.976,-0.466 48.029,-0.465 44.824,1.382 L5.187,24.216 C1.982,26.063 0.009,29.473 0.006,33.169 L0.001,78.829 C0.001,80.566 1.234,83.720 1.234,83.720 L99.034,28.806 C99.034,28.806 96.696,25.289 94.818,24.206 Z"/>'+
                    '</svg>';
                var _buttonPlacement = 'button-placement={{buttonPlacement}}';
                var _buttonSkin = 'button-skin-code={{buttonSkinCode}}';
                return '<div ' +
                    _buttonPlacement + ' ' +
                    _buttonSkin + ' ' +
                    _settings.widgetButton.selectorAttr + '=' + _settings.widgetButton.selectorAttrValue +
                    '>' + _svg +
                    '<div class="text-widget-block">' +
                    '<div class="text-widget" style="color: ' + _widgetParams.buttonFontColor + ';"><div class="text-value">' + _widgetParams.buttonCaption + '</div></div> ' +
                    '</div></div>';

            },
            drop: function(){
                var _svg = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  width="100" height="100" viewBox="0 0 110 110">' +
                    '<defs>' +
                        '<linearGradient id="PSgrad_0" x1="0%" x2="0%" y1="100%" y2="0%">' +
                            '<stop offset="0%" stop-color="rgb(255,255,255)" stop-opacity="0" />' +
                            '<stop offset="100%" stop-color="rgb(255,255,255)" stop-opacity="1" />' +
                        '</linearGradient>' +
                    '</defs>' +
                    '<path fill-rule="evenodd" fill="{{buttonBackgroundColor}}" fill-opacity=".3"  class="animated"' +
                        'd="M50.000,-0.000 L98.000,-0.000 C103.523,-0.000 108.000,4.477 108.000,10.000 L108.000,58.000 C108.000,85.614 85.614,108.000 58.000,108.000 L50.000,108.000 C22.386,108.000 -0.000,85.614 -0.000,58.000 L-0.000,50.000 C-0.000,22.386 22.386,-0.000 50.000,-0.000 Z"/>' +
                    '<path fill-rule="evenodd" fill="{{buttonBackgroundColor}}" ' +
                        'd="M50.000,-0.000 L98.000,-0.000 C103.523,-0.000 108.000,4.477 108.000,10.000 L108.000,58.000 C108.000,85.614 85.614,108.000 58.000,108.000 L50.000,108.000 C22.386,108.000 -0.000,85.614 -0.000,58.000 L-0.000,50.000 C-0.000,22.386 22.386,-0.000 50.000,-0.000 Z"/>' +
                    '<path fill-rule="evenodd"  opacity="0.2" fill="url(#PSgrad_0)"' +
                        'd="M50.000,-0.000 L98.000,-0.000 C102.965,-0.000 105.000,3.000 105.000,3.000 C105.000,3.000 48.062,60.188 14.770,93.480 C5.648,84.422 -0.000,71.871 -0.000,58.000 L-0.000,50.000 C-0.000,22.386 22.386,-0.000 50.000,-0.000 Z"/>' +
                    '<path fill-rule="evenodd"  opacity="0.2" fill="rgb(0, 0, 0)"' +
                        'd="M51.000,7.000 L83.000,7.000 L101.000,25.000 L101.000,57.000 C101.000,81.301 81.301,101.000 57.000,101.000 L51.000,101.000 C26.699,101.000 7.000,81.301 7.000,57.000 L7.000,51.000 C7.000,26.699 26.699,7.000 51.000,7.000 Z"/>' +
                    '<path fill-rule="evenodd"  opacity="0.2" fill="rgb(0, 0, 0)"' +
                        'd="M88.000,7.000 L101.000,7.000 L101.000,20.000 L88.000,7.000 Z"/>' +
                   '</svg>';
                var _buttonPlacement = 'button-placement={{buttonPlacement}}';
                var _buttonSkin = 'button-skin-code={{buttonSkinCode}}';
                return '<div ' +
                    _buttonPlacement + ' ' +
                    _buttonSkin + ' ' +
                    _settings.widgetButton.selectorAttr + '=' + _settings.widgetButton.selectorAttrValue +
                    '>' + _svg +
                    '<div class="text-widget-block">' +
                    '<div class="text-widget" style="color: ' + _widgetParams.buttonFontColor + ';"><div class="text-value">' + _widgetParams.buttonCaption + '</div></div> ' +
                    '</div></div>';

            }
        };
        // ÐÐ¾Ð»ÑÑÐµÐ½Ð¸Ðµ HTML Ð¨Ð°Ð±Ð»Ð¾Ð½Ð° ÐºÐ½Ð¾Ð¿ÐºÐ¸
        var _getButtonHTMLTemplate = function () {
            return _skin[_widgetParams.buttonSkinCode]();
        };


        // ÐÐ»Ð°Ð²Ð½Ð¾Ðµ ÑÐºÑÑÑÐ¸Ðµ Ð²ÑÐ¿Ð»ÑÐ²Ð°ÑÑÐµÐ³Ð¾ Ð¾ÐºÐ½Ð°
        var _removePopupWindow = function () {
            var $popupWindow = $(_getPopupWindowSelector());
            var $popupWindowBack = $(_getPopupWindowBackSelector());
            if ($popupWindowBack.length > 0) {
                $popupWindow.fadeOut(_settings.popupFadeDuration);
                $popupWindowBack.fadeOut(_settings.popupFadeDuration, function () {
                    $popupWindowBack.remove();
                    $popupWindow.remove();
                });
            }
        };

        // ÐÐ¾Ð»ÑÑÐµÐ½Ð¸Ðµ HTML Ð¨Ð°Ð±Ð»Ð¾Ð½Ð° Ð²ÑÐ¿Ð»ÑÐ²Ð°ÑÑÐµÐ³Ð¾ Ð¾ÐºÐ½Ð°
        var _getPopupWindowTemplate = function () {
            return '<div ' + _settings.popupWindowBackAttr + '>' +
                '<div ' + _settings.popupWindowAttr + ' universe-popup-window-placement = {{popupPlacement}}>' +
                '<div class="universe-popup-window-head"><div class="universe-popup-window-close-button"></div></div>' +
                '<div class="universe-popup-window-body"><iframe  src="{{MinisiteUrl}}" frameborder = "0"></iframe></div>' +
                '</div>' +
                '</div>' ;
        };

        var _getButtonSelector = function () {
            return '[' + _settings.widgetButton.selectorAttr + '= ' + _settings.widgetButton.selectorAttrValue + ']';
        };

        var _makeUniqueButtonSelector = function () {
            _settings.widgetButton.selectorAttrValue = Math.round(Math.random() * 999999);
            while ($(_getButtonSelector()).length > 0) {
                _settings.widgetButton.selectorAttrValue = Math.round(Math.random() * 999999);
            }
        };

        var _getMinisiteUrl = function () {
            return _settings.BaseUrl + '/minisite/' + _widgetParams.widgetCode;
        };
    
        // ÐÐ½Ð¸ÑÐ¸Ð°Ð»Ð¸Ð·Ð°ÑÐ¸Ñ ÐºÐ½Ð¾Ð¿ÐºÐ¸
        var _initButton = function () {
            _makeUniqueButtonSelector();
            var _buttonHTML = _getButtonHTMLTemplate()
                .replace('{{caption}}', _widgetParams.buttonCaption)
                .replace(/{{buttonBackgroundColor}}/g, _widgetParams.buttonBackgroundColor)
                .replace('{{buttonFontColor}}', _widgetParams.buttonFontColor)
                .replace('{{buttonPlacement}}', _widgetParams.buttonPlacement)
                .replace('{{buttonSkinCode}}', _widgetParams.buttonSkinCode);
            $('body').append(_buttonHTML);
            $(_getButtonSelector()).addClass('transition-fast-all');
        };
    
        /**
         * ÐÑÐ¾Ð±ÑÐ°Ð¶ÐµÐ½Ð¸Ðµ Ð¾ÐºÐ½Ð° Ñ Ð²Ð¸Ð´Ð¶ÐµÑÐ¾Ð¼
         * @param {String} path Ð¿ÑÑÑ Ð´Ð»Ñ ÑÑÐ»ÑÐ³Ð¸
         * @private
         */
        var _showWidgetWindow = function (path) {
            _removePopupWindow();
            var _popupHtml = _getPopupWindowTemplate()
                .replace('{{popupPlacement}}', _widgetParams.minisitePlacement)
                .replace('{{MinisiteUrl}}', path);
            $('body').append(_popupHtml).css({'overflow': 'hidden'});
            var _popupWindowRight = $('body').find(_settings.popupWindowAttrRight);
    
            $(_getPopupWindowBackSelector()).fadeIn(0);
            if(_popupWindowRight.length > 0) {
                $(_settings.popupWindowAttrRight).css({right: '0px'});
            }
            else $(_getPopupWindowSelector()).fadeIn(_settings.popupFadeDuration);
    
            $('.universe-popup-window-close-button').on('click', function () {
                if(_popupWindowRight.length > 0) {
                    $(_settings.popupWindowAttrRight).css({right: '-460px'});
                }
                $('body').css({'overflow': 'auto'});
                _removePopupWindow();
            })
        }
        
        // ÐÐ½Ð¸ÑÐ¸Ð°Ð»Ð¸Ð·Ð°ÑÐ¸Ñ Ð¾Ð±ÑÐ°Ð±Ð¾ÑÑÐ¸ÐºÐ° Ð½Ð°Ð¶Ð°ÑÐ¸Ñ Ð½Ð° ÐºÐ½Ð¾Ð¿ÐºÑ
        var _initButtonHandler = function () {
            $(_getButtonSelector()).on('click', function () {
                var md = new MobileDetect(window.navigator.userAgent);
                if(md.mobile()) {
                    window.open(_getMinisiteUrl());
                }
                else {
                    if (_widgetParams.minisitePlacement === 'externalWindow') {
                        window.open(_getMinisiteUrl());
                    }
                    else {
                        _showWidgetWindow(_getMinisiteUrl())
                    }
                }
            });
        };
    
        /**
         * ÐÐ°Ð²ÐµÑÐ¸Ð²Ð°Ð½Ð¸Ðµ Ð¾Ð±ÑÐ°Ð±Ð¾ÑÑÐ¸ÐºÐ° Ð½Ð° ÑÑÑÐ»ÐºÐ¸
         * @param {String} className ÐºÐ»Ð°ÑÑ Ð´Ð»Ñ ÑÑÑÐ»ÐºÐ¸, ÐºÐ¾ÑÐ¾ÑÑÑ Ð¸ÑÐ¿Ð¾Ð»ÑÐ·ÑÑÑ Ð´Ð»Ñ Ð²ÑÐ·Ð¾Ð²Ð° Ð²Ð¸Ð´Ð¶ÐµÑÐ°
         * @private
         */
        var _setLinkListener = function (className) {
            var _class = className || 'js-universe-widget-good';
            var _widgetLink = document.getElementsByClassName(_class);
            var _src = '';
            var _goodId = '';
            for (var _i = 0; _i < _widgetLink.length; _i += 1) {
                var _link = _widgetLink[_i];
                if (_widgetParams.minisitePlacement === 'externalWindow') {
                    _src = _getMinisiteUrl();
                    _goodId = _link.dataset.universeGoodId;
                    if (_goodId) {
                        _src += '/?default-good-id=' + _goodId;
                    }
                    _link.setAttribute('target', '_blank');
                    _link.href = _src;
                } else {
                    _link.addEventListener('click', function () {
                        var md = new MobileDetect(window.navigator.userAgent);
                        _src = _getMinisiteUrl();
                        _goodId = this.dataset.universeGoodId;
                        if (_goodId) {
                            _src += '/?default-good-id=' + _goodId;
                        }

                        if (md.mobile()) {
                            window.open(_src);
                        } else {
                            if (_widgetParams.minisitePlacement === 'externalWindow') {
                                window.open(_src);
                            } else {
                                _showWidgetWindow(_src);
                            }
                        }
                    })
                }
            }
        };
    
        // Ð£ÑÑÐ°Ð½Ð¾Ð²ÐºÐ° Ð±Ð°Ð·Ð¾Ð²Ð¾Ð³Ð¾ URL Ð²Ð¸Ð´Ð¶ÐµÑÐ°
        var _setBaseUrl = function (baseURL) {
            _settings.BaseUrl = baseURL;
        };

        var _init = function () {
            _initButton();
            _initButtonHandler();
            _setLinkListener();
        };

        return {
            setWidgetParams: _setWidgetParams,
            setBaseUrl: _setBaseUrl,
            getWidgetParams: _getWidgetParams,
            init: _init
        }
    };
    window.universeWidget = UniverseWidget();
})();

        universeWidget.setWidgetParams({"id":1462,"widgetCode":"7e2e68e6034ef83c726cea53508b65a7","title":"Сайт","statusCode":"active","description":"","mapType":"yandex","buttonBackgroundColor":"#18d7e4","buttonFontColor":"#ffffff","buttonSkinCode":"basic","buttonPlacement":"bottomRight","buttonCaption":"Онлайн запись","buttonTypeId":1,"logoUrl":"/organization_logo/fff/d6e/cd5/fffd6ecd5ba985439ce89758f45b55e12e5045e1.png","minisitePlacement":"windowRight","timeInterval":15,"staffSelectionTitle":"Специалист","goodSelectionTitle":"Услуги","defaultLanguageId":1,"bookingDateSelectionTitle":"Дата и время","logoId":19675,"backgroundColor":"#007aae","backgroundOpacity":1.0,"mobilePhoneConfirmationEnabled":1,"verificationCodeExpiredPeriod":600,"organizationAddress":"ул. Крупской, д.19 /17","fioFormatCode":"firstname_secondname","emailRequired":0,"typeCode":"v2","organizationName":"Салон красоты ОблакаStudio м.Университет","organizationId":677,"currencyTitle":"Российский рубль","currencyShortTitle":"руб","usePhoneMask":1,"stepOrder":"SED","primaryColor":"#ffffff","secondaryColor":"#18d7e4","ymetricCounterId":"","ymetricCounterEmbedCode":"","organizationPhone":"74952343302","organizationEmail":"info@oblakastudio.ru","organizationSite":"https://oblakastudio.ru","organizationDescription":"ОблакаStudio — салоны красоты бизнес-класса. Работаем в индустрии красоты с 2001 года. ","organizationDayStart":{"hour":10,"minute":0,"second":0,"nano":0},"organizationDayEnd":{"hour":21,"minute":0,"second":0,"nano":0},"cabinetLink":"https://widget.universe-soft.ru/v2/minisite/7e2e68e6034ef83c726cea53508b65a7#/personal-account","bookingLink":"https://widget.universe-soft.ru/v2/minisite/7e2e68e6034ef83c726cea53508b65a7#/user-booking-list","bookingIntervals":[{"widgetCode":"7e2e68e6034ef83c726cea53508b65a7","widgetId":1462,"startInterval":{"hour":10,"minute":0,"second":0,"nano":0},"endInterval":{"hour":21,"minute":0,"second":0,"nano":0}}],"allowCancellationToCustomer":1,"prohibitionCancellationType":"before_booking_starts","prohibitionCancellationTime":{"hour":23,"minute":59,"second":59,"nano":0},"isHeadOrganization":0,"phoneMask":"8 (XXX) XXX XX-XX","enableBlackListFilter":0,"yandexCatalogEnabled":1,"yandexCatalogRubricId":"184105814","hideGoodsDuration":0,"organizationScheduleDescription":"C 10:00 до 21:00 ","organizationWeekScheduleActive":1,"showMap":0,"showStaffPosition":0,"moveBookingEnabled":0});
        universeWidget.setBaseUrl('https://widget.universe-soft.ru/v2');
        universeWidget.init();
    };



    function loadScript(url, callback) {

        var script = document.createElement("script")
        script.type = "text/javascript";

        if (script.readyState) {  //IE
            script.onreadystatechange = function () {
                if (script.readyState == "loaded" ||
                    script.readyState == "complete") {
                    script.onreadystatechange = null;
                    callback();
                }
            };
        } else {  //Others
            script.onload = function () {
                callback();
            };
        }

        script.src = url;
        document.getElementsByTagName("head")[0].appendChild(script);
    }

    function appendStyleSheet(URL) {
        var head = document.head;
        var link = document.createElement('link');
        link.type = 'text/css'
        link.rel = 'stylesheet'
        link.href = URL
        head.appendChild(link)
    };

    var getJQuery = function (callback) {
            loadScript('//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js?1.2.34.41', callback);
    };

    // Опциональное подключение библиотеки определения типа устройства
    var getMobileDetect = function(callback){
        if(window.MobileDetect === undefined) {
            loadScript('https://widget.universe-soft.ru/v2/resources/global/plugins/mobile-detect/mobile-detect.min.js', callback);
        }
        else{
            callback();
        }
    };



    getMobileDetect(function(){
        getJQuery(initWidget);
    });



})();

