console.log('loader_bitix');
import { startStimulusApp } from '@symfony/stimulus-bridge';
import checkScheduleBitrix  from './controllers/checkScheduleBitrix_controller';
import signin  from './controllers/signin_controller';
import resetPassword  from './controllers/resetPassword_controller';
import captcha  from './controllers/smartCaptcha_controller';
import passwordShow  from './controllers/passwordShow_controller';
import inputMask  from './controllers/inputMask_controller';

import './sass/main_bitrix.scss';
import "@fancyapps/fancybox";
import './window';
import { syncSessionIdFromUrl } from './components/helper.js';

syncSessionIdFromUrl();

const loader = require("./components/loader.js");

loader.loadSDK('system').then(function (data) {
    webSDK.on('init', function() {
  		window.userInfo = this.data.user.authenticated;
    })
})

window.bitrix = true;

export const app = startStimulusApp();

// register any custom, 3rd party controllers here
app.register('inputMask', inputMask);
app.register('checkScheduleBitrix', checkScheduleBitrix);
app.register('signin', signin);
app.register('resetPassword', resetPassword);
app.register('smartCaptcha', captcha);
app.register('passwordShow', passwordShow);


/*
 * Welcome to your app's main JavaScript file!
 *
 * We recommend including the built version of this JavaScript file
 * (and its CSS file) in your base layout (base.html.twig).
 */

// any CSS you import will output into a single css file (app.css in this case)

