/**
 * @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) 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). 
 *
 *******************************************************************************/

/*******************************************************************************
 * @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, 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) 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 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) 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: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (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) 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 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). 
 * 
 * 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) 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: 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) 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) 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, 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) 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) 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) 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) 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) 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
 *		Mihai Sucan (Mozilla Foundation) - fix for Bug#334583 Bug#348471 Bug#349485 Bug#350595 Bug#360726 Bug#361180 Bug#362835 Bug#362428 Bug#362286 Bug#354270 Bug#361474 Bug#363945 Bug#366312 Bug#370584
 ******************************************************************************/

/* See jsdiff-license.txt for terms of usage */

/*******************************************************************************
 * @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
 *               Alex Lakatos - fix for bug#369781
 ******************************************************************************/

/******************************************************************************* 
 * @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). 
 * 
 * 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
 *	Adrian Aichner - regular expression capture group support in replace
 ******************************************************************************/

/******************************************************************************* 
 * @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) 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) 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) 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, 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).
 * 
 * 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) 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, 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) 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). 


 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, 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) 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) 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) 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). 

 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) 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, 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) 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) 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 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) 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 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: 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) 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) 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 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) 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) 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, 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) 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) 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) 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) 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) 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) 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: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (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

 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

 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) 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
 Mihai Sucan (Mozilla Foundation) - fix for Bug#334583 Bug#348471 Bug#349485 Bug#350595 Bug#360726 Bug#361180 Bug#362835 Bug#362428 Bug#362286 Bug#354270 Bug#361474 Bug#363945 Bug#366312 Bug#370584

 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

 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) 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

 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) 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) 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) 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) 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

 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) 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) 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) 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) 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) 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) 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
 Alex Lakatos - fix for bug#369781

 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) 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
 Adrian Aichner - regular expression capture group support in replace

 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) 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) 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) 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) 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) 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) 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) 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) 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, 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
 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 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, 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) 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, 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 g(d,a,e,j,c,b){a[d]&&(e.push(d),(a[d]===!0||a[d]===1)&&j.push(c+d+"/"+b))}function k(d,a,e,j,c){a=j+a+"/"+c;require._fileExists(d.toUrl(a+".js"))&&e.push(a)}function i(d,a,e){for(var j in a)a.hasOwnProperty(j)&&(!d.hasOwnProperty(j)||e)?d[j]=a[j]:typeof a[j]==="object"&&i(d[j],a[j],e)}var f=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(d){var a=d.config?d.config():{};return{version:"2.0.1+",load:function(e,j,c,b){b=b||{};if(b.locale)a.locale=b.locale;
var h=f.exec(e),d=h[1],n=h[4],m=h[5],s=n.split("-"),r=[],q={},p,t="";if(h[5])d=h[1],e=d+m;else{m=h[4];n=a.locale;if(!n)n=a.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();s=n.split("-")}if(b.isBuild){r.push(e);k(j,"root",r,d,m);for(p=0;p<s.length;p++)b=s[p],t+=(t?"-":"")+b,k(j,t,r,d,m);j(r,function(){c()})}else j([e],function(b){var h=[],a;g("root",b,h,r,d,m);for(p=0;p<s.length;p++)a=s[p],t+=(t?"-":"")+a,g(t,b,h,r,d,m);j(r,function(){var a,
e,f;for(a=h.length-1;a>-1&&h[a];a--){f=h[a];e=b[f];if(e===!0||e===1)e=j(d+f+"/"+m);i(q,e)}c(q)})})}}})})();
define("orion/i18n",[],function(){return{load:function(g,k,i,f){var f=f||{},d=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,a=d.exec(g);if(a)if(k.defined(g))i(k(g));else if(f.isBuild||f.isTest)i({});else{var e=a[1],j=a[3]?a[2]:"",c=a[3]||a[2];k(["orion/bootstrap"],function(b){b.startup().then(function(b){var l=b.serviceRegistry,b=l.getServiceReferences("orion.i18n.message");if(j)b.some(function(b){return g===b.getProperty("name")?(l.getService(b).getMessageBundle().then(function(b){i(b)},function(){i({})}),
!0):!1})||i({});else{var n={},m;b.forEach(function(b){var h=b.getProperty("name");if((a=d.exec(h))&&e===a[1]&&c===(a[3]||a[2]))if(j=a[3]?a[2]:""){if((b=f.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&b.toLowerCase().indexOf(j.toLowerCase())===0)n[j]=!0,k.specified(h)||define(h,["orion/i18n!"+h],function(b){return b})}else m=b});k.specified(g)?i(n):m?l.getService(m).getMessageBundle().then(function(b){Object.keys(n).forEach(function(c){typeof b[c]==="undefined"&&
(b[c]=n[c])});define(g,[],b);i(b)},function(){define(g,[],n);i(n)}):(define(g,[],n),i(n))}})})}else i(null)}}});
define("git/nls/root/gitmessages",{Compare:"Compare","View the side-by-side compare":"View the side-by-side compare","Working Directory Version":"Working Directory Version","Working Directory":"Working Directory","View the working directory version of the file":"View the working directory version of the file","Loading...":"Loading...",Repositories:"Git Repositories","0 on 1 - Git":"${0} on ${1} - Git",Git:"Git","Show in eclipse.org":"Show in eclipse.org","Show this repository at eclipse.org":"Show this repository at eclipse.org",
"Show in GitHub":"Show in GitHub","Show this repository in GitHub":"Show this repository in GitHub","Commit Details":"Commit Details","No Commits":"No Commits","commit: 0":"commit: ${0}","parent: 0":"parent: ${0}","authored by 0 (1) on 2":"authored by ${0} (${1}) on ${2}","committed by 0 (1)":"committed by ${0} (${1})","Tags:":"Tags:","No Tags":"No Tags",Diffs:"Changes",More:"More","Loading git log...":"Loading git log...",local:"local",remote:"remote","Git Log for ${0} branch ${1} on ":"Git Log for ${0} branch ${1} on ",
"Git Log for ${0} branch ${1}":"Git Log for ${0} branch ${1}","Log for branch ${0} - Git":"Log for branch ${0} - Git","Log for ${0} on ${1} - Git":"Log for ${0} on ${1} - Git","View All":"View All","Error ${0}: ":"Error ${0}: ","Loading ":"Loading ",Message:"Message",Author:"Author",Date:"Date",Actions:"Actions",Branches:"Branches",Tags:"Tags",Stage:"Stage","Unstaged removal":"Unstaged removal",Unstage:"Unstage","Staged removal":"Staged removal","Unstaged change":"Unstaged change","Staged change":"Staged change",
"Unstaged add":"Unstaged add","Staged add":"Staged add",Addition:"Addition",Deletion:"Deletion","Resolve Conflict":"Resolve Conflict",Conflicting:"Conflicting","Commit message":"Commit message","Record changes in the active branch":"Record changes in the active branch",Commit:"Commit","Amend last commit":"Amend last commit"," Amend":" Amend","Rebase in progress. Choose action:":"Rebase in progress. Choose action:","Committer name:":"Committer name:","email:":"email:","Author name: ":"Author name: ",
"Select a file on the left to compare...":"Select a file on the left to compare...",Unstaged:"Unstaged",Staged:"Staged","Recent commits on":"Recent commits on","Git Status":"Git Status","Go to Git Status":"Go to Git Status","Recent commits on ${0}":"Recent commits on ${0}","Status for ${0} - Git":"Status for ${0} - Git","Status (${0})":"Status (${0})","Getting git incoming changes...":"Getting git incoming changes...","Loading recent commits...":"Loading recent commits...","Show the side-by-side compare":"Show the side-by-side compare",
"Change Committer or Author":"Change Committer or Author","Use Default Committer and Author":"Use Default Committer and Author",Checkout:"Checkout","Checkout the file, discarding the unstaged change":"Checkout the file, discarding the unstaged change","Your changes to the file will be lost. Are you sure you want to checkout?":"Your changes to the file will be lost. Are you sure you want to checkout?","Checking out...":"Checking out...","Stage the change":"Stage the change","Stage the selected changes":"Stage the selected changes",
"Staging...":"Staging...","Checkout all the selected files, discarding all changes":"Checkout all the selected files, discarding all changes","Your changes to all the selected files will be lost. Are you sure you want to checkout?":"Your changes to all the selected files will be lost. Are you sure you want to checkout?","Save Patch":"Save Patch","Save workspace changes as a patch":"Save workspace changes as a patch","Unstage the change":"Unstage the change","Unstaging...":"Unstaging...",Reset:"Reset",
"Reset the branch, discarding all staged and unstaged changes":"Reset the branch, discarding all staged and unstaged changes","All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.":"All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.","Are you sure you want to continue?":"Are you sure you want to continue?","Resetting local changes...":"Resetting local changes...","Continue rebase...":"Continue rebase...",
"Skipping patch...":"Skipping patch...","Aborting rebase...":"Aborting rebase...","Complete log":"Complete log","local VS index":"local VS index","index VS HEAD":"index VS HEAD","Compare(${0} : ${1})":"Compare(${0} : ${1})","Loading status...":"Loading status...","Committing...":"Committing...","The committer name is required.":"The committer name is required.","The committer mail is required.":"The committer mail is required.","The author name is required.":"The author name is required.","The author mail is required.":"The author mail is required.",
". Repository still contains conflicts.":". Repository still contains conflicts.",". Repository contains unmerged paths. Resolve conflicts first.":". Repository contains unmerged paths. Resolve conflicts first.","Rendering ${0}":"Rendering ${0}",Configuration:"Configuration"," - Git":" - Git","Repositories - Git":"Repositories - Git",Repository:"Repository","Repository Not Found":"Repository Not Found","No Repositories":"No Repositories","Loading repository":"Loading repository","Loading repositories":"Loading repositories",
"(no remote)":"(no remote)","location: ":"location: ","${0} file(s) to stage and ${1} file(s) to commit.":"${0} file(s) to stage and ${1} file(s) to commit.","Nothing to commit.":"Nothing to commit.","Nothing to push.":"Nothing to push."," commit(s) to push.":" commit(s) to push.","You have no changes to commit.":"You have no changes to commit.","You have changes to commit in your workspace!":"You have changes to commit in your workspace!","Rebase in progress!":"Rebase in progress!","View all local and remote tracking branches":"View all local and remote tracking branches",
"tracks no branch, ":"tracks no branch, ","tracks ${0}, ":"tracks ${0}, ","last modified ${0} by ${1}":"last modified ${0} by ${1}","No Remote Branches":"No Remote Branches","Rendering branches":"Rendering branches",Commits:"Commits","Getting current branch":"Getting current branch","See Full Log":"See Full Log","See the full log":"See the full log",'Getting commits for "${0}" branch':'Getting commits for "${0}" branch',"Rendering commits":"Rendering commits","Getting outgoing commits":"Getting outgoing commits",
"The branch is up to date.":"The branch is up to date.","You have no outgoing or incoming commits.":"You have no outgoing or incoming commits.",") by ":") by "," (SHA ":" (SHA ","Getting tags":"Getting tags","View all tags":"View all tags"," on ":" on "," by ":" by ",Remotes:"Remotes","Rendering remotes":"Rendering remotes","No Remotes":"No Remotes","Getting confituration":"Getting confituration","View all configuration entries":"View all configuration entries","Unstaged addition":"Unstaged addition",
"Staged addition":"Staged addition"," (Rebase in Progress)":" (Rebase in Progress)",Status:"Status","Status for ${0} - Git ":"Status for ${0} - Git ","No Unstaged Changes":"No Unstaged Changes","No Staged Changes":"No Staged Changes",'Commits for "${0}" branch':'Commits for "${0}" branch',"Add Remote":"Add Remote","Remote Name:":"Remote Name:","Remote URI:":"Remote URI:","Apply Patch":"Apply Patch","Git Repository":"Git Repository","Go to the git repository":"Go to the git repository","Clone Git Repository":"Clone Git Repository",
"Repository URL:":"Repository URL:","Existing directory:":"Existing directory:","New folder:":"New folder:","Choose a Folder":"Choose a Folder","Commit Changes":"Commit Changes","Message:":"Message:","Amend:":"Amend:","Committer Name:":"Committer Name:","Committer Email:":"Committer Email:","Author Name:":"Author Name:","Author Email:":"Author Email:","The commit message is required.":"The commit message is required.","Git Credentials":"Git Credentials","Username:":"Username:","Ssh password:":"Password:",
"Private key:":"Private key:","Passphrase (optional):":"Passphrase (optional):","commit:":"commit: ","parent:":"parent: ","branches: ":"branches: ","tags: ":"tags: "," authored by ${0} {${1}) on ${2}":" authored by ${0} (${1}) on ${2}",Content:"Content","Go to ${0} section":"Go to ${0} section","Find Commit":"Find Commit","Type the commit name (sha1):":"Type the commit name (sha1):",Search:"Search","Searching...":"Searching...","Looking for the commit":"Looking for the commit"," authored by ${0} (${1})) on ${2}":" authored by ${0} (${1})) on ${2}",
"New Branch:":"New Branch:",OK:"OK"," [New branch]":" [New branch]","Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.":"Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.","Link Repository":"Link Repository","Folder name:":"Folder name:","Repository was linked to ":"Repository was linked to ","Checkout the current tag, creating a local branch based on its contents.":"Checkout the current tag, creating a local branch based on its contents.",
"Checking out tag ${0}":"Checking out tag ${0}","Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.":"Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.","Checking out branch...":"Checking out branch...","Checking out branch ${0}...":"Checking out branch ${0}...",
"Branch checked out.":"Branch checked out.","New Branch":"New Branch","Add a new local branch to the repository":"Add a new local branch to the repository","Branch name":"Branch name",Delete:"Delete","Delete the local branch from the repository":"Delete the local branch from the repository","Are you sure you want to delete branch ${0}?":"Are you sure you want to delete branch ${0}?","Delete the remote tracking branch from the repository":"Delete the remote tracking branch from the repository","Are you sure?":"Are you sure?",
"You're going to delete remote branch ${0} and push the change.":"You're going to delete remote branch ${0} and push the change.","Removing remote branch: ":"Removing remote branch: ","Delete Remote Branch":"Delete Remote Branch","New Remote":"New Remote","Git Remote":"Git Remote","Go to Git Remote":"Go to Git Remote","Add a new remote to the repository":"Add a new remote to the repository","Delete the remote from the repository":"Delete the remote from the repository","Are you sure you want to delete remote ${0}?":"Are you sure you want to delete remote ${0}?",
Pull:"Pull","Pull from the repository":"Pull from the repository","Pulling: ":"Pulling: ","Pull Git Repository":"Pull Git Repository","Git Log":"Git Log","Go to Git Log":"Go to Git Log","Open the log for the branch":"Open the log for the branch","Open the log for the repository":"Open the log for the repository","Open the status for the repository":"Open the status for the repository","Show in Navigator":"Show in Navigator","Show the repository folder in the file navigator":"Show the repository folder in the file navigator",
"Compare With Each Other":"Compare With Each Other","Compare With Working Tree":"Compare With Working Tree",Open:"Open",Fetch:"Fetch","Fetch from the remote":"Fetch from the remote","SSH Password:":"Password:","SSH User Name:":"SSH User Name:","Fetching remote: ":"Fetching remote: ","Force Fetch":"Force Fetch","Fetch from the remote branch into your remote tracking branch overriding its current content":"Fetch from the remote branch into your remote tracking branch overriding its current content",
"You're going to override content of the remote tracking branch. This can cause the branch to lose commits.":"You're going to override content of the remote tracking branch. This can cause the branch to lose commits.",Merge:"Merge","Merge the content from the branch to your active branch":"Merge the content from the branch to your active branch",". Go to ${0}.":". Go to ${0}.","Git Status page":"Git Status page",Rebase:"Rebase","Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch ":"Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch ",
"Rebase on top of ":"Rebase on top of ",". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing":". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing",". Repository state is invalid (i.e. already during rebasing)":". Repository state is invalid (i.e. already during rebasing)",". Repository contains unmerged paths":". Repository contains unmerged paths",". Repository contains pending changes. Please commit or stash them":". Repository contains pending changes. Please commit or stash them",
"Rebase your commits by removing them from the active branch, ":"Rebase your commits by removing them from the active branch, ","starting the active branch again based on the latest state of '":"starting the active branch again based on the latest state of '","and applying each commit again to the updated active branch.":"and applying each commit again to the updated active branch.","Push All":"Push All","Push commits and tags from your local branch into the remote branch":"Push commits and tags from your local branch into the remote branch",
"Pushing remote: ":"Pushing remote: ","Choose Branch":"Choose Branch","Force Push All":"Force Push All","Push commits and tags from your local branch into the remote branch overriding its current content":"Push commits and tags from your local branch into the remote branch overriding its current content","You're going to override content of the remote branch. This can cause the remote repository to lose commits.":"You're going to override content of the remote branch. This can cause the remote repository to lose commits.",
"< Previous Page":"< Previous Page","Show previous page of git log":"Show previous page of git log","Show previous page of git tags":"Show previous page of git tags","Next Page >":"Next Page >","Show next page of git log":"Show next page of git log","Show next page of git tags":"Show next page of git tags","Push from your local branch into the selected remote branch":"Push from your local branch into the selected remote branch","Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.":"Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.",
"The content of your active branch will be replaced with ":"The content of your active branch will be replaced with ","All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?":"All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?","Resetting index...":"Resetting index...","Name:":"Name:",Tag:"Tag","Create a tag for the commit":"Create a tag for the commit","Tag name":"Tag name","Delete the tag from the repository":"Delete the tag from the repository",
"Are you sure you want to delete tag ${0}?":"Are you sure you want to delete tag ${0}?","Cherry-Pick":"Cherry-Pick","Apply the change introduced by the commit to your active branch":"Apply the change introduced by the commit to your active branch","Nothing changed.":"Nothing changed.",". Some conflicts occurred":". Some conflicts occurred","Fetch from the remote branch into your remote tracking branch":"Fetch from the remote branch into your remote tracking branch","Fetch Git Repository":"Fetch Git Repository",
Push:"Push","Push from your local branch into the remote branch":"Push from your local branch into the remote branch","Push Git Repository":"Push Git Repository","Key:":"Key:","Value:":"Value:","New Configuration Entry":"New Configuration Entry",Edit:"Edit","Edit the configuration entry":"Edit the configuration entry","Delete the configuration entry":"Delete the configuration entry","Are you sure you want to delete ${0}?":"Are you sure you want to delete ${0}?","Clone Repository":"Clone Repository",
"Clone an existing Git repository to a folder":"Clone an existing Git repository to a folder","Cloning repository: ":"Cloning repository: ","Init Repository":"Init Repository","Create a new Git repository in a new folder":"Create a new Git repository in a new folder","Initializing repository: ":"Initializing repository: ","Init Git Repository":"Init Git Repository","Delete the repository":"Delete the repository","Are you sure you want do delete ${0} repositories?":"Are you sure you want do delete ${0} repositories?",
"Apply a patch on the selected repository":"Apply a patch on the selected repository","Show content":"Show content","Commit name:":"Commit name:","Open Commit":"Open Commit","Open the commit with the given name":"Open the commit with the given name","No commits found":"No commits found","Staging changes":"Staging changes","Commit message:":"Commit message:","Committing changes":"Committing changes","Resetting local changes":"Resetting local changes","Checkout files, discarding all changes":"Checkout files, discarding all changes",
"Show Patch":"Show Patch","Show workspace changes as a patch":"Show workspace changes as a patch",Continue:"Continue","Contibue Rebase":"Contibue Rebase","Skip Patch":"Skip Patch",Abort:"Abort","Abort Rebase":"Abort Rebase","Your changes to the selected files will be discarded and cannot be recovered.":"Your changes to the selected files will be discarded and cannot be recovered.","Active Branch Log":"Git Log (Active Branch)","Show the log for the active local branch":"Show the log for the active local branch",
"Remote Branch Log":"Git Log (Remote Branch)","Show the log for the corresponding remote tracking branch":"Show the log for the corresponding remote tracking branch","See Full Status":"See Full Status","See the status":"See the status","Choose target location":"Choose target location","Default target location":"Default target location","Change...":"Change...","Merge Squash":"Merge Squash","Squash the content of the branch to the index":"Squash the content of the branch to the index","Local Branch Name:":"Local Branch Name:",
"Filter items":"Filter items","Filter remote branches":"Filter remote branches","Paste link in email or IM":"Paste link in email or IM","Show Commit in GitHub":"Show Commit in GitHub","Show Repository in GitHub":"Show Repository in GitHub","Show this commit in GitHub":"Show this commit in GitHub","Show Commit in eclipse.org":"Show Commit in eclipse.org","Show this commit in eclipse.org":"Show this commit in eclipse.org","Show Repository in eclipse.org":"Show Repository in eclipse.org","Show this repository in eclipse.org":"Show this repository in eclipse.org",
"Ask for review":"Ask for review","Ask for review tooltip":"Send email with request for commit review","Reviewer name":"Reviewer name","Contribution Review Request":"Contribution Review Request","Send the link to the reviewer":"Send the link to the reviewer","Private key file (optional):":"Private key file (optional):","Don't prompt me again:":"Don't prompt me again:","Your private key will be saved in the browser for further use":"Your private key will be saved in the browser for further use","Loading Contribution Review Request...":"Loading Contribution Review Request...",
"The commit can be found in the following repositories":"The commit can be found in the following repositories","Try to update your repositories":"Try to update your repositories","Create new repository":"Create new repository","Attach the remote to one of your existing repositories":"Attach the remote to one of your existing repositories","You are reviewing contribution ${0} from ${1}":"You are reviewing contribution ${0} from ${1}","Unfortunately the commit can not be found in your workspace. To see it try one of the following: ":"Unfortunately the commit can not be found in your workspace. To see it try one of the following: ",
"To review the commit you can also:":"To review the commit you can also:","Contribution Review Request for ${0} on ${1}":"Contribution Review Request for ${0} on ${1}","Failing paths: ${0}":"Failing paths: ${0}","Problem while performing the action":"Problem while performing the action","Clone Git Repository":"Clone 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."});
define("git/nls/gitmessages",["orion/i18n!git/nls/gitmessages","git/nls/root/gitmessages"],function(g,k){var i={root:k};Object.keys(g).forEach(function(f){typeof i[f]==="undefined"&&(i[f]=g[f])});return i});
define("orion/browserCompatibility",[],function(){function g(){for(var d=navigator.userAgent,a={browser:!1,version:!1},e=[{name:"Chrome/Chromium",regExp:/(?:chrome|crios|chromium)\/(\d+)/i,minVersion:24},{name:"Firefox",regExp:/firefox\/(\d+)/i,minVersion:17},{name:"MSIE",regExp:/msie\s(\d+)/i,minVersion:10},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:5}],j=0;j<e.length;j++){var c=e[j],b=d.match(c.regExp);if(b){a.browser=!0;a.version=b[1]>=c.minVersion;a.name=c.name;break}}return a}
function k(){try{return"localStorage"in window&&window.localStorage!==null}catch(d){return!1}}function i(d){alert(d);throw"unsupported browser";}var f=g();if(f.browser)f.version||i("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+f.name+".\n");else if(k()&&!localStorage.skipBrowserCheck)if(confirm("Sorry, your browser is not supported. The latest version of Chrome, Firefox or Safari web browser is recommended.\nContinue anyway?"))localStorage.skipBrowserCheck=
1;else throw"unsupported browser";else k()||i("Sorry, your browser is not supported.\n\nTo use Orion, the latest version of the Chrome, Firefox, or Safari web browser is recommended.\n");return{isSupportedBrowser:g,supportsLocalStorage:k,throwBrowserAlert:i}});
(function(g,k){typeof define==="function"&&define.amd?define("orion/Deferred",k):typeof exports==="object"?module.exports=k():(g.orion=g.orion||{},g.orion.Deferred=k())})(this,function(){function g(){for(var b;b=e.shift()||j.shift();)b();c=!1}function k(b,h){(h?j:e).push(b);c||(c=!0,h?setTimeout(g,0):g())}function i(b){return function(){b.apply(null,arguments)}}function f(){}function d(){var b=Error("Cancel");b.name="Cancel";return b}function a(){function b(){for(var b;b=j.shift();){var a=b.deferred,
d=e==="resolved"?"resolve":"reject";if(typeof b[d]==="function")try{var m=b[d](c);m&&typeof m.then==="function"?(a.cancel=m.cancel||f,m.then(i(a.resolve),i(a.reject),a.progress)):a.resolve(m)}catch(g){a.reject(g)}else a[d](c)}}var c,e,j=[],m=this;this.reject=function(a){e||(e="rejected",c=a,j.length&&k(b));return m.promise};this.resolve=function(a){e||(e="resolved",c=a,j.length&&k(b));return m.promise};this.progress=function(b){e||j.forEach(function(c){c.progress&&c.progress(b)});return m.promise};
this.cancel=function(){e||m.reject(d())};this.then=function(c,h,d){var c={resolve:c,reject:h,progress:d,deferred:new a},f=c.deferred,g=!1,o=function(){g||(g=!0,k(function(){var b=f.cancel===o?m.cancel:f.cancel;typeof b==="function"&&b()},!0))};f.cancel=o;j.push(c);e&&k(b,!0);return f.promise};this.promise=Object.create(Object.prototype,{then:{value:m.then},cancel:{get:function(){return m.cancel},set:function(b){m.cancel=b}}})}var e=[],j=[],c=!1;a.all=function(b,c){function e(b,c){r||(f[b]=c,--d===
0&&q.resolve(f))}function j(b,a){if(!r){if(c)try{e(b,c(a));return}catch(o){a=o}q.reject(a)}}var d=b.length,f=[],r=!1,q=new a;q.then(null,function(){r=!0;b.forEach(function(b){b.cancel&&b.cancel()})});d===0?q.resolve(f):b.forEach(function(b,c){b.then(e.bind(null,c),j.bind(null,c))});return q.promise};a.when=function(b,c,e,j){var d;if(!(b&&typeof b.then==="function"))d=new a,d.resolve(b),b=d.promise;return b.then(c,e,j)};return a});
define("orion/EventTarget",[],function(){function g(){this._namedListeners={}}g.prototype={dispatchEvent:function(g){if(!g.type)throw Error("unspecified type");var i=this._namedListeners[g.type];i&&i.forEach(function(f){try{typeof f==="function"?f(g):f.handleEvent(g)}catch(d){typeof console!=="undefined"&&console.log(d)}});return!g.defaultPrevented},addEventListener:function(g,i){if(typeof i==="function"||i.handleEvent)this._namedListeners[g]=this._namedListeners[g]||[],this._namedListeners[g].push(i)},
removeEventListener:function(g,i){var f=this._namedListeners[g];if(f)for(var d=0;d<f.length;d++)if(f[d]===i){f.length===1?delete this._namedListeners[g]:f.splice(d,1);break}}};g.prototype.constructor=g;g.attach=function(k){var i=new g;k.dispatchEvent=i.dispatchEvent.bind(i);k.addEventListener=i.addEventListener.bind(i);k.removeEventListener=i.removeEventListener.bind(i)};return g});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(g,k){function i(a,c,b){this._properties=b||{};this._properties["service.id"]=a;this._properties.objectClass=c;this._properties["service.names"]=c}function f(a,c,b){this._serviceId=a;this._serviceReference=c;this._internalRegistry=b}function d(a,c){function b(b){return function(){var h;try{if(!c())throw Error("Service was unregistered");var e=a[b].apply(a,Array.prototype.slice.call(arguments));if(e&&typeof e.then==="function")return e;
else h=new g,h.resolve(e)}catch(d){h=new g,h.reject(d)}return h.promise}}for(var h in a)typeof a[h]==="function"&&(this[h]=b(h))}function a(a,c){this.type=a;this.serviceReference=c}function e(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var e=this;this._internalRegistry={isRegistered:function(c){return e._entries[c]?!0:!1},unregisterService:function(c){var b=e._entries[c];if(!b)throw Error("already unregistered");var h=b.reference;e._serviceEventTarget.dispatchEvent(new a("unregistering",
h));e._entries[c]=null;h.getProperty("objectClass").forEach(function(b){for(var c=e._namedReferences[b],a=0;a<c.length;a++)if(c[a]===h){c.length===1?delete e._namedReferences[b]:c.splice(a,1);break}})},modifyService:function(c){c=e._entries[c];if(!c)throw Error("already unregistered");e._serviceEventTarget.dispatchEvent(new a("modified",c.reference))}}}i.prototype={getPropertyKeys:function(){var a=[],c;for(c in this._properties)this._properties.hasOwnProperty(c)&&a.push(c);return a},getProperty:function(a){return this._properties[a]}};
i.prototype.constructor=i;f.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("already unregistered");return this._serviceReference},setProperties:function(a){var c=this._serviceReference._properties;this._serviceReference._properties=a||{};a["service.id"]=this._serviceId;a.objectClass=c.objectClass;a["service.names"]=c["service.names"];this._internalRegistry.modifyService(this._serviceId)}};
f.prototype.constructor=f;e.prototype={getService:function(a){var c;if(typeof a==="string")(a=this._namedReferences[a])&&a.some(function(b){c=this._entries[b.getProperty("service.id")].service;return!!c},this);else if(a=this._entries[a.getProperty("service.id")])c=a.service;return c||null},getServiceReferences:function(a){if(a)return this._namedReferences[a]?this._namedReferences[a]:[];var c=[];this._entries.forEach(function(b){b&&c.push(b.reference)});return c},registerService:function(e,c,b){if(typeof c===
"undefined"||c===null)throw Error("invalid service");typeof e==="string"?e=[e]:Array.isArray(e)||(e=[]);var h=this._entries.length,l=new i(h,e,b),n=this._namedReferences;e.forEach(function(b){n[b]=n[b]||[];n[b].push(l)});e=new d(c,this._internalRegistry.isRegistered.bind(null,h));this._entries.push({reference:l,service:e});e=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new a("registered",l));return new f(h,l,e)},addEventListener:function(a,c){this._serviceEventTarget.addEventListener(a,
c)},removeEventListener:function(a,c){this._serviceEventTarget.removeEventListener(a,c)}};e.prototype.constructor=e;return{ServiceRegistry:e}});
define("orion/xhr",["orion/Deferred"],function(g){function k(g,f,d,a){var e=typeof d.response!=="undefined"?d.response:d.responseText,j;try{j=d.status}catch(c){j=0}g={args:f,response:e,responseText:typeof e==="string"?e:null,status:j,url:g,xhr:d};if(typeof a!=="undefined")g.error=a;return g}return function(i,f,d){var d=d||{},a=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,e=new g,j=d.headers||{},c=d.log||!1,b;typeof j["X-Requested-With"]==="undefined"&&(j["X-Requested-With"]="XMLHttpRequest");
if(typeof d.data!=="undefined"&&(i==="POST"||i==="PUT"))b=d.data;a.onprogress=function(b){b.xhr=a;e.progress(b)};a.onreadystatechange=function(){if(a.readyState===4){var b=k(f,d,a),h=a.status;200<=h&&h<400?e.resolve(b):(c&&typeof console!=="undefined"&&console.log(Error(a.statusText)),e.reject(b))}};try{a.open(i,f,!0);if(typeof d.responseType==="string")a.responseType=d.responseType;if(typeof d.timeout==="number")if(typeof a.timeout==="number")a.timeout=d.timeout,a.addEventListener("timeout",function(){e.reject(k(f,
d,a,"Timeout exceeded"))});else{var h=setTimeout(function(){e.reject(k(f,d,a,"Timeout exceeded"))},d.timeout);e.then(clearTimeout.bind(null,h),clearTimeout.bind(null,h))}Object.keys(j).forEach(function(b){a.setRequestHeader(b,j[b])});a.send(b)}catch(l){e.reject(k(f,d,a,l))}return e.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(g,k,i){function f(b,c){this._name=b;this._providers=c;this._flushPending=!1;this._cached=null;this._stores=[];this._dirty=[]}function d(b,c){return{get:function(a,e){if(c===0)return null;var d=localStorage.getItem(b+a);if(d===null)return null;d=JSON.parse(d);return e||c===-1||d._expires&&d._expires>(new Date).getTime()?(delete d._expires,d):null},set:function(a,e){if(c!==0){if(c!==-1)e._expires=(new Date).getTime()+1E3*c;
if(Object.keys(e).length===0)localStorage.removeItem(b+a);else{var d=JSON.stringify(e);localStorage.setItem(b+a,d);delete e._expires}}},remove:function(c){localStorage.removeItem(b+c)}}}function a(b){this._currentPromises={};this._cache=new d("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var c=b.getServiceReferences("orion.core.preference.provider");if(c.length>0)this._service=b.getService(c[0])}return!!this._service}}function e(b){this._location=
b;this._currentPromise=null;this._cache=new d("/orion/preferences/default",3600)}function j(){this._cache=new d("/orion/preferences/local",-1)}function c(b,c){this._userProvider=new a(b);this._localProvider=new j;c=c||"defaults.pref";c.indexOf("://")===-1&&(c=g.toUrl(c));this._defaultsProvider=new e(c);this._serviceRegistration=b.registerService("orion.core.preference",this)}f.prototype={_flush:function(){for(var b=[],c=0;c<this._stores.length;++c){var a=this._stores[c];this._dirty.indexOf(a)!==-1&&
b.push(this._providers[c].put(this._name,a))}this._dirty=[];return k.all(b)},_scheduleFlush:function(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 c=this._stores[b],a;for(a in c)c.hasOwnProperty(a)&&typeof this._cached[a]==="undefined"&&(this._cached[a]=
c[a])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(b){return this._getCached()[b]},put:function(b,c){if(this._stores.length!==0){var a=this._stores[0];if(a[b]!==c)a[b]=c,this._cached=null,this._scheduleFlush(a)}},remove:function(b){for(var c=0;c<this._stores.length;++c){var a=this._stores[c];if(a.hasOwnProperty(b))return delete a[b],this._cached=null,this._scheduleFlush(a),!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 c=this,a=[],e=0;e<this._providers.length;++e)a.push(this._providers[e].get(this._name,b).then(function(b){return function(a){c._stores[b]=a}}(e)));return k.all(a).then(function(){c._cached=null;c._getCached()})},flush:function(){this._flush()}};a.prototype={get:function(b,c){if(this._currentPromises[b])return this._currentPromises[b];var a=new k,e=null;
c?this._cache.remove(b):e=this._cache.get(b);if(e!==null)a.resolve(e);else{this._currentPromises[b]=a;var d=this;this._service.get(b).then(function(c){d._cache.set(b,c);delete d._currentPromises[b];a.resolve(c)},function(c){c.status===404?(c={},d._cache.set(b,c),delete d._currentPromises[b],a.resolve(c)):(delete d._currentPromises[b],a.resolve(d._cache.get(b,!0)||{}))})}return a},put:function(b,c){this._cache.set(b,c);return this._service.put(b,c)}};e.prototype={get:function(b,c){if(this._currentPromise)return this._currentPromise;
var a=new k,e=null;c?this._cache.remove(b):e=this._cache.get(b);if(e!==null)a.resolve(e);else{this._currentPromise=a;var d=this;i("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(c){c=JSON.parse(c.response);d._cache.set(b,c[b]||{});d._currentPromise=null;a.resolve(c[b]||{})},function(c){c.xhr.status===401||c.xhr.status===404?(d._cache.set(b,{}),d._currentPromise=null,a.resolve({})):(d._currentPromise=null,c=d._cache.get(b,!0),c!==null?a.resolve(c[b]||{}):a.resolve({}))})}return a},
put:function(){var b=new k;b.resolve();return b}};j.prototype={get:function(b){var c=new k,b=this._cache.get(b);b!==null?c.resolve(b):c.resolve({});return c},put:function(b,c){var a=new k;this._cache.set(b,c);a.resolve();return a}};c.DEFAULT_SCOPE=1;c.LOCAL_SCOPE=2;c.USER_SCOPE=4;c.prototype={listenForChangedSettings:function(b,a,e){if(!a||typeof a!=="number"||a>7||a<1)e=a,a=c.DEFAULT_SCOPE|c.LOCAL_SCOPE|c.USER_SCOPE;window.addEventListener("storage",e,!1);if((c.USER_SCOPE&a)!==0)return"/orion/preferences/user"+
b;else if((c.LOCAL_SCOPE&a)!==0)return"/orion/preferences/local"+b;return"/orion/preferences/default"+b},getPreferences:function(b,a){if(!a||typeof a!=="number"||a>7||a<1)a=c.DEFAULT_SCOPE|c.LOCAL_SCOPE|c.USER_SCOPE;var e=[];c.USER_SCOPE&a&&this._userProvider.available()&&e.push(this._userProvider);c.LOCAL_SCOPE&a&&e.push(this._localProvider);c.DEFAULT_SCOPE&a&&e.push(this._defaultsProvider);var d=new f(b,e);return d.sync().then(function(){return d})},getSetting:function(b,c,a){for(var e,d=0;d<b.length;d++)if(b[d].label===
c)for(var j=0;j<b[d].data.length;j++)if(b[d].data[j].label===a){e=b[d].data[j].value;break}return e}};return{PreferencesService:c}});
(function(){function g(b){if(typeof b!=="string")throw new TypeError;}function k(b){return b?b.split("&"):[]}function i(b){return b.length===0?"":b.join("&")}function f(b){var c=/([^=]*)(?:=?)(.*)/.exec(b),b=c[1]?decodeURIComponent(c[1]):"",c=c[2]?decodeURIComponent(c[2]):"";return[b,c]}function d(b){var c=encodeURIComponent(b[0]);b[1]&&(c+="="+encodeURIComponent(b[1]));return c}function a(b,c){var o="",a=[],h=0;return{next:function(){if(o!==b.query)o=b.query,a=k(o);if(h<a.length){var e=f(a[h++]);
switch(c){case "keys":return e[0];case "values":return e[1];case "keys+values":return[e[0],e[1]];default:throw new TypeError;}}throw u;}}}function e(b){Object.defineProperty(this,"_url",{get:function(){return b._url}})}function j(b){var c=[];b.split("/").forEach(function(b){b===".."?c.pop():b!=="."&&c.push(b)});return c.join("/")}function c(b){return b.replace(/\s/g,function(b){return"%"+b.charCodeAt(0).toString(16)})}function b(b,o){if(typeof b!=="string")throw new TypeError;var b=c(b),a=n.exec(b);
if(!a)return null;var h={};h.scheme=a[1]||"";if(h.scheme&&!s.test(h.scheme))return null;var e=a[2];if(e&&(e=m.exec(e),h.userinfo=e[1],h.host=e[2],h.port=e[3],h.port&&!r.test(h.port)))return null;h.path=a[3];h.query=a[4];h.fragment=a[5];if(!h.scheme&&o&&(h.scheme=o.scheme,!h.host&&o.host))h.userinfo=o.userinfo,h.host=o.host,h.port=o.port,h.pathRelative=!0;if(h.pathRelative)if(h.path){if(h.path[0]!=="/")a=/^(.*\/)[^\/]*$/.exec(o.path)[1]||"/",h.path=a+h.path}else h.path=o.path;if(h.scheme)h.scheme=
h.scheme.toLowerCase();if(h.port)h.port=/[1-9]\d*$/.exec(h.port)[0];if(h.host&&h.path)h.path=j(h.path);return h}function h(c,o){var a;if(o){o=o.href||o;a=b(o);if(!a||!a.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:a})}a=b(c,a);if(!a)throw new SyntaxError;Object.defineProperty(this,"_input",{value:c,writable:!0});Object.defineProperty(this,"_url",{value:a,writable:!0});var h=new e(this);Object.defineProperty(this,"query",{get:function(){return this._url?h:null},enumerable:!0})}
try{if(typeof window.URL==="function"&&window.URL.length!==0&&(new window.URL("http://www.w3.org")).protocol==="http:")return}catch(l){}var n=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,m=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,s=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,r=/^\d*$/,q=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,p=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,t=/^([^?#\s]*)$/,o=/^([^\s]*)$/,v=/^\S*$/,z=/([^:]*):?(.*)/,u=typeof StopIteration!=="undefined"?StopIteration:
Error("Stop Iteration"),w={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(e.prototype,{get:{value:function(b){g(b);var c;k(this._url.query).some(function(o){o=f(o);if(o[0]===b)return c=o[1],!0});return c},enumerable:!0},set:{value:function(b,c){g(b);g(c);var o=k(this._url.query);o.some(function(a,h){var e=f(a);if(e[0]===b)return e[1]=c,o[h]=d(e),!0})||o.push(d([b,c]));this._url.query=i(o)},enumerable:!0},has:{value:function(b){g(b);return k(this._url.query).some(function(c){if(f(c)[0]===
b)return!0})},enumerable:!0},"delete":{value:function(b){g(b);var c=k(this._url.query),o=c.filter(function(c){return f(c)[0]!==b});return o.length!==c.length?(this._url.query=i(o),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(b,c){if(typeof b!=="function")throw new TypeError;var o=a(this._url,"keys+values");try{for(;;){var h=o.next();b.call(c,h[1],h[0],this)}}catch(e){if(e!==u)throw e;}},enumerable:!0},keys:{value:function(){return a(this._url,
"keys")},enumerable:!0},values:{value:function(){return a(this._url,"values")},enumerable:!0},items:{value:function(){return a(this._url,"keys+values")}},size:{get:function(){return k(this._url.query).length},enumerable:!0},getAll:{value:function(b){g(b);var c=[];k(this._url.query).forEach(function(o){o=f(o);o[0]===b&&c.push(o[1])});return c},enumerable:!0},append:{value:function(b,c){g(b);g(c);var o=k(this._url.query);o.push(d([b,c]));this._url.query=i(o)},enumerable:!0}});Object.defineProperties(h.prototype,
{href:{get:function(){var b;if(this._url){b=this._url;var c=b.scheme?b.scheme+":":"";b.host&&(c+="//",b.userinfo&&(c+=b.userinfo+"@"),c+=b.host,b.port&&(c+=":"+b.port));c+=b.path;b.query&&(c+="?"+b.query);b.fragment&&(c+="#"+b.fragment);b=c}else b=this._input;return b},set:function(c){g(c);this._input=c;this._url=b(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){g(b);if(this._url&&(b=b.slice(-1)===":"?b.substring(0,b.length-1):b,s.test(b)))this._url.scheme=b.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(b){g(b);if(this._url)this._url.userinfo=b}},username:{get:function(){if(!this._url)return"";var b=z.exec(this._userinfo);return decodeURIComponent(b[1]||"")},set:function(b){g(b);if(this._url){var c=z.exec(this._userinfo),b=[encodeURIComponent(b||"")];
c[2]&&b.push(c[2]);this._userinfo=b.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var b=z.exec(this._userinfo);return decodeURIComponent(b[2]||"")},set:function(b){g(b);if(this._url){var c=[z.exec(this._userinfo)[1]||""];b&&c.push(encodeURIComponent(b));this._userinfo=c.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){g(b);if(this._url&&(b=p.exec(b)))this._url.host=
b[1],this._url.port=/[1-9]\d*$/.exec(b[2])[0]},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(b){g(b);if(this._url&&q.exec(b))this._url.host=b},enumerable:!0},port:{get:function(){var b=this._url?this._url.port||"":"";b&&b===w[this.protocol]&&(b="");return b},set:function(b){g(b);if(this._url&&r.exec(b))this._url.port=/[1-9]\d*$/.exec(b)[0]},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(b){g(b);if(this._url&&t.exec(b))this._url.host&&
b&&b[0]!=="/"&&(b="/"+b),this._url.path=b?j(b):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(b){g(b);if(this._url&&(b&&b[0]==="?"&&(b=b.substring(1)),o.exec(b)))this._url.query=b},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(b){g(b);if(this._url&&(b&&b[0]==="#"&&(b=b.substring(1)),v.exec(b)))this._url.fragment=b},enumerable:!0}});window.URL&&window.URL.createObjectURL&&
(Object.defineProperty(h,"createObjectURL",{value:window.URL.createObjectURL.bind(window.URL),enumerable:!1}),Object.defineProperty(h,"revokeObjectURL",{value:window.URL.revokeObjectURL.bind(window.URL),enumerable:!1}));window.URL=h})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(g,k){function i(c,b){var a=Object.keys(c),e=Object.keys(b);if(a.length!==e.length)return!1;a.sort();e.sort();for(var d=0,j=a.length;d<j;d++){var f=a[d];if(f!==e[d])return!1;var r=c[f],f=b[f];if(r!==f&&JSON.stringify(r)!==JSON.stringify(f))return!1}return!0}function f(c){if(c.indexOf("://")===-1)try{return(new URL(c,location.href)).href}catch(b){}return c}function d(c){var b=null;return{key:function(a){return(b=
b||Object.keys(c))[a]},getItem:function(b){return c[b]},setItem:function(a,e){c[a]=e;b=null},removeItem:function(a){delete c[a];b=null},clear:function(){(b=b||Object.keys(c)).forEach(function(b){delete c[b]}.bind(this));b=null}}}function a(c,b){return{type:c,plugin:b}}function e(c,b,h){function e(b,c,o){if(!F)return(new g).reject(Error("plugin not connected"));var a=C++,d=new g;d.then(null,function(b){w==="active"&&b instanceof Error&&b.name==="Cancel"&&h.postMessage({id:a,cancel:b.message||"Cancel"},
F)});G[String(a)]=d;h.postMessage({id:a,serviceId:b,method:c,params:o},F);return d.promise}function d(b){var c={};if(b.methods&&(b.methods.forEach(function(o){c[o]=function(){var c=Array.prototype.slice.call(arguments);return w==="active"?e(b.serviceId,o,c):p.start({"transient":!0}).then(function(){return e(b.serviceId,o,c)})}}),c.addEventListener&&c.removeEventListener)){var o=new k;c.dispatchEvent=o.dispatchEvent.bind(o);var a=c.addEventListener;c.addEventListener=function(b,c){o._namedListeners[b]||
a(b);o.addEventListener(b,c)};var h=c.removeEventListener;c.removeEventListener=function(b,c){o.removeEventListener(b,c);o._namedListeners[b]&&h(b)}}return c}function j(b){var o=JSON.parse(JSON.stringify(b.properties));o.__plugin__=c;b=b.names||b.type||[];Array.isArray(b)||(b=[b]);o.objectClass=b;return o}function f(b){var c=d(b),o=j(b),o=h.registerService(b.names||b.type,c,o);B[b.serviceId]={registration:o,proxy:c}}function r(){h.persist(c,{created:t,headers:o,services:v,autostart:z,lastModified:u})}
function q(b){var c;try{if(b.method)if("manifest"===b.method||"plugin"===b.method){var o=b.params[0];H({headers:o.headers,services:o.services}).then(function(){A.resolve(p)})}else if("dispatchEvent"===b.method){var a=B[b.serviceId].proxy;a.dispatchEvent.apply(a,b.params)}else if("progress"===b.method)c=G[String(b.requestId)],c.progress.apply(c,b.params);else if("timeout"===b.method)A&&A.reject(b.error);else throw Error("Bad response method: "+b.method);else if(c=G[String(b.id)],delete G[String(b.id)],
b.error){var e=h.handleServiceError(p,b.error);c.reject(e)}else c.resolve(b.result)}catch(d){console.log("Plugin._responseHandler "+d)}}var p=this,b=b||{},t=b.created||(new Date).getTime(),o=b.headers||{},v=b.services||[],z=b.autostart,u=b.lastModified||0,w="installed",x,A,F,B={},C=0,G={},H;this._persist=r;this._resolve=function(){w="resolved";h.dispatchEvent(new a("resolved",p))};this._getAutostart=function(){return z};this._getCreated=function(){return t};this.getLocation=function(){return c};this.getHeaders=
function(){return JSON.parse(JSON.stringify(o))};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 u};this.getServiceReferences=function(){var b=[];Object.keys(B).forEach(function(c){b.push(B[c].registration.getReference())});return b};this.getState=function(){return w};this.start=function(b){if(w==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));
if(x)return x.promise.then(this.start.bind(this,b));if(w==="active")return(new g).resolve();if(!b||!b["transient"]){var o=b&&b.lazy?"lazy":"started";o!==z&&(z=o,r())}o=h.getState();if(o!=="starting"&&o!=="active")return b["transient"]?(new g).reject(Error("start transient error")):(new g).resolve();if(w==="installed")try{this._resolve()}catch(e){return(new g).reject(e)}w==="resolved"&&v.forEach(function(b){f(b)});if(b&&b.lazy)return w!=="starting"&&(w="starting",h.dispatchEvent(new a("lazy activation",
p))),(new g).resolve();var d=new g;x=d;w="starting";h.dispatchEvent(new a("starting",p));A=new g;F=h.connect(c,q);A.then(function(){A=null;w="active";h.dispatchEvent(new a("started",p));x=null;d.resolve()},function(){A=null;w="stopping";h.dispatchEvent(new a("stopping",p));Object.keys(B).forEach(function(b){B[b].registration.unregister();delete B[b]});h.disconnect(F);F=null;w="resolved";x=null;h.dispatchEvent(new a("stopped",p));d.reject(Error("plugin activation error"))});return d.promise};this.stop=
function(b){if(w==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(x)return x.promise.then(this.stop.bind(this,b));if((!b||!b["transient"])&&"stopped"!==z)z="stopped",r();if(w!=="active"&&w!=="starting")return(new g).resolve();x=b=new g;w="stopping";h.dispatchEvent(new a("stopping",p));Object.keys(B).forEach(function(b){B[b].registration.unregister();delete B[b]});F&&(h.disconnect(F),F=null);w="resolved";x=null;h.dispatchEvent(new a("stopped",p));b.resolve();return b.promise};
H=function(b){if(w==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(!b)return u===0&&(u=(new Date).getTime(),r()),h.loadManifest(c).then(H);var e=o,d=v,l=z;o=b.headers||{};v=b.services||{};z=b.autostart||z;b.lastModified?u=b.lastModified:(u=(new Date).getTime(),r());if(i(o,e)&&i(v,d)&&z===l)return(new g).resolve();if(w==="active"||w==="starting"){var n=[];Object.keys(v).forEach(function(b){var c=v[b];n.push(b);var o=B[b];if(o){if(i(c.methods,Object.keys(o.proxy))){var b=j(c),
a=o.registration.getReference(),h={};a.getPropertyKeys().forEach(function(b){h[b]=a.getProperty(b)});i(b,h)||o.registration.setProperties(b);return}o.registration.unregister();delete B[b]}f(c)});Object.keys(B).forEach(function(b){n.indexOf(b)===-1&&(B[b].registration.unregister(),delete B[b])})}w==="active"&&(h.disconnect(F),A=new g,F=h.connect(c,q),A.then(function(){A=null},function(){A=null;w="stopping";h.dispatchEvent(new a("stopping"),p);Object.keys(B).forEach(function(b){B[b].registration.unregister();
delete B[b]});h.disconnect(F);F=null;w="resolved";h.dispatchEvent(new a("stopped",p))}));return(new g).resolve()};this.update=function(b){return H(b).then(function(){h.dispatchEvent(new a("updated",p))})};this.uninstall=function(){if(w==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(w==="active"||w==="starting"||w==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));h.removePlugin(this);w="uninstalled";h.dispatchEvent(new a("uninstalled",
p));return(new g).resolve()}}var j=/^http[s]?/i;return{Plugin:e,PluginRegistry:function(c,b){function h(b){var c=b.source;s.some(function(a){if(c===a.target){if(typeof a.useStructuredClone==="undefined")a.useStructuredClone=typeof b.data!=="string";a.handler(a.useStructuredClone?b.data:JSON.parse(b.data));return!0}})}var b=b||{},l=b.storage||localStorage;l.getItem||(l=d(l));var n="installed",m=[],s=[],r=new k,q={},i={registerService:c.registerService.bind(c),connect:function(c,o,a){function h(b){b=
Error(b);b.name="timeout";o({method:"timeout",error:b})}var e={handler:o,url:c},d=setTimeout(h.bind(null,"Load timeout for: "+c),a||15E3),j=document.createElement("iframe");j.name=c+"_"+(new Date).getTime();if(!b.visible)j.style.display="none",j.style.visibility="hidden";j.src=c;j.onload=function(){clearTimeout(d);setTimeout(h.bind(null,"Plugin handshake timeout for: "+c),5E3)};j.sandbox="allow-scripts allow-same-origin";document.body.appendChild(j);e.target=j.contentWindow;e.close=function(){j&&
(document.body.removeChild(j),j=null)};s.push(e);return e},disconnect:function(b){for(var c=0;c<s.length;c++)if(b===s[c]){s.splice(c,1);try{b.close()}catch(a){}break}},removePlugin:function(b){for(var c=0;c<m.length;c++)if(b===m[c]){m.splice(c,1);break}l.removeItem("plugin."+b.getLocation())},persist:function(b,c){l.setItem("plugin."+b,JSON.stringify(c))},postMessage:function(b,c){c.target.postMessage(c.useStructuredClone?b:JSON.stringify(b),c.url)},dispatchEvent:function(b){try{r.dispatchEvent(b)}catch(c){console&&
console.log("PluginRegistry.dispatchEvent "+c)}},loadManifest:function(b){var c=new g,a=i.connect(b,function(b){a&&b.method&&("manifest"===b.method||"plugin"===b.method?(b=b.params[0],i.disconnect(a),a=null,c.resolve(b)):"timeout"===b.method&&(i.disconnect(a),a=null,c.reject(b.error)))});return c.promise},getState:function(){return n},handleServiceError:function(b,c){if(c&&c.status===401){var a=b.getHeaders(),h=b.getName()||b.getLocation(),e=document.createElement("span");e.appendChild(document.createTextNode("Authentication required for: "+
h+"."));if(a.login)e.appendChild(document.createTextNode(" ")),h=document.createElement("a"),h.target="_blank",h.textContent="Login",h.href=a.login,j.test(h.href)?(e.appendChild(h),e.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+a.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(e)}}if(c.__isError){var d=c,c=Error(d.message);Object.keys(d).forEach(function(b){c[b]=d[b]});delete c.__isError}return c}};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=i.getState;this.init=function(){if(!(n==="starting"||n==="active"||n==="stopping")){addEventListener("message",h,!1);for(var c=[],o=0,a=l.length;o<a;o++)c.push(l.key(o));c.forEach(function(b){if(b.indexOf("plugin.")===0){var c=b.substring(7),b=JSON.parse(l.getItem(b));b.created&&m.push(new e(c,b,i))}});
m.sort(function(b,c){return b._getCreated()<c._getCreated()?-1:1});b.plugins&&Object.keys(b.plugins).forEach(function(c){c=f(c);if(!this.getPlugin(c)){var o=b.plugins[c],o=typeof o==="object"||{};o.autostart=o.autostart||b.defaultAutostart||"lazy";m.push(new e(c,o,i))}}.bind(this));n="starting"}};this.start=function(){n!=="starting"&&this.init();if(n!=="starting")return(new g).reject("Cannot start framework. Framework is already "+n+".");var b=[],c=(new Date).getTime();m.forEach(function(a){var h=
a._getAutostart();a.getLastModified()===0?b.push(a.update().then(function(){if("started"===h)return a.start({"transient":!0});if("lazy"===h)return a.start({lazy:!0,"transient":!0});a._resolve()})):"started"===h?b.push(a.start({"transient":!0})):"lazy"===h?(b.push(a.start({lazy:!0,"transient":!0})),c>a.getLastModified()+864E5&&a.update()):a._resolve()});return g.all(b,function(b){console.log("PluginRegistry.stop "+b)}).then(function(){n="active"})};this.stop=function(){if(n!=="starting"&&n!=="active")return(new g).reject("Cannot stop registry. Registry is already "+
n+".");n="stopping";var b=[];m.forEach(function(c){b.push(c.stop({"transient":!0}))});return g.all(b,function(b){console.log("PluginRegistry.stop "+b)}).then(function(){removeEventListener("message",h);n="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new g).reject("Cannot uninstall registry")};this.installPlugin=function(b,c){var b=f(b),h=this.getPlugin(b);if(h)return(new g).resolve(h);if(q[b])return q[b];if(c)return h=new e(b,c,i),m.push(h),
h._persist(),i.dispatchEvent(new a("installed",h)),(new g).resolve(h);var d=i.loadManifest(b).then(function(c){h=new e(b,c,i);m.push(h);h._persist();delete q[b];i.dispatchEvent(new a("installed",h));return h},function(c){delete q[b];throw c;});return q[b]=d};this.getPlugins=function(){return m.slice()};this.getPlugin=function(b){var c=null,b=f(b);m.some(function(a){if(b===a.getLocation())return c=a,!0});return c};this.addEventListener=r.addEventListener.bind(r);this.removeEventListener=r.removeEventListener.bind(r);
this.resolvePlugins=function(){var b=!0;m.forEach(function(c){b=b&&c._resolve()});return b}}}});
define("orion/serviceTracker",[],function(){function g(f,d){function a(b){var a=b.getProperty("service.id"),h=this.addingService(b);h&&(j[a]=b,c[a]=h)}function e(b){var a=b.getProperty("service.id"),h=c[a];delete j[a];delete c[a];this.removedService(b,h)}this.serviceRegistry=f;var j={},c={},b=k,h,l;this.close=function(){if(b!==i)throw"Already closed";b=k;f.removeEventListener("registered",h);f.removeEventListener("unregistering",l);l=h=null;var c=this;this.getServiceReferences().forEach(function(b){e.call(c,
b)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){return j.length?Object.keys(j).map(function(b){return j[b]}):null};this.open=function(){if(b!==k)throw"Already open";b=i;var c=this;h=function(b){if(b.serviceReference.getProperty("objectClass").indexOf(d)!==-1&&(a.call(c,b.serviceReference),typeof c.onServiceAdded==="function"))return c.onServiceAdded(b.serviceReference,c.serviceRegistry.getService(b.serviceReference))};l=function(b){b.serviceReference.getProperty("objectClass").indexOf(d)!==
-1&&e.call(c,b.serviceReference)};f.addEventListener("registered",h);f.addEventListener("unregistering",l);f.getServiceReferences(d).forEach(function(b){a.call(c,b)});if(typeof this.onOpen==="function")this.onOpen()}}var k=0,i=1;g.prototype={addingService:function(f){return this.serviceRegistry.getService(f)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return g});
define("orion/config",["orion/Deferred","orion/serviceTracker"],function(g,k){var i,f,d,a,e,j="pid";i=function(b,c,a){function e(b,a,d){a.forEach(function(o,e){try{var j=b[e].getProperty("__plugin__"),f=j&&c.getPlugin(j);(!j||f&&f.getState()==="active")&&a[e].updated(d)}catch(l){typeof console!=="undefined"&&console.log(l)}})}k.call(this,b,"orion.cm.managedservice");var d={},f={},r=function(c){var h=[];c.plugin.getServiceReferences().forEach(function(c){if(c.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var o=c.getProperty(j),c=b.getService(c);o&&c&&(o=(o=a._find(o))&&o.getProperties(),h.push(c.updated(o)))}});return g.all(h)};this.addingService=function(c){var a=c.getProperty(j),h=b.getService(c);if(!a||!h)return null;d[a]||(d[a]=[]);f[a]||(f[a]=[]);d[a].push(c);f[a].push(h);return h};this.onServiceAdded=function(b,c){var h=b.getProperty(j),h=a._find(h);e([b],[c],h&&h.getProperties())};this.onOpen=function(){c.addEventListener("started",r)};this.onClose=function(){c.removeEventListener("started",
r)};this.notifyUpdated=function(b){var c=b.getPid();e(d[c]||[],f[c]||[],b.getProperties())};this.notifyDeleted=function(b){b=b.getPid();e(d[b]||[],f[b]||[],null)};this.removedService=function(b,c){var a=b.getProperty(j),o=d[a],h=f[a];o.length>1?o.splice(o.indexOf(b),1):delete d[a];h.length>1?h.splice(h.indexOf(c),1):delete f[a]}};f=function(){function b(b,c,e){this.store=new d(this,e);this.configAdmin=new a(this,this.store);this.tracker=new i(b,c,this.store)}b.prototype={getConfigurationAdmin:function(){var b=
this;return this.configAdmin._init().then(function(c){b.tracker.open();return c})},notifyDeleted:function(b){this.tracker.notifyDeleted(b)},notifyUpdated:function(b){this.tracker.notifyUpdated(b)}};return b}();a=function(){function b(b,c){this.factory=b;this.store=c}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 c="/cm/configurations";
d=function(){function b(b,a){this.factory=b;this.prefsService=a;this.configs=Object.create(null);this.pref=null;var d=this;this.initPromise=this.prefsService.getPreferences(c).then(function(b){d.pref=b;b.keys().forEach(function(c){if(!d.configs[c]){var a=b.get(c);typeof a==="object"&&a!==null&&Object.keys(a).length>0&&(a[j]=c,d.configs[c]=new e(d.factory,d,a))}})})}b.prototype={_init:function(){return this.initPromise},_find:function(b){return this.configs[b]||null},get:function(b){var c=this._find(b);
c||(c=new e(this.factory,this,b),this.configs[b]=c);return c},list:function(){var b=this,c=[];this.pref.keys().forEach(function(a){(a=b._find(a))&&a.getProperties()!==null&&c.push(a)});return c},remove:function(b){this.pref.remove(b);delete this.configs[b]},save:function(b,c){this.pref.put(b,c.getProperties(!0)||{})}};return b}();e=function(){function b(b){for(var c={},a=Object.keys(b),e=0;e<a.length;e++){var h=a[e],d=b[h];c[h]=d instanceof Array?d.slice():d}return c}function c(a,e,h){this.factory=
a;this.store=e;if(h!==null&&typeof h==="object")this.pid=h[j],a=b(h),delete a[j],this.properties=a;else if(typeof h==="string")this.pid=h,this.properties=null;else throw Error("Invalid pid/properties "+h);}c.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(c){this._checkRemoved();var a=null;if(this.properties&&(a=b(this.properties),!c))a[j]=this.pid;return a},remove:function(){this._checkRemoved();
this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=!0},update:function(c){this._checkRemoved();c=b(c);delete c[j];this.properties=c;this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return c}();return{ConfigurationAdminFactory:f}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(g,k,i,f,d,a){var e;return{startup:function(){if(e)return e;e=new k;var j=new i.ServiceRegistry,c=new f.PreferencesService(j);return c.getPreferences("/plugins").then(function(b){var h={plugins:{}};b.keys().forEach(function(c){var a=g.toUrl(c);h.plugins[a]=b[c]});var f=new d.PluginRegistry(j,h);return f.start().then(function(){if(j.getServiceReferences("orion.core.preference.provider").length>
0)return c.getPreferences("/plugins",c.USER_SCOPE).then(function(b){var c=[];b.keys().forEach(function(b){b=g.toUrl(b);f.getPlugin(b)||c.push(f.installPlugin(b,{autostart:"lazy"}).then(function(b){return b.update().then(function(){return b.start({lazy:!0})})}))});return k.all(c,function(b){console.log(b)})})}).then(function(){return(new a.ConfigurationAdminFactory(j,f,c)).getConfigurationAdmin().then(j.registerService.bind(j,"orion.cm.configadmin"))}).then(function(){var b=j.getService("orion.core.auth");
if(b){var c=b.getUser().then(function(c){if(c)localStorage.setItem("lastLogin",(new Date).getTime());else return b.getAuthForm(window.location.href).then(function(b){setTimeout(function(){window.location=b},0)})}),a=localStorage.getItem("lastLogin");if(!a||a<(new Date).getTime()-9E5)return c}}).then(function(){var b={serviceRegistry:j,preferences:c,pluginRegistry:f};e.resolve(b);return b})})}}});
define("orion/webui/littlelib",[],function(){function g(a,c){c||(c=document);return c.querySelectorAll(a)}function k(a,c){var b=a.compareDocumentPosition(c);return a===c||Boolean(b&16)}function i(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var c=0;c<a.childNodes.length;c++){var b=i(a.childNodes[c]);if(b)return b}return null}function f(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var c=a.childNodes.length-1;c>=0;c--){var b=f(a.childNodes[c]);if(b)return b}return null}function d(e,
c){if(e.nodeType===3){var b=a.exec(e.nodeValue);b&&b.length>1&&c(e,b)}if(e.hasChildNodes())for(b=0;b<e.childNodes.length;b++)d(e.childNodes[b],c)}var a=/\$\{([^\}]+)\}/,e=[];return{$:function(a,c){c||(c=document);return c.querySelector(a)},$$:g,$$array:function(a,c){return Array.prototype.slice.call(g(a,c))},node:function(a){var c=a;typeof a==="string"&&(c=document.getElementById(a));return c},contains:k,bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+document.body.scrollLeft,top:a.top+
document.body.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:i,lastTabbable:f,stop:function(a){window.document.all?a.keyCode=0:(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,c){d(a,function(b,a){b.parentNode.replaceChild(document.createTextNode(c[a[1]]||a[1]),b)})},processDOMNodes:function(a,c){d(a,function(b,a){var e=c[a[1]];if(e){var d=document.createRange(),j=a.index;d.setStart(b,j);d.setEnd(b,
j+a[0].length);d.deleteContents();d.insertNode(e)}})},addAutoDismiss:function(a,c){e.length===0&&document.addEventListener("click",function(b){for(var c=[],a=0;a<e.length;a++){var d=e[a].dismiss,j=!1,f;if(e[a].excludeNodes.every(function(c){return c&&(j=document.compareDocumentPosition(document,c)!==1)&&k(c,b.target)?(f=c,!1):!0})){try{d()}catch(r){typeof console!=="undefined"&&console&&console.error(r&&r.message)}j=document.compareDocumentPosition(document,f)!==1}j&&c.push(e[a])}e=c},!0);e.push({excludeNodes:a,
dismiss:c})},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("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor","Filter bindings":"Filter bindings","Orion Editor":"Orion 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",
" is already a favorite.":" is already a favorite.","Add to the favorites list":"Add to the favorites list","Make Favorite":"Make Favorite","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 "," has been added to the favorites list.":" has been added to the favorites list.",Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy",
"Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"I20130625-1555","Add this page to the favorites list":"Add this page to the favorites list","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?","Orion Home":"Orion Home","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations",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","Are you sure you want to delete '${0}' from the favorites?":"Are you sure you want to delete '${0}' from the favorites?","Are you sure you want to delete these ${0} favorites?":"Are you sure you want to delete these ${0} favorites?","You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the More menu.":"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the More menu.",
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","Open in new tab":"Open in new tab","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."});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(g,k){var i={root:k};Object.keys(g).forEach(function(f){typeof i[f]==="undefined"&&(i[f]=g[f])});return i});
define("text",["module"],function(g){var k,i,f=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],d=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,e=typeof location!=="undefined"&&location.href,j=e&&location.protocol&&location.protocol.replace(/\:/,""),c=e&&location.hostname,b=e&&(location.port||void 0),h=[],l=g.config&&g.config()||{};k={version:"2.0.5",strip:function(b){if(b){var b=b.replace(d,""),c=b.match(a);c&&(b=c[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:l.createXhr||function(){var b,c,a;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(c=0;c<3;c+=1){a=f[c];try{b=new ActiveXObject(a)}catch(e){}if(b){f=[a];break}}return b},parseName:function(b){var c,
a,e=!1,h=b.indexOf(".");c=b.indexOf("./")===0||b.indexOf("../")===0;h!==-1&&(!c||h>1)?(c=b.substring(0,h),a=b.substring(h+1,b.length)):c=b;b=a||c;h=b.indexOf("!");h!==-1&&(e=b.substring(h+1)==="strip",b=b.substring(0,h),a?a=b:c=b);return{moduleName:c,ext:a,strip:e}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(b,c,a,e){var h,d;h=k.xdRegExp.exec(b);if(!h)return!0;b=h[2];h=h[3];h=h.split(":");d=h[1];h=h[0];return(!b||b===c)&&(!h||h.toLowerCase()===a.toLowerCase())&&(!d&&!h||d===e)},finishLoad:function(b,
c,a,e){a=c?k.strip(a):a;l.isBuild&&(h[b]=a);e(a)},load:function(a,h,d,f){if(f.isBuild&&!f.inlineText)d();else{l.isBuild=f.isBuild;var g=k.parseName(a),f=g.moduleName+(g.ext?"."+g.ext:""),i=h.toUrl(f),t=l.useXhr||k.useXhr;!e||t(i,j,c,b)?k.get(i,function(b){k.finishLoad(a,g.strip,b,d)},function(b){d.error&&d.error(b)}):h([f],function(b){k.finishLoad(g.moduleName+"."+g.ext,g.strip,b,d)})}},write:function(b,c,a){if(h.hasOwnProperty(c)){var e=k.jsEscape(h[c]);a.asModule(b+"!"+c,"define(function () { return '"+
e+"';});\n")}},writeFile:function(b,c,a,h,e){var c=k.parseName(c),d=c.ext?"."+c.ext:"",j=c.moduleName+d,o=a.toUrl(c.moduleName+d)+".js";k.load(j,a,function(){var c=function(b){return h(o,b)};c.asModule=function(b,c){return h.asModule(b,o,c)};k.write(b,j,c,e)},e)}};if(l.env==="node"||!l.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)i=require.nodeRequire("fs"),k.get=function(b,c){var a=i.readFileSync(b,"utf8");a.indexOf("\ufeff")===0&&(a=a.substring(1));c(a)};else if(l.env===
"xhr"||!l.env&&k.createXhr())k.get=function(b,c,a,h){var e=k.createXhr(),d;e.open("GET",b,!0);if(h)for(d in h)h.hasOwnProperty(d)&&e.setRequestHeader(d.toLowerCase(),h[d]);if(l.onXhr)l.onXhr(e,b);e.onreadystatechange=function(){var h;if(e.readyState===4)h=e.status,h>399&&h<600?(h=Error(b+" HTTP status: "+h),h.xhr=e,a(h)):c(e.responseText)};e.send(null)};else if(l.env==="rhino"||!l.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")k.get=function(b,c){var a,h,e=new java.io.File(b),d=java.lang.System.getProperty("line.separator"),
e=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(e),"utf-8")),j="";try{a=new java.lang.StringBuffer;(h=e.readLine())&&h.length()&&h.charAt(0)===65279&&(h=h.substring(1));for(a.append(h);(h=e.readLine())!==null;)a.append(d),a.append(h);j=String(a.toString())}finally{e.close()}c(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(g,k,i){return{slideoutHTMLFragment:function(f){var d=document.createElement("div");d.innerHTML=i;var a=k.$("#slideContainer",d);a.id=f+a.id;a=k.$("#pageCommandParameters",d);a.id=f+a.id;a=k.$("#pageCommandDismiss",d);a.id=f+a.id;return d.innerHTML}}});
define("orion/util",[],function(){var g=navigator.userAgent,k=parseFloat(g.split("MSIE")[1])||void 0,i=parseFloat(g.split("Firefox/")[1]||g.split("Minefield/")[1])||void 0,f=g.indexOf("Opera")!==-1,d=parseFloat(g.split("Chrome/")[1])||void 0,a=g.indexOf("Safari")!==-1&&!d,e=parseFloat(g.split("WebKit/")[1])||void 0,j=g.indexOf("Android")!==-1,c=g.indexOf("iPad")!==-1,g=g.indexOf("iPhone")!==-1,b=c||g,h=navigator.platform.indexOf("Mac")!==-1,l=navigator.platform.indexOf("Win")!==-1,n=navigator.platform.indexOf("Linux")!==
-1;return{formatMessage:function(b){var c=arguments;return b.replace(/\$\{([^\}]+)\}/g,function(b,a){return c[(a<<0)+1]})},createElement:function(b,c){return b.createElementNS?b.createElementNS("http://www.w3.org/1999/xhtml",c):b.createElement(c)},isIE:k,isFirefox:i,isOpera:f,isChrome:d,isSafari:a,isWebkit:e,isAndroid:j,isIPad:c,isIPhone:g,isIOS:b,isMac:h,isWindows:l,isLinux:n,platformDelimiter:l?"\r\n":"\n"}});
define("orion/keyBinding",["orion/util"],function(g){function k(f,d,a,e,j,c){this.type=c||"keydown";this.keyCode=typeof f==="string"&&this.type==="keydown"?f.toUpperCase().charCodeAt(0):f;this.mod1=d!==void 0&&d!==null?d:!1;this.mod2=a!==void 0&&a!==null?a:!1;this.mod3=e!==void 0&&e!==null?e:!1;this.mod4=j!==void 0&&j!==null?j:!1}function i(f){this.keys=f}k.prototype={getKeys:function(){return[this]},match:function(f,d){if(d!==void 0){if(d!==0)return!1}else if(f instanceof Array){if(f.length>1)return!1;
f=f[0]}return f.type!==this.type?!1:this.keyCode===f.keyCode||this.keyCode===String.fromCharCode(g.isOpera?f.which:f.charCode!==void 0?f.charCode:f.keyCode)?this.mod1!==(g.isMac?f.metaKey:f.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==f.shiftKey?!1:this.mod3!==f.altKey?!1:g.isMac&&this.mod4!==f.ctrlKey?!1:!0:!1},equals:function(f){return!f?!1:this.keyCode!==f.keyCode?!1:this.mod1!==f.mod1?!1:this.mod2!==f.mod2?!1:this.mod3!==f.mod3?!1:this.mod4!==f.mod4?!1:this.type!==f.type?!1:!0}};i.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(f,d){var a=this.keys;if(d!==void 0)return d>a.length?!1:a[d].match(f)?d===a.length-1?!0:d+1:!1;else{f instanceof Array||(f=[f]);if(f.length>a.length)return!1;var e;for(e=0;e<f.length;e++)if(!a[e].match(f[e]))return!1;return e===a.length?!0:e}},equals:function(f){if(!f.keys)return!1;if(f.keys.length!==this.keys.length)return!1;for(var d=0;d<f.keys.length;d++)if(!f.keys[d].equals(this.keys[d]))return!1;return!0}};return{KeyBinding:k,KeyStroke:k,
KeySequence:i}});
define("orion/webui/dropdown",["require","orion/webui/littlelib"],function(g,k){function i(f){this._init(f)}i.prototype={_init:function(f){this._dropdownNode=k.node(f.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._triggerNode=k.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";this._populate=f.populate;var d=this;this._triggerNode.addEventListener("click",function(a){d.toggle()&&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)},toggle:function(){return this._triggerNode.classList.contains("dropdownTriggerOpen")?this.close():this.open()},open:function(){this._populate&&(this.empty(),this._populate(this._dropdownNode));var f=this.getItems();if(f.length>0){if(!this._hookedAutoDismiss){var d=k.$$(".dropdownSubMenu",
this._dropdownNode);k.addAutoDismiss([this._triggerNode].concat(Array.prototype.slice.call(d)),this.close.bind(this));this._hookedAutoDismiss=!0}this._triggerNode.classList.add("dropdownTriggerOpen");this._dropdownNode.classList.add("dropdownMenuOpen");this._positionDropdown();f[0].focus();return!0}return!1},_positionDropdown:function(){this._dropdownNode.style.left="";var f=k.bounds(this._dropdownNode),d=k.bounds(this._boundingNode(this._triggerNode));if(f.left+f.width>d.left+d.width)this._dropdownNode.style.right=
0},_boundingNode:function(f){return f.style.right!==""||f.style.position==="absolute"||!f.parentNode||!f.parentNode.style?f:this._boundingNode(f.parentNode)},close:function(f){this._triggerNode.classList.remove("dropdownTriggerOpen");this._dropdownNode.classList.remove("dropdownMenuOpen");f&&this._triggerNode.focus();return!0},getItems:function(){var f=[],d=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(a){a.parentNode.parentNode===d._dropdownNode&&
f.push(a)});return f},empty:function(){var f=this;k.$$array("li",this._dropdownNode).forEach(function(d){d.parentNode===f._dropdownNode&&d.parentNode.removeChild(d)})},_dropdownKeyDown:function(f){if(f.keyCode===k.KEY.UP||f.keyCode===k.KEY.DOWN||f.keyCode===k.KEY.RIGHT||f.keyCode===k.KEY.ENTER||f.keyCode===k.KEY.LEFT){var d=this.getItems(),a=document.activeElement;if(d.length&&d.length>0&&a){var e=d.indexOf(a);e<0&&(e=d.indexOf(a.parentNode));e>=0&&(f.keyCode===k.KEY.UP&&e>0?(e--,d[e].focus()):f.keyCode===
k.KEY.DOWN&&e<d.length-1?(e++,d[e].focus()):f.keyCode===k.KEY.ENTER||f.keyCode===k.KEY.RIGHT?a.classList.contains("dropdownTrigger")&&a.dropdown&&a.dropdown.open():f.keyCode===k.KEY.LEFT&&a.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),k.stop(f))}}else f.keyCode===k.KEY.ESCAPE&&(this.close(!0),k.stop(f))}};i.prototype.constructor=i;return{Dropdown:i}});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<span class="dropdownArrowDown"></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">${ButtonText}<span class="dropdownArrowRight"></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(g,k){function i(f){this._init(f)}i.prototype={_init:function(f){this._node=k.node(f.node);if(!this._node)throw"no dom node for tooltip found";this._position=f.position||["right","above","below","left"];this._text=f.text;this._hideDelay=f.hideDelay===void 0?200:f.hideDelay;this._tailSize=f.tailSize||10;this._trigger=f.trigger||"mouseover";this._afterShowing=f.afterShowing;this._afterHiding=f.afterHiding;var d=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",function(a){a.target===d._node&&(d.show(),k.stop(a))},!1);else if(this._trigger==="mouseover"){this._showDelay=f.showDelay===void 0?500:f.showDelay;f=["mouseout","click"];this._node.addEventListener("mouseover",function(a){k.contains(d._node,a.target)&&(d.show(),k.stop(a))},!1);for(var a=0;a<f.length;a++)this._node.addEventListener(f[a],function(a){k.contains(d._node,a.target)&&d.hide()},!1)}},_makeTipNode:function(){if(!this._tip){this._tip=
document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("span");this._tipInner.classList.add("tooltip");this._text&&this._tipInner.appendChild(document.createTextNode(this._text));this._tip.appendChild(this._tipInner);document.body.appendChild(this._tip);var f=this;k.addAutoDismiss([this._tip,this._node],function(){f.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(f._timeout)window.clearTimeout(f._timeout),f._timeout=null;f._tip.addEventListener("mouseout",function(d){k.contains(f._tip,d.target)&&(f.hide(),k.stop(d))},!1)},!1)}return this._tip},_positionTip:function(f,d){this._makeTipNode();f==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var a=this._node,e;for(e=k.bounds(a);a&&!e.width&&!e.height;a=a.parentNode)e=
k.bounds(a);var a=k.bounds(this._tipInner),j;switch(f){case "above":j=e.top-a.height-this._tailSize-1;e=e.left-this._tailSize;break;case "below":j=e.top+e.height+this._tailSize+1;e=e.left-this._tailSize;break;case "left":j=e.top-this._tailSize/2;e=e.left-a.width-this._tailSize-1;break;default:j=e.top-this._tailSize/2,e=e.left+e.width+this._tailSize+1}var c=k.bounds(document.documentElement);if(j+a.height>c.height)if(d)j=c.height-a.height-1;else return!1;if(e+a.width>c.width)if(d)e=c.width-a.width-
1;else return!1;if(e<0)if(d)e=4;else return!1;if(j<0)if(d)j=4;else return!1;if(!this._tail&&(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+f),f==="above"||f==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),f==="left"))this._tail.style.left=a.width+"px";this._tip.style.top=j+"px";this._tip.style.left=e+"px";this._tip.style.width=a.width+"px";this._tip.style.height=a.height+"px";return!0},contentContainer:function(){this._makeTipNode();
return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){var f=this;if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){for(var d=!1,a=0;!d&&a<f._position.length;)d=f._positionTip(f._position[a]),a++;d||f._positionTip(f._position[0],!0);f._tip.classList.add("tooltipShowing");f._afterShowing&&f._afterShowing()},this._showDelay)}},hide:function(f){if(this._timeout)window.clearTimeout(this._timeout),
this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(f===void 0)f=this._hideDelay;var d=this;this._timeout=window.setTimeout(function(){d._tip.classList.remove("tooltipShowing");d._tip.removeAttribute("style");d._afterHiding&&d._afterHiding()},f)}},destroy:function(){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip)document.body.removeChild(this._tip),this._tail=this._tipInner=this._tip=null}};i.prototype.constructor=i;return{Tooltip:i}});
define("orion/commands","require,orion/util,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip".split(","),function(g,k,i,f,d,a,e,j){function c(b,c){for(var a in c)if(c[a]&&c[a].keyBinding&&c[a].command&&c[a].keyBinding.match(b)){var h=c[a],e=h.keyBinding;if(!e.domScope||i.contains(i.node(e.domScope),b.target)){var o=h.invocation;if(o){var d=h.command;if(d.hrefCallback){i.stop(b);
a=d.hrefCallback.call(o.handler||window,o);a.then?a.then(function(b){window.open(b)}):window.open(a);break}else if(d.onClick||d.callback){i.stop(b);window.setTimeout(function(){(d.onClick||d.callback).call(o.handler||window,o)},0);break}}}}}function b(b,c,a){c.classList.add("commandImage");var h;b.imageClass?b.addImageClassToElement?c.classList.add(b.imageClass):(h=document.createElement("span"),c.appendChild(h),h.classList.add(b.spriteClass),h.classList.add(b.imageClass)):(h=new Image,h.alt=b.name,
h.name=a,h.id=a,h.src=b.image,c.appendChild(h));return h}function h(b,c,a,h,e){this.commandRegistry=e;this.handler=b;this.items=c;this.userData=a;this.command=h;if(h.parameters)this.parameters=h.parameters.makeCopy();this.id=h.id}function l(b){this._init(b)}var n=null,m={};window.document.addEventListener("keydown",function(b){b=b||window.event;if(function(b){if(k.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}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 a=b.target.nodeName.toLowerCase();if(a==="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(a===
"textarea")return}a={};if(n){var h,e,d;e=Object.keys(m);for(h=0;h<e.length;h++)d=e[h],a[d]=m[d];var o=n();e=Object.keys(o);for(h=0;h<e.length;h++)d=e[h],a[d]=o[d]}else a=m;c(b,a)},!1);h.prototype={collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(b){var c=new h(this.handler,this.items,this.userData,this.command,this.commandRegistry);c.domNode=this.domNode;c.domParent=this.domParent;if(b)c.parameters=b.makeCopy();else if(this.parameters)c.parameters=
this.parameters.makeCopy();return c}};h.prototype.constructor=h;l.prototype={_init:function(b){this.id=b.id;this.name=b.name;this.tooltip=b.tooltip||b.name;this.callback=b.callback;this.hrefCallback=b.hrefCallback;this.choiceCallback=b.choiceCallback;this.image=b.image||g.toUrl("images/none.png");this.imageClass=b.imageClass;this.addImageClassToElement=b.addImageClassToElement;this.spriteClass=b.spriteClass||"commandSprite";this.visibleWhen=b.visibleWhen;this.parameters=b.parameters},populateChoicesMenu:function(b,
c,a,h,e){this.getChoices(c,a,h).forEach(function(a){if(a.name){var h=document.createElement("li");b.appendChild(h);var d=document.createElement("span");d.tabIndex=0;d.role="menuitem";d.classList.add("dropdownMenuItem");var j=document.createTextNode(a.name);d.appendChild(j);h.appendChild(d);d.choice=a;d.addEventListener("click",function(b){b.target.choice&&b.target.choice.callback.call(b.target.choice,c)},!1);d.addEventListener("keydown",function(b){(b.keyCode===i.KEY.ENTER||b.keyCode===i.KEY.SPACE)&&
b.target.choice&&b.target.choice.callback.call(b.target.choice,c)},!1)}else e._generateMenuSeparator(b)})},getChoices:function(b,c,a){return this.choiceCallback?this.choiceCallback.call(c,b,a):null},makeChoiceCallback:function(b,c){return function(a){b.callback&&b.callback.call(b,c,a)}},hasImage:function(){return this.imageClass||this.image!==g.toUrl("images/none.png")}};l.prototype.constructor=l;return{Command:l,CommandInvocation:h,createDropdownMenu:function(c,a,h,e,j,o){c=i.node(c);if(!c)throw"no parent node was specified";
var l=document.createRange();l.selectNode(c);l=l.createContextualFragment(d);i.processTextNodes(l,{ButtonText:a});c.appendChild(l);c=c.lastChild;l=c.previousSibling;e?l.classList.add(e):(l.classList.add("orionButton"),l.classList.add("commandButton"));if(j){if(!o)l.textContent="",l.setAttribute("aria-label",a);b({spriteClass:"commandSprite",imageClass:j},l,a);l.classList.add("orionButton")}l.dropdown=new f.Dropdown({dropdown:c,populate:h});c.dropdown=l.dropdown;return{menuButton:l,menu:c,dropdown:l.dropdown}},
createCheckedMenuItem:function(b,c,a,h){b=i.node(b);if(!b)throw"no parent node was specified";var d=document.createRange();d.selectNode(b);d=d.createContextualFragment(e);i.processTextNodes(d,{ItemText:c});b.appendChild(d);b=i.$(".checkedMenuItem",b.lastChild);b.checked=a;b.addEventListener("change",h,!1)},createCommandItem:function(c,a,h,e,d,o,f){var l,o=o||!a.name&&a.hasImage();if(a.hrefCallback)l=document.createElement("a"),l.id=e,o&&a.hasImage()?b(a,l,e):(l.className="commandLink",l.appendChild(document.createTextNode(a.name))),
f=a.hrefCallback.call(h.handler,h),f.then?f.then(function(b){l.href=b}):l.href=f?f:"#";else{l=document.createElement("button");l.className="orionButton";o?a.hasImage()?(b(a,l,e),a.name&&l.setAttribute("aria-label",a.name)):(l.classList.add("commandButton"),l.classList.add("commandMissingImageButton"),l.appendChild(document.createTextNode(a.name))):(l.classList.add("commandButton"),e=document.createTextNode(a.name),l.appendChild(e));var u=f||a.callback;if(u)a.onClick=u,l.addEventListener("click",function(){u.call(h.handler,
h)},!1)}c.nodeName.toLowerCase()==="ul"?(f=document.createElement("li"),c.appendChild(f),c=f):l.classList.add("commandMargins");c.appendChild(l);if(a.tooltip)l.commandTooltip=new j.Tooltip({node:l,text:a.tooltip,position:["above","below","right","left"]});d&&(m[a.id]={keyBinding:d,command:a,invocation:h});return l},createCommandMenuItem:function(b,c,a,h,e){var o,d=b.dropdown;if(c.hrefCallback)o=document.createElement("a"),o.appendChild(document.createTextNode(c.name)),e=c.hrefCallback.call(a.handler,
a),e.then?e.then(function(b){o.href=b}):o.href=e?e:"#";else{o=document.createElement("span");o.tabIndex=0;o.appendChild(document.createTextNode(c.name));var f=e||c.callback;if(f)c.onClick=f,o.addEventListener("click",function(){d.close(!0);f.call(a.handler,a)},!1)}if(c.tooltip)o.commandTooltip=new j.Tooltip({node:o,text:c.tooltip,position:["right","left","above","below"]});o.className="dropdownMenuItem";o.role="menuitem";e=document.createElement("li");b.appendChild(e);e.appendChild(o);h&&(m[c.id]=
{keyBinding:h,command:c,invocation:a});return o},setKeyBindingProvider:function(b){n=b},localKeyBindings:m,_testMethodProcessKey:c}});
define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib"],function(g,k){function i(d){var a="",e=navigator.platform.indexOf("Mac")!==-1;d.mod1&&(a+=e?"Cmd+":"Ctrl+");d.mod2&&(a+="Shift+");d.mod3&&(a+="Alt+");d.mod4&&e&&(a+="Ctrl+");if(d.alphaKey)return a+d.alphaKey;if(d.type==="keypress")return a+d.keyCode;for(var j in k.KEY)if(typeof(k.KEY[j]==="number")&&k.KEY[j]===d.keyCode)return a+j;var c;switch(d.keyCode){case 59:c=d.mod2?":":";";break;case 61:c=d.mod2?"+":"=";break;case 188:c=
d.mod2?"<":",";break;case 190:c=d.mod2?">":".";break;case 191:c=d.mod2?"?":"/";break;case 192:c=d.mod2?"~":"`";break;case 219:c=d.mod2?"{":"[";break;case 220:c=d.mod2?"|":"\\";break;case 221:c=d.mod2?"}":"]";break;case 222:c=d.mod2?'"':"'"}return c?a+c:d.keyCode>=112&&d.keyCode<=123?a+"F"+(d.keyCode-111):a+String.fromCharCode(d.keyCode)}function f(d){var a=window.navigator.platform.indexOf("Mac")!==-1;return a&&d.metaKey||!a&&d.ctrlKey}return{getUserKeyString:function(d){for(var a="",d=d.getKeys(),
e=0;e<d.length;e++)e!==0&&(a+=" "),a+=i(d[e]);return a},getUserText:function(d,a,e,j,c,b,h,f,n){var m=!1,h=function(h){return function(f){if(!m){var l=k.node(d),g=l.value;if(l)if(h&&f.keyCode===k.KEY.ESCAPE){if(e)a.style.display="inline";m=!0;l.parentNode.removeChild(l);b&&b()}else if(!(h&&f.keyCode!==k.KEY.ENTER)){if(g.length===0||!n&&g===j){if(e)a.style.display="inline"}else c(g);m=!0;l.parentNode&&l.parentNode.removeChild(l);b&&b()}}}},g=document.createElement("input");g.id=d;g.value=j||"";a.parentNode.insertBefore(g,
a.nextSibling);g.classList.add("userEditBoxPrompt");if(e)a.style.display="none";g.addEventListener("keydown",h(!0),!1);g.addEventListener("blur",h(!1),!1);window.setTimeout(function(){g.focus();if(j){var b=k.node(d),c=f?j.indexOf(f):-1;if(c>0)if(b.createTextRange)b=b.createTextRange(),b.collapse(!0),b.moveStart("character",0),b.moveEnd("character",c),b.select();else if(b.setSelectionRange)b.setSelectionRange(0,c);else{if(b.selectionStart!==void 0)b.selectionStart=0,b.selectionEnd=c}else b.select()}},
0)},openInNewWindow:f,followLink:function(d,a){a&&f(a)?window.open(d):window.location=d},createButton:function(d,a){var e=document.createElement("button");e.className="orionButton commandButton commandMargins";e.addEventListener("click",function(e){a();k.stop(e)},!1);d&&e.appendChild(document.createTextNode(d));return e},createDropdownButton:function(){}}});
define("orion/PageUtil",[],function(){var g=/^(?:[a-zA-Z0-9-_.!~*'()#;,\/?:@&=+$\[\]]|%[0-9A-F][0-9A-F])*$/,k=/^http[s]?/i;return{matchResourceParameters:function(i){var i=i||window.location.toString(),f={resource:""},d=i.indexOf("#");if(d!==-1&&(i=i.substring(d+1),i.length!==0)){i=i.split(",");Object.defineProperty(f,"resourceRaw",{value:i[0]});f.resource=decodeURIComponent(i[0]);if(!f.resource.match(g))f.resource=encodeURI(f.resource).replace(/%5B/g,"[").replace(/%5D/g,"]");for(d=1;d<i.length;d++){var a=
/([^=]*)(=?)(.*)/.exec(i[d]),e=decodeURIComponent(a[1]||""),a=decodeURIComponent(a[3]||"");e!==""&&e!=="resource"&&(f[e]=a)}}return f},validateURLScheme:function(g,f){var d=g;if(g.indexOf("://")===-1){var a=document.createElement("a");a.href=g;d=a.href}a=!1;return(a=f?f.some(function(a){return RegExp("^"+a+":","i").test(d)}):k.test(d))?g:(console.log("Illegal URL Scheme: '"+g+"'"),"")}}});
define("orion/explorers/navigationUtils",[],function(){function g(g,f){if(!k&&g)g.push({domNode:f}),f.tabIndex=-1,f.style.outline="none"}var k=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(i,f,d){i&&(i=i.getGridNavHolder(f,!0))&&g(i,d)},generateNavGrid:g,removeNavGrid:function(g,f){if(g)for(var d=0;d<g.length;d++)if(g[d].domNode===f){g.splice(d,1);break}}}});
define("orion/commandRegistry","require,orion/commands,orion/uiUtils,orion/PageUtil,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip,orion/explorers/navigationUtils".split(","),function(g,k,i,f,d,a,e,j,c,b,h){function l(b){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(b);this._parameterCollector=
null}function n(b,c){this.token=b;this.parameterName=c}function m(b,c,a,h,o){this.name=b;this.type=c;this.label=a;this.value=h;this.lines=o||1}function s(b,c,a){this._storeParameters(b);this._hasOptionalParameters=c&&c.hasOptionalParameters;this._options=c;this.optionsRequested=!1;this.getParameters=a;this.clientCollect=c&&c.clientCollect}l.prototype={_init:function(b){this._selectionService=b.selection;var c=this;k.setKeyBindingProvider(function(){return c._activeBindings})},processURL:function(b){for(var c in this._urlBindings)if(this._urlBindings[c]&&
this._urlBindings[c].urlBinding&&this._urlBindings[c].command){var a=this._urlBindings[c].urlBinding.match(b);if(a){var h=this._urlBindings[c],o=h.command,e=h.invocation;if(e&&e.parameters&&o.callback){e.parameters.setValue(a.parameterName,a.parameterValue);var d=this;window.setTimeout(function(){d._invoke(e)},0);break}}}},findCommand:function(b){return this._commandList[b]},runCommand:function(b,c,a,h){c?(b=this._commandList[b])&&(b.visibleWhen?b.visibleWhen(c):1)&&b.callback&&this._invoke(new k.CommandInvocation(a,
c,null,b,this),h):(c=this._urlBindings[b])&&c.command&&c.command.callback&&this._invoke(c.invocation,h)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(b){this._parameterCollector=b},openParameterCollector:function(b,c,a){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(b,c,a))},confirm:function(b,c,a,h,o,e){var d=!1;if(this._parameterCollector&&!o){var j=this;this._parameterCollector.close();if(this._parameterCollector.open(b,
function(b,o){var e=document.createElement("span");e.classList.add("parameterPrompt");e.textContent=c;b.appendChild(e);e=document.createElement("button");e.addEventListener("click",function(){d=!0;j._parameterCollector.close()},!1);o.appendChild(e);e.appendChild(document.createTextNode(a));e.className="dismissButton";var f=document.createElement("button");f.addEventListener("click",function(){d=!1;j._parameterCollector.close()},!1);o.appendChild(f);f.appendChild(document.createTextNode(h));f.className=
"dismissButton";return e},function(){e(d)}))return}d=window.confirm(c);e(d)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(b,c){return this._collectAndInvoke(b.makeCopy(c),!1)},_collectAndInvoke:function(c,a){if(c)if(this._parameterCollector&&c.parameters&&c.parameters.hasParameters()&&(a||c.parameters.shouldCollectParameters())){var h=!1;c.parameters.updateParameters(c);
if(c.parameters.shouldCollectParameters()&&(h=this._parameterCollector.collectParameters(c),!h)){var e=new b.Tooltip({node:c.domNode,trigger:"click",position:["below","right","above","left"]}),h=e.contentContainer();h.classList.add("parameterPopup");var o=window.document.activeElement,d=this._parameterCollector.getFillFunction(c,function(){o&&o.focus();e.destroy()})(h);e.show();window.setTimeout(function(){d.focus();d.select()},0);h=!0}h||c.command.callback.call(c.handler||window,c)}else c.command.callback.call(c.handler||
window,c);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 c(b){var a=b.invocation;if(a)if(b=b.command,b.hrefCallback)a=b.hrefCallback.call(a.handler||window,a),a.then?a.then(function(b){window.open(b)}):window.open(a);else if(b.onClick||b.callback)(b.onClick||b.callback).call(a.handler||window,a)}function a(b){return function(){c(b)}}var h=
{},o,e,d=[],j;for(j in this._activeBindings)(e=this._activeBindings[j])&&e.keyBinding&&e.command&&d.push(e);d.sort(function(b,c){return b.command.name.localeCompare(c.command.name)});for(j=0;j<d.length;j++)e=d[j],e.keyBinding.scopeName?(h[e.keyBinding.scopeName]||(h[e.keyBinding.scopeName]=[]),h[e.keyBinding.scopeName].push(e)):(o=i.getUserKeyString(e.keyBinding),b.createItem(o,e.command.name,a(e)));for(var f in h)h[f].length&&h[f].length>0&&(b.createHeader(f),h[f].forEach(function(c){o=i.getUserKeyString(c.keyBinding);
b.createItem(o,c.command.name,a(c))}))},addCommand:function(b){this._commandList[b.id]=b;var c=this._pendingBindings[b.id];if(c){var a=this;c.forEach(function(c){a._addBinding(b,c.type,c.binding,c.bindingOnly)});delete this._pendingBindings[b.id]}},addCommandGroup:function(b,c,a,h,o,e,d,j){this._contributionsByScopeId[b]||(this._contributionsByScopeId[b]={});b=this._contributionsByScopeId[b];o&&(b=this._createEntryForPath(b,o));if(b[c]){if(h)b[c].title=h;if(a)b[c].position=a;if(d)b[c].imageClass=
d;if(j)b[c].tooltip=j;b[c].emptyGroupMessage=e}else b[c]={title:h,position:a,emptyGroupMessage:e,imageClass:d,tooltip:j,children:{}},b.sortedContributions=null},_createEntryForPath:function(b,c){c&&c.split("/").forEach(function(c){if(c.length>1)b[c]||(b[c]={position:0,children:{}}),b=b[c].children});return b},registerSelectionService:function(b,c){this._contributionsByScopeId[b]||(this._contributionsByScopeId[b]={});this._contributionsByScopeId[b].localSelectionService=c},registerCommandContribution:function(b,
c,a,h,o,e,d){this._contributionsByScopeId[b]||(this._contributionsByScopeId[b]={});b=this._contributionsByScopeId[b];h&&(b=this._createEntryForPath(b,h));b[c]={position:a};e&&((a=this._commandList[c])?this._addBinding(a,"key",e,o):this._addPendingBinding(c,"key",e,o));d&&((a=this._commandList[c])?this._addBinding(a,"url",d,o):this._addPendingBinding(c,"url",d,o));b.sortedContributions=null},_addBinding:function(b,c,a,h){if(!b.id)throw Error("No command id: "+b);c==="key"?this._activeBindings[b.id]=
{command:b,keyBinding:a,bindingOnly:h}:c==="url"&&(this._urlBindings[b.id]={command:b,urlBinding:a,bindingOnly:h})},_addPendingBinding:function(b,c,a,h){this._pendingBindings[b]=this._pendingBindings[b]||[];this._pendingBindings[b].push({type:c,binding:a,bindingOnly:h})},_checkForTrailingSeparator:function(b,c,a){var h;if(c==="tool"||c==="button")if((h=b.childNodes.length>0?b.childNodes[b.childNodes.length-1]:null)&&h.classList.contains("commandSeparator"))return a?(b.removeChild(h),!1):!0;if(c===
"menu"&&(b=d.$$array("li > *",b),b.length>0&&b[b.length-1].classList.contains("dropdownSeparator")))if(h=b[b.length-1],a)h.parentNode.parentNode.removeChild(h.parentNode);else return!0;return!1},renderCommands:function(b,c,a,h,e,j,f){if(typeof b!=="string")throw"a scope id for rendering must be specified";c=d.node(c);if(!c)throw"no parent";var l=this._contributionsByScopeId[b];if(!a&&l){var a=l.localSelectionService||this._selectionService,n=this;a&&a.getSelections(function(a){n.renderCommands(b,
c,a,h,e,j)})}else l&&(this._render(this._contributionsByScopeId[b],c,a,h,e||"button",j,f),this._checkForTrailingSeparator(c,e,!0))},destroy:function(b){b=d.node(b);if(!b)throw"no parent";for(;b.hasChildNodes();){var c=b.firstChild;c.commandTooltip&&c.commandTooltip.destroy();c.emptyGroupTooltip&&c.emptyGroupTooltip.destroy();this.destroy(c);b.removeChild(c)}},_render:function(c,a,e,d,o,j,f){var l=c.sortedContributions;if(!l){var l=[],n=!1,m;for(m in c)if(!c.hasOwnProperty||c.hasOwnProperty(m)){var g=
c[m];if(g&&typeof g.position==="number")g.id=m,l.push(g),n=!0}if(n)l.sort(function(b,c){return b.position-c.position}),c.sortedContributions=l}var i=0,s=this;l.forEach(function(c){var l,u;if(!c.imageClass)c.imageClass=null;if(c.children&&Object.getOwnPropertyNames(c.children).length>0){l=c.children;var n;if(o==="tool"||o==="button")if(c.title)n=s._createDropdownMenu(a,c.title,null,null,c.imageClass,c.tooltip),f&&h.generateNavGrid(f,n.menuButton),window.setTimeout(function(){s._render(c.children,n.menu,
e,d,"menu",j,f);s._checkForTrailingSeparator(n.menu,"menu",!0);if(n.menu.childNodes.length===0)if(c.emptyGroupMessage){if(!n.menuButton.emptyGroupTooltip)n.menuButton.emptyGroupTooltip=new b.Tooltip({node:n.menuButton,text:c.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})}else f&&h.removeNavGrid(f,n.menuButton),n.menu.parentNode&&n.menu.parentNode.removeChild(n.menu),n.destroyButton&&n.destroyButton.parentNode&&n.destroyButton.parentNode.removeChild(n.destroyButton);
else n.menuButton.style.visibility="visible"},0);else{var m;a.childNodes.length>0&&!s._checkForTrailingSeparator(a,o)&&(m=s.generateSeparatorImage(a));s._render(l,a,e,d,o,j,f);a.childNodes.length>0&&a.childNodes[a.childNodes.length-1]!==m&&(m=s.generateSeparatorImage(a))}else if(c.title){if(m=s._createDropdownMenu(a,c.title,!0,null,null,c.imageClass))s._render(l,m.menu,e,d,"menu",j,f),m.menu.childNodes.length===0&&m.destroyButton&&a.removeChild(m.destroyButton)}else a.childNodes.length>0&&s._generateMenuSeparator(a),
s._render(l,a,e,d,o,j,f),s._generateMenuSeparator(a)}else{var g=s._commandList[c.id];l=g?!0:!1;var w=null,w=null;if(g){u=new k.CommandInvocation(d,e,j,g,s);u.domParent=a;m=l&&(g.visibleWhen?g.visibleWhen(e):!0);if(s._activeBindings[g.id]&&s._activeBindings[g.id].keyBinding)w=s._activeBindings[g.id],w.invocation=m?u:null,w.bindingOnly&&(l=!1);if(s._urlBindings[g.id]&&s._urlBindings[g.id].urlBinding)w=s._urlBindings[g.id],w.invocation=m?u:null,w.bindingOnly&&(l=!1);l=l&&m}if(l)g.choiceCallback?(o===
"tool"||o==="button"?(l=a,m=!1,a.nodeName.toLowerCase()==="ul"&&(l=document.createElement("li"),a.appendChild(l))):(l=a,m=!0),s._createDropdownMenu(l,g.name,m,function(b){g.populateChoicesMenu(b,e,d,j,s)}.bind(g),g.imageClass,g.tooltip||g.title)):(u.handler=u.handler||this,u.domParent=a,m=function(){s._invoke(u)},o==="menu"?l=k.createCommandMenuItem(a,g,u,null,m):(l=o+g.id+i,l=k.createCommandItem(a,g,u,l,null,o==="tool",m)),h.generateNavGrid(f,l),u.domNode=l,i++)}})},_createDropdownMenu:function(c,
h,e,f,o,l){c=d.node(c);if(!c||!d.contains(document.body,c))return null;var n,u=c;if(e)l=document.createRange(),l.selectNode(c),l=l.createContextualFragment(j),d.processTextNodes(l,{ButtonText:h}),c.appendChild(l),n=c.lastChild,c=n.lastChild,h=c.previousSibling,h.dropdown=new a.Dropdown({dropdown:c,populate:f}),c.dropdown=h.dropdown;else if(c.nodeName.toLowerCase()==="ul"&&(u=document.createElement("li"),c.appendChild(u),n=u),c=null,o&&(c="dropdownButtonWithIcon",l=l||h),l=o?l||h:l,f=k.createDropdownMenu(u,
h,f,c,o),h=f.menuButton,c=f.menu,l)h.commandTooltip=new b.Tooltip({node:h,text:l,position:["above","below","right","left"]});return{menuButton:h,menu:c,dropdown:h.dropdown,destroyButton:n}},_generateMenuSeparator:function(b){if(!this._checkForTrailingSeparator(b,"menu")){var c=document.createElement("li");c.classList.add("dropdownSeparator");var a=document.createElement("span");a.classList.add("dropdownSeparator");c.appendChild(a);b.appendChild(c)}},generateSeparatorImage:function(b){var c;c=b.nodeName.toLowerCase()===
"ul"?document.createElement("li"):document.createElement("span");b.appendChild(c);c.classList.add("core-sprite-sep");c.classList.add("imageSprite");c.classList.add("commandSeparator");return c}};l.prototype.constructor=l;n.prototype={match:function(b){b=f.matchResourceParameters(b);return typeof b[this.token]!=="undefined"?(this.parameterValue=b[this.token],this):null}};n.prototype.constructor=n;m.prototype={optionsRequested:function(){return this.optionsRequested}};m.prototype.constructor=m;s.prototype=
{_storeParameters:function(b){this.parameterTable=null;if(b){var c=this.parameterTable={};b.forEach(function(b){c[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,c){var a=this.parameterTable[b];if(a)a.value=c},forEach:function(b){for(var c in this.parameterTable)this.parameterTable[c].type&&this.parameterTable[c].name&&b(this.parameterTable[c])},makeCopy:function(){var b=[];this.forEach(function(c){c=new m(c.name,c.type,c.label,c.value,c.lines);b.push(c)});var c=new s(b,this._options,this.getParameters);c.clientCollect=this.clientCollect;return c},hasOptionalParameters:function(){return this._hasOptionalParameters}};s.prototype.constructor=
s;return{CommandRegistry:l,URLBinding:n,ParametersDescription:s,CommandParameter:m}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(g,k,i){function f(d,a){this._activeContainer=null;this._getElementsFunction=d;this._toolbarLayoutFunction=a}f.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&i.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&i.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(d,a,e){typeof d==="string"&&(d=i.node(d));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===d)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(d))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=e;var j=a(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!j)return!1;this._activeElements.focusNode=j;d=i.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(d.length===0){a=this._activeElements.dismissArea||
this._activeElements.parameterArea;d=document.createElement("button");d.id="closebox";d.className="imageSprite core-sprite-close dismissButton";d.title=g.Close;a.appendChild(d);var c=this;d.addEventListener("click",function(){c.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);if(j)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){j.focus();j.select&&j.select()},0);this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(d,a){i.$$array("input",a).forEach(function(a){a.type==="checkbox"?d.parameters.setValue(a.parameterName,a.checked):a.type!=="button"&&d.parameters.setValue(a.parameterName,a.value.trim())});i.$$array("textArea",a).forEach(function(a){d.parameters.setValue(a.parameterName,a.value.trim())});d.command.callback&&d.command.callback.call(d.handler,d)},collectParameters:function(d){return d.parameters?
(d.domNode&&d.domNode.classList.add("commandMarker"),this.open(d.domNode||d.domParent,this.getFillFunction(d))):!1},getFillFunction:function(d,a){var e=this;return function(j,c){var b=null,h=function(){a&&a();e.close()},f=function(b){b.keyCode===i.KEY.ENTER&&e._collectAndCall(d,j);if(b.keyCode===i.KEY.ESCAPE||b.keyCode===i.KEY.ENTER)h(),i.stop(b)};d.parameters.forEach(function(c){var a=null;if(c.label)a=document.createElement("label"),a.classList.add("parameterInput"),a.setAttribute("for",c.name+
"parameterCollector"),a.textContent=c.label,j.appendChild(a);var e=c.name+"parameterCollector",d=a||j;if(c.type==="text"&&typeof c.lines==="number"&&c.lines>1)a=document.createElement("textarea"),a.rows=c.lines,a.type="textarea",a.id=e,d.appendChild(a),f=function(b){b.keyCode===i.KEY.ESCAPE&&(h(),i.stop(b))};else if(c.type==="boolean"){if(a=document.createElement("input"),a.type="checkbox",a.id=e,d.appendChild(a),c.value)a.checked=!0}else if(a=document.createElement("input"),a.type=c.type,a.id=e,
d.appendChild(a),c.value)a.value=c.value;a.classList.add("parameterInput");a.setAttribute("speech","speech");a.setAttribute("x-webkit-speech","x-webkit-speech");a.parameterName=c.name;b||(b=a);a.addEventListener("keydown",f,!1)});var n=c;if(!n)n=document.createElement("span"),n.className="layoutRight parametersDismiss",j.appendChild(n);var m=function(b,c){var a=document.createElement("button");c.appendChild(a);b&&a.appendChild(document.createTextNode(b));a.classList.add("dismissButton");return a};
if(d.parameters.hasOptionalParameters())d.parameters.optionsRequested=!1,m(g.More,n).addEventListener("click",function(){d.parameters.optionsRequested=!0;e._collectAndCall(d,j);h()},!1);m(g.Submit,n).addEventListener("click",function(){e._collectAndCall(d,j);h()},!1);n=m(null,n);n.id="closebox";n.classList.add("imageSprite");n.classList.add("core-sprite-close");n.title=g.Close;n.addEventListener("click",function(){h()},!1);return b}}};f.prototype.constructor=f;return{CommandParameterCollector:f}});
define("orion/editor/regex",[],function(){return{escape:function(g){return g.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(g){return(g=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(g))?{pattern:g[1],flags:g[2]}:null}}});
define("orion/contentTypes",[],function(){function g(a,e){function d(b,c,a,h){var a=c.filename.indexOf(a)>=0,e=c.extension.indexOf(h)>=0;if(a||e)if(!b||a&&b.extension.indexOf(h)>=0)return c;return b}for(var c=a&&a.split(".").pop(),b=null,h=0;h<e.length;h++){var f=e[h];d(b,f,a,c)===f&&(b=f)}return b}function k(a){this.serviceRegistry=a;this.map=function(a){function j(b){return b===null||typeof b==="undefined"?[]:b instanceof Array?b:[b]}for(var a=a.getServiceReferences(f).concat(a.getServiceReferences(d)),
c={},b=0;b<a.length;b++)for(var h=j(a[b].getProperty("contentTypes")),l=0;l<h.length;l++){var n=h[l];c[n.id]||(c[n.id]={id:n.id,name:n.name,image:n.image,"extends":n["extends"],extension:j(n.extension),filename:j(n.filename)})}return c}(a);a.registerService(i,this)}var i="orion.core.contenttypes",f="orion.core.contenttype",d="orion.file.contenttype";k.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),e=[],d;for(d in a)a.hasOwnProperty(d)&&e.push(a[d]);return e},getContentTypesMap:function(){return this.map},
getFileContentType:function(a){return g(a.Name,this.getContentTypes())},getFilenameContentType:function(a){return g(a,this.getContentTypes())},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,e){a=typeof a==="string"?this.getContentType(a):a;e=typeof e==="string"?this.getContentType(e):e;if(!a||!e)return!1;if(a.id===e.id)return!0;else for(var d=a,c={};d&&(d=this.getContentType(d["extends"]));){if(d.id===e.id)return!0;if(c[d.id])throw Error("Cycle: "+d.id);c[d.id]=!0}return!1},
isSomeExtensionOf:function(a,e){for(var d=0;d<e.length;d++)if(this.isExtensionOf(a,e[d]))return!0;return!1}};return{ContentTypeService:k,getFilenameContentType:g}});
define("orion/URITemplate",[],function(){function g(c){this._text=c}function k(c,b){if(b==="U")return encodeURIComponent(c).replace(/[!'()*]/g,function(b){return"%"+b.charCodeAt(0).toString(16).toUpperCase()});if(b==="U+R")return encodeURI(c).replace(/%5B/g,"[").replace(/%5D/g,"]");if(b==="U+R-,")return encodeURI(c).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+b);}function i(c,b,a){for(var e=[],d=0;d<c.length;d++)typeof c[d]!=="undefined"&&
e.push(k(c[d],b));return e.join(a)}function f(c,b,a,e){for(var d=Object.keys(c),j=[],f=0;f<d.length;f++)typeof c[d[f]]!=="undefined"&&j.push(k(d[f],b)+a+k(c[d[f]],b));return j.join(e)}function d(c){if(c.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=e[c[0]])?c=c.substring(1):this._operator=e.NUL;for(var b=[],a=c.split(","),d=0;d<a.length;d++){var f=a[d].match(j);if(f===null)throw Error("Bad VarSpec: "+c);b.push({name:f[1],explode:!!f[2],prefix:f[3]?parseInt(f[3],
10):-1})}this._varSpecList=b}function a(c){for(var b=[],a=0,e=c.indexOf("{",a);e!==-1;){b.push(new g(c.substring(a,e)));a=c.indexOf("}",e+1);if(a===-1)throw Error("Invalid template: "+c);b.push(new d(c.substring(e+1,a)));a+=1;e=c.indexOf("{",a)}b.push(new g(c.substring(a)));this._templateComponents=b}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-,"}},j=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/;g.prototype={expand:function(){return encodeURI(this._text)}};d.prototype={expand:function(c){for(var b=[],a=
0;a<this._varSpecList.length;a++){var e=this._varSpecList[a],d=e.name,j=c[d],g=typeof j;if(g!=="undefined"&&j!==null){var r=b.length===0?this._operator.first:this._operator.sep;if(g==="string")this._operator.named&&(r+=k(d,"U+R"),r+=j.length===0?this._operator.ifemp:"="),e.prefix!==-1&&e.prefix<j.length&&(j=j.substring(0,e.prefix)),r+=k(j,this._operator.allow);else if(Array.isArray(j))e.explode?r+=i(j,this._operator.allow,this._operator.sep):(this._operator.named&&(r+=k(d,"U+R"),r+=j.length===0?this._operator.ifemp:
"="),r+=i(j,this._operator.allow,","));else if(g==="object")e.explode?r+=f(j,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(r+=k(d,"U+R"),r+=Object.keys(j).length===0?this._operator.ifemp:"="),r+=f(j,this._operator.allow,",",","));else throw Error("bad param type: "+d+" : "+g);b.push(r)}}return b.join("")}};a.prototype={expand:function(c){for(var b=[],a=0;a<this._templateComponents.length;a++)b.push(this._templateComponents[a].expand(c));return b.join("")}};return a});
define("orion/i18nUtil",["require","orion/Deferred"],function(g,k){function i(d){if(d=localStorage.getItem("orion/messageBundle/"+d))if(d=JSON.parse(d),d._expires&&d._expires>(new Date).getTime())return delete d._expires,d;return null}var f={};return{getMessageBundle:function(d){function a(){g(["i18n!"+d],function(b){if(b){var c=d;b._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+c,JSON.stringify(b));delete b._expires}e.resolve(b)})}if(f[d])return f[d];var e=new k;f[d]=
e;var j=i(d);if(j)return e.resolve(j),e;try{g([d],a)}catch(c){g(["orion/i18n!"+d],a)}return e},formatMessage:function(d){var a=arguments;return d.replace(/\$\{([^\}]+)\}/g,function(e,d){return a[(d<<0)+1]})}}});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/URL-shim".split(","),function(g,k,i,f,d){function a(){return(new URL(g.toUrl("orion/../"),window.location.href)).href.slice(0,-1)}function e(e,c){var b=e.getServiceReferences(c||"orion.page.link"),h=i.matchResourceParameters(window.location.href),l={OrionHome:a(),Location:h.resource},n=[];b.forEach(function(b){var c={};b.getPropertyKeys().forEach(function(a){c[a]=b.getProperty(a)});if(c.uriTemplate&&
c.nls&&(c.name||c.nameKey)){var a=new k;d.getMessageBundle(c.nls).then(function(b){var h=new f(c.uriTemplate),h=window.decodeURIComponent(h.expand(l)),h=i.validateURLScheme(h);c.href=h;c.textContent=c.nameKey?b[c.nameKey]:c.name;a.resolve(c)});n.push(a)}else if(c.uriTemplate&&c.name){var h=new f(c.uriTemplate),h=window.decodeURIComponent(h.expand(l)),h=i.validateURLScheme(h);c.href=h;c.textContent=c.name;n.push((new k).resolve(c))}});return k.all(n)}return{createPageLinks:function(a,c){return e(a,
c).then(function(b){b.sort(function(b,c){var a=b.textContent&&b.textContent.toLowerCase(),e=c.textContent&&c.textContent.toLowerCase();return a<e?-1:a>e?1:0});return b.map(function(b){var c=b.href,b=b.textContent,a=document.createElement("a");a.href=c;a.target="_self";a.classList.add("targetSelector");a.textContent=b;return a})})},getPageLinksInfo:e,getOrionHome:a}});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/editor/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks".split(","),function(g,k,i,f,d,a,e,j,c){var b={},h=c.getOrionHome();b._cloneItemWithoutChildren=function m(b){if(b===null||typeof b!=="object")return b;var c=b.constructor(),a;for(a in b)a!=="children"&&a!=="Children"&&(c[a]=m(b[a]));return c};b._getOpenWithNavCommandExtensions=function(b){function c(b,a){for(var h=b.getServiceReferences("orion.navigate.openWith"),
e=[],o=0;o<h.length;o++){var d=h[o];d.getProperty("editor")===a.id&&(d=d.getProperty("contentType"),d instanceof Array?e=e.concat(d):d!==null&&typeof d!=="undefined"&&e.push(d))}return e}for(var a=function(){for(var c=b.getServiceReferences("orion.edit.editor"),a=[],h=0;h<c.length;h++){var e=c[h],o=e.getProperty("id");a.push({id:o,name:e.getProperty("name"),nameKey:e.getProperty("nameKey"),nls:e.getProperty("nls"),uriTemplate:e.getProperty("orionTemplate")||e.getProperty("uriTemplate")})}return a}(),
h=function(b){for(b=b.getServiceReferences("orion.navigate.openWith.default");0<b.length;)return{editor:b[0].getProperty("editor")};return null}(b),e=[],d=0;d<a.length;d++){var o=a[d],j=h&&h.editor===o.id,f=c(b,o);f.length&&e.push({properties:{name:o.name||o.id,nameKey:o.nameKey,id:"eclipse.openWithCommand."+o.id,tooltip:o.name,tooltipKey:o.nameKey,contentType:f,uriTemplate:o.uriTemplate,nls:o.nls,forceSingleItem:!0,isEditor:j?"default":"editor"},service:{}})}return e};b._makeValidator=function(b,
c,e,j){function f(b,c,a,e){var h=a.match,d;if(c.indexOf("|")>=0)return d=c.substring(0,c.indexOf("|")),c=c.substring(c.indexOf("|")+1),f(b,d,a,e)?!0:f(b,c,a,e);else if(c.indexOf(":")>=0)return d=c.substring(0,c.indexOf(":")),c=c.substring(c.indexOf(":")+1),b[d]?f(b[d],c,a,e):!1;else{a:{d=!1;var j;if(typeof b[c]!=="undefined"){if(typeof h==="undefined")j=b[c],d=!0;else if(typeof h==="string"){if(!typeof(b[c]==="string")){a=!1;break a}if(a.variableName){if(h=RegExp(h).exec(b[c]))d=h[0],j=a.variableMatchPosition===
"before"?b[c].substring(0,h.index):a.variableMatchPosition==="after"?b[c].substring(h.index+d.length):a.variableMatchPosition==="only"?d:b[c],d=!0}else{a=RegExp(h).test(b[c]);break a}}else b[c]===h&&(j=b[c],d=!0);if(d&&a.variableName&&(e[a.variableName]=j,e.itemCached=b,a.replacements))for(b=0;b<a.replacements.length;b++)c=!1,a.replacements[b].pattern?e[a.variableName]=e[a.variableName].replace(RegExp(a.replacements[b].pattern),a.replacements[b].replacement||""):c=!0,c&&window.console.log("Invalid replacements specified in validation property.  "+
a.replacements[b]);a=d}else a=!1}return a}}return{info:b,validationFunction:function(c){typeof j==="function"&&(c=j.call(this,c));if(c){if(Array.isArray(c)){if((this.info.forceSingleItem||this.info.uriTemplate)&&c.length!==1)return!1;if(c.length<1)return!1}else c=[c];for(var a=0;a<c.length;a++){var h;a:{var l=c[a],u=e;if(this.info.validationProperties)for(h=0;h<this.info.validationProperties.length;h++){var g=this.info.validationProperties[h];if(typeof g.source!=="undefined"){if(!f(l,g.source,g,this)){h=
!1;break a}}else{window.console.log("Invalid validationProperties in "+b.id+".  No source property specified.");h=!1;break a}}if(this.info.contentType&&u){g=!1;if(l=d.getFilenameContentType(l.Name,u))for(h=0;h<this.info.contentType.length;h++)if(l.id===this.info.contentType[h]){g=!0;break}h=g}else h=!0}if(!h)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(b){if(this.info.uriTemplate){var c={},e;for(e in b)b.hasOwnProperty(e)&&(c[e]=b[e]);if(this.info.validationProperties)for(e=
0;e<this.info.validationProperties.length;e++){var d=this.info.validationProperties[e];d.source&&d.variableName&&(this.itemCached===b&&this[d.variableName]||f(b,d.source,d,this),b[d.variableName]?window.console.log("Variable name "+d.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):c[d.variableName]=this[d.variableName])}c.OrionHome=h;b=new a(this.info.uriTemplate);return window.decodeURIComponent(b.expand(c))}return null}}};b._createCommandOptions=
function(c,a,h,d,j,f){function o(e,o){var l=b._makeValidator(c,h,d,f);e.visibleWhen=l.validationFunction.bind(l);if(j)if(l.generatesURI.bind(l)())e.hrefCallback=function(b){b=Array.isArray(b.items)?b.items[0]:b.items;return l.getURI.bind(l)(b)};else{var v=c;e.callback=function(c){var o;if(v.forceSingleItem)c=Array.isArray(c.items)?c.items[0]:c.items,o=b._cloneItemWithoutChildren(c);else if(Array.isArray(c.items)){o=[];for(var d=0;d<c.items.length;d++)o.push(b._cloneItemWithoutChildren(c.items[d]))}else o=
b._cloneItemWithoutChildren(c.items);if(h)var j=h.getService("orion.page.progress");a.run?j?j.progress(a.run(o),"Running command: "+e.name):a.run(o):h&&(j?j.progress(h.getService(a).run(o),"Running command: "+e.name):h.getService(a).run(o))}}o.resolve(e)}var l=new k;c.nls?e.getMessageBundle(c.nls).then(function(b){o({name:c.nameKey?b[c.nameKey]:c.name,image:c.image,id:c.id||c.name,tooltip:c.tooltipKey?b[c.tooltipKey]:c.tooltip,isEditor:c.isEditor,showGlobally:c.showGlobally},l)}):o({name:c.name,image:c.image,
id:c.id||c.name,tooltip:c.tooltip,isEditor:c.isEditor,showGlobally:c.showGlobally},l);return l};b.getOpenWithCommands=function(b){var c=[],a;for(a in b._commandList){var h=b._commandList[a];h.isEditor&&c.push(h)}return c};var l;b.createAndPlaceFileCommandsExtension=function(c,a,h,e,d,j){var o=!!j;return b.createFileCommands(c,null,j?"all":void 0,o).then(function(b){a._addedOpenWithCommands=o;var c=!1,j=!1;b.forEach(function(b){a.addCommand(b);d&&!c&&(c=!0,a.addCommandGroup(h,"eclipse.fileCommandExtensions",
1E3,null,d));d&&!j&&(j=!0,a.addCommandGroup(h,"eclipse.openWith",1E3,"Open With",d+"/eclipse.fileCommandExtensions"));this.isEditor?a.registerCommandContribution(h,b.id,e+this.index,d?d+"/eclipse.fileCommandExtensions/eclipse.openWith":null):a.registerCommandContribution(h,b.id,e+this.index,d?d+"/eclipse.fileCommandExtensions":null)});return{}})};b.createFileCommands=function(c,a,h,e){var h=h===void 0?"global":h,e=e===void 0?!0:e,d=c.getServiceReferences("orion.navigate.command"),j=[];if(h==="all"||
h==="global")for(var o=0;o<d.length;o++)if(d[o].getProperty("id")!=="orion.navigateFromMetadata"){for(var f=c.getService(d[o]),g={},u=d[o].getPropertyKeys(),w=0;w<u.length;w++)g[u[w]]=d[o].getProperty(u[w]);(h==="all"||g.forceSingleItem&&g.showGlobally)&&j.push({properties:g,service:f})}return k.when(function(){var b=c.getService("orion.core.contenttypes")||a;return l||k.when(b.getContentTypes(),function(b){return l=b})}(),function(){j=e?j.concat(b._getOpenWithNavCommandExtensions(c,l)):j;var a=j.map(function(a){var h=
a.properties;return b._createCommandOptions(h,a.service,c,l,!0).then(function(b){b=new i.Command(b);if(h.isEditor)b.isEditor=h.isEditor;return b})});return k.all(a,function(b){return{_error:b}}).then(function(b){return b})})};b.createOpenWithCommands=function(c,a,h){return h&&h._addedOpenWithCommands?(new k).resolve(b.getOpenWithCommands(h)):b.createFileCommands(c,a,"none",!0)};return b});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(g,k){function i(f){this._init(f)}i.prototype={_init:function(f){var d=k.node(f.container);if(!d)throw"no parent container";this._container=d;d.classList.remove("currentLocation");this._id=f.id||"eclipse.breadcrumbs";this._resource=f.resource||null;this._rootSegmentName=f.rootSegmentName;this._workspaceRootSegmentName=f.workspaceRootSegmentName;this._workspaceRootURL=f.workspaceRootURL;this._makeHref=f.makeHref;this.path="";this.measure();
this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var f;if(this._resource&&this._resource.Parents){f=document.createElement("a");var d=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(f,d):f.href=g.toUrl("navigate/table.html")+"#"+d}else f=document.createElement("span");k.empty(f);f.appendChild(document.createTextNode(this._workspaceRootSegmentName));return f}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],
buildSegment:function(f){var d=document.createElement("a");d.classList.add("breadcrumb");d.appendChild(document.createTextNode(f));return d},addSegmentHref:function(f,d){this._makeHref?this._makeHref(f,d.Location,d):f.href=g.toUrl("navigate/table.html")+"#"+d.ChildrenLocation},buildSegments:function(f,d){if(this._resource.Parents){var a=this._resource.Parents.slice(0),e,j;a&&(a=a.slice(0),d==="reverse"&&(a=a.reverse().slice(0)),a.forEach(function(c){f?(j=f,f=null):j=c.Name;e=this.buildSegment(j);
this.path+=c.Name;this.addSegmentHref(e,c);e.include=!1;this.segments.push(e)}.bind(this)))}},addDivider:function(){var f=document.createElement("span");f.appendChild(document.createTextNode(" / "));this.path+="/";f.classList.add("breadcrumbSeparator");this.append(f)},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(f){this.crumbs.appendChild(f)},addTitle:function(f,d){var a=d||document.title;this.crumbs.childNodes.length===0&&(f=document.createElement("span"),f.appendChild(document.createTextNode(a)),f.classList.add("breadcrumb"),f.classList.add("currentLocation"),
this.append(f))},finalSegment:function(f,d){f=document.createElement("span");d?f.appendChild(document.createTextNode(d)):f.appendChild(document.createTextNode(this._resource.Name));f.classList.add("currentLocation");this.path+=this._resource.Name;this.append(f)},firstSegment:function(f){if(f)this.append(f),this._resource&&this._resource.Parents?(f.classList.add("breadcrumb"),this.addDivider()):(f.href="",f.classList.add("currentLocation"))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(f){f.include===
!0&&(this.append(f),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var f=this.segments.slice(0).reverse();f.forEach(function(d){this.append(d);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?d.include=!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=f.reverse()}},measure:function(){this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var f=this.getNavigatorWorkspaceRootSegment(),d=this._rootSegmentName;
if(d)this.addTitle(f,d);else if(this.finalSegment(f,d),this._resource&&this._resource.Parents&&(this.buildSegments(d,"reverse"),this.measureSegments(),this.firstSegment(f)),this.crumbs.offsetWidth>=this.MAX_LENGTH)this.INCLUDE_FIRST_SECTION=!1},render:function(){this.refresh();var f=this.getNavigatorWorkspaceRootSegment(),d=this._rootSegmentName;d?this.addTitle(f,d):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(f),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(f,
d)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};i.prototype.constructor=i;return{BreadCrumbs:i}});
define("orion/webui/splitter",["require","orion/webui/littlelib"],function(g,k){function i(f){this._init(f)}i.prototype={_init:function(f){this._tracking=null;this._resizeListeners=[];this._animationDelay=501;this.$node=k.node(f.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=k.node(f.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=k.node(f.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";this._vertical=f.vertical;
this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(f.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add("splitThumbLayout");this._closeByDefault=f.closeByDefault;this._initializeFromStoredSettings();this._closed?(this._closed=!1,this._thumbDown()):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)},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||this._thumbDown()},addResizeListener:function(f){this._resizeListeners.push(f)},_initializeFromStoredSettings:function(){var f=localStorage.getItem(this._prefix+"/toggleState");this._closed=f?f==="closed":this._closeByDefault?
!0:!1;if(this._vertical)if(f=localStorage.getItem(this._prefix+"/yPosition"))this._splitTop=parseInt(f,10);else{if(this._closeByDefault)this._splitTop=150}else if(f=localStorage.getItem(this._prefix+"/xPosition"))this._splitLeft=parseInt(f,10);else if(this._closeByDefault)this._splitLeft=150},_adjustToSplitPosition:function(f){var d=k.bounds(this.$node),a=k.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=d.height;if(f||!this._splitTop)this._splitTop=d.top,localStorage.setItem(this._prefix+
"/yPosition",this._splitTop);f=this._splitTop;this.$node.parentNode.style.position==="relative"&&(f=this._splitTop-a.top);this.$sideNode.style.height=f+"px";this.$sideNode.style.bottom=f-1+"px";this.$sideNode.style.display="block";this.$node.style.top=f+"px"}else{this._splitWidth=d.width;if(f||!this._splitLeft)this._splitLeft=d.left,localStorage.setItem(this._prefix+"/xPosition",this._splitLeft);f=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(f=this._splitLeft-a.left);this.$sideNode.style.width=
f+"px";this.$sideNode.style.right=f-1+"px";this.$sideNode.style.display="block";this.$node.style.left=f+"px"}this._resize()},_resize:function(f){var f=f||0,d=k.bounds(this.$node.parentNode),a=k.bounds(this.$node);this._vertical?this.$mainNode.style.height=d.height-(a.top-d.top+a.height)+"px":this.$mainNode.style.width=d.width-(a.left-d.left+a.width)+"px";var e=this;window.setTimeout(function(){e._notifyResizeListeners(e.$mainNode)},f);window.setTimeout(function(){e._notifyResizeListeners(e.$sideNode)},
f)},_notifyResizeListeners:function(f){for(var d=0;d<this._resizeListeners.length;d++)this._resizeListeners[d](f)},_thumbDown:function(){this._closed?(this._closed=!1,this._addAnimation(),this._vertical?(this.$sideNode.style.height=this._splitTop+"px",this.$node.style.top=this._splitTop+"px"):(this.$sideNode.style.width=this._splitLeft+"px",this.$node.style.left=this._splitLeft+"px")):(this._closed=!0,this._addAnimation(),this._vertical?(this.$sideNode.style.top=0,this.$node.style.top="1px"):(this.$sideNode.style.width=
0,this.$node.style.left="1px"));this._resize(this._animationDelay);this._removeAnimation();localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null)},_removeAnimation:function(){var f=this;window.setTimeout(function(){f.$sideNode.classList.remove("sidePanelLayoutAnimation");f.$mainNode.classList.remove("mainPanelLayoutAnimation");f.$node.classList.remove("splitLayoutAnimation");f._thumb.classList.remove("splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add("sidePanelLayoutAnimation");
this.$mainNode.classList.add("mainPanelLayoutAnimation");this.$node.classList.add("splitLayoutAnimation");this._thumb&&this._thumb.classList.add("splitLayoutAnimation")},_mouseDown:function(f){if(f.target===this._thumb)return k.stop(f),this._thumbDown(f);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),
k.stop(f)},_mouseMove:function(f){if(this._tracking){var d=k.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=f.clientY;if(this._splitTop<d.top+5)this._splitTop=d.top+5;else if(this._splitTop>d.top+d.height-5)this._splitTop=d.top+d.height-5;var a=this._splitTop;this.$node.parentNode.style.position==="relative"&&(a=this._splitTop-d.top);this.$node.style.top=a+"px"}else{this._splitLeft=f.clientX;if(this._splitLeft<d.left+5)this._splitLeft=d.left+5;else if(this._splitLeft>d.left+d.width-
5)this._splitLeft=d.left+d.width-5;a=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(a=this._splitLeft-d.left);this.$node.style.left=a+"px"}this._adjustToSplitPosition(!0);k.stop(f)}},_mouseUp:function(f){if(this._tracking)window.removeEventListener("mousemove",this._tracking),this._tracking=null,this.$node.classList.remove("splitTracking"),this.$mainNode.classList.remove("panelTracking"),this.$sideNode.classList.remove("panelTracking"),k.stop(f)}};i.prototype.constructor=i;return{Splitter:i}});
define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(g){return{makeRelative:function(g){if(!g)return g;var i=window.location.protocol+"//"+window.location.host;return g.indexOf(i)===0?g.substring(i.length):g},isAtRoot:function(k){if(!k)return!1;if(k==="/workspace")return!0;var i=new URL(g.toUrl("workspace"),window.location.href);return(new URL(k,window.location.href)).href.indexOf(i.href)===0}}});
define("orion/favorites",["require","orion/fileUtils","orion/EventTarget"],function(g,k,i){function f(d){this._favorites=[];i.attach(this);this._init(d);this._initializeFavorites()}f.prototype={_init:function(d){this._registry=d.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.favorite",this)},_notifyListeners:function(){this.dispatchEvent({type:"favoritesChanged",navigator:this._favorites,registry:this._registry})},makeFavorites:function(d){for(var d=Array.isArray(d)?
d:[d],a=0;a<d.length;a++){var e=d[a],j=e.ChildrenLocation?e.ChildrenLocation:e.Location,j=k.makeRelative(j);this.addFavorite(e.Name,j,e.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(d){this.addFavorite(d,d,!1,!0)},addFavorite:function(d,a,e){this._favorites.push({name:d,path:a,directory:e,isFavorite:!0});this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},removeFavorite:function(d){for(var a in this._favorites)if(this._favorites[a].path===
d){this._favorites.splice(a,1);break}this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},renameFavorite:function(d,a){var e=!1,j;for(j in this._favorites)if(this._favorites[j].path===d){var c=this._favorites[j];if(c.name!==a)c.name=a,e=!0}e&&(this._favorites.sort(this._sorter),this._storeFavorites(),this._notifyListeners())},hasFavorite:function(d){for(var a in this._favorites)if(this._favorites[a].path===d)return!0;return!1},_SPECIAL_CHARS:"^$\\+[]().",queryFavorites:function(d){var a;
if(!d)return this._favorites;var e="";for(a=0;a<d.length;a++){var j=d.charAt(a);e+=j==="*"?".*":j==="?"?".?":this._SPECIAL_CHARS.indexOf(j)>=0?"\\"+j:j}e+=".*";d=RegExp(e);e=[];for(a in this._favorites)this._favorites[a].name.search(d)===0&&e.push(this._favorites[a]);return e},_initializeFavorites:function(){var d=this;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var e,a=a.get("navigate");typeof a==="string"&&(a=JSON.parse(a));if(a)for(e in a)a[e].isFavorite=
!0,d._favorites.push(a[e]);d._favorites.sort(d._sorter);d._notifyListeners()})},_storeFavorites:function(){var d=this._favorites;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("navigate",d)})},_sorter:function(d,a){var e=d.name.toLowerCase(),j=a.name.toLowerCase();return e>j?1:e<j?-1:0},getFavorites:function(){return{navigator:this._favorites}}};f.prototype.constructor=f;return{FavoritesService:f}});
define("orion/widgets/themes/ThemePreferences",[],function(){function g(g,i){this._preferences=g;this._themeData=i;var f=i.getThemeStorageInfo(),d=g.listenForChangedSettings(f.storage,2,function(a){a.key===d&&this.apply()}.bind(this))}g.prototype={_initialize:function(g,i,f){var d=f.get(g.styleset);d||(d=i.getStyles(),f.put(g.styleset,JSON.stringify(d)));(i=f.get("selected"))&&(i=JSON.parse(i));if(!i||i[g.selectedKey]===void 0)i=i||{},i[g.selectedKey]=g.defaultTheme,f.put("selected",JSON.stringify(i))},
apply:function(){this.setTheme()},getTheme:function(g){var i=this._themeData,f=i.getThemeStorageInfo();this._preferences.getPreferences(f.storage,2).then(function(d){this._initialize(f,i,d);var a=JSON.parse(d.get("selected")),d=JSON.parse(d.get(f.styleset)),e;if(d)for(var j=0;j<d.length;j++)if(d[j].name===a[f.selectedKey]){e=d[j];break}g({style:e,styles:d})}.bind(this))},setTheme:function(g,i){var f=this._themeData,d=f.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(a){this._initialize(d,
f,a);var e=JSON.parse(a.get("selected"));g||(g=e[d.selectedKey]);e[d.selectedKey]=g;a.put("selected",JSON.stringify(e));i?a.put(d.styleset,JSON.stringify(i)):i=JSON.parse(a.get(d.styleset));for(a=0;a<i.length;a++)if(i[a].name===e[d.selectedKey]){f.processSettings(i[a]);break}}.bind(this))},setFontSize:function(g){var i=this._themeData,f=i.getThemeStorageInfo();this._preferences.getPreferences(f.storage,2).then(function(d){this._initialize(f,i,d);var a=JSON.parse(d.get("selected")),e=JSON.parse(d.get(f.styleset)),
j;if(e)for(var c=0;c<e.length;c++)e[c].fontSize=g,e[c].name===a[f.selectedKey]&&(j=e[c]);d.put(f.styleset,JSON.stringify(e));i.processSettings(j)}.bind(this))}};return{ThemePreferences:g}});
define("orion/editor/eventTarget",[],function(){function g(){}g.addMixin=function(k){var i=g.prototype,f;for(f in i)i.hasOwnProperty(f)&&(k[f]=i[f])};g.prototype={addEventListener:function(g,i,f){if(!this._eventTypes)this._eventTypes={};var d=this._eventTypes[g];d||(d=this._eventTypes[g]={level:0,listeners:[]});d.listeners.push({listener:i,useCapture:f})},dispatchEvent:function(g){var i=g.type;this._dispatchEvent("pre"+i,g);this._dispatchEvent(i,g);this._dispatchEvent("post"+i,g)},_dispatchEvent:function(g,
i){var f=this._eventTypes?this._eventTypes[g]:null;if(f){var d=f.listeners;try{if(f.level++,d)for(var a=0,e=d.length;a<e;a++)if(d[a]){var j=d[a].listener;typeof j==="function"?j.call(this,i):j.handleEvent&&typeof j.handleEvent==="function"&&j.handleEvent(i)}}finally{if(f.level--,f.compact&&f.level===0){for(a=d.length-1;a>=0;a--)d[a]||d.splice(a,1);d.length===0&&delete this._eventTypes[g];f.compact=!1}}}},isListening:function(g){return!this._eventTypes?!1:this._eventTypes[g]!==void 0},removeEventListener:function(g,
i,f){if(this._eventTypes){var d=this._eventTypes[g];if(d){for(var a=d.listeners,e=0,j=a.length;e<j;e++){var c=a[e];if(c&&c.listener===i&&c.useCapture===f){d.level!==0?(a[e]=null,d.compact=!0):a.splice(e,1);break}}a.length===0&&delete this._eventTypes[g]}}}};return{EventTarget:g}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(g,k,i){function f(a){a=a||{};this._document=a.document||document}var d={};f.getTheme=function(a){var a=a||"default",e=d[a];e||(e=d[a]=new f);return e};f.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(a,e){var d=this,c=d._themeClass;d._themeClass=a;this._load(a,e,function(){d.onThemeChanged({type:"ThemeChanged",oldValue:c,newValue:d.getThemeClass()})})},onThemeChanged:function(a){return this.dispatchEvent(a)},
buildStyleSheet:function(a,e){function d(b,h,e){h&&(c.push("."+a+" ."+b+" {"),c.push("\t"+(e?"background-color":"color")+": "+h+";"),c.push("}"))}var c=[];c.push("");c.push("."+a+" {");e.fontFamily&&c.push("\tfont-family: "+e.fontFamily+";");e.fontSize&&c.push("\tfont-size: "+e.fontSize+";");e.fontSize&&c.push("\tcolor: "+e.text+";");c.push("}");c.push("."+a+".textview {");e.background&&c.push("\tbackground-color: "+e.background+";");c.push("}");d("ruler.annotations",e.annotationRuler,!0);d("ruler.lines",
e.annotationRuler,!0);d("ruler.folding",e.annotationRuler,!0);d("ruler.overview",e.overviewRuler,!0);d("rulerLines",e.lineNumber,!1);d("rulerLines.even",e.lineNumberEven,!1);d("rulerLines.odd",e.lineNumberOdd,!1);d("annotationLine.currentLine",e.currentLine,!0);d("entity-name-tag",e.keyword,!1);d("entity-other-attribute-name",e.attribute,!1);d("string-quoted",e.string,!1);d("line_caret",e.currentLine,!0);d("token_keyword",e.keyword,!1);d("token_string",e.string,!1);d("token_singleline_comment",e.comment,
!1);d("token_multiline_comment",e.comment,!1);d("token_doc_comment",e.comment,!1);d("token_doc_html_markup",e.comment,!1);return c.join("\n")},_createStyle:function(a,e,d,c){var b=this._document,a="orion-theme-"+a,h=b.getElementById(a);if(h){if(c||h.firstChild.data===e)return;h.removeChild(h.firstChild);h.appendChild(b.createTextNode(e))}else c?(h=i.createElement(b,"link"),h.rel="stylesheet",h.type="text/css",h.href=e,h.addEventListener("load",function(){d()})):(h=i.createElement(b,"style"),h.appendChild(b.createTextNode(e))),
h.id=a,(b.getElementsByTagName("head")[0]||b.documentElement).appendChild(h);c||d()},_load:function(a,e,d){if(a)if(typeof e==="string")this._createStyle(a,e,d);else if(e=e.href,e.substring(e.length-4)!==".css"&&(e+=".css"),/^\//.test(e)||/[a-zA-Z0-9]+:\/\//i.test(e)||!g.toUrl)this._createStyle(a,e,d,!0);else{var c=this;g(["text!"+e],function(b){c._createStyle(a,b,d,!1)})}else d()}};k.EventTarget.addMixin(f.prototype);return{TextTheme:f}});
define("orion/widgets/themes/ThemeClass",[],function(){function g(g){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=g;this.classString="."+g+"{ "}g.prototype.className=null;g.prototype.classString=void 0;g.prototype.style=void 0;g.prototype.closeString=" }\n";g.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:g}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(g){function k(){}k.prototype.navbar="#333";k.prototype.button="#777777";k.prototype.location="#EFEFEF";k.prototype.selection="FEC";k.prototype.sidepanel="#FBFBFB";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 i="",f=[],d=new g.ThemeClass("orionPage");
d.style.backgroundColor="#fdfdfd";d.style.width="100%";d.style.height="100%";f.push(d);d=new g.ThemeClass("topRowBanner");d.style.margin="0";d.style.border="0";d.style.backgroundColor=this.navbar;d.style.height="15px";d.style.padding="10px";d.style.paddingRight="3px";f.push(d);d=new g.ThemeClass("a");d.style.textDecoration="none";d.style.color=this.content;f.push(d);d=new g.ThemeClass("navlink");d.style.display="inline-block";d.style.padding="2px";d.style.color=this.content;f.push(d);d=new g.ThemeClass("primaryNav");
d.style.color=this.navtext;d.style.fontSize="8pt";d.style.fontWeight="normal";d.style.paddingTop="0";d.style.verticalAlign="baseline";f.push(d);d=new g.ThemeClass("primaryNav a");d.style.fontSize="8pt";d.style.color=this.navtext;d.style.marginRight="6px";d.style.marginLeft="6px";d.style.verticalAlign="baseline";d.style.textDecoration="none";f.push(d);d=new g.ThemeClass("primaryNav a:hover");d.style.color="#bfbfbf";d.style.cursor="hand";d.style.color="white";d.style.fontWeight="normal";f.push(d);for(var a in f)i+=
f[a].toString();return i};k.prototype.writeLocationStyle=function(){var i="",f=[],d=new g.ThemeClass("titleArea");d.style.margin="0";d.style.paddingTop="5px";d.style.border="0";d.style.background=this.location;d.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.location+"), color-stop(100%,"+this.location+"))";d.style.borderBottom="1px solid "+this.location;d.style.minHeight="20px";f.push(d);d=new g.ThemeClass("breadcrumb");d.style.fontSize="8pt";d.style.textDecoration=
"none";d.style.color="#f1f1f2;";d.style.paddingTop="2px";f.push(d);d=new g.ThemeClass("a.breadcrumb:hover");d.style.textDecoration="none";d.style.borderBottom="1px dotted";d.style.color="#F58B0F";d.style.cursor="pointer";f.push(d);d=new g.ThemeClass("breadcrumbSeparator");d.style.fontSize="8pt";d.style.textDecoration="none";d.style.color="#f1f1f2";d.style.fontWeight="bold";f.push(d);d=new g.ThemeClass("currentLocation");d.style.fontWeight="bold";d.style.fontSize="8pt";d.style.color="#f1f1f2";d.style.textDecoration=
"none";d.style.textWrap="normal";d.style.lineHeight="10pt";f.push(d);d=new g.ThemeClass("a.currentLocation:hover");d.style.fontWeight="bold";d.style.fontSize="10pt";d.style.color="#666666";d.style.textDecoration="none";d.style.borderBottom="0";f.push(d);d=new g.ThemeClass("navlinkonpage");d.style.color=this.content;f.push(d);d=new g.ThemeClass("progressPane_running");d.style.background="url(../images/progress_running_dark.gif) no-repeat center";d.style.width="16px";d.style.height="16px";f.push(d);
for(var a in f)i+=f[a].toString();return i};k.prototype.writeButtonStyle=function(){var i="",f=[],d=new g.ThemeClass("commandButton");d.style.color="#666";d.style.border="1px solid #dedede";d.style.backgroundColor="#ddd";d.style.textAlign="center";d.style.verticalAlign="baseline";d.style.cursor="pointer";d.style.display="inline-block";d.style.padding="5px 6px";d.style.borderRadius="3px";d.style.lineHeight="12px";d.style.fontSize="8pt";d.style.userSelect="none";f.push(d);d=new g.ThemeClass("commandButton:over");
d.style.backgroundColor="#e6e6e6";d.style.border="1px solid #808080";f.push(d);d=new g.ThemeClass("commandMenu");d.style.color="#222";d.style.display="inline-block";d.style.verticalAlign="baseline";d.style.margin="0";d.style.fontSize="8pt";d.style.fontWeight="normal";d.style.border="1px solid #dedede";d.style.backgroundColor="#efefef";d.style.cursor="pointer";d.style.borderRadius="1px";f.push(d);d=new g.ThemeClass("commandMenuItem");d.style.border="0";d.style.padding="0";d.style.margin="0";f.push(d);
for(var a in f)i+=f[a].toString();return i};k.prototype.writeMainStyle=function(){var i="",f=[],d=new g.ThemeClass("searchbox");d.style.backgroundImage="url(../images/core_sprites.png)";d.style.backgroundRepeat="no-repeat";d.style.backgroundPosition="4px -297px";d.style.width="12px";d.style.height="12px";d.style.backgroundColor=this.search;d.style.border="1px solid "+this.search;d.style.fontSize="11px";d.style.width="15em";d.style.height="16px";d.style.borderRadius="10px";d.style.color="#999";d.style.padding=
"0";d.style.paddingLeft="20px";d.style.marginLeft="5px";d.style.marginTop="6px !important";d.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";f.push(d);d=new g.ThemeClass("searchbox:focus");d.style.color="white";d.style.outline="none";f.push(d);d=new g.ThemeClass("checkedRow");d.style.cssText="background-color:"+this.selection+" !important;";f.push(d);d=new g.ThemeClass("navbar-item-selected");d.style.background=this.selection;d.style.color=
this.content;f.push(d);d=new g.ThemeClass("auxpane");d.style.border="0";d.style.background=this.sidepanel;d.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.sidepanel+"), color-stop(100%,"+this.sidepanel+"))";d.style.background="-moz-linear-gradient(top, "+this.sidepanel+" 0%, "+this.sidepanel+" 100%)";f.push(d);d=new g.ThemeClass("mainpane");d.style.background=this.mainpanel;d.style.border=0;f.push(d);d=new g.ThemeClass("mainToolbar");d.style.background=this.toolpanel;
d.style.height="34px";d.style.borderBottom="1px solid #ebebeb";d.style.paddingTop="2px";f.push(d);for(var a in f)i+=f[a].toString();return i};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.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);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:k}});
define("orion/widgets/themes/container/ThemeData",["orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter"],function(g,k){function i(){}function f(){this.styles=[];var a=new i;a.name="Orion";a.navbar="#333";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";this.styles.push(a);a=new i;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";this.styles.push(a);a=new i;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";this.styles.push(a);a=new i;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";this.styles.push(a);a=new i;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";this.styles.push(a);a=new i;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";this.styles.push(a);
a=new i;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";this.styles.push(a)}function d(){return this.styles}i.prototype.name="Orion";i.prototype.navbar="#333";i.prototype.button="#EFEFEF";i.prototype.location="#333";i.prototype.breadcrumb="#3087B3";i.prototype.separator="#333";i.prototype.selection=
"FEC";i.prototype.sidepanel="#FBFBFB";i.prototype.mainpanel="white";i.prototype.toolpanel="white";i.prototype.navtext="#bfbfbf";i.prototype.content="#3087B3";i.prototype.search="#444";f.prototype.styles=[];f.prototype.getStyles=d;f.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion",selectedKey:"selected"}};f.prototype.getViewData=function(){for(var a={top:10,left:10,width:350,height:350,shapes:[{type:"RECTANGLE",name:"Navigation Bar",x:10,y:10,
width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:"Navigation Text",label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:"Search Box",x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:"Tool Panel",x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",name:"Selection Bar",x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},
{type:"RECTANGLE",name:"Location",x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:"Navigation Text",label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:"Content",label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:"Content",label:"/",x:78,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:"Content",label:"Location",
x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:"Main Panel",x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:"Button",x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:"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:"Section Text",label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:"Line Color",x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:"Line Color",x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:"Line Color",x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:"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:"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"}]},e=0;e<3;e++)a.shapes.push({type:"TEXT",name:"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:"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};f.prototype.processSettings=function(a){var e=new k.ThemeSheetWriter;(new g.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",e.getSheet(a))};return{ThemeData:f,getStyles:d}});
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","Populating favorites...":"Populating favorites...",Favorite:"Favorite","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","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}'."});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(g,k){var i={root:k};Object.keys(g).forEach(function(f){typeof i[f]==="undefined"&&(i[f]=g[f])});return i});
define("orion/widgets/UserMenu",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/PageLinks"],function(g,k,i,f){function d(a){this._displaySignOut=!0;this._init(a)}d.prototype={_init:function(a){this._dropdownNode=i.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,d;for(d in a)a.hasOwnProperty(d)&&e++;return e},_makeMenuItem:function(a,e){var d=document.createElement("span");d.role="menuitem";
d.tabIndex=0;var c=document.createTextNode(a);d.appendChild(c);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&d.classList.add(this._dropDownItemClass):d.classList.add("dropdownMenuItem");d.addEventListener("click",e,!1);d.addEventListener("keydown",function(b){(b.keyCode===i.KEY.ENTER||b.keyCode===i.KEY.SPACE)&&e()},!1);return d},_renderAuthenticatedService:function(a){var e=this,d=this.authenticatedServices[a].authService;if(d&&d.logout&&this._displaySignOut){var c=document.createElement("li"),
b=this._makeMenuItem(g["Sign Out"],function(){d.logout().then(function(){e.addUserItem(a,d,e.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var b=localStorage.length-1;b>=0;b--){var c=localStorage.key(b);c&&c.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(c)}d.getAuthForm(window.location.href).then(function(b){window.location=b})})});c.appendChild(b);this._dropdownNode.appendChild(c)}},renderServices:function(){function a(c){d[c]||
(d[c]=e.createDocumentFragment());return d[c]}var e=document,d=[];f.getPageLinksInfo(this._serviceRegistry,"orion.page.link.user").then(function(c){this._dropdown?this._dropdown.empty():this._dropdownNode&&i.empty(this._dropdownNode);c.forEach(function(b){var c=a(typeof b.category==="number"?b.category:1),h=e.createElement("li"),d=e.createElement("a");d.role="menuitem";typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&d.classList.add(this._dropDownItemClass):d.classList.add("dropdownMenuItem");
d.href=b.href;d.textContent=b.textContent;h.appendChild(d);c.appendChild(h)}.bind(this));if(this.keyAssistFunction){var c=document.createElement("li"),b=this._makeMenuItem(g["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass==="string"?this._keyAssistClass!==""&&b.classList.add(this._keyAssistClass):b.classList.add("key-assist-menuitem");c.appendChild(b);a(0).appendChild(c)}var h=this;d.sort(function(b,c){return b-c}).forEach(function(b,c){if(c<d.length-1&&!this._noSeparator){var a=
document.createElement("li");a.classList.add("dropdownSeparator");var e=document.createElement("span");e.classList.add("dropdownSeparator");a.appendChild(e);b.appendChild(a)}h._dropdownNode.appendChild(b)}.bind(this));if(this.isSingleService())for(var f in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(f)&&this._renderAuthenticatedService(f,0)}.bind(this))},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,e,d,c){c?(this.unauthenticatedServices[a]&&
delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:e,label:d,data:c}):(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:e,label:d,pending:this.unauthenticatedServices[a].pending}:{authService:e,label:d});this.renderServices()}};d.prototype.constructor=d;return{UserMenu:d}});
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?"});
define("orion/crawler/nls/messages",["orion/i18n!orion/crawler/nls/messages","orion/crawler/nls/root/messages"],function(g,k){var i={root:k};Object.keys(g).forEach(function(f){typeof i[f]==="undefined"&&(i[f]=g[f])});return i});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/editor/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(g,k,i,f,d,a){function e(c,b,a){var e="";a&&(e="^");if(e=i.parse("/"+e+c.searchStr+"/"))a=e.pattern,e=e.flags,e.indexOf("i")===-1&&!b.caseSensitive&&(e+="i"),c.regExp={pattern:a,flags:e},c.wildCard=!0}var j={ALL_FILE_TYPE:"*.*"};j.doSearch=function(c,b,a,e){if(c){var d=!0;a==="*"&&(a="");a===""&&(d=e&&e.type!==j.ALL_FILE_TYPE);if(d){a!==""&&j.addRecentSearch(b,
a,e?e.regEx:!1);var c=c.createSearchParams(a,!1,!1,e),f=j.generateSearchHref(c);j.getOpenSearchPref(b,function(b){b?window.open(f):window.location=f})}}else window.alert(g["Can't search: no search service is available"])};j.generateSearchHelper=function(c,b){var a=c.keyword,d=a,f={};c.fileType&&c.fileType!==j.ALL_FILE_TYPE&&a===""&&(d="*."+c.fileType);if(c.regEx)f.searchStr=a,e(f,c,b);else{var g=a.indexOf("*")>-1,i=a.indexOf("?")>-1;g&&(a=a.split("*").join(".*"));i&&(a=a.split("?").join("."));!g&&
!i&&!c.nameSearch?(f.searchStr=c.caseSensitive?a.split("\\").join(""):a.split("\\").join("").toLowerCase(),f.wildCard=!1):(f.searchStr=c.caseSensitive?a:a.toLowerCase(),e(f,c,b),f.wildCard=!0)}f.searchStrLength=f.searchStr.length;return{params:c,inFileQuery:f,displayedSearchTerm:d}};j.convertSearchParams=function(c){if(c.rows!==void 0)c.rows=parseInt(c.rows,10);if(c.start!==void 0)c.start=parseInt(c.start,10);if(typeof c.regEx==="string")c.regEx=c.regEx.toLowerCase()==="true";if(typeof c.caseSensitive===
"string")c.caseSensitive=c.caseSensitive.toLowerCase()==="true";if(typeof c.nameSearch==="string")c.nameSearch=c.nameSearch.toLowerCase()==="true"};j.copySearchParams=function(c,b){var a={},e;for(e in c)if(c[e]!==void 0&&c[e]!==null&&(b||e!=="replace"))a[e]=c[e];return a};j.generateSearchHref=function(c){var b=k.toUrl("search/search.html"),c=j.copySearchParams(c,!0),e=c.resource;c.resource=void 0;return(new a(b+"#{,resource,params*}")).expand({resource:e,params:c})};j.generateFindURLBinding=function(c,
b,e,d){c={find:b.searchStr,regEx:b.wildCard?!0:void 0,caseSensitive:c.caseSensitive?!0:void 0,replaceWith:typeof d==="string"?d:void 0,atLine:typeof e==="number"?e:void 0};return","+(new a("{,params*}")).expand({params:c})};j.convertFindURLBinding=function(c){if(typeof c.regEx==="string")c.regEx=c.regEx.toLowerCase()==="true";if(typeof c.caseSensitive==="string")c.caseSensitive=c.caseSensitive.toLowerCase()==="true";if(typeof c.atLine==="string")c.atLine=parseInt(c.atLine,10)};j.replaceRegEx=function(c,
b,a){return c.replace(RegExp(b.pattern,b.flags),a)};j.replaceStringLiteral=function(c,b,a){b=i.parse("/"+b+"/gim");return j.replaceRegEx(c,b,a)};j.searchOnelineLiteral=function(c,b,a){var e;e=0;for(var d=!1,f=[];;)if(e=b.indexOf(c.searchStr,e),e<0)break;else{f.push({startIndex:e,length:c.searchStrLength});d=!0;if(a)break;e+=c.searchStrLength}return d?f:null};j.findRegExp=function(c,b,a,e){if(!b)return null;a=a||"";a+=(a.indexOf("g")===-1?"g":"")+(a.indexOf("m")===-1?"m":"");var d=null;return(d=RegExp(b,
a).exec(c.substring(e)))&&{startIndex:d.index+e,length:d[0].length}};j.searchOnelineRegEx=function(c,b,a){for(var e=0,d=!1,f=[];;)if(e=j.findRegExp(b,c.regExp.pattern,c.regExp.flags,e)){f.push(e);d=!0;if(a)break;e=e.startIndex+e.length}else break;return d?f:null};j.generateNewContents=function(c,b,a,e,d,f){if(e&&b){if(!c)a.contents=[];for(var g=0;g<b.length;g++){for(var i=b[g],k=!1,p=!1,t=[],o,v=0,z=0;z<e.children.length;z++)if(e.children[z].lineNumber-1===g){v=z;for(k=0;k<e.children[z].matches.length;k++)e.children[z+
k].checked!==!1&&t.push(k);p=t.length>0;o=e.children[z].matches;k=!0;break}if(k){if(p){t=j.replaceCheckedMatches(i,d,o,t,f);i=t.replacedStr;for(k=0;k<e.children[v].matches.length;k++)e.children[v+k].newMatches=t.newMatches}else for(k=0;k<e.children[v].matches.length;k++)e.children[v+k].newMatches=e.children[v+k].matches;c?a.contents[g]=i:a.contents.push(i)}else c||a.contents.push(i)}}};j.generateMatchContext=function(c,b,a){var e=[],d=c*2+1,f;b.length<=d?(f=0,c=b.length-1):(f=a-c,f<0?(f=0,c=f+d-1):
(c=a+c,c>b.length-1&&(c=b.length-1,f=c-d+1)));for(d=f;d<=c;d++)e.push({context:b[d],current:d===a});return e};j.splitFile=function(c){for(var b=0,a=0,e=0,d=0,f=[];;){b!==-1&&b<=e&&(b=c.indexOf("\r",e));a!==-1&&a<=e&&(a=c.indexOf("\n",e));if(a===-1&&b===-1){f.push(c.substring(d));break}var j=1;b!==-1&&a!==-1?b+1===a?(j=2,e=a+1):e=(b<a?b:a)+1:e=b!==-1?b+1:a+1;f.push(c.substring(d,e-j));d=e}return f};j.searchWithinFile=function(c,b,a,e,d,f){a=j.splitFile(a);if(d)b.contents=a;if(b){b.children=[];for(var g=
e=0;g<a.length;g++){var i=a[g];if(i&&i.length>0){var k=f?i:i.toLowerCase();if(k=c.wildCard?j.searchOnelineRegEx(c,k):j.searchOnelineLiteral(c,k)){var p,t=g+1;if(d)for(var o=0;o<k.length;o++)p=o+1,p={parent:b,checked:b.checked,type:"detail",matches:k,lineNumber:t,matchNumber:p,name:i,location:b.location+"-"+t+"-"+p},b.children.push(p);else p={parent:b,context:j.generateMatchContext(2,a,g),checked:b.checked,type:"detail",matches:k,lineNumber:t,name:i,location:b.location+"-"+t},b.children.push(p);e+=
k.length}}}b.totalMatches=e}};j.replaceCheckedMatches=function(c,b,a,e,d){for(var f=0,j="",g=[],i=0;i<a.length;i++){f!==a[i].startIndex&&(j+=c.substring(f,a[i].startIndex));if(a[i].length)d=a[i].length;for(var f=!1,k=0;k<e.length;k++)if(e[k]===i){f=!0;break}f?(g.push({startIndex:j.length,length:b.length}),j+=b):(g.push({startIndex:j.length,length:d}),j+=c.substring(a[i].startIndex,a[i].startIndex+d));f=a[i].startIndex+d}f<c.length&&(j+=c.substring(f));return{replacedStr:j,newMatches:g}};j.fullPathNameByMeta=
function(c){var b=c.length,a="";if(b>0)for(b-=1;b>-1;b--)a=a+(a===""?"":"/")+c[b].Name;return a};j.path2FolderName=function(c,b,a){return c.substring(0,c.length-b.length-(a?0:1))};j._storeRecentSearch=function(c,b,a){c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){c.put("recentSearch",b);a&&window.setTimeout(function(){a.dispatchEvent({type:"recentSearchesChanged"})}.bind(this),20)})};j.addRecentSearch=function(c,b,a){typeof b==="string"&&b&&c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){var d,
e=e.get("recentSearch");typeof e==="string"&&(e=JSON.parse(e));if(e){for(d in e)if(e[d].name===b)return;e.length>=20&&e.splice(19,e.length-20+1)}else e=[];e.splice(0,0,{name:b,regEx:a});j._storeRecentSearch(c,e)})};j.removeRecentSearch=function(c,b,a){typeof b==="string"&&b&&c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){var d,e=e.get("recentSearch");typeof e==="string"&&(e=JSON.parse(e));if(e)for(d in e)if(e[d].name===b){e.splice(d,1);j._storeRecentSearch(c,
e,a);break}})};j.getSearches=function(c,b,a){c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){c=c.get(b);typeof c==="string"&&(c=JSON.parse(c));c&&a&&a(c)})};j.getMixedSearches=function(c,b,a,e){c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var d=c.get("recentSearch");typeof d==="string"&&(d=JSON.parse(d));b&&(c=c.get("search"),typeof c==="string"&&(c=JSON.parse(c)),c&&c.forEach(function(b){if(a){var c=j.parseQueryStr(b.query);
d.some(function(b){return c.searchStrTitle===b.name})||d.push({name:c.searchStrTitle,label:b.name})}else d.push({name:null,label:b.name,value:b.query})}));d&&e&&e(d)})};j.getOpenSearchPref=function(c,b){c.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(c){c=c.get("nav.config");b(c&&c["links.newtab"]!=="undefined"?c["links.newtab"]?!0:!1:!1)})};j.setOpenSearchPref=function(c,b){c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){c.put("openSearchPref",
{openInNewTab:b})})};return j});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(g,k,i,f,d,a){function e(a,c,b,e){this.registry=a;this.fileClient=c;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=e&&e.searchOnName;this._buildSkeletonOnly=e&&e.buildSkeletonOnly;this._fetchChildrenCallBack=e&&e.fetchChildrenCallBack;this._searchParams=b;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:f.generateSearchHelper(b);this._location=e&&e.location;this._childrenLocation=e&&e.childrenLocation?e.childrenLocation:this._location}e.prototype.search=function(a){var c=this.registry.getService("orion.core.contenttypes");this._onSearchComplete=a;c.getContentTypes().then(function(b){this.contentTypesCache=b;this._visitRecursively(this._childrenLocation).then(function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,
docs:this.fileLocations}})}.bind(this))}.bind(this))};e.prototype.searchName=function(a,c){if(a)this.searchHelper=f.generateSearchHelper(a,!0);if(c)this.onSearchNameComplete=c;var b=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var e=0;e<this.fileSkeleton.length;e++){var d=this.fileSkeleton[e].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?f.searchOnelineRegEx(this.searchHelper.inFileQuery,d,!0):f.searchOnelineLiteral(this.searchHelper.inFileQuery,d,!0))if(b.push(this.fileSkeleton[e]),
b.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:b.length,docs:b}})}};e.prototype.buildSkeleton=function(a,c){this._buildingSkeleton=!0;var b=this.registry.getService("orion.core.contenttypes"),e=this;a();b.getContentTypes().then(function(b){e.contentTypesCache=b;e._visitRecursively(e._childrenLocation).then(function(){e._buildingSkeleton=!1;c();e.searchHelper&&!e._buildSkeletonOnly&&e.searchName()})})};e.prototype._searchCompleted=function(){console.log("Search Completed.")};
e.prototype._searchFiles=function(){var e=[],c;if(this.fileLocations.length>0){c=this;for(var b=0;b<c.fileLocations.length;b++)e.push(c._sniffSearch(c.fileLocations[b]))}return a.all(e)};e.prototype._sort=function(a){a.sort(function(c,b){var a=c.Name&&c.Name.toLowerCase(),e=b.Name&&b.Name.toLowerCase();return a<e?-1:a>e?1:0})};e.prototype._onFileType=function(a){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===f.ALL_FILE_TYPE?!0:a.extension.indexOf(this.searchHelper.params.fileType)>=
0:!0};e.prototype._visitRecursively=function(e){var c=[],b=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(e);var h=b.registry.getService("orion.page.progress");return(h?h.progress(b.fileClient.fetchChildren(e),"Crawling search for children of "+e):b.fileClient.fetchChildren(e)).then(function(e){for(var h=0;h<e.length;h++)if(e[h].Directory!==void 0&&e[h].Directory===!1)if(b._searchOnName)c.push(b._buildSingleSkeleton(e[h]));else if(b._buildSkeletonOnly)c.push(b._buildSingleSkeleton(e[h]));
else{var f=d.getFilenameContentType(e[h].Name,b.contentTypesCache);f&&(f["extends"]==="text/plain"||f.id==="text/plain")&&b._onFileType(f)&&c.push(b._sniffSearch(e[h]))}else e[h].Location&&c.push(b._visitRecursively(e[h].ChildrenLocation));return a.all(c)})};e.prototype._hitOnceWithinFile=function(a){a=this._searchParams.caseSensitive?a:a.toLowerCase();return this.searchHelper.inFileQuery.wildCard?f.searchOnelineRegEx(this.searchHelper.inFileQuery,a,!0):f.searchOnelineLiteral(this.searchHelper.inFileQuery,
a,!0)};e.prototype._reportSingleHit=function(a){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)};e.prototype._sniffSearch=function(a){this._totalCounter++;var c=this;if(this.searchHelper.params.keyword==="")this._reportSingleHit(a),this.registry.getService("orion.page.message").setProgressResult({Message:i.formatMessage(g["${0} files found out of ${1}"],
this._hitCounter,this._totalCounter)});else return this.registry.getService("orion.page.progress").progress(c.fileClient.read(a.Location),"Reading file "+a.Location).then(function(b){c._hitOnceWithinFile(b)&&c._reportSingleHit(a);c.registry.getService("orion.page.message").setProgressResult({Message:i.formatMessage(g["${0} files found out of ${1}"],c._hitCounter,c._totalCounter)})},function(b){console.error("Error loading file content: "+b.message)})};e.prototype._buildSingleSkeleton=function(e){this._totalCounter++;
this.fileSkeleton.push(e);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();e=new a;e.resolve(this._totalCounter);return e};e.prototype.constructor=e;return{SearchCrawler:e}});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(g,k,i,f){function d(){}d.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&&i.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=i.$("#closeDialog",this.$frame);var d=this;this.$close.addEventListener("click",function(){d.hide()},!1);this.$parent=i.$(".dialogContent",this.$frame);e=document.createRange();e.selectNode(this.$parent);
a=e.createContextualFragment(this.TEMPLATE);this.messages&&i.processTextNodes(a,this.messages);this.$parent.appendChild(a);this.$buttonContainer=i.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(c){c.keyCode===i.KEY.ESCAPE?d.hide():c.keyCode===i.KEY.ENTER&&typeof d._defaultCallback==="function"&&d._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 d=f.createButton(e.text,e.callback);if(e.id)d.id=e.id,a["$"+d.id]=d;if(e.isDefault)a._defaultCallback=e.callback,a._defaultButton=d;a.$buttonContainer.appendChild(d)})}},_makeModal:function(){var a=this;this.$frame.addEventListener("blur",function(b){a.$lastFocusedElement=b.target},!0);this._modalListener=function(b){var c=!i.contains(a.$frame,b.target);if(c)for(var e=0;e<
a.$$modalExclusions.length;e++)if(i.contains(a.$$modalExclusions[e],b.target)){c=!1;break}c&&(window.setTimeout(function(){(a.$lastFocusedElement||a.$parent).focus()},0),i.stop(b))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var e=this.$frameParent.childNodes,d=!1;this._addedBackdrop=[];for(var c=0;c<e.length;c++){for(var b=0;b<this.$$modalExclusions.length;b++)if(i.contains(this.$$modalExclusions[b],e[c])){d=
!0;break}!d&&e[c]!==a.$frame&&e[c].classList&&!e[c].classList.contains("tooltipContainer")&&(b=e[c],b.classList.contains("modalBackdrop")||(b.classList.add("modalBackdrop"),this._addedBackdrop.push(b)))}(e=i.lastTabbable(this.$buttonContainer)||i.lastTabbable(this.$parent))&&e.addEventListener("keydown",function(b){if(b.keyCode===i.KEY.TAB){var c=a._getFirstFocusField();c&&c!==b.target&&c.focus();i.stop(b)}},!1)},_addChildDialog:function(a){this.$$modalExclusions.push(a.$frame||a.$parent)},_bindElements:function(a){for(var e=
0;e<a.childNodes.length;e++){var d=a.childNodes[e];d.id&&(this["$"+d.id]=d);this._bindElements(d)}},hide:function(){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");typeof this._afterHiding==="function"&&this._afterHiding();var a=this;this.keepAlive||window.setTimeout(function(){a.destroy()},
0)},show:function(a){typeof this._beforeShowing==="function"&&this._beforeShowing();var e=i.bounds(this.$frame),d=i.bounds(document.documentElement),c;a?(c=i.bounds(a),a=c.top+c.height+4,c=c.left+4,a+e.height>d.height&&(a=Math.max(0,d.height-e.height-4)),c+e.width>d.width&&(c=Math.max(0,d.width-e.width-4))):(c=Math.max(0,(d.width-e.width)/2),a=Math.max(0,(d.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 i.firstTabbable(this.$parent)||this._defaultButton||i.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){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}};d.prototype.constructor=d;return{Dialog: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(g,k,i,f,d,a,e){function j(c){this._init(c)}j.prototype=new e.Dialog;j.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="'+f.toUrl("../../../images/progress_running.gif")+
'" class="progressPane_running_dialog" id="crawlingProgress"></img></div><div id="favresults" style="max-height:400px; height:auto; overflow-y:auto;"></div><div id="results" style="max-height:400px; height:auto; overflow-y:auto;" aria-live="off"></div><div id="statusbar"></div></div>';j.prototype._init=function(c){this.title=c.title||g["Find File Named"];this.modal=!0;this.messages=g;this._searcher=c.searcher;this._progress=c.progress;this._onHide=c.onHide;this._contentTypeService=new i.ContentTypeService(this._searcher.registry);
if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=c.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=c.initialText;this._message=c.message;this._nameSearch=!0;if(c.nameSearch!==void 0)this._nameSearch=c.nameSearch;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(g["Missing required argument: fileService"]);this._searchRenderer=c.searchRenderer;if(!this._searchRenderer||
typeof this._searchRenderer.makeRenderFunction!=="function")throw Error(g["Missing required argument: searchRenderer"]);this._favService=c.favoriteService;if(!this._favService)throw Error(g["Missing required argument: favService"]);this._initialize()};j.prototype._bindToDom=function(c){var b=this;b.$crawlingProgress.style.display="none";this.$fileName.setAttribute("placeholder",g.Search);this.$fileName.addEventListener("input",function(){b._time=+new Date;b._timeoutId&&clearTimeout(b._timeoutId);
b._timeoutId=setTimeout(b.checkSearch.bind(b),0)},!1);this.$fileName.addEventListener("keydown",function(c){if(c.keyCode===d.KEY.ENTER){var a=d.$("a",b.$results);a&&(d.stop(c),window.open(a.href),b.hide())}},!1);c.addEventListener("keydown",function(c){var a,e,f,j,g;if(c.keyCode===d.KEY.DOWN||c.keyCode===d.KEY.UP)e=d.$$array("a",b.$results),a=d.$$array("a",b.$favresults),f=document.activeElement,g=e.indexOf(f),j=a.indexOf(f),c.keyCode===d.KEY.DOWN?j>=0?(j<a.length-1?a[j+1]:e.length>0?e[0]:a[0]).focus():
g>=0?(g<e.length-1?e[g+1]:a.length>0?a[0]:e[0]).focus():(e.length>0||a.length>0)&&(-1<a.length-1?a[0]:e[0]).focus():j>=0?(f=b.$fileName,(j>0?a[j-1]:f).focus()):g>=0?(f=b.$fileName,(g>0?e[g-1]:a.length>0?a[a.length-1]:f).focus()):e.length>0?e[e.length-1].focus():a.length>0&&a[a.length-1].focus(),d.stop(c)});c.addEventListener("mouseup",function(b){b.target.focus()},!1);this.populateFavorites();setTimeout(function(){if(b._forceUseCrawler||!b._fileService.getService(b._searcher.getSearchLocation()).search){var c=
b._searchOnRoot?b._searcher.getSearchRootLocation():b._searcher.getChildrenLocation(),c=new k.SearchCrawler(b._searcher.registry,b._fileService,"",{searchOnName:!0,location:c});b._searcher.setCrawler(c);c.buildSkeleton(function(){b.$crawlingProgress.style.display="inline";b.$progress.appendChild(document.createTextNode(g["Building file skeleton..."]))},function(){b.$crawlingProgress.style.display="none";b.$progress.removeChild(b.$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()};j.prototype.populateFavorites=function(){var c=document.createElement("div");c.appendChild(document.createTextNode(g["Populating favorites&#x2026;"]));d.empty(this.$favresults);this.$favresults.appendChild(c);this._progress?this._progress.progress(this._favService.getFavorites(),"Getting favorites").then(this.showFavorites()):this._favService.getFavorites().then(this.showFavorites());
this._favService.addEventListener("favoritesChanged",this.showFavorites())};j.prototype.showFavorites=function(){var c=this;return function(b){if(b.navigator)b=b.navigator;c._searchRenderer.makeRenderFunction(c._contentTypeService,c.$favresults,!1,c.decorateResult.bind(c),c.showFavoritesImage)(b);if(b&&b.length>0)b=document.createElement("div"),b.style.borderBottom="1px dashed #BBBBBB",b.style.padding="5px",c.$favresults.appendChild(b)}};j.prototype.showFavoritesImage=function(c){var b=new Image;
b.classList.add("modelDecorationSprite");b.classList.add("core-sprite-favorite");b.src=f.toUrl("images/none.png");b.title=g.Favorite;c.appendChild(b);b.style.verticalAlign="middle"};j.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var c=(new Date).getTime();c-this._time>this._searchDelay?(this._time=c,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};j.prototype.doSearch=function(){var c=this.$fileName.value;if(c){var b=this._searcher.createSearchParams(c,
this._nameSearch,this._searchOnRoot),e=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=e;var f=document.createElement("div");f.appendChild(document.createTextNode(this._nameSearch?g["Searching..."]:a.formatMessage(g["Searching for occurrences of"],c)));d.empty(this.$results);this.$results.appendChild(f);this._searcher.search(b,!1,function(){e===this.currentSearch&&e.apply(null,arguments)}.bind(this))}};j.prototype.decorateResult=
function(c){for(var b=this,c=d.$$array("a",c),a=0;a<c.length;a++){var e=c[a];e.addEventListener("mouseup",function(c){c.button===0&&!c.ctrlKey&&!c.metaKey&&b.hide()},!1);e.addEventListener("keyup",function(c){c.keyCode===d.KEY.ENTER&&b.hide()},!1)}};j.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};j.prototype._afterHiding=function(){this._onHide&&this._onHide()};j.prototype.constructor=j;return{OpenResourceDialog:j}});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\t<\!-- Top row:  Logo + discovery links + search + user --\>\n\t<div id="staticBanner" class="layoutBlock topRowBanner"> <\!-- primaryNav --\>\n\t\t<a id="home" class="layoutLeft "></a>\n\t\t<nav id="primaryNav" class="bannerLeftArea" role="navigation">\n\t\t\t<div class="centralNavigation" id="centralNavigation" tabindex="0" role="button" style="margin-top:0;"></div>\n\t\t</nav>\n\t\t<div class="clear navigationBreadcrumb bannerMiddleArea" >\n\t\t\t<div id="location" class="currentLocation"></div>\n\t\t</div>\n\t\t<div class="bannerRightArea">\n\t\t\t<div id="globalActions" class="spacingLeft layoutLeft"></div>\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\t\t\t<div id="userMenu" class="spacingRight layoutRight" style="color:#ccc;">\n\t\t\t\t<img class="progressPane" id="progressPane" tabindex="0" role="progressbar"></img>\n\t\t\t\t<span id="userTrigger" tabindex="0" role="button" class="dropdownTrigger">\n\t\t\t\t\t<span class="dropdownArrowEmpty"></span>\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\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'<footer id="footerContent" class="layoutBlock footerLayout" role="contentinfo">\n\t<\!-- Requires some js code to bind the NLS variables  --\>\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="http://wiki.eclipse.org/Orion/FAQ" target="_blank">${FAQ}</a></li --\>\n\t\t\t<li><a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=3.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>'});
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;">\n</div>\n<div class="layoutRight" style="padding-left:7px;margin-left:4px;margin-top:6px;" id="settingsTab" style="visibility:hidden;">\n\t<button class="layoutRight core-sprite-wrench imageSprite" id="settingsAction" aria-live="off" style="visibility:hidden;"></button>\n</div>\n<div class="layoutRight status" id="statusPane" role="status" aria-live="off"></div>\n<ul class="layoutRight commandList pageActions" id="pageNavigationActions"></ul>'});
define("orion/objects",[],function(){return{mixin:function(g){Array.prototype.slice.call(arguments,1).forEach(function(k){for(var i=Object.keys(k),f=0;f<i.length;f++){var d=i[f];g[d]=k[d]}})}}});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(g,k){function i(f,d,a){this.CLEAR_PANEL=a!==null?a:!0;this.OPEN="false";a="";f.nodeType?this.node=f:(a=f+"_",f=document.getElementById(f),this.node=f.nodeType?f:document.createElement("span"));this.node.innerHTML=this.templateString;this.navLabelId=a+"navigationlabel";document.getElementById("navigationlabel").id=this.navLabelId;this.arrowId=a+"dropDownArrow";document.getElementById("dropDownArrow").id=this.arrowId;
this.navDropDownId=a+"navdropdown";document.getElementById("navdropdown").id=this.navDropDownId;if(d.icon)this.node.className=this.node.className+" "+d.icon,this.node.onclick=this.click.bind(this);else{if(d.label)f=document.getElementById(this.navLabelId),f.textContent=d.label,f.onclick=this.click.bind(this);if(d.caret)document.getElementById(this.arrowId).className=d.caret}this._dropdownNode=k.node(this.navDropDownId);this._triggerNode=k.node(this.navLabelId)}g.mixin(i.prototype,{templateString:'<div id="navigationlabel" class="navigationLabel dropdownTrigger" ></div><span id="dropDownArrow" class="dropDownArrow"></span><div class="dropDownContainer" id="navdropdown" style="display:none;"></div>',
click:function(){var f=document.getElementById(this.navDropDownId);f.style.display==="none"?this.updateContent(this.getContentNode(),function(){f.style.display="";this._positionDropdown();this.handle=k.addAutoDismiss([this.node,f],this.clearPanel.bind(this))}.bind(this)):this.CLEAR_PANEL&&this.clearPanel()},clearPanel:function(){document.getElementById(this.navDropDownId).style.display="none"},addContent:function(f){document.getElementById(this.navDropDownId).innerHTML=f},getContentNode:function(){return document.getElementById(this.navDropDownId)},
updateContent:function(f,d){d()},toggleLabel:function(f){document.getElementById(this.navLabelId).style.display=f?"":"none";document.getElementById(this.arrowId).style.display=f?"":"none"},_positionDropdown:function(){this._dropdownNode.style.left="";var f=k.bounds(this._dropdownNode),d=k.bounds(this._boundingNode(this._triggerNode));if(f.left+f.width>d.left+d.width)this._dropdownNode.style.right=0},_boundingNode:function(f){return f.style.right!==""||f.style.position==="absolute"||!f.parentNode||
!f.parentNode.style?f:this._boundingNode(f.parentNode)},destroy:function(){if(this.node)k.empty(this.node),this.node=this.select=null}});return i});
define("orion/widgets/input/GroupedContent",["orion/objects","orion/webui/littlelib"],function(g){function k(){}g.mixin(k.prototype,{templateString:'<div style="float:left;"><section><span style="color:#333;padding:15px;">Main Pages</span><nav><ul id="navigationlinks"></ul></nav></section></div><div class="groupedContentDivider"></div><div style="float:left;"><section><span style="color:#333;padding:15px;">Related Links</span><nav><ul id="relatedLinks"></ul></nav></section></div>',getContentPane:function(){return this.templateString}});
return k});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","Make Favorite":"Make Favorite","Delete the selected files or folders":"Delete the selected files or folders","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}'?","Are you sure you want to delete '${0}' from the favorites?":"Are you sure you want to delete '${0}' from the favorites?","Are you sure you want to delete these ${0} favorites?":"Are you sure you want to delete these ${0} favorites?",
"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the ${1} menu.":"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the ${1} menu.","Export as zip":"Export as 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":"New File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"New 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","Import local file...":"Import local file...",
"Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP from...","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 to...","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","Copy Items":"Copy Items","Copy the selected items to the copy/paste buffer":"Copy the selected items to the copy/paste buffer","Paste Items":"Paste Items","Paste items from the copy/paste buffer":"Paste items from the copy/paste buffer",
"Cannot paste into the Workspace root":"Cannot paste into the Workspace root","Open With":"Open With","Loading ":"Loading ",New:"New",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",Favorites:"Favorites","Import from HTTP...":"Import from 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} 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(g,k){var i={root:k};Object.keys(g).forEach(function(f){typeof i[f]==="undefined"&&(i[f]=g[f])});return i});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(g,k,i){function f(a,d,c){if(!a[d])throw d+g[" is not supported in this file system"];return a[d].apply(a,c)}function d(a,j,c,b){if(!a.readBlob)throw g["source file service does not support binary read"];if(!c.writeBlob)throw g["target file service does not support binary write"];if(j[j.length-1]!=="/")return f(a,"readBlob",[j]).then(function(a){return f(c,"writeBlob",[b,a])});var h=b.substring(0,
b.length-1),l=decodeURIComponent(h.substring(h.lastIndexOf("/")+1)),h=h.substring(0,h.lastIndexOf("/")+1);return f(c,"createFolder",[h,l]).then(function(){},function(){}).then(function(){return f(a,"fetchChildren",[j]).then(function(h){for(var f=[],j=0;j<h.length;++j){var l=h[j].Location,g=l;h[j].Directory&&(g=l.substring(0,l.length-1));g=decodeURIComponent(g.substring(g.lastIndexOf("/")+1));g=b+encodeURIComponent(g);h[j].Directory&&(g+="/");f[j]=d(a,l,c,g)}return k.all(f)})})}function a(a,d){function c(b){var c=
new k;c.reject(g["No Matching FileService for location:"]+b);return c}var b=a.getServiceReferences("orion.core.file"),h=b;if(d)for(var h=[],f=0;f<b.length;++f)d(b[f])&&h.push(b[f]);for(var n=[],m=[],s=[],r=[],q={fetchChildren:function(){var b=new k;b.resolve(r);return b},createWorkspace:function(){var b=new k;b.reject(g["no file service"]);return b},loadWorkspaces:function(){var b=new k;b.reject(g["no file service"]);return b},loadWorkspace:function(){var b=new k;window.setTimeout(function(){b.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:g["File Servers"],Location:"/",Children:r,ChildrenLocation:"/"})},100);return b},search:c,createProject:c,createFolder:c,createFile:c,deleteFile:c,moveFile:c,copyFile:c,read:c,write:c},b=0;b<h.length;++b)r[b]={Directory:!0,Length:0,LocalTimeStamp:0,Location:h[b].getProperty("top"),ChildrenLocation:h[b].getProperty("top"),Name:h[b].getProperty("Name")},f=h[b].getProperty("pattern")||".*",f[0]!=="^"&&(f="^"+f),n[b]=RegExp(f),m[b]=a.getService(h[b]),s[b]=h[b].getProperty("Name"),
h[b].getProperty("NameKey")&&h[b].getProperty("nls")&&i.getMessageBundle(h[b].getProperty("nls")).then(function(b,c){r[b].Name=c[h[b].getProperty("NameKey")];s[b]=c[h[b].getProperty("NameKey")]}.bind(this,b));this._getServiceIndex=function(b){if(b==="/")return-1;else if(!b||b.length&&b.length===0)return m[0]?0:-1;for(var c=0;c<n.length;++c)if(n[c].test(b))return c;throw g["No Matching FileService for location:"]+b;};this._getService=function(b){b=this._getServiceIndex(b);return b===-1?q:m[b]};this._getServiceName=
function(b){b=this._getServiceIndex(b);return b===-1?q.Name:s[b]};this._getServiceRootURL=function(b){b=this._getServiceIndex(b);return b===-1?q.Location:r[b].Location}}a.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 f(this._getService(a),"fetchChildren",arguments)},createWorkspace:function(a){return f(this._getService(),"createWorkspace",
arguments)},loadWorkspaces:function(){return f(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(a){return f(this._getService(a),"loadWorkspace",arguments)},createProject:function(a,d,c,b){return f(this._getService(a),"createProject",arguments)},createFolder:function(a,d){return f(this._getService(a),"createFolder",arguments)},createFile:function(a,d){return f(this._getService(a),"createFile",arguments)},deleteFile:function(a){return f(this._getService(a),"deleteFile",arguments)},
moveFile:function(a,j,c){var b=this._getService(a),h=this._getService(j);if(b===h)return f(b,"moveFile",arguments);var l=a[a.length-1]==="/",g=j;g[g.length-1]!=="/"&&(g+="/");if(c)g+=encodeURIComponent(c);else{var m=a;l&&(m=m.substring(0,m.length-1));g+=m.substring(m.lastIndexOf("/")+1)}l&&g[g.length-1]!=="/"&&(g+="/");return d(b,a,h,g).then(function(){return f(b,"deleteFile",[a])})},copyFile:function(a,j,c){var b=this._getService(a),h=this._getService(j);if(b===h)return f(b,"copyFile",arguments);
var l=a[a.length-1]==="/",g=j;g[g.length-1]!=="/"&&(g+="/");if(c)g+=encodeURIComponent(c);else{var m=a;l&&(m=m.substring(0,m.length-1));g+=m.substring(m.lastIndexOf("/")+1)}l&&g[g.length-1]!=="/"&&(g+="/");return d(b,a,h,g)},read:function(a,d){return f(this._getService(a),"read",arguments)},write:function(a,d,c){return f(this._getService(a),"write",arguments)},remoteImport:function(a,d){return f(this._getService(a),"remoteImport",arguments)},remoteExport:function(a,d){return f(this._getService(a),
"remoteExport",arguments)},search:function(a){return f(this._getService(a.resource),"search",arguments)}};a.prototype.constructor=a;return{FileClient:a}});
define("orion/globalCommands","i18n!orion/nls/messages,require,orion/commonHTMLFragments,orion/keyBinding,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/favorites,orion/contentTypes,orion/URITemplate,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/widgets/input/GroupedContent,orion/util,orion/customGlobalCommands,orion/fileClient".split(","),function(g,
k,i,f,d,a,e,j,c,b,h,l,n,m,s,r,q,p,t,o,v,z,u,w,x,A,F,B,C,G,H,K,O){function R(b,c){if(b.getLabel)return b.getLabel();else{var a=new z;a.resolve(c.properties.name);return a}}function T(b){l.node("progressPane").setAttribute("aria-label",g["Operations - Press spacebar to show current operations"]);(b=b.getService("orion.page.progress"))&&b.init.bind(b)("progressPane")}function U(b,c){var a=b.getServiceReferences("orion.core.auth");P=[];for(var e=J.createMenuGenerator.apply(this,arguments),d=0;d<a.length;d++){var o=
a[d],h=b.getService(o);R(h,o).then(function(b){h.getKey().then(function(c){P.push(c);h.getUser().then(function(a){e.addUserItem(c,h,b,a)},function(a,d){e.addUserItem(c,h,b,d)});window.addEventListener("storage",function(){M[c]!==localStorage.getItem(c)&&(M[c]=localStorage.getItem(c),h.getUser().then(function(a){e.addUserItem(c,h,b,a)},function(){e.addUserItem(c,h,b)}))},!1)})})}}function y(b,c,e,d,o){var h=arguments,f,u=b&&b.getServiceReferences("orion.page.link.related");u&&u.length!==0&&z.when(function(){if(f)return f;
var c=b.getService("orion.core.contenttypes");c||(c=new q.ContentTypeService(b),c=b.getService("orion.core.contenttypes"));return c.getContentTypes().then(function(b){return f=b})}(),function(){var l;if(J.beforeGenerateRelatedLinks.apply(this,h)){for(var v=[],g=0;g<u.length;g++){var n={},m,i=u[g].getPropertyKeys();for(m=0;m<i.length;m++)n[i[m]]=u[g].getProperty(i[m]);if(n.id){var w=function(b){if(b)if(!b.visibleWhen||b.visibleWhen(c)){var e=new a.CommandInvocation(c,c,null,b,d);J.addRelatedLinkCommand(b,
e)}else typeof o==="function"&&(l||(l=o()),z.when(l,function(e){e&&c===N&&(!b.visibleWhen||b.visibleWhen(e))&&J.addRelatedLinkCommand(b,new a.CommandInvocation(e,e,null,b,d))}))},k=null;m=null;if(e.indexOf(n.id)<0)if((n.nls&&n.nameKey||n.name)&&n.uriTemplate)m=j._createCommandOptions(n,u[g],b,f,!0),v.push(m),m.then(function(b){b=new a.Command(b);w(b)});else{if(!k&&(k=d.findCommand(n.id))){w(k);continue}if(!k){var A=b.getServiceReferences("orion.navigate.command");for(m=0;m<A.length;m++)if(A[m].getProperty("id")===
n.id){for(var n={},i=A[m].getPropertyKeys(),s=0;s<i.length;s++)n[i[s]]=A[m].getProperty(i[s]);m=j._createCommandOptions(n,A[m],b,f,!0);v.push(m);m.then(function(b){k=new a.Command(b);w(k)});break}}}}}z.all(v,function(b){return b}).then(function(){J.afterGenerateRelatedLinks.apply(this,h)})}})}function D(b){var c=l.node("globalActions");c&&(b.destroy(c),b.renderCommands(c.id,c,{},{},"tool"))}function E(b){var c={},a=null;typeof b==="string"&&(b=l.node(b));b||(b=l.node("pageActions"));for(var e=b;e&&
e.classList;){if(e.classList.contains("toolComposite")){a=e;break}e=e.parentNode}if(b.classList.contains("commandMarker"))c.commandNode=b;if(a&&(c.slideContainer=l.$(".slideParameters",a),c.parameterArea=l.$(".parameters",a),c.dismissArea=l.$(".parametersDismiss",a),c.notifications=l.$("#notificationArea",a),a.parentNode&&(c.toolbarTarget=l.$(".toolbarTarget",a.parentNode),c.toolbarTarget)))b=l.bounds(a),c.toolbarTargetY=b.height+1;return c}function I(b){if(b.toolbarTarget&&b.toolbarTargetY){var c=
0,a;b.notifications&&b.notifications.classList.contains("slideContainerActive")&&(a=l.bounds(b.notifications),c+=a.height);b.slideContainer&&b.slideContainer.classList.contains("slideContainerActive")&&(a=l.bounds(b.slideContainer),c+=a.height);c>0&&(c+=8);b.toolbarTarget.style.top=b.toolbarTargetY+c+"px";b.toolbarTarget.style.bottom=0}}var d=function(b){var c=document.createElement("a");c.href=b;return c.href}(k.toUrl("auth/NotifyAuthentication.html")),M={},J={createMenuGenerator:K.createMenuGenerator||
function(b,c){if(l.node("userMenu")){var a=l.node("userDropdown"),e=new m.Dropdown({dropdown:a}),a=new u.UserMenu({dropdownNode:a,dropdown:e,serviceRegistry:b}),e=l.node("userTrigger");new s.Tooltip({node:e,text:g.Options,position:["below","left"]});var e=document.getElementById("userTrigger"),d=e.className;d+=" imageSprite core-sprite-silhouette";e.className=d;a.setKeyAssist(c);return a}},beforeGenerateRelatedLinks:K.beforeGenerateRelatedLinks||function(){var b=l.node("relatedLinks");l.empty(b);
return!0},addRelatedLinkCommand:K.addRelatedLinkCommand||function(b,c){var e=l.node("relatedLinks");a.createCommandMenuItem(e,b,c).classList.remove("dropdownMenuItem")},afterGenerateRelatedLinks:K.afterGenerateRelatedLinks||function(){},afterSetPageTarget:K.afterSetPageTarget||function(){},generateNavigationMenu:K.generateNavigationMenu||function(){var b=document.getElementById("centralNavigation");new s.Tooltip({node:b,text:"Navigation Menu",position:["right"]});var b=new C("centralNavigation",{label:"Develop",
icon:"commandSprite core-sprite-hamburger"}),c=new G;b.addContent(c.getContentPane())},afterGenerateBanner:K.afterGenerateBanner||function(){}},P=[],N,S=[],L,Q=null;return{addSettings:function(b){(new C("settingsTab",{label:"Develop",icon:"imageSprite core-sprite-wrench"},!1)).updateContent=b.updateContent.bind(b)},generateBanner:function(b,d,h,j,u,z,m){function s(){this.create();this._filterString=""}function q(b){b.registerService("orion.cm.managedservice",{updated:function(b){for(var b=b&&b["links.newtab"]!==
"undefined"?b["links.newtab"]?"_blank":"_self":"_self",c=l.$$array(".targetSelector"),a=0;a<c.length;a++)c[a].target=b}},{pid:"nav.config"})}(new o.ThemePreferences(j,new v.ThemeData)).apply();var p=l.node(b);if(!p)throw g["could not find banner parent, id was "]+b;var C=document.createRange();C.selectNode(p);C=C.createContextualFragment(A);l.processTextNodes(C,g);p.firstChild?p.insertBefore(C,p.firstChild):p.appendChild(C);p=l.node("home");p.href=k.toUrl("navigate/table.html");p.setAttribute("aria-label",
g["Orion Home"]);l.node("progressPane").src=k.toUrl("images/none.png");if(p=l.node("pageToolbar"))p.classList.add("toolbarLayout"),p.innerHTML=B+i.slideoutHTMLFragment("mainToolbar");(p=l.node("closeNotifications"))&&p.setAttribute("aria-label",g["Close notification"]);if(p=l.node("footer"))p.innerHTML=F,l.processTextNodes(p,g);h.setParameterCollector(new e.CommandParameterCollector(E,I));document.addEventListener("keydown",function(b){b.keyCode===l.KEY.ESCAPE&&(b=d.getService("orion.page.message"))&&
b.setProgressMessage("")},!1);J.generateNavigationMenu.apply(this,arguments);var G=l.node("navigationlinks");G&&w.createPageLinks(d,"orion.page.link").then(function(b){b.forEach(function(b){var c=document.createElement("li");c.appendChild(b);G.appendChild(c)})});if(p=l.$(".split")){var C=l.$(".sidePanelLayout"),t=l.$(".mainPanelLayout");if(C&&t)Q={side:C,main:t},Q.splitter=new n.Splitter({node:p,sidePanel:C,mainPanel:t,toggle:!0,closeByDefault:p.style&&p.style.left==="0%"}),p=new a.Command({name:g["Toggle side panel"],
tooltip:g["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){Q.splitter.toggleSidePanel()}}),h.addCommand(p),h.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new f.KeyBinding("o",!0)),m&&Q.splitter.addResizeListener(function(b){m&&b===t&&(b=m.getTextView())&&b.resize()})}p=new a.Command({name:g["Make Favorite"],tooltip:g["Add to the favorites list"],imageClass:"core-sprite-favorite",id:"orion.makeFavorite",visibleWhen:function(b){b=Array.isArray(b)?
b:[b];if(b.length===0)return!1;for(var c=0;c<b.length;c++)if(!b[c].Location)return!1;return!0},callback:function(b){for(var b=Array.isArray(b.items)?b.items:[b.items],c=d.getService("orion.core.favorite"),a=d.getService("orion.page.progress"),e=function(b){return function(e){e?d.getService("orion.page.message").setMessage(b.Name+g[" is already a favorite."],2E3):a.progress(c.makeFavorites(b),"Making favorite "+b.Name)}},o=0;o<b.length;o++){var h=b[o];a.progress(c.hasFavorite(h.ChildrenLocation||h.Location),
"Checking favorite "+h.Name).then(e(h))}}});h.addCommand(p);var K=!1,R=function(b,c,a){if(!K){var e=c.getService("orion.core.favorite"),d=c.getService("orion.page.progress");e||(e=new r.FavoritesService({serviceRegistry:c}),e=c.getService("orion.core.favorite"));var o=new x.OpenResourceDialog({searcher:b,progress:d,searchRenderer:b.defaultRenderer,favoriteService:e,onHide:function(){K=!1;a&&a.getTextView()&&a.getTextView().focus()}});window.setTimeout(function(){K=!0;o.show()},0)}},p=new a.Command({name:g["Find File Named..."],
tooltip:g["Choose a file by name and open an editor on it"],id:"eclipse.openResource",callback:function(){R(u,d,m)}});h.addCommand(p);h.registerCommandContribution("globalActions","eclipse.openResource",100,null,!0,new f.KeyBinding("f",!0,!0));p=new a.Command({name:g["Toggle banner and footer"],tooltip:g["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var b=l.node("banner"),c=l.node("footer"),a=l.$(".content-fixedHeight");b.style.visibility==="hidden"?(b.style.visibility=
"visible",c.style.visibility="visible",a.classList.remove("content-fixedHeight-maximized")):(b.style.visibility="hidden",c.style.visibility="hidden",a.classList.add("content-fixedHeight-maximized"));m&&m.getTextView()&&m.getTextView().resize();return!0}});h.addCommand(p);h.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new f.KeyBinding("m",!0,!0));p=new a.Command({name:g["System Configuration Details"],tooltip:g["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});
h.addCommand(p);h.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new f.KeyBinding(112,!0,!0));p=new a.Command({name:g["Background Operations"],tooltip:g["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});h.addCommand(p);h.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new f.KeyBinding("o",!0,!0));s.prototype={create:function(){var b=this._keyAssistDiv=
document.createElement("div");b.id="keyAssist";b.style.display="none";b.classList.add("keyAssistFloat");b.setAttribute("role","menu");var c=this._keyAssistInput=document.createElement("input");c.classList.add("keyAssistInput");c.type="text";c.placeholder=g["Filter bindings"];b.appendChild(c);var a=this._keyAssistContents=document.createElement("div");a.classList.add("keyAssistContents");if(H.isIOS||H.isAndroid)a.style.overflowY="auto";b.appendChild(a);var e=this._keyAssistTable=document.createElement("table");
e.tabIndex=0;e.classList.add("keyAssistList");a.appendChild(e);document.body.appendChild(b);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));a.addEventListener(H.isFirefox?"DOMMouseScroll":"mousewheel",function(b){this._scrollWheel(b)}.bind(this));document.addEventListener("keydown",function(b){b.keyCode===l.KEY.ESCAPE&&this.hide()}.bind(this));
l.addAutoDismiss([b],function(){this.hide()}.bind(this))},createContents:function(){l.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;this._idCount=this._keyAssistContents.scrollTop=0;if(m&&m.getTextView()){var b=m.getTextView(),a=b.getActions(!0).filter(function(c){return(c=b.getActionDescription(c))&&c.name});a.sort(function(c,a){return b.getActionDescription(c).name.localeCompare(b.getActionDescription(a).name)});this.createHeader(g.Editor);for(var e=function(c){return function(){b.focus();
return b.invokeAction(c)}},d={},o,f=0;f<a.length;f++)for(var j=a[f],u=b.getActionDescription(j),v=b.getKeyBindings(j),n=0;n<v.length;n++){o=v[n];var z=c.getUserKeyString(o);o.scopeName?(d[o.scopeName]||(d[o.scopeName]=[]),d[o.scopeName].push({bindingString:z,name:u.name,execute:e(j)})):this.createItem(z,u.name,e(j))}for(var i in d)if(d[i].length){this.createHeader(i);for(a=0;a<d[i].length;a++)o=d[i][a],this.createItem(o.bindingString,o.name,o.execute)}}this.createHeader(g.Global);h.showKeyBindings(this)},
createItem:function(b,c,a){if(this._filterString){var e=this._filterString.toLowerCase(),d;e!==this._filterString?(e=this._filterString,d=function(b){return b}):d=function(b){return b.toLowerCase()};if(d(c).indexOf(e)===-1&&d(b).indexOf(e)===-1&&d(this._lastHeader).indexOf(e)===-1)return}var o=this._keyAssistTable.insertRow(-1);o.id="keyAssist-keyBinding-"+this._idCount++;o.setAttribute("role","menuitem");o._execute=a;o.classList.add("keyAssistItem");o.addEventListener("click",function(b){this._selectedRow=
o;this.execute();b.preventDefault()}.bind(this));a=o.insertCell(-1);a.classList.add("keyAssistName");a.appendChild(document.createTextNode(c));a=o.insertCell(-1);a.classList.add("keyAssistAccel");a.appendChild(document.createTextNode(b))},createHeader:function(b){this._lastHeader=b;var c=this._keyAssistTable.insertRow(-1);c.classList.add("keyAssistSection");var c=c.insertCell(-1),a=document.createElement("h2");a.appendChild(document.createTextNode(b));c.appendChild(a)},execute:function(){window.setTimeout(function(){this.hide();
var b=this._selectedRow;this._selectedRow=null;b&&b._execute&&b._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var b=this._keyAssistInput.value;if(this._filterString!==b)this._filterString=b,this.createContents()}.bind(this),100)},hide:function(){var b=document.activeElement,c=this._keyAssistDiv,b=c===b||(c.compareDocumentPosition(b)&16)!==0;c.style.display="none";b&&document.compareDocumentPosition(this._previousActiveElement)!==
1&&this._previousActiveElement.focus();this._previousActiveElement=null},isVisible:function(){return this._keyAssistDiv.style.display==="block"},select:function(b){var c=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(c.length===0)this._selectedIndex=-1;else{var a=this._selectedIndex;a+=b?1:-1;a%=c.length;a<0&&(a=c.length-1);if(this._selectedIndex!==-1)b=c[this._selectedIndex],b.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=a;if(this._selectedIndex!==-1){this._selectedRow=
b=c[this._selectedIndex];b.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",b.id);this._keyAssistTable.focus();var c=b.getBoundingClientRect(),e=this._keyAssistContents,d=e.getBoundingClientRect();b.offsetTop<e.scrollTop?a===0?e.scrollTop=0:b.scrollIntoView(!0):c.bottom>d.bottom&&b.scrollIntoView(!1)}}},show:function(){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(b){if(b.keyCode===40)this.select(!0);else if(b.keyCode===38)this.select(!1);else if(b.keyCode===13)this.execute();else return;b.preventDefault()},_scrollWheel:function(b){var c=0,c=H.isIE||H.isOpera?-b.wheelDelta:H.isFirefox?b.detail*40:-b.wheelDeltaY,a=this._keyAssistContents,e=a.scrollTop;a.scrollTop+=c;if(e!==a.scrollTop)return b.preventDefault&&
b.preventDefault(),!1}};var O=new s,y=new a.Command({name:g["Show Keys"],tooltip:g["Show a list of all the keybindings on this page"],id:"eclipse.keyAssist",callback:function(){O.isVisible()?O.hide():O.show();return!0}});h.addCommand(y);h.registerCommandContribution("globalActions","eclipse.keyAssist",100,null,!0,new f.KeyBinding(191,!1,!0));p=function(){m.getTextView().setKeyBinding(new f.KeyBinding(191,!1,!0,!H.isMac,H.isMac),y.id);m.getTextView().setAction(y.id,y.callback,y)};m&&(m.getTextView()?
p():m.addEventListener("TextViewInstalled",p));D(h);U(d,y.callback);T(d);window.addEventListener("hashchange",function(){h.processURL(window.location.href)},!1);window.setTimeout(function(){q(d)},0);J.afterGenerateBanner.apply(this,arguments)},getToolbarElements:E,getMainSplitter:function(){return Q},layoutToolbarElements:I,setPageTarget:function(b){var c,a,e=b.breadcrumbRootName,d=b.serviceRegistry;b.target?(b.searchService&&b.searchService.setLocationByMetaData(b.target),b.fileService&&!b.breadcrumbTarget&&
(a=e?e+" ":"",a+=b.fileService.fileServiceName(b.target.Location),e=null),c=b.name||b.target.Name,N=b.target,y(d,b.target,S,b.commandService,b.makeAlternate)):(b.breadcrumbTarget||(e=e||b.task||b.name),c=b.name,y(d,{NoTarget:""},S,b.commandService,b.makeAlternate));(L=b.title)||(L=c?c+" - "+b.task:b.task);window.document.title=L;J.afterSetPageTarget.apply(this,arguments);if(c=l.node("location")){l.empty(c);var o=d&&new O.FileClient(d),d=b.breadcrumbTarget||b.target,o=o&&d&&d.Location?o.fileServiceRootURL(d.Location):
null;new h.BreadCrumbs({container:c,resource:d,rootSegmentName:e,workspaceRootSegmentName:a,workspaceRootURL:o,makeHref:b.makeBreadcrumbLink})}},setDirtyIndicator:function(b){if(L)L.charAt(0)==="*"&&!b&&(L=L.substring(1)),b&&L.charAt(0)!=="*"&&(L="*"+L),window.document.title=L;var c=l.node("dirty");if(c)c.textContent=b?"*":""},setPageCommandExclusions:function(b){S=b},notifyAuthenticationSite:d}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(g){return{detectValidURL:function(k){for(var i=/\[([^\]]*)\]\(([^\)]+)\)/g,f=i.exec(k),d=[],a=0;f;){if(f.length===3&&f[2].length>0){var e=new URL(f[2]);e.protocol!==":"&&g.validateURLScheme(e.href)&&(f.index>a&&d.push({segmentStr:k.substring(a,f.index)}),d.push({segmentStr:f[1].length>0?f[1]:f[2],urlStr:f[2]}),a=f.index+f[0].length)}f=i.exec(k)}if(a===0)return null;a<k.length-1&&d.push({segmentStr:k.substring(a)});return d},processURLSegments:function(g,
i){i.forEach(function(f){if(f.urlStr){var d=document.createElement("a");d.href=f.urlStr;d.appendChild(document.createTextNode(f.segmentStr))}else d=document.createElement("span"),d.textContent=f.segmentStr;g.appendChild(d)})}}});
define("orion/status",["require","orion/webui/littlelib","orion/globalCommands","orion/PageUtil","orion/urlUtils"],function(g,k,i,f,d){function a(a,c,b,e,d){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.message",this);this._operationsClient=c;this.notificationContainerDomId=d;this.domId=b;this.progressDomId=e||b;this._hookedClose=!1;this._timer=null}var e;a.prototype={_init:function(){var a=k.node("closeNotifications");if(a&&!this._hookedClose)this._hookedClose=!0,
a.addEventListener("click",function(){window.clearTimeout(this._timer);this.setProgressMessage("")}.bind(this))},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=i.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(a,c,b){this._init();this.currentMessage=a;var e=k.node(this.domId);if(typeof b==="boolean"){var d=e.getAttribute("aria-live");e.setAttribute("aria-live",b?"polite":"off");window.setTimeout(function(){a===
this.currentMessage&&(k.empty(e),e.appendChild(document.createTextNode(a)),window.setTimeout(function(){e.setAttribute("aria-live",d)},100))}.bind(this),100)}else k.empty(e),e.appendChild(document.createTextNode(a));typeof c==="number"&&window.setTimeout(function(){a===this.currentMessage&&(k.empty(e),e.appendChild(document.createTextNode("")))}.bind(this),c)},setErrorMessage:function(a){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,e="red";if(c.Severity)switch(c.Severity){case "Warning":e="#FFCC00";break;case "Error":e="red";break;case "Info":case "Ok":e="green"}c=document.createElement("span");c.style.color=e;c.appendChild(document.createTextNode(a));a=k.node(this.domId);k.empty(a);a.appendChild(c)},setProgressMessage:function(a){this._init();this.currentMessage=a;var c=document.createElement("span");c.classList.add("imageSprite");c.classList.add("progressIcon");c.classList.add("core-sprite-progress");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")},setProgressResult:function(a){this.currentMessage=a;var c=a.responseText||a;if(typeof c===
"string")try{c=JSON.parse(c)}catch(b){}this._init();var e=c.Message||c,f="core-sprite-information",g="progressInfo",m=document.createElement("span");m.classList.add("imageSprite");m.classList.add("progressIcon");a=[];if(c.Severity)switch(c.Severity){case "Warning":f="core-sprite-warning";g="progressWarning";a.push("progressInfo");a.push("progressError");a.push("progressNormal");break;case "Error":f="core-sprite-error";g="progressError";a.push("progressWarning");a.push("progressInfo");a.push("progressNormal");
break;default:a.push("progressWarning"),a.push("progressError"),a.push("progressNormal")}a.push("notificationHide");m.classList.add(f);var i=k.node(this.progressDomId),f=k.node(this.notificationContainerDomId);k.empty(i);i.appendChild(m);if(c.HTML)c=document.createElement("span"),c.innerHTML=e,i.appendChild(c);else{if(m=d.detectValidURL(e))e=document.createDocumentFragment(),d.processURLSegments(e,m),Array.prototype.forEach.call(k.$$("a",e),function(b){b.target="_blank"});else{if(c.Severity!=="Warning"&&
c.Severity!=="Error")this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3);e=document.createTextNode(e)}i.appendChild(e)}if(g&&this.progressDomId!==this.domId){f.classList.add(g);for(g=0;g<a.length;g++)f.classList.remove(a[g])}f.classList.add("notificationShow")},showWhile:function(a,c){var b=this;if(c){b.setProgressMessage(c);var e=function(){c===b.currentMessage&&b.setProgressMessage("")};a.then(e,e)}return a},
_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(a,c){return new e(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;e=function(a,c,b,e){this.statusService=a;this.progressId=c;if(b){this.deferred=b;this.begin(e);var d=this;b.then(function(){d.done.bind(d)()},function(){d.done.bind(d)()})}};
e.prototype.begin=function(a){this.status=a;this.statusService._beginProgressMonitor(this)};e.prototype.done=function(a){this.status=a;this.statusService._doneProgressMonitor(this)};e.prototype.worked=function(a){this.status=a;this.statusService._workedProgressMonitor(this)};e.prototype.constructor=e;return{StatusReportingService:a,ProgressMonitor:e}});
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(g,k){var i={root:k};Object.keys(g).forEach(function(f){typeof i[f]==="undefined"&&(i[f]=g[f])});return i});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(g,k,i,f){function d(){}d.prototype={_initialize:function(a,e,d,c,b){this._tooltip=new f.Tooltip({node:a,hideDelay:b||0,afterShowing:this._afterShowingFunction(e).bind(this),afterHiding:d,trigger:c?c:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";a=document.createRange();a.selectNode(this.$parent);a=a.createContextualFragment(this.TEMPLATE);
this.messages&&i.processTextNodes(a,g);this.$parent.appendChild(a);var h=this._tooltip;this.$parent.addEventListener("keydown",function(b){b.keyCode===i.KEY.ESCAPE&&h.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(a){for(var e=0;e<a.childNodes.length;e++){var d=a.childNodes[e];d.id&&(this["$"+d.id]=d);this._bindElements(d)}},_afterShowingFunction:function(a){return function(){a&&a.bind(this)();if(!this.customFocus){var e=
i.firstTabbable(this.$parent);e&&e.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};d.prototype.constructor=d;return{PopupDialog:d}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(g,k,i,f){var d={};(function(){var a=!1;d.updateNavTools=function(e,d,c,b,h,f){var n=i.node(b);if(n)d.destroy(n);else throw g["could not find toolbar "]+b;d.renderCommands(b,n,f,c,"button");if(h&&(b=i.node(h)))d.destroy(b),d.renderCommands(h,b,null,c,"button");a||(a=!0,e.getService("orion.page.selection").addEventListener("selectionChanged",function(b){var a=i.node(h);
a&&(d.destroy(a),d.renderCommands(h,a,b.selections,c,"button"))}))};d.createOperationsCommands=function(a,d,c){function b(b){return!b.operation||!b.operation.type?!1:b.operation.type==="loadstart"||b.operation.type==="progress"}var h=new f.Command({name:g["Remove Completed"],tooltip:g["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){c.removeCompletedOperations().then(function(){d.loadOperations.bind(d)()})},visibleWhen:function(){return!0}});a.addCommand(h);
h=new f.Command({name:g.Remove,tooltip:g["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(b){for(var b=Array.isArray(b.items)?b.items:[b.items],a=0;a<b.length;a++){var e=b[a];c.removeOperation.bind(c)(e.Location).then(function(){d.loadOperations.bind(d)()},function(){d.loadOperations.bind(d)()})}},visibleWhen:function(c){if(!Array.isArray(c)||c.length===0)return!b(c);for(var a in c)if(b(c[a]))return!1;return!0}});a.addCommand(h);
h=new f.Command({name:g.Cancel,tooltip:g["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],c=0;c<b.length;c++){var a=b[c];a.deferred&&a.deferred.cancel()}},visibleWhen:function(c){if(!Array.isArray(c)||c.length===0)return b(c)&&(c.operation&&c.operation.cancelable?!0:!1);for(var a in c)if(!b(c[a])||!c[a].operation||!c[a].operation.cancelable)return!1;return!0}});a.addCommand(h)}})();
return d});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(g,k,i,f,d){function a(a){this._options=a}a.prototype=new f.PopupDialog;a.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>';a.prototype._init=
function(a){this._myOperations=[];this._operationsDeferreds=[];this._commandService=a.commandRegistry;d.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(a.triggerNode)};a.prototype._bindToDom=function(){this.$allOperationsLink.href=k.toUrl("operations/list.html");this._setOperationsVisibility()};a.prototype.setOperations=function(a,d){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(a)for(var c in a)this._myOperations.push(a[c]),this._operationsDeferreds.push(d[c]);this._renderOperations()};a.prototype.parseProgressResult=function(a){if(!a)return{};a=a.responseText||a;try{a=JSON.parse(a)}catch(d){}var c={Message:a.Message||a,Severity:a.Severity};if(a.DetailedMessage&&a.DetailedMessage!==c.Message)c.DetailedMessage=a.DetailedMessage;return c};a.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};a.prototype._renderOperationsTable=function(a,d,c){i.empty(a);for(var b=0;b<d.length;b++){var h=d[b],f=document.createElement("tr"),n=document.createElement("td");n.style.paddingLeft="5px";n.style.paddingRight="5px";n.textContent=h.Name;f.appendChild(n);var m=document.createElement("div");n.appendChild(m);n=document.createElement("span");n.style.paddingRight="5px";n.classList.add("imageSprite");switch(h.type){case "Warning":n.classList.add("core-sprite-warning");n.setAttribute("aria-label",
g["Operation resulted in a warning."]);break;case "error":n.classList.add("core-sprite-error");n.setAttribute("aria-label",g["Operation resulted in an error."]);break;case "loadstart":case "progress":n.classList.add("core-sprite-start");n.setAttribute("aria-label",g["Operation is running."]);break;case "abort":n.classList.add("core-sprite-stop");n.setAttribute("aria-label",g["Operation is canceled."]);break;case "load":case "loadend":n.classList.add("core-sprite-ok"),n.setAttribute("aria-label","Operation ok.")}m.appendChild(n);
n=document.createElement("span");n.classList.add("operationStatus");n.textContent=h.Name;m.appendChild(n);if(h.error){var k=h.error.Message||h.error;h.error.DetailedMessage&&h.error.DetailedMessage!==""&&(k+=": "+h.error.DetailedMessage);n.textContent=k;n.classList.remove("operationStatus");n.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",m,{operation:h,deferred:c[b]},this,"tool");a.appendChild(f)}this._setOperationsVisibility()};a.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"};a.prototype.constructor=a;return{OperationsDialog:a}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(g,k,i,f,d){function a(a,c){if(!this._progressPane){this._progressPane=f.node(a);this._operationsDialog=new d.OperationsDialog({triggerNode:this._progressPane,commandRegistry:c});var b=this;this._progressPane.addEventListener("keydown",function(c){(c.charOrCode===" "||c.keyCode===f.KEY.ENTER)&&b._operationsDialog.show()})}}function e(a,c,b,e){this._serviceRegistry=
a;this._serviceRegistration=a.registerService("orion.page.progress",this);this._commandRegistry=b;this._operationsClient=c;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=e}a.prototype={_switchIconTo:function(a){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=a;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(a,c){var b=
{},e;for(e in a)a[e].progressMonitor||(b[e]=a[e]);if(this._isEmpty(b))this._switchIconTo("progressPane_empty"),this._progressPane.title=g.Operations,this._progressPane.alt=g.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var d="";for(e in b){var f=b[e];if(f.type&&(f.type==="loadstart"||f.type==="progress")){d="running";break}}switch(d){case "running":this._progressPane.title=g["Operations running"];this._progressPane.alt=g["Operations running"];
this._progressPane.setAttribute("aria-valuetext",g["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=g["Some operations finished with warning"];this._progressPane.alt=g["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",g["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=g["Some operations finished with error"];this._progressPane.alt=
g["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",g["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=g.Operations,this._progressPane.alt=g.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_operations")}}this._operationsDialog.setOperations(b,c)},_isEmpty:function(a){for(var c in a)return!1;return!0}};
a.prototype.constructon=a;e.prototype={init:function(e){if(!this._progressMonitorClass)this._progressMonitorTool=new a(e,this._commandRegistry)},progress:function(a,c,b){var e=this,d=this._operationsIndex++;!b&&this._progressMonitorClass&&(b=new this._progressMonitorClass,b.begin(c));a.then(function(){if(e._operations[d]){var f=e._operations[d];if(c)f.Name=c;e._lastOperation=f;f.type="loadend";if(b)f.progressMonitor=b;e.writeOperation.bind(e)(d,f,a);f.Location||e._removeOperationFromTheList.bind(e)(d)}},
function(f){if(e._operations[d]){var g=e._operations[d];if(c)g.Name=c;if(b)g.progressMonitor=b;e._lastOperation=g;g.type=f.canceled?"abort":"error";g.error=f;e.writeOperation.bind(e)(d,g,a);g.Location||e._removeOperationFromTheList.bind(e)(d)}},function(f){if(c)f.Name=c;if(b)f.progressMonitor=b;e.writeOperation.bind(e)(d,f,a)});return a},removeOperation:function(a){for(var c in this._operations)if(this._operations[c].Location&&this._operations[c].Location===a){this._removeOperationFromTheList(c);
break}this._operationsClient.removeOperation.bind(this._operationsClient)(a)},_removeOperationFromTheList:function(a){var c=this._operations[a].progressMonitor;delete this._operations[a];delete this._operationDeferrds[a];c?c.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var a in this._operations){var c=this._operations[a];if(c.type&&c.type!=="loadstart"&&c.type!=="progress")(c=this._operations[a].progressMonitor)&&
c.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,c){c&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(c);var b=this;a.then(function(){b._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(c){b.setProgressResult.bind(b)(c);
return c});return this.progress(a,c)},writeOperation:function(a,c,b){this._operations[a]=c;this._operationDeferrds[a]=b;c.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(b){b.put(c.Location,{Name:c.Name,expires:c.expires})});c.progressMonitor?c.progressMonitor.progress(c.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};e.prototype.constructor=e;return{ProgressService:e}});
define("orion/dialogs",[],function(){function g(g){this._serviceRegistry=g;this._serviceRegistration=g.registerService("orion.page.dialog",this)}g.prototype={confirm:function(g,i){i(window.confirm(g))},openFiles:function(){}};g.prototype.constructor=g;return{DialogService:g}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(g){function k(i,f){f||(f="orion.page.selection");this._serviceRegistry=i;g.attach(this);this._serviceRegistration=i.registerService(f,this);this._selections=null}k.prototype={getSelection:function(g){var f=this._getSingleSelection();typeof g==="function"&&g(f);return f},getSelections:function(g){var f=Array.isArray(this._selections)?this._selections.slice():[];typeof g==="function"&&g(f);return f},_getSingleSelection:function(){return this._selections&&
this._selections.length>0?this._selections[0]:null},setSelections:function(g){var f=this._selections;this._selections=Array.isArray(g)?g.length>0?g.slice():null:g?[g]:null;f!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};k.prototype.constructor=k;return{Selection:k}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(g,k){function i(a,d,c){return a[d].apply(a,c)}function f(a){this._location=a}function d(){var a=new k;a.reject(g["No Matching OperationService for location:"]+this._location);return a}function a(a){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=a.getService("orion.core.preference");for(var d=a.getServiceReferences("orion.core.operation"),
c=0;c<d.length;c++){var b=a.getService(d[c]);this._services[c]=b;b=d[c].getProperty("pattern")||".*";b[0]!=="^"&&(b="^"+b);this._patterns[c]=RegExp(b)}this._getService=function(b){if(!b)return this._services[0];for(var c=0;c<this._patterns.length;++c)if(this._patterns[c].test(b))return this._services[c];return new f(b)}}f.prototype={getOperation:d,getOperations:d,removeCompletedOperations:d,removeOperation:d,cancelOperation:d};f.prototype.constructor=f;a.prototype={getOperations:function(){var a=
new k;if(this._operations)return a.resolve(this._operations),a;var d=this;this._preferenceService.getPreferences("/operations").then(function(c){d._operations=c;a.resolve(d._operations)});return a},getOperation:function(a){return i(this._getService(a),"getOperation",arguments)},removeCompletedOperations:function(){for(var a=[],d=this,c=0;c<this._services.length;c++){var b=this._patterns[c],h=new k;a[c]=h.promise;i(this._services[c],"removeCompletedOperations").then(function(c){return function(a){Array.isArray(a)&&
d.getOperations.bind(d)().then(function(e){for(var d=e.keys(),h=0;h<d.length;h++){var f=d[h];b.test(f)&&a.indexOf(f)<0&&e.remove(f)}c.resolve()})}}(h),function(b){return function(c){b.reject(c)}}(h))}return k.all(a)},removeOperation:function(a){var d=this;return i(this._getService(a),"removeOperation",arguments).then(function(){d.getOperations.bind(d)().then(function(c){c.remove(a)})},function(c){return c},function(c){return c})}};a.prototype.constructor=a;return{OperationsClient:a}});
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",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.",
"Files that contain:":"Files that contain:",Search:"Search","All types":"All types","File type":"File type","All ${0} files":"All ${0} files","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 in Search page for this directory","${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"});define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(g,k){var i={root:k};Object.keys(g).forEach(function(f){typeof i[f]==="undefined"&&(i[f]=g[f])});return i});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(g,k){function i(f){this._init(f)}i.prototype={_init:function(f){var d=f.parent,a=this,d=k.node(d);if(!d)throw g["no parent"];if(!f.model)throw g["no tree model"];if(!f.renderer)throw g["no renderer"];this._parent=d;this._treeModel=f.model;this._renderer=f.renderer;this._showRoot=f.showRoot===void 0?!1:f.showRoot;this._indent=f.indent===void 0?16:f.indent;this._onCollapse=f.onCollapse;this._labelColumnIndex=
f.labelColumnIndex===void 0?0:f.labelColumnIndex;this._id=f.id===void 0?"treetable":f.id;this._tableStyle=f.tableStyle;this._tableElement=f.tableElement||"table";this._tableBodyElement=f.tableBodyElement||"tbody";this._tableRowElement=f.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(e){a._showRoot?(e._depth=0,a._generate([e],0)):a._treeModel.getChildren(e,function(e){a._generate(e,0)})})},_generate:function(f,d){k.empty(this._parent);var a=document.createElement("div");this._renderer.wrapperCallback&&
this._renderer.wrapperCallback(a);var e=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(e);e.id=this._id;this._tableStyle&&e.classList.add(this._tableStyle);this._renderer.initTable(e,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+"tbody";this._generateChildren(f,d);e.appendChild(this._bodyElement);a.appendChild(e);
this._parent.appendChild(a);this._rowsChanged()},_generateChildren:function(f,d,a){for(var e=0;e<f.length;e++){var j=document.createElement(this._tableRowElement);j.id=this._treeModel.getId(f[e]);this._renderer.rowCallback&&this._renderer.rowCallback(j);j._depth=d;j._item=f[e];this._renderer.render(f[e],j);j.childNodes[this._labelColumnIndex].style.paddingLeft=this._indent*d+"px";a?(this._bodyElement.insertBefore(j,a.nextSibling),a&&(a=j)):this._bodyElement.appendChild(j)}},_rowsChanged:function(){this._renderer.rowsChanged&&
this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(f,d,a){var e=this._treeModel.getId(f),j;if(e===this._id)this._removeChildRows(e),this._generateChildren(d,0),this._rowsChanged();else{var c=k.node(e);c?(c._item=f,c&&(a||c._expanded)?(c._expanded=!0,this._removeChildRows(e),this._renderer.updateExpandVisuals(c,!0),d?(this._generateChildren(d,c._depth+1,c),this._rowsChanged()):(j=this,d=this._treeModel.getChildren(c._item,function(b){j._generateChildren(b,
c._depth+1,c);j._rowsChanged()}))):this._renderer.updateExpandVisuals(c,!1)):console.log(g["could not find table row "]+e)}},getItem:function(f){var d=k.node(f);return d&&d._item?d._item:f},toggle:function(f){var d=k.node(f);d&&(d._expanded?(this.collapse(f),this._renderer.updateExpandVisuals(d,!1)):(this.expand(f),this._renderer.updateExpandVisuals(d,!0)))},isExpanded:function(f){return(f=k.node(f))?f._expanded:!1},expand:function(f,d,a){var f=typeof f==="string"?f:this._treeModel.getId(f),e=k.node(f);
if(e&&!e._expanded){e._expanded=!0;var j=this;this._renderer.updateExpandVisuals(e,!0);this._treeModel.getChildren(e._item,function(c){j._generateChildren(c,e._depth+1,e);j._rowsChanged();d&&d.apply(j,a)})}},_removeChildRows:function(f){for(var d=f===this._id,a=!1,e=-1,j=[],c=k.$$array(".treeTableRow",this._parent),b=0;b<c.length;b++){var h=c[b];if(a)break;if(d)h._depth>e?j.push(h):a=!0;else if(h.id===f)d=!0,e=h._depth}for(f=0;f<j.length;f++)d=j[f],d.parentNode.removeChild(d)},collapse:function(f){var f=
typeof f==="string"?f:this._treeModel.getId(f),d=k.node(f);if(d){if(!d._expanded)return;d._expanded=!1;this._renderer.updateExpandVisuals(d,!1);this._removeChildRows(f);this._rowsChanged()}this._onCollapse&&this._onCollapse(d._item)}};i.prototype.constructor=i;return{TableTree:i}});
define("orion/treeModelIterator",[],function(){var g={};g.TreeModelIterator=function(){function g(i,f){this.firstLevelChildren=i;this.reset();this._init(f)}g.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 f=this._getChildren(g),f=f&&f.length>0;this.isExpanded&&f&&(f=this.isExpanded(g));return f},_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 f=this._diveIn(this._cursor);
if(!f){if(g&&this._expandable(this._cursor)&&this.forceExpandFunc){var d=this;return this.forceExpandFunc(this._cursor,"first",function(a){a&&d.setCursor(a)})}(f=this._findSibling(this._cursor,!0))&&this.setCursor(f)}return f},_backward:function(g){if(!this._cursor)return null;var f=this._findSibling(this._cursor,!1);f&&f!==this._cursor.parent&&(f=this._drillToLast(f));if(g&&f&&this._expandable(f)&&this.forceExpandFunc&&f!==this._cursor.parent){var d=this;return this.forceExpandFunc(f,"last",function(a){a&&
d.setCursor(a)})}f&&this.setCursor(f);return f},_findSibling:function(g,f){for(var d=this.topLevel(g),a=this._getChildren(g.parent),a=d?this.firstLevelChildren:a,e=0;e<a.length;e++)if(a[e]===g)return e===0&&!f?d?null:g.parent:e===a.length-1&&f?d?null:this._findSibling(g.parent,f):f?a[e+1]:a[e-1];return null},_inParentChain:function(g,f){for(var d=g.parent;d;){if(d===f)return!0;d=d.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,f,d){this.setCursor(f);var a=[];for(a.push(f);;){if(this.iterate(g))a.push(this.cursor());else break;if(d===this.cursor())return a}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,f){var d=this.cursor(),
a=this._scan(!0,g,f);a||(a=this._scan(!1,g,f));this.setCursor(d);return a},iterate:function(g,f){return g?this._forward(f):this._backward(f)},iterateOnTop:function(g,f){var d=this._findSibling(this._getTopLevelParent(this.cursor()),g);d?this.setCursor(d):f&&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 g}();return g});
define("orion/explorers/explorerNavHandler",["i18n!orion/nls/messages","orion/webui/littlelib","orion/treeModelIterator"],function(g,k,i){var g={},f=navigator.userAgent.indexOf("iPad")!==-1,d=window.navigator.platform.indexOf("Mac")!==-1;g.ExplorerNavHandler=function(){function a(a,d,c){this.explorer=a;this.model=this.explorer.model;this._navDict=d;this._listeners=[];this._selections=[];this._currentColumn=0;var b=this._getEventListeningDiv();b.tabIndex=0;b.classList.add("selectionModelContainer");
var h=this;this._modelIterator=new i.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:c.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,c,a){return h.explorer.forceExpandFunc(b,c,a)}:void 0});this._init(c);(!c||c.setFocus!==!1)&&b.focus();a=function(c){if(c.target===b){if(h.explorer.preventDefaultFunc&&h.explorer.preventDefaultFunc(c,
h._modelIterator.cursor()))return!0;if(c.keyCode===k.KEY.DOWN)return h.onDownArrow(c);else if(c.keyCode===k.KEY.UP)return h.onUpArrow(c);else if(c.keyCode===k.KEY.RIGHT)return h.onRightArrow(c);else if(c.keyCode===k.KEY.LEFT)return h.onLeftArrow(c);else if(c.keyCode===k.KEY.SPACE)return h.onSpace(c);else if(c.keyCode===k.KEY.ENTER)return h.onEnter(c)}};b.addEventListener("keydown",a,!1);this._listeners.push({type:"keydown",listener:a});a=function(){if(h.explorer.onFocus)h.explorer.onFocus(!1);else h.toggleCursor(null,
!1)};b.addEventListener("blur",a,!1);this._listeners.push({type:"blur",listener:a});a=function(){if(h.explorer.onFocus)h.explorer.onFocus(!0);else h.toggleCursor(null,!0)};b.addEventListener("focus",a,!1);this._listeners.push({type:"focus",listener:a});this._parentDiv=b}a.prototype={_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 d?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):k.node(this.explorer._parentId)},
isExpandable:function(a){return!a?!1:k.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){var d=this;this.explorer.selection&&this.explorer.selection.getSelections(function(c){d._clearSelection();for(var b=0;b<c.length;b++)d._selections.push(c[b]);d._selections.length>0&&d.cursorOn(d._selections[0],!0,!1,a)})},refreshModel:function(a,d,c,b){this._currentColumn=
0;this.topIterationNodes=[];this.model=d;this._navDict=a;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(c)this.topIterationNodes=c;this._modelIterator.setTree(this.topIterationNodes);!b&&this.explorer.selection&&this._modelIterator.reset();this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(a){for(var a=this.model.getId(a),d=0;d<this._selections.length;d++)if(a===this.model.getId(this._selections[d]))return d;
return-1},_clearSelection:function(a){if(a)for(a=0;a<this._selections.length;a++)this._checkRow(this._selections[a],!0);this._selections=[]},setSelection:function(a,d){if(this._selectionPolicy==="cursorOnly")d&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(a,!0);else if(this._isRowSelectable(a)){if(!d||this._selectionPolicy==="singleSelection")this._clearSelection(!0),this._checkRow(a,!1),this._selections.push(a),this._lastSelection=a;else{var c=this._inSelection(a);c>=0?(this._checkRow(a,
!0),this._selections.splice(c,1)):(this._checkRow(a,!1),this._selections.push(a),this._lastSelection=a)}this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(a,d){a||(a=this.currentModel());var c=this._getGridChildren(a);if(c&&c.length>1||d===0&&c){d!==0&&this.toggleCursor(a,!1);var b=this._currentColumn,h=!0;b+=d;b<0?(this._linearGridMove&&d!==0&&(this._modelIterator.iterate(!1)?a=this.currentModel():h=!1),
b=h?c.length-1:this._currentColumn):b>=c.length&&(this._linearGridMove&&d!==0&&(this._modelIterator.iterate(!0)?a=this.currentModel():h=!1),b=h?0:this._currentColumn);this._currentColumn=b;d!==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 d=
this._parentDiv,c;a&&a!==d&&(c=a.getAttribute("role"))!=="grid"&&c!=="tree"&&c!=="treegrid";)a=a.parentNode;return a===d?null:a},toggleCursor:function(a,d){var c=this.getRowDiv(a),b=this.getCurrentGrid(a);b?(c&&(d?c.classList.add("treeIterationCursorRow"):c.classList.remove("treeIterationCursorRow")),b.domNode&&(c=this.getAriaContainerElement(b.domNode),d?(b.domNode.classList.add("treeIterationCursor"),c&&c.setAttribute("aria-activedescendant",b.domNode.id)):b.domNode.classList.remove("treeIterationCursor"))):
c&&(d?c.classList.add("treeIterationCursorRow_Dotted"):c.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(a,d,c,b){var c=c===void 0?!1:c,h,f;if(a||d){if(f===this._modelIterator.cursor())return;h=this._modelIterator.cursor();f=a;this._modelIterator.setCursor(f)}else h=this._modelIterator.prevCursor(),f=this._modelIterator.cursor();if(h!==f||d)if(this.toggleCursor(h,!1),!d||f)if(this.moveColumn(null,0),this.toggleCursor(f,
!0),(a=this.getRowDiv())&&!b&&!this._visible(a)&&a.scrollIntoView(!c),this.explorer.onCursorChanged)this.explorer.onCursorChanged(h,f)},getSelection:function(){return this._selections},getSelectionIds:function(){for(var a=[],d=0;d<this._selections.length;d++)a.push(this.model.getId(this._selections[d]));return a},getRowDiv:function(a){a=a?a:this._modelIterator.cursor();if(!a)return null;var a=this.model.getId(a),d=this._navDict.getValue(a);return d&&d.rowDomNode?d.rowDomNode:k.node(a)},iterate:function(a,
d,c){this.topIterationNodes.length!==0&&this._modelIterator.iterate(a,d)&&(this.cursorOn(null,!1,a),c&&this.setSelection(this.currentModel(),!0))},_checkRow:function(a,d){if(this.explorer.renderer._useCheckboxSelection){var c=this.getRowDiv(a);if(c){var b=k.node(this.explorer.renderer.getCheckBoxId(c.id)),h=d?!b.checked:!0;if(h!==b.checked)this.explorer.renderer.onCheck(c,b,h,!0)}}else this._select(a,d)},_vpWidth:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},
_vpHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},_getToolBarHeight:function(a){return(a=k.node(a))?k.bounds(a).height:0},_visible:function(a){if(a.offsetWidth===0||a.offsetHeight===0)return!1;var d=0;d+=this._getToolBarHeight("staticBanner");d+=this._getToolBarHeight("titleArea");d+=this._getToolBarHeight("pageToolbar");var c=this._getEventListeningDiv(!0).getClientRects()[0],b=this._vpHeight();this._vpWidth();for(var d=c.top>d?c.top:
d,c=c.bottom<b?c.bottom:b,a=a.getClientRects(),b=0,h=a.length;b<h;b++){var f=a[b];if(f.top>=d&&f.top<=c&&f.bottom>=d&&f.bottom<=c)return!0}return!1},_select:function(a){a||(a=this._modelIterator.cursor());var d=this.getRowDiv(a);d&&(this._inSelection(a)<0?d.classList.add("checkedRow"):d.classList.remove("checkedRow"))},_onModelGrid:function(a,d){var c=this._getGridChildren(a);if(c)for(var b=0;b<c.length;b++)if(d.target===c[b].domNode)return!0;return!1},onClick:function(a,d){var c=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)));
if(d.target!==c&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(a,d)))if(this.cursorOn(a,!0,!1,!0),f)this.setSelection(a,!0);else if(this._ctrlKeyOn(d))this.setSelection(a,!0);else if(d.shiftKey&&this._lastSelection){if(c=this._modelIterator.scan(this._lastSelection,a)){this._clearSelection(!0);for(var b=0;b<c.length;b++)this.setSelection(c[b],!0)}}else this.setSelection(a,!1)},onCollapse:function(a){this._modelIterator.collapse(a)&&this.cursorOn()},onUpArrow:function(a){this.iterate(!1,
!1,a.shiftKey);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),!1);a.preventDefault();return!1},onDownArrow:function(a){this.iterate(!0,!1,a.shiftKey);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),!1);a.preventDefault();return!1},_shouldMoveColumn:function(a){var d=this.currentModel(),c=this._getGridChildren(d);return c&&c.length>1?this.isExpandable(d)?this._ctrlKeyOn(a):!0:!1},onLeftArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,
-1),a.preventDefault(),!0;var d=this._modelIterator.cursor();if(!d)return!1;if(this.isExpandable(d)&&this.isExpanded(d))return this.explorer.myTree.collapse(d),a.preventDefault(),!0;this._modelIterator.topLevel(d)?this.explorer.scopeUp&&typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(d.parent),this.setSelection(d.parent,!1))},onRightArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,1),a.preventDefault(),!0;var d=this._modelIterator.cursor();
if(!d)return!1;if(this.isExpandable(d)&&!this.isExpanded(d))return this.explorer.myTree.expand(d),a.preventDefault(),!1},_isRowSelectable:function(a){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(a):!0},onSpace:function(a){this.setSelection(this.currentModel(),!0);a.preventDefault()},onEnter:function(a){var d=this.getCurrentGrid(this._modelIterator.cursor());if(d)if(d.widget)if(typeof d.onClick==="function")d.onClick();else typeof d.widget.focus==="function"&&d.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);d.domNode.dispatchEvent(c)}else if(this.explorer.renderer.getRowActionElement&&(d=this._modelIterator.cursor()))if(d=this.explorer.renderer.getRowActionElement(this.model.getId(d)),d.href)this._ctrlKeyOn(a)?window.open(d.href):window.location.href=d.href}};return a}();g.ExplorerNavDict=function(){function a(a){this._dict={};this._model=a}a.prototype={addRow:function(a,
d){this._dict[this._model.getId(a)]={model:a,rowDomNode:d}},getValue:function(a){return this._dict[a]},getGridNavHolder:function(a,d){if(!a)return null;var c=this._model.getId(a);if(this._dict[c]){if(!this._dict[c].gridChildren&&d)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 g});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands,orion/commandRegistry".split(","),function(g,k,i,f,d,a){var e={};e.Explorer=function(){function a(c,b,d,e){this.registry=c;this.renderer=d;this.selection=b;this.commandService=e;this.myTree=null}a.prototype={changedItem:function(a,b){this.myTree&&this.myTree.refresh.bind(this.myTree)(a,b,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},
makeNewItemPlaceHolder:function(a,b,d){a=this.getRow(a);if(d)return a=a.childNodes[d],a.appendChild(document.createElement("br")),d=document.createElement("span"),d.id=b+"placeHolderRow",a.appendChild(d),{tempNode:d,refNode:d};if(a){d=document.createElement("tr");d.id=b+"placeHolderRow";var e=document.createElement("td");e.id=b+"placeHolderCol";d.appendChild(e);a.appendChild(d);d=i.node(b+"placeHolderRow");a=i.node(b+"placeHolderCol");if(d&&a)return{tempNode:d,refNode:a}}return null},getRow:function(a){if(a=
this.model.getId(a))return i.node(a)},collapseAll:function(){for(var a=this._navHandler.getTopLevelNodes(),b=0;b<a.length;b++)this.myTree.collapse(a[b])},expandAll:function(a){if(a)this._expandRecursively(a);else if(this._navHandler)for(var a=this._navHandler.getTopLevelNodes(),b=0;b<a.length;b++)this._expandRecursively(a[b])},_expandRecursively:function(a){if(this._navHandler&&this._navHandler.isExpandable(a)){var b=this;this.myTree.expand(a,function(){b.model.getChildren(a,function(a){if(!(a===
void 0||a===null))for(var c=a.length,d=0;d<c;d++)b._expandRecursively(a[d])})})}},createTree:function(a,b,e){a=typeof a==="string"?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var j=a+"innerTree",g=i.node(j);g&&i.empty(g);if(b)b.rootId=j;this.model=b;this._parentId=a;this._treeOptions=e;if(!e||e&&!e.noSelection)this.selectionPolicy=e?e.selectionPolicy:"",this._navDict=new d.ExplorerNavDict(this.model);this.myTree=new f.TableTree({id:j,
model:b,parent:a,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 a=this.getNavHandler(),b=[];if(a&&this.getNavDict())for(var d=a.getSelection(),e=0;e<d.length;e++){var f=a.getRowDiv(d[e]);f&&f.parentNode&&(f=this.getNavDict().getValue(this.model.getId(d[e])),f.model&&b.push(f.model))}this.selection.setSelections(b)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var a=this._treeOptions;if(!a||a&&!a.noSelection){if(!this.getNavHandler())this._navHandler=
a&&a.navHandlerFactory&&typeof a.navHandlerFactory.createNavHandler==="function"?a.navHandlerFactory.createNavHandler(this,this._navDict,a):new d.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null});var b=this;this.model.getRoot(function(d){d instanceof Array?b.getNavHandler().refreshModel(b.getNavDict(),b.model,d):d.children&&d.children instanceof Array&&b.getNavHandler().refreshModel(b.getNavDict(),b.model,
d.children);a&&a.setFocus&&b.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return a}();e.createExplorerCommands=function(d,c){function b(b){return typeof b.getItemCount==="function"?b.getItemCount()>0?c?c(b):!0:!1:!1}var e=new a.Command({tooltip:g["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return b(a)},callback:function(b){b.items.expandAll()}}),f=new a.Command({tooltip:g["Collapse all"],
imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return b(a)},callback:function(b){b.items.collapseAll()}});d.addCommand(e);d.addCommand(f)};e.ExplorerModel=function(){function a(c,b,d){this.rootPath=c;this.fetchItems=b;this.idPrefix=d||""}a.prototype={destroy:function(){},getRoot:function(a){var b=this;this.fetchItems(this.rootPath).then(function(d){b.root=d;a(d)})},getChildren:function(a,b){a.Children?b(a.Children):a.ChildrenLocation?
this.fetchItems(a.ChildrenLocation).then(function(d){a.Children=d;b(d)}):b([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;for(var a=a.Location.replace(/[\\\/]/g,""),b=this.idPrefix,d=0;d<a.length;d++)b+=a[d].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(d):a[d];return b}};return a}();e.ExplorerFlatModel=function(){function a(c,b,d){this.rootPath=c;this.fetchItems=b;this.root=d}a.prototype=new e.ExplorerModel;a.prototype.getRoot=function(a){if(this.root)a(this.root);else{var b=
this;this.fetchItems(this.rootPath).then(function(d){b.root=d;a(d)})}};a.prototype.getChildren=function(a,b){a===this.root?b(this.root):b([])};return a}();e.ExplorerRenderer=function(){function a(c,b){this.explorer=b;this._init(c);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite"}a.prototype={_init:function(a){if(a){this._useCheckboxSelection=a.checkbox===void 0?!1:a.checkbox;this.selectionPolicy=a.singleSelection?
"singleSelection":"";this._cachePrefix=a.cachePrefix;this.getCheckedFunc=a.getCheckedFunc;this.onCheckedFunc=a.onCheckedFunc;this._highlightSelection=!0;this._treeTableClass=a.treeTableClass||"treetable";if(a.highlightSelection===!1)this._highlightSelection=!1;if(!this.actionScopeId)this.actionScopeId=a.actionScopeId;if(!this.commandService)this.commandService=a.commandService}},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(a,b){this.tableTree=b;i.empty(a);this._treeTableClass&&
a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,b,d,e,f){var d=d||"tool",j=document.createElement("td");j.id=b.id+"actionswrapper";e&&j.classList.add(e);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,j,a,this.explorer,d,null,f&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return j},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,b){if(this._useCheckboxSelection){var d=document.createElement("td"),e=document.createElement("span");e.id=this.getCheckBoxId(b.id);e.classList.add("core-sprite-check");e.classList.add("selectionCheckmarkSprite");e.rowId=b.id;if(this.getCheckedFunc)e.checked=this.getCheckedFunc(a),e.checked?(this._highlightSelection&&b.classList.add("checkedRow"),e.classList.add("core-sprite-check_on")):
(this._highlightSelection&&b.classList.remove("checkedRow"),e.classList.remove("core-sprite-check_on"));d.appendChild(e);var f=this;e.addEventListener("click",function(a){f.onCheck(b,a.target,a.target.checked?!1:!0,!0)},!1);return d}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,b,d,e,f){(b.checked=d)?b.classList.add("core-sprite-check_on"):b.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(b.rowId,d,e);this.explorer.getNavHandler()&&f&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,
!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),b=this._getUIStatePreferencePath();b&&window.sessionStorage&&(window.sessionStorage[b+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){a=window.sessionStorage[a+"selection"];typeof a==="string"&&(a=a.length>0?JSON.parse(a):null);var b;if(a&&this.explorer.getNavDict()){var d=[];for(b=0;b<a.length;b++){var e=this.explorer.getNavDict().getValue(a[b]);if(e&&e.rowDomNode&&
e.model&&(d.push(e.model),this._highlightSelection&&e.rowDomNode.classList.add("checkedRow"),e=i.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(a){window.sessionStorage[a+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var b=!1,d=window.sessionStorage[a+
"expanded"];typeof d==="string"&&(d=d.length>0?JSON.parse(d):null);var e;if(d)for(e=0;e<d.length;e++)if(i.node(d[e])){this._expanded.push(d[e]);var f=this;this.tableTree.expand(d[e],function(){f._restoreSelections(a)});b=!0}return!b},_getUIStatePreferencePath:function(){if(this.explorer){var a=this.explorer.getRootPath();if(this._cachePrefix&&a)return"/"+this._cachePrefix+"/"+a.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(a){return a+"__expand"},updateExpandVisuals:function(a,
b){var d=i.node(this.expandCollapseImageId(a.id));d&&(d.classList.add(b?this._expandImageClass:this._collapseImageClass),d.classList.remove(b?this._collapseImageClass:this._expandImageClass))},getExpandImage:function(a,b,d,e){var f=document.createElement("span");f.id=this.expandCollapseImageId(a.id);b.appendChild(f);f.classList.add(this._twistieSpriteClass);f.classList.add(this._collapseImageClass);if(d){var j=document.createElement("span");b.appendChild(j);j.classList.add(e||"imageSprite");j.classList.add(d)}var g=
this;f.onclick=function(){g.tableTree.toggle(a.id);if(g.tableTree.isExpanded(a.id))g._expanded.push(a.id);else for(var b in g._expanded)if(g._expanded[b]===a.id){g._expanded.splice(b,1);break}(b=g._getUIStatePreferencePath())&&window.sessionStorage&&g._storeExpansions(b)};return f},render:function(a,b){b.classList.add("navRow");this.renderRow(a,b)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),this.explorer.initNavHandler())},updateCommands:function(){if(this.commandService)for(var a=
i.$$array(".treeTableRow"),b=0;b<a.length;b++){var d=a[b],e=i.node(d.id+"actionswrapper");this.commandService.destroy(e);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,e,d._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return a}();e.SelectionRenderer=function(){function a(c,b){this._init(c);this.explorer=b}a.prototype=new e.ExplorerRenderer;
a.prototype.renderTableHeader=function(a){var b=document.createElement("thead"),d=document.createElement("tr");b.classList.add("navTableHeading");this._useCheckboxSelection&&d.appendChild(this.initCheckboxColumn(a));for(var e=0,f=this.getCellHeaderElement(e);f;)f.innerHTML.length>0&&f.classList.add("navColumn"),d.appendChild(f),f=this.getCellHeaderElement(++e);b.appendChild(d);e>0&&a.appendChild(b)};a.prototype.renderRow=function(a,b){b.verticalAlign="baseline";b.classList.add("treeTableRow");var d=
this.explorer.getNavDict();if(d){d.addRow(a,b);var e=this;b.addEventListener("click",function(b){if(e.explorer.getNavHandler())e.explorer.getNavHandler().onClick(a,b)},!1)}if(d=this.getCheckboxColumn(a,b))d.classList.add("checkColumn"),b.appendChild(d);for(var d=0,f=this.getCellElement(d,a,b);f;)b.appendChild(f),d===0?this.getPrimColumnStyle?f.classList.add(this.getPrimColumnStyle()):f.classList.add("navColumn"):this.getSecondaryColumnStyle?f.classList.add(this.getSecondaryColumnStyle()):f.classList.add("secondaryColumn"),
f=this.getCellElement(++d,a,b)};a.prototype.getCellHeaderElement=function(){};a.prototype.getCellElement=function(){};return a}();e.SimpleFlatModel=function(){function a(c,b,d){this.items=c;this.getKey=d;this.idPrefix=b;this.root={children:c}}a.prototype=new e.ExplorerModel;a.prototype.getRoot=function(a){a(this.root)};a.prototype.destroy=function(){};a.prototype.getId=function(a){for(var a=this.getKey(a).replace(/[\\\/]/g,""),b="",d=0;d<a.length;d++)b+=a[d].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(d):
a[d];return this.idPrefix+b};a.prototype.getChildren=function(a,b){a===this.root?b(this.items):b([])};return a}();return e});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages,orion/Deferred,orion/webui/littlelib,orion/explorers/explorer,orion/explorers/navigationUtils,orion/extensionCommands,orion/contentTypes".split(","),function(g,k,i,f,d,a){function e(c,b,d,e,f,j,g){var i;if(b.Directory)i=document.createElement("a"),i.className="navlinkonpage",i.href=c+"#"+b.ChildrenLocation,i.appendChild(document.createTextNode(b.Name));else{f||(f=a.getOpenWithCommands(d));if(!j)for(c=0;c<f.length;c++)f[c].isEditor===
"default"&&(j=f[c]);i=document.createElement("a");i.className="navlink targetSelector";g&&typeof g==="object"&&Object.keys(g).forEach(function(b){i[b]=g[b]});i.appendChild(document.createTextNode(b.Name));for(var q=b.Location,p=!1,c=0;c<f.length;c++)if(d=f[c],d.visibleWhen(b)){q=d.hrefCallback({items:b});p=!0;break}k.when(e.getFileContentType(b),function(a){var c;if(c=!p)if(c=j){a:{switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":c=
!0;break a}c=!1}c=!c}c&&(q=j.hrefCallback({items:b}));c=i;var d=b.Location,e;switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":e=document.createElement("img");e.src=d;e.classList.add("thumbnail");break;default:a&&a.image?(e=document.createElement("img"),e.src=a.image,e.classList.add("thumbnail")):(e=document.createElement("span"),e.className="core-sprite-file_model modelDecorationSprite")}c.firstChild?c.insertBefore(e,c.firstChild):
c.appendChild(e);i.href=q})}return i}function j(a,b,d,e){this.explorer=b;this.commandService=d;this.contentTypeService=e;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}j.prototype=new f.SelectionRenderer;j.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};j.prototype.tableCallback=function(a){a.setAttribute("aria-label",g.Navigator);a.setAttribute("role","presentation")};j.prototype.rowCallback=function(a){a.setAttribute("role","treeitem")};
j.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"}};j.prototype.setTarget=function(a){this.target=a};j.prototype.createFolderNode=function(a){var b;this.showFolderLinks?b=e(this.folderLink||"",a,this.commandService,this.contentTypeService):(b=document.createElement("span"),b.textContent=a.Name);return b};j.prototype.showFolderLinks=!0;j.prototype.getCellElement=function(c,b,f){switch(c){case 0:var c=
document.createElement("td"),j=document.createElement("span");j.id=f.id+"MainCol";j.setAttribute("role","presentation");c.appendChild(j);c.setAttribute("role","presentation");j.className="mainNavColumn";var g;if(b.Directory)this.getExpandImage(f,j),g=this.createFolderNode(b),j.appendChild(g),this.explorer._makeDropTarget(b,g),this.explorer._makeDropTarget(b,f);else{if(!this.openWithCommands){this.openWithCommands=a.getOpenWithCommands(this.commandService);for(g=0;g<this.openWithCommands.length;g++)if(this.openWithCommands[g].isEditor===
"default")this.defaultEditor=this.openWithCommands[g]}g=e("",b,this.commandService,this.contentTypeService,this.openWithCommands,this.defaultEditor,{target:this.target});j.appendChild(g)}if(g)g.id=f.id+"NameLink",g.nodeType===1&&(d.addNavGrid(this.explorer.getNavDict(),b,g),g.setAttribute("role","link"),g.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,j,b,this.explorer,"tool",null,!0);return c;case 1:if(this.oneColumn)return null;f=document.createElement("td");
if(b.LocalTimeStamp)f.textContent=(new Date(b.LocalTimeStamp)).toLocaleString();return f;case 2:if(this.oneColumn)return null;f=document.createElement("td");if(!b.Directory&&typeof b.Length==="number")b=parseInt(b.Length,10)/1024,f.textContent=Math.ceil(b).toLocaleString()+" KB";f.style.textAlign="right";return f}};j.prototype.constructor=j;return{NavigatorRenderer:j,createLink:e}});
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(g,k,i,f,d,a,e,j,c){function b(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 b(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}b.prototype.makeRenderFunction=function(a,b,d,h,r){var q=this.serviceRegistry,p=this.commandRegistry;this.openWithCommands=this.openWithCommands||j.createOpenWithCommands(q,a,p);var t=this;return function(o,j,z){c.when(t.openWithCommands,function(c){if(z)i.empty(b),c=document.createElement("div"),c.appendChild(document.createTextNode(g["Search failed."])),b.appendChild(c),typeof h==="function"&&h(b);else{var w=
function(){function a(b,c){var d=c.folderName?c.folderName:c.path,e=document.createElement("span");e.id=d.replace(/[^a-zA-Z0-9_\.:\-]/g,"");e.appendChild(document.createTextNode(" - "+d+" "));b.appendChild(e)}var b={};return function(c,d){var e=d.name;if(b.hasOwnProperty(e)){a(c,d);var o=b[e];typeof o==="function"&&(b[e]=null,o())}else b[e]=function(){a(c,d)}}}(),x=!1;i.empty(b);if(o&&o.length>0){var A=document.createElement("table");A.setAttribute("role","presentation");for(var q=0;q<o.length;q++){var B=
o[q],C;if(!x&&(x=!0,d))C=A.insertRow(0).insertCell(0),C.textContent=d;C=A.insertRow(-1).insertCell(0);C.colspan=2;r&&r(C);var G={Name:B.name,Directory:B.directory,Location:B.path||B.location},G=e.createLink(k.toUrl("navigate/table.html"),G,p,a,c,null,{"aria-describedby":(B.folderName?B.folderName:B.path).replace(/[^a-zA-Z0-9_\.:\-]/g,""),style:{verticalAlign:"middle"}});B.LineNumber&&G.appendChild(document.createTextNode(" (Line "+B.LineNumber+")"));C.appendChild(G);w(C,B)}b.appendChild(A);typeof h===
"function"&&h(b)}!x&&j&&(c=f.formatMessage(g["No matches found for ${0}"],j),i.empty(b),b.appendChild(document.createTextNode(c)),typeof h==="function"&&h(b))}})}};h.prototype={search:function(b,c,e){var f=function(a){for(var b=[],c=0;c<a.response.docs.length;c++){var e=a.response.docs[c];b.push({name:e.Name,path:e.Location,folderName:d.path2FolderName(e.Path?e.Path:e.Location,e.Name),directory:e.Directory,lineNumber:e.LineNumber})}return b};if(this._crawler&&b.nameSearch)this._crawler.searchName(b,
function(a){e(f(a),null)});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);e(f(a),c)},function(a){e(null,null,a)})}catch(h){typeof h==="string"&&h.indexOf("search")>-1&&this._crawler?this._crawler.searchName(b,function(a){e(f(a),null)}):typeof h==="string"&&h.indexOf("search")>-1&&!b.nameSearch?(new a.SearchCrawler(this.registry,this._fileService,
b,{childrenLocation:this.getChildrenLocation()})).search(function(a){e(f(a),null)}):this.registry.getService("orion.page.message").setErrorMessage(h)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=a},handleError:function(a,b){console.error(a);i.empty(b);b.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,b){var c="",d=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);b&&a&&a.Parents&&a.Parents.length>
0?d=b.index==="last"?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&a.Directory&&a.Location&&a.Parents&&(d=a);if(d)this.setLocationbyURL(d.Location),c=d.Name,this._childrenLocation=d.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),c=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation;d=i.node("search");c||(c="");if(d&&d.placeholder){d.value="";var e=f.formatMessage(g["Search ${0}"],c);d.placeholder=e.length>30?e.substring(0,27)+"...":f.formatMessage(g["Search ${0}"],
c)}if(d&&d.title)d.title=g["Type a keyword or wild card to search in "]+c},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/section",["orion/webui/littlelib","orion/selection","orion/commandRegistry","orion/commonHTMLFragments"],function(g,k,i,f){function d(a,d){var c=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 b=d.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:
["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");a.appendChild(this.domNode);for(var h=0;h<b.length;h++)this.domNode.classList.add(b[h]);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("sectionTitle"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),this.domNode.tabIndex=0,this.domNode.addEventListener("click",
function(a){(a.target===c.titleNode||a.target===c.twistie)&&c._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===g.KEY.ENTER&&(a.target===c.domNode||a.target===c.titleNode||a.target===c.twistie)&&c._changeExpandedState()},!1);if(d.iconClass){var l=document.createElement("span");l.classList.add("sectionIcon");this.domNode.appendChild(l);(Array.isArray(d.iconClass)?d.iconClass:[d.iconClass]).forEach(function(a){l.classList.add(a)})}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")b=document.createElement("div"),b.classList.add("layoutLeft"),b.classList.add("sectionItemCount"),this.domNode.appendChild(b),b.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);b=document.createElement("div");b.id=d.id+"FilterSearchBox";this.domNode.appendChild(b);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("div");this.actionsNode.id=d.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("sectionActions");this.domNode.appendChild(this.actionsNode);this.selectionNode=document.createElement("div");this.selectionNode.id=d.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("sectionActions");
this.domNode.appendChild(this.selectionNode);d.slideout&&(b=f.slideoutHTMLFragment(d.id),h=document.createRange(),h.selectNode(this.domNode),b=h.createContextualFragment(b),this.domNode.appendChild(b));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";if(this._preferenceService){var n=this;this._preferenceService.getPreferences("/window/views").then(function(a){a=a.get(n.id);if(a!==void 0)n.hidden=!a;if(!n.hidden)n._contentParent.style.display="block";n._updateExpandedState(!n.hidden,!1)})}else{if(!this.hidden)this._contentParent.style.display="block";this._updateExpandedState(!this.hidden,
!1)}this._commandService=d.commandService;this._lastMonitor=0;this._loading={}}function a(a){this._section=a;this._id=++a._lastMonitor}d.prototype={setTitle:function(a){this.titleNode.textContent=a},setContent:function(a){typeof a==="string"?this._contentParent.innerHTML=a:(this._contentParent.innerHTML="",this._contentParent.appendChild(a))},getContentElement:function(){return this._contentParent},createProgressMonitor:function(){return new a(this)},_setMonitorMessage:function(a,d){this._progressNode.style.visibility=
"visible";this._loading[a]=d;var c="",b;for(b in this._loading)c!==""&&(c+="\n"),c+=this._loading[b];this._progressNode.title=c},_monitorDone:function(a){delete this._loading[a];var a="",d;for(d in this._loading)a!==""&&(a+="\n"),a+=this._loading[d];this._progressNode.title=a;if(a==="")this._progressNode.style.visibility="hidden"},_changeExpandedState:function(){this.hidden?(this._contentParent.style.display="block",this.hidden=!1):(this._contentParent.style.display="none",this.hidden=!0);this._updateExpandedState(!this.hidden,
!0)},_updateExpandedState:function(a,d){var c=this.twistie,b=this.id;c&&(c.classList.add(a?this._expandImageClass:this._collapseImageClass),c.classList.remove(a?this._collapseImageClass:this._expandImageClass));this._preferenceService&&d&&this._preferenceService.getPreferences("/window/views").then(function(c){c.put(b,a)});this._onExpandCollapse&&this._onExpandCollapse(a,this)}};d.prototype.constructor=d;a.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)}};a.prototype.constructor=a;return{Section:d}});
define("orion/dynamicContent",["require","orion/webui/littlelib","orion/webui/tooltip"],function(g,k,i){function f(a,b){if(a===void 0)throw Error("Missing reqired argument: id");if(b===void 0)throw Error("Missing reqired argument: anchor");this._id=a;this._anchor=b;this._prefix="progressSpinner:"}function d(a,b){if(a===void 0)throw Error("Missing reqired argument: id");if(b===void 0)throw Error("Missing reqired argument: anchor");this._id=a;this._anchor=b;this._prefix="progressDots:"}function a(a,
b){if(!a)throw Error("Missing reqired argument: objects");if(!b)throw Error("Missing reqired argument: populate");this._objects=a;this._populate=b}function e(){}function j(a){if(!a)throw Error("Missing required argument: model");this._model=a;this.use(new e)}f.prototype={start:function(){var a=document.createElement("img");a.id=this._prefix+this._id;a.src=g.toUrl("images/none.png");a.className="progressPane_running";this._anchor.appendChild(a)},stop:function(){var a=k.node(this._prefix+this._id);
a.parentNode.removeChild(a)},error:function(a){var b=k.node(this._prefix+this._id);b.src=g.toUrl("images/problem.gif");b.className="";new i.Tooltip({node:b,text:a})}};f.prototype.constructor=f;d.prototype={start:function(){var a=document.createElement("img");a.id=this._prefix+this._id;a.style.textDecoration="blink";a.appendChild(document.createTextNode(" ..."));this._anchor.appendChild(a)},stop:function(){var a=k.node(this._prefix+this._id);a.parentNode.removeChild(a)},error:function(a){var b=k.node(this._prefix+
this._id);b.parentNode.removeChild(b);var d=document.createElement("img");d.src=g.toUrl("images/problem.gif");this._anchor.appendChild(d);new i.Tooltip({node:b,text:a})}};d.prototype.constructor=d;a.prototype={getObjects:function(){return this._objects},getDetails:function(a){return this._populate(a)}};a.prototype.constructor=a;e.prototype={progressIndicator:d,setupProperties:{progressIndicators:[]},errorHandler:function(a,b){this.explorer.progressIndicators[a].error(b)}};e.prototype.constructor=
e;j.prototype={render:function(){var a=this;this._initialRender&&this._initialRender();for(var b=function(b){return function(){a._renderAfterItemPopulation(b);a.progressIndicators[b].stop()}},d=function(b){return function(d){if(a._errorHandler)a._errorHandler(b,d);else throw Error(d);}},e=0;e<this._model.getObjects().length;e++)this._renderBeforeItemPopulation(e),this.progressIndicators[e].start(),this._model.getDetails(e).then(b(e),d(e));this._cleanupRender&&this._cleanupRender()},use:function(a){for(var b in a)if(b===
"populateItem")this._populateItem=a.populateItem.bind(a),a.explorer=this;else if(b==="renderBeforeItemPopulation")this._renderBeforeItemPopulation=a.renderBeforeItemPopulation.bind(a),a.explorer=this;else if(b==="renderAfterItemPopulation")this._renderAfterItemPopulation=a.renderAfterItemPopulation.bind(a),a.explorer=this;else if(b==="errorHandler")this._errorHandler=a.errorHandler.bind(a),a.explorer=this;else if(b==="initialRender")this._initialRender=a.initialRender.bind(a),a.explorer=this;else if(b===
"cleanupRender")this._cleanupRender=a.cleanupRender.bind(a),a.explorer=this;else if(b==="progressIndicator")this.progressIndicator=a.progressIndicator,a.explorer=this;else if(b==="setupProperties"){for(var d in a.setupProperties)this[d]=a.setupProperties[d];a.explorer=this}}};j.prototype.constructor=j;return{DynamicContentModel:a,DynamicContentExplorer:j,DynamicContentRenderer:e,ProgressSpinner:f,ProgressDots:d}});
define("orion/compare/nls/root/messages",{"Copy current change from right to left":"Copy current change from right to left","Copy current change from left to right":"Copy current change from left to right","Switch to unified diff":"Switch to unified diff",Unified:"Unified","Switch to side by side diff":"Switch to side by side diff","Side by side":"Side by side","Generate link of the current diff":"Generate link of the current diff","Generate Link":"Generate Link","Next diff block":"Next diff block",
"Previous diff block":"Previous diff block","Next diff change":"Next diff change","Previous diff change":"Previous diff change","Copy the link URL:":"Copy the link URL:",Compare:"Compare","Open the compare page":"Open the compare page","fetching...":"fetching...","There are unsaved changes.":"There are unsaved changes.","ERROR: ":"ERROR: ","Compare...":"Compare...","files changed":" files changed",Location:"Location",Options:"Options","Sort by folders":"Sort by folders","Line 0 : Col 0":"Line 0 : Col 0",
"No Matching DiffService for location:":"No Matching DiffService for location:"});define("orion/compare/nls/messages",["orion/i18n!orion/compare/nls/messages","orion/compare/nls/root/messages"],function(g,k){var i={root:k};Object.keys(g).forEach(function(f){typeof i[f]==="undefined"&&(i[f]=g[f])});return i});
define("orion/compare/compareCommands",["i18n!orion/compare/nls/messages","orion/commands","orion/keyBinding","orion/webui/littlelib"],function(g,k,i,f){var d={};d.CompareCommandFactory=function(){function a(a){this.setOptions(a,!0)}a.prototype={setOptions:function(a,d){if(d)this.options={};if(!this.options)this.options={};a&&Object.keys(a).forEach(function(c){this.options[c]=a[c]}.bind(this))},getOptions:function(){return this.options},initCommands:function(a){var d=this.options.commandSpanId,c=
this.options.commandService;if(c&&d){var b=new k.Command({name:g["Copy current change from right to left"],tooltip:g["Copy current change from right to left"],imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",visibleWhen:function(){return a.type==="twoWay"&&a.options.newFile&&!a.options.newFile.readonly}.bind(this),callback:function(a){a.items.copyToLeft()}}),f=new k.Command({name:g["Copy current change from left to right"],tooltip:g["Copy current change from left to right"],
imageClass:"core-sprite-rightarrow",id:"orion.compare.copyToRight",groupId:"orion.compareGroup",visibleWhen:function(){return a.type==="twoWay"&&a.options.oldFile&&!a.options.oldFile.readonly}.bind(this),callback:function(a){a.items.copyToRight()}}),l=new k.Command({tooltip:g["Switch to unified diff"],name:g.Unified,id:"orion.compare.toggle2Inline",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&a.options.toggler.getWidget().type==="twoWay"},callback:function(a){a.items.options.toggler.toggle()}}),
n=new k.Command({tooltip:g["Switch to side by side diff"],name:g["Side by side"],id:"orion.compare.toggle2TwoWay",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&a.options.toggler.getWidget().type==="inline"},callback:function(a){a.items.options.toggler.toggle()}}),m=new k.Command({name:g["Next diff block"],tooltip:g["Next diff block"],imageClass:"core-sprite-move_down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",callback:function(a){a.items.nextDiff()}}),
s=new k.Command({name:g["Previous diff block"],tooltip:g["Previous diff block"],imageClass:"core-sprite-move_up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",callback:function(a){a.items.prevDiff()}}),r=new k.Command({name:g["Next diff change"],tooltip:g["Next diff change"],imageClass:"core-sprite-move_down",id:"orion.compare.nextChange",groupId:"orion.compareGroup",callback:function(a){a.items.nextChange()}}),q=new k.Command({name:g["Previous diff change"],tooltip:g["Previous diff change"],
imageClass:"core-sprite-move_up",id:"orion.compare.prevChange",groupId:"orion.compareGroup",callback:function(a){a.items.prevChange(a)}});c.addCommand(b);c.addCommand(f);c.addCommand(n);c.addCommand(l);c.addCommand(m);c.addCommand(s);c.addCommand(r);c.addCommand(q);c.registerCommandContribution(d,"orion.compare.toggle2Inline",108);c.registerCommandContribution(d,"orion.compare.toggle2TwoWay",109);c.registerCommandContribution(d,"orion.compare.copyToLeft",110,null,!1,new i.KeyBinding(37,!0,!1,!0));
c.registerCommandContribution(d,"orion.compare.copyToRight",111,null,!1,new i.KeyBinding(39,!0,!1,!0));c.registerCommandContribution(d,"orion.compare.nextDiff",112,null,!1,new i.KeyBinding(40,!0));c.registerCommandContribution(d,"orion.compare.prevDiff",113,null,!1,new i.KeyBinding(38,!0));a.options.wordLevelNav?(c.registerCommandContribution(d,"orion.compare.nextChange",114,null,!1,new i.KeyBinding(40,!0,!0)),c.registerCommandContribution(d,"orion.compare.prevChange",115,null,!1,new i.KeyBinding(38,
!0,!0))):(c.registerCommandContribution(d,"orion.compare.nextChange",114,null,!0,new i.KeyBinding(40,!0,!0)),c.registerCommandContribution(d,"orion.compare.prevChange",115,null,!0,new i.KeyBinding(38,!0,!0)))}},renderCommands:function(a){var d=this.options.commandSpanId,c=this.options.commandService;c&&d&&(f.empty(f.node(d)),this.options.gridRenderer&&this.options.gridRenderer.navGridHolder?(this.options.gridRenderer.navGridHolder.splice(0,this.options.gridRenderer.navGridHolder.length),this.options.gridRenderer.additionalCmdRender?
this.options.gridRenderer.before?(this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder),c.renderCommands(d,d,a,a,"tool",null,this.options.gridRenderer.navGridHolder)):(c.renderCommands(d,d,a,a,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):c.renderCommands(d,d,a,a,"tool",null,this.options.gridRenderer.navGridHolder)):c.renderCommands(d,d,a,a,"tool",null))}};return a}();return d});
define("orion/compare/compareUtils",["orion/URITemplate"],function(g){var k=k||{};k.compareUtils=k.compareUtils||{};k.compareUtils.lookUpMapper=function(g,f,d){for(var a=0,e=0;e<g.length;e++){var j=g[e][f];j===0&&(j=1);if(d>=a&&d<a+j)return{mapperIndex:e,startFrom:a};if(e===g.length-1)break;a+=g[e][f]}return{mapperIndex:g.length-1,startFrom:a}};k.compareUtils.lookUpLineIndex=function(g,f,d){if(d===0)return 0;for(var a=0,e=0;e<d;e++)a+=g[e][f];return a};k.compareUtils.updateMapper=function(g,f,d,a,
e){if(a!==e&&(a>0||e>0)){var j=k.compareUtils.lookUpMapper(g,f,d);if(!(j.mapperIndex<0)){if(a>0)for(var c=d-j.startFrom,d=j.mapperIndex;d<g.length;d++){c=g[d][f]-c;if(a<=c){g[d][f]-=a;break}g[d][f]-=c;a-=c;c=0}e>0&&(g[j.mapperIndex][f]+=e)}}};k.compareUtils.overlapMapper=function(g,f,d,a,e){g=d+g[f]-1;g<d&&(g=d);e<a&&(e=a);return g<a||e<d?!1:!0};k.compareUtils.findFirstDiff=function(g,f,d,a){for(var e=0,j=null,c=0;c<g.length;c++){if(e>a)break;if(k.compareUtils.overlapMapper(g[c],f,e,d,a)&&(j={mapperIndex:c,
startFrom:e},g[c][2]!==0))break;e+=g[c][f]}return j};k.compareUtils.matchMapper=function(g,f,d,a){if(g.length===0)return d;var e=d+Math.round((a-d)/3),j=k.compareUtils.findFirstDiff(g,f,d,a),c=g[j.mapperIndex][f]===0?j.startFrom:j.startFrom+g[j.mapperIndex][f]-1,b=k.compareUtils.lookUpLineIndex(g,1-f,j.mapperIndex),h=j.startFrom-d;return g[j.mapperIndex][2]===0?b-h:e>=j.startFrom&&e<=c?b-Math.round((a-d)/3):e<j.startFrom?b-h:(g[j.mapperIndex][1-f]===0?b:b+g[j.mapperIndex][1-f]-1)-(c-d)};k.compareUtils.getMapperLineCount=
function(g){for(var f=0,d=0;d<g.length;d++)f+=Math.max(g[d][0],g[d][1]);return f};k.compareUtils.getAnnotationIndex=function(g,f){for(var d=0;d<g.length;d++)if(g[d][0]===f)return d;return-1};k.compareUtils.getAnnotationMapperIndex=function(g,f){return g[f][1]};k.compareUtils.getAnnotationIndexByMapper=function(g,f){for(var d=0;d<g.length;d++)if(g[d][1]===f)return{current:d,prev:d-1,next:d+1};return{current:-1,prev:-1,next:-1}};k.compareUtils.isMapperConflict=function(g,f){return f<0?!1:!g[f][3]?!1:
g[f][3]===1};k.compareUtils.mergeDiffBlocks=function(g,f,d,a,e,j){for(var c=0;c<f.length;c++){var b=f[c][0],h=d[f[c][1]];if(h[0]>0){for(var l="",n=0;n<h[0];n++)l=l+a[h[2]-1+n].substring(e)+j;h=g.getLineCount();b>=h&&(b=h-1);b=g.getLineStart(b);g.setText(l,b,b)}}};k.compareUtils.generateCompareHref=function(i,f){var d=require.toUrl("compare/compare.html");if(!f.conflict)f.conflict=void 0;if(!f.readonly)f.readonly=void 0;return(new g(d+"#{,resource,params*}")).expand({resource:i,params:f})};k.compareUtils.generateCompareTreeHref=
function(i,f){var d=require.toUrl("compare-tree/compare-tree.html");return(new g(d+"#{,resource,params*}")).expand({resource:i,params:f})};return k.compareUtils});
define("orion/compare/diffProvider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(g,k){function i(d,a,e){var f=new k;d[a].apply(d,e).then(function(a){f.resolve(a)},function(a){f.reject(a)});return f}function f(d,a){var e=d.getServiceReferences("orion.core.diff"),f,c=e;if(a){c=[];for(f=0;f<e.length;++f)a(e[f])&&c.push(e[f])}var b=[],h=[];for(f=0;f<c.length;++f)b[f]=RegExp(c[f].getProperty("pattern")||".*"),h[f]=d.getService(c[f]);this._getService=function(a){if(a.indexOf("://")===-1){var c=
document.createElement("a");c.href=a;a=c.href}for(c=0;c<b.length;++c)if(b[c].test(a))return h[c];throw g["No Matching DiffService for location:"]+a;}}f.prototype={getDiffContent:function(d){return i(this._getService(d),"getDiffContent",arguments)},getDiffFileURI:function(d){return i(this._getService(d),"getDiffFileURI",arguments)}};return{DiffProvider:f}});
define("orion/compare/diffParser",[],function(){var g=g||{};g.DiffParser=function(){function g(f,d){this._lineDelimiter=f?f:i?"\r\n":"\n";this._diffLineDelimiter=d?d:this._lineDelimiter;this._DEBUG=!1}var i=window.navigator.platform.indexOf("Win")!==-1;g.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=!0;this._diffContentIndex=
1},setLineDelim:function(f){this._diffLineDelimiter=this._lineDelimiter=f},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(f,d,a,e){this._init();if(d==="")return{outPutFile:f,mapper:[]};this._oFileContents=f===""?[]:f.split(this._lineDelimiter);this._diffContents=d.split(this._diffLineDelimiter);d=this._diffContents.length;this._hunkRanges=[];for(var g=0;g<d;g++){var c=this._parseHunkRange(g);c&&this._hunkRanges.push(c)}if(0===this._hunkRanges.length)return{outPutFile:f,
mapper:[]};this._DEBUG&&(console.log("***Diff contents: \n"),this._diffContents.forEach(function(a){console.log(a)}),console.log("***Hunk ranges: \n"),console.log(JSON.stringify(this._hunkRanges)));for(f=0;f<this._hunkRanges.length;f++)this._parseHunkBlock(f);this._DEBUG&&(console.log("***Original Hunk range blocks: \n"),console.log(JSON.stringify(this._oBlocks)),console.log("***New Hunk range blocks: \n"),console.log(JSON.stringify(this._nBlocks)));this._buildMap(a);this._DEBUG&&(console.log("***New Line at end of file(original): \n"),
console.log(JSON.stringify(this._oNewLineAtEnd)),console.log("***New Line at end of file(new): \n"),console.log(JSON.stringify(this._nNewLineAtEnd)),console.log("***Mapper: \n"),this._logMap(),console.log("***Total line number in original file: "+this._oFileContents.length));e||this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var f=0;f<this._deltaMap.length;f++)if(console.log(JSON.stringify(this._deltaMap[f])),
this._deltaMap[f][2]>0){console.log("    **Diff content on change/add: \n");for(var d=0;d<this._deltaMap[f][0];d++)console.log("    "+this._diffContents[this._deltaMap[f][2]+d-1])}},_logNewFile:function(){for(var f=0;f<this._nFileContents.length;f++)console.log(this._nFileContents[f])},_createBlock:function(f,d,a,e){e===a&&f===" "||(a=[a,e-a,"s"],f==="-"?a[2]="r":f==="+"?a[2]="a":f==="c"&&(a[2]="c"),d.push(a))},_createMinusBlock:function(f,d,a){var e=this._oBlocks.length;e===0||f!==this._oBlocks[e-
1][0]?(this._oBlocks.push([f===0?1:f,a]),this._nBlocks.push([d,0,-2])):this._oBlocks[e-1][1]+=a},_createPlusBlock:function(f,d,a,e){var g=this._nBlocks.length;g===0||d!==this._nBlocks[g-1][0]?(this._oBlocks.push([f===0?1:f,0]),this._nBlocks.push([d,a,e])):(this._nBlocks[g-1][1]+=a,this._nBlocks[g-1][2]=e)},_parseHunkBlock:function(f){for(var d=" ",a=this._hunkRanges[f][0]+1,e=f===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[f+1][0],g=0,c=0,b=this._hunkRanges[f][1],h=this._hunkRanges[f][3],
l=a,n=a;n<e;n++)if(0!==this._diffContents[n].length){var m=this._diffContents[n][0];if(m==="\\"&&("\\ No newline at end of file"===this._diffContents[n].substring(0,this._diffContents[n].length-1)||"\\ No newline at end of file"===this._diffContents[n]))d==="-"?this._oNewLineAtEnd=!1:d===" "?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,n>a&&this._diffContents[n-1][this._diffContents[n-1].length-1]==="\r"&&(this._diffContents[n-1]=this._diffContents[n-1].substring(0,this._diffContents[n-
1].length-1));else{switch(m){case "-":case "+":case " ":break;default:continue}if(d!==m){m==="+"&&(l=n);switch(d){case " ":b=this._hunkRanges[f][1]+g;h=this._hunkRanges[f][3]+c;break;case "-":this._createMinusBlock(b,h,this._hunkRanges[f][1]+g-b);break;case "+":this._createPlusBlock(b,h,this._hunkRanges[f][3]+c-h,l)}d=m}switch(m){case "-":g++;break;case "+":c++;break;case " ":g++,c++}}}switch(d){case "-":this._createMinusBlock(b,h,this._hunkRanges[f][1]+g-b);break;case "+":this._createPlusBlock(b,
h,this._hunkRanges[f][3]+c-h,l)}},_detectConflictes:function(f,d){if(f<0)return!1;for(var a=f+d,e=f;e<a;e++){var g=this._diffContents[e];if(g.indexOf("<<<<<")>-1||g.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(f){var d=this._oBlocks.length,a=this._oFileContents.length,e=0,g;g=1;for(var c=0;c<d;c++)g=this._oBlocks[c][0]-g,g>0&&(this._deltaMap.push([g,g,0]),e+=g),f&&this._detectConflictes(this._nBlocks[c][2],this._nBlocks[c][1])?this._deltaMap.push([this._nBlocks[c][1],this._oBlocks[c][1],
this._nBlocks[c][2]+1,1]):this._deltaMap.push([this._nBlocks[c][1],this._oBlocks[c][1],this._nBlocks[c][2]+1]),e+=this._oBlocks[c][1],g=this._oBlocks[c][0]+this._oBlocks[c][1];0<a-g&&(this._deltaMap.push([a-g+1,a-g+1,0]),e+=a-g+1);e<a&&(g=a-e,f=this._deltaMap[this._deltaMap.length-1],f[2]===0?(f[0]+=g,f[1]+=g):f[2]===-1?this._deltaMap.push([g,g,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([g,g,0]):(this._nNewLineAtEnd&&(f[0]+=g),this._oNewLineAtEnd&&(f[1]+=g)))},_buildNewFile:function(){var f=
1,d=!1,a=this._deltaMap.length,e,g;for(e=0;e<a;e++){d=!1;if(this._deltaMap[e][2]===0){for(g=0;g<this._deltaMap[e][0];g++)this._nFileContents.push(this._oFileContents[f+g-1]);d=!0}else if(this._deltaMap[e][2]>0)for(g=0;g<this._deltaMap[e][0];g++)this._nFileContents.push(this._diffContents[this._deltaMap[e][2]+g-1].substring(1));f+=this._deltaMap[e][1]}this._nNewLineAtEnd&&!d&&this._nFileContents.push("")},_parseHRangeBody:function(f,d){if(0<f.indexOf(",")){var a=f.split(","),e=parseInt(a[0],10),a=
parseInt(a[1],10);d.push(e>=0?e:1);d.push(a>=0?a:1)}else e=parseInt(f,10),d.push(e>=0?e:1),d.push(1)},_parseHunkRange:function(f){var d=this._diffContents[f];if(8>d.length)return null;if("@@"!==d.substring(0,2))return null;var d=d.substring(2),a=d.indexOf("@@");if(a<0)return null;var d=d.substring(0,a),a=d.indexOf("-"),e=d.indexOf("+");if(a<0||e<0)return null;f=[f];a<e?(d=d.substring(a+1).split("+"),this._parseHRangeBody(d[0],f),this._parseHRangeBody(d[1],f)):(d=d.substring(e+1).split("-"),this._parseHRangeBody(d[1],
f),this._parseHRangeBody(d[0],f));return f}};return g}();return g});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(g){var k=k||{};k.CompareRuler=function(){function g(f,d,a){this._location=f||"left";this._overview=d||"page";this._rulerStyle=a;this._editor=null;var e=this;this._listener={onModelChanged:function(a){e._onModelChanged(a)}}}g.prototype={setView:function(f){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=f;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",
this._listener.onModelChanged)},getLocation:function(){return this._location},getOverview:function(){return this._overview},getAnnotationModel:function(){return null},addAnnotationType:function(){},isAnnotationTypeVisible:function(){return!1},removeAnnotationType:function(){},setAnnotationModel:function(){},getAnnotations:function(f,d){for(var a=[],e=f;e<d;e++){var g=this.getStyle(e);g&&(a[e]={html:this.getHTML(e),style:g})}return a},getWidestAnnotation:function(){return{html:this.getHTML(-1),style:this.getStyle(-1)}},
getRulerStyle:function(){return this.getStyle(void 0)}};return g}();k.LineNumberCompareRuler=function(){function g(f,d,a,e,j,c){k.CompareRuler.call(this,a,"page",e);this._diffNavigator=f;this._oddStyle=j||{style:{backgroundColor:"white"}};this._evenStyle=c||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=d}g.prototype=new k.CompareRuler;g.prototype.getStyle=function(f){return f===void 0?this._rulerStyle:this._evenStyle};g.prototype.getHTML=function(f){var d=this._editor.getModel(),
a=this._diffNavigator.getFeeder(this._mapperColumnIndex===0);return!a?"":f===-1?d.getLineCount():a.getLineNumber?(f=a.getLineNumber(f),f===-1?"":f+1):f+1};g.prototype._onModelChanged=function(f){var f=f.start,d=this._editor.getModel(),a=d.getLineCount(),e=(a+"").length;if(this._numOfDigits!==e)this._numOfDigits=e,this._editor.redrawLines(d.getLineAtOffset(f),a,this)};return g}();k.CompareOverviewRuler=function(){function i(f,d,a,e){this._diffNavigator=a;this._onClick=e;k.CompareRuler.call(this,f,
"document",d)}i.prototype=new k.CompareRuler;i.prototype.getStyle=function(f){var d,a;if(f===void 0)d=this._rulerStyle||{},a=d.style||(d.style={}),a.lineHeight="1px",a.fontSize="1px",a.width="14px";else if(d=f!==-1?{styleClass:"annotationOverview breakpoint"}:{},a=d.style||(d.style={}),a.cursor="pointer",a.width="8px",a.left="2px",f>=0){var e;if(this._diffNavigator&&this._diffNavigator.getFeeder())e=this._diffNavigator.getFeeder().getDiffBlocks();else return null;f=g.getAnnotationIndex(e,f);if(f===
-1)return null;e=g.getAnnotationMapperIndex(e,f);var j;j=this._diffNavigator.getMapper();if(e=g.isMapperConflict(j,e))a.border="1px #FF0000 solid";if(f===this._diffNavigator.getCurrentBlockIndex())a.backgroundColor=e?"red":"blue";f=this._diffNavigator.getFeeder().getDiffBlockH(f);e=this._diffNavigator.getFeeder().getOverviewLineCount();if(f<0)return null;j=this._editor.getClientArea();f=Math.floor(j.height*f/e);f<2&&(f=2);a.height=f+"px"}else return null;return d};i.prototype.setDiffNavigator=function(f){this._diffNavigator=
f};i.prototype.getHTML=function(){return"&nbsp;"};i.prototype.onClick=function(f){f!==void 0&&this._onClick(f,this)};i.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return i}();k.CompareCurveRuler=function(){function i(f){this._canvasDiv=f;this._mapper=void 0}i.prototype={init:function(f,d,a,e){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=f;this._leftEditor=d;this._rightEditor=a;this._leftTextView=d.getTextView();
this._rightTextView=a.getTextView();this._diffNavigator=e;this.render()},matchPositionFrom:function(f){var d=f?this._leftTextView:this._rightTextView,a=f?this._rightTextView:this._leftTextView,e=d.getTopIndex(),d=d.getBottomIndex(),f=g.matchMapper(this._mapper,f?0:1,e,d);a.setTopIndex(f)},copyTo:function(f){if(this._diffNavigator.iterator){var d=this._diffNavigator.iterator.cursor();if(d){var a=f?this._rightTextView.getText(d.oldA.start,d.oldA.end):this._leftTextView.getText(d.newA.start,d.newA.end),
d=f?d.newA:d.oldA;(f?this._leftTextView:this._rightTextView).setText(a,d.start,d.end)}}},render:function(){if(this._mapper){var f=this._canvasDiv.getContext("2d");f.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);f.strokeStyle="#AAAAAA";f.lineWidth=1;f.beginPath();var d=this._leftTextView.getTopIndex(),a=this._leftTextView.getBottomIndex(),e=this._rightTextView.getTopIndex(),j=this._rightTextView.getBottomIndex();this._leftLineH=this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();
for(var c=0,b=0,h=!1,l=0;l<this._mapper.length;l++){if(this._mapper[l][2]!==0)if(g.overlapMapper(this._mapper[l],0,c,d,a)||g.overlapMapper(this._mapper[l],1,b,e,j))this._renderCurve(l,c,b,this._canvasDiv,f,d,a,e,j),h=!0;else if(h)break;c+=this._mapper[l][0];b+=this._mapper[l][1]}f.stroke()}},_renderCurve:function(f,d,a,e,g){var c=this._mapper[f],d=this._leftTextView.getLinePixel(d+c[0]/2)+c[0]%2*this._leftLineH/3-this._leftTextView.getTopPixel(),a=this._rightTextView.getLinePixel(a+c[1]/2)+c[1]%2*
this._rightLineH/3-this._rightTextView.getTopPixel(),e=e.parentNode.clientWidth;f===this._diffNavigator.getCurrentMapperIndex()?(g.stroke(),g.strokeStyle="#000",g.lineWidth=1,g.beginPath(),g.moveTo(0,d),g.bezierCurveTo(e/3,d,e*0.666,a,e,a),g.stroke(),g.strokeStyle="#AAAAAA",g.lineWidth=1,g.beginPath()):(g.moveTo(0,d),g.bezierCurveTo(e/3,d,e*0.666,a,e,a),g.stroke())},onChanged:function(f,d){var a=d?this._rightIniting:this._leftIniting;if(f.removedLineCount!==f.addedLineCount){var e=d?this._rightTextView:
this._leftTextView;a||g.updateMapper(this._mapper,d?1:0,e.getModel().getLineAtOffset(f.start),f.removedLineCount,f.addedLineCount);(f.removedLineCount>0||f.addedLineCount>0)&&this.render()}d?this._rightIniting=!1:this._leftIniting=!1;return a}};return i}();return k});define("orion/editor/i18n",{load:function(g,k,i){k.specified&&k.specified("orion/bootstrap")?k(["orion/i18n!"+g],function(f){i(f)}):i({})}});
define("orion/editor/nls/root/messages",{multipleAnnotations:"Multiple annotations:",line:"Line: ${0}",breakpoint:"Breakpoint",bookmark:"Bookmark",task:"Task",error:"Error",warning:"Warning",matchingSearch:"Matching Search",currentSearch:"Current Search",currentLine:"Current Line",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",lineUp:"Line Up",lineDown:"Line Down",lineStart:"Line Start",lineEnd:"Line End",charPrevious:"Previous Character",charNext:"Next Character",pageUp:"Page Up",
pageDown:"Page Down",scrollPageUp:"Scroll Page Up",scrollPageDown:"Scroll Page Down",scrollLineUp:"Scroll Line Up",scrollLineDown:"Scroll Line Down",wordPrevious:"Previous Word",wordNext:"Next Word",textStart:"Document Start",textEnd:"Document End",scrollTextStart:"Scroll Document Start",scrollTextEnd:"Scroll Document End",centerLine:"Center Line",selectLineUp:"Select Line Up",selectLineDown:"Select Line Down",selectWholeLineUp:" Select Whole Line Up",selectWholeLineDown:"Select Whole Line Down",
selectLineStart:"Select Line Start",selectLineEnd:"Select Line End",selectCharPrevious:"Select Previous Character",selectCharNext:"Select Next Character",selectPageUp:"Select Page Up",selectPageDown:"Select Page Down",selectWordPrevious:"Select Previous Word",selectWordNext:"Select Next Word",selectTextStart:"Select Document Start",selectTextEnd:"Select Document End",deletePrevious:"Delete Previous Character",deleteNext:"Delete Next Character",deleteWordPrevious:"Delete Previous Word",deleteWordNext:"Delete Next Word",
deleteLineStart:"Delete Line Start",deleteLineEnd:"Delete Line End",tab:"Insert Tab",enter:"Insert Line Delimiter",enterNoCursor:"Insert Line Delimiter",selectAll:"Select All",copy:"Copy",cut:"Cut",paste:"Paste",uppercase:"To Upper Case",lowercase:"To Lower Case",capitalize:"Capitalize",reversecase:"Reverse Case",toggleWrapMode:"Toggle Wrap Mode",toggleTabMode:"Toggle Tab Mode",toggleOverwriteMode:"Toggle Overwrite Mode",emacs:"Emacs",exchangeMarkPoint:"Exchange Mark and Point",setMarkCommand:"Set Mark",
clearMark:"Clear Mark",digitArgument:"Digit Argument ${0}",negativeArgument:"Negative Argument",Comment:"Comment","Flat outline":"Flat outline",incrementalFindStr:"Incremental find: ${0}",incrementalFindStrNotFound:"Incremental find: ${0} (not found)",incrementalFindReverseStr:"Reverse Incremental find: ${0}",incrementalFindReverseStrNotFound:"Reverse Incremental find: ${0} (not found)",find:"Find...",undo:"Undo",redo:"Redo",cancelMode:"Cancel Current Mode",findNext:"Find Next Occurrence",findPrevious:"Find Previous Occurrence",
incrementalFind:"Incremental Find",incrementalFindReverse:"Incremental Find Reverse",indentLines:"Indent Lines",unindentLines:"Unindent Lines",moveLinesUp:"Move Lines Up",moveLinesDown:"Move Lines Down",copyLinesUp:"Copy Lines Up",copyLinesDown:"Copy Lines Down",deleteLines:"Delete Lines",gotoLine:"Goto Line...",gotoLinePrompty:"Goto Line:",nextAnnotation:"Next Annotation",prevAnnotation:"Previous Annotation",expand:"Expand",collapse:"Collapse",expandAll:"Expand All",collapseAll:"Collapse All",lastEdit:"Last Edit Location",
toggleLineComment:"Toggle Line Comment",addBlockComment:"Add Block Comment",removeBlockComment:"Remove Block Comment",linkedModeEntered:"Linked Mode entered",linkedModeExited:"Linked Mode exited",syntaxError:"Syntax Error",contentAssist:"Content Assist",lineColumn:"Line ${0} : Col ${1}",vi:"vi",vimove:"(Move)",viyank:"(Yank)",videlete:"(Delete)",vichange:"(Change)",viLeft:"${0} Left",viRight:"${0} Right",viUp:"${0} Up",viDown:"${0} Down",viw:"${0} Next Word",vib:"${0} Beginning of Word",viW:"${0} Next Word (ws stop)",
viB:"${0} Beginning of Word (ws stop)",vie:"${0} End of Word",viE:"${0} End of Word (ws stop)",vi$:"${0} End of the line","vi^_":"${0} First non-blank Char Current Line","vi+":"${0} First Char Next Line","vi-":"${0} First Char Previous Line","vi|":"${0} nth Column in Line",viH:"${0} Top of Page",viM:"${0} Middle of Page",viL:"${0} Bottom of Page","vi/":"${0} Search Forward","vi?":"${0} Search Backward",vin:"${0} Next Search",viN:"${0} Previous Search",vif:"${0} Search Char Fwd",viF:"${0} Search Char Bckwd",
vit:"${0} Search Before Char Fwd",viT:"${0} Search Before Char Bckwd","vi,":"${0} Repeat Reverse Char Search","vi;":"${0} Repeat Char Search",viG:"${0} Go to Line",viycd:"${0} Current Line",via:"Append After Cursor",viA:"Append to End of Line",vii:"Insert Before Cursor",viI:"Insert at Beginning of Line",viO:"Insert Line Above",vio:"Insert Line Below",viR:"Begin Overwriting Text",vis:"Substitute a Character",viS:"Substitute Entire Line",viC:"Change Text Until Line End",vip:"Paste After Char or Line",
viP:"Paste Before Char or Line",replaceAll:"Replacing all...",replacedMatches:"Replaced ${0} matches",nothingReplaced:"Nothing replaced",notFound:"Not found"});define("orion/editor/nls/messages",["orion/editor/i18n!orion/editor/nls/messages","orion/editor/nls/root/messages"],function(g,k){var i={root:k},f;for(f in g)g.hasOwnProperty(f)&&typeof i[f]==="undefined"&&(i[f]=g[f]);return i});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/util"],function(g,k){function i(f,d){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(f);this.setLineDelimiter(d)}i.prototype={find:function(f){if(this._text.length>1)this._text=[this._text.join("")];var d=f.string,a=d,e=f.caseInsensitive;!f.regex&&d&&(a=d.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),e&&(a=a.replace(/[iI\u0130\u0131]/g,"[Ii\u0130\u0131]")));var g=null,c;if(a){var d=f.reverse,b=f.wrap,h=f.wholeWord,
l=f.start||0,f=f.end,n=f!==null&&f!==void 0,m="";m.indexOf("g")===-1&&(m+="g");e&&m.indexOf("i")===-1&&(m+="i");h&&(a="\\b"+a+"\\b");var i=this._text[0],k,q,p=0;n&&(e=l<f?l:f,i=i.substring(e,l<f?f:l),p=e);var t=RegExp(a,m);if(d)c=function(){var a=null;for(t.lastIndex=0;;){q=t.lastIndex;k=t.exec(i);if(q===t.lastIndex)return null;if(k){if(!(k.index+p<l)){if(!b||a)break;l=i.length+p}a={start:k.index+p,end:t.lastIndex+p}}else break}if(a)l=a.start;return a};else{if(!n)t.lastIndex=l;c=function(){for(;;){q=
t.lastIndex;k=t.exec(i);if(q===t.lastIndex)break;if(k)return{start:k.index+p,end:t.lastIndex+p};if(!(q!==0&&b))break}return null}}g=c()}return{next:function(){var a=g;a&&(g=c());return a},hasNext:function(){return g!==null}}},getCharCount:function(){for(var f=0,d=0;d<this._text.length;d++)f+=this._text[d].length;return f},getLine:function(f,d){var a=this.getLineCount();if(!(0<=f&&f<a))return null;var e=this._lineOffsets[f];if(f+1<a){a=this.getText(e,this._lineOffsets[f+1]);if(d)return a;for(var e=
a.length,g;(g=a.charCodeAt(e-1))===10||g===13;)e--;return a.substring(0,e)}else return this.getText(e)},getLineAtOffset:function(f){var d=this.getCharCount();if(!(0<=f&&f<=d))return-1;var a=this.getLineCount();if(f===d)return a-1;var e,g,c=this._lastLineIndex;if(0<=c&&c<a&&(e=this._lineOffsets[c],g=c+1<a?this._lineOffsets[c+1]:d,e<=f&&f<g))return c;for(var b=a,h=-1;b-h>1;)if(c=Math.floor((b+h)/2),e=this._lineOffsets[c],g=c+1<a?this._lineOffsets[c+1]:d,f<=e)b=c;else if(f<g){b=c;break}else h=c;return this._lastLineIndex=
b},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(f,d){var a=this.getLineCount();if(!(0<=f&&f<a))return-1;if(f+1<a){a=this._lineOffsets[f+1];if(d)return a;for(var e=this.getText(Math.max(this._lineOffsets[f],a-2),a),g=e.length,c;(c=e.charCodeAt(g-1))===10||c===13;)g--;return a-(e.length-g)}else return this.getCharCount()},getLineStart:function(f){return!(0<=f&&f<this.getLineCount())?-1:this._lineOffsets[f]},getText:function(f,
d){f===void 0&&(f=0);d===void 0&&(d=this.getCharCount());if(f===d)return"";for(var a=0,e=0,g;e<this._text.length;){g=this._text[e].length;if(f<=a+g)break;a+=g;e++}for(var c=a,b=e;e<this._text.length;){g=this._text[e].length;if(d<=a+g)break;a+=g;e++}if(b===e)return this._text[b].substring(f-c,d-a);c=this._text[b].substring(f-c);a=this._text[e].substring(0,d-a);return c+this._text.slice(b+1,e).join("")+a},onChanging:function(f){return this.dispatchEvent(f)},onChanged:function(f){return this.dispatchEvent(f)},
setLineDelimiter:function(f,d){f==="auto"&&(f=void 0,this.getLineCount()>1&&(f=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=f?f:k.platformDelimiter;if(d){var a=this.getLineCount();if(a>1){for(var e=Array(a),g=0;g<a;g++)e[g]=this.getLine(g);this.setText(e.join(this._lineDelimiter))}}},setText:function(f,d,a){f===void 0&&(f="");d===void 0&&(d=0);a===void 0&&(a=this.getCharCount());if(!(d===a&&f==="")){for(var e=this.getLineAtOffset(d),g=this.getLineAtOffset(a),c=d,b=
a-d,h=g-e,l=f.length,n=0,m=this.getLineCount(),i=0,k=0,q=0,p=[];;){i!==-1&&i<=q&&(i=f.indexOf("\r",q));k!==-1&&k<=q&&(k=f.indexOf("\n",q));if(k===-1&&i===-1)break;q=i!==-1&&k!==-1?i+1===k?k+1:(i<k?i:k)+1:i!==-1?i+1:k+1;p.push(d+q);n++}this.onChanging({type:"Changing",text:f,start:c,removedCharCount:b,addedCharCount:l,removedLineCount:h,addedLineCount:n});p.length===0&&(q=this.getLineStart(e),g=g+1<m?this.getLineStart(g+1):this.getCharCount(),d!==q&&(f=this.getText(q,d)+f,d=q),a!==g&&(f+=this.getText(a,
g),a=g));q=l-b;for(g=e+h+1;g<m;g++)this._lineOffsets[g]+=q;if(p.length<5E4)e=[e+1,h].concat(p),Array.prototype.splice.apply(this._lineOffsets,e);else{q=e+1;this._lineOffsets.splice(q,h);for(m=0;m<p.length;m+=5E4)e=[q,0].concat(p.slice(m,Math.min(p.length,m+5E4))),Array.prototype.splice.apply(this._lineOffsets,e),q+=5E4}for(q=m=0;q<this._text.length;){g=this._text[q].length;if(d<=m+g)break;m+=g;q++}e=m;for(p=q;q<this._text.length;){g=this._text[q].length;if(a<=m+g)break;m+=g;q++}g=this._text[q];d=
this._text[p].substring(0,d-e);a=g.substring(a-m);p=[p,q-p+1];d&&p.push(d);f&&p.push(f);a&&p.push(a);Array.prototype.splice.apply(this._text,p);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:c,removedCharCount:b,addedCharCount:l,removedLineCount:h,addedLineCount:n})}}};g.EventTarget.addMixin(i.prototype);return{TextModel:i}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(g,k){function i(d){if(d)this._view=d,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0}function f(d){i.call(this,d)}i.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(d){for(var a=[],e=this._keyBindings,f=0;f<e.length;f++)e[f].actionID===d&&a.push(e[f].keyBinding);return a},getView:function(){return this._view},isActive:function(){return this._view.getKeyModes().indexOf(this)!==-1},
match:function(d){switch(d.keyCode){case 16:case 17:case 18:case 91:return}for(var a=this._keyBindingIndex,e=this._matchingKeyBindings||this._keyBindings,f=[],c=0;c<e.length;c++){var b=e[c],h=b.keyBinding.match(d,a);if(h===!0)return this._keyBindingIndex=0,this._matchingKeyBindings=null,b.actionID;else typeof h==="number"&&f.push(b)}if(f.length===0)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=f,"noop"},setKeyBinding:function(d,
a){for(var e=this._keyBindings,f=0;f<e.length;f++){var c=e[f];if(c.keyBinding.equals(d)){a?c.actionID=a:c.predefined?c.actionID="noop":e.splice(f,1);return}}a&&e.push({keyBinding:d,actionID:a})},setView:function(d){this._view=d}};f.prototype=new i;f.prototype.createKeyBindings=function(){var d=g.KeyBinding,a=[];a.push({actionID:"lineUp",keyBinding:new d(38),predefined:!0});a.push({actionID:"lineDown",keyBinding:new d(40),predefined:!0});a.push({actionID:"charPrevious",keyBinding:new d(37),predefined:!0});
a.push({actionID:"charNext",keyBinding:new d(39),predefined:!0});k.isMac?(a.push({actionID:"scrollPageUp",keyBinding:new d(33),predefined:!0}),a.push({actionID:"scrollPageDown",keyBinding:new d(34),predefined:!0}),a.push({actionID:"pageUp",keyBinding:new d(33,null,null,!0),predefined:!0}),a.push({actionID:"pageDown",keyBinding:new d(34,null,null,!0),predefined:!0}),a.push({actionID:"lineStart",keyBinding:new d(37,!0),predefined:!0}),a.push({actionID:"lineEnd",keyBinding:new d(39,!0),predefined:!0}),
a.push({actionID:"wordPrevious",keyBinding:new d(37,null,null,!0),predefined:!0}),a.push({actionID:"wordNext",keyBinding:new d(39,null,null,!0),predefined:!0}),a.push({actionID:"scrollTextStart",keyBinding:new d(36),predefined:!0}),a.push({actionID:"scrollTextEnd",keyBinding:new d(35),predefined:!0}),a.push({actionID:"textStart",keyBinding:new d(38,!0),predefined:!0}),a.push({actionID:"textEnd",keyBinding:new d(40,!0),predefined:!0}),a.push({actionID:"scrollPageUp",keyBinding:new d(38,null,null,null,
!0),predefined:!0}),a.push({actionID:"scrollPageDown",keyBinding:new d(40,null,null,null,!0),predefined:!0}),a.push({actionID:"lineStart",keyBinding:new d(37,null,null,null,!0),predefined:!0}),a.push({actionID:"lineEnd",keyBinding:new d(39,null,null,null,!0),predefined:!0}),a.push({actionID:"lineStart",keyBinding:new d(38,null,null,!0),predefined:!0}),a.push({actionID:"lineEnd",keyBinding:new d(40,null,null,!0),predefined:!0})):(a.push({actionID:"pageUp",keyBinding:new d(33),predefined:!0}),a.push({actionID:"pageDown",
keyBinding:new d(34),predefined:!0}),a.push({actionID:"lineStart",keyBinding:new d(36),predefined:!0}),a.push({actionID:"lineEnd",keyBinding:new d(35),predefined:!0}),a.push({actionID:"wordPrevious",keyBinding:new d(37,!0),predefined:!0}),a.push({actionID:"wordNext",keyBinding:new d(39,!0),predefined:!0}),a.push({actionID:"textStart",keyBinding:new d(36,!0),predefined:!0}),a.push({actionID:"textEnd",keyBinding:new d(35,!0),predefined:!0}));k.isFirefox&&k.isLinux&&(a.push({actionID:"lineUp",keyBinding:new d(38,
!0),predefined:!0}),a.push({actionID:"lineDown",keyBinding:new d(40,!0),predefined:!0}));k.isWindows&&(a.push({actionID:"scrollLineUp",keyBinding:new d(38,!0),predefined:!0}),a.push({actionID:"scrollLineDown",keyBinding:new d(40,!0),predefined:!0}));a.push({actionID:"selectLineUp",keyBinding:new d(38,null,!0),predefined:!0});a.push({actionID:"selectLineDown",keyBinding:new d(40,null,!0),predefined:!0});a.push({actionID:"selectCharPrevious",keyBinding:new d(37,null,!0),predefined:!0});a.push({actionID:"selectCharNext",
keyBinding:new d(39,null,!0),predefined:!0});a.push({actionID:"selectPageUp",keyBinding:new d(33,null,!0),predefined:!0});a.push({actionID:"selectPageDown",keyBinding:new d(34,null,!0),predefined:!0});k.isMac?(a.push({actionID:"selectLineStart",keyBinding:new d(37,!0,!0),predefined:!0}),a.push({actionID:"selectLineEnd",keyBinding:new d(39,!0,!0),predefined:!0}),a.push({actionID:"selectWordPrevious",keyBinding:new d(37,null,!0,!0),predefined:!0}),a.push({actionID:"selectWordNext",keyBinding:new d(39,
null,!0,!0),predefined:!0}),a.push({actionID:"selectTextStart",keyBinding:new d(36,null,!0),predefined:!0}),a.push({actionID:"selectTextEnd",keyBinding:new d(35,null,!0),predefined:!0}),a.push({actionID:"selectTextStart",keyBinding:new d(38,!0,!0),predefined:!0}),a.push({actionID:"selectTextEnd",keyBinding:new d(40,!0,!0),predefined:!0}),a.push({actionID:"selectLineStart",keyBinding:new d(37,null,!0,null,!0),predefined:!0}),a.push({actionID:"selectLineEnd",keyBinding:new d(39,null,!0,null,!0),predefined:!0}),
a.push({actionID:"selectLineStart",keyBinding:new d(38,null,!0,!0),predefined:!0}),a.push({actionID:"selectLineEnd",keyBinding:new d(40,null,!0,!0),predefined:!0})):(k.isLinux&&(a.push({actionID:"selectWholeLineUp",keyBinding:new d(38,!0,!0),predefined:!0}),a.push({actionID:"selectWholeLineDown",keyBinding:new d(40,!0,!0),predefined:!0})),a.push({actionID:"selectLineStart",keyBinding:new d(36,null,!0),predefined:!0}),a.push({actionID:"selectLineEnd",keyBinding:new d(35,null,!0),predefined:!0}),a.push({actionID:"selectWordPrevious",
keyBinding:new d(37,!0,!0),predefined:!0}),a.push({actionID:"selectWordNext",keyBinding:new d(39,!0,!0),predefined:!0}),a.push({actionID:"selectTextStart",keyBinding:new d(36,!0,!0),predefined:!0}),a.push({actionID:"selectTextEnd",keyBinding:new d(35,!0,!0),predefined:!0}));a.push({actionID:"undo",keyBinding:new g.KeyBinding("z",!0),predefined:!0});k.isMac?a.push({actionID:"redo",keyBinding:new g.KeyBinding("z",!0,!0),predefined:!0}):a.push({actionID:"redo",keyBinding:new g.KeyBinding("y",!0),predefined:!0});
a.push({actionID:"deletePrevious",keyBinding:new d(8),predefined:!0});a.push({actionID:"deletePrevious",keyBinding:new d(8,null,!0),predefined:!0});a.push({actionID:"deleteNext",keyBinding:new d(46),predefined:!0});a.push({actionID:"deleteWordPrevious",keyBinding:new d(8,!0),predefined:!0});a.push({actionID:"deleteWordPrevious",keyBinding:new d(8,!0,!0),predefined:!0});a.push({actionID:"deleteWordNext",keyBinding:new d(46,!0),predefined:!0});a.push({actionID:"tab",keyBinding:new d(9),predefined:!0});
a.push({actionID:"shiftTab",keyBinding:new d(9,null,!0),predefined:!0});a.push({actionID:"enter",keyBinding:new d(13),predefined:!0});a.push({actionID:"enter",keyBinding:new d(13,null,!0),predefined:!0});a.push({actionID:"selectAll",keyBinding:new d("a",!0),predefined:!0});a.push({actionID:"toggleTabMode",keyBinding:new d("m",!0),predefined:!0});k.isMac&&(a.push({actionID:"deleteNext",keyBinding:new d(46,null,!0),predefined:!0}),a.push({actionID:"deleteWordPrevious",keyBinding:new d(8,null,null,!0),
predefined:!0}),a.push({actionID:"deleteWordNext",keyBinding:new d(46,null,null,!0),predefined:!0}));a.push({actionID:"toggleWrapMode",keyBinding:new g.KeyBinding("w",!0,!1,!0)});a.push({actionID:"toggleOverwriteMode",keyBinding:new g.KeyBinding(45)});if(!k.isFirefox){var e=k.isMac&&k.isChrome;a.push({actionID:"noop",keyBinding:new d("u",!e,!1,!1,e),predefined:!0});a.push({actionID:"noop",keyBinding:new d("i",!e,!1,!1,e),predefined:!0});a.push({actionID:"noop",keyBinding:new d("b",!e,!1,!1,e),predefined:!0})}k.isFirefox&&
(a.push({actionID:"copy",keyBinding:new d(45,!0),predefined:!0}),a.push({actionID:"paste",keyBinding:new d(45,null,!0),predefined:!0}),a.push({actionID:"cut",keyBinding:new d(46,null,!0),predefined:!0}));k.isMac&&(a.push({actionID:"lineStart",keyBinding:new d("a",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"lineEnd",keyBinding:new d("e",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"lineUp",keyBinding:new d("p",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"lineDown",keyBinding:new d("n",!1,!1,
!1,!0),predefined:!0}),a.push({actionID:"charPrevious",keyBinding:new d("b",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"charNext",keyBinding:new d("f",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"deletePrevious",keyBinding:new d("h",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"deleteNext",keyBinding:new d("d",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"deleteLineEnd",keyBinding:new d("k",!1,!1,!1,!0),predefined:!0}),k.isFirefox?(a.push({actionID:"scrollPageDown",keyBinding:new d("v",!1,
!1,!1,!0),predefined:!0}),a.push({actionID:"deleteLineStart",keyBinding:new d("u",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"deleteWordPrevious",keyBinding:new d("w",!1,!1,!1,!0),predefined:!0})):(a.push({actionID:"pageDown",keyBinding:new d("v",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"centerLine",keyBinding:new d("l",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"enterNoCursor",keyBinding:new d("o",!1,!1,!1,!0),predefined:!0})));return a};return{KeyMode:i,DefaultKeyMode:f}});
define("orion/editor/textView","i18n!orion/editor/nls/messages,orion/editor/textModel,orion/editor/keyModes,orion/editor/eventTarget,orion/editor/textTheme,orion/util".split(","),function(g,k,i,f,d,a){function e(a,b,c,d){typeof a.addEventListener==="function"?a.addEventListener(b,c,d===!0):a.attachEvent("on"+b,c)}function j(b,c,d){if(d){c.className="";for(var d=c.attributes,e=d.length;e-- >0;)(!a.isIE||a.isIE>=9||a.isIE<9&&d[e].specified)&&c.removeAttribute(d[e].name)}if(b){if(b.styleClass)c.className=
b.styleClass;if(d=b.style)for(var f in d)d.hasOwnProperty(f)&&(c.style[f]=d[f]);if(b=b.attributes)for(var h in b)b.hasOwnProperty(h)&&c.setAttribute(h,b[h])}}function c(a){return a instanceof Array?a.slice(0):a}function b(a,b){if(!a)return b;if(!b)return a;for(var c in b)b.hasOwnProperty(c)&&(a.hasOwnProperty(c)||(a[c]=b[c]));return a}function h(a,b){if(a===b)return!0;if(a&&!b||!a&&b)return!1;if(a&&a.constructor===String||b&&b.constructor===String)return!1;if(a instanceof Array||b instanceof Array){if(!(a instanceof
Array&&b instanceof Array))return!1;if(a.length!==b.length)return!1;for(var c=0;c<a.length;c++)if(!h(a[c],b[c]))return!1;return!0}if(!(a instanceof Object)||!(b instanceof Object))return!1;for(c in a)if(a.hasOwnProperty(c)){if(!b.hasOwnProperty(c))return!1;if(!h(a[c],b[c]))return!1}for(c in b)if(!a.hasOwnProperty(c))return!1;return!0}function l(a,b,c){for(var d=0,e=0,f=0,h=a.length;f<h;){d!==-1&&d<=f&&(d=a.indexOf("\r",f));e!==-1&&e<=f&&(e=a.indexOf("\n",f));var g=f,j;if(e===-1&&d===-1){b(a.substring(f));
break}d!==-1&&e!==-1?d+1===e?(j=d,f=e+1):(j=d<e?d:e,f=(d<e?d:e)+1):d!==-1?(j=d,f=d+1):(j=e,f=e+1);b(a.substring(g,j));c()}}function n(a){var b,c,d,e,f=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(f.getComputedStyle)a=f.getComputedStyle(a,null),b=a.getPropertyValue("padding-left"),c=a.getPropertyValue("padding-top"),d=a.getPropertyValue("padding-right"),e=a.getPropertyValue("padding-bottom");else if(a.currentStyle)b=a.currentStyle.paddingLeft,c=a.currentStyle.paddingTop,d=a.currentStyle.paddingRight,
e=a.currentStyle.paddingBottom;return{left:parseInt(b,10)||0,top:parseInt(c,10)||0,right:parseInt(d,10)||0,bottom:parseInt(e,10)||0}}function m(a){var b,c,d,e,f=a._trim;if(!f){var f=n(a),h=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(h.getComputedStyle)e=h.getComputedStyle(a,null),b=e.getPropertyValue("border-left-width"),c=e.getPropertyValue("border-top-width"),d=e.getPropertyValue("border-right-width"),e=e.getPropertyValue("border-bottom-width");else if(a.currentStyle)b=a.currentStyle.borderLeftWidth,
c=a.currentStyle.borderTopWidth,d=a.currentStyle.borderRightWidth,e=a.currentStyle.borderBottomWidth;b=parseInt(b,10)||0;c=parseInt(c,10)||0;d=parseInt(d,10)||0;e=parseInt(e,10)||0;f.left+=b;f.top+=c;f.right+=d;f.bottom+=e;a._trim=f}return f}function s(a,b,c){this.start=a;this.end=b;this.caret=c}function r(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function q(a,b,c){this.view=a;this.lineIndex=b;this._lineDiv=c}function p(a){this._init(a||{})}var t=function(){function a(b){this.options=
b}a.prototype.play=function(){var a=typeof this.options.duration==="number"?this.options.duration:350,b=this.options.easing||this.defaultEasing,c=this.options.onAnimate||function(){},d=this.options.curve[0],e=this.options.curve[1],o=e-d,f=-1,h,g=this;this.interval=this.options.window.setInterval(function(){f=f===-1?(new Date).getTime():f;var j=((new Date).getTime()-f)/a;j<1?(j=b(j),h=d+j*o,c(h)):(c(e),g.stop())},typeof this.options.rate==="number"?this.options.rate:20)};a.prototype.stop=function(){this.options.window.clearInterval(this.interval);
(this.options.onEnd||function(){})()};a.prototype.defaultEasing=function(a){return Math.sin(a*(Math.PI/2))};return a}();s.prototype={clone:function(){return new s(this.start,this.end,this.caret)},collapse:function(){this.caret?this.end=this.start:this.start=this.end},extend:function(a){this.caret?this.start=a:this.end=a;if(this.start>this.end)a=this.start,this.start=this.end,this.end=a,this.caret=!this.caret},setCaret:function(a){this.end=this.start=a;this.caret=!1},getCaret:function(){return this.caret?
this.start:this.end},toString:function(){return"start="+this.start+" end="+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(a){return this.caret===a.caret&&this.start===a.start&&this.end===a.end}};r.prototype={toString:function(){return"{l="+this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}};q.prototype={create:function(a,b){if(!this._lineDiv){var c=this._lineDiv=this._createLine(a,b,this.lineIndex);c._line=
this;return c}},_createLine:function(b,c,d){var e=this.view,f=e._model,g=f.getLine(d),l=f.getLineStart(d),m={type:"LineStyle",textView:e,lineIndex:d,lineText:g,lineStart:l};if(g.length<2E3)e.onLineStyle(m);f=c||a.createElement(b.ownerDocument,"div");if(!c||!h(c.viewStyle,m.style)){j(m.style,f,c);if(c)c._trim=null;f.viewStyle=m.style;f.setAttribute("role","presentation")}f.lineIndex=d;d=[];this._createRanges(m.ranges,g,0,g.length,l,{tabOffset:0,ranges:d});g=" ";!e._fullSelection&&a.isIE<9&&(g="\ufeff");
a.isWebkit&&(g="\u200c");m={text:g,style:e._metrics.largestFontStyle,ignoreChars:1};d.length===0||!d[d.length-1].style||d[d.length-1].style.tagName!=="div"?d.push(m):d.splice(d.length-1,0,m);var n,i,k,q,s,g=e=0,r,p;if(c){if(i=c.modelChangedEvent)i.removedLineCount===0&&i.addedLineCount===0?(p=i.start-l,r=i.addedCharCount-i.removedCharCount):p=-1,c.modelChangedEvent=void 0;i=c.firstChild}for(l=0;l<d.length;l++){m=d[l];q=m.text;e+=q.length;n=m.style;if(i)if(s=i.firstChild.data,k=i.viewStyle,s===q&&
h(n,k)){g+=s.length;i._rectsCache=void 0;n=i=i.nextSibling;continue}else for(;i;){if(p!==-1){k=e;k>=p&&(k-=r);s=(s=i.firstChild.data)?s.length:0;if(g+s>k)break;g+=s}k=i.nextSibling;f.removeChild(i);i=k}n=this._createSpan(f,q,n,m.ignoreChars);i?f.insertBefore(n,i):f.appendChild(n);if(c)c.lineWidth=void 0}if(c)for(b=n?n.nextSibling:null;b;)k=b.nextSibling,c.removeChild(b),b=k;else b.appendChild(f);return f},_createRanges:function(a,b,c,d,e,f){if(!(c>d)){if(a)for(var g=0;g<a.length;g++){var j=a[g];if(!(j.end<
e+c)){var l=Math.max(e+c,j.start)-e;if(l>d)break;var m=Math.min(e+d,j.end)-e;if(l<=m){l=Math.max(c,l);m=Math.min(d,m);for(c<l&&this._createRange(b,c,l,null,f);g+1<a.length&&a[g+1].start-e===m&&h(j.style,a[g+1].style);)j=a[g+1],m=Math.min(e+d,j.end)-e,g++;this._createRange(b,l,m,j.style,f);c=m}}}c<d&&this._createRange(b,c,d,null,f)}},_createRange:function(a,b,c,d,e){if(!(b>c)){var f=this.view._customTabSize;if(f&&f!==8)for(var h=a.indexOf("\t",b);h!==-1;){b<h&&(b={text:a.substring(b,h),style:d},e.ranges.push(b),
e.tabOffset+=b.text.length);b=f-e.tabOffset%f;if(b>0){for(var g="\u00a0",j=1;j<b;j++)g+=" ";b={text:g,style:d,ignoreChars:b-1};e.ranges.push(b);e.tabOffset+=b.text.length}b=h+1;if(b===c)return;h=a.indexOf("\t",b)}b<=c&&(b={text:a.substring(b,c),style:d},e.ranges.push(b),e.tabOffset+=b.text.length)}},_createSpan:function(b,c,d,f){var h=this.view,g="span";d&&d.tagName&&(g=d.tagName.toLowerCase());var l=g==="a";if(l)b.hasLink=!0;l&&!h._linksVisible&&(g="span");l=b.ownerDocument;b=a.createElement(b.ownerDocument,
g);d&&d.html?(b.innerHTML=d.html,b.ignore=!0):d&&d.node?(b.appendChild(d.node),b.ignore=!0):b.appendChild(l.createTextNode(d&&d.text?d.text:c));j(d,b);if(g==="a"){var m=h._getWindow();e(b,"click",function(a){return h._handleLinkClick(a?a:m.event)},!1)}b.viewStyle=d;if(f)b.ignoreChars=f;return b},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(b,c){var d=this._ensureCreated(),e=this.view;if(b===void 0)return this._getLineBoundingClientRect(d,
!0);var f=e._model,h=d.ownerDocument,g=this.lineIndex,j=null;if(b<f.getLineEnd(g)){f=f.getLineStart(g);for(g=d.firstChild;g;){if(!g.ignore){var l=g.firstChild,m=l.length;g.ignoreChars&&(m-=g.ignoreChars);if(f+m>b){j=b-f;if(e._isRangeRects)h=h.createRange(),h.setStart(l,j),h.setEnd(l,j+1),j=new r(h.getBoundingClientRect());else if(a.isIE)h=h.body.createTextRange(),h.moveToElementText(g),h.collapse(),h.moveEnd("character",j+1),h.moveStart("character",j),j=new r(h.getBoundingClientRect());else{var n=
l.data;g.removeChild(l);g.appendChild(h.createTextNode(n.substring(0,j)));var i=a.createElement(h,"span");i.appendChild(h.createTextNode(n.substring(j,j+1)));g.appendChild(i);g.appendChild(h.createTextNode(n.substring(j+1)));j=new r(i.getBoundingClientRect());g.innerHTML="";g.appendChild(l);this._createdDiv||(h=e._getSelection(),(f<=h.start&&h.start<f+m||f<=h.end&&h.end<f+m)&&e._updateDOMSelection())}a.isIE&&(h=d.ownerDocument.defaultView||d.ownerDocument.parentWindow,d=h.screen.logicalXDPI/h.screen.deviceXDPI,
h=h.screen.logicalYDPI/h.screen.deviceYDPI,j.left*=d,j.right*=d,j.top*=h,j.bottom*=h);break}f+=m}g=g.nextSibling}}d=this.getBoundingClientRect();if(!j)e._wrapMode?(e=this.getClientRects(),j=e[e.length-1],j.left=j.right,j.left+=d.left,j.top+=d.top,j.right+=d.left,j.bottom+=d.top):(j=new r(d),j.left=j.right);if(c||c===void 0)j.left-=d.left,j.top-=d.top,j.right-=d.left,j.bottom-=d.top;return j},_getClientRects:function(a,b){var c,d,e,f;if(!a._rectsCache){c=a.getClientRects();d=Array(c.length);for(f=
0;f<c.length;f++)e=d[f]=new r(c[f]),e.left-=b.left,e.top-=b.top,e.right-=b.left,e.bottom-=b.top;a._rectsCache=d}c=a._rectsCache;d=[c.length];for(f=0;f<c.length;f++)d[f]=new r(c[f]);return d},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var b=this._ensureCreated(),c=[],d=b.firstChild,e,f=b.getBoundingClientRect();d;){if(!d.ignore)for(var h=this._getClientRects(d,f),b=0;b<h.length;b++){var g=h[b],j;if(g.top!==g.bottom){var l=g.top+(g.bottom-g.top)/2;for(j=
0;j<c.length;j++)if(e=c[j],e.top<=l&&l<e.bottom)break;if(j===c.length)c.push(g);else{if(g.left<e.left)e.left=g.left;if(g.top<e.top)e.top=g.top;if(g.right>e.right)e.right=g.right;if(g.bottom>e.bottom)e.bottom=g.bottom}}}d=d.nextSibling}return a!==void 0?c[a]:c},_getLineBoundingClientRect:function(a,b){var c=new r(a.getBoundingClientRect());if(!this.view._wrapMode){c.right=c.left;for(var d=a.lastChild;d&&d.ignoreChars===d.firstChild.length;)d=d.previousSibling;if(d)d=d.getBoundingClientRect(),c.right=
d.right+m(a).right}b&&(d=m(a),c.left+=d.left,c.right-=d.right);return c},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(a){if(!this.view._wrapMode)return 0;for(var b=this.getClientRects(),a=this.getBoundingClientRect(a),a=a.top+(a.bottom-a.top)/2,c=0;c<b.length;c++)if(b[c].top<=a&&a<b[c].bottom)return c;return b.length-1},getLineStart:function(a){if(!this.view._wrapMode||a===0)return this.view._model.getLineStart(a);var b=this.getClientRects();
return this.getOffset(b[a].left+1,b[a].top+1)},getOffset:function(b,c){var d=this.view,e=d._model,f=this.lineIndex,h=e.getLineStart(f),g=e.getLineEnd(f);if(h===g)return h;var j=this._ensureCreated(),l=this.getBoundingClientRect(),m,n;if(d._wrapMode){m=this.getClientRects();if(c<m[0].top)c=m[0].top;for(var i=0;i<m.length;i++)if(n=m[i],n.top<=c&&c<n.bottom)break;if(b<n.left)b=n.left;b>n.right&&(b=n.right-1)}else b<0&&(b=0),b>l.right-l.left&&(b=l.right-l.left);var k=j.ownerDocument,i=k.defaultView||
k.parentWindow,q=a.isIE?i.screen.logicalXDPI/i.screen.deviceXDPI:1,s=a.isIE?i.screen.logicalYDPI/i.screen.deviceYDPI:1,i=h,r=j.firstChild;a:for(;r;){if(!r.ignore){var p=r.firstChild,j=p.length;r.ignoreChars&&(j-=r.ignoreChars);var t,D,E;m=this._getClientRects(r,l);for(var I=0;I<m.length;I++)if(n=m[I],n.left<=b&&b<n.right&&(!d._wrapMode||n.top<=c&&c<n.bottom)){if(a.isIE||d._isRangeRects){for(var k=d._isRangeRects?k.createRange():k.body.createTextRange(),I=j,M=-1;I-M>1;){var J=Math.floor((I+M)/2);m=
M+1;n=J===j-1&&r.ignoreChars?p.length:J+1;d._isRangeRects?(k.setStart(p,m),k.setEnd(p,n)):(k.moveToElementText(r),k.move("character",m),k.moveEnd("character",n-m));m=k.getClientRects();for(var P=!1,N=0;N<m.length;N++)if(n=m[N],t=n.left*q-l.left,E=n.right*q-l.left,D=n.top*s-l.top,n=n.bottom*s-l.top,t<=b&&b<E&&(!d._wrapMode||D<=c&&c<n)){P=!0;break}P?I=J:M=J}i+=I;m=I;n=I===j-1&&r.ignoreChars?p.length:Math.min(I+1,p.length);d._isRangeRects?(k.setStart(p,m),k.setEnd(p,n)):(k.moveToElementText(r),k.move("character",
m),k.moveEnd("character",n-m));n=k.getClientRects()[0];t=n.left*q-l.left;E=n.right*q-l.left;d=b>t+(E-t)/2;l=i-h;e=e.getLine(f);f=e.charCodeAt(l);55296<=f&&f<=56319&&d?l<e.length&&(f=e.charCodeAt(l+1),56320<=f&&f<=57343&&(i+=1)):56320<=f&&f<=57343&&!d&&l>0&&(f=e.charCodeAt(l-1),55296<=f&&f<=56319&&(i-=1));d&&i++}else{e=[];for(f=0;f<j;f++)e.push("<span>"),f===j-1?e.push(p.data.substring(f)):e.push(p.data.substring(f,f+1)),e.push("</span>");r.innerHTML=e.join("");for(e=r.firstChild;e;){n=e.getBoundingClientRect();
t=n.left-l.left;E=n.right-l.left;if(t<=b&&b<E){b>t+(E-t)/2&&i++;break}i++;e=e.nextSibling}if(!this._createdDiv)r.innerHTML="",r.appendChild(p),l=d._getSelection(),(i<=l.start&&l.start<i+j||i<=l.end&&l.end<i+j)&&d._updateDOMSelection()}break a}i+=j}r=r.nextSibling}return Math.min(g,Math.max(h,i))},getNextOffset:function(b,c){if(c.unit==="line"){var d=this.view._model,e=d.getLineAtOffset(b);if(c.count>0)return c.count--,d.getLineEnd(e);c.count++;return d.getLineStart(e)}return c.unit==="wordend"||c.unit===
"wordWS"||c.unit==="wordendWS"?this._getNextOffset_W3C(b,c):a.isIE?this._getNextOffset_IE(b,c):this._getNextOffset_W3C(b,c)},_getNextOffset_W3C:function(a,b){function c(a){return 33<=a&&a<=47||58<=a&&a<=64||91<=a&&a<=94||a===96||123<=a&&a<=126}function d(a){return a===32||a===9}var e=this.view._model,f=e.getLineAtOffset(a),h=e.getLine(f),g=e.getLineStart(f),e=e.getLineEnd(f),f=h.length,j=a-g,l,m=b.count<0?-1:1;if(b.unit==="word"||b.unit==="wordend"||b.unit==="wordWS"||b.unit==="wordendWS")for(var n,
i,k;b.count!==0;){if(b.count>0){if(j===f)return e;l=h.charCodeAt(j);n=c(l);i=!n&&!d(l);for(j++;j<f;){l=h.charCodeAt(j);if(b.unit!=="wordWS"&&b.unit!=="wordendWS"){k=c(l);if(b.unit==="wordend"){if(!k&&n)break}else if(k&&!n)break;l=!k&&!d(l)}else l=!d(l);if(b.unit==="wordend"||b.unit==="wordendWS"){if(!l&&i)break}else if(l&&!i)break;i=l;n=k;j++}}else{if(j===0)return g;j--;l=h.charCodeAt(j);n=c(l);for(i=!n&&!d(l);0<j;){l=h.charCodeAt(j-1);if(b.unit!=="wordWS"&&b.unit!=="wordendWS"){k=c(l);if(b.unit===
"wordend"){if(k&&!n)break}else if(!k&&n)break;l=!k&&!d(l)}else l=!d(l);if(b.unit==="wordend"||b.unit==="wordendWS"){if(l&&!i)break}else if(!l&&i)break;i=l;n=k;j--}}b.count-=m}else for(;b.count!==0&&0<=j+m&&j+m<=f;)j+=m,l=h.charCodeAt(j),56320<=l&&l<=57343&&j>0&&(l=h.charCodeAt(j-1),55296<=l&&l<=56319&&(j+=m)),b.count-=m;return g+j},_getNextOffset_IE:function(a,b){var c=this._ensureCreated(),d=this.view._model,e=this.lineIndex,f=0,h;h=d.getLineStart(e);var g=c.ownerDocument,j=b.count<0?-1:1;if(a===
d.getLineEnd(e)){for(c=c.lastChild;c&&c.ignoreChars;)c=c.previousSibling;if(!c)return h;f=g.body.createTextRange();f.moveToElementText(c);h=f.text.length;f.moveEnd(b.unit,j);f=a+f.text.length-h}else if(a===h&&b.count<0)f=h;else for(c=c.firstChild;c;){d=c.firstChild.length;c.ignoreChars&&(d-=c.ignoreChars);if(h+d>a){f=g.body.createTextRange();a===h&&b.count<0?f.moveToElementText(c.previousSibling):(f.moveToElementText(c),f.collapse(),f.moveEnd("character",a-h));h=f.text.length;f.moveEnd(b.unit,j);
f=a+f.text.length-h;break}h=d+h;c=c.nextSibling}b.count-=j;return f},destroy:function(){var a=this._createdDiv;if(a)a.parentNode.removeChild(a),this._createdDiv=null}};p.prototype={addKeyMode:function(a,b){var c=this._keyModes;b!==void 0?c.splice(b,0,a):c.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,b){a.setView(this);var c=this._rulers;if(b!==void 0){var d,e;for(d=0,e=0;d<c.length&&e<b;d++)a.getLocation()===c[d].getLocation()&&e++;c.splice(e,0,a);b=e}else c.push(a);this._createRuler(a,
b);this._update()},computeSize:function(){var b=0,c=0,d=this._model,e=this._clientDiv;if(!e)return{width:b,height:c};var f=e.style.width;if(a.isWebkit)e.style.width="0x7fffffffpx";for(var d=d.getLineCount(),h=0;h<d;h++){var g=this._getLine(h),j=g.getBoundingClientRect(),b=Math.max(b,j.right-j.left);c+=j.bottom-j.top;g.destroy()}if(a.isWebkit)e.style.width=f;e=this._getViewPadding();b+=e.right+e.left+this._metrics.scrollWidth;c+=e.bottom+e.top+this._metrics.scrollWidth;return{width:b,height:c}},convert:function(a,
b,c){if(this._clientDiv){var d=this._getScroll(),e=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect();b==="document"&&(a.x!==void 0&&(a.x+=-d.x+f.left+e.left),a.y!==void 0&&(a.y+=-d.y+f.top+e.top));c==="document"&&(a.x!==void 0&&(a.x+=d.x-f.left-e.left),a.y!==void 0&&(a.y+=d.y-f.top-e.top));return a}},destroy:function(){for(var a=0;a<this._rulers.length;a++)this._rulers[a].setView(null);this.rulers=null;this._destroyView();this.onDestroy({type:"Destroy"});this._actions=this._keyModes=
this._doubleClickSelection=this._selection=this._theme=this._model=this._parent=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),a.isOpera&&this._clientDiv.blur(),this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(a){if(a=this._actions[a])return a.actionDescription},getActions:function(a){var b=[],c=this._actions,d;for(d in c)c.hasOwnProperty(d)&&(a||!c[d].defaultHandler)&&b.push(d);return b},getBottomIndex:function(a){return!this._clientDiv?
0:this._getBottomIndex(a)},getBottomPixel:function(){return!this._clientDiv?0:this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var a=this._getScroll();return{x:a.x,y:a.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?0:this._getScroll().x},getKeyBindings:function(a){for(var b=[],c=this._keyModes,
d=0;d<c.length;d++)b=b.concat(c[d].getKeyBindings(a));return b},getKeyModes:function(){return this._keyModes.slice(0)},getLineHeight:function(a){return!this._clientDiv?0:this._getLineHeight(a)},getLineIndex:function(a){return!this._clientDiv?0:this._getLineIndex(a)},getLinePixel:function(a){return!this._clientDiv?0:this._getLinePixel(a)},getLocationAtOffset:function(a){if(!this._clientDiv)return{x:0,y:0};var b=this._model,a=Math.min(Math.max(0,a),b.getCharCount()),b=b.getLineAtOffset(a),c=this._getLine(b),
a=c.getBoundingClientRect(a);c.destroy();c=a.left;b=this._getLinePixel(b)+a.top;return{x:c,y:b}},getOptions:function(){var a;if(arguments.length===0)a=this._defaultOptions();else if(arguments.length===1){if(a=arguments[0],typeof a==="string")return c(this["_"+a])}else{a={};for(var b in arguments)arguments.hasOwnProperty(b)&&(a[arguments[b]]=void 0)}for(var d in a)a.hasOwnProperty(d)&&(a[d]=c(this["_"+d]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,b){if(!this._clientDiv)return 0;
var c=this._getLineIndex(b),d=this._getLine(c),c=d.getOffset(a,b-this._getLinePixel(c));d.destroy();return c},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=this._getSelection();return{start:a.start,end:a.end}},getText:function(a,b){return this._model.getText(a,b)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(a,b,c){if(this._clientDiv){if(a=this._actions[a]){if(!b&&
a.handler&&a.handler(c))return!0;if(a.defaultHandler)return typeof a.defaultHandler(c)==="boolean"}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(a){return this.dispatchEvent(a)},onDragStart:function(a){return this.dispatchEvent(a)},onDrag:function(a){return this.dispatchEvent(a)},onDragEnd:function(a){return this.dispatchEvent(a)},onDragEnter:function(a){return this.dispatchEvent(a)},onDragOver:function(a){return this.dispatchEvent(a)},onDragLeave:function(a){return this.dispatchEvent(a)},
onDrop:function(a){return this.dispatchEvent(a)},onDestroy:function(a){return this.dispatchEvent(a)},onLineStyle:function(a){return this.dispatchEvent(a)},onKeyDown:function(a){return this.dispatchEvent(a)},onKeyPress:function(a){return this.dispatchEvent(a)},onKeyUp:function(a){return this.dispatchEvent(a)},onModelChanged:function(a){return this.dispatchEvent(a)},onModelChanging:function(a){return this.dispatchEvent(a)},onModify:function(a){return this.dispatchEvent(a)},onMouseDown:function(a){return this.dispatchEvent(a)},
onMouseUp:function(a){return this.dispatchEvent(a)},onMouseMove:function(a){return this.dispatchEvent(a)},onMouseOver:function(a){return this.dispatchEvent(a)},onMouseOut:function(a){return this.dispatchEvent(a)},onSelection:function(a){return this.dispatchEvent(a)},onScroll:function(a){return this.dispatchEvent(a)},onVerify:function(a){return this.dispatchEvent(a)},onFocus:function(a){return this.dispatchEvent(a)},onBlur:function(a){return this.dispatchEvent(a)},redraw:function(){if(!(this._redrawCount>
0)){var a=this._model.getLineCount();this.redrawRulers(0,a);this.redrawLines(0,a)}},redrawRulers:function(a,b){if(!(this._redrawCount>0))for(var c=this.getRulers(),d=0;d<c.length;d++)this.redrawLines(a,b,c[d])},redrawLines:function(a,b,c){if(!(this._redrawCount>0)&&(a===void 0&&(a=0),b===void 0&&(b=this._model.getLineCount()),a!==b)){var d=this._clientDiv;if(d){if(c)for(d=(c.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild;d;){if(d._ruler===c)break;d=d.nextSibling}c?d.rulerChanged=
!0:this._lineHeight&&this._resetLineHeight(a,b);if(!c||c.getOverview()==="page")for(d=d.firstChild;d;){var e=d.lineIndex;if(a<=e&&e<b)d.lineChanged=!0;d=d.nextSibling}if(!c&&!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<b)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._queueUpdate()}}},redrawRange:function(a,b){if(!(this._redrawCount>0)){var c=this._model;a===void 0&&(a=0);b===void 0&&(b=c.getCharCount());var d=c.getLineAtOffset(a),c=c.getLineAtOffset(Math.max(a,
b-1))+1;this.redrawLines(d,c)}},removeKeyMode:function(a){for(var b=this._keyModes,c=0;c<b.length;c++)if(b[c]===a){b.splice(c,1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var b=this._rulers,c=0;c<b.length;c++)if(b[c]===a){b.splice(c,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,b,c){if(a){var d=this._actions,e=d[a];e||(e=d[a]={});e.handler=b;if(c!==void 0)e.actionDescription=
c}},setKeyBinding:function(a,b){this._keyModes[0].setKeyBinding(a,b)},setCaretOffset:function(a,b,c){var d=this._model.getCharCount(),a=Math.max(0,Math.min(a,d));this._setSelection(new s(a,a,!1),b===void 0||b,!0,c)},setHorizontalPixel:function(a){this._clientDiv&&(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},setRedraw:function(a){a?--this._redrawCount===0&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==this._model){this._model.removeEventListener("preChanging",this._modelListener.onChanging);
this._model.removeEventListener("postChanged",this._modelListener.onChanged);var b=this._model.getLineCount(),c=this._model.getCharCount(),d=a.getLineCount(),e=a.getCharCount(),f={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:c,addedCharCount:e,removedLineCount:b,addedLineCount:d};this.onModelChanging(f);this._model=a;f={type:"ModelChanged",start:0,removedCharCount:c,addedCharCount:e,removedLineCount:b,addedLineCount:d};this.onModelChanged(f);this._model.addEventListener("preChanging",
this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(a){var b=this._defaultOptions(),d;for(d in a)if(a.hasOwnProperty(d)){var e=a[d];if(!h(this["_"+d],e)){var f=b[d]?b[d].update:null;f?f.call(this,e):this["_"+d]=c(e)}}},setSelection:function(a,b,c,d){var e=a>b;if(e)var f=a,a=b,b=f;f=this._model.getCharCount();a=Math.max(0,Math.min(a,f));b=Math.max(0,Math.min(b,f));this._setSelection(new s(a,b,e),
c===void 0||c,!0,d)},setText:function(b,c,d){var e=c===void 0&&d===void 0;c===void 0&&(c=0);d===void 0&&(d=this._model.getCharCount());if(e)this._variableLineHeight=!1;this._modifyContent({text:b,start:c,end:d,_code:!0},!e);if(e)this._columnX=-1,this._setSelection(new s(0,0,!1),!0),a.isFirefox&&this._fixCaret()},setTopIndex:function(a){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,a))-this._getScroll().y)},setTopPixel:function(a){this._clientDiv&&this._scrollView(0,Math.max(0,
a)-this._getScroll().y)},showSelection:function(){return this._showCaret(!0)},update:function(a,b){this._clientDiv&&(a&&this._updateStyle(),b===void 0||b?this._update():this._queueUpdate())},_handleRootMouseDown:function(b){if(!this._ignoreEvent(b)){if(a.isFirefox&&b.which===1)this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0;var c=this._overlayDiv||this._clientDiv;if(a.isIE<9)c=this._viewDiv;for(var d=b.target?b.target:b.srcElement;d;){if(c===d)return;
d=d.parentNode}b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();if(!this._isW3CEvents){var e=this;this._getWindow().setTimeout(function(){e._clientDiv.focus()},0)}}},_handleRootMouseUp:function(b){if(!this._ignoreEvent(b)&&a.isFirefox&&b.which===1)this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),this._ignoreBlur=!1},_handleBlur:function(){if(!this._ignoreBlur){this._hasFocus=!1;if(a.isIE<9&&!this._getSelection().isEmpty()){var b=
this._rootDiv,c=a.createElement(b.ownerDocument,"div");b.appendChild(c);b.removeChild(c)}if(this._cursorDiv)this._cursorDiv.style.display="none";if(this._selDiv1)if(this._selDiv1.style.background="lightgray",this._selDiv2.style.background="lightgray",this._selDiv3.style.background="lightgray",b=this._getWindow(),c=this._selDiv1.ownerDocument,b.getSelection){c=b.getSelection();for(b=c.anchorNode;b;){if(b===this._clientDiv){c.rangeCount>0&&c.removeAllRanges();break}b=b.parentNode}}else if(c.selection){this._ignoreSelect=
!1;for(b=c.selection.createRange().parentElement();b;){if(b===this._clientDiv){c.selection.empty();break}b=b.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(b){if(!this._ignoreEvent(b)){a.isIE&&this._lastMouseButton===3&&this._updateDOMSelection();var c=!1;this.isListening("ContextMenu")?(c=this._createMouseEvent("ContextMenu",b),c.screenX=b.screenX,c.screenY=b.screenY,this.onContextMenu(c),c=c.defaultPrevented):a.isMac&&a.isFirefox&&
b.button===0&&(c=!0);if(c)return b.preventDefault&&b.preventDefault(),!1}},_handleCopy:function(a){if(!this._ignoreEvent(a)&&!this._ignoreCopy&&this._doCopy(a))return a.preventDefault&&a.preventDefault(),!1},_handleCut:function(a){if(!this._ignoreEvent(a)&&this._doCut(a))return a.preventDefault&&a.preventDefault(),!1},_handleDataModified:function(a){this._ignoreEvent(a)||this._startIME()},_handleDblclick:function(a){if(!this._ignoreEvent(a)&&(this._lastMouseTime=a.timeStamp?a.timeStamp:(new Date).getTime(),
this._clickCount!==2))this._clickCount=2,this._handleMouse(a)},_handleDragStart:function(b){if(!this._ignoreEvent(b)){if(a.isFirefox){var c=this;this._getWindow().setTimeout(function(){c._clientDiv.contentEditable=!0;c._clientDiv.draggable=!1;c._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",b)),this._dragOffset=-1;else return b.preventDefault&&b.preventDefault(),!1}},_handleDrag:function(a){if(!this._ignoreEvent(a)&&
this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",a))},_handleDragEnd:function(b){if(!this._ignoreEvent(b)){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",b));a.isFirefox&&(this._fixCaret(),b.dataTransfer.dropEffect==="none"&&!b.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(b){if(!this._ignoreEvent(b)){var c=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(c=!1,this.onDragEnter(this._createMouseEvent("DragEnter",
b)));if(a.isWebkit||c)return b.preventDefault&&b.preventDefault(),!1}},_handleDragOver:function(b){if(!this._ignoreEvent(b)){var c=!0;this.isListening("DragOver")&&(c=!1,this.onDragOver(this._createMouseEvent("DragOver",b)));if(a.isWebkit||c){if(c)b.dataTransfer.dropEffect="none";b.preventDefault&&b.preventDefault();return!1}}},_handleDragLeave:function(a){if(!this._ignoreEvent(a)&&(this._dropTarget=!1,this.isListening("DragLeave")))this.onDragLeave(this._createMouseEvent("DragLeave",a))},_handleDrop:function(a){if(!this._ignoreEvent(a)){this._dropTarget=
!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",a));a.preventDefault&&a.preventDefault();return!1}},_handleFocus:function(){this._hasFocus=!0;a.isIOS&&this._lastTouchOffset!==void 0?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=void 0):this._updateDOMSelection();if(this._cursorDiv)this._cursorDiv.style.display="block";if(this._selDiv1){var b=this._highlightRGB;this._selDiv1.style.background=b;this._selDiv2.style.background=b;this._selDiv3.style.background=
b}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(b){if(!this._ignoreEvent(b)){if(this.isListening("KeyDown")){var c=this._createKeyEvent("KeyDown",b);this.onKeyDown(c);if(c.defaultPrevented){if(a.isFirefox)this._keyDownPrevented=!0;b.preventDefault();return}}c=!1;switch(b.keyCode){case 16:case 17:case 18:case 91:c=!0;break;default:this._setLinksVisible(!1)}if(b.keyCode===229){if(this._readonly)return b.preventDefault&&b.preventDefault(),!1;c=!0;if(a.isSafari&&a.isMac&&
b.ctrlKey)c=!1,b.keyCode=129;c&&this._startIME()}else c||this._commitIME();if((a.isMac||a.isLinux)&&a.isFirefox<4||a.isOpera)return this._keyDownEvent=b,!0;if(this._doAction(b))return b.preventDefault?(b.preventDefault(),b.stopPropagation()):(b.cancelBubble=!0,b.returnValue=!1,b.keyCode=0),!1}},_handleKeyPress:function(b){if(!this._ignoreEvent(b))if(this._keyDownPrevented)b.preventDefault&&(b.preventDefault(),b.stopPropagation()),this._keyDownPrevented=void 0;else{if(a.isMac&&a.isWebkit&&(63232<=
b.keyCode&&b.keyCode<=63487||b.keyCode===13||b.keyCode===8))return b.preventDefault&&b.preventDefault(),!1;if(((a.isMac||a.isLinux)&&a.isFirefox<4||a.isOpera)&&this._doAction(this._keyDownEvent))return b.preventDefault&&b.preventDefault(),!1;var c=a.isMac?b.metaKey:b.ctrlKey;if(b.charCode!==void 0&&c)switch(b.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(c=this._createKeyEvent("KeyPress",b),this.onKeyPress(c),c.defaultPrevented)){b.preventDefault();return}if(this._doAction(b))return b.preventDefault?
(b.preventDefault(),b.stopPropagation()):(b.cancelBubble=!0,b.returnValue=!1,b.keyCode=0),!1;c=!1;if(a.isMac){if(b.ctrlKey||b.metaKey)c=!0}else if(a.isFirefox){if(b.ctrlKey||b.altKey)c=!0}else b.ctrlKey^b.altKey&&(c=!0);if(!c&&(c=a.isOpera?b.which:b.charCode!==void 0?b.charCode:b.keyCode,c>31))return this._doContent(String.fromCharCode(c)),b.preventDefault&&b.preventDefault(),!1}},_handleKeyUp:function(b){if(!this._ignoreEvent(b)){if(this.isListening("KeyUp")){var c=this._createKeyEvent("KeyUp",b);
this.onKeyUp(c);if(c.defaultPrevented){b.preventDefault();return}}(a.isMac?b.metaKey:b.ctrlKey)||this._setLinksVisible(!1);b.keyCode===13&&this._commitIME()}},_handleLinkClick:function(b){if(!(a.isMac?b.metaKey:b.ctrlKey))return b.preventDefault&&b.preventDefault(),!1},_handleMouse:function(b){var c=this._getWindow(),d=!0,e=c;if(a.isIE||a.isFirefox&&!this._overlayDiv)e=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=!0;var f=this;c.setTimeout(function(){f.focus();f._ignoreFocus=
!1},0)}this._clickCount===1?(d=this._setSelectionTo(b.clientX,b.clientY,b.shiftKey,!a.isOpera&&this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(e):(this._isW3CEvents&&this._setGrab(e),this._doubleClickSelection=null,this._setSelectionTo(b.clientX,b.clientY,b.shiftKey),this._doubleClickSelection=this._getSelection());return d},_handleMouseDown:function(b){if(!this._ignoreEvent(b)){if(this._linksVisible)if((b.target||b.srcElement).tagName!=="A")this._setLinksVisible(!1);else return;this._commitIME();
var c=b.which;c||(b.button===4&&(c=2),b.button===2&&(c=3),b.button===1&&(c=1));var d=c!==2&&b.timeStamp?b.timeStamp:(new Date).getTime(),e=d-this._lastMouseTime,f=Math.abs(this._lastMouseX-b.clientX),h=Math.abs(this._lastMouseY-b.clientY),g=this._lastMouseButton===c;this._lastMouseX=b.clientX;this._lastMouseY=b.clientY;this._lastMouseTime=d;this._lastMouseButton=c;if(c===1)this._isMouseDown=!0,g&&e<=this._clickTime&&f<=this._clickDist&&h<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&
(d=this._createMouseEvent("MouseDown",b),this.onMouseDown(d),d.defaultPrevented)){b.preventDefault();return}if(c===1&&this._handleMouse(b)&&(a.isIE>=9||a.isOpera||a.isChrome||a.isSafari||a.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),b.preventDefault();a.isFirefox&&this._lastMouseButton===3&&this._updateDOMSelection()}},_handleMouseOver:function(a){if(!this._ignoreEvent(a)&&!this._animation&&this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",a))},_handleMouseOut:function(a){if(!this._ignoreEvent(a)&&
!this._animation&&this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",a))},_handleMouseMove:function(b){if(!this._animation){var c=this._isClientDiv(b);if(this.isListening("MouseMove")&&c)this.onMouseMove(this._createMouseEvent("MouseMove",b));if(!this._dropTarget){var d=this._linksVisible||this._lastMouseMoveX!==b.clientX||this._lastMouseMoveY!==b.clientY;this._lastMouseMoveX=b.clientX;this._lastMouseMoveY=b.clientY;this._setLinksVisible(d&&!this._isMouseDown&&(a.isMac?
b.metaKey:b.ctrlKey));if(!this._isW3CEvents){if(b.button===0)return this._setGrab(null),!0;if(!this._isMouseDown&&b.button===1&&(this._clickCount&1)!==0&&c)return this._clickCount=2,this._handleMouse(b,this._clickCount)}if(this._isMouseDown&&this._dragOffset===-1){var c=b.clientX,b=b.clientY,e=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect(),h=this._getClientWidth(),g=this._getClientHeight(),d=f.left+e.left,j=f.top+e.top,h=f.left+e.left+h,e=f.top+e.top+g;b<j?this._doAutoScroll("up",
c,b-j):b>e?this._doAutoScroll("down",c,b-e):c<d&&!this._wrapMode?this._doAutoScroll("left",c-d,b):c>h&&!this._wrapMode?this._doAutoScroll("right",c-h,b):(this._endAutoScroll(),this._setSelectionTo(c,b,!0))}}}},_isClientDiv:function(a){for(var b=this._overlayDiv||this._clientDiv,a=a.target?a.target:a.srcElement;a;){if(b===a)return!0;a=a.parentNode}return!1},_createKeyEvent:function(a,b){return{type:a,event:b,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,b){var c=
this.convert({x:b.clientX,y:b.clientY},"page","document");return{type:a,event:b,clickCount:this._clickCount,x:c.x,y:c.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(b){var c=b.which?b.button===0:b.button===1;if(this.isListening("MouseUp")&&(this._isClientDiv(b)||c&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",b));if(!this._linksVisible&&c&&this._isMouseDown){if(this._dragOffset!==-1)c=this._getSelection(),c.extend(this._dragOffset),c.collapse(),
this._setSelection(c,!0,!0),this._dragOffset=-1;this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null);a.isFirefox&&b.preventDefault()}},_handleMouseWheel:function(b){var c=this._getLineHeight(),d=0,e=0;a.isIE||a.isOpera?e=-b.wheelDelta/40*c:a.isFirefox?(c=a.isMac?b.detail*3:Math.max(-256,Math.min(256,b.detail))*c,b.axis===b.HORIZONTAL_AXIS?d=c:e=c):a.isMac?(e=b.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=b.timeStamp,d=b.wheelDeltaX%120!==0?1:e<40?40/(40-e):40,e=
b.wheelDeltaY%120!==0?1:e<40?40/(40-e):40,d=Math.ceil(-b.wheelDeltaX/d),-1<d&&d<0&&(d=-1),0<d&&d<1&&(d=1),e=Math.ceil(-b.wheelDeltaY/e),-1<e&&e<0&&(e=-1),0<e&&e<1&&(e=1)):(d=-b.wheelDeltaX,e=-b.wheelDeltaY/120*8*c);if(a.isSafari){for(c=b.target;c&&c.lineIndex===void 0;)c=c.parentNode;this._mouseWheelLine=c}c=this._getScroll();this._scrollView(d,e);d=this._getScroll();if(c.x!==d.x||c.y!==d.y)return b.preventDefault&&b.preventDefault(),!1},_handlePaste:function(b){if(!this._ignoreEvent(b)&&!this._ignorePaste&&
this._doPaste(b)){if(a.isIE){var c=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){c._updateDOMSelection();c._ignoreFocus=!1},0)}b.preventDefault&&b.preventDefault();return!1}},_handleResize:function(){var b=this._parent.clientWidth,c=this._parent.clientHeight;if(this._parentWidth!==b||this._parentHeight!==c)this._parentWidth!==b&&this._wrapMode&&this._resetLineHeight(),this._parentWidth=b,this._parentHeight=c,a.isIE<9?this._queueUpdate():this._update()},_handleRulerEvent:function(a){for(var b=
a.target?a.target:a.srcElement,c=b.lineIndex;b&&!b._ruler;){if(c===void 0&&b.lineIndex!==void 0)c=b.lineIndex;b=b.parentNode}b=b?b._ruler:null;if(c===void 0&&b&&b.getOverview()==="document"){var c=this._getClientHeight(),d=this._model.getLineCount(),e=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect(),c=Math.floor((a.clientY-f.top-this._metrics.scrollWidth)*d/(c+e.top+e.bottom-2*this._metrics.scrollWidth));0<=c&&c<d||(c=void 0)}if(b)switch(a.type){case "click":if(b.onClick)b.onClick(c,
a);break;case "dblclick":if(b.onDblClick)b.onDblClick(c,a);break;case "mousemove":if(b.onMouseMove)b.onMouseMove(c,a);break;case "mouseover":if(b.onMouseOver)b.onMouseOver(c,a);break;case "mouseout":if(b.onMouseOut)b.onMouseOut(c,a)}},_handleScroll:function(){var a=this._getScroll(!1),b=this._hScroll,c=this._vScroll;if(b!==a.x||c!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),this._update(c===a.y),this.onScroll({type:"Scroll",oldValue:{x:b,y:c},newValue:a})},_handleSelectStart:function(a){if(this._ignoreSelect)return a&&
a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,b){if(a){var c;c=a.tagName==="DIV"?a:a.parentNode.parentNode;var d=0,e=c.lineIndex;if(a.tagName!=="DIV")for(c=c.firstChild;c;){var f=c.firstChild;if(f===a){c.ignoreChars&&(d-=c.ignoreChars);d+=b;break}c.ignoreChars&&(d-=c.ignoreChars);d+=f.data.length;c=c.nextSibling}return Math.max(0,d)+this._model.getLineStart(e)}},_updateSelectionFromDOM:function(){var a=this._getWindow().getSelection(),b=this._getModelOffset(a.anchorNode,a.anchorOffset),
a=this._getModelOffset(a.focusNode,a.focusOffset);b===void 0||a===void 0||this._setSelection(new s(b,a),!1,!1)},_handleSelectionChange:function(){if(this._imeOffset===-1)if(a.isAndroid){var b=this._getWindow();this._selTimer&&b.clearTimeout(this._selTimer);var c=this;this._selTimer=b.setTimeout(function(){if(c._clientDiv)c._selTimer=null,c._updateSelectionFromDOM()},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(b){if(!this._ignoreEvent(b)){this._imeOffset=-1;if(a.isAndroid){for(var c=
this._getWindow().getSelection(),d=c.anchorNode;d;){if(d.lineIndex!==void 0)break;d=d.parentNode}if(d){var e=this._model,f=d.lineIndex,h=e.getLine(f),g=h,j=0,e=e.getLineStart(f);if(c.rangeCount>0)c.getRangeAt(0).deleteContents(),f=d.ownerDocument.createTextNode(b.data),c.getRangeAt(0).insertNode(f),j=this._getDOMText(d,f),g=j.text,j=j.offset,f.parentNode.removeChild(f);d.lineRemoved=!0;for(d=0;h.charCodeAt(d)===g.charCodeAt(d)&&d<j;)d++;c=h.length-1;for(f=g.length-h.length;h.charCodeAt(c)===g.charCodeAt(c+
f)&&c+f>=j+b.data.length;)c--;c++;h=g.substring(d,c+f);d+=e;c+=e;this._modifyContent({text:h,start:d,end:c,_ignoreDOMSelection:!0},!0)}}else this._doContent(b.data);b.preventDefault()}},_handleTouchStart:function(b){this._commitIME();var c=this._getWindow();if(this._touchScrollTimer)this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",c.clearInterval(this._touchScrollTimer),this._touchScrollTimer=null;var d=b.touches;if(d.length===1){var d=d[0],e=d.clientX,f=d.clientY;this._touchStartX=
e;this._touchStartY=f;if(a.isAndroid&&(f<d.pageY-c.pageYOffset||e<d.pageX-c.pageXOffset))e=d.pageX-c.pageXOffset,f=d.pageY-c.pageYOffset;c=this.convert({x:e,y:f},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(c.x,c.y);this._touchStartTime=b.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var b=a.touches;if(b.length===1){b=b[0];this._touchCurrentX=b.clientX;this._touchCurrentY=b.clientY;if(!this._touchScrollTimer&&a.timeStamp-this._touchStartTime<200){this._vScrollDiv.style.display=
"block";if(!this._wrapMode)this._hScrollDiv.style.display="block";var c=this,d=this._getWindow();this._touchScrollTimer=d.setInterval(function(){var a=0,b=0;if(c._touching)a=c._touchStartX-c._touchCurrentX,b=c._touchStartY-c._touchCurrentY,c._touchSpeedX=a/10,c._touchSpeedY=b/10,c._touchStartX=c._touchCurrentX,c._touchStartY=c._touchCurrentY;else if(Math.abs(c._touchSpeedX)<0.1&&Math.abs(c._touchSpeedY)<0.1){c._vScrollDiv.style.display="none";c._hScrollDiv.style.display="none";d.clearInterval(c._touchScrollTimer);
c._touchScrollTimer=null;return}else a=c._touchSpeedX*10,b=c._touchSpeedY*10,c._touchSpeedX*=0.95,c._touchSpeedY*=0.95;c._scrollView(a,b)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){if(a.touches.length===0)this._touching=!1},_doAction:function(a){var b,c,d=this._keyModes;for(c=d.length-1;c>=0;c--)if(b=d[c],typeof b.match==="function"&&(b=b.match(a),b!==void 0))return this.invokeAction(b);return!1},_doMove:function(a,b){var c=this._model,d=b.getCaret(),e=c.getLineAtOffset(d);
if(!a.count)a.count=1;for(;a.count!==0;){var f=c.getLineStart(e);if(a.count<0&&d===f)if(e>0)a.unit==="character"&&a.count++,e--,b.extend(c.getLineEnd(e));else break;else if(a.count>0&&d===c.getLineEnd(e))if(e+1<c.getLineCount())a.unit==="character"&&a.count--,e++,b.extend(c.getLineStart(e));else break;else{var h=!1;a.expandTab&&a.unit==="character"&&(d-f)%this._tabSize===0&&(h=!/[^ ]/.test(c.getText(f,d)));h?(b.extend(d-this._tabSize),a.count+=a.count<0?1:-1):(f=this._getLine(e),b.extend(f.getNextOffset(d,
a)),f.destroy())}d=b.getCaret()}return b},_doBackspace:function(a){var b=this._getSelection();if(b.isEmpty()){if(!a.count)a.count=1;a.count*=-1;a.expandTab=this._expandTab;this._doMove(a,b)}this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doCase:function(a){var b=this._getSelection();this._doMove(a,b);var c=this.getText(b.start,b.end);this._setSelection(b,!0);switch(a.type){case "lower":c=c.toLowerCase();break;case "capitalize":c=c.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});
break;case "reverse":a="";for(b=0;b<c.length;b++){var d=c[b],e=d.toLowerCase(),d=e!==d?e:d.toUpperCase();a+=d}c=a;break;default:c=c.toUpperCase()}this._doContent(c);return!0},_doContent:function(a){var b=this._getSelection();if(this._overwriteMode&&b.isEmpty()){var c=this._model,d=c.getLineAtOffset(b.end);b.end<c.getLineEnd(d)&&(c=this._getLine(d),b.extend(c.getNextOffset(b.getCaret(),{unit:"character",count:1})),c.destroy())}this._modifyContent({text:a,start:b.start,end:b.end,_ignoreDOMSelection:!0},
!0)},_doCopy:function(a){var b=this._getSelection();return!b.isEmpty()?this._setClipboardText(this._getBaseText(b.start,b.end),a):!0},_doCursorNext:function(a){var b=this._getSelection();!b.isEmpty()&&!a.select?b.start=b.end:this._doMove(a,b);a.select||b.collapse();this._setSelection(b,!0);return!0},_doCursorPrevious:function(a){var b=this._getSelection();if(!b.isEmpty()&&!a.select)b.end=b.start;else{if(!a.count)a.count=1;a.count*=-1;this._doMove(a,b)}a.select||b.collapse();this._setSelection(b,!0);
return!0},_doCut:function(a){var b=this._getSelection();return!b.isEmpty()?(b=this._getBaseText(b.start,b.end),this._doContent(""),this._setClipboardText(b,a)):!0},_doDelete:function(a){var b=this._getSelection();b.isEmpty()&&this._doMove(a,b);this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doEnd:function(a){var b=this._getSelection(),c=this._model,d;if(a.ctrl)b.extend(c.getCharCount()),d=function(){};else{var e=b.getCaret(),f=c.getLineAtOffset(e);if(this._wrapMode){var h=this._getLine(f),
e=h.getLineIndex(e),e=e===h.getLineCount()-1?c.getLineEnd(f):h.getLineStart(e+1)-1;h.destroy()}else a.count&&a.count>0&&(f=Math.min(f+a.count-1,c.getLineCount()-1)),e=c.getLineEnd(f);b.extend(e)}a.select||b.collapse();this._setSelection(b,!0,!0,d);return!0},_doEnter:function(a){var b=this._model,c=this._getSelection();this._doContent(b.getLineDelimiter());if(a&&a.noCursor)c.end=c.start,this._setSelection(c,!0);return!0},_doHome:function(a){var b=this._getSelection(),c=this._model,d;if(a.ctrl)b.extend(0),
d=function(){};else{var e=b.getCaret(),f=c.getLineAtOffset(e);this._wrapMode?(c=this._getLine(f),e=c.getLineIndex(e),e=c.getLineStart(e),c.destroy()):e=c.getLineStart(f);b.extend(e)}a.select||b.collapse();this._setSelection(b,!0,!0,d);return!0},_doLineDown:function(b){var c=this._model,d=this._getSelection(),e=d.getCaret(),f=c.getLineAtOffset(e),h=this._getLine(f),g=this._columnX,j=1,l=!1;if(g===-1||b.wholeLine||b.select&&a.isIE)g=b.wholeLine?c.getLineEnd(f+1):e,g=h.getBoundingClientRect(g).left;
(e=h.getLineIndex(e))<h.getLineCount()-1?j=h.getClientRects(e+1).top+1:(e=c.getLineCount()-1,l=f===e,b.count&&b.count>0?f=Math.min(f+b.count,e):f++);e=!1;if(l){if(b.select||a.isMac||a.isLinux)d.extend(c.getCharCount()),e=!0}else h.lineIndex!==f&&(h.destroy(),h=this._getLine(f)),d.extend(h.getOffset(g,j)),e=!0;e&&(b.select||d.collapse(),this._setSelection(d,!0,!0));this._columnX=g;h.destroy();return!0},_doLineUp:function(b){var c=this._model,d=this._getSelection(),e=d.getCaret(),f=c.getLineAtOffset(e),
h=this._getLine(f),g=this._columnX,j=!1,l;if(g===-1||b.wholeLine||b.select&&a.isIE)g=b.wholeLine?c.getLineStart(f-1):e,g=h.getBoundingClientRect(g).left;(e=h.getLineIndex(e))>0?l=h.getClientRects(e-1).top+1:(j=f===0,j||(b.count&&b.count>0?f=Math.max(f-b.count,0):f--,l=this._getLineHeight(f)-1));e=!1;if(j){if(b.select||a.isMac||a.isLinux)d.extend(0),e=!0}else h.lineIndex!==f&&(h.destroy(),h=this._getLine(f)),d.extend(h.getOffset(g,l)),e=!0;e&&(b.select||d.collapse(),this._setSelection(d,!0,!0));this._columnX=
g;h.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(b){var c=this,d=this._model,e=this._getSelection(),f=e.getCaret(),h=d.getLineAtOffset(f),g=d.getLineCount(),j=this._getScroll(),d=this._getClientHeight(),l,m;if(this._lineHeight){l=this._columnX;j=this._getBoundsAtOffset(f);if(l===-1||b.select&&a.isIE)l=j.left;f=this._getLineIndex(j.top+d);m=this._getLine(f);h=this._getLinePixel(f);f=m.getOffset(l,j.top+d-h);d=m.getBoundingClientRect(f);m.destroy();e.extend(f);b.select||e.collapse();
this._setSelection(e,!0,!0,function(){c._columnX=l},d.top+h-j.top);return!0}if(h<g-1){var n=this._getLineHeight(),i=Math.min(g-h-1,Math.floor(d/n)),i=Math.max(1,i);l=this._columnX;if(l===-1||b.select&&a.isIE)m=this._getLine(h),l=m.getBoundingClientRect(f).left,m.destroy();m=this._getLine(h+i);e.extend(m.getOffset(l,0));m.destroy();b.select||e.collapse();b=g*n;f=j.y+i*n;f+d>b&&(f=b-d);this._setSelection(e,!0,!0,function(){c._columnX=l},f-j.y)}return!0},_doPageUp:function(b){var c=this,d=this._model,
e=this._getSelection(),f=e.getCaret(),h=d.getLineAtOffset(f),g=this._getScroll(),j=this._getClientHeight(),l;if(this._lineHeight){l=this._columnX;g=this._getBoundsAtOffset(f);if(l===-1||b.select&&a.isIE)l=g.left;f=this._getLineIndex(g.bottom-j);d=this._getLine(f);h=this._getLinePixel(f);f=d.getOffset(l,g.bottom-j-h);j=d.getBoundingClientRect(f);d.destroy();e.extend(f);b.select||e.collapse();this._setSelection(e,!0,!0,function(){c._columnX=l},j.top+h-g.top);return!0}if(h>0){var m=this._getLineHeight(),
j=Math.max(1,Math.min(h,Math.floor(j/m)));l=this._columnX;if(l===-1||b.select&&a.isIE)d=this._getLine(h),l=d.getBoundingClientRect(f).left,d.destroy();d=this._getLine(h-j);e.extend(d.getOffset(l,this._getLineHeight(h-j)-1));d.destroy();b.select||e.collapse();b=Math.max(0,g.y-j*m);this._setSelection(e,!0,!0,function(){c._columnX=l},b-g.y)}return!0},_doPaste:function(b){var c=this;return this._getClipboardText(b,function(b){b&&(a.isLinux&&c._lastMouseButton===2&&(new Date).getTime()-c._lastMouseTime<=
c._clickTime&&c._setSelectionTo(c._lastMouseX,c._lastMouseY),c._doContent(b))})!==null},_doScroll:function(a){var b=a.type,c=this._model,d=c.getLineCount(),a=this._getClientHeight(),e=this._getLineHeight();d*=e;var f=this._getScroll().y,h;switch(b){case "textStart":h=0;break;case "textEnd":h=d-a;break;case "pageDown":h=f+a;break;case "pageUp":h=f-a;break;case "lineDown":h=f+e;break;case "lineUp":h=f-e;break;case "centerLine":b=this._getSelection(),h=c.getLineAtOffset(b.start),c=(c.getLineAtOffset(b.end)-
h+1)*e,h=h*e-a/2+c/2}h!==void 0&&(h=Math.min(Math.max(0,h),d-a),this._scrollViewAnimated(0,h-f,function(){}));return!0},_doSelectAll:function(){var a=this._model,b=this._getSelection();b.setCaret(0);b.extend(a.getCharCount());this._setSelection(b,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var a="\t";if(this._expandTab)var b=this._model,a=this._getSelection().getCaret(),c=b.getLineAtOffset(a),b=b.getLineStart(c),a=Array(this._tabSize-(a-b)%this._tabSize+1).join(" ");this._doContent(a);
return!0}},_doShiftTab:function(){return!this._tabMode||this._readonly?void 0:!0},_doOverwriteMode:function(){if(!this._readonly)return this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),!0},_doTabMode:function(){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(){this.setOptions({wrapMode:!this.getOptions("wrapMode")});return!0},_autoScroll:function(){var b=this._model,c=this._getSelection(),d=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),e=c.getCaret(),
f=b.getLineCount(),h=b.getLineAtOffset(e),g;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")e=this._autoScrollY/this._getLineHeight(),e=e<0?Math.floor(e):Math.ceil(e),g=Math.max(0,Math.min(f-1,h+e));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")g=this._getLineIndex(d.y),h=this._getLine(h),d.x+=h.getBoundingClientRect(e,!1).left,h.destroy();g===0&&(a.isMac||a.isLinux)?c.extend(0):g===f-1&&(a.isMac||a.isLinux)?c.extend(b.getCharCount()):(h=this._getLine(g),c.extend(h.getOffset(d.x,
d.y-this._getLinePixel(g))),h.destroy());this._setSelection(c,!0)},_autoScrollTimer:function(){this._autoScroll();var a=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){a._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(a){if(this._lineHeight&&!this._calculateLHTimer){var b=this._model.getLineCount(),c=0;if(a){for(var a=0,d=(new Date).getTime(),e=0;c<b;)if(this._lineHeight[c]||(a++,e||(e=c),this._lineHeight[c]=this._calculateLineHeight(c)),c++,(new Date).getTime()-
d>100)break;this.redrawRulers(0,b);this._queueUpdate()}a=this._getWindow();if(c!==b){var f=this;this._calculateLHTimer=a.setTimeout(function(){f._calculateLHTimer=null;f._calculateLineHeightTimer(!0)},0)}else if(this._calculateLHTimer)a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0}},_calculateLineHeight:function(a){var a=this._getLine(a),b=a.getBoundingClientRect();a.destroy();return Math.max(1,b.bottom-b.top)},_calculateMetrics:function(){var b=this._clientDiv,c=b.ownerDocument,
d=a.createElement(c,"div");d.style.lineHeight="normal";var e={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(e);j(e.style,d);d.style.position="fixed";d.style.left="-1000px";var f=a.createElement(c,"span");f.appendChild(c.createTextNode(" "));d.appendChild(f);var h=a.createElement(c,"span");h.style.fontStyle="italic";h.appendChild(c.createTextNode(" "));d.appendChild(h);var g=a.createElement(c,"span");g.style.fontWeight="bold";g.appendChild(c.createTextNode(" "));
d.appendChild(g);e=a.createElement(c,"span");e.style.fontWeight="bold";e.style.fontStyle="italic";e.appendChild(c.createTextNode(" "));d.appendChild(e);b.appendChild(d);var l=d.getBoundingClientRect(),f=f.getBoundingClientRect(),h=h.getBoundingClientRect(),g=g.getBoundingClientRect(),e=e.getBoundingClientRect(),f=f.bottom-f.top,h=h.bottom-h.top,g=g.bottom-g.top,i=e.bottom-e.top,k=0,e=l.bottom-l.top<=0,l=Math.max(1,l.bottom-l.top);h>f&&(k=1);g>h&&(k=2);i>g&&(k=3);var q;if(k!==0){q={style:{}};if((k&
1)!==0)q.style.fontStyle="italic";if((k&2)!==0)q.style.fontWeight="bold"}f=m(d);b.removeChild(d);h=n(this._viewDiv);d=a.createElement(c,"div");d.style.position="fixed";d.style.left="-1000px";d.style.paddingLeft=h.left+"px";d.style.paddingTop=h.top+"px";d.style.paddingRight=h.right+"px";d.style.paddingBottom=h.bottom+"px";d.style.width="100px";d.style.height="100px";g=a.createElement(c,"div");g.style.width="100%";g.style.height="100%";d.appendChild(g);b.appendChild(d);c=d.getBoundingClientRect();h=
g.getBoundingClientRect();d.style.overflow="hidden";g.style.height="200px";g=d.clientWidth;d.style.overflow="scroll";i=d.clientWidth;b.removeChild(d);h={left:h.left-c.left,top:h.top-c.top,right:c.right-h.right,bottom:c.bottom-h.bottom};return{lineHeight:l,largestFontStyle:q,lineTrim:f,viewPadding:h,scrollWidth:g-i,invalid:e}},_cancelAnimation:function(){if(this._animation)this._animation.stop(),this._animation=null},_clearSelection:function(a){var b=this._getSelection();if(b.isEmpty())return!1;a===
"next"?b.start=b.end:b.end=b.start;this._setSelection(b,!0);return!0},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var a=this._model,b=a.getLineAtOffset(this._imeOffset),c=a.getLineStart(b),d=this._getDOMText(this._getLineNode(b)).text,a=a.getLine(b),c=this._imeOffset-c,a=c+d.length-a.length;c!==a&&this._doContent(d.substring(c,a));this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new i.DefaultKeyMode(this));var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},
lineUp:{defaultHandler:function(c){return a._doLineUp(b(c,{select:!1}))},actionDescription:{name:g.lineUp}},lineDown:{defaultHandler:function(c){return a._doLineDown(b(c,{select:!1}))},actionDescription:{name:g.lineDown}},lineStart:{defaultHandler:function(c){return a._doHome(b(c,{select:!1,ctrl:!1}))},actionDescription:{name:g.lineStart}},lineEnd:{defaultHandler:function(c){return a._doEnd(b(c,{select:!1,ctrl:!1}))},actionDescription:{name:g.lineEnd}},charPrevious:{defaultHandler:function(c){return a._doCursorPrevious(b(c,
{select:!1,unit:"character"}))},actionDescription:{name:g.charPrevious}},charNext:{defaultHandler:function(c){return a._doCursorNext(b(c,{select:!1,unit:"character"}))},actionDescription:{name:g.charNext}},pageUp:{defaultHandler:function(c){return a._doPageUp(b(c,{select:!1}))},actionDescription:{name:g.pageUp}},pageDown:{defaultHandler:function(c){return a._doPageDown(b(c,{select:!1}))},actionDescription:{name:g.pageDown}},scrollPageUp:{defaultHandler:function(c){return a._doScroll(b(c,{type:"pageUp"}))},
actionDescription:{name:g.scrollPageUp}},scrollPageDown:{defaultHandler:function(c){return a._doScroll(b(c,{type:"pageDown"}))},actionDescription:{name:g.scrollPageDown}},scrollLineUp:{defaultHandler:function(c){return a._doScroll(b(c,{type:"lineUp"}))},actionDescription:{name:g.scrollLineUp}},scrollLineDown:{defaultHandler:function(c){return a._doScroll(b(c,{type:"lineDown"}))},actionDescription:{name:g.scrollLineDown}},wordPrevious:{defaultHandler:function(c){return a._doCursorPrevious(b(c,{select:!1,
unit:"word"}))},actionDescription:{name:g.wordPrevious}},wordNext:{defaultHandler:function(c){return a._doCursorNext(b(c,{select:!1,unit:"word"}))},actionDescription:{name:g.wordNext}},textStart:{defaultHandler:function(c){return a._doHome(b(c,{select:!1,ctrl:!0}))},actionDescription:{name:g.textStart}},textEnd:{defaultHandler:function(c){return a._doEnd(b(c,{select:!1,ctrl:!0}))},actionDescription:{name:g.textEnd}},scrollTextStart:{defaultHandler:function(c){return a._doScroll(b(c,{type:"textStart"}))},
actionDescription:{name:g.scrollTextStart}},scrollTextEnd:{defaultHandler:function(c){return a._doScroll(b(c,{type:"textEnd"}))},actionDescription:{name:g.scrollTextEnd}},centerLine:{defaultHandler:function(c){return a._doScroll(b(c,{type:"centerLine"}))},actionDescription:{name:g.centerLine}},selectLineUp:{defaultHandler:function(c){return a._doLineUp(b(c,{select:!0}))},actionDescription:{name:g.selectLineUp}},selectLineDown:{defaultHandler:function(c){return a._doLineDown(b(c,{select:!0}))},actionDescription:{name:g.selectLineDown}},
selectWholeLineUp:{defaultHandler:function(c){return a._doLineUp(b(c,{select:!0,wholeLine:!0}))},actionDescription:{name:g.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(c){return a._doLineDown(b(c,{select:!0,wholeLine:!0}))},actionDescription:{name:g.selectWholeLineDown}},selectLineStart:{defaultHandler:function(c){return a._doHome(b(c,{select:!0,ctrl:!1}))},actionDescription:{name:g.selectLineStart}},selectLineEnd:{defaultHandler:function(c){return a._doEnd(b(c,{select:!0,ctrl:!1}))},
actionDescription:{name:g.selectLineEnd}},selectCharPrevious:{defaultHandler:function(c){return a._doCursorPrevious(b(c,{select:!0,unit:"character"}))},actionDescription:{name:g.selectCharPrevious}},selectCharNext:{defaultHandler:function(c){return a._doCursorNext(b(c,{select:!0,unit:"character"}))},actionDescription:{name:g.selectCharNext}},selectPageUp:{defaultHandler:function(c){return a._doPageUp(b(c,{select:!0}))},actionDescription:{name:g.selectPageUp}},selectPageDown:{defaultHandler:function(c){return a._doPageDown(b(c,
{select:!0}))},actionDescription:{name:g.selectPageDown}},selectWordPrevious:{defaultHandler:function(c){return a._doCursorPrevious(b(c,{select:!0,unit:"word"}))},actionDescription:{name:g.selectWordPrevious}},selectWordNext:{defaultHandler:function(c){return a._doCursorNext(b(c,{select:!0,unit:"word"}))},actionDescription:{name:g.selectWordNext}},selectTextStart:{defaultHandler:function(c){return a._doHome(b(c,{select:!0,ctrl:!0}))},actionDescription:{name:g.selectTextStart}},selectTextEnd:{defaultHandler:function(c){return a._doEnd(b(c,
{select:!0,ctrl:!0}))},actionDescription:{name:g.selectTextEnd}},deletePrevious:{defaultHandler:function(c){return a._doBackspace(b(c,{unit:"character"}))},actionDescription:{name:g.deletePrevious}},deleteNext:{defaultHandler:function(c){return a._doDelete(b(c,{unit:"character"}))},actionDescription:{name:g.deleteNext}},deleteWordPrevious:{defaultHandler:function(c){return a._doBackspace(b(c,{unit:"word"}))},actionDescription:{name:g.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(c){return a._doDelete(b(c,
{unit:"word"}))},actionDescription:{name:g.deleteWordNext}},deleteLineStart:{defaultHandler:function(c){return a._doBackspace(b(c,{unit:"line"}))},actionDescription:{name:g.deleteLineStart}},deleteLineEnd:{defaultHandler:function(c){return a._doDelete(b(c,{unit:"line"}))},actionDescription:{name:g.deleteLineEnd}},tab:{defaultHandler:function(){return a._doTab()},actionDescription:{name:g.tab}},shiftTab:{defaultHandler:function(){return a._doShiftTab()},actionDescription:{name:g.shiftTab}},enter:{defaultHandler:function(){return a._doEnter()},
actionDescription:{name:g.enter}},enterNoCursor:{defaultHandler:function(c){return a._doEnter(b(c,{noCursor:!0}))},actionDescription:{name:g.enterNoCursor}},selectAll:{defaultHandler:function(){return a._doSelectAll()},actionDescription:{name:g.selectAll}},copy:{defaultHandler:function(){return a._doCopy()},actionDescription:{name:g.copy}},cut:{defaultHandler:function(){return a._doCut()},actionDescription:{name:g.cut}},paste:{defaultHandler:function(){return a._doPaste()},actionDescription:{name:g.paste}},
uppercase:{defaultHandler:function(c){return a._doCase(b(c,{type:"upper"}))},actionDescription:{name:g.uppercase}},lowercase:{defaultHandler:function(c){return a._doCase(b(c,{type:"lower"}))},actionDescription:{name:g.lowercase}},capitalize:{defaultHandler:function(c){return a._doCase(b(c,{unit:"word",type:"capitalize"}))},actionDescription:{name:g.capitalize}},reversecase:{defaultHandler:function(c){return a._doCase(b(c,{type:"reverse"}))},actionDescription:{name:g.reversecase}},toggleOverwriteMode:{defaultHandler:function(){return a._doOverwriteMode()},
actionDescription:{name:g.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(){return a._doTabMode()},actionDescription:{name:g.toggleTabMode}},toggleWrapMode:{defaultHandler:function(){return a._doWrapMode()},actionDescription:{name:g.toggleWrapMode}}}},_createRuler:function(b,c){if(this._clientDiv){var d=b.getLocation()==="left"?this._leftDiv:this._rightDiv;d.style.display="block";var e=a.createElement(d.ownerDocument,"div");e._ruler=b;e.rulerChanged=!0;e.style.position="relative";e.style.cssFloat=
"left";e.style.styleFloat="left";e.style.borderWidth="0px";e.style.margin="0px";e.style.padding="0px";e.style.outline="none";if(c===void 0||c<0||c>=d.children.length)d.appendChild(e);else{for(var f=d.firstChild;f&&--c>0;)f=f.nextSibling;d.insertBefore(e,f)}}},_createView:function(){if(!this._clientDiv){for(var b=this._parent;b.hasChildNodes();)b.removeChild(b.lastChild);var c=b.ownerDocument,d=a.createElement(c,"div");this._rootDiv=d;d.tabIndex=-1;d.style.position="relative";d.style.overflow="hidden";
d.style.width="100%";d.style.height="100%";d.style.overflow="hidden";d.style.WebkitTextSizeAdjust="100%";d.setAttribute("role","application");b.appendChild(d);b=a.createElement(c,"div");b.className="textviewLeftRuler";this._leftDiv=b;b.tabIndex=-1;b.style.overflow="hidden";b.style.MozUserSelect="none";b.style.WebkitUserSelect="none";b.style.position="absolute";b.style.top="0px";b.style.bottom="0px";b.style.cursor="default";b.style.display="none";b.setAttribute("aria-hidden","true");d.appendChild(b);
b=a.createElement(c,"div");b.className="textviewScroll";this._viewDiv=b;b.tabIndex=-1;b.style.overflow="auto";b.style.position="absolute";b.style.top="0px";b.style.bottom="0px";b.style.borderWidth="0px";b.style.margin="0px";b.style.outline="none";b.style.background="transparent";if(a.isMac&&a.isWebkit)b.style.pointerEvents="none",b.style.zIndex="2";d.appendChild(b);var e=a.createElement(c,"div");e.className="textviewRightRuler";this._rightDiv=e;e.tabIndex=-1;e.style.display="none";e.style.overflow=
"hidden";e.style.MozUserSelect="none";e.style.WebkitUserSelect="none";e.style.position="absolute";e.style.top="0px";e.style.bottom="0px";e.style.cursor="default";e.style.right="0px";e.setAttribute("aria-hidden","true");d.appendChild(e);this._scrollDiv=e=a.createElement(c,"div");e.style.margin="0px";e.style.borderWidth="0px";e.style.padding="0px";b.appendChild(e);if(a.isFirefox)this._clipboardDiv=b=a.createElement(c,"div"),b.style.position="fixed",b.style.whiteSpace="pre",b.style.left="-1000px",d.appendChild(b);
if(!a.isIE&&!a.isIOS)this._clipDiv=b=a.createElement(c,"div"),b.style.position="absolute",b.style.overflow="hidden",b.style.margin="0px",b.style.borderWidth="0px",b.style.padding="0px",b.style.background="transparent",d.appendChild(b),this._clipScrollDiv=e=a.createElement(c,"div"),e.style.position="absolute",e.style.height="1px",e.style.top="-1000px",e.style.background="transparent",b.appendChild(e);this._setFullSelection(this._fullSelection,!0);b=a.createElement(c,"div");b.className="textviewContent";
this._clientDiv=b;b.style.position="absolute";b.style.borderWidth="0px";b.style.margin="0px";b.style.padding="0px";b.style.outline="none";b.style.zIndex="1";b.style.WebkitUserSelect="text";b.setAttribute("spellcheck","false");if(a.isIOS||a.isAndroid)b.style.WebkitTapHighlightColor="transparent";(this._clipDiv||d).appendChild(b);if(a.isIOS||a.isAndroid)this._vScrollDiv=e=a.createElement(c,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle="solid",
e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",e.style.outline="none",e.style.zIndex="3",e.style.width="8px",e.style.display="none",d.appendChild(e),this._hScrollDiv=e=a.createElement(c,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle="solid",e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",
e.style.outline="none",e.style.zIndex="3",e.style.height="8px",e.style.display="none",d.appendChild(e);if(a.isFirefox&&!b.setCapture)this._overlayDiv=c=a.createElement(c,"div"),c.style.position=b.style.position,c.style.borderWidth=b.style.borderWidth,c.style.margin=b.style.margin,c.style.padding=b.style.padding,c.style.cursor="text",c.style.zIndex="2",(this._clipDiv||d).appendChild(c);b.contentEditable="true";b.setAttribute("role","textbox");b.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,
!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);this._hookEvents();d=this._rulers;for(c=0;c<d.length;c++)this._createRuler(d[c]);this._update()}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,update:this.setModel},scrollAnimation:{value:0,update:null},readonly:{value:!1,update:this._setReadOnly},fullSelection:{value:!0,update:this._setFullSelection},tabMode:{value:!0,update:null},tabSize:{value:8,
update:this._setTabSize},expandTab:{value:!1,update:null},overwriteMode:{value:!1,update:this._setOverwriteMode},blockCursorVisible:{value:!1,update:this._setBlockCursor},wrapMode:{value:!1,update:this._setWrapMode},wrappable:{value:!1,update:null},theme:{value:d.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var b=a.getLocation()==="left"?this._leftDiv:this._rightDiv;if(b)for(var c=b.firstChild;c;){if(c._ruler===a){c._ruler=
void 0;b.removeChild(c);if(b.children.length===0)b.style.display="none";break}c=c.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();var a=this._getWindow();if(this._autoScrollTimerID)a.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null;if(this._updateTimer)a.clearTimeout(this._updateTimer),this._updateTimer=null;a=this._rootDiv;a.parentNode.removeChild(a);this._hScrollDiv=this._vScrollDiv=this._rightDiv=this._leftDiv=this._overlayDiv=
this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(a,b,c){this._autoScrollDir=a;this._autoScrollX=b;this._autoScrollY=c;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var a=this._clientDiv;
if(a){var b=this._hasFocus;this._ignoreFocus=!0;b&&a.blur();a.contentEditable=!1;a.contentEditable=!0;b&&a.focus();this._ignoreFocus=!1}},_getBaseText:function(a,b){var c=this._model;c.getBaseModel&&(a=c.mapOffset(a),b=c.mapOffset(b),c=c.getBaseModel());return c.getText(a,b)},_getBottomIndex:function(a){var b=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=b.getBoundingClientRect(),c=this._clientDiv.getBoundingClientRect();a.bottom>c.bottom&&(b=this._getLinePrevious(b)||
b)}return b.lineIndex},_getBoundsAtOffset:function(a){var b=this._getLine(this._model.getLineAtOffset(a)),a=b.getBoundingClientRect(a),c=this._getLinePixel(b.lineIndex);a.top+=c;a.bottom+=c;b.destroy();return a},_getClientHeight:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-a.top-a.bottom)},_getClientWidth:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-a.left-a.right)},_getClipboardText:function(b,c){var d=this._model.getLineDelimiter(),
e,f,h=this._getWindow();if(h.clipboardData)return e=[],f=h.clipboardData.getData("Text"),l(f,function(a){e.push(a)},function(){e.push(d)}),f=e.join(""),c&&c(f),f;if(a.isFirefox){this._ignoreFocus=!0;var g=this._clipboardDiv;g.innerHTML="<pre contenteditable=''></pre>";g.firstChild.focus();var j=this,m=function(){var a=j._getTextFromElement(g);g.innerHTML="";e=[];l(a,function(a){e.push(a)},function(){e.push(d)});return e.join("")},n=!1;this._ignorePaste=!0;if(!a.isLinux||this._lastMouseButton!==2)try{n=
g.ownerDocument.execCommand("paste",!1,null)}catch(i){n=g.childNodes.length>1||g.firstChild&&g.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!n)return b?(h.setTimeout(function(){j.focus();(f=m())&&c&&c(f);j._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(f=m())&&c&&c(f);return f}return b&&b.clipboardData?(e=[],f=b.clipboardData.getData("text/plain"),l(f,function(a){e.push(a)},function(){e.push(d)}),(f=e.join(""))&&c&&c(f),f):""},_getDOMText:function(a,
b){for(var c=a.firstChild,d="",e=0;c;){var f;if(!c.ignore)if(c.ignoreChars){f=c.lastChild;for(var h=0,g=[],j=-1;f;){for(var l=f.data,m=l.length-1;m>=0;m--){var n=l.substring(m,m+1);h<c.ignoreChars&&(n===" "||n==="\u200c"||n==="\ufeff")?h++:g.push(n==="\u00a0"?"\t":n)}if(b===f)j=g.length;f=f.previousSibling}g=g.reverse().join("");j!==-1&&(e=d.length+g.length-j);d+=g}else for(f=c.firstChild;f;){if(b===f)e=d.length;d+=f.data;f=f.nextSibling}c=c.nextSibling}return{text:d,offset:e}},_getTextFromElement:function(a){var b=
a.ownerDocument,c=b.defaultView;if(!c.getSelection)return a.innerText||a.textContent;b=b.createRange();b.selectNode(a);var a=c.getSelection(),c=[],d;for(d=0;d<a.rangeCount;d++)c.push(a.getRangeAt(d));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(b);b=a.toString();a.removeAllRanges();for(d=0;d<c.length;d++)a.addRange(c[d]);this._ignoreSelect=!1;return b},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var b=this._getLineNode(a);return b&&!b.lineChanged&&!b.lineRemoved?
b._line:new q(this,a)},_getLineHeight:function(a,b){if(a!==void 0&&this._lineHeight){var c=this._lineHeight[a];if(c)return c;if(b||b===void 0)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var b=this._clientDiv.firstChild;b;){if(a===b.lineIndex)return b;b=b.nextSibling}},_getLineNext:function(a){for(a=a?a.nextSibling:this._clientDiv.firstChild;a&&a.lineIndex===-1;)a=a.nextSibling;return a},_getLinePrevious:function(a){for(a=a?
a.previousSibling:this._clientDiv.lastChild;a&&a.lineIndex===-1;)a=a.previousSibling;return a},_getLinePixel:function(a){a=Math.min(Math.max(0,a),this._model.getLineCount());if(this._lineHeight){var b=this._getTopIndex(),c=-this._topIndexY+this._getScroll().y;if(a>b)for(;b<a;b++)c+=this._getLineHeight(b);else for(b-=1;b>=a;b--)c-=this._getLineHeight(b);return c}return this._getLineHeight()*a},_getLineIndex:function(a){var b,c=0,d=this._model.getLineCount();if(this._lineHeight){var c=this._getTopIndex(),
e=-this._topIndexY+this._getScroll().y;if(a!==e)if(a<e)for(;a<e&&c>0;)a+=this._getLineHeight(--c);else for(b=this._getLineHeight(c);a-b>=e&&c<d-1;)a-=b,b=this._getLineHeight(++c)}else b=this._getLineHeight(),c=Math.floor(a/b);return Math.max(0,Math.min(d-1,c))},_getScroll:function(a){(a===void 0||a)&&this._cancelAnimation();a=this._viewDiv;return{x:a.scrollLeft,y:a.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(a){var b=this._topChild;if(a&&this._getClientHeight()>
this._getLineHeight()){var a=b.getBoundingClientRect(),c=this._getViewPadding(),d=this._viewDiv.getBoundingClientRect();a.top<d.top+c.top&&(b=this._getLineNext(b)||b)}return b.lineIndex},_hookEvents:function(){var b=this;this._modelListener={onChanging:function(a){b._onModelChanging(a)},onChanged:function(a){b._onModelChanged(a)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._themeListener=
{onChanged:function(){b._setThemeClass(b._themeClass)}};this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);var c=this._handlers=[],d=this._clientDiv,f=this._viewDiv,h=this._rootDiv,g=this._overlayDiv||d,j=d.ownerDocument,l=this._getWindow(),m=a.isIE?j:l;c.push({target:l,type:"resize",handler:function(a){return b._handleResize(a?a:l.event)}});c.push({target:d,type:"blur",handler:function(a){return b._handleBlur(a?a:l.event)}});c.push({target:d,type:"focus",handler:function(a){return b._handleFocus(a?
a:l.event)}});c.push({target:f,type:"focus",handler:function(){d.focus()}});c.push({target:f,type:"scroll",handler:function(a){return b._handleScroll(a?a:l.event)}});c.push({target:d,type:"textInput",handler:function(a){return b._handleTextInput(a?a:l.event)}});c.push({target:d,type:"keydown",handler:function(a){return b._handleKeyDown(a?a:l.event)}});c.push({target:d,type:"keypress",handler:function(a){return b._handleKeyPress(a?a:l.event)}});c.push({target:d,type:"keyup",handler:function(a){return b._handleKeyUp(a?
a:l.event)}});c.push({target:d,type:"contextmenu",handler:function(a){return b._handleContextMenu(a?a:l.event)}});c.push({target:d,type:"copy",handler:function(a){return b._handleCopy(a?a:l.event)}});c.push({target:d,type:"cut",handler:function(a){return b._handleCut(a?a:l.event)}});c.push({target:d,type:"paste",handler:function(a){return b._handlePaste(a?a:l.event)}});if(a.isIOS||a.isAndroid)c.push({target:j,type:"selectionchange",handler:function(a){return b._handleSelectionChange(a?a:l.event)}}),
c.push({target:d,type:"touchstart",handler:function(a){return b._handleTouchStart(a?a:l.event)}}),c.push({target:d,type:"touchmove",handler:function(a){return b._handleTouchMove(a?a:l.event)}}),c.push({target:d,type:"touchend",handler:function(a){return b._handleTouchEnd(a?a:l.event)}});else{c.push({target:d,type:"selectstart",handler:function(a){return b._handleSelectStart(a?a:l.event)}});c.push({target:d,type:"mousedown",handler:function(a){return b._handleMouseDown(a?a:l.event)}});c.push({target:d,
type:"mouseover",handler:function(a){return b._handleMouseOver(a?a:l.event)}});c.push({target:d,type:"mouseout",handler:function(a){return b._handleMouseOut(a?a:l.event)}});c.push({target:m,type:"mouseup",handler:function(a){return b._handleMouseUp(a?a:l.event)}});c.push({target:m,type:"mousemove",handler:function(a){return b._handleMouseMove(a?a:l.event)}});c.push({target:h,type:"mousedown",handler:function(a){return b._handleRootMouseDown(a?a:l.event)}});c.push({target:h,type:"mouseup",handler:function(a){return b._handleRootMouseUp(a?
a:l.event)}});c.push({target:g,type:"dragstart",handler:function(a){return b._handleDragStart(a?a:l.event)}});c.push({target:g,type:"drag",handler:function(a){return b._handleDrag(a?a:l.event)}});c.push({target:g,type:"dragend",handler:function(a){return b._handleDragEnd(a?a:l.event)}});c.push({target:g,type:"dragenter",handler:function(a){return b._handleDragEnter(a?a:l.event)}});c.push({target:g,type:"dragover",handler:function(a){return b._handleDragOver(a?a:l.event)}});c.push({target:g,type:"dragleave",
handler:function(a){return b._handleDragLeave(a?a:l.event)}});c.push({target:g,type:"drop",handler:function(a){return b._handleDrop(a?a:l.event)}});c.push({target:this._clientDiv,type:a.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return b._handleMouseWheel(a?a:l.event)}});if(a.isFirefox&&(!a.isWindows||a.isFirefox>=15))(f=l.MutationObserver||l.MozMutationObserver)?(this._mutationObserver=new f(function(a){b._handleDataModified(a)}),this._mutationObserver.observe(d,{subtree:!0,characterData:!0})):
c.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(a){return b._handleDataModified(a?a:l.event)}});this._overlayDiv&&(c.push({target:this._overlayDiv,type:"mousedown",handler:function(a){return b._handleMouseDown(a?a:l.event)}}),c.push({target:this._overlayDiv,type:"mouseover",handler:function(a){return b._handleMouseOver(a?a:l.event)}}),c.push({target:this._overlayDiv,type:"mouseout",handler:function(a){return b._handleMouseOut(a?a:l.event)}}),c.push({target:this._overlayDiv,
type:"contextmenu",handler:function(a){return b._handleContextMenu(a?a:l.event)}}));this._isW3CEvents||c.push({target:this._clientDiv,type:"dblclick",handler:function(a){return b._handleDblclick(a?a:l.event)}})}f=this._leftDiv;h=this._rightDiv;a.isIE&&c.push({target:f,type:"selectstart",handler:function(){return!1}});c.push({target:f,type:a.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return b._handleMouseWheel(a?a:l.event)}});c.push({target:f,type:"click",handler:function(a){b._handleRulerEvent(a?
a:l.event)}});c.push({target:f,type:"dblclick",handler:function(a){b._handleRulerEvent(a?a:l.event)}});c.push({target:f,type:"mousemove",handler:function(a){b._handleRulerEvent(a?a:l.event)}});c.push({target:f,type:"mouseover",handler:function(a){b._handleRulerEvent(a?a:l.event)}});c.push({target:f,type:"mouseout",handler:function(a){b._handleRulerEvent(a?a:l.event)}});a.isIE&&c.push({target:h,type:"selectstart",handler:function(){return!1}});c.push({target:h,type:a.isFirefox?"DOMMouseScroll":"mousewheel",
handler:function(a){return b._handleMouseWheel(a?a:l.event)}});c.push({target:h,type:"click",handler:function(a){b._handleRulerEvent(a?a:l.event)}});c.push({target:h,type:"dblclick",handler:function(a){b._handleRulerEvent(a?a:l.event)}});c.push({target:h,type:"mousemove",handler:function(a){b._handleRulerEvent(a?a:l.event)}});c.push({target:h,type:"mouseover",handler:function(a){b._handleRulerEvent(a?a:l.event)}});c.push({target:h,type:"mouseout",handler:function(a){b._handleRulerEvent(a?a:l.event)}});
for(f=0;f<c.length;f++)h=c[f],e(h.target,h.type,h.handler,h.capture)},_getWindow:function(){return this._parent.ownerDocument.defaultView||this._parent.ownerDocument.parentWindow},_ignoreEvent:function(a){for(a=a.target;a&&a!==this._clientDiv;){if(a.ignore)return!0;a=a.parentNode}return!1},_init:function(b){var c=b.parent;typeof c==="string"&&(c=(b.document||document).getElementById(c));if(!c)throw"no parent";b.parent=c;b.model=b.model||new k.TextModel;var d=this._defaultOptions(),e;for(e in d)d.hasOwnProperty(e)&&
(this["_"+e]=b[e]!==void 0?b[e]:d[e].value);this._keyModes=[];this._rulers=[];this._selection=new s(0,0,!1);this._linksVisible=!1;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=!0;this._hasFocus=this._ignoreFocus=!1;this._dragOffset=this._columnX=-1;this._isRangeRects=(!a.isIE||a.isIE>=9)&&typeof c.ownerDocument.createRange().getBoundingClientRect==="function";this._isW3CEvents=c.addEventListener;this._autoScrollTimerID=this._autoScrollY=this._autoScrollX=null;this._AUTO_SCROLL_RATE=
50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createView()},_modifyContent:function(a,b){if(!this._readonly||a._code)if(a.type="Verify",this.onVerify(a),!(a.text===null||a.text===void 0)){var c=this._model;try{if(a._ignoreDOMSelection)this._ignoreDOMSelection=
!0;c.setText(a.text,a.start,a.end)}finally{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!1}b&&(c=this._getSelection(),c.setCaret(a.start+a.text.length),this._setSelection(c,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(a){a.type="ModelChanged";this.onModelChanged(a);a.type="Changed";var b=a.start,c=a.addedCharCount,d=a.removedCharCount,e=a.addedLineCount,f=a.removedLineCount,h=this._getSelection();h.end>b&&(h.end>b&&h.start<b+d?h.setCaret(b+c):(h.start+=c-d,h.end+=c-d),this._setSelection(h,
!1,!1));b=this._model.getLineAtOffset(b);for(c=this._getLineNext();c;){d=c.lineIndex;if(b<=d&&d<=b+f)b===d&&!c.modelChangedEvent&&!c.lineRemoved?(c.modelChangedEvent=a,c.lineChanged=!0):(c.lineRemoved=!0,c.lineChanged=!1,c.modelChangedEvent=null);if(d>b+f)c.lineIndex=d+e-f,c._line.lineIndex=c.lineIndex;c=this._getLineNext(c)}this._lineHeight&&(a=[b,f].concat(Array(e)),Array.prototype.splice.apply(this._lineHeight,a));if(!this._wrapMode&&b<=this._maxLineIndex&&this._maxLineIndex<=b+f)this._checkMaxLineIndex=
this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._update()},_onModelChanging:function(a){a.type="ModelChanging";this.onModelChanging(a);a.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var a=this;this._updateTimer=this._getWindow().setTimeout(function(){a._updateTimer=null;a._update()},0)}},_resetLineHeight:function(a,b){if(this._wrapMode||this._variableLineHeight){if(a!==void 0&&b!==void 0)for(var c=a;c<b;c++)this._lineHeight[c]=void 0;
else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=null},_resetLineWidth:function(){var a=this._clientDiv;if(a)for(a=a.firstChild;a;)a.lineWidth=void 0,a=a.nextSibling},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._variableLineHeight=!1;this._resetLineHeight();this._setSelection(new s(0,0,!1),!1,!1);if(this._viewDiv)this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=
0;var b=this._clientDiv;if(b){for(var c=b.firstChild;c;)c.lineRemoved=!0,c=c.nextSibling;if(a.isFirefox)this._ignoreFocus=!1,(c=this._hasFocus)&&b.blur(),b.contentEditable=!1,b.contentEditable=!0,c&&b.focus(),this._ignoreFocus=!1}},_scrollViewAnimated:function(a,b,c){if(c&&this._scrollAnimation){var d=this;this._animation=new t({window:this._getWindow(),duration:this._scrollAnimation,curve:[b,0],onAnimate:function(a){a=b-Math.floor(a);d._scrollView(0,a);b-=a},onEnd:function(){d._animation=null;d._scrollView(a,
b);c&&c()}});this._animation.play()}else this._scrollView(a,b),c&&c()},_scrollView:function(a,b){this._ensureCaretVisible=!1;var c=this._viewDiv;a&&(c.scrollLeft+=a);b&&(c.scrollTop+=b)},_setClipboardText:function(b,c){var d,e=this._parent.ownerDocument,f=this._getWindow();if(f.clipboardData)return d=[],l(b,function(a){d.push(a)},function(){d.push(a.platformDelimiter)}),f.clipboardData.setData("Text",d.join(""));if(c&&c.clipboardData&&(d=[],l(b,function(a){d.push(a)},function(){d.push(a.platformDelimiter)}),
c.clipboardData.setData("text/plain",d.join(""))))return!0;var h=a.createElement(e,"pre");h.style.position="fixed";h.style.left="-1000px";l(b,function(a){h.appendChild(e.createTextNode(a))},function(){h.appendChild(a.createElement(e,"br"))});h.appendChild(e.createTextNode(" "));this._clientDiv.appendChild(h);var g=e.createRange();g.setStart(h.firstChild,0);g.setEndBefore(h.lastChild);var j=f.getSelection();j.rangeCount>0&&j.removeAllRanges();j.addRange(g);var m=this,g=function(){h&&h.parentNode===
m._clientDiv&&m._clientDiv.removeChild(h);m._updateDOMSelection()},j=!1;this._ignoreCopy=!0;try{j=e.execCommand("copy",!1,null)}catch(n){}this._ignoreCopy=!1;if(!j&&c)return f.setTimeout(g,0),!1;g();return!0},_setDOMSelection:function(b,c,d,e,f){for(var h,g,j,l,m=0,n=b.firstChild,i,k,q=this._model.getLine(b.lineIndex).length;n;){if(!n.ignore){i=n.firstChild;k=i.length;n.ignoreChars&&(k-=n.ignoreChars);if(m+k>c||m+k>=q){h=i;g=c-m;n.ignoreChars&&k>0&&g===k&&(g+=n.ignoreChars);break}m+=k}n=n.nextSibling}for(var m=
0,n=d.firstChild,r=this._model.getLine(d.lineIndex).length;n;){if(!n.ignore){i=n.firstChild;k=i.length;n.ignoreChars&&(k-=n.ignoreChars);if(k+m>e||m+k>=r){j=i;l=e-m;n.ignoreChars&&k>0&&l===k&&(l+=n.ignoreChars);break}m+=k}n=n.nextSibling}this._setDOMFullSelection(b,c,q,d,e,r);b=this._getWindow();c=this._parent.ownerDocument;if(b.getSelection){d=b.getSelection();b=c.createRange();b.setStart(h,g);b.setEnd(j,l);if(this._hasFocus&&(d.anchorNode!==h||d.anchorOffset!==g||d.focusNode!==j||d.focusOffset!==
l||d.anchorNode!==j||d.anchorOffset!==l||d.focusNode!==h||d.focusOffset!==g))this._ignoreSelect=!1,d.rangeCount>0&&d.removeAllRanges(),d.addRange(b),this._ignoreSelect=!0;if(this._cursorDiv&&(b=c.createRange(),f?(b.setStart(h,g),b.setEnd(h,g)):(b.setStart(j,l),b.setEnd(j,l)),j=b.getClientRects()[0],l=this._cursorDiv.parentNode,h=l.getBoundingClientRect(),j&&h))this._cursorDiv.style.top=j.top-h.top+l.scrollTop+"px",this._cursorDiv.style.left=j.left-h.left+l.scrollLeft+"px"}else if(c.selection&&this._hasFocus)f=
c.body,b=a.createElement(c,"div"),f.appendChild(b),f.removeChild(b),b=f.createTextRange(),b.moveToElementText(h.parentNode),b.moveStart("character",g),h=f.createTextRange(),h.moveToElementText(j.parentNode),h.moveStart("character",l),b.setEndPoint("EndToStart",h),this._ignoreSelect=!1,b.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(a,b,c,d,e){if(this._selDiv1&&(c=this._selDiv1,c.style.width="0px",c.style.height="0px",c=this._selDiv2,c.style.width="0px",c.style.height="0px",c=this._selDiv3,
c.style.width="0px",c.style.height="0px",!(a===d&&b===e))){var f=this._model,h=this._getViewPadding(),g=this._clientDiv.getBoundingClientRect(),j=this._viewDiv.getBoundingClientRect(),c=j.left+h.left,l=g.right,h=j.top+h.top,m=g.bottom,j=g=0;this._clipDiv?(j=this._clipDiv.getBoundingClientRect(),g=j.left-this._clipDiv.scrollLeft):(j=this._rootDiv.getBoundingClientRect(),g=j.left);j=j.top;this._ignoreDOMSelection=!0;var a=(new q(this,a.lineIndex,a)).getBoundingClientRect(f.getLineStart(a.lineIndex)+
b,!1),n=a.left,e=(new q(this,d.lineIndex,d)).getBoundingClientRect(f.getLineStart(d.lineIndex)+e,!1),b=e.left;this._ignoreDOMSelection=!1;var f=this._selDiv1,n=Math.min(l,Math.max(c,n)),i=Math.min(m,Math.max(h,a.top)),k=l,d=Math.min(m,Math.max(h,a.bottom));f.style.left=n-g+"px";f.style.top=i-j+"px";f.style.width=Math.max(0,k-n)+"px";f.style.height=Math.max(0,d-i)+"px";if(a.top===e.top)k=Math.min(b,l),f.style.width=Math.max(0,k-n)+"px";else if(a=Math.min(m,Math.max(h,e.top)),b=Math.min(l,Math.max(c,
b)),h=Math.min(m,Math.max(h,e.bottom)),m=this._selDiv3,m.style.left=c-g+"px",m.style.top=a-j+"px",m.style.width=Math.max(0,b-c)+"px",m.style.height=Math.max(0,h-a)+"px",a-d>0)h=this._selDiv2,h.style.left=c-g+"px",h.style.top=d-j+"px",h.style.width=Math.max(0,l-c)+"px",h.style.height=Math.max(0,a-d)+"px"}},_setGrab:function(a){if(a!==this._grabControl)a?(a.setCapture&&a.setCapture(),this._grabControl=a):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null)},
_setLinksVisible:function(b){if(this._linksVisible!==b){this._linksVisible=b;if(a.isIE&&b)this._hadFocus=this._hasFocus;var c=this._clientDiv;c.contentEditable=!b;this._hadFocus&&!b&&c.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=b?"-1":"1";for(b=this._getLineNext();b;){if(b.hasLink)for(c=b.firstChild;c;)if(c.ignore)c=c.nextSibling;else{var d=c.nextSibling,e=c.viewStyle;e&&e.tagName&&e.tagName.toLowerCase()==="a"&&b.replaceChild(b._line._createSpan(b,c.firstChild.data,e),c);c=d}b=this._getLineNext(b)}this._updateDOMSelection()}},
_setSelection:function(a,b,c,d,e){if(a){this._columnX=-1;c===void 0&&(c=!0);var f=this._selection;this._selection=a;b!==!1&&this._showCaret(!1,d,b,e);c&&this._updateDOMSelection();if(!f.equals(a))this.onSelection({type:"Selection",oldValue:{start:f.start,end:f.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,b,c,d){var e=this._model,f=this._getSelection(),b=this.convert({x:a,y:b},"page","document"),a=this._getLineIndex(b.y);if(this._clickCount===1){e=this._getLine(a);a=e.getOffset(b.x,
b.y-this._getLinePixel(a));e.destroy();if(d&&!c&&f.start<=a&&a<f.end)return this._dragOffset=a,!1;f.extend(a);c||f.collapse()}else(this._clickCount&1)===0?(e=this._getLine(a),a=e.getOffset(b.x,b.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(c=this._doubleClickSelection.start,d=e.getNextOffset(a,{unit:"wordend",count:1})):(c=e.getNextOffset(a,{unit:"word",count:-1}),d=this._doubleClickSelection.end):(c=e.getNextOffset(a,{unit:"word",count:-1}),d=e.getNextOffset(c,
{unit:"wordend",count:1})),e.destroy()):this._doubleClickSelection?(d=e.getLineAtOffset(this._doubleClickSelection.start),a>=d?(c=e.getLineStart(d),d=e.getLineEnd(a)):(c=e.getLineStart(a),d=e.getLineEnd(d))):(c=e.getLineStart(a),d=e.getLineEnd(a)),f.setCaret(c),f.extend(d);this._setSelection(f,!0,!0);return!0},_setFullSelection:function(b,c){this._fullSelection=b;if(a.isWebkit)this._fullSelection=!0;var d=this._clipDiv||this._rootDiv;if(d)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&
!a.isIOS){var e=d.ownerDocument;this._highlightRGB=a.isWebkit?"transparent":"Highlight";var f=a.createElement(e,"div");this._selDiv1=f;f.style.position="absolute";f.style.borderWidth="0px";f.style.margin="0px";f.style.padding="0px";f.style.outline="none";f.style.background=this._highlightRGB;f.style.width="0px";f.style.height="0px";f.style.zIndex="0";d.appendChild(f);var h=a.createElement(e,"div");this._selDiv2=h;h.style.position="absolute";h.style.borderWidth="0px";h.style.margin="0px";h.style.padding=
"0px";h.style.outline="none";h.style.background=this._highlightRGB;h.style.width="0px";h.style.height="0px";h.style.zIndex="0";d.appendChild(h);this._selDiv3=e=a.createElement(e,"div");e.style.position="absolute";e.style.borderWidth="0px";e.style.margin="0px";e.style.padding="0px";e.style.outline="none";e.style.background=this._highlightRGB;e.style.width="0px";e.style.height="0px";e.style.zIndex="0";d.appendChild(e);if(a.isFirefox&&a.isMac){d=this._getWindow().getComputedStyle(e,null).getPropertyValue("background-color");
switch(d){case "rgb(119, 141, 168)":d="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":d="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":d="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":d="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":d="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":d="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":d="rgb(232, 184, 255)";break;default:d="rgb(180, 213, 255)"}this._highlightRGB=d;f.style.background=d;h.style.background=d;e.style.background=
d}c||this._updateDOMSelection()}}else{if(this._selDiv1)d.removeChild(this._selDiv1),this._selDiv1=null;if(this._selDiv2)d.removeChild(this._selDiv2),this._selDiv2=null;if(this._selDiv3)d.removeChild(this._selDiv3),this._selDiv3=null}},_setBlockCursor:function(a){this._blockCursorVisible=a;this._updateBlockCursorVisible()},_setOverwriteMode:function(a){this._overwriteMode=a;this._updateBlockCursorVisible()},_updateBlockCursorVisible:function(){if(this._blockCursorVisible||this._overwriteMode){if(!this._cursorDiv){var b=
a.createElement(document,"div");b.className="textviewBlockCursor";this._cursorDiv=b;b.tabIndex=-1;b.style.zIndex="2";b.style.color="transparent";b.style.position="absolute";b.style.pointerEvents="none";b.innerHTML="&nbsp;";this._viewDiv.appendChild(b);this._updateDOMSelection()}}else if(this._cursorDiv)this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":"false")},_setTabSize:function(b,
c){this._tabSize=b;this._customTabSize=void 0;var d=this._clientDiv;if(a.isOpera){if(d)d.style.OTabSize=this._tabSize+""}else if(a.isWebkit>=537.1){if(d)d.style.tabSize=this._tabSize+""}else if(a.isFirefox>=4){if(d)d.style.MozTabSize=this._tabSize+""}else if(this._tabSize!==8)this._customTabSize=this._tabSize;c||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(a){this._theme&&this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);(this._theme=a)&&this._theme.addEventListener("ThemeChanged",
this._themeListener.onChanged);this._setThemeClass(this._themeClass)},_setThemeClass:function(a,b){this._themeClass=a;var c="textview",d=this._theme.getThemeClass();d&&(c+=" "+d);this._themeClass&&d!==this._themeClass&&(c+=" "+this._themeClass);this._rootDiv.className=c;this._updateStyle(b)},_setWrapMode:function(a,b){this._wrapMode=a&&this._wrappable;var c=this._clientDiv,d=this._viewDiv;a?(c.style.whiteSpace="pre-wrap",c.style.wordWrap="break-word",d.style.overflowX="hidden",d.style.overflowY="scroll"):
(c.style.whiteSpace="pre",c.style.wordWrap="normal",d.style.overflowX="auto",d.style.overflowY="auto");b||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,b,c,d){if(this._clientDiv){var e=this._model,f=this._getSelection(),h=this._getScroll(),g=f.getCaret(),j=f.start,l=f.end,m=e.getLineAtOffset(l),n=Math.max(Math.max(j,e.getLineStart(m)),l-1),e=this._getClientWidth(),m=this._getClientHeight(),i=e/4,k=this._getBoundsAtOffset(g===j?j:n),q=k.left,r=k.right,s=k.top,
p=k.bottom;a&&!f.isEmpty()&&(k=this._getBoundsAtOffset(g===l?j:n),k.top===s?g===j?r=q+Math.min(k.right-q,e):q=r-Math.min(r-k.left,e):g===j?p=s+Math.min(k.bottom-s,m):s=p-Math.min(p-k.top,m));a=0;q<h.x&&(a=Math.min(q-h.x,-i));r>h.x+e&&(a=Math.max(r-h.x-e,i));f=0;s<h.y?f=s-h.y:p>h.y+m&&(f=p-h.y-m);d&&(d>0?f>0&&(f=Math.max(f,d)):f<0&&(f=Math.min(f,d)));if(a!==0||f!==0)return f!==0&&typeof c==="number"&&(c<0&&(c=0),c>1&&(c=1),f+=Math.floor(f>0?c*m:-c*m)),this._scrollViewAnimated(a,f,b),m!==this._getClientHeight()||
e!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;else b&&b();return!1}},_startIME:function(){if(this._imeOffset===-1){var a=this._getSelection();a.isEmpty()||this._modifyContent({text:"",start:a.start,end:a.end},!0);this._imeOffset=a.start}},_unhookEvents:function(){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);
this._modelListener=null;for(var a=0;a<this._handlers.length;a++){var b=this._handlers[a],c=b.target,d=b.type,b=b.handler;typeof c.removeEventListener==="function"?c.removeEventListener(d,b,!1):c.detachEvent("on"+d,b)}this._handlers=null;if(this._mutationObserver)this._mutationObserver.disconnect(),this._mutationObserver=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection&&this._clientDiv){var a=this._getSelection(),b=this._model,c=b.getLineAtOffset(a.start),d=b.getLineAtOffset(a.end),
e=this._getLineNext();if(e){var f=this._getLinePrevious(),h;c<e.lineIndex?(h=e,c=0):c>f.lineIndex?(h=f,c=0):(h=this._getLineNode(c),c=a.start-b.getLineStart(c));d<e.lineIndex?b=0:d>f.lineIndex?(e=f,b=0):(e=this._getLineNode(d),b=a.end-b.getLineStart(d));this._setDOMSelection(h,c,e,b,a.caret)}}},_update:function(b){if(!(this._redrawCount>0)){if(this._updateTimer)this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=null,b=!1;var c=this._clientDiv;if(c){if(this._metrics.invalid)this._ignoreQueueUpdate=
!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var d=this._model,e=this._getScroll(!1),f=this._getViewPadding(),h=d.getLineCount(),g=this._getLineHeight(),j=this._getClientWidth();if(this._wrapMode)c.style.width=j+"px";var l,m,n,i,k=0,r=0;if(this._lineHeight){for(;r<h;){m=this._getLineHeight(r);if(k+m>e.y)break;k+=m;r++}l=r;m=Math.max(0,l-1);n=d=e.y-k;l>0&&(d+=this._getLineHeight(l-1))}else i=Math.max(0,e.y)/g,l=Math.floor(i),m=Math.max(0,l-1),d=Math.round((i-m)*g),n=Math.round((i-l)*g);this._topIndexY=
n;i=this._parent;var s=i.clientWidth,p=i.clientHeight;i=this._getClientHeight();if(b){g=0;this._leftDiv&&(l=this._leftDiv.getBoundingClientRect(),g=l.right-l.left);l=j;for(this._wrapMode||(l=Math.max(this._maxLineWidth,l));r<h;)m=this._getLineHeight(r,!1),k+=m,r++;h=k}else{j=this._viewDiv;n=Math.min(l+Math.floor((i+n)/g),h-1);for(var e=Math.min(n+1,h-1),t,y=c.firstChild;y;){t=y.lineIndex;var D=y.nextSibling;if(!(m<=t&&t<=e)||y.lineRemoved||y.lineIndex===-1)this._mouseWheelLine===y?(y.style.display=
"none",y.lineIndex=-1):c.removeChild(y);y=D}var y=this._getLineNext(),D=j.ownerDocument,E=D.createDocumentFragment();for(t=m;t<=e;t++)if(!y||y.lineIndex>t)(new q(this,t)).create(E,null);else{E.firstChild&&(c.insertBefore(E,y),E=D.createDocumentFragment());if(y&&y.lineChanged)y=(new q(this,t)).create(E,y),y.lineChanged=!1;y=this._getLineNext(y)}E.firstChild&&c.insertBefore(E,y);if(a.isWebkit&&!this._wrapMode)c.style.width="0x7fffffffpx";y=this._getLineNext();t=i+d;for(E=!1;y;){m=y.lineWidth;if(m===
void 0)if(D=y._line.getBoundingClientRect(),m=y.lineWidth=Math.ceil(D.right-D.left),D=D.bottom-D.top,this._lineHeight)this._lineHeight[y.lineIndex]=D;else if(g!==0&&D!==0&&Math.ceil(g)!==Math.ceil(D))this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[y.lineIndex]=D;if(this._lineHeight&&!E&&(t-=this._lineHeight[y.lineIndex],t<0))n=y.lineIndex,E=!0;if(!this._wrapMode){if(m>=this._maxLineWidth)this._maxLineWidth=m,this._maxLineIndex=y.lineIndex;if(this._checkMaxLineIndex===y.lineIndex)this._checkMaxLineIndex=
-1}if(y.lineIndex===l)this._topChild=y;if(y.lineIndex===n)this._bottomChild=y;y=this._getLineNext(y)}if(this._checkMaxLineIndex!==-1&&(t=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=t&&t<h)){g=new q(this,t);D=g.getBoundingClientRect();m=D.right-D.left;if(m>=this._maxLineWidth)this._maxLineWidth=m,this._maxLineIndex=t;g.destroy()}for(;r<h;)m=this._getLineHeight(r,r<=n),k+=m,r++;h=k;this._updateRuler(this._leftDiv,l,e,p);this._updateRuler(this._rightDiv,l,e,p);g=0;this._leftDiv&&(l=this._leftDiv.getBoundingClientRect(),
g=l.right-l.left);e=0;this._rightDiv&&(e=this._rightDiv.getBoundingClientRect(),e=e.right-e.left);j.style.left=g+"px";j.style.right=e+"px";e=this._scrollDiv;e.style.height=h+"px";k=j=this._getClientWidth();this._wrapMode||(k=Math.max(this._maxLineWidth,k));l=k;if((!a.isIE||a.isIE>=9)&&this._maxLineWidth>j)k+=f.right+f.left;e.style.width=k+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=k+"px";e=this._getScroll(!1)}if(this._vScrollDiv)k=i-8,r=Math.max(15,Math.ceil(Math.min(1,k/(h+f.top+
f.bottom))*k)),this._vScrollDiv.style.left=g+j-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,e.y*k/h))+"px",this._vScrollDiv.style.height=r+"px";if(!this._wrapMode&&this._hScrollDiv)k=j-8,r=Math.max(15,Math.ceil(Math.min(1,k/(this._maxLineWidth+f.left+f.right))*k)),this._hScrollDiv.style.left=g+Math.floor(Math.max(0,Math.floor(e.x*k/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=i-9+"px",this._hScrollDiv.style.width=r+"px";y=e.x;m=this._clipDiv;k=this._overlayDiv;if(m){m.scrollLeft=
y;m.scrollTop=0;r=g+f.left;n=f.top;b=j;g=i;y=0;t=-d;if(e.x===0)r-=f.left,b+=f.left,y=f.left;e.x+j===l&&(b+=f.right);e.y===0&&(n-=f.top,g+=f.top,t+=f.top);e.y+i===h&&(g+=f.bottom);m.style.left=r+"px";m.style.top=n+"px";m.style.right=s-b-r+"px";m.style.bottom=p-g-n+"px";c.style.left=y+"px";c.style.top=t+"px";c.style.width=l+"px";c.style.height=i+d+"px";if(k)k.style.left=c.style.left,k.style.top=c.style.top,k.style.width=c.style.width,k.style.height=c.style.height}else{r=y;n=d;s=y+j;p=d+i;r===0&&(r-=
f.left);n===0&&(n-=f.top);s===l&&(s+=f.right);e.y+i===h&&(p+=f.bottom);c.style.clip="rect("+n+"px,"+s+"px,"+p+"px,"+r+"px)";c.style.left=-y+g+f.left+"px";c.style.width=(a.isWebkit?l:j+y)+"px";if(!b)c.style.top=-d+f.top+"px",c.style.height=i+d+"px";if(k&&(k.style.clip=c.style.clip,k.style.left=c.style.left,k.style.width=c.style.width,!b))k.style.top=c.style.top,k.style.height=c.style.height}this._updateDOMSelection();c=this._ensureCaretVisible;this._ensureCaretVisible=!1;i!==this._getClientHeight()&&
(this._update(),c&&this._showCaret())}}},_updateRuler:function(b,c,d,e){if(b)for(var f=this._parent.ownerDocument,h=this._getLineHeight(),g=this._getViewPadding(),b=b.firstChild;b;){var l=b._ruler,m=h,n=l.getOverview();n==="page"&&(m+=this._topIndexY);b.style.top=-m+"px";b.style.height=e+m+"px";b.rulerChanged&&j(l.getRulerStyle(),b);var i,k=b.firstChild;k?(i=k,k=k.nextSibling):(i=a.createElement(f,"div"),i.style.visibility="hidden",b.appendChild(i));var r;if(b.rulerChanged&&i){m=-1;if(r=l.getWidestAnnotation())if(j(r.style,
i),r.html)i.innerHTML=r.html;i.lineIndex=m;i.style.height=h+g.top+"px"}var q;if(n==="page"){for(l=l.getAnnotations(c,d+1);k;)m=k.lineIndex,r=k.nextSibling,(!(c<=m&&m<=d)||k.lineChanged)&&b.removeChild(k),k=r;k=b.firstChild.nextSibling;q=f.createDocumentFragment();for(m=c;m<=d;m++)if(!k||k.lineIndex>m){i=a.createElement(f,"div");if(r=l[m]){j(r.style,i);if(r.html)i.innerHTML=r.html;i.annotation=r}i.lineIndex=m;i.style.height=this._getLineHeight(m)+"px";q.appendChild(i)}else if(q.firstChild&&(b.insertBefore(q,
k),q=f.createDocumentFragment()),k)k=k.nextSibling;q.firstChild&&b.insertBefore(q,k)}else{r=this._getClientHeight();m=this._model.getLineCount();k=r+g.top+g.bottom-2*this._metrics.scrollWidth;n=h*m<k?h:k/m;if(b.rulerChanged){for(r=b.childNodes.length;r>1;)b.removeChild(b.lastChild),r--;l=l.getAnnotations(0,m);q=f.createDocumentFragment();for(var s in l)if(m=s>>>0,!(m<0)){i=a.createElement(f,"div");r=l[s];j(r.style,i);i.style.position="absolute";i.style.top=this._metrics.scrollWidth+h+Math.floor(m*
n)+"px";if(r.html)i.innerHTML=r.html;i.annotation=r;i.lineIndex=m;q.appendChild(i)}b.appendChild(q)}else if(b._oldTrackHeight!==k)for(i=b.firstChild?b.firstChild.nextSibling:null;i;)i.style.top=this._metrics.scrollWidth+h+Math.floor(i.lineIndex*n)+"px",i=i.nextSibling;b._oldTrackHeight=k}b.rulerChanged=!1;b=b.nextSibling}},_updateStyleSheet:function(){var b="";a.isWebkit&&this._metrics.scrollWidth>0&&(b+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");a.isFirefox&&a.isMac&&this._highlightRGB&&
this._highlightRGB!=="Highlight"&&(b+="\n.textview ::-moz-selection {background: "+this._highlightRGB+";}");if(b){var c=document.getElementById("_textviewStyle");if(c)c.removeChild(c.firstChild),c.appendChild(document.createTextNode(b));else{c=a.createElement(document,"style");c.id="_textviewStyle";var d=document.getElementsByTagName("head")[0]||document.documentElement;c.appendChild(document.createTextNode(b));d.insertBefore(c,d.firstChild)}}},_updateStyle:function(b){if(!b&&a.isIE)this._rootDiv.style.lineHeight=
"normal";var c=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=a.isIE?c.lineHeight-(c.lineTrim.top+c.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();b||(this.redraw(),this._resetLineWidth())}};f.EventTarget.addMixin(p.prototype);return{TextView:p}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(g,k){function i(f){this._model=f;this._projections=[]}i.prototype={addProjection:function(f){if(f){var d=this._model,a=this._projections;f._lineIndex=d.getLineAtOffset(f.start);f._lineCount=d.getLineAtOffset(f.end)-f._lineIndex;var e=f.text;e||(e="");f._model=typeof e==="string"?new g.TextModel(e,d.getLineDelimiter()):e;var d=this.mapOffset(f.start,!0),e=f.end-f.start,j=f._lineCount,c=f._model.getCharCount(),
b=f._model.getLineCount()-1;this.onChanging({type:"Changing",text:f._model.getText(),start:d,removedCharCount:e,addedCharCount:c,removedLineCount:j,addedLineCount:b});var h=this._binarySearch(a,f.start);a.splice(h,0,f);this.onChanged({type:"Changed",start:d,removedCharCount:e,addedCharCount:c,removedLineCount:j,addedLineCount:b})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(f,d){var a=this._projections,e=0,g,c;if(d){for(g=
0;g<a.length;g++){c=a[g];if(c.start>f)break;if(c.end>f)return-1;e+=c._model.getCharCount()-(c.end-c.start)}return f+e}for(g=0;g<a.length;g++){c=a[g];if(c.start>f-e)break;var b=c._model.getCharCount();if(c.start+b>f-e)return-1;e+=b-(c.end-c.start)}return f-e},removeProjection:function(f){var d,a=0;for(d=0;d<this._projections.length;d++){var e=this._projections[d];if(e===f){f=e;break}a+=e._model.getCharCount()-(e.end-e.start)}if(d<this._projections.length){var e=this._model,a=f.start+a,g=f.end-f.start,
c=f._lineCount,b=f._model.getCharCount(),h=f._model.getLineCount()-1;this.onChanging({type:"Changing",text:e.getText(f.start,f.end),start:a,removedCharCount:b,addedCharCount:g,removedLineCount:h,addedLineCount:c});this._projections.splice(d,1);this.onChanged({type:"Changed",start:a,removedCharCount:b,addedCharCount:g,removedLineCount:h,addedLineCount:c})}},_binarySearch:function(f,d){for(var a=f.length,e=-1,g;a-e>1;)g=Math.floor((a+e)/2),d<=f[g].start?a=g:e=g;return a},getCharCount:function(){for(var f=
this._model.getCharCount(),d=this._projections,a=0;a<d.length;a++){var e=d[a];f+=e._model.getCharCount()-(e.end-e.start)}return f},getLine:function(f,d){if(f<0)return null;var a=this._model,e=this._projections,g=0,c=[],b=0,h,l,n;for(h=0;h<e.length;h++){n=e[h];if(n._lineIndex>=f-g)break;l=n._model.getLineCount()-1;if(n._lineIndex+l>=f-g)if(b=f-(n._lineIndex+g),b<l)return n._model.getLine(b,d);else c.push(n._model.getLine(l));b=n.end;g+=l-n._lineCount}for(b=Math.max(b,a.getLineStart(f-g));h<e.length;h++){n=
e[h];if(n._lineIndex>f-g)break;c.push(a.getText(b,n.start));l=n._model.getLineCount()-1;if(n._lineIndex+l>f-g)return c.push(n._model.getLine(0,d)),c.join("");c.push(n._model.getText());b=n.end;g+=l-n._lineCount}e=a.getLineEnd(f-g,d);b<e&&c.push(a.getText(b,e));return c.join("")},getLineAtOffset:function(f){for(var d=this._model,a=this._projections,e=0,g=0,c=0;c<a.length;c++){var b=a[c];if(b.start>f-e)break;var h=b._model.getCharCount();if(b.start+h>f-e){a=f-(b.start+e);g+=b._model.getLineAtOffset(a);
e+=a;break}g+=b._model.getLineCount()-1-b._lineCount;e+=h-(b.end-b.start)}return d.getLineAtOffset(f-e)+g},getLineCount:function(){for(var f=this._projections,d=this._model.getLineCount(),a=0;a<f.length;a++){var e=f[a];d+=e._model.getLineCount()-1-e._lineCount}return d},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(f,d){if(f<0)return-1;for(var a=this._model,e=this._projections,g=0,c=0,b=0;b<e.length;b++){var h=e[b];if(h._lineIndex>f-g)break;var l=h._model.getLineCount()-
1;if(h._lineIndex+l>f-g)return h._model.getLineEnd(f-(h._lineIndex+g),d)+h.start+c;c+=h._model.getCharCount()-(h.end-h.start);g+=l-h._lineCount}return a.getLineEnd(f-g,d)+c},getLineStart:function(f){if(f<0)return-1;for(var d=this._model,a=this._projections,e=0,g=0,c=0;c<a.length;c++){var b=a[c];if(b._lineIndex>=f-e)break;var h=b._model.getLineCount()-1;if(b._lineIndex+h>=f-e)return b._model.getLineStart(f-(b._lineIndex+e))+b.start+g;g+=b._model.getCharCount()-(b.end-b.start);e+=h-b._lineCount}return d.getLineStart(f-
e)+g},getText:function(f,d){f===void 0&&(f=0);var a=this._model,e=this._projections,g=0,c=[],b,h,l;for(b=0;b<e.length;b++){h=e[b];if(h.start>f-g)break;l=h._model.getCharCount();if(h.start+l>f-g)if(d!==void 0&&h.start+l>d-g)return h._model.getText(f-(h.start+g),d-(h.start+g));else c.push(h._model.getText(f-(h.start+g))),f=h.end+g+l-(h.end-h.start);g+=l-(h.end-h.start)}var n=f-g;if(d!==void 0){for(;b<e.length;b++){h=e[b];if(h.start>d-g)break;c.push(a.getText(n,h.start));l=h._model.getCharCount();if(h.start+
l>d-g)return c.push(h._model.getText(0,d-(h.start+g))),c.join("");c.push(h._model.getText());n=h.end;g+=l-(h.end-h.start)}c.push(a.getText(n,d-g))}else{for(;b<e.length;b++)h=e[b],c.push(a.getText(n,h.start)),c.push(h._model.getText()),n=h.end;c.push(a.getText(n))}return c.join("")},_onChanging:function(f,d,a,e,g,c){for(var b=this._model,h=this._projections,l,n=0,m,i=d+a;l<h.length;l++){a=h[l];if(a.start>d)break;n+=a._model.getCharCount()-(a.end-a.start)}d+=n;for(var k=l;l<h.length;l++){a=h[l];if(a.start>
i)break;n+=a._model.getCharCount()-(a.end-a.start);m+=a._model.getLineCount()-1-a._lineCount}a=i+n;n=l;this.onChanging(d,a-d,e,g+m,c);h.splice(h,n-k);for(f=f.length-(a-d);l<h.length;l++)a=h[l],a.start+=f,a.end+=f,a._lineIndex=b.getLineAtOffset(a.start)},onChanging:function(f){return this.dispatchEvent(f)},onChanged:function(f){return this.dispatchEvent(f)},setLineDelimiter:function(f){this._model.setLineDelimiter(f)},setText:function(f,d,a){f===void 0&&(f="");d===void 0&&(d=0);var e=d,g=a,c=this._model,
b=this._projections,h=0,l=0,n,m,i,k,q,p=0;for(n=0;n<b.length;n++){m=b[n];if(m.start>d-h)break;i=m._model.getCharCount();if(m.start+i>d-h)if(a!==void 0&&m.start+i>a-h){m._model.setText(f,d-(m.start+h),a-(m.start+h));return}else p=m._model.getLineCount()-1-m._model.getLineAtOffset(d-(m.start+h)),k={projection:m,start:d-(m.start+h)},d=m.end+h+i-(m.end-m.start);l+=m._model.getLineCount()-1-m._lineCount;h+=i-(m.end-m.start)}d-=h;var t=n,p=c.getLineAtOffset(d)+l-p;if(a!==void 0)for(;n<b.length;n++){m=b[n];
if(m.start>a-h)break;i=m._model.getCharCount();if(m.start+i>a-h){l+=m._model.getLineAtOffset(a-(m.start+h));i=a-(m.start+h);a=m.end+h;q={projection:m,end:i};break}l+=m._model.getLineCount()-1-m._lineCount;h+=i-(m.end-m.start)}else{for(;n<b.length;n++)m=b[n],l+=m._model.getLineCount()-1-m._lineCount,h+=m._model.getCharCount()-(m.end-m.start);a=g=c.getCharCount()+h}a-=h;m=c.getLineAtOffset(a)+l;g-=e;for(var l=m-p,p=f.length,o=i=m=h=0;;){m!==-1&&m<=o&&(m=f.indexOf("\r",o));i!==-1&&i<=o&&(i=f.indexOf("\n",
o));if(i===-1&&m===-1)break;o=m!==-1&&i!==-1?m+1===i?i+1:(m<i?m:i)+1:m!==-1?m+1:i+1;h++}this.onChanging({type:"Changing",text:f,start:e,removedCharCount:g,addedCharCount:p,removedLineCount:l,addedLineCount:h});c.setText(f,d,a);if(k)m=k.projection,m._model.setText("",k.start);if(q)m=q.projection,m._model.setText("",0,q.end),m.start=m.end,m._lineCount=0;b.splice(t,n-t);for(f=f.length-(a-d);n<b.length;n++)m=b[n],m.start+=f,m.end+=f,m._lineIndex=c.getLineAtOffset(m.start);this.onChanged({type:"Changed",
start:e,removedCharCount:g,addedCharCount:p,removedLineCount:l,addedLineCount:h})}};k.EventTarget.addMixin(i.prototype);return{ProjectionTextModel:i}});
define("orion/editor/tooltip",["i18n!orion/editor/nls/messages","orion/editor/textView","orion/editor/textModel","orion/editor/projectionTextModel","orion/util"],function(g,k,i,f,d){function a(a){this._view=a;this._create(a.getOptions("parent").ownerDocument);a.addEventListener("Destroy",this,this.destroy)}a.getTooltip=function(d){if(!d._tooltip)d._tooltip=new a(d);return d._tooltip};a.prototype={_create:function(a){if(!this._tooltipDiv){var f=this._tooltipDiv=d.createElement(a,"div");f.className=
"textviewTooltip";f.setAttribute("aria-live","assertive");f.setAttribute("aria-atomic","true");var c=this._tooltipContents=d.createElement(a,"div");f.appendChild(c);a.body.appendChild(f);this.hide()}},_getWindow:function(){var a=this._tooltipDiv.ownerDocument;return a.defaultView||a.parentWindow},destroy:function(){if(this._tooltipDiv){this.hide();var a=this._tooltipDiv.parentNode;a&&a.removeChild(this._tooltipDiv);this._tooltipDiv=null}},hide:function(){if(this._contentsView)this._contentsView.destroy(),
this._contentsView=null;if(this._tooltipContents)this._tooltipContents.innerHTML="";if(this._tooltipDiv)this._tooltipDiv.style.visibility="hidden";var a=this._getWindow();if(this._showTimeout)a.clearTimeout(this._showTimeout),this._showTimeout=null;if(this._hideTimeout)a.clearTimeout(this._hideTimeout),this._hideTimeout=null;if(this._fadeTimeout)a.clearInterval(this._fadeTimeout),this._fadeTimeout=null},isVisible:function(){return this._tooltipDiv&&this._tooltipDiv.style.visibility==="visible"},setTarget:function(a,
d){if(this.target!==a&&(this._target=a,this.hide(),a)){var c=this;if(d===0)c.show(!0);else{var b=this._getWindow();c._showTimeout=b.setTimeout(function(){c.show(!0)},d?d:500)}}},show:function(a){if(this._target){var d=this._target.getTooltipInfo();if(d){var c=this._tooltipDiv,b=this._tooltipContents;c.style.left=c.style.right=c.style.width=c.style.height=b.style.width=b.style.height="auto";var h=d.contents;h instanceof Array&&(h=this._getAnnotationContents(h));if(typeof h==="string")b.innerHTML=h;
else if(this._isNode(h))b.appendChild(h);else if(h instanceof f.ProjectionTextModel){var g=this._view,n=g.getOptions();n.wrapMode=!1;n.parent=b;var m=n.themeClass;m?((m=m.replace("tooltip",""))&&(m=" "+m),m="tooltip"+m):m="tooltip";n.themeClass=m;n=this._contentsView=new k.TextView(n);n._clientDiv.contentEditable=!1;n.addEventListener("LineStyle",function(a){g.onLineStyle(a)});n.setModel(h);h=n.computeSize();b.style.width=h.width+"px";b.style.height=h.height+"px";n.resize()}else return;b=c.ownerDocument.documentElement;
d.anchor==="right"?(h=b.clientWidth-d.x,c.style.right=h+"px"):(h=parseInt(this._getNodeStyle(c,"padding-left","0"),10),h+=parseInt(this._getNodeStyle(c,"border-left-width","0"),10),h=d.x-h,c.style.left=h+"px");c.style.maxWidth=b.clientWidth-h-10+"px";h=parseInt(this._getNodeStyle(c,"padding-top","0"),10);h+=parseInt(this._getNodeStyle(c,"border-top-width","0"),10);h=d.y-h;c.style.top=h+"px";c.style.maxHeight=b.clientHeight-h-10+"px";c.style.opacity="1";c.style.visibility="visible";if(a){var i=this,
r=this._getWindow();i._hideTimeout=r.setTimeout(function(){var a=parseFloat(i._getNodeStyle(c,"opacity","1"));i._fadeTimeout=r.setInterval(function(){c.style.visibility==="visible"&&a>0?(a-=0.1,c.style.opacity=a):i.hide()},50)},5E3)}}}},_getAnnotationContents:function(a){function d(a){var c=a.title;if(c==="")return null;var e="<div>";a.html&&(e+=a.html+"&nbsp;");if(!c)c=a.end,a=b.getLineStart(b.getLineAtOffset(a.start)),c=b.getLineEnd(b.getLineAtOffset(c),!0),c=b.getText(a,c);c=c.replace(/</g,"&lt;").replace(/>/g,
"&gt;");e+="<span style='vertical-align:middle;'>"+c+"</span><div>";return e}if(a.length===0)return null;var c=this._view.getModel(),b=c.getBaseModel?c.getBaseModel():c;if(a.length===1)if(c=a[0],c.title!==void 0)return d(c);else{var a=new f.ProjectionTextModel(b),h=b.getLineStart(b.getLineAtOffset(c.start)),l=b.getCharCount();c.end!==l&&a.addProjection({start:c.end,end:l});h>0&&a.addProjection({start:0,end:h});return a}else{h="<div><em>"+g.multipleAnnotations+"</em></div>";for(l=0;l<a.length;l++)c=
a[l],(c=d(c))&&(h+=c);return h}},_getNodeStyle:function(a,d,c){var b;if(a&&(b=a.style[d],!b))if(a.currentStyle){for(b=0;(b=d.indexOf("-",b))!==-1;)d=d.substring(0,b)+d.substring(b+1,b+2).toUpperCase()+d.substring(b+2);b=a.currentStyle[d]}else b=(a=a.ownerDocument.defaultView.getComputedStyle(a,null))?a.getPropertyValue(d):null;return b||c},_isNode:function(a){return typeof Node==="object"?a instanceof Node:a&&typeof a==="object"&&typeof a.nodeType==="number"&&typeof a.nodeName==="string"}};return{Tooltip:a}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(g,k){function i(a,c,d){this.start=a;this.end=c;this._projectionModel=d;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function f(){}function d(a,c){var d=a.lastIndexOf("."),d=a.substring(d+1),e={title:g[d],style:{styleClass:"annotation "+d},html:"<div class='annotationHTML "+d+"'></div>",overviewStyle:{styleClass:"annotationOverview "+d}};c?e.lineStyle={styleClass:"annotationLine "+
d}:e.rangeStyle={styleClass:"annotationRange "+d};f.registerType(a,e)}function a(){}function e(a){this._annotations=[];var c=this;this._listener={onChanged:function(a){c._onChanged(a)}};this.setTextModel(a)}function j(a,c){this._view=a;this._annotationModel=c;var d=this;this._listener={onDestroy:function(a){d._onDestroy(a)},onLineStyle:function(a){d._onLineStyle(a)},onChanged:function(a){d._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",
this._listener.onLineStyle);c.addEventListener("Changed",this._listener.onChanged)}i.prototype={_expandedHTML:"<div class='annotationHTML expanded'></div>",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"<div class='annotationHTML collapsed'></div>",_collapsedStyle:{styleClass:"annotation collapsed"},collapse:function(){if(this.expanded){this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var a=this._projectionModel,c=a.getBaseModel();this._projection=
{start:c.getLineStart(c.getLineAtOffset(this.start)+1),end:c.getLineEnd(c.getLineAtOffset(this.end),!0)};a.addProjection(this._projection)}},expand:function(){if(!this.expanded)this.expanded=!0,this.html=this._expandedHTML,this.style=this._expandedStyle,this._projectionModel.removeProjection(this._projection)}};f.ANNOTATION_ERROR="orion.annotation.error";f.ANNOTATION_WARNING="orion.annotation.warning";f.ANNOTATION_TASK="orion.annotation.task";f.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";
f.ANNOTATION_BOOKMARK="orion.annotation.bookmark";f.ANNOTATION_FOLDING="orion.annotation.folding";f.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";f.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";f.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";f.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";f.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";f.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";f.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";
f.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup";f.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";f.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";var c={};f.registerType=function(a,d){var e=d;if(typeof e!=="function")e=function(a,b,c){this.start=a;this.end=b;if(c!==void 0)this.title=c},e.prototype=d;e.prototype.type=a;c[a]=e;return a};f.createAnnotation=function(a,c,d,e){return new (this.getType(a))(c,d,e)};f.getType=function(a){return c[a]};
d(f.ANNOTATION_ERROR);d(f.ANNOTATION_WARNING);d(f.ANNOTATION_TASK);d(f.ANNOTATION_BREAKPOINT);d(f.ANNOTATION_BOOKMARK);d(f.ANNOTATION_CURRENT_BRACKET);d(f.ANNOTATION_MATCHING_BRACKET);d(f.ANNOTATION_CURRENT_SEARCH);d(f.ANNOTATION_MATCHING_SEARCH);d(f.ANNOTATION_READ_OCCURRENCE);d(f.ANNOTATION_WRITE_OCCURRENCE);d(f.ANNOTATION_SELECTED_LINKED_GROUP);d(f.ANNOTATION_CURRENT_LINKED_GROUP);d(f.ANNOTATION_LINKED_GROUP);d(f.ANNOTATION_CURRENT_LINE,!0);f.registerType(f.ANNOTATION_FOLDING,i);a.addMixin=function(b){var c=
a.prototype,d;for(d in c)c.hasOwnProperty(d)&&(b[d]=c[d])};a.prototype={addAnnotationType:function(a){if(!this._annotationTypes)this._annotationTypes=[];this._annotationTypes.push(a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var c=0;c<this._annotationTypes.length;c++)if(this._annotationTypes[c]===a)return c+1;return 0},getAnnotationsByType:function(a,c,d){a=a.getAnnotations(c,d);for(d=[];a.hasNext();)c=a.next(),this.getAnnotationTypePriority(c.type)!==0&&d.push(c);var e=
this;d.sort(function(a,b){return e.getAnnotationTypePriority(a.type)-e.getAnnotationTypePriority(b.type)});return d},isAnnotationTypeVisible:function(a){return this.getAnnotationTypePriority(a)!==0},removeAnnotationType:function(a){if(this._annotationTypes)for(var c=0;c<this._annotationTypes.length;c++)if(this._annotationTypes[c]===a){this._annotationTypes.splice(c,1);break}}};e.prototype={addAnnotation:function(a){if(a){var c=this._annotations,d=this._binarySearch(c,a.start);c.splice(d,0,a);this.onChanged({type:"Changed",
added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,c){var d=this._annotations,e,f=0,g=function(){for(;f<d.length;){var e=d[f++];if(a===e.start||(a>e.start?a<e.end:e.start<c))return e;if(e.start>=c)break}return null};e=g();return{next:function(){var a=e;a&&(e=g());return a},hasNext:function(){return e!==null}}},modifyAnnotation:function(a){if(a&&!(this._getAnnotationIndex(a)<0))this.onChanged({type:"Changed",added:[],removed:[],changed:[a]})},
onChanged:function(a){return this.dispatchEvent(a)},removeAnnotations:function(a){var c=this._annotations,d,e;if(a){d=[];for(e=c.length-1;e>=0;e--){var f=c[e];f.type===a&&c.splice(e,1);d.splice(0,0,f)}}else d=c;this.onChanged({type:"Changed",removed:d,added:[],changed:[]})},removeAnnotation:function(a){if(a&&(a=this._getAnnotationIndex(a),!(a<0)))this.onChanged({type:"Changed",removed:this._annotations.splice(a,1),added:[],changed:[]})},replaceAnnotations:function(a,c){var d=this._annotations,e,f,
g,j=[];if(a)for(e=a.length-1;e>=0;e--)g=a[e],f=this._getAnnotationIndex(g),f<0||(d.splice(f,1),j.splice(0,0,g));c||(c=[]);for(e=0;e<c.length;e++)g=c[e],f=this._binarySearch(d,g.start),d.splice(f,0,g);this.onChanged({type:"Changed",removed:j,added:c,changed:[]})},setTextModel:function(a){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=a)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(a,c){for(var d=a.length,e=
-1,f;d-e>1;)f=Math.floor((d+e)/2),c<=a[f].start?d=f:e=f;return d},_getAnnotationIndex:function(a){for(var c=this._annotations,d=this._binarySearch(c,a.start);d<c.length&&c[d].start===a.start;){if(c[d]===a)return d;d++}return-1},_onChanged:function(a){var c=a.start,d=a.removedCharCount,e=this._annotations,f=c+d;if(0<e.length){for(var g={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:a},a=a.addedCharCount-d,d=0;d<e.length;d++){var j=e[d];j.start>=f?(j.start+=a,j.end+=a,g.changed.push(j)):
j.end<=c||(j.start<c&&f<j.end?(j.end+=a,g.changed.push(j)):(e.splice(d,1),g.removed.push(j),d--))}if(g.added.length>0||g.removed.length>0||g.changed.length>0)this.onChanged(g)}}};k.EventTarget.addMixin(e.prototype);j.prototype={destroy:function(){var a=this._view;if(a)a.removeEventListener("Destroy",this._listener.onDestroy),a.removeEventListener("LineStyle",this._listener.onLineStyle),this.view=null;(a=this._annotationModel)&&a.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(a,
c){if(c){a||(a={});a.styleClass&&c.styleClass&&a.styleClass!==c.styleClass?a.styleClass+=" "+c.styleClass:a.styleClass=c.styleClass;var d;if(c.tagName&&!a.tagName)a.tagName=c.tagName;if(c.style){if(!a.style)a.style={};for(d in c.style)a.style[d]||(a.style[d]=c.style[d])}if(c.attributes){if(!a.attributes)a.attributes={};for(d in c.attributes)a.attributes[d]||(a.attributes[d]=c.attributes[d])}}return a},_mergeStyleRanges:function(a,c){a||(a=[]);var d,e;for(e=0;e<a.length&&c;e++){var f=a[e];if(c.end<=
f.start)break;if(!(c.start>=f.end)){d=this._mergeStyle({},f.style);d=this._mergeStyle(d,c.style);var g=[];g.push(e,1);c.start<f.start&&g.push({start:c.start,end:f.start,style:c.style});c.start>f.start&&g.push({start:f.start,end:c.start,style:f.style});g.push({start:Math.max(f.start,c.start),end:Math.min(f.end,c.end),style:d});c.end<f.end&&g.push({start:c.end,end:f.end,style:f.style});c=c.end>f.end?{start:f.end,end:c.end,style:c.style}:null;Array.prototype.splice.apply(a,g)}}c&&(d=this._mergeStyle({},
c.style),a.splice(e,0,{start:c.start,end:c.end,style:d}));return a},_onAnnotationModelChanged:function(a){function c(a){for(var b=0;b<a.length;b++)if(e.isAnnotationTypeVisible(a[b].type)){var h=a[b].start,g=a[b].end;f.getBaseModel&&(h=f.mapOffset(h,!0),g=f.mapOffset(g,!0));h!==-1&&g!==-1&&d.redrawRange(h,g)}}if(!a.textModelChangedEvent){var d=this._view;if(d){var e=this,f=d.getModel();c(a.added);c(a.removed);c(a.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){var c=this._annotationModel,
d=a.textView.getModel(),e=c.getTextModel(),f=a.lineStart,g=a.lineStart+a.lineText.length;e!==d&&(f=d.mapOffset(f),g=d.mapOffset(g));for(c=c.getAnnotations(f,g);c.hasNext();)if(f=c.next(),this.isAnnotationTypeVisible(f.type)){if(f.rangeStyle){var g=f.start,j=f.end;e!==d&&(g=d.mapOffset(g,!0),j=d.mapOffset(j,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:g,end:j,style:f.rangeStyle})}if(f.lineStyle)a.style=this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,f.lineStyle)}}};a.addMixin(j.prototype);
return{FoldingAnnotation:i,AnnotationType:f,AnnotationTypeList:a,AnnotationModel:e,AnnotationStyler:j}});
define("orion/editor/editor","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/eventTarget,orion/editor/tooltip,orion/editor/annotations,orion/util".split(","),function(g,k,i,f,d,a){function e(a){this._textViewFactory=a.textViewFactory;this._undoStackFactory=a.undoStackFactory;this._textDNDFactory=a.textDNDFactory;this._annotationFactory=a.annotationFactory;this._foldingRulerFactory=a.foldingRulerFactory;this._lineNumberRulerFactory=a.lineNumberRulerFactory;this._contentAssistFactory=
a.contentAssistFactory;this._keyBindingFactory=a.keyBindingFactory;this._statusReporter=a.statusReporter;this._domNode=a.domNode;this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=this._annotationStyler=null;this._dirty=!1;this._title=this._contentAssist=null}function j(a){var b=this,d=Array.prototype.slice.call(arguments,1);return d.length?function(){return arguments.length?b.apply(a,d.concat(Array.prototype.slice.call(arguments))):b.apply(a,
d)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}e.prototype={destroy:function(){this.uninstallTextView();this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=this._statusReporter=this._domNode=null},getAnnotationModel:function(){return this._annotationModel},getAnnotationRuler:function(){return this._annotationRuler},getAnnotationStyler:function(){return this._annotationStyler},
getFoldingRuler:function(){return this._foldingRuler},getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){var a=this._textView.getModel();a.getBaseModel&&(a=a.getBaseModel());return a},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getTitle:function(){return this._title},getKeyModes:function(){return this._textView.getKeyModes()},isDirty:function(){return this._dirty},setAnnotationRulerVisible:function(a){if(this._annotationRulerVisible!==
a&&(this._annotationRulerVisible=a,this._annotationRuler)){var b=this._textView;a?b.addRuler(this._annotationRuler,0):b.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(a){if(this._foldingRulerVisible!==a&&(this._foldingRulerVisible=a,this._foldingRuler)){var b=this._textView;b.getModel().getBaseModel&&(a?b.addRuler(this._foldingRuler,100):b.removeRuler(this._foldingRuler))}},setDirty:function(a){if(this._dirty!==a)this._dirty=a,this.onDirtyChanged({type:"DirtyChanged"})},setLineNumberRulerVisible:function(a){if(this._lineNumberRulerVisible!==
a&&(this._lineNumberRulerVisible=a,this._lineNumberRuler)){var b=this._textView;a?b.addRuler(this._lineNumberRuler,1):b.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(a){if(this._overviewRulerVisible!==a&&(this._overviewRulerVisible=a,this._overviewRuler)){var b=this._textView;a?b.addRuler(this._overviewRuler):b.removeRuler(this._overviewRuler)}},mapOffset:function(a,b){var d=this._textView.getModel();d.getBaseModel&&(a=d.mapOffset(a,b));return a},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},
getSelection:function(){var a=this._textView,b=a.getSelection(),a=a.getModel();if(a.getBaseModel)b.start=a.mapOffset(b.start),b.end=a.mapOffset(b.end);return b},getText:function(a,b){var d=this._textView.getModel();d.getBaseModel&&(d=d.getBaseModel());return d.getText(a,b)},_expandOffset:function(a){var b=this._textView.getModel(),e=this._annotationModel;if(e&&b.getBaseModel)for(a=e.getAnnotations(a,a+1);a.hasNext();)b=a.next(),b.type===d.AnnotationType.ANNOTATION_FOLDING&&b.expand&&(b.expand(),e.modifyAnnotation(b))},
setCaretOffset:function(a,b,d){var e=this._textView,f=e.getModel();f.getBaseModel&&(this._expandOffset(a),a=f.mapOffset(a,!0));e.setCaretOffset(a,b,d)},setText:function(a,b,d){var e=this._textView,f=e.getModel();f.getBaseModel&&(b!==void 0&&(this._expandOffset(b),b=f.mapOffset(b,!0)),d!==void 0&&(this._expandOffset(d),d=f.mapOffset(d,!0)));e.setText(a,b,d)},setFoldingEnabled:function(a){this.setFoldingRulerVisible(a)},setSelection:function(a,b,d,e){var f=this._textView,g=f.getModel();g.getBaseModel&&
(this._expandOffset(a),this._expandOffset(b),a=g.mapOffset(a,!0),b=g.mapOffset(b,!0));f.setSelection(a,b,d,e)},moveSelection:function(a,b,d,e){var f=this._textView;this.setSelection(a,b||a,1/3,function(){(e===void 0||e)&&f.focus();d&&d()})},checkDirty:function(){this.setDirty(!this._undoStack.isClean())},reportStatus:function(a,b,d){this._statusReporter&&this._statusReporter(a,b,d)},_getTooltipInfo:function(a,b){var d=this._textView,e=this.getAnnotationModel();if(!e)return null;var f=this._annotationStyler;
if(!f)return null;var g=d.getOffsetAtLocation(a,b);if(g===-1)return null;g=this.mapOffset(g);f=f.getAnnotationsByType(e,g,g+1);e=[];for(g=0;g<f.length;g++)f[g].rangeStyle&&e.push(f[g]);if(e.length===0)return null;d=d.convert({x:a,y:b},"document","page");return{contents:e,anchor:"left",x:d.x+10,y:d.y+20}},_highlightCurrentLine:function(a,b){var e=this._annotationModel;if(e){var f=this._textView.getModel(),g=b?f.getLineAtOffset(b.start):-1,j=f.getLineAtOffset(a.start),i=a.start===a.end,k=!b||b.start===
b.end,q=f.getLineStart(j),p=f.getLineEnd(j);f.getBaseModel&&(q=f.mapOffset(q),p=f.mapOffset(p));f=this._currentLineAnnotation;if(!(g===j&&k&&i&&f&&f.start===q&&f.end===p)){var g=f?[f]:null,t;i&&(f=d.AnnotationType.createAnnotation(d.AnnotationType.ANNOTATION_CURRENT_LINE,q,p),t=[f]);this._currentLineAnnotation=f;e.replaceAnnotations(g,t)}}},installTextView:function(){this._textView=this._textViewFactory();if(this._undoStackFactory)this._undoStack=this._undoStackFactory.createUndoStack(this);if(this._textDNDFactory)this._textDND=
this._textDNDFactory.createTextDND(this,this._undoStack);if(this._contentAssistFactory)this._contentAssist=this._contentAssistFactory.createContentAssistMode(this).getContentAssist();var a=this,b=this._textView,e=this;this._listener={onModelChanged:function(){e.checkDirty()},onMouseOver:function(a){e._listener.onMouseMove(a)},onMouseMove:function(a){var c=f.Tooltip.getTooltip(b);if(c&&!(e._listener.lastMouseX===a.event.clientX&&e._listener.lastMouseY===a.event.clientY))e._listener.lastMouseX=a.event.clientX,
e._listener.lastMouseY=a.event.clientY,c.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return e._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(a){var c=f.Tooltip.getTooltip(b);if(c&&!(e._listener.lastMouseX===a.event.clientX&&e._listener.lastMouseY===a.event.clientY))e._listener.lastMouseX=a.event.clientX,e._listener.lastMouseY=a.event.clientY,c.setTarget(null)},onScroll:function(){var a=f.Tooltip.getTooltip(b);a&&a.setTarget(null)},onSelection:function(a){e._updateCursorStatus();e._highlightCurrentLine(a.newValue,
a.oldValue)}};b.addEventListener("ModelChanged",this._listener.onModelChanged);b.addEventListener("Selection",this._listener.onSelection);b.addEventListener("MouseOver",this._listener.onMouseOver);b.addEventListener("MouseOut",this._listener.onMouseOut);b.addEventListener("MouseMove",this._listener.onMouseMove);b.addEventListener("Scroll",this._listener.onScroll);this._keyBindingFactory&&(typeof this._keyBindingFactory==="function"?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):
this._keyBindingFactory.createKeyBindings(a,this._undoStack,this._contentAssist));var g=function(b){if(b!==void 0&&b!==-1){for(var e=this.getView().getModel(),f=this.getAnnotationModel(),h=a.mapOffset(e.getLineStart(b)),b=a.mapOffset(e.getLineEnd(b)),e=f.getAnnotations(h,b),g=null;e.hasNext();){var j=e.next();if(j.type===d.AnnotationType.ANNOTATION_BOOKMARK){g=j;break}}g?f.removeAnnotation(g):(g=d.AnnotationType.createAnnotation(d.AnnotationType.ANNOTATION_BOOKMARK,h,b),g.title=void 0,f.addAnnotation(g))}};
if(this._annotationFactory){var j=b.getModel();j.getBaseModel&&(j=j.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(j))if(j=this._annotationStyler=this._annotationFactory.createAnnotationStyler(b,this._annotationModel))j.addAnnotationType(d.AnnotationType.ANNOTATION_CURRENT_SEARCH),j.addAnnotationType(d.AnnotationType.ANNOTATION_MATCHING_SEARCH),j.addAnnotationType(d.AnnotationType.ANNOTATION_ERROR),j.addAnnotationType(d.AnnotationType.ANNOTATION_WARNING),j.addAnnotationType(d.AnnotationType.ANNOTATION_MATCHING_BRACKET),
j.addAnnotationType(d.AnnotationType.ANNOTATION_CURRENT_BRACKET),j.addAnnotationType(d.AnnotationType.ANNOTATION_CURRENT_LINE),j.addAnnotationType(d.AnnotationType.ANNOTATION_READ_OCCURRENCE),j.addAnnotationType(d.AnnotationType.ANNOTATION_WRITE_OCCURRENCE),j.addAnnotationType(d.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP),j.addAnnotationType(d.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP),j.addAnnotationType(d.AnnotationType.ANNOTATION_LINKED_GROUP),j.addAnnotationType("orion.annotation.highlightError");
b.annotationModel=this._annotationModel;var j=this._annotationFactory.createAnnotationRulers(this._annotationModel),m=this._annotationRuler=j.annotationRuler;if(m)m.onDblClick=g,m.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),m.addAnnotationType(d.AnnotationType.ANNOTATION_ERROR),m.addAnnotationType(d.AnnotationType.ANNOTATION_WARNING),m.addAnnotationType(d.AnnotationType.ANNOTATION_TASK),m.addAnnotationType(d.AnnotationType.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(!0);
if(m=this._overviewRuler=j.overviewRuler)m.addAnnotationType(d.AnnotationType.ANNOTATION_CURRENT_SEARCH),m.addAnnotationType(d.AnnotationType.ANNOTATION_MATCHING_SEARCH),m.addAnnotationType(d.AnnotationType.ANNOTATION_ERROR),m.addAnnotationType(d.AnnotationType.ANNOTATION_WARNING),m.addAnnotationType(d.AnnotationType.ANNOTATION_TASK),m.addAnnotationType(d.AnnotationType.ANNOTATION_BOOKMARK),m.addAnnotationType(d.AnnotationType.ANNOTATION_MATCHING_BRACKET),m.addAnnotationType(d.AnnotationType.ANNOTATION_CURRENT_BRACKET),
m.addAnnotationType(d.AnnotationType.ANNOTATION_CURRENT_LINE),m.addAnnotationType(d.AnnotationType.ANNOTATION_READ_OCCURRENCE),m.addAnnotationType(d.AnnotationType.ANNOTATION_WRITE_OCCURRENCE);this.setOverviewRulerVisible(!0)}if(this._lineNumberRulerFactory)this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.onDblClick=g,this.setLineNumberRulerVisible(!0);if(this._foldingRulerFactory)this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),
this._foldingRuler.addAnnotationType(d.AnnotationType.ANNOTATION_FOLDING),this.setFoldingRulerVisible(!1);this.dispatchEvent({type:"TextViewInstalled",textView:b})},uninstallTextView:function(){var a=this._textView;if(a)a.destroy(),this._textView=this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=this._title=null,this._dirty=!1,this.dispatchEvent({type:"TextViewUninstalled",
textView:a})},_updateCursorStatus:function(){var c=this.getModel(),b=this.getCaretOffset(),d=c.getLineAtOffset(b),c=c.getLineStart(d);b-=c;for(var c=this.getKeyModes(),e=0;e<c.length;e++){var f=c[e];if(f.isActive()&&f.isStatusActive&&f.isStatusActive())return}this.reportStatus(a.formatMessage(g.lineColumn,d+1,b+1))},showProblems:function(a){var b=this._annotationModel;if(b){for(var e=[],f=[],g=b.getTextModel(),j=b.getAnnotations(0,g.getCharCount()),i;j.hasNext();)i=j.next(),(i.type===d.AnnotationType.ANNOTATION_ERROR||
i.type===d.AnnotationType.ANNOTATION_WARNING)&&e.push(i);if(a)for(j=0;j<a.length;j++)if(i=a[j]){var k=i.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),q=g.getLineStart(i.line-1);i=d.AnnotationType.createAnnotation(i.severity==="error"?d.AnnotationType.ANNOTATION_ERROR:d.AnnotationType.ANNOTATION_WARNING,q+i.start-1,q+i.end,k);f.push(i)}b.replaceAnnotations(e,f)}},showOccurrences:function(a){var b=this._annotationModel;if(b){for(var e=[],f=[],g=b.getTextModel(),j=b.getAnnotations(0,g.getCharCount()),
i;j.hasNext();)i=j.next(),(i.type===d.AnnotationType.ANNOTATION_READ_OCCURRENCE||i.type===d.AnnotationType.ANNOTATION_WRITE_OCCURRENCE)&&e.push(i);if(a)for(j=0;j<a.length;j++)if(i=a[j]){var k=g.getLineStart(i.line-1);i=d.AnnotationType.createAnnotation(i.readAccess===!0?d.AnnotationType.ANNOTATION_READ_OCCURRENCE:d.AnnotationType.ANNOTATION_WRITE_OCCURRENCE,k+i.start-1,k+i.end,i.description);f.push(i)}b.replaceAnnotations(e,f)}},showSelection:function(a,b,d,e,f){typeof a==="number"?(typeof b!=="number"&&
(b=a),this.moveSelection(a,b)):typeof d==="number"&&(a=this.getModel().getLineStart(d-1),typeof e==="number"&&(a+=e),typeof f!=="number"&&(f=0),this.moveSelection(a,a+f))},setInput:function(a,b,d,e){this._title=a;this._textView&&(e?(this._undoStack.markClean(),this.checkDirty()):(b?this._textView.setText(b):d!==null&&d!==void 0&&(this._textView.setText(d),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection())),this._undoStack.reset(),this.checkDirty(),
this._textView.focus()));this.onInputChanged({type:"InputChanged",title:a,message:b,contents:d,contentsSaved:e})},onInputChanged:function(a){return this.dispatchEvent(a)},onGotoLine:function(a,b,d,e){if(this._textView){var f=this.getModel(),a=Math.max(0,Math.min(a,f.getLineCount()-1)),g=f.getLineStart(a),j=0;d===void 0&&(d=0);typeof b==="string"?(a=f.getLine(a).indexOf(b),a!==-1&&(j=a,d=j+b.length)):(j=b,b=f.getLineEnd(a)-g,j=Math.min(j,b),d=Math.min(d,b));this.moveSelection(g+j,g+d,e)}},onDirtyChanged:function(a){return this.dispatchEvent(a)}};
i.EventTarget.addMixin(e.prototype);if(!Function.prototype.bind)Function.prototype.bind=j;return{Editor:e}});
define("orion/editor/find","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/keyModes,orion/editor/annotations,orion/editor/regex,orion/objects,orion/util".split(","),function(g,k,i,f,d,a,e){function j(a){var b=a.getTextView();i.KeyMode.call(this,b);this.editor=a;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";b.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));b.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
var c=this;this._listener={onVerify:function(a){var b=c.editor,e=b.getModel(),f=b.mapOffset(a.start),b=b.mapOffset(a.end),e=e.getText(f,b);if((e=c._prefix.match(RegExp("^"+d.escape(e),"i")))&&e.length>0)c._prefix+=a.text,c._success=!0,c._status(),c.find(c._forward,!0),a.text=null},onSelection:function(){c._ignoreSelection||c.setActive(!1)}}}function c(a,b,c){if(a){this._editor=a;this._undoStack=b;this._showAll=!0;this._visible=!1;this._wrap=this._caseInsensitive=!0;this._wholeWord=!1;this._incremental=
!0;this._regex=!1;this._findAfterReplace=!0;this._reverse=this._hideAfterFind=!1;this._timer=this._end=this._start=void 0;this._lastString="";var d=this;this._listeners={onEditorFocus:function(a){d._removeCurrentAnnotation(a)}};this.setOptions(c)}}var b={};j.prototype=new i.KeyMode;a.mixin(j.prototype,{createKeyBindings:function(){var a=k.KeyBinding,b=[];b.push({actionID:"incrementalFindBackspace",keyBinding:new a(8)});b.push({actionID:"incrementalFindCancel",keyBinding:new a(13)});b.push({actionID:"incrementalFindCancel",
keyBinding:new a(27)});b.push({actionID:"incrementalFindReverse",keyBinding:new a(38)});b.push({actionID:"incrementalFind",keyBinding:new a(40)});b.push({actionID:"incrementalFindReverse",keyBinding:new a("k",!0,!0)});b.push({actionID:"incrementalFind",keyBinding:new a("k",!0)});return b},find:function(a,b){this._forward=a;if(!this.isActive())return this.setActive(!0),!1;var c=this._prefix;if(c.length===0)return!1;var d=this.editor,e=d.getModel(),e=a?this._success?b?this._start:d.getCaretOffset()+
1:0:this._success?b?this._start:d.getCaretOffset():e.getCharCount()-1;if(c=d.getModel().find({string:c,start:e,reverse:!a,caseInsensitive:c.toLowerCase()===c}).next()){if(!b)this._start=e;this._ignoreSelection=this._success=!0;d.moveSelection(a?c.start:c.end,a?c.end:c.start);this._ignoreSelection=!1}else this._success=!1;this._status();return!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(a){if(this._active!==a)this._active=a,this._prefix=
"",this._success=!0,a=this.editor.getTextView(),this._start=this.editor.getCaretOffset(),this.editor.setCaretOffset(this._start),this._active?(a.addEventListener("Verify",this._listener.onVerify),a.addEventListener("Selection",this._listener.onSelection),a.addKeyMode(this)):(a.removeEventListener("Verify",this._listener.onVerify),a.removeEventListener("Selection",this._listener.onSelection),a.removeKeyMode(this)),this._status()},_backspace:function(){var a=this._prefix,a=this._prefix=a.substring(0,
a.length-1);return a.length===0?(this._ignoreSelection=this._success=!0,this.editor.setCaretOffset(this.editor.getSelection().start),this._ignoreSelection=!1,this._status(),!0):this.find(this._forward,!0)},_status:function(){if(this.isActive()){var a;a=this._forward?this._success?g.incrementalFindStr:g.incrementalFindStrNotFound:this._success?g.incrementalFindReverseStr:g.incrementalFindReverseStrNotFound;a=e.formatMessage(a,this._prefix);this.editor.reportStatus(a,this._success?"":"error")}else this.editor.reportStatus("")}});
b.IncrementalFind=j;c.prototype={find:function(a,b,c){this.setOptions({reverse:!a});var d=this.getFindString(),e;if(b)d=b.findString||d,e=b.count;a=this.getOptions();this.setOptions(b);b=c?this._startOffset:this.getStartOffset();if((e=this._doFind(d,b,e))&&!c)this._startOffset=e.start;this.setOptions(a);this._hideAfterFind&&this.hide();return e},getStartOffset:function(){return this._start!==void 0?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var a=
this._editor.getSelection();return this._editor.getText(a.start,a.end)||this._lastString},getOptions:function(){return{showAll:this._showAll,caseInsensitive:this._caseInsensitive,wrap:this._wrap,wholeWord:this._wholeWord,incremental:this._incremental,regex:this._regex,findAfterReplace:this._findAfterReplace,hideAfterFind:this._hideAfterFind,reverse:this._reverse,findCallback:this._findCallback,start:this._start,end:this._end}},getReplaceString:function(){return""},hide:function(){this._visible=!1;
if(this._savedOptions&&(this.setOptions(this._savedOptions.pop()),this._savedOptions.length===0))this._savedOptions=null;this._removeAllAnnotations();this._editor.getTextView().removeEventListener("Focus",this._listeners.onEditorFocus);this._editor.getTextView().focus()},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var b=this._editor,c=this.getReplaceString(),d=b.getSelection().start;if(b=b.getModel().find({string:a,start:d,reverse:!1,wrap:this._wrap,
regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),this._doReplace(b.start,b.end,a,c),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var a=this.getFindString();if(a){this._replacingAll=!0;var b=this._editor,c=b.getTextView();b.reportStatus(g.replaceAll);var d=this.getReplaceString(),f=this;window.setTimeout(function(){for(var j=0,i=0;;){var k=f._doFind(a,j);if(!k)break;i++;i===1&&(c.setRedraw(!1),
f.startUndo());f._doReplace(k.start,k.end,a,d);j=f.getStartOffset()}i>0&&(f.endUndo(),c.setRedraw(!0));j>0?b.reportStatus(e.formatMessage(g.replacedMatches,i)):b.reportStatus(g.nothingReplaced,"error");f._replacingAll=!1},100)}},setOptions:function(a){if(a){if((a.showAll===!0||a.showAll===!1)&&this._showAll!==a.showAll)if(this._showAll=a.showAll,this.isVisible())if(this._showAll)this._markAllOccurrences();else{var b=this._editor.getAnnotationModel();b&&b.removeAnnotations(f.AnnotationType.ANNOTATION_MATCHING_SEARCH)}if(a.caseInsensitive===
!0||a.caseInsensitive===!1)this._caseInsensitive=a.caseInsensitive;if(a.wrap===!0||a.wrap===!1)this._wrap=a.wrap;if(a.wholeWord===!0||a.wholeWord===!1)this._wholeWord=a.wholeWord;if(a.incremental===!0||a.incremental===!1)this._incremental=a.incremental;if(a.regex===!0||a.regex===!1)this._regex=a.regex;if(a.findAfterReplace===!0||a.findAfterReplace===!1)this._findAfterReplace=a.findAfterReplace;if(a.hideAfterFind===!0||a.hideAfterFind===!1)this._hideAfterFind=a.hideAfterFind;if(a.reverse===!0||a.reverse===
!1)this._reverse=a.reverse;if(a.hasOwnProperty("findCallback"))this._findCallback=a.findCallback;if(a.hasOwnProperty("start"))this._start=a.start;if(a.hasOwnProperty("end"))this._end=a.end}},show:function(a){this._visible=!0;if(a){if(!this._savedOptions)this._savedOptions=[];this._savedOptions.push(this.getOptions());this.setOptions(a)}this._startOffset=this._editor.getSelection().start;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var b=this;window.setTimeout(function(){b._incremental&&
b.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_doFind:function(a,b,c){var c=c||1,d=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;for(var a=d.getModel().find({string:a,start:b,end:this._end,reverse:this._reverse,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}),e,b=0;b<c&&a.hasNext();b++)e=
a.next();if(!this._replacingAll){e?this._editor.reportStatus(""):this._editor.reportStatus(g.notFound,"error");if(this.isVisible()){c=f.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(a=d.getAnnotationModel())a.removeAnnotations(c),e&&a.addAnnotation(f.AnnotationType.createAnnotation(c,e.start,e.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var j=this;this._timer=window.setTimeout(function(){j._markAllOccurrences();j._timer=null},500)}}this._findCallback?this._findCallback(e):
e&&d.moveSelection(e.start,e.end,null,!1)}return e},_doReplace:function(a,b,c,d){var e=this._editor;if(this._regex&&(d=e.getText(a,b).replace(RegExp(c,this._caseInsensitive?"i":""),d),!d))return;e.setText(d,a,b);e.setSelection(a,a+d.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var b=f.AnnotationType.ANNOTATION_MATCHING_SEARCH,c=a.getAnnotations(0,a.getTextModel().getCharCount()),d=[],e;c.hasNext();){var g=c.next();g.type===b&&d.push(g)}if(this.isVisible()){c=
this.getFindString();c=this._editor.getModel().find({string:c,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(e=[];c.hasNext();)g=c.next(),e.push(f.AnnotationType.createAnnotation(b,g.start,g.end))}a.replaceAnnotations(d,e)}},_removeAllAnnotations:function(){var a=this._editor.getAnnotationModel();a&&(a.removeAnnotations(f.AnnotationType.ANNOTATION_CURRENT_SEARCH),a.removeAnnotations(f.AnnotationType.ANNOTATION_MATCHING_SEARCH))},_removeCurrentAnnotation:function(){var a=
this._editor.getAnnotationModel();a&&a.removeAnnotations(f.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};b.Find=c;return b});
define("orion/editor/actions","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/annotations,orion/editor/tooltip,orion/editor/find,orion/util".split(","),function(g,k,i,f,d,a){function e(a,c,e){this.editor=a;this.undoStack=c;this._incrementalFind=new d.IncrementalFind(a);this._find=e?e:new d.Find(a,c);this._lastEditLocation=null;this.init()}function j(a,c,d,e){this.editor=a;this.undoStack=c;this.contentAssist=d;this.linkedMode=e;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var c={};e.prototype={init:function(){var b=this.editor.getTextView();this._lastEditListener={onModelChanged:function(a){if(this.editor.isDirty())this._lastEditLocation=a.start+a.addedCharCount}.bind(this)};b.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);b.setAction("undo",function(){return this.undoStack?(this.undoStack.undo(),!0):!1}.bind(this),{name:g.undo});b.setAction("redo",function(){return this.undoStack?(this.undoStack.redo(),
!0):!1}.bind(this),{name:g.redo});b.setKeyBinding(new k.KeyBinding("f",!0),"find");b.setAction("find",function(){if(this._find){var a=this.editor.getSelection();(a=prompt(g.find,this.editor.getText(a.start,a.end)))&&this._find.find(!0,{findString:a})}}.bind(this),{name:g.find});b.setKeyBinding(new k.KeyBinding("k",!0),"findNext");b.setAction("findNext",function(a){return this._find?(this._find.find(!0,a),!0):!1}.bind(this),{name:g.findNext});b.setKeyBinding(new k.KeyBinding("k",!0,!0),"findPrevious");
b.setAction("findPrevious",function(a){return this._find?(this._find.find(!1,a),!0):!1}.bind(this),{name:g.findPrevious});b.setKeyBinding(new k.KeyBinding("j",!0),"incrementalFind");b.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:g.incrementalFind});b.setKeyBinding(new k.KeyBinding("j",!0,!0),"incrementalFindReverse");b.setAction("incrementalFindReverse",function(){this._incrementalFind&&this._incrementalFind.find(!1);return!0}.bind(this),
{name:g.incrementalFindReverse});b.setAction("tab",function(){return this.indentLines()}.bind(this));b.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:g.unindentLines});b.setKeyBinding(new k.KeyBinding(38,!1,!1,!0),"moveLinesUp");b.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:g.moveLinesUp});b.setKeyBinding(new k.KeyBinding(40,!1,!1,!0),"moveLinesDown");b.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:g.moveLinesDown});
b.setKeyBinding(new k.KeyBinding(38,!0,!1,!0),"copyLinesUp");b.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:g.copyLinesUp});b.setKeyBinding(new k.KeyBinding(40,!0,!1,!0),"copyLinesDown");b.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:g.copyLinesDown});b.setKeyBinding(new k.KeyBinding("d",!0,!1,!1),"deleteLines");b.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:g.deleteLines});b.setKeyBinding(new k.KeyBinding("l",
!a.isMac,!1,!1,a.isMac),"gotoLine");b.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:g.gotoLine});b.setKeyBinding(new k.KeyBinding(190,!0),"nextAnnotation");b.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:g.nextAnnotation});b.setKeyBinding(new k.KeyBinding(188,!0),"previousAnnotation");b.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:g.prevAnnotation});b.setKeyBinding(new k.KeyBinding("e",
!0,!1,!0,!1),"expand");b.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:g.expand});b.setKeyBinding(new k.KeyBinding("c",!0,!1,!0,!1),"collapse");b.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:g.collapse});b.setKeyBinding(new k.KeyBinding("e",!0,!0,!0,!1),"expandAll");b.setAction("expandAll",function(){return this.expandAnnotations(!0)}.bind(this),{name:g.expandAll});b.setKeyBinding(new k.KeyBinding("c",!0,!0,!0,!1),"collapseAll");
b.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:g.collapseAll});b.setKeyBinding(new k.KeyBinding("q",!a.isMac,!1,!1,a.isMac),"lastEdit");b.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:g.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),d=a.getSelection(),e=c.getLineAtOffset(d.start),d=c.getLineAtOffset(d.end>d.start?d.end-1:d.end),f=c.getLineStart(e),
e=c.getLineEnd(d,!0),g=c.getLineCount(),j="",f=c.getText(f,e);d===g-1&&(f=(j=c.getLineDelimiter())+f);a.setText(f,e,e);a.setSelection(e+j.length,e+f.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),d=a.getSelection(),e=c.getLineAtOffset(d.start),d=c.getLineAtOffset(d.end>d.start?d.end-1:d.end),e=c.getLineStart(e),f=c.getLineEnd(d,!0),g=c.getLineCount(),j="",f=c.getText(e,f);d===g-1&&(f+=j=c.getLineDelimiter());a.setText(f,
e,e);a.setSelection(e,e+f.length-j.length);return!0},deleteLines:function(a){var c=this.editor;if(c.getTextView().getOptions("readonly"))return!1;var d=1;if(a&&a.count)d=a.count;var e=c.getSelection(),f=c.getModel(),g=f.getLineAtOffset(e.start),a=f.getLineStart(g),d=e.start!==e.end||d===1?f.getLineAtOffset(e.end>e.start?e.end-1:e.end):Math.min(g+d-1,f.getLineCount()-1),d=f.getLineEnd(d,!0);c.setText("",a,d);return!0},expandAnnotation:function(a){var c=this.editor,d=c.getAnnotationModel();if(!d)return!0;
var e=c.getModel(),f=c.getCaretOffset(),g=e.getLineAtOffset(f),f=e.getLineStart(g),g=e.getLineEnd(g,!0);e.getBaseModel&&(f=e.mapOffset(f),g=e.mapOffset(g),e.getBaseModel());for(var j,e=d.getAnnotations(f,g);!j&&e.hasNext();)f=e.next(),f.type===i.AnnotationType.ANNOTATION_FOLDING&&(j=f);j&&a!==j.expanded&&(a?j.expand():(c.setCaretOffset(j.start),j.collapse()),d.modifyAnnotation(j));return!0},expandAnnotations:function(a){var c=this.editor,d=c.getTextView(),e=c.getAnnotationModel();if(!e)return!0;var c=
c.getModel(),f=e.getAnnotations(0,c.getCharCount());for(d.setRedraw(!1);f.hasNext();)c=f.next(),c.type===i.AnnotationType.ANNOTATION_FOLDING&&a!==c.expanded&&(a?c.expand():c.collapse(),e.modifyAnnotation(c));d.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,c=a.getTextView();if(c.getOptions("readonly"))return!1;if(c.getOptions("tabMode")){var d=a.getModel(),e=a.getSelection(),f=d.getLineAtOffset(e.start),g=d.getLineAtOffset(e.end>e.start?e.end-1:e.end);if(f!==g){var j=[];j.push("");
for(var i=f;i<=g;i++)j.push(d.getLine(i,!0));i=d.getLineStart(f);d=d.getLineEnd(g,!0);c=c.getOptions("tabSize","expandTab");c=c.expandTab?Array(c.tabSize+1).join(" "):"\t";a.setText(j.join(c),i,d);a.setSelection(i===e.start?e.start:e.start+c.length,e.end+(g-f+1)*c.length);return!0}return!1}},gotoLastEdit:function(){typeof this._lastEditLocation==="number"&&this.editor.showSelection(this._lastEditLocation);return!0},gotoLine:function(){var a=this.editor,c=a.getModel().getLineAtOffset(a.getCaretOffset());
if(c=prompt(g.gotoLinePrompty,c+1))c=parseInt(c,10),a.onGotoLine(c-1,0);return!0},moveLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),d=a.getSelection(),e=c.getLineAtOffset(d.start),f=c.getLineAtOffset(d.end>d.start?d.end-1:d.end),g=c.getLineCount();if(f===g-1)return!0;var e=c.getLineStart(e),d=c.getLineEnd(f,!0),j=c.getLineEnd(f+1,!0)-(d-e),i=0;f!==g-2?c=c.getText(e,d):(f=c.getLineEnd(f),c=c.getText(f,d)+c.getText(e,f),i+=d-f);this.startUndo();
a.setText("",e,d);a.setText(c,j,j);a.setSelection(j+i,j+i+c.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),d=a.getSelection(),e=c.getLineAtOffset(d.start);if(e===0)return!0;var f=c.getLineAtOffset(d.end>d.start?d.end-1:d.end),g=c.getLineCount(),d=c.getLineStart(e-1),j=c.getLineStart(e),i=c.getLineEnd(f,!0),k=c.getText(j,i),t=0;f===g-1&&(f=c.getLineEnd(e-1),e=c.getLineEnd(e-1,!0),k+=c.getText(f,e),j=f,
t=e-f);this.startUndo();a.setText("",j,i);a.setText(k,d,d);a.setSelection(d,d+k.length-t);this.endUndo();return!0},nextAnnotation:function(a){var c=this.editor,d=c.getAnnotationModel();if(!d)return!0;for(var e=c.getModel(),g=c.getCaretOffset(),d=d.getAnnotations(a?g:0,a?e.getCharCount():g),j=null;d.hasNext();){var k=d.next();if(a){if(k.start<=g)continue}else if(k.start>=g)continue;switch(k.type){case i.AnnotationType.ANNOTATION_ERROR:case i.AnnotationType.ANNOTATION_WARNING:case i.AnnotationType.ANNOTATION_TASK:case i.AnnotationType.ANNOTATION_BOOKMARK:break;
default:continue}j=k;if(a)break}if(j){var q=c.getTextView(),p=e.getLineAtOffset(j.start),t=f.Tooltip.getTooltip(q);if(!t)return c.moveSelection(j.start),!0;c.moveSelection(j.start,j.start,function(){t.setTarget({getTooltipInfo:function(){var a=q.convert({x:q.getLocationAtOffset(j.start).x,y:q.getLocationAtOffset(e.getLineStart(p)).y},"document","page");return{contents:[j],x:a.x,y:a.y+Math.floor(q.getLineHeight(p)*1.33)}}},0)})}return!0},unindentLines:function(){var a=this.editor,c=a.getTextView();
if(c.getOptions("readonly"))return!1;if(c.getOptions("tabMode")){for(var d=a.getModel(),e=a.getSelection(),f=d.getLineAtOffset(e.start),g=d.getLineAtOffset(e.end>e.start?e.end-1:e.end),j=c.getOptions("tabSize"),i=Array(j+1).join(" "),k=[],t=c=0,o=f;o<=g;o++){var v=d.getLine(o,!0);if(d.getLineStart(o)!==d.getLineEnd(o))if(v.indexOf("\t")===0)v=v.substring(1),c++;else if(v.indexOf(i)===0)v=v.substring(j),c+=j;else return!0;o===f&&(t=c);k.push(v)}f=d.getLineStart(f);j=d.getLineEnd(g,!0);d=d.getLineStart(g);
a.setText(k.join(""),f,j);g=f===e.start?e.start:e.start-t;e=Math.max(g,e.end-c+(e.end===d+1&&e.start!==e.end?1:0));a.setSelection(g,e);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};c.TextActions=e;j.prototype={init:function(){var b=this.editor.getTextView();b.setAction("lineStart",function(){return this.lineStart()}.bind(this));b.setAction("enter",function(){return this.autoIndent()}.bind(this));
b.setKeyBinding(new k.KeyBinding(191,!0),"toggleLineComment");b.setAction("toggleLineComment",function(){return this.toggleLineComment()}.bind(this),{name:g.toggleLineComment});b.setKeyBinding(new k.KeyBinding(191,!0,!a.isMac,!1,a.isMac),"addBlockComment");b.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:g.addBlockComment});b.setKeyBinding(new k.KeyBinding(220,!0,!a.isMac,!1,a.isMac),"removeBlockComment");b.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),
{name:g.removeBlockComment})},autoIndent:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getSelection();if(c.start===c.end){for(var d=a.getModel(),e=d.getLineAtOffset(c.start),f=d.getLine(e,!0),g=d.getLineStart(e),e=0,g=c.start-g,j;e<g&&((j=f.charCodeAt(e))===32||j===9);)e++;if(e>0){for(var i=f.substring(0,e),e=g;e<f.length&&((j=f.charCodeAt(e++))===32||j===9);)c.end++;a.setText(d.getLineDelimiter()+i,c.start,c.end);return!0}}return!1},addBlockComment:function(){var a=
this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),d=a.getSelection(),e=this._findEnclosingComment(c,d.start,d.end);if(e.commentStart!==void 0&&e.commentEnd!==void 0)return!0;c=c.getText(d.start,d.end);if(c.length===0)return!0;var e=c.length,c=c.replace(/\/\*|\*\//g,""),f=c.length;a.setText("/*"+c+"*/",d.start,d.end);a.setSelection(d.start+2,d.end+2+(f-e));return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&a.positions.length>0&&this.linkedMode){for(var c=
[],d=0;d<a.positions.length;++d)c[d]={positions:[{offset:a.positions[d].offset,length:a.positions[d].length}]};this.linkedMode.enterLinkedMode({groups:c,escapePosition:a.escapePosition})}else a.groups&&a.groups.length>0&&this.linkedMode?this.linkedMode.enterLinkedMode({groups:a.groups,escapePosition:a.escapePosition}):a.escapePosition&&this.editor.getTextView().setCaretOffset(a.escapePosition);return!0},_findEnclosingComment:function(a,c,d){var e=a.getLineAtOffset(c),f=a.getLineAtOffset(d),g,j,i,
k,t,o;for(g=e;g>=0;g--)if(j=a.getLine(g),i=g===e?c-a.getLineStart(e):j.length,k=j.lastIndexOf("/*",i),j=j.lastIndexOf("*/",i),j>k)break;else if(k!==-1){t=a.getLineStart(g)+k;break}for(g=f;g<a.getLineCount();g++)if(j=a.getLine(g),i=g===f?d-a.getLineStart(f):0,k=j.indexOf("/*",i),j=j.indexOf("*/",i),k!==-1&&k<j)break;else if(j!==-1){o=a.getLineStart(g)+j;break}return{commentStart:t,commentEnd:o}},lineStart:function(){for(var a=this.editor,c=a.getModel(),d=a.getCaretOffset(),e=c.getLineAtOffset(d),f=
c.getLineStart(e),c=c.getLine(e),e=0;e<c.length;e++){var g=c.charCodeAt(e);if(!(g===32||g===9))break}e+=f;return d!==e?(a.setSelection(e,e),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var c=a.getModel(),d=a.getSelection(),e=c.getText(d.start,d.end),f,g,j;for(j=0;j<e.length;j++)if(e.substring(j,j+2)==="/*"){f=d.start+j;break}for(;j<e.length;j++)if(e.substring(j,j+2)==="*/"){g=d.start+j;break}if(f!==void 0&&g!==void 0)a.setText(c.getText(f+
2,g),f,g+2),a.setSelection(f,g);else{e=this._findEnclosingComment(c,d.start,d.end);if(e.commentStart===void 0||e.commentEnd===void 0)return!0;c=c.getText(e.commentStart+2,e.commentEnd);a.setText(c,e.commentStart,e.commentEnd+2);a.setSelection(d.start-2,d.end-2)}return!0},toggleLineComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;for(var c=a.getModel(),d=a.getSelection(),e=c.getLineAtOffset(d.start),f=c.getLineAtOffset(d.end>d.start?d.end-1:d.end),g=!0,j=[],i,
k,t=e;t<=f;t++)if(i=c.getLine(t,!0),j.push(i),!g||(k=i.indexOf("//"))===-1)g=!1;else if(k!==0){var o;for(o=0;o<k;o++)if(g=i.charCodeAt(o),!(g===32||g===9))break;g=o===k}t=c.getLineStart(e);o=c.getLineEnd(f,!0);if(g){for(g=0;g<j.length;g++)i=j[g],k=i.indexOf("//"),j[g]=i.substring(0,k)+i.substring(k+2);j=j.join("");i=c.getLineStart(f);c=t===d.start?d.start:d.start-2;d=d.end-2*(f-e+1)+(d.end===i+1?2:0)}else j.splice(0,0,""),j=j.join("//"),c=t===d.start?d.start:d.start+2,d=d.end+2*(f-e+1);a.setText(j,
t,o);a.setSelection(c,d);return!0},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};c.SourceCodeActions=j;return c});
define("orion/editor/undoStack",[],function(){function g(f,d,a){this.offset=f;this.text=d;this.previousText=a}function k(f){this.owner=f;this.changes=[]}function i(f,d){this.view=f;this.size=d!==void 0?d:100;this.reset();var a=f.getModel();a.getBaseModel&&(a=a.getBaseModel());this.model=a;var e=this;this._listener={onChanging:function(a){e._onChanging(a)},onDestroy:function(a){e._onDestroy(a)}};a.addEventListener("Changing",this._listener.onChanging);f.addEventListener("Destroy",this._listener.onDestroy)}
g.prototype={undo:function(f,d){this._doUndoRedo(this.offset,this.previousText,this.text,f,d);return!0},redo:function(f,d){this._doUndoRedo(this.offset,this.text,this.previousText,f,d);return!0},_doUndoRedo:function(f,d,a,e,g){var c=e.getModel();if(c.mapOffset&&e.annotationModel){var b=c.mapOffset(f,!0);if(b<0)for(var h=e.annotationModel.getAnnotations(f,f+1);h.hasNext();){var i=h.next();if(i.type==="orion.annotation.folding"){i.expand();b=c.mapOffset(f,!0);break}}if(b<0)return;f=b}c.setText(d,f,
f+a.length);g&&e.setSelection(f,f+d.length)}};k.prototype={add:function(f){this.changes.push(f)},end:function(f){this.endSelection=f.getSelection();this.endCaret=f.getCaretOffset();(f=this.owner)&&f.end&&f.end()},undo:function(f,d){this.changes.length>1&&f.setRedraw(!1);for(var a=this.changes.length-1;a>=0;a--)this.changes[a].undo(f,!1);this.changes.length>1&&f.setRedraw(!0);if(d){var a=this.startSelection.start,e=this.startSelection.end;f.setSelection(this.startCaret?a:e,this.startCaret?e:a)}(a=
this.owner)&&a.undo&&a.undo();return this.changes.length>0},redo:function(f,d){this.changes.length>1&&f.setRedraw(!1);for(var a=0;a<this.changes.length;a++)this.changes[a].redo(f,!1);this.changes.length>1&&f.setRedraw(!0);if(d){var a=this.endSelection.start,e=this.endSelection.end;f.setSelection(this.endCaret?a:e,this.endCaret?e:a)}(a=this.owner)&&a.redo&&a.redo();return this.changes.length>0},start:function(f){this.startSelection=f.getSelection();this.startCaret=f.getCaretOffset();(f=this.owner)&&
f.start&&f.start()}};i.prototype={add:function(f){this.compoundChange?this.compoundChange.add(f):(this.stack.splice(this.index,this.stack.length-this.index,f),this.index++,this.stack.length>this.size&&(this.stack.shift(),this.index--,this.cleanIndex--))},markClean:function(){this.endCompoundChange();this._commitUndo();this.cleanIndex=this.index},isClean:function(){return this.cleanIndex===this.getSize().undo},canUndo:function(){return this.getSize().undo>0},canRedo:function(){return this.getSize().redo>
0},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=void 0},getSize:function(){var f=this.index,d=this.stack.length;this._undoStart!==void 0&&f++;return{undo:f,redo:d-f}},undo:function(){this._commitUndo();var f;f=!1;this._ignoreUndo=!0;do{if(this.index<=0)break;f=this.stack[--this.index]}while(!(f=f.undo(this.view,!0)));this._ignoreUndo=!1;return f},redo:function(){this._commitUndo();var f;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;
f=this.stack[this.index++]}while(!f.redo(this.view,!0));this._ignoreUndo=!1;return!0},reset:function(){this.index=this.cleanIndex=0;this.stack=[];this._undoStart=void 0;this._undoText="";this._undoType=0;this._ignoreUndo=!1;this._compoundChange=void 0},startCompoundChange:function(f){this._commitUndo();f=new k(f);this.add(f);this.compoundChange=f;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){if(this._undoStart!==void 0)this._undoType===-1?this.add(new g(this._undoStart,
"",this._undoText)):this.add(new g(this._undoStart,this._undoText,"")),this._undoStart=void 0,this._undoText="",this._undoType=0;this.endCompoundChange()},_onDestroy:function(){this.model.removeEventListener("Changing",this._listener.onChanging);this.view.removeEventListener("Destroy",this._listener.onDestroy)},_onChanging:function(f){var d=f.text,a=f.start,e=f.removedCharCount,f=f.addedCharCount;if(!this._ignoreUndo){this._undoStart!==void 0&&!(f===1&&e===0&&this._undoType===1&&a===this._undoStart+
this._undoText.length||f===0&&e===1&&this._undoType===-1&&(a+1===this._undoStart||a===this._undoStart))&&this._commitUndo();if(!this.compoundChange)if(f===1&&e===0){if(this._undoStart===void 0)this._undoStart=a;this._undoText+=d;this._undoType=1;return}else if(f===0&&e===1){d=this._undoText.length>0&&this._undoStart===a;this._undoStart=a;this._undoType=-1;d?this._undoText+=this.model.getText(a,a+e):this._undoText=this.model.getText(a,a+e)+this._undoText;return}this.add(new g(a,d,this.model.getText(a,
a+e)))}}};return{UndoStack:i}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(g,k,i,f){function d(a,c,d,e){this._location=c||"left";this._overview=d||"page";this._rulerStyle=e;this._view=null;var f=this;this._listener={onTextModelChanged:function(a){f._onTextModelChanged(a)},onAnnotationModelChanged:function(a){f._onAnnotationModelChanged(a)}};this.setAnnotationModel(a)}function a(a,c,e,f,g){d.call(this,a,c,"page",e);this._oddStyle=f||{style:{backgroundColor:"white"}};
this._evenStyle=g||{style:{backgroundColor:"white"}};this._numOfDigits=0}function e(a,c,e){d.call(this,a,c,"page",e)}function j(a,c,e){d.call(this,a,c,"document",e)}function c(a,c,d){e.call(this,a,c,d)}d.prototype={getAnnotations:function(a,c){var d=this._annotationModel;if(!d)return[];var e=this._view.getModel(),f=e.getLineStart(a),g=e.getLineEnd(c-1),j=e;e.getBaseModel&&(j=e.getBaseModel(),f=e.mapOffset(f),g=e.mapOffset(g));for(var i=[],d=this.getAnnotationsByType(d,f,g),f=0;f<d.length;f++)for(var g=
d[f],k=j.getLineAtOffset(g.start),t=j.getLineAtOffset(Math.max(g.start,g.end-1)),o=k;o<=t;o++){var v=o;if(e!==j){v=j.getLineStart(o);v=e.mapOffset(v,!0);if(v===-1)continue;v=e.getLineAtOffset(v)}if(a<=v&&v<c){var z=this._mergeAnnotation(i[v],g,o-k,t-k+1);z&&(i[v]=z)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var u in i)i[u]._multiple&&(i[u].html+=this._multiAnnotationOverlay.html);return i},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(a){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=a)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(a){this._multiAnnotation=a},setMultiAnnotationOverlay:function(a){this._multiAnnotationOverlay=
a},setView:function(a){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=a;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(a){if(a!==void 0){var c=this._view,d=c.getModel(),e=d,f=d.getLineStart(a),g=f,j=this._annotationModel;if(j){g=c.getSelection();c=Math.max(g.start,g.end);g=d.getLineEnd(a,!0);f<=c&&c<d.getLineEnd(a)&&(f=c+1);d.getBaseModel&&
(f=d.mapOffset(f),g=d.mapOffset(g),e=d.getBaseModel());for(var k,a=j.getAnnotations(f,g);!k&&a.hasNext();)g=a.next(),this.isAnnotationTypeVisible(g.type)&&(k=g);k&&e.getLineAtOffset(k.start)===e.getLineAtOffset(f)?(f=k.start,g=k.end):g=f;d.getBaseModel&&(f=d.mapOffset(f,!0),g=d.mapOffset(g,!0))}(d=i.Tooltip.getTooltip(this._view))&&d.setTarget(null);this._view.setSelection(g,f,1/3,function(){})}},onDblClick:function(){},onMouseMove:function(a,c){var d=i.Tooltip.getTooltip(this._view);if(d&&!(d.isVisible()&&
this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var e=this;d.setTarget({y:c.clientY,getTooltipInfo:function(){return e._getTooltipInfo(e._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,c){this.onMouseMove(a,c)},onMouseOut:function(){var a=i.Tooltip.getTooltip(this._view);a&&a.setTarget(null)},_getTooltipInfo:function(a,c){if(a!==void 0){var d=this._view,e=d.getModel(),f=this._annotationModel,g=[];if(f){var g=e.getLineStart(a),j=e.getLineEnd(a);e.getBaseModel&&(g=e.mapOffset(g),j=e.mapOffset(j));
g=this.getAnnotationsByType(f,g,j)}f=this._getTooltipContents(a,g);if(!f)return null;f={contents:f,anchor:this.getLocation()};g=d.getClientArea();g.y=this.getOverview()==="document"?d.convert({y:c},"view","document").y:d.getLocationAtOffset(e.getLineStart(a)).y;d.convert(g,"document","page");f.x=g.x;f.y=g.y;f.anchor==="right"&&(f.x+=g.width);return f}},_getTooltipContents:function(a,c){return c},_onAnnotationModelChanged:function(a){function c(a){for(var b=0;b<a.length;b++)if(f.isAnnotationTypeVisible(a[b].type)){var g=
a[b].start,h=a[b].end;e.getBaseModel&&(g=e.mapOffset(g,!0),h=e.mapOffset(h,!0));g!==-1&&h!==-1&&d.redrawLines(e.getLineAtOffset(g),e.getLineAtOffset(Math.max(g,h-1))+1,f)}}var d=this._view;if(d){var e=d.getModel(),f=this,g=e.getLineCount();a.textModelChangedEvent?(a=a.textModelChangedEvent.start,e.getBaseModel&&(a=e.mapOffset(a,!0)),a=e.getLineAtOffset(a),d.redrawLines(a,g,f)):(c(a.added),c(a.removed),c(a.changed))}},_mergeAnnotation:function(a,c,d){a||(a={});if(d===0)if(a.html&&c.html){if(c.html!==
a.html&&!a._multiple&&this._multiAnnotation)a.html=this._multiAnnotation.html;a._multiple=!0}else a.html=c.html;a.style=this._mergeStyle(a.style,c.style);return a},_mergeStyle:function(a,c){if(c){a||(a={});a.styleClass&&c.styleClass&&a.styleClass!==c.styleClass?a.styleClass+=" "+c.styleClass:a.styleClass=c.styleClass;var d;if(c.style){if(!a.style)a.style={};for(d in c.style)a.style[d]||(a.style[d]=c.style[d])}if(c.attributes){if(!a.attributes)a.attributes={};for(d in c.attributes)a.attributes[d]||
(a.attributes[d]=c.attributes[d])}}return a}};k.AnnotationTypeList.addMixin(d.prototype);a.prototype=new d;a.prototype.getAnnotations=function(a,c){for(var e=d.prototype.getAnnotations.call(this,a,c),f=this._view.getModel(),g=a;g<c;g++){var j=g&1?this._oddStyle:this._evenStyle,i=g;f.getBaseModel&&(i=f.getLineStart(i),i=f.getBaseModel().getLineAtOffset(f.mapOffset(i)));e[g]||(e[g]={});e[g].html=i+1+"";if(!e[g].style)e[g].style=j}return e};a.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();
return this.getAnnotations(a-1,a)[a-1]};a.prototype._onTextModelChanged=function(a){var a=a.start,c=this._view.getModel(),d=((c.getBaseModel?c.getBaseModel().getLineCount():c.getLineCount())+"").length;if(this._numOfDigits!==d)this._numOfDigits=d,this._view.redrawLines(c.getLineAtOffset(a),c.getLineCount(),this)};e.prototype=new d;j.prototype=new d;j.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};j.prototype._getTooltipContents=
function(a,c){if(c.length===0){var e=this._view.getModel(),j=a;e.getBaseModel&&(j=e.getLineStart(j),j=e.getBaseModel().getLineAtOffset(e.mapOffset(j)));return f.formatMessage(g.line,j+1)}return d.prototype._getTooltipContents.call(this,a,c)};j.prototype._mergeAnnotation=function(a,c,d,e){if(d===0){if(!a)a={html:"&nbsp;",style:{style:{height:3*e+"px"}}},a.style=this._mergeStyle(a.style,c.overviewStyle);return a}};c.prototype=new e;c.prototype.onClick=function(a){if(a!==void 0){var c=this._annotationModel;
if(c){var d=this._view.getModel(),e=d.getLineStart(a),a=d.getLineEnd(a,!0);d.getBaseModel&&(e=d.mapOffset(e),a=d.mapOffset(a),d=d.getBaseModel());for(var f,c=c.getAnnotations(e,a);!f&&c.hasNext();)a=c.next(),this.isAnnotationTypeVisible(a.type)&&(f=a);f&&d.getLineAtOffset(f.start)===d.getLineAtOffset(e)&&((d=i.Tooltip.getTooltip(this._view))&&d.setTarget(null),f.expanded?f.collapse():f.expand(),this._annotationModel.modifyAnnotation(f))}}};c.prototype._getTooltipContents=function(a,c){return c.length===
1&&c[0].expanded?null:e.prototype._getTooltipContents.call(this,a,c)};c.prototype._onAnnotationModelChanged=function(a){function c(a){for(j=0;j<a.length;j++)if(g.isAnnotationTypeVisible(a[j].type)){var b=a[j].start;f.getBaseModel&&(b=f.mapOffset(b,!0));b!==-1&&(k=Math.min(k,f.getLineAtOffset(b)))}}if(a.textModelChangedEvent)e.prototype._onAnnotationModelChanged.call(this,a);else{var d=this._view;if(d){var f=d.getModel(),g=this,j,i=f.getLineCount(),k=i;c(a.added);c(a.removed);c(a.changed);a=d.getRulers();
for(j=0;j<a.length;j++)d.redrawLines(k,i,a[j])}}};return{Ruler:d,AnnotationRuler:e,LineNumberRuler:a,OverviewRuler:j,FoldingRuler:c}});
define("orion/editor/textDND",[],function(){function g(g,i){this._view=g;this._undoStack=i;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var f=this;this._listener={onDragStart:function(d){f._onDragStart(d)},onDragEnd:function(d){f._onDragEnd(d)},onDragEnter:function(d){f._onDragEnter(d)},onDragOver:function(d){f._onDragOver(d)},onDrop:function(d){f._onDrop(d)},onDestroy:function(d){f._onDestroy(d)}};g.addEventListener("DragStart",this._listener.onDragStart);g.addEventListener("DragEnd",
this._listener.onDragEnd);g.addEventListener("DragEnter",this._listener.onDragEnter);g.addEventListener("DragOver",this._listener.onDragOver);g.addEventListener("Drop",this._listener.onDrop);g.addEventListener("Destroy",this._listener.onDestroy)}g.prototype={destroy:function(){var g=this._view;if(g)g.removeEventListener("DragStart",this._listener.onDragStart),g.removeEventListener("DragEnd",this._listener.onDragEnd),g.removeEventListener("DragEnter",this._listener.onDragEnter),g.removeEventListener("DragOver",
this._listener.onDragOver),g.removeEventListener("Drop",this._listener.onDrop),g.removeEventListener("Destroy",this._listener.onDestroy),this._view=null},_onDestroy:function(){this.destroy()},_onDragStart:function(g){var i=this._view,f=i.getSelection(),i=i.getModel();if(i.getBaseModel)f.start=i.mapOffset(f.start),f.end=i.mapOffset(f.end),i=i.getBaseModel();if(i=i.getText(f.start,f.end))this._dragSelection=f,g.event.dataTransfer.effectAllowed="copyMove",g.event.dataTransfer.setData("Text",i)},_onDragEnd:function(g){var i=
this._view;if(this._dragSelection){this._undoStack&&this._undoStack.startCompoundChange();(g=g.event.dataTransfer.dropEffect==="move")&&i.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var f=this._dropText,d=this._dropOffset;if(g)if(d>=this._dragSelection.end)d-=this._dragSelection.end-this._dragSelection.start;else if(d>=this._dragSelection.start)d=this._dragSelection.start;i.setText(f,d,d);i.setSelection(d,d+f.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&
this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(g){this._onDragOver(g)},_onDragOver:function(g){var i=g.event.dataTransfer.types;if(i){var f=!this._view.getOptions("readonly");f&&(f=i.contains?i.contains("text/plain"):i.indexOf("text/plain")!==-1);if(!f)g.event.dataTransfer.dropEffect="none"}},_onDrop:function(g){var i=this._view,f=g.event.dataTransfer.getData("Text");if(f)g=i.getOffsetAtLocation(g.x,g.y),this._dragSelection?(this._dropOffset=g,this._dropText=f):
(i.setText(f,g,g),i.setSelection(g,g+f.length))}};return{TextDND:g}});
define("orion/editor/templates",[],function(){function g(g,f,d){this.prefix=g;this.description=f;this.template=d;this._parse()}function k(g,f){this._keywords=g||[];this._templates=[];this.addTemplates(f||[])}g.prototype={getProposal:function(g,f,d){var g=f-g.length,f={},a,e=d.delimiter!==void 0?d.delimiter:"\n";d.indentation&&(e+=d.indentation);for(var j=d.tab!==void 0?d.tab:"\t",c=0,b=this.variables,h=this.segments,d=[],k=0;k<h.length;k++){var n=h[k],m=b[n];if(m!==void 0)switch(n){case "${tab}":n=
j;break;case "${delimiter}":n=e;break;case "${cursor}":n="";a=c;break;default:var s=f[n];s||(s=f[n]={data:m.data,positions:[]});n=m.substitution;s.data&&s.data.values&&(n=s.data.values[0]);s.positions.push({offset:g+c,length:n.length})}d.push(n);c+=n.length}var e=[],r;for(r in f)f.hasOwnProperty(r)&&e.push(f[r]);d=d.join("");if(a===void 0)a=d.length;return{proposal:d,description:this.description,groups:e,escapePosition:g+a}},match:function(g){return this.prefix.indexOf(g)===0},_parse:function(){var g=
this.template,f=[],d={},a,e=0,g=g.replace(/\n/g,"${delimiter}"),g=g.replace(/\t/g,"${tab}");g.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(j,c,b){var h=j.substring(2,j.length-1),c=j,k=h,n=null,m=k.indexOf(":");m!==-1&&(k=k.substring(0,m),c="${"+k+"}",n=JSON.parse(h.substring(m+1).replace("\\}","}").trim()));(h=d[c])||(h=d[c]={});h.substitution=k;if(n)h.data=n;(a=g.substring(e,b))&&f.push(a);f.push(c);e=b+j.length;return k});(a=g.substring(e,g.length))&&f.push(a);this.segments=f;this.variables=d}};
k.prototype={addTemplates:function(i){for(var f=this.getTemplates(),d=0;d<i.length;d++)f.push(new g(i[d].prefix,i[d].description,i[d].template))},computeProposals:function(g,f,d){var a=this.getPrefix(g,f,d),e=[];if(!this.isValid(a,g,f,d))return e;e=e.concat(this.getTemplateProposals(a,f,d));return e=e.concat(this.getKeywordProposals(a))},getKeywords:function(){return this._keywords},getKeywordProposals:function(g){var f=[],d=this.getKeywords();if(d)for(var a=0;a<d.length;a++)d[a].indexOf(g)===0&&
f.push({proposal:d[a].substring(g.length),description:d[a]});return f},getPrefix:function(g,f,d){return d.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(g,f,d){for(var a=[],e=this.getTemplates(),j=0;j<e.length;j++){var c=e[j];c.match(g)&&(c=c.getProposal(g,f,d),this.removePrefix(g,c),a.push(c))}return a},removePrefix:function(g,f){if(!(f.overwrite=f.proposal.substring(0,g.length)!==g))f.proposal=f.proposal.substring(g.length)},isValid:function(){return!0}};return{Template:g,
TemplateContentAssist:k}});
define("orion/editor/linkedMode","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/keyModes,orion/editor/annotations,orion/editor/templates,orion/objects,orion/util".split(","),function(g,k,i,f,d,a){function e(a,b,d){var e=a.getTextView();i.KeyMode.call(this,e);this.editor=a;this.undoStack=b;this.contentAssist=d;this.linkedModeModel=null;e.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));e.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);return!0}.bind(this));
e.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));e.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(a.selectedGroupIndex>0?a.selectedGroupIndex-1:a.groups.length-1);return!0}.bind(this));this.linkedModeListener={onActivating:function(){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),this.contentAssist.setProgress(null))}.bind(this),
onModelChanged:function(a){if(!this.ignoreVerify){for(var b=this.linkedModeModel,c,d;b;)if(c=this._getPositionChanged(b,a.start,a.start+a.removedCharCount),d=c.position,d===void 0||d.model!==b)this.exitLinkedMode(!1),b=this.linkedModeModel;else break;if(b){b=0;d=a.addedCharCount-a.removedCharCount;c=c.positions;for(var e,f,g=0;g<c.length;++g){f=c[g];e=f.position;var h=e.offset<=a.start&&a.start<=e.offset+e.length;h&&!f.ansestor?(e.offset+=b,e.length+=d,b+=d):(e.offset+=b,f.ansestor&&h&&(e.length+=
d));if(f.escape)f.model.escapePosition=e.offset}this._updateAnnotations(c)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var b=this.linkedModeModel,c,d;b;)if(c=this._getPositionChanged(b,a.start,a.end),d=c.position,d===void 0||d.model!==b)this.exitLinkedMode(!1),b=this.linkedModeModel;else break;if(b){var e=this._compoundChange;e?e.owner.model===b&&e.owner.group===d.group||(this.endUndo(),this.startUndo()):this.startUndo();b.selectedGroupIndex=d.group;var e=0,f=a.text.length-(a.end-
a.start);c=c.positions;for(var g,h,j=a.start-d.position.offset,i=a.end-d.position.offset,k=0;k<c.length;++k)if(h=c[k],g=h.position,h.oldOffset=g.offset,h.model===b&&h.group===d.group?(g.offset+=e,g.length+=f,e+=f):(g.offset+=e,h.ansestor&&(g.length+=d.count*f)),h.escape)h.model.escapePosition=g.offset;this.ignoreVerify=!0;e=this.editor.getTextView();for(k=c.length-1;k>=0;k--)h=c[k],h.model===b&&h.group===d.group&&e.setText(a.text,h.oldOffset+j,h.oldOffset+i);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(c)}}}.bind(this)}}
var j={};e.prototype=new i.KeyMode;a.mixin(e.prototype,{createKeyBindings:function(){var a=k.KeyBinding,b=[];b.push({actionID:"linkedModeEnter",keyBinding:new a(13)});b.push({actionID:"linkedModeCancel",keyBinding:new a(27)});b.push({actionID:"linkedModeNextGroup",keyBinding:new a(9)});b.push({actionID:"linkedModePreviousGroup",keyBinding:new a(9,!1,!0)});return b},enterLinkedMode:function(a){if(!this.linkedModeModel){var b=this.editor.getTextView();b.addKeyMode(this);b.addEventListener("Verify",
this.linkedModeListener.onVerify);b.addEventListener("ModelChanged",this.linkedModeListener.onModelChanged);this.contentAssist.addEventListener("Activating",this.linkedModeListener.onActivating);this.editor.reportStatus(g.linkedModeEntered,null,!0)}this._sortedPositions=null;if(this.linkedModeModel)a.previousModel=this.linkedModeModel,a.parentGroup=this.linkedModeModel.selectedGroupIndex,this.linkedModeModel.nextModel=a;this.linkedModeModel=a;this.selectLinkedGroup(0)},exitLinkedMode:function(a){if(this.isActive()){if(this._compoundChange)this.endUndo(),
this._compoundChange=null;this._sortedPositions=null;var b=this.linkedModeModel;this.linkedModeModel=b.previousModel;b.parentGroup=b.previousModel=void 0;if(this.linkedModeModel)this.linkedModeModel.nextModel=void 0;if(!this.linkedModeModel){var d=this.editor.getTextView();d.removeKeyMode(this);d.removeEventListener("Verify",this.linkedModeListener.onVerify);d.removeEventListener("ModelChanged",this.linkedModeListener.onModelChanged);var e=this.contentAssist;e.removeEventListener("Activating",this.linkedModeListener.onActivating);
e.offset=void 0;this.editor.reportStatus(g.linkedModeExited,null,!0);a&&d.setCaretOffset(b.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var a=this,b=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:b,group:b.selectedGroupIndex,end:function(){a._compoundChange=null}})}},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},
selectLinkedGroup:function(a){var b=this.linkedModeModel;if(b){b.selectedGroupIndex=a;var a=b.groups[a],e=a.positions[0],f=this.editor.getTextView();f.setSelection(e.offset,e.offset+e.length);if(b=this.contentAssist)if(b.offset=void 0,a.data&&a.data.type==="link"&&a.data.values)(this._groupContentAssistProvider=new d.TemplateContentAssist(a.data.values)).getPrefix=function(){var a=f.getSelection();return a.start===a.end&&(a=f.getCaretOffset(),e.offset<=a&&a<=e.offset+e.length)?f.getText(e.offset,
a):""},b.offset=e.offset,b.deactivate(),b.activate();else if(this._groupContentAssistProvider)this._groupContentAssistProvider=null,b.deactivate()}this._updateAnnotations()},_getModelPositions:function(a,b,d){for(var e=b.groups,f=0;f<e.length;f++)for(var g=e[f].positions,j=0;j<g.length;j++){var i=g[j];d&&(i={offset:i.offset+d,length:i.length});i={index:j,group:f,count:g.length,model:b,position:i};a.push(i);if(b.nextModel&&b.nextModel.parentGroup===f)i.ansestor=!0,this._getModelPositions(a,b.nextModel,
(d||0)+g[j].offset-g[0].offset)}},_getSortedPositions:function(a){var b=this._sortedPositions;if(!b){for(b=[];a.previousModel;)a=a.previousModel;for(this._getModelPositions(b,a);a;)a.escapePosition!==void 0&&b.push({escape:!0,model:a,position:{offset:a.escapePosition,length:0}}),a=a.nextModel;b.sort(function(a,b){return a.position.offset-b.position.offset});this._sortedPositions=b}return b},_getPositionChanged:function(a,b,d){for(var e,a=this._getSortedPositions(a),f=a.length-1;f>=0;f--){var g=a[f].position;
if(g.offset<=b&&d<=g.offset+g.length){e=a[f];break}}return{position:e,positions:a}},_updateAnnotations:function(a){var b=this.editor.getAnnotationModel();if(b){for(var d=[],e=[],g=b.getTextModel(),g=b.getAnnotations(0,g.getCharCount()),j;g.hasNext();)switch(j=g.next(),j.type){case f.AnnotationType.ANNOTATION_LINKED_GROUP:case f.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case f.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:d.push(j)}if(g=this.linkedModeModel)for(var a=a||this._getSortedPositions(g),
i=0;i<a.length;i++)if(j=a[i],j.model===g){var k=f.AnnotationType.ANNOTATION_LINKED_GROUP;j.group===g.selectedGroupIndex&&(k=j.index===0?f.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:f.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);j=j.position;j=f.AnnotationType.createAnnotation(k,j.offset,j.offset+j.length,"");e.push(j)}b.replaceAnnotations(d,e)}}});j.LinkedMode=e;return j});
define("orion/editor/factories","orion/editor/actions,orion/editor/undoStack,orion/editor/rulers,orion/editor/annotations,orion/editor/textDND,orion/editor/linkedMode".split(","),function(g,k,i,f,d,a){function e(){}function j(){}function c(){}function b(){}function h(){}function l(){}var n={};e.prototype={createKeyBindings:function(b,c,d,e){var e=new g.TextActions(b,c,e),f=new a.LinkedMode(b,c,d),b=new g.SourceCodeActions(b,c,d,f);return{textActions:e,linkedMode:f,sourceCodeActions:b}}};n.KeyBindingsFactory=
e;j.prototype={createUndoStack:function(a){a=a.getTextView();return new k.UndoStack(a,200)}};n.UndoFactory=j;c.prototype={createLineNumberRuler:function(a){return new i.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};n.LineNumberRulerFactory=c;b.prototype={createFoldingRuler:function(a){return new i.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};n.FoldingRulerFactory=b;h.prototype={createAnnotationModel:function(a){return new f.AnnotationModel(a)},
createAnnotationStyler:function(a,b){return new f.AnnotationStyler(a,b)},createAnnotationRulers:function(a){var b=new i.AnnotationRuler(a,"left",{styleClass:"ruler annotations"}),a=new i.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};n.AnnotationFactory=h;l.prototype={createTextDND:function(a,b){return new d.TextDND(a.getTextView(),b)}};n.TextDNDFactory=l;return n});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode"],function(g,k,i){var f={};f.KeyBindingsFactory=g.KeyBindingsFactory;f.UndoFactory=g.UndoFactory;f.LineNumberRulerFactory=g.LineNumberRulerFactory;f.FoldingRulerFactory=g.FoldingRulerFactory;f.AnnotationFactory=g.AnnotationFactory;f.TextDNDFactory=g.TextDNDFactory;f.TextActions=k.TextActions;f.SourceCodeActions=k.SourceCodeActions;f.LinkedMode=i.LinkedMode;return f});
define("text!orion/compare/sideBySideTemplate.html",[],function(){return'<div id="topWidget_id" style="height:100%;width:100%;position:relative">\n\t<div class="leftPanelLayout ">\n\t\t<div class="titleContainer" id="left_title_id"></div>\n\t\t<div class="compareEditorParent" id="left_editor_id"></div>\n\t\t<div class="statusContainer" id="left_status_id"></div>\n\t</div>\n\t<div class="split compareSplitLayout"></div>\n\t<div class="rightPanelLayout">\n\t\t<div class="titleContainer" id="right_title_id"></div>\n\t\t<div class="compareEditorParent"  id="right_editor_wrapper_id">\n\t\t\t<div class="canvasContainer">\n\t\t\t\t<canvas id="diff_canvas_id" class="compareCanvas" width="46" height="3000"></canvas>\n\t\t\t</div>\n\t\t\t<div class="compareEditorParentWithCanvas" id="right_editor_id"></div>\n\t\t</div>\n\t\t<div class="statusContainer" id="right_status_id"></div>\n\t</div>\n</div>'});
define("orion/compare/compareUIFactory",["orion/webui/littlelib","orion/webui/splitter","text!orion/compare/sideBySideTemplate.html"],function(g,k,i){var f=f||{};f.TwoWayCompareUIFactory=function(){function d(a){this._parentDivID=a.parentDivID;this._commandSpanId=a.commandSpanId;this._showTitle=a.showTitle;this._leftTitle=a.leftTitle;this._rightTitle=a.rightTitle;this._showLineStatus=a.showLineStatus}d.prototype={_init:function(){var a=this._parentDivID+"_";this._topWidgetDiv=g.node("topWidget_id");
this._topWidgetDiv.id=a+"topWidget_id";this._leftEditorParentDiv=g.node("left_editor_id");this._leftEditorParentDiv.id=a+"left_editor_id";this._rightEditorParentDiv=g.node("right_editor_id");this._rightEditorParentDiv.id=a+"right_editor_id";this._rightEditorWrapperDiv=g.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=a+"right_editor_wrapper_id";this._leftTitleDiv=g.node("left_title_id");this._leftTitleDiv.id=a+"left_title_id";this._rightTitleDiv=g.node("right_title_id");this._rightTitleDiv.id=
a+"right_title_id";this._leftStatusDiv=g.node("left_status_id");this._leftStatusDiv.id=a+"left_status_id";this._rightStatusDiv=g.node("right_status_id");this._rightStatusDiv.id=a+"right_status_id";this._diffCanvasDiv=g.node("diff_canvas_id");this._diffCanvasDiv.id=a+"diff_canvas_id";this._splitterId=a+"orion_splitter";if(!this._showTitle)this._leftEditorParentDiv.style.top="0px",this._rightEditorWrapperDiv.style.top="0px",this._leftTitleDiv.style.height="0px",this._rightTitleDiv.style.height="0px";
if(!this._showLineStatus)this._leftEditorParentDiv.style.marginBottom="0px",this._rightEditorWrapperDiv.style.marginBottom="0px",this._leftStatusDiv.style.height="0px",this._rightStatusDiv.style.height="0px"},_createSplitter:function(){var a=g.$(".split",this._topWidgetDiv);a.id=this._splitterId;var d=g.$(".leftPanelLayout",this._topWidgetDiv),f=g.$(".rightPanelLayout",this._topWidgetDiv);if(a&&d&&f)this._splitter=new k.Splitter({node:a,sidePanel:d,mainPanel:f})},buildUI:function(){g.node(this._parentDivID).innerHTML=
i;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(a){return g.$(".leftPanelLayout",this._topWidgetDiv)===a},getEditorParentDiv:function(a){return a?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(a){return a?this._leftTitleDiv:this._rightTitleDiv},getStatusDiv:function(a){return a?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv}};
return d}();return f});
var JsDiff=function(){function g(a){for(var c=[],b=0;b<a.length;b++)a[b]&&c.push(a[b]);return c}function k(a){a=a.replace(/&/g,"&amp;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");return a=a.replace(/"/g,"&quot;")}var i=function(a){this.ignoreWhitespace=a};i.prototype={diff:function(a,c){if(c==a)return[{value:c}];if(!c)return[{value:a,removed:!0}];if(!a)return[{value:c,added:!0}];var c=this.tokenize(c),a=this.tokenize(a),b=c.length,d=a.length,e=b+d,f=[{newPos:-1,components:[]}],g=this.extractCommon(f[0],
c,a,0);if(f[0].newPos+1>=b&&g+1>=d)return f[0].components;for(var i=1;i<=e;i++)for(var k=-1*i;k<=i;k+=2){var q;q=f[k-1];var p=f[k+1],g=(p?p.newPos:0)-k;q&&(f[k-1]=void 0);var t=q&&q.newPos+1<b,o=p&&0<=g&&g<d;if(!t&&!o)f[k]=void 0;else if(!t||o&&q.newPos<p.newPos?(q={newPos:p.newPos,components:p.components.slice(0)},this.pushComponent(q.components,a[g],void 0,!0)):(q={newPos:q.newPos,components:q.components.slice(0)},q.newPos++,this.pushComponent(q.components,c[q.newPos],!0,void 0)),g=this.extractCommon(q,
c,a,k),q.newPos+1>=b&&g+1>=d)return q.components;else f[k]=q}},pushComponent:function(a,c,b,d){var e=a[a.length-1];e&&e.added===b&&e.removed===d?a[a.length-1]={value:this.join(e.value,c),added:b,removed:d}:a.push({value:c,added:b,removed:d})},extractCommon:function(a,c,b,d){for(var e=c.length,f=b.length,g=a.newPos,d=g-d;g+1<e&&d+1<f&&this.equals(c[g+1],b[d+1]);)g++,d++,this.pushComponent(a.components,c[g],void 0,void 0);a.newPos=g;return d},equals:function(a,c){var b=/\S/;return this.ignoreWhitespace&&
!b.test(a)&&!b.test(c)?!0:a==c},join:function(a,c){return a+c},tokenize:function(a){return a}};var f=new i,d=new i(!1);d.tokenize=function(a){return g(a.split(/(\s+|\b)/))};var a=new i(!0);a.tokenize=function(a){return g(a.split(/([{}:;,]|\s+)/))};var e=new i;e.tokenize=function(a){return a.split(/^/m)};return{diffChars:function(a,c){return f.diff(a,c)},diffWords:function(a,c){return d.diff(a,c)},diffLines:function(a,c){return e.diff(a,c)},diffCss:function(d,c){return a.diff(d,c)},createPatch:function(a,
c,b,d,f){var g=[];g.push("Index: "+a);g.push("===================================================================");g.push("--- "+a+"\t"+d);g.push("+++ "+a+"\t"+f);a=e.diff(c,b);a.push({value:"",lines:[]});for(var b=c=0,d=[],i=f=1,k=0;k<a.length;k++){var r=a[k],q=r.lines||r.value.replace(/\n$/,"").split("\n");r.lines=q;if(r.added||r.removed){if(!c){var p=a[k-1],c=f,b=i;p&&(d.push.apply(d,p.lines.slice(-4).map(function(a){return" "+a})),c-=4,b-=4)}d.push.apply(d,q.map(function(a){return(r.added?"+":
"-")+a}));r.added?i+=q.length:f+=q.length}else c&&(q.length<=8&&k<a.length-1?d.push.apply(d,q.map(function(a){return" "+a})):(p=Math.min(q.length,4),g.push("@@ -"+c+","+(f-c+p)+" +"+b+","+(i-b+p)+" @@"),g.push.apply(g,d),g.push.apply(g,q.slice(0,p).map(function(a){return" "+a})),b=c=0,d=[])),f+=q.length,i+=q.length}a.length>1&&!/\n$/.test(a[a.length-2].value)&&g.push("\\ No newline at end of file\n");return g.join("\n")},convertChangesToXML:function(a){for(var c=[],b=0;b<a.length;b++){var d=a[b];
d.added?c.push("<ins>"):d.removed&&c.push("<del>");c.push(k(d.value));d.added?c.push("</ins>"):d.removed&&c.push("</del>")}return c.join("")}}}();if(typeof module!=="undefined")module.exports=JsDiff;typeof define==="function"&&define.amd&&define("jsdiff/diff",[],function(){return JsDiff});
define("orion/compare/jsdiffAdapter",["jsdiff/diff"],function(g){var k=k||{};k.JSDiffAdapter=function(){function i(){}i.prototype={_specialLine:function(f,d,a){return d.value===f&&a!==f},adapt:function(f,d,a){a||(a="\n");for(var e=f.split(a),j=d.split(a),c=e[e.length-1]==="",j=j[j.length-1]==="",b=g.diffLines(f,d),f=[],d=[],h=0,i=0,k=-1,m=0,s=!0,r=a,q=0;q<b.length;q++){var p=b[q],t=p.lines||p.value.split(a),o=t.length,v=0;t.length>1&&t[t.length-1]===""&&o--;o>1&&!s&&t[0]===""&&(o--,v++);p.lines=t;
if(!p.added&&!p.removed){if(!this._specialLine(a,p,r)){if(h||i)f.push([h,i,k]),i=h=0,k=-1,m+=i;f.push([o,o,0]);m+=o}}else if(p.added){k===-1&&(k=d.length+1);h+=o;for(s=v;s<o+v;s++)d.push(p.lines[s])}else i+=o;s=!1;t.length>1&&t[t.length-1]===""&&(s=!0);r=p.value?p.value[p.value.length-1]:a}if(h||i)f.push([h,i,k]),m+=i;m<e.length&&e.length>1&&(a=f[f.length-1],a[2]===0?(a[0]+=1,a[1]+=1):a[2]===-1?f.push([1,1,0]):c===j?f.push([1,1,0]):(j&&(a[0]+=1),c&&(a[1]+=1)));return{mapper:f,changContents:{array:d,
index:0}}},adaptCharDiff:function(f,d,a){for(var f=a?g.diffWords(f,d):g.diffChars(f,d),d=[],e=a=0,j=0,c=0,b=0;b<f.length;b++){var h=f[b];if(!h.added&&!h.removed){if(j>0||c>0)d.push([e,e+j,a,a+c]),e+=j,a+=c,c=j=0;e+=h.value.length;a+=h.value.length}else h.added?j+=h.value.length:c+=h.value.length}(j>0||c>0)&&d.push([e,e+j,a,a+c]);return d}};return i}();return k});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(g,k,i,f){var d={},a,e,j,c,b,h,l,n,m,s,r,q,p,t,o,v;d.DiffTreeNavigator=function(){function d(a,b,c,e,f,g){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,b,c,e,f,g)}a="orion.annotation.diff.addedBlock";e="orion.annotation.diff.currentAddedBlock";j="orion.annotation.diff.deletedBlock";c="orion.annotation.diff.currentDeletedBlock";
b="orion.annotation.diff.blockTop";h="orion.annotation.diff.currentBlockTop";l="orion.annotation.diff.blockConflict";n="orion.annotation.diff.currentBlockConflict";m="orion.annotation.diff.addedWord";s="orion.annotation.diff.currentAddedWord";r="orion.annotation.diff.deletedWord";q="orion.annotation.diff.currentDeletedWord";p="orion.annotation.diff.emptyDeletedWordLeft";t="orion.annotation.diff.emptyDeletedWordRight";o="orion.annotation.diff.emptyAddedWordLeft";v="orion.annotation.diff.emptyAddedWordRight";
i.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});i.AnnotationType.registerType(e,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});i.AnnotationType.registerType(j,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});i.AnnotationType.registerType(c,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});i.AnnotationType.registerType(b,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
i.AnnotationType.registerType(h,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});i.AnnotationType.registerType(l,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});i.AnnotationType.registerType(n,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});i.AnnotationType.registerType(m,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});i.AnnotationType.registerType(s,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});i.AnnotationType.registerType(r,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});i.AnnotationType.registerType(q,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});i.AnnotationType.registerType(p,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});i.AnnotationType.registerType(t,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
i.AnnotationType.registerType(o,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});i.AnnotationType.registerType(v,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});d.prototype={initAll:function(a,b,c,d,e,f,g){this._charOrWordDiff=a?a:"word";if(b)this._initialized=!0;this.editorWrapper=[{editor:b,diffFeeder:d},{editor:c,diffFeeder:e}];this._curveRuler=g;(this._overviewRuler=f)&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(a){if(a)for(var b=
0;b<this.editorWrapper.length;b++)this.editorWrapper[b].diffFeeder.init(this.editorWrapper[b].editor.getTextView().getModel(),a)},destroy:function(){this.initAll(this._charOrWordDiff)},renderAnnotations:function(){var a;for(a=0;a<this.editorWrapper.length;a++){this.editorWrapper[a].annoTypes=[];this.editorWrapper[a].diffFeeder.getBlockAnnoTypes(this.editorWrapper[a].annoTypes);this.editorWrapper[a].diffFeeder.getWordAnnoTypes(this.editorWrapper[a].annoTypes);for(var b=0;b<this.editorWrapper[a].annoTypes.length;b++)this.editorWrapper[a].annoTypes[b].current&&
this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].current),this.editorWrapper[a].annoTypes[b].normal&&this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].normal)}this._root.children=[];b=this.editorWrapper[0].diffFeeder.getDiffBlocks();if(!b||b.length===0)this.replaceAllAnnotations(!0,0,"block",!1,[]),this.replaceAllAnnotations(!0,1,"block",!1,[]),this.replaceAllAnnotations(!0,0,"word",!1,[]),
this.replaceAllAnnotations(!0,1,"word",!1,[]),this.replaceAllAnnotations(!0,0,"block",!0,[]),this.replaceAllAnnotations(!0,1,"block",!0,[]),this.replaceAllAnnotations(!0,0,"word",!0,[]),this.replaceAllAnnotations(!0,1,"word",!0,[]);else{var c=new f.JSDiffAdapter;for(a=0;a<b.length;a++){var d=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(d);var e=this.generatePairWordAnnotations(d,a,c);if(e)d.children=e}this.replaceAllAnnotations(!1,0,"block",!0);this.replaceAllAnnotations(!1,
1,"block",!0);this.replaceAllAnnotations(!1,0,"word",!0);this.replaceAllAnnotations(!1,1,"word",!0);this.iterator=new g.TreeModelIterator(this._root.children)}},replaceAllAnnotations:function(a,b,c,d,e){if(this.editorWrapper[b].annoTypes)for(var f=0;f<this.editorWrapper[b].annoTypes.length;f++)this.editorWrapper[b].annoTypes[f].type===c&&this.replaceDiffAnnotations(this.editorWrapper[b].editor,e?e:this.editorWrapper[b].annoTypes[f].list,d?this.editorWrapper[b].annoTypes[f].normal:this.editorWrapper[b].annoTypes[f].current,
a)},getMapper:function(){return this.editorWrapper[0].diffFeeder.getMapper()},getFeeder:function(a){return a?this.editorWrapper[1].diffFeeder:this.editorWrapper[0].diffFeeder},iterateOnBlock:function(a,b){this.iterator&&(this.iterator.iterateOnTop(a,b),this.updateCurrentAnnotation(!0))},iterateOnChange:function(a){if(!this.iterator)return null;var b=this.iterator.iterate(a);if(b){var c=this.iterator.cursor();c.type==="block"&&c.children&&c.children.length>0&&this.iterator.iterate(a);this.updateCurrentAnnotation(!0)}return b},
gotoBlock:function(a,b){if(this.iterator){if(a<0||a>=this._root.children.length||this._root.children.length===0)a=0;b!==void 0&&b>=0&&this._root.children[a].children&&b<this._root.children[a].children.length?this.iterator.setCursor(this._root.children[a].children[b]):this.iterator.setCursor(this._root.children[a]);this.updateCurrentAnnotation(!1);this._positionDiffBlock()}},_hitDiffAnnotation:function(a,b,c){if(c===this.editorWrapper[a].editor.getTextView()){for(var d=0;d<this._root.children.length;d++){var c=
this._root.children[d],e=a===0?c.oldA:c.newA;if(b>=e.start&&b<=e.end){d=c;if(c.children&&c.children.length>0)for(e=0;e<c.children.length;e++){var f=c.children[e],g=a===0?f.oldA:f.newA;if(b>=g.start&&b<=g.end){d=f;break}}return d}}return null}},gotoChange:function(a,b){for(var c=0;c<this.editorWrapper.length;c++){var d=this._hitDiffAnnotation(c,a,b);if(d)return this.iterator.setCursor(d),this.updateCurrentAnnotation(!1,b),!0}return!1},getCurrentBlockIndex:function(){if(!this.iterator)return-1;var a=
this.iterator.cursor();return!a?-1:a.type==="block"?a.index:a.parent.index},getCurrentPosition:function(){if(!this.iterator)return{};var a=this.iterator.cursor();return a.type==="block"?{block:a.index+1}:{block:a.parent.index+1,change:a.index+1}},getCurrentMapperIndex:function(){var a=this.getCurrentBlockIndex();a<0&&(a=0);var b=this.getFeeder().getDiffBlocks();if(!b||b.length===0)return-1;a>b.length-1&&(a=0);return b[a][1]},replaceDiffAnnotations:function(a,b,c,d){if(b&&c&&(a=a.getAnnotationModel())){for(var e=
a.getAnnotations(0,a.getTextModel().getCharCount()),f=[];d&&e.hasNext();){var g=e.next();g.type===c&&f.push(g)}a.replaceAnnotations(f,b)}},updateCurrentAnnotation:function(a,b){this.replaceAllAnnotations(!0,0,"block",!1,[]);this.replaceAllAnnotations(!0,1,"block",!1,[]);this.replaceAllAnnotations(!0,0,"word",!1,[]);this.replaceAllAnnotations(!0,1,"word",!1,[]);if(this.iterator){var c=this.iterator.cursor();if(c){var d,e,f={start:c.oldA.start,end:c.oldA.end},g={start:c.newA.start,end:c.newA.end};c.type===
"word"?(d=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(f,this.editorWrapper[0].editor.getTextView().getModel()),e=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(g,this.editorWrapper[1].editor.getTextView().getModel())):(d=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(c.index),e=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(c.index));d&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (i.AnnotationType.getType(d.current))(f.start,f.end)],d,!0);
e&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (i.AnnotationType.getType(e.current))(g.start,g.end)],e,!0);if(a)this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(c.oldA.start,c.oldA.end,!0),this.editorWrapper[1].editor.setSelection(c.newA.start,c.newA.end,!0),this.autoSelecting=!1;else if(b)this.autoSelecting=!0,b!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(c.oldA.start,c.oldA.end,!0),b!==this.editorWrapper[1].editor.getTextView()&&
this.editorWrapper[1].editor.setSelection(c.newA.start,c.newA.end,!0),this.autoSelecting=!1}}},generatePairBlockAnnotations:function(a,b){var c=this.generateBlockDiffAnnotations(0,b),d=this.generateBlockDiffAnnotations(1,b);return{parent:a,index:b,type:"block",oldA:c,newA:d}},generatePairWordAnnotations:function(a,b,c){var d=this.editorWrapper[0].diffFeeder.getTextOnBlock(b),e=this.editorWrapper[1].diffFeeder.getTextOnBlock(b),b=null,f=0,g=0;if(d&&e&&d.text&&e.text&&d.text.length<=5E3&&e.text.length<=
5E3)b=c.adaptCharDiff(d.text,e.text,this._charOrWordDiff==="word"),g=e.start,f=d.start;else return null;c=[];d=[];this.generateWordDiffAnnotations(0,c,f,b,2,3);this.generateWordDiffAnnotations(1,d,g,b,0,1);b=[];for(f=0;f<c.length;f++)b.push({parent:a,index:f,type:"word",oldA:c[f],newA:d[f]});return b},getAnnoModelList:function(a,b,c){for(var d=0;d<this.editorWrapper[a].annoTypes.length;d++)if(this.editorWrapper[a].annoTypes[d].type===b&&this.editorWrapper[a].annoTypes[d].normal===c)return this.editorWrapper[a].annoTypes[d].list;
return null},generateBlockDiffAnnotations:function(a,b){var c=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(b),d=this.getAnnoModelList(a,"block",c.normal),e=this.editorWrapper[a].diffFeeder.getCharRange(b),c=i.AnnotationType.createAnnotation(c.normal,e.start,e.end);d&&d.push(c);return c},generateWordDiffAnnotations:function(a,b,c,d,e,f){if(d)for(var g=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1}),a=this.getAnnoModelList(a,"word",g.normal),h=0;h<d.length;h++){var j=
i.AnnotationType.createAnnotation(g.normal,d[h][e]+c,d[h][f]+c);a.push(j);b.push(j)}},_updateOverviewRuler:function(){if(this._overviewRuler){var a=this.editorWrapper[0].editor.getTextView().getTopIndex();this.editorWrapper[0].editor.getTextView().redrawLines(a,a+1,this._overviewRuler)}},_updateCurveRuler:function(){this._curveRuler&&this._curveRuler.render()},_setTextViewPosition:function(a,b){var c=a.getLineHeight(),d=a.getClientArea(),c=Math.floor(d.height/c/3);a.setTopIndex(b-c>0?b-c:0)},_positionDiffBlock:function(){var a=
this.getCurrentBlockIndex();a<0&&(a=0);var b=this.getFeeder().getDiffBlocks();b.length!==0&&(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),b[a][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor&&(a=k.lookUpLineIndex(this.getMapper(),0,b[a][1]),this._setTextViewPosition(this.editorWrapper[1].editor.getTextView(),a)),this._updateOverviewRuler(),this._updateCurveRuler())},matchPositionFromOverview:function(a){this._initialized&&this.gotoBlock(a<0?0:k.getAnnotationIndex(this.getFeeder().getDiffBlocks(),
a))},gotoDiff:function(a,b){this.gotoChange(a,b)&&(this._updateOverviewRuler(),this._updateCurveRuler())},nextDiff:function(){this.iterateOnBlock(!0,!0);this._positionDiffBlock()},prevDiff:function(){this.iterateOnBlock(!1,!0);this._positionDiffBlock()},nextChange:function(){var a=this.iterateOnChange(!0);this._positionDiffBlock();return a},prevChange:function(){this.iterateOnChange(!1);this._positionDiffBlock()}};return d}();d.DiffBlockFeeder=function(){function a(){}a.prototype={getWordAnnoTypes:function(a){this._mapperColumnIndex===
0?a.push({type:"word",current:s,normal:m,list:[]}):a.push({type:"word",current:q,normal:r,list:[]});a.push({type:"word",current:p});a.push({type:"word",current:t});a.push({type:"word",current:o});a.push({type:"word",current:v})},getCurrentWordAnnoType:function(a,b){return a.start===a.end&&b?this._mapperColumnIndex===0?{current:this._repositionEmptyWord(a,b),normal:m}:{current:this._repositionEmptyWord(a,b),normal:r}:this._mapperColumnIndex===0?{current:s,normal:m}:{current:q,normal:r}},_repositionEmptyWord:function(a,
b){var c=b.getLineAtOffset(a.start),d=b.getLineStart(c),e=b.getLineEnd(c);if(d!==e){if(a.start===e)return a.start--,this._mapperColumnIndex===0?v:t;a.end++}else if(c>0&&(c--,d=b.getLineStart(c),e=b.getLineEnd(c),d!==e))return a.start=e-1,a.end=e,this._mapperColumnIndex===0?v:t;return this._mapperColumnIndex===0?o:p},getMapper:function(){return this._mapper},getDiffBlocks:function(){return this._diffBlocks},getDiffBlockH:function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return-1;a=this._diffBlocks[a][1];
return a===-1?0:this._mapper[a][this._mapperColumnIndex]},getOverviewLineCount:function(){return this._textModel.getLineCount()},getLineNumber:function(a){return a},getCharRange:function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return null;var b=this._diffBlocks[a][0],c=b+this._mapper[this._diffBlocks[a][1]][this._mapperColumnIndex]-1,a=this._textModel.getLineStart(b);if(c<b)return{start:a,end:a};b=this._textModel.getLineEnd(c,!0);return{start:a,end:b}},getTextOnBlock:function(a){if(!this._diffBlocks||
this._diffBlocks.length===0)return null;a=this.getCharRange(a);return{start:a.start,text:this._textModel.getText(a.start,a.end)}},isMapperEmpty:function(){return this._mapper.length===0}};return a}();d.TwoWayDiffBlockFeeder=function(){function f(a,b,c){this._mapperColumnIndex=c;this.init(a,b)}f.prototype=new d.DiffBlockFeeder;f.prototype.init=function(a,b){this._textModel=a;this._diffBlocks=void 0;if(b){this._mapper=b;this._diffBlocks=[];for(var c=0,d=0;d<this._mapper.length;d++)this._mapper[d][2]!==
0&&this._diffBlocks.push([c,d]),c+=this._mapper[d][this._mapperColumnIndex]}};f.prototype.getBlockAnnoTypes=function(d){this._mapperColumnIndex===0?d.push({type:"block",normal:a,current:e,list:[]}):d.push({type:"block",normal:j,current:c,list:[]});d.push({type:"block",normal:b,current:h,list:[]});d.push({type:"block",normal:l,current:n,list:[]})};f.prototype.getCurrentBlockAnnoType=function(d){if(!this._diffBlocks||this._diffBlocks.length===0||this._diffBlocks.length<=d)return null;d=this._diffBlocks[d][1];
if(this._mapper[d][this._mapperColumnIndex]===0)return{normal:b,current:h};else if(k.isMapperConflict(this.getMapper(),d))return{normal:l,current:n};else if(this._mapperColumnIndex===0)return{type:"block",normal:a,current:e,list:[]};return{type:"block",normal:j,current:c,list:[]}};return f}();d.inlineDiffBlockFeeder=function(){function b(a,c){this._mapperColumnIndex=c;this.init(a)}b.prototype=new d.DiffBlockFeeder;b.prototype.setModel=function(a){this._textModel=a};b.prototype.init=function(a){this._diffBlocks=
void 0;if(a){this._mapper=a;this._diffBlocks=[];this._gapBlocks=[];for(var b=a=0,c=0;c<this._mapper.length;c++){if(this._mapper[c][2]!==0){if(this._mapperColumnIndex===0){var d=a+this._mapper[c][1];this._diffBlocks.push([d,c]);this._gapBlocks.push([d,d+this._mapper[c][0],b])}else this._diffBlocks.push([a,c]),this._gapBlocks.push([a,a+this._mapper[c][1],b]);a+=this._mapper[c][0]+this._mapper[c][1]}else this._gapBlocks.push([a,a+this._mapper[c][this._mapperColumnIndex],b]),a+=this._mapper[c][this._mapperColumnIndex];
b+=this._mapper[c][this._mapperColumnIndex]}}};b.prototype.getBlockAnnoTypes=function(b){this._mapperColumnIndex===0?b.push({type:"block",normal:a,current:e,list:[]}):b.push({type:"block",normal:j,current:c,list:[]});b.push({type:"block",normal:l,current:n,list:[]})};b.prototype.getCurrentBlockAnnoType=function(b){if(!this._diffBlocks||this._diffBlocks.length===0)return null;b=this._diffBlocks[b][1];if(this._mapper[b][this._mapperColumnIndex]===0)return{current:s,normal:m};else if(k.isMapperConflict(this.getMapper(),
b))return{normal:l,current:n};else if(this._mapperColumnIndex===0)return{type:"block",normal:a,current:e,list:[]};return{type:"block",normal:j,current:c,list:[]}};b.prototype.getDiffBlockH=function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return-1;a=this._diffBlocks[a][1];return this._mapper[a][0]+this._mapper[a][1]};b.prototype.getLineNumber=function(a){for(var b=0;b<this._gapBlocks.length;b++)if(this._gapBlocks[b][0]!==this._gapBlocks[b][1]&&a>=this._gapBlocks[b][0]&&a<this._gapBlocks[b][1])return a-
this._gapBlocks[b][0]+this._gapBlocks[b][2];return-1};return b}();return d});
define("orion/compare/compareView","i18n!orion/compare/nls/messages,orion/Deferred,orion/webui/littlelib,orion/compare/diffParser,orion/compare/compareRulers,orion/editor/editor,orion/editor/editorFeatures,orion/keyBinding,orion/editor/textView,orion/compare/compareUIFactory,orion/compare/compareUtils,orion/compare/jsdiffAdapter,orion/compare/diffTreeNavigator".split(","),function(g,k,i,f,d,a,e,j,c,b,h,l,n){var m={};m.CompareView=function(){function a(){this._diffParser=new f.DiffParser}a.prototype=
{_clearOptions:function(){this.options={};this.options.blockNumber=1;this.options.changeNumber=0},_getLineDelim:function(){return"\n"},_generateMapper:function(a,b,c,d,e){var f=this._getLineDelim(a,c);this._diffParser.setLineDelim(f);if(this.options.mapper&&this.options.toggler)return{delim:f,mapper:this.options.mapper,output:this.options.newFile.Content,diffArray:this.options.diffArray};if(typeof b==="string"&&typeof a==="string"){a=(new l.JSDiffAdapter).adapt(a,b,f);if(this.options.toggler)this.options.mapper=
a.mapper,this.options.newFile.Content=b,this.options.diffArray=a.changContents;return{delim:f,mapper:a.mapper,output:b,diffArray:a.changContents}}else{b=this._diffParser.parse(a,c,d,e);a=this._diffParser.getDiffArray();if(this.options.toggler)this.options.mapper=b.mapper,this.options.newFile.Content=b.outPutFile,this.options.diffArray=a;return{delim:f,mapper:b.mapper,output:b.outPutFile,diffArray:a}}},_initSyntaxHighlighter:function(a){this._syntaxHighlighters=null;if(this.options.highlighters&&this.options.highlighters.length>
0&&!(a.length<1||a.length>2))this._syntaxHighlighters=[{highlighter:this.options.highlighters[0],target:a[0]}],a.length===2&&this.options.highlighters.length===2&&this._syntaxHighlighters.push({highlighter:this.options.highlighters[1],target:a[1]})},_highlightSyntax:function(){if(this._syntaxHighlighters){var a=[];this._syntaxHighlighters.forEach(function(b){a.push(b.highlighter.highlight(b.target.fileName,b.target.contentType,b.target.editor))}.bind(this));k.all(a,function(a){return{_error:a}}).then(function(){this._diffNavigator.renderAnnotations();
this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this))}else window.setTimeout(function(){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this),50)},setOptions:function(a,b){b&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},getOptions:function(){return this.options},getCurrentDiffPos:function(){return this._diffNavigator.getCurrentPosition()},
initDiffNav:function(){this._diffNavigator.gotoBlock(0,0)},nextDiff:function(){this._diffNavigator.nextDiff()},prevDiff:function(){this._diffNavigator.prevDiff()},nextChange:function(){return this._diffNavigator.nextChange()},prevChange:function(){this._diffNavigator.prevChange()},getWidget:function(){return this},startup:function(){this.initEditors();this.refresh(!0)},initEditors:function(){}};return a}();m.TwoWayCompareView=function(){function f(a){this.setOptions(a,!0);this._diffNavigator=new n.DiffTreeNavigator("word");
this.type="twoWay";this._uiFactory=this.options.uiFactory;if(!this._uiFactory)this._uiFactory=new b.TwoWayCompareUIFactory({parentDivID:this.options.parentDivId,showTitle:this.options.showTitle?this.options.showTitle:!1,showLineStatus:this.options.showLineStatus?this.options.showLineStatus:!1}),this._uiFactory.buildUI();this._viewLoadedCounter=0;this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._curveRuler=new d.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}
f.prototype=new m.CompareView;f.prototype.initEditors=function(a){this._editors=[];this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!1),this._uiFactory.getStatusDiv(!1),this.options.oldFile));this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!0),this._uiFactory.getStatusDiv(!0),this.options.newFile,!0));this._overviewRuler=new d.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));
window.onbeforeunload=function(){if(this._editors&&this._editors.some(function(a){return a.isDirty()}))return g["There are unsaved changes."]}.bind(this)};f.prototype.getEditors=function(){return this._editors};f.prototype.gotoDiff=function(a,b,c){c=c?this._editors[1].getTextView():this._editors[0].getTextView();this._diffNavigator.gotoDiff(c.getModel().getLineStart(a)+b,c)};f.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)};f.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)};
f.prototype.resizeEditors=function(){this._editors.forEach(function(a){a.getTextView().resize()})};f.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};f.prototype._createEditor=function(b,d,f,h,j){var i=typeof h.readonly==="undefined"?!0:h.readonly,k=function(){var a=new c.TextView({parent:d,readonly:i,tabSize:4});this._viewLoadedCounter++;this._viewLoadedCounter===2&&this._diffNavigator.matchPositionFromOverview(-1);if(this.onLoad)this.onLoad();var b=this.getSplitter();b&&b.addResizeListener(function(b){if(b){var c=
!1;(c=this._uiFactory.isLeftPane(b)?j:!j)&&a.resize()}}.bind(this));return a}.bind(this),l=h.keyBindingFactory;l||(l=new e.KeyBindingsFactory);var m=null;if(f)var n="",m=function(a,b){if(f)n=b?g["ERROR: "]+a:a,f.textContent=""+n};k=new a.Editor({textViewFactory:k,undoStackFactory:new e.UndoFactory,annotationFactory:new e.AnnotationFactory,keyBindingFactory:l,statusReporter:m,domNode:d});k.installTextView();k.setInput(null,null,h.Content?h.Content:b);k.setOverviewRulerVisible(!1);var A=k.getTextView();
A.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(A.getCaretOffset(),A)}.bind(this));A.getModel().addEventListener("Changed",function(a){if(!this._curveRuler.onChanged(a,!j))this.options.mapper=null}.bind(this));j?A.addEventListener("Scroll",function(){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render());if(this.onScroll)this.onScroll()}.bind(this)):
A.addEventListener("Scroll",function(){this._curveRuler&&this._curveRuler.render()}.bind(this));return k};f.prototype.destroy=function(){this._editors&&(this._diffNavigator.destroy(),this._editors.forEach(function(a){a.destroy()}),this._uiFactory.destroy())};f.prototype.addRulers=function(){if(this._editors&&!this._hasRuler){var a=new d.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),b=new d.LineNumberCompareRuler(this._diffNavigator,
0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._editors[1].getTextView().addRuler(a);this._editors[0].getTextView().addRuler(b);this._editors[0].getTextView().addRuler(this._overviewRuler);this._hasRuler=!0}};f.prototype.refresh=function(a){var b=this.options.oldFile.Content,c=this.options.newFile.Content,d=this.options.diffContent;typeof c==="string"?d=this._generateMapper(b,c,d,this.options.hasConflicts):(d=this._generateMapper(b,c,d,this.options.hasConflicts),
c=d.output);var e=new n.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),d.mapper,1),f=new n.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),d.mapper,0);this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editors[0],this._editors[1],e,f,this._overviewRuler,this._curveRuler);this._curveRuler.init(d.mapper,this._editors[1],this._editors[0],this._diffNavigator);a&&(this._editors[1].setInput(this.options.newFile.Name,null,c),this._editors[0].setInput(this.options.oldFile.Name,
null,b));this._initSyntaxHighlighter([{fileName:this.options.newFile.Name,contentType:this.options.newFile.Type,editor:this._editors[1]},{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editors[0]}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();this._viewLoadedCounter===2&&this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);a=this._uiFactory.getTitleDiv(!0);
if((b=this._uiFactory.getTitleDiv(!1))&&a)i.empty(b),i.empty(a),b.appendChild(document.createTextNode(this.options.oldFile.Name)),a.appendChild(document.createTextNode(this.options.newFile.Name));a=this._editors[1].getTextView().getModel().getLineCount()*this._editors[1].getTextView().getLineHeight()+5;b=this._editors[0].getTextView().getModel().getLineCount()*this._editors[0].getTextView().getLineHeight()+5;return a>b?a:b};return f}();m.InlineCompareView=function(){function b(a){this.setOptions(a,
!0);this._diffNavigator=new n.DiffTreeNavigator("word");this.type="inline";this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._editorDiv=this.options.parentDivId}b.prototype=new m.CompareView;b.prototype.addRulers=function(){if(this._textView&&!this._hasRuler)this._textView.addRuler(this._rulerOrigin),this._textView.addRuler(this._rulerNew),this._textView.addRuler(this._overviewRuler),this._hasRuler=!0};b.prototype.removeRulers=function(){if(this._textView&&this._hasRuler)this._textView.removeRuler(this._rulerOrigin),
this._textView.removeRuler(this._rulerNew),this._textView.removeRuler(this._overviewRuler),this._hasRuler=!1};b.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.setText(""),this.removeRulers())};b.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};b.prototype.initEditors=function(b){var f=i.node(this._editorDiv),g=function(){return new c.TextView({parent:f,readonly:!0,tabSize:4})}.bind(this);this._editor=
new a.Editor({textViewFactory:g,undoStackFactory:new e.UndoFactory,annotationFactory:new e.AnnotationFactory,domNode:f});this._editor.installTextView();this._editor.setInput(null,null,b);this._editor.setOverviewRulerVisible(!1);this._editor.setAnnotationRulerVisible(!1);this._textView=this._editor.getTextView();this._rulerOrigin=new d.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._rulerNew=new d.LineNumberCompareRuler(this._diffNavigator,
0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._overviewRuler=new d.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));this._textView.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(this._textView.getCaretOffset(),
this._textView)}.bind(this))};b.prototype._initDiffPosition=function(a){var b=a.getModel();if(b&&b.getAnnotations&&(b=b.getAnnotations(),b.length>0)){var b=b[0][0],c=a.getLineHeight(),d=a.getClientArea(),c=Math.floor(d.height/c/3);a.setTopIndex(b-c>0?b-c:0)}};b.prototype.refresh=function(){var a=this.options.oldFile.Content,b=this._generateMapper(a,this.options.newFile.Content,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);this._textView.getModel().setText(a);var a=new n.inlineDiffBlockFeeder(b.mapper,
1),c=new n.inlineDiffBlockFeeder(b.mapper,0);h.mergeDiffBlocks(this._textView.getModel(),c.getDiffBlocks(),b.mapper,b.diffArray.array,b.diffArray.index,this._diffParser._lineDelimiter);a.setModel(this._textView.getModel());c.setModel(this._textView.getModel());this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editor,this._editor,a,c,this._overviewRuler);this._initSyntaxHighlighter([{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editor}]);
this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();b=this._textView.getTopIndex();this._textView.redrawLines(b,b+1,this._overviewRuler);this._textView.redrawLines(b,b+1,this._rulerOrigin);this._textView.redrawLines(b,b+1,this._rulerNew);this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);return this._textView.getLineHeight()*this._textView.getModel().getLineCount()+5};b.prototype.setConflicting=
function(a){this._conflcit=a};return b}();m.toggleableCompareView=function(){function a(b,c){if(c)c.toggler=this;this._widget=b==="inline"?new m.InlineCompareView(c):new m.TwoWayCompareView(c)}a.prototype={startup:function(){this._widget.startup()},toggle:function(){var a=this._widget.options,b=this._widget.getCurrentDiffPos();a.blockNumber=b.block;a.changeNumber=b.change;this._widget.destroy();i.empty(i.node(a.parentDivId));this._widget=this._widget.type==="inline"?new m.TwoWayCompareView(a):new m.InlineCompareView(a);
this._widget.initEditors();this._widget.refresh(!0)},getWidget:function(){return this._widget}};return a}();return m});
define("orion/editor/keywords",[],function(){return{JSKeywords:"break,case,class,catch,continue,const,debugger,default,delete,do,else,enum,export,extends,false,finally,for,function,if,implements,import,in,instanceof,interface,let,new,null,package,private,protected,public,return,static,super,switch,this,throw,true,try,typeof,undefined,var,void,while,with,yield".split(","),CSSKeywords:"alignment-adjust,alignment-baseline,animation,animation-delay,animation-direction,animation-duration,animation-iteration-count,animation-name,animation-play-state,animation-timing-function,appearance,azimuth,backface-visibility,background,background-attachment,background-clip,background-color,background-image,background-origin,background-position,background-repeat,background-size,baseline-shift,binding,bleed,bookmark-label,bookmark-level,bookmark-state,bookmark-target,border,border-bottom,border-bottom-color,border-bottom-left-radius,border-bottom-right-radius,border-bottom-style,border-bottom-width,border-collapse,border-color,border-image,border-image-outset,border-image-repeat,border-image-slice,border-image-source,border-image-width,border-left,border-left-color,border-left-style,border-left-width,border-radius,border-right,border-right-color,border-right-style,border-right-width,border-spacing,border-style,border-top,border-top-color,border-top-left-radius,border-top-right-radius,border-top-style,border-top-width,border-width,bottom,box-align,box-decoration-break,box-direction,box-flex,box-flex-group,box-lines,box-ordinal-group,box-orient,box-pack,box-shadow,box-sizing,break-after,break-before,break-inside,caption-side,clear,clip,color,color-profile,column-count,column-fill,column-gap,column-rule,column-rule-color,column-rule-style,column-rule-width,column-span,column-width,columns,content,counter-increment,counter-reset,crop,cue,cue-after,cue-before,cursor,direction,display,dominant-baseline,drop-initial-after-adjust,drop-initial-after-align,drop-initial-before-adjust,drop-initial-before-align,drop-initial-size,drop-initial-value,elevation,empty-cells,fit,fit-position,flex-align,flex-flow,flex-inline-pack,flex-order,flex-pack,float,float-offset,font,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,grid-columns,grid-rows,hanging-punctuation,height,hyphenate-after,hyphenate-before,hyphenate-character,hyphenate-lines,hyphenate-resource,hyphens,icon,image-orientation,image-rendering,image-resolution,inline-box-align,left,letter-spacing,line-height,line-stacking,line-stacking-ruby,line-stacking-shift,line-stacking-strategy,list-style,list-style-image,list-style-position,list-style-type,margin,margin-bottom,margin-left,margin-right,margin-top,mark,mark-after,mark-before,marker-offset,marks,marquee-direction,marquee-loop,marquee-play-count,marquee-speed,marquee-style,max-height,max-width,min-height,min-width,move-to,nav-down,nav-index,nav-left,nav-right,nav-up,opacity,orphans,outline,outline-color,outline-offset,outline-style,outline-width,overflow,overflow-style,overflow-x,overflow-y,padding,padding-bottom,padding-left,padding-right,padding-top,page,page-break-after,page-break-before,page-break-inside,page-policy,pause,pause-after,pause-before,perspective,perspective-origin,phonemes,pitch,pitch-range,play-during,position,presentation-level,punctuation-trim,quotes,rendering-intent,resize,rest,rest-after,rest-before,richness,right,rotation,rotation-point,ruby-align,ruby-overhang,ruby-position,ruby-span,size,speak,speak-header,speak-numeral,speak-punctuation,speech-rate,stress,string-set,table-layout,target,target-name,target-new,target-position,text-align,text-align-last,text-decoration,text-emphasis,text-height,text-indent,text-justify,text-outline,text-shadow,text-transform,text-wrap,top,transform,transform-origin,transform-style,transition,transition-delay,transition-duration,transition-property,transition-timing-function,unicode-bidi,vertical-align,visibility,voice-balance,voice-duration,voice-family,voice-pitch,voice-pitch-range,voice-rate,voice-stress,voice-volume,volume,white-space,white-space-collapse,widows,width,word-break,word-spacing,word-wrap,z-index".split(","),JAVAKeywords:"abstract,boolean,break,byte,case,catch,char,class,continue,default,do,double,else,extends,false,final,finally,float,for,if,implements,import,instanceof,int,interface,long,native,new,null,package,private,protected,public,return,short,static,super,switch,synchronized,this,throw,throws,transient,true,try,void,volatile,while".split(",")}});
define("examples/editor/textStyler",["orion/editor/annotations","orion/editor/keywords"],function(g,k){function i(a,b){this.keywords=a;this.whitespacesVisible=b;this.setText("")}function f(){i.call(this,null,!0)}function d(a){i.call(this,null,a)}function a(){i.call(this,null,!1)}function e(e,g,h){this.commentStart="/*";this.commentEnd="*/";var k=[];switch(g){case "java":k=c;break;case "js":k=j;break;case "css":k=b}this.whitespacesVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=
this.foldingEnabled=!0;this._scanner=new i(k,this.whitespacesVisible);this._firstScanner=new a;this._commentScanner=new d(this.whitespacesVisible);this._whitespaceScanner=new f;if(g==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=e;this.annotationModel=h;this._bracketAnnotations=void 0;var l=this;this._listener={onChanged:function(a){l._onModelChanged(a)},onDestroy:function(a){l._onDestroy(a)},onLineStyle:function(a){l._onLineStyle(a)},onMouseDown:function(a){l._onMouseDown(a)},
onSelection:function(a){l._onSelection(a)}};g=e.getModel();g.getBaseModel&&(g=g.getBaseModel());g.addEventListener("Changed",this._listener.onChanged);e.addEventListener("MouseDown",this._listener.onMouseDown);e.addEventListener("Selection",this._listener.onSelection);e.addEventListener("Destroy",this._listener.onDestroy);e.addEventListener("LineStyle",this._listener.onLineStyle);this._computeComments();this._computeFolding();e.redrawLines()}var j=k.JSKeywords,c=k.JAVAKeywords,b=k.CSSKeywords,h={styleClass:"token_singleline_comment"},
l={styleClass:"token_multiline_comment"},n={styleClass:"token_doc_comment"},m={styleClass:"token_doc_html_markup"},s={styleClass:"token_task_tag"},r={styleClass:"token_doc_tag"},q={styleClass:"token_string"},p={styleClass:"token_number"},t={styleClass:"token_keyword"},o={styleClass:"token_space"},v={styleClass:"token_tab"},z={styleClass:"line_caret"};i.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,
this.offset)},getDataLength:function(){return this.offset-this.startOffset},_default:function(a){switch(a){case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===9);this._unread(a);return 9;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return a;default:var b=this.isCSS,c=this.offset-1;if(!b&&48<=a&&a<=57){var d=b=!1,e=!1,f=a;do if(a=this._read(),a===46&&!b)b=!0;else if(a===101&&!d)b=d=!0,a=this._read(),a!==45&&this._unread(a);else if(a===
120&&f===48&&this.offset-c===2)b=d=e=!0;else if(!(48<=a&&a<=57||e&&(65<=a&&a<=70||97<=a&&a<=102)))break;while(1);this._unread(a);return 3}if(97<=a&&a<=122||65<=a&&a<=90||a===95||45===a&&b){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57||45===a&&b);this._unread(a);a=this.keywords;if(a.length>0){c=this.text.substring(c,this.offset);for(b=0;b<a.length;b++)if(this.keywords[b]===c)return 2}}return 1}},_read:function(){return this.offset<this.text.length?this.text.charCodeAt(this.offset++):
-1},_unread:function(a){a!==-1&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var a=this._read(),b;switch(a){case -1:return null;case 47:a=this._read();if(!this.isCSS&&a===47)for(;;)if(a=this._read(),a===-1||a===10||a===13)return this._unread(a),6;if(a===42){a=this._read();b=7;for(a===42&&(b=8);;){for(;a===42;)if(a=this._read(),a===47)return b;if(a===-1)return this._unread(a),b;a=this._read()}}this._unread(a);return 1;case 39:for(b=4;;)switch(a=this._read(),a){case 39:return b;
case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;case 34:for(b=4;;)switch(a=this._read(),a){case 34:return b;case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;default:return this._default(a)}}},setText:function(a){this.text=a;this.startOffset=this.offset=0}};f.prototype=new i(null);f.prototype.nextToken=
function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:return 11;case 9:return 10;default:do a=this._read();while(!(a===32||a===9||a===-1));this._unread(a);return 1}}};d.prototype=new i(null);d.prototype.setType=function(a){this._type=a};d.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===
9);this._unread(a);return 9;case 60:if(this._type===8){do a=this._read();while(!(a===62||a===-1));if(a===62)return 12}return 1;case 64:if(this._type===8){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57);this._unread(a);return 13}return 1;case 84:if((a=this._read())===79)if((a=this._read())===68)if((a=this._read())===79)if(a=this._read(),!(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57))return this._unread(a),14;this._unread(a);default:do a=this._read();while(!(a===32||
a===9||a===-1||a===60||a===64||a===84));this._unread(a);return 1}}};a.prototype=new i(null);a.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),1}};e.prototype={destroy:function(){var a=this.view;if(a){var b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.removeEventListener("Changed",this._listener.onChanged);a.removeEventListener("MouseDown",this._listener.onMouseDown);a.removeEventListener("Selection",this._listener.onSelection);
a.removeEventListener("Destroy",this._listener.onDestroy);a.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a){this.whitespacesVisible=a;this._scanner.whitespacesVisible=a;this._commentScanner.whitespacesVisible=a},setDetectHyperlinks:function(a){this.detectHyperlinks=a},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,
b,c,d,e){var f;d===void 0&&(d=-1);if(e===void 0)e=a.length;for(;e-d>1;)if(f=Math.floor((e+d)/2),b<=a[f].start)e=f;else if(c&&b<a[f].end){e=f;break}else d=f;return e},_computeComments:function(){var a=this.view.getModel();a.getBaseModel&&(a=a.getBaseModel());this.comments=this._findComments(a.getText())},_computeFolding:function(){if(this.foldingEnabled){var a=this.view.getModel();if(a.getBaseModel){var b=this.annotationModel;if(b){b.removeAnnotations(g.AnnotationType.ANNOTATION_FOLDING);for(var c=
[],d=a.getBaseModel(),e=this.comments,f=0;f<e.length;f++){var h=e[f];(h=this._createFoldingAnnotation(a,d,h.start,h.end))&&c.push(h)}b.replaceAnnotations(null,c)}}}},_createFoldingAnnotation:function(a,b,c,d){var e=b.getLineAtOffset(c),b=b.getLineAtOffset(d);return e===b?null:new (g.AnnotationType.getType(g.AnnotationType.ANNOTATION_FOLDING))(c,d,a)},_computeTasks:function(a,b,c){if(this.detectTasks){var d=this.annotationModel;if(d){var e=this.view.getModel(),f=e;e.getBaseModel&&(f=e.getBaseModel());
for(var h=d.getAnnotations(b,c),e=[],j=g.AnnotationType.ANNOTATION_TASK;h.hasNext();){var i=h.next();i.type===j&&e.push(i)}h=[];i=this._commentScanner;i.setText(f.getText(b,c));for(var k;k=i.nextToken();){var l=i.getStartOffset()+b;k===14&&(k=f.getLineEnd(f.getLineAtOffset(l)),a!==6&&(k=Math.min(k,c-this.commentEnd.length)),h.push(g.AnnotationType.createAnnotation(j,l,k,f.getText(l,k))))}d.replaceAnnotations(e,h)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var b=this.view,c=b.getModel(),
b=b.getSelection();if(b.start===b.end&&c.getLineAtOffset(b.start)===a)return z}return null},_getStyles:function(a,b,c){a.getBaseModel&&(c=a.mapOffset(c));for(var d=c+b.length,e=[],f=c,g=this.comments,h=this._binarySearch(g,c,!0);h<g.length;h++){if(g[h].start>=d)break;var j=g[h].start,i=g[h].end;f<j&&this._parse(b.substring(f-c,j-c),f,e);var k=g[h].type,m;switch(k){case 8:m=n;break;case 7:m=l;break;case 5:m=q}f=Math.max(f,j);j=Math.min(d,i);(k===8||k===7)&&(this.whitespacesVisible||this.detectHyperlinks)?
this._parseComment(b.substring(f-c,j-c),f,e,m,k):k===5&&this.whitespacesVisible?this._parseString(b.substring(f-c,j-c),f,e,q):e.push({start:f,end:j,style:m});f=i}f<d&&this._parse(b.substring(f-c,d-c),f,e);if(a.getBaseModel)for(b=0;b<e.length;b++)c=e[b].end-e[b].start,e[b].start=a.mapOffset(e[b].start,!0),e[b].end=e[b].start+c;return e},_parse:function(a,b,c){var d=this._scanner;for(d.setText(a);a=d.nextToken();){var e=d.getStartOffset()+b,f=null;switch(a){case 2:f=t;break;case 3:f=p;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(d.getData(),
e,c,q);continue}else f=q;break;case 8:this._parseComment(d.getData(),e,c,n,a);continue;case 6:this._parseComment(d.getData(),e,c,h,a);continue;case 7:this._parseComment(d.getData(),e,c,l,a);continue;case 10:this.whitespacesVisible&&(f=v);break;case 11:this.whitespacesVisible&&(f=o)}c.push({start:e,end:d.getOffset()+b,style:f})}},_parseComment:function(a,b,c,d,e){var f=this._commentScanner;f.setText(a);for(f.setType(e);a=f.nextToken();){var e=f.getStartOffset()+b,g=d;switch(a){case 10:this.whitespacesVisible&&
(g=v);break;case 11:this.whitespacesVisible&&(g=o);break;case 12:g=m;break;case 13:g=r;break;case 14:g=s;break;default:this.detectHyperlinks&&(g=this._detectHyperlinks(f.getData(),e,c,g))}g&&c.push({start:e,end:f.getOffset()+b,style:g})}},_parseString:function(a,b,c,d){var e=this._whitespaceScanner;for(e.setText(a);a=e.nextToken();){var f=e.getStartOffset()+b,g=d;switch(a){case 10:this.whitespacesVisible&&(g=v);break;case 11:this.whitespacesVisible&&(g=o)}g&&c.push({start:f,end:e.getOffset()+b,style:g})}},
_detectHyperlinks:function(a,b,c,d){var e=null,f;if((f=a.indexOf("://"))>0){for(var e=a,g=f;g>0;){f=e.charCodeAt(g-1);if(!(97<=f&&f<=122||65<=f&&f<=90||45===f||48<=f&&f<=57))break;g--}if(g>0&&(f="\"\"''(){}[]<>".indexOf(e.substring(g-1,g)),f!==-1&&(f&1)===0&&(f=e.lastIndexOf("\"\"''(){}[]<>".substring(f+1,f+2)))!==-1)){var h=f;f=this._clone(d);f.tagName="a";f.attributes={href:e.substring(g,h)};c.push({start:b,end:b+g,style:d});c.push({start:b+g,end:b+h,style:f});c.push({start:b+h,end:b+a.length,style:d});
return null}}else a.toLowerCase().indexOf("bug#")===0&&(e="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(a.substring(4),10));return e?(f=this._clone(d),f.tagName="a",f.attributes={href:e},f):d},_clone:function(a){if(!a)return a;var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},_findComments:function(a,b){var b=b||0,c=this._firstScanner,d;c.setText(a);for(var e=[];d=c.nextToken();)(d===7||d===8||d===5)&&e.push({start:c.getStartOffset()+b,end:c.getOffset()+b,type:d}),(d===
6||d===7||d===8)&&this._computeTasks(d,c.getStartOffset()+b,c.getOffset()+b);return e},_findMatchingBracket:function(a,b){var c="{}()[]<>",d=a.getText(b,b+1),e=c.indexOf(d,0);if(e===-1)return-1;var f;f=e&1?c.substring(e-1,e):c.substring(e+1,e+2);for(var g=a.getLineAtOffset(b),c=a.getLine(g),h=a.getLineStart(g),j=a.getLineEnd(g),c=this._findBrackets(d,f,c,h,h,j),j=0;j<c.length;j++)if(h=c[j]>=0?1:-1,c[j]*h-1===b){var i=1;if(e&1){for(j--;j>=0;j--)if(h=c[j]>=0?1:-1,i+=h,i===0)return c[j]*h-1;for(g-=1;g>=
0;){c=a.getLine(g);h=a.getLineStart(g);j=a.getLineEnd(g);c=this._findBrackets(d,f,c,h,h,j);for(e=c.length-1;e>=0;e--)if(h=c[e]>=0?1:-1,i+=h,i===0)return c[e]*h-1;g--}}else{for(j++;j<c.length;j++)if(h=c[j]>=0?1:-1,i+=h,i===0)return c[j]*h-1;g+=1;for(e=a.getLineCount();g<e;){c=a.getLine(g);h=a.getLineStart(g);j=a.getLineEnd(g);c=this._findBrackets(d,f,c,h,h,j);for(j=0;j<c.length;j++)if(h=c[j]>=0?1:-1,i+=h,i===0)return c[j]*h-1;g++}}break}return-1},_findBrackets:function(a,b,c,d,e,f){for(var g=[],a=
a.charCodeAt(0),b=b.charCodeAt(0),h=e,j=this._scanner,i,k=this.comments,l=this._binarySearch(k,e,!0);l<k.length;l++){if(k[l].start>=f)break;i=k[l].start;var m=k[l].end;if(h<i)for(j.setText(c.substring(h-e,i-e));i=j.nextToken();)i===a?g.push(j.getStartOffset()+h-e+d+1):i===b&&g.push(-(j.getStartOffset()+h-e+d+1));h=m}if(h<f)for(j.setText(c.substring(h-e,f-e));i=j.nextToken();)i===a?g.push(j.getStartOffset()+h-e+d+1):i===b&&g.push(-(j.getStartOffset()+h-e+d+1));return g},_onDestroy:function(){this.destroy()},
_onLineStyle:function(a){if(a.textView===this.view)a.style=this._getLineStyle(a.lineIndex);a.ranges=this._getStyles(a.textView.getModel(),a.lineText,a.lineStart)},_onSelection:function(a){var b=a.oldValue,c=a.newValue,d=this.view,a=d.getModel(),e;if(this.highlightCaretLine){var f=a.getLineAtOffset(b.start);e=a.getLineAtOffset(c.start);var h=c.start===c.end,b=b.start===b.end;f===e&&b&&h||(b&&d.redrawLines(f,f+1),(f!==e||!b)&&h&&d.redrawLines(e,e+1))}if(this.annotationModel){var b=this._bracketAnnotations,
j,i;if(c.start===c.end&&(i=d.getCaretOffset())>0)i-=1,a.getBaseModel&&(i=a.mapOffset(i),a=a.getBaseModel()),a=this._findMatchingBracket(a,i),a!==-1&&(j=[g.AnnotationType.createAnnotation(g.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),g.AnnotationType.createAnnotation(g.AnnotationType.ANNOTATION_CURRENT_BRACKET,i,i+1)]);this._bracketAnnotations=j;this.annotationModel.replaceAnnotations(b,j)}},_onMouseDown:function(a){if(a.clickCount===2){var b=this.view,c=b.getModel(),d=b.getOffsetAtLocation(a.x,
a.y);if(d>0){var e=d-1,f=c;c.getBaseModel&&(e=c.mapOffset(e),f=c.getBaseModel());e=this._findMatchingBracket(f,e);e!==-1&&(a.preventDefault(),a=e,c.getBaseModel&&(a=c.mapOffset(a,!0)),d>a&&(d--,a++),b.setSelection(a,d))}}},_onModelChanged:function(a){var b=a.start,c=a.removedCharCount,d=a.addedCharCount-c,e=this.view,a=e.getModel(),f=a.getBaseModel?a.getBaseModel():a,c=b+c,h=f.getCharCount(),j=this.comments.length,i=f.getLineStart(f.getLineAtOffset(b)),k=this._binarySearch(this.comments,i,!0),l=this._binarySearch(this.comments,
c,!1,k-1,j);k<j&&this.comments[k].start<=i&&i<this.comments[k].end?(i=this.comments[k].start,i>b&&(i+=d)):i=k===j&&j>0&&h-d===this.comments[j-1].end?this.comments[j-1].start:i;var m;l<j?(m=this.comments[l].end,m>b&&(m+=d),l+=1):(l=j,m=h);for(var o,h=this._findComments(f.getText(i,m),i),j=k;j<this.comments.length;j++)o=this.comments[j],o.start>b&&(o.start+=d),o.start>b&&(o.end+=d);var n=l-k!==h.length;if(!n)for(j=0;j<h.length;j++){o=this.comments[k+j];var q=h[j];if(o.start!==q.start||o.end!==q.end||
o.type!==q.type){n=!0;break}}j=[k,l-k].concat(h);Array.prototype.splice.apply(this.comments,j);n&&(j=i,o=m,a!==f&&(j=a.mapOffset(j,!0),o=a.mapOffset(o,!0)),e.redrawRange(j,o));if(this.foldingEnabled&&f!==a&&this.annotationModel){e=this.annotationModel;k=e.getAnnotations(i,m);i=[];for(m=[];k.hasNext();)if(o=k.next(),o.type===g.AnnotationType.ANNOTATION_FOLDING){m.push(o);for(j=0;j<h.length;j++)if(o.start===h[j].start&&o.end===h[j].end)break;j===h.length?(i.push(o),o.expand()):(j=o.start,l=o.end,j>
b&&(j-=d),l>b&&(l-=d),j<=b&&b<l&&j<=c&&c<l&&(j=f.getLineAtOffset(o.start),l=f.getLineAtOffset(o.end),j!==l?o.expanded||(o.expand(),e.modifyAnnotation(o)):e.removeAnnotation(o)))}b=[];for(j=0;j<h.length;j++){o=h[j];for(d=0;d<m.length;d++)if(m[d].start===o.start&&m[d].end===o.end)break;d===m.length&&(o=this._createFoldingAnnotation(a,f,o.start,o.end))&&b.push(o)}e.replaceAnnotations(i,b)}}};return{TextStyler:e}});
define("orion/editor/textMateStyler",["orion/editor/regex"],function(g){function k(d){var a;if(d instanceof Array){a=Array(d.length);for(var e=0;e<d.length;e++)a[e]=k(d[e])}else for(e in a={},d)if(Object.prototype.hasOwnProperty.call(d,e)){var f=d[e];a[e]=typeof f==="object"&&f!==null?k(f):f}return a}function i(d,a,e){this.initialize(d);this.grammar=k(a);this.externalGrammars=e?k(e):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var f={unsupported:[{regex:/\(\?[ims\-]:/,
func:function(){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(d){return d[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(d){function a(a,c){throw Error('Unsupported regex feature "'+a+'": "'+c[0]+'" at index: '+c.index+" in "+c.input);}var e="",g,d=f.processGlobalFlag("x",d,function(a){for(var c="",d=!1,e=a.length,f=0;f<e;){var g=a.charAt(f);if(!d&&g==="#")for(;f<e&&g!=="\r"&&g!=="\n";)g=a.charAt(++f);
else if(!d&&/\s/.test(g))for(;f<e&&/\s/.test(g);)g=a.charAt(++f);else g==="\\"?(c+=g,/\s/.test(a.charAt(f+1))||(c+=a.charAt(f+1),f+=1)):(g==="["?d=!0:g==="]"&&(d=!1),c+=g),f+=1}return c}),d=f.processGlobalFlag("i",d,function(a){e+="i";return a});for(g=0;g<this.unsupported.length;g++){var c;(c=this.unsupported[g].regex.exec(d))&&a(this.unsupported[g].func(c),c)}return RegExp(d,e)},processGlobalFlag:function(d,a,e){function f(a,c){for(var d=0,e=a.length,g=-1,j=c;j<e&&g===-1;j++)switch(a.charAt(j)){case "\\":j++;
break;case "(":d++;break;case ")":d--,d===0&&(g=j)}return g}var c="(?"+d+")",d="(?"+d+":";if(a.substring(0,c.length)===c)return e(a.substring(c.length));else if(a.substring(0,d.length)===d){c=f(a,0);if(c<a.length-1)throw Error("Only a "+d+") group that encloses the entire regex is supported in: "+a);return e(a.substring(d.length,c))}return a},hasBackReference:function(d){return/\\\d+/.test(d.source)},getSubstitutedRegex:function(d,a,e){for(var e=typeof e==="undefined"?!0:!1,d=d.source.split(/(\\\d+)/g),
f=[],c=0;c<d.length;c++){var b=d[c],h=/\\(\d+)/.exec(b);h?(b=a[h[1]]||"",f.push(e?g.escape(b):b)):f.push(b)}return RegExp(f.join(""))},groupify:function(d,a){for(var e=d.source,f=e.length,c=[],b=0,g=[],i=1,k=1,m=[],s={},r={},q=0;q<f;q++){var p=c[c.length-1],t=e.charAt(q);switch(t){case "(":if(p===4)c.pop(),m.push(")"),g[g.length-1].end=q;var o=q+2<f?e.charAt(q+1)+""+e.charAt(q+2):null;if(o==="?:"||o==="?="||o==="?!"){var v;o==="?:"?v=1:(v=3,b++);c.push(v);g.push({start:q,end:-1,type:v});m.push(t);
m.push(o);q+=o.length}else c.push(2),g.push({start:q,end:-1,type:2,oldNum:i,num:k}),m.push(t),b===0&&(r[k]=null),s[i]=k,i++,k++;break;case ")":p=c.pop();p===3&&b--;g[g.length-1].end=q;m.push(t);break;case "*":case "+":case "?":case "}":var z=t,u=e.charAt(q-1),o=q-1;if(t==="}"){for(v=q-1;e.charAt(v)!=="{"&&v>=0;v--);u=e.charAt(v-1);o=v-1;z=e.substring(v,q+1)}v=g[g.length-1];if(u===")"&&(v.type===2||v.type===4)){m.splice(v.start,0,"(");m.push(z);m.push(")");t={start:v.start,end:m.length-1,type:4,num:v.num};
for(u=0;u<g.length;u++)if(p=g[u],(p.type===2||p.type===4)&&p.start>=v.start&&p.end<=o)if(p.start+=1,p.end+=1,p.num+=1,p.type===2)s[p.oldNum]=p.num;g.push(t);k++;break}default:t!=="|"&&p!==2&&p!==4&&b===0&&(c.push(4),g.push({start:q,end:-1,type:4,num:k}),m.push("("),r[k]=null,k++),m.push(t),t==="\\"&&(t=e.charAt(q+1),m.push(t),q+=1)}}for(;c.length;)c.pop(),m.push(")");var e=RegExp(m.join("")),f={},a=a||s,w;for(w in a)a.hasOwnProperty(w)&&(f[w]="\\"+a[w]);e=this.getSubstitutedRegex(e,f,!1);return[e,
s,r]},complexCaptures:function(d){if(!d)return!1;for(var a in d)if(d.hasOwnProperty(a)&&a!=="0")return!0;return!1}};i.prototype={initialize:function(d){this.textView=d;this.textView.stylerOptions=this;var a=this;this._listener={onModelChanged:function(d){a.onModelChanged(d)},onDestroy:function(d){a.onDestroy(d)},onLineStyle:function(d){a.onLineStyle(d)},onStorage:function(d){a.onStorage(d)}};d.addEventListener("ModelChanged",this._listener.onModelChanged);d.addEventListener("Destroy",this._listener.onDestroy);
d.addEventListener("LineStyle",this._listener.onLineStyle);d.redrawLines()},onDestroy:function(){this.destroy()},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged),this.textView.removeEventListener("Destroy",this._listener.onDestroy),this.textView.removeEventListener("LineStyle",this._listener.onLineStyle),this.textView=null;this._listener=this._tree=this._styles=this.grammar=null},preprocess:function(d){for(d=[d];d.length!==0;){var a=
d.pop();if(!a._resolvedRule||!a._typedRule)if(a._resolvedRule=this._resolve(a),a._typedRule=this._createTypedRule(a),this.addStyles(a.name),this.addStyles(a.contentName),this.addStylesForCaptures(a.captures),this.addStylesForCaptures(a.beginCaptures),this.addStylesForCaptures(a.endCaptures),a._resolvedRule!==a&&d.push(a._resolvedRule),a.patterns)for(var e=0;e<a.patterns.length;e++)d.push(a.patterns[e])}},addStyles:function(d){if(d&&!this._styles[d]){this._styles[d]=[];for(var a=d.split("."),e=0;e<
a.length;e++)this._styles[d].push(a.slice(0,e+1).join("-"))}},addStylesForCaptures:function(d){for(var a in d)d.hasOwnProperty(a)&&this.addStyles(d[a].name)},ContainerRule:function(){function d(a){this.rule=a;this.subrules=a.patterns}d.prototype.valueOf=function(){return"aa"};return d}(),BeginEndRule:function(){function d(a){this.rule=a;this.beginRegex=f.toRegExp(a.begin);this.endRegex=f.toRegExp(a.end);this.subrules=a.patterns||[];this.endRegexHasBackRef=f.hasBackReference(this.endRegex);var d=f.complexCaptures(a.captures),
a=f.complexCaptures(a.beginCaptures)||f.complexCaptures(a.endCaptures);if(this.isComplex=d||a)d=f.groupify(this.beginRegex),this.beginRegex=d[0],this.beginOld2New=d[1],this.beginConsuming=d[2],d=f.groupify(this.endRegex,this.beginOld2New),this.endRegex=d[0],this.endOld2New=d[1],this.endConsuming=d[2]}d.prototype.valueOf=function(){return this.beginRegex};return d}(),MatchRule:function(){function d(a){this.rule=a;this.matchRegex=f.toRegExp(a.match);if(this.isComplex=f.complexCaptures(a.captures))a=
f.groupify(this.matchRegex),this.matchRegex=a[0],this.matchOld2New=a[1],this.matchConsuming=a[2]}d.prototype.valueOf=function(){return this.matchRegex};return d}(),_createTypedRule:function(d){return d.match?new this.MatchRule(d):d.begin?new this.BeginEndRule(d):new this.ContainerRule(d)},_resolve:function(d){var a=d;if(d.include){if(d.begin||d.end||d.match)throw Error('Unexpected regex pattern in "include" rule '+d.include);d=d.include;if(d.charAt(0)==="#"){if(a=this.grammar.repository&&this.grammar.repository[d.substring(1)],
!a)throw Error("Couldn't find included rule "+d+" in grammar repository");}else if(d==="$self")a=this.grammar;else if(d==="$base")throw Error('Include "$base" is not supported');else if(a=this._allGrammars[d],!a)for(var e=0;e<this.externalGrammars.length;e++){var f=this.externalGrammars[e];if(f.scopeName===d){this.preprocess(f);a=this._allGrammars[d]=f;break}}}return a},ContainerNode:function(){function d(a,d){this.parent=a;this.rule=d;this.children=[];this.end=this.start=null}d.prototype.addChild=
function(a){this.children.push(a)};d.prototype.valueOf=function(){var a=this.rule;return"ContainerNode { "+(a.include||"")+" "+(a.name||"")+(a.comment||"")+"}"};return d}(),BeginEndNode:function(){function d(a,d,g){this.parent=a;this.rule=d;this.children=[];this.setStart(g);this.endMatch=this.end=null;this.endRegexSubstituted=d.endRegexHasBackRef?f.getSubstitutedRegex(d.endRegex,g):null}d.prototype.addChild=function(a){this.children.push(a)};d.prototype.getIndexInParent=function(){return this.parent?
this.parent.children.indexOf(this):-1};d.prototype.setStart=function(a){this.start=a.index;this.beginMatch=a};d.prototype.setEnd=function(a){a&&typeof a==="object"?(this.endMatch=a,this.end=a.index+a[0].length):(this.endMatch=null,this.end=a)};d.prototype.shiftStart=function(a){this.start+=a;this.beginMatch.index+=a};d.prototype.shiftEnd=function(a){this.end+=a;this.endMatch&&(this.endMatch.index+=a)};d.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+
"}"};return d}(),push:function(d,a){if(a)for(var e=a.length;e>0;)d.push(a[--e])},exec:function(d,a,e){(a=d.exec(a))&&(a.index+=e);d.lastIndex=0;return a},afterMatch:function(d){return d.index+d[0].length},getEndMatch:function(d,a,e){if(d instanceof this.BeginEndNode){var f=d.rule,d=d.endRegexSubstituted||f.endRegex;return!d?null:this.exec(d,a,e)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,
!1,0)},onModelChanged:function(d){var a=d.addedCharCount,e=d.removedCharCount,d=d.start;if(this._tree){var f=this.textView.getModel(),c=f.getCharCount(),f=f.getLineEnd(f.getLineAtOffset(d)-1),b=this.getFirstDamaged(f,f),f=f===-1?0:f,a=b?this.parse(b,!0,f,d,a,e):c;this.textView.redrawRange(f,a)}else this.initialParse()},getFirstDamaged:function(d,a){if(d<0)return this._tree;for(var e=[this._tree],f=null;e.length;){var c=e.pop();if(!c.parent||this.isDamaged(c,d,a)){c instanceof this.BeginEndNode&&(f=
c);for(var b=0;b<c.children.length;b++)e.push(c.children[b])}}return f||this._tree},isDamaged:function(d,a,e){return d.start<=e&&d.end>a},parse:function(d,a,e,f,c,b){var g=this.textView.getModel(),i=g.getLineStart(g.getLineCount()-1),k=g.getCharCount(),m=this.getInitialExpected(d,e),s=-1;if(a)d.repaired=!0,d.endNeedsUpdate=!0,s=(s=d.children[d.children.length-1])?g.getLineEnd(g.getLineAtOffset(s.end+(c-b))):-1,f=g.getLineEnd(g.getLineAtOffset(f+b)),s=Math.max(s,f);for(var s=s===-1?k:s,f=m,r=d,q=!1,
p=e,t=-1;r&&(!a||p<s);){var o=this.getNextMatch(g,r,p);o||(p=p>=i?k:g.getLineStart(g.getLineAtOffset(p)+1));var v=o&&o.match,z=o&&o.rule,u=o&&o.isEnd;if(o&&o.isSub){if(p=this.afterMatch(v),z instanceof this.BeginEndRule)q=!0,a&&z===f.rule&&r===f.parent?(r=f,r.setStart(v),r.repaired=!0,r.endNeedsUpdate=!0,f=this.getNextExpected(f,"begin")):(a&&(this.prune(r,f),a=!1),v=new this.BeginEndNode(r,z,v),r.addChild(v),r=v)}else if(u||p===k){if(r instanceof this.BeginEndNode)v?(q=!0,t=Math.max(t,r.end),r.setEnd(v),
p=this.afterMatch(v),a&&r===f&&r.parent===f.parent?(r.repaired=!0,delete r.endNeedsUpdate,f=this.getNextExpected(f,"end")):a&&(this.prune(r,f),a=!1)):(r.setEnd(k),delete r.endNeedsUpdate);r=r.parent}a&&p>=s&&!q&&(this.prune(d,m),a=!1)}this.removeUnrepairedChildren(d,a,e);this.cleanup(a,d,e,s,k,c,b);return a?Math.max(t,p):p},removeUnrepairedChildren:function(d,a,e){if(a){for(var a=d.children,f=-1,c=0;c<a.length;c++){var b=a[c];if(!b.repaired&&this.isDamaged(b,e,Number.MAX_VALUE)){f=c;break}}if(f!==
-1)d.children.length=f}},cleanup:function(d,a,e,f,c,b,g){if(d){d=b-g;c=this.getIntersecting(f-d+1,c);a=this.getIntersecting(e,f);for(e=0;e<c.length;e++)f=c[e],!f.repaired&&f instanceof this.BeginEndNode&&(f.shiftEnd(d),f.shiftStart(d));for(e=0;e<a.length;e++)f=a[e],f.repaired&&f.endNeedsUpdate&&f.shiftEnd(d),delete f.endNeedsUpdate,delete f.repaired}else{a=this.getIntersecting(e,f);for(e=0;e<a.length;e++)delete a[e].repaired}},getNextMatch:function(d,a,e,f){var c=d.getLineAtOffset(e),c=d.getLineEnd(c),
b=d.getText(e,c),g=[],i=[],d=[],c=[];for(this.push(g,a.rule.subrules);g.length;){var k=g.length?g.pop():null,k=k&&k._resolvedRule._typedRule;if(k instanceof this.ContainerRule&&i.indexOf(k)===-1)i.push(k),this.push(g,k.subrules);else if(!k||!f||k.matchRegex){var m=k&&this.exec(k.matchRegex||k.beginRegex,b,e);m&&(d.push(m),c.push(k))}}g=Number.MAX_VALUE;i=-1;for(k=0;k<d.length;k++)if(m=d[k],m.index<g)g=m.index,i=k;if(!f&&(e=this.getEndMatch(a,b,e)))if(f=a.rule.applyEndPatternLast,i===-1||e.index<g||
!f&&e.index===g)return{isEnd:!0,rule:a.rule,match:e};return i===-1?null:{isSub:!0,rule:c[i],match:d[i]}},getInitialExpected:function(d,a){var e,f;if(d===this._tree)for(e=0;e<d.children.length;e++){if(f=d.children[e],f.start>=a)return f}else if(d instanceof this.BeginEndNode&&d.endMatch){var c=d.endMatch.index;for(e=0;e<d.children.length;e++)if(f=d.children[e],f.start>=a)break;if(f&&f.start<c)return f}return d},getNextExpected:function(d,a){if(a==="begin"){var e=d.children[0];return e?e:d}else if(a===
"end"&&(e=d.parent)){var f=e.children[e.children.indexOf(d)+1];return f?f:e}return null},prune:function(d,a){if(a.parent===d)d.children.length=a.getIndexInParent();else if(d instanceof this.BeginEndNode)d.endMatch=null,d.end=null;if(d.parent)d.parent.children.length=d.getIndexInParent()+1},onLineStyle:function(d){this._tree||this.initialParse();var a=d.lineStart,e=this.textView.getModel(),f=e.getLineEnd(d.lineIndex),c=e.getLineEnd(e.getLineAtOffset(a)-1),c=this.getFirstDamaged(c,c),a=this.getLineScope(e,
c,a,f);d.ranges=this.toStyleRanges(a);d.ranges.sort(function(a,c){return a.start-c.start})},getLineScope:function(d,a,e,f){for(var c=e,b=this.getInitialExpected(a,e),g=[],i=[];a&&c<f;){var k=this.getNextMatch(d,a,c);if(!k)break;var m=k&&k.match,s=k&&k.rule,r=k&&k.isSub,k=k&&k.isEnd;m.index!==c&&i.push({start:c,end:m.index,node:a});if(r)c=this.afterMatch(m),s instanceof this.BeginEndRule?(this.addBeginScope(g,m,s),a=b,b=this.getNextExpected(b,"begin")):this.addMatchScope(g,m,s);else if(k)c=this.afterMatch(m),
this.addEndScope(g,m,s),b=this.getNextExpected(b,"end"),a=a.parent}c<f&&i.push({start:c,end:f,node:a});d=this.getInheritedLineScope(i,e,f);return g.concat(d)},getInheritedLineScope:function(d){for(var a=[],e=0;e<d.length;e++)for(var f=d[e],c=f.node;c;){var b=c.rule.rule,g=b.name;if(b=b.contentName||g){this.addScopeRange(a,f.start,f.end,b);break}c=c.parent}return a},addBeginScope:function(d,a,e){var f=e.rule;this.addCapturesScope(d,a,f.beginCaptures||f.captures,e.isComplex,e.beginOld2New,e.beginConsuming)},
addEndScope:function(d,a,e){var f=e.rule;this.addCapturesScope(d,a,f.endCaptures||f.captures,e.isComplex,e.endOld2New,e.endConsuming)},addMatchScope:function(d,a,e){var f=e.rule,c=f.name;(f=f.captures)?this.addCapturesScope(d,a,f,e.isComplex,e.matchOld2New,e.matchConsuming):this.addScope(d,a,c)},addScope:function(d,a,e){e&&d.push({start:a.index,end:this.afterMatch(a),scope:e})},addScopeRange:function(d,a,e,f){f&&d.push({start:a,end:e,scope:f})},addCapturesScope:function(d,a,e,f,c,b){if(e)if(f){for(var f=
{1:0},g=0,i=1;a[i]!==void 0;i++)b[i]!==void 0&&(g+=a[i].length),a[i+1]!==void 0&&(f[i+1]=g);b=a.index;for(g=1;e[g];g++){var i=e[g].name,k=c[g],m=b+f[k];typeof a[k]!=="undefined"&&this.addScopeRange(d,m,m+a[k].length,i)}}else this.addScope(d,a,e[0]&&e[0].name)},getIntersecting:function(d,a){for(var e=[],f=this._tree?[this._tree]:[];f.length;){var c=f.pop(),b=!1;c instanceof this.ContainerNode?b=!0:this.isDamaged(c,d,a)&&(b=!0,e.push(c));if(b)for(var b=c.children.length,g=0;g<b;g++)f.push(c.children[g])}return e.reverse()},
toStyleRanges:function(d){for(var a=[],e=0;e<d.length;e++){var f=d[e],c=this._styles[f.scope];if(!c)throw Error("styles not found for "+f.scope);c=c.join(" ");a.push({start:f.start,end:f.end,style:{styleClass:c}})}return a}};return{RegexUtil:f,TextMateStyler:i}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(g,k){function i(a){return a.getProperty("objectClass").indexOf(d)!==-1&&a.getProperty("type")==="highlighter"}function f(a,d,c){this.initialize(a,d,c);this.lineStyles=[]}var d="orion.edit.highlighter",a=d+" service must be an event emitter";k.AnnotationType.registerType("orion.annotation.highlightError",{title:g.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}});
f.prototype={initialize:function(a,f,c){this.textView=a;this.serviceRegistry=f;this.annotationModel=c;this.services=[];var b=this;this.listener={onModelChanging:function(a){b.onModelChanging(a)},onModelChanged:function(a){b.onModelChanged(a)},onDestroy:function(a){b.onDestroy(a)},onLineStyle:function(a){b.onLineStyle(a)},onStyleReady:function(a){b.onStyleReady(a)},onServiceAdded:function(a){b.onServiceAdded(a.serviceReference,b.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){b.onServiceRemoved(a.serviceReference,
b.serviceRegistry.getService(a.serviceReference))}};a.addEventListener("ModelChanging",this.listener.onModelChanging);a.addEventListener("ModelChanged",this.listener.onModelChanged);a.addEventListener("Destroy",this.listener.onDestroy);a.addEventListener("LineStyle",this.listener.onLineStyle);f.addEventListener("registered",this.listener.onServiceAdded);f.addEventListener("unregistering",this.listener.onServiceRemoved);a=f.getServiceReferences(d);for(c=0;c<a.length;c++){var g=a[c];i(g)&&this.addServiceListener(f.getService(g))}},
onDestroy:function(){this.destroy()},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanging",this.listener.onModelChanging),this.textView.removeEventListener("ModelChanged",this.listener.onModelChanged),this.textView.removeEventListener("Destroy",this.listener.onDestroy),this.textView.removeEventListener("LineStyle",this.listener.onLineStyle),this.textView=null;if(this.services){for(var a=0;a<this.services.length;a++)this.removeServiceListener(this.services[a]);this.services=
null}if(this.serviceRegistry)this.serviceRegistry.removeEventListener("registered",this.listener.onServiceAdded),this.serviceRegistry.removeEventListener("unregistering",this.listener.onServiceRemoved),this.serviceRegistry=null;this.lineStyles=this.listener=null},onModelChanging:function(a){this.startLine=this.textView.getModel().getLineAtOffset(a.start)},onModelChanged:function(a){var d=this.startLine;(a.addedLineCount||a.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[d,a.removedLineCount].concat(this._getEmptyStyle(a.addedLineCount)))},
onStyleReady:function(a){var d=a.lineStyles||a.style,a=Number.MAX_VALUE,c=-1,b=this.textView.getModel(),f;for(f in d)d.hasOwnProperty(f)&&(this.lineStyles[f]=d[f],a=Math.min(a,f),c=Math.max(c,f));a=Math.max(a,0);c=Math.min(c,b.getLineCount());if(d=this.annotationModel){for(var g=d.getAnnotations(b.getLineStart(a),b.getLineEnd(c)),i=[];g.hasNext();){var m=g.next();m.type==="orion.annotation.highlightError"&&i.push(m)}g=[];for(m=a;m<=c;m++){f=m;var s=this.lineStyles[f],s=s&&s.errors;f=b.getLineStart(f);
if(s)for(var r=0;r<s.length;r++){var q=s[r];g.push(k.AnnotationType.createAnnotation("orion.annotation.highlightError",q.start+f,q.end+f))}}d.replaceAnnotations(i,g)}this.textView.redrawLines(a,c+1)},onLineStyle:function(a){function d(a,c){for(var e=a.length,f=[],g=0;g<e;g++){var j=a[g];f.push({start:j.start+c,end:j.end+c,style:j.style})}return f}var c=this.lineStyles[a.lineIndex];if(c)if(c.ranges)a.ranges=d(c.ranges,a.lineStart);else if(c.style)a.style=c.style},_getEmptyStyle:function(a){for(var d=
[],c=0;c<a;c++)d.push(null);return d},setContentType:function(a){this.contentType=a;if(this.services)for(a=0;a<this.services.length;a++){var d=this.services[a];if(d.setContentType){var c=this.serviceRegistry.getService("orion.page.progress");c?c.progress(d.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):d.setContentType(this.contentType)}}},onServiceAdded:function(a,d){i(a)&&this.addServiceListener(d)},onServiceRemoved:function(a,
d){this.services.indexOf(d)!==-1&&this.removeServiceListener(d)},addServiceListener:function(d){if(typeof d.addEventListener==="function"){if(d.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(d),d.setContentType&&this.contentType){var f=this.serviceRegistry.getService("orion.page.progress");f?f.progress(d.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):d.setContentType(this.contentType)}}else typeof console!==
"undefined"&&console.log(Error(a))},removeServiceListener:function(d){typeof d.removeEventListener==="function"?(d.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),d=this.services.indexOf(d),d!==-1&&this.services.splice(d,1)):typeof console!=="undefined"&&console.log(Error(a))}};return f});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(g,k,i,f){function d(a,d,c,b,h,l,n){function m(a,b){var e=a.getProperty("contentType"),g=a.getProperty("fileTypes");if(e)return d.isSomeExtensionOf(c,e).then(function(b){return b?a:null});else if(b&&g&&g.indexOf(b)!==-1)return e=new f,e.resolve(a),e;return null}var s=function(a){var c=null;switch(a&&a.id){case "application/javascript":case "application/json":c=
new g.TextStyler(b,"js",h);break;case "text/x-java-source":c=new g.TextStyler(b,"java",h);break;case "text/css":c=new g.TextStyler(b,"css",h)}return c}(c);if(s)return l=new f,l.resolve(s),l;for(var s=l&&l.split(".").pop().toLowerCase(),l=a.getServiceReferences("orion.edit.highlighter"),r=[],q=[],p=0;p<l.length;p++){var t=l[p];t.getProperty("type")==="grammar"&&r.push(t.getProperty("grammar"));(t=m(t,s))&&q.push(t)}return f.all(q,function(a){return{_error:a}}).then(function(d){for(var f,g=d.length-
1;g>=0;g--){var j=d[g];if(j&&!j._error&&(n||j.getProperty("type")!=="highlighter")){f=j;break}}var l;if(f)if(d=f.getProperty("type"),d==="highlighter")l=new i(b,a,h),l.setContentType(c);else if(d==="grammar"||typeof d==="undefined")f=f.getProperty("grammar"),l=new k.TextMateStyler(b,f,r);return l})}function a(a){this.serviceRegistry=a;this.styler=null}a.prototype={setup:function(a,f,c,b,g){g=typeof g==="undefined"?!0:g;if(this.styler)this.styler.destroy&&this.styler.destroy(),this.styler=null;var i=
this;return d(this.serviceRegistry,this.serviceRegistry.getService("orion.core.contenttypes"),a,f,c,b,g).then(function(a){return i.styler=a})},getStyler:function(){return this.styler}};return{createStyler:d,SyntaxHighlighter:a}});
define("orion/searchAndReplace/textSearcher",["i18n!orion/search/nls/messages","orion/editor/find","orion/commands","orion/objects","orion/webui/littlelib"],function(g,k,i,f,d){function a(a,d,c,b){k.Find.call(this,a,c,b);this._commandService=d}a.prototype=new k.Find;f.mixin(a.prototype,{getFindString:function(){var a=document.getElementById("localSearchFindWith");return!a?k.Find.prototype.getFindString.call(this):a.value},getReplaceString:function(){var a=document.getElementById("localSearchReplaceWith");
return!a?k.Find.prototype.getReplaceString(this):a.value},hide:function(){var a=this.isVisible();k.Find.prototype.hide.call(this);a&&this._commandService.closeParameterCollector()},show:function(a){k.Find.prototype.show.call(this,a);var d=a.findString,a=a.replaceString,c=document.getElementById("localSearchFindWith");c||(this._createActionTable(),c=document.getElementById("localSearchFindWith"));if(d)c.value=d;if(a)document.getElementById("localSearchReplaceWith").value=a;window.setTimeout(function(){c.select();
c.focus()},10)},_createActionTable:function(){var a=this;this._commandService.openParameterCollector("pageNavigationActions",function(d){var c=document.createElement("input");c.type="text";c.name=g["Find:"];c.className="parameterInput";c.id="localSearchFindWith";c.placeholder=g["Find With"];c.oninput=function(b){return a._handleInput(b)};c.onkeydown=function(b){return a._handleKeyDown(b)};d.appendChild(c);a._createButton("Next",d,function(){a.find(!0)});a._createButton("Previous",d,function(){a.find(!1)});
var b=a._editor.getTextView().getOptions("readonly");if(!b){var f=document.createElement("input");f.type="text";f.name=g["ReplaceWith:"];f.className="parameterInput";f.id="localSearchReplaceWith";f.placeholder=g["Replace With"];f.onkeydown=function(b){return a._handleKeyDown(b)};d.appendChild(f);a._createButton(g.Replace,d,function(){a.replace()});a._createButton(g["Replace All"],d,function(){a.replaceAll()})}f=document.createElement("div");d.appendChild(f);f.classList.add("findOptionsDiv");var k=
i.createDropdownMenu(f,g.Options,null,"dismissButton",null,!0);k.menuButton.classList.add("parameterInlineButton");i.createCheckedMenuItem(k.menu,g["Show all"],a._showAll,function(b){a.setOptions({showAll:b.target.checked});k.dropdown.close(!0)});i.createCheckedMenuItem(k.menu,g["Case sensitive"],!a._caseInsensitive,function(b){a.setOptions({caseInsensitive:!b.target.checked});k.dropdown.close(!0);a.find(!0)});i.createCheckedMenuItem(k.menu,g["Wrap search"],a._wrap,function(b){a.setOptions({wrap:b.target.checked});
k.dropdown.close(!0)});i.createCheckedMenuItem(k.menu,g["Incremental search"],a._incremental,function(b){a.setOptions({incremental:b.target.checked});k.dropdown.close(!0)});i.createCheckedMenuItem(k.menu,g["Whole Word"],a._wholeWord,function(b){a.setOptions({wholeWord:b.target.checked});k.dropdown.close(!0);a.find(!0)});i.createCheckedMenuItem(k.menu,g["Regular expression"],a._regex,function(b){a.setOptions({regex:b.target.checked});k.dropdown.close(!0);a.find(!0)});b||i.createCheckedMenuItem(k.menu,
g["Find after replace"],a._findAfterReplace,function(b){a.setOptions({findAfterReplace:b.target.checked});k.dropdown.close(!0)});return c},function(){a.hide()})},_createButton:function(a,f,c){var b=document.createElement("button");b.addEventListener("click",c.bind(this),!1);var g=this;b.addEventListener("keydown",function(a){a.keyCode===d.KEY.ESCAPE&&g.hide()});b.appendChild(document.createTextNode(a));b.className="dismissButton parameterInlineButton";f.appendChild(b)},_handleInput:function(){this._incremental&&
this.find(!0,null,!0);return!0},_handleKeyDown:function(a){var d=(this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&!a.shiftKey;if(d&&a.keyCode===70)return a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,!1;if((this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&a.keyCode===75||a.keyCode===13)return a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,a.keyCode===13?this.find(this._reverse?a.shiftKey:!a.shiftKey):this.find(!a.shiftKey),!1;if(d&&a.keyCode===82)return a.stopPropagation&&a.stopPropagation(),
a.cancelBubble=!0,this.replace(),!1;return a.keyCode===27?(this.hide(),!1):!0}});return{TextSearcher:a}});
define("orion/edit/nls/root/messages",{Fetching:"Fetching: ${0}","An error occurred: ":"An error occurred: ","No File Selected":"No File Selected","There are unsaved changes.  Do you still want to navigate away?":"There are unsaved changes.  Do you still want to navigate away?","Search Files":"Search Files","Enter search term:":"Enter search term:","Toggle Outliner":"Toggle Outliner","There are unsaved changes.":"There are unsaved changes.",Save:"Save","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?",
loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.","Reading metedata of":"Reading metedata of ${0}",Reading:"Reading ${0}","Save this file":"Save this file","Go to Line":"Go to Line","Go to specified line number":"Go to specified line number","Go to line:":"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find","No response from server.  Check your internet connection and try again.":"No response from server.  Check your internet connection and try again.",
"Saving file {0}":"Saving file ${0}","Running {0}":"Running ${0}","Saving...":"Saving...",View:"View",ViewTooltip:"View",Actions:"Actions",Navigator:"Navigator",New:"New",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding."});define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(g,k){var i={root:k};Object.keys(g).forEach(function(f){typeof i[f]==="undefined"&&(i[f]=g[f])});return i});
define("orion/editorCommands","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/webui/littlelib,orion/webui/dialogs/OpenResourceDialog,orion/Deferred,orion/URITemplate,orion/commands,orion/keyBinding,orion/commandRegistry,orion/globalCommands,orion/extensionCommands,orion/contentTypes,orion/editor/undoStack,orion/searchUtils,orion/PageUtil,orion/PageLinks,orion/util".split(","),function(g,k,i,f,d,a,e,j,c,b,h,l,n,m,s,r,q){function p(a,b,c,d,e,f,g,h,j,i){this.serviceRegistry=a;this.commandService=
b;this.fileClient=c;this.inputManager=d;this.toolbarId=e;this.pageNavId=g;this.isReadOnly=f;this._localSearcher=h;this._searcher=j;this.editorSettings=i}var b={},t=null;p.prototype={generateEditorCommands:function(a){this._generateSearchFilesCommand(a);this.isReadOnly||(this._generateUndoStackCommands(a),this._generateSaveCommand(a));this._generateGotoLineCommnand(a);this._generateFindCommnand(a);this.isReadOnly||this._generateEditCommands(a)},_generateUndoStackCommands:function(a){this.commandService.addCommand(new e.Command({name:g.Undo,
id:"orion.undo",callback:function(){a.getTextView().invokeAction("undo")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.undo",400,null,!0,a.getTextView().getKeyBindings("undo")[0]);this.commandService.addCommand(new e.Command({name:g.Redo,id:"orion.redo",callback:function(){a.getTextView().invokeAction("redo")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.redo",401,null,!0,a.getTextView().getKeyBindings("redo")[0])},_generateSearchFilesCommand:function(a){var b=
this;if(b._searcher){var c=!1,d=new e.Command({name:g["Search Files"],tooltip:g["Search Files"],id:"orion.searchFiles",callback:function(){a.getTextView().invokeAction("searchFiles")}});this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.pageNavId,"orion.searchFiles",1,null,!0,new j.KeyBinding("h",!0));a.getTextView().setKeyBinding(new j.KeyBinding("h",!0),"searchFiles");a.getTextView().setAction("searchFiles",function(){if(!c){var d=a.getSelection(),d=a.getText(d.start,
d.end),e=b.serviceRegistry,h=e.getService("orion.page.progress"),e=e.getService("orion.core.favorite"),j=new f.OpenResourceDialog({searcher:b._searcher,progress:h,favoriteService:e,searchRenderer:b._searcher.defaultRenderer,nameSearch:!1,title:g["Search Files"],message:g["Enter search term:"],initialText:d,onHide:function(){c=!1;a&&a.getTextView()&&a.getTextView().focus()}});window.setTimeout(function(){c=!0;j.show(i.node(b.toolbarId))},0);return!0}},d)}},_generateSaveCommand:function(a){var b=this;
a.getTextView().setKeyBinding(new j.KeyBinding("s",!0),"save");a.getTextView().setAction("save",function(){if(b.inputManager.save)b.inputManager.save();else if(b.inputManager.onSave){var c=a.getText();b.inputManager.onSave(b.inputManager.getInput(),c,function(){a.setInput(b.inputManager.getInput(),null,c,!0);b.inputManager.afterSave&&b.inputManager.afterSave()},function(a){a.log=!0})}return!0},{name:g.Save});this.commandService.addCommand(new e.Command({name:g.Save,tooltip:g["Save this file"],id:"orion.save",
visibleWhen:function(){return!b.editorSettings||!b.editorSettings().autoSaveEnabled},callback:function(){a.getTextView().invokeAction("save")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.save",1,null,!1,new j.KeyBinding("s",!0))},_generateGotoLineCommnand:function(a){var b=this,d=new c.ParametersDescription([new c.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var b=a.getModel().getLineAtOffset(a.getCaretOffset())+1;return[new c.CommandParameter("line",
"number","Line:",b.toString())]}),d=new e.Command({name:g["Go to Line"],tooltip:g["Go to specified line number"],id:"orion.gotoLine",parameters:d,callback:function(b){var c=a.getModel();b.parameters&&b.parameters.valueFor("line")?b=b.parameters.valueFor("line"):(b=c.getLineAtOffset(a.getCaretOffset()),(b=prompt(g["Go to line:"],b+1))&&(b=parseInt(b,10)));if(b)a.onGotoLine(b-1,0)}});this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.pageNavId,"orion.gotoLine",1,
null,!0,new j.KeyBinding("l",!q.isMac,!1,!1,q.isMac),new c.URLBinding("gotoLine","line"));a.getTextView().setAction("gotoLine",function(c){if(c)return a.onGotoLine(c.line-1,0,void 0,c.callback),!0;b.commandService.runCommand("orion.gotoLine");return!0},d)},_generateFindCommnand:function(a){var b=this,d=new c.ParametersDescription([new c.CommandParameter("find","text","Find:")],{clientCollect:!0},function(){var b=a.getSelection(),d="";b.end>b.start&&(d=a.getModel().getText(b.start,b.end));return[new c.CommandParameter("find",
"text","Find:",d)]}),d=new e.Command({name:g.Find,tooltip:g.Find,id:"orion.editor.find",parameters:d,callback:function(c){if(b._localSearcher){var d="",e=null,f=a.getSelection();f.end>f.start?d=a.getModel().getText(f.start,f.end):c.parameters&&c.parameters.valueFor("find")&&(d=c.parameters.valueFor("find"),e=s.matchResourceParameters(),m.convertFindURLBinding(e));if(e){c={regex:e.regEx,caseInsensitive:!e.caseSensitive};if(e.atLine)c.start=a.getModel().getLineStart(e.atLine-1);b._localSearcher.show({findString:d,
replaceString:e.replaceWith});b._localSearcher.find(!0,c)}else b._localSearcher.show({findString:d});return!0}return!1}});this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.pageNavId,"orion.editor.find",2,null,!0,new j.KeyBinding("f",!0),new c.URLBinding("find","find"));a.getTextView().setAction("find",function(a){if(a)return b._localSearcher.show(a),!0;b.commandService.runCommand("orion.editor.find");return!0},d)},_generateEditCommands:function(b){function c(a){var b=
new j.KeyBinding;j.KeyBinding.apply(b,a);return b}function f(a,b){!b&&a&&typeof a.HTML!=="undefined"&&delete a.HTML;var c=m.serviceRegistry.getService("orion.page.message");c?c.setProgressResult(a):window.console.log(a)}var m=this,n=this.serviceRegistry.getServiceReferences("orion.edit.command"),q=this.inputManager,p=this.serviceRegistry.getService("orion.page.progress"),s=function(c,d,h){h.callback=function(){b=this;var e=b.getSelection(),h=b.getModel(),j=h.getText(),i=function(a){a&&a.text?(b.setText(a.text),
a.selection&&(b.setSelection(a.selection.start,a.selection.end),b.getTextView().focus())):typeof a==="string"&&(b.setText(a,e.start,e.end),b.setSelection(e.start,e.start+a.length),b.getTextView().focus())};p.showWhile(d.run(h.getText(e.start,e.end),j,e,q.getInput()),k.formatMessage(g["Running {0}"],c.name)).then(function(b){if(b&&b.uriTemplate){var d=new a(b.uriTemplate),e=q.getFileMetadata();e.OrionHome=e.OrionHome||r.getOrionHome();var d=window.decodeURIComponent(d.expand(e)),g=document.createElement("iframe");
g.id=c.id;g.name=c.id;g.type="text/html";g.sandbox="allow-scripts allow-same-origin";g.frameborder=1;g.src=d;g.className="delegatedUI";if(b.width)g.style.width=b.width;if(b.height)g.style.height=b.height;g.style.visibility="hidden";window.document.body.appendChild(g);g.style.left=(window.innerWidth-parseInt(g.clientWidth,10))/2+"px";g.style.top=(window.innerHeight-parseInt(g.clientHeight,10))/2+"px";g.style.visibility="";window.addEventListener("message",function I(a){if(a.source===g.contentWindow&&
typeof a.data==="string"&&(a=JSON.parse(a.data),a.pageService==="orion.page.delegatedUI"&&a.source===c.id)){if(!a.cancelled)if(a.result)i(a.result);else if(a.Status||a.status)f(a.Status||a.status);window.removeEventListener("message",I,!1);window.document.body.removeChild(g)}},!1)}else b.Status||b.status?f(b.Status||b.status):i(b)});return!0};h.callback=h.callback.bind(b);return new e.Command(h)};d.when(function(a){if(t)return t;var b=a.getService("orion.core.contenttypes");b||(b=new l.ContentTypeService(a),
b=a.getService("orion.core.contenttypes"));return b.getContentTypes().then(function(a){return t=a})}(this.serviceRegistry),function(){var a=[],e=100;n.forEach(function(d){for(var f=m.serviceRegistry.getService(d),g={},j=d.getPropertyKeys(),i=0;i<j.length;i++)g[j[i]]=d.getProperty(j[i]);g.forceSingleItem=!0;d=h._createCommandOptions(g,d,m.serviceRegistry,t,!1,function(){return q.getFileMetadata()});a.push(d);d.then(function(a){a=s(g,f,a);m.commandService.addCommand(a);m.commandService.registerCommandContribution(m.toolbarId,
a.id,e);if(g.key){var d=b.getTextView();d.setKeyBinding(c(g.key),a.id);d.setAction(a.id,a.callback,a)}});e++});d.all(a,function(a){return{_error:a}}).then(function(){var a;if(a=q.getFileMetadata()){var c=i.node("pageActions");c&&(m.commandService.destroy(c),m.commandService.renderCommands(c.id,c,a,b,"button"));if(c=i.node("pageNavigationActions"))m.commandService.destroy(c),m.commandService.renderCommands(c.id,c,b,b,"button")}})})}};b.EditorCommandFactory=p;return b});
define("orion/edit/dispatcher",["orion/edit/dispatcher"],function(){function g(g,i,f){this.serviceRegistry=g;this.editor=i;this.contentType=f;this.contentTypeService=g.getService("orion.core.contenttypes");this.serviceReferences={};var d=this;this.listener={onServiceAdded:function(a){d._onServiceAdded(a.serviceReference)},onServiceRemoved:function(a){d._onServiceRemoved(a.serviceReference)}};this.serviceRegistry.addEventListener("registered",this.listener.onServiceAdded);this.serviceRegistry.addEventListener("unregistering",
this.listener.onServiceRemoved);this._init()}g.prototype={_init:function(){var g=this;this.editor.getTextView()?this._wire(this.serviceRegistry):this.editor.addEventListener("TextViewInstalled",function(){g._wire(g.serviceRegistry)})},_wire:function(g){for(var g=g.getServiceReferences("orion.edit.model"),i=0;i<g.length;i++)this._wireServiceReference(g[i])},_wireServiceReference:function(g){var i=g.getProperty("contentType");if(typeof i!==void 0&&i!==null){var f=this;this.contentTypeService.isSomeExtensionOf(this.contentType,
i).then(function(d){d&&f._wireService(g,f.serviceRegistry.getService(g))})}},_wireService:function(g,i){var f=g.getProperty("types"),d=this.editor.getTextView();if(f){for(var a=0;a<f.length;a++){var e=f[a],j=i["on"+e];j&&this._wireServiceMethod(g,i,j,d,e)}this._initService(i,d)}},_wireServiceMethod:function(g,i,f,d,a){i=function(a){f(a).then()};g=g.getProperty("service.id");this.serviceReferences[g]=this.serviceReferences[g]||[];this.serviceReferences[g].push([d,a,i]);d.addEventListener(a,i)},_onServiceRemoved:function(g){var g=
g.getProperty("service.id"),i=this.serviceReferences[g];if(i){for(var f=0;f<i.length;f++){var d=i[f];d[0].removeEventListener(d[1],d[2])}delete this.serviceReferences[g]}},_onServiceAdded:function(g){g.getProperty("objectClass").indexOf("orion.edit.model")!==-1&&this._wireServiceReference(g)},_initService:function(g,i){var f=g.onModelChanging;if(typeof f==="function"){var d=i.getModel(),a=d.getText(),d={type:"Changing",text:a,start:0,removedCharCount:0,addedCharCount:a.length,removedLineCount:0,addedLineCount:d.getLineCount()};
f.call(g,d)}}};return{Dispatcher:g}});
define("orion/edit/syntaxmodel",["orion/serviceTracker"],function(g){function k(a){return(a=a.getProperty("contentType"))?Array.isArray(a)?a:[a]:null}function i(a){var e=this.contentTypesMap={},j=new g(a,f),c=new g(a,d),b=this.notifySyntaxModelListeners.bind(this);j.addingService=function(b){var c=a.getService(b);(b=k(b))&&b.forEach(function(a){var b=e[a];b?b.push(c):e[a]=[c]})};j.removedService=function(a,b){var c=k(a);c&&c.forEach(function(a){var a=e.hasOwnProperty(a.id)?e[a.id]:null,c=a.indexOf(b);
c!==-1&&a.splice(c,1)})};c.addingService=function(c){var e=a.getService(c);k(c)&&(typeof e.addEventListener!=="function"?console.log(Error("A "+d+' service must provide an "addEventListener" method')):e.addEventListener("orion.edit.syntaxmodel.modelReady",b))};c.removedService=function(a,c){c&&typeof c.removeEventListener==="function"&&c.removeEventListener("orion.edit.syntaxmodel.modelReady",b)};j.open();c.open()}var f="orion.edit.syntaxmodel.listener",d="orion.edit.syntaxmodel.provider";i.prototype.notifySyntaxModelListeners=
function(a){var d=a.contentType,f=a.syntaxModel;typeof d!=="string"?console.log(Error('SyntaxModelReadyEvent must provide a "contentType" field')):(a=this.contentTypesMap.hasOwnProperty(d)?this.contentTypesMap[d]:null)&&a.forEach(function(a){a.setSyntaxModel(f)})};return i});
define("orion/inputManager","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/Deferred,orion/EventTarget,orion/objects,orion/globalCommands,orion/edit/dispatcher,orion/highlight,orion/edit/syntaxmodel,orion/PageUtil".split(","),function(g,k,i,f,d,a,e,j,c,b){function h(a){this._document=a.document||document;this._timeout=a.timeout;for(var a="keypress,keydown,keyup,mousemove,mousedown,mousemove".split(","),b=function(){this._resetTimer()}.bind(this),c=0;c<a.length;c++)this._document.addEventListener(a[c],
b,!0);f.attach(this)}function l(a,b){if(a){if(b.status===0)b={Severity:"Error",Message:g["No response from server.  Check your internet connection and try again."]};else{var c=b.responseText;if(c)try{b=JSON.parse(c)}catch(d){b={Severity:"Error",Message:c}}}a.setProgressResult(b)}else window.console.log(b)}function n(a){this.editor=a.editor;this.serviceRegistry=a.serviceRegistry;this.fileClient=a.fileClient;this.progressService=a.progressService;this.contentTypeService=a.contentTypeService;this.selection=
a.selection;this.syntaxHighlighter=new j.SyntaxHighlighter(this.serviceRegistry);this.syntaxModelWirer=new c(this.serviceRegistry);this._input=this._title="";this.dispatcher=null;f.attach(this)}h.prototype={_resetTimer:function(){var a=this._document.defaultView||this._document.parentWindow;if(this._timer)a.clearTimeout(this._timer),this._timer=null;if(this._timeout!==-1)this._timer=a.setTimeout(function(){this.onIdle({type:"Idle"});this._timer=null;this._resetTimer()}.bind(this),this._timeout)},
onIdle:function(a){return this.dispatchEvent(a)},setTimeout:function(a){this._timeout=a;this._resetTimer()}};d.mixin(n.prototype,{load:function(){var a=this.getInput();if(a){var b=this.fileClient,c=this.progressService,d=this.getEditor();if(this._fileMetadata)c.progress(b.read(a,!0),k.formatMessage(g["Reading metedata of"],a)).then(function(e){if(this._fileMetadata.ETag!==e.ETag)this._fileMetadata=e,(!d.isDirty()||window.confirm(g.loadOutOfSync))&&c.progress(b.read(a),k.formatMessage(g.Reading,a)).then(function(b){d.setInput(a,
null,b)})}.bind(this));else{var e=window.setTimeout(function(){d.reportStatus(k.formatMessage(g.Fetching,a))},800);(new i.all([c.progress(b.read(a),k.formatMessage(g.Reading,a)),c.progress(b.read(a,!0),k.formatMessage(g["Reading metedata of"],a))],function(a){return{_error:a}})).then(function(b){e&&window.clearTimeout(e);var c=b[0],b=b[1];if(c._error||b._error){var f=this.serviceRegistry.getService("orion.page.message");l(f,c._error||b._error);this._setNoInput()}else this._setInputContents(this._parsedLocation,
a,c,b);d.reportStatus("")}.bind(this))}}},processParameters:function(a){for(var b=this.getEditor(),c=["start","end","line","offset","length"],d=0;d<c.length;d++){var e=c[d];a[e]&&(a[e]=parseInt(a[e],10))}b.showSelection(a.start,a.end,a.line,a.offset,a.length)},getEditor:function(){return this.editor},getInput:function(){return this._input},getTitle:function(){return this._title},getFileMetadata:function(){return this._fileMetadata},getContentType:function(){return this._contentType},save:function(){function a(b){i.getFileMetadata().ETag=
b.ETag;c.setInput(d,null,e,!0);c.reportStatus("");i.afterSave&&i.afterSave();i._saving=!1}function b(a){c.reportStatus("");l(j,a);i._saving=!1;i._errorSaving=!0}if(!this._saving){var c=this.getEditor();if(c.isDirty()){this._saving=!0;this._errorSaving=!1;var d=this.getInput();c.reportStatus(g["Saving..."]);var e=c.getText(),f={ETag:this.getFileMetadata().ETag},f=this.fileClient.write(d,e,f),h=this.progressService,j=this.serviceRegistry.getService("orion.page.message");h&&(f=h.progress(f,k.formatMessage(g["Saving file {0}"],
d)));var i=this;f.then(a,function(c){c.status===412?window.confirm(g["Resource is out of sync with the server. Do you want to save it anyway?"])?(c=i.fileClient.write(d,e),h&&(c=h.progress(c,k.formatMessage(g["Saving file {0}"],d))),c.then(a,b)):i._saving=!1:b(c)})}}},setAutoLoadEnabled:function(a){this._autoLoadEnabled=a},setAutoSaveTimeout:function(a){this._autoSaveEnabled=a!==-1;if(this._idle)this._idle.setTimeout(a);else{var b=this.getEditor(),c=b.getTextView(),d=function(){b.removeEventListener("TextViewInstalled",
d);var c={document:b.getTextView().getOptions("parent").ownerDocument,timeout:a};this._idle=new h(c);this._idle.addEventListener("Idle",function(){this._errorSaving||this.save()}.bind(this));this._idle.setTimeout(a)}.bind(this);c?d():b.addEventListener("TextViewInstalled",d)}},setDirty:function(b){a.setDirtyIndicator(b)},setInput:function(a){if(!this._ignoreInput){if(!a)a=window.location.hash;if(typeof a==="string"){var c=this.getEditor();a&&a[0]!=="#"&&(a="#"+a);var d=b.matchResourceParameters(a);
if(c.isDirty()&&(c=this._location,b.matchResourceParameters(c).resource!==d.resource))if(this._autoSaveEnabled)this.save();else if(!window.confirm(g["There are unsaved changes.  Do you still want to navigate away?"])){window.location.hash=c;return}this._location=a;this._parsedLocation=d;this._ignoreInput=!0;this.selection.setSelections(a);this._ignoreInput=!1;(a=d.resource)?a===this._input?this.processParameters(d):(this._input=a,this._fileMetadata=null,this.load()):this._setNoInput()}}},_setNoInput:function(){this._input=
this._title=this._contentType=null;this.editor.uninstallTextView();this.dispatchEvent({type:"InputChanged",input:null})},_setInputContents:function(a,b,c,d){var f;d?(this._fileMetadata=d,this.setTitle(d.Location||String(d)),this._contentType=this.contentTypeService.getFileContentType(d),f=d.Name):(this._fileMetadata=null,this.setTitle(b),this._contentType=this.contentTypeService.getFilenameContentType(this.getTitle()),f=this.getTitle());var g=this.getEditor();g.getTextView()||(g.installTextView(),
g.getTextView().addEventListener("Focus",function(){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()}.bind(this)));this.dispatchEvent({type:"InputChanged",input:a,name:f,metadata:d,contents:c});var h=this;this.syntaxHighlighter.setup(this._contentType,g.getTextView(),g.getAnnotationModel(),b,!0).then(function(){var d=h.syntaxHighlighter.getStyler();g.setFoldingEnabled(d&&d.foldingEnabled);h.dispatchEvent({type:"ContentTypeChanged",contentType:h._contentType,
location:window.location});if(!h.dispatcher)h.dispatcher=new e.Dispatcher(h.serviceRegistry,g,h._contentType);g.setInput(b,null,c);h.processParameters(a)});this.setDirty(!1)},setTitle:function(a){var b=a.lastIndexOf("/");b!==-1&&(a=a.substring(b+1));this._title=a}});return{InputManager:n}});
define("orion/compare/resourceComparer","i18n!orion/compare/nls/messages,require,orion/Deferred,orion/webui/littlelib,orion/compare/compareUtils,orion/compare/diffProvider,orion/compare/compareView,orion/highlight,orion/fileClient,orion/globalCommands,orion/commands,orion/keyBinding,orion/searchAndReplace/textSearcher,orion/editorCommands,orion/objects,orion/inputManager,orion/editor/editorFeatures,orion/URL-shim".split(","),function(g,k,i,f,d,a,e,j,c,b,h,l,n,m,s,r,q){function p(a){this._syntaxHighlither=
new j.SyntaxHighlighter(a)}k={};k.DefaultDiffProvider=function(){function b(c){this.serviceRegistry=c;this._diffProvider=new a.DiffProvider(c)}b.prototype={_resolveTwoFiles:function(a,b){var c=this;return i.all([c._getContentType(a),c._getContentType(b)],function(a){return{_error:a}}).then(function(d){if(Array.isArray(d)&&d.length===2&&d[0]&&d[1]){var e=d[0],d=d[1];return(new i).resolve({oldFile:{URL:a,Name:c._resolveFileName(a),Type:e},newFile:{URL:b,Name:c._resolveFileName(b),Type:d},diffContent:c._diffContent})}else return e=
a?c._resolveFileName(a):"",d=b?c._resolveFileName(b):"",(new i).resolve({oldFile:{URL:a,Name:e,Type:null},newFile:{URL:b,Name:d,Type:null},diffContent:c._diffContent})})},_resolveFileName:function(a){return a.split("?")[0]},_getContentType:function(a){a=this._resolveFileName(a);return this.serviceRegistry.getService("orion.core.contenttypes").getFilenameContentType(a)},_resolveComplexFileURL:function(a){var b=this;return this._diffProvider.getDiffFileURI(a).then(function(a){return b._resolveTwoFiles(a.Old,
a.New)},function(){})},resolveDiff:function(a,b,c){this._hasConflicts=c;if(b)return this._resolveTwoFiles(b,a);else if(this._diffProvider){var d=this;return d._diffProvider.getDiffContent(a).then(function(b){d._diffContent=d._hasConflicts?b.split("diff --git")[1]:b;return d._resolveComplexFileURL(a)},function(){})}else console.log("A diff provider is needed for compound diff URL")}};return b}();p.prototype={highlight:function(a,b,c){return this._syntaxHighlither.setup(b,c.getTextView(),null,a,!1)}};
k.ResourceComparer=function(){function a(d,h,j,i){this._registry=d;this._commandService=h;this._fileClient=new c.FileClient(d);this._fileClient=new c.FileClient(d);this._searchService=this._registry.getService("orion.core.search");this._progress=this._registry.getService("orion.page.progress");this.setOptions(j,!0);this._compareView=j.toggleable?new e.toggleableCompareView(j.type==="inline"?"inline":"twoWay",i):j.type==="inline"?new e.inlineCompareView(i):new e.TwoWayCompareView(i);this._compareView.getWidget().setOptions({extCmdHolder:this});
i.highlighters||this._compareView.getWidget().setOptions({highlighters:[new p(d),new p(d)]});i.oldFile||this._compareView.getWidget().setOptions({oldFile:{readonly:!0}});i.newFile||this._compareView.getWidget().setOptions({newFile:{readonly:j.readonly}});this.initExtCmds();var k=this;this._inputManager=new r.InputManager({serviceRegistry:d,fileClient:k._fileClient,progressService:k._progress});s.mixin(this._inputManager,{filePath:"",getInput:function(){return this.filePath},setDirty:function(a){b.setDirtyIndicator(a)},
getFileMetadata:function(){return this._fileMetadata},getEditor:function(){return k._compareView.getWidget().getEditors()[1]},setInput:function(a){k._progress.progress(k._fileClient.read(a,!0),"Getting file metadata "+a).then(function(a){this._fileMetadata=a;if(k.options.savable){var b=f.node("pageActions");b&&(k._commandService.destroy(b),k._commandService.renderCommands(b.id,b,k._compareView.getWidget().getEditors()[1],k._compareView.getWidget().getEditors()[1],"button"))}a&&this.setTitle(a.Location,
a)}.bind(this),function(b){console.error("Error loading file metadata: "+b.message);this.setTitle(a)}.bind(this));this.lastFilePath=a},setTitle:function(a,c){var e;if(c)e=c.Name;b.setPageTarget({task:g.Compare,name:e,target:c,serviceRegistry:d,commandService:k._commandService,searchService:k._searchService,fileService:k._fileClient});a.charAt(0)==="*"?(b.setDirtyIndicator(!0),a.substring(1)):b.setDirtyIndicator(!1)},afterSave:function(){var a=k._compareView.getWidget().getEditors()[1].getTextView().getText();
k._compareView.getWidget().options.newFile.Content=a;k._compareView.getWidget().refresh()}});if(!j.readonly&&!j.toggleable&&this._compareView.getWidget().type==="twoWay")this._compareView.getWidget().options.newFile.keyBindingFactory=function(a,b,c,d){b=new n.TextSearcher(a,k._commandService,c);(new m.EditorCommandFactory(k._registry,k._commandService,k._fileClient,k._inputManager,"pageActions",!1,"pageNavigationActions",b)).generateEditorCommands(a);(new q.KeyBindingsFactory).createKeyBindings(a,
c,d,b)};this._compareView.getWidget().initEditors(g["fetching..."]);if(!j.readonly&&!j.toggleable&&this._compareView.getWidget().type==="twoWay"){var l=this._compareView.getWidget().getEditors();l[1].addEventListener("DirtyChanged",function(){this._inputManager.setDirty(l[1].isDirty())}.bind(this))}}a.prototype={_clearOptions:function(){this.options={}},setOptions:function(a,b){b&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},
generateLink:function(a){a=a.getCurrentDiffPos();a=d.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:this.options.readonly,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0});a=(new URL(a,window.location.href)).href;prompt(g["Copy the link URL:"],a)},openComparePage:function(a){a=a.getCurrentDiffPos();return d.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:!this.options.editableInComparePage,
conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0})},initExtCmds:function(){var a=this._compareView.getWidget().options.commandProvider;if(a&&a.getOptions().commandSpanId){var a=a.getOptions().commandSpanId,b=new h.Command({tooltip:g["Generate link of the current diff"],name:g["Generate Link"],id:"orion.compare.generateLink",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&a.options.extCmdHolder.options.generateLink},
callback:function(a){a.items.options.extCmdHolder.generateLink(a.items)}}),c=new h.Command({tooltip:g["Open the compare page"],name:g.Compare,id:"orion.compare.openComparePage",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&!a.options.extCmdHolder.options.generateLink},hrefCallback:function(a){return a.items.options.extCmdHolder.openComparePage(a.items)}});this._commandService.addCommand(b);this._commandService.addCommand(c);this._commandService.registerCommandContribution(a,
"orion.compare.openComparePage",98);this._commandService.registerCommandContribution(a,"orion.compare.generateLink",99,null,!1,new l.KeyBinding("l",!0,!0))}},_getFilesContents:function(a){var b=[];a.forEach(function(a){b.push(this._loadSingleFile(a))}.bind(this));return i.all(b,function(a){return{_error:a}})},_loadSingleFile:function(a){return this._registry.getService("orion.page.progress").progress(this._fileClient.read(a.URL),"Getting contents of "+a.URL).then(function(b){a.Content=b;return a}.bind(this),
function(b){if(b.status===404)a.Content="";return a}.bind(this))},start:function(){if(this.options.resource)if(this.options.diffProvider){var a=this;return a.options.diffProvider.resolveDiff(a.options.resource,a.options.compareTo,a.options.hasConflicts).then(function(b){a._compareView.getWidget().setOptions(b);var c=a._compareView.getWidget().options;c.oldFile.readonly=!0;if(a.options.readonly)c.newFile.readonly=!0;return a._getFilesContents(c.diffContent?[c.oldFile]:[c.oldFile,c.newFile]).then(function(){var b=
a._compareView.getWidget().refresh(!0);if(!a.options.readonly&&!a.options.toggleable&&a._compareView.getWidget().type==="twoWay")this._inputManager.filePath=a._compareView.getWidget().options.newFile.URL,a._inputManager.setInput(c.newFile.URL,a._compareView.getWidget().getEditors()[1]);return(new i).resolve(b)}.bind(a))})}else console.log("A diff provider is needed for Complex diff URL")}};return a}();return k});
define("orion/git/util",["i18n!git/nls/gitmessages","orion/compare/compareCommands","orion/compare/resourceComparer","orion/webui/littlelib"],function(g,k,i,f){function d(a){for(var b=0;b<j.length;b++)if(a.type===j[b])return!0;return!1}function a(a){for(var b=0;b<e.length;b++)if(a.type===e[b])return!0;return!1}var e=["Missing","Modified","Untracked","Conflicting"],j=["Added","Changed","Removed"];return{statusUILocation:"git/git-status2.html",isStaged:d,isUnstaged:a,isChange:function(c){return d(c)||
a(c)},hasStagedChanges:function(a){for(var b=0;b<j.length;b++)if(a[j[b]].length>0)return!0;return!1},hasUnstagedChanges:function(a){for(var b=0;b<e.length;b++)if(a[e[b]].length>0)return!0;return!1},createCompareWidget:function(a,b,d,e,g,j,s,r,q){var p=new i.DefaultDiffProvider(a),j=new k.CompareCommandFactory({commandService:b,commandSpanId:j,gridRenderer:r});(new i.ResourceComparer(a,b,{toggleable:!0,type:"inline",readonly:!0,hasConflicts:e,diffProvider:p,resource:d,compareTo:q,editableInComparePage:s},
{parentDivId:g,commandProvider:j})).start().then(function(a){var b=420;a<b&&(b=a);f.node(g).style.height=b+"px"})}}});
define("orion/git/gitPreferenceStorage",["orion/Deferred"],function(g){function k(g){this._prefix="/git/credentials";this._preferenceService=g.getService("orion.core.preference")}k.prototype={put:function(i,f){var d={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""};if(f!==void 0){if(f.gitSshUsername!==void 0&&f.gitSshUsername!==null)d.gitSshUsername=f.gitSshUsername;if(f.gitSshPassword!==void 0&&f.gitSshPassword!==null)d.gitSshPassword=f.gitSshPassword;if(f.gitPrivateKey!==void 0&&
f.gitPrivateKey!==null)d.gitPrivateKey=f.gitPrivateKey;if(f.gitPassphrase!==void 0&&f.gitPassphrase!==null)d.gitPassphrase=f.gitPassphrase}var a=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(e){var f=e.get("settings");f===void 0?a.reject():f.enabled?(e.put(i,d),a.resolve()):a.reject()});return a},get:function(i){var f={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""},d=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(a){var e=
a.get("settings");e===void 0?d.reject():e.enabled?(a=a.get(i),a!==void 0?d.resolve(a):d.resolve(f)):d.reject()});return d},isEnabled:function(){var i=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(f){f=f.get("settings");f===void 0?i.resolve(!1):i.resolve(f.enabled)});return i},enable:function(){var i=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(f){f.put("settings",{enabled:!0});i.resolve()});return i},disable:function(){var i=new g;this._preferenceService.getPreferences(this._prefix,
2).then(function(f){f.put("settings",{enabled:!1});i.resolve()});return i},remove:function(i){var f=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(d){d.remove(i);f.resolve()});return f},getRepositories:function(){var i=new g;this._preferenceService.getPreferences(this._prefix,2).then(function(f){for(var d=[],f=f.keys(),a=0;a<f.length;++a)f[a]!=="settings"&&d.push(f[a]);i.resolve(d)});return i}};return k.prototype.constructor=k});
define("orion/git/gitConfigPreference",["orion/Deferred"],function(g){function k(g){this._prefix="/git/config";this._preferenceService=g.getService("orion.core.preference")}k.prototype={getConfig:function(){var i=new g;this._preferenceService.getPreferences(this._prefix).then(function(f){f=f.get("userInfo");i.resolve(f)});return i},setConfig:function(i){var f=new g;this._preferenceService.getPreferences(this._prefix).then(function(d){d.put("userInfo",i);f.resolve()});return f}};return k.prototype.constructor=
k});
define("orion/git/widgets/ConfirmPushDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(g,k){function i(f){this._init(f)}i.prototype=new k.Dialog;i.prototype.TEMPLATE='<div id="header"></div>';i.prototype._init=function(f){var d=this;this.title="Git Push";this.modal=!0;this.messages=g;this.location=f.location;this.dialog2=f.dialog;this.func=f.func;this.buttons=[];this.buttons.push({callback:function(){d.destroy();d.dialog2.show()},text:"More"});this.buttons.push({callback:function(){d.destroy();d.func()},
text:"OK"});this._initialize()};i.prototype._bindToDom=function(){var f=this.$header;f.appendChild(document.createTextNode("You are going to push to the following remote: "+this.location));f.appendChild(document.createElement("br"));f.appendChild(document.createTextNode(" Click More to push to another remote or OK to push to default."))};i.prototype.constructor=i;return{ConfirmPushDialog:i}});
define("orion/git/widgets/RemotePrompterDialog",["i18n!git/nls/gitmessages","orion/webui/dialog","orion/explorers/explorer","orion/selection"],function(g,k,i,f){function d(a,c){this.explorer=c;this._init(a)}function a(a){this._init(a)}var e=function(){function a(c,b,d,e){this.gitClient=c;this.rootPath=b;this.fetchItems=d;this.root=e?e:null}a.prototype=new i.ExplorerModel;a.prototype.getRoot=function(a){var b=this;this.root?a(this.root):this.fetchItems(this.rootPath).then(function(d){b.root=d;a(d)})};
a.prototype.getIdentity=function(a){a.Location?(a=a.Location,a=a.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")):a="ROOT";return a};a.prototype.getChildren=function(a,b){a.children=[];if(a.Children){for(var d=0;d<a.Children.length;d++)a.Children[d].parent=a,a.children[d]=a.Children[d];b(a.Children)}else a.BranchLocation&&a.RemoteLocation?(a.children=[{GroupNode:"true",Location:a.BranchLocation,Name:"Branches",parent:a},{GroupNode:"true",Location:a.RemoteLocation,BranchLocation:a.BranchLocation,Name:"Remotes",
parent:a},{GroupNode:"true",Location:a.TagLocation,Name:"Tags",parent:a}],b(a.children)):a.GroupNode?this.gitClient.getGitBranch(a.Location).then(function(d){a.children=d.Children;for(var e=0;e<d.Children.length;e++)d.Children[e].parent=a;b(d.Children)}):a.Type==="Remote"&&this.gitClient.getGitBranch(a.Location).then(function(d){a.children=d.Children;for(var e=0;e<d.Children.length;e++)d.Children[e].parent=a;b(d.Children)})};return a}();d.prototype=new i.SelectionRenderer;d.prototype.constructor=
d;d.prototype.getLabelColumnIndex=function(){return 0};d.prototype.getCellElement=function(a,c,b){var d=document.createElement("td");b.appendChild(d);a=document.createElement("span");a.id=b.id+"navSpan";d.appendChild(a);a.className="mainNavColumn singleNavColumn";(c.children||c.Children||c.GroupNode||c.Type==="Remote"||c.BranchLocation&&c.RemoteLocation)&&this.getExpandImage(b,a);b=c.Name;c.Type==="RemoteTrackingBranch"&&!c.Id&&(b=c.Name+g[" [New branch]"]);a.appendChild(document.createTextNode(b))};
a.prototype=new k.Dialog;a.prototype.TEMPLATE='<div><div id="treeContentPane" style="width:25em; min-height: 25em; max-height: 30em; height: auto; overflow-y: auto; padding: 8px"></div><div id="newBranchPane" style="padding: 8px"><label for="newBranch">${New Branch:}</label><input id="newBranch" value="" disabled=true/></div></div>';a.prototype._init=function(a){var c=this;this.title=a.title||g["Choose a Folder"];this.modal=!0;this.messages=g;this.func=a.func;this.treeRoot=a.treeRoot;this.gitClient=
a.gitClient;this.hideNewBranch=a.hideNewBranch;this.serviceRegistry=a.serviceRegistry;this.buttons=[];this.buttons.push({callback:function(){c.$remoteOk.classList.contains(this.DISABLED)||(c.destroy(),c._execute.bind(c)())},text:"OK",isDefault:!0,id:"remoteOk"})};a.prototype._bindToDom=function(){var a=this;this.$newBranch.addEventListener("input",function(){a._validate()});if(this.hideNewBranch)this.$newBranchPane.style.display="none"};a.prototype._beforeShowing=function(){this._initialize();this._loadRemoteChildren()};
a.prototype._afterShowing=function(){this.$treeContentPane.focus();this._validate()};a.prototype._loadRemoteChildren=function(){this._createTree(new e(this.gitClient,null,this.gitClient.getGitClone,this.treeRoot))};a.prototype._createTree=function(a){var c=this,b=this.serviceRegistry.getService("orion.remotePrompter.selection");b||(b=new f.Selection(this.serviceRegistry,"orion.remotePrompter.selection"));var e=new d({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"});this.explorer=
new i.Explorer(this.serviceRegistry,b,e);e.explorer=this.explorer;this.explorer.createTree("treeContentPane",a);b.addEventListener("selectionChanged",function(a){c.$newBranch.disabled=a.selection&&a.selection.Type==="Remote"?!1:!0;c._validate(a.selection)})};a.prototype._validate=function(a){var c=function(a){a&&a.Type==="RemoteTrackingBranch"?this.$remoteOk.classList.remove(this.DISABLED):a&&a.Type==="Remote"&&this.$newBranch.value!==""?this.$remoteOk.classList.remove(this.DISABLED):this.$remoteOk.classList.add(this.DISABLED)};
a?c.bind(this)(a):this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(c.bind(this))};a.prototype._execute=function(){var a=this;this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(function(c){if(a.func)if(c.Type==="RemoteTrackingBranch")a.func(c,c.parent);else{var b=c.CloneLocation.substring(c.CloneLocation.indexOf(c.CloneLocation.split("/")[3])),d={};d.parent=c;d.FullName="refs/remotes/"+c.Name+"/"+a.$newBranch.value;d.Name=c.Name+"/"+a.$newBranch.value;
d.Type="RemoteTrackingBranch";d.Location="/gitapi/remote/"+c.Name+"/"+encodeURIComponent(a.$newBranch.value)+"/"+b;a.func(null,c,d)}})};a.prototype.constructor=a;return{RemotePrompterDialog:a}});
define("orion/git/widgets/ReviewRequestDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(g,k){function i(f){this._init(f)}i.prototype=new k.Dialog;i.prototype.TEMPLATE='<div><div id="treeContentPane" style="padding: 8px"><label for="reviewReqUrl">${Paste link in email or IM}</label><br><input id="reviewReqUrl" style="width: 50em" value=""/></div><div id="newBranchPane" style="padding: 8px"><label for="reviewerName">${Send the link to the reviewer}</label><br><input id="reviewerName" style="width: 30em"  value=""/></div></div>';i.prototype._init=
function(f){var d=this;this.title=f.title||g["Contribution Review Request"];this.modal=!0;this.messages=g;this.url=f.url;this.func=f.func;this.buttons=[];this.buttons.push({callback:function(){d.destroy();d.func(d.$reviewerName.value)},text:"Submit"});this._initialize()};i.prototype._bindToDom=function(){this.$reviewReqUrl.value=this.url};i.prototype.constructor=i;return{ReviewRequestDialog:i}});
define("orion/explorers/explorer-table","i18n!orion/navigate/nls/messages,require,orion/Deferred,orion/webui/littlelib,orion/i18nUtil,orion/fileUtils,orion/explorers/explorer,orion/EventTarget".split(","),function(g,k,i,f,d,a,e,j){function c(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 b(a){j.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=this.modelEventDispatcher=new j,c=this;"copy,copyMultiple,create,delete,deleteMultiple,import,move,moveMultiple".split(",").forEach(function(a){b.addEventListener(a,c.modelHandler[a].bind(c))});var d=this.renderer;
this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(a){d.setTarget(a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?"_blank":"_self":"_self")}},{pid:"nav.config"})}c.prototype=new e.ExplorerModel;c.prototype.getRoot=function(a){a(this.root)};c.prototype.processParent=function(a,b){if(this.excludeFiles||this.excludeFolders){var c=[],d;for(d in b)if(!(b[d].Directory?this.excludeFolders:this.excludeFiles))c.push(b[d]),b[d].parent=a;b=c}else for(c in b)b[c].parent=
a;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};c.prototype.getChildren=function(a,b){var c=this;a.children?b(a.children):a.Directory!==void 0&&a.Directory===!1?b([]):a.Location?this.registry.getService("orion.page.progress").progress(this.fileClient.fetchChildren(a.ChildrenLocation),"Fetching children of "+a.Name).then(function(d){b(c.processParent(a,
d))}):b([])};c.prototype.hasChildren=function(){var a=!1;this.root.Children&&(a=this.root.Children.length>0);return a};c.prototype.constructor=c;b.prototype=Object.create(e.Explorer.prototype);b.prototype.modelHandler={copy:function(){},copyMultiple:function(a){var b=this,c={};a.items.forEach(function(a){a=a.newValue.Parents[0]||b.treeRoot;c[a.Location]=a});Object.keys(c).forEach(function(a){b.changedItem(c[a],!0)})},create:function(a){this.changedItem(a.parent,!0,a.newValue)},"delete":function(){},
deleteMultiple:function(a){var a=a.items,b=this,c;if(a.some(function(a){return a.oldValue.Location===b.treeRoot.Location?(c=a.parent,!0):!1}))this.loadResourceList(c);else{var d={};a.forEach(function(a){a=a.parent;d[a.Location]=a});Object.keys(d).forEach(function(a){b.changedItem(d[a],!0)})}},"import":function(a){this.changedItem(a.target,!0)},move:function(a){var b=a.oldValue,c=a.newValue,a=a.parent,d=this,e=null;if(a.Projects)if(d.treeRoot.Location===b.Location){var f=d.treeRoot,b=c.ChildrenLocation?
c:this.fileClient.read(c.ContentLocation,!0);i.when(b,function(a){d.dispatchEvent({type:"rootMoved",oldValue:f,newValue:a});d.loadResourceList(a)})}else e=d.isExpanded(b)&&b;else b.Directory&&(e=d.isExpanded(b)&&c);d.changedItem(a,!0);e&&d.changedItem(e,!0)},moveMultiple:function(){this.changedItem(this.treeRoot,!0)}};b.prototype._makeDropTarget=function(b,c,e){function j(b,c,e,f,h,i){c=c||"";if(b.isFile)a.isAtRoot(e.Location)?f.registry.getService("orion.page.message").setProgressResult({Severity:"Error",
Message:g["You cannot copy files directly into the workspace.  Create a folder first."]}):b.file(function(a){h(e,a,f,a.name.indexOf(".zip")===a.name.length-4&&window.confirm(d.formatMessage(g["Unzip ${0}?"],a.name)))});else if(b.isDirectory){var k=b.createReader(),l=function(a){k.readEntries(function(d){for(var e=0;e<d.length;e++)j(d[e],c+b.name+"/",a,f,h,i)})},q=f.registry.getService("orion.page.progress");a.isAtRoot(e.Location)?q.progress(i.createProject(e.ChildrenLocation,b.name),"Initializing project "+
b.name).then(function(a){f.loadResourceList(f.treeRoot.Path,!0);q.progress(i.read(a.ContentLocation,!0),"Loading project info "+a.name).then(function(a){l(a)})}):q.progress(i.createFolder(e.Location,b.name),"Creating folder "+b.name).then(function(a){f.changedItem(e,!0);l(a)})}}if(this.dragAndDrop){var i=this,k=this.dragAndDrop,q=function(a){c.classList.remove("dragOver");a.preventDefault();a.stopPropagation()};if(e)this._oldDragLeave&&c.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=
q;c.addEventListener("dragleave",q,!1);q=function(a){if(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0)a.dataTransfer.dropEffect="copy";c.classList.add("dragOver");f.stop(a)};if(e)this._oldDragEnter&&c.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=q;c.addEventListener("dragenter",q,!1);q=function(a){if(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||
a.dataTransfer.effectAllowed.indexOf("copy")>=0)a.dataTransfer.dropEffect="copy";f.stop(a)};if(e&&!this._oldDragOver)c.addEventListener("dragover",q,!1),this._oldDragOver=q;q=function(e){c.classList.remove("dragOver");if(e.dataTransfer.items&&e.dataTransfer.items.length>0)for(var q=0;q<e.dataTransfer.items.length;q++){var o=null;typeof e.dataTransfer.items[q].getAsEntry==="function"?o=e.dataTransfer.items[q].getAsEntry():typeof e.dataTransfer.items[q].webkitGetAsEntry==="function"&&(o=e.dataTransfer.items[q].webkitGetAsEntry());
o&&j(o,null,b,i,k,i.fileClient)}else if(e.dataTransfer.files&&e.dataTransfer.files.length>0)for(q=0;q<e.dataTransfer.files.length;q++)o=e.dataTransfer.files[q],!o.length&&(!o.type||o.type==="")?i.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:d.formatMessage(g["Did not drop ${0}.  Folder drop is not supported in this browser."],o.name)}):a.isAtRoot(b.Location)?i.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:g["You cannot copy files directly into the workspace.  Create a folder first."]}):
k(b,o,i,o.name.indexOf(".zip")===o.name.length-4&&window.confirm(d.formatMessage(g["Unzip ${0}?"],o.name)));f.stop(e)};if(e)this._oldDrop&&c.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=q;c.addEventListener("drop",q,!1)}};b.prototype.changedItem=function(a,b){if(this.treeRoot&&this.treeRoot.Location===a.Location)return this.loadResourceList(this.treeRoot,b);var c=this;return this.registry.getService("orion.page.progress").progress(this.fileClient.fetchChildren(a.ChildrenLocation),"Fetching children of "+
a.Name).then(function(d){d=c.model.processParent(a,d);c.getNavHandler();c.myTree.refresh.bind(c.myTree)(a,d,b);return(new i).resolve(d)})};b.prototype.isExpanded=function(a){return this.renderer.tableTree.isExpanded(this.model.getId(a))};b.prototype.getNameNode=function(a){if(a=this.model.getId(a))return f.node(a+"NameLink")};b.prototype.scopeUp=function(){};b.prototype.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 i).resolve(this.treeRoot);this._lastPath=b;var e=this;return c||b!==this.treeRoot.Path?this.load(this.fileClient.loadWorkspace(b),"Loading "+b).then(function(){e.treeRoot.Path=b;typeof d==="function"&&d();e.dispatchEvent({type:"rootChanged",root:e.treeRoot});return(new i).resolve(e.treeRoot)},function(a){e.treeRoot.Path=null;e.dispatchEvent({type:"rootChanged",root:e.treeRoot});return(new i).reject(a)}):(new i).resolve(e.treeRoot)};b.prototype.load=function(a,b,d){var e=
f.node(this.parentId),j=f.node("progress");if(!j)j=document.createElement("div"),j.id="progress",f.empty(e),e.appendChild(j);f.empty(j);var k=setTimeout(function(){f.empty(j);j.appendChild(document.createTextNode(b))},500),q=this;return i.when(a,function(a){q.treeRoot={};clearTimeout(k);for(var b in a)q.treeRoot[b]=a[b];q.model=new c(q.registry,q.treeRoot,q.fileClient,q.parentId,q.excludeFiles,q.excludeFolders);q.model.processParent(q.treeRoot,a.Children);if(q.dragAndDrop)q._hookedDrag?q._makeDropTarget(q.treeRoot,
e,!0):(a=(a=e&&("draggable"in e||"ondragstart"in e&&"ondrop"in e))&&!(!window.File||!window.FileList||!window.FileReader),q._hookedDrag=!0,a?q._makeDropTarget(q.treeRoot,e,!0):(q.dragAndDrop=null,window.console.log("Local file drag and drop is not supported in this browser.")));q.model.hasChildren()?q.createTree(q.parentId,q.model,{navHandlerFactory:q.navHandlerFactory,setFocus:typeof q.setFocus==="undefined"?!0:q.setFocus,selectionPolicy:q.renderer.selectionPolicy,onCollapse:function(a){if(q.getNavHandler())q.getNavHandler().onCollapse(a)}}):
(f.empty(e),a=document.createElement("div"),a.classList.add("noFile"),a.textContent=g.NoFile,b=document.createElement("span"),b.classList.add("core-sprite-addcontent"),b.classList.add("icon-inline"),b.classList.add("imageSprite"),f.processDOMNodes(a,[b]),e.appendChild(a));if(typeof d==="function")try{d()}catch(h){q.registry&&q.registry.getService("orion.page.message").setErrorMessage(h)}if(typeof q.onchange==="function")q.onchange(q.treeRoot);return(new i).resolve(q.treeRoot)},function(a){clearTimeout(k);
q.registry.getService("orion.page.message").setProgressResult(a);return(new i).reject(a)})};b.prototype.onchange=function(){};b.prototype.constructor=b;return{FileExplorer:b,FileModel:c}});
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(g,k,i,f,d,a,e,j){function c(a,b){this.explorer=b;this._init(a)}function b(a){this._init(a)}c.prototype=new e.SelectionRenderer;c.prototype.constructor=c;c.prototype.getLabelColumnIndex=function(){return 0};c.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))};b.prototype=new i.Dialog;b.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>';
b.prototype._init=function(a){this.title=a.title||g["Choose a Folder"];this.modal=!0;this.buttons=[{text:g.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()};b.prototype._bindToDom=function(){this.loadFolderList("/");this._message?this.$message.appendChild(document.createTextNode(this._message)):this.$message.style.display="none";this.$directoryTree.focus()};
b.prototype.loadFolderList=function(a){a=f.makeRelative(a);this.selection=new d.Selection(this._serviceRegistry,"orion.directoryPrompter.selection");this.explorer=new j.FileExplorer({treeRoot:{children:[]},selection:this.selection,serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,parentId:"directoryTree",excludeFiles:!0,rendererFactory:function(a){return new c({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"},a)}});this.explorer.loadResourceList(a,!0,null)};b.prototype.done=
function(){this.selection.getSelection(function(a){this.hide();this._func(a)}.bind(this))};b.prototype.constructor=b;return{DirectoryPrompterDialog:b}});
define("orion/git/widgets/CloneGitRepositoryDialog",["i18n!git/nls/gitmessages","orion/webui/dialogs/DirectoryPrompterDialog","orion/webui/dialog","require"],function(g,k,i,f){function d(a){this._init(a)}d.prototype=new i.Dialog;d.prototype.TEMPLATE='<span id="basicPane"><div style="padding: 8px"><label for="gitUrl">${Repository URL:}</label><input id="gitUrl" style="width: 50em" value=""/></div><div style="padding: 8px; text-align: right;"><a id="advancedLink" href="javascript:">${Choose target location}</a><a id="advancedLinkHide" href="javascript:" style="display: none">${Default target location}</a></div></span><span id="advancedPane" style="display: none;"><div style="padding: 8px"><input id="isNewProject" type="radio" name="isNewProject" checked value="new"/><label for="gitName" style="padding: 0 8px">${New folder:}</label><input id="gitName" value=""></div><div style="padding: 8px"><input id="isExistingProject" type="radio" name="isNewProject" value="existing"/><label for="gitPath" style="padding: 0 8px">${Existing directory:}</label><input id="gitPath" type="hidden" value=""><span id="shownGitPath" style="padding-right: 24px"></span><a id="changeGitPath" href="javascript:">${Change...}</a></div></span>';d.prototype._init=
function(a){var d=this;this.title=a.title?a.title:g["Clone Git Repository"];this.modal=!0;this.messages=g;this.advancedShown=!1;this.alwaysShowAdvanced=a.alwaysShowAdvanced;this.advancedOnly=a.advancedOnly;this.url=a.url;this.serviceRegistry=a.serviceRegistry;this.fileClient=a.fileClient;this.func=a.func;this.buttons=[];this.buttons.push({callback:function(){d.destroy();d._execute()},text:"OK"});this._initialize()};d.prototype._bindToDom=function(){var a=this;if(this.url)this.$gitUrl.value=this.url;
if(this.advancedOnly)this.$basicPane.style.display="none",this.$advancedPane.style.display="",setTimeout(function(){a.$gitName.focus()},400);this.$changeGitPath.addEventListener("click",function(){a._openDirectoryPickerDialog()});this.$isExistingProject.addEventListener("click",function(){a._checkNewExisting()});this.$isNewProject.addEventListener("click",function(){a._checkNewExisting()});this.$gitName.addEventListener("focus",function(){a._showNewProject()});this.$advancedLink.addEventListener("click",
function(){a._showAdvanced()});this.$advancedLinkHide.addEventListener("click",function(){a._hideAdvanced()});this.alwaysShowAdvanced&&this._showAdvanced()};d.prototype._execute=function(){this.func&&this.func(this.advancedOnly?void 0:this.$gitUrl.value,this.advancedShown&&this.$isNewProject.checked?void 0:this.$gitPath.value,this.advancedShown&&!this.$isNewProject.checked?void 0:this.$gitName.value)};d.prototype._showAdvanced=function(){this.advancedShown=!0;this.$advancedPane.style.display="";this.$advancedLink.style.display=
"none";this.$advancedLinkHide.style.display=""};d.prototype._hideAdvanced=function(){this.advancedShown=!1;this.$advancedPane.style.display="none";this.$advancedLink.style.display="";this.$advancedLinkHide.style.display="none"};d.prototype._checkNewExisting=function(){this.$isExistingProject.checked?this._openDirectoryPickerDialog():this.$gitName.focus()};d.prototype._showNewProject=function(){this.$isNewProject.checked=!0};d.prototype._openDirectoryPickerDialog=function(){function a(a){var b=document.createElement("a");
b.href=f.toUrl("navigate/table.html")+"#"+a.ChildrenLocation;b.textContent=a.Name;return b}var d=this;this.$isExistingProject.checked=!0;var j=new k.DirectoryPrompterDialog({title:g["Choose a Folder"],serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,func:function(c){if(c&&c.Location){for(d.$gitPath.value=c.Location;d.$shownGitPath.hasChildNodes();)d.$shownGitPath.removeChild(d.$shownGitPath.lastChild);for(d.$shownGitPath.appendChild(a(c));c.parent&&c.parent.Location!=="/";)d.$shownGitPath.insertBefore(document.createTextNode("/"),
d.$shownGitPath.firstChild),d.$shownGitPath.insertBefore(a(c.parent),d.$shownGitPath.firstChild),c=c.parent}}});this._addChildDialog(j);j.show()};d.prototype.constructor=d;return{CloneGitRepositoryDialog:d}});
define("orion/git/widgets/GitCredentialsDialog",["i18n!git/nls/gitmessages","orion/git/gitPreferenceStorage","orion/webui/dialog"],function(g,k,i){function f(d){this._init(d)}f.prototype=new i.Dialog;f.prototype.TEMPLATE='<div id="gitCredentialsLabel" style="padding: 8px">${Repository URL:}<strong id="url"></strong></div><div id="gitSshUsernameRow" style="padding: 8px"><label id="gitSshUsernameLabel" for="gitSshUsername">${Username:}</label><input id="gitSshUsername" value=""></div><div id="gitSshPasswordRow" style="padding: 8px"><input id="isSshPassword" type="radio" name="isSshPassword" checked value="password"/><label id="gitSshPasswordLabel" for="gitSshPassword" style="padding: 0 8px">${Ssh password:}</label><input type="password" id="gitSshPassword" value="" style="width: 30em"></div><div style="padding: 8px"><div id="gitPrivateKeyRow"><input id="isPrivateKey" type="radio" name="isSshPassword" value="privateKey" style="vertical-align: top"/><label id="gitPrivateKeyLabel" for="gitPrivateKey" style="padding: 0 8px; vertical-align: top">${Private key:}</label><textarea id="gitPrivateKey" value=""></textarea></div><div id="gitPrivateKeyFileRow" style="padding-left: 8em"><label id="gitPrivateKeyFileLabel" for="gitPrivateKeyFile">${Private key file (optional):}</label><br><input id="gitPrivateKeyFile" multiple="false" type="file" size="53" label="Browse..."></div><div id="gitPassphraseRow" style="padding-left: 8em"><label id="gitPassphraseLabel" for="gitPassphrase">${Passphrase (optional):}</label><br><input type="password" id="gitPassphrase" value="" style="width: 30em"></div></div><div id="gitSaveCredentialsRow" style="padding: 8px"><img id="gitSaveCredentialsInfo" src="/images/info.gif""><input id="gitSaveCredentials" type="checkbox" name="gitSaveCredentials"><label id="gitSaveCredentialsLabel" for="gitSaveCredentials">${Don\'t prompt me again:}</label></div>';f.prototype._init=
function(d){var a=this;this.title=d.title||g["Git Credentials"];this.modal=!0;this.messages=g;this.options=d;if(!this.options.username&&!this.options.password&&!this.options.privatekey&&!this.options.passphrase)this.options.username=!0,this.options.password=!0,this.options.privatekey=!0,this.options.passphrase=!0;if(d.serviceRegistry)this._sshService=d.serviceRegistry.getService("orion.net.ssh"),this._progressService=d.serviceRegistry.getService("orion.page.progress");this.buttons=[];this.buttons.push({callback:function(){a.destroy();
a._execute()},text:"OK",isDefault:!0});this._initialize()};f.prototype._bindToDom=function(){var d=this;if(!this.options.username)this.$gitSshUsernameRow.style.display="none";if(!this.options.password)this.$gitSshPasswordRow.style.display="none";if(!this.options.privatekey)this.$gitPrivateKeyRow.style.display="none",this.$gitPrivateKeyFileRow.style.display="none";if(!this.options.passphrase)this.$gitPassphraseRow.style.display="none";if(this.options.errordata&&this.options.errordata.Url)this.$gitCredentialsLabel.style.display=
"block",this.$url.textContent=this.options.errordata.Url;if(this.options.errordata&&this.options.errordata.User&&this.options.errordata.User!=="")this.$gitSshUsername.value=this.options.errordata.User,this.$gitSshUsernameRow.style.display="none",setTimeout(function(){d.$gitSshPassword.focus()},400);(new k(this.options.serviceRegistry)).isEnabled().then(function(a){if(!a)d.$gitSaveCredentials.style.display="none",d.$gitSaveCredentialsLabel.style.display="none",d.$gitSaveCredentialsInfo.style.display=
"none"});this.$gitSshPassword.addEventListener("focus",function(){d.$isSshPassword.checked=!0});this.$gitPrivateKey.addEventListener("focus",function(){d.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("focus",function(){d.$isPrivateKey.checked=!0});this.$gitPassphrase.addEventListener("focus",function(){d.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("change",function(a){d.privateKeyFile=a.target.files[0]})};f.prototype._execute=function(){var d=this,a=this.$gitPrivateKey.value,
e=this.$url.textContent,f=function(a){if(d._sshService)d._sshService.getKnownHosts().then(function(c){if(d.options.func){var e=typeof d.options.failedOperation==="undefined"?d.options.errordata.failedOperation:d.options.failedOperation;e!=="undefined"&&d._progressService.removeOperation(e);d.options.func({gitSshUsername:d.$gitSshUsername.value,gitSshPassword:d.$isSshPassword.checked?d.$gitSshPassword.value:"",gitPrivateKey:d.$isPrivateKey.checked?a:"",gitPassphrase:d.$isPrivateKey.checked?d.$gitPassphrase.value:
"",knownHosts:c})}});else if(d.options.func){var c=typeof d.options.failedOperation==="undefined"?d.options.errordata.failedOperation:d.options.failedOperation;c!=="undefined"&&d._progressService.removeOperation(c);d.options.func({gitSshUsername:d.$gitSshUsername.value,gitSshPassword:d.$gitSshPassword.value,gitPrivateKey:a,gitPassphrase:d.$gitPassphrase.value,knownHosts:d.$gitSshKnownHosts.value})}};if(this.privateKeyFile){var c=new FileReader;c.onload=function(){return function(b){a=b.target.result;
b=new k(d.options.serviceRegistry);d.$gitSaveCredentials.checked?b.put(e,{gitPrivateKey:a,gitPassphrase:d.$gitPassphrase.value}).then(function(){f(a)}):f(a)}}(this.privateKeyFile);c.readAsText(this.privateKeyFile)}else a.length>0?(c=new k(d.options.serviceRegistry),d.$gitSaveCredentials.checked?c.put(e,{gitPrivateKey:a,gitPassphrase:d.$gitPassphrase.value}).then(function(){f(a)}):f(a)):(c=new k(d.options.serviceRegistry),d.$gitSaveCredentials.checked?c.put(e,{gitSshUsername:d.$gitSshUsername.value,
gitSshPassword:d.$gitSshPassword.value}).then(function(){f(a)}):f(a))};f.prototype.constructor=f;return{GitCredentialsDialog:f}});
define("orion/git/widgets/OpenCommitDialog","require,i18n!git/nls/gitmessages,orion/i18nUtil,orion/Deferred,orion/webui/dialog,orion/webui/littlelib".split(","),function(g,k,i,f,d,a){function e(a){this._init(a)}e.prototype=new d.Dialog;e.prototype.TEMPLATE='<div><label for="resourceName">${Type the commit name (sha1):}</label></div><div><input type="text" id="resourceName"></div><div id="results" style="max-height:400px; height:auto; overflow-y:auto;"></div>';e.prototype._init=function(a){this.title=
a.title||k["Find Commit"];this.modal=!0;this.messages=k;this.SEARCH_DELAY=500;this.timeoutId=null;this.time=0;this.serviceRegistry=a.serviceRegistry;if(!this.serviceRegistry)throw Error("Missing required argument: serviceRegistry");this.repositories=a.repositories;if(!this.repositories)throw Error("Missing required argument: repositories");this.commitName=a.commitName;this._initialize()};e.prototype._bindToDom=function(){var d=this;this.$resourceName.addEventListener("input",function(){d.time=+new Date;
d.timeoutId&&clearTimeout(d.timeoutId);d.timeoutId=setTimeout(d._checkSearch.bind(d),0)},!1);this.$resourceName.addEventListener("keydown",function(c){if(c.keyCode===a.KEY.ENTER){var b=a.$("a",d.$results);b&&(a.stop(c),window.open(b.href),d.hide())}},!1);this.$resourceName.value=this.commitName};e.prototype._checkSearch=function(){clearTimeout(this.timeoutId);var a=(new Date).getTime();a-this.time>this.SEARCH_DELAY?(this.time=a,this._doSearch()):this.timeoutId=setTimeout(this._checkSearch.bind(this),
50)};e.prototype._findCommitLocation=function(a,c,b){var d=this;b||(b=new f);a.length>0?this.serviceRegistry.getService("orion.page.progress").progress(d.serviceRegistry.getService("orion.git.provider").doGitLog("/gitapi/commit/"+c+a[0].ContentLocation+"?page=1&pageSize=1"),"Getting commit details "+c).then(function(a){b.resolve(a.Children[0])},function(){d._findCommitLocation(a.slice(1),c,b)}):b.reject();return b};e.prototype._doSearch=function(){var d=this,c=this.$resourceName&&this.$resourceName.value;
if(c){var b=document.createElement("div");b.appendChild(document.createTextNode(k["Searching..."]));a.empty(this.$results);this.$results.appendChild(b);this.serviceRegistry.getService("orion.page.message").setProgressMessage(k["Looking for the commit"]);this._findCommitLocation(this.repositories,c).then(function(b){a.empty(d.$results);d._displayCommit(b,d.$results);d.serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(){var b=document.createElement("div");b.appendChild(document.createTextNode("No commits found"));
a.empty(d.$results);d.$results.appendChild(b);d.serviceRegistry.getService("orion.page.message").setProgressMessage("")})}};e.prototype._displayCommit=function(d,c){var b=this,e=document.createElement("div");e.style.padding="10px";e.style.maxWidth="480px";a.empty(c);c.appendChild(e);var f=d.Message.split(/(\r?\n|$)/)[0],n=document.createElement("a");n.className="navlinkonpage";n.href=g.toUrl("git/git-commit.html#")+d.Location+"?page=1&pageSize=1";n.textContent=f;e.appendChild(n);n.addEventListener("mouseup",
function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&b.hide()},!1);n.addEventListener("keyup",function(c){c.keyCode===a.KEY.ENTER&&b.hide()},!1);f=document.createElement("div");f.style.paddingTop="15px";e.appendChild(f);if(d.AuthorImage)e=new Image,e.src=d.AuthorImage,e.name=d.AuthorName,e.className="git-author-icon",f.appendChild(e);e=document.createElement("div");e.textContent=i.formatMessage(k[" authored by ${0} {${1}) on ${2}"],d.AuthorName,d.AuthorEmail,(new Date(d.Time)).toLocaleString());f.appendChild(e);
e=document.createElement("div");e.textContent=i.formatMessage(k["committed by 0 (1)"],d.CommitterName,d.CommitterEmail);f.appendChild(e);e=document.createElement("div");e.style.paddingTop="15px";e.textContent=k["commit:"]+d.Name;f.appendChild(e);if(d.Parents&&d.Parents.length>0)c=document.createElement("div"),c.textContent=k["parent:"],e=document.createElement("a"),e.className="navlinkonpage",e.href=g.toUrl("git/git-commit.html#")+d.Parents[0].Location+"?page=1&pageSize=1",e.textContent=d.Parents[0].Name,
c.appendChild(e),e.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&b.hide()},!1),e.addEventListener("keyup",function(c){c.keyCode===a.KEY.ENTER&&b.hide()},!1),f.appendChild(c)};e.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};e.prototype.constructor=e;return{OpenCommitDialog:e}});
define("orion/git/widgets/CommitDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(g,k){function i(f){this._init(f)}i.prototype=new k.Dialog;i.prototype.TEMPLATE='<div style="display: none; padding-top: 10px; padding-bottom: 10px;" id="commitInfoBar"><strong id="commitInfo"></strong></div><div style="padding:4px"><label id="commitMessageLabel" for="commitMessage">${Message:}</label><input id="commitMessage" style="width: 30em" value=""></div><div style="padding:4px"><label id="amendLabel" for="amend">${Amend:}</label><input id="amend" type="checkbox"></div><div style="padding:4px"><label id="committerNameLabel" for="committerName">${Committer Name:}</label><input id="committerName" style="width: 30em" value=""></div><div style="padding:4px"><label id="committerEmailLabel" for="committerEmail">${Committer Email:}</label><input id="committerEmail" style="width: 30em" value=""></div><div style="padding:4px"><label id="authorNameLabel" for="authorName">${Author Name:}</label><input id="authorName" style="width: 30em" value=""></div><div style="padding:4px"><label id="authorEmailLabel" for="authorEmail">${Author Email:}</label><input id="authorEmail" style="width: 30em" value=""></div>';
i.prototype._init=function(f){var d=this;this.title=g["Commit Changes"];this.modal=!0;this.messages=g;this.options=f;this.buttons=[];this.buttons.push({callback:function(){d._execute()},text:"OK",id:"commitChangesButton"});this._initialize()};i.prototype._bindToDom=function(){var f=this;if(this.options.body.Message)this.$commitMessage.value=this.options.body.Message;this.$commitMessage.addEventListener("keyup",function(){f._validate()});if(this.options.body.Amend)this.$amend.checked=!0;if(this.options.body.CommitterName)this.$committerName.value=
this.options.body.CommitterName;this.$committerName.addEventListener("keyup",function(){f._validate()});if(this.options.body.CommitterEmail)this.$committerEmail.value=this.options.body.CommitterEmail;this.$committerEmail.addEventListener("keyup",function(){f._validate()});if(this.options.body.AuthorName)this.$authorName.value=this.options.body.AuthorName;this.$authorName.addEventListener("keyup",function(){f._validate()});if(this.options.body.AuthorEmail)this.$authorEmail.value=this.options.body.AuthorEmail;
this.$authorEmail.addEventListener("keyup",function(){f._validate()});this._validate()};i.prototype._validate=function(){this.$commitMessage.value?this.$committerName.value?this.$committerEmail.value?this.$authorName.value?this.$authorEmail.value?(this.$commitInfoBar.style.display="none",this.$commitChangesButton.classList.remove(this.DISABLED)):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The author mail is required."]):
(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The author name is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The committer mail is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The committer name is required."]):(this.$commitInfoBar.style.display=
"block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=g["The commit message is required."])};i.prototype._execute=function(){if(!this.$commitChangesButton.classList.contains(this.DISABLED)){if(this.options.func){var f={};f.Message=this.$commitMessage.value;f.Amend=this.$amend.checked?!0:!1;f.CommitterName=this.$committerName.value;f.CommitterEmail=this.$committerEmail.value;f.AuthorName=this.$authorName.value;f.AuthorEmail=this.$authorEmail.value;this.options.func(f)}this.hide()}};
i.prototype.constructor=i;return{CommitDialog:i}});
define("orion/git/widgets/ApplyPatchDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(g,k){function i(f){this._init(f)}i.prototype=new k.Dialog;i.prototype.TEMPLATE='<div style="padding:4px"><input type="radio" name="radio" value="urlRadio" id="urlRadio" checked/>URL:<input type="text" name="url" id="url"/></div><div style="padding:4px"><input type="radio" name="radio" value="fileRadio" id="fileRadio"/>File:<input type="file" name="selectedFile" id="selectedFile" class="uploadChooser" /></div>';i.prototype._init=
function(f){var d=this;this.title=g["Apply Patch"];this.modal=!0;this.messages=g;this.options=f;this.buttons=[];this.buttons.push({callback:function(){d._applyPatch()},text:"OK"});this._initialize()};i.prototype._bindToDom=function(){this.$selectedFile.onchange=function(){this.$urlRadio.checked=!1;this.$fileRadio.checked="fileRadio"}.bind(this);this.$url.onchange=function(){this.$urlRadio.checked="urlRadio";this.$fileRadio.checked=!1}.bind(this)};i.prototype._applyPatch=function(){var f=new FormData;
f.append("uploadedfile",this.$selectedFile.files[0]);f.append("url",this.$url.value);f.append("radio",this.$fileRadio.checked?"fileRadio":"urlRadio");this.req=new XMLHttpRequest;this.req.open("post",this.options.diffLocation);this.req.setRequestHeader("Orion-Version","1");this.req.onreadystatechange=this.handleReadyState.bind(this);this.req.send(f)};i.prototype.handleReadyState=function(){this.req.readyState===4&&(this.req.status===200?this.options.deferred&&this.options.deferred.resolve(this.req.responseText):
this.options.deferred&&this.options.deferred.reject(this.req.responseText),this.hide())};i.prototype.constructor=i;return{ApplyPatchDialog:i}});
define("orion/git/gitCommands","i18n!git/nls/gitmessages,require,orion/Deferred,orion/i18nUtil,orion/webui/littlelib,orion/commands,orion/commandRegistry,orion/git/util,orion/compare/compareUtils,orion/git/gitPreferenceStorage,orion/git/gitConfigPreference,orion/git/widgets/ConfirmPushDialog,orion/git/widgets/RemotePrompterDialog,orion/git/widgets/ReviewRequestDialog,orion/git/widgets/CloneGitRepositoryDialog,orion/git/widgets/GitCredentialsDialog,orion/git/widgets/OpenCommitDialog,orion/git/widgets/CommitDialog,orion/git/widgets/ApplyPatchDialog,orion/URL-shim,orion/PageLinks,orion/URITemplate".split(","),function(g,
k,i,f,d,a,e,j,c,b,h,l,n,m,s,r,q,p,t,o,v,z){var u={};(function(){function o(a){var b;try{b=JSON.parse(a.responseText)}catch(c){b={Message:g["Problem while performing the action"]}}b.HttpCode=a.status;return b}var x=!1;u.updateNavTools=function(a,b,c,e,f,g,h){var j=d.node(e);if(j)b.destroy(j);else throw"could not find toolbar "+e;b.renderCommands(e,j,g,c,"button");if(h&&(e=d.node(h)))b.destroy(e),b.renderCommands(h,e,g,c,"button");if(f&&(g=d.node(f)))b.destroy(f),b.renderCommands(f,g,null,c,"button");
x||(x=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var e=d.node(f);e&&(b.destroy(e),b.renderCommands(f,e,a.selections,c,"button"))}))};u.handleKnownHostsError=function(a,b,c,d){if(confirm(f.formatMessage(g["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],b.KeyType,b.Host,b.HostFingerprint))){var e=a.getService("orion.net.ssh");e.addKnownHosts(b.Host+" "+b.KeyType+" "+b.HostKey).then(function(){e.getKnownHosts().then(function(b){c.knownHosts=
b;typeof c.failedOperation!=="undefined"&&a.getService("orion.page.progress").removeOperation(c.failedOperation);d(c)})})}};u.handleSshAuthenticationError=function(a,c,d,e,f){var c=c?c.Url:void 0,g=function(){(new r.GitCredentialsDialog({title:f,serviceRegistry:a,func:e,errordata:d.errordata,failedOperation:d.failedOperation})).show()};d.gitSshUsername&&d.gitSshUsername!==""||d.gitSshPassword&&d.gitSshPassword!==""||d.gitPrivateKey&&d.gitPrivateKey!==""?g():(new b(a)).get(c).then(function(b){b.gitPrivateKey!==
""||b.gitSshUsername!==""||b.gitSshPassword!==""?(typeof d.failedOperation!=="undefined"&&a.getService("orion.page.progress").removeOperation(d.failedOperation),e({knownHosts:d.knownHosts,gitSshUsername:b.gitSshUsername,gitSshPassword:b.gitSshPassword,gitPrivateKey:b.gitPrivateKey,gitPassphrase:b.gitPassphrase})):g()},g)};u.getDefaultSshOptions=function(a,b){var c=new i,d=a.getService("orion.net.ssh"),e=b&&!b.optionsRequested?b.valueFor("sshuser"):"",f=b&&!b.optionsRequested?b.valueFor("sshpassword"):
"";d.getKnownHosts().then(function(a){c.resolve({knownHosts:a,gitSshUsername:e,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})});return c};u.handleProgressServiceResponse=function(a,b,c,d,e,f){a&&a.status!==void 0&&(a=o(a));if(!a||a.HttpCode===void 0)d&&d(a);else switch(a.HttpCode){case 401:if(a.JsonData)b.errordata=a.JsonData;if(a.failedOperation)b.failedOperation=a.failedOperation;u.handleSshAuthenticationError(c,a.JsonData,b,e,f);break;case 400:if(a.JsonData&&a.JsonData.HostKey){if(a.failedOperation)b.failedOperation=
a.failedOperation;u.handleKnownHostsError(c,a.JsonData,b,e);break}default:b=[],b.Severity="Error",b.HTML=!1,b.Message=a.DetailedMessage?a.DetailedMessage:a.Message,c.getService("orion.page.message").setProgressResult(b),d&&d(a)}};u.gatherSshCredentials=function(a,c,d){var e=new i,h;if(c.items.RemoteLocation!==void 0)h=c.items.RemoteLocation[0].GitUrl;else if(c.items.GitUrl!==void 0)h=c.items.GitUrl;else if(c.items.errorData!==void 0)h=c.items.errorData.Url;else if(c.items.toRef!==void 0)h=c.items.toRef.RemoteLocation[0].GitUrl;
var j=function(b){a.getService("orion.net.ssh").getKnownHosts().then(function(a){c.sshObject=b;e.resolve({knownHosts:a,gitSshUsername:b.gitSshUsername,gitSshPassword:b.gitSshPassword,gitPrivateKey:b.gitPrivateKey,gitPassphrase:b.gitPassphrase})})},k=c.errorData;if(k&&k.HostKey)return confirm(f.formatMessage(g["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],k.KeyType,k.Host,k.HostFingerprint))&&a.getService("orion.net.ssh").addKnownHosts(k.Host+" "+k.KeyType+
" "+k.HostKey).then(function(){c.sshObject&&(c.sshObject.gitSshUsername!==""||c.sshObject.gitSshPassword!==""||c.sshObject.gitPrivateKey!=="")?j({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""}):(new b(a)).get(h).then(function(a){j(a)},function(){j({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})}),e;var l=function(){if(!c.parameters&&!c.optionsRequested)j({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""});else if(c.parameters&&
!c.optionsRequested){var e=c.parameters?c.parameters.valueFor("sshuser"):"",f=c.parameters?c.parameters.valueFor("sshpassword"):"",g=c.parameters&&c.parameters.valueFor("saveCredentials")?c.parameters.valueFor("saveCredentials"):!1,i=new b(a);g?i.put(h,{gitSshUsername:e,gitSshPassword:f}).then(function(){j({gitSshUsername:e,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})}):j({gitSshUsername:e,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})}else(new r.GitCredentialsDialog({title:d,serviceRegistry:a,
func:j,errordata:k})).show()};c.sshObject&&(c.sshObject.gitSshUsername!==""||c.sshObject.gitSshPassword!==""||c.sshObject.gitPrivateKey!=="")?l():(new b(a)).get(h).then(function(a){a.gitPrivateKey!==""||a.gitSshUsername!==""||a.gitSshPassword!==""?j(a):l()},l);return e};u.handleGitServiceResponse=function(a,b,c,d){a&&a.status!==void 0&&(a=o(a));if(!a||!a.HttpCode)c&&c(a);else switch(a.HttpCode){case 401:d(a);break;case 400:if(a.JsonData&&a.JsonData.HostKey){d(a);break}default:d=[],d.Severity="Error",
d.HTML=!1,d.Message=a.DetailedMessage?a.DetailedMessage:a.Message,b.getService("orion.page.message").setProgressResult(d),c&&c(a)}};u.createFileCommands=function(d,h,o){function q(a){var b={Severity:"Error",HTML:!1};try{var c=JSON.parse(a.responseText);b.Message=c.DetailedMessage?c.DetailedMessage:c.Message?c.Message:g["Problem while performing the action"]}catch(e){b.Message=g["Problem while performing the action"]}d.getService("orion.page.message").setProgressResult(b)}var p=new e.ParametersDescription([new e.CommandParameter("name",
"text",g["Local Branch Name:"])]),p=new a.Command({name:g.Checkout,tooltip:g["Checkout the current tag, creating a local branch based on its contents."],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutTag",parameters:p,callback:function(a){var b=a.items,c=function(a,b,c){d.getService("orion.page.progress").showWhile(d.getService("orion.git.provider").checkoutTag(a,b,c),f.formatMessage(g["Checking out tag ${0}"],c)).then(function(){o.changedItem()},q)},e=b.Repository?
b.Repository.Location:b.CloneLocation;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&c(e,b.Name,a.parameters.valueFor("name"))},visibleWhen:function(a){return a.Type==="Tag"}});h.addCommand(p);p=new a.Command({name:g.Checkout,tooltip:g["Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first."],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",
id:"eclipse.checkoutBranch",callback:function(a){var b=a.items,c=d.getService("orion.git.provider"),e=d.getService("orion.page.message"),h=d.getService("orion.page.progress");e.setProgressMessage(b.Name?f.formatMessage(g["Checking out branch ${0}..."],b.Name):g["Checking out branch..."]);b.Type==="Branch"?h.progress(c.checkoutBranch(b.CloneLocation,b.Name),"Checking out branch "+b.Name).then(function(){e.setProgressResult(g["Branch checked out."]);o.changedItem(b.parent)},function(a){q(a)}):h.progress(c.addBranch(b.Repository?
b.Repository.BranchLocation:b.parent.parent.BranchLocation,null,b.Name),"Adding branch "+b.Name).then(function(a){h.progress(c.checkoutBranch(a.CloneLocation,a.Name),"Checking out branch "+b.Name).then(function(){e.setProgressResult(g["Branch checked out."]);o.changedItem(b.Repository?b.Repository.BranchLocation:b.parent.parent.parent)},function(a){q(a)})},function(a){q(a)})},visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});h.addCommand(p);p=new e.ParametersDescription([new e.CommandParameter("name",
"text","Name:")]);p=new a.Command({name:g["New Branch"],tooltip:g["Add a new local branch to the repository"],id:"eclipse.addBranch",parameters:p,callback:function(a){var b=a.items,c=d.getService("orion.page.progress"),e=function(a,e){c.progress(d.getService("orion.git.provider").addBranch(a,e),"Adding branch "+e).then(function(){o.changedItem(b)},q)},f;f=b.Type==="Clone"?b.BranchLocation:b.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&e(f,a.parameters.valueFor("name"))},
visibleWhen:function(a){return a.GroupNode&&a.Name==="Branches"||a.Type==="Clone"&&o.parentId==="artifacts"}});h.addCommand(p);p=new a.Command({name:g.Delete,tooltip:g["Delete the local branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeBranch",callback:function(a){var b=a.items,a=d.getService("orion.page.progress");confirm(f.formatMessage(g["Are you sure you want to delete branch ${0}?"],b.Name))&&a.progress(d.getService("orion.git.provider").removeBranch(b.Location),
"Removing branch "+b.Name).then(function(){o.changedItem?o.changedItem(b.parent):o.displayBranches&&o.displayBranches(b.ParentLocation,null)},q)},visibleWhen:function(a){return a.Type==="Branch"&&!a.Current}});h.addCommand(p);p=new a.Command({name:g.Delete,tooltip:g["Delete the remote tracking branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemoteBranch",callback:function(a){var b=a.items,c=d.getService("orion.page.progress");confirm(f.formatMessage(g["You're going to delete remote branch ${0} and push the change."],
b.Name)+"\n\n"+g["Are you sure?"])&&u.getDefaultSshOptions(d).then(function(a){var e=arguments.callee,f=d.getService("orion.git.provider"),h=d.getService("orion.page.message"),f=c.progress(f.doPush(b.Location,"",!1,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),g["Removing remote branch: "]+b.Name);h.createProgressMonitor(f,g["Removing remote branch: "]+b.Name);f.then(function(c){u.handleProgressServiceResponse(c,a,d,function(a){a.Result.Severity=="Ok"&&o.changedItem(b.parent)},
e,g["Delete Remote Branch"])},function(c){u.handleProgressServiceResponse(c,a,d,function(){},e,g["Removing remote branch: "]+b.Name)})})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});h.addCommand(p);p=new e.ParametersDescription([new e.CommandParameter("name","text","Name:"),new e.CommandParameter("url","url","Url:")]);p=new a.Command({name:g["New Remote"],tooltip:g["Add a new remote to the repository"],id:"eclipse.addRemote",parameters:p,callback:function(a){var b=a.items,c=
d.getService("orion.page.progress"),e=function(a,e,f){c.progress(d.getService("orion.git.provider").addRemote(a,e,f),"Adding remote "+a).then(function(){o.changedItem(b)},q)},f;f=b.Type==="Clone"?b.RemoteLocation:b.Location;a.parameters.valueFor("name")&&a.parameters.valueFor("url")&&e(f,a.parameters.valueFor("name"),a.parameters.valueFor("url"))},visibleWhen:function(a){return a.GroupNode&&a.Name==="Remotes"||a.Type==="Clone"&&o.parentId==="artifacts"}});h.addCommand(p);p=new a.Command({name:g.Delete,
tooltip:g["Delete the remote from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemote",callback:function(a){var b=a.items;confirm(f.formatMessage(g["Are you sure you want to delete remote ${0}?"],b.Name))&&d.getService("orion.page.progress").progress(d.getService("orion.git.provider").removeRemote(b.Location),"Removing remote "+b.Name).then(function(){o.changedItem(b.parent)},q)},visibleWhen:function(a){return a.Type==="Remote"}});h.addCommand(p);p=new a.Command({name:g.Pull,
tooltip:g["Pull from the repository"],imageClass:"git-sprite-pull",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pull",callback:function(a){var b=a.items,c=b.Location,e=b.Name;u.getDefaultSshOptions(d).then(function(a){var f=arguments.callee,h=d.getService("orion.git.provider"),j=d.getService("orion.page.message"),h=d.getService("orion.page.progress").progress(h.doPull(c,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),g["Pulling: "]+e);j.createProgressMonitor(h,
g["Pulling: "]+e);var i;h.then(function(c){u.handleProgressServiceResponse(c,a,d,function(){b.Type==="Clone"&&o.changedItem(b)},f,"Pull Git Repository")},function(c){if(i)c.failedOperation=i;u.handleProgressServiceResponse(c,a,d,function(){o.changedItem(b)},f,g["Pull Git Repository"])},function(a){i=a.Location})})},visibleWhen:function(a){return a.Type==="Clone"}});h.addCommand(p);p=new a.Command({name:g["Git Log"],tooltip:g["Open the log for the branch"],id:"eclipse.openGitLog",hrefCallback:function(a){a=
a.items;return k.toUrl("git/git-log.html")+"#"+a.CommitLocation+"?page=1"},visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});h.addCommand(p);p=new a.Command({name:g["Git Log"],tooltip:g["Open the log for the repository"],id:"eclipse.openGitLogAll",imageClass:"git-sprite-log",spriteClass:"gitCommandSprite",hrefCallback:function(a){return k.toUrl("git/git-log.html")+"#"+a.items.CommitLocation+"?page=1"},visibleWhen:function(a){return!a.CommitLocation||!a.StatusLocation?
!1:!0}});h.addCommand(p);p=new a.Command({name:g["Git Status"],tooltip:g["Open the status for the repository"],id:"eclipse.openGitStatus",hrefCallback:function(a){return k.toUrl(j.statusUILocation)+"#"+a.items.StatusLocation},visibleWhen:function(a){return!a.StatusLocation?!1:!0}});h.addCommand(p);p=new a.Command({name:g["Show in Navigator"],tooltip:g["Show the repository folder in the file navigator"],id:"eclipse.openCloneContent",hrefCallback:function(a){return k.toUrl("navigate/table.html")+"#"+
a.items.ContentLocation+"?depth=1"},visibleWhen:function(a){return!a.ContentLocation?!1:!0}});h.addCommand(p);p=new a.Command({name:g["Compare With Each Other"],id:"eclipse.compareGitCommits",hrefCallback:function(a){a=a.items;return d.getService("orion.page.progress").progress(d.getService("orion.git.provider").getDiff(a[1].DiffLocation,a[0].Name),"Generating Diff for "+a[0].Name+" and "+a[1].Name).then(function(a){return c.generateCompareHref(a,{readonly:!0})})},visibleWhen:function(a){return o.isDirectory?
!1:Array.isArray(a)&&a.length===2&&a[0].Type==="Commit"&&a[1].Type==="Commit"?!0:!1}});h.addCommand(p);p=new a.Command({name:g["Compare With Working Tree"],id:"eclipse.compareWithWorkingTree",hrefCallback:function(a){return c.generateCompareHref(a.items.DiffLocation,{})},visibleWhen:function(a){return a.Type==="Commit"&&a.ContentLocation!==null&&!o.isDirectory}});h.addCommand(p);p=new a.Command({name:g.Open,id:"eclipse.openGitCommit",hrefCallback:function(a){return k.toUrl("edit/edit.html")+"#"+a.items.ContentLocation},
visibleWhen:function(a){return a.Type==="Commit"&&a.ContentLocation!=null&&!o.isDirectory}});h.addCommand(p);p=new a.Command({name:g.Fetch,tooltip:g["Fetch from the remote"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",callback:function(a){var c=a.items,f=c.Location,j=c.Name,i=function(a,c){a.JsonData.HostKey?(c.parameters=null,c.errorData=a.JsonData,c.errorData.failedOperation=a.failedOperation,h.collectParameters(c)):c.optionsRequested?(c.errorData=a.JsonData,
c.errorData.failedOperation=a.failedOperation,h.collectParameters(c)):(new b(d)).isEnabled().then(function(b){c.parameters=b?a.JsonData.User?new e.ParametersDescription([new e.CommandParameter("sshpassword","password",g["SSH Password:"]),new e.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new e.ParametersDescription([new e.CommandParameter("sshuser","text",g["SSH User Name:"]),new e.CommandParameter("sshpassword","password",g["SSH Password:"]),
new e.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new e.ParametersDescription([new e.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0}):new e.ParametersDescription([new e.CommandParameter("sshuser","text",g["SSH User Name:"]),new e.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});c.errorData=a.JsonData;c.errorData.failedOperation=a.failedOperation;
h.collectParameters(c)})},k=function(){a.parameters&&a.parameters.optionsRequested?(a.parameters=null,a.optionsRequested=!0,h.collectParameters(a)):(a.errorData&&a.errorData.failedOperation&&d.getService("orion.page.progress").removeOperation(a.errorData.failedOperation),u.gatherSshCredentials(d,a).then(function(b){var e=d.getService("orion.git.provider"),h=d.getService("orion.page.message"),b=d.getService("orion.page.progress").progress(e.doFetch(f,!1,b.gitSshUsername,b.gitSshPassword,b.knownHosts,
b.gitPrivateKey,b.gitPassphrase),g["Fetching remote: "]+j);h.createProgressMonitor(b,g["Fetching remote: "]+j);b.then(function(b){u.handleGitServiceResponse(b,d,function(){o.changedItem(c)},function(b){i(b,a)})},function(b){u.handleGitServiceResponse(b,d,function(){o.changedItem(c)},function(b){i(b,a)})})}))};if(a.items.GitUrl)k();else{var l=d.getService("orion.git.provider"),m=d.getService("orion.page.progress");m.progress(l.getGitRemote(f),"Getting remote details "+j).then(function(b){m.progress(l.getGitClone(b.CloneLocation),
"Getting git repository information "+b.Name).then(function(b){a.items.GitUrl=b.Children[0].GitUrl;k()},q)},q)}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Remote"?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});h.addCommand(p);p=new a.Command({name:g["Force Fetch"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",tooltip:g["Fetch from the remote branch into your remote tracking branch overriding its current content"],id:"eclipse.orion.git.fetchForce",
callback:function(a){if(confirm(g["You're going to override content of the remote tracking branch. This can cause the branch to lose commits."]+"\n\n"+g["Are you sure?"])){var c=a.items,f=c.Location,j=c.Name,i=function(a,c){a.JsonData.HostKey?(c.parameters=null,c.errorData=a.JsonData,c.errorData.failedOperation=a.failedOperation,h.collectParameters(c)):c.optionsRequested?(c.errorData=a.JsonData,h.collectParameters(c)):(new b(d)).isEnabled().then(function(b){c.parameters=b?a.JsonData.User?new e.ParametersDescription([new e.CommandParameter("sshpassword",
"password",g["SSH Password:"]),new e.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new e.ParametersDescription([new e.CommandParameter("sshuser","text",g["SSH User Name:"]),new e.CommandParameter("sshpassword","password",g["SSH Password:"]),new e.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new e.ParametersDescription([new e.CommandParameter("sshpassword","password",g["SSH Password:"])],
{hasOptionalParameters:!0}):new e.ParametersDescription([new e.CommandParameter("sshuser","text",g["SSH User Name:"]),new e.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});c.errorData=a.JsonData;c.errorData.failedOperation=a.failedOperation;h.collectParameters(c)})},k=function(){a.parameters&&a.parameters.optionsRequested?(a.parameters=null,a.optionsRequested=!0,h.collectParameters(a)):(a.errorData&&a.errorData.failedOperation&&d.getService("orion.page.progress").removeOperation(a.errorData.failedOperation),
u.gatherSshCredentials(d,a).then(function(b){var e=d.getService("orion.git.provider"),h=d.getService("orion.page.progress"),k=d.getService("orion.page.message"),b=h.progress(e.doFetch(f,!0,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),g["Fetching remote: "]+j);k.createProgressMonitor(b,g["Fetching remote: "]+j);b.then(function(b){u.handleGitServiceResponse(b,d,function(){o.changedItem(c)},function(b){i(b,a)})},function(b){u.handleGitServiceResponse(b,d,function(){o.changedItem(c)},
function(b){i(b,a)})})}))};if(a.items.GitUrl)k();else{var l=d.getService("orion.git.provider");l.getGitRemote(f).then(function(b){l.getGitClone(b.CloneLocation).then(function(b){a.items.GitUrl=b.Children[0].GitUrl;k()})})}}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Remote"?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});h.addCommand(p);p=new a.Command({name:g.Merge,tooltip:g["Merge the content from the branch to your active branch"],
imageClass:"git-sprite-merge",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.merge",callback:function(a){var b=a.items,a=d.getService("orion.git.provider"),c=d.getService("orion.page.progress"),e=d.getService("orion.page.message");c.progress(a.doMerge(b.HeadLocation,b.Name,!1),"Merging "+b.Name).then(function(a){var c={};if(a.Result==="FAST_FORWARD"||a.Result==="ALREADY_UP_TO_DATE")c.Severity="Ok",c.HTML=!1,c.Message=a.Result;else if(a.Result){var d=b.HeadLocation.replace("commit/HEAD","status");
c.Severity="Warning";c.HTML=!0;c.Message="<span>"+a.Result;if(a.FailingPaths){var h="",i=!0,l;for(l in a.FailingPaths)i||(h+=", "),i=!1,h+=l;if(!i)c.Severity="Error",c.Message+=". "+f.formatMessage(g["Failing paths: ${0}"],h)}c.Message+=f.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+d+'">'+g["Git Status page"]+"</a>")+"</span>"}else if(a.error)d=b.HeadLocation.replace("commit/HEAD","status"),c.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?
(a=JSON.parse(a.error.responseText),c.Message=a.DetailedMessage?a.DetailedMessage:a.Message):c.Message=a.error.message,c.HTML=!0,c.Message="<span>"+c.Message+f.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+d+'">'+g["Git Status page"]+"</a>")+"</span>";e.setProgressResult(c);o.changedItem(b)},function(a,c){var e=[],h=b.HeadLocation.replace("commit/HEAD","status");e.Severity="Error";e.HTML=!0;e.Message="<span>"+JSON.stringify(c.xhr.responseText).DetailedMessage+f.formatMessage(g[". Go to ${0}."],
'<a href="'+k.toUrl(j.statusUILocation)+"#"+h+'">'+g["Git Status page"]+"</a>")+".</span>";d.getService("orion.page.message").setProgressResult(e);o.changedItem(b)})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Branch"&&!a.Current?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});h.addCommand(p);p=new a.Command({name:g["Merge Squash"],tooltip:g["Squash the content of the branch to the index"],imageClass:"git-sprite-merge_squash",spriteClass:"gitCommandSprite",
id:"eclipse.orion.git.mergeSquash",callback:function(a){var b=a.items,a=d.getService("orion.git.provider"),c=d.getService("orion.page.progress"),e=d.getService("orion.page.message");c.progress(a.doMerge(b.HeadLocation,b.Name,!0),"Merging "+b.Name).then(function(a){var c=[];if(a.Result==="FAST_FORWARD_SQUASHED"||a.Result==="ALREADY_UP_TO_DATE")c.Severity="Ok",c.HTML=!1,c.Message=a.Result;else if(a.Result){var d=b.HeadLocation.replace("commit/HEAD","status");c.Severity="Warning";c.HTML=!0;c.Message=
"<span>"+a.Result+f.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+d+'">'+g["Git Status page"]+"</a>")+"</span>"}else if(a.error)d=b.HeadLocation.replace("commit/HEAD","status"),c.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),c.Message=a.DetailedMessage?a.DetailedMessage:a.Message):c.Message=a.error.message,c.HTML=!0,c.Message="<span>"+c.Message+f.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+
"#"+d+'">'+g["Git Status page"]+"</a>")+"</span>";e.setProgressResult(c);o.changedItem(b)},function(a,c){var e=[],h=b.HeadLocation.replace("commit/HEAD","status");e.Severity="Error";e.HTML=!0;e.Message="<span>"+JSON.stringify(c.xhr.responseText).DetailedMessage+f.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+h+'">'+g["Git Status page"]+"</a>")+".</span>";d.getService("orion.page.message").setProgressResult(e);o.changedItem(b)})},visibleWhen:function(a){return a.Type===
"RemoteTrackingBranch"?!0:a.Type==="Branch"&&!a.Current?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});h.addCommand(p);p=new a.Command({name:g.Rebase,tooltip:g["Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch "]+"and applying each commit again to the updated active branch.",id:"eclipse.orion.git.rebase",imageClass:"git-sprite-rebase",spriteClass:"gitCommandSprite",callback:function(a){var b=
a.items,a=d.getService("orion.page.message"),c=d.getService("orion.page.progress").progress(d.getService("orion.git.provider").doRebase(b.HeadLocation,b.Name,"BEGIN"),b.Name?g["Rebase on top of "]+b.Name:g.Rebase);a.createProgressMonitor(c,b.Name?g["Rebase on top of "]+b.Name:g.Rebase);c.then(function(a){var c=[],e=b.HeadLocation.replace("commit/HEAD","status");a.Result==="OK"||a.Result==="FAST_FORWARD"||a.Result==="UP_TO_DATE"?(c.Severity="Ok",c.HTML=!1,c.Message=a.Result):a.Result==="STOPPED"?(c.Severity=
"Warning",c.HTML=!0,c.Message="<span>"+a.Result+g[". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing"]+f.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+e+'">'+g["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_WRONG_REPOSITORY_STATE"?(c.Severity="Error",c.HTML=!0,c.Message="<span>"+a.Result+g[". Repository state is invalid (i.e. already during rebasing)"]+f.formatMessage(". Go to ${0}.",'<a href="'+k.toUrl(j.statusUILocation)+
"#"+e+'">'+g["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_UNMERGED_PATHS"?(c.Severity="Error",c.HTML=!0,c.Message="<span>"+a.Result+g[". Repository contains unmerged paths"]+f.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+e+'">'+g["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_PENDING_CHANGES"?(c.Severity="Error",c.HTML=!0,c.Message="<span>"+a.Result+g[". Repository contains pending changes. Please commit or stash them"]+f.formatMessage(g[". Go to ${0}."],
'<a href="'+k.toUrl(j.statusUILocation)+"#"+e+'">Git Status page</a>')+".</span>"):(c.Severity="Warning",c.HTML=!0,c.Message="<span>"+a.Result+f.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+e+'">'+g["Git Status page"]+"</a>")+".</span>");d.getService("orion.page.message").setProgressResult(c);o.changedItem(b)},q)},visibleWhen:function(a){this.tooltip=g["Rebase your commits by removing them from the active branch, "]+g["starting the active branch again based on the latest state of '"]+
a.Name+"' "+g["and applying each commit again to the updated active branch."];return a.Type==="RemoteTrackingBranch"||a.Type==="Branch"&&!a.Current}});h.addCommand(p);p=new a.Command({name:g["Push All"],tooltip:g["Push commits and tags from your local branch into the remote branch"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.push",callback:function(a){var c=a.targetBranch,f,j=a.items;if(j.toRef)j=j.toRef;j.CloneLocation.split("/");var k=function(a,c){a.JsonData.HostKey?
(c.parameters=null,c.errorData=a.JsonData,c.errorData.failedOperation=a.failedOperation,h.collectParameters(c)):c.optionsRequested?(c.errorData=a.JsonData,c.errorData.failedOperation=a.failedOperation,h.collectParameters(c)):(new b(d)).isEnabled().then(function(b){c.parameters=b?a.JsonData.User?new e.ParametersDescription([new e.CommandParameter("sshpassword","password",g["SSH Password:"]),new e.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):
new e.ParametersDescription([new e.CommandParameter("sshuser","text",g["SSH User Name:"]),new e.CommandParameter("sshpassword","password",g["SSH Password:"]),new e.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new e.ParametersDescription([new e.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0}):new e.ParametersDescription([new e.CommandParameter("sshuser","text",g["SSH User Name:"]),new e.CommandParameter("sshpassword",
"password",g["SSH Password:"])],{hasOptionalParameters:!0});c.errorData=a.JsonData;c.errorData.failedOperation=a.failedOperation;h.collectParameters(c)})};if(a.parameters&&a.parameters.optionsRequested)a.parameters=null,a.optionsRequested=!0,h.collectParameters(a);else{var m=d.getService("orion.git.provider"),q=d.getService("orion.page.progress");a.errorData&&a.errorData.failedOperation&&q.removeOperation(a.errorData.failedOperation);var p=function(b,c,e,f,h){var j=d.getService("orion.page.message"),
b=q.progress(m.doPush(c,e,!0,h,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),g["Pushing remote: "]+f);j.createProgressMonitor(b,g["Pushing remote: "]+f);b.then(function(b){u.handleGitServiceResponse(b,d,function(){o.changedItem()},function(b){k(b,a)})},function(b){u.handleGitServiceResponse(b,d,function(){o.changedItem()},function(b){k(b,a)})})};q.progress(m.getGitClone(j.CloneLocation),"Getting git repository details "+j.Name).then(function(b){var e=b.Children[0].RemoteLocation,
h=b.Children[0].ConfigLocation,k=function(a){u.handleProgressServiceResponse(a,{},d)};u.gatherSshCredentials(d,a).then(function(b){var o=new i;if(j.RemoteLocation.length===1&&j.RemoteLocation[0].Children.length===1)o=q.progress(m.getGitRemote(e),"Getting git remote details "+j.Name);else{var r={};r.Children=j.RemoteLocation;o.resolve(r)}o.then(function(e){c?p(b,c.Location,"HEAD",c.Name,!1):(e=new n.RemotePrompterDialog({title:g["Choose Branch"],serviceRegistry:d,gitClient:m,treeRoot:{Children:e.Children},
hideNewBranch:!1,func:function(c,d,e){f=c===null?e:c;var g="branch."+j.Name+".remote";q.progress(m.addCloneConfigurationProperty(h,g,f.parent.Name),"Adding git configuration property "+j.Name).then(function(){a.targetBranch=f;p(b,f.Location,"HEAD",f.Name,!1)},function(c){c.status===409?m.getGitCloneConfig(h).then(function(c){if(c.Children)for(var d=0;d<c.Children.length;d++)if(c.Children[d].Key===g){q.progress(m.editCloneConfigurationProperty(c.Children[d].Location,f.parent.Name),"Updating configuration property "+
f.parent.Name).then(function(){a.targetBranch=f;p(b,f.Location,"HEAD",f.Name,!1)},k);break}},k):k(c)})}}),j.RemoteLocation.length===1&&j.RemoteLocation[0].Children.length===1&&(e=new l.ConfirmPushDialog({title:g["Choose Branch"],serviceRegistry:d,gitClient:m,dialog:e,location:j.RemoteLocation[0].Children[0].Name,func:function(){a.targetBranch=j.RemoteLocation[0].Children[0];p(b,j.RemoteLocation[0].Children[0].Location,"HEAD",j.Name,!1)}})),e.show())})})})}},visibleWhen:function(a){return a.toRef?
a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation:a.Type==="Branch"&&a.Current&&a.RemoteLocation}});h.addCommand(p);p=new a.Command({name:g["Force Push All"],tooltip:g["Push commits and tags from your local branch into the remote branch overriding its current content"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushForce",callback:function(a){var c=a.confirmedWarnings,f=a.targetBranch;if(!c)if(confirm(g["You're going to override content of the remote branch. This can cause the remote repository to lose commits."]+
"\n\n"+g["Are you sure?"]))c=a.confirmedWarnings=!0;else return;var j,k=a.items;if(k.toRef)k=k.toRef;var m=k.CloneLocation.split("/"),q=function(a,c){a.JsonData.HostKey?(c.parameters=null,c.errorData=a.JsonData,h.collectParameters(c)):c.optionsRequested?(c.errorData=a.JsonData,h.collectParameters(c)):(new b(d)).isEnabled().then(function(b){c.parameters=b?a.JsonData.User?new e.ParametersDescription([new e.CommandParameter("sshpassword","password",g["SSH Password:"]),new e.CommandParameter("saveCredentials",
"boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new e.ParametersDescription([new e.CommandParameter("sshuser","text",g["SSH User Name:"]),new e.CommandParameter("sshpassword","password",g["SSH Password:"]),new e.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new e.ParametersDescription([new e.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0}):new e.ParametersDescription([new e.CommandParameter("sshuser",
"text",g["SSH User Name:"]),new e.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});c.errorData=a.JsonData;h.collectParameters(c)})};if(a.parameters&&a.parameters.optionsRequested)a.parameters=null,a.optionsRequested=!0,h.collectParameters(a);else{var p=d.getService("orion.git.provider"),r=d.getService("orion.page.progress"),t=function(b,c,e,f,h){var j=d.getService("orion.page.message"),b=r.progress(p.doPush(c,e,!0,h,b.gitSshUsername,b.gitSshPassword,b.knownHosts,
b.gitPrivateKey,b.gitPassphrase),g["Pushing remote: "]+f);j.createProgressMonitor(b,g["Pushing remote: "]+f);b.then(function(b){u.handleGitServiceResponse(b,d,function(){o.changedItem()},function(b){q(b,a)})},function(b){u.handleGitServiceResponse(b,d,function(){o.changedItem(k)},function(b){q(b,a)})})};r.progress(p.getGitClone(k.CloneLocation),"Getting git repository details "+k.Name).then(function(b){var c=b.Children[0].RemoteLocation,e=b.Children[0].ConfigLocation;u.gatherSshCredentials(d,a).then(function(b){var h=
new i;if(k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1)h=r.progress(p.getGitRemote(c),"Getting remote details "+k.Name);else{var o={};o.Children=k.RemoteLocation;h.resolve(o)}h.then(function(c){f?t(b,f.Location,"HEAD",f.Name,!0):(c=new n.RemotePrompterDialog({title:g["Choose Branch"],serviceRegistry:d,gitClient:p,treeRoot:{Children:c.Children},hideNewBranch:!1,func:function(c,d,f){j=c===null?f:c;var g="/gitapi/config/branch."+k.Name+".remote/clone/file/"+m[4];r.progress(p.addCloneConfigurationProperty(e,
"branch."+k.Name+".remote",j.parent.Name),"Setting git configuration property "+k.Name).then(function(){a.targetBranch=j;t(b,j.Location,"HEAD",j.Name,!0)},function(c){c.status===409&&r.progres(p.editCloneConfigurationProperty(g,j.parent.Name),"Setting git configuration property "+j.parent.Name).then(function(){a.targetBranch=j;t(b,j.Location,"HEAD",j.Name,!0)})})}}),k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1&&(c=new l.ConfirmPushDialog({title:g["Choose Branch"],serviceRegistry:d,
gitClient:p,dialog:c,location:k.RemoteLocation[0].Children[0].Name,func:function(){a.targetBranch=k.RemoteLocation[0].Children[0];t(b,k.RemoteLocation[0].Children[0].Location,"HEAD",k.Location,!0)}})),c.startup(),c.show())})})})}},visibleWhen:function(a){if(a.toRef)return a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation}});h.addCommand(p);p=new a.Command({name:g["< Previous Page"],tooltip:g["Show previous page of git log"],id:"eclipse.orion.git.previousLogPage",
hrefCallback:function(a){return k.toUrl("git/git-log.html")+"#"+a.items.PreviousLocation},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"||a.toRef&&a.toRef.Type==="Branch"||a.RepositoryPath!==null?a.PreviousLocation!==void 0:!1}});h.addCommand(p);p=new a.Command({name:g["Next Page >"],tooltip:g["Show next page of git log"],id:"eclipse.orion.git.nextLogPage",hrefCallback:function(a){return k.toUrl("git/git-log.html")+"#"+a.items.NextLocation},visibleWhen:function(a){return a.Type===
"RemoteTrackingBranch"||a.toRef&&a.toRef.Type==="Branch"||a.RepositoryPath!==null?a.NextLocation!==void 0:!1}});h.addCommand(p);p=new a.Command({name:g["< Previous Page"],tooltip:g["Show previous page of git tags"],id:"eclipse.orion.git.previousTagPage",hrefCallback:function(a){return k.toUrl("git/git-repository.html")+"#"+a.items.PreviousLocation},visibleWhen:function(a){return a.Type==="Tag"?a.PreviousLocation!==void 0:!1}});h.addCommand(p);p=new a.Command({name:g["Next Page >"],tooltip:g["Show next page of git tags"],
id:"eclipse.orion.git.nextTagPage",hrefCallback:function(a){return k.toUrl("git/git-repository.html")+"#"+a.items.NextLocation},visibleWhen:function(a){return a.Type==="Tag"?a.NextLocation!==void 0:!1}});h.addCommand(p);p=new a.Command({name:g.Reset,tooltip:g["Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes."],id:"eclipse.orion.git.resetIndex",imageClass:"git-sprite-reset",spriteClass:"gitCommandSprite",callback:function(a){var b=a.items;if(confirm(g["The content of your active branch will be replaced with "]+
b.Name+". "+g["All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?"])){var a=d.getService("orion.git.provider"),c=d.getService("orion.page.message"),a=d.getService("orion.page.progress").progress(a.resetIndex(b.IndexLocation,b.Name),"Resetting git index for "+b.Name);c.createProgressMonitor(a,g["Resetting index..."]);a.then(function(){o.changedItem(b);c.setProgressResult({Severity:"Info",HTML:!1,Message:"Ok"})},function(a){var b={Severity:"Error",HTML:!1};b.Message=
a.message;c.setProgressResult(b)})}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});h.addCommand(p);p=new e.ParametersDescription([new e.CommandParameter("name","text",g["Name:"])]);p=new a.Command({name:g.Tag,tooltip:g["Create a tag for the commit"],imageClass:"git-sprite-tag",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.addTag",parameters:p,callback:function(a){var b=a.items,c=function(a,c){d.getService("orion.page.progress").progress(d.getService("orion.git.provider").doAddTag(a,
c),"Adding tag "+c).then(function(){o.changedItem(b)},q)},e=b.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&c(e,a.parameters.valueFor("name"))},visibleWhen:function(a){return a.Type==="Commit"}});h.addCommand(p);p=new a.Command({name:g.Delete,tooltip:g["Delete the tag from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeTag",callback:function(a){var b=a.items;confirm(f.formatMessage(g["Are you sure you want to delete tag ${0}?"],b.Name))&&d.getService("orion.page.progress").progress(d.getService("orion.git.provider").doRemoveTag(b.Location),
"Removing tag "+b.Name).then(function(){o.changedItem(b.parent)},q)},visibleWhen:function(a){return a.Type==="Tag"}});h.addCommand(p);p=new e.ParametersDescription([new e.CommandParameter("reviewer","text",g["Reviewer name"])],{hasOptionalParameters:!0});p=new a.Command({name:g["Ask for review"],tooltip:g["Ask for review tooltip"],imageClass:"core-sprite-tag",id:"eclipse.orion.git.askForReviewCommand",parameters:p,callback:function(a){var b=d.getService("orion.page.progress"),c=function(a){var b=
document.createElement("a");b.href=a;b.protocol==="ssh:"&&(b=a.indexOf("@"),b!==-1&&(a="ssh://"+a.substr(b+1)));return a},e=function(e){var f=a.items,g=f.Location.replace(f.Name,"HEAD"),h=f.AuthorName,j=f.Name,i=f.Message;b.progress(d.getService("orion.git.provider").getGitClone(f.CloneLocation),"Getting repository details "+f.Name).then(function(a){window.location.href.split("#");var k=v.getOrionHome(),a=c(a.Children[0].GitUrl),k=k+"/git/reviewRequest.html#"+a+"_"+f.Name;b.progress(d.getService("orion.git.provider").sendCommitReviewRequest(j,
g,e,k,h,i),"Sending review request for "+j).then(function(a){var b={Severity:"Ok",HTML:!1};b.Message=a.Result;d.getService("orion.page.message").setProgressResult(b)},q)})};if(a.parameters.valueFor("reviewer")&&!a.parameters.optionsRequested)e(a.parameters.valueFor("reviewer"));else{var f=a.items;b.progress(d.getService("orion.git.provider").getGitClone(f.CloneLocation),"Getting git details "+f.Name).then(function(a){window.location.href.split("#");var b=v.getOrionHome(),a=c(a.Children[0].GitUrl);
(new m.ReviewRequestDialog({title:g["Contribution Review Request"],url:b+"/git/reviewRequest.html#"+a+"_"+f.Name,func:e})).show()},q)}},visibleWhen:function(a){return a.Type==="Commit"}});h.addCommand(p);p=new a.Command({name:g["Cherry-Pick"],tooltip:g["Apply the change introduced by the commit to your active branch"],id:"eclipse.orion.git.cherryPick",imageClass:"git-sprite-cherry_pick",spriteClass:"gitCommandSprite",callback:function(a){var b=a.items,a=d.getService("orion.page.progress"),c=d.getService("orion.git.provider"),
e=b.Location.replace(b.Name,"HEAD");a.progress(c.doCherryPick(e,b.Name),"Cherry picking "+b.Name).then(function(a){var c=[],e=b.Location.replace("commit/"+b.Name,"status");if(a.Result==="OK")c.Severity="Ok",a.HeadUpdated?(c.HTML=!1,c.Message=a.Result):(c.HTML=!0,c.Message="<span>"+g["Nothing changed."]+"</span>");else if(a.Result==="CONFLICTING")c.Severity="Warning",c.HTML=!0,c.Message="<span>"+a.Result+g[". Some conflicts occurred"]+ +f.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+
"#"+e+'">'+g["Git Status page"]+"</a>")+".</span>";else if(a.Result==="FAILED"){c.Severity="Error";c.HTML=!0;c.Message="<span>"+a.Result;if(a.FailingPaths){var h="",i=!0,l;for(l in a.FailingPaths)i||(h+=", "),i=!1,h+=l;i||(c.Message+=". "+f.formatMessage(g["Failing paths: ${0}"],h))}c.Message+=f.formatMessage(g[". Go to ${0}."],'<a href="'+k.toUrl(j.statusUILocation)+"#"+e+'">'+g["Git Status page"]+"</a>")+".</span>"}else c.Severity="Warning",c.HTML=!1,c.Message=a.Result;d.getService("orion.page.message").setProgressResult(c)},
q)},visibleWhen:function(a){return a.Type==="Commit"}});h.addCommand(p)};u.createGitClonesCommands=function(c,d,j,l,m,o){function p(a){var b={Severity:"Error",HTML:!1};try{var d=JSON.parse(a.responseText);b.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:g["Problem while performing the action"]}catch(e){b.Message=g["Problem while performing the action"]}c.getService("orion.page.message").setProgressResult(b)}function n(a){Array.isArray(a)&&(a=a.length>1?{}:a[0]);return a}l=new e.ParametersDescription([new e.CommandParameter("key",
"text",g["Key:"]),new e.CommandParameter("value","text",g["Value:"])]);l=new a.Command({name:g["New Configuration Entry"],tooltip:"Add a new entry to the repository configuration",id:"eclipse.orion.git.addConfigEntryCommand",parameters:l,callback:function(a){var b=a.items,d=c.getService("orion.git.provider"),e=c.getService("orion.page.progress");a.parameters.valueFor("key")&&a.parameters.valueFor("value")&&e.progress(d.addCloneConfigurationProperty(b.ConfigLocation,a.parameters.valueFor("key"),a.parameters.valueFor("value")),
"Setting configuration propetry: "+a.parameters.valueFor("key")).then(function(){j.changedItem(b)},p)}});d.addCommand(l);l=new e.ParametersDescription([new e.CommandParameter("value","text",g["Value:"])]);l=new a.Command({name:g.Edit,tooltip:g["Edit the configuration entry"],imageClass:"core-sprite-edit",id:"eclipse.orion.git.editConfigEntryCommand",parameters:l,callback:function(a){var b=a.items,d=c.getService("orion.git.provider"),e=c.getService("orion.page.progress");a.parameters.valueFor("value")&&
e.progress(d.editCloneConfigurationProperty(b.Location,a.parameters.valueFor("value")),"Editing configuration property "+b.Key).then(function(){j.changedItem(b)},p)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});d.addCommand(l);l=new a.Command({name:g.Delete,tooltip:g["Delete the configuration entry"],imageClass:"core-sprite-delete",id:"eclipse.orion.git.deleteConfigEntryCommand",callback:function(a){var b=a.items,a=c.getService("orion.git.provider"),d=c.getService("orion.page.progress");
confirm(f.formatMessage(g["Are you sure you want to delete ${0}?"],b.Key))&&d.progress(a.deleteCloneConfigurationProperty(b.Location),"Deleting configuration property "+b.Key).then(function(){j.changedItem(b)},p)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});d.addCommand(l);l=new e.ParametersDescription([new e.CommandParameter("url","url",g["Repository URL:"])],{hasOptionalParameters:!0});m=new a.Command({name:g["Clone Repository"],tooltip:g["Clone an existing Git repository to a folder"],
id:"eclipse.createGitProject",callback:function(a){var b=a.items,d=c.getService("orion.git.provider"),e=c.getService("orion.page.progress"),f=function(a,f,i){u.getDefaultSshOptions(c).then(function(l){var m=arguments.callee,q=new h(c);c.getService("orion.page.message").setProgressMessage("Your project is being set up. This may take a minute...");q.getConfig().then(function(h){e.progress(d.cloneGitRepository(i,a,f,j.defaultPath,l.gitSshUsername,l.gitSshPassword,l.knownHosts,l.gitPrivateKey,l.gitPassphrase,
h),"Cloning repository "+i).then(function(a){u.handleProgressServiceResponse(a,l,c,function(a){d.getGitClone(a.Location).then(function(a){var c="",d;for(d in b.projectDescription)c+=d+"="+b.projectDescription[d]+"\n";o.write(a.Children[0].ContentLocation+".git/.projectInfo",c).then(function(){var b=k.toUrl("edit/edit.html")+"#{,resource,params*}";window.location=(new z(b)).expand({resource:"",params:{navigate:a.Children[0].ContentLocation+"?depth=1"}})})})},m,g["Clone Git Repository"])},function(a){u.handleProgressServiceResponse(a,
l,c,function(){},m,g["Clone Git Repository"])})})})};b.url&&b.projectDescription.name&&(c.getService("orion.page.message").setProgressMessage("Looking for project "+b.projectDescription.name),o.loadWorkspace().then(function(a){for(var c=0;c<a.Children.length;++c){var e=a.Children[c];if(e.Name===b.projectDescription.name){e.Git?d.getGitClone(e.Git.CloneLocation).then(function(a){if(a.Children[0].GitUrl===b.url){var c=k.toUrl("edit/edit.html")+"#{,resource,params*}";window.location=(new z(c)).expand({resource:"",
params:{navigate:a.Children[0].ContentLocation+"?depth=1"}})}else console.info("Folder project is used")}):console.info("Folder project is used");return}}f(b.url,null,b.projectDescription.name)}))},visibleWhen:function(){return!0}});d.addCommand(m);l=new a.Command({name:g["Clone Repository"],tooltip:g["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepository",parameters:l,callback:function(a){var b=c.getService("orion.git.provider"),d=c.getService("orion.page.progress"),e=function(a,
e,f){u.getDefaultSshOptions(c).then(function(i){var k=arguments.callee;(new h(c)).getConfig().then(function(h){h=d.progress(b.cloneGitRepository(f,a,e,j.defaultPath,i.gitSshUsername,i.gitSshPassword,i.knownHosts,i.gitPrivateKey,i.gitPassphrase,h),"Cloning repository "+f);c.getService("orion.page.message").createProgressMonitor(h,g["Cloning repository: "]+a);h.then(function(a){u.handleProgressServiceResponse(a,i,c,function(){j.changedItem&&j.changedItem()},k,g["Clone Git Repository"])},function(a){u.handleProgressServiceResponse(a,
i,c,function(){},k,g["Clone Git Repository"])})})})};a.parameters.valueFor("url")&&!a.parameters.optionsRequested?e(a.parameters.valueFor("url")):(new s.CloneGitRepositoryDialog({serviceRegistry:c,fileClient:o,url:a.parameters.valueFor("url"),alwaysShowAdvanced:a.parameters.optionsRequested,func:e})).show()},visibleWhen:function(){return!0}});d.addCommand(l);l=new a.Command({name:g["Clone Repository"],tooltip:g["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepositoryReviewReq",
callback:function(a){var b=c.getService("orion.git.provider"),d=c.getService("orion.page.progress");(new s.CloneGitRepositoryDialog({serviceRegistry:c,fileClient:o,url:a.userData,alwaysShowAdvanced:!1,func:function(a,e,f){u.getDefaultSshOptions(c).then(function(i){var k=arguments.callee;(new h(c)).getConfig().then(function(h){h=d.progress(b.cloneGitRepository(f,a,e,j.defaultPath,i.gitSshUsername,i.gitSshPassword,i.knownHosts,i.gitPrivateKey,i.gitPassphrase,h),"Cloning git repository "+f);c.getService("orion.page.message").createProgressMonitor(h,
g["Cloning repository: "]+a);h.then(function(a){u.handleProgressServiceResponse(a,i,c,function(){j.changedItem&&j.changedItem()},k,g["Clone Git Repository"])},function(a){u.handleProgressServiceResponse(a,i,c,function(){},k,g["Clone Git Repository"])})})})}})).show()},visibleWhen:function(){return!0}});d.addCommand(l);l=new a.Command({name:g["Add Remote"],tooltip:g["Add a new remote to the repository"],id:"eclipse.addRemoteReviewRequestCommand",imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",
callback:function(a){if(a.parameters&&a.parameters.valueFor("remoteName"))a.remoteName=a.parameters.valueFor("remoteName");var f=function(a,f){a.JsonData.HostKey?(f.parameters=null,f.errorData=a.JsonData,d.collectParameters(f)):f.optionsRequested?(f.errorData=a.JsonData,d.collectParameters(f)):(new b(c)).isEnabled().then(function(b){f.parameters=b?a.JsonData.User?new e.ParametersDescription([new e.CommandParameter("sshpassword","password",g["SSH Password:"]),new e.CommandParameter("saveCredentials",
"boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):new e.ParametersDescription([new e.CommandParameter("sshuser","text",g["SSH User Name:"]),new e.CommandParameter("sshpassword","password",g["SSH Password:"]),new e.CommandParameter("saveCredentials","boolean",g["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new e.ParametersDescription([new e.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0}):new e.ParametersDescription([new e.CommandParameter("sshuser",
"text",g["SSH User Name:"]),new e.CommandParameter("sshpassword","password",g["SSH Password:"])],{hasOptionalParameters:!0});f.errorData=a.JsonData;d.collectParameters(f)})};if(a.parameters&&a.parameters.optionsRequested)a.parameters=null,a.optionsRequested=!0,d.collectParameters(a);else{var h=function(b,d,e){var h=c.getService("orion.page.progress");h.progress(c.getService("orion.git.provider").addRemote(b,d,a.userData),"Adding git remote "+d).then(function(){u.gatherSshCredentials(c,a).then(function(b){c.getService("orion.git.provider").getGitRemote(e.RemoteLocation).then(function(i){for(var k,
l=0;l<i.Children.length;l++)i.Children[l].Name===d&&(k=i.Children[l]);var m=c.getService("orion.git.provider"),i=c.getService("orion.page.message"),l=h.progress(m.doFetch(k.Location,!1,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),"Fetching remote "+d);i.createProgressMonitor(l,g["Fetching remote: "]+k.Location);l.then(function(b){u.handleGitServiceResponse(b,c,function(){h.progress(m.getGitRemote(k.Location),"Getting remote details "+d).then(function(){j.changedItem(e)},
p)},function(b){f(b,a)})},function(b){u.handleGitServiceResponse(b,c,function(){j.changedItem(e)},function(b){f(b,a)})})})})},p)};a.remoteName?h(a.items.RemoteLocation,a.remoteName,a.items):(a.parameters=new e.ParametersDescription([new e.CommandParameter("remoteName","text",g["Remote Name:"])],{hasOptionalParameters:!1}),d.collectParameters(a))}},visibleWhen:function(){return!0}});d.addCommand(l);l=new e.ParametersDescription([new e.CommandParameter("folderName","text",g["New folder:"])],{hasOptionalParameters:!0});
l=new a.Command({name:g["Init Repository"],tooltip:g["Create a new Git repository in a new folder"],id:"eclipse.initGitRepository",parameters:l,callback:function(a){var b=c.getService("orion.git.provider"),d=c.getService("orion.page.progress"),e=function(a,e,f){u.getDefaultSshOptions(c).then(function(i){var k=arguments.callee;(new h(c)).getConfig().then(function(h){h=d.progress(b.cloneGitRepository(f,a,e,j.defaultPath,null,null,null,null,null,h),g["Initializing repository: "]+f);c.getService("orion.page.message").createProgressMonitor(h,
g["Initializing repository: "]+f);h.then(function(a){u.handleProgressServiceResponse(a,i,c,function(){j.changedItem&&j.changedItem()},k,g["Init Git Repository"])},function(a){u.handleProgressServiceResponse(a,i,c,function(){},k,g["Init Git Repository"])})})})};a.parameters.valueFor("folderName")&&!a.parameters.optionsRequested?e(null,null,a.parameters.valueFor("folderName")):(new s.CloneGitRepositoryDialog({serviceRegistry:c,title:g["Init Git Repository"],fileClient:o,advancedOnly:!0,func:e})).show()},
visibleWhen:function(){return!0}});d.addCommand(l);l=new a.Command({name:g.Delete,tooltip:g["Delete the repository"],imageClass:"core-sprite-delete",id:"eclipse.git.deleteClone",visibleWhen:function(a){return a.Type==="Clone"},callback:function(a){var b=a.items,a=c.getService("orion.git.provider"),d=c.getService("orion.page.progress");if(Array.isArray(b)){if(confirm(f.formatMessage(g["Are you sure you want do delete ${0} repositories?"],b.length)))for(var e=0,h=0;h<b.length;h++)d.progress(a.removeGitRepository(b[h].Location),
"Removing repository "+b.Name).then(function(){e++;e>=b.length&&j.changedItem&&j.changedItem()},p)}else confirm(f.formatMessage(g["Are you sure you want to delete ${0}?"],b.Name))&&d.progress(a.removeGitRepository(b.Location),"Removing repository "+b.Name).then(function(){j.changedItem&&j.changedItem()},p)}});d.addCommand(l);l=new a.Command({name:g["Apply Patch"],tooltip:g["Apply a patch on the selected repository"],id:"eclipse.orion.git.applyPatch",imageClass:"git-sprite-apply_patch",spriteClass:"gitCommandSprite",
callback:function(a){var a=n(a.items),b=new i;(new t.ApplyPatchDialog({title:g["Apply Patch"],diffLocation:a.DiffLocation,deferred:b})).show();var d=c.getService("orion.page.message");b.then(function(a){var b;try{var c=JSON.parse(a);if(c.JsonData&&c.JsonData.modifiedFieles){b="Patch applied, files modified: ";for(var a=!0,e=0;e<c.JsonData.modifiedFieles.length;e++)a||(b+=", "),b+=c.JsonData.modifiedFieles[e],a=!1;c=[];c.Severity="Info";c.HTML=!1;c.Message=b;d.setProgressResult(c);return}}catch(f){}d.setMessage("Patch applied")},
function(a){var b=JSON.parse(a),a="Apply patch failed.";b.DetailedMessage?(a+=" ",a+=b.DetailedMessage):b.Message&&(a+=" ",a+=b.Message);b=[];b.Severity="Error";b.HTML=!1;b.Message=a;d.setProgressResult(b)})},visibleWhen:function(a){return a.Type==="Clone"}});d.addCommand(l);l=new e.ParametersDescription([new e.CommandParameter("commitName","text",g["Commit name:"])],{hasOptionalParameters:!0});l=new a.Command({name:g["Open Commit"],tooltip:g["Open the commit with the given name"],id:"eclipse.orion.git.openCommitCommand",
imageClass:"git-sprite-apply_patch",spriteClass:"gitCommandSprite",parameters:l,callback:function(a){var b=c.getService("orion.page.progress"),e=function(d,f,h){h==null&&(h=new i);d.length>0?b.progress(c.getService("orion.git.provider").doGitLog("/gitapi/commit/"+a.parameters.valueFor("commitName")+d[0].ContentLocation+"?page=1&pageSize=1",null,null,g["Looking for the commit"]),"Looking for commit "+a.parameters.valueFor("commitName")).then(function(a){h.resolve(a.Children[0].Location)},function(){e(d.slice(1),
f,h)}):h.reject();return h},f=function(b){a.parameters.optionsRequested?(new q.OpenCommitDialog({repositories:b,serviceRegistry:c,commitName:a.parameters.valueFor("commitName")})).show():(c.getService("orion.page.message").setProgressMessage(g["Looking for the commit"]),e(b,a.parameters.valueFor("commitName")).then(function(a){a&&(a=k.toUrl("git/git-commit.html#")+a+"?page=1&pageSize=1",window.open(a));c.getService("orion.page.message").setProgressMessage("")},function(){var a=[];a.Severity="warning";
a.HTML=!1;a.Message=g["No commits found"];c.getService("orion.page.message").setProgressResult(a)}))};if(!a.parameters.optionsRequested&&!a.parameters.valueFor("commitName"))d.runCommand("eclipse.orion.git.openCommitCommand");else if(a.items.Type==="Clone"){var h=[a.items];f(h)}else a.items.CloneLocation?b.progress(c.getService("orion.git.provider").getGitClone(a.items.CloneLocation),"Getting git repository details").then(function(a){f(a.Children)}):(h=a.items,f(h))},visibleWhen:function(a){return a.Type===
"Clone"||a.CloneLocation||a.length>1&&a[0].Type==="Clone"}});d.addCommand(l)};u.createGitStatusCommands=function(b,c,d){function f(a){var c={Severity:"Error",HTML:!1};try{var d=JSON.parse(a.responseText);c.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:g["Problem while performing the action"]}catch(e){c.Message=g["Problem while performing the action"]}b.getService("orion.page.message").setProgressResult(c)}function h(a){Array.isArray(a)||(a=[a]);return a}function i(a,c){var e=b.getService("orion.page.message"),
h=b.getService("orion.page.progress").progress(b.getService("orion.git.provider").doRebase(a,"",c),"Rebasing git repository");e.createProgressMonitor(h,c);h.then(function(a){if(a.Result==="OK"||a.Result==="ABORTED"||a.Result==="FAST_FORWARD"||a.Result==="UP_TO_DATE"){var c=[];c.Severity="Ok";c.HTML=!1;c.Message=a.Result;b.getService("orion.page.message").setProgressResult(c);d.changedItem({})}if(a.Result==="STOPPED")c=[],c.Severity="Warning",c.HTML=!1,c.Message=a.Result+g[". Repository still contains conflicts."],
b.getService("orion.page.message").setProgressResult(c),d.changedItem({});else if(a.Result==="FAILED_UNMERGED_PATHS")c=[],c.Severity="Error",c.HTML=!1,c.Message=a.Result+g[". Repository contains unmerged paths. Resolve conflicts first."],b.getService("orion.page.message").setProgressResult(c)},f)}var k=new a.Command({name:g.Stage,tooltip:g["Stage the change"],imageClass:"git-sprite-stage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.stageCommand",callback:function(a){var c=h(a.items),e=b.getService("orion.page.message"),
j=b.getService("orion.page.progress");if(c.length===1)a=j.progress(b.getService("orion.git.provider").stage(c[0].indexURI),g["Staging changes"]),e.createProgressMonitor(a,g["Staging changes"]);else{for(var i=[],k=0;k<c.length;k++)i[k]=c[k].name;a=j.progress(b.getService("orion.git.provider").stageMultipleFiles(a.userData.Clone.IndexLocation,i),g["Staging changes"]);e.createProgressMonitor(a,"Staging changes")}a.then(function(){d.changedItem(c)},f)},visibleWhen:function(a){a=h(a);if(a.length===0)return!1;
for(var b=0;b<a.length;b++)if(!j.isChange(a[b])||j.isStaged(a[b]))return!1;return!0}});c.addCommand(k);k=new a.Command({name:g.Unstage,tooltip:g["Unstage the change"],imageClass:"git-sprite-unstage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.unstageCommand",callback:function(a){var c=h(a.items),e=b.getService("orion.page.message"),j=b.getService("orion.page.progress");if(c.length===1)a=j.progress(b.getService("orion.git.provider").unstage(c[0].indexURI,c[0].name),"Unstaging changes");else{for(var i=
[],k=0;k<c.length;k++)i[k]=c[k].name;a=j.progress(b.getService("orion.git.provider").unstage(a.userData.Clone.IndexLocation,i),"Unstaging changes")}e.createProgressMonitor(a,g["Staging changes"]);a.then(function(){d.changedItem(c)},f)},visibleWhen:function(a){a=h(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!j.isChange(a[b])||!j.isStaged(a[b]))return!1;return!0}});c.addCommand(k);k=new e.ParametersDescription([new e.CommandParameter("name","text",g["Commit message:"],"",4),new e.CommandParameter("amend",
"boolean",g["Amend:"],!1)],{hasOptionalParameters:!0});k=new a.Command({name:"Commit",tooltip:"Commit",id:"eclipse.orion.git.commitCommand",parameters:k,callback:function(a){var c=a.items.status,e=function(a){var e=b.getService("orion.page.message"),a=b.getService("orion.page.progress").progress(b.getService("orion.git.provider").commitAll(c.Clone.HeadLocation,null,JSON.stringify(a)),g["Committing changes"]);e.createProgressMonitor(a,g["Committing changes"]);a.then(function(){d.changedItem(c)},f)},
h={};h.Message=a.parameters.valueFor("name");h.Amend=a.parameters.valueFor("amend");for(var j=c.Clone.Config,i=0;i<j.length;i++)if(j[i].Key==="user.name")h.CommitterName=j[i].Value,h.AuthorName=j[i].Value;else if(j[i].Key==="user.email")h.CommitterEmail=j[i].Value,h.AuthorEmail=j[i].Value;h.Message&&h.CommitterName&&h.CommitterEmail&&!a.parameters.optionsRequested?e(h):(new p.CommitDialog({body:h,func:e})).show()},visibleWhen:function(){return!0}});c.addCommand(k);k=new a.Command({name:g.Reset,tooltip:g["Reset the branch, discarding all staged and unstaged changes"],
imageClass:"core-sprite-refresh",id:"eclipse.orion.git.resetCommand",callback:function(a){var c=a.items;b.getService("orion.page.dialog").confirm(g["All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered."]+"\n"+g["Are you sure you want to continue?"],function(a){if(a){var a=b.getService("orion.page.message"),e=b.getService("orion.page.progress").progress(b.getService("orion.git.provider").unstageAll(c.IndexLocation,"HARD"),g["Resetting local changes"]);
a.createProgressMonitor(e,g["Resetting local changes"]);e.then(function(){d.changedItem(c)},f)}})},visibleWhen:function(a){return j.hasStagedChanges(a)||j.hasUnstagedChanges(a)}});c.addCommand(k);k=new a.Command({name:g.Checkout,tooltip:g["Checkout files, discarding all changes"],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.checkoutCommand",callback:function(a){var c=h(a.items);b.getService("orion.page.dialog").confirm(g["Your changes to the selected files will be discarded and cannot be recovered."]+
"\n"+g["Are you sure you want to continue?"],function(e){if(e){for(var e=b.getService("orion.page.message"),h=b.getService("orion.page.progress"),j=[],i=0;i<c.length;i++)j[i]=c[i].name;h=h.progress(b.getService("orion.git.provider").checkoutPath(a.userData.Clone.Location,j),g["Resetting local changes"]);e.createProgressMonitor(h,g["Resetting local changes"]);h.then(function(){d.changedItem(c)},f)}})},visibleWhen:function(a){a=h(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!j.isChange(a[b])||
j.isStaged(a[b]))return!1;return!0}});c.addCommand(k);k=new a.Command({name:g["Show Patch"],tooltip:g["Show workspace changes as a patch"],id:"eclipse.orion.git.showPatchCommand",hrefCallback:function(a){for(var b=h(a.items),a=a.userData.Clone.DiffLocation+"?parts=diff",c=0;c<b.length;c++)a+="&Path=",a+=b[c].name;return a},visibleWhen:function(a){a=h(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(j.isStaged(a[b]))return!1;return!0}});c.addCommand(k);k=new a.Command({name:g.Continue,tooltip:g["Contibue Rebase"],
id:"eclipse.orion.git.rebaseContinueCommand",callback:function(a){return i(a.items.Clone.HeadLocation,"CONTINUE")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});c.addCommand(k);k=new a.Command({name:g["Skip Patch"],tooltip:g["Skip Patch"],id:"eclipse.orion.git.rebaseSkipPatchCommand",callback:function(a){return i(a.items.Clone.HeadLocation,"SKIP")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});c.addCommand(k);k=new a.Command({name:g.Abort,
tooltip:g["Abort Rebase"],id:"eclipse.orion.git.rebaseAbortCommand",callback:function(a){return i(a.items.Clone.HeadLocation,"ABORT")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});c.addCommand(k)}})();return u});
define("orion/git/widgets/CommitTooltipDialog",["i18n!git/nls/gitmessages","require","orion/webui/littlelib","orion/i18nUtil","orion/webui/popupdialog"],function(g,k,i,f,d){function a(a){this._init(a)}a.prototype=new d.PopupDialog;a.prototype.TEMPLATE='<div id="parentPane" style="padding:10px; width:520px"></div>';a.prototype._init=function(a){this.commit=a.commit;this._initialize(a.triggerNode,null,null,"mouseover",1E3)};a.prototype._bindToDom=function(){this._displayCommit(this.commit)};a.prototype._displayCommit=
function(a){var d=this.$parentPane,c=a.Message.split(/(\r?\n|$)/)[0],b=document.createElement("a");b.className="navlinkonpage";b.href=k.toUrl("git/git-commit.html#")+a.Location+"?page=1&pageSize=1";b.textContent=c;d.appendChild(b);c=document.createElement("div");c.style.paddingTop="15px";d.appendChild(c);if(a.AuthorImage)d=new Image,d.src=a.AuthorImage,d.name=a.AuthorName,d.className="git-author-icon",c.appendChild(d);d=document.createElement("div");d.textContent=f.formatMessage(g[" authored by ${0} {${1}) on ${2}"],
a.AuthorName,a.AuthorEmail,(new Date(a.Time)).toLocaleString());c.appendChild(d);d=document.createElement("div");d.textContent=f.formatMessage(g["committed by 0 (1)"],a.CommitterName,a.CommitterEmail);c.appendChild(d);d=document.createElement("div");d.style.paddingTop="15px";d.textContent=g["commit:"]+a.Name;c.appendChild(d);if(a.Parents&&a.Parents.length>0)d=document.createElement("div"),d.textContent=g["parent:"],b=document.createElement("a"),b.className="navlinkonpage",b.href=k.toUrl("git/git-commit.html#")+
a.Parents[0].Location+"?page=1&pageSize=1",b.textContent=a.Parents[0].Name,d.appendChild(b),c.appendChild(d);b=a.Tags&&a.Tags.length>0;if(a.Branches&&a.Branches.length>0){d=document.createElement("section");d.style.paddingTop="15px";d.textContent=g["branches: "];c.appendChild(d);var h=document.createElement("div");d.appendChild(h);for(d=0;d<a.Branches.length;++d){var i=document.createElement("span");i.style.paddingLeft="10px";i.textContent=a.Branches[d].FullName;h.appendChild(i)}}if(b){d=document.createElement("div");
d.style.paddingTop="15px";c.appendChild(d);d=document.createElement("section");c.appendChild(d);c=document.createElement("span");c.textContent=g["tags: "];d.appendChild(c);c=document.createElement("div");d.appendChild(c);for(d=0;d<a.Tags.length;++d)b=document.createElement("span"),b.style.paddingLeft="10px",b.textContent=a.Tags[d].Name,c.appendChild(b)}};a.prototype.constructor=a;return{CommitTooltipDialog:a}});
define("orion/git/gitRepositoryExplorer","i18n!git/nls/gitmessages,require,orion/commandRegistry,orion/section,orion/i18nUtil,orion/webui/littlelib,orion/PageUtil,orion/dynamicContent,orion/fileUtils,orion/globalCommands,orion/git/gitCommands,orion/Deferred,orion/git/widgets/CommitTooltipDialog".split(","),function(g,k,i,f,d,a,e,j,c,b,h,l,n){i={};i.GitRepositoryExplorer=function(){function h(a,b,c,d,e,f,g){this.parentId=e;this.registry=a;this.linkService=c;this.commandService=b;this.selection=d;this.parentId=
e;this.pageNavId=f;this.actionScopeId=g;this.checkbox=!1}h.prototype.handleError=function(a){var b={Severity:"Error",HTML:!1};try{var c=JSON.parse(a.responseText);b.Message=c.DetailedMessage?c.DetailedMessage:c.Message}catch(d){b.Message=a.message}this.registry.getService("orion.page.message").setProgressResult(b);a.status===404&&(this.initTitleBar(),this.displayRepositories())};h.prototype.setDefaultPath=function(a){this.defaultPath=a};h.prototype.changedItem=function(){this.redisplay(!1)};h.prototype.redisplay=
function(a){a===void 0&&(a=!0);var b=e.matchResourceParameters();if(b.resource)this.displayRepository(b.resource);else{var b=c.makeRelative(this.defaultPath),d=k.toUrl("gitapi/clone._"),d=d.substring(0,d.length-2);this.displayRepositories2(b[0]==="/"?d+b:d+"/"+b,a)}};h.prototype.displayRepositories2=function(a,b){var c=this;this.loadingDeferred=new l;b&&this.loadingDeferred.then(function(){c.commandService.processURL(window.location.href)});this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitClone(a),
"Getting git repository details").then(function(a){if(a.Children.length===0)c.initTitleBar({}),c.displayRepositories([],"full");else if(a.Children[0].Type==="Clone")a=a.Children,c.initTitleBar(a),c.displayRepositories(a,"full",!0)},function(a){c.handleError(a)})};h.prototype.displayRepository=function(b){var c=this;this.loadingDeferred=new l;this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitClone(b),"Getting git repository details").then(function(b){var d=
a.node(c.pageNavId);d&&(a.empty(d),c.commandService.renderCommands(c.pageNavId,d,b,c,"button"));b.Children.length===0?(c.initTitleBar({}),c.displayRepositories([],"full")):b.Children.length&&b.Children.length===1&&b.Children[0].Type==="Clone"?(b=b.Children,c.initTitleBar(b[0]),c.displayRepositories(b),c.displayStatus(b[0]),c.displayCommits(b[0]),c.displayBranches(b[0]),c.displayTags(b[0]),c.displayRemotes(b[0]),c.displayConfig(b[0])):b.Children[0].Type==="Clone"?(b=b.Children,c.initTitleBar(b),c.displayRepositories(b,
"full",!0)):b.Children[0].Type==="Branch"?(b=b.Children,c.registry.getService("orion.page.progress").progress(c.registry.getService("orion.git.provider").getGitClone(b[0].CloneLocation),"Getting git repository details").then(function(a){a=a.Children;c.initTitleBar(a[0],"Branches");c.displayRepositories(a,"mini",!0);c.displayBranches(a[0],"full");c.displayRemoteBranches(a[0],"full")},function(a){c.handleError(a)})):b.Children[0].Type==="Tag"?(b=b.Children,c.registry.getService("orion.page.progress").progress(c.registry.getService("orion.git.provider").getGitClone(b[0].CloneLocation),
"Getting git repository details").then(function(a){a=a.Children;c.initTitleBar(a[0],g.Tags);c.displayRepositories(a,"mini",!0);c.displayTags(a[0],"full")},function(a){c.handleError(a)})):b.Children[0].Type==="Config"&&c.registry.getService("orion.page.progress").progress(c.registry.getService("orion.git.provider").getGitClone(b.CloneLocation),"Getting git repository details").then(function(a){a=a.Children;c.initTitleBar(a[0],g.Configuration);c.displayRepositories(a,"mini",!0);c.displayConfig(a[0],
"full")},function(a){c.handleError(a)})},function(a){c.handleError(a)})};var i=function(b,c,d,e,f){if(b=a.node(d))c.destroy(b);else throw"could not find toolbar "+d;c.renderCommands(e,b,f,null,"button")};h.prototype.initTitleBar=function(a,c){var d={},e="repoPageActions",f;a&&a.Type==="Clone"&&c?(f=a,d.Name=c,d.Parents=[],d.Parents[0]={},d.Parents[0].Name=f.Name,d.Parents[0].Location=f.Location,d.Parents[0].ChildrenLocation=f.Location,d.Parents[1]={},d.Parents[1].Name="Repositories"):a&&a.Type===
"Clone"?(f=a,d.Name=f.Name,d.Parents=[],d.Parents[0]={},d.Parents[0].Name="Repositories"):(d.Name="Repositories",e="reposPageActions");i(this.registry,this.commandService,"pageActions",e,f||{});b.setPageTarget({task:"Repositories",target:f,breadcrumbTarget:d,makeBreadcrumbLink:function(a,b){a.href=k.toUrl("git/git-repository.html")+(b?"#"+b:"")},serviceRegistry:this.registry,commandService:this.commandService})};h.prototype.decorateRepository=function(a,b,c){var d=this,c=c||new l;b||(b="full");this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.core.file").loadWorkspace(a.ContentLocation+
"?parts=meta"),"Loading workspace info").then(function(e){try{a.Content={};var f="root / ";if(e.Parents!==null)for(var g=e.Parents.length;g>0;g--)f+=e.Parents[g-1].Name+" / ";f+=e.Name;a.Content.Path=f;b!=="full"?c.resolve():d.registry.getService("orion.page.progress").progress(d.registry.getService("orion.git.provider").getGitStatus(a.StatusLocation),"Getting status for "+a.Name).then(function(b){try{a.Status=b,d.registry.getService("orion.page.progress").progress(d.registry.getService("orion.git.provider").getGitBranch(a.BranchLocation),
"Getting branches for "+a.Name).then(function(b){try{for(var e=b.Children||[],f,b=0;b<e.length;b++)if(e[b].Current){f=e[b];break}!f||f.RemoteLocation[0]===null?c.resolve():f.RemoteLocation.length===1&&f.RemoteLocation[0].Children.length===1&&f.RemoteLocation[0].Children[0].CommitLocation?d.registry.getService("orion.page.progress").progress(d.registry.getService("orion.git.provider").getLog(f.RemoteLocation[0].Children[0].CommitLocation+"?page=1&pageSize=20","HEAD"),"Getting incomming commits "+a.Name).then(function(b){a.CommitsToPush=
b.Children===void 0?0:b.Children.length;c.resolve()},function(){c.reject()}):d.registry.getService("orion.page.progress").progress(d.registry.getService("orion.git.provider").doGitLog(f.CommitLocation+"?page=1&pageSize=20"),"Getting outgoing commits "+a.Name).then(function(b){a.CommitsToPush=b.Children===void 0?0:b.Children.length;c.resolve()},function(){c.reject()})}catch(g){c.reject()}},function(){c.reject()})}catch(e){c.reject()}},function(){c.reject()})}catch(h){c.reject(h)}},function(){c.reject()});
return c};h.prototype.displayRepositories=function(b,c,d){var e=this;this.registry.getService("orion.page.message");var h=new j.DynamicContentModel(b,function(a){return e.decorateRepository.bind(e)(b[a])}),h=new j.DynamicContentExplorer(h);h.use({initialRender:function(){var d=a.node("table");a.empty(d);if(!b||b.length===0)(new f.Section(d,{id:"repositorySection",title:"Repository",iconClass:["gitImageSprite","git-sprite-repository"]})).setTitle(c==="full"?g["No Repositories"]:g["Repository Not Found"]),
e.loadingDeferred.resolve();else{var h=document.createElement("div");h.className="sectionTable";d.appendChild(h);h.innerHTML='<div id="repositoryNode" class="mainPadding"></div>'}},cleanupRender:function(){e.loadingDeferred.resolve()},renderBeforeItemPopulation:function(f){var h=document.createElement("div");h.className="sectionTableItem "+(b.length===1?"":"lightTreeTableRow");a.node("repositoryNode").appendChild(h);var j=document.createElement("div");j.style.overflow="hidden";h.appendChild(j);h=
document.createElement("div");h.className="stretch";j.appendChild(h);var i=document.createElement("span");h.appendChild(i);if(d){var l=document.createElement("a");l.href=k.toUrl("git/git-repository.html#")+b[f].Location;l.appendChild(document.createTextNode(b[f].Name));i.appendChild(l)}else i.appendChild(document.createTextNode(b[f].Name));this.explorer.progressIndicators[f]=new this.explorer.progressIndicator(f,i);i=document.createElement("div");h.appendChild(i);i=document.createElement("span");
i.textContent=b[f].GitUrl!==null?"git url: "+b[f].GitUrl:g["(no remote)"];h.appendChild(i);i=document.createElement("div");h.appendChild(i);i=document.createElement("span");i.id="location"+f;h.appendChild(i);if(c==="full")i=document.createElement("div"),i.style.paddingTop="10px",h.appendChild(i),i=document.createElement("span"),i.id="repositoryState"+f,i.style.paddingLeft="10px",h.appendChild(i),i=document.createElement("span"),i.id="workspaceState"+f,i.style.paddingLeft="10px",h.appendChild(i),i=
document.createElement("span"),i.id="commitsState"+f,i.style.paddingLeft="10px",h.appendChild(i),h=document.createElement("div"),h.className="sectionTableItemActions",h.id="repositoryActionsArea",j.appendChild(h),e.commandService.renderCommands(e.actionScopeId,h,b[f],e,"tool")},renderAfterItemPopulation:function(a){e.renderRepository(b[a],a,b.length,c,d)}});h.render()};h.prototype.renderRepository=function(b,c,e,f){a.node("location"+c).textContent=g["location: "]+b.Content.Path;e=b.Status;if(f===
"full"){var f=e.Untracked.length+e.Conflicting.length+e.Modified.length,h=e.Changed.length+e.Added.length+e.Removed.length,f=f>0||h>0?d.formatMessage(g["${0} file(s) to stage and ${1} file(s) to commit."],f,h):g["Nothing to commit."];if(e.RepositoryState!=="SAFE")a.node("repositoryState"+c).textContent=g["Rebase in progress!"];a.node("workspaceState"+c).textContent=f;b=b.CommitsToPush;a.node("commitsState"+c).textContent=b>0?b+g[" commit(s) to push."]:g["Nothing to push."]}};h.prototype.displayStatus=
function(b){var c=b.StatusLocation,d=this,e=a.node("table"),e=new f.Section(e,{id:"workingDirectorySection",title:g["Working Directory"],content:'<div id="workingDirectoryNode" class="mainPadding"></div>'});d.commandService.registerCommandContribution(e.actionsNode.id,"eclipse.orion.git.repositories.viewAllCommand",10);d.commandService.renderCommands(e.actionsNode.id,e.actionsNode.id,{ViewAllLink:"git/git-status2.html#"+b.StatusLocation,ViewAllLabel:g["See Full Status"],ViewAllTooltip:g["See the status"]},
d,"button");var h=e.createProgressMonitor();h.begin("Loading status");this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitBranch(c),"Loading status").then(function(a){h.done();d.renderStatus(b,a)},function(a){h.done(a)})};h.prototype.renderStatus=function(b,c){var e=a.node("workingDirectoryNode");e&&a.empty(e);var f=document.createElement("div");f.className="sectionTableItem";e.appendChild(f);var h=document.createElement("div");h.style.overflow=
"hidden";f.appendChild(h);var f=c.Untracked.length+c.Conflicting.length+c.Modified.length,e=c.Changed.length+c.Added.length+c.Removed.length,j=g["You have no changes to commit."];if(f>0||e>0)j=g["You have changes to commit in your workspace!"];var i=document.createElement("div");i.style.overflow="vbox stretch details-view";h.appendChild(i);if(c.RepositoryState!=="SAFE")h=document.createElement("div"),h.textContent=g["Rebase in progress!"],i.appendChild(h);h=document.createElement("div");h.textContent=
j;i.appendChild(h);j=document.createElement("div");j.textContent=d.formatMessage(g["${0} file(s) to stage and ${1} file(s) to commit."],f,e);i.appendChild(j)};h.prototype.decorateBranches=function(a,b){var c=this,b=b||new l;a.length>0?this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").doGitLog(a[0].CommitLocation+"?page=1&pageSize=1"),"Getting branch last commit "+a[0].Name).then(function(d){a[0].Commit=d.Children[0];c.decorateBranches(a.slice(1),
b)}):b.resolve();return b};h.prototype.displayBranches=function(b,c){var d=b.BranchLocation,e=this,h=a.node("table"),j=new f.Section(h,{id:"branchSection",title:g.Branches,iconClass:["gitImageSprite","git-sprite-branch"],slideout:!0,content:'<div id="branchNode"></div>',canHide:!0,preferenceService:this.registry.getService("orion.core.preference")}),i=j.createProgressMonitor();i.begin("Getting branches");this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitBranch(d+
(c==="full"?"?commits=1":"?commits=1&page=1&pageSize=5")),"Getting branches "+b.Name).then(function(f){f=f.Children;i.done();e.commandService.destroy(j.actionsNode.id);c!=="full"&&f.length!==0&&(e.commandService.registerCommandContribution(j.actionsNode.id,"eclipse.orion.git.repositories.viewAllCommand",10),e.commandService.renderCommands(j.actionsNode.id,j.actionsNode.id,{ViewAllLink:"git/git-repository.html#"+d+"?page=1",ViewAllLabel:g["View All"],ViewAllTooltip:g["View all local and remote tracking branches"]},
e,"button"));e.commandService.registerCommandContribution(j.actionsNode.id,"eclipse.addBranch",200);e.commandService.renderCommands(j.actionsNode.id,j.actionsNode.id,b,e,"button");var h=document.createElement("div");h.className="mainPadding";for(var k=0;k<f.length;k++)f[k].ParentLocation=d,e.renderBranch(f[k],k,h);a.empty(a.node("branchNode"));a.node("branchNode").appendChild(h)},function(a){i.done();e.handleError(a)})};h.prototype.renderBranch=function(a,b,c){b=document.createElement("div");b.className=
"sectionTableItem lightTreeTableRow";c.appendChild(b);c=document.createElement("div");c.style.overflow="hidden";b.appendChild(c);if(a.Current)b=document.createElement("span"),b.className="sectionIcon gitImageSprite git-sprite-branch_active",c.appendChild(b);b=document.createElement("div");b.className="stretch";c.appendChild(b);var e=document.createElement("span");e.className=a.Current?"activeBranch":"";e.textContent=a.Name;b.appendChild(e);var e=a.Commit.Children[0],f=a.RemoteLocation.length&&a.RemoteLocation.length===
1&&a.RemoteLocation[0].Children.length&&a.RemoteLocation[0].Children.length===1?d.formatMessage(g["tracks ${0}, "],a.RemoteLocation[0].Children[0].Name):g["tracks no branch, "],h=document.createElement("div");h.textContent=f+d.formatMessage(g["last modified ${0} by ${1}"],(new Date(e.Time)).toLocaleString(),e.AuthorName);b.appendChild(h);b=document.createElement("div");b.className="sectionTableItemActions";b.id="branchActionsArea";c.appendChild(b);this.commandService.renderCommands(this.actionScopeId,
b,a,this,"tool")};h.prototype.displayRemoteBranches=function(b){var c=b.RemoteLocation,d=this,e=a.node("table"),h=new f.Section(e,{id:"remoteBranchSection",title:"Remote Branches",iconClass:["gitImageSprite","git-sprite-branch"],content:'<div id="remoteBranchNode" class="mainPadding"></div>',canHide:!0,preferenceService:this.registry.getService("orion.core.preference")}),j=h.createProgressMonitor();j.begin("Getting remote branches");this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitRemote(c),
"Getting remote branches "+b.Name).then(function(a){a=a.Children;j.done();a.length===0?h.setTitle(g["No Remote Branches"]):(j=h.createProgressMonitor(),j.begin(g["Rendering branches"]),d.displayRemoteBranches2(h,a,b).then(function(){j.done()},function(){j.done()}))},function(a){j.done(a)})};h.prototype.displayRemoteBranches2=function(a,b,c,d,e){var f=this,d=d||new l;b.length>0?this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitRemote(b[0].Location),
"Getting remote branches "+b[0].Name).then(function(g){for(var g=g.Children,h=0;h<g.length;h++)g[h].Repository=c,f.renderRemoteBranch(g[h],h);f.displayRemoteBranches2(a,b.slice(1),c,d,e||g.length>0,g)},function(a){d.reject(a)}):(e||a.setTitle(g["No Remote Branches"]),d.resolve());return d};h.prototype.renderRemoteBranch=function(b){var c=document.createElement("div");c.className="sectionTableItem lightTreeTableRow";a.node("remoteBranchNode").appendChild(c);var d=document.createElement("div");d.style.overflow=
"hidden";c.appendChild(d);c=document.createElement("div");c.className="stretch";d.appendChild(c);var e=document.createElement("span");e.textContent=b.Name;c.appendChild(e);c=document.createElement("div");c.className="sectionTableItemActions";c.id="branchActionsArea";d.appendChild(c);this.commandService.renderCommands(this.actionScopeId,c,b,this,"tool")};h.prototype.displayCommits=function(b){var c=this,e=a.node("table"),h=new f.Section(e,{id:"commitSection",title:g.Commits,slideout:!0,content:'<div id="commitNode"></div>',
canHide:!0,preferenceService:this.registry.getService("orion.core.preference")}),j=h.createProgressMonitor();j.begin(g["Getting current branch"]);var i=document.createElement("div");i.className="mainPadding";this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitBranch(b.BranchLocation),"Getting current branch "+b.Name).then(function(a){for(var a=a.Children,b,e=0;e<a.length;e++)if(a[e].Current){b=a[e];break}b?(a=b.RemoteLocation.length===1&&b.RemoteLocation[0].Children.length===
1,h.setTitle(d.formatMessage(g['Commits for "${0}" branch'],b.Name)),c.commandService.destroy(h.actionsNode.id),c.commandService.registerCommandContribution(h.actionsNode.id,"eclipse.orion.git.repositories.viewAllCommand",10),c.commandService.renderCommands(h.actionsNode.id,h.actionsNode.id,{ViewAllLink:"git/git-log.html#"+b.CommitLocation+"?page=1",ViewAllLabel:g["See Full Log"],ViewAllTooltip:g["See the full log"]},c,"button"),a&&(c.commandService.registerCommandContribution(h.actionsNode.id,"eclipse.orion.git.fetch",
100),c.commandService.registerCommandContribution(h.actionsNode.id,"eclipse.orion.git.merge",100),c.commandService.registerCommandContribution(h.actionsNode.id,"eclipse.orion.git.rebase",100),c.commandService.registerCommandContribution(h.actionsNode.id,"eclipse.orion.git.resetIndex",100),c.commandService.renderCommands(h.actionsNode.id,h.actionsNode.id,b.RemoteLocation[0].Children[0],c,"button")),c.commandService.registerCommandContribution(h.actionsNode.id,"eclipse.orion.git.push",100),c.commandService.renderCommands(h.actionsNode.id,
h.actionsNode.id,b,c,"button"),b.RemoteLocation[0]===null?(j.done(),c.renderNoCommit(i)):(j.worked(d.formatMessage(g['Getting commits for "${0}" branch'],b.Name)),a&&b.RemoteLocation[0].Children[0].CommitLocation?c.registry.getService("orion.git.provider").getLog(b.RemoteLocation[0].Children[0].CommitLocation+"?page=1&pageSize=20","HEAD").then(function(a){j.worked(g["Rendering commits"]);for(var d=a.Children.length,e=0;e<a.Children.length;e++)c.renderCommit(a.Children[e],!0,e,i);j.worked(g["Getting outgoing commits"]);
c.registry.getService("orion.git.provider").getLog(b.CommitLocation+"?page=1&pageSize=20",b.RemoteLocation[0].Children[0].Id).then(function(a){j.worked("Rendering commits");for(var b=0;b<a.Children.length;b++)c.renderCommit(a.Children[b],!1,b+d,i);d+=a.Children.length;d===0&&c.renderNoCommit(i);j.done()},function(a){j.done(a)})},function(a){j.done(a)}):c.registry.getService("orion.git.provider").doGitLog(b.CommitLocation+"?page=1&pageSize=20").then(function(a){j.worked(g["Rendering commits"]);for(var b=
0;b<a.Children.length;b++)c.renderCommit(a.Children[b],!0,b,i);a.Children.length===0&&c.renderNoCommit(i);j.done()},function(a){j.done(a)}))):j.done()});a.empty(a.node("commitNode"));a.node("commitNode").appendChild(i)};h.prototype.renderNoCommit=function(a){var b=document.createElement("div");b.className="sectionTableItem";a.appendChild(b);a=document.createElement("div");a.style.overflow="hidden";b.appendChild(a);b=document.createElement("div");b.className="stretch";a.appendChild(b);a=document.createElement("div");
a.textContent=g["The branch is up to date."];b.appendChild(a);a=document.createElement("div");a.textContent=g["You have no outgoing or incoming commits."];b.appendChild(a)};h.prototype.renderCommit=function(a,b,c,d){c=document.createElement("div");c.className="sectionTableItem lightTreeTableRow";d.appendChild(c);d=document.createElement("div");d.style.overflow="hidden";c.appendChild(d);b=b?"git-sprite-outgoing_commit":"git-sprite-incoming_commit";c=document.createElement("span");c.className="sectionIcon gitImageSprite "+
b;d.appendChild(c);if(a.AuthorImage)b=document.createElement("div"),b.style["float"]="left",c=new Image,c.src=a.AuthorImage,c.name=a.AuthorName,c.className="git-author-icon",b.appendChild(c),d.appendChild(b);b=document.createElement("div");b.className="stretch";d.appendChild(b);c=document.createElement("a");c.className="navlinkonpage";c.href=k.toUrl("git/git-commit.html#")+a.Location+"?page=1&pageSize=1";c.textContent=a.Message;b.appendChild(c);new n.CommitTooltipDialog({commit:a,triggerNode:c});
c=document.createElement("div");b.appendChild(c);c=document.createElement("span");c.textContent=g[" (SHA "]+a.Name+g[") by "]+a.AuthorName+" on "+(new Date(a.Time)).toLocaleString();b.appendChild(c);b=document.createElement("div");b.className="sectionTableItemActions";b.id="branchActionsArea";d.appendChild(b);this.commandService.renderCommands(this.actionScopeId,b,a,this,"tool")};h.prototype.decorateTag=function(a,b){b=b||new l;this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").doGitLog(a.CommitLocation+
"?page=1&pageSize=1"),"Getting tag last commit "+a.Name).then(function(c){a.Commit=c.Children[0];b.resolve()},function(){b.reject()});return b};h.prototype.displayTags=function(b,c){var d=this,h=document.createElement("a"),i=e.matchResourceParameters();h.href=i.resource;var h=h.search?h.search:"?page=1&pageSize=20",i=a.node("table"),l=new f.Section(i,{id:"tagSection",iconClass:["gitImageSprite","git-sprite-tag"],title:"Tags"+(c==="full"?"":" (5 most recent)"),content:'<div id="tagNode"></div>',canHide:!0,
hidden:!0,preferenceService:d.registry.getService("orion.core.preference")}),m=l.createProgressMonitor();m.begin(g["Getting tags"]);var n=document.createElement("div");n.className="mainPadding";this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitBranch(b.TagLocation+(c==="full"?h:"?page=1&pageSize=5")),"Getting tags "+b.Name).then(function(e){var f=e.Children,e=new j.DynamicContentModel(f,function(a){return d.decorateTag.bind(d)(f[a])}),e=
new j.DynamicContentExplorer(e);e.use({initialRender:function(){m.done();a.empty(a.node("tagNode"));a.node("tagNode").appendChild(n);d.commandService.destroy(l.actionsNode.id);c!=="full"&&f.length!==0&&(d.commandService.registerCommandContribution(l.actionsNode.id,"eclipse.orion.git.repositories.viewAllCommand",10),d.commandService.renderCommands(l.actionsNode.id,l.actionsNode.id,{ViewAllLink:k.toUrl("git/git-repository.html#")+b.TagLocation+"?page=1&pageSize=20",ViewAllLabel:g["View All"],ViewAllTooltip:g["View all tags"]},
d,"button"));f.length===0&&l.setTitle(g["No Tags"])},renderBeforeItemPopulation:function(a){var b=document.createElement("div");b.className="sectionTableItem lightTreeTableRow";n.appendChild(b);var c=document.createElement("div");c.style.overflow="hidden";b.appendChild(c);b=document.createElement("div");b.className="stretch";c.appendChild(b);var e=document.createElement("span");e.textContent=f[a].Name;b.appendChild(e);this.explorer.progressIndicators[a]=new this.explorer.progressIndicator(a,e);e=
document.createElement("div");e.id="tagDetailsView"+a;b.appendChild(e);b=document.createElement("div");b.className="sectionTableItemActions";b.id="tagActionsArea";c.appendChild(b);d.commandService.renderCommands(d.actionScopeId,b,f[a],d,"tool")},renderAfterItemPopulation:function(a){d.renderTag(f[a],a)}});e.render()},function(a){m.done();d.handleError(a)})};h.prototype.renderTag=function(b,c){var d=document.createElement("span");d.className="tag-description";a.empty(a.node("tagDetailsView"+c));a.node("tagDetailsView"+
c).appendChild(d);var e=b.Commit,f=document.createElement("a");f.className="navlinkonpage";f.href=k.toUrl("git/git-commit.html#")+e.Location+"?page=1&pageSize=1";f.textContent=e.Message;d.appendChild(f);d.appendChild(document.createTextNode(g[" by "]+e.AuthorName+g[" on "]+(new Date(e.Time)).toLocaleString()));new n.CommitTooltipDialog({commit:e,triggerNode:f})};h.prototype.displayRemotes=function(b){var c=b.RemoteLocation,d=this,e=a.node("table"),h=new f.Section(e,{id:"remoteSection",title:g.Remotes,
iconClass:["gitImageSprite","git-sprite-remote"],slideout:!0,content:'<div id="remoteNode" class="mainPadding"></div>',canHide:!0,hidden:!0,preferenceService:this.registry.getService("orion.core.preference")}),j=h.createProgressMonitor();j.begin("Getting remotes");d.commandService.registerCommandContribution(h.actionsNode.id,"eclipse.addRemote",100);d.commandService.renderCommands(h.actionsNode.id,h.actionsNode.id,b,d,"button");this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitRemote(c),
"Getting remotes "+b.Name).then(function(a){a=a.Children;j.worked(g["Rendering remotes"]);if(a.length===0)h.setTitle(g["No Remotes"]);else for(var b=0;b<a.length;b++)d.renderRemote(a[b],b);j.done()},function(a){j.done();d.handleError(a)})};h.prototype.renderRemote=function(b){var c=document.createElement("div");c.className="sectionTableItem lightTreeTableRow";a.node("remoteNode").appendChild(c);var d=document.createElement("div");d.style.overflow="hidden";c.appendChild(d);c=document.createElement("div");
c.className="stretch";d.appendChild(c);var e=document.createElement("div");e.textContent=b.Name;c.appendChild(e);e=document.createElement("div");e.textContent=b.GitUrl;c.appendChild(e);c=document.createElement("div");c.className="sectionTableItemActions";c.id="remoteActionsArea";d.appendChild(c);this.commandService.renderCommands(this.actionScopeId,c,b,this,"tool")};h.prototype.displayConfig=function(b,c){var d=b.ConfigLocation,e=this,h=a.node("table"),j=new f.Section(h,{id:"configSection",title:g.Configuration+
(c==="full"?"":" (user.*)"),slideout:!0,content:'<div id="configNode" class="mainPadding"></div>',canHide:!0,hidden:!0,preferenceService:this.registry.getService("orion.core.preference")}),i=j.createProgressMonitor();i.begin(g["Getting confituration"]);this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitCloneConfig(d),"Getting configuration of "+b.Name).then(function(a){i.worked("Rendering configuration");a=a.Children;c!=="full"&&a.length!==
0&&(e.commandService.registerCommandContribution(j.actionsNode.id,"eclipse.orion.git.repositories.viewAllCommand",10),e.commandService.renderCommands(j.actionsNode.id,j.actionsNode.id,{ViewAllLink:"git/git-repository.html#"+d,ViewAllLabel:g["View All"],ViewAllTooltip:g["View all configuration entries"]},e,"button"));c==="full"&&(e.commandService.registerCommandContribution(j.actionsNode.id,"eclipse.orion.git.addConfigEntryCommand",1E3),e.commandService.renderCommands(j.actionsNode.id,j.actionsNode.id,
b,e,"button"));if(a.length===0)j.setTitle("No Configuration");else for(var f=0;f<a.length;f++)(c==="full"||a[f].Key.indexOf("user.")!==-1)&&e.renderConfigEntry(a[f],f);i.done()},function(a){i.done();e.handleError(a)})};h.prototype.renderConfigEntry=function(b){var c=document.createElement("div");c.className="sectionTableItem lightTreeTableRow";a.node("configNode").appendChild(c);var d=document.createElement("div");d.style.overflow="hidden";c.appendChild(d);c=document.createElement("div");c.className=
"stretch";d.appendChild(c);var e=document.createElement("span");e.textContent=b.Key;c.appendChild(e);e=document.createElement("span");e.style.paddingLeft="10px";e.textContent=b.Value;c.appendChild(e);c=document.createElement("div");c.className="sectionTableItemActions";c.id="configActionsArea";d.appendChild(c);this.commandService.renderCommands(this.actionScopeId,c,b,this,"tool")};return h}();return i});
define("orion/operation",["orion/xhr","orion/Deferred"],function(g,k){function i(d,a,e,f){g("GET",d,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(c){c=c.response?JSON.parse(c.response):null;a.progress(c);!c.type||c.type==="loadstart"||c.type==="progress"?setTimeout(function(){i(d,a,e,f)},2E3):(c.type==="error"||c.type==="abort"?a.reject(f?f(c):c.Result):a.resolve(e?e(c):c.Result.JsonData),c.Location||g("DELETE",d,{headers:{"Orion-Version":"1"},timeout:15E3}))},function(c){var b=c;if(c.responseText!==
void 0){b=c.responseText;try{b=JSON.parse(c.responseText)}catch(d){}}b.Message!==void 0?(b.HttpCode=b.HttpCode===void 0?c.status:b.HttpCode,b.Severity=b.Severity===void 0?"Error":b.Severity,a.reject(b)):a.reject({Severity:"Error",Message:b,HttpCode:c.status})})}function f(d,a){a.then(null,function(a){a instanceof Error&&a.name==="Cancel"&&g("PUT",d,{headers:{"Orion-Version":"1"},data:JSON.stringify({abort:!0}),timeout:15E3})})}return{handle:function(d,a,e){var g=new k;f(d,g);i(d,g,a,e);return g}}});
define("orion/git/gitClient",["require","orion/xhr","orion/Deferred","orion/operation"],function(g,k,i,f){var d=d||{};d.GitService=function(){function a(a){if(a)this._serviceRegistry=a,this._serviceRegistration=a.registerService("orion.git.provider",this),this._sshService=a.getService("orion.net.ssh")}a.prototype={checkGitService:function(){},cloneGitRepository:function(a,d,c,b,f,l,n,m,s,r){var q=this,p={};if(a)p.Name=a;if(c)p.Path=c;if(d)p.GitUrl=d;p.Location=b;if(f)p.GitSshUsername=f;if(l)p.GitSshPassword=
l;if(n)p.GitSshKnownHost=n;if(m)p.GitSshPrivateKey=m;if(s)p.GitSshPassphrase=s;if(r){if(r.GitMail)p.GitMail=r.GitMail;if(r.GitName)p.GitName=r.GitName}var a=g.toUrl("gitapi/clone/._"),a=a.substring(0,a.length-2),t=new i;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(p)}).then(function(a){q._getGitServiceResponse(t,a)},function(a){q._handleGitServiceResponseError(t,a)});return t},removeGitRepository:function(a){var d=this,c=
new i;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},getGitStatus:function(a){var d=this,c=new i;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},stage:function(a){var d=
this,c=new i;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},stageMultipleFiles:function(a,d){var c=this,b=new i;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d})}).then(function(a){c._getGitServiceResponse(b,a)},function(a){c._handleGitServiceResponseError(b,
a)});return b},unstageAll:function(a,d){var c=this,b=new i;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Reset:d})}).then(function(a){c._getGitServiceResponse(b,a)},function(a){c._handleGitServiceResponseError(b,a)});return b},unstage:function(a,d){var c=this,b=new i;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d})}).then(function(a){c._getGitServiceResponse(b,
a)},function(a){c._handleGitServiceResponseError(b,a)});return b},checkoutPath:function(a,d){var c=this,b=new i;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d,RemoveUntracked:"true"})}).then(function(a){c._getGitServiceResponse(b,a)},function(a){c._handleGitServiceResponseError(b,a)});return b},commitAll:function(a,d,c){var b=this,f=new i;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,
handleAs:"json",data:c}).then(function(a){b._getGitServiceResponse(f,a)},function(a){b._handleGitServiceResponseError(f,a)});return f},getGitClone:function(a){var d=this,c=new i;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},getGitCloneConfig:function(a){var d=this,c=new i;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},getGitBranch:function(a){var d=this,c=new i;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},getGitRemote:function(a){var d=this,c=new i;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},checkoutBranch:function(a,d){var c=this,b=new i;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Branch:d})}).then(function(a){c._getGitServiceResponse(b,a)},function(a){c._handleGitServiceResponseError(b,a)});return b},resetIndex:function(a,d){var c=this,b=new i;k("POST",a,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Commit:d,Reset:"HARD"})}).then(function(a){c._getGitServiceResponse(b,a)},function(a){c._handleGitServiceResponseError(b,a)});return b},addBranch:function(a,d,c){var b=this,f={};if(d)f.Name=d;if(c)f.Branch=c;var g=new i;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(f)}).then(function(a){b._getGitServiceResponse(g,a)},function(a){b._handleGitServiceResponseError(g,
a)});return g},removeBranch:function(a){var d=this,c=new i;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},addRemote:function(a,d,c){var b=this,f=new i;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Remote:d,RemoteURI:c})}).then(function(a){b._getGitServiceResponse(f,
a)},function(a){b._handleGitServiceResponseError(f,a)});return f},removeRemote:function(a){var d=this,c=new i;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},doGitLog:function(a){var d=this,c=new i;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,
a)},function(a){d._handleGitServiceResponseError(c,a)});return c},getDiff:function(a,d){var c=this,b=new i;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:d})}).then(function(a){c._getGitServiceResponse(b,a)},function(a){c._handleGitServiceResponseError(b,a)});return b},doFetch:function(a,d,c,b,f,g,n){var m=this,s=new i;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",
data:JSON.stringify({Fetch:"true",Force:d,GitSshUsername:c,GitSshPassword:b,GitSshKnownHost:f,GitSshPrivateKey:g,GitSshPassphrase:n})}).then(function(a){m._getGitServiceResponse(s,a)},function(a){m._handleGitServiceResponseError(s,a)});return s},doPull:function(a,d,c,b,f,g,n){var m=this,s=new i;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Pull:"true",Force:d,GitSshUsername:c,GitSshPassword:b,GitSshKnownHost:f,GitSshPrivateKey:g,
GitSshPassphrase:n})}).then(function(a){m._getGitServiceResponse(s,a)},function(a){m._handleGitServiceResponseError(s,a)});return s},doMerge:function(a,d,c){var b=this,f=new i;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Merge:d,Squash:c})}).then(function(a){b._getGitServiceResponse(f,a)},function(a){b._handleGitServiceResponseError(f,a)});return f},doCherryPick:function(a,d){var c=this,b=new i;k("POST",a,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({"Cherry-Pick":d})}).then(function(a){c._getGitServiceResponse(b,a)},function(a){c._handleGitServiceResponseError(b,a)});return b},doRebase:function(a,d,c){var b=this,f={};f.Rebase=d;if(c)f.Operation=c;var g=new i;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(f)}).then(function(a){b._getGitServiceResponse(g,a)},function(a){b._handleGitServiceResponseError(g,
a)});return g},doPush:function(a,d,c,b,f,g,n,m,s){var r=this,q=new i;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({PushSrcRef:d,PushTags:c,Force:b,GitSshUsername:f,GitSshPassword:g,GitSshKnownHost:n,GitSshPrivateKey:m,GitSshPassphrase:s})}).then(function(a){r._getGitServiceResponse(q,a)},function(a){r._handleGitServiceResponseError(q,a)});return q},getLog:function(a,d){var c=this,b=new i,f=new i;k("POST",a,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:d})}).then(function(a){f.resolve(a.xhr.getResponseHeader("Location"))},function(a){c._handleGitServiceResponseError(b,a)});f.then(function(a){k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){c._getGitServiceResponse(b,a)},function(a){c._handleGitServiceResponseError(b,a)})});return b},getDefaultRemoteBranch:function(a){var d=this,c=new i,b=new i;
k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(b,a)},function(a){d._handleGitServiceResponseError(c,a)});b.then(function(a){k("GET",a.Children[0].Location,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)})});return c},doAddTag:function(a,d){var c=this,b=new i;k("PUT",
a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Name:d})}).then(function(a){c._getGitServiceResponse(b,a)},function(a){c._handleGitServiceResponseError(b,a)});return b},doRemoveTag:function(a){var d=this,c=new i;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},checkoutTag:function(a,
d,c){var b=this,f=new i;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Tag:d,Branch:c})}).then(function(a){b._getGitServiceResponse(f,a)},function(a){b._handleGitServiceResponseError(f,a)});return f},addCloneConfigurationProperty:function(a,d,c){var b=this,f=new i;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Key:d,Value:c})}).then(function(a){b._getGitServiceResponse(f,
a)},function(a){b._handleGitServiceResponseError(f,a)});return f},editCloneConfigurationProperty:function(a,d){var c=this,b=new i;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Value:d})}).then(function(a){c._getGitServiceResponse(b,a)},function(a){c._handleGitServiceResponseError(b,a)});return b},deleteCloneConfigurationProperty:function(a){var d=this,c=new i;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},sendCommitReviewRequest:function(a,d,c,b,f,g){var n=this,m=new i;k("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({ReviewReqCommit:a,ReviewReqUrl:b,ReviewReqNotifyLogin:c,ReviewReqAuthorName:f,ReviewMessage:g})}).then(function(a){n._getGitServiceResponse(m,a)},function(a){n._handleGitServiceResponseError(m,
a)});return m},_getGitServiceResponse:function(a,d){var c=d.response?JSON.parse(d.response):null;if(d.xhr&&d.xhr.status===202){var b=f.handle(c.Location);b.then(a.resolve,function(b){b.failedOperation=c.Location;a.reject(b)},a.progress);a.then(null,function(a){b.reject(a)})}else a.resolve(c)},_handleGitServiceResponseError:function(a,d){a.reject(d)}};return a}();return d});
define("orion/ssh/sshTools",[],function(){var g=g||{};g.SshService=function(){function g(i){if(i)this._serviceRegistry=i,this._serviceRegistration=i.registerService("orion.net.ssh",this)}g.prototype={_KNOWN_HOSTS:"known_hosts",addKnownHosts:function(g,f){f||(f="");var d=localStorage.getItem(f+this._KNOWN_HOSTS);d?d.indexOf(g)<0&&localStorage.setItem(f+this._KNOWN_HOSTS,d+"\n"+g):localStorage.setItem(f+this._KNOWN_HOSTS,g)},clearKnownhosts:function(g){g||(g="");localStorage.removeItem(g+this._KNOWN_HOSTS)},
getKnownHosts:function(g){g||(g="");return localStorage.getItem(g+this._KNOWN_HOSTS)}};return g}();return g});
define("orion/links",[],function(){function g(g){this._init(g)}g.prototype={_init:function(g){this._registry=g.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.textlink",this)},_replaceLink:function(g,i,f,d,a){var e=g.search(f);e>0&&(i.appendChild(document.createTextNode(g.substring(0,e))),g=g.substring(e));var f=g.replace(f,""),e=g.substring(0,g.length-f.length),j=e.split(" ",d);if(j.length===d){for(var g=document.createElement("a"),c=0;c<d;c++)a=a.replace("%"+
(c+1),j[c]);g.setAttribute("href",a);g.textContent=e;i.appendChild(g);g=f}return g},addLinks:function(g,i){var f=i||document.createElement("div"),d=this._registry.getServiceReferences("orion.core.linkScanner");if(d.length>0)for(var a=d[0],d=RegExp(a.getProperty("pattern"),"i"),e=a.getProperty("words"),a=a.getProperty("anchor"),j=g.search(d);j>=0;)g=this._replaceLink(g,f,d,e,a),j=g.search(d);g.length>0&&f.appendChild(document.createTextNode(g));return f}};g.prototype.constructor=g;return{TextLinkService:g}});
var eclipse;
define('built-git-repository.js',"i18n!git/nls/gitmessages,require,orion/browserCompatibility,orion/bootstrap,orion/status,orion/progress,orion/PageUtil,orion/keyBinding,orion/commandRegistry,orion/commands,orion/dialogs,orion/selection,orion/fileClient,orion/operationsClient,orion/searchClient,orion/globalCommands,orion/git/gitRepositoryExplorer,orion/git/gitCommands,orion/git/gitClient,orion/ssh/sshTools,orion/links".split(","),function(g,k,i,f,d,a,e,j,c,b,h,l,n,m,s,r,q,p,t,o,v){f.startup().then(function(f){var i=f.serviceRegistry,
f=f.preferences;new h.DialogService(i);var w=new l.Selection(i);new o.SshService(i);var x=new c.CommandRegistry({selection:w}),w=new m.OperationsClient(i),A=new a.ProgressService(i,w,x);new d.StatusReportingService(i,w,"statusPane","notifications","notificationArea");w=new v.TextLinkService({serviceRegistry:i});new t.GitService(i);var F=new n.FileClient(i),B=new s.Searcher({serviceRegistry:i,commandService:x,fileService:F}),C=new q.GitRepositoryExplorer(i,x,w,null,"artifacts","pageNavigationActions",
"itemLevelCommands");r.generateBanner("orion-repository",i,x,f,B,C);p.createFileCommands(i,x,C,"pageActions","selectionTools");p.createGitClonesCommands(i,x,C,"pageActions","selectionTools",F);x.addCommandGroup("pageActions","eclipse.gitGroup",100);x.addCommandGroup("pageActions","eclipse.gitGroup",200);x.registerCommandContribution("reposPageActions","eclipse.cloneGitRepository",100,"eclipse.gitGroup",!1,null,new c.URLBinding("cloneGitRepository","url"));x.registerCommandContribution("reposPageActions",
"eclipse.createGitProject",300,"eclipse.gitGroup",!0,null,new c.URLBinding("createProjectContext","name"));x.registerCommandContribution("reposPageActions","eclipse.initGitRepository",200,"eclipse.gitGroup");x.registerCommandContribution("repoPageActions","eclipse.orion.git.pull",100,"eclipse.gitGroup");x.registerCommandContribution("repoPageActions","eclipse.orion.git.applyPatch",200,"eclipse.gitGroup");x.registerCommandContribution("repoPageActions","eclipse.git.deleteClone",300,"eclipse.gitGroup");
x.registerCommandContribution("repoPageActions","eclipse.orion.git.openCommitCommand",1E3,"eclipse.gitGroup",!0,new j.KeyBinding("h",!0,!0),new c.URLBinding("openGitCommit","commitName"));x.registerCommandContribution("itemLevelCommands","eclipse.openCloneContent",100);x.registerCommandContribution("itemLevelCommands","eclipse.openGitStatus",100);x.registerCommandContribution("itemLevelCommands","eclipse.openGitLog",100);x.registerCommandContribution("itemLevelCommands","eclipse.orion.git.pull",200);
x.registerCommandContribution("itemLevelCommands","eclipse.removeBranch",1E3);x.registerCommandContribution("itemLevelCommands","eclipse.checkoutTag",200);x.registerCommandContribution("itemLevelCommands","eclipse.removeTag",1E3);x.registerCommandContribution("itemLevelCommands","eclipse.checkoutBranch",200);x.registerCommandContribution("itemLevelCommands","eclipse.orion.git.applyPatch",300);x.registerCommandContribution("itemLevelCommands","eclipse.git.deleteClone",1E3);x.registerCommandContribution("itemLevelCommands",
"eclipse.orion.git.fetch",500);x.registerCommandContribution("itemLevelCommands","eclipse.orion.git.merge",600);x.registerCommandContribution("itemLevelCommands","eclipse.orion.git.mergeSquash",700);x.registerCommandContribution("itemLevelCommands","eclipse.orion.git.rebase",700);x.registerCommandContribution("itemLevelCommands","eclipse.orion.git.resetIndex",800);x.registerCommandContribution("itemLevelCommands","eclipse.removeRemote",1E3);x.registerCommandContribution("itemLevelCommands","eclipse.orion.git.deleteConfigEntryCommand",
1E3);x.registerCommandContribution("itemLevelCommands","eclipse.orion.git.editConfigEntryCommand",200);x.registerCommandContribution("pageNavigationActions","eclipse.orion.git.previousTagPage",1);x.registerCommandContribution("pageNavigationActions","eclipse.orion.git.nextTagPage",2);i=new b.Command({name:g["View All"],id:"eclipse.orion.git.repositories.viewAllCommand",hrefCallback:function(a){return k.toUrl(a.items.ViewAllLink)},visibleWhen:function(a){this.name=a.ViewAllLabel;this.tooltip=a.ViewAllTooltip;
return a.ViewAllLabel&&a.ViewAllTooltip&&a.ViewAllLink}});x.addCommand(i);var G=e.matchResourceParameters();typeof G["createProject.name"]==="undefined"&&x.processURL(window.location.href);A.progress(F.loadWorkspace(),"Loading default workspace").then(function(a){C.setDefaultPath(a.Location);var a={},b;for(b in G)b.indexOf("createProject")!=-1&&(a[b.replace("createProject.","")]=G[b]);x.runCommand("eclipse.createGitProject",{url:G.cloneGit,projectDescription:a},null,null);typeof G["createProject.name"]===
"undefined"&&C.redisplay()});var H="";window.addEventListener("hashchange",function(){x.closeParameterCollector();var a=e.matchResourceParameters().resource;H!==a&&(H=a,A.progress(F.loadWorkspace(),"Loading default workspace").then(function(a){C.setDefaultPath(a.Location);C.redisplay()}))},!1)})});