<commit_before>const Discord = require('discord.js');
const config = require('./config.json');
const fs = require('fs');

const client = new Discord.Client();

const prefix = '🔨';

client.on('ready', () => {
  console.log('ready!');
});

function genLog(banner, banned, reason, channel, ban, owner) {
  fs.writeFileSync(`./out/${Date.now()}.json`, JSON.stringify({
    banner: banner.id,
    banned: banned.id,
    reason,
    messages: {
      channel,
      ban,
      owner,
    },
  }));
}

function hasPermission(member) {
  if (member.id === config.owner) {
    return true;
  }
  for (const role of member.roles) {
    if (config.roles.includes(role.name.toLowerCase())) {
      return true;
    }
  }
  return false;
}

function generateLolYouGotBanned(user, banner, owner, reason) {
  return [
    `Hey ${user.username},\n`,
    'you recently lost send message permissions in the discord.js help channel because a user with high authority' +
    `saw fit to do so. You may appeal to ${owner} if you wish.\n`,
    `Banner: ${banner.username}#${banner.discriminator} (${banner})`,
    `Reason: ${reason}\n`,
    'It is entirely possible this was a mistake, in this case please do contact ' +
    `${owner.username}#${owner.discriminator} ${owner} to clear this up.\n`,
    'Thank you.',
  ].join('\n');
}

function generateOwnerMessage(toBan, banner, reason) {
  return [
    `${toBan.username}#${toBan.discriminator} (${toBan}) was banned at ${Date.now()}`,
    `Banner: ${banner.username}#${banner.discriminator} (${banner}) `,
    `Reason: ${reason}`,
  ].join('\n');
}

client.on('message', message => {
  if (message.channel.id !== config.channel || !message.content.startsWith(prefix)) {
    return;
  }

  if (!hasPermission(message.member)) {
    return message.reply('You don\'t have permission to do that jackass');
  }

  if (message.mentions.users.size === 0) {
    return;
  }

  const banMessage = message.content.split(' ').slice(2).join(' ') || 'unspecified reason';
  const owner = client.users.get(config.owner);
  const toBan = message.mentions.users.array()[0];

  if (message.channel.permissionsFor(toBan) && !message.channel.permissionsFor(toBan).hasPermission('SEND_MESSAGES')) {
    return message.reply('That user is already softbanned.');
  }

  message.channel.overwritePermissions(toBan, {
    SEND_MESSAGES: false,
  })
  .then(() => {
    const channMessage = `${toBan} has lost send permissions here and ${owner.username} has been notified.`;
    const bannedMessage = generateLolYouGotBanned(toBan, message.author, owner, banMessage);
    const ownerMessage = generateOwnerMessage(toBan, message.author, banMessage);
    genLog(message.author, toBan, banMessage, channMessage, bannedMessage, ownerMessage);
    message.channel.sendMessage(channMessage);
    toBan.sendMessage(bannedMessage);
    owner.sendMessage(ownerMessage);
  })
  .catch(e => {
    message.reply(`Couldn't ban - ${e}`);
  });
});

client.login(config.token);
<commit_msg>reduce message cache<commit_after>const Discord = require('discord.js');
const config = require('./config.json');
const fs = require('fs');

const client = new Discord.Client({
  max_message_cache: 5,
});

const prefix = '🔨';

client.on('ready', () => {
  console.log('ready!');
});

function genLog(banner, banned, reason, channel, ban, owner) {
  fs.writeFileSync(`./out/${Date.now()}.json`, JSON.stringify({
    banner: banner.id,
    banned: banned.id,
    reason,
    messages: {
      channel,
      ban,
      owner,
    },
  }));
}

function hasPermission(member) {
  if (member.id === config.owner) {
    return true;
  }
  for (const role of member.roles) {
    if (config.roles.includes(role.name.toLowerCase())) {
      return true;
    }
  }
  return false;
}

function generateLolYouGotBanned(user, banner, owner, reason) {
  return [
    `Hey ${user.username},\n`,
    'you recently lost send message permissions in the discord.js help channel because a user with high authority' +
    `saw fit to do so. You may appeal to ${owner} if you wish.\n`,
    `Banner: ${banner.username}#${banner.discriminator} (${banner})`,
    `Reason: ${reason}\n`,
    'It is entirely possible this was a mistake, in this case please do contact ' +
    `${owner.username}#${owner.discriminator} ${owner} to clear this up.\n`,
    'Thank you.',
  ].join('\n');
}

function generateOwnerMessage(toBan, banner, reason) {
  return [
    `${toBan.username}#${toBan.discriminator} (${toBan}) was banned at ${Date.now()}`,
    `Banner: ${banner.username}#${banner.discriminator} (${banner}) `,
    `Reason: ${reason}`,
  ].join('\n');
}

client.on('message', message => {
  if (message.channel.id !== config.channel || !message.content.startsWith(prefix)) {
    return;
  }

  if (!hasPermission(message.member)) {
    return message.reply('You don\'t have permission to do that jackass');
  }

  if (message.mentions.users.size === 0) {
    return;
  }

  const banMessage = message.content.split(' ').slice(2).join(' ') || 'unspecified reason';
  const owner = client.users.get(config.owner);
  const toBan = message.mentions.users.array()[0];

  if (message.channel.permissionsFor(toBan) && !message.channel.permissionsFor(toBan).hasPermission('SEND_MESSAGES')) {
    return message.reply('That user is already softbanned.');
  }

  message.channel.overwritePermissions(toBan, {
    SEND_MESSAGES: false,
  })
  .then(() => {
    const channMessage = `${toBan} has lost send permissions here and ${owner.username} has been notified.`;
    const bannedMessage = generateLolYouGotBanned(toBan, message.author, owner, banMessage);
    const ownerMessage = generateOwnerMessage(toBan, message.author, banMessage);
    genLog(message.author, toBan, banMessage, channMessage, bannedMessage, ownerMessage);
    message.channel.sendMessage(channMessage);
    toBan.sendMessage(bannedMessage);
    owner.sendMessage(ownerMessage);
  })
  .catch(e => {
    message.reply(`Couldn't ban - ${e}`);
  });
});

client.login(config.token);
<|endoftext|>


<commit_before><commit_msg>map/table width fix #n3<commit_after><|endoftext|>


<commit_before>import Backbone from 'backbone';
import $ from 'jquery';
var d3 = require('d3');
import SvgGroupGadget from './group/svgGroupGadget'
import SvgGroupWriter from './group/svgGroupWriter'
import SvgGroupReader from './group/svgGroupReader'

var self;
var svg;

class GadgetronStreamConfigurationSvg {
    constructor(model, id, svgScalingFactor, zoomCallback, changedEvent, rerenderCallback, clickContextMenu){
        this.id = id;
        this.model = model;
        this.changedEvent = changedEvent;
        this.clickContextMenu = clickContextMenu;
        this.rerenderCallback = rerenderCallback;
        this.svgScalingFactor = svgScalingFactor;
        this.zoomCallback = zoomCallback;
        this.svgWidth = (window.innerWidth) / this.svgScalingFactor;
        // minus 4 because of 2 navbars with 1px border(top+bottom+top+bottom = 4px)
        this.svgHeight = (window.innerHeight - 2 * $('nav').outerHeight() - 4) / this.svgScalingFactor;
        this.draggabel = false;
        this.margin = true;

        // for new files this has to be done
        if(!this.model.get('configuration').gadgetronStreamConfiguration){
            this.model.get('configuration').gadgetronStreamConfiguration = {};
        }
        if(this.model.get('configuration').gadgetronStreamConfiguration.gadget){
            this.gadgetLength = this.model.get('configuration').gadgetronStreamConfiguration.gadget.length;
        }
        else{
            this.gadgetLength = 0;
        }
        if(this.model.get('configuration').gadgetronStreamConfiguration.writer){
            this.writerLength = this.model.get('configuration').gadgetronStreamConfiguration.writer.length;
        }
        else{
            this.writerLength = 0;
        }
        if(this.model.get('configuration').gadgetronStreamConfiguration.reader){
            this.readerLength = this.model.get('configuration').gadgetronStreamConfiguration.reader.length;
        }
        else{
            this.readerLength = 0;
        }

        this.minZoom = 0.5;
        this.maxZoom = 10;
    }

