code
stringlengths
2
1.05M
repo_name
stringlengths
5
114
path
stringlengths
4
991
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
var debug = require('debug')('zuul'); var open = require('opener'); var Batch = require('batch'); var EventEmitter = require('events').EventEmitter; var control_app = require('./control-app'); var frameworks = require('../frameworks'); var setup_test_instance = require('./setup'); var SauceBrowser = require('./SauceBrowser'); var PhantomBrowser = require('./PhantomBrowser'); module.exports = Zuul; function Zuul(config) { if (!(this instanceof Zuul)) { return new Zuul(config); } var self = this; var ui = config.ui; var framework_dir = frameworks[ui]; if (!framework_dir) { throw new Error('unsupported ui: ' + ui); } config.framework_dir = framework_dir; self._config = config; // list of browsers to test self._browsers = []; self._concurrency = config.concurrency || 3; } Zuul.prototype.__proto__ = EventEmitter.prototype; Zuul.prototype._setup = function(cb) { var self = this; var config = self._config; // we only need one control app var control_server = control_app(config).listen(0, function() { debug('control server active on port %d', control_server.address().port); cb(null, control_server.address().port); }); }; Zuul.prototype.browser = function(info) { var self = this; var config = self._config; self._browsers.push(SauceBrowser({ name: config.name, build: process.env.TRAVIS_BUILD_NUMBER, firefox_profile: info.firefox_profile, username: config.username, key: config.key, browser: info.name, version: info.version, platform: info.platform, capabilities: config.capabilities }, config)); }; Zuul.prototype.run = function(done) { var self = this; var config = self._config; self._setup(function(err, control_port) { config.control_port = control_port; if (config.local) { setup_test_instance(config, function(err, url) { if (err) { console.error(err.stack); process.exit(1); return; } if (config.open) { open(url); } else { console.log('open the following url in a browser:'); console.log(url); } }); return; } // TODO love and care if (config.phantom) { var phantom = PhantomBrowser(config); self.emit('browser', phantom); phantom.once('done', function(results) { done(results.failed === 0 && results.passed > 0); }); return phantom.start(); } var batch = new Batch(); batch.concurrency(self._concurrency); var passed = true; self._browsers.forEach(function(browser) { self.emit('browser', browser); var retry = 3; browser.on('error', function(err) { if (--retry >= 0) { debug('browser error (%s), restarting', err.message) self.emit('restart', browser); return browser.start(); } self.emit('error', err); }); batch.push(function(done) { browser.once('done', function(results) { // if no tests passed, then this is also a problem // indicates potential error to even run tests if (results.failed || results.passed === 0) { passed = false; } done(); }); browser.start(); }); }); batch.end(function(err) { debug('batch done'); done(err || passed); }); }); };
wenjoy/homePage
node_modules/node-captcha/node_modules/canvas/node_modules/mocha/node_modules/should/node_modules/zuul/lib/zuul.js
JavaScript
mit
3,918
var ImageDialog = { preInit : function() { var url; tinyMCEPopup.requireLangPack(); if (url = tinyMCEPopup.getParam("external_image_list_url")) document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>'); }, init : function(ed) { var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'); tinyMCEPopup.resizeToInnerSize(); this.fillClassList('class_list'); this.fillFileList('src_list', fl); this.fillFileList('over_list', fl); this.fillFileList('out_list', fl); TinyMCE_EditableSelects.init(); if (n.nodeName == 'IMG') { nl.src.value = dom.getAttrib(n, 'src'); nl.width.value = dom.getAttrib(n, 'width'); nl.height.value = dom.getAttrib(n, 'height'); nl.alt.value = dom.getAttrib(n, 'alt'); nl.title.value = dom.getAttrib(n, 'title'); nl.vspace.value = this.getAttrib(n, 'vspace'); nl.hspace.value = this.getAttrib(n, 'hspace'); nl.border.value = this.getAttrib(n, 'border'); selectByValue(f, 'align', this.getAttrib(n, 'align')); selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); nl.style.value = dom.getAttrib(n, 'style'); nl.id.value = dom.getAttrib(n, 'id'); nl.dir.value = dom.getAttrib(n, 'dir'); nl.lang.value = dom.getAttrib(n, 'lang'); nl.usemap.value = dom.getAttrib(n, 'usemap'); nl.longdesc.value = dom.getAttrib(n, 'longdesc'); nl.insert.value = ed.getLang('update'); if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); if (ed.settings.inline_styles) { // Move attribs to styles if (dom.getAttrib(n, 'align')) this.updateStyle('align'); if (dom.getAttrib(n, 'hlspace')) this.updateStyle('hlspace'); if (dom.getAttrib(n, 'hrspace')) this.updateStyle('hrspace'); if (dom.getAttrib(n, 'border')) this.updateStyle('border'); if (dom.getAttrib(n, 'vtspace')) this.updateStyle('vtspace'); if (dom.getAttrib(n, 'vbspace')) this.updateStyle('vbspace'); } } // Setup browse button document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); if (isVisible('srcbrowser')) document.getElementById('src').style.width = '260px'; // Setup browse button document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); if (isVisible('overbrowser')) document.getElementById('onmouseoversrc').style.width = '260px'; // Setup browse button document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); if (isVisible('outbrowser')) document.getElementById('onmouseoutsrc').style.width = '260px'; // If option enabled default contrain proportions to checked if (ed.getParam("advimage_constrain_proportions", true)) f.constrain.checked = true; // Check swap image if valid data if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) this.setSwapImage(true); else this.setSwapImage(false); this.changeAppearance(); this.showPreviewImage(nl.src.value, 1); }, insert : function(file, title) { var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; if (f.src.value === '') { if (ed.selection.getNode().nodeName == 'IMG') { ed.dom.remove(ed.selection.getNode()); ed.execCommand('mceRepaint'); } tinyMCEPopup.close(); return; } if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { if (!f.alt.value) { tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { if (s) t.insertAndClose(); }); return; } } t.insertAndClose(); }, insertAndClose : function() { var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; tinyMCEPopup.restoreSelection(); // Fixes crash in Safari if (tinymce.isWebKit) ed.getWin().focus(); if (!ed.settings.inline_styles) { args = { vspace : nl.vspace.value, hspace : nl.hspace.value, border : nl.border.value, align : getSelectValue(f, 'align') }; } else { // Remove deprecated values args = { vspace : '', hspace : '', border : '', align : '' }; } tinymce.extend(args, { src : nl.src.value.replace(/ /g, '%20'), width : nl.width.value, height : nl.height.value, alt : nl.alt.value, title : nl.title.value, 'class' : getSelectValue(f, 'class_list'), style : nl.style.value, id : nl.id.value, dir : nl.dir.value, lang : nl.lang.value, usemap : nl.usemap.value, longdesc : nl.longdesc.value }); args.onmouseover = args.onmouseout = ''; if (f.onmousemovecheck.checked) { if (nl.onmouseoversrc.value) args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; if (nl.onmouseoutsrc.value) args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; } el = ed.selection.getNode(); if (el && el.nodeName == 'IMG') { ed.dom.setAttribs(el, args); } else { tinymce.each(args, function(value, name) { if (value === "") { delete args[name]; } }); ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); ed.undoManager.add(); } tinyMCEPopup.editor.execCommand('mceRepaint'); tinyMCEPopup.editor.focus(); tinyMCEPopup.close(); }, getAttrib : function(e, at) { var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; if (ed.settings.inline_styles) { switch (at) { case 'align': if (v = dom.getStyle(e, 'float')) return v; if (v = dom.getStyle(e, 'vertical-align')) return v; break; case 'hspace': v = dom.getStyle(e, 'margin-left') v2 = dom.getStyle(e, 'margin-right'); if (v && v == v2) return parseInt(v.replace(/[^0-9]/g, '')); break; case 'vspace': v = dom.getStyle(e, 'margin-top') v2 = dom.getStyle(e, 'margin-bottom'); if (v && v == v2) return parseInt(v.replace(/[^0-9]/g, '')); break; case 'border': v = 0; tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { sv = dom.getStyle(e, 'border-' + sv + '-width'); // False or not the same as prev if (!sv || (sv != v && v !== 0)) { v = 0; return false; } if (sv) v = sv; }); if (v) return parseInt(v.replace(/[^0-9]/g, '')); break; } } if (v = dom.getAttrib(e, at)) return v; return ''; }, setSwapImage : function(st) { var f = document.forms[0]; f.onmousemovecheck.checked = st; setBrowserDisabled('overbrowser', !st); setBrowserDisabled('outbrowser', !st); if (f.over_list) f.over_list.disabled = !st; if (f.out_list) f.out_list.disabled = !st; f.onmouseoversrc.disabled = !st; f.onmouseoutsrc.disabled = !st; }, fillClassList : function(id) { var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { cl = []; tinymce.each(v.split(';'), function(v) { var p = v.split('='); cl.push({'title' : p[0], 'class' : p[1]}); }); } else cl = tinyMCEPopup.editor.dom.getClasses(); if (cl.length > 0) { lst.options.length = 0; lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); tinymce.each(cl, function(o) { lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); }); } else dom.remove(dom.getParent(id, 'tr')); }, fillFileList : function(id, l) { var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; l = typeof(l) === 'function' ? l() : window[l]; lst.options.length = 0; if (l && l.length > 0) { lst.options[lst.options.length] = new Option('', ''); tinymce.each(l, function(o) { lst.options[lst.options.length] = new Option(o[0], o[1]); }); } else dom.remove(dom.getParent(id, 'tr')); }, resetImageData : function() { var f = document.forms[0]; f.elements.width.value = f.elements.height.value = ''; }, updateImageData : function(img, st) { var f = document.forms[0]; if (!st) { f.elements.width.value = img.width; f.elements.height.value = img.height; } this.preloadImg = img; }, changeAppearance : function() { var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); if (img) { if (ed.getParam('inline_styles')) { ed.dom.setAttrib(img, 'style', f.style.value); } else { img.align = f.align.value; img.border = f.border.value; img.hspace = f.hspace.value; img.vspace = f.vspace.value; } } }, changeHeight : function() { var f = document.forms[0], tp, t = this; if (!f.constrain.checked || !t.preloadImg) { return; } if (f.width.value == "" || f.height.value == "") return; tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; f.height.value = tp.toFixed(0); }, changeWidth : function() { var f = document.forms[0], tp, t = this; if (!f.constrain.checked || !t.preloadImg) { return; } if (f.width.value == "" || f.height.value == "") return; tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; f.width.value = tp.toFixed(0); }, updateStyle : function(ty) { var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); if (tinyMCEPopup.editor.settings.inline_styles) { // Handle align if (ty == 'align') { dom.setStyle(img, 'float', ''); dom.setStyle(img, 'vertical-align', ''); v = getSelectValue(f, 'align'); if (v) { if (v == 'left' || v == 'right') dom.setStyle(img, 'float', v); else img.style.verticalAlign = v; } } // Handle border if (ty == 'border') { b = img.style.border ? img.style.border.split(' ') : []; bStyle = dom.getStyle(img, 'border-style'); bColor = dom.getStyle(img, 'border-color'); dom.setStyle(img, 'border', ''); v = f.border.value; if (v || v == '0') { if (v == '0') img.style.border = isIE ? '0' : '0 none none'; else { if (b.length == 3 && b[isIE ? 2 : 1]) bStyle = b[isIE ? 2 : 1]; else if (!bStyle || bStyle == 'none') bStyle = 'solid'; if (b.length == 3 && b[isIE ? 0 : 2]) bColor = b[isIE ? 0 : 2]; else if (!bColor || bColor == 'none') bColor = 'black'; img.style.border = v + 'px ' + bStyle + ' ' + bColor; } } } // Handle hspace if (ty == 'hlspace') { dom.setStyle(img, 'marginLeft', ''); v = f.hlspace.value; if (v) { img.style.marginLeft = v + 'px'; } } // Handle hspace if (ty == 'hrspace') { dom.setStyle(img, 'marginRight', ''); v = f.hrspace.value; if (v) { img.style.marginRight = v + 'px'; } } // Handle vspace if (ty == 'vtspace') { dom.setStyle(img, 'marginTop', ''); v = f.vtspace.value; if (v) { img.style.marginTop = v + 'px'; } } if (ty == 'vbspace') { dom.setStyle(img, 'marginBottom', ''); v = f.vbspace.value; if (v) { img.style.marginBottom = v + 'px'; } } // Merge dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img'); } }, changeMouseMove : function() { }, showPreviewImage : function(u, st) { if (!u) { tinyMCEPopup.dom.setHTML('prev', ''); return; } if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) this.resetImageData(); u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); if (!st) tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />'); else tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />'); } }; ImageDialog.preInit(); tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
irony-rust/nickel-cms
static/themes/admin/components/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js
JavaScript
mit
13,170
version https://git-lfs.github.com/spec/v1 oid sha256:2c3adeeb6c0341f0567979d93b5aceef7ac52df657743c63d840e686dd82e9cd size 24839
yogeshsaroya/new-cdnjs
ajax/libs/yui/3.15.0/model-sync-rest/model-sync-rest.js
JavaScript
mit
130
Package.describe({ name: 'violet:test-support', version: '0.1.0', summary: 'libraries and helpers that are used to run tests', documentation: 'README.md' }); Package.onUse(function(api) { api.versionsFrom('1.1.0.2'); var packages =[ 'mike:[email protected]', 'practicalmeteor:[email protected]_2', 'violet:[email protected]' ]; api.use(packages); api.imply(packages); api.addFiles([ 'helpers.js' ]); api.export('expect'); api.export('testHelpers'); });
violetjs/violet
packages/test-support/package.js
JavaScript
mit
490
$(document).ready(function() { $('rulang').click(function() { alert( "Handler for .click() called." ); }); $('enlang').click(function() { alert( "Handler for .click() called." ); }); $('pllang').click(function() { alert( "Handler for .click() called." ); }); });
4johndoe/sh
tmpl/js/my.js
JavaScript
mit
278
(function () { var ns = Y.namespace("a11ychecker"), testName = "link-button-test", re = /(^#$)|(^javascript:)/i; function findLinkButtons() { Y.all("a").each(function (link) { var href = link.get('href'); if ((!href || (href && href.search(re) === 0)) && (!link.get('role'))) { ns.logError(testName, link, "Link used to create a button. Consider adding ARIA role of \"button\" or switch to button element.", "warn"); } }); } findLinkButtons.testName = testName; ns.findLinkButtons = findLinkButtons; }());
inikoo/fact
libs/yui/yui3-gallery/src/gallery-a11ychecker-base/js/link-button-checker.js
JavaScript
mit
573
//Dependencies import React, {PropTypes, PureComponent} from 'react'; import {getConfig} from '../config'; function translateDate(date) { const {translateDate} = getConfig(); return translateDate(date); } class Notification extends PureComponent { constructor(props) { super(props); this.handleOnRead = this.handleOnRead.bind(this); } handleOnRead(event){ const {onRead, uuid} = this.props; event.preventDefault(); event.stopPropagation(); onRead(uuid); } render() { const {creationDate, content, hasDate, icon, onClick, onRead, uuid, sender, targetUrl, title, type} = this.props; return ( <li data-focus='notification' data-type={type} onClick={()=>{ onClick({targetUrl})}}> {icon && <div data-focus='notification-icon'><img src={icon}/></div>} <div data-focus='notification-body' > <h4 data-focus='notification-title'>{title}</h4> <div data-focus='notification-content'>{content}</div> </div> {hasDate && <div data-focus='notification-date'> <button className='mdl-button mdl-js-button mdl-button--icon' onClick={this.handleOnRead}> <i className='material-icons'>done</i> </button> <div>{translateDate(creationDate)}</div> </div> } </li> ); }; } Notification.displayName = 'Notification'; Notification.propTypes = { hasDate: PropTypes.bool, uuid: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired, title: PropTypes.string.isRequired, content: PropTypes.string.isRequired, creationDate: PropTypes.string.isRequired, type: PropTypes.string.isRequired, sender: PropTypes.string.isRequired, targetUrl: PropTypes.string.isRequired, icon: PropTypes.string.isRequired, onRead: PropTypes.func.isRequired, onClick: PropTypes.func.isRequired }; Notification.defaultProps = { hasDate: true } export default Notification;
KleeGroup/focus-notifications
src/component/notification.js
JavaScript
mit
2,185
var levelsState = { create: function(){ game.add.image(0,0,'back2'); game.world.setBounds(1,1, 1500, 500);//-1000,-10000 cursors = game.input.keyboard.createCursorKeys(); //player this.player = game.add.sprite(game.width/8, game.height/2, 'player'); this.player.anchor.setTo(0.5, 0.5); game.physics.arcade.enable(this.player); this.player.body.gravity.y = 500; //player control this.cursor = game.input.keyboard.createCursorKeys(); //walls this.walls = game.add.group(); this.walls.enableBody = true; this.wal = game.add.group(); this.wal.enableBody = true; // // // this.music = game.add.audio('bgSong'); this.music.loop = true; this.music.play(); // //timeeeeeeeeeeeeeee var me = this; me.startTime = new Date(); me.totalTime = 120; me.timeElapsed = 0; me.createTimer(); me.gameTimer = game.time.events.loop(100, function(){ me.updateTimer(); }); // var middleBotto = game.add.sprite(290, 140, 'wallH', 0, this.wal); middleBotto.scale.setTo(2, 1); // game.add.sprite(0, 0, 'wallV', 0, this.walls); // game.add.sprite(480, 0, 'wallV', 0, this.walls); // game.add.sprite(0, 0, 'wallH', 0, this.walls); // game.add.sprite(300,0, 'wallH', 0, this.walls); // game.add.sprite(0,320, 'wallH', 0, this.walls); // game.add.sprite(300,320, 'wallH', 0, this.walls); // game.add.sprite(-100,160, 'wallH',0, this.walls); // game.add.sprite(400,160, 'wallH',0, this.walls); var middleTop = game.add.sprite(100, 80, 'wallH', 0, this.walls); middleTop.scale.setTo(1.5, 1); var middleBottom = game.add.sprite(10, 340, 'wallH', 0, this.walls); middleBottom.scale.setTo(1, 1); //2 var middletwo = game.add.sprite(90, 140, 'wallH', 0, this.walls); middleBottom.scale.setTo(1, 1); //3 var middlethree = game.add.sprite(50, 240, 'wallH', 0, this.walls); middleBottom.scale.setTo(1, 1); //4 var middlefour = game.add.sprite(250, 240, 'wallH', 0, this.walls); middleBottom.scale.setTo(1, 1); //5 var middlefive = game.add.sprite(400, 240, 'wallH', 0, this.walls); middleBottom.scale.setTo(1, 1); //6 var middlesix = game.add.sprite(650, 240, 'wallH', 0, this.walls); middleBottom.scale.setTo(1, 1); //7 var middleseven = game.add.sprite(750, 240, 'wallH', 0, this.walls); middleBottom.scale.setTo(1, 1); //8 var middleeight = game.add.sprite(1050, 240, 'wallH', 0, this.walls); middleBottom.scale.setTo(1, 1); //9 var middlenine = game.add.sprite(1350, 240, 'wallH', 0, this.walls); middleBottom.scale.setTo(1, 1); //10 var middleten = game.add.sprite(1750, 240, 'wallH', 0, this.walls); middleBottom.scale.setTo(1, 1); //11 var middleeleven = game.add.sprite(1950, 240, 'wallH', 0, this.walls); middleBottom.scale.setTo(1, 1); //12 var middletwelve = game.add.sprite(2250, 240, 'wallH', 0, this.walls); middleBottom.scale.setTo(1, 1); //13 var middlethirten = game.add.sprite(2550, 240, 'wallH', 0, this.walls); middleBottom.scale.setTo(1, 1); //14 var middlefourten = game.add.sprite(2850, 240, 'wallH', 0, this.walls); middleBottom.scale.setTo(1, 1); //15 var middlefiften = game.add.sprite(3050, 240, 'wallH', 0, this.walls); middleBottom.scale.setTo(1, 1); this.wal.setAll('body.movable', true); this.walls.setAll('body.movable', true); //coin this.coin = game.add.sprite(100, 140, 'coin'); game.physics.arcade.enable(this.coin); this.coin.anchor.setTo(0.5, 0.5); this.goal = game.add.sprite(1450, 200, 'goal'); game.physics.arcade.enable(this.goal); this.goal.anchor.setTo(0.5, 0.5); this.slimes = game.add.group(); this.slimes.enableBody = true; //create 10 enemies this.slimes.createMultiple(30, 'slime'); //call add enemy every 2.2 second this.time.events.loop(2200, this.addSlimeFromBottom, this); this.scoreLabel = game.add.text(30, 30, 'score: 0', {font: '18px Arial', fill: '#ffffff'}); this.scoreLabel.fixedToCamera = true; game.global.score = 0; //create enemy group this.enemies = game.add.group(); this.enemies.enableBody = true; //create 10 enemies this.enemies.createMultiple(20, 'enemy'); //call add enemy every 2.2 second //this.time.events.loop(2200, this.addEnemyFromTop, this); this.time.events.loop(2200, this.addEnemyFromBottom, this); //sound this.jumpSound = game.add.audio('jump'); this.coinSound = game.add.audio('coin'); this.deadSound = game.add.audio('dead'); this.winSound = game.add.audio('win'); //animation this.player.animations.add('right',[5, 6, 7, 8], 10,true); //left anim this.player.animations.add('left',[0, 1, 2, 3], 10,true); this.emitter = game.add.emitter(0,0,15); this.emitter.makeParticles('pixel'); this.emitter.setYSpeed(-150,150); this.emitter.setXSpeed(-150,150); this.emitter.gravity=0; }, update: function(){ if (cursors.left.isDown) { game.camera.x -= 2; } else if (cursors.right.isDown) { game.camera.x += 2; } //player game.physics.arcade.collide(this.player, this.walls); this.movePlayer(); if (!this.player.inWorld){ this.playerDie(); } //coin game.physics.arcade.overlap(this.player, this.coin, this.takeCoin, null, this); game.physics.arcade.overlap(this.player, this.goal, this.win, null, this); game.physics.arcade.collide(this.slimes, this.walls); game.physics.arcade.overlap(this.player, this.slimes, this.playerDie, null, this); //enemies game.physics.arcade.collide(this.enemies, this.walls); game.physics.arcade.overlap(this.player, this.enemies, this.playerDie, null, this); if(!this.player.alive){ return; } }, movePlayer: function(){ if (this.cursor.left.isDown){ this.player.body.velocity.x = -200; this.player.animations.play('left'); } else if (this.cursor.right.isDown){ this.player.body.velocity.x = 200; this.player.animations.play('right'); } else { this.player.body.velocity.x = 0; this.player.animations.stop();//stop anim this.player.frame=0;//stand still } if (this.cursor.up.isDown && this.player.body.touching.down){ this.jumpSound.play(); this.player.body.velocity.y = -320; } } , startMenu: function(){ game.state.start('play'); }, playerDie: function(){ this.music.stop(); this.player.kill(); this.deadSound.play(); this.emitter.x=this.player.x; this.emitter.y=this.player.y; this.emitter.start(true,800,null,15); game.time.events.add(1000,this.startMenu,this); game.camera.shake(0.02,300); }, updateCoinPosition: function(){ var coinPosition = [ {x: 140, y: 180}, {x: 260, y: 180}, {x: 440, y: 140}, {x: 640, y: 140}, // {x: 130, y: 140}, {x: 170, y: 130}, ]; for (var i = 0; i < coinPosition.length; i++){ if(coinPosition[i].x ==this.coin.x) { coinPosition.splice(i, 1); } } var newPosition = game.rnd.pick(coinPosition); this.coin.reset(newPosition.x, newPosition.y); }, takeCoin: function(player, coin){ // this.coin.kill(); this.coin.scale.setTo(0,0); game.add.tween(this.coin.scale).to({x:1,y:1},1000).start(); game.add.tween(this.player.scale).to({x:1.3,y:1.3},100).yoyo(true).start(); game.global.score += 5; this.scoreLabel.text = 'score: ' + game.global.score; this.updateCoinPosition(); this.coinSound.play(); }, win: function(player, goal){ // this.coin.kill(); this.goal.scale.setTo(0,0); game.add.tween(this.goal.scale).to({x:1,y:1},1000).start(); game.add.tween(this.player.scale).to({x:1.3,y:1.3},100).yoyo(true).start(); game.global.score += 5; this.scoreLabel.text = 'score: ' + game.global.score; this.home(); this.music.stop(); //this.winSound.play(); }, home: function(){ game.state.start('home'); }, addSlimeFromBottom: function() { var slimeb = this.slimes.getFirstDead(); if (!slimeb) { return; } //initialize an enemy slimeb.anchor.setTo(0.5, 1); slimeb.reset(game.width/2,1); slimeb.body.gravity.y = 500; slimeb.body.velocity.x = 100 * game.rnd.pick([-1, 1]); slimeb.body.bounce.x = 1; slimeb.checkWorldBounds = true; slimeb.outOfBoundsKill = true; }, //add enemy function // addEnemyFromTop: function() { // //get 1st dead enemy of group // var enemy = this.enemies.getFirstDead(); // //do nothing if no enemy // if (!enemy) { // return; // } // //initialize an enemy // //set anchor to center bottom // enemy.anchor.setTo(0.5, 1); // enemy.reset(game.width/2, 0); // //add gravity // enemy.body.gravity.y = 500; // enemy.body.velocity.x = 100 * game.rnd.pick([-1, 1]); // enemy.body.bounce.x = 1; // enemy.checkWorldBounds = true; // enemy.outOfBoundsKill = true; // }, addEnemyFromBottom: function() { var enemyb = this.enemies.getFirstDead(); if (!enemyb) { return; } //initialize an enemy enemyb.anchor.setTo(0.5, 1); //add enemy from bottom enemyb.reset(game.width/2,game.height); //add gravity enemyb.body.gravity.y = -500; enemyb.body.velocity.x = 100 * game.rnd.pick([-1, 1]); enemyb.body.bounce.x = 1; enemyb.checkWorldBounds = true; enemyb.outOfBoundsKill = true; }, createTimer: function(){ var me = this; me.timeLabel = me.game.add.text(60, 60, "00:00", {font: "18px Arial", fill: "#ffffff"}); me.timeLabel.anchor.setTo(0.5, 0); //me.timeLabel.align = 'center'; this.timeLabel.fixedToCamera = true; }, updateTimer: function(){ var me = this; var currentTime = new Date(); var timeDifference = me.startTime.getTime() - currentTime.getTime(); //Time elapsed in seconds me.timeElapsed = Math.abs(timeDifference / 1000); //Time remaining in seconds // var timeRemaining = me.totalTime - me.timeElapsed; var timeRemaining = me.timeElapsed; var minutes = Math.floor(me.timeElapsed / 60); var seconds = Math.floor(me.timeElapsed) - (60 * minutes); //Convert seconds into minutes and seconds var minutes = Math.floor(timeRemaining / 60); var seconds = Math.floor(timeRemaining) - (60 * minutes); //Display minutes, add a 0 to the start if less than 10 var result = (minutes < 10) ? "0" + minutes : minutes; //Display seconds, add a 0 to the start if less than 10 result += (seconds < 10) ? ":0" + seconds : ":" + seconds; me.timeLabel.text = result; if(me.timeElapsed >= me.totalTime){ //Do what you need to do game.state.start('play'); this.music.stop(); } }, };
nickchulani99/ITE-445
final/alien/js/levels.js
JavaScript
mit
10,651
import Dispatcher from 'core/dispatcher.js'; import ActionTypes from 'const/actions.js'; import Action from 'core/action.js'; import { API } from 'lib/api.js'; let defaultAction = Action.create(function(argument) { API.prototype.formRawSubmit.apply(this, arguments); }) export default { shouldDefaultAction: defaultAction, shouldFormSubmit: defaultAction, goodAddToCart: Action.create(function(argument) { API.prototype.goodAddToCart(argument); }), shouldRemoveGood: API.prototype.goodRemoveFromCart, shouldRecountOrder: API.prototype.orderRecount, shouldReset: API.prototype.cartReset, shouldRefresh: API.prototype.cartRefresh, shouldAuth: Action.create(function() { API.prototype.userAuth.apply(this, arguments); }) }
proxyfabio/modx-shopmodx-frontend
src/actions/appViewActions.js
JavaScript
mit
779
/// //////////////////////////////////////// // GOOGLE BOOKS /// //////////////////////////////////////// console.log('google books connector loading...') /// //////////////////////////////////////// // GOOGLEBOOKS VARIABLES /// //////////////////////////////////////// var url = '' var key = '' /// //////////////////////////////////////// // Function: search /// //////////////////////////////////////// exports.search = function (query, callback) { }
LibrariesHacked/catalogues-librarydata
connectors/googlebooks.js
JavaScript
mit
457
'use strict'; var virtualbox = require('../../lib/virtualbox'), async = require('async'), args = process.argv.slice(2), vm = 'node-virtualbox-test-machine', key = args.length > 1 && args[1], delay = 250, sequence; var SCAN_CODES = virtualbox.SCAN_CODES; var fns = []; /** * * Uncomment the following if you want to * test a particular key down/up (make/break) * sequence. * **/ // SHIFT + A Sequence sequence = [ { key: 'SHIFT', type: 'make', code: SCAN_CODES['SHIFT'] }, { key: 'A', type: 'make', code: SCAN_CODES['A'] }, { key: 'SHIFT', type: 'break', code: SCAN_CODES.getBreakCode('SHIFT') }, { key: 'A', type: 'break', code: SCAN_CODES.getBreakCode('A') }, ]; function onResponse(err) { if (err) { throw err; } } function generateFunc(key, type, code) { return function (cb) { setTimeout(function () { console.info('Sending %s %s code', key, type); virtualbox.keyboardputscancode(vm, code, function (err) { onResponse(err); cb(); }); }, delay); }; } function addKeyFuncs(key) { var makeCode = SCAN_CODES[key]; var breakCode = SCAN_CODES.getBreakCode(key); if (makeCode && makeCode.length) { fns.push(generateFunc(key, 'make', makeCode)); if (breakCode && breakCode.length) { fns.push(generateFunc(key, 'break', breakCode)); } } } if (sequence) { fns = sequence.map(function (s) { return generateFunc(s.key, s.type, s.code); }); } else if (key) { addKeyFuncs(key); } else { for (var key in SCAN_CODES) { if (key === 'getBreakCode') { continue; } addKeyFuncs(key); } } async.series(fns, function () { console.info('Keyboard Put Scan Code Test Complete'); });
Node-Virtualization/node-virtualbox
test/integration/keyboardputscancode.js
JavaScript
mit
1,713
import React from 'react'; import { Alert } from 'react-bootstrap'; export const NotFound = () => ( <Alert bsStyle="danger"> <p><strong>Error [404]</strong>: { window.location.pathname } does not exist.</p> </Alert> );
irvinlim/free4all
imports/ui/pages/not-found.js
JavaScript
mit
228
(function () { 'use strict'; var module = angular.module('fim.base'); module.config(function($routeProvider) { $routeProvider .when('/activity/:engine/:section/:period', { templateUrl: 'partials/activity.html', controller: 'ActivityController' }); }); module.controller('ActivityController', function($scope, $location, $routeParams, nxt, $q, $sce, ActivityProvider, BlocksProvider, ForgersProvider, StatisticsProvider, AllAssetsProvider, BlockStateProvider, $timeout, dateParser, dateFilter, $rootScope) { $rootScope.paramEngine = $routeParams.engine; $scope.paramEngine = $routeParams.engine; $scope.paramSection = $routeParams.section; $scope.paramPeriod = $routeParams.period; $scope.paramTimestamp = 0; $scope.statistics = {}; $scope.blockstate = {}; $scope.filter = {}; if ($scope.paramEngine == 'nxt') { var api = nxt.nxt(); } else if ($scope.paramEngine == 'fim') { var api = nxt.fim(); } else { $location.path('/activity/fim/activity/latest'); return; } if (['activity', 'blockchain', 'forgers', 'assets'].indexOf($scope.paramSection) == -1) { $location.path('/activity/'+$scope.paramEngine+'/activity/latest'); return; } /* Date picker */ $scope.dt = null; $scope.format = 'dd-MMMM-yyyy'; if ($scope.paramPeriod != 'latest') { var d = dateParser.parse($scope.paramPeriod, $scope.format); if (!d) { $location.path('/activity/'+$scope.paramEngine+'/'+$scope.paramSection+'/latest'); return; } $scope.dt = $scope.paramPeriod; /* Timestamp is for 00:00 hour on selected day */ d = new Date(d.getFullYear(), d.getMonth(), d.getDate()+1, 0, 0, 0); $scope.paramTimestamp = nxt.util.convertToEpochTimestamp(d.getTime()); } $scope.symbol = api.engine.symbol; $scope.blockstate['TYPE_FIM'] = new BlockStateProvider(nxt.fim(), $scope); $scope.blockstate['TYPE_FIM'].load(); if ($rootScope.enableDualEngines) { $scope.blockstate['TYPE_NXT'] = new BlockStateProvider(nxt.nxt(), $scope); $scope.blockstate['TYPE_NXT'].load(); } switch ($scope.paramSection) { case 'activity': $scope.showFilter = true; $scope.showTransactionFilter = true; $scope.provider = new ActivityProvider(api, $scope, $scope.paramTimestamp, null, $scope.filter); $scope.provider.reload(); break; case 'blockchain': $scope.showFilter = true; $scope.provider = new BlocksProvider(api, $scope, $scope.paramTimestamp); $scope.provider.reload(); break; case 'forgers': $scope.showFilter = false; $scope.provider = new ForgersProvider(api, $scope); $scope.provider.reload(); break; case 'assets': $scope.showFilter = false; $scope.provider = new AllAssetsProvider(api, $scope, 10); $scope.provider.reload(); break; default: throw new Error('Not reached'); } $scope.minDate = new Date(Date.UTC(2013, 10, 24, 12, 0, 0, 0)); $scope.maxDate = new Date(); $scope.dateOptions = { formatYear: 'yy', startingDay: 1 }; $scope.openDatePicker = function($event) { $event.preventDefault(); $event.stopPropagation(); $scope.opened = true; }; var stopWatching = false; $scope.$watch('dt', function (newValue, oldValue) { if (newValue && newValue !== oldValue && typeof oldValue != 'string' && !stopWatching) { stopWatching = true; var formatted = dateFilter(newValue, $scope.format); $location.path('/activity/'+$scope.paramEngine+'/'+$scope.paramSection+'/'+formatted); } }); if ($scope.showTransactionFilter) { $scope.filter.all = true; $scope.filter.payments = true; $scope.filter.messages = true; $scope.filter.aliases = true; $scope.filter.namespacedAliases = true; $scope.filter.polls = true; $scope.filter.accountInfo = true; $scope.filter.announceHub = true; $scope.filter.goodsStore = true; $scope.filter.balanceLeasing = true; $scope.filter.trades = true; $scope.filter.assetIssued = true; $scope.filter.assetTransfer = true; $scope.filter.assetOrder = true; $scope.filter.currencyIssued = true; $scope.filter.currencyTransfer = true; $scope.filter.currencyOther = true; $scope.filterAllChanged = function () { $scope.$evalAsync(function () { var on = $scope.filter.all; $scope.filter.payments = on; $scope.filter.messages = on; $scope.filter.aliases = on; $scope.filter.namespacedAliases = on; $scope.filter.polls = on; $scope.filter.accountInfo = on; $scope.filter.announceHub = on; $scope.filter.goodsStore = on; $scope.filter.balanceLeasing = on; $scope.filter.trades = on; $scope.filter.assetIssued = on; $scope.filter.assetTransfer = on; $scope.filter.assetOrder = on; $scope.filter.currencyIssued = on; $scope.filter.currencyTransfer = on; $scope.filter.currencyOther = on; $scope.filterChanged(); }); } $scope.filterChanged = function () { $scope.provider.applyFilter($scope.filter); } } $scope.loadStatistics = function (engine, collapse_var) { $scope[collapse_var] = !$scope[collapse_var]; if (!$scope[collapse_var]) { if (!$scope.statistics[engine]) { var api = nxt.get(engine); $scope.statistics[engine] = new StatisticsProvider(api, $scope); } $scope.statistics[engine].load(); } } }); })();
aliasgherlakkadshaw/mofowallet-fork
app/scripts/controllers/activity.js
JavaScript
mit
5,627
(function($) { var cultures = $.cultures, en = cultures.en, standard = en.calendars.standard, culture = cultures["sr-Latn-BA"] = $.extend(true, {}, en, { name: "sr-Latn-BA", englishName: "Serbian (Latin, Bosnia and Herzegovina)", nativeName: "srpski (Bosna i Hercegovina)", language: "sr-Latn", numberFormat: { ',': ".", '.': ",", percent: { ',': ".", '.': "," }, currency: { pattern: ["-n $","n $"], ',': ".", '.': ",", symbol: "KM" } }, calendars: { standard: $.extend(true, {}, standard, { '/': ".", firstDay: 1, days: { names: ["nedelja","ponedeljak","utorak","sreda","četvrtak","petak","subota"], namesAbbr: ["ned","pon","uto","sre","čet","pet","sub"], namesShort: ["ne","po","ut","sr","če","pe","su"] }, months: { names: ["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar",""], namesAbbr: ["jan","feb","mar","apr","maj","jun","jul","avg","sep","okt","nov","dec",""] }, AM: null, PM: null, eras: [{"name":"n.e.","start":null,"offset":0}], patterns: { d: "d.M.yyyy", D: "d. MMMM yyyy", t: "H:mm", T: "H:mm:ss", f: "d. MMMM yyyy H:mm", F: "d. MMMM yyyy H:mm:ss", M: "d. MMMM", Y: "MMMM yyyy" } }) } }, cultures["sr-Latn-BA"]); culture.calendar = culture.calendars.standard; })(jQuery);
Leandro-b-03/SmartBracelet
public/library/javascripts/jquery.GlobalMoneyInput/globinfo/jQuery.glob.sr-Latn-BA.js
JavaScript
mit
1,973
'use strict'; var express = require('express') , router = express.Router(); import * as ctrl from './controller'; router.get('/contact', ctrl.contact); export default router;
calebgregory/portfolio
app/home/routes.js
JavaScript
mit
182
/* @flow */ import {Seat} from "../core/seat"; import {Bid, BidType, BidSuit} from "../core/bid"; import {Card} from "../core/card"; import {validateBid} from "./validators"; /** * Helper class for analysing board-state. */ export class BoardQuery { constructor(boardState) { this.boardState = boardState; } get hands() { return this.boardState.hands; } get dealer() { return this.boardState.dealer; } get bids() { return this.boardState.bids; } get cards() { return this.boardState.cards; } /** * Returns the last bid to be made of any type */ get lastBid(): Bid { return this.boardState.bids[this.boardState.bids.length - 1]; } /** * Returns the last bid to be made of type Bid.Call */ get lastCall(): Bid { return this.boardState.bids .reduce((lastCall, current) => { if (current.type === BidType.Call) return current; else return lastCall; }, undefined); } /** * Returns the player who made the lastCall */ get lastCaller(): Seat { let call = this.lastCall; if (call) return Seat.rotate(this.boardState.dealer, this.boardState.bids.indexOf(call)); } /** * Returns the last bid to be made which was not a no-bid */ get lastAction(): Bid { return this.boardState.bids .reduce((lastAction, current) => { if (current.type !== BidType.NoBid) return current; else return lastAction; }, undefined); } /** * Returns the seat whic made the lastAction */ get lastActor(): Seat { let act = this.lastAction; if (act) return Seat.rotate(this.boardState.dealer, this.boardState.bids.indexOf(act)); } /** * Returns the suit of the bid contract or undefined if the bidding has not ended * or no suit has been bid yet */ get trumpSuit(): BidSuit { if (this.biddingHasEnded && this.lastCall) return this.lastCall.suit; } /** * Returns true when no more bids can be made */ get biddingHasEnded(): boolean { return (this.bids.length >= 4) && !this.bids.slice(-3).some(bid => bid.type !== BidType.NoBid); } /** * Returns the current trick, which will be an array of the cards which have been * played to the trick, starting with the lead card. If no cards have been played * yet it returns an empty array. */ get currentTrick(): Array<Card> { let played = this.boardState.cards.length % 4; played = played || 4; return this.boardState.cards.slice(played * -1); } /* * Returns the winner of the previous trick */ get previousTrickWinner(): Seat { if (this.boardState.cards.length < 4) return undefined; let played = this.boardState.cards.length % 4; let trick = this.boardState.cards.slice(this.boardState.cards.length - played - 4, this.boardState.cards.length - played); let leadSuit = trick[0].card.suit; let winner = trick.sort((played1, played2) => { return Card.compare(played1.card, played2.card, this.trumpSuit, leadSuit); })[3].seat; return winner; } /* * Returns the number of tricks declarer has won */ get declarerTricks(): number { let trickCount = Math.floor(this.boardState.cards.length / 4); let result = 0; let sortTrick = (trick) => { let leadSuit = trick[0].card.suit; return trick.sort((played1, played2) => Card.compare(played1.card, played2.card, this.trumpSuit, leadSuit)); }; for (let i = 0; i < trickCount; i ++) { let trick = this.boardState.cards.slice(i * 4, (i * 4) + 4); let winner = sortTrick(trick)[3].seat; if ((winner === this.declarer) || Seat.isPartner(this.declarer, winner)) result ++; } return result; } /** * Returns true when no more cards can be played */ get playHasEnded(): boolean { return (this.boardState.cards.length === Seat.all().reduce((total, seat) => total + this.hands[seat].length, 0)); } /** * Returns true if this card has already been played */ hasBeenPlayed(card) { return this.boardState.cards .some((played) => Card.equals(card, played.card)); } /** * Returns the seat of the lead card */ get declarer(): Seat { if (!this.biddingHasEnded) throw new Error("the bidding has not ended yet"); if (this.lastCall) { for (let i = 0; i < this.boardState.bids.length - 1; i ++) { if (this.boardState.bids[i].suit === this.lastCall.suit) return Seat.rotate(this.boardState.dealer, i); } } throw new Error("declarer not found"); } get dummy(): Seat { return Seat.rotate(this.declarer, 2); } /** * Returns the seat of the lead card */ get leader(): Seat { if (this.boardState.cards.length < 4) return Seat.rotate(this.declarer, 1); else return this.previousTrickWinner; } /** * Returns the seat of the player who's turn it is to play */ get nextPlayer(): Seat { if (!this.biddingHasEnded) return Seat.rotate(this.boardState.dealer, this.boardState.bids.length); else if (!this.lastCall) return undefined; else return Seat.rotate(this.leader, this.currentTrick.length); } /* * Returns an array of the cards which can legally be played */ get legalCards() { let hand = this.boardState.hands[this.nextPlayer]; let available = hand.filter((card) => !this.hasBeenPlayed(card)); let trick = this.currentTrick; if ((trick.length > 0) && (trick.length < 4)) { let lead = trick[0].card; let followers = available.filter((card) => (card.suit === lead.suit)); if (followers.length > 0) return followers; } return available; } /* * Returns an array of the cards which can legally be played */ getLegalBids() { return Bid.all().filter((bid) => !validateBid(bid, this)); } /* * Converts the hands to their PBN string */ toPBN() { var result = Seat.toPBNString(this.dealer) + ':'; Seat.all().forEach((s, i) => { let seat = Seat.rotate(this.dealer, i); let cards = this.hands[seat] .filter(card => !this.hasBeenPlayed(card)); result = result + Card.toPBN(cards) + " "; }); return result.trim(); } }
frankwallis/redouble
src/model/game/board-query.js
JavaScript
mit
5,929
/* * Example - Run code contain within transactions * * * Execute it with `node index.js` */ var async = require('async') var VM = require('./../../index.js') var Account = require('ethereumjs-account') var Transaction = require('ethereumjs-tx') var Trie = require('merkle-patricia-tree') var rlp = require('rlp') var utils = require('ethereumjs-util') // creating a trie that just resides in memory var stateTrie = new Trie() // create a new VM instance var vm = new VM({state: stateTrie}) // import the key pair // pre-generated (saves time) // used to sign transactions and generate addresses var keyPair = require('./key-pair') var createdAddress // Transaction to initalize the name register, in this case // it will register the sending address as 'null_radix' // Notes: // - In a transaction, all strings as interpeted as hex // - A transaction has the fiels: // - nonce // - gasPrice // - gasLimit // - data var rawTx1 = require('./raw-tx1') // 2nd Transaction var rawTx2 = require('./raw-tx2') // sets up the initial state and runs the callback when complete function setup (cb) { // the address we are sending from var publicKeyBuf = new Buffer(keyPair.publicKey, 'hex') var address = utils.pubToAddress(publicKeyBuf, true) // create a new account var account = new Account() // give the account some wei. // Note: this needs to be a `Buffer` or a string. All // strings need to be in hex. account.balance = '0xf00000000000000001' // store in the trie stateTrie.put(address, account.serialize(), cb) } // runs a transaction through the vm function runTx (raw, cb) { // create a new transaction out of the json var tx = new Transaction(raw) // tx.from tx.sign(new Buffer(keyPair.secretKey, 'hex')) console.log('----running tx-------') // run the tx \o/ vm.runTx({ tx: tx }, function (err, results) { createdAddress = results.createdAddress // log some results console.log('gas used: ' + results.gasUsed.toString()) console.log('returned: ' + results.vm.return.toString('hex')) if (createdAddress) { console.log('address created: ' + createdAddress.toString('hex')) } cb(err) }) } var storageRoot // used later // Now lets look at what we created. The transaction // should have created a new account for the contranct // in the trie.Lets test to see if it did. function checkResults (cb) { // fetch the new account from the trie. stateTrie.get(createdAddress, function (err, val) { var account = new Account(val) storageRoot = account.stateRoot // used later! :) console.log('------results------') console.log('nonce: ' + account.nonce.toString('hex')) console.log('balance in wei: ' + account.balance.toString('hex')) console.log('stateRoot: ' + storageRoot.toString('hex')) console.log('codeHash:' + account.codeHash.toString('hex')) console.log('-------------------') cb(err) }) } // So if everything went right we should have "null_radix" // stored at "0x9bdf9e2cc4dfa83de3c35da792cdf9b9e9fcfabd". To // see this we need to print out the name register's // storage trie. // reads and prints the storage of a contract function readStorage (cb) { // we need to create a copy of the state root var storageTrie = stateTrie.copy() // Since we are using a copy we won't change the // root of `stateTrie` storageTrie.root = storageRoot var stream = storageTrie.createReadStream() console.log('------Storage------') // prints all of the keys and values in the storage trie stream.on('data', function (data) { // remove the 'hex' if you want to see the ascii values console.log('key: ' + data.key.toString('hex')) console.log('Value: ' + rlp.decode(data.value).toString()) }) stream.on('end', cb) } // run everything async.series([ setup, async.apply(runTx, rawTx1), async.apply(runTx, rawTx2), checkResults, readStorage ]) // Now when you run you should see a complete trace. // `onStep` provides an object that contains all the // information on the current state of the `VM`.
giulidb/ticket_dapp
node_modules/ethereumjs-vm/examples/run-transactions-complete/index.js
JavaScript
mit
4,121
import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { FormattedMessage, FormattedRelative } from 'react-intl'; import { Link } from 'react-router-dom'; import Avatar from '../../Avatar'; import './Notification.less'; const NotificationMention = ({ onClick, id, read, date, payload }) => (<div role="presentation" onClick={() => onClick(id)} className={classNames('Notification', { 'Notification--unread': !read, })} > <Avatar username={payload.user} size={40} /> <div className="Notification__text"> <div className="Notification__text__message"> <FormattedMessage id="notification_mention_username_post" defaultMessage="{username} mentioned you on this post {post}." values={{ username: <Link to={`/${payload.user}`}>{payload.user}</Link>, post: <Link to={payload.post_url}>{payload.post_title}</Link>, }} /> </div> <div className="Notification__text__date"> <FormattedRelative value={date} /> </div> </div> </div>); NotificationMention.propTypes = { onClick: PropTypes.func, id: PropTypes.number.isRequired, read: PropTypes.bool.isRequired, date: PropTypes.string.isRequired, payload: PropTypes.shape().isRequired, }; NotificationMention.defaultProps = { onClick: () => {}, }; export default NotificationMention;
ryanbaer/busy
src/components/Navigation/Notifications/NotificationMention.js
JavaScript
mit
1,437
import React, { PropTypes } from 'react'; import { InlineThumbnail as Thumbnail } from 'modules/common/thumbnail'; const icon = 'local_grocery_store'; const ShopInlineThumbnail = ({ shop, className, onClick }) => { const image = (shop && shop.thumbnail) && shop.thumbnail.thumbnail_80_80; return ( <Thumbnail onClick={onClick} image={image} icon={icon} className={className} /> ); }; ShopInlineThumbnail.propTypes = { shop: PropTypes.object, className: PropTypes.string, onClick: PropTypes.func, }; export default ShopInlineThumbnail;
theseushu/funong-web
app/modules/common/shop/inlineThumbnail.js
JavaScript
mit
555
import pageTitle from 'ember-page-title/helpers/page-title'; export default pageTitle;
tim-evans/ember-page-title
app/helpers/page-title.js
JavaScript
mit
88
import { driver, By2 } from 'selenium-appium' import { until } from 'selenium-webdriver'; const setup = require('../jest-setups/jest.setup'); jest.setTimeout(60000); beforeAll(() => { return driver.startWithCapabilities(setup.capabilites); }); afterAll(() => { return driver.quit(); }); describe('Test App', () => { test('API_URL present', async () => { // Get the element by label, will fail if the element is not present // we use the API_URL from the .env file await driver.wait(until.elementLocated(By2.nativeName('API_URL=http://localhost'))); }); })
luggit/react-native-config
Example/__tests__/ShowEnv.test.js
JavaScript
mit
582
import React from 'react' import * as DevTools from 'redux-devtools' import LogMonitor from 'redux-devtools-log-monitor' import DockMonitor from 'redux-devtools-dock-monitor' // export default DevTools.createDevTools( <DockMonitor toggleVisibilityKey='ctrl-h' changePositionKey='ctrl-p' defaultIsVisible={false}> <LogMonitor theme='tomorrow' /> </DockMonitor> )
zab/jumpsuit
src/devtools.js
JavaScript
mit
383
var chai = require('chai'); var should = chai.should(); var User = require('../app/models/User'); describe('User Model', function() { it('should create a new user', function(done) { var user = new User({ uid: 'tester', username: 'Tester', email: '[email protected]', password: 'password' }); user.save(function(err) { if (err) return done(err); done(); }) }); it('should not create a user with the unique username', function(done) { var user = new User({ uid: 'tester', username: 'TESTER', email: '[email protected]', password: 'password' }); user.save(function(err) { if (err) err.code.should.equal(11000); done(); }); }); it('should not create a user with the unique email', function(done) { var user = new User({ username: 'Tester2', email: '[email protected]', password: 'password' }); user.save(function(err) { if (err) err.code.should.equal(11000); done(); }); }); it('should find user by uid (username id)', function(done) { User.findOne({ uid: 'tester' }, function(err, user) { if (err) return done(err); user.uid.should.equal('tester'); done(); }); }); it('should find user by email', function(done) { User.findOne({ email: '[email protected]' }, function(err, user) { if (err) return done(err); user.email.should.equal('[email protected]'); done(); }); }); it('should delete a user', function(done) { User.remove({ email: '[email protected]' }, function(err) { if (err) return done(err); done(); }); }); });
gigavinyl/coffeeshop
test/models.js
JavaScript
mit
1,658
const util = require('util'); module.exports = function (req, res, utils) { var deferred = Promise.defer(); utils.request({ url: 'open/get_posts_by_category', method: 'POST', qs: { siteId: req.site.id, categoryId: 'vicoaeen57jodyi-37vlsa', pageSize: 3 } }, function (result) { var data = { category: {}, list: [], imgNew:[] }; if (result.code != 200) { deferred.resolve(data); return; }; result.body = JSON.parse(result.body); data.category = { href: util.format('category?id=%s', result.body.category.id) }; result.body.data.forEach(function (e) { data.list.push({ title: e.title, image: e.image_url, href: util.format('detail?id=%s', e.id) }); var imageAll = e.image_url; if (imageAll) { data.imgNew.push({ title: e.title, image: e.image_url, href: util.format('detail?id=%s', e.id) }); } }, this); deferred.resolve({ data: data }); },deferred); return deferred.promise; }
xLeonard/ahtvu.ah.cn
themes/jjxy/widgets/portal_picnews/data.js
JavaScript
mit
1,306
Meteor.startup(function () { Template.categoriesMenu.helpers({ hasCategories: function () { return Categories.find().count(); }, menuItems: function () { var defaultItem = [{ route: 'posts_default', label: 'all_categories', itemClass: 'item-never-active' }]; var menuItems = _.map(Categories.find({}, {sort: {order: 1, name: 1}}).fetch(), function (category) { return { route: function () { return getCategoryUrl(category.slug); }, label: category.name } }); return defaultItem.concat(menuItems); }, menuMode: function () { if (!!this.mobile) { return 'list'; } else if (Settings.get('navLayout', 'top-nav') === 'top-nav') { return 'dropdown'; } else { return 'accordion'; } } }); });
NYUMusEdLab/fork-cb
packages/telescope-tags/lib/client/templates/categories_menu.js
JavaScript
mit
879
/** global: __methods_with_response__ */ /** global: __ajax_nonce__ */ /** global: __methods_with_data__ */ /** global: __content_form_urlencoded__ */ /** global: __content_json__ */ /** global: __content_multipart__ */ function _ajaxNonce(url, options) { if(false === options.cache && options.method.match(__methods_with_response__)) { if(!url.match(/_=/)) { url += !url.match(/\?/) ? '?_=' : url.match(/\?$/) ? '_=' : '&_=' url += __ajax_nonce__++ } } return url } function _ajaxHeaders(xhr, headers) { if(headers) { /* eslint-disable guard-for-in */ for (var key in headers) { xhr.setRequestHeader(key, headers[key]) } /* eslint-enable guard-for-in */ } xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest') } function _ajaxContentType(xhr, options) { if(_ajaxNoContentTypeNeeded(options)) { return } if(!options.contentType) { options.contentType = __content_form_urlencoded__ } _ajaxHandleContentType(xhr, options) } function _ajaxHandleContentType(xhr, options) { switch(options.contentType.toLowerCase()) { case __content_form_urlencoded__: case __content_json__: xhr.setRequestHeader('Content-type', options.contentType) break case __content_multipart__: if(options.multipartBoundary) { xhr.setRequestHeader('Content-type', __content_multipart__ + '; boundary=' + options.multipartBoundary) } break default: throw new Error('Unsupported content type ' + options.contentType) } } function _ajaxNoContentTypeNeeded(options) { return(options.headers && options.headers['Content-type'] || !options.method.match(__methods_with_data__)) }
reeteshranjan/browse.js
lib/ajax-request.js
JavaScript
mit
1,725
/*jshint ignore:start,-W101*/ // allow long lines Tinytest.addAsync('dispatch:template-sequence - Test sequence offset -2', function(test, complete) { var container = document.createElement('div'); document.body.appendChild(container); var created = 0; var rendered = 0; var destroyed = 0; Template.item.created = function() { created++; }; Template.item.rendered = function() { rendered++; }; Template.item.destroyed = function() { destroyed++; }; var foo = new TemplateSequence({ template: Template.item, index: 0, offset: -2, container: container, size: 5 }); var c = 0; foo.forEach(function(item, index, i) { test.equal(c, i, 'counter off'); test.equal(c + 2, index, 'counter off'); c++; }); test.equal(foo.items.length, 5, 'Wrong length'); test.equal(created, 5); test.equal(destroyed, 0); test.equal(container.innerHTML, '23456', 'Rendered index did not match'); foo.resize(7); test.equal(foo.items.length, 7, 'Wrong length after resize'); test.equal(created, 7, 'Created counter dont match'); test.equal(destroyed, 0); test.equal(container.innerHTML, '2345678', 'Rendered index did not match'); foo.resize(3); test.equal(foo.items.length, 3, 'Wrong length after resize'); test.equal(created, 7, 'Created counter dont match'); test.equal(destroyed, 4); test.equal(container.innerHTML, '234', 'Rendered index did not match'); foo.resize(10); test.equal(foo.items.length, 10, 'Wrong length after resize'); test.equal(created, 14, 'Created counter dont match'); test.equal(destroyed, 4); test.equal(container.innerHTML, '234567891011', 'Rendered index did not match'); foo.setIndex(0); test.equal(foo.items.length, 10, 'Wrong length after index 0'); test.equal(created, 14, 'Created counter dont match'); test.equal(destroyed, 4); test.equal(container.innerHTML, '234567891011', 'Rendered index did not match'); test.equal(rendered, 0, 'Templates should rendered off'); foo.setIndex(10); Tracker.flush(); // Wait a sec before checking dom etc Meteor.setTimeout(function() { test.equal(rendered, 10, 'Templates should rendered off'); test.equal(foo.items.length, 10, 'Wrong length after index 10'); test.equal(created, 14, 'Created counter dont match'); test.equal(destroyed, 4); test.equal(container.innerHTML, '12131415161718192021', 'Rendered index 10 did not match'); foo.setIndex(-10); Tracker.flush(); Meteor.setTimeout(function() { test.equal(rendered, 10, 'Templates should rendered off'); test.equal(foo.items.length, 10, 'Wrong length after index 10'); test.equal(created, 14, 'Created counter dont match'); test.equal(destroyed, 4); test.equal(container.innerHTML, '-8-7-6-5-4-3-2-101', 'Rendered index 10 did not match'); foo.destroy(); test.equal(container.innerHTML, '', 'Rendered index did not match'); test.equal(destroyed, created, 'TemplateSequence did not clean up'); // Clean up document.body.removeChild(container); complete(); }, 300); }, 300); }); //Test API: //test.isFalse(v, msg) //test.isTrue(v, msg) //test.equalactual, expected, message, not //test.length(obj, len) //test.include(s, v) //test.isNaN(v, msg) //test.isUndefined(v, msg) //test.isNotNull //test.isNull //test.throws(func) //test.instanceOf(obj, klass) //test.notEqual(actual, expected, message) //test.runId() //test.exception(exception) //test.expect_fail() //test.ok(doc) //test.fail(doc) //test.equal(a, b, msg) /*jshint ignore:end,-W101*/
DispatchMe/meteor-scrollview
tests/template-sequence.2.js
JavaScript
mit
3,612
//>>built define("dojo/_base/lang dojo/_base/declare dojo/_base/array dojo/_base/json dojo/_base/kernel dojo/_base/sniff dojo/data/util/sorter dojo/data/util/filter ./css".split(" "),function(f,r,n,t,p,u,v,q,l){return r("dojox.data.CssRuleStore",null,{_storeRef:"_S",_labelAttribute:"selector",_cache:null,_browserMap:null,_cName:"dojox.data.CssRuleStore",constructor:function(a){a&&f.mixin(this,a);this._cache={};this._allItems=null;this._waiting=[];this.gatherHandle=null;var c=this;this.gatherHandle=setInterval(function(){try{for(c.context= l.determineContext(c.context),c.gatherHandle&&(clearInterval(c.gatherHandle),c.gatherHandle=null);c._waiting.length;){var a=c._waiting.pop();l.rules.forEach(a.forFunc,null,c.context);a.finishFunc()}}catch(e){}},250)},setContext:function(a){a&&(this.close(),this.context=l.determineContext(a))},getFeatures:function(){return{"dojo.data.api.Read":!0}},isItem:function(a){return a&&a[this._storeRef]==this?!0:!1},hasAttribute:function(a,c){this._assertIsItem(a);this._assertIsAttribute(c);a=this.getAttributes(a); return-1!=n.indexOf(a,c)?!0:!1},getAttributes:function(a){this._assertIsItem(a);var c="selector classes rule style cssText styleSheet parentStyleSheet parentStyleSheetHref".split(" ");if(a=a.rule.style)for(var b in a)c.push("style."+b);return c},getValue:function(a,c,b){return(a=this.getValues(a,c))&&0<a.length?a[0]:b},getValues:function(a,c){this._assertIsItem(a);this._assertIsAttribute(c);var b=null;"selector"===c?(b=a.rule.selectorText)&&f.isString(b)&&(b=b.split(",")):"classes"===c?b=a.classes: "rule"===c?b=a.rule.rule:"style"===c?b=a.rule.style:"cssText"===c?u("ie")?a.rule.style&&(b=a.rule.style.cssText)&&(b="{ "+b.toLowerCase()+" }"):(b=a.rule.cssText)&&(b=b.substring(b.indexOf("{"),b.length)):"styleSheet"===c?b=a.rule.styleSheet:"parentStyleSheet"===c?b=a.rule.parentStyleSheet:"parentStyleSheetHref"===c?a.href&&(b=a.href):0===c.indexOf("style.")?(c=c.substring(c.indexOf("."),c.length),b=a.rule.style[c]):b=[];void 0!==b&&(f.isArray(b)||(b=[b]));return b},getLabel:function(a){this._assertIsItem(a); return this.getValue(a,this._labelAttribute)},getLabelAttributes:function(a){return[this._labelAttribute]},containsValue:function(a,c,b){var e=void 0;"string"===typeof b&&(e=q.patternToRegExp(b,!1));return this._containsValue(a,c,b,e)},isItemLoaded:function(a){return this.isItem(a)},loadItem:function(a){this._assertIsItem(a.item)},fetch:function(a){a=a||{};a.store||(a.store=this);this._pending&&0<this._pending.length?this._pending.push({request:a,fetch:!0}):(this._pending=[{request:a,fetch:!0}],this._fetch(a)); return a},_fetch:function(a){var c=a.scope||p.global;if(null===this._allItems){this._allItems={};try{this.gatherHandle?this._waiting.push({forFunc:f.hitch(this,this._handleRule),finishFunc:f.hitch(this,this._handleReturn)}):(l.rules.forEach(f.hitch(this,this._handleRule),null,this.context),this._handleReturn())}catch(b){a.onError&&a.onError.call(c,b,a)}}else this._handleReturn()},_handleRule:function(a,c,b){for(var e=a.selectorText,d=e.split(" "),g=[],f=0;f<d.length;f++){var h=d[f],k=h.indexOf("."); if(h&&0<h.length&&-1!==k){var m=h.indexOf(",")||h.indexOf("["),h=h.substring(k,-1!==m&&m>k?m:h.length);g.push(h)}}d={};d.rule=a;d.styleSheet=c;d.href=b;d.classes=g;d[this._storeRef]=this;this._allItems[e]||(this._allItems[e]=[]);this._allItems[e].push(d)},_handleReturn:function(){var a=[],c=[],b=null,e;for(e in this._allItems){var b=this._allItems[e],d;for(d in b)c.push(b[d])}for(;this._pending.length;)b=this._pending.pop(),b.request._items=c,a.push(b);for(;a.length;)b=a.pop(),this._handleFetchReturn(b.request)}, _handleFetchReturn:function(a){var c=a.scope||p.global,b=[],e="all",d;a.query&&(e=t.toJson(a.query));if(this._cache[e])b=this._cache[e];else if(a.query){for(d in a._items){var g=a._items[d],l=a.queryOptions?a.queryOptions.ignoreCase:!1,h={},k,m;for(k in a.query)m=a.query[k],"string"===typeof m&&(h[k]=q.patternToRegExp(m,l));l=!0;for(k in a.query)m=a.query[k],this._containsValue(g,k,m,h[k])||(l=!1);l&&b.push(g)}this._cache[e]=b}else for(d in a._items)b.push(a._items[d]);e=b.length;a.sort&&b.sort(v.createSortFunction(a.sort, this));d=0;g=b.length;0<a.start&&a.start<b.length&&(d=a.start);a.count&&a.count&&(g=a.count);g=d+g;g>b.length&&(g=b.length);b=b.slice(d,g);a.onBegin&&a.onBegin.call(c,e,a);if(a.onItem){if(f.isArray(b)){for(d=0;d<b.length;d++)a.onItem.call(c,b[d],a);a.onComplete&&a.onComplete.call(c,null,a)}}else a.onComplete&&a.onComplete.call(c,b,a);return a},close:function(){this._cache={};this._allItems=null},_assertIsItem:function(a){if(!this.isItem(a))throw Error(this._cName+": Invalid item argument.");},_assertIsAttribute:function(a){if("string"!== typeof a)throw Error(this._cName+": Invalid attribute argument.");},_containsValue:function(a,c,b,e){return n.some(this.getValues(a,c),function(a){if(null!==a&&!f.isObject(a)&&e){if(a.toString().match(e))return!0}else if(b===a)return!0;return!1})}})});
ycabon/presentations
2020-devsummit/arcgis-js-api-road-ahead/js-api/dojox/data/CssRuleStore.js
JavaScript
mit
4,941
'use strict'; const co = require('co'); const fs = require('fs-extra'); const ember = require('../helpers/ember'); const walkSync = require('walk-sync'); const Blueprint = require('../../lib/models/blueprint'); const path = require('path'); const tmp = require('ember-cli-internal-test-helpers/lib/helpers/tmp'); let root = process.cwd(); const util = require('util'); const EOL = require('os').EOL; const chalk = require('chalk'); const chai = require('../chai'); let expect = chai.expect; let file = chai.file; let dir = chai.dir; const forEach = require('ember-cli-lodash-subset').forEach; let tmpDir = './tmp/new-test'; describe('Acceptance: ember new', function() { this.timeout(10000); beforeEach(co.wrap(function *() { yield tmp.setup(tmpDir); process.chdir(tmpDir); })); afterEach(function() { return tmp.teardown(tmpDir); }); function confirmBlueprintedForDir(dir) { let blueprintPath = path.join(root, dir, 'files'); let expected = walkSync(blueprintPath); let actual = walkSync('.').sort(); let directory = path.basename(process.cwd()); forEach(Blueprint.renamedFiles, function(destFile, srcFile) { expected[expected.indexOf(srcFile)] = destFile; }); expected.sort(); expect(directory).to.equal('foo'); expect(expected) .to.deep.equal(actual, `${EOL} expected: ${util.inspect(expected)}${EOL} but got: ${util.inspect(actual)}`); } function confirmBlueprinted() { return confirmBlueprintedForDir('blueprints/app'); } it('ember new foo, where foo does not yet exist, works', co.wrap(function *() { yield ember([ 'new', 'foo', '--skip-npm', '--skip-bower', ]); confirmBlueprinted(); })); it('ember new with empty app name fails with a warning', co.wrap(function *() { let err = yield expect(ember([ 'new', '', ])).to.be.rejected; expect(err.name).to.equal('SilentError'); expect(err.message).to.contain('The `ember new` command requires a name to be specified.'); })); it('ember new without app name fails with a warning', co.wrap(function *() { let err = yield expect(ember([ 'new', ])).to.be.rejected; expect(err.name).to.equal('SilentError'); expect(err.message).to.contain('The `ember new` command requires a name to be specified.'); })); it('ember new with app name creates new directory and has a dasherized package name', co.wrap(function *() { yield ember([ 'new', 'FooApp', '--skip-npm', '--skip-bower', '--skip-git', ]); expect(dir('FooApp')).to.not.exist; expect(file('package.json')).to.exist; let pkgJson = fs.readJsonSync('package.json'); expect(pkgJson.name).to.equal('foo-app'); })); it('Can create new ember project in an existing empty directory', co.wrap(function *() { fs.mkdirsSync('bar'); yield ember([ 'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git', '--directory=bar', ]); })); it('Cannot create new ember project in a populated directory', co.wrap(function *() { fs.mkdirsSync('bar'); fs.writeFileSync(path.join('bar', 'package.json'), '{}'); let error = yield expect(ember([ 'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git', '--directory=bar', ])).to.be.rejected; expect(error.name).to.equal('SilentError'); expect(error.message).to.equal('Directory \'bar\' already exists.'); })); it('Cannot run ember new, inside of ember-cli project', co.wrap(function *() { yield ember([ 'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git', ]); let error = yield expect(ember([ 'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git', ])).to.be.rejected; expect(dir('foo')).to.not.exist; expect(error.name).to.equal('SilentError'); expect(error.message).to.equal(`You cannot use the ${chalk.green('new')} command inside an ember-cli project.`); confirmBlueprinted(); })); it('ember new with blueprint uses the specified blueprint directory with a relative path', co.wrap(function *() { fs.mkdirsSync('my_blueprint/files'); fs.writeFileSync('my_blueprint/files/gitignore'); yield ember([ 'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git', '--blueprint=./my_blueprint', ]); confirmBlueprintedForDir(path.join(tmpDir, 'my_blueprint')); })); it('ember new with blueprint uses the specified blueprint directory with an absolute path', co.wrap(function *() { fs.mkdirsSync('my_blueprint/files'); fs.writeFileSync('my_blueprint/files/gitignore'); yield ember([ 'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git', `--blueprint=${path.resolve(process.cwd(), 'my_blueprint')}`, ]); confirmBlueprintedForDir(path.join(tmpDir, 'my_blueprint')); })); it('ember new with git blueprint checks out the blueprint and uses it', co.wrap(function *() { this.timeout(20000); // relies on GH network stuff yield ember([ 'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git', '--blueprint=https://github.com/ember-cli/app-blueprint-test.git', ]); expect(file('.ember-cli')).to.exist; })); it('ember new passes blueprint options through to blueprint', co.wrap(function *() { fs.mkdirsSync('my_blueprint/files'); fs.writeFileSync('my_blueprint/index.js', [ 'module.exports = {', ' availableOptions: [ { name: \'custom-option\' } ],', ' locals(options) {', ' return {', ' customOption: options.customOption', ' };', ' }', '};', ].join('\n')); fs.writeFileSync('my_blueprint/files/gitignore', '<%= customOption %>'); yield ember([ 'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git', '--blueprint=./my_blueprint', '--custom-option=customValue', ]); expect(file('.gitignore')).to.contain('customValue'); })); it('ember new uses yarn when blueprint has yarn.lock', co.wrap(function *() { fs.mkdirsSync('my_blueprint/files'); fs.writeFileSync('my_blueprint/index.js', 'module.exports = {};'); fs.writeFileSync('my_blueprint/files/package.json', '{ "name": "foo", "dependencies": { "fs-extra": "*" }}'); fs.writeFileSync('my_blueprint/files/yarn.lock', ''); yield ember([ 'new', 'foo', '--skip-git', '--blueprint=./my_blueprint', ]); expect(file('yarn.lock')).to.not.be.empty; expect(dir('node_modules/fs-extra')).to.not.be.empty; })); it('ember new without skip-git flag creates .git dir', co.wrap(function *() { yield ember([ 'new', 'foo', '--skip-npm', '--skip-bower', ], { skipGit: false, }); expect(dir('.git')).to.exist; })); it('ember new cleans up after itself on error', co.wrap(function *() { fs.mkdirsSync('my_blueprint'); fs.writeFileSync('my_blueprint/index.js', 'throw("this will break");'); yield ember([ 'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git', '--blueprint=./my_blueprint', ]); expect(dir('foo')).to.not.exist; })); it('ember new with --dry-run does not create new directory', co.wrap(function *() { yield ember([ 'new', 'foo', '--dry-run', ]); expect(process.cwd()).to.not.match(/foo/, 'does not change cwd to foo in a dry run'); expect(dir('foo')).to.not.exist; expect(dir('.git')).to.not.exist; })); it('ember new with --directory uses given directory name and has correct package name', co.wrap(function *() { let workdir = process.cwd(); yield ember([ 'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git', '--directory=bar', ]); expect(dir(path.join(workdir, 'foo'))).to.not.exist; expect(dir(path.join(workdir, 'bar'))).to.exist; let cwd = process.cwd(); expect(cwd).to.not.match(/foo/, 'does not use app name for directory name'); expect(cwd).to.match(/bar/, 'uses given directory name'); let pkgJson = fs.readJsonSync('package.json'); expect(pkgJson.name).to.equal('foo', 'uses app name for package name'); })); it('ember addon with --directory uses given directory name and has correct package name', co.wrap(function *() { let workdir = process.cwd(); yield ember([ 'addon', 'foo', '--skip-npm', '--skip-bower', '--skip-git', '--directory=bar', ]); expect(dir(path.join(workdir, 'foo'))).to.not.exist; expect(dir(path.join(workdir, 'bar'))).to.exist; let cwd = process.cwd(); expect(cwd).to.not.match(/foo/, 'does not use addon name for directory name'); expect(cwd).to.match(/bar/, 'uses given directory name'); let pkgJson = fs.readJsonSync('package.json'); expect(pkgJson.name).to.equal('foo', 'uses addon name for package name'); })); it('ember new adds ember-welcome-page by default', co.wrap(function *() { yield ember([ 'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git', ]); expect(file('package.json')) .to.match(/"ember-welcome-page"/); expect(file('app/templates/application.hbs')) .to.contain("{{welcome-page}}"); })); it('ember new --no-welcome skips installation of ember-welcome-page', co.wrap(function *() { yield ember([ 'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git', '--no-welcome', ]); expect(file('package.json')) .not.to.match(/"ember-welcome-page"/); expect(file('app/templates/application.hbs')) .to.contain("Welcome to Ember"); })); describe('verify fictures', function() { it('app + npm + !welcome', co.wrap(function *() { yield ember([ 'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git', '--no-welcome', ]); [ 'app/templates/application.hbs', '.travis.yml', 'README.md', ].forEach(filePath => { expect(file(filePath)) .to.equal(file(path.join(__dirname, '../fixtures/app/npm', filePath))); }); })); it('app + yarn + welcome', co.wrap(function *() { yield ember([ 'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git', '--yarn', ]); [ 'app/templates/application.hbs', '.travis.yml', 'README.md', ].forEach(filePath => { expect(file(filePath)) .to.equal(file(path.join(__dirname, '../fixtures/app/yarn', filePath))); }); })); it('addon + npm + !welcome', co.wrap(function *() { yield ember([ 'addon', 'foo', '--skip-npm', '--skip-bower', '--skip-git', ]); [ 'tests/dummy/app/templates/application.hbs', '.travis.yml', 'README.md', ].forEach(filePath => { expect(file(filePath)) .to.equal(file(path.join(__dirname, '../fixtures/addon/npm', filePath))); }); })); it('addon + yarn + welcome', co.wrap(function *() { yield ember([ 'addon', 'foo', '--skip-npm', '--skip-bower', '--skip-git', '--yarn', '--welcome', ]); [ 'tests/dummy/app/templates/application.hbs', '.travis.yml', 'README.md', ].forEach(filePath => { expect(file(filePath)) .to.equal(file(path.join(__dirname, '../fixtures/addon/yarn', filePath))); }); })); }); });
rtablada/ember-cli
tests/acceptance/new-test.js
JavaScript
mit
11,815
/* */ System.register(["./resource-registry", "./view-factory", "./binding-language"], function (_export) { "use strict"; var ResourceRegistry, ViewFactory, BindingLanguage, _prototypeProperties, nextInjectorId, defaultCompileOptions, hasShadowDOM, ViewCompiler; function getNextInjectorId() { return ++nextInjectorId; } function configureProperties(instruction, resources) { var type = instruction.type, attrName = instruction.attrName, attributes = instruction.attributes, property, key, value; var knownAttribute = resources.mapAttribute(attrName); if (knownAttribute && attrName in attributes && knownAttribute !== attrName) { attributes[knownAttribute] = attributes[attrName]; delete attributes[attrName]; } for (key in attributes) { value = attributes[key]; if (typeof value !== "string") { property = type.attributes[key]; if (property !== undefined) { value.targetProperty = property.name; } else { value.targetProperty = key; } } } } function makeIntoInstructionTarget(element) { var value = element.getAttribute("class"); element.setAttribute("class", value ? value += " au-target" : "au-target"); } return { setters: [function (_resourceRegistry) { ResourceRegistry = _resourceRegistry.ResourceRegistry; }, function (_viewFactory) { ViewFactory = _viewFactory.ViewFactory; }, function (_bindingLanguage) { BindingLanguage = _bindingLanguage.BindingLanguage; }], execute: function () { _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; nextInjectorId = 0; defaultCompileOptions = { targetShadowDOM: false }; hasShadowDOM = !!HTMLElement.prototype.createShadowRoot; ViewCompiler = _export("ViewCompiler", (function () { function ViewCompiler(bindingLanguage) { this.bindingLanguage = bindingLanguage; } _prototypeProperties(ViewCompiler, { inject: { value: function inject() { return [BindingLanguage]; }, writable: true, configurable: true } }, { compile: { value: function compile(templateOrFragment, resources) { var options = arguments[2] === undefined ? defaultCompileOptions : arguments[2]; var instructions = [], targetShadowDOM = options.targetShadowDOM, content; targetShadowDOM = targetShadowDOM && hasShadowDOM; if (options.beforeCompile) { options.beforeCompile(templateOrFragment); } if (templateOrFragment.content) { content = document.adoptNode(templateOrFragment.content, true); } else { content = templateOrFragment; } this.compileNode(content, resources, instructions, templateOrFragment, "root", !targetShadowDOM); content.insertBefore(document.createComment("<view>"), content.firstChild); content.appendChild(document.createComment("</view>")); return new ViewFactory(content, instructions, resources); }, writable: true, configurable: true }, compileNode: { value: function compileNode(node, resources, instructions, parentNode, parentInjectorId, targetLightDOM) { switch (node.nodeType) { case 1: return this.compileElement(node, resources, instructions, parentNode, parentInjectorId, targetLightDOM); case 3: var expression = this.bindingLanguage.parseText(resources, node.textContent); if (expression) { var marker = document.createElement("au-marker"); marker.className = "au-target"; node.parentNode.insertBefore(marker, node); node.textContent = " "; instructions.push({ contentExpression: expression }); } return node.nextSibling; case 11: var currentChild = node.firstChild; while (currentChild) { currentChild = this.compileNode(currentChild, resources, instructions, node, parentInjectorId, targetLightDOM); } break; } return node.nextSibling; }, writable: true, configurable: true }, compileElement: { value: function compileElement(node, resources, instructions, parentNode, parentInjectorId, targetLightDOM) { var tagName = node.tagName.toLowerCase(), attributes = node.attributes, expressions = [], behaviorInstructions = [], providers = [], bindingLanguage = this.bindingLanguage, liftingInstruction, viewFactory, type, elementInstruction, elementProperty, i, ii, attr, attrName, attrValue, instruction, info, property, knownAttribute; if (tagName === "content") { if (targetLightDOM) { instructions.push({ parentInjectorId: parentInjectorId, contentSelector: true, selector: node.getAttribute("select"), suppressBind: true }); makeIntoInstructionTarget(node); } return node.nextSibling; } else if (tagName === "template") { viewFactory = this.compile(node, resources); } else { type = resources.getElement(tagName); if (type) { elementInstruction = { type: type, attributes: {} }; behaviorInstructions.push(elementInstruction); } } for (i = 0, ii = attributes.length; i < ii; ++i) { attr = attributes[i]; attrName = attr.name; attrValue = attr.value; info = bindingLanguage.inspectAttribute(resources, attrName, attrValue); type = resources.getAttribute(info.attrName); elementProperty = null; if (type) { knownAttribute = resources.mapAttribute(info.attrName); if (knownAttribute) { property = type.attributes[knownAttribute]; if (property) { info.defaultBindingMode = property.defaultBindingMode; if (!info.command && !info.expression) { info.command = property.hasOptions ? "options" : null; } } } } else if (elementInstruction) { elementProperty = elementInstruction.type.attributes[info.attrName]; if (elementProperty) { info.defaultBindingMode = elementProperty.defaultBindingMode; if (!info.command && !info.expression) { info.command = elementProperty.hasOptions ? "options" : null; } } } if (elementProperty) { instruction = bindingLanguage.createAttributeInstruction(resources, node, info, elementInstruction); } else { instruction = bindingLanguage.createAttributeInstruction(resources, node, info); } if (instruction) { if (instruction.alteredAttr) { type = resources.getAttribute(instruction.attrName); } if (instruction.discrete) { expressions.push(instruction); } else { if (type) { instruction.type = type; configureProperties(instruction, resources); if (type.liftsContent) { instruction.originalAttrName = attrName; liftingInstruction = instruction; break; } else { behaviorInstructions.push(instruction); } } else if (elementProperty) { elementInstruction.attributes[info.attrName].targetProperty = elementProperty.name; } else { expressions.push(instruction.attributes[instruction.attrName]); } } } else { if (type) { instruction = { attrName: attrName, type: type, attributes: {} }; instruction.attributes[resources.mapAttribute(attrName)] = attrValue; if (type.liftsContent) { instruction.originalAttrName = attrName; liftingInstruction = instruction; break; } else { behaviorInstructions.push(instruction); } } else if (elementProperty) { elementInstruction.attributes[attrName] = attrValue; } } } if (liftingInstruction) { liftingInstruction.viewFactory = viewFactory; node = liftingInstruction.type.compile(this, resources, node, liftingInstruction, parentNode); makeIntoInstructionTarget(node); instructions.push({ anchorIsContainer: false, parentInjectorId: parentInjectorId, expressions: [], behaviorInstructions: [liftingInstruction], viewFactory: liftingInstruction.viewFactory, providers: [liftingInstruction.type.target] }); } else { for (i = 0, ii = behaviorInstructions.length; i < ii; ++i) { instruction = behaviorInstructions[i]; instruction.type.compile(this, resources, node, instruction, parentNode); providers.push(instruction.type.target); } var injectorId = behaviorInstructions.length ? getNextInjectorId() : false; if (expressions.length || behaviorInstructions.length) { makeIntoInstructionTarget(node); instructions.push({ anchorIsContainer: true, injectorId: injectorId, parentInjectorId: parentInjectorId, expressions: expressions, behaviorInstructions: behaviorInstructions, providers: providers }); } var currentChild = node.firstChild; while (currentChild) { currentChild = this.compileNode(currentChild, resources, instructions, node, injectorId || parentInjectorId, targetLightDOM); } } return node.nextSibling; }, writable: true, configurable: true } }); return ViewCompiler; })()); } }; });
Maidan-hackaton/ua-tenders-aurelia
jspm_packages/github/aurelia/[email protected]/system/view-compiler.js
JavaScript
mit
11,992
import * as React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path d="M4 3h15v16H4z" opacity=".3" /><path d="M18.5 0h-14C3.12 0 2 1.12 2 2.5v19C2 22.88 3.12 24 4.5 24h14c1.38 0 2.5-1.12 2.5-2.5v-19C21 1.12 19.88 0 18.5 0zm-7 23c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm7.5-4H4V3h15v16z" /></React.Fragment> , 'TabletMacTwoTone');
callemall/material-ui
packages/material-ui-icons/src/TabletMacTwoTone.js
JavaScript
mit
431
const gmail = require('../../engine/api-content/gmail.js'); const $ = require('jquery'); const path = require('path'); const ipcRenderer = require('electron').ipcRenderer; let activeAccounts = []; let currentAccount; let printing = false; //Boolean for preventing fast click-bug /**Loads the current profile and other active accounts to dropdown menu*/ function printProfiles() { console.log(activeAccounts.length); let account = currentAccount; if(typeof account == 'undefined'){ account = 'No accounts found'; } $('#activeButton').append( account + '<span class="caret"></span>' ); for (let i = 0; i < activeAccounts.length; i++) { let account = activeAccounts[i]; if(i == 0){ account = '<b>' + activeAccounts[i] + '</b>'; } $('#dropElement').append( '<div class="dropdown-divider"></div>' + '<li id="user' + i + '"><a class="dropdown-item" href="#">' + account + '</a></li>' ); } printing = false; } function cleanPrint(callback){ $('#dropElement').empty(); $('#activeButton').empty(); console.log('cleaned'); callback(); } function getProfile(callback) { gmail.request.getProfile(function(profile) { let address = profile.emailAddress; if(!activeAccounts.includes(address)){ console.log('Added ' + address); activeAccounts.unshift(address); currentAccount = address; } if(callback.name == 'cleanPrint') callback(printProfiles); else callback(); }); } /*Loads the authentication window and executes cleanPrint*/ function loadAuth(){ $('#authLink').click(function(){ ipcRenderer.send('asynchronous-message','show-auth-gmail'); ipcRenderer.on('asynchronous-reply', function(event, arg) { console.log(arg); if(arg === 'auth-complete') getProfile(cleanPrint); }); }); } /** Document specific JQUERY **/ $(document).ajaxComplete(function(e, xhr, settings) { if (settings.url === path.normalize(__dirname + '/settings.html')) { if(!printing){ printing = true; loadAuth(); getProfile(printProfiles); } } });
Ovhagen/lama-risky
views/settings/settings.js
JavaScript
mit
2,257
$(function () { $(window).on('message', function (e) { $.ajax({ url: '/widget/data', method: 'POST', data: {diff: e.originalEvent.data.diff}, dataType: 'json', success: function (data) { parent.postMessage( { metrics: data.metrics, elementId: e.originalEvent.data.elementId }, '*' ); } }); }); parent.postMessage({ready: true}, '*'); });
ucarion/git-code-debt
git_code_debt/server/static/js/widget_frame.js
JavaScript
mit
579
/* global QUnit */ import { Euler } from '../../../../src/math/Euler.js'; import { Matrix4 } from '../../../../src/math/Matrix4.js'; import { Quaternion } from '../../../../src/math/Quaternion.js'; import { Vector3 } from '../../../../src/math/Vector3.js'; import { x, y, z } from './Constants.tests.js'; const eulerZero = new Euler( 0, 0, 0, 'XYZ' ); const eulerAxyz = new Euler( 1, 0, 0, 'XYZ' ); const eulerAzyx = new Euler( 0, 1, 0, 'ZYX' ); function matrixEquals4( a, b, tolerance ) { tolerance = tolerance || 0.0001; if ( a.elements.length != b.elements.length ) { return false; } for ( var i = 0, il = a.elements.length; i < il; i ++ ) { var delta = a.elements[ i ] - b.elements[ i ]; if ( delta > tolerance ) { return false; } } return true; } function quatEquals( a, b, tolerance ) { tolerance = tolerance || 0.0001; var diff = Math.abs( a.x - b.x ) + Math.abs( a.y - b.y ) + Math.abs( a.z - b.z ) + Math.abs( a.w - b.w ); return ( diff < tolerance ); } export default QUnit.module( 'Maths', () => { QUnit.module( 'Euler', () => { // INSTANCING QUnit.test( 'Instancing', ( assert ) => { var a = new Euler(); assert.ok( a.equals( eulerZero ), 'Passed!' ); assert.ok( ! a.equals( eulerAxyz ), 'Passed!' ); assert.ok( ! a.equals( eulerAzyx ), 'Passed!' ); } ); // STATIC STUFF QUnit.test( 'RotationOrders', ( assert ) => { assert.ok( Array.isArray( Euler.RotationOrders ), 'Passed!' ); assert.deepEqual( Euler.RotationOrders, [ 'XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX' ], 'Passed!' ); } ); QUnit.test( 'DefaultOrder', ( assert ) => { assert.equal( Euler.DefaultOrder, 'XYZ', 'Passed!' ); } ); // PROPERTIES STUFF QUnit.test( 'x', ( assert ) => { var a = new Euler(); assert.ok( a.x === 0, 'Passed!' ); a = new Euler( 1, 2, 3 ); assert.ok( a.x === 1, 'Passed!' ); a = new Euler( 4, 5, 6, 'XYZ' ); assert.ok( a.x === 4, 'Passed!' ); a = new Euler( 7, 8, 9, 'XYZ' ); a.x = 10; assert.ok( a.x === 10, 'Passed!' ); a = new Euler( 11, 12, 13, 'XYZ' ); var b = false; a._onChange( function () { b = true; } ); a.x = 14; assert.ok( b, 'Passed!' ); assert.ok( a.x === 14, 'Passed!' ); } ); QUnit.test( 'y', ( assert ) => { var a = new Euler(); assert.ok( a.y === 0, 'Passed!' ); a = new Euler( 1, 2, 3 ); assert.ok( a.y === 2, 'Passed!' ); a = new Euler( 4, 5, 6, 'XYZ' ); assert.ok( a.y === 5, 'Passed!' ); a = new Euler( 7, 8, 9, 'XYZ' ); a.y = 10; assert.ok( a.y === 10, 'Passed!' ); a = new Euler( 11, 12, 13, 'XYZ' ); var b = false; a._onChange( function () { b = true; } ); a.y = 14; assert.ok( b, 'Passed!' ); assert.ok( a.y === 14, 'Passed!' ); } ); QUnit.test( 'z', ( assert ) => { var a = new Euler(); assert.ok( a.z === 0, 'Passed!' ); a = new Euler( 1, 2, 3 ); assert.ok( a.z === 3, 'Passed!' ); a = new Euler( 4, 5, 6, 'XYZ' ); assert.ok( a.z === 6, 'Passed!' ); a = new Euler( 7, 8, 9, 'XYZ' ); a.z = 10; assert.ok( a.z === 10, 'Passed!' ); a = new Euler( 11, 12, 13, 'XYZ' ); var b = false; a._onChange( function () { b = true; } ); a.z = 14; assert.ok( b, 'Passed!' ); assert.ok( a.z === 14, 'Passed!' ); } ); QUnit.test( 'order', ( assert ) => { var a = new Euler(); assert.ok( a.order === Euler.DefaultOrder, 'Passed!' ); a = new Euler( 1, 2, 3 ); assert.ok( a.order === Euler.DefaultOrder, 'Passed!' ); a = new Euler( 4, 5, 6, 'YZX' ); assert.ok( a.order === 'YZX', 'Passed!' ); a = new Euler( 7, 8, 9, 'YZX' ); a.order = 'ZXY'; assert.ok( a.order === 'ZXY', 'Passed!' ); a = new Euler( 11, 12, 13, 'YZX' ); var b = false; a._onChange( function () { b = true; } ); a.order = 'ZXY'; assert.ok( b, 'Passed!' ); assert.ok( a.order === 'ZXY', 'Passed!' ); } ); // PUBLIC STUFF QUnit.test( 'isEuler', ( assert ) => { var a = new Euler(); assert.ok( a.isEuler, 'Passed!' ); var b = new Vector3(); assert.ok( ! b.isEuler, 'Passed!' ); } ); QUnit.test( 'set/setFromVector3/toVector3', ( assert ) => { var a = new Euler(); a.set( 0, 1, 0, 'ZYX' ); assert.ok( a.equals( eulerAzyx ), 'Passed!' ); assert.ok( ! a.equals( eulerAxyz ), 'Passed!' ); assert.ok( ! a.equals( eulerZero ), 'Passed!' ); var vec = new Vector3( 0, 1, 0 ); var b = new Euler().setFromVector3( vec, 'ZYX' ); assert.ok( a.equals( b ), 'Passed!' ); var c = b.toVector3(); assert.ok( c.equals( vec ), 'Passed!' ); } ); QUnit.test( 'clone/copy/equals', ( assert ) => { var a = eulerAxyz.clone(); assert.ok( a.equals( eulerAxyz ), 'Passed!' ); assert.ok( ! a.equals( eulerZero ), 'Passed!' ); assert.ok( ! a.equals( eulerAzyx ), 'Passed!' ); a.copy( eulerAzyx ); assert.ok( a.equals( eulerAzyx ), 'Passed!' ); assert.ok( ! a.equals( eulerAxyz ), 'Passed!' ); assert.ok( ! a.equals( eulerZero ), 'Passed!' ); } ); QUnit.test( 'Quaternion.setFromEuler/Euler.fromQuaternion', ( assert ) => { var testValues = [ eulerZero, eulerAxyz, eulerAzyx ]; for ( var i = 0; i < testValues.length; i ++ ) { var v = testValues[ i ]; var q = new Quaternion().setFromEuler( v ); var v2 = new Euler().setFromQuaternion( q, v.order ); var q2 = new Quaternion().setFromEuler( v2 ); assert.ok( quatEquals( q, q2 ), 'Passed!' ); } } ); QUnit.test( 'Matrix4.setFromEuler/Euler.fromRotationMatrix', ( assert ) => { var testValues = [ eulerZero, eulerAxyz, eulerAzyx ]; for ( var i = 0; i < testValues.length; i ++ ) { var v = testValues[ i ]; var m = new Matrix4().makeRotationFromEuler( v ); var v2 = new Euler().setFromRotationMatrix( m, v.order ); var m2 = new Matrix4().makeRotationFromEuler( v2 ); assert.ok( matrixEquals4( m, m2, 0.0001 ), 'Passed!' ); } } ); QUnit.test( 'reorder', ( assert ) => { var testValues = [ eulerZero, eulerAxyz, eulerAzyx ]; for ( var i = 0; i < testValues.length; i ++ ) { var v = testValues[ i ]; var q = new Quaternion().setFromEuler( v ); v.reorder( 'YZX' ); var q2 = new Quaternion().setFromEuler( v ); assert.ok( quatEquals( q, q2 ), 'Passed!' ); v.reorder( 'ZXY' ); var q3 = new Quaternion().setFromEuler( v ); assert.ok( quatEquals( q, q3 ), 'Passed!' ); } } ); QUnit.test( 'set/get properties, check callbacks', ( assert ) => { var a = new Euler(); a._onChange( function () { assert.step( 'set: onChange called' ); } ); a.x = 1; a.y = 2; a.z = 3; a.order = 'ZYX'; assert.strictEqual( a.x, 1, 'get: check x' ); assert.strictEqual( a.y, 2, 'get: check y' ); assert.strictEqual( a.z, 3, 'get: check z' ); assert.strictEqual( a.order, 'ZYX', 'get: check order' ); assert.verifySteps( Array( 4 ).fill( 'set: onChange called' ) ); } ); QUnit.test( 'clone/copy, check callbacks', ( assert ) => { var a = new Euler( 1, 2, 3, 'ZXY' ); var b = new Euler( 4, 5, 6, 'XZY' ); var cbSucceed = function () { assert.ok( true ); assert.step( 'onChange called' ); }; var cbFail = function () { assert.ok( false ); }; a._onChange( cbFail ); b._onChange( cbFail ); // clone doesn't trigger onChange a = b.clone(); assert.ok( a.equals( b ), 'clone: check if a equals b' ); // copy triggers onChange once a = new Euler( 1, 2, 3, 'ZXY' ); a._onChange( cbSucceed ); a.copy( b ); assert.ok( a.equals( b ), 'copy: check if a equals b' ); assert.verifySteps( [ 'onChange called' ] ); } ); QUnit.test( 'toArray', ( assert ) => { var order = 'YXZ'; var a = new Euler( x, y, z, order ); var array = a.toArray(); assert.strictEqual( array[ 0 ], x, 'No array, no offset: check x' ); assert.strictEqual( array[ 1 ], y, 'No array, no offset: check y' ); assert.strictEqual( array[ 2 ], z, 'No array, no offset: check z' ); assert.strictEqual( array[ 3 ], order, 'No array, no offset: check order' ); var array = []; a.toArray( array ); assert.strictEqual( array[ 0 ], x, 'With array, no offset: check x' ); assert.strictEqual( array[ 1 ], y, 'With array, no offset: check y' ); assert.strictEqual( array[ 2 ], z, 'With array, no offset: check z' ); assert.strictEqual( array[ 3 ], order, 'With array, no offset: check order' ); var array = []; a.toArray( array, 1 ); assert.strictEqual( array[ 0 ], undefined, 'With array and offset: check [0]' ); assert.strictEqual( array[ 1 ], x, 'With array and offset: check x' ); assert.strictEqual( array[ 2 ], y, 'With array and offset: check y' ); assert.strictEqual( array[ 3 ], z, 'With array and offset: check z' ); assert.strictEqual( array[ 4 ], order, 'With array and offset: check order' ); } ); QUnit.test( 'fromArray', ( assert ) => { var a = new Euler(); var array = [ x, y, z ]; var cb = function () { assert.step( 'onChange called' ); }; a._onChange( cb ); a.fromArray( array ); assert.strictEqual( a.x, x, 'No order: check x' ); assert.strictEqual( a.y, y, 'No order: check y' ); assert.strictEqual( a.z, z, 'No order: check z' ); assert.strictEqual( a.order, 'XYZ', 'No order: check order' ); a = new Euler(); array = [ x, y, z, 'ZXY' ]; a._onChange( cb ); a.fromArray( array ); assert.strictEqual( a.x, x, 'With order: check x' ); assert.strictEqual( a.y, y, 'With order: check y' ); assert.strictEqual( a.z, z, 'With order: check z' ); assert.strictEqual( a.order, 'ZXY', 'With order: check order' ); assert.verifySteps( Array( 2 ).fill( 'onChange called' ) ); } ); QUnit.test( '_onChange', ( assert ) => { var f = function () { }; var a = new Euler( 11, 12, 13, 'XYZ' ); a._onChange( f ); assert.ok( a._onChangeCallback === f, 'Passed!' ); } ); QUnit.test( '_onChangeCallback', ( assert ) => { var b = false; var a = new Euler( 11, 12, 13, 'XYZ' ); var f = function () { b = true; assert.ok( a === this, 'Passed!' ); }; a._onChangeCallback = f; assert.ok( a._onChangeCallback === f, 'Passed!' ); a._onChangeCallback(); assert.ok( b, 'Passed!' ); } ); } ); } );
looeee/three.js
test/unit/src/math/Euler.tests.js
JavaScript
mit
10,298
/* Controls email settings for user Profile */ angular.module('collabjs.controllers') .controller('EmailController', ['$scope', 'accountService', function ($scope, accountService) { 'use strict'; $scope.error = false; $scope.info = false; $scope.dismissError = function () { $scope.error = false; }; $scope.dismissInfo = function () { $scope.info = false; }; $scope.oldEmail = ''; $scope.newEmail = ''; $scope.confirmEmail = ''; $scope.errInvalidValues = 'Incorrect email values.'; $scope.errConfirmation = 'Email confirmation must match value above.'; $scope.errSameEmail = 'New email is the same as old one.'; $scope.msgSuccess = 'Email has been successfully changed.'; $scope.init = function () { accountService.getAccount().then(function (account) { $scope.oldEmail = account.email; }); }; $scope.submit = function () { $scope.error = false; if (!$scope.oldEmail || !$scope.newEmail || !$scope.confirmEmail) { $scope.error = $scope.errInvalidValues; return; } if ($scope.confirmEmail !== $scope.newEmail) { $scope.error = $scope.errConfirmation; return; } if ($scope.newEmail === $scope.oldEmail) { $scope.error = $scope.errSameEmail; return; } accountService .changeEmail($scope.oldEmail, $scope.newEmail) .then( // success handler function () { $scope.info = $scope.msgSuccess; $scope.oldEmail = $scope.newEmail; $scope.newEmail = ''; $scope.confirmEmail = ''; }, // error handler function (err) { $scope.error = 'Error: ' + err; $scope.newEmail = ''; $scope.confirmEmail = ''; } ); }; }]);
lvnhmd/collab.js
public/js/controllers/EmailController.js
JavaScript
mit
1,963
function Cli(argv) { var Cucumber = require('../cucumber'); var Command = require('commander').Command; var path = require('path'); function collect(val, memo) { memo.push(val); return memo; } function getProgram () { var program = new Command(path.basename(argv[1])); program .usage('[options] [<DIR|FILE[:LINE]>...]') .version(Cucumber.VERSION, '-v, --version') .option('-b, --backtrace', 'show full backtrace for errors') .option('--compiler <EXTENSION:MODULE>', 'require files with the given EXTENSION after requiring MODULE (repeatable)', collect, []) .option('-d, --dry-run', 'invoke formatters without executing steps') .option('--fail-fast', 'abort the run on first failure') .option('-f, --format <TYPE[:PATH]>', 'specify the output format, optionally supply PATH to redirect formatter output (repeatable)', collect, ['pretty']) .option('--name <REGEXP>', 'only execute the scenarios with name matching the expression (repeatable)', collect, []) .option('--no-colors', 'disable colors in formatter output') .option('-p, --profile <NAME>', 'specify the profile to use (repeatable)', collect, []) .option('-r, --require <FILE|DIR>', 'require files before executing features (repeatable)', collect, []) .option('--snippet-syntax <FILE>', 'specify a custom snippet syntax') .option('-S, --strict', 'fail if there are any undefined or pending steps') .option('-t, --tags <EXPRESSION>', 'only execute the features or scenarios with tags matching the expression (repeatable)', collect, []); program.on('--help', function(){ console.log(' For more details please visit https://github.com/cucumber/cucumber-js#cli\n'); }); return program; } function getConfiguration() { var program = getProgram(); program.parse(argv); var profileArgs = Cucumber.Cli.ProfilesLoader.getArgs(program.profile); if (profileArgs.length > 0) { var fullArgs = argv.slice(0, 2).concat(profileArgs).concat(argv.slice(2)); program = getProgram(); program.parse(fullArgs); } var configuration = Cucumber.Cli.Configuration(program.opts(), program.args); return configuration; } var self = { run: function run(callback) { var configuration = getConfiguration(); var runtime = Cucumber.Runtime(configuration); var formatters = configuration.getFormatters(); formatters.forEach(function (formatter) { runtime.attachListener(formatter); }); runtime.start(callback); } }; return self; } Cli.Configuration = require('./cli/configuration'); Cli.FeaturePathExpander = require('./cli/feature_path_expander'); Cli.FeatureSourceLoader = require('./cli/feature_source_loader'); Cli.PathExpander = require('./cli/path_expander'); Cli.ProfilesLoader = require('./cli/profiles_loader'); Cli.SupportCodeLoader = require('./cli/support_code_loader'); Cli.SupportCodePathExpander = require('./cli/support_code_path_expander'); module.exports = Cli;
deep0892/jitendrachatbot
node_modules/chimp/node_modules/cucumber/lib/cucumber/cli.js
JavaScript
mit
3,056
{ "translatorID": "db0f4858-10fa-4f76-976c-2592c95f029c", "label": "Internet Archive", "creator": "Adam Crymble, Sebastian Karcher", "target": "^https?://(www\\.)?archive\\.org/", "minVersion": "3.0", "maxVersion": "", "priority": 100, "inRepository": true, "translatorType": 4, "browserSupport": "gcsibv", "lastUpdated": "2020-07-16 13:38:10" } /* ***** BEGIN LICENSE BLOCK ***** Mango Library Translator Copyright © 2017 Adam Crymble and Sebastian Karcher This file is part of Zotero. Zotero is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Zotero is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Zotero. If not, see <http://www.gnu.org/licenses/>. ***** END LICENSE BLOCK ***** */ function detectWeb(doc, url) { var icon = ZU.xpathText(doc, '//div[@class="left-icon"]/span[contains(@class, "iconochive")]/@class'); if (icon) { if (icon.includes("texts")) { return "book"; } else if (icon.includes("movies")) { return "film"; } else if (icon.includes("audio")) { return "audioRecording"; } else if (icon.includes("etree")) { return "audioRecording"; } else if (icon.includes("software")) { return "computerProgram"; } else if (icon.includes("image")) { return "artwork"; } else if (icon.includes("tv")) { return "tvBroadcast"; } else { Z.debug("Unknown Item Type: " + icon); } } else if (url.includes('/stream/')) { return "book"; } else if (getSearchResults(doc, url, true)) { return "multiple"; } return false; } var typemap = { texts: "book", movies: "film", image: "artwork", audio: "audioRecording", etree: "audioRecording", software: "computerProgram" }; function test(data) { var clean = data ? data[0] : undefined; return clean; } function getSearchResults(doc, checkOnly) { var items = {}; var found = false; var rows = ZU.xpath(doc, '//div[@class="results"]//div[contains(@class, "item-ttl")]//a[@href]'); for (var i = 0; i < rows.length; i++) { var href = rows[i].href; var title = ZU.trimInternal(rows[i].textContent); if (!href || !title) continue; if (checkOnly) return true; found = true; items[href] = title; } return found ? items : false; } function scrape(doc, url) { // maximum PDF size to be downloaded. default to 10 MB var prefMaxPdfSizeMB = 10; var pdfurl = ZU.xpathText(doc, '//div[contains(@class, "thats-right")]/div/div/a[contains(text(), "PDF") and not(contains(text(), "B/W"))]/@href'); var pdfSize = ZU.xpathText(doc, '//div[contains(@class, "thats-right")]/div/div/a[contains(text(), "PDF") and not(contains(text(), "B/W"))]/@data-original-title'); var canonicalurl = ZU.xpathText(doc, '//link[@rel="canonical"]/@href'); var apiurl; if (canonicalurl) { apiurl = canonicalurl + "&output=json"; // alternative is // var apiurl = url.replace('/details/', '/metadata/').replace('/stream/', '/metadata/'); } else { apiurl = url.replace('/stream/', '/details/').replace(/#.*$/, '') + "&output=json"; } ZU.doGet(apiurl, function (text) { try { var obj = JSON.parse(text).metadata; } catch (e) { Zotero.debug("JSON parse error"); throw e; } var type = obj.mediatype[0]; var itemType = typemap[type] || "document"; if (type == "movies" && obj.collection.includes("tvarchive")) { itemType = "tvBroadcast"; } var newItem = new Zotero.Item(itemType); newItem.title = obj.title[0]; var creators = obj.creator; var i; if (creators) { // sometimes authors are in one field delimiter by ; if (creators && creators[0].match(/;/)) { creators = creators[0].split(/\s*;\s*/); } for (i = 0; i < creators.length; i++) { // authors are lastname, firstname, additional info - only use the first two. var author = creators[i].replace(/(,[^,]+)(,.+)/, "$1"); if (author.includes(',')) { newItem.creators.push(ZU.cleanAuthor(author, "author", true)); } else { newItem.creators.push({ lastName: author, creatorType: "author", fieldMode: 1 }); } } } var contributors = obj.contributor; if (contributors) { for (i = 0; i < contributors.length; i++) { // authors are lastname, firstname, additional info - only use the first two. var contributor = contributors[i].replace(/(,[^,]+)(,.+)/, "$1"); if (contributor.includes(',')) { newItem.creators.push(ZU.cleanAuthor(contributor, "contributor", true)); } else { newItem.creators.push({ lastName: contributor, creatorType: "contributor", fieldMode: 1 }); } } } for (i = 0; i < newItem.creators.length; i++) { if (!newItem.creators[i].firstName) { newItem.creators[i].fieldMode = 1; } } // abstracts can be in multiple fields; if (obj.description) newItem.abstractNote = ZU.cleanTags(obj.description.join("; ")); var date = obj.date || obj.year; var tags = test(obj.subject); if (tags) { tags = tags.split(/\s*;\s*/); for (i = 0; i < tags.length; i++) { newItem.tags.push(tags[i]); } } // download PDFs; We're being conservative here, only downloading if we understand the filesize if (pdfurl && pdfSize && parseFloat(pdfSize)) { // calculate file size in MB var pdfSizeMB; if (pdfSize.includes("M")) { pdfSizeMB = parseFloat(pdfSize); } else if (pdfSize.includes("K")) { pdfSizeMB = parseFloat(pdfSize) / 1000; } else if (pdfSize.includes("G")) { pdfSizeMB = parseFloat(pdfSize) * 1000; } Z.debug(pdfSizeMB); if (pdfSizeMB < prefMaxPdfSizeMB) { newItem.attachments.push({ url: pdfurl, title: "Internet Archive Fulltext PDF", mimeType: "application/pdf" }); } } newItem.date = test(date); newItem.medium = test(obj.medium); newItem.publisher = test(obj.publisher); newItem.language = test(obj.language); newItem.callNumber = test(obj.call_number); newItem.numPages = test(obj.imagecount); newItem.runningTime = test(obj.runtime); newItem.rights = test(obj.licenseurl); if (!newItem.rights) newItem.rights = test(obj.rights); if (Array.isArray(obj.isbn) && obj.isbn.length > 0) newItem.ISBN = (obj.isbn).join(' '); newItem.url = "http://archive.org/details/" + test(obj.identifier); newItem.complete(); }); } function doWeb(doc, url) { if (detectWeb(doc, url) == "multiple") { Zotero.selectItems(getSearchResults(doc, false), function (items) { if (!items) { return; } var articles = []; for (var i in items) { articles.push(i); } ZU.processDocuments(articles, scrape); }); } else { scrape(doc, url); } } /** BEGIN TEST CASES **/ var testCases = [ { "type": "web", "url": "https://archive.org/details/gullshornbookstu00dekk", "items": [ { "itemType": "book", "title": "The gull's hornbook : Stultorum plena sunt omnia. Al savio mezza parola basta", "creators": [ { "firstName": "Thomas", "lastName": "Dekker", "creatorType": "author" }, { "firstName": "John", "lastName": "Nott", "creatorType": "author" }, { "lastName": "University of Pittsburgh Library System", "creatorType": "contributor", "fieldMode": 1 } ], "date": "1812", "abstractNote": "Notes by John Nott; Bibliography of Dekker: p. iii-ix", "callNumber": "31735060398496", "language": "eng", "libraryCatalog": "Internet Archive", "numPages": "228", "publisher": "Bristol, Reprinted for J.M. Gutch and Sold in London by R. Baldwin, and R. Triphook", "shortTitle": "The gull's hornbook", "url": "http://archive.org/details/gullshornbookstu00dekk", "tags": [], "notes": [], "seeAlso": [], "attachments": [] } ] }, { "type": "web", "url": "https://archive.org/details/darktowersdeutsc0000enri/mode/2up", "items": [ { "itemType":"book", "creators":[ { "firstName":"David", "lastName":"Enrich", "creatorType":"author" }, { "lastName":"Internet Archive", "creatorType":"contributor", "fieldMode": 1 } ], "tags":[ { "tag":"Trump, Donald, 1946-" } ], "title":"Dark towers : Deutsche Bank, Donald Trump, and an epic trail of destruction", "abstractNote":"x, 402 pages ; 24 cm; \"A searing exposé by an award-winning journalist of the most scandalous bank in the world, including its shadowy ties to Donald Trump's business empire\"--; Includes bibliographical references (pages 367-390) and index; \"A searing expose by an award-winning journalist of the most scandalous bank in the world, including its shadowy ties to Donald Trump's business empire\"--", "date":"2020", "publisher":"New York, NY : Custom House", "language":"eng", "numPages":"426", "ISBN":"9780062878816 9780062878830", "url":"http://archive.org/details/darktowersdeutsc0000enri", "libraryCatalog":"Internet Archive", "shortTitle":"Dark towers", "notes": [], "seeAlso": [], "attachments": [] } ] }, { "type": "web", "url": "http://www.archive.org/search.php?query=cervantes%20AND%20mediatype%3Atexts", "items": "multiple" }, { "type": "web", "url": "http://archive.org/details/Allen_Ginsberg__Anne_Waldman__Steven_Tay_89P046", "items": [ { "itemType": "audioRecording", "title": "Allen Ginsberg, Anne Waldman, Steven Taylor and Bobbi Louise Hawkins performance, July, 1989.", "creators": [ { "firstName": "Allen", "lastName": "Ginsberg", "creatorType": "author" }, { "firstName": "Bobbie Louise", "lastName": "Hawkins", "creatorType": "author" }, { "firstName": "Steven", "lastName": "Taylor", "creatorType": "author" }, { "firstName": "Anne", "lastName": "Waldman", "creatorType": "author" } ], "date": "1989-07-08 00:00:00", "abstractNote": "Second half of a reading with Allen Ginsberg, Bobbie Louise Hawkins, Anne Waldman, and Steven Taylor. This portion of the reading features Waldman and Ginsberg. (Continued from 89P045)", "accessDate": "CURRENT_TIMESTAMP", "libraryCatalog": "Internet Archive", "publisher": "Jack Kerouac School of Disembodied Poetics", "rights": "http://creativecommons.org/licenses/by-nd-nc/1.0/", "runningTime": "1:30:05", "url": "http://archive.org/details/Allen_Ginsberg__Anne_Waldman__Steven_Tay_89P046", "attachments": [], "tags": [], "notes": [], "seeAlso": [] } ] }, { "type": "web", "url": "http://archive.org/details/AboutBan1935", "items": [ { "itemType": "film", "title": "About Bananas", "creators": [ { "lastName": "Castle Films", "creatorType": "author", "fieldMode": 1 } ], "date": "1935", "abstractNote": "Complete presentation of the banana industry from the clearing of the jungle and the planting to the shipment of the fruit to the American markets.", "accessDate": "CURRENT_TIMESTAMP", "libraryCatalog": "Internet Archive", "rights": "http://creativecommons.org/licenses/publicdomain/", "runningTime": "11:03", "url": "http://archive.org/details/AboutBan1935", "attachments": [], "tags": [ "Agriculture: Bananas", "Central America" ], "notes": [], "seeAlso": [] } ] }, { "type": "web", "url": "https://archive.org/details/msdos_Oregon_Trail_The_1990", "items": [ { "itemType": "computerProgram", "title": "Oregon Trail, The", "creators": [ { "lastName": "MECC", "creatorType": "author", "fieldMode": 1 } ], "date": "1990", "abstractNote": "Also For\nApple II, Macintosh, Windows, Windows 3.x\nDeveloped by\nMECC\nPublished by\nMECC\nReleased\n1990\n\n\nPacing\nReal-Time\nPerspective\nBird's-eye view, Side view, Text-based / Spreadsheet, Top-down\nEducational\nGeography, History\nGenre\nEducational, Simulation\nSetting\nWestern\nInterface\nText Parser\nGameplay\nManagerial / Business Simulation\nVisual\nFixed / Flip-screen\n\n\nDescription\n\nAs a covered wagon party of pioneers, you head out west from Independence, Missouri to the Willamette River and valley in Oregon. You first must stock up on provisions, and then, while traveling, make decisions such as when to rest, how much food to eat, etc. The Oregon Trail incorporates simulation elements and planning ahead, along with discovery and adventure, as well as mini-game-like activities (hunting and floating down the Dalles River).\n\nFrom Mobygames.com. Original Entry", "libraryCatalog": "Internet Archive", "url": "http://archive.org/details/msdos_Oregon_Trail_The_1990", "attachments": [], "tags": [], "notes": [], "seeAlso": [] } ] }, { "type": "web", "url": "https://archive.org/details/mma_albert_einstein_pasadena_270713", "items": [ { "itemType": "artwork", "title": "Albert Einstein, Pasadena", "creators": [], "date": "1931", "artworkMedium": "Gelatin silver print", "libraryCatalog": "Internet Archive", "rights": "<a href=\"http://www.metmuseum.org/information/terms-and-conditions\" rel=\"nofollow\">Metropolitan Museum of Art Terms and Conditions</a>", "url": "http://archive.org/details/mma_albert_einstein_pasadena_270713", "attachments": [], "tags": [ "Photographs" ], "notes": [], "seeAlso": [] } ] }, { "type": "web", "url": "https://archive.org/stream/siopsecretusplan0000prin#page/n85/mode/2up", "items": [ { "itemType": "book", "title": "SIOP, the secret U.S. plan for nuclear war", "creators": [ { "firstName": "Peter", "lastName": "Pringle", "creatorType": "author" }, { "lastName": "Internet Archive", "creatorType": "contributor", "fieldMode": 1 } ], "date": "1983", "abstractNote": "Bibliography: p. 263-277; Includes index", "language": "eng", "libraryCatalog": "Internet Archive", "numPages": "298", "publisher": "New York : Norton", "url": "http://archive.org/details/siopsecretusplan0000prin", "attachments": [], "tags": [ "Nuclear warfare" ], "notes": [], "seeAlso": [], "ISBN": "9780393017984" } ] }, { "type": "web", "url": "https://archive.org/details/MSNBCW_20170114_020000_The_Rachel_Maddow_Show/start/60/end/120", "items": [ { "itemType": "tvBroadcast", "title": "The Rachel Maddow Show : MSNBCW : January 13, 2017 6:00pm-7:01pm PST", "creators": [ { "lastName": "MSNBCW", "creatorType": "contributor", "fieldMode": 1 } ], "date": "2017-01-14", "abstractNote": "Rachel Maddow takes a look at the day's top political news stories.", "language": "eng", "libraryCatalog": "Internet Archive", "runningTime": "01:01:00", "shortTitle": "The Rachel Maddow Show", "url": "http://archive.org/details/MSNBCW_20170114_020000_The_Rachel_Maddow_Show", "attachments": [], "tags": [ "amd", "atlas", "backups", "bernie sanders", "breo", "britain", "charleston", "chuck schumer", "chuck todd", "cialis", "clinton", "comcast business", "directv", "donald trump", "donald trump jr.", "downy fabric conditioner", "fbi", "geico", "james comey", "john lewis", "london", "michael beschloss", "moscow", "nancy pelosi", "nbc news", "obama", "oregon", "osteo bi-flex", "rachel", "rachel maddow", "richard nixon", "russia", "south carolina", "south carolina", "titan atlas", "washington", "waterloo" ], "notes": [], "seeAlso": [] } ] } ] /** END TEST CASES **/
retorquere/zotero-better-bibtex
test/fixtures/profile/zotero/zotero/translators/Internet Archive.js
JavaScript
mit
16,222
'use strict'; /* https://github.com/angular/protractor/blob/master/docs/toc.md */ describe('my app', function() { it('should automatically redirect to /restaurantList when location hash/fragment is empty', function() { browser.get('index.html'); expect(browser.getLocationAbsUrl()).toMatch("/restaurantList"); }); describe('restaurantList', function() { beforeEach(function() { browser.get('index.html#/restaurantList'); }); it('should render restaurantList when user navigates to /restaurantList', function() { expect(element.all(by.css('[ng-view] p')).first().getText()). toMatch(/partial for view 1/); }); }); describe('timer', function() { beforeEach(function() { browser.get('index.html#/timer'); }); it('should render timer when user navigates to /timer', function() { expect(element.all(by.css('[ng-view] p')).first().getText()). toMatch(/partial for view 2/); }); }); describe('restaurantAdd', function() { beforeEach(function() { browser.get('index.html#/restaurantAdd'); }); it('should render restaurantAdd when user navigates to /restaurantAdd', function() { expect(element.all(by.css('[ng-view] p')).first().getText()). toMatch(/partial for view 3/); }); }); });
kajas90/foodBoard
e2e-tests/scenarios.js
JavaScript
mit
1,329
module.exports = function array_intersect_ukey (arr1) { // eslint-disable-line camelcase // discuss at: https://locutus.io/php/array_intersect_ukey/ // original by: Brett Zamir (https://brett-zamir.me) // example 1: var $array1 = {blue: 1, red: 2, green: 3, purple: 4} // example 1: var $array2 = {green: 5, blue: 6, yellow: 7, cyan: 8} // example 1: array_intersect_ukey ($array1, $array2, function (key1, key2){ return (key1 === key2 ? 0 : (key1 > key2 ? 1 : -1)); }) // returns 1: {blue: 1, green: 3} var retArr = {} var arglm1 = arguments.length - 1 var arglm2 = arglm1 - 1 var cb = arguments[arglm1] // var cb0 = arguments[arglm2] var k1 = '' var i = 1 var k = '' var arr = {} var $global = (typeof window !== 'undefined' ? window : global) cb = (typeof cb === 'string') ? $global[cb] : (Object.prototype.toString.call(cb) === '[object Array]') ? $global[cb[0]][cb[1]] : cb // cb0 = (typeof cb0 === 'string') // ? $global[cb0] // : (Object.prototype.toString.call(cb0) === '[object Array]') // ? $global[cb0[0]][cb0[1]] // : cb0 arr1keys: for (k1 in arr1) { // eslint-disable-line no-labels arrs: for (i = 1; i < arglm1; i++) { // eslint-disable-line no-labels arr = arguments[i] for (k in arr) { if (cb(k, k1) === 0) { if (i === arglm2) { retArr[k1] = arr1[k1] } // If the innermost loop always leads at least once to an equal value, // continue the loop until done continue arrs // eslint-disable-line no-labels } } // If it reaches here, it wasn't found in at least one array, so try next value continue arr1keys // eslint-disable-line no-labels } } return retArr }
kvz/phpjs
src/php/array/array_intersect_ukey.js
JavaScript
mit
1,787
const detachHook = require('../sugar').detachHook; const dropCache = require('../sugar').dropCache; suite('api/camelCase', () => { suite('-> `true`', () => { test('should add camel case keys in token', () => { const tokens = require('./fixture/bem.css'); assert.deepEqual(tokens, { blockElementModifier: '_test_api_fixture_bem__block__element--modifier', 'block__element--modifier': '_test_api_fixture_bem__block__element--modifier', }); }); setup(() => hook({ camelCase: true })); teardown(() => { detachHook('.css'); dropCache('./api/fixture/bem.css'); }); }); suite('-> `dashesOnly`', () => { test('should replace keys with dashes by its camel-cased equivalent', () => { const tokens = require('./fixture/bem.css'); assert.deepEqual(tokens, { 'block__elementModifier': '_test_api_fixture_bem__block__element--modifier', }); }); setup(() => hook({camelCase: 'dashesOnly'})); teardown(() => { detachHook('.css'); dropCache('./api/fixture/bem.css'); }); }); });
css-modules/css-modules-require-hook
test/api/camelCase.js
JavaScript
mit
1,100
var secrets = require('../config/secrets'); var querystring = require('querystring'); var validator = require('validator'); var async = require('async'); var cheerio = require('cheerio'); var request = require('request'); var graph = require('fbgraph'); var LastFmNode = require('lastfm').LastFmNode; var tumblr = require('tumblr.js'); var foursquare = require('node-foursquare')({ secrets: secrets.foursquare }); var Github = require('github-api'); var Twit = require('twit'); var stripe = require('stripe')(secrets.stripe.secretKey); var twilio = require('twilio')(secrets.twilio.sid, secrets.twilio.token); var Linkedin = require('node-linkedin')(secrets.linkedin.clientID, secrets.linkedin.clientSecret, secrets.linkedin.callbackURL); var BitGo = require('bitgo'); var clockwork = require('clockwork')({ key: secrets.clockwork.apiKey }); var paypal = require('paypal-rest-sdk'); var lob = require('lob')(secrets.lob.apiKey); var ig = require('instagram-node').instagram(); var Y = require('yui/yql'); var _ = require('lodash'); var Bitcore = require('bitcore'); var BitcoreInsight = require('bitcore-explorers').Insight; Bitcore.Networks.defaultNetwork = secrets.bitcore.bitcoinNetwork == 'testnet' ? Bitcore.Networks.testnet : Bitcore.Networks.mainnet; /** * GET /api * List of API examples. */ exports.getApi = function(req, res) { res.render('api/index', { title: 'API Examples' }); }; /** * GET /api/foursquare * Foursquare API example. */ exports.getFoursquare = function(req, res, next) { var token = _.find(req.user.tokens, { kind: 'foursquare' }); async.parallel({ trendingVenues: function(callback) { foursquare.Venues.getTrending('40.7222756', '-74.0022724', { limit: 50 }, token.accessToken, function(err, results) { callback(err, results); }); }, venueDetail: function(callback) { foursquare.Venues.getVenue('49da74aef964a5208b5e1fe3', token.accessToken, function(err, results) { callback(err, results); }); }, userCheckins: function(callback) { foursquare.Users.getCheckins('self', null, token.accessToken, function(err, results) { callback(err, results); }); } }, function(err, results) { if (err) return next(err); res.render('api/foursquare', { title: 'Foursquare API', trendingVenues: results.trendingVenues, venueDetail: results.venueDetail, userCheckins: results.userCheckins }); }); }; /** * GET /api/tumblr * Tumblr API example. */ exports.getTumblr = function(req, res, next) { var token = _.find(req.user.tokens, { kind: 'tumblr' }); var client = tumblr.createClient({ consumer_key: secrets.tumblr.consumerKey, consumer_secret: secrets.tumblr.consumerSecret, token: token.accessToken, token_secret: token.tokenSecret }); client.posts('withinthisnightmare.tumblr.com', { type: 'photo' }, function(err, data) { if (err) return next(err); res.render('api/tumblr', { title: 'Tumblr API', blog: data.blog, photoset: data.posts[0].photos }); }); }; /** * GET /api/facebook * Facebook API example. */ exports.getFacebook = function(req, res, next) { var token = _.find(req.user.tokens, { kind: 'facebook' }); graph.setAccessToken(token.accessToken); async.parallel({ getMe: function(done) { graph.get(req.user.facebook, function(err, me) { done(err, me); }); }, getMyFriends: function(done) { graph.get(req.user.facebook + '/friends', function(err, friends) { done(err, friends.data); }); } }, function(err, results) { if (err) return next(err); res.render('api/facebook', { title: 'Facebook API', me: results.getMe, friends: results.getMyFriends }); }); }; /** * GET /api/scraping * Web scraping example using Cheerio library. */ exports.getScraping = function(req, res, next) { request.get('https://news.ycombinator.com/', function(err, request, body) { if (err) return next(err); var $ = cheerio.load(body); var links = []; $('.title a[href^="http"], a[href^="https"]').each(function() { links.push($(this)); }); res.render('api/scraping', { title: 'Web Scraping', links: links }); }); }; /** * GET /api/github * GitHub API Example. */ exports.getGithub = function(req, res, next) { var token = _.find(req.user.tokens, { kind: 'github' }); var github = new Github({ token: token.accessToken }); var repo = github.getRepo('sahat', 'requirejs-library'); repo.show(function(err, repo) { if (err) return next(err); res.render('api/github', { title: 'GitHub API', repo: repo }); }); }; /** * GET /api/aviary * Aviary image processing example. */ exports.getAviary = function(req, res) { res.render('api/aviary', { title: 'Aviary API' }); }; /** * GET /api/nyt * New York Times API example. */ exports.getNewYorkTimes = function(req, res, next) { var query = querystring.stringify({ 'api-key': secrets.nyt.key, 'list-name': 'young-adult' }); var url = 'http://api.nytimes.com/svc/books/v2/lists?' + query; request.get(url, function(err, request, body) { if (err) return next(err); if (request.statusCode === 403) return next(Error('Missing or Invalid New York Times API Key')); var bestsellers = JSON.parse(body); res.render('api/nyt', { title: 'New York Times API', books: bestsellers.results }); }); }; /** * GET /api/lastfm * Last.fm API example. */ exports.getLastfm = function(req, res, next) { var lastfm = new LastFmNode(secrets.lastfm); async.parallel({ artistInfo: function(done) { lastfm.request('artist.getInfo', { artist: 'The Pierces', handlers: { success: function(data) { done(null, data); }, error: function(err) { done(err); } } }); }, artistTopTracks: function(done) { lastfm.request('artist.getTopTracks', { artist: 'The Pierces', handlers: { success: function(data) { var tracks = []; _.each(data.toptracks.track, function(track) { tracks.push(track); }); done(null, tracks.slice(0,10)); }, error: function(err) { done(err); } } }); }, artistTopAlbums: function(done) { lastfm.request('artist.getTopAlbums', { artist: 'The Pierces', handlers: { success: function(data) { var albums = []; _.each(data.topalbums.album, function(album) { albums.push(album.image.slice(-1)[0]['#text']); }); done(null, albums.slice(0, 4)); }, error: function(err) { done(err); } } }); } }, function(err, results) { if (err) return next(err.message); var artist = { name: results.artistInfo.artist.name, image: results.artistInfo.artist.image.slice(-1)[0]['#text'], tags: results.artistInfo.artist.tags.tag, bio: results.artistInfo.artist.bio.summary, stats: results.artistInfo.artist.stats, similar: results.artistInfo.artist.similar.artist, topAlbums: results.artistTopAlbums, topTracks: results.artistTopTracks }; res.render('api/lastfm', { title: 'Last.fm API', artist: artist }); }); }; /** * GET /api/twitter * Twiter API example. */ exports.getTwitter = function(req, res, next) { var token = _.find(req.user.tokens, { kind: 'twitter' }); var T = new Twit({ consumer_key: secrets.twitter.consumerKey, consumer_secret: secrets.twitter.consumerSecret, access_token: token.accessToken, access_token_secret: token.tokenSecret }); T.get('search/tweets', { q: 'nodejs since:2013-01-01', geocode: '40.71448,-74.00598,5mi', count: 10 }, function(err, reply) { if (err) return next(err); res.render('api/twitter', { title: 'Twitter API', tweets: reply.statuses }); }); }; /** * POST /api/twitter * Post a tweet. */ exports.postTwitter = function(req, res, next) { req.assert('tweet', 'Tweet cannot be empty.').notEmpty(); var errors = req.validationErrors(); if (errors) { req.flash('errors', errors); return res.redirect('/api/twitter'); } var token = _.find(req.user.tokens, { kind: 'twitter' }); var T = new Twit({ consumer_key: secrets.twitter.consumerKey, consumer_secret: secrets.twitter.consumerSecret, access_token: token.accessToken, access_token_secret: token.tokenSecret }); T.post('statuses/update', { status: req.body.tweet }, function(err, data, response) { if (err) return next(err); req.flash('success', { msg: 'Tweet has been posted.'}); res.redirect('/api/twitter'); }); }; /** * GET /api/steam * Steam API example. */ exports.getSteam = function(req, res, next) { var steamId = '76561197982488301'; var query = { l: 'english', steamid: steamId, key: secrets.steam.apiKey }; async.parallel({ playerAchievements: function(done) { query.appid = '49520'; var qs = querystring.stringify(query); request.get({ url: 'http://api.steampowered.com/ISteamUserStats/GetPlayerAchievements/v0001/?' + qs, json: true }, function(error, request, body) { if (request.statusCode === 401) return done(new Error('Missing or Invalid Steam API Key')); done(error, body); }); }, playerSummaries: function(done) { query.steamids = steamId; var qs = querystring.stringify(query); request.get({ url: 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?' + qs, json: true }, function(err, request, body) { if (request.statusCode === 401) return done(new Error('Missing or Invalid Steam API Key')); done(err, body); }); }, ownedGames: function(done) { query.include_appinfo = 1; query.include_played_free_games = 1; var qs = querystring.stringify(query); request.get({ url: 'http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?' + qs, json: true }, function(err, request, body) { if (request.statusCode === 401) return done(new Error('Missing or Invalid Steam API Key')); done(err, body); }); } }, function(err, results) { if (err) return next(err); res.render('api/steam', { title: 'Steam Web API', ownedGames: results.ownedGames.response.games, playerAchievemments: results.playerAchievements.playerstats, playerSummary: results.playerSummaries.response.players[0] }); }); }; /** * GET /api/stripe * Stripe API example. */ exports.getStripe = function(req, res) { res.render('api/stripe', { title: 'Stripe API', publishableKey: secrets.stripe.publishableKey }); }; /** * POST /api/stripe * Make a payment. */ exports.postStripe = function(req, res, next) { var stripeToken = req.body.stripeToken; var stripeEmail = req.body.stripeEmail; stripe.charges.create({ amount: 395, currency: 'usd', source: stripeToken, description: stripeEmail }, function(err, charge) { if (err && err.type === 'StripeCardError') { req.flash('errors', { msg: 'Your card has been declined.' }); res.redirect('/api/stripe'); } req.flash('success', { msg: 'Your card has been charged successfully.' }); res.redirect('/api/stripe'); }); }; /** * GET /api/twilio * Twilio API example. */ exports.getTwilio = function(req, res) { res.render('api/twilio', { title: 'Twilio API' }); }; /** * POST /api/twilio * Send a text message using Twilio. */ exports.postTwilio = function(req, res, next) { req.assert('number', 'Phone number is required.').notEmpty(); req.assert('message', 'Message cannot be blank.').notEmpty(); var errors = req.validationErrors(); if (errors) { req.flash('errors', errors); return res.redirect('/api/twilio'); } var message = { to: req.body.number, from: '+13472235148', body: req.body.message }; twilio.sendMessage(message, function(err, responseData) { if (err) return next(err.message); req.flash('success', { msg: 'Text sent to ' + responseData.to + '.'}); res.redirect('/api/twilio'); }); }; /** * GET /api/clockwork * Clockwork SMS API example. */ exports.getClockwork = function(req, res) { res.render('api/clockwork', { title: 'Clockwork SMS API' }); }; /** * POST /api/clockwork * Send a text message using Clockwork SMS */ exports.postClockwork = function(req, res, next) { var message = { To: req.body.telephone, From: 'Hackathon', Content: 'Hello from the Hackathon Starter' }; clockwork.sendSms(message, function(err, responseData) { if (err) return next(err.errDesc); req.flash('success', { msg: 'Text sent to ' + responseData.responses[0].to }); res.redirect('/api/clockwork'); }); }; /** * GET /api/venmo * Venmo API example. */ exports.getVenmo = function(req, res, next) { var token = _.find(req.user.tokens, { kind: 'venmo' }); var query = querystring.stringify({ access_token: token.accessToken }); async.parallel({ getProfile: function(done) { request.get({ url: 'https://api.venmo.com/v1/me?' + query, json: true }, function(err, request, body) { done(err, body); }); }, getRecentPayments: function(done) { request.get({ url: 'https://api.venmo.com/v1/payments?' + query, json: true }, function(err, request, body) { done(err, body); }); } }, function(err, results) { if (err) return next(err); res.render('api/venmo', { title: 'Venmo API', profile: results.getProfile.data, recentPayments: results.getRecentPayments.data }); }); }; /** * POST /api/venmo * Send money. */ exports.postVenmo = function(req, res, next) { req.assert('user', 'Phone, Email or Venmo User ID cannot be blank').notEmpty(); req.assert('note', 'Please enter a message to accompany the payment').notEmpty(); req.assert('amount', 'The amount you want to pay cannot be blank').notEmpty(); var errors = req.validationErrors(); if (errors) { req.flash('errors', errors); return res.redirect('/api/venmo'); } var token = _.find(req.user.tokens, { kind: 'venmo' }); var formData = { access_token: token.accessToken, note: req.body.note, amount: req.body.amount }; if (validator.isEmail(req.body.user)) { formData.email = req.body.user; } else if (validator.isNumeric(req.body.user) && validator.isLength(req.body.user, 10, 11)) { formData.phone = req.body.user; } else { formData.user_id = req.body.user; } request.post('https://api.venmo.com/v1/payments', { form: formData }, function(err, request, body) { if (err) return next(err); if (request.statusCode !== 200) { req.flash('errors', { msg: JSON.parse(body).error.message }); return res.redirect('/api/venmo'); } req.flash('success', { msg: 'Venmo money transfer complete' }); res.redirect('/api/venmo'); }); }; /** * GET /api/linkedin * LinkedIn API example. */ exports.getLinkedin = function(req, res, next) { var token = _.find(req.user.tokens, { kind: 'linkedin' }); var linkedin = Linkedin.init(token.accessToken); linkedin.people.me(function(err, $in) { if (err) return next(err); res.render('api/linkedin', { title: 'LinkedIn API', profile: $in }); }); }; /** * GET /api/instagram * Instagram API example. */ exports.getInstagram = function(req, res, next) { var token = _.find(req.user.tokens, { kind: 'instagram' }); ig.use({ client_id: secrets.instagram.clientID, client_secret: secrets.instagram.clientSecret }); ig.use({ access_token: token.accessToken }); async.parallel({ searchByUsername: function(done) { ig.user_search('richellemead', function(err, users, limit) { done(err, users); }); }, searchByUserId: function(done) { ig.user('175948269', function(err, user) { done(err, user); }); }, popularImages: function(done) { ig.media_popular(function(err, medias) { done(err, medias); }); }, myRecentMedia: function(done) { ig.user_self_media_recent(function(err, medias, pagination, limit) { done(err, medias); }); } }, function(err, results) { if (err) return next(err); res.render('api/instagram', { title: 'Instagram API', usernames: results.searchByUsername, userById: results.searchByUserId, popularImages: results.popularImages, myRecentMedia: results.myRecentMedia }); }); }; /** * GET /api/yahoo * Yahoo API example. */ exports.getYahoo = function(req, res) { Y.YQL('SELECT * FROM weather.forecast WHERE (location = 10007)', function(response) { var location = response.query.results.channel.location; var condition = response.query.results.channel.item.condition; res.render('api/yahoo', { title: 'Yahoo API', location: location, condition: condition }); }); }; /** * GET /api/paypal * PayPal SDK example. */ exports.getPayPal = function(req, res, next) { paypal.configure({ mode: 'sandbox', client_id: secrets.paypal.client_id, client_secret: secrets.paypal.client_secret }); var paymentDetails = { intent: 'sale', payer: { payment_method: 'paypal' }, redirect_urls: { return_url: secrets.paypal.returnUrl, cancel_url: secrets.paypal.cancelUrl }, transactions: [{ description: 'Hackathon Starter', amount: { currency: 'USD', total: '1.99' } }] }; paypal.payment.create(paymentDetails, function(err, payment) { if (err) return next(err); req.session.paymentId = payment.id; var links = payment.links; for (var i = 0; i < links.length; i++) { if (links[i].rel === 'approval_url') { res.render('api/paypal', { approvalUrl: links[i].href }); } } }); }; /** * GET /api/paypal/success * PayPal SDK example. */ exports.getPayPalSuccess = function(req, res) { var paymentId = req.session.paymentId; var paymentDetails = { payer_id: req.query.PayerID }; paypal.payment.execute(paymentId, paymentDetails, function(err) { if (err) { res.render('api/paypal', { result: true, success: false }); } else { res.render('api/paypal', { result: true, success: true }); } }); }; /** * GET /api/paypal/cancel * PayPal SDK example. */ exports.getPayPalCancel = function(req, res) { req.session.paymentId = null; res.render('api/paypal', { result: true, canceled: true }); }; /** * GET /api/lob * Lob API example. */ exports.getLob = function(req, res, next) { lob.routes.list({ zip_codes: ['10007'] }, function(err, routes) { if(err) return next(err); res.render('api/lob', { title: 'Lob API', routes: routes.data[0].routes }); }); }; /** * GET /api/bitgo * BitGo wallet example */ exports.getBitGo = function(req, res, next) { var bitgo = new BitGo.BitGo({ env: 'test', accessToken: secrets.bitgo.accessToken }); var walletId = req.session.walletId; var renderWalletInfo = function(walletId) { bitgo.wallets().get({ id: walletId }, function(err, walletResponse) { walletResponse.createAddress({}, function(err, addressResponse) { walletResponse.transactions({}, function(err, transactionsResponse) { res.render('api/bitgo', { title: 'BitGo API', wallet: walletResponse.wallet, address: addressResponse.address, transactions: transactionsResponse.transactions }); }); }); }); }; if (walletId) { renderWalletInfo(walletId); } else { bitgo.wallets().createWalletWithKeychains({ passphrase: req.sessionID, // change this! label: 'wallet for session ' + req.sessionID, backupXpub: 'xpub6AHA9hZDN11k2ijHMeS5QqHx2KP9aMBRhTDqANMnwVtdyw2TDYRmF8PjpvwUFcL1Et8Hj59S3gTSMcUQ5gAqTz3Wd8EsMTmF3DChhqPQBnU' }, function(err, res) { req.session.walletId = res.wallet.wallet.id; renderWalletInfo(req.session.walletId); } ); } }; /** * POST /api/bitgo * BitGo send coins example */ exports.postBitGo = function(req, res, next) { var bitgo = new BitGo.BitGo({ env: 'test', accessToken: secrets.bitgo.accessToken }); var walletId = req.session.walletId; try { bitgo.wallets().get({ id: walletId }, function(err, wallet) { wallet.sendCoins({ address: req.body.address, amount: parseInt(req.body.amount), walletPassphrase: req.sessionID }, function(err, result) { if (err) { req.flash('errors', { msg: err.message }); return res.redirect('/api/bitgo'); } req.flash('info', { msg: 'txid: ' + result.hash + ', hex: ' + result.tx }); return res.redirect('/api/bitgo'); }); }); } catch (e) { req.flash('errors', { msg: e.message }); return res.redirect('/api/bitgo'); } }; /** * GET /api/bicore * Bitcore example */ exports.getBitcore = function(req, res, next) { try { var privateKey; if (req.session.bitcorePrivateKeyWIF) { privateKey = Bitcore.PrivateKey.fromWIF(req.session.bitcorePrivateKeyWIF); } else { privateKey = new Bitcore.PrivateKey(); req.session.bitcorePrivateKeyWIF = privateKey.toWIF(); req.flash('info', { msg: 'A new ' + secrets.bitcore.bitcoinNetwork + ' private key has been created for you and is stored in ' + 'req.session.bitcorePrivateKeyWIF. Unless you changed the Bitcoin network near the require bitcore line, ' + 'this is a testnet address.' }); } var myAddress = privateKey.toAddress(); var bitcoreUTXOAddress = ''; if (req.session.bitcoreUTXOAddress) bitcoreUTXOAddress = req.session.bitcoreUTXOAddress; res.render('api/bitcore', { title: 'Bitcore API', network: secrets.bitcore.bitcoinNetwork, address: myAddress, getUTXOAddress: bitcoreUTXOAddress }); } catch (e) { req.flash('errors', { msg: e.message }); return next(e); } }; /** * POST /api/bitcore * Bitcore send coins example */ exports.postBitcore = function(req, res, next) { try { var getUTXOAddress; if (req.body.address) { getUTXOAddress = req.body.address; req.session.bitcoreUTXOAddress = getUTXOAddress; } else if (req.session.bitcoreUTXOAddress) { getUTXOAddress = req.session.bitcoreUTXOAddress; } else { getUTXOAddress = ''; } var myAddress; if (req.session.bitcorePrivateKeyWIF) { myAddress = Bitcore.PrivateKey.fromWIF(req.session.bitcorePrivateKeyWIF).toAddress(); } else { myAddress = ''; } var insight = new BitcoreInsight(); insight.getUnspentUtxos(getUTXOAddress, function(err, utxos) { if (err) { req.flash('errors', { msg: err.message }); return next(err); } else { req.flash('info', { msg: 'UTXO information obtained from the Bitcoin network via Bitpay Insight. You can use your own full Bitcoin node.' }); // Results are in the form of an array of items which need to be turned into JS objects. for (var i = 0; i < utxos.length; ++i) { utxos[i] = utxos[i].toObject(); } res.render('api/bitcore', { title: 'Bitcore API', myAddress: myAddress, getUTXOAddress: getUTXOAddress, utxos: utxos, network: secrets.bitcore.bitcoinNetwork }); } }); } catch (e) { req.flash('errors', { msg: e.message }); return next(e); } };
patcullen/hsuehshan
controllers/api.js
JavaScript
mit
23,909
/** * @author Titus Wormer * @copyright 2015 Titus Wormer * @license MIT * @module remark:toc * @fileoverview Generate a Table of Contents (TOC) for Markdown files. */ 'use strict'; /* Dependencies. */ var slug = require('remark-slug'); var toc = require('mdast-util-toc'); /* Expose. */ module.exports = attacher; /* Constants. */ var DEFAULT_HEADING = 'toc|table[ -]of[ -]contents?'; /** * Attacher. * * @param {Unified} processor - Processor. * @param {Object} options - Configuration. * @return {function(node)} - Transformmer. */ function attacher(processor, options) { var settings = options || {}; var heading = settings.heading || DEFAULT_HEADING; var depth = settings.maxDepth || 6; var tight = settings.tight; processor.use(slug); return transformer; /** * Adds an example section based on a valid example * JavaScript document to a `Usage` section. * * @param {Node} node - Root to search in. */ function transformer(node) { var result = toc(node, { heading: heading, maxDepth: depth, tight: tight }); if (result.index === null || result.index === -1 || !result.map) { return; } /* Replace markdown. */ node.children = [].concat( node.children.slice(0, result.index), result.map, node.children.slice(result.endIndex) ); } }
Nrupesh29/Web-Traffic-Visualizer
vizceral/node_modules/remark-toc/index.js
JavaScript
mit
1,360
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><g><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zM18 11c0-3.07-1.64-5.64-4.5-6.32V2.5h-3v2.18c-.24.06-.47.15-.69.23L18 13.1V11z" /><path d="M5.41 3.35L4 4.76l2.81 2.81C6.29 8.57 6 9.73 6 11v5l-2 2v1h14.24l1.74 1.74 1.41-1.41L5.41 3.35z" /></g></React.Fragment> , 'NotificationsOffSharp');
Kagami/material-ui
packages/material-ui-icons/src/NotificationsOffSharp.js
JavaScript
mit
459
/* Copyright (c) 2008 The Crash Team. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*global crash, createTimerTests, runCrashTests */ function createTimerTests() { return crash.test.unit('Timer Tests', { crashTests: [ { func: 'startSetTimeout', callbacks: [ 'timerSetTimeout' ] }, { func: 'startSetInterval', callbacks: [ 'timerSetInterval' ] } ], timerId: null, timerStart: null, startSetTimeout: function () { this.timerId = crash.timer.setTimeout(this.timerSetTimeout, 250); this.timerStart = new Date().getTime(); this.assert(this.timerId !== null, "Timer Id is null"); }, timerSetTimeout: function () { crash.timer.clearTimeout(this.timerId); var time = new Date().getTime() - this.timerStart; this.assert(time >= 250, "Time <= 250 ms (" + time + ")"); }, startSetInterval: function () { this.timerId = crash.timer.setInterval(this.timerSetInterval, 250); this.timerStart = new Date().getTime(); this.assert(this.timerId !== null, "Timer Id is null"); }, timerSetInterval: function () { crash.timer.clearTimeout(this.timerId); var time = new Date().getTime() - this.timerStart; this.assert(time >= 250, "Time <= 250 ms (" + time + ")"); } }, 1000); } function runCrashTests() { return createTimerTests(); }
hankly/frizione
Frizione/frizione-projects/crash/test/core/timer.js
JavaScript
mit
2,543
var gulp = require('gulp'), plumber = require('gulp-plumber'), browserSync = require('browser-sync'), stylus = require('gulp-stylus'), uglify = require('gulp-uglify'), concat = require('gulp-concat'), jeet = require('jeet'), rupture = require('rupture'), koutoSwiss = require('kouto-swiss'), prefixer = require('autoprefixer-stylus'), imagemin = require('gulp-imagemin'), cp = require('child_process'); var messages = { jekyllBuild: '<span style="color: grey">Running:</span> $ jekyll build' }; /** * Build the Jekyll Site */ gulp.task('jekyll-build', function (done) { browserSync.notify(messages.jekyllBuild); return cp.exec('jekyll', ['build'], {stdio: 'inherit'}) .on('close', done); }); /** * Rebuild Jekyll & do page reload */ gulp.task('jekyll-rebuild', ['jekyll-build'], function () { browserSync.reload(); }); /** * Wait for jekyll-build, then launch the Server */ gulp.task('browser-sync', ['jekyll-build'], function() { browserSync({ server: { baseDir: '_site' } }); }); /** * Stylus task */ gulp.task('stylus', function(){ gulp.src('src/styl/main.styl') .pipe(plumber()) .pipe(stylus({ use:[koutoSwiss(), prefixer(), jeet(),rupture()], compress: true })) .pipe(gulp.dest('_site/assets/css/')) .pipe(browserSync.reload({stream:true})) .pipe(gulp.dest('assets/css')) }); /** * Javascript Task */ gulp.task('js', function(){ return gulp.src('src/js/**/*.js') .pipe(plumber()) .pipe(concat('main.js')) .pipe(uglify()) .pipe(gulp.dest('assets/js/')) }); /** * Imagemin Task */ gulp.task('imagemin', function() { return gulp.src('src/img/**/*.{jpg,png,gif,ico}') .pipe(plumber()) .pipe(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true })) .pipe(gulp.dest('assets/img/')); }); /** * Watch stylus files for changes & recompile * Watch html/md files, run jekyll & reload BrowserSync */ gulp.task('watch', function () { gulp.watch('src/styl/**/*.styl', ['stylus']); gulp.watch('src/js/**/*.js', ['js']); gulp.watch('src/img/**/*.{jpg,png,gif}', ['imagemin']); gulp.watch(['*.html', '_includes/*.html', '_layouts/*.html', '_posts/*'], ['jekyll-rebuild']); }); /** * Default task, running just `gulp` will compile the sass, * compile the jekyll site, launch BrowserSync & watch files. */ gulp.task('default', ['js', 'stylus', 'browser-sync', 'watch']); gulp.task('without-jekyll', ['js', 'stylus', 'imagemin']);
matheus-vieira/blog
gulpfile.js
JavaScript
mit
2,478
'use strict'; /*angular.module('mean.dealdeck').factory('Dealdeck', [ function() { return { name: 'dealdeck' }; } ]);*/ angular.module('mean.dealdeck') .factory('Dealdeck', ['$http', function($http) { var urlBase = '/'; var dataFactory = {}; dataFactory.saveDeal = function (myArray,points,percentage) { console.log('getDeal() in service:'+points); //console.log("HTTP: "+request); return $http({ url: '/dealdeck/example/savedeal', method: "POST", data: {myArray: myArray, points : points, percentage : percentage} }); //return $http.get('/dealdeck/example/anyone'); }; dataFactory.listDeal = function(){ console.log('listDeal() in service:'); return $http({ url: '/dealdeck/example/listDeal', method: "GET" }); }; dataFactory.getOnedeal = function(id){ console.log('getOnedeal() in service:'); return $http({ url: '/dealdeck/example/detailsDeal', method: "POST", data : {cardid : id} }); }; return dataFactory; }]);
PankajMean/Dealdeck
packages/dealdeck/public/services/dealdeck.js
JavaScript
mit
1,305
const { colls, getDb, start } = require(`../index`) describe(`db`, () => { start() it(`should create system collections`, () => { const db = getDb() const nodeMetaColl = db.getCollection(colls.nodeMeta.name) const nodeTypesColl = db.getCollection(colls.nodeTypes.name) expect(nodeMetaColl).toBeDefined() expect(nodeTypesColl).toBeDefined() }) })
ChristopherBiscardi/gatsby
packages/gatsby/src/db/loki/__tests__/index.js
JavaScript
mit
373
var quoteList = [ { quote: "I have just three things to teach: simplicity, patience, compassion. These three are your greatest treasures.", source: "Lao Tzu" }, { quote: "In character, in manner, in style, in all things, the supreme excellence is simplicity.", source: "Henry Wadsworth Longfellow" }, { quote: "If we don't discipline ourselves, the world will do it for us.", source: "William Feather" }, { quote: "Rule your mind or it will rule you.", source: "Horace" }, { quote: "All that we are is the result of what we have thought.", source: "Buddha" }, { quote: "Doing just a little bit during the time we have available puts you that much further ahead than if you took no action at all.", source: "Pulsifer, Take Action; Don't Procrastinate" }, { quote: "Never leave that till tomorrow which you can do today.", source: "Benjamin Franklin" }, { quote: "Procrastination is like a credit card: it's a lot of fun until you get the bill.", source: "Christopher Parker" }, { quote: "Someday is not a day of the week.", source: "Author Unknown" }, { quote: "Tomorrow is often the busiest day of the week.", source: "Spanish Proverb" }, { quote: "I can accept failure, everyone fails at something. But I can't accept not trying.", source: "Michael Jordan" }, { quote: "There’s a myth that time is money. In fact, time is more precious than money. It’s a nonrenewable resource. Once you’ve spent it, and if you’ve spent it badly, it’s gone forever.", source: "Neil A. Fiore" }, { quote: "Nothing can stop the man with the right mental attitude from achieving his goal; nothing on earth can help the man with the wrong mental attitude.", source: "Thomas Jefferson" }, { quote: "There is only one success--to be able to spend your life in your own way.", source: "Christopher Morley" }, { quote: "Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.", source: "Evan Esar" }, { quote: "We are still masters of our fate. We are still captains of our souls.", source: "Winston Churchill" }, { quote: "Our truest life is when we are in dreams awake.", source: "Henry David Thoreau" }, { quote: "The best way to make your dreams come true is to wake up.", source: "Paul Valery" }, { quote: "Life without endeavor is like entering a jewel mine and coming out with empty hands.", source: "Japanese Proverb" }, { quote: "Happiness does not consist in pastimes and amusements but in virtuous activities.", source: "Aristotle" }, { quote: "By constant self-discipline and self-control, you can develop greatness of character.", source: "Grenville Kleiser" }, { quote: "The difference between a successful person and others is not a lack of strength, not a lack of knowledge, but rather a lack in will.", source: "Vince Lombardi Jr." }, { quote: "At the end of the day, let there be no excuses, no explanations, no regrets.", source: "Steve Maraboli" }, { quote: "Inaction will cause a man to sink into the slough of despond and vanish without a trace.", source: "Farley Mowat" }, { quote: "True freedom is impossible without a mind made free by discipline.", source: "Mortimer J. Adler" }, { quote: "The most powerful control we can ever attain, is to be in control of ourselves.", source: "Chris Page" }, { quote: "Idleness is only the refuge of weak minds, and the holiday of fools.", source: "Philip Dormer Stanhope" }, { quote: "This is your life and it's ending one minute at a time.", source: "Tyler Durden, Fight Club" }, { quote: "You create opportunities by performing, not complaining.", source: "Muriel Siebert" }, { quote: "Great achievement is usually born of great sacrifice, and is never the result of selfishness.", source: "Napoleon Hill" }, { quote: "Whether you think you can, or you think you can't, you're right.", source: "Henry Ford" }, { quote: "Even if I knew that tomorrow the world would go to pieces, I would still plant my apple tree.", source: "Martin Luther" } ]; var selectedQuote = quoteList[Math.floor(Math.random() * quoteList.length)]; var quoteDiv, quoteText, quoteSource, fbLink, infoPanel, taikoPic; quoteDiv = $("<div class='nfe-quote'/>"); // Info panel, hidden by default infoPanel = $("<div class='nfe-info-panel'></div>") .hide() .appendTo(quoteDiv); quoteText = $("<p>“"+selectedQuote.quote+"”</p>") .addClass('nfe-quote-text') .appendTo(quoteDiv); quoteSource = $("<p>~ "+selectedQuote.source+"</p>") .addClass('nfe-quote-source') .appendTo(quoteDiv); var hideInfoPanel = function(){ $('div.nfe-info-panel').hide(); } var extensionURL = function(relativeURL){ if(window.chrome !== undefined){ // Chrome extension return chrome.extension.getURL(relativeURL); }else{ // Firefox extension return self.options.urls[relativeURL]; } } fbLink = $("<a href='javascript:;'>News Feed Eradicator :)</a>") .addClass('nfe-info-link') .on('click', function(){ var handleClose = function() { $('.nfe-close-button').on('click', hideInfoPanel); }; var url = 'info-panel.html'; if (window.chrome !== undefined) { // Chrome extension infoPanel.load(chrome.extension.getURL(url), handleClose); } else { // Firefox extension self.port.emit('requestUrl', url); self.port.once(url, function(data) { console.log("Received data for ", url); infoPanel.html(data); handleClose(); }); } infoPanel.show(); }) .appendTo(quoteDiv); // This delay ensures that the elements have been created by Facebook's // scripts before we attempt to replace them setInterval(function(){ // Replace the news feed $("div#pagelet_home_stream").replaceWith(quoteDiv); $("div[id^='topnews_main_stream']").replaceWith(quoteDiv); // Delete the ticker $("div#pagelet_ticker").remove(); // Delete the trending box $("div#pagelet_trending_tags_and_topics").remove(); }, 1000);
rajiteh/news-feed-eradicator
eradicate.js
JavaScript
mit
6,329
define(['jquery','ajax'], function ($, ajax) { var project = $('#project').val(); var branch = $('#branch').val(); $('#branch-clone-form').submit(function () { // Collects the branch properties var branchProperties = []; $('.branch-property').each (function (index, el) { var extension = $(el).attr('extension'); var property = $(el).attr('property'); var value = $('#extension-{0}-{1}'.format(extension, property)).val(); branchProperties.push({ extension: extension, name: property, value: value }); }); // Collects the validation stamp expressions var validationStampExpressions = []; $('.validation-stamp-property').each(function (index, el) { var extension = $(el).attr('extension'); var property = $(el).attr('property'); var regex = $('#validation-stamp-{0}-{1}-regex'.format(extension, property)).val(); var replacement = $('#validation-stamp-{0}-{1}-replacement'.format(extension, property)).val(); if (regex != '') { validationStampExpressions.push({ extension: extension, name: property, regex: regex, replacement: replacement }); } }); // Collects the promotion level expressions var promotionLevelExpressions = []; $('.promotion-level-property').each(function (index, el) { var extension = $(el).attr('extension'); var property = $(el).attr('property'); var regex = $('#promotion-level-{0}-{1}-regex'.format(extension, property)).val(); var replacement = $('#promotion-level-{0}-{1}-replacement'.format(extension, property)).val(); if (regex != '') { promotionLevelExpressions.push({ extension: extension, name: property, regex: regex, replacement: replacement }); } }); // AJAX call ajax.post({ url: 'ui/manage/project/{0}/branch/{1}/clone'.format(project, branch), loading: { el: $('#clone-submit') }, data: { name: $('#name').val(), description: $('#description').val(), branchProperties: branchProperties, validationStampReplacements: validationStampExpressions, promotionLevelReplacements: promotionLevelExpressions }, successFn: function (summary) { 'gui/project/{0}/branch/{1}'.format(project, summary.name).goto(); }, errorFn: ajax.simpleAjaxErrorFn(ajax.elementErrorMessageFn($('#clone-error'))) }); // No regular form submit return false; }); });
joansmith/ontrack
ontrack-web/src/main/webapp/static/js/app/branch-clone.js
JavaScript
mit
3,008
'use strict'; import Effect from '../../core/Effect'; class WahWah extends Effect { constructor (audioContext, props, name) { super(audioContext, props, name); this.setMainEffect('WahWah', 'filterBp'); this.setMainProperties({ automode: (this.automode > 0) ? true : false, baseFrequency: this.baseFrequency, excursionOctaves: this.excursionOctaves, sweep: this.sweep, resonance: this.resonance, sensitivity: this.sensitivity, bypass: this.bypass }); } } export default WahWah;
civa86/web-synth
lib/src/modules/Effects/WahWah.js
JavaScript
mit
606
import path from 'path'; import webpack from 'webpack'; import HtmlWebpackPlugin from 'html-webpack-plugin'; export default { devtool: 'inline-source-map', entry: [ 'webpack/hot/only-dev-server', 'webpack-dev-server/client', path.join(__dirname, './mock-entry.dev.js'), ], output: { path: __dirname, filename: 'client-bundle.js', publicPath: '/', }, plugins: [ new webpack.NoErrorsPlugin(), new HtmlWebpackPlugin({ filename: 'carte-blanche/index.html', template: '!!html!' + path.join(__dirname, './index.html'), // eslint-disable-line }), ], module: { loaders: [ { test: /\.js$/, loaders: [ 'react-hot', 'babel', ], include: path.join(__dirname), }, { test: /\.css$/, loader: 'style-loader!css-loader?modules&importLoaders=1&sourceMap!postcss-loader', }, ], }, };
carteb/carte-blanche
client/webpack.dev.babel.js
JavaScript
mit
926
import { GraphQLObjectType, GraphQLInt, GraphQLString, GraphQLList, GraphQLNonNull, GraphQLBoolean } from 'graphql' import R from 'ramda' import { connectionFromArray, connectionFromPromisedArray } from 'graphql-relay' import {toMongoId} from './serverUtils' export const DEFAULT_LIMIT_PER_PAGE = 1; export const DEFAULT_START_PAGE = 1; export const paginatedArgs = { page: { type: GraphQLInt }, limit: { type: GraphQLInt } , id: { type: GraphQLString } }; export function calcPaginationParams({page = DEFAULT_START_PAGE, limit = DEFAULT_LIMIT_PER_PAGE}) { if (page < 1) { throw new Error("Page arg must be positive, got "+page) } if (limit < 1) { throw new Error("Limit arg must be positive, got "+limit) } return { offset: (page - 1) * limit, limit, currentPage: page } } // from facebook function resolveMaybeThunk(thingOrThunk) { return typeof thingOrThunk === 'function' ? thingOrThunk() : thingOrThunk; } //deprecated const pageInfoType = new GraphQLObjectType({ name: 'PageInfo', description: 'Information about pagination in a connection.', fields: () => ({ hasNextPage: { type: new GraphQLNonNull(GraphQLBoolean), description: 'When paginating forwards, are there more items?' }, hasPreviousPage: { type: new GraphQLNonNull(GraphQLBoolean), description: 'When paginating backwards, are there more items?' } }) }); //deprecated export function paginatedDefinitions(config) { const {nodeType} = config; const name = config.name || nodeType.name; const edgeFields = config.edgeFields || {}; const connectionFields = config.connectionFields || {}; const resolveNode = config.resolveNode; const edgeType = new GraphQLObjectType({ name: name + 'Edge', description: 'An edge in a connection.', fields: () => ({ node: { type: nodeType, resolve: resolveNode, description: 'The item at the end of the edge', }, ...(resolveMaybeThunk(edgeFields)) }) }) const connectionType = new GraphQLObjectType({ name: name + 'ConnectionPaginated', description: 'A connection to a list of items.', fields: () => ({ pageInfoPaginated: { // changed the name to avoid graphql internal validation that requires certain field arguments type: new GraphQLNonNull(pageInfoType), description: 'Information to aid in pagination.' }, edgesPaginated: { // changed the name to avoid graphql internal validation that requires certain field arguments type: new GraphQLList(edgeType), description: 'A list of edges.' } , ...(resolveMaybeThunk(connectionFields)) }) }); return {edgeType, connectionType}; } export const PageInfoPaginatedType = new GraphQLObjectType({ name: 'PageInfoPaginated', description: 'Information about pagination in a connection.', fields: () => ({ hasNextPage: { type: new GraphQLNonNull(GraphQLBoolean), description: 'When paginating forwards, are there more items?' }, hasPreviousPage: { type: new GraphQLNonNull(GraphQLBoolean), description: 'When paginating backwards, are there more items?' }, totalNumPages: { type: new GraphQLNonNull(GraphQLInt), description: 'Total number of pages.' }, }) }); export async function calcHasNextPrevious(collection,args){ const {limit,currentPage} = calcPaginationParams(args); const totalNumRecords = await collection.count(); return { hasNextPage: totalNumRecords != 0 && currentPage * limit < totalNumRecords, hasPreviousPage: totalNumRecords != 0 && currentPage > 1, totalNumPages: Math.ceil(totalNumRecords/limit) } } export function paginatedConnection(collection,args,config){ console.log("paginatedConnection config %O",config) function buildConnectionByConfig(config) { console.log("buildConnectionByConfig : %O",config) const offset = config.offset || 0; const limit = config.limit || 0; const findParams = config.findParams || {}; const sort = config.sort || undefined; const options = config.options || undefined; return connectionFromPromisedArray(collection.find(findParams, options).sort(sort).skip(offset).limit(limit).toArray(),args) } function mergeWithConfigAndReturn(obj){ const resultObj = Object.assign({},config,obj) console.log("mergeWithConfigAndReturn resultObj %O",resultObj) return resultObj } return R.compose(buildConnectionByConfig, mergeWithConfigAndReturn, calcPaginationParams)(args) ; } //deprecated export async function paginatedMongodbConnection(collection, args, config) { function requestEntities(config) { const offset = config.offset || 0; const limit = config.limit || 0; const findParams = config.findParams || {}; const sort = config.sort || undefined; const options = config.options || undefined; return collection.find(findParams, options).sort(sort).skip(offset).limit(limit).toArray() } function requestTotalNumRecords() { return collection.count(); } let offset, limit, currentPage, totalNumRecordsPromise, totalNumRecords, entitiesPromise, pageInfo; const findParams = config && config.findParams || {}; const {id} = args; // id takes precedence over other field arguments if (id) { pageInfo = {hasPreviousPage: false, hasNextPage: false}; findParams._id = toMongoId(id); offset = 0; // multiple entities with the same id is not supported limit = 1; entitiesPromise = requestEntities({ findParams, offset, limit }); } else { totalNumRecordsPromise = requestTotalNumRecords(); const params = calcPaginationParams(args); offset = params.offset; limit = params.limit; entitiesPromise = requestEntities({findParams, offset, limit}); currentPage = params.currentPage; totalNumRecords = await totalNumRecordsPromise; pageInfo = { hasPreviousPage: totalNumRecords != 0 && currentPage > 1, hasNextPage: currentPage * limit < totalNumRecords }; } const entities = await entitiesPromise; return { edgesPaginated: entities.map(node => ({node})), pageInfoPaginated: pageInfo } }
igorsvee/react-relay-isomorphic-example
server/paginatedMongodbConnection.js
JavaScript
mit
6,285
'use strict'; exports.pumpArchiveExistsInArray = function (arr, pumpArchiveId) { for (var i = 0; i < arr.length; ++i) { if (arr[i].pumpArchiveId === pumpArchiveId) { return true; } } return false; }; exports.removePumpArchiveInArray = function (arr, pumpArchiveId) { for (var i = 0; i < arr.length; ++i) { if (arr[i].pumpArchiveId === pumpArchiveId) { arr.splice(i,1); return true; } } return false; }; exports.archiveExistsInArray = function (arr, archiveId) { for (var i = 0; i < arr.length; ++i) { if (arr[i].archiveId === archiveId) { return true; } } return false; }; exports.getArchiveInArray = function (arr, archiveId) { for (var i = 0; i < arr.length; ++i) { if (arr[i].archiveId === archiveId) { return arr[i]; } } return false; }; exports.removeArchiveInArray = function (arr, archiveId) { for (var i = 0; i < arr.length; ++i) { if (arr[i].archiveId === archiveId) { arr.splice(i,1); return true; } } return false; }; exports.ObjectToText = function(o, p) { var r = ''; var p = ((p) ? p +'/' : ""); for(var key in o) { if (Array.isArray(o[key])) { //FIXME : Object in Array? var value = ''; for (var i in o[key]) value += "'" + String(o[key][i]).replace("'","\' ") + "' "; r += p+key+'=' + value + '\n'; } else if (typeof o[key] === 'object') { r += this.ObjectToText(o[key], p + key); } else { r += p+key+'='+ String(o[key]).replace("'","\'") + '\n'; } } return r; } exports.getCacheKey = function(archiveId, sourceHash, argvHash) { return 'cache/' + archiveId + '/' + sourceHash + '/' + argvHash; }; // from node/lib/internal/net.js exports.isLegalPort = function(port) { if ((typeof port !== 'number' && typeof port !== 'string') || (typeof port === 'string' && port.trim().length === 0)) return false; return +port === (+port >>> 0) && port <= 0xFFFF; }
ivere27/secc
lib/utils.js
JavaScript
mit
1,974
module.exports = function(grunt) { 'use strict'; grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), handlebars: { compile: { options: { namespace: 'JST', amd: false, processName: function(filename) { var directoryIndex = filename.lastIndexOf('/') + 1; var extensionIndex = filename.lastIndexOf('handlebars') - 1; filename = filename.slice(directoryIndex, extensionIndex); return filename.toLowerCase(); } }, src: 'src/main/handlebars/*.handlebars', dest: 'dist/js/templates.js' } }, less: { options: { paths: ['src/main/less'], expand: true }, files: { src: 'src/main/less/main.less', dest: 'dist/css/main.css' } }, jshint: { options: { evil: true, regexdash: true, browser: true, jquery: true, node: true, wsh: true, trailing: true, sub: true, unused: true, undef: true, curly: true, indent: 4, eqeqeq: true, esversion: 6, globals: { Backbone: false, define: false, require: false, _: false, alert: false, console: false, JST: false, App: false, BaseView: false, Handlebars: false, describe: false, it: false, suite: false, assert: false, test: false, should: false, 'throw': false } }, files: { src: ['src/main/**/*.js', 'build.js', 'bower.json', 'package.json'] } }, concat: { files: { src: ['dist/js/templates.js', 'src/main/js/App.js'], dest: 'dist/js/main.concat.js' } }, copy: { ejs: { files: [{ cwd: 'src/main/ejs', src: 'index.ejs', dest: 'dist/', expand: true }] }, resource: { files: [{ cwd: 'src/main/resource/image', src: '*.png', dest: 'dist/css/image', expand: true, flatten: true }] }, libs: { files: [{ expand: true, dest: 'dist/js/lib', flatten: true, src: ['bower_components/jquery/dist/jquery.js', 'bower_components/handlebars/handlebars.runtime.js', 'bower_components/underscore/underscore.js' ] }] } }, uglify: { options: { mangle: true, preserveComments: false, compress: {}, banner: '/**This content is derived. Do not edit.**/\n', footer: '\n/**End Content**/' }, main: { files: { 'dist/js/main.min.js': ['dist/js/main.concat.js'] } }, node: { files: { 'dist/server.js': ['src/main/node/server.js'] } } }, clean: ['dist/js/main.concat.js', 'dist/js/templates.js'] }); grunt.loadNpmTasks('grunt-contrib-handlebars'); grunt.loadNpmTasks('grunt-contrib-less'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify-es'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.registerTask('default', ['jshint', 'handlebars', 'less', 'concat', 'copy:ejs', 'copy:resource', 'copy:libs', 'uglify:main', 'uglify:node', 'clean']); };
adamyork/tech-news-aggregator
Gruntfile.js
JavaScript
mit
4,576
import createSvgIcon from './utils/createSvgIcon'; import { jsx as _jsx } from "react/jsx-runtime"; export default createSvgIcon( /*#__PURE__*/_jsx("path", { d: "M20 6h-2.18c.11-.31.18-.65.18-1 0-1.66-1.34-3-3-3-1.05 0-1.96.54-2.5 1.35l-.5.67-.5-.68C10.96 2.54 10.05 2 9 2 7.34 2 6 3.34 6 5c0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM9 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm11 15H4v-2h16v2zm0-5H4V8h5.08L7 10.83 8.62 12 11 8.76l1-1.36 1 1.36L15.38 12 17 10.83 14.92 8H20v6z" }), 'CardGiftcard');
oliviertassinari/material-ui
packages/mui-icons-material/lib/esm/CardGiftcard.js
JavaScript
mit
622
(function(Wa,Nb,Ob,E,Pb,H,V,K,G,C,y,Qb,Q,Rb,U,p,R,u,wa,W,Y,f,sa,fa,la,Z,ma,na,oa,w,Sb,Tb,Xa,Ub,Vb,Wb,Xb,Ya,Za,Yb,Zb,$b,ac,bc,cc,dc,ec,fc,gc,hc,ic,jc,kc,lc,mc,nc,e,j){H("JS");c$=C(function(){this.e=this.vwr=null;this.chk=!1;this.st=null;this.slen=0;G(this,arguments)},JS,"ScriptExt");e(c$,"init",function(a){this.e=a;this.vwr=this.e.vwr;return this},"~O");e(c$,"atomExpressionAt",function(a){return this.e.atomExpressionAt(a)},"~N");e(c$,"checkLength",function(a){this.e.checkLength(a)},"~N");e(c$,"error", function(a){this.e.error(a)},"~N");e(c$,"invArg",function(){this.e.invArg()});e(c$,"invPO",function(){this.error(23)});e(c$,"getShapeProperty",function(a,b){return this.e.getShapeProperty(a,b)},"~N,~S");e(c$,"paramAsStr",function(a){return this.e.paramAsStr(a)},"~N");e(c$,"centerParameter",function(a){return this.e.centerParameter(a)},"~N");e(c$,"floatParameter",function(a){return this.e.floatParameter(a)},"~N");e(c$,"getPoint3f",function(a,b){return this.e.getPoint3f(a,b)},"~N,~B");e(c$,"intParameter", function(a){return this.e.intParameter(a)},"~N");e(c$,"isFloatParameter",function(a){switch(this.e.tokAt(a)){case 2:case 3:return!0}return!1},"~N");e(c$,"setShapeProperty",function(a,b,c){this.e.setShapeProperty(a,b,c)},"~N,~S,~O");e(c$,"showString",function(a){this.e.showString(a)},"~S");e(c$,"stringParameter",function(a){return this.e.stringParameter(a)},"~N");e(c$,"getToken",function(a){return this.e.getToken(a)},"~N");e(c$,"tokAt",function(a){return this.e.tokAt(a)},"~N");e(c$,"setShapeId",function(a, b,c){c&&this.invArg();b=this.e.setShapeNameParameter(b).toLowerCase();this.setShapeProperty(a,"thisID",b);return b},"~N,~N,~B");e(c$,"getColorTrans",function(a,b,c,d){c=3.4028235E38;1766856708!=a.theTok&&--b;switch(this.tokAt(b+1)){case 603979967:b++;c=this.isFloatParameter(b+1)?a.getTranslucentLevel(++b):this.vwr.getFloat(570425354);break;case 1073742074:b++,c=0}a.isColorParam(b+1)?d[0]=a.getArgbParam(++b):1048587==this.tokAt(b+1)?(d[0]=0,a.iToken=b+1):3.4028235E38==c?this.invArg():d[0]=-2147483648; return c},"JS.ScriptEval,~N,~B,~A");e(c$,"finalizeObject",function(a,b,c,d,h,m,g,M){h&&this.setShapeProperty(a,"set",m);-2147483648!=b&&this.e.setShapePropertyBs(a,"color",Integer.$valueOf(b),M);3.4028235E38!=c&&this.e.setShapeTranslucency(a,"","translucent",c,M);0!=d&&this.setShapeProperty(a,"scale",Integer.$valueOf(d));0<g&&(this.e.setMeshDisplayProperty(a,g,0)||this.invArg())},"~N,~N,~N,~N,~B,~O,~N,JU.BS");H("JS");K(["JS.ScriptExt"],"JS.IsoExt","java.lang.Boolean $.Float $.Short java.util.Hashtable JU.AU $.BS $.Lst $.M4 $.P3 $.PT $.Quat $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.c.VDW JS.SV $.ScriptEval $.T JU.BSUtil $.BoxInfo $.C $.Escape $.Logger $.Parser $.TempArray".split(" "), function(){c$=wa(JS,"IsoExt",JS.ScriptExt);Q(c$,function(){Y(this,JS.IsoExt,[])});j(c$,"dispatch",function(a,b,c){this.chk=this.e.chk;this.slen=this.e.slen;this.st=c;switch(a){case 23:this.cgo();break;case 25:this.contact();break;case 17:this.dipole();break;case 22:this.draw();break;case 24:case 30:case 29:this.isosurface(a);break;case 26:this.lcaoCartoon();break;case 27:case 28:this.mo(b,a)}return null},"~N,~B,~A");e(c$,"dipole",function(){var a=this.e,b=null,c=null,d=!1,h=!1,m=!1;a.sm.loadShape(17); if(!(1073742001==this.tokAt(1)&&this.listIsosurface(17)))if(this.setShapeProperty(17,"init",null),1==this.slen)this.setShapeProperty(17,"thisID",null);else{for(var g=1;g<this.slen;++g){c=b=null;switch(this.getToken(g).tok){case 1048579:b="all";break;case 1048589:b="on";break;case 1048588:b="off";break;case 12291:b="delete";break;case 2:case 3:b="value";c=Float.$valueOf(this.floatParameter(g));break;case 10:10==this.tokAt(g+1)?this.setShapeProperty(17,"startSet",this.atomExpressionAt(g++)):b="atomBitset"; case 1048577:null==b&&(b=d||h?"endSet":"startSet");c=this.atomExpressionAt(g);g=a.iToken;0==this.tokAt(g+1)&&"startSet"===b&&(b="atomBitset");d=!0;break;case 1048586:case 8:c=this.getPoint3f(g,!0);g=a.iToken;b=d||h?"endCoord":"startCoord";h=!0;break;case 1678770178:b="bonds";break;case 4102:b="calculate";if(10==this.tokAt(g+1)||1048577==this.tokAt(g+1))c=this.atomExpressionAt(++g),g=a.iToken;break;case 1074790550:this.setShapeId(17,++g,m);g=a.iToken;break;case 135267329:b="cross";c=Boolean.TRUE;break; case 1073742040:b="cross";c=Boolean.FALSE;break;case 1073742066:this.isFloatParameter(g+1)?(c=this.floatParameter(++g),2==a.theTok?(b="offsetPercent",c=Integer.$valueOf(y(c))):(b="offset",c=Float.$valueOf(c))):(b="offsetPt",c=this.centerParameter(++g),g=a.iToken);break;case 1073742068:b="offsetSide";c=Float.$valueOf(this.floatParameter(++g));break;case 1073742188:b="value";c=Float.$valueOf(this.floatParameter(++g));break;case 1073742196:b="width";c=Float.$valueOf(this.floatParameter(++g));break;default:if(269484209== a.theTok||JS.T.tokAttr(a.theTok,1073741824)){this.setShapeId(17,g,m);g=a.iToken;break}this.invArg()}m=12291!=a.theTok&&4102!=a.theTok;null!=b&&this.setShapeProperty(17,b,c)}(h||d)&&this.setShapeProperty(17,"set",null)}});e(c$,"draw",function(){var a=this.e;a.sm.loadShape(22);switch(this.tokAt(1)){case 1073742001:if(this.listIsosurface(22))return!1;break;case 1073742102:var b=2,c=1073742138==this.tokAt(b)?"":a.optParameterAsString(b);c.equalsIgnoreCase("chemicalShift")?c="cs":c.equalsIgnoreCase("polyhedra")&& (c=":poly");var d=1,h=0;0<c.length&&this.isFloatParameter(++b)&&(h=this.intParameter(b++));1073742138==this.tokAt(b)&&(d=this.floatParameter(++b));this.chk||a.runScript(this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),!0,c,h,d));return!1;case 137363467:case 135270418:case 1052714:return this.e.getCmdExt().plot(this.st),!1}for(var m=!1,g=!1,M=!1,e=!1,k=!1,f=0,q=3.4028235E38,t=p(-1,[-2147483648]),r=0,L="",j=0,d=null,c=this.initIsosurface(22),u=(b=null!=c)&&null==this.getShapeProperty(22,"ID"),w=null, E=0,h=a.iToken;h<this.slen;++h){var B=null,D=null;switch(this.getToken(h).tok){case 1614417948:case 1679429641:if(this.chk)break;m=this.vwr.getPlaneIntersection(a.theTok,null,r/100,0);r=0;B="polygon";D=m;m=!0;break;case 4106:w=p(4,0);E=4;m=a.floatParameterSet(++h,4,4);h=a.iToken;for(b=0;4>b;b++)w[b]=y(m[b]);m=!0;break;case 1678770178:case 1141899265:if(null==w||E>(1229980163==a.theTok?2:3))E=0,w=p(-1,[-1,-1,-1,-1]);w[E++]=this.atomExpressionAt(++h).nextSetBit(0);h=a.iToken;w[E++]=1678770178==a.theTok? this.atomExpressionAt(++h).nextSetBit(0):-1;h=a.iToken;m=!0;break;case 554176565:switch(this.getToken(++h).tok){case 1048582:B="slab";D=a.objectNameParameter(++h);h=a.iToken;m=!0;break;default:this.invArg()}break;case 135267842:switch(this.getToken(++h).tok){case 1614417948:case 1679429641:f=a.theTok;e=!0;continue;case 1048582:B="intersect";D=a.objectNameParameter(++h);h=a.iToken;m=e=!0;break;default:this.invArg()}break;case 135266320:case 1073742106:var A=135266320==a.theTok,B="polygon",m=!0,D=new JU.Lst, H=0,F=0,N=null,P=null;if(a.isArrayParameter(++h))N=a.getPointArray(h,-1,!1),H=N.length;else{H=Math.max(0,this.intParameter(h));N=Array(H);for(b=0;b<H;b++)N[b]=this.centerParameter(++a.iToken);h=a.iToken}var G=null;switch(this.tokAt(h+1)){case 11:case 12:h=JS.SV.newT(this.getToken(++h));h.toArray();P=h.getList();F=P.size();break;case 7:P=this.getToken(++h).getList();F=P.size();break;case 2:F=this.intParameter(++h);0>F&&(A=!0);break;default:!A&&!this.chk&&(G=J.api.Interface.getInterface("JU.MeshCapper", this.vwr,"script").set(null).triangulatePolygon(N))}if(null==G&&!A){G=JU.AU.newInt2(F);for(b=0;b<F;b++)A=null==P?a.floatParameterSet(++a.iToken,3,4):JS.SV.flistValue(P.get(b),0),(3>A.length||4<A.length)&&this.invArg(),G[b]=p(-1,[y(A[0]),y(A[1]),y(A[2]),3==A.length?7:y(A[3])])}0<H?(D.addLast(N),D.addLast(G)):D=null;h=a.iToken;break;case 1297090050:g=null;M=0;e=null;switch(this.tokAt(++h)){case 4:g=this.stringParameter(h);break;case 12:g=JS.SV.sValue(this.getToken(h));break;default:a.isCenterParameter(h)|| (M=this.intParameter(h++));a.isCenterParameter(h)&&(d=this.centerParameter(h));a.isCenterParameter(a.iToken+1)&&(e=this.centerParameter(++a.iToken));if(this.chk)return!1;h=a.iToken}k=null;null==d&&h+1<this.slen&&(d=this.centerParameter(++h),k=10==this.tokAt(h)||1048577==this.tokAt(h)?this.atomExpressionAt(h):null);a.checkLast(a.iToken);this.chk||(d=this.vwr.ms.getSymTemp(!1).getSymmetryInfoAtom(this.vwr.ms,k,g,M,d,e,c,135176),this.showString(d.substring(0,d.indexOf("\n")+1)),a.runScript(0<d.length? d:'draw ID "sym_'+c+'*" delete'));return!1;case 4115:k=!0;continue;case 1048586:case 9:case 8:if(9==a.theTok||!a.isPoint3f(h)){D=a.getPoint4f(h);if(k)return a.checkLast(a.iToken),this.chk||a.runScript(JU.Escape.drawQuat(JU.Quat.newP4(D),null==c?"frame":c," "+L,null==d?new JU.P3:d,r/100)),!1;B="planedef"}else D=d=this.getPoint3f(h,!0),B="coord";h=a.iToken;m=!0;break;case 135267841:case 135266319:if(!m&&!e&&0==f&&135267841!=a.theTok){B="plane";break}b=135266319==a.theTok?a.planeParameter(h):a.hklParameter(++h); h=a.iToken;if(0!=f){if(this.chk)break;m=this.vwr.getPlaneIntersection(f,b,r/100,0);r=0;B="polygon";D=m}else D=b,B="planedef";m=!0;break;case 1073742E3:B="lineData";D=a.floatParameterSet(++h,0,2147483647);h=a.iToken;m=!0;break;case 10:case 1048577:B="atomSet";D=this.atomExpressionAt(h);k&&(d=this.centerParameter(h));h=a.iToken;m=!0;break;case 7:B="modelBasedPoints";D=a.theToken.value;m=!0;break;case 1073742195:case 269484080:break;case 269484096:D=a.xypParameter(h);if(null!=D){h=a.iToken;B="coord"; m=!0;break}M&&this.invArg();M=!0;break;case 269484097:M||this.invArg();M=!1;break;case 1141899269:B="reverse";break;case 4:D=this.stringParameter(h);B="title";break;case 135198:B="vector";break;case 1141899267:D=Float.$valueOf(this.floatParameter(++h));B="length";break;case 3:D=Float.$valueOf(this.floatParameter(h));B="length";break;case 1095761935:B="modelIndex";D=Integer.$valueOf(this.intParameter(++h));break;case 2:M?(B="modelIndex",D=Integer.$valueOf(this.intParameter(h))):r=this.intParameter(h); break;case 1073742138:++h>=this.slen&&this.error(34);switch(this.getToken(h).tok){case 2:r=this.intParameter(h);continue;case 3:r=Math.round(100*this.floatParameter(h));continue}this.error(34);break;case 1074790550:c=this.setShapeId(22,++h,b);u=null==this.getShapeProperty(22,"ID");h=a.iToken;break;case 1073742027:B="fixed";D=Boolean.FALSE;break;case 1060869:B="fixed";D=Boolean.TRUE;break;case 1073742066:b=this.getPoint3f(++h,!0);h=a.iToken;B="offset";D=b;break;case 1073741906:B="crossed";break;case 1073742196:D= Float.$valueOf(this.floatParameter(++h));B="width";L=B+" "+D;break;case 1073741998:B="line";D=Boolean.TRUE;break;case 1073741908:B="curve";break;case 1074790416:B="arc";break;case 1073741846:B="arrow";break;case 1073741880:B="circle";break;case 1073741912:B="cylinder";break;case 1073742194:B="vertices";break;case 1073742048:B="nohead";break;case 1073741861:B="isbarb";break;case 1073742130:B="rotate45";break;case 1073742092:B="perp";break;case 1666189314:case 1073741917:L=1666189314==a.theTok;A=this.floatParameter(++h); L&&(A*=2);D=Float.$valueOf(A);B=L||3==this.tokAt(h)?"width":"diameter";L=B+(3==this.tokAt(h)?" "+A:" "+y(A));break;case 1048582:if(269484096==this.tokAt(h+2)||k){m=d=this.centerParameter(h);h=a.iToken;B="coord";D=m;m=!0;break}D=a.objectNameParameter(++h);B="identifier";m=!0;break;case 1766856708:case 603979967:case 1073742074:b=!0;q=this.getColorTrans(a,h,!1,t);h=a.iToken;continue;default:if(!a.setMeshDisplayProperty(22,0,a.theTok)){if(269484209==a.theTok||JS.T.tokAttr(a.theTok,1073741824)){c=this.setShapeId(22, h,b);h=a.iToken;break}this.invArg()}0==j&&(j=h);h=a.iToken;continue}b=12291!=a.theTok;m&&(!g&&!k)&&(this.setShapeProperty(22,"points",Integer.$valueOf(r)),g=!0,r=0);m&&u&&this.invArg();null!=B&&this.setShapeProperty(22,B,D)}this.finalizeObject(22,t[0],q,r,m,w,j,null);return!0});e(c$,"mo",function(a,b){var c=this.e,d=2147483647,h=!1,m=null,g=this.vwr.getVisibleFramesBitSet(),M=new JU.Lst,e=1;if(1073877011==this.tokAt(0)&&1==this.e.slen)this.chk||(c=new java.util.Hashtable,c.put("service","nbo"),c.put("action", "showPanel"),this.vwr.sm.processService(c));else{if(1095766030==this.tokAt(1)||4115==this.tokAt(1))e=c.modelNumberParameter(2),0>e&&this.invArg(),g.clearAll(),g.set(e),e=3;c.sm.loadShape(b);for(var k=g.nextSetBit(0);0<=k;k=g.nextSetBit(k+1)){var f=e;if(1073742001==this.tokAt(f)&&this.listIsosurface(b))break;this.setShapeProperty(b,"init",Integer.$valueOf(k));var q=null,t=this.getShapeProperty(b,"moNumber").intValue(),r=this.getShapeProperty(b,"moLinearCombination");if(a)break;0==t&&(t=2147483647); var L=null,j=null;switch(this.getToken(f).tok){case 1141899272:if(1073877010==b){this.mo(a,28);return}m=this.paramAsStr(++f).toUpperCase();break;case 1074790451:case 554176565:L=c.theToken.value;j=this.getCapSlabObject(f,!1);break;case 1073741914:L="squareLinear";j=Boolean.TRUE;r=u(-1,[1]);d=t=0;break;case 2:t=this.intParameter(f);r=this.moCombo(M);null==r&&0>t&&(r=u(-1,[-100,-t]));break;case 269484192:switch(this.tokAt(++f)){case 1073741973:case 1073742008:break;default:this.invArg()}h=!0;case 1073741973:case 1073742008:2147483647== (d=this.moOffset(f))&&this.invArg();t=0;r=this.moCombo(M);break;case 1073742037:t=1073742037;r=this.moCombo(M);break;case 1073742108:t=1073742108;r=this.moCombo(M);break;case 1766856708:this.setColorOptions(null,f+1,b,2);break;case 135266319:L="plane";j=1048587==this.tokAt(this.e.iToken=++f)?null:c.planeParameter(f);break;case 135266320:this.addShapeProperty(M,"randomSeed",2==this.tokAt(f+2)?Integer.$valueOf(this.intParameter(f+2)):null);L="monteCarloCount";j=Integer.$valueOf(this.intParameter(f+ 1));break;case 1073742138:L="scale";j=Float.$valueOf(this.floatParameter(f+1));break;case 1073741910:269484193==this.tokAt(f+1)?(L="cutoffPositive",j=Float.$valueOf(this.floatParameter(f+2))):(L="cutoff",j=Float.$valueOf(this.floatParameter(f+1)));break;case 536870916:L="debug";break;case 1073742054:L="plane";break;case 1073742104:case 1073742122:L="resolution";j=Float.$valueOf(this.floatParameter(f+1));break;case 1073742156:L="squareData";j=Boolean.TRUE;break;case 1073742168:f+1<this.slen&&4==this.tokAt(f+ 1)&&(L="titleFormat",j=this.paramAsStr(f+1));break;case 1073741824:this.invArg();break;default:if(c.isArrayParameter(f)){r=c.floatParameterSet(f,1,2147483647);1073742156==this.tokAt(c.iToken+1)&&(this.addShapeProperty(M,"squareLinear",Boolean.TRUE),c.iToken++);break}d=c.iToken;c.setMeshDisplayProperty(b,0,c.theTok)||this.invArg();this.setShapeProperty(b,"setProperties",M);c.setMeshDisplayProperty(b,d,this.tokAt(d));return}null!=L&&this.addShapeProperty(M,L,j);f=2147483647!=t||null!=r;if(this.chk)break; if(null!=m||f)f&&4==this.tokAt(c.iToken+1)&&(q=this.paramAsStr(++c.iToken)),c.setCursorWait(!0),this.setMoData(M,t,r,d,h,k,q,m),f&&this.addShapeProperty(M,"finalize",null);0<M.size()&&this.setShapeProperty(b,"setProperties",M);M.clear()}}},"~B,~N");e(c$,"setNBOType",function(a,b){var c=";AO; ;PNAO;;NAO; ;PNHO;;NHO; ;PNBO;;NBO; ;PNLMO;NLMO;;MO; ;NO;".indexOf(";"+b+";");0>c&&this.invArg();var c=E(c/6)+31,d=a.get("nboLabels");null==d&&this.error(27);if(!this.chk)try{var h=a.get(b+"_coefs");if(null== h){var m=a.get("nboRoot")+"."+c,g=this.vwr.getFileAsString3(m,!0,null);null==g&&this.error(27);for(var h=a.get("mos"),M=h.get(0).get("dfCoefMaps"),e=h.size(),h=new JU.Lst,c=e;0<=--c;){var f=new java.util.Hashtable;h.addLast(f);f.put("dfCoefMaps",M)}J.api.Interface.getInterface("J.quantum.QS",this.vwr,"script").setNboLabels(d,e,h,0,b);for(var g=g.substring(g.lastIndexOf("--")+2),n=g.length,q=p(1,0),c=0;c<e;c++){var f=h.get(c),t=u(e,0);f.put("coefficients",t);for(var r=0;r<e;r++)t[r]=JU.PT.parseFloatChecked(g, n,q,!1)}if(b.equals("NBO")){for(var j=u(e,0),r=0;r<e;r++)j[r]=JU.PT.parseFloatChecked(g,n,q,!1);for(c=0;c<e;c++)f=h.get(c),f.put("occupancy",Float.$valueOf(j[c]))}a.put(b+"_coefs",h)}a.put("nboType",b);a.put("mos",h)}catch(ta){if(U(ta,Exception))this.error(27);else throw ta;}},"java.util.Map,~S");e(c$,"moCombo",function(a){if(1073742156!=this.tokAt(this.e.iToken+1))return null;this.addShapeProperty(a,"squareLinear",Boolean.TRUE);this.e.iToken++;return u(0,0)},"JU.Lst");e(c$,"moOffset",function(a){var b= 1073741973==this.getToken(a).tok?0:1,c=this.tokAt(++a);2==c&&0>this.intParameter(a)?b+=this.intParameter(a):269484193==c?b+=this.intParameter(++a):269484192==c&&(b-=this.intParameter(++a));return b},"~N");e(c$,"setMoData",function(a,b,c,d,h,m,g,e){var f=this.e;0>m&&(m=this.vwr.am.cmi,0>m&&f.errorStr(30,"MO isosurfaces"));m=this.vwr.ms.getInfo(m,"moData");null==m&&this.error(27);this.vwr.checkMenuUpdate();if(null!=e&&(this.setNBOType(m,e),null==c&&2147483647==b))return;var k=null,n,q,t=0;if(null== c||2>c.length){null!=c&&1==c.length&&(d=0);e=m.containsKey("lastMoNumber")?m.get("lastMoNumber").intValue():0;k=m.containsKey("lastMoCount")?m.get("lastMoCount").intValue():1;1073742108==b?b=e-1:1073742037==b&&(b=e+k);k=m.get("mos");t=null==k?0:k.size();0==t&&this.error(25);1==t&&1<b&&this.error(29);if(2147483647!=d){if(m.containsKey("HOMO"))b=m.get("HOMO").intValue()+d;else{b=-1;for(e=0;e<t;e++)if(n=k.get(e),null!=(q=n.get("occupancy"))){if(0.5>q.floatValue()){b=e;break}}else if(null!=(q=n.get("energy"))){if(0< q.floatValue()){b=e;break}}else break;0>b&&this.error(28);b+=d}JU.Logger.info("MO "+b)}(1>b||b>t)&&f.errorStr(26,""+t)}b=Math.abs(b);m.put("lastMoNumber",Integer.$valueOf(b));m.put("lastMoCount",Integer.$valueOf(1));h&&null==c&&(c=u(-1,[-100,b]));if(null!=c&&2>c.length){n=k.get(b-1);if(null==(q=n.get("energy")))c=u(-1,[100,b]);else{f=q.floatValue();d=JU.BS.newN(t);h=0;c=1==c.length&&1==c[0];for(e=0;e<t;e++)if(null!=(q=k.get(e).get("energy")))if(q=q.floatValue(),c?q<=f:q==f)d.set(e+1),h+=2;c=u(h,0); for(k=e=0;e<h;e+=2)c[e]=1,c[e+1]=k=d.nextSetBit(k+1);m.put("lastMoNumber",Integer.$valueOf(d.nextSetBit(0)));m.put("lastMoCount",Integer.$valueOf(E(h/2)))}this.addShapeProperty(a,"squareLinear",Boolean.TRUE)}this.addShapeProperty(a,"moData",m);null!=g&&this.addShapeProperty(a,"title",g);this.addShapeProperty(a,"molecularOrbital",null!=c?c:Integer.$valueOf(Math.abs(b)));this.addShapeProperty(a,"clear",null)},"JU.Lst,~N,~A,~N,~B,~N,~S,~S");e(c$,"isosurface",function(a){var b=this.e;b.sm.loadShape(a); if(!(1073742001==this.tokAt(1)&&this.listIsosurface(a))){var c=0,d=24==a,h=29==a,m=30==a,g=26==a,e=!1,f=!1,k=!1,n=!1,q=!1,t=!1,r=!1,j=!1,ta=!1,pb=!1,E=!1,H=!1,B=!1,D=!1,A=null,G=null,F=-2147483648,N,P,C,K,Q,R=NaN,aa=NaN,Z=0,W=null,Y=2147483647,O=null,S=null,ca=null,s=new JU.SB,I,fa=null,la=null,ma=!1,xa,ga=0,da=null,T=this.chk?0:-2147483648;b.setCursorWait(!0);var ua=null!=this.initIsosurface(a),na=ua&&null==this.getShapeProperty(a,"ID"),oa=!1,sa=!1,Ea=null,wa=null,ha=null,$a=null,Ba=null,Fa=null, z=new JU.Lst,qb=!1;(h||m)&&this.addShapeProperty(z,"fileType","Pmesh");for(var l=b.iToken;l<this.slen;++l){var x=null,v=null;this.getToken(l);1073741824==b.theTok&&(da=this.paramAsStr(l));switch(b.theTok){case 603979870:W=1048589==this.getToken(++l).tok?Boolean.TRUE:1048588==b.theTok?Boolean.FALSE:null;null==W&&this.invArg();continue;case 553648149:Y=this.intParameter(++l);continue;case 4128:x="moveIsosurface";12!=this.tokAt(++l)&&this.invArg();v=this.getToken(l++).value;break;case 1297090050:for(var rb= this.floatArraySet(l+2,this.intParameter(l+1),16),Ba=Array(rb.length),ia=Ba.length;0<=--ia;)Ba[ia]=JU.M4.newA16(rb[ia]);l=b.iToken;break;case 1089470478:0>T&&(T=Math.min(this.vwr.am.cmi,0));var sb=null==ca;null==S&&(S=JU.BSUtil.copy(this.vwr.bsA()));S.and(this.vwr.ms.getAtoms(1297090050,Integer.$valueOf(1)));sb||S.andNot(ca);this.addShapeProperty(z,"select",S);sb&&(ca=JU.BSUtil.copy(S),JU.BSUtil.invertInPlace(ca,this.vwr.ms.ac),D=!0,this.addShapeProperty(z,"ignore",ca),s.append(" ignore ").append(JU.Escape.eBS(ca))); s.append(" symmetry");0==ga&&this.addShapeProperty(z,"colorRGB",Integer.$valueOf(1297090050));Ba=this.vwr.ms.getSymMatrices(T);break;case 1073742066:x="offset";v=this.centerParameter(++l);l=b.iToken;break;case 528432:x="rotate";v=1048587==this.tokAt(b.iToken=++l)?null:b.getPoint4f(l);l=b.iToken;break;case 1610612740:x="scale3d";v=Float.$valueOf(this.floatParameter(++l));break;case 1073742090:s.append(" periodic");x="periodic";break;case 1073742078:case 266298:case 135266320:x=b.theToken.value.toString(); s.append(" ").appendO(b.theToken.value);v=this.centerParameter(++l);s.append(" ").append(JU.Escape.eP(v));l=b.iToken;break;case 1679429641:if(0<=b.fullCommand.indexOf("# BBOX=")){var tb=JU.PT.split(JU.PT.getQuotedAttribute(b.fullCommand,"# BBOX"),",");xa=w(-1,[JU.Escape.uP(tb[0]),JU.Escape.uP(tb[1])])}else b.isCenterParameter(l+1)?(xa=w(-1,[this.getPoint3f(l+1,!0),this.getPoint3f(b.iToken+1,!0)]),l=b.iToken):xa=this.vwr.ms.getBBoxVertices();s.append(" boundBox "+JU.Escape.eP(xa[0])+" "+JU.Escape.eP(xa[xa.length- 1]));x="boundingBox";v=xa;break;case 135188:h=!0;s.append(" pmesh");x="fileType";v="Pmesh";break;case 135267842:S=this.atomExpressionAt(++l);this.chk?O=new JU.BS:1048577==this.tokAt(b.iToken+1)||10==this.tokAt(b.iToken+1)?(O=this.atomExpressionAt(++b.iToken),O.and(this.vwr.ms.getAtomsWithinRadius(5,S,!1,null))):(O=this.vwr.ms.getAtomsWithinRadius(5,S,!0,null),O.andNot(this.vwr.ms.getAtoms(1095761936,S)));O.andNot(S);s.append(" intersection ").append(JU.Escape.eBS(S)).append(" ").append(JU.Escape.eBS(O)); l=b.iToken;if(135368713==this.tokAt(l+1)){l++;var Ga=this.getToken(++l).value;s.append(" function ").append(JU.PT.esc(Ga));this.chk||this.addShapeProperty(z,"func",Ga.equals("a+b")||Ga.equals("a-b")?Ga:this.createFunction("__iso__","a,b",Ga))}else B=!0;x="intersection";v=w(-1,[S,O]);break;case 1610625028:case 135266325:var ab=1610625028==b.theTok;if(ab){s.append(" display");var c=l,pa=this.tokAt(l+1);if(0==pa)continue;l++;this.addShapeProperty(z,"token",Integer.$valueOf(1048589));if(10==pa||1048579== pa){x="bsDisplay";1048579==pa?s.append(" all"):(v=this.st[l].value,s.append(" ").append(JU.Escape.eBS(v)));b.checkLast(l);break}else 135266325!=pa&&(b.iToken=l,this.invArg())}else Z=l;var Pa,ya=null,O=null,bb=!1;1048577==this.tokAt(l+1)?(Pa=this.floatParameter(l+3),b.isPoint3f(l+4)?(ya=this.centerParameter(l+4),bb=!0,b.iToken+=2):b.isPoint3f(l+5)?(ya=this.centerParameter(l+5),bb=!0,b.iToken+=2):(O=b.atomExpression(this.st,l+5,this.slen,!0,!1,!1,!0),null==O&&this.invArg())):(Pa=this.floatParameter(++l), ya=this.centerParameter(++l));ab&&b.checkLast(b.iToken);l=b.iToken;0<=b.fullCommand.indexOf("# WITHIN=")?O=JU.BS.unescape(JU.PT.getQuotedAttribute(b.fullCommand,"# WITHIN")):bb||(O=V(b.expressionResult,JU.BS)?b.expressionResult:null);this.chk||(null!=O&&0<=T&&O.and(this.vwr.getModelUndeletedAtomsBitSet(T)),null==ya&&(ya=null==O?new JU.P3:this.vwr.ms.getAtomSetCenter(O)),this.getWithinDistanceVector(z,Pa,ya,O,ab),s.append(" within ").appendF(Pa).append(" ").append(null==O?JU.Escape.eP(ya):JU.Escape.eBS(O))); continue;case 1073742083:var x="parameters",ub=b.floatParameterSet(++l,1,10),l=b.iToken,v=ub;s.append(" parameters ").append(JU.Escape.eAF(ub));break;case 1716520985:case 1073742190:var Ea=b.theToken.value,Wa=1073742190==b.theTok,Ha=this.tokAt(l+1);null==$a?(!e&&(!k&&!f)&&(this.addShapeProperty(z,"sasurface",Float.$valueOf(0)),s.append(" vdw"),e=!0),x="property",null==W&&(W=JS.T.tokAttr(Ha,1112539136)&&1==this.vwr.getIsosurfacePropertySmoothing(!1)?Boolean.TRUE:Boolean.FALSE),this.addShapeProperty(z, "propertySmoothing",W),s.append(" isosurfacePropertySmoothing "+W),W===Boolean.TRUE&&(2147483647==Y&&(Y=this.vwr.getIsosurfacePropertySmoothing(!0)),this.addShapeProperty(z,"propertySmoothingPower",Integer.$valueOf(Y)),s.append(" isosurfacePropertySmoothingPower "+Y)),this.vwr.g.rangeSelected&&this.addShapeProperty(z,"rangeSelected",Boolean.TRUE)):x=$a;da=this.paramAsStr(l);s.append(" ").append(da);if(0==da.toLowerCase().indexOf("property_")){A=u(this.vwr.ms.ac,0);if(this.chk)continue;A=this.vwr.getDataFloat(da); null==A&&this.invArg();this.addShapeProperty(z,x,A);continue}var Ia=this.vwr.ms.ac,A=u(Ia,0);if(Wa){var vb=this.paramAsStr(++l);0==vb.length?A=b.floatParameterSet(l,Ia,Ia):(A=u(Ia,0),this.chk||JU.Parser.parseStringInfestedFloatArray(""+b.getParameter(vb,4,!0),null,A));this.chk||s.append(' "" ').append(JU.Escape.eAF(A))}else{this.getToken(++l);if(!this.chk){s.append(" "+b.theToken.value);var Xa=this.vwr.ms.at;this.vwr.autoCalculate(Ha);if(1766856708!=Ha){I=new JU.P3;for(var cb=Ia;0<=--cb;)A[cb]=Xa[cb].atomPropertyFloat(this.vwr, Ha,I)}}1766856708==Ha&&(ha="inherit");if(135266325==this.tokAt(l+1)){var wb=this.floatParameter(l+=2);s.append(" within "+wb);this.addShapeProperty(z,"propertyDistanceMax",Float.$valueOf(wb))}}v=A;break;case 1095761935:case 1095766030:e&&this.invArg();T=1095761935==b.theTok?this.intParameter(++l):b.modelNumberParameter(++l);s.append(" modelIndex "+T);if(0>T){x="fixed";v=Boolean.TRUE;break}x="modelIndex";v=Integer.$valueOf(T);break;case 135280133:var x="select",db=this.atomExpressionAt(++l),v=db,l= b.iToken;1073742072==this.tokAt(l+1)&&(l++,ca=JU.BSUtil.copy(db),JU.BSUtil.invertInPlace(ca,this.vwr.ms.ac),this.addShapeProperty(z,"ignore",ca),s.append(" ignore ").append(JU.Escape.eBS(ca)),D=!0);e||k?s.append(" select "+JU.Escape.eBS(db)):(S=v,0>T&&0<=S.nextSetBit(0)&&(T=this.vwr.ms.at[S.nextSetBit(0)].mi));break;case 1085443:F=this.intParameter(++l);break;case 12289:x="center";v=this.centerParameter(++l);s.append(" center "+JU.Escape.eP(v));l=b.iToken;break;case 1073742147:case 1766856708:var ua= !0,eb=1073742147==b.theTok;if(eb)s.append(" sign"),this.addShapeProperty(z,"sign",Boolean.TRUE);else{if(1073741914==this.tokAt(l+1)){l++;x="colorDensity";s.append(" color density");if(this.isFloatParameter(l+1)){var xb=this.floatParameter(++l);s.append(" "+xb);v=Float.$valueOf(xb)}break}if(4==this.getToken(l+1).tok)ha=this.paramAsStr(++l),0<ha.indexOf(" ")&&(Fa=JU.C.getColixArray(ha),null==Fa&&this.error(4));else if(1073742018==b.theTok){l++;s.append(" color mesh");ga=b.getArgbParam(++l);this.addShapeProperty(z, "meshcolor",Integer.$valueOf(ga));s.append(" ").append(JU.Escape.escapeColor(ga));l=b.iToken;continue}if(603979967==(b.theTok=this.tokAt(l+1))||1073742074==b.theTok){s.append(" color");wa=this.setColorOptions(s,l+1,24,-2);l=b.iToken;continue}switch(this.tokAt(l+1)){case 1073741826:case 1073742114:this.getToken(++l);s.append(" color range");this.addShapeProperty(z,"rangeAll",null);if(1048579==this.tokAt(l+1)){l++;s.append(" all");continue}var yb=this.floatParameter(++l),zb=this.floatParameter(++l); this.addShapeProperty(z,"red",Float.$valueOf(yb));this.addShapeProperty(z,"blue",Float.$valueOf(zb));s.append(" ").appendF(yb).append(" ").appendF(zb);continue}if(b.isColorParam(l+1)&&(ga=b.getArgbParam(l+1),1074790746==this.tokAt(l+2))){ha=b.getColorRange(l+1);l=b.iToken;break}s.append(" color")}b.isColorParam(l+1)?(ga=b.getArgbParam(++l),s.append(" ").append(JU.Escape.escapeColor(ga)),l=b.iToken,this.addShapeProperty(z,"colorRGB",Integer.$valueOf(ga)),ua=!0,b.isColorParam(l+1)?(ga=b.getArgbParam(++l), l=b.iToken,this.addShapeProperty(z,"colorRGB",Integer.$valueOf(ga)),s.append(" ").append(JU.Escape.escapeColor(ga)),n=!0):eb&&this.invPO()):!eb&&null==Fa&&this.invPO();continue;case 135270423:d||this.invArg();pb=!this.chk;continue;case 1229984263:4!=this.tokAt(l+1)&&this.invPO();continue;case 1112541194:case 1649412120:s.append(" ").appendO(b.theToken.value);var Ja=b.encodeRadiusParameter(l,!1,!0);if(null==Ja)return;s.append(" ").appendO(Ja);Float.isNaN(Ja.value)&&(Ja.value=100);v=Ja;x="radius";ta= !0;k&&(e=!1);l=b.iToken;break;case 135266319:f=!0;x="plane";v=b.planeParameter(l);l=b.iToken;s.append(" plane ").append(JU.Escape.eP4(v));break;case 1073742138:x="scale";v=Float.$valueOf(this.floatParameter(++l));s.append(" scale ").appendO(v);break;case 1048579:ua&&this.invArg();x="thisID";break;case 1113198596:e=!0;++l;v=b.getPoint4f(l);x="ellipsoid";l=b.iToken;s.append(" ellipsoid ").append(JU.Escape.eP4(v));break;case 135267841:f=!0;x="plane";v=b.hklParameter(++l);l=b.iToken;s.append(" plane ").append(JU.Escape.eP4(v)); break;case 135182:var e=!0,Qa=this.paramAsStr(++l);this.addShapeProperty(z,"lcaoType",Qa);s.append(" lcaocartoon ").append(JU.PT.esc(Qa));switch(this.getToken(++l).tok){case 10:case 1048577:x="lcaoCartoon";O=this.atomExpressionAt(l);l=b.iToken;if(this.chk)continue;var Ka=O.nextSetBit(0);0>Ka&&this.error(14);s.append(" ({").appendI(Ka).append("})");T=this.vwr.ms.at[Ka].mi;this.addShapeProperty(z,"modelIndex",Integer.$valueOf(T));var fb=w(-1,[new JU.V3,new JU.V3,JU.V3.newV(this.vwr.ms.at[Ka]),new JU.V3]); if(!Qa.equalsIgnoreCase("s")&&null==this.vwr.getHybridizationAndAxes(Ka,fb[0],fb[1],Qa))return;v=fb;break;default:this.error(14)}break;case 1073877010:var La=2147483647,Ca=2147483647,gb=269484192==this.tokAt(l+1);gb&&l++;var Ma=null;switch(this.tokAt(++l)){case 0:b.bad();break;case 1073741914:s.append("mo [1] squared ");this.addShapeProperty(z,"squareLinear",Boolean.TRUE);Ma=u(-1,[1]);Ca=La=0;l++;break;case 1073741973:case 1073742008:Ca=this.moOffset(l);La=0;l=b.iToken;s.append(" mo "+(gb?"-":"")+ "HOMO ");0<Ca&&s.append("+");0!=Ca&&s.appendI(Ca);break;case 2:La=this.intParameter(l);s.append(" mo ").appendI(La);break;default:b.isArrayParameter(l)&&(Ma=b.floatParameterSet(l,1,2147483647),l=b.iToken)}if(1073742156==this.tokAt(l+1))this.addShapeProperty(z,"squareLinear",Boolean.TRUE),s.append(" squared"),null==Ma&&(Ma=u(0,0));else if(135266320==this.tokAt(l+1)){++l;var Ab=this.intParameter(++l),Bb=2==this.tokAt(l+1)?this.intParameter(++l):-System.currentTimeMillis()%1E4;this.addShapeProperty(z, "monteCarloCount",Integer.$valueOf(Ab));this.addShapeProperty(z,"randomSeed",Integer.$valueOf(Bb));s.append(" points ").appendI(Ab).appendC(" ").appendI(Bb)}this.setMoData(z,La,Ma,Ca,gb,T,null,null);e=!0;continue;case 1073742036:x="nci";s.append(" "+x);var pa=this.tokAt(l+1),Cb=1229984263!=pa&&4!=pa&&1073742033!=pa,v=Boolean.$valueOf(Cb);Cb&&(e=!0);break;case 1073742016:case 1073742022:var Db=1073742016==b.theTok,x=Db?"mep":"mlp";s.append(" "+x);var Ra=null,hb=-1,e=!0;2==this.tokAt(l+1)&&(hb=this.intParameter(++l), s.append(" "+hb),this.addShapeProperty(z,"mepCalcType",Integer.$valueOf(hb)));if(4==this.tokAt(l+1))Ra=this.stringParameter(++l),s.append(" /*file*/"+JU.PT.esc(Ra));else if(1716520985==this.tokAt(l+1)){$a=x;continue}if(!this.chk)try{A=null==Ra&&Db?this.vwr.getPartialCharges():this.getAtomicPotentials(S,ca,Ra)}catch(Eb){if(!U(Eb,Exception))throw Eb;}!this.chk&&null==A&&this.error(32);v=A;break;case 1313866249:r=!this.chk;s.append(" volume");break;case 1074790550:this.setShapeId(a,++l,ua);na=null== this.getShapeProperty(a,"ID");l=b.iToken;break;case 1073741888:603979967==this.tokAt(l+1)&&(oa=!0,l++);ha=this.paramAsStr(++l).toLowerCase();ha.equals("sets")?s.append(' colorScheme "sets"'):b.isColorParam(l)&&(ha=b.getColorRange(l),l=b.iToken);break;case 1073741828:x="addHydrogens";v=Boolean.TRUE;s.append(" mp.addHydrogens");break;case 1073741836:x="angstroms";s.append(" angstroms");break;case 1073741837:x="anisotropy";v=this.getPoint3f(++l,!1);s.append(" anisotropy").append(JU.Escape.eP(v));l=b.iToken; break;case 1073741842:t=!this.chk;s.append(" area");break;case 1073741850:case 1073742076:e=!0;n&&!q&&(s.append(' phase "_orb"'),this.addShapeProperty(z,"phase","_orb"));var $=u(7,0);$[0]=this.intParameter(++l);$[1]=this.intParameter(++l);$[2]=this.intParameter(++l);$[3]=this.isFloatParameter(l+1)?this.floatParameter(++l):6;s.append(" atomicOrbital ").appendI(y($[0])).append(" ").appendI(y($[1])).append(" ").appendI(y($[2])).append(" ").appendF($[3]);135266320==this.tokAt(l+1)&&(l+=2,$[4]=this.intParameter(l), $[5]=3==this.tokAt(l+1)?this.floatParameter(++l):0,$[6]=2==this.tokAt(l+1)?this.intParameter(++l):-System.currentTimeMillis()%1E4,s.append(" points ").appendI(y($[4])).appendC(" ").appendF($[5]).appendC(" ").appendI(y($[6])));x="hydrogenOrbital";v=$;break;case 1073741866:s.append(" binary");continue;case 1073741868:s.append(" blockData");x="blockData";v=Boolean.TRUE;break;case 1074790451:case 554176565:H=!0;x=b.theToken.value;v=this.getCapSlabObject(l,!1);l=b.iToken;break;case 1073741876:d||this.invArg(); var j=!0,Fb=this.isFloatParameter(l+1)?this.floatParameter(++l):1.2,ib=this.isFloatParameter(l+1)?this.floatParameter(++l):10;if(this.chk)continue;if(10<ib){b.integerOutOfRange(0,10);return}s.append(" cavity ").appendF(Fb).append(" ").appendF(ib);this.addShapeProperty(z,"envelopeRadius",Float.$valueOf(ib));this.addShapeProperty(z,"cavityRadius",Float.$valueOf(Fb));x="cavity";break;case 1073741896:case 1073741900:x="contour";s.append(" contour");switch(this.tokAt(l+1)){case 1073741920:v=b.floatParameterSet(l+ 2,1,2147483647);s.append(" discrete ").append(JU.Escape.eAF(v));l=b.iToken;break;case 1073741981:I=this.getPoint3f(l+2,!1);(0>=I.z||I.y<I.x)&&this.invArg();I.z==y(I.z)&&I.z>I.y-I.x&&(I.z=(I.y-I.x)/I.z);v=I;l=b.iToken;s.append(" increment ").append(JU.Escape.eP(I));break;default:v=Integer.$valueOf(2==this.tokAt(l+1)?this.intParameter(++l):0),s.append(" ").appendO(v),2==this.tokAt(l+1)&&(this.addShapeProperty(z,x,v),v=Integer.$valueOf(-Math.abs(this.intParameter(++l))),s.append(" ").appendO(v))}break; case 1073741910:s.append(" cutoff ");269484193==this.tokAt(++l)?(x="cutoffPositive",v=Float.$valueOf(aa=this.floatParameter(++l)),s.append("+").appendO(v)):this.isFloatParameter(l)?(x="cutoff",v=Float.$valueOf(aa=this.floatParameter(l)),s.appendO(v)):(x="cutoffRange",v=b.floatParameterSet(l,2,2),this.addShapeProperty(z,"cutoff",Float.$valueOf(0)),s.append(JU.Escape.eAF(v)),l=b.iToken);break;case 1073741928:x="downsample";v=Integer.$valueOf(this.intParameter(++l));s.append(" downsample ").appendO(v); break;case 1073741931:x="eccentricity";v=b.getPoint4f(++l);s.append(" eccentricity ").append(JU.Escape.eP4(v));l=b.iToken;break;case 1074790508:s.append(" ed");this.setMoData(z,-1,null,0,!1,T,null,null);e=!0;continue;case 536870916:case 1073742041:s.append(" ").appendO(b.theToken.value);x="debug";v=536870916==b.theTok?Boolean.TRUE:Boolean.FALSE;break;case 1060869:s.append(" fixed");x="fixed";v=Boolean.TRUE;break;case 1073741962:s.append(" fullPlane");x="fullPlane";v=Boolean.TRUE;break;case 1073741966:case 1073741968:var Ya= 1073741968==b.theTok,x=""+b.theToken.value,qa=new JU.Lst,v=qa,E=e=!0;s.append(" ").append(x);var ba=this.paramAsStr(++l);if(ba.equals("=")){s.append(" =");ba=this.paramAsStr(++l);s.append(" ").append(JU.PT.esc(ba));qa.addLast(ba);this.chk||this.addShapeProperty(z,"func",this.createFunction("__iso__","x,y,z",ba));break}var jb=JU.PT.getQuotedAttribute(b.fullCommand,"# DATA"+(E?"2":""));null==jb?jb="inline":ba=jb;var Gb=0==ba.indexOf("data2d_"),Za=0==ba.indexOf("data3d_"),sa=ba.equals("inline");s.append(" inline"); qa.addLast(ba);var Hb=this.getPoint3f(++l,!1);s.append(" ").append(JU.Escape.eP(Hb));qa.addLast(Hb);var ra;K=++b.iToken;qa.addLast(ra=b.getPoint4f(K));s.append(" ").append(JU.Escape.eP4(ra));N=y(ra.x);Q=++b.iToken;qa.addLast(ra=b.getPoint4f(Q));s.append(" ").append(JU.Escape.eP4(ra));P=y(ra.x);qa.addLast(ra=b.getPoint4f(++b.iToken));s.append(" ").append(JU.Escape.eP4(ra));C=y(ra.x);(0==N||0==P||0==C)&&this.invArg();if(!this.chk){var ea=null,ja=null;if(Ya){sa?(N=Math.abs(N),P=Math.abs(P),C=Math.abs(C), ja=this.floatArraySetXYZ(++b.iToken,N,P,C)):ja=Za?this.vwr.getDataFloat3D(ba):this.vwr.functionXYZ(ba,N,P,C);N=Math.abs(N);P=Math.abs(P);C=Math.abs(C);null==ja&&(b.iToken=K,b.errorStr(53,"xyzdata is null."));if(ja.length!=N||ja[0].length!=P||ja[0][0].length!=C)b.iToken=K,b.errorStr(53,"xyzdata["+ja.length+"]["+ja[0].length+"]["+ja[0][0].length+"] is not of size ["+N+"]["+P+"]["+C+"]");qa.addLast(ja);s.append(" ").append(JU.Escape.e(ja))}else{sa?(N=Math.abs(N),P=Math.abs(P),ea=this.floatArraySet(++b.iToken, N,P)):Gb?(ea=this.vwr.getDataFloat2D(ba),N=null==ea?0:ea.length,P=3):(ea=this.vwr.functionXY(ba,N,P),N=Math.abs(N),P=Math.abs(P));null==ea&&(b.iToken=K,b.errorStr(53,"fdata is null."));ea.length!=N&&!Gb&&(b.iToken=K,b.errorStr(53,"fdata length is not correct: "+ea.length+" "+N+"."));for(ia=0;ia<N;ia++)null==ea[ia]&&(b.iToken=Q,b.errorStr(53,"fdata["+ia+"] is null.")),ea[ia].length!=P&&(b.iToken=Q,b.errorStr(53,"fdata["+ia+"] is not the right length: "+ea[ia].length+" "+P+"."));qa.addLast(ea);s.append(" ").append(JU.Escape.e(ea))}}l= b.iToken;break;case 1073741970:x="gridPoints";s.append(" gridPoints");break;case 1073741976:x="ignore";v=ca=this.atomExpressionAt(++l);s.append(" ignore ").append(JU.Escape.eBS(ca));l=b.iToken;break;case 1073741984:x="insideOut";s.append(" insideout");break;case 1073741988:case 1073741986:case 1073742100:s.append(" ").appendO(b.theToken.value);x="pocket";v=1073742100==b.theTok?Boolean.TRUE:Boolean.FALSE;break;case 1073742002:x="lobe";v=b.getPoint4f(++l);l=b.iToken;s.append(" lobe ").append(JU.Escape.eP4(v)); e=!0;break;case 1073742004:case 1073742006:x="lp";v=b.getPoint4f(++l);l=b.iToken;s.append(" lp ").append(JU.Escape.eP4(v));e=!0;break;case 1052700:(k||this.slen==l+1)&&this.invArg();k=!0;if((j||ta||B)&&!e)e=!0,this.addShapeProperty(z,"bsSolvent",ta||B?new JU.BS:b.lookupIdentifierValue("solvent")),this.addShapeProperty(z,"sasurface",Float.$valueOf(0));0==s.length()?(fa=this.getShapeProperty(24,"plane"),null==fa?null!=this.getShapeProperty(24,"contours")&&this.addShapeProperty(z,"nocontour",null):(this.addShapeProperty(z, "plane",fa),s.append("plane ").append(JU.Escape.eP4(fa)),f=!0,fa=null)):!e&&!f&&this.invArg();s.append("; isosurface map");this.addShapeProperty(z,"map",e?Boolean.TRUE:Boolean.FALSE);break;case 1073742014:x="maxset";v=Integer.$valueOf(this.intParameter(++l));s.append(" maxSet ").appendO(v);break;case 1073742020:x="minset";v=Integer.$valueOf(this.intParameter(++l));s.append(" minSet ").appendO(v);break;case 1073742112:e=!0;x="rad";v=b.getPoint4f(++l);l=b.iToken;s.append(" radical ").append(JU.Escape.eP4(v)); break;case 1073742027:x="fixed";v=Boolean.FALSE;s.append(" modelBased");break;case 1073742028:case 1073742135:case 1613758488:var Ea=b.theToken.value,Sa;1073742028==b.theTok?(x="molecular",s.append(" molecular"),Sa=this.isFloatParameter(l+1)?this.floatParameter(++l):1.4):(this.addShapeProperty(z,"bsSolvent",b.lookupIdentifierValue("solvent")),x=1073742135==b.theTok?"sasurface":"solvent",s.append(" ").appendO(b.theToken.value),Sa=this.isFloatParameter(l+1)?this.floatParameter(++l):this.vwr.getFloat(570425394)); s.append(" ").appendF(Sa);v=Float.$valueOf(Sa);1073741961==this.tokAt(l+1)&&(this.addShapeProperty(z,"doFullMolecular",null),s.append(" full"),l++);e=!0;break;case 1073742033:this.addShapeProperty(z,"fileType","Mrc");s.append(" mrc");continue;case 1073742064:case 1073742062:this.addShapeProperty(z,"fileType","Obj");s.append(" obj");continue;case 1073742034:this.addShapeProperty(z,"fileType","Msms");s.append(" msms");continue;case 1073742094:e&&this.invArg();x="phase";q=!0;v=4==this.tokAt(l+1)?this.stringParameter(++l): "_orb";s.append(" phase ").append(JU.PT.esc(v));break;case 1073742104:case 1073742122:x="resolution";v=Float.$valueOf(this.floatParameter(++l));s.append(" resolution ").appendO(v);break;case 1073742124:x="reverseColor";v=Boolean.TRUE;s.append(" reversecolor");break;case 1073742127:case 1073742146:x="sigma";v=Float.$valueOf(R=this.floatParameter(++l));s.append(" sigma ").appendO(v);break;case 1113198597:x="geodesic";v=Float.$valueOf(this.floatParameter(++l));s.append(" geosurface ").appendO(v);e=!0; break;case 1073742154:x="sphere";v=Float.$valueOf(this.floatParameter(++l));s.append(" sphere ").appendO(v);e=!0;break;case 1073742156:x="squareData";v=Boolean.TRUE;s.append(" squared");break;case 1073741983:x=!e&&!f&&!k?"readFile":"mapColor";da=this.stringParameter(++l);null==da&&this.invArg();h&&(da=JU.PT.replaceWithCharacter(da,"{,}|"," "));b.debugHigh&&JU.Logger.debug("pmesh inline data:\n"+da);v=this.chk?null:da;this.addShapeProperty(z,"fileName","");s.append(" INLINE ").append(JU.PT.esc(da)); e=!0;break;case 4:var Ta=!e&&!f,x=Ta&&!k?"readFile":"mapColor",X=this.paramAsStr(l);if(X.startsWith("=")&&1<X.length){var kb=this.vwr.setLoadFormat(X,"_",!1),X=kb[0],lb=!Ta||!Float.isNaN(aa)?null:kb[1],Ib=kb[2];if(null!=lb&&!this.chk){var aa=NaN,Jb=null==Ib?"MAP_SIGMA_DENS":"DIFF_SIGMA_DENS";try{var Ua=this.vwr.getFileAsString3(lb,!1,null);JU.Logger.info(Ua);Ua=JU.PT.split(Ua,Jb)[1];aa=JU.PT.parseFloat(Ua)}catch(Kb){if(U(Kb,Exception))JU.Logger.error(Jb+" -- could not read "+lb);else throw Kb;}0< aa&&(null!=Ib&&(Float.isNaN(R)&&(R=3),this.addShapeProperty(z,"sign",Boolean.TRUE)),this.showString("using cutoff = "+aa+(Float.isNaN(R)?"":" sigma="+R)),Float.isNaN(R)||(aa*=R,R=NaN,this.addShapeProperty(z,"sigma",Float.$valueOf(R))),this.addShapeProperty(z,"cutoff",Float.$valueOf(aa)),s.append(" cutoff ").appendF(aa))}0==Z&&(Ea="=xxxx",0>T&&(T=this.vwr.am.cmi),O=this.vwr.getModelUndeletedAtomsBitSet(T),0<=O.nextSetBit(0)&&(this.getWithinDistanceVector(z,2,null,O,!1),s.append(" within 2.0 ").append(JU.Escape.eBS(O)))); Ta&&(qb=!0)}Ta&&(this.vwr.getP("_fileType").equals("Pdb")&&Float.isNaN(R)&&Float.isNaN(aa))&&(this.addShapeProperty(z,"sigma",Float.$valueOf(-1)),s.append(" sigma -1.0"));0==X.length&&(0>T&&(T=this.vwr.am.cmi),X=b.getFullPathName(),v=this.vwr.ms.getInfo(T,"jmolSurfaceInfo"));var mb=-1;null==v&&2==this.tokAt(l+1)&&this.addShapeProperty(z,"fileIndex",Integer.$valueOf(mb=this.intParameter(++l)));var Na=4==this.tokAt(l+1)?this.stringParameter(++l):null,e=!0;if(this.chk)break;var Da,va=null;null==v&&(0<= b.fullCommand.indexOf("# FILE0=")?(X=JU.PT.getQuotedAttribute(b.fullCommand,"# FILE0"),1073741848==this.tokAt(l+1)&&(l+=2)):1073741848==this.tokAt(l+1)&&(va=this.vwr.fm.getFilePath(this.stringParameter(b.iToken=l+=2),!1,!1),Da=this.vwr.getFullPathNameOrError(va),va=Da[0],""!==this.vwr.fm.getPathForAllFiles()?(X=va,va=null):this.addShapeProperty(z,"localName",va)));!X.startsWith("cache://")&&null==Na&&(Da=this.vwr.getFullPathNameOrError(X),X=Da[0],null!=Da[1]&&b.errorStr(17,X+":"+Da[1]));this.showString("reading isosurface data from "+ X);null!=Na&&(v=this.vwr.fm.cacheGet(X,!1),this.addShapeProperty(z,"calculationType",Na));null==v&&(this.addShapeProperty(z,"fileName",X),null!=va&&(X=va),0<=mb&&s.append(" ").appendI(mb));s.append(" /*file*/").append(JU.PT.esc(X));null!=Na&&s.append(" ").append(JU.PT.esc(Na));break;case 4106:x="connections";switch(this.tokAt(++l)){case 10:case 1048577:v=p(-1,[this.atomExpressionAt(l).nextSetBit(0)]);break;default:v=p(-1,[y(b.floatParameterSet(l,1,1)[0])])}l=b.iToken;break;case 1095761923:x="atomIndex"; v=Integer.$valueOf(this.intParameter(++l));break;case 1073741999:x="link";s.append(" link");break;case 1614417948:24!=a&&this.invArg();269484193==this.tokAt(l+1)&&l++;x="extendGrid";v=Float.$valueOf(this.floatParameter(++l));s.append(" unitcell "+v);break;case 1073741994:24!=a&&this.invArg();I=this.getPoint3f(++l,!1);l=b.iToken;if(0>=I.x||0>=I.y||0>=I.z)break;I.x=y(I.x);I.y=y(I.y);I.z=y(I.z);s.append(" lattice ").append(JU.Escape.eP(I));k?(x="mapLattice",v=I):(la=I,1060869==this.tokAt(l+1)&&(s.append(" fixed"), ma=!0,l++));break;default:1073741824==b.theTok&&(x="thisID",v=da);if(!b.setMeshDisplayProperty(a,0,b.theTok)){if(JS.T.tokAttr(b.theTok,1073741824)&&!ua){this.setShapeId(a,l,ua);l=b.iToken;break}this.invArg()}0==c&&(c=l);l=this.slen-1}ua=12291!=b.theTok;na&&e&&this.invArg();null!=x&&this.addShapeProperty(z,x,v)}if(!this.chk){if((j||ta)&&!e)e=!0,this.addShapeProperty(z,"bsSolvent",ta?new JU.BS:b.lookupIdentifierValue("solvent")),this.addShapeProperty(z,"sasurface",Float.$valueOf(0));f&&(!e&&!k)&&(this.addShapeProperty(z, "nomap",Float.$valueOf(0)),e=!0);-1<=F&&this.addShapeProperty(z,"getSurfaceSets",Integer.$valueOf(F-1));if(null!=Fa)this.addShapeProperty(z,"colorDiscrete",Fa);else if("sets".equals(ha))this.addShapeProperty(z,"setColorScheme",null);else if(null!=ha){var Va=this.vwr.cm.getColorEncoder(ha);null!=Va&&(Va.isTranslucent=oa,Va.hi=3.4028235E38,this.addShapeProperty(z,"remapColor",Va))}if(e&&!g&&0!=s.indexOf(";")){z.add(0,w(-1,["newObject",null]));var Lb=null==S;Lb&&(S=JU.BSUtil.copy(this.vwr.bsA()));0> T&&(T=this.vwr.am.cmi);S.and(this.vwr.getModelUndeletedAtomsBitSet(T));null!=Ea&&(1<this.vwr.ms.getModelBS(S,!1).cardinality()&&b.errorStr(30,"ISOSURFACE "+Ea),Lb&&(z.add(0,w(-1,["select",S])),0==s.indexOf("; isosurface map")&&(s=(new JU.SB).append("; isosurface map select ").append(JU.Escape.eBS(S)).append(s.substring(16)))))}B&&!H&&(e||this.addShapeProperty(z,"sasurface",Float.$valueOf(0)),k||(this.addShapeProperty(z,"map",Boolean.TRUE),this.addShapeProperty(z,"select",O),this.addShapeProperty(z, "sasurface",Float.$valueOf(0))),this.addShapeProperty(z,"slab",this.getCapSlabObject(-100,!1)));var Mb=e&&this.vwr.getBoolean(603979934);Mb&&JU.Logger.startTimer("isosurface");this.setShapeProperty(a,"setProperties",z);Mb&&this.showString(JU.Logger.getTimerMsg("isosurface",0));qb&&(this.setShapeProperty(a,"token",Integer.$valueOf(1073742018)),this.setShapeProperty(a,"token",Integer.$valueOf(1073742046)),D=!0,s.append(" mesh nofill frontOnly"))}null!=la&&(this.setShapeProperty(a,"lattice",la),ma&& this.setShapeProperty(a,"fixLattice",Boolean.TRUE));null!=Ba&&this.setShapeProperty(a,"symops",Ba);D&&this.setShapeProperty(a,"token",Integer.$valueOf(1073741960));0<c&&(b.setMeshDisplayProperty(a,c,0)||this.invArg());if(!this.chk){var za=null,Aa=null;t&&(za=this.getShapeProperty(a,"area"),V(za,Float)?this.vwr.setFloatProperty("isosurfaceArea",za.floatValue()):this.vwr.g.setUserVariable("isosurfaceArea",JS.SV.getVariableAD(za)));r&&(Aa=r?this.getShapeProperty(a,"volume"):null,V(Aa,Float)?this.vwr.setFloatProperty("isosurfaceVolume", Aa.floatValue()):this.vwr.g.setUserVariable("isosurfaceVolume",JS.SV.getVariableAD(Aa)));if(!g){var ka=null;k&&!e?this.setShapeProperty(a,"finalize",s.toString()):e&&(G=s.toString(),this.setShapeProperty(a,"finalize",(0==G.indexOf("; isosurface map")?"":" select "+JU.Escape.eBS(S)+" ")+G),ka=this.getShapeProperty(a,"ID"),null!=ka&&!b.tQuiet&&(aa=this.getShapeProperty(a,"cutoff").floatValue(),Float.isNaN(aa)&&!Float.isNaN(R)&&JU.Logger.error("sigma not supported"),ka+=" created "+this.getShapeProperty(a, "message")));var nb,ob;if(t||r)nb=t?"isosurfaceArea = "+(V(za,Float)?""+za:JU.Escape.eAD(za)):null,ob=r?"isosurfaceVolume = "+(V(Aa,Float)?""+Aa:JU.Escape.eAD(Aa)):null,null==ka?(t&&this.showString(nb),r&&this.showString(ob)):(t&&(ka+="\n"+nb),r&&(ka+="\n"+ob));null!=ka&&this.showString(ka)}null!=wa&&this.setShapeProperty(a,"translucency",wa);this.setShapeProperty(a,"clear",null);pb&&this.setShapeProperty(a,"cache",null);26!=a&&this.listIsosurface(a)}}},"~N");e(c$,"lcaoCartoon",function(){var a=this.e; a.sm.loadShape(26);if(!(1073742001==a.tokAt(1)&&this.listIsosurface(26)))if(this.setShapeProperty(26,"init",a.fullCommand),1==this.slen)this.setShapeProperty(26,"lcaoID",null);else{for(var b=!1,c=null,c=1;c<this.slen;c++){var d=null,h=null;switch(this.getToken(c).tok){case 1074790451:case 554176565:d=a.theToken.value;1048588==this.tokAt(c+1)&&(a.iToken=c+1);h=this.getCapSlabObject(c,!0);c=a.iToken;break;case 12289:this.isosurface(26);return;case 528432:var m=h=0,g=0;switch(this.getToken(++c).tok){case 1112541205:h= 0.017453292*this.floatParameter(++c);break;case 1112541206:m=0.017453292*this.floatParameter(++c);break;case 1112541207:g=0.017453292*this.floatParameter(++c);break;default:this.invArg()}d="rotationAxis";h=JU.V3.new3(h,m,g);break;case 1048589:case 1610625028:case 3145768:d="on";break;case 1048588:case 12294:case 3145770:d="off";break;case 12291:d="delete";break;case 10:case 1048577:d="select";h=this.atomExpressionAt(c);c=a.iToken;break;case 1766856708:c=this.setColorOptions(null,c+1,26,-2);null!= c&&this.setShapeProperty(26,"settranslucency",c);c=a.iToken;b=!0;continue;case 603979967:case 1073742074:a.setMeshDisplayProperty(26,c,a.theTok);c=a.iToken;b=!0;continue;case 1113200651:case 4:h=this.paramAsStr(c).toLowerCase();h.equals("spacefill")&&(h="cpk");d="create";a.optParameterAsString(c+1).equalsIgnoreCase("molecular")&&(c++,d="molecular");break;case 135280133:10==this.tokAt(c+1)||1048577==this.tokAt(c+1)?(d="select",h=this.atomExpressionAt(c+1),c=a.iToken):(d="selectType",h=this.paramAsStr(++c), h.equals("spacefill")&&(h="cpk"));break;case 1073742138:d="scale";h=Float.$valueOf(this.floatParameter(++c));break;case 1073742004:case 1073742006:d="lonePair";break;case 1073742112:case 1073742111:d="radical";break;case 1073742028:d="molecular";break;case 1073741904:h=this.paramAsStr(++c);d="create";a.optParameterAsString(c+1).equalsIgnoreCase("molecular")&&(c++,d="molecular");break;case 1074790550:h=a.setShapeNameParameter(++c);c=a.iToken;b&&this.invArg();d="lcaoID";break;default:if(269484209== a.theTok||JS.T.tokAttr(a.theTok,1073741824))269484209!=a.theTok&&(h=this.paramAsStr(c)),b&&this.invArg(),d="lcaoID"}12291!=a.theTok&&(b=!0);null==d&&this.invArg();this.setShapeProperty(26,d,h)}this.setShapeProperty(26,"clear",null)}});e(c$,"contact",function(){var a=this.e;a.sm.loadShape(25);if(1073742001==this.tokAt(1)&&this.listIsosurface(25))return!1;var b=0;a.iToken=1;for(var c=null!=this.initIsosurface(25),d=c&&null==this.getShapeProperty(25,"ID"),h=null,m=null,g=null,e=null,f=null,k=!1,n=new JU.SB, q=2147483647,t=135266319,r=0,j=NaN,p=NaN,y=!0,C=null,H=null,B=0,D=!1,A=-2147483648,G=1<a.iToken,F=a.iToken;F<this.slen;++F){switch(g=this.getToken(F).tok){default:G=!0;if(!a.setMeshDisplayProperty(25,0,a.theTok)){269484209!=a.theTok&&!JS.T.tokAttr(a.theTok,1073741824)&&this.invArg();this.setShapeId(25,F,c);F=a.iToken;break}0==b&&(b=F);F=a.iToken;continue;case 1074790550:G=!0;this.setShapeId(25,++F,c);d=null==this.getShapeProperty(25,"ID");F=a.iToken;break;case 1766856708:switch(this.tokAt(F+1)){case 1073741914:g= 0;k=!0;n.append(" color density");F++;break;case 1141899272:g=0,D=!0,n.append(" color type"),F++}if(0==g)break;case 603979967:case 1073742074:G=!0;0==B&&(B=F);a.setMeshDisplayProperty(25,F,a.theTok);F=a.iToken;break;case 554176565:G=!0;H=this.getCapSlabObject(F,!1);this.setShapeProperty(25,"slab",H);F=a.iToken;break;case 1073741914:k=!0;n.append(" density");this.isFloatParameter(F+1)&&(null==f&&(f=u(1,0)),f[0]=-Math.abs(this.floatParameter(++F)),n.append(" "+-f[0]));break;case 1073742122:c=this.floatParameter(++F); 0<c&&(n.append(" resolution ").appendF(c),this.setShapeProperty(25,"resolution",Float.$valueOf(c)));break;case 1095766030:case 1095761935:A=1095761935==a.theTok?this.intParameter(++F):a.modelNumberParameter(++F);n.append(" modelIndex "+A);break;case 135266325:case 1276118018:j=this.floatParameter(++F);n.append(" within ").appendF(j);break;case 269484193:case 2:case 3:e=a.encodeRadiusParameter(F,!1,!1);if(null==e)return!1;n.append(" ").appendO(e);F=a.iToken;break;case 1073741990:case 1073741989:C= 1073741989==g?Boolean.TRUE:Boolean.FALSE;n.append(" ").appendO(a.theToken.value);break;case 1073742020:q=this.intParameter(++F);break;case 1612189718:case 1073741881:case 1649412120:r=g;n.append(" ").appendO(a.theToken.value);break;case 1073742135:this.isFloatParameter(F+1)&&(p=this.floatParameter(++F));case 1074790451:case 1073742036:case 3145756:y=!1;case 1276117512:case 1073741961:case 135266319:case 4106:t=g;n.append(" ").appendO(a.theToken.value);1073742135==g&&n.append(" ").appendF(p);break; case 1073742083:f=a.floatParameterSet(++F,1,10);F=a.iToken;break;case 10:case 1048577:(d||null!=m)&&this.invArg(),g=JU.BSUtil.copy(this.atomExpressionAt(F)),F=a.iToken,null==h?h=g:m=g,n.append(" ").append(JU.Escape.eBS(g))}c=12291!=a.theTok}!G&&null==h&&this.error(13);if(this.chk)return!1;if(null!=h){1649412120==r&&null==e&&(e=new J.atomdata.RadiusData(null,0,J.atomdata.RadiusData.EnumType.OFFSET,J.c.VDW.AUTO));F=null==e?new J.atomdata.RadiusData(null,0.26,J.atomdata.RadiusData.EnumType.OFFSET,J.c.VDW.AUTO): e;m=1073742036==t&&null==m&&null!=C&&C.booleanValue()?h:a.getMathExt().setContactBitSets(h,m,y,j,F,!0);switch(t){case 1074790451:case 1073742135:F=a.lookupIdentifierValue("solvent");h.andNot(F);m.andNot(F);m.andNot(h);break;case 3145756:m.andNot(h);break;case 1073742036:2147483647==q&&(q=100),this.setShapeProperty(25,"minset",Integer.$valueOf(q)),n.append(" minSet ").appendI(q),null==f&&(f=u(-1,[0.5,2]))}null!=C&&(f=null==f?u(2,0):JU.AU.ensureLengthA(f,2),f[1]=C.booleanValue()?1:2);null!=f&&n.append(" parameters ").append(JU.Escape.eAF(f)); this.setShapeProperty(25,"set",w(-1,[Integer.$valueOf(r),Integer.$valueOf(t),Boolean.$valueOf(k),Boolean.$valueOf(D),h,m,e,Float.$valueOf(p),f,Integer.$valueOf(A),n.toString()]));0<B&&a.setMeshDisplayProperty(25,B,0)}0<b&&(a.setMeshDisplayProperty(25,b,0)||this.invArg());null!=H&&null!=h&&this.setShapeProperty(25,"slab",H);if(null!=h&&(1073742036==t||y)){h=this.getShapeProperty(25,"volume");b=1073741961==t;if(JU.AU.isAD(h))for(F=a=0;F<h.length;F++)a+=b?h[F]:Math.abs(h[F]);else a=h.floatValue();a= Math.round(1E3*a)/1E3;if(k||1276117512!=t)k=this.getShapeProperty(25,"nSets").intValue(),k="Contacts: "+(0>k?E(-k/2):k),0!=a&&(k+=", with "+(b?"approx ":"net ")+"volume "+a+" A^3"),this.showString(k)}return!0});e(c$,"cgo",function(){var a=this.e;a.sm.loadShape(23);if(1073742001==this.tokAt(1)&&this.listIsosurface(23))return!1;for(var b=0,c=null!=this.initIsosurface(23),d=c&&null==this.getShapeProperty(23,"ID"),h=!1,m=null,g=3.4028235E38,e=p(-1,[-2147483648]),f=0,k=a.iToken;k<this.slen;++k){var n= null,q=null;switch(this.getToken(k).tok){case 269484096:case 1073742195:case 7:(null!=m||d)&&this.invArg();m=new JU.Lst;k=p(-1,[k,this.slen]);a.getShapePropertyData(23,"data",w(-1,[this.st,k,m,this.vwr]))||this.invArg();k=k[0];continue;case 1073742138:++k>=this.slen&&this.error(34);switch(this.getToken(k).tok){case 2:f=this.intParameter(k);continue;case 3:f=Math.round(100*this.floatParameter(k));continue}this.error(34);break;case 1766856708:case 603979967:case 1073742074:g=this.getColorTrans(a,k, !1,e);k=a.iToken;c=!0;continue;case 1074790550:this.setShapeId(23,++k,c);d=null==this.getShapeProperty(23,"ID");k=a.iToken;break;default:if(!a.setMeshDisplayProperty(23,0,a.theTok)){if(269484209==a.theTok||JS.T.tokAttr(a.theTok,1073741824)){this.setShapeId(23,k,c);k=a.iToken;break}this.invArg()}0==b&&(b=k);k=a.iToken;continue}c=12291!=a.theTok;null!=m&&!h&&(n="points",q=Integer.$valueOf(f),h=!0,f=0);null!=n&&this.setShapeProperty(23,n,q)}this.finalizeObject(23,e[0],g,f,null!=m,m,b,null);return!0}); e(c$,"getAtomicPotentials",function(a,b,c){var d=u(this.vwr.ms.ac,0),h=J.api.Interface.getOption("quantum.MlpCalculation",this.vwr,"script");h.set(this.vwr);c=null==c?null:this.vwr.getFileAsString3(c,!1,null);h.assignPotentials(this.vwr.ms.at,d,this.vwr.getSmartsMatch("a",a),this.vwr.getSmartsMatch("/noAromatic/[$(C=O),$(O=C),$(NC=O)]",a),b,c);return d},"JU.BS,JU.BS,~S");e(c$,"getCapSlabObject",function(a,b){if(0>a)return JU.TempArray.getSlabWithinRange(a,0);var c=this.e,d=null,h=554176565==this.tokAt(a), m=this.tokAt(a+1),g=null,e=g=null,f=null,k=null;if(603979967==m)switch(f=this.isFloatParameter(++a+1)?this.floatParameter(++a):0.5,c.isColorParam(a+1)?(f=Short.$valueOf(JU.C.getColixTranslucent3(JU.C.getColix(c.getArgbParam(a+1)),0!=f,f)),a=c.iToken):f=Short.$valueOf(JU.C.getColixTranslucent3(1,0!=f,f)),m=this.tokAt(a+1)){case 1073742018:case 1073741938:k=Integer.$valueOf(m);m=this.tokAt(++a+1);break;default:k=Integer.$valueOf(1073741938)}switch(m){case 1048588:return c.iToken=a+1,Integer.$valueOf(-2147483648); case 1048587:c.iToken=a+1;break;case 1048582:a++;d=w(-1,[Float.$valueOf(1),this.paramAsStr(++a)]);m=1073742018;break;case 135266325:a++;if(1073742114==this.tokAt(++a))d=this.floatParameter(++a),m=this.floatParameter(++a),d=w(-1,[Float.$valueOf(d),Float.$valueOf(m)]),m=1073742114;else if(this.isFloatParameter(a)){d=this.floatParameter(a);if(c.isCenterParameter(++a))if(g=this.centerParameter(a),this.chk||!V(c.expressionResult,JU.BS))g=w(-1,[g]);else for(var n=this.vwr.ms.at,e=c.expressionResult,g=Array(e.cardinality()), q=0,t=e.nextSetBit(0);0<=t;t=e.nextSetBit(t+1),q++)g[q]=n[t];else g=c.getPointArray(a,-1,!1);0==g.length&&(c.iToken=a,this.invArg());d=w(-1,[Float.$valueOf(d),g,e])}else d=c.getPointArray(a,4,!1),m=1679429641;break;case 1679429641:c.iToken=a+1;d=JU.BoxInfo.getUnitCellPoints(this.vwr.ms.getBBoxVertices(),null);break;case 1073741872:case 1614417948:c.iToken=a+1;c=this.vwr.getCurrentUnitCell();if(null==c)1614417948==m&&this.invArg();else{g=JU.BoxInfo.getUnitCellPoints(c.getUnitCellVerticesNoOffset(), c.getCartesianOffset());c=y(c.getUnitCellInfoType(6));d=e=null;switch(c){case 1:d=JU.V3.newVsub(g[2],g[0]),d.scale(1E3);case 2:e=JU.V3.newVsub(g[1],g[0]),e.scale(1E3),g[0].sub(e),g[1].scale(2E3),1==c&&(g[0].sub(d),g[2].scale(2E3))}d=g}break;case 10:case 1048577:if(d=this.atomExpressionAt(a+1),m=3,!c.isCenterParameter(++c.iToken)){h=!0;break}default:if(!b&&h&&this.isFloatParameter(a+1)){d=this.floatParameter(++a);if(!this.isFloatParameter(a+1))return Integer.$valueOf(y(d));m=this.floatParameter(++a); d=w(-1,[Float.$valueOf(d),Float.$valueOf(m)]);m=1073742114;break}g=c.planeParameter(++a);m=this.isFloatParameter(c.iToken+1)?this.floatParameter(++c.iToken):NaN;Float.isNaN(m)||(g.w-=m);d=g;m=135266319}f=null==k?null:w(-1,[k,f]);return JU.TempArray.getSlabObjectType(m,d,!h,f)},"~N,~B");e(c$,"setColorOptions",function(a,b,c,d){var h=this.e;this.getToken(b);var m="opaque";if(603979967==h.theTok)if(m="translucent",0>d){var g=this.isFloatParameter(b+1)?this.floatParameter(++b):3.4028235E38;h.setShapeTranslucency(c, null,"translucent",g,null);null!=a&&(a.append(" translucent"),3.4028235E38!=g&&a.append(" ").appendF(g))}else h.setMeshDisplayProperty(c,b,h.theTok);else 1073742074==h.theTok?0<=d&&h.setMeshDisplayProperty(c,b,h.theTok):h.iToken--;d=Math.abs(d);for(g=0;g<d;g++)if(h.isColorParam(h.iToken+1)){var e=h.getArgbParam(++h.iToken);this.setShapeProperty(c,"colorRGB",Integer.$valueOf(e));null!=a&&a.append(" ").append(JU.Escape.escapeColor(e))}else if(h.iToken<b)this.invArg();else break;return m},"JU.SB,~N,~N,~N"); e(c$,"createFunction",function(a,b,c){var d=(new JS.ScriptEval).setViewer(this.vwr);try{d.compileScript(null,"function "+a+"("+b+") { return "+c+"}",!1);var h=new JU.Lst;for(a=0;a<b.length;a+=2)h.addLast(JS.SV.newV(3,Float.$valueOf(0)).setName(b.substring(a,a+1)));return w(-1,[d.aatoken[0][1].value,h])}catch(m){if(U(m,Exception))return null;throw m;}},"~S,~S,~S");e(c$,"getWithinDistanceVector",function(a,b,c,d,h){var m=new JU.Lst,g=Array(2);if(null==d){var e=JU.P3.new3(b,b,b),f=JU.P3.newP(c);f.sub(e); e.add(c);g[0]=f;g[1]=e;m.addLast(c)}else c=this.vwr.ms.getBoxInfo(d,-Math.abs(b)),g[0]=c.getBoundBoxVertices()[0],g[1]=c.getBoundBoxVertices()[7],1==d.cardinality()&&m.addLast(this.vwr.ms.at[d.nextSetBit(0)]);1==m.size()&&!h&&(this.addShapeProperty(a,"withinDistance",Float.$valueOf(b)),this.addShapeProperty(a,"withinPoint",m.get(0)));this.addShapeProperty(a,h?"displayWithin":"withinPoints",w(-1,[Float.$valueOf(b),g,d,m]))},"JU.Lst,~N,JU.P3,JU.BS,~B");e(c$,"addShapeProperty",function(a,b,c){this.chk|| a.addLast(w(-1,[b,c]))},"JU.Lst,~S,~O");e(c$,"floatArraySetXYZ",function(a,b,c,d){var h=this.e,m=this.tokAt(a++);1073742195==m&&(m=this.tokAt(a++));(269484096!=m||0>=b)&&this.invArg();for(var g=JU.AU.newFloat3(b,-1),e=0;269484097!=m;)switch(m=this.getToken(a).tok,m){case 1073742195:case 269484097:continue;case 269484080:a++;break;case 269484096:g[e++]=this.floatArraySet(a,c,d);a=++h.iToken;m=0;e==b&&269484097!=this.tokAt(a)&&this.invArg();break;default:this.invArg()}return g},"~N,~N,~N,~N");e(c$, "floatArraySet",function(a,b,c){var d=this.tokAt(a++);1073742195==d&&(d=this.tokAt(a++));269484096!=d&&this.invArg();for(var h=JU.AU.newFloat2(b),m=0;269484097!=d;)switch(d=this.getToken(a).tok,d){case 1073742195:case 269484097:continue;case 269484080:a++;break;case 269484096:a++;d=u(c,0);h[m++]=d;for(var g=0;g<c;g++)d[g]=this.floatParameter(a++),269484080==this.tokAt(a)&&a++;269484097!=this.tokAt(a++)&&this.invArg();d=0;m==b&&269484097!=this.tokAt(a)&&this.invArg();break;default:this.invArg()}return h}, "~N,~N,~N");e(c$,"initIsosurface",function(a){var b=this.e;this.setShapeProperty(a,"init",b.fullCommand);b.iToken=0;var c=this.tokAt(1),d=this.tokAt(2);if(12291==c||12291==d&&1048579==this.tokAt(++b.iToken))return this.setShapeProperty(a,"delete",null),b.iToken+=2,this.slen>b.iToken&&(this.setShapeProperty(a,"init",b.fullCommand),this.setShapeProperty(a,"thisID","+PREVIOUS_MESH+")),null;b.iToken=1;return!b.setMeshDisplayProperty(a,0,c)&&(this.setShapeProperty(a,"thisID","+PREVIOUS_MESH+"),22!=a&& this.setShapeProperty(a,"title",w(-1,[b.thisCommand])),1074790550!=c&&(269484209==d||269484209==c&&b.setMeshDisplayProperty(a,0,d)))?(a=this.setShapeId(a,1,!1),b.iToken++,a):null},"~N");e(c$,"listIsosurface",function(a){var b=3<this.slen?"0":0==this.tokAt(2)?"":" "+this.getToken(2).value;this.chk||this.showString(this.getShapeProperty(a,"list"+b));return!0},"~N")});H("JU");sa(JU,"Triangulator");H("JU");K(["JU.Triangulator","JU.P3i"],"JU.TriangleData",["JU.AU","$.BS","$.P3","JU.BSUtil"],function(){c$= wa(JU,"TriangleData",null,JU.Triangulator);j(c$,"intersectPlane",function(a,b,c){if(null==a)return b.addLast(JU.TriangleData.fullCubePolygon),b;var d=b.get(0);0!=c&&b.clear();for(var h=u(8,0),m=Array(12),g=0,e=0;8>e;e++)h[e]=a.x*d[e].x+a.y*d[e].y+a.z*d[e].z+a.w,0>h[e]&&(g|=JU.TriangleData.Pwr2[e]);a=JU.TriangleData.triangleTable2[g];if(null==a)return null;for(e=0;24>e;e+=2){var g=JU.TriangleData.edgeVertexes[e],f=JU.TriangleData.edgeVertexes[e+1],k=JU.P3.newP(d[f]);k.sub(d[g]);k.scale(h[g]/(h[g]- h[f]));k.add(d[g]);m[e>>1]=k}if(0==c){c=new JU.BS;b.clear();for(e=0;e<a.length;e++)c.set(a[e]),2==e%4&&e++;e=JU.BSUtil.cardinalityOf(c);h=Array(e);b.addLast(h);d=p(12,0);for(e=g=0;e<a.length;e++)f=a[e],c.get(f)&&(c.clear(f),h[g]=m[f],d[f]=g++),2==e%4&&e++;m=JU.AU.newInt2(a.length>>2);b.addLast(m);for(e=0;e<a.length;e++)m[e>>2]=p(-1,[d[a[e++]],d[a[e++]],d[a[e++]],a[e]]);return b}for(e=0;e<a.length;e++)d=m[a[e++]],h=m[a[e++]],g=m[a[e++]],1==(c&1)&&b.addLast(w(-1,[d,h,g])),2==(c&2)&&(f=a[e],1==(f&1)&& b.addLast(w(-1,[d,h])),2==(f&2)&&b.addLast(w(-1,[h,g])),4==(f&4)&&b.addLast(w(-1,[d,g])));return b},"JU.P4,JU.Lst,~N");R(c$,"Pwr2",p(-1,[1,2,4,8,16,32,64,128,256,512,1024,2048]),"fullCubePolygon",w(-1,[p(-1,[0,4,5,3]),p(-1,[5,1,0,3]),p(-1,[1,5,6,2]),p(-1,[6,2,1,3]),p(-1,[2,6,7,2]),p(-1,[7,3,2,3]),p(-1,[3,7,4,2]),p(-1,[4,0,3,2]),p(-1,[6,5,4,0]),p(-1,[4,7,6,0]),p(-1,[0,1,2,0]),p(-1,[2,3,0,0])]));c$.cubeVertexOffsets=c$.prototype.cubeVertexOffsets=w(-1,[JU.P3i.new3(0,0,0),JU.P3i.new3(1,0,0),JU.P3i.new3(1, 0,1),JU.P3i.new3(0,0,1),JU.P3i.new3(0,1,0),JU.P3i.new3(1,1,0),JU.P3i.new3(1,1,1),JU.P3i.new3(0,1,1)]);R(c$,"edgeVertexes",f(-1,[0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),"triangleTable2",w(-1,[null,f(-1,[0,8,3,7]),f(-1,[0,1,9,7]),f(-1,[1,8,3,6,9,8,1,5]),f(-1,[1,2,10,7]),f(-1,[0,8,3,7,1,2,10,7]),f(-1,[9,2,10,6,0,2,9,5]),f(-1,[2,8,3,6,2,10,8,1,10,9,8,3]),f(-1,[3,11,2,7]),f(-1,[0,11,2,6,8,11,0,5]),f(-1,[1,9,0,7,2,3,11,7]),f(-1,[1,11,2,6,1,9,11,1,9,8,11,3]),f(-1,[3,10,1,6,11,10,3,5]),f(-1,[0, 10,1,6,0,8,10,1,8,11,10,3]),f(-1,[3,9,0,6,3,11,9,1,11,10,9,3]),f(-1,[9,8,10,5,10,8,11,6]),f(-1,[4,7,8,7]),f(-1,[4,3,0,6,7,3,4,5]),f(-1,[0,1,9,7,8,4,7,7]),f(-1,[4,1,9,6,4,7,1,1,7,3,1,3]),f(-1,[1,2,10,7,8,4,7,7]),f(-1,[3,4,7,6,3,0,4,3,1,2,10,7]),f(-1,[9,2,10,6,9,0,2,3,8,4,7,7]),f(-1,[2,10,9,3,2,9,7,0,2,7,3,6,7,9,4,6]),f(-1,[8,4,7,7,3,11,2,7]),f(-1,[11,4,7,6,11,2,4,1,2,0,4,3]),f(-1,[9,0,1,7,8,4,7,7,2,3,11,7]),f(-1,[4,7,11,3,9,4,11,1,9,11,2,2,9,2,1,6]),f(-1,[3,10,1,6,3,11,10,3,7,8,4,7]),f(-1,[1,11,10, 6,1,4,11,0,1,0,4,3,7,11,4,5]),f(-1,[4,7,8,7,9,0,11,1,9,11,10,6,11,0,3,6]),f(-1,[4,7,11,3,4,11,9,4,9,11,10,6]),f(-1,[9,5,4,7]),f(-1,[9,5,4,7,0,8,3,7]),f(-1,[0,5,4,6,1,5,0,5]),f(-1,[8,5,4,6,8,3,5,1,3,1,5,3]),f(-1,[1,2,10,7,9,5,4,7]),f(-1,[3,0,8,7,1,2,10,7,4,9,5,7]),f(-1,[5,2,10,6,5,4,2,1,4,0,2,3]),f(-1,[2,10,5,3,3,2,5,1,3,5,4,2,3,4,8,6]),f(-1,[9,5,4,7,2,3,11,7]),f(-1,[0,11,2,6,0,8,11,3,4,9,5,7]),f(-1,[0,5,4,6,0,1,5,3,2,3,11,7]),f(-1,[2,1,5,3,2,5,8,0,2,8,11,6,4,8,5,5]),f(-1,[10,3,11,6,10,1,3,3,9,5,4, 7]),f(-1,[4,9,5,7,0,8,1,5,8,10,1,2,8,11,10,3]),f(-1,[5,4,0,3,5,0,11,0,5,11,10,6,11,0,3,6]),f(-1,[5,4,8,3,5,8,10,4,10,8,11,6]),f(-1,[9,7,8,6,5,7,9,5]),f(-1,[9,3,0,6,9,5,3,1,5,7,3,3]),f(-1,[0,7,8,6,0,1,7,1,1,5,7,3]),f(-1,[1,5,3,5,3,5,7,6]),f(-1,[9,7,8,6,9,5,7,3,10,1,2,7]),f(-1,[10,1,2,7,9,5,0,5,5,3,0,2,5,7,3,3]),f(-1,[8,0,2,3,8,2,5,0,8,5,7,6,10,5,2,5]),f(-1,[2,10,5,3,2,5,3,4,3,5,7,6]),f(-1,[7,9,5,6,7,8,9,3,3,11,2,7]),f(-1,[9,5,7,3,9,7,2,0,9,2,0,6,2,7,11,6]),f(-1,[2,3,11,7,0,1,8,5,1,7,8,2,1,5,7,3]), f(-1,[11,2,1,3,11,1,7,4,7,1,5,6]),f(-1,[9,5,8,5,8,5,7,6,10,1,3,3,10,3,11,6]),f(-1,[5,7,0,1,5,0,9,6,7,11,0,1,1,0,10,5,11,10,0,1]),f(-1,[11,10,0,1,11,0,3,6,10,5,0,1,8,0,7,5,5,7,0,1]),f(-1,[11,10,5,3,7,11,5,5]),f(-1,[10,6,5,7]),f(-1,[0,8,3,7,5,10,6,7]),f(-1,[9,0,1,7,5,10,6,7]),f(-1,[1,8,3,6,1,9,8,3,5,10,6,7]),f(-1,[1,6,5,6,2,6,1,5]),f(-1,[1,6,5,6,1,2,6,3,3,0,8,7]),f(-1,[9,6,5,6,9,0,6,1,0,2,6,3]),f(-1,[5,9,8,3,5,8,2,0,5,2,6,6,3,2,8,5]),f(-1,[2,3,11,7,10,6,5,7]),f(-1,[11,0,8,6,11,2,0,3,10,6,5,7]),f(-1, [0,1,9,7,2,3,11,7,5,10,6,7]),f(-1,[5,10,6,7,1,9,2,5,9,11,2,2,9,8,11,3]),f(-1,[6,3,11,6,6,5,3,1,5,1,3,3]),f(-1,[0,8,11,3,0,11,5,0,0,5,1,6,5,11,6,6]),f(-1,[3,11,6,3,0,3,6,1,0,6,5,2,0,5,9,6]),f(-1,[6,5,9,3,6,9,11,4,11,9,8,6]),f(-1,[5,10,6,7,4,7,8,7]),f(-1,[4,3,0,6,4,7,3,3,6,5,10,7]),f(-1,[1,9,0,7,5,10,6,7,8,4,7,7]),f(-1,[10,6,5,7,1,9,7,1,1,7,3,6,7,9,4,6]),f(-1,[6,1,2,6,6,5,1,3,4,7,8,7]),f(-1,[1,2,5,5,5,2,6,6,3,0,4,3,3,4,7,6]),f(-1,[8,4,7,7,9,0,5,5,0,6,5,2,0,2,6,3]),f(-1,[7,3,9,1,7,9,4,6,3,2,9,1,5,9, 6,5,2,6,9,1]),f(-1,[3,11,2,7,7,8,4,7,10,6,5,7]),f(-1,[5,10,6,7,4,7,2,1,4,2,0,6,2,7,11,6]),f(-1,[0,1,9,7,4,7,8,7,2,3,11,7,5,10,6,7]),f(-1,[9,2,1,6,9,11,2,2,9,4,11,1,7,11,4,5,5,10,6,7]),f(-1,[8,4,7,7,3,11,5,1,3,5,1,6,5,11,6,6]),f(-1,[5,1,11,1,5,11,6,6,1,0,11,1,7,11,4,5,0,4,11,1]),f(-1,[0,5,9,6,0,6,5,2,0,3,6,1,11,6,3,5,8,4,7,7]),f(-1,[6,5,9,3,6,9,11,4,4,7,9,5,7,11,9,1]),f(-1,[10,4,9,6,6,4,10,5]),f(-1,[4,10,6,6,4,9,10,3,0,8,3,7]),f(-1,[10,0,1,6,10,6,0,1,6,4,0,3]),f(-1,[8,3,1,3,8,1,6,0,8,6,4,6,6,1,10, 6]),f(-1,[1,4,9,6,1,2,4,1,2,6,4,3]),f(-1,[3,0,8,7,1,2,9,5,2,4,9,2,2,6,4,3]),f(-1,[0,2,4,5,4,2,6,6]),f(-1,[8,3,2,3,8,2,4,4,4,2,6,6]),f(-1,[10,4,9,6,10,6,4,3,11,2,3,7]),f(-1,[0,8,2,5,2,8,11,6,4,9,10,3,4,10,6,6]),f(-1,[3,11,2,7,0,1,6,1,0,6,4,6,6,1,10,6]),f(-1,[6,4,1,1,6,1,10,6,4,8,1,1,2,1,11,5,8,11,1,1]),f(-1,[9,6,4,6,9,3,6,0,9,1,3,3,11,6,3,5]),f(-1,[8,11,1,1,8,1,0,6,11,6,1,1,9,1,4,5,6,4,1,1]),f(-1,[3,11,6,3,3,6,0,4,0,6,4,6]),f(-1,[6,4,8,3,11,6,8,5]),f(-1,[7,10,6,6,7,8,10,1,8,9,10,3]),f(-1,[0,7,3,6, 0,10,7,0,0,9,10,3,6,7,10,5]),f(-1,[10,6,7,3,1,10,7,1,1,7,8,2,1,8,0,6]),f(-1,[10,6,7,3,10,7,1,4,1,7,3,6]),f(-1,[1,2,6,3,1,6,8,0,1,8,9,6,8,6,7,6]),f(-1,[2,6,9,1,2,9,1,6,6,7,9,1,0,9,3,5,7,3,9,1]),f(-1,[7,8,0,3,7,0,6,4,6,0,2,6]),f(-1,[7,3,2,3,6,7,2,5]),f(-1,[2,3,11,7,10,6,8,1,10,8,9,6,8,6,7,6]),f(-1,[2,0,7,1,2,7,11,6,0,9,7,1,6,7,10,5,9,10,7,1]),f(-1,[1,8,0,6,1,7,8,2,1,10,7,1,6,7,10,5,2,3,11,7]),f(-1,[11,2,1,3,11,1,7,4,10,6,1,5,6,7,1,1]),f(-1,[8,9,6,1,8,6,7,6,9,1,6,1,11,6,3,5,1,3,6,1]),f(-1,[0,9,1,7,11, 6,7,7]),f(-1,[7,8,0,3,7,0,6,4,3,11,0,5,11,6,0,1]),f(-1,[7,11,6,7]),f(-1,[7,6,11,7]),f(-1,[3,0,8,7,11,7,6,7]),f(-1,[0,1,9,7,11,7,6,7]),f(-1,[8,1,9,6,8,3,1,3,11,7,6,7]),f(-1,[10,1,2,7,6,11,7,7]),f(-1,[1,2,10,7,3,0,8,7,6,11,7,7]),f(-1,[2,9,0,6,2,10,9,3,6,11,7,7]),f(-1,[6,11,7,7,2,10,3,5,10,8,3,2,10,9,8,3]),f(-1,[7,2,3,6,6,2,7,5]),f(-1,[7,0,8,6,7,6,0,1,6,2,0,3]),f(-1,[2,7,6,6,2,3,7,3,0,1,9,7]),f(-1,[1,6,2,6,1,8,6,0,1,9,8,3,8,7,6,3]),f(-1,[10,7,6,6,10,1,7,1,1,3,7,3]),f(-1,[10,7,6,6,1,7,10,4,1,8,7,2,1, 0,8,3]),f(-1,[0,3,7,3,0,7,10,0,0,10,9,6,6,10,7,5]),f(-1,[7,6,10,3,7,10,8,4,8,10,9,6]),f(-1,[6,8,4,6,11,8,6,5]),f(-1,[3,6,11,6,3,0,6,1,0,4,6,3]),f(-1,[8,6,11,6,8,4,6,3,9,0,1,7]),f(-1,[9,4,6,3,9,6,3,0,9,3,1,6,11,3,6,5]),f(-1,[6,8,4,6,6,11,8,3,2,10,1,7]),f(-1,[1,2,10,7,3,0,11,5,0,6,11,2,0,4,6,3]),f(-1,[4,11,8,6,4,6,11,3,0,2,9,5,2,10,9,3]),f(-1,[10,9,3,1,10,3,2,6,9,4,3,1,11,3,6,5,4,6,3,1]),f(-1,[8,2,3,6,8,4,2,1,4,6,2,3]),f(-1,[0,4,2,5,4,6,2,3]),f(-1,[1,9,0,7,2,3,4,1,2,4,6,6,4,3,8,6]),f(-1,[1,9,4,3,1, 4,2,4,2,4,6,6]),f(-1,[8,1,3,6,8,6,1,0,8,4,6,3,6,10,1,3]),f(-1,[10,1,0,3,10,0,6,4,6,0,4,6]),f(-1,[4,6,3,1,4,3,8,6,6,10,3,1,0,3,9,5,10,9,3,1]),f(-1,[10,9,4,3,6,10,4,5]),f(-1,[4,9,5,7,7,6,11,7]),f(-1,[0,8,3,7,4,9,5,7,11,7,6,7]),f(-1,[5,0,1,6,5,4,0,3,7,6,11,7]),f(-1,[11,7,6,7,8,3,4,5,3,5,4,2,3,1,5,3]),f(-1,[9,5,4,7,10,1,2,7,7,6,11,7]),f(-1,[6,11,7,7,1,2,10,7,0,8,3,7,4,9,5,7]),f(-1,[7,6,11,7,5,4,10,5,4,2,10,2,4,0,2,3]),f(-1,[3,4,8,6,3,5,4,2,3,2,5,1,10,5,2,5,11,7,6,7]),f(-1,[7,2,3,6,7,6,2,3,5,4,9,7]),f(-1, [9,5,4,7,0,8,6,1,0,6,2,6,6,8,7,6]),f(-1,[3,6,2,6,3,7,6,3,1,5,0,5,5,4,0,3]),f(-1,[6,2,8,1,6,8,7,6,2,1,8,1,4,8,5,5,1,5,8,1]),f(-1,[9,5,4,7,10,1,6,5,1,7,6,2,1,3,7,3]),f(-1,[1,6,10,6,1,7,6,2,1,0,7,1,8,7,0,5,9,5,4,7]),f(-1,[4,0,10,1,4,10,5,6,0,3,10,1,6,10,7,5,3,7,10,1]),f(-1,[7,6,10,3,7,10,8,4,5,4,10,5,4,8,10,1]),f(-1,[6,9,5,6,6,11,9,1,11,8,9,3]),f(-1,[3,6,11,6,0,6,3,4,0,5,6,2,0,9,5,3]),f(-1,[0,11,8,6,0,5,11,0,0,1,5,3,5,6,11,3]),f(-1,[6,11,3,3,6,3,5,4,5,3,1,6]),f(-1,[1,2,10,7,9,5,11,1,9,11,8,6,11,5,6, 6]),f(-1,[0,11,3,6,0,6,11,2,0,9,6,1,5,6,9,5,1,2,10,7]),f(-1,[11,8,5,1,11,5,6,6,8,0,5,1,10,5,2,5,0,2,5,1]),f(-1,[6,11,3,3,6,3,5,4,2,10,3,5,10,5,3,1]),f(-1,[5,8,9,6,5,2,8,0,5,6,2,3,3,8,2,5]),f(-1,[9,5,6,3,9,6,0,4,0,6,2,6]),f(-1,[1,5,8,1,1,8,0,6,5,6,8,1,3,8,2,5,6,2,8,1]),f(-1,[1,5,6,3,2,1,6,5]),f(-1,[1,3,6,1,1,6,10,6,3,8,6,1,5,6,9,5,8,9,6,1]),f(-1,[10,1,0,3,10,0,6,4,9,5,0,5,5,6,0,1]),f(-1,[0,3,8,7,5,6,10,7]),f(-1,[10,5,6,7]),f(-1,[11,5,10,6,7,5,11,5]),f(-1,[11,5,10,6,11,7,5,3,8,3,0,7]),f(-1,[5,11,7, 6,5,10,11,3,1,9,0,7]),f(-1,[10,7,5,6,10,11,7,3,9,8,1,5,8,3,1,3]),f(-1,[11,1,2,6,11,7,1,1,7,5,1,3]),f(-1,[0,8,3,7,1,2,7,1,1,7,5,6,7,2,11,6]),f(-1,[9,7,5,6,9,2,7,0,9,0,2,3,2,11,7,3]),f(-1,[7,5,2,1,7,2,11,6,5,9,2,1,3,2,8,5,9,8,2,1]),f(-1,[2,5,10,6,2,3,5,1,3,7,5,3]),f(-1,[8,2,0,6,8,5,2,0,8,7,5,3,10,2,5,5]),f(-1,[9,0,1,7,5,10,3,1,5,3,7,6,3,10,2,6]),f(-1,[9,8,2,1,9,2,1,6,8,7,2,1,10,2,5,5,7,5,2,1]),f(-1,[1,3,5,5,3,7,5,3]),f(-1,[0,8,7,3,0,7,1,4,1,7,5,6]),f(-1,[9,0,3,3,9,3,5,4,5,3,7,6]),f(-1,[9,8,7,3,5,9, 7,5]),f(-1,[5,8,4,6,5,10,8,1,10,11,8,3]),f(-1,[5,0,4,6,5,11,0,0,5,10,11,3,11,3,0,3]),f(-1,[0,1,9,7,8,4,10,1,8,10,11,6,10,4,5,6]),f(-1,[10,11,4,1,10,4,5,6,11,3,4,1,9,4,1,5,3,1,4,1]),f(-1,[2,5,1,6,2,8,5,0,2,11,8,3,4,5,8,5]),f(-1,[0,4,11,1,0,11,3,6,4,5,11,1,2,11,1,5,5,1,11,1]),f(-1,[0,2,5,1,0,5,9,6,2,11,5,1,4,5,8,5,11,8,5,1]),f(-1,[9,4,5,7,2,11,3,7]),f(-1,[2,5,10,6,3,5,2,4,3,4,5,2,3,8,4,3]),f(-1,[5,10,2,3,5,2,4,4,4,2,0,6]),f(-1,[3,10,2,6,3,5,10,2,3,8,5,1,4,5,8,5,0,1,9,7]),f(-1,[5,10,2,3,5,2,4,4,1,9, 2,5,9,4,2,1]),f(-1,[8,4,5,3,8,5,3,4,3,5,1,6]),f(-1,[0,4,5,3,1,0,5,5]),f(-1,[8,4,5,3,8,5,3,4,9,0,5,5,0,3,5,1]),f(-1,[9,4,5,7]),f(-1,[4,11,7,6,4,9,11,1,9,10,11,3]),f(-1,[0,8,3,7,4,9,7,5,9,11,7,2,9,10,11,3]),f(-1,[1,10,11,3,1,11,4,0,1,4,0,6,7,4,11,5]),f(-1,[3,1,4,1,3,4,8,6,1,10,4,1,7,4,11,5,10,11,4,1]),f(-1,[4,11,7,6,9,11,4,4,9,2,11,2,9,1,2,3]),f(-1,[9,7,4,6,9,11,7,2,9,1,11,1,2,11,1,5,0,8,3,7]),f(-1,[11,7,4,3,11,4,2,4,2,4,0,6]),f(-1,[11,7,4,3,11,4,2,4,8,3,4,5,3,2,4,1]),f(-1,[2,9,10,6,2,7,9,0,2,3,7,3, 7,4,9,3]),f(-1,[9,10,7,1,9,7,4,6,10,2,7,1,8,7,0,5,2,0,7,1]),f(-1,[3,7,10,1,3,10,2,6,7,4,10,1,1,10,0,5,4,0,10,1]),f(-1,[1,10,2,7,8,7,4,7]),f(-1,[4,9,1,3,4,1,7,4,7,1,3,6]),f(-1,[4,9,1,3,4,1,7,4,0,8,1,5,8,7,1,1]),f(-1,[4,0,3,3,7,4,3,5]),f(-1,[4,8,7,7]),f(-1,[9,10,8,5,10,11,8,3]),f(-1,[3,0,9,3,3,9,11,4,11,9,10,6]),f(-1,[0,1,10,3,0,10,8,4,8,10,11,6]),f(-1,[3,1,10,3,11,3,10,5]),f(-1,[1,2,11,3,1,11,9,4,9,11,8,6]),f(-1,[3,0,9,3,3,9,11,4,1,2,9,5,2,11,9,1]),f(-1,[0,2,11,3,8,0,11,5]),f(-1,[3,2,11,7]),f(-1,[2, 3,8,3,2,8,10,4,10,8,9,6]),f(-1,[9,10,2,3,0,9,2,5]),f(-1,[2,3,8,3,2,8,10,4,0,1,8,5,1,10,8,1]),f(-1,[1,10,2,7]),f(-1,[1,3,8,3,9,1,8,5]),f(-1,[0,9,1,7]),f(-1,[0,3,8,7]),null]))});H("J.api");sa(J.api,"VolumeDataInterface");H("J.jvxl.api");sa(J.jvxl.api,"VertexDataServer");H("J.jvxl.api");K(["J.jvxl.api.VertexDataServer"],"J.jvxl.api.MeshDataServer",null,function(){sa(J.jvxl.api,"MeshDataServer",J.jvxl.api.VertexDataServer)});H("J.shapesurface");K(["J.jvxl.api.MeshDataServer","J.shape.MeshCollection", "JU.P3i","$.P4"],"J.shapesurface.Isosurface","java.io.BufferedReader java.lang.Boolean $.Float java.util.Hashtable JU.A4 $.AU $.BS $.CU $.Lst $.M3 $.P3 $.PT $.Quat $.Rdr $.SB $.V3 J.jvxl.data.JvxlCoder $.JvxlData $.MeshData J.jvxl.readers.SurfaceGenerator J.shape.Mesh J.shapesurface.IsosurfaceMesh JU.C $.Escape $.Logger $.TempArray JV.JC $.Viewer".split(" "),function(){c$=C(function(){this.actualID=this.thisMesh=this.isomeshes=null;this.explicitContours=this.iHaveBitSets=!1;this.moNumber=this.atomIndex= 0;this.moLinearCombination=null;this.meshColix=this.defaultColix=this.colorType=0;this.center=null;this.scale3d=0;this.isColorExplicit=this.isPhaseColored=!1;this.scriptAppendix="";this.jvxlData=this.sg=null;this.withinDistance2=0;this.isWithinNot=!1;this.cutoffRange=this.withinPoints=null;this.allowMesh=!0;this.script=null;this.iHaveModelIndex=!1;this.nLCAO=0;this.lcaoDir=null;this.associateNormals=!1;this.keyXy=this.ptXY=null;G(this,arguments)},J.shapesurface,"Isosurface",J.shape.MeshCollection, J.jvxl.api.MeshDataServer);W(c$,function(){this.isomeshes=Array(4);this.lcaoDir=new JU.P4;this.ptXY=new JU.P3i});j(c$,"allocMesh",function(a,b){var c=this.meshCount++;this.meshes=this.isomeshes=JU.AU.ensureLength(this.isomeshes,2*this.meshCount);this.currentMesh=this.thisMesh=this.isomeshes[c]=null==b?new J.shapesurface.IsosurfaceMesh(this.vwr,a,this.colix,c):b;this.currentMesh.index=c;null!=this.sg&&this.sg.setJvxlData(this.jvxlData=this.thisMesh.jvxlData)},"~S,J.shape.Mesh");e(c$,"initShape",function(){Xa(this, J.shapesurface.Isosurface,"initShape",[]);this.myType="isosurface";this.newSg()});e(c$,"newSg",function(){this.sg=new J.jvxl.readers.SurfaceGenerator(this.vwr,this,null,this.jvxlData=new J.jvxl.data.JvxlData);this.sg.params.showTiming=this.vwr.getBoolean(603979934);this.sg.version="Jmol "+JV.Viewer.getJmolVersion()});e(c$,"clearSg",function(){this.sg=null});j(c$,"setProperty",function(a,b,c){this.setPropI(a,b,c)},"~S,~O,JU.BS");e(c$,"setPropI",function(a,b,c){if("cache"===a){if(null!=this.currentMesh){var d= this.currentMesh.thisID;c=this.currentMesh.modelIndex;this.vwr.cachePut("cache://isosurface_"+d,this.getPropI("jvxlDataXml"));this.deleteMeshI(this.currentMesh.index);this.setPropI("init",null,null);this.setPropI("thisID",d,null);this.setPropI("modelIndex",Integer.$valueOf(c),null);this.setPropI("fileName","cache://isosurface_"+d,null);this.setPropI("readFile",null,null);this.setPropI("finalize","isosurface ID "+JU.PT.esc(d)+(0<=c?" modelIndex "+c:"")+" /*file*/"+JU.PT.esc("cache://isosurface_"+d), null);this.setPropI("clear",null,null)}}else if("delete"===a)this.setPropertySuper(a,b,c),this.explicitID||(this.nLCAO=this.nUnnamed=0),this.currentMesh=this.thisMesh=null;else if("remapInherited"===a)for(d=this.meshCount;0<=--d;)null!=this.isomeshes[d]&&"#inherit;".equals(this.isomeshes[d].colorCommand)&&this.isomeshes[d].remapColors(this.vwr,null,NaN);else if("remapColor"===a)null!=this.thisMesh&&this.thisMesh.remapColors(this.vwr,b,this.translucentLevel);else if("thisID"===a)null!=this.actualID&& (b=this.actualID),this.setPropertySuper("thisID",b,null);else if("params"===a){if(null!=this.thisMesh){this.ensureMeshSource();this.thisMesh.checkAllocColixes();a=b[0];var h=null;if(null!=a){for(d=0;d<a.length;d++)a[d]=a[d];h=p(c.length(),0);b=0;for(d=c.nextSetBit(0);0<=d;d=c.nextSetBit(d+1),b++)h[d]=b}this.thisMesh.setVertexColixesForAtoms(this.vwr,a,h,c);this.thisMesh.setVertexColorMap()}}else if("atomcolor"===a)null!=this.thisMesh&&(this.ensureMeshSource(),this.thisMesh.colorVertices(JU.C.getColixO(b), c,!0));else if("pointSize"===a)null!=this.thisMesh&&(this.thisMesh.volumeRenderPointSize=b.floatValue());else if("vertexcolor"===a)null!=this.thisMesh&&this.thisMesh.colorVertices(JU.C.getColixO(b),c,!1);else if("colorPhase"===a){d=b;c=JU.C.getColix(d[0].intValue());b=JU.C.getColix(d[1].intValue());d=null!=this.thisMesh?this.thisMesh.thisID:JU.PT.isWild(this.previousMeshID)?this.previousMeshID:null;h=this.getMeshList(d,!1);for(d=h.size();0<=--d;)this.setColorPhase(h.get(d),c,b)}else if("color"=== a){var m=JU.C.getHexCode(JU.C.getColixO(b));if(null!=this.thisMesh)this.setIsoMeshColor(this.thisMesh,m);else{h=this.getMeshList(JU.PT.isWild(this.previousMeshID)?this.previousMeshID:null,!1);for(d=h.size();0<=--d;)this.setIsoMeshColor(h.get(d),m)}this.setPropertySuper(a,b,c)}else if("nocontour"===a)null!=this.thisMesh&&this.thisMesh.deleteContours();else if("fixed"===a)this.isFixed=b.booleanValue(),this.setMeshI();else if("newObject"===a)null!=this.thisMesh&&this.thisMesh.clearType(this.thisMesh.meshType, !1);else if("moveIsosurface"===a)null!=this.thisMesh&&(this.thisMesh.updateCoordinates(b,null),this.thisMesh.altVertices=null);else if("refreshTrajectories"===a)for(d=this.meshCount;0<=--d;)null!=this.meshes[d].connections&&this.meshes[d].modelIndex==b[0].intValue()&&this.meshes[d].updateCoordinates(b[2],b[1]);else if("modelIndex"===a)this.iHaveModelIndex||(this.modelIndex=b.intValue(),this.isFixed=0>this.modelIndex,this.sg.params.modelIndex=Math.abs(this.modelIndex));else if("lcaoCartoon"===a||"lonePair"=== a||"radical"===a)d=b,this.explicitID||this.setPropertySuper("thisID",null,null),this.sg.setProp("lcaoCartoonCenter",d[2],null)||this.drawLcaoCartoon(d[0],d[1],d[3],"lonePair"===a?2:"radical"===a?1:0);else if(!("select"===a&&this.iHaveBitSets||"ignore"===a&&this.iHaveBitSets))if("meshcolor"===a)d=b.intValue(),this.meshColix=JU.C.getColix(d),null!=this.thisMesh&&(this.thisMesh.meshColix=this.meshColix);else if("offset"===a)d=JU.P3.newP(b),d.equals(JV.JC.center)&&(d=null),null!=this.thisMesh&&(this.thisMesh.rotateTranslate(null, d,!0),this.thisMesh.altVertices=null);else if("rotate"===a)null!=this.thisMesh&&(this.thisMesh.rotateTranslate(JU.Quat.newP4(b),null,!0),this.thisMesh.altVertices=null);else if("bsDisplay"===a)this.bsDisplay=b;else if("displayWithin"===a)d=b,this.displayWithinDistance2=d[0].floatValue(),this.isDisplayWithinNot=0>this.displayWithinDistance2,this.displayWithinDistance2*=this.displayWithinDistance2,this.displayWithinPoints=d[3],0==this.displayWithinPoints.size()&&(this.displayWithinPoints=this.vwr.ms.getAtomPointVector(d[2])); else if("finalize"===a)null!=this.thisMesh&&(d=b,null!=d&&!d.startsWith("; isosurface map")&&(this.thisMesh.setDiscreteColixes(this.sg.params.contoursDiscrete,this.sg.params.contourColixes),this.setJvxlInfo()),this.setScriptInfo(d)),this.clearSg();else if("connections"===a)null!=this.currentMesh&&(this.connections=b,0<=this.connections[0]&&this.connections[0]<this.vwr.ms.ac?this.currentMesh.connections=this.connections:this.connections=this.currentMesh.connections=null);else if("cutoffRange"===a)this.cutoffRange= b;else if("fixLattice"===a)null!=this.thisMesh&&this.thisMesh.fixLattice();else{if("slab"===a){if(V(b,Integer)){null!=this.thisMesh&&(this.thisMesh.jvxlData.slabValue=b.intValue());return}if(null!=this.thisMesh){switch(b[0].intValue()){case 1073742018:d=b[1];c=this.getMesh(d[1]);if(null==c)return;d[1]=c}this.slabPolygons(b);return}}if("cap"===a&&null!=this.thisMesh&&0!=this.thisMesh.pc)this.thisMesh.getMeshSlicer().slabPolygons(b,!0),this.thisMesh.initialize(this.thisMesh.lighting,null,null);else{if("map"=== a&&(null!=this.sg&&(this.sg.params.isMapped=!0),this.setProperty("squareData",Boolean.FALSE,null),null==this.thisMesh||0==this.thisMesh.vc))return;if("deleteVdw"===a){for(d=this.meshCount;0<=--d;)null!=this.isomeshes[d].bsVdw&&(null==c||c.intersects(this.isomeshes[d].bsVdw))&&this.deleteMeshI(d);this.currentMesh=this.thisMesh=null}else{if("mapColor"===a||"readFile"===a){if(null==b){b=this.vwr.fm.getBufferedReaderOrErrorMessageFromName(this.sg.params.fileName,null,!0,!0);if(V(b,String)){JU.Logger.error("Isosurface: could not open file "+ this.sg.params.fileName+" -- "+b);return}if(!V(b,java.io.BufferedReader))try{b=JU.Rdr.getBufferedReader(b,"ISO-8859-1")}catch(g){if(!U(g,java.io.IOException))throw g;}}}else if("atomIndex"===a)this.atomIndex=b.intValue(),null!=this.thisMesh&&(this.thisMesh.atomIndex=this.atomIndex);else if("center"===a)this.center.setT(b);else if("colorRGB"===a)d=b.intValue(),1297090050==d?this.colorType=d:(this.colorType=0,this.defaultColix=JU.C.getColix(d));else if("contour"===a)this.explicitContours=!0;else if("functionXY"=== a)2==this.sg.params.state&&this.setScriptInfo(null);else if("init"===a)this.newSg();else if("getSurfaceSets"===a)null!=this.thisMesh&&(this.thisMesh.jvxlData.thisSet=b.intValue(),this.thisMesh.calculatedVolume=null,this.thisMesh.calculatedArea=null);else if("localName"===a)b=this.vwr.getOutputChannel(b,null),a="outputChannel";else if("molecularOrbital"===a)V(b,Integer)?(this.moNumber=b.intValue(),this.moLinearCombination=null):(this.moLinearCombination=b,this.moNumber=0),this.isColorExplicit||(this.isPhaseColored= !0);else if("phase"===a)this.isPhaseColored=!0;else if("plane"!==a&&"pocket"!==a)if("scale3d"===a)this.scale3d=b.floatValue(),null!=this.thisMesh&&(this.thisMesh.scale3d=this.thisMesh.jvxlData.scale3d=this.scale3d,this.thisMesh.altVertices=null);else if("title"===a)V(b,String)&&"-".equals(b)&&(b=null),this.setPropertySuper(a,b,c),b=this.title;else if("withinPoints"===a)d=b,this.withinDistance2=d[0].floatValue(),this.isWithinNot=0>this.withinDistance2,this.withinDistance2*=this.withinDistance2,this.withinPoints= d[3],0==this.withinPoints.size()&&(this.withinPoints=this.vwr.ms.getAtomPointVector(d[2]));else if(("nci"===a||"orbital"===a)&&null!=this.sg)this.sg.params.testFlags=this.vwr.getTestFlag(2)?2:0;if(null!=this.sg&&this.sg.setProp(a,b,c)){if(this.sg.isValid)return;a="delete"}if("init"===a)this.explicitID=!1,this.scriptAppendix="",d=V(b,String)?b:null,b=null==d?-1:d.indexOf("# ID="),this.actualID=0<=b?JU.PT.getQuotedStringAt(d,b):null,this.setPropertySuper("thisID","+PREVIOUS_MESH+",null),null!=d&&!(this.iHaveBitSets= this.getScriptBitSets(d,null))&&this.sg.setProp("select",c,null),this.initializeIsosurface(),this.sg.params.modelIndex=this.isFixed?-1:this.modelIndex;else if("clear"===a)this.discardTempData(!0);else if("colorDensity"===a)null!=b&&null!=this.currentMesh&&(this.currentMesh.volumeRenderPointSize=b.floatValue());else if("deleteModelAtoms"===a){a=b[2][0];h=b[2][1];b=b[2][2];for(d=this.meshCount;0<=--d;)c=this.meshes[d],null!=c&&(null!=c.connections&&(m=c.connections[0],m>=h+b?c.connections[0]=m-b:m>= h&&(c.connections=null)),c.connections=null,c.modelIndex==a?(this.meshCount--,c===this.currentMesh&&(this.currentMesh=this.thisMesh=null),this.meshes=this.isomeshes=JU.AU.deleteElements(this.meshes,d,1)):c.modelIndex>a&&(c.modelIndex--,c.atomIndex>=h&&(c.atomIndex-=b)))}else this.setPropertySuper(a,b,c)}}}},"~S,~O,JU.BS");e(c$,"setIsoMeshColor",function(a,b){a.jvxlData.baseColor=b;a.isColorSolid=!0;a.pcs=null;a.colorsExplicit=!1;a.colorEncoder=null;a.vertexColorMap=null},"J.shapesurface.IsosurfaceMesh,~S"); e(c$,"setColorPhase",function(a,b,c){a.colorPhased=!0;a.colix=a.jvxlData.minColorIndex=b;a.jvxlData.maxColorIndex=c;a.jvxlData.isBicolorMap=!0;a.jvxlData.colorDensity=!1;a.isColorSolid=!1;a.remapColors(this.vwr,null,this.translucentLevel)},"J.shapesurface.IsosurfaceMesh,~N,~N");e(c$,"ensureMeshSource",function(){var a=null!=this.thisMesh.vertexSource;if(a)for(var b=this.thisMesh.vc;0<=--b;)if(0>this.thisMesh.vertexSource[b]){a=!1;break}if(!a){var a=this.thisMesh.vertexSource,c=this.thisMesh.vcs,b= this.thisMesh.isColorSolid?this.thisMesh.colix:0;this.setProperty("init",null,null);this.setProperty("map",Boolean.FALSE,null);this.setProperty("property",u(this.vwr.ms.ac,0),null);0!=b&&(this.thisMesh.colorCommand="color isosurface "+JU.C.getHexCode(b),this.setProperty("color",Integer.$valueOf(JU.C.getArgb(b)),null));if(null!=a){for(b=this.thisMesh.vc;0<=--b;)0>a[b]&&(a[b]=this.thisMesh.vertexSource[b]);this.thisMesh.vertexSource=a;this.thisMesh.vcs=c}}});e(c$,"slabPolygons",function(a){this.thisMesh.getMeshSlicer().slabPolygons(a, !1);this.thisMesh.reinitializeLightingAndColor(this.vwr)},"~A");e(c$,"setPropertySuper",function(a,b,c){"thisID"===a&&null!=this.currentMesh&&null!=this.currentMesh.thisID&&this.currentMesh.thisID.equals(b)?this.checkExplicit(b):(this.currentMesh=this.thisMesh,this.setPropMC(a,b,c),this.thisMesh=this.currentMesh,this.jvxlData=null==this.thisMesh?null:this.thisMesh.jvxlData,null!=this.sg&&this.sg.setJvxlData(this.jvxlData))},"~S,~O,JU.BS");j(c$,"getPropertyData",function(a,b){if("colorEncoder"===a){var c= this.getMesh(b[0]);return null==c||null==(b[1]=c.colorEncoder)?!1:!0}if("intersectPlane"===a){c=this.getMesh(b[0]);if(null==c)return!1;b[3]=Integer.$valueOf(c.modelIndex);c.getMeshSlicer().getIntersection(0,b[1],null,b[2],null,null,null,!1,!1,135266319,!1);return!0}if("getBoundingBox"===a){c=b[0];c=this.getMesh(c);if(null==c||null==c.vs)return!1;b[2]=c.jvxlData.boundingBox;if(null!=c.mat4){var d=Array(2);d[0]=JU.P3.newP(c.jvxlData.boundingBox[0]);d[1]=JU.P3.newP(c.jvxlData.boundingBox[1]);var h=new JU.V3; c.mat4.getTranslation(h);d[0].add(h);d[1].add(h);b[2]=d}return!0}if("unitCell"===a)return c=this.getMesh(b[0]),null!=c&&null!=(b[1]=c.getUnitCell());if("getCenter"===a&&-2147483648==b[1].intValue()){c=b[0];c=this.getMesh(c);if(null==c||null==c.vs)return!1;d=JU.P3.newP(c.jvxlData.boundingBox[0]);d.add(c.jvxlData.boundingBox[1]);d.scale(0.5);null!=c.mat4&&(h=new JU.V3,c.mat4.getTranslation(h),d.add(h));b[2]=d;return!0}return this.getPropDataMC(a,b)},"~S,~A");j(c$,"getProperty",function(a){return this.getPropI(a)}, "~S,~N");e(c$,"getPropI",function(a){var b=this.getPropMC(a);if(null!=b)return b;if("message"===a)return a="",24==this.shapeID&&(a+=" with cutoff="+this.jvxlData.cutoff),3.4028235E38!=this.jvxlData.dataMin&&(a+=" min="+this.jvxlData.dataMin+" max="+this.jvxlData.dataMax),a+="; "+JV.JC.shapeClassBases[this.shapeID].toLowerCase()+" count: "+this.getPropMC("count"),a+this.getPropI("dataRangeStr")+this.jvxlData.msg;if("dataRange"===a)return this.getDataRange();if("dataRangeStr"===a)return a=this.getDataRange(), null!=a&&3.4028235E38!=a[0]&&a[0]!=a[1]?"\nisosurface full data range "+a[0]+" to "+a[1]+" with color scheme spanning "+a[2]+" to "+a[3]:"";if("moNumber"===a)return Integer.$valueOf(this.moNumber);if("moLinearCombination"===a)return this.moLinearCombination;if("nSets"===a)return Integer.$valueOf(null==this.thisMesh?0:this.thisMesh.nSets);if("area"===a)return null==this.thisMesh?Float.$valueOf(NaN):this.calculateVolumeOrArea(!0);if("volume"===a)return null==this.thisMesh?Float.$valueOf(NaN):this.calculateVolumeOrArea(!1); if(null==this.thisMesh)return null;if("cutoff"===a)return Float.$valueOf(this.jvxlData.cutoff);if("minMaxInfo"===a)return u(-1,[this.jvxlData.dataMin,this.jvxlData.dataMax]);if("plane"===a)return this.jvxlData.jvxlPlane;if("contours"===a)return this.thisMesh.getContours();if("jvxlDataXml"===a||"jvxlMeshXml"===a)return b=null,this.jvxlData.slabInfo=null,"jvxlMeshXml"===a||this.jvxlData.vertexDataOnly||null!=this.thisMesh.bsSlabDisplay&&null==this.thisMesh.bsSlabGhost?(b=new J.jvxl.data.MeshData,this.fillMeshData(b, 1,null),b.polygonColorData=J.shapesurface.Isosurface.getPolygonColorData(b.pc,b.pcs,b.colorsExplicit?b.pis:null,b.bsSlabDisplay)):null!=this.thisMesh.bsSlabGhost&&(this.jvxlData.slabInfo=this.thisMesh.slabOptions.toString()),a=new JU.SB,this.getMeshCommand(a,this.thisMesh.index),this.thisMesh.setJvxlColorMap(!0),J.jvxl.data.JvxlCoder.jvxlGetFile(this.jvxlData,b,this.title,"",!0,1,a.toString(),null);if("jvxlFileInfo"===a)return this.thisMesh.setJvxlColorMap(!1),J.jvxl.data.JvxlCoder.jvxlGetInfo(this.jvxlData); if("command"===a){a=new JU.SB;for(b=this.getMeshList(this.previousMeshID,!1).size();0<=--b;)this.getMeshCommand(a,b);return a.toString()}return null},"~S");e(c$,"getDataRange",function(){return null==this.thisMesh||null!=this.jvxlData.jvxlPlane&&null==this.thisMesh.colorEncoder?null:u(-1,[this.jvxlData.mappedDataMin,this.jvxlData.mappedDataMax,this.jvxlData.isColorReversed?this.jvxlData.valueMappedToBlue:this.jvxlData.valueMappedToRed,this.jvxlData.isColorReversed?this.jvxlData.valueMappedToRed:this.jvxlData.valueMappedToBlue])}); e(c$,"calculateVolumeOrArea",function(a){if(a){if(null!=this.thisMesh.calculatedArea)return this.thisMesh.calculatedArea}else if(null!=this.thisMesh.calculatedVolume)return this.thisMesh.calculatedVolume;var b=new J.jvxl.data.MeshData;this.fillMeshData(b,1,null);b.nSets=this.thisMesh.nSets;b.vertexSets=this.thisMesh.vertexSets;if(!a&&this.thisMesh.jvxlData.colorDensity)return a=this.thisMesh.jvxlData.voxelVolume,a*=null==this.thisMesh.bsSlabDisplay?this.thisMesh.vc:this.thisMesh.bsSlabDisplay.cardinality(), this.thisMesh.calculatedVolume=Float.$valueOf(a);var c=J.jvxl.data.MeshData.calculateVolumeOrArea(b,this.thisMesh.jvxlData.thisSet,a,!1);0>=this.thisMesh.nSets&&(this.thisMesh.nSets=-b.nSets);a?this.thisMesh.calculatedArea=c:this.thisMesh.calculatedVolume=c;return c},"~B");c$.getPolygonColorData=e(c$,"getPolygonColorData",function(a,b,c,d){var h=null!=c;if(null==b&&null==c)return null;for(var m=new JU.SB,g=0,e=0,f=0,k=0,n=!1,q=0;q<a||!0==(n=!0);q++)if(n||null==d||d.get(q))if(n||(h?(k=c[q][4])!=f: b[q]!=e)){0!=g&&m.append(" ").appendI(g).append(" ").appendI(h?f:0==e?0:JU.C.getArgb(e));if(n)break;h?f=k:e=b[q];g=1}else g++;m.append("\n");return m.toString()},"~N,~A,~A,JU.BS");j(c$,"getShapeState",function(){this.clean();var a=new JU.SB;a.append("\n");for(var b=0;b<this.meshCount;b++)this.getMeshCommand(a,b);return a.toString()});e(c$,"getMeshCommand",function(a,b){var c=this.meshes[b];if(!(null==c||null==c.scriptCommand)){var d=c.scriptCommand;1<this.vwr.ms.mc&&J.shape.Shape.appendCmd(a,"frame "+ this.vwr.getModelNumberDotted(c.modelIndex));var d=JU.PT.rep(d,";; isosurface map"," map"),d=JU.PT.rep(d,"; isosurface map"," map"),d=d.$replace("\t"," "),d=JU.PT.rep(d,";#","; #"),h=d.indexOf("; #");0<=h&&(d=d.substring(0,h));null!=c.connections&&(d+=" connect "+JU.Escape.eAI(c.connections));d=JU.PT.trim(d,";");null!=c.linkedMesh&&(d+=" LINK");"lcaoCartoon"===this.myType&&0<=c.atomIndex&&(d+=" ATOMINDEX "+c.atomIndex);J.shape.Shape.appendCmd(a,d);h=this.myType+" ID "+JU.PT.esc(c.thisID);0<=c.jvxlData.thisSet&& J.shape.Shape.appendCmd(a,h+" set "+(c.jvxlData.thisSet+1));null!=c.mat4&&J.shape.Shape.appendCmd(a,h+" move "+JU.Escape.matrixToScript(c.mat4));0!=c.scale3d&&J.shape.Shape.appendCmd(a,h+" scale3d "+c.scale3d);-2147483648!=c.jvxlData.slabValue&&J.shape.Shape.appendCmd(a,h+" slab "+c.jvxlData.slabValue);null!=c.slabOptions&&J.shape.Shape.appendCmd(a,c.slabOptions.toString());if("#"!=d.charAt(0)&&(this.allowMesh&&J.shape.Shape.appendCmd(a,c.getState(this.myType)),!c.isColorSolid&&(0==c.colorType&&JU.C.isColixTranslucent(c.colix))&& J.shape.Shape.appendCmd(a,"color "+this.myType+" "+J.shape.Shape.getTranslucentLabel(c.colix)),null!=c.colorCommand&&(0==c.colorType&&!c.colorCommand.equals("#inherit;"))&&J.shape.Shape.appendCmd(a,c.colorCommand),d=c.isColorSolid&&null!=c.pcs,c.isColorSolid&&0==c.colorType&&!c.colorsExplicit&&!d?J.shape.Shape.appendCmd(a,J.shape.Shape.getColorCommandUnk(this.myType,c.colix,this.translucentAllowed)):c.jvxlData.isBicolorMap&&c.colorPhased&&J.shape.Shape.appendCmd(a,"color isosurface phase "+J.shape.Shape.encodeColor(c.jvxlData.minColorIndex)+ " "+J.shape.Shape.encodeColor(c.jvxlData.maxColorIndex)),null!=c.vertexColorMap))for(var m,c=c.vertexColorMap.entrySet().iterator();c.hasNext()&&((m=c.next())||1);)d=m.getValue(),d.isEmpty()||J.shape.Shape.appendCmd(a,"color "+this.myType+" "+JU.Escape.eBS(d)+" "+m.getKey())}},"JU.SB,~N");e(c$,"getScriptBitSets",function(a,b){this.script=a;var c;this.iHaveModelIndex=!1;this.modelIndex=-1;if(null!=a&&0<=(c=a.indexOf("MODEL({"))){var d=a.indexOf("})",c);0<d&&(c=JU.BS.unescape(a.substring(c+3,d+1)), this.modelIndex=null==c?-1:c.nextSetBit(0),this.iHaveModelIndex=0<=this.modelIndex)}if(null==a)return!1;this.getCapSlabInfo(a);c=a.indexOf("# ({");if(0>c)return!1;d=a.indexOf("})",c);if(0>d)return!1;c=JU.BS.unescape(a.substring(c+2,d+2));null==b?this.sg.setProp("select",c,null):b[0]=c;if(0>(c=a.indexOf("({",d)))return!0;d=a.indexOf("})",c);if(0>d)return!1;c=JU.BS.unescape(a.substring(c+1,d+1));null==b?this.sg.setProp("ignore",c,null):b[1]=c;if((c=a.indexOf("/({",d))==d+2){if(0>(d=a.indexOf("})",c)))return!1; c=JU.BS.unescape(a.substring(c+3,d+1));null==b?this.vwr.ms.setTrajectoryBs(c):b[2]=c}return!0},"~S,~A");e(c$,"getCapSlabInfo",function(a){var b=a.indexOf("# SLAB=");0<=b&&this.sg.setProp("slab",this.getCapSlabObject(JU.PT.getQuotedStringAt(a,b),!1),null);b=a.indexOf("# CAP=");0<=b&&this.sg.setProp("slab",this.getCapSlabObject(JU.PT.getQuotedStringAt(a,b),!0),null)},"~S");e(c$,"getCapSlabObject",function(a,b){try{if(0==a.indexOf("array")){var c=JU.PT.split(a.substring(6,a.length-1),",");return JU.TempArray.getSlabObjectType(1679429641, w(-1,[JU.Escape.uP(c[0]),JU.Escape.uP(c[1]),JU.Escape.uP(c[2]),JU.Escape.uP(c[3])]),b,null)}var d=JU.Escape.uP(a);if(V(d,JU.P4))return JU.TempArray.getSlabObjectType(135266319,d,b,null)}catch(h){if(!U(h,Exception))throw h;}return null},"~S,~B");e(c$,"initializeIsosurface",function(){this.iHaveModelIndex||(this.modelIndex=this.vwr.am.cmi);this.atomIndex=-1;this.bsDisplay=null;this.center=JU.P3.new3(NaN,0,0);this.colix=5;this.cutoffRange=this.connections=null;this.colorType=this.defaultColix=this.meshColix= 0;this.displayWithinPoints=null;this.explicitContours=!1;this.isFixed=0>this.modelIndex;this.isPhaseColored=this.isColorExplicit=!1;this.linkedMesh=null;0>this.modelIndex&&(this.modelIndex=0);this.scale3d=0;this.title=null;this.translucentLevel=0;this.withinPoints=null;this.initState()});e(c$,"initState",function(){this.associateNormals=!0;this.sg.initState()});e(c$,"setMeshI",function(){this.thisMesh.visible=!0;this.thisMesh.modelIndex=0<=(this.thisMesh.atomIndex=this.atomIndex)?this.vwr.ms.at[this.atomIndex].mi: this.isFixed?-1:0<=this.modelIndex?this.modelIndex:this.vwr.am.cmi;this.thisMesh.scriptCommand=this.script;this.thisMesh.ptCenter.setT(this.center);this.thisMesh.scale3d=null==this.thisMesh.jvxlData.jvxlPlane?0:this.scale3d});e(c$,"discardTempData",function(a){a&&(this.title=null,null!=this.thisMesh&&(this.thisMesh.surfaceSet=null))},"~B");e(c$,"getDefaultColix",function(){return 0!=this.defaultColix?this.defaultColix:!this.sg.jvxlData.wasCubic?this.colix:JU.C.getColix(0<=this.sg.params.cutoff?-11525984: -6283184)});e(c$,"drawLcaoCartoon",function(a,b,c,d){var h=this.sg.setLcao(),m=c.x+c.y+c.z;this.defaultColix=JU.C.getColix(this.sg.params.colorPos);var g=JU.C.getColix(this.sg.params.colorNeg),e=new JU.V3,f=0<h.length&&"-"==h.charAt(0);f&&(h=h.substring(1));f=f?-1:1;e.cross(a,b);if(0!=m){var k=new JU.A4;0!=c.x?k.setVA(b,m):0!=c.y?k.setVA(e,m):k.setVA(a,m);c=(new JU.M3).setAA(k);c.rotate(b);c.rotate(e);c.rotate(a)}null==this.thisMesh&&0==this.nLCAO&&(this.nLCAO=this.meshCount);c=null==this.thisMesh? (0<d?"lp":"lcao")+ ++this.nLCAO+"_"+h:this.thisMesh.thisID;null==this.thisMesh&&this.allocMesh(c,null);h.equals("px")?(this.thisMesh.thisID+="a",h=this.thisMesh,this.createLcaoLobe(b,f,d),0<d||(this.setProperty("thisID",c+"b",null),this.createLcaoLobe(b,-f,d),this.thisMesh.colix=g,this.linkedMesh=this.thisMesh.linkedMesh=h)):h.equals("py")?(this.thisMesh.thisID+="a",h=this.thisMesh,this.createLcaoLobe(e,f,d),0<d||(this.setProperty("thisID",c+"b",null),this.createLcaoLobe(e,-f,d),this.thisMesh.colix= g,this.linkedMesh=this.thisMesh.linkedMesh=h)):h.equals("pz")?(this.thisMesh.thisID+="a",h=this.thisMesh,this.createLcaoLobe(a,f,d),0<d||(this.setProperty("thisID",c+"b",null),this.createLcaoLobe(a,-f,d),this.thisMesh.colix=g,this.linkedMesh=this.thisMesh.linkedMesh=h)):h.equals("pza")||0==h.indexOf("sp")||0==h.indexOf("d")||0==h.indexOf("lp")?this.createLcaoLobe(a,f,d):h.equals("pzb")?this.createLcaoLobe(a,-f,d):h.equals("pxa")?this.createLcaoLobe(b,f,d):h.equals("pxb")?this.createLcaoLobe(b,-f, d):h.equals("pya")?this.createLcaoLobe(e,f,d):h.equals("pyb")?this.createLcaoLobe(e,-f,d):h.equals("spacefill")||h.equals("cpk")?this.createLcaoLobe(null,2*this.vwr.ms.at[this.atomIndex].getRadius(),d):this.createLcaoLobe(null,1,d)},"JU.V3,JU.V3,JU.V3,~N");e(c$,"createLcaoLobe",function(a,b,c){this.initState();JU.Logger.debugging&&JU.Logger.debug("creating isosurface ID "+this.thisMesh.thisID);null==a?this.setProperty("sphere",Float.$valueOf(b/2),null):(this.lcaoDir.x=a.x*b,this.lcaoDir.y=a.y*b,this.lcaoDir.z= a.z*b,this.lcaoDir.w=0.7,this.setProperty(2==c?"lp":1==c?"rad":"lobe",this.lcaoDir,null));this.thisMesh.colix=this.defaultColix;this.setScriptInfo(null)},"JU.V3,~N,~N");j(c$,"invalidateTriangles",function(){this.thisMesh.invalidatePolygons()});j(c$,"setOutputChannel",function(a,b){a.setOutputChannel(b)},"javajs.api.GenericBinaryDocument,JU.OC");j(c$,"fillMeshData",function(a,b,c){if(null==a){if(null==this.thisMesh&&this.allocMesh(null,null),this.thisMesh.isMerged||this.thisMesh.clearType(this.myType, this.sg.params.iAddGridPoints),this.thisMesh.connections=this.connections,this.thisMesh.colix=this.getDefaultColix(),this.thisMesh.colorType=this.colorType,this.thisMesh.meshColix=this.meshColix,this.isPhaseColored||this.thisMesh.jvxlData.isBicolorMap)this.thisMesh.isColorSolid=!1}else if(null==c&&(c=this.thisMesh),null!=c)switch(b){case 1:a.mergeVertexCount0=c.mergeVertexCount0;a.vs=c.vs;a.vertexSource=c.vertexSource;a.vvs=c.vvs;a.vc=c.vc;a.vertexIncrement=c.vertexIncrement;a.pc=c.pc;a.pis=c.pis; a.pcs=c.pcs;a.bsSlabDisplay=c.bsSlabDisplay;a.bsSlabGhost=c.bsSlabGhost;a.slabColix=c.slabColix;a.slabMeshType=c.slabMeshType;a.polygonCount0=c.polygonCount0;a.vertexCount0=c.vertexCount0;a.slabOptions=c.slabOptions;a.colorsExplicit=c.colorsExplicit;break;case 2:if(null==c.vcs||c.vc>c.vcs.length)c.vcs=Z(c.vc,0);a.vcs=c.vcs;break;case 3:c.surfaceSet=a.surfaceSet;c.vertexSets=a.vertexSets;c.nSets=a.nSets;break;case 4:c.vs=a.vs,c.vvs=a.vvs,c.vc=a.vc,c.vertexIncrement=a.vertexIncrement,c.vertexSource= a.vertexSource,c.pc=a.pc,c.pis=a.pis,c.pcs=a.pcs,c.bsSlabDisplay=a.bsSlabDisplay,c.bsSlabGhost=a.bsSlabGhost,c.slabColix=a.slabColix,c.slabMeshType=a.slabMeshType,c.polygonCount0=a.polygonCount0,c.vertexCount0=a.vertexCount0,c.mergeVertexCount0=a.mergeVertexCount0,c.slabOptions=a.slabOptions,c.colorsExplicit=a.colorsExplicit}},"J.jvxl.data.MeshData,~N,J.shapesurface.IsosurfaceMesh");j(c$,"notifySurfaceGenerationCompleted",function(){this.setMeshI();this.setBsVdw();this.thisMesh.insideOut=this.sg.isInsideOut(); this.thisMesh.vertexSource=this.sg.params.vertexSource;this.thisMesh.spanningVectors=this.sg.getSpanningVectors();this.thisMesh.calculatedArea=null;this.thisMesh.calculatedVolume=null;if(!this.thisMesh.isMerged)return this.thisMesh.initialize(this.sg.isFullyLit()?1073741964:1073741958,null,this.sg.params.thePlane),null!=this.jvxlData.fixedLattice&&(this.thisMesh.lattice=this.jvxlData.fixedLattice,this.thisMesh.fixLattice()),this.thisMesh.setColorsFromJvxlData(this.sg.params.colorRgb);this.sg.params.allowVolumeRender|| (this.thisMesh.jvxlData.allowVolumeRender=!1);this.thisMesh.setColorsFromJvxlData(this.sg.params.colorRgb);null!=this.thisMesh.jvxlData.slabInfo&&this.vwr.runScript("isosurface "+this.thisMesh.jvxlData.slabInfo);0<this.sg.params.psi_monteCarloCount&&(this.thisMesh.diameter=-1);return!1});j(c$,"notifySurfaceMappingCompleted",function(){this.thisMesh.isMerged||this.thisMesh.initialize(this.sg.isFullyLit()?1073741964:1073741958,null,this.sg.params.thePlane);this.setBsVdw();this.thisMesh.isColorSolid= !1;this.thisMesh.colorDensity=this.jvxlData.colorDensity;this.thisMesh.volumeRenderPointSize=this.jvxlData.pointSize;this.thisMesh.colorEncoder=this.sg.params.colorEncoder;this.thisMesh.getContours();0!=this.thisMesh.jvxlData.nContours&&-1!=this.thisMesh.jvxlData.nContours&&(this.explicitContours=!0);this.explicitContours&&null!=this.thisMesh.jvxlData.jvxlPlane&&(this.thisMesh.havePlanarContours=!0);this.setPropertySuper("token",Integer.$valueOf(this.explicitContours?1073742046:1073741938),null); this.setPropertySuper("token",Integer.$valueOf(this.explicitContours?1073741898:1073742039),null);this.thisMesh.isMerged||this.thisMesh.setJvxlDataRendering();null!=this.sg.params.slabInfo&&(this.thisMesh.slabPolygonsList(this.sg.params.slabInfo,!1),this.thisMesh.reinitializeLightingAndColor(this.vwr));this.thisMesh.setColorCommand()});e(c$,"setBsVdw",function(){null!=this.sg.bsVdw&&(null==this.thisMesh.bsVdw&&(this.thisMesh.bsVdw=new JU.BS),this.thisMesh.bsVdw.or(this.sg.bsVdw))});j(c$,"calculateGeodesicSurface", function(a,b){return this.vwr.calculateSurface(a,b)},"JU.BS,~N");j(c$,"getSurfacePointIndexAndFraction",function(){return 0},"~N,~B,~N,~N,~N,JU.P3i,~N,~N,~N,~N,JU.T3,JU.V3,~B,~A");j(c$,"addVertexCopy",function(a,b,c,d){return null!=this.cutoffRange&&(b<this.cutoffRange[0]||b>this.cutoffRange[1])?-1:null!=this.withinPoints&&!J.shape.Mesh.checkWithin(a,this.withinPoints,this.withinDistance2,this.isWithinNot)?-1:this.thisMesh.addVertexCopy(a,b,c,this.associateNormals,d)},"JU.T3,~N,~N,~B");j(c$,"addTriangleCheck", function(a,b,c,d,h,m,g){return 0>a||0>b||0>c||m&&!J.jvxl.data.MeshData.checkCutoff(a,b,c,this.thisMesh.vvs)?-1:this.thisMesh.addTriangleCheck(a,b,c,d,h,g)},"~N,~N,~N,~N,~N,~B,~N");e(c$,"setScriptInfo",function(a){a=null==a?this.sg.params.script:a;var b=null==a?-1:a.indexOf("; isosurface map");if(0==b)null!=this.thisMesh.scriptCommand&&(b=this.thisMesh.scriptCommand.indexOf("; isosurface map"),0<=b&&(this.thisMesh.scriptCommand=this.thisMesh.scriptCommand.substring(0,b)),this.thisMesh.scriptCommand+= a);else if(this.thisMesh.title=this.sg.params.title,this.thisMesh.dataType=this.sg.params.dataType,this.thisMesh.scale3d=this.sg.params.scale3d,null!=a&&" "==a.charAt(0)&&(a=this.myType+" ID "+JU.PT.esc(this.thisMesh.thisID)+a,b=a.indexOf("; isosurface map")),this.thisMesh.scriptCommand=0<b&&0<this.scriptAppendix.length?a.substring(0,b)+this.scriptAppendix+a.substring(b):a+this.scriptAppendix,!this.explicitID&&null!=a&&0<=(b=a.indexOf("# ID=")))this.thisMesh.thisID=JU.PT.getQuotedStringAt(a,b)},"~S"); j(c$,"addRequiredFile",function(a){a=' # /*file*/"'+a+'"';0>this.scriptAppendix.indexOf(a)&&(this.scriptAppendix+=a)},"~S");e(c$,"setJvxlInfo",function(){if(this.sg.jvxlData!==this.jvxlData||this.sg.jvxlData!==this.thisMesh.jvxlData)this.jvxlData=this.thisMesh.jvxlData=this.sg.jvxlData});j(c$,"getShapeDetail",function(){for(var a=new JU.Lst,b=0;b<this.meshCount;b++){var c=new java.util.Hashtable,d=this.isomeshes[b];null==d||(null==d.vs||0==d.vc&&0==d.pc)||(this.addMeshInfo(d,c),a.addLast(c))}return a}); e(c$,"addMeshInfo",function(a,b){b.put("ID",null==a.thisID?"<noid>":a.thisID);b.put("visible",Boolean.$valueOf(a.visible));b.put("vertexCount",Integer.$valueOf(a.vc));null!=a.calculatedVolume&&b.put("volume",a.calculatedVolume);null!=a.calculatedArea&&b.put("area",a.calculatedArea);Float.isNaN(a.ptCenter.x)||b.put("center",a.ptCenter);null!=a.mat4&&b.put("mat4",a.mat4);0!=a.scale3d&&b.put("scale3d",Float.$valueOf(a.scale3d));b.put("xyzMin",a.jvxlData.boundingBox[0]);b.put("xyzMax",a.jvxlData.boundingBox[1]); var c=J.jvxl.data.JvxlCoder.jvxlGetInfo(a.jvxlData);null!=c&&b.put("jvxlInfo",c.$replace("\n"," "));b.put("modelIndex",Integer.$valueOf(a.modelIndex));b.put("color",JU.CU.colorPtFromInt(JU.C.getArgb(a.colix),null));null!=a.colorEncoder&&b.put("colorKey",a.colorEncoder.getColorKey());null!=a.title&&b.put("title",a.title);(null!=a.jvxlData.contourValues||null!=a.jvxlData.contourValuesUsed)&&b.put("contours",a.getContourList(this.vwr))},"J.shapesurface.IsosurfaceMesh,java.util.Map");j(c$,"getPlane", function(){return null},"~N");j(c$,"getValue",function(){return 0},"~N,~N,~N,~N");j(c$,"checkObjectHovered",function(a,b,c){if(null!=this.keyXy&&a>=this.keyXy[0]&&b>=this.keyXy[1]&&a<this.keyXy[2]&&b<this.keyXy[3])return this.hoverKey(a,b),!0;if(!this.vwr.getDrawHover())return!1;c=this.findValue(a,b,!1,c);if(null==c)return!1;this.vwr.gdata.antialiasEnabled&&(a<<=1,b<<=1);this.vwr.hoverOnPt(a,b,c,this.pickedMesh.thisID,this.pickedPt);return!0},"~N,~N,JU.BS");e(c$,"hoverKey",function(a,b){try{var c, d=1-1*(b-this.keyXy[1])/(this.keyXy[3]-this.keyXy[1]);if(this.thisMesh.showContourLines){var h=this.thisMesh.getContours();if(null==h){if(null==this.thisMesh.jvxlData.contourValues)return;var m=E(Math.floor(d*this.thisMesh.jvxlData.contourValues.length));if(0>m||m>this.thisMesh.jvxlData.contourValues.length)return;c=""+this.thisMesh.jvxlData.contourValues[m]}else{m=E(Math.floor(d*h.length));if(0>m||m>h.length)return;c=""+h[m].get(2).floatValue()}}else{var g=this.thisMesh.colorEncoder.quantize(d,!0), d=this.thisMesh.colorEncoder.quantize(d,!1);c=""+g+" - "+d}this.vwr.gdata.isAntialiased()&&(a<<=1,b<<=1);this.vwr.hoverOnPt(a,b,c,null,null)}catch(e){if(!U(e,Exception))throw e;}},"~N,~N");j(c$,"checkObjectClicked",function(a,b,c,d,h){if(!h||!this.vwr.isBound(c,18))return null;c=100;this.vwr.gdata.isAntialiased()&&(a<<=1,b<<=1,c<<=1);for(var m=h=-1,g=-2147483648,e=2147483647,f=0;f<this.meshCount;f++){var k=this.isomeshes[f];if(this.isPickable(k,d)&&(k=k.vs,null!=k))for(var n=k.length;0<=--n;){var q= k[n];null!=q&&0<=this.coordinateInRange(a,b,q,c,this.ptXY)&&(this.ptXY.z<e&&(h=f,e=this.ptXY.z,m=n),this.ptXY.z>g&&(g=this.ptXY.z))}}if(0>h)return null;this.pickedMesh=this.isomeshes[h];this.setPropertySuper("thisID",this.pickedMesh.thisID,null);this.pickedVertex=m;a=new JU.P3;a.setT(this.pickedMesh.vs[this.pickedVertex]);this.pickedModel=this.pickedMesh.modelIndex;b=this.getPickedPoint(a,this.pickedModel);this.setStatusPicked(-4,a,b);return b},"~N,~N,~N,JU.BS,~B");e(c$,"isPickable",function(a,b){return 0!= a.visibilityFlags&&(0>a.modelIndex||b.get(a.modelIndex))&&!JU.C.isColixTranslucent(a.colix)},"J.shapesurface.IsosurfaceMesh,JU.BS");e(c$,"findValue",function(a,b,c,d){c=100;this.vwr.gdata.isAntialiased()&&(a<<=1,b<<=1,c<<=1);for(var h=-1,m=null,g=null,e=0;e<this.meshCount;e++)if(g=this.isomeshes[e],this.isPickable(g,d)){var f=g.jvxlData.vContours,k=0>g.firstRealVertex?0:g.firstRealVertex,n=0;if(null!=f&&0<f.length){for(k=0;k<f.length;k++)for(var q=f[k],t=q.size()-1,r=6;r<t;r++){var j=q.get(r),p=this.coordinateInRange(a, b,j,c,this.ptXY);0<=p&&(c=p,m=q,n=k,this.pickedMesh=g,this.pickedPt=j)}if(null!=m)return m.get(2).toString()+(JU.Logger.debugging?" "+n:"")}else if(null!=g.jvxlData.jvxlPlane&&null!=g.vvs){f=null==g.mat4&&0==g.scale3d?g.vs:g.getOffsetVertices(g.jvxlData.jvxlPlane);for(r=g.vc;--r>=k;)j=f[r],p=this.coordinateInRange(a,b,j,c,this.ptXY),0<=p&&(c=p,h=r,this.pickedMesh=g,this.pickedPt=j);if(-1!=h)break}else if(null!=g.vvs){if(null!=g.bsSlabDisplay)for(r=g.bsSlabDisplay.nextSetBit(0);0<=r;r=g.bsSlabDisplay.nextSetBit(r+ 1)){f=g.pis[r];for(n=0;3>n;n++)j=g.vs[f[n]],p=this.coordinateInRange(a,b,j,c,this.ptXY),0<=p&&(c=p,h=f[n],this.pickedMesh=g,this.pickedPt=j)}else for(r=g.vc;--r>=k;)j=g.vs[r],p=this.coordinateInRange(a,b,j,c,this.ptXY),0<=p&&(c=p,h=r,this.pickedMesh=g,this.pickedPt=j);if(-1!=h)break}}return-1==h?null:(JU.Logger.debugging?"$"+g.thisID+"["+(h+1)+"] "+g.vs[h]+": ":g.thisID+": ")+g.vvs[h]},"~N,~N,~B,JU.BS");e(c$,"getCmd",function(a){var b=(new JU.SB).append("\n");this.getMeshCommand(b,a);return b.toString()}, "~N");R(c$,"MAX_OBJECT_CLICK_DISTANCE_SQUARED",100)});H("J.jvxl.data");K(null,"J.jvxl.data.JvxlCoder","java.lang.Float JU.BS $.Lst $.P3 $.PT $.SB $.XmlUtil J.jvxl.data.VolumeData JU.BSUtil $.C $.Escape $.Logger".split(" "),function(){c$=wa(J.jvxl.data,"JvxlCoder");c$.jvxlGetFile=e(c$,"jvxlGetFile",function(a,b,c){var d=a.getVoxelCounts();b.nPointsX=d[0];b.nPointsY=d[1];b.nPointsZ=d[2];b.jvxlVolumeDataXml=a.setVolumetricXml();return J.jvxl.data.JvxlCoder.jvxlGetFile(b,null,c,null,!0,1,null,null)}, "J.jvxl.data.VolumeData,J.jvxl.data.JvxlData,~A");c$.jvxlGetFile=e(c$,"jvxlGetFile",function(a,b,c,d,h,m,g,e){return J.jvxl.data.JvxlCoder.jvxlGetFileXml(a,b,c,d,h,m,g,e)},"J.jvxl.data.JvxlData,J.jvxl.data.MeshData,~A,~S,~B,~N,~S,~S");c$.jvxlGetFileXml=e(c$,"jvxlGetFileXml",function(a,b,c,d,h,m,g,e){var f=new JU.SB;if("TRAILERONLY".equals(d))return JU.XmlUtil.closeTag(f,"jvxlSurfaceSet"),JU.XmlUtil.closeTag(f,"jvxl"),f.toString();var k=null!=b,n="HEADERONLY".equals(d);if(h){JU.XmlUtil.openDocument(f); JU.XmlUtil.openTagAttr(f,"jvxl",w(-1,["version","2.3","jmolVersion",a.version,"xmlns","http://jmol.org/jvxl_schema","xmlns:cml","http://www.xml-cml.org/schema"]));null!=a.jvxlFileTitle&&JU.XmlUtil.appendCdata(f,"jvxlFileTitle",null,"\n"+a.jvxlFileTitle);null!=a.moleculeXml&&f.append(a.moleculeXml);var q=k?null:a.jvxlVolumeDataXml;null==q&&(q=(new J.jvxl.data.VolumeData).setVolumetricXml());f.append(q);JU.XmlUtil.openTagAttr(f,"jvxlSurfaceSet",w(-1,["count",""+(0<m?m:1)]));if(n)return f.toString()}m= k?"pmesh":null==a.jvxlPlane?"isosurface":"plane";null!=a.jvxlColorData&&0<a.jvxlColorData.length&&(m="mapped "+m);JU.XmlUtil.openTagAttr(f,"jvxlSurface",w(-1,["type",m]));f.append(J.jvxl.data.JvxlCoder.jvxlGetInfoData(a,k));J.jvxl.data.JvxlCoder.jvxlAppendCommandState(f,e,g);if(null!=c||null!=d&&0<d.length){g=new JU.SB;null!=d&&0<d.length&&g.append(d).append("\n");if(null!=c)for(d=0;d<c.length;d++)g.append(c[d]).appendC("\n");JU.XmlUtil.appendCdata(f,"jvxlSurfaceTitle",null,g.toString())}g=new JU.SB; JU.XmlUtil.openTagAttr(g,"jvxlSurfaceData",k||null==a.jvxlPlane?null:null==a.mapLattice?w(-1,["plane",JU.Escape.eP4(a.jvxlPlane)]):w(-1,["plane",JU.Escape.eP4(a.jvxlPlane),"maplattice",JU.Escape.eP(a.mapLattice)]));if(k)J.jvxl.data.JvxlCoder.appendXmlVertexOnlyData(g,a,b,!0);else{if(null==a.jvxlPlane){if(null==a.jvxlEdgeData)return"";J.jvxl.data.JvxlCoder.appendXmlEdgeData(g,a)}J.jvxl.data.JvxlCoder.appendXmlColorData(g,a.jvxlColorData,!0,a.isJvxlPrecisionColor,a.valueMappedToRed,a.valueMappedToBlue)}J.jvxl.data.JvxlCoder.appendEncodedBitSetTag(g, "jvxlInvalidatedVertexData",a.jvxlExcluded[1],-1,null);0<a.excludedVertexCount&&(J.jvxl.data.JvxlCoder.appendEncodedBitSetTag(g,"jvxlExcludedVertexData",a.jvxlExcluded[0],a.excludedVertexCount,null),J.jvxl.data.JvxlCoder.appendEncodedBitSetTag(g,"jvxlExcludedPlaneData",a.jvxlExcluded[2],-1,null));J.jvxl.data.JvxlCoder.appendEncodedBitSetTag(g,"jvxlExcludedTriangleData",a.jvxlExcluded[3],a.excludedTriangleCount,null);JU.XmlUtil.closeTag(g,"jvxlSurfaceData");b=g.length();f.appendSB(g);null!=a.vContours&& 0<a.vContours.length&&J.jvxl.data.JvxlCoder.jvxlEncodeContourData(a.vContours,f);if(null!=a.vertexColorMap){null==a.baseColor?JU.XmlUtil.openTag(f,"jvxlVertexColorData"):JU.XmlUtil.openTagAttr(f,"jvxlVertexColorData",w(-1,["baseColor",a.baseColor]));var t;for(c=a.vertexColorMap.entrySet().iterator();c.hasNext()&&((t=c.next())||1);)J.jvxl.data.JvxlCoder.appendEncodedBitSetTag(f,"jvxlColorMap",t.getValue(),-1,w(-1,["color",t.getKey()]));a.vertexColorMap=null;JU.XmlUtil.closeTag(f,"jvxlVertexColorData")}JU.XmlUtil.closeTag(f, "jvxlSurface");h&&(JU.XmlUtil.closeTag(f,"jvxlSurfaceSet"),JU.XmlUtil.closeTag(f,"jvxl"));return J.jvxl.data.JvxlCoder.jvxlSetCompressionRatio(f,a,b)},"J.jvxl.data.JvxlData,J.jvxl.data.MeshData,~A,~S,~B,~N,~S,~S");c$.appendEncodedBitSetTag=e(c$,"appendEncodedBitSetTag",function(a,b,c,d,h){0>d&&(d=JU.BSUtil.cardinalityOf(c));if(0!=d){var m=new JU.SB;m.append("\n ");J.jvxl.data.JvxlCoder.jvxlEncodeBitSetBuffer(c,-1,m);JU.XmlUtil.appendTagObj(a,b,w(-1,[h,"bsEncoding","base90+35","count",""+d,"len",""+ c.length()]),J.jvxl.data.JvxlCoder.jvxlCompressString(m.toString(),!0))}},"JU.SB,~S,JU.BS,~N,~A");c$.jvxlSetCompressionRatio=e(c$,"jvxlSetCompressionRatio",function(a,b,c){a=a.toString();b=y(0<b.nBytes?b.nBytes/c:13*b.nPointsX*b.nPointsY*b.nPointsZ/c);return JU.PT.rep(a,'"not calculated"',0<b?'"'+b+':1"':'"?"')},"JU.SB,J.jvxl.data.JvxlData,~N");c$.appendXmlEdgeData=e(c$,"appendXmlEdgeData",function(a,b){JU.XmlUtil.appendTagObj(a,"jvxlEdgeData",w(-1,["count",""+(b.jvxlEdgeData.length-1),"encoding", "base90f1","bsEncoding","base90+35c","isXLowToHigh",""+b.isXLowToHigh,"data",J.jvxl.data.JvxlCoder.jvxlCompressString(b.jvxlEdgeData,!0)]),"\n"+J.jvxl.data.JvxlCoder.jvxlCompressString(b.jvxlSurfaceData,!0))},"JU.SB,J.jvxl.data.JvxlData");c$.jvxlAppendCommandState=e(c$,"jvxlAppendCommandState",function(a,b,c){null!=b&&JU.XmlUtil.appendCdata(a,"jvxlIsosurfaceCommand",null,"\n"+(0>b.indexOf("#")?b:b.substring(0,b.indexOf("#")))+"\n");null!=c&&(0<=c.indexOf("** XML ** ")?(c=JU.PT.split(c,"** XML **")[1].trim(), JU.XmlUtil.appendTag(a,"jvxlIsosurfaceState","\n"+c+"\n")):JU.XmlUtil.appendCdata(a,"jvxlIsosurfaceState",null,"\n"+c))},"JU.SB,~S,~S");c$.appendXmlColorData=e(c$,"appendXmlColorData",function(a,b,c,d,h,m){var g;if(!(null==b||0>(g=b.length-1)))d&&(g/=2),JU.XmlUtil.appendTagObj(a,"jvxlColorData",w(-1,["count",""+g,"encoding",c?"base90f"+(d?"2":"1"):"none","min",""+h,"max",""+m,"data",J.jvxl.data.JvxlCoder.jvxlCompressString(b,!0)]),null)},"JU.SB,~S,~B,~B,~N,~N");c$.jvxlGetInfo=e(c$,"jvxlGetInfo",function(a){return J.jvxl.data.JvxlCoder.jvxlGetInfoData(a, a.vertexDataOnly)},"J.jvxl.data.JvxlData");c$.jvxlGetInfoData=e(c$,"jvxlGetInfoData",function(a,b){if(null==a.jvxlSurfaceData)return"";var c=new JU.Lst,d=a.nSurfaceInts,h=b?0:a.jvxlEdgeData.length-1,m=null==a.jvxlColorData?-1:a.jvxlColorData.length-1;if(!b){J.jvxl.data.JvxlCoder.addAttrib(c,"\n cutoff",""+a.cutoff);J.jvxl.data.JvxlCoder.addAttrib(c,"\n isCutoffAbsolute",""+a.isCutoffAbsolute);J.jvxl.data.JvxlCoder.addAttrib(c,"\n pointsPerAngstrom",""+a.pointsPerAngstrom);var g=a.jvxlSurfaceData.length+ h+m+1;0<g&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n nBytesData",""+g);J.jvxl.data.JvxlCoder.addAttrib(c,"\n isXLowToHigh",""+a.isXLowToHigh);null==a.jvxlPlane&&(J.jvxl.data.JvxlCoder.addAttrib(c,"\n nSurfaceInts",""+d),J.jvxl.data.JvxlCoder.addAttrib(c,"\n nBytesUncompressedEdgeData",""+h));0<m&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n nBytesUncompressedColorData",""+m)}a.excludedVertexCount=JU.BSUtil.cardinalityOf(a.jvxlExcluded[0]);a.excludedTriangleCount=JU.BSUtil.cardinalityOf(a.jvxlExcluded[3]); 0<a.excludedVertexCount&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n nExcludedVertexes",""+a.excludedVertexCount);0<a.excludedTriangleCount&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n nExcludedTriangles",""+a.excludedTriangleCount);g=JU.BSUtil.cardinalityOf(a.jvxlExcluded[1]);0<g&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n nInvalidatedVertexes",""+g);null!=a.slabInfo&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n slabInfo",a.slabInfo);a.isJvxlPrecisionColor&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n precisionColor","true"); a.colorDensity&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n colorDensity","true");Float.isNaN(a.pointSize)?0!=a.diameter&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n diameter",""+a.diameter):J.jvxl.data.JvxlCoder.addAttrib(c,"\n pointSize",""+a.pointSize);a.allowVolumeRender||J.jvxl.data.JvxlCoder.addAttrib(c,"\n allowVolumeRender","false");null==a.jvxlPlane||b?(null!=a.fixedLattice&&!b&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n fixedLattice",""+a.fixedLattice),a.isContoured?(J.jvxl.data.JvxlCoder.addAttrib(c, "\n contoured","true"),J.jvxl.data.JvxlCoder.addAttrib(c,"\n colorMapped","true")):a.isBicolorMap?(J.jvxl.data.JvxlCoder.addAttrib(c,"\n bicolorMap","true"),J.jvxl.data.JvxlCoder.addAttrib(c,"\n colorNegative",JU.C.getHexCode(a.minColorIndex)),J.jvxl.data.JvxlCoder.addAttrib(c,"\n colorPositive",JU.C.getHexCode(a.maxColorIndex))):0<m&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n colorMapped","true"),null!=a.vContours&&0<a.vContours.length&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n nContourData",""+a.vContours.length)): (null!=a.mapLattice&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n mapLattice",""+a.mapLattice),0!=a.scale3d&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n scale3d",""+a.scale3d),0<m&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n colorMapped","true"),J.jvxl.data.JvxlCoder.addAttrib(c,"\n plane",JU.Escape.eP4(a.jvxlPlane)));null!=a.color&&0>a.color.indexOf("null")&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n color",a.color);J.jvxl.data.JvxlCoder.addAttrib(c,"\n translucency",""+a.translucency);null!=a.meshColor&&J.jvxl.data.JvxlCoder.addAttrib(c, "\n meshColor",a.meshColor);null!=a.colorScheme&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n colorScheme",a.colorScheme);null!=a.rendering&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n rendering",a.rendering);0<=a.thisSet&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n set",""+(a.thisSet+1));-2147483648!=a.slabValue&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n slabValue",""+a.slabValue);a.isSlabbable&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n slabbable","true");0<a.nVertexColors&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n nVertexColors", ""+a.nVertexColors);d=3.4028235E38==a.mappedDataMin?0:a.mappedDataMin;h=a.isColorReversed?a.valueMappedToRed:a.valueMappedToBlue;m=a.isColorReversed?a.valueMappedToBlue:a.valueMappedToRed;null!=a.jvxlColorData&&(0<a.jvxlColorData.length&&!a.isBicolorMap)&&(J.jvxl.data.JvxlCoder.addAttrib(c,"\n dataMinimum",""+d),J.jvxl.data.JvxlCoder.addAttrib(c,"\n dataMaximum",""+a.mappedDataMax),J.jvxl.data.JvxlCoder.addAttrib(c,"\n valueMappedToRed",""+m),J.jvxl.data.JvxlCoder.addAttrib(c,"\n valueMappedToBlue", ""+h));a.isContoured&&(null==a.contourValues||null==a.contourColixes?null==a.vContours&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n nContours",""+Math.abs(a.nContours)):(null!=a.jvxlPlane&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n contoured","true"),J.jvxl.data.JvxlCoder.addAttrib(c,"\n nContours",""+a.contourValues.length),J.jvxl.data.JvxlCoder.addAttrib(c,"\n contourValues",JU.Escape.eAF(null==a.contourValuesUsed?a.contourValues:a.contourValuesUsed)),J.jvxl.data.JvxlCoder.addAttrib(c,"\n contourColors", a.contourColors)),0<a.thisContour&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n thisContour",""+a.thisContour));a.insideOut&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n insideOut","true");a.vertexDataOnly?J.jvxl.data.JvxlCoder.addAttrib(c,"\n note","vertex/face data only"):a.isXLowToHigh&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n note","progressive JVXL+ -- X values read from low(0) to high("+(a.nPointsX-1)+")");J.jvxl.data.JvxlCoder.addAttrib(c,"\n xyzMin",JU.Escape.eP(a.boundingBox[0]));J.jvxl.data.JvxlCoder.addAttrib(c, "\n xyzMax",JU.Escape.eP(a.boundingBox[1]));J.jvxl.data.JvxlCoder.addAttrib(c,"\n approximateCompressionRatio","not calculated");J.jvxl.data.JvxlCoder.addAttrib(c,"\n jmolVersion",a.version);d=new JU.SB;JU.XmlUtil.openTagAttr(d,"jvxlSurfaceInfo",c.toArray(Array(c.size())));JU.XmlUtil.closeTag(d,"jvxlSurfaceInfo");return d.toString()},"J.jvxl.data.JvxlData,~B");c$.addAttrib=e(c$,"addAttrib",function(a,b,c){a.addLast(w(-1,[b,c]))},"JU.Lst,~S,~S");c$.jvxlEncodeContourData=e(c$,"jvxlEncodeContourData", function(a,b){JU.XmlUtil.openTagAttr(b,"jvxlContourData",w(-1,["count",""+a.length]));for(var c=0;c<a.length;c++)if(!(6>a[c].size())){var d=a[c].get(0).intValue(),h=new JU.SB;h.append("\n");var m=a[c].get(1);J.jvxl.data.JvxlCoder.jvxlEncodeBitSetBuffer(m,d,h);JU.XmlUtil.appendTagObj(b,"jvxlContour",w(-1,["index",""+c,"value",""+a[c].get(2),"color",JU.Escape.escapeColor(a[c].get(4)[0]),"count",""+m.length(),"encoding","base90iff1","bsEncoding","base90+35c","data",J.jvxl.data.JvxlCoder.jvxlCompressString(a[c].get(5).toString(), !0)]),J.jvxl.data.JvxlCoder.jvxlCompressString(h.toString(),!0))}JU.XmlUtil.closeTag(b,"jvxlContourData")},"~A,JU.SB");c$.set3dContourVector=e(c$,"set3dContourVector",function(a,b,c){if(!(6>a.size()))for(var d=a.get(5),h=a.get(1),m=0,g=d.length(),e=0,f=" ",k=" ",n=h.nextSetBit(0);0<=n;n=h.nextSetBit(n+1)){for(var q=b[n];m<g&&!JU.PT.isDigit(f=d.charAt(m++)););for(e=f.charCodeAt(0)-48;m<g&&JU.PT.isWhitespace(f=d.charAt(m++)););for(;m<g&&JU.PT.isWhitespace(k=d.charAt(m++)););var t=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(f.charCodeAt(0), 35,90,0),r=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(k.charCodeAt(0),35,90,0),j,p;0==(e&1)?(j=q[1],p=e=q[2],q=q[0]):(j=q[0],p=q[1],0!=(e&2)?(e=p,q=q[2]):(e=q[2],q=j));a.addLast(J.jvxl.data.JvxlCoder.getContourPoint(c,j,p,t));a.addLast(J.jvxl.data.JvxlCoder.getContourPoint(c,e,q,r))}},"JU.Lst,~A,~A");c$.getContourPoint=e(c$,"getContourPoint",function(a,b,c,d){var h=new JU.P3;h.sub2(a[c],a[b]);h.scaleAdd2(d,h,a[b]);return h},"~A,~N,~N,~N");c$.appendContourTriangleIntersection=e(c$,"appendContourTriangleIntersection", function(a,b,c,d){d.appendI(a);d.appendC(J.jvxl.data.JvxlCoder.jvxlFractionAsCharacter(b));d.appendC(J.jvxl.data.JvxlCoder.jvxlFractionAsCharacter(c))},"~N,~N,~N,JU.SB");c$.jvxlCreateColorData=e(c$,"jvxlCreateColorData",function(a,b){if(null==b)a.jvxlColorData="";else{var c=a.isJvxlPrecisionColor,d=a.isTruncated,h=a.colorFractionBase,m=a.colorFractionRange,g=a.valueMappedToBlue,e=a.valueMappedToRed,f=0<a.saveVertexCount?a.saveVertexCount:a.vertexCount;f>b.length&&System.out.println("JVXLCODER ERROR"); var k=a.mappedDataMin,n=a.mappedDataMax,q=new JU.SB,j=new JU.SB;b.length<f&&System.out.println("JVXLCOLOR OHOHO");for(var r=0;r<f;r++){var p=b[r];Float.isNaN(p)&&(p=k);d&&(p=0<p?0.999:-0.999);c?J.jvxl.data.JvxlCoder.jvxlAppendCharacter2(p,k,n,h,m,q,j):q.appendC(J.jvxl.data.JvxlCoder.jvxlValueAsCharacter(p,e,g,h,m))}a.jvxlColorData=q.appendSB(j).appendC("\n").toString()}},"J.jvxl.data.JvxlData,~A");c$.appendXmlVertexOnlyData=e(c$,"appendXmlVertexOnlyData",function(a,b,c,d){var h=p(c.vc,0);J.jvxl.data.JvxlCoder.appendXmlTriangleData(a, c.pis,c.pc,c.bsSlabDisplay,h,d)&&J.jvxl.data.JvxlCoder.appendXmlVertexData(a,b,h,c.vs,c.vvs,c.vc,c.polygonColorData,c.pc,c.bsSlabDisplay,b.vertexColors,0<b.jvxlColorData.length,d)},"JU.SB,J.jvxl.data.JvxlData,J.jvxl.data.MeshData,~B");c$.appendXmlTriangleData=e(c$,"appendXmlTriangleData",function(a,b,c,d,h,m){for(var g=new JU.SB,e=new JU.SB,f=1,k=0,n=0,q=!1,j=0,r=null!=d,p=0;p<c;)if(null==b[p]||r&&!d.get(p))p++;else{var u=b[p][k],u=0<h[u]?h[u]:h[u]=++n,y=u-f,f=u;0==y?(g.appendC("!"),q=!1):32<y?(q&& g.appendC("+"),g.appendI(y),q=!0):-32>y?(g.appendI(y),q=!0):(g.appendC(String.fromCharCode(92+y)),q=!1);0==++k%3&&(e.appendI(b[p][3]),k=0,p++,j++)}if(0==g.length())return!0;JU.XmlUtil.appendTagObj(a,"jvxlTriangleData",w(-1,["count",""+j,"encoding","jvxltdiff","data",J.jvxl.data.JvxlCoder.jvxlCompressString(g.toString(),m)]),null);JU.XmlUtil.appendTagObj(a,"jvxlTriangleEdgeData",w(-1,["count",""+j,"encoding","jvxlsc","data",J.jvxl.data.JvxlCoder.jvxlCompressString(e.toString(),m)]),null);return!0}, "JU.SB,~A,~N,JU.BS,~A,~B");c$.appendXmlVertexData=e(c$,"appendXmlVertexData",function(a,b,c,d,h,m,g,e,f,k,n,q){var j=b.colorFractionBase,r=b.colorFractionRange,L,u=b.boundingBox[0],y=b.boundingBox[1],E=new JU.SB,C=new JU.SB,B=null,D=null!=f;if(0<e){D&&(e=f.cardinality());for(var D=!1,B=p(m,0),A=0;A<m;A++)0<c[A]&&(B[c[A]-1]=A)}for(A=c=0;A<m;A++)if(!D||f.get(A))c++,L=d[0==e?A:B[A]],J.jvxl.data.JvxlCoder.jvxlAppendCharacter2(L.x,u.x,y.x,j,r,E,C),J.jvxl.data.JvxlCoder.jvxlAppendCharacter2(L.y,u.y,y.y, j,r,E,C),J.jvxl.data.JvxlCoder.jvxlAppendCharacter2(L.z,u.z,y.z,j,r,E,C);E.appendSB(C);JU.XmlUtil.appendTagObj(a,"jvxlVertexData",w(-1,["count",""+c,"min",JU.Escape.eP(u),"max",JU.Escape.eP(y),"encoding","base90xyz2","data",J.jvxl.data.JvxlCoder.jvxlCompressString(E.toString(),q)]),null);null!=g&&JU.XmlUtil.appendTagObj(a,"jvxlPolygonColorData",w(-1,["encoding","jvxlnc","count",""+e]),"\n"+g);if(n){E=new JU.SB;C=new JU.SB;if(null==k)for(A=0;A<m;A++){if(!D||f.get(A))J.jvxl.data.JvxlCoder.jvxlAppendCharacter2(h[0== e?A:B[A]],b.mappedDataMin,b.mappedDataMax,j,r,E,C)}else{d=0;E.appendI(c).append(" ");for(A=0;A<m;A++)if(!D||f.get(A))h=k[0==e?A:B[A]],h==d?h=0:d=h,E.appendI(h),E.append(" ")}J.jvxl.data.JvxlCoder.appendXmlColorData(a,E.appendSB(C).append("\n").toString(),null==k,!0,b.valueMappedToRed,b.valueMappedToBlue)}},"JU.SB,J.jvxl.data.JvxlData,~A,~A,~A,~N,~S,~N,JU.BS,~A,~B,~B");c$.jvxlFractionAsCharacter=e(c$,"jvxlFractionAsCharacter",function(a){return J.jvxl.data.JvxlCoder.jvxlFractionAsCharacterRange(a, 35,90)},"~N");c$.jvxlFractionAsCharacterRange=e(c$,"jvxlFractionAsCharacterRange",function(a,b,c){0.9999<a?a=0.9999:Float.isNaN(a)&&(a=1.0001);a=E(Math.floor(a*c+b));return a<b?String.fromCharCode(b):92==a?"!":String.fromCharCode(a)},"~N,~N,~N");c$.jvxlAppendCharacter2=e(c$,"jvxlAppendCharacter2",function(a,b,c,d,h,m,g){a=b==c?a:(a-b)/(c-b);b=J.jvxl.data.JvxlCoder.jvxlFractionAsCharacterRange(a,d,h);m.appendC(b);a-=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(b.charCodeAt(0),d,h,0);g.appendC(J.jvxl.data.JvxlCoder.jvxlFractionAsCharacterRange(a* h,d,h))},"~N,~N,~N,~N,~N,JU.SB,JU.SB");c$.jvxlFractionFromCharacter=e(c$,"jvxlFractionFromCharacter",function(a,b,c,d){if(a==b+c)return NaN;a<b&&(a=92);a=(a-b+d)/c;return 0>a?0:1<a?0.999999:a},"~N,~N,~N,~N");c$.jvxlFractionFromCharacter2=e(c$,"jvxlFractionFromCharacter2",function(a,b,c,d){a=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(a,c,d,0);b=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(b,c,d,0.5);return a+b/d},"~N,~N,~N,~N");c$.jvxlValueAsCharacter=e(c$,"jvxlValueAsCharacter",function(a, b,c,d,h){return J.jvxl.data.JvxlCoder.jvxlFractionAsCharacterRange(b==c?a:(a-b)/(c-b),d,h)},"~N,~N,~N,~N,~N");c$.jvxlValueFromCharacter2=e(c$,"jvxlValueFromCharacter2",function(a,b,c,d,h,m){a=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2(a,b,h,m);return d==c?a:c+a*(d-c)},"~N,~N,~N,~N,~N,~N");c$.jvxlEncodeBitSet0=e(c$,"jvxlEncodeBitSet0",function(a,b,c){var d=0,h=-1,m=0;0>b&&(b=a.length());for(var g=0,e=!1,f=b-1,k=0;k<b;++k)e==a.get(k)?d++:(d==h&&k!=f?m++:(0<m&&(c.appendC(" ").appendI(-m),m=0,g++), c.appendC(" ").appendI(d),g++,h=d),d=1,e=!e);c.appendC(" ").appendI(d).appendC("\n");return g},"JU.BS,~N,JU.SB");c$.jvxlEncodeBitSet=e(c$,"jvxlEncodeBitSet",function(a){var b=new JU.SB;J.jvxl.data.JvxlCoder.jvxlEncodeBitSetBuffer(a,-1,b);return b.toString()},"JU.BS");c$.jvxlEncodeBitSetBuffer=e(c$,"jvxlEncodeBitSetBuffer",function(a,b,c){var d=0,h=0,m=!1;0>b&&(b=a.length());if(0==b)return 0;c.append("-");for(var e=0;e<b;++e)m==a.get(e)?d++:(J.jvxl.data.JvxlCoder.jvxlAppendEncodedNumber(c,d,35,90), h++,d=1,m=!m);J.jvxl.data.JvxlCoder.jvxlAppendEncodedNumber(c,d,35,90);c.appendC("\n");return h},"JU.BS,~N,JU.SB");c$.jvxlAppendEncodedNumber=e(c$,"jvxlAppendEncodedNumber",function(a,b,c,d){var h=b<d;for(0==b?a.appendC(String.fromCharCode(c)):h||a.appendC(String.fromCharCode(c+d));0<b;){var e=E(b/d);b=c+b-e*d;92==b&&(b=33);a.appendC(String.fromCharCode(b));b=e}h||a.append(" ")},"JU.SB,~N,~N,~N");c$.jvxlDecodeBitSetRange=e(c$,"jvxlDecodeBitSetRange",function(a,b,c){for(var d=new JU.BS,h=0,e=0,g=!1, f=p(1,0);-2147483648!=(h=J.jvxl.data.JvxlCoder.jvxlParseEncodedInt(a,b,c,f));)g&&d.setBits(e,e+h),e+=h,g=!g;return d},"~S,~N,~N");c$.jvxlParseEncodedInt=e(c$,"jvxlParseEncodedInt",function(a,b,c,d){var h=!1,e=0,g=d[0],f=a.length;if(0>g)return-2147483648;for(;g<f&&JU.PT.isWhitespace(a.charAt(g));)++g;if(g>=f)return-2147483648;var j=1,k=a.charCodeAt(g)==b+c;for(k&&g++;g<f&&!JU.PT.isWhitespace(a.charAt(g));){h=a.charCodeAt(g);h<b&&(h=92);e+=(h-b)*j;h=!0;++g;if(!k)break;j*=c}h||(e=-2147483648);d[0]=g; return e},"~S,~N,~N,~A");c$.jvxlDecodeBitSet=e(c$,"jvxlDecodeBitSet",function(a){if(a.startsWith("-"))return J.jvxl.data.JvxlCoder.jvxlDecodeBitSetRange(J.jvxl.data.JvxlCoder.jvxlDecompressString(a.substring(1)),35,90);for(var b=new JU.BS,c=0,d=0,h=0,e=0,g=!1,f=p(1,0);;){c=0>h++?c:JU.PT.parseIntNext(a,f);if(-2147483648==c)break;0>c?(h=c,c=d):(g&&b.setBits(e,e+c),e+=c,d=c,g=!g)}return b},"~S");c$.jvxlCompressString=e(c$,"jvxlCompressString",function(a,b){if(0<=a.indexOf("~"))return a;for(var c=new JU.SB, d="\x00",h=!1,e=!1,g=0,f=a.length,j=0;j<=f;j++){var k=j==f?"\x00":a.charAt(j);switch(k){case "\n":case "\r":continue;case "&":case "<":h=b;break;default:h=!1}if(k==d)++g,k="\x00";else if(0<g||e){if(4>g&&!e||" "==d||"\t"==d)for(;0<=--g;)c.appendC(d);else e?e=!1:c.appendC("~"),c.appendI(g),c.appendC(" ");g=0}"\x00"!=k&&(h?(e=!0,c.appendC("~"),d=k,k=String.fromCharCode(k.charCodeAt(0)-1)):d=k,c.appendC(k))}return c.toString()},"~S,~B");c$.jvxlDecompressString=e(c$,"jvxlDecompressString",function(a){if(0> a.indexOf("~"))return a;for(var b=new JU.SB,c="\x00",d=p(1,0),h=0;h<a.length;h++){var e=a.charAt(h);if("~"==e)switch(d[0]=++h,e=a.charAt(h)){case ";":case "%":d[0]++,b.appendC(c=String.fromCharCode(e.charCodeAt(0)+1));case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":h=JU.PT.parseIntNext(a,d);for(e=0;e<h;e++)b.appendC(c);h=d[0];continue;case "~":--h;break;default:JU.Logger.error("Error uncompressing string "+a.substring(0,h)+"?")}b.appendC(e);c=e}return b.toString()}, "~S");c$.jvxlCreateHeaderWithoutTitleOrAtoms=e(c$,"jvxlCreateHeaderWithoutTitleOrAtoms",function(a,b){J.jvxl.data.JvxlCoder.jvxlCreateHeader(a,b)},"J.jvxl.data.VolumeData,JU.SB");c$.jvxlCreateHeader=e(c$,"jvxlCreateHeader",function(a,b){a.setVolumetricXml();0==b.length()&&b.append("Line 1\nLine 2\n")},"J.jvxl.data.VolumeData,JU.SB");R(c$,"JVXL_VERSION1","2.0","JVXL_VERSION_XML","2.3","CONTOUR_NPOLYGONS",0,"CONTOUR_BITSET",1,"CONTOUR_VALUE",2,"CONTOUR_COLIX",3,"CONTOUR_COLOR",4,"CONTOUR_FDATA",5,"CONTOUR_POINTS", 6,"defaultEdgeFractionBase",35,"defaultEdgeFractionRange",90,"defaultColorFractionBase",35,"defaultColorFractionRange",90)});H("J.jvxl.data");K(["J.api.VolumeDataInterface","JU.M3","$.P3","$.V3"],"J.jvxl.data.VolumeData",["java.lang.Float","java.util.Hashtable","JU.SB","JU.Escape","$.Logger"],function(){c$=C(function(){this.sr=null;this.doIterate=!0;this.voxelCounts=this.volumetricVectors=this.origin=this.volumetricOrigin=null;this.nPoints=0;this.volumetricVectorLengths=this.voxelMap=this.voxelData= null;this.yzCount=this.minToPlaneDistance=this.maxVectorLength=0;this.thePlane=this.inverseMatrix=this.volumetricMatrix=this.unitVolumetricVectors=null;this.thePlaneNormalMag=0;this.mappingPlane=this.xmlData=this.ptXyzTemp=null;this.voxelVolume=this.maxGrid=this.minGrid=this.mappingPlaneNormalMag=0;this.spanningVectors=null;this.isSquared=this.isPeriodic=!1;this.ptTemp=this.edgeVector=null;G(this,arguments)},J.jvxl.data,"VolumeData",null,J.api.VolumeDataInterface);W(c$,function(){this.volumetricOrigin= new JU.P3;this.origin=u(3,0);this.volumetricVectors=Array(3);this.voxelCounts=p(3,0);this.volumetricVectorLengths=u(3,0);this.unitVolumetricVectors=Array(3);this.volumetricMatrix=new JU.M3;this.inverseMatrix=new JU.M3;this.ptXyzTemp=new JU.P3;this.edgeVector=new JU.V3;this.ptTemp=new JU.P3});j(c$,"getVoxelData",function(){return this.voxelData});j(c$,"setVoxelDataAsArray",function(a){this.voxelData=a;null!=a&&(this.sr=null)},"~A");e(c$,"hasPlane",function(){return null!=this.thePlane});Q(c$,function(){this.volumetricVectors[0]= new JU.V3;this.volumetricVectors[1]=new JU.V3;this.volumetricVectors[2]=new JU.V3;this.unitVolumetricVectors[0]=new JU.V3;this.unitVolumetricVectors[1]=new JU.V3;this.unitVolumetricVectors[2]=new JU.V3});e(c$,"setMappingPlane",function(a){this.mappingPlane=a;null!=a&&(this.mappingPlaneNormalMag=Math.sqrt(a.x*a.x+a.y*a.y+a.z*a.z))},"JU.P4");e(c$,"distanceToMappingPlane",function(a){return(this.mappingPlane.x*a.x+this.mappingPlane.y*a.y+this.mappingPlane.z*a.z+this.mappingPlane.w)/this.mappingPlaneNormalMag}, "JU.T3");j(c$,"setVolumetricOrigin",function(a,b,c){this.volumetricOrigin.set(a,b,c)},"~N,~N,~N");j(c$,"getOriginFloat",function(){return this.origin});e(c$,"getYzCount",function(){this.minGrid=this.volumetricVectors[0].length();this.minGrid=Math.min(this.minGrid,this.volumetricVectors[1].length());this.minGrid=Math.min(this.minGrid,this.volumetricVectors[2].length());this.maxGrid=this.volumetricVectors[0].length();this.maxGrid=Math.max(this.maxGrid,this.volumetricVectors[1].length());this.maxGrid= Math.max(this.maxGrid,this.volumetricVectors[2].length());this.nPoints=this.voxelCounts[0]*this.voxelCounts[1]*this.voxelCounts[2];return this.yzCount=this.voxelCounts[1]*this.voxelCounts[2]});j(c$,"getVolumetricVectorLengths",function(){return this.volumetricVectorLengths});j(c$,"setVolumetricVector",function(a,b,c,d){this.volumetricVectors[a].x=b;this.volumetricVectors[a].y=c;this.volumetricVectors[a].z=d;this.setUnitVectors()},"~N,~N,~N,~N");j(c$,"getVoxelCounts",function(){return this.voxelCounts}); j(c$,"setVoxelCounts",function(a,b,c){this.voxelCounts[0]=a;this.voxelCounts[1]=b;this.voxelCounts[2]=c;return a*b*c},"~N,~N,~N");e(c$,"getVoxelDataAt",function(a){var b=E(a/this.yzCount);a-=b*this.yzCount;var c=E(a/this.voxelCounts[2]);return this.voxelData[b][c][a-c*this.voxelCounts[2]]},"~N");e(c$,"getPointIndex",function(a,b,c){return a*this.yzCount+b*this.voxelCounts[2]+c},"~N,~N,~N");e(c$,"getPoint",function(a,b){var c=E(a/this.yzCount);a-=c*this.yzCount;var d=E(a/this.voxelCounts[2]);this.voxelPtToXYZ(c, d,a-d*this.voxelCounts[2],b)},"~N,JU.P3");e(c$,"setVoxelData",function(a,b){var c=E(a/this.yzCount);a-=c*this.yzCount;var d=E(a/this.voxelCounts[2]);this.voxelData[c][d][a-d*this.voxelCounts[2]]=b},"~N,~N");e(c$,"setVoxelMap",function(){this.voxelMap=new java.util.Hashtable;this.getYzCount()});e(c$,"setMatrix",function(){for(var a=0;3>a;a++)this.volumetricMatrix.setColumnV(a,this.volumetricVectors[a]);try{this.inverseMatrix.invertM(this.volumetricMatrix)}catch(b){if(U(b,Exception))return JU.Logger.error("VolumeData error setting matrix -- bad unit vectors? "), !1;throw b;}return!0});j(c$,"transform",function(a,b){this.volumetricMatrix.rotate2(a,b)},"JU.V3,JU.V3");j(c$,"setPlaneParameters",function(a){this.thePlane=a;this.thePlaneNormalMag=Math.sqrt(a.x*a.x+a.y*a.y+a.z*a.z)},"JU.P4");j(c$,"calcVoxelPlaneDistance",function(a,b,c){this.voxelPtToXYZ(a,b,c,this.ptXyzTemp);return this.distancePointToPlane(this.ptXyzTemp)},"~N,~N,~N");e(c$,"getToPlaneParameter",function(){return Math.sqrt(this.thePlane.x*this.thePlane.x+this.thePlane.y*this.thePlane.y+this.thePlane.z* this.thePlane.z)*this.minToPlaneDistance});e(c$,"isNearPlane",function(a,b,c,d){this.voxelPtToXYZ(a,b,c,this.ptXyzTemp);return this.thePlane.x*this.ptXyzTemp.x+this.thePlane.y*this.ptXyzTemp.y+this.thePlane.z*this.ptXyzTemp.z+this.thePlane.w<d},"~N,~N,~N,~N");j(c$,"distancePointToPlane",function(a){return(this.thePlane.x*a.x+this.thePlane.y*a.y+this.thePlane.z*a.z+this.thePlane.w)/this.thePlaneNormalMag},"JU.T3");j(c$,"voxelPtToXYZ",function(a,b,c,d){d.scaleAdd2(a,this.volumetricVectors[0],this.volumetricOrigin); d.scaleAdd2(b,this.volumetricVectors[1],d);d.scaleAdd2(c,this.volumetricVectors[2],d)},"~N,~N,~N,JU.T3");e(c$,"setUnitVectors",function(){this.maxVectorLength=0;this.voxelVolume=1;for(var a=0;3>a;a++){var b=this.volumetricVectorLengths[a]=this.volumetricVectors[a].length();if(0==b)return!1;b>this.maxVectorLength&&(this.maxVectorLength=b);this.voxelVolume*=b;this.unitVolumetricVectors[a].setT(this.volumetricVectors[a]);this.unitVolumetricVectors[a].normalize()}this.minToPlaneDistance=2*this.maxVectorLength; this.origin[0]=this.volumetricOrigin.x;this.origin[1]=this.volumetricOrigin.y;this.origin[2]=this.volumetricOrigin.z;this.spanningVectors=Array(4);this.spanningVectors[0]=JU.V3.newV(this.volumetricOrigin);for(a=0;3>a;a++)b=this.spanningVectors[a+1]=new JU.V3,b.scaleAdd2(this.voxelCounts[a]-1,this.volumetricVectors[a],b);return this.setMatrix()});j(c$,"xyzToVoxelPt",function(a,b,c,d){this.ptXyzTemp.set(a,b,c);this.ptXyzTemp.sub(this.volumetricOrigin);this.inverseMatrix.rotate(this.ptXyzTemp);d.set(Math.round(this.ptXyzTemp.x), Math.round(this.ptXyzTemp.y),Math.round(this.ptXyzTemp.z))},"~N,~N,~N,JU.T3i");j(c$,"lookupInterpolatedVoxelValue",function(a,b){if(null!=this.mappingPlane)return this.distanceToMappingPlane(a);if(null!=this.sr){var c=this.sr.getValueAtPoint(a,b);return this.isSquared?c*c:c}this.ptXyzTemp.sub2(a,this.volumetricOrigin);this.inverseMatrix.rotate(this.ptXyzTemp);var d,h=this.indexLower(this.ptXyzTemp.x,d=this.voxelCounts[0]-1),e=this.indexUpper(this.ptXyzTemp.x,h,d),g=this.indexLower(this.ptXyzTemp.y, d=this.voxelCounts[1]-1),f=this.indexUpper(this.ptXyzTemp.y,g,d),c=this.indexLower(this.ptXyzTemp.z,d=this.voxelCounts[2]-1),j=this.indexUpper(this.ptXyzTemp.z,c,d);d=J.jvxl.data.VolumeData.getFractional2DValue(this.mantissa(this.ptXyzTemp.x-h),this.mantissa(this.ptXyzTemp.y-g),this.getVoxelValue(h,g,c),this.getVoxelValue(e,g,c),this.getVoxelValue(h,f,c),this.getVoxelValue(e,f,c));h=J.jvxl.data.VolumeData.getFractional2DValue(this.mantissa(this.ptXyzTemp.x-h),this.mantissa(this.ptXyzTemp.y-g),this.getVoxelValue(h, g,j),this.getVoxelValue(e,g,j),this.getVoxelValue(h,f,j),this.getVoxelValue(e,f,j));return d+this.mantissa(this.ptXyzTemp.z-c)*(h-d)},"JU.T3,~B");e(c$,"mantissa",function(a){return this.isPeriodic?a-Math.floor(a):a},"~N");e(c$,"getVoxelValue",function(a,b,c){if(null==this.voxelMap)return this.voxelData[a][b][c];a=this.voxelMap.get(Integer.$valueOf(this.getPointIndex(a,b,c)));return null==a?NaN:a.floatValue()},"~N,~N,~N");c$.getFractional2DValue=e(c$,"getFractional2DValue",function(a,b,c,d,h,e){c+= a*(d-c);return c+b*(h+a*(e-h)-c)},"~N,~N,~N,~N,~N,~N");e(c$,"indexLower",function(a,b){if(this.isPeriodic&&0<b){for(;0>a;)a+=b;for(;a>=b;)a-=b;return E(Math.floor(a))}if(0>a)return 0;var c=E(Math.floor(a));return c>b?b:c},"~N,~N");e(c$,"indexUpper",function(a,b,c){return!this.isPeriodic&&0>a||b==c?b:b+1},"~N,~N,~N");e(c$,"offsetCenter",function(a){var b=new JU.P3;b.scaleAdd2((this.voxelCounts[0]-1)/2,this.volumetricVectors[0],b);b.scaleAdd2((this.voxelCounts[1]-1)/2,this.volumetricVectors[1],b);b.scaleAdd2((this.voxelCounts[2]- 1)/2,this.volumetricVectors[2],b);this.volumetricOrigin.sub2(a,b)},"JU.P3");j(c$,"setDataDistanceToPlane",function(a){this.setPlaneParameters(a);a=this.voxelCounts[0];var b=this.voxelCounts[1],c=this.voxelCounts[2];this.voxelData=u(a,b,c,0);for(var d=0;d<a;d++)for(var h=0;h<b;h++)for(var e=0;e<c;e++)this.voxelData[d][h][e]=this.calcVoxelPlaneDistance(d,h,e)},"JU.P4");j(c$,"filterData",function(a,b){var c=!Float.isNaN(b);if(null!=this.sr)this.isSquared=a;else{var d=this.voxelCounts[0],h=this.voxelCounts[1], e=this.voxelCounts[2];if(a)for(var g=0;g<d;g++)for(var f=0;f<h;f++)for(var j=0;j<e;j++)this.voxelData[g][f][j]*=this.voxelData[g][f][j];if(c)for(g=0;g<d;g++)for(f=0;f<h;f++)for(j=0;j<e;j++)this.voxelData[g][f][j]=b-this.voxelData[g][f][j]}},"~B,~N");j(c$,"capData",function(a,b){if(null!=this.voxelData){var c=this.voxelCounts[0],d=this.voxelCounts[1],h=this.voxelCounts[2],e=JU.V3.new3(a.x,a.y,a.z);e.normalize();for(var g=0;g<c;g++)for(var f=0;f<d;f++)for(var j=0;j<h;j++){var k=this.voxelData[g][f][j]- b;this.voxelPtToXYZ(g,f,j,this.ptXyzTemp);var n=(this.ptXyzTemp.x*e.x+this.ptXyzTemp.y*e.y+this.ptXyzTemp.z*e.z+a.w-b)/1;if(0<=n||n>k)this.voxelData[g][f][j]=n}}},"JU.P4,~N");e(c$,"setVolumetricXml",function(){var a=new JU.SB;if(0==this.voxelCounts[0])a.append("<jvxlVolumeData>\n");else{a.append('<jvxlVolumeData origin="'+JU.Escape.eP(this.volumetricOrigin)+'">\n');for(var b=0;3>b;b++)a.append('<jvxlVolumeVector type="'+b+'" count="'+this.voxelCounts[b]+'" vector="'+JU.Escape.eP(this.volumetricVectors[b])+ '"></jvxlVolumeVector>\n')}a.append("</jvxlVolumeData>\n");return this.xmlData=a.toString()});e(c$,"setVoxelMapValue",function(a,b,c,d){null!=this.voxelMap&&this.voxelMap.put(Integer.$valueOf(this.getPointIndex(a,b,c)),Float.$valueOf(d))},"~N,~N,~N,~N");e(c$,"calculateFractionalPoint",function(a,b,c,d,h,e){var g=h-d,f=(a-d)/g;this.edgeVector.sub2(c,b);e.scaleAdd2(f,this.edgeVector,b);if(null==this.sr||!this.doIterate||h==d||0.01>f||0.99<f||0.01>this.edgeVector.length())return a;b=0;this.ptTemp.setT(e); c=this.lookupInterpolatedVoxelValue(this.ptTemp,!1);for(h=NaN;10>++b;){var j=(c-d)/g;if(0>j||1<j)break;j=(a-c)/g/2;f+=j;if(0>f||1<f)break;e.setT(this.ptTemp);h=c;if(0.005>Math.abs(j))break;this.ptTemp.scaleAdd2(j,this.edgeVector,e);c=this.lookupInterpolatedVoxelValue(this.ptTemp,!1)}return h},"~N,JU.P3,JU.P3,~N,~N,JU.P3")});H("J.jvxl.data");K(null,"J.jvxl.data.JvxlData",["java.lang.Float","JU.SB","J.jvxl.data.JvxlCoder"],function(){c$=C(function(){this.msg="";this.wasCubic=this.wasJvxl=!1;this.jvxlPlane= this.jvxlExcluded=this.jvxlVolumeDataXml=this.jvxlColorData=this.jvxlEdgeData=this.jvxlSurfaceData=this.jvxlFileMessage=this.jvxlFileTitle=null;this.isColorReversed=this.jvxlDataIsColorDensity=this.jvxlDataIs2dContour=this.jvxlDataIsColorMapped=this.isJvxlPrecisionColor=!1;this.thisSet=-2147483648;this.edgeFractionBase=35;this.edgeFractionRange=90;this.colorFractionBase=35;this.colorFractionRange=90;this.vertexDataOnly=this.isCutoffAbsolute=this.isTruncated=this.isBicolorMap=this.isContoured=this.isXLowToHigh= this.insideOut=this.dataXYReversed=!1;this.vertexCount=this.nSurfaceInts=this.nEdges=this.nContours=this.nBytes=this.nPointsZ=this.nPointsY=this.nPointsX=this.pointsPerAngstrom=this.cutoff=this.valueMappedToBlue=this.valueMappedToRed=this.mappedDataMax=this.mappedDataMin=0;this.contourValuesUsed=this.contourValues=this.contourColors=this.contourColixes=this.vContours=null;this.thisContour=-1;this.scale3d=0;this.minColorIndex=-1;this.maxColorIndex=0;this.boundingBox=this.version=this.title=null;this.excludedVertexCount= this.excludedTriangleCount=0;this.colorDensity=!1;this.pointSize=0;this.moleculeXml=null;this.saveVertexCount=this.dataMax=this.dataMin=0;this.vertexColorMap=null;this.nVertexColors=0;this.meshColor=this.color=this.vertexColors=null;this.translucency=0;this.rendering=this.colorScheme=null;this.slabValue=-2147483648;this.isSlabbable=!1;this.diameter=0;this.slabInfo=null;this.allowVolumeRender=!1;this.voxelVolume=0;this.baseColor=this.fixedLattice=this.mapLattice=null;G(this,arguments)},J.jvxl.data, "JvxlData");W(c$,function(){this.jvxlExcluded=Array(4)});Q(c$,function(){});e(c$,"clear",function(){this.allowVolumeRender=!0;this.jvxlVolumeDataXml=this.jvxlColorData=this.jvxlEdgeData=this.jvxlSurfaceData="";this.colorScheme=this.color=null;this.colorDensity=!1;this.pointSize=NaN;this.contourColors=this.contourColixes=this.contourValuesUsed=this.contourValues=null;this.isSlabbable=!1;this.meshColor=this.mapLattice=null;this.msg="";this.nVertexColors=this.nPointsX=0;this.slabInfo=this.fixedLattice= null;this.thisSet=this.slabValue=-2147483648;this.rendering=null;this.thisContour=-1;this.translucency=0;this.vertexColors=this.vertexColorMap=this.vContours=null;this.voxelVolume=0});e(c$,"setSurfaceInfo",function(a,b,c,d){this.jvxlSurfaceData=d;0==this.jvxlSurfaceData.indexOf("--")&&(this.jvxlSurfaceData=this.jvxlSurfaceData.substring(2));this.jvxlPlane=a;this.mapLattice=b;this.nSurfaceInts=c},"JU.P4,JU.P3,~N,~S");e(c$,"setSurfaceInfoFromBitSet",function(a,b){this.setSurfaceInfoFromBitSetPts(a, b,null)},"JU.BS,JU.P4");e(c$,"setSurfaceInfoFromBitSetPts",function(a,b,c){var d=new JU.SB;a=null!=b?0:J.jvxl.data.JvxlCoder.jvxlEncodeBitSetBuffer(a,this.nPointsX*this.nPointsY*this.nPointsZ,d);this.setSurfaceInfo(b,c,a,d.toString())},"JU.BS,JU.P4,JU.P3");e(c$,"jvxlUpdateInfo",function(a,b){this.title=a;this.nBytes=b},"~A,~N");c$.updateSurfaceData=e(c$,"updateSurfaceData",function(a,b,c,d,h){if(0==a.length)return"";a=a.toCharArray();for(var e=0,g=0;e<c;e+=d,g++)Float.isNaN(b[e])&&(a[g]=h);return String.copyValueOf(a)}, "~S,~A,~N,~N,~S")});H("J.jvxl.data");K(["JU.MeshSurface"],"J.jvxl.data.MeshData",["java.lang.Float","java.util.Arrays","JU.AU","$.BS","$.V3"],function(){c$=C(function(){this.setsSuccessful=!1;this.vertexIncrement=1;this.polygonColorData=null;na("J.jvxl.data.MeshData.SSet")||J.jvxl.data.MeshData.$MeshData$SSet$();na("J.jvxl.data.MeshData.SortSet")||J.jvxl.data.MeshData.$MeshData$SortSet$();G(this,arguments)},J.jvxl.data,"MeshData",JU.MeshSurface);e(c$,"addVertexCopy",function(a,b,c,d){0>c&&(this.vertexIncrement= -c);return this.addVCVal(a,b,d)},"JU.T3,~N,~N,~B");e(c$,"getSurfaceSet",function(){return null==this.surfaceSet?this.getSurfaceSetForLevel(0):this.surfaceSet});e(c$,"getSurfaceSetForLevel",function(a){0==a&&(this.surfaceSet=Array(100),this.nSets=0);this.setsSuccessful=!0;for(var b=0;b<this.pc;b++)if(null!=this.pis[b]&&(null==this.bsSlabDisplay||this.bsSlabDisplay.get(b))){var c=this.pis[b],d=this.findSet(c[0]),h=this.findSet(c[1]),e=this.findSet(c[2]);0>d&&0>h&&0>e?this.createSet(c[0],c[1],c[2]): d==h&&h==e||(0<=d?(this.surfaceSet[d].set(c[1]),this.surfaceSet[d].set(c[2]),0<=h&&h!=d&&this.mergeSets(d,h),0<=e&&(e!=d&&e!=h)&&this.mergeSets(d,e)):0<=h?(this.surfaceSet[h].set(c[0]),this.surfaceSet[h].set(c[2]),0<=e&&e!=h&&this.mergeSets(h,e)):(this.surfaceSet[e].set(c[0]),this.surfaceSet[e].set(c[1])))}for(b=c=0;b<this.nSets;b++)null!=this.surfaceSet[b]&&c++;d=Array(this.surfaceSet.length);for(b=c=0;b<this.nSets;b++)null!=this.surfaceSet[b]&&(d[c++]=this.surfaceSet[b]);this.nSets=c;this.surfaceSet= d;!this.setsSuccessful&&2>a&&this.getSurfaceSetForLevel(a+1);if(0==a){a=Array(this.nSets);for(b=0;b<this.nSets;b++)a[b]=ma(J.jvxl.data.MeshData.SSet,this,null,this.surfaceSet[b]);java.util.Arrays.sort(a,ma(J.jvxl.data.MeshData.SortSet,this,null));for(b=0;b<this.nSets;b++)this.surfaceSet[b]=a[b].bs;this.setVertexSets(!1)}return this.surfaceSet},"~N");e(c$,"setVertexSets",function(a){if(null!=this.surfaceSet){for(var b=0,c=0;c<this.nSets;c++)null!=this.surfaceSet[c]&&0>this.surfaceSet[c].nextSetBit(0)&& (this.surfaceSet[c]=null),null==this.surfaceSet[c]&&b++;if(0<b){a=Array(this.nSets-b);for(var d=c=0;c<this.nSets;c++)null!=this.surfaceSet[c]&&(a[d++]=this.surfaceSet[c]);this.surfaceSet=a;this.nSets-=b}else if(a)return;this.vertexSets=p(this.vc,0);for(c=0;c<this.nSets;c++)for(b=this.surfaceSet[c].nextSetBit(0);0<=b;b=this.surfaceSet[c].nextSetBit(b+1))this.vertexSets[b]=c}},"~B");e(c$,"findSet",function(a){for(var b=0;b<this.nSets;b++)if(null!=this.surfaceSet[b]&&this.surfaceSet[b].get(a))return b; return-1},"~N");e(c$,"createSet",function(a,b,c){var d;for(d=0;d<this.nSets&&null!=this.surfaceSet[d];d++);d==this.surfaceSet.length&&(this.surfaceSet=JU.AU.ensureLength(this.surfaceSet,this.surfaceSet.length+100));this.surfaceSet[d]=new JU.BS;this.surfaceSet[d].set(a);this.surfaceSet[d].set(b);this.surfaceSet[d].set(c);d==this.nSets&&this.nSets++},"~N,~N,~N");e(c$,"mergeSets",function(a,b){this.surfaceSet[a].or(this.surfaceSet[b]);this.surfaceSet[b]=null},"~N,~N");e(c$,"invalidateSurfaceSet",function(a){for(var b= this.surfaceSet[a].nextSetBit(0);0<=b;b=this.surfaceSet[a].nextSetBit(b+1))this.vvs[b]=NaN;this.surfaceSet[a]=null},"~N");c$.checkCutoff=e(c$,"checkCutoff",function(a,b,c,d){if(0>a||0>b||0>c)return!1;a=d[a];b=d[b];c=d[c];return 0<=a&&0<=b&&0<=c||0>=a&&0>=b&&0>=c},"~N,~N,~N,~A");c$.calculateVolumeOrArea=e(c$,"calculateVolumeOrArea",function(a,b,c,d){(d||0>=a.nSets)&&a.getSurfaceSet();for(var h=(d=-1<=b)||0>=a.nSets?1:a.nSets,e=Ya(h,0),g=new JU.V3,f=new JU.V3,j=new JU.V3,k=a.pc;0<=--k;)if(null!=a.setABC(k)){var n= 0>=a.nSets?0:a.vertexSets[a.iA];0<=b&&n!=b||(c?(g.sub2(a.vs[a.iB],a.vs[a.iA]),f.sub2(a.vs[a.iC],a.vs[a.iA]),j.cross(g,f),e[d?0:n]+=j.length()):(g.setT(a.vs[a.iB]),f.setT(a.vs[a.iC]),j.cross(g,f),f.setT(a.vs[a.iA]),e[d?0:n]+=f.dot(j)))}a=c?2:6;for(k=0;k<h;k++)e[k]/=a;return d?Float.$valueOf(e[0]):e},"J.jvxl.data.MeshData,~N,~B,~B");e(c$,"updateInvalidatedVertices",function(a){a.clearAll();for(var b=0;b<this.vc;b+=this.vertexIncrement)Float.isNaN(this.vvs[b])&&a.set(b)},"JU.BS");e(c$,"invalidateVertices", function(a){for(var b=a.nextSetBit(0);0<=b;b=a.nextSetBit(b+1))this.vvs[b]=NaN},"JU.BS");c$.$MeshData$SSet$=function(){la(self.c$);c$=C(function(){oa(this,arguments);this.bs=null;this.n=0;G(this,arguments)},J.jvxl.data.MeshData,"SSet");Q(c$,function(a){this.bs=a;this.n=a.cardinality()},"JU.BS");c$=fa()};c$.$MeshData$SortSet$=function(){la(self.c$);c$=C(function(){oa(this,arguments);G(this,arguments)},J.jvxl.data.MeshData,"SortSet",null,java.util.Comparator);j(c$,"compare",function(a,b){return a.n> b.n?-1:a.n<b.n?1:0},"J.jvxl.data.MeshData.SSet,J.jvxl.data.MeshData.SSet");c$=fa()};R(c$,"MODE_GET_VERTICES",1,"MODE_GET_COLOR_INDEXES",2,"MODE_PUT_SETS",3,"MODE_PUT_VERTICES",4)});H("J.jvxl.readers");K(null,"J.jvxl.readers.XmlReader",["JU.P3","$.PT","$.SB","$.XmlUtil","JU.Escape"],function(){c$=C(function(){this.line=this.br=null;G(this,arguments)},J.jvxl.readers,"XmlReader");e(c$,"getLine",function(){return this.line});Q(c$,function(a){this.br=a},"java.io.BufferedReader");e(c$,"toTag",function(a){this.skipTo("<"+ a);if(null==this.line)return"";var b=this.line.indexOf("<"+a)+a.length+1;if(b==this.line.length||" "==this.line.charAt(b)||">"==this.line.charAt(b))return this.line;this.line=null;return this.toTag(a)},"~S");e(c$,"skipTag",function(a){this.skipTo("</"+a+">")},"~S");e(c$,"getXmlData",function(a,b,c,d){var h="</"+a+">";a="<"+a;if(null==b){b=new JU.SB;try{null==this.line&&(this.line=this.br.readLine());for(;0>this.line.indexOf(a);)this.line=this.br.readLine()}catch(e){if(U(e,Exception))return null;throw e; }b.append(this.line);var g=!1,f=this.line.indexOf("/>"),j=this.line.indexOf(">");if(0>j||f==j-1)g=d;for(;0>this.line.indexOf(h)&&(!g||0>this.line.indexOf("/>"));)b.append(this.line=this.br.readLine());b=b.toString()}return J.jvxl.readers.XmlReader.extractTag(b,a,h,c)},"~S,~S,~B,~B");c$.extractTagOnly=e(c$,"extractTagOnly",function(a,b){return J.jvxl.readers.XmlReader.extractTag(a,"<"+b+">","</"+b+">",!1)},"~S,~S");c$.extractTag=e(c$,"extractTag",function(a,b,c,d){b=a.indexOf(b);if(0>b)return"";var h= a.indexOf(c,b);0>h&&(h=a.indexOf("/>",b),c="/>");if(0>h)return"";if(d)return h+=c.length,a.substring(b,h);for(c=!1;b<h;b++)if('"'==(d=a.charAt(b)))c=!c;else if(c&&"\\"==d)b++;else if(!c&&(">"==d||"/"==d))break;if(b>=h)return"";for(;JU.PT.isWhitespace(a.charAt(++b)););return JU.XmlUtil.unwrapCdata(a.substring(b,h))},"~S,~S,~S,~B");c$.getXmlAttrib=e(c$,"getXmlAttrib",function(a,b){var c=p(1,0),d=J.jvxl.readers.XmlReader.setNext(a,b,c,1);if(2>d||2>(d=J.jvxl.readers.XmlReader.setNext(a,'"',c,0)))return""; c=J.jvxl.readers.XmlReader.setNext(a,'"',c,-1);return 0>=c?"":a.substring(d,c)},"~S,~S");e(c$,"getXmlPoint",function(a,b){var c=J.jvxl.readers.XmlReader.getXmlAttrib(a,b).$replace("(","{").$replace(")","}"),c=JU.Escape.uP(c);return V(c,JU.P3)?c:new JU.P3},"~S,~S");c$.setNext=e(c$,"setNext",function(a,b,c,d){var h=c[0];if(0>h||0>(h=a.indexOf(b,c[0])))return-1;h+=b.length;c[0]=h+d;return 0<d&&h<a.length&&"="!=a.charAt(h)?J.jvxl.readers.XmlReader.setNext(a,b,c,d):c[0]},"~S,~S,~A,~N");e(c$,"skipTo",function(a){null== this.line&&(this.line=this.br.readLine());for(;null!=this.line&&0>this.line.indexOf(a);)this.line=this.br.readLine()},"~S");e(c$,"isNext",function(a){if(null==this.line||0<=this.line.indexOf("</")&&this.line.indexOf("</")==this.line.indexOf("<"))this.line=this.br.readLine();return 0<=this.line.indexOf("<"+a)},"~S")});H("J.jvxl.readers");K(["JU.P3","$.V3"],"J.jvxl.readers.SurfaceGenerator","java.lang.Float java.util.Map JU.AU $.BS $.Measure $.P4 $.PT $.Rdr J.jvxl.data.JvxlCoder $.JvxlData $.MeshData $.VolumeData J.jvxl.readers.Parameters $.SurfaceReader JU.Logger JV.FileManager".split(" "), function(){c$=C(function(){this.version=this.marchingSquares=this.atomDataServer=this.meshDataServer=this.volumeDataTemp=this.meshData=this.jvxlData=this.params=null;this.isValid=!0;this.bsVdw=this.fileType=null;this.colorPtr=0;this.ptRef=this.vNorm=this.vAB=this.readerData=this.out=this.surfaceReader=null;G(this,arguments)},J.jvxl.readers,"SurfaceGenerator");W(c$,function(){this.vAB=new JU.V3;this.vNorm=new JU.V3;this.ptRef=JU.P3.new3(0,0,1E15)});Q(c$,function(a,b,c,d){this.atomDataServer=a;this.meshDataServer= b;this.params=new J.jvxl.readers.Parameters;this.meshData=null==c?new J.jvxl.data.MeshData:c;this.jvxlData=null==d?new J.jvxl.data.JvxlData:d;this.volumeDataTemp=new J.jvxl.data.VolumeData;this.initializeIsosurface()},"J.atomdata.AtomDataServer,J.jvxl.api.MeshDataServer,J.jvxl.data.MeshData,J.jvxl.data.JvxlData");e(c$,"setJvxlData",function(a){this.jvxlData=a;null!=a&&(a.version=this.version)},"J.jvxl.data.JvxlData");e(c$,"isInsideOut",function(){return this.params.insideOut!=this.params.dataXYReversed}); e(c$,"isFullyLit",function(){return null!=this.params.thePlane||this.params.fullyLit});e(c$,"setProp",function(a,b){if("debug"===a){var c=b.booleanValue();this.params.logMessages=c;this.params.logCube=c;return!0}if("init"===a)return this.initializeIsosurface(),V(b,J.jvxl.readers.Parameters)?this.params=b:(this.params.script=b,null!=this.params.script&&0<=this.params.script.indexOf(";#")&&(this.params.script=JU.PT.rep(this.params.script,";#","; #"))),!1;if("map"===a)return this.params.resetForMapping(b.booleanValue()), null!=this.surfaceReader&&(this.surfaceReader.minMax=null),!0;if("finalize"===a)return this.initializeIsosurface(),!0;if("clear"===a)return null!=this.surfaceReader&&this.surfaceReader.discardTempData(!0),!1;if("fileIndex"===a)return this.params.fileIndex=b.intValue(),0>this.params.fileIndex&&(this.params.fileIndex=0),this.params.readAllData=!1,!0;if("blockData"===a)return this.params.blockCubeData=b.booleanValue(),!0;if("withinPoints"===a)return this.params.boundingBox=b[1],!0;if("boundingBox"=== a)return this.params.boundingBox=w(-1,[JU.P3.newP(b[0]),JU.P3.newP(b[b.length-1])]),!0;if("func"===a)return this.params.func=b,!0;if("intersection"===a)return this.params.intersection=b,!0;if("bsSolvent"===a)return this.params.bsSolvent=b,!0;if("select"===a)return this.params.bsSelected=b,!0;if("ignore"===a)return this.params.bsIgnore=b,!0;if("propertySmoothing"===a)return this.params.propertySmoothing=b.booleanValue(),!0;if("propertyDistanceMax"===a)return this.params.propertyDistanceMax=b.floatValue(), !0;if("propertySmoothingPower"===a)return this.params.propertySmoothingPower=b.intValue(),!0;if("title"===a){if(null==b)this.params.title=null;else if(JU.AU.isAS(b)){this.params.title=b;for(var d=0;d<this.params.title.length;d++)0<this.params.title[d].length&&JU.Logger.info(this.params.title[d])}return!0}if("sigma"===a)return this.params.cutoff=this.params.sigma=b.floatValue(),this.params.isPositiveOnly=!1,this.params.cutoffAutomatic=!1,!0;if("cutoff"===a)return this.params.cutoff=b.floatValue(), this.params.isPositiveOnly=!1,this.params.cutoffAutomatic=!1,!0;if("parameters"===a)return this.params.parameters=JU.AU.ensureLengthA(b,2),0<this.params.parameters.length&&0!=this.params.parameters[0]&&(this.params.cutoff=this.params.parameters[0]),!0;if("cutoffPositive"===a)return this.params.cutoff=b.floatValue(),this.params.isPositiveOnly=!0;if("cap"===a||"slab"===a)return null!=b&&this.params.addSlabInfo(b),!0;if("scale"===a)return this.params.scale=b.floatValue(),!0;if("scale3d"===a)return this.params.scale3d= b.floatValue(),!0;if("angstroms"===a)return this.params.isAngstroms=!0;if("resolution"===a)return c=b.floatValue(),this.params.resolution=0<c?c:3.4028235E38,!0;if("downsample"===a)return c=b.intValue(),this.params.downsampleFactor=0<=c?c:0,!0;if("anisotropy"===a)return 0==(this.params.dataType&32)&&this.params.setAnisotropy(b),!0;if("eccentricity"===a)return this.params.setEccentricity(b),!0;if("addHydrogens"===a)return this.params.addHydrogens=b.booleanValue(),!0;if("squareData"===a)return this.params.isSquared= null==b?!1:b.booleanValue(),!0;if("squareLinear"===a)return this.params.isSquaredLinear=null==b?!1:b.booleanValue(),!0;if("gridPoints"===a)return this.params.iAddGridPoints=!0;if("atomIndex"===a)return this.params.atomIndex=b.intValue(),!0;if("insideOut"===a)return this.params.insideOut=!0;if("sign"===a)return this.params.isCutoffAbsolute=!0,this.params.colorBySign=!0,this.colorPtr=0,!0;if("colorRGB"===a)return c=b.intValue(),this.params.colorRgb=this.params.colorPos=this.params.colorPosLCAO=c,0== this.colorPtr++?this.params.colorNeg=this.params.colorNegLCAO=c:this.params.colorRgb=2147483647,!0;if("monteCarloCount"===a)return this.params.psi_monteCarloCount=b.intValue(),!0;if("rangeAll"===a)return this.params.rangeAll=!0;if("rangeSelected"===a)return this.params.rangeSelected=!0;if("red"===a)return this.params.valueMappedToRed=b.floatValue(),!0;if("blue"===a)return this.params.valueMappedToBlue=b.floatValue(),this.params.valueMappedToRed>this.params.valueMappedToBlue&&(c=this.params.valueMappedToRed, this.params.valueMappedToRed=this.params.valueMappedToBlue,this.params.valueMappedToBlue=c,this.params.isColorReversed=!this.params.isColorReversed),this.params.rangeDefined=!0,this.params.rangeAll=!1,!0;if("reverseColor"===a)return this.params.isColorReversed=!0;if("setColorScheme"===a)return this.getSurfaceSets(),this.params.colorBySets=!0,this.mapSurface(),!0;if("center"===a)return this.params.center.setT(b),!0;if("origin"===a)return this.params.origin=b,!0;if("step"===a)return this.params.steps= b,!0;if("point"===a)return this.params.points=b,!0;if("withinDistance"===a)return this.params.distance=b.floatValue(),!0;if("withinPoint"===a)return this.params.point=b,!0;if("progressive"===a)return this.params.isXLowToHigh=!0;if("phase"===a)return this.params.isCutoffAbsolute=!0,this.params.colorBySign=!0,this.params.colorByPhase=!0,this.params.colorPhase=J.jvxl.readers.SurfaceReader.getColorPhaseIndex(b),0>this.params.colorPhase&&(JU.Logger.warn(" invalid color phase: "+b),this.params.colorPhase= 0),this.params.colorByPhase=0!=this.params.colorPhase,2<=this.params.state&&(this.params.dataType=this.params.surfaceType,this.params.state=3,this.params.isBicolorMap=!0,this.surfaceReader.applyColorScale()),!0;if("radius"===a)return JU.Logger.info("solvent probe radius set to "+b),this.params.atomRadiusData=b,!0;if("envelopeRadius"===a)return this.params.envelopeRadius=b.floatValue(),!0;if("cavityRadius"===a)return this.params.cavityRadius=b.floatValue(),!0;if("cavity"===a)return this.params.isCavity= !0;if("doFullMolecular"===a)return this.params.doFullMolecular=!0;if("pocket"===a)return this.params.pocket=b,this.params.fullyLit=this.params.pocket.booleanValue(),!0;if("minset"===a)return this.params.minSet=b.intValue(),!0;if("maxset"===a)return this.params.maxSet=b.intValue(),!0;if("plane"===a)return this.params.setPlane(b),!0;if("contour"===a){this.params.isContoured=!0;if(JU.AU.isAF(b))this.params.contoursDiscrete=b,this.params.nContours=this.params.contoursDiscrete.length;else if(V(b,JU.P3)){var c= this.params.contourIncrements=b,d=c.x,h=c.y,e=c.z;0>=e&&(e=1);for(var c=0,g=d;g<=h+e/10;g+=e,c++);this.params.contoursDiscrete=u(c,0);g=d;for(d=0;d<c;d++,g+=e)this.params.contoursDiscrete[d]=g;this.params.nContours=c}else c=b.intValue(),this.params.thisContour=0,0==c?this.params.nContours=9:0<c?this.params.nContours=c:this.params.thisContour=-c;return!0}if("colorDiscrete"===a)return this.params.contourColixes=b,!0;if("colorDensity"===a)return this.params.colorDensity=!0,null!=b&&(this.params.pointSize= b.floatValue()),!1;if("fullPlane"===a)return this.params.contourFromZero=!b.booleanValue(),!0;if("mapLattice"===a)return this.params.mapLattice=b,!0;if("extendGrid"===a)return this.params.extendGrid=b.floatValue(),!0;if("property"===a)return this.params.dataType=1206,this.params.theProperty=b,this.mapSurface(),!0;if("sphere"===a)return this.params.setSphere(b.floatValue(),!1),this.readerData=Float.$valueOf(this.params.distance),this.surfaceReader=this.newReader("IsoShapeReader"),this.generateSurface(), !0;if("geodesic"===a)return this.params.setSphere(b.floatValue(),!0),this.readerData=Float.$valueOf(this.params.distance),this.surfaceReader=this.newReader("IsoShapeReader"),this.generateSurface(),!0;if("ellipsoid"===a){if(V(b,JU.P4))this.params.setEllipsoidP4(b);else if(JU.AU.isAF(b))this.params.setEllipsoidAF(b);else return!0;this.readerData=Float.$valueOf(this.params.distance);this.surfaceReader=this.newReader("IsoShapeReader");this.generateSurface();return!0}if("ellipsoid3"===a)return this.params.setEllipsoidAF(b), this.readerData=Float.$valueOf(this.params.distance),this.surfaceReader=this.newReader("IsoShapeReader"),this.generateSurface(),!0;if("lp"===a)return this.params.setLp(b),this.readerData=u(-1,[3,2,0,15,0]),this.surfaceReader=this.newReader("IsoShapeReader"),this.generateSurface(),!0;if("rad"===a)return this.params.setRadical(b),this.readerData=u(-1,[3,2,0,15,0]),this.surfaceReader=this.newReader("IsoShapeReader"),this.generateSurface(),!0;if("lobe"===a)return this.params.setLobe(b),this.readerData= u(-1,[3,2,0,15,0]),this.surfaceReader=this.newReader("IsoShapeReader"),this.generateSurface(),!0;if("hydrogenOrbital"===a){if(!this.params.setAtomicOrbital(b))return this.isValid=!1,!0;this.readerData=u(-1,[this.params.psi_n,this.params.psi_l,this.params.psi_m,this.params.psi_Znuc,this.params.psi_monteCarloCount]);this.surfaceReader=this.newReader("IsoShapeReader");this.processState();return!0}if("functionXY"===a)return this.params.setFunctionXY(b),this.params.isContoured&&this.volumeDataTemp.setPlaneParameters(null== this.params.thePlane?this.params.thePlane=JU.P4.new4(0,0,1,0):this.params.thePlane),0<=this.params.functionInfo.get(0).indexOf("_xyz")&&this.getFunctionZfromXY(),this.processState(),!0;if("functionXYZ"===a)return this.params.setFunctionXYZ(b),this.processState(),!0;if("lcaoType"===a)return this.params.setLcao(b,this.colorPtr),!0;if("lcaoCartoonCenter"===a){if(2!=++this.params.state)return!0;Float.isNaN(this.params.center.x)&&this.params.center.setT(b);return!1}if("molecular"===a||"solvent"===a||"sasurface"=== a||"nomap"===a)return this.params.setSolvent(a,b.floatValue()),JU.Logger.info(this.params.calculationType),this.processState(),!0;if("moData"===a)return this.params.moData=b,!0;if("mepCalcType"===a)return this.params.mep_calcType=b.intValue(),!0;if("mep"===a)return this.params.setMep(b,!1),this.processState(),!0;if("mlp"===a)return this.params.setMep(b,!0),this.processState(),!0;if("nci"===a)return c=b.booleanValue(),this.params.setNci(c),c&&this.processState(),!0;if("calculationType"===a)return this.params.calculationType= b,!0;if("charges"===a)return this.params.theProperty=b,!0;if("randomSeed"===a)return this.params.randomSeed=b.intValue(),!0;if("molecularOrbital"===a)return c=0,d=null,V(b,Integer)?c=b.intValue():d=b,this.params.setMO(c,d),JU.Logger.info(this.params.calculationType),this.processState(),!0;if("fileType"===a)return this.fileType=b,!0;if("fileName"===a)return this.params.fileName=b,!0;if("outputChannel"===a)return this.out=b,!0;if("readFile"===a){if(null==(this.surfaceReader=this.setFileData(this.atomDataServer, b)))return JU.Logger.error("Could not set the surface data"),!0;this.surfaceReader.setOutputChannel(this.out);this.generateSurface();return!0}if("mapColor"===a){if(null==(this.surfaceReader=this.setFileData(this.atomDataServer,b)))return JU.Logger.error("Could not set the mapping data"),!0;this.surfaceReader.setOutputChannel(this.out);this.mapSurface();return!0}if("getSurfaceSets"===a)return this.getSurfaceSets(),!0;"periodic"===a&&(this.params.isPeriodic=!0);return!1},"~S,~O,JU.BS");e(c$,"newReader", function(a){a=J.jvxl.readers.SurfaceGenerator.getInterface(a);null!=a&&a.init(this);return a},"~S");e(c$,"newReaderBr",function(a,b){var c=J.jvxl.readers.SurfaceGenerator.getInterface(a);null!=c&&c.init2(this,b);return c},"~S,java.io.BufferedReader");c$.getInterface=e(c$,"getInterface",function(a){try{var b=Wa._4Name("J.jvxl.readers."+a);return null==b?null:b.newInstance()}catch(c){if(U(c,Exception))return JU.Logger.error("Interface.java Error creating instance for "+a+": \n"+c.toString()),null;throw c; }},"~S");e(c$,"getSurfaceSets",function(){null==this.meshDataServer?this.meshData.getSurfaceSet():(this.meshDataServer.fillMeshData(this.meshData,1,null),this.meshData.getSurfaceSet(),this.meshDataServer.fillMeshData(this.meshData,3,null))});e(c$,"processState",function(){1==this.params.state&&null!=this.params.thePlane&&this.params.state++;2<=this.params.state?this.mapSurface():this.generateSurface()});e(c$,"setReader",function(){this.readerData=null;if(null!=this.surfaceReader)return!this.surfaceReader.vertexDataOnly; switch(this.params.dataType){case 1205:this.surfaceReader=this.newReader("IsoPlaneReader");break;case 1206:this.surfaceReader=this.newReader("AtomPropertyMapper");break;case 1328:case 1329:this.readerData=1328==this.params.dataType?"Mep":"Mlp";this.surfaceReader=3==this.params.state?this.newReader("AtomPropertyMapper"):this.newReader("Iso"+this.readerData+"Reader");break;case 1333:this.surfaceReader=this.newReader("IsoIntersectReader");break;case 1195:case 1203:case 1196:this.surfaceReader=this.newReader("IsoSolventReader"); break;case 1844:case 1837:this.surfaceReader=this.newReader("IsoMOReader");break;case 8:this.surfaceReader=this.newReader("IsoFxyReader");break;case 9:this.surfaceReader=this.newReader("IsoFxyzReader")}JU.Logger.info("Using surface reader "+this.surfaceReader);return!0});e(c$,"generateSurface",function(){if(2==++this.params.state){this.setReader();var a=null!=this.meshDataServer;this.params.colorBySign&&(this.params.isBicolorMap=!0);if(null==this.surfaceReader)JU.Logger.error("surfaceReader is null for "+ this.params.dataType);else if(this.surfaceReader.createIsosurface(!1)){null!=this.params.pocket&&a&&this.surfaceReader.selectPocket(!this.params.pocket.booleanValue());0<this.params.minSet&&this.surfaceReader.excludeMinimumSet();0<this.params.maxSet&&this.surfaceReader.excludeMaximumSet();null!=this.params.slabInfo&&this.surfaceReader.slabIsosurface(this.params.slabInfo);a&&this.meshDataServer.notifySurfaceGenerationCompleted()&&(this.surfaceReader.hasColorData=!1);0<=this.jvxlData.thisSet&&this.getSurfaceSets(); this.jvxlData.jvxlDataIs2dContour&&(this.surfaceReader.colorIsosurface(),this.params.state=3);this.jvxlData.jvxlDataIsColorDensity&&(this.params.state=3);if(this.params.colorBySign||this.params.isBicolorMap)this.params.state=3,this.surfaceReader.applyColorScale();null!=this.jvxlData.vertexColorMap&&(this.jvxlData.vertexColorMap=null,this.surfaceReader.hasColorData=!1);this.surfaceReader.jvxlUpdateInfo();this.marchingSquares=this.surfaceReader.marchingSquares;this.surfaceReader.discardTempData(!1); this.params.mappedDataMin=3.4028235E38;this.surfaceReader.closeReader();if(3!=this.params.state&&(this.surfaceReader.hasColorData||this.params.colorDensity))this.params.state=3,this.colorIsosurface();this.surfaceReader=null}else JU.Logger.error("Could not create isosurface"),this.params.cutoff=NaN,this.surfaceReader.closeReader()}});e(c$,"mapSurface",function(){1==this.params.state&&null!=this.params.thePlane&&this.params.state++;if(!(3>++this.params.state)&&this.setReader()){this.params.isPeriodic&& (this.surfaceReader.volumeData.isPeriodic=!0);if(null!=this.params.thePlane){var a=this.params.isSquared;this.params.isSquared=!1;this.params.cutoff=0;this.surfaceReader.volumeData.setMappingPlane(this.params.thePlane);this.surfaceReader.createIsosurface(!this.params.isPeriodic);this.surfaceReader.volumeData.setMappingPlane(null);null!=this.meshDataServer&&this.meshDataServer.notifySurfaceGenerationCompleted();if(1205==this.params.dataType){this.surfaceReader.discardTempData(!0);return}this.params.isSquared= a;this.params.mappedDataMin=3.4028235E38;this.surfaceReader.readVolumeData(!0);null!=this.params.mapLattice&&(this.surfaceReader.volumeData.isPeriodic=!0)}else!this.params.colorBySets&&!this.params.colorDensity&&(this.surfaceReader.readAndSetVolumeParameters(!0),this.params.mappedDataMin=3.4028235E38,this.surfaceReader.readVolumeData(!0));this.colorIsosurface();this.surfaceReader.closeReader();this.surfaceReader=null}});e(c$,"colorIsosurface",function(){this.surfaceReader.colorIsosurface();this.surfaceReader.jvxlUpdateInfo(); this.surfaceReader.updateTriangles();this.surfaceReader.discardTempData(!0);null!=this.meshDataServer&&this.meshDataServer.notifySurfaceMappingCompleted()});e(c$,"getProperty",function(a,b){return"jvxlFileData"===a?J.jvxl.data.JvxlCoder.jvxlGetFile(this.jvxlData,null,this.params.title,"",!0,b,null,null):"jvxlFileInfo"===a?J.jvxl.data.JvxlCoder.jvxlGetInfo(this.jvxlData):null},"~S,~N");e(c$,"setFileData",function(a,b){var c=this.fileType;this.fileType=null;if(V(b,java.util.Map)){var d=b;if(d.containsKey("__pymolSurfaceData__"))return this.readerData= d,this.newReaderBr("PyMOLMeshReader",null);b=d.get("volumeData")}if(V(b,J.jvxl.data.VolumeData))return this.volumeDataTemp=b,this.newReader("VolumeDataReader");d=null;V(b,String)&&(d=b,b=JU.Rdr.getBR(b));var h=b;null==c&&(c=JV.FileManager.determineSurfaceFileType(h));if(null!=c&&c.startsWith("UPPSALA")){var e=this.params.fileName,e=e.substring(0,e.indexOf("/",10)),e=e+JU.PT.getQuotedStringAt(c,c.indexOf("A HREF")+1);this.params.fileName=e;b=this.atomDataServer.getBufferedInputStream(e);if(null==b)return JU.Logger.error("Isosurface: could not open file "+ e),null;try{h=JU.Rdr.getBufferedReader(b,null)}catch(g){if(!U(g,Exception))throw g;}c=JV.FileManager.determineSurfaceFileType(h)}null==c&&(c="UNKNOWN");JU.Logger.info("data file type was determined to be "+c);if(c.equals("Jvxl+"))return this.newReaderBr("JvxlReader",h);this.readerData=w(-1,[this.params.fileName,d]);if(0<="MRC DELPHI DSN6".indexOf(c.toUpperCase())){try{h.close()}catch(f){if(!U(f,java.io.IOException))throw f;}h=null;c+="Binary"}return this.newReaderBr(c+"Reader",h)},"JV.Viewer,~O"); e(c$,"getReaderData",function(){var a=this.readerData;this.readerData=null;return a});e(c$,"initializeIsosurface",function(){this.params.initialize();this.colorPtr=0;this.marchingSquares=this.surfaceReader=null;this.initState()});e(c$,"initState",function(){this.params.state=1;this.params.dataType=this.params.surfaceType=0});e(c$,"setLcao",function(){this.params.colorPos=this.params.colorPosLCAO;this.params.colorNeg=this.params.colorNegLCAO;return this.params.lcaoType});e(c$,"getFunctionZfromXY", function(){for(var a=this.params.functionInfo.get(1),b=p(3,0),c=p(3,0),d=Array(3),h=0;3>h;h++){var e=this.params.functionInfo.get(h+2);b[h]=Math.abs(y(e.x));d[h]=JU.V3.new3(e.y,e.z,e.w)}for(var e=b[0],b=b[1],g=new JU.P3,f=new JU.P3,j=new JU.P3,k=new JU.P3,n=this.params.functionInfo.get(5),q=u(e,b,0),t,h=0;h<e;h++)for(var r=0;r<b;r++){g.scaleAdd2(h,d[0],a);g.scaleAdd2(r,d[1],g);var L=J.jvxl.readers.SurfaceGenerator.findNearestThreePoints(g.x,g.y,n,c);f.set((t=n[c[0]])[0],t[1],t[2]);1E-5>L?g.z=t[2]: (j.set((t=n[c[1]])[0],t[1],t[2]),k.set((t=n[c[2]])[0],t[1],t[2]),g.z=this.distanceVerticalToPlane(g.x,g.y,f,j,k));q[h][r]=g.z}this.params.functionInfo.set(5,q)});e(c$,"distanceVerticalToPlane",function(a,b,c,d,h){c=JU.Measure.getDirectedNormalThroughPoints(c,d,h,this.ptRef,this.vNorm,this.vAB);return(this.vNorm.x*a+this.vNorm.y*b+c)/-this.vNorm.z},"~N,~N,JU.P3,JU.P3,JU.P3");c$.findNearestThreePoints=e(c$,"findNearestThreePoints",function(a,b,c,d){var h,e,g,f,j,k,n;j=k=n=-1;e=g=f=3.4028235E38;for(var q= c.length;0<=--q;)h=(h=c[q][0]-a)*h+(h=c[q][1]-b)*h,h<e?(f=g,g=e,e=h,n=k,k=j,j=q):h<g?(f=g,g=h,n=k,k=q):h<f&&(f=h,n=q);d[0]=j;d[1]=k;d[2]=n;return e},"~N,~N,~A,~A");e(c$,"addRequiredFile",function(a){null!=this.meshDataServer&&this.meshDataServer.addRequiredFile(a)},"~S");e(c$,"log",function(a){null==this.atomDataServer?System.out.println(a):this.atomDataServer.log(a)},"~S");e(c$,"setOutputChannel",function(a,b){null!=this.meshDataServer&&this.meshDataServer.setOutputChannel(a,b)},"javajs.api.GenericBinaryDocument,JU.OC"); e(c$,"fillAtomData",function(a,b){0!=(b&2)&&null!=a.bsSelected&&(null==this.bsVdw&&(this.bsVdw=new JU.BS),this.bsVdw.or(a.bsSelected));this.atomDataServer.fillAtomData(a,b)},"J.atomdata.AtomData,~N");e(c$,"getSpanningVectors",function(){return null==this.surfaceReader.volumeData?null:this.surfaceReader.volumeData.spanningVectors})});H("J.jvxl.readers");K(null,"J.jvxl.readers.Parameters","java.lang.Float java.util.Hashtable JU.A4 $.Lst $.M3 $.P3 $.P4 $.V3 JU.Escape $.Logger".split(" "),function(){c$= C(function(){this.testFlags=this.state=0;this.isSilent=this.logCube=this.logCompression=this.logMessages=!1;this.assocCutoff=0.3;this.surfaceType=this.dataType=0;this.calculationType="";this.atomRadiusData=null;this.addHydrogens=!1;this.solventExtendedAtomRadius=this.solventRadius=0;this.propertySmoothing=!1;this.propertySmoothingPower=4;this.cavityRadius=this.envelopeRadius=0;this.isCavity=!1;this.pocket=null;this.minSet=0;this.slabInfo=null;this.slabPlaneOffset=NaN;this.theProperty=null;this.solvent_ptsPerAngstrom= 4;this.solvent_gridMax=60;this.plane_ptsPerAngstrom=4;this.plane_gridMax=81;this.colorBySets=this.colorByPhase=this.colorBySign=!1;this.colorPhase=this.colorNegLCAO=this.colorPosLCAO=this.colorPos=this.colorNeg=this.colorRgb=0;this.iAddGridPoints=this.colorDensity=!1;this.atomIndex=0;this.isAngstroms=!1;this.scale3d=this.scale=0;this.anisotropy=null;this.isAnisotropic=!1;this.eccentricityMatrixInverse=this.eccentricityMatrix=null;this.isEccentric=!1;this.eccentricityRatio=this.eccentricityScale=0; this.functionInfo=this.lcaoType=this.anisoB=this.aniosU=null;this.psi_n=2;this.psi_Znuc=this.psi_m=this.psi_l=1;this.psi_ptsPerAngstrom=5;this.psi_monteCarloCount=0;this.mep_gridMax=40;this.mep_ptsPerAngstrom=3;this.mep_marginAngstroms=1;this.mep_calcType=-1;this.qmOrbitalCount=this.qmOrbitalType=0;this.moData=null;this.qm_gridMax=80;this.qm_ptsPerAngstrom=10;this.qm_marginAngstroms=1;this.qm_nAtoms=0;this.qm_moNumber=2147483647;this.point=this.center=this.qm_moLinearCombination=null;this.distance= 0;this.allowVolumeRender=!1;this.title=this.func=this.bsSolvent=this.bsIgnore=this.bsSelected=this.script=null;this.readAllData=this.blockCubeData=!1;this.fileIndex=-1;this.fileName=null;this.modelIndex=-1;this.dataXYReversed=this.insideOut=this.isXLowToHigh=!1;this.sigma=this.cutoff=3.4028235E38;this.cutoffAutomatic=!0;this.rangeDefined=this.rangeSelected=this.rangeAll=this.isPositiveOnly=this.isCutoffAbsolute=!1;this.mappedDataMax=this.mappedDataMin=this.valueMappedToBlue=this.valueMappedToRed= 0;this.isSquaredLinear=this.isSquared=this.isBicolorMap=this.isColorReversed=!1;this.thePlane=null;this.isContoured=!1;this.thisContour=this.nContours=0;this.contourFromZero=!1;this.parameters=null;this.maxSet=this.downsampleFactor=this.resolution=0;this.bsExcluded=this.boundingBox=this.contourIncrements=this.contourColixes=this.contoursDiscrete=null;this.contourType=0;this.colorSchemeTranslucent=!1;this.colorEncoder=null;this.usePropertyForColorRange=!0;this.doFullMolecular=this.isPeriodic=!1;this.propertyDistanceMax= 2147483647;this.randomSeed=0;this.fullyLit=!1;this.mapLattice=this.contactPair=this.volumeData=this.points=this.steps=this.origin=this.intersection=this.vertexSource=null;this.extendGrid=0;this.showTiming=this.isMapped=!1;this.pointSize=0;G(this,arguments)},J.jvxl.readers,"Parameters");W(c$,function(){this.anisotropy=u(3,0)});e(c$,"initialize",function(){this.addHydrogens=!1;this.allowVolumeRender=!0;this.atomRadiusData=null;this.atomIndex=-1;this.blockCubeData=!1;this.boundingBox=null;this.bsExcluded= Array(4);this.bsSolvent=this.bsSelected=this.bsIgnore=null;this.calculationType="";this.center=new JU.P3;this.resetForMapping(!0);this.colorBySign=this.colorByPhase=this.colorBySets=!1;this.colorEncoder=null;this.colorNeg=-65536;this.colorNegLCAO=-8388480;this.colorPos=-16776961;this.colorPosLCAO=-23296;this.colorRgb=-2147483648;this.colorSchemeTranslucent=!1;this.contourColixes=this.contoursDiscrete=this.contourIncrements=this.contactPair=null;this.contourFromZero=!0;this.cutoff=3.4028235E38;this.cutoffAutomatic= !0;this.dataXYReversed=!1;this.distance=3.4028235E38;this.doFullMolecular=!1;this.envelopeRadius=10;this.extendGrid=0;this.fileIndex=1;this.readAllData=!0;this.fileName="";this.fullyLit=!1;this.functionInfo=null;this.logCube=this.logCompression=this.isSilent=this.isPeriodic=this.isMapped=this.isEccentric=this.isContoured=this.isSquaredLinear=this.isSquared=this.isColorReversed=this.isCavity=this.isBicolorMap=this.isCutoffAbsolute=this.isPositiveOnly=this.isAngstroms=this.insideOut=this.iAddGridPoints= !1;this.logMessages=JU.Logger.debugging;this.mapLattice=null;this.mep_calcType=-1;this.minSet=0;this.modelIndex=-1;this.nContours=0;this.pocket=null;this.pointSize=NaN;this.propertyDistanceMax=2147483647;this.propertySmoothing=!1;this.propertySmoothingPower=4;this.rangeSelected=this.rangeAll=this.rangeDefined=!1;this.resolution=3.4028235E38;this.scale=NaN;this.scale3d=0;this.sigma=NaN;this.slabInfo=null;this.solventExtendedAtomRadius=0;this.state=1;this.testFlags=0;this.theProperty=this.thePlane= null;this.thisContour=-1;this.title=null;this.usePropertyForColorRange=!0;this.vertexSource=null});e(c$,"resetForMapping",function(a){a||(this.state=2);this.center.x=NaN;this.colorDensity=!1;this.intersection=this.func=null;this.isAnisotropic=!1;this.isMapped=!0;this.mappedDataMin=3.4028235E38;this.points=this.parameters=this.origin=null;this.qmOrbitalType=0;this.volumeData=this.steps=null},"~B");e(c$,"setAnisotropy",function(a){this.anisotropy[0]=a.x;this.anisotropy[1]=a.y;this.anisotropy[2]=a.z; this.isAnisotropic=!0;Float.isNaN(this.center.x)&&this.center.set(0,0,0)},"JU.P3");e(c$,"setEccentricity",function(a){var b=JU.V3.new3(a.x,a.y,a.z),c=0<this.scale?this.scale:0>a.w?1:b.length();a=Math.abs(a.w);b.normalize();var d=JU.V3.new3(0,0,1);b.add(d);b.normalize();Float.isNaN(b.x)&&b.set(1,0,0);this.eccentricityMatrixInverse=new JU.M3;this.eccentricityMatrixInverse.invertM(this.eccentricityMatrix=(new JU.M3).setAA(JU.A4.newVA(b,3.141592653589793)));this.isEccentric=this.isAnisotropic=!0;this.eccentricityScale= c;this.eccentricityRatio=a;1<a&&(this.eccentricityScale*=a);this.anisotropy[0]=a*c;this.anisotropy[1]=a*c;this.anisotropy[2]=c;Float.isNaN(this.center.x)&&this.center.set(0,0,0)},"JU.P4");e(c$,"setPlane",function(a){this.thePlane=a;0==this.thePlane.x&&(0==this.thePlane.y&&0==this.thePlane.z)&&(this.thePlane.z=1);this.isContoured=!0},"JU.P4");e(c$,"setSphere",function(a,b){this.dataType=b?74:65;this.distance=a;this.setEccentricity(JU.P4.new4(0,0,1,1));this.cutoff=1.4E-45;this.isCutoffAbsolute=!1;this.isSilent= !this.logMessages;this.script=this.getScriptParams()+" SPHERE "+a+";"},"~N,~B");e(c$,"setEllipsoidP4",function(a){this.dataType=66;this.distance=1;this.setEccentricity(a);this.cutoff=1.4E-45;this.isCutoffAbsolute=!1;this.isSilent=!this.logMessages},"JU.P4");e(c$,"setEllipsoidAF",function(a){this.anisoB=a;this.dataType=67;this.distance=0.3*(Float.isNaN(this.scale)?1:this.scale);this.cutoff=1.4E-45;this.isCutoffAbsolute=!1;this.isSilent=!this.logMessages;Float.isNaN(this.center.x)&&this.center.set(0, 0,0);3.4028235E38==this.resolution&&(this.resolution=6)},"~A");e(c$,"setLobe",function(a){this.dataType=68;this.setEccentricity(a);3.4028235E38==this.cutoff&&(this.cutoff=0.14,this.isSquared&&(this.cutoff*=this.cutoff));this.isSilent=!this.logMessages;this.script=this.getScriptParams()+" LOBE {"+a.x+" "+a.y+" "+a.z+" "+a.w+"};"},"JU.P4");e(c$,"getScriptParams",function(){return" center "+JU.Escape.eP(this.center)+(Float.isNaN(this.scale)?"":" scale "+this.scale)});e(c$,"setLp",function(a){this.dataType= 70;this.setEccentricity(a);3.4028235E38==this.cutoff&&(this.cutoff=0.14,this.isSquared&&(this.cutoff*=this.cutoff));this.isSilent=!this.logMessages;this.script=" center "+JU.Escape.eP(this.center)+(Float.isNaN(this.scale)?"":" scale "+this.scale)+" LP {"+a.x+" "+a.y+" "+a.z+" "+a.w+"};"},"JU.P4");e(c$,"setRadical",function(a){this.dataType=71;this.setEccentricity(a);3.4028235E38==this.cutoff&&(this.cutoff=0.14,this.isSquared&&(this.cutoff*=this.cutoff));this.isSilent=!this.logMessages;this.script= " center "+JU.Escape.eP(this.center)+(Float.isNaN(this.scale)?"":" scale "+this.scale)+" RAD {"+a.x+" "+a.y+" "+a.z+" "+a.w+"};"},"JU.P4");e(c$,"setLcao",function(a,b){this.lcaoType=a;1==b&&(this.colorPosLCAO=this.colorNegLCAO);this.isSilent=!this.logMessages},"~S,~N");e(c$,"setSolvent",function(a,b){this.isEccentric=this.isAnisotropic=!1;this.solventRadius=Math.abs(b);this.dataType=null!=this.intersection?1333:"nomap"===a?1205:"molecular"===a?1203:"sasurface"===a||0==this.solventRadius?1196:1195; if(2>this.state&&(this.cutoffAutomatic||!this.colorDensity)&&(null==this.intersection||3.4028235E38==this.cutoff))this.cutoff=0;switch(this.dataType){case 1333:this.calculationType="VDW intersection";break;case 1205:this.calculationType="unmapped plane";break;case 1203:this.calculationType="molecular surface with radius "+this.solventRadius;break;case 1195:this.calculationType="solvent-excluded surface with radius "+this.solventRadius;break;case 1196:this.calculationType="solvent-accessible surface with radius "+ this.solventRadius}switch(this.dataType){case 1205:this.solventExtendedAtomRadius=this.solventRadius;this.solventRadius=0;this.isContoured=!1;break;case 1203:this.solventExtendedAtomRadius=0;break;case 1195:this.solventExtendedAtomRadius=0;null==this.bsIgnore?this.bsIgnore=this.bsSolvent:null!=this.bsSolvent&&this.bsIgnore.or(this.bsSolvent);break;case 1196:this.solventExtendedAtomRadius=this.solventRadius,this.solventRadius=0,null==this.bsIgnore?this.bsIgnore=this.bsSolvent:null!=this.bsSolvent&& this.bsIgnore.or(this.bsSolvent)}},"~S,~N");e(c$,"setFunctionXY",function(a){this.dataType=8;this.functionInfo=a;this.cutoff=1.4E-45;this.isEccentric=this.isAnisotropic=!1},"JU.Lst");e(c$,"setFunctionXYZ",function(a){this.dataType=9;this.functionInfo=a;3.4028235E38==this.cutoff&&(this.cutoff=1.4E-45);this.isEccentric=this.isAnisotropic=!1},"JU.Lst");e(c$,"setAtomicOrbital",function(a){this.dataType=1294;this.setEccentricity(JU.P4.new4(0,0,1,1));this.psi_n=y(a[0]);this.psi_l=y(a[1]);this.psi_m=y(a[2]); this.psi_Znuc=a[3];this.psi_monteCarloCount=y(a[4]);this.distance=a[5];if(0!=this.distance||null!=this.thePlane)this.allowVolumeRender=!1;this.randomSeed=y(a[6]);this.psi_ptsPerAngstrom=10;if(3.4028235E38==this.cutoff||0.14==this.cutoff)this.cutoff=0<this.psi_monteCarloCount?0:0.04,this.isSquared&&(this.cutoff*=this.cutoff);this.isCutoffAbsolute=!0;2>this.state&&(null==this.thePlane&&this.colorBySign)&&(this.isBicolorMap=!0);return 0<this.psi_Znuc&&Math.abs(this.psi_m)<=this.psi_l&&this.psi_l<this.psi_n}, "~A");e(c$,"setMep",function(a,b){this.dataType=b?1329:1328;this.theProperty=a;this.isEccentric=this.isAnisotropic=this.usePropertyForColorRange=!1;3.4028235E38==this.cutoff&&(this.cutoff=0.1,this.isSquared&&(this.cutoff*=this.cutoff));this.isCutoffAbsolute=0<this.cutoff&&!this.isPositiveOnly;this.contourFromZero=!1;2<=this.state||null!=this.thePlane?!this.rangeDefined&&!this.rangeAll&&(this.valueMappedToRed=-0.1,this.valueMappedToBlue=0.1,this.rangeDefined=!0):this.isBicolorMap=this.colorBySign= !0},"~A,~B");e(c$,"setNci",function(a){this.fullyLit=!0;this.qm_gridMax=200;a&&(this.dataType=1844);this.qm_marginAngstroms=2;this.qmOrbitalType=a?3:4;if(a&&(null==this.parameters||2>this.parameters.length))this.parameters=u(-1,[this.cutoff,2]);if(3.4028235E38==this.cutoff||0==this.cutoff)this.cutoff=0.3;this.isSquared&&(this.cutoff*=this.cutoff);null==this.title&&(this.title=[]);this.moData=new java.util.Hashtable},"~B");e(c$,"setMO",function(a,b){this.qm_moLinearCombination=b;this.qm_moNumber=null== b?Math.abs(a):y(b[1]);this.qmOrbitalType=this.moData.containsKey("haveVolumeData")?5:this.moData.containsKey("gaussians")?1:this.moData.containsKey("slaters")?2:0;var c=0>=a&&null==b;0==this.qmOrbitalType?(JU.Logger.error("MO ERROR: No basis functions found in file for MO calculation. (GAUSSIAN 'gfprint' keyword may be missing?)"),this.title=w(-1,["no basis functions found in file"])):(this.qmOrbitalCount=this.moData.get("mos").size(),this.calculationType=this.moData.get("calculationType"),this.calculationType= "Molecular orbital #"+this.qm_moNumber+"/"+this.qmOrbitalCount+" "+(null==this.calculationType?"":this.calculationType),!c&&null==this.title&&(this.title=Array(5),this.title[0]="%F",this.title[1]="Model %M MO %I/%N %T",this.title[2]="?Energy = %E %U",this.title[3]="?Symmetry = %S",this.title[4]="?Occupancy = %O"));this.dataType=1837;3.4028235E38==this.cutoff&&(this.cutoff=c?0.01:0.05);if(this.isSquared||this.isSquaredLinear)this.cutoff*=this.cutoff;this.isEccentric=this.isAnisotropic=!1;this.isCutoffAbsolute= 0<this.cutoff&&!this.isPositiveOnly;2<=this.state||null!=this.thePlane||(this.colorBySign=!0,this.colorByPhase&&0==this.colorPhase&&(this.colorByPhase=!1),this.isBicolorMap=!0)},"~N,~A");e(c$,"setMapRanges",function(a,b){if(!this.colorDensity&&(this.colorByPhase||this.colorBySign||(null!=this.thePlane||this.isBicolorMap)&&!this.isContoured))this.mappedDataMin=-1,this.mappedDataMax=1;if(3.4028235E38==this.mappedDataMin||this.mappedDataMin==this.mappedDataMax){var c=a.getMinMaxMappedValues(b);this.mappedDataMin= c[0];this.mappedDataMax=c[1]}0==this.mappedDataMin&&0==this.mappedDataMax&&(this.mappedDataMin=-1,this.mappedDataMax=1);this.rangeDefined||(this.valueMappedToRed=this.mappedDataMin,this.valueMappedToBlue=this.mappedDataMax)},"J.jvxl.readers.SurfaceReader,~B");e(c$,"addSlabInfo",function(a){null==this.slabInfo&&(this.slabInfo=new JU.Lst);this.slabInfo.addLast(a)},"~A");R(c$,"STATE_UNINITIALIZED",0,"STATE_INITIALIZED",1,"STATE_DATA_READ",2,"STATE_DATA_COLORED",3,"NO_ANISOTROPY",32,"IS_SILENT",64,"IS_SOLVENTTYPE", 128,"HAS_MAXGRID",256,"IS_POINTMAPPABLE",512,"IS_SLABBABLE",1024,"SURFACE_NONE",0,"SURFACE_SPHERE",65,"SURFACE_ELLIPSOID2",66,"SURFACE_ELLIPSOID3",67,"SURFACE_LOBE",68,"SURFACE_LCAOCARTOON",69,"SURFACE_LONEPAIR",70,"SURFACE_RADICAL",71,"SURFACE_FUNCTIONXY",8,"SURFACE_FUNCTIONXYZ",9,"SURFACE_GEODESIC",74,"SURFACE_SOLVENT",1195,"SURFACE_SASURFACE",1196,"SURFACE_MOLECULARORBITAL",1837,"SURFACE_ATOMICORBITAL",1294,"SURFACE_MEP",1328,"SURFACE_MLP",1329,"SURFACE_MOLECULAR",1203,"SURFACE_NCI",1844,"SURFACE_INTERSECT", 1333,"SURFACE_NOMAP",1205,"SURFACE_PROPERTY",1206,"ANGSTROMS_PER_BOHR",0.5291772,"defaultEdgeFractionBase",35,"defaultEdgeFractionRange",90,"defaultColorFractionBase",35,"defaultColorFractionRange",90,"defaultMappedDataMin",0,"defaultMappedDataMax",1,"defaultCutoff",0.02,"defaultOrbitalCutoff",0.04,"defaultLobeCutoff",0.14,"defaultOrbitalCutoffOld",0.14,"defaultQMOrbitalCutoff",0.05,"defaultQMElectronDensityCutoff",0.01,"defaultContourCount",11,"nContourMax",100,"defaultColorNegative",4294901760, "defaultColorPositive",4278190335,"defaultColorNegativeLCAO",4286578816,"defaultColorPositiveLCAO",4294944E3,"defaultSolventRadius",1.2,"defaultMepCutoff",0.1,"defaultMepMin",-0.1,"defaultMepMax",0.1,"MEP_MAX_GRID",40,"QM_TYPE_UNKNOWN",0,"QM_TYPE_GAUSSIAN",1,"QM_TYPE_SLATER",2,"QM_TYPE_NCI_PRO",3,"QM_TYPE_NCI_SCF",4,"QM_TYPE_VOLUME_DATA",5,"MO_MAX_GRID",80)});H("J.jvxl.readers");K(["J.jvxl.api.VertexDataServer","JU.P3"],"J.jvxl.readers.SurfaceReader","java.lang.Float JU.AU $.BS J.jvxl.calc.MarchingCubes $.MarchingSquares J.jvxl.data.JvxlCoder $.MeshData JU.BoxInfo $.C $.ColorEncoder $.Escape $.Logger".split(" "), function(){c$=C(function(){this.edgeData=this.volumeData=this.jvxlData=this.meshData=this.params=this.meshDataServer=this.sg=null;this.isXLowToHigh=this.isProgressive=this.allowSigma=this.haveSurfaceAtoms=!1;this.assocCutoff=0.3;this.hasColorData=this.vertexDataOnly=this.isPeriodic=this.isQuiet=!1;this.dataMin=3.4028235E38;this.dataMax=-3.4028235E38;this.dataMean=0;this.anisotropy=this.center=this.xyzMax=this.xyzMin=null;this.isAnisotropic=!1;this.eccentricityMatrixInverse=this.eccentricityMatrix= null;this.isEccentric=!1;this.edgeCount=this.eccentricityRatio=this.eccentricityScale=0;this.voxelData=this.voxelCounts=this.volumetricVectors=this.volumetricOrigin=null;this.nPointsZ=this.nPointsY=this.nPointsX=this.nDataPoints=this.nBytes=0;this.isJvxl=!1;this.colorFractionRange=this.colorFractionBase=this.edgeFractionRange=this.edgeFractionBase=0;this.fractionData=this.jvxlFileHeaderBuffer=null;this.jvxlColorDataRead=this.jvxlEdgeDataRead="";this.jvxlVoxelBitSet=null;this.jvxlDataIsColorDensity= this.jvxlDataIs2dContour=this.jvxlDataIsPrecisionColor=this.jvxlDataIsColorMapped=!1;this.jvxlNSurfaceInts=this.jvxlCutoff=0;this.cJvxlEdgeNaN="\x00";this.contourVertexCount=0;this.yzPlanes=this.marchingCubes=this.marchingSquares=null;this.yzCount=0;this.minMax=this.ptTemp=this.qpc=null;this.haveSetAnisotropy=!1;G(this,arguments)},J.jvxl.readers,"SurfaceReader",null,J.jvxl.api.VertexDataServer);W(c$,function(){this.ptTemp=new JU.P3});Q(c$,function(){});e(c$,"initSR",function(a){this.sg=a;this.params= a.params;this.assocCutoff=this.params.assocCutoff;this.isXLowToHigh=this.params.isXLowToHigh;this.center=this.params.center;this.anisotropy=this.params.anisotropy;this.isAnisotropic=this.params.isAnisotropic;this.eccentricityMatrix=this.params.eccentricityMatrix;this.eccentricityMatrixInverse=this.params.eccentricityMatrixInverse;this.isEccentric=this.params.isEccentric;this.eccentricityScale=this.params.eccentricityScale;this.eccentricityRatio=this.params.eccentricityRatio;this.marchingSquares=a.marchingSquares; this.meshData=a.meshData;this.jvxlData=a.jvxlData;this.setVolumeDataV(a.volumeDataTemp);this.meshDataServer=a.meshDataServer;this.cJvxlEdgeNaN=String.fromCharCode(125)},"J.jvxl.readers.SurfaceGenerator");e(c$,"setOutputChannel",function(){},"JU.OC");e(c$,"newVoxelDataCube",function(){this.volumeData.setVoxelDataAsArray(this.voxelData=u(this.nPointsX,this.nPointsY,this.nPointsZ,0))});e(c$,"setVolumeDataV",function(a){this.nBytes=0;this.volumetricOrigin=a.volumetricOrigin;this.volumetricVectors=a.volumetricVectors; this.voxelCounts=a.voxelCounts;this.voxelData=a.getVoxelData();this.volumeData=a},"J.jvxl.data.VolumeData");e(c$,"jvxlUpdateInfo",function(){this.jvxlData.jvxlUpdateInfo(this.params.title,this.nBytes)});e(c$,"readAndSetVolumeParameters",function(a){return!this.readVolumeParameters(a)?!1:this.vertexDataOnly?!0:this.volumeData.setUnitVectors()},"~B");e(c$,"createIsosurface",function(a){this.resetIsosurface();this.params.showTiming&&JU.Logger.startTimer("isosurface creation");this.jvxlData.cutoff=NaN; if(!this.readAndSetVolumeParameters(a))return!1;!a&&(!Float.isNaN(this.params.sigma)&&!this.allowSigma)&&(0<this.params.sigma&&JU.Logger.error("Reader does not support SIGMA option -- using cutoff 1.6"),this.params.cutoff=1.6);0>this.params.sigma&&(this.params.sigma=-this.params.sigma);this.nPointsX=this.voxelCounts[0];this.nPointsY=this.voxelCounts[1];this.nPointsZ=this.voxelCounts[2];this.jvxlData.isSlabbable=0!=(this.params.dataType&1024);this.jvxlData.insideOut=this.params.insideOut;this.jvxlData.dataXYReversed= this.params.dataXYReversed;this.jvxlData.isBicolorMap=this.params.isBicolorMap;this.jvxlData.nPointsX=this.nPointsX;this.jvxlData.nPointsY=this.nPointsY;this.jvxlData.nPointsZ=this.nPointsZ;this.jvxlData.jvxlVolumeDataXml=this.volumeData.xmlData;this.jvxlData.voxelVolume=this.volumeData.voxelVolume;if(a)this.volumeData.setMappingPlane(this.params.thePlane),null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,1,null),this.params.setMapRanges(this,!1),this.generateSurfaceData(), this.volumeData.setMappingPlane(null);else{if(!this.readVolumeData(!1))return!1;this.generateSurfaceData()}if(null!=this.jvxlFileHeaderBuffer){a=this.jvxlFileHeaderBuffer.toString();var b=a.indexOf("\n",a.indexOf("\n",a.indexOf("\n")+1)+1)+1;this.jvxlData.jvxlFileTitle=a.substring(0,b)}null==this.params.contactPair&&this.setBBoxAll();this.params.isSilent||JU.Logger.info("boundbox corners "+JU.Escape.eP(this.xyzMin)+" "+JU.Escape.eP(this.xyzMax));this.jvxlData.boundingBox=w(-1,[this.xyzMin,this.xyzMax]); this.jvxlData.dataMin=this.dataMin;this.jvxlData.dataMax=this.dataMax;this.jvxlData.cutoff=this.isJvxl?this.jvxlCutoff:this.params.cutoff;this.jvxlData.isCutoffAbsolute=this.params.isCutoffAbsolute;this.jvxlData.pointsPerAngstrom=1/this.volumeData.volumetricVectorLengths[0];this.jvxlData.jvxlColorData="";this.jvxlData.jvxlPlane=this.params.thePlane;this.jvxlData.jvxlEdgeData=this.edgeData;this.jvxlData.isBicolorMap=this.params.isBicolorMap;this.jvxlData.isContoured=this.params.isContoured;this.jvxlData.colorDensity= this.params.colorDensity;this.jvxlData.pointSize=this.params.pointSize;null!=this.jvxlData.vContours&&(this.params.nContours=this.jvxlData.vContours.length);this.jvxlData.nContours=this.params.contourFromZero?this.params.nContours:-1-this.params.nContours;this.jvxlData.thisContour=this.params.thisContour;this.jvxlData.nEdges=this.edgeCount;this.jvxlData.edgeFractionBase=this.edgeFractionBase;this.jvxlData.edgeFractionRange=this.edgeFractionRange;this.jvxlData.colorFractionBase=this.colorFractionBase; this.jvxlData.colorFractionRange=this.colorFractionRange;this.jvxlData.jvxlDataIs2dContour=this.jvxlDataIs2dContour;this.jvxlData.jvxlDataIsColorMapped=this.jvxlDataIsColorMapped;this.jvxlData.jvxlDataIsColorDensity=this.jvxlDataIsColorDensity;this.jvxlData.isXLowToHigh=this.isXLowToHigh;this.jvxlData.vertexDataOnly=this.vertexDataOnly;this.jvxlData.saveVertexCount=0;if(this.jvxlDataIsColorMapped||0<this.jvxlData.nVertexColors)null!=this.meshDataServer&&(this.meshDataServer.fillMeshData(this.meshData, 1,null),this.meshDataServer.fillMeshData(this.meshData,2,null)),this.jvxlData.jvxlColorData=this.readColorData(),this.updateSurfaceData(),null!=this.meshDataServer&&this.meshDataServer.notifySurfaceMappingCompleted();this.params.showTiming&&JU.Logger.checkTimer("isosurface creation",!1);return!0},"~B");e(c$,"resetIsosurface",function(){this.meshData=new J.jvxl.data.MeshData;this.xyzMin=this.xyzMax=null;this.jvxlData.isBicolorMap=this.params.isBicolorMap;null!=this.meshDataServer&&this.meshDataServer.fillMeshData(null, 0,null);this.contourVertexCount=0;3.4028235E38==this.params.cutoff&&(this.params.cutoff=0.02);this.jvxlData.jvxlSurfaceData="";this.jvxlData.jvxlEdgeData="";this.jvxlData.jvxlColorData="";this.edgeCount=0;this.edgeFractionBase=35;this.edgeFractionRange=90;this.colorFractionBase=35;this.colorFractionRange=90;this.params.mappedDataMin=3.4028235E38});e(c$,"discardTempData",function(a){this.discardTempDataSR(a)},"~B");e(c$,"discardTempDataSR",function(a){a&&(this.voxelData=null,this.marchingCubes=this.sg.marchingSquares= this.marchingSquares=null)},"~B");e(c$,"initializeVolumetricData",function(){this.nPointsX=this.voxelCounts[0];this.nPointsY=this.voxelCounts[1];this.nPointsZ=this.voxelCounts[2];this.setVolumeDataV(this.volumeData)});e(c$,"gotoAndReadVoxelData",function(a){this.initializeVolumetricData();if(0<this.nPointsX&&0<this.nPointsY&&0<this.nPointsZ)try{this.gotoData(this.params.fileIndex-1,this.nPointsX*this.nPointsY*this.nPointsZ),this.readSurfaceData(a)}catch(b){if(U(b,Exception))return JU.Logger.error(b.toString()), !1;throw b;}return!0},"~B");e(c$,"gotoData",function(){},"~N,~N");e(c$,"readColorData",function(){if(null==this.jvxlData.vertexColors)return"";var a=this.jvxlData.vertexCount,b=this.meshData.vcs,c=this.meshData.vvs;if(null==b||b.length<a)this.meshData.vcs=b=Z(a,0);if(null==c||c.length<a)this.meshData.vvs=u(a,0);for(c=0;c<a;c++)b[c]=JU.C.getColix(this.jvxlData.vertexColors[c]);return"-"});j(c$,"getPlane",function(a){return this.getPlane2(a)},"~N");e(c$,"getPlane2",function(a){0==this.yzCount&&this.initPlanes(); null!=this.qpc&&this.qpc.getPlane(a,this.yzPlanes[a%2]);return this.yzPlanes[a%2]},"~N");e(c$,"initPlanes",function(){this.yzCount=this.nPointsY*this.nPointsZ;this.isQuiet||JU.Logger.info("reading data progressively -- yzCount = "+this.yzCount);this.yzPlanes=JU.AU.newFloat2(2);this.yzPlanes[0]=u(this.yzCount,0);this.yzPlanes[1]=u(this.yzCount,0)});j(c$,"getValue",function(a,b,c,d){return this.getValue2(a,b,c,d)},"~N,~N,~N,~N");e(c$,"getValue2",function(a,b,c,d){return null==this.yzPlanes?this.voxelData[a][b][c]: this.yzPlanes[a%2][d]},"~N,~N,~N,~N");e(c$,"generateSurfaceData",function(){this.edgeData="";if(this.vertexDataOnly)try{this.readSurfaceData(!1)}catch(a){if(U(a,Exception))System.out.println(a.toString()),JU.Logger.error("Exception in SurfaceReader::readSurfaceData: "+a.toString());else throw a;}else{this.contourVertexCount=0;var b=-1;this.marchingSquares=null;if(null!=this.params.thePlane||this.params.isContoured)this.marchingSquares=new J.jvxl.calc.MarchingSquares(this,this.volumeData,this.params.thePlane, this.params.contoursDiscrete,this.params.nContours,this.params.thisContour,this.params.contourFromZero),b=this.marchingSquares.contourType,this.marchingSquares.setMinMax(this.params.valueMappedToRed,this.params.valueMappedToBlue);this.params.contourType=b;this.params.isXLowToHigh=this.isXLowToHigh;this.marchingCubes=new J.jvxl.calc.MarchingCubes(this,this.volumeData,this.params,this.jvxlVoxelBitSet);b=this.marchingCubes.getEdgeData();null==this.params.thePlane&&(this.edgeData=b);this.jvxlData.setSurfaceInfoFromBitSetPts(this.marchingCubes.bsVoxels, this.params.thePlane,this.params.mapLattice);this.jvxlData.jvxlExcluded=this.params.bsExcluded;this.isJvxl&&(this.edgeData=this.jvxlEdgeDataRead);this.postProcessVertices()}});e(c$,"postProcessVertices",function(){});j(c$,"getSurfacePointIndexAndFraction",function(a,b,c,d,h,e,g,f,j,k,n,q,t,r){b=this.getSurfacePointAndFraction(a,b,j,k,n,q,c,d,h,g,f,r,this.ptTemp);if(null!=this.marchingSquares&&this.params.isContoured)return this.marchingSquares.addContourVertex(this.ptTemp,a);a=0<this.assocCutoff? r[0]<this.assocCutoff?g:r[0]>1-this.assocCutoff?f:-1:-1;0<=a&&(a=this.marchingCubes.getLinearOffset(c,d,h,a));a=this.addVertexCopy(this.ptTemp,b,a,!0);0<=a&&this.params.iAddGridPoints&&(this.marchingCubes.calcVertexPoint(c,d,h,f,this.ptTemp),this.addVertexCopy(j<k?n:this.ptTemp,Math.min(j,k),-3,!0),this.addVertexCopy(j<k?this.ptTemp:n,Math.max(j,k),-3,!0));return a},"~N,~B,~N,~N,~N,JU.P3i,~N,~N,~N,~N,JU.T3,JU.V3,~B,~A");e(c$,"getSurfacePointAndFraction",function(a,b,c,d,h,e,g,f,j,k,n,q,t){return this.getSPF(a, b,c,d,h,e,g,f,j,k,n,q,t)},"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");e(c$,"getSPF",function(a,b,c,d,h,e,g,f,j,k,n,q,t){d-=c;g=(a-c)/d;if(b&&(0>g||1<g))g=(-a-c)/d;if(0>g||1<g)g=NaN;q[0]=g;t.scaleAdd2(g,e,h);return c+g*d},"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");e(c$,"addVertexCopy",function(a,b,c,d){return this.addVC(a,b,c,d)},"JU.T3,~N,~N,~B");e(c$,"addVC",function(a,b,c,d){return Float.isNaN(b)&&-3!=c?-1:null==this.meshDataServer?this.meshData.addVertexCopy(a,b,c,d):this.meshDataServer.addVertexCopy(a, b,c,d)},"JU.T3,~N,~N,~B");e(c$,"addTriangleCheck",function(a,b,c,d,h,e,g){if(null!=this.marchingSquares&&this.params.isContoured){if(0==g)return this.marchingSquares.addTriangle(a,b,c,d,h);g=0}return null!=this.meshDataServer?this.meshDataServer.addTriangleCheck(a,b,c,d,h,e,g):e&&!J.jvxl.data.MeshData.checkCutoff(a,b,c,this.meshData.vvs)?-1:this.meshData.addTriangleCheck(a,b,c,d,h,g)},"~N,~N,~N,~N,~N,~B,~N");e(c$,"colorIsosurface",function(){this.params.isSquared&&null!=this.volumeData&&this.volumeData.filterData(!0, NaN);null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,1,null);this.jvxlData.saveVertexCount=0;this.params.isContoured&&null!=this.marchingSquares&&(this.initializeMapping(),this.params.setMapRanges(this,!1),this.marchingSquares.setMinMax(this.params.valueMappedToRed,this.params.valueMappedToBlue),this.jvxlData.saveVertexCount=this.marchingSquares.contourVertexCount,this.contourVertexCount=this.marchingSquares.generateContourData(this.jvxlDataIs2dContour,this.params.isSquared? 1E-8:1E-4),this.jvxlData.contourValuesUsed=this.marchingSquares.contourValuesUsed,this.minMax=this.marchingSquares.getMinMax(),null!=this.meshDataServer&&this.meshDataServer.notifySurfaceGenerationCompleted(),this.finalizeMapping());this.applyColorScale();this.jvxlData.nContours=this.params.contourFromZero?this.params.nContours:-1-this.params.nContours;this.jvxlData.thisContour=this.params.thisContour;this.jvxlData.jvxlFileMessage="mapped: min = "+this.params.valueMappedToRed+"; max = "+this.params.valueMappedToBlue}); e(c$,"applyColorScale",function(){this.colorFractionBase=this.jvxlData.colorFractionBase=35;this.colorFractionRange=this.jvxlData.colorFractionRange=90;0==this.params.colorPhase&&(this.params.colorPhase=1);null==this.meshDataServer?this.meshData.vcs=Z(this.meshData.vc,0):(this.meshDataServer.fillMeshData(this.meshData,1,null),null==this.params.contactPair&&this.meshDataServer.fillMeshData(this.meshData,2,null));var a=this.params.colorDensity||this.params.isBicolorMap||this.params.colorBySign||!this.params.colorByPhase; null!=this.params.contactPair&&(a=!1);this.jvxlData.isJvxlPrecisionColor=!0;this.jvxlData.vertexCount=0<this.contourVertexCount?this.contourVertexCount:this.meshData.vc;this.jvxlData.minColorIndex=-1;this.jvxlData.maxColorIndex=0;this.jvxlData.contourValues=this.params.contoursDiscrete;this.jvxlData.isColorReversed=this.params.isColorReversed;if(!this.params.colorDensity&&(this.params.isBicolorMap&&!this.params.isContoured||this.params.colorBySign))this.jvxlData.minColorIndex=JU.C.getColixTranslucent3(JU.C.getColix(this.params.isColorReversed? this.params.colorPos:this.params.colorNeg),0!=this.jvxlData.translucency,this.jvxlData.translucency),this.jvxlData.maxColorIndex=JU.C.getColixTranslucent3(JU.C.getColix(this.params.isColorReversed?this.params.colorNeg:this.params.colorPos),0!=this.jvxlData.translucency,this.jvxlData.translucency);this.jvxlData.isTruncated=0<=this.jvxlData.minColorIndex&&!this.params.isContoured;if(!this.jvxlDataIs2dContour&&!this.hasColorData&&!this.vertexDataOnly&&!(this.params.colorDensity||this.params.isBicolorMap&& !this.params.isContoured)){this.haveSurfaceAtoms&&null==this.meshData.vertexSource&&(this.meshData.vertexSource=p(this.meshData.vc,0));var b=3.4028235E38,c=-3.4028235E38,d;this.initializeMapping();for(var h=this.meshData.vc;--h>=this.meshData.mergeVertexCount0;){if(this.params.colorBySets)d=this.meshData.vertexSets[h];else if(this.params.colorByPhase)d=this.getPhase(this.meshData.vs[h]);else{var e=this.haveSurfaceAtoms;d=this.volumeData.lookupInterpolatedVoxelValue(this.meshData.vs[h],e);e&&(this.meshData.vertexSource[h]= this.getSurfaceAtomIndex())}d<b&&(b=d);d>c&&3.4028235E38!=d&&(c=d);this.meshData.vvs[h]=d}this.params.rangeSelected&&null==this.minMax&&(this.minMax=u(-1,[b,c]));this.finalizeMapping()}this.params.setMapRanges(this,!0);this.jvxlData.mappedDataMin=this.params.mappedDataMin;this.jvxlData.mappedDataMax=this.params.mappedDataMax;this.jvxlData.valueMappedToRed=this.params.valueMappedToRed;this.jvxlData.valueMappedToBlue=this.params.valueMappedToBlue;null==this.params.contactPair&&null==this.jvxlData.vertexColors&& this.colorData();J.jvxl.data.JvxlCoder.jvxlCreateColorData(this.jvxlData,a?this.meshData.vvs:null);this.haveSurfaceAtoms&&null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,4,null);null!=this.meshDataServer&&this.params.colorBySets&&this.meshDataServer.fillMeshData(this.meshData,3,null)});e(c$,"colorData",function(){var a=this.meshData.vvs,b=this.meshData.vcs;this.meshData.pcs=null;var c=this.jvxlData.valueMappedToBlue,d=this.jvxlData.valueMappedToRed,h=this.jvxlData.minColorIndex, e=this.jvxlData.maxColorIndex;null==this.params.colorEncoder&&(this.params.colorEncoder=new JU.ColorEncoder(null,null));this.params.colorEncoder.setRange(this.params.valueMappedToRed,this.params.valueMappedToBlue,this.params.isColorReversed);for(var g=this.meshData.vc;0<=--g;){var f=a[g];0<=h?0>=f?b[g]=h:0<f&&(b[g]=e):(f<=d&&(f=d),f>=c&&(f=c),b[g]=this.params.colorEncoder.getColorIndex(f))}if((0<this.params.nContours||null!=this.jvxlData.contourValues)&&null==this.jvxlData.contourColixes){a=null== this.jvxlData.contourValues?this.params.nContours:this.jvxlData.contourValues.length;b=this.jvxlData.contourColixes=Z(a,0);h=this.jvxlData.contourValues;null==h&&(h=this.jvxlData.contourValuesUsed);null==this.jvxlData.contourValuesUsed&&(this.jvxlData.contourValuesUsed=null==h?u(a,0):h);c=(c-d)/(a+1);this.params.colorEncoder.setRange(this.params.valueMappedToRed,this.params.valueMappedToBlue,this.params.isColorReversed);for(g=0;g<a;g++)e=null==h?d+(g+1)*c:h[g],this.jvxlData.contourValuesUsed[g]=e, b[g]=JU.C.getColixTranslucent(this.params.colorEncoder.getArgb(e));this.jvxlData.contourColors=JU.C.getHexCodes(b)}});c$.getColorPhaseIndex=e(c$,"getColorPhaseIndex",function(a){for(var b=-1,c=0;c<J.jvxl.readers.SurfaceReader.colorPhases.length;c++)if(a.equalsIgnoreCase(J.jvxl.readers.SurfaceReader.colorPhases[c])){b=c;break}return b},"~S");e(c$,"getPhase",function(a){switch(this.params.colorPhase){case 0:case -1:case 1:return 0<a.x?1:-1;case 2:return 0<a.y?1:-1;case 3:return 0<a.z?1:-1;case 4:return 0< a.x*a.y?1:-1;case 5:return 0<a.y*a.z?1:-1;case 6:return 0<a.x*a.z?1:-1;case 7:return 0<a.x*a.x-a.y*a.y?1:-1;case 8:return 0<2*a.z*a.z-a.x*a.x-a.y*a.y?1:-1}return 1},"JU.T3");e(c$,"getMinMaxMappedValues",function(a){if(null!=this.minMax&&3.4028235E38!=this.minMax[0])return this.minMax;if(this.params.colorBySets)return this.minMax=u(-1,[0,Math.max(this.meshData.nSets-1,0)]);var b=3.4028235E38,c=-3.4028235E38;if(this.params.usePropertyForColorRange&&null!=this.params.theProperty){for(a=this.params.theProperty.length;0<= --a;)if(!this.params.rangeSelected||this.params.bsSelected.get(a)){var d=this.params.theProperty[a];Float.isNaN(d)||(d<b&&(b=d),d>c&&(c=d))}return this.minMax=u(-1,[b,c])}var d=0<this.contourVertexCount?this.contourVertexCount:this.meshData.vc,h=this.meshData.vs,e=a||this.jvxlDataIs2dContour||this.vertexDataOnly||this.params.colorDensity;for(a=this.meshData.mergeVertexCount0;a<d;a++){var g;g=e?this.meshData.vvs[a]:this.volumeData.lookupInterpolatedVoxelValue(h[a],!1);g<b&&(b=g);g>c&&3.4028235E38!= g&&(c=g)}return this.minMax=u(-1,[b,c])},"~B");e(c$,"updateTriangles",function(){null==this.meshDataServer?this.meshData.invalidatePolygons():this.meshDataServer.invalidateTriangles()});e(c$,"updateSurfaceData",function(){this.meshData.setVertexSets(!0);this.updateTriangles();null==this.params.bsExcluded[1]&&(this.params.bsExcluded[1]=new JU.BS);this.meshData.updateInvalidatedVertices(this.params.bsExcluded[1])});e(c$,"selectPocket",function(){},"~B");e(c$,"excludeMinimumSet",function(){null!=this.meshDataServer&& this.meshDataServer.fillMeshData(this.meshData,1,null);this.meshData.getSurfaceSet();for(var a,b=this.meshData.nSets;0<=--b;)null!=(a=this.meshData.surfaceSet[b])&&a.cardinality()<this.params.minSet&&this.meshData.invalidateSurfaceSet(b);this.updateSurfaceData();null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,3,null)});e(c$,"excludeMaximumSet",function(){null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,1,null);this.meshData.getSurfaceSet();for(var a, b=this.meshData.nSets;0<=--b;)null!=(a=this.meshData.surfaceSet[b])&&a.cardinality()>this.params.maxSet&&this.meshData.invalidateSurfaceSet(b);this.updateSurfaceData();null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,3,null)});e(c$,"slabIsosurface",function(a){null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,1,null);this.meshData.slabPolygonsList(a,!0);null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,4,null)},"JU.Lst");e(c$, "setVertexAnisotropy",function(a){a.x*=this.anisotropy[0];a.y*=this.anisotropy[1];a.z*=this.anisotropy[2];a.add(this.center)},"JU.T3");e(c$,"setVectorAnisotropy",function(a){this.haveSetAnisotropy=!0;a.x*=this.anisotropy[0];a.y*=this.anisotropy[1];a.z*=this.anisotropy[2]},"JU.T3");e(c$,"setVolumetricAnisotropy",function(){this.haveSetAnisotropy||(this.setVolumetricOriginAnisotropy(),this.setVectorAnisotropy(this.volumetricVectors[0]),this.setVectorAnisotropy(this.volumetricVectors[1]),this.setVectorAnisotropy(this.volumetricVectors[2]))}); e(c$,"setVolumetricOriginAnisotropy",function(){this.volumetricOrigin.setT(this.center)});e(c$,"setBBoxAll",function(){null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,1,null);this.xyzMin=new JU.P3;this.xyzMax=new JU.P3;this.meshData.setBox(this.xyzMin,this.xyzMax)});e(c$,"setBBox",function(a,b){null==this.xyzMin&&(this.xyzMin=JU.P3.new3(3.4028235E38,3.4028235E38,3.4028235E38),this.xyzMax=JU.P3.new3(-3.4028235E38,-3.4028235E38,-3.4028235E38));JU.BoxInfo.addPoint(a,this.xyzMin, this.xyzMax,b)},"JU.T3,~N");e(c$,"getValueAtPoint",function(){return 0},"JU.T3,~B");e(c$,"initializeMapping",function(){});e(c$,"finalizeMapping",function(){});e(c$,"getSurfaceAtomIndex",function(){return-1});R(c$,"ANGSTROMS_PER_BOHR",0.5291772,"defaultMappedDataMin",0,"defaultMappedDataMax",1,"defaultCutoff",0.02,"colorPhases",w(-1,"_orb x y z xy yz xz x2-y2 z2".split(" ")))});H("J.jvxl.calc");K(["JU.TriangleData","JU.BS","$.P3","$.SB","$.V3"],"J.jvxl.calc.MarchingCubes",["java.lang.Float","J.jvxl.data.JvxlCoder"], function(){c$=C(function(){this.volumeData=this.surfaceReader=null;this.contourType=0;this.isContoured=!1;this.cutoff=0;this.isXLowToHigh=this.isSquared=this.isCutoffAbsolute=!1;this.yzCount=this.nZ=this.nY=this.cubeCountZ=this.cubeCountY=this.cubeCountX=0;this.colorDensity=!1;this.integrateSquared=!0;this.edgeData=this.bsExcludedPlanes=this.bsExcludedTriangles=this.bsExcludedVertices=this.bsVoxels=null;this.excludePartialCubes=!0;this.mode=0;this.vertexValues=null;this.edgeCount=0;this.mappingPlane= this.yzPlanes=this.isoPointIndexPlanes=this.edgePointIndexes=this.edgeVectors=this.voxelVertexVectors=null;this.$isInside=this.allInside=!1;this.voxelData=this.offset=null;this.nTriangles=0;this.linearOffsets=this.fReturn=this.edgeVertexPlanes=this.edgeVertexPointers=this.pointA=this.pt0=this.bsValues=null;G(this,arguments)},J.jvxl.calc,"MarchingCubes",JU.TriangleData);W(c$,function(){this.edgeData=new JU.SB;this.vertexValues=u(8,0);this.voxelVertexVectors=Array(8);this.edgeVectors=Array(12);for(var a= 12;0<=--a;)this.edgeVectors[a]=new JU.V3;this.edgePointIndexes=p(12,0);this.bsValues=new JU.BS;this.pt0=new JU.P3;this.pointA=new JU.P3;this.fReturn=u(1,0);this.linearOffsets=p(8,0)});Q(c$,function(){Y(this,J.jvxl.calc.MarchingCubes,[])});Q(c$,function(a,b,c,d){Y(this,J.jvxl.calc.MarchingCubes,[]);this.excludePartialCubes=!0;this.surfaceReader=a;this.bsVoxels=d;a=c.bsExcluded;this.bsExcludedVertices=null==a[0]?a[0]=new JU.BS:a[0];this.bsExcludedPlanes=null==a[2]?a[2]=new JU.BS:a[2];this.bsExcludedTriangles= null==a[3]?a[3]=new JU.BS:a[3];this.mode=null!=b.getVoxelData()||null!=b.mappingPlane?1:null!=d?2:3;this.setParameters(b,c)},"J.jvxl.api.VertexDataServer,J.jvxl.data.VolumeData,J.jvxl.readers.Parameters,JU.BS");e(c$,"setParameters",function(a,b){this.volumeData=a;this.colorDensity=b.colorDensity;this.isContoured=null==b.thePlane&&b.isContoured&&!this.colorDensity;this.cutoff=b.cutoff;this.isCutoffAbsolute=b.isCutoffAbsolute;this.contourType=b.contourType;this.isSquared=b.isSquared;this.isXLowToHigh= b.isXLowToHigh;this.cubeCountX=a.voxelCounts[0]-1;this.cubeCountY=a.voxelCounts[1]-1;this.cubeCountZ=a.voxelCounts[2]-1;a.getYzCount();null!=b.mapLattice&&(this.cubeCountX*=Math.abs(b.mapLattice.x),this.cubeCountY*=Math.abs(b.mapLattice.y),this.cubeCountZ*=Math.abs(b.mapLattice.z));this.nY=this.cubeCountY+1;this.nZ=this.cubeCountZ+1;this.yzCount=this.nY*this.nZ;null==this.bsVoxels&&(this.bsVoxels=new JU.BS);this.edgeVertexPointers=this.isXLowToHigh?J.jvxl.calc.MarchingCubes.edgeVertexPointersLowToHigh: J.jvxl.calc.MarchingCubes.edgeVertexPointersHighToLow;this.edgeVertexPlanes=this.isXLowToHigh?J.jvxl.calc.MarchingCubes.edgeVertexPlanesLowToHigh:J.jvxl.calc.MarchingCubes.edgeVertexPlanesHighToLow;this.isoPointIndexPlanes=p(2,this.yzCount,3,0);this.yzPlanes=3==this.mode?u(2,this.yzCount,0):null;this.setLinearOffsets();this.calcVoxelVertexVectors()},"J.jvxl.data.VolumeData,J.jvxl.readers.Parameters");e(c$,"calcVoxelVertexVectors",function(){for(var a=8;0<=--a;)this.volumeData.transform(J.jvxl.calc.MarchingCubes.cubeVertexVectors[a], this.voxelVertexVectors[a]=new JU.V3);for(a=12;0<=--a;)this.edgeVectors[a].sub2(this.voxelVertexVectors[JU.TriangleData.edgeVertexes[a+a+1]],this.voxelVertexVectors[JU.TriangleData.edgeVertexes[a+a]])});e(c$,"resetIndexPlane",function(a){for(var b=0;b<this.yzCount;b++)for(var c=0;3>c;c++)a[b][c]=-2147483648;return a},"~A");e(c$,"getEdgeData",function(){if(0>this.cubeCountX||0>this.cubeCountY||0>this.cubeCountZ)return"";this.mappingPlane=this.volumeData.mappingPlane;this.edgeCount=0;var a,b,c,d,h, e;this.isXLowToHigh?(a=0,this.colorDensity?(b=this.cubeCountX+1,e=this.yzCount-1):(b=this.cubeCountX,e=this.yzCount-1-this.nZ-1),c=1,d=this.yzCount):(this.colorDensity?(a=this.cubeCountX,e=(this.cubeCountX+1)*this.yzCount-1):(a=this.cubeCountX-1,e=this.cubeCountX*this.yzCount-1-this.nZ-1),c=b=-1,d=-this.yzCount);h=e;this.resetIndexPlane(this.isoPointIndexPlanes[1]);this.voxelData=null;var g=this.cubeCountY+(this.colorDensity?1:0),f=this.cubeCountZ+(this.colorDensity?1:0);switch(this.mode){case 3:this.getPlane(a, !1);break;case 1:this.voxelData=this.volumeData.getVoxelData()}this.allInside=this.colorDensity&&(0==this.cutoff||2==this.mode&&0>this.bsVoxels.nextSetBit(0));for(var j=this.colorDensity&&0==this.cutoff,k=0;a!=b;a+=c,e+=d,h=e)if(3==this.mode&&a+c<=b&&this.getPlane(a+c,!0),!this.bsExcludedPlanes.get(a)||!this.bsExcludedPlanes.get(a+c))if(this.colorDensity)for(var n=g;0<=--n;)for(var q=f;0<=--q;h--)k=this.getValue(a,n,q,h,0),(j||this.$isInside)&&this.addVertex(a,n,q,h,k);else{n=this.isoPointIndexPlanes[0]; this.isoPointIndexPlanes[0]=this.isoPointIndexPlanes[1];this.isoPointIndexPlanes[1]=this.resetIndexPlane(n);for(var t=!0,n=g;0<=--n;h--)for(q=f;0<=--q;h--){for(var r=0,p=8;0<=--p;)k=this.getValue(a,n,q,h,p),this.$isInside&&(r|=JU.TriangleData.Pwr2[p]);t&&!Float.isNaN(k)&&(t=!1);0!=r&&255!=r&&this.processOneCubical(r,a,n,q,h)&&(!this.isContoured&&!this.colorDensity)&&this.processTriangles(r)}t&&this.bsExcludedPlanes.set(a)}return this.edgeData.toString()});e(c$,"getValue",function(a,b,c,d,h){this.offset= JU.TriangleData.cubeVertexOffsets[h];d+=this.linearOffsets[h];switch(this.mode){case 3:a=this.vertexValues[h]=this.getValueArray(a+this.offset.x,b+this.offset.y,c+this.offset.z,d,this.yzPlanes[J.jvxl.calc.MarchingCubes.yzPlanePts[h]]);this.$isInside=this.allInside||this.bsVoxels.get(d);break;case 2:this.$isInside=this.allInside||this.bsVoxels.get(d);a=this.vertexValues[h]=this.bsExcludedVertices.get(d)?NaN:this.$isInside?1:0;break;default:case 1:null==this.mappingPlane?a=this.vertexValues[h]=this.voxelData[a+ this.offset.x][b+this.offset.y][c+this.offset.z]:(this.volumeData.voxelPtToXYZ(a+this.offset.x,b+this.offset.y,c+this.offset.z,this.pt0),a=this.vertexValues[h]=this.volumeData.distanceToMappingPlane(this.pt0)),this.isSquared&&(this.vertexValues[h]*=this.vertexValues[h]),(this.$isInside=this.allInside?!0:J.jvxl.calc.MarchingCubes.isInside(this.vertexValues[h],this.cutoff,this.isCutoffAbsolute))&&this.bsVoxels.set(d)}return a},"~N,~N,~N,~N,~N");e(c$,"getPlane",function(a,b){if(!(0>a||a>this.cubeCountX))if(this.surfaceReader.getPlane(a), b){var c=this.yzPlanes[0];this.yzPlanes[0]=this.yzPlanes[1];this.yzPlanes[1]=c}},"~N,~B");e(c$,"processTriangles",function(a){a=JU.TriangleData.triangleTable2[a];for(var b=a.length;0<=(b-=4);)this.addTriangle(a[b],a[b+1],a[b+2],a[b+3])},"~N");e(c$,"addVertex",function(a,b,c,d,h){this.volumeData.voxelPtToXYZ(a,b,c,this.pt0);0>this.surfaceReader.addVertexCopy(this.pt0,h,-4,!0)&&this.bsExcludedVertices.set(d)},"~N,~N,~N,~N,~N");e(c$,"addTriangle",function(a,b,c,d){!this.bsExcludedTriangles.get(this.nTriangles)&& 0>this.surfaceReader.addTriangleCheck(this.edgePointIndexes[a],this.edgePointIndexes[b],this.edgePointIndexes[c],d,0,this.isCutoffAbsolute,0)&&this.bsExcludedTriangles.set(this.nTriangles);this.nTriangles++},"~N,~N,~N,~N");e(c$,"getValueArray",function(a,b,c,d,h){var e=d%this.yzCount;this.bsValues.set(d);a=this.surfaceReader.getValue(a,b,c,e);this.isSquared&&(a*=a);h[e]=a;J.jvxl.calc.MarchingCubes.isInside(a,this.cutoff,this.isCutoffAbsolute)&&this.bsVoxels.set(d);return a},"~N,~N,~N,~N,~A");c$.isInside= e(c$,"isInside",function(a,b,c){return 0<b&&(c?Math.abs(a):a)>=b||0>=b&&a<=b},"~N,~N,~B");e(c$,"processOneCubical",function(a,b,c,d,h){a=J.jvxl.calc.MarchingCubes.insideMaskTable[a];for(var e=!1,g=12;0<=--g;)if(0!=(a&JU.TriangleData.Pwr2[g])){var f=this.edgeVertexPlanes[g],j=(h+this.linearOffsets[this.edgeVertexPointers[g]])%this.yzCount,k=J.jvxl.calc.MarchingCubes.edgeTypeTable[g],n=this.edgePointIndexes[g]=this.isoPointIndexPlanes[f][j][k];if(-2147483648!=n)-1==n&&(e=this.excludePartialCubes);else{var n= JU.TriangleData.edgeVertexes[g<<1],q=JU.TriangleData.edgeVertexes[(g<<1)+1],t=this.vertexValues[n],r=this.vertexValues[q];this.calcVertexPoint(b,c,d,n,this.pointA);this.edgeCount++;f=this.edgePointIndexes[g]=this.isoPointIndexPlanes[f][j][k]=this.surfaceReader.getSurfacePointIndexAndFraction(this.cutoff,this.isCutoffAbsolute,b,c,d,JU.TriangleData.cubeVertexOffsets[n],n,q,t,r,this.pointA,this.edgeVectors[g],k==this.contourType,this.fReturn);this.addEdgeData(0>f?NaN:this.fReturn[0]);if(Float.isNaN(this.fReturn[0])|| 0>f)e=this.excludePartialCubes}}return!e},"~N,~N,~N,~N,~N");e(c$,"addEdgeData",function(a){a=J.jvxl.data.JvxlCoder.jvxlFractionAsCharacter(a);this.edgeData.appendC(a)},"~N");e(c$,"calcVertexPoint",function(a,b,c,d,h){this.volumeData.voxelPtToXYZ(a,b,c,this.pt0);h.add2(this.pt0,this.voxelVertexVectors[d])},"~N,~N,~N,~N,JU.P3");e(c$,"setLinearOffsets",function(){this.linearOffsets[0]=0;this.linearOffsets[1]=this.yzCount;this.linearOffsets[2]=this.yzCount+1;this.linearOffsets[3]=1;this.linearOffsets[4]= this.nZ;this.linearOffsets[5]=this.yzCount+this.nZ;this.linearOffsets[6]=this.yzCount+this.nZ+1;this.linearOffsets[7]=this.nZ+1});e(c$,"getLinearOffset",function(a,b,c,d){return a*this.yzCount+b*this.nZ+c+this.linearOffsets[d]},"~N,~N,~N,~N");R(c$,"MODE_CUBE",1,"MODE_JVXL",2,"MODE_PLANES",3);R(c$,"yzPlanePts",p(-1,[0,1,1,0,0,1,1,0]),"edgeVertexPointersLowToHigh",p(-1,[1,1,2,0,5,5,6,4,0,1,2,3]),"edgeVertexPointersHighToLow",p(-1,[0,1,3,0,4,5,7,4,0,1,2,3]),"edgeVertexPlanesLowToHigh",p(-1,[1,1,1,0, 1,1,1,0,0,1,1,0]),"edgeVertexPlanesHighToLow",p(-1,[1,0,1,1,1,0,1,1,1,0,0,1]));c$.cubeVertexVectors=c$.prototype.cubeVertexVectors=w(-1,[JU.V3.new3(0,0,0),JU.V3.new3(1,0,0),JU.V3.new3(1,0,1),JU.V3.new3(0,0,1),JU.V3.new3(0,1,0),JU.V3.new3(1,1,0),JU.V3.new3(1,1,1),JU.V3.new3(0,1,1)]);R(c$,"edgeTypeTable",p(-1,[0,2,0,2,0,2,0,2,1,1,1,1]),"insideMaskTable",Z(-1,[0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993, 3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204, 453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331, 3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0]))});H("J.jvxl.calc");K(["JU.P3","java.util.Hashtable"],"J.jvxl.calc.MarchingSquares",["java.lang.Float","JU.AU","JU.Logger"],function(){c$=C(function(){this.volumeData=this.surfaceReader=null;this.valueMax=this.valueMin=this.thisContour=this.contourType=this.nContourSegments=0;this.pointB=this.pointA=null;this.contourFromZero=!0;this.contoursDiscrete=null;this.contourVertexCount=0;this.contourVertexes=null;na("J.jvxl.calc.MarchingSquares.ContourVertex")|| J.jvxl.calc.MarchingSquares.$MarchingSquares$ContourVertex$();this.contourPlaneMaximumValue=this.contourPlaneMinimumValue=0;this.ptTemp=this.contourValuesUsed=null;this.triangleCount=0;this.htPts=this.triangles=null;na("J.jvxl.calc.MarchingSquares.Triangle")||J.jvxl.calc.MarchingSquares.$MarchingSquares$Triangle$();G(this,arguments)},J.jvxl.calc,"MarchingSquares");W(c$,function(){this.pointA=new JU.P3;this.pointB=new JU.P3;this.contourVertexes=Array(1E3);this.ptTemp=new JU.P3;this.triangles=Array(1E3); this.htPts=new java.util.Hashtable});Q(c$,function(a,b,c,d,h,e,g){this.surfaceReader=a;this.volumeData=b;this.thisContour=e;this.contoursDiscrete=d;this.contourFromZero=g;null==d?(this.nContourSegments=(0==h?9:h)+0,100<this.nContourSegments&&(this.nContourSegments=100)):(this.nContourSegments=h=d.length,this.contourFromZero=!1)},"J.jvxl.api.VertexDataServer,J.jvxl.data.VolumeData,JU.P4,~A,~N,~N,~B");e(c$,"setMinMax",function(a,b){this.valueMin=a;this.valueMax=b},"~N,~N");e(c$,"addContourVertex",function(a, b){this.contourVertexCount==this.contourVertexes.length&&(this.contourVertexes=JU.AU.doubleLength(this.contourVertexes));var c=this.surfaceReader.addVertexCopy(a,b,-2,!0);this.contourVertexes[this.contourVertexCount++]=ma(J.jvxl.calc.MarchingSquares.ContourVertex,this,null,a);return c},"JU.P3,~N");e(c$,"setContourData",function(a,b){this.contourVertexes[a].setValue(b)},"~N,~N");e(c$,"calcContourPoint",function(a,b,c,d){return this.volumeData.calculateFractionalPoint(a,this.pointA,this.pointB,b,c, d)},"~N,~N,~N,JU.P3");e(c$,"addTriangle",function(a,b,c,d,h){this.triangleCount==this.triangles.length&&(this.triangles=JU.AU.doubleLength(this.triangles));this.triangles[this.triangleCount++]=ma(J.jvxl.calc.MarchingSquares.Triangle,this,null,a,b,c,d,h);return 0},"~N,~N,~N,~N,~N");e(c$,"generateContourData",function(a,b){JU.Logger.info("generateContours: "+this.nContourSegments+" segments");this.getVertexValues(a);this.createContours(this.valueMin,this.valueMax,b);this.addAllTriangles();return this.contourVertexCount}, "~B,~N");e(c$,"getVertexValues",function(a){this.contourPlaneMinimumValue=3.4028235E38;this.contourPlaneMaximumValue=-3.4028235E38;for(var b=0;b<this.contourVertexCount;b++){var c=this.contourVertexes[b],d;a?d=c.value:(d=this.volumeData.lookupInterpolatedVoxelValue(c,!1),c.setValue(d));d<this.contourPlaneMinimumValue&&(this.contourPlaneMinimumValue=d);d>this.contourPlaneMaximumValue&&(this.contourPlaneMaximumValue=d)}},"~B");e(c$,"createContours",function(a,b,c){b-=a;this.contourValuesUsed=u(this.nContourSegments, 0);for(var d=this.triangleCount;0<=--d;)this.triangles[d].check=0;for(var h=-3.4028235E38,d=0;d<this.nContourSegments;d++){h=null!=this.contoursDiscrete?this.contoursDiscrete[d]:this.contourFromZero?a+1*d/this.nContourSegments*b:0==d?-3.4028235E38:d==this.nContourSegments-1?3.4028235E38:a+1*(d-1)/(this.nContourSegments-1)*b;null==this.contoursDiscrete&&Math.abs(h)<c&&(h=0>h?-c:c);this.contourValuesUsed[d]=h;JU.Logger.info("#contour "+(d+1)+" "+h+" "+this.triangleCount);this.htPts.clear();for(var e= this.triangleCount;0<=--e;)this.triangles[e].isValid&&this.checkContour(this.triangles[e],d,h)}this.valueMin=this.contourValuesUsed[0];this.valueMax=0==this.contourValuesUsed.length?this.valueMin:this.contourValuesUsed[this.contourValuesUsed.length-1];return!0},"~N,~N,~N");e(c$,"intercept",function(a,b,c){var d=a.pts[b];a=a.pts[(b+1)%3];if(2147483647==d||2147483647==a)return-1;b=d<a?d+"_"+a:a+"_"+d;if(this.htPts.containsKey(b))return this.htPts.get(b).intValue();var h=this.contourVertexes[d].value, e=this.contourVertexes[a].value,g=-1;if(h!=e){var f=(c-h)/(e-h);if(0<=f&&1>=f&&(this.pointA.setT(this.contourVertexes[d]),this.pointB.setT(this.contourVertexes[a]),c=this.calcContourPoint(c,h,e,this.ptTemp),!Float.isNaN(c))){g=this.addContourVertex(this.ptTemp,c);if(0>g)return-1;this.contourVertexes[g].setValue(c)}}this.htPts.put(b,Integer.$valueOf(g));return g},"J.jvxl.calc.MarchingSquares.Triangle,~N,~N");e(c$,"checkContour",function(a,b,c){if(!(0<this.thisContour&&b+1!=this.thisContour)){var d= this.intercept(a,0,c),h=this.intercept(a,1,c);c=this.intercept(a,2,c);var e=a.pts,g=0;0<=d&&(g+=1);0<=h&&(g+=2);0<=c&&(g+=4);switch(g){case 3:this.addTriangle(e[0],d,h,2|a.check&1,b);this.addTriangle(d,e[1],h,4|a.check&3,b);this.addTriangle(e[0],h,e[2],a.check&6,b);break;case 5:this.addTriangle(e[0],d,c,2|a.check&5,b);this.addTriangle(d,e[1],c,4|a.check&1,b);this.addTriangle(c,e[1],e[2],a.check&6,b);break;case 6:this.addTriangle(e[0],e[1],c,a.check&5,b);this.addTriangle(c,e[1],h,4|a.check&2,b);this.addTriangle(c, h,e[2],1|a.check&6,b);break;default:return}a.isValid=!1}},"J.jvxl.calc.MarchingSquares.Triangle,~N,~N");e(c$,"getMinMax",function(){return u(-1,[this.valueMin,this.valueMax])});e(c$,"addAllTriangles",function(){for(var a=0;a<this.triangleCount;a++)if(this.triangles[a].isValid){var b=this.triangles[a];this.surfaceReader.addTriangleCheck(b.pts[0],b.pts[1],b.pts[2],b.check,b.contourIndex,!1,-1)}});c$.$MarchingSquares$ContourVertex$=function(){la(self.c$);c$=C(function(){oa(this,arguments);this.value= 0;G(this,arguments)},J.jvxl.calc.MarchingSquares,"ContourVertex",JU.P3);Q(c$,function(a){Y(this,J.jvxl.calc.MarchingSquares.ContourVertex,[]);this.setT(a)},"JU.P3");e(c$,"setValue",function(a){this.value=a},"~N");j(c$,"toString",function(){return this.value+" "+this.x+" "+this.y+" "+this.z});c$=fa()};c$.$MarchingSquares$Triangle$=function(){la(self.c$);c$=C(function(){oa(this,arguments);this.pts=null;this.check=0;this.isValid=!0;this.contourIndex=0;G(this,arguments)},J.jvxl.calc.MarchingSquares,"Triangle"); Q(c$,function(a,b,c,d,h){this.pts=p(-1,[a,b,c]);this.check=d;this.contourIndex=h},"~N,~N,~N,~N,~N");c$=fa()};R(c$,"CONTOUR_POINT",-1,"VERTEX_POINT",-2,"EDGE_POINT",-3,"nContourMax",100,"defaultContourCount",9)});H("J.shapesurface");K(["J.shape.Mesh"],"J.shapesurface.IsosurfaceMesh","java.lang.Float java.util.Hashtable JU.AU $.BS $.CU $.Lst $.M4 $.P3 $.P3i $.PT $.SB $.V3 J.api.Interface J.jvxl.data.JvxlCoder $.JvxlData JS.T JU.C $.ColorEncoder $.Logger JV.Viewer".split(" "),function(){c$=C(function(){this.jvxlData= null;this.vertexIncrement=1;this.firstRealVertex=-1;this.dataType=0;this.hasGridPoints=!1;this.assocGridPointNormals=this.assocGridPointMap=this.info=this.calculatedVolume=this.calculatedArea=null;this.mergeAssociatedNormalCount=0;this.bsVdw=this.colorEncoder=this.contourColixes=this.contourValues=this.centers=null;this.colorPhased=!1;G(this,arguments)},J.shapesurface,"IsosurfaceMesh",J.shape.Mesh);j(c$,"getResolution",function(){return 1/this.jvxlData.pointsPerAngstrom});Q(c$,function(a,b,c,d){this.mesh1(a, b,c,d);this.jvxlData=new J.jvxl.data.JvxlData;this.checkByteCount=2;this.jvxlData.version=JV.Viewer.getJmolVersion()},"JV.Viewer,~S,~N,~N");e(c$,"clearType",function(a,b){this.clear(a);this.jvxlData.clear();this.colorEncoder=this.centers=this.calculatedArea=this.calculatedVolume=this.bsVdw=this.assocGridPointNormals=this.assocGridPointMap=null;this.colorsExplicit=this.colorPhased=!1;this.firstRealVertex=-1;this.hasGridPoints=b;this.isColorSolid=!0;this.nSets=this.mergeAssociatedNormalCount=0;this.pcs= null;this.showPoints=b;this.vertexColorMap=this.vcs=this.surfaceSet=null;this.vertexIncrement=1;this.vvs=this.vertexSets=null},"~S,~B");e(c$,"allocVertexColixes",function(){if(null==this.vcs){this.vcs=Z(this.vc,0);for(var a=this.vc;0<=--a;)this.vcs[a]=this.colix}this.isColorSolid=!1});e(c$,"addVertexCopy",function(a,b,c,d,h){a=this.addVCVal(a,b,h);switch(c){case -1:0>this.firstRealVertex&&(this.firstRealVertex=a);break;case -2:this.hasGridPoints=!0;break;case -3:this.vertexIncrement=3;break;default:0> this.firstRealVertex&&(this.firstRealVertex=a),d&&(null==this.assocGridPointMap&&(this.assocGridPointMap=new java.util.Hashtable),this.assocGridPointMap.put(Integer.$valueOf(a),Integer.$valueOf(c+this.mergeAssociatedNormalCount)))}return a},"JU.T3,~N,~N,~B,~B");j(c$,"setTranslucent",function(a,b){this.colix=JU.C.getColixTranslucent3(this.colix,a,b);if(null!=this.vcs)for(var c=this.vc;0<=--c;)this.vcs[c]=JU.C.getColixTranslucent3(this.vcs[c],a,b)},"~B,~N");e(c$,"setMerged",function(a){this.mergePolygonCount0= (this.isMerged=a)?this.pc:0;this.mergeVertexCount0=a?this.vc:0;a&&(this.mergeAssociatedNormalCount+=this.jvxlData.nPointsX*this.jvxlData.nPointsY*this.jvxlData.nPointsZ,this.assocGridPointNormals=null)},"~B");j(c$,"sumVertexNormals",function(a,b){J.shape.Mesh.sumVertexNormals2(this,a,b);if(null!=this.assocGridPointMap&&0<b.length&&!this.isMerged){null==this.assocGridPointNormals&&(this.assocGridPointNormals=new java.util.Hashtable);for(var c,d=this.assocGridPointMap.entrySet().iterator();d.hasNext()&& ((c=d.next())||1);){var h=c.getValue();this.assocGridPointNormals.containsKey(h)||this.assocGridPointNormals.put(h,JU.V3.new3(0,0,0));this.assocGridPointNormals.get(h).add(b[c.getKey().intValue()])}for(d=this.assocGridPointMap.entrySet().iterator();d.hasNext()&&((c=d.next())||1);)b[c.getKey().intValue()]=this.assocGridPointNormals.get(c.getValue())}},"~A,~A");e(c$,"getCenters",function(){if(null!=this.centers)return this.centers;this.centers=Array(this.pc);for(var a=0;a<this.pc;a++){var b=this.pis[a]; if(null!=b){var c=this.centers[a]=JU.P3.newP(this.vs[b[0]]);c.add(this.vs[b[1]]);c.add(this.vs[b[2]]);c.scale(0.33333334)}}return this.centers});e(c$,"getContours",function(){var a=this.jvxlData.nContours;if(0==a||null==this.pis||(this.havePlanarContours=null!=this.jvxlData.jvxlPlane))return null;0>a&&(a=-1-a);var b=this.jvxlData.vContours;if(null!=b){for(var c=0;c<a&&!(6<b[c].size());c++)J.jvxl.data.JvxlCoder.set3dContourVector(b[c],this.pis,this.vs);return this.jvxlData.vContours}b=Array(a);for(c= 0;c<a;c++)b[c]=new JU.Lst;if(null==this.jvxlData.contourValuesUsed){for(var d=(this.jvxlData.valueMappedToBlue-this.jvxlData.valueMappedToRed)/(a+1),c=0;c<a;c++){var h=this.jvxlData.valueMappedToRed+(c+1)*d;J.shapesurface.IsosurfaceMesh.get3dContour(this,b[c],h,this.jvxlData.contourColixes[c])}JU.Logger.info(a+" contour lines; separation = "+d)}else for(c=0;c<a;c++)h=this.jvxlData.contourValuesUsed[c],J.shapesurface.IsosurfaceMesh.get3dContour(this,b[c],h,this.jvxlData.contourColixes[c]);this.jvxlData.contourColixes= Z(a,0);this.jvxlData.contourValues=u(a,0);for(c=0;c<a;c++)this.jvxlData.contourValues[c]=b[c].get(2).floatValue(),this.jvxlData.contourColixes[c]=b[c].get(3)[0];return this.jvxlData.vContours=b});c$.get3dContour=e(c$,"get3dContour",function(a,b,c,d){var h=JU.BS.newN(a.pc),e=new JU.SB,g=JU.C.getArgb(d);J.shapesurface.IsosurfaceMesh.setContourVector(b,a.pc,h,c,d,g,e);for(d=0;d<a.pc;d++)null!=a.setABC(d)&&J.shapesurface.IsosurfaceMesh.addContourPoints(b,h,d,e,a.vs,a.vvs,a.iA,a.iB,a.iC,c)},"J.shapesurface.IsosurfaceMesh,JU.Lst,~N,~N"); c$.setContourVector=e(c$,"setContourVector",function(a,b,c,d,h,e,g){a.add(0,Integer.$valueOf(b));a.add(1,c);a.add(2,Float.$valueOf(d));a.add(3,Z(-1,[h]));a.add(4,p(-1,[e]));a.add(5,g)},"JU.Lst,~N,JU.BS,~N,~N,~N,JU.SB");c$.addContourPoints=e(c$,"addContourPoints",function(a,b,c,d,e,f,g,j,p,k){var n=null,q=null,t=0,r=J.shapesurface.IsosurfaceMesh.checkPt(f,g,j,k);Float.isNaN(r)||(n=J.shapesurface.IsosurfaceMesh.getContourPoint(e,g,j,r),t|=1);var u=1==r?NaN:J.shapesurface.IsosurfaceMesh.checkPt(f,j, p,k);Float.isNaN(u)||(q=J.shapesurface.IsosurfaceMesh.getContourPoint(e,j,p,u),0==t&&(n=q,r=u),t|=2);switch(t){case 0:return;case 1:if(0==r)return;case 2:u=1==u?NaN:J.shapesurface.IsosurfaceMesh.checkPt(f,p,g,k),Float.isNaN(u)||(q=J.shapesurface.IsosurfaceMesh.getContourPoint(e,p,g,u),t|=4)}switch(t){case 3:case 5:case 6:break;default:return}b.set(c);J.jvxl.data.JvxlCoder.appendContourTriangleIntersection(t,r,u,d);a.addLast(n);a.addLast(q)},"JU.Lst,JU.BS,~N,JU.SB,~A,~A,~N,~N,~N,~N");c$.checkPt=e(c$, "checkPt",function(a,b,c,d){var e,f;return d==(e=a[b])?0:d==(f=a[c])?1:e<d==d<f?(d-e)/(f-e):NaN},"~A,~N,~N,~N");c$.getContourPoint=e(c$,"getContourPoint",function(a,b,c,d){var e=new JU.P3;e.sub2(a[c],a[b]);e.scaleAdd2(d,e,a[b]);return e},"~A,~N,~N,~N");e(c$,"setDiscreteColixes",function(a,b){null!=a&&(this.jvxlData.contourValues=a);if(null==a||0==a.length)a=this.jvxlData.contourValues=this.jvxlData.contourValuesUsed;null==b&&null!=this.jvxlData.contourColixes?b=this.jvxlData.contourColixes:(this.jvxlData.contourColixes= b,this.jvxlData.contourColors=JU.C.getHexCodes(b));if(!(null==this.vs||null==this.vvs||null==a)){var c=a.length,d=a[c-1];this.colorCommand=null;var e=null!=b&&0<b.length;this.isColorSolid=e&&null!=this.jvxlData.jvxlPlane;if(null!=this.jvxlData.vContours){if(e)for(var f=0;f<this.jvxlData.vContours.length;f++)c=b[f%b.length],this.jvxlData.vContours[f].get(3)[0]=c,this.jvxlData.vContours[f].get(4)[0]=JU.C.getArgb(c)}else{this.pcs=Z(this.pc,0);this.colorsExplicit=!1;for(f=0;f<this.pc;f++){var g=this.pis[f]; if(null!=g){this.pcs[f]=0;for(var g=(this.vvs[g[0]]+this.vvs[g[1]]+this.vvs[g[2]])/3,j=c;0<=--j;)if(g>=a[j]&&g<d){this.pcs[f]=e?b[j%b.length]:0;break}}}}}},"~A,~A");e(c$,"getContourList",function(){var a=new java.util.Hashtable;a.put("values",null==this.jvxlData.contourValuesUsed?this.jvxlData.contourValues:this.jvxlData.contourValuesUsed);var b=new JU.Lst;if(null!=this.jvxlData.contourColixes){for(var c=0;c<this.jvxlData.contourColixes.length;c++)b.addLast(JU.CU.colorPtFromInt(JU.C.getArgb(this.jvxlData.contourColixes[c]), null));a.put("colors",b)}return a},"JV.Viewer");e(c$,"deleteContours",function(){this.jvxlData.contourValuesUsed=null;this.jvxlData.contourValues=null;this.jvxlData.contourColixes=null;this.jvxlData.vContours=null});e(c$,"setVertexColorMap",function(){this.vertexColorMap=new java.util.Hashtable;for(var a=-999,b=null,c=this.vc;0<=--c;){var d=this.vcs[c];d!=a&&(d=JU.C.getHexCode(a=d),b=this.vertexColorMap.get(d),null==b&&this.vertexColorMap.put(d,b=new JU.BS));b.set(c)}});e(c$,"setVertexColixesForAtoms", function(a,b,c,d){this.jvxlData.vertexDataOnly=!0;this.jvxlData.vertexColors=p(this.vc,0);this.jvxlData.nVertexColors=this.vc;var e=a.ms.at;a=a.gdata;for(var f=this.mergeVertexCount0;f<this.vc;f++){var g=this.vertexSource[f];if(!(0>g)&&d.get(g)){this.jvxlData.vertexColors[f]=a.getColorArgbOrGray(this.vcs[f]=JU.C.copyColixTranslucency(this.colix,e[g].colixAtom));var j=null==b?0:b[c[g]];0==j&&(j=e[g].colixAtom);this.vcs[f]=JU.C.copyColixTranslucency(this.colix,j)}}},"JV.Viewer,~A,~A,JU.BS");e(c$,"colorVertices", function(a,b,c){if(null!=this.vertexSource){a=JU.C.copyColixTranslucency(this.colix,a);var d=c?new JU.BS:b;this.checkAllocColixes();if(c)for(var e=0;e<this.vc;e++){var f=this.vertexSource[e];0<=f&&b.get(f)&&(this.vcs[e]=a,null!=d&&d.set(e))}else for(e=0;e<this.vc;e++)d.get(e)&&(this.vcs[e]=a);c&&(a=JU.C.getHexCode(a),null==this.vertexColorMap&&(this.vertexColorMap=new java.util.Hashtable),J.shapesurface.IsosurfaceMesh.addColorToMap(this.vertexColorMap,a,b))}},"~N,JU.BS,~B");e(c$,"checkAllocColixes", function(){(null==this.vcs||null==this.vertexColorMap&&this.isColorSolid)&&this.allocVertexColixes();this.isColorSolid=!1});c$.addColorToMap=e(c$,"addColorToMap",function(a,b,c){for(var d=null,e,f=a.entrySet().iterator();f.hasNext()&&((e=f.next())||1);)e.getKey()===b?(d=e.getValue(),d.or(c)):e.getValue().andNot(c);null==d&&a.put(b,c)},"java.util.Map,~S,JU.BS");e(c$,"setJvxlColorMap",function(a){this.jvxlData.diameter=this.diameter;this.jvxlData.color=JU.C.getHexCode(this.colix);this.jvxlData.meshColor= 0==this.meshColix?null:JU.C.getHexCode(this.meshColix);this.jvxlData.translucency=30720==(this.colix&30720)?-1:JU.C.getColixTranslucencyFractional(this.colix);this.jvxlData.rendering=this.getRendering().substring(1);this.jvxlData.colorScheme=null==this.colorEncoder?null:this.colorEncoder.getColorScheme();null==this.jvxlData.vertexColors&&(this.jvxlData.nVertexColors=null==this.vertexColorMap?0:this.vertexColorMap.size());if(!(null==this.vertexColorMap||null==this.vertexSource||!a)){null==this.jvxlData.vertexColorMap&& (this.jvxlData.vertexColorMap=new java.util.Hashtable);var b;for(a=this.vertexColorMap.entrySet().iterator();a.hasNext()&&((b=a.next())||1);){var c=b.getValue();if(!c.isEmpty()){for(var d=b.getKey(),e=new JU.BS,f=0;f<this.vc;f++)c.get(this.vertexSource[f])&&e.set(f);J.shapesurface.IsosurfaceMesh.addColorToMap(this.jvxlData.vertexColorMap,d,e)}}this.jvxlData.nVertexColors=this.jvxlData.vertexColorMap.size();0==this.jvxlData.vertexColorMap.size()&&(this.jvxlData.vertexColorMap=null)}},"~B");e(c$,"setColorCommand", function(){null!=this.colorEncoder&&(this.colorCommand=this.colorEncoder.getColorScheme(),this.colorCommand.equals("inherit")?this.colorCommand="#inherit;":null!=this.colorCommand&&(this.colorCommand="color $"+(JU.PT.isLetter(this.thisID.charAt(0))&&0>this.thisID.indexOf(" ")?this.thisID:'"'+this.thisID+'"')+' "'+this.colorCommand+'" range '+(this.jvxlData.isColorReversed?this.jvxlData.valueMappedToBlue+" "+this.jvxlData.valueMappedToRed:this.jvxlData.valueMappedToRed+" "+this.jvxlData.valueMappedToBlue)))}); e(c$,"setColorsFromJvxlData",function(a){this.diameter=this.jvxlData.diameter;-1!=a&&(-2147483648!=a&&2147483647!=a?this.colix=JU.C.getColix(a):null!=this.jvxlData.color&&(this.colix=JU.C.getColixS(this.jvxlData.color)));0==this.colix&&(this.colix=5);this.colix=JU.C.getColixTranslucent3(this.colix,0!=this.jvxlData.translucency,this.jvxlData.translucency);a=0==this.jvxlData.translucency?NaN:this.jvxlData.translucency;null!=this.jvxlData.meshColor&&(this.meshColix=JU.C.getColixS(this.jvxlData.meshColor)); this.setJvxlDataRendering();this.isColorSolid=!this.jvxlData.isBicolorMap&&null==this.jvxlData.vertexColors&&null==this.jvxlData.vertexColorMap;if(null==this.colorEncoder)return!1;if(null==this.jvxlData.vertexColorMap){if(null!=this.jvxlData.colorScheme){var b=this.jvxlData.colorScheme,c=b.startsWith("translucent ");c&&(b=b.substring(12),a=NaN);this.colorEncoder.setColorScheme(b,c);this.remapColors(null,null,a)}}else{if(null!=this.jvxlData.baseColor)for(a=this.vc;0<=--a;)this.vcs[a]=this.colix;for(c= this.jvxlData.vertexColorMap.entrySet().iterator();c.hasNext()&&((b=c.next())||1);){var d=b.getValue(),e=JU.C.copyColixTranslucency(this.colix,JU.C.getColixS(b.getKey()));for(a=d.nextSetBit(0);0<=a;a=d.nextSetBit(a+1))this.vcs[a]=e}}return!0},"~N");e(c$,"setJvxlDataRendering",function(){if(null!=this.jvxlData.rendering)for(var a=JU.PT.getTokens(this.jvxlData.rendering),b=0;b<a.length;b++)this.setTokenProperty(JS.T.getTokFromName(a[b]),!0)});e(c$,"remapColors",function(a,b,c){null==b&&(b=this.colorEncoder); null==b&&(b=this.colorEncoder=new JU.ColorEncoder(null,a));this.colorEncoder=b;this.setColorCommand();Float.isNaN(c)?c=JU.C.getColixTranslucencyLevel(this.colix):this.colix=JU.C.getColixTranslucent3(this.colix,!0,c);var d=b.lo,e=b.hi,f=null!=this.vertexSource&&15==b.currentPalette;this.pcs=this.vertexColorMap=null;this.colorsExplicit=!1;this.jvxlData.baseColor=null;this.jvxlData.vertexCount=this.vc;if(!(null==this.vvs||0==this.jvxlData.vertexCount))if((null==this.vcs||this.vcs.length!=this.vc)&&this.allocVertexColixes(), f){this.jvxlData.vertexDataOnly=!0;this.jvxlData.vertexColors=p(this.vc,0);this.jvxlData.nVertexColors=this.vc;b=a.ms.at;c=a.gdata;for(a=this.mergeVertexCount0;a<this.vc;a++)d=this.vertexSource[a],0<=d&&d<b.length&&(this.jvxlData.vertexColors[a]=c.getColorArgbOrGray(this.vcs[a]=JU.C.copyColixTranslucency(this.colix,b[d].colixAtom)))}else if(this.jvxlData.vertexColors=null,this.jvxlData.vertexColorMap=null,this.jvxlData.isBicolorMap)for(a=this.mergeVertexCount0;a<this.vc;a++)this.vcs[a]=JU.C.copyColixTranslucency(this.colix, 0>this.vvs[a]?this.jvxlData.minColorIndex:this.jvxlData.maxColorIndex);else{this.jvxlData.isColorReversed=b.isReversed;3.4028235E38!=e&&(this.jvxlData.valueMappedToRed=d,this.jvxlData.valueMappedToBlue=e);b.setRange(this.jvxlData.valueMappedToRed,this.jvxlData.valueMappedToBlue,this.jvxlData.isColorReversed);d=JU.C.isColixTranslucent(this.colix);b.isTranslucent&&(d||(this.colix=JU.C.getColixTranslucent3(this.colix,!0,0.5)),d=!1);this.vcs=JU.AU.ensureLengthShort(this.vcs,this.vc);for(a=this.vc;--a>= this.mergeVertexCount0;)this.vcs[a]=b.getColorIndex(this.vvs[a]);this.setTranslucent(d,c);this.colorEncoder=b;c=this.getContours();if(null!=c)for(a=c.length;0<=--a;)d=c[a].get(2).floatValue(),e=c[a].get(3),e[0]=b.getColorIndex(d),c[a].get(4)[0]=JU.C.getArgb(e[0]);if(null!=this.contourValues){this.contourColixes=Z(this.contourValues.length,0);for(a=0;a<this.contourValues.length;a++)this.contourColixes[a]=b.getColorIndex(this.contourValues[a]);this.setDiscreteColixes(null,null)}this.jvxlData.isJvxlPrecisionColor= !0;J.jvxl.data.JvxlCoder.jvxlCreateColorData(this.jvxlData,this.vvs);this.setColorCommand();this.isColorSolid=!1}},"JV.Viewer,JU.ColorEncoder,~N");e(c$,"reinitializeLightingAndColor",function(a){this.initialize(this.lighting,null,null);if(null!=this.colorEncoder||this.jvxlData.isBicolorMap)this.vcs=null,this.remapColors(a,null,NaN)},"JV.Viewer");j(c$,"getBoundingBox",function(){return this.jvxlData.boundingBox});j(c$,"setBoundingBox",function(a){this.jvxlData.boundingBox=a},"~A");e(c$,"merge",function(a){var b= this.vc+(null==a?0:a.vc);null==this.pis&&(this.pis=p(0,0,0));null!=a&&null==a.pis&&(a.pis=p(0,0,0));var c=(null==this.bsSlabDisplay||0==this.pc?this.pc:this.bsSlabDisplay.cardinality())+(null==a||0==a.pc?0:null==a.bsSlabDisplay?a.pc:a.bsSlabDisplay.cardinality());null==this.vs&&(this.vs=[]);this.vs=JU.AU.ensureLength(this.vs,b);this.vvs=JU.AU.ensureLengthA(this.vvs,b);var d=null!=this.vertexSource&&(null==a||null!=a.vertexSource);this.vertexSource=JU.AU.ensureLengthI(this.vertexSource,b);var e=JU.AU.newInt2(c), f=J.shapesurface.IsosurfaceMesh.mergePolygons(this,0,0,e);if(null!=a){J.shapesurface.IsosurfaceMesh.mergePolygons(a,f,this.vc,e);for(f=0;f<a.vc;f++,this.vc++)this.vs[this.vc]=a.vs[f],this.vvs[this.vc]=a.vvs[f],d&&(this.vertexSource[this.vc]=a.vertexSource[f])}this.pc=this.polygonCount0=c;this.vc=this.vertexCount0=b;0<c&&this.resetSlab();this.pis=e},"J.jvxl.data.MeshData");c$.mergePolygons=e(c$,"mergePolygons",function(a,b,c,d){for(var e,f=0;f<a.pc;f++)if(!(null==(e=a.pis[f])||null!=a.bsSlabDisplay&& !a.bsSlabDisplay.get(f)))if(d[b++]=a.pis[f],0<c)for(var g=0;3>g;g++)e[g]+=c;return b},"JU.MeshSurface,~N,~N,~A");j(c$,"getUnitCell",function(){return null!=this.unitCell||null!=(this.unitCell=this.vwr.ms.am[this.modelIndex].biosymmetry)||null!=(this.unitCell=this.vwr.ms.getUnitCell(this.modelIndex))||null!=this.spanningVectors&&null!=(this.unitCell=J.api.Interface.getSymmetry(this.vwr,"symmetry").getUnitCell(this.spanningVectors,!0,null))?this.unitCell:null});e(c$,"fixLattice",function(){if(null!= this.getUnitCell()){var a=new JU.P3i,b=JU.P3i.new3(y(this.lattice.x),y(this.lattice.y),y(this.lattice.z));this.jvxlData.fixedLattice=this.lattice;this.lattice=null;this.unitCell.setMinMaxLatticeParameters(a,b);var c=(b.x-a.x)*(b.y-a.y)*(b.z-a.z),d=new JU.P3,e=this.vc,f=c*this.vc;this.vs=JU.AU.arrayCopyPt(this.vs,f);this.vvs=null==this.vvs?null:JU.AU.ensureLengthA(this.vvs,f);var g=this.pc;this.pis=JU.AU.arrayCopyII(this.pis,c*this.pc);c=0;this.normixes=JU.AU.arrayCopyShort(this.normixes,f);for(f= a.x;f<b.x;f++)for(var j=a.y;j<b.y;j++)for(var p=a.z;p<b.z;p++)if(!(0==f&&0==j&&0==p)){d.set(f,j,p);this.unitCell.toCartesian(d,!1);for(var k=0;k<e;k++){this.normixes[this.vc]=this.normixes[k];var n=JU.P3.newP(this.vs[k]);n.add(d);this.addVCVal(n,this.vvs[k],!1)}c+=e;for(k=0;k<g;k++)n=JU.AU.arrayCopyI(this.pis[k],-1),n[0]+=c,n[1]+=c,n[2]+=c,this.addPolygon(n,null)}a=new JU.P3;b=new JU.P3;this.setBox(a,b);this.jvxlData.boundingBox=w(-1,[a,b])}});j(c$,"getMinDistance2ForVertexGrouping",function(){return null!= this.jvxlData.boundingBox&&null!=this.jvxlData.boundingBox[0]&&5>this.jvxlData.boundingBox[1].distanceSquared(this.jvxlData.boundingBox[0])?1E-10:1E-8});j(c$,"getVisibleVertexBitSet",function(){var a=this.getVisibleVBS();if(0<=this.jvxlData.thisSet)for(var b=0;b<this.vc;b++)this.vertexSets[b]!=this.jvxlData.thisSet&&a.clear(b);return a});e(c$,"updateCoordinates",function(a,b){var c=null==b;if(!c)for(var d=0;d<this.connections.length;d++)if(0<=this.connections[d]&&b.get(this.connections[d])){c=!0; break}c&&(null==this.mat4&&(this.mat4=JU.M4.newM4(null)),this.mat4.mul2(a,this.mat4),this.recalcAltVertices=!0)},"JU.M4,JU.BS")});H("J.jvxl.readers");K(["J.jvxl.readers.SurfaceReader"],"J.jvxl.readers.VolumeDataReader",["java.lang.Float","JU.AU","$.SB","J.jvxl.data.JvxlCoder","JU.Logger"],function(){c$=C(function(){this.dataType=0;this.allowMapData=this.precalculateVoxelData=!1;this.point=null;this.maxGrid=this.ptsPerAngstrom=0;this.useOriginStepsPoints=!1;G(this,arguments)},J.jvxl.readers,"VolumeDataReader", J.jvxl.readers.SurfaceReader);Q(c$,function(){Y(this,J.jvxl.readers.VolumeDataReader,[])});j(c$,"init",function(a){this.initVDR(a)},"J.jvxl.readers.SurfaceGenerator");e(c$,"initVDR",function(a){this.initSR(a);this.useOriginStepsPoints=null!=this.params.origin&&null!=this.params.points&&null!=this.params.steps;this.dataType=this.params.dataType;this.allowMapData=this.precalculateVoxelData=!0},"J.jvxl.readers.SurfaceGenerator");e(c$,"setup",function(){this.jvxlFileHeaderBuffer=(new JU.SB).append("volume data read from file\n\n"); J.jvxl.data.JvxlCoder.jvxlCreateHeaderWithoutTitleOrAtoms(this.volumeData,this.jvxlFileHeaderBuffer)},"~B");j(c$,"readVolumeParameters",function(a){this.setup(a);this.initializeVolumetricData();return!0},"~B");j(c$,"readVolumeData",function(a){try{this.readSurfaceData(a)}catch(b){if(U(b,Exception))return System.out.println(b.toString()),!1;throw b;}return!0},"~B");e(c$,"readVoxelDataIndividually",function(a){if(!a||this.allowMapData)if(!a||null!=this.volumeData.sr)this.volumeData.setVoxelDataAsArray(this.voxelData= null);else{this.newVoxelDataCube();for(a=0;a<this.nPointsX;++a){var b=JU.AU.newFloat2(this.nPointsY);this.voxelData[a]=b;for(var c=0,d=0;d<this.nPointsY;++d)for(var e=b[d]=u(this.nPointsZ,0),f=0;f<this.nPointsZ;++f,++c)e[f]=this.getValue(a,d,f,c)}}},"~B");e(c$,"setVolumeData",function(){});e(c$,"setVolumeDataParams",function(){if(null!=this.params.volumeData)return this.setVolumeDataV(this.params.volumeData),!0;if(!this.useOriginStepsPoints)return!1;this.volumetricOrigin.setT(this.params.origin); this.volumetricVectors[0].set(this.params.steps.x,0,0);this.volumetricVectors[1].set(0,this.params.steps.y,0);this.volumetricVectors[2].set(0,0,this.params.steps.z);this.voxelCounts[0]=y(this.params.points.x);this.voxelCounts[1]=y(this.params.points.y);this.voxelCounts[2]=y(this.params.points.z);if(1>this.voxelCounts[0]||1>this.voxelCounts[1]||1>this.voxelCounts[2])return!1;this.showGridInfo();return!0});e(c$,"showGridInfo",function(){JU.Logger.info("grid origin = "+this.params.origin);JU.Logger.info("grid steps = "+ this.params.steps);JU.Logger.info("grid points = "+this.params.points);this.ptTemp.x=this.params.steps.x*this.params.points.x;this.ptTemp.y=this.params.steps.y*this.params.points.y;this.ptTemp.z=this.params.steps.z*this.params.points.z;JU.Logger.info("grid lengths = "+this.ptTemp);this.ptTemp.add(this.params.origin);JU.Logger.info("grid max xyz = "+this.ptTemp)});e(c$,"setVoxelRange",function(a,b,c,d,e,f){b>=c&&(b=-10,c=10);var g=c-b,j=this.params.resolution;3.4028235E38!=j&&(d=j);c=E(Math.floor(g* d))+1;c>e&&(0<(this.dataType&256)?3.4028235E38==j?(this.isQuiet||JU.Logger.info("Maximum number of voxels for index="+a+" exceeded ("+c+") -- set to "+e),c=e):this.isQuiet||JU.Logger.info("Warning -- high number of grid points: "+c):3.4028235E38==j&&(c=e));d=(c-1)/g;d<f&&(c=E(Math.floor(f*g+1)),d=(c-1)/g);e=this.volumeData.volumetricVectorLengths[a]=1/d;this.voxelCounts[a]=c;this.isQuiet||JU.Logger.info("isosurface resolution for axis "+(a+1)+" set to "+d+" points/Angstrom; "+this.voxelCounts[a]+ " voxels");switch(a){case 0:this.volumetricVectors[0].set(e,0,0);this.volumetricOrigin.x=b;break;case 1:this.volumetricVectors[1].set(0,e,0);this.volumetricOrigin.y=b;break;case 2:this.volumetricVectors[2].set(0,0,e),this.volumetricOrigin.z=b,this.isEccentric&&this.eccentricityMatrix.rotate(this.volumetricOrigin),null!=this.center&&!Float.isNaN(this.center.x)&&this.volumetricOrigin.add(this.center)}this.isEccentric&&this.eccentricityMatrix.rotate(this.volumetricVectors[a]);return this.voxelCounts[a]}, "~N,~N,~N,~N,~N,~N");j(c$,"readSurfaceData",function(a){this.readSurfaceDataVDR(a)},"~B");e(c$,"readSurfaceDataVDR",function(a){this.isProgressive&&!a?(this.nDataPoints=this.volumeData.setVoxelCounts(this.nPointsX,this.nPointsY,this.nPointsZ),this.voxelData=null):this.precalculateVoxelData?this.generateCube():this.readVoxelDataIndividually(a)},"~B");e(c$,"generateCube",function(){JU.Logger.info("data type: user volumeData");JU.Logger.info("voxel grid origin:"+this.volumetricOrigin);for(var a=0;3> a;++a)JU.Logger.info("voxel grid vector:"+this.volumetricVectors[a]);JU.Logger.info("Read "+this.nPointsX+" x "+this.nPointsY+" x "+this.nPointsZ+" data points")});j(c$,"closeReader",function(){})});H("J.jvxl.readers");K(["J.jvxl.readers.VolumeDataReader","JU.BS","$.P3","$.P3i","J.atomdata.AtomData"],"J.jvxl.readers.AtomDataReader","java.lang.Float java.util.Date JU.AU $.SB $.V3 J.atomdata.RadiusData J.c.VDW J.jvxl.data.JvxlCoder JU.BSUtil $.Logger".split(" "),function(){c$=C(function(){this.maxDistance= 0;this.fileDotModel=this.fileName=this.contactPair=null;this.modelIndex=0;this.myIndex=this.atomIndex=this.atomNo=this.atomProp=this.atomRadius=this.atomXyz=this.atomData=null;this.firstNearbyAtom=this.nearbyAtomCount=this.myAtomCount=this.ac=0;this.bsNearby=this.bsMyIgnored=this.bsMySelected=null;this.doUseIterator=this.havePlane=this.doAddHydrogens=!1;this.theProperty=0;this.haveOneProperty=!1;this.sr=this.minPtsPerAng=0;this.rs2=this.rs=null;this.maxRS=0;this.thisAtomSet=this.thisPlane=null;this.vl2= this.vl1=this.vl0=this.margin=this.thisX=0;this.ptV=this.pt1=this.pt0=this.ptZ0=this.ptY0=this.voxelSource=this.noFaceSpheres=this.validSpheres=this.bsSurfaceVoxels=null;G(this,arguments)},J.jvxl.readers,"AtomDataReader",J.jvxl.readers.VolumeDataReader);W(c$,function(){this.atomData=new J.atomdata.AtomData;this.bsMySelected=new JU.BS;this.bsMyIgnored=new JU.BS;this.ptY0=new JU.P3;this.ptZ0=new JU.P3;this.pt0=new JU.P3i;this.pt1=new JU.P3i;this.ptV=new JU.P3});Q(c$,function(){Y(this,J.jvxl.readers.AtomDataReader, [])});e(c$,"initADR",function(a){this.initVDR(a);this.precalculateVoxelData=!0},"J.jvxl.readers.SurfaceGenerator");j(c$,"setup",function(){this.setup2()},"~B");e(c$,"setup2",function(){this.contactPair=this.params.contactPair;this.doAddHydrogens=null!=this.sg.atomDataServer&&this.params.addHydrogens;this.modelIndex=this.params.modelIndex;null!=this.params.bsIgnore&&(this.bsMyIgnored=this.params.bsIgnore);if(null!=this.params.volumeData){this.setVolumeDataV(this.params.volumeData);this.setBBox(this.volumeData.volumetricOrigin, 0);this.ptV.setT(this.volumeData.volumetricOrigin);for(var a=0;3>a;a++)this.ptV.scaleAdd2(this.volumeData.voxelCounts[a]-1,this.volumeData.volumetricVectors[a],this.ptV);this.setBBox(this.ptV,0)}(this.havePlane=null!=this.params.thePlane)&&this.volumeData.setPlaneParameters(this.params.thePlane)});e(c$,"markPlaneVoxels",function(a,b){for(var c=0,d=this.thisX*this.yzCount,e=d+this.yzCount;d<e;d++,c++)this.volumeData.getPoint(d,this.ptV),this.thisPlane[c]=this.ptV.distance(a)-b},"JU.P3,~N");e(c$,"setVolumeForPlane", function(){this.useOriginStepsPoints?(this.xyzMin=JU.P3.newP(this.params.origin),this.xyzMax=JU.P3.newP(this.params.origin),this.xyzMax.add3((this.params.points.x-1)*this.params.steps.x,(this.params.points.y-1)*this.params.steps.y,(this.params.points.z-1)*this.params.steps.z)):null==this.params.boundingBox?(this.getAtoms(this.params.bsSelected,!1,!0,!1,!1,!1,!1,this.params.mep_marginAngstroms),null==this.xyzMin&&(this.xyzMin=JU.P3.new3(-10,-10,-10),this.xyzMax=JU.P3.new3(10,10,10))):(this.xyzMin= JU.P3.newP(this.params.boundingBox[0]),this.xyzMax=JU.P3.newP(this.params.boundingBox[1]));this.setRanges(this.params.plane_ptsPerAngstrom,this.params.plane_gridMax,0)});e(c$,"getAtoms",function(a,b,c,d,e,f,g,j){f&&(c=!0);c&&(null==this.params.atomRadiusData&&(this.params.atomRadiusData=new J.atomdata.RadiusData(null,1,J.atomdata.RadiusData.EnumType.FACTOR,J.c.VDW.AUTO)),this.atomData.radiusData=this.params.atomRadiusData,this.atomData.radiusData.valueExtended=this.params.solventExtendedAtomRadius, b&&(this.atomData.radiusData.vdwType=J.c.VDW.NOJMOL));this.atomData.modelIndex=this.modelIndex;this.atomData.bsSelected=a;this.atomData.bsIgnored=this.bsMyIgnored;this.sg.fillAtomData(this.atomData,1|(e?16:0)|(d?4:0)|(c?2:0));this.doUseIterator&&(this.atomData.bsSelected=null);this.ac=this.atomData.ac;this.modelIndex=this.atomData.firstModelIndex;e=!1;for(d=0;d<this.ac;d++){if((null==a||a.get(d))&&!this.bsMyIgnored.get(d)){if(this.havePlane&&Math.abs(this.volumeData.distancePointToPlane(this.atomData.atomXyz[d]))> 2*(this.atomData.atomRadius[d]=this.getWorkingRadius(d,j)))continue;this.bsMySelected.set(d);e=!this.havePlane}if(c&&(f||e))this.atomData.atomRadius[d]=this.getWorkingRadius(d,j)}e=c&&b?this.getWorkingRadius(-1,j):0;this.myAtomCount=JU.BSUtil.cardinalityOf(this.bsMySelected);j=JU.BSUtil.copy(this.bsMySelected);g=0;this.atomProp=null;this.theProperty=3.4028235E38;this.haveOneProperty=!1;a=this.params.theProperty;if(0<this.myAtomCount){var Oa=null;if(b){this.atomData.bsSelected=j;this.sg.atomDataServer.fillAtomData(this.atomData, 8);Oa=Array(g=this.atomData.hydrogenAtomCount);for(d=0;d<this.atomData.hAtoms.length;d++)if(null!=this.atomData.hAtoms[d])for(b=this.atomData.hAtoms[d].length;0<=--b;)Oa[--g]=this.atomData.hAtoms[d][b];g=Oa.length;JU.Logger.info(g+" attached hydrogens added")}b=g+this.myAtomCount;c&&(this.atomRadius=u(b,0));this.atomXyz=Array(b);null!=this.params.theProperty&&(this.atomProp=u(b,0));this.atomNo=p(b,0);this.atomIndex=p(b,0);this.myIndex=p(this.ac,0);for(d=0;d<g;d++)c&&(this.atomRadius[d]=e),this.atomXyz[d]= Oa[d],this.atomNo[d]=-1,null!=this.atomProp&&this.addAtomProp(d,NaN);this.myAtomCount=g;for(d=j.nextSetBit(0);0<=d;d=j.nextSetBit(d+1))null!=this.atomProp&&this.addAtomProp(this.myAtomCount,null!=a&&d<a.length?a[d]:NaN),this.atomXyz[this.myAtomCount]=this.atomData.atomXyz[d],this.atomNo[this.myAtomCount]=this.atomData.atomicNumber[d],this.atomIndex[this.myAtomCount]=d,this.myIndex[d]=this.myAtomCount,c&&(this.atomRadius[this.myAtomCount]=this.atomData.atomRadius[d]),this.myAtomCount++}this.firstNearbyAtom= this.myAtomCount;JU.Logger.info(this.myAtomCount+" atoms will be used in the surface calculation");0==this.myAtomCount&&(this.setBBox(JU.P3.new3(10,10,10),0),this.setBBox(JU.P3.new3(-10,-10,-10),0));for(d=0;d<this.myAtomCount;d++)this.setBBox(this.atomXyz[d],c?this.atomRadius[d]+0.5:0);Float.isNaN(this.params.scale)||(b=JU.V3.newVsub(this.xyzMax,this.xyzMin),b.scale(0.5),this.xyzMin.add(b),b.scale(this.params.scale),this.xyzMax.add2(this.xyzMin,b),this.xyzMin.sub(b));if(f&&0!=this.myAtomCount){f= new JU.P3;this.bsNearby=new JU.BS;for(d=0;d<this.ac;d++)!j.get(d)&&!this.bsMyIgnored.get(d)&&(b=this.atomData.atomRadius[d],null!=this.params.thePlane&&Math.abs(this.volumeData.distancePointToPlane(this.atomData.atomXyz[d]))>2*b||(null!=this.params.theProperty&&(b+=this.maxDistance),f=this.atomData.atomXyz[d],f.x+b>this.xyzMin.x&&(f.x-b<this.xyzMax.x&&f.y+b>this.xyzMin.y&&f.y-b<this.xyzMax.y&&f.z+b>this.xyzMin.z&&f.z-b<this.xyzMax.z)&&(this.bsNearby.set(d),this.nearbyAtomCount++)));f=this.myAtomCount; if(0!=this.nearbyAtomCount){f+=this.nearbyAtomCount;this.atomRadius=JU.AU.arrayCopyF(this.atomRadius,f);this.atomXyz=JU.AU.arrayCopyObject(this.atomXyz,f);null!=this.atomIndex&&(this.atomIndex=JU.AU.arrayCopyI(this.atomIndex,f));null!=a&&(this.atomProp=JU.AU.arrayCopyF(this.atomProp,f));for(d=this.bsNearby.nextSetBit(0);0<=d;d=this.bsNearby.nextSetBit(d+1))null!=a&&this.addAtomProp(this.myAtomCount,a[d]),this.myIndex[d]=this.myAtomCount,this.atomIndex[this.myAtomCount]=d,this.atomXyz[this.myAtomCount]= this.atomData.atomXyz[d],this.atomRadius[this.myAtomCount++]=this.atomData.atomRadius[d]}c&&this.setRadii();this.haveOneProperty=!Float.isNaN(this.theProperty)}},"JU.BS,~B,~B,~B,~B,~B,~B,~N");e(c$,"setRadii",function(){if(null==this.rs){this.maxRS=0;this.rs=u(this.myAtomCount,0);this.rs2=u(this.myAtomCount,0);for(var a=0;a<this.myAtomCount;a++){var b=this.rs[a]=this.atomRadius[a]+this.sr;b>this.maxRS&&(this.maxRS=b);this.rs2[a]=this.rs[a]*this.rs[a]}}});e(c$,"addAtomProp",function(a,b){this.atomProp[a]= b;!Float.isNaN(this.theProperty)&&b!=this.theProperty&&(this.theProperty=3.4028235E38==this.theProperty?b:NaN)},"~N,~N");e(c$,"getWorkingRadius",function(a,b){var c=0>a?this.atomData.hAtomRadius:this.atomData.atomRadius[a];return Float.isNaN(b)?Math.max(c,0.1):c+b},"~N,~N");e(c$,"setHeader",function(a,b){this.jvxlFileHeaderBuffer=new JU.SB;null!=this.atomData.programInfo&&this.jvxlFileHeaderBuffer.append("#created by ").append(this.atomData.programInfo).append(" on ").append(""+new java.util.Date).append("\n"); this.jvxlFileHeaderBuffer.append(a).append("\n").append(b).append("\n")},"~S,~S");e(c$,"setRanges",function(a,b,c){null!=this.xyzMin&&(this.ptsPerAngstrom=a,this.maxGrid=b,this.minPtsPerAng=c,this.setVolumeData(),J.jvxl.data.JvxlCoder.jvxlCreateHeader(this.volumeData,this.jvxlFileHeaderBuffer))},"~N,~N,~N");j(c$,"setVolumeData",function(){this.setVolumeDataADR()});e(c$,"setVolumeDataADR",function(){this.setVolumeDataParams()||(this.setVoxelRange(0,this.xyzMin.x,this.xyzMax.x,this.ptsPerAngstrom,this.maxGrid, this.minPtsPerAng),this.setVoxelRange(1,this.xyzMin.y,this.xyzMax.y,this.ptsPerAngstrom,this.maxGrid,this.minPtsPerAng),this.setVoxelRange(2,this.xyzMin.z,this.xyzMax.z,this.ptsPerAngstrom,this.maxGrid,this.minPtsPerAng))});e(c$,"setVertexSource",function(){null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,1,null);if(null!=this.params.vertexSource){this.params.vertexSource=JU.AU.arrayCopyI(this.params.vertexSource,this.meshData.vc);for(var a=0;a<this.meshData.vc;a++)this.params.vertexSource[a]= Math.abs(this.params.vertexSource[a])-1}});e(c$,"resetPlane",function(a){for(var b=0;b<this.yzCount;b++)this.thisPlane[b]=a},"~N");e(c$,"resetVoxelData",function(a){for(var b=0;b<this.nPointsX;++b)for(var c=0;c<this.nPointsY;++c)for(var d=0;d<this.nPointsZ;++d)this.voxelData[b][c][d]=a},"~N");e(c$,"getVoxel",function(a,b,c,d){return this.isProgressive?this.thisPlane[d%this.yzCount]:this.voxelData[a][b][c]},"~N,~N,~N,~N");e(c$,"unsetVoxelData",function(){this.unsetVoxelData2()});e(c$,"unsetVoxelData2", function(){if(this.isProgressive)for(var a=0;a<this.yzCount;a++)3.4028235E38==this.thisPlane[a]&&(this.thisPlane[a]=NaN);else for(a=0;a<this.nPointsX;++a)for(var b=0;b<this.nPointsY;++b)for(var c=0;c<this.nPointsZ;++c)3.4028235E38==this.voxelData[a][b][c]&&(this.voxelData[a][b][c]=NaN)});e(c$,"setGridLimitsForAtom",function(a,b,c,d){b+=this.margin;this.volumeData.xyzToVoxelPt(a.x,a.y,a.z,c);a=E(Math.floor(b/this.volumeData.volumetricVectorLengths[0]));var e=E(Math.floor(b/this.volumeData.volumetricVectorLengths[1])); b=E(Math.floor(b/this.volumeData.volumetricVectorLengths[2]));d.set(c.x+a,c.y+e,c.z+b);c.set(c.x-a,c.y-e,c.z-b);c.x=Math.max(c.x-1,0);c.y=Math.max(c.y-1,0);c.z=Math.max(c.z-1,0);d.x=Math.min(d.x+1,this.nPointsX);d.y=Math.min(d.y+1,this.nPointsY);d.z=Math.min(d.z+1,this.nPointsZ)},"JU.P3,~N,JU.P3i,JU.P3i");e(c$,"getAtomMinMax",function(a,b){for(var c=0;c<this.nPointsX;c++)b[c]=new JU.BS;for(var d=this.myAtomCount;0<=--d;)if(null==a||a.get(d)){this.setGridLimitsForAtom(this.atomXyz[d],this.atomRadius[d], this.pt0,this.pt1);for(c=this.pt0.x;c<this.pt1.x;c++)b[c].set(d)}},"JU.BS,~A");e(c$,"markSphereVoxels",function(a,b){for(var c=3.4028235E38!=b&&null!=this.point,d=this.volumetricVectors[0],e=this.volumetricVectors[1],f=this.volumetricVectors[2],g=this.thisAtomSet.nextSetBit(0);0<=g;g=this.thisAtomSet.nextSetBit(g+1))if(this.havePlane||null==this.validSpheres||this.validSpheres.get(g)){var j=null!=this.noFaceSpheres&&this.noFaceSpheres.get(g),p=g>=this.firstNearbyAtom,k=this.atomXyz[g],n=this.atomRadius[g]; if(!(c&&k.distance(this.point)>b+n+0.5)){var q=n+a;this.setGridLimitsForAtom(k,q,this.pt0,this.pt1);this.isProgressive&&(this.pt0.x=this.thisX,this.pt1.x=this.thisX+1);this.volumeData.voxelPtToXYZ(this.pt0.x,this.pt0.y,this.pt0.z,this.ptV);for(var t=this.pt0.x;t<this.pt1.x;t++,this.ptV.add2(d,this.ptY0)){this.ptY0.setT(this.ptV);for(var r=this.pt0.y;r<this.pt1.y;r++,this.ptV.add2(e,this.ptZ0)){this.ptZ0.setT(this.ptV);for(var u=this.pt0.z;u<this.pt1.z;u++,this.ptV.add(f)){var y=this.ptV.distance(k)- n,w=this.volumeData.getPointIndex(t,r,u);if((0==a||y<=q)&&y<this.getVoxel(t,r,u,w)){if(p||c&&this.ptV.distance(this.point)>b)y=NaN;this.setVoxel(t,r,u,w,y);Float.isNaN(y)||(null!=this.voxelSource&&(this.voxelSource[w]=g+1),0>y&&j&&this.bsSurfaceVoxels.set(w))}}}}}}},"~N,~N");e(c$,"setVoxel",function(a,b,c,d,e){this.isProgressive?this.thisPlane[d%this.yzCount]=e:this.voxelData[a][b][c]=e},"~N,~N,~N,~N,~N")});H("J.jvxl.readers");K(["JU.P3","J.jvxl.readers.AtomDataReader","JU.P4","$.V3"],"J.jvxl.readers.IsoSolventReader", "java.lang.Float java.util.Hashtable JU.BS $.Lst $.Measure J.jvxl.data.MeshData JU.BSUtil $.Logger $.MeshSurface $.TempArray".split(" "),function(){c$=C(function(){this.envelopeRadius=this.cavityRadius=0;this.dots=null;this.isPocket=this.isCavity=this.doCalculateTroughs=!1;this.bsAtomMinMax=this.p=this.vTemp2=this.ptTemp2=this.plane=this.vTemp=this.ptS2=this.ptS1=this.vFaces=this.vEdges=this.htEdges=this.bsLocale=this.bsSurfaceDone=this.bsSurfacePoints=this.iter=null;this.isSurfacePoint=!1;this.nTest= this.iAtomSurface=0;na("J.jvxl.readers.IsoSolventReader.Edge")||J.jvxl.readers.IsoSolventReader.$IsoSolventReader$Edge$();na("J.jvxl.readers.IsoSolventReader.Face")||J.jvxl.readers.IsoSolventReader.$IsoSolventReader$Face$();this.ecosASB2=this.dAB2=this.dAB=this.rBS2=this.rAS2=this.rBS=this.rAS=0;G(this,arguments)},J.jvxl.readers,"IsoSolventReader",J.jvxl.readers.AtomDataReader);W(c$,function(){this.ptS1=new JU.P3;this.ptS2=new JU.P3;this.vTemp=new JU.V3;this.plane=new JU.P4;this.ptTemp2=new JU.P3; this.vTemp2=new JU.V3;this.p=new JU.P3});Q(c$,function(){Y(this,J.jvxl.readers.IsoSolventReader,[])});j(c$,"init",function(a){this.initADR(a)},"J.jvxl.readers.SurfaceGenerator");j(c$,"readVolumeParameters",function(a){this.setup(a);this.initializeVolumetricData();this.volumeData.setUnitVectors();this.vl0=this.volumeData.volumetricVectorLengths[0];this.vl1=this.volumeData.volumetricVectorLengths[1];this.vl2=this.volumeData.volumetricVectorLengths[2];this.isProgressive&&(this.volumeData.getYzCount(), this.bsAtomMinMax=Array(this.nPointsX),this.getAtomMinMax(null,this.bsAtomMinMax),this.voxelSource=p(this.volumeData.nPoints,0));return!0},"~B");j(c$,"setup",function(a){this.setup2();if(null==this.contactPair){this.cavityRadius=this.params.cavityRadius;this.envelopeRadius=this.params.envelopeRadius;this.sr=this.params.solventRadius;this.point=this.params.point;this.isCavity=this.params.isCavity&&null!=this.meshDataServer;this.isPocket=null!=this.params.pocket&&null!=this.meshDataServer;this.doUseIterator= this.doCalculateTroughs=!a&&null!=this.sg.atomDataServer&&!this.isCavity&&0<this.sr&&(1195==this.dataType||1203==this.dataType);this.getAtoms(this.params.bsSelected,this.doAddHydrogens,!0,!1,!1,!0,!1,NaN);if(this.isCavity||this.isPocket)this.dots=this.meshDataServer.calculateGeodesicSurface(this.bsMySelected,this.envelopeRadius);this.setHeader("solvent/molecular surface",this.params.calculationType);if(this.havePlane||!a)this.setRanges(this.params.solvent_ptsPerAngstrom,this.params.solvent_gridMax, 0),this.volumeData.getYzCount(),this.margin=2*this.volumeData.maxGrid;null!=this.bsNearby&&this.bsMySelected.or(this.bsNearby)}else a||this.setVolumeData();this.doCalculateTroughs||(a?(this.precalculateVoxelData=!1,this.volumeData.sr=this):this.isCavity||(this.isProgressive=this.isXLowToHigh=!0));null==this.thisAtomSet&&(this.thisAtomSet=JU.BSUtil.setAll(this.myAtomCount))},"~B");j(c$,"generateCube",function(){if(!(this.isCavity&&null!=this.params.theProperty)){this.isCavity&&1205!=this.dataType&& 1206!=this.dataType?(this.params.vertexSource=null,this.newVoxelDataCube(),this.resetVoxelData(3.4028235E38),this.markSphereVoxels(this.cavityRadius,this.params.distance),this.generateSolventCavity(),this.resetVoxelData(3.4028235E38),this.markSphereVoxels(0,NaN)):(this.voxelSource=p(this.volumeData.nPoints,0),this.generateSolventCube());this.unsetVoxelData();var a=this.params.slabInfo;if(null!=a)for(var b=0;b<a.size();b++)a.get(b)[2].booleanValue()&&V(a.get(b)[0],JU.P4)&&(this.volumeData.capData(a.get(b)[0], this.params.cutoff),a.remove(b--))}});j(c$,"getSurfacePointAndFraction",function(a,b,c,d,e,f,g,j,p,k,n,q,t){k=this.marchingCubes.getLinearOffset(g,j,p,k);n=this.marchingCubes.getLinearOffset(g,j,p,n);this.isSurfacePoint=null!=this.bsSurfaceVoxels&&(this.bsSurfaceVoxels.get(k)||this.bsSurfaceVoxels.get(n));if(null!=this.voxelSource){var r=Math.abs(Float.isNaN(d)||c<d?this.voxelSource[k]:this.voxelSource[n]);0<r&&(this.iAtomSurface=this.atomIndex[r-1])}if(J.jvxl.readers.IsoSolventReader.testLinear|| null==this.voxelSource||0==this.voxelSource[k]||this.voxelSource[k]!=this.voxelSource[n])return this.getSPF(a,b,c,d,e,f,g,j,p,k,n,q,t);a=q[0]=JU.MeshSurface.getSphericalInterpolationFraction(0>this.voxelSource[k]?this.sr:this.atomRadius[this.voxelSource[k]-1],c,d,f.length());t.scaleAdd2(a,f,e);return c+a*(d-c)},"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");j(c$,"addVertexCopy",function(a,b,c,d){a=this.addVC(a,b,c,d);if(0>a)return a;this.isSurfacePoint&&this.bsSurfacePoints.set(a);null!=this.params.vertexSource&& (this.params.vertexSource[a]=this.iAtomSurface);return a},"JU.T3,~N,~N,~B");j(c$,"selectPocket",function(a){null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,1,null);for(var b=this.meshData.vs,c=this.meshData.vc,d=this.meshData.vvs,e=this.dots.length,f=0;f<c;f++)for(var g=0;g<e;g++)this.dots[g].distance(b[f])<this.envelopeRadius&&(d[f]=NaN);this.meshData.getSurfaceSet();b=this.meshData.nSets;c=JU.BS.newN(b);for(f=0;f<b;f++)if(null!=(d=this.meshData.surfaceSet[f]))for(g=d.nextSetBit(0);0<= g;g=d.nextSetBit(g+1))if(Float.isNaN(this.meshData.vvs[g])){c.set(f);break}for(f=0;f<b;f++)null!=this.meshData.surfaceSet[f]&&c.get(f)==a&&this.meshData.invalidateSurfaceSet(f);this.updateSurfaceData();a||(this.meshData.surfaceSet=null);null!=this.meshDataServer&&(this.meshDataServer.fillMeshData(this.meshData,3,null),this.meshData=new J.jvxl.data.MeshData)},"~B");j(c$,"postProcessVertices",function(){this.setVertexSource();if(this.doCalculateTroughs&&null!=this.bsSurfacePoints){var a=new JU.BS,b= this.meshData.getSurfaceSet(),c=null,d=this.isPocket?null:J.jvxl.data.MeshData.calculateVolumeOrArea(this.meshData,-2147483648,!1,!1),e=this.isCavity?4.71238898038469*Math.pow(this.sr,3):0,f=0,g=!1;if(null!=d&&!this.isCavity)for(var j=0;j<this.meshData.nSets;j++){var p=d[j];Math.abs(p)>f&&(f=Math.abs(p),g=0>p)}f=g?-1:1;for(j=0;j<this.meshData.nSets;j++)if(g=b[j],g.intersects(this.bsSurfacePoints)&&(null==d||d[j]*f>e)&&null!=this.params.vertexSource){p=new JU.BS;null==c&&(c=Array(b.length));for(var k= g.nextSetBit(0);0<=k;k=g.nextSetBit(k+1)){var n=this.params.vertexSource[k];if(!(0>n)){if(a.get(n)){this.meshData.invalidateSurfaceSet(j);break}p.set(n)}}a.or(p)}else this.meshData.invalidateSurfaceSet(j);this.updateSurfaceData();null!=this.meshDataServer&&(this.meshDataServer.fillMeshData(this.meshData,3,null),this.meshData=new J.jvxl.data.MeshData)}null!=this.params.thePlane&&null==this.params.slabInfo&&this.params.addSlabInfo(JU.TempArray.getSlabWithinRange(-100,0))});e(c$,"generateSolventCavity", function(){for(var a=JU.BS.newN(this.nPointsX*this.nPointsY*this.nPointsZ),b=0,c=this.dots.length,d=0,e,f=this.envelopeRadius,g=0;g<this.nPointsX;++g)for(var j=0;j<this.nPointsY;++j){var p=0;a:for(;p<this.nPointsZ;++p,++b)if(3.4028235E38>(e=this.voxelData[g][j][p])&&e>=this.cavityRadius){this.volumeData.voxelPtToXYZ(g,j,p,this.ptV);for(var k=0;k<c;k++)if(this.dots[k].distance(this.ptV)<f)continue a;a.set(b);d++}}JU.Logger.info("cavities include "+d+" voxel points");this.atomRadius=u(d,0);this.atomXyz= Array(d);for(c=b=g=0;g<this.nPointsX;++g)for(j=0;j<this.nPointsY;++j)for(p=0;p<this.nPointsZ;++p)a.get(b++)&&(this.volumeData.voxelPtToXYZ(g,j,p,this.atomXyz[c]=new JU.P3),this.atomRadius[c++]=this.voxelData[g][j][p]);this.myAtomCount=this.firstNearbyAtom=d;this.thisAtomSet=JU.BSUtil.setAll(this.myAtomCount);this.rs=null;this.setRadii()});e(c$,"generateSolventCube",function(){1205!=this.dataType&&(this.params.vertexSource=p(this.volumeData.nPoints,0),this.bsSurfaceDone=new JU.BS,this.bsSurfaceVoxels= new JU.BS,this.bsSurfacePoints=new JU.BS,this.doCalculateTroughs?(this.iter=this.sg.atomDataServer.getSelectedAtomIterator(this.bsMySelected,!0,!1,!1),this.vEdges=new JU.Lst,this.bsLocale=Array(this.myAtomCount),this.htEdges=new java.util.Hashtable,this.getEdges(),JU.Logger.info(this.vEdges.size()+" edges"),this.vFaces=new JU.Lst,this.getFaces(),JU.Logger.info(this.vFaces.size()+" faces"),this.htEdges=this.bsLocale=null,this.iter.release(),this.iter=null,this.newVoxelDataCube(),this.resetVoxelData(3.4028235E38), this.markFaceVoxels(!0),this.markToroidVoxels(),this.validSpheres.or(this.noFaceSpheres),this.vEdges=null,this.markFaceVoxels(!1),this.vFaces=null):(this.newVoxelDataCube(),this.resetVoxelData(3.4028235E38)),this.markSphereVoxels(0,this.doCalculateTroughs?3.4028235E38:this.params.distance),this.validSpheres=this.noFaceSpheres=null)});e(c$,"getEdges",function(){for(var a=0;a<this.myAtomCount;a++)this.bsLocale[a]=new JU.BS;for(a=0;a<this.myAtomCount;a++){var b=this.atomXyz[a],c=this.rs[a];for(this.sg.atomDataServer.setIteratorForAtom(this.iter, this.atomIndex[a],c+this.maxRS);this.iter.hasNext();){var d=this.iter.next(),d=this.myIndex[d];if(!(a>=this.firstNearbyAtom&&d>=this.firstNearbyAtom)){var e=this.rs[d],f=b.distance(this.atomXyz[d]);f>=c+e||(e=ma(J.jvxl.readers.IsoSolventReader.Edge,this,null,this,a,d,f),this.vEdges.addLast(e),this.bsLocale[a].set(d),this.bsLocale[d].set(a),this.htEdges.put(e.toString(),e))}}}});e(c$,"findEdge",function(a,b){return this.htEdges.get(a<b?a+"_"+b:b+"_"+a)},"~N,~N");e(c$,"getFaces",function(){var a=new JU.BS; this.validSpheres=new JU.BS;this.noFaceSpheres=JU.BSUtil.setAll(this.myAtomCount);for(var b=this.vEdges.size();0<=--b;){var c=this.vEdges.get(b),d=c.ia,e=c.ib;a.clearAll();a.or(this.bsLocale[d]);a.and(this.bsLocale[e]);for(var f=a.nextSetBit(e+1);0<=f;f=a.nextSetBit(f+1))if(this.getSolventPoints(c,d,e,f)){var g,j=!1;if(null!=(g=this.validateFace(d,e,f,c,this.ptS1)))this.vFaces.addLast(g),j=!0,g.dump();if(null!=(g=this.validateFace(d,e,f,c,this.ptS2)))this.vFaces.addLast(g),j||g.dump(),j=!0;j&&(this.noFaceSpheres.clear(d), this.noFaceSpheres.clear(e),this.noFaceSpheres.clear(f))}}});e(c$,"validateFace",function(a,b,c,d,e){this.sg.atomDataServer.setIteratorForPoint(this.iter,this.modelIndex,e,this.maxRS);for(var f=!0;this.iter.hasNext();){var g=this.iter.next(),j=this.myIndex[g];if(!(j==a||j==b||j==c)&&this.atomData.atomXyz[g].distance(e)<this.atomData.atomRadius[g]+this.sr){f=!1;break}}g=this.findEdge(b,c);j=this.findEdge(a,c);e=f?ma(J.jvxl.readers.IsoSolventReader.Face,this,null,a,b,c,e):null;d.addFace(e);g.addFace(e); j.addFace(e);if(!f)return null;this.validSpheres.set(a);this.validSpheres.set(b);this.validSpheres.set(c);return e},"~N,~N,~N,J.jvxl.readers.IsoSolventReader.Edge,JU.P3");e(c$,"markFaceVoxels",function(a){for(var b=new JU.BS,c=this.volumetricVectors[0],d=this.volumetricVectors[1],e=this.volumetricVectors[2],f=this.vFaces.size();0<=--f;){var g=this.vFaces.get(f),j=this.atomXyz[g.ia],p=this.atomXyz[g.ib],k=this.atomXyz[g.ic],n=g.pS;this.setGridLimitsForAtom(n,this.sr,this.pt0,this.pt1);this.volumeData.voxelPtToXYZ(this.pt0.x, this.pt0.y,this.pt0.z,this.ptV);for(var q=this.pt0.x;q<this.pt1.x;q++,this.ptV.add2(c,this.ptY0)){this.ptY0.setT(this.ptV);for(var t=this.pt0.y;t<this.pt1.y;t++,this.ptV.add2(d,this.ptZ0)){this.ptZ0.setT(this.ptV);for(var r=this.pt0.z;r<this.pt1.z;r++,this.ptV.add(e)){var u=this.sr-this.ptV.distance(n),y=this.voxelData[q][t][r],w=this.volumeData.getPointIndex(q,t,r);a&&0<u&&this.bsSurfaceDone.set(w);if(JU.Measure.isInTetrahedron(this.ptV,j,p,k,n,this.plane,this.vTemp,this.vTemp2,!1)&&(!a?!this.bsSurfaceDone.get(w)&& 0>u&&u>1.8*-this.volumeData.maxGrid&&u>y==b.get(w):0<u&&(0>y||3.4028235E38==y||u>y==b.get(w))))b.set(w),this.setVoxel(q,t,r,w,u),null!=this.voxelSource&&(this.voxelSource[w]=-1-g.ia),0<u&&this.bsSurfaceVoxels.set(w)}}}}},"~B");e(c$,"markToroidVoxels",function(){for(var a=this.volumetricVectors[0],b=this.volumetricVectors[1],c=this.volumetricVectors[2],d=this.vEdges.size();0<=--d;){var e=this.vEdges.get(d);if(e.isValid()){var f=e.ia,g=e.ib,j=this.atomXyz[f],p=this.atomXyz[g];this.rAS=this.rs[f];this.rBS= this.rs[g];this.rAS2=this.rs2[f];this.rBS2=this.rs2[g];this.dAB=e.d;this.dAB2=e.d2;this.ecosASB2=e.cosASB2;this.setGridLimitsForAtom(e,e.maxr,this.pt0,this.pt1);this.volumeData.voxelPtToXYZ(this.pt0.x,this.pt0.y,this.pt0.z,this.ptV);for(e=this.pt0.x;e<this.pt1.x;e++,this.ptV.add2(a,this.ptY0)){this.ptY0.setT(this.ptV);for(g=this.pt0.y;g<this.pt1.y;g++,this.ptV.add2(b,this.ptZ0)){this.ptZ0.setT(this.ptV);for(var k=this.pt0.z;k<this.pt1.z;k++,this.ptV.add(c)){var n=this.checkSpecialVoxel(j,p,this.ptV); if(!Float.isNaN(n)&&(n=this.sr-n,n<this.voxelData[e][g][k])){var q=this.volumeData.getPointIndex(e,g,k);this.setVoxel(e,g,k,q,n);null!=this.voxelSource&&(this.voxelSource[q]=-1-f)}}}}}}});j(c$,"unsetVoxelData",function(){if(this.havePlane)if(this.isProgressive)for(var a=0;a<this.yzCount;a++)0.001>this.thisPlane[a]||(this.thisPlane[a]=0.001);else for(a=0;a<this.nPointsX;++a)for(var b=0;b<this.nPointsY;++b)for(var c=0;c<this.nPointsZ;++c)0.001>this.voxelData[a][b][c]||(this.voxelData[a][b][c]=0.001); else this.unsetVoxelData2()});e(c$,"getSolventPoints",function(a,b,c,d){var e=this.rs[b],f=a.v;a=(a.d2+this.rs2[b]-this.rs2[c])/(2*a.d*e);c=Math.acos(a);this.p.scaleAdd2(a*e,f,this.atomXyz[b]);JU.Measure.getPlaneThroughPoint(this.p,f,this.plane);b=Math.sin(c)*e;a=this.atomXyz[d];c=this.rs[d];e=JU.Measure.distanceToPlane(this.plane,a);if(Math.abs(e)>=0.9*c)return!1;this.ptTemp.scaleAdd2(-e,f,a);a=this.p.distance(this.ptTemp);d=(b*b+a*a-(this.rs2[d]-e*e))/(2*b*a);if(0.99<=Math.abs(d))return!1;e=this.vTemp2; e.sub2(this.ptTemp,this.p);e.normalize();this.ptTemp.scaleAdd2(b*d,e,this.p);e.cross(f,e);e.normalize();e.scale(Math.sqrt(1-d*d)*b);this.ptS1.add2(this.ptTemp,e);this.ptS2.sub2(this.ptTemp,e);return!0},"J.jvxl.readers.IsoSolventReader.Edge,~N,~N,~N");e(c$,"checkSpecialVoxel",function(a,b,c){var d=a.distance(c),e=a.distanceSquared(c),f=this.rAS/d;if(1<f)return this.p.set(a.x+(c.x-a.x)*f,a.y+(c.y-a.y)*f,a.z+(c.z-a.z)*f),b.distanceSquared(this.p)>=this.rBS2?NaN:this.solventDistance(this.rAS,this.rAS2, this.rBS2,d,e,b.distanceSquared(c));d=b.distance(c);return 1<(f=this.rBS/d)?(this.p.set(b.x+(c.x-b.x)*f,b.y+(c.y-b.y)*f,b.z+(c.z-b.z)*f),a.distanceSquared(this.p)>=this.rAS2?NaN:this.solventDistance(this.rBS,this.rBS2,this.rAS2,d,d*d,e)):NaN},"JU.P3,JU.P3,JU.P3");e(c$,"solventDistance",function(a,b,c,d,e,f){f=Math.acos((e+this.dAB2-f)/(2*d*this.dAB));c=Math.acos((b+this.dAB2-c)/(2*a*this.dAB));e=b+e-2*a*d*Math.cos(c-f);c=Math.sqrt(e);return this.ecosASB2<(b+e-d*d)/(c*a)?c:NaN},"~N,~N,~N,~N,~N,~N"); e(c$,"dumpLine",function(a,b,c,d){this.sg.log('draw ID "x'+c+this.nTest++ +'" '+JU.P3.newP(a)+" "+JU.P3.newP(b)+" color "+d)},"JU.P3,JU.T3,~S,~S");e(c$,"dumpLine2",function(a,b,c,d,e,f){var g=new JU.V3;g.setT(b);g.sub(a);g.normalize();g.scale(d);g.add(a);this.sg.log('draw ID "'+c+this.nTest++ +'" '+JU.P3.newP(a)+" "+JU.P3.newP(g)+" color "+e);this.sg.log('draw ID "'+c+this.nTest++ +'"'+JU.P3.newP(g)+" "+JU.P3.newP(b)+" color "+f+'"'+c+'"')},"JU.P3,JU.P3,~S,~N,~S,~S");e(c$,"dumpPoint",function(a,b, c){this.sg.log('draw ID "'+b+this.nTest++ +'"'+JU.P3.newP(a)+" color "+c)},"JU.P3,~S,~S");j(c$,"getValueAtPoint",function(a){if(null!=this.contactPair)return a.distance(this.contactPair.myAtoms[1])-this.contactPair.radii[1];for(var b=3.4028235E38,c=0;c<this.firstNearbyAtom;c++){var d=a.distance(this.atomXyz[c])-this.rs[c];d<b&&(b=d)}return 3.4028235E38==b?NaN:b},"JU.T3,~B");j(c$,"discardTempData",function(a){this.rs2=this.rs=null;this.discardTempDataSR(a)},"~B");j(c$,"getPlane",function(a){0==this.yzCount&& this.initPlanes();this.thisX=a;this.thisPlane=this.yzPlanes[a%2];null==this.contactPair?(this.resetPlane(3.4028235E38),this.thisAtomSet=this.bsAtomMinMax[a],this.markSphereVoxels(0,this.params.distance),this.unsetVoxelData()):this.markPlaneVoxels(this.contactPair.myAtoms[0],this.contactPair.radii[0]);return this.thisPlane},"~N");c$.$IsoSolventReader$Edge$=function(){la(self.c$);c$=C(function(){oa(this,arguments);this.cosASB2=this.maxr=this.d2=this.d=this.nInvalid=this.nFaces=this.ib=this.ia=0;this.v= null;G(this,arguments)},J.jvxl.readers.IsoSolventReader,"Edge",JU.P3);Za(c$,function(a,b,c,d){this.ia=Math.min(b,c);this.ib=Math.max(b,c);this.d=d;this.d2=d*d;this.maxr=Math.sqrt(this.d2/4+Math.max(a.rs2[b],a.rs2[c]));this.ave(a.atomXyz[b],a.atomXyz[c]);this.cosASB2=(a.rs2[b]+a.rs2[c]-this.d2)/(a.rs[c]*a.rs[b]);this.v=JU.V3.newVsub(a.atomXyz[c],a.atomXyz[b]);this.v.normalize()},"J.jvxl.readers.IsoSolventReader,~N,~N,~N");e(c$,"addFace",function(a){this.nFaces++;null==a&&this.nInvalid++},"J.jvxl.readers.IsoSolventReader.Face"); e(c$,"isValid",function(){return 0==this.nFaces||this.nInvalid!=this.nFaces});j(c$,"toString",function(){return this.ia+"_"+this.ib});c$=fa()};c$.$IsoSolventReader$Face$=function(){la(self.c$);c$=C(function(){oa(this,arguments);this.ic=this.ib=this.ia=0;this.pS=null;G(this,arguments)},J.jvxl.readers.IsoSolventReader,"Face");Q(c$,function(a,b,c,d){this.ia=a;this.ib=b;this.ic=c;this.pS=JU.P3.newP(d)},"~N,~N,~N,JU.P3");e(c$,"dump",function(){var a=this.b$["J.jvxl.readers.IsoSolventReader"].atomXyz[this.ia], b=this.b$["J.jvxl.readers.IsoSolventReader"].atomXyz[this.ib],c=this.b$["J.jvxl.readers.IsoSolventReader"].atomXyz[this.ic];this.b$["J.jvxl.readers.IsoSolventReader"].sg.log('draw ID "x'+("f"+this.ia+"_"+this.ib+"_"+this.ic+"_")+this.b$["J.jvxl.readers.IsoSolventReader"].nTest++ +'" '+JU.P3.newP(a)+" "+JU.P3.newP(b)+" "+JU.P3.newP(c)+" color red")});j(c$,"toString",function(){return this.ia+"_"+this.ib+"_"+this.ic+"_"+this.pS});c$=fa()};R(c$,"testLinear",!1)});H("J.jvxl.readers");K(["J.jvxl.readers.SurfaceReader"], "J.jvxl.readers.SurfaceFileReader",["JU.PT","J.api.Interface"],function(){c$=C(function(){this.next=this.line=this.out=this.binarydoc=this.br=null;G(this,arguments)},J.jvxl.readers,"SurfaceFileReader",J.jvxl.readers.SurfaceReader);W(c$,function(){this.next=p(1,0)});Q(c$,function(){Y(this,J.jvxl.readers.SurfaceFileReader,[])});e(c$,"setStream",function(a,b){this.binarydoc.setStream(this.sg.atomDataServer.getJzt(),null==a?null:this.sg.atomDataServer.getBufferedInputStream(a),b)},"~S,~B");j(c$,"init", function(a){this.initSR(a)},"J.jvxl.readers.SurfaceGenerator");e(c$,"init2",function(a,b){this.init2SFR(a,b)},"J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");e(c$,"init2SFR",function(a,b){this.init(a);this.br=b},"J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");e(c$,"newBinaryDocument",function(){return J.api.Interface.getInterface("JU.BinaryDocument",this.sg.atomDataServer,"file")});j(c$,"setOutputChannel",function(a){null==this.binarydoc?this.out=a:this.sg.setOutputChannel(this.binarydoc, a)},"JU.OC");j(c$,"closeReader",function(){this.closeReaderSFR()});e(c$,"closeReaderSFR",function(){if(null!=this.br)try{this.br.close()}catch(a){if(!U(a,java.io.IOException))throw a;}null!=this.out&&this.out.closeChannel();null!=this.binarydoc&&this.binarydoc.close()});j(c$,"discardTempData",function(a){this.closeReader();this.discardTempDataSR(a)},"~B");e(c$,"getTokens",function(){return JU.PT.getTokensAt(this.line,0)});e(c$,"parseFloat",function(){return JU.PT.parseFloatNext(this.line,this.next)}); e(c$,"parseFloatStr",function(a){this.next[0]=0;return JU.PT.parseFloatNext(a,this.next)},"~S");e(c$,"parseFloatRange",function(a,b,c){this.next[0]=b;return JU.PT.parseFloatRange(a,c,this.next)},"~S,~N,~N");e(c$,"parseInt",function(){return JU.PT.parseIntNext(this.line,this.next)});e(c$,"parseIntStr",function(a){this.next[0]=0;return JU.PT.parseIntNext(a,this.next)},"~S");e(c$,"parseIntNext",function(a){return JU.PT.parseIntNext(a,this.next)},"~S");e(c$,"parseFloatArrayStr",function(a){this.next[0]= 0;return JU.PT.parseFloatArrayNext(a,this.next,null,null,null)},"~S");e(c$,"parseFloatArray",function(a,b,c){return JU.PT.parseFloatArrayNext(this.line,this.next,a,b,c)},"~A,~S,~S");e(c$,"getQuotedStringNext",function(){return JU.PT.getQuotedStringNext(this.line,this.next)});e(c$,"skipTo",function(a,b){if(null!=a)for(;0>this.rd().indexOf(a););null!=b&&(this.next[0]=this.line.indexOf(b)+b.length+2)},"~S,~S");e(c$,"rd",function(){this.line=this.br.readLine();if(null!=this.line&&(this.nBytes+=this.line.length, null!=this.out)){var a=this.line.getBytes();this.out.write(a,0,a.length);this.out.writeByteAsInt(10)}return this.line})});H("J.jvxl.readers");K(["J.jvxl.readers.SurfaceFileReader"],"J.jvxl.readers.VolumeFileReader","java.lang.Float JU.AU $.PT $.SB J.api.Interface J.atomdata.AtomData JU.Logger".split(" "),function(){c$=C(function(){this.negativeAtomCount=this.endOfData=!1;this.nSurfaces=this.ac=0;this.canDownsample=this.isAngstroms=!1;this.downsampleRemainders=null;this.preProcessPlanes=!1;this.nData= 0;this.readerClosed=!1;this.nSkipZ=this.nSkipY=this.nSkipX=this.downsampleFactor=0;this.yzPlanesRaw=null;this.iPlaneRaw=0;this.boundingBox=null;this.isScaledAlready=!1;G(this,arguments)},J.jvxl.readers,"VolumeFileReader",J.jvxl.readers.SurfaceFileReader);Q(c$,function(){Y(this,J.jvxl.readers.VolumeFileReader,[])});j(c$,"init2",function(a,b){this.init2VFR(a,b)},"J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");e(c$,"init2VFR",function(a,b){this.init2SFR(a,b);this.canDownsample=this.isProgressive= this.isXLowToHigh=!0;this.jvxlData.wasCubic=!0;this.boundingBox=this.params.boundingBox;4==this.params.qmOrbitalType&&(this.hasColorData=null==this.params.parameters||0<=this.params.parameters[1],this.preProcessPlanes=!0,this.params.insideOut=!this.params.insideOut)},"J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");e(c$,"recordData",function(a){if(Float.isNaN(a))return a;a<this.dataMin&&(this.dataMin=a);a>this.dataMax&&(this.dataMax=a);this.dataMean+=a;this.nData++;return a},"~N");j(c$,"closeReader", function(){this.readerClosed||(this.readerClosed=!0,this.closeReaderSFR(),0==this.nData||-3.4028235E38==this.dataMax||(this.dataMean/=this.nData,JU.Logger.info("VolumeFileReader closing file: "+this.nData+" points read \ndata min/max/mean = "+this.dataMin+"/"+this.dataMax+"/"+this.dataMean)))});j(c$,"readVolumeParameters",function(){this.endOfData=!1;this.nSurfaces=this.readVolumetricHeader();if(0==this.nSurfaces)return!1;this.nSurfaces<this.params.fileIndex&&(JU.Logger.warn("not enough surfaces in file -- resetting params.fileIndex to "+ this.nSurfaces),this.params.fileIndex=this.nSurfaces);return!0},"~B");j(c$,"readVolumeData",function(a){return this.readVolumeDataVFR(a)},"~B");e(c$,"readVolumeDataVFR",function(a){if(!this.gotoAndReadVoxelData(a))return!1;this.vertexDataOnly||JU.Logger.info("JVXL read: "+this.nPointsX+" x "+this.nPointsY+" x "+this.nPointsZ+" data points");return!0},"~B");e(c$,"readVolumetricHeader",function(){try{this.readParameters();if(-2147483648==this.ac)return 0;this.vertexDataOnly||JU.Logger.info("voxel grid origin:"+ this.volumetricOrigin);var a=this.params.downsampleFactor,b=this.canDownsample&&1<a;1<a&&!this.canDownsample&&(this.jvxlData.msg+="\ncannot downsample this file type");if(b){this.downsampleRemainders=p(3,0);JU.Logger.info("downsample factor = "+a);for(var c=0;3>c;++c){var d=this.voxelCounts[c];this.downsampleRemainders[c]=d%a;this.voxelCounts[c]/=a;this.isPeriodic&&(this.voxelCounts[c]++,this.downsampleRemainders[c]--);this.volumetricVectors[c].scale(a);JU.Logger.info("downsampling axis "+(c+1)+" from "+ d+" to "+this.voxelCounts[c])}}if(!this.vertexDataOnly)for(c=0;3>c;++c)this.isAngstroms||this.volumetricVectors[c].scale(0.5291772),this.line=this.voxelCounts[c]+" "+this.volumetricVectors[c].x+" "+this.volumetricVectors[c].y+" "+this.volumetricVectors[c].z,this.jvxlFileHeaderBuffer.append(this.line).appendC("\n"),JU.Logger.info("voxel grid count/vector:"+this.line);this.scaleIsosurface(this.params.scale);this.volumeData.setVolumetricXml();return this.nSurfaces}catch(e){if(U(e,Exception))return JU.Logger.error(e.toString()), 0;throw e;}});e(c$,"skipComments",function(a){for(var b=new JU.SB;null!=this.rd()&&(a&&0==this.line.length||0==this.line.indexOf("#"));)b.append(this.line).appendC("\n");return b.toString()},"~B");e(c$,"readVoxelVector",function(a){this.rd();var b=this.volumetricVectors[a];if(-2147483648==(this.voxelCounts[a]=this.parseIntStr(this.line)))this.next[0]=this.line.indexOf(" ");b.set(this.parseFloat(),this.parseFloat(),this.parseFloat());this.isAnisotropic&&this.setVectorAnisotropy(b)},"~N");e(c$,"initializeSurfaceData", function(){this.downsampleFactor=this.params.downsampleFactor;this.nSkipZ=this.nSkipY=this.nSkipX=0;this.canDownsample&&0<this.downsampleFactor&&(this.nSkipX=this.downsampleFactor-1,this.nSkipY=this.downsampleRemainders[2]+(this.downsampleFactor-1)*(this.nSkipZ=(this.nPointsZ-(this.isPeriodic?1:0))*this.downsampleFactor+this.downsampleRemainders[2]),this.nSkipZ=this.downsampleRemainders[1]*this.nSkipZ+(this.downsampleFactor-1)*this.nSkipZ*((this.nPointsY-(this.isPeriodic?1:0))*this.downsampleFactor+ this.downsampleRemainders[1]));null!=this.params.thePlane?this.params.cutoff=0:this.isJvxl&&(this.params.cutoff=this.params.isBicolorMap||this.params.colorBySign?0.01:0.5);this.nDataPoints=0;this.next[0]=0;this.line="";this.jvxlNSurfaceInts=0});j(c$,"readSurfaceData",function(a){this.readSurfaceDataVFR(a)},"~B");e(c$,"readSurfaceDataVFR",function(a){this.initializeSurfaceData();if(this.isProgressive&&!a||this.isJvxl)this.nDataPoints=this.volumeData.setVoxelCounts(this.nPointsX,this.nPointsY,this.nPointsZ), this.voxelData=null,this.isJvxl&&(this.jvxlVoxelBitSet=this.getVoxelBitSet(this.nDataPoints));else if(a&&this.volumeData.hasPlane()){this.volumeData.setVoxelMap();var b=this.volumeData.getToPlaneParameter();for(a=0;a<this.nPointsX;++a){for(var c=0;c<this.nPointsY;++c){for(var d=0;d<this.nPointsZ;++d){var e=this.recordData(this.getNextVoxelValue());this.volumeData.isNearPlane(a,c,d,b)&&this.volumeData.setVoxelMapValue(a,c,d,e);0!=this.nSkipX&&this.skipVoxels(this.nSkipX)}0!=this.nSkipY&&this.skipVoxels(this.nSkipY)}0!= this.nSkipZ&&this.skipVoxels(this.nSkipZ)}}else{this.voxelData=JU.AU.newFloat3(this.nPointsX,-1);for(a=0;a<this.nPointsX;++a){b=JU.AU.newFloat2(this.nPointsY);this.voxelData[a]=b;for(c=0;c<this.nPointsY;++c){e=u(this.nPointsZ,0);b[c]=e;for(d=0;d<this.nPointsZ;++d)e[d]=this.recordData(this.getNextVoxelValue()),0!=this.nSkipX&&this.skipVoxels(this.nSkipX);0!=this.nSkipY&&this.skipVoxels(this.nSkipY)}0!=this.nSkipZ&&this.skipVoxels(this.nSkipZ)}}this.volumeData.setVoxelDataAsArray(this.voxelData)},"~B"); e(c$,"getPlane",function(a){0==a&&this.initPlanes();if(this.preProcessPlanes)return this.getPlaneProcessed(a);a=this.getPlane2(a);null==this.qpc&&this.getPlane(a,!0);return a},"~N");e(c$,"getPlaneProcessed",function(a){var b;if(0==this.iPlaneRaw){this.qpc=J.api.Interface.getOption("quantum.NciCalculation",this.sg.atomDataServer,null);b=new J.atomdata.AtomData;b.modelIndex=-1;b.bsSelected=this.params.bsSelected;this.sg.fillAtomData(b,1);this.qpc.setupCalculation(this.volumeData,this.sg.params.bsSelected, null,null,null,b.atomXyz,-1,null,null,null,null,null,null,this.params.isSquaredLinear,null,this.params.theProperty,!0,null,this.params.parameters,this.params.testFlags);this.iPlaneRaw=1;this.qpc.setPlanes(this.yzPlanesRaw=u(4,this.yzCount,0));if(this.hasColorData){this.getPlane(this.yzPlanesRaw[0],!1);this.getPlane(this.yzPlanesRaw[1],!1);b=this.yzPlanes[0];for(a=0;a<this.yzCount;a++)b[a]=NaN;return b}this.iPlaneRaw=-1}var c=this.qpc.getNoValue(),d=this.nPointsX-1;switch(this.iPlaneRaw){case -1:b= this.yzPlanes[a%2];d++;break;case 3:b=this.yzPlanesRaw[0];this.yzPlanesRaw[0]=this.yzPlanesRaw[1];this.yzPlanesRaw[1]=this.yzPlanesRaw[2];this.yzPlanesRaw[2]=this.yzPlanesRaw[3];this.yzPlanesRaw[3]=b;b=this.yzPlanesRaw[this.iPlaneRaw];break;default:this.iPlaneRaw++,b=this.yzPlanesRaw[this.iPlaneRaw]}if(a<d){this.getPlane(b,!1);this.qpc.calcPlane(a,b=this.yzPlanes[a%2]);for(a=0;a<this.yzCount;a++)b[a]!=c&&this.recordData(b[a])}else for(a=0;a<this.yzCount;a++)b[a]=NaN;return b},"~N");e(c$,"getPlane", function(a,b){try{for(var c=0,d=0;c<this.nPointsY;++c){for(var e=0;e<this.nPointsZ;++e){var f=this.getNextVoxelValue();b&&this.recordData(f);a[d++]=f;0!=this.nSkipX&&this.skipVoxels(this.nSkipX)}0!=this.nSkipY&&this.skipVoxels(this.nSkipY)}0!=this.nSkipZ&&this.skipVoxels(this.nSkipZ)}catch(g){if(!U(g,Exception))throw g;}},"~A,~B");j(c$,"getValue",function(a,b,c,d){return null!=this.boundingBox&&(this.volumeData.voxelPtToXYZ(a,b,c,this.ptTemp),this.ptTemp.x<this.boundingBox[0].x||this.ptTemp.x>this.boundingBox[1].x|| this.ptTemp.y<this.boundingBox[0].y||this.ptTemp.y>this.boundingBox[1].y||this.ptTemp.z<this.boundingBox[0].z||this.ptTemp.z>this.boundingBox[1].z)?NaN:this.getValue2(a,b,c,d)},"~N,~N,~N,~N");e(c$,"skipVoxels",function(a){for(;0<=--a;)this.getNextVoxelValue()},"~N");e(c$,"getVoxelBitSet",function(){return null},"~N");e(c$,"getNextVoxelValue",function(){var a=0;if(1<this.nSurfaces&&!this.params.blockCubeData){for(var b=1;b<this.params.fileIndex;b++)this.nextVoxel();a=this.nextVoxel();for(b=this.params.fileIndex;b< this.nSurfaces;b++)this.nextVoxel()}else a=this.nextVoxel();return a});e(c$,"nextVoxel",function(){var a=this.parseFloat();if(Float.isNaN(a)){for(;null!=this.rd()&&Float.isNaN(a=this.parseFloatStr(this.line)););null==this.line&&(this.endOfData||JU.Logger.warn("end of file reading cube voxel data? nBytes="+this.nBytes+" nDataPoints="+this.nDataPoints+" (line):"+this.line),this.endOfData=!0,this.line="0 0 0 0 0 0 0 0 0 0")}return a});j(c$,"gotoData",function(a,b){if(this.params.blockCubeData){0<a&& JU.Logger.info("skipping "+a+" data sets, "+b+" points each");for(var c=0;c<a;c++)this.skipData(b)}},"~N,~N");e(c$,"skipData",function(a){this.skipDataVFR(a)},"~N");e(c$,"skipDataVFR",function(a){for(var b=0;b<a;)b+=this.countData(this.rd())},"~N");e(c$,"countData",function(a){for(var b=0,c=0,d=a.length,e;c<d;){for(;c<d&&(" "==(e=a.charAt(c))||"\t"==e);)++c;for(c<d&&++b;c<d&&" "!=(e=a.charAt(c))&&"\t"!=e;)++c}return b},"~S");c$.checkAtomLine=e(c$,"checkAtomLine",function(a,b,c,d,e){0<=d.indexOf("ANGSTROMS")&& (b=!0);c=null==c?2147483647:JU.PT.parseInt(c);switch(c){case -2147483648:c=0;d=" "+d.substring(d.indexOf(" ")+1);break;case 2147483647:c=-2147483648;break;default:var f=""+c;d=d.substring(d.indexOf(f)+f.length)}b?0>d.indexOf("ANGSTROM")&&(d+=" ANGSTROMS"):0>d.indexOf("BOHR")&&(d+=" BOHR");d=(-2147483648==c?"":(a?"+":"-")+Math.abs(c))+d+"\n";e.append(d);return b},"~B,~B,~S,~S,JU.SB");j(c$,"getSurfacePointAndFraction",function(a,b,c,d,e,f,g,j,p,k,n,q,t){return this.getSPFv(a,b,c,d,e,f,g,j,p,k,n,q,t)}, "~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");e(c$,"getSPFv",function(a,b,c,d,e,f,g,j,p,k,n,q,t){a=this.getSPF(a,b,c,d,e,f,g,j,p,k,n,q,t);if(null==this.qpc||Float.isNaN(a)||!this.hasColorData)return a;k=this.marchingCubes.getLinearOffset(g,j,p,k);n=this.marchingCubes.getLinearOffset(g,j,p,n);return this.qpc.process(k,n,q[0])},"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");e(c$,"scaleIsosurface",function(a){this.isScaledAlready||(this.isScaledAlready=!0,this.isAnisotropic&&this.setVolumetricAnisotropy(), Float.isNaN(a)||(JU.Logger.info("applying scaling factor of "+a),this.volumetricOrigin.scaleAdd2((1-a)/2,this.volumetricVectors[0],this.volumetricOrigin),this.volumetricOrigin.scaleAdd2((1-a)/2,this.volumetricVectors[1],this.volumetricOrigin),this.volumetricOrigin.scaleAdd2((1-a)/2,this.volumetricVectors[2],this.volumetricOrigin),this.volumetricVectors[0].scale(a),this.volumetricVectors[1].scale(a),this.volumetricVectors[2].scale(a)))},"~N");e(c$,"swapXZ",function(){var a=this.volumetricVectors[0]; this.volumetricVectors[0]=this.volumetricVectors[2];this.volumetricVectors[2]=a;a=this.voxelCounts[0];this.voxelCounts[0]=this.voxelCounts[2];this.voxelCounts[2]=a;this.params.insideOut=!this.params.insideOut})});H("J.jvxl.readers");K(["J.jvxl.readers.VolumeFileReader"],"J.jvxl.readers.JvxlXmlReader","java.lang.Float $.NullPointerException java.util.Hashtable JU.AU $.BS $.CU $.Lst $.P3 $.P4 $.PT $.SB J.jvxl.data.JvxlCoder $.MeshData J.jvxl.readers.XmlReader J.shapesurface.IsosurfaceMesh JU.C $.ColorEncoder $.Escape $.Logger".split(" "), function(){c$=C(function(){this.JVXL_VERSION="2.3";this.invalidatedVertexCount=this.excludedVertexCount=this.excludedTriangleCount=this.colorDataCount=this.edgeDataCount=this.surfaceDataCount=0;this.haveContourData=!1;this.xr=null;this.isXmlFile=!0;this.thisInside=!1;this.bsVoxelBitSet=this.tempDataXml=null;this.includeValueNaN=!0;this.valueCount=0;this.valueRange=this.valueMin=NaN;this.colorPtr=this.fractionPtr=0;this.strFractionTemp="";this.haveReadColorData=!1;this.jvxlColorEncodingRead=null;G(this, arguments)},J.jvxl.readers,"JvxlXmlReader",J.jvxl.readers.VolumeFileReader);Q(c$,function(){Y(this,J.jvxl.readers.JvxlXmlReader,[])});j(c$,"init2",function(a,b){this.init2JXR(a,b)},"J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");e(c$,"init2JXR",function(a,b){this.init2VFR(a,b);this.jvxlData.wasJvxl=this.isJvxl=!0;this.isXLowToHigh=this.canDownsample=!1;this.xr=new J.jvxl.readers.XmlReader(b)},"J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");j(c$,"readVolumeData",function(a){if(!this.readVolumeDataVFR(a))return!1; this.strFractionTemp=this.jvxlEdgeDataRead;this.fractionPtr=0;return!0},"~B");j(c$,"gotoAndReadVoxelData",function(a){this.initializeVolumetricData();if(0>this.nPointsX||0>this.nPointsY||0>this.nPointsZ)return!0;try{this.gotoData(this.params.fileIndex-1,this.nPointsX*this.nPointsY*this.nPointsZ);if(this.vertexDataOnly)return!0;this.volumeData.setMappingPlane(this.params.thePlane);this.readSurfaceData(a);this.volumeData.setMappingPlane(null);0<this.edgeDataCount&&(this.jvxlEdgeDataRead=this.jvxlReadFractionData("edge", this.edgeDataCount));this.params.bsExcluded=this.jvxlData.jvxlExcluded=Array(4);if(this.hasColorData=0<this.colorDataCount)this.jvxlColorDataRead=this.jvxlReadFractionData("color",this.colorDataCount);0<this.excludedVertexCount&&(this.jvxlData.jvxlExcluded[0]=J.jvxl.data.JvxlCoder.jvxlDecodeBitSet(this.xr.getXmlData("jvxlExcludedVertexData",null,!1,!1)),this.xr.isNext("jvxlExcludedPlaneData")&&(this.jvxlData.jvxlExcluded[2]=J.jvxl.data.JvxlCoder.jvxlDecodeBitSet(this.xr.getXmlData("jvxlExcludedPlaneData", null,!1,!1))));0<this.excludedTriangleCount&&(this.jvxlData.jvxlExcluded[3]=J.jvxl.data.JvxlCoder.jvxlDecodeBitSet(this.xr.getXmlData("jvxlExcludedTriangleData",null,!1,!1)));0<this.invalidatedVertexCount&&(this.jvxlData.jvxlExcluded[1]=J.jvxl.data.JvxlCoder.jvxlDecodeBitSet(this.xr.getXmlData("jvxlInvalidatedVertexData",null,!1,!1)));this.haveContourData&&this.jvxlDecodeContourData(this.jvxlData,this.xr.getXmlData("jvxlContourData",null,!1,!1));if(this.jvxlDataIsColorMapped&&0<this.jvxlData.nVertexColors){this.jvxlData.vertexColorMap= new java.util.Hashtable;var b=this.xr.getXmlData("jvxlVertexColorData",null,!0,!1),c=J.jvxl.readers.XmlReader.getXmlAttrib(b,"baseColor");this.jvxlData.baseColor=0<c.length?c:null;for(a=0;a<this.jvxlData.nVertexColors;a++){var d=this.xr.getXmlData("jvxlColorMap",b,!0,!1),e=J.jvxl.readers.XmlReader.getXmlAttrib(d,"color"),f=J.jvxl.data.JvxlCoder.jvxlDecodeBitSet(this.xr.getXmlData("jvxlColorMap",d,!1,!1));this.jvxlData.vertexColorMap.put(e,f)}}}catch(g){if(U(g,Exception))return JU.Logger.error(g.toString()), !1;throw g;}return!0},"~B");j(c$,"readParameters",function(){var a=this.xr.getXmlData("jvxlFileTitle",null,!1,!1);this.jvxlFileHeaderBuffer=JU.SB.newS(a);this.xr.toTag("jvxlVolumeData");a=this.tempDataXml=this.xr.getXmlData("jvxlVolumeData",null,!0,!1);this.volumetricOrigin.setT(this.xr.getXmlPoint(a,"origin"));this.isAngstroms=!0;this.readVector(0);this.readVector(1);this.readVector(2);this.line=this.xr.toTag("jvxlSurfaceSet");this.nSurfaces=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(this.line, "count"));JU.Logger.info("jvxl file surfaces: "+this.nSurfaces);JU.Logger.info("using default edge fraction base and range");JU.Logger.info("using default color fraction base and range");this.cJvxlEdgeNaN=String.fromCharCode(this.edgeFractionBase+this.edgeFractionRange)});e(c$,"readVector",function(a){var b=this.xr.getXmlData("jvxlVolumeVector",this.tempDataXml,!0,!0);this.tempDataXml=this.tempDataXml.substring(this.tempDataXml.indexOf(b)+b.length);var c=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b, "count"));-2147483648==c&&(this.vertexDataOnly=!0);this.voxelCounts[a]=0>c?0:c;this.volumetricVectors[a].setT(this.xr.getXmlPoint(b,"vector"));this.isAnisotropic&&this.setVectorAnisotropy(this.volumetricVectors[a])},"~N");j(c$,"gotoData",function(a,b){0<a&&JU.Logger.info("skipping "+a+" data sets, "+b+" points each");this.vertexDataOnly=this.jvxlData.vertexDataOnly=0==b;for(var c=0;c<a;c++)this.jvxlSkipData(b,!0);this.xr.toTag("jvxlSurface");this.jvxlReadSurfaceInfo()},"~N,~N");e(c$,"jvxlSkipData", function(){this.rd();this.xr.skipTag("jvxlSurface")},"~N,~B");e(c$,"jvxlReadSurfaceInfo",function(){var a,b=this.xr.getXmlData("jvxlSurfaceInfo",null,!0,!0);this.isXLowToHigh=J.jvxl.readers.XmlReader.getXmlAttrib(b,"isXLowToHigh").equals("true");this.jvxlCutoff=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"cutoff"));Float.isNaN(this.jvxlCutoff)||JU.Logger.info("JVXL read: cutoff "+this.jvxlCutoff);var c=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nContourData"));this.haveContourData= 0<c;this.params.isContoured=J.jvxl.readers.XmlReader.getXmlAttrib(b,"contoured").equals("true");if(this.params.isContoured){var d=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nContours"));0>=d?d=0:(0>this.params.thisContour&&(this.params.thisContour=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"thisContour"))),a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"contourValues"),0<a.length&&(a=a.$replace("["," ").$replace("]"," "),this.jvxlData.contourValues=this.params.contoursDiscrete= this.parseFloatArrayStr(a),JU.Logger.info("JVXL read: contourValues "+JU.Escape.eAF(this.jvxlData.contourValues))),a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"contourColors"),0<a.length&&(this.jvxlData.contourColixes=this.params.contourColixes=JU.C.getColixArray(a),this.jvxlData.contourColors=JU.C.getHexCodes(this.jvxlData.contourColixes),JU.Logger.info("JVXL read: contourColixes "+JU.C.getHexCodes(this.jvxlData.contourColixes))),this.params.contourFromZero=J.jvxl.readers.XmlReader.getXmlAttrib(b, "contourFromZero").equals("true"));this.params.nContours=this.haveContourData?c:d}this.jvxlData.nVertexColors=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nVertexColors"));this.params.isBicolorMap=J.jvxl.readers.XmlReader.getXmlAttrib(b,"bicolorMap").equals("true");this.params.isBicolorMap&&(a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"colorPositive"),0<a.length&&(-2147483648==this.params.colorRgb&&-16776961==this.params.colorPos)&&(this.params.colorPos=JU.CU.getArgbFromString(a)),a=J.jvxl.readers.XmlReader.getXmlAttrib(b, "colorNegative"),0<a.length&&(-2147483648==this.params.colorRgb&&-65536==this.params.colorNeg)&&(this.params.colorNeg=JU.CU.getArgbFromString(a)));if(this.params.isBicolorMap||this.params.colorBySign)this.jvxlCutoff=0;this.jvxlDataIsColorMapped=(-2147483648==this.params.colorRgb||2147483647==this.params.colorRgb)&&(this.params.isBicolorMap||J.jvxl.readers.XmlReader.getXmlAttrib(b,"colorMapped").equals("true"));this.jvxlData.isJvxlPrecisionColor=J.jvxl.readers.XmlReader.getXmlAttrib(b,"precisionColor").equals("true"); this.jvxlData.jvxlDataIsColorDensity=this.params.colorDensity=-2147483648==this.params.colorRgb&&J.jvxl.readers.XmlReader.getXmlAttrib(b,"colorDensity").equals("true");this.jvxlData.jvxlDataIsColorDensity&&Float.isNaN(this.params.pointSize)&&(a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"pointSize"),0<a.length&&(this.jvxlData.pointSize=this.params.pointSize=this.parseFloatStr(a)));a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"allowVolumeRender");this.jvxlData.allowVolumeRender=this.params.allowVolumeRender= 0==a.length||a.equalsIgnoreCase("true");a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"plane");if(0<=a.indexOf("{")){this.params.thePlane=null;this.params.mapLattice=null;try{this.params.thePlane=JU.Escape.uP(a),a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"maplattice"),JU.Logger.info("JVXL read: plane "+this.params.thePlane),0<=a.indexOf("{")&&(this.params.mapLattice=JU.Escape.uP(a),JU.Logger.info("JVXL read: mapLattice "+this.params.mapLattice)),0==this.params.scale3d&&(this.params.scale3d=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(b, "scale3d"))),Float.isNaN(this.params.scale3d)&&(this.params.scale3d=0)}catch(e){if(U(e,Exception))null==this.params.thePlane?(JU.Logger.error("JVXL Error reading plane definition -- setting to 0 0 1 0 (z=0)"),this.params.thePlane=JU.P4.new4(0,0,1,0)):JU.Logger.error("JVXL Error reading mapLattice definition -- ignored");else throw e;}this.edgeDataCount=this.surfaceDataCount=0}else this.params.thePlane=null,this.surfaceDataCount=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nSurfaceInts")), this.edgeDataCount=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nBytesUncompressedEdgeData")),a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"fixedLattice"),0<=a.indexOf("{")&&(this.jvxlData.fixedLattice=JU.Escape.uP(a));this.excludedVertexCount=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nExcludedVertexes"));this.excludedTriangleCount=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nExcludedTriangles"));this.invalidatedVertexCount=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b, "nInvalidatedVertexes"));a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"slabInfo");0<a.length&&(this.jvxlData.slabInfo=a);this.colorDataCount=Math.max(0,this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nBytesUncompressedColorData")));this.jvxlDataIs2dContour=null!=this.params.thePlane&&this.jvxlDataIsColorMapped;this.jvxlData.color=J.jvxl.readers.XmlReader.getXmlAttrib(b,"color");if(0==this.jvxlData.color.length||0<=this.jvxlData.color.indexOf("null"))this.jvxlData.color="orange";this.jvxlData.translucency= this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"translucency"));Float.isNaN(this.jvxlData.translucency)&&(this.jvxlData.translucency=0);a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"meshColor");0<a.length&&(this.jvxlData.meshColor=a);a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"rendering");0<a.length&&(this.jvxlData.rendering=a);this.jvxlData.colorScheme=J.jvxl.readers.XmlReader.getXmlAttrib(b,"colorScheme");0==this.jvxlData.colorScheme.length&&(this.jvxlData.colorScheme=null);0>this.jvxlData.thisSet&& (a=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"set")),0<a&&(this.jvxlData.thisSet=a-1));this.jvxlData.slabValue=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"slabValue"));this.jvxlData.isSlabbable=J.jvxl.readers.XmlReader.getXmlAttrib(b,"slabbable").equalsIgnoreCase("true");this.jvxlData.diameter=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"diameter"));-2147483648==this.jvxlData.diameter&&(this.jvxlData.diameter=0);this.jvxlDataIs2dContour&&(this.params.isContoured= !0);this.params.colorBySign&&(this.params.isBicolorMap=!0);a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"insideOut").equals("true");var f=d=c=NaN,g=NaN;this.jvxlDataIsColorMapped&&(c=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"dataMinimum")),d=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"dataMaximum")),f=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"valueMappedToRed")),g=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"valueMappedToBlue")),Float.isNaN(c)&& (c=f=-1,d=g=1));this.jvxlSetColorRanges(c,d,f,g,a)});e(c$,"jvxlSetColorRanges",function(a,b,c,d,e){this.jvxlDataIsColorMapped&&(!Float.isNaN(a)&&!Float.isNaN(b)&&(0==b&&0==a&&(a=-1,b=1),this.params.mappedDataMin=a,this.params.mappedDataMax=b,JU.Logger.info("JVXL read: data_min/max "+this.params.mappedDataMin+"/"+this.params.mappedDataMax)),this.params.rangeDefined||(!Float.isNaN(c)&&!Float.isNaN(d)?(0==c&&0==d&&(c=-1,d=1),this.params.valueMappedToRed=Math.min(c,d),this.params.valueMappedToBlue=Math.max(c, d),this.params.isColorReversed=c>d):(this.params.valueMappedToRed=0,this.params.valueMappedToBlue=1),this.params.rangeDefined=!0),JU.Logger.info("JVXL read: color red/blue: "+this.params.valueMappedToRed+"/"+this.params.valueMappedToBlue));this.jvxlData.valueMappedToRed=this.params.valueMappedToRed;this.jvxlData.valueMappedToBlue=this.params.valueMappedToBlue;this.jvxlData.mappedDataMin=this.params.mappedDataMin;this.jvxlData.mappedDataMax=this.params.mappedDataMax;this.jvxlData.isColorReversed=this.params.isColorReversed; this.jvxlData.insideOut=e;this.params.insideOut&&(this.jvxlData.insideOut=!this.jvxlData.insideOut);this.params.insideOut=this.jvxlData.insideOut},"~N,~N,~N,~N,~B");j(c$,"readSurfaceData",function(){this.thisInside=!this.params.isContoured;this.readSurfaceDataXML()||(this.tempDataXml=this.xr.getXmlData("jvxlEdgeData",null,!0,!1),this.bsVoxelBitSet=J.jvxl.data.JvxlCoder.jvxlDecodeBitSet(this.xr.getXmlData("jvxlEdgeData",this.tempDataXml,!1,!1)),this.readSurfaceDataJXR())},"~B");e(c$,"readSurfaceDataXML", function(){return this.vertexDataOnly?(this.getEncodedVertexData(),!0):null!=this.params.thePlane?(this.volumeData.setDataDistanceToPlane(this.params.thePlane),this.setVolumeDataV(this.volumeData),this.params.cutoff=0,this.jvxlData.setSurfaceInfo(this.params.thePlane,this.params.mapLattice,0,""),this.jvxlData.scale3d=this.params.scale3d,!0):!1});e(c$,"readSurfaceDataJXR",function(){this.readSurfaceDataVFR(!1);this.volumeData.setMappingPlane(null)});e(c$,"jvxlReadFractionData",function(a){var b;try{if(a.equals("edge"))b= J.jvxl.data.JvxlCoder.jvxlDecompressString(J.jvxl.readers.XmlReader.getXmlAttrib(this.tempDataXml,"data"));else{var c=this.xr.getXmlData("jvxlColorData",null,!0,!1);this.jvxlData.isJvxlPrecisionColor=J.jvxl.readers.JvxlXmlReader.getEncoding(c).endsWith("2");b=J.jvxl.data.JvxlCoder.jvxlDecompressString(J.jvxl.readers.XmlReader.getXmlAttrib(c,"data"))}}catch(d){if(U(d,Exception))throw JU.Logger.error("Error reading "+a+" data "+d),new NullPointerException;throw d;}return b},"~S,~N");j(c$,"getVoxelBitSet", function(a){if(null!=this.bsVoxelBitSet)return this.bsVoxelBitSet;var b=new JU.BS,c=0;if(0>=this.surfaceDataCount)return b;for(var d=0;c<a;){d=this.parseInt();if(-2147483648==d&&(this.rd(),null==this.line||-2147483648==(d=this.parseIntStr(this.line))))this.endOfData||JU.Logger.error("end of file in JvxlReader? line="+this.line),this.endOfData=!0,d=1E4;this.thisInside=!this.thisInside;++this.jvxlNSurfaceInts;this.thisInside&&b.setBits(c,c+d);c+=d}return b},"~N");j(c$,"getSurfacePointAndFraction",function(a, b,c,d,e,f,g,j,p,k,n,q,t){if(0>=this.edgeDataCount)return this.getSPFv(a,b,c,d,e,f,g,j,p,k,n,q,t);t.scaleAdd2(q[0]=this.jvxlGetNextFraction(this.edgeFractionBase,this.edgeFractionRange,0.5),f,e);Float.isNaN(this.valueMin)&&this.setValueMinMax();return 0==this.valueCount||this.includeValueNaN&&Float.isNaN(q[0])?q[0]:this.getNextValue()},"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");e(c$,"getNextValue",function(){for(var a=NaN;this.colorPtr<this.valueCount&&Float.isNaN(a);){a=this.jvxlData.isJvxlPrecisionColor? J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2(this.jvxlColorDataRead.charCodeAt(this.colorPtr),this.jvxlColorDataRead.charCodeAt(this.colorPtr++ +this.valueCount),this.colorFractionBase,this.colorFractionRange):J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(this.jvxlColorDataRead.charCodeAt(this.colorPtr++),this.colorFractionBase,this.colorFractionRange,0.5);break}return this.valueMin+a*this.valueRange});e(c$,"setValueMinMax",function(){this.valueCount=this.jvxlColorDataRead.length;this.jvxlData.isJvxlPrecisionColor&& (this.valueCount/=2);this.includeValueNaN=this.valueCount!=this.jvxlEdgeDataRead.length;this.valueMin=!this.jvxlData.isJvxlPrecisionColor?this.params.valueMappedToRed:3.4028235E38==this.params.mappedDataMin?0:this.params.mappedDataMin;this.valueRange=(!this.jvxlData.isJvxlPrecisionColor?this.params.valueMappedToBlue:3.4028235E38==this.params.mappedDataMin?1:this.params.mappedDataMax)-this.valueMin;this.haveReadColorData=!0});e(c$,"jvxlGetNextFraction",function(a,b,c){this.fractionPtr>=this.strFractionTemp.length&& (this.endOfData||JU.Logger.error("end of file reading compressed fraction data"),this.endOfData=!0,this.strFractionTemp=""+String.fromCharCode(a),this.fractionPtr=0);return J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(this.strFractionTemp.charCodeAt(this.fractionPtr++),a,b,c)},"~N,~N,~N");j(c$,"readColorData",function(){if(!this.jvxlDataIsColorMapped)return"";var a=this.jvxlData.vertexCount=this.meshData.vc,b=this.meshData.vcs,c=this.meshData.vvs;if("none".equals(this.jvxlColorEncodingRead)){this.jvxlData.vertexColors= p(a,0);for(var d=p(1,0),c=JU.PT.parseIntNext(this.jvxlColorDataRead,d),c=Math.min(c,a),a=JU.PT.getTokens(this.jvxlColorDataRead.substring(d[0])),e=!1,f=this.jvxlData.translucency,g=0,d=0;d<c;d++)try{var j=J.jvxl.readers.JvxlXmlReader.getColor(a[d]);0==j?j=g:g=j;b[d]=JU.C.getColixTranslucent(this.jvxlData.vertexColors[d]=j);JU.C.isColixTranslucent(b[d])?e=!0:0!=f&&(b[d]=JU.C.getColixTranslucent3(b[d],!0,f))}catch(u){if(U(u,Exception))JU.Logger.info("JvxlXmlReader: Cannot interpret color code: "+a[d]); else throw u;}e&&0==f&&(this.jvxlData.translucency=0.5);return"-"}null==this.params.colorEncoder&&(this.params.colorEncoder=new JU.ColorEncoder(null,null));this.params.colorEncoder.setColorScheme(null,!1);this.params.colorEncoder.setRange(this.params.valueMappedToRed,this.params.valueMappedToBlue,this.params.isColorReversed);JU.Logger.info("JVXL reading color data mapped min/max: "+this.params.mappedDataMin+"/"+this.params.mappedDataMax+" for "+a+" vertices. using encoding keys "+this.colorFractionBase+ " "+this.colorFractionRange);JU.Logger.info("mapping red--\x3eblue for "+this.params.valueMappedToRed+" to "+this.params.valueMappedToBlue+" colorPrecision:"+this.jvxlData.isJvxlPrecisionColor);var k=Float.isNaN(this.valueMin);k&&this.setValueMinMax();var n=3.4028235E38,q=-3.4028235E38;if(null==b||b.length<a)this.meshData.vcs=b=Z(a,0);e=j=0;this.params.colorBySign&&(e=JU.C.getColix(this.params.isColorReversed?this.params.colorNeg:this.params.colorPos),j=JU.C.getColix(this.params.isColorReversed?this.params.colorPos: this.params.colorNeg));for(var f=this.meshData.vertexIncrement,t=3.4028235E38==this.params.mappedDataMin,d=0;d<a;d+=f)g=k?c[d]=this.getNextValue():c[d],t&&(g<n&&(n=g),g>q&&(q=g));t&&(this.params.mappedDataMin=n,this.params.mappedDataMax=q);if(null!=this.jvxlData.colorScheme){k=null!=this.marchingSquares&&this.params.isContoured;for(d=0;d<a;d+=f)g=c[d],k?this.marchingSquares.setContourData(d,g):(g=!this.params.colorBySign?this.params.colorEncoder.getColorIndex(g):(this.params.isColorReversed?0<g:0>= g)?j:e,b[d]=JU.C.getColixTranslucent3(g,!0,this.jvxlData.translucency))}return this.jvxlColorDataRead+"\n"});c$.getColor=e(c$,"getColor",function(a){var b=0;try{switch(a.charAt(0)){case "[":b=JU.CU.getArgbFromString(a);break;case "0":b=JU.PT.parseIntRadix(a.substring(2),16);break;default:b=JU.PT.parseIntRadix(a,10)}}catch(c){if(!U(c,Exception))throw c;}return b},"~S");e(c$,"getEncodedVertexData",function(){var a=this.xr.getXmlData("jvxlSurfaceData",null,!0,!1);this.jvxlDecodeVertexData(this.xr.getXmlData("jvxlVertexData", a,!0,!1),!1);var b=this.xr.getXmlData("jvxlTriangleData",a,!0,!1),c=this.xr.getXmlData("jvxlTriangleEdgeData",a,!0,!1),d=this.xr.getXmlData("jvxlPolygonColorData",a,!1,!1);this.jvxlDecodeTriangleData(b,c,d);a=this.xr.getXmlData("jvxlColorData",a,!0,!1);this.jvxlColorEncodingRead=J.jvxl.readers.JvxlXmlReader.getEncoding(a);this.jvxlData.isJvxlPrecisionColor=this.jvxlColorEncodingRead.endsWith("2");a=this.getData(a,"jvxlColorData");this.jvxlColorDataRead=this.jvxlColorEncodingRead.equals("none")?a: J.jvxl.data.JvxlCoder.jvxlDecompressString(a);this.jvxlDataIsColorMapped=(-2147483648==this.params.colorRgb||2147483647==this.params.colorRgb)&&0<this.jvxlColorDataRead.length;this.haveContourData&&this.jvxlDecodeContourData(this.jvxlData,this.xr.getXmlData("jvxlContourData",null,!1,!1))});e(c$,"getData",function(a,b){var c=J.jvxl.readers.XmlReader.getXmlAttrib(a,"data");0==c.length&&(c=this.xr.getXmlData(b,a,!1,!1));return c},"~S,~S");c$.getEncoding=e(c$,"getEncoding",function(a){if(0<J.jvxl.readers.XmlReader.getXmlAttrib(a, "len").length)return"";a=J.jvxl.readers.XmlReader.getXmlAttrib(a,"encoding");return 0==a.length?"none":a},"~S");e(c$,"jvxlDecodeVertexData",function(a,b){var c=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"count"));b||JU.Logger.info("Reading "+c+" vertices");var d=3*c,e=b?Array(c):null,f,g=J.jvxl.readers.XmlReader.getXmlAttrib(a,"data"),j=J.jvxl.readers.JvxlXmlReader.getEncoding(a);if("none".equals(j)){0==g.length&&(g=this.xr.getXmlData("jvxlVertexData",a,!1,!1));d=JU.PT.parseFloatArray(g); d[0]!=3*c&&JU.Logger.info("JvxlXmlReader: vertexData count="+y(d[0])+"; expected "+3*c);g=0;for(j=1;g<c;g++){var p=JU.P3.new3(d[j++],d[j++],d[j++]);b?e[g]=p:this.addVertexCopy(p,0,g,!1)}}else{var k=this.xr.getXmlPoint(a,"min"),n=this.xr.getXmlPoint(a,"max");n.sub(k);var q=this.jvxlData.colorFractionBase,t=this.jvxlData.colorFractionRange,r=J.jvxl.data.JvxlCoder.jvxlDecompressString(g);0==r.length&&(r=this.xr.getXmlData("jvxlVertexData",a,!1,!1));g=0;for(j=-1;g<c;g++)p=new JU.P3,f=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2(r.charCodeAt(++j), r.charCodeAt(j+d),q,t),p.x=k.x+f*n.x,f=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2(r.charCodeAt(++j),r.charCodeAt(j+d),q,t),p.y=k.y+f*n.y,f=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2(r.charCodeAt(++j),r.charCodeAt(j+d),q,t),p.z=k.z+f*n.z,b?e[g]=p:this.addVertexCopy(p,0,g,!1)}return e},"~S,~B");e(c$,"jvxlDecodeTriangleData",function(a,b,c){var d=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"count"));if(!(0>d)){var e=p(1,0),f=null==c?-1:1,g=0;JU.Logger.info("Reading "+d+" triangles"); var j=J.jvxl.readers.JvxlXmlReader.getEncoding(a);a=this.getData(a,"jvxlTriangleData");b=this.getData(b,"jvxlTriangleEdgeData");var u=p(3,0),k=p(1,0),n=null,q=7,t=!"none".equals(j);if(t)a=J.jvxl.data.JvxlCoder.jvxlDecompressString(a),b=J.jvxl.data.JvxlCoder.jvxlDecompressString(b).trim(),j=b.length==d;else{var r=JU.PT.parseIntNext(a,k);(j=0<b.length)?(n=p(1,0),JU.PT.parseIntNext(b,n)):0<r&&JU.Logger.info("JvxlXmlReader: jvxlTriangleEdgeData count="+r+"; expected "+d)}for(var w=r=0,y=0,E=-1;r<d;){if(t){var C= a.charAt(++E);switch(C){case "!":C=0;break;case "+":case ".":case " ":case "\n":case "\r":case "\t":case ",":continue;case "-":case "0":case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":k[0]=E;C=JU.PT.parseIntNext(a,k);E=k[0]-1;break;default:C=C.charCodeAt(0)-92}w+=C}else w=JU.PT.parseIntNext(a,k)-1;u[y]=w;if(3==++y){y=0;if(j&&(q=null==n?b.charCodeAt(r)-48:JU.PT.parseIntNext(b,n),0>q||7<q))q=7;0==--f&&(f=JU.PT.parseIntNext(c,e),C=JU.PT.parseIntNext(c,e),-2147483648== C?f=0:g=C|4278190080);this.addTriangleCheck(u[0],u[1],u[2],q,g,!1,g);r++}}}},"~S,~S,~S");e(c$,"jvxlDecodeContourData",function(a,b){var c=new JU.Lst,d=new JU.SB,e=new JU.SB,f=-1;a.vContours=null;if(null!=b){for(;0<=(f=b.indexOf("<jvxlContour",f+1));){var g=new JU.Lst,j=this.xr.getXmlData("jvxlContour",b.substring(f),!0,!1),p=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(j,"value"));d.append(" ").appendF(p);var k=J.jvxl.readers.JvxlXmlReader.getColor(J.jvxl.readers.XmlReader.getXmlAttrib(j, "color")),n=JU.C.getColix(k);e.append(" ").append(JU.Escape.escapeColor(k));var q=J.jvxl.data.JvxlCoder.jvxlDecompressString(J.jvxl.readers.XmlReader.getXmlAttrib(j,"data")),t=J.jvxl.data.JvxlCoder.jvxlDecodeBitSet(this.xr.getXmlData("jvxlContour",j,!1,!1)),j=t.length();J.shapesurface.IsosurfaceMesh.setContourVector(g,j,t,p,n,k,JU.SB.newS(q));c.addLast(g)}j=c.size();if(0<j){a.vContours=JU.AU.createArrayOfArrayList(j);a.contourColixes=this.params.contourColixes=Z(j,0);a.contourValues=this.params.contoursDiscrete= u(j,0);for(f=0;f<j;f++)a.vContours[f]=c.get(f),a.contourValues[f]=a.vContours[f].get(2).floatValue(),a.contourColixes[f]=a.vContours[f].get(3)[0];a.contourColors=JU.C.getHexCodes(a.contourColixes);JU.Logger.info("JVXL read: "+j+" discrete contours");JU.Logger.info("JVXL read: contour values: "+d);JU.Logger.info("JVXL read: contour colors: "+e)}}},"J.jvxl.data.JvxlData,~S");j(c$,"postProcessVertices",function(){var a=this.params.bsExcluded[1];null!=a&&(null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData, 1,null),this.meshData.invalidateVertices(a),null!=this.meshDataServer&&(this.meshDataServer.fillMeshData(this.meshData,4,null),this.meshData=new J.jvxl.data.MeshData),this.updateTriangles())})});H("J.rendersurface");K(["J.render.MeshRenderer"],"J.rendersurface.IsosurfaceRenderer",["java.lang.Boolean","$.Float","JU.V3","JU.C","$.Normix"],function(){c$=C(function(){this.isBicolorMap=this.iHideBackground=!1;this.nError=this.backgroundColix=0;this.isosurface=this.imesh=this.vertexValues=null;this.showNumbers= this.iShowNormals=this.isNavigationMode=!1;this.showKey=null;this.hasColorRange=!1;this.meshScale=-1;this.globalSlabValue=this.mySlabValue=0;G(this,arguments)},J.rendersurface,"IsosurfaceRenderer",J.render.MeshRenderer);j(c$,"render",function(){return this.renderIso()});e(c$,"renderIso",function(){this.setGlobals();for(var a=this.isosurface.meshCount;0<=--a;)if(this.mesh=this.imesh=this.isosurface.meshes[a],null==this.imesh.connections||this.vwr.ms.at[this.imesh.connections[0]].checkVisible())this.hasColorRange= !1,this.renderMeshSlab()&&(this.renderInfo(),this.isExport&&this.isGhostPass&&(this.exportPass=1,this.renderMeshSlab(),this.exportPass=2));return this.needTranslucent});e(c$,"setGlobals",function(){this.needTranslucent=!1;this.antialias=this.g3d.isAntialiased();this.iShowNormals=this.vwr.getTestFlag(4);this.showNumbers=this.vwr.getTestFlag(3);this.isosurface=this.shape;this.exportPass=this.isExport?2:0;this.isNavigationMode=this.vwr.getBoolean(603979888);this.showKey=this.vwr.getBoolean(603979869)? Boolean.TRUE:null;this.isosurface.keyXy=null;this.meshScale=-1;this.globalSlabValue=this.vwr.gdata.slab;this.mySlabValue=this.isNavigationMode?y(this.tm.getNavigationOffset().z):2147483647});e(c$,"renderInfo",function(){if(!this.isExport&&this.hasColorRange&&!(null==this.imesh.colorEncoder||Boolean.TRUE!==this.showKey)){this.showKey=Boolean.FALSE;var a=null,b=null,c=null,d=0,e=0;if(this.imesh.showContourLines)if(c=this.imesh.getContours(),null==c){b=this.imesh.jvxlData.contourColixes;if(null==b)return; d=b.length}else d=c.length,e=1;else a=this.imesh.colorEncoder.getColorSchemeArray(this.imesh.colorEncoder.currentPalette),d=null==a?0:a.length,e=2;if(!(2>d)){var f=this.antialias?2:1,g=this.vwr.getScreenHeight()*f,j=E(E(g/2)/(d-1)),g=3*E(g/4)-j,u=10*f,k=20*f;this.isosurface.keyXy=p(-1,[E(u/f),0,E((u+k)/f),E((g+j)/f),E(j/f)]);for(var n=0;n<d;n++,g-=j){switch(e){case 0:if(!this.g3d.setC(b[n]))return;break;case 1:if(!this.g3d.setC(c[n].get(3)[0]))return;break;case 2:this.vwr.gdata.setColor(a[n])}this.g3d.fillRect(u, g,5,-2147483648,k,j)}this.isosurface.keyXy[1]=E((g+j)/f)}}});e(c$,"renderMeshSlab",function(){this.volumeRender=this.imesh.jvxlData.colorDensity&&this.imesh.jvxlData.allowVolumeRender;var a=this.mySlabValue;this.frontOnly=this.mesh.frontOnly||26==this.shapeID;if(!this.isNavigationMode&&(this.meshSlabValue=this.imesh.jvxlData.slabValue,-2147483648!=this.meshSlabValue&&this.imesh.jvxlData.isSlabbable)){for(var b=this.imesh.jvxlData.boundingBox,a=3.4028235E38,c=1.4E-45,d=b.length;0<=--d;)this.pt2f.setT(b[d]), this.tm.transformPt3f(this.pt2f,this.pt2f),this.pt2f.z<a&&(a=this.pt2f.z),this.pt2f.z>c&&(c=this.pt2f.z);a=Math.round(a+(c-a)*(100-this.meshSlabValue)/100);this.frontOnly=(new Boolean(this.frontOnly&100<=this.meshSlabValue)).valueOf()}b=this.vwr.gdata.translucentCoverOnly;this.vwr.gdata.translucentCoverOnly=this.frontOnly||!this.vwr.getBoolean(603979967);this.thePlane=this.imesh.jvxlData.jvxlPlane;this.vertexValues=this.mesh.vvs;2147483647!=a&&this.imesh.jvxlData.isSlabbable?(this.g3d.setSlab(a), a=this.renderMesh2(this.mesh),this.g3d.setSlab(this.globalSlabValue)):a=this.renderMesh2(this.mesh);this.vwr.gdata.translucentCoverOnly=b;return a});j(c$,"render2",function(a){if(this.volumeRender)this.renderPoints();else{switch(this.imesh.dataType){case 70:this.renderLonePair(!1);return;case 71:this.renderLonePair(!0);return}this.isBicolorMap=this.imesh.jvxlData.isBicolorMap;this.render2b(a);this.g3d.setC(4)&&this.imesh.showContourLines&&this.renderContourLines()}},"~B");e(c$,"renderLonePair",function(a){this.pt2f.setT(this.vertices[1]); this.tm.transformPt3f(this.pt2f,this.pt2f);var b=y(this.vwr.tm.scaleToScreen(y(this.pt2f.z),100));1>b&&(b=1);if(!a){var c=new JU.V3;a=new JU.V3;this.pt1f.setT(this.vertices[0]);this.tm.transformPt3f(this.pt1f,this.pt1f);c.sub2(this.pt2f,this.pt1f);a.set(c.x,c.y,c.z+1);a.cross(a,c);a.normalize();c=this.vwr.tm.scaleToScreen(y(this.pt1f.z),100);a.scale(c);this.pt1f.add2(this.pt2f,a);this.pt2f.sub(a);this.screens[0].set(Math.round(this.pt1f.x),Math.round(this.pt1f.y),Math.round(this.pt1f.z));this.g3d.fillSphereI(b, this.screens[0])}this.screens[1].set(Math.round(this.pt2f.x),Math.round(this.pt2f.y),Math.round(this.pt2f.z));this.g3d.fillSphereI(b,this.screens[1])},"~B");e(c$,"renderContourLines",function(){var a=this.imesh.getContours();if(null==a)null!=this.imesh.jvxlData.contourValues&&(this.hasColorRange=!0);else{this.hasColorRange=0==this.mesh.meshColix;for(var b=a.length;0<=--b;){var c=a[b];if(!(6>c.size())){this.colix=0==this.mesh.meshColix?c.get(3)[0]:this.mesh.meshColix;if(!this.g3d.setC(this.colix))break; for(var d=c.size()-1,e=this.getDiameter(),f=6;f<d;f++){var g=c.get(f),j=c.get(++f);if(Float.isNaN(g.x)||Float.isNaN(j.x))break;this.tm.transformPtScrT3(g,this.pt1f);this.tm.transformPtScrT3(j,this.pt2f);this.pt1f.z-=2;this.pt2f.z-=2;!this.antialias&&1==e?this.g3d.drawLineAB(this.pt1f,this.pt2f):this.g3d.fillCylinderBits(1,e,this.pt1f,this.pt2f)}}}}});j(c$,"renderPoints",function(){try{this.volumeRender&&this.g3d.volumeRender(!0);var a=(this.volumeRender||0==this.mesh.pc)&&this.selectedPolyOnly,b= this.imesh.vertexIncrement,c;0>=this.mesh.diameter?(c=this.vwr.getInt(553648144),this.frontOnly=!1):c=E(this.vwr.getScreenDim()/(this.volumeRender?50:100));var d=Math.round(Float.isNaN(this.mesh.volumeRenderPointSize)?150:1E3*this.mesh.volumeRenderPointSize);1>c&&(c=1);var e=this.showNumbers?E(this.vwr.getScreenWidth()/2):0,f=this.showNumbers?E(this.vwr.getScreenHeight()/2):0;this.showNumbers&&this.vwr.gdata.setFontFid(this.vwr.gdata.getFontFidFS("Monospaced",24));for(var g=!this.imesh.hasGridPoints|| 0>this.imesh.firstRealVertex?0:this.imesh.firstRealVertex;g<this.vertexCount;g+=b)if(!(null!=this.vertexValues&&Float.isNaN(this.vertexValues[g])||this.frontOnly&&0>this.transformedVectors[this.normixes[g]].z||0<=this.imesh.jvxlData.thisSet&&this.mesh.vertexSets[g]!=this.imesh.jvxlData.thisSet||!this.mesh.isColorSolid&&null!=this.mesh.vcs&&!this.setColix(this.mesh.vcs[g])||this.haveBsDisplay&&!this.mesh.bsDisplay.get(g)||a&&!this.bsPolygons.get(g))){this.hasColorRange=!0;if(this.showNumbers&&10<this.screens[g].z&& 150>Math.abs(this.screens[g].x-e)&&150>Math.abs(this.screens[g].y-f)){var j=g+(this.mesh.isColorSolid?"":" "+this.mesh.vvs[g]);this.g3d.setC(4);this.g3d.drawStringNoSlab(j,null,this.screens[g].x,this.screens[g].y,this.screens[g].z-30,0)}this.volumeRender?(c=y(this.vwr.tm.scaleToScreen(this.screens[g].z,d)),1>c&&(c=1),this.g3d.volumeRender4(c,this.screens[g].x,this.screens[g].y,this.screens[g].z)):this.g3d.fillSphereI(c,this.screens[g])}if(3==b){this.g3d.setC(this.isTranslucent?JU.C.getColixTranslucent3(12, !0,0.5):12);for(g=1;g<this.vertexCount;g+=3)this.g3d.fillCylinder(3,E(c/4),this.screens[g],this.screens[g+1]);this.g3d.setC(this.isTranslucent?JU.C.getColixTranslucent3(21,!0,0.5):21);for(g=1;g<this.vertexCount;g+=3)this.g3d.fillSphereI(c,this.screens[g]);this.g3d.setC(this.isTranslucent?JU.C.getColixTranslucent3(7,!0,0.5):7);for(g=2;g<this.vertexCount;g+=3)this.g3d.fillSphereI(c,this.screens[g])}}catch(p){}this.volumeRender&&this.g3d.volumeRender(!1)});j(c$,"renderTriangles",function(a,b,c){this.g3d.addRenderer(1073742182); var d=this.mesh.pis;this.colix=this.isGhostPass?this.mesh.slabColix:!a&&0!=this.mesh.meshColix?this.mesh.meshColix:this.mesh.colix;var e=!a&&0!=this.mesh.meshColix?null:this.mesh.vcs;this.isTranslucentInherit&&(this.colix=JU.C.copyColixTranslucency(this.mesh.slabColix,this.mesh.colix));this.g3d.setC(this.colix);c&&(this.frontOnly&&a&&(this.frontOnly=!1),this.bsPolygonsToExport.clearAll());1==this.exportType&&(this.frontOnly=!1);var f=this.isGhostPass&&!this.isBicolorMap||null==e||this.mesh.isColorSolid, g=this.isGhostPass&&!this.isBicolorMap||null==e||!a&&0!=this.mesh.meshColix,j=this.colix;null!=this.imesh.jvxlData.jvxlPlane&&(!f&&!a&&this.mesh.fillTriangles)&&(f=!0,j=4);var p=f&&null!=this.mesh.pcs;p&&(!a&&this.mesh.fillTriangles)&&(p=!1);var k=this.imesh.jvxlData.contourColixes;this.hasColorRange=!f&&!this.isBicolorMap;for(var n=this.getDiameter(),q=this.mesh.pc;0<=--q;){var t=d[q];if(!(null==t||this.selectedPolyOnly&&!this.bsPolygons.get(q))){var r=t[0],u=t[1],w=t[2];if(!(0<=this.imesh.jvxlData.thisSet&& null!=this.mesh.vertexSets&&this.mesh.vertexSets[r]!=this.imesh.jvxlData.thisSet)&&(!this.haveBsDisplay||this.mesh.bsDisplay.get(r)&&this.mesh.bsDisplay.get(u)&&this.mesh.bsDisplay.get(w))){var y=this.normixes[r],C=this.normixes[u],E=this.normixes[w],B=this.checkNormals(y,C,E);if(!(a&&0==B)){var D,A,G;if(f){if(p&&q<this.mesh.pcs.length){D=this.mesh.pcs[q];if(0==D)continue;j=D}b&&(j=Math.round(10*Math.random())+5);D=A=G=j}else if(D=e[r],A=e[u],G=e[w],this.isBicolorMap){if(D!=A||A!=G)continue;this.isGhostPass&& (D=A=G=JU.C.copyColixTranslucency(this.mesh.slabColix,D))}if(a)c?this.bsPolygonsToExport.set(q):(u==w?(this.setColix(D),r==u?this.g3d.fillSphereI(n,this.screens[r]):this.g3d.fillCylinder(3,n,this.screens[r],this.screens[u])):this.mesh.colorsExplicit?(this.vwr.gdata.setColor(t[4]),D=JU.C.copyColixTranslucency(this.mesh.colix,2047),this.g3d.setC(D),this.g3d.fillTriangle3CN(this.screens[r],D,y,this.screens[u],D,C,this.screens[w],D,E)):(this.isTranslucentInherit&&null!=e&&(D=JU.C.copyColixTranslucency(this.mesh.slabColix, e[r]),A=JU.C.copyColixTranslucency(this.mesh.slabColix,e[u]),G=JU.C.copyColixTranslucency(this.mesh.slabColix,e[w])),this.g3d.fillTriangle3CN(this.screens[r],D,y,this.screens[u],A,C,this.screens[w],G,E)),this.iShowNormals&&this.renderNormals());else if(B&=t[3],0!=B){b&&(B=7);this.pt1i.setT(this.screens[r]);this.pt2i.setT(this.screens[u]);this.pt3i.setT(this.screens[w]);this.pt1i.z-=2;this.pt2i.z-=2;this.pt3i.z-=2;if(!g)if(p)this.g3d.setC(this.mesh.fillTriangles?4:k[t[4]%k.length]);else{this.drawTriangle(this.pt1i, D,this.pt2i,A,this.pt3i,G,B,n);continue}this.drawTriangle(this.pt1i,j,this.pt2i,j,this.pt3i,j,B,n)}}}}}c&&this.exportSurface(f?j:0)},"~B,~B,~B");e(c$,"getDiameter",function(){var a;0>=this.mesh.diameter?(a=0>this.meshScale?this.meshScale=this.vwr.getInt(553648151):this.meshScale,this.antialias&&(a*=2)):a=E(this.vwr.getScreenDim()/100);1>a&&(a=1);return a});e(c$,"renderNormals",function(){if(this.g3d.setC(JU.C.copyColixTranslucency(this.mesh.colix,8))){this.vwr.gdata.setFontFid(this.vwr.gdata.getFontFidFS("Monospaced", 24));for(var a=JU.Normix.getVertexVectors(),b=this.vertexCount;0<=--b;)if(!(null!=this.vertexValues&&Float.isNaN(this.vertexValues[b]))&&!(100<b)){this.pt1f.setT(this.vertices[b]);var c=this.mesh.normixes[b];0<=c&&(this.pt1f.scaleAdd2(3,a[c],this.pt1f),this.tm.transformPtScrT3(this.pt1f,this.pt1f),this.pt1f.set(this.screens[b].x,this.screens[b].y,this.screens[b].z),this.g3d.drawLineAB(this.pt1f,this.pt1f))}}})})})(Clazz,Clazz.newLongArray,Clazz.doubleToByte,Clazz.doubleToInt,Clazz.doubleToLong,Clazz.declarePackage, Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.floatToLong,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.defineStatics,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.p0p,Clazz.pu$h,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall, Clazz.decorateAsType,Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs,Clazz.alert,Clazz.defineMethod,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.cloneFinals);
ekimb/esperite
jsmol/j2s/core/coresurface.z.js
JavaScript
mit
327,849
module.exports={A:{A:{"2":"J C G E B A TB"},B:{"2":"D X g H L"},C:{"2":"1 2 3 RB F I J C G E B A D X g H L M N O P Q R S T U V W t Y Z a b c d e f K h i j k l m n o p q v w x y z s r PB OB"},D:{"1":"1 2 7 9 F I J C G E B A D X g H L M N O P Q R S T U V W t Y Z a b c d e f K h i j k l m n o p q v w x y z s r DB SB AB BB"},E:{"1":"6 F I J C G E B A CB EB FB GB HB IB JB"},F:{"1":"0 4 5 A D H L M N O P Q R S T U V W t Y Z a b c d e f K h i j k l m n o p q MB NB QB","2":"E KB LB"},G:{"1":"6 8 G A u UB VB WB XB YB ZB aB bB"},H:{"2":"cB"},I:{"1":"3 F r dB eB fB gB u hB iB"},J:{"1":"C B"},K:{"1":"0 4 5 A D K","2":"B"},L:{"1":"7"},M:{"2":"s"},N:{"2":"B A"},O:{"1":"jB"},P:{"1":"F I"},Q:{"1":"kB"},R:{"1":"lB"}},B:7,C:"Web SQL Database"};
asrar7787/Test-Frontools
node_modules/caniuse-lite/data/features/sql-storage.js
JavaScript
mit
737
module.exports={A:{A:{"2":"H D G E A B EB"},B:{"2":"C p x J L","129":"N I"},C:{"2":"0 1 2 3 4 5 6 8 9 ZB BB F K H D G E A B C p x J L N I O P Q R S T U V W X Y Z b c d e f g h i j k l m n o M q r s t u v w y XB RB"},D:{"16":"F K H D G E A B C p","33":"0 1 2 3 4 5 6 8 9 x J L N I O P Q R S T U V W X Y Z b c d e f g h i j k l m n o M q r s t u v w y LB GB FB bB a HB IB JB"},E:{"2":"F KB CB","33":"K H D G E A B C MB NB OB PB QB z SB"},F:{"2":"7 E B C TB UB VB WB z AB YB","33":"0 J L N I O P Q R S T U V W X Y Z b c d e f g h i j k l m n o M q r s t u v w"},G:{"2":"CB aB DB","33":"G cB dB eB fB gB hB iB jB kB lB"},H:{"2":"mB"},I:{"16":"nB oB","33":"BB F a pB qB DB rB sB"},J:{"33":"D A"},K:{"2":"7 A B C z AB","33":"M"},L:{"33":"a"},M:{"2":"y"},N:{"2":"A B"},O:{"33":"tB"},P:{"33":"F K uB vB"},Q:{"33":"wB"},R:{"33":"xB"}},B:7,C:"CSS line-clamp"};
gabz75/ember-cli-deploy-redis-publish
node_modules/caniuse-lite/data/features/css-line-clamp.js
JavaScript
mit
851
define("ace/snippets/slim",["require","exports","module"],function(e,o,t){"use strict";o.snippetText=void 0,o.scope="slim"}),window.require(["ace/snippets/slim"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)});
cdnjs/cdnjs
ajax/libs/ace/1.4.9/snippets/slim.min.js
JavaScript
mit
254
//! moment.js locale configuration //! locale : great britain scottish gealic (gd) //! author : Jon Ashdown : https://github.com/jonashdown import moment from '../moment'; var months = [ 'Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd' ]; var monthsShort = ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh']; var weekdays = ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne']; var weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis']; var weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa']; export default moment.defineLocale('gd', { months : months, monthsShort : monthsShort, weekdays : weekdays, weekdaysShort : weekdaysShort, weekdaysMin : weekdaysMin, longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', L : 'DD/MM/YYYY', LL : 'D MMMM YYYY', LLL : 'D MMMM YYYY HH:mm', LLLL : 'dddd, D MMMM YYYY HH:mm' }, calendar : { sameDay : '[An-diugh aig] LT', nextDay : '[A-màireach aig] LT', nextWeek : 'dddd [aig] LT', lastDay : '[An-dè aig] LT', lastWeek : 'dddd [seo chaidh] [aig] LT', sameElse : 'L' }, relativeTime : { future : 'ann an %s', past : 'bho chionn %s', s : 'beagan diogan', m : 'mionaid', mm : '%d mionaidean', h : 'uair', hh : '%d uairean', d : 'latha', dd : '%d latha', M : 'mìos', MM : '%d mìosan', y : 'bliadhna', yy : '%d bliadhna' }, ordinalParse : /\d{1,2}(d|na|mh)/, ordinal : function (number) { var output = (number === 1) ? 'd' : (number.toString().substr(-1) === '2') ? 'na' : 'mh'; return number + output; }, week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } });
bbc/moment
src/locale/gd.js
JavaScript
mit
2,174
var Suckle = require('../'); var vows = require('vows') var assert = require('assert') var ReadStream = require('./readstream') var WriteStream = require('./writestream') var createMulticast = function(num, cb) { var suckle = new Suckle() var completed = [] var writeCallback = function(err, data) { if (err) return cb(err) completed.push(data.length) if (completed.length === num) { return cb(null, completed) } } var streams = [] for (var i=0;i<num;i++) { ;(function() { var ws = new WriteStream(writeCallback) ws.on('error', cb) streams.push(ws) })() } streams.forEach(function(stream) { suckle.pipe(stream) }) var rs = new ReadStream(2048, 1024) rs.pipe(suckle) rs.init() rs.on('error', cb) suckle.on('error', cb) } var validStream = { 'new Suckle': { topic:new Suckle(), 'has writable property':function(val) { assert.strictEqual(val.writable, true) }, 'has write method':function(val) { assert.strictEqual(typeof val.write, 'function') }, 'has end method':function(val) { assert.strictEqual(typeof val.end, 'function') } } } var unicast = { 'Data length 1024 chunksize 1024': { topic:function() { var ws = new WriteStream(this.callback) var suckle = new Suckle(ws) var rs = new ReadStream(1024, 1024) rs.pipe(suckle) rs.init() }, 'was streamed':function(val) { assert.ok(val) }, 'has length 1024':function(val) { assert.strictEqual(val.length, 1024) } }, 'Data length 102400 chunksize 8': { topic:function() { var ws = new WriteStream(this.callback) var suckle = new Suckle(ws) var rs = new ReadStream(102400, 8) rs.pipe(suckle) rs.init() }, 'was streamed':function(val) { assert.ok(val) }, 'has length 102400':function(val) { assert.strictEqual(val.length, 102400) } } } var multicast = { 'Two streams': { topic:function() { createMulticast(2, this.callback) }, 'should not err':function(err, val) { assert.ifError(err) }, 'were streamed':function(err, val) { assert.strictEqual(val.length, 2) }, 'received complete data':function(err, val) { assert.ok(val.every(function(i) { return i === 2048 })) } }, 'Ten streams': { topic:function() { createMulticast(10, this.callback) }, 'should not err':function(err, val) { assert.ifError(err) }, 'were streamed':function(err, val) { assert.strictEqual(val.length, 10) }, 'received complete data':function(err, val) { assert.ok(val.every(function(i) { return i === 2048 })) } }, 'One hundred streams': { topic:function() { createMulticast(100, this.callback) }, 'should not err':function(err, val) { assert.ifError(err) }, 'were streamed':function(err, val) { assert.strictEqual(val.length, 100) }, 'received complete data':function(err, val) { assert.ok(val.every(function(i) { return i === 2048 })) } } } var streamCallback = { 'Stream Callback (Constructor)': { topic:function() { var self = this var suckle = new Suckle(function(data) { return self.callback(null, data) }) var rs = new ReadStream(2048, 1024) suckle.on('error', this.callback) rs.on('error', this.callback) rs.pipe(suckle) rs.init() }, 'should not err':function(err, res) { assert.ifError(err) }, 'supplied accumulated data':function(err, res) { assert.strictEqual(res.length, 2048) } }, 'Stream Callback (oncomplete)': { topic:function() { var self = this var suckle = new Suckle() suckle.oncomplete(function(data) { return self.callback(null, data) }) var rs = new ReadStream(2048, 1024) suckle.on('error', this.callback) rs.on('error', this.callback) rs.pipe(suckle) rs.init() }, 'should not err':function(err, res) { assert.ifError(err) }, 'supplied accumulated data':function(err, res) { assert.strictEqual(res.length, 2048) } }, 'Stream Callback With Unicast': { topic:function() { var self = this var suckle = new Suckle() suckle.oncomplete(function(data) { return self.callback(null, data) }) var ws = new WriteStream() suckle.pipe(ws) var rs = new ReadStream(2048, 1024) suckle.on('error', this.callback) rs.on('error', this.callback) rs.pipe(suckle) rs.init() }, 'should not err':function(err, res) { assert.ifError(err) }, 'supplied accumulated data':function(err, res) { assert.strictEqual(res.length, 2048) } } } vows.describe('Validate Writable Stream') .addBatch(validStream) .export(module) vows.describe('Unicast') .addBatch(unicast) .export(module) vows.describe('Multicast') .addBatch(multicast) .export(module) vows.describe('Stream Callback') .addBatch(streamCallback) .export(module)
rcgray/geometryzen
node_modules/lactate/node_modules/suckle/test/test.js
JavaScript
mit
5,166
var roles = []; var users_authorized = []; var user_role_count = {}; var application = {}; // Handle authorize users to the application $(document).ready(function() { var application_name = $('#detailApplication') .find('h4.name') .contents() .get(0) .nodeValue.trim(); function htmlEntities(str) { return String(str) .replace(/&/g, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/"/g, '&quot;'); } // Pop up with a form to authorize new users to the application $('#auth_users_action_manage_application_users').click(function() { var applicationId = $(this) .closest('#auth_users') .attr('data-application_id'); var url = '/idm/applications/' + applicationId + '/edit/users'; $.get(url, function(data) { if (data.type === 'error') { exit_authorize_users(); $('#authorize_user').modal('toggle'); } else { users_authorized = data.users_authorized; roles = data.roles; // Relation between users and roles for (var i = 0; i < users_authorized.length; i++) { if (!user_role_count[users_authorized[i].user_id]) { user_role_count[users_authorized[i].user_id] = 0; } if (users_authorized[i].role_id) { user_role_count[users_authorized[i].user_id]++; } } if (users_authorized.length > 0) { for (var i = 0; i < users_authorized.length; i++) { if ( !$('#authorize_user') .find('#authorized_users') .find('#' + users_authorized[i].user_id).length ) { var assign_role_user_row = $( '#table_row_assign_role_user_template' ).html(); assign_role_user_row = assign_role_user_row.replace( /username/g, htmlEntities(users_authorized[i].username) ); assign_role_user_row = assign_role_user_row.replace( /user_id/g, String(users_authorized[i].user_id) ); assign_role_user_row = assign_role_user_row.replace( /user_avatar/g, String(users_authorized[i].image) ); assign_role_user_row = assign_role_user_row.replace( /application_name/g, htmlEntities(application_name) ); if (user_role_count[users_authorized[i].user_id] > 0) { assign_role_user_row = assign_role_user_row.replace( /roles_count/g, String( user_role_count[users_authorized[i].user_id] + ' roles' ) ); } else { assign_role_user_row = assign_role_user_row.replace( /roles_count/g, 'No roles' ); } $('#authorize_user') .find('#authorized_users') .append(assign_role_user_row); for (j in roles) { var role = '<li id=' + roles[j].id + " class='role_dropdown_role'><i class='fa fa-check'></i>" + roles[j].name + '</li>'; $('#authorize_user') .find('#authorized_users') .find('#' + users_authorized[i].user_id) .find('ol') .append(role); } } if (users_authorized[i].role_id) { $('#authorize_user') .find('#authorized_users') .find('#' + users_authorized[i].user_id) .find('#' + users_authorized[i].role_id) .addClass('active'); } } } else { $('#no_update_owners_users_members').show(); } } }); }); // Exit from form to authorize users to the application $('#authorize_user') .find('.cancel, .close') .click(function() { exit_authorize_users(); }); var typingTimerMembers; var doneTypingInterval = 500; // Send requests to server to obtain organization names and show in available members column $('#authorize_user') .find('#available_update_owners_users') .bind('keyup input', function(e) { var input = $(this).val(); clearTimeout(typingTimerMembers); typingTimerMembers = setTimeout(function() { available_users( input, 'table_row_available_user_template', 'available_members' ); }, doneTypingInterval); }); // Filter authorized members $('#authorize_user') .find('#update_owners_users_members') .bind('keyup input', function(e) { input = $(this); filter = $(this) .val() .toUpperCase(); ul = $('#authorize_user').find('#authorized_users'); li = ul.children(); for (i = 0; i < li.length; i++) { span = li[i].querySelectorAll('span.name')[0]; if (span.innerHTML.toUpperCase().indexOf(filter) > -1) { li[i].style.display = ''; } else { li[i].style.display = 'none'; } } if ( $('#authorize_user') .find('#authorized_users') .children(':visible').length == 0 ) { $('#no_update_owners_users_members').show(); } else { $('#no_update_owners_users_members').hide(); } $('#alert_error_search_authorized').hide('close'); }); // Change available organization to members column $('#available_members').on('click', '.active', function(event) { // Stop linking event.preventDefault(); $('#no_update_owners_users_members').hide(); // item of list row = $(this).parent(); // Id and name of user var user_id = row.parent().attr('id'); var username = row.find('.name').html(); var image = row .parent() .find('.avatar') .children('img') .first() .attr('src'); if ( $('#authorize_user') .find('ul.update_owners_users_members') .find('#' + user_id).length ) { info_added_user = "<span id='info_added_user' style='display: none; text-align: center;' class='help-block alert alert-warning'>User " + username + ' has been already added</span>'; $('#authorize_user') .find('#info_added_user') .replaceWith(info_added_user); $('#authorize_user') .find('#info_added_user') .fadeIn(800) .delay(300) .fadeOut(800); } else { var assign_role_user_row = $( '#table_row_assign_role_user_template' ).html(); assign_role_user_row = assign_role_user_row.replace( /username/g, htmlEntities(username) ); assign_role_user_row = assign_role_user_row.replace( /user_id/g, String(user_id) ); assign_role_user_row = assign_role_user_row.replace( /user_avatar/g, String(image) ); assign_role_user_row = assign_role_user_row.replace( /application_name/g, htmlEntities(application_name) ); assign_role_user_row = assign_role_user_row.replace( /roles_count/g, String('No roles') ); $('#authorize_user') .find('#authorized_users') .append(assign_role_user_row); for (j in roles) { var role = '<li id=' + roles[j].id + " class='role_dropdown_role'><i class='fa fa-check'></i>" + roles[j].name + '</li>'; $('#authorize_user') .find('#authorized_users') .find('#' + user_id) .find('ol') .append(role); } info_added_user = "<span id='info_added_user' style='display: none; text-align: center;' class='help-block alert alert-success'>User " + username + ' added</span>'; $('#authorize_user') .find('#info_added_user') .replaceWith(info_added_user); $('#authorize_user') .find('#info_added_user') .fadeIn(800) .delay(300) .fadeOut(800); if (!user_role_count[user_id]) { user_role_count[user_id] = 0; } } }); $('#authorized_users').on('click', '.dropdown', function(event) { var offset = $(this).offset(); offset.left -= 20; offset.top -= 20; $('#update_owners_users_members_scroll').animate({ scrollTop: offset.top, scrollLeft: offset.left, }); }); // Remove authorized member $('#authorized_users').on('click', '.remove', function(event) { // Stop linking event.preventDefault(); // item of list row = $(this).parent(); // Id and name of user var user_id = row.parent().attr('id'); var username = row.find('.name').html(); users_authorized = users_authorized.filter(function(elem) { return elem.user_id != user_id; }); delete user_role_count[user_id]; var info_added_user = "<span id='info_added_user' style='display: none; text-align: center;' class='help-block alert alert-success'>User " + username + ' removed from application</span>'; $('#authorize_user') .find('#info_added_user') .replaceWith(info_added_user); $('#authorize_user') .find('#info_added_user') .fadeIn(800) .delay(300) .fadeOut(800); row.parent().fadeOut(500, function() { row.parent().remove(); }); if ( $('#authorize_user') .find('#authorized_users') .children().length <= 1 ) { $('#no_update_owners_users_members').show(); } }); // Assign roles to users $('#authorized_users').on('click', '.role_dropdown_role', function(event) { // Stop linking event.stopPropagation(); var role_id = String($(this).attr('id')); var user_id = $(this) .closest('.list-group-item') .attr('id'); var username = $(this) .closest('.list-group-item') .find('.name') .html(); var roles_display = $(this) .closest('.list-group-item') .find('.roles_display'); // Remove role from user if ($(this).hasClass('active')) { $(this).removeClass('active'); user_role_count[user_id]--; if (user_role_count[user_id] <= 0) { roles_display.html('No roles'); } else { roles_display.html(String(user_role_count[user_id]) + ' roles'); } users_authorized = users_authorized.filter(function(elem) { return !(elem.user_id == user_id && elem.role_id == role_id); }); // Add role to user } else { $(this).addClass('active'); user_role_count[user_id]++; roles_display.html(String(user_role_count[user_id] + ' roles')); users_authorized.push({ user_id: user_id, role_id: role_id }); } }); // Handle the submit button form to submit assignment $('#submit_authorized_users_form').bind('keypress submit', function(event) { // stop form from submitting by pressing enter if (event.which == 13) { event.preventDefault(); } else if (event.type == 'submit') { // stop form from submitting normally event.preventDefault(); for (var key in user_role_count) { if (user_role_count[key] == 0) { $('.alert-warning').show('open'); $('#authorize_user') .find('#authorized_users') .find('#' + key) .find('.role_options') .addClass('dropdown-empty'); } } if ( $('#authorize_user') .find('#authorized_users') .find('.dropdown-empty').length === 0 || $('#authorize_user') .find('.modal-footer') .find('#submit_button') .val() == 'Confirm' ) { // get the action attribute from the <form action=""> element var $form = $(this), url = $form.attr('action'); // Change value of hidden input $('#authorize_user') .find('#submit_authorize') .val(JSON.stringify(users_authorized)); // Continue with the submit request $('#submit_authorized_users_form')[0].submit(); } else { $('#authorize_user') .find('.modal-footer') .find('#submit_button') .val('Confirm'); } } }); // To remove message $('#container.container-fluid').on('click', '#close_message', function() { $('.messages').empty(); }); }); // Function to exit from dialog function exit_authorize_users() { user_role_count = {}; $('#authorize_user') .find('#alert_error_search_available') .hide(); $('#authorize_user') .find('.alert-warning') .hide(); $('#authorize_user') .find('#no_update_owners_users_members') .hide(); $('#authorize_user') .find('.modal-footer') .find('#submit_button') .val('Save'); $('#authorize_user') .find('#no_available_update_owners_users') .hide('close'); $('#authorize_user') .find('#perform_filter_available_update_owners_users') .show('open'); $('#authorize_user') .find('#available_update_owners_users') .val(''); $('#authorize_user') .find('.available_members') .empty(); $('#authorize_user') .find('#authorized_users') .empty(); $('#authorize_user') .find('.alert-warning') .hide('close'); $('#authorize_user') .find('#update_owners_users_members') .val(''); }
Fiware/security.Idm
public/javascripts/applications/handle_authorize_users.js
JavaScript
mit
13,598
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var infiniteRowModelModule_1 = require("./infiniteRowModelModule"); exports.InfiniteRowModelModule = infiniteRowModelModule_1.InfiniteRowModelModule; //# sourceMappingURL=main.js.map
ceolter/angular-grid
community-modules/infinite-row-model/dist/cjs/main.js
JavaScript
mit
259
'use strict'; var MACROUTILS = require( 'osg/Utils' ); var Object = require( 'osg/Object' ); var Matrix = require( 'osg/Matrix' ); var Quat = require( 'osg/Quat' ); var Target = require( 'osgAnimation/Target' ); var StackedQuaternion = function ( name, quat ) { Object.call( this ); this._target = Target.createQuatTarget( quat || Quat.identity ); if ( name ) this.setName( name ); }; StackedQuaternion.prototype = MACROUTILS.objectInherit( Object.prototype, { init: function ( q ) { this.setQuaternion( q ); Quat.copy( q, this._target.defaultValue ); }, setQuaternion: function ( q ) { Quat.copy( q, this._target.value ); }, getTarget: function () { return this._target; }, resetToDefaultValue: function () { this.setQuaternion( this._target.defaultValue ); }, applyToMatrix: ( function () { var matrixTmp = Matrix.create(); return function applyToMatrix( m ) { var mtmp = matrixTmp; Matrix.setRotateFromQuat( mtmp, this._target.value ); Matrix.preMult( m, mtmp ); }; } )() } ); module.exports = StackedQuaternion;
gideonmay/osgjs
sources/osgAnimation/StackedQuaternion.js
JavaScript
mit
1,179
/*! * frontendboilerplate - v0.1.1 - MIT LICENSE 2015-06-22. * @author */ /** * Sample content to test the concat and minify grunt plugins. */ function sampleA() { 'use strict'; window.console.log("Sample A"); } sampleA(); /** * Sample content to test the concat and minify grunt plugins. */ function sampleB() { 'use strict'; window.console.log("Sample B"); } sampleB(); /** * Sample content to illustrate the use of Mocha for tests. */ var Apple = function (opts) { 'use strict'; opts = opts || {}; this.name = opts.name || 'Fuji'; this.sound = opts.sound || 'crunch'; return this; };
mcoy37/frontend-boilerplate
assets/js/scripts.js
JavaScript
mit
629
import{h as r,Component as t,render as o}from"preact";export{h,Component}from"preact";import e from"htm";function m(r,t){o(r,t,t.firstElementChild)}var n=e.bind(r);export{n as html,m as render};
cdnjs/cdnjs
ajax/libs/htm/2.2.1/preact/index.module.js
JavaScript
mit
195
/* * * * Highcharts funnel3d series module * * (c) 2010-2020 Highsoft AS * * Author: Kacper Madej * * License: www.highcharts.com/license * * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!! * * */ 'use strict'; import H from '../Core/Globals.js'; import Math3D from '../Extensions/Math3D.js'; var perspective = Math3D.perspective; import Color from '../Core/Color.js'; var color = Color.parse; import U from '../Core/Utilities.js'; var error = U.error, extend = U.extend, merge = U.merge, pick = U.pick, relativeLength = U.relativeLength, seriesType = U.seriesType; import './ColumnSeries.js'; import '../Core/Renderer/SVG/SVGRenderer.js'; var charts = H.charts, seriesTypes = H.seriesTypes, // Use H.Renderer instead of SVGRenderer for VML support. RendererProto = H.Renderer.prototype, // cuboidPath = RendererProto.cuboidPath, funnel3dMethods; /** * The funnel3d series type. * * @constructor seriesTypes.funnel3d * @augments seriesTypes.column * @requires highcharts-3d * @requires modules/cylinder * @requires modules/funnel3d */ seriesType('funnel3d', 'column', /** * A funnel3d is a 3d version of funnel series type. Funnel charts are * a type of chart often used to visualize stages in a sales project, * where the top are the initial stages with the most clients. * * It requires that the `highcharts-3d.js`, `cylinder.js` and * `funnel3d.js` module are loaded. * * @sample highcharts/demo/funnel3d/ * Funnel3d * * @extends plotOptions.column * @excluding allAreas, boostThreshold, colorAxis, compare, compareBase, * dataSorting, boostBlending * @product highcharts * @since 7.1.0 * @requires highcharts-3d * @requires modules/cylinder * @requires modules/funnel3d * @optionparent plotOptions.funnel3d */ { /** @ignore-option */ center: ['50%', '50%'], /** * The max width of the series compared to the width of the plot area, * or the pixel width if it is a number. * * @type {number|string} * @sample {highcharts} highcharts/demo/funnel3d/ Funnel3d demo * @product highcharts */ width: '90%', /** * The width of the neck, the lower part of the funnel. A number defines * pixel width, a percentage string defines a percentage of the plot * area width. * * @type {number|string} * @sample {highcharts} highcharts/demo/funnel3d/ Funnel3d demo * @product highcharts */ neckWidth: '30%', /** * The height of the series. If it is a number it defines * the pixel height, if it is a percentage string it is the percentage * of the plot area height. * * @type {number|string} * @sample {highcharts} highcharts/demo/funnel3d/ Funnel3d demo * @product highcharts */ height: '100%', /** * The height of the neck, the lower part of the funnel. A number * defines pixel width, a percentage string defines a percentage * of the plot area height. * * @type {number|string} * @sample {highcharts} highcharts/demo/funnel3d/ Funnel3d demo * @product highcharts */ neckHeight: '25%', /** * A reversed funnel has the widest area down. A reversed funnel with * no neck width and neck height is a pyramid. * * @product highcharts */ reversed: false, /** * By deafult sides fill is set to a gradient through this option being * set to `true`. Set to `false` to get solid color for the sides. * * @product highcharts */ gradientForSides: true, animation: false, edgeWidth: 0, colorByPoint: true, showInLegend: false, dataLabels: { align: 'right', crop: false, inside: false, overflow: 'allow' } }, { // Override default axis options with series required options for axes bindAxes: function () { H.Series.prototype.bindAxes.apply(this, arguments); extend(this.xAxis.options, { gridLineWidth: 0, lineWidth: 0, title: null, tickPositions: [] }); extend(this.yAxis.options, { gridLineWidth: 0, title: null, labels: { enabled: false } }); }, translate3dShapes: H.noop, translate: function () { H.Series.prototype.translate.apply(this, arguments); var sum = 0, series = this, chart = series.chart, options = series.options, reversed = options.reversed, ignoreHiddenPoint = options.ignoreHiddenPoint, plotWidth = chart.plotWidth, plotHeight = chart.plotHeight, cumulative = 0, // start at top center = options.center, centerX = relativeLength(center[0], plotWidth), centerY = relativeLength(center[1], plotHeight), width = relativeLength(options.width, plotWidth), tempWidth, getWidthAt, height = relativeLength(options.height, plotHeight), neckWidth = relativeLength(options.neckWidth, plotWidth), neckHeight = relativeLength(options.neckHeight, plotHeight), neckY = (centerY - height / 2) + height - neckHeight, data = series.data, fraction, tooltipPos, // y1, y3, y5, // h, shapeArgs; // Return the width at a specific y coordinate series.getWidthAt = getWidthAt = function (y) { var top = (centerY - height / 2); return (y > neckY || height === neckHeight) ? neckWidth : neckWidth + (width - neckWidth) * (1 - (y - top) / (height - neckHeight)); }; // Expose series.center = [centerX, centerY, height]; series.centerX = centerX; /* * Individual point coordinate naming: * * _________centerX,y1________ * \ / * \ / * \ / * \ / * \ / * ___centerX,y3___ * * Additional for the base of the neck: * * | | * | | * | | * ___centerX,y5___ */ // get the total sum data.forEach(function (point) { if (!ignoreHiddenPoint || point.visible !== false) { sum += point.y; } }); data.forEach(function (point) { // set start and end positions y5 = null; fraction = sum ? point.y / sum : 0; y1 = centerY - height / 2 + cumulative * height; y3 = y1 + fraction * height; tempWidth = getWidthAt(y1); h = y3 - y1; shapeArgs = { // for fill setter gradientForSides: pick(point.options.gradientForSides, options.gradientForSides), x: centerX, y: y1, height: h, width: tempWidth, z: 1, top: { width: tempWidth } }; tempWidth = getWidthAt(y3); shapeArgs.bottom = { fraction: fraction, width: tempWidth }; // the entire point is within the neck if (y1 >= neckY) { shapeArgs.isCylinder = true; } else if (y3 > neckY) { // the base of the neck y5 = y3; tempWidth = getWidthAt(neckY); y3 = neckY; shapeArgs.bottom.width = tempWidth; shapeArgs.middle = { fraction: h ? (neckY - y1) / h : 0, width: tempWidth }; } if (reversed) { shapeArgs.y = y1 = centerY + height / 2 - (cumulative + fraction) * height; if (shapeArgs.middle) { shapeArgs.middle.fraction = 1 - (h ? shapeArgs.middle.fraction : 0); } tempWidth = shapeArgs.width; shapeArgs.width = shapeArgs.bottom.width; shapeArgs.bottom.width = tempWidth; } point.shapeArgs = extend(point.shapeArgs, shapeArgs); // for tooltips and data labels context point.percentage = fraction * 100; point.plotX = centerX; if (reversed) { point.plotY = centerY + height / 2 - (cumulative + fraction / 2) * height; } else { point.plotY = (y1 + (y5 || y3)) / 2; } // Placement of tooltips and data labels in 3D tooltipPos = perspective([{ x: centerX, y: point.plotY, z: reversed ? -(width - getWidthAt(point.plotY)) / 2 : -(getWidthAt(point.plotY)) / 2 }], chart, true)[0]; point.tooltipPos = [tooltipPos.x, tooltipPos.y]; // base to be used when alignment options are known point.dlBoxRaw = { x: centerX, width: getWidthAt(point.plotY), y: y1, bottom: shapeArgs.height, fullWidth: width }; if (!ignoreHiddenPoint || point.visible !== false) { cumulative += fraction; } }); }, alignDataLabel: function (point, dataLabel, options) { var series = this, dlBoxRaw = point.dlBoxRaw, inverted = series.chart.inverted, below = point.plotY > pick(series.translatedThreshold, series.yAxis.len), inside = pick(options.inside, !!series.options.stacking), dlBox = { x: dlBoxRaw.x, y: dlBoxRaw.y, height: 0 }; options.align = pick(options.align, !inverted || inside ? 'center' : below ? 'right' : 'left'); options.verticalAlign = pick(options.verticalAlign, inverted || inside ? 'middle' : below ? 'top' : 'bottom'); if (options.verticalAlign !== 'top') { dlBox.y += dlBoxRaw.bottom / (options.verticalAlign === 'bottom' ? 1 : 2); } dlBox.width = series.getWidthAt(dlBox.y); if (series.options.reversed) { dlBox.width = dlBoxRaw.fullWidth - dlBox.width; } if (inside) { dlBox.x -= dlBox.width / 2; } else { // swap for inside if (options.align === 'left') { options.align = 'right'; dlBox.x -= dlBox.width * 1.5; } else if (options.align === 'right') { options.align = 'left'; dlBox.x += dlBox.width / 2; } else { dlBox.x -= dlBox.width / 2; } } point.dlBox = dlBox; seriesTypes.column.prototype.alignDataLabel.apply(series, arguments); } }, /** @lends seriesTypes.funnel3d.prototype.pointClass.prototype */ { shapeType: 'funnel3d', hasNewShapeType: H .seriesTypes.column.prototype .pointClass.prototype .hasNewShapeType }); /** * A `funnel3d` series. If the [type](#series.funnel3d.type) option is * not specified, it is inherited from [chart.type](#chart.type). * * @sample {highcharts} highcharts/demo/funnel3d/ * Funnel3d demo * * @since 7.1.0 * @extends series.funnel,plotOptions.funnel3d * @excluding allAreas,boostThreshold,colorAxis,compare,compareBase * @product highcharts * @requires highcharts-3d * @requires modules/cylinder * @requires modules/funnel3d * @apioption series.funnel3d */ /** * An array of data points for the series. For the `funnel3d` series * type, points can be given in the following ways: * * 1. An array of numerical values. In this case, the numerical values * will be interpreted as `y` options. The `x` values will be automatically * calculated, either starting at 0 and incremented by 1, or from `pointStart` * and `pointInterval` given in the series options. If the axis has * categories, these will be used. Example: * * ```js * data: [0, 5, 3, 5] * ``` * * 2. An array of objects with named values. The following snippet shows only a * few settings, see the complete options set below. If the total number of data * points exceeds the series' [turboThreshold](#series.funnel3d.turboThreshold), * this option is not available. * * ```js * data: [{ * y: 2, * name: "Point2", * color: "#00FF00" * }, { * y: 4, * name: "Point1", * color: "#FF00FF" * }] * ``` * * @sample {highcharts} highcharts/chart/reflow-true/ * Numerical values * @sample {highcharts} highcharts/series/data-array-of-arrays/ * Arrays of numeric x and y * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/ * Arrays of datetime x and y * @sample {highcharts} highcharts/series/data-array-of-name-value/ * Arrays of point.name and y * @sample {highcharts} highcharts/series/data-array-of-objects/ * Config objects * * @type {Array<number|Array<number>|*>} * @extends series.column.data * @product highcharts * @apioption series.funnel3d.data */ /** * By deafult sides fill is set to a gradient through this option being * set to `true`. Set to `false` to get solid color for the sides. * * @type {boolean} * @product highcharts * @apioption series.funnel3d.data.gradientForSides */ funnel3dMethods = merge(RendererProto.elements3d.cuboid, { parts: [ 'top', 'bottom', 'frontUpper', 'backUpper', 'frontLower', 'backLower', 'rightUpper', 'rightLower' ], mainParts: ['top', 'bottom'], sideGroups: [ 'upperGroup', 'lowerGroup' ], sideParts: { upperGroup: ['frontUpper', 'backUpper', 'rightUpper'], lowerGroup: ['frontLower', 'backLower', 'rightLower'] }, pathType: 'funnel3d', // override opacity and color setters to control opacity opacitySetter: function (opacity) { var funnel3d = this, parts = funnel3d.parts, chart = H.charts[funnel3d.renderer.chartIndex], filterId = 'group-opacity-' + opacity + '-' + chart.index; // use default for top and bottom funnel3d.parts = funnel3d.mainParts; funnel3d.singleSetterForParts('opacity', opacity); // restore funnel3d.parts = parts; if (!chart.renderer.filterId) { chart.renderer.definition({ tagName: 'filter', id: filterId, children: [{ tagName: 'feComponentTransfer', children: [{ tagName: 'feFuncA', type: 'table', tableValues: '0 ' + opacity }] }] }); funnel3d.sideGroups.forEach(function (groupName) { funnel3d[groupName].attr({ filter: 'url(#' + filterId + ')' }); }); // styled mode if (funnel3d.renderer.styledMode) { chart.renderer.definition({ tagName: 'style', textContent: '.highcharts-' + filterId + ' {filter:url(#' + filterId + ')}' }); funnel3d.sideGroups.forEach(function (group) { group.addClass('highcharts-' + filterId); }); } } return funnel3d; }, fillSetter: function (fill) { // extract alpha channel to use the opacitySetter var funnel3d = this, fillColor = color(fill), alpha = fillColor.rgba[3], partsWithColor = { // standard color for top and bottom top: color(fill).brighten(0.1).get(), bottom: color(fill).brighten(-0.2).get() }; if (alpha < 1) { fillColor.rgba[3] = 1; fillColor = fillColor.get('rgb'); // set opacity through the opacitySetter funnel3d.attr({ opacity: alpha }); } else { // use default for full opacity fillColor = fill; } // add gradient for sides if (!fillColor.linearGradient && !fillColor.radialGradient && funnel3d.gradientForSides) { fillColor = { linearGradient: { x1: 0, x2: 1, y1: 1, y2: 1 }, stops: [ [0, color(fill).brighten(-0.2).get()], [0.5, fill], [1, color(fill).brighten(-0.2).get()] ] }; } // gradient support if (fillColor.linearGradient) { // color in steps, as each gradient will generate a key funnel3d.sideGroups.forEach(function (sideGroupName) { var box = funnel3d[sideGroupName].gradientBox, gradient = fillColor.linearGradient, alteredGradient = merge(fillColor, { linearGradient: { x1: box.x + gradient.x1 * box.width, y1: box.y + gradient.y1 * box.height, x2: box.x + gradient.x2 * box.width, y2: box.y + gradient.y2 * box.height } }); funnel3d.sideParts[sideGroupName].forEach(function (partName) { partsWithColor[partName] = alteredGradient; }); }); } else { merge(true, partsWithColor, { frontUpper: fillColor, backUpper: fillColor, rightUpper: fillColor, frontLower: fillColor, backLower: fillColor, rightLower: fillColor }); if (fillColor.radialGradient) { funnel3d.sideGroups.forEach(function (sideGroupName) { var gradBox = funnel3d[sideGroupName].gradientBox, centerX = gradBox.x + gradBox.width / 2, centerY = gradBox.y + gradBox.height / 2, diameter = Math.min(gradBox.width, gradBox.height); funnel3d.sideParts[sideGroupName].forEach(function (partName) { funnel3d[partName].setRadialReference([ centerX, centerY, diameter ]); }); }); } } funnel3d.singleSetterForParts('fill', null, partsWithColor); // fill for animation getter (#6776) funnel3d.color = funnel3d.fill = fill; // change gradientUnits to userSpaceOnUse for linearGradient if (fillColor.linearGradient) { [funnel3d.frontLower, funnel3d.frontUpper].forEach(function (part) { var elem = part.element, grad = elem && funnel3d.renderer.gradients[elem.gradient]; if (grad && grad.attr('gradientUnits') !== 'userSpaceOnUse') { grad.attr({ gradientUnits: 'userSpaceOnUse' }); } }); } return funnel3d; }, adjustForGradient: function () { var funnel3d = this, bbox; funnel3d.sideGroups.forEach(function (sideGroupName) { // use common extremes for groups for matching gradients var topLeftEdge = { x: Number.MAX_VALUE, y: Number.MAX_VALUE }, bottomRightEdge = { x: -Number.MAX_VALUE, y: -Number.MAX_VALUE }; // get extremes funnel3d.sideParts[sideGroupName].forEach(function (partName) { var part = funnel3d[partName]; bbox = part.getBBox(true); topLeftEdge = { x: Math.min(topLeftEdge.x, bbox.x), y: Math.min(topLeftEdge.y, bbox.y) }; bottomRightEdge = { x: Math.max(bottomRightEdge.x, bbox.x + bbox.width), y: Math.max(bottomRightEdge.y, bbox.y + bbox.height) }; }); // store for color fillSetter funnel3d[sideGroupName].gradientBox = { x: topLeftEdge.x, width: bottomRightEdge.x - topLeftEdge.x, y: topLeftEdge.y, height: bottomRightEdge.y - topLeftEdge.y }; }); }, zIndexSetter: function () { // this.added won't work, because zIndex is set after the prop is set, // but before the graphic is really added if (this.finishedOnAdd) { this.adjustForGradient(); } // run default return this.renderer.Element.prototype.zIndexSetter.apply(this, arguments); }, onAdd: function () { this.adjustForGradient(); this.finishedOnAdd = true; } }); RendererProto.elements3d.funnel3d = funnel3dMethods; RendererProto.funnel3d = function (shapeArgs) { var renderer = this, funnel3d = renderer.element3d('funnel3d', shapeArgs), styledMode = renderer.styledMode, // hide stroke for Firefox strokeAttrs = { 'stroke-width': 1, stroke: 'none' }; // create groups for sides for oppacity setter funnel3d.upperGroup = renderer.g('funnel3d-upper-group').attr({ zIndex: funnel3d.frontUpper.zIndex }).add(funnel3d); [ funnel3d.frontUpper, funnel3d.backUpper, funnel3d.rightUpper ].forEach(function (upperElem) { if (!styledMode) { upperElem.attr(strokeAttrs); } upperElem.add(funnel3d.upperGroup); }); funnel3d.lowerGroup = renderer.g('funnel3d-lower-group').attr({ zIndex: funnel3d.frontLower.zIndex }).add(funnel3d); [ funnel3d.frontLower, funnel3d.backLower, funnel3d.rightLower ].forEach(function (lowerElem) { if (!styledMode) { lowerElem.attr(strokeAttrs); } lowerElem.add(funnel3d.lowerGroup); }); funnel3d.gradientForSides = shapeArgs.gradientForSides; return funnel3d; }; // eslint-disable-next-line valid-jsdoc /** * Generates paths and zIndexes. * @private */ RendererProto.funnel3dPath = function (shapeArgs) { // Check getCylinderEnd for better error message if // the cylinder module is missing if (!this.getCylinderEnd) { error('A required Highcharts module is missing: cylinder.js', true, charts[this.chartIndex]); } var renderer = this, chart = charts[renderer.chartIndex], // adjust angles for visible edges // based on alpha, selected through visual tests alphaCorrection = shapeArgs.alphaCorrection = 90 - Math.abs((chart.options.chart.options3d.alpha % 180) - 90), // set zIndexes of parts based on cubiod logic, for consistency cuboidData = cuboidPath.call(renderer, merge(shapeArgs, { depth: shapeArgs.width, width: (shapeArgs.width + shapeArgs.bottom.width) / 2 })), isTopFirst = cuboidData.isTop, isFrontFirst = !cuboidData.isFront, hasMiddle = !!shapeArgs.middle, // top = renderer.getCylinderEnd(chart, merge(shapeArgs, { x: shapeArgs.x - shapeArgs.width / 2, z: shapeArgs.z - shapeArgs.width / 2, alphaCorrection: alphaCorrection })), bottomWidth = shapeArgs.bottom.width, bottomArgs = merge(shapeArgs, { width: bottomWidth, x: shapeArgs.x - bottomWidth / 2, z: shapeArgs.z - bottomWidth / 2, alphaCorrection: alphaCorrection }), bottom = renderer.getCylinderEnd(chart, bottomArgs, true), // middleWidth = bottomWidth, middleTopArgs = bottomArgs, middleTop = bottom, middleBottom = bottom, ret, // masking for cylinders or a missing part of a side shape useAlphaCorrection; if (hasMiddle) { middleWidth = shapeArgs.middle.width; middleTopArgs = merge(shapeArgs, { y: shapeArgs.y + shapeArgs.middle.fraction * shapeArgs.height, width: middleWidth, x: shapeArgs.x - middleWidth / 2, z: shapeArgs.z - middleWidth / 2 }); middleTop = renderer.getCylinderEnd(chart, middleTopArgs, false); middleBottom = renderer.getCylinderEnd(chart, middleTopArgs, false); } ret = { top: top, bottom: bottom, frontUpper: renderer.getCylinderFront(top, middleTop), zIndexes: { group: cuboidData.zIndexes.group, top: isTopFirst !== 0 ? 0 : 3, bottom: isTopFirst !== 1 ? 0 : 3, frontUpper: isFrontFirst ? 2 : 1, backUpper: isFrontFirst ? 1 : 2, rightUpper: isFrontFirst ? 2 : 1 } }; ret.backUpper = renderer.getCylinderBack(top, middleTop); useAlphaCorrection = (Math.min(middleWidth, shapeArgs.width) / Math.max(middleWidth, shapeArgs.width)) !== 1; ret.rightUpper = renderer.getCylinderFront(renderer.getCylinderEnd(chart, merge(shapeArgs, { x: shapeArgs.x - shapeArgs.width / 2, z: shapeArgs.z - shapeArgs.width / 2, alphaCorrection: useAlphaCorrection ? -alphaCorrection : 0 }), false), renderer.getCylinderEnd(chart, merge(middleTopArgs, { alphaCorrection: useAlphaCorrection ? -alphaCorrection : 0 }), !hasMiddle)); if (hasMiddle) { useAlphaCorrection = (Math.min(middleWidth, bottomWidth) / Math.max(middleWidth, bottomWidth)) !== 1; merge(true, ret, { frontLower: renderer.getCylinderFront(middleBottom, bottom), backLower: renderer.getCylinderBack(middleBottom, bottom), rightLower: renderer.getCylinderFront(renderer.getCylinderEnd(chart, merge(bottomArgs, { alphaCorrection: useAlphaCorrection ? -alphaCorrection : 0 }), true), renderer.getCylinderEnd(chart, merge(middleTopArgs, { alphaCorrection: useAlphaCorrection ? -alphaCorrection : 0 }), false)), zIndexes: { frontLower: isFrontFirst ? 2 : 1, backLower: isFrontFirst ? 1 : 2, rightLower: isFrontFirst ? 1 : 2 } }); } return ret; };
cdnjs/cdnjs
ajax/libs/highcharts/8.2.0/es-modules/Series/Funnel3DSeries.js
JavaScript
mit
26,697
//>>built define({"themes/JewelryBoxTheme/widgets/HeaderController/setting/nls/strings":{group:"Nimi",openAll:"Avaa kaikki paneelissa",dropDown:"N\u00e4yt\u00e4 pudotusvalikossa",noGroup:"Pienoisohjelmaryhm\u00e4\u00e4 ei ole asetettu.",groupSetLabel:"Aseta pienoisohjelmaryhmien ominaisuudet",_localized:{}}});
pjdohertygis/MapSAROnline
Web Mapping Application/themes/JewelryBoxTheme/widgets/HeaderController/setting/nls/Setting_fi.js
JavaScript
cc0-1.0
311
/** @jsx React.DOM */ var React = require('react'); var CartSummary = require('./app-cartsummary.js'); var Header = React.createClass({ render:function(){ return ( <div className="row"> <div className="col-sm-6"><h1>Lets Shop</h1></div> <div className="col-sm-2 col-sm-push-3"> <br /> <CartSummary /> </div> </div> ) } }); module.exports = Header;
wandarkaf/React-Bible
ReactFlux/src/js/components/header/app-header.js
JavaScript
cc0-1.0
450
import Clipboard from 'clipboard'; function init(ractive, selector, isCopied) { if (!Clipboard.isSupported()) return; const clipboard = new Clipboard(ractive.find(selector)); let isRunning = false; clipboard.on('success', () => { if (isRunning) return; isRunning = true; ractive.set(isCopied, true); setTimeout(() => { isRunning = false; ractive.set(isCopied, false); }, 1000); }); return clipboard; } export default init;
skyjam/CoinSpace
app/lib/clipboard/index.js
JavaScript
gpl-2.0
469
/* Do not modify this file directly. It is compiled from other files. */ /** * JS for handling the Site Logo real-time display in the Customizer preview frame. */ !function(s){var i,t,e,o;(0,wp.customize)("site_logo",function(l){l.bind(function(l){i||(i=s("body"),t=s(".site-logo-link"),e=s(".site-logo"),o=e.attr("data-size")),l&&l.url?(l.sizes[o]||(o="full"),e.attr({height:l.sizes[o].height,width:l.sizes[o].width,src:l.sizes[o].url,srcset:""}),t.show(),i.addClass("has-site-logo")):(t.hide(),i.removeClass("has-site-logo"))})})}(jQuery);
Automattic/vip-go-mu-plugins
jetpack-9.8/modules/theme-tools/site-logo/js/site-logo.min.js
JavaScript
gpl-2.0
544
var azure = require("azure"); var Promise = require("bluebird"); var config = require("../config"); exports.set = function(container, id, name, path, size) { return new Promise(function(resolve, reject) { var service = azure.createBlobService(config.call(this, "storageName"), config.call(this, "storageKey")); service.createContainerIfNotExists(container, function (err) { if (err) reject(new Error("Error creating container: " + err)); else { service.createBlockBlobFromFile(container, id + "-" + name, path, function (err, result) { if (err) reject(new Error("Error while creating block blob from stream: " + err)); resolve({ container: result.container, id: id, name: name, file: result.blob, size: size }); }) } }); }); }; exports.get = function(container, name, stream) { return new Promise(function(resolve, reject) { var service = azure.createBlobService(config.call(this, "storageName"), config.call(this, "storageKey")); service.createContainerIfNotExists(container, function (err) { if (err) reject(new Error("Error creating container: " + err)); else { service.getBlobToStream(container, name, stream, function (err) { if (err) reject(new Error("Error while creating block blob from stream: " + err)); resolve(); }) } }); }); };
chrisharrington/Leaf
storage/storage.js
JavaScript
gpl-2.0
1,333
/*! { "name" : "HTML5 Audio Element", "property": "audio", "aliases" : [], "tags" : ["html5", "audio", "media"], "doc" : "/docs/#audio", "knownBugs": [], "authors" : [] } !*/ define(['Modernizr', 'createElement'], function( Modernizr, createElement ) { // This tests evaluates support of the audio element, as well as // testing what types of content it supports. // // We're using the Boolean constructor here, so that we can extend the value // e.g. Modernizr.audio // true // Modernizr.audio.ogg // 'probably' // // Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845 // thx to NielsLeenheer and zcorpan // Note: in some older browsers, "no" was a return value instead of empty string. // It was live in FF3.5.0 and 3.5.1, but fixed in 3.5.2 // It was also live in Safari 4.0.0 - 4.0.4, but fixed in 4.0.5 Modernizr.addTest('audio', function() { /* jshint -W053 */ var elem = createElement('audio'); var bool = false; try { if ( bool = !!elem.canPlayType ) { bool = new Boolean(bool); bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,''); bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,''); bool.opus = elem.canPlayType('audio/ogg; codecs="opus"') .replace(/^no$/,''); // Mimetypes accepted: // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements // bit.ly/iphoneoscodecs bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,''); bool.m4a = ( elem.canPlayType('audio/x-m4a;') || elem.canPlayType('audio/aac;')) .replace(/^no$/,''); } } catch(e) { } return bool; }); });
tony-stratton/blueridgeartist.com
sites/all/libraries/modernizr/feature-detects/audio.js
JavaScript
gpl-2.0
1,850
/* --------------------------------------------------------------------------- * UI Sortable init for items * --------------------------------------------------------------------------- */ function mfnSortableInit(item){ item.find('.mfn-sortable').sortable({ connectWith : '.mfn-sortable', cursor : 'move', forcePlaceholderSize : true, placeholder : 'mfn-placeholder', items : '.mfn-item', opacity : 0.9, receive : mfnSortableReceive }); return item; } /* --------------------------------------------------------------------------- * UI Sortable receive callback * --------------------------------------------------------------------------- */ function mfnSortableReceive(event, ui){ var targetSectionID = jQuery(this).siblings('.mfn-row-id').val(); ui.item.find('.mfn-item-parent').val(targetSectionID); } /* --------------------------------------------------------------------------- * Muffin Builder 2.0 * --------------------------------------------------------------------------- */ function mfnBuilder(){ var desktop = jQuery('#mfn-desk'); if( ! desktop.length ) return false; // Exit if Builder HTML does not exist var sectionID = jQuery('#mfn-row-id'); // sizes & classes ======================================== // available items ---------------------------------------- var items = { 'accordion' : [ '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'article_box' : [ '1/3', '1/2' ], 'blockquote' : [ '1/6', '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'blog' : [ '1/1' ], 'blog_news' : [ '1/4', '1/3', '1/2' ], 'blog_slider' : [ '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'call_to_action' : [ '1/1' ], 'chart' : [ '1/4', '1/3', '1/2' ], 'clients' : [ '1/1' ], 'clients_slider' : [ '1/1' ], 'code' : [ '1/6', '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'column' : [ '1/6', '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'contact_box' : [ '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'content' : [ '1/6', '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'countdown' : [ '1/1' ], 'counter' : [ '1/6', '1/5', '1/4', '1/3', '1/2' ], 'divider' : [ '1/1' ], 'fancy_divider' : [ '1/1' ], 'fancy_heading' : [ '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'feature_list' : [ '1/1' ], 'faq' : [ '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'flat_box' : [ '1/4', '1/3', '1/2' ], 'hover_box' : [ '1/6', '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'hover_color' : [ '1/6', '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'how_it_works' : [ '1/4', '1/3' ], 'icon_box' : [ '1/5', '1/4', '1/3', '1/2' ], 'image' : [ '1/6', '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'info_box' : [ '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'list' : [ '1/6', '1/5', '1/4', '1/3', '1/2' ], 'map' : [ '1/6', '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'offer' : [ '1/1' ], 'offer_thumb' : [ '1/1' ], 'opening_hours' : [ '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'our_team' : [ '1/6', '1/5', '1/4', '1/3', '1/2' ], 'our_team_list' : [ '1/1' ], 'photo_box' : [ '1/6', '1/5', '1/4', '1/3', '1/2' ], 'placeholder' : [ '1/6', '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'portfolio' : [ '1/1' ], 'portfolio_grid' : [ '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'portfolio_photo' : [ '1/1' ], 'portfolio_slider' : [ '1/1' ], 'pricing_item' : [ '1/6', '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'progress_bars' : [ '1/6', '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'promo_box' : [ '1/2' ], 'quick_fact' : [ '1/6', '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'shop_slider' : [ '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'sidebar_widget' : [ '1/4', '1/3' ], 'slider' : [ '1/2', '2/3', '3/4', '1/1' ], 'slider_plugin' : [ '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'sliding_box' : [ '1/6', '1/5', '1/4', '1/3', '1/2' ], 'story_box' : [ '1/4', '1/3', '1/2' ], 'tabs' : [ '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'testimonials' : [ '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'testimonials_list' : [ '1/1' ], 'trailer_box' : [ '1/6', '1/5', '1/4', '1/3', '1/2' ], 'timeline' : [ '1/1' ], 'video' : [ '1/6', '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'visual' : [ '1/6', '1/5', '1/4', '1/3', '1/2', '2/3', '3/4', '1/1' ], 'zoom_box' : [ '1/4', '1/3', '1/2' ] }; // available classes ------------------------------------------ var classes = { '1/6' : 'mfn-item-1-6', '1/5' : 'mfn-item-1-5', '1/4' : 'mfn-item-1-4', '1/3' : 'mfn-item-1-3', '1/2' : 'mfn-item-1-2', '2/3' : 'mfn-item-2-3', '3/4' : 'mfn-item-3-4', '1/1' : 'mfn-item-1-1' }; // available textarea shortcodes ------------------------------ var shortcodes = { 'alert' : '[alert style="warning"]Insert your content here[/alert]', 'blockquote' : '[blockquote author="" link="" target="_blank"]Insert your content here[/blockquote]', 'button' : '[button title="" icon="" icon_position="" link="" target="_blank" color="" font_color="" large="0" class="" download="" onclick=""]', 'code' : '[code]Insert your content here[/code]', 'content_link' : '[content_link title="" icon="icon-lamp" link="" target="_blank" class="" download=""]', 'dropcap' : '[dropcap background="" color="" circle="0"]I[/dropcap]nsert your content here', 'fancy_link' : '[fancy_link title="" link="" target="" style="1" class="" download=""]', 'google_font' : '[google_font font="Open Sans" size="25" weight="400" italic="0" color="#626262" subset=""]Insert your content here[/google_font]', 'highlight' : '[highlight background="" color=""]Insert your content here[/highlight]', 'hr' : '[hr height="30" style="default" line="default" themecolor="1"]', 'icon' : '[icon type="icon-lamp"]', 'icon_bar' : '[icon_bar icon="icon-lamp" link="" target="_blank" size="" social=""]', 'icon_block' : '[icon_block icon="icon-lamp" align="" color="" size="25"]', 'idea' : '[idea]Insert your content here[/idea]', 'image' : '[image src="" align="" caption="" link="" link_image="" target="" alt="" border="0" greyscale="0" animate=""]', 'popup' : '[popup title="Title" padding="0" button="0"]Insert your popup content here[/popup]', 'progress_icons' : '[progress_icons icon="icon-heart-line" count="5" active="3" background=""]', 'share_box' : '[share_box]', 'table' : '<table><thead><tr><th>Column 1 heading</th><th>Column 2 heading</th><th>Column 3 heading</th></tr></thead><tbody><tr><td>Row 1 col 1 content</td><td>Row 1 col 2 content</td><td>Row 1 col 3 content</td></tr><tr><td>Row 2 col 1 content</td><td>Row 2 col 2 content</td><td>Row 2 col 3 content</td></tr></tbody></table>', 'tooltip' : '[tooltip hint="Insert your hint here"]Insert your content here[/tooltip]', 'tooltip_image' : '[tooltip_image hint="Insert your hint here" image=""]Insert your content here[/tooltip_image]', }; // jquery.ui ================================================= desktop.sortable({ cursor : 'move', forcePlaceholderSize : true, placeholder : 'mfn-placeholder', items : '.mfn-row', opacity : 0.9 }); desktop.find('.mfn-sortable').sortable({ connectWith : '.mfn-sortable', cursor : 'move', forcePlaceholderSize : true, placeholder : 'mfn-placeholder', items : '.mfn-item', opacity : 0.9, receive : mfnSortableReceive }); // section =================================================== // add section ----------------------------------------------- jQuery('.mfn-row-add-btn').click(function(){ var clone = jQuery('#mfn-rows .mfn-row').clone(true); clone.find('.mfn-sortable').sortable({ connectWith : '.mfn-sortable', cursor : 'move', forcePlaceholderSize : true, placeholder : 'mfn-placeholder', items : '.mfn-item', opacity : 0.9, receive : mfnSortableReceive }); clone.hide() .find('.mfn-element-content > input').each(function() { jQuery(this).attr('name',jQuery(this).attr('class')+'[]'); }); sectionID.val(sectionID.val()*1+1); clone .find('.mfn-row-id').val(sectionID.val()); desktop.append(clone).find(".mfn-row").fadeIn(500); }); // clone section --------------------------------------------- jQuery('.mfn-row .mfn-row-clone').click(function(){ var element = jQuery(this).closest('.mfn-element'); // sortable destroy, clone & init for cloned element element.find('.mfn-sortable').sortable('destroy'); var clone = element.clone(true); mfnSortableInit(element); mfnSortableInit(clone); sectionID.val(sectionID.val()*1+1); clone .find('.mfn-row-id, .mfn-item-parent').val(sectionID.val()); element.after(clone); }); // add item list toggle --------------------------------------- jQuery('.mfn-item-add-btn').click(function(){ var parent = jQuery(this).parent(); if( parent.hasClass('focus') ){ parent.removeClass('focus'); } else { jQuery('.mfn-item-add').removeClass('focus'); parent.addClass('focus'); } }); // add item --------------------------------------------------- jQuery('.mfn-item-add-list a').click(function(){ jQuery(this).closest('.mfn-item-add').removeClass('focus'); var parentDesktop = jQuery(this).parents('.mfn-row').find('.mfn-droppable'); var targetSectionID = jQuery(this).parents('.mfn-row').find('.mfn-row-id').val(); var item = jQuery(this).attr('class'); var clone = jQuery('#mfn-items').find('div.mfn-item-'+ item ).clone(true); clone .hide() .find('.mfn-element-content input').each(function() { jQuery(this).attr('name',jQuery(this).attr('class')+'[]'); }); clone.find('.mfn-item-parent').val(targetSectionID); parentDesktop.append(clone).find(".mfn-item").fadeIn(500); }); // item ======================================================= // increase item size -------------------------------------- jQuery('.mfn-item-size-inc').click(function(){ var item = jQuery(this).closest('.mfn-item'); var item_type = item.find('.mfn-item-type').val(); var item_sizes = items[item_type]; for( var i = 0; i < item_sizes.length-1; i++ ){ if( ! item.hasClass( classes[item_sizes[i]] ) ) continue; item .removeClass( classes[item_sizes[i]] ) .addClass( classes[item_sizes[i+1]] ) .find('.mfn-item-size').val( item_sizes[i+1] ); item.find('.mfn-item-desc').text( item_sizes[i+1] ); break; } }); // decrease size ---------------------------------------------- jQuery('.mfn-item-size-dec').click(function(){ var item = jQuery(this).closest('.mfn-item'); var item_type = item.find('.mfn-item-type').val(); var item_sizes = items[item_type]; for( var i = 1; i < item_sizes.length; i++ ){ if( ! item.hasClass( classes[item_sizes[i]] ) ) continue; item .removeClass( classes[item_sizes[i]] ) .addClass( classes[item_sizes[i-1]] ) .find('.mfn-item-size').val( item_sizes[i-1]); item.find('.mfn-item-desc').text( item_sizes[i-1] ); break; } }); // clone item --------------------------------------------- jQuery('.mfn-item .mfn-item-clone').click(function(){ var element = jQuery(this).closest('.mfn-element'); var clone = element.clone(true); element.after(clone); }); // element =================================================== // delete element -------------------------------------------- jQuery('.mfn-element-delete').click(function(){ var item = jQuery(this).closest('.mfn-element'); if( confirm( "You are about to delete this element.\nIt can not be restored at a later time! Continue?" ) ){ item.fadeOut(500,function(){jQuery(this).remove();}); } else { return false; } }); // helper - switch editor ------------------------------------ jQuery('#mfn-popup').on('click', '.mfn-switch-editor', function(e) { e.preventDefault(); if( tinymce.get('mfn-editor') ) { var tinyHTML = tinymce.get('mfn-editor').getContent(); // Fix | HTML Tags 1/2 tinymce.execCommand('mceRemoveEditor', false, 'mfn-editor'); jQuery('#mfn-editor').val( tinyHTML ); // Fix | HTML Tags 2/2 } else { tinymce.execCommand('mceAddEditor', false, 'mfn-editor'); } }); var source_item = ''; var source_top = ''; // popup - edit ----------------------------------------------- jQuery('.mfn-element-edit').click(function(){ source_top = jQuery(this).offset().top; // hide Publish/Update button jQuery('#publish').fadeOut(500); jQuery('#vc_navbar').fadeOut(500); jQuery('#mfn-content, .form-table').fadeOut(50); source_item = jQuery(this).closest('.mfn-element'); var clone_meta = source_item.children('.mfn-element-meta').clone(true); jQuery('#mfn-popup') .append(clone_meta) .fadeIn(500); // FIX | Chrome 43.0.2357.65 (64-bit) jQuery('#mfn-popup textarea').each(function(){ var chromeFix = jQuery(this).val(); jQuery(this).html( chromeFix + ' ' ); //jQuery(this).val( chromeFix ); }); // scroll if( jQuery('#mfn-wrapper').length > 0 ){ var adjustment = 30; jQuery('html, body').animate({ scrollTop: jQuery('#mfn-wrapper').offset().top - adjustment }, 500); } source_item.children('.mfn-element-meta').remove(); // mce - editor --------------- jQuery('#mfn-popup textarea.editor').attr('id','mfn-editor'); try { jQuery('.wp-switch-editor.switch-html').click(); jQuery('.wp-switch-editor.switch-tmce').click(); tinymce.execCommand('mceAddEditor', true, 'mfn-editor'); } catch (err) { // console.log(err); } jQuery('#mfn-popup .mce-tinymce .mce-i-wp_more, #mfn-popup .mce-tinymce .mce-i-dfw, #mfn-popup .mce-tinymce .mce_woocommerce_shortcodes_button, #mfn-popup .mce-tinymce .mce_revslider') .closest('.mce-btn').remove(); // removed since Be 4.5, restored since Be 7.3 jQuery('#mfn-popup .mce-tinymce').closest('td').prepend('<a href="#" class="mfn-switch-editor"">Visual / HTML<span>may remove some tags</span></a>'); // end: mce - editor ---------- }); // popup - close ---------------------------------------------- jQuery('#mfn-popup .mfn-popup-close, #mfn-popup .mfn-popup-save').click(function(){ // mce - editor --------------- try { if( tinymce.get('mfn-editor') ){ jQuery('#mfn-editor').html( tinymce.get('mfn-editor').getContent() ); tinymce.execCommand('mceRemoveEditor', false, 'mfn-editor'); } else { jQuery('#mfn-editor').html( jQuery('#mfn-editor').val() ); } } catch (err) { // console.log(err); } jQuery('.mfn-switch-editor').remove(); jQuery('#mfn-editor').removeAttr('id'); // end: mce - editor ---------- // destroy sortable for fields 'tabs' if( jQuery('#mfn-popup .tabs-ul.ui-sortable').length ){ jQuery('#mfn-popup .tabs-ul.ui-sortable').sortable('destroy'); } // hide Publish/Update button jQuery('#publish').fadeIn(500); jQuery('#vc_navbar').fadeIn(500); jQuery('#mfn-content, .form-table').fadeIn(500); var popup = jQuery('#mfn-popup'); var clone = popup.find('.mfn-element-meta').clone(true); source_item.append(clone); popup.fadeOut(50); setTimeout(function(){ popup.find('.mfn-element-meta').remove(); },50); // scroll if( source_top ){ var adjustment = 40; if( jQuery('.vc_subnav-fixed').length > 0 ) adjustment = 96; jQuery('html, body').animate({ scrollTop: source_top - adjustment }, 500); } }); // go to top =================================================== jQuery('#mfn-go-to-top').click(function(){ jQuery('html, body').animate({ scrollTop: 0 }, 500); }); // post formats ================================================ jQuery("#post-formats-select label.post-format-standard").text('Standard, Horizontal Image'); jQuery("#post-formats-select label.post-format-image").text('Vertical Image'); // migrate ========================================================= // show/hide jQuery('#mfn-migrate .btn-exp').click(function(){ alert('Please remember to Publish/Update your post before Export.'); jQuery('.migrate-wrapper ').hide(); jQuery('.export-wrapper').show(); }); jQuery('#mfn-migrate .btn-imp').click(function(){ jQuery('.migrate-wrapper ').hide(); jQuery('.import-wrapper').show(); }); jQuery('#mfn-migrate .btn-tem').click(function(){ jQuery('.migrate-wrapper ').hide(); jQuery('.templates-wrapper').show(); }); // copy to clipboard jQuery('#mfn-items-export').click(function(){ jQuery(this).select(); }); // import jQuery('#mfn-migrate .btn-import').click(function(){ var el = jQuery(this).siblings('#mfn-items-import'); el.attr('name',el.attr('id')); jQuery('#publish').click(); }); // template jQuery('#mfn-migrate .btn-template').click(function(){ var el = jQuery(this).siblings('#mfn-items-import-template'); el.attr('name',el.attr('id')); jQuery('#publish').click(); }); // seo ========================================================= jQuery('#wp-content-wrap .wp-editor-tabs').prepend('<a class="wp-switch-editor switch-seo" id="content-seo">Builder &raquo; SEO</a>'); jQuery('#content-seo').click(function(){ if( confirm( "This option is useful for plugins like Yoast SEO to analize post content when you use Muffin Builder.\nIt will collect content from Muffin Builder Elements and copy it into the WordPress Editor.\n\nCurrent Editor Content will be replaced.\nYou can hide the content if you turn \"Hide the content\" option ON.\n\nPlease remember to Publish/Update your post before & after use of this option.\nContinue?" ) ){ var items_decoded = jQuery('#mfn-items-seo-data').val(); console.log(items_decoded); jQuery('#content-html').click(); jQuery('#content').val( items_decoded ).text( items_decoded ); } else { return false; } }); // Textarea | Shortcodes ======================================== // Helper | Wrap Selected Text OR Insert Into Carret ------------ function wrapText(textArea, openTag, closeTag){ var len = textArea.val().length; var start = textArea[0].selectionStart; var end = textArea[0].selectionEnd; var selectedText = textArea.val().substring(start, end); var replacement = openTag + selectedText + closeTag; textArea.val(textArea.val().substring(0, start) + replacement + textArea.val().substring(end, len)); } // Add Shortcode | Menu ----------------------------------------- jQuery('.mfn-sc-add-btn').click(function(){ var parent = jQuery(this).parent(); if( parent.hasClass('focus') ){ parent.removeClass('focus'); } else { jQuery('.mfn-sc-add').removeClass('focus'); parent.addClass('focus'); } }); // Insert Shortcode ------------------------------------------------ jQuery('.mfn-sc-add-list a').click(function(){ jQuery(this).closest('.mfn-sc-add').removeClass('focus'); var sc = jQuery(this).attr('data-rel'); if( sc ){ var shortcode = shortcodes[sc]; var textarea = jQuery(this).closest('td').find('textarea'); wrapText( textarea, shortcode, '' ); } }); // Insert HTML Tag ------------------------------------------------ jQuery('.mfn-sc-tools a').click(function(){ var open = jQuery(this).attr('data-open'); var close = jQuery(this).attr('data-close'); var open = open.replace( /X/g, '"' ); if( close ){ open = '<'+ open + '>'; close = '</'+ close + '>'; } else { open = '<'+ open + ' />'; close = ''; } var textarea = jQuery(this).closest('td').find('textarea'); wrapText( textarea, open, close ); }); } /* --------------------------------------------------------------------------- * Clone fix (textarea, select) * --------------------------------------------------------------------------- */ (function (original) { jQuery.fn.clone = function(){ var result = original.apply (this, arguments), my_textareas = this.find('textarea:not(.editor), select'), result_textareas = result.find('textarea:not(.editor), select'); for (var i = 0, l = my_textareas.length; i < l; ++i){ jQuery(result_textareas[i]).val( jQuery(my_textareas[i]).val() ); } return result; }; })(jQuery.fn.clone); /* --------------------------------------------------------------------------- * jQuery(document).ready * --------------------------------------------------------------------------- */ jQuery(document).ready(function(){ mfnBuilder(); }); /* --------------------------------------------------------------------------- * jQuery(document).mouseup * --------------------------------------------------------------------------- */ jQuery(document).mouseup(function(e) { if (jQuery(".mfn-item-add").has(e.target).length === 0){ jQuery(".mfn-item-add").removeClass('focus'); } if (jQuery(".mfn-sc-add").has(e.target).length === 0){ jQuery(".mfn-sc-add").removeClass('focus'); } });
ehsangolshani/mohsenGMD-website
wp-content/themes/betheme/functions/js/mfn.builder.js
JavaScript
gpl-2.0
21,172
// Quick Chat 4.12 - core jQuery.fn.quick_chat_insert_at_caret=function(a){return this.each(function(){if(document.selection)this.focus(),sel=document.selection.createRange(),sel.text=a,this.focus();else if(this.selectionStart||"0"==this.selectionStart){var b=this.selectionStart,c=this.selectionEnd,e=this.scrollTop;this.value=this.value.substring(0,b)+a+this.value.substring(c,this.value.length);this.focus();this.selectionStart=b+a.length;this.selectionEnd=b+a.length;this.scrollTop=e}else this.value+=a,this.focus()})}; var quick_chat=jQuery.extend(quick_chat||{},{last_timestamp:0,rooms:[],private_queue:{},private_current:{},private_count:0,audio_support:0,play_audio:0,audio_element:document.createElement("audio"),update_users_limit:Math.floor(quick_chat.inactivity_timeout/quick_chat.timeout_refresh_users),update_users_counter:0,private_queue_name:"quick_chat_private_queue_"+quick_chat.user_id,random_string:function(a){for(var b=0,c="",e;b<a;)e=Math.floor(100*Math.random())%94+33,!(33<=e&&47>=e)&&(!(58<=e&&64>=e)&& !(91<=e&&96>=e)&&!(123<=e&&126>=e))&&(b++,c+=String.fromCharCode(e));return"quick_chat_"+c},is_user_inactive:function(){return quick_chat.update_users_counter==quick_chat.update_users_limit&&0!=quick_chat.user_status?!0:!1},is_private_eq:function(a,b){return a.private_from==b.private_from&&a.private_to==b.private_to||a.private_to==b.private_from&&a.private_from==b.private_to?!0:!1},spawn_private_chat:function(a,b,c){var e={};e.room_name=a;e.userlist_position="top";e.scroll_enable=1;e.avatars=1;e.him= b;e.state="o"==c?"o":"m";quick_chat.data[a]=e;b='<div class="quick-chat-container quick-chat-container-private" data-quick-chat-id="'+a+'"><div class="quick-chat-container-private-titlebar"><div class="quick-chat-container-private-title">'+quick_chat.i18n.private_title_s+'</div><div class="quick-chat-container-private-close"><a href="" title="'+quick_chat.i18n.private_close_s+'">x</a></div><div class="quick-chat-container-private-minimize-restore"><a href="" title="';b="o"==c?b+quick_chat.i18n.private_minimize_s: b+quick_chat.i18n.private_restore_s;b+='">'+("o"==c?"-":"o")+'</a></div></div><div class="quick-chat-users-container quick-chat-users-container-top"></div><div class="quick-chat-history-container" style="height: 300px;"></div>';0==quick_chat.user_status&&(b+='<div class="quick-chat-links"><div class="quick-chat-left-link quick-chat-transcript-link"><a title="'+quick_chat.i18n.fetch_transcript_s+'" href="">'+quick_chat.i18n.transcript_s+"</a></div></div>");b+='<div class="quick-chat-alias-container"><input class="quick-chat-alias" type="text" autocomplete="off" maxlength="20" value="'+ quick_chat.user_name+'" readonly="readonly" /></div><textarea class="quick-chat-message"></textarea></div>';jQuery("body").append(b);a=jQuery('div[data-quick-chat-id="'+a+'"]');quick_chat.private_right_position(a);quick_chat.private_bottom_position(a,c)},private_right_position:function(a){var b=a.outerWidth(!0)*quick_chat.private_count;quick_chat.private_count++;a.css("right",b)},private_bottom_position:function(a,b){"o"==b?jQuery(a).animate({bottom:0},500):"m"==b&&jQuery(a).animate({bottom:-(jQuery(a).outerHeight(!0)- jQuery(a).find("div.quick-chat-history-container").position().top)},500)},update_private_cookie:function(a,b){jQuery.cookie(a,jQuery.toJSON(b),{path:quick_chat.cookiepath,domain:quick_chat.cookie_domain})},preg_quote:function(a){return a.replace(RegExp("[.*+?|()\\[\\]{}\\\\]","g"),"\\$&")},stripslashes:function(a){a=a.replace(/\\'/g,"'");a=a.replace(/\\"/g,'"');a=a.replace(/\\\\/g,"\\");return a=a.replace(/\\0/g,"\x00")},flag_html:function(a){return null!=a.c&&null!=a.m?' <img class="quick-chat-flags" title="'+ a.m+'" src="'+quick_chat.quick_flag_url+"/"+a.c+'.gif" />':""},update_rooms:function(){quick_chat.rooms=[];for(var a in quick_chat.data)-1==jQuery.inArray(quick_chat.data[a].room_name,quick_chat.rooms)&&quick_chat.rooms.push(quick_chat.data[a].room_name)},update_sound_state:function(){0==quick_chat.play_audio?jQuery("div.quick-chat-sound-link a").css("text-decoration","line-through"):jQuery("div.quick-chat-sound-link a").css("text-decoration","none")},user_status_class:function(a){var b="";0==a?b= "quick-chat-admin":1==a?b="quick-chat-loggedin":2==a&&(b="quick-chat-guest");return b},is_private_allowed:function(a){return 0==a||1==a&&1==quick_chat.loggedin_initiate_private||2==a&&1==quick_chat.guests_initiate_private?!0:!1},single_message_html:function(a,b,c){if(!1==c)var e=quick_chat.stripslashes(a.alias),d=quick_chat.user_status_class(a.status);else!0==c&&(e=quick_chat.i18n.notice_s,d="quick-chat-notice");var f=quick_chat.stripslashes(a.message),j;for(j in quick_chat.smilies)var g='<div class="quick-chat-smile quick-chat-smile-'+ quick_chat.smilies[j]+'" title="'+j+'"></div>',f=f.replace(RegExp(quick_chat.preg_quote(j),"g"),g);d='<div class="quick-chat-history-message-alias-container '+d+'"><div class="quick-chat-history-header">';1==b&&!1!=a.avatar&&(d+=quick_chat.stripslashes(a.avatar));d+='<div class="quick-chat-history-alias">';d=e==quick_chat.user_name||!0==c||1==quick_chat.no_participation?d+e:d+('<a href="" title="'+quick_chat.i18n.reply_to_s.replace("%s",e)+'">'+e+"</a>");d=d+"</div>"+('<div class="quick-chat-history-timestring">'+ a.timestring+'</div></div><div class="quick-chat-history-message">'+f+"</div>");0==quick_chat.user_status&&(d+='<div class="quick-chat-history-links">');0==quick_chat.user_status&&!1==c&&(d+='<input class="quick-chat-to-delete-boxes" type="checkbox" name="quick-chat-to-delete[]" value="'+a.id+'" />');0==quick_chat.user_status&&(d+="</div>");return d+="</div>"},check_username:function(a,b,c){"undefined"!=typeof quick_chat.data[a].username_timeout&&clearTimeout(quick_chat.data[a].username_timeout); quick_chat.data[a].username_timeout=setTimeout(function(){jQuery.ajax({type:"POST",url:quick_chat.ajaxurl,data:{action:"quick-chat-ajax-username-check",username_check:b},cache:!1,dataType:"json",success:function(a){0==quick_chat.no_participation&&1==a.no_participation&&location.reload(!0);jQuery(c).html("");if(1==a.username_invalid)jQuery(c).addClass("quick-chat-error"),jQuery(c).html(quick_chat.i18n.username_invalid_s);else if(1==a.username_bad_words)jQuery(c).addClass("quick-chat-error"),jQuery(c).html(quick_chat.i18n.username_bad_words_s); else if(1==a.username_exists)jQuery(c).addClass("quick-chat-error"),jQuery(c).html(quick_chat.i18n.username_exists_s);else if(1==a.username_blocked)jQuery(c).addClass("quick-chat-error"),jQuery(c).html(quick_chat.i18n.username_blocked_s);else if(0==a.username_exists||0==a.username_blocked||0==a.username_invalid)jQuery(c).html(""),quick_chat.user_name=a.username,jQuery("input.quick-chat-alias").val(a.username)},beforeSend:function(){jQuery(c).html("");jQuery(c).removeClass("quick-chat-error");jQuery(c).html(quick_chat.i18n.username_check_wait_s)}}); delete quick_chat.data[a].username_timeout},1500)},update_messages:function(){jQuery.post(quick_chat.ajaxurl,{action:"quick-chat-ajax-update-messages",last_timestamp:quick_chat.last_timestamp,rooms:quick_chat.rooms},function(a){(0==quick_chat.no_participation&&1==a.no_participation||1==quick_chat.no_participation&&0==a.no_participation)&&location.reload(!0);if(1==a.success){var b=a.messages;jQuery("div.quick-chat-container").each(function(){for(var a=0,e=jQuery(this).attr("data-quick-chat-id"),d= quick_chat.data[e].room_name,f=quick_chat.data[e].avatars,j=quick_chat.data[e].scroll_enable,g=jQuery(this).find(".quick-chat-history-container"),e=quick_chat.data[e].state,k=0;"undefined"!=typeof b[k];k++)if(d==b[k].room)if("quick_chat"!=b[k].alias)0==a&&(1==quick_chat.play_audio&&quick_chat.user_name!=quick_chat.stripslashes(b[k].alias)&&0!=quick_chat.last_timestamp)&&(quick_chat.audio_element.play(),a=1),0!=quick_chat.last_timestamp&&("undefined"!=typeof e&&"m"==e)&&jQuery(this).find("div.quick-chat-container-private-minimize-restore a").click(), jQuery(g).append(quick_chat.single_message_html(b[k],f,!1));else if(0!=quick_chat.last_timestamp){var l=jQuery.parseJSON(quick_chat.stripslashes(b[k].message)),h;for(h in l)if(l[h].private_to==quick_chat.user_name&&"INV"==l[h].type){if(quick_chat.is_private_allowed(b[k].status)){quick_chat.private_queue[h]=l[h];quick_chat.update_private_cookie(quick_chat.private_queue_name,quick_chat.private_queue);var m=jQuery.extend(!0,{},b[k]);m.message=quick_chat.i18n.invitation_received_s.replace("%s",l[h].private_from); jQuery(g).append(quick_chat.single_message_html(m,0,!0))}}else if(l[h].private_from==quick_chat.user_name){var m=!1,n;for(n in quick_chat.private_queue)quick_chat.is_private_eq(quick_chat.private_queue[n],l[h])&&(quick_chat.spawn_private_chat(n,l[h].private_to,"o"),quick_chat.update_rooms(),delete quick_chat.private_queue[n],quick_chat.update_private_cookie(quick_chat.private_queue_name,quick_chat.private_queue),quick_chat.private_current[n]=quick_chat.data[n],quick_chat.update_private_cookie(quick_chat.private_current_name, quick_chat.private_current),m=!0);!1==m&&(quick_chat.is_private_allowed(b[k].status)?(quick_chat.spawn_private_chat(h,l[h].private_to,"o"),quick_chat.update_rooms(),quick_chat.private_current[h]=quick_chat.data[h],quick_chat.update_private_cookie(quick_chat.private_current_name,quick_chat.private_current),m=jQuery.extend(!0,{},b[k]),m.message=quick_chat.i18n.invitation_sent_s.replace("%s",l[h].private_to),jQuery(g).append(quick_chat.single_message_html(m,0,!0))):alert(quick_chat.i18n.not_allowed_to_initiate_s))}}1== j&&jQuery(g).animate({scrollTop:jQuery(g)[0].scrollHeight},500)});quick_chat.last_timestamp=b[b.length-1].unix_timestamp}quick_chat.is_user_inactive()||quick_chat.update_messages()},"json")},update_users:function(){quick_chat.update_users_counter++;quick_chat.is_user_inactive()?(clearInterval(quick_chat.users_interval),jQuery("div.quick-chat-container").html('<div style="quick-chat-bootom-notice">'+quick_chat.i18n.dropped_inactivity_s+"</div>")):jQuery.post(quick_chat.ajaxurl,{action:"quick-chat-ajax-update-users", rooms:quick_chat.rooms},function(a){(0==quick_chat.no_participation&&1==a.no_participation||1==quick_chat.no_participation&&0==a.no_participation)&&location.reload(!0);"undefined"==typeof quick_chat.users_interval&&(quick_chat.users_interval=setInterval(function(){quick_chat.update_users()},1E3*quick_chat.timeout_refresh_users));var b=a.users;jQuery("div.quick-chat-container").each(function(){for(var a=jQuery(this).attr("data-quick-chat-id"),e=quick_chat.data[a].userlist_position,a=quick_chat.data[a].room_name, d="",f=0;"undefined"!=typeof b[f];f++)if(a==b[f].room){if(0==quick_chat.user_status){var j=[];jQuery(this).find(".quick-chat-users-container input[type=checkbox]:checked").each(function(){j.push(jQuery(this).attr("data-user-id"))})}var g=quick_chat.stripslashes(b[f].alias),d=d+('<div class="quick-chat-single-user '+quick_chat.user_status_class(b[f].status)+'">');g==quick_chat.user_name||1==quick_chat.no_participation?d+=g:(0==quick_chat.user_status&&(d+='<input class="quick-chat-to-ban-boxes" type="checkbox" name="quick-chat-to-ban[]" value="'+ b[f].ip+'" data-user-id="'+b[f].id+'"'+(0==jQuery.inArray(b[f].id,j)?' checked="checked"':"")+"/>"),d+='<a href="" title="'+quick_chat.i18n.private_with_s.replace("%s",g)+'">'+g+"</a>");d+=quick_chat.flag_html(b[f]);d+="</div>";"top"==e&&(d+=", ")}jQuery(this).find(".quick-chat-users-container").html("top"==e?d.substring(0,d.length-2):d)})},"json")},new_message:function(a,b,c){a=quick_chat.data[a].room_name;quick_chat.update_users_counter=0;jQuery.post(quick_chat.ajaxurl,{action:"quick-chat-ajax-new-message", sys_mes:c,message:b,room:a},function(a){0==quick_chat.no_participation&&1==a.no_participation&&location.reload(!0)})}}); quick_chat.audio_element.canPlayType&&(quick_chat.audio_element.canPlayType('audio/ogg; codecs="vorbis"')?(quick_chat.audio_element.setAttribute("src",quick_chat.url+"/sounds/message-sound.ogg"),quick_chat.audio_element.setAttribute("preload","auto"),quick_chat.audio_support=1):quick_chat.audio_element.canPlayType("audio/mpeg;")?(quick_chat.audio_element.setAttribute("src",quick_chat.url+"sounds/message-sound.mp3"),quick_chat.audio_element.setAttribute("preload","auto"),quick_chat.audio_support=1): quick_chat.audio_element.canPlayType('audio/wav; codecs="1"')&&(quick_chat.audio_element.setAttribute("src",quick_chat.url+"sounds/message-sound.wav"),quick_chat.audio_element.setAttribute("preload","auto"),quick_chat.audio_support=1));1==quick_chat.audio_support&&(quick_chat.play_audio=jQuery.cookie("quick_chat_sound_state")?jQuery.cookie("quick_chat_sound_state"):quick_chat.audio_enable); if(0==quick_chat.no_participation){null!=jQuery.cookie(quick_chat.private_queue_name)&&(quick_chat.private_queue=jQuery.parseJSON(jQuery.cookie(quick_chat.private_queue_name)));null!=jQuery.cookie(quick_chat.private_current_name)&&(quick_chat.private_current=jQuery.parseJSON(jQuery.cookie(quick_chat.private_current_name)));for(var quick_chat_pc_room_name in quick_chat.private_current)quick_chat.spawn_private_chat(quick_chat_pc_room_name,quick_chat.private_current[quick_chat_pc_room_name].him,quick_chat.private_current[quick_chat_pc_room_name].state)}quick_chat.update_rooms(); quick_chat.audio_support&&(jQuery("div.quick-chat-sound-link").css("display","block"),quick_chat.update_sound_state());quick_chat.update_users();jQuery("textarea.quick-chat-message").live("keypress",function(a){code=a.keyCode?a.keyCode:a.which;if(13==code.toString()&&(a.preventDefault(),a=jQuery.trim(jQuery(this).val()),""!=a)){var b=jQuery(this).parents(".quick-chat-container").attr("data-quick-chat-id");jQuery(this).val("");quick_chat.new_message(b,a,!1)}}); jQuery("input.quick-chat-send-button").bind("click",function(a){a.preventDefault();a=jQuery(this).siblings("textarea.quick-chat-message");var b=jQuery.trim(jQuery(a).val());if(""!=b){var c=jQuery(this).parents(".quick-chat-container").attr("data-quick-chat-id");jQuery(a).val("");quick_chat.new_message(c,b,!1)}jQuery(this).prev().focus()}); jQuery("div.quick-chat-smile").bind("click",function(){var a=jQuery(this).parents(".quick-chat-container").find(".quick-chat-message"),b=jQuery(this);jQuery(this).fadeTo(100,0,function(){jQuery(a).quick_chat_insert_at_caret(jQuery(b).attr("title")).trigger("change");jQuery(b).fadeTo(100,1)})}); jQuery("div.quick-chat-history-alias a").live("click",function(a){a.preventDefault();var b=jQuery(this).parents(".quick-chat-container").find(".quick-chat-message"),c=jQuery(this);jQuery(this).fadeTo(100,0,function(){jQuery(b).quick_chat_insert_at_caret("@"+jQuery(c).text()+": ");jQuery(c).fadeTo(100,1)})}); jQuery("div.quick-chat-single-user a").live("click",function(a){a.preventDefault();var b=jQuery(this).parents(".quick-chat-container").attr("data-quick-chat-id"),c=jQuery(this);jQuery(this).fadeTo(100,0,function(){var a=quick_chat.random_string(12),d=jQuery.parseJSON('{"'+a+'":{"private_from":"'+quick_chat.user_name+'","private_to":"'+jQuery(c).text()+'"}}'),f="INV",j=quick_chat.i18n.private_invite_confirm_s.replace("%s",jQuery(c).text()),g;for(g in quick_chat.private_queue){quick_chat.is_private_eq(quick_chat.private_queue[g], d[a])&&(f="ACK");j=quick_chat.i18n.private_accept_confirm_s.replace("%s",jQuery(c).text());break}confirm(j)&&(d[a].type=f,quick_chat.new_message(b,jQuery.toJSON(d),!0));jQuery(c).fadeTo(100,1)})}); jQuery("div.quick-chat-container-private-close a").live("click",function(a){a.preventDefault();var b=jQuery(this),c=jQuery(this).parents(".quick-chat-container").attr("data-quick-chat-id");jQuery(this).fadeTo(100,0,function(){delete quick_chat.data[c];delete quick_chat.private_current[c];quick_chat.update_private_cookie(quick_chat.private_current_name,quick_chat.private_current);quick_chat.private_count--;quick_chat.update_rooms();jQuery(this).parents(".quick-chat-container").remove();jQuery(b).fadeTo(100, 1)})}); jQuery("div.quick-chat-container-private-minimize-restore a").live("click",function(a){a.preventDefault();var b=jQuery(this).parents(".quick-chat-container").attr("data-quick-chat-id"),c=jQuery(this).parents(".quick-chat-container"),e=quick_chat.data[b].state,d=jQuery(this);jQuery(this).fadeTo(100,0,function(){"o"==e?(jQuery(d).attr("title",quick_chat.private_restore),quick_chat.data[b].state="m",quick_chat.private_current[b].state="m",quick_chat.update_private_cookie(quick_chat.private_current_name,quick_chat.private_current), jQuery(d).text("o"),quick_chat.private_bottom_position(c,"m")):"m"==e&&(jQuery(d).attr("title",quick_chat.private_minimize),quick_chat.data[b].state="o",quick_chat.private_current[b].state="o",quick_chat.update_private_cookie(quick_chat.private_current_name,quick_chat.private_current),jQuery(d).text("-"),quick_chat.private_bottom_position(c,"o"));jQuery(d).fadeTo(100,1)})}); jQuery("div.quick-chat-sound-link a").bind("click",function(a){a.preventDefault();var b=jQuery(this);jQuery(this).fadeTo(100,0,function(){quick_chat.play_audio=1==quick_chat.play_audio?0:1;jQuery.cookie("quick_chat_sound_state",quick_chat.play_audio,{path:quick_chat.cookiepath,domain:quick_chat.cookie_domain});quick_chat.update_sound_state();jQuery(b).fadeTo(100,1)})}); jQuery("div.quick-chat-scroll-link a").bind("click",function(a){a.preventDefault();var b=jQuery(this).parents(".quick-chat-container").attr("data-quick-chat-id"),c=quick_chat.data[b].scroll_enable,e=jQuery(this);jQuery(this).fadeTo(100,0,function(){0==c?(quick_chat.data[b].scroll_enable=1,jQuery(e).css("text-decoration","none")):(quick_chat.data[b].scroll_enable=0,jQuery(e).css("text-decoration","line-through"));jQuery(e).fadeTo(100,1)})}); (0==quick_chat.user_status||1==quick_chat.allow_change_username)&&jQuery("input.quick-chat-alias").bind("keyup","change",function(){var a=jQuery.trim(jQuery(this).val());if(""!=a){var b=jQuery(this).parents(".quick-chat-container").attr("data-quick-chat-id"),c=jQuery(this).parents(".quick-chat-container").find("span.quick-chat-username-status");quick_chat.check_username(b,a,c)}}); 0!=quick_chat.user_status&&jQuery("textarea.quick-chat-message").bind("keyup change input paste",function(){if(1==jQuery(this).parents(".quick-chat-container").attr("data-quick-chat-counter")){var a=jQuery(this).parents(".quick-chat-container").find("span.quick-chat-counter"),b=jQuery(this).val().length,b=quick_chat.message_maximum_number_chars-b;25>=b&&0<=b?jQuery(a).addClass("quick-chat-warning"):jQuery(a).removeClass("quick-chat-warning");0>b?jQuery(a).addClass("quick-chat-exceeded"):jQuery(a).removeClass("quick-chat-exceeded"); jQuery(a).html(b)}});quick_chat.update_messages();
jonathan1212/mywordpress
wp-content/plugins/quick-chat/js/quick-chat-core.js
JavaScript
gpl-2.0
18,559
// RU KOI8-R lang variables tinyMCE.addToLang('',{ paste_text_desc : '÷ÓÔÁ×ÉÔØ ËÁË ÐÒÏÓÔÏÊ ÔÅËÓÔ', paste_text_title : 'éÓÐÏÌØÚÕÊÔÅ CTRL+V ÄÌÑ ×ÓÔÁ×ËÉ ÔÅËÓÔÁ × ÏËÏÛËÏ.', paste_text_linebreaks : 'óÏÈÒÁÎÉÔØ ÐÅÒÅÎÏÓÙ ÓÔÒÏË', paste_word_desc : '÷ÓÔÁ×ÉÔØ ÉÚ Word', paste_word_title : 'éÓÐÏÌØÚÕÊÔÅ CTRL+V ÄÌÑ ×ÓÔÁ×ËÉ ÔÅËÓÔÁ × ÏËÏÛËÏ.', selectall_desc : '÷ÙÄÅÌÉÔØ ×Ó£' });
pzingg/saugus_elgg
_tinymce/jscripts/tiny_mce/plugins/paste/langs/ru_KOI8-R.js
JavaScript
gpl-2.0
376
jQuery(document).ready(function(a){a("a[href=#scroll-top]").click(function(){return a("html, body").animate({scrollTop:0},"slow"),!1})});
samayres1992/lucy-yin
wp-content/themes/responsive-mobile/core/js/jquery-scroll-top.min.js
JavaScript
gpl-2.0
137
var helper = require(__dirname + '/../test-helper'); //TODO would this be better served set at ../test-helper? if(helper.args.native) { Client = require(__dirname + '/../../lib/native'); helper.pg = helper.pg.native; } //export parent helper stuffs module.exports = helper;
elmerfreddy/nodejs-postgres
node_modules/pg/test/integration/test-helper.js
JavaScript
gpl-2.0
280
FusionCharts.ready(function () { var salaryDistribution = new FusionCharts({ type: 'boxandwhisker2d', renderAt: 'chart-container', width: '500', height: '350', dataFormat: 'json', dataSource: { "chart": { "caption": "Distribution of annual salaries", "subcaption": "By Gender", "xAxisName": "Pay Grades", "YAxisName": "Salaries (In USD)", "numberPrefix": "$", "theme": "fint", "showValues": "0", //Showing out of range outliers "showAllOutliers ": "1" }, "categories": [ { "category": [ { "label": "Grade 1" }, { "label": "Grade 2" }, { "label": "Grade 3" } ] } ], "dataset": [ { "seriesname": "Male", "lowerboxcolor": "#008ee4", "upperboxcolor": "#6baa01", "data": [ { "value": "2400,2000,2500,2800,3500,4000, 3700, 3750, 3880, 5000,5500,7500,8000,8200, 8400, 8500, 8550, 8800, 8700, 9000, 14000", //specifying the outlier "outliers":"16900" }, { "value": "7500,9000,12000,13000,14000,16500,17000, 18000, 19000, 19500", "outliers":"23000" }, { "value": "15000,19000,25000,32000,50000,65000", "outliers":"72000" } ] }, { "seriesname": "Female", "lowerboxcolor": "#e44a00", "upperboxcolor": "#f8bd19", "data": [ { "value": "1900,2100,2300,2350,2400,2550,3000,3500,4000, 6000, 6500, 9000", "outliers":"12000" }, { "value": "7000,8000,8300,8700,9500,11000,15000, 17000, 21000", "outliers":"25000" }, { "value": "24000,32000,35000,37000,39000, 58000", "outliers":"71000" } ] } ] } }).render(); });
sguha-work/fiddletest
backup/fiddles/Chart/Data_plots/Configuring_data_plots_in_Box_And_Whisker_chart/demo.js
JavaScript
gpl-2.0
2,779
var Cylon = require('cylon'); Cylon.robot({ connections:{ leapmotion: {adaptor: 'leapmotion'}, ardrone: {adaptor: 'ardrone', port: '192.168.1.1'} }, devices: { leapmotion: {driver: 'leapmotion', connection: 'leapmotion'}, drone: {driver: 'ardrone', connection: 'ardrone'}, //nav: { driver: 'ardroneNav' } }, work: function(my){ // my.drone.config('general:navdata_demo', 'TRUE'); // my.nav.on('update', function(data) { // console.log(data); // }), my.leapmotion.on('hand', function(hand){ if (hand.type === 'right'){ if (hand.pitch() <= 0.25 && hand.pitch() >= -0.15){ console.log("Hover"); my.drone.hover(); }else{ my.drone.forward(hand.pitch()); console.log(hand.pitch()); } if (hand.roll() <= 0.1 && hand.roll() >= -0.1){ console.log("No Turn"); my.drone.hover(); }else{ console.log("Turn"); my.drone.left(hand.roll()); } if (hand.palmPosition[1] >= 150){ console.log("takeoff"); my.drone.takeoff(); }else{ console.log("land"); my.drone.land(); } } }); } }).start();
AlphaNerds/alphaDrone
node_modules/cylon-leapmotion/examples/leap/leapDrone.js
JavaScript
gpl-2.0
1,236
/* * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * The Original Code is HAT. The Initial Developer of the * Original Code is Bill Foote, with contributions from others * at JavaSoft/Sun. */ var hatPkg = Packages.com.sun.tools.hat.internal; /** * This is JavaScript interface for heap analysis using HAT * (Heap Analysis Tool). HAT classes are referred from * this file. In particular, refer to classes in hat.model * package. * * HAT model objects are wrapped as convenient script objects so that * fields may be accessed in natural syntax. For eg. Java fields can be * accessed with obj.field_name syntax and array elements can be accessed * with array[index] syntax. */ // returns an enumeration that wraps elements of // the input enumeration elements. function wrapperEnumeration(e) { return new java.util.Enumeration() { hasMoreElements: function() { return e.hasMoreElements(); }, nextElement: function() { return wrapJavaValue(e.nextElement()); } }; } // returns an enumeration that filters out elements // of input enumeration using the filter function. function filterEnumeration(e, func, wrap) { var next = undefined; var index = 0; function findNext() { var tmp; while (e.hasMoreElements()) { tmp = e.nextElement(); index++; if (wrap) { tmp = wrapJavaValue(tmp); } if (func(tmp, index, e)) { next = tmp; return; } } } return new java.util.Enumeration() { hasMoreElements: function() { findNext(); return next != undefined; }, nextElement: function() { if (next == undefined) { // user may not have called hasMoreElements? findNext(); } if (next == undefined) { throw "NoSuchElementException"; } var res = next; next = undefined; return res; } }; } // enumeration that has no elements .. var emptyEnumeration = new java.util.Enumeration() { hasMoreElements: function() { return false; }, nextElement: function() { throw "NoSuchElementException"; } }; function wrapRoot(root) { if (root) { return { id: root.idString, description: root.description, referrer: wrapJavaValue(root.referer), type: root.typeName }; } else { return null; } } function JavaClassProto() { function jclass(obj) { return obj['wrapped-object']; } // return whether given class is subclass of this class or not this.isSubclassOf = function(other) { var tmp = jclass(this); var otherid = objectid(other); while (tmp != null) { if (otherid.equals(tmp.idString)) { return true; } tmp = tmp.superclass; } return false; } // return whether given class is superclass of this class or not this.isSuperclassOf = function(other) { return other.isSubclassOf(this); } // includes direct and indirect superclasses this.superclasses = function() { var res = new Array(); var tmp = this.superclass; while (tmp != null) { res[res.length] = tmp; tmp = tmp.superclass; } return res; } /** * Returns an array containing subclasses of this class. * * @param indirect should include indirect subclasses or not. * default is true. */ this.subclasses = function(indirect) { if (indirect == undefined) indirect = true; var classes = jclass(this).subclasses; var res = new Array(); for (var i in classes) { var subclass = wrapJavaValue(classes[i]); res[res.length] = subclass; if (indirect) { res = res.concat(subclass.subclasses()); } } return res; } this.toString = function() { return jclass(this).toString(); } } var theJavaClassProto = new JavaClassProto(); // Script wrapper for HAT model objects, values. // wraps a Java value as appropriate for script object function wrapJavaValue(thing) { if (thing == null || thing == undefined || thing instanceof hatPkg.model.HackJavaValue) { return null; } if (thing instanceof hatPkg.model.JavaValue) { // map primitive values to closest JavaScript primitives if (thing instanceof hatPkg.model.JavaBoolean) { return thing.toString() == "true"; } else if (thing instanceof hatPkg.model.JavaChar) { return thing.toString() + ''; } else { return java.lang.Double.parseDouble(thing.toString()); } } else { // wrap Java object as script object return wrapJavaObject(thing); } } // wrap Java object with appropriate script object function wrapJavaObject(thing) { // HAT Java model object wrapper. Handles all cases // (instance, object/primitive array and Class objects) function javaObject(jobject) { // FIXME: Do I need this? or can I assume that these would // have been resolved already? if (jobject instanceof hatPkg.model.JavaObjectRef) { jobject = jobject.dereference(); if (jobject instanceof hatPkg.model.HackJavaValue) { print(jobject); return null; } } if (jobject instanceof hatPkg.model.JavaObject) { return new JavaObjectWrapper(jobject); } else if (jobject instanceof hatPkg.model.JavaClass) { return new JavaClassWrapper(jobject); } else if (jobject instanceof hatPkg.model.JavaObjectArray) { return new JavaObjectArrayWrapper(jobject); } else if (jobject instanceof hatPkg.model.JavaValueArray) { return new JavaValueArrayWrapper(jobject); } else { print("unknown heap object type: " + jobject.getClass()); return jobject; } } // returns wrapper for Java instances function JavaObjectWrapper(instance) { var things = instance.fields; var fields = instance.clazz.fieldsForInstance; // instance fields can be accessed in natural syntax return new JSAdapter() { __getIds__ : function() { var res = new Array(fields.length); for (var i in fields) { res[i] = fields[i].name; } return res; }, __has__ : function(name) { for (var i in fields) { if (name == fields[i].name) return true; } return name == 'class' || name == 'toString' || name == 'wrapped-object'; }, __get__ : function(name) { for (var i in fields) { if(fields[i].name == name) { return wrapJavaValue(things[i]); } } if (name == 'class') { return wrapJavaValue(instance.clazz); } else if (name == 'toString') { return function() { return instance.toString(); } } else if (name == 'wrapped-object') { return instance; } return undefined; } } } // return wrapper for Java Class objects function JavaClassWrapper(jclass) { var fields = jclass.statics; // to access static fields of given Class cl, use // cl.statics.<static-field-name> syntax this.statics = new JSAdapter() { __getIds__ : function() { var res = new Array(fields.length); for (var i in fields) { res[i] = fields[i].field.name; } return res; }, __has__ : function(name) { for (var i in fields) { if (name == fields[i].field.name) { return true; } } return theJavaClassProto[name] != undefined; }, __get__ : function(name) { for (var i in fields) { if (name == fields[i].field.name) { return wrapJavaValue(fields[i].value); } } return theJavaClassProto[name]; } } if (jclass.superclass != null) { this.superclass = wrapJavaValue(jclass.superclass); } else { this.superclass = null; } this.loader = wrapJavaValue(jclass.getLoader()); this.signers = wrapJavaValue(jclass.getSigners()); this.protectionDomain = wrapJavaValue(jclass.getProtectionDomain()); this.instanceSize = jclass.instanceSize; this.name = jclass.name; this.fields = jclass.fields; this['wrapped-object'] = jclass; this.__proto__ = this.statics; } // returns wrapper for Java object arrays function JavaObjectArrayWrapper(array) { var elements = array.elements; // array elements can be accessed in natural syntax // also, 'length' property is supported. return new JSAdapter() { __getIds__ : function() { var res = new Array(elements.length); for (var i = 0; i < elements.length; i++) { res[i] = i; } return res; }, __has__: function(name) { return (typeof(name) == 'number' && name >= 0 && name < elements.length) || name == 'length' || name == 'class' || name == 'toString' || name == 'wrapped-object'; }, __get__ : function(name) { if (typeof(name) == 'number' && name >= 0 && name < elements.length) { return wrapJavaValue(elements[name]); } else if (name == 'length') { return elements.length; } else if (name == 'class') { return wrapJavaValue(array.clazz); } else if (name == 'toString') { return function() { return array.toString(); } } else if (name == 'wrapped-object') { return array; } else { return undefined; } } } } // returns wrapper for Java primitive arrays function JavaValueArrayWrapper(array) { var type = String(java.lang.Character.toString(array.elementType)); var elements = array.elements; // array elements can be accessed in natural syntax // also, 'length' property is supported. return new JSAdapter() { __getIds__ : function() { var r = new Array(array.length); for (var i = 0; i < array.length; i++) { r[i] = i; } return r; }, __has__: function(name) { return (typeof(name) == 'number' && name >= 0 && name < array.length) || name == 'length' || name == 'class' || name == 'toString' || name == 'wrapped-object'; }, __get__: function(name) { if (typeof(name) == 'number' && name >= 0 && name < array.length) { return elements[name]; } if (name == 'length') { return array.length; } else if (name == 'toString') { return function() { return array.valueString(true); } } else if (name == 'wrapped-object') { return array; } else if (name == 'class') { return wrapJavaValue(array.clazz); } else { return undefined; } } } } return javaObject(thing); } // unwrap a script object to corresponding HAT object function unwrapJavaObject(jobject) { if (!(jobject instanceof hatPkg.model.JavaHeapObject)) { try { jobject = jobject["wrapped-object"]; } catch (e) { print("unwrapJavaObject: " + jobject + ", " + e); jobject = undefined; } } return jobject; } /** * readHeapDump parses a heap dump file and returns script wrapper object. * * @param file Heap dump file name * @param stack flag to tell if allocation site traces are available * @param refs flag to tell if backward references are needed or not * @param debug debug level for HAT * @return heap as a JavaScript object */ function readHeapDump(file, stack, refs, debug) { // default value of debug is 0 if (!debug) debug = 0; // by default, we assume no stack traces if (!stack) stack = false; // by default, backward references are resolved if (!refs) refs = true; // read the heap dump var heap = hatPkg.parser.HprofReader.readFile(file, stack, debug); // resolve it heap.resolve(refs); // wrap Snapshot as convenient script object return wrapHeapSnapshot(heap); } /** * The result object supports the following methods: * * forEachClass -- calls a callback for each Java Class * forEachObject -- calls a callback for each Java object * findClass -- finds Java Class of given name * findObject -- finds object from given object id * objects -- returns all objects of given class as an enumeration * classes -- returns all classes in the heap as an enumeration * reachables -- returns all objects reachable from a given object * livepaths -- returns an array of live paths because of which an * object alive. * describeRef -- returns description for a reference from a 'from' * object to a 'to' object. */ function wrapHeapSnapshot(heap) { function getClazz(clazz) { if (clazz == undefined) clazz = "java.lang.Object"; var type = typeof(clazz); if (type == "string") { clazz = heap.findClass(clazz); } else if (type == "object") { clazz = unwrapJavaObject(clazz); } else { throw "class expected";; } return clazz; } // return heap as a script object with useful methods. return { snapshot: heap, /** * Class iteration: Calls callback function for each * Java Class in the heap. Default callback function * is 'print'. If callback returns true, the iteration * is stopped. * * @param callback function to be called. */ forEachClass: function(callback) { if (callback == undefined) callback = print; var classes = this.snapshot.classes; while (classes.hasMoreElements()) { if (callback(wrapJavaValue(classes.nextElement()))) return; } }, /** * Returns an Enumeration of all roots. */ roots: function() { var e = this.snapshot.roots; return new java.util.Enumeration() { hasMoreElements: function() { return e.hasMoreElements(); }, nextElement: function() { return wrapRoot(e.nextElement()); } }; }, /** * Returns an Enumeration for all Java classes. */ classes: function() { return wrapIterator(this.snapshot.classes, true); }, /** * Object iteration: Calls callback function for each * Java Object in the heap. Default callback function * is 'print'.If callback returns true, the iteration * is stopped. * * @param callback function to be called. * @param clazz Class whose objects are retrieved. * Optional, default is 'java.lang.Object' * @param includeSubtypes flag to tell if objects of subtypes * are included or not. optional, default is true. */ forEachObject: function(callback, clazz, includeSubtypes) { if (includeSubtypes == undefined) includeSubtypes = true; if (callback == undefined) callback = print; clazz = getClazz(clazz); if (clazz) { var instances = clazz.getInstances(includeSubtypes); while (instances.hasNextElements()) { if (callback(wrapJavaValue(instances.nextElement()))) return; } } }, /** * Returns an enumeration of Java objects in the heap. * * @param clazz Class whose objects are retrieved. * Optional, default is 'java.lang.Object' * @param includeSubtypes flag to tell if objects of subtypes * are included or not. optional, default is true. * @param where (optional) filter expression or function to * filter the objects. The expression has to return true * to include object passed to it in the result array. * Built-in variable 'it' refers to the current object in * filter expression. */ objects: function(clazz, includeSubtypes, where) { if (includeSubtypes == undefined) includeSubtypes = true; if (where) { if (typeof(where) == 'string') { where = new Function("it", "return " + where); } } clazz = getClazz(clazz); if (clazz) { var instances = clazz.getInstances(includeSubtypes); if (where) { return filterEnumeration(instances, where, true); } else { return wrapperEnumeration(instances); } } else { return emptyEnumeration; } }, /** * Find Java Class of given name. * * @param name class name */ findClass: function(name) { var clazz = this.snapshot.findClass(name + ''); return wrapJavaValue(clazz); }, /** * Find Java Object from given object id * * @param id object id as string */ findObject: function(id) { return wrapJavaValue(this.snapshot.findThing(id)); }, /** * Returns an enumeration of objects in the finalizer * queue waiting to be finalized. */ finalizables: function() { var tmp = this.snapshot.getFinalizerObjects(); return wrapperEnumeration(tmp); }, /** * Returns an array that contains objects referred from the * given Java object directly or indirectly (i.e., all * transitively referred objects are returned). * * @param jobject Java object whose reachables are returned. */ reachables: function (jobject) { return reachables(jobject, this.snapshot.reachableExcludes); }, /** * Returns array of paths of references by which the given * Java object is live. Each path itself is an array of * objects in the chain of references. Each path supports * toHtml method that returns html description of the path. * * @param jobject Java object whose live paths are returned * @param weak flag to indicate whether to include paths with * weak references or not. default is false. */ livepaths: function (jobject, weak) { if (weak == undefined) { weak = false; } function wrapRefChain(refChain) { var path = new Array(); // compute path array from refChain var tmp = refChain; while (tmp != null) { var obj = tmp.obj; path[path.length] = wrapJavaValue(obj); tmp = tmp.next; } function computeDescription(html) { var root = refChain.obj.root; var desc = root.description; if (root.referer) { var ref = root.referer; desc += " (from " + (html? toHtml(ref) : ref.toString()) + ')'; } desc += '->'; var tmp = refChain; while (tmp != null) { var next = tmp.next; var obj = tmp.obj; desc += html? toHtml(obj) : obj.toString(); if (next != null) { desc += " (" + obj.describeReferenceTo(next.obj, heap) + ") ->"; } tmp = next; } return desc; } return new JSAdapter() { __getIds__ : function() { var res = new Array(path.length); for (var i = 0; i < path.length; i++) { res[i] = i; } return res; }, __has__ : function (name) { return (typeof(name) == 'number' && name >= 0 && name < path.length) || name == 'length' || name == 'toHtml' || name == 'toString'; }, __get__ : function(name) { if (typeof(name) == 'number' && name >= 0 && name < path.length) { return path[name]; } else if (name == 'length') { return path.length; } else if (name == 'toHtml') { return function() { return computeDescription(true); } } else if (name == 'toString') { return function() { return computeDescription(false); } } else { return undefined; } }, }; } jobject = unwrapJavaObject(jobject); var refChains = this.snapshot.rootsetReferencesTo(jobject, weak); var paths = new Array(refChains.length); for (var i in refChains) { paths[i] = wrapRefChain(refChains[i]); } return paths; }, /** * Return description string for reference from 'from' object * to 'to' Java object. * * @param from source Java object * @param to destination Java object */ describeRef: function (from, to) { from = unwrapJavaObject(from); to = unwrapJavaObject(to); return from.describeReferenceTo(to, this.snapshot); }, }; } // per-object functions /** * Returns allocation site trace (if available) of a Java object * * @param jobject object whose allocation site trace is returned */ function allocTrace(jobject) { try { jobject = unwrapJavaObject(jobject); var trace = jobject.allocatedFrom; return (trace != null) ? trace.frames : null; } catch (e) { print("allocTrace: " + jobject + ", " + e); return null; } } /** * Returns Class object for given Java object * * @param jobject object whose Class object is returned */ function classof(jobject) { jobject = unwrapJavaObject(jobject); return wrapJavaValue(jobject.clazz); } /** * Find referers (a.k.a in-coming references). Calls callback * for each referrer of the given Java object. If the callback * returns true, the iteration is stopped. * * @param callback function to call for each referer * @param jobject object whose referers are retrieved */ function forEachReferrer(callback, jobject) { jobject = unwrapJavaObject(jobject); var refs = jobject.referers; while (refs.hasMoreElements()) { if (callback(wrapJavaValue(refs.nextElement()))) { return; } } } /** * Compares two Java objects for object identity. * * @param o1, o2 objects to compare for identity */ function identical(o1, o2) { return objectid(o1) == objectid(o2); } /** * Returns Java object id as string * * @param jobject object whose id is returned */ function objectid(jobject) { try { jobject = unwrapJavaObject(jobject); return String(jobject.idString); } catch (e) { print("objectid: " + jobject + ", " + e); return null; } } /** * Prints allocation site trace of given object * * @param jobject object whose allocation site trace is returned */ function printAllocTrace(jobject) { var frames = this.allocTrace(jobject); if (frames == null || frames.length == 0) { print("allocation site trace unavailable for " + objectid(jobject)); return; } print(objectid(jobject) + " was allocated at .."); for (var i in frames) { var frame = frames[i]; var src = frame.sourceFileName; if (src == null) src = '<unknown source>'; print('\t' + frame.className + "." + frame.methodName + '(' + frame.methodSignature + ') [' + src + ':' + frame.lineNumber + ']'); } } /** * Returns an enumeration of referrers of the given Java object. * * @param jobject Java object whose referrers are returned. */ function referrers(jobject) { try { jobject = unwrapJavaObject(jobject); return wrapperEnumeration(jobject.referers); } catch (e) { print("referrers: " + jobject + ", " + e); return emptyEnumeration; } } /** * Returns an array that contains objects referred from the * given Java object. * * @param jobject Java object whose referees are returned. */ function referees(jobject) { var res = new Array(); jobject = unwrapJavaObject(jobject); if (jobject != undefined) { try { jobject.visitReferencedObjects( new hatPkg.model.JavaHeapObjectVisitor() { visit: function(other) { res[res.length] = wrapJavaValue(other); }, exclude: function(clazz, field) { return false; }, mightExclude: function() { return false; } }); } catch (e) { print("referees: " + jobject + ", " + e); } } return res; } /** * Returns an array that contains objects referred from the * given Java object directly or indirectly (i.e., all * transitively referred objects are returned). * * @param jobject Java object whose reachables are returned. * @param excludes optional comma separated list of fields to be * removed in reachables computation. Fields are * written as class_name.field_name form. */ function reachables(jobject, excludes) { if (excludes == undefined) { excludes = null; } else if (typeof(excludes) == 'string') { var st = new java.util.StringTokenizer(excludes, ","); var excludedFields = new Array(); while (st.hasMoreTokens()) { excludedFields[excludedFields.length] = st.nextToken().trim(); } if (excludedFields.length > 0) { excludes = new hatPkg.model.ReachableExcludes() { isExcluded: function (field) { for (var index in excludedFields) { if (field.equals(excludedFields[index])) { return true; } } return false; } }; } else { // nothing to filter... excludes = null; } } else if (! (excludes instanceof hatPkg.model.ReachableExcludes)) { excludes = null; } jobject = unwrapJavaObject(jobject); var ro = new hatPkg.model.ReachableObjects(jobject, excludes); var tmp = ro.reachables; var res = new Array(tmp.length); for (var i in tmp) { res[i] = wrapJavaValue(tmp[i]); } return res; } /** * Returns whether 'from' object refers to 'to' object or not. * * @param from Java object that is source of the reference. * @param to Java object that is destination of the reference. */ function refers(from, to) { try { var tmp = unwrapJavaObject(from); if (tmp instanceof hatPkg.model.JavaClass) { from = from.statics; } else if (tmp instanceof hatPkg.model.JavaValueArray) { return false; } for (var i in from) { if (identical(from[i], to)) { return true; } } } catch (e) { print("refers: " + from + ", " + e); } return false; } /** * If rootset includes given jobject, return Root * object explanining the reason why it is a root. * * @param jobject object whose Root is returned */ function root(jobject) { try { jobject = unwrapJavaObject(jobject); return wrapRoot(jobject.root); } catch (e) { return null; } } /** * Returns size of the given Java object * * @param jobject object whose size is returned */ function sizeof(jobject) { try { jobject = unwrapJavaObject(jobject); return jobject.size; } catch (e) { print("sizeof: " + jobject + ", " + e); return null; } } /** * Returns String by replacing Unicode chars and * HTML special chars (such as '<') with entities. * * @param str string to be encoded */ function encodeHtml(str) { return hatPkg.util.Misc.encodeHtml(str); } /** * Returns HTML string for the given object. * * @param obj object for which HTML string is returned. */ function toHtml(obj) { if (obj == null) { return "null"; } if (obj == undefined) { return "undefined"; } var tmp = unwrapJavaObject(obj); if (tmp != undefined) { var id = tmp.idString; if (tmp instanceof Packages.com.sun.tools.hat.internal.model.JavaClass) { var name = tmp.name; return "<a href='/class/" + id + "'>class " + name + "</a>"; } else { var name = tmp.clazz.name; return "<a href='/object/" + id + "'>" + name + "@" + id + "</a>"; } } else if ((typeof(obj) == 'object') || (obj instanceof JSAdapter)) { if (obj instanceof java.lang.Object) { // script wrapped Java object obj = wrapIterator(obj); // special case for enumeration if (obj instanceof java.util.Enumeration) { var res = "[ "; while (obj.hasMoreElements()) { res += toHtml(obj.nextElement()) + ", "; } res += "]"; return res; } else { return obj; } } else if (obj instanceof Array) { // script array var res = "[ "; for (var i in obj) { res += toHtml(obj[i]); if (i != obj.length - 1) { res += ", "; } } res += " ]"; return res; } else { // if the object has a toHtml function property // just use that... if (typeof(obj.toHtml) == 'function') { return obj.toHtml(); } else { // script object var res = "{ "; for (var i in obj) { res += i + ":" + toHtml(obj[i]) + ", "; } res += "}"; return res; } } } else { // JavaScript primitive value return obj; } } /* * Generic array/iterator/enumeration [or even object!] manipulation * functions. These functions accept an array/iteration/enumeration * and expression String or function. These functions iterate each * element of array and apply the expression/function on each element. */ // private function to wrap an Iterator as an Enumeration function wrapIterator(itr, wrap) { if (itr instanceof java.util.Iterator) { return new java.util.Enumeration() { hasMoreElements: function() { return itr.hasNext(); }, nextElement: function() { return wrap? wrapJavaValue(itr.next()) : itr.next(); } }; } else { return itr; } } /** * Converts an enumeration/iterator/object into an array * * @param obj enumeration/iterator/object * @return array that contains values of enumeration/iterator/object */ function toArray(obj) { obj = wrapIterator(obj); if (obj instanceof java.util.Enumeration) { var res = new Array(); while (obj.hasMoreElements()) { res[res.length] = obj.nextElement(); } return res; } else if (obj instanceof Array) { return obj; } else { var res = new Array(); for (var index in obj) { res[res.length] = obj[index]; } return res; } } /** * Returns whether the given array/iterator/enumeration contains * an element that satisfies the given boolean expression specified * in code. * * @param array input array/iterator/enumeration that is iterated * @param code expression string or function * @return boolean result * * The code evaluated can refer to the following built-in variables. * * 'it' -> currently visited element * 'index' -> index of the current element * 'array' -> array that is being iterated */ function contains(array, code) { array = wrapIterator(array); var func = code; if (typeof(func) != 'function') { func = new Function("it", "index", "array", "return " + code); } if (array instanceof java.util.Enumeration) { var index = 0; while (array.hasMoreElements()) { var it = array.nextElement(); if (func(it, index, array)) { return true; } index++; } } else { for (var index in array) { var it = array[index]; if (func(it, index, array)) { return true; } } } return false; } /** * concatenates two arrays/iterators/enumerators. * * @param array1 array/iterator/enumeration * @param array2 array/iterator/enumeration * * @return concatenated array or composite enumeration */ function concat(array1, array2) { array1 = wrapIterator(array1); array2 = wrapIterator(array2); if (array1 instanceof Array && array2 instanceof Array) { return array1.concat(array2); } else if (array1 instanceof java.util.Enumeration && array2 instanceof java.util.Enumeration) { return new Packages.com.sun.tools.hat.internal.util.CompositeEnumeration(array1, array2); } else { return undefined; } } /** * Returns the number of array/iterator/enumeration elements * that satisfy the given boolean expression specified in code. * The code evaluated can refer to the following built-in variables. * * @param array input array/iterator/enumeration that is iterated * @param code expression string or function * @return number of elements * * 'it' -> currently visited element * 'index' -> index of the current element * 'array' -> array that is being iterated */ function count(array, code) { if (code == undefined) { return length(array); } array = wrapIterator(array); var func = code; if (typeof(func) != 'function') { func = new Function("it", "index", "array", "return " + code); } var result = 0; if (array instanceof java.util.Enumeration) { var index = 0; while (array.hasMoreElements()) { var it = array.nextElement(); if (func(it, index, array)) { result++; } index++; } } else { for (var index in array) { var it = array[index]; if (func(it, index, array)) { result++; } } } return result; } /** * filter function returns an array/enumeration that contains * elements of the input array/iterator/enumeration that satisfy * the given boolean expression. The boolean expression code can * refer to the following built-in variables. * * @param array input array/iterator/enumeration that is iterated * @param code expression string or function * @return array/enumeration that contains the filtered elements * * 'it' -> currently visited element * 'index' -> index of the current element * 'array' -> array that is being iterated * 'result' -> result array */ function filter(array, code) { array = wrapIterator(array); var func = code; if (typeof(code) != 'function') { func = new Function("it", "index", "array", "result", "return " + code); } if (array instanceof java.util.Enumeration) { return filterEnumeration(array, func, false); } else { var result = new Array(); for (var index in array) { var it = array[index]; if (func(it, index, array, result)) { result[result.length] = it; } } return result; } } /** * Returns the number of elements of array/iterator/enumeration. * * @param array input array/iterator/enumeration that is iterated */ function length(array) { array = wrapIterator(array); if (array instanceof Array) { return array.length; } else if (array instanceof java.util.Enumeration) { var cnt = 0; while (array.hasMoreElements()) { array.nextElement(); cnt++; } return cnt; } else { var cnt = 0; for (var index in array) { cnt++; } return cnt; } } /** * Transforms the given object or array by evaluating given code * on each element of the object or array. The code evaluated * can refer to the following built-in variables. * * @param array input array/iterator/enumeration that is iterated * @param code expression string or function * @return array/enumeration that contains mapped values * * 'it' -> currently visited element * 'index' -> index of the current element * 'array' -> array that is being iterated * 'result' -> result array * * map function returns an array/enumeration of values created * by repeatedly calling code on each element of the input * array/iterator/enumeration. */ function map(array, code) { array = wrapIterator(array); var func = code; if(typeof(code) != 'function') { func = new Function("it", "index", "array", "result", "return " + code); } if (array instanceof java.util.Enumeration) { var index = 0; var result = new java.util.Enumeration() { hasMoreElements: function() { return array.hasMoreElements(); }, nextElement: function() { return func(array.nextElement(), index++, array, result); } }; return result; } else { var result = new Array(); for (var index in array) { var it = array[index]; result[result.length] = func(it, index, array, result); } return result; } } // private function used by min, max functions function minmax(array, code) { if (typeof(code) == 'string') { code = new Function("lhs", "rhs", "return " + code); } array = wrapIterator(array); if (array instanceof java.util.Enumeration) { if (! array.hasMoreElements()) { return undefined; } var res = array.nextElement(); while (array.hasMoreElements()) { var next = array.nextElement(); if (code(next, res)) { res = next; } } return res; } else { if (array.length == 0) { return undefined; } var res = array[0]; for (var index = 1; index < array.length; index++) { if (code(array[index], res)) { res = array[index]; } } return res; } } /** * Returns the maximum element of the array/iterator/enumeration * * @param array input array/iterator/enumeration that is iterated * @param code (optional) comparision expression or function * by default numerical maximum is computed. */ function max(array, code) { if (code == undefined) { code = function (lhs, rhs) { return lhs > rhs; } } return minmax(array, code); } /** * Returns the minimum element of the array/iterator/enumeration * * @param array input array/iterator/enumeration that is iterated * @param code (optional) comparision expression or function * by default numerical minimum is computed. */ function min(array, code) { if (code == undefined) { code = function (lhs, rhs) { return lhs < rhs; } } return minmax(array, code); } /** * sort function sorts the input array. optionally accepts * code to compare the elements. If code is not supplied, * numerical sort is done. * * @param array input array/iterator/enumeration that is sorted * @param code expression string or function * @return sorted array * * The comparison expression can refer to the following * built-in variables: * * 'lhs' -> 'left side' element * 'rhs' -> 'right side' element */ function sort(array, code) { // we need an array to sort, so convert non-arrays array = toArray(array); // by default use numerical comparison var func = code; if (code == undefined) { func = function(lhs, rhs) { return lhs - rhs; }; } else if (typeof(code) == 'string') { func = new Function("lhs", "rhs", "return " + code); } return array.sort(func); } /** * Returns the sum of the elements of the array * * @param array input array that is summed. * @param code optional expression used to map * input elements before sum. */ function sum(array, code) { array = wrapIterator(array); if (code != undefined) { array = map(array, code); } var result = 0; if (array instanceof java.util.Enumeration) { while (array.hasMoreElements()) { result += Number(array.nextElement()); } } else { for (var index in array) { result += Number(array[index]); } } return result; } /** * Returns array of unique elements from the given input * array/iterator/enumeration. * * @param array from which unique elements are returned. * @param code optional expression (or function) giving unique * attribute/property for each element. * by default, objectid is used for uniqueness. */ function unique(array, code) { array = wrapIterator(array); if (code == undefined) { code = new Function("it", "return objectid(it);"); } else if (typeof(code) == 'string') { code = new Function("it", "return " + code); } var tmp = new Object(); if (array instanceof java.util.Enumeration) { while (array.hasMoreElements()) { var it = array.nextElement(); tmp[code(it)] = it; } } else { for (var index in array) { var it = array[index]; tmp[code(it)] = it; } } var res = new Array(); for (var index in tmp) { res[res.length] = tmp[index]; } return res; }
openjdk/jdk7u
jdk/src/share/classes/com/sun/tools/hat/resources/hat.js
JavaScript
gpl-2.0
46,751
var searchData= [ ['key',['key',['../classJson_1_1ValueIteratorBase.html#aa2ff5e79fc96acd4c3cd288e92614fc7',1,'Json::ValueIteratorBase::key() const '],['../classJson_1_1ValueIteratorBase.html#aa2ff5e79fc96acd4c3cd288e92614fc7',1,'Json::ValueIteratorBase::key() const ']]] ];
bmob/BmobCocos2d-x
html/search/functions_9.js
JavaScript
gpl-2.0
277
const thymeleaf = require('/lib/thymeleaf'); const dataUtils = require('/lib/data'); const portal = require('/lib/xp/portal'); const assetUrlCache = require('/lib/assetUrlCache'); const view = resolve('default.html'); function buildBodyClass(site, siteConfig, content, params, backgroundImage) { let bodyClass = ''; if (backgroundImage) { bodyClass += 'custom-background '; } if ((content._path == site._path) && dataUtils.isEmpty(params)) { bodyClass += 'home blog '; } if (params.cat || params.tag || params.author) { bodyClass += ' archive '; } if (content.type == app.name + ':post' || content.type == 'portal:page-template') { bodyClass += 'single single-post single-format-standard '; } if (params.author) { bodyClass += 'author ' } return bodyClass; } function getPageItemClass(targetPath, currentContentPath) { return targetPath == currentContentPath ? 'current_page_item' : 'page_item'; } exports.get = function handleGet(request) { const site = portal.getSite(); const siteConfig = portal.getSiteConfig(); dataUtils.deleteEmptyProperties(siteConfig); const content = portal.getContent(); const dashedAppName = app.name.replace(/\./g, "-"); const siteCommon = site.x[dashedAppName].siteCommon; const backgroundImage = siteCommon.backgroundImage; const assetUrls = assetUrlCache.getAssetUrls(request.mode, request.branch); const isFragment = content.type === 'portal:fragment'; const model = { assetUrls: assetUrls, title: site.displayName, description: site.data.description, bodyClass: buildBodyClass(site, siteConfig, content, request.params, backgroundImage), mainRegion: isFragment ? null : content.page.regions['main'], isFragment: isFragment, siteUrl: portal.pageUrl({path: site._path}), footerText: siteCommon.footerText ? portal.processHtml({value: siteCommon.footerText}) : null, backgroundImageUrl: (backgroundImage) ? portal.imageUrl({ id: backgroundImage, scale: '(1,1)', format: 'jpeg' }) : null, headerStyle: request.mode == 'edit' ? 'position: absolute;' : null }; return { body: thymeleaf.render(view, model), pageContributions: { // Insert here instead of in the HTML view itself, because some parts add some of these as their own page contribution. // This is the easiest way to prevent duplicates (which cause errors). headEnd: [ `<script src="${assetUrls.jqueryJs}"></script>`, `<script src="${assetUrls.superheroJs}"></script>`, `<script src="${assetUrls.flexsliderJs}"></script>`, ] } } };
enonic/app-superhero-blog
src/main/resources/site/pages/default/default.js
JavaScript
gpl-2.0
2,889
EasyBlog.module('responsive', function($) { var module = this; // $(selector).responsive({condition}); // $(selector).responsive([{condition1}, {condition2}]); $.fn.responsive = function() { var node = this; /* conditions = { at: 0, // threshold value switchTo: '', // classname to apply to the node alsoSwitch: { 'selector': 'class' } switchStylesheet: '', targetFunction: '', reverseFunction: '' } */ var options = { elementWidth: function() { return $(node).outerWidth(true); }, conditions: $.makeArray(arguments) }; $.responsive.process.call(node, options); }; /* $.responsive({ elementWidth: function() {} // width calculation of the target element }, { condition1 }); $.responsive({ elementWidth: function() {} // width calculation of the target element }, [{ condition1 }, { condition2 }]); */ $.responsive = function(elem, options) { // make sure that single condition object gets convert into array any how options.conditions = $.makeArray(options.conditions); /*var defaultOptions = { // main element width to calculate elementWidth: function() {}, // a function that returns pixel value // array of conditions of ascending thresholdWidth conditions: [{ // threshold for this condition at: 0, // condition specific options switchTo: '', alsoSwitch: {}, // objects with element and class switchStylesheet: '', targetFunction: '', // function to run reverseFunction: '' // reverse function that reverses any action in target function }] }*/ $.responsive.process.call($(elem), options); }; $.responsive.process = function(options) { var node = this; var totalConditions = options.conditions.length; $(window).resize(function() { $.responsive.sortConditions(options); var elementWidth; // calculate element width if ($.isFunction(options.elementWidth)) { elementWidth = options.elementWidth(); } else { elementWidth = options.elementWidth; } // loop through each condition $.each(options.conditions, function(i, condition) { var conditionOptions = $.responsive.properConditions(condition); var thresholdWidth = condition.at; // calculate threshold width if ($.isFunction(condition.at)) { thresholdWidth = condition.at(); } else { thresholdWidth = condition.at; } // perform resize if element <= threshold if (elementWidth <= thresholdWidth) { // remove all other condition first $.responsive.resetToDefault.call(node, options.conditions, i); // apply current condition $.responsive.resize.call(node, conditionOptions); return false; } else { $.responsive.deresize.call(node, conditionOptions); } }); }).resize(); }; $.responsive.resize = function(condition) { var node = this; if (condition.switchTo) { $.each(condition.switchTo, function(i, classname) { node.addClass(classname); }); } if (condition.alsoSwitch) { $.each(condition.alsoSwitch, function(selector, classname) { $(selector).addClass(classname); }); } if (condition.targetFunction) { condition.targetFunction(); } if (condition.switchStylesheet) { $.each(condition.switchStylesheet, function(i, stylesheet) { var tmp = $('link[href$="' + stylesheet + '"]'); if (tmp.length < 1) { $('<link/>', { rel: 'stylesheet', type: 'text/css', href: stylesheet }).appendTo('head'); } }); } }; $.responsive.deresize = function(condition) { var node = this; if (condition.switchTo) { $.each(condition.switchTo, function(i, classname) { node.removeClass(classname); }); } if (condition.alsoSwitch) { $.each(condition.alsoSwitch, function(selector, classname) { $(selector).removeClass(classname); }); } if (condition.reverseFunction) { condition.reverseFunction(); } if (condition.switchStylesheet) { $.each(condition.switchStylesheet, function(i, stylesheet) { $('link[href$="' + stylesheet + '"]').remove(); }); } }; $.responsive.resetToDefault = function(options, current) { var node = this; $.each(options, function(i, condition) { if (current && i == current) { return true; } else { $.responsive.deresize.call(node, condition); } }); }; $.responsive.properConditions = function(condition) { var conditionOptions = { at: condition.at, alsoSwitch: condition.alsoSwitch, switchTo: $.makeArray(condition.switchTo), switchStylesheet: $.makeArray(condition.switchStylesheet), targetFunction: condition.targetFunction, reverseFunction: condition.reverseFunction }; return conditionOptions; }; $.responsive.sortConditions = function(options) { var totalConditions = options.conditions.length; for (var i = 0; i < totalConditions; i++) { for (var j = i + 1; j < totalConditions; j++) { var a, b; if ($.isFunction(options.conditions[i].at)) { a = options.conditions[i].at(); } else { a = options.conditions[i].at; } if ($.isFunction(options.conditions[j].at)) { b = options.conditions[j].at(); } else { b = options.conditions[j].at; } if (a > b) { var tmp = options.conditions[i]; options.conditions[i] = options.conditions[j]; options.conditions[j] = tmp; } } } }; module.resolve(); });
cuongnd/banhangonline88_joomla
media/com_easyblog/scripts_/responsive.js
JavaScript
gpl-2.0
5,417
//Copyright (C) 2015 Timothy Watson, Jakub Pachansky //This program is free software; you can redistribute it and/or //modify it under the terms of the GNU General Public License //as published by the Free Software Foundation; either version 2 //of the License, or (at your option) any later version. //This program is distributed in the hope that it will be useful, //but WITHOUT ANY WARRANTY; without even the implied warranty of //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //GNU General Public License for more details. //You should have received a copy of the GNU General Public License //along with this program; if not, write to the Free Software //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. define(['backbone', 'backbone-pageable'], function(Backbone) { "use strict"; var collection = Backbone.PageableCollection.extend({ url: "heartbeats", mode: "client" }); return collection; });
R-Suite/ServiceConnect.Monitor
ServiceConnect.Monitor/Scripts/app/collections/heartbeats.js
JavaScript
gpl-2.0
987
/*global define*/ define(['jquery', 'i18n!nls/common'], function ($, Common) { 'use strict'; return $.extend(true, {}, Common, { /* "compare_data": "Comparer Données", "add_filter": "Add Filter", "chart_title": "Timeseries on selected data", "select_a_timerange": "Select a timerange", "filter_box_title": "(Filter Box)" */ compare_data: "Comparer les données", add_filter: "Ajouter un filtre", chart_title: "Timeseries sur les données sélectionnées", select_a_timerange: "Sélectionner une série de temps", filter_box_title: "(Boîte à filtre)" }); });
FAOSTAT4/faostat4-ui
i18n/fr/compare.js
JavaScript
gpl-2.0
673
"use strict"; var path_1 = require('path'); var errors_1 = require('./errors'); var fs_extra_1 = require('fs-extra'); var osName = require('os-name'); var _context; var cachedAppScriptsPackageJson; function getAppScriptsPackageJson() { if (!cachedAppScriptsPackageJson) { try { cachedAppScriptsPackageJson = fs_extra_1.readJsonSync(path_1.join(__dirname, '..', '..', 'package.json')); } catch (e) { } } return cachedAppScriptsPackageJson; } exports.getAppScriptsPackageJson = getAppScriptsPackageJson; function getAppScriptsVersion() { var appScriptsPackageJson = getAppScriptsPackageJson(); return (appScriptsPackageJson && appScriptsPackageJson.version) ? appScriptsPackageJson.version : ''; } exports.getAppScriptsVersion = getAppScriptsVersion; function getUserPackageJson(userRootDir) { try { return fs_extra_1.readJsonSync(path_1.join(userRootDir, 'package.json')); } catch (e) { } return null; } function getSystemInfo(userRootDir) { var d = []; var ionicAppScripts = getAppScriptsVersion(); var ionicFramework = null; var ionicNative = null; var angularCore = null; var angularCompilerCli = null; try { var userPackageJson = getUserPackageJson(userRootDir); if (userPackageJson) { var userDependencies = userPackageJson.dependencies; if (userDependencies) { ionicFramework = userDependencies['ionic-angular']; ionicNative = userDependencies['ionic-native']; angularCore = userDependencies['@angular/core']; angularCompilerCli = userDependencies['@angular/compiler-cli']; } } } catch (e) { } d.push("Ionic Framework: " + ionicFramework); if (ionicNative) { d.push("Ionic Native: " + ionicNative); } d.push("Ionic App Scripts: " + ionicAppScripts); d.push("Angular Core: " + angularCore); d.push("Angular Compiler CLI: " + angularCompilerCli); d.push("Node: " + process.version.replace('v', '')); d.push("OS Platform: " + osName()); return d; } exports.getSystemInfo = getSystemInfo; function splitLineBreaks(sourceText) { if (!sourceText) return []; sourceText = sourceText.replace(/\\r/g, '\n'); return sourceText.split('\n'); } exports.splitLineBreaks = splitLineBreaks; exports.objectAssign = (Object.assign) ? Object.assign : function (target, source) { var output = Object(target); for (var index = 1; index < arguments.length; index++) { source = arguments[index]; if (source !== undefined && source !== null) { for (var key in source) { if (source.hasOwnProperty(key)) { output[key] = source[key]; } } } } return output; }; function titleCase(str) { return str.charAt(0).toUpperCase() + str.substr(1); } exports.titleCase = titleCase; function writeFileAsync(filePath, content) { return new Promise(function (resolve, reject) { fs_extra_1.writeFile(filePath, content, function (err) { if (err) { return reject(new errors_1.BuildError(err)); } return resolve(); }); }); } exports.writeFileAsync = writeFileAsync; function readFileAsync(filePath) { return new Promise(function (resolve, reject) { fs_extra_1.readFile(filePath, 'utf-8', function (err, buffer) { if (err) { return reject(new errors_1.BuildError(err)); } return resolve(buffer); }); }); } exports.readFileAsync = readFileAsync; function unlinkAsync(filePath) { return new Promise(function (resolve, reject) { fs_extra_1.unlink(filePath, function (err) { if (err) { return reject(new errors_1.BuildError(err)); } return resolve(); }); }); } exports.unlinkAsync = unlinkAsync; function rimRafAsync(directoryPath) { return new Promise(function (resolve, reject) { fs_extra_1.remove(directoryPath, function (err) { if (err) { return reject(err); } return resolve(); }); }); } exports.rimRafAsync = rimRafAsync; function copyFileAsync(srcPath, destPath) { return new Promise(function (resolve, reject) { var writeStream = fs_extra_1.createWriteStream(destPath); writeStream.on('error', function (err) { reject(err); }); writeStream.on('close', function () { resolve(); }); fs_extra_1.createReadStream(srcPath).pipe(writeStream); }); } exports.copyFileAsync = copyFileAsync; function createFileObject(filePath) { var content = fs_extra_1.readFileSync(filePath).toString(); return { content: content, path: filePath, timestamp: Date.now() }; } exports.createFileObject = createFileObject; function setContext(context) { _context = context; } exports.setContext = setContext; function getContext() { return _context; } exports.getContext = getContext; function transformSrcPathToTmpPath(originalPath, context) { return originalPath.replace(context.srcDir, context.tmpDir); } exports.transformSrcPathToTmpPath = transformSrcPathToTmpPath; function transformTmpPathToSrcPath(originalPath, context) { return originalPath.replace(context.tmpDir, context.srcDir); } exports.transformTmpPathToSrcPath = transformTmpPathToSrcPath; function changeExtension(filePath, newExtension) { var dir = path_1.dirname(filePath); var extension = path_1.extname(filePath); var extensionlessfileName = path_1.basename(filePath, extension); var newFileName = extensionlessfileName + newExtension; return path_1.join(dir, newFileName); } exports.changeExtension = changeExtension; function escapeHtml(unsafe) { return unsafe .replace(/&/g, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/"/g, '&quot;') .replace(/'/g, '&#039;'); } exports.escapeHtml = escapeHtml; function rangeReplace(source, startIndex, endIndex, newContent) { return source.substring(0, startIndex) + newContent + source.substring(endIndex); } exports.rangeReplace = rangeReplace; function stringSplice(source, startIndex, numToDelete, newContent) { return source.slice(0, startIndex) + newContent + source.slice(startIndex + Math.abs(numToDelete)); } exports.stringSplice = stringSplice; function toUnixPath(filePath) { return filePath.replace(/\\/g, '/'); } exports.toUnixPath = toUnixPath;
kfrerichs/roleplay
node_modules/@ionic/app-scripts/dist/util/helpers.js
JavaScript
gpl-3.0
6,661
'use strict'; var resolveBranch = require('resolve-git-branch') , resolveRemote = require('resolve-git-remote') , asyncreduce = require('asyncreduce') , cheerio = require('cheerio') function overrideWithEnvVars(ghinfo) { // could be optimized if both are given since then we don't need to obtain github info var env = process.env; ghinfo.remote = env.JSDOC_GITHUBIFY_REMOTE || ghinfo.remote; ghinfo.branch = env.JSDOC_GITHUBIFY_BRANCH || ghinfo.branch; } function githubInfo(cb) { asyncreduce( [ [ 'remote', resolveRemote ], [ 'branch', resolveBranch ] ] , {} , function (acc, tuple, cb_) { tuple[1](function (err, res) { if (err) return cb_(err); acc[tuple[0]] = res; cb_(null, acc); }); } , function (err, res) { if (err) return cb(err); overrideWithEnvVars(res); res.blobRoot = 'https://github.com/' + res.remote + '/blob/' + res.branch; cb(null, res); } ); } function getDom(html) { // all jsdoc pages should have a <div id="main"> and we only care about its children var dom = cheerio('<wrap>' + html + '</wrap>') var main = dom.find('div#main'); if (main.length) return main; // however if that is not found we'll grab the entire body var body = dom.find('body'); if (body.length) return body; // and if we don't even have a body we'll take it all return dom; } function adaptLinks(dom, blobRoot) { dom.find('.tag-source li') .map(function (idx, x) { if (x.children && x.children[0] && x.children[0].data) { var parts = x.children[0].data.split(','); if (parts.length < 2) return null; return { li: cheerio(x), file: parts[0].trim(), lineno: parts[1].replace(/line/, '').trim() }; } }) .filter(function (x) { return x }) .forEach(function (x) { var fileUrl = blobRoot + '/' + x.file; x.li.replaceWith( '\n<li>\n' + '<a href="' + fileUrl + '">' + x.file + '</a>\n' + '<span>, </span>\n' + '<a href="' + fileUrl + '#L' + x.lineno + '">lineno ' + x.lineno + '</a>\n' + '</li>\n' ) }) } /** * Adapts the given html to be used on github via the following steps: * * - redirect all code sample links to gihub repo blob * - wrap in div.jsdoc-githubify for styling * * @name adaptHtml * @function * @private * @param {String} html generated by jsdoc * @param {Function} cb function (err, res) { } called with transformed html */ exports = module.exports = function adaptHtml(html, cb) { githubInfo(function (err, ghinfo) { if (err) return cb(err); var dom = getDom(html); adaptLinks(dom, ghinfo.blobRoot); var trimmedHtml = dom.html().trim(); cb(null, '<div class="jsdoc-githubify">\n' + trimmedHtml + '\n</div>'); }); }; /** * Determines if the given html contains API documentation * * @name hasApi * @function * @private * @param {String} html * @return true if @see html contains API documentation */ exports.hasApi = function(html) { return !!cheerio(html).find('.details .tag-source').length; }
santiagogil/mis-e-recursos
node_modules/docme/node_modules/jsdoc-githubify/lib/adapt-html.js
JavaScript
gpl-3.0
3,153
process.on('uncaughtException', function (err) { console.log(err) if (err.code !== 'ENOTFOUND') { process.exit() } }) var fs = require('fs') var Path = require('path') var createSbot = require('../lib/ssb-server') var electron = require('electron') var openWindow = require('../lib/window') var TorrentTracker = require('bittorrent-tracker/server') var magnet = require('magnet-uri') var pull = require('pull-stream') var ssbConfig = require('../lib/ssb-config')('ferment') var backgroundProcess = require('../models/background-remote')(ssbConfig) var windows = {} var context = { sbot: createSbot(ssbConfig), config: ssbConfig } console.log('address:', context.sbot.getAddress()) ssbConfig.manifest = context.sbot.getManifest() fs.writeFileSync(Path.join(ssbConfig.path, 'manifest.json'), JSON.stringify(ssbConfig.manifest)) electron.app.on('ready', function () { windows.background = openWindow(context, Path.join(__dirname, '..', 'background-window.js'), { center: true, fullscreen: false, fullscreenable: false, height: 150, maximizable: false, minimizable: false, resizable: false, show: true, skipTaskbar: true, title: 'ferment-background-window', useContentSize: true, width: 150 }) backgroundProcess.target = windows.background }) // torrent tracker (with whitelist) var torrentWhiteList = new Set() var tracker = TorrentTracker({ udp: true, http: false, stats: false, ws: true, filter (infoHash, params, cb) { cb(torrentWhiteList.has(infoHash)) } }) // only allow tracking torrents added by contacts electron.ipcMain.once('ipcBackgroundReady', (e) => { pull( context.sbot.createLogStream({ live: true }), ofType(['ferment/audio', 'ferment/update']), pull.drain((item) => { if (item.sync) { tracker.listen(ssbConfig.trackerPort, ssbConfig.host, (err) => { if (err) console.log('Cannot start tracker') else console.log(`Tracker started at ws://${ssbConfig.host || 'localhost'}:${ssbConfig.trackerPort}`) }) } else if (item.value && typeof item.value.content.audioSrc === 'string') { var torrent = magnet.decode(item.value.content.audioSrc) if (torrent.infoHash) { torrentWhiteList.add(torrent.infoHash) } } }) ) }) function ofType (types) { types = Array.isArray(types) ? types : [types] return pull.filter((item) => { if (item.value) { return types.includes(item.value.content.type) } else { return true } }) }
fermentation/ferment
server/index.js
JavaScript
gpl-3.0
2,551
// srvice supported commands. These functions run the JSON-encoded commands // sent by the server. var srvice$actions = (function($) { function statements(json) { for (var i = 0; i < json.data.length; i++) { srvice.exec(json.data[i]); } } function redirect(json) { if (json.as_link) { window.location.href = json.url; } else { window.location.replace(json.url); } } function dialog(json) { srvice.show_dialog(json.data, json); } function refresh() { window.location.replace('.'); } function jquery(json) { var method; if (json.selector !== undefined) { method = $[json.action]; } else { method = $(json.selector)[json.action]; delete json.selector; } // Execute method if (method !== undefined) { throw 'invalid jQuery method: ' + json.action; } delete json.action; return jsoncall(method, json); } function jquery_chain(json){ var action; var query = $(json.selector); for (var node in json.actions) { if (json.actions.hasOwnProperty(node)) { action = node.action; delete node.action; query = jsoncall(query[action], node); } } return query; } return {statements: statements, redirect: redirect, refresh: refresh, dialog:dialog, jquery_chain: jquery_chain }; })(jQuery);
jonnatas/codeschool
src/srvice/static/js/srvice/commands.js
JavaScript
gpl-3.0
1,568
(function(S,T,U,V,P,W,B,K,C,E,D,Q,X,G,Y,F,t,H,N,O,I,L,Z,R,$,aa,ba,ca,da,ea,M,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,g,n){B("JS");C(["JU.BS","$.V3"],"JS.VTemp",null,function(){c$=D(function(){this.bsTemp=this.vNorm4=this.vNorm3=this.vNorm2=this.vTemp2=this.vTemp1=this.vB=this.vA=this.vTemp=null;E(this,arguments)},JS,"VTemp");I(c$,function(){this.vTemp=new JU.V3;this.vA=new JU.V3;this.vB=new JU.V3;this.vTemp1=new JU.V3;this.vTemp2=new JU.V3;this.vNorm2=new JU.V3; this.vNorm3=new JU.V3;this.vNorm4=new JU.V3;this.bsTemp=new JU.BS})});B("J.api");R(J.api,"SmilesMatcherInterface");B("JS");C(["J.api.SmilesMatcherInterface"],"JS.SmilesMatcher","JU.AU $.BS $.PT JS.InvalidSmilesException $.SmilesAtom $.SmilesBond $.SmilesGenerator $.SmilesParser $.SmilesSearch JU.BSUtil $.Elements $.Logger $.Node $.Point3fi".split(" "),function(){c$=O(JS,"SmilesMatcher",null,J.api.SmilesMatcherInterface);n(c$,"getLastException",function(){return JS.InvalidSmilesException.getLastError()}); n(c$,"getMolecularFormula",function(a,b){JS.InvalidSmilesException.clear();var c=JS.SmilesParser.newSearch("/nostereo/"+a,b,!0);c.createTopoMap(null);c.nodes=c.targetAtoms;return c.getMolecularFormula(!b,null,!1)},"~S,~B");n(c$,"getSmiles",function(a,b,c,d,e){JS.InvalidSmilesException.clear();return(new JS.SmilesGenerator).getSmiles(this,a,b,c,d,e)},"~A,~N,JU.BS,~S,~N");n(c$,"areEqual",function(a,b){JS.InvalidSmilesException.clear();var c=this.findPriv(a,JS.SmilesParser.newSearch(b,!1,!0),(0<=a.indexOf("*")? 2:1)|8,2);return null==c?-1:c.length},"~S,~S");g(c$,"areEqualTest",function(a,b){var c=this.findPriv(a,b,9,2);return null!=c&&1==c.length},"~S,JS.SmilesSearch");n(c$,"find",function(a,b,c){JS.InvalidSmilesException.clear();b=JS.SmilesParser.cleanPattern(b);a=JS.SmilesParser.cleanPattern(a);b=JS.SmilesParser.newSearch(b,!1,!0);a=this.findPriv(a,b,c,3);for(c=a.length;0<=--c;)for(var d=a[c],e=d.length;0<=--e;)d[e]=b.targetAtoms[d[e]].mapIndex;return a},"~S,~S,~N");n(c$,"getRelationship",function(a,b){if(null== a||null==b||0==a.length||0==b.length)return"";var c=this.getMolecularFormula(a,!1),d=this.getMolecularFormula(b,!1);if(!c.equals(d))return"none";var e,c=JU.PT.countChar(JU.PT.rep(a,"@@","@"),"@"),d=JU.PT.countChar(JU.PT.rep(b,"@@","@"),"@");e=c==d&&0<this.areEqual(b,a);if(!e){e=a+b;if(0<=e.indexOf("/")||0<=e.indexOf("\\")||0<=e.indexOf("@")){if(c==d&&(0<c&&0>e.indexOf("@SP"))&&(e=0<this.areEqual("/invertstereo/"+b,a)))return"enantiomers";if(e=0<this.areEqual("/nostereo/"+b,a))return c==d?"diastereomers": "ambiguous stereochemistry!"}return"constitutional isomers"}return"identical"},"~S,~S");n(c$,"reverseChirality",function(a){a=JU.PT.rep(a,"@@","!@");a=JU.PT.rep(a,"@","@@");return a=JU.PT.rep(a,"!@@","@")},"~S");n(c$,"getSubstructureSet",function(a,b,c,d,e){return this.matchPriv(a,b,c,d,null,!0,e|JS.SmilesParser.getFlags(a),1)},"~S,~A,~N,JU.BS,~N");n(c$,"getMMFF94AtomTypes",function(a,b,c,d,e,f){JS.InvalidSmilesException.clear();var h=new JS.SmilesParser(!0,!0),j=null,j=h.parse("");j.exitFirstMatch= !1;j.targetAtoms=b;j.targetAtomCount=Math.abs(c);j.setSelected(d);j.flags=770;j.getRingData(f,!0,!0);j.asVector=!1;j.subSearches=Array(1);j.getSelections();b=new JU.BS;for(d=0;d<a.length;d++)if(null==a[d]||0==a[d].length||a[d].startsWith("#"))e.addLast(null);else if(j.clear(),j.subSearches[0]=h.getSubsearch(j,JS.SmilesParser.cleanPattern(a[d]),770),f=JU.BSUtil.copy(j.search()),e.addLast(f),b.or(f),b.cardinality()==c)break},"~A,~A,~N,JU.BS,JU.Lst,~A");n(c$,"getSubstructureSetArray",function(a,b,c, d,e,f){return this.matchPriv(a,b,c,d,e,!0,f,2)},"~S,~A,~N,JU.BS,JU.BS,~N");g(c$,"getAtropisomerKeys",function(a,b,c,d,e,f){return this.matchPriv(a,b,c,d,e,!1,f,4)},"~S,~A,~N,JU.BS,JU.BS,~N");n(c$,"polyhedronToSmiles",function(a,b,c,d,e,f){for(var h=Array(c),j=0;j<c;j++){h[j]=new JS.SmilesAtom;var m=null==d?null:d[j];K(m,JU.Node)?(h[j].elementNumber=m.getElementNumber(),h[j].bioAtomName=m.getAtomName(),h[j].atomNumber=m.getAtomNumber(),h[j].setT(m)):h[j].elementNumber=K(m,JU.Point3fi)?m.sD:-2;h[j].index= j}m=0;for(j=b.length;0<=--j;)for(var s=b[j],k=s.length,l,g,p=k;0<=--p;)if(!((l=s[p])>=c||(g=s[(p+1)%k])>=c)&&null==h[l].getBondTo(h[g]))(new JS.SmilesBond(h[l],h[g],1,!1)).index=m++;for(j=0;j<c;j++)if(k=h[j].bondCount,0==k||k!=h[j].bonds.length)h[j].bonds=JU.AU.arrayCopyObject(h[j].bonds,k);b=null;b=new JS.SmilesGenerator;null!=d&&(b.polySmilesCenter=a);JS.InvalidSmilesException.clear();b=b.getSmiles(this,h,c,JU.BSUtil.newBitSet2(0,c),null,e|4144);65536==(e&65536)&&(b="//* "+a+" *//\t["+JU.Elements.elementSymbolFromNumber(a.getElementNumber())+ "@PH"+c+(null==f?"":"/"+f+"/")+"]."+b);return b},"JU.Node,~A,~N,~A,~N,~S");n(c$,"getCorrelationMaps",function(a,b,c,d,e){return this.matchPriv(a,b,c,d,null,!0,e,3)},"~S,~A,~N,JU.BS,~N");g(c$,"findPriv",function(a,b,c,d){var e=new JU.BS;b.setFlags(b.flags|JS.SmilesParser.getFlags(a));b.createTopoMap(e);return this.matchPriv(a,b.targetAtoms,-b.targetAtoms.length,null,e,e.isEmpty(),c,d)},"~S,JS.SmilesSearch,~N,~N");g(c$,"matchPriv",function(a,b,c,d,e,f,h,j){JS.InvalidSmilesException.clear();try{var m= 2==(h&2),s=JS.SmilesParser.newSearch(a,m,!1);!m&&!s.patternAromatic&&(null==e&&(e=new JU.BS),JS.SmilesSearch.normalizeAromaticity(s.patternAtoms,e,s.flags),s.isNormalized=!0);s.targetAtoms=b;s.targetAtomCount=Math.abs(c);0>c&&(s.haveTopo=!0);if(0!=c&&(null==d||!d.isEmpty())){var k=!K(b[0],JS.SmilesAtom);s.setSelected(d);s.getSelections();f||(s.bsAromatic=e);s.setRingData(null,null,k||f);s.exitFirstMatch=8==(h&8)}switch(j){case 1:return s.asVector=!1,s.search();case 2:s.asVector=!0;var l=s.search(); return l.toArray(Array(l.size()));case 4:return s.exitFirstMatch=!0,s.setAtropicity=!0,s.search(),s.atropKeys;case 3:s.getMaps=!0;s.setFlags(h|s.flags);var g=s.search();return g.toArray(JU.AU.newInt2(g.size()))}}catch(p){if(F(p,Exception))throw JU.Logger.debugging&&p.printStackTrace(),null==JS.InvalidSmilesException.getLastError()&&JS.InvalidSmilesException.clear(),new JS.InvalidSmilesException(JS.InvalidSmilesException.getLastError());throw p;}return null},"~S,~A,~N,JU.BS,JU.BS,~B,~N,~N");n(c$,"cleanSmiles", function(a){return JS.SmilesParser.cleanPattern(a)},"~S");H(c$,"MODE_BITSET",1,"MODE_ARRAY",2,"MODE_MAP",3,"MODE_ATROP",4)});B("JS");C(["java.lang.Exception"],"JS.InvalidSmilesException",null,function(){c$=O(JS,"InvalidSmilesException",Exception);c$.getLastError=g(c$,"getLastError",function(){return JS.InvalidSmilesException.lastError});c$.clear=g(c$,"clear",function(){JS.InvalidSmilesException.lastError=null});n(c$,"getMessage",function(){return JS.InvalidSmilesException.lastError});G(c$,function(a){L(this, JS.InvalidSmilesException,[a]);JS.InvalidSmilesException.lastError=a.startsWith("Jmol SMILES")?a:"Jmol SMILES Exception: "+a},"~S");H(c$,"lastError",null)});B("JS");C(["JU.JmolMolecule","JU.BS","$.Lst"],"JS.SmilesSearch","java.lang.Float java.util.Hashtable JU.AU $.SB JS.InvalidSmilesException $.SmilesAromatic $.SmilesAtom $.SmilesBond $.SmilesMeasure $.SmilesParser $.VTemp JU.BSUtil $.Edge $.Logger".split(" "),function(){c$=D(function(){this.isSmarts=!1;this.targetAtoms=this.patternAtoms=this.pattern= this.top=null;this.targetAtomCount=0;this.v=this.bsSelected=null;this.patternBioSequence=this.isTopology=this.haveTopo=this.patternAromatic=this.setAtropicity=this.groupByModel=this.exitFirstMatch=this.invertStereochemistry=this.ignoreStereochemistry=this.ignoreAtomClass=this.noAromatic=this.aromaticDouble=this.aromaticPlanar=this.aromaticStrict=this.aromaticOpen=!1;this.subSearches=null;this.haveBondStereochemistry=this.haveSelected=!1;this.stereo=null;this.needRingData=!1;this.needAromatic=!0;this.needRingMemberships= !1;this.nDouble=0;this.ringDataMax=-2147483648;this.ringSets=null;this.ringCount=0;this.measures=null;this.flags=0;this.lastChainAtom=this.atropKeys=this.bsAromatic6=this.bsAromatic5=this.bsAromatic=null;this.isRingCheck=this.isSilent=this.haveComponents=this.isNormalized=this.getMaps=this.asVector=!1;this.selectedAtomCount=0;this.htNested=this.bsFound=this.ringConnections=this.ringCounts=this.ringData=null;this.nNested=0;this.bsCheck=this.bsReturn=this.vReturn=this.nestedBond=null;E(this,arguments)}, JS,"SmilesSearch",JU.JmolMolecule);I(c$,function(){this.patternAtoms=Array(16);this.measures=new JU.Lst;this.bsAromatic=new JU.BS;this.bsAromatic5=new JU.BS;this.bsAromatic6=new JU.BS;this.bsFound=new JU.BS;this.bsReturn=new JU.BS});G(c$,function(){L(this,JS.SmilesSearch,[]);this.top=this;this.v=new JS.VTemp});g(c$,"setTop",function(a){for(;a.top!==a;)a=a.top;this.top=a},"JS.SmilesSearch");c$.addFlags=g(c$,"addFlags",function(a,b){0<=b.indexOf("OPEN")&&(a|=5);0<=b.indexOf("BIO")&&(a|=1048576);0<= b.indexOf("HYDROGEN")&&(a|=4096);0<=b.indexOf("FIRSTMATCHONLY")&&(a|=8);0<=b.indexOf("STRICT")&&(a|=256);0<=b.indexOf("PLANAR")&&(a|=1024);if(0<=b.indexOf("NOAROMATIC")||0<=b.indexOf("NONAROMATIC"))a|=16;0<=b.indexOf("AROMATICDOUBLE")&&(a|=512);0<=b.indexOf("AROMATICDEFINED")&&(a|=128);0<=b.indexOf("MMFF94")&&(a|=768);0<=b.indexOf("TOPOLOGY")&&(a|=8192);0<=b.indexOf("NOATOMCLASS")&&(a|=2048);0<=b.indexOf("NOSTEREO")?a|=32:0<=b.indexOf("INVERTSTEREO")&&(a=0!=(a&64)?a&-65:a|64);0<=b.indexOf("ATOMCOMMENT")&& (a|=131072);0<=b.indexOf("GROUPBYMODEL")&&(a|=67108864);1048576==(a&1048576)&&(0<=b.indexOf("NOCOMMENT")&&(a|=34603008),0<=b.indexOf("UNMATCHED")&&(a|=3145728),0<=b.indexOf("COVALENT")&&(a|=5242880),0<=b.indexOf("HBOND")&&(a|=9437184));return a},"~N,~S");g(c$,"setFlags",function(a){this.flags=a;this.exitFirstMatch=(new Boolean(this.exitFirstMatch|8==(a&8))).valueOf();this.aromaticOpen=5==(a&5);this.aromaticDouble=512==(a&512);this.aromaticStrict=256==(a&256);this.aromaticPlanar=1024==(a&1024);this.groupByModel= 67108864==(a&67108864);this.noAromatic=16==(a&16);this.ignoreAtomClass=2048==(a&2048);this.ignoreStereochemistry=32==(a&32);this.invertStereochemistry=!this.ignoreStereochemistry&&64==(a&64)},"~N");g(c$,"set",function(){this.patternAtoms.length>this.ac&&(this.patternAtoms=JU.AU.arrayCopyObject(this.patternAtoms,this.ac));this.nodes=this.patternAtoms;this.isTopology=!0;this.patternAromatic=!1;this.patternBioSequence=!0;for(var a=this.ac;0<=--a;){var b=this.patternAtoms[a];this.isTopology&&b.isDefined()&& (this.isTopology=!1);b.isBioResidue||(this.patternBioSequence=!1);b.isAromatic&&(this.patternAromatic=!0);b.setBondArray();if(!this.isSmarts&&"\x00"==b.bioType&&!b.setHydrogenCount())throw new JS.InvalidSmilesException("unbracketed atoms must be one of: B, C, N, O, P, S, F, Cl, Br, I, *,");}if(this.haveComponents)for(a=this.ac;0<=--a;)for(var b=this.patternAtoms[a],c=b.bonds,d=b.component,e=b.bondCount;0<=--e;){var f=c[e],h;if(f.isConnection&&f.atom2===b&&(h=f.atom1.component)!=d)for(f=this.ac;0<= --f;)this.patternAtoms[f].component==d&&(this.patternAtoms[f].component=h)}});g(c$,"setSelected",function(a){null==a&&(a=JU.BS.newN(this.targetAtomCount),a.setBits(0,this.targetAtomCount));this.bsSelected=a},"JU.BS");g(c$,"addAtom",function(){return this.appendAtom(new JS.SmilesAtom)});g(c$,"appendAtom",function(a){this.ac>=this.patternAtoms.length&&(this.patternAtoms=JU.AU.doubleLength(this.patternAtoms));return this.patternAtoms[this.ac]=a.setIndex(this.ac++)},"JS.SmilesAtom");g(c$,"addNested", function(a){null==this.htNested&&(this.htNested=new java.util.Hashtable);this.setNested(++this.nNested,a);return this.nNested},"~S");g(c$,"clear",function(){this.bsReturn.clearAll();this.nNested=0;this.nestedBond=this.htNested=null;this.clearBsFound(-1)});g(c$,"clearBsFound",function(a){0>a?null==this.bsCheck&&this.bsFound.clearAll():this.bsFound.clear(a)},"~N");g(c$,"setNested",function(a,b){this.top.htNested.put("_"+a,b)},"~N,~O");g(c$,"getNested",function(a){return this.top.htNested.get("_"+a)}, "~N");g(c$,"getMissingHydrogenCount",function(){for(var a=0,b,c=0;c<this.ac;c++)if(0<=(b=this.patternAtoms[c].explicitHydrogenCount))a+=b;return a});g(c$,"setRingData",function(a,b,c){if(this.isTopology||this.patternBioSequence)this.needAromatic=!1;this.needAromatic&&(this.needRingData=!0);this.needAromatic=(new Boolean(this.needAromatic&(new Boolean(null==a&16!=(this.flags&16))).valueOf())).valueOf();if(!this.needAromatic&&(this.bsAromatic.clearAll(),null!=a&&this.bsAromatic.or(a),!this.needRingMemberships&& !this.needRingData))return;this.getRingData(b,this.needRingData,c)},"JU.BS,~A,~B");g(c$,"getRingData",function(a,b,c){var d=this.aromaticStrict||!this.aromaticOpen&&!this.aromaticPlanar,e=this.aromaticOpen&&!this.aromaticStrict,f=!d?0:768==(this.flags&768)?2:1,h=0==f,j=128==(this.flags&128),m=this.needAromatic&&c&&(d||e),s=null==a?new JU.Lst:a[3]=new JU.Lst,k=m?new JU.Lst:null,l=m?t(this.targetAtomCount,0):null;j&&this.needAromatic&&(JS.SmilesAromatic.checkAromaticDefined(this.targetAtoms,this.bsSelected, this.bsAromatic),f=0);var g=this.targetAtomCount,p=0==g||K(this.targetAtoms[0],JS.SmilesAtom);0>this.ringDataMax&&(this.ringDataMax=8);0<f&&6>this.ringDataMax&&(this.ringDataMax=6);b&&(this.ringCounts=t(g,0),this.ringConnections=t(this.targetAtomCount,0),this.ringData=Array(this.ringDataMax+1));this.ringSets=new JU.SB;for(var q="****",r=this.ringDataMax;q.length<r;)q+=q;for(var v=3;v<=r;v++)if(!(v>g)){var n="*1"+q.substring(0,v-2)+"*1",n=JS.SmilesParser.newSearch(n,!0,!0),n=this.subsearch(n,2);if(null!= a&&5>=v){for(var u=new JU.Lst,x=n.size();0<=--x;)u.addLast(n.get(x));a[v-3]=u}if(0!=n.size()&&(this.needAromatic&&(!j&&4<=v&&7>=v)&&JS.SmilesAromatic.setAromatic(v,this.targetAtoms,this.bsSelected,n,this.bsAromatic,f,e,p,h,this.v,s,k,l,c),b)){this.ringData[v]=new JU.BS;for(u=n.size();0<=--u;){var w=n.get(u);this.ringData[v].or(w);for(x=w.nextSetBit(0);0<=x;x=w.nextSetBit(x+1))this.ringCounts[x]++}}}if(this.needAromatic){m&&JS.SmilesAromatic.finalizeAromatic(this.targetAtoms,this.bsAromatic,s,k,l, e,d);this.bsAromatic5.clearAll();this.bsAromatic6.clearAll();for(v=s.size();0<=--v;)switch(a=s.get(v),a.and(this.bsAromatic),a.cardinality()){case 5:this.bsAromatic5.or(a);break;case 6:this.bsAromatic6.or(a)}}if(b)for(v=this.bsSelected.nextSetBit(0);0<=v;v=this.bsSelected.nextSetBit(v+1))if(b=this.targetAtoms[v],s=b.getEdges(),null!=s)for(u=s.length;0<=--u;)0<this.ringCounts[b.getBondedAtomIndex(u)]&&this.ringConnections[v]++},"~A,~B,~B");g(c$,"subsearch",function(a,b){a.ringSets=this.ringSets;a.targetAtoms= this.targetAtoms;a.targetAtomCount=this.targetAtomCount;a.bsSelected=this.bsSelected;a.htNested=this.htNested;a.haveTopo=this.haveTopo;a.bsCheck=this.bsCheck;a.isSmarts=!0;a.bsAromatic=this.bsAromatic;a.bsAromatic5=this.bsAromatic5;a.bsAromatic6=this.bsAromatic6;a.ringData=this.ringData;a.ringCounts=this.ringCounts;a.ringConnections=this.ringConnections;switch(b){case 1:a.exitFirstMatch=!1;break;case 2:a.isRingCheck=!0;a.isSilent=!0;a.asVector=!0;break;case 3:a.ignoreAtomClass=this.ignoreAtomClass, a.aromaticDouble=this.aromaticDouble,a.haveSelected=this.haveSelected,a.exitFirstMatch=this.exitFirstMatch,a.getMaps=this.getMaps,a.asVector=this.asVector,a.vReturn=this.vReturn,a.bsReturn=this.bsReturn,a.haveBondStereochemistry=this.haveBondStereochemistry}return a.search2(1==b)},"JS.SmilesSearch,~N");g(c$,"search",function(){return this.search2(!1)});g(c$,"search2",function(a){this.setFlags(this.flags);!this.isRingCheck&&(JU.Logger.debugging&&!this.isSilent)&&JU.Logger.debug("SmilesSearch processing "+ this.pattern);if(null==this.vReturn&&(this.asVector||this.getMaps))this.vReturn=new JU.Lst;null==this.bsSelected&&(this.bsSelected=JU.BS.newN(this.targetAtomCount),this.bsSelected.setBits(0,this.targetAtomCount));this.selectedAtomCount=this.bsSelected.cardinality();if(null!=this.subSearches)for(a=0;a<this.subSearches.length&&!(null!=this.subSearches[a]&&(this.subsearch(this.subSearches[a],3),this.exitFirstMatch&&(null==this.vReturn?0<=this.bsReturn.nextSetBit(0):0<this.vReturn.size())));a++);else 0< this.ac&&(null==this.nestedBond?this.clearBsFound(-1):this.bsReturn.clearAll(),this.nextPatternAtom(-1,-1,a,-1));return this.asVector||this.getMaps?this.vReturn:this.bsReturn},"~B");g(c$,"nextPatternAtom",function(a,b,c,d){var e,f;if(++a<this.ac){var h=this.patternAtoms[a],j=0<=b?h.getBondTo(null):0==a?this.nestedBond:null;if(null==j){b=JU.BSUtil.copy(this.bsFound);var m=JU.BSUtil.copy(this.bsFound);if(0<=h.notBondedIndex)if(e=this.patternAtoms[h.notBondedIndex],j=e.getMatchingAtom(),e.isBioAtom)e= j.getOffsetResidueAtom("\x00",1),0<=e&&b.set(e),e=j.getOffsetResidueAtom("\x00",-1),0<=e&&b.set(e);else{f=j.getEdges();for(e=0;e<f.length;e++)b.set(f[e].getOtherAtomNode(j).getIndex())}f=h.isBioAtomWild;e=this.bsSelected.nextSetBit(0);e=f&&0<=e?this.targetAtoms[e].getOffsetResidueAtom("\x00",e):e;for(var s,k=(0<a?this.patternAtoms[a-1]:h).component,l=h.component,g=this.haveComponents&&-2147483648!=l,j=e;0<=j;j=this.bsSelected.nextSetBit(j+1)){if(!b.get(j)&&!this.bsFound.get(j)){e=this.targetAtoms[j]; if(g&&!this.isRingCheck&&(d=this.groupByModel?e.getModelIndex():e.getMoleculeNumber(!1),s=0<a?this.patternAtoms[a-1].matchingComponent:d,k==l!=(s==d)))continue;if(!this.nextTargetAtom(h,e,a,j,c,d))return!1}f&&(e=this.targetAtoms[j].getOffsetResidueAtom(h.bioAtomName,1),0<=e&&(j=e-1))}this.bsFound=m;return!0}e=j.atom1.getMatchingAtom();switch(j.order){case 96:j=e.getOffsetResidueAtom(h.bioAtomName,1);if(0<=j){b=JU.BSUtil.copy(this.bsFound);e.getGroupBits(this.bsFound);if(this.doCheckAtom(j)&&!this.nextTargetAtom(h, this.targetAtoms[j],a,j,c,d))return!1;this.bsFound=b}return!0;case 112:f=new JU.Lst;e.getCrossLinkVector(f,!0,!0);b=JU.BSUtil.copy(this.bsFound);e.getGroupBits(this.bsFound);for(j=2;j<f.size();j+=3)if(m=f.get(j).intValue(),this.doCheckAtom(m)&&!this.nextTargetAtom(h,this.targetAtoms[m],a,m,c,d))return!1;this.bsFound=b;return!0}f=e.getEdges();if(null!=f)for(j=0;j<f.length;j++)if(m=e.getBondedAtomIndex(j),this.doCheckAtom(m)&&!this.nextTargetAtom(h,this.targetAtoms[m],a,m,c,d))return!1;this.clearBsFound(b); return!0}if(!this.ignoreStereochemistry&&!this.isRingCheck&&!this.checkStereochemistry())return!0;b=new JU.BS;for(j=d=0;j<this.ac;j++)if(h=this.patternAtoms[j].getMatchingAtomIndex(),c||!this.top.haveSelected||this.patternAtoms[j].selected){d++;b.set(h);this.patternAtoms[j].isBioAtomWild&&this.targetAtoms[h].getGroupBits(b);if(c)break;if(!this.isSmarts&&!this.setAtropicity&&0<this.patternAtoms[j].explicitHydrogenCount){h=this.targetAtoms[h];e=0;for(f=h.getEdges().length;e<f;e++)m=h.getBondedAtomIndex(e), 1==this.targetAtoms[m].getElementNumber()&&b.set(m)}}if(!this.isSmarts&&b.cardinality()!=this.selectedAtomCount)return!0;if(null!=this.bsCheck)if(c){this.bsCheck.clearAll();for(j=0;j<this.ac;j++)this.bsCheck.set(this.patternAtoms[j].getMatchingAtomIndex());if(this.bsCheck.cardinality()!=this.ac)return!0}else if(b.cardinality()!=this.ac)return!0;this.bsReturn.or(b);if(this.getMaps){a=t(d,0);for(b=j=0;j<this.ac;j++)if(c||!this.top.haveSelected||this.patternAtoms[j].selected)a[b++]=this.patternAtoms[j].getMatchingAtomIndex(); this.vReturn.addLast(a);return!this.exitFirstMatch}if(this.asVector){c=!0;for(j=this.vReturn.size();0<=--j&&c;)c=!this.vReturn.get(j).equals(b);if(!c)return!0;this.vReturn.addLast(b)}if(this.isRingCheck){this.ringSets.append(" ");for(e=3*a+2;--e>a;)this.ringSets.append("-").appendI(this.patternAtoms[(e<=2*a?2*a-e+1:e-1)%a].getMatchingAtomIndex());this.ringSets.append("- ");return!0}return this.exitFirstMatch?!1:b.cardinality()!=this.selectedAtomCount},"~N,~N,~B,~N");g(c$,"doCheckAtom",function(a){return this.bsSelected.get(a)&& !this.bsFound.get(a)},"~N");g(c$,"nextTargetAtom",function(a,b,c,d,e,f){if(!this.isRingCheck&&!this.isTopology)if(null==a.subAtoms){if(!this.checkPrimitiveAtom(a,d))return!0}else if(a.isAND)for(var h=0;h<a.nSubAtoms;h++){if(!this.checkPrimitiveAtom(a.subAtoms[h],d))return!0}else{for(h=0;h<a.nSubAtoms;h++)if(!this.nextTargetAtom(a.subAtoms[h],b,c,d,e,f))return!1;return!0}b=b.getEdges();for(h=a.getBondCount();0<=--h;){var j=a.getBond(h);if(j.getAtomIndex2()==a.index){var m=j.atom1,s=m.getMatchingAtomIndex(); switch(j.order){case 96:case 112:if(!this.checkMatchBond(a,m,j,d,s,null))return!0;break;default:for(var k=0,l=null;k<b.length&&(!(l=b[k]).isCovalent()||!(l.getAtomIndex1()==s||l.getAtomIndex2()==s));k++);if(k==b.length||!this.checkMatchBond(a,m,j,d,s,l))return!0}}}a=this.patternAtoms[a.index];a.setMatchingAtom(this.targetAtoms[d],d);a.matchingComponent=f;if(JU.Logger.debugging&&!this.isRingCheck){for(h=0;h<=c;h++)JU.Logger.debug("pattern atoms "+this.patternAtoms[h]+" "+this.patternAtoms[h].matchingComponent); JU.Logger.debug("--ss--")}this.bsFound.set(d);if(!this.nextPatternAtom(c,d,e,f))return!1;0<=d&&this.clearBsFound(d);return!0},"JS.SmilesAtom,JU.Node,~N,~N,~B,~N");g(c$,"checkPrimitiveAtom",function(a,b){if(0<a.nSubAtoms){for(var c=0;c<a.nSubAtoms;c++)if(this.checkPrimitiveAtom(a.subAtoms[c],b))return!0;return!1}for(var d=this.targetAtoms[b],c=a.not;;){if(0<a.iNested){c=this.getNested(a.iNested);K(c,JS.SmilesSearch)&&(a.isBioAtom&&(c.nestedBond=a.getBondTo(null)),c=this.subsearch(c,1),null==c&&(c= new JU.BS),a.isBioAtom||this.setNested(a.iNested,c));c=a.not!=c.get(b);break}var e=d.getElementNumber(),f=a.elementNumber;if(0<=e&&0<=f&&f!=e)break;if(a.isBioResidue){if(null!=a.bioAtomName&&(a.isLeadAtom()?!d.isLeadAtom():!a.bioAtomName.equals(d.getAtomName().toUpperCase())))break;if(null!=a.residueName&&!a.residueName.equals(d.getGroup3(!1).toUpperCase()))break;if(-2147483648!=a.residueNumber&&a.residueNumber!=d.getResno())break;if("\x00"!=a.insCode&&a.insCode!=d.getInsertionCode())break;if(null!= a.residueChar||-2==a.elementNumber){var e=d.getBioSmilesType(),h=a.getBioSmilesType(),j=!0,f=!1;switch(h){case "\x00":case "*":j=!0;break;case "n":j="r"==e||"c"==e;f=!0;break;case "r":case "c":f=!0;default:j=e==h}if(!j)break;j=d.getGroup1("\x00").toUpperCase();h=null==a.residueChar?"*":a.residueChar.charAt(0);j=h==j.charAt(0);switch(h){case "*":j=!0;break;case "N":j=f?"r"==e||"c"==e:j;break;case "R":j=f?d.isPurine():j;break;case "Y":j=f?d.isPyrimidine():j}if(!j)break}if(a.isBioAtom&&a.notCrossLinked&& d.getCrossLinkVector(null,!0,!0))break}else{if(-2147483648!=a.atomNumber&&a.atomNumber!=d.getAtomNumber())break;if(0<=a.jmolIndex&&d.getIndex()!=a.jmolIndex)break;if(null!=a.atomType&&!a.atomType.equals(d.getAtomType()))break;if(-2147483648!=(f=a.getAtomicMass())&&(0<=f&&f!=(e=d.getIsotopeNumber())||0>f&&0!=e&&-f!=e))break;if(!this.noAromatic&&!a.aromaticAmbiguous&&a.isAromatic!=this.bsAromatic.get(b))break;if(-2147483648!=(f=a.getCharge())&&f!=d.getFormalCharge())break;f=a.getCovalentHydrogenCount()+ a.explicitHydrogenCount;if(0<=f&&f!=d.getTotalHydrogenCount())break;if(-2147483648!=(f=a.implicitHydrogenCount))if(e=d.getImplicitHydrogenCount(),-1==f?0==e:f!=e)break;if(0<a.degree&&a.degree!=d.getCovalentBondCount()-d.getImplicitHydrogenCount())break;if(0<a.nonhydrogenDegree&&a.nonhydrogenDegree!=d.getCovalentBondCount()-d.getCovalentHydrogenCount())break;if(this.isSmarts&&0<a.valence&&a.valence!=d.getTotalValence())break;if(0<a.connectivity&&a.connectivity!=d.getCovalentBondCountPlusMissingH())break; if(-2147483648!=a.atomNumber&&a.atomNumber!=d.getAtomNumber())break;if(0<=a.jmolIndex&&d.getIndex()!=a.jmolIndex)break;if(null!=a.atomType&&!a.atomType.equals(d.getAtomType()))break;if((!this.ignoreAtomClass||this.isSmarts)&&!Float.isNaN(a.atomClass)&&a.atomClass!=d.getFloatProperty("property_atomclass"))break;if(null!=this.ringData){if(-1<=a.ringSize)if(0>=a.ringSize){if(0==this.ringCounts[b]!=(0==a.ringSize))break}else{d=this.ringData[500==a.ringSize?5:600==a.ringSize?6:a.ringSize];if(null==d|| !d.get(b))break;if(!this.noAromatic)if(500==a.ringSize){if(!this.bsAromatic5.get(b))break}else if(600==a.ringSize&&!this.bsAromatic6.get(b))break}if(-1<=a.ringMembership&&(-1==a.ringMembership?0==this.ringCounts[b]:this.ringCounts[b]!=a.ringMembership))break;if(0<=a.ringConnectivity&&(f=this.ringConnections[b],-1==a.ringConnectivity&&0==f||-1!=a.ringConnectivity&&f!=a.ringConnectivity))break}}c=!c;break}return c},"JS.SmilesAtom,~N");g(c$,"checkMatchBond",function(a,b,c,d,e,f){if(null!=c.bondsOr){for(var h= 0;h<c.nBondsOr;h++)if(this.checkMatchBond(a,b,c.bondsOr[h],d,e,f))return!0;return!1}if(!this.isRingCheck&&!this.isTopology)if(0==c.nPrimitives){if(!this.checkPrimitiveBond(c,d,e,f))return!1}else for(a=0;a<c.nPrimitives;a++)if(b=c.setPrimitive(a),!this.checkPrimitiveBond(b,d,e,f))return!1;c.matchingBond=f;return!0},"JS.SmilesAtom,JS.SmilesAtom,JS.SmilesBond,~N,~N,JU.Edge");g(c$,"checkPrimitiveBond",function(a,b,c,d){var e=!1;switch(a.order){case 96:return a.isNot!=(this.targetAtoms[c].getOffsetResidueAtom("\x00", 1)==this.targetAtoms[b].getOffsetResidueAtom("\x00",0));case 112:return a.isNot!=this.targetAtoms[b].isCrossLinked(this.targetAtoms[c])}var f=!this.noAromatic&&this.bsAromatic.get(b),h=!this.noAromatic&&this.bsAromatic.get(c);d=d.getCovalentOrder();var j=a.order;if(f&&h)switch(j){case 17:case 65:e=JS.SmilesSearch.isRingBond(this.ringSets,b,c);break;case 1:e=!this.isSmarts||!JS.SmilesSearch.isRingBond(this.ringSets,b,c);break;case 2:e=this.isNormalized||this.aromaticDouble&&(2==d||514==d);break;case 65537:case 65538:e= !a.isNot;break;case 81:case -1:e=!0}else switch(j){case 17:if(!this.noAromatic)break;case 81:case -1:e=!0;break;case 1:case 1025:case 1041:switch(d){case 1:case 1025:case 1041:e=!0}break;case 65537:case 65538:switch(d){case 1:case 65537:case 65538:e=!a.isNot}break;case 2:case 3:case 4:e=d==j;break;case 65:e=JS.SmilesSearch.isRingBond(this.ringSets,b,c)}return e!=a.isNot},"JS.SmilesBond,~N,~N,JU.Edge");c$.isRingBond=g(c$,"isRingBond",function(a,b,c){return null!=a&&0<=a.indexOf("-"+b+"-"+c+"-")},"JU.SB,~N,~N"); g(c$,"checkStereochemistry",function(){for(var a=0;a<this.measures.size();a++)if(!this.measures.get(a).check())return!1;if(null!=this.stereo&&!this.stereo.checkStereoChemistry(this,this.v))return!1;if(!this.haveBondStereochemistry)return!0;for(var b=null,c=null,a=0;a<this.ac;a++){for(var d=this.patternAtoms[a],e=null,f=null,h=null,j=0,m=0,s=0,k=d.getBondCount(),l=!1,g=!0,p=0;p<k;p++){var c=d.getBond(p),q=c.atom2===d,g=c.atom1.index<c.atom2.index,r=c.order;switch(r){case 65537:case 65538:if(!g)continue; case 2:if(q)continue;e=c.atom2;s=r;(l=2!=r)&&(j=c.isNot?-1:1);break;case 1025:case 1041:f=q?c.atom1:c.atom2,j=q!=(1025==r)?1:-1}}if(l){if(this.setAtropicity){null==b&&(b=new JU.Lst);b.addLast(c);continue}h=d.getBond(c.atropType[0]);if(null==h)return!1;f=h.getOtherAtom(d);h=e.getBond(c.atropType[1]);if(null==h)return!1;h=h.getOtherAtom(e);JU.Logger.debugging&&JU.Logger.info("atropisomer check for atoms "+f+d+" "+e+h)}else{if(null==e||0==j)continue;k=d;for(p=0;2==e.getBondCount()&&4==e.getValence();)p++, q=e.getEdges(),q=q[q[0].getOtherAtomNode(e)===k?1:0],k=e,e=q.getOtherAtomNode(e);if(1==p%2)continue;k=e.getBondCount();for(p=0;p<k&&0==m;p++)switch(c=e.getBond(p),r=c.order,r){case 1025:case 1041:h=(q=c.atom2===e)?c.atom1:c.atom2,m=q!=(1025==r)?1:-1}if(0==m)continue}k=d.getMatchingAtom();p=e.getMatchingAtom();f=f.getMatchingAtom();h=h.getMatchingAtom();if(null==f||null==h)return!1;this.haveTopo&&this.setTopoCoordinates(k,p,f,h,s);f=JS.SmilesMeasure.setTorsionData(f,k,p,h,this.v,l);if(l){if(f*=j*(65537== s?1:-1)*(g?1:-1),JU.Logger.debugging&&JU.Logger.info("atrop dihedral "+f+" "+d+" "+e+" "+c),1>f)return!1}else if(0>this.v.vTemp1.dot(this.v.vTemp2)*j*m)return!1}if(this.setAtropicity){this.atropKeys="";for(a=0;a<b.size();a++)this.atropKeys+=","+this.getAtropIndex(c=b.get(a),!0)+this.getAtropIndex(c,!1)}return!0});g(c$,"getAtropIndex",function(a,b){for(var c=b?a.atom1:a.atom2,d=c.getMatchingAtom(),d=JU.Edge.getAtropismNode(a.matchingBond.order,d,b),e=c.bonds,f=c.getBondCount();0<=--f;)if(e[f].getOtherAtomNode(c).getMatchingAtom()=== d)return f+1;return 0},"JS.SmilesBond,~B");g(c$,"setTopoCoordinates",function(a,b,c,d,e){a.set(-1,0,0);b.set(1,0,0);if(2!=e)e=a.getBondTo(b),b=65537==e.order?1:-1,c.set(-1,1,0),d.set(1,1,b/2);else{d=c=0;for(var f=a.getEdges(),h=f.length;0<=--h;)if(e=f[h],2!=e.order){var j=e.getOtherAtomNode(a);j.set(-1,0==c++?-1:1,0);j=e.getAtomIndex2()==a.getIndex()?c:-c;switch(e.order){case 1025:d=j;break;case 1041:d=-j}}var m=0;c=0;a=Array(2);f=b.getEdges();for(h=f.length;0<=--h;)if(e=f[h],2!=e.order)switch(j= e.getOtherAtomNode(b),a[c]=j,j.set(1,0==c++?1:-1,0),j=e.getAtomIndex2()==b.getIndex()?c:-c,e.order){case 1025:m=j;break;case 1041:m=-j}0<d*m==(Math.abs(d)%2==Math.abs(m)%2)&&(b=a[0].y,a[0].y=a[1].y,a[1].y=b)}},"JS.SmilesAtom,JS.SmilesAtom,JS.SmilesAtom,JS.SmilesAtom,~N");g(c$,"createTopoMap",function(a){var b=null==a,c=this.getMissingHydrogenCount(),c=this.ac+c,d=Array(c);this.targetAtoms=d;for(var e=0,f=0;e<this.ac;e++,f++){var h=this.patternAtoms[e],j=h.explicitHydrogenCount;0>j&&(j=0);var m=d[f]= (new JS.SmilesAtom).setTopoAtom(h.component,f,h.symbol,h.getCharge());m.implicitHydrogenCount=j;if(!b){m.mapIndex=e;m.stereo=h.stereo;m.setAtomicMass(h.getAtomicMass());m.bioAtomName=h.bioAtomName;m.residueName=h.residueName;m.residueChar=h.residueChar;m.residueNumber=h.residueNumber;m.atomNumber=h.residueNumber;m.insCode=h.insCode;m.atomClass=h.atomClass;m.explicitHydrogenCount=0;m.isBioAtom=h.isBioAtom;m.bioType=h.bioType;m.$isLeadAtom=h.$isLeadAtom;!b&&h.isAromatic&&a.set(f);h.setMatchingAtom(null, f);h=Array(h.getBondCount()+j);for(m.setBonds(h);0<=--j;){h=d[++f]=(new JS.SmilesAtom).setTopoAtom(m.component,f,"H",0);h.mapIndex=-e-1;h.setBonds(Array(1));var s=new JS.SmilesBond(m,h,1,!1);JU.Logger.debugging&&JU.Logger.info(""+s)}}}if(!b){for(e=0;e<this.ac;e++){h=this.patternAtoms[e];j=h.getMatchingAtomIndex();a=d[j];j=h.getBondCount();for(b=0;b<j;b++)if(f=h.getBond(b),f.atom1===h){s=1;switch(f.order){case 1:case 2:case 3:case 4:case 1025:case 1041:case 65537:case 65538:case 112:case 96:s=f.order; break;case 17:s=514}f=d[f.atom2.getMatchingAtomIndex()];s=new JS.SmilesBond(a,f,s,!1);f.bondCount--;JU.Logger.debugging&&JU.Logger.info(""+s)}else f=d[f.atom1.getMatchingAtomIndex()],s=f.getBondTo(a),a.addBond(s)}for(e=0;e<c;e++)if(s=d[e],h=s.bonds,!(2>h.length||h[0].isFromPreviousTo(s)))for(j=h.length;1<=--j;)if(h[j].isFromPreviousTo(s)){s=h[j];h[j]=h[0];h[0]=s;break}if(!this.ignoreStereochemistry)for(e=this.ac;0<=--e;)h=this.patternAtoms[e],null!=h.stereo&&h.stereo.fixStereo(h)}},"JU.BS");c$.normalizeAromaticity= g(c$,"normalizeAromaticity",function(a,b,c){var d=new JS.SmilesSearch;d.setFlags(c);d.targetAtoms=a;d.targetAtomCount=a.length;d.bsSelected=JU.BSUtil.newBitSet2(0,a.length);c=JU.AU.createArrayOfArrayList(4);d.setRingData(null,c,!0);b.or(d.bsAromatic);if(!b.isEmpty()){b=c[3];for(d=b.size();0<=--d;){c=b.get(d);for(var e=c.nextSetBit(0);0<=e;e=c.nextSetBit(e+1)){var f=a[e];!f.isAromatic&&!(-2==f.elementNumber||0==f.elementNumber)&&f.setSymbol(f.symbol.toLowerCase())}}}},"~A,JU.BS,~N");g(c$,"getSelections", function(){var a=this.top.htNested;if(!(null==a||0==this.targetAtoms.length))for(var b=new java.util.Hashtable,c,a=a.entrySet().iterator();a.hasNext()&&((c=a.next())||1);){var d=c.getValue().toString();if(d.startsWith("select")){var e=b.containsKey(d)?b.get(d):this.targetAtoms[0].findAtomsLike(d.substring(6));null==e&&(e=new JU.BS);b.put(d,e);c.setValue(e)}}});c$.getNormalThroughPoints=g(c$,"getNormalThroughPoints",function(a,b,c,d,e,f){e.sub2(b,a);f.sub2(c,a);d.cross(e,f);d.normalize();e.setT(a); return-e.dot(d)},"JU.Node,JU.Node,JU.Node,JU.V3,JU.V3,JU.V3");g(c$,"findImplicitHydrogen",function(a){for(var b=a.getEdges().length;0<=--b;){var c=a.getBondedAtomIndex(b);if(1==this.targetAtoms[c].getElementNumber()&&!this.bsFound.get(c))return this.targetAtoms[c]}return null},"JU.Node");g(c$,"toString",function(){var a=(new JU.SB).append(this.pattern);a.append("\nmolecular formula: "+this.getMolecularFormula(!0,null,!1));return a.toString()});H(c$,"SUBMODE_NESTED",1,"SUBMODE_RINGCHECK",2,"SUBMODE_OR", 3)});B("JS");C(["java.util.Hashtable","JU.BS","JS.VTemp"],"JS.SmilesGenerator","JU.AU $.Lst $.SB JS.InvalidSmilesException $.SmilesAtom $.SmilesBond $.SmilesParser $.SmilesSearch $.SmilesStereo JU.BSUtil $.Elements $.JmolMolecule $.Logger".split(" "),function(){c$=D(function(){this.atoms=null;this.ac=0;this.bsAromatic=this.bsSelected=null;this.flags=0;this.explicitH=!1;this.vTemp=this.ringSets=null;this.nPairsMax=this.nPairs=0;this.bsIncludingH=this.bsRingKeys=this.htRings=this.htRingsSequence=this.prevSp2Atoms= this.prevAtom=this.bsToDo=this.bsBondsDn=this.bsBondsUp=null;this.topologyOnly=!1;this.getAromatic=!0;this.openSMILES=this.noStereo=this.aromaticDouble=this.noBioComment=this.addAtomComment=!1;this.smilesStereo=this.polySmilesCenter=null;this.isPolyhedral=!1;this.sm=this.aromaticRings=null;this.iHypervalent=0;this.atemp=null;this.chainCheck=0;E(this,arguments)},JS,"SmilesGenerator");I(c$,function(){this.vTemp=new JS.VTemp;this.bsBondsUp=new JU.BS;this.bsBondsDn=new JU.BS;this.htRingsSequence=new java.util.Hashtable; this.htRings=new java.util.Hashtable;this.bsRingKeys=new JU.BS});g(c$,"getSmiles",function(a,b,c,d,e,f){var h=d.nextSetBit(0);if(0>h)return"";this.sm=a;this.flags=f;this.atoms=b;this.ac=c;this.bsSelected=d=JU.BSUtil.copy(d);this.flags=f=JS.SmilesSearch.addFlags(f,null==e?"":e.toUpperCase());if(1048576==(f&1048576))return this.getBioSmiles(d,e,f);this.openSMILES=5==(f&5);this.addAtomComment=131072==(f&131072);this.aromaticDouble=512==(f&512);this.explicitH=4096==(f&4096);this.topologyOnly=8192==(f& 8192);this.getAromatic=16!=(f&16);this.noStereo=32==(f&32);this.isPolyhedral=65536==(f&65536);return this.getSmilesComponent(b[h],d,!0,!1,!1)},"JS.SmilesMatcher,~A,~N,JU.BS,~S,~N");g(c$,"getBioSmiles",function(a,b,c){this.addAtomComment=131072==(c&131072);var d=3145728==(c&3145728),e=34603008==(c&34603008),f=5242880==(c&5242880);c=9437184==(c&9437184);var h=f||c,j=new JU.SB;null!=b&&!this.noBioComment&&j.append("//* Jmol bioSMILES ").append(b.$replace("*","_")).append(" *//");b=this.noBioComment? "":"\n";var m=new JU.BS,s=null,k="",l,g=new JU.Lst;try{for(var p=0,q=a.nextSetBit(0);0<=q;q=a.nextSetBit(q+1)){var r=this.atoms[q],n=r.getGroup1("?"),y=r.getBioStructureTypeName(),u=n===n.toLowerCase();if(null!=b)if(0<j.length()&&j.append(b),b=null,p=0,0<y.length)0!=r.getChainID()&&!e&&(l="//* chain "+r.getChainIDStr()+" "+y+" "+r.getResno()+" *// ",p=l.length,j.append(l)),p++,j.append("~").appendC(y.toLowerCase().charAt(0)).append("~");else{l=this.getSmilesComponent(r,a,!1,!0,!0);if(l.equals(s)){b= "";continue}var s=l,x=r.getGroup3(!0),w;e?w="/"+l+"/":(null!=x&&(l="//* "+x+" *//"+l),w=l+"//");if(0<=k.indexOf(w)){b="";continue}k+=w;j.append(l);b=e?".":".\n";continue}75<=p&&!e&&(j.append("\n "),p=2);this.addAtomComment&&j.append("\n//* ["+r.getGroup3(!1)+"#"+r.getResno()+"] *//\t");u?this.addBracketedBioName(j,r,0<y.length?".0":null,!1):j.append(n);p++;if(h){r.getCrossLinkVector(g,f,c);for(var z=0;z<g.size();z+=3)j.append(":"),l=this.getRingCache(g.get(z).intValue(),g.get(z+1).intValue(),this.htRingsSequence), j.append(l),p+=1+l.length;g.clear()}r.getGroupBits(m);a.andNot(m);var A=r.getOffsetResidueAtom("\x00",1);if(0>A||!a.get(A)){e||j.append(" //* ").appendI(r.getResno()).append(" *//");if(0>A&&0>(A=a.nextSetBit(q+1)))break;0<p&&(b=e?".":".\n")}q=A-1}}catch(t){if(F(t,Exception))throw new JS.InvalidSmilesException("//* error: "+t.getMessage()+" *//");throw t;}if(!d&&!this.htRingsSequence.isEmpty())throw this.dumpRingKeys(j,this.htRingsSequence),new JS.InvalidSmilesException("//* ?ring error? *//");l=j.toString(); l.endsWith(".\n")?l=l.substring(0,l.length-2):e&&l.endsWith(".")&&(l=l.substring(0,l.length-1));return l},"JU.BS,~S,~N");g(c$,"addBracketedBioName",function(a,b,c,d){a.append("[");if(null!=c){var e=b.getChainIDStr();a.append(b.getGroup3(!1));c.equals(".0")||a.append(c).append("#").appendI(b.getElementNumber());d&&(a.append("//* ").appendI(b.getResno()),0<e.length&&a.append(":").append(e),a.append(" *//"))}else a.append(JU.Elements.elementNameFromNumber(b.getElementNumber()));a.append("]")},"JU.SB,JU.Node,~S,~B"); g(c$,"getSmilesComponent",function(a,b,c,d,e){!this.explicitH&&(1==a.getElementNumber()&&0<a.getEdges().length)&&(a=this.atoms[a.getBondedAtomIndex(0)]);this.bsSelected=JU.JmolMolecule.getBranchBitSet(this.atoms,a.getIndex(),JU.BSUtil.copy(b),null,-1,!0,c);b.andNot(this.bsSelected);this.iHypervalent=-1;for(b=this.bsSelected.nextSetBit(0);0<=b&&0>this.iHypervalent;b=this.bsSelected.nextSetBit(b+1))if(4<this.atoms[b].getCovalentBondCount()||this.isPolyhedral)this.iHypervalent=b;this.bsIncludingH=JU.BSUtil.copy(this.bsSelected); if(!this.explicitH)for(b=this.bsSelected.nextSetBit(0);0<=b;b=this.bsSelected.nextSetBit(b+1))c=this.atoms[b],1==c.getElementNumber()&&(0==c.getIsotopeNumber()&&0<c.getBondCount()&&c.getBondedAtomIndex(0)!=this.iHypervalent)&&this.bsSelected.clear(b);this.bsAromatic=new JU.BS;!this.topologyOnly&&2<this.bsSelected.cardinality()&&(this.generateRingData(),this.setBondDirections());this.bsToDo=JU.BSUtil.copy(this.bsSelected);c=new JU.SB;for(b=this.bsToDo.nextSetBit(0);0<=b;b=this.bsToDo.nextSetBit(b+ 1))if(4<this.atoms[b].getCovalentBondCount()||this.isPolyhedral)null==a&&c.append("."),this.getSmilesAt(c,this.atoms[b],d,!1,e),a=null;if(null!=a)for(;null!=(a=this.getSmilesAt(c,a,d,!0,e)););for(;0<this.bsToDo.cardinality()||!this.htRings.isEmpty();){a=this.htRings.values().iterator();if(a.hasNext()){if(a=this.atoms[a.next()[1].intValue()],!this.bsToDo.get(a.getIndex()))break}else a=this.atoms[this.bsToDo.nextSetBit(0)];c.append(".");for(this.prevAtom=this.prevSp2Atoms=null;null!=(a=this.getSmilesAt(c, a,d,!0,e)););}if(!this.htRings.isEmpty())throw this.dumpRingKeys(c,this.htRings),new JS.InvalidSmilesException("//* ?ring error? *//\n"+c);d=c.toString();if(0<=d.indexOf("^-")){e=d;try{var f=this.sm.getAtropisomerKeys(d,this.atoms,this.ac,this.bsSelected,this.bsAromatic,this.flags);for(b=1;b<f.length;){var h=d.indexOf("^-");if(0>h)break;d=d.substring(0,h+1)+f.substring(b,b+2)+d.substring(h+1);b+=3}}catch(j){if(F(j,Exception))System.out.println("???"),d=e;else throw j;}}return d},"JU.Node,JU.BS,~B,~B,~B"); g(c$,"generateRingData",function(){var a=JS.SmilesParser.newSearch("[r500]",!0,!0);a.targetAtoms=this.atoms;a.setSelected(this.bsSelected);a.setFlags(this.flags);a.targetAtomCount=this.ac;a.ringDataMax=7;a.flags=this.flags;var b=JU.AU.createArrayOfArrayList(4);a.setRingData(null,b,!0);this.bsAromatic=a.bsAromatic;this.ringSets=a.ringSets;this.aromaticRings=b[3]});g(c$,"getBondStereochemistry",function(a,b){if(null==a)return"\x00";var c=a.index,d=null==b||a.getAtomIndex1()==b.getIndex();return this.bsBondsUp.get(c)? d?"/":"\\":this.bsBondsDn.get(c)?d?"\\":"/":"\x00"},"JU.Edge,JU.Node");g(c$,"setBondDirections",function(){for(var a=new JU.BS,b=M(2,3,null),c=this.bsSelected.nextSetBit(0);0<=c;c=this.bsSelected.nextSetBit(c+1))for(var d=this.atoms[c],e=d.getEdges(),f=0;f<e.length;f++){var h=e[f],j=h.index,m;if(!a.get(j)&&!(2!=h.getCovalentOrder()||JS.SmilesSearch.isRingBond(this.ringSets,c,(m=h.getOtherAtomNode(d)).getIndex()))){a.set(j);h=0;for(j=d;2==m.getCovalentBondCount()&&4==m.getValence();){var g=m.getEdges(), g=g[g[0].getOtherAtomNode(m)===j?1:0];a.set(g.index);j=m;m=g.getOtherAtomNode(m);h++}if(1!=h%2){for(var k=h=null,j=0,g=M(-1,[d,m]),k=1,l=0;2>l&&0<k&&3>k;l++)for(var k=0,n=g[l],p=n.getEdges(),q=0;q<p.length;q++)1!=p[q].getCovalentOrder()||1==p[q].getOtherAtomNode(n).getElementNumber()||(b[l][k++]=p[q],"\x00"!=this.getBondStereochemistry(p[q],n)&&(h=p[q],j=l));if(!(3==k||0==k))if(null==h&&(j=0,h=b[j][0],this.bsBondsUp.set(h.index)),n=this.getBondStereochemistry(h,g[j]),k=h.getOtherAtomNode(g[j]),null!= k)for(l=0;2>l;l++)for(p=0;2>p;p++)if(q=b[l][p],!(null==q||q===h)){var r=q.index,v=q.getOtherAtomNode(g[l]);if(null!=v){var y=this.getBondStereochemistry(q,g[l]),u=JS.SmilesStereo.isDiaxial(g[j],g[l],k,v,this.vTemp,0);"\x00"==y||y!=n==u?("\\"==n&&u||"/"==n&&!u)==(q.getAtomIndex1()!=v.getIndex())?this.bsBondsUp.set(r):this.bsBondsDn.set(r):JU.Logger.error("BOND STEREOCHEMISTRY ERROR");JU.Logger.debugging&&JU.Logger.debug(this.getBondStereochemistry(h,g[0])+" "+k.getIndex()+" "+v.getIndex()+" "+this.getBondStereochemistry(q, g[l]))}}}}}});g(c$,"getSmilesAt",function(a,b,c,d,e){var f=b.getIndex();if(!this.bsToDo.get(f))return null;this.bsToDo.clear(f);var h=f==this.iHypervalent||this.explicitH,j=!this.bsSelected.get(f),m=null==this.prevAtom?-1:this.prevAtom.getIndex(),g=this.bsAromatic.get(f),k=null!=this.prevSp2Atoms,l=b.getElementNumber(),n=0,p=new JU.Lst,q=null,r=null,v=b.getEdges();null!=this.polySmilesCenter&&(d=!1,this.sortBonds(b,this.prevAtom,this.polySmilesCenter));var y=null,u=g?10:0;JU.Logger.debugging&&JU.Logger.debug(a.toString()); if(null!=v)for(var x=v.length;0<=--x;){var w=v[x];if(w.isCovalent()){var z=v[x].getOtherAtomNode(b),A=z.getIndex();if(A==m)r=v[x];else{var t=!h&&1==z.getElementNumber()&&0==z.getIsotopeNumber();if(!this.bsIncludingH.get(A))if(!t&&c&&this.bsSelected.get(f))this.bsToDo.set(A);else continue;t?(y=z,n++,1<n&&(u=10)):p.addLast(v[x])}}}z=this.prevSp2Atoms;v=null==z?1:2;null==z&&(z=Array(5));var B=null;null!=r&&(B=this.getBondOrder(r,f,m,g),k||(z[0]=this.prevAtom));var v=v+n,A=0,C=new JU.BS,E=p.size();if(d)for(x= 0;x<E;x++){var w=p.get(x),t=w.getOtherAtomNode(b),m=t.getCovalentBondCount()-(h?0:t.getCovalentHydrogenCount()),D=w.getCovalentOrder();if(1==m&&(null!=q||x<E-1))C.set(w.index);else if((1<D||m>A)&&!this.htRings.containsKey(JS.SmilesGenerator.getRingKey(t.getIndex(),f)))A=1<D?1E3+D:m,q=w}h=null==q?null:q.getOtherAtomNode(b);m=null==q?0:q.getCovalentOrder();if(g||2==m&&1<n||null!=h&&JS.SmilesSearch.isRingBond(this.ringSets,f,h.getIndex()))z=null;A=Array(7);7>u&&null!=r&&(k&&2==r.getCovalentOrder()&& 2==m&&null!=this.prevSp2Atoms[1]?(A[u++]=this.prevSp2Atoms[0],A[u++]=this.prevSp2Atoms[1]):A[u++]=this.prevAtom);7>u&&1==n&&(A[u++]=y);E=1==m&&null==this.prevSp2Atoms;w=this.getBondStereochemistry(r,this.prevAtom);if(null!=B||"\x00"!=w)"\x00"!=w&&(B=""+w),a.append(B);for(var D=u,G=v,y=new JU.SB,r=new JU.Lst,x=0;x<p.size();x++)w=p.get(x),C.get(w.index)&&(t=w.getOtherAtomNode(b),w=new JU.SB,this.prevAtom=b,this.prevSp2Atoms=null,this.getSmilesAt(w,t,c,d,e),w=w.toString(),p.removeItemAt(x--),null==q? r.addLast(w):y.append("(").append(w).append(")"),7>u&&(A[u++]=t),null!=z&&5>v&&(z[v++]=t));c=new JU.SB;var F=u,H=v,C=null;if(!d&&!this.noStereo&&null==this.polySmilesCenter&&(5==p.size()||6==p.size()))C=this.sortInorganic(b,p,this.vTemp);for(x=0;x<p.size();x++)w=p.get(x),w!==q&&(t=w.getOtherAtomNode(b),B=this.getBondOrder(w,f,t.getIndex(),g),E||(w=this.getBondStereochemistry(w,b),"\x00"!=w&&(B=""+w)),c.append(B),c.append(this.getRingCache(f,t.getIndex(),this.htRings)),7>u&&(A[u++]=t),null!=z&&5>v&& (z[v++]=t));D!=F&&F!=u&&this.swapArray(A,D,F,u);G!=H&&H!=v&&this.swapArray(z,G,H,v);if(k&&2==u&&2==m&&3==h.getCovalentBondCount()){v=h.getEdges();for(d=0;d<v.length;d++)v[d].isCovalent()&&h.getBondedAtomIndex(d)!=f&&(A[u++]=this.atoms[h.getBondedAtomIndex(d)]);v=0}else null!=h&&7>u&&(A[u++]=h);d=b.getFormalCharge();k=b.getIsotopeNumber();p=b.getValence();x=this.openSMILES?b.getFloatProperty("property_atomclass"):NaN;t=b.getAtomName();w=b.getBioStructureTypeName();this.addAtomComment&&a.append("\n//* "+ b.toString()+" *//\t");this.topologyOnly?a.append("*"):j&&0!=w.length&&0!=t.length?this.addBracketedBioName(a,b,"."+t,!1):a.append(JS.SmilesAtom.getAtomLabel(l,k,e?-1:p,d,x,n,g,null!=C?C:this.noStereo?null:this.checkStereoPairs(b,f,A,u)));a.appendSB(c);if(null!=q)a.appendSB(y);else{m=r.size()-1;if(0<=m){for(x=0;x<m;x++)a.append("(").append(r.get(x)).append(")");a.append(r.get(m))}return null}null!=z&&2==m&&(1==v||2==v)?(null==z[0]&&(z[0]=b),null==z[1]&&(z[1]=b)):z=null;this.prevSp2Atoms=z;this.prevAtom= b;return h},"JU.SB,JU.Node,~B,~B,~B");g(c$,"swapArray",function(a,b,c,d){b=c-b;if(null==this.atemp||this.atemp.length<b)this.atemp=Array(b);for(var e=b,f=c;0<e;)this.atemp[--e]=a[--f];for(f=c;f<d;f++)a[f-b]=a[f];e=b;for(f=d;0<e;)a[--f]=this.atemp[--e]},"~A,~N,~N,~N");g(c$,"getBondOrder",function(a,b,c,d){if(this.topologyOnly)return"";if(65537==(a.order&65537))return"^-";a=a.getCovalentOrder();return!d||!this.bsAromatic.get(c)?JS.SmilesBond.getBondOrderString(a):1==a&&!this.isSameAromaticRing(b,c)? "-":this.aromaticDouble&&(2==a||514==a)?"=":""},"JU.Edge,~N,~N,~B");g(c$,"isSameAromaticRing",function(a,b){for(var c,d=this.aromaticRings.size();0<=--d;)if((c=this.aromaticRings.get(d)).get(a)&&c.get(b))return!0;return!1},"~N,~N");g(c$,"sortBonds",function(a,b,c){if(null==this.smilesStereo)try{this.smilesStereo=JS.SmilesStereo.newStereo(null)}catch(d){if(!F(d,JS.InvalidSmilesException))throw d;}this.smilesStereo.sortBondsByStereo(a,b,c,a.getEdges(),this.vTemp.vA)},"JU.Node,JU.Node,JU.P3");g(c$,"sortInorganic", function(a,b,c){for(var d=a.getIndex(),e=b.size(),f=new JU.Lst,h=new JU.Lst,j,m,g=null,k=null,l,n,p=new JU.BS,q=null,r=Array(6),q=!0,v="",y=0,u=0;u<e;u++)if(l=b.get(u),r[0]=j=l.getOtherAtomNode(a),0==u?v=this.addStereoCheck(0,d,j,"",null):q&&null!=this.addStereoCheck(0,d,j,v,null)&&(q=!1),!p.get(u)){p.set(u);for(var x=!1,w=u+1;w<e;w++)if(!p.get(w)&&(n=b.get(w),m=n.getOtherAtomNode(a),JS.SmilesStereo.isDiaxial(a,a,j,m,c,-0.95))){switch(++y){case 1:g=j;break;case 2:k=j;break;case 3:2==JS.SmilesStereo.getHandedness(k, g,j,a,c)&&(j=l,l=n,n=j)}f.addLast(M(-1,[l,n]));x=!0;p.set(w);break}x||h.addLast(l)}d=f.size();if(q||6==e&&3!=d||5==e&&0==d)return"";q=f.get(0);l=q[0];r[0]=l.getOtherAtomNode(a);b.clear();b.addLast(l);1<d&&h.addLast(f.get(1)[0]);3==d&&h.addLast(f.get(2)[0]);1<d&&h.addLast(f.get(1)[1]);3==d&&h.addLast(f.get(2)[1]);for(u=0;u<h.size();u++)l=h.get(u),b.addLast(l),r[u+1]=l.getOtherAtomNode(a);b.addLast(q[1]);r[e-1]=q[1].getOtherAtomNode(a);return JS.SmilesStereo.getStereoFlag(a,r,e,c)},"JU.Node,JU.Lst,JS.VTemp"); g(c$,"checkStereoPairs",function(a,b,c,d){if(4>d)return"";if(4==d&&6==a.getElementNumber())for(var e="",f=0;4>f;f++)if(null==(e=this.addStereoCheck(0,b,c[f],e,JU.BSUtil.newAndSetBit(b)))){d=10;break}return 6<d?"":JS.SmilesStereo.getStereoFlag(a,c,d,this.vTemp)},"JU.Node,~N,~A,~N");g(c$,"addStereoCheck",function(a,b,c,d,e){null!=e&&e.set(b);var f=c.getAtomicAndIsotopeNumber(),h=c.getCovalentBondCount(),j=6==f&&!this.explicitH?c.getCovalentHydrogenCount():0;if(6==f?4!=h:1==f||1<h)return d;var m=";"+ a+"/"+f+"/"+j+"/"+h+(0==a?",":"_");if(6==f)switch(j){case 1:return d+m+ ++this.chainCheck;case 0:case 2:if(null==e)return d;for(var g=c.getEdges(),k="",l="",n=2==j?0:3,f=c.getBondCount();0<=--f;){var l=g[f].getOtherAtomNode(c),p=l.getIndex();!e.get(p)&&(g[f].isCovalent()&&1!=l.getElementNumber())&&(e.set(p),l=this.addStereoCheck(a+1,c.getIndex(),l,"",e),0<=k.indexOf(l)&&n--,k+=l)}if(3==n)return d+m+ ++this.chainCheck;m=(m+k).$replace(",","_");if(0<a)return d+m}if(0<=d.indexOf(m)){if(3==j){for(f=a= 0;f<h&&3>a;f++)e=c.getBondedAtomIndex(f),e!=b&&(a+=this.atoms[e].getAtomicAndIsotopeNumber());if(3<a)return d}return null}return d+m},"~N,~N,JU.Node,~S,JU.BS");g(c$,"getRingCache",function(a,b,c){var d=JS.SmilesGenerator.getRingKey(a,b),e=c.get(d),f=null==e?null:e[0];if(null==f)this.bsRingKeys.set(++this.nPairs),this.nPairsMax=Math.max(this.nPairs,this.nPairsMax),c.put(d,M(-1,[f=this.getRingPointer(this.nPairs),Integer.$valueOf(b),Integer.$valueOf(this.nPairs)])),JU.Logger.debugging&&JU.Logger.debug("adding for "+ a+" ring key "+this.nPairs+": "+d);else{c.remove(d);a=e[2].intValue();this.bsRingKeys.clear(a);if(0>this.bsRingKeys.nextSetBit(0)&&(2==this.nPairsMax||99==this.nPairsMax))this.nPairsMax=this.nPairs=99==this.nPairsMax?10:0;JU.Logger.debugging&&JU.Logger.debug("using ring key "+d)}return f},"~N,~N,java.util.Map");g(c$,"getRingPointer",function(a){return 10>a?""+a:100>a?"%"+a:"%("+a+")"},"~N");g(c$,"dumpRingKeys",function(a,b){JU.Logger.info(a.toString()+"\n\n");for(var c,d=b.keySet().iterator();d.hasNext()&& ((c=d.next())||1);)JU.Logger.info("unmatched connection: "+c)},"JU.SB,java.util.Map");c$.getRingKey=g(c$,"getRingKey",function(a,b){return Math.min(a,b)+"_"+Math.max(a,b)},"~N,~N")});B("JS");C(null,"JS.SmilesAromatic","java.util.Hashtable JU.BS $.Lst $.V3 JS.SmilesRing $.SmilesRingSet $.SmilesSearch JU.BSUtil $.Logger".split(" "),function(){c$=O(JS,"SmilesAromatic");c$.setAromatic=g(c$,"setAromatic",function(a,b,c,d,e,f,h,j,m,g,k,l,n,p){h=h||0<f;if(p)for(w=d.size();0<=--w;){if(t=d.get(w),p=JS.SmilesAromatic.isSp2Ring(a, b,c,t,j?3.4028235E38:0<f?0.1:0.01,m,0==f)){e.or(t);if(h){g=new JU.Lst;for(var q=t.nextSetBit(0);0<=q;q=t.nextSetBit(q+1))for(var r=b[q],v=r.getEdges(),y=r.getIndex(),u=v.length;0<=--u;){var x=v[u].getOtherAtomNode(r).getIndex();x>y&&t.get(x)&&g.addLast(v[u])}switch(JS.SmilesAromatic.checkHueckelAromatic(a,b,e,t,f,n)){case -1:continue;case 0:p=!1;case 1:if(null!=l&&l.addLast(new JS.SmilesRing(a,t,g,p)),!p)continue}}k.addLast(t)}}else for(var w=d.size();0<=--w;){var t=JU.BSUtil.copy(d.get(w));t.and(e); t.cardinality()==a&&k.addLast(t)}},"~N,~A,JU.BS,JU.Lst,JU.BS,~N,~B,~B,~B,JS.VTemp,JU.Lst,JU.Lst,~A,~B");c$.checkAromaticDefined=g(c$,"checkAromaticDefined",function(a,b,c){for(var d=b.nextSetBit(0);0<=d;d=b.nextSetBit(d+1))for(var e=a[d].getEdges(),f=0;f<e.length;f++)switch(e[f].order){case 515:case 514:case 513:c.set(e[f].getAtomIndex1()),c.set(e[f].getAtomIndex2())}},"~A,JU.BS,JU.BS");c$.isSp2Ring=g(c$,"isSp2Ring",function(a,b,c,d,e,f,h){if(f)for(var j=d.nextSetBit(0);0<=j;j=d.nextSetBit(j+1)){if(3< b[j].getCovalentBondCount())return!1}else for(j=d.nextSetBit(0);0<=j;j=d.nextSetBit(j+1))if(3<b[j].getCovalentBondCountPlusMissingH())return!1;if(3.4028235E38==e)return!0;0>=e&&(e=0.01);a=new JU.V3;f=new JU.V3;for(var m=new JU.V3,g=null,j=d.cardinality(),k=Array(2*j),l=0,n=1-5*e,j=d.nextSetBit(0);0<=j;j=d.nextSetBit(j+1)){for(var p=b[j],q=-1,r=-1,v=-1,t=p.getEdges().length;0<=--t;){var u=p.getBondedAtomIndex(t);if(c.get(u))if(d.get(u))0>r?r=u:v=u;else{if(16==p.getElementNumber()){if(!h)return!1;u= -1}q=u}}null==g&&(g=new JU.V3);t=0;for(p=j;2>t;t++){JS.SmilesSearch.getNormalThroughPoints(b[r],b[p],b[v],a,f,m);if(!JS.SmilesAromatic.addNormal(a,g,n))return!1;k[l++]=JU.V3.newV(a);if(0>(p=q))break}}return JS.SmilesAromatic.checkStandardDeviation(k,g,l,e)},"~N,~A,JU.BS,JU.BS,~N,~B,~B");c$.addNormal=g(c$,"addNormal",function(a,b,c){var d=b.dot(a);if(0!=d&&Math.abs(d)<c)return!1;0>d&&a.scale(-1);b.add(a);b.normalize();return!0},"JU.V3,JU.V3,~N");c$.checkStandardDeviation=g(c$,"checkStandardDeviation", function(a,b,c,d){for(var e=0,f=0,h=0;h<c;h++)var j=a[h].dot(b),e=e+j,f=f+j*j;e=Math.sqrt((f-e*e/c)/(c-1));return e<d},"~A,JU.V3,~N,~N");c$.checkHueckelAromatic=g(c$,"checkHueckelAromatic",function(a,b,c,d,e,f){for(var h=0,j=0,m=d.nextSetBit(0);0<=m&&0<=h;m=d.nextSetBit(m+1)){var g=b[m],k=g.getElementNumber(),l=g.getCovalentBondCountPlusMissingH(),l=l+g.getValence(),l=l-4;if(6==k){var n=g.getFormalCharge();-2147483648!=n&&(l+=n)}k=5<=k&&8>=k?k-5:15==k?2:34==k?3:33==k?4:16==k?5:-1;if(0<=k){k=JS.SmilesAromatic.OS_PI_COUNTS[k]; if(0>l||l>=k.length)return-1;switch(l=k[l]){case -2:return-1;case -1:k=g.getEdges();l=0;for(n=k.length;0<=--n;){var p=k[n];if(2==p.getCovalentOrder()){l=p.getOtherAtomNode(g);l=6==l.getElementNumber()||c.get(l.getIndex())?1:0<e?-100:0;break}}default:if(0>l)return-1;null!=f&&(f[m]=l);h+=l;1==l&&j++;JU.Logger.debugging&&JU.Logger.info("atom "+g+" pi="+l+" npi="+h)}}}return 0==(h-2)%4&&(2>e||5==a||6==j)?1:0},"~N,~A,JU.BS,JU.BS,~N,~A");c$.finalizeAromatic=g(c$,"finalizeAromatic",function(a,b,c,d,e,f, h){h&&JS.SmilesAromatic.removeBridgingRings(c,d);JS.SmilesAromatic.checkFusedRings(d,e,c);b.clearAll();for(e=c.size();0<=--e;)b.or(c.get(e));if(h||f)for(e=b.nextSetBit(0);0<=e;e=b.nextSetBit(e+1)){c=a[e].getEdges();f=0;for(var j=c.length;0<=--j;){var m=c[j].getOtherAtomNode(a[e]),g=c[j].getCovalentOrder(),k=m.getIndex();if(b.get(k)){if(2==g){m=!1;for(g=d.size();0<=--g;){var l=d.get(g);if(l.get(e)&&l.get(k)){m=!0;break}}if(!m){f=-1;break}}f++}else if(h&&6==m.getElementNumber()&&2==g){f=-1;break}}2> f&&(b.clear(e),e=-1)}},"~A,JU.BS,JU.Lst,JU.Lst,~A,~B,~B");c$.removeBridgingRings=g(c$,"removeBridgingRings",function(a,b){var c=new JU.BS,d=new JU.BS,e=new JU.BS;JS.SmilesAromatic.checkBridges(a,d,a,d,c);JS.SmilesAromatic.checkBridges(b,e,b,e,c);JS.SmilesAromatic.checkBridges(a,d,b,e,c);for(c=a.size();0<=--c;)d.get(c)&&a.removeItemAt(c);for(c=b.size();0<=--c;)e.get(c)&&b.removeItemAt(c)},"JU.Lst,JU.Lst");c$.checkBridges=g(c$,"checkBridges",function(a,b,c,d,e){for(var f=a===c,h=a.size();0<=--h;)for(var j= a.get(h),m=f?h+1:0,g=c.size();--g>=m;){var k=c.get(g);k.equals(j)||(e.clearAll(),e.or(j),e.and(k),2<e.cardinality()&&(b.set(h),d.set(g)))}},"JU.Lst,JU.BS,JU.Lst,JU.BS,JU.BS");c$.checkFusedRings=g(c$,"checkFusedRings",function(a,b,c){for(var d=new java.util.Hashtable,e=a.size();0<=--e;){for(var f=a.get(e),h=f.edges,j=h.size();0<=--j;){var m=JS.SmilesRing.getSetByEdge(h.get(j),d);null==m||m===f.$set||(null!=f.$set?m.addSet(f.$set,d):m.addRing(f))}(null==f.$set?f.$set=new JS.SmilesRingSet:f.$set).addRing(f); f.addEdges(d)}for(e=a.size();0<=--e;)if(!(f=a.get(e)).isOK&&!(null==(m=f.$set)||m.isEmpty())){if(2==m.getElectronCount(b)%4)for(j=m.size();0<=--j;)(f=m.get(j)).isOK||c.addLast(f);m.clear()}},"JU.Lst,~A,JU.Lst");H(c$,"OS_PI_COUNTS",M(-1,[t(-1,[-2,1,0]),t(-1,[1,2,1,-1]),t(-1,[2,1,2,1,1]),t(-1,[2,1]),t(-1,[-2,1,2,1,-2]),t(-1,[2,1,2,2])]))});B("JS");C(["JU.BS"],"JS.SmilesRing",null,function(){c$=D(function(){this.bsEdgesToCheck=this.edges=this.$set=null;this.isOK=!1;this.n=0;E(this,arguments)},JS,"SmilesRing", JU.BS);G(c$,function(a,b,c,d){L(this,JS.SmilesRing,[]);this.or(b);this.edges=c;this.isOK=d;this.n=a},"~N,JU.BS,JU.Lst,~B");g(c$,"addEdges",function(a){for(var b=this.edges.size();0<=--b;)a.put(JS.SmilesRing.getKey(this.edges.get(b)),this.$set)},"java.util.Hashtable");c$.getSetByEdge=g(c$,"getSetByEdge",function(a,b){return b.get(JS.SmilesRing.getKey(a))},"JU.Edge,java.util.Hashtable");c$.getKey=g(c$,"getKey",function(a){var b=a.getAtomIndex1();a=a.getAtomIndex2();return b<a?b+"_"+a:a+"_"+b},"JU.Edge")}); B("JS");C(["JU.Lst","$.BS"],"JS.SmilesRingSet",null,function(){c$=D(function(){this.bs=null;E(this,arguments)},JS,"SmilesRingSet",JU.Lst);I(c$,function(){this.bs=new JU.BS});G(c$,function(){L(this,JS.SmilesRingSet,[])});g(c$,"addSet",function(a,b){for(var c=a.size();0<=--c;){var d=a.get(c);this.addRing(d);d.addEdges(b)}},"JS.SmilesRingSet,java.util.Hashtable");g(c$,"addRing",function(a){this.addLast(a);a.$set=this;this.bs.or(a)},"JS.SmilesRing");g(c$,"getElectronCount",function(a){for(var b=0,c=this.bs.nextSetBit(0);0<= c;c=this.bs.nextSetBit(c+1))b+=a[c];return b},"~A")});B("JS");C(["JU.P3","JU.Node"],"JS.SmilesAtom",["java.lang.Float","JU.AU","JU.Elements","$.Logger"],function(){c$=D(function(){this.pattern=null;this.primitiveType=0;this.isAND=!1;this.subAtoms=null;this.index=this.nSubAtoms=0;this.residueChar=this.residueName=this.referance=null;this.insCode="\x00";this.isBioAtomWild=this.isBioResidue=this.isBioAtom=!1;this.bioType="\x00";this.$isLeadAtom=!1;this.notBondedIndex=-1;this.notCrossLinked=!1;this.aromaticAmbiguous= !0;this.covalentHydrogenCount=-1;this.elementDefined=this.hasSymbol=this.selected=this.not=!1;this.bioAtomName=this.atomType=null;this.isFirst=!0;this.jmolIndex=-1;this.elementNumber=-2;this.implicitHydrogenCount=this.explicitHydrogenCount=this.residueNumber=this.atomNumber=-2147483648;this.bonds=this.parent=null;this.iNested=this.bondCount=0;this.isAromatic=!1;this.charge=this.atomicMass=-2147483648;this.matchingIndex=-1;this.stereo=null;this.component=-2147483648;this.atomSite=this.matchingComponent= 0;this.nonhydrogenDegree=this.degree=-1;this.valence=0;this.connectivity=-1;this.ringSize=this.ringMembership=-2147483648;this.ringConnectivity=-1;this.matchingNode=null;this.hasSubpattern=!1;this.mapIndex=-1;this.atomClass=NaN;this.symbol=null;this.isTopoAtom=!1;this.missingHydrogenCount=0;E(this,arguments)},JS,"SmilesAtom",JU.P3,JU.Node);I(c$,function(){this.bonds=Array(4)});c$.allowSmilesUnbracketed=g(c$,"allowSmilesUnbracketed",function(a){return 0<="B, C, N, O, P, S, F, Cl, Br, I, *,".indexOf(a+ ",")},"~S");G(c$,function(){L(this,JS.SmilesAtom,[])});n(c$,"getAtomType",function(){return null==this.atomType?this.bioAtomName:this.atomType});g(c$,"getChiralClass",function(){return null==this.stereo?-2147483648:this.stereo.getChiralClass(this)});g(c$,"isDefined",function(){return this.hasSubpattern||0!=this.iNested||this.isBioAtom||-2147483648!=this.component||-2!=this.elementNumber||0<this.nSubAtoms});g(c$,"setBioAtom",function(a){this.isBioAtom="\x00"!=a;this.bioType=a;null!=this.parent&&(this.parent.bioType= a,this.parent.isBioAtom=this.isBioAtom,this.parent.isBioAtomWild=this.isBioAtomWild)},"~S");g(c$,"setAtomName",function(a){null!=a&&(0<a.length&&(this.bioAtomName=a),a.equals("\x00")&&(this.$isLeadAtom=!0),null!=this.parent&&(this.parent.bioAtomName=a))},"~S");g(c$,"setBonds",function(a){this.bonds=a},"~A");g(c$,"addSubAtom",function(a,b){this.isAND=b;null==this.subAtoms&&(this.subAtoms=Array(2));this.nSubAtoms>=this.subAtoms.length&&(this.subAtoms=JU.AU.doubleLength(this.subAtoms));a.setIndex(this.index); a.parent=this;this.subAtoms[this.nSubAtoms++]=a;this.setSymbol("*");this.hasSymbol=!1;return a},"JS.SmilesAtom,~B");g(c$,"setIndex",function(a){this.index=a;return this},"~N");g(c$,"setTopoAtom",function(a,b,c,d){this.component=a;this.index=b;this.setSymbol(c);this.charge=d;this.isTopoAtom=!0;return this},"~N,~N,~S,~N");g(c$,"setHydrogenCount",function(){this.missingHydrogenCount=this.explicitHydrogenCount;if(-2147483648!=this.explicitHydrogenCount)return!0;var a=JS.SmilesAtom.getDefaultCount(this.elementNumber, this.isAromatic);if(0>a)return this.missingHydrogenCount=0,-1==a;7==this.elementNumber&&this.isAromatic&&2==this.bondCount&&1==this.bonds[0].order&&1==this.bonds[1].order&&a++;for(var b=0;b<this.bondCount;b++){var c=this.bonds[b];switch(c.order){case 81:7==this.elementNumber&&JU.Logger.info("Ambiguous bonding to aromatic N found -- MF may be in error");a-=1;break;case 1025:case 1041:case 65537:case 65538:a-=1;break;case 2:a-=this.isAromatic&&6==this.elementNumber?1:2;break;case 1:case 3:case 4:a-= c.order}}0<=a&&(this.missingHydrogenCount=this.explicitHydrogenCount=a);return!0});c$.getDefaultCount=g(c$,"getDefaultCount",function(a,b){switch(a){case 0:case -1:case -2:return-1;case 6:return b?3:4;case 8:case 16:return 2;case 7:return b?2:3;case 5:case 15:return 3;case 9:case 17:case 35:case 53:return 1}return-2},"~N,~B");n(c$,"getIndex",function(){return this.index});g(c$,"setSymbol",function(a){this.symbol=a;this.isAromatic=a.equals(a.toLowerCase());this.elementDefined=this.hasSymbol=!0;if(a.equals("*"))return this.isAromatic= !1,this.elementNumber=-2,!0;if(a.equals("Xx"))return this.elementNumber=0,!0;this.aromaticAmbiguous=!1;if(a.equals("a")||a.equals("A"))return 0>this.elementNumber&&(this.elementNumber=-1),!0;this.isAromatic&&(a=a.substring(0,1).toUpperCase()+(1==a.length?"":a.substring(1)));this.elementNumber=JU.Elements.elementNumberFromSymbol(a,!0);return 0!=this.elementNumber},"~S");n(c$,"getElementNumber",function(){return this.elementNumber});g(c$,"getAtomicMass",function(){return this.atomicMass});n(c$,"getAtomNumber", function(){return this.atomNumber});g(c$,"setAtomicMass",function(a){this.atomicMass=a},"~N");g(c$,"getCharge",function(){return this.charge});g(c$,"setCharge",function(a){this.charge=a},"~N");g(c$,"getMatchingAtomIndex",function(){return this.matchingIndex});g(c$,"getMatchingAtom",function(){return this.matchingNode});g(c$,"setMatchingAtom",function(a,b){this.matchingNode=a;this.matchingIndex=b},"JU.Node,~N");g(c$,"setExplicitHydrogenCount",function(a){this.explicitHydrogenCount=a},"~N");g(c$,"setImplicitHydrogenCount", function(a){this.implicitHydrogenCount=a},"~N");g(c$,"setDegree",function(a){this.degree=a},"~N");g(c$,"setNonhydrogenDegree",function(a){this.nonhydrogenDegree=a},"~N");g(c$,"setValence",function(a){this.valence=a},"~N");g(c$,"setConnectivity",function(a){this.connectivity=a},"~N");g(c$,"setRingMembership",function(a){this.ringMembership=a},"~N");g(c$,"setRingSize",function(a){this.ringSize=a;if(500==this.ringSize||600==this.ringSize)this.isAromatic=!0},"~N");g(c$,"setRingConnectivity",function(a){this.ringConnectivity= a},"~N");n(c$,"getModelIndex",function(){return this.component});n(c$,"getMoleculeNumber",function(){return this.component},"~B");n(c$,"getAtomSite",function(){return this.atomSite});n(c$,"getFormalCharge",function(){return this.charge});n(c$,"getIsotopeNumber",function(){return this.atomicMass});n(c$,"getAtomicAndIsotopeNumber",function(){return JU.Elements.getAtomicAndIsotopeNumber(this.elementNumber,this.atomicMass)});n(c$,"getAtomName",function(){return null==this.bioAtomName?"":this.bioAtomName}); n(c$,"getGroup3",function(){return null==this.residueName?"":this.residueName},"~B");n(c$,"getGroup1",function(){return null==this.residueChar?"":this.residueChar},"~S");g(c$,"addBond",function(a){this.bondCount>=this.bonds.length&&(this.bonds=JU.AU.doubleLength(this.bonds));this.bonds[this.bondCount]=a;this.bondCount++},"JS.SmilesBond");g(c$,"setBondArray",function(){this.bonds.length>this.bondCount&&(this.bonds=JU.AU.arrayCopyObject(this.bonds,this.bondCount));null!=this.subAtoms&&this.subAtoms.length> this.nSubAtoms&&(this.subAtoms=JU.AU.arrayCopyObject(this.subAtoms,this.subAtoms.length));for(var a=0;a<this.bonds.length;a++){var b=this.bonds[a];this.isBioAtom&&17==b.order&&(b.order=112);b.atom1.index>b.atom2.index&&b.switchAtoms()}});n(c$,"getEdges",function(){return null!=this.parent?this.parent.getEdges():this.bonds});g(c$,"getBond",function(a){return null!=this.parent?this.parent.getBond(a):0<=a&&a<this.bondCount?this.bonds[a]:null},"~N");n(c$,"getCovalentBondCount",function(){return this.getBondCount()}); n(c$,"getBondCount",function(){return null!=this.parent?this.parent.getBondCount():this.bondCount});n(c$,"getCovalentBondCountPlusMissingH",function(){return this.getBondCount()+(this.isTopoAtom?0:this.missingHydrogenCount)});n(c$,"getTotalHydrogenCount",function(){return this.getCovalentHydrogenCount()+(this.isTopoAtom?0:this.missingHydrogenCount)});n(c$,"getImplicitHydrogenCount",function(){return this.implicitHydrogenCount});g(c$,"getExplicitHydrogenCount",function(){return this.explicitHydrogenCount}); g(c$,"getMatchingBondedAtom",function(a){if(null!=this.parent)return this.parent.getMatchingBondedAtom(a);if(a>=this.bondCount)return-1;a=this.bonds[a];return(a.atom1===this?a.atom2:a.atom1).matchingIndex},"~N");n(c$,"getBondedAtomIndex",function(a){return null!=this.parent?this.parent.getBondedAtomIndex(a):this.bonds[a].getOtherAtom(this).index},"~N");n(c$,"getCovalentHydrogenCount",function(){if(0<=this.covalentHydrogenCount)return this.covalentHydrogenCount;if(null!=this.parent)return this.covalentHydrogenCount= this.parent.getCovalentHydrogenCount();for(var a=this.covalentHydrogenCount=0;a<this.bonds.length;a++)1==this.bonds[a].getOtherAtom(this).elementNumber&&this.covalentHydrogenCount++;return this.covalentHydrogenCount});n(c$,"getValence",function(){if(null!=this.parent)return this.parent.getValence();var a=this.valence;if(0>=a&&null!=this.bonds)for(var b=this.bonds.length;0<=--b;)a+=this.bonds[b].getValence();return this.valence=a});n(c$,"getTotalValence",function(){return this.getValence()+(this.isTopoAtom? 0:this.missingHydrogenCount)});g(c$,"getBondTo",function(a){if(null!=this.parent)return this.parent.getBondTo(a);for(var b,c=0;c<this.bonds.length;c++)if(null!=(b=this.bonds[c]))if(null==a?b.atom2===this:b.getOtherAtom(this)===a)return b;return null},"JS.SmilesAtom");g(c$,"getBondNotTo",function(a,b){for(var c,d=0;d<this.bonds.length;d++)if(null!=(c=this.bonds[d])){var e=c.getOtherAtom(this);if(a!==e&&(b||1!=e.elementNumber))return c}return null},"JS.SmilesAtom,~B");n(c$,"isLeadAtom",function(){return this.$isLeadAtom}); n(c$,"getOffsetResidueAtom",function(a,b){if(this.isBioAtom){if(0==b)return this.index;for(var c=0;c<this.bonds.length;c++)if(this.bonds[c].getAtomIndex1()==this.index&&96==this.bonds[c].order)return this.bonds[c].getOtherAtom(this).index}return-1},"~S,~N");n(c$,"getGroupBits",function(a){a.set(this.index)},"JU.BS");n(c$,"isCrossLinked",function(a){return this.getBondTo(a).isHydrogen()},"JU.Node");n(c$,"getCrossLinkVector",function(a){for(var b=!1,c=0;c<this.bonds.length;c++)if(112==this.bonds[c].order){if(null== a)return!0;a.addLast(Integer.$valueOf(this.index));a.addLast(Integer.$valueOf(this.bonds[c].getOtherAtom(this).index));a.addLast(Integer.$valueOf(this.bonds[c].getOtherAtom(this).index));b=!0}return b},"JU.Lst,~B,~B");n(c$,"getBioStructureTypeName",function(){return null});n(c$,"getInsertionCode",function(){return this.insCode});n(c$,"getResno",function(){return this.residueNumber});n(c$,"getChainID",function(){return 0});n(c$,"getChainIDStr",function(){return""});c$.getAtomLabel=g(c$,"getAtomLabel", function(a,b,c,d,e,f,h,j){var m=JU.Elements.elementSymbolFromNumber(a);h&&(m=m.toLowerCase(),6!=a&&(c=2147483647));return(2147483647==c||0!=b||0!=d||!Float.isNaN(e)||null!=j&&0<j.length?-1:JS.SmilesAtom.getDefaultCount(a,!1))==c?m:"["+(0>=b?"":""+b)+m+(null==j?"":j)+(1<f?"H"+f:1==f?"H":"")+(0>d&&-2147483648!=d?""+d:0<d?"+"+d:"")+(Float.isNaN(e)?"":":"+Q(e))+"]"},"~N,~N,~N,~N,~N,~N,~B,~S");n(c$,"getBioSmilesType",function(){return this.bioType});g(c$,"isNucleic",function(){return"n"==this.bioType|| "r"==this.bioType||"d"==this.bioType});n(c$,"isPurine",function(){return null!=this.residueChar&&this.isNucleic()&&0<="AG".indexOf(this.residueChar)});n(c$,"isPyrimidine",function(){return null!=this.residueChar&&this.isNucleic()&&0<="CTUI".indexOf(this.residueChar)});n(c$,"isDeleted",function(){return!1});n(c$,"findAtomsLike",function(){return null},"~S");n(c$,"toString",function(){var a=null!=this.residueChar||null!=this.residueName?(null==this.residueChar?this.residueName:this.residueChar)+"."+ this.bioAtomName:null!=this.bioAtomName&&-2147483648!=this.atomNumber?null:-1==this.elementNumber?"A":-2==this.elementNumber?"*":JU.Elements.elementSymbolFromNumber(this.elementNumber);if(null==a)return this.bioAtomName+" #"+this.atomNumber;this.isAromatic&&(a=a.toLowerCase());for(var b="",c=0;c<this.bondCount;c++)b+=this.bonds[c].getOtherAtom(this).index+", ";return"["+a+"."+this.index+(0<=this.matchingIndex?"("+this.matchingNode+")":"")+"]"+b+"("+this.x+","+this.y+","+this.z+")"});n(c$,"getFloatProperty", function(a){return"property_atomclass"===a?this.atomClass:NaN},"~S");H(c$,"UNBRACKETED_SET","B, C, N, O, P, S, F, Cl, Br, I, *,")});B("JS");C(["JU.Edge"],"JS.SmilesBond",["JS.InvalidSmilesException"],function(){c$=D(function(){this.atom2=this.atom1=null;this.isNot=!1;this.primitives=this.matchingBond=null;this.nPrimitives=0;this.bondsOr=null;this.nBondsOr=0;this.isConnection=!1;this.atropType=null;this.isChain=!1;E(this,arguments)},JS,"SmilesBond",JU.Edge);c$.getBondOrderString=g(c$,"getBondOrderString", function(a){switch(a){case 2:return"=";case 3:return"#";case 4:return"$";default:return""}},"~N");c$.getBondTypeFromCode=g(c$,"getBondTypeFromCode",function(a){switch(a){case ".":return 0;case "-":return 1;case "=":return 2;case "#":return 3;case "$":return 4;case ":":return 17;case "/":return 1025;case "\\":return 1041;case "^":return 65537;case "`":return 65538;case "@":return 65;case "~":return 81;case "+":return 96}return-1},"~S");g(c$,"set",function(a){this.order=a.order;this.isNot=a.isNot;this.primitives= a.primitives;this.nPrimitives=a.nPrimitives;this.bondsOr=a.bondsOr;this.nBondsOr=a.nBondsOr},"JS.SmilesBond");g(c$,"setAtropType",function(a){this.atropType=t(-1,[P(a/10)-1,a%10-1])},"~N");g(c$,"setPrimitive",function(a){a=this.primitives[a];this.order=a.order;this.isNot=a.isNot;this.atropType=a.atropType;return a},"~N");g(c$,"addBondOr",function(){null==this.bondsOr&&(this.bondsOr=Array(2));if(this.nBondsOr>=this.bondsOr.length){var a=Array(2*this.bondsOr.length);System.arraycopy(this.bondsOr,0, a,0,this.bondsOr.length);this.bondsOr=a}a=new JS.SmilesBond(null,null,-1,!1);this.bondsOr[this.nBondsOr]=a;this.nBondsOr++;return a});g(c$,"addPrimitive",function(){null==this.primitives&&(this.primitives=Array(2));if(this.nPrimitives>=this.primitives.length){var a=Array(2*this.primitives.length);System.arraycopy(this.primitives,0,a,0,this.primitives.length);this.primitives=a}a=new JS.SmilesBond(null,null,-1,!1);this.primitives[this.nPrimitives]=a;this.nPrimitives++;return a});n(c$,"toString",function(){return this.atom1+ " -"+(this.isNot?"!":"")+this.order+"- "+this.atom2});G(c$,function(a,b,c,d){L(this,JS.SmilesBond,[]);this.set2(c,d);this.set2a(a,b)},"JS.SmilesAtom,JS.SmilesAtom,~N,~B");g(c$,"set2",function(a,b){this.order=a;this.isNot=b},"~N,~B");g(c$,"set2a",function(a,b){null!=a&&(this.atom1=a,a.addBond(this));null!=b&&(this.atom2=b,b.isBioAtomWild&&this.atom1.isBioAtomWild&&(this.order=96),b.isFirst=!1,b.addBond(this))},"JS.SmilesAtom,JS.SmilesAtom");g(c$,"setAtom2",function(a){this.atom2=a;null!=this.atom2&& (a.addBond(this),this.isConnection=!0)},"JS.SmilesAtom,JS.SmilesSearch");g(c$,"isFromPreviousTo",function(a){return!this.isConnection&&this.atom2===a},"JS.SmilesAtom");c$.isBondType=g(c$,"isBondType",function(a,b,c){if(">"==a)return 1;if(0>"-=#$:/\\.~^`+!,&;@".indexOf(a))return 0;if(!b&&0>"-=#$:/\\.~^`".indexOf(a))throw new JS.InvalidSmilesException("SMARTS bond type "+a+" not allowed in SMILES");switch(a){case "~":return c?0:1;case "^":case "`":return-1;default:return 1}},"~S,~B,~B");g(c$,"getBondType", function(){return this.order});g(c$,"getValence",function(){return this.order&7});g(c$,"getOtherAtom",function(a){return this.atom1===a?this.atom2:this.atom1},"JS.SmilesAtom");n(c$,"getAtomIndex1",function(){return this.atom1.index});n(c$,"getAtomIndex2",function(){return this.atom2.index});n(c$,"getCovalentOrder",function(){return this.order});n(c$,"getOtherAtomNode",function(a){return a===this.atom1?this.atom2:a===this.atom2?this.atom1:null},"JU.Node");n(c$,"isCovalent",function(){return 112!=this.order}); n(c$,"isHydrogen",function(){return 112==this.order});g(c$,"switchAtoms",function(){var a=this.atom1;this.atom1=this.atom2;this.atom2=a;switch(this.order){case 65537:this.order=65538;break;case 65538:this.order=65537;break;case 1025:this.order=1041;break;case 1041:this.order=1025}});H(c$,"TYPE_UNKNOWN",-1,"TYPE_NONE",0,"TYPE_AROMATIC",17,"TYPE_RING",65,"TYPE_ANY",81,"TYPE_BIO_SEQUENCE",96,"TYPE_BIO_CROSSLINK",112,"ALL_BONDS","-=#$:/\\.~^`+!,&;@","SMILES_BONDS","-=#$:/\\.~^`")});B("JS");C(null,"JS.SmilesMeasure", ["JU.PT"],function(){c$=D(function(){this.search=null;this.index=this.type=this.nPoints=0;this.isNot=!1;this.points=this.minmax=this.indices=null;E(this,arguments)},JS,"SmilesMeasure");I(c$,function(){this.indices=t(4,0);this.points=Array(4)});G(c$,function(a,b,c,d,e){this.search=a;this.type=Math.min(4,Math.max(c,2));this.index=b;this.isNot=d;this.minmax=e;for(a=e.length-2;0<=a;a-=2)e[a]>e[a+1]&&(b=e[a+1],e[a+1]=e[a],e[a]=b)},"JS.SmilesSearch,~N,~N,~B,~A");g(c$,"addPoint",function(a){if(this.nPoints== this.type)return!1;if(0==this.nPoints)for(var b=1;b<this.type;b++)this.indices[b]=a+b;this.indices[this.nPoints++]=a;return!0},"~N");g(c$,"check",function(){for(var a=0;a<this.type;a++){var b=this.search.patternAtoms[this.indices[a]].getMatchingAtomIndex();this.points[a]=this.search.targetAtoms[b]}b=0;switch(this.type){case 2:b=this.points[0].distance(this.points[1]);break;case 3:this.search.v.vA.sub2(this.points[0],this.points[1]);this.search.v.vB.sub2(this.points[2],this.points[1]);b=this.search.v.vA.angle(this.search.v.vB)/ 0.017453292;break;case 4:b=JS.SmilesMeasure.setTorsionData(this.points[0],this.points[1],this.points[2],this.points[3],this.search.v,!0)}for(a=this.minmax.length-2;0<=a;a-=2)if(b>=this.minmax[a]&&b<=this.minmax[a+1])return!this.isNot;return this.isNot});c$.setTorsionData=g(c$,"setTorsionData",function(a,b,c,d,e,f){e.vTemp1.sub2(a,b);e.vTemp2.sub2(d,c);if(!f)return 0;e.vNorm2.sub2(b,c);e.vNorm2.normalize();e.vTemp1.cross(e.vTemp1,e.vNorm2);e.vTemp1.normalize();e.vTemp2.cross(e.vTemp2,e.vNorm2);e.vTemp2.normalize(); e.vNorm3.cross(e.vTemp1,e.vTemp2);return e.vTemp1.angle(e.vTemp2)/0.017453292*(0>e.vNorm2.dot(e.vNorm3)?1:-1)},"JU.T3,JU.T3,JU.T3,JU.T3,JS.VTemp,~B");n(c$,"toString",function(){for(var a="(."+"__dat".charAt(this.type)+this.index+":"+JU.PT.toJSON(null,this.minmax)+") for",b=0;b<this.type;b++)a+=" "+(b>=this.nPoints?"?":""+this.indices[b]);return a});H(c$,"TYPES","__dat","radiansPerDegree",0.017453292519943295)});B("JS");C(["java.util.Hashtable"],"JS.SmilesParser","java.lang.Character $.Float JU.Lst $.PT $.SB JS.InvalidSmilesException $.SmilesAtom $.SmilesBond $.SmilesMeasure $.SmilesSearch $.SmilesStereo JU.Elements $.Logger".split(" "), function(){c$=D(function(){this.htMeasures=this.connections=null;this.flags=0;this.isBioSequence=this.isSmarts=!1;this.bioType="\x00";this.componentParenCount=this.componentCount=this.branchLevel=this.braceCount=0;this.ignoreStereochemistry=!1;this.bondDirectionPaired=!0;this.isTarget=!1;E(this,arguments)},JS,"SmilesParser");I(c$,function(){this.connections=new java.util.Hashtable;this.htMeasures=new java.util.Hashtable});c$.newSearch=g(c$,"newSearch",function(a,b,c){return(new JS.SmilesParser(b, c)).parse(a)},"~S,~B,~B");G(c$,function(a,b){this.isSmarts=a;this.isTarget=b},"~B,~B");g(c$,"parse",function(a){if(null==a)throw new JS.InvalidSmilesException("expression must not be null");var b=new JS.SmilesSearch;0<=a.indexOf("$(select")&&(a=this.parseNested(b,a,"select"));var c=t(1,0);a=JS.SmilesParser.extractFlags(a,c);this.flags=c[0];this.ignoreStereochemistry=32==(this.flags&32);b.setFlags(this.flags);0<=a.indexOf("$")&&(a=this.parseVariables(a));this.isSmarts&&0<=a.indexOf("[$")&&(a=this.parseVariableLength(a)); if(0>a.indexOf("||"))return this.getSubsearch(b,a,this.flags);a=JU.PT.split(a,"||");c="";b.subSearches=Array(a.length);for(var d=0;d<a.length;d++){var e="|"+a[d]+"|";0>c.indexOf(e)&&(b.subSearches[d]=this.getSubsearch(b,a[d],this.flags),c+=e)}return b},"~S");g(c$,"parseVariableLength",function(a){for(var b=new JU.SB,c=a.length-1,d=0,e=!1,f=0;f<c;f++)switch(a.charAt(f)){case "(":d++;break;case ")":d--;break;case "|":0<d&&(e=!0,"|"==a.charAt(f+1)&&(a=a.substring(0,f)+a.substring(f+1),c--))}if(0<=a.indexOf("||")){c= JU.PT.split(a,"||");for(f=0;f<c.length;f++)b.append("||").append(this.parseVariableLength(c[f]))}else{c=-1;d=t(1,0);for(f=null;0<=(c=a.indexOf("[$",c+1));){var h=c,j=-2147483648,m=-2147483648,c=JS.SmilesParser.getDigits(a,c+2,d),j=d[0];-2147483648!=j&&"-"==JS.SmilesParser.getChar(a,c)&&(c=JS.SmilesParser.getDigits(a,c+1,d),m=d[0]);if("("==JS.SmilesParser.getChar(a,c)&&(f=JS.SmilesParser.getSubPattern(a,h,"["),f.endsWith(")"))){var g=h+f.length+2,k=JS.SmilesParser.getSubPattern(a,c,"("),l=c;JS.SmilesParser.getSubPattern(a, c,"[");c+=1+k.length;if(0<=k.indexOf(":")&&0>k.indexOf("|")){for(var n=0,p=k.length,q=-1,f=0;f<p;f++)switch(k.charAt(f)){case "[":case "(":n++;break;case ")":case "]":n--;break;case ".":0<=q&&0==n&&(p=f);break;case ":":0>q&&0==n&&(q=f)}0<q&&(k=k.substring(0,q)+"("+k.substring(q,p)+")"+k.substring(p))}if(-2147483648==j){if(f=k.indexOf("|"),0<=f)return this.parseVariableLength(a.substring(0,h)+"[$1"+a.substring(l,l+f+1)+")]"+a.substring(g)+"||"+a.substring(0,h)+"[$1("+a.substring(l+f+2)+a.substring(g))}else{-2147483648== m&&(m=j);0<=k.indexOf("|")&&(k="[$("+k+")]");for(f=j;f<=m;f++){j=new JU.SB;j.append("||").append(a.substring(0,h));for(l=0;l<f;l++)j.append(k);j.append(a.substring(g));b.appendSB(j)}}}}}return e?this.parseVariableLength(b.substring(2)):2>b.length()?a:b.substring(2)},"~S");g(c$,"getSubsearch",function(a,b,c){this.htMeasures=new java.util.Hashtable;var d=new JS.SmilesSearch;d.setTop(a);d.isSmarts=this.isSmarts;d.pattern=b;d.setFlags(c);0<=b.indexOf("$(")&&(b=this.parseNested(d,b,""));this.parseSmiles(d, b,null,!1);if(0!=this.braceCount)throw new JS.InvalidSmilesException("unmatched '{'");if(!this.connections.isEmpty())throw new JS.InvalidSmilesException("Open connection");d.set();if(this.isSmarts)for(a=d.ac;0<=--a;)this.checkNested(d,d.patternAtoms[a],c);else this.isBioSequence||(d.elementCounts[1]=d.getMissingHydrogenCount());!this.ignoreStereochemistry&&!this.isTarget&&this.fixChirality(d);return d},"JS.SmilesSearch,~S,~N");g(c$,"checkNested",function(a,b,c){if(0<b.iNested){var d=a.getNested(b.iNested); if(K(d,String)){if(d.startsWith("select"))return;"~"!=d.charAt(0)&&"\x00"!=b.bioType&&(d="~"+b.bioType+"~"+d);d=this.getSubsearch(a,d,c);0<d.ac&&d.patternAtoms[0].selected&&(b.selected=!0);a.setNested(b.iNested,d)}}for(d=0;d<b.nSubAtoms;d++)this.checkNested(a,b.subAtoms[d],c)},"JS.SmilesSearch,JS.SmilesAtom,~N");g(c$,"fixChirality",function(a){for(var b=a.ac;0<=--b;){var c=a.patternAtoms[b];null!=c.stereo&&c.stereo.fixStereo(c)}},"JS.SmilesSearch");g(c$,"parseSmiles",function(a,b,c,d){var e=t(1,0), f=0,h,j=null,g=!1,s=!1;a:for(;null!=b&&0!=b.length;){var k=0;null==c&&(k=this.checkBioType(b,0),k==b.length&&(b+="*"),this.isBioSequence&&(a.needAromatic=a.top.needAromatic=!1));h=JS.SmilesParser.getChar(b,k);var l=this.checkBrace(a,h,"{");l&&(h=JS.SmilesParser.getChar(b,++k));if("("==h)if(j=JS.SmilesParser.getSubPattern(b,k,"("),h="."==JS.SmilesParser.getChar(b,k+1),null==c){if(h||!this.isSmarts)throw new JS.InvalidSmilesException("No previous atom for measure");a.haveComponents=!0;do this.componentCount++, this.componentParenCount++,h=JS.SmilesParser.getChar(b=b.substring(1),0);while("("==h);if(!l&&!0==(l=this.checkBrace(a,h,"{")))h=JS.SmilesParser.getChar(b=b.substring(1),0)}else g=s=!1,j.startsWith(".")?(this.parseMeasure(a,j.substring(1),c),g=!0):0==j.length&&this.isBioSequence?c.notCrossLinked=!0:(this.branchLevel++,this.parseSmiles(a,j,c,!0),s=!0,this.branchLevel--),k=j.length+2,h=JS.SmilesParser.getChar(b,k),"}"==h&&this.checkBrace(a,h,"}")&&k++,h="\x00";if("\x00"!=h){f=k;b:for(;"\x00"!=h;){switch(JS.SmilesBond.isBondType(h, this.isSmarts,this.isBioSequence)){case 0:break b;case -1:if(!((JU.PT.isDigit(JS.SmilesParser.getChar(b,++k))&&0<k++?JU.PT.isDigit(JS.SmilesParser.getChar(b,k++)):1)&&"-"==(h=JS.SmilesParser.getChar(b,k))))throw new JS.InvalidSmilesException("malformed atropisomerism bond ^nn- or ^^nn-");continue}h=JS.SmilesParser.getChar(b,++k)}h=JS.SmilesParser.getChar(b,k);if(")"==h){switch(JS.SmilesParser.getChar(b,++k)){case "\x00":case ")":case ".":if(b=b.substring(k),this.componentParenCount--,0<=this.componentParenCount)continue a}throw new JS.InvalidSmilesException("invalid continuation after component grouping (SMARTS).(SMARTS)"); }j=this.parseBond(a,null,b.substring(f,k),null,c,!1,d,k-f,e);l&&-1!=j.order&&(h=JS.SmilesParser.getChar(b,k=f));this.checkBrace(a,h,"{")&&(h=JS.SmilesParser.getChar(b,++k));switch(h){case "~":0==j.order&&(k=this.checkBioType(b,k),k==b.length&&(b+="*"));break;case "(":do this.componentCount++,this.componentParenCount++,h=JS.SmilesParser.getChar(b,++k);while("("==h);break;case "\x00":if(0==j.order)return}l=JU.PT.isDigit(h)||"%"==h;f=!l&&("_"==h||"["==h||"*"==h||JU.PT.isLetter(h));if(l){if(g||s)throw new JS.InvalidSmilesException("connection number must immediately follow its connecting atom"); k=JS.SmilesParser.getRingNumber(b,k,h,e);this.parseConnection(a,e[0],c,j)}else if(f)switch(g=s=!1,h){case "[":case "_":l=JS.SmilesParser.getSubPattern(b,k,h);k+=l.length+("["==h?2:0);this.isBioSequence&&("["==h&&0>l.indexOf(".")&&0>l.indexOf("_"))&&(l+=".0");c=this.parseAtom(a,null,l,c,j,"["==h,!1,d);c.hasSubpattern=!0;-1!=j.order&&0!=j.order&&this.setBondAtom(j,null,c,a);break;default:l=!this.isBioSequence&&JU.PT.isUpperCase(h)?JS.SmilesParser.getChar(b,k+1):"\x00";if("X"!=h||"x"!=l)if(!JU.PT.isLowerCase(l)|| 0==JU.Elements.elementNumberFromSymbol(b.substring(k,k+2),!0))l="\x00";"\x00"!=l&&0<="NA CA BA PA SC AC".indexOf(b.substring(k,k+2))&&(l="\x00");h=JU.PT.isUpperCase(h)&&JU.PT.isLowerCase(l)?2:1;c=this.parseAtom(a,null,b.substring(k,k+h),c,j,!1,!1,d);k+=h}else throw new JS.InvalidSmilesException("Unexpected character: "+JS.SmilesParser.getChar(b,k));h=JS.SmilesParser.getChar(b,k);"}"==h&&this.checkBrace(a,h,"}")&&k++}b=b.substring(k);d=!1}},"JS.SmilesSearch,~S,JS.SmilesAtom,~B");g(c$,"parseConnection", function(a,b,c,d){b=Integer.$valueOf(b);var e=this.connections.get(b);if(null==e)this.connections.put(b,d),a.top.ringCount++;else{this.connections.remove(b);switch(d.order){case -1:d.order=-1!=e.order?e.order:this.isSmarts||c.isAromatic&&e.atom1.isAromatic?81:1;break;case 1025:d.order=1041;break;case 1041:d.order=1025}if(-1!=e.order&&e.order!=d.order||c===e.atom1||null!=e.atom1.getBondTo(c))throw new JS.InvalidSmilesException("Bad connection type or atom");e.set(d);c.bondCount--;e.setAtom2(c,a)}}, "JS.SmilesSearch,~N,JS.SmilesAtom,JS.SmilesBond");g(c$,"setBondAtom",function(a,b,c,d){a.set2a(b,c);null!=d&&(2==a.order&&null!=a.atom1&&null!=a.atom2&&a.atom1.isAromatic&&a.atom2.isAromatic&&0==(this.flags&512))&&d.setFlags(this.flags|=512)},"JS.SmilesBond,JS.SmilesAtom,JS.SmilesAtom,JS.SmilesSearch");c$.getRingNumber=g(c$,"getRingNumber",function(a,b,c,d){switch(c){case "%":if("("==JS.SmilesParser.getChar(a,b+1)){if(a=JS.SmilesParser.getSubPattern(a,b+1,"("),JS.SmilesParser.getDigits(a,0,d),b+= a.length+3,0>d[0])throw new JS.InvalidSmilesException("Invalid number designation: "+a);}else if(b+3<=a.length&&(b=JS.SmilesParser.getDigits(a.substring(0,b+3),b+1,d)),10>d[0])throw new JS.InvalidSmilesException("Two digits must follow the % sign");a=d[0];break;default:a=c.charCodeAt(0)-48,b++}d[0]=a;return b},"~S,~N,~S,~A");g(c$,"checkBioType",function(a,b){if(this.isBioSequence="~"==a.charAt(b)){b++;this.bioType="*";var c=JS.SmilesParser.getChar(a,2);if("~"==c&&("*"==(c=a.charAt(1))||JU.PT.isLowerCase(c)))this.bioType= c,b=3}return b},"~S,~N");g(c$,"parseMeasure",function(a,b,c){for(var d=b.indexOf(":"),e=0>d?b:b.substring(0,d);0!=d;){var f=e.length;1==f&&(e+="0");var h=this.htMeasures.get(e);if(null==h==0>d||0==f)break;try{if(0<d){var j="__dat".indexOf(e.charAt(0));if(2>j)break;var g=t(1,0);JS.SmilesParser.getDigits(e,1,g);var s=g[0];b=b.substring(d+1);var k=b.startsWith("!");k&&(b=b.substring(1));var l=b.startsWith("-");l&&(b=b.substring(1));b=JU.PT.rep(b,"-",",");b=JU.PT.rep(b,",,",",-");l&&(b="-"+b);var n=JU.PT.split(b, ",");if(1==n.length%2||k&&2!=n.length)break;for(var p=N(n.length,0),q=n.length;0<=--q&&!Float.isNaN(p[q]=JU.PT.fVal(n[q])););if(0<=q)break;h=new JS.SmilesMeasure(a,s,j,k,p);a.measures.addLast(h);0<s?this.htMeasures.put(e,h):0==s&&JU.Logger.debugging&&JU.Logger.debug("measure created: "+h)}else{if(!h.addPoint(c.index))break;h.nPoints==h.type&&(this.htMeasures.remove(e),JU.Logger.debugging&&JU.Logger.debug("measure created: "+h));return}if(!h.addPoint(c.index))break}catch(r){if(F(r,NumberFormatException))break; else throw r;}return}throw new JS.InvalidSmilesException("invalid measure: "+b);},"JS.SmilesSearch,~S,JS.SmilesAtom");g(c$,"checkBrace",function(a,b,c){switch(b){case "{":if(b!=c)break;this.braceCount++;return a.top.haveSelected=!0;case "}":if(b!=c)break;if(0<this.braceCount)return this.braceCount--,!0;break;default:return!1}throw new JS.InvalidSmilesException("Unmatched '}'");},"JS.SmilesSearch,~S,~S");g(c$,"parseNested",function(a,b,c){var d;for(c="$("+c;0<=(d=b.lastIndexOf(c));){var e=JS.SmilesParser.getSubPattern(b, d+1,"("),f=d+e.length+3,h=b.substring(f);b=b.substring(0,d);var j="";if(b.endsWith("]"))throw new JS.InvalidSmilesException("$(...) must be enclosed in brackets: "+b+"$("+e+")");if(1<d&&2==c.length&&1<(f=b.length)&&0>",;&![".indexOf(b.substring(f-1)))j="&";1<h.length&&0>",;&!)]".indexOf(h.charAt(0))&&(h="&"+h);b=b+j+"_"+a.top.addNested(e)+"_"+h}return b},"JS.SmilesSearch,~S,~S");g(c$,"parseVariables",function(a){var b=new JU.Lst,c=new JU.Lst,d,e=0,f=-1;for(JU.Logger.debugging&&JU.Logger.info(a);0<= (d=a.indexOf("$",e))&&"("!=JS.SmilesParser.getChar(a,d+1);){e=JS.SmilesParser.skipTo(a,d,"=");if(e<=d+1||'"'!=JS.SmilesParser.getChar(a,e+1))break;d=a.substring(d,e);if(0<d.lastIndexOf("$")||0<d.indexOf("]"))throw new JS.InvalidSmilesException("Invalid variable name: "+d);f=JS.SmilesParser.getSubPattern(a,e+1,'"');b.addLast("["+d+"]");c.addLast(f);e+=f.length+2;e=JS.SmilesParser.skipTo(a,e,";");f=++e}if(0>f)return a;a=a.substring(f);for(e=b.size();0<=--e;)d=b.get(e),f=c.get(e),f.equals(d)||(a=JU.PT.rep(a, d,f));JU.Logger.debugging&&JU.Logger.info(a);return a},"~S");g(c$,"parseAtom",function(a,b,c,d,e,f,h,j){if(null==c||0==c.length)throw new JS.InvalidSmilesException("Empty atom definition");var g=new JS.SmilesAtom;0<this.componentParenCount&&(g.component=this.componentCount);null==b&&a.appendAtom(g);if(!this.checkLogic(a,c,g,null,d,h,j,null)){var s=t(1,0);this.isBioSequence&&1==c.length&&(c+=".0");var k=c.charAt(0),l=0,n=!1;if(this.isSmarts&&"!"==k){k=JS.SmilesParser.getChar(c,++l);if("\x00"==k)throw new JS.InvalidSmilesException("invalid '!'"); g.not=n=!0}var p=c.indexOf(".");if(0<=p){g.isBioResidue=!0;var q=c.substring(l,p);c=c.substring(p+1).toUpperCase();var r=q.length;if(0<=(p=q.indexOf("^")))p==r-2&&(k=q.charAt(r-1),"*"!=k&&(g.insCode=k)),q=q.substring(0,p);if(0<=(p=q.indexOf("#")))JS.SmilesParser.getDigits(q,p+1,s),g.residueNumber=s[0],q=q.substring(0,p);0==q.length&&(q="*");1<q.length?g.residueName=q.toUpperCase():q.equals("*")||(g.residueChar=q);q=c;if(0<=(p=q.indexOf("#")))JS.SmilesParser.getDigits(q,p+1,s),g.elementNumber=s[0], q=q.substring(0,p);0==q.length?q="*":q.equals("0")&&(q="\x00");q.equals("*")?g.isBioAtomWild=!0:g.setAtomName(q);k="\x00"}g.setBioAtom(this.bioType);for(p=-2147483648;"\x00"!=k;){g.setAtomName(this.isBioSequence?"\x00":"");if(JU.PT.isDigit(k)){l=JS.SmilesParser.getDigits(c,l,s);k=s[0];if(-2147483648==k)throw new JS.InvalidSmilesException("Non numeric atomic mass");"?"==JS.SmilesParser.getChar(c,l)&&(l++,k=-k);if(g.elementDefined)throw new JS.InvalidSmilesException('atom mass must precede atom symbol or be separated from it with ";"'); g.setAtomicMass(k)}else switch(k){case '"':k=JU.PT.getQuotedStringAt(c,l);l+=k.length+2;g.atomType=k;break;case "_":l=JS.SmilesParser.getDigits(c,l+1,s)+1;if(-2147483648==s[0])throw new JS.InvalidSmilesException("Invalid SEARCH primitive: "+c.substring(l));g.iNested=s[0];if(!f)throw new JS.InvalidSmilesException("nesting must appear in [...]: $("+a.getNested(s[0])+")");if(this.isBioSequence&&l!=c.length)throw new JS.InvalidSmilesException("invalid characters: "+c.substring(l));break;case "=":l=JS.SmilesParser.getDigits(c, l+1,s);g.jmolIndex=s[0];break;case "#":k="-"==c.charAt(l+1);l=JS.SmilesParser.getDigits(c,l+(k?2:1),s);k?g.atomNumber=s[0]:g.elementNumber=s[0];break;case "-":case "+":l=this.checkCharge(c,l,g);break;case "@":null==a.stereo&&(a.stereo=JS.SmilesStereo.newStereo(null));l=JS.SmilesStereo.checkChirality(c,l,a.patternAtoms[g.index]);break;case ":":l=JS.SmilesParser.getDigits(c,++l,s);if(-2147483648==s[0])throw new JS.InvalidSmilesException("Invalid atom class");g.atomClass=s[0];break;default:var q=JS.SmilesParser.getChar(c, l+1),r=l+(JU.PT.isLowerCase(q)&&(!f||!JU.PT.isDigit(JS.SmilesParser.getChar(c,l+2)))?2:1),v=c.substring(l+1,r),y=Character.toUpperCase(k)+v,u=!0;f&&JU.PT.isLetter(k)&&(!n&&(h?b:g).hasSymbol?u=!1:"H"==k?u=1==c.length||!JU.PT.isDigit(q):JU.PT.isDigit(q)?u=!1:!y.equals("A")&&!y.equals("Xx")&&(u=("h"==k?2==r:!0)&&0<JU.Elements.elementNumberFromSymbol(y,!0),!u&&2==r&&(v="",y=y.substring(0,1),u=0<JU.Elements.elementNumberFromSymbol(y,!0))));if(u){if(!f&&!this.isSmarts&&!this.isBioSequence&&!JS.SmilesAtom.allowSmilesUnbracketed(y)|| !g.setSymbol(y=k+v))throw new JS.InvalidSmilesException("Invalid atom symbol: "+y);h&&(b.hasSymbol=!0);l+=y.length}else switch(l=JS.SmilesParser.getDigits(c,l+1,s),r=s[0],k){default:throw new JS.InvalidSmilesException("Invalid SEARCH primitive: "+c.substring(l));case "D":g.setDegree(-2147483648==r?1:r);break;case "d":g.setNonhydrogenDegree(-2147483648==r?1:r);break;case "H":p=-2147483648==r?1:r;break;case "h":g.setImplicitHydrogenCount(-2147483648==r?-1:r);break;case "R":-2147483648==r&&(r=-1);g.setRingMembership(r); a.top.needRingData=!0;break;case "r":if(-2147483648==r)r=-1,g.setRingMembership(r);else{g.setRingSize(r);switch(r){case 500:r=5;break;case 600:r=6}r>a.ringDataMax&&(a.ringDataMax=r)}a.top.needRingData=!0;break;case "v":g.setValence(-2147483648==r?1:r);break;case "X":g.setConnectivity(-2147483648==r?1:r);break;case "x":g.setRingConnectivity(-2147483648==r?-1:r),a.top.needRingData=!0}}k=JS.SmilesParser.getChar(c,l);if(n&&"\x00"!=k)throw new JS.InvalidSmilesException("'!' may only involve one primitive."); }-2147483648==p&&f&&(p=-2147483647);g.setExplicitHydrogenCount(p);a.patternAtoms[g.index].setExplicitHydrogenCount(p)}0<this.braceCount&&(g.selected=!0);null!=b&&b.addSubAtom(g,h);null!=d&&0==e.order&&(g.notBondedIndex=d.index);null!=d&&0!=e.order&&(-1==e.order&&(e.order=this.isBioSequence&&j?112:this.isSmarts||d.isAromatic&&g.isAromatic?81:1),f||this.setBondAtom(e,null,g,a),0==this.branchLevel&&(17==e.order||112==e.order)&&this.branchLevel++);0==this.branchLevel&&(a.lastChainAtom=g);return g},"JS.SmilesSearch,JS.SmilesAtom,~S,JS.SmilesAtom,JS.SmilesBond,~B,~B,~B"); g(c$,"checkCharge",function(a,b,c){var d=a.length,e=a.charAt(b),f=1;++b;if(b<d){var h=a.charAt(b);if(JU.PT.isDigit(h)){if(d=t(1,0),b=JS.SmilesParser.getDigits(a,b,d),f=d[0],-2147483648==f)throw new JS.InvalidSmilesException("Non numeric charge");}else for(;b<d&&a.charAt(b)==e;)b++,f++}c.setCharge("+"==e?f:-f);return b},"~S,~N,JS.SmilesAtom");g(c$,"parseBond",function(a,b,c,d,e,f,h,j,g){var n;if(0<j)switch(n=c.charAt(0)){case ">":if(!c.equals(">>")){j=-1;break}case ".":if(null==d&&null==b)return this.isBioSequence= "~"==JS.SmilesParser.getChar(c,1),new JS.SmilesBond(null,null,0,!1);j=-1;break;case "+":null!=b&&(j=-1)}else n="\x00";d=null==b?null==d?new JS.SmilesBond(e,null,this.isBioSequence&&null!=e?h?112:96:-1,!1):d:f?b.addPrimitive():b.addBondOr();if(0<j&&!this.checkLogic(a,c,null,d,e,f,!1,g)){if(f="!"==n)if(n=JS.SmilesParser.getChar(c,1),"\x00"==n||"!"==n)throw new JS.InvalidSmilesException("invalid '!'");h=JS.SmilesBond.getBondTypeFromCode(n);65==h&&(a.top.needRingMemberships=!0);if(null==e&&0!=h)throw new JS.InvalidSmilesException("Bond without a previous atom"); switch(h){case 65537:case 65538:(j=c.length)<(f?3:2)||"-"!=c.charAt(j-1)?j=0:j==(f?3:2)?d.setAtropType(22):(JS.SmilesParser.getDigits(c,f?2:1,g),d.setAtropType(g[0]));a.haveBondStereochemistry=!0;break;case 1025:case 1041:this.bondDirectionPaired=!this.bondDirectionPaired;a.haveBondStereochemistry=!0;break;case 2:a.top.nDouble++;case 1:e.isAromatic&&(a.top.needRingData=!0)}d.set2(h,f);this.isBioSequence&&null!=b&&b.set2(h,f)}if(-1==j)throw new JS.InvalidSmilesException("invalid bond:"+n);return d}, "JS.SmilesSearch,JS.SmilesBond,~S,JS.SmilesBond,JS.SmilesAtom,~B,~B,~N,~A");g(c$,"checkLogic",function(a,b,c,d,e,f,h,j){var g=b.lastIndexOf("!");null!=c&&(c.pattern=b);for(;0<g;)0>",;&!".indexOf(b.charAt(g-1))&&(b=b.substring(0,g)+"&"+b.substring(g)),g=b.lastIndexOf("!",g-1);var g=b.indexOf(","),n=b.length,k="&";a:for(;;){var l=0<g;if(l&&!this.isSmarts||0==g)break;g=b.indexOf(";");if(0<=g){if(!this.isSmarts||0==g)break;l?(k=";",l=!1):b=b.$replace(";","&")}var t=0;if(l)for(b+=",";0<(g=b.indexOf(",", t))&&g<=n;){t=b.substring(t,g);if(0==t.length)throw new JS.InvalidSmilesException("missing "+(null==d?"atom":"bond")+" token");null==d?this.parseAtom(a,c,t,null,null,!0,!1,h):this.parseBond(a,d,t,null,e,!1,!1,t.length,j);t=g+1}else if(0<=(g=b.indexOf(k))||null!=d&&1<n&&!f){if(0==g||null==d&&!this.isSmarts)break;if(null!=d&&0>g&&1<n){f=new JU.SB;for(l=0;l<n;){var p=b.charAt(l++);f.appendC(p);switch(p){case "!":if(!this.isSmarts)break a;continue;case "^":case "`":for(;"-"!=(p=b.charAt(l++))&&"\x00"!= p;)f.appendC(p);f.appendC("-")}if(l<n){if(!this.isSmarts)break a;f.append(k)}}b=f.toString();n=b.length}for(b+=k;0<(g=b.indexOf(k,t))&&g<=n;)t=b.substring(t,g),null==d?this.parseAtom(a,c,t,null,null,!0,!0,h):this.parseBond(a,this.isSmarts?d:null,t,this.isSmarts?null:d,e,!0,!1,t.length,j),t=g+1}else return!1;return!0}p=b.charAt(g);throw new JS.InvalidSmilesException((this.isSmarts?"invalid placement for '"+p+"'":"["+p+"] notation only valid with SMARTS, not SMILES,")+" in "+b);},"JS.SmilesSearch,~S,JS.SmilesAtom,JS.SmilesBond,JS.SmilesAtom,~B,~B,~A"); c$.getSubPattern=g(c$,"getSubPattern",function(a,b,c){var d,e=1;switch(c){case "[":d="]";break;case '"':case "%":case "/":d=c;break;case "(":d=")";break;default:d=c,e=0}for(var f=a.length,g=1,j=b+1;j<f;j++){var m=a.charAt(j);if(m==d){if(g--,0==g)return a.substring(b+e,j+1-e)}else m==c&&g++}throw new JS.InvalidSmilesException("Unmatched "+c);},"~S,~N,~S");c$.getChar=g(c$,"getChar",function(a,b){return b<a.length?a.charAt(b):"\x00"},"~S,~N");c$.getDigits=g(c$,"getDigits",function(a,b,c){for(var d=b, e=a.length;d<e&&JU.PT.isDigit(a.charAt(d));)d++;if(d>b)try{return c[0]=Integer.parseInt(a.substring(b,d)),d}catch(f){if(!F(f,NumberFormatException))throw f;}c[0]=-2147483648;return d},"~S,~N,~A");c$.skipTo=g(c$,"skipTo",function(a,b,c){for(var d;(d=JS.SmilesParser.getChar(a,++b))!=c&&"\x00"!=d;);return"\x00"==d?-1:b},"~S,~N,~S");c$.cleanPattern=g(c$,"cleanPattern",function(a){a=JU.PT.replaceAllCharacters(a," \t\n\r","");a=JU.PT.rep(a,"^^","`");for(var b=0,c=0;0<=(b=a.indexOf("//*"))&&(c=a.indexOf("*//"))>= b;)a=a.substring(0,b)+a.substring(c+3);return a=JU.PT.rep(a,"//","")},"~S");c$.extractFlags=g(c$,"extractFlags",function(a,b){a=JS.SmilesParser.cleanPattern(a);for(var c=0;a.startsWith("/");){var d=JS.SmilesParser.getSubPattern(a,0,"/").toUpperCase();a=a.substring(d.length+2);c=JS.SmilesSearch.addFlags(c,d)}b[0]=c;return a},"~S,~A");c$.getFlags=g(c$,"getFlags",function(a){var b=t(1,0);JS.SmilesParser.extractFlags(a,b);return b[0]},"~S")});B("JS");C(null,"JS.SmilesExt","java.lang.Float JU.AU $.BS $.Lst $.M4 $.Measure $.P3 J.api.Interface JU.Logger".split(" "), function(){c$=D(function(){this.sm=this.e=null;E(this,arguments)},JS,"SmilesExt");G(c$,function(){});g(c$,"init",function(a){this.e=a;this.sm=this.e.vwr.getSmilesMatcher();return this},"~O");g(c$,"getSmilesCorrelation",function(a,b,c,d,e,f,g,j,m,n,k,l){var t=null==m?0.1:3.4028235E38;try{null==d&&(d=new JU.Lst,e=new JU.Lst);var p=new JU.M4,q=new JU.P3,r=this.e.vwr.ms.at,v=this.e.vwr.ms.ac,y=this.sm.getCorrelationMaps(c,r,v,a,l|8);null==y&&this.e.evalError(this.sm.getLastException(),null);if(0==y.length)return NaN; var u=y[0];for(a=0;a<u.length;a++)d.addLast(r[u[a]]);y=this.sm.getCorrelationMaps(c,r,v,b,l);null==y&&this.e.evalError(this.sm.getLastException(),null);if(0==y.length)return NaN;JU.Logger.info(y.length+" mappings found");if(k||!j){b=3.4028235E38;c=null;for(a=0;a<y.length;a++){e.clear();for(var x=0;x<y[a].length;x++)e.addLast(r[y[a][x]]);J.api.Interface.getInterface("JU.Eigen",this.e.vwr,"script");var w=1==e.size()?0:JU.Measure.getTransformMatrix4(d,e,p,null);JU.Logger.info("getSmilesCorrelation stddev="+ w);if(null!=g&&w<t){for(var z=new JU.BS,x=0;x<y[a].length;x++)z.set(y[a][x]);g.addLast(z)}w<b&&(c=y[a],null!=f&&f.setM4(p),null!=n&&n.setT(q),b=w)}null!=m&&(m[0]=u,m[1]=c);e.clear();for(a=0;a<c.length;a++)e.addLast(r[c[a]]);return b}for(a=0;a<y.length;a++)for(x=0;x<y[a].length;x++)e.addLast(r[y[a][x]])}catch(A){if(F(A,Exception))this.e.evalError(A.getMessage(),null);else throw A;}return 0},"JU.BS,JU.BS,~S,JU.Lst,JU.Lst,JU.M4,JU.Lst,~B,~A,JU.P3,~B,~N");g(c$,"getSmilesMatches",function(a,b,c,d,e,f, g){if(0==a.length||a.endsWith("///")||a.equals("H")||a.equals("top")||a.equalsIgnoreCase("NOAROMATIC"))try{return this.e.vwr.getSmilesOpt(c,0,0,e|(a.equals("H")?4096:0)|(a.equals("top")?8192:0)|(a.equalsIgnoreCase("NOAROMATIC")?16:0),a.endsWith("///")?a:null)}catch(j){if(F(j,Exception))this.e.evalError(j.getMessage(),null);else throw j;}var m;if(null==d){d=2==(e&2);try{if(null==b)m=this.sm.getSubstructureSetArray(a,this.e.vwr.ms.at,this.e.vwr.ms.ac,c,null,e);else{var n=this.sm.find(a,b,(d?2:1)|(g? 8:0));if(!f)return!g?n:0==n.length?t(0,0):n[0];var k=new JU.BS;for(f=0;f<n.length;f++)for(var l=n[f],B=l.length;0<=--B;)0<=l[B]&&k.set(l[B]);if(!d)return t(k.cardinality(),0);var p=t(k.cardinality(),0);f=0;for(var q=k.nextSetBit(0);0<=q;q=k.nextSetBit(q+1))p[f++]=q;return p}}catch(r){if(F(r,Exception))return this.e.evalError(r.getMessage(),null),null;throw r;}}else{m=new JU.Lst;k=this.getSmilesCorrelation(d,c,a,null,null,null,m,!1,null,null,!1,e);if(Float.isNaN(k))return f?new JU.BS:M(-1,[]);this.e.showString("RMSD "+ k+" Angstroms");m=m.toArray(Array(m.size()))}if(f){k=new JU.BS;for(f=0;f<m.length;f++)k.or(m[f]);return k}k=new JU.Lst;for(f=0;f<m.length;f++)k.addLast(m[f]);return k},"~S,~S,JU.BS,JU.BS,~N,~B,~B");g(c$,"getFlexFitList",function(a,b,c,d){var e=JU.AU.newInt2(2);this.getSmilesCorrelation(a,b,c,null,null,null,null,!1,e,null,!1,d?2:1);if(null==e[0])return null;a=this.e.vwr.ms.getDihedralMap(e[0]);b=null==a?null:this.e.vwr.ms.getDihedralMap(e[1]);if(null==b||b.length!=a.length)return null;e=N(a.length, 3,0);c=this.e.vwr.ms.at;JS.SmilesExt.getTorsions(c,b,e,0);JS.SmilesExt.getTorsions(c,a,e,1);b=N(6*a.length,0);for(d=c=0;c<a.length;c++){var f=a[c];b[d++]=f[0];b[d++]=f[1];b[d++]=f[2];b[d++]=f[3];b[d++]=e[c][0];b[d++]=e[c][1]}return b},"JU.BS,JU.BS,~S,~B");c$.getTorsions=g(c$,"getTorsions",function(a,b,c,d){for(var e=b.length;0<=--e;){var f=b[e],f=JU.Measure.computeTorsion(a[f[0]],a[f[1]],a[f[2]],a[f[3]],!0);1==d&&(180<f-c[e][0]?f-=360:-180>=f-c[e][0]&&(f+=360));c[e][d]=f}},"~A,~A,~A,~N")})})(Clazz, Clazz.getClassName,Clazz.newLongArray,Clazz.doubleToByte,Clazz.doubleToInt,Clazz.doubleToLong,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.floatToLong,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.defineStatics,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.p0p,Clazz.pu$h,Clazz.newShortArray,Clazz.innerTypeInstance, Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAB,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs,Clazz.alert, Clazz.defineMethod,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.cloneFinals);
davidbuzatto/CryProteinModelsComparisonLab
web/j2s/core/coresmiles.z.js
JavaScript
gpl-3.0
98,094
import _ from "lodash"; import { Meteor } from "meteor/meteor"; import { Tracker } from "meteor/tracker"; import { AnalyticsEvents, Packages } from "/lib/collections"; import { Reaction, i18next, Logger } from "/client/api"; import Alerts from "/imports/plugins/core/layout/client/templates/layout/alerts/inlineAlerts"; // Create a queue, but don't obliterate an existing one! analytics = window.analytics = window.analytics || []; // If the real analytics.js is already on the page return. if (analytics.initialize) return; // If the snippet was invoked already show an error. if (analytics.invoked) { Logger.warn("Segment snippet included twice."); return; } // Invoked flag, to make sure the snippet // is never invoked twice. analytics.invoked = true; // A list of the methods in Analytics.js to stub. analytics.methods = [ "trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "page", "once", "off", "on" ]; // Define a factory to create stubs. These are placeholders // for methods in Analytics.js so that you never have to wait // for it to load to actually record data. The `method` is // stored as the first argument, so we can replay the data. analytics.factory = function (method) { return function () { const args = Array.prototype.slice.call(arguments); args.unshift(method); analytics.push(args); return analytics; }; }; // For each of our methods, generate a queueing stub. for (let i = 0; i < analytics.methods.length; i++) { const key = analytics.methods[i]; analytics[key] = analytics.factory(key); } // Define a method to load Analytics.js from our CDN, // and that will be sure to only ever load it once. analytics.load = function (key) { // Create an async script element based on your key. const script = document.createElement("script"); script.type = "text/javascript"; script.async = true; script.src = (document.location.protocol === "https:" ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js"; // Insert our script next to the first script element. const first = document.getElementsByTagName("script")[0]; first.parentNode.insertBefore(script, first); }; // Add a version to keep track of what"s in the wild. analytics.SNIPPET_VERSION = "3.1.0"; // Load Analytics.js with your key, which will automatically // load the tools you"ve enabled for your account. Boosh! // analytics.load("YOUR_WRITE_KEY"); // Make the first page call to load the integrations. If // you"d like to manually name or tag the page, edit or // move this call however you"d like. // analytics.page(); // // Initialize analytics page tracking // // segment page tracking function notifySegment(context) { if (typeof analytics !== "undefined") { analytics.page({ userId: Meteor.userId(), properties: { url: context.path, shopId: Reaction.getShopId() } }); } } // google analytics page tracking function notifyGoogleAnalytics(context) { if (typeof ga !== "undefined") { ga("send", "pageview", context.path); } } // mixpanel page tracking function notifyMixpanel(context) { if (typeof mixpanel !== "undefined") { mixpanel.track("page viewed", { "page name": document.title, "url": context.path }); } } Reaction.Router.triggers.enter([notifySegment, notifyGoogleAnalytics, notifyMixpanel]); // // Initialize analytics event tracking // Meteor.startup(function () { Tracker.autorun(function () { const coreAnalytics = Packages.findOne({ name: "reaction-analytics" }); // check if installed and enabled if (!coreAnalytics || !coreAnalytics.enabled) { return Alerts.removeType("analytics-not-configured"); } const googleAnalytics = coreAnalytics.settings.public.googleAnalytics; const mixpanel = coreAnalytics.settings.public.mixpanel; const segmentio = coreAnalytics.settings.public.segmentio; // // segment.io // if (segmentio.enabled) { if (segmentio.api_key && analytics.invoked === true) { analytics.load(segmentio.api_key); } else if (!segmentio.api_key && Reaction.hasAdminAccess()) { _.defer(function () { return Alerts.toast( `${i18next.t("admin.settings.segmentNotConfigured")}`, "danger", { html: true, sticky: true }); }); } } // // Google Analytics // if (googleAnalytics.enabled) { if (googleAnalytics.api_key) { ga("create", googleAnalytics.api_key, "auto"); } else if (!googleAnalytics.api_key && Reaction.hasAdminAccess()) { _.defer(function () { return Alerts.toast( `${i18next.t("admin.settings.googleAnalyticsNotConfigured")}`, "error", { type: "analytics-not-configured", html: true, sticky: true }); }); } } // // mixpanel // if (mixpanel.enabled) { if (mixpanel.api_key) { mixpanel.init(mixpanel.api_key); } else if (!mixpanel.api_key && Reaction.hasAdminAccess()) { _.defer(function () { return Alerts.toast( `${i18next.t("admin.settings.mixpanelNotConfigured")}`, "error", { type: "analytics-not-configured", html: true, sticky: true }); }); } } if (!Reaction.hasAdminAccess()) { return Alerts.removeType("analytics-not-configured"); } return null; }); // // analytics event processing // return $(document.body).click(function (e) { let $targets = $(e.target).closest("*[data-event-action]"); $targets = $targets.parents("*[data-event-action]").add($targets); return $targets.each(function (index, element) { const $element = $(element); const analyticsEvent = { eventType: "event", category: $element.data("event-category"), action: $element.data("event-action"), label: $element.data("event-label"), value: $element.data("event-value") }; if (typeof ga === "function") { ga("send", "event", analyticsEvent.category, analyticsEvent.action, analyticsEvent.label, analyticsEvent.value); } if (typeof mixpanel === "object" && mixpanel.length > 0) { mixpanel.track(analyticsEvent.action, { Category: analyticsEvent.category, Label: analyticsEvent.label, Value: analyticsEvent.value }); } if (typeof analytics === "object") { analytics.track(analyticsEvent.action, { Category: analyticsEvent.category, Label: analyticsEvent.label, Value: analyticsEvent.value }); } // we could add a hook here, but not needed as // you can trigger using the collection hooks return AnalyticsEvents.insert(analyticsEvent); }); }); });
evereveofficial/reaction
imports/plugins/included/analytics/client/startup.js
JavaScript
gpl-3.0
7,072
var searchData= [ ['k',['k',['../a00008.html#ad4adeba1dac18ef43f26892b9878c3c3',1,'gaml::xtree::classification::Learner::k()'],['../a00020.html#a0d4642365c5cb8a02327248e79f6314e',1,'gaml::xtree::regression::Learner::k()']]] ];
HerveFrezza-Buet/gaml
doc/gaml-xtree/html/search/variables_1.js
JavaScript
gpl-3.0
229
ace.define("ace/ext/modelist",["require","exports","module"], function(require, exports, module) { "use strict"; var modes = []; function getModeForPath(path) { var mode = modesByName.text; var fileName = path.split(/[\/\\]/).pop(); for (var i = 0; i < modes.length; i++) { if (modes[i].supportsFile(fileName)) { mode = modes[i]; break; } } return mode; } var Mode = function(name, caption, extensions) { this.name = name; this.caption = caption; this.mode = "ace/mode/" + name; this.extensions = extensions; if (/\^/.test(extensions)) { var re = extensions.replace(/\|(\^)?/g, function(a, b){ return "$|" + (b ? "^" : "^.*\\."); }) + "$"; } else { var re = "^.*\\.(" + extensions + ")$"; } this.extRe = new RegExp(re, "gi"); }; Mode.prototype.supportsFile = function(filename) { return filename.match(this.extRe); }; var supportedModes = { ABAP: ["abap"], ActionScript:["as"], ADA: ["ada|adb"], Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"], AsciiDoc: ["asciidoc"], Assembly_x86:["asm"], AutoHotKey: ["ahk"], BatchFile: ["bat|cmd"], C9Search: ["c9search_results"], C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp"], Cirru: ["cirru|cr"], Clojure: ["clj|cljs"], Cobol: ["CBL|COB"], coffee: ["coffee|cf|cson|^Cakefile"], ColdFusion: ["cfm"], CSharp: ["cs"], CSS: ["css"], Curly: ["curly"], D: ["d|di"], Dart: ["dart"], Diff: ["diff|patch"], Dockerfile: ["^Dockerfile"], Dot: ["dot"], Erlang: ["erl|hrl"], EJS: ["ejs"], Forth: ["frt|fs|ldr"], FTL: ["ftl"], Gherkin: ["feature"], Glsl: ["glsl|frag|vert"], golang: ["go"], Groovy: ["groovy"], HAML: ["haml"], Handlebars: ["hbs|handlebars|tpl|mustache"], Haskell: ["hs"], haXe: ["hx"], HTML: ["html|htm|xhtml"], HTML_Ruby: ["erb|rhtml|html.erb"], INI: ["ini|conf|cfg|prefs"], Jack: ["jack"], Jade: ["jade"], Java: ["java"], JavaScript: ["js|jsm"], JSON: ["json"], JSONiq: ["jq"], JSP: ["jsp"], JSX: ["jsx"], Julia: ["jl"], LaTeX: ["tex|latex|ltx|bib"], LESS: ["less"], Liquid: ["liquid"], Lisp: ["lisp"], LiveScript: ["ls"], LogiQL: ["logic|lql"], LSL: ["lsl"], Lua: ["lua"], LuaPage: ["lp"], Lucene: ["lucene"], Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"], MATLAB: ["matlab"], Markdown: ["md|markdown"], MEL: ["mel"], MySQL: ["mysql"], MUSHCode: ["mc|mush"], Nix: ["nix"], ObjectiveC: ["m|mm"], OCaml: ["ml|mli"], Pascal: ["pas|p"], Perl: ["pl|pm"], pgSQL: ["pgsql"], PHP: ["php|phtml"], Powershell: ["ps1"], Prolog: ["plg|prolog"], Properties: ["properties"], Protobuf: ["proto"], Python: ["py"], R: ["r"], RDoc: ["Rd"], RHTML: ["Rhtml"], Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"], Rust: ["rs"], SASS: ["sass"], SCAD: ["scad"], Scala: ["scala"], Smarty: ["smarty|tpl"], Scheme: ["scm|rkt"], SCSS: ["scss"], SH: ["sh|bash|^.bashrc"], SJS: ["sjs"], Space: ["space"], snippets: ["snippets"], Soy_Template:["soy"], SQL: ["sql"], Stylus: ["styl|stylus"], SVG: ["svg"], Tcl: ["tcl"], Tex: ["tex"], Text: ["txt"], Textile: ["textile"], Toml: ["toml"], Twig: ["twig"], Typescript: ["ts|typescript|str"], Vala: ["vala"], VBScript: ["vbs"], Velocity: ["vm"], Verilog: ["v|vh|sv|svh"], XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"], XQuery: ["xq"], YAML: ["yaml|yml"] }; var nameOverrides = { ObjectiveC: "Objective-C", CSharp: "C#", golang: "Go", C_Cpp: "C/C++", coffee: "CoffeeScript", HTML_Ruby: "HTML (Ruby)", FTL: "FreeMarker" }; var modesByName = {}; for (var name in supportedModes) { var data = supportedModes[name]; var displayName = (nameOverrides[name] || name).replace(/_/g, " "); var filename = name.toLowerCase(); var mode = new Mode(filename, displayName, data[0]); modesByName[filename] = mode; modes.push(mode); } module.exports = { getModeForPath: getModeForPath, modes: modes, modesByName: modesByName }; }); ; (function() { ace.require(["ace/ext/modelist"], function() {}); })();
maddyonline/forked-cui
static/cui/vendor/ace-src-noconflict/ext-modelist.js
JavaScript
gpl-3.0
5,084
/** * @file * Adds an interface between the media recorder jQuery plugin and the drupal media module. */ (function($) { Drupal.behaviors.mediaRecorder = { attach: function(context, settings) { $('.media-recorder-wrapper').mediaRecorder({ 'recordingPath': Drupal.settings.mediaRecorder.recordingPath, 'filePath': Drupal.settings.mediaRecorder.filePath, 'fileName': Drupal.settings.mediaRecorder.fileName, 'timeLimit': Drupal.settings.mediaRecorder.timeLimit, 'width': Drupal.settings.mediaRecorder.width, 'height': Drupal.settings.mediaRecorder.height, 'swfurl': Drupal.settings.mediaRecorder.swfurl, 'html5url': Drupal.settings.mediaRecorder.html5url, }); } }; })(jQuery);
agiza/elmsln
core/dslmcode/shared/drupal-7.x/modules/ulmus/media_recorder/js/media-recorder.js
JavaScript
gpl-3.0
765
../release/angular-recaptcha.js
jbernach/transandalus-backend
src/main/webapp/bower_components/angular-recaptcha/demo/angular-recaptcha.js
JavaScript
gpl-3.0
31
$(document).ready(function () { var Settings = $.parseJSON(gdn.definition('TranslateThisSettings')); console.log(Settings); TranslateThis({ GA : false, // Google Analytics tracking scope : 'content', // ID to confine translation wrapper : 'translate-this', // ID of the TranslateThis wrapper cookie : 'tt-lang', // Name of the cookie - set to 0 to disable panelText : 'Translate Into:', // Panel header text moreText : '42 More Languages »', // More link text busyText : 'Translating page...', cancelText : 'cancel', doneText : 'Translated by the', // Completion message text undoText : 'Undo »', // Text for untranslate link undoLength : 10000, // Time undo link stays visible (milliseconds) ddLangs : [ // Languages in the dropdown 'cs', 'pt-PT', 'it', 'ru', 'ar', 'zh-CN', 'ja', 'ko' ], noBtn : false, //whether to disable the button styling btnImg : 'http://x.translateth.is/tt-btn1.png', btnWidth : 180, btnHeight : 18, noImg : false, // whether to disable flag imagery imgHeight : 12, // height of flag icons imgWidth : 8, // width of flag icons bgImg : 'http://x.translateth.is/tt-sprite.png', reparse : false // whether to reparse the DOM for each translation }); });
hgtonight/Plugin-TranslateThis
js/translatethis.js
JavaScript
gpl-3.0
1,249
import React, {Component, PropTypes} from 'react'; import Comment from '../components/Comment'; import SidebarContent from '../components/SidebarContent'; import Switch from '../components/Switch'; const COMMENTS_REFRESH_RATE = 10; class Comments extends Component { constructor(props) { super(props); this.toggleTimedComments = this.toggleTimedComments.bind(this); this.state = { className: null, currentTime: 0, timedComments: false, }; } componentWillReceiveProps(nextProps) { const {currentTime, timedComments} = this.state; if (!timedComments || !nextProps.isActive) { return; } if (nextProps.currentTime % COMMENTS_REFRESH_RATE === 0 || Math.abs(nextProps.currentTime - currentTime) > COMMENTS_REFRESH_RATE) { this.setState({ className: 'animate-out' }, () => { setTimeout(() => this.setState({ className: null, currentTime: nextProps.currentTime, }), 200); }); } } handleMouseEnter() { document.body.style.overflow = 'hidden'; } handleMouseLeave() { document.body.style.overflow = 'auto'; } toggleTimedComments() { this.setState({ timedComments: !this.state.timedComments }); } renderComments() { const {currentTime, timedComments} = this.state; const {comments, isActive} = this.props; if (isActive && timedComments) { return comments .slice() .filter(song => { const songTime = song.timestamp / 1000; return songTime >= currentTime && songTime < (currentTime + COMMENTS_REFRESH_RATE); }) .sort((a, b) => a.timestamp - b.timestamp) .map((comment, i) => { return <Comment comment={comment} i={i} key={comment.id} />; }); } return comments.slice().sort((a, b) => a.timestamp - b.timestamp).map((comment, i) => { return <Comment comment={comment} i={i} key={comment.id} />; }); } render() { const {height, isActive} = this.props; const {className, timedComments} = this.state; return ( <div className={'comments' + (isActive && timedComments ? ' timed' : '')}> <div className='comments-header'> <div className='comments-header-title'>Comments</div> <Switch isOn={timedComments} toggleFunc={this.toggleTimedComments} /> </div> <SidebarContent className={className} height={height - 220}> {this.renderComments()} </SidebarContent> </div> ); } } export default Comments;
joshburgess/sound-redux
scripts/components/Comments.js
JavaScript
gpl-3.0
2,988
'use strict'; var async = require('async'), winston = require('winston'), cron = require('cron').CronJob, nconf = require('nconf'), S = require('string'), db = require('./database'), User = require('./user'), groups = require('./groups'), meta = require('./meta'), plugins = require('./plugins'); (function(Notifications) { Notifications.init = function() { winston.verbose('[notifications.init] Registering jobs.'); new cron('*/30 * * * *', Notifications.prune, null, true); }; Notifications.get = function(nid, callback) { Notifications.getMultiple([nid], function(err, notifications) { callback(err, Array.isArray(notifications) && notifications.length ? notifications[0] : null); }); }; Notifications.getMultiple = function(nids, callback) { var keys = nids.map(function(nid) { return 'notifications:' + nid; }); db.getObjects(keys, function(err, notifications) { if (err) { return callback(err); } if (!Array.isArray(notifications) || !notifications.length) { return callback(null, []); } async.map(notifications, function(notification, next) { if (!notification) { return next(null, null); } if (notification.bodyShort) { notification.bodyShort = S(notification.bodyShort).escapeHTML().s; } if (notification.bodyLong) { notification.bodyLong = S(notification.bodyLong).escapeHTML().s; } if (notification.from && !notification.image) { User.getUserFields(notification.from, ['username', 'userslug', 'picture'], function(err, userData) { if (err) { return next(err); } notification.image = userData.picture || null; notification.user = userData; next(null, notification); }); return; } else if (notification.image) { switch(notification.image) { case 'brand:logo': notification.image = meta.config['brand:logo'] || nconf.get('relative_path') + '/logo.png'; break; } return next(null, notification); } else { notification.image = meta.config['brand:logo'] || nconf.get('relative_path') + '/logo.png'; return next(null, notification); } }, callback); }); }; Notifications.create = function(data, callback) { if (!data.nid) { return callback(new Error('no-notification-id')); } data.importance = data.importance || 5; db.getObject('notifications:' + data.nid, function(err, oldNotification) { if (err) { return callback(err); } if (oldNotification) { if (parseInt(oldNotification.pid, 10) === parseInt(data.pid, 10) && parseInt(oldNotification.importance, 10) > parseInt(data.importance, 10)) { return callback(); } } var now = Date.now(); data.datetime = now; async.parallel([ function(next) { db.sortedSetAdd('notifications', now, data.nid, next); }, function(next) { db.setObject('notifications:' + data.nid, data, next); } ], function(err) { callback(err, data); }); }); }; Notifications.push = function(notification, uids, callback) { callback = callback || function() {}; if (!notification.nid) { return callback(); } if (!Array.isArray(uids)) { uids = [uids]; } uids = uids.filter(function(uid) { return parseInt(uid, 10); }); if (!uids.length) { return callback(); } var done = false; var start = 0; var batchSize = 50; setTimeout(function() { async.whilst( function() { return !done; }, function(next) { var currentUids = uids.slice(start, start + batchSize); if (!currentUids.length) { done = true; return next(); } pushToUids(currentUids, notification, function(err) { if (err) { return next(err); } start = start + batchSize; setTimeout(next, 1000); }); }, function(err) { if (err) { winston.error(err.stack); } } ); }, 1000); callback(); }; function pushToUids(uids, notification, callback) { var unreadKeys = []; var readKeys = []; uids.forEach(function(uid) { unreadKeys.push('uid:' + uid + ':notifications:unread'); readKeys.push('uid:' + uid + ':notifications:read'); }); var oneWeekAgo = Date.now() - 604800000; async.series([ function(next) { db.sortedSetsAdd(unreadKeys, notification.datetime, notification.nid, next); }, function(next) { db.sortedSetsRemove(readKeys, notification.nid, next); }, function(next) { db.sortedSetsRemoveRangeByScore(unreadKeys, 0, oneWeekAgo, next); }, function(next) { db.sortedSetsRemoveRangeByScore(readKeys, 0, oneWeekAgo, next); } ], function(err) { if (err) { return callback(err); } plugins.fireHook('action:notification.pushed', {notification: notification, uids: uids}); var websockets = require('./socket.io'); if (websockets.server) { for(var i=0; i<uids.length; ++i) { websockets.in('uid_' + uids[i]).emit('event:new_notification', notification); } } callback(); }); } Notifications.pushGroup = function(notification, groupName, callback) { callback = callback || function() {}; groups.getMembers(groupName, 0, -1, function(err, members) { if (err || !Array.isArray(members) || !members.length) { return callback(err); } Notifications.push(notification, members, callback); }); }; Notifications.markRead = function(nid, uid, callback) { callback = callback || function() {}; if (!parseInt(uid, 10) || !nid) { return callback(); } Notifications.markReadMultiple([nid], uid, callback); }; Notifications.markUnread = function(nid, uid, callback) { callback = callback || function() {}; if (!parseInt(uid, 10) || !nid) { return callback(); } db.getObject('notifications:' + nid, function(err, notification) { if (err || !notification) { return callback(err || new Error('[[error:no-notification]]')); } notification.datetime = notification.datetime || Date.now(); async.parallel([ async.apply(db.sortedSetRemove, 'uid:' + uid + ':notifications:read', nid), async.apply(db.sortedSetAdd, 'uid:' + uid + ':notifications:unread', notification.datetime, nid) ], callback); }); }; Notifications.markReadMultiple = function(nids, uid, callback) { callback = callback || function() {}; nids = nids.filter(Boolean); if (!Array.isArray(nids) || !nids.length) { return callback(); } var notificationKeys = nids.map(function(nid) { return 'notifications:' + nid; }); db.getObjectsFields(notificationKeys, ['nid', 'datetime'], function(err, notificationData) { if (err) { return callback(err); } notificationData = notificationData.filter(function(notification) { return notification && notification.nid; }); nids = notificationData.map(function(notification) { return notification.nid; }); var datetimes = notificationData.map(function(notification) { return (notification && notification.datetime) || Date.now(); }); async.parallel([ function(next) { db.sortedSetRemove('uid:' + uid + ':notifications:unread', nids, next); }, function(next) { db.sortedSetAdd('uid:' + uid + ':notifications:read', datetimes, nids, next); } ], callback); }); }; Notifications.markAllRead = function(uid, callback) { db.getSortedSetRevRange('uid:' + uid + ':notifications:unread', 0, 99, function(err, nids) { if (err) { return callback(err); } if (!Array.isArray(nids) || !nids.length) { return callback(); } Notifications.markReadMultiple(nids, uid, callback); }); }; Notifications.prune = function() { var week = 604800000, numPruned = 0; var cutoffTime = Date.now() - week; db.getSortedSetRangeByScore('notifications', 0, 500, 0, cutoffTime, function(err, nids) { if (err) { return winston.error(err.message); } if (!Array.isArray(nids) || !nids.length) { return; } var keys = nids.map(function(nid) { return 'notifications:' + nid; }); numPruned = nids.length; async.parallel([ function(next) { db.sortedSetRemove('notifications', nids, next); }, function(next) { db.deleteAll(keys, next); } ], function(err) { if (err) { return winston.error('Encountered error pruning notifications: ' + err.message); } }); }); }; Notifications.merge = function(notifications, callback) { // When passed a set of notification objects, merge any that can be merged var mergeIds = [ 'notifications:favourited_your_post_in', 'notifications:upvoted_your_post_in', 'notifications:user_started_following_you', 'notifications:user_posted_to', 'notifications:user_flagged_post_in' ], isolated, differentiators, differentiator, modifyIndex, set; notifications = mergeIds.reduce(function(notifications, mergeId) { isolated = notifications.filter(function(notifObj) { if (!notifObj || !notifObj.hasOwnProperty('mergeId')) { return false; } return notifObj.mergeId.split('|')[0] === mergeId; }); if (isolated.length <= 1) { return notifications; // Nothing to merge } // Each isolated mergeId may have multiple differentiators, so process each separately differentiators = isolated.reduce(function(cur, next) { differentiator = next.mergeId.split('|')[1]; if (cur.indexOf(differentiator) === -1) { cur.push(differentiator); } return cur; }, []); differentiators.forEach(function(differentiator) { set = isolated.filter(function(notifObj) { return notifObj.mergeId === (mergeId + '|' + differentiator); }); modifyIndex = notifications.indexOf(set[0]); if (modifyIndex === -1 || set.length === 1) { return notifications; } switch(mergeId) { case 'notifications:favourited_your_post_in': // intentional fall-through case 'notifications:upvoted_your_post_in': case 'notifications:user_started_following_you': case 'notifications:user_posted_to': case 'notifications:user_flagged_post_in': var usernames = set.map(function(notifObj) { return notifObj.user.username; }); var numUsers = usernames.length; // Update bodyShort if (numUsers === 2) { notifications[modifyIndex].bodyShort = '[[' + mergeId + '_dual, ' + usernames.join(', ') + ', ' + notifications[modifyIndex].topicTitle + ']]' } else { notifications[modifyIndex].bodyShort = '[[' + mergeId + '_multiple, ' + usernames[0] + ', ' + (numUsers-1) + ', ' + notifications[modifyIndex].topicTitle + ']]' } break; } // Filter out duplicates notifications = notifications.filter(function(notifObj, idx) { if (!notifObj || !notifObj.mergeId) { return true; } return !(notifObj.mergeId === (mergeId + '|' + differentiator) && idx !== modifyIndex); }); }); return notifications; }, notifications); plugins.fireHook('filter:notifications.merge', { notifications: notifications }, function(err, data) { callback(err, data.notifications); }); }; }(exports));
magination/NodeBB
src/notifications.js
JavaScript
gpl-3.0
11,127
// flow-typed signature: 8cb5833be5a2bdcd60ada6e8ec3f93dd // flow-typed version: <<STUB>>/react-router-redux_vnext/flow_v0.50.0 /** * This is an autogenerated libdef stub for: * * 'react-router-redux' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'react-router-redux' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'react-router-redux/actions' { declare module.exports: any; } declare module 'react-router-redux/ConnectedRouter' { declare module.exports: any; } declare module 'react-router-redux/es/actions' { declare module.exports: any; } declare module 'react-router-redux/es/ConnectedRouter' { declare module.exports: any; } declare module 'react-router-redux/es/index' { declare module.exports: any; } declare module 'react-router-redux/es/middleware' { declare module.exports: any; } declare module 'react-router-redux/es/reducer' { declare module.exports: any; } declare module 'react-router-redux/middleware' { declare module.exports: any; } declare module 'react-router-redux/reducer' { declare module.exports: any; } declare module 'react-router-redux/umd/react-router-redux' { declare module.exports: any; } declare module 'react-router-redux/umd/react-router-redux.min' { declare module.exports: any; } // Filename aliases declare module 'react-router-redux/actions.js' { declare module.exports: $Exports<'react-router-redux/actions'>; } declare module 'react-router-redux/ConnectedRouter.js' { declare module.exports: $Exports<'react-router-redux/ConnectedRouter'>; } declare module 'react-router-redux/es/actions.js' { declare module.exports: $Exports<'react-router-redux/es/actions'>; } declare module 'react-router-redux/es/ConnectedRouter.js' { declare module.exports: $Exports<'react-router-redux/es/ConnectedRouter'>; } declare module 'react-router-redux/es/index.js' { declare module.exports: $Exports<'react-router-redux/es/index'>; } declare module 'react-router-redux/es/middleware.js' { declare module.exports: $Exports<'react-router-redux/es/middleware'>; } declare module 'react-router-redux/es/reducer.js' { declare module.exports: $Exports<'react-router-redux/es/reducer'>; } declare module 'react-router-redux/index' { declare module.exports: $Exports<'react-router-redux'>; } declare module 'react-router-redux/index.js' { declare module.exports: $Exports<'react-router-redux'>; } declare module 'react-router-redux/middleware.js' { declare module.exports: $Exports<'react-router-redux/middleware'>; } declare module 'react-router-redux/reducer.js' { declare module.exports: $Exports<'react-router-redux/reducer'>; } declare module 'react-router-redux/umd/react-router-redux.js' { declare module.exports: $Exports<'react-router-redux/umd/react-router-redux'>; } declare module 'react-router-redux/umd/react-router-redux.min.js' { declare module.exports: $Exports<'react-router-redux/umd/react-router-redux.min'>; }
zumbara/zumbara-web
flow-typed/npm/react-router-redux_vx.x.x.js
JavaScript
gpl-3.0
3,273