<commit_before>import './embed.less';
import {
  Container,
  HelpPlugin,
  CaptionsPlugin,
  SoundPlugin,
  PausePlugin,
  UserDataPlugin
} from 'springroll-container';
import '../libs/jquery.mobile.custom';
import '../plugins/jquery-menuToggle';

const container = new Container('#appContainer');
const frame = $('#frame');
const captionsToggle = $('#captionsToggle');
const soundToggle = $('#soundToggle');
const title = $('#appTitle');
captionsToggle.hide();
soundToggle.hide();

const captions = new CaptionsPlugin('#captionsButton');

container.uses(new UserDataPlugin());
container.uses(new HelpPlugin('#helpButton'));
container.uses(captions);
container.uses(new PausePlugin('#pauseButton, #resumeButton'));
container.uses(
  new SoundPlugin({
    voButton: '#voButton',
    soundButton: '#soundButton',
    sfxButton: '#sfxButton',
    musicButton: '#musicButton',
    voSlider: '#voiceRange',
    musicSlider: '#musicRange',
    sfxSlider: '#sfxRange',
    soundSlider: '#mainVolume'
  })
);

function pauseOverlay({ data }) {
  data.paused ? frame.addClass('paused') : frame.removeClass('paused');
}

function onLoadComplete() {
  frame.removeClass('loading');
  title.text(container.release.game.title);
}

function onCaptionStyles({ currentTarget }) {
  const { name, value } = currentTarget;
  captions.setCaptionsStyles(name, value);
}

$('#captionsStyles select').change(onCaptionStyles.bind(this));

container.client.on('paused', pauseOverlay);
container.client.on('resumed', pauseOverlay);
container.client.on('loadDone', onLoadComplete);
container.client.on('loaded', onLoadComplete);
container.client.on('features', ({ data }) => {
  if (data.captions) {
    captionsToggle.removeClass('disabled');
    captionsToggle.show();
  }
  if (data.sound) {
    soundToggle.removeClass('disabled');
    soundToggle.show();
  }<commit_msg>Update container constructor call in embed<commit_after>import './embed.less';
import {
  Container,
  HelpPlugin,
  CaptionsPlugin,
  SoundPlugin,
  PausePlugin,
  UserDataPlugin
} from 'springroll-container';
import '../libs/jquery.mobile.custom';
import '../plugins/jquery-menuToggle';

const frame = $('#frame');
const captionsToggle = $('#captionsToggle');
const soundToggle = $('#soundToggle');
const title = $('#appTitle');
captionsToggle.hide();
soundToggle.hide();

const captions = new CaptionsPlugin('#captionsButton');

const container = new Container({
  iFrameSelector: '#appContainer',
  plugins: [
    new UserDataPlugin(),
    new HelpPlugin('#helpButton'),
    captions,
    new PausePlugin('#pauseButton, #resumeButton'),
    new SoundPlugin({
    voButton: '#voButton',
    soundButton: '#soundButton',
    sfxButton: '#sfxButton',
    musicButton: '#musicButton',
    voSlider: '#voiceRange',
    musicSlider: '#musicRange',
    sfxSlider: '#sfxRange',
    soundSlider: '#mainVolume'
  })
]});

function pauseOverlay({ data }) {
  data.paused ? frame.addClass('paused') : frame.removeClass('paused');
}

function onLoadComplete() {
  frame.removeClass('loading');
  title.text(container.release.game.title);
}

function onCaptionStyles({ currentTarget }) {
  const { name, value } = currentTarget;
  captions.setCaptionsStyles(name, value);
}

$('#captionsStyles select').change(onCaptionStyles.bind(this));

container.client.on('paused', pauseOverlay);
container.client.on('resumed', pauseOverlay);
container.client.on('loadDone', onLoadComplete);
container.client.on('loaded', onLoadComplete);
container.client.on('features', ({ data }) => {
  if (data.captions) {
    captionsToggle.removeClass('disabled');
    captionsToggle.show();
  }
  if (data.sound) {
    soundToggle.removeClass('disabled');
    soundToggle.show();
  }
{'fraction_non_alphanumeric': 0.16455012158875978, 'fraction_numerical': 0.0, 'mean_word_length': 5.494736842105263, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '306871', 'n_tokens_mistral': 1113, 'n_tokens_neox': 1120, 'n_words': 213}