    Draw(){
        self = this;
        svg = d3.select('svg#' + this.id);

        svg.attr('viewBox', '0 0 ' + this.svgWidth + ' ' +  this.svgHeight)
            .attr('width', this.svgWidth)
            .attr('height', this.svgHeight)
            .attr('xmlns', 'http://www.w3.org/2000/svg')
            .attr('xmlns:xlink', 'http://www.w3.org/1999/xlink')
            .style('position', 'absolute')
            .selectAll('svg');

        // rectangle around the svg
        svg.append('rect')
            .attr('width', this.svgWidth)
            .attr('height', this.svgHeight)
            .style('fill','white')
            .style('fill-opacity', 1)
            .style('stroke', function(){
                if(self.margin){
                    return 'black';
                }
                return 'white';
            })
            .style('stroke-width', 1);
        this.container = svg.append('g');
        this.containerSelectAll = this.container.selectAll('g');

        svg.on("contextmenu", function(){
            var contextMenu = [
                {"title": "Add Reader", "icon": "import", "id": "add-reader-button"},
                {"title": "Add Gadget", "icon": "cog", "id": "add-gadget-button"},
                {"title": "Add Writer", "icon": "export", "id": "add-writer-button"}];

            d3.event.preventDefault();
            var position = d3.mouse(this);
            var menu = d3.select('#context-menu')
                .style('left', position[0] + "px")
                .style('top', position[1] + "px")
                .style('display', 'inline-block')
                .on('mouseleave', function() {
                    d3.select('#context-menu').style('display', 'none');
                });
            menu.selectAll('li')
                .data(contextMenu)
                .enter()
                .append('li')
                .html(function(data, index){
                    return `<a id="${data.id}"><i class="glyphicon glyphicon-${data.icon}" aria-hidden="true"></i> ${data.title}</a>`;
                })
                .on('click', function(data) {
                    self.clickContextMenu(data);
                    d3.select('#context-menu').style('display', 'none');
                });
        });

        if(this.draggabel){
            svg.call(d3.zoom()
                .scaleExtent([this.minZoom, this.maxZoom])
                .on("zoom", self.ZoomAndMove));

            svg.call(d3.zoom()
                .scaleExtent([this.minZoom, this.maxZoom])
                .on("zoom", self.ZoomAndMove));
        }

        if(this.readerLength){
            this.readers = new SvgGroupReader(this.model.get('configuration').gadgetronStreamConfiguration.reader, this.gadgetLength, this.id, this.svgScalingFactor, this.changedEvent, this.container, this.containerSelectAll, this.RerenderCallback);
            this.readers.Draw();
        }

        if(this.gadgetLength){
            this.gadgets = new SvgGroupGadget(this.model.get('configuration').gadgetronStreamConfiguration.gadget, this.gadgetLength, this.id, this.svgScalingFactor, this.changedEvent, this.container, this.containerSelectAll, this.RerenderCallback, this.RerenderGroupCallback);
            this.gadgets.Draw();
        }

        if(this.writerLength){
            this.writers = new SvgGroupWriter(this.model.get('configuration').gadgetronStreamConfiguration.writer, this.gadgetLength, this.id, this.svgScalingFactor, this.changedEvent, this.container, this.containerSelectAll, this.RerenderCallback);
            this.writers.Draw();
        }

        if(this.gadgets){
            this.container
                .attr('transform',"translate(" +  this.gadgets.gapBetweenGroups / 2 + ",0)");
        }
    }

    // Draw the red rectangle of the visible region when zoomed in
    DrawVisibleRegion(transform){
        if(this.visibleRectangle === undefined){
            this.visibleRectangle = this.container.append('rect')
                .attr('width', this.svgWidth)
                .attr('height', this.svgHeight)
                .style('fill-opacity', 0)
                .style('stroke','red')
                .style('stroke-width', 1);
        }
        else{
            this.visibleRectangle.attr('x', (transform.x / this.svgScalingFactor) * -1);
            this.visibleRectangle.attr('y', (transform.y / this.svgScalingFactor) * -1);
            var scaleFactor = 1 / transform.k;
            this.visibleRectangle.attr('transform', 'scale(' + scaleFactor + ')');
        }
    }

    ToolBarClickedEvent(event){
        self.lastEvent = event;
        if($(event.currentTarget).hasClass('active')){
            switch (event.currentTarget.id) {
                case 'remove-button':
                    self.lastClass = 'remove';
                    self.ToggleAllRectangleClasses('edit','remove');
                    break;
                case 'reorder-button':
                    self.lastClass = 'move';
                    if(this.gadgets){
                        this.gadgets.ToggleRectangleClass('edit', false);
                        this.gadgets.ToggleRectangleClass('move', true);
                    }
                    break;
                default:
                    break;
            }
        }
        else{
            self.ToggleAllRectangleClasses(self.lastClass,'edit');
        }
    }

    AppendReader(reader){
        if(!self.model.get('configuration').gadgetronStreamConfiguration.reader){
            self.model.get('configuration').gadgetronStreamConfiguration.reader = new Array();
        }
        self.model.get('configuration').gadgetronStreamConfiguration.reader.push(reader.convertModel());
        self.RerenderCallback();
    }

    AppendGadget(gadget){
        if(!self.model.get('configuration').gadgetronStreamConfiguration.gadget){
            self.model.get('configuration').gadgetronStreamConfiguration.gadget = new Array();
        }
        self.model.get('configuration').gadgetronStreamConfiguration.gadget.push(gadget.convertModel());
        self.RerenderCallback();
    }

    AppendWriter(writer){
        if(!self.model.get('configuration').gadgetronStreamConfiguration.writer){
            self.model.get('configuration').gadgetronStreamConfiguration.writer = new Array();
        }
        self.model.get('configuration').gadgetronStreamConfiguration.writer.push(writer.convertModel());
        self.RerenderCallback();
    }

    RerenderCallback(model){
        if($(self.lastEvent.currentTarget).hasClass('active-btn')){
            $(self.lastEvent.currentTarget).toggleClass('active');
        }
        self.rerenderCallback(model);
    }

    RerenderGroupCallback(groupGadget){
        self.changedEvent();
        groupGadget.group.remove();
        groupGadget.containerRect.remove();
        groupGadget.containerRectText.remove();
        self.gadgets = new SvgGroupGadget(self.model.get('configuration').gadgetronStreamConfiguration.gadget, self.gadgetLength, self.id, self.svgScalingFactor, self.changedEvent, self.container, self.containerSelectAll, self.RerenderCallback, self.RerenderGroupCallback);
        self.gadgets.Draw();
        self.gadgets.ToggleRectangleClass('edit', false);
        self.gadgets.ToggleRectangleClass('move', true);
    }

    ZoomAndMove(){
        self.zoomCallback(d3.event.transform);
        self.container.attr("transform", d3.event.transform);
    }

    ToggleAllRectangleClasses(currentClass, newClass){
        if(this.readers){
            this.readers.ToggleRectangleClass(currentClass, false);
            this.readers.ToggleRectangleClass(newClass, true);
        }
        if(this.gadgets){
            this.gadgets.ToggleRectangleClass(currentClass, false);
            this.gadgets.ToggleRectangleClass(newClass, true);
        }
        if(this.writers){
            this.writers.ToggleRectangleClass(currentClass, false);
            this.writers.ToggleRectangleClass(newClass, true);
        }
    }
}

module.exports = GadgetronStreamConfigurationSvg;<commit_msg>delete equal code line<commit_after>import Backbone from 'backbone';
import $ from 'jquery';
var d3 = require('d3');
import SvgGroupGadget from './group/svgGroupGadget'
import SvgGroupWriter from './group/svgGroupWriter'
import SvgGroupReader from './group/svgGroupReader'

var self;
var svg;

class GadgetronStreamConfigurationSvg {
    constructor(model, id, svgScalingFactor, zoomCallback, changedEvent, rerenderCallback, clickContextMenu){
        this.id = id;
        this.model = model;
        this.changedEvent = changedEvent;
        this.clickContextMenu = clickContextMenu;
        this.rerenderCallback = rerenderCallback;
        this.svgScalingFactor = svgScalingFactor;
        this.zoomCallback = zoomCallback;
        this.svgWidth = (window.innerWidth) / this.svgScalingFactor;
        // minus 4 because of 2 navbars with 1px border(top+bottom+top+bottom = 4px)
        this.svgHeight = (window.innerHeight - 2 * $('nav').outerHeight() - 4) / this.svgScalingFactor;
        this.draggabel = false;
        this.margin = true;

        // for new files this has to be done
        if(!this.model.get('configuration').gadgetronStreamConfiguration){
            this.model.get('configuration').gadgetronStreamConfiguration = {};
        }
        if(this.model.get('configuration').gadgetronStreamConfiguration.gadget){
            this.gadgetLength = this.model.get('configuration').gadgetronStreamConfiguration.gadget.length;
        }
        else{
            this.gadgetLength = 0;
        }
        if(this.model.get('configuration').gadgetronStreamConfiguration.writer){
            this.writerLength = this.model.get('configuration').gadgetronStreamConfiguration.writer.length;
        }
        else{
            this.writerLength = 0;
        }
        if(this.model.get('configuration').gadgetronStreamConfiguration.reader){
            this.readerLength = this.model.get('configuration').gadgetronStreamConfiguration.reader.length;
        }
        else{
            this.readerLength = 0;
        }

        this.minZoom = 0.5;
        this.maxZoom = 10;
    }

