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

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


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

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


 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: Anton McConville - 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
 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) 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
*/
define("orion/browserCompatibility",[],function(){function i(){for(var c=navigator.userAgent,b={browser:!1,version:!1},a=[{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}],h=0;h<a.length;h++){var f=a[h],e=c.match(f.regExp);if(e){b.browser=!0;b.version=e[1]>=f.minVersion;b.name=f.name;break}}return b}
function k(){try{return"localStorage"in window&&window.localStorage!==null}catch(c){return!1}}function g(c){alert(c);throw"unsupported browser";}var d=i();if(d.browser)d.version||g("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+d.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()||g("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:i,supportsLocalStorage:k,throwBrowserAlert:g}});
(function(i,k){typeof define==="function"&&define.amd?define("orion/Deferred",k):typeof exports==="object"?module.exports=k():(i.orion=i.orion||{},i.orion.Deferred=k())})(this,function(){function i(){for(var e;e=a.shift()||h.shift();)e();f=!1}function k(e,j){(j?h:a).push(e);f||(f=!0,j?setTimeout(i,0):i())}function g(e){return function(){e.apply(null,arguments)}}function d(){}function c(){var e=Error("Cancel");e.name="Cancel";return e}function b(){function e(){for(var e;e=f.shift();){var b=e.deferred,
c=a==="resolved"?"resolve":"reject";if(typeof e[c]==="function")try{var h=e[c](j);h&&typeof h.then==="function"?(b.cancel=h.cancel||d,h.then(g(b.resolve),g(b.reject),b.progress)):b.resolve(h)}catch(n){b.reject(n)}else b[c](j)}}var j,a,f=[],h=this;this.reject=function(b){a||(a="rejected",j=b,f.length&&k(e));return h.promise};this.resolve=function(b){a||(a="resolved",j=b,f.length&&k(e));return h.promise};this.progress=function(e){a||f.forEach(function(j){j.progress&&j.progress(e)});return h.promise};
this.cancel=function(){a||h.reject(c())};this.then=function(j,c,d){var j={resolve:j,reject:c,progress:d,deferred:new b},g=j.deferred,i=!1,l=function(){i||(i=!0,k(function(){var e=g.cancel===l?h.cancel:g.cancel;typeof e==="function"&&e()},!0))};g.cancel=l;f.push(j);a&&k(e,!0);return g.promise};this.promise=Object.create(Object.prototype,{then:{value:h.then},cancel:{get:function(){return h.cancel},set:function(e){h.cancel=e}}})}var a=[],h=[],f=!1;b.all=function(e,j){function a(e,j){d||(h[e]=j,--c===
0&&g.resolve(h))}function f(e,b){if(!d){if(j)try{a(e,j(b));return}catch(l){b=l}g.reject(b)}}var c=e.length,h=[],d=!1,g=new b;g.then(null,function(){d=!0;e.forEach(function(e){e.cancel&&e.cancel()})});c===0?g.resolve(h):e.forEach(function(e,j){e.then(a.bind(null,j),f.bind(null,j))});return g.promise};b.when=function(e,j,a,f){var c;if(!(e&&typeof e.then==="function"))c=new b,c.resolve(e),e=c.promise;return e.then(j,a,f)};return b});
define("orion/EventTarget",[],function(){function i(){this._namedListeners={}}i.prototype={dispatchEvent:function(k){if(!k.type)throw Error("unspecified type");var g=this._namedListeners[k.type];g&&g.forEach(function(d){try{typeof d==="function"?d(k):d.handleEvent(k)}catch(c){typeof console!=="undefined"&&console.log(c)}});return!k.defaultPrevented},addEventListener:function(k,g){if(typeof g==="function"||g.handleEvent)this._namedListeners[k]=this._namedListeners[k]||[],this._namedListeners[k].push(g)},
removeEventListener:function(k,g){var d=this._namedListeners[k];if(d)for(var c=0;c<d.length;c++)if(d[c]===g){d.length===1?delete this._namedListeners[k]:d.splice(c,1);break}}};i.prototype.constructor=i;i.attach=function(k){var g=new i;k.dispatchEvent=g.dispatchEvent.bind(g);k.addEventListener=g.addEventListener.bind(g);k.removeEventListener=g.removeEventListener.bind(g)};return i});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(i,k){function g(a,f,e){this._properties=e||{};this._properties["service.id"]=a;this._properties.objectClass=f;this._properties["service.names"]=f}function d(a,f,e){this._serviceId=a;this._serviceReference=f;this._internalRegistry=e}function c(a,f){function e(e){return function(){var j;try{if(!f())throw Error("Service was unregistered");var b=a[e].apply(a,Array.prototype.slice.call(arguments));if(b&&typeof b.then==="function")return b;
else j=new i,j.resolve(b)}catch(c){j=new i,j.reject(c)}return j.promise}}for(var j in a)typeof a[j]==="function"&&(this[j]=e(j))}function b(a,f){this.type=a;this.serviceReference=f}function a(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var a=this;this._internalRegistry={isRegistered:function(f){return a._entries[f]?!0:!1},unregisterService:function(f){var e=a._entries[f];if(!e)throw Error("already unregistered");var j=e.reference;a._serviceEventTarget.dispatchEvent(new b("unregistering",
j));a._entries[f]=null;j.getProperty("objectClass").forEach(function(e){for(var f=a._namedReferences[e],b=0;b<f.length;b++)if(f[b]===j){f.length===1?delete a._namedReferences[e]:f.splice(b,1);break}})},modifyService:function(f){f=a._entries[f];if(!f)throw Error("already unregistered");a._serviceEventTarget.dispatchEvent(new b("modified",f.reference))}}}g.prototype={getPropertyKeys:function(){var a=[],f;for(f in this._properties)this._properties.hasOwnProperty(f)&&a.push(f);return a},getProperty:function(a){return this._properties[a]}};
g.prototype.constructor=g;d.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 f=this._serviceReference._properties;this._serviceReference._properties=a||{};a["service.id"]=this._serviceId;a.objectClass=f.objectClass;a["service.names"]=f["service.names"];this._internalRegistry.modifyService(this._serviceId)}};
d.prototype.constructor=d;a.prototype={getService:function(a){var f;if(typeof a==="string")(a=this._namedReferences[a])&&a.some(function(e){f=this._entries[e.getProperty("service.id")].service;return!!f},this);else if(a=this._entries[a.getProperty("service.id")])f=a.service;return f||null},getServiceReferences:function(a){if(a)return this._namedReferences[a]?this._namedReferences[a]:[];var f=[];this._entries.forEach(function(e){e&&f.push(e.reference)});return f},registerService:function(a,f,e){if(typeof f===
"undefined"||f===null)throw Error("invalid service");typeof a==="string"?a=[a]:Array.isArray(a)||(a=[]);var j=this._entries.length,m=new g(j,a,e),o=this._namedReferences;a.forEach(function(e){o[e]=o[e]||[];o[e].push(m)});a=new c(f,this._internalRegistry.isRegistered.bind(null,j));this._entries.push({reference:m,service:a});a=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new b("registered",m));return new d(j,m,a)},addEventListener:function(a,f){this._serviceEventTarget.addEventListener(a,
f)},removeEventListener:function(a,f){this._serviceEventTarget.removeEventListener(a,f)}};a.prototype.constructor=a;return{ServiceRegistry:a}});
define("orion/xhr",["orion/Deferred"],function(i){function k(g,d,c,b){var a=typeof c.response!=="undefined"?c.response:c.responseText,h;try{h=c.status}catch(f){h=0}g={args:d,response:a,responseText:typeof a==="string"?a:null,status:h,url:g,xhr:c};if(typeof b!=="undefined")g.error=b;return g}return function(g,d,c){var c=c||{},b=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,a=new i,h=c.headers||{},f=c.log||!1,e;typeof h["X-Requested-With"]==="undefined"&&(h["X-Requested-With"]="XMLHttpRequest");
if(typeof c.data!=="undefined"&&(g==="POST"||g==="PUT"))e=c.data;b.onprogress=function(e){e.xhr=b;a.progress(e)};b.onreadystatechange=function(){if(b.readyState===4){var e=k(d,c,b),j=b.status;200<=j&&j<400?a.resolve(e):(f&&typeof console!=="undefined"&&console.log(Error(b.statusText)),a.reject(e))}};try{b.open(g,d,!0);if(typeof c.responseType==="string")b.responseType=c.responseType;if(typeof c.timeout==="number")if(typeof b.timeout==="number")b.timeout=c.timeout,b.addEventListener("timeout",function(){a.reject(k(d,
c,b,"Timeout exceeded"))});else{var j=setTimeout(function(){a.reject(k(d,c,b,"Timeout exceeded"))},c.timeout);a.then(clearTimeout.bind(null,j),clearTimeout.bind(null,j))}Object.keys(h).forEach(function(e){b.setRequestHeader(e,h[e])});b.send(e)}catch(m){a.reject(k(d,c,b,m))}return a.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(i,k,g){function d(e,a){this._name=e;this._providers=a;this._flushPending=!1;this._cached=null;this._stores=[];this._dirty=[]}function c(e,a){return{get:function(f,b){if(a===0)return null;var c=localStorage.getItem(e+f);if(c===null)return null;c=JSON.parse(c);return b||a===-1||c._expires&&c._expires>(new Date).getTime()?(delete c._expires,c):null},set:function(f,b){if(a!==0){if(a!==-1)b._expires=(new Date).getTime()+1E3*a;
if(Object.keys(b).length===0)localStorage.removeItem(e+f);else{var c=JSON.stringify(b);localStorage.setItem(e+f,c);delete b._expires}}},remove:function(a){localStorage.removeItem(e+a)}}}function b(e){this._currentPromises={};this._cache=new c("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var a=e.getServiceReferences("orion.core.preference.provider");if(a.length>0)this._service=e.getService(a[0])}return!!this._service}}function a(e){this._location=
e;this._currentPromise=null;this._cache=new c("/orion/preferences/default",3600)}function h(){this._cache=new c("/orion/preferences/local",-1)}function f(e,j){this._userProvider=new b(e);this._localProvider=new h;j=j||"defaults.pref";j.indexOf("://")===-1&&(j=i.toUrl(j));this._defaultsProvider=new a(j);this._serviceRegistration=e.registerService("orion.core.preference",this)}d.prototype={_flush:function(){for(var e=[],a=0;a<this._stores.length;++a){var f=this._stores[a];this._dirty.indexOf(f)!==-1&&
e.push(this._providers[a].put(this._name,f))}this._dirty=[];return k.all(e)},_scheduleFlush:function(e){this._dirty.indexOf(e)===-1&&this._dirty.push(e);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 e=0;e<this._stores.length;++e){var a=this._stores[e],f;for(f in a)a.hasOwnProperty(f)&&typeof this._cached[f]==="undefined"&&(this._cached[f]=
a[f])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(e){return this._getCached()[e]},put:function(e,a){if(this._stores.length!==0){var f=this._stores[0];if(f[e]!==a)f[e]=a,this._cached=null,this._scheduleFlush(f)}},remove:function(e){for(var a=0;a<this._stores.length;++a){var f=this._stores[a];if(f.hasOwnProperty(e))return delete f[e],this._cached=null,this._scheduleFlush(f),!0}return!1},clear:function(){for(var e=0;e<this._stores.length;++e)this._stores[e]=
{},this._scheduleFlush(this._stores[e]);this._cached=null},sync:function(e){if(this._flushPending)return this._flushPending=!1,this._flush();for(var a=this,f=[],b=0;b<this._providers.length;++b)f.push(this._providers[b].get(this._name,e).then(function(e){return function(f){a._stores[e]=f}}(b)));return k.all(f).then(function(){a._cached=null;a._getCached()})},flush:function(){this._flush()}};b.prototype={get:function(e,a){if(this._currentPromises[e])return this._currentPromises[e];var f=new k,b=null;
a?this._cache.remove(e):b=this._cache.get(e);if(b!==null)f.resolve(b);else{this._currentPromises[e]=f;var c=this;this._service.get(e).then(function(a){c._cache.set(e,a);delete c._currentPromises[e];f.resolve(a)},function(a){a.status===404?(a={},c._cache.set(e,a),delete c._currentPromises[e],f.resolve(a)):(delete c._currentPromises[e],f.resolve(c._cache.get(e,!0)||{}))})}return f},put:function(a,f){this._cache.set(a,f);return this._service.put(a,f)}};a.prototype={get:function(a,f){if(this._currentPromise)return this._currentPromise;
var b=new k,c=null;f?this._cache.remove(a):c=this._cache.get(a);if(c!==null)b.resolve(c);else{this._currentPromise=b;var h=this;g("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(f){f=JSON.parse(f.response);h._cache.set(a,f[a]||{});h._currentPromise=null;b.resolve(f[a]||{})},function(f){f.xhr.status===401||f.xhr.status===404?(h._cache.set(a,{}),h._currentPromise=null,b.resolve({})):(h._currentPromise=null,f=h._cache.get(a,!0),f!==null?b.resolve(f[a]||{}):b.resolve({}))})}return b},
put:function(){var a=new k;a.resolve();return a}};h.prototype={get:function(a){var f=new k,a=this._cache.get(a);a!==null?f.resolve(a):f.resolve({});return f},put:function(a,f){var b=new k;this._cache.set(a,f);b.resolve();return b}};f.DEFAULT_SCOPE=1;f.LOCAL_SCOPE=2;f.USER_SCOPE=4;f.prototype={listenForChangedSettings:function(a,b,c){if(!b||typeof b!=="number"||b>7||b<1)c=b,b=f.DEFAULT_SCOPE|f.LOCAL_SCOPE|f.USER_SCOPE;window.addEventListener("storage",c,!1);if((f.USER_SCOPE&b)!==0)return"/orion/preferences/user"+
a;else if((f.LOCAL_SCOPE&b)!==0)return"/orion/preferences/local"+a;return"/orion/preferences/default"+a},getPreferences:function(a,b){if(!b||typeof b!=="number"||b>7||b<1)b=f.DEFAULT_SCOPE|f.LOCAL_SCOPE|f.USER_SCOPE;var c=[];f.USER_SCOPE&b&&this._userProvider.available()&&c.push(this._userProvider);f.LOCAL_SCOPE&b&&c.push(this._localProvider);f.DEFAULT_SCOPE&b&&c.push(this._defaultsProvider);var h=new d(a,c);return h.sync().then(function(){return h})},getSetting:function(a,f,b){for(var c,h=0;h<a.length;h++)if(a[h].label===
f)for(var d=0;d<a[h].data.length;d++)if(a[h].data[d].label===b){c=a[h].data[d].value;break}return c}};return{PreferencesService:f}});
(function(){function i(l){if(typeof l!=="string")throw new TypeError;}function k(l){return l?l.split("&"):[]}function g(l){return l.length===0?"":l.join("&")}function d(l){var a=/([^=]*)(?:=?)(.*)/.exec(l),l=a[1]?decodeURIComponent(a[1]):"",a=a[2]?decodeURIComponent(a[2]):"";return[l,a]}function c(l){var a=encodeURIComponent(l[0]);l[1]&&(a+="="+encodeURIComponent(l[1]));return a}function b(l,a){var e="",f=[],b=0;return{next:function(){if(e!==l.query)e=l.query,f=k(e);if(b<f.length){var j=d(f[b++]);
switch(a){case "keys":return j[0];case "values":return j[1];case "keys+values":return[j[0],j[1]];default:throw new TypeError;}}throw w;}}}function a(l){Object.defineProperty(this,"_url",{get:function(){return l._url}})}function h(l){var a=[];l.split("/").forEach(function(l){l===".."?a.pop():l!=="."&&a.push(l)});return a.join("/")}function f(l){return l.replace(/\s/g,function(l){return"%"+l.charCodeAt(0).toString(16)})}function e(l,a){if(typeof l!=="string")throw new TypeError;var l=f(l),e=o.exec(l);
if(!e)return null;var b={};b.scheme=e[1]||"";if(b.scheme&&!p.test(b.scheme))return null;var j=e[2];if(j&&(j=n.exec(j),b.userinfo=j[1],b.host=j[2],b.port=j[3],b.port&&!s.test(b.port)))return null;b.path=e[3];b.query=e[4];b.fragment=e[5];if(!b.scheme&&a&&(b.scheme=a.scheme,!b.host&&a.host))b.userinfo=a.userinfo,b.host=a.host,b.port=a.port,b.pathRelative=!0;if(b.pathRelative)if(b.path){if(b.path[0]!=="/")e=/^(.*\/)[^\/]*$/.exec(a.path)[1]||"/",b.path=e+b.path}else b.path=a.path;if(b.scheme)b.scheme=
b.scheme.toLowerCase();if(b.port)b.port=/[1-9]\d*$/.exec(b.port)[0];if(b.host&&b.path)b.path=h(b.path);return b}function j(l,b){var f;if(b){b=b.href||b;f=e(b);if(!f||!f.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:f})}f=e(l,f);if(!f)throw new SyntaxError;Object.defineProperty(this,"_input",{value:l,writable:!0});Object.defineProperty(this,"_url",{value:f,writable:!0});var j=new a(this);Object.defineProperty(this,"query",{get:function(){return this._url?j:null},enumerable:!0})}
try{if(typeof window.URL==="function"&&window.URL.length!==0&&(new window.URL("http://www.w3.org")).protocol==="http:")return}catch(m){}var o=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,n=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,p=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,s=/^\d*$/,q=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,r=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,t=/^([^?#\s]*)$/,l=/^([^\s]*)$/,u=/^\S*$/,y=/([^:]*):?(.*)/,w=typeof StopIteration!=="undefined"?StopIteration:
Error("Stop Iteration"),v={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(a.prototype,{get:{value:function(l){i(l);var a;k(this._url.query).some(function(e){e=d(e);if(e[0]===l)return a=e[1],!0});return a},enumerable:!0},set:{value:function(l,a){i(l);i(a);var e=k(this._url.query);e.some(function(b,f){var j=d(b);if(j[0]===l)return j[1]=a,e[f]=c(j),!0})||e.push(c([l,a]));this._url.query=g(e)},enumerable:!0},has:{value:function(l){i(l);return k(this._url.query).some(function(a){if(d(a)[0]===
l)return!0})},enumerable:!0},"delete":{value:function(l){i(l);var a=k(this._url.query),e=a.filter(function(a){return d(a)[0]!==l});return e.length!==a.length?(this._url.query=g(e),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(l,a){if(typeof l!=="function")throw new TypeError;var e=b(this._url,"keys+values");try{for(;;){var f=e.next();l.call(a,f[1],f[0],this)}}catch(j){if(j!==w)throw j;}},enumerable:!0},keys:{value:function(){return b(this._url,
"keys")},enumerable:!0},values:{value:function(){return b(this._url,"values")},enumerable:!0},items:{value:function(){return b(this._url,"keys+values")}},size:{get:function(){return k(this._url.query).length},enumerable:!0},getAll:{value:function(l){i(l);var a=[];k(this._url.query).forEach(function(e){e=d(e);e[0]===l&&a.push(e[1])});return a},enumerable:!0},append:{value:function(l,a){i(l);i(a);var e=k(this._url.query);e.push(c([l,a]));this._url.query=g(e)},enumerable:!0}});Object.defineProperties(j.prototype,
{href:{get:function(){var l;if(this._url){l=this._url;var a=l.scheme?l.scheme+":":"";l.host&&(a+="//",l.userinfo&&(a+=l.userinfo+"@"),a+=l.host,l.port&&(a+=":"+l.port));a+=l.path;l.query&&(a+="?"+l.query);l.fragment&&(a+="#"+l.fragment);l=a}else l=this._input;return l},set:function(l){i(l);this._input=l;this._url=e(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(l){i(l);if(this._url&&(l=l.slice(-1)===":"?l.substring(0,l.length-1):l,p.test(l)))this._url.scheme=l.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(l){i(l);if(this._url)this._url.userinfo=l}},username:{get:function(){if(!this._url)return"";var l=y.exec(this._userinfo);return decodeURIComponent(l[1]||"")},set:function(l){i(l);if(this._url){var a=y.exec(this._userinfo),l=[encodeURIComponent(l||"")];
a[2]&&l.push(a[2]);this._userinfo=l.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var l=y.exec(this._userinfo);return decodeURIComponent(l[2]||"")},set:function(l){i(l);if(this._url){var a=[y.exec(this._userinfo)[1]||""];l&&a.push(encodeURIComponent(l));this._userinfo=a.join(":")}},enumerable:!0},host:{get:function(){var l="";this._url&&this._url.host&&(l+=this._url.host,this._url.port&&(l+=":"+this._url.port));return l},set:function(l){i(l);if(this._url&&(l=r.exec(l)))this._url.host=
l[1],this._url.port=/[1-9]\d*$/.exec(l[2])[0]},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(l){i(l);if(this._url&&q.exec(l))this._url.host=l},enumerable:!0},port:{get:function(){var l=this._url?this._url.port||"":"";l&&l===v[this.protocol]&&(l="");return l},set:function(l){i(l);if(this._url&&s.exec(l))this._url.port=/[1-9]\d*$/.exec(l)[0]},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(l){i(l);if(this._url&&t.exec(l))this._url.host&&
l&&l[0]!=="/"&&(l="/"+l),this._url.path=l?h(l):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){i(a);if(this._url&&(a&&a[0]==="?"&&(a=a.substring(1)),l.exec(a)))this._url.query=a},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(l){i(l);if(this._url&&(l&&l[0]==="#"&&(l=l.substring(1)),u.exec(l)))this._url.fragment=l},enumerable:!0}});window.URL&&window.URL.createObjectURL&&
(Object.defineProperty(j,"createObjectURL",{value:window.URL.createObjectURL.bind(window.URL),enumerable:!1}),Object.defineProperty(j,"revokeObjectURL",{value:window.URL.revokeObjectURL.bind(window.URL),enumerable:!1}));window.URL=j})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(i,k){function g(a,e){var b=Object.keys(a),c=Object.keys(e);if(b.length!==c.length)return!1;b.sort();c.sort();for(var h=0,d=b.length;h<d;h++){var p=b[h];if(p!==c[h])return!1;var s=a[p],p=e[p];if(s!==p&&JSON.stringify(s)!==JSON.stringify(p))return!1}return!0}function d(a){if(a.indexOf("://")===-1)try{return(new URL(a,location.href)).href}catch(e){}return a}function c(a){var e=null;return{key:function(b){return(e=
e||Object.keys(a))[b]},getItem:function(e){return a[e]},setItem:function(b,c){a[b]=c;e=null},removeItem:function(b){delete a[b];e=null},clear:function(){(e=e||Object.keys(a)).forEach(function(e){delete a[e]}.bind(this));e=null}}}function b(a,e){return{type:a,plugin:e}}function a(a,e,j){function c(l,a,e){if(!D)return(new i).reject(Error("plugin not connected"));var b=G++,f=new i;f.then(null,function(l){v==="active"&&l instanceof Error&&l.name==="Cancel"&&j.postMessage({id:b,cancel:l.message||"Cancel"},
D)});L[String(b)]=f;j.postMessage({id:b,serviceId:l,method:a,params:e},D);return f.promise}function h(l){var a={};if(l.methods&&(l.methods.forEach(function(e){a[e]=function(){var a=Array.prototype.slice.call(arguments);return v==="active"?c(l.serviceId,e,a):r.start({"transient":!0}).then(function(){return c(l.serviceId,e,a)})}}),a.addEventListener&&a.removeEventListener)){var e=new k;a.dispatchEvent=e.dispatchEvent.bind(e);var b=a.addEventListener;a.addEventListener=function(l,a){e._namedListeners[l]||
b(l);e.addEventListener(l,a)};var f=a.removeEventListener;a.removeEventListener=function(l,a){e.removeEventListener(l,a);e._namedListeners[l]&&f(l)}}return a}function d(l){var e=JSON.parse(JSON.stringify(l.properties));e.__plugin__=a;l=l.names||l.type||[];Array.isArray(l)||(l=[l]);e.objectClass=l;return e}function p(l){var a=h(l),e=d(l),e=j.registerService(l.names||l.type,a,e);z[l.serviceId]={registration:e,proxy:a}}function s(){j.persist(a,{created:t,headers:l,services:u,autostart:y,lastModified:w})}
function q(l){var a;try{if(l.method)if("manifest"===l.method||"plugin"===l.method){var e=l.params[0];H({headers:e.headers,services:e.services}).then(function(){E.resolve(r)})}else if("dispatchEvent"===l.method){var b=z[l.serviceId].proxy;b.dispatchEvent.apply(b,l.params)}else if("progress"===l.method)a=L[String(l.requestId)],a.progress.apply(a,l.params);else if("timeout"===l.method)E&&E.reject(l.error);else throw Error("Bad response method: "+l.method);else if(a=L[String(l.id)],delete L[String(l.id)],
l.error){var f=j.handleServiceError(r,l.error);a.reject(f)}else a.resolve(l.result)}catch(c){console.log("Plugin._responseHandler "+c)}}var r=this,e=e||{},t=e.created||(new Date).getTime(),l=e.headers||{},u=e.services||[],y=e.autostart,w=e.lastModified||0,v="installed",A,E,D,z={},G=0,L={},H;this._persist=s;this._resolve=function(){v="resolved";j.dispatchEvent(new b("resolved",r))};this._getAutostart=function(){return y};this._getCreated=function(){return t};this.getLocation=function(){return a};this.getHeaders=
function(){return JSON.parse(JSON.stringify(l))};this.getName=function(){var l=this.getHeaders();return l?l.name||"":null};this.getVersion=function(){var l=this.getHeaders();return l?l.version||"0.0.0":null};this.getLastModified=function(){return w};this.getServiceReferences=function(){var l=[];Object.keys(z).forEach(function(a){l.push(z[a].registration.getReference())});return l};this.getState=function(){return v};this.start=function(l){if(v==="uninstalled")return(new i).reject(Error("Plugin is uninstalled"));
if(A)return A.promise.then(this.start.bind(this,l));if(v==="active")return(new i).resolve();if(!l||!l["transient"]){var e=l&&l.lazy?"lazy":"started";e!==y&&(y=e,s())}e=j.getState();if(e!=="starting"&&e!=="active")return l["transient"]?(new i).reject(Error("start transient error")):(new i).resolve();if(v==="installed")try{this._resolve()}catch(c){return(new i).reject(c)}v==="resolved"&&u.forEach(function(l){p(l)});if(l&&l.lazy)return v!=="starting"&&(v="starting",j.dispatchEvent(new b("lazy activation",
r))),(new i).resolve();var h=new i;A=h;v="starting";j.dispatchEvent(new b("starting",r));E=new i;D=j.connect(a,q);E.then(function(){E=null;v="active";j.dispatchEvent(new b("started",r));A=null;h.resolve()},function(){E=null;v="stopping";j.dispatchEvent(new b("stopping",r));Object.keys(z).forEach(function(l){z[l].registration.unregister();delete z[l]});j.disconnect(D);D=null;v="resolved";A=null;j.dispatchEvent(new b("stopped",r));h.reject(Error("plugin activation error"))});return h.promise};this.stop=
function(l){if(v==="uninstalled")return(new i).reject(Error("Plugin is uninstalled"));if(A)return A.promise.then(this.stop.bind(this,l));if((!l||!l["transient"])&&"stopped"!==y)y="stopped",s();if(v!=="active"&&v!=="starting")return(new i).resolve();A=l=new i;v="stopping";j.dispatchEvent(new b("stopping",r));Object.keys(z).forEach(function(l){z[l].registration.unregister();delete z[l]});D&&(j.disconnect(D),D=null);v="resolved";A=null;j.dispatchEvent(new b("stopped",r));l.resolve();return l.promise};
H=function(e){if(v==="uninstalled")return(new i).reject(Error("Plugin is uninstalled"));if(!e)return w===0&&(w=(new Date).getTime(),s()),j.loadManifest(a).then(H);var c=l,h=u,m=y;l=e.headers||{};u=e.services||{};y=e.autostart||y;e.lastModified?w=e.lastModified:(w=(new Date).getTime(),s());if(g(l,c)&&g(u,h)&&y===m)return(new i).resolve();if(v==="active"||v==="starting"){var o=[];Object.keys(u).forEach(function(l){var a=u[l];o.push(l);var e=z[l];if(e){if(g(a.methods,Object.keys(e.proxy))){var l=d(a),
b=e.registration.getReference(),f={};b.getPropertyKeys().forEach(function(l){f[l]=b.getProperty(l)});g(l,f)||e.registration.setProperties(l);return}e.registration.unregister();delete z[l]}p(a)});Object.keys(z).forEach(function(l){o.indexOf(l)===-1&&(z[l].registration.unregister(),delete z[l])})}v==="active"&&(j.disconnect(D),E=new i,D=j.connect(a,q),E.then(function(){E=null},function(){E=null;v="stopping";j.dispatchEvent(new b("stopping"),r);Object.keys(z).forEach(function(l){z[l].registration.unregister();
delete z[l]});j.disconnect(D);D=null;v="resolved";j.dispatchEvent(new b("stopped",r))}));return(new i).resolve()};this.update=function(l){return H(l).then(function(){j.dispatchEvent(new b("updated",r))})};this.uninstall=function(){if(v==="uninstalled")return(new i).reject(Error("Plugin is uninstalled"));if(v==="active"||v==="starting"||v==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));j.removePlugin(this);v="uninstalled";j.dispatchEvent(new b("uninstalled",
r));return(new i).resolve()}}var h=/^http[s]?/i;return{Plugin:a,PluginRegistry:function(f,e){function j(a){var l=a.source;p.some(function(e){if(l===e.target){if(typeof e.useStructuredClone==="undefined")e.useStructuredClone=typeof a.data!=="string";e.handler(e.useStructuredClone?a.data:JSON.parse(a.data));return!0}})}var e=e||{},m=e.storage||localStorage;m.getItem||(m=c(m));var o="installed",n=[],p=[],s=new k,g={},r={registerService:f.registerService.bind(f),connect:function(a,l,b){function f(a){a=
Error(a);a.name="timeout";l({method:"timeout",error:a})}var j={handler:l,url:a},c=setTimeout(f.bind(null,"Load timeout for: "+a),b||15E3),h=document.createElement("iframe");h.name=a+"_"+(new Date).getTime();if(!e.visible)h.style.display="none",h.style.visibility="hidden";h.src=a;h.onload=function(){clearTimeout(c);setTimeout(f.bind(null,"Plugin handshake timeout for: "+a),5E3)};h.sandbox="allow-scripts allow-same-origin";document.body.appendChild(h);j.target=h.contentWindow;j.close=function(){h&&
(document.body.removeChild(h),h=null)};p.push(j);return j},disconnect:function(a){for(var l=0;l<p.length;l++)if(a===p[l]){p.splice(l,1);try{a.close()}catch(e){}break}},removePlugin:function(a){for(var l=0;l<n.length;l++)if(a===n[l]){n.splice(l,1);break}m.removeItem("plugin."+a.getLocation())},persist:function(a,l){m.setItem("plugin."+a,JSON.stringify(l))},postMessage:function(a,l){l.target.postMessage(l.useStructuredClone?a:JSON.stringify(a),l.url)},dispatchEvent:function(a){try{s.dispatchEvent(a)}catch(l){console&&
console.log("PluginRegistry.dispatchEvent "+l)}},loadManifest:function(a){var l=new i,e=r.connect(a,function(a){e&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],r.disconnect(e),e=null,l.resolve(a)):"timeout"===a.method&&(r.disconnect(e),e=null,l.reject(a.error)))});return l.promise},getState:function(){return o},handleServiceError:function(a,l){if(l&&l.status===401){var e=a.getHeaders(),b=a.getName()||a.getLocation(),f=document.createElement("span");f.appendChild(document.createTextNode("Authentication required for: "+
b+"."));if(e.login)f.appendChild(document.createTextNode(" ")),b=document.createElement("a"),b.target="_blank",b.textContent="Login",b.href=e.login,h.test(b.href)?(f.appendChild(b),f.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+e.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(f)}}if(l.__isError){var j=l,l=Error(j.message);Object.keys(j).forEach(function(a){l[a]=j[a]});delete l.__isError}return l}};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=r.getState;this.init=function(){if(!(o==="starting"||o==="active"||o==="stopping")){addEventListener("message",j,!1);for(var b=[],l=0,f=m.length;l<f;l++)b.push(m.key(l));b.forEach(function(l){if(l.indexOf("plugin.")===0){var e=l.substring(7),l=JSON.parse(m.getItem(l));l.created&&n.push(new a(e,l,r))}});
n.sort(function(l,a){return l._getCreated()<a._getCreated()?-1:1});e.plugins&&Object.keys(e.plugins).forEach(function(l){l=d(l);if(!this.getPlugin(l)){var b=e.plugins[l],b=typeof b==="object"||{};b.autostart=b.autostart||e.defaultAutostart||"lazy";n.push(new a(l,b,r))}}.bind(this));o="starting"}};this.start=function(){o!=="starting"&&this.init();if(o!=="starting")return(new i).reject("Cannot start framework. Framework is already "+o+".");var a=[],l=(new Date).getTime();n.forEach(function(e){var b=
e._getAutostart();e.getLastModified()===0?a.push(e.update().then(function(){if("started"===b)return e.start({"transient":!0});if("lazy"===b)return e.start({lazy:!0,"transient":!0});e._resolve()})):"started"===b?a.push(e.start({"transient":!0})):"lazy"===b?(a.push(e.start({lazy:!0,"transient":!0})),l>e.getLastModified()+864E5&&e.update()):e._resolve()});return i.all(a,function(l){console.log("PluginRegistry.stop "+l)}).then(function(){o="active"})};this.stop=function(){if(o!=="starting"&&o!=="active")return(new i).reject("Cannot stop registry. Registry is already "+
o+".");o="stopping";var a=[];n.forEach(function(l){a.push(l.stop({"transient":!0}))});return i.all(a,function(l){console.log("PluginRegistry.stop "+l)}).then(function(){removeEventListener("message",j);o="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new i).reject("Cannot uninstall registry")};this.installPlugin=function(e,l){var e=d(e),f=this.getPlugin(e);if(f)return(new i).resolve(f);if(g[e])return g[e];if(l)return f=new a(e,l,r),n.push(f),
f._persist(),r.dispatchEvent(new b("installed",f)),(new i).resolve(f);var j=r.loadManifest(e).then(function(l){f=new a(e,l,r);n.push(f);f._persist();delete g[e];r.dispatchEvent(new b("installed",f));return f},function(l){delete g[e];throw l;});return g[e]=j};this.getPlugins=function(){return n.slice()};this.getPlugin=function(a){var l=null,a=d(a);n.some(function(e){if(a===e.getLocation())return l=e,!0});return l};this.addEventListener=s.addEventListener.bind(s);this.removeEventListener=s.removeEventListener.bind(s);
this.resolvePlugins=function(){var a=!0;n.forEach(function(l){a=a&&l._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function i(d,c){function b(a){var e=a.getProperty("service.id"),b=this.addingService(a);b&&(h[e]=a,f[e]=b)}function a(a){var e=a.getProperty("service.id"),b=f[e];delete h[e];delete f[e];this.removedService(a,b)}this.serviceRegistry=d;var h={},f={},e=k,j,m;this.close=function(){if(e!==g)throw"Already closed";e=k;d.removeEventListener("registered",j);d.removeEventListener("unregistering",m);m=j=null;var b=this;this.getServiceReferences().forEach(function(e){a.call(b,
e)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){return h.length?Object.keys(h).map(function(a){return h[a]}):null};this.open=function(){if(e!==k)throw"Already open";e=g;var f=this;j=function(a){if(a.serviceReference.getProperty("objectClass").indexOf(c)!==-1&&(b.call(f,a.serviceReference),typeof f.onServiceAdded==="function"))return f.onServiceAdded(a.serviceReference,f.serviceRegistry.getService(a.serviceReference))};m=function(e){e.serviceReference.getProperty("objectClass").indexOf(c)!==
-1&&a.call(f,e.serviceReference)};d.addEventListener("registered",j);d.addEventListener("unregistering",m);d.getServiceReferences(c).forEach(function(a){b.call(f,a)});if(typeof this.onOpen==="function")this.onOpen()}}var k=0,g=1;i.prototype={addingService:function(d){return this.serviceRegistry.getService(d)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return i});
define("orion/config",["orion/Deferred","orion/serviceTracker"],function(i,k){var g,d,c,b,a,h="pid";g=function(a,b,f){function c(a,e,f){e.forEach(function(l,c){try{var h=a[c].getProperty("__plugin__"),d=h&&b.getPlugin(h);(!h||d&&d.getState()==="active")&&e[c].updated(f)}catch(m){typeof console!=="undefined"&&console.log(m)}})}k.call(this,a,"orion.cm.managedservice");var d={},p={},s=function(b){var j=[];b.plugin.getServiceReferences().forEach(function(b){if(b.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var l=b.getProperty(h),b=a.getService(b);l&&b&&(l=(l=f._find(l))&&l.getProperties(),j.push(b.updated(l)))}});return i.all(j)};this.addingService=function(b){var f=b.getProperty(h),j=a.getService(b);if(!f||!j)return null;d[f]||(d[f]=[]);p[f]||(p[f]=[]);d[f].push(b);p[f].push(j);return j};this.onServiceAdded=function(a,e){var b=a.getProperty(h),b=f._find(b);c([a],[e],b&&b.getProperties())};this.onOpen=function(){b.addEventListener("started",s)};this.onClose=function(){b.removeEventListener("started",
s)};this.notifyUpdated=function(a){var e=a.getPid();c(d[e]||[],p[e]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();c(d[a]||[],p[a]||[],null)};this.removedService=function(a,e){var b=a.getProperty(h),l=d[b],f=p[b];l.length>1?l.splice(l.indexOf(a),1):delete d[b];f.length>1?f.splice(f.indexOf(e),1):delete p[b]}};d=function(){function a(e,f,h){this.store=new c(this,h);this.configAdmin=new b(this,this.store);this.tracker=new g(e,f,this.store)}a.prototype={getConfigurationAdmin:function(){var a=
this;return this.configAdmin._init().then(function(e){a.tracker.open();return e})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();b=function(){function a(e,b){this.factory=e;this.store=b}a.prototype={_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},listConfigurations:function(){return this.store.list()}};return a}();var f="/cm/configurations";
c=function(){function e(e,b){this.factory=e;this.prefsService=b;this.configs=Object.create(null);this.pref=null;var c=this;this.initPromise=this.prefsService.getPreferences(f).then(function(e){c.pref=e;e.keys().forEach(function(b){if(!c.configs[b]){var f=e.get(b);typeof f==="object"&&f!==null&&Object.keys(f).length>0&&(f[h]=b,c.configs[b]=new a(c.factory,c,f))}})})}e.prototype={_init:function(){return this.initPromise},_find:function(a){return this.configs[a]||null},get:function(e){var b=this._find(e);
b||(b=new a(this.factory,this,e),this.configs[e]=b);return b},list:function(){var a=this,e=[];this.pref.keys().forEach(function(b){(b=a._find(b))&&b.getProperties()!==null&&e.push(b)});return e},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,e){this.pref.put(a,e.getProperties(!0)||{})}};return e}();a=function(){function a(e){for(var b={},f=Object.keys(e),c=0;c<f.length;c++){var j=f[c],h=e[j];b[j]=h instanceof Array?h.slice():h}return b}function b(f,c,j){this.factory=
f;this.store=c;if(j!==null&&typeof j==="object")this.pid=j[h],f=a(j),delete f[h],this.properties=f;else if(typeof j==="string")this.pid=j,this.properties=null;else throw Error("Invalid pid/properties "+j);}b.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(b){this._checkRemoved();var f=null;if(this.properties&&(f=a(this.properties),!b))f[h]=this.pid;return f},remove:function(){this._checkRemoved();
this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=!0},update:function(b){this._checkRemoved();b=a(b);delete b[h];this.properties=b;this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return b}();return{ConfigurationAdminFactory:d}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(i,k,g,d,c,b){var a;return{startup:function(){if(a)return a;a=new k;var h=new g.ServiceRegistry,f=new d.PreferencesService(h);return f.getPreferences("/plugins").then(function(e){var j={plugins:{}};e.keys().forEach(function(a){var b=i.toUrl(a);j.plugins[b]=e[a]});var d=new c.PluginRegistry(h,j);return d.start().then(function(){if(h.getServiceReferences("orion.core.preference.provider").length>
0)return f.getPreferences("/plugins",f.USER_SCOPE).then(function(a){var e=[];a.keys().forEach(function(a){a=i.toUrl(a);d.getPlugin(a)||e.push(d.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return k.all(e,function(a){console.log(a)})})}).then(function(){return(new b.ConfigurationAdminFactory(h,d,f)).getConfigurationAdmin().then(h.registerService.bind(h,"orion.cm.configadmin"))}).then(function(){var a=h.getService("orion.core.auth");
if(a){var e=a.getUser().then(function(e){if(e)localStorage.setItem("lastLogin",(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),b=localStorage.getItem("lastLogin");if(!b||b<(new Date).getTime()-9E5)return e}}).then(function(){var e={serviceRegistry:h,preferences:f,pluginRegistry:d};a.resolve(e);return e})})}}});
define("orion/webui/littlelib",[],function(){function i(a,b){b||(b=document);return b.querySelectorAll(a)}function k(a,b){var e=a.compareDocumentPosition(b);return a===b||Boolean(e&16)}function g(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var b=0;b<a.childNodes.length;b++){var e=g(a.childNodes[b]);if(e)return e}return null}function d(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var b=a.childNodes.length-1;b>=0;b--){var e=d(a.childNodes[b]);if(e)return e}return null}function c(a,
f){if(a.nodeType===3){var e=b.exec(a.nodeValue);e&&e.length>1&&f(a,e)}if(a.hasChildNodes())for(e=0;e<a.childNodes.length;e++)c(a.childNodes[e],f)}var b=/\$\{([^\}]+)\}/,a=[];return{$:function(a,b){b||(b=document);return b.querySelector(a)},$$:i,$$array:function(a,b){return Array.prototype.slice.call(i(a,b))},node:function(a){var b=a;typeof a==="string"&&(b=document.getElementById(a));return b},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:g,lastTabbable:d,stop:function(a){window.document.all?a.keyCode=0:(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,b){c(a,function(a,c){a.parentNode.replaceChild(document.createTextNode(b[c[1]]||c[1]),a)})},processDOMNodes:function(a,b){c(a,function(a,c){var h=b[c[1]];if(h){var d=document.createRange(),n=c.index;d.setStart(a,n);d.setEnd(a,
n+c[0].length);d.deleteContents();d.insertNode(h)}})},addAutoDismiss:function(b,f){a.length===0&&document.addEventListener("click",function(e){for(var b=[],f=0;f<a.length;f++){var c=a[f].dismiss,h=!1,d;if(a[f].excludeNodes.every(function(a){return a&&(h=document.compareDocumentPosition(document,a)!==1)&&k(a,e.target)?(d=a,!1):!0})){try{c()}catch(s){typeof console!=="undefined"&&console&&console.error(s&&s.message)}h=document.compareDocumentPosition(document,d)!==1}h&&b.push(a[f])}a=b},!0);a.push({excludeNodes:b,
dismiss:f})},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}}});
(function(){function i(c,b,a,h,f,e){b[c]&&(a.push(c),(b[c]===!0||b[c]===1)&&h.push(f+c+"/"+e))}function k(c,b,a,h,f){b=h+b+"/"+f;require._fileExists(c.toUrl(b+".js"))&&a.push(b)}function g(c,b,a){for(var h in b)b.hasOwnProperty(h)&&(!c.hasOwnProperty(h)||a)?c[h]=b[h]:typeof b[h]==="object"&&g(c[h],b[h],a)}var d=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(c){var b=c.config?c.config():{};return{version:"2.0.1+",load:function(a,c,f,e){e=e||{};if(e.locale)b.locale=e.locale;
var j=d.exec(a),m=j[1],o=j[4],n=j[5],p=o.split("-"),s=[],q={},r,t="";if(j[5])m=j[1],a=m+n;else{n=j[4];o=b.locale;if(!o)o=b.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();p=o.split("-")}if(e.isBuild){s.push(a);k(c,"root",s,m,n);for(r=0;r<p.length;r++)e=p[r],t+=(t?"-":"")+e,k(c,t,s,m,n);c(s,function(){f()})}else c([a],function(l){var a=[],e;i("root",l,a,s,m,n);for(r=0;r<p.length;r++)e=p[r],t+=(t?"-":"")+e,i(t,l,a,s,m,n);c(s,function(){var e,
b,j;for(e=a.length-1;e>-1&&a[e];e--){j=a[e];b=l[j];if(b===!0||b===1)b=c(m+j+"/"+n);g(q,b)}f(q)})})}}})})();
define("orion/i18n",[],function(){return{load:function(i,k,g,d){var d=d||{},c=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,b=c.exec(i);if(b)if(k.defined(i))g(k(i));else if(d.isBuild||d.isTest)g({});else{var a=b[1],h=b[3]?b[2]:"",f=b[3]||b[2];k(["orion/bootstrap"],function(e){e.startup().then(function(e){var m=e.serviceRegistry,e=m.getServiceReferences("orion.i18n.message");if(h)e.some(function(a){return i===a.getProperty("name")?(m.getService(a).getMessageBundle().then(function(a){g(a)},function(){g({})}),
!0):!1})||g({});else{var o={},n;e.forEach(function(e){var j=e.getProperty("name");if((b=c.exec(j))&&a===b[1]&&f===(b[3]||b[2]))if(h=b[3]?b[2]:""){if((e=d.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&e.toLowerCase().indexOf(h.toLowerCase())===0)o[h]=!0,k.specified(j)||define(j,["orion/i18n!"+j],function(a){return a})}else n=e});k.specified(i)?g(o):n?m.getService(n).getMessageBundle().then(function(a){Object.keys(o).forEach(function(e){typeof a[e]==="undefined"&&
(a[e]=o[e])});define(i,[],a);g(a)},function(){define(i,[],o);g(o)}):(define(i,[],o),g(o))}})})}else g(null)}}});
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(i,k){var g={root:k};Object.keys(i).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=i[d])});return g});
define("text",["module"],function(i){var k,g,d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],c=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,b=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,a=typeof location!=="undefined"&&location.href,h=a&&location.protocol&&location.protocol.replace(/\:/,""),f=a&&location.hostname,e=a&&(location.port||void 0),j=[],m=i.config&&i.config()||{};k={version:"2.0.5",strip:function(a){if(a){var a=a.replace(c,""),e=a.match(b);e&&(a=e[1])}else a="";return a},
jsEscape:function(a){return a.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:m.createXhr||function(){var a,e,b;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(e=0;e<3;e+=1){b=d[e];try{a=new ActiveXObject(b)}catch(f){}if(a){d=[b];break}}return a},parseName:function(a){var e,
b,f=!1,c=a.indexOf(".");e=a.indexOf("./")===0||a.indexOf("../")===0;c!==-1&&(!e||c>1)?(e=a.substring(0,c),b=a.substring(c+1,a.length)):e=a;a=b||e;c=a.indexOf("!");c!==-1&&(f=a.substring(c+1)==="strip",a=a.substring(0,c),b?b=a:e=a);return{moduleName:e,ext:b,strip:f}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,e,b,f){var c,j;c=k.xdRegExp.exec(a);if(!c)return!0;a=c[2];c=c[3];c=c.split(":");j=c[1];c=c[0];return(!a||a===e)&&(!c||c.toLowerCase()===b.toLowerCase())&&(!j&&!c||j===f)},finishLoad:function(a,
e,b,f){b=e?k.strip(b):b;m.isBuild&&(j[a]=b);f(b)},load:function(b,c,j,d){if(d.isBuild&&!d.inlineText)j();else{m.isBuild=d.isBuild;var g=k.parseName(b),d=g.moduleName+(g.ext?"."+g.ext:""),i=c.toUrl(d),t=m.useXhr||k.useXhr;!a||t(i,h,f,e)?k.get(i,function(a){k.finishLoad(b,g.strip,a,j)},function(a){j.error&&j.error(a)}):c([d],function(a){k.finishLoad(g.moduleName+"."+g.ext,g.strip,a,j)})}},write:function(a,e,b){if(j.hasOwnProperty(e)){var f=k.jsEscape(j[e]);b.asModule(a+"!"+e,"define(function () { return '"+
f+"';});\n")}},writeFile:function(a,e,b,f,c){var e=k.parseName(e),j=e.ext?"."+e.ext:"",h=e.moduleName+j,l=b.toUrl(e.moduleName+j)+".js";k.load(h,b,function(){var e=function(a){return f(l,a)};e.asModule=function(a,e){return f.asModule(a,l,e)};k.write(a,h,e,c)},c)}};if(m.env==="node"||!m.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)g=require.nodeRequire("fs"),k.get=function(a,e){var b=g.readFileSync(a,"utf8");b.indexOf("\ufeff")===0&&(b=b.substring(1));e(b)};else if(m.env===
"xhr"||!m.env&&k.createXhr())k.get=function(a,e,b,f){var c=k.createXhr(),j;c.open("GET",a,!0);if(f)for(j in f)f.hasOwnProperty(j)&&c.setRequestHeader(j.toLowerCase(),f[j]);if(m.onXhr)m.onXhr(c,a);c.onreadystatechange=function(){var f;if(c.readyState===4)f=c.status,f>399&&f<600?(f=Error(a+" HTTP status: "+f),f.xhr=c,b(f)):e(c.responseText)};c.send(null)};else if(m.env==="rhino"||!m.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")k.get=function(a,e){var b,f,c=new java.io.File(a),j=java.lang.System.getProperty("line.separator"),
c=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(c),"utf-8")),h="";try{b=new java.lang.StringBuffer;(f=c.readLine())&&f.length()&&f.charAt(0)===65279&&(f=f.substring(1));for(b.append(f);(f=c.readLine())!==null;)b.append(j),b.append(f);h=String(b.toString())}finally{c.close()}e(h)};return k});define("text!orion/banner/slideout.html",[],function(){return'<div id="slideContainer" class="slideParameters slideContainer">\n\t<span id="pageCommandParameters" class="layoutLeft parameters"></span>\n\t<span id="pageCommandDismiss" class="layoutRight parametersDismiss"></span>\n</div>'});
define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(i,k,g){return{slideoutHTMLFragment:function(d){var c=document.createElement("div");c.innerHTML=g;var b=k.$("#slideContainer",c);b.id=d+b.id;b=k.$("#pageCommandParameters",c);b.id=d+b.id;b=k.$("#pageCommandDismiss",c);b.id=d+b.id;return c.innerHTML}}});
define("orion/util",[],function(){var i=navigator.userAgent,k=parseFloat(i.split("MSIE")[1])||void 0,g=parseFloat(i.split("Firefox/")[1]||i.split("Minefield/")[1])||void 0,d=i.indexOf("Opera")!==-1,c=parseFloat(i.split("Chrome/")[1])||void 0,b=i.indexOf("Safari")!==-1&&!c,a=parseFloat(i.split("WebKit/")[1])||void 0,h=i.indexOf("Android")!==-1,f=i.indexOf("iPad")!==-1,i=i.indexOf("iPhone")!==-1,e=f||i,j=navigator.platform.indexOf("Mac")!==-1,m=navigator.platform.indexOf("Win")!==-1,o=navigator.platform.indexOf("Linux")!==
-1;return{formatMessage:function(a){var e=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,b){return e[(b<<0)+1]})},createElement:function(a,e){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",e):a.createElement(e)},isIE:k,isFirefox:g,isOpera:d,isChrome:c,isSafari:b,isWebkit:a,isAndroid:h,isIPad:f,isIPhone:i,isIOS:e,isMac:j,isWindows:m,isLinux:o,platformDelimiter:m?"\r\n":"\n"}});
define("orion/keyBinding",["orion/util"],function(i){function k(d,c,b,a,h,f){this.type=f||"keydown";this.keyCode=typeof d==="string"&&this.type==="keydown"?d.toUpperCase().charCodeAt(0):d;this.mod1=c!==void 0&&c!==null?c:!1;this.mod2=b!==void 0&&b!==null?b:!1;this.mod3=a!==void 0&&a!==null?a:!1;this.mod4=h!==void 0&&h!==null?h:!1}function g(d){this.keys=d}k.prototype={getKeys:function(){return[this]},match:function(d,c){if(c!==void 0){if(c!==0)return!1}else if(d instanceof Array){if(d.length>1)return!1;
d=d[0]}return d.type!==this.type?!1:this.keyCode===d.keyCode||this.keyCode===String.fromCharCode(i.isOpera?d.which:d.charCode!==void 0?d.charCode:d.keyCode)?this.mod1!==(i.isMac?d.metaKey:d.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==d.shiftKey?!1:this.mod3!==d.altKey?!1:i.isMac&&this.mod4!==d.ctrlKey?!1:!0:!1},equals:function(d){return!d?!1:this.keyCode!==d.keyCode?!1:this.mod1!==d.mod1?!1:this.mod2!==d.mod2?!1:this.mod3!==d.mod3?!1:this.mod4!==d.mod4?!1:this.type!==d.type?!1:!0}};g.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(d,c){var b=this.keys;if(c!==void 0)return c>b.length?!1:b[c].match(d)?c===b.length-1?!0:c+1:!1;else{d instanceof Array||(d=[d]);if(d.length>b.length)return!1;var a;for(a=0;a<d.length;a++)if(!b[a].match(d[a]))return!1;return a===b.length?!0:a}},equals:function(d){if(!d.keys)return!1;if(d.keys.length!==this.keys.length)return!1;for(var c=0;c<d.keys.length;c++)if(!d.keys[c].equals(this.keys[c]))return!1;return!0}};return{KeyBinding:k,KeyStroke:k,
KeySequence:g}});
define("orion/webui/dropdown",["require","orion/webui/littlelib"],function(i,k){function g(d){this._init(d)}g.prototype={_init:function(d){this._dropdownNode=k.node(d.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=d.populate;var c=this;this._triggerNode.addEventListener("click",function(b){c.toggle()&&k.stop(b)},!1);this._triggerNode.tagName.toLowerCase()===
"span"&&this._triggerNode.addEventListener("keydown",function(b){if(b.keyCode===k.KEY.ENTER||b.keyCode===k.KEY.SPACE)c.toggle(),k.stop(b)},!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 d=this.getItems();if(d.length>0){if(!this._hookedAutoDismiss){var c=k.$$(".dropdownSubMenu",
this._dropdownNode);k.addAutoDismiss([this._triggerNode].concat(Array.prototype.slice.call(c)),this.close.bind(this));this._hookedAutoDismiss=!0}this._triggerNode.classList.add("dropdownTriggerOpen");this._dropdownNode.classList.add("dropdownMenuOpen");this._positionDropdown();d[0].focus();return!0}return!1},_positionDropdown:function(){this._dropdownNode.style.left="";var d=k.bounds(this._dropdownNode),c=k.bounds(this._boundingNode(this._triggerNode));if(d.left+d.width>c.left+c.width)this._dropdownNode.style.right=
0},_boundingNode:function(d){return d.style.right!==""||d.style.position==="absolute"||!d.parentNode||!d.parentNode.style?d:this._boundingNode(d.parentNode)},close:function(d){this._triggerNode.classList.remove("dropdownTriggerOpen");this._dropdownNode.classList.remove("dropdownMenuOpen");d&&this._triggerNode.focus();return!0},getItems:function(){var d=[],c=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(b){b.parentNode.parentNode===c._dropdownNode&&
d.push(b)});return d},empty:function(){var d=this;k.$$array("li",this._dropdownNode).forEach(function(c){c.parentNode===d._dropdownNode&&c.parentNode.removeChild(c)})},_dropdownKeyDown:function(d){if(d.keyCode===k.KEY.UP||d.keyCode===k.KEY.DOWN||d.keyCode===k.KEY.RIGHT||d.keyCode===k.KEY.ENTER||d.keyCode===k.KEY.LEFT){var c=this.getItems(),b=document.activeElement;if(c.length&&c.length>0&&b){var a=c.indexOf(b);a<0&&(a=c.indexOf(b.parentNode));a>=0&&(d.keyCode===k.KEY.UP&&a>0?(a--,c[a].focus()):d.keyCode===
k.KEY.DOWN&&a<c.length-1?(a++,c[a].focus()):d.keyCode===k.KEY.ENTER||d.keyCode===k.KEY.RIGHT?b.classList.contains("dropdownTrigger")&&b.dropdown&&b.dropdown.open():d.keyCode===k.KEY.LEFT&&b.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),k.stop(d))}}else d.keyCode===k.KEY.ESCAPE&&(this.close(!0),k.stop(d))}};g.prototype.constructor=g;return{Dropdown:g}});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(i,k){function g(d){this._init(d)}g.prototype={_init:function(d){this._node=k.node(d.node);if(!this._node)throw"no dom node for tooltip found";this._position=d.position||["right","above","below","left"];this._text=d.text;this._hideDelay=d.hideDelay===void 0?200:d.hideDelay;this._tailSize=d.tailSize||10;this._trigger=d.trigger||"mouseover";this._afterShowing=d.afterShowing;this._afterHiding=d.afterHiding;var c=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",function(a){a.target===c._node&&(c.show(),k.stop(a))},!1);else if(this._trigger==="mouseover"){this._showDelay=d.showDelay===void 0?500:d.showDelay;d=["mouseout","click"];this._node.addEventListener("mouseover",function(a){k.contains(c._node,a.target)&&(c.show(),k.stop(a))},!1);for(var b=0;b<d.length;b++)this._node.addEventListener(d[b],function(a){k.contains(c._node,a.target)&&c.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 d=this;k.addAutoDismiss([this._tip,this._node],function(){d.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(d._timeout)window.clearTimeout(d._timeout),d._timeout=null;d._tip.addEventListener("mouseout",function(c){k.contains(d._tip,c.target)&&(d.hide(),k.stop(c))},!1)},!1)}return this._tip},_positionTip:function(d,c){this._makeTipNode();d==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var b=this._node,a;for(a=k.bounds(b);b&&!a.width&&!a.height;b=b.parentNode)a=
k.bounds(b);var b=k.bounds(this._tipInner),h;switch(d){case "above":h=a.top-b.height-this._tailSize-1;a=a.left-this._tailSize;break;case "below":h=a.top+a.height+this._tailSize+1;a=a.left-this._tailSize;break;case "left":h=a.top-this._tailSize/2;a=a.left-b.width-this._tailSize-1;break;default:h=a.top-this._tailSize/2,a=a.left+a.width+this._tailSize+1}var f=k.bounds(document.documentElement);if(h+b.height>f.height)if(c)h=f.height-b.height-1;else return!1;if(a+b.width>f.width)if(c)a=f.width-b.width-
1;else return!1;if(a<0)if(c)a=4;else return!1;if(h<0)if(c)h=4;else return!1;if(!this._tail&&(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+d),d==="above"||d==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),d==="left"))this._tail.style.left=b.width+"px";this._tip.style.top=h+"px";this._tip.style.left=a+"px";this._tip.style.width=b.width+"px";this._tip.style.height=b.height+"px";return!0},contentContainer:function(){this._makeTipNode();
return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){var d=this;if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){for(var c=!1,b=0;!c&&b<d._position.length;)c=d._positionTip(d._position[b]),b++;c||d._positionTip(d._position[0],!0);d._tip.classList.add("tooltipShowing");d._afterShowing&&d._afterShowing()},this._showDelay)}},hide:function(d){if(this._timeout)window.clearTimeout(this._timeout),
this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(d===void 0)d=this._hideDelay;var c=this;this._timeout=window.setTimeout(function(){c._tip.classList.remove("tooltipShowing");c._tip.removeAttribute("style");c._afterHiding&&c._afterHiding()},d)}},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}};g.prototype.constructor=g;return{Tooltip:g}});
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(i,k,g,d,c,b,a,h){function f(a,e){for(var b in e)if(e[b]&&e[b].keyBinding&&e[b].command&&e[b].keyBinding.match(a)){var f=e[b],c=f.keyBinding;if(!c.domScope||g.contains(g.node(c.domScope),a.target)){var l=f.invocation;if(l){var j=f.command;if(j.hrefCallback){g.stop(a);
b=j.hrefCallback.call(l.handler||window,l);b.then?b.then(function(a){window.open(a)}):window.open(b);break}else if(j.onClick||j.callback){g.stop(a);window.setTimeout(function(){(j.onClick||j.callback).call(l.handler||window,l)},0);break}}}}}function e(a,e,b){e.classList.add("commandImage");var f;a.imageClass?a.addImageClassToElement?e.classList.add(a.imageClass):(f=document.createElement("span"),e.appendChild(f),f.classList.add(a.spriteClass),f.classList.add(a.imageClass)):(f=new Image,f.alt=a.name,
f.name=b,f.id=b,f.src=a.image,e.appendChild(f));return f}function j(a,e,b,f,c){this.commandRegistry=c;this.handler=a;this.items=e;this.userData=b;this.command=f;if(f.parameters)this.parameters=f.parameters.makeCopy();this.id=f.id}function m(a){this._init(a)}var o=null,n={};window.document.addEventListener("keydown",function(a){a=a||window.event;if(function(a){if(k.isMac){if(a.metaKey&&!a.altKey)return!a.shiftKey&&!a.ctrlKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===
90)?!0:!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===90)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return a["char"].length>0;else if(a.charCode||a.keyCode)switch(a=a.charCode||a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return a>=32&&a<112||a>123}return!1}(a)){if(a.target.contentEditable==="true")return;var e=a.target.nodeName.toLowerCase();if(e==="input")switch(a.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(e===
"textarea")return}e={};if(o){var b,c,j;c=Object.keys(n);for(b=0;b<c.length;b++)j=c[b],e[j]=n[j];var l=o();c=Object.keys(l);for(b=0;b<c.length;b++)j=c[b],e[j]=l[j]}else e=n;f(a,e)},!1);j.prototype={collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(a){var e=new j(this.handler,this.items,this.userData,this.command,this.commandRegistry);e.domNode=this.domNode;e.domParent=this.domParent;if(a)e.parameters=a.makeCopy();else if(this.parameters)e.parameters=
this.parameters.makeCopy();return e}};j.prototype.constructor=j;m.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip||a.name;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;this.image=a.image||i.toUrl("images/none.png");this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters},populateChoicesMenu:function(a,
e,b,f,c){this.getChoices(e,b,f).forEach(function(l){if(l.name){var b=document.createElement("li");a.appendChild(b);var f=document.createElement("span");f.tabIndex=0;f.role="menuitem";f.classList.add("dropdownMenuItem");var j=document.createTextNode(l.name);f.appendChild(j);b.appendChild(f);f.choice=l;f.addEventListener("click",function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,e)},!1);f.addEventListener("keydown",function(a){(a.keyCode===g.KEY.ENTER||a.keyCode===g.KEY.SPACE)&&
a.target.choice&&a.target.choice.callback.call(a.target.choice,e)},!1)}else c._generateMenuSeparator(a)})},getChoices:function(a,e,b){return this.choiceCallback?this.choiceCallback.call(e,a,b):null},makeChoiceCallback:function(a,e){return function(b){a.callback&&a.callback.call(a,e,b)}},hasImage:function(){return this.imageClass||this.image!==i.toUrl("images/none.png")}};m.prototype.constructor=m;return{Command:m,CommandInvocation:j,createDropdownMenu:function(a,b,f,j,h,l){a=g.node(a);if(!a)throw"no parent node was specified";
var u=document.createRange();u.selectNode(a);u=u.createContextualFragment(c);g.processTextNodes(u,{ButtonText:b});a.appendChild(u);a=a.lastChild;u=a.previousSibling;j?u.classList.add(j):(u.classList.add("orionButton"),u.classList.add("commandButton"));if(h){if(!l)u.textContent="",u.setAttribute("aria-label",b);e({spriteClass:"commandSprite",imageClass:h},u,b);u.classList.add("orionButton")}u.dropdown=new d.Dropdown({dropdown:a,populate:f});a.dropdown=u.dropdown;return{menuButton:u,menu:a,dropdown:u.dropdown}},
createCheckedMenuItem:function(e,b,f,c){e=g.node(e);if(!e)throw"no parent node was specified";var j=document.createRange();j.selectNode(e);j=j.createContextualFragment(a);g.processTextNodes(j,{ItemText:b});e.appendChild(j);e=g.$(".checkedMenuItem",e.lastChild);e.checked=f;e.addEventListener("change",c,!1)},createCommandItem:function(a,b,f,c,j,l,d){var m,l=l||!b.name&&b.hasImage();if(b.hrefCallback)m=document.createElement("a"),m.id=c,l&&b.hasImage()?e(b,m,c):(m.className="commandLink",m.appendChild(document.createTextNode(b.name))),
d=b.hrefCallback.call(f.handler,f),d.then?d.then(function(a){m.href=a}):m.href=d?d:"#";else{m=document.createElement("button");m.className="orionButton";l?b.hasImage()?(e(b,m,c),b.name&&m.setAttribute("aria-label",b.name)):(m.classList.add("commandButton"),m.classList.add("commandMissingImageButton"),m.appendChild(document.createTextNode(b.name))):(m.classList.add("commandButton"),c=document.createTextNode(b.name),m.appendChild(c));var w=d||b.callback;if(w)b.onClick=w,m.addEventListener("click",function(){w.call(f.handler,
f)},!1)}a.nodeName.toLowerCase()==="ul"?(d=document.createElement("li"),a.appendChild(d),a=d):m.classList.add("commandMargins");a.appendChild(m);if(b.tooltip)m.commandTooltip=new h.Tooltip({node:m,text:b.tooltip,position:["above","below","right","left"]});j&&(n[b.id]={keyBinding:j,command:b,invocation:f});return m},createCommandMenuItem:function(a,e,b,f,c){var l,j=a.dropdown;if(e.hrefCallback)l=document.createElement("a"),l.appendChild(document.createTextNode(e.name)),c=e.hrefCallback.call(b.handler,
b),c.then?c.then(function(a){l.href=a}):l.href=c?c:"#";else{l=document.createElement("span");l.tabIndex=0;l.appendChild(document.createTextNode(e.name));var d=c||e.callback;if(d)e.onClick=d,l.addEventListener("click",function(){j.close(!0);d.call(b.handler,b)},!1)}if(e.tooltip)l.commandTooltip=new h.Tooltip({node:l,text:e.tooltip,position:["right","left","above","below"]});l.className="dropdownMenuItem";l.role="menuitem";c=document.createElement("li");a.appendChild(c);c.appendChild(l);f&&(n[e.id]=
{keyBinding:f,command:e,invocation:b});return l},setKeyBindingProvider:function(a){o=a},localKeyBindings:n,_testMethodProcessKey:f}});
define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib"],function(i,k){function g(c){var b="",a=navigator.platform.indexOf("Mac")!==-1;c.mod1&&(b+=a?"Cmd+":"Ctrl+");c.mod2&&(b+="Shift+");c.mod3&&(b+="Alt+");c.mod4&&a&&(b+="Ctrl+");if(c.alphaKey)return b+c.alphaKey;if(c.type==="keypress")return b+c.keyCode;for(var h in k.KEY)if(typeof(k.KEY[h]==="number")&&k.KEY[h]===c.keyCode)return b+h;var f;switch(c.keyCode){case 59:f=c.mod2?":":";";break;case 61:f=c.mod2?"+":"=";break;case 188:f=
c.mod2?"<":",";break;case 190:f=c.mod2?">":".";break;case 191:f=c.mod2?"?":"/";break;case 192:f=c.mod2?"~":"`";break;case 219:f=c.mod2?"{":"[";break;case 220:f=c.mod2?"|":"\\";break;case 221:f=c.mod2?"}":"]";break;case 222:f=c.mod2?'"':"'"}return f?b+f:c.keyCode>=112&&c.keyCode<=123?b+"F"+(c.keyCode-111):b+String.fromCharCode(c.keyCode)}function d(c){var b=window.navigator.platform.indexOf("Mac")!==-1;return b&&c.metaKey||!b&&c.ctrlKey}return{getUserKeyString:function(c){for(var b="",c=c.getKeys(),
a=0;a<c.length;a++)a!==0&&(b+=" "),b+=g(c[a]);return b},getUserText:function(c,b,a,h,f,e,j,d,o){var n=!1,j=function(j){return function(d){if(!n){var m=k.node(c),g=m.value;if(m)if(j&&d.keyCode===k.KEY.ESCAPE){if(a)b.style.display="inline";n=!0;m.parentNode.removeChild(m);e&&e()}else if(!(j&&d.keyCode!==k.KEY.ENTER)){if(g.length===0||!o&&g===h){if(a)b.style.display="inline"}else f(g);n=!0;m.parentNode&&m.parentNode.removeChild(m);e&&e()}}}},g=document.createElement("input");g.id=c;g.value=h||"";b.parentNode.insertBefore(g,
b.nextSibling);g.classList.add("userEditBoxPrompt");if(a)b.style.display="none";g.addEventListener("keydown",j(!0),!1);g.addEventListener("blur",j(!1),!1);window.setTimeout(function(){g.focus();if(h){var a=k.node(c),e=d?h.indexOf(d):-1;if(e>0)if(a.createTextRange)a=a.createTextRange(),a.collapse(!0),a.moveStart("character",0),a.moveEnd("character",e),a.select();else if(a.setSelectionRange)a.setSelectionRange(0,e);else{if(a.selectionStart!==void 0)a.selectionStart=0,a.selectionEnd=e}else a.select()}},
0)},openInNewWindow:d,followLink:function(c,b){b&&d(b)?window.open(c):window.location=c},createButton:function(c,b){var a=document.createElement("button");a.className="orionButton commandButton commandMargins";a.addEventListener("click",function(a){b();k.stop(a)},!1);c&&a.appendChild(document.createTextNode(c));return a},createDropdownButton:function(){}}});
define("orion/PageUtil",[],function(){var i=/^(?:[a-zA-Z0-9-_.!~*'()#;,\/?:@&=+$\[\]]|%[0-9A-F][0-9A-F])*$/,k=/^http[s]?/i;return{matchResourceParameters:function(g){var g=g||window.location.toString(),d={resource:""},c=g.indexOf("#");if(c!==-1&&(g=g.substring(c+1),g.length!==0)){g=g.split(",");Object.defineProperty(d,"resourceRaw",{value:g[0]});d.resource=decodeURIComponent(g[0]);if(!d.resource.match(i))d.resource=encodeURI(d.resource).replace(/%5B/g,"[").replace(/%5D/g,"]");for(c=1;c<g.length;c++){var b=
/([^=]*)(=?)(.*)/.exec(g[c]),a=decodeURIComponent(b[1]||""),b=decodeURIComponent(b[3]||"");a!==""&&a!=="resource"&&(d[a]=b)}}return d},validateURLScheme:function(g,d){var c=g;if(g.indexOf("://")===-1){var b=document.createElement("a");b.href=g;c=b.href}b=!1;return(b=d?d.some(function(a){return RegExp("^"+a+":","i").test(c)}):k.test(c))?g:(console.log("Illegal URL Scheme: '"+g+"'"),"")}}});
define("orion/explorers/navigationUtils",[],function(){function i(g,d){if(!k&&g)g.push({domNode:d}),d.tabIndex=-1,d.style.outline="none"}var k=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(g,d,c){g&&(g=g.getGridNavHolder(d,!0))&&i(g,c)},generateNavGrid:i,removeNavGrid:function(g,d){if(g)for(var c=0;c<g.length;c++)if(g[c].domNode===d){g.splice(c,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(i,k,g,d,c,b,a,h,f,e,j){function m(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function o(a,e){this.token=a;this.parameterName=e}function n(a,e,b,f,l){this.name=a;this.type=e;this.label=b;this.value=f;this.lines=l||1}function p(a,e,b){this._storeParameters(a);this._hasOptionalParameters=e&&e.hasOptionalParameters;this._options=e;this.optionsRequested=!1;this.getParameters=b;this.clientCollect=e&&e.clientCollect}m.prototype={_init:function(a){this._selectionService=a.selection;var e=this;k.setKeyBindingProvider(function(){return e._activeBindings})},processURL:function(a){for(var e in this._urlBindings)if(this._urlBindings[e]&&
this._urlBindings[e].urlBinding&&this._urlBindings[e].command){var b=this._urlBindings[e].urlBinding.match(a);if(b){var f=this._urlBindings[e],l=f.command,c=f.invocation;if(c&&c.parameters&&l.callback){c.parameters.setValue(b.parameterName,b.parameterValue);var j=this;window.setTimeout(function(){j._invoke(c)},0);break}}}},findCommand:function(a){return this._commandList[a]},runCommand:function(a,e,b,f){e?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(e):1)&&a.callback&&this._invoke(new k.CommandInvocation(b,
e,null,a,this),f):(e=this._urlBindings[a])&&e.command&&e.command.callback&&this._invoke(e.invocation,f)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,e,b){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,e,b))},confirm:function(a,e,b,f,l,c){var j=!1;if(this._parameterCollector&&!l){var h=this;this._parameterCollector.close();if(this._parameterCollector.open(a,
function(a,l){var c=document.createElement("span");c.classList.add("parameterPrompt");c.textContent=e;a.appendChild(c);c=document.createElement("button");c.addEventListener("click",function(){j=!0;h._parameterCollector.close()},!1);l.appendChild(c);c.appendChild(document.createTextNode(b));c.className="dismissButton";var d=document.createElement("button");d.addEventListener("click",function(){j=!1;h._parameterCollector.close()},!1);l.appendChild(d);d.appendChild(document.createTextNode(f));d.className=
"dismissButton";return c},function(){c(j)}))return}j=window.confirm(e);c(j)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(a,e){return this._collectAndInvoke(a.makeCopy(e),!1)},_collectAndInvoke:function(a,b){if(a)if(this._parameterCollector&&a.parameters&&a.parameters.hasParameters()&&(b||a.parameters.shouldCollectParameters())){var f=!1;a.parameters.updateParameters(a);
if(a.parameters.shouldCollectParameters()&&(f=this._parameterCollector.collectParameters(a),!f)){var c=new e.Tooltip({node:a.domNode,trigger:"click",position:["below","right","above","left"]}),f=c.contentContainer();f.classList.add("parameterPopup");var l=window.document.activeElement,j=this._parameterCollector.getFillFunction(a,function(){l&&l.focus();c.destroy()})(f);c.show();window.setTimeout(function(){j.focus();j.select()},0);f=!0}f||a.command.callback.call(a.handler||window,a)}else a.command.callback.call(a.handler||
window,a);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(a){this._collectAndInvoke(a,!0)},showKeyBindings:function(a){function e(a){var l=a.invocation;if(l)if(a=a.command,a.hrefCallback)l=a.hrefCallback.call(l.handler||window,l),l.then?l.then(function(a){window.open(a)}):window.open(l);else if(a.onClick||a.callback)(a.onClick||a.callback).call(l.handler||window,l)}function b(a){return function(){e(a)}}var f=
{},l,c,j=[],h;for(h in this._activeBindings)(c=this._activeBindings[h])&&c.keyBinding&&c.command&&j.push(c);j.sort(function(a,l){return a.command.name.localeCompare(l.command.name)});for(h=0;h<j.length;h++)c=j[h],c.keyBinding.scopeName?(f[c.keyBinding.scopeName]||(f[c.keyBinding.scopeName]=[]),f[c.keyBinding.scopeName].push(c)):(l=g.getUserKeyString(c.keyBinding),a.createItem(l,c.command.name,b(c)));for(var d in f)f[d].length&&f[d].length>0&&(a.createHeader(d),f[d].forEach(function(e){l=g.getUserKeyString(e.keyBinding);
a.createItem(l,e.command.name,b(e))}))},addCommand:function(a){this._commandList[a.id]=a;var e=this._pendingBindings[a.id];if(e){var b=this;e.forEach(function(e){b._addBinding(a,e.type,e.binding,e.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,e,b,f,l,c,j,h){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];l&&(a=this._createEntryForPath(a,l));if(a[e]){if(f)a[e].title=f;if(b)a[e].position=b;if(j)a[e].imageClass=
j;if(h)a[e].tooltip=h;a[e].emptyGroupMessage=c}else a[e]={title:f,position:b,emptyGroupMessage:c,imageClass:j,tooltip:h,children:{}},a.sortedContributions=null},_createEntryForPath:function(a,e){e&&e.split("/").forEach(function(e){if(e.length>1)a[e]||(a[e]={position:0,children:{}}),a=a[e].children});return a},registerSelectionService:function(a,e){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=e},registerCommandContribution:function(a,
e,b,f,l,c,j){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];f&&(a=this._createEntryForPath(a,f));a[e]={position:b};c&&((b=this._commandList[e])?this._addBinding(b,"key",c,l):this._addPendingBinding(e,"key",c,l));j&&((b=this._commandList[e])?this._addBinding(b,"url",j,l):this._addPendingBinding(e,"url",j,l));a.sortedContributions=null},_addBinding:function(a,e,b,f){if(!a.id)throw Error("No command id: "+a);e==="key"?this._activeBindings[a.id]=
{command:a,keyBinding:b,bindingOnly:f}:e==="url"&&(this._urlBindings[a.id]={command:a,urlBinding:b,bindingOnly:f})},_addPendingBinding:function(a,e,b,f){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:e,binding:b,bindingOnly:f})},_checkForTrailingSeparator:function(a,e,b){var f;if(e==="tool"||e==="button")if((f=a.childNodes.length>0?a.childNodes[a.childNodes.length-1]:null)&&f.classList.contains("commandSeparator"))return b?(a.removeChild(f),!1):!0;if(e===
"menu"&&(a=c.$$array("li > *",a),a.length>0&&a[a.length-1].classList.contains("dropdownSeparator")))if(f=a[a.length-1],b)f.parentNode.parentNode.removeChild(f.parentNode);else return!0;return!1},renderCommands:function(a,e,b,f,l,j,h){if(typeof a!=="string")throw"a scope id for rendering must be specified";e=c.node(e);if(!e)throw"no parent";var d=this._contributionsByScopeId[a];if(!b&&d){var b=d.localSelectionService||this._selectionService,m=this;b&&b.getSelections(function(b){m.renderCommands(a,
e,b,f,l,j)})}else d&&(this._render(this._contributionsByScopeId[a],e,b,f,l||"button",j,h),this._checkForTrailingSeparator(e,l,!0))},destroy:function(a){a=c.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var e=a.firstChild;e.commandTooltip&&e.commandTooltip.destroy();e.emptyGroupTooltip&&e.emptyGroupTooltip.destroy();this.destroy(e);a.removeChild(e)}},_render:function(a,b,f,c,l,h,d){var m=a.sortedContributions;if(!m){var m=[],o=!1,n;for(n in a)if(!a.hasOwnProperty||a.hasOwnProperty(n)){var g=
a[n];if(g&&typeof g.position==="number")g.id=n,m.push(g),o=!0}if(o)m.sort(function(a,l){return a.position-l.position}),a.sortedContributions=m}var p=0,i=this;m.forEach(function(a){var m,w;if(!a.imageClass)a.imageClass=null;if(a.children&&Object.getOwnPropertyNames(a.children).length>0){m=a.children;var o;if(l==="tool"||l==="button")if(a.title)o=i._createDropdownMenu(b,a.title,null,null,a.imageClass,a.tooltip),d&&j.generateNavGrid(d,o.menuButton),window.setTimeout(function(){i._render(a.children,o.menu,
f,c,"menu",h,d);i._checkForTrailingSeparator(o.menu,"menu",!0);if(o.menu.childNodes.length===0)if(a.emptyGroupMessage){if(!o.menuButton.emptyGroupTooltip)o.menuButton.emptyGroupTooltip=new e.Tooltip({node:o.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})}else d&&j.removeNavGrid(d,o.menuButton),o.menu.parentNode&&o.menu.parentNode.removeChild(o.menu),o.destroyButton&&o.destroyButton.parentNode&&o.destroyButton.parentNode.removeChild(o.destroyButton);
else o.menuButton.style.visibility="visible"},0);else{var n;b.childNodes.length>0&&!i._checkForTrailingSeparator(b,l)&&(n=i.generateSeparatorImage(b));i._render(m,b,f,c,l,h,d);b.childNodes.length>0&&b.childNodes[b.childNodes.length-1]!==n&&(n=i.generateSeparatorImage(b))}else if(a.title){if(n=i._createDropdownMenu(b,a.title,!0,null,null,a.imageClass))i._render(m,n.menu,f,c,"menu",h,d),n.menu.childNodes.length===0&&n.destroyButton&&b.removeChild(n.destroyButton)}else b.childNodes.length>0&&i._generateMenuSeparator(b),
i._render(m,b,f,c,l,h,d),i._generateMenuSeparator(b)}else{var v=i._commandList[a.id];m=v?!0:!1;var g=null,g=null;if(v){w=new k.CommandInvocation(c,f,h,v,i);w.domParent=b;n=m&&(v.visibleWhen?v.visibleWhen(f):!0);if(i._activeBindings[v.id]&&i._activeBindings[v.id].keyBinding)g=i._activeBindings[v.id],g.invocation=n?w:null,g.bindingOnly&&(m=!1);if(i._urlBindings[v.id]&&i._urlBindings[v.id].urlBinding)g=i._urlBindings[v.id],g.invocation=n?w:null,g.bindingOnly&&(m=!1);m=m&&n}if(m)v.choiceCallback?(l===
"tool"||l==="button"?(m=b,n=!1,b.nodeName.toLowerCase()==="ul"&&(m=document.createElement("li"),b.appendChild(m))):(m=b,n=!0),i._createDropdownMenu(m,v.name,n,function(a){v.populateChoicesMenu(a,f,c,h,i)}.bind(v),v.imageClass,v.tooltip||v.title)):(w.handler=w.handler||this,w.domParent=b,n=function(){i._invoke(w)},l==="menu"?m=k.createCommandMenuItem(b,v,w,null,n):(m=l+v.id+p,m=k.createCommandItem(b,v,w,m,null,l==="tool",n)),j.generateNavGrid(d,m),w.domNode=m,p++)}})},_createDropdownMenu:function(a,
f,j,d,l,m){a=c.node(a);if(!a||!c.contains(document.body,a))return null;var o,w=a;if(j)m=document.createRange(),m.selectNode(a),m=m.createContextualFragment(h),c.processTextNodes(m,{ButtonText:f}),a.appendChild(m),o=a.lastChild,a=o.lastChild,f=a.previousSibling,f.dropdown=new b.Dropdown({dropdown:a,populate:d}),a.dropdown=f.dropdown;else if(a.nodeName.toLowerCase()==="ul"&&(w=document.createElement("li"),a.appendChild(w),o=w),a=null,l&&(a="dropdownButtonWithIcon",m=m||f),m=l?m||f:m,d=k.createDropdownMenu(w,
f,d,a,l),f=d.menuButton,a=d.menu,m)f.commandTooltip=new e.Tooltip({node:f,text:m,position:["above","below","right","left"]});return{menuButton:f,menu:a,dropdown:f.dropdown,destroyButton:o}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var e=document.createElement("li");e.classList.add("dropdownSeparator");var b=document.createElement("span");b.classList.add("dropdownSeparator");e.appendChild(b);a.appendChild(e)}},generateSeparatorImage:function(a){var e;e=a.nodeName.toLowerCase()===
"ul"?document.createElement("li"):document.createElement("span");a.appendChild(e);e.classList.add("core-sprite-sep");e.classList.add("imageSprite");e.classList.add("commandSeparator");return e}};m.prototype.constructor=m;o.prototype={match:function(a){a=d.matchResourceParameters(a);return typeof a[this.token]!=="undefined"?(this.parameterValue=a[this.token],this):null}};o.prototype.constructor=o;n.prototype={optionsRequested:function(){return this.optionsRequested}};n.prototype.constructor=n;p.prototype=
{_storeParameters:function(a){this.parameterTable=null;if(a){var e=this.parameterTable={};a.forEach(function(a){e[a.name]=a})}},updateParameters:function(a){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(a))},hasParameters:function(){return this.parameterTable!==null},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(a){return this.parameterTable[a]},valueFor:function(a){return(a=this.parameterTable[a])?a.value:
null},setValue:function(a,e){var b=this.parameterTable[a];if(b)b.value=e},forEach:function(a){for(var e in this.parameterTable)this.parameterTable[e].type&&this.parameterTable[e].name&&a(this.parameterTable[e])},makeCopy:function(){var a=[];this.forEach(function(e){e=new n(e.name,e.type,e.label,e.value,e.lines);a.push(e)});var e=new p(a,this._options,this.getParameters);e.clientCollect=this.clientCollect;return e},hasOptionalParameters:function(){return this._hasOptionalParameters}};p.prototype.constructor=
p;return{CommandRegistry:m,URLBinding:o,ParametersDescription:p,CommandParameter:n}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(i,k,g){function d(c,b){this._activeContainer=null;this._getElementsFunction=c;this._toolbarLayoutFunction=b}d.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&g.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&g.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();if(this._oldFocusNode)this._oldFocusNode.focus(),this._oldFocusNode=null}this._activeElements=null},open:function(c,b,a){typeof c==="string"&&(c=g.node(c));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===c)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(c))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=a;var h=b(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!h)return!1;this._activeElements.focusNode=h;c=g.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(c.length===0){b=this._activeElements.dismissArea||
this._activeElements.parameterArea;c=document.createElement("button");c.id="closebox";c.className="imageSprite core-sprite-close dismissButton";c.title=i.Close;b.appendChild(c);var f=this;c.addEventListener("click",function(){f.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);if(h)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){h.focus();h.select&&h.select()},0);this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(c,b){g.$$array("input",b).forEach(function(a){a.type==="checkbox"?c.parameters.setValue(a.parameterName,a.checked):a.type!=="button"&&c.parameters.setValue(a.parameterName,a.value.trim())});g.$$array("textArea",b).forEach(function(a){c.parameters.setValue(a.parameterName,a.value.trim())});c.command.callback&&c.command.callback.call(c.handler,c)},collectParameters:function(c){return c.parameters?
(c.domNode&&c.domNode.classList.add("commandMarker"),this.open(c.domNode||c.domParent,this.getFillFunction(c))):!1},getFillFunction:function(c,b){var a=this;return function(h,f){var e=null,j=function(){b&&b();a.close()},d=function(e){e.keyCode===g.KEY.ENTER&&a._collectAndCall(c,h);if(e.keyCode===g.KEY.ESCAPE||e.keyCode===g.KEY.ENTER)j(),g.stop(e)};c.parameters.forEach(function(a){var b=null;if(a.label)b=document.createElement("label"),b.classList.add("parameterInput"),b.setAttribute("for",a.name+
"parameterCollector"),b.textContent=a.label,h.appendChild(b);var f=a.name+"parameterCollector",c=b||h;if(a.type==="text"&&typeof a.lines==="number"&&a.lines>1)b=document.createElement("textarea"),b.rows=a.lines,b.type="textarea",b.id=f,c.appendChild(b),d=function(a){a.keyCode===g.KEY.ESCAPE&&(j(),g.stop(a))};else if(a.type==="boolean"){if(b=document.createElement("input"),b.type="checkbox",b.id=f,c.appendChild(b),a.value)b.checked=!0}else if(b=document.createElement("input"),b.type=a.type,b.id=f,
c.appendChild(b),a.value)b.value=a.value;b.classList.add("parameterInput");b.setAttribute("speech","speech");b.setAttribute("x-webkit-speech","x-webkit-speech");b.parameterName=a.name;e||(e=b);b.addEventListener("keydown",d,!1)});var o=f;if(!o)o=document.createElement("span"),o.className="layoutRight parametersDismiss",h.appendChild(o);var n=function(a,e){var b=document.createElement("button");e.appendChild(b);a&&b.appendChild(document.createTextNode(a));b.classList.add("dismissButton");return b};
if(c.parameters.hasOptionalParameters())c.parameters.optionsRequested=!1,n(i.More,o).addEventListener("click",function(){c.parameters.optionsRequested=!0;a._collectAndCall(c,h);j()},!1);n(i.Submit,o).addEventListener("click",function(){a._collectAndCall(c,h);j()},!1);o=n(null,o);o.id="closebox";o.classList.add("imageSprite");o.classList.add("core-sprite-close");o.title=i.Close;o.addEventListener("click",function(){j()},!1);return e}}};d.prototype.constructor=d;return{CommandParameterCollector:d}});
define("orion/editor/regex",[],function(){return{escape:function(i){return i.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(i){return(i=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(i))?{pattern:i[1],flags:i[2]}:null}}});
define("orion/contentTypes",[],function(){function i(b,a){function c(a,e,b,f){var b=e.filename.indexOf(b)>=0,j=e.extension.indexOf(f)>=0;if(b||j)if(!a||b&&a.extension.indexOf(f)>=0)return e;return a}for(var f=b&&b.split(".").pop(),e=null,j=0;j<a.length;j++){var d=a[j];c(e,d,b,f)===d&&(e=d)}return e}function k(b){this.serviceRegistry=b;this.map=function(a){function b(a){return a===null||typeof a==="undefined"?[]:a instanceof Array?a:[a]}for(var a=a.getServiceReferences(d).concat(a.getServiceReferences(c)),
f={},e=0;e<a.length;e++)for(var j=b(a[e].getProperty("contentTypes")),m=0;m<j.length;m++){var o=j[m];f[o.id]||(f[o.id]={id:o.id,name:o.name,image:o.image,"extends":o["extends"],extension:b(o.extension),filename:b(o.filename)})}return f}(b);b.registerService(g,this)}var g="orion.core.contenttypes",d="orion.core.contenttype",c="orion.file.contenttype";k.prototype={getContentTypes:function(){var b=this.getContentTypesMap(),a=[],c;for(c in b)b.hasOwnProperty(c)&&a.push(b[c]);return a},getContentTypesMap:function(){return this.map},
getFileContentType:function(b){return i(b.Name,this.getContentTypes())},getFilenameContentType:function(b){return i(b,this.getContentTypes())},getContentType:function(b){return this.map[b]||null},isExtensionOf:function(b,a){b=typeof b==="string"?this.getContentType(b):b;a=typeof a==="string"?this.getContentType(a):a;if(!b||!a)return!1;if(b.id===a.id)return!0;else for(var c=b,f={};c&&(c=this.getContentType(c["extends"]));){if(c.id===a.id)return!0;if(f[c.id])throw Error("Cycle: "+c.id);f[c.id]=!0}return!1},
isSomeExtensionOf:function(b,a){for(var c=0;c<a.length;c++)if(this.isExtensionOf(b,a[c]))return!0;return!1}};return{ContentTypeService:k,getFilenameContentType:i}});
define("orion/URITemplate",[],function(){function i(a){this._text=a}function k(a,e){if(e==="U")return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if(e==="U+R")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]");if(e==="U+R-,")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+e);}function g(a,e,b){for(var c=[],h=0;h<a.length;h++)typeof a[h]!=="undefined"&&
c.push(k(a[h],e));return c.join(b)}function d(a,e,b,c){for(var h=Object.keys(a),d=[],g=0;g<h.length;g++)typeof a[h[g]]!=="undefined"&&d.push(k(h[g],e)+b+k(a[h[g]],e));return d.join(c)}function c(b){if(b.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=a[b[0]])?b=b.substring(1):this._operator=a.NUL;for(var e=[],c=b.split(","),d=0;d<c.length;d++){var o=c[d].match(h);if(o===null)throw Error("Bad VarSpec: "+b);e.push({name:o[1],explode:!!o[2],prefix:o[3]?parseInt(o[3],
10):-1})}this._varSpecList=e}function b(a){for(var e=[],b=0,h=a.indexOf("{",b);h!==-1;){e.push(new i(a.substring(b,h)));b=a.indexOf("}",h+1);if(b===-1)throw Error("Invalid template: "+a);e.push(new c(a.substring(h+1,b)));b+=1;h=a.indexOf("{",b)}e.push(new i(a.substring(b)));this._templateComponents=e}var a={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-,"}},h=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/;i.prototype={expand:function(){return encodeURI(this._text)}};c.prototype={expand:function(a){for(var e=[],b=
0;b<this._varSpecList.length;b++){var c=this._varSpecList[b],h=c.name,n=a[h],p=typeof n;if(p!=="undefined"&&n!==null){var i=e.length===0?this._operator.first:this._operator.sep;if(p==="string")this._operator.named&&(i+=k(h,"U+R"),i+=n.length===0?this._operator.ifemp:"="),c.prefix!==-1&&c.prefix<n.length&&(n=n.substring(0,c.prefix)),i+=k(n,this._operator.allow);else if(Array.isArray(n))c.explode?i+=g(n,this._operator.allow,this._operator.sep):(this._operator.named&&(i+=k(h,"U+R"),i+=n.length===0?this._operator.ifemp:
"="),i+=g(n,this._operator.allow,","));else if(p==="object")c.explode?i+=d(n,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(i+=k(h,"U+R"),i+=Object.keys(n).length===0?this._operator.ifemp:"="),i+=d(n,this._operator.allow,",",","));else throw Error("bad param type: "+h+" : "+p);e.push(i)}}return e.join("")}};b.prototype={expand:function(a){for(var e=[],b=0;b<this._templateComponents.length;b++)e.push(this._templateComponents[b].expand(a));return e.join("")}};return b});
define("orion/i18nUtil",["require","orion/Deferred"],function(i,k){function g(c){if(c=localStorage.getItem("orion/messageBundle/"+c))if(c=JSON.parse(c),c._expires&&c._expires>(new Date).getTime())return delete c._expires,c;return null}var d={};return{getMessageBundle:function(c){function b(){i(["i18n!"+c],function(e){if(e){var b=c;e._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+b,JSON.stringify(e));delete e._expires}a.resolve(e)})}if(d[c])return d[c];var a=new k;d[c]=
a;var h=g(c);if(h)return a.resolve(h),a;try{i([c],b)}catch(f){i(["orion/i18n!"+c],b)}return a},formatMessage:function(c){var b=arguments;return c.replace(/\$\{([^\}]+)\}/g,function(a,c){return b[(c<<0)+1]})}}});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/URL-shim".split(","),function(i,k,g,d,c){function b(){return(new URL(i.toUrl("orion/../"),window.location.href)).href.slice(0,-1)}function a(a,f){var e=a.getServiceReferences(f||"orion.page.link"),j=g.matchResourceParameters(window.location.href),m={OrionHome:b(),Location:j.resource},o=[];e.forEach(function(a){var e={};a.getPropertyKeys().forEach(function(b){e[b]=a.getProperty(b)});if(e.uriTemplate&&
e.nls&&(e.name||e.nameKey)){var b=new k;c.getMessageBundle(e.nls).then(function(a){var f=new d(e.uriTemplate),f=window.decodeURIComponent(f.expand(m)),f=g.validateURLScheme(f);e.href=f;e.textContent=e.nameKey?a[e.nameKey]:e.name;b.resolve(e)});o.push(b)}else if(e.uriTemplate&&e.name){var f=new d(e.uriTemplate),f=window.decodeURIComponent(f.expand(m)),f=g.validateURLScheme(f);e.href=f;e.textContent=e.name;o.push((new k).resolve(e))}});return k.all(o)}return{createPageLinks:function(b,f){return a(b,
f).then(function(a){a.sort(function(a,e){var b=a.textContent&&a.textContent.toLowerCase(),f=e.textContent&&e.textContent.toLowerCase();return b<f?-1:b>f?1:0});return a.map(function(a){var e=a.href,a=a.textContent,b=document.createElement("a");b.href=e;b.target="_self";b.classList.add("targetSelector");b.textContent=a;return b})})},getPageLinksInfo:a,getOrionHome:b}});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/editor/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks".split(","),function(i,k,g,d,c,b,a,h,f){var e={},j=f.getOrionHome();e._cloneItemWithoutChildren=function n(a){if(a===null||typeof a!=="object")return a;var e=a.constructor(),b;for(b in a)b!=="children"&&b!=="Children"&&(e[b]=n(a[b]));return e};e._getOpenWithNavCommandExtensions=function(a){function e(a,l){for(var b=a.getServiceReferences("orion.navigate.openWith"),
f=[],c=0;c<b.length;c++){var j=b[c];j.getProperty("editor")===l.id&&(j=j.getProperty("contentType"),j instanceof Array?f=f.concat(j):j!==null&&typeof j!=="undefined"&&f.push(j))}return f}for(var b=function(){for(var e=a.getServiceReferences("orion.edit.editor"),l=[],b=0;b<e.length;b++){var f=e[b],c=f.getProperty("id");l.push({id:c,name:f.getProperty("name"),nameKey:f.getProperty("nameKey"),nls:f.getProperty("nls"),uriTemplate:f.getProperty("orionTemplate")||f.getProperty("uriTemplate")})}return l}(),
f=function(a){for(a=a.getServiceReferences("orion.navigate.openWith.default");0<a.length;)return{editor:a[0].getProperty("editor")};return null}(a),c=[],j=0;j<b.length;j++){var l=b[j],h=f&&f.editor===l.id,d=e(a,l);d.length&&c.push({properties:{name:l.name||l.id,nameKey:l.nameKey,id:"eclipse.openWithCommand."+l.id,tooltip:l.name,tooltipKey:l.nameKey,contentType:d,uriTemplate:l.uriTemplate,nls:l.nls,forceSingleItem:!0,isEditor:h?"default":"editor"},service:{}})}return c};e._makeValidator=function(a,
e,f,h){function d(a,e,b,f){var c=b.match,j;if(e.indexOf("|")>=0)return j=e.substring(0,e.indexOf("|")),e=e.substring(e.indexOf("|")+1),d(a,j,b,f)?!0:d(a,e,b,f);else if(e.indexOf(":")>=0)return j=e.substring(0,e.indexOf(":")),e=e.substring(e.indexOf(":")+1),a[j]?d(a[j],e,b,f):!1;else{a:{j=!1;var h;if(typeof a[e]!=="undefined"){if(typeof c==="undefined")h=a[e],j=!0;else if(typeof c==="string"){if(!typeof(a[e]==="string")){b=!1;break a}if(b.variableName){if(c=RegExp(c).exec(a[e]))j=c[0],h=b.variableMatchPosition===
"before"?a[e].substring(0,c.index):b.variableMatchPosition==="after"?a[e].substring(c.index+j.length):b.variableMatchPosition==="only"?j:a[e],j=!0}else{b=RegExp(c).test(a[e]);break a}}else a[e]===c&&(h=a[e],j=!0);if(j&&b.variableName&&(f[b.variableName]=h,f.itemCached=a,b.replacements))for(a=0;a<b.replacements.length;a++)e=!1,b.replacements[a].pattern?f[b.variableName]=f[b.variableName].replace(RegExp(b.replacements[a].pattern),b.replacements[a].replacement||""):e=!0,e&&window.console.log("Invalid replacements specified in validation property.  "+
b.replacements[a]);b=j}else b=!1}return b}}return{info:a,validationFunction:function(e){typeof h==="function"&&(e=h.call(this,e));if(e){if(Array.isArray(e)){if((this.info.forceSingleItem||this.info.uriTemplate)&&e.length!==1)return!1;if(e.length<1)return!1}else e=[e];for(var b=0;b<e.length;b++){var j;a:{var m=e[b],w=f;if(this.info.validationProperties)for(j=0;j<this.info.validationProperties.length;j++){var g=this.info.validationProperties[j];if(typeof g.source!=="undefined"){if(!d(m,g.source,g,this)){j=
!1;break a}}else{window.console.log("Invalid validationProperties in "+a.id+".  No source property specified.");j=!1;break a}}if(this.info.contentType&&w){g=!1;if(m=c.getFilenameContentType(m.Name,w))for(j=0;j<this.info.contentType.length;j++)if(m.id===this.info.contentType[j]){g=!0;break}j=g}else j=!0}if(!j)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var e={},f;for(f in a)a.hasOwnProperty(f)&&(e[f]=a[f]);if(this.info.validationProperties)for(f=
0;f<this.info.validationProperties.length;f++){var c=this.info.validationProperties[f];c.source&&c.variableName&&(this.itemCached===a&&this[c.variableName]||d(a,c.source,c,this),a[c.variableName]?window.console.log("Variable name "+c.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):e[c.variableName]=this[c.variableName])}e.OrionHome=j;a=new b(this.info.uriTemplate);return window.decodeURIComponent(a.expand(e))}return null}}};e._createCommandOptions=
function(b,f,c,j,h,d){function l(a,l){var m=e._makeValidator(b,c,j,d);a.visibleWhen=m.validationFunction.bind(m);if(h)if(m.generatesURI.bind(m)())a.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return m.getURI.bind(m)(a)};else{var u=b;a.callback=function(b){var l;if(u.forceSingleItem)b=Array.isArray(b.items)?b.items[0]:b.items,l=e._cloneItemWithoutChildren(b);else if(Array.isArray(b.items)){l=[];for(var j=0;j<b.items.length;j++)l.push(e._cloneItemWithoutChildren(b.items[j]))}else l=
e._cloneItemWithoutChildren(b.items);if(c)var h=c.getService("orion.page.progress");f.run?h?h.progress(f.run(l),"Running command: "+a.name):f.run(l):c&&(h?h.progress(c.getService(f).run(l),"Running command: "+a.name):c.getService(f).run(l))}}l.resolve(a)}var m=new k;b.nls?a.getMessageBundle(b.nls).then(function(a){l({name:b.nameKey?a[b.nameKey]:b.name,image:b.image,id:b.id||b.name,tooltip:b.tooltipKey?a[b.tooltipKey]:b.tooltip,isEditor:b.isEditor,showGlobally:b.showGlobally},m)}):l({name:b.name,image:b.image,
id:b.id||b.name,tooltip:b.tooltip,isEditor:b.isEditor,showGlobally:b.showGlobally},m);return m};e.getOpenWithCommands=function(a){var e=[],b;for(b in a._commandList){var f=a._commandList[b];f.isEditor&&e.push(f)}return e};var m;e.createAndPlaceFileCommandsExtension=function(a,b,f,c,j,h){var l=!!h;return e.createFileCommands(a,null,h?"all":void 0,l).then(function(a){b._addedOpenWithCommands=l;var e=!1,h=!1;a.forEach(function(a){b.addCommand(a);j&&!e&&(e=!0,b.addCommandGroup(f,"eclipse.fileCommandExtensions",
1E3,null,j));j&&!h&&(h=!0,b.addCommandGroup(f,"eclipse.openWith",1E3,"Open With",j+"/eclipse.fileCommandExtensions"));this.isEditor?b.registerCommandContribution(f,a.id,c+this.index,j?j+"/eclipse.fileCommandExtensions/eclipse.openWith":null):b.registerCommandContribution(f,a.id,c+this.index,j?j+"/eclipse.fileCommandExtensions":null)});return{}})};e.createFileCommands=function(a,b,f,c){var f=f===void 0?"global":f,c=c===void 0?!0:c,j=a.getServiceReferences("orion.navigate.command"),h=[];if(f==="all"||
f==="global")for(var l=0;l<j.length;l++)if(j[l].getProperty("id")!=="orion.navigateFromMetadata"){for(var d=a.getService(j[l]),y={},w=j[l].getPropertyKeys(),v=0;v<w.length;v++)y[w[v]]=j[l].getProperty(w[v]);(f==="all"||y.forceSingleItem&&y.showGlobally)&&h.push({properties:y,service:d})}return k.when(function(){var e=a.getService("orion.core.contenttypes")||b;return m||k.when(e.getContentTypes(),function(a){return m=a})}(),function(){h=c?h.concat(e._getOpenWithNavCommandExtensions(a,m)):h;var b=h.map(function(b){var l=
b.properties;return e._createCommandOptions(l,b.service,a,m,!0).then(function(a){a=new g.Command(a);if(l.isEditor)a.isEditor=l.isEditor;return a})});return k.all(b,function(a){return{_error:a}}).then(function(a){return a})})};e.createOpenWithCommands=function(a,b,f){return f&&f._addedOpenWithCommands?(new k).resolve(e.getOpenWithCommands(f)):e.createFileCommands(a,b,"none",!0)};return e});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(i,k){function g(d){this._init(d)}g.prototype={_init:function(d){var c=k.node(d.container);if(!c)throw"no parent container";this._container=c;c.classList.remove("currentLocation");this._id=d.id||"eclipse.breadcrumbs";this._resource=d.resource||null;this._rootSegmentName=d.rootSegmentName;this._workspaceRootSegmentName=d.workspaceRootSegmentName;this._workspaceRootURL=d.workspaceRootURL;this._makeHref=d.makeHref;this.path="";this.measure();
this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var d;if(this._resource&&this._resource.Parents){d=document.createElement("a");var c=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(d,c):d.href=i.toUrl("navigate/table.html")+"#"+c}else d=document.createElement("span");k.empty(d);d.appendChild(document.createTextNode(this._workspaceRootSegmentName));return d}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],
buildSegment:function(d){var c=document.createElement("a");c.classList.add("breadcrumb");c.appendChild(document.createTextNode(d));return c},addSegmentHref:function(d,c){this._makeHref?this._makeHref(d,c.Location,c):d.href=i.toUrl("navigate/table.html")+"#"+c.ChildrenLocation},buildSegments:function(d,c){if(this._resource.Parents){var b=this._resource.Parents.slice(0),a,h;b&&(b=b.slice(0),c==="reverse"&&(b=b.reverse().slice(0)),b.forEach(function(b){d?(h=d,d=null):h=b.Name;a=this.buildSegment(h);
this.path+=b.Name;this.addSegmentHref(a,b);a.include=!1;this.segments.push(a)}.bind(this)))}},addDivider:function(){var d=document.createElement("span");d.appendChild(document.createTextNode(" / "));this.path+="/";d.classList.add("breadcrumbSeparator");this.append(d)},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(d){this.crumbs.appendChild(d)},addTitle:function(d,c){var b=c||document.title;this.crumbs.childNodes.length===0&&(d=document.createElement("span"),d.appendChild(document.createTextNode(b)),d.classList.add("breadcrumb"),d.classList.add("currentLocation"),
this.append(d))},finalSegment:function(d,c){d=document.createElement("span");c?d.appendChild(document.createTextNode(c)):d.appendChild(document.createTextNode(this._resource.Name));d.classList.add("currentLocation");this.path+=this._resource.Name;this.append(d)},firstSegment:function(d){if(d)this.append(d),this._resource&&this._resource.Parents?(d.classList.add("breadcrumb"),this.addDivider()):(d.href="",d.classList.add("currentLocation"))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(d){d.include===
!0&&(this.append(d),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var d=this.segments.slice(0).reverse();d.forEach(function(c){this.append(c);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?c.include=!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=d.reverse()}},measure:function(){this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var d=this.getNavigatorWorkspaceRootSegment(),c=this._rootSegmentName;
if(c)this.addTitle(d,c);else if(this.finalSegment(d,c),this._resource&&this._resource.Parents&&(this.buildSegments(c,"reverse"),this.measureSegments(),this.firstSegment(d)),this.crumbs.offsetWidth>=this.MAX_LENGTH)this.INCLUDE_FIRST_SECTION=!1},render:function(){this.refresh();var d=this.getNavigatorWorkspaceRootSegment(),c=this._rootSegmentName;c?this.addTitle(d,c):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(d),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(d,
c)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};g.prototype.constructor=g;return{BreadCrumbs:g}});
define("orion/webui/splitter",["require","orion/webui/littlelib"],function(i,k){function g(d){this._init(d)}g.prototype={_init:function(d){this._tracking=null;this._resizeListeners=[];this._animationDelay=501;this.$node=k.node(d.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=k.node(d.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=k.node(d.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";this._vertical=d.vertical;
this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(d.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add("splitThumbLayout");this._closeByDefault=d.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(d){this._resizeListeners.push(d)},_initializeFromStoredSettings:function(){var d=localStorage.getItem(this._prefix+"/toggleState");this._closed=d?d==="closed":this._closeByDefault?
!0:!1;if(this._vertical)if(d=localStorage.getItem(this._prefix+"/yPosition"))this._splitTop=parseInt(d,10);else{if(this._closeByDefault)this._splitTop=150}else if(d=localStorage.getItem(this._prefix+"/xPosition"))this._splitLeft=parseInt(d,10);else if(this._closeByDefault)this._splitLeft=150},_adjustToSplitPosition:function(d){var c=k.bounds(this.$node),b=k.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=c.height;if(d||!this._splitTop)this._splitTop=c.top,localStorage.setItem(this._prefix+
"/yPosition",this._splitTop);d=this._splitTop;this.$node.parentNode.style.position==="relative"&&(d=this._splitTop-b.top);this.$sideNode.style.height=d+"px";this.$sideNode.style.bottom=d-1+"px";this.$sideNode.style.display="block";this.$node.style.top=d+"px"}else{this._splitWidth=c.width;if(d||!this._splitLeft)this._splitLeft=c.left,localStorage.setItem(this._prefix+"/xPosition",this._splitLeft);d=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(d=this._splitLeft-b.left);this.$sideNode.style.width=
d+"px";this.$sideNode.style.right=d-1+"px";this.$sideNode.style.display="block";this.$node.style.left=d+"px"}this._resize()},_resize:function(d){var d=d||0,c=k.bounds(this.$node.parentNode),b=k.bounds(this.$node);this._vertical?this.$mainNode.style.height=c.height-(b.top-c.top+b.height)+"px":this.$mainNode.style.width=c.width-(b.left-c.left+b.width)+"px";var a=this;window.setTimeout(function(){a._notifyResizeListeners(a.$mainNode)},d);window.setTimeout(function(){a._notifyResizeListeners(a.$sideNode)},
d)},_notifyResizeListeners:function(d){for(var c=0;c<this._resizeListeners.length;c++)this._resizeListeners[c](d)},_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 d=this;window.setTimeout(function(){d.$sideNode.classList.remove("sidePanelLayoutAnimation");d.$mainNode.classList.remove("mainPanelLayoutAnimation");d.$node.classList.remove("splitLayoutAnimation");d._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(d){if(d.target===this._thumb)return k.stop(d),this._thumbDown(d);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(d)},_mouseMove:function(d){if(this._tracking){var c=k.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=d.clientY;if(this._splitTop<c.top+5)this._splitTop=c.top+5;else if(this._splitTop>c.top+c.height-5)this._splitTop=c.top+c.height-5;var b=this._splitTop;this.$node.parentNode.style.position==="relative"&&(b=this._splitTop-c.top);this.$node.style.top=b+"px"}else{this._splitLeft=d.clientX;if(this._splitLeft<c.left+5)this._splitLeft=c.left+5;else if(this._splitLeft>c.left+c.width-
5)this._splitLeft=c.left+c.width-5;b=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(b=this._splitLeft-c.left);this.$node.style.left=b+"px"}this._adjustToSplitPosition(!0);k.stop(d)}},_mouseUp:function(d){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(d)}};g.prototype.constructor=g;return{Splitter:g}});
define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(i){return{makeRelative:function(i){if(!i)return i;var g=window.location.protocol+"//"+window.location.host;return i.indexOf(g)===0?i.substring(g.length):i},isAtRoot:function(k){if(!k)return!1;if(k==="/workspace")return!0;var g=new URL(i.toUrl("workspace"),window.location.href);return(new URL(k,window.location.href)).href.indexOf(g.href)===0}}});
define("orion/favorites",["require","orion/fileUtils","orion/EventTarget"],function(i,k,g){function d(c){this._favorites=[];g.attach(this);this._init(c);this._initializeFavorites()}d.prototype={_init:function(c){this._registry=c.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.favorite",this)},_notifyListeners:function(){this.dispatchEvent({type:"favoritesChanged",navigator:this._favorites,registry:this._registry})},makeFavorites:function(c){for(var c=Array.isArray(c)?
c:[c],b=0;b<c.length;b++){var a=c[b],h=a.ChildrenLocation?a.ChildrenLocation:a.Location,h=k.makeRelative(h);this.addFavorite(a.Name,h,a.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(c){this.addFavorite(c,c,!1,!0)},addFavorite:function(c,b,a){this._favorites.push({name:c,path:b,directory:a,isFavorite:!0});this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},removeFavorite:function(c){for(var b in this._favorites)if(this._favorites[b].path===
c){this._favorites.splice(b,1);break}this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},renameFavorite:function(c,b){var a=!1,h;for(h in this._favorites)if(this._favorites[h].path===c){var f=this._favorites[h];if(f.name!==b)f.name=b,a=!0}a&&(this._favorites.sort(this._sorter),this._storeFavorites(),this._notifyListeners())},hasFavorite:function(c){for(var b in this._favorites)if(this._favorites[b].path===c)return!0;return!1},_SPECIAL_CHARS:"^$\\+[]().",queryFavorites:function(c){var b;
if(!c)return this._favorites;var a="";for(b=0;b<c.length;b++){var h=c.charAt(b);a+=h==="*"?".*":h==="?"?".?":this._SPECIAL_CHARS.indexOf(h)>=0?"\\"+h:h}a+=".*";c=RegExp(a);a=[];for(b in this._favorites)this._favorites[b].name.search(c)===0&&a.push(this._favorites[b]);return a},_initializeFavorites:function(){var c=this;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var a,b=b.get("navigate");typeof b==="string"&&(b=JSON.parse(b));if(b)for(a in b)b[a].isFavorite=
!0,c._favorites.push(b[a]);c._favorites.sort(c._sorter);c._notifyListeners()})},_storeFavorites:function(){var c=this._favorites;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){b.put("navigate",c)})},_sorter:function(c,b){var a=c.name.toLowerCase(),h=b.name.toLowerCase();return a>h?1:a<h?-1:0},getFavorites:function(){return{navigator:this._favorites}}};d.prototype.constructor=d;return{FavoritesService:d}});
define("orion/widgets/themes/ThemePreferences",[],function(){function i(i,g){this._preferences=i;this._themeData=g;var d=g.getThemeStorageInfo(),c=i.listenForChangedSettings(d.storage,2,function(b){b.key===c&&this.apply()}.bind(this))}i.prototype={_initialize:function(i,g,d){var c=d.get(i.styleset);c||(c=g.getStyles(),d.put(i.styleset,JSON.stringify(c)));(g=d.get("selected"))&&(g=JSON.parse(g));if(!g||g[i.selectedKey]===void 0)g=g||{},g[i.selectedKey]=i.defaultTheme,d.put("selected",JSON.stringify(g))},
apply:function(){this.setTheme()},getTheme:function(i){var g=this._themeData,d=g.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(c){this._initialize(d,g,c);var b=JSON.parse(c.get("selected")),c=JSON.parse(c.get(d.styleset)),a;if(c)for(var h=0;h<c.length;h++)if(c[h].name===b[d.selectedKey]){a=c[h];break}i({style:a,styles:c})}.bind(this))},setTheme:function(i,g){var d=this._themeData,c=d.getThemeStorageInfo();this._preferences.getPreferences(c.storage,2).then(function(b){this._initialize(c,
d,b);var a=JSON.parse(b.get("selected"));i||(i=a[c.selectedKey]);a[c.selectedKey]=i;b.put("selected",JSON.stringify(a));g?b.put(c.styleset,JSON.stringify(g)):g=JSON.parse(b.get(c.styleset));for(b=0;b<g.length;b++)if(g[b].name===a[c.selectedKey]){d.processSettings(g[b]);break}}.bind(this))},setFontSize:function(i){var g=this._themeData,d=g.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(c){this._initialize(d,g,c);var b=JSON.parse(c.get("selected")),a=JSON.parse(c.get(d.styleset)),
h;if(a)for(var f=0;f<a.length;f++)a[f].fontSize=i,a[f].name===b[d.selectedKey]&&(h=a[f]);c.put(d.styleset,JSON.stringify(a));g.processSettings(h)}.bind(this))}};return{ThemePreferences:i}});
define("orion/editor/eventTarget",[],function(){function i(){}i.addMixin=function(k){var g=i.prototype,d;for(d in g)g.hasOwnProperty(d)&&(k[d]=g[d])};i.prototype={addEventListener:function(i,g,d){if(!this._eventTypes)this._eventTypes={};var c=this._eventTypes[i];c||(c=this._eventTypes[i]={level:0,listeners:[]});c.listeners.push({listener:g,useCapture:d})},dispatchEvent:function(i){var g=i.type;this._dispatchEvent("pre"+g,i);this._dispatchEvent(g,i);this._dispatchEvent("post"+g,i)},_dispatchEvent:function(i,
g){var d=this._eventTypes?this._eventTypes[i]:null;if(d){var c=d.listeners;try{if(d.level++,c)for(var b=0,a=c.length;b<a;b++)if(c[b]){var h=c[b].listener;typeof h==="function"?h.call(this,g):h.handleEvent&&typeof h.handleEvent==="function"&&h.handleEvent(g)}}finally{if(d.level--,d.compact&&d.level===0){for(b=c.length-1;b>=0;b--)c[b]||c.splice(b,1);c.length===0&&delete this._eventTypes[i];d.compact=!1}}}},isListening:function(i){return!this._eventTypes?!1:this._eventTypes[i]!==void 0},removeEventListener:function(i,
g,d){if(this._eventTypes){var c=this._eventTypes[i];if(c){for(var b=c.listeners,a=0,h=b.length;a<h;a++){var f=b[a];if(f&&f.listener===g&&f.useCapture===d){c.level!==0?(b[a]=null,c.compact=!0):b.splice(a,1);break}}b.length===0&&delete this._eventTypes[i]}}}};return{EventTarget:i}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(i,k,g){function d(b){b=b||{};this._document=b.document||document}var c={};d.getTheme=function(b){var b=b||"default",a=c[b];a||(a=c[b]=new d);return a};d.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(b,a){var c=this,f=c._themeClass;c._themeClass=b;this._load(b,a,function(){c.onThemeChanged({type:"ThemeChanged",oldValue:f,newValue:c.getThemeClass()})})},onThemeChanged:function(b){return this.dispatchEvent(b)},
buildStyleSheet:function(b,a){function c(a,j,h){j&&(f.push("."+b+" ."+a+" {"),f.push("\t"+(h?"background-color":"color")+": "+j+";"),f.push("}"))}var f=[];f.push("");f.push("."+b+" {");a.fontFamily&&f.push("\tfont-family: "+a.fontFamily+";");a.fontSize&&f.push("\tfont-size: "+a.fontSize+";");a.fontSize&&f.push("\tcolor: "+a.text+";");f.push("}");f.push("."+b+".textview {");a.background&&f.push("\tbackground-color: "+a.background+";");f.push("}");c("ruler.annotations",a.annotationRuler,!0);c("ruler.lines",
a.annotationRuler,!0);c("ruler.folding",a.annotationRuler,!0);c("ruler.overview",a.overviewRuler,!0);c("rulerLines",a.lineNumber,!1);c("rulerLines.even",a.lineNumberEven,!1);c("rulerLines.odd",a.lineNumberOdd,!1);c("annotationLine.currentLine",a.currentLine,!0);c("entity-name-tag",a.keyword,!1);c("entity-other-attribute-name",a.attribute,!1);c("string-quoted",a.string,!1);c("line_caret",a.currentLine,!0);c("token_keyword",a.keyword,!1);c("token_string",a.string,!1);c("token_singleline_comment",a.comment,
!1);c("token_multiline_comment",a.comment,!1);c("token_doc_comment",a.comment,!1);c("token_doc_html_markup",a.comment,!1);return f.join("\n")},_createStyle:function(b,a,c,f){var e=this._document,b="orion-theme-"+b,j=e.getElementById(b);if(j){if(f||j.firstChild.data===a)return;j.removeChild(j.firstChild);j.appendChild(e.createTextNode(a))}else f?(j=g.createElement(e,"link"),j.rel="stylesheet",j.type="text/css",j.href=a,j.addEventListener("load",function(){c()})):(j=g.createElement(e,"style"),j.appendChild(e.createTextNode(a))),
j.id=b,(e.getElementsByTagName("head")[0]||e.documentElement).appendChild(j);f||c()},_load:function(b,a,c){if(b)if(typeof a==="string")this._createStyle(b,a,c);else if(a=a.href,a.substring(a.length-4)!==".css"&&(a+=".css"),/^\//.test(a)||/[a-zA-Z0-9]+:\/\//i.test(a)||!i.toUrl)this._createStyle(b,a,c,!0);else{var f=this;i(["text!"+a],function(a){f._createStyle(b,a,c,!1)})}else c()}};k.EventTarget.addMixin(d.prototype);return{TextTheme:d}});
define("orion/widgets/themes/ThemeClass",[],function(){function i(i){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=i;this.classString="."+i+"{ "}i.prototype.className=null;i.prototype.classString=void 0;i.prototype.style=void 0;i.prototype.closeString=" }\n";i.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:i}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(i){function k(){}k.prototype.navbar="#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 g="",d=[],c=new i.ThemeClass("orionPage");
c.style.backgroundColor="#fdfdfd";c.style.width="100%";c.style.height="100%";d.push(c);c=new i.ThemeClass("topRowBanner");c.style.margin="0";c.style.border="0";c.style.backgroundColor=this.navbar;c.style.height="15px";c.style.padding="10px";c.style.paddingRight="3px";d.push(c);c=new i.ThemeClass("a");c.style.textDecoration="none";c.style.color=this.content;d.push(c);c=new i.ThemeClass("navlink");c.style.display="inline-block";c.style.padding="2px";c.style.color=this.content;d.push(c);c=new i.ThemeClass("primaryNav");
c.style.color=this.navtext;c.style.fontSize="8pt";c.style.fontWeight="normal";c.style.paddingTop="0";c.style.verticalAlign="baseline";d.push(c);c=new i.ThemeClass("primaryNav a");c.style.fontSize="8pt";c.style.color=this.navtext;c.style.marginRight="6px";c.style.marginLeft="6px";c.style.verticalAlign="baseline";c.style.textDecoration="none";d.push(c);c=new i.ThemeClass("primaryNav a:hover");c.style.color="#bfbfbf";c.style.cursor="hand";c.style.color="white";c.style.fontWeight="normal";d.push(c);for(var b in d)g+=
d[b].toString();return g};k.prototype.writeLocationStyle=function(){var g="",d=[],c=new i.ThemeClass("titleArea");c.style.margin="0";c.style.paddingTop="5px";c.style.border="0";c.style.background=this.location;c.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.location+"), color-stop(100%,"+this.location+"))";c.style.borderBottom="1px solid "+this.location;c.style.minHeight="20px";d.push(c);c=new i.ThemeClass("breadcrumb");c.style.fontSize="8pt";c.style.textDecoration=
"none";c.style.color="#f1f1f2;";c.style.paddingTop="2px";d.push(c);c=new i.ThemeClass("a.breadcrumb:hover");c.style.textDecoration="none";c.style.borderBottom="1px dotted";c.style.color="#F58B0F";c.style.cursor="pointer";d.push(c);c=new i.ThemeClass("breadcrumbSeparator");c.style.fontSize="8pt";c.style.textDecoration="none";c.style.color="#f1f1f2";c.style.fontWeight="bold";d.push(c);c=new i.ThemeClass("currentLocation");c.style.fontWeight="bold";c.style.fontSize="8pt";c.style.color="#f1f1f2";c.style.textDecoration=
"none";c.style.textWrap="normal";c.style.lineHeight="10pt";d.push(c);c=new i.ThemeClass("a.currentLocation:hover");c.style.fontWeight="bold";c.style.fontSize="10pt";c.style.color="#666666";c.style.textDecoration="none";c.style.borderBottom="0";d.push(c);c=new i.ThemeClass("navlinkonpage");c.style.color=this.content;d.push(c);c=new i.ThemeClass("progressPane_running");c.style.background="url(../images/progress_running_dark.gif) no-repeat center";c.style.width="16px";c.style.height="16px";d.push(c);
for(var b in d)g+=d[b].toString();return g};k.prototype.writeButtonStyle=function(){var g="",d=[],c=new i.ThemeClass("commandButton");c.style.color="#666";c.style.border="1px solid #dedede";c.style.backgroundColor="#ddd";c.style.textAlign="center";c.style.verticalAlign="baseline";c.style.cursor="pointer";c.style.display="inline-block";c.style.padding="5px 6px";c.style.borderRadius="3px";c.style.lineHeight="12px";c.style.fontSize="8pt";c.style.userSelect="none";d.push(c);c=new i.ThemeClass("commandButton:over");
c.style.backgroundColor="#e6e6e6";c.style.border="1px solid #808080";d.push(c);c=new i.ThemeClass("commandMenu");c.style.color="#222";c.style.display="inline-block";c.style.verticalAlign="baseline";c.style.margin="0";c.style.fontSize="8pt";c.style.fontWeight="normal";c.style.border="1px solid #dedede";c.style.backgroundColor="#efefef";c.style.cursor="pointer";c.style.borderRadius="1px";d.push(c);c=new i.ThemeClass("commandMenuItem");c.style.border="0";c.style.padding="0";c.style.margin="0";d.push(c);
for(var b in d)g+=d[b].toString();return g};k.prototype.writeMainStyle=function(){var g="",d=[],c=new i.ThemeClass("searchbox");c.style.backgroundImage="url(../images/core_sprites.png)";c.style.backgroundRepeat="no-repeat";c.style.backgroundPosition="4px -297px";c.style.width="12px";c.style.height="12px";c.style.backgroundColor=this.search;c.style.border="1px solid "+this.search;c.style.fontSize="11px";c.style.width="15em";c.style.height="16px";c.style.borderRadius="10px";c.style.color="#999";c.style.padding=
"0";c.style.paddingLeft="20px";c.style.marginLeft="5px";c.style.marginTop="6px !important";c.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";d.push(c);c=new i.ThemeClass("searchbox:focus");c.style.color="white";c.style.outline="none";d.push(c);c=new i.ThemeClass("checkedRow");c.style.cssText="background-color:"+this.selection+" !important;";d.push(c);c=new i.ThemeClass("navbar-item-selected");c.style.background=this.selection;c.style.color=
this.content;d.push(c);c=new i.ThemeClass("auxpane");c.style.border="0";c.style.background=this.sidepanel;c.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.sidepanel+"), color-stop(100%,"+this.sidepanel+"))";c.style.background="-moz-linear-gradient(top, "+this.sidepanel+" 0%, "+this.sidepanel+" 100%)";d.push(c);c=new i.ThemeClass("mainpane");c.style.background=this.mainpanel;c.style.border=0;d.push(c);c=new i.ThemeClass("mainToolbar");c.style.background=this.toolpanel;
c.style.height="34px";c.style.borderBottom="1px solid #ebebeb";c.style.paddingTop="2px";d.push(c);for(var b in d)g+=d[b].toString();return g};k.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};k.prototype.getSheet=function(g){g.navbar.value?(this.navbar=g.navbar.value,this.button=g.button.value,this.location=g.location.value,this.selection=g.selection.value,this.sidepanel=
g.sidepanel.value,this.mainpanel=g.mainpanel.value,this.navtext=g.navtext.value,this.search=g.search.value,this.content=g.content.value,this.toolpanel=g.toolpanel.value):(this.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(i,k){function g(){}function d(){this.styles=[];var b=new g;b.name="Orion";b.navbar="#333";b.button="#EFEFEF";b.location="#efefef";b.selection="FEC";b.sidepanel="#FBFBFB";b.mainpanel="white";b.toolpanel="white";b.navtext="#bfbfbf";b.content="#3087B3";b.search="#444";b.breadcrumb="#3087B3";b.separator="#333";this.styles.push(b);b=new g;b.name="Green Zone";b.navbar=
"seagreen";b.button="lavender";b.location="darkseagreen";b.selection="moccasin";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="darkgreen";b.search="darkgreen";b.breadcrumb="#3087B3";b.separator="seagreen";this.styles.push(b);b=new g;b.name="Pretty In Pink";b.navbar="plum";b.button="lavender";b.location="pink";b.selection="lavender";b.sidepanel="seashell";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumorchid";b.search="violet";
b.breadcrumb="#3087B3";b.separator="plum";this.styles.push(b);b=new g;b.name="Blue Monday";b.navbar="cornflowerblue";b.button="lavender";b.location="skyblue";b.selection="lavender";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="royalblue";b.search="royalblue";b.breadcrumb="#3087B3";b.separator="cornflowerblue";this.styles.push(b);b=new g;b.name="Vanilla Skies";b.navbar="sandybrown";b.button="lemmonchiffon";b.location="cornsilk";b.selection="lemonchiffon";
b.sidepanel="white";b.mainpanel="white";b.toolpanel="white";b.navtext="lemonchiffon";b.content="chocolate";b.search="moccasin";b.breadcrumb="#3087B3";b.separator="sandybrown";this.styles.push(b);b=new g;b.name="Beetlejuice";b.navbar="indigo";b.button="slateblue";b.location="darkslateblue";b.selection="silver";b.sidepanel="lavender";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumslateblue";b.search="#444";b.breadcrumb="#3087B3";b.separator="indigo";this.styles.push(b);
b=new g;b.name="Red";b.navbar="#CD2127";b.button="#777777";b.location="#D85F56";b.selection="lightcoral";b.sidepanel="#EFDAB2";b.mainpanel="#FDFADD";b.toolpanel="#FDFADD";b.navtext="#FBFBFB";b.content="darkred";b.search="#D85F56";b.breadcrumb="darkred";b.separator="#CD2127";this.styles.push(b)}function c(){return this.styles}g.prototype.name="Orion";g.prototype.navbar="#333";g.prototype.button="#EFEFEF";g.prototype.location="#333";g.prototype.breadcrumb="#3087B3";g.prototype.separator="#333";g.prototype.selection=
"FEC";g.prototype.sidepanel="#FBFBFB";g.prototype.mainpanel="white";g.prototype.toolpanel="white";g.prototype.navtext="#bfbfbf";g.prototype.content="#3087B3";g.prototype.search="#444";d.prototype.styles=[];d.prototype.getStyles=c;d.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion",selectedKey:"selected"}};d.prototype.getViewData=function(){for(var b={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"}]},a=0;a<3;a++)b.shapes.push({type:"TEXT",name:"content",label:"org.eclipse.orion.content",x:170,y:127+20*a,fill:"#3087B3",family:"content"});for(a=0;a<3;a++)b.shapes.push({type:"TEXT",name:"content",label:"Item",x:25,y:115+20*a,fill:"#3087B3",family:"content"});for(a=0;a<3;a++)b.shapes.push({type:"TRIANGLE",name:"twisty",x1:160,y1:121+a*20,x2:165,y2:124+a*20,x3:160,y3:127+a*20,family:"navbar",fill:"#333"});
b.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return b};d.prototype.processSettings=function(b){var a=new k.ThemeSheetWriter;(new i.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",a.getSheet(b))};return{ThemeData:d,getStyles:c}});
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(i,k){var g={root:k};Object.keys(i).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=i[d])});return g});
define("orion/widgets/UserMenu",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/PageLinks"],function(i,k,g,d){function c(b){this._displaySignOut=!0;this._init(b)}c.prototype={_init:function(b){this._dropdownNode=g.node(b.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=b.dropdown;this._serviceRegistry=b.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices={};this._noSeparator=b.noSeparator;this._dropDownItemClass=
b.dropDownItemClass;this._keyAssistClass=b.keyAssistClass;if(b.signOut!==void 0)this._displaySignOut=b.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(b){var a=0,c;for(c in b)b.hasOwnProperty(c)&&a++;return a},_makeMenuItem:function(b,a){var c=document.createElement("span");c.role="menuitem";
c.tabIndex=0;var f=document.createTextNode(b);c.appendChild(f);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&c.classList.add(this._dropDownItemClass):c.classList.add("dropdownMenuItem");c.addEventListener("click",a,!1);c.addEventListener("keydown",function(b){(b.keyCode===g.KEY.ENTER||b.keyCode===g.KEY.SPACE)&&a()},!1);return c},_renderAuthenticatedService:function(b){var a=this,c=this.authenticatedServices[b].authService;if(c&&c.logout&&this._displaySignOut){var f=document.createElement("li"),
e=this._makeMenuItem(i["Sign Out"],function(){c.logout().then(function(){a.addUserItem(b,c,a.authenticatedServices[b].label);localStorage.removeItem(b);localStorage.removeItem("lastLogin");for(var e=localStorage.length-1;e>=0;e--){var f=localStorage.key(e);f&&f.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(f)}c.getAuthForm(window.location.href).then(function(a){window.location=a})})});f.appendChild(e);this._dropdownNode.appendChild(f)}},renderServices:function(){function b(b){c[b]||
(c[b]=a.createDocumentFragment());return c[b]}var a=document,c=[];d.getPageLinksInfo(this._serviceRegistry,"orion.page.link.user").then(function(f){this._dropdown?this._dropdown.empty():this._dropdownNode&&g.empty(this._dropdownNode);f.forEach(function(e){var f=b(typeof e.category==="number"?e.category:1),c=a.createElement("li"),j=a.createElement("a");j.role="menuitem";typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&j.classList.add(this._dropDownItemClass):j.classList.add("dropdownMenuItem");
j.href=e.href;j.textContent=e.textContent;c.appendChild(j);f.appendChild(c)}.bind(this));if(this.keyAssistFunction){var f=document.createElement("li"),e=this._makeMenuItem(i["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass==="string"?this._keyAssistClass!==""&&e.classList.add(this._keyAssistClass):e.classList.add("key-assist-menuitem");f.appendChild(e);b(0).appendChild(f)}var j=this;c.sort(function(a,b){return a-b}).forEach(function(a,b){if(b<c.length-1&&!this._noSeparator){var e=
document.createElement("li");e.classList.add("dropdownSeparator");var f=document.createElement("span");f.classList.add("dropdownSeparator");e.appendChild(f);a.appendChild(e)}j._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var d in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(d)&&this._renderAuthenticatedService(d,0)}.bind(this))},setKeyAssist:function(b){this.keyAssistFunction=b;this.renderServices()},addUserItem:function(b,a,c,f){f?(this.unauthenticatedServices[b]&&
delete this.unauthenticatedServices[b],this.authenticatedServices[b]={authService:a,label:c,data:f}):(this.authenticatedServices[b]&&delete this.authenticatedServices[b],this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:a,label:c,pending:this.unauthenticatedServices[b].pending}:{authService:a,label:c});this.renderServices()}};c.prototype.constructor=c;return{UserMenu:c}});
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(i,k){var g={root:k};Object.keys(i).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=i[d])});return g});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/editor/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(i,k,g,d,c,b){function a(a,b,c){var d="";c&&(d="^");if(d=g.parse("/"+d+a.searchStr+"/"))c=d.pattern,d=d.flags,d.indexOf("i")===-1&&!b.caseSensitive&&(d+="i"),a.regExp={pattern:c,flags:d},a.wildCard=!0}var h={ALL_FILE_TYPE:"*.*"};h.doSearch=function(a,b,c,d){if(a){var o=!0;c==="*"&&(c="");c===""&&(o=d&&d.type!==h.ALL_FILE_TYPE);if(o){c!==""&&h.addRecentSearch(b,
c,d?d.regEx:!1);var a=a.createSearchParams(c,!1,!1,d),n=h.generateSearchHref(a);h.getOpenSearchPref(b,function(a){a?window.open(n):window.location=n})}}else window.alert(i["Can't search: no search service is available"])};h.generateSearchHelper=function(b,e){var c=b.keyword,d=c,o={};b.fileType&&b.fileType!==h.ALL_FILE_TYPE&&c===""&&(d="*."+b.fileType);if(b.regEx)o.searchStr=c,a(o,b,e);else{var n=c.indexOf("*")>-1,g=c.indexOf("?")>-1;n&&(c=c.split("*").join(".*"));g&&(c=c.split("?").join("."));!n&&
!g&&!b.nameSearch?(o.searchStr=b.caseSensitive?c.split("\\").join(""):c.split("\\").join("").toLowerCase(),o.wildCard=!1):(o.searchStr=b.caseSensitive?c:c.toLowerCase(),a(o,b,e),o.wildCard=!0)}o.searchStrLength=o.searchStr.length;return{params:b,inFileQuery:o,displayedSearchTerm:d}};h.convertSearchParams=function(a){if(a.rows!==void 0)a.rows=parseInt(a.rows,10);if(a.start!==void 0)a.start=parseInt(a.start,10);if(typeof a.regEx==="string")a.regEx=a.regEx.toLowerCase()==="true";if(typeof a.caseSensitive===
"string")a.caseSensitive=a.caseSensitive.toLowerCase()==="true";if(typeof a.nameSearch==="string")a.nameSearch=a.nameSearch.toLowerCase()==="true"};h.copySearchParams=function(a,b){var c={},d;for(d in a)if(a[d]!==void 0&&a[d]!==null&&(b||d!=="replace"))c[d]=a[d];return c};h.generateSearchHref=function(a){var e=k.toUrl("search/search.html"),a=h.copySearchParams(a,!0),c=a.resource;a.resource=void 0;return(new b(e+"#{,resource,params*}")).expand({resource:c,params:a})};h.generateFindURLBinding=function(a,
e,c,d){a={find:e.searchStr,regEx:e.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:typeof d==="string"?d:void 0,atLine:typeof c==="number"?c:void 0};return","+(new b("{,params*}")).expand({params:a})};h.convertFindURLBinding=function(a){if(typeof a.regEx==="string")a.regEx=a.regEx.toLowerCase()==="true";if(typeof a.caseSensitive==="string")a.caseSensitive=a.caseSensitive.toLowerCase()==="true";if(typeof a.atLine==="string")a.atLine=parseInt(a.atLine,10)};h.replaceRegEx=function(a,
b,c){return a.replace(RegExp(b.pattern,b.flags),c)};h.replaceStringLiteral=function(a,b,c){b=g.parse("/"+b+"/gim");return h.replaceRegEx(a,b,c)};h.searchOnelineLiteral=function(a,b,c){var d;d=0;for(var h=!1,n=[];;)if(d=b.indexOf(a.searchStr,d),d<0)break;else{n.push({startIndex:d,length:a.searchStrLength});h=!0;if(c)break;d+=a.searchStrLength}return h?n:null};h.findRegExp=function(a,b,c,d){if(!b)return null;c=c||"";c+=(c.indexOf("g")===-1?"g":"")+(c.indexOf("m")===-1?"m":"");var h=null;return(h=RegExp(b,
c).exec(a.substring(d)))&&{startIndex:h.index+d,length:h[0].length}};h.searchOnelineRegEx=function(a,b,c){for(var d=0,o=!1,n=[];;)if(d=h.findRegExp(b,a.regExp.pattern,a.regExp.flags,d)){n.push(d);o=!0;if(c)break;d=d.startIndex+d.length}else break;return o?n:null};h.generateNewContents=function(a,b,c,d,o,n){if(d&&b){if(!a)c.contents=[];for(var g=0;g<b.length;g++){for(var i=b[g],k=!1,r=!1,t=[],l,u=0,y=0;y<d.children.length;y++)if(d.children[y].lineNumber-1===g){u=y;for(k=0;k<d.children[y].matches.length;k++)d.children[y+
k].checked!==!1&&t.push(k);r=t.length>0;l=d.children[y].matches;k=!0;break}if(k){if(r){t=h.replaceCheckedMatches(i,o,l,t,n);i=t.replacedStr;for(k=0;k<d.children[u].matches.length;k++)d.children[u+k].newMatches=t.newMatches}else for(k=0;k<d.children[u].matches.length;k++)d.children[u+k].newMatches=d.children[u+k].matches;a?c.contents[g]=i:c.contents.push(i)}else a||c.contents.push(i)}}};h.generateMatchContext=function(a,b,c){var d=[],h=a*2+1,n;b.length<=h?(n=0,a=b.length-1):(n=c-a,n<0?(n=0,a=n+h-1):
(a=c+a,a>b.length-1&&(a=b.length-1,n=a-h+1)));for(h=n;h<=a;h++)d.push({context:b[h],current:h===c});return d};h.splitFile=function(a){for(var b=0,c=0,d=0,h=0,n=[];;){b!==-1&&b<=d&&(b=a.indexOf("\r",d));c!==-1&&c<=d&&(c=a.indexOf("\n",d));if(c===-1&&b===-1){n.push(a.substring(h));break}var g=1;b!==-1&&c!==-1?b+1===c?(g=2,d=c+1):d=(b<c?b:c)+1:d=b!==-1?b+1:c+1;n.push(a.substring(h,d-g));h=d}return n};h.searchWithinFile=function(a,b,c,d,o,n){c=h.splitFile(c);if(o)b.contents=c;if(b){b.children=[];for(var g=
d=0;g<c.length;g++){var i=c[g];if(i&&i.length>0){var k=n?i:i.toLowerCase();if(k=a.wildCard?h.searchOnelineRegEx(a,k):h.searchOnelineLiteral(a,k)){var r,t=g+1;if(o)for(var l=0;l<k.length;l++)r=l+1,r={parent:b,checked:b.checked,type:"detail",matches:k,lineNumber:t,matchNumber:r,name:i,location:b.location+"-"+t+"-"+r},b.children.push(r);else r={parent:b,context:h.generateMatchContext(2,c,g),checked:b.checked,type:"detail",matches:k,lineNumber:t,name:i,location:b.location+"-"+t},b.children.push(r);d+=
k.length}}}b.totalMatches=d}};h.replaceCheckedMatches=function(a,b,c,d,h){for(var n=0,g="",i=[],k=0;k<c.length;k++){n!==c[k].startIndex&&(g+=a.substring(n,c[k].startIndex));if(c[k].length)h=c[k].length;for(var n=!1,r=0;r<d.length;r++)if(d[r]===k){n=!0;break}n?(i.push({startIndex:g.length,length:b.length}),g+=b):(i.push({startIndex:g.length,length:h}),g+=a.substring(c[k].startIndex,c[k].startIndex+h));n=c[k].startIndex+h}n<a.length&&(g+=a.substring(n));return{replacedStr:g,newMatches:i}};h.fullPathNameByMeta=
function(a){var b=a.length,c="";if(b>0)for(b-=1;b>-1;b--)c=c+(c===""?"":"/")+a[b].Name;return c};h.path2FolderName=function(a,b,c){return a.substring(0,a.length-b.length-(c?0:1))};h._storeRecentSearch=function(a,b,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("recentSearch",b);c&&window.setTimeout(function(){c.dispatchEvent({type:"recentSearchesChanged"})}.bind(this),20)})};h.addRecentSearch=function(a,b,c){typeof b==="string"&&b&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(d){var o,
d=d.get("recentSearch");typeof d==="string"&&(d=JSON.parse(d));if(d){for(o in d)if(d[o].name===b)return;d.length>=20&&d.splice(19,d.length-20+1)}else d=[];d.splice(0,0,{name:b,regEx:c});h._storeRecentSearch(a,d)})};h.removeRecentSearch=function(a,b,c){typeof b==="string"&&b&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(d){var o,d=d.get("recentSearch");typeof d==="string"&&(d=JSON.parse(d));if(d)for(o in d)if(d[o].name===b){d.splice(o,1);h._storeRecentSearch(a,
d,c);break}})};h.getSearches=function(a,b,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a=a.get(b);typeof a==="string"&&(a=JSON.parse(a));a&&c&&c(a)})};h.getMixedSearches=function(a,b,c,d){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var f=a.get("recentSearch");typeof f==="string"&&(f=JSON.parse(f));b&&(a=a.get("search"),typeof a==="string"&&(a=JSON.parse(a)),a&&a.forEach(function(a){if(c){var b=h.parseQueryStr(a.query);
f.some(function(a){return b.searchStrTitle===a.name})||f.push({name:b.searchStrTitle,label:a.name})}else f.push({name:null,label:a.name,value:a.query})}));f&&d&&d(f)})};h.getOpenSearchPref=function(a,b){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");b(a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?!0:!1:!1)})};h.setOpenSearchPref=function(a,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",
{openInNewTab:b})})};return h});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(i,k,g,d,c,b){function a(a,b,e,c){this.registry=a;this.fileClient=b;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=c&&c.searchOnName;this._buildSkeletonOnly=c&&c.buildSkeletonOnly;this._fetchChildrenCallBack=c&&c.fetchChildrenCallBack;this._searchParams=e;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:d.generateSearchHelper(e);this._location=c&&c.location;this._childrenLocation=c&&c.childrenLocation?c.childrenLocation:this._location}a.prototype.search=function(a){var b=this.registry.getService("orion.core.contenttypes");this._onSearchComplete=a;b.getContentTypes().then(function(a){this.contentTypesCache=a;this._visitRecursively(this._childrenLocation).then(function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,
docs:this.fileLocations}})}.bind(this))}.bind(this))};a.prototype.searchName=function(a,b){if(a)this.searchHelper=d.generateSearchHelper(a,!0);if(b)this.onSearchNameComplete=b;var e=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var c=0;c<this.fileSkeleton.length;c++){var m=this.fileSkeleton[c].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?d.searchOnelineRegEx(this.searchHelper.inFileQuery,m,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,m,!0))if(e.push(this.fileSkeleton[c]),
e.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:e.length,docs:e}})}};a.prototype.buildSkeleton=function(a,b){this._buildingSkeleton=!0;var e=this.registry.getService("orion.core.contenttypes"),c=this;a();e.getContentTypes().then(function(a){c.contentTypesCache=a;c._visitRecursively(c._childrenLocation).then(function(){c._buildingSkeleton=!1;b();c.searchHelper&&!c._buildSkeletonOnly&&c.searchName()})})};a.prototype._searchCompleted=function(){console.log("Search Completed.")};
a.prototype._searchFiles=function(){var a=[],c;if(this.fileLocations.length>0){c=this;for(var e=0;e<c.fileLocations.length;e++)a.push(c._sniffSearch(c.fileLocations[e]))}return b.all(a)};a.prototype._sort=function(a){a.sort(function(a,b){var c=a.Name&&a.Name.toLowerCase(),d=b.Name&&b.Name.toLowerCase();return c<d?-1:c>d?1:0})};a.prototype._onFileType=function(a){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===d.ALL_FILE_TYPE?!0:a.extension.indexOf(this.searchHelper.params.fileType)>=
0:!0};a.prototype._visitRecursively=function(a){var f=[],e=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(a);var j=e.registry.getService("orion.page.progress");return(j?j.progress(e.fileClient.fetchChildren(a),"Crawling search for children of "+a):e.fileClient.fetchChildren(a)).then(function(a){for(var j=0;j<a.length;j++)if(a[j].Directory!==void 0&&a[j].Directory===!1)if(e._searchOnName)f.push(e._buildSingleSkeleton(a[j]));else if(e._buildSkeletonOnly)f.push(e._buildSingleSkeleton(a[j]));
else{var d=c.getFilenameContentType(a[j].Name,e.contentTypesCache);d&&(d["extends"]==="text/plain"||d.id==="text/plain")&&e._onFileType(d)&&f.push(e._sniffSearch(a[j]))}else a[j].Location&&f.push(e._visitRecursively(a[j].ChildrenLocation));return b.all(f)})};a.prototype._hitOnceWithinFile=function(a){a=this._searchParams.caseSensitive?a:a.toLowerCase();return this.searchHelper.inFileQuery.wildCard?d.searchOnelineRegEx(this.searchHelper.inFileQuery,a,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,
a,!0)};a.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)};a.prototype._sniffSearch=function(a){this._totalCounter++;var b=this;if(this.searchHelper.params.keyword==="")this._reportSingleHit(a),this.registry.getService("orion.page.message").setProgressResult({Message:g.formatMessage(i["${0} files found out of ${1}"],
this._hitCounter,this._totalCounter)});else return this.registry.getService("orion.page.progress").progress(b.fileClient.read(a.Location),"Reading file "+a.Location).then(function(e){b._hitOnceWithinFile(e)&&b._reportSingleHit(a);b.registry.getService("orion.page.message").setProgressResult({Message:g.formatMessage(i["${0} files found out of ${1}"],b._hitCounter,b._totalCounter)})},function(a){console.error("Error loading file content: "+a.message)})};a.prototype._buildSingleSkeleton=function(a){this._totalCounter++;
this.fileSkeleton.push(a);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();a=new b;a.resolve(this._totalCounter);return a};a.prototype.constructor=a;return{SearchCrawler:a}});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(i,k,g,d){function c(){}c.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 b=
document.body;this.$frameParent=b;this.$$modalExclusions=this.$$modalExclusions||[];var a=document.createRange();a.selectNode(b);a=a.createContextualFragment(this.CONTAINERTEMPLATE);b.appendChild(a);this.$frame=b.lastChild;this.title&&g.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=g.$("#closeDialog",this.$frame);var c=this;this.$close.addEventListener("click",function(){c.hide()},!1);this.$parent=g.$(".dialogContent",this.$frame);a=document.createRange();a.selectNode(this.$parent);
b=a.createContextualFragment(this.TEMPLATE);this.messages&&g.processTextNodes(b,this.messages);this.$parent.appendChild(b);this.$buttonContainer=g.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(a){a.keyCode===g.KEY.ESCAPE?c.hide():a.keyCode===g.KEY.ENTER&&typeof c._defaultCallback==="function"&&c._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 b=this;this.buttons.forEach(function(a){var c=d.createButton(a.text,a.callback);if(a.id)c.id=a.id,b["$"+c.id]=c;if(a.isDefault)b._defaultCallback=a.callback,b._defaultButton=c;b.$buttonContainer.appendChild(c)})}},_makeModal:function(){var b=this;this.$frame.addEventListener("blur",function(a){b.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var e=!g.contains(b.$frame,a.target);if(e)for(var c=0;c<
b.$$modalExclusions.length;c++)if(g.contains(b.$$modalExclusions[c],a.target)){e=!1;break}e&&(window.setTimeout(function(){(b.$lastFocusedElement||b.$parent).focus()},0),g.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var a=this.$frameParent.childNodes,c=!1;this._addedBackdrop=[];for(var f=0;f<a.length;f++){for(var e=0;e<this.$$modalExclusions.length;e++)if(g.contains(this.$$modalExclusions[e],a[f])){c=
!0;break}!c&&a[f]!==b.$frame&&a[f].classList&&!a[f].classList.contains("tooltipContainer")&&(e=a[f],e.classList.contains("modalBackdrop")||(e.classList.add("modalBackdrop"),this._addedBackdrop.push(e)))}(a=g.lastTabbable(this.$buttonContainer)||g.lastTabbable(this.$parent))&&a.addEventListener("keydown",function(a){if(a.keyCode===g.KEY.TAB){var e=b._getFirstFocusField();e&&e!==a.target&&e.focus();g.stop(a)}},!1)},_addChildDialog:function(b){this.$$modalExclusions.push(b.$frame||b.$parent)},_bindElements:function(b){for(var a=
0;a<b.childNodes.length;a++){var c=b.childNodes[a];c.id&&(this["$"+c.id]=c);this._bindElements(c)}},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 b=this;this.keepAlive||window.setTimeout(function(){b.destroy()},
0)},show:function(b){typeof this._beforeShowing==="function"&&this._beforeShowing();var a=g.bounds(this.$frame),c=g.bounds(document.documentElement),f;b?(f=g.bounds(b),b=f.top+f.height+4,f=f.left+4,b+a.height>c.height&&(b=Math.max(0,c.height-a.height-4)),f+a.width>c.width&&(f=Math.max(0,c.width-a.width-4))):(f=Math.max(0,(c.width-a.width)/2),b=Math.max(0,(c.height-a.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=b+"px";this.$frame.style.left=f+"px";this.$frame.classList.add("dialogShowing");
typeof this._afterShowing==="function"&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return g.firstTabbable(this.$parent)||this._defaultButton||g.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(b){b.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}};c.prototype.constructor=c;return{Dialog:c}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages,orion/crawler/searchCrawler,orion/contentTypes,require,orion/webui/littlelib,orion/util,orion/webui/dialog".split(","),function(i,k,g,d,c,b,a){function h(a){this._init(a)}h.prototype=new a.Dialog;h.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="'+d.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>';h.prototype._init=function(a){this.title=a.title||i["Find File Named"];this.modal=!0;this.messages=i;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=new g.ContentTypeService(this._searcher.registry);
if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=a.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=a.initialText;this._message=a.message;this._nameSearch=!0;if(a.nameSearch!==void 0)this._nameSearch=a.nameSearch;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(i["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||
typeof this._searchRenderer.makeRenderFunction!=="function")throw Error(i["Missing required argument: searchRenderer"]);this._favService=a.favoriteService;if(!this._favService)throw Error(i["Missing required argument: favService"]);this._initialize()};h.prototype._bindToDom=function(a){var b=this;b.$crawlingProgress.style.display="none";this.$fileName.setAttribute("placeholder",i.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(a){if(a.keyCode===c.KEY.ENTER){var f=c.$("a",b.$results);f&&(c.stop(a),window.open(f.href),b.hide())}},!1);a.addEventListener("keydown",function(a){var f,d,h,g,i;if(a.keyCode===c.KEY.DOWN||a.keyCode===c.KEY.UP)d=c.$$array("a",b.$results),f=c.$$array("a",b.$favresults),h=document.activeElement,i=d.indexOf(h),g=f.indexOf(h),a.keyCode===c.KEY.DOWN?g>=0?(g<f.length-1?f[g+1]:d.length>0?d[0]:f[0]).focus():
i>=0?(i<d.length-1?d[i+1]:f.length>0?f[0]:d[0]).focus():(d.length>0||f.length>0)&&(-1<f.length-1?f[0]:d[0]).focus():g>=0?(h=b.$fileName,(g>0?f[g-1]:h).focus()):i>=0?(h=b.$fileName,(i>0?d[i-1]:f.length>0?f[f.length-1]:h).focus()):d.length>0?d[d.length-1].focus():f.length>0&&f[f.length-1].focus(),c.stop(a)});a.addEventListener("mouseup",function(a){a.target.focus()},!1);this.populateFavorites();setTimeout(function(){if(b._forceUseCrawler||!b._fileService.getService(b._searcher.getSearchLocation()).search){var a=
b._searchOnRoot?b._searcher.getSearchRootLocation():b._searcher.getChildrenLocation(),a=new k.SearchCrawler(b._searcher.registry,b._fileService,"",{searchOnName:!0,location:a});b._searcher.setCrawler(a);a.buildSkeleton(function(){b.$crawlingProgress.style.display="inline";b.$progress.appendChild(document.createTextNode(i["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()};h.prototype.populateFavorites=function(){var a=document.createElement("div");a.appendChild(document.createTextNode(i["Populating favorites&#x2026;"]));c.empty(this.$favresults);this.$favresults.appendChild(a);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())};h.prototype.showFavorites=function(){var a=this;return function(b){if(b.navigator)b=b.navigator;a._searchRenderer.makeRenderFunction(a._contentTypeService,a.$favresults,!1,a.decorateResult.bind(a),a.showFavoritesImage)(b);if(b&&b.length>0)b=document.createElement("div"),b.style.borderBottom="1px dashed #BBBBBB",b.style.padding="5px",a.$favresults.appendChild(b)}};h.prototype.showFavoritesImage=function(a){var b=new Image;
b.classList.add("modelDecorationSprite");b.classList.add("core-sprite-favorite");b.src=d.toUrl("images/none.png");b.title=i.Favorite;a.appendChild(b);b.style.verticalAlign="middle"};h.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var a=(new Date).getTime();a-this._time>this._searchDelay?(this._time=a,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};h.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var e=this._searcher.createSearchParams(a,
this._nameSearch,this._searchOnRoot),d=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=d;var h=document.createElement("div");h.appendChild(document.createTextNode(this._nameSearch?i["Searching..."]:b.formatMessage(i["Searching for occurrences of"],a)));c.empty(this.$results);this.$results.appendChild(h);this._searcher.search(e,!1,function(){d===this.currentSearch&&d.apply(null,arguments)}.bind(this))}};h.prototype.decorateResult=
function(a){for(var b=this,a=c.$$array("a",a),d=0;d<a.length;d++){var h=a[d];h.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&b.hide()},!1);h.addEventListener("keyup",function(a){a.keyCode===c.KEY.ENTER&&b.hide()},!1)}};h.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};h.prototype._afterHiding=function(){this._onHide&&this._onHide()};h.prototype.constructor=h;return{OpenResourceDialog:h}});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(i){Array.prototype.slice.call(arguments,1).forEach(function(k){for(var g=Object.keys(k),d=0;d<g.length;d++){var c=g[d];i[c]=k[c]}})}}});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(i,k){function g(d,c,b){this.CLEAR_PANEL=b!==null?b:!0;this.OPEN="false";b="";d.nodeType?this.node=d:(b=d+"_",d=document.getElementById(d),this.node=d.nodeType?d:document.createElement("span"));this.node.innerHTML=this.templateString;this.navLabelId=b+"navigationlabel";document.getElementById("navigationlabel").id=this.navLabelId;this.arrowId=b+"dropDownArrow";document.getElementById("dropDownArrow").id=this.arrowId;
this.navDropDownId=b+"navdropdown";document.getElementById("navdropdown").id=this.navDropDownId;if(c.icon)this.node.className=this.node.className+" "+c.icon,this.node.onclick=this.click.bind(this);else{if(c.label)d=document.getElementById(this.navLabelId),d.textContent=c.label,d.onclick=this.click.bind(this);if(c.caret)document.getElementById(this.arrowId).className=c.caret}this._dropdownNode=k.node(this.navDropDownId);this._triggerNode=k.node(this.navLabelId)}i.mixin(g.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 d=document.getElementById(this.navDropDownId);d.style.display==="none"?this.updateContent(this.getContentNode(),function(){d.style.display="";this._positionDropdown();this.handle=k.addAutoDismiss([this.node,d],this.clearPanel.bind(this))}.bind(this)):this.CLEAR_PANEL&&this.clearPanel()},clearPanel:function(){document.getElementById(this.navDropDownId).style.display="none"},addContent:function(d){document.getElementById(this.navDropDownId).innerHTML=d},getContentNode:function(){return document.getElementById(this.navDropDownId)},
updateContent:function(d,c){c()},toggleLabel:function(d){document.getElementById(this.navLabelId).style.display=d?"":"none";document.getElementById(this.arrowId).style.display=d?"":"none"},_positionDropdown:function(){this._dropdownNode.style.left="";var d=k.bounds(this._dropdownNode),c=k.bounds(this._boundingNode(this._triggerNode));if(d.left+d.width>c.left+c.width)this._dropdownNode.style.right=0},_boundingNode:function(d){return d.style.right!==""||d.style.position==="absolute"||!d.parentNode||
!d.parentNode.style?d:this._boundingNode(d.parentNode)},destroy:function(){if(this.node)k.empty(this.node),this.node=this.select=null}});return g});
define("orion/widgets/input/GroupedContent",["orion/objects","orion/webui/littlelib"],function(i){function k(){}i.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(i,k){var g={root:k};Object.keys(i).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=i[d])});return g});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(i,k,g){function d(a,b,c){if(!a[b])throw b+i[" is not supported in this file system"];return a[b].apply(a,c)}function c(a,b,f,e){if(!a.readBlob)throw i["source file service does not support binary read"];if(!f.writeBlob)throw i["target file service does not support binary write"];if(b[b.length-1]!=="/")return d(a,"readBlob",[b]).then(function(a){return d(f,"writeBlob",[e,a])});var j=e.substring(0,
e.length-1),m=decodeURIComponent(j.substring(j.lastIndexOf("/")+1)),j=j.substring(0,j.lastIndexOf("/")+1);return d(f,"createFolder",[j,m]).then(function(){},function(){}).then(function(){return d(a,"fetchChildren",[b]).then(function(b){for(var d=[],j=0;j<b.length;++j){var h=b[j].Location,m=h;b[j].Directory&&(m=h.substring(0,h.length-1));m=decodeURIComponent(m.substring(m.lastIndexOf("/")+1));m=e+encodeURIComponent(m);b[j].Directory&&(m+="/");d[j]=c(a,h,f,m)}return k.all(d)})})}function b(a,b){function c(a){var b=
new k;b.reject(i["No Matching FileService for location:"]+a);return b}var e=a.getServiceReferences("orion.core.file"),d=e;if(b)for(var d=[],m=0;m<e.length;++m)b(e[m])&&d.push(e[m]);for(var o=[],n=[],p=[],s=[],q={fetchChildren:function(){var a=new k;a.resolve(s);return a},createWorkspace:function(){var a=new k;a.reject(i["no file service"]);return a},loadWorkspaces:function(){var a=new k;a.reject(i["no file service"]);return a},loadWorkspace:function(){var a=new k;window.setTimeout(function(){a.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:i["File Servers"],Location:"/",Children:s,ChildrenLocation:"/"})},100);return a},search:c,createProject:c,createFolder:c,createFile:c,deleteFile:c,moveFile:c,copyFile:c,read:c,write:c},e=0;e<d.length;++e)s[e]={Directory:!0,Length:0,LocalTimeStamp:0,Location:d[e].getProperty("top"),ChildrenLocation:d[e].getProperty("top"),Name:d[e].getProperty("Name")},m=d[e].getProperty("pattern")||".*",m[0]!=="^"&&(m="^"+m),o[e]=RegExp(m),n[e]=a.getService(d[e]),p[e]=d[e].getProperty("Name"),
d[e].getProperty("NameKey")&&d[e].getProperty("nls")&&g.getMessageBundle(d[e].getProperty("nls")).then(function(a,b){s[a].Name=b[d[a].getProperty("NameKey")];p[a]=b[d[a].getProperty("NameKey")]}.bind(this,e));this._getServiceIndex=function(a){if(a==="/")return-1;else if(!a||a.length&&a.length===0)return n[0]?0:-1;for(var b=0;b<o.length;++b)if(o[b].test(a))return b;throw i["No Matching FileService for location:"]+a;};this._getService=function(a){a=this._getServiceIndex(a);return a===-1?q:n[a]};this._getServiceName=
function(a){a=this._getServiceIndex(a);return a===-1?q.Name:p[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return a===-1?q.Location:s[a].Location}}b.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 d(this._getService(a),"fetchChildren",arguments)},createWorkspace:function(a){return d(this._getService(),"createWorkspace",
arguments)},loadWorkspaces:function(){return d(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(a){return d(this._getService(a),"loadWorkspace",arguments)},createProject:function(a,b,c,e){return d(this._getService(a),"createProject",arguments)},createFolder:function(a,b){return d(this._getService(a),"createFolder",arguments)},createFile:function(a,b){return d(this._getService(a),"createFile",arguments)},deleteFile:function(a){return d(this._getService(a),"deleteFile",arguments)},
moveFile:function(a,b,f){var e=this._getService(a),j=this._getService(b);if(e===j)return d(e,"moveFile",arguments);var m=a[a.length-1]==="/",o=b;o[o.length-1]!=="/"&&(o+="/");if(f)o+=encodeURIComponent(f);else{var n=a;m&&(n=n.substring(0,n.length-1));o+=n.substring(n.lastIndexOf("/")+1)}m&&o[o.length-1]!=="/"&&(o+="/");return c(e,a,j,o).then(function(){return d(e,"deleteFile",[a])})},copyFile:function(a,b,f){var e=this._getService(a),j=this._getService(b);if(e===j)return d(e,"copyFile",arguments);
var m=a[a.length-1]==="/",o=b;o[o.length-1]!=="/"&&(o+="/");if(f)o+=encodeURIComponent(f);else{var n=a;m&&(n=n.substring(0,n.length-1));o+=n.substring(n.lastIndexOf("/")+1)}m&&o[o.length-1]!=="/"&&(o+="/");return c(e,a,j,o)},read:function(a,b){return d(this._getService(a),"read",arguments)},write:function(a,b,c){return d(this._getService(a),"write",arguments)},remoteImport:function(a,b){return d(this._getService(a),"remoteImport",arguments)},remoteExport:function(a,b){return d(this._getService(a),
"remoteExport",arguments)},search:function(a){return d(this._getService(a.resource),"search",arguments)}};b.prototype.constructor=b;return{FileClient:b}});
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(i,
k,g,d,c,b,a,h,f,e,j,m,o,n,p,s,q,r,t,l,u,y,w,v,A,E,D,z,G,L,H,J,R){function O(a,b){if(a.getLabel)return a.getLabel();else{var l=new y;l.resolve(b.properties.name);return l}}function T(a){m.node("progressPane").setAttribute("aria-label",i["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function U(a,b){var l=a.getServiceReferences("orion.core.auth");P=[];for(var e=I.createMenuGenerator.apply(this,arguments),c=0;c<l.length;c++){var f=
l[c],d=a.getService(f);O(d,f).then(function(a){d.getKey().then(function(b){P.push(b);d.getUser().then(function(l){e.addUserItem(b,d,a,l)},function(l,c){e.addUserItem(b,d,a,c)});window.addEventListener("storage",function(){M[b]!==localStorage.getItem(b)&&(M[b]=localStorage.getItem(b),d.getUser().then(function(l){e.addUserItem(b,d,a,l)},function(){e.addUserItem(b,d,a)}))},!1)})})}}function x(a,l,e,c,f){var d=arguments,j,w=a&&a.getServiceReferences("orion.page.link.related");w&&w.length!==0&&y.when(function(){if(j)return j;
var b=a.getService("orion.core.contenttypes");b||(b=new q.ContentTypeService(a),b=a.getService("orion.core.contenttypes"));return b.getContentTypes().then(function(a){return j=a})}(),function(){var u;if(I.beforeGenerateRelatedLinks.apply(this,d)){for(var m=[],o=0;o<w.length;o++){var n={},g,v=w[o].getPropertyKeys();for(g=0;g<v.length;g++)n[v[g]]=w[o].getProperty(v[g]);if(n.id){var i=function(a){if(a)if(!a.visibleWhen||a.visibleWhen(l)){var e=new b.CommandInvocation(l,l,null,a,c);I.addRelatedLinkCommand(a,
e)}else typeof f==="function"&&(u||(u=f()),y.when(u,function(e){e&&l===N&&(!a.visibleWhen||a.visibleWhen(e))&&I.addRelatedLinkCommand(a,new b.CommandInvocation(e,e,null,a,c))}))},p=null;g=null;if(e.indexOf(n.id)<0)if((n.nls&&n.nameKey||n.name)&&n.uriTemplate)g=h._createCommandOptions(n,w[o],a,j,!0),m.push(g),g.then(function(a){a=new b.Command(a);i(a)});else{if(!p&&(p=c.findCommand(n.id))){i(p);continue}if(!p){var A=a.getServiceReferences("orion.navigate.command");for(g=0;g<A.length;g++)if(A[g].getProperty("id")===
n.id){for(var n={},v=A[g].getPropertyKeys(),k=0;k<v.length;k++)n[v[k]]=A[g].getProperty(v[k]);g=h._createCommandOptions(n,A[g],a,j,!0);m.push(g);g.then(function(a){p=new b.Command(a);i(p)});break}}}}}y.all(m,function(a){return a}).then(function(){I.afterGenerateRelatedLinks.apply(this,d)})}})}function B(a){var b=m.node("globalActions");b&&(a.destroy(b),a.renderCommands(b.id,b,{},{},"tool"))}function C(a){var b={},l=null;typeof a==="string"&&(a=m.node(a));a||(a=m.node("pageActions"));for(var e=a;e&&
e.classList;){if(e.classList.contains("toolComposite")){l=e;break}e=e.parentNode}if(a.classList.contains("commandMarker"))b.commandNode=a;if(l&&(b.slideContainer=m.$(".slideParameters",l),b.parameterArea=m.$(".parameters",l),b.dismissArea=m.$(".parametersDismiss",l),b.notifications=m.$("#notificationArea",l),l.parentNode&&(b.toolbarTarget=m.$(".toolbarTarget",l.parentNode),b.toolbarTarget)))a=m.bounds(l),b.toolbarTargetY=a.height+1;return b}function F(a){if(a.toolbarTarget&&a.toolbarTargetY){var b=
0,l;a.notifications&&a.notifications.classList.contains("slideContainerActive")&&(l=m.bounds(a.notifications),b+=l.height);a.slideContainer&&a.slideContainer.classList.contains("slideContainerActive")&&(l=m.bounds(a.slideContainer),b+=l.height);b>0&&(b+=8);a.toolbarTarget.style.top=a.toolbarTargetY+b+"px";a.toolbarTarget.style.bottom=0}}var c=function(a){var b=document.createElement("a");b.href=a;return b.href}(k.toUrl("auth/NotifyAuthentication.html")),M={},I={createMenuGenerator:J.createMenuGenerator||
function(a,b){if(m.node("userMenu")){var l=m.node("userDropdown"),e=new n.Dropdown({dropdown:l}),l=new w.UserMenu({dropdownNode:l,dropdown:e,serviceRegistry:a}),e=m.node("userTrigger");new p.Tooltip({node:e,text:i.Options,position:["below","left"]});var e=document.getElementById("userTrigger"),c=e.className;c+=" imageSprite core-sprite-silhouette";e.className=c;l.setKeyAssist(b);return l}},beforeGenerateRelatedLinks:J.beforeGenerateRelatedLinks||function(){var a=m.node("relatedLinks");m.empty(a);
return!0},addRelatedLinkCommand:J.addRelatedLinkCommand||function(a,l){var e=m.node("relatedLinks");b.createCommandMenuItem(e,a,l).classList.remove("dropdownMenuItem")},afterGenerateRelatedLinks:J.afterGenerateRelatedLinks||function(){},afterSetPageTarget:J.afterSetPageTarget||function(){},generateNavigationMenu:J.generateNavigationMenu||function(){var a=document.getElementById("centralNavigation");new p.Tooltip({node:a,text:"Navigation Menu",position:["right"]});var a=new G("centralNavigation",{label:"Develop",
icon:"commandSprite core-sprite-hamburger"}),b=new L;a.addContent(b.getContentPane())},afterGenerateBanner:J.afterGenerateBanner||function(){}},P=[],N,S=[],K,Q=null;return{addSettings:function(a){(new G("settingsTab",{label:"Develop",icon:"imageSprite core-sprite-wrench"},!1)).updateContent=a.updateContent.bind(a)},generateBanner:function(e,c,j,h,w,y,n){function p(){this.create();this._filterString=""}function G(a){a.registerService("orion.cm.managedservice",{updated:function(a){for(var a=a&&a["links.newtab"]!==
"undefined"?a["links.newtab"]?"_blank":"_self":"_self",b=m.$$array(".targetSelector"),l=0;l<b.length;l++)b[l].target=a}},{pid:"nav.config"})}(new l.ThemePreferences(h,new u.ThemeData)).apply();var q=m.node(e);if(!q)throw i["could not find banner parent, id was "]+e;var r=document.createRange();r.selectNode(q);r=r.createContextualFragment(E);m.processTextNodes(r,i);q.firstChild?q.insertBefore(r,q.firstChild):q.appendChild(r);q=m.node("home");q.href=k.toUrl("navigate/table.html");q.setAttribute("aria-label",
i["Orion Home"]);m.node("progressPane").src=k.toUrl("images/none.png");if(q=m.node("pageToolbar"))q.classList.add("toolbarLayout"),q.innerHTML=z+g.slideoutHTMLFragment("mainToolbar");(q=m.node("closeNotifications"))&&q.setAttribute("aria-label",i["Close notification"]);if(q=m.node("footer"))q.innerHTML=D,m.processTextNodes(q,i);j.setParameterCollector(new a.CommandParameterCollector(C,F));document.addEventListener("keydown",function(a){a.keyCode===m.KEY.ESCAPE&&(a=c.getService("orion.page.message"))&&
a.setProgressMessage("")},!1);I.generateNavigationMenu.apply(this,arguments);var L=m.node("navigationlinks");L&&v.createPageLinks(c,"orion.page.link").then(function(a){a.forEach(function(a){var b=document.createElement("li");b.appendChild(a);L.appendChild(b)})});if(q=m.$(".split")){var r=m.$(".sidePanelLayout"),t=m.$(".mainPanelLayout");if(r&&t)Q={side:r,main:t},Q.splitter=new o.Splitter({node:q,sidePanel:r,mainPanel:t,toggle:!0,closeByDefault:q.style&&q.style.left==="0%"}),q=new b.Command({name:i["Toggle side panel"],
tooltip:i["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){Q.splitter.toggleSidePanel()}}),j.addCommand(q),j.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new d.KeyBinding("o",!0)),n&&Q.splitter.addResizeListener(function(a){n&&a===t&&(a=n.getTextView())&&a.resize()})}q=new b.Command({name:i["Make Favorite"],tooltip:i["Add to the favorites list"],imageClass:"core-sprite-favorite",id:"orion.makeFavorite",visibleWhen:function(a){a=Array.isArray(a)?
a:[a];if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!a[b].Location)return!1;return!0},callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],b=c.getService("orion.core.favorite"),l=c.getService("orion.page.progress"),e=function(a){return function(e){e?c.getService("orion.page.message").setMessage(a.Name+i[" is already a favorite."],2E3):l.progress(b.makeFavorites(a),"Making favorite "+a.Name)}},f=0;f<a.length;f++){var d=a[f];l.progress(b.hasFavorite(d.ChildrenLocation||d.Location),
"Checking favorite "+d.Name).then(e(d))}}});j.addCommand(q);var J=!1,R=function(a,b,l){if(!J){var e=b.getService("orion.core.favorite"),c=b.getService("orion.page.progress");e||(e=new s.FavoritesService({serviceRegistry:b}),e=b.getService("orion.core.favorite"));var f=new A.OpenResourceDialog({searcher:a,progress:c,searchRenderer:a.defaultRenderer,favoriteService:e,onHide:function(){J=!1;l&&l.getTextView()&&l.getTextView().focus()}});window.setTimeout(function(){J=!0;f.show()},0)}},q=new b.Command({name:i["Find File Named..."],
tooltip:i["Choose a file by name and open an editor on it"],id:"eclipse.openResource",callback:function(){R(w,c,n)}});j.addCommand(q);j.registerCommandContribution("globalActions","eclipse.openResource",100,null,!0,new d.KeyBinding("f",!0,!0));q=new b.Command({name:i["Toggle banner and footer"],tooltip:i["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var a=m.node("banner"),b=m.node("footer"),l=m.$(".content-fixedHeight");a.style.visibility==="hidden"?(a.style.visibility=
"visible",b.style.visibility="visible",l.classList.remove("content-fixedHeight-maximized")):(a.style.visibility="hidden",b.style.visibility="hidden",l.classList.add("content-fixedHeight-maximized"));n&&n.getTextView()&&n.getTextView().resize();return!0}});j.addCommand(q);j.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new d.KeyBinding("m",!0,!0));q=new b.Command({name:i["System Configuration Details"],tooltip:i["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});
j.addCommand(q);j.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new d.KeyBinding(112,!0,!0));q=new b.Command({name:i["Background Operations"],tooltip:i["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});j.addCommand(q);j.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new d.KeyBinding("o",!0,!0));p.prototype={create:function(){var a=this._keyAssistDiv=
document.createElement("div");a.id="keyAssist";a.style.display="none";a.classList.add("keyAssistFloat");a.setAttribute("role","menu");var b=this._keyAssistInput=document.createElement("input");b.classList.add("keyAssistInput");b.type="text";b.placeholder=i["Filter bindings"];a.appendChild(b);var l=this._keyAssistContents=document.createElement("div");l.classList.add("keyAssistContents");if(H.isIOS||H.isAndroid)l.style.overflowY="auto";a.appendChild(l);var e=this._keyAssistTable=document.createElement("table");
e.tabIndex=0;e.classList.add("keyAssistList");l.appendChild(e);document.body.appendChild(a);b.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));e.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));b.addEventListener("input",function(){this.filterChanged()}.bind(this));l.addEventListener(H.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===m.KEY.ESCAPE&&this.hide()}.bind(this));
m.addAutoDismiss([a],function(){this.hide()}.bind(this))},createContents:function(){m.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;this._idCount=this._keyAssistContents.scrollTop=0;if(n&&n.getTextView()){var a=n.getTextView(),b=a.getActions(!0).filter(function(b){return(b=a.getActionDescription(b))&&b.name});b.sort(function(b,l){return a.getActionDescription(b).name.localeCompare(a.getActionDescription(l).name)});this.createHeader(i.Editor);for(var l=function(b){return function(){a.focus();
return a.invokeAction(b)}},e={},c,d=0;d<b.length;d++)for(var h=b[d],w=a.getActionDescription(h),u=a.getKeyBindings(h),o=0;o<u.length;o++){c=u[o];var y=f.getUserKeyString(c);c.scopeName?(e[c.scopeName]||(e[c.scopeName]=[]),e[c.scopeName].push({bindingString:y,name:w.name,execute:l(h)})):this.createItem(y,w.name,l(h))}for(var g in e)if(e[g].length){this.createHeader(g);for(b=0;b<e[g].length;b++)c=e[g][b],this.createItem(c.bindingString,c.name,c.execute)}}this.createHeader(i.Global);j.showKeyBindings(this)},
createItem:function(a,b,l){if(this._filterString){var e=this._filterString.toLowerCase(),c;e!==this._filterString?(e=this._filterString,c=function(a){return a}):c=function(a){return a.toLowerCase()};if(c(b).indexOf(e)===-1&&c(a).indexOf(e)===-1&&c(this._lastHeader).indexOf(e)===-1)return}var f=this._keyAssistTable.insertRow(-1);f.id="keyAssist-keyBinding-"+this._idCount++;f.setAttribute("role","menuitem");f._execute=l;f.classList.add("keyAssistItem");f.addEventListener("click",function(a){this._selectedRow=
f;this.execute();a.preventDefault()}.bind(this));l=f.insertCell(-1);l.classList.add("keyAssistName");l.appendChild(document.createTextNode(b));l=f.insertCell(-1);l.classList.add("keyAssistAccel");l.appendChild(document.createTextNode(a))},createHeader:function(a){this._lastHeader=a;var b=this._keyAssistTable.insertRow(-1);b.classList.add("keyAssistSection");var b=b.insertCell(-1),l=document.createElement("h2");l.appendChild(document.createTextNode(a));b.appendChild(l)},execute:function(){window.setTimeout(function(){this.hide();
var a=this._selectedRow;this._selectedRow=null;a&&a._execute&&a._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var a=this._keyAssistInput.value;if(this._filterString!==a)this._filterString=a,this.createContents()}.bind(this),100)},hide:function(){var a=document.activeElement,b=this._keyAssistDiv,a=b===a||(b.compareDocumentPosition(a)&16)!==0;b.style.display="none";a&&document.compareDocumentPosition(this._previousActiveElement)!==
1&&this._previousActiveElement.focus();this._previousActiveElement=null},isVisible:function(){return this._keyAssistDiv.style.display==="block"},select:function(a){var b=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(b.length===0)this._selectedIndex=-1;else{var l=this._selectedIndex;l+=a?1:-1;l%=b.length;l<0&&(l=b.length-1);if(this._selectedIndex!==-1)a=b[this._selectedIndex],a.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=l;if(this._selectedIndex!==-1){this._selectedRow=
a=b[this._selectedIndex];a.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",a.id);this._keyAssistTable.focus();var b=a.getBoundingClientRect(),e=this._keyAssistContents,c=e.getBoundingClientRect();a.offsetTop<e.scrollTop?l===0?e.scrollTop=0:a.scrollIntoView(!0):b.bottom>c.bottom&&a.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(a){if(a.keyCode===40)this.select(!0);else if(a.keyCode===38)this.select(!1);else if(a.keyCode===13)this.execute();else return;a.preventDefault()},_scrollWheel:function(a){var b=0,b=H.isIE||H.isOpera?-a.wheelDelta:H.isFirefox?a.detail*40:-a.wheelDeltaY,l=this._keyAssistContents,e=l.scrollTop;l.scrollTop+=b;if(e!==l.scrollTop)return a.preventDefault&&
a.preventDefault(),!1}};var O=new p,x=new b.Command({name:i["Show Keys"],tooltip:i["Show a list of all the keybindings on this page"],id:"eclipse.keyAssist",callback:function(){O.isVisible()?O.hide():O.show();return!0}});j.addCommand(x);j.registerCommandContribution("globalActions","eclipse.keyAssist",100,null,!0,new d.KeyBinding(191,!1,!0));q=function(){n.getTextView().setKeyBinding(new d.KeyBinding(191,!1,!0,!H.isMac,H.isMac),x.id);n.getTextView().setAction(x.id,x.callback,x)};n&&(n.getTextView()?
q():n.addEventListener("TextViewInstalled",q));B(j);U(c,x.callback);T(c);window.addEventListener("hashchange",function(){j.processURL(window.location.href)},!1);window.setTimeout(function(){G(c)},0);I.afterGenerateBanner.apply(this,arguments)},getToolbarElements:C,getMainSplitter:function(){return Q},layoutToolbarElements:F,setPageTarget:function(a){var b,l,e=a.breadcrumbRootName,c=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&!a.breadcrumbTarget&&
(l=e?e+" ":"",l+=a.fileService.fileServiceName(a.target.Location),e=null),b=a.name||a.target.Name,N=a.target,x(c,a.target,S,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(e=e||a.task||a.name),b=a.name,x(c,{NoTarget:""},S,a.commandService,a.makeAlternate));(K=a.title)||(K=b?b+" - "+a.task:a.task);window.document.title=K;I.afterSetPageTarget.apply(this,arguments);if(b=m.node("location")){m.empty(b);var f=c&&new R.FileClient(c),c=a.breadcrumbTarget||a.target,f=f&&c&&c.Location?f.fileServiceRootURL(c.Location):
null;new j.BreadCrumbs({container:b,resource:c,rootSegmentName:e,workspaceRootSegmentName:l,workspaceRootURL:f,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){if(K)K.charAt(0)==="*"&&!a&&(K=K.substring(1)),a&&K.charAt(0)!=="*"&&(K="*"+K),window.document.title=K;var b=m.node("dirty");if(b)b.textContent=a?"*":""},setPageCommandExclusions:function(a){S=a},notifyAuthenticationSite:c}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(i){return{detectValidURL:function(k){for(var g=/\[([^\]]*)\]\(([^\)]+)\)/g,d=g.exec(k),c=[],b=0;d;){if(d.length===3&&d[2].length>0){var a=new URL(d[2]);a.protocol!==":"&&i.validateURLScheme(a.href)&&(d.index>b&&c.push({segmentStr:k.substring(b,d.index)}),c.push({segmentStr:d[1].length>0?d[1]:d[2],urlStr:d[2]}),b=d.index+d[0].length)}d=g.exec(k)}if(b===0)return null;b<k.length-1&&c.push({segmentStr:k.substring(b)});return c},processURLSegments:function(i,
g){g.forEach(function(d){if(d.urlStr){var c=document.createElement("a");c.href=d.urlStr;c.appendChild(document.createTextNode(d.segmentStr))}else c=document.createElement("span"),c.textContent=d.segmentStr;i.appendChild(c)})}}});
define("orion/status",["require","orion/webui/littlelib","orion/globalCommands","orion/PageUtil","orion/urlUtils"],function(i,k,g,d,c){function b(a,b,e,c,d){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.message",this);this._operationsClient=b;this.notificationContainerDomId=d;this.domId=e;this.progressDomId=c||e;this._hookedClose=!1;this._timer=null}var a;b.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=g.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(a,b,e){this._init();this.currentMessage=a;var c=k.node(this.domId);if(typeof e==="boolean"){var d=c.getAttribute("aria-live");c.setAttribute("aria-live",e?"polite":"off");window.setTimeout(function(){a===
this.currentMessage&&(k.empty(c),c.appendChild(document.createTextNode(a)),window.setTimeout(function(){c.setAttribute("aria-live",d)},100))}.bind(this),100)}else k.empty(c),c.appendChild(document.createTextNode(a));typeof b==="number"&&window.setTimeout(function(){a===this.currentMessage&&(k.empty(c),c.appendChild(document.createTextNode("")))}.bind(this),b)},setErrorMessage:function(a){this.currentMessage=a;this._init();var b=a.responseText||a.message||a;if(typeof b==="string")try{b=JSON.parse(b)}catch(e){}var a=
b.Message||b,c="red";if(b.Severity)switch(b.Severity){case "Warning":c="#FFCC00";break;case "Error":c="red";break;case "Info":case "Ok":c="green"}b=document.createElement("span");b.style.color=c;b.appendChild(document.createTextNode(a));a=k.node(this.domId);k.empty(a);a.appendChild(b)},setProgressMessage:function(a){this._init();this.currentMessage=a;var b=document.createElement("span");b.classList.add("imageSprite");b.classList.add("progressIcon");b.classList.add("core-sprite-progress");var e=k.node(this.progressDomId);
k.empty(e);e.appendChild(b);e.appendChild(document.createTextNode(a));b=k.node(this.notificationContainerDomId);b.classList.remove("notificationHide");if(a&&a.length>0)b.classList.add("progressNormal"),b.classList.add("notificationShow");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();else b.classList.remove("notificationShow"),b.classList.add("notificationHide")},setProgressResult:function(a){this.currentMessage=a;var b=a.responseText||a;if(typeof b===
"string")try{b=JSON.parse(b)}catch(e){}this._init();var d=b.Message||b,m="core-sprite-information",o="progressInfo",n=document.createElement("span");n.classList.add("imageSprite");n.classList.add("progressIcon");a=[];if(b.Severity)switch(b.Severity){case "Warning":m="core-sprite-warning";o="progressWarning";a.push("progressInfo");a.push("progressError");a.push("progressNormal");break;case "Error":m="core-sprite-error";o="progressError";a.push("progressWarning");a.push("progressInfo");a.push("progressNormal");
break;default:a.push("progressWarning"),a.push("progressError"),a.push("progressNormal")}a.push("notificationHide");n.classList.add(m);var g=k.node(this.progressDomId),m=k.node(this.notificationContainerDomId);k.empty(g);g.appendChild(n);if(b.HTML)b=document.createElement("span"),b.innerHTML=d,g.appendChild(b);else{if(n=c.detectValidURL(d))d=document.createDocumentFragment(),c.processURLSegments(d,n),Array.prototype.forEach.call(k.$$("a",d),function(a){a.target="_blank"});else{if(b.Severity!=="Warning"&&
b.Severity!=="Error")this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3);d=document.createTextNode(d)}g.appendChild(d)}if(o&&this.progressDomId!==this.domId){m.classList.add(o);for(o=0;o<a.length;o++)m.classList.remove(a[o])}m.classList.add("notificationShow")},showWhile:function(a,b){var e=this;if(b){e.setProgressMessage(b);var c=function(){b===e.currentMessage&&e.setProgressMessage("")};a.then(c,c)}return a},
_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(b,c){return new a(this,++this._lastProgressId,b,c)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var a="",b=!0,e;for(e in this._progressMonitors)this._progressMonitors[e].status&&(b||(a+=", "),a+=this._progressMonitors[e].status,b=!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()}};b.prototype.constructor=b;a=function(a,b,e,c){this.statusService=a;this.progressId=b;if(e){this.deferred=e;this.begin(c);var d=this;e.then(function(){d.done.bind(d)()},function(){d.done.bind(d)()})}};
a.prototype.begin=function(a){this.status=a;this.statusService._beginProgressMonitor(this)};a.prototype.done=function(a){this.status=a;this.statusService._doneProgressMonitor(this)};a.prototype.worked=function(a){this.status=a;this.statusService._workedProgressMonitor(this)};a.prototype.constructor=a;return{StatusReportingService:b,ProgressMonitor:a}});
define("orion/operations/nls/root/messages",{More:"More","No Matching OperationService for location:":"No Matching OperationService for location:","No operations services registered.":"No operations services registered.","could not find toolbar ":"could not find toolbar ","Remove Completed":"Remove Completed","Remove all completed operations":"Remove all completed operations",Remove:"Remove","Remove operations from the operations list.":"Remove operations from the operations list.",Cancel:"Cancel",
"Cancel operations from the operations list.":"Cancel operations from the operations list.","Operation resulted in a warning.":"Operation resulted in a warning.","Operation resulted in an error.":"Operation resulted in an error.","Operation is running.":"Operation is running.","Operation is canceled.":"Operation is canceled.","Operation failed.":"Operation failed.",Name:"Name",Actions:"Actions",Status:"Status",Scheduled:"Scheduled"});
define("orion/operations/nls/messages",["orion/i18n!orion/operations/nls/messages","orion/operations/nls/root/messages"],function(i,k){var g={root:k};Object.keys(i).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=i[d])});return g});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(i,k,g,d){function c(){}c.prototype={_initialize:function(b,a,c,f,e){this._tooltip=new d.Tooltip({node:b,hideDelay:e||0,afterShowing:this._afterShowingFunction(a).bind(this),afterHiding:c,trigger:f?f:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";b=document.createRange();b.selectNode(this.$parent);b=b.createContextualFragment(this.TEMPLATE);
this.messages&&g.processTextNodes(b,i);this.$parent.appendChild(b);var j=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===g.KEY.ESCAPE&&j.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(b){for(var a=0;a<b.childNodes.length;a++){var c=b.childNodes[a];c.id&&(this["$"+c.id]=c);this._bindElements(c)}},_afterShowingFunction:function(b){return function(){b&&b.bind(this)();if(!this.customFocus){var a=
g.firstTabbable(this.$parent);a&&a.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};c.prototype.constructor=c;return{PopupDialog:c}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(i,k,g,d){var c={};(function(){var b=!1;c.updateNavTools=function(a,c,f,e,d,m){var o=g.node(e);if(o)c.destroy(o);else throw i["could not find toolbar "]+e;c.renderCommands(e,o,m,f,"button");if(d&&(e=g.node(d)))c.destroy(e),c.renderCommands(d,e,null,f,"button");b||(b=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var b=g.node(d);
b&&(c.destroy(b),c.renderCommands(d,b,a.selections,f,"button"))}))};c.createOperationsCommands=function(a,b,c){function e(a){return!a.operation||!a.operation.type?!1:a.operation.type==="loadstart"||a.operation.type==="progress"}var j=new d.Command({name:i["Remove Completed"],tooltip:i["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){c.removeCompletedOperations().then(function(){b.loadOperations.bind(b)()})},visibleWhen:function(){return!0}});a.addCommand(j);
j=new d.Command({name:i.Remove,tooltip:i["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],e=0;e<a.length;e++){var d=a[e];c.removeOperation.bind(c)(d.Location).then(function(){b.loadOperations.bind(b)()},function(){b.loadOperations.bind(b)()})}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return!e(a);for(var b in a)if(e(a[b]))return!1;return!0}});a.addCommand(j);
j=new d.Command({name:i.Cancel,tooltip:i["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],b=0;b<a.length;b++){var e=a[b];e.deferred&&e.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return e(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var b in a)if(!e(a[b])||!a[b].operation||!a[b].operation.cancelable)return!1;return!0}});a.addCommand(j)}})();
return c});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(i,k,g,d,c){function b(a){this._options=a}b.prototype=new d.PopupDialog;b.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>';b.prototype._init=
function(a){this._myOperations=[];this._operationsDeferreds=[];this._commandService=a.commandRegistry;c.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(a.triggerNode)};b.prototype._bindToDom=function(){this.$allOperationsLink.href=k.toUrl("operations/list.html");this._setOperationsVisibility()};b.prototype.setOperations=function(a,b){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(b[c]);this._renderOperations()};b.prototype.parseProgressResult=function(a){if(!a)return{};a=a.responseText||a;try{a=JSON.parse(a)}catch(b){}var c={Message:a.Message||a,Severity:a.Severity};if(a.DetailedMessage&&a.DetailedMessage!==c.Message)c.DetailedMessage=a.DetailedMessage;return c};b.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};b.prototype._renderOperationsTable=function(a,b,c){g.empty(a);for(var e=0;e<b.length;e++){var d=b[e],m=document.createElement("tr"),o=document.createElement("td");o.style.paddingLeft="5px";o.style.paddingRight="5px";o.textContent=d.Name;m.appendChild(o);var n=document.createElement("div");o.appendChild(n);o=document.createElement("span");o.style.paddingRight="5px";o.classList.add("imageSprite");switch(d.type){case "Warning":o.classList.add("core-sprite-warning");o.setAttribute("aria-label",
i["Operation resulted in a warning."]);break;case "error":o.classList.add("core-sprite-error");o.setAttribute("aria-label",i["Operation resulted in an error."]);break;case "loadstart":case "progress":o.classList.add("core-sprite-start");o.setAttribute("aria-label",i["Operation is running."]);break;case "abort":o.classList.add("core-sprite-stop");o.setAttribute("aria-label",i["Operation is canceled."]);break;case "load":case "loadend":o.classList.add("core-sprite-ok"),o.setAttribute("aria-label","Operation ok.")}n.appendChild(o);
o=document.createElement("span");o.classList.add("operationStatus");o.textContent=d.Name;n.appendChild(o);if(d.error){var p=d.error.Message||d.error;d.error.DetailedMessage&&d.error.DetailedMessage!==""&&(p+=": "+d.error.DetailedMessage);o.textContent=p;o.classList.remove("operationStatus");o.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",n,{operation:d,deferred:c[e]},this,"tool");a.appendChild(m)}this._setOperationsVisibility()};b.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"};b.prototype.constructor=b;return{OperationsDialog:b}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(i,k,g,d,c){function b(a,b){if(!this._progressPane){this._progressPane=d.node(a);this._operationsDialog=new c.OperationsDialog({triggerNode:this._progressPane,commandRegistry:b});var e=this;this._progressPane.addEventListener("keydown",function(a){(a.charOrCode===" "||a.keyCode===d.KEY.ENTER)&&e._operationsDialog.show()})}}function a(a,b,e,c){this._serviceRegistry=
a;this._serviceRegistration=a.registerService("orion.page.progress",this);this._commandRegistry=e;this._operationsClient=b;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=c}b.prototype={_switchIconTo:function(a){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=a;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(a,b){var c=
{},d;for(d in a)a[d].progressMonitor||(c[d]=a[d]);if(this._isEmpty(c))this._switchIconTo("progressPane_empty"),this._progressPane.title=i.Operations,this._progressPane.alt=i.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var m="";for(d in c){var o=c[d];if(o.type&&(o.type==="loadstart"||o.type==="progress")){m="running";break}}switch(m){case "running":this._progressPane.title=i["Operations running"];this._progressPane.alt=i["Operations running"];
this._progressPane.setAttribute("aria-valuetext",i["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=i["Some operations finished with warning"];this._progressPane.alt=i["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",i["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=i["Some operations finished with error"];this._progressPane.alt=
i["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",i["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=i.Operations,this._progressPane.alt=i.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_operations")}}this._operationsDialog.setOperations(c,b)},_isEmpty:function(a){for(var b in a)return!1;return!0}};
b.prototype.constructon=b;a.prototype={init:function(a){if(!this._progressMonitorClass)this._progressMonitorTool=new b(a,this._commandRegistry)},progress:function(a,b,c){var d=this,m=this._operationsIndex++;!c&&this._progressMonitorClass&&(c=new this._progressMonitorClass,c.begin(b));a.then(function(){if(d._operations[m]){var o=d._operations[m];if(b)o.Name=b;d._lastOperation=o;o.type="loadend";if(c)o.progressMonitor=c;d.writeOperation.bind(d)(m,o,a);o.Location||d._removeOperationFromTheList.bind(d)(m)}},
function(o){if(d._operations[m]){var n=d._operations[m];if(b)n.Name=b;if(c)n.progressMonitor=c;d._lastOperation=n;n.type=o.canceled?"abort":"error";n.error=o;d.writeOperation.bind(d)(m,n,a);n.Location||d._removeOperationFromTheList.bind(d)(m)}},function(o){if(b)o.Name=b;if(c)o.progressMonitor=c;d.writeOperation.bind(d)(m,o,a)});return a},removeOperation:function(a){for(var b in this._operations)if(this._operations[b].Location&&this._operations[b].Location===a){this._removeOperationFromTheList(b);
break}this._operationsClient.removeOperation.bind(this._operationsClient)(a)},_removeOperationFromTheList:function(a){var b=this._operations[a].progressMonitor;delete this._operations[a];delete this._operationDeferrds[a];b?b.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var a in this._operations){var b=this._operations[a];if(b.type&&b.type!=="loadstart"&&b.type!=="progress")(b=this._operations[a].progressMonitor)&&
b.done(),delete this._operations[a],delete this._operationDeferrds[a]}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(a){this._serviceRegistry.getService("orion.page.message").setProgressResult(a)},showWhile:function(a,b){b&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(b);var c=this;a.then(function(){c._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){c.setProgressResult.bind(c)(a);
return a});return this.progress(a,b)},writeOperation:function(a,b,c){this._operations[a]=b;this._operationDeferrds[a]=c;b.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(a){a.put(b.Location,{Name:b.Name,expires:b.expires})});b.progressMonitor?b.progressMonitor.progress(b.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};a.prototype.constructor=a;return{ProgressService:a}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(i,k){function g(a,b,c){return a[b].apply(a,c)}function d(a){this._location=a}function c(){var a=new k;a.reject(i["No Matching OperationService for location:"]+this._location);return a}function b(a){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=a.getService("orion.core.preference");for(var b=a.getServiceReferences("orion.core.operation"),
c=0;c<b.length;c++){var e=a.getService(b[c]);this._services[c]=e;e=b[c].getProperty("pattern")||".*";e[0]!=="^"&&(e="^"+e);this._patterns[c]=RegExp(e)}this._getService=function(a){if(!a)return this._services[0];for(var b=0;b<this._patterns.length;++b)if(this._patterns[b].test(a))return this._services[b];return new d(a)}}d.prototype={getOperation:c,getOperations:c,removeCompletedOperations:c,removeOperation:c,cancelOperation:c};d.prototype.constructor=d;b.prototype={getOperations:function(){var a=
new k;if(this._operations)return a.resolve(this._operations),a;var b=this;this._preferenceService.getPreferences("/operations").then(function(c){b._operations=c;a.resolve(b._operations)});return a},getOperation:function(a){return g(this._getService(a),"getOperation",arguments)},removeCompletedOperations:function(){for(var a=[],b=this,c=0;c<this._services.length;c++){var e=this._patterns[c],d=new k;a[c]=d.promise;g(this._services[c],"removeCompletedOperations").then(function(a){return function(c){Array.isArray(c)&&
b.getOperations.bind(b)().then(function(b){for(var d=b.keys(),f=0;f<d.length;f++){var j=d[f];e.test(j)&&c.indexOf(j)<0&&b.remove(j)}a.resolve()})}}(d),function(a){return function(b){a.reject(b)}}(d))}return k.all(a)},removeOperation:function(a){var b=this;return g(this._getService(a),"removeOperation",arguments).then(function(){b.getOperations.bind(b)().then(function(b){b.remove(a)})},function(a){return a},function(a){return a})}};b.prototype.constructor=b;return{OperationsClient:b}});
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(i,k){var g={root:k};Object.keys(i).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=i[d])});return g});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(i,k){function g(d){this._init(d)}g.prototype={_init:function(d){var c=d.parent,b=this,c=k.node(c);if(!c)throw i["no parent"];if(!d.model)throw i["no tree model"];if(!d.renderer)throw i["no renderer"];this._parent=c;this._treeModel=d.model;this._renderer=d.renderer;this._showRoot=d.showRoot===void 0?!1:d.showRoot;this._indent=d.indent===void 0?16:d.indent;this._onCollapse=d.onCollapse;this._labelColumnIndex=
d.labelColumnIndex===void 0?0:d.labelColumnIndex;this._id=d.id===void 0?"treetable":d.id;this._tableStyle=d.tableStyle;this._tableElement=d.tableElement||"table";this._tableBodyElement=d.tableBodyElement||"tbody";this._tableRowElement=d.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(a){b._showRoot?(a._depth=0,b._generate([a],0)):b._treeModel.getChildren(a,function(a){b._generate(a,0)})})},_generate:function(d,c){k.empty(this._parent);var b=document.createElement("div");this._renderer.wrapperCallback&&
this._renderer.wrapperCallback(b);var a=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(a);a.id=this._id;this._tableStyle&&a.classList.add(this._tableStyle);this._renderer.initTable(a,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+"tbody";this._generateChildren(d,c);a.appendChild(this._bodyElement);b.appendChild(a);
this._parent.appendChild(b);this._rowsChanged()},_generateChildren:function(d,c,b){for(var a=0;a<d.length;a++){var h=document.createElement(this._tableRowElement);h.id=this._treeModel.getId(d[a]);this._renderer.rowCallback&&this._renderer.rowCallback(h);h._depth=c;h._item=d[a];this._renderer.render(d[a],h);h.childNodes[this._labelColumnIndex].style.paddingLeft=this._indent*c+"px";b?(this._bodyElement.insertBefore(h,b.nextSibling),b&&(b=h)):this._bodyElement.appendChild(h)}},_rowsChanged:function(){this._renderer.rowsChanged&&
this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(d,c,b){var a=this._treeModel.getId(d),h;if(a===this._id)this._removeChildRows(a),this._generateChildren(c,0),this._rowsChanged();else{var f=k.node(a);f?(f._item=d,f&&(b||f._expanded)?(f._expanded=!0,this._removeChildRows(a),this._renderer.updateExpandVisuals(f,!0),c?(this._generateChildren(c,f._depth+1,f),this._rowsChanged()):(h=this,c=this._treeModel.getChildren(f._item,function(a){h._generateChildren(a,
f._depth+1,f);h._rowsChanged()}))):this._renderer.updateExpandVisuals(f,!1)):console.log(i["could not find table row "]+a)}},getItem:function(d){var c=k.node(d);return c&&c._item?c._item:d},toggle:function(d){var c=k.node(d);c&&(c._expanded?(this.collapse(d),this._renderer.updateExpandVisuals(c,!1)):(this.expand(d),this._renderer.updateExpandVisuals(c,!0)))},isExpanded:function(d){return(d=k.node(d))?d._expanded:!1},expand:function(d,c,b){var d=typeof d==="string"?d:this._treeModel.getId(d),a=k.node(d);
if(a&&!a._expanded){a._expanded=!0;var h=this;this._renderer.updateExpandVisuals(a,!0);this._treeModel.getChildren(a._item,function(d){h._generateChildren(d,a._depth+1,a);h._rowsChanged();c&&c.apply(h,b)})}},_removeChildRows:function(d){for(var c=d===this._id,b=!1,a=-1,h=[],f=k.$$array(".treeTableRow",this._parent),e=0;e<f.length;e++){var j=f[e];if(b)break;if(c)j._depth>a?h.push(j):b=!0;else if(j.id===d)c=!0,a=j._depth}for(d=0;d<h.length;d++)c=h[d],c.parentNode.removeChild(c)},collapse:function(d){var d=
typeof d==="string"?d:this._treeModel.getId(d),c=k.node(d);if(c){if(!c._expanded)return;c._expanded=!1;this._renderer.updateExpandVisuals(c,!1);this._removeChildRows(d);this._rowsChanged()}this._onCollapse&&this._onCollapse(c._item)}};g.prototype.constructor=g;return{TableTree:g}});
define("orion/treeModelIterator",[],function(){var i={};i.TreeModelIterator=function(){function i(g,d){this.firstLevelChildren=g;this.reset();this._init(d)}i.prototype={_init:function(g){if(g)this.isExpanded=g.isExpanded,this.isExpandable=g.isExpandable,this.forceExpandFunc=g.forceExpandFunc,this.getChildrenFunc=g.getChildrenFunc},topLevel:function(g){return g.parent?g.parent===this.root:!0},_getChildren:function(g){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(g):g?g.children:
null},_expanded:function(g){if(!g)return!0;var d=this._getChildren(g),d=d&&d.length>0;this.isExpanded&&d&&(d=this.isExpanded(g));return d},_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 d=this._diveIn(this._cursor);
if(!d){if(g&&this._expandable(this._cursor)&&this.forceExpandFunc){var c=this;return this.forceExpandFunc(this._cursor,"first",function(b){b&&c.setCursor(b)})}(d=this._findSibling(this._cursor,!0))&&this.setCursor(d)}return d},_backward:function(g){if(!this._cursor)return null;var d=this._findSibling(this._cursor,!1);d&&d!==this._cursor.parent&&(d=this._drillToLast(d));if(g&&d&&this._expandable(d)&&this.forceExpandFunc&&d!==this._cursor.parent){var c=this;return this.forceExpandFunc(d,"last",function(b){b&&
c.setCursor(b)})}d&&this.setCursor(d);return d},_findSibling:function(g,d){for(var c=this.topLevel(g),b=this._getChildren(g.parent),b=c?this.firstLevelChildren:b,a=0;a<b.length;a++)if(b[a]===g)return a===0&&!d?c?null:g.parent:a===b.length-1&&d?c?null:this._findSibling(g.parent,d):d?b[a+1]:b[a-1];return null},_inParentChain:function(g,d){for(var c=g.parent;c;){if(c===d)return!0;c=c.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,d,c){this.setCursor(d);var b=[];for(b.push(d);;){if(this.iterate(g))b.push(this.cursor());else break;if(c===this.cursor())return b}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,d){var c=this.cursor(),
b=this._scan(!0,g,d);b||(b=this._scan(!1,g,d));this.setCursor(c);return b},iterate:function(g,d){return g?this._forward(d):this._backward(d)},iterateOnTop:function(g,d){var c=this._findSibling(this._getTopLevelParent(this.cursor()),g);c?this.setCursor(c):d&&this.firstLevelChildren.length>0&&this.setCursor(g?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(g){if(!this._cursor)return null;return this._inParentChain(this._cursor,g)?(this.setCursor(g),
this._cursor):null},reset:function(){this.root=this._prevCursor=this._cursor=null;if(this.firstLevelChildren.length>0)this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent},cursorMoved:function(){return this._cursor!==this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return i}();return i});
define("orion/explorers/explorerNavHandler",["i18n!orion/nls/messages","orion/webui/littlelib","orion/treeModelIterator"],function(i,k,g){var i={},d=navigator.userAgent.indexOf("iPad")!==-1,c=window.navigator.platform.indexOf("Mac")!==-1;i.ExplorerNavHandler=function(){function b(a,b,c){this.explorer=a;this.model=this.explorer.model;this._navDict=b;this._listeners=[];this._selections=[];this._currentColumn=0;var e=this._getEventListeningDiv();e.tabIndex=0;e.classList.add("selectionModelContainer");
var d=this;this._modelIterator=new g.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:c.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return d.explorer.renderer.isExpandable(a)}:function(a){return d.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,b,c){return d.explorer.forceExpandFunc(a,b,c)}:void 0});this._init(c);(!c||c.setFocus!==!1)&&e.focus();a=function(a){if(a.target===e){if(d.explorer.preventDefaultFunc&&d.explorer.preventDefaultFunc(a,
d._modelIterator.cursor()))return!0;if(a.keyCode===k.KEY.DOWN)return d.onDownArrow(a);else if(a.keyCode===k.KEY.UP)return d.onUpArrow(a);else if(a.keyCode===k.KEY.RIGHT)return d.onRightArrow(a);else if(a.keyCode===k.KEY.LEFT)return d.onLeftArrow(a);else if(a.keyCode===k.KEY.SPACE)return d.onSpace(a);else if(a.keyCode===k.KEY.ENTER)return d.onEnter(a)}};e.addEventListener("keydown",a,!1);this._listeners.push({type:"keydown",listener:a});a=function(){if(d.explorer.onFocus)d.explorer.onFocus(!1);else d.toggleCursor(null,
!1)};e.addEventListener("blur",a,!1);this._listeners.push({type:"blur",listener:a});a=function(){if(d.explorer.onFocus)d.explorer.onFocus(!0);else d.toggleCursor(null,!0)};e.addEventListener("focus",a,!1);this._listeners.push({type:"focus",listener:a});this._parentDiv=e}b.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 c?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 b=this;this.explorer.selection&&this.explorer.selection.getSelections(function(c){b._clearSelection();for(var e=0;e<c.length;e++)b._selections.push(c[e]);b._selections.length>0&&b.cursorOn(b._selections[0],!0,!1,a)})},refreshModel:function(a,b,c,e){this._currentColumn=
0;this.topIterationNodes=[];this.model=b;this._navDict=a;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(c)this.topIterationNodes=c;this._modelIterator.setTree(this.topIterationNodes);!e&&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),b=0;b<this._selections.length;b++)if(a===this.model.getId(this._selections[b]))return b;
return-1},_clearSelection:function(a){if(a)for(a=0;a<this._selections.length;a++)this._checkRow(this._selections[a],!0);this._selections=[]},setSelection:function(a,b){if(this._selectionPolicy==="cursorOnly")b&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(a,!0);else if(this._isRowSelectable(a)){if(!b||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,b){a||(a=this.currentModel());var c=this._getGridChildren(a);if(c&&c.length>1||b===0&&c){b!==0&&this.toggleCursor(a,!1);var e=this._currentColumn,d=!0;e+=b;e<0?(this._linearGridMove&&b!==0&&(this._modelIterator.iterate(!1)?a=this.currentModel():d=!1),
e=d?c.length-1:this._currentColumn):e>=c.length&&(this._linearGridMove&&b!==0&&(this._modelIterator.iterate(!0)?a=this.currentModel():d=!1),e=d?0:this._currentColumn);this._currentColumn=e;b!==0&&this.toggleCursor(a,!0);return!0}return!1},_getGridChildren:function(a){return this._navDict?this._navDict.getGridNavHolder(a):null},getCurrentGrid:function(a){a||(a=this.currentModel());return(a=this._getGridChildren(a))&&a.length>0?a[this._currentColumn]:null},getAriaContainerElement:function(a){for(var b=
this._parentDiv,c;a&&a!==b&&(c=a.getAttribute("role"))!=="grid"&&c!=="tree"&&c!=="treegrid";)a=a.parentNode;return a===b?null:a},toggleCursor:function(a,b){var c=this.getRowDiv(a),e=this.getCurrentGrid(a);e?(c&&(b?c.classList.add("treeIterationCursorRow"):c.classList.remove("treeIterationCursorRow")),e.domNode&&(c=this.getAriaContainerElement(e.domNode),b?(e.domNode.classList.add("treeIterationCursor"),c&&c.setAttribute("aria-activedescendant",e.domNode.id)):e.domNode.classList.remove("treeIterationCursor"))):
c&&(b?c.classList.add("treeIterationCursorRow_Dotted"):c.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(a,b,c,e){var c=c===void 0?!1:c,d,m;if(a||b){if(m===this._modelIterator.cursor())return;d=this._modelIterator.cursor();m=a;this._modelIterator.setCursor(m)}else d=this._modelIterator.prevCursor(),m=this._modelIterator.cursor();if(d!==m||b)if(this.toggleCursor(d,!1),!b||m)if(this.moveColumn(null,0),this.toggleCursor(m,
!0),(a=this.getRowDiv())&&!e&&!this._visible(a)&&a.scrollIntoView(!c),this.explorer.onCursorChanged)this.explorer.onCursorChanged(d,m)},getSelection:function(){return this._selections},getSelectionIds:function(){for(var a=[],b=0;b<this._selections.length;b++)a.push(this.model.getId(this._selections[b]));return a},getRowDiv:function(a){a=a?a:this._modelIterator.cursor();if(!a)return null;var a=this.model.getId(a),b=this._navDict.getValue(a);return b&&b.rowDomNode?b.rowDomNode:k.node(a)},iterate:function(a,
b,c){this.topIterationNodes.length!==0&&this._modelIterator.iterate(a,b)&&(this.cursorOn(null,!1,a),c&&this.setSelection(this.currentModel(),!0))},_checkRow:function(a,b){if(this.explorer.renderer._useCheckboxSelection){var c=this.getRowDiv(a);if(c){var e=k.node(this.explorer.renderer.getCheckBoxId(c.id)),d=b?!e.checked:!0;if(d!==e.checked)this.explorer.renderer.onCheck(c,e,d,!0)}}else this._select(a,b)},_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 b=0;b+=this._getToolBarHeight("staticBanner");b+=this._getToolBarHeight("titleArea");b+=this._getToolBarHeight("pageToolbar");var c=this._getEventListeningDiv(!0).getClientRects()[0],e=this._vpHeight();this._vpWidth();for(var b=c.top>b?c.top:
b,c=c.bottom<e?c.bottom:e,a=a.getClientRects(),e=0,d=a.length;e<d;e++){var m=a[e];if(m.top>=b&&m.top<=c&&m.bottom>=b&&m.bottom<=c)return!0}return!1},_select:function(a){a||(a=this._modelIterator.cursor());var b=this.getRowDiv(a);b&&(this._inSelection(a)<0?b.classList.add("checkedRow"):b.classList.remove("checkedRow"))},_onModelGrid:function(a,b){var c=this._getGridChildren(a);if(c)for(var e=0;e<c.length;e++)if(b.target===c[e].domNode)return!0;return!1},onClick:function(a,b){var c=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)));
if(b.target!==c&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(a,b)))if(this.cursorOn(a,!0,!1,!0),d)this.setSelection(a,!0);else if(this._ctrlKeyOn(b))this.setSelection(a,!0);else if(b.shiftKey&&this._lastSelection){if(c=this._modelIterator.scan(this._lastSelection,a)){this._clearSelection(!0);for(var e=0;e<c.length;e++)this.setSelection(c[e],!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 b=this.currentModel(),c=this._getGridChildren(b);return c&&c.length>1?this.isExpandable(b)?this._ctrlKeyOn(a):!0:!1},onLeftArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,
-1),a.preventDefault(),!0;var b=this._modelIterator.cursor();if(!b)return!1;if(this.isExpandable(b)&&this.isExpanded(b))return this.explorer.myTree.collapse(b),a.preventDefault(),!0;this._modelIterator.topLevel(b)?this.explorer.scopeUp&&typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(b.parent),this.setSelection(b.parent,!1))},onRightArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,1),a.preventDefault(),!0;var b=this._modelIterator.cursor();
if(!b)return!1;if(this.isExpandable(b)&&!this.isExpanded(b))return this.explorer.myTree.expand(b),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 b=this.getCurrentGrid(this._modelIterator.cursor());if(b)if(b.widget)if(typeof b.onClick==="function")b.onClick();else typeof b.widget.focus==="function"&&b.widget.focus();
else{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(a),!1,!1,!1,0,null);b.domNode.dispatchEvent(c)}else if(this.explorer.renderer.getRowActionElement&&(b=this._modelIterator.cursor()))if(b=this.explorer.renderer.getRowActionElement(this.model.getId(b)),b.href)this._ctrlKeyOn(a)?window.open(b.href):window.location.href=b.href}};return b}();i.ExplorerNavDict=function(){function b(a){this._dict={};this._model=a}b.prototype={addRow:function(a,
b){this._dict[this._model.getId(a)]={model:a,rowDomNode:b}},getValue:function(a){return this._dict[a]},getGridNavHolder:function(a,b){if(!a)return null;var c=this._model.getId(a);if(this._dict[c]){if(!this._dict[c].gridChildren&&b)this._dict[c].gridChildren=[];return this._dict[c].gridChildren}return null},initGridNavHolder:function(a){if(!a)return null;a=this._model.getId(a);if(this._dict[a])this._dict[a].gridChildren=null}};return b}();return i});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands,orion/commandRegistry".split(","),function(i,k,g,d,c,b){var a={};a.Explorer=function(){function a(b,c,d,h){this.registry=b;this.renderer=d;this.selection=c;this.commandService=h;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,c){a=this.getRow(a);if(c)return a=a.childNodes[c],a.appendChild(document.createElement("br")),c=document.createElement("span"),c.id=b+"placeHolderRow",a.appendChild(c),{tempNode:c,refNode:c};if(a){c=document.createElement("tr");c.id=b+"placeHolderRow";var d=document.createElement("td");d.id=b+"placeHolderCol";c.appendChild(d);a.appendChild(c);c=g.node(b+"placeHolderRow");a=g.node(b+"placeHolderCol");if(c&&a)return{tempNode:c,refNode:a}}return null},getRow:function(a){if(a=
this.model.getId(a))return g.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,j){a=typeof a==="string"?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var h=a+"innerTree",o=g.node(h);o&&g.empty(o);if(b)b.rootId=h;this.model=b;this._parentId=a;this._treeOptions=j;if(!j||j&&!j.noSelection)this.selectionPolicy=j?j.selectionPolicy:"",this._navDict=new c.ExplorerNavDict(this.model);this.myTree=new d.TableTree({id:h,
model:b,parent:a,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:j?!!j.showRoot:!1,indent:j?j.indent:void 0,onCollapse:j?j.onCollapse:void 0,navHandlerFactory:j?j.navHandlerFactory:void 0,tableElement:j?j.tableElement:void 0,tableBodyElement:j?j.tableBodyElement:void 0,tableRowElement:j?j.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 c=a.getSelection(),d=0;d<c.length;d++){var h=a.getRowDiv(c[d]);h&&h.parentNode&&(h=this.getNavDict().getValue(this.model.getId(c[d])),h.model&&b.push(h.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 c.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(c){c instanceof Array?b.getNavHandler().refreshModel(b.getNavDict(),b.model,c):c.children&&c.children instanceof Array&&b.getNavHandler().refreshModel(b.getNavDict(),b.model,
c.children);a&&a.setFocus&&b.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return a}();a.createExplorerCommands=function(a,c){function e(a){return typeof a.getItemCount==="function"?a.getItemCount()>0?c?c(a):!0:!1:!1}var d=new b.Command({tooltip:i["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return e(a)},callback:function(a){a.items.expandAll()}}),m=new b.Command({tooltip:i["Collapse all"],
imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return e(a)},callback:function(a){a.items.collapseAll()}});a.addCommand(d);a.addCommand(m)};a.ExplorerModel=function(){function a(b,c,d){this.rootPath=b;this.fetchItems=c;this.idPrefix=d||""}a.prototype={destroy:function(){},getRoot:function(a){var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})},getChildren:function(a,b){a.Children?b(a.Children):a.ChildrenLocation?
this.fetchItems(a.ChildrenLocation).then(function(c){a.Children=c;b(c)}):b([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;for(var a=a.Location.replace(/[\\\/]/g,""),b=this.idPrefix,c=0;c<a.length;c++)b+=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(c):a[c];return b}};return a}();a.ExplorerFlatModel=function(){function b(a,c,d){this.rootPath=a;this.fetchItems=c;this.root=d}b.prototype=new a.ExplorerModel;b.prototype.getRoot=function(a){if(this.root)a(this.root);else{var b=
this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})}};b.prototype.getChildren=function(a,b){a===this.root?b(this.root):b([])};return b}();a.ExplorerRenderer=function(){function a(b,c){this.explorer=c;this._init(b);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;g.empty(a);this._treeTableClass&&
a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,b,c,d,h){var c=c||"tool",g=document.createElement("td");g.id=b.id+"actionswrapper";d&&g.classList.add(d);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,g,a,this.explorer,c,null,h&&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 g},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,b){if(this._useCheckboxSelection){var c=document.createElement("td"),d=document.createElement("span");d.id=this.getCheckBoxId(b.id);d.classList.add("core-sprite-check");d.classList.add("selectionCheckmarkSprite");d.rowId=b.id;if(this.getCheckedFunc)d.checked=this.getCheckedFunc(a),d.checked?(this._highlightSelection&&b.classList.add("checkedRow"),d.classList.add("core-sprite-check_on")):
(this._highlightSelection&&b.classList.remove("checkedRow"),d.classList.remove("core-sprite-check_on"));c.appendChild(d);var h=this;d.addEventListener("click",function(a){h.onCheck(b,a.target,a.target.checked?!1:!0,!0)},!1);return c}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,b,c,d,h){(b.checked=c)?b.classList.add("core-sprite-check_on"):b.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(b.rowId,c,d);this.explorer.getNavHandler()&&h&&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 c=[];for(b=0;b<a.length;b++){var d=this.explorer.getNavDict().getValue(a[b]);if(d&&d.rowDomNode&&
d.model&&(c.push(d.model),this._highlightSelection&&d.rowDomNode.classList.add("checkedRow"),d=g.node(this.getCheckBoxId(d.rowDomNode.id))))d.checked=!0,d.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(c),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var b=!1,c=window.sessionStorage[a+
"expanded"];typeof c==="string"&&(c=c.length>0?JSON.parse(c):null);var d;if(c)for(d=0;d<c.length;d++)if(g.node(c[d])){this._expanded.push(c[d]);var h=this;this.tableTree.expand(c[d],function(){h._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 c=g.node(this.expandCollapseImageId(a.id));c&&(c.classList.add(b?this._expandImageClass:this._collapseImageClass),c.classList.remove(b?this._collapseImageClass:this._expandImageClass))},getExpandImage:function(a,b,c,d){var h=document.createElement("span");h.id=this.expandCollapseImageId(a.id);b.appendChild(h);h.classList.add(this._twistieSpriteClass);h.classList.add(this._collapseImageClass);if(c){var g=document.createElement("span");b.appendChild(g);g.classList.add(d||"imageSprite");g.classList.add(c)}var i=
this;h.onclick=function(){i.tableTree.toggle(a.id);if(i.tableTree.isExpanded(a.id))i._expanded.push(a.id);else for(var b in i._expanded)if(i._expanded[b]===a.id){i._expanded.splice(b,1);break}(b=i._getUIStatePreferencePath())&&window.sessionStorage&&i._storeExpansions(b)};return h},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=
g.$$array(".treeTableRow"),b=0;b<a.length;b++){var c=a[b],d=g.node(c.id+"actionswrapper");this.commandService.destroy(d);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,d,c._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return a}();a.SelectionRenderer=function(){function b(a,c){this._init(a);this.explorer=c}b.prototype=new a.ExplorerRenderer;
b.prototype.renderTableHeader=function(a){var b=document.createElement("thead"),c=document.createElement("tr");b.classList.add("navTableHeading");this._useCheckboxSelection&&c.appendChild(this.initCheckboxColumn(a));for(var d=0,h=this.getCellHeaderElement(d);h;)h.innerHTML.length>0&&h.classList.add("navColumn"),c.appendChild(h),h=this.getCellHeaderElement(++d);b.appendChild(c);d>0&&a.appendChild(b)};b.prototype.renderRow=function(a,b){b.verticalAlign="baseline";b.classList.add("treeTableRow");var c=
this.explorer.getNavDict();if(c){c.addRow(a,b);var d=this;b.addEventListener("click",function(b){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(a,b)},!1)}if(c=this.getCheckboxColumn(a,b))c.classList.add("checkColumn"),b.appendChild(c);for(var c=0,h=this.getCellElement(c,a,b);h;)b.appendChild(h),c===0?this.getPrimColumnStyle?h.classList.add(this.getPrimColumnStyle()):h.classList.add("navColumn"):this.getSecondaryColumnStyle?h.classList.add(this.getSecondaryColumnStyle()):h.classList.add("secondaryColumn"),
h=this.getCellElement(++c,a,b)};b.prototype.getCellHeaderElement=function(){};b.prototype.getCellElement=function(){};return b}();a.SimpleFlatModel=function(){function b(a,c,d){this.items=a;this.getKey=d;this.idPrefix=c;this.root={children:a}}b.prototype=new a.ExplorerModel;b.prototype.getRoot=function(a){a(this.root)};b.prototype.destroy=function(){};b.prototype.getId=function(a){for(var a=this.getKey(a).replace(/[\\\/]/g,""),b="",c=0;c<a.length;c++)b+=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(c):
a[c];return this.idPrefix+b};b.prototype.getChildren=function(a,b){a===this.root?b(this.items):b([])};return b}();return a});
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(i,k,g,d,c,b){function a(a,c,d,h,o,g,i){var s;if(c.Directory)s=document.createElement("a"),s.className="navlinkonpage",s.href=a+"#"+c.ChildrenLocation,s.appendChild(document.createTextNode(c.Name));else{o||(o=b.getOpenWithCommands(d));if(!g)for(a=0;a<o.length;a++)o[a].isEditor===
"default"&&(g=o[a]);s=document.createElement("a");s.className="navlink targetSelector";i&&typeof i==="object"&&Object.keys(i).forEach(function(a){s[a]=i[a]});s.appendChild(document.createTextNode(c.Name));for(var q=c.Location,r=!1,a=0;a<o.length;a++)if(d=o[a],d.visibleWhen(c)){q=d.hrefCallback({items:c});r=!0;break}k.when(h.getFileContentType(c),function(a){var b;if(b=!r)if(b=g){a:{switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":b=
!0;break a}b=!1}b=!b}b&&(q=g.hrefCallback({items:c}));b=s;var d=c.Location,f;switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":f=document.createElement("img");f.src=d;f.classList.add("thumbnail");break;default:a&&a.image?(f=document.createElement("img"),f.src=a.image,f.classList.add("thumbnail")):(f=document.createElement("span"),f.className="core-sprite-file_model modelDecorationSprite")}b.firstChild?b.insertBefore(f,b.firstChild):
b.appendChild(f);s.href=q})}return s}function h(a,b,c,d){this.explorer=b;this.commandService=c;this.contentTypeService=d;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}h.prototype=new d.SelectionRenderer;h.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};h.prototype.tableCallback=function(a){a.setAttribute("aria-label",i.Navigator);a.setAttribute("role","presentation")};h.prototype.rowCallback=function(a){a.setAttribute("role","treeitem")};
h.prototype.getCellHeaderElement=function(a){if(this.oneColumn&&a!==0)return null;switch(a){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};h.prototype.setTarget=function(a){this.target=a};h.prototype.createFolderNode=function(b){var c;this.showFolderLinks?c=a(this.folderLink||"",b,this.commandService,this.contentTypeService):(c=document.createElement("span"),c.textContent=b.Name);return c};h.prototype.showFolderLinks=!0;h.prototype.getCellElement=function(d,e,j){switch(d){case 0:var d=
document.createElement("td"),h=document.createElement("span");h.id=j.id+"MainCol";h.setAttribute("role","presentation");d.appendChild(h);d.setAttribute("role","presentation");h.className="mainNavColumn";var o;if(e.Directory)this.getExpandImage(j,h),o=this.createFolderNode(e),h.appendChild(o),this.explorer._makeDropTarget(e,o),this.explorer._makeDropTarget(e,j);else{if(!this.openWithCommands){this.openWithCommands=b.getOpenWithCommands(this.commandService);for(o=0;o<this.openWithCommands.length;o++)if(this.openWithCommands[o].isEditor===
"default")this.defaultEditor=this.openWithCommands[o]}o=a("",e,this.commandService,this.contentTypeService,this.openWithCommands,this.defaultEditor,{target:this.target});h.appendChild(o)}if(o)o.id=j.id+"NameLink",o.nodeType===1&&(c.addNavGrid(this.explorer.getNavDict(),e,o),o.setAttribute("role","link"),o.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,h,e,this.explorer,"tool",null,!0);return d;case 1:if(this.oneColumn)return null;j=document.createElement("td");
if(e.LocalTimeStamp)j.textContent=(new Date(e.LocalTimeStamp)).toLocaleString();return j;case 2:if(this.oneColumn)return null;j=document.createElement("td");if(!e.Directory&&typeof e.Length==="number")e=parseInt(e.Length,10)/1024,j.textContent=Math.ceil(e).toLocaleString()+" KB";j.style.textAlign="right";return j}};h.prototype.constructor=h;return{NavigatorRenderer:h,createLink:a}});
define("orion/searchClient","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/i18nUtil,orion/searchUtils,orion/crawler/searchCrawler,orion/explorers/navigatorRenderer,orion/extensionCommands,orion/Deferred".split(","),function(i,k,g,d,c,b,a,h,f){function e(a,b){this.serviceRegistry=a;this.commandRegistry=b;this.openWithCommands=null}function j(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new e(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}e.prototype.makeRenderFunction=function(b,c,e,j,s){var q=this.serviceRegistry,r=this.commandRegistry;this.openWithCommands=this.openWithCommands||h.createOpenWithCommands(q,b,r);var t=this;return function(l,h,y){f.when(t.openWithCommands,function(f){if(y)g.empty(c),f=document.createElement("div"),f.appendChild(document.createTextNode(i["Search failed."])),c.appendChild(f),typeof j==="function"&&j(c);else{var v=
function(){function a(b,c){var l=c.folderName?c.folderName:c.path,e=document.createElement("span");e.id=l.replace(/[^a-zA-Z0-9_\.:\-]/g,"");e.appendChild(document.createTextNode(" - "+l+" "));b.appendChild(e)}var b={};return function(c,l){var e=l.name;if(b.hasOwnProperty(e)){a(c,l);var d=b[e];typeof d==="function"&&(b[e]=null,d())}else b[e]=function(){a(c,l)}}}(),A=!1;g.empty(c);if(l&&l.length>0){var E=document.createElement("table");E.setAttribute("role","presentation");for(var D=0;D<l.length;D++){var z=
l[D],G;if(!A&&(A=!0,e))G=E.insertRow(0).insertCell(0),G.textContent=e;G=E.insertRow(-1).insertCell(0);G.colspan=2;s&&s(G);var q={Name:z.name,Directory:z.directory,Location:z.path||z.location},q=a.createLink(k.toUrl("navigate/table.html"),q,r,b,f,null,{"aria-describedby":(z.folderName?z.folderName:z.path).replace(/[^a-zA-Z0-9_\.:\-]/g,""),style:{verticalAlign:"middle"}});z.LineNumber&&q.appendChild(document.createTextNode(" (Line "+z.LineNumber+")"));G.appendChild(q);v(G,z)}c.appendChild(E);typeof j===
"function"&&j(c)}!A&&h&&(f=d.formatMessage(i["No matches found for ${0}"],h),g.empty(c),c.appendChild(document.createTextNode(f)),typeof j==="function"&&j(c))}})}};j.prototype={search:function(a,e,d){var f=function(a){for(var b=[],e=0;e<a.response.docs.length;e++){var l=a.response.docs[e];b.push({name:l.Name,path:l.Location,folderName:c.path2FolderName(l.Path?l.Path:l.Location,l.Name),directory:l.Directory,lineNumber:l.LineNumber})}return b};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,
function(a){d(f(a),null)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(b){var c=a.keyword,c=c.substring(c.indexOf("}")+1),c=c.substring(c.indexOf(":")+1);d(f(b),c)},function(a){d(null,null,a)})}catch(j){typeof j==="string"&&j.indexOf("search")>-1&&this._crawler?this._crawler.searchName(a,function(a){d(f(a),null)}):typeof j==="string"&&j.indexOf("search")>-1&&!a.nameSearch?(new b.SearchCrawler(this.registry,this._fileService,
a,{childrenLocation:this.getChildrenLocation()})).search(function(a){d(f(a),null)}):this.registry.getService("orion.page.message").setErrorMessage(j)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=a},handleError:function(a,b){console.error(a);g.empty(b);b.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,b){var c="",e=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);b&&a&&a.Parents&&a.Parents.length>
0?e=b.index==="last"?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&a.Directory&&a.Location&&a.Parents&&(e=a);if(e)this.setLocationbyURL(e.Location),c=e.Name,this._childrenLocation=e.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),c=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation;e=g.node("search");c||(c="");if(e&&e.placeholder){e.value="";var f=d.formatMessage(i["Search ${0}"],c);e.placeholder=f.length>30?f.substring(0,27)+"...":d.formatMessage(i["Search ${0}"],
c)}if(e&&e.title)e.title=i["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,e){c=c?this.getSearchRootLocation():this.getSearchLocation();return b?{resource:c,sort:"NameLower asc",rows:100,start:0,nameSearch:!0,keyword:a}:{resource:c,sort:e&&e.sort?e.sort:"Path asc",rows:e&&e.rows?e.rows:40,start:0,caseSensitive:e?e.caseSensitive:void 0,regEx:e?e.regEx:void 0,fileType:e?e.fileType:void 0,keyword:a,replace:e?e.replace:void 0}}};j.prototype.constructor=j;return{Searcher:j}});
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(i,k){var g={root:k};Object.keys(i).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=i[d])});return g});
define("orion/compare/compareCommands",["i18n!orion/compare/nls/messages","orion/commands","orion/keyBinding","orion/webui/littlelib"],function(i,k,g,d){var c={};c.CompareCommandFactory=function(){function b(a){this.setOptions(a,!0)}b.prototype={setOptions:function(a,b){if(b)this.options={};if(!this.options)this.options={};a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},getOptions:function(){return this.options},initCommands:function(a){var b=this.options.commandSpanId,c=
this.options.commandService;if(c&&b){var e=new k.Command({name:i["Copy current change from right to left"],tooltip:i["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()}}),d=new k.Command({name:i["Copy current change from left to right"],tooltip:i["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()}}),m=new k.Command({tooltip:i["Switch to unified diff"],name:i.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()}}),
o=new k.Command({tooltip:i["Switch to side by side diff"],name:i["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()}}),n=new k.Command({name:i["Next diff block"],tooltip:i["Next diff block"],imageClass:"core-sprite-move_down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",callback:function(a){a.items.nextDiff()}}),
p=new k.Command({name:i["Previous diff block"],tooltip:i["Previous diff block"],imageClass:"core-sprite-move_up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",callback:function(a){a.items.prevDiff()}}),s=new k.Command({name:i["Next diff change"],tooltip:i["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:i["Previous diff change"],tooltip:i["Previous diff change"],
imageClass:"core-sprite-move_up",id:"orion.compare.prevChange",groupId:"orion.compareGroup",callback:function(a){a.items.prevChange(a)}});c.addCommand(e);c.addCommand(d);c.addCommand(o);c.addCommand(m);c.addCommand(n);c.addCommand(p);c.addCommand(s);c.addCommand(q);c.registerCommandContribution(b,"orion.compare.toggle2Inline",108);c.registerCommandContribution(b,"orion.compare.toggle2TwoWay",109);c.registerCommandContribution(b,"orion.compare.copyToLeft",110,null,!1,new g.KeyBinding(37,!0,!1,!0));
c.registerCommandContribution(b,"orion.compare.copyToRight",111,null,!1,new g.KeyBinding(39,!0,!1,!0));c.registerCommandContribution(b,"orion.compare.nextDiff",112,null,!1,new g.KeyBinding(40,!0));c.registerCommandContribution(b,"orion.compare.prevDiff",113,null,!1,new g.KeyBinding(38,!0));a.options.wordLevelNav?(c.registerCommandContribution(b,"orion.compare.nextChange",114,null,!1,new g.KeyBinding(40,!0,!0)),c.registerCommandContribution(b,"orion.compare.prevChange",115,null,!1,new g.KeyBinding(38,
!0,!0))):(c.registerCommandContribution(b,"orion.compare.nextChange",114,null,!0,new g.KeyBinding(40,!0,!0)),c.registerCommandContribution(b,"orion.compare.prevChange",115,null,!0,new g.KeyBinding(38,!0,!0)))}},renderCommands:function(a){var b=this.options.commandSpanId,c=this.options.commandService;c&&b&&(d.empty(d.node(b)),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(b,b,a,a,"tool",null,this.options.gridRenderer.navGridHolder)):(c.renderCommands(b,b,a,a,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):c.renderCommands(b,b,a,a,"tool",null,this.options.gridRenderer.navGridHolder)):c.renderCommands(b,b,a,a,"tool",null))}};return b}();return c});
define("orion/compare/compareUtils",["orion/URITemplate"],function(i){var k=k||{};k.compareUtils=k.compareUtils||{};k.compareUtils.lookUpMapper=function(g,d,c){for(var b=0,a=0;a<g.length;a++){var h=g[a][d];h===0&&(h=1);if(c>=b&&c<b+h)return{mapperIndex:a,startFrom:b};if(a===g.length-1)break;b+=g[a][d]}return{mapperIndex:g.length-1,startFrom:b}};k.compareUtils.lookUpLineIndex=function(g,d,c){if(c===0)return 0;for(var b=0,a=0;a<c;a++)b+=g[a][d];return b};k.compareUtils.updateMapper=function(g,d,c,b,
a){if(b!==a&&(b>0||a>0)){var h=k.compareUtils.lookUpMapper(g,d,c);if(!(h.mapperIndex<0)){if(b>0)for(var f=c-h.startFrom,c=h.mapperIndex;c<g.length;c++){f=g[c][d]-f;if(b<=f){g[c][d]-=b;break}g[c][d]-=f;b-=f;f=0}a>0&&(g[h.mapperIndex][d]+=a)}}};k.compareUtils.overlapMapper=function(g,d,c,b,a){g=c+g[d]-1;g<c&&(g=c);a<b&&(a=b);return g<b||a<c?!1:!0};k.compareUtils.findFirstDiff=function(g,d,c,b){for(var a=0,h=null,f=0;f<g.length;f++){if(a>b)break;if(k.compareUtils.overlapMapper(g[f],d,a,c,b)&&(h={mapperIndex:f,
startFrom:a},g[f][2]!==0))break;a+=g[f][d]}return h};k.compareUtils.matchMapper=function(g,d,c,b){if(g.length===0)return c;var a=c+Math.round((b-c)/3),h=k.compareUtils.findFirstDiff(g,d,c,b),f=g[h.mapperIndex][d]===0?h.startFrom:h.startFrom+g[h.mapperIndex][d]-1,e=k.compareUtils.lookUpLineIndex(g,1-d,h.mapperIndex),j=h.startFrom-c;return g[h.mapperIndex][2]===0?e-j:a>=h.startFrom&&a<=f?e-Math.round((b-c)/3):a<h.startFrom?e-j:(g[h.mapperIndex][1-d]===0?e:e+g[h.mapperIndex][1-d]-1)-(f-c)};k.compareUtils.getMapperLineCount=
function(g){for(var d=0,c=0;c<g.length;c++)d+=Math.max(g[c][0],g[c][1]);return d};k.compareUtils.getAnnotationIndex=function(g,d){for(var c=0;c<g.length;c++)if(g[c][0]===d)return c;return-1};k.compareUtils.getAnnotationMapperIndex=function(g,d){return g[d][1]};k.compareUtils.getAnnotationIndexByMapper=function(g,d){for(var c=0;c<g.length;c++)if(g[c][1]===d)return{current:c,prev:c-1,next:c+1};return{current:-1,prev:-1,next:-1}};k.compareUtils.isMapperConflict=function(g,d){return d<0?!1:!g[d][3]?!1:
g[d][3]===1};k.compareUtils.mergeDiffBlocks=function(g,d,c,b,a,h){for(var f=0;f<d.length;f++){var e=d[f][0],j=c[d[f][1]];if(j[0]>0){for(var m="",o=0;o<j[0];o++)m=m+b[j[2]-1+o].substring(a)+h;j=g.getLineCount();e>=j&&(e=j-1);e=g.getLineStart(e);g.setText(m,e,e)}}};k.compareUtils.generateCompareHref=function(g,d){var c=require.toUrl("compare/compare.html");if(!d.conflict)d.conflict=void 0;if(!d.readonly)d.readonly=void 0;return(new i(c+"#{,resource,params*}")).expand({resource:g,params:d})};k.compareUtils.generateCompareTreeHref=
function(g,d){var c=require.toUrl("compare-tree/compare-tree.html");return(new i(c+"#{,resource,params*}")).expand({resource:g,params:d})};return k.compareUtils});
define("orion/compare/diffProvider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(i,k){function g(c,b,a){var d=new k;c[b].apply(c,a).then(function(a){d.resolve(a)},function(a){d.reject(a)});return d}function d(c,b){var a=c.getServiceReferences("orion.core.diff"),d,f=a;if(b){f=[];for(d=0;d<a.length;++d)b(a[d])&&f.push(a[d])}var e=[],j=[];for(d=0;d<f.length;++d)e[d]=RegExp(f[d].getProperty("pattern")||".*"),j[d]=c.getService(f[d]);this._getService=function(a){if(a.indexOf("://")===-1){var b=
document.createElement("a");b.href=a;a=b.href}for(b=0;b<e.length;++b)if(e[b].test(a))return j[b];throw i["No Matching DiffService for location:"]+a;}}d.prototype={getDiffContent:function(c){return g(this._getService(c),"getDiffContent",arguments)},getDiffFileURI:function(c){return g(this._getService(c),"getDiffFileURI",arguments)}};return{DiffProvider:d}});
define("orion/compare/diffParser",[],function(){var i=i||{};i.DiffParser=function(){function i(d,c){this._lineDelimiter=d?d:g?"\r\n":"\n";this._diffLineDelimiter=c?c:this._lineDelimiter;this._DEBUG=!1}var g=window.navigator.platform.indexOf("Win")!==-1;i.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(d){this._diffLineDelimiter=this._lineDelimiter=d},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(d,c,b,a){this._init();if(c==="")return{outPutFile:d,mapper:[]};this._oFileContents=d===""?[]:d.split(this._lineDelimiter);this._diffContents=c.split(this._diffLineDelimiter);c=this._diffContents.length;this._hunkRanges=[];for(var h=0;h<c;h++){var f=this._parseHunkRange(h);f&&this._hunkRanges.push(f)}if(0===this._hunkRanges.length)return{outPutFile:d,
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(d=0;d<this._hunkRanges.length;d++)this._parseHunkBlock(d);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(b);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));a||this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var d=0;d<this._deltaMap.length;d++)if(console.log(JSON.stringify(this._deltaMap[d])),
this._deltaMap[d][2]>0){console.log("    **Diff content on change/add: \n");for(var c=0;c<this._deltaMap[d][0];c++)console.log("    "+this._diffContents[this._deltaMap[d][2]+c-1])}},_logNewFile:function(){for(var d=0;d<this._nFileContents.length;d++)console.log(this._nFileContents[d])},_createBlock:function(d,c,b,a){a===b&&d===" "||(b=[b,a-b,"s"],d==="-"?b[2]="r":d==="+"?b[2]="a":d==="c"&&(b[2]="c"),c.push(b))},_createMinusBlock:function(d,c,b){var a=this._oBlocks.length;a===0||d!==this._oBlocks[a-
1][0]?(this._oBlocks.push([d===0?1:d,b]),this._nBlocks.push([c,0,-2])):this._oBlocks[a-1][1]+=b},_createPlusBlock:function(d,c,b,a){var h=this._nBlocks.length;h===0||c!==this._nBlocks[h-1][0]?(this._oBlocks.push([d===0?1:d,0]),this._nBlocks.push([c,b,a])):(this._nBlocks[h-1][1]+=b,this._nBlocks[h-1][2]=a)},_parseHunkBlock:function(d){for(var c=" ",b=this._hunkRanges[d][0]+1,a=d===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[d+1][0],h=0,f=0,e=this._hunkRanges[d][1],j=this._hunkRanges[d][3],
m=b,g=b;g<a;g++)if(0!==this._diffContents[g].length){var n=this._diffContents[g][0];if(n==="\\"&&("\\ No newline at end of file"===this._diffContents[g].substring(0,this._diffContents[g].length-1)||"\\ No newline at end of file"===this._diffContents[g]))c==="-"?this._oNewLineAtEnd=!1:c===" "?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,g>b&&this._diffContents[g-1][this._diffContents[g-1].length-1]==="\r"&&(this._diffContents[g-1]=this._diffContents[g-1].substring(0,this._diffContents[g-
1].length-1));else{switch(n){case "-":case "+":case " ":break;default:continue}if(c!==n){n==="+"&&(m=g);switch(c){case " ":e=this._hunkRanges[d][1]+h;j=this._hunkRanges[d][3]+f;break;case "-":this._createMinusBlock(e,j,this._hunkRanges[d][1]+h-e);break;case "+":this._createPlusBlock(e,j,this._hunkRanges[d][3]+f-j,m)}c=n}switch(n){case "-":h++;break;case "+":f++;break;case " ":h++,f++}}}switch(c){case "-":this._createMinusBlock(e,j,this._hunkRanges[d][1]+h-e);break;case "+":this._createPlusBlock(e,
j,this._hunkRanges[d][3]+f-j,m)}},_detectConflictes:function(d,c){if(d<0)return!1;for(var b=d+c,a=d;a<b;a++){var h=this._diffContents[a];if(h.indexOf("<<<<<")>-1||h.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(d){var c=this._oBlocks.length,b=this._oFileContents.length,a=0,h;h=1;for(var f=0;f<c;f++)h=this._oBlocks[f][0]-h,h>0&&(this._deltaMap.push([h,h,0]),a+=h),d&&this._detectConflictes(this._nBlocks[f][2],this._nBlocks[f][1])?this._deltaMap.push([this._nBlocks[f][1],this._oBlocks[f][1],
this._nBlocks[f][2]+1,1]):this._deltaMap.push([this._nBlocks[f][1],this._oBlocks[f][1],this._nBlocks[f][2]+1]),a+=this._oBlocks[f][1],h=this._oBlocks[f][0]+this._oBlocks[f][1];0<b-h&&(this._deltaMap.push([b-h+1,b-h+1,0]),a+=b-h+1);a<b&&(h=b-a,d=this._deltaMap[this._deltaMap.length-1],d[2]===0?(d[0]+=h,d[1]+=h):d[2]===-1?this._deltaMap.push([h,h,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([h,h,0]):(this._nNewLineAtEnd&&(d[0]+=h),this._oNewLineAtEnd&&(d[1]+=h)))},_buildNewFile:function(){var d=
1,c=!1,b=this._deltaMap.length,a,h;for(a=0;a<b;a++){c=!1;if(this._deltaMap[a][2]===0){for(h=0;h<this._deltaMap[a][0];h++)this._nFileContents.push(this._oFileContents[d+h-1]);c=!0}else if(this._deltaMap[a][2]>0)for(h=0;h<this._deltaMap[a][0];h++)this._nFileContents.push(this._diffContents[this._deltaMap[a][2]+h-1].substring(1));d+=this._deltaMap[a][1]}this._nNewLineAtEnd&&!c&&this._nFileContents.push("")},_parseHRangeBody:function(d,c){if(0<d.indexOf(",")){var b=d.split(","),a=parseInt(b[0],10),b=
parseInt(b[1],10);c.push(a>=0?a:1);c.push(b>=0?b:1)}else a=parseInt(d,10),c.push(a>=0?a:1),c.push(1)},_parseHunkRange:function(d){var c=this._diffContents[d];if(8>c.length)return null;if("@@"!==c.substring(0,2))return null;var c=c.substring(2),b=c.indexOf("@@");if(b<0)return null;var c=c.substring(0,b),b=c.indexOf("-"),a=c.indexOf("+");if(b<0||a<0)return null;d=[d];b<a?(c=c.substring(b+1).split("+"),this._parseHRangeBody(c[0],d),this._parseHRangeBody(c[1],d)):(c=c.substring(a+1).split("-"),this._parseHRangeBody(c[1],
d),this._parseHRangeBody(c[0],d));return d}};return i}();return i});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(i){var k=k||{};k.CompareRuler=function(){function g(d,c,b){this._location=d||"left";this._overview=c||"page";this._rulerStyle=b;this._editor=null;var a=this;this._listener={onModelChanged:function(b){a._onModelChanged(b)}}}g.prototype={setView:function(d){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=d;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(d,c){for(var b=[],a=d;a<c;a++){var h=this.getStyle(a);h&&(b[a]={html:this.getHTML(a),style:h})}return b},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(d,c,b,a,h,f){k.CompareRuler.call(this,b,"page",a);this._diffNavigator=d;this._oddStyle=h||{style:{backgroundColor:"white"}};this._evenStyle=f||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=c}g.prototype=new k.CompareRuler;g.prototype.getStyle=function(d){return d===void 0?this._rulerStyle:this._evenStyle};g.prototype.getHTML=function(d){var c=this._editor.getModel(),
b=this._diffNavigator.getFeeder(this._mapperColumnIndex===0);return!b?"":d===-1?c.getLineCount():b.getLineNumber?(d=b.getLineNumber(d),d===-1?"":d+1):d+1};g.prototype._onModelChanged=function(d){var d=d.start,c=this._editor.getModel(),b=c.getLineCount(),a=(b+"").length;if(this._numOfDigits!==a)this._numOfDigits=a,this._editor.redrawLines(c.getLineAtOffset(d),b,this)};return g}();k.CompareOverviewRuler=function(){function g(d,c,b,a){this._diffNavigator=b;this._onClick=a;k.CompareRuler.call(this,d,
"document",c)}g.prototype=new k.CompareRuler;g.prototype.getStyle=function(d){var c,b;if(d===void 0)c=this._rulerStyle||{},b=c.style||(c.style={}),b.lineHeight="1px",b.fontSize="1px",b.width="14px";else if(c=d!==-1?{styleClass:"annotationOverview breakpoint"}:{},b=c.style||(c.style={}),b.cursor="pointer",b.width="8px",b.left="2px",d>=0){var a;if(this._diffNavigator&&this._diffNavigator.getFeeder())a=this._diffNavigator.getFeeder().getDiffBlocks();else return null;d=i.getAnnotationIndex(a,d);if(d===
-1)return null;a=i.getAnnotationMapperIndex(a,d);var h;h=this._diffNavigator.getMapper();if(a=i.isMapperConflict(h,a))b.border="1px #FF0000 solid";if(d===this._diffNavigator.getCurrentBlockIndex())b.backgroundColor=a?"red":"blue";d=this._diffNavigator.getFeeder().getDiffBlockH(d);a=this._diffNavigator.getFeeder().getOverviewLineCount();if(d<0)return null;h=this._editor.getClientArea();d=Math.floor(h.height*d/a);d<2&&(d=2);b.height=d+"px"}else return null;return c};g.prototype.setDiffNavigator=function(d){this._diffNavigator=
d};g.prototype.getHTML=function(){return"&nbsp;"};g.prototype.onClick=function(d){d!==void 0&&this._onClick(d,this)};g.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return g}();k.CompareCurveRuler=function(){function g(d){this._canvasDiv=d;this._mapper=void 0}g.prototype={init:function(d,c,b,a){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=d;this._leftEditor=c;this._rightEditor=b;this._leftTextView=c.getTextView();
this._rightTextView=b.getTextView();this._diffNavigator=a;this.render()},matchPositionFrom:function(d){var c=d?this._leftTextView:this._rightTextView,b=d?this._rightTextView:this._leftTextView,a=c.getTopIndex(),c=c.getBottomIndex(),d=i.matchMapper(this._mapper,d?0:1,a,c);b.setTopIndex(d)},copyTo:function(d){if(this._diffNavigator.iterator){var c=this._diffNavigator.iterator.cursor();if(c){var b=d?this._rightTextView.getText(c.oldA.start,c.oldA.end):this._leftTextView.getText(c.newA.start,c.newA.end),
c=d?c.newA:c.oldA;(d?this._leftTextView:this._rightTextView).setText(b,c.start,c.end)}}},render:function(){if(this._mapper){var d=this._canvasDiv.getContext("2d");d.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);d.strokeStyle="#AAAAAA";d.lineWidth=1;d.beginPath();var c=this._leftTextView.getTopIndex(),b=this._leftTextView.getBottomIndex(),a=this._rightTextView.getTopIndex(),h=this._rightTextView.getBottomIndex();this._leftLineH=this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();
for(var f=0,e=0,j=!1,m=0;m<this._mapper.length;m++){if(this._mapper[m][2]!==0)if(i.overlapMapper(this._mapper[m],0,f,c,b)||i.overlapMapper(this._mapper[m],1,e,a,h))this._renderCurve(m,f,e,this._canvasDiv,d,c,b,a,h),j=!0;else if(j)break;f+=this._mapper[m][0];e+=this._mapper[m][1]}d.stroke()}},_renderCurve:function(d,c,b,a,h){var f=this._mapper[d],c=this._leftTextView.getLinePixel(c+f[0]/2)+f[0]%2*this._leftLineH/3-this._leftTextView.getTopPixel(),b=this._rightTextView.getLinePixel(b+f[1]/2)+f[1]%2*
this._rightLineH/3-this._rightTextView.getTopPixel(),a=a.parentNode.clientWidth;d===this._diffNavigator.getCurrentMapperIndex()?(h.stroke(),h.strokeStyle="#000",h.lineWidth=1,h.beginPath(),h.moveTo(0,c),h.bezierCurveTo(a/3,c,a*0.666,b,a,b),h.stroke(),h.strokeStyle="#AAAAAA",h.lineWidth=1,h.beginPath()):(h.moveTo(0,c),h.bezierCurveTo(a/3,c,a*0.666,b,a,b),h.stroke())},onChanged:function(d,c){var b=c?this._rightIniting:this._leftIniting;if(d.removedLineCount!==d.addedLineCount){var a=c?this._rightTextView:
this._leftTextView;b||i.updateMapper(this._mapper,c?1:0,a.getModel().getLineAtOffset(d.start),d.removedLineCount,d.addedLineCount);(d.removedLineCount>0||d.addedLineCount>0)&&this.render()}c?this._rightIniting=!1:this._leftIniting=!1;return b}};return g}();return k});define("orion/editor/i18n",{load:function(i,k,g){k.specified&&k.specified("orion/bootstrap")?k(["orion/i18n!"+i],function(d){g(d)}):g({})}});
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(i,k){var g={root:k},d;for(d in i)i.hasOwnProperty(d)&&typeof g[d]==="undefined"&&(g[d]=i[d]);return g});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/util"],function(i,k){function g(d,c){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(d);this.setLineDelimiter(c)}g.prototype={find:function(d){if(this._text.length>1)this._text=[this._text.join("")];var c=d.string,b=c,a=d.caseInsensitive;!d.regex&&c&&(b=c.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),a&&(b=b.replace(/[iI\u0130\u0131]/g,"[Ii\u0130\u0131]")));var h=null,f;if(b){var c=d.reverse,e=d.wrap,j=d.wholeWord,
m=d.start||0,d=d.end,g=d!==null&&d!==void 0,n="";n.indexOf("g")===-1&&(n+="g");a&&n.indexOf("i")===-1&&(n+="i");j&&(b="\\b"+b+"\\b");var i=this._text[0],k,q,r=0;g&&(a=m<d?m:d,i=i.substring(a,m<d?d:m),r=a);var t=RegExp(b,n);if(c)f=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+r<m)){if(!e||a)break;m=i.length+r}a={start:k.index+r,end:t.lastIndex+r}}else break}if(a)m=a.start;return a};else{if(!g)t.lastIndex=m;f=function(){for(;;){q=
t.lastIndex;k=t.exec(i);if(q===t.lastIndex)break;if(k)return{start:k.index+r,end:t.lastIndex+r};if(!(q!==0&&e))break}return null}}h=f()}return{next:function(){var a=h;a&&(h=f());return a},hasNext:function(){return h!==null}}},getCharCount:function(){for(var d=0,c=0;c<this._text.length;c++)d+=this._text[c].length;return d},getLine:function(d,c){var b=this.getLineCount();if(!(0<=d&&d<b))return null;var a=this._lineOffsets[d];if(d+1<b){b=this.getText(a,this._lineOffsets[d+1]);if(c)return b;for(var a=
b.length,h;(h=b.charCodeAt(a-1))===10||h===13;)a--;return b.substring(0,a)}else return this.getText(a)},getLineAtOffset:function(d){var c=this.getCharCount();if(!(0<=d&&d<=c))return-1;var b=this.getLineCount();if(d===c)return b-1;var a,h,f=this._lastLineIndex;if(0<=f&&f<b&&(a=this._lineOffsets[f],h=f+1<b?this._lineOffsets[f+1]:c,a<=d&&d<h))return f;for(var e=b,j=-1;e-j>1;)if(f=Math.floor((e+j)/2),a=this._lineOffsets[f],h=f+1<b?this._lineOffsets[f+1]:c,d<=a)e=f;else if(d<h){e=f;break}else j=f;return this._lastLineIndex=
e},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(d,c){var b=this.getLineCount();if(!(0<=d&&d<b))return-1;if(d+1<b){b=this._lineOffsets[d+1];if(c)return b;for(var a=this.getText(Math.max(this._lineOffsets[d],b-2),b),h=a.length,f;(f=a.charCodeAt(h-1))===10||f===13;)h--;return b-(a.length-h)}else return this.getCharCount()},getLineStart:function(d){return!(0<=d&&d<this.getLineCount())?-1:this._lineOffsets[d]},getText:function(d,
c){d===void 0&&(d=0);c===void 0&&(c=this.getCharCount());if(d===c)return"";for(var b=0,a=0,h;a<this._text.length;){h=this._text[a].length;if(d<=b+h)break;b+=h;a++}for(var f=b,e=a;a<this._text.length;){h=this._text[a].length;if(c<=b+h)break;b+=h;a++}if(e===a)return this._text[e].substring(d-f,c-b);f=this._text[e].substring(d-f);b=this._text[a].substring(0,c-b);return f+this._text.slice(e+1,a).join("")+b},onChanging:function(d){return this.dispatchEvent(d)},onChanged:function(d){return this.dispatchEvent(d)},
setLineDelimiter:function(d,c){d==="auto"&&(d=void 0,this.getLineCount()>1&&(d=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=d?d:k.platformDelimiter;if(c){var b=this.getLineCount();if(b>1){for(var a=Array(b),h=0;h<b;h++)a[h]=this.getLine(h);this.setText(a.join(this._lineDelimiter))}}},setText:function(d,c,b){d===void 0&&(d="");c===void 0&&(c=0);b===void 0&&(b=this.getCharCount());if(!(c===b&&d==="")){for(var a=this.getLineAtOffset(c),h=this.getLineAtOffset(b),f=c,e=
b-c,j=h-a,m=d.length,g=0,n=this.getLineCount(),i=0,k=0,q=0,r=[];;){i!==-1&&i<=q&&(i=d.indexOf("\r",q));k!==-1&&k<=q&&(k=d.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;r.push(c+q);g++}this.onChanging({type:"Changing",text:d,start:f,removedCharCount:e,addedCharCount:m,removedLineCount:j,addedLineCount:g});r.length===0&&(q=this.getLineStart(a),h=h+1<n?this.getLineStart(h+1):this.getCharCount(),c!==q&&(d=this.getText(q,c)+d,c=q),b!==h&&(d+=this.getText(b,
h),b=h));q=m-e;for(h=a+j+1;h<n;h++)this._lineOffsets[h]+=q;if(r.length<5E4)a=[a+1,j].concat(r),Array.prototype.splice.apply(this._lineOffsets,a);else{q=a+1;this._lineOffsets.splice(q,j);for(n=0;n<r.length;n+=5E4)a=[q,0].concat(r.slice(n,Math.min(r.length,n+5E4))),Array.prototype.splice.apply(this._lineOffsets,a),q+=5E4}for(q=n=0;q<this._text.length;){h=this._text[q].length;if(c<=n+h)break;n+=h;q++}a=n;for(r=q;q<this._text.length;){h=this._text[q].length;if(b<=n+h)break;n+=h;q++}h=this._text[q];c=
this._text[r].substring(0,c-a);b=h.substring(b-n);r=[r,q-r+1];c&&r.push(c);d&&r.push(d);b&&r.push(b);Array.prototype.splice.apply(this._text,r);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:f,removedCharCount:e,addedCharCount:m,removedLineCount:j,addedLineCount:g})}}};i.EventTarget.addMixin(g.prototype);return{TextModel:g}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(i,k){function g(c){if(c)this._view=c,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0}function d(c){g.call(this,c)}g.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(c){for(var b=[],a=this._keyBindings,d=0;d<a.length;d++)a[d].actionID===c&&b.push(a[d].keyBinding);return b},getView:function(){return this._view},isActive:function(){return this._view.getKeyModes().indexOf(this)!==-1},
match:function(c){switch(c.keyCode){case 16:case 17:case 18:case 91:return}for(var b=this._keyBindingIndex,a=this._matchingKeyBindings||this._keyBindings,d=[],f=0;f<a.length;f++){var e=a[f],j=e.keyBinding.match(c,b);if(j===!0)return this._keyBindingIndex=0,this._matchingKeyBindings=null,e.actionID;else typeof j==="number"&&d.push(e)}if(d.length===0)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=d,"noop"},setKeyBinding:function(c,
b){for(var a=this._keyBindings,d=0;d<a.length;d++){var f=a[d];if(f.keyBinding.equals(c)){b?f.actionID=b:f.predefined?f.actionID="noop":a.splice(d,1);return}}b&&a.push({keyBinding:c,actionID:b})},setView:function(c){this._view=c}};d.prototype=new g;d.prototype.createKeyBindings=function(){var c=i.KeyBinding,b=[];b.push({actionID:"lineUp",keyBinding:new c(38),predefined:!0});b.push({actionID:"lineDown",keyBinding:new c(40),predefined:!0});b.push({actionID:"charPrevious",keyBinding:new c(37),predefined:!0});
b.push({actionID:"charNext",keyBinding:new c(39),predefined:!0});k.isMac?(b.push({actionID:"scrollPageUp",keyBinding:new c(33),predefined:!0}),b.push({actionID:"scrollPageDown",keyBinding:new c(34),predefined:!0}),b.push({actionID:"pageUp",keyBinding:new c(33,null,null,!0),predefined:!0}),b.push({actionID:"pageDown",keyBinding:new c(34,null,null,!0),predefined:!0}),b.push({actionID:"lineStart",keyBinding:new c(37,!0),predefined:!0}),b.push({actionID:"lineEnd",keyBinding:new c(39,!0),predefined:!0}),
b.push({actionID:"wordPrevious",keyBinding:new c(37,null,null,!0),predefined:!0}),b.push({actionID:"wordNext",keyBinding:new c(39,null,null,!0),predefined:!0}),b.push({actionID:"scrollTextStart",keyBinding:new c(36),predefined:!0}),b.push({actionID:"scrollTextEnd",keyBinding:new c(35),predefined:!0}),b.push({actionID:"textStart",keyBinding:new c(38,!0),predefined:!0}),b.push({actionID:"textEnd",keyBinding:new c(40,!0),predefined:!0}),b.push({actionID:"scrollPageUp",keyBinding:new c(38,null,null,null,
!0),predefined:!0}),b.push({actionID:"scrollPageDown",keyBinding:new c(40,null,null,null,!0),predefined:!0}),b.push({actionID:"lineStart",keyBinding:new c(37,null,null,null,!0),predefined:!0}),b.push({actionID:"lineEnd",keyBinding:new c(39,null,null,null,!0),predefined:!0}),b.push({actionID:"lineStart",keyBinding:new c(38,null,null,!0),predefined:!0}),b.push({actionID:"lineEnd",keyBinding:new c(40,null,null,!0),predefined:!0})):(b.push({actionID:"pageUp",keyBinding:new c(33),predefined:!0}),b.push({actionID:"pageDown",
keyBinding:new c(34),predefined:!0}),b.push({actionID:"lineStart",keyBinding:new c(36),predefined:!0}),b.push({actionID:"lineEnd",keyBinding:new c(35),predefined:!0}),b.push({actionID:"wordPrevious",keyBinding:new c(37,!0),predefined:!0}),b.push({actionID:"wordNext",keyBinding:new c(39,!0),predefined:!0}),b.push({actionID:"textStart",keyBinding:new c(36,!0),predefined:!0}),b.push({actionID:"textEnd",keyBinding:new c(35,!0),predefined:!0}));k.isFirefox&&k.isLinux&&(b.push({actionID:"lineUp",keyBinding:new c(38,
!0),predefined:!0}),b.push({actionID:"lineDown",keyBinding:new c(40,!0),predefined:!0}));k.isWindows&&(b.push({actionID:"scrollLineUp",keyBinding:new c(38,!0),predefined:!0}),b.push({actionID:"scrollLineDown",keyBinding:new c(40,!0),predefined:!0}));b.push({actionID:"selectLineUp",keyBinding:new c(38,null,!0),predefined:!0});b.push({actionID:"selectLineDown",keyBinding:new c(40,null,!0),predefined:!0});b.push({actionID:"selectCharPrevious",keyBinding:new c(37,null,!0),predefined:!0});b.push({actionID:"selectCharNext",
keyBinding:new c(39,null,!0),predefined:!0});b.push({actionID:"selectPageUp",keyBinding:new c(33,null,!0),predefined:!0});b.push({actionID:"selectPageDown",keyBinding:new c(34,null,!0),predefined:!0});k.isMac?(b.push({actionID:"selectLineStart",keyBinding:new c(37,!0,!0),predefined:!0}),b.push({actionID:"selectLineEnd",keyBinding:new c(39,!0,!0),predefined:!0}),b.push({actionID:"selectWordPrevious",keyBinding:new c(37,null,!0,!0),predefined:!0}),b.push({actionID:"selectWordNext",keyBinding:new c(39,
null,!0,!0),predefined:!0}),b.push({actionID:"selectTextStart",keyBinding:new c(36,null,!0),predefined:!0}),b.push({actionID:"selectTextEnd",keyBinding:new c(35,null,!0),predefined:!0}),b.push({actionID:"selectTextStart",keyBinding:new c(38,!0,!0),predefined:!0}),b.push({actionID:"selectTextEnd",keyBinding:new c(40,!0,!0),predefined:!0}),b.push({actionID:"selectLineStart",keyBinding:new c(37,null,!0,null,!0),predefined:!0}),b.push({actionID:"selectLineEnd",keyBinding:new c(39,null,!0,null,!0),predefined:!0}),
b.push({actionID:"selectLineStart",keyBinding:new c(38,null,!0,!0),predefined:!0}),b.push({actionID:"selectLineEnd",keyBinding:new c(40,null,!0,!0),predefined:!0})):(k.isLinux&&(b.push({actionID:"selectWholeLineUp",keyBinding:new c(38,!0,!0),predefined:!0}),b.push({actionID:"selectWholeLineDown",keyBinding:new c(40,!0,!0),predefined:!0})),b.push({actionID:"selectLineStart",keyBinding:new c(36,null,!0),predefined:!0}),b.push({actionID:"selectLineEnd",keyBinding:new c(35,null,!0),predefined:!0}),b.push({actionID:"selectWordPrevious",
keyBinding:new c(37,!0,!0),predefined:!0}),b.push({actionID:"selectWordNext",keyBinding:new c(39,!0,!0),predefined:!0}),b.push({actionID:"selectTextStart",keyBinding:new c(36,!0,!0),predefined:!0}),b.push({actionID:"selectTextEnd",keyBinding:new c(35,!0,!0),predefined:!0}));b.push({actionID:"undo",keyBinding:new i.KeyBinding("z",!0),predefined:!0});k.isMac?b.push({actionID:"redo",keyBinding:new i.KeyBinding("z",!0,!0),predefined:!0}):b.push({actionID:"redo",keyBinding:new i.KeyBinding("y",!0),predefined:!0});
b.push({actionID:"deletePrevious",keyBinding:new c(8),predefined:!0});b.push({actionID:"deletePrevious",keyBinding:new c(8,null,!0),predefined:!0});b.push({actionID:"deleteNext",keyBinding:new c(46),predefined:!0});b.push({actionID:"deleteWordPrevious",keyBinding:new c(8,!0),predefined:!0});b.push({actionID:"deleteWordPrevious",keyBinding:new c(8,!0,!0),predefined:!0});b.push({actionID:"deleteWordNext",keyBinding:new c(46,!0),predefined:!0});b.push({actionID:"tab",keyBinding:new c(9),predefined:!0});
b.push({actionID:"shiftTab",keyBinding:new c(9,null,!0),predefined:!0});b.push({actionID:"enter",keyBinding:new c(13),predefined:!0});b.push({actionID:"enter",keyBinding:new c(13,null,!0),predefined:!0});b.push({actionID:"selectAll",keyBinding:new c("a",!0),predefined:!0});b.push({actionID:"toggleTabMode",keyBinding:new c("m",!0),predefined:!0});k.isMac&&(b.push({actionID:"deleteNext",keyBinding:new c(46,null,!0),predefined:!0}),b.push({actionID:"deleteWordPrevious",keyBinding:new c(8,null,null,!0),
predefined:!0}),b.push({actionID:"deleteWordNext",keyBinding:new c(46,null,null,!0),predefined:!0}));b.push({actionID:"toggleWrapMode",keyBinding:new i.KeyBinding("w",!0,!1,!0)});b.push({actionID:"toggleOverwriteMode",keyBinding:new i.KeyBinding(45)});if(!k.isFirefox){var a=k.isMac&&k.isChrome;b.push({actionID:"noop",keyBinding:new c("u",!a,!1,!1,a),predefined:!0});b.push({actionID:"noop",keyBinding:new c("i",!a,!1,!1,a),predefined:!0});b.push({actionID:"noop",keyBinding:new c("b",!a,!1,!1,a),predefined:!0})}k.isFirefox&&
(b.push({actionID:"copy",keyBinding:new c(45,!0),predefined:!0}),b.push({actionID:"paste",keyBinding:new c(45,null,!0),predefined:!0}),b.push({actionID:"cut",keyBinding:new c(46,null,!0),predefined:!0}));k.isMac&&(b.push({actionID:"lineStart",keyBinding:new c("a",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"lineEnd",keyBinding:new c("e",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"lineUp",keyBinding:new c("p",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"lineDown",keyBinding:new c("n",!1,!1,
!1,!0),predefined:!0}),b.push({actionID:"charPrevious",keyBinding:new c("b",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"charNext",keyBinding:new c("f",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"deletePrevious",keyBinding:new c("h",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"deleteNext",keyBinding:new c("d",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"deleteLineEnd",keyBinding:new c("k",!1,!1,!1,!0),predefined:!0}),k.isFirefox?(b.push({actionID:"scrollPageDown",keyBinding:new c("v",!1,
!1,!1,!0),predefined:!0}),b.push({actionID:"deleteLineStart",keyBinding:new c("u",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"deleteWordPrevious",keyBinding:new c("w",!1,!1,!1,!0),predefined:!0})):(b.push({actionID:"pageDown",keyBinding:new c("v",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"centerLine",keyBinding:new c("l",!1,!1,!1,!0),predefined:!0}),b.push({actionID:"enterNoCursor",keyBinding:new c("o",!1,!1,!1,!0),predefined:!0})));return b};return{KeyMode:g,DefaultKeyMode:d}});
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(i,k,g,d,c,b){function a(a,b,c,e){typeof a.addEventListener==="function"?a.addEventListener(b,c,e===!0):a.attachEvent("on"+b,c)}function h(a,c,e){if(e){c.className="";for(var e=c.attributes,d=e.length;d-- >0;)(!b.isIE||b.isIE>=9||b.isIE<9&&e[d].specified)&&c.removeAttribute(e[d].name)}if(a){if(a.styleClass)c.className=
a.styleClass;if(e=a.style)for(var f in e)e.hasOwnProperty(f)&&(c.style[f]=e[f]);if(a=a.attributes)for(var j in a)a.hasOwnProperty(j)&&c.setAttribute(j,a[j])}}function f(a){return a instanceof Array?a.slice(0):a}function e(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 j(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(!j(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(!j(a[c],b[c]))return!1}for(c in b)if(!a.hasOwnProperty(c))return!1;return!0}function m(a,b,c){for(var e=0,d=0,f=0,j=a.length;f<j;){e!==-1&&e<=f&&(e=a.indexOf("\r",f));d!==-1&&d<=f&&(d=a.indexOf("\n",f));var h=f,m;if(d===-1&&e===-1){b(a.substring(f));
break}e!==-1&&d!==-1?e+1===d?(m=e,f=d+1):(m=e<d?e:d,f=(e<d?e:d)+1):e!==-1?(m=e,f=e+1):(m=d,f=d+1);b(a.substring(h,m));c()}}function o(a){var b,c,e,d,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"),e=a.getPropertyValue("padding-right"),d=a.getPropertyValue("padding-bottom");else if(a.currentStyle)b=a.currentStyle.paddingLeft,c=a.currentStyle.paddingTop,e=a.currentStyle.paddingRight,
d=a.currentStyle.paddingBottom;return{left:parseInt(b,10)||0,top:parseInt(c,10)||0,right:parseInt(e,10)||0,bottom:parseInt(d,10)||0}}function n(a){var b,c,e,d,f=a._trim;if(!f){var f=o(a),j=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(j.getComputedStyle)d=j.getComputedStyle(a,null),b=d.getPropertyValue("border-left-width"),c=d.getPropertyValue("border-top-width"),e=d.getPropertyValue("border-right-width"),d=d.getPropertyValue("border-bottom-width");else if(a.currentStyle)b=a.currentStyle.borderLeftWidth,
c=a.currentStyle.borderTopWidth,e=a.currentStyle.borderRightWidth,d=a.currentStyle.borderBottomWidth;b=parseInt(b,10)||0;c=parseInt(c,10)||0;e=parseInt(e,10)||0;d=parseInt(d,10)||0;f.left+=b;f.top+=c;f.right+=e;f.bottom+=d;a._trim=f}return f}function p(a,b,c){this.start=a;this.end=b;this.caret=c}function s(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 r(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(){},l=this.options.curve[0],e=this.options.curve[1],d=e-l,f=-1,j,h=this;this.interval=this.options.window.setInterval(function(){f=f===-1?(new Date).getTime():f;var m=((new Date).getTime()-f)/a;m<1?(m=b(m),j=l+m*d,c(j)):(c(e),h.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}();p.prototype={clone:function(){return new p(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}};s.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(a,c,e){var d=this.view,f=d._model,m=f.getLine(e),g=f.getLineStart(e),o={type:"LineStyle",textView:d,lineIndex:e,lineText:m,lineStart:g};if(m.length<2E3)d.onLineStyle(o);f=c||b.createElement(a.ownerDocument,"div");if(!c||!j(c.viewStyle,o.style)){h(o.style,f,c);if(c)c._trim=null;f.viewStyle=o.style;f.setAttribute("role","presentation")}f.lineIndex=e;e=[];this._createRanges(o.ranges,m,0,m.length,g,{tabOffset:0,ranges:e});m=" ";!d._fullSelection&&b.isIE<9&&(m="\ufeff");
b.isWebkit&&(m="\u200c");o={text:m,style:d._metrics.largestFontStyle,ignoreChars:1};e.length===0||!e[e.length-1].style||e[e.length-1].style.tagName!=="div"?e.push(o):e.splice(e.length-1,0,o);var n,i,k,p,s,m=d=0,q,r;if(c){if(i=c.modelChangedEvent)i.removedLineCount===0&&i.addedLineCount===0?(r=i.start-g,q=i.addedCharCount-i.removedCharCount):r=-1,c.modelChangedEvent=void 0;i=c.firstChild}for(g=0;g<e.length;g++){o=e[g];p=o.text;d+=p.length;n=o.style;if(i)if(s=i.firstChild.data,k=i.viewStyle,s===p&&
j(n,k)){m+=s.length;i._rectsCache=void 0;n=i=i.nextSibling;continue}else for(;i;){if(r!==-1){k=d;k>=r&&(k-=q);s=(s=i.firstChild.data)?s.length:0;if(m+s>k)break;m+=s}k=i.nextSibling;f.removeChild(i);i=k}n=this._createSpan(f,p,n,o.ignoreChars);i?f.insertBefore(n,i):f.appendChild(n);if(c)c.lineWidth=void 0}if(c)for(a=n?n.nextSibling:null;a;)k=a.nextSibling,c.removeChild(a),a=k;else a.appendChild(f);return f},_createRanges:function(a,b,c,e,d,f){if(!(c>e)){if(a)for(var h=0;h<a.length;h++){var m=a[h];if(!(m.end<
d+c)){var g=Math.max(d+c,m.start)-d;if(g>e)break;var o=Math.min(d+e,m.end)-d;if(g<=o){g=Math.max(c,g);o=Math.min(e,o);for(c<g&&this._createRange(b,c,g,null,f);h+1<a.length&&a[h+1].start-d===o&&j(m.style,a[h+1].style);)m=a[h+1],o=Math.min(d+e,m.end)-d,h++;this._createRange(b,g,o,m.style,f);c=o}}}c<e&&this._createRange(b,c,e,null,f)}},_createRange:function(a,b,c,e,d){if(!(b>c)){var f=this.view._customTabSize;if(f&&f!==8)for(var j=a.indexOf("\t",b);j!==-1;){b<j&&(b={text:a.substring(b,j),style:e},d.ranges.push(b),
d.tabOffset+=b.text.length);b=f-d.tabOffset%f;if(b>0){for(var h="\u00a0",m=1;m<b;m++)h+=" ";b={text:h,style:e,ignoreChars:b-1};d.ranges.push(b);d.tabOffset+=b.text.length}b=j+1;if(b===c)return;j=a.indexOf("\t",b)}b<=c&&(b={text:a.substring(b,c),style:e},d.ranges.push(b),d.tabOffset+=b.text.length)}},_createSpan:function(c,e,d,f){var j=this.view,m="span";d&&d.tagName&&(m=d.tagName.toLowerCase());var g=m==="a";if(g)c.hasLink=!0;g&&!j._linksVisible&&(m="span");g=c.ownerDocument;c=b.createElement(c.ownerDocument,
m);d&&d.html?(c.innerHTML=d.html,c.ignore=!0):d&&d.node?(c.appendChild(d.node),c.ignore=!0):c.appendChild(g.createTextNode(d&&d.text?d.text:e));h(d,c);if(m==="a"){var o=j._getWindow();a(c,"click",function(a){return j._handleLinkClick(a?a:o.event)},!1)}c.viewStyle=d;if(f)c.ignoreChars=f;return c},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(a,c){var e=this._ensureCreated(),d=this.view;if(a===void 0)return this._getLineBoundingClientRect(e,
!0);var f=d._model,j=e.ownerDocument,h=this.lineIndex,m=null;if(a<f.getLineEnd(h)){f=f.getLineStart(h);for(h=e.firstChild;h;){if(!h.ignore){var g=h.firstChild,o=g.length;h.ignoreChars&&(o-=h.ignoreChars);if(f+o>a){m=a-f;if(d._isRangeRects)j=j.createRange(),j.setStart(g,m),j.setEnd(g,m+1),m=new s(j.getBoundingClientRect());else if(b.isIE)j=j.body.createTextRange(),j.moveToElementText(h),j.collapse(),j.moveEnd("character",m+1),j.moveStart("character",m),m=new s(j.getBoundingClientRect());else{var n=
g.data;h.removeChild(g);h.appendChild(j.createTextNode(n.substring(0,m)));var i=b.createElement(j,"span");i.appendChild(j.createTextNode(n.substring(m,m+1)));h.appendChild(i);h.appendChild(j.createTextNode(n.substring(m+1)));m=new s(i.getBoundingClientRect());h.innerHTML="";h.appendChild(g);this._createdDiv||(j=d._getSelection(),(f<=j.start&&j.start<f+o||f<=j.end&&j.end<f+o)&&d._updateDOMSelection())}b.isIE&&(j=e.ownerDocument.defaultView||e.ownerDocument.parentWindow,e=j.screen.logicalXDPI/j.screen.deviceXDPI,
j=j.screen.logicalYDPI/j.screen.deviceYDPI,m.left*=e,m.right*=e,m.top*=j,m.bottom*=j);break}f+=o}h=h.nextSibling}}e=this.getBoundingClientRect();if(!m)d._wrapMode?(d=this.getClientRects(),m=d[d.length-1],m.left=m.right,m.left+=e.left,m.top+=e.top,m.right+=e.left,m.bottom+=e.top):(m=new s(e),m.left=m.right);if(c||c===void 0)m.left-=e.left,m.top-=e.top,m.right-=e.left,m.bottom-=e.top;return m},_getClientRects:function(a,b){var c,e,d,f;if(!a._rectsCache){c=a.getClientRects();e=Array(c.length);for(f=
0;f<c.length;f++)d=e[f]=new s(c[f]),d.left-=b.left,d.top-=b.top,d.right-=b.left,d.bottom-=b.top;a._rectsCache=e}c=a._rectsCache;e=[c.length];for(f=0;f<c.length;f++)e[f]=new s(c[f]);return e},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var b=this._ensureCreated(),c=[],e=b.firstChild,d,f=b.getBoundingClientRect();e;){if(!e.ignore)for(var j=this._getClientRects(e,f),b=0;b<j.length;b++){var h=j[b],m;if(h.top!==h.bottom){var g=h.top+(h.bottom-h.top)/2;for(m=
0;m<c.length;m++)if(d=c[m],d.top<=g&&g<d.bottom)break;if(m===c.length)c.push(h);else{if(h.left<d.left)d.left=h.left;if(h.top<d.top)d.top=h.top;if(h.right>d.right)d.right=h.right;if(h.bottom>d.bottom)d.bottom=h.bottom}}}e=e.nextSibling}return a!==void 0?c[a]:c},_getLineBoundingClientRect:function(a,b){var c=new s(a.getBoundingClientRect());if(!this.view._wrapMode){c.right=c.left;for(var e=a.lastChild;e&&e.ignoreChars===e.firstChild.length;)e=e.previousSibling;if(e)e=e.getBoundingClientRect(),c.right=
e.right+n(a).right}b&&(e=n(a),c.left+=e.left,c.right-=e.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(a,c){var e=this.view,d=e._model,f=this.lineIndex,j=d.getLineStart(f),h=d.getLineEnd(f);if(j===h)return j;var m=this._ensureCreated(),g=this.getBoundingClientRect(),o,n;if(e._wrapMode){o=this.getClientRects();if(c<o[0].top)c=o[0].top;for(var i=0;i<o.length;i++)if(n=o[i],n.top<=c&&c<n.bottom)break;if(a<n.left)a=n.left;a>n.right&&(a=n.right-1)}else a<0&&(a=0),a>g.right-g.left&&(a=g.right-g.left);var k=m.ownerDocument,i=k.defaultView||
k.parentWindow,p=b.isIE?i.screen.logicalXDPI/i.screen.deviceXDPI:1,s=b.isIE?i.screen.logicalYDPI/i.screen.deviceYDPI:1,i=j,q=m.firstChild;a:for(;q;){if(!q.ignore){var r=q.firstChild,m=r.length;q.ignoreChars&&(m-=q.ignoreChars);var t,B,C;o=this._getClientRects(q,g);for(var F=0;F<o.length;F++)if(n=o[F],n.left<=a&&a<n.right&&(!e._wrapMode||n.top<=c&&c<n.bottom)){if(b.isIE||e._isRangeRects){for(var k=e._isRangeRects?k.createRange():k.body.createTextRange(),F=m,M=-1;F-M>1;){var I=Math.floor((F+M)/2);o=
M+1;n=I===m-1&&q.ignoreChars?r.length:I+1;e._isRangeRects?(k.setStart(r,o),k.setEnd(r,n)):(k.moveToElementText(q),k.move("character",o),k.moveEnd("character",n-o));o=k.getClientRects();for(var P=!1,N=0;N<o.length;N++)if(n=o[N],t=n.left*p-g.left,C=n.right*p-g.left,B=n.top*s-g.top,n=n.bottom*s-g.top,t<=a&&a<C&&(!e._wrapMode||B<=c&&c<n)){P=!0;break}P?F=I:M=I}i+=F;o=F;n=F===m-1&&q.ignoreChars?r.length:Math.min(F+1,r.length);e._isRangeRects?(k.setStart(r,o),k.setEnd(r,n)):(k.moveToElementText(q),k.move("character",
o),k.moveEnd("character",n-o));n=k.getClientRects()[0];t=n.left*p-g.left;C=n.right*p-g.left;e=a>t+(C-t)/2;g=i-j;d=d.getLine(f);f=d.charCodeAt(g);55296<=f&&f<=56319&&e?g<d.length&&(f=d.charCodeAt(g+1),56320<=f&&f<=57343&&(i+=1)):56320<=f&&f<=57343&&!e&&g>0&&(f=d.charCodeAt(g-1),55296<=f&&f<=56319&&(i-=1));e&&i++}else{d=[];for(f=0;f<m;f++)d.push("<span>"),f===m-1?d.push(r.data.substring(f)):d.push(r.data.substring(f,f+1)),d.push("</span>");q.innerHTML=d.join("");for(d=q.firstChild;d;){n=d.getBoundingClientRect();
t=n.left-g.left;C=n.right-g.left;if(t<=a&&a<C){a>t+(C-t)/2&&i++;break}i++;d=d.nextSibling}if(!this._createdDiv)q.innerHTML="",q.appendChild(r),g=e._getSelection(),(i<=g.start&&g.start<i+m||i<=g.end&&g.end<i+m)&&e._updateDOMSelection()}break a}i+=m}q=q.nextSibling}return Math.min(h,Math.max(j,i))},getNextOffset:function(a,c){if(c.unit==="line"){var e=this.view._model,d=e.getLineAtOffset(a);if(c.count>0)return c.count--,e.getLineEnd(d);c.count++;return e.getLineStart(d)}return c.unit==="wordend"||c.unit===
"wordWS"||c.unit==="wordendWS"?this._getNextOffset_W3C(a,c):b.isIE?this._getNextOffset_IE(a,c):this._getNextOffset_W3C(a,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 e(a){return a===32||a===9}var d=this.view._model,f=d.getLineAtOffset(a),j=d.getLine(f),h=d.getLineStart(f),d=d.getLineEnd(f),f=j.length,m=a-h,g,o=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(m===f)return d;g=j.charCodeAt(m);n=c(g);i=!n&&!e(g);for(m++;m<f;){g=j.charCodeAt(m);if(b.unit!=="wordWS"&&b.unit!=="wordendWS"){k=c(g);if(b.unit==="wordend"){if(!k&&n)break}else if(k&&!n)break;g=!k&&!e(g)}else g=!e(g);if(b.unit==="wordend"||b.unit==="wordendWS"){if(!g&&i)break}else if(g&&!i)break;i=g;n=k;m++}}else{if(m===0)return h;m--;g=j.charCodeAt(m);n=c(g);for(i=!n&&!e(g);0<m;){g=j.charCodeAt(m-1);if(b.unit!=="wordWS"&&b.unit!=="wordendWS"){k=c(g);if(b.unit===
"wordend"){if(k&&!n)break}else if(!k&&n)break;g=!k&&!e(g)}else g=!e(g);if(b.unit==="wordend"||b.unit==="wordendWS"){if(g&&!i)break}else if(!g&&i)break;i=g;n=k;m--}}b.count-=o}else for(;b.count!==0&&0<=m+o&&m+o<=f;)m+=o,g=j.charCodeAt(m),56320<=g&&g<=57343&&m>0&&(g=j.charCodeAt(m-1),55296<=g&&g<=56319&&(m+=o)),b.count-=o;return h+m},_getNextOffset_IE:function(a,b){var c=this._ensureCreated(),e=this.view._model,d=this.lineIndex,f=0,j;j=e.getLineStart(d);var h=c.ownerDocument,m=b.count<0?-1:1;if(a===
e.getLineEnd(d)){for(c=c.lastChild;c&&c.ignoreChars;)c=c.previousSibling;if(!c)return j;f=h.body.createTextRange();f.moveToElementText(c);j=f.text.length;f.moveEnd(b.unit,m);f=a+f.text.length-j}else if(a===j&&b.count<0)f=j;else for(c=c.firstChild;c;){e=c.firstChild.length;c.ignoreChars&&(e-=c.ignoreChars);if(j+e>a){f=h.body.createTextRange();a===j&&b.count<0?f.moveToElementText(c.previousSibling):(f.moveToElementText(c),f.collapse(),f.moveEnd("character",a-j));j=f.text.length;f.moveEnd(b.unit,m);
f=a+f.text.length-j;break}j=e+j;c=c.nextSibling}b.count-=m;return f},destroy:function(){var a=this._createdDiv;if(a)a.parentNode.removeChild(a),this._createdDiv=null}};r.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 e,d;for(e=0,d=0;e<c.length&&d<b;e++)a.getLocation()===c[e].getLocation()&&d++;c.splice(d,0,a);b=d}else c.push(a);this._createRuler(a,
b);this._update()},computeSize:function(){var a=0,c=0,e=this._model,d=this._clientDiv;if(!d)return{width:a,height:c};var f=d.style.width;if(b.isWebkit)d.style.width="0x7fffffffpx";for(var e=e.getLineCount(),j=0;j<e;j++){var h=this._getLine(j),m=h.getBoundingClientRect(),a=Math.max(a,m.right-m.left);c+=m.bottom-m.top;h.destroy()}if(b.isWebkit)d.style.width=f;d=this._getViewPadding();a+=d.right+d.left+this._metrics.scrollWidth;c+=d.bottom+d.top+this._metrics.scrollWidth;return{width:a,height:c}},convert:function(a,
b,c){if(this._clientDiv){var e=this._getScroll(),d=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect();b==="document"&&(a.x!==void 0&&(a.x+=-e.x+f.left+d.left),a.y!==void 0&&(a.y+=-e.y+f.top+d.top));c==="document"&&(a.x!==void 0&&(a.x+=e.x-f.left-d.left),a.y!==void 0&&(a.y+=e.y-f.top-d.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(),b.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,e;for(e in c)c.hasOwnProperty(e)&&(a||!c[e].defaultHandler)&&b.push(e);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,
e=0;e<c.length;e++)b=b.concat(c[e].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 f(this["_"+a])}else{a={};for(var b in arguments)arguments.hasOwnProperty(b)&&(a[arguments[b]]=void 0)}for(var c in a)a.hasOwnProperty(c)&&(a[c]=f(this["_"+c]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,b){if(!this._clientDiv)return 0;
var c=this._getLineIndex(b),e=this._getLine(c),c=e.getOffset(a,b-this._getLinePixel(c));e.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(),e=0;e<c.length;e++)this.redrawLines(a,b,c[e])},redrawLines:function(a,b,c){if(!(this._redrawCount>0)&&(a===void 0&&(a=0),b===void 0&&(b=this._model.getLineCount()),a!==b)){var e=this._clientDiv;if(e){if(c)for(e=(c.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild;e;){if(e._ruler===c)break;e=e.nextSibling}c?e.rulerChanged=
!0:this._lineHeight&&this._resetLineHeight(a,b);if(!c||c.getOverview()==="page")for(e=e.firstChild;e;){var d=e.lineIndex;if(a<=d&&d<b)e.lineChanged=!0;e=e.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 e=c.getLineAtOffset(a),c=c.getLineAtOffset(Math.max(a,
b-1))+1;this.redrawLines(e,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 e=this._actions,d=e[a];d||(d=e[a]={});d.handler=b;if(c!==void 0)d.actionDescription=
c}},setKeyBinding:function(a,b){this._keyModes[0].setKeyBinding(a,b)},setCaretOffset:function(a,b,c){var e=this._model.getCharCount(),a=Math.max(0,Math.min(a,e));this._setSelection(new p(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(),e=a.getLineCount(),d=a.getCharCount(),f={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:c,addedCharCount:d,removedLineCount:b,addedLineCount:e};this.onModelChanging(f);this._model=a;f={type:"ModelChanged",start:0,removedCharCount:c,addedCharCount:d,removedLineCount:b,addedLineCount:e};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(),c;for(c in a)if(a.hasOwnProperty(c)){var e=a[c];if(!j(this["_"+c],e)){var d=b[c]?b[c].update:null;d?d.call(this,e):this["_"+c]=f(e)}}},setSelection:function(a,b,c,e){var d=a>b;if(d)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 p(a,b,d),
c===void 0||c,!0,e)},setText:function(a,c,e){var d=c===void 0&&e===void 0;c===void 0&&(c=0);e===void 0&&(e=this._model.getCharCount());if(d)this._variableLineHeight=!1;this._modifyContent({text:a,start:c,end:e,_code:!0},!d);if(d)this._columnX=-1,this._setSelection(new p(0,0,!1),!0),b.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(a){if(!this._ignoreEvent(a)){if(b.isFirefox&&a.which===1)this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0;var c=this._overlayDiv||this._clientDiv;if(b.isIE<9)c=this._viewDiv;for(var e=a.target?a.target:a.srcElement;e;){if(c===e)return;
e=e.parentNode}a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();if(!this._isW3CEvents){var d=this;this._getWindow().setTimeout(function(){d._clientDiv.focus()},0)}}},_handleRootMouseUp:function(a){if(!this._ignoreEvent(a)&&b.isFirefox&&a.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(b.isIE<9&&!this._getSelection().isEmpty()){var a=
this._rootDiv,c=b.createElement(a.ownerDocument,"div");a.appendChild(c);a.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",a=this._getWindow(),c=this._selDiv1.ownerDocument,a.getSelection){c=a.getSelection();for(a=c.anchorNode;a;){if(a===this._clientDiv){c.rangeCount>0&&c.removeAllRanges();break}a=a.parentNode}}else if(c.selection){this._ignoreSelect=
!1;for(a=c.selection.createRange().parentElement();a;){if(a===this._clientDiv){c.selection.empty();break}a=a.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(a){if(!this._ignoreEvent(a)){b.isIE&&this._lastMouseButton===3&&this._updateDOMSelection();var c=!1;this.isListening("ContextMenu")?(c=this._createMouseEvent("ContextMenu",a),c.screenX=a.screenX,c.screenY=a.screenY,this.onContextMenu(c),c=c.defaultPrevented):b.isMac&&b.isFirefox&&
a.button===0&&(c=!0);if(c)return a.preventDefault&&a.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(a){if(!this._ignoreEvent(a)){if(b.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",a)),this._dragOffset=-1;else return a.preventDefault&&a.preventDefault(),!1}},_handleDrag:function(a){if(!this._ignoreEvent(a)&&
this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",a))},_handleDragEnd:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",a));b.isFirefox&&(this._fixCaret(),a.dataTransfer.dropEffect==="none"&&!a.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(a){if(!this._ignoreEvent(a)){var c=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(c=!1,this.onDragEnter(this._createMouseEvent("DragEnter",
a)));if(b.isWebkit||c)return a.preventDefault&&a.preventDefault(),!1}},_handleDragOver:function(a){if(!this._ignoreEvent(a)){var c=!0;this.isListening("DragOver")&&(c=!1,this.onDragOver(this._createMouseEvent("DragOver",a)));if(b.isWebkit||c){if(c)a.dataTransfer.dropEffect="none";a.preventDefault&&a.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;b.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 a=this._highlightRGB;this._selDiv1.style.background=a;this._selDiv2.style.background=a;this._selDiv3.style.background=
a}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyDown")){var c=this._createKeyEvent("KeyDown",a);this.onKeyDown(c);if(c.defaultPrevented){if(b.isFirefox)this._keyDownPrevented=!0;a.preventDefault();return}}c=!1;switch(a.keyCode){case 16:case 17:case 18:case 91:c=!0;break;default:this._setLinksVisible(!1)}if(a.keyCode===229){if(this._readonly)return a.preventDefault&&a.preventDefault(),!1;c=!0;if(b.isSafari&&b.isMac&&
a.ctrlKey)c=!1,a.keyCode=129;c&&this._startIME()}else c||this._commitIME();if((b.isMac||b.isLinux)&&b.isFirefox<4||b.isOpera)return this._keyDownEvent=a,!0;if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1}},_handleKeyPress:function(a){if(!this._ignoreEvent(a))if(this._keyDownPrevented)a.preventDefault&&(a.preventDefault(),a.stopPropagation()),this._keyDownPrevented=void 0;else{if(b.isMac&&b.isWebkit&&(63232<=
a.keyCode&&a.keyCode<=63487||a.keyCode===13||a.keyCode===8))return a.preventDefault&&a.preventDefault(),!1;if(((b.isMac||b.isLinux)&&b.isFirefox<4||b.isOpera)&&this._doAction(this._keyDownEvent))return a.preventDefault&&a.preventDefault(),!1;var c=b.isMac?a.metaKey:a.ctrlKey;if(a.charCode!==void 0&&c)switch(a.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(c=this._createKeyEvent("KeyPress",a),this.onKeyPress(c),c.defaultPrevented)){a.preventDefault();return}if(this._doAction(a))return a.preventDefault?
(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1;c=!1;if(b.isMac){if(a.ctrlKey||a.metaKey)c=!0}else if(b.isFirefox){if(a.ctrlKey||a.altKey)c=!0}else a.ctrlKey^a.altKey&&(c=!0);if(!c&&(c=b.isOpera?a.which:a.charCode!==void 0?a.charCode:a.keyCode,c>31))return this._doContent(String.fromCharCode(c)),a.preventDefault&&a.preventDefault(),!1}},_handleKeyUp:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyUp")){var c=this._createKeyEvent("KeyUp",a);
this.onKeyUp(c);if(c.defaultPrevented){a.preventDefault();return}}(b.isMac?a.metaKey:a.ctrlKey)||this._setLinksVisible(!1);a.keyCode===13&&this._commitIME()}},_handleLinkClick:function(a){if(!(b.isMac?a.metaKey:a.ctrlKey))return a.preventDefault&&a.preventDefault(),!1},_handleMouse:function(a){var c=this._getWindow(),e=!0,d=c;if(b.isIE||b.isFirefox&&!this._overlayDiv)d=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?(e=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,!b.isOpera&&this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(d):(this._isW3CEvents&&this._setGrab(d),this._doubleClickSelection=null,this._setSelectionTo(a.clientX,a.clientY,a.shiftKey),this._doubleClickSelection=this._getSelection());return e},_handleMouseDown:function(a){if(!this._ignoreEvent(a)){if(this._linksVisible)if((a.target||a.srcElement).tagName!=="A")this._setLinksVisible(!1);else return;this._commitIME();
var c=a.which;c||(a.button===4&&(c=2),a.button===2&&(c=3),a.button===1&&(c=1));var e=c!==2&&a.timeStamp?a.timeStamp:(new Date).getTime(),d=e-this._lastMouseTime,f=Math.abs(this._lastMouseX-a.clientX),j=Math.abs(this._lastMouseY-a.clientY),h=this._lastMouseButton===c;this._lastMouseX=a.clientX;this._lastMouseY=a.clientY;this._lastMouseTime=e;this._lastMouseButton=c;if(c===1)this._isMouseDown=!0,h&&d<=this._clickTime&&f<=this._clickDist&&j<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&
(e=this._createMouseEvent("MouseDown",a),this.onMouseDown(e),e.defaultPrevented)){a.preventDefault();return}if(c===1&&this._handleMouse(a)&&(b.isIE>=9||b.isOpera||b.isChrome||b.isSafari||b.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),a.preventDefault();b.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(a){if(!this._animation){var c=this._isClientDiv(a);if(this.isListening("MouseMove")&&c)this.onMouseMove(this._createMouseEvent("MouseMove",a));if(!this._dropTarget){var e=this._linksVisible||this._lastMouseMoveX!==a.clientX||this._lastMouseMoveY!==a.clientY;this._lastMouseMoveX=a.clientX;this._lastMouseMoveY=a.clientY;this._setLinksVisible(e&&!this._isMouseDown&&(b.isMac?
a.metaKey:a.ctrlKey));if(!this._isW3CEvents){if(a.button===0)return this._setGrab(null),!0;if(!this._isMouseDown&&a.button===1&&(this._clickCount&1)!==0&&c)return this._clickCount=2,this._handleMouse(a,this._clickCount)}if(this._isMouseDown&&this._dragOffset===-1){var c=a.clientX,a=a.clientY,d=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect(),j=this._getClientWidth(),h=this._getClientHeight(),e=f.left+d.left,m=f.top+d.top,j=f.left+d.left+j,d=f.top+d.top+h;a<m?this._doAutoScroll("up",
c,a-m):a>d?this._doAutoScroll("down",c,a-d):c<e&&!this._wrapMode?this._doAutoScroll("left",c-e,a):c>j&&!this._wrapMode?this._doAutoScroll("right",c-j,a):(this._endAutoScroll(),this._setSelectionTo(c,a,!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(a){var c=a.which?a.button===0:a.button===1;if(this.isListening("MouseUp")&&(this._isClientDiv(a)||c&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",a));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);b.isFirefox&&a.preventDefault()}},_handleMouseWheel:function(a){var c=this._getLineHeight(),e=0,d=0;b.isIE||b.isOpera?d=-a.wheelDelta/40*c:b.isFirefox?(c=b.isMac?a.detail*3:Math.max(-256,Math.min(256,a.detail))*c,a.axis===a.HORIZONTAL_AXIS?e=c:d=c):b.isMac?(d=a.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=a.timeStamp,e=a.wheelDeltaX%120!==0?1:d<40?40/(40-d):40,d=
a.wheelDeltaY%120!==0?1:d<40?40/(40-d):40,e=Math.ceil(-a.wheelDeltaX/e),-1<e&&e<0&&(e=-1),0<e&&e<1&&(e=1),d=Math.ceil(-a.wheelDeltaY/d),-1<d&&d<0&&(d=-1),0<d&&d<1&&(d=1)):(e=-a.wheelDeltaX,d=-a.wheelDeltaY/120*8*c);if(b.isSafari){for(c=a.target;c&&c.lineIndex===void 0;)c=c.parentNode;this._mouseWheelLine=c}c=this._getScroll();this._scrollView(e,d);e=this._getScroll();if(c.x!==e.x||c.y!==e.y)return a.preventDefault&&a.preventDefault(),!1},_handlePaste:function(a){if(!this._ignoreEvent(a)&&!this._ignorePaste&&
this._doPaste(a)){if(b.isIE){var c=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){c._updateDOMSelection();c._ignoreFocus=!1},0)}a.preventDefault&&a.preventDefault();return!1}},_handleResize:function(){var a=this._parent.clientWidth,c=this._parent.clientHeight;if(this._parentWidth!==a||this._parentHeight!==c)this._parentWidth!==a&&this._wrapMode&&this._resetLineHeight(),this._parentWidth=a,this._parentHeight=c,b.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(),e=this._model.getLineCount(),d=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect(),c=Math.floor((a.clientY-f.top-this._metrics.scrollWidth)*e/(c+d.top+d.bottom-2*this._metrics.scrollWidth));0<=c&&c<e||(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 e=0,d=c.lineIndex;if(a.tagName!=="DIV")for(c=c.firstChild;c;){var f=c.firstChild;if(f===a){c.ignoreChars&&(e-=c.ignoreChars);e+=b;break}c.ignoreChars&&(e-=c.ignoreChars);e+=f.data.length;c=c.nextSibling}return Math.max(0,e)+this._model.getLineStart(d)}},_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 p(b,a),!1,!1)},_handleSelectionChange:function(){if(this._imeOffset===-1)if(b.isAndroid){var a=this._getWindow();this._selTimer&&a.clearTimeout(this._selTimer);var c=this;this._selTimer=a.setTimeout(function(){if(c._clientDiv)c._selTimer=null,c._updateSelectionFromDOM()},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(a){if(!this._ignoreEvent(a)){this._imeOffset=-1;if(b.isAndroid){for(var c=
this._getWindow().getSelection(),e=c.anchorNode;e;){if(e.lineIndex!==void 0)break;e=e.parentNode}if(e){var d=this._model,f=e.lineIndex,j=d.getLine(f),h=j,m=0,d=d.getLineStart(f);if(c.rangeCount>0)c.getRangeAt(0).deleteContents(),f=e.ownerDocument.createTextNode(a.data),c.getRangeAt(0).insertNode(f),m=this._getDOMText(e,f),h=m.text,m=m.offset,f.parentNode.removeChild(f);e.lineRemoved=!0;for(e=0;j.charCodeAt(e)===h.charCodeAt(e)&&e<m;)e++;c=j.length-1;for(f=h.length-j.length;j.charCodeAt(c)===h.charCodeAt(c+
f)&&c+f>=m+a.data.length;)c--;c++;j=h.substring(e,c+f);e+=d;c+=d;this._modifyContent({text:j,start:e,end:c,_ignoreDOMSelection:!0},!0)}}else this._doContent(a.data);a.preventDefault()}},_handleTouchStart:function(a){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 e=a.touches;if(e.length===1){var e=e[0],d=e.clientX,f=e.clientY;this._touchStartX=
d;this._touchStartY=f;if(b.isAndroid&&(f<e.pageY-c.pageYOffset||d<e.pageX-c.pageXOffset))d=e.pageX-c.pageXOffset,f=e.pageY-c.pageYOffset;c=this.convert({x:d,y:f},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(c.x,c.y);this._touchStartTime=a.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,e=this._getWindow();this._touchScrollTimer=e.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";e.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,e=this._keyModes;for(c=e.length-1;c>=0;c--)if(b=e[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,e=b.getCaret(),d=c.getLineAtOffset(e);
if(!a.count)a.count=1;for(;a.count!==0;){var f=c.getLineStart(d);if(a.count<0&&e===f)if(d>0)a.unit==="character"&&a.count++,d--,b.extend(c.getLineEnd(d));else break;else if(a.count>0&&e===c.getLineEnd(d))if(d+1<c.getLineCount())a.unit==="character"&&a.count--,d++,b.extend(c.getLineStart(d));else break;else{var j=!1;a.expandTab&&a.unit==="character"&&(e-f)%this._tabSize===0&&(j=!/[^ ]/.test(c.getText(f,e)));j?(b.extend(e-this._tabSize),a.count+=a.count<0?1:-1):(f=this._getLine(d),b.extend(f.getNextOffset(e,
a)),f.destroy())}e=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 e=c[b],d=e.toLowerCase(),e=d!==e?d:e.toUpperCase();a+=e}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,e=c.getLineAtOffset(b.end);b.end<c.getLineEnd(e)&&(c=this._getLine(e),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,e;if(a.ctrl)b.extend(c.getCharCount()),e=function(){};else{var d=b.getCaret(),f=c.getLineAtOffset(d);if(this._wrapMode){var j=this._getLine(f),
d=j.getLineIndex(d),d=d===j.getLineCount()-1?c.getLineEnd(f):j.getLineStart(d+1)-1;j.destroy()}else a.count&&a.count>0&&(f=Math.min(f+a.count-1,c.getLineCount()-1)),d=c.getLineEnd(f);b.extend(d)}a.select||b.collapse();this._setSelection(b,!0,!0,e);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,e;if(a.ctrl)b.extend(0),
e=function(){};else{var d=b.getCaret(),f=c.getLineAtOffset(d);this._wrapMode?(c=this._getLine(f),d=c.getLineIndex(d),d=c.getLineStart(d),c.destroy()):d=c.getLineStart(f);b.extend(d)}a.select||b.collapse();this._setSelection(b,!0,!0,e);return!0},_doLineDown:function(a){var c=this._model,e=this._getSelection(),d=e.getCaret(),f=c.getLineAtOffset(d),j=this._getLine(f),h=this._columnX,m=1,g=!1;if(h===-1||a.wholeLine||a.select&&b.isIE)h=a.wholeLine?c.getLineEnd(f+1):d,h=j.getBoundingClientRect(h).left;
(d=j.getLineIndex(d))<j.getLineCount()-1?m=j.getClientRects(d+1).top+1:(d=c.getLineCount()-1,g=f===d,a.count&&a.count>0?f=Math.min(f+a.count,d):f++);d=!1;if(g){if(a.select||b.isMac||b.isLinux)e.extend(c.getCharCount()),d=!0}else j.lineIndex!==f&&(j.destroy(),j=this._getLine(f)),e.extend(j.getOffset(h,m)),d=!0;d&&(a.select||e.collapse(),this._setSelection(e,!0,!0));this._columnX=h;j.destroy();return!0},_doLineUp:function(a){var c=this._model,e=this._getSelection(),d=e.getCaret(),f=c.getLineAtOffset(d),
j=this._getLine(f),h=this._columnX,m=!1,g;if(h===-1||a.wholeLine||a.select&&b.isIE)h=a.wholeLine?c.getLineStart(f-1):d,h=j.getBoundingClientRect(h).left;(d=j.getLineIndex(d))>0?g=j.getClientRects(d-1).top+1:(m=f===0,m||(a.count&&a.count>0?f=Math.max(f-a.count,0):f--,g=this._getLineHeight(f)-1));d=!1;if(m){if(a.select||b.isMac||b.isLinux)e.extend(0),d=!0}else j.lineIndex!==f&&(j.destroy(),j=this._getLine(f)),e.extend(j.getOffset(h,g)),d=!0;d&&(a.select||e.collapse(),this._setSelection(e,!0,!0));this._columnX=
h;j.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(a){var c=this,e=this._model,d=this._getSelection(),f=d.getCaret(),j=e.getLineAtOffset(f),h=e.getLineCount(),m=this._getScroll(),e=this._getClientHeight(),g,o;if(this._lineHeight){g=this._columnX;m=this._getBoundsAtOffset(f);if(g===-1||a.select&&b.isIE)g=m.left;f=this._getLineIndex(m.top+e);o=this._getLine(f);j=this._getLinePixel(f);f=o.getOffset(g,m.top+e-j);e=o.getBoundingClientRect(f);o.destroy();d.extend(f);a.select||d.collapse();
this._setSelection(d,!0,!0,function(){c._columnX=g},e.top+j-m.top);return!0}if(j<h-1){var n=this._getLineHeight(),i=Math.min(h-j-1,Math.floor(e/n)),i=Math.max(1,i);g=this._columnX;if(g===-1||a.select&&b.isIE)o=this._getLine(j),g=o.getBoundingClientRect(f).left,o.destroy();o=this._getLine(j+i);d.extend(o.getOffset(g,0));o.destroy();a.select||d.collapse();a=h*n;f=m.y+i*n;f+e>a&&(f=a-e);this._setSelection(d,!0,!0,function(){c._columnX=g},f-m.y)}return!0},_doPageUp:function(a){var c=this,e=this._model,
d=this._getSelection(),f=d.getCaret(),j=e.getLineAtOffset(f),h=this._getScroll(),m=this._getClientHeight(),g;if(this._lineHeight){g=this._columnX;h=this._getBoundsAtOffset(f);if(g===-1||a.select&&b.isIE)g=h.left;f=this._getLineIndex(h.bottom-m);e=this._getLine(f);j=this._getLinePixel(f);f=e.getOffset(g,h.bottom-m-j);m=e.getBoundingClientRect(f);e.destroy();d.extend(f);a.select||d.collapse();this._setSelection(d,!0,!0,function(){c._columnX=g},m.top+j-h.top);return!0}if(j>0){var o=this._getLineHeight(),
m=Math.max(1,Math.min(j,Math.floor(m/o)));g=this._columnX;if(g===-1||a.select&&b.isIE)e=this._getLine(j),g=e.getBoundingClientRect(f).left,e.destroy();e=this._getLine(j-m);d.extend(e.getOffset(g,this._getLineHeight(j-m)-1));e.destroy();a.select||d.collapse();a=Math.max(0,h.y-m*o);this._setSelection(d,!0,!0,function(){c._columnX=g},a-h.y)}return!0},_doPaste:function(a){var c=this;return this._getClipboardText(a,function(a){a&&(b.isLinux&&c._lastMouseButton===2&&(new Date).getTime()-c._lastMouseTime<=
c._clickTime&&c._setSelectionTo(c._lastMouseX,c._lastMouseY),c._doContent(a))})!==null},_doScroll:function(a){var b=a.type,c=this._model,e=c.getLineCount(),a=this._getClientHeight(),d=this._getLineHeight();e*=d;var f=this._getScroll().y,j;switch(b){case "textStart":j=0;break;case "textEnd":j=e-a;break;case "pageDown":j=f+a;break;case "pageUp":j=f-a;break;case "lineDown":j=f+d;break;case "lineUp":j=f-d;break;case "centerLine":b=this._getSelection(),j=c.getLineAtOffset(b.start),c=(c.getLineAtOffset(b.end)-
j+1)*d,j=j*d-a/2+c/2}j!==void 0&&(j=Math.min(Math.max(0,j),e-a),this._scrollViewAnimated(0,j-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 a=this._model,c=this._getSelection(),e=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),d=c.getCaret(),
f=a.getLineCount(),j=a.getLineAtOffset(d),h;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")d=this._autoScrollY/this._getLineHeight(),d=d<0?Math.floor(d):Math.ceil(d),h=Math.max(0,Math.min(f-1,j+d));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")h=this._getLineIndex(e.y),j=this._getLine(j),e.x+=j.getBoundingClientRect(d,!1).left,j.destroy();h===0&&(b.isMac||b.isLinux)?c.extend(0):h===f-1&&(b.isMac||b.isLinux)?c.extend(a.getCharCount()):(j=this._getLine(h),c.extend(j.getOffset(e.x,
e.y-this._getLinePixel(h))),j.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,e=(new Date).getTime(),d=0;c<b;)if(this._lineHeight[c]||(a++,d||(d=c),this._lineHeight[c]=this._calculateLineHeight(c)),c++,(new Date).getTime()-
e>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 a=this._clientDiv,c=a.ownerDocument,
e=b.createElement(c,"div");e.style.lineHeight="normal";var d={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(d);h(d.style,e);e.style.position="fixed";e.style.left="-1000px";var f=b.createElement(c,"span");f.appendChild(c.createTextNode(" "));e.appendChild(f);var j=b.createElement(c,"span");j.style.fontStyle="italic";j.appendChild(c.createTextNode(" "));e.appendChild(j);var m=b.createElement(c,"span");m.style.fontWeight="bold";m.appendChild(c.createTextNode(" "));
e.appendChild(m);d=b.createElement(c,"span");d.style.fontWeight="bold";d.style.fontStyle="italic";d.appendChild(c.createTextNode(" "));e.appendChild(d);a.appendChild(e);var g=e.getBoundingClientRect(),f=f.getBoundingClientRect(),j=j.getBoundingClientRect(),m=m.getBoundingClientRect(),d=d.getBoundingClientRect(),f=f.bottom-f.top,j=j.bottom-j.top,m=m.bottom-m.top,i=d.bottom-d.top,k=0,d=g.bottom-g.top<=0,g=Math.max(1,g.bottom-g.top);j>f&&(k=1);m>j&&(k=2);i>m&&(k=3);var p;if(k!==0){p={style:{}};if((k&
1)!==0)p.style.fontStyle="italic";if((k&2)!==0)p.style.fontWeight="bold"}f=n(e);a.removeChild(e);j=o(this._viewDiv);e=b.createElement(c,"div");e.style.position="fixed";e.style.left="-1000px";e.style.paddingLeft=j.left+"px";e.style.paddingTop=j.top+"px";e.style.paddingRight=j.right+"px";e.style.paddingBottom=j.bottom+"px";e.style.width="100px";e.style.height="100px";m=b.createElement(c,"div");m.style.width="100%";m.style.height="100%";e.appendChild(m);a.appendChild(e);c=e.getBoundingClientRect();j=
m.getBoundingClientRect();e.style.overflow="hidden";m.style.height="200px";m=e.clientWidth;e.style.overflow="scroll";i=e.clientWidth;a.removeChild(e);j={left:j.left-c.left,top:j.top-c.top,right:c.right-j.right,bottom:c.bottom-j.bottom};return{lineHeight:g,largestFontStyle:p,lineTrim:f,viewPadding:j,scrollWidth:m-i,invalid:d}},_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),e=this._getDOMText(this._getLineNode(b)).text,a=a.getLine(b),c=this._imeOffset-c,a=c+e.length-a.length;c!==a&&this._doContent(e.substring(c,a));this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new g.DefaultKeyMode(this));var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},
lineUp:{defaultHandler:function(b){return a._doLineUp(e(b,{select:!1}))},actionDescription:{name:i.lineUp}},lineDown:{defaultHandler:function(b){return a._doLineDown(e(b,{select:!1}))},actionDescription:{name:i.lineDown}},lineStart:{defaultHandler:function(b){return a._doHome(e(b,{select:!1,ctrl:!1}))},actionDescription:{name:i.lineStart}},lineEnd:{defaultHandler:function(b){return a._doEnd(e(b,{select:!1,ctrl:!1}))},actionDescription:{name:i.lineEnd}},charPrevious:{defaultHandler:function(b){return a._doCursorPrevious(e(b,
{select:!1,unit:"character"}))},actionDescription:{name:i.charPrevious}},charNext:{defaultHandler:function(b){return a._doCursorNext(e(b,{select:!1,unit:"character"}))},actionDescription:{name:i.charNext}},pageUp:{defaultHandler:function(b){return a._doPageUp(e(b,{select:!1}))},actionDescription:{name:i.pageUp}},pageDown:{defaultHandler:function(b){return a._doPageDown(e(b,{select:!1}))},actionDescription:{name:i.pageDown}},scrollPageUp:{defaultHandler:function(b){return a._doScroll(e(b,{type:"pageUp"}))},
actionDescription:{name:i.scrollPageUp}},scrollPageDown:{defaultHandler:function(b){return a._doScroll(e(b,{type:"pageDown"}))},actionDescription:{name:i.scrollPageDown}},scrollLineUp:{defaultHandler:function(b){return a._doScroll(e(b,{type:"lineUp"}))},actionDescription:{name:i.scrollLineUp}},scrollLineDown:{defaultHandler:function(b){return a._doScroll(e(b,{type:"lineDown"}))},actionDescription:{name:i.scrollLineDown}},wordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(e(b,{select:!1,
unit:"word"}))},actionDescription:{name:i.wordPrevious}},wordNext:{defaultHandler:function(b){return a._doCursorNext(e(b,{select:!1,unit:"word"}))},actionDescription:{name:i.wordNext}},textStart:{defaultHandler:function(b){return a._doHome(e(b,{select:!1,ctrl:!0}))},actionDescription:{name:i.textStart}},textEnd:{defaultHandler:function(b){return a._doEnd(e(b,{select:!1,ctrl:!0}))},actionDescription:{name:i.textEnd}},scrollTextStart:{defaultHandler:function(b){return a._doScroll(e(b,{type:"textStart"}))},
actionDescription:{name:i.scrollTextStart}},scrollTextEnd:{defaultHandler:function(b){return a._doScroll(e(b,{type:"textEnd"}))},actionDescription:{name:i.scrollTextEnd}},centerLine:{defaultHandler:function(b){return a._doScroll(e(b,{type:"centerLine"}))},actionDescription:{name:i.centerLine}},selectLineUp:{defaultHandler:function(b){return a._doLineUp(e(b,{select:!0}))},actionDescription:{name:i.selectLineUp}},selectLineDown:{defaultHandler:function(b){return a._doLineDown(e(b,{select:!0}))},actionDescription:{name:i.selectLineDown}},
selectWholeLineUp:{defaultHandler:function(b){return a._doLineUp(e(b,{select:!0,wholeLine:!0}))},actionDescription:{name:i.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(b){return a._doLineDown(e(b,{select:!0,wholeLine:!0}))},actionDescription:{name:i.selectWholeLineDown}},selectLineStart:{defaultHandler:function(b){return a._doHome(e(b,{select:!0,ctrl:!1}))},actionDescription:{name:i.selectLineStart}},selectLineEnd:{defaultHandler:function(b){return a._doEnd(e(b,{select:!0,ctrl:!1}))},
actionDescription:{name:i.selectLineEnd}},selectCharPrevious:{defaultHandler:function(b){return a._doCursorPrevious(e(b,{select:!0,unit:"character"}))},actionDescription:{name:i.selectCharPrevious}},selectCharNext:{defaultHandler:function(b){return a._doCursorNext(e(b,{select:!0,unit:"character"}))},actionDescription:{name:i.selectCharNext}},selectPageUp:{defaultHandler:function(b){return a._doPageUp(e(b,{select:!0}))},actionDescription:{name:i.selectPageUp}},selectPageDown:{defaultHandler:function(b){return a._doPageDown(e(b,
{select:!0}))},actionDescription:{name:i.selectPageDown}},selectWordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(e(b,{select:!0,unit:"word"}))},actionDescription:{name:i.selectWordPrevious}},selectWordNext:{defaultHandler:function(b){return a._doCursorNext(e(b,{select:!0,unit:"word"}))},actionDescription:{name:i.selectWordNext}},selectTextStart:{defaultHandler:function(b){return a._doHome(e(b,{select:!0,ctrl:!0}))},actionDescription:{name:i.selectTextStart}},selectTextEnd:{defaultHandler:function(b){return a._doEnd(e(b,
{select:!0,ctrl:!0}))},actionDescription:{name:i.selectTextEnd}},deletePrevious:{defaultHandler:function(b){return a._doBackspace(e(b,{unit:"character"}))},actionDescription:{name:i.deletePrevious}},deleteNext:{defaultHandler:function(b){return a._doDelete(e(b,{unit:"character"}))},actionDescription:{name:i.deleteNext}},deleteWordPrevious:{defaultHandler:function(b){return a._doBackspace(e(b,{unit:"word"}))},actionDescription:{name:i.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(b){return a._doDelete(e(b,
{unit:"word"}))},actionDescription:{name:i.deleteWordNext}},deleteLineStart:{defaultHandler:function(b){return a._doBackspace(e(b,{unit:"line"}))},actionDescription:{name:i.deleteLineStart}},deleteLineEnd:{defaultHandler:function(b){return a._doDelete(e(b,{unit:"line"}))},actionDescription:{name:i.deleteLineEnd}},tab:{defaultHandler:function(){return a._doTab()},actionDescription:{name:i.tab}},shiftTab:{defaultHandler:function(){return a._doShiftTab()},actionDescription:{name:i.shiftTab}},enter:{defaultHandler:function(){return a._doEnter()},
actionDescription:{name:i.enter}},enterNoCursor:{defaultHandler:function(b){return a._doEnter(e(b,{noCursor:!0}))},actionDescription:{name:i.enterNoCursor}},selectAll:{defaultHandler:function(){return a._doSelectAll()},actionDescription:{name:i.selectAll}},copy:{defaultHandler:function(){return a._doCopy()},actionDescription:{name:i.copy}},cut:{defaultHandler:function(){return a._doCut()},actionDescription:{name:i.cut}},paste:{defaultHandler:function(){return a._doPaste()},actionDescription:{name:i.paste}},
uppercase:{defaultHandler:function(b){return a._doCase(e(b,{type:"upper"}))},actionDescription:{name:i.uppercase}},lowercase:{defaultHandler:function(b){return a._doCase(e(b,{type:"lower"}))},actionDescription:{name:i.lowercase}},capitalize:{defaultHandler:function(b){return a._doCase(e(b,{unit:"word",type:"capitalize"}))},actionDescription:{name:i.capitalize}},reversecase:{defaultHandler:function(b){return a._doCase(e(b,{type:"reverse"}))},actionDescription:{name:i.reversecase}},toggleOverwriteMode:{defaultHandler:function(){return a._doOverwriteMode()},
actionDescription:{name:i.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(){return a._doTabMode()},actionDescription:{name:i.toggleTabMode}},toggleWrapMode:{defaultHandler:function(){return a._doWrapMode()},actionDescription:{name:i.toggleWrapMode}}}},_createRuler:function(a,c){if(this._clientDiv){var e=a.getLocation()==="left"?this._leftDiv:this._rightDiv;e.style.display="block";var d=b.createElement(e.ownerDocument,"div");d._ruler=a;d.rulerChanged=!0;d.style.position="relative";d.style.cssFloat=
"left";d.style.styleFloat="left";d.style.borderWidth="0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";if(c===void 0||c<0||c>=e.children.length)e.appendChild(d);else{for(var f=e.firstChild;f&&--c>0;)f=f.nextSibling;e.insertBefore(d,f)}}},_createView:function(){if(!this._clientDiv){for(var a=this._parent;a.hasChildNodes();)a.removeChild(a.lastChild);var c=a.ownerDocument,e=b.createElement(c,"div");this._rootDiv=e;e.tabIndex=-1;e.style.position="relative";e.style.overflow="hidden";
e.style.width="100%";e.style.height="100%";e.style.overflow="hidden";e.style.WebkitTextSizeAdjust="100%";e.setAttribute("role","application");a.appendChild(e);a=b.createElement(c,"div");a.className="textviewLeftRuler";this._leftDiv=a;a.tabIndex=-1;a.style.overflow="hidden";a.style.MozUserSelect="none";a.style.WebkitUserSelect="none";a.style.position="absolute";a.style.top="0px";a.style.bottom="0px";a.style.cursor="default";a.style.display="none";a.setAttribute("aria-hidden","true");e.appendChild(a);
a=b.createElement(c,"div");a.className="textviewScroll";this._viewDiv=a;a.tabIndex=-1;a.style.overflow="auto";a.style.position="absolute";a.style.top="0px";a.style.bottom="0px";a.style.borderWidth="0px";a.style.margin="0px";a.style.outline="none";a.style.background="transparent";if(b.isMac&&b.isWebkit)a.style.pointerEvents="none",a.style.zIndex="2";e.appendChild(a);var d=b.createElement(c,"div");d.className="textviewRightRuler";this._rightDiv=d;d.tabIndex=-1;d.style.display="none";d.style.overflow=
"hidden";d.style.MozUserSelect="none";d.style.WebkitUserSelect="none";d.style.position="absolute";d.style.top="0px";d.style.bottom="0px";d.style.cursor="default";d.style.right="0px";d.setAttribute("aria-hidden","true");e.appendChild(d);this._scrollDiv=d=b.createElement(c,"div");d.style.margin="0px";d.style.borderWidth="0px";d.style.padding="0px";a.appendChild(d);if(b.isFirefox)this._clipboardDiv=a=b.createElement(c,"div"),a.style.position="fixed",a.style.whiteSpace="pre",a.style.left="-1000px",e.appendChild(a);
if(!b.isIE&&!b.isIOS)this._clipDiv=a=b.createElement(c,"div"),a.style.position="absolute",a.style.overflow="hidden",a.style.margin="0px",a.style.borderWidth="0px",a.style.padding="0px",a.style.background="transparent",e.appendChild(a),this._clipScrollDiv=d=b.createElement(c,"div"),d.style.position="absolute",d.style.height="1px",d.style.top="-1000px",d.style.background="transparent",a.appendChild(d);this._setFullSelection(this._fullSelection,!0);a=b.createElement(c,"div");a.className="textviewContent";
this._clientDiv=a;a.style.position="absolute";a.style.borderWidth="0px";a.style.margin="0px";a.style.padding="0px";a.style.outline="none";a.style.zIndex="1";a.style.WebkitUserSelect="text";a.setAttribute("spellcheck","false");if(b.isIOS||b.isAndroid)a.style.WebkitTapHighlightColor="transparent";(this._clipDiv||e).appendChild(a);if(b.isIOS||b.isAndroid)this._vScrollDiv=d=b.createElement(c,"div"),d.style.position="absolute",d.style.borderWidth="1px",d.style.borderColor="white",d.style.borderStyle="solid",
d.style.borderRadius="4px",d.style.backgroundColor="black",d.style.opacity="0.5",d.style.margin="0px",d.style.padding="0px",d.style.outline="none",d.style.zIndex="3",d.style.width="8px",d.style.display="none",e.appendChild(d),this._hScrollDiv=d=b.createElement(c,"div"),d.style.position="absolute",d.style.borderWidth="1px",d.style.borderColor="white",d.style.borderStyle="solid",d.style.borderRadius="4px",d.style.backgroundColor="black",d.style.opacity="0.5",d.style.margin="0px",d.style.padding="0px",
d.style.outline="none",d.style.zIndex="3",d.style.height="8px",d.style.display="none",e.appendChild(d);if(b.isFirefox&&!a.setCapture)this._overlayDiv=c=b.createElement(c,"div"),c.style.position=a.style.position,c.style.borderWidth=a.style.borderWidth,c.style.margin=a.style.margin,c.style.padding=a.style.padding,c.style.cursor="text",c.style.zIndex="2",(this._clipDiv||e).appendChild(c);a.contentEditable="true";a.setAttribute("role","textbox");a.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();e=this._rulers;for(c=0;c<e.length;c++)this._createRuler(e[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:c.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(a,c){var e=this._model.getLineDelimiter(),
d,f,j=this._getWindow();if(j.clipboardData)return d=[],f=j.clipboardData.getData("Text"),m(f,function(a){d.push(a)},function(){d.push(e)}),f=d.join(""),c&&c(f),f;if(b.isFirefox){this._ignoreFocus=!0;var h=this._clipboardDiv;h.innerHTML="<pre contenteditable=''></pre>";h.firstChild.focus();var g=this,o=function(){var a=g._getTextFromElement(h);h.innerHTML="";d=[];m(a,function(a){d.push(a)},function(){d.push(e)});return d.join("")},n=!1;this._ignorePaste=!0;if(!b.isLinux||this._lastMouseButton!==2)try{n=
h.ownerDocument.execCommand("paste",!1,null)}catch(i){n=h.childNodes.length>1||h.firstChild&&h.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!n)return a?(j.setTimeout(function(){g.focus();(f=o())&&c&&c(f);g._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(f=o())&&c&&c(f);return f}return a&&a.clipboardData?(d=[],f=a.clipboardData.getData("text/plain"),m(f,function(a){d.push(a)},function(){d.push(e)}),(f=d.join(""))&&c&&c(f),f):""},_getDOMText:function(a,
b){for(var c=a.firstChild,e="",d=0;c;){var f;if(!c.ignore)if(c.ignoreChars){f=c.lastChild;for(var j=0,h=[],m=-1;f;){for(var g=f.data,o=g.length-1;o>=0;o--){var n=g.substring(o,o+1);j<c.ignoreChars&&(n===" "||n==="\u200c"||n==="\ufeff")?j++:h.push(n==="\u00a0"?"\t":n)}if(b===f)m=h.length;f=f.previousSibling}h=h.reverse().join("");m!==-1&&(d=e.length+h.length-m);e+=h}else for(f=c.firstChild;f;){if(b===f)d=e.length;e+=f.data;f=f.nextSibling}c=c.nextSibling}return{text:e,offset:d}},_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=[],e;for(e=0;e<a.rangeCount;e++)c.push(a.getRangeAt(e));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(b);b=a.toString();a.removeAllRanges();for(e=0;e<c.length;e++)a.addRange(c[e]);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,e=this._model.getLineCount();if(this._lineHeight){var c=this._getTopIndex(),
d=-this._topIndexY+this._getScroll().y;if(a!==d)if(a<d)for(;a<d&&c>0;)a+=this._getLineHeight(--c);else for(b=this._getLineHeight(c);a-b>=d&&c<e-1;)a-=b,b=this._getLineHeight(++c)}else b=this._getLineHeight(),c=Math.floor(a/b);return Math.max(0,Math.min(e-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(),e=this._viewDiv.getBoundingClientRect();a.top<e.top+c.top&&(b=this._getLineNext(b)||b)}return b.lineIndex},_hookEvents:function(){var c=this;this._modelListener={onChanging:function(a){c._onModelChanging(a)},onChanged:function(a){c._onModelChanged(a)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._themeListener=
{onChanged:function(){c._setThemeClass(c._themeClass)}};this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);var e=this._handlers=[],d=this._clientDiv,f=this._viewDiv,j=this._rootDiv,h=this._overlayDiv||d,m=d.ownerDocument,g=this._getWindow(),o=b.isIE?m:g;e.push({target:g,type:"resize",handler:function(a){return c._handleResize(a?a:g.event)}});e.push({target:d,type:"blur",handler:function(a){return c._handleBlur(a?a:g.event)}});e.push({target:d,type:"focus",handler:function(a){return c._handleFocus(a?
a:g.event)}});e.push({target:f,type:"focus",handler:function(){d.focus()}});e.push({target:f,type:"scroll",handler:function(a){return c._handleScroll(a?a:g.event)}});e.push({target:d,type:"textInput",handler:function(a){return c._handleTextInput(a?a:g.event)}});e.push({target:d,type:"keydown",handler:function(a){return c._handleKeyDown(a?a:g.event)}});e.push({target:d,type:"keypress",handler:function(a){return c._handleKeyPress(a?a:g.event)}});e.push({target:d,type:"keyup",handler:function(a){return c._handleKeyUp(a?
a:g.event)}});e.push({target:d,type:"contextmenu",handler:function(a){return c._handleContextMenu(a?a:g.event)}});e.push({target:d,type:"copy",handler:function(a){return c._handleCopy(a?a:g.event)}});e.push({target:d,type:"cut",handler:function(a){return c._handleCut(a?a:g.event)}});e.push({target:d,type:"paste",handler:function(a){return c._handlePaste(a?a:g.event)}});if(b.isIOS||b.isAndroid)e.push({target:m,type:"selectionchange",handler:function(a){return c._handleSelectionChange(a?a:g.event)}}),
e.push({target:d,type:"touchstart",handler:function(a){return c._handleTouchStart(a?a:g.event)}}),e.push({target:d,type:"touchmove",handler:function(a){return c._handleTouchMove(a?a:g.event)}}),e.push({target:d,type:"touchend",handler:function(a){return c._handleTouchEnd(a?a:g.event)}});else{e.push({target:d,type:"selectstart",handler:function(a){return c._handleSelectStart(a?a:g.event)}});e.push({target:d,type:"mousedown",handler:function(a){return c._handleMouseDown(a?a:g.event)}});e.push({target:d,
type:"mouseover",handler:function(a){return c._handleMouseOver(a?a:g.event)}});e.push({target:d,type:"mouseout",handler:function(a){return c._handleMouseOut(a?a:g.event)}});e.push({target:o,type:"mouseup",handler:function(a){return c._handleMouseUp(a?a:g.event)}});e.push({target:o,type:"mousemove",handler:function(a){return c._handleMouseMove(a?a:g.event)}});e.push({target:j,type:"mousedown",handler:function(a){return c._handleRootMouseDown(a?a:g.event)}});e.push({target:j,type:"mouseup",handler:function(a){return c._handleRootMouseUp(a?
a:g.event)}});e.push({target:h,type:"dragstart",handler:function(a){return c._handleDragStart(a?a:g.event)}});e.push({target:h,type:"drag",handler:function(a){return c._handleDrag(a?a:g.event)}});e.push({target:h,type:"dragend",handler:function(a){return c._handleDragEnd(a?a:g.event)}});e.push({target:h,type:"dragenter",handler:function(a){return c._handleDragEnter(a?a:g.event)}});e.push({target:h,type:"dragover",handler:function(a){return c._handleDragOver(a?a:g.event)}});e.push({target:h,type:"dragleave",
handler:function(a){return c._handleDragLeave(a?a:g.event)}});e.push({target:h,type:"drop",handler:function(a){return c._handleDrop(a?a:g.event)}});e.push({target:this._clientDiv,type:b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return c._handleMouseWheel(a?a:g.event)}});if(b.isFirefox&&(!b.isWindows||b.isFirefox>=15))(f=g.MutationObserver||g.MozMutationObserver)?(this._mutationObserver=new f(function(a){c._handleDataModified(a)}),this._mutationObserver.observe(d,{subtree:!0,characterData:!0})):
e.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(a){return c._handleDataModified(a?a:g.event)}});this._overlayDiv&&(e.push({target:this._overlayDiv,type:"mousedown",handler:function(a){return c._handleMouseDown(a?a:g.event)}}),e.push({target:this._overlayDiv,type:"mouseover",handler:function(a){return c._handleMouseOver(a?a:g.event)}}),e.push({target:this._overlayDiv,type:"mouseout",handler:function(a){return c._handleMouseOut(a?a:g.event)}}),e.push({target:this._overlayDiv,
type:"contextmenu",handler:function(a){return c._handleContextMenu(a?a:g.event)}}));this._isW3CEvents||e.push({target:this._clientDiv,type:"dblclick",handler:function(a){return c._handleDblclick(a?a:g.event)}})}f=this._leftDiv;j=this._rightDiv;b.isIE&&e.push({target:f,type:"selectstart",handler:function(){return!1}});e.push({target:f,type:b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return c._handleMouseWheel(a?a:g.event)}});e.push({target:f,type:"click",handler:function(a){c._handleRulerEvent(a?
a:g.event)}});e.push({target:f,type:"dblclick",handler:function(a){c._handleRulerEvent(a?a:g.event)}});e.push({target:f,type:"mousemove",handler:function(a){c._handleRulerEvent(a?a:g.event)}});e.push({target:f,type:"mouseover",handler:function(a){c._handleRulerEvent(a?a:g.event)}});e.push({target:f,type:"mouseout",handler:function(a){c._handleRulerEvent(a?a:g.event)}});b.isIE&&e.push({target:j,type:"selectstart",handler:function(){return!1}});e.push({target:j,type:b.isFirefox?"DOMMouseScroll":"mousewheel",
handler:function(a){return c._handleMouseWheel(a?a:g.event)}});e.push({target:j,type:"click",handler:function(a){c._handleRulerEvent(a?a:g.event)}});e.push({target:j,type:"dblclick",handler:function(a){c._handleRulerEvent(a?a:g.event)}});e.push({target:j,type:"mousemove",handler:function(a){c._handleRulerEvent(a?a:g.event)}});e.push({target:j,type:"mouseover",handler:function(a){c._handleRulerEvent(a?a:g.event)}});e.push({target:j,type:"mouseout",handler:function(a){c._handleRulerEvent(a?a:g.event)}});
for(f=0;f<e.length;f++)j=e[f],a(j.target,j.type,j.handler,j.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(a){var c=a.parent;typeof c==="string"&&(c=(a.document||document).getElementById(c));if(!c)throw"no parent";a.parent=c;a.model=a.model||new k.TextModel;var e=this._defaultOptions(),d;for(d in e)e.hasOwnProperty(d)&&
(this["_"+d]=a[d]!==void 0?a[d]:e[d].value);this._keyModes=[];this._rulers=[];this._selection=new p(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=(!b.isIE||b.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,e=a.removedCharCount,d=a.addedLineCount,f=a.removedLineCount,j=this._getSelection();j.end>b&&(j.end>b&&j.start<b+e?j.setCaret(b+c):(j.start+=c-e,j.end+=c-e),this._setSelection(j,
!1,!1));b=this._model.getLineAtOffset(b);for(c=this._getLineNext();c;){e=c.lineIndex;if(b<=e&&e<=b+f)b===e&&!c.modelChangedEvent&&!c.lineRemoved?(c.modelChangedEvent=a,c.lineChanged=!0):(c.lineRemoved=!0,c.lineChanged=!1,c.modelChangedEvent=null);if(e>b+f)c.lineIndex=e+d-f,c._line.lineIndex=c.lineIndex;c=this._getLineNext(c)}this._lineHeight&&(a=[b,f].concat(Array(d)),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 p(0,0,!1),!1,!1);if(this._viewDiv)this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=
0;var a=this._clientDiv;if(a){for(var c=a.firstChild;c;)c.lineRemoved=!0,c=c.nextSibling;if(b.isFirefox)this._ignoreFocus=!1,(c=this._hasFocus)&&a.blur(),a.contentEditable=!1,a.contentEditable=!0,c&&a.focus(),this._ignoreFocus=!1}},_scrollViewAnimated:function(a,b,c){if(c&&this._scrollAnimation){var e=this;this._animation=new t({window:this._getWindow(),duration:this._scrollAnimation,curve:[b,0],onAnimate:function(a){a=b-Math.floor(a);e._scrollView(0,a);b-=a},onEnd:function(){e._animation=null;e._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(a,c){var e,d=this._parent.ownerDocument,f=this._getWindow();if(f.clipboardData)return e=[],m(a,function(a){e.push(a)},function(){e.push(b.platformDelimiter)}),f.clipboardData.setData("Text",e.join(""));if(c&&c.clipboardData&&(e=[],m(a,function(a){e.push(a)},function(){e.push(b.platformDelimiter)}),
c.clipboardData.setData("text/plain",e.join(""))))return!0;var j=b.createElement(d,"pre");j.style.position="fixed";j.style.left="-1000px";m(a,function(a){j.appendChild(d.createTextNode(a))},function(){j.appendChild(b.createElement(d,"br"))});j.appendChild(d.createTextNode(" "));this._clientDiv.appendChild(j);var h=d.createRange();h.setStart(j.firstChild,0);h.setEndBefore(j.lastChild);var g=f.getSelection();g.rangeCount>0&&g.removeAllRanges();g.addRange(h);var o=this,h=function(){j&&j.parentNode===
o._clientDiv&&o._clientDiv.removeChild(j);o._updateDOMSelection()},g=!1;this._ignoreCopy=!0;try{g=d.execCommand("copy",!1,null)}catch(n){}this._ignoreCopy=!1;if(!g&&c)return f.setTimeout(h,0),!1;h();return!0},_setDOMSelection:function(a,c,e,d,f){for(var j,h,m,g,o=0,n=a.firstChild,i,k,p=this._model.getLine(a.lineIndex).length;n;){if(!n.ignore){i=n.firstChild;k=i.length;n.ignoreChars&&(k-=n.ignoreChars);if(o+k>c||o+k>=p){j=i;h=c-o;n.ignoreChars&&k>0&&h===k&&(h+=n.ignoreChars);break}o+=k}n=n.nextSibling}for(var o=
0,n=e.firstChild,s=this._model.getLine(e.lineIndex).length;n;){if(!n.ignore){i=n.firstChild;k=i.length;n.ignoreChars&&(k-=n.ignoreChars);if(k+o>d||o+k>=s){m=i;g=d-o;n.ignoreChars&&k>0&&g===k&&(g+=n.ignoreChars);break}o+=k}n=n.nextSibling}this._setDOMFullSelection(a,c,p,e,d,s);a=this._getWindow();c=this._parent.ownerDocument;if(a.getSelection){e=a.getSelection();a=c.createRange();a.setStart(j,h);a.setEnd(m,g);if(this._hasFocus&&(e.anchorNode!==j||e.anchorOffset!==h||e.focusNode!==m||e.focusOffset!==
g||e.anchorNode!==m||e.anchorOffset!==g||e.focusNode!==j||e.focusOffset!==h))this._ignoreSelect=!1,e.rangeCount>0&&e.removeAllRanges(),e.addRange(a),this._ignoreSelect=!0;if(this._cursorDiv&&(a=c.createRange(),f?(a.setStart(j,h),a.setEnd(j,h)):(a.setStart(m,g),a.setEnd(m,g)),m=a.getClientRects()[0],g=this._cursorDiv.parentNode,j=g.getBoundingClientRect(),m&&j))this._cursorDiv.style.top=m.top-j.top+g.scrollTop+"px",this._cursorDiv.style.left=m.left-j.left+g.scrollLeft+"px"}else if(c.selection&&this._hasFocus)f=
c.body,a=b.createElement(c,"div"),f.appendChild(a),f.removeChild(a),a=f.createTextRange(),a.moveToElementText(j.parentNode),a.moveStart("character",h),j=f.createTextRange(),j.moveToElementText(m.parentNode),j.moveStart("character",g),a.setEndPoint("EndToStart",j),this._ignoreSelect=!1,a.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(a,b,c,e,d){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===e&&b===d))){var f=this._model,j=this._getViewPadding(),h=this._clientDiv.getBoundingClientRect(),m=this._viewDiv.getBoundingClientRect(),c=m.left+j.left,g=h.right,j=m.top+j.top,o=h.bottom,m=h=0;this._clipDiv?(m=this._clipDiv.getBoundingClientRect(),h=m.left-this._clipDiv.scrollLeft):(m=this._rootDiv.getBoundingClientRect(),h=m.left);m=m.top;this._ignoreDOMSelection=!0;var a=(new q(this,a.lineIndex,a)).getBoundingClientRect(f.getLineStart(a.lineIndex)+
b,!1),n=a.left,d=(new q(this,e.lineIndex,e)).getBoundingClientRect(f.getLineStart(e.lineIndex)+d,!1),b=d.left;this._ignoreDOMSelection=!1;var f=this._selDiv1,n=Math.min(g,Math.max(c,n)),i=Math.min(o,Math.max(j,a.top)),k=g,e=Math.min(o,Math.max(j,a.bottom));f.style.left=n-h+"px";f.style.top=i-m+"px";f.style.width=Math.max(0,k-n)+"px";f.style.height=Math.max(0,e-i)+"px";if(a.top===d.top)k=Math.min(b,g),f.style.width=Math.max(0,k-n)+"px";else if(a=Math.min(o,Math.max(j,d.top)),b=Math.min(g,Math.max(c,
b)),j=Math.min(o,Math.max(j,d.bottom)),o=this._selDiv3,o.style.left=c-h+"px",o.style.top=a-m+"px",o.style.width=Math.max(0,b-c)+"px",o.style.height=Math.max(0,j-a)+"px",a-e>0)j=this._selDiv2,j.style.left=c-h+"px",j.style.top=e-m+"px",j.style.width=Math.max(0,g-c)+"px",j.style.height=Math.max(0,a-e)+"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(a){if(this._linksVisible!==a){this._linksVisible=a;if(b.isIE&&a)this._hadFocus=this._hasFocus;var c=this._clientDiv;c.contentEditable=!a;this._hadFocus&&!a&&c.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=a?"-1":"1";for(a=this._getLineNext();a;){if(a.hasLink)for(c=a.firstChild;c;)if(c.ignore)c=c.nextSibling;else{var e=c.nextSibling,d=c.viewStyle;d&&d.tagName&&d.tagName.toLowerCase()==="a"&&a.replaceChild(a._line._createSpan(a,c.firstChild.data,d),c);c=e}a=this._getLineNext(a)}this._updateDOMSelection()}},
_setSelection:function(a,b,c,e,d){if(a){this._columnX=-1;c===void 0&&(c=!0);var f=this._selection;this._selection=a;b!==!1&&this._showCaret(!1,e,b,d);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,e){var d=this._model,f=this._getSelection(),b=this.convert({x:a,y:b},"page","document"),a=this._getLineIndex(b.y);if(this._clickCount===1){d=this._getLine(a);a=d.getOffset(b.x,
b.y-this._getLinePixel(a));d.destroy();if(e&&!c&&f.start<=a&&a<f.end)return this._dragOffset=a,!1;f.extend(a);c||f.collapse()}else(this._clickCount&1)===0?(d=this._getLine(a),a=d.getOffset(b.x,b.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(c=this._doubleClickSelection.start,e=d.getNextOffset(a,{unit:"wordend",count:1})):(c=d.getNextOffset(a,{unit:"word",count:-1}),e=this._doubleClickSelection.end):(c=d.getNextOffset(a,{unit:"word",count:-1}),e=d.getNextOffset(c,
{unit:"wordend",count:1})),d.destroy()):this._doubleClickSelection?(e=d.getLineAtOffset(this._doubleClickSelection.start),a>=e?(c=d.getLineStart(e),e=d.getLineEnd(a)):(c=d.getLineStart(a),e=d.getLineEnd(e))):(c=d.getLineStart(a),e=d.getLineEnd(a)),f.setCaret(c),f.extend(e);this._setSelection(f,!0,!0);return!0},_setFullSelection:function(a,c){this._fullSelection=a;if(b.isWebkit)this._fullSelection=!0;var e=this._clipDiv||this._rootDiv;if(e)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&
!b.isIOS){var d=e.ownerDocument;this._highlightRGB=b.isWebkit?"transparent":"Highlight";var f=b.createElement(d,"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";e.appendChild(f);var j=b.createElement(d,"div");this._selDiv2=j;j.style.position="absolute";j.style.borderWidth="0px";j.style.margin="0px";j.style.padding=
"0px";j.style.outline="none";j.style.background=this._highlightRGB;j.style.width="0px";j.style.height="0px";j.style.zIndex="0";e.appendChild(j);this._selDiv3=d=b.createElement(d,"div");d.style.position="absolute";d.style.borderWidth="0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";d.style.background=this._highlightRGB;d.style.width="0px";d.style.height="0px";d.style.zIndex="0";e.appendChild(d);if(b.isFirefox&&b.isMac){e=this._getWindow().getComputedStyle(d,null).getPropertyValue("background-color");
switch(e){case "rgb(119, 141, 168)":e="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":e="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":e="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":e="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":e="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":e="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":e="rgb(232, 184, 255)";break;default:e="rgb(180, 213, 255)"}this._highlightRGB=e;f.style.background=e;j.style.background=e;d.style.background=
e}c||this._updateDOMSelection()}}else{if(this._selDiv1)e.removeChild(this._selDiv1),this._selDiv1=null;if(this._selDiv2)e.removeChild(this._selDiv2),this._selDiv2=null;if(this._selDiv3)e.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 a=
b.createElement(document,"div");a.className="textviewBlockCursor";this._cursorDiv=a;a.tabIndex=-1;a.style.zIndex="2";a.style.color="transparent";a.style.position="absolute";a.style.pointerEvents="none";a.innerHTML="&nbsp;";this._viewDiv.appendChild(a);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(a,
c){this._tabSize=a;this._customTabSize=void 0;var e=this._clientDiv;if(b.isOpera){if(e)e.style.OTabSize=this._tabSize+""}else if(b.isWebkit>=537.1){if(e)e.style.tabSize=this._tabSize+""}else if(b.isFirefox>=4){if(e)e.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",e=this._theme.getThemeClass();e&&(c+=" "+e);this._themeClass&&e!==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,e=this._viewDiv;a?(c.style.whiteSpace="pre-wrap",c.style.wordWrap="break-word",e.style.overflowX="hidden",e.style.overflowY="scroll"):
(c.style.whiteSpace="pre",c.style.wordWrap="normal",e.style.overflowX="auto",e.style.overflowY="auto");b||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,b,c,e){if(this._clientDiv){var d=this._model,f=this._getSelection(),j=this._getScroll(),h=f.getCaret(),m=f.start,g=f.end,o=d.getLineAtOffset(g),n=Math.max(Math.max(m,d.getLineStart(o)),g-1),d=this._getClientWidth(),o=this._getClientHeight(),i=d/4,k=this._getBoundsAtOffset(h===m?m:n),p=k.left,s=k.right,q=k.top,
r=k.bottom;a&&!f.isEmpty()&&(k=this._getBoundsAtOffset(h===g?m:n),k.top===q?h===m?s=p+Math.min(k.right-p,d):p=s-Math.min(s-k.left,d):h===m?r=q+Math.min(k.bottom-q,o):q=r-Math.min(r-k.top,o));a=0;p<j.x&&(a=Math.min(p-j.x,-i));s>j.x+d&&(a=Math.max(s-j.x-d,i));f=0;q<j.y?f=q-j.y:r>j.y+o&&(f=r-j.y-o);e&&(e>0?f>0&&(f=Math.max(f,e)):f<0&&(f=Math.min(f,e)));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*o:-c*o)),this._scrollViewAnimated(a,f,b),o!==this._getClientHeight()||
d!==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,e=b.type,b=b.handler;typeof c.removeEventListener==="function"?c.removeEventListener(e,b,!1):c.detachEvent("on"+e,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),e=b.getLineAtOffset(a.end),
d=this._getLineNext();if(d){var f=this._getLinePrevious(),j;c<d.lineIndex?(j=d,c=0):c>f.lineIndex?(j=f,c=0):(j=this._getLineNode(c),c=a.start-b.getLineStart(c));e<d.lineIndex?b=0:e>f.lineIndex?(d=f,b=0):(d=this._getLineNode(e),b=a.end-b.getLineStart(e));this._setDOMSelection(j,c,d,b,a.caret)}}},_update:function(a){if(!(this._redrawCount>0)){if(this._updateTimer)this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=null,a=!1;var c=this._clientDiv;if(c){if(this._metrics.invalid)this._ignoreQueueUpdate=
!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var e=this._model,d=this._getScroll(!1),f=this._getViewPadding(),j=e.getLineCount(),h=this._getLineHeight(),m=this._getClientWidth();if(this._wrapMode)c.style.width=m+"px";var g,o,n,i,k=0,p=0;if(this._lineHeight){for(;p<j;){o=this._getLineHeight(p);if(k+o>d.y)break;k+=o;p++}g=p;o=Math.max(0,g-1);n=e=d.y-k;g>0&&(e+=this._getLineHeight(g-1))}else i=Math.max(0,d.y)/h,g=Math.floor(i),o=Math.max(0,g-1),e=Math.round((i-o)*h),n=Math.round((i-g)*h);this._topIndexY=
n;i=this._parent;var s=i.clientWidth,r=i.clientHeight;i=this._getClientHeight();if(a){h=0;this._leftDiv&&(g=this._leftDiv.getBoundingClientRect(),h=g.right-g.left);g=m;for(this._wrapMode||(g=Math.max(this._maxLineWidth,g));p<j;)o=this._getLineHeight(p,!1),k+=o,p++;j=k}else{m=this._viewDiv;n=Math.min(g+Math.floor((i+n)/h),j-1);for(var d=Math.min(n+1,j-1),t,x=c.firstChild;x;){t=x.lineIndex;var B=x.nextSibling;if(!(o<=t&&t<=d)||x.lineRemoved||x.lineIndex===-1)this._mouseWheelLine===x?(x.style.display=
"none",x.lineIndex=-1):c.removeChild(x);x=B}var x=this._getLineNext(),B=m.ownerDocument,C=B.createDocumentFragment();for(t=o;t<=d;t++)if(!x||x.lineIndex>t)(new q(this,t)).create(C,null);else{C.firstChild&&(c.insertBefore(C,x),C=B.createDocumentFragment());if(x&&x.lineChanged)x=(new q(this,t)).create(C,x),x.lineChanged=!1;x=this._getLineNext(x)}C.firstChild&&c.insertBefore(C,x);if(b.isWebkit&&!this._wrapMode)c.style.width="0x7fffffffpx";x=this._getLineNext();t=i+e;for(C=!1;x;){o=x.lineWidth;if(o===
void 0)if(B=x._line.getBoundingClientRect(),o=x.lineWidth=Math.ceil(B.right-B.left),B=B.bottom-B.top,this._lineHeight)this._lineHeight[x.lineIndex]=B;else if(h!==0&&B!==0&&Math.ceil(h)!==Math.ceil(B))this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[x.lineIndex]=B;if(this._lineHeight&&!C&&(t-=this._lineHeight[x.lineIndex],t<0))n=x.lineIndex,C=!0;if(!this._wrapMode){if(o>=this._maxLineWidth)this._maxLineWidth=o,this._maxLineIndex=x.lineIndex;if(this._checkMaxLineIndex===x.lineIndex)this._checkMaxLineIndex=
-1}if(x.lineIndex===g)this._topChild=x;if(x.lineIndex===n)this._bottomChild=x;x=this._getLineNext(x)}if(this._checkMaxLineIndex!==-1&&(t=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=t&&t<j)){h=new q(this,t);B=h.getBoundingClientRect();o=B.right-B.left;if(o>=this._maxLineWidth)this._maxLineWidth=o,this._maxLineIndex=t;h.destroy()}for(;p<j;)o=this._getLineHeight(p,p<=n),k+=o,p++;j=k;this._updateRuler(this._leftDiv,g,d,r);this._updateRuler(this._rightDiv,g,d,r);h=0;this._leftDiv&&(g=this._leftDiv.getBoundingClientRect(),
h=g.right-g.left);d=0;this._rightDiv&&(d=this._rightDiv.getBoundingClientRect(),d=d.right-d.left);m.style.left=h+"px";m.style.right=d+"px";d=this._scrollDiv;d.style.height=j+"px";k=m=this._getClientWidth();this._wrapMode||(k=Math.max(this._maxLineWidth,k));g=k;if((!b.isIE||b.isIE>=9)&&this._maxLineWidth>m)k+=f.right+f.left;d.style.width=k+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=k+"px";d=this._getScroll(!1)}if(this._vScrollDiv)k=i-8,p=Math.max(15,Math.ceil(Math.min(1,k/(j+f.top+
f.bottom))*k)),this._vScrollDiv.style.left=h+m-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,d.y*k/j))+"px",this._vScrollDiv.style.height=p+"px";if(!this._wrapMode&&this._hScrollDiv)k=m-8,p=Math.max(15,Math.ceil(Math.min(1,k/(this._maxLineWidth+f.left+f.right))*k)),this._hScrollDiv.style.left=h+Math.floor(Math.max(0,Math.floor(d.x*k/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=i-9+"px",this._hScrollDiv.style.width=p+"px";x=d.x;o=this._clipDiv;k=this._overlayDiv;if(o){o.scrollLeft=
x;o.scrollTop=0;p=h+f.left;n=f.top;a=m;h=i;x=0;t=-e;if(d.x===0)p-=f.left,a+=f.left,x=f.left;d.x+m===g&&(a+=f.right);d.y===0&&(n-=f.top,h+=f.top,t+=f.top);d.y+i===j&&(h+=f.bottom);o.style.left=p+"px";o.style.top=n+"px";o.style.right=s-a-p+"px";o.style.bottom=r-h-n+"px";c.style.left=x+"px";c.style.top=t+"px";c.style.width=g+"px";c.style.height=i+e+"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{p=x;n=e;s=x+m;r=e+i;p===0&&(p-=
f.left);n===0&&(n-=f.top);s===g&&(s+=f.right);d.y+i===j&&(r+=f.bottom);c.style.clip="rect("+n+"px,"+s+"px,"+r+"px,"+p+"px)";c.style.left=-x+h+f.left+"px";c.style.width=(b.isWebkit?g:m+x)+"px";if(!a)c.style.top=-e+f.top+"px",c.style.height=i+e+"px";if(k&&(k.style.clip=c.style.clip,k.style.left=c.style.left,k.style.width=c.style.width,!a))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(a,c,e,d){if(a)for(var f=this._parent.ownerDocument,j=this._getLineHeight(),m=this._getViewPadding(),a=a.firstChild;a;){var g=a._ruler,o=j,n=g.getOverview();n==="page"&&(o+=this._topIndexY);a.style.top=-o+"px";a.style.height=d+o+"px";a.rulerChanged&&h(g.getRulerStyle(),a);var i,k=a.firstChild;k?(i=k,k=k.nextSibling):(i=b.createElement(f,"div"),i.style.visibility="hidden",a.appendChild(i));var p;if(a.rulerChanged&&i){o=-1;if(p=g.getWidestAnnotation())if(h(p.style,
i),p.html)i.innerHTML=p.html;i.lineIndex=o;i.style.height=j+m.top+"px"}var s;if(n==="page"){for(g=g.getAnnotations(c,e+1);k;)o=k.lineIndex,p=k.nextSibling,(!(c<=o&&o<=e)||k.lineChanged)&&a.removeChild(k),k=p;k=a.firstChild.nextSibling;s=f.createDocumentFragment();for(o=c;o<=e;o++)if(!k||k.lineIndex>o){i=b.createElement(f,"div");if(p=g[o]){h(p.style,i);if(p.html)i.innerHTML=p.html;i.annotation=p}i.lineIndex=o;i.style.height=this._getLineHeight(o)+"px";s.appendChild(i)}else if(s.firstChild&&(a.insertBefore(s,
k),s=f.createDocumentFragment()),k)k=k.nextSibling;s.firstChild&&a.insertBefore(s,k)}else{p=this._getClientHeight();o=this._model.getLineCount();k=p+m.top+m.bottom-2*this._metrics.scrollWidth;n=j*o<k?j:k/o;if(a.rulerChanged){for(p=a.childNodes.length;p>1;)a.removeChild(a.lastChild),p--;g=g.getAnnotations(0,o);s=f.createDocumentFragment();for(var q in g)if(o=q>>>0,!(o<0)){i=b.createElement(f,"div");p=g[q];h(p.style,i);i.style.position="absolute";i.style.top=this._metrics.scrollWidth+j+Math.floor(o*
n)+"px";if(p.html)i.innerHTML=p.html;i.annotation=p;i.lineIndex=o;s.appendChild(i)}a.appendChild(s)}else if(a._oldTrackHeight!==k)for(i=a.firstChild?a.firstChild.nextSibling:null;i;)i.style.top=this._metrics.scrollWidth+j+Math.floor(i.lineIndex*n)+"px",i=i.nextSibling;a._oldTrackHeight=k}a.rulerChanged=!1;a=a.nextSibling}},_updateStyleSheet:function(){var a="";b.isWebkit&&this._metrics.scrollWidth>0&&(a+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");b.isFirefox&&b.isMac&&this._highlightRGB&&
this._highlightRGB!=="Highlight"&&(a+="\n.textview ::-moz-selection {background: "+this._highlightRGB+";}");if(a){var c=document.getElementById("_textviewStyle");if(c)c.removeChild(c.firstChild),c.appendChild(document.createTextNode(a));else{c=b.createElement(document,"style");c.id="_textviewStyle";var e=document.getElementsByTagName("head")[0]||document.documentElement;c.appendChild(document.createTextNode(a));e.insertBefore(c,e.firstChild)}}},_updateStyle:function(a){if(!a&&b.isIE)this._rootDiv.style.lineHeight=
"normal";var c=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=b.isIE?c.lineHeight-(c.lineTrim.top+c.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();a||(this.redraw(),this._resetLineWidth())}};d.EventTarget.addMixin(r.prototype);return{TextView:r}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(i,k){function g(d){this._model=d;this._projections=[]}g.prototype={addProjection:function(d){if(d){var c=this._model,b=this._projections;d._lineIndex=c.getLineAtOffset(d.start);d._lineCount=c.getLineAtOffset(d.end)-d._lineIndex;var a=d.text;a||(a="");d._model=typeof a==="string"?new i.TextModel(a,c.getLineDelimiter()):a;var c=this.mapOffset(d.start,!0),a=d.end-d.start,h=d._lineCount,f=d._model.getCharCount(),
e=d._model.getLineCount()-1;this.onChanging({type:"Changing",text:d._model.getText(),start:c,removedCharCount:a,addedCharCount:f,removedLineCount:h,addedLineCount:e});var j=this._binarySearch(b,d.start);b.splice(j,0,d);this.onChanged({type:"Changed",start:c,removedCharCount:a,addedCharCount:f,removedLineCount:h,addedLineCount:e})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(d,c){var b=this._projections,a=0,h,f;if(c){for(h=
0;h<b.length;h++){f=b[h];if(f.start>d)break;if(f.end>d)return-1;a+=f._model.getCharCount()-(f.end-f.start)}return d+a}for(h=0;h<b.length;h++){f=b[h];if(f.start>d-a)break;var e=f._model.getCharCount();if(f.start+e>d-a)return-1;a+=e-(f.end-f.start)}return d-a},removeProjection:function(d){var c,b=0;for(c=0;c<this._projections.length;c++){var a=this._projections[c];if(a===d){d=a;break}b+=a._model.getCharCount()-(a.end-a.start)}if(c<this._projections.length){var a=this._model,b=d.start+b,h=d.end-d.start,
f=d._lineCount,e=d._model.getCharCount(),j=d._model.getLineCount()-1;this.onChanging({type:"Changing",text:a.getText(d.start,d.end),start:b,removedCharCount:e,addedCharCount:h,removedLineCount:j,addedLineCount:f});this._projections.splice(c,1);this.onChanged({type:"Changed",start:b,removedCharCount:e,addedCharCount:h,removedLineCount:j,addedLineCount:f})}},_binarySearch:function(d,c){for(var b=d.length,a=-1,h;b-a>1;)h=Math.floor((b+a)/2),c<=d[h].start?b=h:a=h;return b},getCharCount:function(){for(var d=
this._model.getCharCount(),c=this._projections,b=0;b<c.length;b++){var a=c[b];d+=a._model.getCharCount()-(a.end-a.start)}return d},getLine:function(d,c){if(d<0)return null;var b=this._model,a=this._projections,h=0,f=[],e=0,j,m,g;for(j=0;j<a.length;j++){g=a[j];if(g._lineIndex>=d-h)break;m=g._model.getLineCount()-1;if(g._lineIndex+m>=d-h)if(e=d-(g._lineIndex+h),e<m)return g._model.getLine(e,c);else f.push(g._model.getLine(m));e=g.end;h+=m-g._lineCount}for(e=Math.max(e,b.getLineStart(d-h));j<a.length;j++){g=
a[j];if(g._lineIndex>d-h)break;f.push(b.getText(e,g.start));m=g._model.getLineCount()-1;if(g._lineIndex+m>d-h)return f.push(g._model.getLine(0,c)),f.join("");f.push(g._model.getText());e=g.end;h+=m-g._lineCount}a=b.getLineEnd(d-h,c);e<a&&f.push(b.getText(e,a));return f.join("")},getLineAtOffset:function(d){for(var c=this._model,b=this._projections,a=0,h=0,f=0;f<b.length;f++){var e=b[f];if(e.start>d-a)break;var j=e._model.getCharCount();if(e.start+j>d-a){b=d-(e.start+a);h+=e._model.getLineAtOffset(b);
a+=b;break}h+=e._model.getLineCount()-1-e._lineCount;a+=j-(e.end-e.start)}return c.getLineAtOffset(d-a)+h},getLineCount:function(){for(var d=this._projections,c=this._model.getLineCount(),b=0;b<d.length;b++){var a=d[b];c+=a._model.getLineCount()-1-a._lineCount}return c},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(d,c){if(d<0)return-1;for(var b=this._model,a=this._projections,h=0,f=0,e=0;e<a.length;e++){var j=a[e];if(j._lineIndex>d-h)break;var g=j._model.getLineCount()-
1;if(j._lineIndex+g>d-h)return j._model.getLineEnd(d-(j._lineIndex+h),c)+j.start+f;f+=j._model.getCharCount()-(j.end-j.start);h+=g-j._lineCount}return b.getLineEnd(d-h,c)+f},getLineStart:function(d){if(d<0)return-1;for(var c=this._model,b=this._projections,a=0,h=0,f=0;f<b.length;f++){var e=b[f];if(e._lineIndex>=d-a)break;var j=e._model.getLineCount()-1;if(e._lineIndex+j>=d-a)return e._model.getLineStart(d-(e._lineIndex+a))+e.start+h;h+=e._model.getCharCount()-(e.end-e.start);a+=j-e._lineCount}return c.getLineStart(d-
a)+h},getText:function(d,c){d===void 0&&(d=0);var b=this._model,a=this._projections,h=0,f=[],e,j,g;for(e=0;e<a.length;e++){j=a[e];if(j.start>d-h)break;g=j._model.getCharCount();if(j.start+g>d-h)if(c!==void 0&&j.start+g>c-h)return j._model.getText(d-(j.start+h),c-(j.start+h));else f.push(j._model.getText(d-(j.start+h))),d=j.end+h+g-(j.end-j.start);h+=g-(j.end-j.start)}var o=d-h;if(c!==void 0){for(;e<a.length;e++){j=a[e];if(j.start>c-h)break;f.push(b.getText(o,j.start));g=j._model.getCharCount();if(j.start+
g>c-h)return f.push(j._model.getText(0,c-(j.start+h))),f.join("");f.push(j._model.getText());o=j.end;h+=g-(j.end-j.start)}f.push(b.getText(o,c-h))}else{for(;e<a.length;e++)j=a[e],f.push(b.getText(o,j.start)),f.push(j._model.getText()),o=j.end;f.push(b.getText(o))}return f.join("")},_onChanging:function(d,c,b,a,h,f){for(var e=this._model,j=this._projections,g,o=0,n,i=c+b;g<j.length;g++){b=j[g];if(b.start>c)break;o+=b._model.getCharCount()-(b.end-b.start)}c+=o;for(var k=g;g<j.length;g++){b=j[g];if(b.start>
i)break;o+=b._model.getCharCount()-(b.end-b.start);n+=b._model.getLineCount()-1-b._lineCount}b=i+o;o=g;this.onChanging(c,b-c,a,h+n,f);j.splice(j,o-k);for(d=d.length-(b-c);g<j.length;g++)b=j[g],b.start+=d,b.end+=d,b._lineIndex=e.getLineAtOffset(b.start)},onChanging:function(d){return this.dispatchEvent(d)},onChanged:function(d){return this.dispatchEvent(d)},setLineDelimiter:function(d){this._model.setLineDelimiter(d)},setText:function(d,c,b){d===void 0&&(d="");c===void 0&&(c=0);var a=c,h=b,f=this._model,
e=this._projections,j=0,g=0,o,n,i,k,q,r=0;for(o=0;o<e.length;o++){n=e[o];if(n.start>c-j)break;i=n._model.getCharCount();if(n.start+i>c-j)if(b!==void 0&&n.start+i>b-j){n._model.setText(d,c-(n.start+j),b-(n.start+j));return}else r=n._model.getLineCount()-1-n._model.getLineAtOffset(c-(n.start+j)),k={projection:n,start:c-(n.start+j)},c=n.end+j+i-(n.end-n.start);g+=n._model.getLineCount()-1-n._lineCount;j+=i-(n.end-n.start)}c-=j;var t=o,r=f.getLineAtOffset(c)+g-r;if(b!==void 0)for(;o<e.length;o++){n=e[o];
if(n.start>b-j)break;i=n._model.getCharCount();if(n.start+i>b-j){g+=n._model.getLineAtOffset(b-(n.start+j));i=b-(n.start+j);b=n.end+j;q={projection:n,end:i};break}g+=n._model.getLineCount()-1-n._lineCount;j+=i-(n.end-n.start)}else{for(;o<e.length;o++)n=e[o],g+=n._model.getLineCount()-1-n._lineCount,j+=n._model.getCharCount()-(n.end-n.start);b=h=f.getCharCount()+j}b-=j;n=f.getLineAtOffset(b)+g;h-=a;for(var g=n-r,r=d.length,l=i=n=j=0;;){n!==-1&&n<=l&&(n=d.indexOf("\r",l));i!==-1&&i<=l&&(i=d.indexOf("\n",
l));if(i===-1&&n===-1)break;l=n!==-1&&i!==-1?n+1===i?i+1:(n<i?n:i)+1:n!==-1?n+1:i+1;j++}this.onChanging({type:"Changing",text:d,start:a,removedCharCount:h,addedCharCount:r,removedLineCount:g,addedLineCount:j});f.setText(d,c,b);if(k)n=k.projection,n._model.setText("",k.start);if(q)n=q.projection,n._model.setText("",0,q.end),n.start=n.end,n._lineCount=0;e.splice(t,o-t);for(d=d.length-(b-c);o<e.length;o++)n=e[o],n.start+=d,n.end+=d,n._lineIndex=f.getLineAtOffset(n.start);this.onChanged({type:"Changed",
start:a,removedCharCount:h,addedCharCount:r,removedLineCount:g,addedLineCount:j})}};k.EventTarget.addMixin(g.prototype);return{ProjectionTextModel:g}});
define("orion/editor/tooltip",["i18n!orion/editor/nls/messages","orion/editor/textView","orion/editor/textModel","orion/editor/projectionTextModel","orion/util"],function(i,k,g,d,c){function b(a){this._view=a;this._create(a.getOptions("parent").ownerDocument);a.addEventListener("Destroy",this,this.destroy)}b.getTooltip=function(a){if(!a._tooltip)a._tooltip=new b(a);return a._tooltip};b.prototype={_create:function(a){if(!this._tooltipDiv){var b=this._tooltipDiv=c.createElement(a,"div");b.className=
"textviewTooltip";b.setAttribute("aria-live","assertive");b.setAttribute("aria-atomic","true");var d=this._tooltipContents=c.createElement(a,"div");b.appendChild(d);a.body.appendChild(b);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,
b){if(this.target!==a&&(this._target=a,this.hide(),a)){var c=this;if(b===0)c.show(!0);else{var e=this._getWindow();c._showTimeout=e.setTimeout(function(){c.show(!0)},b?b:500)}}},show:function(a){if(this._target){var b=this._target.getTooltipInfo();if(b){var c=this._tooltipDiv,e=this._tooltipContents;c.style.left=c.style.right=c.style.width=c.style.height=e.style.width=e.style.height="auto";var j=b.contents;j instanceof Array&&(j=this._getAnnotationContents(j));if(typeof j==="string")e.innerHTML=j;
else if(this._isNode(j))e.appendChild(j);else if(j instanceof d.ProjectionTextModel){var g=this._view,o=g.getOptions();o.wrapMode=!1;o.parent=e;var n=o.themeClass;n?((n=n.replace("tooltip",""))&&(n=" "+n),n="tooltip"+n):n="tooltip";o.themeClass=n;o=this._contentsView=new k.TextView(o);o._clientDiv.contentEditable=!1;o.addEventListener("LineStyle",function(a){g.onLineStyle(a)});o.setModel(j);j=o.computeSize();e.style.width=j.width+"px";e.style.height=j.height+"px";o.resize()}else return;e=c.ownerDocument.documentElement;
b.anchor==="right"?(j=e.clientWidth-b.x,c.style.right=j+"px"):(j=parseInt(this._getNodeStyle(c,"padding-left","0"),10),j+=parseInt(this._getNodeStyle(c,"border-left-width","0"),10),j=b.x-j,c.style.left=j+"px");c.style.maxWidth=e.clientWidth-j-10+"px";j=parseInt(this._getNodeStyle(c,"padding-top","0"),10);j+=parseInt(this._getNodeStyle(c,"border-top-width","0"),10);j=b.y-j;c.style.top=j+"px";c.style.maxHeight=e.clientHeight-j-10+"px";c.style.opacity="1";c.style.visibility="visible";if(a){var i=this,
s=this._getWindow();i._hideTimeout=s.setTimeout(function(){var a=parseFloat(i._getNodeStyle(c,"opacity","1"));i._fadeTimeout=s.setInterval(function(){c.style.visibility==="visible"&&a>0?(a-=0.1,c.style.opacity=a):i.hide()},50)},5E3)}}}},_getAnnotationContents:function(a){function b(a){var c=a.title;if(c==="")return null;var d="<div>";a.html&&(d+=a.html+"&nbsp;");if(!c)c=a.end,a=e.getLineStart(e.getLineAtOffset(a.start)),c=e.getLineEnd(e.getLineAtOffset(c),!0),c=e.getText(a,c);c=c.replace(/</g,"&lt;").replace(/>/g,
"&gt;");d+="<span style='vertical-align:middle;'>"+c+"</span><div>";return d}if(a.length===0)return null;var c=this._view.getModel(),e=c.getBaseModel?c.getBaseModel():c;if(a.length===1)if(c=a[0],c.title!==void 0)return b(c);else{var a=new d.ProjectionTextModel(e),j=e.getLineStart(e.getLineAtOffset(c.start)),g=e.getCharCount();c.end!==g&&a.addProjection({start:c.end,end:g});j>0&&a.addProjection({start:0,end:j});return a}else{j="<div><em>"+i.multipleAnnotations+"</em></div>";for(g=0;g<a.length;g++)c=
a[g],(c=b(c))&&(j+=c);return j}},_getNodeStyle:function(a,b,c){var e;if(a&&(e=a.style[b],!e))if(a.currentStyle){for(e=0;(e=b.indexOf("-",e))!==-1;)b=b.substring(0,e)+b.substring(e+1,e+2).toUpperCase()+b.substring(e+2);e=a.currentStyle[b]}else e=(a=a.ownerDocument.defaultView.getComputedStyle(a,null))?a.getPropertyValue(b):null;return e||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:b}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(i,k){function g(a,b,c){this.start=a;this.end=b;this._projectionModel=c;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function d(){}function c(a,b){var c=a.lastIndexOf("."),c=a.substring(c+1),f={title:i[c],style:{styleClass:"annotation "+c},html:"<div class='annotationHTML "+c+"'></div>",overviewStyle:{styleClass:"annotationOverview "+c}};b?f.lineStyle={styleClass:"annotationLine "+
c}:f.rangeStyle={styleClass:"annotationRange "+c};d.registerType(a,f)}function b(){}function a(a){this._annotations=[];var b=this;this._listener={onChanged:function(a){b._onChanged(a)}};this.setTextModel(a)}function h(a,b){this._view=a;this._annotationModel=b;var c=this;this._listener={onDestroy:function(a){c._onDestroy(a)},onLineStyle:function(a){c._onLineStyle(a)},onChanged:function(a){c._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",
this._listener.onLineStyle);b.addEventListener("Changed",this._listener.onChanged)}g.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,b=a.getBaseModel();this._projection=
{start:b.getLineStart(b.getLineAtOffset(this.start)+1),end:b.getLineEnd(b.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)}};d.ANNOTATION_ERROR="orion.annotation.error";d.ANNOTATION_WARNING="orion.annotation.warning";d.ANNOTATION_TASK="orion.annotation.task";d.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";
d.ANNOTATION_BOOKMARK="orion.annotation.bookmark";d.ANNOTATION_FOLDING="orion.annotation.folding";d.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";d.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";d.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";d.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";d.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";d.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";d.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";
d.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup";d.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";d.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";var f={};d.registerType=function(a,b){var c=b;if(typeof c!=="function")c=function(a,b,c){this.start=a;this.end=b;if(c!==void 0)this.title=c},c.prototype=b;c.prototype.type=a;f[a]=c;return a};d.createAnnotation=function(a,b,c,d){return new (this.getType(a))(b,c,d)};d.getType=function(a){return f[a]};
c(d.ANNOTATION_ERROR);c(d.ANNOTATION_WARNING);c(d.ANNOTATION_TASK);c(d.ANNOTATION_BREAKPOINT);c(d.ANNOTATION_BOOKMARK);c(d.ANNOTATION_CURRENT_BRACKET);c(d.ANNOTATION_MATCHING_BRACKET);c(d.ANNOTATION_CURRENT_SEARCH);c(d.ANNOTATION_MATCHING_SEARCH);c(d.ANNOTATION_READ_OCCURRENCE);c(d.ANNOTATION_WRITE_OCCURRENCE);c(d.ANNOTATION_SELECTED_LINKED_GROUP);c(d.ANNOTATION_CURRENT_LINKED_GROUP);c(d.ANNOTATION_LINKED_GROUP);c(d.ANNOTATION_CURRENT_LINE,!0);d.registerType(d.ANNOTATION_FOLDING,g);b.addMixin=function(a){var c=
b.prototype,d;for(d in c)c.hasOwnProperty(d)&&(a[d]=c[d])};b.prototype={addAnnotationType:function(a){if(!this._annotationTypes)this._annotationTypes=[];this._annotationTypes.push(a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a)return b+1;return 0},getAnnotationsByType:function(a,b,c){a=a.getAnnotations(b,c);for(c=[];a.hasNext();)b=a.next(),this.getAnnotationTypePriority(b.type)!==0&&c.push(b);var d=
this;c.sort(function(a,b){return d.getAnnotationTypePriority(a.type)-d.getAnnotationTypePriority(b.type)});return c},isAnnotationTypeVisible:function(a){return this.getAnnotationTypePriority(a)!==0},removeAnnotationType:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a){this._annotationTypes.splice(b,1);break}}};a.prototype={addAnnotation:function(a){if(a){var b=this._annotations,c=this._binarySearch(b,a.start);b.splice(c,0,a);this.onChanged({type:"Changed",
added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,b){var c=this._annotations,d,f=0,h=function(){for(;f<c.length;){var d=c[f++];if(a===d.start||(a>d.start?a<d.end:d.start<b))return d;if(d.start>=b)break}return null};d=h();return{next:function(){var a=d;a&&(d=h());return a},hasNext:function(){return d!==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 b=this._annotations,c,d;if(a){c=[];for(d=b.length-1;d>=0;d--){var f=b[d];f.type===a&&b.splice(d,1);c.splice(0,0,f)}}else c=b;this.onChanged({type:"Changed",removed:c,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,b){var c=this._annotations,d,f,
h,g=[];if(a)for(d=a.length-1;d>=0;d--)h=a[d],f=this._getAnnotationIndex(h),f<0||(c.splice(f,1),g.splice(0,0,h));b||(b=[]);for(d=0;d<b.length;d++)h=b[d],f=this._binarySearch(c,h.start),c.splice(f,0,h);this.onChanged({type:"Changed",removed:g,added:b,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,b){for(var c=a.length,d=
-1,f;c-d>1;)f=Math.floor((c+d)/2),b<=a[f].start?c=f:d=f;return c},_getAnnotationIndex:function(a){for(var b=this._annotations,c=this._binarySearch(b,a.start);c<b.length&&b[c].start===a.start;){if(b[c]===a)return c;c++}return-1},_onChanged:function(a){var b=a.start,c=a.removedCharCount,d=this._annotations,f=b+c;if(0<d.length){for(var h={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:a},a=a.addedCharCount-c,c=0;c<d.length;c++){var g=d[c];g.start>=f?(g.start+=a,g.end+=a,h.changed.push(g)):
g.end<=b||(g.start<b&&f<g.end?(g.end+=a,h.changed.push(g)):(d.splice(c,1),h.removed.push(g),c--))}if(h.added.length>0||h.removed.length>0||h.changed.length>0)this.onChanged(h)}}};k.EventTarget.addMixin(a.prototype);h.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,
b){if(b){a||(a={});a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?a.styleClass+=" "+b.styleClass:a.styleClass=b.styleClass;var c;if(b.tagName&&!a.tagName)a.tagName=b.tagName;if(b.style){if(!a.style)a.style={};for(c in b.style)a.style[c]||(a.style[c]=b.style[c])}if(b.attributes){if(!a.attributes)a.attributes={};for(c in b.attributes)a.attributes[c]||(a.attributes[c]=b.attributes[c])}}return a},_mergeStyleRanges:function(a,b){a||(a=[]);var c,d;for(d=0;d<a.length&&b;d++){var f=a[d];if(b.end<=
f.start)break;if(!(b.start>=f.end)){c=this._mergeStyle({},f.style);c=this._mergeStyle(c,b.style);var h=[];h.push(d,1);b.start<f.start&&h.push({start:b.start,end:f.start,style:b.style});b.start>f.start&&h.push({start:f.start,end:b.start,style:f.style});h.push({start:Math.max(f.start,b.start),end:Math.min(f.end,b.end),style:c});b.end<f.end&&h.push({start:b.end,end:f.end,style:f.style});b=b.end>f.end?{start:f.end,end:b.end,style:b.style}:null;Array.prototype.splice.apply(a,h)}}b&&(c=this._mergeStyle({},
b.style),a.splice(d,0,{start:b.start,end:b.end,style:c}));return a},_onAnnotationModelChanged:function(a){function b(a){for(var e=0;e<a.length;e++)if(d.isAnnotationTypeVisible(a[e].type)){var j=a[e].start,h=a[e].end;f.getBaseModel&&(j=f.mapOffset(j,!0),h=f.mapOffset(h,!0));j!==-1&&h!==-1&&c.redrawRange(j,h)}}if(!a.textModelChangedEvent){var c=this._view;if(c){var d=this,f=c.getModel();b(a.added);b(a.removed);b(a.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){var b=this._annotationModel,
c=a.textView.getModel(),d=b.getTextModel(),f=a.lineStart,h=a.lineStart+a.lineText.length;d!==c&&(f=c.mapOffset(f),h=c.mapOffset(h));for(b=b.getAnnotations(f,h);b.hasNext();)if(f=b.next(),this.isAnnotationTypeVisible(f.type)){if(f.rangeStyle){var h=f.start,g=f.end;d!==c&&(h=c.mapOffset(h,!0),g=c.mapOffset(g,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:h,end:g,style:f.rangeStyle})}if(f.lineStyle)a.style=this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,f.lineStyle)}}};b.addMixin(h.prototype);
return{FoldingAnnotation:g,AnnotationType:d,AnnotationTypeList:b,AnnotationModel:a,AnnotationStyler:h}});
define("orion/editor/editor","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/eventTarget,orion/editor/tooltip,orion/editor/annotations,orion/util".split(","),function(i,k,g,d,c,b){function a(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 h(a){var b=this,c=Array.prototype.slice.call(arguments,1);return c.length?function(){return arguments.length?b.apply(a,c.concat(Array.prototype.slice.call(arguments))):b.apply(a,
c)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}a.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 c=this._textView.getModel();c.getBaseModel&&(a=c.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 c=this._textView.getModel();c.getBaseModel&&(c=c.getBaseModel());return c.getText(a,b)},_expandOffset:function(a){var b=this._textView.getModel(),d=this._annotationModel;if(d&&b.getBaseModel)for(a=d.getAnnotations(a,a+1);a.hasNext();)b=a.next(),b.type===c.AnnotationType.ANNOTATION_FOLDING&&b.expand&&(b.expand(),d.modifyAnnotation(b))},
setCaretOffset:function(a,b,c){var d=this._textView,h=d.getModel();h.getBaseModel&&(this._expandOffset(a),a=h.mapOffset(a,!0));d.setCaretOffset(a,b,c)},setText:function(a,b,c){var d=this._textView,h=d.getModel();h.getBaseModel&&(b!==void 0&&(this._expandOffset(b),b=h.mapOffset(b,!0)),c!==void 0&&(this._expandOffset(c),c=h.mapOffset(c,!0)));d.setText(a,b,c)},setFoldingEnabled:function(a){this.setFoldingRulerVisible(a)},setSelection:function(a,b,c,d){var h=this._textView,g=h.getModel();g.getBaseModel&&
(this._expandOffset(a),this._expandOffset(b),a=g.mapOffset(a,!0),b=g.mapOffset(b,!0));h.setSelection(a,b,c,d)},moveSelection:function(a,b,c,d){var h=this._textView;this.setSelection(a,b||a,1/3,function(){(d===void 0||d)&&h.focus();c&&c()})},checkDirty:function(){this.setDirty(!this._undoStack.isClean())},reportStatus:function(a,b,c){this._statusReporter&&this._statusReporter(a,b,c)},_getTooltipInfo:function(a,b){var c=this._textView,d=this.getAnnotationModel();if(!d)return null;var h=this._annotationStyler;
if(!h)return null;var g=c.getOffsetAtLocation(a,b);if(g===-1)return null;g=this.mapOffset(g);h=h.getAnnotationsByType(d,g,g+1);d=[];for(g=0;g<h.length;g++)h[g].rangeStyle&&d.push(h[g]);if(d.length===0)return null;c=c.convert({x:a,y:b},"document","page");return{contents:d,anchor:"left",x:c.x+10,y:c.y+20}},_highlightCurrentLine:function(a,b){var d=this._annotationModel;if(d){var h=this._textView.getModel(),g=b?h.getLineAtOffset(b.start):-1,i=h.getLineAtOffset(a.start),k=a.start===a.end,s=!b||b.start===
b.end,q=h.getLineStart(i),r=h.getLineEnd(i);h.getBaseModel&&(q=h.mapOffset(q),r=h.mapOffset(r));h=this._currentLineAnnotation;if(!(g===i&&s&&k&&h&&h.start===q&&h.end===r)){var g=h?[h]:null,t;k&&(h=c.AnnotationType.createAnnotation(c.AnnotationType.ANNOTATION_CURRENT_LINE,q,r),t=[h]);this._currentLineAnnotation=h;d.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,j=this;this._listener={onModelChanged:function(){j.checkDirty()},onMouseOver:function(a){j._listener.onMouseMove(a)},onMouseMove:function(a){var c=d.Tooltip.getTooltip(b);if(c&&!(j._listener.lastMouseX===a.event.clientX&&j._listener.lastMouseY===a.event.clientY))j._listener.lastMouseX=a.event.clientX,
j._listener.lastMouseY=a.event.clientY,c.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return j._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(a){var c=d.Tooltip.getTooltip(b);if(c&&!(j._listener.lastMouseX===a.event.clientX&&j._listener.lastMouseY===a.event.clientY))j._listener.lastMouseX=a.event.clientX,j._listener.lastMouseY=a.event.clientY,c.setTarget(null)},onScroll:function(){var a=d.Tooltip.getTooltip(b);a&&a.setTarget(null)},onSelection:function(a){j._updateCursorStatus();j._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 h=function(b){if(b!==void 0&&b!==-1){for(var e=this.getView().getModel(),d=this.getAnnotationModel(),j=a.mapOffset(e.getLineStart(b)),b=a.mapOffset(e.getLineEnd(b)),e=d.getAnnotations(j,b),h=null;e.hasNext();){var g=e.next();if(g.type===c.AnnotationType.ANNOTATION_BOOKMARK){h=g;break}}h?d.removeAnnotation(h):(h=c.AnnotationType.createAnnotation(c.AnnotationType.ANNOTATION_BOOKMARK,j,b),h.title=void 0,d.addAnnotation(h))}};
if(this._annotationFactory){var g=b.getModel();g.getBaseModel&&(g=g.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(g))if(g=this._annotationStyler=this._annotationFactory.createAnnotationStyler(b,this._annotationModel))g.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_SEARCH),g.addAnnotationType(c.AnnotationType.ANNOTATION_MATCHING_SEARCH),g.addAnnotationType(c.AnnotationType.ANNOTATION_ERROR),g.addAnnotationType(c.AnnotationType.ANNOTATION_WARNING),g.addAnnotationType(c.AnnotationType.ANNOTATION_MATCHING_BRACKET),
g.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_BRACKET),g.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_LINE),g.addAnnotationType(c.AnnotationType.ANNOTATION_READ_OCCURRENCE),g.addAnnotationType(c.AnnotationType.ANNOTATION_WRITE_OCCURRENCE),g.addAnnotationType(c.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP),g.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP),g.addAnnotationType(c.AnnotationType.ANNOTATION_LINKED_GROUP),g.addAnnotationType("orion.annotation.highlightError");
b.annotationModel=this._annotationModel;var g=this._annotationFactory.createAnnotationRulers(this._annotationModel),i=this._annotationRuler=g.annotationRuler;if(i)i.onDblClick=h,i.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),i.addAnnotationType(c.AnnotationType.ANNOTATION_ERROR),i.addAnnotationType(c.AnnotationType.ANNOTATION_WARNING),i.addAnnotationType(c.AnnotationType.ANNOTATION_TASK),i.addAnnotationType(c.AnnotationType.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(!0);
if(i=this._overviewRuler=g.overviewRuler)i.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_SEARCH),i.addAnnotationType(c.AnnotationType.ANNOTATION_MATCHING_SEARCH),i.addAnnotationType(c.AnnotationType.ANNOTATION_ERROR),i.addAnnotationType(c.AnnotationType.ANNOTATION_WARNING),i.addAnnotationType(c.AnnotationType.ANNOTATION_TASK),i.addAnnotationType(c.AnnotationType.ANNOTATION_BOOKMARK),i.addAnnotationType(c.AnnotationType.ANNOTATION_MATCHING_BRACKET),i.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_BRACKET),
i.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_LINE),i.addAnnotationType(c.AnnotationType.ANNOTATION_READ_OCCURRENCE),i.addAnnotationType(c.AnnotationType.ANNOTATION_WRITE_OCCURRENCE);this.setOverviewRulerVisible(!0)}if(this._lineNumberRulerFactory)this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.onDblClick=h,this.setLineNumberRulerVisible(!0);if(this._foldingRulerFactory)this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),
this._foldingRuler.addAnnotationType(c.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 a=this.getModel(),c=this.getCaretOffset(),d=a.getLineAtOffset(c),a=a.getLineStart(d);c-=a;for(var a=this.getKeyModes(),h=0;h<a.length;h++){var g=a[h];if(g.isActive()&&g.isStatusActive&&g.isStatusActive())return}this.reportStatus(b.formatMessage(i.lineColumn,d+1,c+1))},showProblems:function(a){var b=this._annotationModel;if(b){for(var d=[],h=[],g=b.getTextModel(),i=b.getAnnotations(0,g.getCharCount()),k;i.hasNext();)k=i.next(),(k.type===c.AnnotationType.ANNOTATION_ERROR||
k.type===c.AnnotationType.ANNOTATION_WARNING)&&d.push(k);if(a)for(i=0;i<a.length;i++)if(k=a[i]){var s=k.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),q=g.getLineStart(k.line-1);k=c.AnnotationType.createAnnotation(k.severity==="error"?c.AnnotationType.ANNOTATION_ERROR:c.AnnotationType.ANNOTATION_WARNING,q+k.start-1,q+k.end,s);h.push(k)}b.replaceAnnotations(d,h)}},showOccurrences:function(a){var b=this._annotationModel;if(b){for(var d=[],h=[],g=b.getTextModel(),i=b.getAnnotations(0,g.getCharCount()),
k;i.hasNext();)k=i.next(),(k.type===c.AnnotationType.ANNOTATION_READ_OCCURRENCE||k.type===c.AnnotationType.ANNOTATION_WRITE_OCCURRENCE)&&d.push(k);if(a)for(i=0;i<a.length;i++)if(k=a[i]){var s=g.getLineStart(k.line-1);k=c.AnnotationType.createAnnotation(k.readAccess===!0?c.AnnotationType.ANNOTATION_READ_OCCURRENCE:c.AnnotationType.ANNOTATION_WRITE_OCCURRENCE,s+k.start-1,s+k.end,k.description);h.push(k)}b.replaceAnnotations(d,h)}},showSelection:function(a,b,c,d,h){typeof a==="number"?(typeof b!=="number"&&
(b=a),this.moveSelection(a,b)):typeof c==="number"&&(a=this.getModel().getLineStart(c-1),typeof d==="number"&&(a+=d),typeof h!=="number"&&(h=0),this.moveSelection(a,a+h))},setInput:function(a,b,c,d){this._title=a;this._textView&&(d?(this._undoStack.markClean(),this.checkDirty()):(b?this._textView.setText(b):c!==null&&c!==void 0&&(this._textView.setText(c),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:c,contentsSaved:d})},onInputChanged:function(a){return this.dispatchEvent(a)},onGotoLine:function(a,b,c,d){if(this._textView){var h=this.getModel(),a=Math.max(0,Math.min(a,h.getLineCount()-1)),g=h.getLineStart(a),i=0;c===void 0&&(c=0);typeof b==="string"?(a=h.getLine(a).indexOf(b),a!==-1&&(i=a,c=i+b.length)):(i=b,b=h.getLineEnd(a)-g,i=Math.min(i,b),c=Math.min(c,b));this.moveSelection(g+i,g+c,d)}},onDirtyChanged:function(a){return this.dispatchEvent(a)}};
g.EventTarget.addMixin(a.prototype);if(!Function.prototype.bind)Function.prototype.bind=h;return{Editor:a}});
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(i,k,g,d,c,b,a){function h(a){var b=a.getTextView();g.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 d=this;this._listener={onVerify:function(a){var b=d.editor,e=b.getModel(),f=b.mapOffset(a.start),b=b.mapOffset(a.end),e=e.getText(f,b);if((e=d._prefix.match(RegExp("^"+c.escape(e),"i")))&&e.length>0)d._prefix+=a.text,d._success=!0,d._status(),d.find(d._forward,!0),a.text=null},onSelection:function(){d._ignoreSelection||d.setActive(!1)}}}function f(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 e={};h.prototype=new g.KeyMode;b.mixin(h.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 b;b=this._forward?this._success?i.incrementalFindStr:i.incrementalFindStrNotFound:this._success?i.incrementalFindReverseStr:i.incrementalFindReverseStrNotFound;b=a.formatMessage(b,this._prefix);this.editor.reportStatus(b,this._success?"":"error")}else this.editor.reportStatus("")}});
e.IncrementalFind=h;f.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 b=this.getFindString();if(b){this._replacingAll=!0;var c=this._editor,d=c.getTextView();c.reportStatus(i.replaceAll);var e=this.getReplaceString(),f=this;window.setTimeout(function(){for(var h=0,g=0;;){var k=f._doFind(b,h);if(!k)break;g++;g===1&&(d.setRedraw(!1),
f.startUndo());f._doReplace(k.start,k.end,b,e);h=f.getStartOffset()}g>0&&(f.endUndo(),d.setRedraw(!0));h>0?c.reportStatus(a.formatMessage(i.replacedMatches,g)):c.reportStatus(i.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(d.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,e=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;for(var a=e.getModel().find({string:a,start:b,end:this._end,reverse:this._reverse,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}),f,b=0;b<c&&a.hasNext();b++)f=
a.next();if(!this._replacingAll){f?this._editor.reportStatus(""):this._editor.reportStatus(i.notFound,"error");if(this.isVisible()){c=d.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(a=e.getAnnotationModel())a.removeAnnotations(c),f&&a.addAnnotation(d.AnnotationType.createAnnotation(c,f.start,f.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var h=this;this._timer=window.setTimeout(function(){h._markAllOccurrences();h._timer=null},500)}}this._findCallback?this._findCallback(f):
f&&e.moveSelection(f.start,f.end,null,!1)}return f},_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=d.AnnotationType.ANNOTATION_MATCHING_SEARCH,c=a.getAnnotations(0,a.getTextModel().getCharCount()),e=[],f;c.hasNext();){var h=c.next();h.type===b&&e.push(h)}if(this.isVisible()){c=
this.getFindString();c=this._editor.getModel().find({string:c,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(f=[];c.hasNext();)h=c.next(),f.push(d.AnnotationType.createAnnotation(b,h.start,h.end))}a.replaceAnnotations(e,f)}},_removeAllAnnotations:function(){var a=this._editor.getAnnotationModel();a&&(a.removeAnnotations(d.AnnotationType.ANNOTATION_CURRENT_SEARCH),a.removeAnnotations(d.AnnotationType.ANNOTATION_MATCHING_SEARCH))},_removeCurrentAnnotation:function(){var a=
this._editor.getAnnotationModel();a&&a.removeAnnotations(d.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};e.Find=f;return e});
define("orion/editor/actions","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/annotations,orion/editor/tooltip,orion/editor/find,orion/util".split(","),function(i,k,g,d,c,b){function a(a,b,d){this.editor=a;this.undoStack=b;this._incrementalFind=new c.IncrementalFind(a);this._find=d?d:new c.Find(a,b);this._lastEditLocation=null;this.init()}function h(a,b,c,d){this.editor=a;this.undoStack=b;this.contentAssist=c;this.linkedMode=d;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var f={};a.prototype={init:function(){var a=this.editor.getTextView();this._lastEditListener={onModelChanged:function(a){if(this.editor.isDirty())this._lastEditLocation=a.start+a.addedCharCount}.bind(this)};a.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);a.setAction("undo",function(){return this.undoStack?(this.undoStack.undo(),!0):!1}.bind(this),{name:i.undo});a.setAction("redo",function(){return this.undoStack?(this.undoStack.redo(),
!0):!1}.bind(this),{name:i.redo});a.setKeyBinding(new k.KeyBinding("f",!0),"find");a.setAction("find",function(){if(this._find){var a=this.editor.getSelection();(a=prompt(i.find,this.editor.getText(a.start,a.end)))&&this._find.find(!0,{findString:a})}}.bind(this),{name:i.find});a.setKeyBinding(new k.KeyBinding("k",!0),"findNext");a.setAction("findNext",function(a){return this._find?(this._find.find(!0,a),!0):!1}.bind(this),{name:i.findNext});a.setKeyBinding(new k.KeyBinding("k",!0,!0),"findPrevious");
a.setAction("findPrevious",function(a){return this._find?(this._find.find(!1,a),!0):!1}.bind(this),{name:i.findPrevious});a.setKeyBinding(new k.KeyBinding("j",!0),"incrementalFind");a.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:i.incrementalFind});a.setKeyBinding(new k.KeyBinding("j",!0,!0),"incrementalFindReverse");a.setAction("incrementalFindReverse",function(){this._incrementalFind&&this._incrementalFind.find(!1);return!0}.bind(this),
{name:i.incrementalFindReverse});a.setAction("tab",function(){return this.indentLines()}.bind(this));a.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:i.unindentLines});a.setKeyBinding(new k.KeyBinding(38,!1,!1,!0),"moveLinesUp");a.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:i.moveLinesUp});a.setKeyBinding(new k.KeyBinding(40,!1,!1,!0),"moveLinesDown");a.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:i.moveLinesDown});
a.setKeyBinding(new k.KeyBinding(38,!0,!1,!0),"copyLinesUp");a.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:i.copyLinesUp});a.setKeyBinding(new k.KeyBinding(40,!0,!1,!0),"copyLinesDown");a.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:i.copyLinesDown});a.setKeyBinding(new k.KeyBinding("d",!0,!1,!1),"deleteLines");a.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:i.deleteLines});a.setKeyBinding(new k.KeyBinding("l",
!b.isMac,!1,!1,b.isMac),"gotoLine");a.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:i.gotoLine});a.setKeyBinding(new k.KeyBinding(190,!0),"nextAnnotation");a.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:i.nextAnnotation});a.setKeyBinding(new k.KeyBinding(188,!0),"previousAnnotation");a.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:i.prevAnnotation});a.setKeyBinding(new k.KeyBinding("e",
!0,!1,!0,!1),"expand");a.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:i.expand});a.setKeyBinding(new k.KeyBinding("c",!0,!1,!0,!1),"collapse");a.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:i.collapse});a.setKeyBinding(new k.KeyBinding("e",!0,!0,!0,!1),"expandAll");a.setAction("expandAll",function(){return this.expandAnnotations(!0)}.bind(this),{name:i.expandAll});a.setKeyBinding(new k.KeyBinding("c",!0,!0,!0,!1),"collapseAll");
a.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:i.collapseAll});a.setKeyBinding(new k.KeyBinding("q",!b.isMac,!1,!1,b.isMac),"lastEdit");a.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:i.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start),c=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),f=b.getLineStart(d),
d=b.getLineEnd(c,!0),h=b.getLineCount(),g="",f=b.getText(f,d);c===h-1&&(f=(g=b.getLineDelimiter())+f);a.setText(f,d,d);a.setSelection(d+g.length,d+f.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start),c=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),d=b.getLineStart(d),f=b.getLineEnd(c,!0),h=b.getLineCount(),g="",f=b.getText(d,f);c===h-1&&(f+=g=b.getLineDelimiter());a.setText(f,
d,d);a.setSelection(d,d+f.length-g.length);return!0},deleteLines:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var c=1;if(a&&a.count)c=a.count;var d=b.getSelection(),f=b.getModel(),h=f.getLineAtOffset(d.start),a=f.getLineStart(h),c=d.start!==d.end||c===1?f.getLineAtOffset(d.end>d.start?d.end-1:d.end):Math.min(h+c-1,f.getLineCount()-1),c=f.getLineEnd(c,!0);b.setText("",a,c);return!0},expandAnnotation:function(a){var b=this.editor,c=b.getAnnotationModel();if(!c)return!0;
var d=b.getModel(),f=b.getCaretOffset(),h=d.getLineAtOffset(f),f=d.getLineStart(h),h=d.getLineEnd(h,!0);d.getBaseModel&&(f=d.mapOffset(f),h=d.mapOffset(h),d.getBaseModel());for(var i,d=c.getAnnotations(f,h);!i&&d.hasNext();)f=d.next(),f.type===g.AnnotationType.ANNOTATION_FOLDING&&(i=f);i&&a!==i.expanded&&(a?i.expand():(b.setCaretOffset(i.start),i.collapse()),c.modifyAnnotation(i));return!0},expandAnnotations:function(a){var b=this.editor,c=b.getTextView(),d=b.getAnnotationModel();if(!d)return!0;var b=
b.getModel(),f=d.getAnnotations(0,b.getCharCount());for(c.setRedraw(!1);f.hasNext();)b=f.next(),b.type===g.AnnotationType.ANNOTATION_FOLDING&&a!==b.expanded&&(a?b.expand():b.collapse(),d.modifyAnnotation(b));c.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){var c=a.getModel(),d=a.getSelection(),f=c.getLineAtOffset(d.start),h=c.getLineAtOffset(d.end>d.start?d.end-1:d.end);if(f!==h){var g=[];g.push("");
for(var i=f;i<=h;i++)g.push(c.getLine(i,!0));i=c.getLineStart(f);c=c.getLineEnd(h,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(g.join(b),i,c);a.setSelection(i===d.start?d.start:d.start+b.length,d.end+(h-f+1)*b.length);return!0}return!1}},gotoLastEdit:function(){typeof this._lastEditLocation==="number"&&this.editor.showSelection(this._lastEditLocation);return!0},gotoLine:function(){var a=this.editor,b=a.getModel().getLineAtOffset(a.getCaretOffset());
if(b=prompt(i.gotoLinePrompty,b+1))b=parseInt(b,10),a.onGotoLine(b-1,0);return!0},moveLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start),f=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),h=b.getLineCount();if(f===h-1)return!0;var d=b.getLineStart(d),c=b.getLineEnd(f,!0),g=b.getLineEnd(f+1,!0)-(c-d),i=0;f!==h-2?b=b.getText(d,c):(f=b.getLineEnd(f),b=b.getText(f,c)+b.getText(d,f),i+=c-f);this.startUndo();
a.setText("",d,c);a.setText(b,g,g);a.setSelection(g+i,g+i+b.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start);if(d===0)return!0;var f=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),h=b.getLineCount(),c=b.getLineStart(d-1),g=b.getLineStart(d),i=b.getLineEnd(f,!0),k=b.getText(g,i),t=0;f===h-1&&(f=b.getLineEnd(d-1),d=b.getLineEnd(d-1,!0),k+=b.getText(f,d),g=f,
t=d-f);this.startUndo();a.setText("",g,i);a.setText(k,c,c);a.setSelection(c,c+k.length-t);this.endUndo();return!0},nextAnnotation:function(a){var b=this.editor,c=b.getAnnotationModel();if(!c)return!0;for(var f=b.getModel(),h=b.getCaretOffset(),c=c.getAnnotations(a?h:0,a?f.getCharCount():h),i=null;c.hasNext();){var k=c.next();if(a){if(k.start<=h)continue}else if(k.start>=h)continue;switch(k.type){case g.AnnotationType.ANNOTATION_ERROR:case g.AnnotationType.ANNOTATION_WARNING:case g.AnnotationType.ANNOTATION_TASK:case g.AnnotationType.ANNOTATION_BOOKMARK:break;
default:continue}i=k;if(a)break}if(i){var q=b.getTextView(),r=f.getLineAtOffset(i.start),t=d.Tooltip.getTooltip(q);if(!t)return b.moveSelection(i.start),!0;b.moveSelection(i.start,i.start,function(){t.setTarget({getTooltipInfo:function(){var a=q.convert({x:q.getLocationAtOffset(i.start).x,y:q.getLocationAtOffset(f.getLineStart(r)).y},"document","page");return{contents:[i],x:a.x,y:a.y+Math.floor(q.getLineHeight(r)*1.33)}}},0)})}return!0},unindentLines:function(){var a=this.editor,b=a.getTextView();
if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){for(var c=a.getModel(),d=a.getSelection(),f=c.getLineAtOffset(d.start),h=c.getLineAtOffset(d.end>d.start?d.end-1:d.end),g=b.getOptions("tabSize"),i=Array(g+1).join(" "),k=[],t=b=0,l=f;l<=h;l++){var u=c.getLine(l,!0);if(c.getLineStart(l)!==c.getLineEnd(l))if(u.indexOf("\t")===0)u=u.substring(1),b++;else if(u.indexOf(i)===0)u=u.substring(g),b+=g;else return!0;l===f&&(t=b);k.push(u)}f=c.getLineStart(f);g=c.getLineEnd(h,!0);c=c.getLineStart(h);
a.setText(k.join(""),f,g);h=f===d.start?d.start:d.start-t;d=Math.max(h,d.end-b+(d.end===c+1&&d.start!==d.end?1:0));a.setSelection(h,d);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};f.TextActions=a;h.prototype={init:function(){var a=this.editor.getTextView();a.setAction("lineStart",function(){return this.lineStart()}.bind(this));a.setAction("enter",function(){return this.autoIndent()}.bind(this));
a.setKeyBinding(new k.KeyBinding(191,!0),"toggleLineComment");a.setAction("toggleLineComment",function(){return this.toggleLineComment()}.bind(this),{name:i.toggleLineComment});a.setKeyBinding(new k.KeyBinding(191,!0,!b.isMac,!1,b.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:i.addBlockComment});a.setKeyBinding(new k.KeyBinding(220,!0,!b.isMac,!1,b.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),
{name:i.removeBlockComment})},autoIndent:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getSelection();if(b.start===b.end){for(var c=a.getModel(),d=c.getLineAtOffset(b.start),f=c.getLine(d,!0),h=c.getLineStart(d),d=0,h=b.start-h,g;d<h&&((g=f.charCodeAt(d))===32||g===9);)d++;if(d>0){for(var i=f.substring(0,d),d=h;d<f.length&&((g=f.charCodeAt(d++))===32||g===9);)b.end++;a.setText(c.getLineDelimiter()+i,b.start,b.end);return!0}}return!1},addBlockComment:function(){var a=
this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=this._findEnclosingComment(b,c.start,c.end);if(d.commentStart!==void 0&&d.commentEnd!==void 0)return!0;b=b.getText(c.start,c.end);if(b.length===0)return!0;var d=b.length,b=b.replace(/\/\*|\*\//g,""),f=b.length;a.setText("/*"+b+"*/",c.start,c.end);a.setSelection(c.start+2,c.end+2+(f-d));return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&a.positions.length>0&&this.linkedMode){for(var b=
[],c=0;c<a.positions.length;++c)b[c]={positions:[{offset:a.positions[c].offset,length:a.positions[c].length}]};this.linkedMode.enterLinkedMode({groups:b,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,b,c){var d=a.getLineAtOffset(b),f=a.getLineAtOffset(c),h,g,i,
k,t,l;for(h=d;h>=0;h--)if(g=a.getLine(h),i=h===d?b-a.getLineStart(d):g.length,k=g.lastIndexOf("/*",i),g=g.lastIndexOf("*/",i),g>k)break;else if(k!==-1){t=a.getLineStart(h)+k;break}for(h=f;h<a.getLineCount();h++)if(g=a.getLine(h),i=h===f?c-a.getLineStart(f):0,k=g.indexOf("/*",i),g=g.indexOf("*/",i),k!==-1&&k<g)break;else if(g!==-1){l=a.getLineStart(h)+g;break}return{commentStart:t,commentEnd:l}},lineStart:function(){for(var a=this.editor,b=a.getModel(),c=a.getCaretOffset(),d=b.getLineAtOffset(c),f=
b.getLineStart(d),b=b.getLine(d),d=0;d<b.length;d++){var h=b.charCodeAt(d);if(!(h===32||h===9))break}d+=f;return c!==d?(a.setSelection(d,d),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getText(c.start,c.end),f,h,g;for(g=0;g<d.length;g++)if(d.substring(g,g+2)==="/*"){f=c.start+g;break}for(;g<d.length;g++)if(d.substring(g,g+2)==="*/"){h=c.start+g;break}if(f!==void 0&&h!==void 0)a.setText(b.getText(f+
2,h),f,h+2),a.setSelection(f,h);else{d=this._findEnclosingComment(b,c.start,c.end);if(d.commentStart===void 0||d.commentEnd===void 0)return!0;b=b.getText(d.commentStart+2,d.commentEnd);a.setText(b,d.commentStart,d.commentEnd+2);a.setSelection(c.start-2,c.end-2)}return!0},toggleLineComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;for(var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start),f=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),h=!0,g=[],i,
k,t=d;t<=f;t++)if(i=b.getLine(t,!0),g.push(i),!h||(k=i.indexOf("//"))===-1)h=!1;else if(k!==0){var l;for(l=0;l<k;l++)if(h=i.charCodeAt(l),!(h===32||h===9))break;h=l===k}t=b.getLineStart(d);l=b.getLineEnd(f,!0);if(h){for(h=0;h<g.length;h++)i=g[h],k=i.indexOf("//"),g[h]=i.substring(0,k)+i.substring(k+2);g=g.join("");i=b.getLineStart(f);b=t===c.start?c.start:c.start-2;c=c.end-2*(f-d+1)+(c.end===i+1?2:0)}else g.splice(0,0,""),g=g.join("//"),b=t===c.start?c.start:c.start+2,c=c.end+2*(f-d+1);a.setText(g,
t,l);a.setSelection(b,c);return!0},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};f.SourceCodeActions=h;return f});
define("orion/editor/undoStack",[],function(){function i(d,c,b){this.offset=d;this.text=c;this.previousText=b}function k(d){this.owner=d;this.changes=[]}function g(d,c){this.view=d;this.size=c!==void 0?c:100;this.reset();var b=d.getModel();b.getBaseModel&&(b=b.getBaseModel());this.model=b;var a=this;this._listener={onChanging:function(b){a._onChanging(b)},onDestroy:function(b){a._onDestroy(b)}};b.addEventListener("Changing",this._listener.onChanging);d.addEventListener("Destroy",this._listener.onDestroy)}
i.prototype={undo:function(d,c){this._doUndoRedo(this.offset,this.previousText,this.text,d,c);return!0},redo:function(d,c){this._doUndoRedo(this.offset,this.text,this.previousText,d,c);return!0},_doUndoRedo:function(d,c,b,a,h){var f=a.getModel();if(f.mapOffset&&a.annotationModel){var e=f.mapOffset(d,!0);if(e<0)for(var g=a.annotationModel.getAnnotations(d,d+1);g.hasNext();){var i=g.next();if(i.type==="orion.annotation.folding"){i.expand();e=f.mapOffset(d,!0);break}}if(e<0)return;d=e}f.setText(c,d,
d+b.length);h&&a.setSelection(d,d+c.length)}};k.prototype={add:function(d){this.changes.push(d)},end:function(d){this.endSelection=d.getSelection();this.endCaret=d.getCaretOffset();(d=this.owner)&&d.end&&d.end()},undo:function(d,c){this.changes.length>1&&d.setRedraw(!1);for(var b=this.changes.length-1;b>=0;b--)this.changes[b].undo(d,!1);this.changes.length>1&&d.setRedraw(!0);if(c){var b=this.startSelection.start,a=this.startSelection.end;d.setSelection(this.startCaret?b:a,this.startCaret?a:b)}(b=
this.owner)&&b.undo&&b.undo();return this.changes.length>0},redo:function(d,c){this.changes.length>1&&d.setRedraw(!1);for(var b=0;b<this.changes.length;b++)this.changes[b].redo(d,!1);this.changes.length>1&&d.setRedraw(!0);if(c){var b=this.endSelection.start,a=this.endSelection.end;d.setSelection(this.endCaret?b:a,this.endCaret?a:b)}(b=this.owner)&&b.redo&&b.redo();return this.changes.length>0},start:function(d){this.startSelection=d.getSelection();this.startCaret=d.getCaretOffset();(d=this.owner)&&
d.start&&d.start()}};g.prototype={add:function(d){this.compoundChange?this.compoundChange.add(d):(this.stack.splice(this.index,this.stack.length-this.index,d),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 d=this.index,c=this.stack.length;this._undoStart!==void 0&&d++;return{undo:d,redo:c-d}},undo:function(){this._commitUndo();var d;d=!1;this._ignoreUndo=!0;do{if(this.index<=0)break;d=this.stack[--this.index]}while(!(d=d.undo(this.view,!0)));this._ignoreUndo=!1;return d},redo:function(){this._commitUndo();var d;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;
d=this.stack[this.index++]}while(!d.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(d){this._commitUndo();d=new k(d);this.add(d);this.compoundChange=d;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){if(this._undoStart!==void 0)this._undoType===-1?this.add(new i(this._undoStart,
"",this._undoText)):this.add(new i(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(d){var c=d.text,b=d.start,a=d.removedCharCount,d=d.addedCharCount;if(!this._ignoreUndo){this._undoStart!==void 0&&!(d===1&&a===0&&this._undoType===1&&b===this._undoStart+
this._undoText.length||d===0&&a===1&&this._undoType===-1&&(b+1===this._undoStart||b===this._undoStart))&&this._commitUndo();if(!this.compoundChange)if(d===1&&a===0){if(this._undoStart===void 0)this._undoStart=b;this._undoText+=c;this._undoType=1;return}else if(d===0&&a===1){c=this._undoText.length>0&&this._undoStart===b;this._undoStart=b;this._undoType=-1;c?this._undoText+=this.model.getText(b,b+a):this._undoText=this.model.getText(b,b+a)+this._undoText;return}this.add(new i(b,c,this.model.getText(b,
b+a)))}}};return{UndoStack:g}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(i,k,g,d){function c(a,b,c,d){this._location=b||"left";this._overview=c||"page";this._rulerStyle=d;this._view=null;var f=this;this._listener={onTextModelChanged:function(a){f._onTextModelChanged(a)},onAnnotationModelChanged:function(a){f._onAnnotationModelChanged(a)}};this.setAnnotationModel(a)}function b(a,b,d,f,h){c.call(this,a,b,"page",d);this._oddStyle=f||{style:{backgroundColor:"white"}};
this._evenStyle=h||{style:{backgroundColor:"white"}};this._numOfDigits=0}function a(a,b,d){c.call(this,a,b,"page",d)}function h(a,b,d){c.call(this,a,b,"document",d)}function f(b,c,d){a.call(this,b,c,d)}c.prototype={getAnnotations:function(a,b){var c=this._annotationModel;if(!c)return[];var d=this._view.getModel(),f=d.getLineStart(a),h=d.getLineEnd(b-1),g=d;d.getBaseModel&&(g=d.getBaseModel(),f=d.mapOffset(f),h=d.mapOffset(h));for(var i=[],c=this.getAnnotationsByType(c,f,h),f=0;f<c.length;f++)for(var h=
c[f],k=g.getLineAtOffset(h.start),t=g.getLineAtOffset(Math.max(h.start,h.end-1)),l=k;l<=t;l++){var u=l;if(d!==g){u=g.getLineStart(l);u=d.mapOffset(u,!0);if(u===-1)continue;u=d.getLineAtOffset(u)}if(a<=u&&u<b){var y=this._mergeAnnotation(i[u],h,l-k,t-k+1);y&&(i[u]=y)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var w in i)i[w]._multiple&&(i[w].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 b=this._view,c=b.getModel(),d=c,f=c.getLineStart(a),h=f,i=this._annotationModel;if(i){h=b.getSelection();b=Math.max(h.start,h.end);h=c.getLineEnd(a,!0);f<=b&&b<c.getLineEnd(a)&&(f=b+1);c.getBaseModel&&
(f=c.mapOffset(f),h=c.mapOffset(h),d=c.getBaseModel());for(var k,a=i.getAnnotations(f,h);!k&&a.hasNext();)h=a.next(),this.isAnnotationTypeVisible(h.type)&&(k=h);k&&d.getLineAtOffset(k.start)===d.getLineAtOffset(f)?(f=k.start,h=k.end):h=f;c.getBaseModel&&(f=c.mapOffset(f,!0),h=c.mapOffset(h,!0))}(c=g.Tooltip.getTooltip(this._view))&&c.setTarget(null);this._view.setSelection(h,f,1/3,function(){})}},onDblClick:function(){},onMouseMove:function(a,b){var c=g.Tooltip.getTooltip(this._view);if(c&&!(c.isVisible()&&
this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var d=this;c.setTarget({y:b.clientY,getTooltipInfo:function(){return d._getTooltipInfo(d._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,b){this.onMouseMove(a,b)},onMouseOut:function(){var a=g.Tooltip.getTooltip(this._view);a&&a.setTarget(null)},_getTooltipInfo:function(a,b){if(a!==void 0){var c=this._view,d=c.getModel(),f=this._annotationModel,h=[];if(f){var h=d.getLineStart(a),g=d.getLineEnd(a);d.getBaseModel&&(h=d.mapOffset(h),g=d.mapOffset(g));
h=this.getAnnotationsByType(f,h,g)}f=this._getTooltipContents(a,h);if(!f)return null;f={contents:f,anchor:this.getLocation()};h=c.getClientArea();h.y=this.getOverview()==="document"?c.convert({y:b},"view","document").y:c.getLocationAtOffset(d.getLineStart(a)).y;c.convert(h,"document","page");f.x=h.x;f.y=h.y;f.anchor==="right"&&(f.x+=h.width);return f}},_getTooltipContents:function(a,b){return b},_onAnnotationModelChanged:function(a){function b(a){for(var e=0;e<a.length;e++)if(f.isAnnotationTypeVisible(a[e].type)){var h=
a[e].start,g=a[e].end;d.getBaseModel&&(h=d.mapOffset(h,!0),g=d.mapOffset(g,!0));h!==-1&&g!==-1&&c.redrawLines(d.getLineAtOffset(h),d.getLineAtOffset(Math.max(h,g-1))+1,f)}}var c=this._view;if(c){var d=c.getModel(),f=this,h=d.getLineCount();a.textModelChangedEvent?(a=a.textModelChangedEvent.start,d.getBaseModel&&(a=d.mapOffset(a,!0)),a=d.getLineAtOffset(a),c.redrawLines(a,h,f)):(b(a.added),b(a.removed),b(a.changed))}},_mergeAnnotation:function(a,b,c){a||(a={});if(c===0)if(a.html&&b.html){if(b.html!==
a.html&&!a._multiple&&this._multiAnnotation)a.html=this._multiAnnotation.html;a._multiple=!0}else a.html=b.html;a.style=this._mergeStyle(a.style,b.style);return a},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?a.styleClass+=" "+b.styleClass:a.styleClass=b.styleClass;var c;if(b.style){if(!a.style)a.style={};for(c in b.style)a.style[c]||(a.style[c]=b.style[c])}if(b.attributes){if(!a.attributes)a.attributes={};for(c in b.attributes)a.attributes[c]||
(a.attributes[c]=b.attributes[c])}}return a}};k.AnnotationTypeList.addMixin(c.prototype);b.prototype=new c;b.prototype.getAnnotations=function(a,b){for(var d=c.prototype.getAnnotations.call(this,a,b),f=this._view.getModel(),h=a;h<b;h++){var g=h&1?this._oddStyle:this._evenStyle,i=h;f.getBaseModel&&(i=f.getLineStart(i),i=f.getBaseModel().getLineAtOffset(f.mapOffset(i)));d[h]||(d[h]={});d[h].html=i+1+"";if(!d[h].style)d[h].style=g}return d};b.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();
return this.getAnnotations(a-1,a)[a-1]};b.prototype._onTextModelChanged=function(a){var a=a.start,b=this._view.getModel(),c=((b.getBaseModel?b.getBaseModel().getLineCount():b.getLineCount())+"").length;if(this._numOfDigits!==c)this._numOfDigits=c,this._view.redrawLines(b.getLineAtOffset(a),b.getLineCount(),this)};a.prototype=new c;h.prototype=new c;h.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};h.prototype._getTooltipContents=
function(a,b){if(b.length===0){var f=this._view.getModel(),h=a;f.getBaseModel&&(h=f.getLineStart(h),h=f.getBaseModel().getLineAtOffset(f.mapOffset(h)));return d.formatMessage(i.line,h+1)}return c.prototype._getTooltipContents.call(this,a,b)};h.prototype._mergeAnnotation=function(a,b,c,d){if(c===0){if(!a)a={html:"&nbsp;",style:{style:{height:3*d+"px"}}},a.style=this._mergeStyle(a.style,b.overviewStyle);return a}};f.prototype=new a;f.prototype.onClick=function(a){if(a!==void 0){var b=this._annotationModel;
if(b){var c=this._view.getModel(),d=c.getLineStart(a),a=c.getLineEnd(a,!0);c.getBaseModel&&(d=c.mapOffset(d),a=c.mapOffset(a),c=c.getBaseModel());for(var f,b=b.getAnnotations(d,a);!f&&b.hasNext();)a=b.next(),this.isAnnotationTypeVisible(a.type)&&(f=a);f&&c.getLineAtOffset(f.start)===c.getLineAtOffset(d)&&((c=g.Tooltip.getTooltip(this._view))&&c.setTarget(null),f.expanded?f.collapse():f.expand(),this._annotationModel.modifyAnnotation(f))}}};f.prototype._getTooltipContents=function(b,c){return c.length===
1&&c[0].expanded?null:a.prototype._getTooltipContents.call(this,b,c)};f.prototype._onAnnotationModelChanged=function(b){function c(a){for(g=0;g<a.length;g++)if(h.isAnnotationTypeVisible(a[g].type)){var b=a[g].start;f.getBaseModel&&(b=f.mapOffset(b,!0));b!==-1&&(k=Math.min(k,f.getLineAtOffset(b)))}}if(b.textModelChangedEvent)a.prototype._onAnnotationModelChanged.call(this,b);else{var d=this._view;if(d){var f=d.getModel(),h=this,g,i=f.getLineCount(),k=i;c(b.added);c(b.removed);c(b.changed);b=d.getRulers();
for(g=0;g<b.length;g++)d.redrawLines(k,i,b[g])}}};return{Ruler:c,AnnotationRuler:a,LineNumberRuler:b,OverviewRuler:h,FoldingRuler:f}});
define("orion/editor/textDND",[],function(){function i(i,g){this._view=i;this._undoStack=g;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var d=this;this._listener={onDragStart:function(c){d._onDragStart(c)},onDragEnd:function(c){d._onDragEnd(c)},onDragEnter:function(c){d._onDragEnter(c)},onDragOver:function(c){d._onDragOver(c)},onDrop:function(c){d._onDrop(c)},onDestroy:function(c){d._onDestroy(c)}};i.addEventListener("DragStart",this._listener.onDragStart);i.addEventListener("DragEnd",
this._listener.onDragEnd);i.addEventListener("DragEnter",this._listener.onDragEnter);i.addEventListener("DragOver",this._listener.onDragOver);i.addEventListener("Drop",this._listener.onDrop);i.addEventListener("Destroy",this._listener.onDestroy)}i.prototype={destroy:function(){var i=this._view;if(i)i.removeEventListener("DragStart",this._listener.onDragStart),i.removeEventListener("DragEnd",this._listener.onDragEnd),i.removeEventListener("DragEnter",this._listener.onDragEnter),i.removeEventListener("DragOver",
this._listener.onDragOver),i.removeEventListener("Drop",this._listener.onDrop),i.removeEventListener("Destroy",this._listener.onDestroy),this._view=null},_onDestroy:function(){this.destroy()},_onDragStart:function(i){var g=this._view,d=g.getSelection(),g=g.getModel();if(g.getBaseModel)d.start=g.mapOffset(d.start),d.end=g.mapOffset(d.end),g=g.getBaseModel();if(g=g.getText(d.start,d.end))this._dragSelection=d,i.event.dataTransfer.effectAllowed="copyMove",i.event.dataTransfer.setData("Text",g)},_onDragEnd:function(i){var g=
this._view;if(this._dragSelection){this._undoStack&&this._undoStack.startCompoundChange();(i=i.event.dataTransfer.dropEffect==="move")&&g.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var d=this._dropText,c=this._dropOffset;if(i)if(c>=this._dragSelection.end)c-=this._dragSelection.end-this._dragSelection.start;else if(c>=this._dragSelection.start)c=this._dragSelection.start;g.setText(d,c,c);g.setSelection(c,c+d.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&
this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(i){this._onDragOver(i)},_onDragOver:function(i){var g=i.event.dataTransfer.types;if(g){var d=!this._view.getOptions("readonly");d&&(d=g.contains?g.contains("text/plain"):g.indexOf("text/plain")!==-1);if(!d)i.event.dataTransfer.dropEffect="none"}},_onDrop:function(i){var g=this._view,d=i.event.dataTransfer.getData("Text");if(d)i=g.getOffsetAtLocation(i.x,i.y),this._dragSelection?(this._dropOffset=i,this._dropText=d):
(g.setText(d,i,i),g.setSelection(i,i+d.length))}};return{TextDND:i}});
define("orion/editor/templates",[],function(){function i(g,d,c){this.prefix=g;this.description=d;this.template=c;this._parse()}function k(g,d){this._keywords=g||[];this._templates=[];this.addTemplates(d||[])}i.prototype={getProposal:function(g,d,c){var g=d-g.length,d={},b,a=c.delimiter!==void 0?c.delimiter:"\n";c.indentation&&(a+=c.indentation);for(var h=c.tab!==void 0?c.tab:"\t",f=0,e=this.variables,j=this.segments,c=[],i=0;i<j.length;i++){var k=j[i],n=e[k];if(n!==void 0)switch(k){case "${tab}":k=
h;break;case "${delimiter}":k=a;break;case "${cursor}":k="";b=f;break;default:var p=d[k];p||(p=d[k]={data:n.data,positions:[]});k=n.substitution;p.data&&p.data.values&&(k=p.data.values[0]);p.positions.push({offset:g+f,length:k.length})}c.push(k);f+=k.length}var a=[],s;for(s in d)d.hasOwnProperty(s)&&a.push(d[s]);c=c.join("");if(b===void 0)b=c.length;return{proposal:c,description:this.description,groups:a,escapePosition:g+b}},match:function(g){return this.prefix.indexOf(g)===0},_parse:function(){var g=
this.template,d=[],c={},b,a=0,g=g.replace(/\n/g,"${delimiter}"),g=g.replace(/\t/g,"${tab}");g.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(h,f,e){var j=h.substring(2,h.length-1),f=h,i=j,k=null,n=i.indexOf(":");n!==-1&&(i=i.substring(0,n),f="${"+i+"}",k=JSON.parse(j.substring(n+1).replace("\\}","}").trim()));(j=c[f])||(j=c[f]={});j.substitution=i;if(k)j.data=k;(b=g.substring(a,e))&&d.push(b);d.push(f);a=e+h.length;return i});(b=g.substring(a,g.length))&&d.push(b);this.segments=d;this.variables=c}};
k.prototype={addTemplates:function(g){for(var d=this.getTemplates(),c=0;c<g.length;c++)d.push(new i(g[c].prefix,g[c].description,g[c].template))},computeProposals:function(g,d,c){var b=this.getPrefix(g,d,c),a=[];if(!this.isValid(b,g,d,c))return a;a=a.concat(this.getTemplateProposals(b,d,c));return a=a.concat(this.getKeywordProposals(b))},getKeywords:function(){return this._keywords},getKeywordProposals:function(g){var d=[],c=this.getKeywords();if(c)for(var b=0;b<c.length;b++)c[b].indexOf(g)===0&&
d.push({proposal:c[b].substring(g.length),description:c[b]});return d},getPrefix:function(g,d,c){return c.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(g,d,c){for(var b=[],a=this.getTemplates(),h=0;h<a.length;h++){var f=a[h];f.match(g)&&(f=f.getProposal(g,d,c),this.removePrefix(g,f),b.push(f))}return b},removePrefix:function(g,d){if(!(d.overwrite=d.proposal.substring(0,g.length)!==g))d.proposal=d.proposal.substring(g.length)},isValid:function(){return!0}};return{Template:i,
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(i,k,g,d,c,b){function a(a,b,c){var d=a.getTextView();g.KeyMode.call(this,d);this.editor=a;this.undoStack=b;this.contentAssist=c;this.linkedModeModel=null;d.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));d.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);return!0}.bind(this));
d.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));d.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,h=0;h<c.length;++h){f=c[h];e=f.position;var g=e.offset<=a.start&&a.start<=e.offset+e.length;g&&!f.ansestor?(e.offset+=b,e.length+=d,b+=d):(e.offset+=b,f.ansestor&&g&&(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 h,g,j=a.start-d.position.offset,i=a.end-d.position.offset,k=0;k<c.length;++k)if(g=c[k],h=g.position,g.oldOffset=h.offset,g.model===b&&g.group===d.group?(h.offset+=e,h.length+=f,e+=f):(h.offset+=e,g.ansestor&&(h.length+=d.count*f)),g.escape)g.model.escapePosition=h.offset;this.ignoreVerify=!0;e=this.editor.getTextView();for(k=c.length-1;k>=0;k--)g=c[k],g.model===b&&g.group===d.group&&e.setText(a.text,g.oldOffset+j,g.oldOffset+i);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(c)}}}.bind(this)}}
var h={};a.prototype=new g.KeyMode;b.mixin(a.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(i.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 c=this.editor.getTextView();c.removeKeyMode(this);c.removeEventListener("Verify",this.linkedModeListener.onVerify);c.removeEventListener("ModelChanged",this.linkedModeListener.onModelChanged);var d=this.contentAssist;d.removeEventListener("Activating",this.linkedModeListener.onActivating);
d.offset=void 0;this.editor.reportStatus(i.linkedModeExited,null,!0);a&&c.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],d=a.positions[0],h=this.editor.getTextView();h.setSelection(d.offset,d.offset+d.length);if(b=this.contentAssist)if(b.offset=void 0,a.data&&a.data.type==="link"&&a.data.values)(this._groupContentAssistProvider=new c.TemplateContentAssist(a.data.values)).getPrefix=function(){var a=h.getSelection();return a.start===a.end&&(a=h.getCaretOffset(),d.offset<=a&&a<=d.offset+d.length)?h.getText(d.offset,
a):""},b.offset=d.offset,b.deactivate(),b.activate();else if(this._groupContentAssistProvider)this._groupContentAssistProvider=null,b.deactivate()}this._updateAnnotations()},_getModelPositions:function(a,b,c){for(var d=b.groups,h=0;h<d.length;h++)for(var g=d[h].positions,i=0;i<g.length;i++){var k=g[i];c&&(k={offset:k.offset+c,length:k.length});k={index:i,group:h,count:g.length,model:b,position:k};a.push(k);if(b.nextModel&&b.nextModel.parentGroup===h)k.ansestor=!0,this._getModelPositions(a,b.nextModel,
(c||0)+g[i].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,c){for(var d,a=this._getSortedPositions(a),h=a.length-1;h>=0;h--){var g=a[h].position;
if(g.offset<=b&&c<=g.offset+g.length){d=a[h];break}}return{position:d,positions:a}},_updateAnnotations:function(a){var b=this.editor.getAnnotationModel();if(b){for(var c=[],h=[],g=b.getTextModel(),g=b.getAnnotations(0,g.getCharCount()),i;g.hasNext();)switch(i=g.next(),i.type){case d.AnnotationType.ANNOTATION_LINKED_GROUP:case d.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case d.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:c.push(i)}if(g=this.linkedModeModel)for(var a=a||this._getSortedPositions(g),
k=0;k<a.length;k++)if(i=a[k],i.model===g){var s=d.AnnotationType.ANNOTATION_LINKED_GROUP;i.group===g.selectedGroupIndex&&(s=i.index===0?d.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:d.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);i=i.position;i=d.AnnotationType.createAnnotation(s,i.offset,i.offset+i.length,"");h.push(i)}b.replaceAnnotations(c,h)}}});h.LinkedMode=a;return h});
define("orion/editor/factories","orion/editor/actions,orion/editor/undoStack,orion/editor/rulers,orion/editor/annotations,orion/editor/textDND,orion/editor/linkedMode".split(","),function(i,k,g,d,c,b){function a(){}function h(){}function f(){}function e(){}function j(){}function m(){}var o={};a.prototype={createKeyBindings:function(a,c,d,e){var e=new i.TextActions(a,c,e),f=new b.LinkedMode(a,c,d),a=new i.SourceCodeActions(a,c,d,f);return{textActions:e,linkedMode:f,sourceCodeActions:a}}};o.KeyBindingsFactory=
a;h.prototype={createUndoStack:function(a){a=a.getTextView();return new k.UndoStack(a,200)}};o.UndoFactory=h;f.prototype={createLineNumberRuler:function(a){return new g.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};o.LineNumberRulerFactory=f;e.prototype={createFoldingRuler:function(a){return new g.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};o.FoldingRulerFactory=e;j.prototype={createAnnotationModel:function(a){return new d.AnnotationModel(a)},
createAnnotationStyler:function(a,b){return new d.AnnotationStyler(a,b)},createAnnotationRulers:function(a){var b=new g.AnnotationRuler(a,"left",{styleClass:"ruler annotations"}),a=new g.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};o.AnnotationFactory=j;m.prototype={createTextDND:function(a,b){return new c.TextDND(a.getTextView(),b)}};o.TextDNDFactory=m;return o});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode"],function(i,k,g){var d={};d.KeyBindingsFactory=i.KeyBindingsFactory;d.UndoFactory=i.UndoFactory;d.LineNumberRulerFactory=i.LineNumberRulerFactory;d.FoldingRulerFactory=i.FoldingRulerFactory;d.AnnotationFactory=i.AnnotationFactory;d.TextDNDFactory=i.TextDNDFactory;d.TextActions=k.TextActions;d.SourceCodeActions=k.SourceCodeActions;d.LinkedMode=g.LinkedMode;return d});
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(i,k,g){var d=d||{};d.TwoWayCompareUIFactory=function(){function c(b){this._parentDivID=b.parentDivID;this._commandSpanId=b.commandSpanId;this._showTitle=b.showTitle;this._leftTitle=b.leftTitle;this._rightTitle=b.rightTitle;this._showLineStatus=b.showLineStatus}c.prototype={_init:function(){var b=this._parentDivID+"_";this._topWidgetDiv=i.node("topWidget_id");
this._topWidgetDiv.id=b+"topWidget_id";this._leftEditorParentDiv=i.node("left_editor_id");this._leftEditorParentDiv.id=b+"left_editor_id";this._rightEditorParentDiv=i.node("right_editor_id");this._rightEditorParentDiv.id=b+"right_editor_id";this._rightEditorWrapperDiv=i.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=b+"right_editor_wrapper_id";this._leftTitleDiv=i.node("left_title_id");this._leftTitleDiv.id=b+"left_title_id";this._rightTitleDiv=i.node("right_title_id");this._rightTitleDiv.id=
b+"right_title_id";this._leftStatusDiv=i.node("left_status_id");this._leftStatusDiv.id=b+"left_status_id";this._rightStatusDiv=i.node("right_status_id");this._rightStatusDiv.id=b+"right_status_id";this._diffCanvasDiv=i.node("diff_canvas_id");this._diffCanvasDiv.id=b+"diff_canvas_id";this._splitterId=b+"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 b=i.$(".split",this._topWidgetDiv);b.id=this._splitterId;var a=i.$(".leftPanelLayout",this._topWidgetDiv),c=i.$(".rightPanelLayout",this._topWidgetDiv);if(b&&a&&c)this._splitter=new k.Splitter({node:b,sidePanel:a,mainPanel:c})},buildUI:function(){i.node(this._parentDivID).innerHTML=
g;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(b){return i.$(".leftPanelLayout",this._topWidgetDiv)===b},getEditorParentDiv:function(b){return b?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(b){return b?this._leftTitleDiv:this._rightTitleDiv},getStatusDiv:function(b){return b?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv}};
return c}();return d});
var JsDiff=function(){function i(a){for(var b=[],c=0;c<a.length;c++)a[c]&&b.push(a[c]);return b}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 g=function(a){this.ignoreWhitespace=a};g.prototype={diff:function(a,b){if(b==a)return[{value:b}];if(!b)return[{value:a,removed:!0}];if(!a)return[{value:b,added:!0}];var b=this.tokenize(b),a=this.tokenize(a),c=b.length,d=a.length,g=c+d,i=[{newPos:-1,components:[]}],k=this.extractCommon(i[0],
b,a,0);if(i[0].newPos+1>=c&&k+1>=d)return i[0].components;for(var p=1;p<=g;p++)for(var s=-1*p;s<=p;s+=2){var q;q=i[s-1];var r=i[s+1],k=(r?r.newPos:0)-s;q&&(i[s-1]=void 0);var t=q&&q.newPos+1<c,l=r&&0<=k&&k<d;if(!t&&!l)i[s]=void 0;else if(!t||l&&q.newPos<r.newPos?(q={newPos:r.newPos,components:r.components.slice(0)},this.pushComponent(q.components,a[k],void 0,!0)):(q={newPos:q.newPos,components:q.components.slice(0)},q.newPos++,this.pushComponent(q.components,b[q.newPos],!0,void 0)),k=this.extractCommon(q,
b,a,s),q.newPos+1>=c&&k+1>=d)return q.components;else i[s]=q}},pushComponent:function(a,b,c,d){var g=a[a.length-1];g&&g.added===c&&g.removed===d?a[a.length-1]={value:this.join(g.value,b),added:c,removed:d}:a.push({value:b,added:c,removed:d})},extractCommon:function(a,b,c,d){for(var g=b.length,i=c.length,k=a.newPos,d=k-d;k+1<g&&d+1<i&&this.equals(b[k+1],c[d+1]);)k++,d++,this.pushComponent(a.components,b[k],void 0,void 0);a.newPos=k;return d},equals:function(a,b){var c=/\S/;return this.ignoreWhitespace&&
!c.test(a)&&!c.test(b)?!0:a==b},join:function(a,b){return a+b},tokenize:function(a){return a}};var d=new g,c=new g(!1);c.tokenize=function(a){return i(a.split(/(\s+|\b)/))};var b=new g(!0);b.tokenize=function(a){return i(a.split(/([{}:;,]|\s+)/))};var a=new g;a.tokenize=function(a){return a.split(/^/m)};return{diffChars:function(a,b){return d.diff(a,b)},diffWords:function(a,b){return c.diff(a,b)},diffLines:function(b,c){return a.diff(b,c)},diffCss:function(a,c){return b.diff(a,c)},createPatch:function(b,
c,d,g,i){var k=[];k.push("Index: "+b);k.push("===================================================================");k.push("--- "+b+"\t"+g);k.push("+++ "+b+"\t"+i);b=a.diff(c,d);b.push({value:"",lines:[]});for(var d=c=0,g=[],n=i=1,p=0;p<b.length;p++){var s=b[p],q=s.lines||s.value.replace(/\n$/,"").split("\n");s.lines=q;if(s.added||s.removed){if(!c){var r=b[p-1],c=i,d=n;r&&(g.push.apply(g,r.lines.slice(-4).map(function(a){return" "+a})),c-=4,d-=4)}g.push.apply(g,q.map(function(a){return(s.added?"+":
"-")+a}));s.added?n+=q.length:i+=q.length}else c&&(q.length<=8&&p<b.length-1?g.push.apply(g,q.map(function(a){return" "+a})):(r=Math.min(q.length,4),k.push("@@ -"+c+","+(i-c+r)+" +"+d+","+(n-d+r)+" @@"),k.push.apply(k,g),k.push.apply(k,q.slice(0,r).map(function(a){return" "+a})),d=c=0,g=[])),i+=q.length,n+=q.length}b.length>1&&!/\n$/.test(b[b.length-2].value)&&k.push("\\ No newline at end of file\n");return k.join("\n")},convertChangesToXML:function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];
d.added?b.push("<ins>"):d.removed&&b.push("<del>");b.push(k(d.value));d.added?b.push("</ins>"):d.removed&&b.push("</del>")}return b.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(i){var k=k||{};k.JSDiffAdapter=function(){function g(){}g.prototype={_specialLine:function(d,c,b){return c.value===d&&b!==d},adapt:function(d,c,b){b||(b="\n");for(var a=d.split(b),h=c.split(b),f=a[a.length-1]==="",h=h[h.length-1]==="",e=i.diffLines(d,c),d=[],c=[],g=0,k=0,o=-1,n=0,p=!0,s=b,q=0;q<e.length;q++){var r=e[q],t=r.lines||r.value.split(b),l=t.length,u=0;t.length>1&&t[t.length-1]===""&&l--;l>1&&!p&&t[0]===""&&(l--,u++);r.lines=t;
if(!r.added&&!r.removed){if(!this._specialLine(b,r,s)){if(g||k)d.push([g,k,o]),k=g=0,o=-1,n+=k;d.push([l,l,0]);n+=l}}else if(r.added){o===-1&&(o=c.length+1);g+=l;for(p=u;p<l+u;p++)c.push(r.lines[p])}else k+=l;p=!1;t.length>1&&t[t.length-1]===""&&(p=!0);s=r.value?r.value[r.value.length-1]:b}if(g||k)d.push([g,k,o]),n+=k;n<a.length&&a.length>1&&(b=d[d.length-1],b[2]===0?(b[0]+=1,b[1]+=1):b[2]===-1?d.push([1,1,0]):f===h?d.push([1,1,0]):(h&&(b[0]+=1),f&&(b[1]+=1)));return{mapper:d,changContents:{array:c,
index:0}}},adaptCharDiff:function(d,c,b){for(var d=b?i.diffWords(d,c):i.diffChars(d,c),c=[],a=b=0,h=0,f=0,e=0;e<d.length;e++){var g=d[e];if(!g.added&&!g.removed){if(h>0||f>0)c.push([a,a+h,b,b+f]),a+=h,b+=f,f=h=0;a+=g.value.length;b+=g.value.length}else g.added?h+=g.value.length:f+=g.value.length}(h>0||f>0)&&c.push([a,a+h,b,b+f]);return c}};return g}();return k});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(i,k,g,d){var c={},b,a,h,f,e,j,m,o,n,p,s,q,r,t,l,u;c.DiffTreeNavigator=function(){function c(a,b,d,e,f,h){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,b,d,e,f,h)}b="orion.annotation.diff.addedBlock";a="orion.annotation.diff.currentAddedBlock";h="orion.annotation.diff.deletedBlock";f="orion.annotation.diff.currentDeletedBlock";
e="orion.annotation.diff.blockTop";j="orion.annotation.diff.currentBlockTop";m="orion.annotation.diff.blockConflict";o="orion.annotation.diff.currentBlockConflict";n="orion.annotation.diff.addedWord";p="orion.annotation.diff.currentAddedWord";s="orion.annotation.diff.deletedWord";q="orion.annotation.diff.currentDeletedWord";r="orion.annotation.diff.emptyDeletedWordLeft";t="orion.annotation.diff.emptyDeletedWordRight";l="orion.annotation.diff.emptyAddedWordLeft";u="orion.annotation.diff.emptyAddedWordRight";
g.AnnotationType.registerType(b,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});g.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});g.AnnotationType.registerType(h,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});g.AnnotationType.registerType(f,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});g.AnnotationType.registerType(e,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
g.AnnotationType.registerType(j,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});g.AnnotationType.registerType(m,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});g.AnnotationType.registerType(o,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});g.AnnotationType.registerType(n,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});g.AnnotationType.registerType(p,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});g.AnnotationType.registerType(s,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});g.AnnotationType.registerType(q,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});g.AnnotationType.registerType(r,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});g.AnnotationType.registerType(t,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
g.AnnotationType.registerType(l,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});g.AnnotationType.registerType(u,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});c.prototype={initAll:function(a,b,c,d,e,f,h){this._charOrWordDiff=a?a:"word";if(b)this._initialized=!0;this.editorWrapper=[{editor:b,diffFeeder:d},{editor:c,diffFeeder:e}];this._curveRuler=h;(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 d.JSDiffAdapter;for(a=0;a<b.length;a++){var e=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(e);var f=this.generatePairWordAnnotations(e,a,c);if(f)e.children=f}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 i.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],h=a===0?f.oldA:f.newA;if(b>=h.start&&b<=h.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 h=e.next();h.type===c&&f.push(h)}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},h={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(h,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 (g.AnnotationType.getType(d.current))(f.start,f.end)],d,!0);
e&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (g.AnnotationType.getType(e.current))(h.start,h.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,h=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"),h=e.start,f=d.start;else return null;c=[];d=[];this.generateWordDiffAnnotations(0,c,f,b,2,3);this.generateWordDiffAnnotations(1,d,h,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=g.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 h=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1}),a=this.getAnnoModelList(a,"word",h.normal),j=0;j<d.length;j++){var i=
g.AnnotationType.createAnnotation(h.normal,d[j][e]+c,d[j][f]+c);a.push(i);b.push(i)}},_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 c}();c.DiffBlockFeeder=function(){function a(){}a.prototype={getWordAnnoTypes:function(a){this._mapperColumnIndex===
0?a.push({type:"word",current:p,normal:n,list:[]}):a.push({type:"word",current:q,normal:s,list:[]});a.push({type:"word",current:r});a.push({type:"word",current:t});a.push({type:"word",current:l});a.push({type:"word",current:u})},getCurrentWordAnnoType:function(a,b){return a.start===a.end&&b?this._mapperColumnIndex===0?{current:this._repositionEmptyWord(a,b),normal:n}:{current:this._repositionEmptyWord(a,b),normal:s}:this._mapperColumnIndex===0?{current:p,normal:n}:{current:q,normal:s}},_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?u: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?u:t;return this._mapperColumnIndex===0?l:r},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}();c.TwoWayDiffBlockFeeder=function(){function d(a,b,c){this._mapperColumnIndex=c;this.init(a,b)}d.prototype=new c.DiffBlockFeeder;d.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]}};d.prototype.getBlockAnnoTypes=function(c){this._mapperColumnIndex===0?c.push({type:"block",normal:b,current:a,list:[]}):c.push({type:"block",normal:h,current:f,list:[]});c.push({type:"block",normal:e,current:j,list:[]});c.push({type:"block",normal:m,current:o,list:[]})};d.prototype.getCurrentBlockAnnoType=function(c){if(!this._diffBlocks||this._diffBlocks.length===0||this._diffBlocks.length<=c)return null;c=this._diffBlocks[c][1];
if(this._mapper[c][this._mapperColumnIndex]===0)return{normal:e,current:j};else if(k.isMapperConflict(this.getMapper(),c))return{normal:m,current:o};else if(this._mapperColumnIndex===0)return{type:"block",normal:b,current:a,list:[]};return{type:"block",normal:h,current:f,list:[]}};return d}();c.inlineDiffBlockFeeder=function(){function d(a,b){this._mapperColumnIndex=b;this.init(a)}d.prototype=new c.DiffBlockFeeder;d.prototype.setModel=function(a){this._textModel=a};d.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]}}};d.prototype.getBlockAnnoTypes=function(c){this._mapperColumnIndex===0?c.push({type:"block",normal:b,current:a,list:[]}):c.push({type:"block",normal:h,current:f,list:[]});c.push({type:"block",normal:m,current:o,list:[]})};d.prototype.getCurrentBlockAnnoType=function(c){if(!this._diffBlocks||this._diffBlocks.length===0)return null;c=this._diffBlocks[c][1];if(this._mapper[c][this._mapperColumnIndex]===0)return{current:p,normal:n};else if(k.isMapperConflict(this.getMapper(),
c))return{normal:m,current:o};else if(this._mapperColumnIndex===0)return{type:"block",normal:b,current:a,list:[]};return{type:"block",normal:h,current:f,list:[]}};d.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]};d.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 d}();return c});
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(i,k,g,d,c,b,a,h,f,e,j,m,o){var n={};n.CompareView=function(){function a(){this._diffParser=new d.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 m.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}();n.TwoWayCompareView=function(){function d(a){this.setOptions(a,!0);this._diffNavigator=new o.DiffTreeNavigator("word");
this.type="twoWay";this._uiFactory=this.options.uiFactory;if(!this._uiFactory)this._uiFactory=new e.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 c.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}
d.prototype=new n.CompareView;d.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 c.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 i["There are unsaved changes."]}.bind(this)};d.prototype.getEditors=function(){return this._editors};d.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)};d.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)};d.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)};
d.prototype.resizeEditors=function(){this._editors.forEach(function(a){a.getTextView().resize()})};d.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};d.prototype._createEditor=function(c,d,e,h,g){var j=typeof h.readonly==="undefined"?!0:h.readonly,k=function(){var a=new f.TextView({parent:d,readonly:j,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)?g:!g)&&a.resize()}}.bind(this));return a}.bind(this),m=h.keyBindingFactory;m||(m=new a.KeyBindingsFactory);var n=null;if(e)var o="",n=function(a,b){if(e)o=b?i["ERROR: "]+a:a,e.textContent=""+o};k=new b.Editor({textViewFactory:k,undoStackFactory:new a.UndoFactory,annotationFactory:new a.AnnotationFactory,keyBindingFactory:m,statusReporter:n,domNode:d});k.installTextView();k.setInput(null,null,h.Content?h.Content:c);k.setOverviewRulerVisible(!1);var p=k.getTextView();
p.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(p.getCaretOffset(),p)}.bind(this));p.getModel().addEventListener("Changed",function(a){if(!this._curveRuler.onChanged(a,!g))this.options.mapper=null}.bind(this));g?p.addEventListener("Scroll",function(){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render());if(this.onScroll)this.onScroll()}.bind(this)):
p.addEventListener("Scroll",function(){this._curveRuler&&this._curveRuler.render()}.bind(this));return k};d.prototype.destroy=function(){this._editors&&(this._diffNavigator.destroy(),this._editors.forEach(function(a){a.destroy()}),this._uiFactory.destroy())};d.prototype.addRulers=function(){if(this._editors&&!this._hasRuler){var a=new c.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),b=new c.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}};d.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 o.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),d.mapper,1),f=new o.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)g.empty(b),g.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 d}();n.InlineCompareView=function(){function d(a){this.setOptions(a,
!0);this._diffNavigator=new o.DiffTreeNavigator("word");this.type="inline";this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._editorDiv=this.options.parentDivId}d.prototype=new n.CompareView;d.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};d.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};d.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.setText(""),this.removeRulers())};d.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};d.prototype.initEditors=function(d){var e=g.node(this._editorDiv),h=function(){return new f.TextView({parent:e,readonly:!0,tabSize:4})}.bind(this);this._editor=
new b.Editor({textViewFactory:h,undoStackFactory:new a.UndoFactory,annotationFactory:new a.AnnotationFactory,domNode:e});this._editor.installTextView();this._editor.setInput(null,null,d);this._editor.setOverviewRulerVisible(!1);this._editor.setAnnotationRulerVisible(!1);this._textView=this._editor.getTextView();this._rulerOrigin=new c.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._rulerNew=new c.LineNumberCompareRuler(this._diffNavigator,
0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._overviewRuler=new c.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))};d.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)}};d.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 o.inlineDiffBlockFeeder(b.mapper,
1),c=new o.inlineDiffBlockFeeder(b.mapper,0);j.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};d.prototype.setConflicting=
function(a){this._conflcit=a};return d}();n.toggleableCompareView=function(){function a(b,c){if(c)c.toggler=this;this._widget=b==="inline"?new n.InlineCompareView(c):new n.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();g.empty(g.node(a.parentDivId));this._widget=this._widget.type==="inline"?new n.TwoWayCompareView(a):new n.InlineCompareView(a);
this._widget.initEditors();this._widget.refresh(!0)},getWidget:function(){return this._widget}};return a}();return n});
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(i,k){function g(a,b){this.keywords=a;this.whitespacesVisible=b;this.setText("")}function d(){g.call(this,null,!0)}function c(a){g.call(this,null,a)}function b(){g.call(this,null,!1)}function a(a,j,i){this.commentStart="/*";this.commentEnd="*/";var k=[];switch(j){case "java":k=f;break;case "js":k=h;break;case "css":k=e}this.whitespacesVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=
this.foldingEnabled=!0;this._scanner=new g(k,this.whitespacesVisible);this._firstScanner=new b;this._commentScanner=new c(this.whitespacesVisible);this._whitespaceScanner=new d;if(j==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=a;this.annotationModel=i;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)}};j=a.getModel();j.getBaseModel&&(j=j.getBaseModel());j.addEventListener("Changed",this._listener.onChanged);a.addEventListener("MouseDown",this._listener.onMouseDown);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",this._listener.onLineStyle);this._computeComments();this._computeFolding();a.redrawLines()}var h=k.JSKeywords,f=k.JAVAKeywords,e=k.CSSKeywords,j={styleClass:"token_singleline_comment"},
m={styleClass:"token_multiline_comment"},o={styleClass:"token_doc_comment"},n={styleClass:"token_doc_html_markup"},p={styleClass:"token_task_tag"},s={styleClass:"token_doc_tag"},q={styleClass:"token_string"},r={styleClass:"token_number"},t={styleClass:"token_keyword"},l={styleClass:"token_space"},u={styleClass:"token_tab"},y={styleClass:"line_caret"};g.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}};d.prototype=new g(null);d.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}}};c.prototype=new g(null);c.prototype.setType=function(a){this._type=a};c.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}}};b.prototype=new g(null);b.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),1}};a.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(i.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 (i.AnnotationType.getType(i.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=[],g=i.AnnotationType.ANNOTATION_TASK;h.hasNext();){var j=h.next();j.type===g&&e.push(j)}h=[];j=this._commentScanner;j.setText(f.getText(b,c));for(var k;k=j.nextToken();){var l=j.getStartOffset()+b;k===14&&(k=f.getLineEnd(f.getLineAtOffset(l)),a!==6&&(k=Math.min(k,c-this.commentEnd.length)),h.push(i.AnnotationType.createAnnotation(g,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 y}return null},_getStyles:function(a,b,c){a.getBaseModel&&(c=a.mapOffset(c));for(var d=c+b.length,e=[],f=c,h=this.comments,g=this._binarySearch(h,c,!0);g<h.length;g++){if(h[g].start>=d)break;var j=h[g].start,i=h[g].end;f<j&&this._parse(b.substring(f-c,j-c),f,e);var k=h[g].type,l;switch(k){case 8:l=o;break;case 7:l=m;break;case 5:l=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,l,k):k===5&&this.whitespacesVisible?this._parseString(b.substring(f-c,j-c),f,e,q):e.push({start:f,end:j,style:l});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=r;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,o,a);continue;case 6:this._parseComment(d.getData(),e,c,j,a);continue;case 7:this._parseComment(d.getData(),e,c,m,a);continue;case 10:this.whitespacesVisible&&(f=u);break;case 11:this.whitespacesVisible&&(f=l)}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,h=d;switch(a){case 10:this.whitespacesVisible&&
(h=u);break;case 11:this.whitespacesVisible&&(h=l);break;case 12:h=n;break;case 13:h=s;break;case 14:h=p;break;default:this.detectHyperlinks&&(h=this._detectHyperlinks(f.getData(),e,c,h))}h&&c.push({start:e,end:f.getOffset()+b,style:h})}},_parseString:function(a,b,c,d){var e=this._whitespaceScanner;for(e.setText(a);a=e.nextToken();){var f=e.getStartOffset()+b,h=d;switch(a){case 10:this.whitespacesVisible&&(h=u);break;case 11:this.whitespacesVisible&&(h=l)}h&&c.push({start:f,end:e.getOffset()+b,style:h})}},
_detectHyperlinks:function(a,b,c,d){var e=null,f;if((f=a.indexOf("://"))>0){for(var e=a,h=f;h>0;){f=e.charCodeAt(h-1);if(!(97<=f&&f<=122||65<=f&&f<=90||45===f||48<=f&&f<=57))break;h--}if(h>0&&(f="\"\"''(){}[]<>".indexOf(e.substring(h-1,h)),f!==-1&&(f&1)===0&&(f=e.lastIndexOf("\"\"''(){}[]<>".substring(f+1,f+2)))!==-1)){var g=f;f=this._clone(d);f.tagName="a";f.attributes={href:e.substring(h,g)};c.push({start:b,end:b+h,style:d});c.push({start:b+h,end:b+g,style:f});c.push({start:b+g,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 h=a.getLineAtOffset(b),c=a.getLine(h),g=a.getLineStart(h),j=a.getLineEnd(h),c=this._findBrackets(d,f,c,g,g,j),j=0;j<c.length;j++)if(g=c[j]>=0?1:-1,c[j]*g-1===b){var i=1;if(e&1){for(j--;j>=0;j--)if(g=c[j]>=0?1:-1,i+=g,i===0)return c[j]*g-1;for(h-=1;h>=
0;){c=a.getLine(h);g=a.getLineStart(h);j=a.getLineEnd(h);c=this._findBrackets(d,f,c,g,g,j);for(e=c.length-1;e>=0;e--)if(g=c[e]>=0?1:-1,i+=g,i===0)return c[e]*g-1;h--}}else{for(j++;j<c.length;j++)if(g=c[j]>=0?1:-1,i+=g,i===0)return c[j]*g-1;h+=1;for(e=a.getLineCount();h<e;){c=a.getLine(h);g=a.getLineStart(h);j=a.getLineEnd(h);c=this._findBrackets(d,f,c,g,g,j);for(j=0;j<c.length;j++)if(g=c[j]>=0?1:-1,i+=g,i===0)return c[j]*g-1;h++}}break}return-1},_findBrackets:function(a,b,c,d,e,f){for(var h=[],a=
a.charCodeAt(0),b=b.charCodeAt(0),g=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(g<i)for(j.setText(c.substring(g-e,i-e));i=j.nextToken();)i===a?h.push(j.getStartOffset()+g-e+d+1):i===b&&h.push(-(j.getStartOffset()+g-e+d+1));g=m}if(g<f)for(j.setText(c.substring(g-e,f-e));i=j.nextToken();)i===a?h.push(j.getStartOffset()+g-e+d+1):i===b&&h.push(-(j.getStartOffset()+g-e+d+1));return h},_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,
g,j;if(c.start===c.end&&(j=d.getCaretOffset())>0)j-=1,a.getBaseModel&&(j=a.mapOffset(j),a=a.getBaseModel()),a=this._findMatchingBracket(a,j),a!==-1&&(g=[i.AnnotationType.createAnnotation(i.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),i.AnnotationType.createAnnotation(i.AnnotationType.ANNOTATION_CURRENT_BRACKET,j,j+1)]);this._bracketAnnotations=g;this.annotationModel.replaceAnnotations(b,g)}},_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(),g=this.comments.length,j=f.getLineStart(f.getLineAtOffset(b)),k=this._binarySearch(this.comments,j,!0),l=this._binarySearch(this.comments,
c,!1,k-1,g);k<g&&this.comments[k].start<=j&&j<this.comments[k].end?(j=this.comments[k].start,j>b&&(j+=d)):j=k===g&&g>0&&h-d===this.comments[g-1].end?this.comments[g-1].start:j;var m;l<g?(m=this.comments[l].end,m>b&&(m+=d),l+=1):(l=g,m=h);for(var n,h=this._findComments(f.getText(j,m),j),g=k;g<this.comments.length;g++)n=this.comments[g],n.start>b&&(n.start+=d),n.start>b&&(n.end+=d);var o=l-k!==h.length;if(!o)for(g=0;g<h.length;g++){n=this.comments[k+g];var p=h[g];if(n.start!==p.start||n.end!==p.end||
n.type!==p.type){o=!0;break}}g=[k,l-k].concat(h);Array.prototype.splice.apply(this.comments,g);o&&(g=j,n=m,a!==f&&(g=a.mapOffset(g,!0),n=a.mapOffset(n,!0)),e.redrawRange(g,n));if(this.foldingEnabled&&f!==a&&this.annotationModel){e=this.annotationModel;k=e.getAnnotations(j,m);j=[];for(m=[];k.hasNext();)if(n=k.next(),n.type===i.AnnotationType.ANNOTATION_FOLDING){m.push(n);for(g=0;g<h.length;g++)if(n.start===h[g].start&&n.end===h[g].end)break;g===h.length?(j.push(n),n.expand()):(g=n.start,l=n.end,g>
b&&(g-=d),l>b&&(l-=d),g<=b&&b<l&&g<=c&&c<l&&(g=f.getLineAtOffset(n.start),l=f.getLineAtOffset(n.end),g!==l?n.expanded||(n.expand(),e.modifyAnnotation(n)):e.removeAnnotation(n)))}b=[];for(g=0;g<h.length;g++){n=h[g];for(d=0;d<m.length;d++)if(m[d].start===n.start&&m[d].end===n.end)break;d===m.length&&(n=this._createFoldingAnnotation(a,f,n.start,n.end))&&b.push(n)}e.replaceAnnotations(j,b)}}};return{TextStyler:a}});
define("orion/editor/textMateStyler",["orion/editor/regex"],function(i){function k(c){var b;if(c instanceof Array){b=Array(c.length);for(var a=0;a<c.length;a++)b[a]=k(c[a])}else for(a in b={},c)if(Object.prototype.hasOwnProperty.call(c,a)){var d=c[a];b[a]=typeof d==="object"&&d!==null?k(d):d}return b}function g(c,b,a){this.initialize(c);this.grammar=k(b);this.externalGrammars=a?k(a):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var d={unsupported:[{regex:/\(\?[ims\-]:/,
func:function(){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(c){return c[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(c){function b(a,b){throw Error('Unsupported regex feature "'+a+'": "'+b[0]+'" at index: '+b.index+" in "+b.input);}var a="",h,c=d.processGlobalFlag("x",c,function(a){for(var b="",c=!1,d=a.length,f=0;f<d;){var h=a.charAt(f);if(!c&&h==="#")for(;f<d&&h!=="\r"&&h!=="\n";)h=a.charAt(++f);
else if(!c&&/\s/.test(h))for(;f<d&&/\s/.test(h);)h=a.charAt(++f);else h==="\\"?(b+=h,/\s/.test(a.charAt(f+1))||(b+=a.charAt(f+1),f+=1)):(h==="["?c=!0:h==="]"&&(c=!1),b+=h),f+=1}return b}),c=d.processGlobalFlag("i",c,function(b){a+="i";return b});for(h=0;h<this.unsupported.length;h++){var f;(f=this.unsupported[h].regex.exec(c))&&b(this.unsupported[h].func(f),f)}return RegExp(c,a)},processGlobalFlag:function(c,b,a){function d(a,b){for(var c=0,f=a.length,h=-1,g=b;g<f&&h===-1;g++)switch(a.charAt(g)){case "\\":g++;
break;case "(":c++;break;case ")":c--,c===0&&(h=g)}return h}var f="(?"+c+")",c="(?"+c+":";if(b.substring(0,f.length)===f)return a(b.substring(f.length));else if(b.substring(0,c.length)===c){f=d(b,0);if(f<b.length-1)throw Error("Only a "+c+") group that encloses the entire regex is supported in: "+b);return a(b.substring(c.length,f))}return b},hasBackReference:function(c){return/\\\d+/.test(c.source)},getSubstitutedRegex:function(c,b,a){for(var a=typeof a==="undefined"?!0:!1,c=c.source.split(/(\\\d+)/g),
d=[],f=0;f<c.length;f++){var e=c[f],g=/\\(\d+)/.exec(e);g?(e=b[g[1]]||"",d.push(a?i.escape(e):e)):d.push(e)}return RegExp(d.join(""))},groupify:function(c,b){for(var a=c.source,d=a.length,f=[],e=0,g=[],i=1,k=1,n=[],p={},s={},q=0;q<d;q++){var r=f[f.length-1],t=a.charAt(q);switch(t){case "(":if(r===4)f.pop(),n.push(")"),g[g.length-1].end=q;var l=q+2<d?a.charAt(q+1)+""+a.charAt(q+2):null;if(l==="?:"||l==="?="||l==="?!"){var u;l==="?:"?u=1:(u=3,e++);f.push(u);g.push({start:q,end:-1,type:u});n.push(t);
n.push(l);q+=l.length}else f.push(2),g.push({start:q,end:-1,type:2,oldNum:i,num:k}),n.push(t),e===0&&(s[k]=null),p[i]=k,i++,k++;break;case ")":r=f.pop();r===3&&e--;g[g.length-1].end=q;n.push(t);break;case "*":case "+":case "?":case "}":var y=t,w=a.charAt(q-1),l=q-1;if(t==="}"){for(u=q-1;a.charAt(u)!=="{"&&u>=0;u--);w=a.charAt(u-1);l=u-1;y=a.substring(u,q+1)}u=g[g.length-1];if(w===")"&&(u.type===2||u.type===4)){n.splice(u.start,0,"(");n.push(y);n.push(")");t={start:u.start,end:n.length-1,type:4,num:u.num};
for(w=0;w<g.length;w++)if(r=g[w],(r.type===2||r.type===4)&&r.start>=u.start&&r.end<=l)if(r.start+=1,r.end+=1,r.num+=1,r.type===2)p[r.oldNum]=r.num;g.push(t);k++;break}default:t!=="|"&&r!==2&&r!==4&&e===0&&(f.push(4),g.push({start:q,end:-1,type:4,num:k}),n.push("("),s[k]=null,k++),n.push(t),t==="\\"&&(t=a.charAt(q+1),n.push(t),q+=1)}}for(;f.length;)f.pop(),n.push(")");var a=RegExp(n.join("")),d={},b=b||p,v;for(v in b)b.hasOwnProperty(v)&&(d[v]="\\"+b[v]);a=this.getSubstitutedRegex(a,d,!1);return[a,
p,s]},complexCaptures:function(c){if(!c)return!1;for(var b in c)if(c.hasOwnProperty(b)&&b!=="0")return!0;return!1}};g.prototype={initialize:function(c){this.textView=c;this.textView.stylerOptions=this;var b=this;this._listener={onModelChanged:function(a){b.onModelChanged(a)},onDestroy:function(a){b.onDestroy(a)},onLineStyle:function(a){b.onLineStyle(a)},onStorage:function(a){b.onStorage(a)}};c.addEventListener("ModelChanged",this._listener.onModelChanged);c.addEventListener("Destroy",this._listener.onDestroy);
c.addEventListener("LineStyle",this._listener.onLineStyle);c.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(c){for(c=[c];c.length!==0;){var b=
c.pop();if(!b._resolvedRule||!b._typedRule)if(b._resolvedRule=this._resolve(b),b._typedRule=this._createTypedRule(b),this.addStyles(b.name),this.addStyles(b.contentName),this.addStylesForCaptures(b.captures),this.addStylesForCaptures(b.beginCaptures),this.addStylesForCaptures(b.endCaptures),b._resolvedRule!==b&&c.push(b._resolvedRule),b.patterns)for(var a=0;a<b.patterns.length;a++)c.push(b.patterns[a])}},addStyles:function(c){if(c&&!this._styles[c]){this._styles[c]=[];for(var b=c.split("."),a=0;a<
b.length;a++)this._styles[c].push(b.slice(0,a+1).join("-"))}},addStylesForCaptures:function(c){for(var b in c)c.hasOwnProperty(b)&&this.addStyles(c[b].name)},ContainerRule:function(){function c(b){this.rule=b;this.subrules=b.patterns}c.prototype.valueOf=function(){return"aa"};return c}(),BeginEndRule:function(){function c(b){this.rule=b;this.beginRegex=d.toRegExp(b.begin);this.endRegex=d.toRegExp(b.end);this.subrules=b.patterns||[];this.endRegexHasBackRef=d.hasBackReference(this.endRegex);var a=d.complexCaptures(b.captures),
b=d.complexCaptures(b.beginCaptures)||d.complexCaptures(b.endCaptures);if(this.isComplex=a||b)a=d.groupify(this.beginRegex),this.beginRegex=a[0],this.beginOld2New=a[1],this.beginConsuming=a[2],a=d.groupify(this.endRegex,this.beginOld2New),this.endRegex=a[0],this.endOld2New=a[1],this.endConsuming=a[2]}c.prototype.valueOf=function(){return this.beginRegex};return c}(),MatchRule:function(){function c(b){this.rule=b;this.matchRegex=d.toRegExp(b.match);if(this.isComplex=d.complexCaptures(b.captures))b=
d.groupify(this.matchRegex),this.matchRegex=b[0],this.matchOld2New=b[1],this.matchConsuming=b[2]}c.prototype.valueOf=function(){return this.matchRegex};return c}(),_createTypedRule:function(c){return c.match?new this.MatchRule(c):c.begin?new this.BeginEndRule(c):new this.ContainerRule(c)},_resolve:function(c){var b=c;if(c.include){if(c.begin||c.end||c.match)throw Error('Unexpected regex pattern in "include" rule '+c.include);c=c.include;if(c.charAt(0)==="#"){if(b=this.grammar.repository&&this.grammar.repository[c.substring(1)],
!b)throw Error("Couldn't find included rule "+c+" in grammar repository");}else if(c==="$self")b=this.grammar;else if(c==="$base")throw Error('Include "$base" is not supported');else if(b=this._allGrammars[c],!b)for(var a=0;a<this.externalGrammars.length;a++){var d=this.externalGrammars[a];if(d.scopeName===c){this.preprocess(d);b=this._allGrammars[c]=d;break}}}return b},ContainerNode:function(){function c(b,a){this.parent=b;this.rule=a;this.children=[];this.end=this.start=null}c.prototype.addChild=
function(b){this.children.push(b)};c.prototype.valueOf=function(){var b=this.rule;return"ContainerNode { "+(b.include||"")+" "+(b.name||"")+(b.comment||"")+"}"};return c}(),BeginEndNode:function(){function c(b,a,c){this.parent=b;this.rule=a;this.children=[];this.setStart(c);this.endMatch=this.end=null;this.endRegexSubstituted=a.endRegexHasBackRef?d.getSubstitutedRegex(a.endRegex,c):null}c.prototype.addChild=function(b){this.children.push(b)};c.prototype.getIndexInParent=function(){return this.parent?
this.parent.children.indexOf(this):-1};c.prototype.setStart=function(b){this.start=b.index;this.beginMatch=b};c.prototype.setEnd=function(b){b&&typeof b==="object"?(this.endMatch=b,this.end=b.index+b[0].length):(this.endMatch=null,this.end=b)};c.prototype.shiftStart=function(b){this.start+=b;this.beginMatch.index+=b};c.prototype.shiftEnd=function(b){this.end+=b;this.endMatch&&(this.endMatch.index+=b)};c.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+
"}"};return c}(),push:function(c,b){if(b)for(var a=b.length;a>0;)c.push(b[--a])},exec:function(c,b,a){(b=c.exec(b))&&(b.index+=a);c.lastIndex=0;return b},afterMatch:function(c){return c.index+c[0].length},getEndMatch:function(c,b,a){if(c instanceof this.BeginEndNode){var d=c.rule,c=c.endRegexSubstituted||d.endRegex;return!c?null:this.exec(c,b,a)}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(c){var b=c.addedCharCount,a=c.removedCharCount,c=c.start;if(this._tree){var d=this.textView.getModel(),f=d.getCharCount(),d=d.getLineEnd(d.getLineAtOffset(c)-1),e=this.getFirstDamaged(d,d),d=d===-1?0:d,b=e?this.parse(e,!0,d,c,b,a):f;this.textView.redrawRange(d,b)}else this.initialParse()},getFirstDamaged:function(c,b){if(c<0)return this._tree;for(var a=[this._tree],d=null;a.length;){var f=a.pop();if(!f.parent||this.isDamaged(f,c,b)){f instanceof this.BeginEndNode&&(d=
f);for(var e=0;e<f.children.length;e++)a.push(f.children[e])}}return d||this._tree},isDamaged:function(c,b,a){return c.start<=a&&c.end>b},parse:function(c,b,a,d,f,e){var g=this.textView.getModel(),i=g.getLineStart(g.getLineCount()-1),k=g.getCharCount(),n=this.getInitialExpected(c,a),p=-1;if(b)c.repaired=!0,c.endNeedsUpdate=!0,p=(p=c.children[c.children.length-1])?g.getLineEnd(g.getLineAtOffset(p.end+(f-e))):-1,d=g.getLineEnd(g.getLineAtOffset(d+e)),p=Math.max(p,d);for(var p=p===-1?k:p,d=n,s=c,q=!1,
r=a,t=-1;s&&(!b||r<p);){var l=this.getNextMatch(g,s,r);l||(r=r>=i?k:g.getLineStart(g.getLineAtOffset(r)+1));var u=l&&l.match,y=l&&l.rule,w=l&&l.isEnd;if(l&&l.isSub){if(r=this.afterMatch(u),y instanceof this.BeginEndRule)q=!0,b&&y===d.rule&&s===d.parent?(s=d,s.setStart(u),s.repaired=!0,s.endNeedsUpdate=!0,d=this.getNextExpected(d,"begin")):(b&&(this.prune(s,d),b=!1),u=new this.BeginEndNode(s,y,u),s.addChild(u),s=u)}else if(w||r===k){if(s instanceof this.BeginEndNode)u?(q=!0,t=Math.max(t,s.end),s.setEnd(u),
r=this.afterMatch(u),b&&s===d&&s.parent===d.parent?(s.repaired=!0,delete s.endNeedsUpdate,d=this.getNextExpected(d,"end")):b&&(this.prune(s,d),b=!1)):(s.setEnd(k),delete s.endNeedsUpdate);s=s.parent}b&&r>=p&&!q&&(this.prune(c,n),b=!1)}this.removeUnrepairedChildren(c,b,a);this.cleanup(b,c,a,p,k,f,e);return b?Math.max(t,r):r},removeUnrepairedChildren:function(c,b,a){if(b){for(var b=c.children,d=-1,f=0;f<b.length;f++){var e=b[f];if(!e.repaired&&this.isDamaged(e,a,Number.MAX_VALUE)){d=f;break}}if(d!==
-1)c.children.length=d}},cleanup:function(c,b,a,d,f,e,g){if(c){c=e-g;f=this.getIntersecting(d-c+1,f);b=this.getIntersecting(a,d);for(a=0;a<f.length;a++)d=f[a],!d.repaired&&d instanceof this.BeginEndNode&&(d.shiftEnd(c),d.shiftStart(c));for(a=0;a<b.length;a++)d=b[a],d.repaired&&d.endNeedsUpdate&&d.shiftEnd(c),delete d.endNeedsUpdate,delete d.repaired}else{b=this.getIntersecting(a,d);for(a=0;a<b.length;a++)delete b[a].repaired}},getNextMatch:function(c,b,a,d){var f=c.getLineAtOffset(a),f=c.getLineEnd(f),
e=c.getText(a,f),g=[],i=[],c=[],f=[];for(this.push(g,b.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||!d||k.matchRegex){var n=k&&this.exec(k.matchRegex||k.beginRegex,e,a);n&&(c.push(n),f.push(k))}}g=Number.MAX_VALUE;i=-1;for(k=0;k<c.length;k++)if(n=c[k],n.index<g)g=n.index,i=k;if(!d&&(a=this.getEndMatch(b,e,a)))if(d=b.rule.applyEndPatternLast,i===-1||a.index<g||
!d&&a.index===g)return{isEnd:!0,rule:b.rule,match:a};return i===-1?null:{isSub:!0,rule:f[i],match:c[i]}},getInitialExpected:function(c,b){var a,d;if(c===this._tree)for(a=0;a<c.children.length;a++){if(d=c.children[a],d.start>=b)return d}else if(c instanceof this.BeginEndNode&&c.endMatch){var f=c.endMatch.index;for(a=0;a<c.children.length;a++)if(d=c.children[a],d.start>=b)break;if(d&&d.start<f)return d}return c},getNextExpected:function(c,b){if(b==="begin"){var a=c.children[0];return a?a:c}else if(b===
"end"&&(a=c.parent)){var d=a.children[a.children.indexOf(c)+1];return d?d:a}return null},prune:function(c,b){if(b.parent===c)c.children.length=b.getIndexInParent();else if(c instanceof this.BeginEndNode)c.endMatch=null,c.end=null;if(c.parent)c.parent.children.length=c.getIndexInParent()+1},onLineStyle:function(c){this._tree||this.initialParse();var b=c.lineStart,a=this.textView.getModel(),d=a.getLineEnd(c.lineIndex),f=a.getLineEnd(a.getLineAtOffset(b)-1),f=this.getFirstDamaged(f,f),b=this.getLineScope(a,
f,b,d);c.ranges=this.toStyleRanges(b);c.ranges.sort(function(a,b){return a.start-b.start})},getLineScope:function(c,b,a,d){for(var f=a,e=this.getInitialExpected(b,a),g=[],i=[];b&&f<d;){var k=this.getNextMatch(c,b,f);if(!k)break;var n=k&&k.match,p=k&&k.rule,s=k&&k.isSub,k=k&&k.isEnd;n.index!==f&&i.push({start:f,end:n.index,node:b});if(s)f=this.afterMatch(n),p instanceof this.BeginEndRule?(this.addBeginScope(g,n,p),b=e,e=this.getNextExpected(e,"begin")):this.addMatchScope(g,n,p);else if(k)f=this.afterMatch(n),
this.addEndScope(g,n,p),e=this.getNextExpected(e,"end"),b=b.parent}f<d&&i.push({start:f,end:d,node:b});c=this.getInheritedLineScope(i,a,d);return g.concat(c)},getInheritedLineScope:function(c){for(var b=[],a=0;a<c.length;a++)for(var d=c[a],f=d.node;f;){var e=f.rule.rule,g=e.name;if(e=e.contentName||g){this.addScopeRange(b,d.start,d.end,e);break}f=f.parent}return b},addBeginScope:function(c,b,a){var d=a.rule;this.addCapturesScope(c,b,d.beginCaptures||d.captures,a.isComplex,a.beginOld2New,a.beginConsuming)},
addEndScope:function(c,b,a){var d=a.rule;this.addCapturesScope(c,b,d.endCaptures||d.captures,a.isComplex,a.endOld2New,a.endConsuming)},addMatchScope:function(c,b,a){var d=a.rule,f=d.name;(d=d.captures)?this.addCapturesScope(c,b,d,a.isComplex,a.matchOld2New,a.matchConsuming):this.addScope(c,b,f)},addScope:function(c,b,a){a&&c.push({start:b.index,end:this.afterMatch(b),scope:a})},addScopeRange:function(c,b,a,d){d&&c.push({start:b,end:a,scope:d})},addCapturesScope:function(c,b,a,d,f,e){if(a)if(d){for(var d=
{1:0},g=0,i=1;b[i]!==void 0;i++)e[i]!==void 0&&(g+=b[i].length),b[i+1]!==void 0&&(d[i+1]=g);e=b.index;for(g=1;a[g];g++){var i=a[g].name,k=f[g],n=e+d[k];typeof b[k]!=="undefined"&&this.addScopeRange(c,n,n+b[k].length,i)}}else this.addScope(c,b,a[0]&&a[0].name)},getIntersecting:function(c,b){for(var a=[],d=this._tree?[this._tree]:[];d.length;){var f=d.pop(),e=!1;f instanceof this.ContainerNode?e=!0:this.isDamaged(f,c,b)&&(e=!0,a.push(f));if(e)for(var e=f.children.length,g=0;g<e;g++)d.push(f.children[g])}return a.reverse()},
toStyleRanges:function(c){for(var b=[],a=0;a<c.length;a++){var d=c[a],f=this._styles[d.scope];if(!f)throw Error("styles not found for "+d.scope);f=f.join(" ");b.push({start:d.start,end:d.end,style:{styleClass:f}})}return b}};return{RegexUtil:d,TextMateStyler:g}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(i,k){function g(a){return a.getProperty("objectClass").indexOf(c)!==-1&&a.getProperty("type")==="highlighter"}function d(a,b,c){this.initialize(a,b,c);this.lineStyles=[]}var c="orion.edit.highlighter",b=c+" service must be an event emitter";k.AnnotationType.registerType("orion.annotation.highlightError",{title:i.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}});
d.prototype={initialize:function(a,b,d){this.textView=a;this.serviceRegistry=b;this.annotationModel=d;this.services=[];var e=this;this.listener={onModelChanging:function(a){e.onModelChanging(a)},onModelChanged:function(a){e.onModelChanged(a)},onDestroy:function(a){e.onDestroy(a)},onLineStyle:function(a){e.onLineStyle(a)},onStyleReady:function(a){e.onStyleReady(a)},onServiceAdded:function(a){e.onServiceAdded(a.serviceReference,e.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){e.onServiceRemoved(a.serviceReference,
e.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);b.addEventListener("registered",this.listener.onServiceAdded);b.addEventListener("unregistering",this.listener.onServiceRemoved);a=b.getServiceReferences(c);for(d=0;d<a.length;d++){var i=a[d];g(i)&&this.addServiceListener(b.getService(i))}},
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 b=this.startLine;(a.addedLineCount||a.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[b,a.removedLineCount].concat(this._getEmptyStyle(a.addedLineCount)))},
onStyleReady:function(a){var b=a.lineStyles||a.style,a=Number.MAX_VALUE,c=-1,d=this.textView.getModel(),g;for(g in b)b.hasOwnProperty(g)&&(this.lineStyles[g]=b[g],a=Math.min(a,g),c=Math.max(c,g));a=Math.max(a,0);c=Math.min(c,d.getLineCount());if(b=this.annotationModel){for(var i=b.getAnnotations(d.getLineStart(a),d.getLineEnd(c)),o=[];i.hasNext();){var n=i.next();n.type==="orion.annotation.highlightError"&&o.push(n)}i=[];for(n=a;n<=c;n++){g=n;var p=this.lineStyles[g],p=p&&p.errors;g=d.getLineStart(g);
if(p)for(var s=0;s<p.length;s++){var q=p[s];i.push(k.AnnotationType.createAnnotation("orion.annotation.highlightError",q.start+g,q.end+g))}}b.replaceAnnotations(o,i)}this.textView.redrawLines(a,c+1)},onLineStyle:function(a){function b(a,c){for(var d=a.length,f=[],g=0;g<d;g++){var h=a[g];f.push({start:h.start+c,end:h.end+c,style:h.style})}return f}var c=this.lineStyles[a.lineIndex];if(c)if(c.ranges)a.ranges=b(c.ranges,a.lineStart);else if(c.style)a.style=c.style},_getEmptyStyle:function(a){for(var b=
[],c=0;c<a;c++)b.push(null);return b},setContentType:function(a){this.contentType=a;if(this.services)for(a=0;a<this.services.length;a++){var b=this.services[a];if(b.setContentType){var c=this.serviceRegistry.getService("orion.page.progress");c?c.progress(b.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):b.setContentType(this.contentType)}}},onServiceAdded:function(a,b){g(a)&&this.addServiceListener(b)},onServiceRemoved:function(a,
b){this.services.indexOf(b)!==-1&&this.removeServiceListener(b)},addServiceListener:function(a){if(typeof a.addEventListener==="function"){if(a.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(a),a.setContentType&&this.contentType){var c=this.serviceRegistry.getService("orion.page.progress");c?c.progress(a.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):a.setContentType(this.contentType)}}else typeof console!==
"undefined"&&console.log(Error(b))},removeServiceListener:function(a){typeof a.removeEventListener==="function"?(a.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),a=this.services.indexOf(a),a!==-1&&this.services.splice(a,1)):typeof console!=="undefined"&&console.log(Error(b))}};return d});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(i,k,g,d){function c(a,b,c,e,j,m,o){function n(a,e){var g=a.getProperty("contentType"),i=a.getProperty("fileTypes");if(g)return b.isSomeExtensionOf(c,g).then(function(b){return b?a:null});else if(e&&i&&i.indexOf(e)!==-1)return g=new d,g.resolve(a),g;return null}var p=function(a){var b=null;switch(a&&a.id){case "application/javascript":case "application/json":b=
new i.TextStyler(e,"js",j);break;case "text/x-java-source":b=new i.TextStyler(e,"java",j);break;case "text/css":b=new i.TextStyler(e,"css",j)}return b}(c);if(p)return m=new d,m.resolve(p),m;for(var p=m&&m.split(".").pop().toLowerCase(),m=a.getServiceReferences("orion.edit.highlighter"),s=[],q=[],r=0;r<m.length;r++){var t=m[r];t.getProperty("type")==="grammar"&&s.push(t.getProperty("grammar"));(t=n(t,p))&&q.push(t)}return d.all(q,function(a){return{_error:a}}).then(function(b){for(var d,h=b.length-
1;h>=0;h--){var i=b[h];if(i&&!i._error&&(o||i.getProperty("type")!=="highlighter")){d=i;break}}var m;if(d)if(b=d.getProperty("type"),b==="highlighter")m=new g(e,a,j),m.setContentType(c);else if(b==="grammar"||typeof b==="undefined")d=d.getProperty("grammar"),m=new k.TextMateStyler(e,d,s);return m})}function b(a){this.serviceRegistry=a;this.styler=null}b.prototype={setup:function(a,b,d,e,g){g=typeof g==="undefined"?!0:g;if(this.styler)this.styler.destroy&&this.styler.destroy(),this.styler=null;var i=
this;return c(this.serviceRegistry,this.serviceRegistry.getService("orion.core.contenttypes"),a,b,d,e,g).then(function(a){return i.styler=a})},getStyler:function(){return this.styler}};return{createStyler:c,SyntaxHighlighter:b}});
define("orion/searchAndReplace/textSearcher",["i18n!orion/search/nls/messages","orion/editor/find","orion/commands","orion/objects","orion/webui/littlelib"],function(i,k,g,d,c){function b(a,b,c,d){k.Find.call(this,a,c,d);this._commandService=b}b.prototype=new k.Find;d.mixin(b.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 b=a.findString,a=a.replaceString,c=document.getElementById("localSearchFindWith");c||(this._createActionTable(),c=document.getElementById("localSearchFindWith"));if(b)c.value=b;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(b){var c=document.createElement("input");c.type="text";c.name=i["Find:"];c.className="parameterInput";c.id="localSearchFindWith";c.placeholder=i["Find With"];c.oninput=function(b){return a._handleInput(b)};c.onkeydown=function(b){return a._handleKeyDown(b)};b.appendChild(c);a._createButton("Next",b,function(){a.find(!0)});a._createButton("Previous",b,function(){a.find(!1)});
var d=a._editor.getTextView().getOptions("readonly");if(!d){var j=document.createElement("input");j.type="text";j.name=i["ReplaceWith:"];j.className="parameterInput";j.id="localSearchReplaceWith";j.placeholder=i["Replace With"];j.onkeydown=function(b){return a._handleKeyDown(b)};b.appendChild(j);a._createButton(i.Replace,b,function(){a.replace()});a._createButton(i["Replace All"],b,function(){a.replaceAll()})}j=document.createElement("div");b.appendChild(j);j.classList.add("findOptionsDiv");var k=
g.createDropdownMenu(j,i.Options,null,"dismissButton",null,!0);k.menuButton.classList.add("parameterInlineButton");g.createCheckedMenuItem(k.menu,i["Show all"],a._showAll,function(b){a.setOptions({showAll:b.target.checked});k.dropdown.close(!0)});g.createCheckedMenuItem(k.menu,i["Case sensitive"],!a._caseInsensitive,function(b){a.setOptions({caseInsensitive:!b.target.checked});k.dropdown.close(!0);a.find(!0)});g.createCheckedMenuItem(k.menu,i["Wrap search"],a._wrap,function(b){a.setOptions({wrap:b.target.checked});
k.dropdown.close(!0)});g.createCheckedMenuItem(k.menu,i["Incremental search"],a._incremental,function(b){a.setOptions({incremental:b.target.checked});k.dropdown.close(!0)});g.createCheckedMenuItem(k.menu,i["Whole Word"],a._wholeWord,function(b){a.setOptions({wholeWord:b.target.checked});k.dropdown.close(!0);a.find(!0)});g.createCheckedMenuItem(k.menu,i["Regular expression"],a._regex,function(b){a.setOptions({regex:b.target.checked});k.dropdown.close(!0);a.find(!0)});d||g.createCheckedMenuItem(k.menu,
i["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,b,d){var e=document.createElement("button");e.addEventListener("click",d.bind(this),!1);var g=this;e.addEventListener("keydown",function(a){a.keyCode===c.KEY.ESCAPE&&g.hide()});e.appendChild(document.createTextNode(a));e.className="dismissButton parameterInlineButton";b.appendChild(e)},_handleInput:function(){this._incremental&&
this.find(!0,null,!0);return!0},_handleKeyDown:function(a){var b=(this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&!a.shiftKey;if(b&&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(b&&a.keyCode===82)return a.stopPropagation&&a.stopPropagation(),
a.cancelBubble=!0,this.replace(),!1;return a.keyCode===27?(this.hide(),!1):!0}});return{TextSearcher:b}});
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(i,k){var g={root:k};Object.keys(i).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=i[d])});return g});
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(i,k,g,d,c,b,a,h,f,e,j,m,o,n,p,s,q){function r(a,b,c,d,e,f,g,h,i,j){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=i;this.editorSettings=j}var e={},t=null;r.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(b){this.commandService.addCommand(new a.Command({name:i.Undo,
id:"orion.undo",callback:function(){b.getTextView().invokeAction("undo")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.undo",400,null,!0,b.getTextView().getKeyBindings("undo")[0]);this.commandService.addCommand(new a.Command({name:i.Redo,id:"orion.redo",callback:function(){b.getTextView().invokeAction("redo")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.redo",401,null,!0,b.getTextView().getKeyBindings("redo")[0])},_generateSearchFilesCommand:function(b){var c=
this;if(c._searcher){var e=!1,f=new a.Command({name:i["Search Files"],tooltip:i["Search Files"],id:"orion.searchFiles",callback:function(){b.getTextView().invokeAction("searchFiles")}});this.commandService.addCommand(f);this.commandService.registerCommandContribution(this.pageNavId,"orion.searchFiles",1,null,!0,new h.KeyBinding("h",!0));b.getTextView().setKeyBinding(new h.KeyBinding("h",!0),"searchFiles");b.getTextView().setAction("searchFiles",function(){if(!e){var a=b.getSelection(),a=b.getText(a.start,
a.end),f=c.serviceRegistry,h=f.getService("orion.page.progress"),f=f.getService("orion.core.favorite"),j=new d.OpenResourceDialog({searcher:c._searcher,progress:h,favoriteService:f,searchRenderer:c._searcher.defaultRenderer,nameSearch:!1,title:i["Search Files"],message:i["Enter search term:"],initialText:a,onHide:function(){e=!1;b&&b.getTextView()&&b.getTextView().focus()}});window.setTimeout(function(){e=!0;j.show(g.node(c.toolbarId))},0);return!0}},f)}},_generateSaveCommand:function(b){var c=this;
b.getTextView().setKeyBinding(new h.KeyBinding("s",!0),"save");b.getTextView().setAction("save",function(){if(c.inputManager.save)c.inputManager.save();else if(c.inputManager.onSave){var a=b.getText();c.inputManager.onSave(c.inputManager.getInput(),a,function(){b.setInput(c.inputManager.getInput(),null,a,!0);c.inputManager.afterSave&&c.inputManager.afterSave()},function(a){a.log=!0})}return!0},{name:i.Save});this.commandService.addCommand(new a.Command({name:i.Save,tooltip:i["Save this file"],id:"orion.save",
visibleWhen:function(){return!c.editorSettings||!c.editorSettings().autoSaveEnabled},callback:function(){b.getTextView().invokeAction("save")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.save",1,null,!1,new h.KeyBinding("s",!0))},_generateGotoLineCommnand:function(b){var c=this,d=new f.ParametersDescription([new f.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var a=b.getModel().getLineAtOffset(b.getCaretOffset())+1;return[new f.CommandParameter("line",
"number","Line:",a.toString())]}),d=new a.Command({name:i["Go to Line"],tooltip:i["Go to specified line number"],id:"orion.gotoLine",parameters:d,callback:function(a){var c=b.getModel();a.parameters&&a.parameters.valueFor("line")?a=a.parameters.valueFor("line"):(a=c.getLineAtOffset(b.getCaretOffset()),(a=prompt(i["Go to line:"],a+1))&&(a=parseInt(a,10)));if(a)b.onGotoLine(a-1,0)}});this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.pageNavId,"orion.gotoLine",1,
null,!0,new h.KeyBinding("l",!q.isMac,!1,!1,q.isMac),new f.URLBinding("gotoLine","line"));b.getTextView().setAction("gotoLine",function(a){if(a)return b.onGotoLine(a.line-1,0,void 0,a.callback),!0;c.commandService.runCommand("orion.gotoLine");return!0},d)},_generateFindCommnand:function(b){var c=this,d=new f.ParametersDescription([new f.CommandParameter("find","text","Find:")],{clientCollect:!0},function(){var a=b.getSelection(),c="";a.end>a.start&&(c=b.getModel().getText(a.start,a.end));return[new f.CommandParameter("find",
"text","Find:",c)]}),d=new a.Command({name:i.Find,tooltip:i.Find,id:"orion.editor.find",parameters:d,callback:function(a){if(c._localSearcher){var d="",e=null,f=b.getSelection();f.end>f.start?d=b.getModel().getText(f.start,f.end):a.parameters&&a.parameters.valueFor("find")&&(d=a.parameters.valueFor("find"),e=p.matchResourceParameters(),n.convertFindURLBinding(e));if(e){a={regex:e.regEx,caseInsensitive:!e.caseSensitive};if(e.atLine)a.start=b.getModel().getLineStart(e.atLine-1);c._localSearcher.show({findString:d,
replaceString:e.replaceWith});c._localSearcher.find(!0,a)}else c._localSearcher.show({findString:d});return!0}return!1}});this.commandService.addCommand(d);this.commandService.registerCommandContribution(this.pageNavId,"orion.editor.find",2,null,!0,new h.KeyBinding("f",!0),new f.URLBinding("find","find"));b.getTextView().setAction("find",function(a){if(a)return c._localSearcher.show(a),!0;c.commandService.runCommand("orion.editor.find");return!0},d)},_generateEditCommands:function(d){function e(a){var b=
new h.KeyBinding;h.KeyBinding.apply(b,a);return b}function f(a,b){!b&&a&&typeof a.HTML!=="undefined"&&delete a.HTML;var c=n.serviceRegistry.getService("orion.page.message");c?c.setProgressResult(a):window.console.log(a)}var n=this,o=this.serviceRegistry.getServiceReferences("orion.edit.command"),p=this.inputManager,q=this.serviceRegistry.getService("orion.page.progress"),r=function(c,e,g){g.callback=function(){d=this;var a=d.getSelection(),g=d.getModel(),h=g.getText(),j=function(b){b&&b.text?(d.setText(b.text),
b.selection&&(d.setSelection(b.selection.start,b.selection.end),d.getTextView().focus())):typeof b==="string"&&(d.setText(b,a.start,a.end),d.setSelection(a.start,a.start+b.length),d.getTextView().focus())};q.showWhile(e.run(g.getText(a.start,a.end),h,a,p.getInput()),k.formatMessage(i["Running {0}"],c.name)).then(function(a){if(a&&a.uriTemplate){var d=new b(a.uriTemplate),e=p.getFileMetadata();e.OrionHome=e.OrionHome||s.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(a.width)g.style.width=a.width;if(a.height)g.style.height=a.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 F(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)j(a.result);else if(a.Status||a.status)f(a.Status||a.status);window.removeEventListener("message",F,!1);window.document.body.removeChild(g)}},!1)}else a.Status||a.status?f(a.Status||a.status):j(a)});return!0};g.callback=g.callback.bind(d);return new a.Command(g)};c.when(function(a){if(t)return t;var b=a.getService("orion.core.contenttypes");b||(b=new m.ContentTypeService(a),
b=a.getService("orion.core.contenttypes"));return b.getContentTypes().then(function(a){return t=a})}(this.serviceRegistry),function(){var a=[],b=100;o.forEach(function(c){for(var f=n.serviceRegistry.getService(c),g={},h=c.getPropertyKeys(),i=0;i<h.length;i++)g[h[i]]=c.getProperty(h[i]);g.forceSingleItem=!0;c=j._createCommandOptions(g,c,n.serviceRegistry,t,!1,function(){return p.getFileMetadata()});a.push(c);c.then(function(a){a=r(g,f,a);n.commandService.addCommand(a);n.commandService.registerCommandContribution(n.toolbarId,
a.id,b);if(g.key){var c=d.getTextView();c.setKeyBinding(e(g.key),a.id);c.setAction(a.id,a.callback,a)}});b++});c.all(a,function(a){return{_error:a}}).then(function(){var a;if(a=p.getFileMetadata()){var b=g.node("pageActions");b&&(n.commandService.destroy(b),n.commandService.renderCommands(b.id,b,a,d,"button"));if(b=g.node("pageNavigationActions"))n.commandService.destroy(b),n.commandService.renderCommands(b.id,b,d,d,"button")}})})}};e.EditorCommandFactory=r;return e});
define("orion/edit/dispatcher",["orion/edit/dispatcher"],function(){function i(i,g,d){this.serviceRegistry=i;this.editor=g;this.contentType=d;this.contentTypeService=i.getService("orion.core.contenttypes");this.serviceReferences={};var c=this;this.listener={onServiceAdded:function(b){c._onServiceAdded(b.serviceReference)},onServiceRemoved:function(b){c._onServiceRemoved(b.serviceReference)}};this.serviceRegistry.addEventListener("registered",this.listener.onServiceAdded);this.serviceRegistry.addEventListener("unregistering",
this.listener.onServiceRemoved);this._init()}i.prototype={_init:function(){var i=this;this.editor.getTextView()?this._wire(this.serviceRegistry):this.editor.addEventListener("TextViewInstalled",function(){i._wire(i.serviceRegistry)})},_wire:function(i){for(var i=i.getServiceReferences("orion.edit.model"),g=0;g<i.length;g++)this._wireServiceReference(i[g])},_wireServiceReference:function(i){var g=i.getProperty("contentType");if(typeof g!==void 0&&g!==null){var d=this;this.contentTypeService.isSomeExtensionOf(this.contentType,
g).then(function(c){c&&d._wireService(i,d.serviceRegistry.getService(i))})}},_wireService:function(i,g){var d=i.getProperty("types"),c=this.editor.getTextView();if(d){for(var b=0;b<d.length;b++){var a=d[b],h=g["on"+a];h&&this._wireServiceMethod(i,g,h,c,a)}this._initService(g,c)}},_wireServiceMethod:function(i,g,d,c,b){g=function(a){d(a).then()};i=i.getProperty("service.id");this.serviceReferences[i]=this.serviceReferences[i]||[];this.serviceReferences[i].push([c,b,g]);c.addEventListener(b,g)},_onServiceRemoved:function(i){var i=
i.getProperty("service.id"),g=this.serviceReferences[i];if(g){for(var d=0;d<g.length;d++){var c=g[d];c[0].removeEventListener(c[1],c[2])}delete this.serviceReferences[i]}},_onServiceAdded:function(i){i.getProperty("objectClass").indexOf("orion.edit.model")!==-1&&this._wireServiceReference(i)},_initService:function(i,g){var d=i.onModelChanging;if(typeof d==="function"){var c=g.getModel(),b=c.getText(),c={type:"Changing",text:b,start:0,removedCharCount:0,addedCharCount:b.length,removedLineCount:0,addedLineCount:c.getLineCount()};
d.call(i,c)}}};return{Dispatcher:i}});
define("orion/edit/syntaxmodel",["orion/serviceTracker"],function(i){function k(b){return(b=b.getProperty("contentType"))?Array.isArray(b)?b:[b]:null}function g(b){var a=this.contentTypesMap={},g=new i(b,d),f=new i(b,c),e=this.notifySyntaxModelListeners.bind(this);g.addingService=function(c){var d=b.getService(c);(c=k(c))&&c.forEach(function(b){var c=a[b];c?c.push(d):a[b]=[d]})};g.removedService=function(b,c){var d=k(b);d&&d.forEach(function(b){var b=a.hasOwnProperty(b.id)?a[b.id]:null,d=b.indexOf(c);
d!==-1&&b.splice(d,1)})};f.addingService=function(a){var d=b.getService(a);k(a)&&(typeof d.addEventListener!=="function"?console.log(Error("A "+c+' service must provide an "addEventListener" method')):d.addEventListener("orion.edit.syntaxmodel.modelReady",e))};f.removedService=function(a,b){b&&typeof b.removeEventListener==="function"&&b.removeEventListener("orion.edit.syntaxmodel.modelReady",e)};g.open();f.open()}var d="orion.edit.syntaxmodel.listener",c="orion.edit.syntaxmodel.provider";g.prototype.notifySyntaxModelListeners=
function(b){var a=b.contentType,c=b.syntaxModel;typeof a!=="string"?console.log(Error('SyntaxModelReadyEvent must provide a "contentType" field')):(b=this.contentTypesMap.hasOwnProperty(a)?this.contentTypesMap[a]:null)&&b.forEach(function(a){a.setSyntaxModel(c)})};return g});
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(i,k,g,d,c,b,a,h,f,e){function j(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);d.attach(this)}function m(a,b){if(a){if(b.status===0)b={Severity:"Error",Message:i["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 o(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 h.SyntaxHighlighter(this.serviceRegistry);this.syntaxModelWirer=new f(this.serviceRegistry);this._input=this._title="";this.dispatcher=null;d.attach(this)}j.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()}};c.mixin(o.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(i["Reading metedata of"],a)).then(function(e){if(this._fileMetadata.ETag!==e.ETag)this._fileMetadata=e,(!d.isDirty()||window.confirm(i.loadOutOfSync))&&c.progress(b.read(a),k.formatMessage(i.Reading,a)).then(function(b){d.setInput(a,
null,b)})}.bind(this));else{var e=window.setTimeout(function(){d.reportStatus(k.formatMessage(i.Fetching,a))},800);(new g.all([c.progress(b.read(a),k.formatMessage(i.Reading,a)),c.progress(b.read(a,!0),k.formatMessage(i["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");m(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){j.getFileMetadata().ETag=
b.ETag;c.setInput(d,null,e,!0);c.reportStatus("");j.afterSave&&j.afterSave();j._saving=!1}function b(a){c.reportStatus("");m(h,a);j._saving=!1;j._errorSaving=!0}if(!this._saving){var c=this.getEditor();if(c.isDirty()){this._saving=!0;this._errorSaving=!1;var d=this.getInput();c.reportStatus(i["Saving..."]);var e=c.getText(),f={ETag:this.getFileMetadata().ETag},f=this.fileClient.write(d,e,f),g=this.progressService,h=this.serviceRegistry.getService("orion.page.message");g&&(f=g.progress(f,k.formatMessage(i["Saving file {0}"],
d)));var j=this;f.then(a,function(c){c.status===412?window.confirm(i["Resource is out of sync with the server. Do you want to save it anyway?"])?(c=j.fileClient.write(d,e),g&&(c=g.progress(c,k.formatMessage(i["Saving file {0}"],d))),c.then(a,b)):j._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 j(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(a){b.setDirtyIndicator(a)},setInput:function(a){if(!this._ignoreInput){if(!a)a=window.location.hash;if(typeof a==="string"){var b=this.getEditor();a&&a[0]!=="#"&&(a="#"+a);var c=e.matchResourceParameters(a);
if(b.isDirty()&&(b=this._location,e.matchResourceParameters(b).resource!==c.resource))if(this._autoSaveEnabled)this.save();else if(!window.confirm(i["There are unsaved changes.  Do you still want to navigate away?"])){window.location.hash=b;return}this._location=a;this._parsedLocation=c;this._ignoreInput=!0;this.selection.setSelections(a);this._ignoreInput=!1;(a=c.resource)?a===this._input?this.processParameters(c):(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(b,c,d,e){var f;e?(this._fileMetadata=e,this.setTitle(e.Location||String(e)),this._contentType=this.contentTypeService.getFileContentType(e),f=e.Name):(this._fileMetadata=null,this.setTitle(c),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:b,name:f,metadata:e,contents:d});var h=this;this.syntaxHighlighter.setup(this._contentType,g.getTextView(),g.getAnnotationModel(),c,!0).then(function(){var e=h.syntaxHighlighter.getStyler();g.setFoldingEnabled(e&&e.foldingEnabled);h.dispatchEvent({type:"ContentTypeChanged",contentType:h._contentType,
location:window.location});if(!h.dispatcher)h.dispatcher=new a.Dispatcher(h.serviceRegistry,g,h._contentType);g.setInput(c,null,d);h.processParameters(b)});this.setDirty(!1)},setTitle:function(a){var b=a.lastIndexOf("/");b!==-1&&(a=a.substring(b+1));this._title=a}});return{InputManager:o}});
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(i,k,g,d,c,b,a,h,f,e,j,m,o,n,p,s,q){function r(a){this._syntaxHighlither=
new h.SyntaxHighlighter(a)}k={};k.DefaultDiffProvider=function(){function a(c){this.serviceRegistry=c;this._diffProvider=new b.DiffProvider(c)}a.prototype={_resolveTwoFiles:function(a,b){var c=this;return g.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 g).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 g).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 a}();r.prototype={highlight:function(a,b,c){return this._syntaxHighlither.setup(b,c.getTextView(),null,a,!1)}};
k.ResourceComparer=function(){function b(c,g,h,j){this._registry=c;this._commandService=g;this._fileClient=new f.FileClient(c);this._fileClient=new f.FileClient(c);this._searchService=this._registry.getService("orion.core.search");this._progress=this._registry.getService("orion.page.progress");this.setOptions(h,!0);this._compareView=h.toggleable?new a.toggleableCompareView(h.type==="inline"?"inline":"twoWay",j):h.type==="inline"?new a.inlineCompareView(j):new a.TwoWayCompareView(j);this._compareView.getWidget().setOptions({extCmdHolder:this});
j.highlighters||this._compareView.getWidget().setOptions({highlighters:[new r(c),new r(c)]});j.oldFile||this._compareView.getWidget().setOptions({oldFile:{readonly:!0}});j.newFile||this._compareView.getWidget().setOptions({newFile:{readonly:h.readonly}});this.initExtCmds();var k=this;this._inputManager=new s.InputManager({serviceRegistry:c,fileClient:k._fileClient,progressService:k._progress});p.mixin(this._inputManager,{filePath:"",getInput:function(){return this.filePath},setDirty:function(a){e.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=d.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,b){var d;if(b)d=b.Name;e.setPageTarget({task:i.Compare,name:d,target:b,serviceRegistry:c,commandService:k._commandService,searchService:k._searchService,fileService:k._fileClient});a.charAt(0)==="*"?(e.setDirtyIndicator(!0),a.substring(1)):e.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(!h.readonly&&!h.toggleable&&this._compareView.getWidget().type==="twoWay")this._compareView.getWidget().options.newFile.keyBindingFactory=function(a,b,c,d){b=new o.TextSearcher(a,k._commandService,c);(new n.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(i["fetching..."]);if(!h.readonly&&!h.toggleable&&this._compareView.getWidget().type==="twoWay"){var m=this._compareView.getWidget().getEditors();m[1].addEventListener("DirtyChanged",function(){this._inputManager.setDirty(m[1].isDirty())}.bind(this))}}b.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=c.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(i["Copy the link URL:"],a)},openComparePage:function(a){a=a.getCurrentDiffPos();return c.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 j.Command({tooltip:i["Generate link of the current diff"],name:i["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 j.Command({tooltip:i["Open the compare page"],name:i.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 m.KeyBinding("l",!0,!0))}},_getFilesContents:function(a){var b=[];a.forEach(function(a){b.push(this._loadSingleFile(a))}.bind(this));return g.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 g).resolve(b)}.bind(a))})}else console.log("A diff provider is needed for Complex diff URL")}};return b}();return k});
define("orion/widgets/themes/editor/ThemeData",["orion/editor/textTheme"],function(i){function k(){}function g(){this.styles=[];var a=new k;a.name="Eclipse";a.annotationRuler="white";a.background="white";a.comment="green";a.keyword="#7f0055";a.text="darkSlateGray";a.string="blue";a.overviewRuler="white";a.lineNumberOdd="#444";a.lineNumberEven="#444";a.lineNumber="#444";a.currentLine="#EAF2FE";a.tag="darkorange";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name=
"Prospecto";a.annotationRuler="white";a.background="white";a.comment="#3C802C";a.keyword="#CC4C07";a.text="#333";a.string="#446FBD";a.overviewRuler="white";a.lineNumberOdd="silver";a.lineNumberEven="silver";a.lineNumber="silver";a.currentLine="#EAF2FE";a.tag="#CC4C07";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name="Blue";a.annotationRuler="lavender";a.background="aliceBlue";a.comment="indigo";a.keyword="cornFlowerBlue";a.text="navy";a.string="cornFlowerBlue";
a.overviewRuler="lavender";a.lineNumberOdd="darkSlateGray";a.lineNumberEven="darkSlateGray";a.lineNumber="darkSlateGray";a.currentLine="white";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name="Ambience";a.annotationRuler="#3D3D3D";a.background="#202020";a.comment="mediumslateblue";a.keyword="cornFlowerBlue";a.text="darkseagreen";a.string="lightcoral";a.overviewRuler="white";a.lineNumberOdd="black";a.lineNumberEven="black";a.lineNumber="black";
a.currentLine="lightcyan";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name="Tierra";a.annotationRuler="moccasin";a.background="lemonchiffon";a.comment="darkseagreen";a.keyword="darkred";a.text="#555555";a.string="orangered";a.overviewRuler="moccasin";a.lineNumberOdd="chocolate";a.lineNumberEven="chocolate";a.lineNumber="chocolate";a.currentLine="#baa289";a.tag="darkred";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);
a=new k;a.name="Nimbus";a.annotationRuler="#444";a.background="dimgray";a.comment="darkseagreen";a.keyword="darkorange";a.text="white";a.string="cornflowerblue";a.overviewRuler="#444";a.lineNumberOdd="#aaa";a.lineNumberEven="#aaa";a.lineNumber="#aaa";a.currentLine="#aabfbb";a.tag="darkorange";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name="Adelante";a.annotationRuler="#E2D2B2";a.background="#F1E7C8";a.comment="#5D774E";a.keyword="#AF473B";a.text="dimgray";a.string=
"#DE5D3B";a.overviewRuler="#E2D2B2";a.lineNumberOdd="#AF473B";a.lineNumberEven="#AF473B";a.lineNumber="#AF473B";a.currentLine="#9e937b";a.tag="#AF473B";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a);a=new k;a.name="Raspberry Pi";a.annotationRuler="seashell";a.background="seashell";a.comment="#66B32F";a.keyword="#E73E36";a.text="dimgray";a.string="darkorange";a.overviewRuler="seashell";a.lineNumberOdd="#E73E36";a.lineNumberEven="#E73E36";a.lineNumber="#E73E36";a.currentLine=
"#F5B1AE";a.tag="#E73E36";a.attribute="cadetBlue";a.fontFamily=c;a.fontSize=b;this.styles.push(a)}function d(){return this.styles}var c='"Consolas", "Monaco", "Vera Mono", "monospace"',b="10pt";g.prototype.styles=[];g.prototype.getStyles=d;g.prototype.fontSettable=!0;g.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"editorstyles",defaultTheme:"Prospecto",selectedKey:"editorSelected"}};g.prototype.parseToXML=function(a){try{var b=null;if(window.DOMParser){var b=(new DOMParser).parseFromString(a,
"text/xml"),c=b.getElementsByTagName("parsererror");return!c||!c.length||!c[0].childNodes.length?b:null}else return b=new ActiveXObject("Microsoft.XMLDOM"),b.async=!1,b.loadXML(a),b}catch(d){}};g.prototype.selectFontSize=function(a){console.log("fontsize: "+a)};g.prototype.importTheme=function(a){console.log("import theme");console.log(a);var b=this.parseToXML(a.parameters.valueFor("name")),c=new k;c.name=b.getElementsByTagName("colorTheme")[0].attributes[1].value;c.annotationRuler=b.getElementsByTagName("background")[0].attributes[0].value;
c.background=b.getElementsByTagName("background")[0].attributes[0].value;c.comment=b.getElementsByTagName("singleLineComment")[0].attributes[0].value;c.keyword=b.getElementsByTagName("keyword")[0].attributes[0].value;c.text=b.getElementsByTagName("foreground")[0].attributes[0].value;c.string=b.getElementsByTagName("string")[0].attributes[0].value;c.overviewRuler=b.getElementsByTagName("background")[0].attributes[0].value;c.lineNumberOdd=b.getElementsByTagName("lineNumber")[0].attributes[0].value;
c.lineNumberEven=b.getElementsByTagName("lineNumber")[0].attributes[0].value;c.lineNumber=b.getElementsByTagName("lineNumber")[0].attributes[0].value;c.currentLine=b.getElementsByTagName("selectionBackground")[0].attributes[0].value;a.items.addTheme(c)};g.prototype.processSettings=function(a){var b=i.TextTheme.getTheme();b.setThemeClass("editorTheme",b.buildStyleSheet("editorTheme",a))};g.prototype.getViewData=function(){var a={top:10,left:10,width:400,height:350},b=a.left,c=a.top;a.shapes=[{type:"TEXT",
name:"Line Numbers",label:"1",x:b+20,y:c+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Background",x:b+46,y:c,width:290,height:a.height,family:"background",fill:"white"},{type:"TEXT",name:"Strings",label:"'text/javascript'",x:b+134,y:c+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"=",x:b+124,y:c+20,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Current Line",x:b+46,y:c+
87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:"HTML Attribute",label:"type",x:b+98,y:c+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Overview Ruler",x:b+336,y:c,width:14,height:a.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:"Comments",label:"/* comment */",x:b+75,y:c+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"<script",x:b+55,y:c+20,fill:"darkorange",family:"keyword",
font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:">",x:b+213,y:c+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Current Line",x:b+46,y:c+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:"Strings",label:"'Result'",x:b+164,y:c+80,fill:"cornflowerBlue",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"multiply(a,b){",x:b+120,y:c+60,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",
name:"keywords",label:"function",x:b+75,y:c+60,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Keywords",label:"var",x:b+95,y:c+80,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"output = ",x:b+115,y:c+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:";",x:b+205,y:c+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"keywords",label:"var",x:b+95,
y:c+100,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"result = a*b;",x:b+115,y:c+100,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"keywords",label:"return",x:b+95,y:c+120,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"output + result;",x:b+135,y:c+120,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"}",x:b+75,y:c+140,fill:"darkSlateGray",
family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"<\/script>",x:b+55,y:c+160,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"<style",x:b+55,y:c+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Attribute",label:"type",x:b+95,y:c+200,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"=",x:b+121,y:c+200,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},
{type:"TEXT",name:"Strings",label:"'text/css'",x:b+131,y:c+200,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:">",x:b+180,y:c+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Class Name",label:".some-class",x:b+75,y:c+220,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Class Name",label:"{",x:b+145,y:c+220,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Attribute",
label:"color:",x:b+95,y:c+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Value",label:"#123456",x:b+130,y:c+240,fill:"darkSlateGray",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Text",label:";",x:b+180,y:c+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Class Name",label:"}",x:b+75,y:c+260,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"</style>",x:b+55,y:c+280,
fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Annotation Ruler",x:b,y:c,width:46,height:a.height,family:"annotationRuler",fill:"white"}];for(var d=0;d<16;d++)a.shapes.push({type:"TEXT",name:"Line Numbers",label:d+1,x:b+20,y:c+20*d+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return a};return{ThemeData:g,getStyles:d}});
define('built-compare.js',"orion/browserCompatibility,orion/bootstrap,orion/status,orion/progress,orion/operationsClient,orion/commandRegistry,orion/fileClient,orion/searchClient,orion/globalCommands,orion/compare/compareCommands,orion/compare/resourceComparer,orion/widgets/themes/ThemePreferences,orion/widgets/themes/editor/ThemeData,orion/compare/compareUtils,orion/contentTypes,orion/PageUtil,i18n!orion/compare/nls/messages".split(","),function(i,k,g,d,c,b,a,h,f,e,j,m,o,n,p,s,q){k.startup().then(function(i){var k=
i.serviceRegistry,i=i.preferences,l=new b.CommandRegistry({}),n=new a.FileClient(k);new p.ContentTypeService(k);var n=new h.Searcher({serviceRegistry:k,commandService:l,fileService:n}),y=new c.OperationsClient(k);new g.StatusReportingService(k,y,"statusPane","notifications","notificationArea");new d.ProgressService(k,y,l);(new m.ThemePreferences(i,new o.ThemeData)).apply();f.generateBanner("orion-compare",k,l,i,n);f.setPageTarget({task:q.Compare,serviceRegistry:k,commandService:l});var w=new j.DefaultDiffProvider(k),
v=new e.CompareCommandFactory({commandService:l,commandSpanId:"pageNavigationActions"}),A=function(){var a=s.matchResourceParameters();(new j.ResourceComparer(k,l,{readonly:a.readonly==="true",generateLink:!0,savable:!a.readonly,hasConflicts:a.conflict==="true",diffProvider:w,resource:a.resource,compareTo:a.compareTo},{parentDivId:"compareContainer",commandProvider:v,showTitle:!0,showLineStatus:!0,blockNumber:typeof a.block==="undefined"?1:a.block,changeNumber:typeof a.change==="undefined"?0:a.change})).start()};
A();window.addEventListener("hashchange",function(){A()},!1)})});