/**
 * @license RequireJS i18n 2.0.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/requirejs/i18n for details
 */

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License v1.0
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010-2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License v1.0
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
 *
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/

/**
 * @license RequireJS text 2.0.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/requirejs/text for details
 */

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010,2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2009, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2014 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012, 2014 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License v1.0
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
 *
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011,2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License v1.0
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
 *
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors:  IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: Anton McConville - IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: Anton McConville - IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2009, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     Andy Clement (vmware) - bug 344614
 *******************************************************************************/

/*******************************************************************************
 * @license Copyright (c) 2013 IBM Corporation and others. All rights
 *          reserved. This program and the accompanying materials are made
 *          available under the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2014 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: Anton McConville - IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2009, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors: IBM Corporation - _initial API and implementation
 *******************************************************************************/

/******************************************************************************* 
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2014 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License v1.0
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2009, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others 
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors:
 * IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others. 
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010-2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation
 RequireJS text 2.0.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/text for details

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010,2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010,2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012, 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2011,2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:  IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: Anton McConville - IBM Corporation - initial API and implementation

 Copyright (c) 2012, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: Anton McConville - IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: Anton McConville - IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: Anton McConville - IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation
 Andy Clement (vmware) - bug 344614

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: Anton McConville - IBM Corporation - initial API and implementation
 Copyright (c) 2013 IBM Corporation and others. All rights
 reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 Distribution License v1.0
 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: Anton McConville - IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - _initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 


 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others 
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2009, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others. 
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation
 RequireJS i18n 2.0.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/i18n for details

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation
*/
(function(){function i(a,c,d,e,b,j){c[a]&&(d.push(a),(c[a]===!0||c[a]===1)&&e.push(b+a+"/"+j))}function k(a,c,d,e,b){c=e+c+"/"+b;require._fileExists(a.toUrl(c+".js"))&&d.push(c)}function g(a,c,d){for(var e in c)c.hasOwnProperty(e)&&(!a.hasOwnProperty(e)||d)?a[e]=c[e]:typeof c[e]==="object"&&g(a[e],c[e],d)}var c=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(a){var l=a.config?a.config():{};return{version:"2.0.1+",load:function(a,e,b,j){j=j||{};if(j.locale)l.locale=j.locale;
var h=c.exec(a),f=h[1],m=h[4],n=h[5],q=m.split("-"),p=[],o={},r,w="";if(h[5])f=h[1],a=f+n;else{n=h[4];m=l.locale;if(!m)m=l.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();q=m.split("-")}if(j.isBuild){p.push(a);k(e,"root",p,f,n);for(r=0;r<q.length;r++)j=q[r],w+=(w?"-":"")+j,k(e,w,p,f,n);e(p,function(){b()})}else e([a],function(h){var j=[],a;i("root",h,j,p,f,n);for(r=0;r<q.length;r++)a=q[r],w+=(w?"-":"")+a,i(w,h,j,p,f,n);e(p,function(){var a,
d,m;for(a=j.length-1;a>-1&&j[a];a--){m=j[a];d=h[m];if(d===!0||d===1)d=e(f+m+"/"+n);g(o,d)}b(o)})})}}})})();
define("orion/i18n",[],function(){return{load:function(i,k,g,c){var c=c||{},a=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,l=a.exec(i);if(l){if(!k.defined||k.defined(i))try{g(k(i));return}catch(d){}if(c.isBuild||c.isTest)g({});else if(k.specified&&!k.specified("orion/bootstrap"))g({});else{var e=l[1],b=l[3]?l[2]:"",j=l[3]||l[2];k(["orion/bootstrap"],function(h){h.startup().then(function(f){var h=f.serviceRegistry,f=h.getServiceReferences("orion.i18n.message");if(b)f.some(function(b){return i===b.getProperty("name")?
(h.getService(b).getMessageBundle().then(function(b){g(b)},function(){g({})}),!0):!1})||g({});else{var d={},q;f.forEach(function(f){var h=f.getProperty("name");if((l=a.exec(h))&&e===l[1]&&j===(l[3]||l[2]))if(b=l[3]?l[2]:""){if((f=c.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&f.toLowerCase().indexOf(b.toLowerCase())===0)d[b]=!0,(!k.specified||!k.specified(h))&&define(h,["orion/i18n!"+h],function(b){return b})}else q=f});!k.specified||!k.specified(i)?q?
h.getService(q).getMessageBundle().then(function(b){Object.keys(d).forEach(function(f){typeof b[f]==="undefined"&&(b[f]=d[f])});define(i,[],b);g(b)},function(){define(i,[],d);g(d)}):(define(i,[],d),g(d)):g(d)}})})}}else g(null)}}});
define("orion/sites/nls/root/messages",{OK:"OK","Name:":"Name:",Path:"Path","Mount at (server path)":"Mount at (server path)","Mappings:":"Mappings:","Hostname hint:":"Hostname hint:","Status:":"Status:","Not a valid name":"Not a valid name","Not a valid hostname":"Not a valid hostname","Convert to Self-Hosting":"Convert to Self-Hosting","Enable the site configuration to launch an Orion server running your local client code":"Enable the site configuration to launch an Orion server running your local client code",
Save:"Save","Save the site configuration":"Save the site configuration","Choose folder...":"Choose folder\u2026",ConvertToSelfHostingTitle:"Locate Required Folders",SelectRequiredFoldersSingle:"Locate the following required folder in your workspace.",SelectRequiredFolders:"Locate the following required folders in your workspace.",LocateFolderTitle:"Locate ${0}",FolderPrompt:"${0} (${1}):",orionClientLabel:"Orion client repository","Loading...":"Loading...",Add:"Add","Add a directory mapping to the site configuration":"Add a directory mapping to the site configuration",
"There are unsaved changes. Do you still want to navigate away?":"There are unsaved changes. Do you still want to navigate away?","There are unsaved changes.":"There are unsaved changes.","Service method missing: ":"Service method missing: ","No Matching SiteService for ":"No Matching SiteService for ",Create:"Create","Create a new site configuration":"Create a new site configuration",Edit:"Edit","Edit the site configuration":"Edit the site configuration",Delete:"Delete","Delete the site configuration":"Delete the site configuration",
ConfirmDeleteSingle:"Are you sure you want to delete the site configuration '${0}'?",ConfirmDeleteMultiple:"Are you sure you want to delete these ${0} site configurations?",ViewOnSiteTitle:"View on Site",ViewOnSiteCaption:"Choose a site configuration to view '${0}' on.","Add to site":"Add to site","Add the file to this site":"Add the file to this site",View:"View","View the file on the site":"View the file on the site",Started:"Started at ${0}",Unknown:"Unknown",Name:"Name",Actions:"Actions",Status:"Status",
URL:"URL","New Site":"New Site",WorkspaceFile:"Workspace file: ${0}",WorkspaceFolder:"Workspace folder: ${0}",WorkspaceResourceNotFound:"Workspace resource not found: ${0}",ExternalLinkTo:"External link to ${0}","Move Up":"Move Up","Move Down":"Move Down",HostHint:"HostHint",Start:"Start",Stop:"Stop","Optional; used to determine the URL where a started site can be accessed.":"Optional; used to determine the URL where a started site can be accessed.","Changes you make here won't affect the running site.":"Changes you make here won't affect the running site.",
Stopped:"Stopped",Sites:"Sites",Mappings:"Mappings","SitesExplorer.NoSitesText":"You have no sites. Click ${0} to create a site."});define("orion/sites/nls/messages",["orion/i18n!orion/sites/nls/messages","orion/sites/nls/root/messages"],function(i,k){var g={root:k};Object.keys(i).forEach(function(c){typeof g[c]==="undefined"&&(g[c]=i[c])});return g});
(function(i,k){typeof define==="function"&&define.amd?define("orion/Deferred",k):typeof exports==="object"?module.exports=k():(i.orion=i.orion||{},i.orion.Deferred=k())})(this,function(){function i(){for(var d;d=a.shift();)d();l=!1}function k(d){a.push(d);l||(l=!0,setTimeout(i,0))}function g(a){return function(){a.apply(void 0,arguments)}}function c(){function d(){for(var b;b=m.shift();){var j=b.deferred,e=f==="fulfilled"?"resolve":"reject";if(typeof b[e]==="function")try{var d=(0,b[e])(h),c=d&&(typeof d===
"object"||typeof d==="function")&&d.then;if(typeof c==="function")if(d===j.promise)j.reject(new TypeError);else{var n=d.cancel;typeof n==="function"?j._protected(a).parentCancel=n.bind(d):delete j._protected(a).parentCancel;c.call(d,g(j.resolve),g(j.reject),g(j.progress))}else j.resolve(d)}catch(q){j.reject(q)}else j[e](h)}}function e(b){delete q.parentCancel;f="rejected";h=b;m.length&&k(d)}function b(j){function a(b){return function(f){l||(l=!0,b(f))}}var l=!1;delete q.parentCancel;try{var g=j&&
(typeof j==="object"||typeof j==="function")&&j.then;if(typeof g==="function")if(j===n)e(new TypeError);else{f="assumed";var i=j&&j.cancel;if(typeof i!=="function"){var y=new c,j=y.promise;try{g(y.resolve,y.reject,y.progress)}catch(t){y.reject(t)}i=j.cancel;g=j.then}h=j;g.call(j,a(b),a(e));q.parentCancel=i.bind(j)}else f="fulfilled",h=j,m.length&&k(d)}catch(z){a(e)(z)}}function j(){var b=q.parentCancel;if(b)delete q.parentCancel,b();else if(!f)b=Error("Cancel"),b.name="Cancel",e(b)}var h,f,m=[],n=
this,q={};Object.defineProperty(this,"_protected",{value:function(b){if(b!==a)throw Error("protected");return q}});this.resolve=function(j){f||b(j);return n};this.reject=function(b){f||e(b);return n};this.progress=function(b){f||m.forEach(function(f){if(f.progress)try{f.progress(b)}catch(j){}});return n.promise};this.cancel=function(){q.parentCancel?setTimeout(j,0):j();return n};this.then=function(b,j,h){b={resolve:b,reject:j,progress:h,deferred:new c};m.push(b);b.deferred._protected(a).parentCancel=
n.promise.cancel.bind(n);(f==="fulfilled"||f==="rejected")&&k(d);return b.deferred.promise};this.promise={then:n.then,cancel:n.cancel}}var a=[],l=!1;c.all=function(a,e){function b(b,j){m||(f[b]=j,--h===0&&n.resolve(f))}function j(f,j){if(!m){if(e)try{b(f,e(j));return}catch(h){j=h}n.reject(j)}}var h=a.length,f=[],m=!1,n=new c;n.then(void 0,function(){m=!0;a.forEach(function(b){b.cancel&&b.cancel()})});h===0?n.resolve(f):a.forEach(function(f,h){f.then(b.bind(void 0,h),j.bind(void 0,h))});return n.promise};
c.when=function(a,e,b,j){var h;if(!(a&&typeof a.then==="function"))h=new c,h.resolve(a),a=h.promise;return a.then(e,b,j)};return c});
define("orion/EventTarget",[],function(){function i(){this._namedListeners={}}i.prototype={dispatchEvent:function(i){if(!i.type)throw Error("unspecified type");var g=this._namedListeners[i.type];g&&g.forEach(function(c){try{typeof c==="function"?c(i):c.handleEvent(i)}catch(a){typeof console!=="undefined"&&console.log(a)}});return!i.defaultPrevented},addEventListener:function(i,g){if(typeof g==="function"||g.handleEvent)this._namedListeners[i]=this._namedListeners[i]||[],this._namedListeners[i].push(g)},
removeEventListener:function(i,g){var c=this._namedListeners[i];if(c)for(var a=0;a<c.length;a++)if(c[a]===g){c.length===1?delete this._namedListeners[i]:c.splice(a,1);break}}};i.prototype.constructor=i;i.attach=function(k){var g=new i;k.dispatchEvent=g.dispatchEvent.bind(g);k.addEventListener=g.addEventListener.bind(g);k.removeEventListener=g.removeEventListener.bind(g)};return i});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(i,k){function g(a,b,j){this._properties=j||{};this._properties["service.id"]=a;this._properties.objectClass=b;this._properties["service.names"]=b}function c(a,b,j){this._serviceId=a;this._serviceReference=b;this._internalRegistry=j}function a(a,b){function j(f){return function(){var j;try{if(!b())throw Error("Service was unregistered");var h=a[f].apply(a,Array.prototype.slice.call(arguments));if(h&&typeof h.then==="function")return h;
else j=new i,j.resolve(h)}catch(d){j=new i,j.reject(d)}return j.promise}}for(var h in a)typeof a[h]==="function"&&(this[h]=j(h))}function l(a,b){this.type=a;this.serviceReference=b}function d(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var a=this;this._internalRegistry={isRegistered:function(b){return a._entries[b]?!0:!1},unregisterService:function(b){var j=a._entries[b];if(!j)throw Error("Service has already been unregistered: "+b);var h=j.reference;a._serviceEventTarget.dispatchEvent(new l("unregistering",
h));a._entries[b]=null;h.getProperty("objectClass").forEach(function(b){for(var j=a._namedReferences[b],d=0;d<j.length;d++)if(j[d]===h){j.length===1?delete a._namedReferences[b]:j.splice(d,1);break}})},modifyService:function(b){var j=a._entries[b];if(!j)throw Error("Service not found while trying to send modified event: "+b);a._serviceEventTarget.dispatchEvent(new l("modified",j.reference))}}}g.prototype={getPropertyKeys:function(){var a=[],b;for(b in this._properties)this._properties.hasOwnProperty(b)&&
a.push(b);return a},getProperty:function(a){return this._properties[a]}};g.prototype.constructor=g;c.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("Service has already been unregistered: "+this._serviceId);return this._serviceReference},setProperties:function(a){var b=this._serviceReference._properties;this._serviceReference._properties=a||{};a["service.id"]=this._serviceId;
a.objectClass=b.objectClass;a["service.names"]=b["service.names"];this._internalRegistry.modifyService(this._serviceId)}};c.prototype.constructor=c;d.prototype={getService:function(a){var b;if(typeof a==="string")(a=this._namedReferences[a])&&a.some(function(j){b=this._entries[j.getProperty("service.id")].service;return!!b},this);else if(a=this._entries[a.getProperty("service.id")])b=a.service;return b||null},getServiceReferences:function(a){if(a)return this._namedReferences[a]?this._namedReferences[a]:
[];var b=[];this._entries.forEach(function(j){j&&b.push(j.reference)});return b},registerService:function(d,b,j){if(typeof b==="undefined"||b===null)throw Error("invalid service");typeof d==="string"?d=[d]:Array.isArray(d)||(d=[]);var h=this._entries.length,f=new g(h,d,j),m=this._namedReferences;d.forEach(function(b){m[b]=m[b]||[];m[b].push(f)});d=new a(b,this._internalRegistry.isRegistered.bind(null,h));this._entries.push({reference:f,service:d});d=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new l("registered",
f));return new c(h,f,d)},addEventListener:function(a,b){this._serviceEventTarget.addEventListener(a,b)},removeEventListener:function(a,b){this._serviceEventTarget.removeEventListener(a,b)}};d.prototype.constructor=d;return{ServiceRegistry:d}});
define("orion/xhr",["orion/Deferred"],function(i){function k(g,c,a,l){var d=typeof a.response!=="undefined"?a.response:a.responseText,e;try{e=a.status}catch(b){e=0}g={args:c,response:d,responseText:typeof d==="string"?d:null,status:e,url:g,xhr:a};if(typeof l!=="undefined")g.error=l;return g}return function(g,c,a){var a=a||{},l=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,d=new i,e=a.headers||{},b=a.log||!1,j;typeof e["X-Requested-With"]==="undefined"&&(e["X-Requested-With"]="XMLHttpRequest");
if(typeof a.data!=="undefined"&&(g==="POST"||g==="PUT"))j=a.data;var h=!1,f=!1;d.promise.then(void 0,function(b){h=!0;!f&&b instanceof Error&&b.name==="Cancel"&&l.abort()});l.onabort=function(){f=!0;if(!h){var b=Error("Cancel");b.name="Cancel";d.reject(b)}};l.onload=function(){var f=k(c,a,l);200<=l.status&&l.status<400?d.resolve(f):(d.reject(f),b&&typeof console!=="undefined"&&console.log(Error(l.statusText)))};l.onerror=function(){var f=k(c,a,l);d.reject(f);b&&typeof console!=="undefined"&&console.log(Error(l.statusText))};
l.onprogress=function(b){b.xhr=l;d.progress(b)};try{l.open(g,c,!0);if(typeof a.responseType==="string")l.responseType=a.responseType;if(typeof a.timeout==="number")if(typeof l.timeout==="number")l.timeout=a.timeout,l.addEventListener("timeout",function(){d.reject(k(c,a,l,"Timeout exceeded"))});else{var m=setTimeout(function(){d.reject(k(c,a,l,"Timeout exceeded"))},a.timeout);d.promise.then(clearTimeout.bind(null,m),clearTimeout.bind(null,m))}Object.keys(e).forEach(function(b){l.setRequestHeader(b,
e[b])});l.send(j||null)}catch(n){d.reject(k(c,a,l,n))}return d.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(i,k,g){function c(b,a){this._name=b;this._providers=a;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function a(b,a){return{get:function(f,d){if(a===0)return null;var e=localStorage.getItem(b+f);if(e===null)return null;e=JSON.parse(e);return d||a===-1||e._expires&&e._expires>(new Date).getTime()?(delete e._expires,e):null},set:function(f,d){if(a!==0){if(a!==-1)d._expires=(new Date).getTime()+
1E3*a;if(Object.keys(d).length===0)localStorage.removeItem(b+f);else{var e=JSON.stringify(d);localStorage.setItem(b+f,e);delete d._expires}}},remove:function(f){localStorage.removeItem(b+f)}}}function l(b){this._currentPromises={};this._cache=new a("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var a=b.getServiceReferences("orion.core.preference.provider");if(a.length>0)this._service=b.getService(a[0])}return!!this._service}}function d(b){this._location=
b;this._currentPromise=null;this._cache=new a("/orion/preferences/default",3600)}function e(){this._cache=new a("/orion/preferences/local",-1)}function b(b,a){this._userProvider=new l(b);this._localProvider=new e;a=a||"defaults.pref";a.indexOf("://")===-1&&(a=i.toUrl(a));this._defaultsProvider=new d(a);this._serviceRegistration=b.registerService("orion.core.preference",this)}c.prototype={_flush:function(){for(var b=[],a=0;a<this._stores.length;++a){var f=this._stores[a];this._dirty.indexOf(f)!==-1&&
b.push(this._providers[a].put(this._name,f));if(this._pendingDeletes[a]&&this._pendingDeletes[a].length>0){for(f=0;f<this._pendingDeletes[a].length;f++)b.push(this._providers[a].remove(this._name,this._pendingDeletes[a][f]));delete this._pendingDeletes[a]}}this._dirty=[];return k.all(b)},_scheduleFlush:function(b){b&&this._dirty.indexOf(b)===-1&&this._dirty.push(b);if(!this._flushPending)this._flushPending=!0,window.setTimeout(function(){if(this._flushPending)this._flushPending=!1,this._flush()}.bind(this),
0)},_getCached:function(){if(!this._cached){this._cached={};for(var b=0;b<this._stores.length;++b){var a=this._stores[b],f;for(f in a)a.hasOwnProperty(f)&&typeof this._cached[f]==="undefined"&&(this._cached[f]=a[f])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(b){return this._getCached()[b]},put:function(b,a){if(this._stores.length!==0){var f=this._stores[0];if(f[b]!==a)f[b]=a,this._cached=null,this._scheduleFlush(f)}},remove:function(b){for(var a=0;a<
this._stores.length;++a){var f=this._stores[a];if(f.hasOwnProperty(b))return delete f[b],this._pendingDeletes[a]||(this._pendingDeletes[a]=[]),this._pendingDeletes[a].push(b),this._cached=null,this._scheduleFlush(),!0}return!1},clear:function(){for(var b=0;b<this._stores.length;++b)this._stores[b]={},this._scheduleFlush(this._stores[b]);this._cached=null},sync:function(b){if(this._flushPending)return this._flushPending=!1,this._flush();for(var a=this,f=[],d=0;d<this._providers.length;++d)f.push(this._providers[d].get(this._name,
b).then(function(b){return function(f){a._stores[b]=f}}(d)));return k.all(f).then(function(){a._cached=null;a._getCached()})},flush:function(){this._flush()}};l.prototype={get:function(b,a){if(this._currentPromises[b])return this._currentPromises[b];var f=new k,d=null;a?this._cache.remove(b):d=this._cache.get(b);if(d!==null)f.resolve(d);else{this._currentPromises[b]=f;var e=this;this._service.get(b).then(function(a){e._cache.set(b,a);delete e._currentPromises[b];f.resolve(a)},function(a){a.status===
404?(a={},e._cache.set(b,a),delete e._currentPromises[b],f.resolve(a)):(delete e._currentPromises[b],f.resolve(e._cache.get(b,!0)||{}))})}return f},put:function(b,a){this._cache.set(b,a);return this._service.put(b,a)},remove:function(b,a){var f=this._cache.get(b);delete f[a];this._cache.set(b,f);return this._service.remove(b,a)}};d.prototype={get:function(b,a){if(this._currentPromise)return this._currentPromise;var f=new k,d=null;a?this._cache.remove(b):d=this._cache.get(b);if(d!==null)f.resolve(d);
else{this._currentPromise=f;var e=this;g("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(a){a=JSON.parse(a.response);e._cache.set(b,a[b]||{});e._currentPromise=null;f.resolve(a[b]||{})},function(a){a.xhr.status===401||a.xhr.status===404?(e._cache.set(b,{}),e._currentPromise=null,f.resolve({})):(e._currentPromise=null,a=e._cache.get(b,!0),a!==null?f.resolve(a[b]||{}):f.resolve({}))})}return f},put:function(){var b=new k;b.resolve();return b},remove:function(b,a){var f=
this._cache.get(b);delete f[a];this.put(b,f)}};e.prototype={get:function(b){var a=new k,b=this._cache.get(b);b!==null?a.resolve(b):a.resolve({});return a},put:function(b,a){var f=new k;this._cache.set(b,a);f.resolve();return f},remove:function(b,a){var f=this._cache.get(b);delete f[a];this.put(b,f)}};b.DEFAULT_SCOPE=1;b.LOCAL_SCOPE=2;b.USER_SCOPE=4;b.prototype={listenForChangedSettings:function(a,d,f){if(!d||typeof d!=="number"||d>7||d<1)f=d,d=b.DEFAULT_SCOPE|b.LOCAL_SCOPE|b.USER_SCOPE;window.addEventListener("storage",
f,!1);if((b.USER_SCOPE&d)!==0)return"/orion/preferences/user"+a;else if((b.LOCAL_SCOPE&d)!==0)return"/orion/preferences/local"+a;return"/orion/preferences/default"+a},getPreferences:function(a,d){if(!d||typeof d!=="number"||d>7||d<1)d=b.DEFAULT_SCOPE|b.LOCAL_SCOPE|b.USER_SCOPE;var f=[];b.USER_SCOPE&d&&this._userProvider.available()&&f.push(this._userProvider);b.LOCAL_SCOPE&d&&f.push(this._localProvider);b.DEFAULT_SCOPE&d&&f.push(this._defaultsProvider);var e=new c(a,f);return e.sync().then(function(){return e})},
getSetting:function(b,a,f){for(var d,e=0;e<b.length;e++)if(b[e].label===a)for(var c=0;c<b[e].data.length;c++)if(b[e].data[c].label===f){d=b[e].data[c].value;break}return d}};return{PreferencesService:b}});
(function(){function i(b){if(typeof b!=="string")throw new TypeError;}function k(b){return b?b.split("&"):[]}function g(b){return b.length===0?"":b.join("&")}function c(b){var a=/([^=]*)(?:=?)(.*)/.exec(b),b=a[1]?decodeURIComponent(a[1]):"",a=a[2]?decodeURIComponent(a[2]):"";return[b,a]}function a(b){var a=encodeURIComponent(b[0]);b[1]&&(a+="="+encodeURIComponent(b[1]));return a}function l(b,a){var f="",d=[],e=0;return{next:function(){if(f!==b.query)f=b.query,d=k(f);if(e<d.length){var j=c(d[e++]);
switch(a){case "keys":return j[0];case "values":return j[1];case "keys+values":return[j[0],j[1]];default:throw new TypeError;}}throw H;}}}function d(b){Object.defineProperty(this,"_url",{get:function(){return b._url}})}function e(b){return b?/[1-9]\d*$/.exec(b)[0]:""}function b(b){var a=[];b.split("/").forEach(function(b){b===".."?a.pop():b!=="."&&a.push(b)});return a.join("/")}function j(b){return b.replace(/\s/g,function(b){return"%"+b.charCodeAt(0).toString(16)})}function h(a,f){if(typeof a!==
"string")throw new TypeError;var a=j(a),d=q.exec(a);if(!d)return null;var h={};h.scheme=d[1]||"";if(h.scheme&&!o.test(h.scheme))return null;var c=d[2];if(c&&(c=p.exec(c),h.userinfo=c[1],h.host=c[2],h.port=c[3],h.port&&!r.test(h.port)))return null;h.path=d[3];h.query=d[4];h.fragment=d[5];if(!h.scheme&&f&&(h.scheme=f.scheme,!h.host&&f.host))h.userinfo=f.userinfo,h.host=f.host,h.port=f.port,h.pathRelative=!0;if(h.pathRelative)if(h.path){if(h.path[0]!=="/")d=/^(.*\/)[^\/]*$/.exec(f.path)[1]||"/",h.path=
d+h.path}else h.path=f.path;if(h.scheme)h.scheme=h.scheme.toLowerCase();if(h.port)h.port=e(h.port);if(h.host&&h.path)h.path=b(h.path);return h}function f(b,a){var f;if(a){a=a.href||a;f=h(a);if(!f||!f.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:f})}f=h(b,f);if(!f)throw new SyntaxError;Object.defineProperty(this,"_input",{value:b,writable:!0});Object.defineProperty(this,"_url",{value:f,writable:!0});var e=new d(this);Object.defineProperty(this,"query",{get:function(){return this._url?
e:null},enumerable:!0})}try{var m;if(typeof window.URL==="function"&&window.URL.length!==0&&(m=new window.URL("http://www.w3.org?q")).protocol==="http:"&&m.query)return}catch(n){}var q=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,p=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,o=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,r=/^\d*$/,w=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,s=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,y=/^([^?#\s]*)$/,t=/^([^\s]*)$/,z=/^\S*$/,v=/([^:]*):?(.*)/,H=typeof StopIteration!==
"undefined"?StopIteration:Error("Stop Iteration"),G={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(d.prototype,{get:{value:function(b){i(b);var a;k(this._url.query).some(function(f){f=c(f);if(f[0]===b)return a=f[1],!0});return a},enumerable:!0},set:{value:function(b,f){i(b);i(f);var d=k(this._url.query);d.some(function(h,e){var j=c(h);if(j[0]===b)return j[1]=f,d[e]=a(j),!0})||d.push(a([b,f]));this._url.query=g(d)},enumerable:!0},has:{value:function(b){i(b);
return k(this._url.query).some(function(a){if(c(a)[0]===b)return!0})},enumerable:!0},"delete":{value:function(b){i(b);var a=k(this._url.query),f=a.filter(function(a){return c(a)[0]!==b});return f.length!==a.length?(this._url.query=g(f),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(b,a){if(typeof b!=="function")throw new TypeError;var f=l(this._url,"keys+values");try{for(;;){var d=f.next();b.call(a,d[1],d[0],this)}}catch(h){if(h!==H)throw h;
}},enumerable:!0},keys:{value:function(){return l(this._url,"keys")},enumerable:!0},values:{value:function(){return l(this._url,"values")},enumerable:!0},items:{value:function(){return l(this._url,"keys+values")}},size:{get:function(){return k(this._url.query).length},enumerable:!0},getAll:{value:function(b){i(b);var a=[];k(this._url.query).forEach(function(f){f=c(f);f[0]===b&&a.push(f[1])});return a},enumerable:!0},append:{value:function(b,f){i(b);i(f);var d=k(this._url.query);d.push(a([b,f]));this._url.query=
g(d)},enumerable:!0}});Object.defineProperties(f.prototype,{href:{get:function(){var b;if(this._url){b=this._url;var a=b.scheme?b.scheme+":":"";b.host&&(a+="//",b.userinfo&&(a+=b.userinfo+"@"),a+=b.host,b.port&&(a+=":"+b.port));a+=b.path;b.query&&(a+="?"+b.query);b.fragment&&(a+="#"+b.fragment);b=a}else b=this._input;return b},set:function(b){i(b);this._input=b;this._url=h(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:
""},enumerable:!0},protocol:{get:function(){return this._url?this._url.scheme+":":":"},set:function(b){i(b);if(this._url&&(b=b.slice(-1)===":"?b.substring(0,b.length-1):b,b===""||o.test(b)))this._url.scheme=b.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(b){i(b);if(this._url)this._url.userinfo=b}},username:{get:function(){if(!this._url)return"";var b=v.exec(this._userinfo);return decodeURIComponent(b[1]||"")},set:function(b){i(b);if(this._url){var a=
v.exec(this._userinfo),b=[encodeURIComponent(b||"")];a[2]&&b.push(a[2]);this._userinfo=b.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var b=v.exec(this._userinfo);return decodeURIComponent(b[2]||"")},set:function(b){i(b);if(this._url){var a=[v.exec(this._userinfo)[1]||""];b&&a.push(encodeURIComponent(b));this._userinfo=a.join(":")}},enumerable:!0},host:{get:function(){var b="";this._url&&this._url.host&&(b+=this._url.host,this._url.port&&(b+=":"+this._url.port));return b},
set:function(b){i(b);if(this._url&&(b=s.exec(b)))this._url.host=b[1],this._url.port=e(b[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(b){i(b);if(this._url&&w.exec(b))this._url.host=b},enumerable:!0},port:{get:function(){var b=this._url?this._url.port||"":"";b&&b===G[this.protocol]&&(b="");return b},set:function(b){i(b);if(this._url&&r.exec(b))this._url.port=e(b)},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(a){i(a);
if(this._url&&y.exec(a))this._url.host&&a&&a[0]!=="/"&&(a="/"+a),this._url.path=a?b(a):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(b){i(b);if(this._url&&(b&&b[0]==="?"&&(b=b.substring(1)),t.exec(b)))this._url.query=b},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(b){i(b);if(this._url&&(b&&b[0]==="#"&&(b=b.substring(1)),z.exec(b)))this._url.fragment=b},enumerable:!0}});
if((m=window.URL||window.webkitURL)&&m.createObjectURL)Object.defineProperty(f,"createObjectURL",{value:m.createObjectURL.bind(m),enumerable:!1}),Object.defineProperty(f,"revokeObjectURL",{value:m.revokeObjectURL.bind(m),enumerable:!1});window.URL=f})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(i,k){function g(b,a){var d=Object.keys(b),h=Object.keys(a);if(d.length!==h.length)return!1;d.sort();h.sort();for(var e=0,j=d.length;e<j;e++){var c=d[e];if(c!==h[e])return!1;var g=b[c],c=a[c];if(g!==c&&JSON.stringify(g)!==JSON.stringify(c))return!1}return!0}function c(b){if(b.indexOf("://")===-1)try{return(new URL(b,location.href)).href}catch(a){}return b}function a(b){var a=null,d={key:function(d){return(a=
a||Object.keys(b))[d]},getItem:function(a){return b[a]},setItem:function(d,h){b[d]=h;a=null},removeItem:function(d){delete b[d];a=null},clear:function(){(a=a||Object.keys(b)).forEach(function(a){delete b[a]}.bind(this));a=null}};Object.defineProperty(d,"length",{get:function(){return(a=a||Object.keys(b)).length}});return d}function l(b,a){if(a&&a instanceof XMLHttpRequest){var d,h;try{d=a.status,h=a.statusText}catch(e){d=0,h=""}return{status:d||0,statusText:h}}return a}function d(b){var a=b?JSON.parse(JSON.stringify(b,
l)):b;if(b instanceof Error)a.__isError=!0,a.message=a.message||b.message,a.name=a.name||b.name;return a}function e(b,a){this.type=b;this.plugin=a}function b(b,a){this.__objectId=b;this.__methods=a}function j(a,h,j){function c(b){E&&j.postMessage(b,E)}function p(a){if(!E)return(new i).reject(Error("plugin not connected"));a.id=String(R++);var f=new i;L[a.id]=f;f.then(null,function(b){x==="active"&&b instanceof Error&&b.name==="Cancel"&&c({requestId:a.id,method:"cancel",params:b.message?[b.message]:
[]})});var d=Object.prototype.toString;a.params.forEach(function(h,j){if(d.call(h)==="[object Object]"&&!(h instanceof b)){var e,c;for(e in h)d.call(h[e])==="[object Function]"&&(c=c||[],c.push(e));if(c){var m=P++;M[m]=h;e=function(){delete M[m]};f.then(e,e);a.params[j]=new b(m,c)}}});j.postMessage(a,E);return f.promise}function o(b,a){b||b===0?c({id:b,result:null,error:a}):console.log(a)}function l(b,a,f,h){h.forEach(function(b,a){if(b&&typeof b.__objectId!=="undefined"){var f={};b.__methods.forEach(function(a){f[a]=
function(){return p({objectId:b.__objectId,method:a,params:Array.prototype.slice.call(arguments)})}});h[a]=f}});var j=typeof b===void 0?null:{id:b,result:null,error:null};try{var e=f.apply(a,h);if(j)e&&typeof e.then==="function"?(K[b]=e,e.then(function(a){delete K[b];j.result=a;c(j)},function(a){if(K[b])delete K[b],j.error=d(a),c(j)},function(){c({responseId:b,method:"progress",params:Array.prototype.slice.call(arguments)})})):(j.result=e,c(j))}catch(m){if(j)j.error=d(m),c(j)}}function w(b){try{if(b.method){var a=
b.method,f=b.params||[];if("serviceId"in b){var d=S[b.serviceId];d||o(b.id,"service not found");a in d?l(b.id,d,d[a],f):o(b.id,"method not found")}else if("objectId"in b){var h=M[b.objectId];h||o(b.id,"object not found");a in h?l(b.id,h,h[a],f):o(b.id,"method not found")}else if("requestId"in b){var e=K[b.requestId];e&&a==="cancel"&&e.cancel&&e.cancel.apply(e,f)}else if("responseId"in b){var c=L[b.responseId];c&&a==="progress"&&c.progress&&c.progress.apply(c,f)}else if("plugin"===b.method){var m=
b.params[0];N({headers:m.headers,services:m.services}).then(function(){A&&A.resolve(v)})}else if("timeout"===b.method)A&&A.reject(b.error);else throw Error("Bad method: "+b.method);}else{var p=L[String(b.id)];delete L[String(b.id)];if(b.error){var q=j.handleServiceError(v,b.error);p.reject(q)}else p.resolve(b.result)}}catch(g){console.log("Plugin._messageHandler "+g)}}function s(a){var f={};if(a.methods&&(a.methods.forEach(function(b){f[b]=function(){var f={serviceId:a.serviceId,method:b,params:Array.prototype.slice.call(arguments)};
return x==="active"?p(f):v.start({"transient":!0}).then(function(){return p(f)})}}),f.addEventListener&&f.removeEventListener)){var d=new k,h=P++;M[h]={handleEvent:d.dispatchEvent.bind(d)};var j=new b(h,["handleEvent"]),e=f.addEventListener;f.addEventListener=function(b,a){d._namedListeners[b]||e(b,j);d.addEventListener(b,a)};var c=f.removeEventListener;f.removeEventListener=function(b,a){d.removeEventListener(b,a);d._namedListeners[b]||c(b,j)}}return f}function y(b){var d=JSON.parse(JSON.stringify(b.properties));
d.__plugin__=a;b=b.names||b.type||[];Array.isArray(b)||(b=[b]);d.objectClass=b;return d}function t(b){var a=s(b),f=y(b),f=j.registerService(b.names||b.type,a,f);F[b.serviceId]={registration:f,proxy:a}}function z(){j.persist(a,{created:H,headers:G,services:D,autostart:u,lastModified:B})}var v=this,h=h||{},H=h.created||(new Date).getTime(),G=h.headers||{},D=h.services||[],u=h.autostart,B=h.lastModified||0,x="installed",C,A,E,O,F={},R=0,P=0,K={},L={},M={},S={},N;this._persist=z;this._resolve=function(){x=
"resolved";j.dispatchEvent(new e("resolved",v))};this._getAutostart=function(){return u};this._getCreated=function(){return H};this.getLocation=function(){return a};this.getHeaders=function(){return JSON.parse(JSON.stringify(G))};this.getName=function(){var b=this.getHeaders();return b?b.name||"":null};this.getVersion=function(){var b=this.getHeaders();return b?b.version||"0.0.0":null};this.getLastModified=function(){return B};this.getServiceReferences=function(){var b=[];Object.keys(F).forEach(function(a){b.push(F[a].registration.getReference())});
return b};this.setParent=function(b){return O!==b?(O=b,v.stop({"transient":!0}).then(function(){if("started"===u)return v.start({"transient":!0});else if("lazy"===u)return v.start({lazy:!0,"transient":!0})})):(new i).resolve()};this.getState=function(){return x};this.start=function(b){if(x==="uninstalled")return(new i).reject(Error("Plugin is uninstalled"));if(C)return C.promise.then(this.start.bind(this,b));if(x==="active")return(new i).resolve();if(!b||!b.transient){var d=b&&b.lazy?"lazy":"started";
d!==u&&(u=d,z())}d=j.getState();if(d!=="starting"&&d!=="active")return b.transient?(new i).reject(Error("start transient error")):(new i).resolve();if(x==="installed")try{this._resolve()}catch(h){return(new i).reject(h)}x==="resolved"&&D.forEach(function(b){t(b)});if(b&&b.lazy)return x!=="starting"&&(x="starting",j.dispatchEvent(new e("lazy activation",v))),(new i).resolve();var c=new i;C=c;x="starting";j.dispatchEvent(new e("starting",v));A=new i;E=j.connect(a,w,O);A.then(function(){A=null;x="active";
j.dispatchEvent(new e("started",v));C=null;c.resolve()},function(){A=null;x="stopping";j.dispatchEvent(new e("stopping",v));Object.keys(F).forEach(function(b){F[b].registration.unregister();delete F[b]});j.disconnect(E);E=null;x="resolved";C=null;j.dispatchEvent(new e("stopped",v));c.reject(Error("plugin activation error"))});return c.promise};this.stop=function(b){if(x==="uninstalled")return(new i).reject(Error("Plugin is uninstalled"));if(C)return C.promise.then(this.stop.bind(this,b));if((!b||
!b.transient)&&"stopped"!==u)u="stopped",z();if(x!=="active"&&x!=="starting")return(new i).resolve();C=b=new i;x="stopping";j.dispatchEvent(new e("stopping",v));Object.keys(F).forEach(function(b){F[b].registration.unregister();delete F[b]});E&&(j.disconnect(E),E=null);x="resolved";C=null;j.dispatchEvent(new e("stopped",v));b.resolve();return b.promise};N=function(b){if(x==="uninstalled")return(new i).reject(Error("Plugin is uninstalled"));if(!b)return B===0&&(B=(new Date).getTime(),z()),j.loadManifest(a).then(N);
var d=G,h=D,c=u;G=b.headers||{};D=b.services||{};u=b.autostart||u;b.lastModified?B=b.lastModified:(B=(new Date).getTime(),z());if(g(G,d)&&g(D,h)&&u===c)return(new i).resolve();if(x==="active"||x==="starting"){var m=[];Object.keys(D).forEach(function(b){var a=D[b];m.push(b);var f=F[b];if(f){if(g(a.methods,Object.keys(f.proxy))){var b=y(a),d=f.registration.getReference(),h={};d.getPropertyKeys().forEach(function(b){h[b]=d.getProperty(b)});g(b,h)||f.registration.setProperties(b);return}f.registration.unregister();
delete F[b]}t(a)});Object.keys(F).forEach(function(b){m.indexOf(b)===-1&&(F[b].registration.unregister(),delete F[b])})}x==="active"&&(j.disconnect(E),A=new i,E=j.connect(a,w,O),A.then(function(){A=null},function(){A=null;x="stopping";j.dispatchEvent(new e("stopping"),v);Object.keys(F).forEach(function(b){F[b].registration.unregister();delete F[b]});j.disconnect(E);E=null;x="resolved";j.dispatchEvent(new e("stopped",v))}));return(new i).resolve()};this.update=function(b){return N(b).then(function(){j.dispatchEvent(new e("updated",
v))})};this.uninstall=function(){if(x==="uninstalled")return(new i).reject(Error("Plugin is uninstalled"));if(x==="active"||x==="starting"||x==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));j.removePlugin(this);x="uninstalled";j.dispatchEvent(new e("uninstalled",v));return(new i).resolve()}}var h=/^http[s]?/i;return{Plugin:j,PluginRegistry:function(b,d){function n(b){var a=b.source;l.some(function(f){if(a===f.target){try{var d;if(typeof f.useStructuredClone===
"undefined"){var h=typeof b.data!=="string";d=h?b.data:JSON.parse(b.data);f.useStructuredClone=h}else d=f.useStructuredClone?b.data:JSON.parse(b.data);f.handler(d)}catch(j){}return!0}})}var d=d||{},q=d.storage||localStorage;q.getItem||(q=a(q));var p="installed",o,g=[],l=[],s=new k,y={},t={registerService:b.registerService.bind(b),connect:function(b,a,f,d){function h(b){b=Error(b);b.name="timeout";a({method:"timeout",error:b})}var j={handler:a,url:b},e=setTimeout(h.bind(null,"Load timeout for: "+b),
d||15E3),c=document.createElement("iframe");c.name=b+"_"+(new Date).getTime();c.src=b;c.onload=function(){clearTimeout(e);e=setTimeout(h.bind(null,"Plugin handshake timeout for: "+b),5E3)};c.sandbox="allow-scripts allow-same-origin";c.style.width=c.style.height="100%";c.frameBorder=0;(f||o).appendChild(c);j.target=c.contentWindow;j.close=function(){clearTimeout(e);if(c){var b=c.parentNode;b&&b.removeChild(c);c=null}};l.push(j);return j},disconnect:function(b){for(var a=0;a<l.length;a++)if(b===l[a]){l.splice(a,
1);try{b.close()}catch(f){}break}},removePlugin:function(b){for(var a=0;a<g.length;a++)if(b===g[a]){g.splice(a,1);break}q.removeItem("plugin."+b.getLocation())},persist:function(b,a){q.setItem("plugin."+b,JSON.stringify(a))},postMessage:function(b,a){a.target.postMessage(a.useStructuredClone?b:JSON.stringify(b),a.url)},dispatchEvent:function(b){try{s.dispatchEvent(b)}catch(a){console&&console.log("PluginRegistry.dispatchEvent "+a)}},loadManifest:function(b){var a=new i,f=t.connect(b,function(b){f&&
b.method&&("manifest"===b.method||"plugin"===b.method?(b=b.params[0],t.disconnect(f),f=null,a.resolve(b)):"timeout"===b.method&&(t.disconnect(f),f=null,a.reject(b.error)))});return a.promise},getState:function(){return p},handleServiceError:function(b,a){if(a&&a.status===401){var f=b.getHeaders(),d=b.getName()||b.getLocation(),j=document.createElement("span");j.appendChild(document.createTextNode("Authentication required for: "+d+"."));if(f.login)j.appendChild(document.createTextNode(" ")),d=document.createElement("a"),
d.target="_blank",d.textContent="Login",d.href=f.login,h.test(d.href)?(j.appendChild(d),j.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+f.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(j)}}if(a.__isError){var e=a,a=Error(e.message);Object.keys(e).forEach(function(b){a[b]=e[b]});delete a.__isError}return a}};this.getLocation=function(){return"System"};this.getHeaders=function(){return{}};this.getName=function(){return"System"};
this.getVersion=function(){return"0.0.0"};this.getLastModified=function(){return 0};this.getState=t.getState;this.init=function(){if(!(p==="starting"||p==="active"||p==="stopping")){addEventListener("message",n,!1);for(var b=[],a=0,f=q.length;a<f;a++)b.push(q.key(a));b.forEach(function(b){if(b.indexOf("plugin.")===0){var a=b.substring(7),b=JSON.parse(q.getItem(b));b.created&&g.push(new j(a,b,t))}});g.sort(function(b,a){return b._getCreated()<a._getCreated()?-1:1});if(d.parent)o=d.parent;else{o=document.createElement("div");
if(!d.visible)o.style.display="none",o.style.visibility="hidden";document.body.appendChild(o)}d.plugins&&Object.keys(d.plugins).forEach(function(b){b=c(b);if(!this.getPlugin(b)){var a=d.plugins[b];typeof a!=="object"&&(a={});a.autostart=a.autostart||d.defaultAutostart||"lazy";g.push(new j(b,a,t))}}.bind(this));p="starting"}};this.start=function(){p!=="starting"&&this.init();if(p!=="starting")return(new i).reject("Cannot start framework. Framework is already "+p+".");var b=[],a=(new Date).getTime();
g.forEach(function(f){var d=f._getAutostart();f.getLastModified()===0?b.push(f.update().then(function(){if("started"===d)return f.start({"transient":!0});if("lazy"===d)return f.start({lazy:!0,"transient":!0});f._resolve()})):"started"===d?b.push(f.start({"transient":!0})):"lazy"===d?(b.push(f.start({lazy:!0,"transient":!0})),a>f.getLastModified()+864E5&&f.update()):f._resolve()});return i.all(b,function(b){console.log("PluginRegistry.stop "+b)}).then(function(){p="active"})};this.stop=function(){if(p!==
"starting"&&p!=="active")return(new i).reject("Cannot stop registry. Registry is already "+p+".");p="stopping";var b=[];g.forEach(function(a){b.push(a.stop({"transient":!0}))});return i.all(b,function(b){console.log("PluginRegistry.stop "+b)}).then(function(){if(!d.parent){var b=o.parentNode;b&&b.removeChild(o)}o=null;removeEventListener("message",n);p="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new i).reject("Cannot uninstall registry")};
this.installPlugin=function(b,a){var b=c(b),f=this.getPlugin(b);if(f)return(new i).resolve(f);if(y[b])return y[b];if(a)return f=new j(b,a,t),g.push(f),f._persist(),t.dispatchEvent(new e("installed",f)),(new i).resolve(f);var d=t.loadManifest(b).then(function(a){f=new j(b,a,t);g.push(f);f._persist();delete y[b];t.dispatchEvent(new e("installed",f));return f},function(a){delete y[b];throw a;});return y[b]=d};this.getPlugins=function(){return g.slice()};this.getPlugin=function(b){var a=null,b=c(b);g.some(function(f){if(b===
f.getLocation())return a=f,!0});return a};this.addEventListener=s.addEventListener.bind(s);this.removeEventListener=s.removeEventListener.bind(s);this.resolvePlugins=function(){var b=!0;g.forEach(function(a){b=b&&a._resolve()});return b}}}});
define("orion/serviceTracker",[],function(){function i(c,a){function l(a){var f=a.getProperty("service.id"),d=this.addingService(a);d&&(e[f]=a,b[f]=d)}function d(a){var f=a.getProperty("service.id"),d=b[f];delete e[f];delete b[f];this.removedService(a,d)}this.serviceRegistry=c;var e={},b={},j=k,h,f;this.close=function(){if(j!==g)throw"Already closed";j=k;c.removeEventListener("registered",h);c.removeEventListener("unregistering",f);f=h=null;var b=this;this.getServiceReferences().forEach(function(a){d.call(b,
a)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){var b=Object.keys(e);return!b.length?null:b.map(function(b){return e[b]})};this.open=function(){if(j!==k)throw"Already open";j=g;var b=this;h=function(f){if(f.serviceReference.getProperty("objectClass").indexOf(a)!==-1&&(l.call(b,f.serviceReference),typeof b.onServiceAdded==="function"))return b.onServiceAdded(f.serviceReference,b.serviceRegistry.getService(f.serviceReference))};f=function(f){f.serviceReference.getProperty("objectClass").indexOf(a)!==
-1&&d.call(b,f.serviceReference)};c.addEventListener("registered",h);c.addEventListener("unregistering",f);c.getServiceReferences(a).forEach(function(a){l.call(b,a);if(typeof b.onServiceAdded==="function")return b.onServiceAdded(a,c.getService(a))});if(typeof this.onOpen==="function")this.onOpen()}}var k=0,g=1;i.prototype={addingService:function(c){return this.serviceRegistry.getService(c)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return i});
define("orion/objects",[],function(){function i(i){for(var g=1;g<arguments.length;g++){var c=arguments[g],a;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(i[a]=c[a])}return i}return{clone:function(k){if(Array.isArray(k))return Array.prototype.slice.call(k);var g=Object.create(Object.getPrototypeOf(k));i(g,k);return g},mixin:i,toArray:function(i){return Array.isArray(i)?i:[i]}}});
define("orion/config",["orion/Deferred","orion/serviceTracker","orion/objects"],function(i,k,g){var c,a,l,d,e,b="pid";c=function(a,f,d){function j(b,a,d){a.forEach(function(h,j){try{var e=b[j].getProperty("__plugin__"),c=e&&f.getPlugin(e);(!e||c&&c.getState()==="active")&&a[j].updated(d)}catch(o){typeof console!=="undefined"&&console.log(o)}})}k.call(this,a,"orion.cm.managedservice");var e={},c={},o=function(f){var j=[];f.plugin.getServiceReferences().forEach(function(f){if(f.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var e=f.getProperty(b),f=a.getService(f);e&&f&&(e=(e=d._find(e))&&e.getProperties(),j.push(f.updated(e)))}});return i.all(j)};this.addingService=function(f){var d=f.getProperty(b),j=a.getService(f);if(!d||!j)return null;e[d]||(e[d]=[]);c[d]||(c[d]=[]);e[d].push(f);c[d].push(j);return j};this.onServiceAdded=function(a,f){var h=a.getProperty(b),h=d._find(h);j([a],[f],h&&h.getProperties())};this.onOpen=function(){f.addEventListener("started",o)};this.onClose=function(){f.removeEventListener("started",
o)};this.notifyUpdated=function(b){var a=b.getPid();j(e[a]||[],c[a]||[],b.getProperties())};this.notifyDeleted=function(b){b=b.getPid();j(e[b]||[],c[b]||[],null)};this.removedService=function(a,f){var d=a.getProperty(b),h=e[d],j=c[d];h.length>1?h.splice(h.indexOf(a),1):delete e[d];j.length>1?j.splice(j.indexOf(f),1):delete c[d]}};a=function(){function b(a,j,h){this.store=new l(this,h);this.configAdmin=new d(this,this.store);this.tracker=new c(a,j,this.store)}b.prototype={getConfigurationAdmin:function(){var b=
this;return this.configAdmin._init().then(function(a){b.tracker.open();return a})},notifyDeleted:function(b){this.tracker.notifyDeleted(b)},notifyUpdated:function(b){this.tracker.notifyUpdated(b)}};return b}();d=function(){function b(a,d){this.factory=a;this.store=d}b.prototype={_init:function(){var b=this;return this.store._init().then(function(){return b})},getConfiguration:function(b){return this.store.get(b)},listConfigurations:function(){return this.store.list()}};return b}();var j="/cm/configurations";
l=function(){function a(f,d){this.factory=f;this.prefsService=d;this.configs=Object.create(null);this.pref=null;var h=this;this.initPromise=this.prefsService.getPreferences(j).then(function(a){h.pref=a;a.keys().forEach(function(f){if(!h.configs[f]){var d=a.get(f);typeof d==="object"&&d!==null&&Object.keys(d).length>0&&(d[b]=f,h.configs[f]=new e(h.factory,h,d))}})})}a.prototype={_init:function(){return this.initPromise},_find:function(b){return this.configs[b]||null},get:function(b){var a=this._find(b);
a||(a=new e(this.factory,this,b),this.configs[b]=a);return a},list:function(){var b=this,a=[];this.pref.keys().forEach(function(d){(d=b._find(d))&&d.getProperties()!==null&&a.push(d)});return a},remove:function(b){this.pref.remove(b);delete this.configs[b]},save:function(b,a){this.pref.put(b,a.getProperties(!0)||{})}};return a}();e=function(){function a(f,d){d=g.clone(d);delete d[b];f.properties=d}function f(f,d,j){this.factory=f;this.store=d;if(j!==null&&typeof j==="object")this.pid=j[b],a(this,
j);else if(typeof j==="string")this.pid=j,this.properties=null;else throw Error("Invalid pid/properties "+j);}f.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(a){this._checkRemoved();var f=null;if(this.properties&&(f=g.clone(this.properties),!a))f[b]=this.pid;return f},remove:function(){this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=
!0},update:function(b){this._checkRemoved();a(this,b);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return f}();return{ConfigurationAdminFactory:a}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(i,k,g,c,a,l){var d;return{startup:function(){if(d)return d;d=new k;var e=new g.ServiceRegistry,b=new c.PreferencesService(e);return b.getPreferences("/plugins").then(function(j){var h={plugins:{}};j.keys().forEach(function(b){var a=i.toUrl(b);h.plugins[a]=j[b]});var f=new a.PluginRegistry(e,h);return f.start().then(function(){if(e.getServiceReferences("orion.core.preference.provider").length>
0)return b.getPreferences("/plugins",b.USER_SCOPE).then(function(b){var a=[];b.keys().forEach(function(b){b=i.toUrl(b);f.getPlugin(b)||a.push(f.installPlugin(b,{autostart:"lazy"}).then(function(b){return b.update().then(function(){return b.start({lazy:!0})})}))});return k.all(a,function(b){console.log(b)})})}).then(function(){return(new l.ConfigurationAdminFactory(e,f,b)).getConfigurationAdmin().then(e.registerService.bind(e,"orion.cm.configadmin"))}).then(function(){var b=e.getService("orion.core.auth");
if(b){var a=b.getUser().then(function(a){if(a)localStorage.setItem("lastLogin",(new Date).getTime());else return b.getAuthForm(window.location.href).then(function(b){setTimeout(function(){window.location=b},0)})}),f=localStorage.getItem("lastLogin");if(!f||f<(new Date).getTime()-9E5)return a}}).then(function(){var a={serviceRegistry:e,preferences:b,pluginRegistry:f};d.resolve(a);return a})})}}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell",ShellLinkWorkspace:"Workspace Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor",EditorRelatedLink:"Show Current Folder",EditorRelatedLinkParent:"Show Enclosing Folder",EditorLinkWorkspace:"Show Workspace",EditorRelatedLinkProj:"Show Project","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","Orion Image Viewer":"Orion Image Viewer","Orion Markdown Viewer":"Orion Markdown Viewer","Orion JSON Editor":"Orion JSON Editor",
"View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion.","Show a list of all the keybindings on this page":"Show a list of all the keybindings on this page","Show Keys":"Show Keys","Hide or show the page banner and footer":"Hide or show the page banner and footer","Toggle banner and footer":"Toggle banner and footer","Choose a file by name and open an editor on it":"Choose a file by name and open an editor on it",
"Find File Named...":"Find File Named...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown","Unknown item":"Unknown item","Can't search: no search service is available":"Can't search: no search service is available","could not find banner parent, id was ":"could not find banner parent, id was ",
Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy","Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"I20140226-2325","LOG: ":"LOG: ",View:"View","no parent":"no parent","no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ","Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?",
Operations:"Operations","Operations running":"Operations running","Some operations finished with warning":"Some operations finished with warning","Some operations finished with error":"Some operations finished with error","no service registry":"no service registry",Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Saved searches":"Saved searches","Recent searches":"Recent searches","Regular expression":"Regular expression",
"Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations","Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site",
"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plugin","Generate a sample plugin for integrating with Orion.":"Generate a sample plugin for integrating with Orion.",Browser:"Web Browser",OutlineProgress:"Getting outline for ${0} from ${1}",UnknownError:"An unknown error occurred.",UnknownWarning:"An unknown warning occurred.",Filter:"Filter (* = any string, ? = any character)",
"To view the browser's context menu, trigger the context menu again.":"To view the browser's context menu, trigger the context menu again.",Edit:"Edit",CentralNavTooltip:"Toggle Navigation Menu"});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(i,k){var g={root:k};Object.keys(i).forEach(function(c){typeof g[c]==="undefined"&&(g[c]=i[c])});return g});
define("orion/util",[],function(){var i=navigator.userAgent,k=i.indexOf("MSIE")!==-1||i.indexOf("Trident")!==-1?document.documentMode:void 0,g=parseFloat(i.split("Firefox/")[1]||i.split("Minefield/")[1])||void 0,c=i.indexOf("Opera")!==-1?parseFloat(i.split("Version/")[1]):void 0,a=parseFloat(i.split("Chrome/")[1])||void 0,l=i.indexOf("Safari")!==-1&&!a,d=parseFloat(i.split("WebKit/")[1])||void 0,e=i.indexOf("Android")!==-1,b=i.indexOf("iPad")!==-1,i=i.indexOf("iPhone")!==-1,j=b||i,h=navigator.platform.indexOf("Mac")!==
-1,f=navigator.platform.indexOf("Win")!==-1,m=navigator.platform.indexOf("Linux")!==-1,n="ontouchstart"in document.createElement("input");return{formatMessage:function(b){var a=arguments;return b.replace(/\$\{([^\}]+)\}/g,function(b,f){return a[(f<<0)+1]})},createElement:function(b,a){return b.createElementNS?b.createElementNS("http://www.w3.org/1999/xhtml",a):b.createElement(a)},isIE:k,isFirefox:g,isOpera:c,isChrome:a,isSafari:l,isWebkit:d,isAndroid:e,isIPad:b,isIPhone:i,isIOS:j,isMac:h,isWindows:f,
isLinux:m,isTouch:n,platformDelimiter:f?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(i){function k(b,a){a||(a=document);return a.querySelectorAll(b)}function g(b){var a=b.tabIndex;a===0&&i.isIE&&!{a:!0,body:!0,button:!0,frame:!0,iframe:!0,img:!0,input:!0,isindex:!0,object:!0,select:!0,textarea:!0}[b.nodeName.toLowerCase()]&&!b.attributes.tabIndex&&(a=-1);return a}function c(b){if(g(b)>=0)return b;if(b.hasChildNodes())for(var a=0;a<b.childNodes.length;a++){var d=c(b.childNodes[a]);if(d)return d}return null}function a(b){if(g(b)>=
0)return b;if(b.hasChildNodes())for(var d=b.childNodes.length-1;d>=0;d--){var h=a(b.childNodes[d]);if(h)return h}return null}function l(b,a){if(b.nodeType===3){var h=d.exec(b.nodeValue);h&&h.length>1&&a(b,h)}if(b.hasChildNodes())for(h=0;h<b.childNodes.length;h++)l(b.childNodes[h],a)}var d=/\$\{([^\}]+)\}/,e=null;return{$:function(b,a){a||(a=document);return a.querySelector(b)},$$:k,$$array:function(b,a){return Array.prototype.slice.call(k(b,a))},node:function(b){var a=b;typeof b==="string"&&(a=document.getElementById(b));
return a},contains:function(b,a){if(!b||!a)return!1;if(b===a)return!0;var d=b.compareDocumentPosition(a);return Boolean(d&16)},bounds:function(b){b=b.getBoundingClientRect();return{left:b.left+document.documentElement.scrollLeft,top:b.top+document.documentElement.scrollTop,width:b.width,height:b.height}},empty:function(b){for(;b.hasChildNodes();)b.removeChild(b.firstChild)},firstTabbable:c,lastTabbable:a,stop:function(b){if(window.document.all)b.keyCode=0;b.preventDefault&&(b.preventDefault(),b.stopPropagation())},
processTextNodes:function(b,a){l(b,function(b,f){b.parentNode.replaceChild(document.createTextNode(a[f[1]]||f[1]),b)})},processDOMNodes:function(b,a){l(b,function(b,f){var d=a[f[1]];if(d){var e=document.createRange(),c=f.index;e.setStart(b,c);e.setEnd(b,c+f[0].length);e.deleteContents();e.insertNode(d)}})},addAutoDismiss:function(b,a){function d(b){e.forEach(function(a){var d=!1,e=a.excludeNodes.some(function(a){return document.body.contains(a)?(d=!0,a.contains(b.target)):!1});if(d&&!e)try{a.dismiss(b)}catch(h){typeof console!==
"undefined"&&console&&console.error(h&&h.message)}});e=e.filter(function(b){return b.excludeNodes.some(function(b){return document.body.contains(b)})})}e===null&&(e=[],document.addEventListener("click",d,!0),i.isIOS&&document.addEventListener("touchend",function(b){function a(){b.target.removeEventListener("click",a)}b.touches.length===0&&b.target.addEventListener("click",a)},!1));e.push({excludeNodes:b,dismiss:a})},setFramesEnabled:function(b){for(var a=document.getElementsByTagName("iframe"),d=
0;d<a.length;d++)a[d].parentNode.style.pointerEvents=b?"":"none"},removeAutoDismiss:function(b){e=e.filter(function(a){return b!==a.dismiss})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("text",["module"],function(i){var k,g,c=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],a=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,l=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,d=typeof location!=="undefined"&&location.href,e=d&&location.protocol&&location.protocol.replace(/\:/,""),b=d&&location.hostname,j=d&&(location.port||void 0),h=[],f=i.config&&i.config()||{};k={version:"2.0.5",strip:function(b){if(b){var b=b.replace(a,""),d=b.match(l);d&&(b=d[1])}else b="";return b},
jsEscape:function(b){return b.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:f.createXhr||function(){var b,a,d;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(a=0;a<3;a+=1){d=c[a];try{b=new ActiveXObject(d)}catch(f){}if(b){c=[d];break}}return b},parseName:function(b){var a,
d,f=!1,e=b.indexOf(".");a=b.indexOf("./")===0||b.indexOf("../")===0;e!==-1&&(!a||e>1)?(a=b.substring(0,e),d=b.substring(e+1,b.length)):a=b;b=d||a;e=b.indexOf("!");e!==-1&&(f=b.substring(e+1)==="strip",b=b.substring(0,e),d?d=b:a=b);return{moduleName:a,ext:d,strip:f}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(b,a,d,f){var e,h;e=k.xdRegExp.exec(b);if(!e)return!0;b=e[2];e=e[3];e=e.split(":");h=e[1];e=e[0];return(!b||b===a)&&(!e||e.toLowerCase()===d.toLowerCase())&&(!h&&!e||h===f)},finishLoad:function(b,
a,d,e){d=a?k.strip(d):d;f.isBuild&&(h[b]=d);e(d)},load:function(a,h,c,p){if(p.isBuild&&!p.inlineText)c();else{f.isBuild=p.isBuild;var o=k.parseName(a),p=o.moduleName+(o.ext?"."+o.ext:""),g=h.toUrl(p),l=f.useXhr||k.useXhr;!d||l(g,e,b,j)?k.get(g,function(b){k.finishLoad(a,o.strip,b,c)},function(b){c.error&&c.error(b)}):h([p],function(b){k.finishLoad(o.moduleName+"."+o.ext,o.strip,b,c)})}},write:function(b,a,d){if(h.hasOwnProperty(a)){var f=k.jsEscape(h[a]);d.asModule(b+"!"+a,"define(function () { return '"+
f+"';});\n")}},writeFile:function(b,a,d,f,e){var a=k.parseName(a),h=a.ext?"."+a.ext:"",j=a.moduleName+h,c=d.toUrl(a.moduleName+h)+".js";k.load(j,d,function(){var a=function(b){return f(c,b)};a.asModule=function(b,a){return f.asModule(b,c,a)};k.write(b,j,a,e)},e)}};if(f.env==="node"||!f.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)g=require.nodeRequire("fs"),k.get=function(b,a){var d=g.readFileSync(b,"utf8");d.indexOf("\ufeff")===0&&(d=d.substring(1));a(d)};else if(f.env===
"xhr"||!f.env&&k.createXhr())k.get=function(b,a,d,e){var h=k.createXhr(),j;h.open("GET",b,!0);if(e)for(j in e)e.hasOwnProperty(j)&&h.setRequestHeader(j.toLowerCase(),e[j]);if(f.onXhr)f.onXhr(h,b);h.onreadystatechange=function(){var f;if(h.readyState===4)f=h.status,f>399&&f<600?(f=Error(b+" HTTP status: "+f),f.xhr=h,d(f)):a(h.responseText)};h.send(null)};else if(f.env==="rhino"||!f.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")k.get=function(b,a){var d,f,e=new java.io.File(b),h=java.lang.System.getProperty("line.separator"),
e=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(e),"utf-8")),j="";try{d=new java.lang.StringBuffer;(f=e.readLine())&&f.length()&&f.charAt(0)===65279&&(f=f.substring(1));for(f!==null&&d.append(f);(f=e.readLine())!==null;)d.append(h),d.append(f);j=String(d.toString())}finally{e.close()}a(j)};return k});define("text!orion/banner/slideout.html",[],function(){return'<div id="slideContainer" class="slideParameters slideContainer">\n\t<span id="pageCommandParameters" class="layoutLeft parameters"></span>\n\t<span id="pageCommandDismiss" class="layoutRight parametersDismiss"></span>\n</div>'});
define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(i,k,g){return{slideoutHTMLFragment:function(c){var a=document.createElement("div");a.innerHTML=g;var l=k.$("#slideContainer",a);l.id=c+l.id;l=k.$("#pageCommandParameters",a);l.id=c+l.id;l=k.$("#pageCommandDismiss",a);l.id=c+l.id;return a.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(i){function k(c,a,g,d,e,b){this.type=b||"keydown";this.keyCode=typeof c==="string"&&this.type==="keydown"?c.toUpperCase().charCodeAt(0):c;this.mod1=a!==void 0&&a!==null?a:!1;this.mod2=g!==void 0&&g!==null?g:!1;this.mod3=d!==void 0&&d!==null?d:!1;this.mod4=e!==void 0&&e!==null?e:!1}function g(c){this.keys=c}k.prototype={getKeys:function(){return[this]},match:function(c,a){if(a!==void 0){if(a!==0)return!1}else if(c instanceof Array){if(c.length>1)return!1;
c=c[0]}return c.type!==this.type?!1:this.keyCode===c.keyCode||this.keyCode===String.fromCharCode(i.isOpera?c.which:c.charCode!==void 0?c.charCode:c.keyCode)?this.mod1!==(i.isMac?c.metaKey:c.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==c.shiftKey?!1:this.mod3!==c.altKey?!1:i.isMac&&this.mod4!==c.ctrlKey?!1:!0:!1},equals:function(c){return!c?!1:this.keyCode!==c.keyCode?!1:this.mod1!==c.mod1?!1:this.mod2!==c.mod2?!1:this.mod3!==c.mod3?!1:this.mod4!==c.mod4?!1:this.type!==c.type?!1:!0}};g.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(c,a){var g=this.keys;if(a!==void 0)return a>g.length?!1:g[a].match(c)?a===g.length-1?!0:a+1:!1;else{c instanceof Array||(c=[c]);if(c.length>g.length)return!1;var d;for(d=0;d<c.length;d++)if(!g[d].match(c[d]))return!1;return d===g.length?!0:d}},equals:function(c){if(!c.keys)return!1;if(c.keys.length!==this.keys.length)return!1;for(var a=0;a<c.keys.length;a++)if(!c.keys[a].equals(this.keys[a]))return!1;return!0}};return{KeyBinding:k,KeyStroke:k,
KeySequence:g}});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(i,k,g){function c(a){g.attach(this);this._init(a)}c.prototype={_init:function(a){this._dropdownNode=k.node(a.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=a.populate;this._selectionClass=a.selectionClass;this._parentDropdown=a.parentDropdown;this._positioningNode=a.positioningNode;if(!this._parentDropdown)for(var c=this._dropdownNode.parentNode;c&&document!==c;){if(c.classList&&
c.classList.contains("dropdownMenu")){this._parentDropdown=c.dropdown;break}c=c.parentNode}this._triggerNode=a.triggerNode?a.triggerNode:k.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!a.skipTriggerEventListeners){var d=this;this._triggerNode.addEventListener("click",function(a){d.toggle(a)&&k.stop(a)},!1);this._triggerNode.tagName.toLowerCase()==="span"&&this._triggerNode.addEventListener("keydown",function(a){if(a.keyCode===
k.KEY.ENTER||a.keyCode===k.KEY.SPACE)d.toggle(),k.stop(a)},!1)}this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(a){var c=this;a.addEventListener("click",function(a){c.toggle(a)&&k.stop(a)},!1)},toggle:function(a){return this.isVisible()?this.close():this.open(a)},isVisible:function(){return this._isVisible},open:function(a){var c=!1;if(!this.isVisible()){this.dispatchEvent({type:"triggered",dropdown:this,event:a});k.setFramesEnabled(!1);this._populate&&
(this.empty(),this._populate(this._dropdownNode));var d=this.getItems();if(d.length>0){if(!this._hookedAutoDismiss)this._boundAutoDismiss?k.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),c=k.$$array(".dropdownSubMenu",this._dropdownNode),k.addAutoDismiss([this._triggerNode].concat(c),this._boundAutoDismiss),this._hookedAutoDismiss=!0;this._triggerNode.classList.add("dropdownTriggerOpen");this._selectionClass&&this._triggerNode.classList.add(this._selectionClass);
this._dropdownNode.classList.add("dropdownMenuOpen");this._isVisible=!0;this._positionDropdown(a);d[0].focus();c=!0;this._parentDropdown&&this._parentDropdown.submenuOpen(this)}}return c},_autoDismiss:function(a){if(this.close(!1)&&this._dropdownNode.contains(a.target))for(a=this._parentDropdown;a;)a.close(!1),a=a._parentDropdown},_positionDropdown:function(){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+
"px";else{var a=k.bounds(this._dropdownNode),c=k.bounds(document.body);if(a.left+a.width>c.left+c.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-a.width+"px";else{var d=k.bounds(this._boundingNode(this._triggerNode)),e=k.bounds(this._triggerNode);this._dropdownNode.style.left=e.left-d.left-a.width+e.width+"px"}a=a.top+a.height-(c.top+c.height);if(0<a)this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-a)+"px"}},_boundingNode:function(a){var c=
window.getComputedStyle(a,null);return c===null?a:c.getPropertyValue("position")==="absolute"||!a.parentNode||a===document.body?a:this._boundingNode(a.parentNode)},close:function(a){var c=!1;if(this.isVisible())this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),k.setFramesEnabled(!0),a&&this._triggerNode.focus(),this._isVisible=!1,c=!0;return c},getItems:function(){var a=
[],c=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(d){d.parentNode.parentNode===c._dropdownNode&&a.push(d)});a.forEach(function(a){if(!a._hasDropdownMouseover)a.addEventListener("mouseover",function(e){a.dropdown?a.dropdown.open(e):(c._closeSelectedSubmenu(),k.stop(e))}),a._hasDropdownMouseover=!0});return a},empty:function(){var a=this;k.$$array("li",this._dropdownNode).forEach(function(c){c.parentNode===a._dropdownNode&&c.parentNode.removeChild(c)});
this._hookedAutoDismiss=!1},_dropdownKeyDown:function(a){if(a.keyCode===k.KEY.UP||a.keyCode===k.KEY.DOWN||a.keyCode===k.KEY.RIGHT||a.keyCode===k.KEY.ENTER||a.keyCode===k.KEY.LEFT){var c=this.getItems(),d=document.activeElement;if(c.length&&c.length>0&&d){var e=c.indexOf(d);e<0&&(e=c.indexOf(d.parentNode));e>=0&&(a.keyCode===k.KEY.UP&&e>0?(e--,c[e].focus()):a.keyCode===k.KEY.DOWN&&e<c.length-1?(e++,c[e].focus()):a.keyCode===k.KEY.ENTER||a.keyCode===k.KEY.RIGHT?d.classList.contains("dropdownTrigger")&&
d.dropdown&&d.dropdown.open():a.keyCode===k.KEY.LEFT&&d.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),k.stop(a))}}else a.keyCode===k.KEY.ESCAPE&&(this.close(!0),k.stop(a))},submenuOpen:function(a){if(a!==this._selectedSubmenu)this._closeSelectedSubmenu(),this._selectedSubmenu=a},_closeSelectedSubmenu:function(){for(var a=this._selectedSubmenu;a;)a.close(),a=a._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&k.removeAutoDismiss(this._boundAutoDismiss)}};
c.prototype.constructor=c;return{Dropdown:c}});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<\!--span class="dropdownArrowDown core-sprite-openarrow"></span--\></button><ul class="dropdownMenu"></ul>'});define("text!orion/webui/dropdowntriggerbuttonwitharrow.html",[],function(){return'<button class="dropdownTrigger dropdownDefaultButton">${ButtonText}<span class="dropdownArrowDown core-sprite-openarrow"></span></button><ul class="dropdownMenu"></ul>'});
define("text!orion/webui/submenutriggerbutton.html",[],function(){return'<li class="dropdownSubMenu"><span class="dropdownTrigger dropdownMenuItem" role="menuitem" tabindex="0"><span class="dropdownCommandName">${ButtonText}</span><span class="dropdownArrowRight core-sprite-closedarrow"></span></span><ul class="dropdownMenu"></ul></li>'});define("text!orion/webui/checkedmenuitem.html",[],function(){return'<li><label class="dropdownMenuItem"><input class="checkedMenuItem" role="menuitem" type="checkbox" />${ItemText}</label></li>'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(i,k){function g(c){this._init(c)}g.prototype={_init:function(c){this._node=k.node(c.node);if(!this._node)throw"no dom node for tooltip found";this._position=c.position||["right","above","below","left"];this._text=c.text;this._hideDelay=c.hideDelay===void 0?200:c.hideDelay;this._tailSize=c.tailSize||10;this._trigger=c.trigger||"mouseover";this._afterShowing=c.afterShowing;this._afterHiding=c.afterHiding;var a=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(d){d.target===a._node&&(a.show(),k.stop(d))},!1);else if(this._trigger==="mouseover"){this._showDelay=c.showDelay===void 0?500:c.showDelay;c=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(d){k.contains(a._node,d.target)&&(a.show(),k.stop(d))},!1);this._leaveHandler=function(d){k.contains(a._node,d.target)&&a.hide()};for(var g=0;g<c.length;g++)this._node.addEventListener(c[g],
this._leaveHandler,!1)}},_makeTipNode:function(){if(!this._tip){this._tip=document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("div");this._tipInner.classList.add("tooltip");if(this._text)this._tipTextContent=document.createElement("div"),this._tipTextContent.classList.add("textContent"),this._tipInner.appendChild(this._tipTextContent),this._tipTextContent.appendChild(document.createTextNode(this._text));this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var c=this;k.addAutoDismiss([this._tip,this._node],function(){c.hide()});if(this._trigger==="mouseover")this._tipInner.role="tooltip",this._tipInner.id="tooltip"+(new Date).getTime().toString(),this._node.setAttribute("aria-describedby",this._tipInner.id),this._tip.addEventListener("mouseover",function(){if(c._timeout)window.clearTimeout(c._timeout),c._timeout=null;c._tip.addEventListener("mouseout",function(a){k.contains(c._tip,a.target)&&(c.hide(),k.stop(a))},
!1)},!1)}return this._tip},_positionTip:function(c,a){this._makeTipNode();c==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var g=this._node,d;for(d=k.bounds(g);g&&!d.width&&!d.height;g=g.parentNode)d=k.bounds(g);var g=k.bounds(this._tipInner),e;switch(c){case "above":e=d.top-g.height-this._tailSize-1;d=d.left-this._tailSize;break;case "below":e=d.top+d.height+this._tailSize+1;d=d.left-this._tailSize;break;case "left":e=d.top-this._tailSize/2;d=d.left-g.width-
this._tailSize-1;break;default:e=d.top-this._tailSize/2,d=d.left+d.width+this._tailSize+1}var b=k.bounds(document.documentElement);if(e+g.height>b.height)if(a)e=b.height-g.height-1;else return!1;if(d+g.width>b.width)if(a)d=b.width-g.width-1;else return!1;if(d<0)if(a)d=4;else return!1;if(e<0)if(a)e=4;else return!1;if(this._tail&&this._tail.previousPosition!==c)this._tip.removeChild(this._tail),this._tail=null;if(!this._tail){this._tail=document.createElement("span");this._tail.classList.add("tooltipTailFrom"+
c);c==="above"||c==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner);if(c==="left")this._tail.style.left=g.width+"px";this._tail.previousPosition=c}this._tip.style.top=e+"px";this._tip.style.left=d+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._showDelay?this._timeout=
window.setTimeout(this._showImmediately.bind(this),this._showDelay):this._showImmediately()}},_showImmediately:function(){for(var c=!1,a=0;!c&&a<this._position.length;)c=this._positionTip(this._position[a]),a++;c||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(c){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(c===void 0)c=
this._hideDelay;var a=this;this._timeout=window.setTimeout(function(){a._tip.classList.remove("tooltipShowing");a._tip.removeAttribute("style");a._afterHiding&&a._afterHiding()},c)}},destroy:function(){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip)document.body.removeChild(this._tip),this._tail=this._tipTextContent=this._tipInner=this._tip=null;if(this._node){this._node.removeEventListener("click",this._clickHandler,!1);this._node.removeEventListener("mouseover",
this._mouseoverHandler,!1);for(var c=["mouseout","click"],a=0;a<c.length;a++)this._node.removeEventListener(c[a],this._leaveHandler,!1)}}};g.prototype.constructor=g;return{Tooltip:g}});
define("orion/commands","orion/util,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/dropdowntriggerbuttonwitharrow.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip".split(","),function(i,k,g,c,a,l,d,e){function b(b){var a=b.invocation;if(a){var d=b.command;if(d.hrefCallback)return b=d.hrefCallback.call(a.handler||window,a),b.then?b.then(function(b){window.open(b)}):window.open(b),!0;else if(a.commandRegistry)return a.commandRegistry._invoke(a),
!0;else if(d.onClick||d.callback)return window.setTimeout(function(){(d.onClick||d.callback).call(a.handler||window,a)},0),!0}return!1}function j(a,d){for(var f in d)if(d[f]&&d[f].keyBinding&&d[f].command&&d[f].keyBinding.match(a)){var e=d[f],h=e.keyBinding;if((!h.domScope||k.contains(k.node(h.domScope),a.target))&&b(e)){k.stop(a);break}}}function h(){var b={};if(w){var a,d,f;d=Object.keys(s);for(a=0;a<d.length;a++)f=d[a],b[f]=s[f];var e=w();d=Object.keys(e);for(a=0;a<d.length;a++)f=d[a],b[f]=e[f]}else b=
s;return b}function f(b){j(b,h())}function m(b,a){b=b||window.event;if(function(b){if(i.isMac){if(b.metaKey&&!b.altKey)return!b.shiftKey&&!b.ctrlKey&&(b.keyCode===65||b.keyCode===67||b.keyCode===86||b.keyCode===88||b.keyCode===90)?!0:!1;if(b.ctrlKey)return!1}else{if(b.ctrlKey&&!b.altKey)return!b.shiftKey&&(b.keyCode===65||b.keyCode===67||b.keyCode===86||b.keyCode===88||b.keyCode===90)?!0:!1;if(b.altKey&&!b.ctrlKey)return!1}if(b["char"])return b["char"].length>0;else if(b.charCode||b.keyCode)switch(b=
b.charCode||b.keyCode,b){case 8:case 9:case 13:case 46:return!0;default:return b>=32&&b<112||b>123}return!1}(b)){if(b.target.contentEditable==="true")return;var d=b.target.nodeName.toLowerCase();if(d==="input")switch(b.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if(d==="textarea")return}a?a(b):f(b)}function n(){this._init()}
function q(b,a,d){a.classList.add("commandImage");var f;b.imageClass?b.addImageClassToElement?a.classList.add(b.imageClass):(f=document.createElement("span"),a.appendChild(f),f.classList.add(b.spriteClass),f.classList.add(b.imageClass)):(f=new Image,f.alt=b.name,f.name=d,f.id=d,f.src=b.image,a.appendChild(f));return f}function p(b,a){var d=document.createElement("span");d.classList.add("dropdownKeyBinding");d.appendChild(document.createTextNode(a));b.appendChild(d)}function o(b,a,d,f,e){this.commandRegistry=
e;this.handler=b;this.items=a;this.userData=d;this.command=f;if(f.parameters)this.parameters=f.parameters.makeCopy();this.id=f.id}function r(b){this._init(b)}var w=null,s={};n.prototype={setProxy:function(b){this.proxy=b},setKeyBindings:function(b){this.bindings=b},_init:function(){var b=this;document.addEventListener("keydown",function(a){return m(a,function(a){var d=b.proxy,f=b.bindings;if(f&&d)for(var e=0;e<f.length;e++)f[e].match(a)&&(d.processKey({type:a.type,keyCode:a.keyCode,altKey:a.altKey,
ctrlKey:a.ctrlKey,metaKey:a.metaKey,shiftKey:a.shiftKey}),k.stop(a))})})}};window.document.addEventListener("keydown",m,!1);o.prototype={collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(b){var a=new o(this.handler,this.items,this.userData,this.command,this.commandRegistry);a.domNode=this.domNode;a.domParent=this.domParent;if(b)a.parameters=b.makeCopy();else if(this.parameters)a.parameters=this.parameters.makeCopy();return a}};
o.prototype.constructor=o;r.prototype={_init:function(b){this.id=b.id;this.name=b.name;this.tooltip=b.tooltip;this.callback=b.callback;this.hrefCallback=b.hrefCallback;this.choiceCallback=b.choiceCallback;this.positioningNode=b.positioningNode;this.image=b.image||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC";this.imageClass=b.imageClass;this.addImageClassToElement=b.addImageClassToElement;this.selectionClass=
b.selectionClass;this.spriteClass=b.spriteClass||"commandSprite";this.visibleWhen=b.visibleWhen;this.parameters=b.parameters;this.isEditor=b.isEditor},populateChoicesMenu:function(b,a,d,f,e){var d=this.getChoices(a,d,f),h=d.some(function(b){return b.checked});d.forEach(function(d){if(d.name){var f=document.createElement("li");b.appendChild(f);var j=document.createElement("span");j.tabIndex=0;j.role="menuitem";j.classList.add("dropdownMenuItem");if(h){var c=document.createElement("span");c.classList.add("check");
c.appendChild(document.createTextNode(d.checked?"\u25cf":""));j.appendChild(c)}c=document.createTextNode(d.name);j.appendChild(c);f.appendChild(j);j.choice=d;j.addEventListener("click",function(b){b.target.choice&&b.target.choice.callback.call(b.target.choice,a)},!1);j.addEventListener("keydown",function(b){(b.keyCode===k.KEY.ENTER||b.keyCode===k.KEY.SPACE)&&b.target.choice&&b.target.choice.callback.call(b.target.choice,a)},!1)}else e._generateMenuSeparator(b)})},getChoices:function(b,a,d){return this.choiceCallback?
this.choiceCallback.call(a,b,d):null},makeChoiceCallback:function(b,a){return function(d){b.callback&&b.callback.call(b,a,d)}},hasImage:function(){return this.imageClass||this.image!=="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"}};r.prototype.constructor=r;return{Command:r,CommandInvocation:o,createDropdownMenu:function(b,d,f,e,h,j,o,m,n){b=k.node(b);if(!b)throw"no parent node was specified";
var p=document.createRange();p.selectNode(b);p=n?p.createContextualFragment(a):p.createContextualFragment(c);k.processTextNodes(p,{ButtonText:d});b.appendChild(p);var b=b.lastChild,i;n?(n=b.previousSibling,i=n.lastChild):n=b.previousSibling;e?n.classList.add(e):(n.classList.add("orionButton"),n.classList.add("commandButton"));if(h){if(!j)n.textContent="",n.setAttribute("aria-label",d);q({spriteClass:"commandSprite",imageClass:h},n,d);n.classList.add("orionButton")}n.dropdown=new g.Dropdown({dropdown:b,
populate:f,selectionClass:o,skipTriggerEventListeners:!!i,positioningNode:m});b.dropdown=n.dropdown;return{menuButton:n,menu:b,dropdown:n.dropdown,dropdownArrow:i}},createCheckedMenuItem:function(b,a,f,e){b=k.node(b);if(!b)throw"no parent node was specified";var h=document.createRange();h.selectNode(b);h=h.createContextualFragment(d);k.processTextNodes(h,{ItemText:a});b.appendChild(h);b=k.$(".checkedMenuItem",b.lastChild);b.checked=f;b.addEventListener("change",e,!1);return b},createCommandItem:function(b,
a,d,f,h,j,c){var o,j=j||!a.name&&a.hasImage();if(a.hrefCallback)o=document.createElement("a"),o.id=f,j&&a.hasImage()?q(a,o,f):(o.className="commandLink",o.appendChild(document.createTextNode(a.name))),c=a.hrefCallback.call(d.handler,d),c.then?c.then(function(b){o.href=b}):o.href=c?c:"#";else{o=document.createElement("button");o.className="orionButton";j?a.hasImage()?(q(a,o,f),a.name&&o.setAttribute("aria-label",a.name)):(o.classList.add("commandButton"),o.classList.add("commandMissingImageButton"),
o.appendChild(document.createTextNode(a.name))):(o.classList.add("commandButton"),f=document.createTextNode(a.name),o.appendChild(f));var m=c||a.callback;if(m)a.onClick=m,o.addEventListener("click",function(){m.call(d.handler,d)},!1)}b.nodeName.toLowerCase()==="ul"?(c=document.createElement("li"),b.appendChild(c),b=c):o.classList.add("commandMargins");b.appendChild(o);if(a.tooltip)o.commandTooltip=new e.Tooltip({node:o,text:a.tooltip,position:["above","below","right","left"]});h&&(s[a.id]={keyBinding:h,
command:a,invocation:d});return o},createCommandMenuItem:function(b,a,d,f,h,j){var c,o=b.dropdown;if(a.hrefCallback){c=document.createElement("a");var m=document.createElement("span");m.appendChild(document.createTextNode(a.name));m.classList.add("dropdownCommandName");c.appendChild(m);h=a.hrefCallback.call(d.handler,d);h.then?h.then(function(b){c.href=b}):c.href=h?h:"#";c.addEventListener("keydown",function(b){(b.keyCode===k.KEY.ENTER||b.keyCode===k.KEY.SPACE)&&c.click()},!1)}else{c=document.createElement("span");
c.tabIndex=0;m=document.createElement("span");m.appendChild(document.createTextNode(a.name));m.classList.add("dropdownCommandName");c.appendChild(m);var n=h||a.callback;if(n)a.onClick=n,c.addEventListener("click",function(){o.close(!0);n.call(d.handler,d)},!1),c.addEventListener("keydown",function(b){if(b.keyCode===k.KEY.ENTER||b.keyCode===k.KEY.SPACE)b.preventDefault(),c.click()},!1)}c.className="dropdownMenuItem";c.role="menuitem";if(a.tooltip)c.commandTooltip=new e.Tooltip({node:c,text:a.tooltip,
position:["above","below","right","left"]});j&&p(c,j);j=document.createElement("li");b.appendChild(j);j.appendChild(c);f&&(s[a.id]={keyBinding:f,command:a,invocation:d});return c},executeBinding:b,setKeyBindingProvider:function(b){w=b},localKeyBindings:s,CommandsProxy:n,getKeyBindings:h,processKey:f,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",_testMethodProcessKey:j}});
define("orion/explorers/navigationUtils",[],function(){function i(g,c){if(!k&&g)g.push({domNode:c}),c.tabIndex=-1,c.style.outline="none"}var k=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(g,c,a){g&&(g=g.getGridNavHolder(c,!0))&&i(g,a)},generateNavGrid:i,removeNavGrid:function(g,c){if(g)for(var a=0;a<g.length;a++)if(g[a].domNode===c){g.splice(a,1);break}}}});
define("orion/PageUtil",[],function(){var i=/^http[s]?/i;return{hash:function(){var i=window.location.href.split("#")[1];return i?"#"+i:""},matchResourceParameters:function(i){var i=i||window.location.toString(),g={resource:""},c=i.indexOf("#");if(c!==-1&&(i=i.substring(c+1),i.length!==0)){i=i.split(",");g.resource=decodeURIComponent(i[0]);for(c=1;c<i.length;c++){var a=/([^=]*)(=?)(.*)/.exec(i[c]),l=decodeURIComponent(a[1]||""),a=decodeURIComponent(a[3]||"");l!==""&&l!=="resource"&&(g[l]=a)}}return g},
validateURLScheme:function(k,g){var c=k;if(k.indexOf("://")===-1){var a=document.createElement("a");a.href=k;c=a.href}a=!1;return(a=g?g.some(function(a){return RegExp("^"+a+":","i").test(c)}):i.test(c))?k:(console.log("Illegal URL Scheme: '"+k+"'"),"")}}});
define("orion/uiUtils",["orion/webui/littlelib"],function(i){function k(c){var a="",g=navigator.platform.indexOf("Mac")!==-1;g?(c.mod4&&(a+="\u2303"),c.mod3&&(a+="\u2325"),c.mod2&&(a+="\u21e7"),c.mod1&&(a+="\u2318")):(c.mod1&&(a+="Ctrl+"),c.mod2&&(a+="Shift+"),c.mod3&&(a+="Alt+"));if(c.alphaKey)return a+c.alphaKey;if(c.type==="keypress")return a+c.keyCode;for(var d in i.KEY)if(typeof(i.KEY[d]==="number")&&i.KEY[d]===c.keyCode){if(g)switch(i.KEY[d]){case i.KEY.BKSPC:d="\u232b";break;case i.KEY.TAB:d=
"\u21e5";break;case i.KEY.ENTER:d="\u23ce";break;case i.KEY.ESCAPE:d="\u238b";break;case i.KEY.SPACE:d="\u2423";break;case i.KEY.PAGEUP:d="\u21de";break;case i.KEY.PAGEDOWN:d="\u21df";break;case i.KEY.END:d="\u21f2";break;case i.KEY.HOME:d="\u21f1";break;case i.KEY.DEL:d="\u2326"}switch(i.KEY[d]){case i.KEY.DOWN:d="\u2193";break;case i.KEY.UP:d="\u2191";break;case i.KEY.RIGHT:d="\u2192";break;case i.KEY.LEFT:d="\u2190"}return a+d}var e;switch(c.keyCode){case 59:e=c.mod2?":":";";break;case 61:e=c.mod2?
"+":"=";break;case 188:e=c.mod2?"<":",";break;case 190:e=c.mod2?">":".";break;case 191:e=c.mod2?"?":"/";break;case 192:e=c.mod2?"~":"`";break;case 219:e=c.mod2?"{":"[";break;case 220:e=c.mod2?"|":"\\";break;case 221:e=c.mod2?"}":"]";break;case 222:e=c.mod2?'"':"'"}return e?a+e:c.keyCode>=112&&c.keyCode<=123?a+"F"+(c.keyCode-111):a+String.fromCharCode(c.keyCode)}function g(c){var a=window.navigator.platform.indexOf("Mac")!==-1;return a&&c.metaKey||!a&&c.ctrlKey}return{getUserKeyString:function(c){for(var a=
"",c=c.getKeys(),g=0;g<c.length;g++)g!==0&&(a+=" "),a+=k(c[g]);return a},getUserText:function(c){var a=c.id,g=c.refNode,d=c.hideRefNode,e=c.initialText,b=c.onComplete,j=c.onEditDestroy,h=c.selectTo,f=c.isInitialValid,c=c.insertAsChild,m=!1,n=function(h){return function(c){if(!m){var n=i.node(a),q=n.value;if(n)if(h&&c.keyCode===i.KEY.ESCAPE){if(d)g.style.display="inline";m=!0;n.parentNode.removeChild(n);j&&j()}else if(!(h&&c.keyCode!==i.KEY.ENTER)){if(q.length===0||!f&&q===e){if(d)g.style.display=
"inline"}else if(b(q),d&&g.parentNode)g.style.display="inline";m=!0;n.parentNode&&n.parentNode.removeChild(n);j&&j()}}}},q=document.createElement("input");q.id=a;q.value=e||"";c?g.appendChild(q):g.parentNode.insertBefore(q,g.nextSibling);q.classList.add("userEditBoxPrompt");if(d)g.style.display="none";q.addEventListener("keydown",n(!0),!1);q.addEventListener("blur",n(!1),!1);window.setTimeout(function(){q.focus();if(e){var b=i.node(a),d=h?e.indexOf(h):-1;if(d>0)if(b.createTextRange)b=b.createTextRange(),
b.collapse(!0),b.moveStart("character",0),b.moveEnd("character",d),b.select();else if(b.setSelectionRange)b.setSelectionRange(0,d);else{if(b.selectionStart!==void 0)b.selectionStart=0,b.selectionEnd=d}else b.select()}},0)},openInNewWindow:g,followLink:function(c,a){a&&g(a)?window.open(c):window.location=c},createButton:function(c,a){var g=document.createElement("button");g.className="orionButton commandButton commandMargins";g.addEventListener("click",function(d){a();i.stop(d)},!1);c&&g.appendChild(document.createTextNode(c));
return g},createDropdownButton:function(){},isFormElement:function(c){switch(c.tagName.toLowerCase()){case "button":case "fieldset":case "form":case "input":case "keygen":case "label":case "legend":case "meter":case "optgroup":case "output":case "progress":case "select":case "textarea":return!0}return!1}}});
define("orion/commandRegistry","orion/commands,orion/explorers/navigationUtils,orion/PageUtil,orion/uiUtils,orion/webui/littlelib,orion/webui/dropdown,orion/webui/tooltip,text!orion/webui/checkedmenuitem.html,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html".split(","),function(i,k,g,c,a,l,d,e,b,j){function h(b){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(b);this._parameterCollector=
null}function f(b,a){this.token=b;this.parameterName=a}function m(b,a,d){this.event=b;this.handler=a;this.capture=d||!1}function n(b,a,d,f,e,h){this.name=b;this.type=a;this.label=d;this.value=f;this.lines=e||1;this.eventListeners=Array.isArray(h)?h:h?[h]:[]}function q(b,a,d){this._storeParameters(b);this._hasOptionalParameters=a&&a.hasOptionalParameters;this._options=a;this.optionsRequested=!1;this.getParameters=d;this.clientCollect=a&&a.clientCollect}h.prototype={_init:function(b){this._selectionService=
b.selection;var a=this;i.setKeyBindingProvider(function(){return a._activeBindings})},processURL:function(b){for(var a in this._urlBindings)if(this._urlBindings[a]&&this._urlBindings[a].urlBinding&&this._urlBindings[a].command){var d=this._urlBindings[a].urlBinding.match(b);if(d){var f=this._urlBindings[a],e=f.command,h=f.invocation;if(h&&h.parameters&&e.callback){h.parameters.setValue(d.parameterName,d.parameterValue);var j=this;window.setTimeout(function(){j._invoke(h)},0);break}}}},findCommand:function(b){return this._commandList[b]},
runCommand:function(b,a,d,f){a?(b=this._commandList[b])&&(b.visibleWhen?b.visibleWhen(a):1)&&b.callback&&this._invoke(new i.CommandInvocation(d,a,null,b,this),f):(a=this._urlBindings[b])&&a.command&&a.command.callback&&this._invoke(a.invocation,f)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(b){this._parameterCollector=b},openParameterCollector:function(b,a,d){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(b,
a,d))},confirm:function(b,a,d,f,e,h){var j=!1;if(this._parameterCollector&&!e){var c=this;this._parameterCollector.close();if(this._parameterCollector.open(b,function(b,e){var h=document.createElement("span");h.classList.add("parameterPrompt");h.textContent=a;b.appendChild(h);h=document.createElement("button");h.addEventListener("click",function(){j=!0;c._parameterCollector.close()},!1);e.appendChild(h);h.appendChild(document.createTextNode(d));h.className="dismissButton";var m=document.createElement("button");
m.addEventListener("click",function(){j=!1;c._parameterCollector.close()},!1);e.appendChild(m);m.appendChild(document.createTextNode(f));m.className="dismissButton";return h},function(){h(j)}))return}j=window.confirm(a);h(j)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(b,a){return this._collectAndInvoke(b.makeCopy(a),!1)},_collectAndInvoke:function(b,a){if(b)if(this._parameterCollector&&
b.parameters&&b.parameters.hasParameters()&&(a||b.parameters.shouldCollectParameters())){var f=!1;b.parameters.updateParameters(b);if(b.parameters.shouldCollectParameters()&&(f=this._parameterCollector.collectParameters(b),!f)){var h=new d.Tooltip({node:b.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),f=h.contentContainer();f.classList.add("parameterPopup");var e=window.document.activeElement,j=this._parameterCollector.getFillFunction(b,
function(){e&&e.focus();h.destroy()})(f);h.show();window.setTimeout(function(){j.focus();j.select()},0);f=!0}f||b.command.callback.call(b.handler||window,b)}else b.command.callback.call(b.handler||window,b);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(b){this._collectAndInvoke(b,!0)},showKeyBindings:function(b){function a(b){return function(){i.executeBinding(b)}}var d={},f,h,e=[],j;for(j in this._activeBindings)(h=
this._activeBindings[j])&&h.keyBinding&&h.command&&(h.command.name||h.command.tooltip)&&e.push(h);e.sort(function(b,a){return(b.command.name||b.command.tooltip).localeCompare(a.command.name||a.command.tooltip)});for(j=0;j<e.length;j++)h=e[j],h.keyBinding.scopeName?(d[h.keyBinding.scopeName]||(d[h.keyBinding.scopeName]=[]),d[h.keyBinding.scopeName].push(h)):(f=c.getUserKeyString(h.keyBinding),b.createItem(f,h.command.name||h.command.tooltip,a(h)));for(var m in d)d[m].length&&d[m].length>0&&(b.createHeader(m),
d[m].forEach(function(d){f=c.getUserKeyString(d.keyBinding);b.createItem(f,d.command.name||d.command.tooltip,a(d))}))},addCommand:function(b){this._commandList[b.id]=b;var a=this._pendingBindings[b.id];if(a){var d=this;a.forEach(function(a){d._addBinding(b,a.type,a.binding,a.bindingOnly)});delete this._pendingBindings[b.id]}},addCommandGroup:function(b,a,d,f,h,e,j,c,m,n){this._contributionsByScopeId[b]||(this._contributionsByScopeId[b]={});b=this._contributionsByScopeId[b];h&&(b=this._createEntryForPath(b,
h));if(b[a]){if(f)b[a].title=f;if(d)b[a].position=d;if(j)b[a].imageClass=j;if(c)b[a].tooltip=c;if(m)b[a].selectionClass=m;n===!0?b[a].pretendDefaultActionId=!0:b[a].defaultActionId=n;b[a].emptyGroupMessage=e}else b[a]={title:f,position:d,emptyGroupMessage:e,imageClass:j,tooltip:c,selectionClass:m,defaultActionId:n===!0?null:n,pretendDefaultActionId:n===!0,children:{}},b.sortedContributions=null},_createEntryForPath:function(b,a){a&&a.split("/").forEach(function(a){if(a.length>1){if(!b[a])b[a]={position:0,
children:{}},b.sortedContributions=null;b=b[a].children}});return b},registerSelectionService:function(b,a){this._contributionsByScopeId[b]||(this._contributionsByScopeId[b]={});this._contributionsByScopeId[b].localSelectionService=a},registerCommandContribution:function(b,a,d,f,h,e,j){this._contributionsByScopeId[b]||(this._contributionsByScopeId[b]={});b=this._contributionsByScopeId[b];f&&(b=this._createEntryForPath(b,f));b[a]={position:d};e&&((d=this._commandList[a])?this._addBinding(d,"key",e,
h):this._addPendingBinding(a,"key",e,h));j&&((d=this._commandList[a])?this._addBinding(d,"url",j,h):this._addPendingBinding(a,"url",j,h));b.sortedContributions=null},unregisterCommandContribution:function(b,a,d){if(this._contributionsByScopeId[b]){delete this._commandList[a];delete this._activeBindings[a];delete this._urlBindings[a];delete this._pendingBindings[a];var f=this._contributionsByScopeId[b];d&&d.split("/").forEach(function(b){if(b.length>1&&f[b])f=f[b].children});delete f[a];f.sortedContributions=
null}},_addBinding:function(b,a,d,f){if(!b.id)throw Error("No command id: "+b);a==="key"?this._activeBindings[b.id]={command:b,keyBinding:d,bindingOnly:f}:a==="url"&&(this._urlBindings[b.id]={command:b,urlBinding:d,bindingOnly:f})},_addPendingBinding:function(b,a,d,f){this._pendingBindings[b]=this._pendingBindings[b]||[];this._pendingBindings[b].push({type:a,binding:d,bindingOnly:f})},_checkForTrailingSeparator:function(b,d,f){var h;if(d==="tool"||d==="button")if((h=b.childNodes.length>0?b.childNodes[b.childNodes.length-
1]:null)&&h.classList.contains("commandSeparator"))return f?(b.removeChild(h),!1):!0;if(d==="menu"&&(b=a.$$array("li > *",b),b.length>0&&b[b.length-1].classList.contains("dropdownSeparator")))if(h=b[b.length-1],f)h.parentNode.parentNode.removeChild(h.parentNode);else return!0;return!1},renderCommands:function(b,d,f,h,e,j,c){if(typeof b!=="string")throw"a scope id for rendering must be specified";d=a.node(d);if(!d)throw"no parent";var m=this._contributionsByScopeId[b];if(!f&&m){var f=m.localSelectionService||
this._selectionService,n=this;f&&f.getSelections(function(a){n.renderCommands(b,d,a,h,e,j)})}else m&&(this._render(m,d,f,h,e||"button",j,c),this._checkForTrailingSeparator(d,e,!0))},destroy:function(b){b=a.node(b);if(!b)throw"no parent";for(;b.hasChildNodes();){var d=b.firstChild;d.commandTooltip&&d.commandTooltip.destroy();d.emptyGroupTooltip&&d.emptyGroupTooltip.destroy();this.destroy(d);b.removeChild(d)}},_render:function(b,a,f,h,e,j,m){var n=b.sortedContributions;if(!n){var n=[],g=!1,q;for(q in b)if(Object.prototype.hasOwnProperty.call(b,
q)){var l=b[q];if(l&&typeof l.position==="number")l.id=q,n.push(l),g=!0}if(g)n.sort(function(b,a){return b.position-a.position}),b.sortedContributions=n}var D=0,u=this;n.forEach(function(b){var n;if(!b.imageClass)b.imageClass=null;if(b.children&&Object.getOwnPropertyNames(b.children).length>0){var g=b.children;if(e==="tool"||e==="button")if(b.title){var q;if(b.defaultActionId)(g=u._commandList[b.defaultActionId])&&(g.visibleWhen?g.visibleWhen(f):1)?(q=new i.CommandInvocation(h,f,j,g,u),q.domParent=
a):b.pretendDefaultActionId=!0;g=u._createDropdownMenu(a,b.title,null,null,b.imageClass,b.tooltip,b.selectionClass,null,q,b.pretendDefaultActionId);m&&k.generateNavGrid(m,g.menuButton);if(g)if(u._render(b.children,g.menu,f,h,"menu",j,m),u._checkForTrailingSeparator(g.menu,"menu",!0),g.menu.childNodes.length===0)if(b.emptyGroupMessage){if(!g.menuButton.emptyGroupTooltip)g.menuButton.emptyGroupTooltip=new d.Tooltip({node:g.menuButton,text:b.emptyGroupMessage,trigger:"click",position:["below","right",
"above","left"]})}else m&&k.removeNavGrid(m,g.menuButton),b=function(b){b&&b.parentNode&&b.parentNode.removeChild(b)},b(g.menu),b(g.menuButton),b(g.destroyButton);else g.menuButton.style.visibility="visible"}else{var l;a.childNodes.length>0&&!u._checkForTrailingSeparator(a,e)&&(l=u.generateSeparatorImage(a));u._render(g,a,f,h,e,j,m);a.childNodes.length>0&&a.childNodes[a.childNodes.length-1]!==l&&(l=u.generateSeparatorImage(a))}else if(b.title){if(b=u._createDropdownMenu(a,b.title,!0,null,null,b.imageClass))u._render(g,
b.menu,f,h,"menu",j,m),u._checkForTrailingSeparator(b.menu,"menu",!0),b.menu.childNodes.length===0&&b.destroyButton&&a.removeChild(b.destroyButton)}else a.childNodes.length>0&&u._generateMenuSeparator(a),u._render(g,a,f,h,e,j,m),u._generateMenuSeparator(a)}else{var p=u._commandList[b.id],g=p?!0:!1;q=b=null;if(p){n=new i.CommandInvocation(h,f,j,p,u);n.domParent=a;l=g&&(p.visibleWhen?p.visibleWhen(f):!0);if(u._activeBindings[p.id]&&u._activeBindings[p.id].keyBinding)b=u._activeBindings[p.id],b.invocation=
l?n:null,b.bindingOnly&&(g=!1);if(u._urlBindings[p.id]&&u._urlBindings[p.id].urlBinding)q=u._urlBindings[p.id],q.invocation=l?n:null,q.bindingOnly&&(g=!1);g=g&&l}if(g)p.choiceCallback?(e==="tool"||e==="button"?(b=a,g=!1,a.nodeName.toLowerCase()==="ul"&&(b=document.createElement("li"),a.appendChild(b))):(b=a,g=!0),u._createDropdownMenu(b,p.name,g,function(b){p.populateChoicesMenu(b,f,h,j,u)}.bind(p),p.imageClass,p.tooltip||p.title,p.selectionClass,p.positioningNode)):(n.handler=n.handler||this,n.domParent=
a,g=function(){u._invoke(n)},e==="menu"?(q=null,b&&b.keyBinding&&(q=c.getUserKeyString(b.keyBinding)),b=i.createCommandMenuItem(a,p,n,null,g,q)):(b=e+p.id+D,b=i.createCommandItem(a,p,n,b,null,e==="tool",g)),k.generateNavGrid(m,b),n.domNode=b,D++)}})},_createDropdownMenu:function(b,f,h,e,c,m,g,n,q,k){b=a.node(b);if(!b||!a.contains(document.body,b))return null;var G,D,u=b;if(h)m=document.createRange(),m.selectNode(b),m=m.createContextualFragment(j),a.processTextNodes(m,{ButtonText:f}),b.appendChild(m),
D=b.lastChild,c=D.lastChild,f=c.previousSibling,f.dropdown=new l.Dropdown({dropdown:c,populate:e,parentDropdown:b.dropdown}),c.dropdown=f.dropdown;else{b.nodeName.toLowerCase()==="ul"&&(u=document.createElement("li"),b.appendChild(u),D=u);b=null;c&&(b="dropdownButtonWithIcon",m=m||f);var m=c?m||f:m,B=i.createDropdownMenu(u,f,e,b,c,!1,g,n,q||k);G=B.dropdownArrow;f=B.menuButton;if(G){if(q)q.domNode=B.menuButton;var x=this;f.onclick=function(b){var d=a.bounds(G);b.clientX>=d.left&&B.dropdown?B.dropdown.toggle(b):
x._invoke(q)};if(B.dropdown)f.onkeydown=function(b){a.KEY.DOWN===b.keyCode&&(B.dropdown.toggle(b),a.stop(b))}}var c=B.menu,C;(e=q&&q.command&&(q.command.tooltip||q.command.name))?C=q.command.tooltip||q.command.name:e&&(C=m);if(C)f.commandTooltip=new d.Tooltip({node:f,text:C,position:["above","below","right","left"]})}return{menuButton:f,menu:c,dropdown:f.dropdown,destroyButton:D,dropdownArrow:G}},_generateMenuSeparator:function(b){if(!this._checkForTrailingSeparator(b,"menu")){var a=document.createElement("li");
a.classList.add("dropdownSeparator");var d=document.createElement("span");d.classList.add("dropdownSeparator");a.appendChild(d);b.appendChild(a)}},generateSeparatorImage:function(b){var a;a=b.nodeName.toLowerCase()==="ul"?document.createElement("li"):document.createElement("span");b.appendChild(a);a.classList.add("core-sprite-sep");a.classList.add("imageSprite");a.classList.add("commandSeparator");return a}};h.prototype.constructor=h;f.prototype={match:function(b){b=g.matchResourceParameters(b);return typeof b[this.token]!==
"undefined"?(this.parameterValue=b[this.token],this):null}};f.prototype.constructor=f;m.prototype.constructor=m;n.prototype={optionsRequested:function(){return this.optionsRequested}};n.prototype.constructor=n;q.prototype={_storeParameters:function(b){this.parameterTable=null;if(b){var a=this.parameterTable={};b.forEach(function(b){a[b.name]=b})}},updateParameters:function(b){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(b))},hasParameters:function(){return this.parameterTable!==
null},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(b){return this.parameterTable[b]},valueFor:function(b){return(b=this.parameterTable[b])?b.value:null},setValue:function(b,a){var d=this.parameterTable[b];if(d)d.value=a},forEach:function(b){for(var a in this.parameterTable)this.parameterTable[a].type&&this.parameterTable[a].name&&b(this.parameterTable[a])},makeCopy:function(){var b=[];this.forEach(function(a){a=new n(a.name,a.type,a.label,
a.value,a.lines,a.eventListeners);b.push(a)});var a=new q(b,this._options,this.getParameters);a.clientCollect=this.clientCollect;return a},hasOptionalParameters:function(){return this._hasOptionalParameters}};q.prototype.constructor=q;return{CommandRegistry:h,URLBinding:f,ParametersDescription:q,CommandParameter:n,CommandEventListener:m}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(i,k,g){function c(a,c){this._activeContainer=null;this._getElementsFunction=a;this._toolbarLayoutFunction=c}c.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&g.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&g.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();if(this._oldFocusNode)this._oldFocusNode.focus(),this._oldFocusNode=null}this._activeElements=null},open:function(a,c,d){typeof a==="string"&&(a=g.node(a));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===a)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(a))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=d;var e=c(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!e)return!1;this._activeElements.focusNode=e;a=g.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(a.length===0){c=this._activeElements.dismissArea||
this._activeElements.parameterArea;a=document.createElement("button");a.id="closebox";a.className="imageSprite core-sprite-close dismissButton";a.title=i.Close;c.appendChild(a);var b=this;a.addEventListener("click",function(){b.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);if(e)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){e.focus();e.select&&e.select()},0);this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(a,c){g.$$array("input",c).forEach(function(d){d.type==="checkbox"?a.parameters.setValue(d.parameterName,d.checked):d.type!=="button"&&a.parameters.setValue(d.parameterName,d.value.trim())});g.$$array("textArea",c).forEach(function(d){a.parameters.setValue(d.parameterName,d.value.trim())});a.command.callback&&a.command.callback.call(a.handler,a)},collectParameters:function(a){return a.parameters?
(a.domNode&&a.domNode.classList.add("commandMarker"),this.open(a.domNode||a.domParent,this.getFillFunction(a))):!1},getFillFunction:function(a,c){var d=this;return function(e,b){var j=null,h=function(){c&&c();d.close()},f=function(b){b.keyCode===g.KEY.ENTER&&d._collectAndCall(a,e);if(b.keyCode===g.KEY.ESCAPE||b.keyCode===g.KEY.ENTER)h(),g.stop(b)};a.parameters.forEach(function(b){var d=null;if(b.label)d=document.createElement("label"),d.classList.add("parameterInput"),d.setAttribute("for",b.name+
"parameterCollector"),d.textContent=b.label,e.appendChild(d);var c=b.name+"parameterCollector",m,d=d||e;if(b.type==="text"&&typeof b.lines==="number"&&b.lines>1)m=document.createElement("textarea"),m.rows=b.lines,m.type="textarea",m.id=c,d.appendChild(m),f=function(b){b.keyCode===g.KEY.ESCAPE&&(h(),g.stop(b))};else if(b.type==="boolean"){if(m=document.createElement("input"),m.type="checkbox",m.id=c,d.appendChild(m),b.value)m.checked=!0}else if(m=document.createElement("input"),m.type=b.type,m.id=
c,d.appendChild(m),b.value)m.value=b.value;m.classList.add("parameterInput");m.setAttribute("speech","speech");m.setAttribute("x-webkit-speech","x-webkit-speech");m.parameterName=b.name;j||(j=m);b.eventListeners.length>0&&b.eventListeners.forEach(function(b){m.addEventListener(b.event,function(d){return b.handler(d,a)},b.capture)});m.addEventListener("keydown",f,!1)});var m=b;m||(m=document.createElement("span"),m.classList.add("layoutRight"),m.classList.add("parametersDismiss"),e.appendChild(m));
var n=function(b,a){var d=document.createElement("button");a.appendChild(d);b&&d.appendChild(document.createTextNode(b));d.classList.add("dismissButton");return d};if(a.parameters.hasOptionalParameters())a.parameters.optionsRequested=!1,n(i.More,m).addEventListener("click",function(){a.parameters.optionsRequested=!0;d._collectAndCall(a,e);h()},!1);n(i.Submit,m).addEventListener("click",function(){d._collectAndCall(a,e);h()},!1);m=n(null,m);m.id="closebox";m.classList.add("imageSprite");m.classList.add("core-sprite-close");
m.title=i.Close;m.addEventListener("click",function(){h()},!1);return j}}};c.prototype.constructor=c;return{CommandParameterCollector:c}});define("orion/regex",[],function(){return{escape:function(i){return i.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(i){return(i=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(i))?{pattern:i[1],flags:i[2]}:null}}});
define("orion/contentTypes",[],function(){function i(b,a){function d(b,a,f,h){var f=a.filename.indexOf(f)>=0,e;e=h.toLowerCase();e=a.extension.indexOf(e)!==-1;if(f||e){if(!(e=!b))f&&(h=h.toLowerCase(),f=b.extension.indexOf(h)!==-1),e=f;if(e)return a}return b}if(typeof b!=="string")return null;for(var e=b&&b.split(".").pop(),c=null,g=0;g<a.length;g++){var i=a[g];d(c,i,b,e)===i&&(c=i)}return c}function k(b){return b===null||typeof b==="undefined"?[]:Array.isArray(b)?b:[b]}function g(b){return k(b).map(function(b){return String.prototype.toLowerCase.call(b)})}
function c(b){return{id:b.id,name:b.name,image:b.image,imageClass:b.imageClass,"extends":b["extends"],extension:g(b.extension),filename:k(b.filename)}}function a(b){var a=Object.create(null);b.map(c).forEach(function(b){Object.prototype.hasOwnProperty.call(a,b.id)||(a[b.id]=b)});return a}function l(c){if(c&&c.registerService){this.serviceRegistry=c;for(var h=c.getServiceReferences(e).concat(c.getServiceReferences(b)),f=[],m=0;m<h.length;m++)for(var g=k(h[m].getProperty("contentTypes")),i=0;i<g.length;i++)f.push(g[i]);
this.map=a(f);c.registerService(d,this)}else if(Array.isArray(c))this.serviceRegistry=null,this.map=a(c);else throw Error("Invalid parameter");}var d="orion.core.contentTypeRegistry",e="orion.core.contenttype",b="orion.file.contenttype";l.prototype={getContentTypes:function(){var b=this.getContentTypesMap(),a=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&a.push(b[d]);return a},getContentTypesMap:function(){return this.map},getFileContentType:function(b){return i(b.Name,this.getContentTypes())},
getFilenameContentType:function(b){return i(b,this.getContentTypes())},getContentType:function(b){return this.map[b]||null},isExtensionOf:function(b,a){b=typeof b==="string"?this.getContentType(b):b;a=typeof a==="string"?this.getContentType(a):a;if(!b||!a)return!1;if(b.id===a.id)return!0;else for(var d=b,e={};d&&(d=this.getContentType(d["extends"]));){if(d.id===a.id)return!0;if(e[d.id])throw Error("Cycle: "+d.id);e[d.id]=!0}return!1},isSomeExtensionOf:function(b,a){for(var d=0;d<a.length;d++)if(this.isExtensionOf(b,
a[d]))return!0;return!1}};return{ContentTypeRegistry:l,getFilenameContentType:i}});
define("orion/URITemplate",[],function(){function i(b){this._text=b}function k(b){return b.replace("%25","%")}function g(b,a){if(a==="U")return encodeURIComponent(b).replace(/[!'()*]/g,function(b){return"%"+b.charCodeAt(0).toString(16).toUpperCase()});if(a==="U+R")return encodeURI(b).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(j,k);if(a==="U+R-,")return encodeURI(b).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+a);}function c(b,a,d){for(var e=
[],c=0;c<b.length;c++)typeof b[c]!=="undefined"&&e.push(g(b[c],a));return e.join(d)}function a(b,a,d,e){for(var c=Object.keys(b),j=[],o=0;o<c.length;o++)typeof b[c[o]]!=="undefined"&&j.push(g(c[o],a)+d+g(b[c[o]],a));return j.join(e)}function l(a){if(a.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=e[a[0]])?a=a.substring(1):this._operator=e.NUL;for(var d=[],c=a.split(","),j=0;j<c.length;j++){var g=c[j].match(b);if(g===null)throw Error("Bad VarSpec: "+a);d.push({name:g[1],
explode:!!g[2],prefix:g[3]?parseInt(g[3],10):-1})}this._varSpecList=d}function d(b){for(var a=[],d=0,e=b.indexOf("{",d);e!==-1;){a.push(new i(b.substring(d,e)));d=b.indexOf("}",e+1);if(d===-1)throw Error("Invalid template: "+b);a.push(new l(b.substring(e+1,d)));d+=1;e=b.indexOf("{",d)}a.push(new i(b.substring(d)));this._templateComponents=a}var e={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},
"/":{first:"/",sep:"/",named:!1,ifemp:"",allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"&",named:!0,ifemp:"=",allow:"U"},"&":{first:"&",sep:"&",named:!0,ifemp:"=",allow:"U"},"#":{first:"#",sep:",",named:!1,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R-,"}},b=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,j=/%25[0-9A-F][0-9A-F]/g;i.prototype={expand:function(){return encodeURI(this._text)}};
l.prototype={expand:function(b){for(var d=[],e=0;e<this._varSpecList.length;e++){var j=this._varSpecList[e],i=j.name,l=b[i],o=typeof l;if(o!=="undefined"&&l!==null){var k=d.length===0?this._operator.first:this._operator.sep;if(o==="string")this._operator.named&&(k+=g(i,"U+R"),k+=l.length===0?this._operator.ifemp:"="),j.prefix!==-1&&j.prefix<l.length&&(l=l.substring(0,j.prefix)),k+=g(l,this._operator.allow);else if(Array.isArray(l)){if(l.length===0)continue;j.explode?k+=c(l,this._operator.allow,this._operator.sep):
(j=c(l,this._operator.allow,","),this._operator.named&&(k+=g(i,"U+R"),k+=j.length===0?this._operator.ifemp:"="),k+=j)}else if(o==="object"){if(Object.keys(l).length===0)continue;j.explode?k+=a(l,this._operator.allow,"=",this._operator.sep):(j=a(l,this._operator.allow,",",","),this._operator.named&&(k+=g(i,"U+R"),k+=j.length===0?this._operator.ifemp:"="),k+=j)}else throw Error("bad param type: "+i+" : "+o);d.push(k)}}return d.join("")}};d.prototype={expand:function(b){for(var a=[],d=0;d<this._templateComponents.length;d++)a.push(this._templateComponents[d].expand(b));
return a.join("")}};return d});
define("orion/i18nUtil",["require","orion/Deferred"],function(i,k){function g(a){if(a=localStorage.getItem("orion/messageBundle/"+a))if(a=JSON.parse(a),a._expires&&a._expires>(new Date).getTime())return delete a._expires,a;return null}var c={};return{getMessageBundle:function(a){function l(b){b?i(["i18n!"+a],function(b){if(b){var d=a;b._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+d,JSON.stringify(b));delete b._expires}e.resolve(b)}):d(Error(a))}function d(b){e.reject(b)}
if(c[a])return c[a];var e=new k;c[a]=e;var b=g(a);if(b)return e.resolve(b),e;try{i([a],l,d)}catch(j){i(["orion/i18n!"+a],l,d)}return e},formatMessage:function(a){var c=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,e){return c[(e<<0)+1]})}}});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/objects,orion/URL-shim".split(","),function(i,k,g,c,a,l){function d(){return i.toUrl?(new URL(i.toUrl("orion/../"),window.location.href)).href.slice(0,-1):(new URL("/",window.location.href)).href.slice(0,-1)}function e(b){var a={};b.getPropertyKeys().forEach(function(d){d!=="objectClass"&&d!=="service.names"&&d!=="service.id"&&d!=="__plugin__"&&(a[d]=b.getProperty(d))});return a}function b(b){return a.getMessageBundle(b.nls).then(function(a){b.textContent=
b.nameKey?a[b.nameKey]:b.name;return b},function(){b.textContent=b.nameKey||b.name;return b})}function j(a,f){var h=a.getServiceReferences(f||"orion.page.link"),j=g.matchResourceParameters(window.location.href),m={OrionHome:d(),Location:j.resource},n=[];h.forEach(function(a){a=e(a);if(a.uriTemplate&&(a.nls||a.name)){var d=(new c(a.uriTemplate)).expand(m),d=g.validateURLScheme(d);a.href=d;a.nls?n.push(b(a)):(a.textContent=a.name,n.push((new k).resolve(a)))}});return k.all(n)}function h(b){var a=this.categories=
Object.create(null);b.forEach(function(b){a[b.id]=b})}function f(b){this.allPageLinks=b;this.allPageLinks.sort(m)}function m(b,a){var d=b.textContent&&b.textContent.toLowerCase(),f=a.textContent&&a.textContent.toLowerCase();return d<f?-1:d>f?1:0}var n;l.mixin(h.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(b){return this.categories[b]||null}});l.mixin(f.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(b){var a=b.href,b=
b.textContent,d=document.createElement("a");d.href=a;d.target="_self";d.classList.add("targetSelector");d.textContent=b;return d})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(a){var d;return!n?(d=[],a.getServiceReferences("orion.page.link.category").forEach(function(a){a=e(a);if(a.id&&(a.name||a.nameKey))a.nls?d.push(b(a)):(a.textContent=a.name,d.push((new k).resolve(a)))}),k.all(d).then(function(b){return n=new h(b)})):(new k).resolve(n)},getPageLinksInfo:function(b,
a){return j(b,a).then(function(b){return new f(b)})},getOrionHome:d}});
define("orion/edit/nls/root/messages",{Editor:"Editor",switchEditor:"Switch Editor",Fetching:"Fetching: ${0}",confirmUnsavedChanges:"There are unsaved changes.  Do you still want to navigate away?",searchFiles:"Search Files...",searchTerm:"Enter search term:",unsavedChanges:"There are unsaved changes.",unsavedAutoSaveChanges:"Please stay on the page until Auto Save is complete.",Save:"Save",Saved:"Saved",Blame:"Blame",BlameTooltip:"Show blame annotations",saveOutOfSync:"Resource is out of sync with the server. Do you want to save it anyway?",
loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.",ReadingMetadata:"Reading metadata of ${0}",ReadingMetadataError:"Can not get metadata of ${0}",Reading:"Reading ${0}",readonly:"Read Only.",saveFile:"Save this file",gotoLine:"Go to Line...",gotoLineTooltip:"Go to specified line number",gotoLinePrompt:"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find...",noResponse:"No response from server.  Check your internet connection and try again.",
savingFile:"Saving file ${0}",running:"Running ${0}","Saving...":"Saving...",View:"View",SidePanel:"Side Panel",SidePanelTooltip:"Choose what to show in the side panel.",Actions:"Actions",Navigator:"Navigator",FolderNavigator:"Folder Navigator",Project:"Project",New:"New",File:"File",Edit:"Edit",Tools:"Tools",Add:"Add",noActions:"There are no actions for the current selection.",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding.",LocalEditorSettings:"Local Editor Settings",
NoProject:"${0} is not a project. To convert it to a project use ${1}.",NoProjects:"There are no projects in your workspace. Use the ${0} menu to create projects.",disconnected:"(disconnected)",ChooseFS:"Choose Filesystem",ChooseFSTooltip:"Choose the filesystem you want to view.",FSTitle:"${0} (${1})",Deploy:"Deploy","Deploy As":"Deploy As",Import:"Import",Export:"Export",OpenWith:"Open With",OpenRelated:"Open Related",Dependency:"Dependency",UnnamedCommand:"Unnamed"});
define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(i,k){var g={root:k};Object.keys(i).forEach(function(c){typeof g[c]==="undefined"&&(g[c]=i[c])});return g});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks,i18n!orion/edit/nls/messages".split(","),function(i,k,g,c,a,l,d,e,b,j){function h(b){var a={};b.getPropertyKeys().forEach(function(d){a[d]=b.getProperty(d)});return a}var f={},m=b.getOrionHome();f._cloneItemWithoutChildren=function o(b){if(b===null||typeof b!=="object")return b;var a=b.constructor(),d;for(d in b)d!=="children"&&d!==
"Children"&&(a[d]=o(b[d]));return a};f._getOpenWithNavCommandExtensions=function(b){function a(b,d){for(var f=b.getServiceReferences("orion.navigate.openWith"),e=[],h=[],c=0;c<f.length;c++){var j=f[c];if(j.getProperty("editor")===d.id){var m=j.getProperty("contentType");m instanceof Array?e=e.concat(m):e.push(m||"*/*");j=j.getProperty("excludedContentTypes");j instanceof Array?h=h.concat(j):j!==null&&typeof j!=="undefined"&&h.push(j)}}0===e.length&&(e=null);0===h.length&&(h=null);return{contentTypes:e,
excludedContentTypes:h}}for(var d=function(){for(var a=b.getServiceReferences("orion.edit.editor"),d=[],f=0;f<a.length;f++){var e=a[f],h=e.getProperty("id");d.push({id:h,"default":e.getProperty("default")||!1,name:e.getProperty("name"),nameKey:e.getProperty("nameKey"),nls:e.getProperty("nls"),uriTemplate:e.getProperty("orionTemplate")||e.getProperty("uriTemplate"),validationProperties:e.getProperty("validationProperties")||[]})}return d}(),f=[],e=0;e<d.length;e++){var h=d[e],c=a(b,h);f.push({properties:{name:h.name||
h.id,nameKey:h.nameKey,id:"eclipse.openWithCommand."+h.id,contentType:c.contentTypes,excludedContentTypes:c.excludedContentTypes,uriTemplate:h.uriTemplate,nls:h.nls,forceSingleItem:!0,isEditor:h["default"]?"default":"editor",validationProperties:h.validationProperties},service:{}})}return f};f._makeValidator=function(b,d,f,e){function h(b,a,d,f){var e=d.match,c,j;if((c=a.indexOf("["))>=0){if((j=a.indexOf("]"))<0)return!1;var m=a.substring(0,c),g;if(!(g=b[m])||!Array.isArray(g))return!1;c=a.substring(c+
1,j);c=parseInt(c,10);if(isNaN(c))return!1;c<0&&(c+=g.length);a=a.substring(j+1);a=m+":"+String(c)+a}if(a.indexOf("|")>=0)return c=a.substring(0,a.indexOf("|")),a=a.substring(a.indexOf("|")+1),h(b,c,d,f)?!0:h(b,a,d,f);else if(a.indexOf(":")>=0)return c=a.substring(0,a.indexOf(":")),a=a.substring(a.indexOf(":")+1),b[c]?h(b[c],a,d,f):!1;else{a:{var m=!1,n;if(a.charAt(0)==="!")d=typeof b[a.substring(1)]==="undefined";else if(typeof b[a]!=="undefined"){if(typeof e==="undefined")n=b[a],m=!0;else if(typeof e===
"string"){if(!typeof(b[a]==="string")){d=!1;break a}if(d.variableName){if(e=RegExp(e).exec(b[a]))n=e[0],n=d.variableMatchPosition==="before"?b[a].substring(0,e.index):d.variableMatchPosition==="after"?b[a].substring(e.index+n.length):d.variableMatchPosition==="only"?n:b[a],m=!0}else{d=RegExp(e).test(b[a]);break a}}else b[a]===e&&(n=b[a],m=!0);if(m&&d.variableName&&(f[d.variableName]=n,f.itemCached=b,d.replacements))for(b=0;b<d.replacements.length;b++)n=!1,d.replacements[b].pattern?f[d.variableName]=
f[d.variableName].replace(RegExp(d.replacements[b].pattern),d.replacements[b].replacement||""):n=!0,n&&window.console.log("Invalid replacements specified in validation property.  "+d.replacements[b]);d=m}else d=!1}return d}}function c(d,f,e){if(e.info.validationProperties)for(var j=0;j<e.info.validationProperties.length;j++){var m=e.info.validationProperties[j];if(typeof m.source!=="undefined"){if(!h(d,m.source,m,e))return!1}else return window.console.log("Invalid validationProperties in "+b.id+".  No source property specified."),
!1}var j=!0,g=f?a.getFilenameContentType(d.Name,f):null,g=g||{id:"application/octet-stream"};e.info.excludedContentTypes&&f&&(j=e.info.excludedContentTypes.every(function(b){b=b.replace(/([*?])/g,".$1");return-1!==g.id.search(b)?!1:!0}));j&&e.info.contentType&&f&&(j=e.info.contentType.some(function(b){b=b.replace(/([*?])/g,".$1");return-1!==g.id.search(b)?!0:!1}));return j}return{info:b,validationFunction:function(b){typeof e==="function"&&(b=e.call(this,b));if(b){if(Array.isArray(b)){if((this.info.forceSingleItem||
this.info.uriTemplate)&&b.length!==1)return!1;if(b.length<1)return!1}else b=[b];for(var a=0;a<b.length;a++)if(!c(b[a],f,this))return!1;return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(b){if(this.info.uriTemplate){var a={},d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);if(this.info.validationProperties)for(d=0;d<this.info.validationProperties.length;d++){var f=this.info.validationProperties[d];f.source&&f.variableName&&(this.itemCached===
b&&this[f.variableName]||h(b,f.source,f,this),b[f.variableName]?window.console.log("Variable name "+f.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):a[f.variableName]=this[f.variableName])}a.OrionHome=m;return(new l(this.info.uriTemplate)).expand(a)}return null}}};var n=j.UnnamedCommand;f._createCommandOptions=function(b,a,e,h,c,j){function m(d,g){var n=f._makeValidator(b,e,h,j);d.visibleWhen=n.validationFunction.bind(n);if(c)if(n.generatesURI.bind(n)())d.hrefCallback=
function(b){b=Array.isArray(b.items)?b.items[0]:b.items;return n.getURI.bind(n)(b)};else{var i=b;d.callback=function(b){var h;if(i.forceSingleItem)b=Array.isArray(b.items)?b.items[0]:b.items,h=f._cloneItemWithoutChildren(b);else if(Array.isArray(b.items)){h=[];for(var c=0;c<b.items.length;c++)h.push(f._cloneItemWithoutChildren(b.items[c]))}else h=f._cloneItemWithoutChildren(b.items);if(e)var j=e.getService("orion.page.progress");a.run?j?j.progress(a.run(h),"Running command: "+d.name):a.run(h):e&&
(j?j.progress(e.getService(a).run(h),"Running command: "+d.name):e.getService(a).run(h))}}g.resolve(d)}var g=new k;if(b.nls){var i=function(a){var d;a?(d=b.tooltipKey&&a[b.tooltipKey],a=b.nameKey&&a[b.nameKey]||b.name||n,d=d||b.tooltip||""):(a=b.name||b.nameKey||n,d=b.tooltip||b.tooltipKey||"");m({name:a,image:b.image,id:b.id||b.name,tooltip:d,isEditor:b.isEditor,showGlobally:b.showGlobally},g)};d.getMessageBundle(b.nls).then(i,i.bind(this,null))}else m({name:b.name,image:b.image,id:b.id||b.name,
tooltip:b.tooltip,isEditor:b.isEditor,showGlobally:b.showGlobally},g);return g};f.getOpenWithCommand=function(b,a,d){for(var e,b=d||f.getOpenWithCommands(b),d=0;d<b.length;d++)if(b[d].visibleWhen(a)){var h=b[d].isEditor==="default";if(!e||h)if(e=b[d],h)break}return e};f.getOpenWithCommands=function(b){var a=[],d;for(d in b._commandList){var f=b._commandList[d];f.isEditor&&a.push(f)}return a};var q;f.createAndPlaceFileCommandsExtension=function(b,a,d,e,h,c){return f.createFileCommands(b,null,c?"all":
void 0,!!c,a).then(function(b){h&&0<b.length&&(a.addCommandGroup(d,"eclipse.openWith",1E3,j.OpenWith,h,null,null,null,"dropdownSelection"),a.addCommandGroup(d,"eclipse.fileCommandExtensions",1E3,j.OpenRelated,h));b.forEach(function(b){var f=null;h&&(f=b.isEditor?h+"/eclipse.openWith":h+"/eclipse.fileCommandExtensions");a.registerCommandContribution(d,b.id,e,f)});return{}})};f.createFileCommands=function(b,a,d,e,h){var d=d===void 0?"global":d,e=e===void 0?!0:e,c=[];f._cachedFileCommands||f._createCachedFileCommands(b);
(d==="all"||d==="global")&&f._cachedFileCommands.forEach(function(b){var a=b.properties;(d==="all"||a.forceSingleItem&&a.showGlobally)&&c.push(b)});return k.when(function(){var d=b.getService("orion.core.contentTypeRegistry")||a;return q||k.when(d.getContentTypes(),function(b){return q=b})}(),function(){if(e){if(!f._cachedOpenWithExtensions)f._cachedOpenWithExtensions=f._getOpenWithNavCommandExtensions(b,q);c=c.concat(f._cachedOpenWithExtensions);h._addedOpenWithCommands=e}var a=c.map(function(a){var d=
a.properties,a=a.service,e=h.findCommand(d.id||d.name);return e?(new k).resolve(e):f._createCommandOptions(d,a,b,q,!0).then(function(b){b=new g.Command(b);h.addCommand(b);return b})});return k.all(a,function(b){return{_error:b}}).then(function(b){return b})})};f._createCachedFileCommands=function(b){var a=b.getServiceReferences("orion.navigate.command");f._cachedFileCommands=[];for(var d=0;d<a.length;d++)if(a[d].getProperty("id")!=="orion.navigateFromMetadata"){var e=b.getService(a[d]),c=h(a[d]);
f._cachedFileCommands.push({properties:c,service:e})}};f.getFileCommandIds=function(){var b=[];if(f._cachedFileCommands)f._cachedFileCommands.length&&(b=f._cachedFileCommands.map(function(b){return b.properties.id}));else throw"extensionCommandUtils._cachedFileCommands is not initialized";return b};f.createOpenWithCommands=function(b,a,d){return d&&d._addedOpenWithCommands?(new k).resolve(f.getOpenWithCommands(d)):f.createFileCommands(b,a,"none",!0,d)};return f});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(i,k){function g(c){this._init(c)}g.prototype={_init:function(c){var a=k.node(c.container);if(!a)throw"no parent container";this._container=a;a.classList.remove("currentLocation");this._id=c.id||"eclipse.breadcrumbs";this._resource=c.resource||null;this._rootSegmentName=c.rootSegmentName;this._workspaceRootSegmentName=c.workspaceRootSegmentName;this._workspaceRootURL=c.workspaceRootURL;this._makeHref=c.makeHref;this._makeFinalHref=
c.makeFinalHref;this._maxLength=c.maxLength;this.path="";this.measure();this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var c;if(this._resource&&this._resource.Parents&&!this._resource.skip){c=document.createElement("a");var a=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(c,a):c.href=i.toUrl("edit/edit.html")+"#"+a}else c=document.createElement("span");k.empty(c);c.appendChild(document.createTextNode(this._workspaceRootSegmentName));
return c}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(c){var a=document.createElement("a");a.classList.add("breadcrumb");a.appendChild(document.createTextNode(c));return a},addSegmentHref:function(c,a){this._makeHref?this._makeHref(c,a.Location,a):c.href=i.toUrl("edit/edit.html")+"#"+a.ChildrenLocation},buildSegments:function(c,a){if(this._resource.Parents){var g=this._resource.Parents.slice(0),d,e;g&&(g=g.slice(0),a==="reverse"&&(g=g.reverse().slice(0)),
g.forEach(function(b){if(!b.skip)c?(e=c,c=null):e=b.Name,d=this.buildSegment(e),this.path+=b.Name,this.addSegmentHref(d,b),d.include=!1,this.segments.push(d)}.bind(this)))}},addDivider:function(){var c=document.createElement("span");c.appendChild(document.createTextNode(" / "));this.path+="/";c.classList.add("breadcrumbSeparator");this.append(c)},refresh:function(){(this.crumbs=k.node(this._id))?k.empty(this.crumbs):(this.crumbs=document.createElement("span"),this.crumbs.id=this._id,this._container.appendChild(this.crumbs),
this.dirty=document.createElement("span"),this.dirty.id="dirty",this.dirty.className="modifiedFileMarker",this._container.appendChild(this.dirty));this.crumbs.style.width="auto";this.crumbs.style.visibility="visible";this.crumbs.parentNode.className="currentLocation";this.crumbs.parentNode.style.width="auto"},append:function(c){this.crumbs.appendChild(c)},addTitle:function(c,a){var g=a||document.title;this.crumbs.childNodes.length===0&&(c=document.createElement("span"),c.appendChild(document.createTextNode(g)),
c.classList.add("breadcrumb"),c.classList.add("currentLocation"),this.append(c))},finalSegment:function(c,a){if(!this._resource.skip){var g;g=a?a:this._resource.Name;this._makeFinalHref?(c=this.buildSegment(g),this.addSegmentHref(c,this._resource)):(c=document.createElement("span"),c.appendChild(document.createTextNode(g)));c.classList.add("currentLocation");this.path+=this._resource.Name;this.append(c)}},firstSegment:function(c){if(c)if(this.append(c),this._resource&&this._resource.Parents&&!this._resource.skip)c.classList.add("breadcrumb"),
this.addDivider();else{if(!this._resource.skip)c.href="";c.classList.add("currentLocation")}},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(c){c.include===!0&&(this.append(c),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var c=this.segments.slice(0).reverse();c.forEach(function(a){this.append(a);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?a.include=!0:this.INCLUDE_FIRST_SECTION=
!1}.bind(this));this.segments=c.reverse()}},measure:function(){var c=this._container;c.style.width="auto";this.MAX_LENGTH=this._maxLength?this._maxLength:c.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var c=this.getNavigatorWorkspaceRootSegment(),a=this._rootSegmentName;if(a)this.addTitle(c,a);else if(this.finalSegment(c,a),this._resource&&this._resource.Parents&&(this.buildSegments(a,"reverse"),this.measureSegments(),this.firstSegment(c)),this.crumbs.offsetWidth>=
this.MAX_LENGTH)this.INCLUDE_FIRST_SECTION=!1},render:function(){this.refresh();var c=this.getNavigatorWorkspaceRootSegment(),a=this._rootSegmentName;a?this.addTitle(c,a):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(c),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(c,a)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};g.prototype.constructor=g;return{BreadCrumbs:g}});
define("orion/webui/splitter",["require","orion/EventTarget","orion/webui/littlelib"],function(i,k,g){function c(a){k.attach(this);this._init(a)}c.prototype={_init:function(a){this._tracking=null;this._animationDelay=501;this._closeReversely=a.closeReversely;this.$node=g.node(a.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=g.node(a.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=g.node(a.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";
this._vertical=a.vertical;this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(a.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add(this._vertical?"splitVerticalThumbLayout":"splitThumbLayout");this._closeByDefault=this.$node.getAttribute("data-initial-state")==="closed";if(typeof a.closeByDefault!=="undefined")this._closeByDefault=a.closeByDefault;this._initializeFromStoredSettings();
this._closed?(this._closed=!1,this._thumbDown(!0,!0)):this._adjustToSplitPosition();this.$node.style.visibility="visible";this.$mainNode.style.display="block";this.$sideNode.style.display="block";this.$node.addEventListener("mousedown",this._mouseDown.bind(this),!1);window.addEventListener("mouseup",this._mouseUp.bind(this),!1);window.addEventListener("resize",this._resize.bind(this),!1)},isClosed:function(){return this._closed},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||
this._thumbDown()},addResizeListener:function(a){this.addEventListener("resize",function(c){a(c.node)})},_initializeFromStoredSettings:function(){var a=localStorage.getItem(this._prefix+"/toggleState");this._closed=typeof a==="string"?a==="closed":this._closeByDefault;var a=g.bounds(this.$node.parentNode),c=g.bounds(this.$node),d;if(this._vertical)if(d=localStorage.getItem(this._prefix+"/yPosition")){if(this._splitTop=parseInt(d,10),this._splitTop>a.top+a.height-c.height)this._splitTop=a.top+a.height/
2}else{if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitTop=0}else if(d=localStorage.getItem(this._prefix+"/xPosition")){if(this._splitLeft=parseInt(d,10),this._splitLeft>a.left+a.width-c.width)this._splitLeft=a.left+a.width/2}else if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitLeft=0},_getSplitPosition:function(){var a=g.bounds(this.$node),c=g.bounds(this.$node.parentNode);return this.vertical?a.top-c.top:a.left-c.left},_adjustToSplitPosition:function(a){var c=
g.bounds(this.$node),d=g.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=c.height;if(a||!this._splitTop)this._splitTop=c.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);a=this._splitTop;this.$node.parentNode.style.position==="relative"&&(a=this._splitTop-d.top);this.$sideNode.style.height=a+"px";this.$sideNode.style.display="block";this.$node.style.top=a+"px"}else{this._splitWidth=c.width;if(a||!this._splitLeft)this._splitLeft=c.left,localStorage.setItem(this._prefix+
"/xPosition",this._splitLeft);a=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(a=this._splitLeft-d.left);this.$sideNode.style.width=a+"px";this.$sideNode.style.display="block";this.$node.style.left=a+"px"}this._resize()},_resize:function(a,c,d){var a=a||0,e=g.bounds(this.$node.parentNode),b=g.bounds(this.$node);this._vertical?(d===void 0&&(d=b.top-e.top),d+=b.height,this.$mainNode.style.top=d+"px"):(c===void 0&&(c=b.left-e.left),c+=b.width,this.$mainNode.style.left=c+"px");var j=
this;window.setTimeout(function(){j._notifyResizeListeners(j.$mainNode);j._notifyResizeListeners(j.$sideNode)},a)},_notifyResizeListeners:function(a){this.dispatchEvent({type:"resize",node:a})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(a,c){a||this._addAnimation();var d=this._splitTop,e=this._splitLeft;if(this._closed){if(this._closed=!1,!this._splitLeft&&!this._splitTop&&typeof this._initialSplit==="number")d=e=this._initialSplit}else if(this._closed=
!0,this._closeReversely){var b=g.bounds(this.$node.parentNode),j=g.bounds(this.$node);this._vertical?d=b.height-j.height:e=b.width-j.width}else d=e=0;this._vertical?(this.$sideNode.style.height=d+"px",this.$node.style.top=d+"px"):(this.$sideNode.style.width=e+"px",this.$node.style.left=e+"px");this._resize(this._animationDelay,e,d);a||this._removeAnimation();c||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var h=this;window.setTimeout(function(){h._notifyToggleListeners()},
this._animationDelay)},_removeAnimation:function(){var a=this;window.setTimeout(function(){a.$sideNode.classList.remove(a._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");a.$mainNode.classList.remove(a._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");a.$node.classList.remove(a._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add(this._vertical?"sidePanelVerticalLayoutAnimation":
"sidePanelLayoutAnimation");this.$mainNode.classList.add(this._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");this.$node.classList.add(this._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},_mouseDown:function(a){if(a.target===this._thumb)return g.stop(a),this._thumbDown();if(!this._tracking)this.$node.classList.add("splitTracking"),this.$mainNode.classList.add("panelTracking"),this.$sideNode.classList.add("panelTracking"),this._tracking=this._mouseMove.bind(this),
window.addEventListener("mousemove",this._tracking),g.setFramesEnabled(!1),g.stop(a)},_mouseMove:function(a){if(this._tracking){var c=g.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=a.clientY;if(this._splitTop<c.top+5)this._splitTop=c.top+5;else if(this._splitTop>c.top+c.height-5)this._splitTop=c.top+c.height-5;var d=this._splitTop,d=this._splitTop-c.top;this.$node.style.top=d+"px"}else{this._splitLeft=a.clientX;if(this._splitLeft<c.left+5)this._splitLeft=c.left+5;else if(this._splitLeft>
c.left+c.width-5)this._splitLeft=c.left+c.width-5;d=this._splitLeft;d=this._splitLeft-2*c.left;this.$node.style.left=d+"px"}this._adjustToSplitPosition(!0);g.stop(a)}},_mouseUp:function(a){if(this._tracking)g.setFramesEnabled(!0),window.removeEventListener("mousemove",this._tracking),this._tracking=null,this.$node.classList.remove("splitTracking"),this.$mainNode.classList.remove("panelTracking"),this.$sideNode.classList.remove("panelTracking"),g.stop(a)}};c.prototype.constructor=c;return{Splitter:c}});
define("orion/keyAssist",["i18n!orion/nls/messages","orion/webui/littlelib","orion/util"],function(i,k,g){function c(a){this.commandRegistry=a.commandRegistry;this.create();this._filterString="";this._providers=[]}c.prototype={addProvider:function(a){this._providers.push(a)},create:function(){var a=this._keyAssistDiv=document.createElement("div");a.id="keyAssist";a.style.display="none";a.classList.add("keyAssistFloat");a.setAttribute("role","menu");var c=this._keyAssistInput=document.createElement("input");
c.classList.add("keyAssistInput");c.type="text";c.placeholder=i["Filter bindings"];a.appendChild(c);var d=this._keyAssistContents=document.createElement("div");d.classList.add("keyAssistContents");if(g.isIOS||g.isAndroid)d.style.overflowY="auto";a.appendChild(d);var e=this._keyAssistTable=document.createElement("table");e.tabIndex=0;e.classList.add("keyAssistList");d.appendChild(e);document.body.appendChild(a);c.addEventListener("keydown",function(b){this._keyDown(b)}.bind(this));e.addEventListener("keydown",
function(b){this._keyDown(b)}.bind(this));c.addEventListener("input",function(){this.filterChanged()}.bind(this));d.addEventListener(g.isFirefox?"DOMMouseScroll":"mousewheel",function(b){this._scrollWheel(b)}.bind(this));document.addEventListener("keydown",function(b){b.keyCode===k.KEY.ESCAPE&&this.hide()}.bind(this));k.addAutoDismiss([a],function(){this.hide()}.bind(this))},createContents:function(){k.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;for(var a=this._idCount=
this._keyAssistContents.scrollTop=0;a<this._providers.length;a++)this._providers[a].showKeyBindings(this);this.createHeader(i.Global);this.commandRegistry.showKeyBindings(this)},createItem:function(a,c,d){if(this._filterString){var e=this._filterString.toLowerCase(),b;e!==this._filterString?(e=this._filterString,b=function(b){return b}):b=function(b){return b.toLowerCase()};if(b(c).indexOf(e)===-1&&b(a).indexOf(e)===-1&&b(this._lastHeader).indexOf(e)===-1)return}var j=this._keyAssistTable.insertRow(-1);
j.id="keyAssist-keyBinding-"+this._idCount++;j.setAttribute("role","menuitem");j._execute=d;j.classList.add("keyAssistItem");j.addEventListener("click",function(b){this._selectedRow=j;this.execute();b.preventDefault()}.bind(this));d=j.insertCell(-1);d.classList.add("keyAssistName");d.appendChild(document.createTextNode(c));d=j.insertCell(-1);d.classList.add("keyAssistAccel");d.appendChild(document.createTextNode(a))},createHeader:function(a){this._lastHeader=a;var c=this._keyAssistTable.insertRow(-1);
c.classList.add("keyAssistSection");var c=c.insertCell(-1),d=document.createElement("h2");d.appendChild(document.createTextNode(a));c.appendChild(d)},execute:function(){window.setTimeout(function(){this.hide();var a=this._selectedRow;this._selectedRow=null;a&&a._execute&&a._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var a=this._keyAssistInput.value;if(this._filterString!==a)this._filterString=
a,this.createContents()}.bind(this),100)},hide:function(){if(this.isVisible()){var a=document.activeElement,c=this._keyAssistDiv,a=c===a||(c.compareDocumentPosition(a)&16)!==0;c.style.display="none";a&&document.compareDocumentPosition(this._previousActiveElement)!==1&&this._previousActiveElement.focus();this._previousActiveElement=null}},isVisible:function(){return this._keyAssistDiv.style.display==="block"},removeProvider:function(a){a=this._providers.indexOf(a);a!==-1&&this._providers.splice(a,
1)},select:function(a){var c=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(c.length===0)this._selectedIndex=-1;else{var d=this._selectedIndex;d+=a?1:-1;d%=c.length;d<0&&(d=c.length-1);if(this._selectedIndex!==-1)a=c[this._selectedIndex],a.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=d;if(this._selectedIndex!==-1){this._selectedRow=a=c[this._selectedIndex];a.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",a.id);this._keyAssistTable.focus();
var c=a.getBoundingClientRect(),e=this._keyAssistContents,b=e.getBoundingClientRect();a.offsetTop<e.scrollTop?d===0?e.scrollTop=0:a.scrollIntoView(!0):c.bottom>b.bottom&&a.scrollIntoView(!1)}}},show:function(){if(!this.isVisible())this._previousActiveElement=document.activeElement,this.createContents(),this._keyAssistContents.style.height=Math.floor(this._keyAssistDiv.parentNode.clientHeight*0.75)+"px",this._keyAssistDiv.style.display="block",this._keyAssistInput.value=this._filterString,this._keyAssistInput.focus(),
this._keyAssistInput.select()},_keyDown:function(a){if(a.keyCode===40)this.select(!0);else if(a.keyCode===38)this.select(!1);else if(a.keyCode===13)this.execute();else return;a.preventDefault()},_scrollWheel:function(a){var c=0,c=g.isIE||g.isOpera?-a.wheelDelta:g.isFirefox?a.detail*40:-a.wheelDeltaY,d=this._keyAssistContents,e=d.scrollTop;d.scrollTop+=c;if(e!==d.scrollTop)return a.preventDefault&&a.preventDefault(),!1}};return{KeyAssistPanel:c}});
define("orion/widgets/themes/ThemePreferences",[],function(){function i(i,g){this._preferences=i;this._themeData=g;var c=g.getThemeStorageInfo();this._themeVersion=c.version;var a=i.listenForChangedSettings(c.storage,2,function(c){c.key===a&&this.apply()}.bind(this))}i.prototype={_initialize:function(i,g,c){var a,l;this._themeVersion===void 0||c.get("version")===this._themeVersion?(a=c.get(i.styleset),(l=c.get("selected"))&&(l=JSON.parse(l))):l=a=null;a||(a=g.getStyles(),c.put(i.styleset,JSON.stringify(a)));
if(!l||l[i.selectedKey]===void 0)l=l||{},l[i.selectedKey]=i.defaultTheme,c.put("selected",JSON.stringify(l));c.put("version",this._themeVersion)},apply:function(){this.setTheme()},getTheme:function(i){var g=this._themeData,c=g.getThemeStorageInfo();this._preferences.getPreferences(c.storage,2).then(function(a){this._initialize(c,g,a);var l=JSON.parse(a.get("selected")),a=JSON.parse(a.get(c.styleset)),d;if(a)for(var e=0;e<a.length;e++)if(a[e].name===l[c.selectedKey]){d=a[e];break}i({style:d,styles:a})}.bind(this))},
setTheme:function(i,g){var c=this._themeData,a=c.getThemeStorageInfo();this._preferences.getPreferences(a.storage,2).then(function(l){this._initialize(a,c,l);var d=JSON.parse(l.get("selected"));i||(i=d[a.selectedKey]);d[a.selectedKey]=i;l.put("selected",JSON.stringify(d));g?l.put(a.styleset,JSON.stringify(g)):g=JSON.parse(l.get(a.styleset));for(var e=0;e<g.length;e++)if(g[e].name===d[a.selectedKey]){c.processSettings(g[e]);break}l.put("version",this._themeVersion)}.bind(this))},setFontSize:function(i){var g=
this._themeData,c=g.getThemeStorageInfo();this._preferences.getPreferences(c.storage,2).then(function(a){this._initialize(c,g,a);var l=JSON.parse(a.get("selected")),d=JSON.parse(a.get(c.styleset)),e;if(d)for(var b=0;b<d.length;b++)d[b].fontSize=i,d[b].name===l[c.selectedKey]&&(e=d[b]);a.put(c.styleset,JSON.stringify(d));g.processSettings(e)}.bind(this))}};return{ThemePreferences:i}});
define("orion/settings/nls/root/messages",{"Plugin Description":"Plugin Description",Create:"Create","Loading...":"Loading...","Label:":"Label:",Title:"Title",Plugins:"Plugins","User Profile":"User Profile",Git:"Git","Git Settings":"Git Settings",General:"General",Navigation:"Navigation",Links:"Links","Open in same tab":"Open in same tab","Open in new tab":"Open in new tab",Font:"Font",Family:"Family","Sans Serif":"Sans Serif",Serif:"Serif",Size:"Size","8pt":"8pt","9pt":"9pt","10pt":"10pt","12pt":"12pt",
Color:"Color",Background:"Background",Strings:"Strings","String Types":"String Types",blue:"blue",Weight:"Weight",Normal:"Normal",Bold:"Bold",Comments:"Comments","Comment Types":"Comment Types",green:"green",Keywords:"Keywords","Keyword Types":"Keyword Types",darkred:"darkred",Categories:"Categories",Username:"Username","Full Name":"Full Name","Email Address":"Email Address","Email Confirmed":"Email Confirmed",Account:"Account","Current Password":"Current Password","New Password":"New Password","Verify Password":"Verify Password",
Password:"Password",OpenId:"OpenId",AOL:"AOL",Yahoo:"Yahoo",Google:"Google",Unlink:"Unlink",Link:"Link",Unlinked:"Unlinked",Linked:"Linked","Linked Accounts":"Linked Accounts","Git Email Address":"Git Email Address","Git Username":"Git Username","Git Credentials Storage":"Git Credentials Storage",Update:"Update","Update Profile Settings":"Update Profile Settings","Update Git User Settings":"Update Git User Settings","Update Git Credentials":"Update Git Credentials","User profile data successfully updated.":"User profile data successfully updated.",
"Git user data successfully updated.":"Git user data successfully updated.","Git Credentials successfully updated.":"Git Credentials successfully updated.","Edit Plugin JavaScript":"Edit Plugin JavaScript","Install Plugin":"Install Plugin","Plugin Name:":"Plugin Name:","Author Name:":"Author Name:","Licence:":"Licence:","Description:":"Description:","A plugin for Eclipse Orion":"A plugin for Eclipse Orion","Plugin Link":"Plugin Link",Install:"Install","Install a plugin by specifying its URL":"Install a plugin by specifying its URL",
"Plugin URL:":"Plugin URL:",Disable:"Disable",DisableTooltip:"Disable the plugin",Enable:"Enable",EnableTooltip:"Enable the plugin","Reload all":"Reload all","Reload all installed plugins":"Reload all installed plugins","Create a new Orion Plugin":"Create a new Orion Plugin","Find More Orion Plugins":"Find More Orion Plugins","Get Plugins":"Get Plugins",Reload:"Reload","Reload the plugin":"Reload the plugin",Delete:"Delete","Delete this plugin from the configuration":"Delete this plugin from the configuration",
"Type a plugin url here ...":"Type a plugin url here ...","Installed ":"Installed ","Installing ":"Installing ","Already installed":"Already installed"," plugin":" plugin","Reloaded ":"Reloaded ","Uninstalled ":"Uninstalled ","Are you sure you want to uninstall '":"Are you sure you want to uninstall '",Services:"Services",Value:"Value","JavaScript Object":"JavaScript Object","click here, then check javascript console to drill down":"click here, then check javascript console to drill down",Item:"Item",
"Git Config":"Git Config","Clear Git Credentials":"Clear Git Credentials","Enable Storage":"Enable Storage","Please be aware that your credentials will be stored persistently in the browser.":"Please be aware that your credentials will be stored persistently in the browser.","Do you wish to enable the Key Storage?":"Do you wish to enable the Key Storage?",general:"General",validation:"Validation","Deleted git credentials for ${0}":"Deleted git credentials for ${0}",Editor:"Editor",editorSettings:"Settings",
EditorThemes:"Themes",Import:"Import","Import a theme":"Import a theme",Export:"Export","Export a theme":"Export a theme","Theme name:":"Theme name:",yourTheme:"yourTheme",fileManagement:"File Management",typing:"Typing",autoSave:"Auto Save",autoSaveTimeout:"Save interval (ms)",autoLoad:"Auto Load",saveDiffs:"Save file as diffs",trimTrailingWhiteSpace:"Trim Trailing Whitespace on Save",Restore:"Restore Defaults",Default:"Default",keys:"Keys",tabs:"Tabs",tabSize:"Tab Size",expandTab:"Insert spaces for tabs",
smoothScrolling:"Smooth Scrolling",scrollAnimation:"Scrolling Animation",scrollAnimationTimeout:"Scrolling Duration (ms)",keyBindings:"Key Bindings",rulers:"Rulers",annotationRuler:"Show Annotation Ruler",lineNumberRuler:"Show Line Number Ruler",foldingRuler:"Show Folding Ruler",overviewRuler:"Show Overview Ruler",whitespaces:"White Spaces",wrapping:"Wrapping",wordWrap:"Word Wrap",showMargin:"Show Margin",marginOffset:"Margin Column",showTabs:"Show Tabs",showSpaces:"Show Spaces",autoSaveTimeoutInvalid:"Invalid save interval.",
scrollAnimationTimeoutInvalid:"Invalid scrolling duration.",tabSizeInvalid:"Invalid tab size.",localSettingsTooltip:"Toggle whether this setting is shown in the local editor settings drop down.",editorSettingsInfo:"Use the ${0} and ${1} to toggle whether a given setting is shown in the local editor settings drop down ${2}.",autoPairParentheses:"Autopair (Parentheses)",autoPairBraces:"Autopair {Braces}",autoPairSquareBrackets:"Autopair [Square] Brackets",autoPairAngleBrackets:"Autopair <Angle> Brackets",
autoPairQuotations:'Autopair "Strings"',autoCompleteComments:"Autocomplete /** Block Comments */",smartIndentation:"Smart Indentation",sourceControl:"Source Control",showBlame:"Show Blame",languageTools:"Language Tools",showOccurrences:"Show Occurrences",contentAssistAutoTrigger:"Show Content Assist automatically","Editor preferences updated":"Editor preferences updated","Editor defaults restored":"Editor defaults restored",Theme:"Theme","Font Size":"Font Size","New Theme Name:":"New Theme Name:",
"Font Size:":"Font Size:","UI Theme":"UI Theme","Navigation Bar":"Navigation Bar","Navigation Text":"Navigation Text","Search Box":"Search Box","Tool Panel":"Tool Panel","Selection Bar":"Selection Bar",Location:"Location",Content:"Content","Main Panel":"Main Panel",Button:"Button","Button Text":"Button Text","Section Text":"Section Text","Side Panel":"Side Panel","Line Color":"Line Color","Line Numbers":"Line Numbers",Foreground:"Foreground","Current Line":"Current Line","HTML Attribute":"HTML Attribute",
"Overview Ruler":"Overview Ruler","HTML Tag":"HTML Tag","Annotation Ruler":"Annotation Ruler","Show Guide":"Show Guide","Check Guide":"Check Guide",Cancel:"Cancel","Revert Theme":"Revert Theme","Update Theme":"Update Theme","Theme:":"Theme:",clickDiagram:"Click diagram to style.",clickUpdate:"Click Update button to save preview.","CSS Class Name":"CSS Class Name","CSS Attribute":"CSS Attribute","CSS Value":"CSS Value","CSS Text":"CSS Text","COLOR:":"Color:","NEW COLOR:":"New Color:",Ok:"Ok","OR HEX:":"Or Hex: "});
define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(i,k){var g={root:k};Object.keys(i).forEach(function(c){typeof g[c]==="undefined"&&(g[c]=i[c])});return g});
define("orion/editor/eventTarget",[],function(){function i(){}i.addMixin=function(k){var g=i.prototype,c;for(c in g)g.hasOwnProperty(c)&&(k[c]=g[c])};i.prototype={addEventListener:function(i,g,c){if(!this._eventTypes)this._eventTypes={};var a=this._eventTypes[i];a||(a=this._eventTypes[i]={level:0,listeners:[]});a.listeners.push({listener:g,useCapture:c})},dispatchEvent:function(i){var g=i.type;this._dispatchEvent("pre"+g,i);this._dispatchEvent(g,i);this._dispatchEvent("post"+g,i)},_dispatchEvent:function(i,
g){var c=this._eventTypes?this._eventTypes[i]:null;if(c){var a=c.listeners;try{if(c.level++,a)for(var l=0,d=a.length;l<d;l++)if(a[l]){var e=a[l].listener;typeof e==="function"?e.call(this,g):e.handleEvent&&typeof e.handleEvent==="function"&&e.handleEvent(g)}}finally{if(c.level--,c.compact&&c.level===0){for(l=a.length-1;l>=0;l--)a[l]||a.splice(l,1);a.length===0&&delete this._eventTypes[i];c.compact=!1}}}},isListening:function(i){return!this._eventTypes?!1:this._eventTypes[i]!==void 0},removeEventListener:function(i,
g,c){if(this._eventTypes){var a=this._eventTypes[i];if(a){for(var l=a.listeners,d=0,e=l.length;d<e;d++){var b=l[d];if(b&&b.listener===g&&b.useCapture===c){a.level!==0?(l[d]=null,a.compact=!0):l.splice(d,1);break}}l.length===0&&delete this._eventTypes[i]}}}};return{EventTarget:i}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(i,k,g){function c(a){a=a||{};this._document=a.document||document}var a={};c.getTheme=function(g){var g=g||"default",d=a[g];d||(d=a[g]=new c);return d};c.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(a,d){var e=this,b=e._themeClass;e._themeClass=a;this._load(a,d,function(){e.onThemeChanged({type:"ThemeChanged",oldValue:b,newValue:e.getThemeClass()})})},onThemeChanged:function(a){return this.dispatchEvent(a)},
buildStyleSheet:function(a,d){function e(d,e,f){e&&(b.push("."+a+" ."+d+" {"),b.push("\t"+(f?"background-color":"color")+": "+e+";"),b.push("}"))}var b=[];b.push("");b.push("."+a+" {");d.fontFamily&&b.push("\tfont-family: "+d.fontFamily+";");d.fontSize&&b.push("\tfont-size: "+d.fontSize+";");d.fontSize&&b.push("\tcolor: "+d.text+";");b.push("}");b.push("."+a+".textview {");d.background&&b.push("\tbackground-color: "+d.background+";");b.push("}");e("ruler.annotations",d.annotationRuler,!0);e("ruler.lines",
d.annotationRuler,!0);e("ruler.folding",d.annotationRuler,!0);e("ruler.overview",d.overviewRuler,!0);e("rulerLines",d.lineNumber,!1);e("rulerLines.even",d.lineNumberEven,!1);e("rulerLines.odd",d.lineNumberOdd,!1);e("annotationLine.currentLine",d.currentLine,!0);e("entity-name-tag",d.keyword,!1);e("entity-other-attribute-name",d.attribute,!1);e("string-quoted",d.string,!1);e("meta.annotation.currentLine",d.currentLine,!0);e("keyword",d.keyword,!1);e("string",d.string,!1);e("comment",d.comment,!1);
e("comment.block.documentation",d.comment,!1);e("keyword.other.documentation.markup",d.comment,!1);return b.join("\n")},_createStyle:function(a,d,e,b){var c=this._document,a="orion-theme-"+a,h=c.getElementById(a);if(h){if(b||h.firstChild.data===d)return;h.removeChild(h.firstChild);h.appendChild(c.createTextNode(d))}else b?(h=g.createElement(c,"link"),h.rel="stylesheet",h.type="text/css",h.href=d,h.addEventListener("load",function(){e()})):(h=g.createElement(c,"style"),h.appendChild(c.createTextNode(d))),
h.id=a,(c.getElementsByTagName("head")[0]||c.documentElement).appendChild(h);b||e()},_load:function(a,d,e){if(a)if(typeof d==="string")this._createStyle(a,d,e);else if(d=d.href,d.substring(d.length-4)!==".css"&&(d+=".css"),/^\//.test(d)||/[a-zA-Z0-9]+:\/\//i.test(d)||!i.toUrl)this._createStyle(a,d,e,!0);else{var b=this;i(["text!"+d],function(d){b._createStyle(a,d,e,!1)})}else e()}};k.EventTarget.addMixin(c.prototype);return{TextTheme:c}});
define("orion/widgets/themes/ThemeClass",[],function(){function i(i){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=i;this.classString="."+i+"{ "}i.prototype.className=null;i.prototype.classString=void 0;i.prototype.style=void 0;i.prototype.closeString=" }\n";i.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:i}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(i){function k(){}k.prototype.navbar="white";k.prototype.button="#777777";k.prototype.location="#EFEFEF";k.prototype.selection="#cedce7";k.prototype.sidepanel="#F7F7F7";k.prototype.mainpanel="white";k.prototype.navtext="#bfbfbf";k.prototype.content="#3087B3";k.prototype.search="#444";k.prototype.toolpanel="white";k.prototype.writeNavigationStyle=function(){var g="",c=[],a=new i.ThemeClass("orionPage");
a.style.backgroundColor="#fdfdfd";a.style.width="100%";a.style.height="100%";c.push(a);a=new i.ThemeClass("topRowBanner");a.style.margin="0";a.style.border="0";a.style.backgroundColor=this.navbar;a.style.height="16px";a.style.padding="10px";a.style.paddingLeft="6px";a.style.paddingRight="2px";a.style.borderBottom="none";a.style.boxShadow="0 2px 2px 0 rgba(0, 0, 0, 0.1),0 1px 0 0 rgba(0, 0, 0, 0.1)";a.style.zIndex="100";c.push(a);a=new i.ThemeClass("a");a.style.textDecoration="none";a.style.color=
this.content;c.push(a);a=new i.ThemeClass("navlink");a.style.display="inline-block";a.style.padding="2px";a.style.color=this.content;a.style.verticalAlign="bottom";c.push(a);a=new i.ThemeClass("primaryNav");a.style.color=this.navtext;a.style.fontSize="8pt";a.style.fontWeight="normal";a.style.paddingTop="0";a.style.verticalAlign="baseline";c.push(a);a=new i.ThemeClass("primaryNav a");a.style.fontSize="8pt";a.style.color=this.navtext;a.style.marginRight="6px";a.style.marginLeft="6px";a.style.verticalAlign=
"baseline";a.style.textDecoration="none";c.push(a);a=new i.ThemeClass("primaryNav a:hover");a.style.color="#bfbfbf";a.style.cursor="hand";a.style.color="white";a.style.fontWeight="normal";c.push(a);for(var k in c)g+=c[k].toString();return g};k.prototype.writeLocationStyle=function(){var g="",c=[],a=new i.ThemeClass("titleArea");a.style.margin="0";a.style.paddingTop="5px";a.style.border="0";a.style.background=this.location;a.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+
this.location+"), color-stop(100%,"+this.location+"))";a.style.borderBottom="1px solid "+this.location;a.style.minHeight="20px";c.push(a);a=new i.ThemeClass("breadcrumb");a.style.fontSize="8pt";a.style.textDecoration="none";a.style.color="#f1f1f2;";a.style.paddingTop="2px";c.push(a);a=new i.ThemeClass("a.breadcrumb:hover");a.style.textDecoration="none";a.style.borderBottom="1px dotted";a.style.color="#F58B0F";a.style.cursor="pointer";c.push(a);a=new i.ThemeClass("breadcrumbSeparator");a.style.fontSize=
"8pt";a.style.textDecoration="none";a.style.color=this.separator;a.style.fontWeight="bold";c.push(a);a=new i.ThemeClass("currentLocation");a.style.fontWeight="bold";a.style.fontSize="8pt";a.style.color=this.breadcrumb;a.style.textDecoration="none";a.style.textWrap="normal";a.style.lineHeight="10pt";c.push(a);a=new i.ThemeClass("a.currentLocation:hover");a.style.fontWeight="bold";a.style.fontSize="10pt";a.style.color="#666666";a.style.textDecoration="none";a.style.borderBottom="0";c.push(a);a=new i.ThemeClass("navlinkonpage");
a.style.color=this.content;a.style.verticalAlign="middle";c.push(a);if(this.bannerProgress)a=new i.ThemeClass("topRowBanner .progressPane_running"),a.style.borderColor=this.bannerProgress,c.push(a);for(var k in c)g+=c[k].toString();return g};k.prototype.writeButtonStyle=function(){var g="",c=[],a=new i.ThemeClass("commandButton");a.style.color="#666";a.style.border="1px solid #dedede";a.style.backgroundColor="#ddd";a.style.textAlign="center";a.style.verticalAlign="middle";a.style.cursor="pointer";
a.style.display="inline-block";a.style.padding="4px 6px";a.style.borderRadius="3px";a.style.lineHeight="12px";a.style.fontSize="9pt";a.style.userSelect="none";c.push(a);a=new i.ThemeClass("commandButton:over");a.style.backgroundColor="#e6e6e6";a.style.border="1px solid #808080";c.push(a);a=new i.ThemeClass("commandMenu");a.style.color="#222";a.style.display="inline-block";a.style.verticalAlign="baseline";a.style.margin="0";a.style.fontSize="8pt";a.style.fontWeight="normal";a.style.border="1px solid #dedede";
a.style.backgroundColor="#efefef";a.style.cursor="pointer";a.style.borderRadius="1px";c.push(a);a=new i.ThemeClass("commandMenuItem");a.style.border="0";a.style.padding="0";a.style.margin="0";c.push(a);for(var k in c)g+=c[k].toString();return g};k.prototype.writeMainStyle=function(){var g="",c=[],a=new i.ThemeClass("searchbox");a.style.backgroundImage="url(../images/core_sprites.png)";a.style.backgroundRepeat="no-repeat";a.style.backgroundPosition="4px -297px";a.style.width="12px";a.style.height=
"12px";a.style.backgroundColor=this.search;a.style.border="1px solid "+this.search;a.style.fontSize="11px";a.style.width="15em";a.style.height="16px";a.style.borderRadius="10px";a.style.color="#999";a.style.padding="0";a.style.paddingLeft="20px";a.style.marginLeft="5px";a.style.marginTop="6px !important";a.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";c.push(a);a=new i.ThemeClass("searchbox:focus");a.style.color="white";a.style.outline=
"none";c.push(a);a=new i.ThemeClass("checkedRow");a.style.cssText="background-color:"+this.selection+" !important;";c.push(a);a=new i.ThemeClass("navbar-item-selected");a.style.background=this.selection;a.style.color=this.content;c.push(a);a=new i.ThemeClass("auxpane");a.style.border="0";a.style.background=this.sidepanel;c.push(a);a=new i.ThemeClass("mainpane");a.style.background=this.mainpanel;a.style.border=0;c.push(a);a=new i.ThemeClass("mainToolbar");a.style.background=this.toolpanel;c.push(a);
for(var k in c)g+=c[k].toString();return g};k.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};k.prototype.getSheet=function(g){g.navbar.value?(this.navbar=g.navbar.value,this.button=g.button.value,this.location=g.location.value,this.selection=g.selection.value,this.sidepanel=g.sidepanel.value,this.mainpanel=g.mainpanel.value,this.navtext=g.navtext.value,this.search=
g.search.value,this.content=g.content.value,this.toolpanel=g.toolpanel.value,this.bannerProgress=g.bannerProgress.value):(this.navbar=g.navbar,this.button=g.button,this.location=g.location,this.selection=g.selection,this.sidepanel=g.sidepanel,this.mainpanel=g.mainpanel,this.navtext=g.navtext,this.search=g.search,this.content=g.content,this.toolpanel=g.toolpanel,this.bannerProgress=g.bannerProgress);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:k}});
define("orion/widgets/themes/container/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter"],function(i,k,g){function c(){}function a(){this.styles=[];var a=new c;a.name="Orion";a.navbar="white";a.button="#EFEFEF";a.location="#efefef";a.selection="FEC";a.sidepanel="#FBFBFB";a.mainpanel="white";a.toolpanel="white";a.navtext="#bfbfbf";a.content="#3087B3";a.search="#444";a.breadcrumb="#3087B3";a.separator="#333";a.bannerProgress="whitesmoke";
this.styles.push(a);a=new c;a.name="Orion2014";a.navbar="white";a.button="#EFEFEF";a.location="#EFEFEF";a.selection="FEC";a.sidepanel="#EEEEEE";a.mainpanel="#EEEEEE";a.toolpanel="#EEEEEE";a.navtext="#BFBFBF";a.content="#333333";a.search="#444444";a.breadcrumb="#333333";a.separator="#333333";a.bannerProgress="orange";this.styles.push(a);a=new c;a.name="Green Zone";a.navbar="seagreen";a.button="lavender";a.location="darkseagreen";a.selection="moccasin";a.sidepanel="aliceblue";a.mainpanel="white";a.toolpanel=
"white";a.navtext="#FBFBFB";a.content="darkgreen";a.search="darkgreen";a.breadcrumb="#3087B3";a.separator="seagreen";a.bannerProgress="#F2F2F2";this.styles.push(a);a=new c;a.name="Pretty In Pink";a.navbar="plum";a.button="lavender";a.location="pink";a.selection="lavender";a.sidepanel="seashell";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="mediumorchid";a.search="violet";a.breadcrumb="#3087B3";a.separator="plum";a.bannerProgress="#F2F2F2";this.styles.push(a);a=new c;a.name=
"Blue Monday";a.navbar="cornflowerblue";a.button="lavender";a.location="skyblue";a.selection="lavender";a.sidepanel="aliceblue";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="royalblue";a.search="royalblue";a.breadcrumb="#3087B3";a.separator="cornflowerblue";a.bannerProgress="#F2F2F2";this.styles.push(a);a=new c;a.name="Vanilla Skies";a.navbar="sandybrown";a.button="lemmonchiffon";a.location="cornsilk";a.selection="lemonchiffon";a.sidepanel="white";a.mainpanel="white";a.toolpanel=
"white";a.navtext="lemonchiffon";a.content="chocolate";a.search="moccasin";a.breadcrumb="#3087B3";a.separator="sandybrown";a.bannerProgress="#F2F2F2";this.styles.push(a);a=new c;a.name="Beetlejuice";a.navbar="indigo";a.button="slateblue";a.location="darkslateblue";a.selection="silver";a.sidepanel="lavender";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="mediumslateblue";a.search="#444";a.breadcrumb="#3087B3";a.separator="indigo";a.bannerProgress="#F2F2F2";this.styles.push(a);
a=new c;a.name="Red";a.navbar="#CD2127";a.button="#777777";a.location="#D85F56";a.selection="lightcoral";a.sidepanel="#EFDAB2";a.mainpanel="#FDFADD";a.toolpanel="#FDFADD";a.navtext="#FBFBFB";a.content="darkred";a.search="#D85F56";a.breadcrumb="darkred";a.separator="#CD2127";a.bannerProgress="#F2F2F2";this.styles.push(a)}function l(){return this.styles}c.prototype.name="Orion";c.prototype.navbar="#404648";c.prototype.button="#EFEFEF";c.prototype.location="#333";c.prototype.breadcrumb="#3087B3";c.prototype.separator=
"#333";c.prototype.selection="FEC";c.prototype.sidepanel="#FBFBFB";c.prototype.mainpanel="white";c.prototype.toolpanel="white";c.prototype.navtext="#bfbfbf";c.prototype.content="#3087B3";c.prototype.search="#444";c.prototype.bannerProgress="white";a.prototype.styles=[];a.prototype.getStyles=l;a.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion2014",selectedKey:"selected",version:"5.0"}};a.prototype.getViewData=function(){var a={top:10,left:10,
width:350,height:350};a.shapes=[{type:"RECTANGLE",name:i["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:i["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:i["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:i["Tool Panel"],x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",
name:i["Selection Bar"],x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:i.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:i["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:i.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:i.Content,label:"/",x:78,y:60,family:"content",
fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:i.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:i["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:i.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:i["Button Text"],label:"Button",x:158,y:90,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"TRIANGLE",
name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:i["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:i["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:i["Line Color"],x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:i["Line Color"],
x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:i["Side Panel"],x:10,y:71,width:140,height:289,family:"sidepanel",fill:"#FBFBFB",order:12},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:i["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},
{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}];for(var e=0;e<3;e++)a.shapes.push({type:"TEXT",name:i.Content,label:"org.eclipse.orion.content",x:170,y:127+20*e,fill:"#3087B3",family:"content"});for(e=0;e<3;e++)a.shapes.push({type:"TEXT",name:i.Content,label:"Item",x:25,y:115+20*e,fill:"#3087B3",family:"content"});for(e=0;e<3;e++)a.shapes.push({type:"TRIANGLE",
name:"twisty",x1:160,y1:121+e*20,x2:165,y2:124+e*20,x3:160,y3:127+e*20,family:"navbar",fill:"#333"});a.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return a};a.prototype.processSettings=function(a){var e=new g.ThemeSheetWriter;(new k.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",e.getSheet(a))};return{ThemeData:a,getStyles:l}});
define("orion/widgets/nls/root/messages",{"no input":"no input","no output":"no output","Choose a Folder":"Choose a Folder",OK:"OK",Profile:"Profile","Sign out":"Sign out","N/A":"N/A","logged in since ":"logged in since ","Sign in":"Sign in","Authentication required!":"Authentication required!","Name:":"Name:","Plug-ins":"Plug-ins"," <No available services or timed out, check URL and try reloading>":" <No available services or timed out, check URL and try reloading>",Properties:"Properties"," (Service Id: ":" (Service Id: ",
Services:"Services","SFTP Transfer":"SFTP Transfer","Remote host:":"Remote host:","Port:":"SFTP Port:","Remote path:":"Remote path:","User name:":"User name:","Password:":"Password:","Start Transfer":"Start Transfer","Location:":"Location:","orion.sftpConnections":"orion.sftpConnections","Drag a file here":"Drag a file here","unzip zips":"Unzip *.zip files","or if you prefer":"(or upload a file using the buttons below)",Upload:"Upload","Browse...":"Browse...","Import a file or zip":"Import a file or zip",
"Missing required argument: searchRenderer":"Missing required argument: searchRenderer","Missing required argument: favService":"Missing required argument: favService","Find File Named":"Find File Named","Type the name of a file to open (? = any character, * = any string):":"Type the name of a file to open (? = any character, * = any string):",Search:"Search","FileName FolderName":"FileName FolderName(Optional)","Searching...":"Searching...","Searching for occurrences of":'Searching for occurrences of: "${0}"',
name:"name","orion.widgets.UserMenu":"orion.widgets.UserMenu",test:"test","Sign Out":"Sign Out","Sign Out ":"Sign Out ","</a>":"</a>",">":">","Sign In To ":"Sign In To ","Sign In":"Sign In",Help:"Help","Report a Bug":"Report a Bug","Keyboard Shortcuts":"Keyboard Shortcuts",Settings:"Settings","View profile of ":"View profile of ",Profiles:"Profiles","Information Needed":"Information Needed",Cancel:"Cancel","If the same file exists in both the source and destination:":"If the same file exists in both the source and destination:",
"Cancel the transfer":"Cancel the transfer","Always overwrite destination":"Always overwrite destination","Overwrite if source is newer":"Overwrite if source is newer",New:"New","Building file skeleton...":"Building file skeleton...",Add:"Add","Upload...":"Upload...","For a list of available commands type '${0}'.":"For a list of available commands type '${0}'.","Main Pages":"Main Pages","Related Links":"Related Links"});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(i,k){var g={root:k};Object.keys(i).forEach(function(c){typeof g[c]==="undefined"&&(g[c]=i[c])});return g});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(i){function k(g,c,a){this.elements=a;this.taskPanel=document.createElement("div");this.taskPanel.className="UAContainer";this.taskPanel.innerHTML='<header class="UAHeader">Develop software from within the cloud</header>';this.elementNode=document.createElement("div");this.switchesContainer=document.createElement("div");this.switches=document.createElement("span");this.radioButtons=[];this.elementNode.className="UAContainer-body";
this.taskPanel.appendChild(this.elementNode);this.switchesContainer.className="UAContainer-switch-body";this.switches.className="UAContainer-switches";this.switchesContainer.innerHTML="";this.switchesContainer.appendChild(this.switches);this.taskPanel.appendChild(this.switchesContainer);c===!0?(this.container=document.createElement("div"),this.container.className="UAModal",this.container.appendChild(this.taskPanel),this.backdrop=document.createElement("div"),this.backdrop.className="UAModalBackground",
document.body.appendChild(this.backdrop),document.body.appendChild(this.container),i.addAutoDismiss([this.container],this.destroy.bind(this))):g.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}k.prototype.elementNode=null;k.prototype.switchesContainer=null;k.prototype.switches=null;k.prototype.radioButtons=null;k.prototype.chosenSwitch=null;k.prototype.addElement=
function(g){var c=document.createElement("span");c.className="UAContainer-icon";c.innerHTML='<span class="workingSpan"><img src="'+g.image+'" id="'+g.label+'ImageNode" alt="'+g.alt+'" height="64" width="64"></span><span class="UAIcon-label"><span class="UALabel" id="'+g.label+'LabelNode" >'+g.label+"</span></span>";c.onmouseover=function(){document.getElementById(g.label+"ImageNode").src=g.secondaryImage;document.getElementById(g.label+"LabelNode").className="UALabel-live";c.className="UAContainer-icon-live"};
c.onmouseout=function(){document.getElementById(g.label+"ImageNode").src=g.image;document.getElementById(g.label+"LabelNode").className="UALabel";c.className="UAContainer-icon"};var a=this;c.onclick=function(){a.showMedia(g)};this.elementNode.appendChild(c)};k.prototype.clearElements=function(){this.elementNode.innerHTML=""};k.prototype.showMedia=function(g){this.clearElements();this.addElement(g);var c=document.createElement("span");c.className="UAContainer-media";c.innerHTML='<div></div><div></div><span class="mediaSpan"><img src="'+
g.media+'" alt="'+g.alt+'" height="300" width="400"></span>';this.elementNode.appendChild(c);setTimeout(function(){c.style.opacity=1},100);g=document.getElementById(g.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=g.parentNode;g.className="chosenCircle"};k.prototype.createSwitch=function(g){var c;c=g?g.label+"switch":"indexSwitch";var a=document.createElement("span");a.className="workingSpan";a.innerHTML='<div class="circle" id ="'+c+'"></div>';var i=this;a.onclick=
g?function(){i.showMedia(g)}:function(){i.initialize();i.chosenSwitch.firstChild.className="circle";i.chosenSwitch=a;i.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(a);return this.radioButtons[this.radioButtons.length]=a};k.prototype.initialize=function(){this.clearElements();this.elements.forEach(this.addElement.bind(this))};k.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return k});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(i,k,g,c){function a(){}var l=null;a.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'<div class="dialog" role="dialog"><div class="dialogTitle"><span id="title" class="dialogTitleText layoutLeft"></span><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" id="closeDialog"></button></div><div id="dialogContent" class="dialogContent layoutBlock"></div><div id="buttons" class="dialogButtons"></div></div>',
_initialize:function(){var a=document.body;this.$frameParent=a;this.$$modalExclusions=this.$$modalExclusions||[];var e=document.createRange();e.selectNode(a);e=e.createContextualFragment(this.CONTAINERTEMPLATE);a.appendChild(e);this.$frame=a.lastChild;this.title&&g.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=g.$("#closeDialog",this.$frame);var b=this;this.$close.addEventListener("click",function(){b.hide()},!1);this.$parent=g.$(".dialogContent",this.$frame);
e=document.createRange();e.selectNode(this.$parent);a=e.createContextualFragment(this.TEMPLATE);this.messages&&g.processTextNodes(a,this.messages);this.$parent.appendChild(a);this.$buttonContainer=g.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(a){a.keyCode===g.KEY.ESCAPE?b.hide():a.keyCode===g.KEY.ENTER&&typeof b._defaultCallback==="function"&&b._defaultCallback()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent);
this.modal&&this._makeModal()},_makeButtons:function(){if(this.$buttonContainer&&Array.isArray(this.buttons)){var a=this;this.buttons.forEach(function(e){var b=c.createButton(e.text,e.callback);if(e.id)b.id=e.id,a["$"+b.id]=b;if(e.isDefault)a._defaultCallback=e.callback,a._defaultButton=b;a.$buttonContainer.appendChild(b)})}},_makeModal:function(){var a=this;this.$frame.addEventListener("blur",function(b){a.$lastFocusedElement=b.target},!0);this._modalListener=function(b){var e=!g.contains(a.$frame,
b.target);if(e)for(var c=0;c<a.$$modalExclusions.length;c++)if(g.contains(a.$$modalExclusions[c],b.target)){e=!1;break}e&&(window.setTimeout(function(){(a.$lastFocusedElement||a.$parent).focus()},0),g.stop(b))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var e=this.$frameParent.childNodes,b=!1;this._addedBackdrop=[];for(var c=0;c<e.length;c++){for(var h=0;h<this.$$modalExclusions.length;h++)if(g.contains(this.$$modalExclusions[h],
e[c])){b=!0;break}!b&&e[c]!==a.$frame&&e[c].classList&&!e[c].classList.contains("tooltipContainer")&&(h=e[c],h.classList.contains("modalBackdrop")||(h.classList.add("modalBackdrop"),this._addedBackdrop.push(h)))}(e=g.lastTabbable(this.$buttonContainer)||g.lastTabbable(this.$parent))&&e.addEventListener("keydown",function(b){if(b.keyCode===g.KEY.TAB){var e=a._getFirstFocusField();e&&e!==b.target&&e.focus();g.stop(b)}},!1)},_addChildDialog:function(a){this.$$modalExclusions.push(a.$frame||a.$parent)},
_inModalExclusion:function(a){return this.$$modalExclusions.some(function(e){return a.$frame===e||a.$parent===e})},_bindElements:function(a){for(var e=0;e<a.childNodes.length;e++){var b=a.childNodes[e];b.id&&(this["$"+b.id]=b);this._bindElements(b)}},hide:function(a){!a&&l===this&&(l=null);typeof this._beforeHiding==="function"&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,
!0));this.$frame.classList.remove("dialogShowing");g.setFramesEnabled(!0);typeof this._afterHiding==="function"&&this._afterHiding();var e=this;this.keepAlive||window.setTimeout(function(){e.destroy()},0)},show:function(a){if(this.modal)if(l){if(!l._inModalExclusion(this)){this.hide(!0);return}}else l=this;typeof this._beforeShowing==="function"&&this._beforeShowing();g.setFramesEnabled(!1);var e=g.bounds(this.$frame),b=g.bounds(document.documentElement),c;a?(c=g.bounds(a),a=c.top+c.height+4,c=c.left+
4,a+e.height>b.height&&(a=Math.max(0,b.height-e.height-4)),c+e.width>b.width&&(c=Math.max(0,b.width-e.width-4))):(c=Math.max(0,(b.width-e.width)/2),a=Math.max(0,(b.height-e.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=a+"px";this.$frame.style.left=c+"px";this.$frame.classList.add("dialogShowing");typeof this._afterShowing==="function"&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return g.firstTabbable(this.$parent)||
this._defaultButton||g.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){if(this.$frame)l===this&&(l=null),g.setFramesEnabled(!0),this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(a){a.classList.remove("modalBackdrop")}),this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0),this.$frameParent.removeChild(this.$frame),this.$parent=this.$frame=void 0}};a.prototype.constructor=
a;return{Dialog:a}});
define("orion/widgets/UserMenu","i18n!orion/widgets/nls/messages,require,orion/webui/littlelib,orion/PageLinks,orion/widgets/userAssistance/UATaskPanel,orion/webui/dialog".split(","),function(i,k,g,c,a){function l(a){this._displaySignOut=!0;this._init(a)}l.prototype={_init:function(a){this._dropdownNode=g.node(a.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=a.dropdown;this._serviceRegistry=a.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices=
{};this._noSeparator=a.noSeparator;this._dropDownItemClass=a.dropDownItemClass;this._keyAssistClass=a.keyAssistClass;if(a.signOut!==void 0)this._displaySignOut=a.signOut},isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},hasServices:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)>0},length:function(a){var e=0,b;for(b in a)a.hasOwnProperty(b)&&e++;return e},_makeMenuItem:function(a,
e){var b=document.createElement("span");b.role="menuitem";b.tabIndex=0;var c=document.createTextNode(a);b.appendChild(c);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&b.classList.add(this._dropDownItemClass):b.classList.add("dropdownMenuItem");b.addEventListener("click",e,!1);b.addEventListener("keydown",function(b){(b.keyCode===g.KEY.ENTER||b.keyCode===g.KEY.SPACE)&&e()},!1);return b},_renderAuthenticatedService:function(a){var e=this,b=this.authenticatedServices[a].authService;
if(b&&b.logout&&this._displaySignOut){var c=document.createElement("li"),h=this._makeMenuItem(i["Sign Out"],function(){b.logout().then(function(){e.addUserItem(a,b,e.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var f=localStorage.length-1;f>=0;f--){var c=localStorage.key(f);c&&c.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(c)}b.getAuthForm(window.location.href).then(function(b){window.location=b})})});c.appendChild(h);this._dropdownNode.appendChild(c)}},
renderServices:function(){function a(d){b[d]||(b[d]=e.createDocumentFragment());return b[d]}var e=document,b=[],j=this._serviceRegistry;c.getPageLinksInfo(j,"orion.page.link.user").then(function(c){this._dropdown?this._dropdown.empty():this._dropdownNode&&g.empty(this._dropdownNode);c.getAllLinks().forEach(function(b){var f,c;if(b.category&&(c=/user\.(\d+)/.exec(b.category)))f=parseInt(c[1],10);if(typeof f!=="number"||isNaN(f))f=1;f=a(f);c=e.createElement("li");var h=e.createElement("a");h.role="menuitem";
typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&h.classList.add(this._dropDownItemClass):h.classList.add("dropdownMenuItem");h.href=b.href;h.textContent=b.textContent;c.appendChild(h);f.appendChild(c);h.addEventListener("keydown",function(b){(b.keyCode===g.KEY.ENTER||b.keyCode===g.KEY.SPACE)&&h.click()},!1)}.bind(this));if(this.keyAssistFunction){var c=document.createElement("li"),f=this._makeMenuItem(i["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass===
"string"?this._keyAssistClass!==""&&f.classList.add(this._keyAssistClass):f.classList.add("key-assist-menuitem");c.appendChild(f);a(0).appendChild(c)}if(c=j.getServiceReferences("orion.page.getstarted")[0])f=c.getProperty("data"),c=document.createElement("li"),f=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,f)),c.appendChild(f),a(0).appendChild(c);var m=this;b.sort(function(b,a){return b-a}).forEach(function(a,d){if(d<b.length-1&&!this._noSeparator){var f=document.createElement("li");
f.classList.add("dropdownSeparator");var c=document.createElement("span");c.classList.add("dropdownSeparator");f.appendChild(c);a.appendChild(f)}m._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var n in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(n)&&this._renderAuthenticatedService(n,0)}.bind(this))},getStartedDialog:function(d){new a(null,!0,d)},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,c,b,j){j?
(this.unauthenticatedServices[a]&&delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:c,label:b,data:j}):(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:c,label:b,pending:this.unauthenticatedServices[a].pending}:{authService:c,label:b});this.renderServices()}};l.prototype.constructor=l;return{UserMenu:l}});
define("orion/crawler/nls/root/messages",{"Searching file:":"Searching file:","is not supported in this file system":"is not supported in this file system","${0} files found out of ${1}":"${0} files found out of ${1}","The search term on this location will not use indexed files.":"The search term on this location will not use indexed files.","It will take longer time. Do you want to proceed?":"It will take longer time. Do you want to proceed?","Search cancelled by user":"Search cancelled by user",
Cancel:"Cancel"});define("orion/crawler/nls/messages",["orion/i18n!orion/crawler/nls/messages","orion/crawler/nls/root/messages"],function(i,k){var g={root:k};Object.keys(i).forEach(function(c){typeof g[c]==="undefined"&&(g[c]=i[c])});return g});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(i,k,g,c,a,l){function d(b,a,d){var f="";d&&(f="^");if(f=g.parse("/"+f+b.searchStr+"/"))d=f.pattern,f=f.flags,f.indexOf("i")===-1&&!a.caseSensitive&&(f+="i"),b.regExp={pattern:d,flags:f},b.wildCard=!0}var e={ALL_FILE_TYPE:"*.*"};e.doSearch=function(b,a,d,f){if(b){var c=!0;d==="*"&&(d="");d===""&&(c=f&&f.type!==e.ALL_FILE_TYPE);if(c)d!==""&&e.addRecentSearch(a,
d,f?f.regEx:!1),b=b.createSearchParams(d,!1,!1,f),b=e.generateSearchHref(b),window.location=b}else window.alert(i["Can't search: no search service is available"])};e.generateSearchHelper=function(b,a){var c=b.keyword,f=c,g={};b.fileType&&b.fileType!==e.ALL_FILE_TYPE&&c===""&&(f="*."+b.fileType);if(b.regEx)g.searchStr=c,d(g,b,a);else{var n=c.indexOf("*")>-1,i=c.indexOf("?")>-1;n&&(c=c.split("*").join(".*"));i&&(c=c.split("?").join("."));!n&&!i&&!b.nameSearch?(g.searchStr=b.caseSensitive?c.split("\\").join(""):
c.split("\\").join("").toLowerCase(),g.wildCard=!1):(g.searchStr=b.caseSensitive?c:c.toLowerCase(),d(g,b,a),g.wildCard=!0)}g.searchStrLength=g.searchStr.length;return{params:b,inFileQuery:g,displayedSearchTerm:f}};e.convertSearchParams=function(b){if(b.rows!==void 0)b.rows=parseInt(b.rows,10);if(b.start!==void 0)b.start=parseInt(b.start,10);if(typeof b.regEx==="string")b.regEx=b.regEx.toLowerCase()==="true";if(typeof b.caseSensitive==="string")b.caseSensitive=b.caseSensitive.toLowerCase()==="true";
if(typeof b.nameSearch==="string")b.nameSearch=b.nameSearch.toLowerCase()==="true"};e.copySearchParams=function(b,a){var d={},f;for(f in b)if(b[f]!==void 0&&b[f]!==null&&(a||f!=="replace"))d[f]=b[f];return d};e.generateSearchHref=function(b){var a=k.toUrl("search/search.html"),b=e.copySearchParams(b,!0),d=b.resource;b.resource=void 0;return typeof b.keyword!=="undefined"?(new l(a+"#{,resource,params*}")).expand({resource:d,params:b}):(new l(a+"#{,resource}")).expand({resource:d})};e.generateFindURLBinding=
function(b,a,d,f,c){b={find:a.searchStr,regEx:a.wildCard?!0:void 0,caseSensitive:b.caseSensitive?!0:void 0,replaceWith:typeof f==="string"?f:void 0,atLine:typeof d==="number"?d:void 0};return c?b:","+(new l("{,params*}")).expand({params:b})};e.convertFindURLBinding=function(b){if(typeof b.regEx==="string")b.regEx=b.regEx.toLowerCase()==="true";if(typeof b.caseSensitive==="string")b.caseSensitive=b.caseSensitive.toLowerCase()==="true";if(typeof b.atLine==="string")b.atLine=parseInt(b.atLine,10)};e.replaceRegEx=
function(b,a,d){return b.replace(RegExp(a.pattern,a.flags),d)};e.replaceStringLiteral=function(b,a,d){a=g.parse("/"+a+"/gim");return e.replaceRegEx(b,a,d)};e.searchOnelineLiteral=function(b,a,d){var f;f=0;for(var c=!1,e=[];;)if(f=a.indexOf(b.searchStr,f),f<0)break;else{e.push({startIndex:f,length:b.searchStrLength});c=!0;if(d)break;f+=b.searchStrLength}return c?e:null};e.findRegExp=function(b,a,d,f){if(!a)return null;d=d||"";d+=(d.indexOf("g")===-1?"g":"")+(d.indexOf("m")===-1?"m":"");var c=null;
return(c=RegExp(a,d).exec(b.substring(f)))&&{startIndex:c.index+f,length:c[0].length}};e.searchOnelineRegEx=function(b,a,d){for(var f=0,c=!1,g=[];;)if(f=e.findRegExp(a,b.regExp.pattern,b.regExp.flags,f)){g.push(f);c=!0;if(d)break;f=f.startIndex+f.length}else break;return c?g:null};e.generateNewContents=function(b,a,d,f,c,g){if(f&&a){if(!b)d.contents=[];for(var i=0;i<a.length;i++){for(var k=a[i],o=!1,l=!1,w=[],s,y=0,t=0;t<f.children.length;t++)if(f.children[t].lineNumber-1===i){y=t;for(o=0;o<f.children[t].matches.length;o++)f.children[t+
o].checked!==!1&&w.push(o);l=w.length>0;s=f.children[t].matches;o=!0;break}if(o){if(l){w=e.replaceCheckedMatches(k,c,s,w,g);k=w.replacedStr;for(o=0;o<f.children[y].matches.length;o++)f.children[y+o].newMatches=w.newMatches}else for(o=0;o<f.children[y].matches.length;o++)f.children[y+o].newMatches=f.children[y+o].matches;b?d.contents[i]=k:d.contents.push(k)}else b||d.contents.push(k)}}};e.generateMatchContext=function(b,a,d){var f=[],c=b*2+1,e;a.length<=c?(e=0,b=a.length-1):(e=d-b,e<0?(e=0,b=e+c-1):
(b=d+b,b>a.length-1&&(b=a.length-1,e=b-c+1)));for(c=e;c<=b;c++)f.push({context:a[c],current:c===d});return f};e.splitFile=function(b){for(var a=0,d=0,f=0,c=0,e=[];;){a!==-1&&a<=f&&(a=b.indexOf("\r",f));d!==-1&&d<=f&&(d=b.indexOf("\n",f));if(d===-1&&a===-1){e.push(b.substring(c));break}var g=1;a!==-1&&d!==-1?a+1===d?(g=2,f=d+1):f=(a<d?a:d)+1:f=a!==-1?a+1:d+1;e.push(b.substring(c,f-g));c=f}return e};e.searchWithinFile=function(b,a,d,f,c,g){d=e.splitFile(d);if(c)a.contents=d;if(a){a.children=[];for(var i=
f=0;i<d.length;i++){var k=d[i];if(k&&k.length>0){var o=g?k:k.toLowerCase();if(o=b.wildCard?e.searchOnelineRegEx(b,o):e.searchOnelineLiteral(b,o)){var l,w=i+1;if(c)for(var s=0;s<o.length;s++)l=s+1,l={parent:a,checked:a.checked,type:"detail",matches:o,lineNumber:w,matchNumber:l,name:k,location:a.location+"-"+w+"-"+l},a.children.push(l);else l={parent:a,context:e.generateMatchContext(2,d,i),checked:a.checked,type:"detail",matches:o,lineNumber:w,name:k,location:a.location+"-"+w},a.children.push(l);f+=
o.length}}}a.totalMatches=f}};e.replaceCheckedMatches=function(b,a,d,f,c){for(var e=0,g="",i=[],o=0;o<d.length;o++){e!==d[o].startIndex&&(g+=b.substring(e,d[o].startIndex));if(d[o].length)c=d[o].length;for(var e=!1,k=0;k<f.length;k++)if(f[k]===o){e=!0;break}e?(i.push({startIndex:g.length,length:a.length}),g+=a):(i.push({startIndex:g.length,length:c}),g+=b.substring(d[o].startIndex,d[o].startIndex+c));e=d[o].startIndex+c}e<b.length&&(g+=b.substring(e));return{replacedStr:g,newMatches:i}};e.fullPathNameByMeta=
function(b){var a=b.length,d="";if(a>0)for(a-=1;a>-1;a--)d=d+(d===""?"":"/")+b[a].Name;return d};e.path2FolderName=function(b,a,d){return b.substring(0,b.length-a.length-(d?0:1))};e._storeRecentSearch=function(b,a,d,f){b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b.put("recentSearch",a);d&&window.setTimeout(function(){d.dispatchEvent({type:"inputDataListChanged",deleting:f})}.bind(this),20)})};e.addRecentSearch=function(b,a,d){typeof a==="string"&&a&&
b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){var c,f=f.get("recentSearch");typeof f==="string"&&(f=JSON.parse(f));if(f){for(c in f)if(f[c].name===a)return;f.length>=20&&f.splice(19,f.length-20+1)}else f=[];f.splice(0,0,{name:a,regEx:d});e._storeRecentSearch(b,f)})};e.removeRecentSearch=function(b,a,d){typeof a==="string"&&a&&b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){var c,f=f.get("recentSearch");typeof f===
"string"&&(f=JSON.parse(f));if(f)for(c in f)if(f[c].name===a){f.splice(c,1);e._storeRecentSearch(b,f,d,!0);break}})};e.getSearches=function(b,a,d){b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b=b.get(a);typeof b==="string"&&(b=JSON.parse(b));b&&d&&d(b)})};e.getMixedSearches=function(b,a,d,f){b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var c=b.get("recentSearch");typeof c==="string"&&(c=JSON.parse(c));a&&(b=
b.get("search"),typeof b==="string"&&(b=JSON.parse(b)),b&&b.forEach(function(b){if(d){var a=e.parseQueryStr(b.query);c.some(function(b){return a.searchStrTitle===b.name})||c.push({name:a.searchStrTitle,label:b.name})}else c.push({name:null,label:b.name,value:b.query})}));c&&f&&f(c)})};e.getOpenSearchPref=function(b,a){b.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(b){b=b.get("nav.config");a(b&&b["links.newtab"]!=="undefined"?b["links.newtab"]?!0:!1:!1)})};
e.setOpenSearchPref=function(b,a){b.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b.put("openSearchPref",{openInNewTab:a})})};return e});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(i,k,g,c,a,l){function d(a,b,d,h){this.registry=a;this.fileClient=b;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=h&&h.searchOnName;this._buildSkeletonOnly=h&&h.buildSkeletonOnly;this._fetchChildrenCallBack=h&&h.fetchChildrenCallBack;this._searchParams=d;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:c.generateSearchHelper(d);this._location=h&&h.location;this._childrenLocation=h&&h.childrenLocation?h.childrenLocation:this._location;this._cancelled=!1;this._statusService=this.registry.getService("orion.page.message");this._progressService=this.registry.getService("orion.page.progress");this._statusService&&this._statusService.setCancelFunction(function(){this._cancelFileContentsSearch()}.bind(this))}d.prototype.search=function(a){var b=this.registry.getService("orion.core.contentTypeRegistry");
this._onSearchComplete=a;this._cancelled=!1;this._deferredArray=[];b.getContentTypes().then(function(b){this.contentTypesCache=b;var a=this;this._visitRecursively(this._childrenLocation).then(function(){a._cancelled||a._reportResult()}.bind(a),function(b){a._reportResult();a._statusService&&b.name==="Cancel"&&(console.log("Crawling search cancelled. Deferred array length : "+a._deferredArray.length),a._statusService.setProgressResult({Message:i["Search cancelled by user"],Severity:"Warning"}))}.bind(a))}.bind(this))};
d.prototype.searchName=function(a,b){if(a)this._searchParams=a,this.searchHelper=c.generateSearchHelper(a,!0);if(b)this.onSearchNameComplete=b;var d=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var h=0;h<this.fileSkeleton.length;h++){var f=this.fileSkeleton[h].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?c.searchOnelineRegEx(this.searchHelper.inFileQuery,f,!0):c.searchOnelineLiteral(this.searchHelper.inFileQuery,f,!0))if(d.push(this.fileSkeleton[h]),
d.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:d.length,docs:d}})}else this.onSearchNameComplete({response:{numFound:0,docs:[]}})};d.prototype.buildSkeleton=function(a,b){this._buildingSkeleton=!0;var d=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=[];var c=this;a();d.getContentTypes().then(function(a){c.contentTypesCache=a;c._visitRecursively(c._childrenLocation).then(function(){c._buildingSkeleton=!1;
b();c.searchHelper&&!c._buildSkeletonOnly&&c.searchName()})})};d.prototype._sort=function(a){a.sort(function(b,a){var d,f;if(this._searchParams.sort==="Path asc"){d=b.Location&&b.Location.toLowerCase();d=c.path2FolderName(d,b.Name&&b.Name.toLowerCase(),!0);f=a.Location&&a.Location.toLowerCase();f=c.path2FolderName(f,a.Name&&a.Name.toLowerCase(),!0);if(d<f)return-1;if(d>f)return 1}return this._sortOnNameSingle(b,a)}.bind(this))};d.prototype._reportResult=function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,
docs:this.fileLocations}})};d.prototype._sortOnNameSingle=function(a,b){var d=a.Name&&a.Name.toLowerCase(),c=b.Name&&b.Name.toLowerCase();return d<c?-1:d>c?1:0};d.prototype._onFileType=function(a){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===c.ALL_FILE_TYPE?!0:a.extension.indexOf(this.searchHelper.params.fileType)>=0:!0};d.prototype._visitRecursively=function(d){var b=[],c=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(d);return(c._progressService?this._progressService.progress(c.fileClient.fetchChildren(d),
"Crawling search for children of "+d):c.fileClient.fetchChildren(d)).then(function(d){for(var f=0;f<d.length;f++)if(d[f].Directory!==void 0&&d[f].Directory===!1)if(c._searchOnName)b.push(c._buildSingleSkeleton(d[f]));else if(c._buildSkeletonOnly)b.push(c._buildSingleSkeleton(d[f]));else{if(!c._cancelled){var e=a.getFilenameContentType(d[f].Name,c.contentTypesCache);if(e&&(e["extends"]==="text/plain"||e.id==="text/plain")&&c._onFileType(e))e=c._sniffSearch(d[f]),b.push(e),c._deferredArray.push(e)}}else if(d[f].Location)if(c._cancelled)break;
else e=c._visitRecursively(d[f].ChildrenLocation),b.push(e),c._deferredArray.push(e);return l.all(b)})};d.prototype._hitOnceWithinFile=function(a){a=this._searchParams.caseSensitive?a:a.toLowerCase();return this.searchHelper.inFileQuery.wildCard?c.searchOnelineRegEx(this.searchHelper.inFileQuery,a,!0):c.searchOnelineLiteral(this.searchHelper.inFileQuery,a,!0)};d.prototype._reportSingleHit=function(a){if(!this._cancelled)a.LastModified=a.LocalTimeStamp,this.fileLocations.push(a),this._hitCounter++,
this._sort(this.fileLocations),this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0)};d.prototype._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(a){a.cancel()})};d.prototype._sniffSearch=function(a){this._totalCounter++;var b=this;if(!this._cancelled)if(this.searchHelper.params.keyword==="")this._reportSingleHit(a),this._statusService&&this._statusService.setProgressResult({Message:g.formatMessage(i["${0} files found out of ${1}"],
this._hitCounter,this._totalCounter)});else return(b._progressService?b._progressService.progress(b.fileClient.read(a.Location),"Reading file "+a.Location):b.fileClient.read(a.Location)).then(function(d){b._hitOnceWithinFile(d)&&b._reportSingleHit(a);b._statusService&&b._statusService.setProgressResult({Message:g.formatMessage(i["${0} files found out of ${1}"],b._hitCounter,b._totalCounter)},i.Cancel)},function(b){b&&b.message&&b.message.toLowerCase()!=="cancel"&&console.error("Error loading file content: "+
b.message)})};d.prototype._buildSingleSkeleton=function(a){this._totalCounter++;this.fileSkeleton.push(a);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();a=new l;a.resolve(this._totalCounter);return a};d.prototype.constructor=d;return{SearchCrawler:d}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages,orion/crawler/searchCrawler,orion/contentTypes,require,orion/webui/littlelib,orion/util,orion/webui/dialog".split(","),function(i,k,g,c,a,l,d){function e(b){this._init(b)}e.prototype=new d.Dialog;e.prototype.TEMPLATE='<div role="search"><div><label id="fileNameMessage" for="fileName">${Type the name of a file to open (? = any character, * = any string):}</label></div><div><input id="fileName" type="text" class="setting-control" style="width:90%;"/></div><div id="progress" style="padding: 2px 0 0; width: 100%;"><img src="'+
c.toUrl("../../../images/progress_running.gif")+'" class="progressPane_running_dialog" id="crawlingProgress"></img></div><div id="results" style="max-height:250px; height:auto; overflow-y:auto;" aria-live="off"></div><div id="statusbar"></div></div>';e.prototype._init=function(b){this.title=b.title||i["Find File Named"];this.modal=!0;this.messages=i;this._searcher=b.searcher;this._progress=b.progress;this._onHide=b.onHide;this._contentTypeService=new g.ContentTypeRegistry(this._searcher.registry);
if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=b.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=b.initialText;this._message=b.message;this._nameSearch=!0;if(b.nameSearch!==void 0)this._nameSearch=b.nameSearch;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(i["Missing required argument: fileService"]);this._searchRenderer=b.searchRenderer;if(!this._searchRenderer||
typeof this._searchRenderer.makeRenderFunction!=="function")throw Error(i["Missing required argument: searchRenderer"]);this._initialize()};e.prototype._bindToDom=function(b){var d=this;d.$crawlingProgress.style.display="none";this._nameSearch?this.$fileName.setAttribute("placeholder",i["FileName FolderName"]):this.$fileName.setAttribute("placeholder",i.Search);this.$fileName.addEventListener("input",function(){d._time=+new Date;d._timeoutId&&clearTimeout(d._timeoutId);d._timeoutId=setTimeout(d.checkSearch.bind(d),
0)},!1);this.$fileName.addEventListener("keydown",function(b){if(b.keyCode===a.KEY.ENTER){var c=a.$("a",d.$results);if(c)a.stop(b),(l.isMac?b.metaKey:b.ctrlKey)?window.open(c.href):(window.location.href=c.href,d.hide())}},!1);b.addEventListener("keydown",function(b){var c,e,g;if(b.keyCode===a.KEY.DOWN||b.keyCode===a.KEY.UP)c=a.$$array("a",d.$results),e=document.activeElement,g=c.indexOf(e),b.keyCode===a.KEY.DOWN?g>=0?(e.classList.remove("treeIterationCursor"),c=g<c.length-1?c[g+1]:c[0],c.focus(),
c.classList.add("treeIterationCursor")):c.length>0&&(c=-1<c.length-1?c[0]:c[0],c.focus(),c.classList.add("treeIterationCursor")):g>=0?(e.classList.remove("treeIterationCursor"),e=d.$fileName,c=g>0?c[g-1]:e,c.focus(),g>0&&c.classList.add("treeIterationCursor")):c.length>0&&(c[c.length-1].focus(),c[c.length-1].classList.add("treeIterationCursor")),a.stop(b)});b.addEventListener("mouseup",function(b){b.target.focus()},!1);setTimeout(function(){if(d._forceUseCrawler||!d._fileService.getService(d._searcher.getSearchLocation()).search){var b=
d._searchOnRoot?d._searcher.getSearchRootLocation():d._searcher.getChildrenLocation(),b=new k.SearchCrawler(d._searcher.registry,d._fileService,"",{searchOnName:!0,location:b});d._searcher.setCrawler(b);b.buildSkeleton(function(){d.$crawlingProgress.style.display="inline";d.$progress.appendChild(document.createTextNode(i["Building file skeleton..."]))},function(){d.$crawlingProgress.style.display="none";d.$progress.removeChild(d.$progress.lastChild)})}},0);this._message&&(this.$fileNameMessage.removeChild(this.$fileNameMessage.firstChild),
this.$fileNameMessage.appendChild(document.createTextNode(this._message)));if(this._initialText)this.$fileName.value=this._initialText,this.doSearch()};e.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var b=(new Date).getTime();b-this._time>this._searchDelay?(this._time=b,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};e.prototype._detectFolderKeyword=function(b){var a,d=b,c=null;if(this._nameSearch&&(a=/(\S+)\s*(.*)/,(b=a.exec(b))&&b.length===3))b[1]&&
(d=b[1]),b[2]&&(c=b[2]);return{keyword:d,folderKeyword:c}};e.prototype.doSearch=function(){var b=this.$fileName.value;if(b){var d=this._detectFolderKeyword(b),c=this._searcher.createSearchParams(d.keyword,this._nameSearch,this._searchOnRoot),f=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=f;var e=document.createElement("div");e.appendChild(document.createTextNode(this._nameSearch?i["Searching..."]:l.formatMessage(i["Searching for occurrences of"],
b)));a.empty(this.$results);this.$results.appendChild(e);this._searcher.search(c,d.folderKeyword,function(){f===this.currentSearch&&f.apply(null,arguments)}.bind(this))}};e.prototype.decorateResult=function(b){function d(b){b.button===0&&!b.ctrlKey&&!b.metaKey&&c.hide()}for(var c=this,b=a.$$array("a",b),f=0;f<b.length;f++)b[f].addEventListener("click",d,!1)};e.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};e.prototype._afterHiding=function(){this._onHide&&this._onHide()};e.prototype.constructor=
e;return{OpenResourceDialog:e}});define("text!orion/banner/banner.html",[],function(){return'<header id="banner" role="banner">\n\t<\!-- Requires some js code to bind the home link, link to progress image, and binding NLS variables  --\>\n\n\t<div id="staticBanner" class="layoutBlock topRowBanner"> <\!-- primaryNav --\>\n\t\t<div id="centralNavigationArea" style="position:absolute;left:0;top:0;width:39px;height:36px; z-index:1;border-right:1px solid #ddd;"></div>\n\n\t\t<\!-- Static "Home" link. TODO delete this --\>\n\t\t<a id="home" class="layoutLeft "></a>\n\n\t\t<\!-- Left banner component: hamburger --\>\n\t\t<nav id="primaryNav" class="bannerLeftArea" style="z-index:2;" role="navigation">\n\t\t\t\t<button class="centralNavigation commandSprite core-sprite-hamburger" type="button"id="centralNavigation"></button>\n\t\t</nav>\n\n\t\t<\!-- Middle banner component: Breadcrumb bar --\>\n\t\t<div class="clear navigationBreadcrumb bannerMiddleArea" >\n\t\t\t<div id="location" class="currentLocation"></div>\n\t\t</div>\n\n\t\t<\!-- Right banner component: user identity --\>\n\t\t<div class="bannerRightArea" style="z-index:2;">\n\t\t\t<\!-- Global commands support. --\>\n\t\t\t<div id="globalActions" class="spacingLeft layoutLeft"></div>\n\n\t\t\t<\!-- Search. TODO delete this --\>\n\t\t\t<input type="text" id="search" autocomplete="off" class="layoutLeft spacingLeft searchbox" role="search" style="display:none;">\n\t\t\t<div id="searchOptions" class="layoutLeft" style="padding-top:1px;display:none;"></div>\n\n\t\t\t<\!-- User identity menu and Progress --\>\n\t\t\t<div id="userMenu" class="spacingRight layoutRight" style="color:#ccc;line-height:16px;">\n\t\t\t\t<div style="position: absolute;right: 0px;top:0;width: 39px;height:36px; z-index:-50;border-left: 1px solid #ddd;"></div>\n\n\t\t\t\t<\!-- Progress indicator --\>\n\t\t\t\t<img class="progressPane" id="progressPane" tabindex="0" role="progressbar"></img>\n\n\t\t\t\t<\!-- User identity menu --\>\n\t\t\t\t<span id="userTrigger" tabindex="0" role="button" class="dropdownTrigger" style="z-index:2;">\n\t\t\t\t</span>\n\t\t\t\t<ul id="userDropdown" class="dropdownMenu" role="menu"></ul>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n\t<\!-- IDE notification messages go in here --\>\n\t<div id="notificationArea" class="notificationHide">\n\t\t<div class="layoutLeft" id="notifications" aria-live="assertive" aria-atomic="true"></div>\n\t\t<div class="layoutRight"><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" type="button" id="closeNotifications"></span></div>\n\t</div>\n</header>'});
define("text!orion/banner/footer.html",[],function(){return'<\!--\n<footer id="footerContent" class="layoutBlock footerLayout" role="contentinfo">\n\t<div class="logoFooter commandSprite core-sprite-orion-logo"></div>\n\t<div class="footerBlock">${Orion is in Beta. Please try it out but BEWARE your data may be lost.}</div>\n\t<div class="footerRightBlock">\n\t\t<ul>\n\t\t\t<li><a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=5.0" target="_blank">${Report a Bug}</a>\n\t\t\t<li><a href="http://www.eclipse.org/legal/privacy.php" target="_blank">${Privacy Policy}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">${Terms of Use}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/copyright.php" target="_blank">${Copyright Agent}</a></li>\n\t\t</ul>\n\t</div>\n</footer>\n--\>'});
define("text!orion/banner/toolbar.html",[],function(){return'<ul class="layoutLeft commandList pageActions" id="pageActions"></ul>\n<ul class="layoutLeft commandList pageActions" id="selectionTools"></ul>\n<ul class="layoutLeft commandList pageActions" id="navActions"></ul>\n<div class="layoutLeft" style="padding-left:7px;padding-right:7px;margin-top:2px;" id="filterBox" style="visibility: hidden;"></div>\n<ul class="layoutRight commandList pageActions" id="settingsActions"></ul>\n<div class="layoutRight status" id="statusPane" role="status" aria-live="off"></div>\n<ul class="layoutRight commandList pageActions" id="pageNavigationActions"></ul>'});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(i,k){function g(c,a,g){if(c=k.node(c))this._parent=c;else throw Error("Parent node of dropdown menu not found");this.options=g=g||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=g.selectionClass;c=document.createElement("div");c.classList.add("dropDownContainer");c.id=this.navDropDownId;c.style.display="none";this._parent.appendChild(c);this._dropdownMenu=c;if(a=k.node(a))this._triggerNode=
a;else throw"Trigger node of dropdown menu not found";if(this._triggerNode.style.visibility==="hidden")this._triggerNode.style.visibility="visible";if(!g.noClick)this._triggerNode.onclick=this.click.bind(this);this._dropdownMenu.addEventListener("keydown",function(a){a.keyCode===k.KEY.ESCAPE&&this.clearPanel()}.bind(this))}i.mixin(g.prototype,{click:function(){this._dropdownMenu.style.display==="none"?this.updateContent(this.getContentNode(),function(){k.setFramesEnabled(!1);this._dropdownMenu.style.display=
"";this._positionDropdown();this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=k.addAutoDismiss([this._triggerNode,this._dropdownMenu],this.clearPanel.bind(this));if(this.options.onShow)this.options.onShow()}.bind(this)):this.clearPanel()},clearPanel:function(){if(this.isVisible()&&(this._dropdownMenu.style.display="none",k.setFramesEnabled(!0),this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},
addContent:function(c){this._dropdownMenu.innerHTML=c},getContentNode:function(){return this._dropdownMenu},updateContent:function(c,a){a()},_positionDropdown:function(){this._dropdownMenu.style.right="";var c=k.bounds(this._dropdownMenu),a=k.bounds(document.body);if(c.left+c.width>a.left+a.width)c=k.bounds(this._boundingNode(this._triggerNode)),a=k.bounds(this._triggerNode),this._dropdownMenu.style.right=c.width-(a.left-c.left+a.width)+"px"},_boundingNode:function(c){var a=window.getComputedStyle(c,
null);return a===null?c:a.getPropertyValue("position")==="absolute"||!c.parentNode||c===document.body?c:this._boundingNode(c.parentNode)},isDestroyed:function(){return!this._dropdownMenu.parentNode},isVisible:function(){return this._dropdownMenu.style.display!=="none"&&!this.isDestroyed()},focus:function(){this._dropdownMenu.focus()},destroy:function(){if(this._parent)k.setFramesEnabled(!0),k.empty(this._parent),this._parent=this.select=null}});return g});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize strings from JavaScript files in this folder.",
"Choose a Folder":"Choose a Folder","Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Export as zip":"Zip","Create a zip file of the folder contents and download it":"Create a zip file of the folder contents and download it","New File":"File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"Folder","Folder name:":"Folder name:","Create a new folder":"Create a new folder",
"Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder","Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.":"Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',
"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.":"Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.","Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file",
"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.":"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.","Uploaded Content":"Uploaded Content","Creating an upload folder for ":"Creating an upload folder for ","Clone Git Repository":"Clone Git Repository","Clone a git repository":"Clone a git repository","Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.",
"Link to Server":"Link to Server","Link to existing content on the server":"Link to existing content on the server","Create a folder that links to an existing folder on the server.":"Create a folder that links to an existing folder on the server.","Server path:":"Server path:","The name and server location were not specified.":"The name and server location were not specified.","Go Up":"Go Up","Move up to the parent folder":"Move up to the parent folder","Go Into":"Go Into","Move into the selected folder":"Move into the selected folder",
"Import local file...":"File System","Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP","Copy files and folders from a specified SFTP connection":"Copy files and folders from a specified SFTP connection","Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP","Copy files and folders to a specified SFTP location":"Copy files and folders to a specified SFTP location",Exporting:"Exporting to ${0}","Pasting ${0}":"Pasting ${0}",
"Copy to":"Copy to","Move to":"Move to","Copying ${0}":"Copying ${0}","Moving ${0}":"Moving ${0}","Renaming ${0}":"Renaming ${0}","Deleting ${0}":"Deleting ${0}","Creating ${0}":"Creating ${0}","Linking to ${0}":"Linking to ${0}","Move files and folders to a new location":"Move files and folders to a new location",Cut:"Cut",Copy:"Copy","Fetching children of ":"Fetching children of ",Paste:"Paste","Cannot paste into the Workspace root":"Cannot paste into the Workspace root","Open With":"Open With",
"Loading ":"Loading ",New:"New",File:"File",Actions:"Actions","Orion Content":"Orion Content"," is not supported in this file system":" is not supported in this file system","Create new content":"Create new content","Import from HTTP...":"HTTP","File URL:":"File URL:","Copy a file from a URL and optionally unzip it":"Copy a file from a URL and optionally unzip it","Unzip *.zip files:":"Unzip *.zip files:","Extracted from:":"Extracted from:","Did not drop ${0}.  Folder drop is not supported in this browser.":"Did not drop ${0}.  Folder drop is not supported in this browser.",
"You cannot copy files directly into the workspace.  Create a folder first.":"You cannot copy files directly into the workspace.  Create a folder first.","Unzip ${0}?":"Unzip ${0}?",NoFile:"Use the ${0} menu to create new files and folders. Click a file to start coding."});define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(i,k){var g={root:k};Object.keys(i).forEach(function(c){typeof g[c]==="undefined"&&(g[c]=i[c])});return g});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(i,k,g){function c(a,c,b){if(!a[c])throw c+i[" is not supported in this file system"];return a[c].apply(a,b)}function a(d,e,b,j){if(!d.readBlob)throw i["source file service does not support binary read"];if(!b.writeBlob)throw i["target file service does not support binary write"];if(e[e.length-1]!=="/")return c(d,"readBlob",[e]).then(function(a){return c(b,"writeBlob",[j,a])});var h=j.substring(0,
j.length-1),f=decodeURIComponent(h.substring(h.lastIndexOf("/")+1)),h=h.substring(0,h.lastIndexOf("/")+1);return c(b,"createFolder",[h,f]).then(function(){},function(){}).then(function(){return c(d,"fetchChildren",[e]).then(function(c){for(var f=[],e=0;e<c.length;++e){var h=c[e].Location,g=h;c[e].Directory&&(g=h.substring(0,h.length-1));g=decodeURIComponent(g.substring(g.lastIndexOf("/")+1));g=j+encodeURIComponent(g);c[e].Directory&&(g+="/");f[e]=a(d,h,b,g)}return k.all(f)})})}function l(a,c){function b(b){var a=
new k;a.reject(i["No Matching FileService for location:"]+b);return a}var j=a.getServiceReferences("orion.core.file"),h=j;if(c)for(var h=[],f=0;f<j.length;++f)c(j[f])&&h.push(j[f]);for(var m=[],n=[],q=[],l=[],o={fetchChildren:function(){var b=new k;b.resolve(l);return b},createWorkspace:function(){var b=new k;b.reject(i["no file service"]);return b},loadWorkspaces:function(){var b=new k;b.reject(i["no file service"]);return b},loadWorkspace:function(){var b=new k;window.setTimeout(function(){b.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:i["File Servers"],Location:"/",Children:l,ChildrenLocation:"/"})},100);return b},search:b,createProject:b,createFolder:b,createFile:b,deleteFile:b,moveFile:b,copyFile:b,read:b,write:b},j=0;j<h.length;++j)l[j]={Directory:!0,Length:0,LocalTimeStamp:0,Location:h[j].getProperty("top"),ChildrenLocation:h[j].getProperty("top"),Name:h[j].getProperty("Name")},f=h[j].getProperty("pattern")||h[j].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),f[0]!=="^"&&(f=
"^"+f),m[j]=RegExp(f),n[j]=a.getService(h[j]),q[j]=h[j].getProperty("Name"),h[j].getProperty("NameKey")&&h[j].getProperty("nls")&&g.getMessageBundle(h[j].getProperty("nls")).then(function(b,a){l[b].Name=a[h[b].getProperty("NameKey")];q[b]=a[h[b].getProperty("NameKey")]}.bind(this,j));this._getServiceIndex=function(b){if(b==="/")return-1;else if(!b||b.length&&b.length===0)return n[0]?0:-1;for(var a=0;a<m.length;++a)if(m[a].test(b))return a;throw i["No Matching FileService for location:"]+b;};this._getService=
function(b){b=this._getServiceIndex(b);return b===-1?o:n[b]};this._getServiceName=function(b){b=this._getServiceIndex(b);return b===-1?o.Name:q[b]};this._getServiceRootURL=function(b){b=this._getServiceIndex(b);return b===-1?o.Location:l[b].Location}}l.prototype={getService:function(a){return this._getService(a)},fileServiceName:function(a){return this._getServiceName(a)},fileServiceRootURL:function(a){return this._getServiceRootURL(a)},fetchChildren:function(a){return c(this._getService(a),"fetchChildren",
arguments)},createWorkspace:function(a){return c(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return c(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(a){return c(this._getService(a),"loadWorkspace",arguments)},createProject:function(a,e,b,j){return c(this._getService(a),"createProject",arguments)},createFolder:function(a,e){return c(this._getService(a),"createFolder",arguments)},createFile:function(a,e){return c(this._getService(a),"createFile",
arguments)},deleteFile:function(a){return c(this._getService(a),"deleteFile",arguments)},moveFile:function(d,e,b){var j=this._getService(d),h=this._getService(e);if(j===h)return c(j,"moveFile",arguments);var f=d[d.length-1]==="/",g=e;g[g.length-1]!=="/"&&(g+="/");if(b)g+=encodeURIComponent(b);else{var i=d;f&&(i=i.substring(0,i.length-1));g+=i.substring(i.lastIndexOf("/")+1)}f&&g[g.length-1]!=="/"&&(g+="/");return a(j,d,h,g).then(function(){return c(j,"deleteFile",[d])})},copyFile:function(d,e,b){var j=
this._getService(d),h=this._getService(e);if(j===h)return c(j,"copyFile",arguments);var f=d[d.length-1]==="/",g=e;g[g.length-1]!=="/"&&(g+="/");if(b)g+=encodeURIComponent(b);else{var i=d;f&&(i=i.substring(0,i.length-1));g+=i.substring(i.lastIndexOf("/")+1)}f&&g[g.length-1]!=="/"&&(g+="/");return a(j,d,h,g)},read:function(a,e){return c(this._getService(a),"read",arguments)},readBlob:function(a){return c(this._getService(a),"readBlob",arguments)},write:function(a,e,b){return c(this._getService(a),"write",
arguments)},remoteImport:function(a,e){return c(this._getService(a),"remoteImport",arguments)},remoteExport:function(a,e){return c(this._getService(a),"remoteExport",arguments)},search:function(a){return c(this._getService(a.resource),"search",arguments)}};l.prototype.constructor=l;return{FileClient:l}});
define("orion/webui/SideMenu","orion/commands,orion/objects,orion/webui/littlelib,orion/PageLinks,orion/PageUtil,orion/URITemplate,orion/URL-shim,orion/util".split(","),function(i,k,g,c,a,l,d,e){function b(b,a){this.parentNode=g.node(b);this.contentNode=g.node(a);if(!this.parentNode)throw Error("Missing parentNode");this.menuitems=Object.create(null);this.categories=this.links=null;this.anchor=document.createElement("ul");this.anchor.classList.add("sideMenuList");this.parentNode.appendChild(this.anchor);
this.anchor.addEventListener("click",this._handleEvent.bind(this));this.anchor.addEventListener("touchstart",this._handleEvent.bind(this));this.anchor.addEventListener("focus",this._handleEvent.bind(this),!0);g.addAutoDismiss([this.anchor],this._expandMenu.bind(this,null))}function j(b){return!b.isRelatedLink}function h(b,a){var d=b.order,c=a.order;if(d<c)return-1;else if(c<d)return 1;return 0}function f(b,a){var d=b.source.order,c=a.source.order,d=typeof d==="number"?d:100,c=typeof c==="number"?
c:100;return d===c?b.textContent.localeCompare(a.textContent):d<c?-1:1}var m=e.isTouch;k.mixin(b.prototype,{LOCAL_STORAGE_NAME:"sideMenuNavigation",OPEN_STATE:"open",CLOSED_STATE:"closed",DEFAULT_STATE:"open",SIDE_MENU_OPEN_WIDTH:"40px",TRANSITION_DURATION_MS:301,addMenuItem:function(b,a,d){var c=this.anchor,b=this.createListItem(b,a);d&&b.classList.add("sideMenuItemActive");c.appendChild(b);this.menuitems[a]=b},setSideMenu:function(){var b=this.getDisplayState(),a=this.parentNode;if(a){if(b===this.CLOSED_STATE){this.setPageContentLeft("0");
if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){a.style.display="none"},this.TRANSITION_DURATION_MS);a.classList.add("animating")}if(b===this.OPEN_STATE){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;a.classList.remove("animating");a.style.display="block";a.style.width=this.SIDE_MENU_OPEN_WIDTH;this.setPageContentLeft(this.SIDE_MENU_OPEN_WIDTH)}}},setPageContentLeft:function(b){var a=this.contentNode;if(a)a.style.left=
b},toggleSideMenu:function(){var b=this.getDisplayState(),a=this.contentNode;a&&a.classList.add("content-fixedHeight-animation");b=b===this.OPEN_STATE?this.CLOSED_STATE:this.OPEN_STATE;b===this.DEFAULT_STATE?localStorage.removeItem(this.LOCAL_STORAGE_NAME):localStorage.setItem(this.LOCAL_STORAGE_NAME,b);this.setSideMenu()},clearMenuItems:function(){this.menuitems=[];g.empty(this.anchor)},getMenuItems:function(){var b=this.menuitems;return Object.keys(b).map(function(a){return b[a]})},getMenuItem:function(b){return this.menuitems[b]},
getDisplayState:function(){var b=localStorage.getItem(this.LOCAL_STORAGE_NAME);if(!b)b=this.DEFAULT_STATE;return b},createListItem:function(b,a){var d=document.createElement("li");d.className=b;d.classList.add("sideMenuItem");d.categoryId=a;return d},setCategories:function(b){this.categories=b;this.links=Object.create(null)},setPageLinks:function(b){this.pageLinks=b;var a=this,d=b.createLinkElements();b.getAllLinks().forEach(function(b,c){var f=d[c];f.source=b;a._getLinksBin(b.category).push(f)});
this._renderLinks()},setRelatedLinks:function(b,a){this.relatedLinks=b;var d=this;Object.keys(this.links).forEach(function(b){var a=d._getLinksBin(b);d.links[b]=a.filter(j)});var c=document.createDocumentFragment();b.forEach(function(b){var a=b.relatedLink,f=d._getLinksBin(a.category),b=i.createCommandMenuItem(c,b.command,b.invocation);b.classList.remove("dropdownMenuItem");b.isRelatedLink=!0;b.source=a;f.push(b)});this._renderLinks(a)},_getLinksBin:function(b){if(b){var a=this.links;a[b]=a[b]||[];
return a[b]}else return[]},_sort:function(){var b=this.links;Object.keys(b).forEach(function(a){b[a].sort(f)})},_renderCategories:function(){var b=this.categories,d=this,f=new URL(window.location.href),e=a.matchResourceParameters();e.OrionHome=c.getOrionHome();var j=!1;this.clearMenuItems();b.getCategoryIDs().map(function(a){return b.getCategory(a)}).sort(h).forEach(function(b){var a=d._getLinksBin(b.id);a.length&&(j?d.addMenuItem(b.imageClass,b.id,!1):(a=a.some(function(b){if(!b.source.uriTemplate)return!1;
b=new l(b.source.uriTemplate);b=new URL(b.expand(e),window.location);return b.protocol===f.protocol&&b.host===f.host&&b.hostname===f.hostname&&b.port===f.port&&b.pathname===f.pathname&&b.search===f.search?j=!0:!1}),d.addMenuItem(b.imageClass,b.id,a)))})},_renderLinks:function(b){b=b||[];this._sort();this._renderCategories();var a=this,d=window.location.href;Object.keys(this.menuitems).forEach(function(c){var f=a.getMenuItem(c);if(f){for(var e=a._getLinksBin(c).slice(),e=e.filter(function(a){var c=
a.source;return b.indexOf(c.id)>=0||!c.default&&!c.force&&a.href===d?!1:!0}),e=e.filter(function(b){b=b.source;return!(e.length>1&&b.default&&!b.force)}),h=e.length-1;h>0;h--)e[h].href===e[h-1].href&&e.splice(h,1);if(e.length){f.appendChild(a._createCategoryElement(c,f,e[0]));var j=document.createElement("ul");j.className="sideMenuSubMenu";e.forEach(function(b){var a=document.createElement("li");a.className="sideMenuSubMenuItem";var d=document.createElement("a");d.href=b;d.className="sideMenuSubMenuItemLink";
var c=document.createElement("span");c.innerHTML=b.innerHTML;c.className="sideMenuSubMenuItemSpan";d.appendChild(c);a.appendChild(d);j.appendChild(a)});f.appendChild(j)}}})},_createCategoryElement:function(b,a,d){var b=this.categories.getCategory(b),c;m?(c=document.createElement("button"),c.type="button"):(c=document.createElement("a"),c.href=d.href);c.className+=b.imageClass;c.classList.add("submenu-trigger");c.tabIndex="0";a.classList.remove(b.imageClass);return c},_handleEvent:function(b){var a=
b.target,b=b.type==="focus";if(a.tagName!=="A"||b)a.classList.contains("submenu-trigger")&&(m||b)&&this._expandMenu(g.$(".sideMenuSubMenu",a.parentNode))},_expandMenu:function(b){this.getMenuItems().forEach(function(a){a=g.$(".sideMenuSubMenu",a);b!==a&&a.classList.remove("expanded")});b&&b.classList.toggle("expanded")}});return b});
define("orion/globalCommands","i18n!orion/nls/messages,require,orion/commonHTMLFragments,orion/keyBinding,orion/EventTarget,orion/commandRegistry,orion/commands,orion/parameterCollectors,orion/extensionCommands,orion/uiUtils,orion/keyBinding,orion/breadcrumbs,orion/webui/littlelib,orion/webui/splitter,orion/webui/dropdown,orion/webui/tooltip,orion/contentTypes,orion/URITemplate,orion/keyAssist,orion/PageUtil,orion/widgets/themes/ThemePreferences,orion/widgets/themes/container/ThemeData,orion/Deferred,orion/widgets/UserMenu,orion/PageLinks,orion/webui/dialogs/OpenResourceDialog,text!orion/banner/banner.html,text!orion/banner/footer.html,text!orion/banner/toolbar.html,orion/widgets/input/DropDownMenu,orion/util,orion/customGlobalCommands,orion/fileClient,orion/webui/SideMenu,orion/objects".split(","),function(i,
k,g,c,a,l,d,e,b,j,h,f,m,n,q,p,o,r,w,s,y,t,z,v,H,G,D,u,B,x,C,A,E,O,F){var R,P,K,L,M,S,N,V;function ea(b,a){if(b.getLabel)return b.getLabel();else{var d=new z;d.resolve(a.properties.name);return d}}function ga(b){m.node("progressPane").setAttribute("aria-label",i["Operations - Press spacebar to show current operations"]);(b=b.getService("orion.page.progress"))&&b.init.bind(b)("progressPane")}function fa(b,a){var d=b.getServiceReferences("orion.core.auth");ba=[];var c=R.apply(this,arguments);if(c)for(var f=
0;f<d.length;f++){var e=d[f],h=b.getService(e);ea(h,e).then(function(b){h.getKey().then(function(a){ba.push(a);h.getUser().then(function(d){c.addUserItem(a,h,b,d)},function(d,f){c.addUserItem(a,h,b,f)});window.addEventListener("storage",function(){aa[a]!==localStorage.getItem(a)&&(aa[a]=localStorage.getItem(a),h.getUser().then(function(d){c.addUserItem(a,h,b,d)},function(){c.addUserItem(a,h,b)}))},!1)})})}}function W(b){return b}function X(a,c,f,e,h){function j(b){for(var a={},d=b.getPropertyKeys(),
c,f=0;f<d.length;f++)c=d[f],a[c]=b.getProperty(c);return a}function g(b,a){var d=null;b.some(function(b){return a===b.getProperty("id")?!!(d=b):!1});return d}function i(b){var a=b.command;if(!a.visibleWhen||a.visibleWhen(c))return b.invocation=new d.CommandInvocation(c,c,null,a,e),(new z).resolve(b);else if(typeof h==="function")return l||(l=h()),z.when(l,function(f){if(f&&c===ca&&(!a.visibleWhen||a.visibleWhen(f)))return b.invocation=new d.CommandInvocation(f,f,null,a,e),b});return(new z).resolve()}
function m(b,a,c){return c?(new z).resolve({relatedLink:b,command:c}):a.then(function(a){return{relatedLink:b,command:new d.Command(a)}})}var n=arguments,k,l,q=a&&a.getServiceReferences("orion.page.link.related");if(q&&q.length!==0){var p=this;z.when(function(){if(k)return k;var b=a.getService("orion.core.contentTypeRegistry");b||(b=new o.ContentTypeRegistry(a),b=a.getService("orion.core.contentTypeRegistry"));return b.getContentTypes().then(function(b){return k=b})}(),function(){if(P.apply(p,n)){var d=
a.getServiceReferences("orion.navigate.command"),c=[];q.forEach(function(f){var h=j(f);if(h.id){var i;if((h.nls&&h.nameKey||h.name)&&h.uriTemplate)i=b._createCommandOptions(h,f,a,k,!0),c.push(m(h,i,null));else if(i=g(d,h.id)){var n=j(i),f={};F.mixin(f,n,h);(h=e.findCommand(h.id))?c.push(m(f,null,h)):(i=b._createCommandOptions(n,i,a,k,!0),c.push(m(f,i,null)))}}});z.all(c,W).then(function(b){b.sort(function(b,a){return b.command.name.localeCompare(a.command.name)});return z.all(b.map(i),W).then(function(a){var d=
[],a=a.filter(function(a,c){if(a)return!0;d.push(b[c]);return!1});K.call(p,e,a,d,f);L.apply(p,n)})})}})}}function ha(b){var a=m.node("globalActions");a&&(b.destroy(a),b.renderCommands(a.id,a,{},{},"tool"))}function Y(b){var a=window.getComputedStyle(b,null);return a===null?b:a.getPropertyValue("position")==="absolute"||!b.parentNode||b===document.body?b:Y(b.parentNode)}function Z(b){var a={},d=null;typeof b==="string"&&(b=m.node(b));b||(b=m.node("pageActions"));for(var c=b;c&&c.classList;){if(c.classList.contains("toolComposite")){d=
c;break}c=c.parentNode}if(b.classList.contains("commandMarker"))a.commandNode=b;if(d&&(a.slideContainer=m.$(".slideParameters",d),a.parameterArea=m.$(".parameters",d),a.dismissArea=m.$(".parametersDismiss",d),a.notifications=m.$("#notificationArea",d),d.parentNode&&(a.toolbarTarget=m.$(".toolbarTarget",d.parentNode),a.toolbarTarget)))b=m.bounds(a.toolbarTarget),c=m.bounds(Y(a.toolbarTarget.parentNode)),a.toolbarTargetY=b.top-c.top,a.toolbar=d;return a}function $(b){if(b=b.slideContainer)if(b.style.left=
"",b.style.top="",b.classList.contains("slideContainerActive")){var a=m.bounds(b),d=m.bounds(b.parentNode);b.style.left=(d.width-a.width)/2+"px";b.style.top="0"}}var l=function(b){var a=document.createElement("a");a.href=b;return a.href}(k.toUrl("auth/NotifyAuthentication.html")),aa={},J=null;R=A.createMenuGenerator||function(b,a){if(m.node("userMenu")){var d=m.node("userDropdown"),c=new q.Dropdown({dropdown:d}),d=new v.UserMenu({dropdownNode:d,dropdown:c,serviceRegistry:b}),c=m.node("userTrigger");
new p.Tooltip({node:c,text:i.Options,position:["below","left"]});var c=document.getElementById("userTrigger"),f=c.className;f+=" imageSprite core-sprite-silhouette";c.className=f;d.setKeyAssist(a);return d}};P=A.beforeGenerateRelatedLinks||function(){return!0};K=A.addRelatedLinkCommands||function(b,a,d,c){this.sideMenu&&this.sideMenu.setRelatedLinks(a,c)};L=A.afterGenerateRelatedLinks||function(){};M=A.afterSetPageTarget||function(){};S=A.generateNavigationMenu||function(){var b=m.node("sideMenu");
if(b){var a=m.node("centralNavigation");new p.Tooltip({node:a,text:i.CentralNavTooltip,position:["right"]});J=this.sideMenu=new O(b,m.node("pageContent"));a.addEventListener("click",J.toggleSideMenu.bind(J));(b=m.node("sideMenuToggle"))&&b.addEventListener("click",J.toggleSideMenu.bind(J))}};N=A.afterGenerateNavigationMenu||function(){};V=A.afterGenerateBanner||function(){};var ba=[],ca,U=[],I,T=null,Q=null,da=new a;return{generateBanner:function(b,a,f,h,j,o,l,q){function p(b){b.registerService("orion.cm.managedservice",
{updated:function(b){for(var b=b&&b["links.newtab"]!=="undefined"?b["links.newtab"]?"_blank":"_self":"_self",a=m.$$array(".targetSelector"),d=0;d<a.length;d++)a[d].target=b}},{pid:"nav.config"})}(new y.ThemePreferences(h,new t.ThemeData)).apply();var r=m.node(b);if(!r)throw i["could not find banner parent, id was "]+b;var s=document.createRange();s.selectNode(r);s=s.createContextualFragment(D);m.processTextNodes(s,i);r.firstChild?r.insertBefore(s,r.firstChild):r.appendChild(s);r=m.node("home");r.href=
k.toUrl("edit/edit.html");r.setAttribute("aria-label",i["Orion Home"]);m.node("progressPane").src=d.NO_IMAGE;if(r=m.node("pageToolbar"))r.classList.add("toolbarLayout"),r.innerHTML=B+g.slideoutHTMLFragment("mainToolbar");(r=m.node("closeNotifications"))&&r.setAttribute("aria-label",i["Close notification"]);if(C.isFirefox<=17&&(r=m.node("staticBanner")))r.style.width="100%",r.style.MozBoxSizing="border-box";if(r=m.node("footer"))r.innerHTML=u,m.processTextNodes(r,i);f.setParameterCollector(new e.CommandParameterCollector(Z,
$));document.addEventListener("keydown",function(b){b.keyCode===m.KEY.ESCAPE&&(b=a.getService("orion.page.message"))&&b.setProgressMessage("")},!1);S.apply(this,arguments);N.apply(this,arguments);r=H.getCategoriesInfo(a);s=H.getPageLinksInfo(a,"orion.page.link");z.all([r,s]).then(function(b){if(J){var a=b[1];J.setCategories(b[0]);J.setPageLinks(a);J.setSideMenu()}});if(r=m.$(".split")){var s=m.$(".sidePanelLayout"),v=m.$(".mainPanelLayout");if(s&&v)T={side:s,main:v},T.splitter=new n.Splitter({node:r,
sidePanel:s,mainPanel:v,toggle:!0,closeByDefault:q}),r=new d.Command({name:i["Toggle side panel"],tooltip:i["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){T.splitter.toggleSidePanel()}}),f.addCommand(r),f.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new c.KeyBinding("l",C.isMac?!1:!0,!0,!1,C.isMac?!0:!1))}var x=!1,A=function(b,a){if(!x){var d=a.getService("orion.page.progress"),c=new G.OpenResourceDialog({searcher:b,progress:d,searchRenderer:b.defaultRenderer,
onHide:function(){x=!1}});window.setTimeout(function(){x=!0;c.show()},0)}},r=new d.Command({name:i["Find File Named..."],tooltip:i["Choose a file by name and open an editor on it"],id:"orion.openResource",callback:function(){A(j,a)}});f.addCommand(r);f.registerCommandContribution("globalActions","orion.openResource",100,null,!0,new c.KeyBinding("f",!0,!0));r=new d.Command({name:i["Toggle banner and footer"],tooltip:i["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var b=
m.node("banner"),a=m.node("footer"),d=m.node("sideMenu"),c=m.$(".content-fixedHeight"),f=b.style.visibility==="hidden";f?(b.style.visibility="visible",a.style.visibility="visible",c.classList.remove("content-fixedHeight-maximized"),d&&d.classList.remove("sideMenu-maximized")):(b.style.visibility="hidden",a.style.visibility="hidden",c.classList.add("content-fixedHeight-maximized"),d&&d.classList.add("sideMenu-maximized"));da.dispatchEvent({type:"toggleTrim",maximized:!f});return!0}});f.addCommand(r);
f.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new c.KeyBinding("m",!0,!0));r=new d.Command({name:i["System Configuration Details"],tooltip:i["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});f.addCommand(r);f.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new c.KeyBinding(112,!0,!0));r=new d.Command({name:i["Background Operations"],tooltip:i["Background Operations Tooltip"],
id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});f.addCommand(r);f.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new c.KeyBinding("o",!0,!0));Q=new w.KeyAssistPanel({commandRegistry:f});r=new d.Command({name:i["Show Keys"],tooltip:i["Show a list of all the keybindings on this page"],id:"orion.keyAssist",callback:function(){Q.isVisible()?Q.hide():Q.show();return!0}});f.addCommand(r);f.registerCommandContribution("globalActions",
"orion.keyAssist",100,null,!0,new c.KeyBinding(191,!1,!0));ha(f);fa(a,r.callback);ga(a);window.addEventListener("hashchange",function(){f.processURL(window.location.href)},!1);window.setTimeout(function(){p(a)},0);V.apply(this,arguments)},getToolbarElements:Z,getMainSplitter:function(){return T},getKeyAssist:function(){return Q},getGlobalEventTarget:function(){return da},layoutToolbarElements:$,setPageTarget:function(b){var a,d,c=b.breadcrumbRootName,e=b.serviceRegistry;b.target?(b.searchService&&
b.searchService.setLocationByMetaData(b.target),b.fileService&&!b.breadcrumbTarget&&(d=c?c+" ":"",d+=b.fileService.fileServiceName(b.target.Location),c=null),a=b.name||b.target.Name,ca=b.target,X.call(this,e,b.target,U,b.commandService,b.makeAlternate)):(b.breadcrumbTarget||(c=c||b.task||b.name),a=b.name,X.call(this,e,{NoTarget:""},U,b.commandService,b.makeAlternate));(I=b.title)||(I=a?a+" - "+b.task:b.task);window.document.title=I;M.apply(this,arguments);if(a=b.breadCrumbContainer?m.node(b.breadCrumbContainer):
m.node("location")){m.empty(a);var h=e&&new E.FileClient(e),e=b.breadcrumbTarget||b.target,h=h&&e&&e.Location?h.fileServiceRootURL(e.Location):null;new f.BreadCrumbs({container:a,resource:e,rootSegmentName:c,workspaceRootSegmentName:d,workspaceRootURL:h,makeFinalHref:b.makeBreadcrumFinalLink,makeHref:b.makeBreadcrumbLink})}},setDirtyIndicator:function(b){if(I)I.charAt(0)==="*"&&!b&&(I=I.substring(1)),b&&I.charAt(0)!=="*"&&(I="*"+I),window.document.title=I;var a=m.node("dirty");if(a)a.textContent=
b?"*":""},setPageCommandExclusions:function(b){U=b},notifyAuthenticationSite:l}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(i){return{detectValidURL:function(k){for(var g=/\[([^\]]*)\]\(([^\)]+)\)/g,c=g.exec(k),a=[],l=0;c;){if(c.length===3&&c[2].length>0){var d=new URL(c[2]);d.protocol!==":"&&i.validateURLScheme(d.href)&&(c.index>l&&a.push({segmentStr:k.substring(l,c.index)}),a.push({segmentStr:c[1].length>0?c[1]:c[2],urlStr:c[2]}),l=c.index+c[0].length)}c=g.exec(k)}if(l===0)return null;l<k.length-1&&a.push({segmentStr:k.substring(l)});return a},processURLSegments:function(i,
g){g.forEach(function(c){if(c.urlStr){var a=document.createElement("a");a.href=c.urlStr;a.appendChild(document.createTextNode(c.segmentStr))}else a=document.createElement("span"),a.textContent=c.segmentStr;i.appendChild(a)})}}});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(i,k,g,c){function a(a,c,b,j,h){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.message",this);this._operationsClient=c;this.notificationContainerDomId=h;this.domId=b;this.progressDomId=j||b;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var l;a.prototype={_init:function(){var a=k.node("closeNotifications");if(a&&
!this._hookedClose){a.style.cursor="pointer";this._hookedClose=!0;var c=k.node(this.notificationContainerDomId);k.addAutoDismiss([c],function(){this._clickToDisMiss&&this.close()}.bind(this));a.addEventListener("click",function(){this.close()}.bind(this));c.addEventListener("click",function(b){b&&b.target&&b.target.nodeName.toLowerCase()==="a"&&(b=k.$$("a",c))&&b.length&&b.length===1&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);var a=k.node("closeNotifications");
this._cancelMsg&&this._cancelFunc&&a?(a.innerHTML="",a.classList.remove("cancelButton"),a.classList.add("dismissButton"),a.classList.add("core-sprite-close"),a.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null):this.setProgressMessage("")},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=g.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(a,c,b){this._init();this.currentMessage=a;var j=k.node(this.domId);
if(typeof b==="boolean"){var h=j.getAttribute("aria-live");j.setAttribute("aria-live",b?"polite":"off");window.setTimeout(function(){a===this.currentMessage&&(k.empty(j),j.appendChild(document.createTextNode(a)),window.setTimeout(function(){j.setAttribute("aria-live",h)},100))}.bind(this),100)}else k.empty(j),j.appendChild(document.createTextNode(a));typeof c==="number"&&window.setTimeout(function(){a===this.currentMessage&&(k.empty(j),j.appendChild(document.createTextNode("")))}.bind(this),c)},setErrorMessage:function(a){this._clickToDisMiss=
!0;this.currentMessage=a;this._init();var c=a.responseText||a.message||a;if(typeof c==="string")try{c=JSON.parse(c)}catch(b){}var a=c.Message||c,j="red";if(c.Severity)switch(c.Severity){case "Warning":j="#FFCC00";break;case "Error":j="red";break;case "Info":case "Ok":j="green"}c=document.createElement("span");c.style.color=j;c.appendChild(document.createTextNode(a));a=k.node(this.domId);k.empty(a);a.appendChild(c)},setProgressMessage:function(a){this._clickToDisMiss=!1;this._init();this.currentMessage=
a;var c=document.createElement("span");c.classList.add("progressIcon");var b=k.node(this.progressDomId);k.empty(b);b.appendChild(c);b.appendChild(document.createTextNode(a));c=k.node(this.notificationContainerDomId);c.classList.remove("notificationHide");if(a&&a.length>0)c.classList.add("progressNormal"),c.classList.add("notificationShow");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();else c.classList.remove("notificationShow"),c.classList.add("notificationHide")},
setCancelFunction:function(a){this._cancelFunc=a},setProgressResult:function(a,e){this._clickToDisMiss=!1;this._cancelMsg=e;this.currentMessage=a;var b=a.responseText||a;if(typeof b==="string")try{b=JSON.parse(b)}catch(j){}this._init();var h=b.Message||b.toString(),f=i.UnknownError,g="core-sprite-information",n="progressNormal",l=document.createElement("span");l.classList.add("imageSprite");l.classList.add("progressIcon");var p=[];if(b.Severity)switch(b.Severity){case "Warning":f=i.UnknownWarning;
g="core-sprite-warning";n="progressWarning";p.push("progressInfo");p.push("progressError");p.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":g="core-sprite-error";n="progressError";p.push("progressWarning");p.push("progressInfo");p.push("progressNormal");this._clickToDisMiss=!0;break;default:n="progressNormal",p.push("progressWarning"),p.push("progressError"),p.push("progressNormal")}p.push("notificationHide");l.classList.add(g);var o=k.node(this.progressDomId),g=k.node(this.notificationContainerDomId);
k.empty(o);o.appendChild(l);h===Object.prototype.toString()&&(h=f);if(b.HTML)b=document.createElement("span"),b.innerHTML=h,o.appendChild(b);else{if(f=c.detectValidURL(h))h=document.createDocumentFragment(),c.processURLSegments(h,f),Array.prototype.forEach.call(k.$$("a",h),function(b){b.target="_blank"});else{if(b.Severity!=="Warning"&&b.Severity!=="Error"&&!e)this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),
5E3);h=document.createTextNode(h)}o.appendChild(h)}if(n&&this.progressDomId!==this.domId){g.classList.add(n);for(n=0;n<p.length;n++)g.classList.remove(p[n])}g.classList.add("notificationShow");if(p=k.node("closeNotifications"))this._cancelMsg?(p.classList.add("cancelButton"),p.classList.remove("dismissButton"),p.classList.remove("core-sprite-close"),p.classList.remove("imageSprite"),p.innerHTML=this._cancelMsg):(p.innerHTML="",p.classList.remove("cancelButton"),p.classList.add("dismissButton"),p.classList.add("core-sprite-close"),
p.classList.add("imageSprite"))},showWhile:function(a,c){var b=this;if(c){b.setProgressMessage(c);var j=function(){c===b.currentMessage&&b.setProgressMessage("")};a.then(j,j)}return a},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(a,c){return new l(this,++this._lastProgressId,a,c)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var a="",c=!0,b;for(b in this._progressMonitors)this._progressMonitors[b].status&&(c||(a+=", "),a+=this._progressMonitors[b].status,
c=!1);this.setProgressMessage(a)}else this.setProgressMessage("")},_beginProgressMonitor:function(a){this._progressMonitors[a.progressId]=a;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(a){this._progressMonitors[a.progressId]=a;this._renderOngoingMonitors()},_doneProgressMonitor:function(a){delete this._progressMonitors[a.progressId];this._progressMonitors.length--;a.status?this.setProgressResult(a.status):this._renderOngoingMonitors()}};a.prototype.constructor=
a;l=function(a,c,b,j){this.statusService=a;this.progressId=c;if(b){this.deferred=b;this.begin(j);var h=this;b.then(function(){h.done.bind(h)()},function(){h.done.bind(h)()})}};l.prototype.begin=function(a){this.status=a;this.statusService._beginProgressMonitor(this)};l.prototype.done=function(a){this.status=a;this.statusService._doneProgressMonitor(this)};l.prototype.worked=function(a){this.status=a;this.statusService._workedProgressMonitor(this)};l.prototype.constructor=l;return{StatusReportingService:a,
ProgressMonitor:l}});
define("orion/operations/nls/root/messages",{More:"More","No Matching OperationService for location:":"No Matching OperationService for location:","No operations services registered.":"No operations services registered.","could not find toolbar ":"could not find toolbar ","Remove Completed":"Remove Completed","Remove all completed operations":"Remove all completed operations",Remove:"Remove","Remove operations from the operations list.":"Remove operations from the operations list.",Cancel:"Cancel",
"Cancel operations from the operations list.":"Cancel operations from the operations list.","Operation resulted in a warning.":"Operation resulted in a warning.","Operation resulted in an error.":"Operation resulted in an error.","Operation is running.":"Operation is running.","Operation is canceled.":"Operation is canceled.","Operation failed.":"Operation failed.",Name:"Name",Actions:"Actions",Status:"Status",Scheduled:"Scheduled"});
define("orion/operations/nls/messages",["orion/i18n!orion/operations/nls/messages","orion/operations/nls/root/messages"],function(i,k){var g={root:k};Object.keys(i).forEach(function(c){typeof g[c]==="undefined"&&(g[c]=i[c])});return g});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(i,k,g,c){function a(){}a.prototype={_initialize:function(a,d,e,b,j){this._tooltip=new c.Tooltip({node:a,hideDelay:j||0,afterShowing:this._afterShowingFunction(d).bind(this),afterHiding:e,trigger:b?b:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";a=document.createRange();a.selectNode(this.$parent);a=a.createContextualFragment(this.TEMPLATE);
this.messages&&g.processTextNodes(a,i);this.$parent.appendChild(a);var h=this._tooltip;this.$parent.addEventListener("keydown",function(b){b.keyCode===g.KEY.ESCAPE&&h.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(a){for(var c=0;c<a.childNodes.length;c++){var e=a.childNodes[c];e.id&&(this["$"+e.id]=e);this._bindElements(e)}},_afterShowingFunction:function(a){return function(){a&&a.bind(this)();if(!this.customFocus){var c=
g.firstTabbable(this.$parent);c&&c.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};a.prototype.constructor=a;return{PopupDialog:a}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(i,k,g,c){var a={};(function(){var k=!1;a.updateNavTools=function(a,c,b,j,h,f){var m=g.node(j);if(m)c.destroy(m);else throw i["could not find toolbar "]+j;c.renderCommands(j,m,f,b,"button");if(h&&(j=g.node(h)))c.destroy(j),c.renderCommands(h,j,null,b,"button");k||(k=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var d=g.node(h);
d&&(c.destroy(d),c.renderCommands(h,d,a.selections,b,"button"))}))};a.createOperationsCommands=function(a,e,b){function j(b){return!b.operation||!b.operation.type?!1:b.operation.type==="loadstart"||b.operation.type==="progress"}var h=new c.Command({name:i["Remove Completed"],tooltip:i["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){b.removeCompletedOperations().then(function(){e.loadOperations.bind(e)()})},visibleWhen:function(){return!0}});a.addCommand(h);
h=new c.Command({name:i.Remove,tooltip:i["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],c=0;c<a.length;c++){var d=a[c];b.removeOperation.bind(b)(d.Location).then(function(){e.loadOperations.bind(e)()},function(){e.loadOperations.bind(e)()})}},visibleWhen:function(b){if(!Array.isArray(b)||b.length===0)return!j(b);for(var a in b)if(j(b[a]))return!1;return!0}});a.addCommand(h);
h=new c.Command({name:i.Cancel,tooltip:i["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(b){for(var b=Array.isArray(b.items)?b.items:[b.items],a=0;a<b.length;a++){var c=b[a];c.deferred&&c.deferred.cancel()}},visibleWhen:function(b){if(!Array.isArray(b)||b.length===0)return j(b)&&(b.operation&&b.operation.cancelable?!0:!1);for(var a in b)if(!j(b[a])||!b[a].operation||!b[a].operation.cancelable)return!1;return!0}});a.addCommand(h)}})();
return a});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(i,k,g,c,a){function l(a){this._options=a}l.prototype=new c.PopupDialog;l.prototype.TEMPLATE='<table style="width: 360px;"><tr><td><h2>Recent operations</h2></td><td style="text-align: right;"><a id="allOperationsLink" class="navlinkonpage">All Operations</a></td></tr></table><div id="operationsExist"><div style="padding-left: 7px" id="myOperationsListEmpty">No operations running on this page.</div><table id="myOperationsList" style="display: none;"></table></div><div style="padding-left: 7px" id="operationsDontExist">No operations running.</div>';l.prototype._init=
function(c){this._myOperations=[];this._operationsDeferreds=[];this._commandService=c.commandRegistry;a.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(c.triggerNode)};l.prototype._bindToDom=function(){this.$allOperationsLink.href=k.toUrl("operations/list.html");this._setOperationsVisibility()};l.prototype.setOperations=function(a,c){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(a)for(var b in a)this._myOperations.push(a[b]),this._operationsDeferreds.push(c[b]);this._renderOperations()};l.prototype.parseProgressResult=function(a){if(!a)return{};a=a.responseText||a;try{a=JSON.parse(a)}catch(c){}var b={Message:a.Message||a,Severity:a.Severity};if(a.DetailedMessage&&a.DetailedMessage!==b.Message)b.DetailedMessage=a.DetailedMessage;return b};l.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};l.prototype._renderOperationsTable=function(a,c,b){g.empty(a);for(var j=0;j<c.length;j++){var h=c[j],f=document.createElement("tr"),m=document.createElement("td");m.style.paddingLeft="5px";m.style.paddingRight="5px";m.textContent=h.Name;f.appendChild(m);var n=document.createElement("div");m.appendChild(n);m=document.createElement("span");m.style.paddingRight="5px";m.classList.add("imageSprite");switch(h.type){case "Warning":m.classList.add("core-sprite-warning");m.setAttribute("aria-label",
i["Operation resulted in a warning."]);break;case "error":m.classList.add("core-sprite-error");m.setAttribute("aria-label",i["Operation resulted in an error."]);break;case "loadstart":case "progress":m.classList.add("core-sprite-start");m.setAttribute("aria-label",i["Operation is running."]);break;case "abort":m.classList.add("core-sprite-stop");m.setAttribute("aria-label",i["Operation is canceled."]);break;case "load":case "loadend":m.classList.add("core-sprite-ok"),m.setAttribute("aria-label","Operation ok.")}n.appendChild(m);
m=document.createElement("span");m.classList.add("operationStatus");m.textContent=h.Name;n.appendChild(m);if(h.error){var k=h.error.Message||h.error;h.error.DetailedMessage&&h.error.DetailedMessage!==""&&(k+=": "+h.error.DetailedMessage);m.textContent=k;m.classList.remove("operationStatus");m.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",n,{operation:h,deferred:b[j]},this,"tool");a.appendChild(f)}this._setOperationsVisibility()};l.prototype._setOperationsVisibility=
function(){this.$myOperationsList.style.display=this._myOperations.length>0?"":"none";this.$myOperationsListEmpty.style.display=this._myOperations.length>0?"none":"";this.$operationsDontExist.style.display=this._myOperations.length>0?"none":"";this.$operationsExist.style.display=this._myOperations.length>0?"":"none"};l.prototype.constructor=l;return{OperationsDialog:l}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(i,k,g,c,a){function l(d,b){if(!this._progressPane){this._progressPane=c.node(d);this._operationsDialog=new a.OperationsDialog({triggerNode:this._progressPane,commandRegistry:b});var j=this;this._progressPane.addEventListener("keydown",function(b){(b.charOrCode===" "||b.keyCode===c.KEY.ENTER)&&j._operationsDialog.show()})}}function d(a,b,c,d){this._serviceRegistry=
a;this._serviceRegistration=a.registerService("orion.page.progress",this);this._commandRegistry=c;this._operationsClient=b;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=d}l.prototype={_switchIconTo:function(a){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=a;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(a,b){var c=
{},d;for(d in a)a[d].progressMonitor||(c[d]=a[d]);if(this._isEmpty(c))this._switchIconTo("progressPane_empty"),this._progressPane.title=i.Operations,this._progressPane.alt=i.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var f="";for(d in c){var g=c[d];if(g.type&&(g.type==="loadstart"||g.type==="progress")){f="running";break}}switch(f){case "running":this._progressPane.title=i["Operations running"];this._progressPane.alt=i["Operations running"];
this._progressPane.setAttribute("aria-valuetext",i["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=i["Some operations finished with warning"];this._progressPane.alt=i["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",i["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=i["Some operations finished with error"];this._progressPane.alt=
i["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",i["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=i.Operations,this._progressPane.alt=i.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_operations")}}this._operationsDialog.setOperations(c,b)},_isEmpty:function(a){for(var b in a)return!1;return!0}};
l.prototype.constructon=l;d.prototype={init:function(a){if(!this._progressMonitorClass)this._progressMonitorTool=new l(a,this._commandRegistry)},progress:function(a,b,c){var d=this,f=this._operationsIndex++;!c&&this._progressMonitorClass&&(c=new this._progressMonitorClass,c.begin(b));a.then(function(){if(d._operations[f]){var g=d._operations[f];if(b)g.Name=b;d._lastOperation=g;g.type="loadend";if(c)g.progressMonitor=c;d.writeOperation.bind(d)(f,g,a);g.Location||d._removeOperationFromTheList.bind(d)(f)}},
function(g){if(d._operations[f]){var i=d._operations[f];if(b)i.Name=b;if(c)i.progressMonitor=c;d._lastOperation=i;i.type=g.canceled?"abort":"error";i.error=g;d.writeOperation.bind(d)(f,i,a);i.Location||d._removeOperationFromTheList.bind(d)(f)}},function(g){if(b)g.Name=b;if(c)g.progressMonitor=c;d.writeOperation.bind(d)(f,g,a)});return a},removeOperation:function(a){for(var b in this._operations)if(this._operations[b].Location&&this._operations[b].Location===a){this._removeOperationFromTheList(b);
break}this._operationsClient.removeOperation.bind(this._operationsClient)(a)},_removeOperationFromTheList:function(a){var b=this._operations[a].progressMonitor;delete this._operations[a];delete this._operationDeferrds[a];b?b.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var a in this._operations){var b=this._operations[a];if(b.type&&b.type!=="loadstart"&&b.type!=="progress")(b=this._operations[a].progressMonitor)&&
b.done(),delete this._operations[a],delete this._operationDeferrds[a]}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(a){this._serviceRegistry.getService("orion.page.message").setProgressResult(a)},showWhile:function(a,b,c){b&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(b);var d=this;a.then(function(){d._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(b){c?d._serviceRegistry.getService("orion.page.message").setProgressMessage(""):
d.setProgressResult.bind(d)(b);return b});return this.progress(a,b)},writeOperation:function(a,b,c){this._operations[a]=b;this._operationDeferrds[a]=c;b.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(a){a.put(b.Location,{Name:b.Name,expires:b.expires})});b.progressMonitor?b.progressMonitor.progress(b.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};d.prototype.constructor=d;return{ProgressService:d}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(i,k){function g(a,c,b){return a[c].apply(a,b)}function c(a){this._location=a}function a(){var a=new k;a.reject(i["No Matching OperationService for location:"]+this._location);return a}function l(a){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=a.getService("orion.core.preference");for(var e=a.getServiceReferences("orion.core.operation"),
b=0;b<e.length;b++){var g=a.getService(e[b]);this._services[b]=g;g=e[b].getProperty("pattern")||".*";g[0]!=="^"&&(g="^"+g);this._patterns[b]=RegExp(g)}this._getService=function(b){if(!b)return this._services[0];for(var a=0;a<this._patterns.length;++a)if(this._patterns[a].test(b))return this._services[a];this._operations.remove(b);return new c(b)}}c.prototype={getOperation:a,getOperations:a,removeCompletedOperations:a,removeOperation:a,cancelOperation:a};c.prototype.constructor=c;l.prototype={getOperations:function(){var a=
new k;if(this._operations)return a.resolve(this._operations),a;var c=this;this._preferenceService.getPreferences("/operations").then(function(b){c._operations=b;a.resolve(c._operations)});return a},getOperation:function(a){return g(this._getService(a),"getOperation",arguments)},removeCompletedOperations:function(){for(var a=[],c=this,b=0;b<this._services.length;b++){var j=this._patterns[b],h=new k;a[b]=h.promise;g(this._services[b],"removeCompletedOperations").then(function(b){return function(a){Array.isArray(a)&&
c.getOperations.bind(c)().then(function(c){for(var d=c.keys(),e=0;e<d.length;e++){var h=d[e];j.test(h)&&a.indexOf(h)<0&&c.remove(h)}b.resolve()})}}(h),function(b){return function(a){b.reject(a)}}(h))}return k.all(a)},removeOperation:function(a){var c=this;return g(this._getService(a),"removeOperation",arguments).then(function(){c.getOperations.bind(c)().then(function(b){b.remove(a)})},function(b){return b},function(b){return b})}};l.prototype.constructor=l;return{OperationsClient:l}});
define("orion/search/nls/root/messages",{"Find:":"Find:","Find With":"Find With","ReplaceWith:":"ReplaceWith:","Replace With":"Replace With","Show all":"Show all","Wrap search":"Wrap search","Incremental search":"Incremental search","Whole Word":"Whole Word","Regular expression":"Regular expression","Find after replace":"Find after replace",Options:"Options","Find next match":"Find next match","Find previous match":"Find previous match",Next:"Next",Previous:"Previous",Replace:"Replace","Replace All":"Replace All",
"Search ${0}":"Search ${0}","Type a keyword or wild card to search in ":"Type a keyword or wild card to search in ","Search failed.":"Search failed.","No matches found for ${0}":"No matches found for ${0}","Searching...":"Searching...","Resource has been changed by others.":"Resource has been changed by others.","Failed to write file.":"Failed to write file.",Results:"Results","Files ${0} of ${1} matching ${2}":"Files ${0} of ${1} matching ${2}","Replace ${0} with ${1} for files ${2} of ${3}":"Replace ${0} with ${1} for files ${2} of ${3}",
Location:"Location","Click to compare":"Click to compare",'Search again in this folder with "${0}"':'Search again in this folder with "${0}"',"Files replaced":"Files replaced",Status:"Status","${0} out of ${1}  matches replaced.":"${0} out of ${1}  matches replaced.","Replace all matches with...":"Replace all matches with...","Apply Changes":"Apply Changes","Replace all selected matches":"Replace all selected matches","Hide Compare":"Hide Compare","Hide compare view of changes":"Hide compare view of changes",
"Show Compare":"Show Compare","Show compare view of changes":"Show compare view of changes","Show All":"Show All","Show all the results in one page":"Show all the results in one page","< Previous Page":"< Previous Page","Show previous page of search result":"Show previous page of search result","Next Page >":"Next Page >","Show next page of search result":"Show next page of search result","Next result":"Next result","Previous result":"Previous result","Expand all results":"Expand all results","Collapse all results":"Collapse all results",
"Writing files...":"Writing files...","Preparing preview...":"Preparing preview...","Replaced File (${0})":"Replaced File (${0})","Original File (${0})":"Original File (${0})","Sort by Name":"Sort by Name","Compare changes":"Compare changes","Search Results":"Search Results","Replace All Matches":"Replace All Matches","No matches":"No matches",Rename:"Rename","My Saved Searches":"My Saved Searches","Save frequently used searches by choosing ${0} shown above.":"Save frequently used searches by choosing ${0} shown above.",
"Save frequently used searches by clicking on the ${0} button above.":"Save frequently used searches by clicking on the ${0} button above.","Files that contain:":"Files that contain:",Search:"Search","All types":"All types","File type":"File type","All ${0} files":"All ${0} files","${0} is already saved":"${0} is already saved","Type a search term":"Type a search term","Type a replace term":"Type a replace term","Case sensitive":"Case sensitive","Sort by":"Sort by","File name":"File name","Path name":"Path name",
Save:"Save","Type a name for the search":"Type a name for the search","Save the current search":"Save the current search","Type filter text":"Type filter text","Scope Search":"Scope Search","Open in Search page for this directory":"Open the Search page for this folder.","${0}. Try your search again.":"${0}. Try your search again.","Click or use delete key to delete the search term":"Click or use delete key to delete the search term","${0} matches":"${0} matches","Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.":"Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.",
"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.":"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>."});
define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(i,k){var g={root:k};Object.keys(i).forEach(function(c){typeof g[c]==="undefined"&&(g[c]=i[c])});return g});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(i,k){function g(c){this._init(c)}g.prototype={_init:function(c){var a=c.parent,g=this,a=k.node(a);if(!a)throw i["no parent"];if(!c.model)throw i["no tree model"];if(!c.renderer)throw i["no renderer"];this._parent=a;this._treeModel=c.model;this._onComplete=c.onComplete;this._renderer=c.renderer;this._showRoot=c.showRoot===void 0?!1:c.showRoot;this._indent=c.indent===void 0?16:c.indent;this._onCollapse=c.onCollapse;
this._labelColumnIndex=c.labelColumnIndex===void 0?0:c.labelColumnIndex;this._id=c.id===void 0?"treetable":c.id;this._tableStyle=c.tableStyle;this._tableElement=c.tableElement||"table";this._tableBodyElement=c.tableBodyElement||"tbody";this._tableRowElement=c.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(a){g._showRoot?(a._depth=0,g._generate([a],0)):g._treeModel.getChildren(a,function(a){g.destroyed||g._generate(a,0)})})},destroy:function(){this.destroyed=!0},_generate:function(c,
a){k.empty(this._parent);var g=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(g);var d=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(d);d.id=this._id;this._tableStyle&&d.classList.add(this._tableStyle);this._renderer.initTable(d,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+
"tbody";c.length===0?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(c,a);d.appendChild(this._bodyElement);g.appendChild(d);this._parent.appendChild(g);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(c,a,g){for(var d=0;d<c.length;d++){var e=document.createElement(this._tableRowElement);e.id=this._treeModel.getId(c[d]);e._depth=a;e._item=c[d];this._renderer.render(c[d],e);e.childNodes[this._labelColumnIndex].style.paddingLeft=
this._indent*a+"px";this._renderer.rowCallback&&this._renderer.rowCallback(e,c[d]);g?(this._bodyElement.insertBefore(e,g.nextSibling),g&&(g=e)):this._bodyElement.appendChild(e)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(c,a,g){var d=this._treeModel.getId(c),e;if(d===this._id)this._removeChildRows(d),this._generateChildren(a,0),this._rowsChanged();else{var b=k.node(d);b?(b._item=c,
b&&(g||b._expanded)?(this._removeChildRows(d),a?(b._expanded=!0,this._renderer.updateExpandVisuals(b,!0),this._generateChildren(a,b._depth+1,b),this._rowsChanged()):(e=this,this._renderer.updateExpandVisuals(b,"progress"),a=this._treeModel.getChildren(b._item,function(a){if(!e.destroyed&&(e._renderer.updateExpandVisuals(b,!0),!b._expanded))b._expanded=!0,e._generateChildren(a,b._depth+1,b),e._rowsChanged()}))):this._renderer.updateExpandVisuals(b,!1)):console.log(i["could not find table row "]+d)}},
getItem:function(c){var a=k.node(c);return a&&a._item?a._item:c},toggle:function(c){var a=k.node(c);a&&(a._expanded?this.collapse(c):this.expand(c))},isExpanded:function(c){c=typeof c==="string"?c:this._treeModel.getId(c);return(c=k.node(c))?c._expanded:!1},expand:function(c,a,g){var c=typeof c==="string"?c:this._treeModel.getId(c),d=k.node(c);if(d)if(d._expanded)a&&a.apply(e,g);else{var e=this;this._renderer.updateExpandVisuals(d,"progress");this._treeModel.getChildren(d._item,function(b){if(!e.destroyed){e._renderer.updateExpandVisuals(d,
!0);if(!d._expanded)d._expanded=!0,e._generateChildren(b,d._depth+1,d),e._rowsChanged();a&&a.apply(e,g)}})}},_removeChildRows:function(c){for(var a=c===this._id,g=!1,d=-1,e=[],b=k.$$array(".treeTableRow",this._parent),j=0;j<b.length;j++){var h=b[j];if(g)break;if(a)h._depth>d?e.push(h):g=!0;else if(h.id===c)a=!0,d=h._depth}for(c=0;c<e.length;c++)a=e[c],a.parentNode.removeChild(a)},collapse:function(c){var c=typeof c==="string"?c:this._treeModel.getId(c),a=k.node(c);if(a){if(!a._expanded)return;a._expanded=
!1;this._renderer.updateExpandVisuals(a,!1);this._removeChildRows(c);this._rowsChanged()}this._onCollapse&&this._onCollapse(a._item)},getIndent:function(){return this._indent}};g.prototype.constructor=g;return{TableTree:g}});
define("orion/treeModelIterator",[],function(){var i={};i.TreeModelIterator=function(){function i(g,c){this.firstLevelChildren=g;this.reset();this._init(c)}i.prototype={_init:function(g){if(g)this.isExpanded=g.isExpanded,this.isExpandable=g.isExpandable,this.forceExpandFunc=g.forceExpandFunc,this.getChildrenFunc=g.getChildrenFunc},topLevel:function(g){return g.parent?g.parent===this.root:!0},_getChildren:function(g){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(g):g?g.children:
null},_expanded:function(g){if(!g)return!0;var c=this._getChildren(g),c=c&&c.length>0;this.isExpanded&&c&&(c=this.isExpanded(g));return c},_expandable:function(g){return!g?!0:this.isExpandable?this.isExpandable(g):!1},_diveIn:function(g){return this._expanded(g)?(this.setCursor(this._getChildren(g)[0]),this.cursor()):null},_drillToLast:function(g){return this._expanded(g)?(g=this._getChildren(g),this._drillToLast(g[g.length-1])):g},_forward:function(g){if(!this._cursor)return null;var c=this._diveIn(this._cursor);
if(!c){if(g&&this._expandable(this._cursor)&&this.forceExpandFunc){var a=this;return this.forceExpandFunc(this._cursor,"first",function(c){c&&a.setCursor(c)})}(c=this._findSibling(this._cursor,!0))&&this.setCursor(c)}return c},_backward:function(g){if(!this._cursor)return null;var c=this._findSibling(this._cursor,!1);c&&c!==this._cursor.parent&&(c=this._drillToLast(c));if(g&&c&&this._expandable(c)&&this.forceExpandFunc&&c!==this._cursor.parent){var a=this;return this.forceExpandFunc(c,"last",function(c){c&&
a.setCursor(c)})}c&&this.setCursor(c);return c},_findSibling:function(g,c){for(var a=this.topLevel(g),i=this._getChildren(g.parent),i=a?this.firstLevelChildren:i,d=0;d<i.length;d++)if(i[d]===g)return d===0&&!c?a?null:g.parent:d===i.length-1&&c?a?null:this._findSibling(g.parent,c):c?i[d+1]:i[d-1];return null},_inParentChain:function(g,c){for(var a=g.parent;a;){if(a===c)return!0;a=a.parent}return!1},_getTopLevelParent:function(g){if(this.topLevel(g))return g;for(g=g.parent;g;){if(this.topLevel(g))return g;
g=g.parent}return null},_onCollapse:function(g){return this._expanded(g.parent)?g:this._onCollapse(g.parent)},_scan:function(g,c,a){this.setCursor(c);var i=[];for(i.push(c);;){if(this.iterate(g))i.push(this.cursor());else break;if(a===this.cursor())return i}return null},setCursor:function(g){this._prevCursor=this._cursor;this._cursor=g},setTree:function(g){this.firstLevelChildren=g;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(g,c){var a=this.cursor(),
i=this._scan(!0,g,c);i||(i=this._scan(!1,g,c));this.setCursor(a);return i},iterate:function(g,c){return g?this._forward(c):this._backward(c)},iterateOnTop:function(g,c){var a=this._findSibling(this._getTopLevelParent(this.cursor()),g);a?this.setCursor(a):c&&this.firstLevelChildren.length>0&&this.setCursor(g?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(g){if(!this._cursor)return null;return this._inParentChain(this._cursor,g)?(this.setCursor(g),
this._cursor):null},reset:function(){this.root=this._prevCursor=this._cursor=null;if(this.firstLevelChildren.length>0)this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent},cursorMoved:function(){return this._cursor!==this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return i}();return i});
define("orion/explorers/explorerNavHandler",["orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(i,k,g){var c={},a=navigator.userAgent.indexOf("iPad")!==-1,l=window.navigator.platform.indexOf("Mac")!==-1;c.ExplorerNavHandler=function(){function c(a,b,d){this.explorer=a;this.model=this.explorer.model;this._navDict=b;this._listeners=[];this._selections=[];this._currentColumn=0;a=this._getEventListeningDiv();a.tabIndex=0;a.classList.add("selectionModelContainer");var h=this;this._modelIterator=
new k.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:d.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(b){return h.explorer.renderer.isExpandable(b)}:function(b){return h.isExpandable(b)},forceExpandFunc:this.explorer.forceExpandFunc?function(b,a,c){return h.explorer.forceExpandFunc(b,a,c)}:void 0});this._init(d);(!d||d.setFocus!==!1)&&a.focus();d=function(b){if(g.isFormElement(b.target))return!0;if(h.explorer.preventDefaultFunc&&h.explorer.preventDefaultFunc(b,
h._modelIterator.cursor()))return!0;if(b.keyCode===i.KEY.DOWN)return h.onDownArrow(b);else if(b.keyCode===i.KEY.UP)return h.onUpArrow(b);else if(b.keyCode===i.KEY.RIGHT)return h.onRightArrow(b);else if(b.keyCode===i.KEY.LEFT)return h.onLeftArrow(b);else if(b.keyCode===i.KEY.SPACE)return h.onSpace(b);else if(b.keyCode===i.KEY.ENTER)return h.onEnter(b)};a.addEventListener("keydown",d,!1);this._listeners.push({type:"keydown",listener:d});d=function(){if(h.explorer.onFocus)h.explorer.onFocus(!1);else h.toggleCursor(null,
!1)};a.addEventListener("blur",d,!1);this._listeners.push({type:"blur",listener:d});d=function(){if(h.explorer.onFocus)h.explorer.onFocus(!0);else h.toggleCursor(null,!0)};a.addEventListener("focus",d,!1);this._listeners.push({type:"focus",listener:d});this._parentDiv=a}c.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_init:function(a){this._linearGridMove=!1;if(a)this._selectionPolicy=a.selectionPolicy,this.gridClickSelectionPolicy=
a.gridClickSelectionPolicy||"none",this.preventDefaultFunc=a.preventDefaultFunc,this.postDefaultFunc=a.postDefaultFunc},_ctrlKeyOn:function(a){return l?a.metaKey:a.ctrlKey},removeListeners:function(){if(this._listeners)for(var a=0;a<this._listeners.length;a++)this._parentDiv.removeEventListener(this._listeners[a].type,this._listeners[a].listener,!1)},focus:function(){var a=this._getEventListeningDiv();a&&a.focus()},_getEventListeningDiv:function(a){return this.explorer.keyEventListeningDiv&&typeof this.explorer.keyEventListeningDiv===
"function"?this.explorer.keyEventListeningDiv(a):i.node(this.explorer._parentId)},isExpandable:function(a){return!a?!1:i.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)))?!0:!1},isExpanded:function(a){return!a?!1:this.explorer.myTree.isExpanded(this.model.getId(a))},refreshSelection:function(a,b){var c=this;this.explorer.selection&&this.explorer.selection.getSelections(function(d){c._clearSelection(b);for(var f=0;f<d.length;f++)c._selections.push(d[f]);c._selections.length>0?
c.cursorOn(c._selections[0],!0,!1,a):c.cursorOn(null,!1,!1,a);if(!(c._shiftSelectionAnchor&&c._inSelection(c._shiftSelectionAnchor)>=0))c._shiftSelectionAnchor=null})},refreshModel:function(a,b,c,d){this._currentColumn=0;this.topIterationNodes=[];this.model=b;this._navDict=a;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(c)this.topIterationNodes=c;this._modelIterator.setTree(this.topIterationNodes);!d&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),
!1),this._modelIterator.reset());this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(a){for(var a=this.model.getId(a),b=0;b<this._selections.length;b++)if(a===this.model.getId(this._selections[b]))return b;return-1},_clearSelection:function(a){if(a)for(a=0;a<this._selections.length;a++)this._checkRow(this._selections[a],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(a){if(this._selectionPolicy!==
a)this._selectionPolicy=a,this._selectionPolicy==="cursorOnly"&&this._clearSelection(!0)},setSelection:function(a,b,c){if(this._selectionPolicy==="cursorOnly")b&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(a,!0);else if(this._isRowSelectable(a)){!b||this._selectionPolicy==="singleSelection"?(this._clearSelection(!0),this._checkRow(a,!1),this._selections.push(a),this._lastSelection=a):(b=this._inSelection(a),b>=0?(this._checkRow(a,!0),this._selections.splice(b,1)):(this._checkRow(a,
!1),this._selections.push(a),this._lastSelection=a));if(c)this._shiftSelectionAnchor=this._lastSelection;this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(a,b){a||(a=this.currentModel());var c=this._getGridChildren(a);if(c&&c.length>1||b===0&&c){b!==0&&this.toggleCursor(a,!1);var d=this._currentColumn,f=!0;d+=b;d<0?(this._linearGridMove&&b!==0&&(this._modelIterator.iterate(!1)?a=this.currentModel():f=!1),
d=f?c.length-1:this._currentColumn):d>=c.length&&(this._linearGridMove&&b!==0&&(this._modelIterator.iterate(!0)?a=this.currentModel():f=!1),d=f?0:this._currentColumn);this._currentColumn=d;b!==0&&this.toggleCursor(a,!0);return!0}return!1},_getGridChildren:function(a){return this._navDict?this._navDict.getGridNavHolder(a):null},getCurrentGrid:function(a){a||(a=this.currentModel());return(a=this._getGridChildren(a))&&a.length>0?a[this._currentColumn]:null},getAriaContainerElement:function(a){for(var b=
this._parentDiv,c;a&&a!==b&&(c=a.getAttribute("role"))!=="grid"&&c!=="tree"&&c!=="treegrid";)a=a.parentNode;return a===b?null:a},toggleCursor:function(a,b){var c=this.getRowDiv(a),d=this.getCurrentGrid(a);d?(c&&(b?c.classList.add("treeIterationCursorRow"):c.classList.remove("treeIterationCursorRow")),d.domNode&&(c=this.getAriaContainerElement(d.domNode),b?(d.domNode.classList.add("treeIterationCursor"),c&&c.setAttribute("aria-activedescendant",d.domNode.id)):d.domNode.classList.remove("treeIterationCursor"))):
c&&(b?c.classList.add("treeIterationCursorRow_Dotted"):c.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(a,b,c,d){var f,g;if(a||b){if(g===this._modelIterator.cursor())return;f=this._modelIterator.cursor();g=a;this._modelIterator.setCursor(g)}else f=this._modelIterator.prevCursor(),g=this._modelIterator.cursor();if(f!==g||b)if(this.toggleCursor(f,!1),!b||g){this.moveColumn(null,0);this.toggleCursor(g,!0);if((a=this.getRowDiv())&&
!d){d=a.parentNode;for(b=document.documentElement;d&&d!==b;){var i=window.getComputedStyle(d,null);if(!i)break;i=i.getPropertyValue("overflow-y");if(i==="auto"||i==="scroll")break;d=d.parentNode}d&&(b=!0,a.offsetTop<=d.scrollTop?(b=!1,c===void 0&&(c=!1)):a.offsetTop+a.offsetHeight>=d.scrollTop+d.clientHeight&&(b=!1,c===void 0&&(c=!0)),b||a.scrollIntoView(!c))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(f,g)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var a=
[],b=0;b<this._selections.length;b++)a.push(this.model.getId(this._selections[b]));return a},getRowDiv:function(a){a=a?a:this._modelIterator.cursor();if(!a)return null;var a=this.model.getId(a),b=this._navDict.getValue(a);return b&&b.rowDomNode?b.rowDomNode:i.node(a)},iterate:function(a,b,c,d){var f=null;if(this.topIterationNodes&&this.topIterationNodes.length!==0)if(d){d=this.currentModel();for((f=this._modelIterator.iterate(a,b))&&this._setCursorOnItem(a,c);f&&f.isNotSelectable;)(f=this._modelIterator.iterate(a,
b))&&this._setCursorOnItem(a,c);f||(this.cursorOn(d,!0,!1,!0),this._setCursorOnItem(a,c))}else(f=this._modelIterator.iterate(a,b))&&this._setCursorOnItem(a,c)},_setCursorOnItem:function(a,b){this.cursorOn(null,!1,a);if(b){var c=this._inSelection(this._modelIterator.prevCursor()),d=this._inSelection(this._modelIterator.cursor());c>=0&&d>=0?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(a,b){if(this.explorer.renderer._useCheckboxSelection&&
this._selectionPolicy!=="singleSelection"){var c=this.getRowDiv(a);if(c){var d=i.node(this.explorer.renderer.getCheckBoxId(c.id)),f=b?!d.checked:!0;if(f!==d.checked)this.explorer.renderer.onCheck(c,d,f,!0)}}else this._select(a,b)},_select:function(a){a||(a=this._modelIterator.cursor());var b=this.getRowDiv(a);b&&(this._inSelection(a)<0?b.classList.add("checkedRow"):b.classList.remove("checkedRow"))},_onModelGrid:function(a,b){var c=this._getGridChildren(a);if(c)for(var d=0;d<c.length;d++)if(b.target===
c[d].domNode)return!0;return!1},onClick:function(c,b){if(this.isDisabled(this.getRowDiv(c)))i.stop(b);else{var d=i.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(c)));if(b.target!==d&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(c,b)))if(this.cursorOn(c,!0,!1,!0),a)this.setSelection(c,!0);else if(this._ctrlKeyOn(b))this.setSelection(c,!0,!0);else if(b.shiftKey&&this._shiftSelectionAnchor){if(d=this._modelIterator.scan(this._shiftSelectionAnchor,c)){this._clearSelection(!0);
for(var h=0;h<d.length;h++)this.setSelection(d[h],!0)}}else this.setSelection(c,!1,!0)}},onCollapse:function(a){this._modelIterator.collapse(a)&&this.cursorOn()},onUpArrow:function(a){this.iterate(!1,!1,a.shiftKey,!0);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),!1,!0);a.preventDefault();return!1},onDownArrow:function(a){this.iterate(!0,!1,a.shiftKey,!0);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),!1,!0);a.preventDefault();return!1},_shouldMoveColumn:function(a){var b=
this.currentModel(),c=this._getGridChildren(b);return c&&c.length>1?this.isExpandable(b)?this._ctrlKeyOn(a):!0:!1},onLeftArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,-1),a.preventDefault(),!0;var b=this._modelIterator.cursor();if(!b)return!1;if(this.isExpandable(b)&&this.isExpanded(b))return this.explorer.myTree.collapse(b),a.preventDefault(),!0;this._modelIterator.topLevel(b)?this.explorer.scopeUp&&typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(b.parent),
this.setSelection(b.parent,!1,!0))},onRightArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,1),a.preventDefault(),!0;var b=this._modelIterator.cursor();if(!b)return!1;if(this.isExpandable(b)&&!this.isExpanded(b))return this.explorer.myTree.expand(b),this.explorer.postUserExpand&&this.explorer.postUserExpand(this.model.getId(b)),a.preventDefault(),!1},_isRowSelectable:function(a){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(a):!0},onSpace:function(a){this.setSelection(this.currentModel(),
!0,!0);a.preventDefault()},onEnter:function(a){var b=this.getCurrentGrid(this._modelIterator.cursor());if(b)if(b.widget)if(typeof b.onClick==="function")b.onClick();else typeof b.widget.focus==="function"&&b.widget.focus();else{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(a),!1,!1,!1,0,null);b.domNode.dispatchEvent(c)}else if(b=this._modelIterator.cursor()){if(this.explorer.renderer.getRowActionElement&&(c=this.explorer.renderer.getRowActionElement(this.model.getId(b)),
c.href))this._ctrlKeyOn(a)?window.open(c.href):window.location.href=c.href;if(this.explorer.renderer.performRowAction)return this.explorer.renderer.performRowAction(a,b),a.preventDefault(),!1}},setIsNotSelectable:function(a,b){a.isNotSelectable=b},disableItem:function(a){var b=this.getRowDiv(a);this.isExpandable(a)&&this.isExpanded(a)&&(this._modelIterator.collapse(a),this.explorer.myTree.toggle(b.id));b.classList.remove("checkedRow");b.classList.add("disabledNavRow");this.setIsNotSelectable(a,!0)},
isDisabled:function(a){return a.classList.contains("disabledNavRow")},enableItem:function(a){var b=this.getRowDiv(a);b&&(b.classList.remove("disabledNavRow"),this.setIsNotSelectable(a,!1))}};return c}();c.ExplorerNavDict=function(){function a(c){this._dict={};this._model=c}a.prototype={addRow:function(a,b){this._dict[this._model.getId(a)]={model:a,rowDomNode:b}},getValue:function(a){return this._dict[a]},getGridNavHolder:function(a,b){if(!a)return null;var c=this._model.getId(a);if(this._dict[c]){if(!this._dict[c].gridChildren&&
b)this._dict[c].gridChildren=[];return this._dict[c].gridChildren}return null},initGridNavHolder:function(a){if(!a)return null;a=this._model.getId(a);if(this._dict[a])this._dict[a].gridChildren=null}};return a}();return c});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands".split(","),function(i,k,g,c,a,l){var d={};d.Explorer=function(){function d(b,a,c,f){this.registry=b;this.renderer=c;this.selection=a;this.commandService=f;if(this.renderer)this.renderer.explorer=this;this.myTree=null}d.prototype={destroy:function(){this._navHandler&&this._navHandler.destroy();this.model&&this.model.destroy();this.myTree&&
this.myTree.destroy();this.destroyed=!0},changedItem:function(b,a){this.myTree&&this.myTree.refresh.bind(this.myTree)(b,a,!0)},updateCommands:function(b){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(b)},makeNewItemPlaceHolder:function(b,a,c,d){b=this.getRow(b);if(c)return b=b.childNodes[c],b.appendChild(document.createElement("br")),d=document.createElement("span"),d.id=a+"placeHolderRow",b.appendChild(d),{tempNode:d,refNode:d};if(b){var e=document.createElement("tr");
e.id=a+"placeHolderRow";c=document.createElement("td");c.id=a+"placeHolderCol";e.appendChild(c);d?(b.parentNode.insertBefore(e,b.nextSibling),b=parseInt(b.firstChild.style.paddingLeft),c.style.paddingLeft=this.myTree.getIndent()+b+"px"):b.appendChild(e);d=g.node(a+"placeHolderRow");b=g.node(a+"placeHolderCol");if(d&&b)return{tempNode:d,refNode:b}}return null},getRow:function(b){if(b=this.model.getId(b))return g.node(b)},collapseAll:function(){for(var b=this._navHandler.getTopLevelNodes(),a=0;a<b.length;a++)this.myTree.collapse(b[a])},
expandAll:function(b){if(b)this._expandRecursively(b);else if(this._navHandler)for(var b=this._navHandler.getTopLevelNodes(),a=0;a<b.length;a++)this._expandRecursively(b[a])},_expandRecursively:function(b){if(this._navHandler&&this._navHandler.isExpandable(b)){var a=this;this.myTree.expand(b,function(){a.model.getChildren(b,function(b){if(!(b===void 0||b===null))for(var c=b.length,d=0;d<c;d++)a._expandRecursively(b[d])})})}},createTree:function(b,d,e){b=typeof b==="string"?b:b.id||b;this.selection&&
this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var f=b+"innerTree",i=g.node(f);i&&g.empty(i);if(d)d.rootId=f;this.model=d;this._parentId=b;this._treeOptions=e;if(!e||e&&!e.noSelection)this.selectionPolicy=e?e.selectionPolicy:"",this._navDict=new a.ExplorerNavDict(this.model);this.myTree=new c.TableTree({id:f,model:d,parent:b,onComplete:e?e.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:e?!!e.showRoot:
!1,indent:e?e.indent:void 0,onCollapse:e?e.onCollapse:void 0,navHandlerFactory:e?e.navHandlerFactory:void 0,tableElement:e?e.tableElement:void 0,tableBodyElement:e?e.tableBodyElement:void 0,tableRowElement:e?e.tableRowElement:void 0});this.renderer._initializeUIState();this.selectionPolicy==="cursorOnly"&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},refreshSelection:function(){if(this.selection){var b=this.getNavHandler(),a=[];
if(b&&this.getNavDict())for(var c=b.getSelection(),d=0;d<c.length;d++){var e=b.getRowDiv(c[d]);e&&e.parentNode&&(e=this.getNavDict().getValue(this.model.getId(c[d])),e.model&&a.push(e.model))}this.selection.setSelections(a)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var b=this._treeOptions;if(!b||b&&!b.noSelection){if(!this.getNavHandler())this._navHandler=b&&b.navHandlerFactory&&typeof b.navHandlerFactory.createNavHandler===
"function"?b.navHandlerFactory.createNavHandler(this,this._navDict,b):new a.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:b?b.getChildrenFunc:null,setFocus:b&&b.setFocus,selectionPolicy:b?b.selectionPolicy:null});var c=this;this.model.getRoot(function(a){a instanceof Array?c.getNavHandler().refreshModel(c.getNavDict(),c.model,a):a.children&&a.children instanceof Array&&c.getNavHandler().refreshModel(c.getNavDict(),c.model,a.children);b&&b.setFocus&&c.getNavHandler().cursorOn(null,!1,!1,!0)})}},
_lastHash:null,checkbox:!1};return d}();d.createExplorerCommands=function(a,b){function c(a){return typeof a.getItemCount==="function"?a.getItemCount()>0?b?b(a):!0:!1:!1}var d=new l.Command({tooltip:i["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(b){return c(b)},callback:function(b){b.items.expandAll()}}),f=new l.Command({tooltip:i["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",
groupId:"orion.explorerGroup",visibleWhen:function(b){return c(b)},callback:function(b){b.items.collapseAll()}});a.addCommand(d);a.addCommand(f)};d.ExplorerModel=function(){function a(b,c,d){this.rootPath=b;this.fetchItems=c;this.idPrefix=d||""}a.prototype={destroy:function(){this.destroyed=!0},getRoot:function(b){var a=this;this.fetchItems(this.rootPath).then(function(c){a.root=c;b(c)})},getChildren:function(b,a){b.Children?a(b.Children):b.ChildrenLocation?this.fetchItems(b.ChildrenLocation).then(function(c){b.Children=
c;a(c)}):a([])},getId:function(b){if(b.Location===this.root.Location)return this.rootId;for(var b=b.Location.replace(/[\\\/]/g,""),a=this.idPrefix,c=0;c<b.length;c++)a+=b[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?b.charCodeAt(c):b[c];return a}};return a}();d.ExplorerFlatModel=function(){function a(b,c,d){this.rootPath=b;this.fetchItems=c;this.root=d}a.prototype=new d.ExplorerModel;a.prototype.getRoot=function(b){if(this.root)b(this.root);else{var a=this;this.fetchItems(this.rootPath).then(function(c){a.root=
c;b(c)})}};a.prototype.getChildren=function(b,a){b===this.root?a(this.root):a([])};return a}();d.ExplorerRenderer=function(){function a(b,c){this.explorer=c;this._init(b);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite"}a.prototype={_init:function(b){if(b){this._useCheckboxSelection=b.checkbox===void 0?!1:b.checkbox;this.selectionPolicy=b.singleSelection?
"singleSelection":"";this._cachePrefix=b.cachePrefix;this.getCheckedFunc=b.getCheckedFunc;this.onCheckedFunc=b.onCheckedFunc;this._highlightSelection=!0;this._treeTableClass=b.treeTableClass||"treetable";if(b.highlightSelection===!1)this._highlightSelection=!1;if(!this.actionScopeId)this.actionScopeId=b.actionScopeId;if(!this.commandService)this.commandService=b.commandService}},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(b,a){this.tableTree=a;this.tableNode=
b;g.empty(b);this._treeTableClass&&b.classList.add(this._treeTableClass);this.renderTableHeader(b)},getActionsColumn:function(b,a,c,d,e){var c=c||"tool",g=document.createElement("td");g.id=a.id+"actionswrapper";d&&g.classList.add(d);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,g,b,this.explorer,c,null,e&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(b,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return g},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(b,a){if(this._useCheckboxSelection){var c=document.createElement("td"),d=document.createElement("span");d.id=this.getCheckBoxId(a.id);d.classList.add("core-sprite-check");d.classList.add("selectionCheckmarkSprite");d.rowId=a.id;if(this.getCheckedFunc)d.checked=this.getCheckedFunc(b),d.checked?(this._highlightSelection&&a.classList.add("checkedRow"),d.classList.add("core-sprite-check_on")):
(this._highlightSelection&&a.classList.remove("checkedRow"),d.classList.remove("core-sprite-check_on"));c.appendChild(d);var e=this;d.addEventListener("click",function(b){e.onCheck(a,b.target,b.target.checked?!1:!0,!0)},!1);return c}},getCheckBoxId:function(b){return b+"selectedState"},onCheck:function(b,a,c,d,e){(a.checked=c)?a.classList.add("core-sprite-check_on"):a.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(a.rowId,c,d);this.explorer.getNavHandler()&&e&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(b.id).model,
!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var b=this.explorer.getNavHandler().getSelectionIds(),a=this._getUIStatePreferencePath();a&&window.sessionStorage&&(window.sessionStorage[a+"selection"]=JSON.stringify(b))}},_restoreSelections:function(b){var a=this.explorer.getNavDict(),c=this.explorer.getNavHandler();if(c&&a&&c.getSelectionPolicy()!=="cursorOnly"&&(b=window.sessionStorage[b+"selection"],typeof b==="string"&&(b=b.length>0?JSON.parse(b):null),b)){for(var d=[],c=0;c<
b.length;c++){var e=a.getValue(b[c]);if(e&&e.rowDomNode&&e.model&&(d.push(e.model),this._highlightSelection&&e.rowDomNode.classList.add("checkedRow"),e=g.node(this.getCheckBoxId(e.rowDomNode.id))))e.checked=!0,e.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(d),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(b){window.sessionStorage[b+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(b){var a=
!1,c=window.sessionStorage[b+"expanded"];typeof c==="string"&&(c=c.length>0?JSON.parse(c):null);var d;if(c)for(d=0;d<c.length;d++)if(g.node(c[d])){this._expanded.push(c[d]);var e=this;this.tableTree.expand(c[d],function(){e._restoreSelections(b)});a=!0}return!a},_getUIStatePreferencePath:function(){if(this.explorer){var b=this.explorer.getRootPath();if(this._cachePrefix&&b)return"/"+this._cachePrefix+"/"+b.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(b){return b+
"__expand"},updateExpandVisuals:function(b,a){var c=g.node(this.expandCollapseImageId(b.id));c&&(c.classList.remove(this._expandImageClass),c.classList.remove(this._collapseImageClass),c.classList.remove(this._progressImageClass),c.classList.add(a==="progress"?this._progressImageClass:a?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(b,a,c,d){var e=document.createElement("span");e.id=this.expandCollapseImageId(b.id);a.appendChild(e);e.classList.add(this._twistieSpriteClass);
e.classList.add(this._collapseImageClass);if(c){var g=document.createElement("span");a.appendChild(g);g.classList.add(d||"imageSprite");g.classList.add(c)}var i=this;e.onclick=function(){if(!i.explorer.getNavHandler().isDisabled(b)){i.tableTree.toggle(b.id);if(i.tableTree.isExpanded(b.id))i._expanded.push(b.id),i.explorer.postUserExpand&&i.explorer.postUserExpand(b.id);else for(var a in i._expanded)if(i._expanded[a]===b.id){i._expanded.splice(a,1);break}(a=i._getUIStatePreferencePath())&&window.sessionStorage&&
i._storeExpansions(a)}};return e},render:function(b,a){a.classList.add("navRow");this.renderRow(b,a)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),this.explorer.initNavHandler());(g.$(".sectionTreeTable",this.tableNode.parentNode)||g.$(".treetable",this.tableNode.parentNode))&&g.$$array(".treeTableRow",this.tableNode).forEach(function(b,a){var c=!(a%2)?"darkSectionTreeTableRow":"lightSectionTreeTableRow",d=c==="darkSectionTreeTableRow"?"lightSectionTreeTableRow":
"darkSectionTreeTableRow";b.classList.add(c);b.classList.remove(d)})},updateCommands:function(){if(this.commandService)for(var b=g.$$array(".treeTableRow"),a=0;a<b.length;a++){var c=b[a],d=g.node(c.id+"actionswrapper");this.commandService.destroy(d);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,d,c._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var b=this._getUIStatePreferencePath();b&&window.sessionStorage&&this._restoreExpansions(b)&&this._restoreSelections(b)}};
return a}();d.SelectionRenderer=function(){function a(b,c){this._init(b);this.explorer=c}a.prototype=new d.ExplorerRenderer;a.prototype.renderTableHeader=function(b){var a=document.createElement("thead"),c=document.createElement("tr");a.classList.add("navTableHeading");this._useCheckboxSelection&&c.appendChild(this.initCheckboxColumn(b));for(var d=0,e=this.getCellHeaderElement(d);e;)e.innerHTML.length>0&&e.classList.add("navColumn"),c.appendChild(e),e=this.getCellHeaderElement(++d);a.appendChild(c);
d>0&&b.appendChild(a)};a.prototype.renderRow=function(b,a){a.verticalAlign="baseline";a.classList.add("treeTableRow");var c=this.explorer.getNavDict();if(c){c.addRow(b,a);var d=this;a.addEventListener("click",function(a){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(b,a)},!1)}if(c=this.getCheckboxColumn(b,a))c.classList.add("checkColumn"),a.appendChild(c);for(var c=0,e=this.getCellElement(c,b,a);e;)a.appendChild(e),c===0?this.getPrimColumnStyle?e.classList.add(this.getPrimColumnStyle(b)):
e.classList.add("navColumn"):this.getSecondaryColumnStyle?e.classList.add(this.getSecondaryColumnStyle()):e.classList.add("secondaryColumn"),e=this.getCellElement(++c,b,a)};a.prototype.getCellHeaderElement=function(){};a.prototype.getCellElement=function(){};return a}();d.SimpleFlatModel=function(){function a(b,c,d){this.items=b;this.getKey=d;this.idPrefix=c;this.root={children:b}}a.prototype=new d.ExplorerModel;a.prototype.getRoot=function(a){a(this.root)};a.prototype.getId=function(a){for(var a=
this.getKey(a).replace(/[\\\/]/g,""),c="",d=0;d<a.length;d++)c+=a[d].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(d):a[d];return this.idPrefix+c};a.prototype.getChildren=function(a,c){a===this.root?c(this.items):c([])};return a}();return d});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages,orion/Deferred,orion/explorers/explorer,orion/explorers/navigationUtils,orion/extensionCommands,orion/objects,orion/URITemplate,orion/webui/littlelib".split(","),function(i,k,g,c,a,l,d,e){function b(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1}function j(c,e,g,h,i,j,w,s,y){var e=l.clone(e),t;if(e.Directory)t=document.createElement("a"),
t.className="navlinkonpage",t.href=!c?f:(new d(c+"#{,resource,params*}")).expand({resource:e.ChildrenLocation}),e.Name&&t.appendChild(document.createTextNode(e.Name));else{i||(i=a.getOpenWithCommands(g));t=document.createElement("a");t.className="navlink targetSelector";j&&typeof j==="object"&&Object.keys(j).forEach(function(a){t[a]=j[a]});var z=null,v=null;if(z=s?s.holderDom:t)v=document.createElement("span"),v.className="core-sprite-file modelDecorationSprite thumbnail",z.appendChild(v);e.Name&&
t.appendChild(document.createTextNode(e.Name));var H=e.Location;if(w&&typeof w==="object")e.params={},l.mixin(e.params,w);(c=a.getOpenWithCommand(g,e,i))&&(H=c.hrefCallback({items:e}));k.when(h.getFileContentType(e),function(a){if(z){var c=z,d=v;if(a){var f,g=a.imageClass,h=a.image;if(g)f=document.createElement("span"),f.className+=g,f.classList.add("thumbnail");else if(h)f=document.createElement("img"),f.src=h,f.classList.add("thumbnail");f&&c.replaceChild(f,d)}}t.href=H;y&&typeof y.updateFileNode===
"function"&&y.updateFileNode(e,t,b(a))})}return t}function h(a,b,c,d){this.explorer=b;this.commandService=c;this.contentTypeService=d;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var f=new d("#{,resource,params*}");h.prototype=new g.SelectionRenderer;h.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};h.prototype.tableCallback=function(a){a.setAttribute("aria-label",i.Navigator);a.setAttribute("role","presentation")};h.prototype.rowCallback=
function(a){a.setAttribute("role","treeitem")};h.prototype.emptyCallback=function(a){var b=document.createElement("tr"),c=document.createElement("td");c.colSpan=this.oneColumn?1:3;var d=document.createElement("div");d.classList.add("noFile");d.textContent=i.NoFile;var f=document.createElement("span");f.appendChild(document.createTextNode(i.File));e.processDOMNodes(d,[f]);c.appendChild(d);b.appendChild(c);a.appendChild(b)};h.prototype.getCellHeaderElement=function(a){if(this.oneColumn&&a!==0)return null;
switch(a){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};h.prototype.setTarget=function(a){this.target=a};h.prototype.getFolderImage=function(){if(!this.showFolderImage)return null;var a=document.createElement("span");a.className="core-sprite-folder modelDecorationSprite";return a};h.prototype.createFolderNode=function(a){var b;this.showFolderLinks?(b=j(this.folderLink||"",a,this.commandService,this.contentTypeService),(a=this.getFolderImage(a))&&b.insertBefore(a,b.firstChild)):
(b=document.createElement("span"),b.textContent=a.Name);return b};h.prototype.updateFileNode=function(){};h.prototype.showFolderLinks=!0;h.prototype.getCellElement=function(b,d,f){switch(b){case 0:var b=document.createElement("td"),e=document.createElement("span");e.id=f.id+"MainCol";e.setAttribute("role","presentation");b.appendChild(e);b.setAttribute("role","presentation");e.className="mainNavColumn";var g;if(d.Directory)this.getExpandImage(f,e),g=this.createFolderNode(d),e.appendChild(g),this.explorer._makeDropTarget(d,
g),this.explorer._makeDropTarget(d,f);else{if(!this.openWithCommands)this.openWithCommands=a.getOpenWithCommands(this.commandService);g=j("",d,this.commandService,this.contentTypeService,this.openWithCommands,{target:this.target},null,null,this);e.appendChild(g)}if(g)g.id=f.id+"NameLink",g.nodeType===1&&(c.addNavGrid(this.explorer.getNavDict(),d,g),g.setAttribute("role","link"),g.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,e,d,this.explorer,
"tool",null,!0);return b;case 1:if(this.oneColumn)return null;f=document.createElement("td");if(d.LocalTimeStamp)f.textContent=(new Date(d.LocalTimeStamp)).toLocaleString();return f;case 2:if(this.oneColumn)return null;f=document.createElement("td");if(!d.Directory&&typeof d.Length==="number")d=parseInt(d.Length,10)/1024,f.textContent=Math.ceil(d).toLocaleString()+" KB";f.style.textAlign="right";return f}};h.prototype.constructor=h;return{NavigatorRenderer:h,isImage:b,createLink:j}});
define("orion/searchClient","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/i18nUtil,orion/searchUtils,orion/crawler/searchCrawler,orion/explorers/navigatorRenderer,orion/extensionCommands,orion/Deferred".split(","),function(i,k,g,c,a,l,d,e,b){function j(a,b){this.serviceRegistry=a;this.commandRegistry=b;this.openWithCommands=null}function h(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new j(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}j.prototype.makeRenderFunction=function(f,h,j,l,p){var o=this.serviceRegistry,r=this.commandRegistry;this.openWithCommands=this.openWithCommands||e.createOpenWithCommands(o,f,r);var w=this;return function(e,o,t,z){b.when(w.openWithCommands,function(b){if(t)g.empty(h),b=document.createElement("div"),b.appendChild(document.createTextNode(i["Search failed."])),h.appendChild(b),typeof l==="function"&&l(h);else{var w=
function(){function a(b,c){var d=c.folderName?c.folderName:c.path,f=document.createElement("span");f.id=d.replace(/[^a-zA-Z0-9_\.:\-]/g,"");f.appendChild(document.createTextNode(" - "+d+" "));b.appendChild(f)}var b={};return function(c,d){var f=d.name;if(b.hasOwnProperty(f)){a(c,d);var e=b[f];typeof e==="function"&&(b[f]=null,e())}else b[f]=function(){a(c,d)}}}(),G=!1;g.empty(h);if(e&&e.length>0){var D=document.createElement("table");D.setAttribute("role","presentation");for(var u=0;u<e.length;u++){var B=
e[u],x;if(!G&&(G=!0,j))x=D.insertRow(0).insertCell(0),x.textContent=j;x=D.insertRow(-1).insertCell(0);x.colspan=2;p&&p(x);var C={Name:B.name,Directory:B.directory,Location:B.path||B.location},A=null;if(typeof B.LineNumber==="number")A={},A.line=B.LineNumber;if(z&&z.keyword&&!z.nameSearch){var E=a.generateSearchHelper(z),A=A||{};A.find=E.inFileQuery.searchStr;A.regEx=E.inFileQuery.wildCard?!0:void 0}C=d.createLink(k.toUrl("edit/edit.html"),C,r,f,b,{"aria-describedby":(B.folderName?B.folderName:B.path).replace(/[^a-zA-Z0-9_\.:\-]/g,
""),style:{verticalAlign:"middle"}},A);B.LineNumber&&C.appendChild(document.createTextNode(" (Line "+B.LineNumber+")"));x.appendChild(C);w(x,B)}h.appendChild(D);typeof l==="function"&&l(h)}!G&&o&&(b=c.formatMessage(i["No matches found for ${0}"],o),g.empty(h),h.appendChild(document.createTextNode(b)),typeof l==="function"&&l(h))}})}};h.prototype={search:function(b,c,d){var e=function(b){for(var d=[],f=0;f<b.response.docs.length;f++){var e=b.response.docs[f],g=e.Location,h=a.path2FolderName(e.Path?
e.Path:e.Location,e.Name),i=h?h:g;(c?i.indexOf(c)>=0:1)&&d.push({name:e.Name,path:g,folderName:h,directory:e.Directory,lineNumber:e.LineNumber})}return d};if(this._crawler&&b.nameSearch)this._crawler.searchName(b,function(a){d(e(a),b.keyword,null,b)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(b),"Searching "+b.keyword).then(function(a){var c=b.keyword,c=c.substring(c.indexOf("}")+1),c=c.substring(c.indexOf(":")+1);d(e(a),c,null,b)},function(a){d(null,
null,a,null)})}catch(g){typeof g==="string"&&g.indexOf("search")>-1&&this._crawler?this._crawler.searchName(b,function(a){d(e(a),null,null,b)}):typeof g==="string"&&g.indexOf("search")>-1&&!b.nameSearch?(new l.SearchCrawler(this.registry,this._fileService,b,{childrenLocation:this.getChildrenLocation()})).search(function(a){d(e(a),null,null,b)}):this.registry.getService("orion.page.message").setErrorMessage(g)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=
a},handleError:function(a,b){console.error(a);g.empty(b);b.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,b){var d="",e=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);b&&a&&a.Parents&&a.Parents.length>0?e=b.index==="last"?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&a.Directory&&a.Location&&a.Parents&&(e=a);if(e)this.setLocationbyURL(e.Location),d=e.Name,this._childrenLocation=e.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),
d=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation;e=g.node("search");d||(d="");if(e&&e.placeholder){e.value="";var h=c.formatMessage(i["Search ${0}"],d);e.placeholder=h.length>30?h.substring(0,27)+"...":c.formatMessage(i["Search ${0}"],d)}if(e&&e.title)e.title=i["Type a keyword or wild card to search in "]+d},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=
a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,b,c,d){c=c?this.getSearchRootLocation():this.getSearchLocation();return b?{resource:c,sort:"NameLower asc",
rows:100,start:0,nameSearch:!0,keyword:a}:{resource:c,sort:d&&d.sort?d.sort:"Path asc",rows:d&&d.rows?d.rows:40,start:0,caseSensitive:d?d.caseSensitive:void 0,regEx:d?d.regEx:void 0,fileType:d?d.fileType:void 0,keyword:a,replace:d?d.replace:void 0}}};h.prototype.constructor=h;return{Searcher:h}});
define("orion/dialogs",[],function(){function i(i){this._serviceRegistry=i;this._serviceRegistration=i.registerService("orion.page.dialog",this)}i.prototype={confirm:function(i,g){g(window.confirm(i))},openFiles:function(){}};i.prototype.constructor=i;return{DialogService:i}});
define("orion/sites/siteClient",["i18n!orion/sites/nls/messages","require","orion/Deferred","orion/fileClient"],function(i,k,g,c){function a(a,b,c){var d=a[b],e=new g;if(typeof d!=="function")throw i["Service method missing: "]+b;d.apply(a,c).then(function(a){e.resolve(a)},function(a){e.reject(a)});return e}function l(a,b){return new c.FileClient(a,function(a){return(a=a.getProperty("top"))&&a.indexOf(b)===0})}function d(a,b,c){this._serviceRegistry=a;this._siteService=b;this._selfHost=c.getProperty("canSelfHost");
this._selfHostConfig=c.getProperty("selfHostingConfig");this._sitePattern=c.getProperty("sitePattern");this._filePattern=c.getProperty("filePattern");this._name=c.getProperty("name");this._id=c.getProperty("id");this._getService=function(){return this._siteService};this._getFilePattern=function(){return this._filePattern};this._getFileClient=function(){return l(this._serviceRegistry,this._getFilePattern())};this._canSelfHost=function(){return this._selfHost}}function e(b,c){b[c]=function(){return a(this._getService(),
c,Array.prototype.slice.call(arguments))}}function b(a,b,c){for(var e=a.getServiceReferences("orion.site"),g=[],k=[],l=[],o=0;o<e.length;o++){var r=e[o].getProperty(b),r=r[0]!=="^"?"^"+r:r;g.push(e[o]);k.push(RegExp(r));l.push(a.getService(e[o]))}c=function(a){if(a==="/")return-1;else if(!a||a.length&&a.length===0)return 0;for(var c=0;c<k.length;c++)if(k[c].test(a))return c;throw i["No Matching SiteService for "]+b+": "+a;}(c);return new d(a,l[c],g[c])}d.prototype={getSelfHostingConfig:function(){return this._selfHostConfig},
isFileMapped:function(a,b){if(!a){var c=new g;c.resolve(!1);return c}return this.getURLOnSite(a,b).then(function(a){return a!==null})},mapOnSiteAndStart:function(a,b,c){function d(c,f,i){return e.isFileMapped(a,b).then(function(a){a||i.push({Source:c,Target:f,FriendlyPath:c});a=new g;a.resolve();return a})}var e=this,i="/"+b.Name,k;if(a){if(a.HostingStatus.Status==="started")a.HostingStatus.Status="stopped";k=e.toInternalForm(b.Location).then(function(b){return d(i,b,a.Mappings).then(function(){return e.updateSiteConfiguration(a.Location,
a).then(function(a){return e.updateSiteConfiguration(a.Location,{HostingStatus:{Status:"started"}})})})})}else{var o=b.Name+" site";k=e.toInternalForm(b.Location).then(function(a){var b=[];return d(i,a,b).then(function(){return e.createSiteConfiguration(o,c,b,null,{Status:"started"}).then(function(a){return a})})})}return k.then(function(a){return e.getURLOnSite(a,b)})}};"createSiteConfiguration,getSiteConfigurations,deleteSiteConfiguration,loadSiteConfiguration,updateSiteConfiguration,toFileLocation,toInternalForm,getMappingObject,getMappingProposals,updateMappingsDisplayStrings,parseInternalForm,isSelfHostingSite,convertToSelfHosting,getURLOnSite".split(",").forEach(function(a){e(d.prototype,
a)});d.prototype.constructor=d;return{forLocation:function(a,c){return b(a,"pattern",c)},forFileLocation:function(a,c){return b(a,"filePattern",c)},getFileClient:l,SiteClient:d}});
define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(i){return{makeRelative:function(i){if(!i)return i;var g=window.location.protocol+"//"+window.location.host;return i.indexOf(g)===0?i.substring(g.length):i},isAtRoot:function(k){if(!k)return!1;if(k==="/workspace")return!0;var g=new URL(i.toUrl("workspace"),window.location.href);return(new URL(k,window.location.href)).href.indexOf(g.href)===0}}});
define("orion/sites/siteUtils",["require","orion/fileUtils","orion/URITemplate"],function(i,k,g){return{generateEditSiteHref:function(c){var a=i.toUrl("sites/site.html");return(new g(a+"#{,resource,params*}")).expand({resource:k.makeRelative(c.Location)})}}});
define("orion/sites/siteCommands","i18n!orion/sites/nls/messages,require,orion/commandRegistry,orion/commands,orion/sites/siteUtils,orion/sites/siteClient,orion/Deferred,orion/i18nUtil".split(","),function(i,k,g,c,a,l,d,e){function b(a){return a instanceof Array?a:[a]}function j(a){return function(b){if(b instanceof Array&&b.length===1&&!(a instanceof Array))return b[0]}}var h=c.Command,f=e.formatMessage;return{createSiteServiceCommands:function(b,d,f){var f=f||{},e=new c.Command({name:i.Create,tooltip:i["Create a new site configuration"],
id:"orion.site.create",parameters:new g.ParametersDescription([new g.CommandParameter("name","text",i.Name)]),visibleWhen:function(){return!0},callback:function(c){var d=c.items,e=b.getService(d),d=l.getFileClient(b,d.getProperty("filePattern")),g=c.parameters&&c.parameters.valueFor("name"),c=b.getService("orion.page.progress");(c?c.progress(d.loadWorkspaces(),"Loading workspaces"):d.loadWorkspaces()).then(function(b){(b=b&&b[0]&&b[0].Id)&&g&&e.createSiteConfiguration(g,b).then(function(b){f.createCallback(a.generateEditSiteHref(b),
b)},f.errorCallback)})}});d.addCommand(e)},createSiteCommands:function(c,e){var g=c.getService("orion.page.dialog"),k=c.getService("orion.page.progress"),o=new h({name:i.Edit,tooltip:i["Edit the site configuration"],imageClass:"core-sprite-edit",id:"orion.site.edit",visibleWhen:function(a){a instanceof Array&&a.length===1&&(a=a[0]);return a.HostingStatus},hrefCallback:function(b){return a.generateEditSiteHref(b.items instanceof Array?b.items[0]:b.items)}});e.addCommand(o);o=new h({name:i.Start,tooltip:i["Start the site"],
imageClass:"core-sprite-start",id:"orion.site.start",visibleWhen:function(a){return b(a).some(function(a){return a.HostingStatus&&a.HostingStatus.Status==="stopped"})},callback:function(a){var f=b(a.items),e=a.userData;if(e.site&&f.length>1)throw Error("userData.site requires a single site configuration to act upon");f=f.map(function(a){var b=e.site||{};b.HostingStatus={Status:"started"};a=a.Location;return l.forLocation(c,a).updateSiteConfiguration(a,b)});k.showWhile(d.all(f)).then(j(a.items)).then(e.startCallback,
e.errorCallback)}});e.addCommand(o);var r=function(a,b){var d=a?b:{};d.HostingStatus={Status:"stopped"};var f=b.Location;return l.forLocation(c,f).updateSiteConfiguration(f,d)},o=new h({name:i.Stop,tooltip:i["Stop the site"],imageClass:"core-sprite-stop",id:"orion.site.stop",visibleWhen:function(a){return b(a).some(function(a){return a.HostingStatus&&a.HostingStatus.Status==="started"})},callback:function(a){var c=b(a.items),f=a.userData;if(f.site&&c.length>1)throw Error("userData.site requires a single site configuration to act upon");
c=c||[f.site];c=c.map(r.bind(null,!!f.site));k.showWhile(d.all(c)).then(j(a.items)).then(f.stopCallback,f.errorCallback)}});e.addCommand(o);o=new h({name:i.Delete,tooltip:i["Delete the site configuration"],imageClass:"core-sprite-delete",id:"orion.site.delete",visibleWhen:function(a){return b(a).length>0},callback:function(a){var e=b(a.items),h=a.userData,k=e.length===1?f(i.ConfirmDeleteSingle,e[0].Name):f(i.ConfirmDeleteMultiple,e.length);g.confirm(k,function(b){b&&(b=e.map(function(a){var b=a.HostingStatus&&
a.HostingStatus.Status!=="stopped"?r(!1,a):a;return d.when(b).then(function(){var b=a.Location;return l.forLocation(c,b).deleteSiteConfiguration(b)})}),d.all(b).then(j(a.items)).then(h.deleteCallback,h.errorCallback))})}});e.addCommand(o)},createViewOnSiteCommands:function(a,b){var c=a.getService("orion.core.file");b.addCommand(new h({name:i["Add to site"],tooltip:i["Add the file to this site"],id:"orion.site.add-to",imageClass:"core-sprite-add",visibleWhen:function(a){return!a.IsFileRunningOn},callback:function(b){var d=
b.userData.file,f=b.items.SiteConfiguration,e=a.getService("orion.page.progress");return(e?e.progress(c.loadWorkspaces(),"Loading workspaces"):c.loadWorkspaces()).then(function(b){return l.forFileLocation(a,d.Location).mapOnSiteAndStart(f,d,b[0].Id)}).then(b.userData.addToCallback,b.userData.errorCallback)}}));b.addCommand(new h({name:i.View,tooltip:i["View the file on the site"],id:"orion.site.view-on-link",visibleWhen:function(a){return a.IsFileRunningOn},hrefCallback:function(b){var c=b.userData.file,
b=b.items.SiteConfiguration;return l.forFileLocation(a,c.Location).getURLOnSite(b,c)}}))}}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(i){function k(g,c){c||(c="orion.page.selection");this._serviceRegistry=g;i.attach(this);this._serviceRegistration=g.registerService(c,this);this._selections=null}k.prototype={getSelection:function(g){var c=this._getSingleSelection();typeof g==="function"&&g(c);return c},getSelections:function(g){var c=Array.isArray(this._selections)?this._selections.slice():[];typeof g==="function"&&g(c);return c},_getSingleSelection:function(){return this._selections&&
this._selections.length>0?this._selections[0]:null},setSelections:function(g){var c=this._selections;this._selections=Array.isArray(g)?g.length>0?g.slice():null:g?[g]:null;c!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};k.prototype.constructor=k;return{Selection:k}});
define("orion/section","orion/webui/littlelib,orion/selection,orion/commandRegistry,orion/commonHTMLFragments,orion/objects,orion/selection".split(","),function(i,k,g,c,a,l){function d(a,d){var e=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite";if(!d.id)throw Error("Missing required argument: id");this.id=d.id;if(!d.title)throw Error("Missing required argument: title");var f=d.useAuxStyle?["sectionWrapper",
"sectionWrapperAux","toolComposite"]:["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");a.appendChild(this.domNode);for(var g=0;g<f.length;g++)this.domNode.classList.add(f[g]);this.domNode.id=d.id;if(d.canHide)this.twistie=document.createElement("span"),this.twistie.classList.add("modelDecorationSprite"),this.twistie.classList.add("layoutLeft"),this.twistie.classList.add("sectionTitleTwistie"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),this.domNode.tabIndex=
0,this.domNode.addEventListener("click",function(a){(a.target===e.titleNode||a.target===e.twistie)&&e._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===i.KEY.ENTER&&(a.target===e.domNode||a.target===e.titleNode||a.target===e.twistie)&&e._changeExpandedState()},!1);if(d.iconClass){var k=document.createElement("span");k.classList.add("sectionIcon");this.domNode.appendChild(k);f=Array.isArray(d.iconClass)?d.iconClass:[d.iconClass];f.forEach(function(a){k.classList.add(a)})}d.headerClass&&
(f=Array.isArray(d.headerClass)?d.headerClass:[d.headerClass],f.forEach(function(a){this.domNode.classList.add(a)}.bind(this)));this.titleNode=document.createElement("div");this.titleNode.id=d.id+"Title";this.titleNode.classList.add("sectionAnchor");this.titleNode.classList.add("sectionTitle");this.titleNode.classList.add("layoutLeft");this.domNode.appendChild(this.titleNode);this.titleNode.textContent=d.title;if(typeof d.getItemCount==="function")f=document.createElement("div"),f.classList.add("layoutLeft"),
f.classList.add("sectionItemCount"),this.domNode.appendChild(f),f.textContent=d.getItemCount(this);this._progressNode=document.createElement("div");this._progressNode.id=d.id+"Progress";this._progressNode.classList.add("sectionProgress");this._progressNode.classList.add("sectionTitle");this._progressNode.classList.add("layoutLeft");this._progressNode.style.visibility="hidden";this._progressNode.textContent="...";this.domNode.appendChild(this._progressNode);f=document.createElement("div");f.id=d.id+
"FilterSearchBox";this.domNode.appendChild(f);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=d.id+"ToolActionsArea";this._toolActionsNode.classList.add("layoutRight");this._toolActionsNode.classList.add("sectionActions");this.domNode.appendChild(this._toolActionsNode);this.actionsNode=document.createElement("ul");this.actionsNode.id=d.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("commandList");this.actionsNode.classList.add("sectionActions");
this.domNode.appendChild(this.actionsNode);this.selectionNode=document.createElement("ul");this.selectionNode.id=d.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("commandList");this.selectionNode.classList.add("sectionActions");this.domNode.appendChild(this.selectionNode);d.slideout&&(f=c.slideoutHTMLFragment(d.id),g=document.createRange(),g.selectNode(this.domNode),f=g.createContextualFragment(f),this.domNode.appendChild(f));this._contentParent=
document.createElement("div");this._contentParent.id=this.id+"Content";this._contentParent.role="region";this._contentParent.classList.add("sectionTable");this._contentParent.setAttribute("aria-labelledby",this.titleNode.id);a.appendChild(this._contentParent);d.content&&this.setContent(d.content);this.hidden=d.hidden;if(typeof d.onExpandCollapse==="function")this._onExpandCollapse=d.onExpandCollapse;this._preferenceService=d.preferenceService;this._contentParent.style.display="none";this.domNode.classList.add("sectionWrapperClosed");
if(this._preferenceService){var l=this;this._preferenceService.getPreferences("/window/views").then(function(a){a=a.get(l.id);if(a!==void 0)l.hidden=!a;if(!l.hidden)l._contentParent.style.display="block",l.domNode.classList.remove("sectionWrapperClosed");l._updateExpandedState(!l.hidden,!1)})}else{if(!this.hidden)this._contentParent.style.display="block",this.domNode.classList.remove("sectionWrapperClosed");this._updateExpandedState(!this.hidden,!1)}this._commandService=d.commandService;this._lastMonitor=
0;this._loading={}}function e(a){this._section=a;this._id=++a._lastMonitor}d.prototype={setTitle:function(a){this.titleNode.textContent=a},getHeaderElement:function(){return this.domNode},getTitleElement:function(){return this.titleNode},getActionElement:function(){return this._toolActionsNode},setContent:function(a){typeof a==="string"?this._contentParent.innerHTML=a:(this._contentParent.innerHTML="",this._contentParent.appendChild(a))},getContentElement:function(){return this._contentParent},embedExplorer:function(b,
c,d){this._contentParent.innerHTML="";if(!b.parent)b.parent=c;this._contentParent.appendChild(b.parent);b.section=this;a.mixin(b,{createActionSections:function(){this.actionsSections&&this.actionsSections.forEach(function(a){if(!i.node(a)){var b=document.createElement("ul");b.id=a;b.classList.add("commandList");b.classList.add("layoutRight");this.section.actionsNode.appendChild(b)}}.bind(this))},getCommandsVisible:function(){return this.section.actionsNode.style.visibility!=="hidden"},setCommandsVisible:function(a){this.section.actionsNode.style.visibility=
a?"":"hidden";var b=a?null:"cursorOnly";this.renderer.selectionPolicy=b;var c=this.getNavHandler();c&&c.setSelectionPolicy(b);a?this.updateCommands():this.actionsSections&&this.actionsSections.forEach(function(a){i.node(a)&&this.commandRegistry.destroy(a)}.bind(this))},destroy:function(){Object.getPrototypeOf(this).destroy.call(this);var a=this;this.actionsSections&&(this.actionsSections.forEach(function(b){delete a[b]}),delete this.actionsSections)},updateCommands:function(a){this.section.actionsNode&&
this.getCommandsVisible()&&(this.createActionSections(),Object.getPrototypeOf(this).updateCommands.call(this,a))},loaded:function(){var a=this;if(!this.selection&&!d)this.serviceRegistry||this.registry?(this.selection=new l.Selection(this.serviceRegistry||this.registry,this.parent.id+"Selection"),this.selection.addEventListener("selectionChanged",function(b){a.updateCommands(b.selections)})):window.console.error("Could not create a Selection for the explorer because of lack of serviceRegistry");var b=
this.registerCommands();!b||!b.then?a.updateCommands():b.then(function(){a.updateCommands()})}});if(b.renderer)b.renderer.section=this,a.mixin(b.renderer,{getCellHeaderElement:function(a){(a=Object.getPrototypeOf(this).getCellHeaderElement.call(this,a))&&this.section.setTitle(a.innerHTML);return null}})},createProgressMonitor:function(){return new e(this)},_setMonitorMessage:function(a,c){this._progressNode.style.visibility="visible";this._loading[a]=c;var d="",f;for(f in this._loading)d!==""&&(d+=
"\n"),d+=this._loading[f];this._progressNode.title=d},_monitorDone:function(a){delete this._loading[a];var a="",c;for(c in this._loading)a!==""&&(a+="\n"),a+=this._loading[c];this._progressNode.title=a;if(a==="")this._progressNode.style.visibility="hidden"},_changeExpandedState:function(){this.hidden?(this._contentParent.style.display="block",this.domNode.classList.remove("sectionWrapperClosed"),this.hidden=!1):(this._contentParent.style.display="none",this.domNode.classList.add("sectionWrapperClosed"),
this.hidden=!0);this._updateExpandedState(!this.hidden,!0)},_updateExpandedState:function(a,c){var d=this.twistie,f=this.id;d&&(d.classList.add(a?this._expandImageClass:this._collapseImageClass),d.classList.remove(a?this._collapseImageClass:this._expandImageClass));this._preferenceService&&c&&this._preferenceService.getPreferences("/window/views").then(function(c){c.put(f,a)});this._onExpandCollapse&&this._onExpandCollapse(a,this)}};d.prototype.constructor=d;e.prototype={begin:function(a){this.status=
a;this._section._setMonitorMessage(this.id,a)},worked:function(a){this.status=a;this._section._setMonitorMessage(this.id,a)},done:function(a){this.status=a;this._section._monitorDone(this.id)}};e.prototype.constructor=e;return{Section:d}});
define("orion/sites/siteMappingsTable","i18n!orion/sites/nls/messages,orion/commands,orion/explorers/explorer,orion/i18nUtil,orion/Deferred,orion/webui/littlelib,orion/EventTarget".split(","),function(i,k,g,c,a,l,d){function e(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}function b(a){return a.replace(/[\r\n\t]/g,"")}var j={};j.Model=function(){function a(b,c,d){this.rootPath=b;this.fetchItems=c;this.items=d}a.prototype=new g.ExplorerFlatModel;e(a.prototype,{getId:function(a){return a===this.root?
this.rootId:"mapping_"+this.items.indexOf(a)}});return a}();j.Renderer=function(){function a(b,c){this._init(b);this.options=b;this.explorer=c;this.commandService=b.commandService}a.prototype=new g.SelectionRenderer;e(a.prototype,{getCellHeaderElement:function(a){switch(a){case 0:return a=document.createElement("th"),a.textContent=" ",a.classList.add("isValidColumn"),a;case 1:return a=document.createElement("th"),a.textContent=i.Path,a;case 2:return a=document.createElement("th"),a.textContent=i["Mount at (server path)"],
a;case 3:return a=document.createElement("th"),a.textContent=i.Actions,a}},getCellElement:function(a,b,c){var d;switch(a){case 0:return this.getIsValidCell(a,b,c);case 1:return a=document.createElement("td"),c=document.createElement("input"),c.classList.add("pathInput"),c.value=typeof b.FriendlyPath!=="undefined"?b.FriendlyPath:b.Target,d=function(a){this.options.onchange(b,"FriendlyPath",a.target.value,a)}.bind(this),c.onchange=d,c.onkeyup=d,a.appendChild(c),a;case 2:return a=document.createElement("td"),
c=document.createElement("input"),c.classList.add("serverPathInput"),c.value=b.Source,d=function(a){this.options.onchange(b,"Source",a.target.value,a)}.bind(this),c.onchange=d,c.onkeyup=d,a.appendChild(c),a;case 3:return this.getActionsColumn(b,c)}},getIsValidCell:function(a,b){var d=b.Target,e=document.createElement("td"),g,h;if(/^\//.test(d)){var j=this;this.options.siteClient.toFileLocation(d).then(function(a){g=a;var b=document.createElement("span");b.classList.add("validating");l.empty(e);e.appendChild(b);
b.textContent="\u2026";b=j.options.fileClient._getService(a).read(a,!0);j.options.progress&&j.options.progress.progress(b,"Reading metadata of "+a);b.then(function(a){var b=a&&a.Directory,a=b?"core-sprite-folder":"core-sprite-file",b=b?i.WorkspaceFolder:i.WorkspaceFile;h=document.createElement("a");h.href=g;h.target="_new";var d=document.createElement("span");d.className+="imageSprite "+a;d.title=c.formatMessage(b,g);h.appendChild(d);l.empty(e);e.appendChild(h)},function(){h=document.createElement("a");
h.href=g;h.target="_new";var a=document.createElement("span");a.className+="imageSprite core-sprite-error";a.title=c.formatMessage(i.WorkspaceResourceNotFound,g);h.appendChild(a);l.empty(e);e.appendChild(h)})})}else g=d,h=document.createElement("a"),h.href=g,h.target="_new",l.empty(e),d=document.createElement("span"),d.className+="imageSprite core-sprite-link",d.title=c.formatMessage(i.ExternalLinkTo,g),h.appendChild(d),e.appendChild(h);e.classList.add("isValidCell");return e}});return a}();j.MappingsTable=
function(){function c(a){this.registry=a.serviceRegistry;this.commandService=a.commandRegistry;this.registerCommands();this.siteClient=a.siteClient;this.parentId=a.parentId;this.selection=a.selection;this.renderer=new j.Renderer({checkbox:!1,onchange:this.fieldChanged.bind(this),siteConfiguration:a.siteConfiguration,siteClient:a.siteClient,fileClient:a.fileClient,commandService:this.commandService,progress:a.serviceRegistry.getService("orion.page.progress"),actionScopeId:"siteMappingCommand"},this);
this.myTree=null;this._setSiteConfiguration(a.siteConfiguration);this.setDirty(!1)}c.prototype=Object.create(g.Explorer.prototype);d.attach(c.prototype);e(c.prototype,{_setSiteConfiguration:function(a){this.siteConfiguration=a;this.refresh()},refresh:function(){var b=function(){return(new a).resolve(this.siteConfiguration.Mappings)}.bind(this),c=this;this.siteClient.updateMappingsDisplayStrings(this.siteConfiguration).then(function(a){c.siteConfiguration.Mappings=a.Mappings;c.createTree(c.parentId,
new j.Model(null,b,c.siteConfiguration.Mappings))})},render:function(){this.changedItem(this.siteConfiguration.Mappings,this.siteConfiguration.Mappings)},renderItemRow:function(a,b){if(b==="FriendlyPath"){var c=document.getElementById(this.myTree._treeModel.getId(a)),d=l.$(".isValidCell",c),c=this.renderer.getIsValidCell(l.$$array("td",c).indexOf(d),a,c);d.parentNode.replaceChild(c,d)}},registerCommands:function(){this.commandService.addCommand(new k.Command({name:i.Delete,imageClass:"core-sprite-delete",
id:"orion.site.mappings.remove",visibleWhen:function(a){return"Source"in a||"Target"in a||"FriendlyPath"in a},callback:function(a){this.deleteMapping(a.items);this.render();this.setDirty(!0)}.bind(this)}));this.commandService.registerCommandContribution("siteMappingCommand","orion.site.mappings.remove",0);this.commandService.addCommand(new k.Command({name:i["Move Up"],imageClass:"core-sprite-move-up",id:"orion.site.mappings.moveUp",visibleWhen:function(a){return"Source"in a||"Target"in a||"FriendlyPath"in
a}.bind(this),callback:function(a){var b=this.getItemIndex(a.items);if(b!==0){var c=this.siteConfiguration.Mappings[b-1];this.siteConfiguration.Mappings[b-1]=a.items;this.siteConfiguration.Mappings[b]=c;this.render();this.setDirty(!0)}}.bind(this)}));this.commandService.registerCommandContribution("siteMappingCommand","orion.site.mappings.moveUp",1);this.commandService.addCommand(new k.Command({name:i["Move Down"],imageClass:"core-sprite-move-down",id:"orion.site.mappings.moveDown",visibleWhen:function(a){return"Source"in
a||"Target"in a||"FriendlyPath"in a}.bind(this),callback:function(a){var b=this.getItemIndex(a.items);if(b!==this.siteConfiguration.Mappings.length-1){var c=this.siteConfiguration.Mappings[b+1];this.siteConfiguration.Mappings[b+1]=a.items;this.siteConfiguration.Mappings[b]=c;this.render();this.setDirty(!0)}}.bind(this)}));this.commandService.registerCommandContribution("siteMappingCommand","orion.site.mappings.moveDown",2)},getItemIndex:function(a){return this.siteConfiguration.Mappings.indexOf(a)},
_addMapping:function(a){var c=a.Source,d=a.Target,e=a.FriendlyPath;a.Source=b(typeof c==="string"?c:this.getNextMountPoint(e));a.Target=b(typeof d==="string"?d:"/");this.mappingExists(c,d)||this.siteConfiguration.Mappings.push(a)},addMapping:function(a){this._addMapping(a);this.render();this.setDirty(!0)},addMappings:function(a){for(var b=0;b<a.length;b++)this.addMapping(a[b]);this.render();this.setDirty(!0)},mappingExists:function(a,b){if(typeof a==="object"&&typeof b==="undefined")b=a.Target,a=
a.Source;for(var c=this.siteConfiguration.Mappings,d=0;d<c.length;d++)if(c[d].Source===a&&c[d].Target===b)return!0;return!1},getNextMountPoint:function(a){for(var b=this.siteConfiguration.Mappings,c=!1,d=0;d<b.length;d++)if(b[d].Source==="/"){c=!0;break}if(!c)return"/";if(!a)return"/web/somePath";a=a.split("/");for(d=a.length-1;d>=0;d--)if(!/\s+/.test(a[d]))return"/"+a[d];return"/web/somePath"},deleteMapping:function(a){a=this.siteConfiguration.Mappings.indexOf(a);a!==-1&&this.siteConfiguration.Mappings.splice(a,
1)},deleteAllMappings:function(){this.siteConfiguration.Mappings.splice(0,this.siteConfiguration.Mappings.length)},fieldChanged:function(a,c,d){d=b(d);if(a[c]!==d&&(a[c]=d,c==="FriendlyPath")){var e=d,g=this;this.siteClient.parseInternalForm(this.siteConfiguration,e).then(function(b){a.Target=b||e;g.renderItemRow(a,c);g.setDirty(!0)})}},setDirty:function(a){this._isDirty=a;this.dispatchEvent({type:"dirty",value:a})},isDirty:function(){return this._isDirty}});return c}();return j});
define("orion/explorers/explorer-table","i18n!orion/navigate/nls/messages,orion/Deferred,orion/webui/littlelib,orion/i18nUtil,orion/fileUtils,orion/explorers/explorer,orion/EventTarget,orion/objects,orion/util".split(","),function(i,k,g,c,a,l,d,e,b){function j(a,b,c,d,e,f){this.registry=a;this.root=b;this.fileClient=c;this.idPrefix=d||"";this.excludeFiles=!!e;this.excludeFolders=!!f}function h(a){d.attach(this);this.registry=a.serviceRegistry;this.treeRoot=a.treeRoot;this.selection=a.selection;this.fileClient=
a.fileClient;this.excludeFiles=a.excludeFiles;this.excludeFolders=a.excludeFolders;this.navHandlerFactory=a.navHandlerFactory;this.parentId=a.parentId;this.renderer=a.rendererFactory(this);this.dragAndDrop=a.dragAndDrop;this.setFocus=a.setFocus;this.myTree=this.model=null;this._hookedDrag=this.checkbox=!1;var b=a.modelEventDispatcher?a.modelEventDispatcher:new d;this.modelEventDispatcher=b;var c=this;this._modelListeners={};"copy,copyMultiple,create,delete,deleteMultiple,import,move,moveMultiple".split(",").forEach(function(a){b.addEventListener(a,
c._modelListeners[a]=c.modelHandler[a].bind(c))});this._clickListener=function(a){if(a.target.tagName==="A"){for(a=a.target;a;){if(a._item)break;a=a.parentNode}if(a&&a._item)c.onLinkClick({type:"linkClick",item:a._item})}};(a=g.node(this.parentId))&&a.addEventListener("click",this._clickListener);var e=this.renderer;this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(a){a=a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?"_blank":"_self":"_self";e.setTarget&&
e.setTarget(a)}},{pid:"nav.config"})}j.prototype=new l.ExplorerModel;e.mixin(j.prototype,{getRoot:function(a){a(this.root)},processParent:function(a,b){var c=a.Projects?[]:[a].concat(a.Parents||[]);if(this.excludeFiles||this.excludeFolders){var d=[],e;for(e in b)if(!(b[e].Directory?this.excludeFolders:this.excludeFiles))if(d.push(b[e]),b[e].parent=a,!b[e].Parents)b[e].Parents=c;b=d}else for(d in b)if(b[d].parent=a,!b[d].Parents)b[d].Parents=c;a.children=b;a.children.sort(function(a,b){var c=a.Directory;
if(c!==b.Directory)return c?-1:1;var c=a.Name&&a.Name.toLowerCase(),d=b.Name&&b.Name.toLowerCase();return c<d?-1:c>d?1:0});return b},getChildren:function(a,b){var c=this;if(a.children)b(a.children);else if(a.Directory!==void 0&&a.Directory===!1)b([]);else if(a.Children)b(c.processParent(a,a.Children));else if(a.Location){var d=null;this.registry&&(d=this.registry.getService("orion.page.progress"));(d?d.progress(this.fileClient.fetchChildren(a.ChildrenLocation),i["Fetching children of "]+a.Name):this.fileClient.fetchChildren(a.ChildrenLocation)).then(function(d){c.destroyed||
b(c.processParent(a,d))},function(){b([])})}else b([])},hasChildren:function(){var a=!1;this.root.Children&&(a=this.root.Children.length>0);return a}});j.prototype.constructor=j;var f,m;h.prototype=Object.create(l.Explorer.prototype);e.mixin(h.prototype,{destroy:function(){var a=this;Object.keys(this._modelListeners).forEach(function(b){a.modelEventDispatcher.removeEventListener(b,a._modelListeners[b])});var b=g.node(this.parentId);b&&b.removeEventListener("click",this._clickListener);l.Explorer.prototype.destroy.call(this)},
onLinkClick:function(a){this.dispatchEvent(a)},onModelCreate:function(a){return this.changedItem(a.parent,!0)},onModelCopy:function(a){var b=this,c={};(a.items||[a]).forEach(function(a){var n;n=(a=a.parent)||b.treeRoot,a=n;c[a.Location]=a});return k.all(Object.keys(c).map(function(a){return b.changedItem(c[a],!0)}))},onModelMove:function(a){var b=this,c={};(a.items||[a]).forEach(function(a){var d=b.treeRoot;if((d.Location||d.ContentLocation)===a.oldValue.Location){var e=b.treeRoot,a=a.newValue,a=
a.ChildrenLocation?a:this.fileClient.read(a.ContentLocation,!0);return k.when(a,function(a){b.dispatchEvent({type:"rootMoved",oldValue:e,newValue:a});b.loadResourceList(a)})}d=(d=a.oldValue.parent)||b.treeRoot;c[d.Location]=d;d=(d=a.parent)||b.treeRoot;c[d.Location]=d;if(a.oldValue.Directory&&a.newValue&&b.isExpanded(a.oldValue))c[a.newValue.Location]=a.newValue});return k.all(Object.keys(c).map(function(a){return b.changedItem(c[a],!0)}))},onModelDelete:function(a){var a=a.items||[a],b=this,c=b.treeRoot,
d;if(a.some(function(a){if(a.oldValue.Location===(c.Location||c.ContentLocation)){if(a.oldValue.Location!==(a.parent.Location||a.parent.ContentLocation))d=a.parent;return!0}return!1}))return this.loadResourceList(d);else{var e={};a.forEach(function(a){a=a.parent;e[a.Location]=a});return k.all(Object.keys(e).map(function(a){return b.changedItem(e[a],!0)}))}},modelHandler:{copy:function(a){return a.count?void 0:this.onModelCopy(a)},copyMultiple:function(a){return this.onModelCopy(a)},create:function(a){return this.onModelCreate(a)},
"delete":function(a){return a.count?void 0:this.onModelDelete(a)},deleteMultiple:function(a){return this.onModelDelete(a)},"import":function(a){return this.changedItem(a.target,!0)},move:function(a){return a.count?void 0:this.onModelMove(a)},moveMultiple:function(a){return this.onModelMove(a)}},_makeDropTarget:function(d,e,h){if(this.dragAndDrop){var j=this,k=this.dragAndDrop,l=function(a){f=a.target};if(h)this._oldDragStart&&e.removeEventListener("dragstart",this._oldDragStart,!1),this._oldDragStart=
l;e.addEventListener("dragstart",l,!1);l=function(){f=null};if(h)this._oldDragEnd&&e.removeEventListener("dragend",this._oldDragEnd,!1),this._oldDragEnd=l;e.addEventListener("dragend",l,!1);l=function(a){e.classList.remove("dragOver");a.preventDefault();a.stopPropagation()};if(h)this._oldDragLeave&&e.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=l;e.addEventListener("dragleave",l,!1);l=function(a){if(f)m=a.dataTransfer.dropEffect=(b.isMac?a.altKey:a.ctrlKey)?"copy":"move";
else if(!b.isIE&&(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0))a.dataTransfer.dropEffect="copy";e.classList.add("dragOver");g.stop(a)};if(h)this._oldDragEnter&&e.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=l;e.addEventListener("dragenter",l,!1);l=function(a){if(f)m=a.dataTransfer.dropEffect=(b.isMac?a.altKey:a.ctrlKey)?"copy":"move";else if(!b.isIE&&(a.dataTransfer.effectAllowed===
"all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0))a.dataTransfer.dropEffect="copy";g.stop(a)};if(h&&!this._oldDragOver)e.addEventListener("dragover",l,!1),this._oldDragOver=l;var s=null;j.registry&&(s=j.registry.getService("orion.page.progress"));var y=function(a){s?s.setProgressResult(a):window.console.log(a)},t=function(b,e,f,g,h,j){if(!f.Location&&f.fileMetadata)f=f.fileMetadata;e=e||"";if(b.isFile)a.isAtRoot(f.Location)?g.registry&&g.registry.getService("orion.page.message").setProgressResult({Severity:"Error",
Message:i["You cannot copy files directly into the workspace.  Create a folder first."]}):b.file(function(a){h(f,a,g,a.name.indexOf(".zip")===a.name.length-4&&window.confirm(c.formatMessage(i["Unzip ${0}?"],a.name)))});else if(b.isDirectory){var k=b.createReader(),l=function(a){k.readEntries(function(c){for(var d=0;d<c.length;d++)t(c[d],e+b.name+"/",a,g,h,j)})};a.isAtRoot(f.Location)?(s?s.progress(j.createProject(f.ChildrenLocation,b.name),c.formatMessage(i["Creating ${0}"],b.name)):j.createProject(f.ChildrenLocation,
b.name)).then(function(a){g.loadResourceList(g.treeRoot.Path,!0);(s?s.progress(j.read(a.ContentLocation,!0),i["Loading "]+a.name):j.read(a.ContentLocation,!0)).then(function(a){l(a)},y)},y):(s?s.progress(j.createFolder(f.Location,b.name),c.formatMessage(i["Creating ${0}"],b.name)):j.createFolder(f.Location,b.name)).then(function(a){g.modelEventDispatcher.dispatchEvent({type:"create",parent:d,newValue:a});l(a)},y)}},l=function(b){var h;e.classList.remove("dragOver");if(f){h=j.fileClient;for(var l=
f,p;l;){if(l._item){p=l._item;break}l=l.parentNode}if(!p)return;var w=m==="copy",l=w?h.copyFile:h.moveFile;(s?s.showWhile(l.apply(h,[p.Location,d.Location]),c.formatMessage(i[w?"Copying ${0}":"Moving ${0}"],p.Location)):l.apply(h,[p.Location,d.Location])).then(function(a){j.modelEventDispatcher.dispatchEvent({type:w?"copy":"move",oldValue:p,newValue:a,parent:d})},y)}else if(b.dataTransfer.items&&b.dataTransfer.items.length>0)for(h=0;h<b.dataTransfer.items.length;h++)l=null,typeof b.dataTransfer.items[h].getAsEntry===
"function"?l=b.dataTransfer.items[h].getAsEntry():typeof b.dataTransfer.items[h].webkitGetAsEntry==="function"&&(l=b.dataTransfer.items[h].webkitGetAsEntry()),l&&t(l,null,d,j,k,j.fileClient);else if(b.dataTransfer.files&&b.dataTransfer.files.length>0)for(h=0;h<b.dataTransfer.files.length;h++)l=b.dataTransfer.files[h],!l.size&&!l.type?j.registry&&j.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:c.formatMessage(i["Did not drop ${0}.  Folder drop is not supported in this browser."],
l.name)}):a.isAtRoot(d.Location)?j.registry&&j.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:i["You cannot copy files directly into the workspace.  Create a folder first."]}):k(d,l,j,l.name.indexOf(".zip")===l.name.length-4&&window.confirm(c.formatMessage(i["Unzip ${0}?"],l.name)));g.stop(b)};if(h)this._oldDrop&&e.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=l;e.addEventListener("drop",l,!1)}},createModel:function(){return new j(this.registry,
this.treeRoot,this.fileClient,this.parentId,this.excludeFiles,this.excludeFolders)},changedItem:function(a,b){if(this.treeRoot&&this.treeRoot.Location===a.Location)return this.loadResourceList(this.treeRoot,b);var c=this,d=new k;a.children=a.Children=null;this.model.getChildren(a,function(e){c.getNavHandler();c.myTree.refresh.bind(c.myTree)(a,e,b);d.resolve(e)});return d},showItem:function(a,b){var c=new k;if(!a||!this.model||!this.myTree||!this.myTree.showRoot&&a.Location===this.treeRoot.Location)return c.reject();
var d=this.getRow(a);if(d)c.resolve(d._item||a);else return a.Parents&&a.Parents.length>0?(a.Parents[0].Parents=a.Parents.slice(1),this.expandItem(a.Parents[0],b).then(function(b){var c=this.getRow(a);return!c?this.changedItem(b,!0).then(function(){var b=this.getRow(a);return b?b._item:(new k).reject()}.bind(this)):c._item||a}.bind(this))):b===void 0||b?this.reroot(a):c.reject();return c},expandItem:function(a,b){var c=new k;this.showItem(a,b).then(function(a){this.myTree.isExpanded(a)?c.resolve(a):
this.myTree.expand(this.model.getId(a),function(){c.resolve(a)})}.bind(this),c.reject);return c},reveal:function(a,b){return this.showItem(a,b).then(function(a){var b=this.getNavHandler();b&&(b.cursorOn(a,!0),b.setSelection(a));return a}.bind(this))},reroot:function(){return(new k).reject()},isExpanded:function(a){return this.renderer.tableTree.isExpanded(this.model.getId(a))},getNameNode:function(a){if(a=this.model.getId(a))return g.node(a+"NameLink")},scopeUp:function(){},scopeDown:function(){},
loadResourceList:function(b,c,d){b&&typeof b==="object"&&(b=b.ChildrenLocation||b.ContentLocation);b=a.makeRelative(b);if(!c&&b===this._lastPath)return(new k).resolve(this.treeRoot);this._lastPath=b;var e=this;return c||b!==this.treeRoot.Path?this.load(this.fileClient.loadWorkspace(b),i["Loading "]+b).then(function(){e.treeRoot.Path=b;typeof d==="function"&&d();e.dispatchEvent({type:"rootChanged",root:e.treeRoot});return(new k).resolve(e.treeRoot)},function(a){e.treeRoot.Path=null;e.dispatchEvent({type:"rootChanged",
root:e.treeRoot});return(new k).reject(a)}):(new k).resolve(e.treeRoot)},load:function(a,b,c){var d=g.node(this.parentId),e=g.node("progress");if(!e)e=document.createElement("div"),e.id="progress",g.empty(d),d.appendChild(e);g.empty(e);var f=setTimeout(function(){g.empty(e);e.appendChild(document.createTextNode(b))},500),h=this;return k.when(a,function(a){clearTimeout(f);if(!h.destroyed){h.treeRoot={};for(var b in a)h.treeRoot[b]=a[b];h.model=h.createModel();if(h.dragAndDrop)h._hookedDrag?h._makeDropTarget(h.treeRoot,
d,!0):(a=(a=d&&("draggable"in d||"ondragstart"in d&&"ondrop"in d))&&!(!window.File||!window.FileList||!window.FileReader),h._hookedDrag=!0,a?h._makeDropTarget(h.treeRoot,d,!0):(h.dragAndDrop=null,window.console.log("Local file drag and drop is not supported in this browser.")));var e=new k;h.createTree(h.parentId,h.model,{onComplete:function(a){e.resolve(a)},navHandlerFactory:h.navHandlerFactory,setFocus:typeof h.setFocus==="undefined"?!0:h.setFocus,selectionPolicy:h.renderer.selectionPolicy,onCollapse:function(a){if(h.getNavHandler())h.getNavHandler().onCollapse(a)}});
return e.then(function(){if(typeof c==="function")try{c()}catch(a){h.registry&&h.registry.getService("orion.page.message").setErrorMessage(a)}if(typeof h.onchange==="function")h.onchange(h.treeRoot);return h.treeRoot})}},function(a){clearTimeout(f);h.registry&&h.registry.getService("orion.page.message").setProgressResult(a);return(new k).reject(a)})},onchange:function(){}});h.prototype.constructor=h;return{FileExplorer:h,FileModel:j}});
define("orion/webui/dialogs/DirectoryPrompterDialog","i18n!orion/widgets/nls/messages,orion/webui/littlelib,orion/webui/dialog,orion/fileUtils,orion/selection,orion/explorers/navigationUtils,orion/explorers/explorer,orion/explorers/explorer-table".split(","),function(i,k,g,c,a,l,d,e){function b(a,b){this.explorer=b;this._init(a)}function j(a){this._init(a)}b.prototype=new d.SelectionRenderer;b.prototype.constructor=b;b.prototype.getLabelColumnIndex=function(){return 0};b.prototype.getCellElement=
function(a,b,c){a=document.createElement("td");c.appendChild(a);var d=document.createElement("span");d.id=c.id+"navSpan";a.appendChild(d);d.className="mainNavColumn singleNavColumn";this.getExpandImage(c,d);d.appendChild(document.createTextNode(b.Name))};j.prototype=new g.Dialog;j.prototype.TEMPLATE='<div id="message" style="width: 25em; padding-bottom: 5px;"></div><div id="directoryTree" class="explorerTreeClass" style="width:25em; min-height: 25em; max-height:30em; height: auto; overflow-y: auto;"></div>';
j.prototype._init=function(a){this.title=a.title||i["Choose a Folder"];this.modal=!0;this.buttons=[{text:i.OK,isDefault:!0,callback:this.done.bind(this)}];this.customFocus=!0;this._fileClient=a.fileClient;this._serviceRegistry=a.serviceRegistry;this._message=a.message||"";this._func=a.func;this._initialize()};j.prototype._bindToDom=function(){this.loadFolderList("/");this._message?this.$message.appendChild(document.createTextNode(this._message)):this.$message.style.display="none";this.$directoryTree.focus()};
j.prototype.loadFolderList=function(d){d=c.makeRelative(d);this.selection=new a.Selection(this._serviceRegistry,"orion.directoryPrompter.selection");this.explorer=new e.FileExplorer({treeRoot:{children:[]},selection:this.selection,serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,parentId:"directoryTree",excludeFiles:!0,rendererFactory:function(a){return new b({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"},a)}});this.explorer.loadResourceList(d,!0,null)};j.prototype.done=
function(){this.selection.getSelection(function(a){this.hide();this._func(a)}.bind(this))};j.prototype.constructor=j;return{DirectoryPrompterDialog:j}});define("text!orion/sites/templates/SiteEditor.html",[],function(){return'<div class="siteEditor">\n\t<div class="sectionTable" role="region">\n\t\t<form id="siteForm" class="siteForm sectionTableItem">\n\t\t\t<div class="siteEditorTable">\n\t\t\t\t<div>\n\t\t\t\t\t<div class="header">\n\t\t\t\t\t\t<label class="siteConfigNameLabel">${Name:}</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="cell">\n\t\t\t\t\t\t<input class="siteConfigName" required="required" pattern="\\s*\\S+\\s*" value="">\n\t\t\t\t\t\t<div class="nameInvalid">${Not a valid name}</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div>\n\t\t\t\t\t<div class="header">\n\t\t\t\t\t\t<label class="hostHintLabel">${Hostname hint:}</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="cell">\n\t\t\t\t\t\t<input class="hostHint" required="required" pattern="^(?:\\s*|[A-Za-z0-9-_]+)$" value="">\n\t\t\t\t\t\t<em>${Optional; used to determine the URL where a started site can be accessed.}</em>\n\t\t\t\t\t\t<div class="hostInvalid">${Not a valid hostname}</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div>\n\t\t\t\t\t<div class="header">\n\t\t\t\t\t\t<label class="hostingStatusLabel">${Status:}</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="cell hostingStatusArea">\n\t\t\t\t\t\t<span class="hostingStatus"></span>\n\t\t\t\t\t\t<span class="siteStartedWarning">\n\t\t\t\t\t\t\t<em>${Changes you make here won\'t affect the running site.}</em>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</form>\n\t</div>\n\n\t<div class="siteEditorTable">\n\t\t<div class="mappingsGridTable"></div>\n\n\t\t<div class="convertToolbar"></div>\n\t</div>\n\n</div>'});
define("text!orion/sites/templates/ConvertToSelfHostingDialog.html",[],function(){return'<div>\n\t<style>\n\t.form {\n\t\twidth: auto;\n\t\tlist-style-type: none; \n\t\tpadding: 0; \n\t\tmargin: 0;\n\t\t-webkit-padding-start: 0;\n\t\t-webkit-margin-before: 0;\n\t}\n\t.form li {\n\t\tmargin: 0;\n\t}\n\t.msg {\n\t\tclear: both;\n\t\twidth: 25em;\n\t}\n\t.pad1 { padding: 8px 0 0 0; }\n\t.pad2 { padding: 20px 0 0 0; }\n\t.browseButton { margin: 0 5px 0 5px; }\n\t.folderName {\n\t\tfont-weight: bold;\n\t}\n\t.field {\n\t\tfloat: left;\n\t\twidth: 6em;\n\t}\n\t.col { float: left; }\n\t.okButton {\n\t\tfloat: right;\n\t\tclear: both;\n\t}\n\t</style>\n\t<div>\n\t\t<ul class="form">\n\t\t\t<li class="msg" id="selectRequired">\n\t\t\t\t<div>${LabelSelectRequired}</div>\n\t\t\t</li>\n\n\t\t\t<\!-- Elements are dynamically added here for each required folder. Each folder follows this pattern: --\>\n\t\t\t<\!--\n\t\t\t<li class="msg pad2"><div class="col">orion.client - Orion client repository:</div></li>\n\t\t\t<li class="pad1">\n\t\t\t\t<div class="col">\n\t\t\t\t\t<button class="browseButton commandButton" type="button">Browse...</button>\n\t\t\t\t\t<span class="folderText">impress.js</span>\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t\t--\>\n\t\t</ul>\n\t</div>\n</div>'});
define("orion/sites/SiteEditor","i18n!orion/sites/nls/messages,i18n!orion/widgets/nls/messages,orion/commands,orion/Deferred,orion/section,orion/objects,orion/sites/siteMappingsTable,orion/i18nUtil,orion/webui/littlelib,orion/EventTarget,orion/webui/dialogs/DirectoryPrompterDialog,orion/webui/dialog,text!orion/sites/templates/SiteEditor.html,text!orion/sites/templates/ConvertToSelfHostingDialog.html".split(","),function(i,k,g,c,a,l,d,e,b,j,h,f,m,n){var q=function(a){this.options=a=a||{};l.mixin(this,
a);this._init(a)};q.prototype=new f.Dialog;l.mixin(q.prototype,{TEMPLATE:n,_init:function(a){this.title=a.title||i["Convert to Self-Hosting"];this.buttons=[{text:i.OK,callback:this.okButtonClicked.bind(this)}];this.modal=!0;this.folders=this.selfHostingConfig.folders;this.messages={};l.mixin(this.messages,i);this.messages.LabelSelectRequired=this.folders.length===1?i.SelectRequiredFoldersSingle:i.SelectRequiredFolders;this._initialize()},_bindToDom:function(){this.$okButton=this.$buttonContainer.firstChild;
this.$okButton.classList.add("disabled");this.browseButtons=[];this.folderTexts=[];this.appendFolderElements();this.updateValidity()},appendFolderElements:function(){var a=this,c=document.createDocumentFragment();this.folders.forEach(function(d,e){var f=document.createElement("li");f.className="msg pad2";var g=document.createElement("div");g.textContent=i.FolderPrompt;var h=document.createElement("span");h.className="folderName";h.textContent=d.name;b.processDOMNodes(g,[h,document.createTextNode(d.label)]);
f.appendChild(g);c.appendChild(f);f=document.createElement("li");f.className="pad1";g=document.createElement("div");g.className="col";h=document.createElement("button");h.className="browseButton commandButton";h.textContent=k["Browse..."];h.type="button";var j=document.createElement("span");j.className="folderText";g.appendChild(h);g.appendChild(j);f.appendChild(g);a.browseButtons.push(h);a.folderTexts.push(j);c.appendChild(f);h.addEventListener("click",a.showChooseFolderDialog.bind(a,e))});a.$selectRequired.parentNode.appendChild(c,
null)},showChooseFolderDialog:function(a){a=new h.DirectoryPrompterDialog({title:e.formatMessage(i.LocateFolderTitle,this.folders[a].name),serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,func:this.onFolderChosen.bind(this,a)});this._addChildDialog(a);a.show()},onFolderChosen:function(a,b){this.folders[a].folder=b;this.folderTexts[a].textContent=b?b.Name:"";this.updateValidity()},isValid:function(){return this.folders.every(function(a){return a.folder})},updateValidity:function(){this.isValid()?
this.$okButton.classList.remove("disabled"):this.$okButton.classList.add("disabled")},okButtonClicked:function(){this.isValid()&&(this.hide(),typeof this.options.func==="function"&&this.options.func(this.folders))}});var p="/",f=function(a,b){a=a||{};l.mixin(this,a);this.options=a;this.checkOptions(this.options,"serviceRegistry,fileClient,siteClient,commandService,statusService,progressService".split(","));this._fileClient=this.options.fileClient;this._siteClient=this.options.siteClient;this._commandService=
this.options.commandService;this._statusService=this.options.statusService;this._progressService=this.options.progressService;this._commandsContainer=this.options.commandsContainer;this.options.location&&this.load(this.options.location);this.node=b||document.createElement("div")};j.attach(f.prototype);l.mixin(f.prototype,{_siteConfiguration:null,_modelListeners:null,mappings:null,_mappingProposals:null,_isSelfHostingSite:!1,_isDirty:!1,_autoSaveTimer:null,show:function(){this.createElements();this.postCreate()},
createElements:function(){this.node.innerHTML=m;b.processTextNodes(this.node,i);this.siteForm=b.$(".siteForm",this.node);this.name=b.$(".siteConfigName",this.node);this.name.id=this.id+"_name";this.nameInvalid=b.$(".nameInvalid",this.node);this.hostHint=b.$(".hostHint",this.node);this.hostHint.id=this.id+"_hostHint";this.hostInvalid=b.$(".hostInvalid",this.node);this.hostingStatus=b.$(".hostingStatus",this.node);this.siteStartedWarning=b.$(".siteStartedWarning",this.node);this.mappingsPlaceholder=
b.$(".mappingsGridTable");this.mappingsPlaceholder.id=this.id+"_mappingsPlaceholder";this.convertToolbar=b.$(".convertToolbar");this.convertToolbar.id=this.id+"_convertToolbar";b.$(".siteConfigNameLabel",this.node).htmlFor=name.id;b.$(".hostHintLabel",this.node).htmlFor=this.hostHint.id},postCreate:function(){var a=this;this.name.addEventListener("input",function(){a.name.checkValidity()?(a.name.classList.remove("invalid"),a.nameInvalid.classList.remove("visible")):(a.name.classList.add("invalid"),
a.nameInvalid.classList.add("visible"))});this.hostHint.addEventListener("change",function(){a.hostHint.checkValidity()?(a.hostHint.classList.remove("invalid"),a.hostInvalid.classList.remove("visible")):(a.hostHint.classList.add("invalid"),a.hostInvalid.classList.add("visible"))});var b=this;c.when(this.siteClient._canSelfHost(),function(a){var c=new g.Command({name:i["Convert to Self-Hosting"],tooltip:i["Enable the site configuration to launch an Orion server running your local client code"],imageClass:"core-sprite-add",
id:"orion.site.convert",visibleWhen:function(c){return!!c.Location&&a&&!b._isSelfHostingSite},callback:b.convertToSelfHostedSite.bind(b)});b._commandService.addCommand(c)});this._autoSaveTimer=setTimeout(this.autoSave.bind(this),8E3)},checkOptions:function(a,b){for(var c=0;c<b.length;c++)if(typeof a[b[c]]==="undefined")throw Error("options."+b[c]+" is required");},_makeAddMenuChoices:function(a,b){function c(a){if(!d.getSiteConfiguration().Mappings.some(function(a){return a.Source===p}))a.Source=
p;d.mappings.addMapping(a)}var b=Array.isArray(b)?b[0]:b,a=a.sort(function(a,b){return a.FriendlyPath.toLowerCase().localeCompare(b.FriendlyPath.toLowerCase())}),d=this,e=function(){c(this.mapping)},f=a.map(function(a){return{name:a.FriendlyPath,imageClass:"core-sprite-folder",mapping:a,callback:e}});a.length>0&&f.push({});f.push({name:i["Choose folder..."],imageClass:"core-sprite-folder",callback:function(){(new h.DirectoryPrompterDialog({serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,
func:function(a){a&&this._siteClient.getMappingObject(this.getSiteConfiguration(),a.Location,a.Name).then(function(a){e.call({mapping:a})})}.bind(this)})).show()}.bind(this)});f.push({name:i.URL,imageClass:"core-sprite-link",callback:function(){c({Source:"/web/somePath",Target:"http://",FriendlyPath:"http://"})}});return f},convertToSelfHostedSite:function(){var a=this._siteClient.getSelfHostingConfig(),b=[];a.folders.forEach(function(a){a.nls&&b.push(e.getMessageBundle(a.nls).then(function(b){a.label=
b[a.labelKey]||a.label||a.labelKey}))});c.all(b,function(a){return a}).then(function(){var b=this;(new q({serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,siteClient:this._siteClient,selfHostingConfig:a,func:function(a){a=a.map(function(a){return a.folder.Location});b._siteClient.convertToSelfHosting(b.getSiteConfiguration(),a).then(function(a){b.mappings.deleteAllMappings();b.mappings.addMappings(a.Mappings);b.save()})}})).show()}.bind(this))},load:function(a){var b=new c;this._busyWhile(b,
"Loading...");this._siteClient.loadSiteConfiguration(a).then(function(a){this._setSiteConfiguration(a);this.setDirty(!1);b.resolve(a)}.bind(this),function(a){b.reject(a)});return b},_setSiteConfiguration:function(a){this._detachListeners();this._siteConfiguration=a;if(!this._mappingProposals){var b=this._commandService;this._mappingProposals=this._siteClient.getMappingProposals(a).then(function(a){a=new g.Command({name:i.Add,tooltip:i["Add a directory mapping to the site configuration"],id:"orion.site.mappings.add",
visibleWhen:function(){return!0},choiceCallback:this._makeAddMenuChoices.bind(this,a)});b.addCommand(a);a=this.titleWrapper.actionsNode;b.registerCommandContribution(a.id,"orion.site.mappings.add",1);b.renderCommands(a.id,a,this.mappings,this,"button")}.bind(this))}this._refreshCommands();this._refreshFields()},setDirty:function(a){this._isDirty=a;this.dispatchEvent({type:"dirty",value:a})},isDirty:function(){return this._isDirty},_refreshCommands:function(){function a(b){c._onError(b)}function b(a){c._setSiteConfiguration(a);
c.setDirty(!1)}var c=this;this._siteClient.isSelfHostingSite(this.getSiteConfiguration()).then(function(d){c._isSelfHostingSite=d;c._commandService.destroy(c._commandsContainer);c._commandService.renderCommands(c._commandsContainer.id,c._commandsContainer,c._siteConfiguration,{},"button",{site:c._siteConfiguration,startCallback:b,stopCallback:b,errorCallback:a})})},_refreshFields:function(){this.name.setAttribute("value",this._siteConfiguration.Name);this.hostHint.setAttribute("value",this._siteConfiguration.HostHint);
this.mappings?this.mappings._setSiteConfiguration(this._siteConfiguration):(this.titleWrapper=new a.Section(document.getElementById(this.mappingsPlaceholder.id),{id:"workingDirectorySection",title:i.Mappings,content:'<div id="mappingsNode"/>',canHide:!0}),this.mappings=new d.MappingsTable({serviceRegistry:this.serviceRegistry,siteClient:this._siteClient,fileClient:this._fileClient,commandRegistry:this._commandService,selection:null,parentId:"mappingsNode",siteConfiguration:this._siteConfiguration}));
var c=this._siteConfiguration.HostingStatus;if(c&&c.Status==="started"){this.siteStartedWarning.style.display="block";this.hostingStatus.textContent=i.Started;var e=document.createElement("a");e.href=c.URL;e.target="_new";e.textContent=c.URL;b.processDOMNodes(this.hostingStatus,[e])}else if(c&&c.Status==="stopped")this.siteStartedWarning.style.display="none",this.hostingStatus.textContent=i.Stopped;setTimeout(function(){this._attachListeners(this._siteConfiguration)}.bind(this),0)},_attachListeners:function(a){function b(d,
e){function f(){var b=d.value,g=a[e];a[e]=b;c.setDirty(g!==b||c.isDirty())}d.addEventListener("input",f);c._modelListeners.push({target:d,type:"input",listener:f})}this._detachListeners();this._modelListeners=this._modelListeners||[];var c=this;b(this.name,i.Name);b(this.hostHint,i.HostHint);var d=function(a){c.setDirty(a.value)};this.mappings.addEventListener("dirty",d);this._modelListeners.push({target:this.mappings,type:"dirty",listener:d})},_detachListeners:function(){if(this._modelListeners){for(var a=
0;a<this._modelListeners.length;a++){var b=this._modelListeners[a];b.target.removeEventListener(b.type,b.listener)}this._modelListeners.splice(0)}},getSiteConfiguration:function(){return this._siteConfiguration},getResource:function(){return this._siteConfiguration&&this._siteConfiguration.Location},save:function(a){var a=typeof a==="undefined"?!0:a,b=this._siteConfiguration,c=b.HostingStatus;delete b.HostingStatus;var d=this;this._busyWhile(this._siteClient.updateSiteConfiguration(b.Location,b).then(function(e){d.setDirty(!1);
return a?(d._setSiteConfiguration(e),e):(b.HostingStatus=c,d._refreshCommands(),b)}));return!0},autoSave:function(){this.isDirty()&&this.save(!1);setTimeout(this.autoSave.bind(this),8E3)},_busyWhile:function(a,b){a.then(this._onSuccess.bind(this),this._onError.bind(this));this.progressService.showWhile(a,b)},_onSuccess:function(a){this.onSuccess(a)},_onError:function(a){this._statusService.setErrorMessage(a);this.onError(a)},onSuccess:function(a){this.dispatchEvent({type:"success",deferred:a})},onError:function(a){this.dispatchEvent({type:"error",
deferred:a})}});return f});
define('built-site.js',"require,i18n!orion/sites/nls/messages,orion/bootstrap,orion/status,orion/progress,orion/commandRegistry,orion/fileClient,orion/operationsClient,orion/searchClient,orion/dialogs,orion/globalCommands,orion/sites/siteClient,orion/sites/siteCommands,orion/PageUtil,orion/sites/SiteEditor".split(","),function(i,k,g,c,a,l,d,e,b,j,h,f,m,n,q){g.startup().then(function(d){var g=d.serviceRegistry,r=d.preferences;new j.DialogService(g);var w=new e.OperationsClient(g),d=new c.StatusReportingService(g,
w,"statusPane","notifications","notificationArea"),s=new l.CommandRegistry({}),w=new a.ProgressService(g,w,s),y=n.matchResourceParameters().resource,y=f.forLocation(g,y),t=y._getFileClient(),z=new b.Searcher({serviceRegistry:g,commandService:s,fileService:t});h.generateBanner("orion-site",g,s,r,z);var v,H=function(){var a=v&&v.getSiteConfiguration();if(v&&a){var b={Parents:[]};b.Name=a.Name;b.Parents[0]={};b.Parents[0].Name=k.Sites;b.Parents[0].Location="";h.setPageTarget({task:"Edit Site",target:a,
breadcrumbTarget:b,makeBreadcrumbLink:function(a){a.href=i.toUrl("sites/sites.html")},serviceRegistry:g,searchService:z,fileService:t,commandService:s});h.setDirtyIndicator(v.isDirty())}},r=function(){var a=n.matchResourceParameters().resource;a&&a!==v.getResource()&&(!v.isDirty()||confirm(k["There are unsaved changes. Do you still want to navigate away?"]))&&v.load(a).then(function(){H()})};window.addEventListener("hashchange",r);v=new q({serviceRegistry:g,fileClient:t,siteClient:y,commandService:s,
statusService:d,progressService:w,commandsContainer:document.getElementById("pageActions"),id:"site-editor"});document.getElementById("site").appendChild(v.node);v.show();v.addEventListener("success",H);v.addEventListener("dirty",H);r();window.onbeforeunload=function(){if(v.isDirty())return k["There are unsaved changes."]};m.createSiteCommands(g,s);s.registerCommandContribution("pageActions","orion.site.start",1);s.registerCommandContribution("pageActions","orion.site.stop",2);s.registerCommandContribution("pageActions",
"orion.site.convert",3)})});