    Draw(){
        self = this;
        svg = d3.select('svg#' + this.id);

        svg.attr('viewBox', '0 0 ' + this.svgWidth + ' ' +  this.svgHeight)
            .attr('width', this.svgWidth)
            .attr('height', this.svgHeight)
            .attr('xmlns', 'http://www.w3.org/2000/svg')
            .attr('xmlns:xlink', 'http://www.w3.org/1999/xlink')
            .style('position', 'absolute')
            .selectAll('svg');

        // rectangle around the svg
        svg.append('rect')
            .attr('width', this.svgWidth)
            .attr('height', this.svgHeight)
            .style('fill','white')
            .style('fill-opacity', 1)
            .style('stroke', function(){
                if(self.margin){
                    return 'black';
                }
                return 'white';
            })
            .style('stroke-width', 1);
        this.container = svg.append('g');
        this.containerSelectAll = this.container.selectAll('g');

        svg.on("contextmenu", function(){
            var contextMenu = [
                {"title": "Add Reader", "icon": "import", "id": "add-reader-button"},
                {"title": "Add Gadget", "icon": "cog", "id": "add-gadget-button"},
                {"title": "Add Writer", "icon": "export", "id": "add-writer-button"}];

            d3.event.preventDefault();
            var position = d3.mouse(this);
            var menu = d3.select('#context-menu')
                .style('left', position[0] + "px")
                .style('top', position[1] + "px")
                .style('display', 'inline-block')
                .on('mouseleave', function() {
                    d3.select('#context-menu').style('display', 'none');
                });
            menu.selectAll('li')
                .data(contextMenu)
                .enter()
                .append('li')
                .html(function(data, index){
                    return `<a id="${data.id}"><i class="glyphicon glyphicon-${data.icon}" aria-hidden="true"></i> ${data.title}</a>`;
                })
                .on('click', function(data) {
                    self.clickContextMenu(data);
                    d3.select('#context-menu').style('display', 'none');
                });
        });

        if(this.draggabel){
            svg.call(d3.zoom()
                .scaleExtent([this.minZoom, this.maxZoom])
                .on("zoom", self.ZoomAndMove));
        }

        if(this.readerLength){
            this.readers = new SvgGroupReader(this.model.get('configuration').gadgetronStreamConfiguration.reader, this.gadgetLength, this.id, this.svgScalingFactor, this.changedEvent, this.container, this.containerSelectAll, this.RerenderCallback);
            this.readers.Draw();
        }

        if(this.gadgetLength){
            this.gadgets = new SvgGroupGadget(this.model.get('configuration').gadgetronStreamConfiguration.gadget, this.gadgetLength, this.id, this.svgScalingFactor, this.changedEvent, this.container, this.containerSelectAll, this.RerenderCallback, this.RerenderGroupCallback);
            this.gadgets.Draw();
        }

        if(this.writerLength){
            this.writers = new SvgGroupWriter(this.model.get('configuration').gadgetronStreamConfiguration.writer, this.gadgetLength, this.id, this.svgScalingFactor, this.changedEvent, this.container, this.containerSelectAll, this.RerenderCallback);
            this.writers.Draw();
        }

        if(this.gadgets){
            this.container
                .attr('transform',"translate(" +  this.gadgets.gapBetweenGroups / 2 + ",0)");
        }
    }

    // Draw the red rectangle of the visible region when zoomed in
    DrawVisibleRegion(transform){
        if(this.visibleRectangle === undefined){
            this.visibleRectangle = this.container.append('rect')
                .attr('width', this.svgWidth)
                .attr('height', this.svgHeight)
                .style('fill-opacity', 0)
                .style('stroke','red')
                .style('stroke-width', 1);
        }
        else{
            this.visibleRectangle.attr('x', (transform.x / this.svgScalingFactor) * -1);
            this.visibleRectangle.attr('y', (transform.y / this.svgScalingFactor) * -1);
            var scaleFactor = 1 / transform.k;
            this.visibleRectangle.attr('transform', 'scale(' + scaleFactor + ')');
        }
    }

    ToolBarClickedEvent(event){
        self.lastEvent = event;
        if($(event.currentTarget).hasClass('active')){
            switch (event.currentTarget.id) {
                case 'remove-button':
                    self.lastClass = 'remove';
                    self.ToggleAllRectangleClasses('edit','remove');
                    break;
                case 'reorder-button':
                    self.lastClass = 'move';
                    if(this.gadgets){
                        this.gadgets.ToggleRectangleClass('edit', false);
                        this.gadgets.ToggleRectangleClass('move', true);
                    }
                    break;
                default:
                    break;
            }
        }
        else{
            self.ToggleAllRectangleClasses(self.lastClass,'edit');
        }
    }

    AppendReader(reader){
        if(!self.model.get('configuration').gadgetronStreamConfiguration.reader){
            self.model.get('configuration').gadgetronStreamConfiguration.reader = new Array();
        }
        self.model.get('configuration').gadgetronStreamConfiguration.reader.push(reader.convertModel());
        self.RerenderCallback();
    }

    AppendGadget(gadget){
        if(!self.model.get('configuration').gadgetronStreamConfiguration.gadget){
            self.model.get('configuration').gadgetronStreamConfiguration.gadget = new Array();
        }
        self.model.get('configuration').gadgetronStreamConfiguration.gadget.push(gadget.convertModel());
        self.RerenderCallback();
    }

    AppendWriter(writer){
        if(!self.model.get('configuration').gadgetronStreamConfiguration.writer){
            self.model.get('configuration').gadgetronStreamConfiguration.writer = new Array();
        }
        self.model.get('configuration').gadgetronStreamConfiguration.writer.push(writer.convertModel());
        self.RerenderCallback();
    }

    RerenderCallback(model){
        if($(self.lastEvent.currentTarget).hasClass('active-btn')){
            $(self.lastEvent.currentTarget).toggleClass('active');
        }
        self.rerenderCallback(model);
    }

    RerenderGroupCallback(groupGadget){
        self.changedEvent();
        groupGadget.group.remove();
        groupGadget.containerRect.remove();
        groupGadget.containerRectText.remove();
        self.gadgets = new SvgGroupGadget(self.model.get('configuration').gadgetronStreamConfiguration.gadget, self.gadgetLength, self.id, self.svgScalingFactor, self.changedEvent, self.container, self.containerSelectAll, self.RerenderCallback, self.RerenderGroupCallback);
        self.gadgets.Draw();
        self.gadgets.ToggleRectangleClass('edit', false);
        self.gadgets.ToggleRectangleClass('move', true);
    }

    ZoomAndMove(){
        self.zoomCallback(d3.event.transform);
        self.container.attr("transform", d3.event.transform);
    }

    ToggleAllRectangleClasses(currentClass, newClass){
        if(this.readers){
            this.readers.ToggleRectangleClass(currentClass, false);
            this.readers.ToggleRectangleClass(newClass, true);
        }
        if(this.gadgets){
            this.gadgets.ToggleRectangleClass(currentClass, false);
            this.gadgets.ToggleRectangleClass(newClass, true);
        }
        if(this.writers){
            this.writers.ToggleRectangleClass(currentClass, false);
            this.writers.ToggleRectangleClass(newClass, true);
        }
    }
}

module.exports = GadgetronStreamConfigurationSvg;
<|endoftext|>


<commit_before>// POLYFILLS
import './polyfill/array-find.js';
import './polyfill/math-log2.js';
import './polyfill/math-sign.js';
import './polyfill/object-assign.js';
import './polyfill/pointer-lock.js';
import './polyfill/request-animation-frame.js';
import './polyfill/string.js';

// CORE
export { apps, common, config, data, extend, isDefined, makeArray, revision, type, version } from './core/core.js';
export { debug } from './core/debug.js';
export { events } from './core/events.js';
export { guid } from './core/guid.js';
export { path } from './core/path.js';
export { platform } from './core/platform.js';
export { string } from './core/string.js';
export { Color } from './core/color.js';
export { EventHandler } from './core/event-handler.js';
export { IndexedList } from './core/indexed-list.js';
export { Tags } from './core/tags.js';
export { Timer, now } from './core/time.js';
export { URI, createURI } from './core/uri.js';

// NET
export { http, Http } from './net/http.js';

// MATH
export * from './math/constants.js';
export { math } from './math/math.js';
export { Curve } from './math/curve.js';
export { CurveSet } from './math/curve-set.js';
export { Mat3 } from './math/mat3.js';
export { Mat4 } from './math/mat4.js';
export { Quat } from './math/quat.js';
export { Vec2 } from './math/vec2.js';
export { Vec3 } from './math/vec3.js';
export { Vec4 } from './math/vec4.js';

// SHAPE
export { BoundingBox } from './shape/bounding-box.js';
export { BoundingSphere } from './shape/bounding-sphere.js';
export { Frustum } from './shape/frustum.js';
export { OrientedBox } from './shape/oriented-box.js';
export { Plane } from './shape/plane.js';
export { Ray } from './shape/ray.js';

// GRAPHICS
export * from './graphics/graphics.js';
export { drawQuadWithShader, drawTexture } from './graphics/simple-post-effect.js';
export { prefilterCubemap, shFromCubemap } from './graphics/prefilter-cubemap.js';
export { programlib } from './graphics/program-lib/program-lib.js';
export { shaderChunks } from './graphics/chunks.js';
export { GraphicsDevice } from './graphics/device.js';
export { IndexBuffer } from './graphics/index-buffer.js';
export { PostEffect, drawFullscreenQuad } from './graphics/post-effect.js';
export { ProgramLibrary } from './graphics/program-library.js';
export { RenderTarget } from './graphics/render-target.js';
export { ScopeId } from './graphics/scope-id.js';
export { ScopeSpace } from './graphics/scope-space.js';
export { Shader } from './graphics/shader.js';
export { Texture } from './graphics/texture.js';
export { TransformFeedback } from './graphics/transform-feedback.js';
export { VertexBuffer } from './graphics/vertex-buffer.js';
export { VertexFormat } from './graphics/vertex-format.js';
export { VertexIterator } from './graphics/vertex-iterator.js';

// SCENE
export * from './scene/constants.js';
export { calculateNormals, calculateTangents, createBox, createCapsule, createCone, createCylinder, createMesh, createPlane, createSphere, createTorus } from './scene/procedural.js';
export { BasicMaterial } from './scene/materials/basic-material.js';
export { Batch, BatchGroup, BatchManager } from './scene/batching.js';
export { Camera } from './scene/camera.js';
export { DepthMaterial } from './scene/materials/depth-material.js';
export { ForwardRenderer } from './scene/forward-renderer.js';
export { GraphNode } from './scene/graph-node.js';
export { Layer } from './scene/layer.js';
export { LayerComposition } from './scene/layer-composition.js';
export { Light } from './scene/light.js';
export { Lightmapper } from './scene/lightmapper.js';
export { Material } from './scene/materials/material.js';
export { Mesh } from './scene/mesh.js';
export { MeshInstance, Command } from './scene/mesh-instance.js';
export { Model } from './scene/model.js';
export { Morph } from './scene/morph.js';
export { MorphInstance } from './scene/morph-instance.js';
export { MorphTarget } from './scene/morph-target.js';
export { ParticleEmitter } from './scene/particle-system/particle-emitter.js';
export { Picker } from './scene/pick.js';
export { Scene } from './scene/scene.js';
export { Skin, SkinInstance } from './scene/skin.js';
export { Sprite } from './scene/sprite.js';
export { StandardMaterial } from './scene/materials/standard-material.js';
export { StencilParameters } from './scene/stencil-parameters.js';
export { TextureAtlas } from './scene/texture-atlas.js';

// ANIMATION
export * from './anim/constants.js';
export { Animation, Key, Node } from './anim/animation.js';
export { Skeleton } from './anim/skeleton.js';
export { AnimBinder, AnimClip, AnimCurve, AnimData, AnimEvaluator, AnimSnapshot, AnimTarget, AnimTrack, DefaultAnimBinder } from './anim/anim.js';

// SOUND
export * from './audio/constants.js';

export { SoundManager } from './sound/manager.js';
export { Sound } from './sound/sound.js';
export { SoundInstance } from './sound/instance.js';
export { SoundInstance3d } from './sound/instance3d.js';

// BUNDLES
export { Bundle } from './bundles/bundle.js';
export { BundleRegistry } from './bundles/bundle-registry.js';

// RESOURCES
export { basisDownload, basisDownloadFromConfig, basisInitialize, basisTargetFormat, basisTranscode } from './resources/basis.js';
export { AnimClipHandler } from './resources/anim-clip.js';
export { AnimStateGraphHandler } from './resources/anim-state-graph.js';
export { AnimationHandler } from './resources/animation.js';
export { AudioHandler } from './resources/audio.js';
export { BasisParser } from './resources/parser/texture/basis.js';
export { BinaryHandler } from './resources/binary.js';
export { BundleHandler } from './resources/bundle.js';
export { ContainerHandler, ContainerResource } from './resources/container.js';
export { createStyle, CssHandler } from './resources/css.js';
export { CubemapHandler } from './resources/cubemap.js';
export { FolderHandler } from './resources/folder.js';
export { FontHandler } from './resources/font.js';
export { HierarchyHandler } from './resources/hierarchy.js';
export { HtmlHandler } from './resources/html.js';
export { ImgParser } from './resources/parser/texture/img.js';
export { JsonHandler } from './resources/json.js';
export { JsonStandardMaterialParser } from './resources/parser/material/json-standard-material.js';
export { KtxParser } from './resources/parser/texture/ktx.js';
export { LegacyDdsParser } from './resources/parser/texture/legacy-dds.js';
export { MaterialHandler } from './resources/material.js';
export { ModelHandler } from './resources/model.js';
export { ResourceHandler } from './resources/handler.js';
export { ResourceLoader } from './resources/loader.js';
export { ScriptHandler } from './resources/script.js';
export { SceneHandler } from './resources/scene.js';
export { SceneSettingsHandler } from './resources/scene-settings.js';
export { ShaderHandler } from './resources/shader.js';
export { SpriteHandler } from './resources/sprite.js';
export { TemplateHandler } from './resources/template.js';
export { TextHandler } from './resources/text.js';
export { TextureHandler, TextureParser } from './resources/texture.js';
export { TextureAtlasHandler } from './resources/texture-atlas.js';

// ASSETS
export * from './asset/constants.js';
export { Asset } from './asset/asset.js';
export { AssetListLoader } from './asset/asset-list-loader.js';
export { AssetReference } from './asset/asset-reference.js';
export { AssetRegistry } from './asset/asset-registry.js';
export { LocalizedAsset } from './asset/asset-localized.js';

// SCRIPTS
export { createScript, registerScript } from './script/script.js';
export { ScriptAttributes } from './script/script-attributes.js';
export { ScriptRegistry } from './script/script-registry.js';
export { ScriptType } from './script/script-type.js';

// LOCALIZATION
export { I18n } from './i18n/i18n.js';

// INPUT
export * from './input/constants.js';
export { Controller } from './input/controller.js';
export { ElementInput, ElementInputEvent, ElementMouseEvent, ElementSelectEvent, ElementTouchEvent } from './input/element-input.js';
export { GamePads } from './input/game-pads.js';
export { Keyboard, KeyboardEvent } from './input/keyboard.js';
export { Mouse, MouseEvent } from './input/mouse.js';
export { getTouchTargetCoords, Touch, TouchDevice, TouchEvent } from './input/touch.js';

// FRAMEWORK
export * from './framework/constants.js';
export { script } from './framework/script.js';
export { app, Application } from './framework/application.js';
export { AnimationComponent } from './framework/components/animation/component.js';
export { AnimationComponentSystem } from './framework/components/animation/system.js';
export * from './framework/components/anim/constants.js';
export { AnimComponent } from './framework/components/anim/component.js';
export { AnimComponentLayer } from './framework/components/anim/layer.js';
export { AnimComponentSystem } from './framework/components/anim/system.js';
export { AnimController } from './framework/components/anim/controller.js';
export { AnimPropertyLocator } from './framework/components/anim/property-locator.js';
export { AnimStateGraph } from './framework/components/anim/state-graph.js';
export { AudioListenerComponent } from './framework/components/audio-listener/component.js';
export { AudioListenerComponentSystem } from './framework/components/audio-listener/system.js';
export { AudioSourceComponent } from './framework/components/audio-source/component.js';
export { AudioSourceComponentSystem } from './framework/components/audio-source/system.js';
export * from './framework/components/button/constants.js';
export { ButtonComponent } from './framework/components/button/component.js';
export { ButtonComponentSystem } from './framework/components/button/system.js';
export { CameraComponent } from './framework/components/camera/component.js';
export { CameraComponentSystem } from './framework/components/camera/system.js';
export { CanvasFont } from './framework/components/text/canvas-font.js';
export { CollisionComponent } from './framework/components/collision/component.js';
export { CollisionComponentSystem } from './framework/components/collision/system.js';
export { Component } from './framework/components/component.js';
export { ComponentData } from './framework/components/data.js';
export { ComponentSystem } from './framework/components/system.js';
export { ComponentSystemRegistry } from './framework/components/registry.js';
export * from './framework/components/element/constants.js';
export { ElementComponent } from './framework/components/element/component.js';
export { ElementComponentSystem } from './framework/components/element/system.js';
export { ElementDragHelper } from './framework/components/element/element-drag-helper.js';
export { Entity } from './framework/entity.js';
export { EntityReference } from './framework/utils/entity-reference.js';
export { Font, FONT_BITMAP, FONT_MSDF } from './framework/components/text/font.js';
export { ImageElement } from './framework/components/element/image-element.js';
export { LayoutCalculator } from './framework/components/layout-group/layout-calculator.js';
export { LayoutChildComponent } from './framework/components/layout-child/component.js';
export { LayoutChildComponentSystem } from './framework/components/layout-child/system.js';
export * from './framework/components/layout-group/constants.js';
export { LayoutGroupComponent } from './framework/components/layout-group/component.js';
export { LayoutGroupComponentSystem } from './framework/components/layout-group/system.js';
export { LightComponent } from './framework/components/light/component.js';
export { LightComponentSystem } from './framework/components/light/system.js';
export { ModelComponent } from './framework/components/model/component.js';
export { ModelComponentSystem } from './framework/components/model/system.js';
export { ParticleSystemComponent } from './framework/components/particle-system/component.js';
export { ParticleSystemComponentSystem } from './framework/components/particle-system/system.js';
export { PostEffectQueue } from './framework/components/camera/post-effect-queue.js';
export * from './framework/components/rigid-body/constants.js';
export { RigidBodyComponent } from './framework/components/rigid-body/component.js';
export { RigidBodyComponentSystem, ContactPoint, ContactResult, RaycastResult, SingleContactResult } from './framework/components/rigid-body/system.js';
export { SceneRegistry, SceneRegistryItem } from './framework/scene-registry.js';
export * from './framework/components/screen/constants.js';
export { ScreenComponent } from './framework/components/screen/component.js';
export { ScreenComponentSystem } from './framework/components/screen/system.js';
export { ScriptComponent } from './framework/components/script/component.js';
export { ScriptComponentSystem } from './framework/components/script/system.js';
export { ScriptLegacyComponent } from './framework/components/script-legacy/component.js';
export { ScriptLegacyComponentSystem } from './framework/components/script-legacy/system.js';
export { ScrollbarComponent } from './framework/components/scrollbar/component.js';
export { ScrollbarComponentSystem } from './framework/components/scrollbar/system.js';
export * from './framework/components/scroll-view/constants.js';
export { ScrollViewComponent } from './framework/components/scroll-view/component.js';
export { ScrollViewComponentSystem } from './framework/components/scroll-view/system.js';
export { SortedLoopArray } from './framework/utils/sorted-loop-array.js';
export { SoundSlot } from './framework/components/sound/slot.js';
export { SoundComponent } from './framework/components/sound/component.js';
export { SoundComponentSystem } from './framework/components/sound/system.js';
export * from './framework/components/sprite/constants.js';
export { SpriteAnimationClip } from './framework/components/sprite/sprite-animation-clip.js';
export { SpriteComponent } from './framework/components/sprite/component.js';
export { SpriteComponentSystem } from './framework/components/sprite/system.js';
export { TextElement } from './framework/components/element/text-element.js';
export { ZoneComponent } from './framework/components/zone/component.js';
export { ZoneComponentSystem } from './framework/components/zone/system.js';

// TEMPLATES
export { Template } from './templates/template.js';
export { TemplateUtils } from './templates/template-utils.js';

// VR
export { VrDisplay } from './vr/vr-display.js';
export { VrManager } from './vr/vr-manager.js';

// XR
export * from './xr/constants.js';
export { XrInput } from './xr/xr-input.js';
export { XrInputSource } from './xr/xr-input-source.js';
export { XrLightEstimation } from './xr/xr-light-estimation.js';
export { XrManager } from './xr/xr-manager.js';
export { XrHitTest } from './xr/xr-hit-test.js';
export { XrHitTestSource } from './xr/xr-hit-test-source.js';

// BACKWARDS COMPATIBILITY
export * from './deprecated.js';
<commit_msg>Expose PostEffectPass<commit_after>// POLYFILLS
import './polyfill/array-find.js';
import './polyfill/math-log2.js';
import './polyfill/math-sign.js';
import './polyfill/object-assign.js';
import './polyfill/pointer-lock.js';
import './polyfill/request-animation-frame.js';
import './polyfill/string.js';

// CORE
export { apps, common, config, data, extend, isDefined, makeArray, revision, type, version } from './core/core.js';
export { debug } from './core/debug.js';
export { events } from './core/events.js';
export { guid } from './core/guid.js';
export { path } from './core/path.js';
export { platform } from './core/platform.js';
export { string } from './core/string.js';
export { Color } from './core/color.js';
export { EventHandler } from './core/event-handler.js';
export { IndexedList } from './core/indexed-list.js';
export { Tags } from './core/tags.js';
export { Timer, now } from './core/time.js';
export { URI, createURI } from './core/uri.js';

// NET
export { http, Http } from './net/http.js';

// MATH
export * from './math/constants.js';
export { math } from './math/math.js';
export { Curve } from './math/curve.js';
export { CurveSet } from './math/curve-set.js';
export { Mat3 } from './math/mat3.js';
export { Mat4 } from './math/mat4.js';
export { Quat } from './math/quat.js';
export { Vec2 } from './math/vec2.js';
export { Vec3 } from './math/vec3.js';
export { Vec4 } from './math/vec4.js';

// SHAPE
export { BoundingBox } from './shape/bounding-box.js';
export { BoundingSphere } from './shape/bounding-sphere.js';
export { Frustum } from './shape/frustum.js';
export { OrientedBox } from './shape/oriented-box.js';
export { Plane } from './shape/plane.js';
export { Ray } from './shape/ray.js';

// GRAPHICS
export * from './graphics/graphics.js';
export { drawQuadWithShader, drawTexture } from './graphics/simple-post-effect.js';
export { prefilterCubemap, shFromCubemap } from './graphics/prefilter-cubemap.js';
export { programlib } from './graphics/program-lib/program-lib.js';
export { shaderChunks } from './graphics/chunks.js';
export { GraphicsDevice } from './graphics/device.js';
export { IndexBuffer } from './graphics/index-buffer.js';
export { PostEffect, drawFullscreenQuad } from './graphics/post-effect.js';
export { ProgramLibrary } from './graphics/program-library.js';
export { RenderTarget } from './graphics/render-target.js';
export { ScopeId } from './graphics/scope-id.js';
export { ScopeSpace } from './graphics/scope-space.js';
export { Shader } from './graphics/shader.js';
export { Texture } from './graphics/texture.js';
export { TransformFeedback } from './graphics/transform-feedback.js';
export { VertexBuffer } from './graphics/vertex-buffer.js';
export { VertexFormat } from './graphics/vertex-format.js';
export { VertexIterator } from './graphics/vertex-iterator.js';

// SCENE
export * from './scene/constants.js';
export { calculateNormals, calculateTangents, createBox, createCapsule, createCone, createCylinder, createMesh, createPlane, createSphere, createTorus } from './scene/procedural.js';
export { BasicMaterial } from './scene/materials/basic-material.js';
export { Batch, BatchGroup, BatchManager } from './scene/batching.js';
export { Camera } from './scene/camera.js';
export { DepthMaterial } from './scene/materials/depth-material.js';
export { ForwardRenderer } from './scene/forward-renderer.js';
export { GraphNode } from './scene/graph-node.js';
export { Layer } from './scene/layer.js';
export { LayerComposition } from './scene/layer-composition.js';
export { Light } from './scene/light.js';
export { Lightmapper } from './scene/lightmapper.js';
export { Material } from './scene/materials/material.js';
export { Mesh } from './scene/mesh.js';
export { MeshInstance, Command } from './scene/mesh-instance.js';
export { Model } from './scene/model.js';
export { Morph } from './scene/morph.js';
export { MorphInstance } from './scene/morph-instance.js';
export { MorphTarget } from './scene/morph-target.js';
export { ParticleEmitter } from './scene/particle-system/particle-emitter.js';
export { Picker } from './scene/pick.js';
export { Scene } from './scene/scene.js';
export { Skin, SkinInstance } from './scene/skin.js';
export { Sprite } from './scene/sprite.js';
export { StandardMaterial } from './scene/materials/standard-material.js';
export { StencilParameters } from './scene/stencil-parameters.js';
export { TextureAtlas } from './scene/texture-atlas.js';

// ANIMATION
export * from './anim/constants.js';
export { Animation, Key, Node } from './anim/animation.js';
export { Skeleton } from './anim/skeleton.js';
export { AnimBinder, AnimClip, AnimCurve, AnimData, AnimEvaluator, AnimSnapshot, AnimTarget, AnimTrack, DefaultAnimBinder } from './anim/anim.js';

// SOUND
export * from './audio/constants.js';

export { SoundManager } from './sound/manager.js';
export { Sound } from './sound/sound.js';
export { SoundInstance } from './sound/instance.js';
export { SoundInstance3d } from './sound/instance3d.js';

// BUNDLES
export { Bundle } from './bundles/bundle.js';
export { BundleRegistry } from './bundles/bundle-registry.js';

// RESOURCES
export { basisDownload, basisDownloadFromConfig, basisInitialize, basisTargetFormat, basisTranscode } from './resources/basis.js';
export { AnimClipHandler } from './resources/anim-clip.js';
export { AnimStateGraphHandler } from './resources/anim-state-graph.js';
export { AnimationHandler } from './resources/animation.js';
export { AudioHandler } from './resources/audio.js';
export { BasisParser } from './resources/parser/texture/basis.js';
export { BinaryHandler } from './resources/binary.js';
export { BundleHandler } from './resources/bundle.js';
export { ContainerHandler, ContainerResource } from './resources/container.js';
export { createStyle, CssHandler } from './resources/css.js';
export { CubemapHandler } from './resources/cubemap.js';
export { FolderHandler } from './resources/folder.js';
export { FontHandler } from './resources/font.js';
export { HierarchyHandler } from './resources/hierarchy.js';
export { HtmlHandler } from './resources/html.js';
export { ImgParser } from './resources/parser/texture/img.js';
export { JsonHandler } from './resources/json.js';
export { JsonStandardMaterialParser } from './resources/parser/material/json-standard-material.js';
export { KtxParser } from './resources/parser/texture/ktx.js';
export { LegacyDdsParser } from './resources/parser/texture/legacy-dds.js';
export { MaterialHandler } from './resources/material.js';
export { ModelHandler } from './resources/model.js';
export { ResourceHandler } from './resources/handler.js';
export { ResourceLoader } from './resources/loader.js';
export { ScriptHandler } from './resources/script.js';
export { SceneHandler } from './resources/scene.js';
export { SceneSettingsHandler } from './resources/scene-settings.js';
export { ShaderHandler } from './resources/shader.js';
export { SpriteHandler } from './resources/sprite.js';
export { TemplateHandler } from './resources/template.js';
export { TextHandler } from './resources/text.js';
export { TextureHandler, TextureParser } from './resources/texture.js';
export { TextureAtlasHandler } from './resources/texture-atlas.js';

// ASSETS
export * from './asset/constants.js';
export { Asset } from './asset/asset.js';
export { AssetListLoader } from './asset/asset-list-loader.js';
export { AssetReference } from './asset/asset-reference.js';
export { AssetRegistry } from './asset/asset-registry.js';
export { LocalizedAsset } from './asset/asset-localized.js';

// SCRIPTS
export { createScript, registerScript } from './script/script.js';
export { ScriptAttributes } from './script/script-attributes.js';
export { ScriptRegistry } from './script/script-registry.js';
export { ScriptType } from './script/script-type.js';

// LOCALIZATION
export { I18n } from './i18n/i18n.js';

// INPUT
export * from './input/constants.js';
export { Controller } from './input/controller.js';
export { ElementInput, ElementInputEvent, ElementMouseEvent, ElementSelectEvent, ElementTouchEvent } from './input/element-input.js';
export { GamePads } from './input/game-pads.js';
export { Keyboard, KeyboardEvent } from './input/keyboard.js';
export { Mouse, MouseEvent } from './input/mouse.js';
export { getTouchTargetCoords, Touch, TouchDevice, TouchEvent } from './input/touch.js';

// FRAMEWORK
export * from './framework/constants.js';
export { script } from './framework/script.js';
export { app, Application } from './framework/application.js';
export { AnimationComponent } from './framework/components/animation/component.js';
export { AnimationComponentSystem } from './framework/components/animation/system.js';
export * from './framework/components/anim/constants.js';
export { AnimComponent } from './framework/components/anim/component.js';
export { AnimComponentLayer } from './framework/components/anim/layer.js';
export { AnimComponentSystem } from './framework/components/anim/system.js';
export { AnimController } from './framework/components/anim/controller.js';
export { AnimPropertyLocator } from './framework/components/anim/property-locator.js';
export { AnimStateGraph } from './framework/components/anim/state-graph.js';
export { AudioListenerComponent } from './framework/components/audio-listener/component.js';
export { AudioListenerComponentSystem } from './framework/components/audio-listener/system.js';
export { AudioSourceComponent } from './framework/components/audio-source/component.js';
export { AudioSourceComponentSystem } from './framework/components/audio-source/system.js';
export * from './framework/components/button/constants.js';
export { ButtonComponent } from './framework/components/button/component.js';
export { ButtonComponentSystem } from './framework/components/button/system.js';
export { CameraComponent } from './framework/components/camera/component.js';
export { CameraComponentSystem } from './framework/components/camera/system.js';
export { CanvasFont } from './framework/components/text/canvas-font.js';
export { CollisionComponent } from './framework/components/collision/component.js';
export { CollisionComponentSystem } from './framework/components/collision/system.js';
export { Component } from './framework/components/component.js';
export { ComponentData } from './framework/components/data.js';
export { ComponentSystem } from './framework/components/system.js';
export { ComponentSystemRegistry } from './framework/components/registry.js';
export * from './framework/components/element/constants.js';
export { ElementComponent } from './framework/components/element/component.js';
export { ElementComponentSystem } from './framework/components/element/system.js';
export { ElementDragHelper } from './framework/components/element/element-drag-helper.js';
export { Entity } from './framework/entity.js';
export { EntityReference } from './framework/utils/entity-reference.js';
export { Font, FONT_BITMAP, FONT_MSDF } from './framework/components/text/font.js';
export { ImageElement } from './framework/components/element/image-element.js';
export { LayoutCalculator } from './framework/components/layout-group/layout-calculator.js';
export { LayoutChildComponent } from './framework/components/layout-child/component.js';
export { LayoutChildComponentSystem } from './framework/components/layout-child/system.js';
export * from './framework/components/layout-group/constants.js';
export { LayoutGroupComponent } from './framework/components/layout-group/component.js';
export { LayoutGroupComponentSystem } from './framework/components/layout-group/system.js';
export { LightComponent } from './framework/components/light/component.js';
export { LightComponentSystem } from './framework/components/light/system.js';
export { ModelComponent } from './framework/components/model/component.js';
export { ModelComponentSystem } from './framework/components/model/system.js';
export { ParticleSystemComponent } from './framework/components/particle-system/component.js';
export { ParticleSystemComponentSystem } from './framework/components/particle-system/system.js';
export { PostEffectPass } from './framework/components/camera/post-effect-pass.js';
export { PostEffectQueue } from './framework/components/camera/post-effect-queue.js';
export * from './framework/components/rigid-body/constants.js';
export { RigidBodyComponent } from './framework/components/rigid-body/component.js';
export { RigidBodyComponentSystem, ContactPoint, ContactResult, RaycastResult, SingleContactResult } from './framework/components/rigid-body/system.js';
export { SceneRegistry, SceneRegistryItem } from './framework/scene-registry.js';
export * from './framework/components/screen/constants.js';
export { ScreenComponent } from './framework/components/screen/component.js';
export { ScreenComponentSystem } from './framework/components/screen/system.js';
export { ScriptComponent } from './framework/components/script/component.js';
export { ScriptComponentSystem } from './framework/components/script/system.js';
export { ScriptLegacyComponent } from './framework/components/script-legacy/component.js';
export { ScriptLegacyComponentSystem } from './framework/components/script-legacy/system.js';
export { ScrollbarComponent } from './framework/components/scrollbar/component.js';
export { ScrollbarComponentSystem } from './framework/components/scrollbar/system.js';
export * from './framework/components/scroll-view/constants.js';
export { ScrollViewComponent } from './framework/components/scroll-view/component.js';
export { ScrollViewComponentSystem } from './framework/components/scroll-view/system.js';
export { SortedLoopArray } from './framework/utils/sorted-loop-array.js';
export { SoundSlot } from './framework/components/sound/slot.js';
export { SoundComponent } from './framework/components/sound/component.js';
export { SoundComponentSystem } from './framework/components/sound/system.js';
export * from './framework/components/sprite/constants.js';
export { SpriteAnimationClip } from './framework/components/sprite/sprite-animation-clip.js';
export { SpriteComponent } from './framework/components/sprite/component.js';
export { SpriteComponentSystem } from './framework/components/sprite/system.js';
export { TextElement } from './framework/components/element/text-element.js';
export { ZoneComponent } from './framework/components/zone/component.js';
export { ZoneComponentSystem } from './framework/components/zone/system.js';

// TEMPLATES
export { Template } from './templates/template.js';
export { TemplateUtils } from './templates/template-utils.js';

// VR
export { VrDisplay } from './vr/vr-display.js';
export { VrManager } from './vr/vr-manager.js';

// XR
export * from './xr/constants.js';
export { XrInput } from './xr/xr-input.js';
export { XrInputSource } from './xr/xr-input-source.js';
export { XrLightEstimation } from './xr/xr-light-estimation.js';
export { XrManager } from './xr/xr-manager.js';
export { XrHitTest } from './xr/xr-hit-test.js';
export { XrHitTestSource } from './xr/xr-hit-test-source.js';

// BACKWARDS COMPATIBILITY
export * from './deprecated.js';
<|endoftext|>


<commit_before>
var AttendeeSelectionOptionView = Backbone.Layout.extend({
    template: "#attendee-selection-option-template",
    tagName: "div",
    className: "controls",

    option: null,
    selectionModel: null,
    attendeeModel: null,

    modelChecked: null,

    events: {
        'change input': 'selectionChangedHandler'
    },

    initialize: function(options) {

        this.option = options.option;
        this.selectionModel = options.selectionModel;
        this.attendeeModel = options.attendeeModel;

        this.modelChecked = !this.selectionModel.isNew();
    },

    serialize: function() {
        return {
            option: this.option,
            isChecked: this.modelChecked
        };
    },

    selectionChangedHandler: function() {

        var checked = this.$('input:checkbox')[0].checked;

        console.log("modelCHecked: " + this.modelChecked + " checked: " + checked);
        if (checked != this.modelChecked) {

            if (checked) {
                // add it
                console.log('commit');
                this.selectionModel.save();
                this.modelChecked = true;

            } else {
                // delete it
                console.log('rewoke');
                this.selectionModel.destroy({
                    success: function(model) {
                        model.unset('id');
                        model.unset('resource_uri');
                    }
                });

                this.modelChecked = false;
            }

        } else {
            console.log('hunh');
        }
    },

    afterRender: function() {
        this.$('input:checkbox').attr('checked', this.modelChecked);
    }
});<commit_msg>Correction to debug output<commit_after>
var AttendeeSelectionOptionView = Backbone.Layout.extend({
    template: "#attendee-selection-option-template",
    tagName: "div",
    className: "controls",

    option: null,
    selectionModel: null,
    attendeeModel: null,

    modelChecked: null,

    events: {
        'change input': 'selectionChangedHandler'
    },

    initialize: function(options) {

        this.option = options.option;
        this.selectionModel = options.selectionModel;
        this.attendeeModel = options.attendeeModel;

        this.modelChecked = !this.selectionModel.isNew();
    },

    serialize: function() {
        return {
            option: this.option,
            isChecked: this.modelChecked
        };
    },

    selectionChangedHandler: function() {

        var checked = this.$('input:checkbox')[0].checked;

        console.log("modelChecked: " + this.modelChecked + " checked: " + checked);
        if (checked != this.modelChecked) {

            if (checked) {
                // add it
                console.log('commit');
                this.selectionModel.save();
                this.modelChecked = true;

            } else {
                // delete it
                console.log('rewoke');
                this.selectionModel.destroy({
                    success: function(model) {
                        model.unset('id');
                        model.unset('resource_uri');
                    }
                });

                this.modelChecked = false;
            }

        } else {
            console.log('hunh');
        }
    },

    afterRender: function() {
        this.$('input:checkbox').attr('checked', this.modelChecked);
    }
});<|endoftext|>


<commit_before>
function getSubstringCount(needle, haystack) {
    var m = haystack.match(new RegExp(needle.toString().replace(/(?=[.\\+*?[^\]$(){}\|])/g, "\\"), "g"));
    return m ? m.length:0;
}

function wordLimit(string, wordCount) {
	return string.split(/\s+/).slice(0,wordCount).join(" ");
}

function initializeSearchButton(){
    // Attach onclick handler to submit button
    var button = document.getElementById("search-button");
    button.addEventListener("click", onSearchClick);

    // give the search bar a submit on enter functionality
    $("#searchBar").keyup(function(event){
        if(event.keyCode == 13){ // enter key
            onSearchClick();
        }
    });
}

// Given a string, search all the charity data for particular results.
function getPointsMap(charityDetails){
	// ensure we have the charity data
	var pointsMap = {}; // pointsMap[points] -> [index, index, index]

	// get all the filters.
	var sessionObject = getSessionObject();
	var filters = sessionObject["searchFilters"];

	//filters = {"cause": ["Museums", "Social Services"]};

	// loop over all charities [N is small, so this is OK]
	for (var i = 0; i < charityDetails.length; i++) {

		// ensure it passes all filters
		var passedFilters = true;
		for (var filterKey in filters) {
			if (filterKey === "rating") {
				passedFilters &= (+charityDetails[i]["rating"] >= +filters["rating"] );
			} else {
				passedFilters &= (-1 !== filters[filterKey].indexOf(charityDetails[i][filterKey]));
			}
		}
		if (!passedFilters) {
			continue;
		}

		var points = 0;
		for (j in sessionObject["searchStrings"]) {
			var inputString = sessionObject["searchStrings"][j].toLowerCase();
			// if it's in the name, give it 10 credits
			points += getSubstringCount(inputString, charityDetails[i].name.toLowerCase()) * 5;
			// if it's in the category or cause, give it three credits
			points += getSubstringCount(inputString, charityDetails[i].cause.toLowerCase()) * 3;
			points += getSubstringCount(inputString, charityDetails[i].category.toLowerCase()) * 3;
			// if it's in the mission, give it one credit.
			points += getSubstringCount(inputString, charityDetails[i].mission.toLowerCase()) * 1;

		}

		if (points > 0) {
			if (pointsMap[points]) {
				pointsMap[points] = pointsMap[points].concat(i);
			}
			else {
				pointsMap[points] = [i];
			}
		}
	}
	return pointsMap;
}

function addSubstringFilter(filterText) {
	var sessionObject = getSessionObject();
	sessionObject["searchStrings"].push(filterText);
	setSessionObject(sessionObject);
}

function removeSubstringFilter(element) {
	var sessionObject = getSessionObject();
	var currentSearchStrings = sessionObject["searchStrings"];
	var filterValue = $(element).siblings(".filter-substring-text")[0].innerHTML;

	currentSearchStrings = currentSearchStrings.filter(function(e) { return e !== filterValue });

	sessionObject["searchStrings"] = currentSearchStrings;
	setSessionObject(sessionObject);

	updateSearch();
}

function onSearchClick() {
	// add the current searchbar contents to the filter list
	var searchbar = $("#searchBar").val();
	addSubstringFilter(searchbar);
	updateSearch();
}

function updateSearch() {
	var charityDetails = getCharityDetails();
	var pointsMap = getPointsMap(charityDetails);

	var search_results = $("#search-results");
	search_results.empty();

	var keys = Object.keys(pointsMap);
	keys.sort(function (a, b) {return b-a;});
	/*
	var none_found_msg = document.createElement('div')
	var text_msg = document.createTextNode('No results found')
	none_found_msg.append(text_msg)
	none_found_msg.style.display = 'none'
	search_results.append(none_found_msg)

	var result_indeces = keys.map(function (i) {return pointsMap[i];});
	if (result_indeces.length == 0 && getSessionObject['searchStrings'].length != 0){
		document.getElementById('none_found').style.display = 'block'
	}else{
		document.getElementById('none_found').style.display = 'hidden'
	}
	*/
	// flatten the results.
	result_indeces = [].concat.apply([], result_indeces);

	var start = checkGETfor('start') || 0;
	var end = +start + 10; // the limit is ten per page

	for (var i = start; i < result_indeces.length && i < end; i++) {
		search_results.append(
			'
 \

'
					+ charityDetails[result_indeces[i]].name +
				'
\

'
					+ wordLimit(charityDetails[result_indeces[i]].mission, 18) + '... (see more)
\

'
					+ charityDetails[result_indeces[i]].mission + '  Learn More...
\

\

\
						Rating:	 \
						' + buildRating(charityDetails[result_indeces[i]].rating) + '	\
						Headquarters:	 \
						Seattle, Washington	\
						Cause:	 \
						'
						+ charityDetails[result_indeces[i]].cause + '	\

\

\
						Org. Type:	 \
						Private Foundation	\
						Regions of Operation:	 \
						Worldwide	\
						Charitable Commitment:	\
						$2.19B	\

\
						Founded:	\
						Jan 1, 1997	\

\

\

'
		)
	}

	// add links to other pages of results
	var pagination = $('

');
	for (var i = 0; i*10 < result_indeces.length; i++) {
		var extraclass = "";
		if (start == i*10) {
			extraclass = " results-page-link-active";
		}
		pagination.append('
  '+(i+1)+'
');
	}
	search_results.append(pagination);
}

function loadDetailsPage(pageIndex) {
	var q = getSessionObject();
	q.detailsCharity = pageIndex;
	setSessionObject(q);

	window.location.href = 'details.html';
}

function toggleDetailsTable(detailsP) {
	var relevantObjects = $(detailsP).siblings().add($(detailsP));
	relevantObjects.filter(".details-table-visible").removeClass("details-table-visible").addClass("details-table-temp");
	relevantObjects.filter(".details-table-hidden").removeClass("details-table-hidden").addClass("details-table-visible");
	relevantObjects.filter(".details-table-temp").removeClass("details-table-temp").addClass("details-table-hidden");
}

function checkGETfor(name){
    var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
    if (results==null){
       return null;
    }
    else{
       return results[1] || 0;
    }
}

function checkGETforQuery() {
	var query = checkGETfor("q");
	if (query) {
		$("#searchBar").val(query);
		//TODO: update this lol
		updateSearch();
	}
}

function toggleFilter(element, isChecked, filterType, filterValue) {
	var sessionObject = getSessionObject();
	var currentFilterList = sessionObject["searchFilters"][filterType];
	// if it's checked, add the filter to the current filter list
	if (isChecked) {
		if (currentFilterList) {
			currentFilterList.push(filterValue);
		} else {
			currentFilterList = [filterValue];
		}
		sessionObject["searchFilters"][filterType] = currentFilterList;
	}
	// if it's unchecked, remove the filter from the filter list
	else {
		currentFilterList = currentFilterList.filter(function(e) { return e !== filterValue });
		// and test to see if the filter list should be removed entirely.
		if (currentFilterList.length > 0) {
			sessionObject["searchFilters"][filterType] = currentFilterList;
		} else {
			delete sessionObject["searchFilters"][filterType];
		}
	}

	// if it's a category, hide / show the causes
	if (filterType === "category") {
		var categoryDiv = $(element).parent();
		if (isChecked) {
			categoryDiv.children(".filter-cause-hidden").addClass("filter-cause-visible").removeClass("filter-cause-hidden");
		} else {
			categoryDiv.children(".filter-cause-visible").removeClass("filter-cause-visible").addClass("filter-cause-hidden");
		}
	}
	setSessionObject(sessionObject);
	// trigger another onSearchClick
	updateSearch();
}

function onStarClick(el, val) {
	// set the rating filter
	var sessionObject = getSessionObject();
	var ratingFilter = sessionObject.searchFilters["rating"];
	if (ratingFilter === val) {
		delete sessionObject.searchFilters["rating"];
		val = undefined;
	} else {
		sessionObject.searchFilters["rating"] = val;
	}
	setSessionObject(sessionObject);

	// update the images
	val = val || "0";
	for (var i = 1; i <= 5; i++) {
		var img_src = 'imgs/star_empty.png';
		if (+val >= i) {
			img_src = 'imgs/star_fill.png';
		}
		$(el).siblings().add(el).filter(".filter-rating-star-" + i).attr('src', img_src);
	}

	updateSearch();
}

function buildRating(val) {
	var htmlBuilder = "";
	for (var i = 1; i <= 5; i++) {
		var img_src = "imgs/star_empty.png";
		if (val >= i) {
			img_src = "imgs/star_fill.png";
		}
		htmlBuilder += "";
	}
	return htmlBuilder;
}

function loadSidebar() {
	// inside #scopes, #category,
	// ignore #types, #organization for the moment.

	var allCategoriesDiv = $("#category");
	// for each cause: [#category]
	var currentCategory = "";
	var categoryDiv = null;
	for (i in allCauses) {
		// if it's a new category, make a new big div and checkbox
		if (allCauses[i][1] !== currentCategory) {
			// make a new big div and checkbox
			currentCategory = allCauses[i][1];
			categoryDiv = $('
 \
	            				<input type="checkbox" onchange="toggleFilter(this, this.checked, \'category\',\'' + currentCategory + '\')">\

' + currentCategory + '
\

(--)
\

');
			allCategoriesDiv.append(categoryDiv);
		}
		// make a checkbox for the cause
		categoryDiv.append('
 \
	            				<input type="checkbox" onchange="toggleFilter(this, this.checked, \'cause\',\'' + allCauses[i][0] + '\')">\

' + allCauses[i][0] + '
\

(--)
\

')
	}
	// for each scope: [#scopes]
	// make a checkbox for the scope
	var scopesDiv = $("#scopes");
	for (i in allScopes) {
		scopesDiv.append('
 \
	            				<input type="checkbox" onchange="toggleFilter(this, this.checked, \'Scope of Impact\',\'' + allScopes[i] + '\')">\

' + allScopes[i] + '
\

(--)
\

')

	}

	// for each active filter:
	var sessionObject = getSessionObject();
	var searchFilters = sessionObject["searchFilters"];
	for (i in searchFilters) {
		for (j in searchFilters[i]) {
			var el = $("#" + escapeSpaces(searchFilters[i][j])).siblings("input")[0];
		    el.checked = true;
		    el.onchange();
		}
	}
}
<commit_msg>no results found<commit_after>
function getSubstringCount(needle, haystack) {
    var m = haystack.match(new RegExp(needle.toString().replace(/(?=[.\\+*?[^\]$(){}\|])/g, "\\"), "g"));
    return m ? m.length:0;
}

function wordLimit(string, wordCount) {
	return string.split(/\s+/).slice(0,wordCount).join(" ");
}

function initializeSearchButton(){
    // Attach onclick handler to submit button
    var button = document.getElementById("search-button");
    button.addEventListener("click", onSearchClick);

    // give the search bar a submit on enter functionality
    $("#searchBar").keyup(function(event){
        if(event.keyCode == 13){ // enter key
            onSearchClick();
        }
    });
}

// Given a string, search all the charity data for particular results.
function getPointsMap(charityDetails){
	// ensure we have the charity data
	var pointsMap = {}; // pointsMap[points] -> [index, index, index]

	// get all the filters.
	var sessionObject = getSessionObject();
	var filters = sessionObject["searchFilters"];

	//filters = {"cause": ["Museums", "Social Services"]};

	// loop over all charities [N is small, so this is OK]
	for (var i = 0; i < charityDetails.length; i++) {

		// ensure it passes all filters
		var passedFilters = true;
		for (var filterKey in filters) {
			if (filterKey === "rating") {
				passedFilters &= (+charityDetails[i]["rating"] >= +filters["rating"] );
			} else {
				passedFilters &= (-1 !== filters[filterKey].indexOf(charityDetails[i][filterKey]));
			}
		}
		if (!passedFilters) {
			continue;
		}

		var points = 0;
		for (j in sessionObject["searchStrings"]) {
			var inputString = sessionObject["searchStrings"][j].toLowerCase();
			// if it's in the name, give it 10 credits
			points += getSubstringCount(inputString, charityDetails[i].name.toLowerCase()) * 5;
			// if it's in the category or cause, give it three credits
			points += getSubstringCount(inputString, charityDetails[i].cause.toLowerCase()) * 3;
			points += getSubstringCount(inputString, charityDetails[i].category.toLowerCase()) * 3;
			// if it's in the mission, give it one credit.
			points += getSubstringCount(inputString, charityDetails[i].mission.toLowerCase()) * 1;

		}

		if (points > 0) {
			if (pointsMap[points]) {
				pointsMap[points] = pointsMap[points].concat(i);
			}
			else {
				pointsMap[points] = [i];
			}
		}
	}
	return pointsMap;
}

function addSubstringFilter(filterText) {
	var sessionObject = getSessionObject();
	sessionObject["searchStrings"].push(filterText);
	setSessionObject(sessionObject);
}

function removeSubstringFilter(element) {
	var sessionObject = getSessionObject();
	var currentSearchStrings = sessionObject["searchStrings"];
	var filterValue = $(element).siblings(".filter-substring-text")[0].innerHTML;

	currentSearchStrings = currentSearchStrings.filter(function(e) { return e !== filterValue });

	sessionObject["searchStrings"] = currentSearchStrings;
	setSessionObject(sessionObject);

	updateSearch();
}

function onSearchClick() {
	// add the current searchbar contents to the filter list
	var searchbar = $("#searchBar").val();
	addSubstringFilter(searchbar);
	updateSearch();
}

function updateSearch() {
	var charityDetails = getCharityDetails();
	var pointsMap = getPointsMap(charityDetails);

	var search_results = $("#search-results");
	search_results.empty();

	var keys = Object.keys(pointsMap);
	keys.sort(function (a, b) {return b-a;});
	/*
	var none_found_msg = document.createElement('div')
	var text_msg = document.createTextNode('No results found')
	none_found_msg.append(text_msg)
	none_found_msg.style.display = 'none'
	search_results.append(none_found_msg)*/

	var result_indeces = keys.map(function (i) {return pointsMap[i];});
	/*if (result_indeces.length == 0 && getSessionObject['searchStrings'].length != 0){
		document.getElementById('none_found').style.display = 'block'
	}else{
		document.getElementById('none_found').style.display = 'hidden'
	}
	*/
	// flatten the results.
	result_indeces = [].concat.apply([], result_indeces);

	var start = checkGETfor('start') || 0;
	var end = +start + 10; // the limit is ten per page

	for (var i = start; i < result_indeces.length && i < end; i++) {
		search_results.append(
			'
 \

'
					+ charityDetails[result_indeces[i]].name +
				'
\

'
					+ wordLimit(charityDetails[result_indeces[i]].mission, 18) + '... (see more)
\

'
					+ charityDetails[result_indeces[i]].mission + '  Learn More...
\

\

\
						Rating:	 \
						' + buildRating(charityDetails[result_indeces[i]].rating) + '	\
						Headquarters:	 \
						Seattle, Washington	\
						Cause:	 \
						'
						+ charityDetails[result_indeces[i]].cause + '	\

\

\
						Org. Type:	 \
						Private Foundation	\
						Regions of Operation:	 \
						Worldwide	\
						Charitable Commitment:	\
						$2.19B	\

\
						Founded:	\
						Jan 1, 1997	\

\

\

'
		)
	}

	// add links to other pages of results
	var pagination = $('

');
	for (var i = 0; i*10 < result_indeces.length; i++) {
		var extraclass = "";
		if (start == i*10) {
			extraclass = " results-page-link-active";
		}
		pagination.append('
  '+(i+1)+'
');
	}
	search_results.append(pagination);
}

function loadDetailsPage(pageIndex) {
	var q = getSessionObject();
	q.detailsCharity = pageIndex;
	setSessionObject(q);

	window.location.href = 'details.html';
}

function toggleDetailsTable(detailsP) {
	var relevantObjects = $(detailsP).siblings().add($(detailsP));
	relevantObjects.filter(".details-table-visible").removeClass("details-table-visible").addClass("details-table-temp");
	relevantObjects.filter(".details-table-hidden").removeClass("details-table-hidden").addClass("details-table-visible");
	relevantObjects.filter(".details-table-temp").removeClass("details-table-temp").addClass("details-table-hidden");
}

function checkGETfor(name){
    var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
    if (results==null){
       return null;
    }
    else{
       return results[1] || 0;
    }
}

function checkGETforQuery() {
	var query = checkGETfor("q");
	if (query) {
		$("#searchBar").val(query);
		//TODO: update this lol
		updateSearch();
	}
}

function toggleFilter(element, isChecked, filterType, filterValue) {
	var sessionObject = getSessionObject();
	var currentFilterList = sessionObject["searchFilters"][filterType];
	// if it's checked, add the filter to the current filter list
	if (isChecked) {
		if (currentFilterList) {
			currentFilterList.push(filterValue);
		} else {
			currentFilterList = [filterValue];
		}
		sessionObject["searchFilters"][filterType] = currentFilterList;
	}
	// if it's unchecked, remove the filter from the filter list
	else {
		currentFilterList = currentFilterList.filter(function(e) { return e !== filterValue });
		// and test to see if the filter list should be removed entirely.
		if (currentFilterList.length > 0) {
			sessionObject["searchFilters"][filterType] = currentFilterList;
		} else {
			delete sessionObject["searchFilters"][filterType];
		}
	}

	// if it's a category, hide / show the causes
	if (filterType === "category") {
		var categoryDiv = $(element).parent();
		if (isChecked) {
			categoryDiv.children(".filter-cause-hidden").addClass("filter-cause-visible").removeClass("filter-cause-hidden");
		} else {
			categoryDiv.children(".filter-cause-visible").removeClass("filter-cause-visible").addClass("filter-cause-hidden");
		}
	}
	setSessionObject(sessionObject);
	// trigger another onSearchClick
	updateSearch();
}

function onStarClick(el, val) {
	// set the rating filter
	var sessionObject = getSessionObject();
	var ratingFilter = sessionObject.searchFilters["rating"];
	if (ratingFilter === val) {
		delete sessionObject.searchFilters["rating"];
		val = undefined;
	} else {
		sessionObject.searchFilters["rating"] = val;
	}
	setSessionObject(sessionObject);

	// update the images
	val = val || "0";
	for (var i = 1; i <= 5; i++) {
		var img_src = 'imgs/star_empty.png';
		if (+val >= i) {
			img_src = 'imgs/star_fill.png';
		}
		$(el).siblings().add(el).filter(".filter-rating-star-" + i).attr('src', img_src);
	}

	updateSearch();
}

function buildRating(val) {
	var htmlBuilder = "";
	for (var i = 1; i <= 5; i++) {
		var img_src = "imgs/star_empty.png";
		if (val >= i) {
			img_src = "imgs/star_fill.png";
		}
		htmlBuilder += "";
	}
	return htmlBuilder;
}

function loadSidebar() {
	// inside #scopes, #category,
	// ignore #types, #organization for the moment.

	var allCategoriesDiv = $("#category");
	// for each cause: [#category]
	var currentCategory = "";
	var categoryDiv = null;
	for (i in allCauses) {
		// if it's a new category, make a new big div and checkbox
		if (allCauses[i][1] !== currentCategory) {
			// make a new big div and checkbox
			currentCategory = allCauses[i][1];
			categoryDiv = $('
 \
	            				<input type="checkbox" onchange="toggleFilter(this, this.checked, \'category\',\'' + currentCategory + '\')">\

' + currentCategory + '
\

(--)
\

');
			allCategoriesDiv.append(categoryDiv);
		}
		// make a checkbox for the cause
		categoryDiv.append('
 \
	            				<input type="checkbox" onchange="toggleFilter(this, this.checked, \'cause\',\'' + allCauses[i][0] + '\')">\

' + allCauses[i][0] + '
\

(--)
\

')
	}
	// for each scope: [#scopes]
	// make a checkbox for the scope
	var scopesDiv = $("#scopes");
	for (i in allScopes) {
		scopesDiv.append('
 \
	            				<input type="checkbox" onchange="toggleFilter(this, this.checked, \'Scope of Impact\',\'' + allScopes[i] + '\')">\

' + allScopes[i] + '
\

(--)
\

')

	}

	// for each active filter:
	var sessionObject = getSessionObject();
	var searchFilters = sessionObject["searchFilters"];
	for (i in searchFilters) {
		for (j in searchFilters[i]) {
			var el = $("#" + escapeSpaces(searchFilters[i][j])).siblings("input")[0];
		    el.checked = true;
		    el.onchange();
		}
	}
}
<|endoftext|>