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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 *		Mihai Sucan (Mozilla Foundation) - fix for Bug#334583 Bug#348471 Bug#349485 Bug#350595 Bug#360726 Bug#361180 Bug#362835 Bug#362428 Bug#362286 Bug#354270 Bug#361474 Bug#363945 Bug#366312 Bug#370584
 ******************************************************************************/

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

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

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

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

/*

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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:  IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

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

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

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

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - _initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 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
 RequireJS i18n 2.0.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/i18n for details

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation
*/
(function(){function j(b,a,f,h,g,c){a[b]&&(f.push(b),(a[b]===!0||a[b]===1)&&h.push(g+b+"/"+c))}function k(b,a,f,h,g){a=h+a+"/"+g;require._fileExists(b.toUrl(a+".js"))&&f.push(a)}function i(b,a,f){for(var h in a)a.hasOwnProperty(h)&&(!b.hasOwnProperty(h)||f)?b[h]=a[h]:typeof a[h]==="object"&&i(b[h],a[h],f)}var d=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(b){var a=b.config?b.config():{};return{version:"2.0.1+",load:function(b,h,g,c){c=c||{};if(c.locale)a.locale=c.locale;
var e=d.exec(b),l=e[1],n=e[4],p=e[5],o=n.split("-"),s=[],r={},q,t="";if(e[5])l=e[1],b=l+p;else{p=e[4];n=a.locale;if(!n)n=a.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();o=n.split("-")}if(c.isBuild){s.push(b);k(h,"root",s,l,p);for(q=0;q<o.length;q++)c=o[q],t+=(t?"-":"")+c,k(h,t,s,l,p);h(s,function(){g()})}else h([b],function(c){var e=[],a;j("root",c,e,s,l,p);for(q=0;q<o.length;q++)a=o[q],t+=(t?"-":"")+a,j(t,c,e,s,l,p);h(s,function(){var a,
b,f;for(a=e.length-1;a>-1&&e[a];a--){f=e[a];b=c[f];if(b===!0||b===1)b=h(l+f+"/"+p);i(r,b)}g(r)})})}}})})();
define("orion/i18n",[],function(){return{load:function(j,k,i,d){var d=d||{},b=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,a=b.exec(j);if(a)if(k.defined(j))i(k(j));else if(d.isBuild||d.isTest)i({});else{var f=a[1],h=a[3]?a[2]:"",g=a[3]||a[2];k(["orion/bootstrap"],function(c){c.startup().then(function(c){var l=c.serviceRegistry,c=l.getServiceReferences("orion.i18n.message");if(h)c.some(function(c){return j===c.getProperty("name")?(l.getService(c).getMessageBundle().then(function(c){i(c)},function(){i({})}),
!0):!1})||i({});else{var n={},p;c.forEach(function(c){var e=c.getProperty("name");if((a=b.exec(e))&&f===a[1]&&g===(a[3]||a[2]))if(h=a[3]?a[2]:""){if((c=d.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&c.toLowerCase().indexOf(h.toLowerCase())===0)n[h]=!0,k.specified(e)||define(e,["orion/i18n!"+e],function(c){return c})}else p=c});k.specified(j)?i(n):p?l.getService(p).getMessageBundle().then(function(c){Object.keys(n).forEach(function(e){typeof c[e]==="undefined"&&
(c[e]=n[e])});define(j,[],c);i(c)},function(){define(j,[],n);i(n)}):(define(j,[],n),i(n))}})})}else i(null)}}});
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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/browserCompatibility",[],function(){function j(){for(var b=navigator.userAgent,a={browser:!1,version:!1},f=[{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<f.length;h++){var g=f[h],c=b.match(g.regExp);if(c){a.browser=!0;a.version=c[1]>=g.minVersion;a.name=g.name;break}}return a}
function k(){try{return"localStorage"in window&&window.localStorage!==null}catch(b){return!1}}function i(b){alert(b);throw"unsupported browser";}var d=j();if(d.browser)d.version||i("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()||i("Sorry, your browser is not supported.\n\nTo use Orion, the latest version of the Chrome, Firefox, or Safari web browser is recommended.\n");return{isSupportedBrowser:j,supportsLocalStorage:k,throwBrowserAlert:i}});
(function(j,k){typeof define==="function"&&define.amd?define("orion/Deferred",k):typeof exports==="object"?module.exports=k():(j.orion=j.orion||{},j.orion.Deferred=k())})(this,function(){function j(){for(var c;c=f.shift()||h.shift();)c();g=!1}function k(c,e){(e?h:f).push(c);g||(g=!0,e?setTimeout(j,0):j())}function i(c){return function(){c.apply(null,arguments)}}function d(){}function b(){var c=Error("Cancel");c.name="Cancel";return c}function a(){function c(){for(var c;c=h.shift();){var a=c.deferred,
b=g==="resolved"?"resolve":"reject";if(typeof c[b]==="function")try{var f=c[b](e);f&&typeof f.then==="function"?(a.cancel=f.cancel||d,f.then(i(a.resolve),i(a.reject),a.progress)):a.resolve(f)}catch(p){a.reject(p)}else a[b](e)}}var e,g,h=[],f=this;this.reject=function(a){g||(g="rejected",e=a,h.length&&k(c));return f.promise};this.resolve=function(a){g||(g="resolved",e=a,h.length&&k(c));return f.promise};this.progress=function(c){g||h.forEach(function(e){e.progress&&e.progress(c)});return f.promise};
this.cancel=function(){g||f.reject(b())};this.then=function(e,b,d){var e={resolve:e,reject:b,progress:d,deferred:new a},i=e.deferred,j=!1,m=function(){j||(j=!0,k(function(){var c=i.cancel===m?f.cancel:i.cancel;typeof c==="function"&&c()},!0))};i.cancel=m;h.push(e);g&&k(c,!0);return i.promise};this.promise=Object.create(Object.prototype,{then:{value:f.then},cancel:{get:function(){return f.cancel},set:function(c){f.cancel=c}}})}var f=[],h=[],g=!1;a.all=function(c,e){function g(c,e){d||(f[c]=e,--h===
0&&i.resolve(f))}function b(c,a){if(!d){if(e)try{g(c,e(a));return}catch(m){a=m}i.reject(a)}}var h=c.length,f=[],d=!1,i=new a;i.then(null,function(){d=!0;c.forEach(function(c){c.cancel&&c.cancel()})});h===0?i.resolve(f):c.forEach(function(c,e){c.then(g.bind(null,e),b.bind(null,e))});return i.promise};a.when=function(c,e,g,b){var h;if(!(c&&typeof c.then==="function"))h=new a,h.resolve(c),c=h.promise;return c.then(e,g,b)};return a});
define("orion/EventTarget",[],function(){function j(){this._namedListeners={}}j.prototype={dispatchEvent:function(j){if(!j.type)throw Error("unspecified type");var i=this._namedListeners[j.type];i&&i.forEach(function(d){try{typeof d==="function"?d(j):d.handleEvent(j)}catch(b){typeof console!=="undefined"&&console.log(b)}});return!j.defaultPrevented},addEventListener:function(j,i){if(typeof i==="function"||i.handleEvent)this._namedListeners[j]=this._namedListeners[j]||[],this._namedListeners[j].push(i)},
removeEventListener:function(j,i){var d=this._namedListeners[j];if(d)for(var b=0;b<d.length;b++)if(d[b]===i){d.length===1?delete this._namedListeners[j]:d.splice(b,1);break}}};j.prototype.constructor=j;j.attach=function(k){var i=new j;k.dispatchEvent=i.dispatchEvent.bind(i);k.addEventListener=i.addEventListener.bind(i);k.removeEventListener=i.removeEventListener.bind(i)};return j});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(j,k){function i(a,g,c){this._properties=c||{};this._properties["service.id"]=a;this._properties.objectClass=g;this._properties["service.names"]=g}function d(a,g,c){this._serviceId=a;this._serviceReference=g;this._internalRegistry=c}function b(a,g){function c(c){return function(){var e;try{if(!g())throw Error("Service was unregistered");var b=a[c].apply(a,Array.prototype.slice.call(arguments));if(b&&typeof b.then==="function")return b;
else e=new j,e.resolve(b)}catch(f){e=new j,e.reject(f)}return e.promise}}for(var e in a)typeof a[e]==="function"&&(this[e]=c(e))}function a(a,g){this.type=a;this.serviceReference=g}function f(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var b=this;this._internalRegistry={isRegistered:function(a){return b._entries[a]?!0:!1},unregisterService:function(g){var c=b._entries[g];if(!c)throw Error("already unregistered");var e=c.reference;b._serviceEventTarget.dispatchEvent(new a("unregistering",
e));b._entries[g]=null;e.getProperty("objectClass").forEach(function(c){for(var a=b._namedReferences[c],g=0;g<a.length;g++)if(a[g]===e){a.length===1?delete b._namedReferences[c]:a.splice(g,1);break}})},modifyService:function(g){g=b._entries[g];if(!g)throw Error("already unregistered");b._serviceEventTarget.dispatchEvent(new a("modified",g.reference))}}}i.prototype={getPropertyKeys:function(){var a=[],g;for(g in this._properties)this._properties.hasOwnProperty(g)&&a.push(g);return a},getProperty:function(a){return this._properties[a]}};
i.prototype.constructor=i;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 g=this._serviceReference._properties;this._serviceReference._properties=a||{};a["service.id"]=this._serviceId;a.objectClass=g.objectClass;a["service.names"]=g["service.names"];this._internalRegistry.modifyService(this._serviceId)}};
d.prototype.constructor=d;f.prototype={getService:function(a){var g;if(typeof a==="string")(a=this._namedReferences[a])&&a.some(function(c){g=this._entries[c.getProperty("service.id")].service;return!!g},this);else if(a=this._entries[a.getProperty("service.id")])g=a.service;return g||null},getServiceReferences:function(a){if(a)return this._namedReferences[a]?this._namedReferences[a]:[];var g=[];this._entries.forEach(function(c){c&&g.push(c.reference)});return g},registerService:function(f,g,c){if(typeof g===
"undefined"||g===null)throw Error("invalid service");typeof f==="string"?f=[f]:Array.isArray(f)||(f=[]);var e=this._entries.length,l=new i(e,f,c),n=this._namedReferences;f.forEach(function(c){n[c]=n[c]||[];n[c].push(l)});f=new b(g,this._internalRegistry.isRegistered.bind(null,e));this._entries.push({reference:l,service:f});f=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new a("registered",l));return new d(e,l,f)},addEventListener:function(a,g){this._serviceEventTarget.addEventListener(a,
g)},removeEventListener:function(a,g){this._serviceEventTarget.removeEventListener(a,g)}};f.prototype.constructor=f;return{ServiceRegistry:f}});
define("orion/xhr",["orion/Deferred"],function(j){function k(i,d,b,a){var f=typeof b.response!=="undefined"?b.response:b.responseText,h;try{h=b.status}catch(g){h=0}i={args:d,response:f,responseText:typeof f==="string"?f:null,status:h,url:i,xhr:b};if(typeof a!=="undefined")i.error=a;return i}return function(i,d,b){var b=b||{},a=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,f=new j,h=b.headers||{},g=b.log||!1,c;typeof h["X-Requested-With"]==="undefined"&&(h["X-Requested-With"]="XMLHttpRequest");
if(typeof b.data!=="undefined"&&(i==="POST"||i==="PUT"))c=b.data;a.onprogress=function(c){c.xhr=a;f.progress(c)};a.onreadystatechange=function(){if(a.readyState===4){var c=k(d,b,a),e=a.status;200<=e&&e<400?f.resolve(c):(g&&typeof console!=="undefined"&&console.log(Error(a.statusText)),f.reject(c))}};try{a.open(i,d,!0);if(typeof b.responseType==="string")a.responseType=b.responseType;if(typeof b.timeout==="number")if(typeof a.timeout==="number")a.timeout=b.timeout,a.addEventListener("timeout",function(){f.reject(k(d,
b,a,"Timeout exceeded"))});else{var e=setTimeout(function(){f.reject(k(d,b,a,"Timeout exceeded"))},b.timeout);f.then(clearTimeout.bind(null,e),clearTimeout.bind(null,e))}Object.keys(h).forEach(function(c){a.setRequestHeader(c,h[c])});a.send(c)}catch(l){f.reject(k(d,b,a,l))}return f.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(j,k,i){function d(c,e){this._name=c;this._providers=e;this._flushPending=!1;this._cached=null;this._stores=[];this._dirty=[]}function b(c,e){return{get:function(a,g){if(e===0)return null;var b=localStorage.getItem(c+a);if(b===null)return null;b=JSON.parse(b);return g||e===-1||b._expires&&b._expires>(new Date).getTime()?(delete b._expires,b):null},set:function(a,g){if(e!==0){if(e!==-1)g._expires=(new Date).getTime()+1E3*e;
if(Object.keys(g).length===0)localStorage.removeItem(c+a);else{var b=JSON.stringify(g);localStorage.setItem(c+a,b);delete g._expires}}},remove:function(e){localStorage.removeItem(c+e)}}}function a(c){this._currentPromises={};this._cache=new b("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var e=c.getServiceReferences("orion.core.preference.provider");if(e.length>0)this._service=c.getService(e[0])}return!!this._service}}function f(c){this._location=
c;this._currentPromise=null;this._cache=new b("/orion/preferences/default",3600)}function h(){this._cache=new b("/orion/preferences/local",-1)}function g(c,e){this._userProvider=new a(c);this._localProvider=new h;e=e||"defaults.pref";e.indexOf("://")===-1&&(e=j.toUrl(e));this._defaultsProvider=new f(e);this._serviceRegistration=c.registerService("orion.core.preference",this)}d.prototype={_flush:function(){for(var c=[],e=0;e<this._stores.length;++e){var a=this._stores[e];this._dirty.indexOf(a)!==-1&&
c.push(this._providers[e].put(this._name,a))}this._dirty=[];return k.all(c)},_scheduleFlush:function(c){this._dirty.indexOf(c)===-1&&this._dirty.push(c);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 c=0;c<this._stores.length;++c){var e=this._stores[c],a;for(a in e)e.hasOwnProperty(a)&&typeof this._cached[a]==="undefined"&&(this._cached[a]=
e[a])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(c){return this._getCached()[c]},put:function(c,e){if(this._stores.length!==0){var a=this._stores[0];if(a[c]!==e)a[c]=e,this._cached=null,this._scheduleFlush(a)}},remove:function(c){for(var e=0;e<this._stores.length;++e){var a=this._stores[e];if(a.hasOwnProperty(c))return delete a[c],this._cached=null,this._scheduleFlush(a),!0}return!1},clear:function(){for(var c=0;c<this._stores.length;++c)this._stores[c]=
{},this._scheduleFlush(this._stores[c]);this._cached=null},sync:function(c){if(this._flushPending)return this._flushPending=!1,this._flush();for(var e=this,a=[],g=0;g<this._providers.length;++g)a.push(this._providers[g].get(this._name,c).then(function(c){return function(a){e._stores[c]=a}}(g)));return k.all(a).then(function(){e._cached=null;e._getCached()})},flush:function(){this._flush()}};a.prototype={get:function(c,e){if(this._currentPromises[c])return this._currentPromises[c];var a=new k,g=null;
e?this._cache.remove(c):g=this._cache.get(c);if(g!==null)a.resolve(g);else{this._currentPromises[c]=a;var b=this;this._service.get(c).then(function(e){b._cache.set(c,e);delete b._currentPromises[c];a.resolve(e)},function(e){e.status===404?(e={},b._cache.set(c,e),delete b._currentPromises[c],a.resolve(e)):(delete b._currentPromises[c],a.resolve(b._cache.get(c,!0)||{}))})}return a},put:function(c,e){this._cache.set(c,e);return this._service.put(c,e)}};f.prototype={get:function(c,e){if(this._currentPromise)return this._currentPromise;
var a=new k,g=null;e?this._cache.remove(c):g=this._cache.get(c);if(g!==null)a.resolve(g);else{this._currentPromise=a;var b=this;i("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(e){e=JSON.parse(e.response);b._cache.set(c,e[c]||{});b._currentPromise=null;a.resolve(e[c]||{})},function(e){e.xhr.status===401||e.xhr.status===404?(b._cache.set(c,{}),b._currentPromise=null,a.resolve({})):(b._currentPromise=null,e=b._cache.get(c,!0),e!==null?a.resolve(e[c]||{}):a.resolve({}))})}return a},
put:function(){var c=new k;c.resolve();return c}};h.prototype={get:function(c){var e=new k,c=this._cache.get(c);c!==null?e.resolve(c):e.resolve({});return e},put:function(c,e){var a=new k;this._cache.set(c,e);a.resolve();return a}};g.DEFAULT_SCOPE=1;g.LOCAL_SCOPE=2;g.USER_SCOPE=4;g.prototype={listenForChangedSettings:function(c,e,a){if(!e||typeof e!=="number"||e>7||e<1)a=e,e=g.DEFAULT_SCOPE|g.LOCAL_SCOPE|g.USER_SCOPE;window.addEventListener("storage",a,!1);if((g.USER_SCOPE&e)!==0)return"/orion/preferences/user"+
c;else if((g.LOCAL_SCOPE&e)!==0)return"/orion/preferences/local"+c;return"/orion/preferences/default"+c},getPreferences:function(c,e){if(!e||typeof e!=="number"||e>7||e<1)e=g.DEFAULT_SCOPE|g.LOCAL_SCOPE|g.USER_SCOPE;var a=[];g.USER_SCOPE&e&&this._userProvider.available()&&a.push(this._userProvider);g.LOCAL_SCOPE&e&&a.push(this._localProvider);g.DEFAULT_SCOPE&e&&a.push(this._defaultsProvider);var b=new d(c,a);return b.sync().then(function(){return b})},getSetting:function(c,a,g){for(var b,f=0;f<c.length;f++)if(c[f].label===
a)for(var h=0;h<c[f].data.length;h++)if(c[f].data[h].label===g){b=c[f].data[h].value;break}return b}};return{PreferencesService:g}});
(function(){function j(c){if(typeof c!=="string")throw new TypeError;}function k(c){return c?c.split("&"):[]}function i(c){return c.length===0?"":c.join("&")}function d(c){var m=/([^=]*)(?:=?)(.*)/.exec(c),c=m[1]?decodeURIComponent(m[1]):"",m=m[2]?decodeURIComponent(m[2]):"";return[c,m]}function b(c){var m=encodeURIComponent(c[0]);c[1]&&(m+="="+encodeURIComponent(c[1]));return m}function a(c,m){var a="",e=[],g=0;return{next:function(){if(a!==c.query)a=c.query,e=k(a);if(g<e.length){var b=d(e[g++]);
switch(m){case "keys":return b[0];case "values":return b[1];case "keys+values":return[b[0],b[1]];default:throw new TypeError;}}throw w;}}}function f(c){Object.defineProperty(this,"_url",{get:function(){return c._url}})}function h(c){var m=[];c.split("/").forEach(function(c){c===".."?m.pop():c!=="."&&m.push(c)});return m.join("/")}function g(c){return c.replace(/\s/g,function(c){return"%"+c.charCodeAt(0).toString(16)})}function c(c,m){if(typeof c!=="string")throw new TypeError;var c=g(c),a=n.exec(c);
if(!a)return null;var e={};e.scheme=a[1]||"";if(e.scheme&&!o.test(e.scheme))return null;var b=a[2];if(b&&(b=p.exec(b),e.userinfo=b[1],e.host=b[2],e.port=b[3],e.port&&!s.test(e.port)))return null;e.path=a[3];e.query=a[4];e.fragment=a[5];if(!e.scheme&&m&&(e.scheme=m.scheme,!e.host&&m.host))e.userinfo=m.userinfo,e.host=m.host,e.port=m.port,e.pathRelative=!0;if(e.pathRelative)if(e.path){if(e.path[0]!=="/")a=/^(.*\/)[^\/]*$/.exec(m.path)[1]||"/",e.path=a+e.path}else e.path=m.path;if(e.scheme)e.scheme=
e.scheme.toLowerCase();if(e.port)e.port=/[1-9]\d*$/.exec(e.port)[0];if(e.host&&e.path)e.path=h(e.path);return e}function e(m,e){var a;if(e){e=e.href||e;a=c(e);if(!a||!a.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:a})}a=c(m,a);if(!a)throw new SyntaxError;Object.defineProperty(this,"_input",{value:m,writable:!0});Object.defineProperty(this,"_url",{value:a,writable:!0});var g=new f(this);Object.defineProperty(this,"query",{get:function(){return this._url?g:null},enumerable:!0})}
try{if(typeof window.URL==="function"&&window.URL.length!==0&&(new window.URL("http://www.w3.org")).protocol==="http:")return}catch(l){}var n=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,p=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,o=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,s=/^\d*$/,r=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,q=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,t=/^([^?#\s]*)$/,m=/^([^\s]*)$/,u=/^\S*$/,z=/([^:]*):?(.*)/,w=typeof StopIteration!=="undefined"?StopIteration:
Error("Stop Iteration"),v={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(f.prototype,{get:{value:function(c){j(c);var m;k(this._url.query).some(function(e){e=d(e);if(e[0]===c)return m=e[1],!0});return m},enumerable:!0},set:{value:function(c,m){j(c);j(m);var e=k(this._url.query);e.some(function(a,g){var f=d(a);if(f[0]===c)return f[1]=m,e[g]=b(f),!0})||e.push(b([c,m]));this._url.query=i(e)},enumerable:!0},has:{value:function(c){j(c);return k(this._url.query).some(function(m){if(d(m)[0]===
c)return!0})},enumerable:!0},"delete":{value:function(c){j(c);var m=k(this._url.query),e=m.filter(function(m){return d(m)[0]!==c});return e.length!==m.length?(this._url.query=i(e),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(c,m){if(typeof c!=="function")throw new TypeError;var e=a(this._url,"keys+values");try{for(;;){var g=e.next();c.call(m,g[1],g[0],this)}}catch(b){if(b!==w)throw b;}},enumerable:!0},keys:{value:function(){return a(this._url,
"keys")},enumerable:!0},values:{value:function(){return a(this._url,"values")},enumerable:!0},items:{value:function(){return a(this._url,"keys+values")}},size:{get:function(){return k(this._url.query).length},enumerable:!0},getAll:{value:function(c){j(c);var m=[];k(this._url.query).forEach(function(e){e=d(e);e[0]===c&&m.push(e[1])});return m},enumerable:!0},append:{value:function(c,m){j(c);j(m);var e=k(this._url.query);e.push(b([c,m]));this._url.query=i(e)},enumerable:!0}});Object.defineProperties(e.prototype,
{href:{get:function(){var c;if(this._url){c=this._url;var m=c.scheme?c.scheme+":":"";c.host&&(m+="//",c.userinfo&&(m+=c.userinfo+"@"),m+=c.host,c.port&&(m+=":"+c.port));m+=c.path;c.query&&(m+="?"+c.query);c.fragment&&(m+="#"+c.fragment);c=m}else c=this._input;return c},set:function(m){j(m);this._input=m;this._url=c(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(c){j(c);if(this._url&&(c=c.slice(-1)===":"?c.substring(0,c.length-1):c,o.test(c)))this._url.scheme=c.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(c){j(c);if(this._url)this._url.userinfo=c}},username:{get:function(){if(!this._url)return"";var c=z.exec(this._userinfo);return decodeURIComponent(c[1]||"")},set:function(c){j(c);if(this._url){var m=z.exec(this._userinfo),c=[encodeURIComponent(c||"")];
m[2]&&c.push(m[2]);this._userinfo=c.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var c=z.exec(this._userinfo);return decodeURIComponent(c[2]||"")},set:function(c){j(c);if(this._url){var m=[z.exec(this._userinfo)[1]||""];c&&m.push(encodeURIComponent(c));this._userinfo=m.join(":")}},enumerable:!0},host:{get:function(){var c="";this._url&&this._url.host&&(c+=this._url.host,this._url.port&&(c+=":"+this._url.port));return c},set:function(c){j(c);if(this._url&&(c=q.exec(c)))this._url.host=
c[1],this._url.port=/[1-9]\d*$/.exec(c[2])[0]},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(c){j(c);if(this._url&&r.exec(c))this._url.host=c},enumerable:!0},port:{get:function(){var c=this._url?this._url.port||"":"";c&&c===v[this.protocol]&&(c="");return c},set:function(c){j(c);if(this._url&&s.exec(c))this._url.port=/[1-9]\d*$/.exec(c)[0]},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(c){j(c);if(this._url&&t.exec(c))this._url.host&&
c&&c[0]!=="/"&&(c="/"+c),this._url.path=c?h(c):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(c){j(c);if(this._url&&(c&&c[0]==="?"&&(c=c.substring(1)),m.exec(c)))this._url.query=c},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(c){j(c);if(this._url&&(c&&c[0]==="#"&&(c=c.substring(1)),u.exec(c)))this._url.fragment=c},enumerable:!0}});window.URL&&window.URL.createObjectURL&&
(Object.defineProperty(e,"createObjectURL",{value:window.URL.createObjectURL.bind(window.URL),enumerable:!1}),Object.defineProperty(e,"revokeObjectURL",{value:window.URL.revokeObjectURL.bind(window.URL),enumerable:!1}));window.URL=e})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(j,k){function i(a,c){var e=Object.keys(a),b=Object.keys(c);if(e.length!==b.length)return!1;e.sort();b.sort();for(var f=0,h=e.length;f<h;f++){var d=e[f];if(d!==b[f])return!1;var s=a[d],d=c[d];if(s!==d&&JSON.stringify(s)!==JSON.stringify(d))return!1}return!0}function d(a){if(a.indexOf("://")===-1)try{return(new URL(a,location.href)).href}catch(c){}return a}function b(a){var c=null;return{key:function(e){return(c=
c||Object.keys(a))[e]},getItem:function(c){return a[c]},setItem:function(e,b){a[e]=b;c=null},removeItem:function(e){delete a[e];c=null},clear:function(){(c=c||Object.keys(a)).forEach(function(c){delete a[c]}.bind(this));c=null}}}function a(a,c){return{type:a,plugin:c}}function f(b,c,e){function f(c,m,a){if(!E)return(new j).reject(Error("plugin not connected"));var b=A++,g=new j;g.then(null,function(c){v==="active"&&c instanceof Error&&c.name==="Cancel"&&e.postMessage({id:b,cancel:c.message||"Cancel"},
E)});x[String(b)]=g;e.postMessage({id:b,serviceId:c,method:m,params:a},E);return g.promise}function h(c){var m={};if(c.methods&&(c.methods.forEach(function(e){m[e]=function(){var m=Array.prototype.slice.call(arguments);return v==="active"?f(c.serviceId,e,m):q.start({"transient":!0}).then(function(){return f(c.serviceId,e,m)})}}),m.addEventListener&&m.removeEventListener)){var e=new k;m.dispatchEvent=e.dispatchEvent.bind(e);var a=m.addEventListener;m.addEventListener=function(c,m){e._namedListeners[c]||
a(c);e.addEventListener(c,m)};var b=m.removeEventListener;m.removeEventListener=function(c,m){e.removeEventListener(c,m);e._namedListeners[c]&&b(c)}}return m}function d(c){var m=JSON.parse(JSON.stringify(c.properties));m.__plugin__=b;c=c.names||c.type||[];Array.isArray(c)||(c=[c]);m.objectClass=c;return m}function o(c){var m=h(c),a=d(c),a=e.registerService(c.names||c.type,m,a);C[c.serviceId]={registration:a,proxy:m}}function s(){e.persist(b,{created:t,headers:m,services:u,autostart:z,lastModified:w})}
function r(c){var m;try{if(c.method)if("manifest"===c.method||"plugin"===c.method){var a=c.params[0];F({headers:a.headers,services:a.services}).then(function(){B.resolve(q)})}else if("dispatchEvent"===c.method){var b=C[c.serviceId].proxy;b.dispatchEvent.apply(b,c.params)}else if("progress"===c.method)m=x[String(c.requestId)],m.progress.apply(m,c.params);else if("timeout"===c.method)B&&B.reject(c.error);else throw Error("Bad response method: "+c.method);else if(m=x[String(c.id)],delete x[String(c.id)],
c.error){var g=e.handleServiceError(q,c.error);m.reject(g)}else m.resolve(c.result)}catch(f){console.log("Plugin._responseHandler "+f)}}var q=this,c=c||{},t=c.created||(new Date).getTime(),m=c.headers||{},u=c.services||[],z=c.autostart,w=c.lastModified||0,v="installed",D,B,E,C={},A=0,x={},F;this._persist=s;this._resolve=function(){v="resolved";e.dispatchEvent(new a("resolved",q))};this._getAutostart=function(){return z};this._getCreated=function(){return t};this.getLocation=function(){return b};this.getHeaders=
function(){return JSON.parse(JSON.stringify(m))};this.getName=function(){var c=this.getHeaders();return c?c.name||"":null};this.getVersion=function(){var c=this.getHeaders();return c?c.version||"0.0.0":null};this.getLastModified=function(){return w};this.getServiceReferences=function(){var c=[];Object.keys(C).forEach(function(m){c.push(C[m].registration.getReference())});return c};this.getState=function(){return v};this.start=function(c){if(v==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));
if(D)return D.promise.then(this.start.bind(this,c));if(v==="active")return(new j).resolve();if(!c||!c["transient"]){var m=c&&c.lazy?"lazy":"started";m!==z&&(z=m,s())}m=e.getState();if(m!=="starting"&&m!=="active")return c["transient"]?(new j).reject(Error("start transient error")):(new j).resolve();if(v==="installed")try{this._resolve()}catch(f){return(new j).reject(f)}v==="resolved"&&u.forEach(function(c){o(c)});if(c&&c.lazy)return v!=="starting"&&(v="starting",e.dispatchEvent(new a("lazy activation",
q))),(new j).resolve();var h=new j;D=h;v="starting";e.dispatchEvent(new a("starting",q));B=new j;E=e.connect(b,r);B.then(function(){B=null;v="active";e.dispatchEvent(new a("started",q));D=null;h.resolve()},function(){B=null;v="stopping";e.dispatchEvent(new a("stopping",q));Object.keys(C).forEach(function(c){C[c].registration.unregister();delete C[c]});e.disconnect(E);E=null;v="resolved";D=null;e.dispatchEvent(new a("stopped",q));h.reject(Error("plugin activation error"))});return h.promise};this.stop=
function(c){if(v==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(D)return D.promise.then(this.stop.bind(this,c));if((!c||!c["transient"])&&"stopped"!==z)z="stopped",s();if(v!=="active"&&v!=="starting")return(new j).resolve();D=c=new j;v="stopping";e.dispatchEvent(new a("stopping",q));Object.keys(C).forEach(function(c){C[c].registration.unregister();delete C[c]});E&&(e.disconnect(E),E=null);v="resolved";D=null;e.dispatchEvent(new a("stopped",q));c.resolve();return c.promise};
F=function(c){if(v==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(!c)return w===0&&(w=(new Date).getTime(),s()),e.loadManifest(b).then(F);var f=m,h=u,l=z;m=c.headers||{};u=c.services||{};z=c.autostart||z;c.lastModified?w=c.lastModified:(w=(new Date).getTime(),s());if(i(m,f)&&i(u,h)&&z===l)return(new j).resolve();if(v==="active"||v==="starting"){var n=[];Object.keys(u).forEach(function(c){var m=u[c];n.push(c);var e=C[c];if(e){if(i(m.methods,Object.keys(e.proxy))){var c=d(m),
a=e.registration.getReference(),b={};a.getPropertyKeys().forEach(function(c){b[c]=a.getProperty(c)});i(c,b)||e.registration.setProperties(c);return}e.registration.unregister();delete C[c]}o(m)});Object.keys(C).forEach(function(c){n.indexOf(c)===-1&&(C[c].registration.unregister(),delete C[c])})}v==="active"&&(e.disconnect(E),B=new j,E=e.connect(b,r),B.then(function(){B=null},function(){B=null;v="stopping";e.dispatchEvent(new a("stopping"),q);Object.keys(C).forEach(function(c){C[c].registration.unregister();
delete C[c]});e.disconnect(E);E=null;v="resolved";e.dispatchEvent(new a("stopped",q))}));return(new j).resolve()};this.update=function(c){return F(c).then(function(){e.dispatchEvent(new a("updated",q))})};this.uninstall=function(){if(v==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(v==="active"||v==="starting"||v==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));e.removePlugin(this);v="uninstalled";e.dispatchEvent(new a("uninstalled",
q));return(new j).resolve()}}var h=/^http[s]?/i;return{Plugin:f,PluginRegistry:function(g,c){function e(c){var m=c.source;o.some(function(e){if(m===e.target){if(typeof e.useStructuredClone==="undefined")e.useStructuredClone=typeof c.data!=="string";e.handler(e.useStructuredClone?c.data:JSON.parse(c.data));return!0}})}var c=c||{},l=c.storage||localStorage;l.getItem||(l=b(l));var n="installed",p=[],o=[],s=new k,i={},q={registerService:g.registerService.bind(g),connect:function(e,m,a){function b(c){c=
Error(c);c.name="timeout";m({method:"timeout",error:c})}var g={handler:m,url:e},f=setTimeout(b.bind(null,"Load timeout for: "+e),a||15E3),h=document.createElement("iframe");h.name=e+"_"+(new Date).getTime();if(!c.visible)h.style.display="none",h.style.visibility="hidden";h.src=e;h.onload=function(){clearTimeout(f);setTimeout(b.bind(null,"Plugin handshake timeout for: "+e),5E3)};h.sandbox="allow-scripts allow-same-origin";document.body.appendChild(h);g.target=h.contentWindow;g.close=function(){h&&
(document.body.removeChild(h),h=null)};o.push(g);return g},disconnect:function(c){for(var m=0;m<o.length;m++)if(c===o[m]){o.splice(m,1);try{c.close()}catch(e){}break}},removePlugin:function(c){for(var m=0;m<p.length;m++)if(c===p[m]){p.splice(m,1);break}l.removeItem("plugin."+c.getLocation())},persist:function(c,m){l.setItem("plugin."+c,JSON.stringify(m))},postMessage:function(c,m){m.target.postMessage(m.useStructuredClone?c:JSON.stringify(c),m.url)},dispatchEvent:function(c){try{s.dispatchEvent(c)}catch(m){console&&
console.log("PluginRegistry.dispatchEvent "+m)}},loadManifest:function(c){var m=new j,e=q.connect(c,function(c){e&&c.method&&("manifest"===c.method||"plugin"===c.method?(c=c.params[0],q.disconnect(e),e=null,m.resolve(c)):"timeout"===c.method&&(q.disconnect(e),e=null,m.reject(c.error)))});return m.promise},getState:function(){return n},handleServiceError:function(c,m){if(m&&m.status===401){var e=c.getHeaders(),a=c.getName()||c.getLocation(),b=document.createElement("span");b.appendChild(document.createTextNode("Authentication required for: "+
a+"."));if(e.login)b.appendChild(document.createTextNode(" ")),a=document.createElement("a"),a.target="_blank",a.textContent="Login",a.href=e.login,h.test(a.href)?(b.appendChild(a),b.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+e.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(b)}}if(m.__isError){var g=m,m=Error(g.message);Object.keys(g).forEach(function(c){m[c]=g[c]});delete m.__isError}return m}};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=q.getState;this.init=function(){if(!(n==="starting"||n==="active"||n==="stopping")){addEventListener("message",e,!1);for(var a=[],m=0,b=l.length;m<b;m++)a.push(l.key(m));a.forEach(function(c){if(c.indexOf("plugin.")===0){var m=c.substring(7),c=JSON.parse(l.getItem(c));c.created&&p.push(new f(m,c,q))}});
p.sort(function(c,m){return c._getCreated()<m._getCreated()?-1:1});c.plugins&&Object.keys(c.plugins).forEach(function(m){m=d(m);if(!this.getPlugin(m)){var e=c.plugins[m],e=typeof e==="object"||{};e.autostart=e.autostart||c.defaultAutostart||"lazy";p.push(new f(m,e,q))}}.bind(this));n="starting"}};this.start=function(){n!=="starting"&&this.init();if(n!=="starting")return(new j).reject("Cannot start framework. Framework is already "+n+".");var c=[],m=(new Date).getTime();p.forEach(function(e){var a=
e._getAutostart();e.getLastModified()===0?c.push(e.update().then(function(){if("started"===a)return e.start({"transient":!0});if("lazy"===a)return e.start({lazy:!0,"transient":!0});e._resolve()})):"started"===a?c.push(e.start({"transient":!0})):"lazy"===a?(c.push(e.start({lazy:!0,"transient":!0})),m>e.getLastModified()+864E5&&e.update()):e._resolve()});return j.all(c,function(c){console.log("PluginRegistry.stop "+c)}).then(function(){n="active"})};this.stop=function(){if(n!=="starting"&&n!=="active")return(new j).reject("Cannot stop registry. Registry is already "+
n+".");n="stopping";var c=[];p.forEach(function(m){c.push(m.stop({"transient":!0}))});return j.all(c,function(c){console.log("PluginRegistry.stop "+c)}).then(function(){removeEventListener("message",e);n="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new j).reject("Cannot uninstall registry")};this.installPlugin=function(c,m){var c=d(c),e=this.getPlugin(c);if(e)return(new j).resolve(e);if(i[c])return i[c];if(m)return e=new f(c,m,q),p.push(e),
e._persist(),q.dispatchEvent(new a("installed",e)),(new j).resolve(e);var b=q.loadManifest(c).then(function(m){e=new f(c,m,q);p.push(e);e._persist();delete i[c];q.dispatchEvent(new a("installed",e));return e},function(m){delete i[c];throw m;});return i[c]=b};this.getPlugins=function(){return p.slice()};this.getPlugin=function(c){var m=null,c=d(c);p.some(function(e){if(c===e.getLocation())return m=e,!0});return m};this.addEventListener=s.addEventListener.bind(s);this.removeEventListener=s.removeEventListener.bind(s);
this.resolvePlugins=function(){var c=!0;p.forEach(function(m){c=c&&m._resolve()});return c}}}});
define("orion/serviceTracker",[],function(){function j(d,b){function a(c){var e=c.getProperty("service.id"),a=this.addingService(c);a&&(h[e]=c,g[e]=a)}function f(c){var e=c.getProperty("service.id"),a=g[e];delete h[e];delete g[e];this.removedService(c,a)}this.serviceRegistry=d;var h={},g={},c=k,e,l;this.close=function(){if(c!==i)throw"Already closed";c=k;d.removeEventListener("registered",e);d.removeEventListener("unregistering",l);l=e=null;var a=this;this.getServiceReferences().forEach(function(c){f.call(a,
c)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){return h.length?Object.keys(h).map(function(c){return h[c]}):null};this.open=function(){if(c!==k)throw"Already open";c=i;var g=this;e=function(c){if(c.serviceReference.getProperty("objectClass").indexOf(b)!==-1&&(a.call(g,c.serviceReference),typeof g.onServiceAdded==="function"))return g.onServiceAdded(c.serviceReference,g.serviceRegistry.getService(c.serviceReference))};l=function(c){c.serviceReference.getProperty("objectClass").indexOf(b)!==
-1&&f.call(g,c.serviceReference)};d.addEventListener("registered",e);d.addEventListener("unregistering",l);d.getServiceReferences(b).forEach(function(c){a.call(g,c)});if(typeof this.onOpen==="function")this.onOpen()}}var k=0,i=1;j.prototype={addingService:function(d){return this.serviceRegistry.getService(d)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return j});
define("orion/config",["orion/Deferred","orion/serviceTracker"],function(j,k){var i,d,b,a,f,h="pid";i=function(c,e,a){function b(c,a,g){a.forEach(function(m,b){try{var f=c[b].getProperty("__plugin__"),h=f&&e.getPlugin(f);(!f||h&&h.getState()==="active")&&a[b].updated(g)}catch(d){typeof console!=="undefined"&&console.log(d)}})}k.call(this,c,"orion.cm.managedservice");var g={},f={},d=function(e){var b=[];e.plugin.getServiceReferences().forEach(function(e){if(e.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var m=e.getProperty(h),e=c.getService(e);m&&e&&(m=(m=a._find(m))&&m.getProperties(),b.push(e.updated(m)))}});return j.all(b)};this.addingService=function(e){var a=e.getProperty(h),b=c.getService(e);if(!a||!b)return null;g[a]||(g[a]=[]);f[a]||(f[a]=[]);g[a].push(e);f[a].push(b);return b};this.onServiceAdded=function(c,e){var g=c.getProperty(h),g=a._find(g);b([c],[e],g&&g.getProperties())};this.onOpen=function(){e.addEventListener("started",d)};this.onClose=function(){e.removeEventListener("started",
d)};this.notifyUpdated=function(c){var e=c.getPid();b(g[e]||[],f[e]||[],c.getProperties())};this.notifyDeleted=function(c){c=c.getPid();b(g[c]||[],f[c]||[],null)};this.removedService=function(c,e){var a=c.getProperty(h),m=g[a],b=f[a];m.length>1?m.splice(m.indexOf(c),1):delete g[a];b.length>1?b.splice(b.indexOf(e),1):delete f[a]}};d=function(){function c(c,g,f){this.store=new b(this,f);this.configAdmin=new a(this,this.store);this.tracker=new i(c,g,this.store)}c.prototype={getConfigurationAdmin:function(){var c=
this;return this.configAdmin._init().then(function(a){c.tracker.open();return a})},notifyDeleted:function(c){this.tracker.notifyDeleted(c)},notifyUpdated:function(c){this.tracker.notifyUpdated(c)}};return c}();a=function(){function c(c,a){this.factory=c;this.store=a}c.prototype={_init:function(){var c=this;return this.store._init().then(function(){return c})},getConfiguration:function(c){return this.store.get(c)},listConfigurations:function(){return this.store.list()}};return c}();var g="/cm/configurations";
b=function(){function c(c,a){this.factory=c;this.prefsService=a;this.configs=Object.create(null);this.pref=null;var b=this;this.initPromise=this.prefsService.getPreferences(g).then(function(c){b.pref=c;c.keys().forEach(function(e){if(!b.configs[e]){var a=c.get(e);typeof a==="object"&&a!==null&&Object.keys(a).length>0&&(a[h]=e,b.configs[e]=new f(b.factory,b,a))}})})}c.prototype={_init:function(){return this.initPromise},_find:function(c){return this.configs[c]||null},get:function(c){var a=this._find(c);
a||(a=new f(this.factory,this,c),this.configs[c]=a);return a},list:function(){var c=this,a=[];this.pref.keys().forEach(function(b){(b=c._find(b))&&b.getProperties()!==null&&a.push(b)});return a},remove:function(c){this.pref.remove(c);delete this.configs[c]},save:function(c,a){this.pref.put(c,a.getProperties(!0)||{})}};return c}();f=function(){function c(c){for(var e={},a=Object.keys(c),b=0;b<a.length;b++){var g=a[b],f=c[g];e[g]=f instanceof Array?f.slice():f}return e}function e(e,a,b){this.factory=
e;this.store=a;if(b!==null&&typeof b==="object")this.pid=b[h],e=c(b),delete e[h],this.properties=e;else if(typeof b==="string")this.pid=b,this.properties=null;else throw Error("Invalid pid/properties "+b);}e.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(e){this._checkRemoved();var a=null;if(this.properties&&(a=c(this.properties),!e))a[h]=this.pid;return a},remove:function(){this._checkRemoved();
this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=!0},update:function(e){this._checkRemoved();e=c(e);delete e[h];this.properties=e;this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return e}();return{ConfigurationAdminFactory:d}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(j,k,i,d,b,a){var f;return{startup:function(){if(f)return f;f=new k;var h=new i.ServiceRegistry,g=new d.PreferencesService(h);return g.getPreferences("/plugins").then(function(c){var e={plugins:{}};c.keys().forEach(function(a){var b=j.toUrl(a);e.plugins[b]=c[a]});var d=new b.PluginRegistry(h,e);return d.start().then(function(){if(h.getServiceReferences("orion.core.preference.provider").length>
0)return g.getPreferences("/plugins",g.USER_SCOPE).then(function(c){var e=[];c.keys().forEach(function(c){c=j.toUrl(c);d.getPlugin(c)||e.push(d.installPlugin(c,{autostart:"lazy"}).then(function(c){return c.update().then(function(){return c.start({lazy:!0})})}))});return k.all(e,function(c){console.log(c)})})}).then(function(){return(new a.ConfigurationAdminFactory(h,d,g)).getConfigurationAdmin().then(h.registerService.bind(h,"orion.cm.configadmin"))}).then(function(){var c=h.getService("orion.core.auth");
if(c){var e=c.getUser().then(function(e){if(e)localStorage.setItem("lastLogin",(new Date).getTime());else return c.getAuthForm(window.location.href).then(function(c){setTimeout(function(){window.location=c},0)})}),a=localStorage.getItem("lastLogin");if(!a||a<(new Date).getTime()-9E5)return e}}).then(function(){var c={serviceRegistry:h,preferences:g,pluginRegistry:d};f.resolve(c);return c})})}}});
define("orion/webui/littlelib",[],function(){function j(a,b){b||(b=document);return b.querySelectorAll(a)}function k(a,b){var c=a.compareDocumentPosition(b);return a===b||Boolean(c&16)}function i(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var b=0;b<a.childNodes.length;b++){var c=i(a.childNodes[b]);if(c)return c}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 c=d(a.childNodes[b]);if(c)return c}return null}function b(f,
g){if(f.nodeType===3){var c=a.exec(f.nodeValue);c&&c.length>1&&g(f,c)}if(f.hasChildNodes())for(c=0;c<f.childNodes.length;c++)b(f.childNodes[c],g)}var a=/\$\{([^\}]+)\}/,f=[];return{$:function(a,b){b||(b=document);return b.querySelector(a)},$$:j,$$array:function(a,b){return Array.prototype.slice.call(j(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:i,lastTabbable:d,stop:function(a){window.document.all?a.keyCode=0:(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,g){b(a,function(c,a){c.parentNode.replaceChild(document.createTextNode(g[a[1]]||a[1]),c)})},processDOMNodes:function(a,g){b(a,function(c,a){var b=g[a[1]];if(b){var f=document.createRange(),h=a.index;f.setStart(c,h);f.setEnd(c,
h+a[0].length);f.deleteContents();f.insertNode(b)}})},addAutoDismiss:function(a,b){f.length===0&&document.addEventListener("click",function(c){for(var a=[],b=0;b<f.length;b++){var g=f[b].dismiss,h=!1,d;if(f[b].excludeNodes.every(function(a){return a&&(h=document.compareDocumentPosition(document,a)!==1)&&k(a,c.target)?(d=a,!1):!0})){try{g()}catch(s){typeof console!=="undefined"&&console&&console.error(s&&s.message)}h=document.compareDocumentPosition(document,d)!==1}h&&a.push(f[b])}f=a},!0);f.push({excludeNodes:a,
dismiss:b})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion","Show a list of all the keybindings on this page":"Show a list of all the keybindings on this page","Show Keys":"Show Keys","Hide or show the page banner and footer":"Hide or show the page banner and footer",
"Toggle banner and footer":"Toggle banner and footer","Choose a file by name and open an editor on it":"Choose a file by name and open an editor on it","Find File Named...":"Find File Named...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown",
" is already a favorite.":" is already a favorite.","Add to the favorites list":"Add to the favorites list","Make Favorite":"Make Favorite","Unknown item":"Unknown item","Can't search: no search service is available":"Can't search: no search service is available","could not find banner parent, id was ":"could not find banner parent, id was "," has been added to the favorites list.":" has been added to the favorites list.",Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy",
"Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"I20130625-1555","Add this page to the favorites list":"Add this page to the favorites list","LOG: ":"LOG: ",View:"View","no parent":"no parent","no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ",
"Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?","Orion Home":"Orion Home","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations",Operations:"Operations","Operations running":"Operations running","Some operations finished with warning":"Some operations finished with warning","Some operations finished with error":"Some operations finished with error",
"no service registry":"no service registry","Are you sure you want to delete '${0}' from the favorites?":"Are you sure you want to delete '${0}' from the favorites?","Are you sure you want to delete these ${0} favorites?":"Are you sure you want to delete these ${0} favorites?","You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the More menu.":"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the More menu.",
Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Saved searches":"Saved searches","Recent searches":"Recent searches","Open in new tab":"Open in new tab","Regular expression":"Regular expression","Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations",
"Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site","Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plugin",
"Generate a sample plugin for integrating with Orion.":"Generate a sample plugin for integrating with Orion."});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("text",["module"],function(j){var k,i,d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],b=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,f=typeof location!=="undefined"&&location.href,h=f&&location.protocol&&location.protocol.replace(/\:/,""),g=f&&location.hostname,c=f&&(location.port||void 0),e=[],l=j.config&&j.config()||{};k={version:"2.0.5",strip:function(c){if(c){var c=c.replace(b,""),e=c.match(a);e&&(c=e[1])}else c="";return c},
jsEscape:function(c){return c.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:l.createXhr||function(){var c,a,e;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(a=0;a<3;a+=1){e=d[a];try{c=new ActiveXObject(e)}catch(b){}if(c){d=[e];break}}return c},parseName:function(c){var a,
e,b=!1,g=c.indexOf(".");a=c.indexOf("./")===0||c.indexOf("../")===0;g!==-1&&(!a||g>1)?(a=c.substring(0,g),e=c.substring(g+1,c.length)):a=c;c=e||a;g=c.indexOf("!");g!==-1&&(b=c.substring(g+1)==="strip",c=c.substring(0,g),e?e=c:a=c);return{moduleName:a,ext:e,strip:b}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(c,a,e,b){var g,f;g=k.xdRegExp.exec(c);if(!g)return!0;c=g[2];g=g[3];g=g.split(":");f=g[1];g=g[0];return(!c||c===a)&&(!g||g.toLowerCase()===e.toLowerCase())&&(!f&&!g||f===b)},finishLoad:function(c,
a,b,g){b=a?k.strip(b):b;l.isBuild&&(e[c]=b);g(b)},load:function(a,e,b,d){if(d.isBuild&&!d.inlineText)b();else{l.isBuild=d.isBuild;var i=k.parseName(a),d=i.moduleName+(i.ext?"."+i.ext:""),j=e.toUrl(d),t=l.useXhr||k.useXhr;!f||t(j,h,g,c)?k.get(j,function(c){k.finishLoad(a,i.strip,c,b)},function(c){b.error&&b.error(c)}):e([d],function(c){k.finishLoad(i.moduleName+"."+i.ext,i.strip,c,b)})}},write:function(c,a,b){if(e.hasOwnProperty(a)){var g=k.jsEscape(e[a]);b.asModule(c+"!"+a,"define(function () { return '"+
g+"';});\n")}},writeFile:function(c,a,e,b,g){var a=k.parseName(a),f=a.ext?"."+a.ext:"",h=a.moduleName+f,m=e.toUrl(a.moduleName+f)+".js";k.load(h,e,function(){var a=function(c){return b(m,c)};a.asModule=function(c,a){return b.asModule(c,m,a)};k.write(c,h,a,g)},g)}};if(l.env==="node"||!l.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)i=require.nodeRequire("fs"),k.get=function(c,a){var e=i.readFileSync(c,"utf8");e.indexOf("\ufeff")===0&&(e=e.substring(1));a(e)};else if(l.env===
"xhr"||!l.env&&k.createXhr())k.get=function(c,a,e,b){var g=k.createXhr(),f;g.open("GET",c,!0);if(b)for(f in b)b.hasOwnProperty(f)&&g.setRequestHeader(f.toLowerCase(),b[f]);if(l.onXhr)l.onXhr(g,c);g.onreadystatechange=function(){var b;if(g.readyState===4)b=g.status,b>399&&b<600?(b=Error(c+" HTTP status: "+b),b.xhr=g,e(b)):a(g.responseText)};g.send(null)};else if(l.env==="rhino"||!l.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")k.get=function(c,a){var e,b,g=new java.io.File(c),f=java.lang.System.getProperty("line.separator"),
g=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(g),"utf-8")),h="";try{e=new java.lang.StringBuffer;(b=g.readLine())&&b.length()&&b.charAt(0)===65279&&(b=b.substring(1));for(e.append(b);(b=g.readLine())!==null;)e.append(f),e.append(b);h=String(e.toString())}finally{g.close()}a(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(j,k,i){return{slideoutHTMLFragment:function(d){var b=document.createElement("div");b.innerHTML=i;var a=k.$("#slideContainer",b);a.id=d+a.id;a=k.$("#pageCommandParameters",b);a.id=d+a.id;a=k.$("#pageCommandDismiss",b);a.id=d+a.id;return b.innerHTML}}});
define("orion/util",[],function(){var j=navigator.userAgent,k=parseFloat(j.split("MSIE")[1])||void 0,i=parseFloat(j.split("Firefox/")[1]||j.split("Minefield/")[1])||void 0,d=j.indexOf("Opera")!==-1,b=parseFloat(j.split("Chrome/")[1])||void 0,a=j.indexOf("Safari")!==-1&&!b,f=parseFloat(j.split("WebKit/")[1])||void 0,h=j.indexOf("Android")!==-1,g=j.indexOf("iPad")!==-1,j=j.indexOf("iPhone")!==-1,c=g||j,e=navigator.platform.indexOf("Mac")!==-1,l=navigator.platform.indexOf("Win")!==-1,n=navigator.platform.indexOf("Linux")!==
-1;return{formatMessage:function(c){var a=arguments;return c.replace(/\$\{([^\}]+)\}/g,function(c,e){return a[(e<<0)+1]})},createElement:function(c,a){return c.createElementNS?c.createElementNS("http://www.w3.org/1999/xhtml",a):c.createElement(a)},isIE:k,isFirefox:i,isOpera:d,isChrome:b,isSafari:a,isWebkit:f,isAndroid:h,isIPad:g,isIPhone:j,isIOS:c,isMac:e,isWindows:l,isLinux:n,platformDelimiter:l?"\r\n":"\n"}});
define("orion/keyBinding",["orion/util"],function(j){function k(d,b,a,f,h,g){this.type=g||"keydown";this.keyCode=typeof d==="string"&&this.type==="keydown"?d.toUpperCase().charCodeAt(0):d;this.mod1=b!==void 0&&b!==null?b:!1;this.mod2=a!==void 0&&a!==null?a:!1;this.mod3=f!==void 0&&f!==null?f:!1;this.mod4=h!==void 0&&h!==null?h:!1}function i(d){this.keys=d}k.prototype={getKeys:function(){return[this]},match:function(d,b){if(b!==void 0){if(b!==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(j.isOpera?d.which:d.charCode!==void 0?d.charCode:d.keyCode)?this.mod1!==(j.isMac?d.metaKey:d.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==d.shiftKey?!1:this.mod3!==d.altKey?!1:j.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}};i.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(d,b){var a=this.keys;if(b!==void 0)return b>a.length?!1:a[b].match(d)?b===a.length-1?!0:b+1:!1;else{d instanceof Array||(d=[d]);if(d.length>a.length)return!1;var f;for(f=0;f<d.length;f++)if(!a[f].match(d[f]))return!1;return f===a.length?!0:f}},equals:function(d){if(!d.keys)return!1;if(d.keys.length!==this.keys.length)return!1;for(var b=0;b<d.keys.length;b++)if(!d.keys[b].equals(this.keys[b]))return!1;return!0}};return{KeyBinding:k,KeyStroke:k,
KeySequence:i}});
define("orion/webui/dropdown",["require","orion/webui/littlelib"],function(j,k){function i(d){this._init(d)}i.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 b=this;this._triggerNode.addEventListener("click",function(a){b.toggle()&&k.stop(a)},!1);this._triggerNode.tagName.toLowerCase()===
"span"&&this._triggerNode.addEventListener("keydown",function(a){if(a.keyCode===k.KEY.ENTER||a.keyCode===k.KEY.SPACE)b.toggle(),k.stop(a)},!1);this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},toggle:function(){return this._triggerNode.classList.contains("dropdownTriggerOpen")?this.close():this.open()},open:function(){this._populate&&(this.empty(),this._populate(this._dropdownNode));var d=this.getItems();if(d.length>0){if(!this._hookedAutoDismiss){var b=k.$$(".dropdownSubMenu",
this._dropdownNode);k.addAutoDismiss([this._triggerNode].concat(Array.prototype.slice.call(b)),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),b=k.bounds(this._boundingNode(this._triggerNode));if(d.left+d.width>b.left+b.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=[],b=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(a){a.parentNode.parentNode===b._dropdownNode&&
d.push(a)});return d},empty:function(){var d=this;k.$$array("li",this._dropdownNode).forEach(function(b){b.parentNode===d._dropdownNode&&b.parentNode.removeChild(b)})},_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 b=this.getItems(),a=document.activeElement;if(b.length&&b.length>0&&a){var f=b.indexOf(a);f<0&&(f=b.indexOf(a.parentNode));f>=0&&(d.keyCode===k.KEY.UP&&f>0?(f--,b[f].focus()):d.keyCode===
k.KEY.DOWN&&f<b.length-1?(f++,b[f].focus()):d.keyCode===k.KEY.ENTER||d.keyCode===k.KEY.RIGHT?a.classList.contains("dropdownTrigger")&&a.dropdown&&a.dropdown.open():d.keyCode===k.KEY.LEFT&&a.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),k.stop(d))}}else d.keyCode===k.KEY.ESCAPE&&(this.close(!0),k.stop(d))}};i.prototype.constructor=i;return{Dropdown:i}});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<span class="dropdownArrowDown"></span></button><ul class="dropdownMenu"></ul>'});
define("text!orion/webui/submenutriggerbutton.html",[],function(){return'<li class="dropdownSubMenu"><span class="dropdownTrigger dropdownMenuItem" role="menuitem" tabindex="0">${ButtonText}<span class="dropdownArrowRight"></span></span><ul class="dropdownMenu"></ul></li>'});define("text!orion/webui/checkedmenuitem.html",[],function(){return'<li><label class="dropdownMenuItem"><input class="checkedMenuItem" role="menuitem" type="checkbox" />${ItemText}</label></li>'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(j,k){function i(d){this._init(d)}i.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 b=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",function(a){a.target===b._node&&(b.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(b._node,a.target)&&(b.show(),k.stop(a))},!1);for(var a=0;a<d.length;a++)this._node.addEventListener(d[a],function(a){k.contains(b._node,a.target)&&b.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(b){k.contains(d._tip,b.target)&&(d.hide(),k.stop(b))},!1)},!1)}return this._tip},_positionTip:function(d,b){this._makeTipNode();d==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var a=this._node,f;for(f=k.bounds(a);a&&!f.width&&!f.height;a=a.parentNode)f=
k.bounds(a);var a=k.bounds(this._tipInner),h;switch(d){case "above":h=f.top-a.height-this._tailSize-1;f=f.left-this._tailSize;break;case "below":h=f.top+f.height+this._tailSize+1;f=f.left-this._tailSize;break;case "left":h=f.top-this._tailSize/2;f=f.left-a.width-this._tailSize-1;break;default:h=f.top-this._tailSize/2,f=f.left+f.width+this._tailSize+1}var g=k.bounds(document.documentElement);if(h+a.height>g.height)if(b)h=g.height-a.height-1;else return!1;if(f+a.width>g.width)if(b)f=g.width-a.width-
1;else return!1;if(f<0)if(b)f=4;else return!1;if(h<0)if(b)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=a.width+"px";this._tip.style.top=h+"px";this._tip.style.left=f+"px";this._tip.style.width=a.width+"px";this._tip.style.height=a.height+"px";return!0},contentContainer:function(){this._makeTipNode();
return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){var d=this;if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){for(var b=!1,a=0;!b&&a<d._position.length;)b=d._positionTip(d._position[a]),a++;b||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 b=this;this._timeout=window.setTimeout(function(){b._tip.classList.remove("tooltipShowing");b._tip.removeAttribute("style");b._afterHiding&&b._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}};i.prototype.constructor=i;return{Tooltip:i}});
define("orion/commands","require,orion/util,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip".split(","),function(j,k,i,d,b,a,f,h){function g(c,a){for(var e in a)if(a[e]&&a[e].keyBinding&&a[e].command&&a[e].keyBinding.match(c)){var b=a[e],g=b.keyBinding;if(!g.domScope||i.contains(i.node(g.domScope),c.target)){var m=b.invocation;if(m){var f=b.command;if(f.hrefCallback){i.stop(c);
e=f.hrefCallback.call(m.handler||window,m);e.then?e.then(function(c){window.open(c)}):window.open(e);break}else if(f.onClick||f.callback){i.stop(c);window.setTimeout(function(){(f.onClick||f.callback).call(m.handler||window,m)},0);break}}}}}function c(c,a,e){a.classList.add("commandImage");var b;c.imageClass?c.addImageClassToElement?a.classList.add(c.imageClass):(b=document.createElement("span"),a.appendChild(b),b.classList.add(c.spriteClass),b.classList.add(c.imageClass)):(b=new Image,b.alt=c.name,
b.name=e,b.id=e,b.src=c.image,a.appendChild(b));return b}function e(c,a,e,b,g){this.commandRegistry=g;this.handler=c;this.items=a;this.userData=e;this.command=b;if(b.parameters)this.parameters=b.parameters.makeCopy();this.id=b.id}function l(c){this._init(c)}var n=null,p={};window.document.addEventListener("keydown",function(c){c=c||window.event;if(function(c){if(k.isMac){if(c.metaKey&&!c.altKey)return!c.shiftKey&&!c.ctrlKey&&(c.keyCode===65||c.keyCode===67||c.keyCode===86||c.keyCode===88||c.keyCode===
90)?!0:!1}else{if(c.ctrlKey&&!c.altKey)return!c.shiftKey&&(c.keyCode===65||c.keyCode===67||c.keyCode===86||c.keyCode===88||c.keyCode===90)?!0:!1;if(c.altKey&&!c.ctrlKey)return!1}if(c["char"])return c["char"].length>0;else if(c.charCode||c.keyCode)switch(c=c.charCode||c.keyCode,c){case 8:case 9:case 13:case 46:return!0;default:return c>=32&&c<112||c>123}return!1}(c)){if(c.target.contentEditable==="true")return;var a=c.target.nodeName.toLowerCase();if(a==="input")switch(c.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if(a===
"textarea")return}a={};if(n){var e,b,f;b=Object.keys(p);for(e=0;e<b.length;e++)f=b[e],a[f]=p[f];var m=n();b=Object.keys(m);for(e=0;e<b.length;e++)f=b[e],a[f]=m[f]}else a=p;g(c,a)},!1);e.prototype={collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(c){var a=new e(this.handler,this.items,this.userData,this.command,this.commandRegistry);a.domNode=this.domNode;a.domParent=this.domParent;if(c)a.parameters=c.makeCopy();else if(this.parameters)a.parameters=
this.parameters.makeCopy();return a}};e.prototype.constructor=e;l.prototype={_init:function(c){this.id=c.id;this.name=c.name;this.tooltip=c.tooltip||c.name;this.callback=c.callback;this.hrefCallback=c.hrefCallback;this.choiceCallback=c.choiceCallback;this.image=c.image||j.toUrl("images/none.png");this.imageClass=c.imageClass;this.addImageClassToElement=c.addImageClassToElement;this.spriteClass=c.spriteClass||"commandSprite";this.visibleWhen=c.visibleWhen;this.parameters=c.parameters},populateChoicesMenu:function(c,
a,e,b,g){this.getChoices(a,e,b).forEach(function(e){if(e.name){var b=document.createElement("li");c.appendChild(b);var f=document.createElement("span");f.tabIndex=0;f.role="menuitem";f.classList.add("dropdownMenuItem");var h=document.createTextNode(e.name);f.appendChild(h);b.appendChild(f);f.choice=e;f.addEventListener("click",function(c){c.target.choice&&c.target.choice.callback.call(c.target.choice,a)},!1);f.addEventListener("keydown",function(c){(c.keyCode===i.KEY.ENTER||c.keyCode===i.KEY.SPACE)&&
c.target.choice&&c.target.choice.callback.call(c.target.choice,a)},!1)}else g._generateMenuSeparator(c)})},getChoices:function(c,a,e){return this.choiceCallback?this.choiceCallback.call(a,c,e):null},makeChoiceCallback:function(c,a){return function(e){c.callback&&c.callback.call(c,a,e)}},hasImage:function(){return this.imageClass||this.image!==j.toUrl("images/none.png")}};l.prototype.constructor=l;return{Command:l,CommandInvocation:e,createDropdownMenu:function(a,e,g,f,h,m){a=i.node(a);if(!a)throw"no parent node was specified";
var u=document.createRange();u.selectNode(a);u=u.createContextualFragment(b);i.processTextNodes(u,{ButtonText:e});a.appendChild(u);a=a.lastChild;u=a.previousSibling;f?u.classList.add(f):(u.classList.add("orionButton"),u.classList.add("commandButton"));if(h){if(!m)u.textContent="",u.setAttribute("aria-label",e);c({spriteClass:"commandSprite",imageClass:h},u,e);u.classList.add("orionButton")}u.dropdown=new d.Dropdown({dropdown:a,populate:g});a.dropdown=u.dropdown;return{menuButton:u,menu:a,dropdown:u.dropdown}},
createCheckedMenuItem:function(c,a,e,b){c=i.node(c);if(!c)throw"no parent node was specified";var g=document.createRange();g.selectNode(c);g=g.createContextualFragment(f);i.processTextNodes(g,{ItemText:a});c.appendChild(g);c=i.$(".checkedMenuItem",c.lastChild);c.checked=e;c.addEventListener("change",b,!1)},createCommandItem:function(a,e,b,g,f,m,d){var l,m=m||!e.name&&e.hasImage();if(e.hrefCallback)l=document.createElement("a"),l.id=g,m&&e.hasImage()?c(e,l,g):(l.className="commandLink",l.appendChild(document.createTextNode(e.name))),
d=e.hrefCallback.call(b.handler,b),d.then?d.then(function(c){l.href=c}):l.href=d?d:"#";else{l=document.createElement("button");l.className="orionButton";m?e.hasImage()?(c(e,l,g),e.name&&l.setAttribute("aria-label",e.name)):(l.classList.add("commandButton"),l.classList.add("commandMissingImageButton"),l.appendChild(document.createTextNode(e.name))):(l.classList.add("commandButton"),g=document.createTextNode(e.name),l.appendChild(g));var w=d||e.callback;if(w)e.onClick=w,l.addEventListener("click",function(){w.call(b.handler,
b)},!1)}a.nodeName.toLowerCase()==="ul"?(d=document.createElement("li"),a.appendChild(d),a=d):l.classList.add("commandMargins");a.appendChild(l);if(e.tooltip)l.commandTooltip=new h.Tooltip({node:l,text:e.tooltip,position:["above","below","right","left"]});f&&(p[e.id]={keyBinding:f,command:e,invocation:b});return l},createCommandMenuItem:function(c,a,e,b,g){var m,f=c.dropdown;if(a.hrefCallback)m=document.createElement("a"),m.appendChild(document.createTextNode(a.name)),g=a.hrefCallback.call(e.handler,
e),g.then?g.then(function(c){m.href=c}):m.href=g?g:"#";else{m=document.createElement("span");m.tabIndex=0;m.appendChild(document.createTextNode(a.name));var d=g||a.callback;if(d)a.onClick=d,m.addEventListener("click",function(){f.close(!0);d.call(e.handler,e)},!1)}if(a.tooltip)m.commandTooltip=new h.Tooltip({node:m,text:a.tooltip,position:["right","left","above","below"]});m.className="dropdownMenuItem";m.role="menuitem";g=document.createElement("li");c.appendChild(g);g.appendChild(m);b&&(p[a.id]=
{keyBinding:b,command:a,invocation:e});return m},setKeyBindingProvider:function(c){n=c},localKeyBindings:p,_testMethodProcessKey:g}});
define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib"],function(j,k){function i(b){var a="",f=navigator.platform.indexOf("Mac")!==-1;b.mod1&&(a+=f?"Cmd+":"Ctrl+");b.mod2&&(a+="Shift+");b.mod3&&(a+="Alt+");b.mod4&&f&&(a+="Ctrl+");if(b.alphaKey)return a+b.alphaKey;if(b.type==="keypress")return a+b.keyCode;for(var h in k.KEY)if(typeof(k.KEY[h]==="number")&&k.KEY[h]===b.keyCode)return a+h;var g;switch(b.keyCode){case 59:g=b.mod2?":":";";break;case 61:g=b.mod2?"+":"=";break;case 188:g=
b.mod2?"<":",";break;case 190:g=b.mod2?">":".";break;case 191:g=b.mod2?"?":"/";break;case 192:g=b.mod2?"~":"`";break;case 219:g=b.mod2?"{":"[";break;case 220:g=b.mod2?"|":"\\";break;case 221:g=b.mod2?"}":"]";break;case 222:g=b.mod2?'"':"'"}return g?a+g:b.keyCode>=112&&b.keyCode<=123?a+"F"+(b.keyCode-111):a+String.fromCharCode(b.keyCode)}function d(b){var a=window.navigator.platform.indexOf("Mac")!==-1;return a&&b.metaKey||!a&&b.ctrlKey}return{getUserKeyString:function(b){for(var a="",b=b.getKeys(),
f=0;f<b.length;f++)f!==0&&(a+=" "),a+=i(b[f]);return a},getUserText:function(b,a,f,h,g,c,e,d,n){var p=!1,e=function(e){return function(d){if(!p){var l=k.node(b),o=l.value;if(l)if(e&&d.keyCode===k.KEY.ESCAPE){if(f)a.style.display="inline";p=!0;l.parentNode.removeChild(l);c&&c()}else if(!(e&&d.keyCode!==k.KEY.ENTER)){if(o.length===0||!n&&o===h){if(f)a.style.display="inline"}else g(o);p=!0;l.parentNode&&l.parentNode.removeChild(l);c&&c()}}}},o=document.createElement("input");o.id=b;o.value=h||"";a.parentNode.insertBefore(o,
a.nextSibling);o.classList.add("userEditBoxPrompt");if(f)a.style.display="none";o.addEventListener("keydown",e(!0),!1);o.addEventListener("blur",e(!1),!1);window.setTimeout(function(){o.focus();if(h){var c=k.node(b),a=d?h.indexOf(d):-1;if(a>0)if(c.createTextRange)c=c.createTextRange(),c.collapse(!0),c.moveStart("character",0),c.moveEnd("character",a),c.select();else if(c.setSelectionRange)c.setSelectionRange(0,a);else{if(c.selectionStart!==void 0)c.selectionStart=0,c.selectionEnd=a}else c.select()}},
0)},openInNewWindow:d,followLink:function(b,a){a&&d(a)?window.open(b):window.location=b},createButton:function(b,a){var f=document.createElement("button");f.className="orionButton commandButton commandMargins";f.addEventListener("click",function(b){a();k.stop(b)},!1);b&&f.appendChild(document.createTextNode(b));return f},createDropdownButton:function(){}}});
define("orion/PageUtil",[],function(){var j=/^(?:[a-zA-Z0-9-_.!~*'()#;,\/?:@&=+$\[\]]|%[0-9A-F][0-9A-F])*$/,k=/^http[s]?/i;return{matchResourceParameters:function(i){var i=i||window.location.toString(),d={resource:""},b=i.indexOf("#");if(b!==-1&&(i=i.substring(b+1),i.length!==0)){i=i.split(",");Object.defineProperty(d,"resourceRaw",{value:i[0]});d.resource=decodeURIComponent(i[0]);if(!d.resource.match(j))d.resource=encodeURI(d.resource).replace(/%5B/g,"[").replace(/%5D/g,"]");for(b=1;b<i.length;b++){var a=
/([^=]*)(=?)(.*)/.exec(i[b]),f=decodeURIComponent(a[1]||""),a=decodeURIComponent(a[3]||"");f!==""&&f!=="resource"&&(d[f]=a)}}return d},validateURLScheme:function(i,d){var b=i;if(i.indexOf("://")===-1){var a=document.createElement("a");a.href=i;b=a.href}a=!1;return(a=d?d.some(function(a){return RegExp("^"+a+":","i").test(b)}):k.test(b))?i:(console.log("Illegal URL Scheme: '"+i+"'"),"")}}});
define("orion/explorers/navigationUtils",[],function(){function j(i,d){if(!k&&i)i.push({domNode:d}),d.tabIndex=-1,d.style.outline="none"}var k=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(i,d,b){i&&(i=i.getGridNavHolder(d,!0))&&j(i,b)},generateNavGrid:j,removeNavGrid:function(i,d){if(i)for(var b=0;b<i.length;b++)if(i[b].domNode===d){i.splice(b,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(j,k,i,d,b,a,f,h,g,c,e){function l(c){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(c);this._parameterCollector=
null}function n(c,a){this.token=c;this.parameterName=a}function p(c,a,e,b,m){this.name=c;this.type=a;this.label=e;this.value=b;this.lines=m||1}function o(c,a,e){this._storeParameters(c);this._hasOptionalParameters=a&&a.hasOptionalParameters;this._options=a;this.optionsRequested=!1;this.getParameters=e;this.clientCollect=a&&a.clientCollect}l.prototype={_init:function(c){this._selectionService=c.selection;var a=this;k.setKeyBindingProvider(function(){return a._activeBindings})},processURL:function(c){for(var a in this._urlBindings)if(this._urlBindings[a]&&
this._urlBindings[a].urlBinding&&this._urlBindings[a].command){var e=this._urlBindings[a].urlBinding.match(c);if(e){var b=this._urlBindings[a],m=b.command,g=b.invocation;if(g&&g.parameters&&m.callback){g.parameters.setValue(e.parameterName,e.parameterValue);var f=this;window.setTimeout(function(){f._invoke(g)},0);break}}}},findCommand:function(c){return this._commandList[c]},runCommand:function(c,a,e,b){a?(c=this._commandList[c])&&(c.visibleWhen?c.visibleWhen(a):1)&&c.callback&&this._invoke(new k.CommandInvocation(e,
a,null,c,this),b):(a=this._urlBindings[c])&&a.command&&a.command.callback&&this._invoke(a.invocation,b)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(c){this._parameterCollector=c},openParameterCollector:function(c,a,e){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(c,a,e))},confirm:function(c,a,e,b,m,g){var f=!1;if(this._parameterCollector&&!m){var h=this;this._parameterCollector.close();if(this._parameterCollector.open(c,
function(c,m){var g=document.createElement("span");g.classList.add("parameterPrompt");g.textContent=a;c.appendChild(g);g=document.createElement("button");g.addEventListener("click",function(){f=!0;h._parameterCollector.close()},!1);m.appendChild(g);g.appendChild(document.createTextNode(e));g.className="dismissButton";var d=document.createElement("button");d.addEventListener("click",function(){f=!1;h._parameterCollector.close()},!1);m.appendChild(d);d.appendChild(document.createTextNode(b));d.className=
"dismissButton";return g},function(){g(f)}))return}f=window.confirm(a);g(f)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(c,a){return this._collectAndInvoke(c.makeCopy(a),!1)},_collectAndInvoke:function(a,e){if(a)if(this._parameterCollector&&a.parameters&&a.parameters.hasParameters()&&(e||a.parameters.shouldCollectParameters())){var b=!1;a.parameters.updateParameters(a);
if(a.parameters.shouldCollectParameters()&&(b=this._parameterCollector.collectParameters(a),!b)){var g=new c.Tooltip({node:a.domNode,trigger:"click",position:["below","right","above","left"]}),b=g.contentContainer();b.classList.add("parameterPopup");var m=window.document.activeElement,f=this._parameterCollector.getFillFunction(a,function(){m&&m.focus();g.destroy()})(b);g.show();window.setTimeout(function(){f.focus();f.select()},0);b=!0}b||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(c){this._collectAndInvoke(c,!0)},showKeyBindings:function(c){function a(c){var e=c.invocation;if(e)if(c=c.command,c.hrefCallback)e=c.hrefCallback.call(e.handler||window,e),e.then?e.then(function(c){window.open(c)}):window.open(e);else if(c.onClick||c.callback)(c.onClick||c.callback).call(e.handler||window,e)}function e(c){return function(){a(c)}}var b=
{},m,g,f=[],h;for(h in this._activeBindings)(g=this._activeBindings[h])&&g.keyBinding&&g.command&&f.push(g);f.sort(function(c,a){return c.command.name.localeCompare(a.command.name)});for(h=0;h<f.length;h++)g=f[h],g.keyBinding.scopeName?(b[g.keyBinding.scopeName]||(b[g.keyBinding.scopeName]=[]),b[g.keyBinding.scopeName].push(g)):(m=i.getUserKeyString(g.keyBinding),c.createItem(m,g.command.name,e(g)));for(var d in b)b[d].length&&b[d].length>0&&(c.createHeader(d),b[d].forEach(function(a){m=i.getUserKeyString(a.keyBinding);
c.createItem(m,a.command.name,e(a))}))},addCommand:function(c){this._commandList[c.id]=c;var a=this._pendingBindings[c.id];if(a){var e=this;a.forEach(function(a){e._addBinding(c,a.type,a.binding,a.bindingOnly)});delete this._pendingBindings[c.id]}},addCommandGroup:function(c,a,e,b,m,g,f,h){this._contributionsByScopeId[c]||(this._contributionsByScopeId[c]={});c=this._contributionsByScopeId[c];m&&(c=this._createEntryForPath(c,m));if(c[a]){if(b)c[a].title=b;if(e)c[a].position=e;if(f)c[a].imageClass=
f;if(h)c[a].tooltip=h;c[a].emptyGroupMessage=g}else c[a]={title:b,position:e,emptyGroupMessage:g,imageClass:f,tooltip:h,children:{}},c.sortedContributions=null},_createEntryForPath:function(c,a){a&&a.split("/").forEach(function(a){if(a.length>1)c[a]||(c[a]={position:0,children:{}}),c=c[a].children});return c},registerSelectionService:function(c,a){this._contributionsByScopeId[c]||(this._contributionsByScopeId[c]={});this._contributionsByScopeId[c].localSelectionService=a},registerCommandContribution:function(c,
a,e,b,m,g,f){this._contributionsByScopeId[c]||(this._contributionsByScopeId[c]={});c=this._contributionsByScopeId[c];b&&(c=this._createEntryForPath(c,b));c[a]={position:e};g&&((e=this._commandList[a])?this._addBinding(e,"key",g,m):this._addPendingBinding(a,"key",g,m));f&&((e=this._commandList[a])?this._addBinding(e,"url",f,m):this._addPendingBinding(a,"url",f,m));c.sortedContributions=null},_addBinding:function(c,a,e,b){if(!c.id)throw Error("No command id: "+c);a==="key"?this._activeBindings[c.id]=
{command:c,keyBinding:e,bindingOnly:b}:a==="url"&&(this._urlBindings[c.id]={command:c,urlBinding:e,bindingOnly:b})},_addPendingBinding:function(c,a,e,b){this._pendingBindings[c]=this._pendingBindings[c]||[];this._pendingBindings[c].push({type:a,binding:e,bindingOnly:b})},_checkForTrailingSeparator:function(c,a,e){var g;if(a==="tool"||a==="button")if((g=c.childNodes.length>0?c.childNodes[c.childNodes.length-1]:null)&&g.classList.contains("commandSeparator"))return e?(c.removeChild(g),!1):!0;if(a===
"menu"&&(c=b.$$array("li > *",c),c.length>0&&c[c.length-1].classList.contains("dropdownSeparator")))if(g=c[c.length-1],e)g.parentNode.parentNode.removeChild(g.parentNode);else return!0;return!1},renderCommands:function(c,a,e,g,m,f,h){if(typeof c!=="string")throw"a scope id for rendering must be specified";a=b.node(a);if(!a)throw"no parent";var d=this._contributionsByScopeId[c];if(!e&&d){var e=d.localSelectionService||this._selectionService,l=this;e&&e.getSelections(function(e){l.renderCommands(c,
a,e,g,m,f)})}else d&&(this._render(this._contributionsByScopeId[c],a,e,g,m||"button",f,h),this._checkForTrailingSeparator(a,m,!0))},destroy:function(c){c=b.node(c);if(!c)throw"no parent";for(;c.hasChildNodes();){var a=c.firstChild;a.commandTooltip&&a.commandTooltip.destroy();a.emptyGroupTooltip&&a.emptyGroupTooltip.destroy();this.destroy(a);c.removeChild(a)}},_render:function(a,b,g,f,m,h,d){var l=a.sortedContributions;if(!l){var l=[],n=!1,p;for(p in a)if(!a.hasOwnProperty||a.hasOwnProperty(p)){var o=
a[p];if(o&&typeof o.position==="number")o.id=p,l.push(o),n=!0}if(n)l.sort(function(c,a){return c.position-a.position}),a.sortedContributions=l}var i=0,j=this;l.forEach(function(a){var l,w;if(!a.imageClass)a.imageClass=null;if(a.children&&Object.getOwnPropertyNames(a.children).length>0){l=a.children;var n;if(m==="tool"||m==="button")if(a.title)n=j._createDropdownMenu(b,a.title,null,null,a.imageClass,a.tooltip),d&&e.generateNavGrid(d,n.menuButton),window.setTimeout(function(){j._render(a.children,n.menu,
g,f,"menu",h,d);j._checkForTrailingSeparator(n.menu,"menu",!0);if(n.menu.childNodes.length===0)if(a.emptyGroupMessage){if(!n.menuButton.emptyGroupTooltip)n.menuButton.emptyGroupTooltip=new c.Tooltip({node:n.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})}else d&&e.removeNavGrid(d,n.menuButton),n.menu.parentNode&&n.menu.parentNode.removeChild(n.menu),n.destroyButton&&n.destroyButton.parentNode&&n.destroyButton.parentNode.removeChild(n.destroyButton);
else n.menuButton.style.visibility="visible"},0);else{var p;b.childNodes.length>0&&!j._checkForTrailingSeparator(b,m)&&(p=j.generateSeparatorImage(b));j._render(l,b,g,f,m,h,d);b.childNodes.length>0&&b.childNodes[b.childNodes.length-1]!==p&&(p=j.generateSeparatorImage(b))}else if(a.title){if(p=j._createDropdownMenu(b,a.title,!0,null,null,a.imageClass))j._render(l,p.menu,g,f,"menu",h,d),p.menu.childNodes.length===0&&p.destroyButton&&b.removeChild(p.destroyButton)}else b.childNodes.length>0&&j._generateMenuSeparator(b),
j._render(l,b,g,f,m,h,d),j._generateMenuSeparator(b)}else{var v=j._commandList[a.id];l=v?!0:!1;var o=null,o=null;if(v){w=new k.CommandInvocation(f,g,h,v,j);w.domParent=b;p=l&&(v.visibleWhen?v.visibleWhen(g):!0);if(j._activeBindings[v.id]&&j._activeBindings[v.id].keyBinding)o=j._activeBindings[v.id],o.invocation=p?w:null,o.bindingOnly&&(l=!1);if(j._urlBindings[v.id]&&j._urlBindings[v.id].urlBinding)o=j._urlBindings[v.id],o.invocation=p?w:null,o.bindingOnly&&(l=!1);l=l&&p}if(l)v.choiceCallback?(m===
"tool"||m==="button"?(l=b,p=!1,b.nodeName.toLowerCase()==="ul"&&(l=document.createElement("li"),b.appendChild(l))):(l=b,p=!0),j._createDropdownMenu(l,v.name,p,function(c){v.populateChoicesMenu(c,g,f,h,j)}.bind(v),v.imageClass,v.tooltip||v.title)):(w.handler=w.handler||this,w.domParent=b,p=function(){j._invoke(w)},m==="menu"?l=k.createCommandMenuItem(b,v,w,null,p):(l=m+v.id+i,l=k.createCommandItem(b,v,w,l,null,m==="tool",p)),e.generateNavGrid(d,l),w.domNode=l,i++)}})},_createDropdownMenu:function(e,
g,f,d,m,l){e=b.node(e);if(!e||!b.contains(document.body,e))return null;var n,w=e;if(f)l=document.createRange(),l.selectNode(e),l=l.createContextualFragment(h),b.processTextNodes(l,{ButtonText:g}),e.appendChild(l),n=e.lastChild,e=n.lastChild,g=e.previousSibling,g.dropdown=new a.Dropdown({dropdown:e,populate:d}),e.dropdown=g.dropdown;else if(e.nodeName.toLowerCase()==="ul"&&(w=document.createElement("li"),e.appendChild(w),n=w),e=null,m&&(e="dropdownButtonWithIcon",l=l||g),l=m?l||g:l,d=k.createDropdownMenu(w,
g,d,e,m),g=d.menuButton,e=d.menu,l)g.commandTooltip=new c.Tooltip({node:g,text:l,position:["above","below","right","left"]});return{menuButton:g,menu:e,dropdown:g.dropdown,destroyButton:n}},_generateMenuSeparator:function(c){if(!this._checkForTrailingSeparator(c,"menu")){var a=document.createElement("li");a.classList.add("dropdownSeparator");var e=document.createElement("span");e.classList.add("dropdownSeparator");a.appendChild(e);c.appendChild(a)}},generateSeparatorImage:function(c){var a;a=c.nodeName.toLowerCase()===
"ul"?document.createElement("li"):document.createElement("span");c.appendChild(a);a.classList.add("core-sprite-sep");a.classList.add("imageSprite");a.classList.add("commandSeparator");return a}};l.prototype.constructor=l;n.prototype={match:function(c){c=d.matchResourceParameters(c);return typeof c[this.token]!=="undefined"?(this.parameterValue=c[this.token],this):null}};n.prototype.constructor=n;p.prototype={optionsRequested:function(){return this.optionsRequested}};p.prototype.constructor=p;o.prototype=
{_storeParameters:function(c){this.parameterTable=null;if(c){var a=this.parameterTable={};c.forEach(function(c){a[c.name]=c})}},updateParameters:function(c){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(c))},hasParameters:function(){return this.parameterTable!==null},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(c){return this.parameterTable[c]},valueFor:function(c){return(c=this.parameterTable[c])?c.value:
null},setValue:function(c,a){var e=this.parameterTable[c];if(e)e.value=a},forEach:function(c){for(var a in this.parameterTable)this.parameterTable[a].type&&this.parameterTable[a].name&&c(this.parameterTable[a])},makeCopy:function(){var c=[];this.forEach(function(a){a=new p(a.name,a.type,a.label,a.value,a.lines);c.push(a)});var a=new o(c,this._options,this.getParameters);a.clientCollect=this.clientCollect;return a},hasOptionalParameters:function(){return this._hasOptionalParameters}};o.prototype.constructor=
o;return{CommandRegistry:l,URLBinding:n,ParametersDescription:o,CommandParameter:p}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(j,k,i){function d(b,a){this._activeContainer=null;this._getElementsFunction=b;this._toolbarLayoutFunction=a}d.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&i.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&i.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();if(this._oldFocusNode)this._oldFocusNode.focus(),this._oldFocusNode=null}this._activeElements=null},open:function(b,a,f){typeof b==="string"&&(b=i.node(b));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===b)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(b))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=f;var h=a(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!h)return!1;this._activeElements.focusNode=h;b=i.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(b.length===0){a=this._activeElements.dismissArea||
this._activeElements.parameterArea;b=document.createElement("button");b.id="closebox";b.className="imageSprite core-sprite-close dismissButton";b.title=j.Close;a.appendChild(b);var g=this;b.addEventListener("click",function(){g.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(b,a){i.$$array("input",a).forEach(function(a){a.type==="checkbox"?b.parameters.setValue(a.parameterName,a.checked):a.type!=="button"&&b.parameters.setValue(a.parameterName,a.value.trim())});i.$$array("textArea",a).forEach(function(a){b.parameters.setValue(a.parameterName,a.value.trim())});b.command.callback&&b.command.callback.call(b.handler,b)},collectParameters:function(b){return b.parameters?
(b.domNode&&b.domNode.classList.add("commandMarker"),this.open(b.domNode||b.domParent,this.getFillFunction(b))):!1},getFillFunction:function(b,a){var f=this;return function(h,g){var c=null,e=function(){a&&a();f.close()},d=function(c){c.keyCode===i.KEY.ENTER&&f._collectAndCall(b,h);if(c.keyCode===i.KEY.ESCAPE||c.keyCode===i.KEY.ENTER)e(),i.stop(c)};b.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 g=a.name+"parameterCollector",f=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=g,f.appendChild(b),d=function(c){c.keyCode===i.KEY.ESCAPE&&(e(),i.stop(c))};else if(a.type==="boolean"){if(b=document.createElement("input"),b.type="checkbox",b.id=g,f.appendChild(b),a.value)b.checked=!0}else if(b=document.createElement("input"),b.type=a.type,b.id=g,
f.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;c||(c=b);b.addEventListener("keydown",d,!1)});var n=g;if(!n)n=document.createElement("span"),n.className="layoutRight parametersDismiss",h.appendChild(n);var p=function(c,a){var e=document.createElement("button");a.appendChild(e);c&&e.appendChild(document.createTextNode(c));e.classList.add("dismissButton");return e};
if(b.parameters.hasOptionalParameters())b.parameters.optionsRequested=!1,p(j.More,n).addEventListener("click",function(){b.parameters.optionsRequested=!0;f._collectAndCall(b,h);e()},!1);p(j.Submit,n).addEventListener("click",function(){f._collectAndCall(b,h);e()},!1);n=p(null,n);n.id="closebox";n.classList.add("imageSprite");n.classList.add("core-sprite-close");n.title=j.Close;n.addEventListener("click",function(){e()},!1);return c}}};d.prototype.constructor=d;return{CommandParameterCollector:d}});
define("orion/editor/regex",[],function(){return{escape:function(j){return j.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(j){return(j=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(j))?{pattern:j[1],flags:j[2]}:null}}});
define("orion/contentTypes",[],function(){function j(a,b){function h(c,a,e,b){var e=a.filename.indexOf(e)>=0,g=a.extension.indexOf(b)>=0;if(e||g)if(!c||e&&c.extension.indexOf(b)>=0)return a;return c}for(var g=a&&a.split(".").pop(),c=null,e=0;e<b.length;e++){var d=b[e];h(c,d,a,g)===d&&(c=d)}return c}function k(a){this.serviceRegistry=a;this.map=function(a){function h(c){return c===null||typeof c==="undefined"?[]:c instanceof Array?c:[c]}for(var a=a.getServiceReferences(d).concat(a.getServiceReferences(b)),
g={},c=0;c<a.length;c++)for(var e=h(a[c].getProperty("contentTypes")),l=0;l<e.length;l++){var n=e[l];g[n.id]||(g[n.id]={id:n.id,name:n.name,image:n.image,"extends":n["extends"],extension:h(n.extension),filename:h(n.filename)})}return g}(a);a.registerService(i,this)}var i="orion.core.contenttypes",d="orion.core.contenttype",b="orion.file.contenttype";k.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),b=[],h;for(h in a)a.hasOwnProperty(h)&&b.push(a[h]);return b},getContentTypesMap:function(){return this.map},
getFileContentType:function(a){return j(a.Name,this.getContentTypes())},getFilenameContentType:function(a){return j(a,this.getContentTypes())},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,b){a=typeof a==="string"?this.getContentType(a):a;b=typeof b==="string"?this.getContentType(b):b;if(!a||!b)return!1;if(a.id===b.id)return!0;else for(var h=a,g={};h&&(h=this.getContentType(h["extends"]));){if(h.id===b.id)return!0;if(g[h.id])throw Error("Cycle: "+h.id);g[h.id]=!0}return!1},
isSomeExtensionOf:function(a,b){for(var h=0;h<b.length;h++)if(this.isExtensionOf(a,b[h]))return!0;return!1}};return{ContentTypeService:k,getFilenameContentType:j}});
define("orion/URITemplate",[],function(){function j(a){this._text=a}function k(a,c){if(c==="U")return encodeURIComponent(a).replace(/[!'()*]/g,function(c){return"%"+c.charCodeAt(0).toString(16).toUpperCase()});if(c==="U+R")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]");if(c==="U+R-,")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+c);}function i(a,c,e){for(var b=[],f=0;f<a.length;f++)typeof a[f]!=="undefined"&&
b.push(k(a[f],c));return b.join(e)}function d(a,c,e,b){for(var f=Object.keys(a),h=[],d=0;d<f.length;d++)typeof a[f[d]]!=="undefined"&&h.push(k(f[d],c)+e+k(a[f[d]],c));return h.join(b)}function b(a){if(a.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=f[a[0]])?a=a.substring(1):this._operator=f.NUL;for(var c=[],e=a.split(","),b=0;b<e.length;b++){var d=e[b].match(h);if(d===null)throw Error("Bad VarSpec: "+a);c.push({name:d[1],explode:!!d[2],prefix:d[3]?parseInt(d[3],
10):-1})}this._varSpecList=c}function a(a){for(var c=[],e=0,f=a.indexOf("{",e);f!==-1;){c.push(new j(a.substring(e,f)));e=a.indexOf("}",f+1);if(e===-1)throw Error("Invalid template: "+a);c.push(new b(a.substring(f+1,e)));e+=1;f=a.indexOf("{",e)}c.push(new j(a.substring(e)));this._templateComponents=c}var f={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]+))?$/;j.prototype={expand:function(){return encodeURI(this._text)}};b.prototype={expand:function(a){for(var c=[],e=
0;e<this._varSpecList.length;e++){var b=this._varSpecList[e],f=b.name,h=a[f],o=typeof h;if(o!=="undefined"&&h!==null){var j=c.length===0?this._operator.first:this._operator.sep;if(o==="string")this._operator.named&&(j+=k(f,"U+R"),j+=h.length===0?this._operator.ifemp:"="),b.prefix!==-1&&b.prefix<h.length&&(h=h.substring(0,b.prefix)),j+=k(h,this._operator.allow);else if(Array.isArray(h))b.explode?j+=i(h,this._operator.allow,this._operator.sep):(this._operator.named&&(j+=k(f,"U+R"),j+=h.length===0?this._operator.ifemp:
"="),j+=i(h,this._operator.allow,","));else if(o==="object")b.explode?j+=d(h,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(j+=k(f,"U+R"),j+=Object.keys(h).length===0?this._operator.ifemp:"="),j+=d(h,this._operator.allow,",",","));else throw Error("bad param type: "+f+" : "+o);c.push(j)}}return c.join("")}};a.prototype={expand:function(a){for(var c=[],e=0;e<this._templateComponents.length;e++)c.push(this._templateComponents[e].expand(a));return c.join("")}};return a});
define("orion/i18nUtil",["require","orion/Deferred"],function(j,k){function i(b){if(b=localStorage.getItem("orion/messageBundle/"+b))if(b=JSON.parse(b),b._expires&&b._expires>(new Date).getTime())return delete b._expires,b;return null}var d={};return{getMessageBundle:function(b){function a(){j(["i18n!"+b],function(c){if(c){var a=b;c._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+a,JSON.stringify(c));delete c._expires}f.resolve(c)})}if(d[b])return d[b];var f=new k;d[b]=
f;var h=i(b);if(h)return f.resolve(h),f;try{j([b],a)}catch(g){j(["orion/i18n!"+b],a)}return f},formatMessage:function(b){var a=arguments;return b.replace(/\$\{([^\}]+)\}/g,function(b,h){return a[(h<<0)+1]})}}});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/URL-shim".split(","),function(j,k,i,d,b){function a(){return(new URL(j.toUrl("orion/../"),window.location.href)).href.slice(0,-1)}function f(f,g){var c=f.getServiceReferences(g||"orion.page.link"),e=i.matchResourceParameters(window.location.href),l={OrionHome:a(),Location:e.resource},n=[];c.forEach(function(c){var a={};c.getPropertyKeys().forEach(function(e){a[e]=c.getProperty(e)});if(a.uriTemplate&&
a.nls&&(a.name||a.nameKey)){var e=new k;b.getMessageBundle(a.nls).then(function(c){var b=new d(a.uriTemplate),b=window.decodeURIComponent(b.expand(l)),b=i.validateURLScheme(b);a.href=b;a.textContent=a.nameKey?c[a.nameKey]:a.name;e.resolve(a)});n.push(e)}else if(a.uriTemplate&&a.name){var g=new d(a.uriTemplate),g=window.decodeURIComponent(g.expand(l)),g=i.validateURLScheme(g);a.href=g;a.textContent=a.name;n.push((new k).resolve(a))}});return k.all(n)}return{createPageLinks:function(a,b){return f(a,
b).then(function(c){c.sort(function(c,a){var b=c.textContent&&c.textContent.toLowerCase(),g=a.textContent&&a.textContent.toLowerCase();return b<g?-1:b>g?1:0});return c.map(function(c){var a=c.href,c=c.textContent,b=document.createElement("a");b.href=a;b.target="_self";b.classList.add("targetSelector");b.textContent=c;return b})})},getPageLinksInfo:f,getOrionHome:a}});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/editor/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks".split(","),function(j,k,i,d,b,a,f,h,g){var c={},e=g.getOrionHome();c._cloneItemWithoutChildren=function p(c){if(c===null||typeof c!=="object")return c;var a=c.constructor(),e;for(e in c)e!=="children"&&e!=="Children"&&(a[e]=p(c[e]));return a};c._getOpenWithNavCommandExtensions=function(c){function a(c,e){for(var b=c.getServiceReferences("orion.navigate.openWith"),
m=[],g=0;g<b.length;g++){var f=b[g];f.getProperty("editor")===e.id&&(f=f.getProperty("contentType"),f instanceof Array?m=m.concat(f):f!==null&&typeof f!=="undefined"&&m.push(f))}return m}for(var e=function(){for(var a=c.getServiceReferences("orion.edit.editor"),e=[],b=0;b<a.length;b++){var m=a[b],g=m.getProperty("id");e.push({id:g,name:m.getProperty("name"),nameKey:m.getProperty("nameKey"),nls:m.getProperty("nls"),uriTemplate:m.getProperty("orionTemplate")||m.getProperty("uriTemplate")})}return e}(),
b=function(c){for(c=c.getServiceReferences("orion.navigate.openWith.default");0<c.length;)return{editor:c[0].getProperty("editor")};return null}(c),g=[],f=0;f<e.length;f++){var m=e[f],h=b&&b.editor===m.id,d=a(c,m);d.length&&g.push({properties:{name:m.name||m.id,nameKey:m.nameKey,id:"eclipse.openWithCommand."+m.id,tooltip:m.name,tooltipKey:m.nameKey,contentType:d,uriTemplate:m.uriTemplate,nls:m.nls,forceSingleItem:!0,isEditor:h?"default":"editor"},service:{}})}return g};c._makeValidator=function(c,
g,f,h){function d(c,a,e,b){var g=e.match,f;if(a.indexOf("|")>=0)return f=a.substring(0,a.indexOf("|")),a=a.substring(a.indexOf("|")+1),d(c,f,e,b)?!0:d(c,a,e,b);else if(a.indexOf(":")>=0)return f=a.substring(0,a.indexOf(":")),a=a.substring(a.indexOf(":")+1),c[f]?d(c[f],a,e,b):!1;else{a:{f=!1;var h;if(typeof c[a]!=="undefined"){if(typeof g==="undefined")h=c[a],f=!0;else if(typeof g==="string"){if(!typeof(c[a]==="string")){e=!1;break a}if(e.variableName){if(g=RegExp(g).exec(c[a]))f=g[0],h=e.variableMatchPosition===
"before"?c[a].substring(0,g.index):e.variableMatchPosition==="after"?c[a].substring(g.index+f.length):e.variableMatchPosition==="only"?f:c[a],f=!0}else{e=RegExp(g).test(c[a]);break a}}else c[a]===g&&(h=c[a],f=!0);if(f&&e.variableName&&(b[e.variableName]=h,b.itemCached=c,e.replacements))for(c=0;c<e.replacements.length;c++)a=!1,e.replacements[c].pattern?b[e.variableName]=b[e.variableName].replace(RegExp(e.replacements[c].pattern),e.replacements[c].replacement||""):a=!0,a&&window.console.log("Invalid replacements specified in validation property.  "+
e.replacements[c]);e=f}else e=!1}return e}}return{info:c,validationFunction:function(a){typeof h==="function"&&(a=h.call(this,a));if(a){if(Array.isArray(a)){if((this.info.forceSingleItem||this.info.uriTemplate)&&a.length!==1)return!1;if(a.length<1)return!1}else a=[a];for(var e=0;e<a.length;e++){var g;a:{var l=a[e],w=f;if(this.info.validationProperties)for(g=0;g<this.info.validationProperties.length;g++){var v=this.info.validationProperties[g];if(typeof v.source!=="undefined"){if(!d(l,v.source,v,this)){g=
!1;break a}}else{window.console.log("Invalid validationProperties in "+c.id+".  No source property specified.");g=!1;break a}}if(this.info.contentType&&w){v=!1;if(l=b.getFilenameContentType(l.Name,w))for(g=0;g<this.info.contentType.length;g++)if(l.id===this.info.contentType[g]){v=!0;break}g=v}else g=!0}if(!g)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(c){if(this.info.uriTemplate){var b={},g;for(g in c)c.hasOwnProperty(g)&&(b[g]=c[g]);if(this.info.validationProperties)for(g=
0;g<this.info.validationProperties.length;g++){var f=this.info.validationProperties[g];f.source&&f.variableName&&(this.itemCached===c&&this[f.variableName]||d(c,f.source,f,this),c[f.variableName]?window.console.log("Variable name "+f.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):b[f.variableName]=this[f.variableName])}b.OrionHome=e;c=new a(this.info.uriTemplate);return window.decodeURIComponent(c.expand(b))}return null}}};c._createCommandOptions=
function(a,e,b,g,h,d){function m(m,f){var l=c._makeValidator(a,b,g,d);m.visibleWhen=l.validationFunction.bind(l);if(h)if(l.generatesURI.bind(l)())m.hrefCallback=function(c){c=Array.isArray(c.items)?c.items[0]:c.items;return l.getURI.bind(l)(c)};else{var u=a;m.callback=function(a){var g;if(u.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,g=c._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){g=[];for(var f=0;f<a.items.length;f++)g.push(c._cloneItemWithoutChildren(a.items[f]))}else g=
c._cloneItemWithoutChildren(a.items);if(b)var h=b.getService("orion.page.progress");e.run?h?h.progress(e.run(g),"Running command: "+m.name):e.run(g):b&&(h?h.progress(b.getService(e).run(g),"Running command: "+m.name):b.getService(e).run(g))}}f.resolve(m)}var l=new k;a.nls?f.getMessageBundle(a.nls).then(function(c){m({name:a.nameKey?c[a.nameKey]:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltipKey?c[a.tooltipKey]:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},l)}):m({name:a.name,image:a.image,
id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},l);return l};c.getOpenWithCommands=function(c){var a=[],e;for(e in c._commandList){var b=c._commandList[e];b.isEditor&&a.push(b)}return a};var l;c.createAndPlaceFileCommandsExtension=function(a,e,b,g,f,h){var m=!!h;return c.createFileCommands(a,null,h?"all":void 0,m).then(function(c){e._addedOpenWithCommands=m;var a=!1,h=!1;c.forEach(function(c){e.addCommand(c);f&&!a&&(a=!0,e.addCommandGroup(b,"eclipse.fileCommandExtensions",
1E3,null,f));f&&!h&&(h=!0,e.addCommandGroup(b,"eclipse.openWith",1E3,"Open With",f+"/eclipse.fileCommandExtensions"));this.isEditor?e.registerCommandContribution(b,c.id,g+this.index,f?f+"/eclipse.fileCommandExtensions/eclipse.openWith":null):e.registerCommandContribution(b,c.id,g+this.index,f?f+"/eclipse.fileCommandExtensions":null)});return{}})};c.createFileCommands=function(a,e,b,g){var b=b===void 0?"global":b,g=g===void 0?!0:g,f=a.getServiceReferences("orion.navigate.command"),h=[];if(b==="all"||
b==="global")for(var m=0;m<f.length;m++)if(f[m].getProperty("id")!=="orion.navigateFromMetadata"){for(var d=a.getService(f[m]),z={},w=f[m].getPropertyKeys(),v=0;v<w.length;v++)z[w[v]]=f[m].getProperty(w[v]);(b==="all"||z.forceSingleItem&&z.showGlobally)&&h.push({properties:z,service:d})}return k.when(function(){var c=a.getService("orion.core.contenttypes")||e;return l||k.when(c.getContentTypes(),function(c){return l=c})}(),function(){h=g?h.concat(c._getOpenWithNavCommandExtensions(a,l)):h;var e=h.map(function(e){var b=
e.properties;return c._createCommandOptions(b,e.service,a,l,!0).then(function(c){c=new i.Command(c);if(b.isEditor)c.isEditor=b.isEditor;return c})});return k.all(e,function(c){return{_error:c}}).then(function(c){return c})})};c.createOpenWithCommands=function(a,e,b){return b&&b._addedOpenWithCommands?(new k).resolve(c.getOpenWithCommands(b)):c.createFileCommands(a,e,"none",!0)};return c});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(j,k){function i(d){this._init(d)}i.prototype={_init:function(d){var b=k.node(d.container);if(!b)throw"no parent container";this._container=b;b.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 b=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(d,b):d.href=j.toUrl("navigate/table.html")+"#"+b}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 b=document.createElement("a");b.classList.add("breadcrumb");b.appendChild(document.createTextNode(d));return b},addSegmentHref:function(d,b){this._makeHref?this._makeHref(d,b.Location,b):d.href=j.toUrl("navigate/table.html")+"#"+b.ChildrenLocation},buildSegments:function(d,b){if(this._resource.Parents){var a=this._resource.Parents.slice(0),f,h;a&&(a=a.slice(0),b==="reverse"&&(a=a.reverse().slice(0)),a.forEach(function(a){d?(h=d,d=null):h=a.Name;f=this.buildSegment(h);
this.path+=a.Name;this.addSegmentHref(f,a);f.include=!1;this.segments.push(f)}.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,b){var a=b||document.title;this.crumbs.childNodes.length===0&&(d=document.createElement("span"),d.appendChild(document.createTextNode(a)),d.classList.add("breadcrumb"),d.classList.add("currentLocation"),
this.append(d))},finalSegment:function(d,b){d=document.createElement("span");b?d.appendChild(document.createTextNode(b)):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(b){this.append(b);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?b.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(),b=this._rootSegmentName;
if(b)this.addTitle(d,b);else if(this.finalSegment(d,b),this._resource&&this._resource.Parents&&(this.buildSegments(b,"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(),b=this._rootSegmentName;b?this.addTitle(d,b):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(d),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(d,
b)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};i.prototype.constructor=i;return{BreadCrumbs:i}});
define("orion/webui/splitter",["require","orion/webui/littlelib"],function(j,k){function i(d){this._init(d)}i.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 b=k.bounds(this.$node),a=k.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=b.height;if(d||!this._splitTop)this._splitTop=b.top,localStorage.setItem(this._prefix+
"/yPosition",this._splitTop);d=this._splitTop;this.$node.parentNode.style.position==="relative"&&(d=this._splitTop-a.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=b.width;if(d||!this._splitLeft)this._splitLeft=b.left,localStorage.setItem(this._prefix+"/xPosition",this._splitLeft);d=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(d=this._splitLeft-a.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,b=k.bounds(this.$node.parentNode),a=k.bounds(this.$node);this._vertical?this.$mainNode.style.height=b.height-(a.top-b.top+a.height)+"px":this.$mainNode.style.width=b.width-(a.left-b.left+a.width)+"px";var f=this;window.setTimeout(function(){f._notifyResizeListeners(f.$mainNode)},d);window.setTimeout(function(){f._notifyResizeListeners(f.$sideNode)},
d)},_notifyResizeListeners:function(d){for(var b=0;b<this._resizeListeners.length;b++)this._resizeListeners[b](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 b=k.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=d.clientY;if(this._splitTop<b.top+5)this._splitTop=b.top+5;else if(this._splitTop>b.top+b.height-5)this._splitTop=b.top+b.height-5;var a=this._splitTop;this.$node.parentNode.style.position==="relative"&&(a=this._splitTop-b.top);this.$node.style.top=a+"px"}else{this._splitLeft=d.clientX;if(this._splitLeft<b.left+5)this._splitLeft=b.left+5;else if(this._splitLeft>b.left+b.width-
5)this._splitLeft=b.left+b.width-5;a=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(a=this._splitLeft-b.left);this.$node.style.left=a+"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)}};i.prototype.constructor=i;return{Splitter:i}});
define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(j){return{makeRelative:function(j){if(!j)return j;var i=window.location.protocol+"//"+window.location.host;return j.indexOf(i)===0?j.substring(i.length):j},isAtRoot:function(k){if(!k)return!1;if(k==="/workspace")return!0;var i=new URL(j.toUrl("workspace"),window.location.href);return(new URL(k,window.location.href)).href.indexOf(i.href)===0}}});
define("orion/favorites",["require","orion/fileUtils","orion/EventTarget"],function(j,k,i){function d(b){this._favorites=[];i.attach(this);this._init(b);this._initializeFavorites()}d.prototype={_init:function(b){this._registry=b.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.favorite",this)},_notifyListeners:function(){this.dispatchEvent({type:"favoritesChanged",navigator:this._favorites,registry:this._registry})},makeFavorites:function(b){for(var b=Array.isArray(b)?
b:[b],a=0;a<b.length;a++){var f=b[a],h=f.ChildrenLocation?f.ChildrenLocation:f.Location,h=k.makeRelative(h);this.addFavorite(f.Name,h,f.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(b){this.addFavorite(b,b,!1,!0)},addFavorite:function(b,a,f){this._favorites.push({name:b,path:a,directory:f,isFavorite:!0});this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},removeFavorite:function(b){for(var a in this._favorites)if(this._favorites[a].path===
b){this._favorites.splice(a,1);break}this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},renameFavorite:function(b,a){var f=!1,h;for(h in this._favorites)if(this._favorites[h].path===b){var g=this._favorites[h];if(g.name!==a)g.name=a,f=!0}f&&(this._favorites.sort(this._sorter),this._storeFavorites(),this._notifyListeners())},hasFavorite:function(b){for(var a in this._favorites)if(this._favorites[a].path===b)return!0;return!1},_SPECIAL_CHARS:"^$\\+[]().",queryFavorites:function(b){var a;
if(!b)return this._favorites;var f="";for(a=0;a<b.length;a++){var h=b.charAt(a);f+=h==="*"?".*":h==="?"?".?":this._SPECIAL_CHARS.indexOf(h)>=0?"\\"+h:h}f+=".*";b=RegExp(f);f=[];for(a in this._favorites)this._favorites[a].name.search(b)===0&&f.push(this._favorites[a]);return f},_initializeFavorites:function(){var b=this;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var f,a=a.get("navigate");typeof a==="string"&&(a=JSON.parse(a));if(a)for(f in a)a[f].isFavorite=
!0,b._favorites.push(a[f]);b._favorites.sort(b._sorter);b._notifyListeners()})},_storeFavorites:function(){var b=this._favorites;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("navigate",b)})},_sorter:function(b,a){var f=b.name.toLowerCase(),h=a.name.toLowerCase();return f>h?1:f<h?-1:0},getFavorites:function(){return{navigator:this._favorites}}};d.prototype.constructor=d;return{FavoritesService:d}});
define("orion/widgets/themes/ThemePreferences",[],function(){function j(j,i){this._preferences=j;this._themeData=i;var d=i.getThemeStorageInfo(),b=j.listenForChangedSettings(d.storage,2,function(a){a.key===b&&this.apply()}.bind(this))}j.prototype={_initialize:function(j,i,d){var b=d.get(j.styleset);b||(b=i.getStyles(),d.put(j.styleset,JSON.stringify(b)));(i=d.get("selected"))&&(i=JSON.parse(i));if(!i||i[j.selectedKey]===void 0)i=i||{},i[j.selectedKey]=j.defaultTheme,d.put("selected",JSON.stringify(i))},
apply:function(){this.setTheme()},getTheme:function(j){var i=this._themeData,d=i.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(b){this._initialize(d,i,b);var a=JSON.parse(b.get("selected")),b=JSON.parse(b.get(d.styleset)),f;if(b)for(var h=0;h<b.length;h++)if(b[h].name===a[d.selectedKey]){f=b[h];break}j({style:f,styles:b})}.bind(this))},setTheme:function(j,i){var d=this._themeData,b=d.getThemeStorageInfo();this._preferences.getPreferences(b.storage,2).then(function(a){this._initialize(b,
d,a);var f=JSON.parse(a.get("selected"));j||(j=f[b.selectedKey]);f[b.selectedKey]=j;a.put("selected",JSON.stringify(f));i?a.put(b.styleset,JSON.stringify(i)):i=JSON.parse(a.get(b.styleset));for(a=0;a<i.length;a++)if(i[a].name===f[b.selectedKey]){d.processSettings(i[a]);break}}.bind(this))},setFontSize:function(j){var i=this._themeData,d=i.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(b){this._initialize(d,i,b);var a=JSON.parse(b.get("selected")),f=JSON.parse(b.get(d.styleset)),
h;if(f)for(var g=0;g<f.length;g++)f[g].fontSize=j,f[g].name===a[d.selectedKey]&&(h=f[g]);b.put(d.styleset,JSON.stringify(f));i.processSettings(h)}.bind(this))}};return{ThemePreferences:j}});
define("orion/editor/eventTarget",[],function(){function j(){}j.addMixin=function(k){var i=j.prototype,d;for(d in i)i.hasOwnProperty(d)&&(k[d]=i[d])};j.prototype={addEventListener:function(j,i,d){if(!this._eventTypes)this._eventTypes={};var b=this._eventTypes[j];b||(b=this._eventTypes[j]={level:0,listeners:[]});b.listeners.push({listener:i,useCapture:d})},dispatchEvent:function(j){var i=j.type;this._dispatchEvent("pre"+i,j);this._dispatchEvent(i,j);this._dispatchEvent("post"+i,j)},_dispatchEvent:function(j,
i){var d=this._eventTypes?this._eventTypes[j]:null;if(d){var b=d.listeners;try{if(d.level++,b)for(var a=0,f=b.length;a<f;a++)if(b[a]){var h=b[a].listener;typeof h==="function"?h.call(this,i):h.handleEvent&&typeof h.handleEvent==="function"&&h.handleEvent(i)}}finally{if(d.level--,d.compact&&d.level===0){for(a=b.length-1;a>=0;a--)b[a]||b.splice(a,1);b.length===0&&delete this._eventTypes[j];d.compact=!1}}}},isListening:function(j){return!this._eventTypes?!1:this._eventTypes[j]!==void 0},removeEventListener:function(j,
i,d){if(this._eventTypes){var b=this._eventTypes[j];if(b){for(var a=b.listeners,f=0,h=a.length;f<h;f++){var g=a[f];if(g&&g.listener===i&&g.useCapture===d){b.level!==0?(a[f]=null,b.compact=!0):a.splice(f,1);break}}a.length===0&&delete this._eventTypes[j]}}}};return{EventTarget:j}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(j,k,i){function d(a){a=a||{};this._document=a.document||document}var b={};d.getTheme=function(a){var a=a||"default",f=b[a];f||(f=b[a]=new d);return f};d.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(a,b){var h=this,g=h._themeClass;h._themeClass=a;this._load(a,b,function(){h.onThemeChanged({type:"ThemeChanged",oldValue:g,newValue:h.getThemeClass()})})},onThemeChanged:function(a){return this.dispatchEvent(a)},
buildStyleSheet:function(a,b){function h(c,e,b){e&&(g.push("."+a+" ."+c+" {"),g.push("\t"+(b?"background-color":"color")+": "+e+";"),g.push("}"))}var g=[];g.push("");g.push("."+a+" {");b.fontFamily&&g.push("\tfont-family: "+b.fontFamily+";");b.fontSize&&g.push("\tfont-size: "+b.fontSize+";");b.fontSize&&g.push("\tcolor: "+b.text+";");g.push("}");g.push("."+a+".textview {");b.background&&g.push("\tbackground-color: "+b.background+";");g.push("}");h("ruler.annotations",b.annotationRuler,!0);h("ruler.lines",
b.annotationRuler,!0);h("ruler.folding",b.annotationRuler,!0);h("ruler.overview",b.overviewRuler,!0);h("rulerLines",b.lineNumber,!1);h("rulerLines.even",b.lineNumberEven,!1);h("rulerLines.odd",b.lineNumberOdd,!1);h("annotationLine.currentLine",b.currentLine,!0);h("entity-name-tag",b.keyword,!1);h("entity-other-attribute-name",b.attribute,!1);h("string-quoted",b.string,!1);h("line_caret",b.currentLine,!0);h("token_keyword",b.keyword,!1);h("token_string",b.string,!1);h("token_singleline_comment",b.comment,
!1);h("token_multiline_comment",b.comment,!1);h("token_doc_comment",b.comment,!1);h("token_doc_html_markup",b.comment,!1);return g.join("\n")},_createStyle:function(a,b,h,g){var c=this._document,a="orion-theme-"+a,e=c.getElementById(a);if(e){if(g||e.firstChild.data===b)return;e.removeChild(e.firstChild);e.appendChild(c.createTextNode(b))}else g?(e=i.createElement(c,"link"),e.rel="stylesheet",e.type="text/css",e.href=b,e.addEventListener("load",function(){h()})):(e=i.createElement(c,"style"),e.appendChild(c.createTextNode(b))),
e.id=a,(c.getElementsByTagName("head")[0]||c.documentElement).appendChild(e);g||h()},_load:function(a,b,h){if(a)if(typeof b==="string")this._createStyle(a,b,h);else if(b=b.href,b.substring(b.length-4)!==".css"&&(b+=".css"),/^\//.test(b)||/[a-zA-Z0-9]+:\/\//i.test(b)||!j.toUrl)this._createStyle(a,b,h,!0);else{var g=this;j(["text!"+b],function(c){g._createStyle(a,c,h,!1)})}else h()}};k.EventTarget.addMixin(d.prototype);return{TextTheme:d}});
define("orion/widgets/themes/ThemeClass",[],function(){function j(j){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=j;this.classString="."+j+"{ "}j.prototype.className=null;j.prototype.classString=void 0;j.prototype.style=void 0;j.prototype.closeString=" }\n";j.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:j}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(j){function k(){}k.prototype.navbar="#333";k.prototype.button="#777777";k.prototype.location="#EFEFEF";k.prototype.selection="FEC";k.prototype.sidepanel="#FBFBFB";k.prototype.mainpanel="white";k.prototype.navtext="#bfbfbf";k.prototype.content="#3087B3";k.prototype.search="#444";k.prototype.toolpanel="white";k.prototype.writeNavigationStyle=function(){var i="",d=[],b=new j.ThemeClass("orionPage");
b.style.backgroundColor="#fdfdfd";b.style.width="100%";b.style.height="100%";d.push(b);b=new j.ThemeClass("topRowBanner");b.style.margin="0";b.style.border="0";b.style.backgroundColor=this.navbar;b.style.height="15px";b.style.padding="10px";b.style.paddingRight="3px";d.push(b);b=new j.ThemeClass("a");b.style.textDecoration="none";b.style.color=this.content;d.push(b);b=new j.ThemeClass("navlink");b.style.display="inline-block";b.style.padding="2px";b.style.color=this.content;d.push(b);b=new j.ThemeClass("primaryNav");
b.style.color=this.navtext;b.style.fontSize="8pt";b.style.fontWeight="normal";b.style.paddingTop="0";b.style.verticalAlign="baseline";d.push(b);b=new j.ThemeClass("primaryNav a");b.style.fontSize="8pt";b.style.color=this.navtext;b.style.marginRight="6px";b.style.marginLeft="6px";b.style.verticalAlign="baseline";b.style.textDecoration="none";d.push(b);b=new j.ThemeClass("primaryNav a:hover");b.style.color="#bfbfbf";b.style.cursor="hand";b.style.color="white";b.style.fontWeight="normal";d.push(b);for(var a in d)i+=
d[a].toString();return i};k.prototype.writeLocationStyle=function(){var i="",d=[],b=new j.ThemeClass("titleArea");b.style.margin="0";b.style.paddingTop="5px";b.style.border="0";b.style.background=this.location;b.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.location+"), color-stop(100%,"+this.location+"))";b.style.borderBottom="1px solid "+this.location;b.style.minHeight="20px";d.push(b);b=new j.ThemeClass("breadcrumb");b.style.fontSize="8pt";b.style.textDecoration=
"none";b.style.color="#f1f1f2;";b.style.paddingTop="2px";d.push(b);b=new j.ThemeClass("a.breadcrumb:hover");b.style.textDecoration="none";b.style.borderBottom="1px dotted";b.style.color="#F58B0F";b.style.cursor="pointer";d.push(b);b=new j.ThemeClass("breadcrumbSeparator");b.style.fontSize="8pt";b.style.textDecoration="none";b.style.color="#f1f1f2";b.style.fontWeight="bold";d.push(b);b=new j.ThemeClass("currentLocation");b.style.fontWeight="bold";b.style.fontSize="8pt";b.style.color="#f1f1f2";b.style.textDecoration=
"none";b.style.textWrap="normal";b.style.lineHeight="10pt";d.push(b);b=new j.ThemeClass("a.currentLocation:hover");b.style.fontWeight="bold";b.style.fontSize="10pt";b.style.color="#666666";b.style.textDecoration="none";b.style.borderBottom="0";d.push(b);b=new j.ThemeClass("navlinkonpage");b.style.color=this.content;d.push(b);b=new j.ThemeClass("progressPane_running");b.style.background="url(../images/progress_running_dark.gif) no-repeat center";b.style.width="16px";b.style.height="16px";d.push(b);
for(var a in d)i+=d[a].toString();return i};k.prototype.writeButtonStyle=function(){var i="",d=[],b=new j.ThemeClass("commandButton");b.style.color="#666";b.style.border="1px solid #dedede";b.style.backgroundColor="#ddd";b.style.textAlign="center";b.style.verticalAlign="baseline";b.style.cursor="pointer";b.style.display="inline-block";b.style.padding="5px 6px";b.style.borderRadius="3px";b.style.lineHeight="12px";b.style.fontSize="8pt";b.style.userSelect="none";d.push(b);b=new j.ThemeClass("commandButton:over");
b.style.backgroundColor="#e6e6e6";b.style.border="1px solid #808080";d.push(b);b=new j.ThemeClass("commandMenu");b.style.color="#222";b.style.display="inline-block";b.style.verticalAlign="baseline";b.style.margin="0";b.style.fontSize="8pt";b.style.fontWeight="normal";b.style.border="1px solid #dedede";b.style.backgroundColor="#efefef";b.style.cursor="pointer";b.style.borderRadius="1px";d.push(b);b=new j.ThemeClass("commandMenuItem");b.style.border="0";b.style.padding="0";b.style.margin="0";d.push(b);
for(var a in d)i+=d[a].toString();return i};k.prototype.writeMainStyle=function(){var i="",d=[],b=new j.ThemeClass("searchbox");b.style.backgroundImage="url(../images/core_sprites.png)";b.style.backgroundRepeat="no-repeat";b.style.backgroundPosition="4px -297px";b.style.width="12px";b.style.height="12px";b.style.backgroundColor=this.search;b.style.border="1px solid "+this.search;b.style.fontSize="11px";b.style.width="15em";b.style.height="16px";b.style.borderRadius="10px";b.style.color="#999";b.style.padding=
"0";b.style.paddingLeft="20px";b.style.marginLeft="5px";b.style.marginTop="6px !important";b.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";d.push(b);b=new j.ThemeClass("searchbox:focus");b.style.color="white";b.style.outline="none";d.push(b);b=new j.ThemeClass("checkedRow");b.style.cssText="background-color:"+this.selection+" !important;";d.push(b);b=new j.ThemeClass("navbar-item-selected");b.style.background=this.selection;b.style.color=
this.content;d.push(b);b=new j.ThemeClass("auxpane");b.style.border="0";b.style.background=this.sidepanel;b.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.sidepanel+"), color-stop(100%,"+this.sidepanel+"))";b.style.background="-moz-linear-gradient(top, "+this.sidepanel+" 0%, "+this.sidepanel+" 100%)";d.push(b);b=new j.ThemeClass("mainpane");b.style.background=this.mainpanel;b.style.border=0;d.push(b);b=new j.ThemeClass("mainToolbar");b.style.background=this.toolpanel;
b.style.height="34px";b.style.borderBottom="1px solid #ebebeb";b.style.paddingTop="2px";d.push(b);for(var a in d)i+=d[a].toString();return i};k.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};k.prototype.getSheet=function(i){i.navbar.value?(this.navbar=i.navbar.value,this.button=i.button.value,this.location=i.location.value,this.selection=i.selection.value,this.sidepanel=
i.sidepanel.value,this.mainpanel=i.mainpanel.value,this.navtext=i.navtext.value,this.search=i.search.value,this.content=i.content.value,this.toolpanel=i.toolpanel.value):(this.navbar=i.navbar,this.button=i.button,this.location=i.location,this.selection=i.selection,this.sidepanel=i.sidepanel,this.mainpanel=i.mainpanel,this.navtext=i.navtext,this.search=i.search,this.content=i.content,this.toolpanel=i.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(j,k){function i(){}function d(){this.styles=[];var a=new i;a.name="Orion";a.navbar="#333";a.button="#EFEFEF";a.location="#efefef";a.selection="FEC";a.sidepanel="#FBFBFB";a.mainpanel="white";a.toolpanel="white";a.navtext="#bfbfbf";a.content="#3087B3";a.search="#444";a.breadcrumb="#3087B3";a.separator="#333";this.styles.push(a);a=new i;a.name="Green Zone";a.navbar=
"seagreen";a.button="lavender";a.location="darkseagreen";a.selection="moccasin";a.sidepanel="aliceblue";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="darkgreen";a.search="darkgreen";a.breadcrumb="#3087B3";a.separator="seagreen";this.styles.push(a);a=new i;a.name="Pretty In Pink";a.navbar="plum";a.button="lavender";a.location="pink";a.selection="lavender";a.sidepanel="seashell";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="mediumorchid";a.search="violet";
a.breadcrumb="#3087B3";a.separator="plum";this.styles.push(a);a=new i;a.name="Blue Monday";a.navbar="cornflowerblue";a.button="lavender";a.location="skyblue";a.selection="lavender";a.sidepanel="aliceblue";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="royalblue";a.search="royalblue";a.breadcrumb="#3087B3";a.separator="cornflowerblue";this.styles.push(a);a=new i;a.name="Vanilla Skies";a.navbar="sandybrown";a.button="lemmonchiffon";a.location="cornsilk";a.selection="lemonchiffon";
a.sidepanel="white";a.mainpanel="white";a.toolpanel="white";a.navtext="lemonchiffon";a.content="chocolate";a.search="moccasin";a.breadcrumb="#3087B3";a.separator="sandybrown";this.styles.push(a);a=new i;a.name="Beetlejuice";a.navbar="indigo";a.button="slateblue";a.location="darkslateblue";a.selection="silver";a.sidepanel="lavender";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="mediumslateblue";a.search="#444";a.breadcrumb="#3087B3";a.separator="indigo";this.styles.push(a);
a=new i;a.name="Red";a.navbar="#CD2127";a.button="#777777";a.location="#D85F56";a.selection="lightcoral";a.sidepanel="#EFDAB2";a.mainpanel="#FDFADD";a.toolpanel="#FDFADD";a.navtext="#FBFBFB";a.content="darkred";a.search="#D85F56";a.breadcrumb="darkred";a.separator="#CD2127";this.styles.push(a)}function b(){return this.styles}i.prototype.name="Orion";i.prototype.navbar="#333";i.prototype.button="#EFEFEF";i.prototype.location="#333";i.prototype.breadcrumb="#3087B3";i.prototype.separator="#333";i.prototype.selection=
"FEC";i.prototype.sidepanel="#FBFBFB";i.prototype.mainpanel="white";i.prototype.toolpanel="white";i.prototype.navtext="#bfbfbf";i.prototype.content="#3087B3";i.prototype.search="#444";d.prototype.styles=[];d.prototype.getStyles=b;d.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion",selectedKey:"selected"}};d.prototype.getViewData=function(){for(var a={top:10,left:10,width:350,height:350,shapes:[{type:"RECTANGLE",name:"Navigation Bar",x:10,y:10,
width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:"Navigation Text",label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:"Search Box",x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:"Tool Panel",x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",name:"Selection Bar",x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},
{type:"RECTANGLE",name:"Location",x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:"Navigation Text",label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:"Content",label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:"Content",label:"/",x:78,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:"Content",label:"Location",
x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:"Main Panel",x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:"Button",x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:"Button Text",label:"Button",x:158,y:90,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",
name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:"Section Text",label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:"Line Color",x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:"Line Color",x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:"Line Color",x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:"Side Panel",x:10,y:71,
width:140,height:289,family:"sidepanel",fill:"#FBFBFB",order:12},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:"Navigation Text",label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},
{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}]},b=0;b<3;b++)a.shapes.push({type:"TEXT",name:"content",label:"org.eclipse.orion.content",x:170,y:127+20*b,fill:"#3087B3",family:"content"});for(b=0;b<3;b++)a.shapes.push({type:"TEXT",name:"content",label:"Item",x:25,y:115+20*b,fill:"#3087B3",family:"content"});for(b=0;b<3;b++)a.shapes.push({type:"TRIANGLE",name:"twisty",x1:160,y1:121+b*20,x2:165,y2:124+b*20,x3:160,y3:127+b*20,family:"navbar",fill:"#333"});
a.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return a};d.prototype.processSettings=function(a){var b=new k.ThemeSheetWriter;(new j.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",b.getSheet(a))};return{ThemeData:d,getStyles:b}});
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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/widgets/UserMenu",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/PageLinks"],function(j,k,i,d){function b(a){this._displaySignOut=!0;this._init(a)}b.prototype={_init:function(a){this._dropdownNode=i.node(a.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=a.dropdown;this._serviceRegistry=a.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices={};this._noSeparator=a.noSeparator;this._dropDownItemClass=
a.dropDownItemClass;this._keyAssistClass=a.keyAssistClass;if(a.signOut!==void 0)this._displaySignOut=a.signOut},isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},hasServices:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)>0},length:function(a){var b=0,h;for(h in a)a.hasOwnProperty(h)&&b++;return b},_makeMenuItem:function(a,b){var h=document.createElement("span");h.role="menuitem";
h.tabIndex=0;var g=document.createTextNode(a);h.appendChild(g);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&h.classList.add(this._dropDownItemClass):h.classList.add("dropdownMenuItem");h.addEventListener("click",b,!1);h.addEventListener("keydown",function(c){(c.keyCode===i.KEY.ENTER||c.keyCode===i.KEY.SPACE)&&b()},!1);return h},_renderAuthenticatedService:function(a){var b=this,h=this.authenticatedServices[a].authService;if(h&&h.logout&&this._displaySignOut){var g=document.createElement("li"),
c=this._makeMenuItem(j["Sign Out"],function(){h.logout().then(function(){b.addUserItem(a,h,b.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var c=localStorage.length-1;c>=0;c--){var g=localStorage.key(c);g&&g.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(g)}h.getAuthForm(window.location.href).then(function(c){window.location=c})})});g.appendChild(c);this._dropdownNode.appendChild(g)}},renderServices:function(){function a(a){h[a]||
(h[a]=b.createDocumentFragment());return h[a]}var b=document,h=[];d.getPageLinksInfo(this._serviceRegistry,"orion.page.link.user").then(function(g){this._dropdown?this._dropdown.empty():this._dropdownNode&&i.empty(this._dropdownNode);g.forEach(function(c){var e=a(typeof c.category==="number"?c.category:1),g=b.createElement("li"),h=b.createElement("a");h.role="menuitem";typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&h.classList.add(this._dropDownItemClass):h.classList.add("dropdownMenuItem");
h.href=c.href;h.textContent=c.textContent;g.appendChild(h);e.appendChild(g)}.bind(this));if(this.keyAssistFunction){var g=document.createElement("li"),c=this._makeMenuItem(j["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass==="string"?this._keyAssistClass!==""&&c.classList.add(this._keyAssistClass):c.classList.add("key-assist-menuitem");g.appendChild(c);a(0).appendChild(g)}var e=this;h.sort(function(c,a){return c-a}).forEach(function(c,a){if(a<h.length-1&&!this._noSeparator){var b=
document.createElement("li");b.classList.add("dropdownSeparator");var g=document.createElement("span");g.classList.add("dropdownSeparator");b.appendChild(g);c.appendChild(b)}e._dropdownNode.appendChild(c)}.bind(this));if(this.isSingleService())for(var d in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(d)&&this._renderAuthenticatedService(d,0)}.bind(this))},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,b,h,g){g?(this.unauthenticatedServices[a]&&
delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:b,label:h,data:g}):(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:b,label:h,pending:this.unauthenticatedServices[a].pending}:{authService:b,label:h});this.renderServices()}};b.prototype.constructor=b;return{UserMenu:b}});
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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/editor/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(j,k,i,d,b,a){function f(a,c,e){var b="";e&&(b="^");if(b=i.parse("/"+b+a.searchStr+"/"))e=b.pattern,b=b.flags,b.indexOf("i")===-1&&!c.caseSensitive&&(b+="i"),a.regExp={pattern:e,flags:b},a.wildCard=!0}var h={ALL_FILE_TYPE:"*.*"};h.doSearch=function(a,c,e,b){if(a){var f=!0;e==="*"&&(e="");e===""&&(f=b&&b.type!==h.ALL_FILE_TYPE);if(f){e!==""&&h.addRecentSearch(c,
e,b?b.regEx:!1);var a=a.createSearchParams(e,!1,!1,b),d=h.generateSearchHref(a);h.getOpenSearchPref(c,function(c){c?window.open(d):window.location=d})}}else window.alert(j["Can't search: no search service is available"])};h.generateSearchHelper=function(a,c){var e=a.keyword,b=e,d={};a.fileType&&a.fileType!==h.ALL_FILE_TYPE&&e===""&&(b="*."+a.fileType);if(a.regEx)d.searchStr=e,f(d,a,c);else{var p=e.indexOf("*")>-1,i=e.indexOf("?")>-1;p&&(e=e.split("*").join(".*"));i&&(e=e.split("?").join("."));!p&&
!i&&!a.nameSearch?(d.searchStr=a.caseSensitive?e.split("\\").join(""):e.split("\\").join("").toLowerCase(),d.wildCard=!1):(d.searchStr=a.caseSensitive?e:e.toLowerCase(),f(d,a,c),d.wildCard=!0)}d.searchStrLength=d.searchStr.length;return{params:a,inFileQuery:d,displayedSearchTerm:b}};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,c){var e={},b;for(b in a)if(a[b]!==void 0&&a[b]!==null&&(c||b!=="replace"))e[b]=a[b];return e};h.generateSearchHref=function(b){var c=k.toUrl("search/search.html"),b=h.copySearchParams(b,!0),e=b.resource;b.resource=void 0;return(new a(c+"#{,resource,params*}")).expand({resource:e,params:b})};h.generateFindURLBinding=function(b,
c,e,f){b={find:c.searchStr,regEx:c.wildCard?!0:void 0,caseSensitive:b.caseSensitive?!0:void 0,replaceWith:typeof f==="string"?f:void 0,atLine:typeof e==="number"?e:void 0};return","+(new a("{,params*}")).expand({params:b})};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,
c,b){return a.replace(RegExp(c.pattern,c.flags),b)};h.replaceStringLiteral=function(a,c,b){c=i.parse("/"+c+"/gim");return h.replaceRegEx(a,c,b)};h.searchOnelineLiteral=function(a,c,b){var f;f=0;for(var h=!1,d=[];;)if(f=c.indexOf(a.searchStr,f),f<0)break;else{d.push({startIndex:f,length:a.searchStrLength});h=!0;if(b)break;f+=a.searchStrLength}return h?d:null};h.findRegExp=function(a,c,b,f){if(!c)return null;b=b||"";b+=(b.indexOf("g")===-1?"g":"")+(b.indexOf("m")===-1?"m":"");var h=null;return(h=RegExp(c,
b).exec(a.substring(f)))&&{startIndex:h.index+f,length:h[0].length}};h.searchOnelineRegEx=function(a,c,b){for(var f=0,d=!1,p=[];;)if(f=h.findRegExp(c,a.regExp.pattern,a.regExp.flags,f)){p.push(f);d=!0;if(b)break;f=f.startIndex+f.length}else break;return d?p:null};h.generateNewContents=function(a,c,b,f,d,p){if(f&&c){if(!a)b.contents=[];for(var i=0;i<c.length;i++){for(var j=c[i],k=!1,q=!1,t=[],m,u=0,z=0;z<f.children.length;z++)if(f.children[z].lineNumber-1===i){u=z;for(k=0;k<f.children[z].matches.length;k++)f.children[z+
k].checked!==!1&&t.push(k);q=t.length>0;m=f.children[z].matches;k=!0;break}if(k){if(q){t=h.replaceCheckedMatches(j,d,m,t,p);j=t.replacedStr;for(k=0;k<f.children[u].matches.length;k++)f.children[u+k].newMatches=t.newMatches}else for(k=0;k<f.children[u].matches.length;k++)f.children[u+k].newMatches=f.children[u+k].matches;a?b.contents[i]=j:b.contents.push(j)}else a||b.contents.push(j)}}};h.generateMatchContext=function(a,c,b){var f=[],h=a*2+1,d;c.length<=h?(d=0,a=c.length-1):(d=b-a,d<0?(d=0,a=d+h-1):
(a=b+a,a>c.length-1&&(a=c.length-1,d=a-h+1)));for(h=d;h<=a;h++)f.push({context:c[h],current:h===b});return f};h.splitFile=function(a){for(var c=0,b=0,f=0,h=0,d=[];;){c!==-1&&c<=f&&(c=a.indexOf("\r",f));b!==-1&&b<=f&&(b=a.indexOf("\n",f));if(b===-1&&c===-1){d.push(a.substring(h));break}var i=1;c!==-1&&b!==-1?c+1===b?(i=2,f=b+1):f=(c<b?c:b)+1:f=c!==-1?c+1:b+1;d.push(a.substring(h,f-i));h=f}return d};h.searchWithinFile=function(a,c,b,f,d,p){b=h.splitFile(b);if(d)c.contents=b;if(c){c.children=[];for(var i=
f=0;i<b.length;i++){var j=b[i];if(j&&j.length>0){var k=p?j:j.toLowerCase();if(k=a.wildCard?h.searchOnelineRegEx(a,k):h.searchOnelineLiteral(a,k)){var q,t=i+1;if(d)for(var m=0;m<k.length;m++)q=m+1,q={parent:c,checked:c.checked,type:"detail",matches:k,lineNumber:t,matchNumber:q,name:j,location:c.location+"-"+t+"-"+q},c.children.push(q);else q={parent:c,context:h.generateMatchContext(2,b,i),checked:c.checked,type:"detail",matches:k,lineNumber:t,name:j,location:c.location+"-"+t},c.children.push(q);f+=
k.length}}}c.totalMatches=f}};h.replaceCheckedMatches=function(a,c,b,f,h){for(var d=0,i="",j=[],k=0;k<b.length;k++){d!==b[k].startIndex&&(i+=a.substring(d,b[k].startIndex));if(b[k].length)h=b[k].length;for(var d=!1,q=0;q<f.length;q++)if(f[q]===k){d=!0;break}d?(j.push({startIndex:i.length,length:c.length}),i+=c):(j.push({startIndex:i.length,length:h}),i+=a.substring(b[k].startIndex,b[k].startIndex+h));d=b[k].startIndex+h}d<a.length&&(i+=a.substring(d));return{replacedStr:i,newMatches:j}};h.fullPathNameByMeta=
function(a){var c=a.length,b="";if(c>0)for(c-=1;c>-1;c--)b=b+(b===""?"":"/")+a[c].Name;return b};h.path2FolderName=function(a,c,b){return a.substring(0,a.length-c.length-(b?0:1))};h._storeRecentSearch=function(a,c,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("recentSearch",c);b&&window.setTimeout(function(){b.dispatchEvent({type:"recentSearchesChanged"})}.bind(this),20)})};h.addRecentSearch=function(a,c,b){typeof c==="string"&&c&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){var d,
f=f.get("recentSearch");typeof f==="string"&&(f=JSON.parse(f));if(f){for(d in f)if(f[d].name===c)return;f.length>=20&&f.splice(19,f.length-20+1)}else f=[];f.splice(0,0,{name:c,regEx:b});h._storeRecentSearch(a,f)})};h.removeRecentSearch=function(a,c,b){typeof c==="string"&&c&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){var d,f=f.get("recentSearch");typeof f==="string"&&(f=JSON.parse(f));if(f)for(d in f)if(f[d].name===c){f.splice(d,1);h._storeRecentSearch(a,
f,b);break}})};h.getSearches=function(a,c,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a=a.get(c);typeof a==="string"&&(a=JSON.parse(a));a&&b&&b(a)})};h.getMixedSearches=function(a,c,b,f){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var g=a.get("recentSearch");typeof g==="string"&&(g=JSON.parse(g));c&&(a=a.get("search"),typeof a==="string"&&(a=JSON.parse(a)),a&&a.forEach(function(c){if(b){var a=h.parseQueryStr(c.query);
g.some(function(c){return a.searchStrTitle===c.name})||g.push({name:a.searchStrTitle,label:c.name})}else g.push({name:null,label:c.name,value:c.query})}));g&&f&&f(g)})};h.getOpenSearchPref=function(a,c){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");c(a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?!0:!1:!1)})};h.setOpenSearchPref=function(a,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",
{openInNewTab:c})})};return h});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(j,k,i,d,b,a){function f(a,b,c,e){this.registry=a;this.fileClient=b;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=e&&e.searchOnName;this._buildSkeletonOnly=e&&e.buildSkeletonOnly;this._fetchChildrenCallBack=e&&e.fetchChildrenCallBack;this._searchParams=c;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:d.generateSearchHelper(c);this._location=e&&e.location;this._childrenLocation=e&&e.childrenLocation?e.childrenLocation:this._location}f.prototype.search=function(a){var b=this.registry.getService("orion.core.contenttypes");this._onSearchComplete=a;b.getContentTypes().then(function(c){this.contentTypesCache=c;this._visitRecursively(this._childrenLocation).then(function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,
docs:this.fileLocations}})}.bind(this))}.bind(this))};f.prototype.searchName=function(a,b){if(a)this.searchHelper=d.generateSearchHelper(a,!0);if(b)this.onSearchNameComplete=b;var c=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var e=0;e<this.fileSkeleton.length;e++){var f=this.fileSkeleton[e].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?d.searchOnelineRegEx(this.searchHelper.inFileQuery,f,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,f,!0))if(c.push(this.fileSkeleton[e]),
c.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:c.length,docs:c}})}};f.prototype.buildSkeleton=function(a,b){this._buildingSkeleton=!0;var c=this.registry.getService("orion.core.contenttypes"),e=this;a();c.getContentTypes().then(function(c){e.contentTypesCache=c;e._visitRecursively(e._childrenLocation).then(function(){e._buildingSkeleton=!1;b();e.searchHelper&&!e._buildSkeletonOnly&&e.searchName()})})};f.prototype._searchCompleted=function(){console.log("Search Completed.")};
f.prototype._searchFiles=function(){var b=[],g;if(this.fileLocations.length>0){g=this;for(var c=0;c<g.fileLocations.length;c++)b.push(g._sniffSearch(g.fileLocations[c]))}return a.all(b)};f.prototype._sort=function(a){a.sort(function(a,c){var b=a.Name&&a.Name.toLowerCase(),f=c.Name&&c.Name.toLowerCase();return b<f?-1:b>f?1:0})};f.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};f.prototype._visitRecursively=function(f){var g=[],c=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(f);var e=c.registry.getService("orion.page.progress");return(e?e.progress(c.fileClient.fetchChildren(f),"Crawling search for children of "+f):c.fileClient.fetchChildren(f)).then(function(e){for(var f=0;f<e.length;f++)if(e[f].Directory!==void 0&&e[f].Directory===!1)if(c._searchOnName)g.push(c._buildSingleSkeleton(e[f]));else if(c._buildSkeletonOnly)g.push(c._buildSingleSkeleton(e[f]));
else{var h=b.getFilenameContentType(e[f].Name,c.contentTypesCache);h&&(h["extends"]==="text/plain"||h.id==="text/plain")&&c._onFileType(h)&&g.push(c._sniffSearch(e[f]))}else e[f].Location&&g.push(c._visitRecursively(e[f].ChildrenLocation));return a.all(g)})};f.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)};f.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)};f.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:i.formatMessage(j["${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(c){b._hitOnceWithinFile(c)&&b._reportSingleHit(a);b.registry.getService("orion.page.message").setProgressResult({Message:i.formatMessage(j["${0} files found out of ${1}"],b._hitCounter,b._totalCounter)})},function(c){console.error("Error loading file content: "+c.message)})};f.prototype._buildSingleSkeleton=function(b){this._totalCounter++;
this.fileSkeleton.push(b);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();b=new a;b.resolve(this._totalCounter);return b};f.prototype.constructor=f;return{SearchCrawler:f}});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(j,k,i,d){function b(){}b.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'<div class="dialog" role="dialog"><div class="dialogTitle"><span id="title" class="dialogTitleText layoutLeft"></span><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" id="closeDialog"></button></div><div id="dialogContent" class="dialogContent layoutBlock"></div><div id="buttons" class="dialogButtons"></div></div>',_initialize:function(){var a=
document.body;this.$frameParent=a;this.$$modalExclusions=this.$$modalExclusions||[];var b=document.createRange();b.selectNode(a);b=b.createContextualFragment(this.CONTAINERTEMPLATE);a.appendChild(b);this.$frame=a.lastChild;this.title&&i.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=i.$("#closeDialog",this.$frame);var d=this;this.$close.addEventListener("click",function(){d.hide()},!1);this.$parent=i.$(".dialogContent",this.$frame);b=document.createRange();b.selectNode(this.$parent);
a=b.createContextualFragment(this.TEMPLATE);this.messages&&i.processTextNodes(a,this.messages);this.$parent.appendChild(a);this.$buttonContainer=i.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(a){a.keyCode===i.KEY.ESCAPE?d.hide():a.keyCode===i.KEY.ENTER&&typeof d._defaultCallback==="function"&&d._defaultCallback()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent);this.modal&&this._makeModal()},
_makeButtons:function(){if(this.$buttonContainer&&Array.isArray(this.buttons)){var a=this;this.buttons.forEach(function(b){var h=d.createButton(b.text,b.callback);if(b.id)h.id=b.id,a["$"+h.id]=h;if(b.isDefault)a._defaultCallback=b.callback,a._defaultButton=h;a.$buttonContainer.appendChild(h)})}},_makeModal:function(){var a=this;this.$frame.addEventListener("blur",function(c){a.$lastFocusedElement=c.target},!0);this._modalListener=function(c){var b=!i.contains(a.$frame,c.target);if(b)for(var g=0;g<
a.$$modalExclusions.length;g++)if(i.contains(a.$$modalExclusions[g],c.target)){b=!1;break}b&&(window.setTimeout(function(){(a.$lastFocusedElement||a.$parent).focus()},0),i.stop(c))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var b=this.$frameParent.childNodes,d=!1;this._addedBackdrop=[];for(var g=0;g<b.length;g++){for(var c=0;c<this.$$modalExclusions.length;c++)if(i.contains(this.$$modalExclusions[c],b[g])){d=
!0;break}!d&&b[g]!==a.$frame&&b[g].classList&&!b[g].classList.contains("tooltipContainer")&&(c=b[g],c.classList.contains("modalBackdrop")||(c.classList.add("modalBackdrop"),this._addedBackdrop.push(c)))}(b=i.lastTabbable(this.$buttonContainer)||i.lastTabbable(this.$parent))&&b.addEventListener("keydown",function(c){if(c.keyCode===i.KEY.TAB){var b=a._getFirstFocusField();b&&b!==c.target&&b.focus();i.stop(c)}},!1)},_addChildDialog:function(a){this.$$modalExclusions.push(a.$frame||a.$parent)},_bindElements:function(a){for(var b=
0;b<a.childNodes.length;b++){var d=a.childNodes[b];d.id&&(this["$"+d.id]=d);this._bindElements(d)}},hide:function(){typeof this._beforeHiding==="function"&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0));this.$frame.classList.remove("dialogShowing");typeof this._afterHiding==="function"&&this._afterHiding();var a=this;this.keepAlive||window.setTimeout(function(){a.destroy()},
0)},show:function(a){typeof this._beforeShowing==="function"&&this._beforeShowing();var b=i.bounds(this.$frame),d=i.bounds(document.documentElement),g;a?(g=i.bounds(a),a=g.top+g.height+4,g=g.left+4,a+b.height>d.height&&(a=Math.max(0,d.height-b.height-4)),g+b.width>d.width&&(g=Math.max(0,d.width-b.width-4))):(g=Math.max(0,(d.width-b.width)/2),a=Math.max(0,(d.height-b.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=a+"px";this.$frame.style.left=g+"px";this.$frame.classList.add("dialogShowing");
typeof this._afterShowing==="function"&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return i.firstTabbable(this.$parent)||this._defaultButton||i.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(a){a.classList.remove("modalBackdrop")});this.$frameParent.removeEventListener("focus",this._modalListener,!0);this.$frameParent.removeEventListener("click",
this._modalListener,!0);this.$frameParent.removeChild(this.$frame);this.$parent=this.$frame=void 0}};b.prototype.constructor=b;return{Dialog:b}});
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(j,k,i,d,b,a,f){function h(a){this._init(a)}h.prototype=new f.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||j["Find File Named"];this.modal=!0;this.messages=j;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=new i.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(j["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||
typeof this._searchRenderer.makeRenderFunction!=="function")throw Error(j["Missing required argument: searchRenderer"]);this._favService=a.favoriteService;if(!this._favService)throw Error(j["Missing required argument: favService"]);this._initialize()};h.prototype._bindToDom=function(a){var c=this;c.$crawlingProgress.style.display="none";this.$fileName.setAttribute("placeholder",j.Search);this.$fileName.addEventListener("input",function(){c._time=+new Date;c._timeoutId&&clearTimeout(c._timeoutId);
c._timeoutId=setTimeout(c.checkSearch.bind(c),0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===b.KEY.ENTER){var g=b.$("a",c.$results);g&&(b.stop(a),window.open(g.href),c.hide())}},!1);a.addEventListener("keydown",function(a){var g,f,d,h,i;if(a.keyCode===b.KEY.DOWN||a.keyCode===b.KEY.UP)f=b.$$array("a",c.$results),g=b.$$array("a",c.$favresults),d=document.activeElement,i=f.indexOf(d),h=g.indexOf(d),a.keyCode===b.KEY.DOWN?h>=0?(h<g.length-1?g[h+1]:f.length>0?f[0]:g[0]).focus():
i>=0?(i<f.length-1?f[i+1]:g.length>0?g[0]:f[0]).focus():(f.length>0||g.length>0)&&(-1<g.length-1?g[0]:f[0]).focus():h>=0?(d=c.$fileName,(h>0?g[h-1]:d).focus()):i>=0?(d=c.$fileName,(i>0?f[i-1]:g.length>0?g[g.length-1]:d).focus()):f.length>0?f[f.length-1].focus():g.length>0&&g[g.length-1].focus(),b.stop(a)});a.addEventListener("mouseup",function(c){c.target.focus()},!1);this.populateFavorites();setTimeout(function(){if(c._forceUseCrawler||!c._fileService.getService(c._searcher.getSearchLocation()).search){var a=
c._searchOnRoot?c._searcher.getSearchRootLocation():c._searcher.getChildrenLocation(),a=new k.SearchCrawler(c._searcher.registry,c._fileService,"",{searchOnName:!0,location:a});c._searcher.setCrawler(a);a.buildSkeleton(function(){c.$crawlingProgress.style.display="inline";c.$progress.appendChild(document.createTextNode(j["Building file skeleton..."]))},function(){c.$crawlingProgress.style.display="none";c.$progress.removeChild(c.$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(j["Populating favorites&#x2026;"]));b.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(c){if(c.navigator)c=c.navigator;a._searchRenderer.makeRenderFunction(a._contentTypeService,a.$favresults,!1,a.decorateResult.bind(a),a.showFavoritesImage)(c);if(c&&c.length>0)c=document.createElement("div"),c.style.borderBottom="1px dashed #BBBBBB",c.style.padding="5px",a.$favresults.appendChild(c)}};h.prototype.showFavoritesImage=function(a){var c=new Image;
c.classList.add("modelDecorationSprite");c.classList.add("core-sprite-favorite");c.src=d.toUrl("images/none.png");c.title=j.Favorite;a.appendChild(c);c.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 f=this.$fileName.value;if(f){var c=this._searcher.createSearchParams(f,
this._nameSearch,this._searchOnRoot),e=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=e;var d=document.createElement("div");d.appendChild(document.createTextNode(this._nameSearch?j["Searching..."]:a.formatMessage(j["Searching for occurrences of"],f)));b.empty(this.$results);this.$results.appendChild(d);this._searcher.search(c,!1,function(){e===this.currentSearch&&e.apply(null,arguments)}.bind(this))}};h.prototype.decorateResult=
function(a){for(var c=this,a=b.$$array("a",a),e=0;e<a.length;e++){var f=a[e];f.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&c.hide()},!1);f.addEventListener("keyup",function(a){a.keyCode===b.KEY.ENTER&&c.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(j){Array.prototype.slice.call(arguments,1).forEach(function(k){for(var i=Object.keys(k),d=0;d<i.length;d++){var b=i[d];j[b]=k[b]}})}}});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(j,k){function i(d,b,a){this.CLEAR_PANEL=a!==null?a:!0;this.OPEN="false";a="";d.nodeType?this.node=d:(a=d+"_",d=document.getElementById(d),this.node=d.nodeType?d:document.createElement("span"));this.node.innerHTML=this.templateString;this.navLabelId=a+"navigationlabel";document.getElementById("navigationlabel").id=this.navLabelId;this.arrowId=a+"dropDownArrow";document.getElementById("dropDownArrow").id=this.arrowId;
this.navDropDownId=a+"navdropdown";document.getElementById("navdropdown").id=this.navDropDownId;if(b.icon)this.node.className=this.node.className+" "+b.icon,this.node.onclick=this.click.bind(this);else{if(b.label)d=document.getElementById(this.navLabelId),d.textContent=b.label,d.onclick=this.click.bind(this);if(b.caret)document.getElementById(this.arrowId).className=b.caret}this._dropdownNode=k.node(this.navDropDownId);this._triggerNode=k.node(this.navLabelId)}j.mixin(i.prototype,{templateString:'<div id="navigationlabel" class="navigationLabel dropdownTrigger" ></div><span id="dropDownArrow" class="dropDownArrow"></span><div class="dropDownContainer" id="navdropdown" style="display:none;"></div>',
click:function(){var 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,b){b()},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),b=k.bounds(this._boundingNode(this._triggerNode));if(d.left+d.width>b.left+b.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 i});
define("orion/widgets/input/GroupedContent",["orion/objects","orion/webui/littlelib"],function(j){function k(){}j.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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(j,k,i){function d(a,b,g){if(!a[b])throw b+j[" is not supported in this file system"];return a[b].apply(a,g)}function b(a,h,g,c){if(!a.readBlob)throw j["source file service does not support binary read"];if(!g.writeBlob)throw j["target file service does not support binary write"];if(h[h.length-1]!=="/")return d(a,"readBlob",[h]).then(function(a){return d(g,"writeBlob",[c,a])});var e=c.substring(0,
c.length-1),l=decodeURIComponent(e.substring(e.lastIndexOf("/")+1)),e=e.substring(0,e.lastIndexOf("/")+1);return d(g,"createFolder",[e,l]).then(function(){},function(){}).then(function(){return d(a,"fetchChildren",[h]).then(function(e){for(var d=[],h=0;h<e.length;++h){var l=e[h].Location,i=l;e[h].Directory&&(i=l.substring(0,l.length-1));i=decodeURIComponent(i.substring(i.lastIndexOf("/")+1));i=c+encodeURIComponent(i);e[h].Directory&&(i+="/");d[h]=b(a,l,g,i)}return k.all(d)})})}function a(a,b){function g(c){var a=
new k;a.reject(j["No Matching FileService for location:"]+c);return a}var c=a.getServiceReferences("orion.core.file"),e=c;if(b)for(var e=[],d=0;d<c.length;++d)b(c[d])&&e.push(c[d]);for(var n=[],p=[],o=[],s=[],r={fetchChildren:function(){var c=new k;c.resolve(s);return c},createWorkspace:function(){var c=new k;c.reject(j["no file service"]);return c},loadWorkspaces:function(){var c=new k;c.reject(j["no file service"]);return c},loadWorkspace:function(){var c=new k;window.setTimeout(function(){c.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:j["File Servers"],Location:"/",Children:s,ChildrenLocation:"/"})},100);return c},search:g,createProject:g,createFolder:g,createFile:g,deleteFile:g,moveFile:g,copyFile:g,read:g,write:g},c=0;c<e.length;++c)s[c]={Directory:!0,Length:0,LocalTimeStamp:0,Location:e[c].getProperty("top"),ChildrenLocation:e[c].getProperty("top"),Name:e[c].getProperty("Name")},d=e[c].getProperty("pattern")||".*",d[0]!=="^"&&(d="^"+d),n[c]=RegExp(d),p[c]=a.getService(e[c]),o[c]=e[c].getProperty("Name"),
e[c].getProperty("NameKey")&&e[c].getProperty("nls")&&i.getMessageBundle(e[c].getProperty("nls")).then(function(c,a){s[c].Name=a[e[c].getProperty("NameKey")];o[c]=a[e[c].getProperty("NameKey")]}.bind(this,c));this._getServiceIndex=function(c){if(c==="/")return-1;else if(!c||c.length&&c.length===0)return p[0]?0:-1;for(var a=0;a<n.length;++a)if(n[a].test(c))return a;throw j["No Matching FileService for location:"]+c;};this._getService=function(c){c=this._getServiceIndex(c);return c===-1?r:p[c]};this._getServiceName=
function(c){c=this._getServiceIndex(c);return c===-1?r.Name:o[c]};this._getServiceRootURL=function(c){c=this._getServiceIndex(c);return c===-1?r.Location:s[c].Location}}a.prototype={getService:function(a){return this._getService(a)},fileServiceName:function(a){return this._getServiceName(a)},fileServiceRootURL:function(a){return this._getServiceRootURL(a)},fetchChildren:function(a){return 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,g,c){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,h,g){var c=this._getService(a),e=this._getService(h);if(c===e)return d(c,"moveFile",arguments);var l=a[a.length-1]==="/",n=h;n[n.length-1]!=="/"&&(n+="/");if(g)n+=encodeURIComponent(g);else{var p=a;l&&(p=p.substring(0,p.length-1));n+=p.substring(p.lastIndexOf("/")+1)}l&&n[n.length-1]!=="/"&&(n+="/");return b(c,a,e,n).then(function(){return d(c,"deleteFile",[a])})},copyFile:function(a,h,g){var c=this._getService(a),e=this._getService(h);if(c===e)return d(c,"copyFile",arguments);
var l=a[a.length-1]==="/",n=h;n[n.length-1]!=="/"&&(n+="/");if(g)n+=encodeURIComponent(g);else{var p=a;l&&(p=p.substring(0,p.length-1));n+=p.substring(p.lastIndexOf("/")+1)}l&&n[n.length-1]!=="/"&&(n+="/");return b(c,a,e,n)},read:function(a,b){return d(this._getService(a),"read",arguments)},write:function(a,b,g){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)}};a.prototype.constructor=a;return{FileClient:a}});
define("orion/globalCommands","i18n!orion/nls/messages,require,orion/commonHTMLFragments,orion/keyBinding,orion/commandRegistry,orion/commands,orion/parameterCollectors,orion/extensionCommands,orion/uiUtils,orion/keyBinding,orion/breadcrumbs,orion/webui/littlelib,orion/webui/splitter,orion/webui/dropdown,orion/webui/tooltip,orion/favorites,orion/contentTypes,orion/URITemplate,orion/PageUtil,orion/widgets/themes/ThemePreferences,orion/widgets/themes/container/ThemeData,orion/Deferred,orion/widgets/UserMenu,orion/PageLinks,orion/webui/dialogs/OpenResourceDialog,text!orion/banner/banner.html,text!orion/banner/footer.html,text!orion/banner/toolbar.html,orion/widgets/input/DropDownMenu,orion/widgets/input/GroupedContent,orion/util,orion/customGlobalCommands,orion/fileClient".split(","),function(j,
k,i,d,b,a,f,h,g,c,e,l,n,p,o,s,r,q,t,m,u,z,w,v,D,B,E,C,A,x,F,L,O){function P(c,a){if(c.getLabel)return c.getLabel();else{var b=new z;b.resolve(a.properties.name);return b}}function T(c){l.node("progressPane").setAttribute("aria-label",j["Operations - Press spacebar to show current operations"]);(c=c.getService("orion.page.progress"))&&c.init.bind(c)("progressPane")}function U(c,a){var b=c.getServiceReferences("orion.core.auth");Q=[];for(var e=J.createMenuGenerator.apply(this,arguments),m=0;m<b.length;m++){var g=
b[m],f=c.getService(g);P(f,g).then(function(c){f.getKey().then(function(a){Q.push(a);f.getUser().then(function(b){e.addUserItem(a,f,c,b)},function(b,m){e.addUserItem(a,f,c,m)});window.addEventListener("storage",function(){M[a]!==localStorage.getItem(a)&&(M[a]=localStorage.getItem(a),f.getUser().then(function(b){e.addUserItem(a,f,c,b)},function(){e.addUserItem(a,f,c)}))},!1)})})}}function y(c,b,e,m,g){var f=arguments,d,w=c&&c.getServiceReferences("orion.page.link.related");w&&w.length!==0&&z.when(function(){if(d)return d;
var a=c.getService("orion.core.contenttypes");a||(a=new r.ContentTypeService(c),a=c.getService("orion.core.contenttypes"));return a.getContentTypes().then(function(c){return d=c})}(),function(){var u;if(J.beforeGenerateRelatedLinks.apply(this,f)){for(var l=[],n=0;n<w.length;n++){var p={},i,v=w[n].getPropertyKeys();for(i=0;i<v.length;i++)p[v[i]]=w[n].getProperty(v[i]);if(p.id){var j=function(c){if(c)if(!c.visibleWhen||c.visibleWhen(b)){var e=new a.CommandInvocation(b,b,null,c,m);J.addRelatedLinkCommand(c,
e)}else typeof g==="function"&&(u||(u=g()),z.when(u,function(e){e&&b===N&&(!c.visibleWhen||c.visibleWhen(e))&&J.addRelatedLinkCommand(c,new a.CommandInvocation(e,e,null,c,m))}))},o=null;i=null;if(e.indexOf(p.id)<0)if((p.nls&&p.nameKey||p.name)&&p.uriTemplate)i=h._createCommandOptions(p,w[n],c,d,!0),l.push(i),i.then(function(c){c=new a.Command(c);j(c)});else{if(!o&&(o=m.findCommand(p.id))){j(o);continue}if(!o){var D=c.getServiceReferences("orion.navigate.command");for(i=0;i<D.length;i++)if(D[i].getProperty("id")===
p.id){for(var p={},v=D[i].getPropertyKeys(),F=0;F<v.length;F++)p[v[F]]=D[i].getProperty(v[F]);i=h._createCommandOptions(p,D[i],c,d,!0);l.push(i);i.then(function(c){o=new a.Command(c);j(o)});break}}}}}z.all(l,function(c){return c}).then(function(){J.afterGenerateRelatedLinks.apply(this,f)})}})}function G(c){var a=l.node("globalActions");a&&(c.destroy(a),c.renderCommands(a.id,a,{},{},"tool"))}function H(c){var a={},b=null;typeof c==="string"&&(c=l.node(c));c||(c=l.node("pageActions"));for(var e=c;e&&
e.classList;){if(e.classList.contains("toolComposite")){b=e;break}e=e.parentNode}if(c.classList.contains("commandMarker"))a.commandNode=c;if(b&&(a.slideContainer=l.$(".slideParameters",b),a.parameterArea=l.$(".parameters",b),a.dismissArea=l.$(".parametersDismiss",b),a.notifications=l.$("#notificationArea",b),b.parentNode&&(a.toolbarTarget=l.$(".toolbarTarget",b.parentNode),a.toolbarTarget)))c=l.bounds(b),a.toolbarTargetY=c.height+1;return a}function I(c){if(c.toolbarTarget&&c.toolbarTargetY){var a=
0,b;c.notifications&&c.notifications.classList.contains("slideContainerActive")&&(b=l.bounds(c.notifications),a+=b.height);c.slideContainer&&c.slideContainer.classList.contains("slideContainerActive")&&(b=l.bounds(c.slideContainer),a+=b.height);a>0&&(a+=8);c.toolbarTarget.style.top=c.toolbarTargetY+a+"px";c.toolbarTarget.style.bottom=0}}var b=function(c){var a=document.createElement("a");a.href=c;return a.href}(k.toUrl("auth/NotifyAuthentication.html")),M={},J={createMenuGenerator:L.createMenuGenerator||
function(c,a){if(l.node("userMenu")){var b=l.node("userDropdown"),e=new p.Dropdown({dropdown:b}),b=new w.UserMenu({dropdownNode:b,dropdown:e,serviceRegistry:c}),e=l.node("userTrigger");new o.Tooltip({node:e,text:j.Options,position:["below","left"]});var e=document.getElementById("userTrigger"),m=e.className;m+=" imageSprite core-sprite-silhouette";e.className=m;b.setKeyAssist(a);return b}},beforeGenerateRelatedLinks:L.beforeGenerateRelatedLinks||function(){var c=l.node("relatedLinks");l.empty(c);
return!0},addRelatedLinkCommand:L.addRelatedLinkCommand||function(c,b){var e=l.node("relatedLinks");a.createCommandMenuItem(e,c,b).classList.remove("dropdownMenuItem")},afterGenerateRelatedLinks:L.afterGenerateRelatedLinks||function(){},afterSetPageTarget:L.afterSetPageTarget||function(){},generateNavigationMenu:L.generateNavigationMenu||function(){var c=document.getElementById("centralNavigation");new o.Tooltip({node:c,text:"Navigation Menu",position:["right"]});var c=new A("centralNavigation",{label:"Develop",
icon:"commandSprite core-sprite-hamburger"}),a=new x;c.addContent(a.getContentPane())},afterGenerateBanner:L.afterGenerateBanner||function(){}},Q=[],N,S=[],K,R=null;return{addSettings:function(c){(new A("settingsTab",{label:"Develop",icon:"imageSprite core-sprite-wrench"},!1)).updateContent=c.updateContent.bind(c)},generateBanner:function(c,b,e,h,w,z,p){function o(){this.create();this._filterString=""}function L(c){c.registerService("orion.cm.managedservice",{updated:function(c){for(var c=c&&c["links.newtab"]!==
"undefined"?c["links.newtab"]?"_blank":"_self":"_self",a=l.$$array(".targetSelector"),b=0;b<a.length;b++)a[b].target=c}},{pid:"nav.config"})}(new m.ThemePreferences(h,new u.ThemeData)).apply();var A=l.node(c);if(!A)throw j["could not find banner parent, id was "]+c;var r=document.createRange();r.selectNode(A);r=r.createContextualFragment(B);l.processTextNodes(r,j);A.firstChild?A.insertBefore(r,A.firstChild):A.appendChild(r);A=l.node("home");A.href=k.toUrl("navigate/table.html");A.setAttribute("aria-label",
j["Orion Home"]);l.node("progressPane").src=k.toUrl("images/none.png");if(A=l.node("pageToolbar"))A.classList.add("toolbarLayout"),A.innerHTML=C+i.slideoutHTMLFragment("mainToolbar");(A=l.node("closeNotifications"))&&A.setAttribute("aria-label",j["Close notification"]);if(A=l.node("footer"))A.innerHTML=E,l.processTextNodes(A,j);e.setParameterCollector(new f.CommandParameterCollector(H,I));document.addEventListener("keydown",function(c){c.keyCode===l.KEY.ESCAPE&&(c=b.getService("orion.page.message"))&&
c.setProgressMessage("")},!1);J.generateNavigationMenu.apply(this,arguments);var x=l.node("navigationlinks");x&&v.createPageLinks(b,"orion.page.link").then(function(c){c.forEach(function(c){var a=document.createElement("li");a.appendChild(c);x.appendChild(a)})});if(A=l.$(".split")){var r=l.$(".sidePanelLayout"),q=l.$(".mainPanelLayout");if(r&&q)R={side:r,main:q},R.splitter=new n.Splitter({node:A,sidePanel:r,mainPanel:q,toggle:!0,closeByDefault:A.style&&A.style.left==="0%"}),A=new a.Command({name:j["Toggle side panel"],
tooltip:j["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){R.splitter.toggleSidePanel()}}),e.addCommand(A),e.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new d.KeyBinding("o",!0)),p&&R.splitter.addResizeListener(function(c){p&&c===q&&(c=p.getTextView())&&c.resize()})}A=new a.Command({name:j["Make Favorite"],tooltip:j["Add to the favorites list"],imageClass:"core-sprite-favorite",id:"orion.makeFavorite",visibleWhen:function(c){c=Array.isArray(c)?
c:[c];if(c.length===0)return!1;for(var a=0;a<c.length;a++)if(!c[a].Location)return!1;return!0},callback:function(c){for(var c=Array.isArray(c.items)?c.items:[c.items],a=b.getService("orion.core.favorite"),e=b.getService("orion.page.progress"),m=function(c){return function(m){m?b.getService("orion.page.message").setMessage(c.Name+j[" is already a favorite."],2E3):e.progress(a.makeFavorites(c),"Making favorite "+c.Name)}},g=0;g<c.length;g++){var f=c[g];e.progress(a.hasFavorite(f.ChildrenLocation||f.Location),
"Checking favorite "+f.Name).then(m(f))}}});e.addCommand(A);var O=!1,t=function(c,a,b){if(!O){var e=a.getService("orion.core.favorite"),m=a.getService("orion.page.progress");e||(e=new s.FavoritesService({serviceRegistry:a}),e=a.getService("orion.core.favorite"));var g=new D.OpenResourceDialog({searcher:c,progress:m,searchRenderer:c.defaultRenderer,favoriteService:e,onHide:function(){O=!1;b&&b.getTextView()&&b.getTextView().focus()}});window.setTimeout(function(){O=!0;g.show()},0)}},A=new a.Command({name:j["Find File Named..."],
tooltip:j["Choose a file by name and open an editor on it"],id:"eclipse.openResource",callback:function(){t(w,b,p)}});e.addCommand(A);e.registerCommandContribution("globalActions","eclipse.openResource",100,null,!0,new d.KeyBinding("f",!0,!0));A=new a.Command({name:j["Toggle banner and footer"],tooltip:j["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var c=l.node("banner"),a=l.node("footer"),b=l.$(".content-fixedHeight");c.style.visibility==="hidden"?(c.style.visibility=
"visible",a.style.visibility="visible",b.classList.remove("content-fixedHeight-maximized")):(c.style.visibility="hidden",a.style.visibility="hidden",b.classList.add("content-fixedHeight-maximized"));p&&p.getTextView()&&p.getTextView().resize();return!0}});e.addCommand(A);e.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new d.KeyBinding("m",!0,!0));A=new a.Command({name:j["System Configuration Details"],tooltip:j["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});
e.addCommand(A);e.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new d.KeyBinding(112,!0,!0));A=new a.Command({name:j["Background Operations"],tooltip:j["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});e.addCommand(A);e.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new d.KeyBinding("o",!0,!0));o.prototype={create:function(){var c=this._keyAssistDiv=
document.createElement("div");c.id="keyAssist";c.style.display="none";c.classList.add("keyAssistFloat");c.setAttribute("role","menu");var a=this._keyAssistInput=document.createElement("input");a.classList.add("keyAssistInput");a.type="text";a.placeholder=j["Filter bindings"];c.appendChild(a);var b=this._keyAssistContents=document.createElement("div");b.classList.add("keyAssistContents");if(F.isIOS||F.isAndroid)b.style.overflowY="auto";c.appendChild(b);var e=this._keyAssistTable=document.createElement("table");
e.tabIndex=0;e.classList.add("keyAssistList");b.appendChild(e);document.body.appendChild(c);a.addEventListener("keydown",function(c){this._keyDown(c)}.bind(this));e.addEventListener("keydown",function(c){this._keyDown(c)}.bind(this));a.addEventListener("input",function(){this.filterChanged()}.bind(this));b.addEventListener(F.isFirefox?"DOMMouseScroll":"mousewheel",function(c){this._scrollWheel(c)}.bind(this));document.addEventListener("keydown",function(c){c.keyCode===l.KEY.ESCAPE&&this.hide()}.bind(this));
l.addAutoDismiss([c],function(){this.hide()}.bind(this))},createContents:function(){l.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;this._idCount=this._keyAssistContents.scrollTop=0;if(p&&p.getTextView()){var c=p.getTextView(),a=c.getActions(!0).filter(function(a){return(a=c.getActionDescription(a))&&a.name});a.sort(function(a,b){return c.getActionDescription(a).name.localeCompare(c.getActionDescription(b).name)});this.createHeader(j.Editor);for(var b=function(a){return function(){c.focus();
return c.invokeAction(a)}},m={},f,d=0;d<a.length;d++)for(var h=a[d],w=c.getActionDescription(h),u=c.getKeyBindings(h),n=0;n<u.length;n++){f=u[n];var z=g.getUserKeyString(f);f.scopeName?(m[f.scopeName]||(m[f.scopeName]=[]),m[f.scopeName].push({bindingString:z,name:w.name,execute:b(h)})):this.createItem(z,w.name,b(h))}for(var i in m)if(m[i].length){this.createHeader(i);for(a=0;a<m[i].length;a++)f=m[i][a],this.createItem(f.bindingString,f.name,f.execute)}}this.createHeader(j.Global);e.showKeyBindings(this)},
createItem:function(c,a,b){if(this._filterString){var e=this._filterString.toLowerCase(),m;e!==this._filterString?(e=this._filterString,m=function(c){return c}):m=function(c){return c.toLowerCase()};if(m(a).indexOf(e)===-1&&m(c).indexOf(e)===-1&&m(this._lastHeader).indexOf(e)===-1)return}var g=this._keyAssistTable.insertRow(-1);g.id="keyAssist-keyBinding-"+this._idCount++;g.setAttribute("role","menuitem");g._execute=b;g.classList.add("keyAssistItem");g.addEventListener("click",function(c){this._selectedRow=
g;this.execute();c.preventDefault()}.bind(this));b=g.insertCell(-1);b.classList.add("keyAssistName");b.appendChild(document.createTextNode(a));b=g.insertCell(-1);b.classList.add("keyAssistAccel");b.appendChild(document.createTextNode(c))},createHeader:function(c){this._lastHeader=c;var a=this._keyAssistTable.insertRow(-1);a.classList.add("keyAssistSection");var a=a.insertCell(-1),b=document.createElement("h2");b.appendChild(document.createTextNode(c));a.appendChild(b)},execute:function(){window.setTimeout(function(){this.hide();
var c=this._selectedRow;this._selectedRow=null;c&&c._execute&&c._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var c=this._keyAssistInput.value;if(this._filterString!==c)this._filterString=c,this.createContents()}.bind(this),100)},hide:function(){var c=document.activeElement,a=this._keyAssistDiv,c=a===c||(a.compareDocumentPosition(c)&16)!==0;a.style.display="none";c&&document.compareDocumentPosition(this._previousActiveElement)!==
1&&this._previousActiveElement.focus();this._previousActiveElement=null},isVisible:function(){return this._keyAssistDiv.style.display==="block"},select:function(c){var a=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(a.length===0)this._selectedIndex=-1;else{var b=this._selectedIndex;b+=c?1:-1;b%=a.length;b<0&&(b=a.length-1);if(this._selectedIndex!==-1)c=a[this._selectedIndex],c.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=b;if(this._selectedIndex!==-1){this._selectedRow=
c=a[this._selectedIndex];c.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",c.id);this._keyAssistTable.focus();var a=c.getBoundingClientRect(),e=this._keyAssistContents,m=e.getBoundingClientRect();c.offsetTop<e.scrollTop?b===0?e.scrollTop=0:c.scrollIntoView(!0):a.bottom>m.bottom&&c.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(c){if(c.keyCode===40)this.select(!0);else if(c.keyCode===38)this.select(!1);else if(c.keyCode===13)this.execute();else return;c.preventDefault()},_scrollWheel:function(c){var a=0,a=F.isIE||F.isOpera?-c.wheelDelta:F.isFirefox?c.detail*40:-c.wheelDeltaY,b=this._keyAssistContents,e=b.scrollTop;b.scrollTop+=a;if(e!==b.scrollTop)return c.preventDefault&&
c.preventDefault(),!1}};var P=new o,y=new a.Command({name:j["Show Keys"],tooltip:j["Show a list of all the keybindings on this page"],id:"eclipse.keyAssist",callback:function(){P.isVisible()?P.hide():P.show();return!0}});e.addCommand(y);e.registerCommandContribution("globalActions","eclipse.keyAssist",100,null,!0,new d.KeyBinding(191,!1,!0));A=function(){p.getTextView().setKeyBinding(new d.KeyBinding(191,!1,!0,!F.isMac,F.isMac),y.id);p.getTextView().setAction(y.id,y.callback,y)};p&&(p.getTextView()?
A():p.addEventListener("TextViewInstalled",A));G(e);U(b,y.callback);T(b);window.addEventListener("hashchange",function(){e.processURL(window.location.href)},!1);window.setTimeout(function(){L(b)},0);J.afterGenerateBanner.apply(this,arguments)},getToolbarElements:H,getMainSplitter:function(){return R},layoutToolbarElements:I,setPageTarget:function(c){var a,b,m=c.breadcrumbRootName,g=c.serviceRegistry;c.target?(c.searchService&&c.searchService.setLocationByMetaData(c.target),c.fileService&&!c.breadcrumbTarget&&
(b=m?m+" ":"",b+=c.fileService.fileServiceName(c.target.Location),m=null),a=c.name||c.target.Name,N=c.target,y(g,c.target,S,c.commandService,c.makeAlternate)):(c.breadcrumbTarget||(m=m||c.task||c.name),a=c.name,y(g,{NoTarget:""},S,c.commandService,c.makeAlternate));(K=c.title)||(K=a?a+" - "+c.task:c.task);window.document.title=K;J.afterSetPageTarget.apply(this,arguments);if(a=l.node("location")){l.empty(a);var f=g&&new O.FileClient(g),g=c.breadcrumbTarget||c.target,f=f&&g&&g.Location?f.fileServiceRootURL(g.Location):
null;new e.BreadCrumbs({container:a,resource:g,rootSegmentName:m,workspaceRootSegmentName:b,workspaceRootURL:f,makeHref:c.makeBreadcrumbLink})}},setDirtyIndicator:function(c){if(K)K.charAt(0)==="*"&&!c&&(K=K.substring(1)),c&&K.charAt(0)!=="*"&&(K="*"+K),window.document.title=K;var a=l.node("dirty");if(a)a.textContent=c?"*":""},setPageCommandExclusions:function(c){S=c},notifyAuthenticationSite:b}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(j){return{detectValidURL:function(k){for(var i=/\[([^\]]*)\]\(([^\)]+)\)/g,d=i.exec(k),b=[],a=0;d;){if(d.length===3&&d[2].length>0){var f=new URL(d[2]);f.protocol!==":"&&j.validateURLScheme(f.href)&&(d.index>a&&b.push({segmentStr:k.substring(a,d.index)}),b.push({segmentStr:d[1].length>0?d[1]:d[2],urlStr:d[2]}),a=d.index+d[0].length)}d=i.exec(k)}if(a===0)return null;a<k.length-1&&b.push({segmentStr:k.substring(a)});return b},processURLSegments:function(j,
i){i.forEach(function(d){if(d.urlStr){var b=document.createElement("a");b.href=d.urlStr;b.appendChild(document.createTextNode(d.segmentStr))}else b=document.createElement("span"),b.textContent=d.segmentStr;j.appendChild(b)})}}});
define("orion/status",["require","orion/webui/littlelib","orion/globalCommands","orion/PageUtil","orion/urlUtils"],function(j,k,i,d,b){function a(a,b,c,e,f){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.message",this);this._operationsClient=b;this.notificationContainerDomId=f;this.domId=c;this.progressDomId=e||c;this._hookedClose=!1;this._timer=null}var f;a.prototype={_init:function(){var a=k.node("closeNotifications");if(a&&!this._hookedClose)this._hookedClose=!0,
a.addEventListener("click",function(){window.clearTimeout(this._timer);this.setProgressMessage("")}.bind(this))},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=i.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(a,b,c){this._init();this.currentMessage=a;var e=k.node(this.domId);if(typeof c==="boolean"){var f=e.getAttribute("aria-live");e.setAttribute("aria-live",c?"polite":"off");window.setTimeout(function(){a===
this.currentMessage&&(k.empty(e),e.appendChild(document.createTextNode(a)),window.setTimeout(function(){e.setAttribute("aria-live",f)},100))}.bind(this),100)}else k.empty(e),e.appendChild(document.createTextNode(a));typeof b==="number"&&window.setTimeout(function(){a===this.currentMessage&&(k.empty(e),e.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(c){}var a=
b.Message||b,e="red";if(b.Severity)switch(b.Severity){case "Warning":e="#FFCC00";break;case "Error":e="red";break;case "Info":case "Ok":e="green"}b=document.createElement("span");b.style.color=e;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 c=k.node(this.progressDomId);
k.empty(c);c.appendChild(b);c.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 f=a.responseText||a;if(typeof f===
"string")try{f=JSON.parse(f)}catch(c){}this._init();var e=f.Message||f,d="core-sprite-information",n="progressInfo",p=document.createElement("span");p.classList.add("imageSprite");p.classList.add("progressIcon");a=[];if(f.Severity)switch(f.Severity){case "Warning":d="core-sprite-warning";n="progressWarning";a.push("progressInfo");a.push("progressError");a.push("progressNormal");break;case "Error":d="core-sprite-error";n="progressError";a.push("progressWarning");a.push("progressInfo");a.push("progressNormal");
break;default:a.push("progressWarning"),a.push("progressError"),a.push("progressNormal")}a.push("notificationHide");p.classList.add(d);var i=k.node(this.progressDomId),d=k.node(this.notificationContainerDomId);k.empty(i);i.appendChild(p);if(f.HTML)f=document.createElement("span"),f.innerHTML=e,i.appendChild(f);else{if(p=b.detectValidURL(e))e=document.createDocumentFragment(),b.processURLSegments(e,p),Array.prototype.forEach.call(k.$$("a",e),function(c){c.target="_blank"});else{if(f.Severity!=="Warning"&&
f.Severity!=="Error")this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3);e=document.createTextNode(e)}i.appendChild(e)}if(n&&this.progressDomId!==this.domId){d.classList.add(n);for(n=0;n<a.length;n++)d.classList.remove(a[n])}d.classList.add("notificationShow")},showWhile:function(a,b){var c=this;if(b){c.setProgressMessage(b);var e=function(){b===c.currentMessage&&c.setProgressMessage("")};a.then(e,e)}return a},
_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(a,b){return new f(this,++this._lastProgressId,a,b)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var a="",b=!0,c;for(c in this._progressMonitors)this._progressMonitors[c].status&&(b||(a+=", "),a+=this._progressMonitors[c].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()}};a.prototype.constructor=a;f=function(a,b,c,e){this.statusService=a;this.progressId=b;if(c){this.deferred=c;this.begin(e);var f=this;c.then(function(){f.done.bind(f)()},function(){f.done.bind(f)()})}};
f.prototype.begin=function(a){this.status=a;this.statusService._beginProgressMonitor(this)};f.prototype.done=function(a){this.status=a;this.statusService._doneProgressMonitor(this)};f.prototype.worked=function(a){this.status=a;this.statusService._workedProgressMonitor(this)};f.prototype.constructor=f;return{StatusReportingService:a,ProgressMonitor:f}});
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(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(j,k,i,d){function b(){}b.prototype={_initialize:function(a,b,h,g,c){this._tooltip=new d.Tooltip({node:a,hideDelay:c||0,afterShowing:this._afterShowingFunction(b).bind(this),afterHiding:h,trigger:g?g:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";a=document.createRange();a.selectNode(this.$parent);a=a.createContextualFragment(this.TEMPLATE);
this.messages&&i.processTextNodes(a,j);this.$parent.appendChild(a);var e=this._tooltip;this.$parent.addEventListener("keydown",function(c){c.keyCode===i.KEY.ESCAPE&&e.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(a){for(var b=0;b<a.childNodes.length;b++){var d=a.childNodes[b];d.id&&(this["$"+d.id]=d);this._bindElements(d)}},_afterShowingFunction:function(a){return function(){a&&a.bind(this)();if(!this.customFocus){var b=
i.firstTabbable(this.$parent);b&&b.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};b.prototype.constructor=b;return{PopupDialog:b}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(j,k,i,d){var b={};(function(){var a=!1;b.updateNavTools=function(b,d,g,c,e,l){var n=i.node(c);if(n)d.destroy(n);else throw j["could not find toolbar "]+c;d.renderCommands(c,n,l,g,"button");if(e&&(c=i.node(e)))d.destroy(c),d.renderCommands(e,c,null,g,"button");a||(a=!0,b.getService("orion.page.selection").addEventListener("selectionChanged",function(c){var a=i.node(e);
a&&(d.destroy(a),d.renderCommands(e,a,c.selections,g,"button"))}))};b.createOperationsCommands=function(a,b,g){function c(c){return!c.operation||!c.operation.type?!1:c.operation.type==="loadstart"||c.operation.type==="progress"}var e=new d.Command({name:j["Remove Completed"],tooltip:j["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){g.removeCompletedOperations().then(function(){b.loadOperations.bind(b)()})},visibleWhen:function(){return!0}});a.addCommand(e);
e=new d.Command({name:j.Remove,tooltip:j["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(c){for(var c=Array.isArray(c.items)?c.items:[c.items],a=0;a<c.length;a++){var e=c[a];g.removeOperation.bind(g)(e.Location).then(function(){b.loadOperations.bind(b)()},function(){b.loadOperations.bind(b)()})}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return!c(a);for(var b in a)if(c(a[b]))return!1;return!0}});a.addCommand(e);
e=new d.Command({name:j.Cancel,tooltip:j["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(c){for(var c=Array.isArray(c.items)?c.items:[c.items],a=0;a<c.length;a++){var b=c[a];b.deferred&&b.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return c(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var b in a)if(!c(a[b])||!a[b].operation||!a[b].operation.cancelable)return!1;return!0}});a.addCommand(e)}})();
return b});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(j,k,i,d,b){function a(a){this._options=a}a.prototype=new d.PopupDialog;a.prototype.TEMPLATE='<table style="width: 360px;"><tr><td><h2>Recent operations</h2></td><td style="text-align: right;"><a id="allOperationsLink" class="navlinkonpage">All Operations</a></td></tr></table><div id="operationsExist"><div style="padding-left: 7px" id="myOperationsListEmpty">No operations running on this page.</div><table id="myOperationsList" style="display: none;"></table></div><div style="padding-left: 7px" id="operationsDontExist">No operations running.</div>';a.prototype._init=
function(a){this._myOperations=[];this._operationsDeferreds=[];this._commandService=a.commandRegistry;b.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(a.triggerNode)};a.prototype._bindToDom=function(){this.$allOperationsLink.href=k.toUrl("operations/list.html");this._setOperationsVisibility()};a.prototype.setOperations=function(a,b){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(a)for(var g in a)this._myOperations.push(a[g]),this._operationsDeferreds.push(b[g]);this._renderOperations()};a.prototype.parseProgressResult=function(a){if(!a)return{};a=a.responseText||a;try{a=JSON.parse(a)}catch(b){}var g={Message:a.Message||a,Severity:a.Severity};if(a.DetailedMessage&&a.DetailedMessage!==g.Message)g.DetailedMessage=a.DetailedMessage;return g};a.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};a.prototype._renderOperationsTable=function(a,b,g){i.empty(a);for(var c=0;c<b.length;c++){var e=b[c],d=document.createElement("tr"),n=document.createElement("td");n.style.paddingLeft="5px";n.style.paddingRight="5px";n.textContent=e.Name;d.appendChild(n);var p=document.createElement("div");n.appendChild(p);n=document.createElement("span");n.style.paddingRight="5px";n.classList.add("imageSprite");switch(e.type){case "Warning":n.classList.add("core-sprite-warning");n.setAttribute("aria-label",
j["Operation resulted in a warning."]);break;case "error":n.classList.add("core-sprite-error");n.setAttribute("aria-label",j["Operation resulted in an error."]);break;case "loadstart":case "progress":n.classList.add("core-sprite-start");n.setAttribute("aria-label",j["Operation is running."]);break;case "abort":n.classList.add("core-sprite-stop");n.setAttribute("aria-label",j["Operation is canceled."]);break;case "load":case "loadend":n.classList.add("core-sprite-ok"),n.setAttribute("aria-label","Operation ok.")}p.appendChild(n);
n=document.createElement("span");n.classList.add("operationStatus");n.textContent=e.Name;p.appendChild(n);if(e.error){var o=e.error.Message||e.error;e.error.DetailedMessage&&e.error.DetailedMessage!==""&&(o+=": "+e.error.DetailedMessage);n.textContent=o;n.classList.remove("operationStatus");n.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",p,{operation:e,deferred:g[c]},this,"tool");a.appendChild(d)}this._setOperationsVisibility()};a.prototype._setOperationsVisibility=
function(){this.$myOperationsList.style.display=this._myOperations.length>0?"":"none";this.$myOperationsListEmpty.style.display=this._myOperations.length>0?"none":"";this.$operationsDontExist.style.display=this._myOperations.length>0?"none":"";this.$operationsExist.style.display=this._myOperations.length>0?"":"none"};a.prototype.constructor=a;return{OperationsDialog:a}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(j,k,i,d,b){function a(a,f){if(!this._progressPane){this._progressPane=d.node(a);this._operationsDialog=new b.OperationsDialog({triggerNode:this._progressPane,commandRegistry:f});var c=this;this._progressPane.addEventListener("keydown",function(a){(a.charOrCode===" "||a.keyCode===d.KEY.ENTER)&&c._operationsDialog.show()})}}function f(a,b,c,e){this._serviceRegistry=
a;this._serviceRegistration=a.registerService("orion.page.progress",this);this._commandRegistry=c;this._operationsClient=b;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=e}a.prototype={_switchIconTo:function(a){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=a;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(a,b){var c=
{},e;for(e in a)a[e].progressMonitor||(c[e]=a[e]);if(this._isEmpty(c))this._switchIconTo("progressPane_empty"),this._progressPane.title=j.Operations,this._progressPane.alt=j.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var f="";for(e in c){var d=c[e];if(d.type&&(d.type==="loadstart"||d.type==="progress")){f="running";break}}switch(f){case "running":this._progressPane.title=j["Operations running"];this._progressPane.alt=j["Operations running"];
this._progressPane.setAttribute("aria-valuetext",j["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=j["Some operations finished with warning"];this._progressPane.alt=j["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",j["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=j["Some operations finished with error"];this._progressPane.alt=
j["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",j["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=j.Operations,this._progressPane.alt=j.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}};
a.prototype.constructon=a;f.prototype={init:function(b){if(!this._progressMonitorClass)this._progressMonitorTool=new a(b,this._commandRegistry)},progress:function(a,b,c){var e=this,f=this._operationsIndex++;!c&&this._progressMonitorClass&&(c=new this._progressMonitorClass,c.begin(b));a.then(function(){if(e._operations[f]){var d=e._operations[f];if(b)d.Name=b;e._lastOperation=d;d.type="loadend";if(c)d.progressMonitor=c;e.writeOperation.bind(e)(f,d,a);d.Location||e._removeOperationFromTheList.bind(e)(f)}},
function(d){if(e._operations[f]){var p=e._operations[f];if(b)p.Name=b;if(c)p.progressMonitor=c;e._lastOperation=p;p.type=d.canceled?"abort":"error";p.error=d;e.writeOperation.bind(e)(f,p,a);p.Location||e._removeOperationFromTheList.bind(e)(f)}},function(d){if(b)d.Name=b;if(c)d.progressMonitor=c;e.writeOperation.bind(e)(f,d,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(c){c.put(b.Location,{Name:b.Name,expires:b.expires})});b.progressMonitor?b.progressMonitor.progress(b.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};f.prototype.constructor=f;return{ProgressService:f}});
define("orion/dialogs",[],function(){function j(j){this._serviceRegistry=j;this._serviceRegistration=j.registerService("orion.page.dialog",this)}j.prototype={confirm:function(j,i){i(window.confirm(j))},openFiles:function(){}};j.prototype.constructor=j;return{DialogService:j}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(j){function k(i,d){d||(d="orion.page.selection");this._serviceRegistry=i;j.attach(this);this._serviceRegistration=i.registerService(d,this);this._selections=null}k.prototype={getSelection:function(i){var d=this._getSingleSelection();typeof i==="function"&&i(d);return d},getSelections:function(i){var d=Array.isArray(this._selections)?this._selections.slice():[];typeof i==="function"&&i(d);return d},_getSingleSelection:function(){return this._selections&&
this._selections.length>0?this._selections[0]:null},setSelections:function(i){var d=this._selections;this._selections=Array.isArray(i)?i.length>0?i.slice():null:i?[i]:null;d!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};k.prototype.constructor=k;return{Selection:k}});
define("orion/section",["orion/webui/littlelib","orion/selection","orion/commandRegistry","orion/commonHTMLFragments"],function(j,k,i,d){function b(a,b){var g=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite";if(!b.id)throw Error("Missing required argument: id");this.id=b.id;if(!b.title)throw Error("Missing required argument: title");var c=b.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:
["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");a.appendChild(this.domNode);for(var e=0;e<c.length;e++)this.domNode.classList.add(c[e]);this.domNode.id=b.id;if(b.canHide)this.twistie=document.createElement("span"),this.twistie.classList.add("modelDecorationSprite"),this.twistie.classList.add("layoutLeft"),this.twistie.classList.add("sectionTitle"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),this.domNode.tabIndex=0,this.domNode.addEventListener("click",
function(c){(c.target===g.titleNode||c.target===g.twistie)&&g._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(c){c.keyCode===j.KEY.ENTER&&(c.target===g.domNode||c.target===g.titleNode||c.target===g.twistie)&&g._changeExpandedState()},!1);if(b.iconClass){var l=document.createElement("span");l.classList.add("sectionIcon");this.domNode.appendChild(l);(Array.isArray(b.iconClass)?b.iconClass:[b.iconClass]).forEach(function(c){l.classList.add(c)})}this.titleNode=document.createElement("div");
this.titleNode.id=b.id+"Title";this.titleNode.classList.add("sectionAnchor");this.titleNode.classList.add("sectionTitle");this.titleNode.classList.add("layoutLeft");this.domNode.appendChild(this.titleNode);this.titleNode.textContent=b.title;if(typeof b.getItemCount==="function")c=document.createElement("div"),c.classList.add("layoutLeft"),c.classList.add("sectionItemCount"),this.domNode.appendChild(c),c.textContent=b.getItemCount(this);this._progressNode=document.createElement("div");this._progressNode.id=
b.id+"Progress";this._progressNode.classList.add("sectionProgress");this._progressNode.classList.add("sectionTitle");this._progressNode.classList.add("layoutLeft");this._progressNode.style.visibility="hidden";this._progressNode.textContent="...";this.domNode.appendChild(this._progressNode);c=document.createElement("div");c.id=b.id+"FilterSearchBox";this.domNode.appendChild(c);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=b.id+"ToolActionsArea";this._toolActionsNode.classList.add("layoutRight");
this._toolActionsNode.classList.add("sectionActions");this.domNode.appendChild(this._toolActionsNode);this.actionsNode=document.createElement("div");this.actionsNode.id=b.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("sectionActions");this.domNode.appendChild(this.actionsNode);this.selectionNode=document.createElement("div");this.selectionNode.id=b.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("sectionActions");
this.domNode.appendChild(this.selectionNode);b.slideout&&(c=d.slideoutHTMLFragment(b.id),e=document.createRange(),e.selectNode(this.domNode),c=e.createContextualFragment(c),this.domNode.appendChild(c));this._contentParent=document.createElement("div");this._contentParent.id=this.id+"Content";this._contentParent.role="region";this._contentParent.classList.add("sectionTable");this._contentParent.setAttribute("aria-labelledby",this.titleNode.id);a.appendChild(this._contentParent);b.content&&this.setContent(b.content);
this.hidden=b.hidden;if(typeof b.onExpandCollapse==="function")this._onExpandCollapse=b.onExpandCollapse;this._preferenceService=b.preferenceService;this._contentParent.style.display="none";if(this._preferenceService){var n=this;this._preferenceService.getPreferences("/window/views").then(function(c){c=c.get(n.id);if(c!==void 0)n.hidden=!c;if(!n.hidden)n._contentParent.style.display="block";n._updateExpandedState(!n.hidden,!1)})}else{if(!this.hidden)this._contentParent.style.display="block";this._updateExpandedState(!this.hidden,
!1)}this._commandService=b.commandService;this._lastMonitor=0;this._loading={}}function a(a){this._section=a;this._id=++a._lastMonitor}b.prototype={setTitle:function(a){this.titleNode.textContent=a},setContent:function(a){typeof a==="string"?this._contentParent.innerHTML=a:(this._contentParent.innerHTML="",this._contentParent.appendChild(a))},getContentElement:function(){return this._contentParent},createProgressMonitor:function(){return new a(this)},_setMonitorMessage:function(a,b){this._progressNode.style.visibility=
"visible";this._loading[a]=b;var d="",c;for(c in this._loading)d!==""&&(d+="\n"),d+=this._loading[c];this._progressNode.title=d},_monitorDone:function(a){delete this._loading[a];var a="",b;for(b in this._loading)a!==""&&(a+="\n"),a+=this._loading[b];this._progressNode.title=a;if(a==="")this._progressNode.style.visibility="hidden"},_changeExpandedState:function(){this.hidden?(this._contentParent.style.display="block",this.hidden=!1):(this._contentParent.style.display="none",this.hidden=!0);this._updateExpandedState(!this.hidden,
!0)},_updateExpandedState:function(a,b){var d=this.twistie,c=this.id;d&&(d.classList.add(a?this._expandImageClass:this._collapseImageClass),d.classList.remove(a?this._collapseImageClass:this._expandImageClass));this._preferenceService&&b&&this._preferenceService.getPreferences("/window/views").then(function(b){b.put(c,a)});this._onExpandCollapse&&this._onExpandCollapse(a,this)}};b.prototype.constructor=b;a.prototype={begin:function(a){this.status=a;this._section._setMonitorMessage(this.id,a)},worked:function(a){this.status=
a;this._section._setMonitorMessage(this.id,a)},done:function(a){this.status=a;this._section._monitorDone(this.id)}};a.prototype.constructor=a;return{Section:b}});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(j,k){function i(d){this._init(d)}i.prototype={_init:function(d){var b=d.parent,a=this,b=k.node(b);if(!b)throw j["no parent"];if(!d.model)throw j["no tree model"];if(!d.renderer)throw j["no renderer"];this._parent=b;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(b){a._showRoot?(b._depth=0,a._generate([b],0)):a._treeModel.getChildren(b,function(b){a._generate(b,0)})})},_generate:function(d,b){k.empty(this._parent);var a=document.createElement("div");this._renderer.wrapperCallback&&
this._renderer.wrapperCallback(a);var f=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(f);f.id=this._id;this._tableStyle&&f.classList.add(this._tableStyle);this._renderer.initTable(f,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+"tbody";this._generateChildren(d,b);f.appendChild(this._bodyElement);a.appendChild(f);
this._parent.appendChild(a);this._rowsChanged()},_generateChildren:function(d,b,a){for(var f=0;f<d.length;f++){var h=document.createElement(this._tableRowElement);h.id=this._treeModel.getId(d[f]);this._renderer.rowCallback&&this._renderer.rowCallback(h);h._depth=b;h._item=d[f];this._renderer.render(d[f],h);h.childNodes[this._labelColumnIndex].style.paddingLeft=this._indent*b+"px";a?(this._bodyElement.insertBefore(h,a.nextSibling),a&&(a=h)):this._bodyElement.appendChild(h)}},_rowsChanged:function(){this._renderer.rowsChanged&&
this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(d,b,a){var f=this._treeModel.getId(d),h;if(f===this._id)this._removeChildRows(f),this._generateChildren(b,0),this._rowsChanged();else{var g=k.node(f);g?(g._item=d,g&&(a||g._expanded)?(g._expanded=!0,this._removeChildRows(f),this._renderer.updateExpandVisuals(g,!0),b?(this._generateChildren(b,g._depth+1,g),this._rowsChanged()):(h=this,b=this._treeModel.getChildren(g._item,function(c){h._generateChildren(c,
g._depth+1,g);h._rowsChanged()}))):this._renderer.updateExpandVisuals(g,!1)):console.log(j["could not find table row "]+f)}},getItem:function(d){var b=k.node(d);return b&&b._item?b._item:d},toggle:function(d){var b=k.node(d);b&&(b._expanded?(this.collapse(d),this._renderer.updateExpandVisuals(b,!1)):(this.expand(d),this._renderer.updateExpandVisuals(b,!0)))},isExpanded:function(d){return(d=k.node(d))?d._expanded:!1},expand:function(d,b,a){var d=typeof d==="string"?d:this._treeModel.getId(d),f=k.node(d);
if(f&&!f._expanded){f._expanded=!0;var h=this;this._renderer.updateExpandVisuals(f,!0);this._treeModel.getChildren(f._item,function(d){h._generateChildren(d,f._depth+1,f);h._rowsChanged();b&&b.apply(h,a)})}},_removeChildRows:function(d){for(var b=d===this._id,a=!1,f=-1,h=[],g=k.$$array(".treeTableRow",this._parent),c=0;c<g.length;c++){var e=g[c];if(a)break;if(b)e._depth>f?h.push(e):a=!0;else if(e.id===d)b=!0,f=e._depth}for(d=0;d<h.length;d++)b=h[d],b.parentNode.removeChild(b)},collapse:function(d){var d=
typeof d==="string"?d:this._treeModel.getId(d),b=k.node(d);if(b){if(!b._expanded)return;b._expanded=!1;this._renderer.updateExpandVisuals(b,!1);this._removeChildRows(d);this._rowsChanged()}this._onCollapse&&this._onCollapse(b._item)}};i.prototype.constructor=i;return{TableTree:i}});
define("orion/treeModelIterator",[],function(){var j={};j.TreeModelIterator=function(){function j(i,d){this.firstLevelChildren=i;this.reset();this._init(d)}j.prototype={_init:function(i){if(i)this.isExpanded=i.isExpanded,this.isExpandable=i.isExpandable,this.forceExpandFunc=i.forceExpandFunc,this.getChildrenFunc=i.getChildrenFunc},topLevel:function(i){return i.parent?i.parent===this.root:!0},_getChildren:function(i){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(i):i?i.children:
null},_expanded:function(i){if(!i)return!0;var d=this._getChildren(i),d=d&&d.length>0;this.isExpanded&&d&&(d=this.isExpanded(i));return d},_expandable:function(i){return!i?!0:this.isExpandable?this.isExpandable(i):!1},_diveIn:function(i){return this._expanded(i)?(this.setCursor(this._getChildren(i)[0]),this.cursor()):null},_drillToLast:function(i){return this._expanded(i)?(i=this._getChildren(i),this._drillToLast(i[i.length-1])):i},_forward:function(i){if(!this._cursor)return null;var d=this._diveIn(this._cursor);
if(!d){if(i&&this._expandable(this._cursor)&&this.forceExpandFunc){var b=this;return this.forceExpandFunc(this._cursor,"first",function(a){a&&b.setCursor(a)})}(d=this._findSibling(this._cursor,!0))&&this.setCursor(d)}return d},_backward:function(i){if(!this._cursor)return null;var d=this._findSibling(this._cursor,!1);d&&d!==this._cursor.parent&&(d=this._drillToLast(d));if(i&&d&&this._expandable(d)&&this.forceExpandFunc&&d!==this._cursor.parent){var b=this;return this.forceExpandFunc(d,"last",function(a){a&&
b.setCursor(a)})}d&&this.setCursor(d);return d},_findSibling:function(i,d){for(var b=this.topLevel(i),a=this._getChildren(i.parent),a=b?this.firstLevelChildren:a,f=0;f<a.length;f++)if(a[f]===i)return f===0&&!d?b?null:i.parent:f===a.length-1&&d?b?null:this._findSibling(i.parent,d):d?a[f+1]:a[f-1];return null},_inParentChain:function(i,d){for(var b=i.parent;b;){if(b===d)return!0;b=b.parent}return!1},_getTopLevelParent:function(i){if(this.topLevel(i))return i;for(i=i.parent;i;){if(this.topLevel(i))return i;
i=i.parent}return null},_onCollapse:function(i){return this._expanded(i.parent)?i:this._onCollapse(i.parent)},_scan:function(i,d,b){this.setCursor(d);var a=[];for(a.push(d);;){if(this.iterate(i))a.push(this.cursor());else break;if(b===this.cursor())return a}return null},setCursor:function(i){this._prevCursor=this._cursor;this._cursor=i},setTree:function(i){this.firstLevelChildren=i;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(i,d){var b=this.cursor(),
a=this._scan(!0,i,d);a||(a=this._scan(!1,i,d));this.setCursor(b);return a},iterate:function(i,d){return i?this._forward(d):this._backward(d)},iterateOnTop:function(i,d){var b=this._findSibling(this._getTopLevelParent(this.cursor()),i);b?this.setCursor(b):d&&this.firstLevelChildren.length>0&&this.setCursor(i?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(i){if(!this._cursor)return null;return this._inParentChain(this._cursor,i)?(this.setCursor(i),
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 j}();return j});
define("orion/explorers/explorerNavHandler",["i18n!orion/nls/messages","orion/webui/littlelib","orion/treeModelIterator"],function(j,k,i){var j={},d=navigator.userAgent.indexOf("iPad")!==-1,b=window.navigator.platform.indexOf("Mac")!==-1;j.ExplorerNavHandler=function(){function a(a,b,d){this.explorer=a;this.model=this.explorer.model;this._navDict=b;this._listeners=[];this._selections=[];this._currentColumn=0;var c=this._getEventListeningDiv();c.tabIndex=0;c.classList.add("selectionModelContainer");
var e=this;this._modelIterator=new i.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:d.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(c){return e.explorer.renderer.isExpandable(c)}:function(c){return e.isExpandable(c)},forceExpandFunc:this.explorer.forceExpandFunc?function(c,a,b){return e.explorer.forceExpandFunc(c,a,b)}:void 0});this._init(d);(!d||d.setFocus!==!1)&&c.focus();a=function(a){if(a.target===c){if(e.explorer.preventDefaultFunc&&e.explorer.preventDefaultFunc(a,
e._modelIterator.cursor()))return!0;if(a.keyCode===k.KEY.DOWN)return e.onDownArrow(a);else if(a.keyCode===k.KEY.UP)return e.onUpArrow(a);else if(a.keyCode===k.KEY.RIGHT)return e.onRightArrow(a);else if(a.keyCode===k.KEY.LEFT)return e.onLeftArrow(a);else if(a.keyCode===k.KEY.SPACE)return e.onSpace(a);else if(a.keyCode===k.KEY.ENTER)return e.onEnter(a)}};c.addEventListener("keydown",a,!1);this._listeners.push({type:"keydown",listener:a});a=function(){if(e.explorer.onFocus)e.explorer.onFocus(!1);else e.toggleCursor(null,
!1)};c.addEventListener("blur",a,!1);this._listeners.push({type:"blur",listener:a});a=function(){if(e.explorer.onFocus)e.explorer.onFocus(!0);else e.toggleCursor(null,!0)};c.addEventListener("focus",a,!1);this._listeners.push({type:"focus",listener:a});this._parentDiv=c}a.prototype={_init:function(a){this._linearGridMove=!1;if(a)this._selectionPolicy=a.selectionPolicy,this.gridClickSelectionPolicy=a.gridClickSelectionPolicy||"none",this.preventDefaultFunc=a.preventDefaultFunc,this.postDefaultFunc=
a.postDefaultFunc},_ctrlKeyOn:function(a){return b?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(d){b._clearSelection();for(var c=0;c<d.length;c++)b._selections.push(d[c]);b._selections.length>0&&b.cursorOn(b._selections[0],!0,!1,a)})},refreshModel:function(a,b,d,c){this._currentColumn=
0;this.topIterationNodes=[];this.model=b;this._navDict=a;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(d)this.topIterationNodes=d;this._modelIterator.setTree(this.topIterationNodes);!c&&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 d=this._inSelection(a);d>=0?(this._checkRow(a,
!0),this._selections.splice(d,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 d=this._getGridChildren(a);if(d&&d.length>1||b===0&&d){b!==0&&this.toggleCursor(a,!1);var c=this._currentColumn,e=!0;c+=b;c<0?(this._linearGridMove&&b!==0&&(this._modelIterator.iterate(!1)?a=this.currentModel():e=!1),
c=e?d.length-1:this._currentColumn):c>=d.length&&(this._linearGridMove&&b!==0&&(this._modelIterator.iterate(!0)?a=this.currentModel():e=!1),c=e?0:this._currentColumn);this._currentColumn=c;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,d;a&&a!==b&&(d=a.getAttribute("role"))!=="grid"&&d!=="tree"&&d!=="treegrid";)a=a.parentNode;return a===b?null:a},toggleCursor:function(a,b){var d=this.getRowDiv(a),c=this.getCurrentGrid(a);c?(d&&(b?d.classList.add("treeIterationCursorRow"):d.classList.remove("treeIterationCursorRow")),c.domNode&&(d=this.getAriaContainerElement(c.domNode),b?(c.domNode.classList.add("treeIterationCursor"),d&&d.setAttribute("aria-activedescendant",c.domNode.id)):c.domNode.classList.remove("treeIterationCursor"))):
d&&(b?d.classList.add("treeIterationCursorRow_Dotted"):d.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(a,b,d,c){var d=d===void 0?!1:d,e,l;if(a||b){if(l===this._modelIterator.cursor())return;e=this._modelIterator.cursor();l=a;this._modelIterator.setCursor(l)}else e=this._modelIterator.prevCursor(),l=this._modelIterator.cursor();if(e!==l||b)if(this.toggleCursor(e,!1),!b||l)if(this.moveColumn(null,0),this.toggleCursor(l,
!0),(a=this.getRowDiv())&&!c&&!this._visible(a)&&a.scrollIntoView(!d),this.explorer.onCursorChanged)this.explorer.onCursorChanged(e,l)},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,d){this.topIterationNodes.length!==0&&this._modelIterator.iterate(a,b)&&(this.cursorOn(null,!1,a),d&&this.setSelection(this.currentModel(),!0))},_checkRow:function(a,b){if(this.explorer.renderer._useCheckboxSelection){var d=this.getRowDiv(a);if(d){var c=k.node(this.explorer.renderer.getCheckBoxId(d.id)),e=b?!c.checked:!0;if(e!==c.checked)this.explorer.renderer.onCheck(d,c,e,!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 d=this._getEventListeningDiv(!0).getClientRects()[0],c=this._vpHeight();this._vpWidth();for(var b=d.top>b?d.top:
b,d=d.bottom<c?d.bottom:c,a=a.getClientRects(),c=0,e=a.length;c<e;c++){var l=a[c];if(l.top>=b&&l.top<=d&&l.bottom>=b&&l.bottom<=d)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 d=this._getGridChildren(a);if(d)for(var c=0;c<d.length;c++)if(b.target===d[c].domNode)return!0;return!1},onClick:function(a,b){var g=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)));
if(b.target!==g&&!(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(g=this._modelIterator.scan(this._lastSelection,a)){this._clearSelection(!0);for(var c=0;c<g.length;c++)this.setSelection(g[c],!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(),d=this._getGridChildren(b);return d&&d.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 d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(a),!1,!1,!1,0,null);b.domNode.dispatchEvent(d)}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 a}();j.ExplorerNavDict=function(){function a(a){this._dict={};this._model=a}a.prototype={addRow:function(a,
b){this._dict[this._model.getId(a)]={model:a,rowDomNode:b}},getValue:function(a){return this._dict[a]},getGridNavHolder:function(a,b){if(!a)return null;var d=this._model.getId(a);if(this._dict[d]){if(!this._dict[d].gridChildren&&b)this._dict[d].gridChildren=[];return this._dict[d].gridChildren}return null},initGridNavHolder:function(a){if(!a)return null;a=this._model.getId(a);if(this._dict[a])this._dict[a].gridChildren=null}};return a}();return j});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands,orion/commandRegistry".split(","),function(j,k,i,d,b,a){var f={};f.Explorer=function(){function a(b,c,e,d){this.registry=b;this.renderer=e;this.selection=c;this.commandService=d;this.myTree=null}a.prototype={changedItem:function(a,c){this.myTree&&this.myTree.refresh.bind(this.myTree)(a,c,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},
makeNewItemPlaceHolder:function(a,c,b){a=this.getRow(a);if(b)return a=a.childNodes[b],a.appendChild(document.createElement("br")),b=document.createElement("span"),b.id=c+"placeHolderRow",a.appendChild(b),{tempNode:b,refNode:b};if(a){b=document.createElement("tr");b.id=c+"placeHolderRow";var d=document.createElement("td");d.id=c+"placeHolderCol";b.appendChild(d);a.appendChild(b);b=i.node(c+"placeHolderRow");a=i.node(c+"placeHolderCol");if(b&&a)return{tempNode:b,refNode:a}}return null},getRow:function(a){if(a=
this.model.getId(a))return i.node(a)},collapseAll:function(){for(var a=this._navHandler.getTopLevelNodes(),c=0;c<a.length;c++)this.myTree.collapse(a[c])},expandAll:function(a){if(a)this._expandRecursively(a);else if(this._navHandler)for(var a=this._navHandler.getTopLevelNodes(),c=0;c<a.length;c++)this._expandRecursively(a[c])},_expandRecursively:function(a){if(this._navHandler&&this._navHandler.isExpandable(a)){var c=this;this.myTree.expand(a,function(){c.model.getChildren(a,function(a){if(!(a===
void 0||a===null))for(var b=a.length,d=0;d<b;d++)c._expandRecursively(a[d])})})}},createTree:function(a,c,e){a=typeof a==="string"?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var f=a+"innerTree",h=i.node(f);h&&i.empty(h);if(c)c.rootId=f;this.model=c;this._parentId=a;this._treeOptions=e;if(!e||e&&!e.noSelection)this.selectionPolicy=e?e.selectionPolicy:"",this._navDict=new b.ExplorerNavDict(this.model);this.myTree=new d.TableTree({id:f,
model:c,parent:a,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:e?!!e.showRoot:!1,indent:e?e.indent:void 0,onCollapse:e?e.onCollapse:void 0,navHandlerFactory:e?e.navHandlerFactory:void 0,tableElement:e?e.tableElement:void 0,tableBodyElement:e?e.tableBodyElement:void 0,tableRowElement:e?e.tableRowElement:void 0});this.renderer._initializeUIState();this.selectionPolicy==="cursorOnly"&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},
refreshSelection:function(){if(this.selection){var a=this.getNavHandler(),c=[];if(a&&this.getNavDict())for(var b=a.getSelection(),d=0;d<b.length;d++){var f=a.getRowDiv(b[d]);f&&f.parentNode&&(f=this.getNavDict().getValue(this.model.getId(b[d])),f.model&&c.push(f.model))}this.selection.setSelections(c)}},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 b.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null});var c=this;this.model.getRoot(function(b){b instanceof Array?c.getNavHandler().refreshModel(c.getNavDict(),c.model,b):b.children&&b.children instanceof Array&&c.getNavHandler().refreshModel(c.getNavDict(),c.model,
b.children);a&&a.setFocus&&c.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return a}();f.createExplorerCommands=function(b,d){function c(a){return typeof a.getItemCount==="function"?a.getItemCount()>0?d?d(a):!0:!1:!1}var e=new a.Command({tooltip:j["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return c(a)},callback:function(a){a.items.expandAll()}}),f=new a.Command({tooltip:j["Collapse all"],
imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return c(a)},callback:function(a){a.items.collapseAll()}});b.addCommand(e);b.addCommand(f)};f.ExplorerModel=function(){function a(b,c,e){this.rootPath=b;this.fetchItems=c;this.idPrefix=e||""}a.prototype={destroy:function(){},getRoot:function(a){var c=this;this.fetchItems(this.rootPath).then(function(b){c.root=b;a(b)})},getChildren:function(a,c){a.Children?c(a.Children):a.ChildrenLocation?
this.fetchItems(a.ChildrenLocation).then(function(b){a.Children=b;c(b)}):c([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;for(var a=a.Location.replace(/[\\\/]/g,""),c=this.idPrefix,b=0;b<a.length;b++)c+=a[b].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(b):a[b];return c}};return a}();f.ExplorerFlatModel=function(){function a(b,c,e){this.rootPath=b;this.fetchItems=c;this.root=e}a.prototype=new f.ExplorerModel;a.prototype.getRoot=function(a){if(this.root)a(this.root);else{var c=
this;this.fetchItems(this.rootPath).then(function(b){c.root=b;a(b)})}};a.prototype.getChildren=function(a,c){a===this.root?c(this.root):c([])};return a}();f.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,c){this.tableTree=c;i.empty(a);this._treeTableClass&&
a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,c,b,d,f){var b=b||"tool",h=document.createElement("td");h.id=c.id+"actionswrapper";d&&h.classList.add(d);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,h,a,this.explorer,b,null,f&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return h},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,c){if(this._useCheckboxSelection){var b=document.createElement("td"),d=document.createElement("span");d.id=this.getCheckBoxId(c.id);d.classList.add("core-sprite-check");d.classList.add("selectionCheckmarkSprite");d.rowId=c.id;if(this.getCheckedFunc)d.checked=this.getCheckedFunc(a),d.checked?(this._highlightSelection&&c.classList.add("checkedRow"),d.classList.add("core-sprite-check_on")):
(this._highlightSelection&&c.classList.remove("checkedRow"),d.classList.remove("core-sprite-check_on"));b.appendChild(d);var f=this;d.addEventListener("click",function(a){f.onCheck(c,a.target,a.target.checked?!1:!0,!0)},!1);return b}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,c,b,d,f){(c.checked=b)?c.classList.add("core-sprite-check_on"):c.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(c.rowId,b,d);this.explorer.getNavHandler()&&f&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,
!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),c=this._getUIStatePreferencePath();c&&window.sessionStorage&&(window.sessionStorage[c+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){a=window.sessionStorage[a+"selection"];typeof a==="string"&&(a=a.length>0?JSON.parse(a):null);var c;if(a&&this.explorer.getNavDict()){var b=[];for(c=0;c<a.length;c++){var d=this.explorer.getNavDict().getValue(a[c]);if(d&&d.rowDomNode&&
d.model&&(b.push(d.model),this._highlightSelection&&d.rowDomNode.classList.add("checkedRow"),d=i.node(this.getCheckBoxId(d.rowDomNode.id))))d.checked=!0,d.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(b),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var c=!1,b=window.sessionStorage[a+
"expanded"];typeof b==="string"&&(b=b.length>0?JSON.parse(b):null);var d;if(b)for(d=0;d<b.length;d++)if(i.node(b[d])){this._expanded.push(b[d]);var f=this;this.tableTree.expand(b[d],function(){f._restoreSelections(a)});c=!0}return!c},_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,
c){var b=i.node(this.expandCollapseImageId(a.id));b&&(b.classList.add(c?this._expandImageClass:this._collapseImageClass),b.classList.remove(c?this._collapseImageClass:this._expandImageClass))},getExpandImage:function(a,c,b,d){var f=document.createElement("span");f.id=this.expandCollapseImageId(a.id);c.appendChild(f);f.classList.add(this._twistieSpriteClass);f.classList.add(this._collapseImageClass);if(b){var h=document.createElement("span");c.appendChild(h);h.classList.add(d||"imageSprite");h.classList.add(b)}var i=
this;f.onclick=function(){i.tableTree.toggle(a.id);if(i.tableTree.isExpanded(a.id))i._expanded.push(a.id);else for(var c in i._expanded)if(i._expanded[c]===a.id){i._expanded.splice(c,1);break}(c=i._getUIStatePreferencePath())&&window.sessionStorage&&i._storeExpansions(c)};return f},render:function(a,c){c.classList.add("navRow");this.renderRow(a,c)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),this.explorer.initNavHandler())},updateCommands:function(){if(this.commandService)for(var a=
i.$$array(".treeTableRow"),c=0;c<a.length;c++){var b=a[c],d=i.node(b.id+"actionswrapper");this.commandService.destroy(d);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,d,b._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return a}();f.SelectionRenderer=function(){function a(b,c){this._init(b);this.explorer=c}a.prototype=new f.ExplorerRenderer;
a.prototype.renderTableHeader=function(a){var c=document.createElement("thead"),b=document.createElement("tr");c.classList.add("navTableHeading");this._useCheckboxSelection&&b.appendChild(this.initCheckboxColumn(a));for(var d=0,f=this.getCellHeaderElement(d);f;)f.innerHTML.length>0&&f.classList.add("navColumn"),b.appendChild(f),f=this.getCellHeaderElement(++d);c.appendChild(b);d>0&&a.appendChild(c)};a.prototype.renderRow=function(a,c){c.verticalAlign="baseline";c.classList.add("treeTableRow");var b=
this.explorer.getNavDict();if(b){b.addRow(a,c);var d=this;c.addEventListener("click",function(c){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(a,c)},!1)}if(b=this.getCheckboxColumn(a,c))b.classList.add("checkColumn"),c.appendChild(b);for(var b=0,f=this.getCellElement(b,a,c);f;)c.appendChild(f),b===0?this.getPrimColumnStyle?f.classList.add(this.getPrimColumnStyle()):f.classList.add("navColumn"):this.getSecondaryColumnStyle?f.classList.add(this.getSecondaryColumnStyle()):f.classList.add("secondaryColumn"),
f=this.getCellElement(++b,a,c)};a.prototype.getCellHeaderElement=function(){};a.prototype.getCellElement=function(){};return a}();f.SimpleFlatModel=function(){function a(b,c,e){this.items=b;this.getKey=e;this.idPrefix=c;this.root={children:b}}a.prototype=new f.ExplorerModel;a.prototype.getRoot=function(a){a(this.root)};a.prototype.destroy=function(){};a.prototype.getId=function(a){for(var a=this.getKey(a).replace(/[\\\/]/g,""),c="",b=0;b<a.length;b++)c+=a[b].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(b):
a[b];return this.idPrefix+c};a.prototype.getChildren=function(a,c){a===this.root?c(this.items):c([])};return a}();return f});
define("orion/inputCompletion/inputCompletion",["i18n!orion/search/nls/messages","orion/EventTarget","orion/searchUtils"],function(j,k,i){function d(b,a,d){this._inputField=b;k.attach(this);if(typeof this._inputField==="string")this._inputField=document.getElementById(this._inputField);this._binderFunc=a;(b=d?d.group:null)||(b=this._inputField.id?this._inputField.id:"default__input__group");this._completionIdPrefix=b+"__completion__";this._proposeFromStart=d?d.proposeFromStart:!1;this._extendedProvider=
d?d.extendedProvider:null;this._serviceRegistry=d?d.serviceRegistry:null;this._proposalIndex=-1;this._dismissed=!0;this._mouseDown=!1;this._dataList=[];this._initUI();this.addEventListener("recentSearchesChanged",function(){this._binderFunc&&this._binderFunc(function(a){this._bind(a);this._proposeOn(this._inputField.value)}.bind(this))}.bind(this));this._completionUIContainer.addEventListener("mousedown",function(){this._mouseDown=!0}.bind(this));this._completionUIContainer.addEventListener("mouseup",
function(){this._mouseDown=!1}.bind(this));this._inputField.addEventListener("blur",function(){this._mouseDown?window.setTimeout(function(){this._inputField.focus()}.bind(this),200):this._dismiss()}.bind(this));this._inputField.addEventListener("keydown",function(a){this.onKeyDown(a)}.bind(this));this._inputField.addEventListener("input",function(){this._proposeOn(this._inputField.value)}.bind(this));this._inputField.addEventListener("focus",function(){if(this._dismissed&&this._binderFunc)this._dismissing?
this._dismissing=!1:this._binderFunc&&this._binderFunc(function(a){this._bind(a)}.bind(this))}.bind(this))}d.prototype.onKeyDown=function(b){if(this._dismissed)return!0;var a=b.charCode||b.keyCode;if(a===13){if(this._proposalList&&this._proposalList.length>0&&this._proposalIndex>=0&&this._proposalIndex<this._proposalList.length)return b.preventDefault(),this._dismiss(this._proposalList[this._proposalIndex].item.value,b.ctrlKey),b.stopPropagation(),!1}else if((a===40||a===38)&&this._proposalList&&
this._proposalList.length>0)return b.preventDefault(),this._walk(a===40),b.stopPropagation(),!1;else if(a===27)return b.preventDefault(),this._dismiss(),!1;else if(a===46&&this._proposalIndex>-1)return b.preventDefault(),this._delete(),b.stopPropagation(),!1;return!0};d.prototype._bind=function(b){this._dataList=b};d.prototype._getUIContainerID=function(){return this._completionIdPrefix+"UIContainer"};d.prototype._getUIProposalListId=function(){return this._completionIdPrefix+"UIProposalList"};d.prototype._initUI=
function(){this._completionUIContainer=document.getElementById(this._getUIContainerID());if(!this._completionUIContainer)this._completionUIContainer=document.createElement("div"),this._completionUIContainer.id=this._getUIContainerID(),this._completionUIContainer.style.display="none",this._completionUIContainer.className="inputCompletionContainer",this._completionUIContainer.setAttribute("role","list"),this._completionUIContainer.setAttribute("aria-atomic","true"),this._completionUIContainer.setAttribute("aria-live",
"assertive"),document.body.appendChild(this._completionUIContainer);this._completionUIContainer.textContent="";this._completionUL=document.getElementById(this._getUIProposalListId());if(!this._completionUL)this._completionUL=document.createElement("ul"),this._completionUL.id=this._getUIProposalListId(),this._completionUL.className="inputCompletionUL";this._completionUL.textContent="";this._completionUIContainer.appendChild(this._completionUL)};d.prototype._createProposalLink=function(b,a,d,h){var g=
document.createElement("a");g.href=require.toUrl(a);g.appendChild(this._createBoldText(b,d,h));return g};d.prototype._createBoldText=function(b,a,d,h){if(a<0)return document.createTextNode(b);var h=h?h:document.createElement("span"),g;0!==a&&(g=document.createTextNode(b.substring(0,a)),h.appendChild(g));var c=document.createElement("b");h.appendChild(c);g=document.createTextNode(b.substring(a,a+d));c.appendChild(g);a+d<b.length-1&&(g=document.createTextNode(b.substring(a+d)),h.appendChild(g));return h};
d.prototype._proposeOnCategory=function(b,a){if(a.length!==0){var d;if(b){d=document.createElement("li");d.className="inputCompletionLICategory";var h=document.createTextNode(b);d.appendChild(h);this._completionUL.appendChild(d)}a.forEach(function(a){d=document.createElement("li");d.onmouseover=function(a){this._selectProposal(a.currentTarget)}.bind(this);d.onclick=function(a){this._dismiss(a.currentTarget.completionItem.value)}.bind(this);d.className="inputCompletionLINormal";d.completionItem=a.item;
var c;if(typeof a.item.value==="string"){var b=document.createElement("table");b.style.width="100%";b.style.tableLayout="fixed";b.style.borderSpacing="0";var h=document.createElement("tr");h.style.width=this._inputField.offsetWidth+"px";b.appendChild(h);c=document.createElement("td");var n=this._createBoldText(a.item.value,a.boldIndex,a.boldLength);c.appendChild(n);c.style.overflow="hidden";h.appendChild(c);c=document.createElement("button");c.classList.add("dismissButton");c.classList.add("layoutRight");
c.classList.add("core-sprite-close");c.classList.add("imageSprite");c.style.display="none";c.style.margin="0 0 0";c.title=j["Click or use delete key to delete the search term"];c.onclick=function(c){c.stopPropagation();this._proposalIndex=-1;i.removeRecentSearch(this._serviceRegistry,a.item.value,this)}.bind(this);n=document.createElement("td");n.style.width="16px";n.style.height="16px";n.appendChild(c);h.appendChild(n);d.appendChild(b)}else a.item.value.name&&a.item.value.type==="link"&&d.appendChild(this._createProposalLink(a.item.value.name,
a.item.value.value,a.boldIndex,a.boldLength));this._completionUL.appendChild(d);this._proposalList.push({item:a.item,domNode:d,deleteBtn:c})}.bind(this))}};d.prototype._domNode2Index=function(b){if(this._proposalList)for(var a=0;a<this._proposalList.length;a++)if(this._proposalList[a].domNode===b)return a;return-1};d.prototype._highlight=function(b,a){var d=b,h,g=!1;if(!isNaN(d))g=!0,this._proposalList&&b>=0&&b<this._proposalList.length?(d=this._proposalList[b].domNode,h=this._proposalList[b].deleteBtn):
d=null;if(d){d.className=a?"inputCompletionLISelected":"inputCompletionLINormal";if(h)h.style.display=a?"":"none";a&&g&&(d.offsetTop<this._completionUIContainer.scrollTop?d.scrollIntoView(!0):d.offsetTop+d.offsetHeight>this._completionUIContainer.scrollTop+this._completionUIContainer.clientHeight&&d.scrollIntoView(!1))}};d.prototype._selectProposal=function(b){var a=b;isNaN(a)&&(a=this._domNode2Index(b));if(a!==this._proposalIndex)this._highlight(this._proposalIndex,!1),this._proposalIndex=a,this._highlight(this._proposalIndex,
!0)};d.prototype._dismiss=function(b,a){if(!this._mouseDown){this._dismissed=!0;this._proposalList=null;this._proposalIndex=-1;if(typeof b==="string")this._inputField.value=b,this._dismissing=!0,this._inputField.focus();else if(b&&b.name&&b.type==="link")a?window.open(b.value):window.location.href=b.value;window.setTimeout(function(){this._completionUIContainer.style.display="none"}.bind(this),200)}};d.prototype._show=function(){if(this._proposalList&&this._proposalList.length>0){for(var b=0,a=0,
d=this._inputField;d;)b+=d.offsetLeft,a+=d.offsetTop,d=d.offsetParent;this._completionUIContainer.style.display="block";this._completionUIContainer.style.top=a+this._inputField.offsetHeight+2+"px";this._completionUIContainer.style.left=b+"px";this._completionUIContainer.style.width=this._inputField.offsetWidth+"px";this._dismissed=this._mouseDown=!1}else this._dismissed=!0,this._proposalList=null,this._proposalIndex=-1,this._completionUIContainer.style.display="none"};d.prototype._walk=function(b){b=
this._proposalIndex+(b?1:-1);b<-1?b=this._proposalList.length-1:b>=this._proposalList.length&&(b=-1);this._selectProposal(b)};d.prototype._delete=function(){return this._proposalIndex>-1?(i.removeRecentSearch(this._serviceRegistry,this._proposalList[this._proposalIndex].item.value,this),this._proposalIndex=-1,!0):!1};d.prototype._proposeOnList=function(b,a,d){var h="",g=[],c=a?a.length:0;b.forEach(function(b){if(b.type==="category")this._proposeOnCategory(h,g),h=b.label,g=[];else{var l=!0,n=-1;if(a&&
d){var i;typeof b.value==="string"?i=b.value.toLowerCase():b.value.name&&(i=b.value.name.toLowerCase());n=i.indexOf(a);n<0?l=!1:this._proposeFromStart&&(l=n===0)}l&&g.push({item:b,boldIndex:n,boldLength:c})}}.bind(this));this._proposeOnCategory(h,g)};d.prototype._proposeOn=function(b){this._completionUL.textContent="";var a=b?b.toLowerCase():null;this._proposalList=[];this._proposeOnList(this._dataList,a,!0);this._extendedProvider&&a?this._extendedProvider(b,function(d){d&&d.forEach(function(d){this._proposeOnList(d.proposals,
d.filterForMe?a:b,d.filterForMe)}.bind(this));this._show()}.bind(this),[]):this._show()};d.prototype.constructor=d;return{InputCompletion:d}});define("text!orion/globalSearch/searchBuilder.html",[],function(){return'\t<div class="searchOptionBlock">\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<input type="text" class="search-control" style="min-width:20em;" id="advSearchInput"></input>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span id="advSearchCmd" ></span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<input type="text" class="search-control" style="min-width:20em;" id="advReplaceInput"></input>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span id="advReplacePreviewCmd" ></span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>\n\t<div class="searchOptionBlock">\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<label id="advSearchTypeLabel"  class="search-label"></label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<select id="advSearchTypes" class="search-control" style="min-width:10em;"></select>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<label id="advSortByLabel"  class="search-label"></label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<select id="advSortBy" class="search-control" style="min-width:10em;"></select>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<label id="advSearchCaseSensitiveLabel" class="search-label" ></label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type="checkbox" id="advSearchCaseSensitive" class="search-control"></input>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<label id="advSearchRegExLabel"  class="search-label"></label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type="checkbox" id="advSearchRegEx" class="search-control"></input>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>\n\t<div class="searchOptionBlock">\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<input type="text" class="search-control" style="min-width:20em;" id="advSaveSearchInput"></input>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span id="advSaveSearchCmd" ></span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>'});
define("orion/globalSearch/advSearchOptContainer","i18n!orion/search/nls/messages,require,orion/fileClient,orion/searchUtils,orion/contentTypes,orion/i18nUtil,orion/webui/littlelib,orion/inputCompletion/inputCompletion,orion/Deferred,orion/commands,text!orion/globalSearch/searchBuilder.html".split(","),function(j,k,i,d,b,a,f,h,g,c,e){function l(a,c,b){this._searcher=a;this._serviceRegistry=c;this._commandService=b;this.fileClient=new i.FileClient(this._serviceRegistry)}function n(a,c,b,e){this._parent=
f.node(a);this._optRenderer=new l(c,b,e);this._optRenderer.render(this._parent)}l.prototype.getOptions=function(a){var c;a&&(c=this._searchParams?this._searchParams.resource:this._searcher.getSearchRootLocation());return{keyword:this._searchBox.value,sort:this._sortBy.options[this._sortBy.selectedIndex].value,rows:40,start:0,replace:this._replaceBox.value?this._replaceBox.value:void 0,caseSensitive:this._caseSensitiveCB.checked,regEx:this._regExCB.checked,fileType:this._fileTypes.options[this._fileTypes.selectedIndex].value,
resource:c}};l.prototype.loadSearchParams=function(a){this._searchParams=a;this._locationName=null;this._searchParams.resource.length>0?this._serviceRegistry.getService("orion.page.progress").progress(this.fileClient.read(this._searchParams.resource,!0),"Getting file metadata "+this._searchParams.resource).then(function(a){var c=d.fullPathNameByMeta(a.Parents);this._locationName=c.length===0?a.Name:c+"/"+a.Name;this._searchNameBox.value=this._getDefaultSaveName()}.bind(this),function(a){console.error("Error loading file meta data: "+
a.message);this._locationName="root";this._searchNameBox.value=this._getDefaultSaveName()}.bind(this)):(this._locationName="root",this._searchNameBox.value=this._getDefaultSaveName());this._searchHelper=d.generateSearchHelper(a);this._loadSearchParams()};l.prototype._loadSearchParams=function(){if(this._init&&this._searchParams){this._searchBox.value=this._searchParams.keyword?this._searchParams.keyword:"";this._replaceBox.value=this._searchParams.replace?this._searchParams.replace:"";this._caseSensitiveCB.checked=
this._searchParams.caseSensitive;this._regExCB.checked=this._searchParams.regEx;var a;for(a=0;a<this._fileTypes.options.length;a++)if(this._fileTypes.options[a].value===this._searchParams.fileType){this._fileTypes.selectedIndex=a;break}for(a=0;a<this._sortBy.options.length;a++)if(this._sortBy.options[a].value===this._searchParams.sort){this._sortBy.selectedIndex=a;break}}};l.prototype.render=function(a){this._parentDiv=a;(a=this._serviceRegistry.getService("orion.core.contenttypes"))?a.getContentTypes().then(function(a){this.contentTypesCache=
a;this._render()}.bind(this)):(a=new b.ContentTypeService(this._serviceRegistry),this.contentTypesCache=a.getContentTypes(),this._render())};l.prototype._render=function(){this._parentDiv.innerHTML=e;this._initHTMLLabels();this._initControls();this._searchBox.focus()};l.prototype._submitSearch=function(){var a=this.getOptions();a.replace=null;d.doSearch(this._searcher,this._serviceRegistry,a.keyword,a)};l.prototype._replacePreview=function(){var a=this.getOptions();if(!a.replace)a.replace="";a.keyword&&
d.doSearch(this._searcher,this._serviceRegistry,a.keyword,a)};l.prototype._saveSearch=function(){if(this._searchBox.value&&this._searchNameBox.value){var a=this.getOptions(!0),a=d.generateSearchHref(a).split("#")[1];this._serviceRegistry.getService("orion.core.savedSearches").addSearch(this._searchNameBox.value,a)}};l.prototype._getDefaultSaveName=function(){if(this._searchBox.value){var a="'"+this._searchBox.value+"' in ",c="root";if(this._locationName)c=this._locationName;return a+c}return""};l.prototype._initCompletion=
function(){var a=function(a){d.getMixedSearches(this._serviceRegistry,!0,!1,function(c){var b,e=[],m=!1,d=!1;for(b in c)c[b].label&&c[b].value?(m||(e.push({type:"category",label:j["Saved searches"]}),m=!0),e.push({type:"proposal",value:{name:c[b].label,value:k.toUrl("search/search.html")+"#"+c[b].value,type:"link"}})):(d||(e.push({type:"category",label:j["Recent searches"]}),d=!0),e.push({type:"proposal",label:c[b].name,value:c[b].name}));a(e)})}.bind(this),c=function(a,c){var b=this._serviceRegistry.getServiceReferences("orion.search.proposal");
if(!b||b.length===0)c(null);else{var e=[];b.forEach(function(c){var b=c.getProperty("filterForMe");e.push(this._serviceRegistry.getService(c).run(a).then(function(a){for(var c={filterForMe:b,proposals:[]},e=0;e<a.length;e++){c.proposals.push({type:"category",label:a[e].category});for(var m=0;m<a[e].datalist.length;m++)c.proposals.push({type:"proposal",label:a[e].datalist[m],value:a[e].datalist[m]})}return c}))}.bind(this));g.all(e).then(function(a){c(a)})}}.bind(this);this._completion=new h.InputCompletion(this._searchBox,
a,{serviceRegistry:this._serviceRegistry,group:"globalSearch",extendedProvider:c})};l.prototype._initControls=function(){this._searchBox=document.getElementById("advSearchInput");this._replaceBox=document.getElementById("advReplaceInput");this._searchNameBox=document.getElementById("advSaveSearchInput");this._fileTypes=document.getElementById("advSearchTypes");this._sortBy=document.getElementById("advSortBy");this._caseSensitiveCB=document.getElementById("advSearchCaseSensitive");this._regExCB=document.getElementById("advSearchRegEx");
for(var b=[{label:j["All types"],value:d.ALL_FILE_TYPE}],e=0;e<this.contentTypesCache.length;e++)if(this.contentTypesCache[e]["extends"]==="text/plain"||this.contentTypesCache[e].id==="text/plain")for(var f=0;f<this.contentTypesCache[e].extension.length;f++)b.push({label:this.contentTypesCache[e].extension[f],value:this.contentTypesCache[e].extension[f]});b.forEach(function(a){var c=document.createElement("option"),b=document.createTextNode(a.label);c.appendChild(b);this._fileTypes.appendChild(c);
c.value=a.value}.bind(this));[{label:j["Path name"],value:"Path asc"},{label:j["File name"],value:"NameLower asc"}].forEach(function(a){var c=document.createElement("option"),b=document.createTextNode(a.label);c.appendChild(b);this._sortBy.appendChild(c);c.value=a.value}.bind(this));this._init=!0;this._loadSearchParams();this._initCompletion();this._searchBox.addEventListener("keydown",function(a){a.defaultPrevented||(a.charCode||a.keyCode)===13&&this._submitSearch()}.bind(this));this._searchBox.addEventListener("change",
function(){this._searchNameBox.value=this._getDefaultSaveName()}.bind(this));this._replaceBox.addEventListener("keydown",function(a){(a.charCode||a.keyCode)===13&&this._replacePreview()}.bind(this));this._fileTypes.addEventListener("change",function(){var c=this._fileTypes.options[this._fileTypes.selectedIndex].value;this._searchBox.placeholder=c===d.ALL_FILE_TYPE?j["Type a search term"]:a.formatMessage(j["All ${0} files"],c)}.bind(this));b=new c.Command({name:j.Search,id:"orion.globalSearch.search",
callback:function(){this._submitSearch()}.bind(this),visibleWhen:function(){return!0}});e=new c.Command({name:j.Replace,id:"orion.globalSearch.previewCurrentPage",callback:function(){this._replacePreview()}.bind(this),visibleWhen:function(){return!0}});f=new c.Command({name:j.Save,tooltip:j["Save the current search"],id:"orion.globalSearch.saveSearch",callback:function(){this._saveSearch()},visibleWhen:function(){return!0}});this._commandService.addCommand(b);this._commandService.addCommand(e);this._commandService.addCommand(f);
this._commandService.registerCommandContribution("advSearchCmd","orion.globalSearch.search",1);b=[];this._commandService.renderCommands("advSearchCmd","advSearchCmd",this,this,"button",null,b);b[0].domNode.classList.add("search-button");this._commandService.registerCommandContribution("advReplacePreviewCmd","orion.globalSearch.previewCurrentPage",1);b=[];this._commandService.renderCommands("advReplacePreviewCmd","advReplacePreviewCmd",this,this,"button",null,b);b[0].domNode.classList.add("search-button");
this._commandService.registerCommandContribution("advSaveSearchCmd","orion.globalSearch.saveSearch",1);b=[];this._commandService.renderCommands("advSaveSearchCmd","advSaveSearchCmd",this,this,"button",null,b);b[0].domNode.classList.add("search-button")};l.prototype._initHTMLLabels=function(){document.getElementById("advSearchInput").placeholder=j["Type a search term"];document.getElementById("advReplaceInput").placeholder=j["Type a replace term"];document.getElementById("advSaveSearchInput").placeholder=
j["Type a name for the search"];document.getElementById("advSearchTypeLabel").appendChild(document.createTextNode(j["File type"]));document.getElementById("advSearchCaseSensitiveLabel").appendChild(document.createTextNode(j["Case sensitive"]));document.getElementById("advSearchRegExLabel").appendChild(document.createTextNode(j["Regular expression"]));document.getElementById("advSortByLabel").appendChild(document.createTextNode(j["Sort by"]))};l.prototype.constructor=l;n.prototype.getRenderer=function(){return this._optRenderer};
n.prototype.constructor=n;return{AdvSearchOptContainer:n,AdvSearchOptRenderer:l}});
define("orion/searchOutliner","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/i18nUtil,orion/section,orion/commands,orion/commandRegistry,orion/keyBinding,orion/selection,orion/explorers/explorer,orion/EventTarget,orion/globalSearch/advSearchOptContainer,orion/webui/splitter".split(","),function(j,k,i,d,b,a,f,h,g,c,e,l,n){function p(a){this._searches=[];e.attach(this);this._init(a);this._initializeSearches()}function o(a,c){this.explorer=c;this._init(a)}function s(a,c){this.selection=
c;this.registry=a;this.renderer=new o({checkbox:!1},this)}function r(c){var b=i.node(c.parent);if(!b)throw"no parent";if(!c.serviceRegistry)throw"no service registry";this._parent=b;this._registry=c.serviceRegistry;this.commandService=c.commandService;var b=new a.Command({name:j.Rename,imageClass:"core-sprite-rename",id:"eclipse.renameSearch",parameters:new f.ParametersDescription([new f.CommandParameter("name","text","Name:","")]),visibleWhen:function(a){a=Array.isArray(a)?a:[a];return a.length===
1&&a[0].query},callback:function(a){var c=Array.isArray(a.items)?a.items[0]:a.items;a.parameters&&a.parameters.valueFor("name")&&this._registry.getService("orion.core.savedSearches").renameSearch(c.query,a.parameters.valueFor("name"))}.bind(this)}),e=new a.Command({name:"Delete",imageClass:"core-sprite-delete",id:"eclipse.deleteSearch",visibleWhen:function(a){a=Array.isArray(a)?a:[a];if(a.length===0)return!1;for(var c=0;c<a.length;c++)if(!a[c].query)return!1;return!0},callback:function(a){var a=Array.isArray(a.items)?
a.items:[a.items],b=a.length===1?d.formatMessage("Are you sure you want to delete '${0}' from the searches?",a[0].name):d.formatMessage("Are you sure you want to delete these ${0} searches?",a.length);if(window.confirm(b))for(b=0;b<a.length;b++)c.serviceRegistry.getService("orion.core.savedSearches").removeSearch(a[b].query)}});this.commandService.addCommand(b);this.commandService.addCommand(e);if(b=this._registry.getService("orion.core.savedSearches")){var g=this._registry;b.getSearches().then(function(a){this.render(a.searches,
g)}.bind(this));b.addEventListener("searchesChanged",function(a){this.render(a.searches,a.registry)}.bind(this))}}function q(a){var c=i.node(a.parent);if(!c)throw"no parent";if(!a.serviceRegistry)throw"no service registry";this._parent=c;this._registry=a.serviceRegistry;this.commandService=a.commandService;this.advSearchOptContainer=new l.AdvSearchOptContainer(this._parent,a.searcher,this._registry,this.commandService);var a=i.node("outlineContainer"),b=i.$("#outlineTop",a),e=i.$("#outlineBottom",
a),d=i.$(".outlinerSplitLayout",a);d.id="searchOutlineSplitter";window.setTimeout(function(){this._splitter=new n.Splitter({node:d,sidePanel:b,mainPanel:e,vertical:!0})},100)}p.prototype={_init:function(a){this._registry=a.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.savedSearches",this)},_notifyListeners:function(){this.dispatchEvent({type:"searchesChanged",searches:this._searches,registry:this._registry})},_initializeSearches:function(){var a=this;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var b,
c=c.get("search");typeof c==="string"&&(c=JSON.parse(c));if(c)for(b in c)a._searches.push(c[b]);a._notifyListeners()})},_storeSearches:function(){var a=this._searches;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){c.put("search",a)})},addSearch:function(a,c){var b=!1,e;for(e in this._searches)if(this._searches[e].query===c)this._searches[e].name=a,b=!0;b?this._registry.getService("orion.page.message").setMessage(a+" is already saved.",2E3):
this._searches.push({name:a,query:c});this._searches.sort(this._sorter);this._storeSearches();this._notifyListeners()},removeSearch:function(a){for(var c in this._searches)if(this._searches[c].query===a){this._searches.splice(c,1);break}this._searches.sort(this._sorter);this._storeSearches();this._notifyListeners()},renameSearch:function(a,c){var b=!1,e;for(e in this._searches)if(this._searches[e].query===a){var d=this._searches[e];if(d.name!==c)d.name=c,b=!0}b&&(this._searches.sort(this._sorter),
this._storeSearches(),this._notifyListeners())},getSearches:function(){return{searches:this._searches}},_sorter:function(a,c){var b=a.name.toLowerCase(),e=c.name.toLowerCase();return b>e?1:b<e?-1:0}};o.prototype=c.SelectionRenderer.prototype;o.prototype.constructor=o;o.prototype.getLabelColumnIndex=function(){return 0};o.prototype.getCellElement=function(a,c,b){if(c.query){var a=k.toUrl("search/search.html")+"#"+c.query,e=document.createElement("td");b.appendChild(e);e.classList.add("mainNavColumn");
e.classList.add("singleNavColumn");b=document.createElement("a");b.href=a;b.className="navlinkonpage";e.appendChild(b);b.appendChild(window.document.createTextNode(c.name))}};s.prototype=c.Explorer.prototype;s.prototype.constructor=s;r.prototype={render:function(a,e){var f=this.commandService;if(!this.searchesSection){this.searchesSection=new b.Section(this._parent,{id:"searchSection",title:j["My Saved Searches"],content:'<div id="searchContent"></div>',useAuxStyle:!0,preferenceService:e.getService("orion.core.preference"),
slideout:!0});this.searchSelection=new g.Selection(e,"orion.searches.selection");var l=this.searchesSection.selectionNode.id,w;w=new h.KeyBinding(113);w.domScope="searchContent";w.scopeName=j["My Saved Searches"];this.commandService.registerCommandContribution(l,"eclipse.renameSearch",1,null,!1,w);w=new h.KeyBinding(46);w.domScope="searchContent";w.scopeName=j["My Saved Searches"];this.commandService.registerCommandContribution(l,"eclipse.deleteSearch",2,null,!1,w);f.registerSelectionService(l,this.searchSelection);
e.getService("orion.searches.selection").addEventListener("selectionChanged",function(a){var c=i.node(l);c&&(f.destroy(c),f.renderCommands(l,c,a.selections,this,"button"))})}if(a.length>0)this.searchTable=(new s(e,this.searchSelection)).createTree("searchContent",new c.SimpleFlatModel(a,"srch",function(a){return a.query}));else if(w=i.node("searchContent"))w.innerHTML="<p>"+d.formatMessage(j["Save frequently used searches by choosing ${0} shown above."],["<b>Remember search as</b>"])+"</p>"}};r.prototype.constructor=
r;q.prototype={loadSearchParams:function(a){this.advSearchOptContainer.getRenderer().loadSearchParams(a)}};q.prototype.constructor=r;return{SavedSearches:p,SearchOutliner:r,SearchBuilder:q}});
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(j,k,i,d,b,a){function f(b,c,e,d,f,h,i){var j;if(c.Directory)j=document.createElement("a"),j.className="navlinkonpage",j.href=b+"#"+c.ChildrenLocation,j.appendChild(document.createTextNode(c.Name));else{f||(f=a.getOpenWithCommands(e));if(!h)for(b=0;b<f.length;b++)f[b].isEditor===
"default"&&(h=f[b]);j=document.createElement("a");j.className="navlink targetSelector";i&&typeof i==="object"&&Object.keys(i).forEach(function(a){j[a]=i[a]});j.appendChild(document.createTextNode(c.Name));for(var r=c.Location,q=!1,b=0;b<f.length;b++)if(e=f[b],e.visibleWhen(c)){r=e.hrefCallback({items:c});q=!0;break}k.when(d.getFileContentType(c),function(a){var b;if(b=!q)if(b=h){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&&(r=h.hrefCallback({items:c}));b=j;var e=c.Location,d;switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":d=document.createElement("img");d.src=e;d.classList.add("thumbnail");break;default:a&&a.image?(d=document.createElement("img"),d.src=a.image,d.classList.add("thumbnail")):(d=document.createElement("span"),d.className="core-sprite-file_model modelDecorationSprite")}b.firstChild?b.insertBefore(d,b.firstChild):
b.appendChild(d);j.href=r})}return j}function h(a,c,b,d){this.explorer=c;this.commandService=b;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",j.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(a){var c;this.showFolderLinks?c=f(this.folderLink||"",a,this.commandService,this.contentTypeService):(c=document.createElement("span"),c.textContent=a.Name);return c};h.prototype.showFolderLinks=!0;h.prototype.getCellElement=function(d,c,e){switch(d){case 0:var d=
document.createElement("td"),h=document.createElement("span");h.id=e.id+"MainCol";h.setAttribute("role","presentation");d.appendChild(h);d.setAttribute("role","presentation");h.className="mainNavColumn";var n;if(c.Directory)this.getExpandImage(e,h),n=this.createFolderNode(c),h.appendChild(n),this.explorer._makeDropTarget(c,n),this.explorer._makeDropTarget(c,e);else{if(!this.openWithCommands){this.openWithCommands=a.getOpenWithCommands(this.commandService);for(n=0;n<this.openWithCommands.length;n++)if(this.openWithCommands[n].isEditor===
"default")this.defaultEditor=this.openWithCommands[n]}n=f("",c,this.commandService,this.contentTypeService,this.openWithCommands,this.defaultEditor,{target:this.target});h.appendChild(n)}if(n)n.id=e.id+"NameLink",n.nodeType===1&&(b.addNavGrid(this.explorer.getNavDict(),c,n),n.setAttribute("role","link"),n.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,h,c,this.explorer,"tool",null,!0);return d;case 1:if(this.oneColumn)return null;e=document.createElement("td");
if(c.LocalTimeStamp)e.textContent=(new Date(c.LocalTimeStamp)).toLocaleString();return e;case 2:if(this.oneColumn)return null;e=document.createElement("td");if(!c.Directory&&typeof c.Length==="number")c=parseInt(c.Length,10)/1024,e.textContent=Math.ceil(c).toLocaleString()+" KB";e.style.textAlign="right";return e}};h.prototype.constructor=h;return{NavigatorRenderer:h,createLink:f}});
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(j,k,i,d,b,a,f,h,g){function c(a,c){this.serviceRegistry=a;this.commandRegistry=c;this.openWithCommands=null}function e(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new c(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}c.prototype.makeRenderFunction=function(a,c,b,e,s){var r=this.serviceRegistry,q=this.commandRegistry;this.openWithCommands=this.openWithCommands||h.createOpenWithCommands(r,a,q);var t=this;return function(m,h,z){g.when(t.openWithCommands,function(g){if(z)i.empty(c),g=document.createElement("div"),g.appendChild(document.createTextNode(j["Search failed."])),c.appendChild(g),typeof e==="function"&&e(c);else{var v=
function(){function a(c,b){var e=b.folderName?b.folderName:b.path,d=document.createElement("span");d.id=e.replace(/[^a-zA-Z0-9_\.:\-]/g,"");d.appendChild(document.createTextNode(" - "+e+" "));c.appendChild(d)}var c={};return function(b,e){var d=e.name;if(c.hasOwnProperty(d)){a(b,e);var m=c[d];typeof m==="function"&&(c[d]=null,m())}else c[d]=function(){a(b,e)}}}(),D=!1;i.empty(c);if(m&&m.length>0){var B=document.createElement("table");B.setAttribute("role","presentation");for(var E=0;E<m.length;E++){var C=
m[E],A;if(!D&&(D=!0,b))A=B.insertRow(0).insertCell(0),A.textContent=b;A=B.insertRow(-1).insertCell(0);A.colspan=2;s&&s(A);var r={Name:C.name,Directory:C.directory,Location:C.path||C.location},r=f.createLink(k.toUrl("navigate/table.html"),r,q,a,g,null,{"aria-describedby":(C.folderName?C.folderName:C.path).replace(/[^a-zA-Z0-9_\.:\-]/g,""),style:{verticalAlign:"middle"}});C.LineNumber&&r.appendChild(document.createTextNode(" (Line "+C.LineNumber+")"));A.appendChild(r);v(A,C)}c.appendChild(B);typeof e===
"function"&&e(c)}!D&&h&&(g=d.formatMessage(j["No matches found for ${0}"],h),i.empty(c),c.appendChild(document.createTextNode(g)),typeof e==="function"&&e(c))}})}};e.prototype={search:function(c,e,d){var f=function(a){for(var c=[],e=0;e<a.response.docs.length;e++){var d=a.response.docs[e];c.push({name:d.Name,path:d.Location,folderName:b.path2FolderName(d.Path?d.Path:d.Location,d.Name),directory:d.Directory,lineNumber:d.LineNumber})}return c};if(this._crawler&&c.nameSearch)this._crawler.searchName(c,
function(a){d(f(a),null)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(c),"Searching "+c.keyword).then(function(a){var b=c.keyword,b=b.substring(b.indexOf("}")+1),b=b.substring(b.indexOf(":")+1);d(f(a),b)},function(a){d(null,null,a)})}catch(g){typeof g==="string"&&g.indexOf("search")>-1&&this._crawler?this._crawler.searchName(c,function(a){d(f(a),null)}):typeof g==="string"&&g.indexOf("search")>-1&&!c.nameSearch?(new a.SearchCrawler(this.registry,this._fileService,
c,{childrenLocation:this.getChildrenLocation()})).search(function(a){d(f(a),null)}):this.registry.getService("orion.page.message").setErrorMessage(g)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=a},handleError:function(a,c){console.error(a);i.empty(c);c.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,c){var b="",e=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);c&&a&&a.Parents&&a.Parents.length>
0?e=c.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),b=e.Name,this._childrenLocation=e.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),b=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation;e=i.node("search");b||(b="");if(e&&e.placeholder){e.value="";var f=d.formatMessage(j["Search ${0}"],b);e.placeholder=f.length>30?f.substring(0,27)+"...":d.formatMessage(j["Search ${0}"],
b)}if(e&&e.title)e.title=j["Type a keyword or wild card to search in "]+b},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,c,b,e){b=b?this.getSearchRootLocation():this.getSearchLocation();return c?{resource:b,sort:"NameLower asc",rows:100,start:0,nameSearch:!0,keyword:a}:{resource:b,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}}};e.prototype.constructor=e;return{Searcher:e}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(j,k){function i(a,b,d){return a[b].apply(a,d)}function d(a){this._location=a}function b(){var a=new k;a.reject(j["No Matching OperationService for location:"]+this._location);return a}function a(a){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=a.getService("orion.core.preference");for(var b=a.getServiceReferences("orion.core.operation"),
g=0;g<b.length;g++){var c=a.getService(b[g]);this._services[g]=c;c=b[g].getProperty("pattern")||".*";c[0]!=="^"&&(c="^"+c);this._patterns[g]=RegExp(c)}this._getService=function(a){if(!a)return this._services[0];for(var c=0;c<this._patterns.length;++c)if(this._patterns[c].test(a))return this._services[c];return new d(a)}}d.prototype={getOperation:b,getOperations:b,removeCompletedOperations:b,removeOperation:b,cancelOperation:b};d.prototype.constructor=d;a.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(d){b._operations=d;a.resolve(b._operations)});return a},getOperation:function(a){return i(this._getService(a),"getOperation",arguments)},removeCompletedOperations:function(){for(var a=[],b=this,d=0;d<this._services.length;d++){var c=this._patterns[d],e=new k;a[d]=e.promise;i(this._services[d],"removeCompletedOperations").then(function(a){return function(e){Array.isArray(e)&&
b.getOperations.bind(b)().then(function(b){for(var d=b.keys(),f=0;f<d.length;f++){var g=d[f];c.test(g)&&e.indexOf(g)<0&&b.remove(g)}a.resolve()})}}(e),function(a){return function(c){a.reject(c)}}(e))}return k.all(a)},removeOperation:function(a){var b=this;return i(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})}};a.prototype.constructor=a;return{OperationsClient:a}});
define("text!orion/globalSearch/search-features.html",[],function(){return'<div id="replaceTopWidget_id" style="height:100%;width:100%;position:relative;">\n\t<div id="replaceTop" class="topPanelLayout">\n\t</div>\n\t<div class="replaceSplitLayout"></div>\n\t<div id="replaceBottom" class="bottomPanelLayout">\n\t</div>\n</div>'});
define("orion/globalSearch/search-features",["orion/webui/littlelib","orion/webui/splitter","orion/globalCommands","text!orion/globalSearch/search-features.html"],function(j,k,i,d){var b=b||{};b.SearchUIFactory=function(){function a(a){this._parentDivID=a.parentDivID}a.prototype={buildUI:function(){var a=j.node(this._parentDivID);a.innerHTML=d;var b=j.$("#replaceTop",a),g=j.$("#replaceBottom",a),a=j.$(".replaceSplitLayout",a);a.id="replaceSplitter";var c=new k.Splitter({node:a,sidePanel:b,mainPanel:g,
vertical:!0});window.setTimeout(function(){c._adjustToSplitPosition(!0)},100);c.addResizeListener(function(a){a===g&&this._compareWidget&&this._compareWidget.resizeEditors&&this._compareWidget.resizeEditors()}.bind(this));var e=i.getMainSplitter();e&&e.splitter&&e.splitter.addResizeListener(function(a){a===e.main&&this._compareWidget&&this._compareWidget.getSplitter()&&this._compareWidget.getSplitter()._adjustToSplitPosition(!0)}.bind(this))},destroy:function(){},setCompareWidget:function(a){this._compareWidget=
a},getMatchDivID:function(){return"replaceTop"},getCompareDivID:function(){return"replaceBottom"}};return a}();return b});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(j,k,i){var d=d||{};d.TwoWayCompareUIFactory=function(){function b(a){this._parentDivID=a.parentDivID;this._commandSpanId=a.commandSpanId;this._showTitle=a.showTitle;this._leftTitle=a.leftTitle;this._rightTitle=a.rightTitle;this._showLineStatus=a.showLineStatus}b.prototype={_init:function(){var a=this._parentDivID+"_";this._topWidgetDiv=j.node("topWidget_id");
this._topWidgetDiv.id=a+"topWidget_id";this._leftEditorParentDiv=j.node("left_editor_id");this._leftEditorParentDiv.id=a+"left_editor_id";this._rightEditorParentDiv=j.node("right_editor_id");this._rightEditorParentDiv.id=a+"right_editor_id";this._rightEditorWrapperDiv=j.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=a+"right_editor_wrapper_id";this._leftTitleDiv=j.node("left_title_id");this._leftTitleDiv.id=a+"left_title_id";this._rightTitleDiv=j.node("right_title_id");this._rightTitleDiv.id=
a+"right_title_id";this._leftStatusDiv=j.node("left_status_id");this._leftStatusDiv.id=a+"left_status_id";this._rightStatusDiv=j.node("right_status_id");this._rightStatusDiv.id=a+"right_status_id";this._diffCanvasDiv=j.node("diff_canvas_id");this._diffCanvasDiv.id=a+"diff_canvas_id";this._splitterId=a+"orion_splitter";if(!this._showTitle)this._leftEditorParentDiv.style.top="0px",this._rightEditorWrapperDiv.style.top="0px",this._leftTitleDiv.style.height="0px",this._rightTitleDiv.style.height="0px";
if(!this._showLineStatus)this._leftEditorParentDiv.style.marginBottom="0px",this._rightEditorWrapperDiv.style.marginBottom="0px",this._leftStatusDiv.style.height="0px",this._rightStatusDiv.style.height="0px"},_createSplitter:function(){var a=j.$(".split",this._topWidgetDiv);a.id=this._splitterId;var b=j.$(".leftPanelLayout",this._topWidgetDiv),d=j.$(".rightPanelLayout",this._topWidgetDiv);if(a&&b&&d)this._splitter=new k.Splitter({node:a,sidePanel:b,mainPanel:d})},buildUI:function(){j.node(this._parentDivID).innerHTML=
i;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(a){return j.$(".leftPanelLayout",this._topWidgetDiv)===a},getEditorParentDiv:function(a){return a?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(a){return a?this._leftTitleDiv:this._rightTitleDiv},getStatusDiv:function(a){return a?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv}};
return b}();return d});
define("orion/compare/nls/root/messages",{"Copy current change from right to left":"Copy current change from right to left","Copy current change from left to right":"Copy current change from left to right","Switch to unified diff":"Switch to unified diff",Unified:"Unified","Switch to side by side diff":"Switch to side by side diff","Side by side":"Side by side","Generate link of the current diff":"Generate link of the current diff","Generate Link":"Generate Link","Next diff block":"Next diff block","Previous diff block":"Previous diff block",
"Next diff change":"Next diff change","Previous diff change":"Previous diff change","Copy the link URL:":"Copy the link URL:",Compare:"Compare","Open the compare page":"Open the compare page","fetching...":"fetching...","There are unsaved changes.":"There are unsaved changes.","ERROR: ":"ERROR: ","Compare...":"Compare...","files changed":" files changed",Location:"Location",Options:"Options","Sort by folders":"Sort by folders","Line 0 : Col 0":"Line 0 : Col 0","No Matching DiffService for location:":"No Matching DiffService for location:"});
define("orion/compare/nls/messages",["orion/i18n!orion/compare/nls/messages","orion/compare/nls/root/messages"],function(j,k){var i={root:k};Object.keys(j).forEach(function(d){typeof i[d]==="undefined"&&(i[d]=j[d])});return i});
define("orion/compare/diffParser",[],function(){var j=j||{};j.DiffParser=function(){function j(d,b){this._lineDelimiter=d?d:i?"\r\n":"\n";this._diffLineDelimiter=b?b:this._lineDelimiter;this._DEBUG=!1}var i=window.navigator.platform.indexOf("Win")!==-1;j.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,b,a,f){this._init();if(b==="")return{outPutFile:d,mapper:[]};this._oFileContents=d===""?[]:d.split(this._lineDelimiter);this._diffContents=b.split(this._diffLineDelimiter);b=this._diffContents.length;this._hunkRanges=[];for(var h=0;h<b;h++){var g=this._parseHunkRange(h);g&&this._hunkRanges.push(g)}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(a);this._DEBUG&&(console.log("***New Line at end of file(original): \n"),
console.log(JSON.stringify(this._oNewLineAtEnd)),console.log("***New Line at end of file(new): \n"),console.log(JSON.stringify(this._nNewLineAtEnd)),console.log("***Mapper: \n"),this._logMap(),console.log("***Total line number in original file: "+this._oFileContents.length));f||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 b=0;b<this._deltaMap[d][0];b++)console.log("    "+this._diffContents[this._deltaMap[d][2]+b-1])}},_logNewFile:function(){for(var d=0;d<this._nFileContents.length;d++)console.log(this._nFileContents[d])},_createBlock:function(d,b,a,f){f===a&&d===" "||(a=[a,f-a,"s"],d==="-"?a[2]="r":d==="+"?a[2]="a":d==="c"&&(a[2]="c"),b.push(a))},_createMinusBlock:function(d,b,a){var f=this._oBlocks.length;f===0||d!==this._oBlocks[f-
1][0]?(this._oBlocks.push([d===0?1:d,a]),this._nBlocks.push([b,0,-2])):this._oBlocks[f-1][1]+=a},_createPlusBlock:function(d,b,a,f){var h=this._nBlocks.length;h===0||b!==this._nBlocks[h-1][0]?(this._oBlocks.push([d===0?1:d,0]),this._nBlocks.push([b,a,f])):(this._nBlocks[h-1][1]+=a,this._nBlocks[h-1][2]=f)},_parseHunkBlock:function(d){for(var b=" ",a=this._hunkRanges[d][0]+1,f=d===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[d+1][0],h=0,g=0,c=this._hunkRanges[d][1],e=this._hunkRanges[d][3],
l=a,i=a;i<f;i++)if(0!==this._diffContents[i].length){var j=this._diffContents[i][0];if(j==="\\"&&("\\ No newline at end of file"===this._diffContents[i].substring(0,this._diffContents[i].length-1)||"\\ No newline at end of file"===this._diffContents[i]))b==="-"?this._oNewLineAtEnd=!1:b===" "?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,i>a&&this._diffContents[i-1][this._diffContents[i-1].length-1]==="\r"&&(this._diffContents[i-1]=this._diffContents[i-1].substring(0,this._diffContents[i-
1].length-1));else{switch(j){case "-":case "+":case " ":break;default:continue}if(b!==j){j==="+"&&(l=i);switch(b){case " ":c=this._hunkRanges[d][1]+h;e=this._hunkRanges[d][3]+g;break;case "-":this._createMinusBlock(c,e,this._hunkRanges[d][1]+h-c);break;case "+":this._createPlusBlock(c,e,this._hunkRanges[d][3]+g-e,l)}b=j}switch(j){case "-":h++;break;case "+":g++;break;case " ":h++,g++}}}switch(b){case "-":this._createMinusBlock(c,e,this._hunkRanges[d][1]+h-c);break;case "+":this._createPlusBlock(c,
e,this._hunkRanges[d][3]+g-e,l)}},_detectConflictes:function(d,b){if(d<0)return!1;for(var a=d+b,f=d;f<a;f++){var h=this._diffContents[f];if(h.indexOf("<<<<<")>-1||h.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(d){var b=this._oBlocks.length,a=this._oFileContents.length,f=0,h;h=1;for(var g=0;g<b;g++)h=this._oBlocks[g][0]-h,h>0&&(this._deltaMap.push([h,h,0]),f+=h),d&&this._detectConflictes(this._nBlocks[g][2],this._nBlocks[g][1])?this._deltaMap.push([this._nBlocks[g][1],this._oBlocks[g][1],
this._nBlocks[g][2]+1,1]):this._deltaMap.push([this._nBlocks[g][1],this._oBlocks[g][1],this._nBlocks[g][2]+1]),f+=this._oBlocks[g][1],h=this._oBlocks[g][0]+this._oBlocks[g][1];0<a-h&&(this._deltaMap.push([a-h+1,a-h+1,0]),f+=a-h+1);f<a&&(h=a-f,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,b=!1,a=this._deltaMap.length,f,h;for(f=0;f<a;f++){b=!1;if(this._deltaMap[f][2]===0){for(h=0;h<this._deltaMap[f][0];h++)this._nFileContents.push(this._oFileContents[d+h-1]);b=!0}else if(this._deltaMap[f][2]>0)for(h=0;h<this._deltaMap[f][0];h++)this._nFileContents.push(this._diffContents[this._deltaMap[f][2]+h-1].substring(1));d+=this._deltaMap[f][1]}this._nNewLineAtEnd&&!b&&this._nFileContents.push("")},_parseHRangeBody:function(d,b){if(0<d.indexOf(",")){var a=d.split(","),f=parseInt(a[0],10),a=
parseInt(a[1],10);b.push(f>=0?f:1);b.push(a>=0?a:1)}else f=parseInt(d,10),b.push(f>=0?f:1),b.push(1)},_parseHunkRange:function(d){var b=this._diffContents[d];if(8>b.length)return null;if("@@"!==b.substring(0,2))return null;var b=b.substring(2),a=b.indexOf("@@");if(a<0)return null;var b=b.substring(0,a),a=b.indexOf("-"),f=b.indexOf("+");if(a<0||f<0)return null;d=[d];a<f?(b=b.substring(a+1).split("+"),this._parseHRangeBody(b[0],d),this._parseHRangeBody(b[1],d)):(b=b.substring(f+1).split("-"),this._parseHRangeBody(b[1],
d),this._parseHRangeBody(b[0],d));return d}};return j}();return j});
define("orion/compare/compareUtils",["orion/URITemplate"],function(j){var k=k||{};k.compareUtils=k.compareUtils||{};k.compareUtils.lookUpMapper=function(i,d,b){for(var a=0,f=0;f<i.length;f++){var h=i[f][d];h===0&&(h=1);if(b>=a&&b<a+h)return{mapperIndex:f,startFrom:a};if(f===i.length-1)break;a+=i[f][d]}return{mapperIndex:i.length-1,startFrom:a}};k.compareUtils.lookUpLineIndex=function(i,d,b){if(b===0)return 0;for(var a=0,f=0;f<b;f++)a+=i[f][d];return a};k.compareUtils.updateMapper=function(i,d,b,a,
f){if(a!==f&&(a>0||f>0)){var h=k.compareUtils.lookUpMapper(i,d,b);if(!(h.mapperIndex<0)){if(a>0)for(var g=b-h.startFrom,b=h.mapperIndex;b<i.length;b++){g=i[b][d]-g;if(a<=g){i[b][d]-=a;break}i[b][d]-=g;a-=g;g=0}f>0&&(i[h.mapperIndex][d]+=f)}}};k.compareUtils.overlapMapper=function(i,d,b,a,f){i=b+i[d]-1;i<b&&(i=b);f<a&&(f=a);return i<a||f<b?!1:!0};k.compareUtils.findFirstDiff=function(i,d,b,a){for(var f=0,h=null,g=0;g<i.length;g++){if(f>a)break;if(k.compareUtils.overlapMapper(i[g],d,f,b,a)&&(h={mapperIndex:g,
startFrom:f},i[g][2]!==0))break;f+=i[g][d]}return h};k.compareUtils.matchMapper=function(i,d,b,a){if(i.length===0)return b;var f=b+Math.round((a-b)/3),h=k.compareUtils.findFirstDiff(i,d,b,a),g=i[h.mapperIndex][d]===0?h.startFrom:h.startFrom+i[h.mapperIndex][d]-1,c=k.compareUtils.lookUpLineIndex(i,1-d,h.mapperIndex),e=h.startFrom-b;return i[h.mapperIndex][2]===0?c-e:f>=h.startFrom&&f<=g?c-Math.round((a-b)/3):f<h.startFrom?c-e:(i[h.mapperIndex][1-d]===0?c:c+i[h.mapperIndex][1-d]-1)-(g-b)};k.compareUtils.getMapperLineCount=
function(i){for(var d=0,b=0;b<i.length;b++)d+=Math.max(i[b][0],i[b][1]);return d};k.compareUtils.getAnnotationIndex=function(i,d){for(var b=0;b<i.length;b++)if(i[b][0]===d)return b;return-1};k.compareUtils.getAnnotationMapperIndex=function(i,d){return i[d][1]};k.compareUtils.getAnnotationIndexByMapper=function(i,d){for(var b=0;b<i.length;b++)if(i[b][1]===d)return{current:b,prev:b-1,next:b+1};return{current:-1,prev:-1,next:-1}};k.compareUtils.isMapperConflict=function(i,d){return d<0?!1:!i[d][3]?!1:
i[d][3]===1};k.compareUtils.mergeDiffBlocks=function(i,d,b,a,f,h){for(var g=0;g<d.length;g++){var c=d[g][0],e=b[d[g][1]];if(e[0]>0){for(var l="",n=0;n<e[0];n++)l=l+a[e[2]-1+n].substring(f)+h;e=i.getLineCount();c>=e&&(c=e-1);c=i.getLineStart(c);i.setText(l,c,c)}}};k.compareUtils.generateCompareHref=function(i,d){var b=require.toUrl("compare/compare.html");if(!d.conflict)d.conflict=void 0;if(!d.readonly)d.readonly=void 0;return(new j(b+"#{,resource,params*}")).expand({resource:i,params:d})};k.compareUtils.generateCompareTreeHref=
function(i,d){var b=require.toUrl("compare-tree/compare-tree.html");return(new j(b+"#{,resource,params*}")).expand({resource:i,params:d})};return k.compareUtils});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(j){var k=k||{};k.CompareRuler=function(){function i(d,b,a){this._location=d||"left";this._overview=b||"page";this._rulerStyle=a;this._editor=null;var f=this;this._listener={onModelChanged:function(a){f._onModelChanged(a)}}}i.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,b){for(var a=[],f=d;f<b;f++){var h=this.getStyle(f);h&&(a[f]={html:this.getHTML(f),style:h})}return a},getWidestAnnotation:function(){return{html:this.getHTML(-1),style:this.getStyle(-1)}},
getRulerStyle:function(){return this.getStyle(void 0)}};return i}();k.LineNumberCompareRuler=function(){function i(d,b,a,f,h,g){k.CompareRuler.call(this,a,"page",f);this._diffNavigator=d;this._oddStyle=h||{style:{backgroundColor:"white"}};this._evenStyle=g||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=b}i.prototype=new k.CompareRuler;i.prototype.getStyle=function(d){return d===void 0?this._rulerStyle:this._evenStyle};i.prototype.getHTML=function(d){var b=this._editor.getModel(),
a=this._diffNavigator.getFeeder(this._mapperColumnIndex===0);return!a?"":d===-1?b.getLineCount():a.getLineNumber?(d=a.getLineNumber(d),d===-1?"":d+1):d+1};i.prototype._onModelChanged=function(d){var d=d.start,b=this._editor.getModel(),a=b.getLineCount(),f=(a+"").length;if(this._numOfDigits!==f)this._numOfDigits=f,this._editor.redrawLines(b.getLineAtOffset(d),a,this)};return i}();k.CompareOverviewRuler=function(){function i(d,b,a,f){this._diffNavigator=a;this._onClick=f;k.CompareRuler.call(this,d,
"document",b)}i.prototype=new k.CompareRuler;i.prototype.getStyle=function(d){var b,a;if(d===void 0)b=this._rulerStyle||{},a=b.style||(b.style={}),a.lineHeight="1px",a.fontSize="1px",a.width="14px";else if(b=d!==-1?{styleClass:"annotationOverview breakpoint"}:{},a=b.style||(b.style={}),a.cursor="pointer",a.width="8px",a.left="2px",d>=0){var f;if(this._diffNavigator&&this._diffNavigator.getFeeder())f=this._diffNavigator.getFeeder().getDiffBlocks();else return null;d=j.getAnnotationIndex(f,d);if(d===
-1)return null;f=j.getAnnotationMapperIndex(f,d);var h;h=this._diffNavigator.getMapper();if(f=j.isMapperConflict(h,f))a.border="1px #FF0000 solid";if(d===this._diffNavigator.getCurrentBlockIndex())a.backgroundColor=f?"red":"blue";d=this._diffNavigator.getFeeder().getDiffBlockH(d);f=this._diffNavigator.getFeeder().getOverviewLineCount();if(d<0)return null;h=this._editor.getClientArea();d=Math.floor(h.height*d/f);d<2&&(d=2);a.height=d+"px"}else return null;return b};i.prototype.setDiffNavigator=function(d){this._diffNavigator=
d};i.prototype.getHTML=function(){return"&nbsp;"};i.prototype.onClick=function(d){d!==void 0&&this._onClick(d,this)};i.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return i}();k.CompareCurveRuler=function(){function i(d){this._canvasDiv=d;this._mapper=void 0}i.prototype={init:function(d,b,a,f){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=d;this._leftEditor=b;this._rightEditor=a;this._leftTextView=b.getTextView();
this._rightTextView=a.getTextView();this._diffNavigator=f;this.render()},matchPositionFrom:function(d){var b=d?this._leftTextView:this._rightTextView,a=d?this._rightTextView:this._leftTextView,f=b.getTopIndex(),b=b.getBottomIndex(),d=j.matchMapper(this._mapper,d?0:1,f,b);a.setTopIndex(d)},copyTo:function(d){if(this._diffNavigator.iterator){var b=this._diffNavigator.iterator.cursor();if(b){var a=d?this._rightTextView.getText(b.oldA.start,b.oldA.end):this._leftTextView.getText(b.newA.start,b.newA.end),
b=d?b.newA:b.oldA;(d?this._leftTextView:this._rightTextView).setText(a,b.start,b.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 b=this._leftTextView.getTopIndex(),a=this._leftTextView.getBottomIndex(),f=this._rightTextView.getTopIndex(),h=this._rightTextView.getBottomIndex();this._leftLineH=this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();
for(var g=0,c=0,e=!1,l=0;l<this._mapper.length;l++){if(this._mapper[l][2]!==0)if(j.overlapMapper(this._mapper[l],0,g,b,a)||j.overlapMapper(this._mapper[l],1,c,f,h))this._renderCurve(l,g,c,this._canvasDiv,d,b,a,f,h),e=!0;else if(e)break;g+=this._mapper[l][0];c+=this._mapper[l][1]}d.stroke()}},_renderCurve:function(d,b,a,f,h){var g=this._mapper[d],b=this._leftTextView.getLinePixel(b+g[0]/2)+g[0]%2*this._leftLineH/3-this._leftTextView.getTopPixel(),a=this._rightTextView.getLinePixel(a+g[1]/2)+g[1]%2*
this._rightLineH/3-this._rightTextView.getTopPixel(),f=f.parentNode.clientWidth;d===this._diffNavigator.getCurrentMapperIndex()?(h.stroke(),h.strokeStyle="#000",h.lineWidth=1,h.beginPath(),h.moveTo(0,b),h.bezierCurveTo(f/3,b,f*0.666,a,f,a),h.stroke(),h.strokeStyle="#AAAAAA",h.lineWidth=1,h.beginPath()):(h.moveTo(0,b),h.bezierCurveTo(f/3,b,f*0.666,a,f,a),h.stroke())},onChanged:function(d,b){var a=b?this._rightIniting:this._leftIniting;if(d.removedLineCount!==d.addedLineCount){var f=b?this._rightTextView:
this._leftTextView;a||j.updateMapper(this._mapper,b?1:0,f.getModel().getLineAtOffset(d.start),d.removedLineCount,d.addedLineCount);(d.removedLineCount>0||d.addedLineCount>0)&&this.render()}b?this._rightIniting=!1:this._leftIniting=!1;return a}};return i}();return k});define("orion/editor/i18n",{load:function(j,k,i){k.specified&&k.specified("orion/bootstrap")?k(["orion/i18n!"+j],function(d){i(d)}):i({})}});
define("orion/editor/nls/root/messages",{multipleAnnotations:"Multiple annotations:",line:"Line: ${0}",breakpoint:"Breakpoint",bookmark:"Bookmark",task:"Task",error:"Error",warning:"Warning",matchingSearch:"Matching Search",currentSearch:"Current Search",currentLine:"Current Line",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",lineUp:"Line Up",lineDown:"Line Down",lineStart:"Line Start",lineEnd:"Line End",charPrevious:"Previous Character",charNext:"Next Character",pageUp:"Page Up",
pageDown:"Page Down",scrollPageUp:"Scroll Page Up",scrollPageDown:"Scroll Page Down",scrollLineUp:"Scroll Line Up",scrollLineDown:"Scroll Line Down",wordPrevious:"Previous Word",wordNext:"Next Word",textStart:"Document Start",textEnd:"Document End",scrollTextStart:"Scroll Document Start",scrollTextEnd:"Scroll Document End",centerLine:"Center Line",selectLineUp:"Select Line Up",selectLineDown:"Select Line Down",selectWholeLineUp:" Select Whole Line Up",selectWholeLineDown:"Select Whole Line Down",
selectLineStart:"Select Line Start",selectLineEnd:"Select Line End",selectCharPrevious:"Select Previous Character",selectCharNext:"Select Next Character",selectPageUp:"Select Page Up",selectPageDown:"Select Page Down",selectWordPrevious:"Select Previous Word",selectWordNext:"Select Next Word",selectTextStart:"Select Document Start",selectTextEnd:"Select Document End",deletePrevious:"Delete Previous Character",deleteNext:"Delete Next Character",deleteWordPrevious:"Delete Previous Word",deleteWordNext:"Delete Next Word",
deleteLineStart:"Delete Line Start",deleteLineEnd:"Delete Line End",tab:"Insert Tab",enter:"Insert Line Delimiter",enterNoCursor:"Insert Line Delimiter",selectAll:"Select All",copy:"Copy",cut:"Cut",paste:"Paste",uppercase:"To Upper Case",lowercase:"To Lower Case",capitalize:"Capitalize",reversecase:"Reverse Case",toggleWrapMode:"Toggle Wrap Mode",toggleTabMode:"Toggle Tab Mode",toggleOverwriteMode:"Toggle Overwrite Mode",emacs:"Emacs",exchangeMarkPoint:"Exchange Mark and Point",setMarkCommand:"Set Mark",
clearMark:"Clear Mark",digitArgument:"Digit Argument ${0}",negativeArgument:"Negative Argument",Comment:"Comment","Flat outline":"Flat outline",incrementalFindStr:"Incremental find: ${0}",incrementalFindStrNotFound:"Incremental find: ${0} (not found)",incrementalFindReverseStr:"Reverse Incremental find: ${0}",incrementalFindReverseStrNotFound:"Reverse Incremental find: ${0} (not found)",find:"Find...",undo:"Undo",redo:"Redo",cancelMode:"Cancel Current Mode",findNext:"Find Next Occurrence",findPrevious:"Find Previous Occurrence",
incrementalFind:"Incremental Find",incrementalFindReverse:"Incremental Find Reverse",indentLines:"Indent Lines",unindentLines:"Unindent Lines",moveLinesUp:"Move Lines Up",moveLinesDown:"Move Lines Down",copyLinesUp:"Copy Lines Up",copyLinesDown:"Copy Lines Down",deleteLines:"Delete Lines",gotoLine:"Goto Line...",gotoLinePrompty:"Goto Line:",nextAnnotation:"Next Annotation",prevAnnotation:"Previous Annotation",expand:"Expand",collapse:"Collapse",expandAll:"Expand All",collapseAll:"Collapse All",lastEdit:"Last Edit Location",
toggleLineComment:"Toggle Line Comment",addBlockComment:"Add Block Comment",removeBlockComment:"Remove Block Comment",linkedModeEntered:"Linked Mode entered",linkedModeExited:"Linked Mode exited",syntaxError:"Syntax Error",contentAssist:"Content Assist",lineColumn:"Line ${0} : Col ${1}",vi:"vi",vimove:"(Move)",viyank:"(Yank)",videlete:"(Delete)",vichange:"(Change)",viLeft:"${0} Left",viRight:"${0} Right",viUp:"${0} Up",viDown:"${0} Down",viw:"${0} Next Word",vib:"${0} Beginning of Word",viW:"${0} Next Word (ws stop)",
viB:"${0} Beginning of Word (ws stop)",vie:"${0} End of Word",viE:"${0} End of Word (ws stop)",vi$:"${0} End of the line","vi^_":"${0} First non-blank Char Current Line","vi+":"${0} First Char Next Line","vi-":"${0} First Char Previous Line","vi|":"${0} nth Column in Line",viH:"${0} Top of Page",viM:"${0} Middle of Page",viL:"${0} Bottom of Page","vi/":"${0} Search Forward","vi?":"${0} Search Backward",vin:"${0} Next Search",viN:"${0} Previous Search",vif:"${0} Search Char Fwd",viF:"${0} Search Char Bckwd",
vit:"${0} Search Before Char Fwd",viT:"${0} Search Before Char Bckwd","vi,":"${0} Repeat Reverse Char Search","vi;":"${0} Repeat Char Search",viG:"${0} Go to Line",viycd:"${0} Current Line",via:"Append After Cursor",viA:"Append to End of Line",vii:"Insert Before Cursor",viI:"Insert at Beginning of Line",viO:"Insert Line Above",vio:"Insert Line Below",viR:"Begin Overwriting Text",vis:"Substitute a Character",viS:"Substitute Entire Line",viC:"Change Text Until Line End",vip:"Paste After Char or Line",
viP:"Paste Before Char or Line",replaceAll:"Replacing all...",replacedMatches:"Replaced ${0} matches",nothingReplaced:"Nothing replaced",notFound:"Not found"});define("orion/editor/nls/messages",["orion/editor/i18n!orion/editor/nls/messages","orion/editor/nls/root/messages"],function(j,k){var i={root:k},d;for(d in j)j.hasOwnProperty(d)&&typeof i[d]==="undefined"&&(i[d]=j[d]);return i});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/util"],function(j,k){function i(d,b){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(d);this.setLineDelimiter(b)}i.prototype={find:function(d){if(this._text.length>1)this._text=[this._text.join("")];var b=d.string,a=b,f=d.caseInsensitive;!d.regex&&b&&(a=b.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),f&&(a=a.replace(/[iI\u0130\u0131]/g,"[Ii\u0130\u0131]")));var h=null,g;if(a){var b=d.reverse,c=d.wrap,e=d.wholeWord,
l=d.start||0,d=d.end,i=d!==null&&d!==void 0,j="";j.indexOf("g")===-1&&(j+="g");f&&j.indexOf("i")===-1&&(j+="i");e&&(a="\\b"+a+"\\b");var o=this._text[0],k,r,q=0;i&&(f=l<d?l:d,o=o.substring(f,l<d?d:l),q=f);var t=RegExp(a,j);if(b)g=function(){var a=null;for(t.lastIndex=0;;){r=t.lastIndex;k=t.exec(o);if(r===t.lastIndex)return null;if(k){if(!(k.index+q<l)){if(!c||a)break;l=o.length+q}a={start:k.index+q,end:t.lastIndex+q}}else break}if(a)l=a.start;return a};else{if(!i)t.lastIndex=l;g=function(){for(;;){r=
t.lastIndex;k=t.exec(o);if(r===t.lastIndex)break;if(k)return{start:k.index+q,end:t.lastIndex+q};if(!(r!==0&&c))break}return null}}h=g()}return{next:function(){var a=h;a&&(h=g());return a},hasNext:function(){return h!==null}}},getCharCount:function(){for(var d=0,b=0;b<this._text.length;b++)d+=this._text[b].length;return d},getLine:function(d,b){var a=this.getLineCount();if(!(0<=d&&d<a))return null;var f=this._lineOffsets[d];if(d+1<a){a=this.getText(f,this._lineOffsets[d+1]);if(b)return a;for(var f=
a.length,h;(h=a.charCodeAt(f-1))===10||h===13;)f--;return a.substring(0,f)}else return this.getText(f)},getLineAtOffset:function(d){var b=this.getCharCount();if(!(0<=d&&d<=b))return-1;var a=this.getLineCount();if(d===b)return a-1;var f,h,g=this._lastLineIndex;if(0<=g&&g<a&&(f=this._lineOffsets[g],h=g+1<a?this._lineOffsets[g+1]:b,f<=d&&d<h))return g;for(var c=a,e=-1;c-e>1;)if(g=Math.floor((c+e)/2),f=this._lineOffsets[g],h=g+1<a?this._lineOffsets[g+1]:b,d<=f)c=g;else if(d<h){c=g;break}else e=g;return this._lastLineIndex=
c},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(d,b){var a=this.getLineCount();if(!(0<=d&&d<a))return-1;if(d+1<a){a=this._lineOffsets[d+1];if(b)return a;for(var f=this.getText(Math.max(this._lineOffsets[d],a-2),a),h=f.length,g;(g=f.charCodeAt(h-1))===10||g===13;)h--;return a-(f.length-h)}else return this.getCharCount()},getLineStart:function(d){return!(0<=d&&d<this.getLineCount())?-1:this._lineOffsets[d]},getText:function(d,
b){d===void 0&&(d=0);b===void 0&&(b=this.getCharCount());if(d===b)return"";for(var a=0,f=0,h;f<this._text.length;){h=this._text[f].length;if(d<=a+h)break;a+=h;f++}for(var g=a,c=f;f<this._text.length;){h=this._text[f].length;if(b<=a+h)break;a+=h;f++}if(c===f)return this._text[c].substring(d-g,b-a);g=this._text[c].substring(d-g);a=this._text[f].substring(0,b-a);return g+this._text.slice(c+1,f).join("")+a},onChanging:function(d){return this.dispatchEvent(d)},onChanged:function(d){return this.dispatchEvent(d)},
setLineDelimiter:function(d,b){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(b){var a=this.getLineCount();if(a>1){for(var f=Array(a),h=0;h<a;h++)f[h]=this.getLine(h);this.setText(f.join(this._lineDelimiter))}}},setText:function(d,b,a){d===void 0&&(d="");b===void 0&&(b=0);a===void 0&&(a=this.getCharCount());if(!(b===a&&d==="")){for(var f=this.getLineAtOffset(b),h=this.getLineAtOffset(a),g=b,c=
a-b,e=h-f,l=d.length,i=0,j=this.getLineCount(),o=0,k=0,r=0,q=[];;){o!==-1&&o<=r&&(o=d.indexOf("\r",r));k!==-1&&k<=r&&(k=d.indexOf("\n",r));if(k===-1&&o===-1)break;r=o!==-1&&k!==-1?o+1===k?k+1:(o<k?o:k)+1:o!==-1?o+1:k+1;q.push(b+r);i++}this.onChanging({type:"Changing",text:d,start:g,removedCharCount:c,addedCharCount:l,removedLineCount:e,addedLineCount:i});q.length===0&&(r=this.getLineStart(f),h=h+1<j?this.getLineStart(h+1):this.getCharCount(),b!==r&&(d=this.getText(r,b)+d,b=r),a!==h&&(d+=this.getText(a,
h),a=h));r=l-c;for(h=f+e+1;h<j;h++)this._lineOffsets[h]+=r;if(q.length<5E4)f=[f+1,e].concat(q),Array.prototype.splice.apply(this._lineOffsets,f);else{r=f+1;this._lineOffsets.splice(r,e);for(j=0;j<q.length;j+=5E4)f=[r,0].concat(q.slice(j,Math.min(q.length,j+5E4))),Array.prototype.splice.apply(this._lineOffsets,f),r+=5E4}for(r=j=0;r<this._text.length;){h=this._text[r].length;if(b<=j+h)break;j+=h;r++}f=j;for(q=r;r<this._text.length;){h=this._text[r].length;if(a<=j+h)break;j+=h;r++}h=this._text[r];b=
this._text[q].substring(0,b-f);a=h.substring(a-j);q=[q,r-q+1];b&&q.push(b);d&&q.push(d);a&&q.push(a);Array.prototype.splice.apply(this._text,q);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:g,removedCharCount:c,addedCharCount:l,removedLineCount:e,addedLineCount:i})}}};j.EventTarget.addMixin(i.prototype);return{TextModel:i}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(j,k){function i(b){if(b)this._view=b,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0}function d(b){i.call(this,b)}i.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(b){for(var a=[],d=this._keyBindings,h=0;h<d.length;h++)d[h].actionID===b&&a.push(d[h].keyBinding);return a},getView:function(){return this._view},isActive:function(){return this._view.getKeyModes().indexOf(this)!==-1},
match:function(b){switch(b.keyCode){case 16:case 17:case 18:case 91:return}for(var a=this._keyBindingIndex,d=this._matchingKeyBindings||this._keyBindings,h=[],g=0;g<d.length;g++){var c=d[g],e=c.keyBinding.match(b,a);if(e===!0)return this._keyBindingIndex=0,this._matchingKeyBindings=null,c.actionID;else typeof e==="number"&&h.push(c)}if(h.length===0)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=h,"noop"},setKeyBinding:function(b,
a){for(var d=this._keyBindings,h=0;h<d.length;h++){var g=d[h];if(g.keyBinding.equals(b)){a?g.actionID=a:g.predefined?g.actionID="noop":d.splice(h,1);return}}a&&d.push({keyBinding:b,actionID:a})},setView:function(b){this._view=b}};d.prototype=new i;d.prototype.createKeyBindings=function(){var b=j.KeyBinding,a=[];a.push({actionID:"lineUp",keyBinding:new b(38),predefined:!0});a.push({actionID:"lineDown",keyBinding:new b(40),predefined:!0});a.push({actionID:"charPrevious",keyBinding:new b(37),predefined:!0});
a.push({actionID:"charNext",keyBinding:new b(39),predefined:!0});k.isMac?(a.push({actionID:"scrollPageUp",keyBinding:new b(33),predefined:!0}),a.push({actionID:"scrollPageDown",keyBinding:new b(34),predefined:!0}),a.push({actionID:"pageUp",keyBinding:new b(33,null,null,!0),predefined:!0}),a.push({actionID:"pageDown",keyBinding:new b(34,null,null,!0),predefined:!0}),a.push({actionID:"lineStart",keyBinding:new b(37,!0),predefined:!0}),a.push({actionID:"lineEnd",keyBinding:new b(39,!0),predefined:!0}),
a.push({actionID:"wordPrevious",keyBinding:new b(37,null,null,!0),predefined:!0}),a.push({actionID:"wordNext",keyBinding:new b(39,null,null,!0),predefined:!0}),a.push({actionID:"scrollTextStart",keyBinding:new b(36),predefined:!0}),a.push({actionID:"scrollTextEnd",keyBinding:new b(35),predefined:!0}),a.push({actionID:"textStart",keyBinding:new b(38,!0),predefined:!0}),a.push({actionID:"textEnd",keyBinding:new b(40,!0),predefined:!0}),a.push({actionID:"scrollPageUp",keyBinding:new b(38,null,null,null,
!0),predefined:!0}),a.push({actionID:"scrollPageDown",keyBinding:new b(40,null,null,null,!0),predefined:!0}),a.push({actionID:"lineStart",keyBinding:new b(37,null,null,null,!0),predefined:!0}),a.push({actionID:"lineEnd",keyBinding:new b(39,null,null,null,!0),predefined:!0}),a.push({actionID:"lineStart",keyBinding:new b(38,null,null,!0),predefined:!0}),a.push({actionID:"lineEnd",keyBinding:new b(40,null,null,!0),predefined:!0})):(a.push({actionID:"pageUp",keyBinding:new b(33),predefined:!0}),a.push({actionID:"pageDown",
keyBinding:new b(34),predefined:!0}),a.push({actionID:"lineStart",keyBinding:new b(36),predefined:!0}),a.push({actionID:"lineEnd",keyBinding:new b(35),predefined:!0}),a.push({actionID:"wordPrevious",keyBinding:new b(37,!0),predefined:!0}),a.push({actionID:"wordNext",keyBinding:new b(39,!0),predefined:!0}),a.push({actionID:"textStart",keyBinding:new b(36,!0),predefined:!0}),a.push({actionID:"textEnd",keyBinding:new b(35,!0),predefined:!0}));k.isFirefox&&k.isLinux&&(a.push({actionID:"lineUp",keyBinding:new b(38,
!0),predefined:!0}),a.push({actionID:"lineDown",keyBinding:new b(40,!0),predefined:!0}));k.isWindows&&(a.push({actionID:"scrollLineUp",keyBinding:new b(38,!0),predefined:!0}),a.push({actionID:"scrollLineDown",keyBinding:new b(40,!0),predefined:!0}));a.push({actionID:"selectLineUp",keyBinding:new b(38,null,!0),predefined:!0});a.push({actionID:"selectLineDown",keyBinding:new b(40,null,!0),predefined:!0});a.push({actionID:"selectCharPrevious",keyBinding:new b(37,null,!0),predefined:!0});a.push({actionID:"selectCharNext",
keyBinding:new b(39,null,!0),predefined:!0});a.push({actionID:"selectPageUp",keyBinding:new b(33,null,!0),predefined:!0});a.push({actionID:"selectPageDown",keyBinding:new b(34,null,!0),predefined:!0});k.isMac?(a.push({actionID:"selectLineStart",keyBinding:new b(37,!0,!0),predefined:!0}),a.push({actionID:"selectLineEnd",keyBinding:new b(39,!0,!0),predefined:!0}),a.push({actionID:"selectWordPrevious",keyBinding:new b(37,null,!0,!0),predefined:!0}),a.push({actionID:"selectWordNext",keyBinding:new b(39,
null,!0,!0),predefined:!0}),a.push({actionID:"selectTextStart",keyBinding:new b(36,null,!0),predefined:!0}),a.push({actionID:"selectTextEnd",keyBinding:new b(35,null,!0),predefined:!0}),a.push({actionID:"selectTextStart",keyBinding:new b(38,!0,!0),predefined:!0}),a.push({actionID:"selectTextEnd",keyBinding:new b(40,!0,!0),predefined:!0}),a.push({actionID:"selectLineStart",keyBinding:new b(37,null,!0,null,!0),predefined:!0}),a.push({actionID:"selectLineEnd",keyBinding:new b(39,null,!0,null,!0),predefined:!0}),
a.push({actionID:"selectLineStart",keyBinding:new b(38,null,!0,!0),predefined:!0}),a.push({actionID:"selectLineEnd",keyBinding:new b(40,null,!0,!0),predefined:!0})):(k.isLinux&&(a.push({actionID:"selectWholeLineUp",keyBinding:new b(38,!0,!0),predefined:!0}),a.push({actionID:"selectWholeLineDown",keyBinding:new b(40,!0,!0),predefined:!0})),a.push({actionID:"selectLineStart",keyBinding:new b(36,null,!0),predefined:!0}),a.push({actionID:"selectLineEnd",keyBinding:new b(35,null,!0),predefined:!0}),a.push({actionID:"selectWordPrevious",
keyBinding:new b(37,!0,!0),predefined:!0}),a.push({actionID:"selectWordNext",keyBinding:new b(39,!0,!0),predefined:!0}),a.push({actionID:"selectTextStart",keyBinding:new b(36,!0,!0),predefined:!0}),a.push({actionID:"selectTextEnd",keyBinding:new b(35,!0,!0),predefined:!0}));a.push({actionID:"undo",keyBinding:new j.KeyBinding("z",!0),predefined:!0});k.isMac?a.push({actionID:"redo",keyBinding:new j.KeyBinding("z",!0,!0),predefined:!0}):a.push({actionID:"redo",keyBinding:new j.KeyBinding("y",!0),predefined:!0});
a.push({actionID:"deletePrevious",keyBinding:new b(8),predefined:!0});a.push({actionID:"deletePrevious",keyBinding:new b(8,null,!0),predefined:!0});a.push({actionID:"deleteNext",keyBinding:new b(46),predefined:!0});a.push({actionID:"deleteWordPrevious",keyBinding:new b(8,!0),predefined:!0});a.push({actionID:"deleteWordPrevious",keyBinding:new b(8,!0,!0),predefined:!0});a.push({actionID:"deleteWordNext",keyBinding:new b(46,!0),predefined:!0});a.push({actionID:"tab",keyBinding:new b(9),predefined:!0});
a.push({actionID:"shiftTab",keyBinding:new b(9,null,!0),predefined:!0});a.push({actionID:"enter",keyBinding:new b(13),predefined:!0});a.push({actionID:"enter",keyBinding:new b(13,null,!0),predefined:!0});a.push({actionID:"selectAll",keyBinding:new b("a",!0),predefined:!0});a.push({actionID:"toggleTabMode",keyBinding:new b("m",!0),predefined:!0});k.isMac&&(a.push({actionID:"deleteNext",keyBinding:new b(46,null,!0),predefined:!0}),a.push({actionID:"deleteWordPrevious",keyBinding:new b(8,null,null,!0),
predefined:!0}),a.push({actionID:"deleteWordNext",keyBinding:new b(46,null,null,!0),predefined:!0}));a.push({actionID:"toggleWrapMode",keyBinding:new j.KeyBinding("w",!0,!1,!0)});a.push({actionID:"toggleOverwriteMode",keyBinding:new j.KeyBinding(45)});if(!k.isFirefox){var d=k.isMac&&k.isChrome;a.push({actionID:"noop",keyBinding:new b("u",!d,!1,!1,d),predefined:!0});a.push({actionID:"noop",keyBinding:new b("i",!d,!1,!1,d),predefined:!0});a.push({actionID:"noop",keyBinding:new b("b",!d,!1,!1,d),predefined:!0})}k.isFirefox&&
(a.push({actionID:"copy",keyBinding:new b(45,!0),predefined:!0}),a.push({actionID:"paste",keyBinding:new b(45,null,!0),predefined:!0}),a.push({actionID:"cut",keyBinding:new b(46,null,!0),predefined:!0}));k.isMac&&(a.push({actionID:"lineStart",keyBinding:new b("a",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"lineEnd",keyBinding:new b("e",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"lineUp",keyBinding:new b("p",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"lineDown",keyBinding:new b("n",!1,!1,
!1,!0),predefined:!0}),a.push({actionID:"charPrevious",keyBinding:new b("b",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"charNext",keyBinding:new b("f",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"deletePrevious",keyBinding:new b("h",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"deleteNext",keyBinding:new b("d",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"deleteLineEnd",keyBinding:new b("k",!1,!1,!1,!0),predefined:!0}),k.isFirefox?(a.push({actionID:"scrollPageDown",keyBinding:new b("v",!1,
!1,!1,!0),predefined:!0}),a.push({actionID:"deleteLineStart",keyBinding:new b("u",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"deleteWordPrevious",keyBinding:new b("w",!1,!1,!1,!0),predefined:!0})):(a.push({actionID:"pageDown",keyBinding:new b("v",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"centerLine",keyBinding:new b("l",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"enterNoCursor",keyBinding:new b("o",!1,!1,!1,!0),predefined:!0})));return a};return{KeyMode:i,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(j,k,i,d,b,a){function f(a,c,b,e){typeof a.addEventListener==="function"?a.addEventListener(c,b,e===!0):a.attachEvent("on"+c,b)}function h(c,b,e){if(e){b.className="";for(var e=b.attributes,d=e.length;d-- >0;)(!a.isIE||a.isIE>=9||a.isIE<9&&e[d].specified)&&b.removeAttribute(e[d].name)}if(c){if(c.styleClass)b.className=
c.styleClass;if(e=c.style)for(var f in e)e.hasOwnProperty(f)&&(b.style[f]=e[f]);if(c=c.attributes)for(var g in c)c.hasOwnProperty(g)&&b.setAttribute(g,c[g])}}function g(a){return a instanceof Array?a.slice(0):a}function c(a,c){if(!a)return c;if(!c)return a;for(var b in c)c.hasOwnProperty(b)&&(a.hasOwnProperty(b)||(a[b]=c[b]));return a}function e(a,c){if(a===c)return!0;if(a&&!c||!a&&c)return!1;if(a&&a.constructor===String||c&&c.constructor===String)return!1;if(a instanceof Array||c instanceof Array){if(!(a instanceof
Array&&c instanceof Array))return!1;if(a.length!==c.length)return!1;for(var b=0;b<a.length;b++)if(!e(a[b],c[b]))return!1;return!0}if(!(a instanceof Object)||!(c instanceof Object))return!1;for(b in a)if(a.hasOwnProperty(b)){if(!c.hasOwnProperty(b))return!1;if(!e(a[b],c[b]))return!1}for(b in c)if(!a.hasOwnProperty(b))return!1;return!0}function l(a,c,b){for(var e=0,d=0,f=0,g=a.length;f<g;){e!==-1&&e<=f&&(e=a.indexOf("\r",f));d!==-1&&d<=f&&(d=a.indexOf("\n",f));var h=f,l;if(d===-1&&e===-1){c(a.substring(f));
break}e!==-1&&d!==-1?e+1===d?(l=e,f=d+1):(l=e<d?e:d,f=(e<d?e:d)+1):e!==-1?(l=e,f=e+1):(l=d,f=d+1);c(a.substring(h,l));b()}}function n(a){var c,b,e,d,f=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(f.getComputedStyle)a=f.getComputedStyle(a,null),c=a.getPropertyValue("padding-left"),b=a.getPropertyValue("padding-top"),e=a.getPropertyValue("padding-right"),d=a.getPropertyValue("padding-bottom");else if(a.currentStyle)c=a.currentStyle.paddingLeft,b=a.currentStyle.paddingTop,e=a.currentStyle.paddingRight,
d=a.currentStyle.paddingBottom;return{left:parseInt(c,10)||0,top:parseInt(b,10)||0,right:parseInt(e,10)||0,bottom:parseInt(d,10)||0}}function p(a){var c,b,e,d,f=a._trim;if(!f){var f=n(a),g=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(g.getComputedStyle)d=g.getComputedStyle(a,null),c=d.getPropertyValue("border-left-width"),b=d.getPropertyValue("border-top-width"),e=d.getPropertyValue("border-right-width"),d=d.getPropertyValue("border-bottom-width");else if(a.currentStyle)c=a.currentStyle.borderLeftWidth,
b=a.currentStyle.borderTopWidth,e=a.currentStyle.borderRightWidth,d=a.currentStyle.borderBottomWidth;c=parseInt(c,10)||0;b=parseInt(b,10)||0;e=parseInt(e,10)||0;d=parseInt(d,10)||0;f.left+=c;f.top+=b;f.right+=e;f.bottom+=d;a._trim=f}return f}function o(a,c,b){this.start=a;this.end=c;this.caret=b}function s(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function r(a,c,b){this.view=a;this.lineIndex=c;this._lineDiv=b}function q(a){this._init(a||{})}var t=function(){function a(c){this.options=
c}a.prototype.play=function(){var a=typeof this.options.duration==="number"?this.options.duration:350,c=this.options.easing||this.defaultEasing,b=this.options.onAnimate||function(){},e=this.options.curve[0],d=this.options.curve[1],m=d-e,f=-1,g,h=this;this.interval=this.options.window.setInterval(function(){f=f===-1?(new Date).getTime():f;var l=((new Date).getTime()-f)/a;l<1?(l=c(l),g=e+l*m,b(g)):(b(d),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}();o.prototype={clone:function(){return new o(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+"}"}};r.prototype={create:function(a,c){if(!this._lineDiv){var b=this._lineDiv=this._createLine(a,c,this.lineIndex);b._line=
this;return b}},_createLine:function(c,b,d){var f=this.view,g=f._model,l=g.getLine(d),i=g.getLineStart(d),n={type:"LineStyle",textView:f,lineIndex:d,lineText:l,lineStart:i};if(l.length<2E3)f.onLineStyle(n);g=b||a.createElement(c.ownerDocument,"div");if(!b||!e(b.viewStyle,n.style)){h(n.style,g,b);if(b)b._trim=null;g.viewStyle=n.style;g.setAttribute("role","presentation")}g.lineIndex=d;d=[];this._createRanges(n.ranges,l,0,l.length,i,{tabOffset:0,ranges:d});l=" ";!f._fullSelection&&a.isIE<9&&(l="\ufeff");
a.isWebkit&&(l="\u200c");n={text:l,style:f._metrics.largestFontStyle,ignoreChars:1};d.length===0||!d[d.length-1].style||d[d.length-1].style.tagName!=="div"?d.push(n):d.splice(d.length-1,0,n);var j,p,o,F,k,l=f=0,s,r;if(b){if(p=b.modelChangedEvent)p.removedLineCount===0&&p.addedLineCount===0?(r=p.start-i,s=p.addedCharCount-p.removedCharCount):r=-1,b.modelChangedEvent=void 0;p=b.firstChild}for(i=0;i<d.length;i++){n=d[i];F=n.text;f+=F.length;j=n.style;if(p)if(k=p.firstChild.data,o=p.viewStyle,k===F&&
e(j,o)){l+=k.length;p._rectsCache=void 0;j=p=p.nextSibling;continue}else for(;p;){if(r!==-1){o=f;o>=r&&(o-=s);k=(k=p.firstChild.data)?k.length:0;if(l+k>o)break;l+=k}o=p.nextSibling;g.removeChild(p);p=o}j=this._createSpan(g,F,j,n.ignoreChars);p?g.insertBefore(j,p):g.appendChild(j);if(b)b.lineWidth=void 0}if(b)for(c=j?j.nextSibling:null;c;)o=c.nextSibling,b.removeChild(c),c=o;else c.appendChild(g);return g},_createRanges:function(a,c,b,d,f,g){if(!(b>d)){if(a)for(var h=0;h<a.length;h++){var l=a[h];if(!(l.end<
f+b)){var i=Math.max(f+b,l.start)-f;if(i>d)break;var n=Math.min(f+d,l.end)-f;if(i<=n){i=Math.max(b,i);n=Math.min(d,n);for(b<i&&this._createRange(c,b,i,null,g);h+1<a.length&&a[h+1].start-f===n&&e(l.style,a[h+1].style);)l=a[h+1],n=Math.min(f+d,l.end)-f,h++;this._createRange(c,i,n,l.style,g);b=n}}}b<d&&this._createRange(c,b,d,null,g)}},_createRange:function(a,c,b,e,d){if(!(c>b)){var f=this.view._customTabSize;if(f&&f!==8)for(var g=a.indexOf("\t",c);g!==-1;){c<g&&(c={text:a.substring(c,g),style:e},d.ranges.push(c),
d.tabOffset+=c.text.length);c=f-d.tabOffset%f;if(c>0){for(var h="\u00a0",l=1;l<c;l++)h+=" ";c={text:h,style:e,ignoreChars:c-1};d.ranges.push(c);d.tabOffset+=c.text.length}c=g+1;if(c===b)return;g=a.indexOf("\t",c)}c<=b&&(c={text:a.substring(c,b),style:e},d.ranges.push(c),d.tabOffset+=c.text.length)}},_createSpan:function(c,b,e,d){var g=this.view,l="span";e&&e.tagName&&(l=e.tagName.toLowerCase());var i=l==="a";if(i)c.hasLink=!0;i&&!g._linksVisible&&(l="span");i=c.ownerDocument;c=a.createElement(c.ownerDocument,
l);e&&e.html?(c.innerHTML=e.html,c.ignore=!0):e&&e.node?(c.appendChild(e.node),c.ignore=!0):c.appendChild(i.createTextNode(e&&e.text?e.text:b));h(e,c);if(l==="a"){var n=g._getWindow();f(c,"click",function(a){return g._handleLinkClick(a?a:n.event)},!1)}c.viewStyle=e;if(d)c.ignoreChars=d;return c},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(c,b){var e=this._ensureCreated(),d=this.view;if(c===void 0)return this._getLineBoundingClientRect(e,
!0);var f=d._model,g=e.ownerDocument,h=this.lineIndex,l=null;if(c<f.getLineEnd(h)){f=f.getLineStart(h);for(h=e.firstChild;h;){if(!h.ignore){var i=h.firstChild,n=i.length;h.ignoreChars&&(n-=h.ignoreChars);if(f+n>c){l=c-f;if(d._isRangeRects)g=g.createRange(),g.setStart(i,l),g.setEnd(i,l+1),l=new s(g.getBoundingClientRect());else if(a.isIE)g=g.body.createTextRange(),g.moveToElementText(h),g.collapse(),g.moveEnd("character",l+1),g.moveStart("character",l),l=new s(g.getBoundingClientRect());else{var j=
i.data;h.removeChild(i);h.appendChild(g.createTextNode(j.substring(0,l)));var p=a.createElement(g,"span");p.appendChild(g.createTextNode(j.substring(l,l+1)));h.appendChild(p);h.appendChild(g.createTextNode(j.substring(l+1)));l=new s(p.getBoundingClientRect());h.innerHTML="";h.appendChild(i);this._createdDiv||(g=d._getSelection(),(f<=g.start&&g.start<f+n||f<=g.end&&g.end<f+n)&&d._updateDOMSelection())}a.isIE&&(g=e.ownerDocument.defaultView||e.ownerDocument.parentWindow,e=g.screen.logicalXDPI/g.screen.deviceXDPI,
g=g.screen.logicalYDPI/g.screen.deviceYDPI,l.left*=e,l.right*=e,l.top*=g,l.bottom*=g);break}f+=n}h=h.nextSibling}}e=this.getBoundingClientRect();if(!l)d._wrapMode?(d=this.getClientRects(),l=d[d.length-1],l.left=l.right,l.left+=e.left,l.top+=e.top,l.right+=e.left,l.bottom+=e.top):(l=new s(e),l.left=l.right);if(b||b===void 0)l.left-=e.left,l.top-=e.top,l.right-=e.left,l.bottom-=e.top;return l},_getClientRects:function(a,c){var b,e,d,f;if(!a._rectsCache){b=a.getClientRects();e=Array(b.length);for(f=
0;f<b.length;f++)d=e[f]=new s(b[f]),d.left-=c.left,d.top-=c.top,d.right-=c.left,d.bottom-=c.top;a._rectsCache=e}b=a._rectsCache;e=[b.length];for(f=0;f<b.length;f++)e[f]=new s(b[f]);return e},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var c=this._ensureCreated(),b=[],e=c.firstChild,d,f=c.getBoundingClientRect();e;){if(!e.ignore)for(var g=this._getClientRects(e,f),c=0;c<g.length;c++){var h=g[c],l;if(h.top!==h.bottom){var i=h.top+(h.bottom-h.top)/2;for(l=
0;l<b.length;l++)if(d=b[l],d.top<=i&&i<d.bottom)break;if(l===b.length)b.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?b[a]:b},_getLineBoundingClientRect:function(a,c){var b=new s(a.getBoundingClientRect());if(!this.view._wrapMode){b.right=b.left;for(var e=a.lastChild;e&&e.ignoreChars===e.firstChild.length;)e=e.previousSibling;if(e)e=e.getBoundingClientRect(),b.right=
e.right+p(a).right}c&&(e=p(a),b.left+=e.left,b.right-=e.right);return b},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(a){if(!this.view._wrapMode)return 0;for(var c=this.getClientRects(),a=this.getBoundingClientRect(a),a=a.top+(a.bottom-a.top)/2,b=0;b<c.length;b++)if(c[b].top<=a&&a<c[b].bottom)return b;return c.length-1},getLineStart:function(a){if(!this.view._wrapMode||a===0)return this.view._model.getLineStart(a);var c=this.getClientRects();
return this.getOffset(c[a].left+1,c[a].top+1)},getOffset:function(c,b){var e=this.view,d=e._model,f=this.lineIndex,g=d.getLineStart(f),h=d.getLineEnd(f);if(g===h)return g;var l=this._ensureCreated(),i=this.getBoundingClientRect(),n,j;if(e._wrapMode){n=this.getClientRects();if(b<n[0].top)b=n[0].top;for(var p=0;p<n.length;p++)if(j=n[p],j.top<=b&&b<j.bottom)break;if(c<j.left)c=j.left;c>j.right&&(c=j.right-1)}else c<0&&(c=0),c>i.right-i.left&&(c=i.right-i.left);var o=l.ownerDocument,p=o.defaultView||
o.parentWindow,k=a.isIE?p.screen.logicalXDPI/p.screen.deviceXDPI:1,s=a.isIE?p.screen.logicalYDPI/p.screen.deviceYDPI:1,p=g,r=l.firstChild;a:for(;r;){if(!r.ignore){var q=r.firstChild,l=q.length;r.ignoreChars&&(l-=r.ignoreChars);var t,G,H;n=this._getClientRects(r,i);for(var I=0;I<n.length;I++)if(j=n[I],j.left<=c&&c<j.right&&(!e._wrapMode||j.top<=b&&b<j.bottom)){if(a.isIE||e._isRangeRects){for(var o=e._isRangeRects?o.createRange():o.body.createTextRange(),I=l,M=-1;I-M>1;){var J=Math.floor((I+M)/2);n=
M+1;j=J===l-1&&r.ignoreChars?q.length:J+1;e._isRangeRects?(o.setStart(q,n),o.setEnd(q,j)):(o.moveToElementText(r),o.move("character",n),o.moveEnd("character",j-n));n=o.getClientRects();for(var Q=!1,N=0;N<n.length;N++)if(j=n[N],t=j.left*k-i.left,H=j.right*k-i.left,G=j.top*s-i.top,j=j.bottom*s-i.top,t<=c&&c<H&&(!e._wrapMode||G<=b&&b<j)){Q=!0;break}Q?I=J:M=J}p+=I;n=I;j=I===l-1&&r.ignoreChars?q.length:Math.min(I+1,q.length);e._isRangeRects?(o.setStart(q,n),o.setEnd(q,j)):(o.moveToElementText(r),o.move("character",
n),o.moveEnd("character",j-n));j=o.getClientRects()[0];t=j.left*k-i.left;H=j.right*k-i.left;e=c>t+(H-t)/2;i=p-g;d=d.getLine(f);f=d.charCodeAt(i);55296<=f&&f<=56319&&e?i<d.length&&(f=d.charCodeAt(i+1),56320<=f&&f<=57343&&(p+=1)):56320<=f&&f<=57343&&!e&&i>0&&(f=d.charCodeAt(i-1),55296<=f&&f<=56319&&(p-=1));e&&p++}else{d=[];for(f=0;f<l;f++)d.push("<span>"),f===l-1?d.push(q.data.substring(f)):d.push(q.data.substring(f,f+1)),d.push("</span>");r.innerHTML=d.join("");for(d=r.firstChild;d;){j=d.getBoundingClientRect();
t=j.left-i.left;H=j.right-i.left;if(t<=c&&c<H){c>t+(H-t)/2&&p++;break}p++;d=d.nextSibling}if(!this._createdDiv)r.innerHTML="",r.appendChild(q),i=e._getSelection(),(p<=i.start&&i.start<p+l||p<=i.end&&i.end<p+l)&&e._updateDOMSelection()}break a}p+=l}r=r.nextSibling}return Math.min(h,Math.max(g,p))},getNextOffset:function(c,b){if(b.unit==="line"){var e=this.view._model,d=e.getLineAtOffset(c);if(b.count>0)return b.count--,e.getLineEnd(d);b.count++;return e.getLineStart(d)}return b.unit==="wordend"||b.unit===
"wordWS"||b.unit==="wordendWS"?this._getNextOffset_W3C(c,b):a.isIE?this._getNextOffset_IE(c,b):this._getNextOffset_W3C(c,b)},_getNextOffset_W3C:function(a,c){function b(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),g=d.getLine(f),h=d.getLineStart(f),d=d.getLineEnd(f),f=g.length,l=a-h,i,n=c.count<0?-1:1;if(c.unit==="word"||c.unit==="wordend"||c.unit==="wordWS"||c.unit==="wordendWS")for(var j,
p,o;c.count!==0;){if(c.count>0){if(l===f)return d;i=g.charCodeAt(l);j=b(i);p=!j&&!e(i);for(l++;l<f;){i=g.charCodeAt(l);if(c.unit!=="wordWS"&&c.unit!=="wordendWS"){o=b(i);if(c.unit==="wordend"){if(!o&&j)break}else if(o&&!j)break;i=!o&&!e(i)}else i=!e(i);if(c.unit==="wordend"||c.unit==="wordendWS"){if(!i&&p)break}else if(i&&!p)break;p=i;j=o;l++}}else{if(l===0)return h;l--;i=g.charCodeAt(l);j=b(i);for(p=!j&&!e(i);0<l;){i=g.charCodeAt(l-1);if(c.unit!=="wordWS"&&c.unit!=="wordendWS"){o=b(i);if(c.unit===
"wordend"){if(o&&!j)break}else if(!o&&j)break;i=!o&&!e(i)}else i=!e(i);if(c.unit==="wordend"||c.unit==="wordendWS"){if(i&&!p)break}else if(!i&&p)break;p=i;j=o;l--}}c.count-=n}else for(;c.count!==0&&0<=l+n&&l+n<=f;)l+=n,i=g.charCodeAt(l),56320<=i&&i<=57343&&l>0&&(i=g.charCodeAt(l-1),55296<=i&&i<=56319&&(l+=n)),c.count-=n;return h+l},_getNextOffset_IE:function(a,c){var b=this._ensureCreated(),e=this.view._model,d=this.lineIndex,f=0,g;g=e.getLineStart(d);var h=b.ownerDocument,l=c.count<0?-1:1;if(a===
e.getLineEnd(d)){for(b=b.lastChild;b&&b.ignoreChars;)b=b.previousSibling;if(!b)return g;f=h.body.createTextRange();f.moveToElementText(b);g=f.text.length;f.moveEnd(c.unit,l);f=a+f.text.length-g}else if(a===g&&c.count<0)f=g;else for(b=b.firstChild;b;){e=b.firstChild.length;b.ignoreChars&&(e-=b.ignoreChars);if(g+e>a){f=h.body.createTextRange();a===g&&c.count<0?f.moveToElementText(b.previousSibling):(f.moveToElementText(b),f.collapse(),f.moveEnd("character",a-g));g=f.text.length;f.moveEnd(c.unit,l);
f=a+f.text.length-g;break}g=e+g;b=b.nextSibling}c.count-=l;return f},destroy:function(){var a=this._createdDiv;if(a)a.parentNode.removeChild(a),this._createdDiv=null}};q.prototype={addKeyMode:function(a,c){var b=this._keyModes;c!==void 0?b.splice(c,0,a):b.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,c){a.setView(this);var b=this._rulers;if(c!==void 0){var e,d;for(e=0,d=0;e<b.length&&d<c;e++)a.getLocation()===b[e].getLocation()&&d++;b.splice(d,0,a);c=d}else b.push(a);this._createRuler(a,
c);this._update()},computeSize:function(){var c=0,b=0,e=this._model,d=this._clientDiv;if(!d)return{width:c,height:b};var f=d.style.width;if(a.isWebkit)d.style.width="0x7fffffffpx";for(var e=e.getLineCount(),g=0;g<e;g++){var h=this._getLine(g),l=h.getBoundingClientRect(),c=Math.max(c,l.right-l.left);b+=l.bottom-l.top;h.destroy()}if(a.isWebkit)d.style.width=f;d=this._getViewPadding();c+=d.right+d.left+this._metrics.scrollWidth;b+=d.bottom+d.top+this._metrics.scrollWidth;return{width:c,height:b}},convert:function(a,
c,b){if(this._clientDiv){var e=this._getScroll(),d=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect();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));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));return a}},destroy:function(){for(var a=0;a<this._rulers.length;a++)this._rulers[a].setView(null);this.rulers=null;this._destroyView();this.onDestroy({type:"Destroy"});this._actions=this._keyModes=
this._doubleClickSelection=this._selection=this._theme=this._model=this._parent=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),a.isOpera&&this._clientDiv.blur(),this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(a){if(a=this._actions[a])return a.actionDescription},getActions:function(a){var c=[],b=this._actions,e;for(e in b)b.hasOwnProperty(e)&&(a||!b[e].defaultHandler)&&c.push(e);return c},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 c=[],b=this._keyModes,
e=0;e<b.length;e++)c=c.concat(b[e].getKeyBindings(a));return c},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 c=this._model,a=Math.min(Math.max(0,a),c.getCharCount()),c=c.getLineAtOffset(a),b=this._getLine(c),
a=b.getBoundingClientRect(a);b.destroy();b=a.left;c=this._getLinePixel(c)+a.top;return{x:b,y:c}},getOptions:function(){var a;if(arguments.length===0)a=this._defaultOptions();else if(arguments.length===1){if(a=arguments[0],typeof a==="string")return g(this["_"+a])}else{a={};for(var c in arguments)arguments.hasOwnProperty(c)&&(a[arguments[c]]=void 0)}for(var b in a)a.hasOwnProperty(b)&&(a[b]=g(this["_"+b]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,c){if(!this._clientDiv)return 0;
var b=this._getLineIndex(c),e=this._getLine(b),b=e.getOffset(a,c-this._getLinePixel(b));e.destroy();return b},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=this._getSelection();return{start:a.start,end:a.end}},getText:function(a,c){return this._model.getText(a,c)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(a,c,b){if(this._clientDiv){if(a=this._actions[a]){if(!c&&
a.handler&&a.handler(b))return!0;if(a.defaultHandler)return typeof a.defaultHandler(b)==="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,c){if(!(this._redrawCount>0))for(var b=this.getRulers(),e=0;e<b.length;e++)this.redrawLines(a,c,b[e])},redrawLines:function(a,c,b){if(!(this._redrawCount>0)&&(a===void 0&&(a=0),c===void 0&&(c=this._model.getLineCount()),a!==c)){var e=this._clientDiv;if(e){if(b)for(e=(b.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild;e;){if(e._ruler===b)break;e=e.nextSibling}b?e.rulerChanged=
!0:this._lineHeight&&this._resetLineHeight(a,c);if(!b||b.getOverview()==="page")for(e=e.firstChild;e;){var d=e.lineIndex;if(a<=d&&d<c)e.lineChanged=!0;e=e.nextSibling}if(!b&&!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<c)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._queueUpdate()}}},redrawRange:function(a,c){if(!(this._redrawCount>0)){var b=this._model;a===void 0&&(a=0);c===void 0&&(c=b.getCharCount());var e=b.getLineAtOffset(a),b=b.getLineAtOffset(Math.max(a,
c-1))+1;this.redrawLines(e,b)}},removeKeyMode:function(a){for(var c=this._keyModes,b=0;b<c.length;b++)if(c[b]===a){c.splice(b,1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var c=this._rulers,b=0;b<c.length;b++)if(c[b]===a){c.splice(b,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,c,b){if(a){var e=this._actions,d=e[a];d||(d=e[a]={});d.handler=c;if(b!==void 0)d.actionDescription=
b}},setKeyBinding:function(a,c){this._keyModes[0].setKeyBinding(a,c)},setCaretOffset:function(a,c,b){var e=this._model.getCharCount(),a=Math.max(0,Math.min(a,e));this._setSelection(new o(a,a,!1),c===void 0||c,!0,b)},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 c=this._model.getLineCount(),b=this._model.getCharCount(),e=a.getLineCount(),d=a.getCharCount(),f={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:b,addedCharCount:d,removedLineCount:c,addedLineCount:e};this.onModelChanging(f);this._model=a;f={type:"ModelChanged",start:0,removedCharCount:b,addedCharCount:d,removedLineCount:c,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 c=this._defaultOptions(),b;for(b in a)if(a.hasOwnProperty(b)){var d=a[b];if(!e(this["_"+b],d)){var f=c[b]?c[b].update:null;f?f.call(this,d):this["_"+b]=g(d)}}},setSelection:function(a,c,b,e){var d=a>c;if(d)var f=a,a=c,c=f;f=this._model.getCharCount();a=Math.max(0,Math.min(a,f));c=Math.max(0,Math.min(c,f));this._setSelection(new o(a,c,d),
b===void 0||b,!0,e)},setText:function(c,b,e){var d=b===void 0&&e===void 0;b===void 0&&(b=0);e===void 0&&(e=this._model.getCharCount());if(d)this._variableLineHeight=!1;this._modifyContent({text:c,start:b,end:e,_code:!0},!d);if(d)this._columnX=-1,this._setSelection(new o(0,0,!1),!0),a.isFirefox&&this._fixCaret()},setTopIndex:function(a){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,a))-this._getScroll().y)},setTopPixel:function(a){this._clientDiv&&this._scrollView(0,Math.max(0,
a)-this._getScroll().y)},showSelection:function(){return this._showCaret(!0)},update:function(a,c){this._clientDiv&&(a&&this._updateStyle(),c===void 0||c?this._update():this._queueUpdate())},_handleRootMouseDown:function(c){if(!this._ignoreEvent(c)){if(a.isFirefox&&c.which===1)this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0;var b=this._overlayDiv||this._clientDiv;if(a.isIE<9)b=this._viewDiv;for(var e=c.target?c.target:c.srcElement;e;){if(b===e)return;
e=e.parentNode}c.preventDefault&&c.preventDefault();c.stopPropagation&&c.stopPropagation();if(!this._isW3CEvents){var d=this;this._getWindow().setTimeout(function(){d._clientDiv.focus()},0)}}},_handleRootMouseUp:function(c){if(!this._ignoreEvent(c)&&a.isFirefox&&c.which===1)this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),this._ignoreBlur=!1},_handleBlur:function(){if(!this._ignoreBlur){this._hasFocus=!1;if(a.isIE<9&&!this._getSelection().isEmpty()){var c=
this._rootDiv,b=a.createElement(c.ownerDocument,"div");c.appendChild(b);c.removeChild(b)}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",c=this._getWindow(),b=this._selDiv1.ownerDocument,c.getSelection){b=c.getSelection();for(c=b.anchorNode;c;){if(c===this._clientDiv){b.rangeCount>0&&b.removeAllRanges();break}c=c.parentNode}}else if(b.selection){this._ignoreSelect=
!1;for(c=b.selection.createRange().parentElement();c;){if(c===this._clientDiv){b.selection.empty();break}c=c.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(c){if(!this._ignoreEvent(c)){a.isIE&&this._lastMouseButton===3&&this._updateDOMSelection();var b=!1;this.isListening("ContextMenu")?(b=this._createMouseEvent("ContextMenu",c),b.screenX=c.screenX,b.screenY=c.screenY,this.onContextMenu(b),b=b.defaultPrevented):a.isMac&&a.isFirefox&&
c.button===0&&(b=!0);if(b)return c.preventDefault&&c.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(c){if(!this._ignoreEvent(c)){if(a.isFirefox){var b=this;this._getWindow().setTimeout(function(){b._clientDiv.contentEditable=!0;b._clientDiv.draggable=!1;b._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",c)),this._dragOffset=-1;else return c.preventDefault&&c.preventDefault(),!1}},_handleDrag:function(a){if(!this._ignoreEvent(a)&&
this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",a))},_handleDragEnd:function(c){if(!this._ignoreEvent(c)){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",c));a.isFirefox&&(this._fixCaret(),c.dataTransfer.dropEffect==="none"&&!c.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(c){if(!this._ignoreEvent(c)){var b=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(b=!1,this.onDragEnter(this._createMouseEvent("DragEnter",
c)));if(a.isWebkit||b)return c.preventDefault&&c.preventDefault(),!1}},_handleDragOver:function(c){if(!this._ignoreEvent(c)){var b=!0;this.isListening("DragOver")&&(b=!1,this.onDragOver(this._createMouseEvent("DragOver",c)));if(a.isWebkit||b){if(b)c.dataTransfer.dropEffect="none";c.preventDefault&&c.preventDefault();return!1}}},_handleDragLeave:function(a){if(!this._ignoreEvent(a)&&(this._dropTarget=!1,this.isListening("DragLeave")))this.onDragLeave(this._createMouseEvent("DragLeave",a))},_handleDrop:function(a){if(!this._ignoreEvent(a)){this._dropTarget=
!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",a));a.preventDefault&&a.preventDefault();return!1}},_handleFocus:function(){this._hasFocus=!0;a.isIOS&&this._lastTouchOffset!==void 0?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=void 0):this._updateDOMSelection();if(this._cursorDiv)this._cursorDiv.style.display="block";if(this._selDiv1){var c=this._highlightRGB;this._selDiv1.style.background=c;this._selDiv2.style.background=c;this._selDiv3.style.background=
c}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(c){if(!this._ignoreEvent(c)){if(this.isListening("KeyDown")){var b=this._createKeyEvent("KeyDown",c);this.onKeyDown(b);if(b.defaultPrevented){if(a.isFirefox)this._keyDownPrevented=!0;c.preventDefault();return}}b=!1;switch(c.keyCode){case 16:case 17:case 18:case 91:b=!0;break;default:this._setLinksVisible(!1)}if(c.keyCode===229){if(this._readonly)return c.preventDefault&&c.preventDefault(),!1;b=!0;if(a.isSafari&&a.isMac&&
c.ctrlKey)b=!1,c.keyCode=129;b&&this._startIME()}else b||this._commitIME();if((a.isMac||a.isLinux)&&a.isFirefox<4||a.isOpera)return this._keyDownEvent=c,!0;if(this._doAction(c))return c.preventDefault?(c.preventDefault(),c.stopPropagation()):(c.cancelBubble=!0,c.returnValue=!1,c.keyCode=0),!1}},_handleKeyPress:function(c){if(!this._ignoreEvent(c))if(this._keyDownPrevented)c.preventDefault&&(c.preventDefault(),c.stopPropagation()),this._keyDownPrevented=void 0;else{if(a.isMac&&a.isWebkit&&(63232<=
c.keyCode&&c.keyCode<=63487||c.keyCode===13||c.keyCode===8))return c.preventDefault&&c.preventDefault(),!1;if(((a.isMac||a.isLinux)&&a.isFirefox<4||a.isOpera)&&this._doAction(this._keyDownEvent))return c.preventDefault&&c.preventDefault(),!1;var b=a.isMac?c.metaKey:c.ctrlKey;if(c.charCode!==void 0&&b)switch(c.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(b=this._createKeyEvent("KeyPress",c),this.onKeyPress(b),b.defaultPrevented)){c.preventDefault();return}if(this._doAction(c))return c.preventDefault?
(c.preventDefault(),c.stopPropagation()):(c.cancelBubble=!0,c.returnValue=!1,c.keyCode=0),!1;b=!1;if(a.isMac){if(c.ctrlKey||c.metaKey)b=!0}else if(a.isFirefox){if(c.ctrlKey||c.altKey)b=!0}else c.ctrlKey^c.altKey&&(b=!0);if(!b&&(b=a.isOpera?c.which:c.charCode!==void 0?c.charCode:c.keyCode,b>31))return this._doContent(String.fromCharCode(b)),c.preventDefault&&c.preventDefault(),!1}},_handleKeyUp:function(c){if(!this._ignoreEvent(c)){if(this.isListening("KeyUp")){var b=this._createKeyEvent("KeyUp",c);
this.onKeyUp(b);if(b.defaultPrevented){c.preventDefault();return}}(a.isMac?c.metaKey:c.ctrlKey)||this._setLinksVisible(!1);c.keyCode===13&&this._commitIME()}},_handleLinkClick:function(c){if(!(a.isMac?c.metaKey:c.ctrlKey))return c.preventDefault&&c.preventDefault(),!1},_handleMouse:function(c){var b=this._getWindow(),e=!0,d=b;if(a.isIE||a.isFirefox&&!this._overlayDiv)d=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=!0;var f=this;b.setTimeout(function(){f.focus();f._ignoreFocus=
!1},0)}this._clickCount===1?(e=this._setSelectionTo(c.clientX,c.clientY,c.shiftKey,!a.isOpera&&this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(d):(this._isW3CEvents&&this._setGrab(d),this._doubleClickSelection=null,this._setSelectionTo(c.clientX,c.clientY,c.shiftKey),this._doubleClickSelection=this._getSelection());return e},_handleMouseDown:function(c){if(!this._ignoreEvent(c)){if(this._linksVisible)if((c.target||c.srcElement).tagName!=="A")this._setLinksVisible(!1);else return;this._commitIME();
var b=c.which;b||(c.button===4&&(b=2),c.button===2&&(b=3),c.button===1&&(b=1));var e=b!==2&&c.timeStamp?c.timeStamp:(new Date).getTime(),d=e-this._lastMouseTime,f=Math.abs(this._lastMouseX-c.clientX),g=Math.abs(this._lastMouseY-c.clientY),h=this._lastMouseButton===b;this._lastMouseX=c.clientX;this._lastMouseY=c.clientY;this._lastMouseTime=e;this._lastMouseButton=b;if(b===1)this._isMouseDown=!0,h&&d<=this._clickTime&&f<=this._clickDist&&g<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&
(e=this._createMouseEvent("MouseDown",c),this.onMouseDown(e),e.defaultPrevented)){c.preventDefault();return}if(b===1&&this._handleMouse(c)&&(a.isIE>=9||a.isOpera||a.isChrome||a.isSafari||a.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),c.preventDefault();a.isFirefox&&this._lastMouseButton===3&&this._updateDOMSelection()}},_handleMouseOver:function(a){if(!this._ignoreEvent(a)&&!this._animation&&this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",a))},_handleMouseOut:function(a){if(!this._ignoreEvent(a)&&
!this._animation&&this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",a))},_handleMouseMove:function(c){if(!this._animation){var b=this._isClientDiv(c);if(this.isListening("MouseMove")&&b)this.onMouseMove(this._createMouseEvent("MouseMove",c));if(!this._dropTarget){var e=this._linksVisible||this._lastMouseMoveX!==c.clientX||this._lastMouseMoveY!==c.clientY;this._lastMouseMoveX=c.clientX;this._lastMouseMoveY=c.clientY;this._setLinksVisible(e&&!this._isMouseDown&&(a.isMac?
c.metaKey:c.ctrlKey));if(!this._isW3CEvents){if(c.button===0)return this._setGrab(null),!0;if(!this._isMouseDown&&c.button===1&&(this._clickCount&1)!==0&&b)return this._clickCount=2,this._handleMouse(c,this._clickCount)}if(this._isMouseDown&&this._dragOffset===-1){var b=c.clientX,c=c.clientY,d=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect(),g=this._getClientWidth(),h=this._getClientHeight(),e=f.left+d.left,l=f.top+d.top,g=f.left+d.left+g,d=f.top+d.top+h;c<l?this._doAutoScroll("up",
b,c-l):c>d?this._doAutoScroll("down",b,c-d):b<e&&!this._wrapMode?this._doAutoScroll("left",b-e,c):b>g&&!this._wrapMode?this._doAutoScroll("right",b-g,c):(this._endAutoScroll(),this._setSelectionTo(b,c,!0))}}}},_isClientDiv:function(a){for(var c=this._overlayDiv||this._clientDiv,a=a.target?a.target:a.srcElement;a;){if(c===a)return!0;a=a.parentNode}return!1},_createKeyEvent:function(a,c){return{type:a,event:c,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,c){var b=
this.convert({x:c.clientX,y:c.clientY},"page","document");return{type:a,event:c,clickCount:this._clickCount,x:b.x,y:b.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(c){var b=c.which?c.button===0:c.button===1;if(this.isListening("MouseUp")&&(this._isClientDiv(c)||b&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",c));if(!this._linksVisible&&b&&this._isMouseDown){if(this._dragOffset!==-1)b=this._getSelection(),b.extend(this._dragOffset),b.collapse(),
this._setSelection(b,!0,!0),this._dragOffset=-1;this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null);a.isFirefox&&c.preventDefault()}},_handleMouseWheel:function(c){var b=this._getLineHeight(),e=0,d=0;a.isIE||a.isOpera?d=-c.wheelDelta/40*b:a.isFirefox?(b=a.isMac?c.detail*3:Math.max(-256,Math.min(256,c.detail))*b,c.axis===c.HORIZONTAL_AXIS?e=b:d=b):a.isMac?(d=c.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=c.timeStamp,e=c.wheelDeltaX%120!==0?1:d<40?40/(40-d):40,d=
c.wheelDeltaY%120!==0?1:d<40?40/(40-d):40,e=Math.ceil(-c.wheelDeltaX/e),-1<e&&e<0&&(e=-1),0<e&&e<1&&(e=1),d=Math.ceil(-c.wheelDeltaY/d),-1<d&&d<0&&(d=-1),0<d&&d<1&&(d=1)):(e=-c.wheelDeltaX,d=-c.wheelDeltaY/120*8*b);if(a.isSafari){for(b=c.target;b&&b.lineIndex===void 0;)b=b.parentNode;this._mouseWheelLine=b}b=this._getScroll();this._scrollView(e,d);e=this._getScroll();if(b.x!==e.x||b.y!==e.y)return c.preventDefault&&c.preventDefault(),!1},_handlePaste:function(c){if(!this._ignoreEvent(c)&&!this._ignorePaste&&
this._doPaste(c)){if(a.isIE){var b=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){b._updateDOMSelection();b._ignoreFocus=!1},0)}c.preventDefault&&c.preventDefault();return!1}},_handleResize:function(){var c=this._parent.clientWidth,b=this._parent.clientHeight;if(this._parentWidth!==c||this._parentHeight!==b)this._parentWidth!==c&&this._wrapMode&&this._resetLineHeight(),this._parentWidth=c,this._parentHeight=b,a.isIE<9?this._queueUpdate():this._update()},_handleRulerEvent:function(a){for(var c=
a.target?a.target:a.srcElement,b=c.lineIndex;c&&!c._ruler;){if(b===void 0&&c.lineIndex!==void 0)b=c.lineIndex;c=c.parentNode}c=c?c._ruler:null;if(b===void 0&&c&&c.getOverview()==="document"){var b=this._getClientHeight(),e=this._model.getLineCount(),d=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect(),b=Math.floor((a.clientY-f.top-this._metrics.scrollWidth)*e/(b+d.top+d.bottom-2*this._metrics.scrollWidth));0<=b&&b<e||(b=void 0)}if(c)switch(a.type){case "click":if(c.onClick)c.onClick(b,
a);break;case "dblclick":if(c.onDblClick)c.onDblClick(b,a);break;case "mousemove":if(c.onMouseMove)c.onMouseMove(b,a);break;case "mouseover":if(c.onMouseOver)c.onMouseOver(b,a);break;case "mouseout":if(c.onMouseOut)c.onMouseOut(b,a)}},_handleScroll:function(){var a=this._getScroll(!1),c=this._hScroll,b=this._vScroll;if(c!==a.x||b!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),this._update(b===a.y),this.onScroll({type:"Scroll",oldValue:{x:c,y:b},newValue:a})},_handleSelectStart:function(a){if(this._ignoreSelect)return a&&
a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,c){if(a){var b;b=a.tagName==="DIV"?a:a.parentNode.parentNode;var e=0,d=b.lineIndex;if(a.tagName!=="DIV")for(b=b.firstChild;b;){var f=b.firstChild;if(f===a){b.ignoreChars&&(e-=b.ignoreChars);e+=c;break}b.ignoreChars&&(e-=b.ignoreChars);e+=f.data.length;b=b.nextSibling}return Math.max(0,e)+this._model.getLineStart(d)}},_updateSelectionFromDOM:function(){var a=this._getWindow().getSelection(),c=this._getModelOffset(a.anchorNode,a.anchorOffset),
a=this._getModelOffset(a.focusNode,a.focusOffset);c===void 0||a===void 0||this._setSelection(new o(c,a),!1,!1)},_handleSelectionChange:function(){if(this._imeOffset===-1)if(a.isAndroid){var c=this._getWindow();this._selTimer&&c.clearTimeout(this._selTimer);var b=this;this._selTimer=c.setTimeout(function(){if(b._clientDiv)b._selTimer=null,b._updateSelectionFromDOM()},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(c){if(!this._ignoreEvent(c)){this._imeOffset=-1;if(a.isAndroid){for(var b=
this._getWindow().getSelection(),e=b.anchorNode;e;){if(e.lineIndex!==void 0)break;e=e.parentNode}if(e){var d=this._model,f=e.lineIndex,g=d.getLine(f),h=g,l=0,d=d.getLineStart(f);if(b.rangeCount>0)b.getRangeAt(0).deleteContents(),f=e.ownerDocument.createTextNode(c.data),b.getRangeAt(0).insertNode(f),l=this._getDOMText(e,f),h=l.text,l=l.offset,f.parentNode.removeChild(f);e.lineRemoved=!0;for(e=0;g.charCodeAt(e)===h.charCodeAt(e)&&e<l;)e++;b=g.length-1;for(f=h.length-g.length;g.charCodeAt(b)===h.charCodeAt(b+
f)&&b+f>=l+c.data.length;)b--;b++;g=h.substring(e,b+f);e+=d;b+=d;this._modifyContent({text:g,start:e,end:b,_ignoreDOMSelection:!0},!0)}}else this._doContent(c.data);c.preventDefault()}},_handleTouchStart:function(c){this._commitIME();var b=this._getWindow();if(this._touchScrollTimer)this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",b.clearInterval(this._touchScrollTimer),this._touchScrollTimer=null;var e=c.touches;if(e.length===1){var e=e[0],d=e.clientX,f=e.clientY;this._touchStartX=
d;this._touchStartY=f;if(a.isAndroid&&(f<e.pageY-b.pageYOffset||d<e.pageX-b.pageXOffset))d=e.pageX-b.pageXOffset,f=e.pageY-b.pageYOffset;b=this.convert({x:d,y:f},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(b.x,b.y);this._touchStartTime=c.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var c=a.touches;if(c.length===1){c=c[0];this._touchCurrentX=c.clientX;this._touchCurrentY=c.clientY;if(!this._touchScrollTimer&&a.timeStamp-this._touchStartTime<200){this._vScrollDiv.style.display=
"block";if(!this._wrapMode)this._hScrollDiv.style.display="block";var b=this,e=this._getWindow();this._touchScrollTimer=e.setInterval(function(){var a=0,c=0;if(b._touching)a=b._touchStartX-b._touchCurrentX,c=b._touchStartY-b._touchCurrentY,b._touchSpeedX=a/10,b._touchSpeedY=c/10,b._touchStartX=b._touchCurrentX,b._touchStartY=b._touchCurrentY;else if(Math.abs(b._touchSpeedX)<0.1&&Math.abs(b._touchSpeedY)<0.1){b._vScrollDiv.style.display="none";b._hScrollDiv.style.display="none";e.clearInterval(b._touchScrollTimer);
b._touchScrollTimer=null;return}else a=b._touchSpeedX*10,c=b._touchSpeedY*10,b._touchSpeedX*=0.95,b._touchSpeedY*=0.95;b._scrollView(a,c)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){if(a.touches.length===0)this._touching=!1},_doAction:function(a){var c,b,e=this._keyModes;for(b=e.length-1;b>=0;b--)if(c=e[b],typeof c.match==="function"&&(c=c.match(a),c!==void 0))return this.invokeAction(c);return!1},_doMove:function(a,c){var b=this._model,e=c.getCaret(),d=b.getLineAtOffset(e);
if(!a.count)a.count=1;for(;a.count!==0;){var f=b.getLineStart(d);if(a.count<0&&e===f)if(d>0)a.unit==="character"&&a.count++,d--,c.extend(b.getLineEnd(d));else break;else if(a.count>0&&e===b.getLineEnd(d))if(d+1<b.getLineCount())a.unit==="character"&&a.count--,d++,c.extend(b.getLineStart(d));else break;else{var g=!1;a.expandTab&&a.unit==="character"&&(e-f)%this._tabSize===0&&(g=!/[^ ]/.test(b.getText(f,e)));g?(c.extend(e-this._tabSize),a.count+=a.count<0?1:-1):(f=this._getLine(d),c.extend(f.getNextOffset(e,
a)),f.destroy())}e=c.getCaret()}return c},_doBackspace:function(a){var c=this._getSelection();if(c.isEmpty()){if(!a.count)a.count=1;a.count*=-1;a.expandTab=this._expandTab;this._doMove(a,c)}this._modifyContent({text:"",start:c.start,end:c.end},!0);return!0},_doCase:function(a){var c=this._getSelection();this._doMove(a,c);var b=this.getText(c.start,c.end);this._setSelection(c,!0);switch(a.type){case "lower":b=b.toLowerCase();break;case "capitalize":b=b.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});
break;case "reverse":a="";for(c=0;c<b.length;c++){var e=b[c],d=e.toLowerCase(),e=d!==e?d:e.toUpperCase();a+=e}b=a;break;default:b=b.toUpperCase()}this._doContent(b);return!0},_doContent:function(a){var c=this._getSelection();if(this._overwriteMode&&c.isEmpty()){var b=this._model,e=b.getLineAtOffset(c.end);c.end<b.getLineEnd(e)&&(b=this._getLine(e),c.extend(b.getNextOffset(c.getCaret(),{unit:"character",count:1})),b.destroy())}this._modifyContent({text:a,start:c.start,end:c.end,_ignoreDOMSelection:!0},
!0)},_doCopy:function(a){var c=this._getSelection();return!c.isEmpty()?this._setClipboardText(this._getBaseText(c.start,c.end),a):!0},_doCursorNext:function(a){var c=this._getSelection();!c.isEmpty()&&!a.select?c.start=c.end:this._doMove(a,c);a.select||c.collapse();this._setSelection(c,!0);return!0},_doCursorPrevious:function(a){var c=this._getSelection();if(!c.isEmpty()&&!a.select)c.end=c.start;else{if(!a.count)a.count=1;a.count*=-1;this._doMove(a,c)}a.select||c.collapse();this._setSelection(c,!0);
return!0},_doCut:function(a){var c=this._getSelection();return!c.isEmpty()?(c=this._getBaseText(c.start,c.end),this._doContent(""),this._setClipboardText(c,a)):!0},_doDelete:function(a){var c=this._getSelection();c.isEmpty()&&this._doMove(a,c);this._modifyContent({text:"",start:c.start,end:c.end},!0);return!0},_doEnd:function(a){var c=this._getSelection(),b=this._model,e;if(a.ctrl)c.extend(b.getCharCount()),e=function(){};else{var d=c.getCaret(),f=b.getLineAtOffset(d);if(this._wrapMode){var g=this._getLine(f),
d=g.getLineIndex(d),d=d===g.getLineCount()-1?b.getLineEnd(f):g.getLineStart(d+1)-1;g.destroy()}else a.count&&a.count>0&&(f=Math.min(f+a.count-1,b.getLineCount()-1)),d=b.getLineEnd(f);c.extend(d)}a.select||c.collapse();this._setSelection(c,!0,!0,e);return!0},_doEnter:function(a){var c=this._model,b=this._getSelection();this._doContent(c.getLineDelimiter());if(a&&a.noCursor)b.end=b.start,this._setSelection(b,!0);return!0},_doHome:function(a){var c=this._getSelection(),b=this._model,e;if(a.ctrl)c.extend(0),
e=function(){};else{var d=c.getCaret(),f=b.getLineAtOffset(d);this._wrapMode?(b=this._getLine(f),d=b.getLineIndex(d),d=b.getLineStart(d),b.destroy()):d=b.getLineStart(f);c.extend(d)}a.select||c.collapse();this._setSelection(c,!0,!0,e);return!0},_doLineDown:function(c){var b=this._model,e=this._getSelection(),d=e.getCaret(),f=b.getLineAtOffset(d),g=this._getLine(f),h=this._columnX,l=1,i=!1;if(h===-1||c.wholeLine||c.select&&a.isIE)h=c.wholeLine?b.getLineEnd(f+1):d,h=g.getBoundingClientRect(h).left;
(d=g.getLineIndex(d))<g.getLineCount()-1?l=g.getClientRects(d+1).top+1:(d=b.getLineCount()-1,i=f===d,c.count&&c.count>0?f=Math.min(f+c.count,d):f++);d=!1;if(i){if(c.select||a.isMac||a.isLinux)e.extend(b.getCharCount()),d=!0}else g.lineIndex!==f&&(g.destroy(),g=this._getLine(f)),e.extend(g.getOffset(h,l)),d=!0;d&&(c.select||e.collapse(),this._setSelection(e,!0,!0));this._columnX=h;g.destroy();return!0},_doLineUp:function(c){var b=this._model,e=this._getSelection(),d=e.getCaret(),f=b.getLineAtOffset(d),
g=this._getLine(f),h=this._columnX,l=!1,i;if(h===-1||c.wholeLine||c.select&&a.isIE)h=c.wholeLine?b.getLineStart(f-1):d,h=g.getBoundingClientRect(h).left;(d=g.getLineIndex(d))>0?i=g.getClientRects(d-1).top+1:(l=f===0,l||(c.count&&c.count>0?f=Math.max(f-c.count,0):f--,i=this._getLineHeight(f)-1));d=!1;if(l){if(c.select||a.isMac||a.isLinux)e.extend(0),d=!0}else g.lineIndex!==f&&(g.destroy(),g=this._getLine(f)),e.extend(g.getOffset(h,i)),d=!0;d&&(c.select||e.collapse(),this._setSelection(e,!0,!0));this._columnX=
h;g.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(c){var b=this,e=this._model,d=this._getSelection(),f=d.getCaret(),g=e.getLineAtOffset(f),h=e.getLineCount(),l=this._getScroll(),e=this._getClientHeight(),i,n;if(this._lineHeight){i=this._columnX;l=this._getBoundsAtOffset(f);if(i===-1||c.select&&a.isIE)i=l.left;f=this._getLineIndex(l.top+e);n=this._getLine(f);g=this._getLinePixel(f);f=n.getOffset(i,l.top+e-g);e=n.getBoundingClientRect(f);n.destroy();d.extend(f);c.select||d.collapse();
this._setSelection(d,!0,!0,function(){b._columnX=i},e.top+g-l.top);return!0}if(g<h-1){var j=this._getLineHeight(),p=Math.min(h-g-1,Math.floor(e/j)),p=Math.max(1,p);i=this._columnX;if(i===-1||c.select&&a.isIE)n=this._getLine(g),i=n.getBoundingClientRect(f).left,n.destroy();n=this._getLine(g+p);d.extend(n.getOffset(i,0));n.destroy();c.select||d.collapse();c=h*j;f=l.y+p*j;f+e>c&&(f=c-e);this._setSelection(d,!0,!0,function(){b._columnX=i},f-l.y)}return!0},_doPageUp:function(c){var b=this,e=this._model,
d=this._getSelection(),f=d.getCaret(),g=e.getLineAtOffset(f),h=this._getScroll(),l=this._getClientHeight(),i;if(this._lineHeight){i=this._columnX;h=this._getBoundsAtOffset(f);if(i===-1||c.select&&a.isIE)i=h.left;f=this._getLineIndex(h.bottom-l);e=this._getLine(f);g=this._getLinePixel(f);f=e.getOffset(i,h.bottom-l-g);l=e.getBoundingClientRect(f);e.destroy();d.extend(f);c.select||d.collapse();this._setSelection(d,!0,!0,function(){b._columnX=i},l.top+g-h.top);return!0}if(g>0){var n=this._getLineHeight(),
l=Math.max(1,Math.min(g,Math.floor(l/n)));i=this._columnX;if(i===-1||c.select&&a.isIE)e=this._getLine(g),i=e.getBoundingClientRect(f).left,e.destroy();e=this._getLine(g-l);d.extend(e.getOffset(i,this._getLineHeight(g-l)-1));e.destroy();c.select||d.collapse();c=Math.max(0,h.y-l*n);this._setSelection(d,!0,!0,function(){b._columnX=i},c-h.y)}return!0},_doPaste:function(c){var b=this;return this._getClipboardText(c,function(c){c&&(a.isLinux&&b._lastMouseButton===2&&(new Date).getTime()-b._lastMouseTime<=
b._clickTime&&b._setSelectionTo(b._lastMouseX,b._lastMouseY),b._doContent(c))})!==null},_doScroll:function(a){var c=a.type,b=this._model,e=b.getLineCount(),a=this._getClientHeight(),d=this._getLineHeight();e*=d;var f=this._getScroll().y,g;switch(c){case "textStart":g=0;break;case "textEnd":g=e-a;break;case "pageDown":g=f+a;break;case "pageUp":g=f-a;break;case "lineDown":g=f+d;break;case "lineUp":g=f-d;break;case "centerLine":c=this._getSelection(),g=b.getLineAtOffset(c.start),b=(b.getLineAtOffset(c.end)-
g+1)*d,g=g*d-a/2+b/2}g!==void 0&&(g=Math.min(Math.max(0,g),e-a),this._scrollViewAnimated(0,g-f,function(){}));return!0},_doSelectAll:function(){var a=this._model,c=this._getSelection();c.setCaret(0);c.extend(a.getCharCount());this._setSelection(c,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var a="\t";if(this._expandTab)var c=this._model,a=this._getSelection().getCaret(),b=c.getLineAtOffset(a),c=c.getLineStart(b),a=Array(this._tabSize-(a-c)%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 c=this._model,b=this._getSelection(),e=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),d=b.getCaret(),
f=c.getLineCount(),g=c.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,g+d));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")h=this._getLineIndex(e.y),g=this._getLine(g),e.x+=g.getBoundingClientRect(d,!1).left,g.destroy();h===0&&(a.isMac||a.isLinux)?b.extend(0):h===f-1&&(a.isMac||a.isLinux)?b.extend(c.getCharCount()):(g=this._getLine(h),b.extend(g.getOffset(e.x,
e.y-this._getLinePixel(h))),g.destroy());this._setSelection(b,!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 c=this._model.getLineCount(),b=0;if(a){for(var a=0,e=(new Date).getTime(),d=0;b<c;)if(this._lineHeight[b]||(a++,d||(d=b),this._lineHeight[b]=this._calculateLineHeight(b)),b++,(new Date).getTime()-
e>100)break;this.redrawRulers(0,c);this._queueUpdate()}a=this._getWindow();if(b!==c){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),c=a.getBoundingClientRect();a.destroy();return Math.max(1,c.bottom-c.top)},_calculateMetrics:function(){var c=this._clientDiv,b=c.ownerDocument,
e=a.createElement(b,"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=a.createElement(b,"span");f.appendChild(b.createTextNode(" "));e.appendChild(f);var g=a.createElement(b,"span");g.style.fontStyle="italic";g.appendChild(b.createTextNode(" "));e.appendChild(g);var l=a.createElement(b,"span");l.style.fontWeight="bold";l.appendChild(b.createTextNode(" "));
e.appendChild(l);d=a.createElement(b,"span");d.style.fontWeight="bold";d.style.fontStyle="italic";d.appendChild(b.createTextNode(" "));e.appendChild(d);c.appendChild(e);var i=e.getBoundingClientRect(),f=f.getBoundingClientRect(),g=g.getBoundingClientRect(),l=l.getBoundingClientRect(),d=d.getBoundingClientRect(),f=f.bottom-f.top,g=g.bottom-g.top,l=l.bottom-l.top,j=d.bottom-d.top,o=0,d=i.bottom-i.top<=0,i=Math.max(1,i.bottom-i.top);g>f&&(o=1);l>g&&(o=2);j>l&&(o=3);var k;if(o!==0){k={style:{}};if((o&
1)!==0)k.style.fontStyle="italic";if((o&2)!==0)k.style.fontWeight="bold"}f=p(e);c.removeChild(e);g=n(this._viewDiv);e=a.createElement(b,"div");e.style.position="fixed";e.style.left="-1000px";e.style.paddingLeft=g.left+"px";e.style.paddingTop=g.top+"px";e.style.paddingRight=g.right+"px";e.style.paddingBottom=g.bottom+"px";e.style.width="100px";e.style.height="100px";l=a.createElement(b,"div");l.style.width="100%";l.style.height="100%";e.appendChild(l);c.appendChild(e);b=e.getBoundingClientRect();g=
l.getBoundingClientRect();e.style.overflow="hidden";l.style.height="200px";l=e.clientWidth;e.style.overflow="scroll";j=e.clientWidth;c.removeChild(e);g={left:g.left-b.left,top:g.top-b.top,right:b.right-g.right,bottom:b.bottom-g.bottom};return{lineHeight:i,largestFontStyle:k,lineTrim:f,viewPadding:g,scrollWidth:l-j,invalid:d}},_cancelAnimation:function(){if(this._animation)this._animation.stop(),this._animation=null},_clearSelection:function(a){var c=this._getSelection();if(c.isEmpty())return!1;a===
"next"?c.start=c.end:c.end=c.start;this._setSelection(c,!0);return!0},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var a=this._model,c=a.getLineAtOffset(this._imeOffset),b=a.getLineStart(c),e=this._getDOMText(this._getLineNode(c)).text,a=a.getLine(c),b=this._imeOffset-b,a=b+e.length-a.length;b!==a&&this._doContent(e.substring(b,a));this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new i.DefaultKeyMode(this));var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},
lineUp:{defaultHandler:function(b){return a._doLineUp(c(b,{select:!1}))},actionDescription:{name:j.lineUp}},lineDown:{defaultHandler:function(b){return a._doLineDown(c(b,{select:!1}))},actionDescription:{name:j.lineDown}},lineStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!1,ctrl:!1}))},actionDescription:{name:j.lineStart}},lineEnd:{defaultHandler:function(b){return a._doEnd(c(b,{select:!1,ctrl:!1}))},actionDescription:{name:j.lineEnd}},charPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,
{select:!1,unit:"character"}))},actionDescription:{name:j.charPrevious}},charNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!1,unit:"character"}))},actionDescription:{name:j.charNext}},pageUp:{defaultHandler:function(b){return a._doPageUp(c(b,{select:!1}))},actionDescription:{name:j.pageUp}},pageDown:{defaultHandler:function(b){return a._doPageDown(c(b,{select:!1}))},actionDescription:{name:j.pageDown}},scrollPageUp:{defaultHandler:function(b){return a._doScroll(c(b,{type:"pageUp"}))},
actionDescription:{name:j.scrollPageUp}},scrollPageDown:{defaultHandler:function(b){return a._doScroll(c(b,{type:"pageDown"}))},actionDescription:{name:j.scrollPageDown}},scrollLineUp:{defaultHandler:function(b){return a._doScroll(c(b,{type:"lineUp"}))},actionDescription:{name:j.scrollLineUp}},scrollLineDown:{defaultHandler:function(b){return a._doScroll(c(b,{type:"lineDown"}))},actionDescription:{name:j.scrollLineDown}},wordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,{select:!1,
unit:"word"}))},actionDescription:{name:j.wordPrevious}},wordNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!1,unit:"word"}))},actionDescription:{name:j.wordNext}},textStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!1,ctrl:!0}))},actionDescription:{name:j.textStart}},textEnd:{defaultHandler:function(b){return a._doEnd(c(b,{select:!1,ctrl:!0}))},actionDescription:{name:j.textEnd}},scrollTextStart:{defaultHandler:function(b){return a._doScroll(c(b,{type:"textStart"}))},
actionDescription:{name:j.scrollTextStart}},scrollTextEnd:{defaultHandler:function(b){return a._doScroll(c(b,{type:"textEnd"}))},actionDescription:{name:j.scrollTextEnd}},centerLine:{defaultHandler:function(b){return a._doScroll(c(b,{type:"centerLine"}))},actionDescription:{name:j.centerLine}},selectLineUp:{defaultHandler:function(b){return a._doLineUp(c(b,{select:!0}))},actionDescription:{name:j.selectLineUp}},selectLineDown:{defaultHandler:function(b){return a._doLineDown(c(b,{select:!0}))},actionDescription:{name:j.selectLineDown}},
selectWholeLineUp:{defaultHandler:function(b){return a._doLineUp(c(b,{select:!0,wholeLine:!0}))},actionDescription:{name:j.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(b){return a._doLineDown(c(b,{select:!0,wholeLine:!0}))},actionDescription:{name:j.selectWholeLineDown}},selectLineStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!0,ctrl:!1}))},actionDescription:{name:j.selectLineStart}},selectLineEnd:{defaultHandler:function(b){return a._doEnd(c(b,{select:!0,ctrl:!1}))},
actionDescription:{name:j.selectLineEnd}},selectCharPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,{select:!0,unit:"character"}))},actionDescription:{name:j.selectCharPrevious}},selectCharNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!0,unit:"character"}))},actionDescription:{name:j.selectCharNext}},selectPageUp:{defaultHandler:function(b){return a._doPageUp(c(b,{select:!0}))},actionDescription:{name:j.selectPageUp}},selectPageDown:{defaultHandler:function(b){return a._doPageDown(c(b,
{select:!0}))},actionDescription:{name:j.selectPageDown}},selectWordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(c(b,{select:!0,unit:"word"}))},actionDescription:{name:j.selectWordPrevious}},selectWordNext:{defaultHandler:function(b){return a._doCursorNext(c(b,{select:!0,unit:"word"}))},actionDescription:{name:j.selectWordNext}},selectTextStart:{defaultHandler:function(b){return a._doHome(c(b,{select:!0,ctrl:!0}))},actionDescription:{name:j.selectTextStart}},selectTextEnd:{defaultHandler:function(b){return a._doEnd(c(b,
{select:!0,ctrl:!0}))},actionDescription:{name:j.selectTextEnd}},deletePrevious:{defaultHandler:function(b){return a._doBackspace(c(b,{unit:"character"}))},actionDescription:{name:j.deletePrevious}},deleteNext:{defaultHandler:function(b){return a._doDelete(c(b,{unit:"character"}))},actionDescription:{name:j.deleteNext}},deleteWordPrevious:{defaultHandler:function(b){return a._doBackspace(c(b,{unit:"word"}))},actionDescription:{name:j.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(b){return a._doDelete(c(b,
{unit:"word"}))},actionDescription:{name:j.deleteWordNext}},deleteLineStart:{defaultHandler:function(b){return a._doBackspace(c(b,{unit:"line"}))},actionDescription:{name:j.deleteLineStart}},deleteLineEnd:{defaultHandler:function(b){return a._doDelete(c(b,{unit:"line"}))},actionDescription:{name:j.deleteLineEnd}},tab:{defaultHandler:function(){return a._doTab()},actionDescription:{name:j.tab}},shiftTab:{defaultHandler:function(){return a._doShiftTab()},actionDescription:{name:j.shiftTab}},enter:{defaultHandler:function(){return a._doEnter()},
actionDescription:{name:j.enter}},enterNoCursor:{defaultHandler:function(b){return a._doEnter(c(b,{noCursor:!0}))},actionDescription:{name:j.enterNoCursor}},selectAll:{defaultHandler:function(){return a._doSelectAll()},actionDescription:{name:j.selectAll}},copy:{defaultHandler:function(){return a._doCopy()},actionDescription:{name:j.copy}},cut:{defaultHandler:function(){return a._doCut()},actionDescription:{name:j.cut}},paste:{defaultHandler:function(){return a._doPaste()},actionDescription:{name:j.paste}},
uppercase:{defaultHandler:function(b){return a._doCase(c(b,{type:"upper"}))},actionDescription:{name:j.uppercase}},lowercase:{defaultHandler:function(b){return a._doCase(c(b,{type:"lower"}))},actionDescription:{name:j.lowercase}},capitalize:{defaultHandler:function(b){return a._doCase(c(b,{unit:"word",type:"capitalize"}))},actionDescription:{name:j.capitalize}},reversecase:{defaultHandler:function(b){return a._doCase(c(b,{type:"reverse"}))},actionDescription:{name:j.reversecase}},toggleOverwriteMode:{defaultHandler:function(){return a._doOverwriteMode()},
actionDescription:{name:j.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(){return a._doTabMode()},actionDescription:{name:j.toggleTabMode}},toggleWrapMode:{defaultHandler:function(){return a._doWrapMode()},actionDescription:{name:j.toggleWrapMode}}}},_createRuler:function(c,b){if(this._clientDiv){var e=c.getLocation()==="left"?this._leftDiv:this._rightDiv;e.style.display="block";var d=a.createElement(e.ownerDocument,"div");d._ruler=c;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(b===void 0||b<0||b>=e.children.length)e.appendChild(d);else{for(var f=e.firstChild;f&&--b>0;)f=f.nextSibling;e.insertBefore(d,f)}}},_createView:function(){if(!this._clientDiv){for(var c=this._parent;c.hasChildNodes();)c.removeChild(c.lastChild);var b=c.ownerDocument,e=a.createElement(b,"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");c.appendChild(e);c=a.createElement(b,"div");c.className="textviewLeftRuler";this._leftDiv=c;c.tabIndex=-1;c.style.overflow="hidden";c.style.MozUserSelect="none";c.style.WebkitUserSelect="none";c.style.position="absolute";c.style.top="0px";c.style.bottom="0px";c.style.cursor="default";c.style.display="none";c.setAttribute("aria-hidden","true");e.appendChild(c);
c=a.createElement(b,"div");c.className="textviewScroll";this._viewDiv=c;c.tabIndex=-1;c.style.overflow="auto";c.style.position="absolute";c.style.top="0px";c.style.bottom="0px";c.style.borderWidth="0px";c.style.margin="0px";c.style.outline="none";c.style.background="transparent";if(a.isMac&&a.isWebkit)c.style.pointerEvents="none",c.style.zIndex="2";e.appendChild(c);var d=a.createElement(b,"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=a.createElement(b,"div");d.style.margin="0px";d.style.borderWidth="0px";d.style.padding="0px";c.appendChild(d);if(a.isFirefox)this._clipboardDiv=c=a.createElement(b,"div"),c.style.position="fixed",c.style.whiteSpace="pre",c.style.left="-1000px",e.appendChild(c);
if(!a.isIE&&!a.isIOS)this._clipDiv=c=a.createElement(b,"div"),c.style.position="absolute",c.style.overflow="hidden",c.style.margin="0px",c.style.borderWidth="0px",c.style.padding="0px",c.style.background="transparent",e.appendChild(c),this._clipScrollDiv=d=a.createElement(b,"div"),d.style.position="absolute",d.style.height="1px",d.style.top="-1000px",d.style.background="transparent",c.appendChild(d);this._setFullSelection(this._fullSelection,!0);c=a.createElement(b,"div");c.className="textviewContent";
this._clientDiv=c;c.style.position="absolute";c.style.borderWidth="0px";c.style.margin="0px";c.style.padding="0px";c.style.outline="none";c.style.zIndex="1";c.style.WebkitUserSelect="text";c.setAttribute("spellcheck","false");if(a.isIOS||a.isAndroid)c.style.WebkitTapHighlightColor="transparent";(this._clipDiv||e).appendChild(c);if(a.isIOS||a.isAndroid)this._vScrollDiv=d=a.createElement(b,"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=a.createElement(b,"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(a.isFirefox&&!c.setCapture)this._overlayDiv=b=a.createElement(b,"div"),b.style.position=c.style.position,b.style.borderWidth=c.style.borderWidth,b.style.margin=c.style.margin,b.style.padding=c.style.padding,b.style.cursor="text",b.style.zIndex="2",(this._clipDiv||e).appendChild(b);c.contentEditable="true";c.setAttribute("role","textbox");c.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(b=0;b<e.length;b++)this._createRuler(e[b]);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:b.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var c=a.getLocation()==="left"?this._leftDiv:this._rightDiv;if(c)for(var b=c.firstChild;b;){if(b._ruler===a){b._ruler=
void 0;c.removeChild(b);if(c.children.length===0)c.style.display="none";break}b=b.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,c,b){this._autoScrollDir=a;this._autoScrollX=c;this._autoScrollY=b;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 c=this._hasFocus;this._ignoreFocus=!0;c&&a.blur();a.contentEditable=!1;a.contentEditable=!0;c&&a.focus();this._ignoreFocus=!1}},_getBaseText:function(a,c){var b=this._model;b.getBaseModel&&(a=b.mapOffset(a),c=b.mapOffset(c),b=b.getBaseModel());return b.getText(a,c)},_getBottomIndex:function(a){var c=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=c.getBoundingClientRect(),b=this._clientDiv.getBoundingClientRect();a.bottom>b.bottom&&(c=this._getLinePrevious(c)||
c)}return c.lineIndex},_getBoundsAtOffset:function(a){var c=this._getLine(this._model.getLineAtOffset(a)),a=c.getBoundingClientRect(a),b=this._getLinePixel(c.lineIndex);a.top+=b;a.bottom+=b;c.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(c,b){var e=this._model.getLineDelimiter(),
d,f,g=this._getWindow();if(g.clipboardData)return d=[],f=g.clipboardData.getData("Text"),l(f,function(a){d.push(a)},function(){d.push(e)}),f=d.join(""),b&&b(f),f;if(a.isFirefox){this._ignoreFocus=!0;var h=this._clipboardDiv;h.innerHTML="<pre contenteditable=''></pre>";h.firstChild.focus();var i=this,n=function(){var a=i._getTextFromElement(h);h.innerHTML="";d=[];l(a,function(a){d.push(a)},function(){d.push(e)});return d.join("")},j=!1;this._ignorePaste=!0;if(!a.isLinux||this._lastMouseButton!==2)try{j=
h.ownerDocument.execCommand("paste",!1,null)}catch(p){j=h.childNodes.length>1||h.firstChild&&h.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!j)return c?(g.setTimeout(function(){i.focus();(f=n())&&b&&b(f);i._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(f=n())&&b&&b(f);return f}return c&&c.clipboardData?(d=[],f=c.clipboardData.getData("text/plain"),l(f,function(a){d.push(a)},function(){d.push(e)}),(f=d.join(""))&&b&&b(f),f):""},_getDOMText:function(a,
c){for(var b=a.firstChild,e="",d=0;b;){var f;if(!b.ignore)if(b.ignoreChars){f=b.lastChild;for(var g=0,h=[],l=-1;f;){for(var i=f.data,n=i.length-1;n>=0;n--){var j=i.substring(n,n+1);g<b.ignoreChars&&(j===" "||j==="\u200c"||j==="\ufeff")?g++:h.push(j==="\u00a0"?"\t":j)}if(c===f)l=h.length;f=f.previousSibling}h=h.reverse().join("");l!==-1&&(d=e.length+h.length-l);e+=h}else for(f=b.firstChild;f;){if(c===f)d=e.length;e+=f.data;f=f.nextSibling}b=b.nextSibling}return{text:e,offset:d}},_getTextFromElement:function(a){var c=
a.ownerDocument,b=c.defaultView;if(!b.getSelection)return a.innerText||a.textContent;c=c.createRange();c.selectNode(a);var a=b.getSelection(),b=[],e;for(e=0;e<a.rangeCount;e++)b.push(a.getRangeAt(e));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(c);c=a.toString();a.removeAllRanges();for(e=0;e<b.length;e++)a.addRange(b[e]);this._ignoreSelect=!1;return c},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var c=this._getLineNode(a);return c&&!c.lineChanged&&!c.lineRemoved?
c._line:new r(this,a)},_getLineHeight:function(a,c){if(a!==void 0&&this._lineHeight){var b=this._lineHeight[a];if(b)return b;if(c||c===void 0)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var c=this._clientDiv.firstChild;c;){if(a===c.lineIndex)return c;c=c.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 c=this._getTopIndex(),b=-this._topIndexY+this._getScroll().y;if(a>c)for(;c<a;c++)b+=this._getLineHeight(c);else for(c-=1;c>=a;c--)b-=this._getLineHeight(c);return b}return this._getLineHeight()*a},_getLineIndex:function(a){var c,b=0,e=this._model.getLineCount();if(this._lineHeight){var b=this._getTopIndex(),
d=-this._topIndexY+this._getScroll().y;if(a!==d)if(a<d)for(;a<d&&b>0;)a+=this._getLineHeight(--b);else for(c=this._getLineHeight(b);a-c>=d&&b<e-1;)a-=c,c=this._getLineHeight(++b)}else c=this._getLineHeight(),b=Math.floor(a/c);return Math.max(0,Math.min(e-1,b))},_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 c=this._topChild;if(a&&this._getClientHeight()>
this._getLineHeight()){var a=c.getBoundingClientRect(),b=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect();a.top<e.top+b.top&&(c=this._getLineNext(c)||c)}return c.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 b=this._handlers=[],e=this._clientDiv,d=this._viewDiv,g=this._rootDiv,h=this._overlayDiv||e,l=e.ownerDocument,i=this._getWindow(),n=a.isIE?l:i;b.push({target:i,type:"resize",handler:function(a){return c._handleResize(a?a:i.event)}});b.push({target:e,type:"blur",handler:function(a){return c._handleBlur(a?a:i.event)}});b.push({target:e,type:"focus",handler:function(a){return c._handleFocus(a?
a:i.event)}});b.push({target:d,type:"focus",handler:function(){e.focus()}});b.push({target:d,type:"scroll",handler:function(a){return c._handleScroll(a?a:i.event)}});b.push({target:e,type:"textInput",handler:function(a){return c._handleTextInput(a?a:i.event)}});b.push({target:e,type:"keydown",handler:function(a){return c._handleKeyDown(a?a:i.event)}});b.push({target:e,type:"keypress",handler:function(a){return c._handleKeyPress(a?a:i.event)}});b.push({target:e,type:"keyup",handler:function(a){return c._handleKeyUp(a?
a:i.event)}});b.push({target:e,type:"contextmenu",handler:function(a){return c._handleContextMenu(a?a:i.event)}});b.push({target:e,type:"copy",handler:function(a){return c._handleCopy(a?a:i.event)}});b.push({target:e,type:"cut",handler:function(a){return c._handleCut(a?a:i.event)}});b.push({target:e,type:"paste",handler:function(a){return c._handlePaste(a?a:i.event)}});if(a.isIOS||a.isAndroid)b.push({target:l,type:"selectionchange",handler:function(a){return c._handleSelectionChange(a?a:i.event)}}),
b.push({target:e,type:"touchstart",handler:function(a){return c._handleTouchStart(a?a:i.event)}}),b.push({target:e,type:"touchmove",handler:function(a){return c._handleTouchMove(a?a:i.event)}}),b.push({target:e,type:"touchend",handler:function(a){return c._handleTouchEnd(a?a:i.event)}});else{b.push({target:e,type:"selectstart",handler:function(a){return c._handleSelectStart(a?a:i.event)}});b.push({target:e,type:"mousedown",handler:function(a){return c._handleMouseDown(a?a:i.event)}});b.push({target:e,
type:"mouseover",handler:function(a){return c._handleMouseOver(a?a:i.event)}});b.push({target:e,type:"mouseout",handler:function(a){return c._handleMouseOut(a?a:i.event)}});b.push({target:n,type:"mouseup",handler:function(a){return c._handleMouseUp(a?a:i.event)}});b.push({target:n,type:"mousemove",handler:function(a){return c._handleMouseMove(a?a:i.event)}});b.push({target:g,type:"mousedown",handler:function(a){return c._handleRootMouseDown(a?a:i.event)}});b.push({target:g,type:"mouseup",handler:function(a){return c._handleRootMouseUp(a?
a:i.event)}});b.push({target:h,type:"dragstart",handler:function(a){return c._handleDragStart(a?a:i.event)}});b.push({target:h,type:"drag",handler:function(a){return c._handleDrag(a?a:i.event)}});b.push({target:h,type:"dragend",handler:function(a){return c._handleDragEnd(a?a:i.event)}});b.push({target:h,type:"dragenter",handler:function(a){return c._handleDragEnter(a?a:i.event)}});b.push({target:h,type:"dragover",handler:function(a){return c._handleDragOver(a?a:i.event)}});b.push({target:h,type:"dragleave",
handler:function(a){return c._handleDragLeave(a?a:i.event)}});b.push({target:h,type:"drop",handler:function(a){return c._handleDrop(a?a:i.event)}});b.push({target:this._clientDiv,type:a.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return c._handleMouseWheel(a?a:i.event)}});if(a.isFirefox&&(!a.isWindows||a.isFirefox>=15))(d=i.MutationObserver||i.MozMutationObserver)?(this._mutationObserver=new d(function(a){c._handleDataModified(a)}),this._mutationObserver.observe(e,{subtree:!0,characterData:!0})):
b.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(a){return c._handleDataModified(a?a:i.event)}});this._overlayDiv&&(b.push({target:this._overlayDiv,type:"mousedown",handler:function(a){return c._handleMouseDown(a?a:i.event)}}),b.push({target:this._overlayDiv,type:"mouseover",handler:function(a){return c._handleMouseOver(a?a:i.event)}}),b.push({target:this._overlayDiv,type:"mouseout",handler:function(a){return c._handleMouseOut(a?a:i.event)}}),b.push({target:this._overlayDiv,
type:"contextmenu",handler:function(a){return c._handleContextMenu(a?a:i.event)}}));this._isW3CEvents||b.push({target:this._clientDiv,type:"dblclick",handler:function(a){return c._handleDblclick(a?a:i.event)}})}d=this._leftDiv;g=this._rightDiv;a.isIE&&b.push({target:d,type:"selectstart",handler:function(){return!1}});b.push({target:d,type:a.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return c._handleMouseWheel(a?a:i.event)}});b.push({target:d,type:"click",handler:function(a){c._handleRulerEvent(a?
a:i.event)}});b.push({target:d,type:"dblclick",handler:function(a){c._handleRulerEvent(a?a:i.event)}});b.push({target:d,type:"mousemove",handler:function(a){c._handleRulerEvent(a?a:i.event)}});b.push({target:d,type:"mouseover",handler:function(a){c._handleRulerEvent(a?a:i.event)}});b.push({target:d,type:"mouseout",handler:function(a){c._handleRulerEvent(a?a:i.event)}});a.isIE&&b.push({target:g,type:"selectstart",handler:function(){return!1}});b.push({target:g,type:a.isFirefox?"DOMMouseScroll":"mousewheel",
handler:function(a){return c._handleMouseWheel(a?a:i.event)}});b.push({target:g,type:"click",handler:function(a){c._handleRulerEvent(a?a:i.event)}});b.push({target:g,type:"dblclick",handler:function(a){c._handleRulerEvent(a?a:i.event)}});b.push({target:g,type:"mousemove",handler:function(a){c._handleRulerEvent(a?a:i.event)}});b.push({target:g,type:"mouseover",handler:function(a){c._handleRulerEvent(a?a:i.event)}});b.push({target:g,type:"mouseout",handler:function(a){c._handleRulerEvent(a?a:i.event)}});
for(d=0;d<b.length;d++)g=b[d],f(g.target,g.type,g.handler,g.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(c){var b=c.parent;typeof b==="string"&&(b=(c.document||document).getElementById(b));if(!b)throw"no parent";c.parent=b;c.model=c.model||new k.TextModel;var e=this._defaultOptions(),d;for(d in e)e.hasOwnProperty(d)&&
(this["_"+d]=c[d]!==void 0?c[d]:e[d].value);this._keyModes=[];this._rulers=[];this._selection=new o(0,0,!1);this._linksVisible=!1;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=!0;this._hasFocus=this._ignoreFocus=!1;this._dragOffset=this._columnX=-1;this._isRangeRects=(!a.isIE||a.isIE>=9)&&typeof b.ownerDocument.createRange().getBoundingClientRect==="function";this._isW3CEvents=b.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,c){if(!this._readonly||a._code)if(a.type="Verify",this.onVerify(a),!(a.text===null||a.text===void 0)){var b=this._model;try{if(a._ignoreDOMSelection)this._ignoreDOMSelection=
!0;b.setText(a.text,a.start,a.end)}finally{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!1}c&&(b=this._getSelection(),b.setCaret(a.start+a.text.length),this._setSelection(b,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(a){a.type="ModelChanged";this.onModelChanged(a);a.type="Changed";var c=a.start,b=a.addedCharCount,e=a.removedCharCount,d=a.addedLineCount,f=a.removedLineCount,g=this._getSelection();g.end>c&&(g.end>c&&g.start<c+e?g.setCaret(c+b):(g.start+=b-e,g.end+=b-e),this._setSelection(g,
!1,!1));c=this._model.getLineAtOffset(c);for(b=this._getLineNext();b;){e=b.lineIndex;if(c<=e&&e<=c+f)c===e&&!b.modelChangedEvent&&!b.lineRemoved?(b.modelChangedEvent=a,b.lineChanged=!0):(b.lineRemoved=!0,b.lineChanged=!1,b.modelChangedEvent=null);if(e>c+f)b.lineIndex=e+d-f,b._line.lineIndex=b.lineIndex;b=this._getLineNext(b)}this._lineHeight&&(a=[c,f].concat(Array(d)),Array.prototype.splice.apply(this._lineHeight,a));if(!this._wrapMode&&c<=this._maxLineIndex&&this._maxLineIndex<=c+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,c){if(this._wrapMode||this._variableLineHeight){if(a!==void 0&&c!==void 0)for(var b=a;b<c;b++)this._lineHeight[b]=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 o(0,0,!1),!1,!1);if(this._viewDiv)this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=
0;var c=this._clientDiv;if(c){for(var b=c.firstChild;b;)b.lineRemoved=!0,b=b.nextSibling;if(a.isFirefox)this._ignoreFocus=!1,(b=this._hasFocus)&&c.blur(),c.contentEditable=!1,c.contentEditable=!0,b&&c.focus(),this._ignoreFocus=!1}},_scrollViewAnimated:function(a,c,b){if(b&&this._scrollAnimation){var e=this;this._animation=new t({window:this._getWindow(),duration:this._scrollAnimation,curve:[c,0],onAnimate:function(a){a=c-Math.floor(a);e._scrollView(0,a);c-=a},onEnd:function(){e._animation=null;e._scrollView(a,
c);b&&b()}});this._animation.play()}else this._scrollView(a,c),b&&b()},_scrollView:function(a,c){this._ensureCaretVisible=!1;var b=this._viewDiv;a&&(b.scrollLeft+=a);c&&(b.scrollTop+=c)},_setClipboardText:function(c,b){var e,d=this._parent.ownerDocument,f=this._getWindow();if(f.clipboardData)return e=[],l(c,function(a){e.push(a)},function(){e.push(a.platformDelimiter)}),f.clipboardData.setData("Text",e.join(""));if(b&&b.clipboardData&&(e=[],l(c,function(a){e.push(a)},function(){e.push(a.platformDelimiter)}),
b.clipboardData.setData("text/plain",e.join(""))))return!0;var g=a.createElement(d,"pre");g.style.position="fixed";g.style.left="-1000px";l(c,function(a){g.appendChild(d.createTextNode(a))},function(){g.appendChild(a.createElement(d,"br"))});g.appendChild(d.createTextNode(" "));this._clientDiv.appendChild(g);var h=d.createRange();h.setStart(g.firstChild,0);h.setEndBefore(g.lastChild);var i=f.getSelection();i.rangeCount>0&&i.removeAllRanges();i.addRange(h);var n=this,h=function(){g&&g.parentNode===
n._clientDiv&&n._clientDiv.removeChild(g);n._updateDOMSelection()},i=!1;this._ignoreCopy=!0;try{i=d.execCommand("copy",!1,null)}catch(j){}this._ignoreCopy=!1;if(!i&&b)return f.setTimeout(h,0),!1;h();return!0},_setDOMSelection:function(c,b,e,d,f){for(var g,h,l,i,n=0,j=c.firstChild,p,o,k=this._model.getLine(c.lineIndex).length;j;){if(!j.ignore){p=j.firstChild;o=p.length;j.ignoreChars&&(o-=j.ignoreChars);if(n+o>b||n+o>=k){g=p;h=b-n;j.ignoreChars&&o>0&&h===o&&(h+=j.ignoreChars);break}n+=o}j=j.nextSibling}for(var n=
0,j=e.firstChild,s=this._model.getLine(e.lineIndex).length;j;){if(!j.ignore){p=j.firstChild;o=p.length;j.ignoreChars&&(o-=j.ignoreChars);if(o+n>d||n+o>=s){l=p;i=d-n;j.ignoreChars&&o>0&&i===o&&(i+=j.ignoreChars);break}n+=o}j=j.nextSibling}this._setDOMFullSelection(c,b,k,e,d,s);c=this._getWindow();b=this._parent.ownerDocument;if(c.getSelection){e=c.getSelection();c=b.createRange();c.setStart(g,h);c.setEnd(l,i);if(this._hasFocus&&(e.anchorNode!==g||e.anchorOffset!==h||e.focusNode!==l||e.focusOffset!==
i||e.anchorNode!==l||e.anchorOffset!==i||e.focusNode!==g||e.focusOffset!==h))this._ignoreSelect=!1,e.rangeCount>0&&e.removeAllRanges(),e.addRange(c),this._ignoreSelect=!0;if(this._cursorDiv&&(c=b.createRange(),f?(c.setStart(g,h),c.setEnd(g,h)):(c.setStart(l,i),c.setEnd(l,i)),l=c.getClientRects()[0],i=this._cursorDiv.parentNode,g=i.getBoundingClientRect(),l&&g))this._cursorDiv.style.top=l.top-g.top+i.scrollTop+"px",this._cursorDiv.style.left=l.left-g.left+i.scrollLeft+"px"}else if(b.selection&&this._hasFocus)f=
b.body,c=a.createElement(b,"div"),f.appendChild(c),f.removeChild(c),c=f.createTextRange(),c.moveToElementText(g.parentNode),c.moveStart("character",h),g=f.createTextRange(),g.moveToElementText(l.parentNode),g.moveStart("character",i),c.setEndPoint("EndToStart",g),this._ignoreSelect=!1,c.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(a,c,b,e,d){if(this._selDiv1&&(b=this._selDiv1,b.style.width="0px",b.style.height="0px",b=this._selDiv2,b.style.width="0px",b.style.height="0px",b=this._selDiv3,
b.style.width="0px",b.style.height="0px",!(a===e&&c===d))){var f=this._model,g=this._getViewPadding(),h=this._clientDiv.getBoundingClientRect(),l=this._viewDiv.getBoundingClientRect(),b=l.left+g.left,i=h.right,g=l.top+g.top,n=h.bottom,l=h=0;this._clipDiv?(l=this._clipDiv.getBoundingClientRect(),h=l.left-this._clipDiv.scrollLeft):(l=this._rootDiv.getBoundingClientRect(),h=l.left);l=l.top;this._ignoreDOMSelection=!0;var a=(new r(this,a.lineIndex,a)).getBoundingClientRect(f.getLineStart(a.lineIndex)+
c,!1),j=a.left,d=(new r(this,e.lineIndex,e)).getBoundingClientRect(f.getLineStart(e.lineIndex)+d,!1),c=d.left;this._ignoreDOMSelection=!1;var f=this._selDiv1,j=Math.min(i,Math.max(b,j)),p=Math.min(n,Math.max(g,a.top)),o=i,e=Math.min(n,Math.max(g,a.bottom));f.style.left=j-h+"px";f.style.top=p-l+"px";f.style.width=Math.max(0,o-j)+"px";f.style.height=Math.max(0,e-p)+"px";if(a.top===d.top)o=Math.min(c,i),f.style.width=Math.max(0,o-j)+"px";else if(a=Math.min(n,Math.max(g,d.top)),c=Math.min(i,Math.max(b,
c)),g=Math.min(n,Math.max(g,d.bottom)),n=this._selDiv3,n.style.left=b-h+"px",n.style.top=a-l+"px",n.style.width=Math.max(0,c-b)+"px",n.style.height=Math.max(0,g-a)+"px",a-e>0)g=this._selDiv2,g.style.left=b-h+"px",g.style.top=e-l+"px",g.style.width=Math.max(0,i-b)+"px",g.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(c){if(this._linksVisible!==c){this._linksVisible=c;if(a.isIE&&c)this._hadFocus=this._hasFocus;var b=this._clientDiv;b.contentEditable=!c;this._hadFocus&&!c&&b.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=c?"-1":"1";for(c=this._getLineNext();c;){if(c.hasLink)for(b=c.firstChild;b;)if(b.ignore)b=b.nextSibling;else{var e=b.nextSibling,d=b.viewStyle;d&&d.tagName&&d.tagName.toLowerCase()==="a"&&c.replaceChild(c._line._createSpan(c,b.firstChild.data,d),b);b=e}c=this._getLineNext(c)}this._updateDOMSelection()}},
_setSelection:function(a,c,b,e,d){if(a){this._columnX=-1;b===void 0&&(b=!0);var f=this._selection;this._selection=a;c!==!1&&this._showCaret(!1,e,c,d);b&&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,c,b,e){var d=this._model,f=this._getSelection(),c=this.convert({x:a,y:c},"page","document"),a=this._getLineIndex(c.y);if(this._clickCount===1){d=this._getLine(a);a=d.getOffset(c.x,
c.y-this._getLinePixel(a));d.destroy();if(e&&!b&&f.start<=a&&a<f.end)return this._dragOffset=a,!1;f.extend(a);b||f.collapse()}else(this._clickCount&1)===0?(d=this._getLine(a),a=d.getOffset(c.x,c.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(b=this._doubleClickSelection.start,e=d.getNextOffset(a,{unit:"wordend",count:1})):(b=d.getNextOffset(a,{unit:"word",count:-1}),e=this._doubleClickSelection.end):(b=d.getNextOffset(a,{unit:"word",count:-1}),e=d.getNextOffset(b,
{unit:"wordend",count:1})),d.destroy()):this._doubleClickSelection?(e=d.getLineAtOffset(this._doubleClickSelection.start),a>=e?(b=d.getLineStart(e),e=d.getLineEnd(a)):(b=d.getLineStart(a),e=d.getLineEnd(e))):(b=d.getLineStart(a),e=d.getLineEnd(a)),f.setCaret(b),f.extend(e);this._setSelection(f,!0,!0);return!0},_setFullSelection:function(c,b){this._fullSelection=c;if(a.isWebkit)this._fullSelection=!0;var e=this._clipDiv||this._rootDiv;if(e)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&
!a.isIOS){var d=e.ownerDocument;this._highlightRGB=a.isWebkit?"transparent":"Highlight";var f=a.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 g=a.createElement(d,"div");this._selDiv2=g;g.style.position="absolute";g.style.borderWidth="0px";g.style.margin="0px";g.style.padding=
"0px";g.style.outline="none";g.style.background=this._highlightRGB;g.style.width="0px";g.style.height="0px";g.style.zIndex="0";e.appendChild(g);this._selDiv3=d=a.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(a.isFirefox&&a.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;g.style.background=e;d.style.background=
e}b||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 c=
a.createElement(document,"div");c.className="textviewBlockCursor";this._cursorDiv=c;c.tabIndex=-1;c.style.zIndex="2";c.style.color="transparent";c.style.position="absolute";c.style.pointerEvents="none";c.innerHTML="&nbsp;";this._viewDiv.appendChild(c);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(c,
b){this._tabSize=c;this._customTabSize=void 0;var e=this._clientDiv;if(a.isOpera){if(e)e.style.OTabSize=this._tabSize+""}else if(a.isWebkit>=537.1){if(e)e.style.tabSize=this._tabSize+""}else if(a.isFirefox>=4){if(e)e.style.MozTabSize=this._tabSize+""}else if(this._tabSize!==8)this._customTabSize=this._tabSize;b||(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,c){this._themeClass=a;var b="textview",e=this._theme.getThemeClass();e&&(b+=" "+e);this._themeClass&&e!==this._themeClass&&(b+=" "+this._themeClass);this._rootDiv.className=b;this._updateStyle(c)},_setWrapMode:function(a,c){this._wrapMode=a&&this._wrappable;var b=this._clientDiv,e=this._viewDiv;a?(b.style.whiteSpace="pre-wrap",b.style.wordWrap="break-word",e.style.overflowX="hidden",e.style.overflowY="scroll"):
(b.style.whiteSpace="pre",b.style.wordWrap="normal",e.style.overflowX="auto",e.style.overflowY="auto");c||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,c,b,e){if(this._clientDiv){var d=this._model,f=this._getSelection(),g=this._getScroll(),h=f.getCaret(),l=f.start,i=f.end,n=d.getLineAtOffset(i),j=Math.max(Math.max(l,d.getLineStart(n)),i-1),d=this._getClientWidth(),n=this._getClientHeight(),p=d/4,o=this._getBoundsAtOffset(h===l?l:j),k=o.left,s=o.right,r=o.top,
q=o.bottom;a&&!f.isEmpty()&&(o=this._getBoundsAtOffset(h===i?l:j),o.top===r?h===l?s=k+Math.min(o.right-k,d):k=s-Math.min(s-o.left,d):h===l?q=r+Math.min(o.bottom-r,n):r=q-Math.min(q-o.top,n));a=0;k<g.x&&(a=Math.min(k-g.x,-p));s>g.x+d&&(a=Math.max(s-g.x-d,p));f=0;r<g.y?f=r-g.y:q>g.y+n&&(f=q-g.y-n);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 b==="number"&&(b<0&&(b=0),b>1&&(b=1),f+=Math.floor(f>0?b*n:-b*n)),this._scrollViewAnimated(a,f,c),n!==this._getClientHeight()||
d!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;else c&&c();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 c=this._handlers[a],b=c.target,e=c.type,c=c.handler;typeof b.removeEventListener==="function"?b.removeEventListener(e,c,!1):b.detachEvent("on"+e,c)}this._handlers=null;if(this._mutationObserver)this._mutationObserver.disconnect(),this._mutationObserver=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection&&this._clientDiv){var a=this._getSelection(),c=this._model,b=c.getLineAtOffset(a.start),e=c.getLineAtOffset(a.end),
d=this._getLineNext();if(d){var f=this._getLinePrevious(),g;b<d.lineIndex?(g=d,b=0):b>f.lineIndex?(g=f,b=0):(g=this._getLineNode(b),b=a.start-c.getLineStart(b));e<d.lineIndex?c=0:e>f.lineIndex?(d=f,c=0):(d=this._getLineNode(e),c=a.end-c.getLineStart(e));this._setDOMSelection(g,b,d,c,a.caret)}}},_update:function(c){if(!(this._redrawCount>0)){if(this._updateTimer)this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=null,c=!1;var b=this._clientDiv;if(b){if(this._metrics.invalid)this._ignoreQueueUpdate=
!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var e=this._model,d=this._getScroll(!1),f=this._getViewPadding(),g=e.getLineCount(),h=this._getLineHeight(),l=this._getClientWidth();if(this._wrapMode)b.style.width=l+"px";var i,n,j,p,o=0,k=0;if(this._lineHeight){for(;k<g;){n=this._getLineHeight(k);if(o+n>d.y)break;o+=n;k++}i=k;n=Math.max(0,i-1);j=e=d.y-o;i>0&&(e+=this._getLineHeight(i-1))}else p=Math.max(0,d.y)/h,i=Math.floor(p),n=Math.max(0,i-1),e=Math.round((p-n)*h),j=Math.round((p-i)*h);this._topIndexY=
j;p=this._parent;var s=p.clientWidth,q=p.clientHeight;p=this._getClientHeight();if(c){h=0;this._leftDiv&&(i=this._leftDiv.getBoundingClientRect(),h=i.right-i.left);i=l;for(this._wrapMode||(i=Math.max(this._maxLineWidth,i));k<g;)n=this._getLineHeight(k,!1),o+=n,k++;g=o}else{l=this._viewDiv;j=Math.min(i+Math.floor((p+j)/h),g-1);for(var d=Math.min(j+1,g-1),t,y=b.firstChild;y;){t=y.lineIndex;var G=y.nextSibling;if(!(n<=t&&t<=d)||y.lineRemoved||y.lineIndex===-1)this._mouseWheelLine===y?(y.style.display=
"none",y.lineIndex=-1):b.removeChild(y);y=G}var y=this._getLineNext(),G=l.ownerDocument,H=G.createDocumentFragment();for(t=n;t<=d;t++)if(!y||y.lineIndex>t)(new r(this,t)).create(H,null);else{H.firstChild&&(b.insertBefore(H,y),H=G.createDocumentFragment());if(y&&y.lineChanged)y=(new r(this,t)).create(H,y),y.lineChanged=!1;y=this._getLineNext(y)}H.firstChild&&b.insertBefore(H,y);if(a.isWebkit&&!this._wrapMode)b.style.width="0x7fffffffpx";y=this._getLineNext();t=p+e;for(H=!1;y;){n=y.lineWidth;if(n===
void 0)if(G=y._line.getBoundingClientRect(),n=y.lineWidth=Math.ceil(G.right-G.left),G=G.bottom-G.top,this._lineHeight)this._lineHeight[y.lineIndex]=G;else if(h!==0&&G!==0&&Math.ceil(h)!==Math.ceil(G))this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[y.lineIndex]=G;if(this._lineHeight&&!H&&(t-=this._lineHeight[y.lineIndex],t<0))j=y.lineIndex,H=!0;if(!this._wrapMode){if(n>=this._maxLineWidth)this._maxLineWidth=n,this._maxLineIndex=y.lineIndex;if(this._checkMaxLineIndex===y.lineIndex)this._checkMaxLineIndex=
-1}if(y.lineIndex===i)this._topChild=y;if(y.lineIndex===j)this._bottomChild=y;y=this._getLineNext(y)}if(this._checkMaxLineIndex!==-1&&(t=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=t&&t<g)){h=new r(this,t);G=h.getBoundingClientRect();n=G.right-G.left;if(n>=this._maxLineWidth)this._maxLineWidth=n,this._maxLineIndex=t;h.destroy()}for(;k<g;)n=this._getLineHeight(k,k<=j),o+=n,k++;g=o;this._updateRuler(this._leftDiv,i,d,q);this._updateRuler(this._rightDiv,i,d,q);h=0;this._leftDiv&&(i=this._leftDiv.getBoundingClientRect(),
h=i.right-i.left);d=0;this._rightDiv&&(d=this._rightDiv.getBoundingClientRect(),d=d.right-d.left);l.style.left=h+"px";l.style.right=d+"px";d=this._scrollDiv;d.style.height=g+"px";o=l=this._getClientWidth();this._wrapMode||(o=Math.max(this._maxLineWidth,o));i=o;if((!a.isIE||a.isIE>=9)&&this._maxLineWidth>l)o+=f.right+f.left;d.style.width=o+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=o+"px";d=this._getScroll(!1)}if(this._vScrollDiv)o=p-8,k=Math.max(15,Math.ceil(Math.min(1,o/(g+f.top+
f.bottom))*o)),this._vScrollDiv.style.left=h+l-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,d.y*o/g))+"px",this._vScrollDiv.style.height=k+"px";if(!this._wrapMode&&this._hScrollDiv)o=l-8,k=Math.max(15,Math.ceil(Math.min(1,o/(this._maxLineWidth+f.left+f.right))*o)),this._hScrollDiv.style.left=h+Math.floor(Math.max(0,Math.floor(d.x*o/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=p-9+"px",this._hScrollDiv.style.width=k+"px";y=d.x;n=this._clipDiv;o=this._overlayDiv;if(n){n.scrollLeft=
y;n.scrollTop=0;k=h+f.left;j=f.top;c=l;h=p;y=0;t=-e;if(d.x===0)k-=f.left,c+=f.left,y=f.left;d.x+l===i&&(c+=f.right);d.y===0&&(j-=f.top,h+=f.top,t+=f.top);d.y+p===g&&(h+=f.bottom);n.style.left=k+"px";n.style.top=j+"px";n.style.right=s-c-k+"px";n.style.bottom=q-h-j+"px";b.style.left=y+"px";b.style.top=t+"px";b.style.width=i+"px";b.style.height=p+e+"px";if(o)o.style.left=b.style.left,o.style.top=b.style.top,o.style.width=b.style.width,o.style.height=b.style.height}else{k=y;j=e;s=y+l;q=e+p;k===0&&(k-=
f.left);j===0&&(j-=f.top);s===i&&(s+=f.right);d.y+p===g&&(q+=f.bottom);b.style.clip="rect("+j+"px,"+s+"px,"+q+"px,"+k+"px)";b.style.left=-y+h+f.left+"px";b.style.width=(a.isWebkit?i:l+y)+"px";if(!c)b.style.top=-e+f.top+"px",b.style.height=p+e+"px";if(o&&(o.style.clip=b.style.clip,o.style.left=b.style.left,o.style.width=b.style.width,!c))o.style.top=b.style.top,o.style.height=b.style.height}this._updateDOMSelection();b=this._ensureCaretVisible;this._ensureCaretVisible=!1;p!==this._getClientHeight()&&
(this._update(),b&&this._showCaret())}}},_updateRuler:function(c,b,e,d){if(c)for(var f=this._parent.ownerDocument,g=this._getLineHeight(),l=this._getViewPadding(),c=c.firstChild;c;){var i=c._ruler,n=g,j=i.getOverview();j==="page"&&(n+=this._topIndexY);c.style.top=-n+"px";c.style.height=d+n+"px";c.rulerChanged&&h(i.getRulerStyle(),c);var p,o=c.firstChild;o?(p=o,o=o.nextSibling):(p=a.createElement(f,"div"),p.style.visibility="hidden",c.appendChild(p));var k;if(c.rulerChanged&&p){n=-1;if(k=i.getWidestAnnotation())if(h(k.style,
p),k.html)p.innerHTML=k.html;p.lineIndex=n;p.style.height=g+l.top+"px"}var s;if(j==="page"){for(i=i.getAnnotations(b,e+1);o;)n=o.lineIndex,k=o.nextSibling,(!(b<=n&&n<=e)||o.lineChanged)&&c.removeChild(o),o=k;o=c.firstChild.nextSibling;s=f.createDocumentFragment();for(n=b;n<=e;n++)if(!o||o.lineIndex>n){p=a.createElement(f,"div");if(k=i[n]){h(k.style,p);if(k.html)p.innerHTML=k.html;p.annotation=k}p.lineIndex=n;p.style.height=this._getLineHeight(n)+"px";s.appendChild(p)}else if(s.firstChild&&(c.insertBefore(s,
o),s=f.createDocumentFragment()),o)o=o.nextSibling;s.firstChild&&c.insertBefore(s,o)}else{k=this._getClientHeight();n=this._model.getLineCount();o=k+l.top+l.bottom-2*this._metrics.scrollWidth;j=g*n<o?g:o/n;if(c.rulerChanged){for(k=c.childNodes.length;k>1;)c.removeChild(c.lastChild),k--;i=i.getAnnotations(0,n);s=f.createDocumentFragment();for(var r in i)if(n=r>>>0,!(n<0)){p=a.createElement(f,"div");k=i[r];h(k.style,p);p.style.position="absolute";p.style.top=this._metrics.scrollWidth+g+Math.floor(n*
j)+"px";if(k.html)p.innerHTML=k.html;p.annotation=k;p.lineIndex=n;s.appendChild(p)}c.appendChild(s)}else if(c._oldTrackHeight!==o)for(p=c.firstChild?c.firstChild.nextSibling:null;p;)p.style.top=this._metrics.scrollWidth+g+Math.floor(p.lineIndex*j)+"px",p=p.nextSibling;c._oldTrackHeight=o}c.rulerChanged=!1;c=c.nextSibling}},_updateStyleSheet:function(){var c="";a.isWebkit&&this._metrics.scrollWidth>0&&(c+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");a.isFirefox&&a.isMac&&this._highlightRGB&&
this._highlightRGB!=="Highlight"&&(c+="\n.textview ::-moz-selection {background: "+this._highlightRGB+";}");if(c){var b=document.getElementById("_textviewStyle");if(b)b.removeChild(b.firstChild),b.appendChild(document.createTextNode(c));else{b=a.createElement(document,"style");b.id="_textviewStyle";var e=document.getElementsByTagName("head")[0]||document.documentElement;b.appendChild(document.createTextNode(c));e.insertBefore(b,e.firstChild)}}},_updateStyle:function(c){if(!c&&a.isIE)this._rootDiv.style.lineHeight=
"normal";var b=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=a.isIE?b.lineHeight-(b.lineTrim.top+b.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();c||(this.redraw(),this._resetLineWidth())}};d.EventTarget.addMixin(q.prototype);return{TextView:q}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(j,k){function i(d){this._model=d;this._projections=[]}i.prototype={addProjection:function(d){if(d){var b=this._model,a=this._projections;d._lineIndex=b.getLineAtOffset(d.start);d._lineCount=b.getLineAtOffset(d.end)-d._lineIndex;var f=d.text;f||(f="");d._model=typeof f==="string"?new j.TextModel(f,b.getLineDelimiter()):f;var b=this.mapOffset(d.start,!0),f=d.end-d.start,h=d._lineCount,g=d._model.getCharCount(),
c=d._model.getLineCount()-1;this.onChanging({type:"Changing",text:d._model.getText(),start:b,removedCharCount:f,addedCharCount:g,removedLineCount:h,addedLineCount:c});var e=this._binarySearch(a,d.start);a.splice(e,0,d);this.onChanged({type:"Changed",start:b,removedCharCount:f,addedCharCount:g,removedLineCount:h,addedLineCount:c})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(d,b){var a=this._projections,f=0,h,g;if(b){for(h=
0;h<a.length;h++){g=a[h];if(g.start>d)break;if(g.end>d)return-1;f+=g._model.getCharCount()-(g.end-g.start)}return d+f}for(h=0;h<a.length;h++){g=a[h];if(g.start>d-f)break;var c=g._model.getCharCount();if(g.start+c>d-f)return-1;f+=c-(g.end-g.start)}return d-f},removeProjection:function(d){var b,a=0;for(b=0;b<this._projections.length;b++){var f=this._projections[b];if(f===d){d=f;break}a+=f._model.getCharCount()-(f.end-f.start)}if(b<this._projections.length){var f=this._model,a=d.start+a,h=d.end-d.start,
g=d._lineCount,c=d._model.getCharCount(),e=d._model.getLineCount()-1;this.onChanging({type:"Changing",text:f.getText(d.start,d.end),start:a,removedCharCount:c,addedCharCount:h,removedLineCount:e,addedLineCount:g});this._projections.splice(b,1);this.onChanged({type:"Changed",start:a,removedCharCount:c,addedCharCount:h,removedLineCount:e,addedLineCount:g})}},_binarySearch:function(d,b){for(var a=d.length,f=-1,h;a-f>1;)h=Math.floor((a+f)/2),b<=d[h].start?a=h:f=h;return a},getCharCount:function(){for(var d=
this._model.getCharCount(),b=this._projections,a=0;a<b.length;a++){var f=b[a];d+=f._model.getCharCount()-(f.end-f.start)}return d},getLine:function(d,b){if(d<0)return null;var a=this._model,f=this._projections,h=0,g=[],c=0,e,l,i;for(e=0;e<f.length;e++){i=f[e];if(i._lineIndex>=d-h)break;l=i._model.getLineCount()-1;if(i._lineIndex+l>=d-h)if(c=d-(i._lineIndex+h),c<l)return i._model.getLine(c,b);else g.push(i._model.getLine(l));c=i.end;h+=l-i._lineCount}for(c=Math.max(c,a.getLineStart(d-h));e<f.length;e++){i=
f[e];if(i._lineIndex>d-h)break;g.push(a.getText(c,i.start));l=i._model.getLineCount()-1;if(i._lineIndex+l>d-h)return g.push(i._model.getLine(0,b)),g.join("");g.push(i._model.getText());c=i.end;h+=l-i._lineCount}f=a.getLineEnd(d-h,b);c<f&&g.push(a.getText(c,f));return g.join("")},getLineAtOffset:function(d){for(var b=this._model,a=this._projections,f=0,h=0,g=0;g<a.length;g++){var c=a[g];if(c.start>d-f)break;var e=c._model.getCharCount();if(c.start+e>d-f){a=d-(c.start+f);h+=c._model.getLineAtOffset(a);
f+=a;break}h+=c._model.getLineCount()-1-c._lineCount;f+=e-(c.end-c.start)}return b.getLineAtOffset(d-f)+h},getLineCount:function(){for(var d=this._projections,b=this._model.getLineCount(),a=0;a<d.length;a++){var f=d[a];b+=f._model.getLineCount()-1-f._lineCount}return b},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(d,b){if(d<0)return-1;for(var a=this._model,f=this._projections,h=0,g=0,c=0;c<f.length;c++){var e=f[c];if(e._lineIndex>d-h)break;var l=e._model.getLineCount()-
1;if(e._lineIndex+l>d-h)return e._model.getLineEnd(d-(e._lineIndex+h),b)+e.start+g;g+=e._model.getCharCount()-(e.end-e.start);h+=l-e._lineCount}return a.getLineEnd(d-h,b)+g},getLineStart:function(d){if(d<0)return-1;for(var b=this._model,a=this._projections,f=0,h=0,g=0;g<a.length;g++){var c=a[g];if(c._lineIndex>=d-f)break;var e=c._model.getLineCount()-1;if(c._lineIndex+e>=d-f)return c._model.getLineStart(d-(c._lineIndex+f))+c.start+h;h+=c._model.getCharCount()-(c.end-c.start);f+=e-c._lineCount}return b.getLineStart(d-
f)+h},getText:function(d,b){d===void 0&&(d=0);var a=this._model,f=this._projections,h=0,g=[],c,e,l;for(c=0;c<f.length;c++){e=f[c];if(e.start>d-h)break;l=e._model.getCharCount();if(e.start+l>d-h)if(b!==void 0&&e.start+l>b-h)return e._model.getText(d-(e.start+h),b-(e.start+h));else g.push(e._model.getText(d-(e.start+h))),d=e.end+h+l-(e.end-e.start);h+=l-(e.end-e.start)}var i=d-h;if(b!==void 0){for(;c<f.length;c++){e=f[c];if(e.start>b-h)break;g.push(a.getText(i,e.start));l=e._model.getCharCount();if(e.start+
l>b-h)return g.push(e._model.getText(0,b-(e.start+h))),g.join("");g.push(e._model.getText());i=e.end;h+=l-(e.end-e.start)}g.push(a.getText(i,b-h))}else{for(;c<f.length;c++)e=f[c],g.push(a.getText(i,e.start)),g.push(e._model.getText()),i=e.end;g.push(a.getText(i))}return g.join("")},_onChanging:function(d,b,a,f,h,g){for(var c=this._model,e=this._projections,l,i=0,j,o=b+a;l<e.length;l++){a=e[l];if(a.start>b)break;i+=a._model.getCharCount()-(a.end-a.start)}b+=i;for(var k=l;l<e.length;l++){a=e[l];if(a.start>
o)break;i+=a._model.getCharCount()-(a.end-a.start);j+=a._model.getLineCount()-1-a._lineCount}a=o+i;i=l;this.onChanging(b,a-b,f,h+j,g);e.splice(e,i-k);for(d=d.length-(a-b);l<e.length;l++)a=e[l],a.start+=d,a.end+=d,a._lineIndex=c.getLineAtOffset(a.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,b,a){d===void 0&&(d="");b===void 0&&(b=0);var f=b,h=a,g=this._model,
c=this._projections,e=0,l=0,i,j,o,k,r,q=0;for(i=0;i<c.length;i++){j=c[i];if(j.start>b-e)break;o=j._model.getCharCount();if(j.start+o>b-e)if(a!==void 0&&j.start+o>a-e){j._model.setText(d,b-(j.start+e),a-(j.start+e));return}else q=j._model.getLineCount()-1-j._model.getLineAtOffset(b-(j.start+e)),k={projection:j,start:b-(j.start+e)},b=j.end+e+o-(j.end-j.start);l+=j._model.getLineCount()-1-j._lineCount;e+=o-(j.end-j.start)}b-=e;var t=i,q=g.getLineAtOffset(b)+l-q;if(a!==void 0)for(;i<c.length;i++){j=c[i];
if(j.start>a-e)break;o=j._model.getCharCount();if(j.start+o>a-e){l+=j._model.getLineAtOffset(a-(j.start+e));o=a-(j.start+e);a=j.end+e;r={projection:j,end:o};break}l+=j._model.getLineCount()-1-j._lineCount;e+=o-(j.end-j.start)}else{for(;i<c.length;i++)j=c[i],l+=j._model.getLineCount()-1-j._lineCount,e+=j._model.getCharCount()-(j.end-j.start);a=h=g.getCharCount()+e}a-=e;j=g.getLineAtOffset(a)+l;h-=f;for(var l=j-q,q=d.length,m=o=j=e=0;;){j!==-1&&j<=m&&(j=d.indexOf("\r",m));o!==-1&&o<=m&&(o=d.indexOf("\n",
m));if(o===-1&&j===-1)break;m=j!==-1&&o!==-1?j+1===o?o+1:(j<o?j:o)+1:j!==-1?j+1:o+1;e++}this.onChanging({type:"Changing",text:d,start:f,removedCharCount:h,addedCharCount:q,removedLineCount:l,addedLineCount:e});g.setText(d,b,a);if(k)j=k.projection,j._model.setText("",k.start);if(r)j=r.projection,j._model.setText("",0,r.end),j.start=j.end,j._lineCount=0;c.splice(t,i-t);for(d=d.length-(a-b);i<c.length;i++)j=c[i],j.start+=d,j.end+=d,j._lineIndex=g.getLineAtOffset(j.start);this.onChanged({type:"Changed",
start:f,removedCharCount:h,addedCharCount:q,removedLineCount:l,addedLineCount:e})}};k.EventTarget.addMixin(i.prototype);return{ProjectionTextModel:i}});
define("orion/editor/tooltip",["i18n!orion/editor/nls/messages","orion/editor/textView","orion/editor/textModel","orion/editor/projectionTextModel","orion/util"],function(j,k,i,d,b){function a(a){this._view=a;this._create(a.getOptions("parent").ownerDocument);a.addEventListener("Destroy",this,this.destroy)}a.getTooltip=function(b){if(!b._tooltip)b._tooltip=new a(b);return b._tooltip};a.prototype={_create:function(a){if(!this._tooltipDiv){var d=this._tooltipDiv=b.createElement(a,"div");d.className=
"textviewTooltip";d.setAttribute("aria-live","assertive");d.setAttribute("aria-atomic","true");var g=this._tooltipContents=b.createElement(a,"div");d.appendChild(g);a.body.appendChild(d);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 d=this;if(b===0)d.show(!0);else{var c=this._getWindow();d._showTimeout=c.setTimeout(function(){d.show(!0)},b?b:500)}}},show:function(a){if(this._target){var b=this._target.getTooltipInfo();if(b){var g=this._tooltipDiv,c=this._tooltipContents;g.style.left=g.style.right=g.style.width=g.style.height=c.style.width=c.style.height="auto";var e=b.contents;e instanceof Array&&(e=this._getAnnotationContents(e));if(typeof e==="string")c.innerHTML=e;
else if(this._isNode(e))c.appendChild(e);else if(e instanceof d.ProjectionTextModel){var i=this._view,j=i.getOptions();j.wrapMode=!1;j.parent=c;var p=j.themeClass;p?((p=p.replace("tooltip",""))&&(p=" "+p),p="tooltip"+p):p="tooltip";j.themeClass=p;j=this._contentsView=new k.TextView(j);j._clientDiv.contentEditable=!1;j.addEventListener("LineStyle",function(a){i.onLineStyle(a)});j.setModel(e);e=j.computeSize();c.style.width=e.width+"px";c.style.height=e.height+"px";j.resize()}else return;c=g.ownerDocument.documentElement;
b.anchor==="right"?(e=c.clientWidth-b.x,g.style.right=e+"px"):(e=parseInt(this._getNodeStyle(g,"padding-left","0"),10),e+=parseInt(this._getNodeStyle(g,"border-left-width","0"),10),e=b.x-e,g.style.left=e+"px");g.style.maxWidth=c.clientWidth-e-10+"px";e=parseInt(this._getNodeStyle(g,"padding-top","0"),10);e+=parseInt(this._getNodeStyle(g,"border-top-width","0"),10);e=b.y-e;g.style.top=e+"px";g.style.maxHeight=c.clientHeight-e-10+"px";g.style.opacity="1";g.style.visibility="visible";if(a){var o=this,
s=this._getWindow();o._hideTimeout=s.setTimeout(function(){var a=parseFloat(o._getNodeStyle(g,"opacity","1"));o._fadeTimeout=s.setInterval(function(){g.style.visibility==="visible"&&a>0?(a-=0.1,g.style.opacity=a):o.hide()},50)},5E3)}}}},_getAnnotationContents:function(a){function b(a){var e=a.title;if(e==="")return null;var d="<div>";a.html&&(d+=a.html+"&nbsp;");if(!e)e=a.end,a=c.getLineStart(c.getLineAtOffset(a.start)),e=c.getLineEnd(c.getLineAtOffset(e),!0),e=c.getText(a,e);e=e.replace(/</g,"&lt;").replace(/>/g,
"&gt;");d+="<span style='vertical-align:middle;'>"+e+"</span><div>";return d}if(a.length===0)return null;var g=this._view.getModel(),c=g.getBaseModel?g.getBaseModel():g;if(a.length===1)if(g=a[0],g.title!==void 0)return b(g);else{var a=new d.ProjectionTextModel(c),e=c.getLineStart(c.getLineAtOffset(g.start)),i=c.getCharCount();g.end!==i&&a.addProjection({start:g.end,end:i});e>0&&a.addProjection({start:0,end:e});return a}else{e="<div><em>"+j.multipleAnnotations+"</em></div>";for(i=0;i<a.length;i++)g=
a[i],(g=b(g))&&(e+=g);return e}},_getNodeStyle:function(a,b,d){var c;if(a&&(c=a.style[b],!c))if(a.currentStyle){for(c=0;(c=b.indexOf("-",c))!==-1;)b=b.substring(0,c)+b.substring(c+1,c+2).toUpperCase()+b.substring(c+2);c=a.currentStyle[b]}else c=(a=a.ownerDocument.defaultView.getComputedStyle(a,null))?a.getPropertyValue(b):null;return c||d},_isNode:function(a){return typeof Node==="object"?a instanceof Node:a&&typeof a==="object"&&typeof a.nodeType==="number"&&typeof a.nodeName==="string"}};return{Tooltip:a}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(j,k){function i(a,b,d){this.start=a;this.end=b;this._projectionModel=d;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function d(){}function b(a,b){var f=a.lastIndexOf("."),f=a.substring(f+1),g={title:j[f],style:{styleClass:"annotation "+f},html:"<div class='annotationHTML "+f+"'></div>",overviewStyle:{styleClass:"annotationOverview "+f}};b?g.lineStyle={styleClass:"annotationLine "+
f}:g.rangeStyle={styleClass:"annotationRange "+f};d.registerType(a,g)}function a(){}function f(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 d=this;this._listener={onDestroy:function(a){d._onDestroy(a)},onLineStyle:function(a){d._onLineStyle(a)},onChanged:function(a){d._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",
this._listener.onLineStyle);b.addEventListener("Changed",this._listener.onChanged)}i.prototype={_expandedHTML:"<div class='annotationHTML expanded'></div>",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"<div class='annotationHTML collapsed'></div>",_collapsedStyle:{styleClass:"annotation collapsed"},collapse:function(){if(this.expanded){this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var a=this._projectionModel,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 g={};d.registerType=function(a,b){var d=b;if(typeof d!=="function")d=function(a,c,b){this.start=a;this.end=c;if(b!==void 0)this.title=b},d.prototype=b;d.prototype.type=a;g[a]=d;return a};d.createAnnotation=function(a,b,d,f){return new (this.getType(a))(b,d,f)};d.getType=function(a){return g[a]};
b(d.ANNOTATION_ERROR);b(d.ANNOTATION_WARNING);b(d.ANNOTATION_TASK);b(d.ANNOTATION_BREAKPOINT);b(d.ANNOTATION_BOOKMARK);b(d.ANNOTATION_CURRENT_BRACKET);b(d.ANNOTATION_MATCHING_BRACKET);b(d.ANNOTATION_CURRENT_SEARCH);b(d.ANNOTATION_MATCHING_SEARCH);b(d.ANNOTATION_READ_OCCURRENCE);b(d.ANNOTATION_WRITE_OCCURRENCE);b(d.ANNOTATION_SELECTED_LINKED_GROUP);b(d.ANNOTATION_CURRENT_LINKED_GROUP);b(d.ANNOTATION_LINKED_GROUP);b(d.ANNOTATION_CURRENT_LINE,!0);d.registerType(d.ANNOTATION_FOLDING,i);a.addMixin=function(c){var b=
a.prototype,d;for(d in b)b.hasOwnProperty(d)&&(c[d]=b[d])};a.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,d){a=a.getAnnotations(b,d);for(d=[];a.hasNext();)b=a.next(),this.getAnnotationTypePriority(b.type)!==0&&d.push(b);var f=
this;d.sort(function(a,c){return f.getAnnotationTypePriority(a.type)-f.getAnnotationTypePriority(c.type)});return d},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}}};f.prototype={addAnnotation:function(a){if(a){var b=this._annotations,d=this._binarySearch(b,a.start);b.splice(d,0,a);this.onChanged({type:"Changed",
added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,b){var d=this._annotations,f,g=0,h=function(){for(;g<d.length;){var f=d[g++];if(a===f.start||(a>f.start?a<f.end:f.start<b))return f;if(f.start>=b)break}return null};f=h();return{next:function(){var a=f;a&&(f=h());return a},hasNext:function(){return f!==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,d,f;if(a){d=[];for(f=b.length-1;f>=0;f--){var g=b[f];g.type===a&&b.splice(f,1);d.splice(0,0,g)}}else d=b;this.onChanged({type:"Changed",removed:d,added:[],changed:[]})},removeAnnotation:function(a){if(a&&(a=this._getAnnotationIndex(a),!(a<0)))this.onChanged({type:"Changed",removed:this._annotations.splice(a,1),added:[],changed:[]})},replaceAnnotations:function(a,b){var d=this._annotations,f,g,
h,i=[];if(a)for(f=a.length-1;f>=0;f--)h=a[f],g=this._getAnnotationIndex(h),g<0||(d.splice(g,1),i.splice(0,0,h));b||(b=[]);for(f=0;f<b.length;f++)h=b[f],g=this._binarySearch(d,h.start),d.splice(g,0,h);this.onChanged({type:"Changed",removed:i,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 d=a.length,f=
-1,g;d-f>1;)g=Math.floor((d+f)/2),b<=a[g].start?d=g:f=g;return d},_getAnnotationIndex:function(a){for(var b=this._annotations,d=this._binarySearch(b,a.start);d<b.length&&b[d].start===a.start;){if(b[d]===a)return d;d++}return-1},_onChanged:function(a){var b=a.start,d=a.removedCharCount,f=this._annotations,g=b+d;if(0<f.length){for(var h={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:a},a=a.addedCharCount-d,d=0;d<f.length;d++){var i=f[d];i.start>=g?(i.start+=a,i.end+=a,h.changed.push(i)):
i.end<=b||(i.start<b&&g<i.end?(i.end+=a,h.changed.push(i)):(f.splice(d,1),h.removed.push(i),d--))}if(h.added.length>0||h.removed.length>0||h.changed.length>0)this.onChanged(h)}}};k.EventTarget.addMixin(f.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 d;if(b.tagName&&!a.tagName)a.tagName=b.tagName;if(b.style){if(!a.style)a.style={};for(d in b.style)a.style[d]||(a.style[d]=b.style[d])}if(b.attributes){if(!a.attributes)a.attributes={};for(d in b.attributes)a.attributes[d]||(a.attributes[d]=b.attributes[d])}}return a},_mergeStyleRanges:function(a,b){a||(a=[]);var d,f;for(f=0;f<a.length&&b;f++){var g=a[f];if(b.end<=
g.start)break;if(!(b.start>=g.end)){d=this._mergeStyle({},g.style);d=this._mergeStyle(d,b.style);var h=[];h.push(f,1);b.start<g.start&&h.push({start:b.start,end:g.start,style:b.style});b.start>g.start&&h.push({start:g.start,end:b.start,style:g.style});h.push({start:Math.max(g.start,b.start),end:Math.min(g.end,b.end),style:d});b.end<g.end&&h.push({start:b.end,end:g.end,style:g.style});b=b.end>g.end?{start:g.end,end:b.end,style:b.style}:null;Array.prototype.splice.apply(a,h)}}b&&(d=this._mergeStyle({},
b.style),a.splice(f,0,{start:b.start,end:b.end,style:d}));return a},_onAnnotationModelChanged:function(a){function b(a){for(var c=0;c<a.length;c++)if(f.isAnnotationTypeVisible(a[c].type)){var e=a[c].start,h=a[c].end;g.getBaseModel&&(e=g.mapOffset(e,!0),h=g.mapOffset(h,!0));e!==-1&&h!==-1&&d.redrawRange(e,h)}}if(!a.textModelChangedEvent){var d=this._view;if(d){var f=this,g=d.getModel();b(a.added);b(a.removed);b(a.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){var b=this._annotationModel,
d=a.textView.getModel(),f=b.getTextModel(),g=a.lineStart,h=a.lineStart+a.lineText.length;f!==d&&(g=d.mapOffset(g),h=d.mapOffset(h));for(b=b.getAnnotations(g,h);b.hasNext();)if(g=b.next(),this.isAnnotationTypeVisible(g.type)){if(g.rangeStyle){var h=g.start,i=g.end;f!==d&&(h=d.mapOffset(h,!0),i=d.mapOffset(i,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:h,end:i,style:g.rangeStyle})}if(g.lineStyle)a.style=this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,g.lineStyle)}}};a.addMixin(h.prototype);
return{FoldingAnnotation:i,AnnotationType:d,AnnotationTypeList:a,AnnotationModel:f,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(j,k,i,d,b,a){function f(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 c=this,b=Array.prototype.slice.call(arguments,1);return b.length?function(){return arguments.length?c.apply(a,b.concat(Array.prototype.slice.call(arguments))):c.apply(a,
b)}:function(){return arguments.length?c.apply(a,arguments):c.call(a)}}f.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 c=this._textView;a?c.addRuler(this._annotationRuler,0):c.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(a){if(this._foldingRulerVisible!==a&&(this._foldingRulerVisible=a,this._foldingRuler)){var c=this._textView;c.getModel().getBaseModel&&(a?c.addRuler(this._foldingRuler,100):c.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 c=this._textView;a?c.addRuler(this._lineNumberRuler,1):c.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(a){if(this._overviewRulerVisible!==a&&(this._overviewRulerVisible=a,this._overviewRuler)){var c=this._textView;a?c.addRuler(this._overviewRuler):c.removeRuler(this._overviewRuler)}},mapOffset:function(a,c){var b=this._textView.getModel();b.getBaseModel&&(a=b.mapOffset(a,c));return a},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},
getSelection:function(){var a=this._textView,c=a.getSelection(),a=a.getModel();if(a.getBaseModel)c.start=a.mapOffset(c.start),c.end=a.mapOffset(c.end);return c},getText:function(a,c){var b=this._textView.getModel();b.getBaseModel&&(b=b.getBaseModel());return b.getText(a,c)},_expandOffset:function(a){var c=this._textView.getModel(),e=this._annotationModel;if(e&&c.getBaseModel)for(a=e.getAnnotations(a,a+1);a.hasNext();)c=a.next(),c.type===b.AnnotationType.ANNOTATION_FOLDING&&c.expand&&(c.expand(),e.modifyAnnotation(c))},
setCaretOffset:function(a,c,b){var d=this._textView,f=d.getModel();f.getBaseModel&&(this._expandOffset(a),a=f.mapOffset(a,!0));d.setCaretOffset(a,c,b)},setText:function(a,c,b){var d=this._textView,f=d.getModel();f.getBaseModel&&(c!==void 0&&(this._expandOffset(c),c=f.mapOffset(c,!0)),b!==void 0&&(this._expandOffset(b),b=f.mapOffset(b,!0)));d.setText(a,c,b)},setFoldingEnabled:function(a){this.setFoldingRulerVisible(a)},setSelection:function(a,c,b,d){var f=this._textView,h=f.getModel();h.getBaseModel&&
(this._expandOffset(a),this._expandOffset(c),a=h.mapOffset(a,!0),c=h.mapOffset(c,!0));f.setSelection(a,c,b,d)},moveSelection:function(a,c,b,d){var f=this._textView;this.setSelection(a,c||a,1/3,function(){(d===void 0||d)&&f.focus();b&&b()})},checkDirty:function(){this.setDirty(!this._undoStack.isClean())},reportStatus:function(a,c,b){this._statusReporter&&this._statusReporter(a,c,b)},_getTooltipInfo:function(a,c){var b=this._textView,d=this.getAnnotationModel();if(!d)return null;var f=this._annotationStyler;
if(!f)return null;var h=b.getOffsetAtLocation(a,c);if(h===-1)return null;h=this.mapOffset(h);f=f.getAnnotationsByType(d,h,h+1);d=[];for(h=0;h<f.length;h++)f[h].rangeStyle&&d.push(f[h]);if(d.length===0)return null;b=b.convert({x:a,y:c},"document","page");return{contents:d,anchor:"left",x:b.x+10,y:b.y+20}},_highlightCurrentLine:function(a,c){var d=this._annotationModel;if(d){var f=this._textView.getModel(),h=c?f.getLineAtOffset(c.start):-1,i=f.getLineAtOffset(a.start),j=a.start===a.end,k=!c||c.start===
c.end,r=f.getLineStart(i),q=f.getLineEnd(i);f.getBaseModel&&(r=f.mapOffset(r),q=f.mapOffset(q));f=this._currentLineAnnotation;if(!(h===i&&k&&j&&f&&f.start===r&&f.end===q)){var h=f?[f]:null,t;j&&(f=b.AnnotationType.createAnnotation(b.AnnotationType.ANNOTATION_CURRENT_LINE,r,q),t=[f]);this._currentLineAnnotation=f;d.replaceAnnotations(h,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,c=this._textView,e=this;this._listener={onModelChanged:function(){e.checkDirty()},onMouseOver:function(a){e._listener.onMouseMove(a)},onMouseMove:function(a){var b=d.Tooltip.getTooltip(c);if(b&&!(e._listener.lastMouseX===a.event.clientX&&e._listener.lastMouseY===a.event.clientY))e._listener.lastMouseX=a.event.clientX,
e._listener.lastMouseY=a.event.clientY,b.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return e._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(a){var b=d.Tooltip.getTooltip(c);if(b&&!(e._listener.lastMouseX===a.event.clientX&&e._listener.lastMouseY===a.event.clientY))e._listener.lastMouseX=a.event.clientX,e._listener.lastMouseY=a.event.clientY,b.setTarget(null)},onScroll:function(){var a=d.Tooltip.getTooltip(c);a&&a.setTarget(null)},onSelection:function(a){e._updateCursorStatus();e._highlightCurrentLine(a.newValue,
a.oldValue)}};c.addEventListener("ModelChanged",this._listener.onModelChanged);c.addEventListener("Selection",this._listener.onSelection);c.addEventListener("MouseOver",this._listener.onMouseOver);c.addEventListener("MouseOut",this._listener.onMouseOut);c.addEventListener("MouseMove",this._listener.onMouseMove);c.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 f=function(c){if(c!==void 0&&c!==-1){for(var d=this.getView().getModel(),e=this.getAnnotationModel(),f=a.mapOffset(d.getLineStart(c)),c=a.mapOffset(d.getLineEnd(c)),d=e.getAnnotations(f,c),h=null;d.hasNext();){var i=d.next();if(i.type===b.AnnotationType.ANNOTATION_BOOKMARK){h=i;break}}h?e.removeAnnotation(h):(h=b.AnnotationType.createAnnotation(b.AnnotationType.ANNOTATION_BOOKMARK,f,c),h.title=void 0,e.addAnnotation(h))}};
if(this._annotationFactory){var h=c.getModel();h.getBaseModel&&(h=h.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(h))if(h=this._annotationStyler=this._annotationFactory.createAnnotationStyler(c,this._annotationModel))h.addAnnotationType(b.AnnotationType.ANNOTATION_CURRENT_SEARCH),h.addAnnotationType(b.AnnotationType.ANNOTATION_MATCHING_SEARCH),h.addAnnotationType(b.AnnotationType.ANNOTATION_ERROR),h.addAnnotationType(b.AnnotationType.ANNOTATION_WARNING),h.addAnnotationType(b.AnnotationType.ANNOTATION_MATCHING_BRACKET),
h.addAnnotationType(b.AnnotationType.ANNOTATION_CURRENT_BRACKET),h.addAnnotationType(b.AnnotationType.ANNOTATION_CURRENT_LINE),h.addAnnotationType(b.AnnotationType.ANNOTATION_READ_OCCURRENCE),h.addAnnotationType(b.AnnotationType.ANNOTATION_WRITE_OCCURRENCE),h.addAnnotationType(b.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP),h.addAnnotationType(b.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP),h.addAnnotationType(b.AnnotationType.ANNOTATION_LINKED_GROUP),h.addAnnotationType("orion.annotation.highlightError");
c.annotationModel=this._annotationModel;var h=this._annotationFactory.createAnnotationRulers(this._annotationModel),i=this._annotationRuler=h.annotationRuler;if(i)i.onDblClick=f,i.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),i.addAnnotationType(b.AnnotationType.ANNOTATION_ERROR),i.addAnnotationType(b.AnnotationType.ANNOTATION_WARNING),i.addAnnotationType(b.AnnotationType.ANNOTATION_TASK),i.addAnnotationType(b.AnnotationType.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(!0);
if(i=this._overviewRuler=h.overviewRuler)i.addAnnotationType(b.AnnotationType.ANNOTATION_CURRENT_SEARCH),i.addAnnotationType(b.AnnotationType.ANNOTATION_MATCHING_SEARCH),i.addAnnotationType(b.AnnotationType.ANNOTATION_ERROR),i.addAnnotationType(b.AnnotationType.ANNOTATION_WARNING),i.addAnnotationType(b.AnnotationType.ANNOTATION_TASK),i.addAnnotationType(b.AnnotationType.ANNOTATION_BOOKMARK),i.addAnnotationType(b.AnnotationType.ANNOTATION_MATCHING_BRACKET),i.addAnnotationType(b.AnnotationType.ANNOTATION_CURRENT_BRACKET),
i.addAnnotationType(b.AnnotationType.ANNOTATION_CURRENT_LINE),i.addAnnotationType(b.AnnotationType.ANNOTATION_READ_OCCURRENCE),i.addAnnotationType(b.AnnotationType.ANNOTATION_WRITE_OCCURRENCE);this.setOverviewRulerVisible(!0)}if(this._lineNumberRulerFactory)this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.onDblClick=f,this.setLineNumberRulerVisible(!0);if(this._foldingRulerFactory)this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),
this._foldingRuler.addAnnotationType(b.AnnotationType.ANNOTATION_FOLDING),this.setFoldingRulerVisible(!1);this.dispatchEvent({type:"TextViewInstalled",textView:c})},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 b=this.getModel(),c=this.getCaretOffset(),d=b.getLineAtOffset(c),b=b.getLineStart(d);c-=b;for(var b=this.getKeyModes(),f=0;f<b.length;f++){var h=b[f];if(h.isActive()&&h.isStatusActive&&h.isStatusActive())return}this.reportStatus(a.formatMessage(j.lineColumn,d+1,c+1))},showProblems:function(a){var c=this._annotationModel;if(c){for(var d=[],f=[],h=c.getTextModel(),i=c.getAnnotations(0,h.getCharCount()),j;i.hasNext();)j=i.next(),(j.type===b.AnnotationType.ANNOTATION_ERROR||
j.type===b.AnnotationType.ANNOTATION_WARNING)&&d.push(j);if(a)for(i=0;i<a.length;i++)if(j=a[i]){var k=j.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),r=h.getLineStart(j.line-1);j=b.AnnotationType.createAnnotation(j.severity==="error"?b.AnnotationType.ANNOTATION_ERROR:b.AnnotationType.ANNOTATION_WARNING,r+j.start-1,r+j.end,k);f.push(j)}c.replaceAnnotations(d,f)}},showOccurrences:function(a){var c=this._annotationModel;if(c){for(var d=[],f=[],h=c.getTextModel(),i=c.getAnnotations(0,h.getCharCount()),
j;i.hasNext();)j=i.next(),(j.type===b.AnnotationType.ANNOTATION_READ_OCCURRENCE||j.type===b.AnnotationType.ANNOTATION_WRITE_OCCURRENCE)&&d.push(j);if(a)for(i=0;i<a.length;i++)if(j=a[i]){var k=h.getLineStart(j.line-1);j=b.AnnotationType.createAnnotation(j.readAccess===!0?b.AnnotationType.ANNOTATION_READ_OCCURRENCE:b.AnnotationType.ANNOTATION_WRITE_OCCURRENCE,k+j.start-1,k+j.end,j.description);f.push(j)}c.replaceAnnotations(d,f)}},showSelection:function(a,c,b,d,f){typeof a==="number"?(typeof c!=="number"&&
(c=a),this.moveSelection(a,c)):typeof b==="number"&&(a=this.getModel().getLineStart(b-1),typeof d==="number"&&(a+=d),typeof f!=="number"&&(f=0),this.moveSelection(a,a+f))},setInput:function(a,c,b,d){this._title=a;this._textView&&(d?(this._undoStack.markClean(),this.checkDirty()):(c?this._textView.setText(c):b!==null&&b!==void 0&&(this._textView.setText(b),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:c,contents:b,contentsSaved:d})},onInputChanged:function(a){return this.dispatchEvent(a)},onGotoLine:function(a,c,b,d){if(this._textView){var f=this.getModel(),a=Math.max(0,Math.min(a,f.getLineCount()-1)),h=f.getLineStart(a),i=0;b===void 0&&(b=0);typeof c==="string"?(a=f.getLine(a).indexOf(c),a!==-1&&(i=a,b=i+c.length)):(i=c,c=f.getLineEnd(a)-h,i=Math.min(i,c),b=Math.min(b,c));this.moveSelection(h+i,h+b,d)}},onDirtyChanged:function(a){return this.dispatchEvent(a)}};
i.EventTarget.addMixin(f.prototype);if(!Function.prototype.bind)Function.prototype.bind=h;return{Editor:f}});
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(j,k,i,d,b,a,f){function h(a){var c=a.getTextView();i.KeyMode.call(this,c);this.editor=a;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";c.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));c.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
var d=this;this._listener={onVerify:function(a){var c=d.editor,e=c.getModel(),f=c.mapOffset(a.start),c=c.mapOffset(a.end),e=e.getText(f,c);if((e=d._prefix.match(RegExp("^"+b.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 g(a,c,b){if(a){this._editor=a;this._undoStack=c;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(b)}}var c={};h.prototype=new i.KeyMode;a.mixin(h.prototype,{createKeyBindings:function(){var a=k.KeyBinding,c=[];c.push({actionID:"incrementalFindBackspace",keyBinding:new a(8)});c.push({actionID:"incrementalFindCancel",keyBinding:new a(13)});c.push({actionID:"incrementalFindCancel",
keyBinding:new a(27)});c.push({actionID:"incrementalFindReverse",keyBinding:new a(38)});c.push({actionID:"incrementalFind",keyBinding:new a(40)});c.push({actionID:"incrementalFindReverse",keyBinding:new a("k",!0,!0)});c.push({actionID:"incrementalFind",keyBinding:new a("k",!0)});return c},find:function(a,c){this._forward=a;if(!this.isActive())return this.setActive(!0),!1;var b=this._prefix;if(b.length===0)return!1;var d=this.editor,f=d.getModel(),f=a?this._success?c?this._start:d.getCaretOffset()+
1:0:this._success?c?this._start:d.getCaretOffset():f.getCharCount()-1;if(b=d.getModel().find({string:b,start:f,reverse:!a,caseInsensitive:b.toLowerCase()===b}).next()){if(!c)this._start=f;this._ignoreSelection=this._success=!0;d.moveSelection(a?b.start:b.end,a?b.end:b.start);this._ignoreSelection=!1}else this._success=!1;this._status();return!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(a){if(this._active!==a)this._active=a,this._prefix=
"",this._success=!0,a=this.editor.getTextView(),this._start=this.editor.getCaretOffset(),this.editor.setCaretOffset(this._start),this._active?(a.addEventListener("Verify",this._listener.onVerify),a.addEventListener("Selection",this._listener.onSelection),a.addKeyMode(this)):(a.removeEventListener("Verify",this._listener.onVerify),a.removeEventListener("Selection",this._listener.onSelection),a.removeKeyMode(this)),this._status()},_backspace:function(){var a=this._prefix,a=this._prefix=a.substring(0,
a.length-1);return a.length===0?(this._ignoreSelection=this._success=!0,this.editor.setCaretOffset(this.editor.getSelection().start),this._ignoreSelection=!1,this._status(),!0):this.find(this._forward,!0)},_status:function(){if(this.isActive()){var a;a=this._forward?this._success?j.incrementalFindStr:j.incrementalFindStrNotFound:this._success?j.incrementalFindReverseStr:j.incrementalFindReverseStrNotFound;a=f.formatMessage(a,this._prefix);this.editor.reportStatus(a,this._success?"":"error")}else this.editor.reportStatus("")}});
c.IncrementalFind=h;g.prototype={find:function(a,c,b){this.setOptions({reverse:!a});var d=this.getFindString(),f;if(c)d=c.findString||d,f=c.count;a=this.getOptions();this.setOptions(c);c=b?this._startOffset:this.getStartOffset();if((f=this._doFind(d,c,f))&&!b)this._startOffset=f.start;this.setOptions(a);this._hideAfterFind&&this.hide();return f},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 c=this._editor,b=this.getReplaceString(),d=c.getSelection().start;if(c=c.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(c.start,c.end,a,b),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var a=this.getFindString();if(a){this._replacingAll=!0;var c=this._editor,b=c.getTextView();c.reportStatus(j.replaceAll);var d=this.getReplaceString(),g=this;window.setTimeout(function(){for(var h=0,i=0;;){var k=g._doFind(a,h);if(!k)break;i++;i===1&&(b.setRedraw(!1),
g.startUndo());g._doReplace(k.start,k.end,a,d);h=g.getStartOffset()}i>0&&(g.endUndo(),b.setRedraw(!0));h>0?c.reportStatus(f.formatMessage(j.replacedMatches,i)):c.reportStatus(j.nothingReplaced,"error");g._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 c=this._editor.getAnnotationModel();c&&c.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 c=this;window.setTimeout(function(){c._incremental&&
c.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_doFind:function(a,c,b){var b=b||1,f=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;for(var a=f.getModel().find({string:a,start:c,end:this._end,reverse:this._reverse,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}),g,c=0;c<b&&a.hasNext();c++)g=
a.next();if(!this._replacingAll){g?this._editor.reportStatus(""):this._editor.reportStatus(j.notFound,"error");if(this.isVisible()){b=d.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(a=f.getAnnotationModel())a.removeAnnotations(b),g&&a.addAnnotation(d.AnnotationType.createAnnotation(b,g.start,g.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(g):
g&&f.moveSelection(g.start,g.end,null,!1)}return g},_doReplace:function(a,c,b,d){var f=this._editor;if(this._regex&&(d=f.getText(a,c).replace(RegExp(b,this._caseInsensitive?"i":""),d),!d))return;f.setText(d,a,c);f.setSelection(a,a+d.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var c=d.AnnotationType.ANNOTATION_MATCHING_SEARCH,b=a.getAnnotations(0,a.getTextModel().getCharCount()),f=[],g;b.hasNext();){var h=b.next();h.type===c&&f.push(h)}if(this.isVisible()){b=
this.getFindString();b=this._editor.getModel().find({string:b,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(g=[];b.hasNext();)h=b.next(),g.push(d.AnnotationType.createAnnotation(c,h.start,h.end))}a.replaceAnnotations(f,g)}},_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)}};c.Find=g;return c});
define("orion/editor/actions","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/annotations,orion/editor/tooltip,orion/editor/find,orion/util".split(","),function(j,k,i,d,b,a){function f(a,d,f){this.editor=a;this.undoStack=d;this._incrementalFind=new b.IncrementalFind(a);this._find=f?f:new b.Find(a,d);this._lastEditLocation=null;this.init()}function h(a,b,d,f){this.editor=a;this.undoStack=b;this.contentAssist=d;this.linkedMode=f;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var g={};f.prototype={init:function(){var c=this.editor.getTextView();this._lastEditListener={onModelChanged:function(a){if(this.editor.isDirty())this._lastEditLocation=a.start+a.addedCharCount}.bind(this)};c.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);c.setAction("undo",function(){return this.undoStack?(this.undoStack.undo(),!0):!1}.bind(this),{name:j.undo});c.setAction("redo",function(){return this.undoStack?(this.undoStack.redo(),
!0):!1}.bind(this),{name:j.redo});c.setKeyBinding(new k.KeyBinding("f",!0),"find");c.setAction("find",function(){if(this._find){var a=this.editor.getSelection();(a=prompt(j.find,this.editor.getText(a.start,a.end)))&&this._find.find(!0,{findString:a})}}.bind(this),{name:j.find});c.setKeyBinding(new k.KeyBinding("k",!0),"findNext");c.setAction("findNext",function(a){return this._find?(this._find.find(!0,a),!0):!1}.bind(this),{name:j.findNext});c.setKeyBinding(new k.KeyBinding("k",!0,!0),"findPrevious");
c.setAction("findPrevious",function(a){return this._find?(this._find.find(!1,a),!0):!1}.bind(this),{name:j.findPrevious});c.setKeyBinding(new k.KeyBinding("j",!0),"incrementalFind");c.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:j.incrementalFind});c.setKeyBinding(new k.KeyBinding("j",!0,!0),"incrementalFindReverse");c.setAction("incrementalFindReverse",function(){this._incrementalFind&&this._incrementalFind.find(!1);return!0}.bind(this),
{name:j.incrementalFindReverse});c.setAction("tab",function(){return this.indentLines()}.bind(this));c.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:j.unindentLines});c.setKeyBinding(new k.KeyBinding(38,!1,!1,!0),"moveLinesUp");c.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:j.moveLinesUp});c.setKeyBinding(new k.KeyBinding(40,!1,!1,!0),"moveLinesDown");c.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:j.moveLinesDown});
c.setKeyBinding(new k.KeyBinding(38,!0,!1,!0),"copyLinesUp");c.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:j.copyLinesUp});c.setKeyBinding(new k.KeyBinding(40,!0,!1,!0),"copyLinesDown");c.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:j.copyLinesDown});c.setKeyBinding(new k.KeyBinding("d",!0,!1,!1),"deleteLines");c.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:j.deleteLines});c.setKeyBinding(new k.KeyBinding("l",
!a.isMac,!1,!1,a.isMac),"gotoLine");c.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:j.gotoLine});c.setKeyBinding(new k.KeyBinding(190,!0),"nextAnnotation");c.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:j.nextAnnotation});c.setKeyBinding(new k.KeyBinding(188,!0),"previousAnnotation");c.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:j.prevAnnotation});c.setKeyBinding(new k.KeyBinding("e",
!0,!1,!0,!1),"expand");c.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:j.expand});c.setKeyBinding(new k.KeyBinding("c",!0,!1,!0,!1),"collapse");c.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:j.collapse});c.setKeyBinding(new k.KeyBinding("e",!0,!0,!0,!1),"expandAll");c.setAction("expandAll",function(){return this.expandAnnotations(!0)}.bind(this),{name:j.expandAll});c.setKeyBinding(new k.KeyBinding("c",!0,!0,!0,!1),"collapseAll");
c.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:j.collapseAll});c.setKeyBinding(new k.KeyBinding("q",!a.isMac,!1,!1,a.isMac),"lastEdit");c.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:j.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),f=b.getLineAtOffset(d.start),d=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),g=b.getLineStart(f),
f=b.getLineEnd(d,!0),h=b.getLineCount(),i="",g=b.getText(g,f);d===h-1&&(g=(i=b.getLineDelimiter())+g);a.setText(g,f,f);a.setSelection(f+i.length,f+g.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),f=b.getLineAtOffset(d.start),d=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),f=b.getLineStart(f),g=b.getLineEnd(d,!0),h=b.getLineCount(),i="",g=b.getText(f,g);d===h-1&&(g+=i=b.getLineDelimiter());a.setText(g,
f,f);a.setSelection(f,f+g.length-i.length);return!0},deleteLines:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var d=1;if(a&&a.count)d=a.count;var f=b.getSelection(),g=b.getModel(),h=g.getLineAtOffset(f.start),a=g.getLineStart(h),d=f.start!==f.end||d===1?g.getLineAtOffset(f.end>f.start?f.end-1:f.end):Math.min(h+d-1,g.getLineCount()-1),d=g.getLineEnd(d,!0);b.setText("",a,d);return!0},expandAnnotation:function(a){var b=this.editor,d=b.getAnnotationModel();if(!d)return!0;
var f=b.getModel(),g=b.getCaretOffset(),h=f.getLineAtOffset(g),g=f.getLineStart(h),h=f.getLineEnd(h,!0);f.getBaseModel&&(g=f.mapOffset(g),h=f.mapOffset(h),f.getBaseModel());for(var j,f=d.getAnnotations(g,h);!j&&f.hasNext();)g=f.next(),g.type===i.AnnotationType.ANNOTATION_FOLDING&&(j=g);j&&a!==j.expanded&&(a?j.expand():(b.setCaretOffset(j.start),j.collapse()),d.modifyAnnotation(j));return!0},expandAnnotations:function(a){var b=this.editor,d=b.getTextView(),f=b.getAnnotationModel();if(!f)return!0;var b=
b.getModel(),g=f.getAnnotations(0,b.getCharCount());for(d.setRedraw(!1);g.hasNext();)b=g.next(),b.type===i.AnnotationType.ANNOTATION_FOLDING&&a!==b.expanded&&(a?b.expand():b.collapse(),f.modifyAnnotation(b));d.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){var d=a.getModel(),f=a.getSelection(),g=d.getLineAtOffset(f.start),h=d.getLineAtOffset(f.end>f.start?f.end-1:f.end);if(g!==h){var i=[];i.push("");
for(var j=g;j<=h;j++)i.push(d.getLine(j,!0));j=d.getLineStart(g);d=d.getLineEnd(h,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(i.join(b),j,d);a.setSelection(j===f.start?f.start:f.start+b.length,f.end+(h-g+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(j.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(),d=a.getSelection(),f=b.getLineAtOffset(d.start),g=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),h=b.getLineCount();if(g===h-1)return!0;var f=b.getLineStart(f),d=b.getLineEnd(g,!0),i=b.getLineEnd(g+1,!0)-(d-f),j=0;g!==h-2?b=b.getText(f,d):(g=b.getLineEnd(g),b=b.getText(g,d)+b.getText(f,g),j+=d-g);this.startUndo();
a.setText("",f,d);a.setText(b,i,i);a.setSelection(i+j,i+j+b.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),f=b.getLineAtOffset(d.start);if(f===0)return!0;var g=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),h=b.getLineCount(),d=b.getLineStart(f-1),i=b.getLineStart(f),j=b.getLineEnd(g,!0),k=b.getText(i,j),t=0;g===h-1&&(g=b.getLineEnd(f-1),f=b.getLineEnd(f-1,!0),k+=b.getText(g,f),i=g,
t=f-g);this.startUndo();a.setText("",i,j);a.setText(k,d,d);a.setSelection(d,d+k.length-t);this.endUndo();return!0},nextAnnotation:function(a){var b=this.editor,f=b.getAnnotationModel();if(!f)return!0;for(var g=b.getModel(),h=b.getCaretOffset(),f=f.getAnnotations(a?h:0,a?g.getCharCount():h),j=null;f.hasNext();){var k=f.next();if(a){if(k.start<=h)continue}else if(k.start>=h)continue;switch(k.type){case i.AnnotationType.ANNOTATION_ERROR:case i.AnnotationType.ANNOTATION_WARNING:case i.AnnotationType.ANNOTATION_TASK:case i.AnnotationType.ANNOTATION_BOOKMARK:break;
default:continue}j=k;if(a)break}if(j){var r=b.getTextView(),q=g.getLineAtOffset(j.start),t=d.Tooltip.getTooltip(r);if(!t)return b.moveSelection(j.start),!0;b.moveSelection(j.start,j.start,function(){t.setTarget({getTooltipInfo:function(){var a=r.convert({x:r.getLocationAtOffset(j.start).x,y:r.getLocationAtOffset(g.getLineStart(q)).y},"document","page");return{contents:[j],x:a.x,y:a.y+Math.floor(r.getLineHeight(q)*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 d=a.getModel(),f=a.getSelection(),g=d.getLineAtOffset(f.start),h=d.getLineAtOffset(f.end>f.start?f.end-1:f.end),i=b.getOptions("tabSize"),j=Array(i+1).join(" "),k=[],t=b=0,m=g;m<=h;m++){var u=d.getLine(m,!0);if(d.getLineStart(m)!==d.getLineEnd(m))if(u.indexOf("\t")===0)u=u.substring(1),b++;else if(u.indexOf(j)===0)u=u.substring(i),b+=i;else return!0;m===g&&(t=b);k.push(u)}g=d.getLineStart(g);i=d.getLineEnd(h,!0);d=d.getLineStart(h);
a.setText(k.join(""),g,i);h=g===f.start?f.start:f.start-t;f=Math.max(h,f.end-b+(f.end===d+1&&f.start!==f.end?1:0));a.setSelection(h,f);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};g.TextActions=f;h.prototype={init:function(){var c=this.editor.getTextView();c.setAction("lineStart",function(){return this.lineStart()}.bind(this));c.setAction("enter",function(){return this.autoIndent()}.bind(this));
c.setKeyBinding(new k.KeyBinding(191,!0),"toggleLineComment");c.setAction("toggleLineComment",function(){return this.toggleLineComment()}.bind(this),{name:j.toggleLineComment});c.setKeyBinding(new k.KeyBinding(191,!0,!a.isMac,!1,a.isMac),"addBlockComment");c.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:j.addBlockComment});c.setKeyBinding(new k.KeyBinding(220,!0,!a.isMac,!1,a.isMac),"removeBlockComment");c.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),
{name:j.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 d=a.getModel(),f=d.getLineAtOffset(b.start),g=d.getLine(f,!0),h=d.getLineStart(f),f=0,h=b.start-h,i;f<h&&((i=g.charCodeAt(f))===32||i===9);)f++;if(f>0){for(var j=g.substring(0,f),f=h;f<g.length&&((i=g.charCodeAt(f++))===32||i===9);)b.end++;a.setText(d.getLineDelimiter()+j,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(),d=a.getSelection(),f=this._findEnclosingComment(b,d.start,d.end);if(f.commentStart!==void 0&&f.commentEnd!==void 0)return!0;b=b.getText(d.start,d.end);if(b.length===0)return!0;var f=b.length,b=b.replace(/\/\*|\*\//g,""),g=b.length;a.setText("/*"+b+"*/",d.start,d.end);a.setSelection(d.start+2,d.end+2+(g-f));return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&a.positions.length>0&&this.linkedMode){for(var b=
[],d=0;d<a.positions.length;++d)b[d]={positions:[{offset:a.positions[d].offset,length:a.positions[d].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,d){var f=a.getLineAtOffset(b),g=a.getLineAtOffset(d),h,i,j,
k,t,m;for(h=f;h>=0;h--)if(i=a.getLine(h),j=h===f?b-a.getLineStart(f):i.length,k=i.lastIndexOf("/*",j),i=i.lastIndexOf("*/",j),i>k)break;else if(k!==-1){t=a.getLineStart(h)+k;break}for(h=g;h<a.getLineCount();h++)if(i=a.getLine(h),j=h===g?d-a.getLineStart(g):0,k=i.indexOf("/*",j),i=i.indexOf("*/",j),k!==-1&&k<i)break;else if(i!==-1){m=a.getLineStart(h)+i;break}return{commentStart:t,commentEnd:m}},lineStart:function(){for(var a=this.editor,b=a.getModel(),d=a.getCaretOffset(),f=b.getLineAtOffset(d),g=
b.getLineStart(f),b=b.getLine(f),f=0;f<b.length;f++){var h=b.charCodeAt(f);if(!(h===32||h===9))break}f+=g;return d!==f?(a.setSelection(f,f),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),d=a.getSelection(),f=b.getText(d.start,d.end),g,h,i;for(i=0;i<f.length;i++)if(f.substring(i,i+2)==="/*"){g=d.start+i;break}for(;i<f.length;i++)if(f.substring(i,i+2)==="*/"){h=d.start+i;break}if(g!==void 0&&h!==void 0)a.setText(b.getText(g+
2,h),g,h+2),a.setSelection(g,h);else{f=this._findEnclosingComment(b,d.start,d.end);if(f.commentStart===void 0||f.commentEnd===void 0)return!0;b=b.getText(f.commentStart+2,f.commentEnd);a.setText(b,f.commentStart,f.commentEnd+2);a.setSelection(d.start-2,d.end-2)}return!0},toggleLineComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;for(var b=a.getModel(),d=a.getSelection(),f=b.getLineAtOffset(d.start),g=b.getLineAtOffset(d.end>d.start?d.end-1:d.end),h=!0,i=[],j,
k,t=f;t<=g;t++)if(j=b.getLine(t,!0),i.push(j),!h||(k=j.indexOf("//"))===-1)h=!1;else if(k!==0){var m;for(m=0;m<k;m++)if(h=j.charCodeAt(m),!(h===32||h===9))break;h=m===k}t=b.getLineStart(f);m=b.getLineEnd(g,!0);if(h){for(h=0;h<i.length;h++)j=i[h],k=j.indexOf("//"),i[h]=j.substring(0,k)+j.substring(k+2);i=i.join("");j=b.getLineStart(g);b=t===d.start?d.start:d.start-2;d=d.end-2*(g-f+1)+(d.end===j+1?2:0)}else i.splice(0,0,""),i=i.join("//"),b=t===d.start?d.start:d.start+2,d=d.end+2*(g-f+1);a.setText(i,
t,m);a.setSelection(b,d);return!0},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};g.SourceCodeActions=h;return g});
define("orion/editor/undoStack",[],function(){function j(d,b,a){this.offset=d;this.text=b;this.previousText=a}function k(d){this.owner=d;this.changes=[]}function i(d,b){this.view=d;this.size=b!==void 0?b:100;this.reset();var a=d.getModel();a.getBaseModel&&(a=a.getBaseModel());this.model=a;var f=this;this._listener={onChanging:function(a){f._onChanging(a)},onDestroy:function(a){f._onDestroy(a)}};a.addEventListener("Changing",this._listener.onChanging);d.addEventListener("Destroy",this._listener.onDestroy)}
j.prototype={undo:function(d,b){this._doUndoRedo(this.offset,this.previousText,this.text,d,b);return!0},redo:function(d,b){this._doUndoRedo(this.offset,this.text,this.previousText,d,b);return!0},_doUndoRedo:function(d,b,a,f,h){var g=f.getModel();if(g.mapOffset&&f.annotationModel){var c=g.mapOffset(d,!0);if(c<0)for(var e=f.annotationModel.getAnnotations(d,d+1);e.hasNext();){var i=e.next();if(i.type==="orion.annotation.folding"){i.expand();c=g.mapOffset(d,!0);break}}if(c<0)return;d=c}g.setText(b,d,
d+a.length);h&&f.setSelection(d,d+b.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,b){this.changes.length>1&&d.setRedraw(!1);for(var a=this.changes.length-1;a>=0;a--)this.changes[a].undo(d,!1);this.changes.length>1&&d.setRedraw(!0);if(b){var a=this.startSelection.start,f=this.startSelection.end;d.setSelection(this.startCaret?a:f,this.startCaret?f:a)}(a=
this.owner)&&a.undo&&a.undo();return this.changes.length>0},redo:function(d,b){this.changes.length>1&&d.setRedraw(!1);for(var a=0;a<this.changes.length;a++)this.changes[a].redo(d,!1);this.changes.length>1&&d.setRedraw(!0);if(b){var a=this.endSelection.start,f=this.endSelection.end;d.setSelection(this.endCaret?a:f,this.endCaret?f:a)}(a=this.owner)&&a.redo&&a.redo();return this.changes.length>0},start:function(d){this.startSelection=d.getSelection();this.startCaret=d.getCaretOffset();(d=this.owner)&&
d.start&&d.start()}};i.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,b=this.stack.length;this._undoStart!==void 0&&d++;return{undo:d,redo:b-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 j(this._undoStart,
"",this._undoText)):this.add(new j(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 b=d.text,a=d.start,f=d.removedCharCount,d=d.addedCharCount;if(!this._ignoreUndo){this._undoStart!==void 0&&!(d===1&&f===0&&this._undoType===1&&a===this._undoStart+
this._undoText.length||d===0&&f===1&&this._undoType===-1&&(a+1===this._undoStart||a===this._undoStart))&&this._commitUndo();if(!this.compoundChange)if(d===1&&f===0){if(this._undoStart===void 0)this._undoStart=a;this._undoText+=b;this._undoType=1;return}else if(d===0&&f===1){b=this._undoText.length>0&&this._undoStart===a;this._undoStart=a;this._undoType=-1;b?this._undoText+=this.model.getText(a,a+f):this._undoText=this.model.getText(a,a+f)+this._undoText;return}this.add(new j(a,b,this.model.getText(a,
a+f)))}}};return{UndoStack:i}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(j,k,i,d){function b(a,b,d,f){this._location=b||"left";this._overview=d||"page";this._rulerStyle=f;this._view=null;var g=this;this._listener={onTextModelChanged:function(a){g._onTextModelChanged(a)},onAnnotationModelChanged:function(a){g._onAnnotationModelChanged(a)}};this.setAnnotationModel(a)}function a(a,d,f,g,h){b.call(this,a,d,"page",f);this._oddStyle=g||{style:{backgroundColor:"white"}};
this._evenStyle=h||{style:{backgroundColor:"white"}};this._numOfDigits=0}function f(a,d,f){b.call(this,a,d,"page",f)}function h(a,d,f){b.call(this,a,d,"document",f)}function g(a,b,d){f.call(this,a,b,d)}b.prototype={getAnnotations:function(a,b){var d=this._annotationModel;if(!d)return[];var f=this._view.getModel(),g=f.getLineStart(a),h=f.getLineEnd(b-1),i=f;f.getBaseModel&&(i=f.getBaseModel(),g=f.mapOffset(g),h=f.mapOffset(h));for(var j=[],d=this.getAnnotationsByType(d,g,h),g=0;g<d.length;g++)for(var h=
d[g],k=i.getLineAtOffset(h.start),t=i.getLineAtOffset(Math.max(h.start,h.end-1)),m=k;m<=t;m++){var u=m;if(f!==i){u=i.getLineStart(m);u=f.mapOffset(u,!0);if(u===-1)continue;u=f.getLineAtOffset(u)}if(a<=u&&u<b){var z=this._mergeAnnotation(j[u],h,m-k,t-k+1);z&&(j[u]=z)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var w in j)j[w]._multiple&&(j[w].html+=this._multiAnnotationOverlay.html);return j},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,d=b.getModel(),f=d,g=d.getLineStart(a),h=g,j=this._annotationModel;if(j){h=b.getSelection();b=Math.max(h.start,h.end);h=d.getLineEnd(a,!0);g<=b&&b<d.getLineEnd(a)&&(g=b+1);d.getBaseModel&&
(g=d.mapOffset(g),h=d.mapOffset(h),f=d.getBaseModel());for(var k,a=j.getAnnotations(g,h);!k&&a.hasNext();)h=a.next(),this.isAnnotationTypeVisible(h.type)&&(k=h);k&&f.getLineAtOffset(k.start)===f.getLineAtOffset(g)?(g=k.start,h=k.end):h=g;d.getBaseModel&&(g=d.mapOffset(g,!0),h=d.mapOffset(h,!0))}(d=i.Tooltip.getTooltip(this._view))&&d.setTarget(null);this._view.setSelection(h,g,1/3,function(){})}},onDblClick:function(){},onMouseMove:function(a,b){var d=i.Tooltip.getTooltip(this._view);if(d&&!(d.isVisible()&&
this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var f=this;d.setTarget({y:b.clientY,getTooltipInfo:function(){return f._getTooltipInfo(f._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,b){this.onMouseMove(a,b)},onMouseOut:function(){var a=i.Tooltip.getTooltip(this._view);a&&a.setTarget(null)},_getTooltipInfo:function(a,b){if(a!==void 0){var d=this._view,f=d.getModel(),g=this._annotationModel,h=[];if(g){var h=f.getLineStart(a),i=f.getLineEnd(a);f.getBaseModel&&(h=f.mapOffset(h),i=f.mapOffset(i));
h=this.getAnnotationsByType(g,h,i)}g=this._getTooltipContents(a,h);if(!g)return null;g={contents:g,anchor:this.getLocation()};h=d.getClientArea();h.y=this.getOverview()==="document"?d.convert({y:b},"view","document").y:d.getLocationAtOffset(f.getLineStart(a)).y;d.convert(h,"document","page");g.x=h.x;g.y=h.y;g.anchor==="right"&&(g.x+=h.width);return g}},_getTooltipContents:function(a,b){return b},_onAnnotationModelChanged:function(a){function b(a){for(var c=0;c<a.length;c++)if(g.isAnnotationTypeVisible(a[c].type)){var e=
a[c].start,h=a[c].end;f.getBaseModel&&(e=f.mapOffset(e,!0),h=f.mapOffset(h,!0));e!==-1&&h!==-1&&d.redrawLines(f.getLineAtOffset(e),f.getLineAtOffset(Math.max(e,h-1))+1,g)}}var d=this._view;if(d){var f=d.getModel(),g=this,h=f.getLineCount();a.textModelChangedEvent?(a=a.textModelChangedEvent.start,f.getBaseModel&&(a=f.mapOffset(a,!0)),a=f.getLineAtOffset(a),d.redrawLines(a,h,g)):(b(a.added),b(a.removed),b(a.changed))}},_mergeAnnotation:function(a,b,d){a||(a={});if(d===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 d;if(b.style){if(!a.style)a.style={};for(d in b.style)a.style[d]||(a.style[d]=b.style[d])}if(b.attributes){if(!a.attributes)a.attributes={};for(d in b.attributes)a.attributes[d]||
(a.attributes[d]=b.attributes[d])}}return a}};k.AnnotationTypeList.addMixin(b.prototype);a.prototype=new b;a.prototype.getAnnotations=function(a,d){for(var f=b.prototype.getAnnotations.call(this,a,d),g=this._view.getModel(),h=a;h<d;h++){var i=h&1?this._oddStyle:this._evenStyle,j=h;g.getBaseModel&&(j=g.getLineStart(j),j=g.getBaseModel().getLineAtOffset(g.mapOffset(j)));f[h]||(f[h]={});f[h].html=j+1+"";if(!f[h].style)f[h].style=i}return f};a.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();
return this.getAnnotations(a-1,a)[a-1]};a.prototype._onTextModelChanged=function(a){var a=a.start,b=this._view.getModel(),d=((b.getBaseModel?b.getBaseModel().getLineCount():b.getLineCount())+"").length;if(this._numOfDigits!==d)this._numOfDigits=d,this._view.redrawLines(b.getLineAtOffset(a),b.getLineCount(),this)};f.prototype=new b;h.prototype=new b;h.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};h.prototype._getTooltipContents=
function(a,e){if(e.length===0){var f=this._view.getModel(),g=a;f.getBaseModel&&(g=f.getLineStart(g),g=f.getBaseModel().getLineAtOffset(f.mapOffset(g)));return d.formatMessage(j.line,g+1)}return b.prototype._getTooltipContents.call(this,a,e)};h.prototype._mergeAnnotation=function(a,b,d,f){if(d===0){if(!a)a={html:"&nbsp;",style:{style:{height:3*f+"px"}}},a.style=this._mergeStyle(a.style,b.overviewStyle);return a}};g.prototype=new f;g.prototype.onClick=function(a){if(a!==void 0){var b=this._annotationModel;
if(b){var d=this._view.getModel(),f=d.getLineStart(a),a=d.getLineEnd(a,!0);d.getBaseModel&&(f=d.mapOffset(f),a=d.mapOffset(a),d=d.getBaseModel());for(var g,b=b.getAnnotations(f,a);!g&&b.hasNext();)a=b.next(),this.isAnnotationTypeVisible(a.type)&&(g=a);g&&d.getLineAtOffset(g.start)===d.getLineAtOffset(f)&&((d=i.Tooltip.getTooltip(this._view))&&d.setTarget(null),g.expanded?g.collapse():g.expand(),this._annotationModel.modifyAnnotation(g))}}};g.prototype._getTooltipContents=function(a,b){return b.length===
1&&b[0].expanded?null:f.prototype._getTooltipContents.call(this,a,b)};g.prototype._onAnnotationModelChanged=function(a){function b(a){for(i=0;i<a.length;i++)if(h.isAnnotationTypeVisible(a[i].type)){var c=a[i].start;g.getBaseModel&&(c=g.mapOffset(c,!0));c!==-1&&(k=Math.min(k,g.getLineAtOffset(c)))}}if(a.textModelChangedEvent)f.prototype._onAnnotationModelChanged.call(this,a);else{var d=this._view;if(d){var g=d.getModel(),h=this,i,j=g.getLineCount(),k=j;b(a.added);b(a.removed);b(a.changed);a=d.getRulers();
for(i=0;i<a.length;i++)d.redrawLines(k,j,a[i])}}};return{Ruler:b,AnnotationRuler:f,LineNumberRuler:a,OverviewRuler:h,FoldingRuler:g}});
define("orion/editor/textDND",[],function(){function j(j,i){this._view=j;this._undoStack=i;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var d=this;this._listener={onDragStart:function(b){d._onDragStart(b)},onDragEnd:function(b){d._onDragEnd(b)},onDragEnter:function(b){d._onDragEnter(b)},onDragOver:function(b){d._onDragOver(b)},onDrop:function(b){d._onDrop(b)},onDestroy:function(b){d._onDestroy(b)}};j.addEventListener("DragStart",this._listener.onDragStart);j.addEventListener("DragEnd",
this._listener.onDragEnd);j.addEventListener("DragEnter",this._listener.onDragEnter);j.addEventListener("DragOver",this._listener.onDragOver);j.addEventListener("Drop",this._listener.onDrop);j.addEventListener("Destroy",this._listener.onDestroy)}j.prototype={destroy:function(){var j=this._view;if(j)j.removeEventListener("DragStart",this._listener.onDragStart),j.removeEventListener("DragEnd",this._listener.onDragEnd),j.removeEventListener("DragEnter",this._listener.onDragEnter),j.removeEventListener("DragOver",
this._listener.onDragOver),j.removeEventListener("Drop",this._listener.onDrop),j.removeEventListener("Destroy",this._listener.onDestroy),this._view=null},_onDestroy:function(){this.destroy()},_onDragStart:function(j){var i=this._view,d=i.getSelection(),i=i.getModel();if(i.getBaseModel)d.start=i.mapOffset(d.start),d.end=i.mapOffset(d.end),i=i.getBaseModel();if(i=i.getText(d.start,d.end))this._dragSelection=d,j.event.dataTransfer.effectAllowed="copyMove",j.event.dataTransfer.setData("Text",i)},_onDragEnd:function(j){var i=
this._view;if(this._dragSelection){this._undoStack&&this._undoStack.startCompoundChange();(j=j.event.dataTransfer.dropEffect==="move")&&i.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var d=this._dropText,b=this._dropOffset;if(j)if(b>=this._dragSelection.end)b-=this._dragSelection.end-this._dragSelection.start;else if(b>=this._dragSelection.start)b=this._dragSelection.start;i.setText(d,b,b);i.setSelection(b,b+d.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&
this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(j){this._onDragOver(j)},_onDragOver:function(j){var i=j.event.dataTransfer.types;if(i){var d=!this._view.getOptions("readonly");d&&(d=i.contains?i.contains("text/plain"):i.indexOf("text/plain")!==-1);if(!d)j.event.dataTransfer.dropEffect="none"}},_onDrop:function(j){var i=this._view,d=j.event.dataTransfer.getData("Text");if(d)j=i.getOffsetAtLocation(j.x,j.y),this._dragSelection?(this._dropOffset=j,this._dropText=d):
(i.setText(d,j,j),i.setSelection(j,j+d.length))}};return{TextDND:j}});
define("orion/editor/templates",[],function(){function j(i,d,b){this.prefix=i;this.description=d;this.template=b;this._parse()}function k(i,d){this._keywords=i||[];this._templates=[];this.addTemplates(d||[])}j.prototype={getProposal:function(i,d,b){var i=d-i.length,d={},a,f=b.delimiter!==void 0?b.delimiter:"\n";b.indentation&&(f+=b.indentation);for(var h=b.tab!==void 0?b.tab:"\t",g=0,c=this.variables,e=this.segments,b=[],j=0;j<e.length;j++){var k=e[j],p=c[k];if(p!==void 0)switch(k){case "${tab}":k=
h;break;case "${delimiter}":k=f;break;case "${cursor}":k="";a=g;break;default:var o=d[k];o||(o=d[k]={data:p.data,positions:[]});k=p.substitution;o.data&&o.data.values&&(k=o.data.values[0]);o.positions.push({offset:i+g,length:k.length})}b.push(k);g+=k.length}var f=[],s;for(s in d)d.hasOwnProperty(s)&&f.push(d[s]);b=b.join("");if(a===void 0)a=b.length;return{proposal:b,description:this.description,groups:f,escapePosition:i+a}},match:function(i){return this.prefix.indexOf(i)===0},_parse:function(){var i=
this.template,d=[],b={},a,f=0,i=i.replace(/\n/g,"${delimiter}"),i=i.replace(/\t/g,"${tab}");i.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(h,g,c){var e=h.substring(2,h.length-1),g=h,j=e,k=null,p=j.indexOf(":");p!==-1&&(j=j.substring(0,p),g="${"+j+"}",k=JSON.parse(e.substring(p+1).replace("\\}","}").trim()));(e=b[g])||(e=b[g]={});e.substitution=j;if(k)e.data=k;(a=i.substring(f,c))&&d.push(a);d.push(g);f=c+h.length;return j});(a=i.substring(f,i.length))&&d.push(a);this.segments=d;this.variables=b}};
k.prototype={addTemplates:function(i){for(var d=this.getTemplates(),b=0;b<i.length;b++)d.push(new j(i[b].prefix,i[b].description,i[b].template))},computeProposals:function(i,d,b){var a=this.getPrefix(i,d,b),f=[];if(!this.isValid(a,i,d,b))return f;f=f.concat(this.getTemplateProposals(a,d,b));return f=f.concat(this.getKeywordProposals(a))},getKeywords:function(){return this._keywords},getKeywordProposals:function(i){var d=[],b=this.getKeywords();if(b)for(var a=0;a<b.length;a++)b[a].indexOf(i)===0&&
d.push({proposal:b[a].substring(i.length),description:b[a]});return d},getPrefix:function(i,d,b){return b.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(i,d,b){for(var a=[],f=this.getTemplates(),h=0;h<f.length;h++){var g=f[h];g.match(i)&&(g=g.getProposal(i,d,b),this.removePrefix(i,g),a.push(g))}return a},removePrefix:function(i,d){if(!(d.overwrite=d.proposal.substring(0,i.length)!==i))d.proposal=d.proposal.substring(i.length)},isValid:function(){return!0}};return{Template:j,
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(j,k,i,d,b,a){function f(a,b,d){var f=a.getTextView();i.KeyMode.call(this,f);this.editor=a;this.undoStack=b;this.contentAssist=d;this.linkedModeModel=null;f.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));f.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);return!0}.bind(this));
f.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));f.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(a.selectedGroupIndex>0?a.selectedGroupIndex-1:a.groups.length-1);return!0}.bind(this));this.linkedModeListener={onActivating:function(){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),this.contentAssist.setProgress(null))}.bind(this),
onModelChanged:function(a){if(!this.ignoreVerify){for(var b=this.linkedModeModel,c,d;b;)if(c=this._getPositionChanged(b,a.start,a.start+a.removedCharCount),d=c.position,d===void 0||d.model!==b)this.exitLinkedMode(!1),b=this.linkedModeModel;else break;if(b){b=0;d=a.addedCharCount-a.removedCharCount;c=c.positions;for(var e,f,g=0;g<c.length;++g){f=c[g];e=f.position;var h=e.offset<=a.start&&a.start<=e.offset+e.length;h&&!f.ansestor?(e.offset+=b,e.length+=d,b+=d):(e.offset+=b,f.ansestor&&h&&(e.length+=
d));if(f.escape)f.model.escapePosition=e.offset}this._updateAnnotations(c)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var b=this.linkedModeModel,c,d;b;)if(c=this._getPositionChanged(b,a.start,a.end),d=c.position,d===void 0||d.model!==b)this.exitLinkedMode(!1),b=this.linkedModeModel;else break;if(b){var e=this._compoundChange;e?e.owner.model===b&&e.owner.group===d.group||(this.endUndo(),this.startUndo()):this.startUndo();b.selectedGroupIndex=d.group;var e=0,f=a.text.length-(a.end-
a.start);c=c.positions;for(var g,h,i=a.start-d.position.offset,j=a.end-d.position.offset,l=0;l<c.length;++l)if(h=c[l],g=h.position,h.oldOffset=g.offset,h.model===b&&h.group===d.group?(g.offset+=e,g.length+=f,e+=f):(g.offset+=e,h.ansestor&&(g.length+=d.count*f)),h.escape)h.model.escapePosition=g.offset;this.ignoreVerify=!0;e=this.editor.getTextView();for(l=c.length-1;l>=0;l--)h=c[l],h.model===b&&h.group===d.group&&e.setText(a.text,h.oldOffset+i,h.oldOffset+j);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(c)}}}.bind(this)}}
var h={};f.prototype=new i.KeyMode;a.mixin(f.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(j.linkedModeEntered,null,!0)}this._sortedPositions=null;if(this.linkedModeModel)a.previousModel=this.linkedModeModel,a.parentGroup=this.linkedModeModel.selectedGroupIndex,this.linkedModeModel.nextModel=a;this.linkedModeModel=a;this.selectLinkedGroup(0)},exitLinkedMode:function(a){if(this.isActive()){if(this._compoundChange)this.endUndo(),
this._compoundChange=null;this._sortedPositions=null;var b=this.linkedModeModel;this.linkedModeModel=b.previousModel;b.parentGroup=b.previousModel=void 0;if(this.linkedModeModel)this.linkedModeModel.nextModel=void 0;if(!this.linkedModeModel){var d=this.editor.getTextView();d.removeKeyMode(this);d.removeEventListener("Verify",this.linkedModeListener.onVerify);d.removeEventListener("ModelChanged",this.linkedModeListener.onModelChanged);var f=this.contentAssist;f.removeEventListener("Activating",this.linkedModeListener.onActivating);
f.offset=void 0;this.editor.reportStatus(j.linkedModeExited,null,!0);a&&d.setCaretOffset(b.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var a=this,b=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:b,group:b.selectedGroupIndex,end:function(){a._compoundChange=null}})}},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},
selectLinkedGroup:function(a){var c=this.linkedModeModel;if(c){c.selectedGroupIndex=a;var a=c.groups[a],d=a.positions[0],f=this.editor.getTextView();f.setSelection(d.offset,d.offset+d.length);if(c=this.contentAssist)if(c.offset=void 0,a.data&&a.data.type==="link"&&a.data.values)(this._groupContentAssistProvider=new b.TemplateContentAssist(a.data.values)).getPrefix=function(){var a=f.getSelection();return a.start===a.end&&(a=f.getCaretOffset(),d.offset<=a&&a<=d.offset+d.length)?f.getText(d.offset,
a):""},c.offset=d.offset,c.deactivate(),c.activate();else if(this._groupContentAssistProvider)this._groupContentAssistProvider=null,c.deactivate()}this._updateAnnotations()},_getModelPositions:function(a,b,d){for(var f=b.groups,h=0;h<f.length;h++)for(var i=f[h].positions,j=0;j<i.length;j++){var k=i[j];d&&(k={offset:k.offset+d,length:k.length});k={index:j,group:h,count:i.length,model:b,position:k};a.push(k);if(b.nextModel&&b.nextModel.parentGroup===h)k.ansestor=!0,this._getModelPositions(a,b.nextModel,
(d||0)+i[j].offset-i[0].offset)}},_getSortedPositions:function(a){var b=this._sortedPositions;if(!b){for(b=[];a.previousModel;)a=a.previousModel;for(this._getModelPositions(b,a);a;)a.escapePosition!==void 0&&b.push({escape:!0,model:a,position:{offset:a.escapePosition,length:0}}),a=a.nextModel;b.sort(function(a,b){return a.position.offset-b.position.offset});this._sortedPositions=b}return b},_getPositionChanged:function(a,b,d){for(var f,a=this._getSortedPositions(a),h=a.length-1;h>=0;h--){var i=a[h].position;
if(i.offset<=b&&d<=i.offset+i.length){f=a[h];break}}return{position:f,positions:a}},_updateAnnotations:function(a){var b=this.editor.getAnnotationModel();if(b){for(var e=[],f=[],h=b.getTextModel(),h=b.getAnnotations(0,h.getCharCount()),i;h.hasNext();)switch(i=h.next(),i.type){case d.AnnotationType.ANNOTATION_LINKED_GROUP:case d.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case d.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:e.push(i)}if(h=this.linkedModeModel)for(var a=a||this._getSortedPositions(h),
j=0;j<a.length;j++)if(i=a[j],i.model===h){var k=d.AnnotationType.ANNOTATION_LINKED_GROUP;i.group===h.selectedGroupIndex&&(k=i.index===0?d.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:d.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);i=i.position;i=d.AnnotationType.createAnnotation(k,i.offset,i.offset+i.length,"");f.push(i)}b.replaceAnnotations(e,f)}}});h.LinkedMode=f;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(j,k,i,d,b,a){function f(){}function h(){}function g(){}function c(){}function e(){}function l(){}var n={};f.prototype={createKeyBindings:function(b,c,d,e){var e=new j.TextActions(b,c,e),f=new a.LinkedMode(b,c,d),b=new j.SourceCodeActions(b,c,d,f);return{textActions:e,linkedMode:f,sourceCodeActions:b}}};n.KeyBindingsFactory=
f;h.prototype={createUndoStack:function(a){a=a.getTextView();return new k.UndoStack(a,200)}};n.UndoFactory=h;g.prototype={createLineNumberRuler:function(a){return new i.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};n.LineNumberRulerFactory=g;c.prototype={createFoldingRuler:function(a){return new i.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};n.FoldingRulerFactory=c;e.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 i.AnnotationRuler(a,"left",{styleClass:"ruler annotations"}),a=new i.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};n.AnnotationFactory=e;l.prototype={createTextDND:function(a,c){return new b.TextDND(a.getTextView(),c)}};n.TextDNDFactory=l;return n});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode"],function(j,k,i){var d={};d.KeyBindingsFactory=j.KeyBindingsFactory;d.UndoFactory=j.UndoFactory;d.LineNumberRulerFactory=j.LineNumberRulerFactory;d.FoldingRulerFactory=j.FoldingRulerFactory;d.AnnotationFactory=j.AnnotationFactory;d.TextDNDFactory=j.TextDNDFactory;d.TextActions=k.TextActions;d.SourceCodeActions=k.SourceCodeActions;d.LinkedMode=i.LinkedMode;return d});
var JsDiff=function(){function j(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 i=function(a){this.ignoreWhitespace=a};i.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,f=c+d,i=[{newPos:-1,components:[]}],j=this.extractCommon(i[0],
b,a,0);if(i[0].newPos+1>=c&&j+1>=d)return i[0].components;for(var k=1;k<=f;k++)for(var s=-1*k;s<=k;s+=2){var r;r=i[s-1];var q=i[s+1],j=(q?q.newPos:0)-s;r&&(i[s-1]=void 0);var t=r&&r.newPos+1<c,m=q&&0<=j&&j<d;if(!t&&!m)i[s]=void 0;else if(!t||m&&r.newPos<q.newPos?(r={newPos:q.newPos,components:q.components.slice(0)},this.pushComponent(r.components,a[j],void 0,!0)):(r={newPos:r.newPos,components:r.components.slice(0)},r.newPos++,this.pushComponent(r.components,b[r.newPos],!0,void 0)),j=this.extractCommon(r,
b,a,s),r.newPos+1>=c&&j+1>=d)return r.components;else i[s]=r}},pushComponent:function(a,b,c,d){var f=a[a.length-1];f&&f.added===c&&f.removed===d?a[a.length-1]={value:this.join(f.value,b),added:c,removed:d}:a.push({value:b,added:c,removed:d})},extractCommon:function(a,b,c,d){for(var f=b.length,i=c.length,j=a.newPos,d=j-d;j+1<f&&d+1<i&&this.equals(b[j+1],c[d+1]);)j++,d++,this.pushComponent(a.components,b[j],void 0,void 0);a.newPos=j;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 i,b=new i(!1);b.tokenize=function(a){return j(a.split(/(\s+|\b)/))};var a=new i(!0);a.tokenize=function(a){return j(a.split(/([{}:;,]|\s+)/))};var f=new i;f.tokenize=function(a){return a.split(/^/m)};return{diffChars:function(a,b){return d.diff(a,b)},diffWords:function(a,d){return b.diff(a,d)},diffLines:function(a,b){return f.diff(a,b)},diffCss:function(b,d){return a.diff(b,d)},createPatch:function(a,
b,c,d,i){var j=[];j.push("Index: "+a);j.push("===================================================================");j.push("--- "+a+"\t"+d);j.push("+++ "+a+"\t"+i);a=f.diff(b,c);a.push({value:"",lines:[]});for(var c=b=0,d=[],k=i=1,o=0;o<a.length;o++){var s=a[o],r=s.lines||s.value.replace(/\n$/,"").split("\n");s.lines=r;if(s.added||s.removed){if(!b){var q=a[o-1],b=i,c=k;q&&(d.push.apply(d,q.lines.slice(-4).map(function(a){return" "+a})),b-=4,c-=4)}d.push.apply(d,r.map(function(a){return(s.added?"+":
"-")+a}));s.added?k+=r.length:i+=r.length}else b&&(r.length<=8&&o<a.length-1?d.push.apply(d,r.map(function(a){return" "+a})):(q=Math.min(r.length,4),j.push("@@ -"+b+","+(i-b+q)+" +"+c+","+(k-c+q)+" @@"),j.push.apply(j,d),j.push.apply(j,r.slice(0,q).map(function(a){return" "+a})),c=b=0,d=[])),i+=r.length,k+=r.length}a.length>1&&!/\n$/.test(a[a.length-2].value)&&j.push("\\ No newline at end of file\n");return j.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(j){var k=k||{};k.JSDiffAdapter=function(){function i(){}i.prototype={_specialLine:function(d,b,a){return b.value===d&&a!==d},adapt:function(d,b,a){a||(a="\n");for(var f=d.split(a),h=b.split(a),g=f[f.length-1]==="",h=h[h.length-1]==="",c=j.diffLines(d,b),d=[],b=[],e=0,i=0,k=-1,p=0,o=!0,s=a,r=0;r<c.length;r++){var q=c[r],t=q.lines||q.value.split(a),m=t.length,u=0;t.length>1&&t[t.length-1]===""&&m--;m>1&&!o&&t[0]===""&&(m--,u++);q.lines=t;
if(!q.added&&!q.removed){if(!this._specialLine(a,q,s)){if(e||i)d.push([e,i,k]),i=e=0,k=-1,p+=i;d.push([m,m,0]);p+=m}}else if(q.added){k===-1&&(k=b.length+1);e+=m;for(o=u;o<m+u;o++)b.push(q.lines[o])}else i+=m;o=!1;t.length>1&&t[t.length-1]===""&&(o=!0);s=q.value?q.value[q.value.length-1]:a}if(e||i)d.push([e,i,k]),p+=i;p<f.length&&f.length>1&&(a=d[d.length-1],a[2]===0?(a[0]+=1,a[1]+=1):a[2]===-1?d.push([1,1,0]):g===h?d.push([1,1,0]):(h&&(a[0]+=1),g&&(a[1]+=1)));return{mapper:d,changContents:{array:b,
index:0}}},adaptCharDiff:function(d,b,a){for(var d=a?j.diffWords(d,b):j.diffChars(d,b),b=[],f=a=0,h=0,g=0,c=0;c<d.length;c++){var e=d[c];if(!e.added&&!e.removed){if(h>0||g>0)b.push([f,f+h,a,a+g]),f+=h,a+=g,g=h=0;f+=e.value.length;a+=e.value.length}else e.added?h+=e.value.length:g+=e.value.length}(h>0||g>0)&&b.push([f,f+h,a,a+g]);return b}};return i}();return k});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(j,k,i,d){var b={},a,f,h,g,c,e,l,n,p,o,s,r,q,t,m,u;b.DiffTreeNavigator=function(){function b(a,c,d,e,f,g){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,c,d,e,f,g)}a="orion.annotation.diff.addedBlock";f="orion.annotation.diff.currentAddedBlock";h="orion.annotation.diff.deletedBlock";g="orion.annotation.diff.currentDeletedBlock";
c="orion.annotation.diff.blockTop";e="orion.annotation.diff.currentBlockTop";l="orion.annotation.diff.blockConflict";n="orion.annotation.diff.currentBlockConflict";p="orion.annotation.diff.addedWord";o="orion.annotation.diff.currentAddedWord";s="orion.annotation.diff.deletedWord";r="orion.annotation.diff.currentDeletedWord";q="orion.annotation.diff.emptyDeletedWordLeft";t="orion.annotation.diff.emptyDeletedWordRight";m="orion.annotation.diff.emptyAddedWordLeft";u="orion.annotation.diff.emptyAddedWordRight";
i.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});i.AnnotationType.registerType(f,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});i.AnnotationType.registerType(h,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});i.AnnotationType.registerType(g,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});i.AnnotationType.registerType(c,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
i.AnnotationType.registerType(e,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});i.AnnotationType.registerType(l,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});i.AnnotationType.registerType(n,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});i.AnnotationType.registerType(p,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});i.AnnotationType.registerType(o,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});i.AnnotationType.registerType(s,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});i.AnnotationType.registerType(r,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});i.AnnotationType.registerType(q,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});i.AnnotationType.registerType(t,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
i.AnnotationType.registerType(m,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});i.AnnotationType.registerType(u,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});b.prototype={initAll:function(a,b,c,d,e,f,g){this._charOrWordDiff=a?a:"word";if(b)this._initialized=!0;this.editorWrapper=[{editor:b,diffFeeder:d},{editor:c,diffFeeder:e}];this._curveRuler=g;(this._overviewRuler=f)&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(a){if(a)for(var b=
0;b<this.editorWrapper.length;b++)this.editorWrapper[b].diffFeeder.init(this.editorWrapper[b].editor.getTextView().getModel(),a)},destroy:function(){this.initAll(this._charOrWordDiff)},renderAnnotations:function(){var a;for(a=0;a<this.editorWrapper.length;a++){this.editorWrapper[a].annoTypes=[];this.editorWrapper[a].diffFeeder.getBlockAnnoTypes(this.editorWrapper[a].annoTypes);this.editorWrapper[a].diffFeeder.getWordAnnoTypes(this.editorWrapper[a].annoTypes);for(var b=0;b<this.editorWrapper[a].annoTypes.length;b++)this.editorWrapper[a].annoTypes[b].current&&
this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].current),this.editorWrapper[a].annoTypes[b].normal&&this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].normal)}this._root.children=[];b=this.editorWrapper[0].diffFeeder.getDiffBlocks();if(!b||b.length===0)this.replaceAllAnnotations(!0,0,"block",!1,[]),this.replaceAllAnnotations(!0,1,"block",!1,[]),this.replaceAllAnnotations(!0,0,"word",!1,[]),
this.replaceAllAnnotations(!0,1,"word",!1,[]),this.replaceAllAnnotations(!0,0,"block",!0,[]),this.replaceAllAnnotations(!0,1,"block",!0,[]),this.replaceAllAnnotations(!0,0,"word",!0,[]),this.replaceAllAnnotations(!0,1,"word",!0,[]);else{var c=new 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 j.TreeModelIterator(this._root.children)}},replaceAllAnnotations:function(a,b,c,d,e){if(this.editorWrapper[b].annoTypes)for(var f=0;f<this.editorWrapper[b].annoTypes.length;f++)this.editorWrapper[b].annoTypes[f].type===c&&this.replaceDiffAnnotations(this.editorWrapper[b].editor,e?e:this.editorWrapper[b].annoTypes[f].list,d?this.editorWrapper[b].annoTypes[f].normal:this.editorWrapper[b].annoTypes[f].current,
a)},getMapper:function(){return this.editorWrapper[0].diffFeeder.getMapper()},getFeeder:function(a){return a?this.editorWrapper[1].diffFeeder:this.editorWrapper[0].diffFeeder},iterateOnBlock:function(a,b){this.iterator&&(this.iterator.iterateOnTop(a,b),this.updateCurrentAnnotation(!0))},iterateOnChange:function(a){if(!this.iterator)return null;var b=this.iterator.iterate(a);if(b){var c=this.iterator.cursor();c.type==="block"&&c.children&&c.children.length>0&&this.iterator.iterate(a);this.updateCurrentAnnotation(!0)}return b},
gotoBlock:function(a,b){if(this.iterator){if(a<0||a>=this._root.children.length||this._root.children.length===0)a=0;b!==void 0&&b>=0&&this._root.children[a].children&&b<this._root.children[a].children.length?this.iterator.setCursor(this._root.children[a].children[b]):this.iterator.setCursor(this._root.children[a]);this.updateCurrentAnnotation(!1);this._positionDiffBlock()}},_hitDiffAnnotation:function(a,b,c){if(c===this.editorWrapper[a].editor.getTextView()){for(var d=0;d<this._root.children.length;d++){var c=
this._root.children[d],e=a===0?c.oldA:c.newA;if(b>=e.start&&b<=e.end){d=c;if(c.children&&c.children.length>0)for(e=0;e<c.children.length;e++){var f=c.children[e],g=a===0?f.oldA:f.newA;if(b>=g.start&&b<=g.end){d=f;break}}return d}}return null}},gotoChange:function(a,b){for(var c=0;c<this.editorWrapper.length;c++){var d=this._hitDiffAnnotation(c,a,b);if(d)return this.iterator.setCursor(d),this.updateCurrentAnnotation(!1,b),!0}return!1},getCurrentBlockIndex:function(){if(!this.iterator)return-1;var a=
this.iterator.cursor();return!a?-1:a.type==="block"?a.index:a.parent.index},getCurrentPosition:function(){if(!this.iterator)return{};var a=this.iterator.cursor();return a.type==="block"?{block:a.index+1}:{block:a.parent.index+1,change:a.index+1}},getCurrentMapperIndex:function(){var a=this.getCurrentBlockIndex();a<0&&(a=0);var b=this.getFeeder().getDiffBlocks();if(!b||b.length===0)return-1;a>b.length-1&&(a=0);return b[a][1]},replaceDiffAnnotations:function(a,b,c,d){if(b&&c&&(a=a.getAnnotationModel())){for(var e=
a.getAnnotations(0,a.getTextModel().getCharCount()),f=[];d&&e.hasNext();){var g=e.next();g.type===c&&f.push(g)}a.replaceAnnotations(f,b)}},updateCurrentAnnotation:function(a,b){this.replaceAllAnnotations(!0,0,"block",!1,[]);this.replaceAllAnnotations(!0,1,"block",!1,[]);this.replaceAllAnnotations(!0,0,"word",!1,[]);this.replaceAllAnnotations(!0,1,"word",!1,[]);if(this.iterator){var c=this.iterator.cursor();if(c){var d,e,f={start:c.oldA.start,end:c.oldA.end},g={start:c.newA.start,end:c.newA.end};c.type===
"word"?(d=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(f,this.editorWrapper[0].editor.getTextView().getModel()),e=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(g,this.editorWrapper[1].editor.getTextView().getModel())):(d=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(c.index),e=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(c.index));d&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (i.AnnotationType.getType(d.current))(f.start,f.end)],d,!0);
e&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (i.AnnotationType.getType(e.current))(g.start,g.end)],e,!0);if(a)this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(c.oldA.start,c.oldA.end,!0),this.editorWrapper[1].editor.setSelection(c.newA.start,c.newA.end,!0),this.autoSelecting=!1;else if(b)this.autoSelecting=!0,b!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(c.oldA.start,c.oldA.end,!0),b!==this.editorWrapper[1].editor.getTextView()&&
this.editorWrapper[1].editor.setSelection(c.newA.start,c.newA.end,!0),this.autoSelecting=!1}}},generatePairBlockAnnotations:function(a,b){var c=this.generateBlockDiffAnnotations(0,b),d=this.generateBlockDiffAnnotations(1,b);return{parent:a,index:b,type:"block",oldA:c,newA:d}},generatePairWordAnnotations:function(a,b,c){var d=this.editorWrapper[0].diffFeeder.getTextOnBlock(b),e=this.editorWrapper[1].diffFeeder.getTextOnBlock(b),b=null,f=0,g=0;if(d&&e&&d.text&&e.text&&d.text.length<=5E3&&e.text.length<=
5E3)b=c.adaptCharDiff(d.text,e.text,this._charOrWordDiff==="word"),g=e.start,f=d.start;else return null;c=[];d=[];this.generateWordDiffAnnotations(0,c,f,b,2,3);this.generateWordDiffAnnotations(1,d,g,b,0,1);b=[];for(f=0;f<c.length;f++)b.push({parent:a,index:f,type:"word",oldA:c[f],newA:d[f]});return b},getAnnoModelList:function(a,b,c){for(var d=0;d<this.editorWrapper[a].annoTypes.length;d++)if(this.editorWrapper[a].annoTypes[d].type===b&&this.editorWrapper[a].annoTypes[d].normal===c)return this.editorWrapper[a].annoTypes[d].list;
return null},generateBlockDiffAnnotations:function(a,b){var c=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(b),d=this.getAnnoModelList(a,"block",c.normal),e=this.editorWrapper[a].diffFeeder.getCharRange(b),c=i.AnnotationType.createAnnotation(c.normal,e.start,e.end);d&&d.push(c);return c},generateWordDiffAnnotations:function(a,b,c,d,e,f){if(d)for(var g=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1}),a=this.getAnnoModelList(a,"word",g.normal),h=0;h<d.length;h++){var j=
i.AnnotationType.createAnnotation(g.normal,d[h][e]+c,d[h][f]+c);a.push(j);b.push(j)}},_updateOverviewRuler:function(){if(this._overviewRuler){var a=this.editorWrapper[0].editor.getTextView().getTopIndex();this.editorWrapper[0].editor.getTextView().redrawLines(a,a+1,this._overviewRuler)}},_updateCurveRuler:function(){this._curveRuler&&this._curveRuler.render()},_setTextViewPosition:function(a,b){var c=a.getLineHeight(),d=a.getClientArea(),c=Math.floor(d.height/c/3);a.setTopIndex(b-c>0?b-c:0)},_positionDiffBlock:function(){var a=
this.getCurrentBlockIndex();a<0&&(a=0);var b=this.getFeeder().getDiffBlocks();b.length!==0&&(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),b[a][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor&&(a=k.lookUpLineIndex(this.getMapper(),0,b[a][1]),this._setTextViewPosition(this.editorWrapper[1].editor.getTextView(),a)),this._updateOverviewRuler(),this._updateCurveRuler())},matchPositionFromOverview:function(a){this._initialized&&this.gotoBlock(a<0?0:k.getAnnotationIndex(this.getFeeder().getDiffBlocks(),
a))},gotoDiff:function(a,b){this.gotoChange(a,b)&&(this._updateOverviewRuler(),this._updateCurveRuler())},nextDiff:function(){this.iterateOnBlock(!0,!0);this._positionDiffBlock()},prevDiff:function(){this.iterateOnBlock(!1,!0);this._positionDiffBlock()},nextChange:function(){var a=this.iterateOnChange(!0);this._positionDiffBlock();return a},prevChange:function(){this.iterateOnChange(!1);this._positionDiffBlock()}};return b}();b.DiffBlockFeeder=function(){function a(){}a.prototype={getWordAnnoTypes:function(a){this._mapperColumnIndex===
0?a.push({type:"word",current:o,normal:p,list:[]}):a.push({type:"word",current:r,normal:s,list:[]});a.push({type:"word",current:q});a.push({type:"word",current:t});a.push({type:"word",current:m});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:p}:{current:this._repositionEmptyWord(a,b),normal:s}:this._mapperColumnIndex===0?{current:o,normal:p}:{current:r,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?m:q},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}();b.TwoWayDiffBlockFeeder=function(){function d(a,b,c){this._mapperColumnIndex=c;this.init(a,b)}d.prototype=new b.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(b){this._mapperColumnIndex===0?b.push({type:"block",normal:a,current:f,list:[]}):b.push({type:"block",normal:h,current:g,list:[]});b.push({type:"block",normal:c,current:e,list:[]});b.push({type:"block",normal:l,current:n,list:[]})};d.prototype.getCurrentBlockAnnoType=function(b){if(!this._diffBlocks||this._diffBlocks.length===0||this._diffBlocks.length<=b)return null;b=this._diffBlocks[b][1];
if(this._mapper[b][this._mapperColumnIndex]===0)return{normal:c,current:e};else if(k.isMapperConflict(this.getMapper(),b))return{normal:l,current:n};else if(this._mapperColumnIndex===0)return{type:"block",normal:a,current:f,list:[]};return{type:"block",normal:h,current:g,list:[]}};return d}();b.inlineDiffBlockFeeder=function(){function c(a,b){this._mapperColumnIndex=b;this.init(a)}c.prototype=new b.DiffBlockFeeder;c.prototype.setModel=function(a){this._textModel=a};c.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]}}};c.prototype.getBlockAnnoTypes=function(b){this._mapperColumnIndex===0?b.push({type:"block",normal:a,current:f,list:[]}):b.push({type:"block",normal:h,current:g,list:[]});b.push({type:"block",normal:l,current:n,list:[]})};c.prototype.getCurrentBlockAnnoType=function(b){if(!this._diffBlocks||this._diffBlocks.length===0)return null;b=this._diffBlocks[b][1];if(this._mapper[b][this._mapperColumnIndex]===0)return{current:o,normal:p};else if(k.isMapperConflict(this.getMapper(),
b))return{normal:l,current:n};else if(this._mapperColumnIndex===0)return{type:"block",normal:a,current:f,list:[]};return{type:"block",normal:h,current:g,list:[]}};c.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]};c.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 c}();return b});
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(j,k,i,d,b,a,f,h,g,c,e,l,n){var p={};p.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 l.JSDiffAdapter).adapt(a,b,f);if(this.options.toggler)this.options.mapper=
a.mapper,this.options.newFile.Content=b,this.options.diffArray=a.changContents;return{delim:f,mapper:a.mapper,output:b,diffArray:a.changContents}}else{b=this._diffParser.parse(a,c,d,e);a=this._diffParser.getDiffArray();if(this.options.toggler)this.options.mapper=b.mapper,this.options.newFile.Content=b.outPutFile,this.options.diffArray=a;return{delim:f,mapper:b.mapper,output:b.outPutFile,diffArray:a}}},_initSyntaxHighlighter:function(a){this._syntaxHighlighters=null;if(this.options.highlighters&&this.options.highlighters.length>
0&&!(a.length<1||a.length>2))this._syntaxHighlighters=[{highlighter:this.options.highlighters[0],target:a[0]}],a.length===2&&this.options.highlighters.length===2&&this._syntaxHighlighters.push({highlighter:this.options.highlighters[1],target:a[1]})},_highlightSyntax:function(){if(this._syntaxHighlighters){var a=[];this._syntaxHighlighters.forEach(function(b){a.push(b.highlighter.highlight(b.target.fileName,b.target.contentType,b.target.editor))}.bind(this));k.all(a,function(a){return{_error:a}}).then(function(){this._diffNavigator.renderAnnotations();
this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this))}else window.setTimeout(function(){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this),50)},setOptions:function(a,b){b&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},getOptions:function(){return this.options},getCurrentDiffPos:function(){return this._diffNavigator.getCurrentPosition()},
initDiffNav:function(){this._diffNavigator.gotoBlock(0,0)},nextDiff:function(){this._diffNavigator.nextDiff()},prevDiff:function(){this._diffNavigator.prevDiff()},nextChange:function(){return this._diffNavigator.nextChange()},prevChange:function(){this._diffNavigator.prevChange()},getWidget:function(){return this},startup:function(){this.initEditors();this.refresh(!0)},initEditors:function(){}};return a}();p.TwoWayCompareView=function(){function d(a){this.setOptions(a,!0);this._diffNavigator=new n.DiffTreeNavigator("word");
this.type="twoWay";this._uiFactory=this.options.uiFactory;if(!this._uiFactory)this._uiFactory=new c.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 b.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}
d.prototype=new p.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 b.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 j["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(b,c,d,e,h){var i=typeof e.readonly==="undefined"?!0:e.readonly,k=function(){var a=new g.TextView({parent:c,readonly:i,tabSize:4});this._viewLoadedCounter++;this._viewLoadedCounter===2&&this._diffNavigator.matchPositionFromOverview(-1);if(this.onLoad)this.onLoad();var b=this.getSplitter();b&&b.addResizeListener(function(b){if(b){var c=
!1;(c=this._uiFactory.isLeftPane(b)?h:!h)&&a.resize()}}.bind(this));return a}.bind(this),l=e.keyBindingFactory;l||(l=new f.KeyBindingsFactory);var n=null;if(d)var p="",n=function(a,b){if(d)p=b?j["ERROR: "]+a:a,d.textContent=""+p};k=new a.Editor({textViewFactory:k,undoStackFactory:new f.UndoFactory,annotationFactory:new f.AnnotationFactory,keyBindingFactory:l,statusReporter:n,domNode:c});k.installTextView();k.setInput(null,null,e.Content?e.Content:b);k.setOverviewRulerVisible(!1);var o=k.getTextView();
o.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(o.getCaretOffset(),o)}.bind(this));o.getModel().addEventListener("Changed",function(a){if(!this._curveRuler.onChanged(a,!h))this.options.mapper=null}.bind(this));h?o.addEventListener("Scroll",function(){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render());if(this.onScroll)this.onScroll()}.bind(this)):
o.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 b.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),c=new b.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(c);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 n.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),d.mapper,1),f=new n.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),d.mapper,0);this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editors[0],this._editors[1],e,f,this._overviewRuler,this._curveRuler);this._curveRuler.init(d.mapper,this._editors[1],this._editors[0],this._diffNavigator);a&&(this._editors[1].setInput(this.options.newFile.Name,null,c),this._editors[0].setInput(this.options.oldFile.Name,
null,b));this._initSyntaxHighlighter([{fileName:this.options.newFile.Name,contentType:this.options.newFile.Type,editor:this._editors[1]},{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editors[0]}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();this._viewLoadedCounter===2&&this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);a=this._uiFactory.getTitleDiv(!0);
if((b=this._uiFactory.getTitleDiv(!1))&&a)i.empty(b),i.empty(a),b.appendChild(document.createTextNode(this.options.oldFile.Name)),a.appendChild(document.createTextNode(this.options.newFile.Name));a=this._editors[1].getTextView().getModel().getLineCount()*this._editors[1].getTextView().getLineHeight()+5;b=this._editors[0].getTextView().getModel().getLineCount()*this._editors[0].getTextView().getLineHeight()+5;return a>b?a:b};return d}();p.InlineCompareView=function(){function c(a){this.setOptions(a,
!0);this._diffNavigator=new n.DiffTreeNavigator("word");this.type="inline";this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._editorDiv=this.options.parentDivId}c.prototype=new p.CompareView;c.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};c.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};c.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.setText(""),this.removeRulers())};c.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};c.prototype.initEditors=function(c){var d=i.node(this._editorDiv),e=function(){return new g.TextView({parent:d,readonly:!0,tabSize:4})}.bind(this);this._editor=
new a.Editor({textViewFactory:e,undoStackFactory:new f.UndoFactory,annotationFactory:new f.AnnotationFactory,domNode:d});this._editor.installTextView();this._editor.setInput(null,null,c);this._editor.setOverviewRulerVisible(!1);this._editor.setAnnotationRulerVisible(!1);this._textView=this._editor.getTextView();this._rulerOrigin=new b.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._rulerNew=new b.LineNumberCompareRuler(this._diffNavigator,
0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._overviewRuler=new b.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))};c.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)}};c.prototype.refresh=function(){var a=this.options.oldFile.Content,b=this._generateMapper(a,this.options.newFile.Content,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);this._textView.getModel().setText(a);var a=new n.inlineDiffBlockFeeder(b.mapper,
1),c=new n.inlineDiffBlockFeeder(b.mapper,0);e.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};c.prototype.setConflicting=
function(a){this._conflcit=a};return c}();p.toggleableCompareView=function(){function a(b,c){if(c)c.toggler=this;this._widget=b==="inline"?new p.InlineCompareView(c):new p.TwoWayCompareView(c)}a.prototype={startup:function(){this._widget.startup()},toggle:function(){var a=this._widget.options,b=this._widget.getCurrentDiffPos();a.blockNumber=b.block;a.changeNumber=b.change;this._widget.destroy();i.empty(i.node(a.parentDivId));this._widget=this._widget.type==="inline"?new p.TwoWayCompareView(a):new p.InlineCompareView(a);
this._widget.initEditors();this._widget.refresh(!0)},getWidget:function(){return this._widget}};return a}();return p});
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(j,k){function i(a,b){this.keywords=a;this.whitespacesVisible=b;this.setText("")}function d(){i.call(this,null,!0)}function b(a){i.call(this,null,a)}function a(){i.call(this,null,!1)}function f(e,f,j){this.commentStart="/*";this.commentEnd="*/";var k=[];switch(f){case "java":k=g;break;case "js":k=h;break;case "css":k=c}this.whitespacesVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=
this.foldingEnabled=!0;this._scanner=new i(k,this.whitespacesVisible);this._firstScanner=new a;this._commentScanner=new b(this.whitespacesVisible);this._whitespaceScanner=new d;if(f==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=e;this.annotationModel=j;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)}};f=e.getModel();f.getBaseModel&&(f=f.getBaseModel());f.addEventListener("Changed",this._listener.onChanged);e.addEventListener("MouseDown",this._listener.onMouseDown);e.addEventListener("Selection",this._listener.onSelection);e.addEventListener("Destroy",this._listener.onDestroy);e.addEventListener("LineStyle",this._listener.onLineStyle);this._computeComments();this._computeFolding();e.redrawLines()}var h=k.JSKeywords,g=k.JAVAKeywords,c=k.CSSKeywords,e={styleClass:"token_singleline_comment"},
l={styleClass:"token_multiline_comment"},n={styleClass:"token_doc_comment"},p={styleClass:"token_doc_html_markup"},o={styleClass:"token_task_tag"},s={styleClass:"token_doc_tag"},r={styleClass:"token_string"},q={styleClass:"token_number"},t={styleClass:"token_keyword"},m={styleClass:"token_space"},u={styleClass:"token_tab"},z={styleClass:"line_caret"};i.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,
this.offset)},getDataLength:function(){return this.offset-this.startOffset},_default:function(a){switch(a){case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===9);this._unread(a);return 9;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return a;default:var b=this.isCSS,c=this.offset-1;if(!b&&48<=a&&a<=57){var d=b=!1,e=!1,f=a;do if(a=this._read(),a===46&&!b)b=!0;else if(a===101&&!d)b=d=!0,a=this._read(),a!==45&&this._unread(a);else if(a===
120&&f===48&&this.offset-c===2)b=d=e=!0;else if(!(48<=a&&a<=57||e&&(65<=a&&a<=70||97<=a&&a<=102)))break;while(1);this._unread(a);return 3}if(97<=a&&a<=122||65<=a&&a<=90||a===95||45===a&&b){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57||45===a&&b);this._unread(a);a=this.keywords;if(a.length>0){c=this.text.substring(c,this.offset);for(b=0;b<a.length;b++)if(this.keywords[b]===c)return 2}}return 1}},_read:function(){return this.offset<this.text.length?this.text.charCodeAt(this.offset++):
-1},_unread:function(a){a!==-1&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var a=this._read(),b;switch(a){case -1:return null;case 47:a=this._read();if(!this.isCSS&&a===47)for(;;)if(a=this._read(),a===-1||a===10||a===13)return this._unread(a),6;if(a===42){a=this._read();b=7;for(a===42&&(b=8);;){for(;a===42;)if(a=this._read(),a===47)return b;if(a===-1)return this._unread(a),b;a=this._read()}}this._unread(a);return 1;case 39:for(b=4;;)switch(a=this._read(),a){case 39:return b;
case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;case 34:for(b=4;;)switch(a=this._read(),a){case 34:return b;case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;default:return this._default(a)}}},setText:function(a){this.text=a;this.startOffset=this.offset=0}};d.prototype=new i(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}}};b.prototype=new i(null);b.prototype.setType=function(a){this._type=a};b.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===
9);this._unread(a);return 9;case 60:if(this._type===8){do a=this._read();while(!(a===62||a===-1));if(a===62)return 12}return 1;case 64:if(this._type===8){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57);this._unread(a);return 13}return 1;case 84:if((a=this._read())===79)if((a=this._read())===68)if((a=this._read())===79)if(a=this._read(),!(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57))return this._unread(a),14;this._unread(a);default:do a=this._read();while(!(a===32||
a===9||a===-1||a===60||a===64||a===84));this._unread(a);return 1}}};a.prototype=new i(null);a.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),1}};f.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(j.AnnotationType.ANNOTATION_FOLDING);for(var c=
[],d=a.getBaseModel(),e=this.comments,f=0;f<e.length;f++){var g=e[f];(g=this._createFoldingAnnotation(a,d,g.start,g.end))&&c.push(g)}b.replaceAnnotations(null,c)}}}},_createFoldingAnnotation:function(a,b,c,d){var e=b.getLineAtOffset(c),b=b.getLineAtOffset(d);return e===b?null:new (j.AnnotationType.getType(j.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 g=d.getAnnotations(b,c),e=[],h=j.AnnotationType.ANNOTATION_TASK;g.hasNext();){var i=g.next();i.type===h&&e.push(i)}g=[];i=this._commentScanner;i.setText(f.getText(b,c));for(var k;k=i.nextToken();){var l=i.getStartOffset()+b;k===14&&(k=f.getLineEnd(f.getLineAtOffset(l)),a!==6&&(k=Math.min(k,c-this.commentEnd.length)),g.push(j.AnnotationType.createAnnotation(h,l,k,f.getText(l,k))))}d.replaceAnnotations(e,g)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var b=this.view,c=b.getModel(),
b=b.getSelection();if(b.start===b.end&&c.getLineAtOffset(b.start)===a)return z}return null},_getStyles:function(a,b,c){a.getBaseModel&&(c=a.mapOffset(c));for(var d=c+b.length,e=[],f=c,g=this.comments,h=this._binarySearch(g,c,!0);h<g.length;h++){if(g[h].start>=d)break;var i=g[h].start,j=g[h].end;f<i&&this._parse(b.substring(f-c,i-c),f,e);var k=g[h].type,m;switch(k){case 8:m=n;break;case 7:m=l;break;case 5:m=r}f=Math.max(f,i);i=Math.min(d,j);(k===8||k===7)&&(this.whitespacesVisible||this.detectHyperlinks)?
this._parseComment(b.substring(f-c,i-c),f,e,m,k):k===5&&this.whitespacesVisible?this._parseString(b.substring(f-c,i-c),f,e,r):e.push({start:f,end:i,style:m});f=j}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 f=d.getStartOffset()+b,g=null;switch(a){case 2:g=t;break;case 3:g=q;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(d.getData(),
f,c,r);continue}else g=r;break;case 8:this._parseComment(d.getData(),f,c,n,a);continue;case 6:this._parseComment(d.getData(),f,c,e,a);continue;case 7:this._parseComment(d.getData(),f,c,l,a);continue;case 10:this.whitespacesVisible&&(g=u);break;case 11:this.whitespacesVisible&&(g=m)}c.push({start:f,end:d.getOffset()+b,style:g})}},_parseComment:function(a,b,c,d,e){var f=this._commentScanner;f.setText(a);for(f.setType(e);a=f.nextToken();){var e=f.getStartOffset()+b,g=d;switch(a){case 10:this.whitespacesVisible&&
(g=u);break;case 11:this.whitespacesVisible&&(g=m);break;case 12:g=p;break;case 13:g=s;break;case 14:g=o;break;default:this.detectHyperlinks&&(g=this._detectHyperlinks(f.getData(),e,c,g))}g&&c.push({start:e,end:f.getOffset()+b,style:g})}},_parseString:function(a,b,c,d){var e=this._whitespaceScanner;for(e.setText(a);a=e.nextToken();){var f=e.getStartOffset()+b,g=d;switch(a){case 10:this.whitespacesVisible&&(g=u);break;case 11:this.whitespacesVisible&&(g=m)}g&&c.push({start:f,end:e.getOffset()+b,style:g})}},
_detectHyperlinks:function(a,b,c,d){var e=null,f;if((f=a.indexOf("://"))>0){for(var e=a,g=f;g>0;){f=e.charCodeAt(g-1);if(!(97<=f&&f<=122||65<=f&&f<=90||45===f||48<=f&&f<=57))break;g--}if(g>0&&(f="\"\"''(){}[]<>".indexOf(e.substring(g-1,g)),f!==-1&&(f&1)===0&&(f=e.lastIndexOf("\"\"''(){}[]<>".substring(f+1,f+2)))!==-1)){var h=f;f=this._clone(d);f.tagName="a";f.attributes={href:e.substring(g,h)};c.push({start:b,end:b+g,style:d});c.push({start:b+g,end:b+h,style:f});c.push({start:b+h,end:b+a.length,style:d});
return null}}else a.toLowerCase().indexOf("bug#")===0&&(e="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(a.substring(4),10));return e?(f=this._clone(d),f.tagName="a",f.attributes={href:e},f):d},_clone:function(a){if(!a)return a;var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},_findComments:function(a,b){var b=b||0,c=this._firstScanner,d;c.setText(a);for(var e=[];d=c.nextToken();)(d===7||d===8||d===5)&&e.push({start:c.getStartOffset()+b,end:c.getOffset()+b,type:d}),(d===
6||d===7||d===8)&&this._computeTasks(d,c.getStartOffset()+b,c.getOffset()+b);return e},_findMatchingBracket:function(a,b){var c="{}()[]<>",d=a.getText(b,b+1),e=c.indexOf(d,0);if(e===-1)return-1;var f;f=e&1?c.substring(e-1,e):c.substring(e+1,e+2);for(var g=a.getLineAtOffset(b),c=a.getLine(g),h=a.getLineStart(g),i=a.getLineEnd(g),c=this._findBrackets(d,f,c,h,h,i),i=0;i<c.length;i++)if(h=c[i]>=0?1:-1,c[i]*h-1===b){var j=1;if(e&1){for(i--;i>=0;i--)if(h=c[i]>=0?1:-1,j+=h,j===0)return c[i]*h-1;for(g-=1;g>=
0;){c=a.getLine(g);h=a.getLineStart(g);i=a.getLineEnd(g);c=this._findBrackets(d,f,c,h,h,i);for(e=c.length-1;e>=0;e--)if(h=c[e]>=0?1:-1,j+=h,j===0)return c[e]*h-1;g--}}else{for(i++;i<c.length;i++)if(h=c[i]>=0?1:-1,j+=h,j===0)return c[i]*h-1;g+=1;for(e=a.getLineCount();g<e;){c=a.getLine(g);h=a.getLineStart(g);i=a.getLineEnd(g);c=this._findBrackets(d,f,c,h,h,i);for(i=0;i<c.length;i++)if(h=c[i]>=0?1:-1,j+=h,j===0)return c[i]*h-1;g++}}break}return-1},_findBrackets:function(a,b,c,d,e,f){for(var g=[],a=
a.charCodeAt(0),b=b.charCodeAt(0),h=e,i=this._scanner,j,k=this.comments,l=this._binarySearch(k,e,!0);l<k.length;l++){if(k[l].start>=f)break;j=k[l].start;var n=k[l].end;if(h<j)for(i.setText(c.substring(h-e,j-e));j=i.nextToken();)j===a?g.push(i.getStartOffset()+h-e+d+1):j===b&&g.push(-(i.getStartOffset()+h-e+d+1));h=n}if(h<f)for(i.setText(c.substring(h-e,f-e));j=i.nextToken();)j===a?g.push(i.getStartOffset()+h-e+d+1):j===b&&g.push(-(i.getStartOffset()+h-e+d+1));return g},_onDestroy:function(){this.destroy()},
_onLineStyle:function(a){if(a.textView===this.view)a.style=this._getLineStyle(a.lineIndex);a.ranges=this._getStyles(a.textView.getModel(),a.lineText,a.lineStart)},_onSelection:function(a){var b=a.oldValue,c=a.newValue,d=this.view,a=d.getModel(),e;if(this.highlightCaretLine){var f=a.getLineAtOffset(b.start);e=a.getLineAtOffset(c.start);var g=c.start===c.end,b=b.start===b.end;f===e&&b&&g||(b&&d.redrawLines(f,f+1),(f!==e||!b)&&g&&d.redrawLines(e,e+1))}if(this.annotationModel){var b=this._bracketAnnotations,
h,i;if(c.start===c.end&&(i=d.getCaretOffset())>0)i-=1,a.getBaseModel&&(i=a.mapOffset(i),a=a.getBaseModel()),a=this._findMatchingBracket(a,i),a!==-1&&(h=[j.AnnotationType.createAnnotation(j.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),j.AnnotationType.createAnnotation(j.AnnotationType.ANNOTATION_CURRENT_BRACKET,i,i+1)]);this._bracketAnnotations=h;this.annotationModel.replaceAnnotations(b,h)}},_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,g=f.getCharCount(),h=this.comments.length,i=f.getLineStart(f.getLineAtOffset(b)),k=this._binarySearch(this.comments,i,!0),l=this._binarySearch(this.comments,
c,!1,k-1,h);k<h&&this.comments[k].start<=i&&i<this.comments[k].end?(i=this.comments[k].start,i>b&&(i+=d)):i=k===h&&h>0&&g-d===this.comments[h-1].end?this.comments[h-1].start:i;var n;l<h?(n=this.comments[l].end,n>b&&(n+=d),l+=1):(l=h,n=g);for(var m,g=this._findComments(f.getText(i,n),i),h=k;h<this.comments.length;h++)m=this.comments[h],m.start>b&&(m.start+=d),m.start>b&&(m.end+=d);var p=l-k!==g.length;if(!p)for(h=0;h<g.length;h++){m=this.comments[k+h];var o=g[h];if(m.start!==o.start||m.end!==o.end||
m.type!==o.type){p=!0;break}}h=[k,l-k].concat(g);Array.prototype.splice.apply(this.comments,h);p&&(h=i,m=n,a!==f&&(h=a.mapOffset(h,!0),m=a.mapOffset(m,!0)),e.redrawRange(h,m));if(this.foldingEnabled&&f!==a&&this.annotationModel){e=this.annotationModel;k=e.getAnnotations(i,n);i=[];for(n=[];k.hasNext();)if(m=k.next(),m.type===j.AnnotationType.ANNOTATION_FOLDING){n.push(m);for(h=0;h<g.length;h++)if(m.start===g[h].start&&m.end===g[h].end)break;h===g.length?(i.push(m),m.expand()):(h=m.start,l=m.end,h>
b&&(h-=d),l>b&&(l-=d),h<=b&&b<l&&h<=c&&c<l&&(h=f.getLineAtOffset(m.start),l=f.getLineAtOffset(m.end),h!==l?m.expanded||(m.expand(),e.modifyAnnotation(m)):e.removeAnnotation(m)))}b=[];for(h=0;h<g.length;h++){m=g[h];for(d=0;d<n.length;d++)if(n[d].start===m.start&&n[d].end===m.end)break;d===n.length&&(m=this._createFoldingAnnotation(a,f,m.start,m.end))&&b.push(m)}e.replaceAnnotations(i,b)}}};return{TextStyler:f}});
define("orion/editor/textMateStyler",["orion/editor/regex"],function(j){function k(b){var a;if(b instanceof Array){a=Array(b.length);for(var d=0;d<b.length;d++)a[d]=k(b[d])}else for(d in a={},b)if(Object.prototype.hasOwnProperty.call(b,d)){var h=b[d];a[d]=typeof h==="object"&&h!==null?k(h):h}return a}function i(b,a,d){this.initialize(b);this.grammar=k(a);this.externalGrammars=d?k(d):[];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(b){return b[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(b){function a(a,b){throw Error('Unsupported regex feature "'+a+'": "'+b[0]+'" at index: '+b.index+" in "+b.input);}var f="",h,b=d.processGlobalFlag("x",b,function(a){for(var b="",d=!1,f=a.length,g=0;g<f;){var h=a.charAt(g);if(!d&&h==="#")for(;g<f&&h!=="\r"&&h!=="\n";)h=a.charAt(++g);
else if(!d&&/\s/.test(h))for(;g<f&&/\s/.test(h);)h=a.charAt(++g);else h==="\\"?(b+=h,/\s/.test(a.charAt(g+1))||(b+=a.charAt(g+1),g+=1)):(h==="["?d=!0:h==="]"&&(d=!1),b+=h),g+=1}return b}),b=d.processGlobalFlag("i",b,function(a){f+="i";return a});for(h=0;h<this.unsupported.length;h++){var g;(g=this.unsupported[h].regex.exec(b))&&a(this.unsupported[h].func(g),g)}return RegExp(b,f)},processGlobalFlag:function(b,a,d){function h(a,b){for(var d=0,f=a.length,g=-1,h=b;h<f&&g===-1;h++)switch(a.charAt(h)){case "\\":h++;
break;case "(":d++;break;case ")":d--,d===0&&(g=h)}return g}var g="(?"+b+")",b="(?"+b+":";if(a.substring(0,g.length)===g)return d(a.substring(g.length));else if(a.substring(0,b.length)===b){g=h(a,0);if(g<a.length-1)throw Error("Only a "+b+") group that encloses the entire regex is supported in: "+a);return d(a.substring(b.length,g))}return a},hasBackReference:function(b){return/\\\d+/.test(b.source)},getSubstitutedRegex:function(b,a,d){for(var d=typeof d==="undefined"?!0:!1,b=b.source.split(/(\\\d+)/g),
h=[],g=0;g<b.length;g++){var c=b[g],e=/\\(\d+)/.exec(c);e?(c=a[e[1]]||"",h.push(d?j.escape(c):c)):h.push(c)}return RegExp(h.join(""))},groupify:function(b,a){for(var d=b.source,h=d.length,g=[],c=0,e=[],i=1,j=1,k=[],o={},s={},r=0;r<h;r++){var q=g[g.length-1],t=d.charAt(r);switch(t){case "(":if(q===4)g.pop(),k.push(")"),e[e.length-1].end=r;var m=r+2<h?d.charAt(r+1)+""+d.charAt(r+2):null;if(m==="?:"||m==="?="||m==="?!"){var u;m==="?:"?u=1:(u=3,c++);g.push(u);e.push({start:r,end:-1,type:u});k.push(t);
k.push(m);r+=m.length}else g.push(2),e.push({start:r,end:-1,type:2,oldNum:i,num:j}),k.push(t),c===0&&(s[j]=null),o[i]=j,i++,j++;break;case ")":q=g.pop();q===3&&c--;e[e.length-1].end=r;k.push(t);break;case "*":case "+":case "?":case "}":var z=t,w=d.charAt(r-1),m=r-1;if(t==="}"){for(u=r-1;d.charAt(u)!=="{"&&u>=0;u--);w=d.charAt(u-1);m=u-1;z=d.substring(u,r+1)}u=e[e.length-1];if(w===")"&&(u.type===2||u.type===4)){k.splice(u.start,0,"(");k.push(z);k.push(")");t={start:u.start,end:k.length-1,type:4,num:u.num};
for(w=0;w<e.length;w++)if(q=e[w],(q.type===2||q.type===4)&&q.start>=u.start&&q.end<=m)if(q.start+=1,q.end+=1,q.num+=1,q.type===2)o[q.oldNum]=q.num;e.push(t);j++;break}default:t!=="|"&&q!==2&&q!==4&&c===0&&(g.push(4),e.push({start:r,end:-1,type:4,num:j}),k.push("("),s[j]=null,j++),k.push(t),t==="\\"&&(t=d.charAt(r+1),k.push(t),r+=1)}}for(;g.length;)g.pop(),k.push(")");var d=RegExp(k.join("")),h={},a=a||o,v;for(v in a)a.hasOwnProperty(v)&&(h[v]="\\"+a[v]);d=this.getSubstitutedRegex(d,h,!1);return[d,
o,s]},complexCaptures:function(b){if(!b)return!1;for(var a in b)if(b.hasOwnProperty(a)&&a!=="0")return!0;return!1}};i.prototype={initialize:function(b){this.textView=b;this.textView.stylerOptions=this;var a=this;this._listener={onModelChanged:function(b){a.onModelChanged(b)},onDestroy:function(b){a.onDestroy(b)},onLineStyle:function(b){a.onLineStyle(b)},onStorage:function(b){a.onStorage(b)}};b.addEventListener("ModelChanged",this._listener.onModelChanged);b.addEventListener("Destroy",this._listener.onDestroy);
b.addEventListener("LineStyle",this._listener.onLineStyle);b.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(b){for(b=[b];b.length!==0;){var a=
b.pop();if(!a._resolvedRule||!a._typedRule)if(a._resolvedRule=this._resolve(a),a._typedRule=this._createTypedRule(a),this.addStyles(a.name),this.addStyles(a.contentName),this.addStylesForCaptures(a.captures),this.addStylesForCaptures(a.beginCaptures),this.addStylesForCaptures(a.endCaptures),a._resolvedRule!==a&&b.push(a._resolvedRule),a.patterns)for(var d=0;d<a.patterns.length;d++)b.push(a.patterns[d])}},addStyles:function(b){if(b&&!this._styles[b]){this._styles[b]=[];for(var a=b.split("."),d=0;d<
a.length;d++)this._styles[b].push(a.slice(0,d+1).join("-"))}},addStylesForCaptures:function(b){for(var a in b)b.hasOwnProperty(a)&&this.addStyles(b[a].name)},ContainerRule:function(){function b(a){this.rule=a;this.subrules=a.patterns}b.prototype.valueOf=function(){return"aa"};return b}(),BeginEndRule:function(){function b(a){this.rule=a;this.beginRegex=d.toRegExp(a.begin);this.endRegex=d.toRegExp(a.end);this.subrules=a.patterns||[];this.endRegexHasBackRef=d.hasBackReference(this.endRegex);var b=d.complexCaptures(a.captures),
a=d.complexCaptures(a.beginCaptures)||d.complexCaptures(a.endCaptures);if(this.isComplex=b||a)b=d.groupify(this.beginRegex),this.beginRegex=b[0],this.beginOld2New=b[1],this.beginConsuming=b[2],b=d.groupify(this.endRegex,this.beginOld2New),this.endRegex=b[0],this.endOld2New=b[1],this.endConsuming=b[2]}b.prototype.valueOf=function(){return this.beginRegex};return b}(),MatchRule:function(){function b(a){this.rule=a;this.matchRegex=d.toRegExp(a.match);if(this.isComplex=d.complexCaptures(a.captures))a=
d.groupify(this.matchRegex),this.matchRegex=a[0],this.matchOld2New=a[1],this.matchConsuming=a[2]}b.prototype.valueOf=function(){return this.matchRegex};return b}(),_createTypedRule:function(b){return b.match?new this.MatchRule(b):b.begin?new this.BeginEndRule(b):new this.ContainerRule(b)},_resolve:function(b){var a=b;if(b.include){if(b.begin||b.end||b.match)throw Error('Unexpected regex pattern in "include" rule '+b.include);b=b.include;if(b.charAt(0)==="#"){if(a=this.grammar.repository&&this.grammar.repository[b.substring(1)],
!a)throw Error("Couldn't find included rule "+b+" in grammar repository");}else if(b==="$self")a=this.grammar;else if(b==="$base")throw Error('Include "$base" is not supported');else if(a=this._allGrammars[b],!a)for(var d=0;d<this.externalGrammars.length;d++){var h=this.externalGrammars[d];if(h.scopeName===b){this.preprocess(h);a=this._allGrammars[b]=h;break}}}return a},ContainerNode:function(){function b(a,b){this.parent=a;this.rule=b;this.children=[];this.end=this.start=null}b.prototype.addChild=
function(a){this.children.push(a)};b.prototype.valueOf=function(){var a=this.rule;return"ContainerNode { "+(a.include||"")+" "+(a.name||"")+(a.comment||"")+"}"};return b}(),BeginEndNode:function(){function b(a,b,h){this.parent=a;this.rule=b;this.children=[];this.setStart(h);this.endMatch=this.end=null;this.endRegexSubstituted=b.endRegexHasBackRef?d.getSubstitutedRegex(b.endRegex,h):null}b.prototype.addChild=function(a){this.children.push(a)};b.prototype.getIndexInParent=function(){return this.parent?
this.parent.children.indexOf(this):-1};b.prototype.setStart=function(a){this.start=a.index;this.beginMatch=a};b.prototype.setEnd=function(a){a&&typeof a==="object"?(this.endMatch=a,this.end=a.index+a[0].length):(this.endMatch=null,this.end=a)};b.prototype.shiftStart=function(a){this.start+=a;this.beginMatch.index+=a};b.prototype.shiftEnd=function(a){this.end+=a;this.endMatch&&(this.endMatch.index+=a)};b.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+
"}"};return b}(),push:function(b,a){if(a)for(var d=a.length;d>0;)b.push(a[--d])},exec:function(b,a,d){(a=b.exec(a))&&(a.index+=d);b.lastIndex=0;return a},afterMatch:function(b){return b.index+b[0].length},getEndMatch:function(b,a,d){if(b instanceof this.BeginEndNode){var h=b.rule,b=b.endRegexSubstituted||h.endRegex;return!b?null:this.exec(b,a,d)}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(b){var a=b.addedCharCount,d=b.removedCharCount,b=b.start;if(this._tree){var h=this.textView.getModel(),g=h.getCharCount(),h=h.getLineEnd(h.getLineAtOffset(b)-1),c=this.getFirstDamaged(h,h),h=h===-1?0:h,a=c?this.parse(c,!0,h,b,a,d):g;this.textView.redrawRange(h,a)}else this.initialParse()},getFirstDamaged:function(b,a){if(b<0)return this._tree;for(var d=[this._tree],h=null;d.length;){var g=d.pop();if(!g.parent||this.isDamaged(g,b,a)){g instanceof this.BeginEndNode&&(h=
g);for(var c=0;c<g.children.length;c++)d.push(g.children[c])}}return h||this._tree},isDamaged:function(b,a,d){return b.start<=d&&b.end>a},parse:function(b,a,d,h,g,c){var e=this.textView.getModel(),i=e.getLineStart(e.getLineCount()-1),j=e.getCharCount(),k=this.getInitialExpected(b,d),o=-1;if(a)b.repaired=!0,b.endNeedsUpdate=!0,o=(o=b.children[b.children.length-1])?e.getLineEnd(e.getLineAtOffset(o.end+(g-c))):-1,h=e.getLineEnd(e.getLineAtOffset(h+c)),o=Math.max(o,h);for(var o=o===-1?j:o,h=k,s=b,r=!1,
q=d,t=-1;s&&(!a||q<o);){var m=this.getNextMatch(e,s,q);m||(q=q>=i?j:e.getLineStart(e.getLineAtOffset(q)+1));var u=m&&m.match,z=m&&m.rule,w=m&&m.isEnd;if(m&&m.isSub){if(q=this.afterMatch(u),z instanceof this.BeginEndRule)r=!0,a&&z===h.rule&&s===h.parent?(s=h,s.setStart(u),s.repaired=!0,s.endNeedsUpdate=!0,h=this.getNextExpected(h,"begin")):(a&&(this.prune(s,h),a=!1),u=new this.BeginEndNode(s,z,u),s.addChild(u),s=u)}else if(w||q===j){if(s instanceof this.BeginEndNode)u?(r=!0,t=Math.max(t,s.end),s.setEnd(u),
q=this.afterMatch(u),a&&s===h&&s.parent===h.parent?(s.repaired=!0,delete s.endNeedsUpdate,h=this.getNextExpected(h,"end")):a&&(this.prune(s,h),a=!1)):(s.setEnd(j),delete s.endNeedsUpdate);s=s.parent}a&&q>=o&&!r&&(this.prune(b,k),a=!1)}this.removeUnrepairedChildren(b,a,d);this.cleanup(a,b,d,o,j,g,c);return a?Math.max(t,q):q},removeUnrepairedChildren:function(b,a,d){if(a){for(var a=b.children,h=-1,g=0;g<a.length;g++){var c=a[g];if(!c.repaired&&this.isDamaged(c,d,Number.MAX_VALUE)){h=g;break}}if(h!==
-1)b.children.length=h}},cleanup:function(b,a,d,h,g,c,e){if(b){b=c-e;g=this.getIntersecting(h-b+1,g);a=this.getIntersecting(d,h);for(d=0;d<g.length;d++)h=g[d],!h.repaired&&h instanceof this.BeginEndNode&&(h.shiftEnd(b),h.shiftStart(b));for(d=0;d<a.length;d++)h=a[d],h.repaired&&h.endNeedsUpdate&&h.shiftEnd(b),delete h.endNeedsUpdate,delete h.repaired}else{a=this.getIntersecting(d,h);for(d=0;d<a.length;d++)delete a[d].repaired}},getNextMatch:function(b,a,d,h){var g=b.getLineAtOffset(d),g=b.getLineEnd(g),
c=b.getText(d,g),e=[],i=[],b=[],g=[];for(this.push(e,a.rule.subrules);e.length;){var j=e.length?e.pop():null,j=j&&j._resolvedRule._typedRule;if(j instanceof this.ContainerRule&&i.indexOf(j)===-1)i.push(j),this.push(e,j.subrules);else if(!j||!h||j.matchRegex){var k=j&&this.exec(j.matchRegex||j.beginRegex,c,d);k&&(b.push(k),g.push(j))}}e=Number.MAX_VALUE;i=-1;for(j=0;j<b.length;j++)if(k=b[j],k.index<e)e=k.index,i=j;if(!h&&(d=this.getEndMatch(a,c,d)))if(h=a.rule.applyEndPatternLast,i===-1||d.index<e||
!h&&d.index===e)return{isEnd:!0,rule:a.rule,match:d};return i===-1?null:{isSub:!0,rule:g[i],match:b[i]}},getInitialExpected:function(b,a){var d,h;if(b===this._tree)for(d=0;d<b.children.length;d++){if(h=b.children[d],h.start>=a)return h}else if(b instanceof this.BeginEndNode&&b.endMatch){var g=b.endMatch.index;for(d=0;d<b.children.length;d++)if(h=b.children[d],h.start>=a)break;if(h&&h.start<g)return h}return b},getNextExpected:function(b,a){if(a==="begin"){var d=b.children[0];return d?d:b}else if(a===
"end"&&(d=b.parent)){var h=d.children[d.children.indexOf(b)+1];return h?h:d}return null},prune:function(b,a){if(a.parent===b)b.children.length=a.getIndexInParent();else if(b instanceof this.BeginEndNode)b.endMatch=null,b.end=null;if(b.parent)b.parent.children.length=b.getIndexInParent()+1},onLineStyle:function(b){this._tree||this.initialParse();var a=b.lineStart,d=this.textView.getModel(),h=d.getLineEnd(b.lineIndex),g=d.getLineEnd(d.getLineAtOffset(a)-1),g=this.getFirstDamaged(g,g),a=this.getLineScope(d,
g,a,h);b.ranges=this.toStyleRanges(a);b.ranges.sort(function(a,b){return a.start-b.start})},getLineScope:function(b,a,d,h){for(var g=d,c=this.getInitialExpected(a,d),e=[],i=[];a&&g<h;){var j=this.getNextMatch(b,a,g);if(!j)break;var k=j&&j.match,o=j&&j.rule,s=j&&j.isSub,j=j&&j.isEnd;k.index!==g&&i.push({start:g,end:k.index,node:a});if(s)g=this.afterMatch(k),o instanceof this.BeginEndRule?(this.addBeginScope(e,k,o),a=c,c=this.getNextExpected(c,"begin")):this.addMatchScope(e,k,o);else if(j)g=this.afterMatch(k),
this.addEndScope(e,k,o),c=this.getNextExpected(c,"end"),a=a.parent}g<h&&i.push({start:g,end:h,node:a});b=this.getInheritedLineScope(i,d,h);return e.concat(b)},getInheritedLineScope:function(b){for(var a=[],d=0;d<b.length;d++)for(var h=b[d],g=h.node;g;){var c=g.rule.rule,e=c.name;if(c=c.contentName||e){this.addScopeRange(a,h.start,h.end,c);break}g=g.parent}return a},addBeginScope:function(b,a,d){var h=d.rule;this.addCapturesScope(b,a,h.beginCaptures||h.captures,d.isComplex,d.beginOld2New,d.beginConsuming)},
addEndScope:function(b,a,d){var h=d.rule;this.addCapturesScope(b,a,h.endCaptures||h.captures,d.isComplex,d.endOld2New,d.endConsuming)},addMatchScope:function(b,a,d){var h=d.rule,g=h.name;(h=h.captures)?this.addCapturesScope(b,a,h,d.isComplex,d.matchOld2New,d.matchConsuming):this.addScope(b,a,g)},addScope:function(b,a,d){d&&b.push({start:a.index,end:this.afterMatch(a),scope:d})},addScopeRange:function(b,a,d,h){h&&b.push({start:a,end:d,scope:h})},addCapturesScope:function(b,a,d,h,g,c){if(d)if(h){for(var h=
{1:0},e=0,i=1;a[i]!==void 0;i++)c[i]!==void 0&&(e+=a[i].length),a[i+1]!==void 0&&(h[i+1]=e);c=a.index;for(e=1;d[e];e++){var i=d[e].name,j=g[e],k=c+h[j];typeof a[j]!=="undefined"&&this.addScopeRange(b,k,k+a[j].length,i)}}else this.addScope(b,a,d[0]&&d[0].name)},getIntersecting:function(b,a){for(var d=[],h=this._tree?[this._tree]:[];h.length;){var g=h.pop(),c=!1;g instanceof this.ContainerNode?c=!0:this.isDamaged(g,b,a)&&(c=!0,d.push(g));if(c)for(var c=g.children.length,e=0;e<c;e++)h.push(g.children[e])}return d.reverse()},
toStyleRanges:function(b){for(var a=[],d=0;d<b.length;d++){var h=b[d],g=this._styles[h.scope];if(!g)throw Error("styles not found for "+h.scope);g=g.join(" ");a.push({start:h.start,end:h.end,style:{styleClass:g}})}return a}};return{RegexUtil:d,TextMateStyler:i}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(j,k){function i(a){return a.getProperty("objectClass").indexOf(b)!==-1&&a.getProperty("type")==="highlighter"}function d(a,b,d){this.initialize(a,b,d);this.lineStyles=[]}var b="orion.edit.highlighter",a=b+" service must be an event emitter";k.AnnotationType.registerType("orion.annotation.highlightError",{title:j.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}});
d.prototype={initialize:function(a,d,g){this.textView=a;this.serviceRegistry=d;this.annotationModel=g;this.services=[];var c=this;this.listener={onModelChanging:function(a){c.onModelChanging(a)},onModelChanged:function(a){c.onModelChanged(a)},onDestroy:function(a){c.onDestroy(a)},onLineStyle:function(a){c.onLineStyle(a)},onStyleReady:function(a){c.onStyleReady(a)},onServiceAdded:function(a){c.onServiceAdded(a.serviceReference,c.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){c.onServiceRemoved(a.serviceReference,
c.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);d.addEventListener("registered",this.listener.onServiceAdded);d.addEventListener("unregistering",this.listener.onServiceRemoved);a=d.getServiceReferences(b);for(g=0;g<a.length;g++){var e=a[g];i(e)&&this.addServiceListener(d.getService(e))}},
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,d=-1,c=this.textView.getModel(),e;for(e in b)b.hasOwnProperty(e)&&(this.lineStyles[e]=b[e],a=Math.min(a,e),d=Math.max(d,e));a=Math.max(a,0);d=Math.min(d,c.getLineCount());if(b=this.annotationModel){for(var i=b.getAnnotations(c.getLineStart(a),c.getLineEnd(d)),j=[];i.hasNext();){var p=i.next();p.type==="orion.annotation.highlightError"&&j.push(p)}i=[];for(p=a;p<=d;p++){e=p;var o=this.lineStyles[e],o=o&&o.errors;e=c.getLineStart(e);
if(o)for(var s=0;s<o.length;s++){var r=o[s];i.push(k.AnnotationType.createAnnotation("orion.annotation.highlightError",r.start+e,r.end+e))}}b.replaceAnnotations(j,i)}this.textView.redrawLines(a,d+1)},onLineStyle:function(a){function b(a,d){for(var f=a.length,g=[],h=0;h<f;h++){var i=a[h];g.push({start:i.start+d,end:i.end+d,style:i.style})}return g}var d=this.lineStyles[a.lineIndex];if(d)if(d.ranges)a.ranges=b(d.ranges,a.lineStart);else if(d.style)a.style=d.style},_getEmptyStyle:function(a){for(var b=
[],d=0;d<a;d++)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 d=this.serviceRegistry.getService("orion.page.progress");d?d.progress(b.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):b.setContentType(this.contentType)}}},onServiceAdded:function(a,b){i(a)&&this.addServiceListener(b)},onServiceRemoved:function(a,
b){this.services.indexOf(b)!==-1&&this.removeServiceListener(b)},addServiceListener:function(b){if(typeof b.addEventListener==="function"){if(b.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(b),b.setContentType&&this.contentType){var d=this.serviceRegistry.getService("orion.page.progress");d?d.progress(b.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):b.setContentType(this.contentType)}}else typeof console!==
"undefined"&&console.log(Error(a))},removeServiceListener:function(b){typeof b.removeEventListener==="function"?(b.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),b=this.services.indexOf(b),b!==-1&&this.services.splice(b,1)):typeof console!=="undefined"&&console.log(Error(a))}};return d});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(j,k,i,d){function b(a,b,g,c,e,l,n){function p(a,c){var e=a.getProperty("contentType"),f=a.getProperty("fileTypes");if(e)return b.isSomeExtensionOf(g,e).then(function(b){return b?a:null});else if(c&&f&&f.indexOf(c)!==-1)return e=new d,e.resolve(a),e;return null}var o=function(a){var b=null;switch(a&&a.id){case "application/javascript":case "application/json":b=
new j.TextStyler(c,"js",e);break;case "text/x-java-source":b=new j.TextStyler(c,"java",e);break;case "text/css":b=new j.TextStyler(c,"css",e)}return b}(g);if(o)return l=new d,l.resolve(o),l;for(var o=l&&l.split(".").pop().toLowerCase(),l=a.getServiceReferences("orion.edit.highlighter"),s=[],r=[],q=0;q<l.length;q++){var t=l[q];t.getProperty("type")==="grammar"&&s.push(t.getProperty("grammar"));(t=p(t,o))&&r.push(t)}return d.all(r,function(a){return{_error:a}}).then(function(b){for(var d,h=b.length-
1;h>=0;h--){var j=b[h];if(j&&!j._error&&(n||j.getProperty("type")!=="highlighter")){d=j;break}}var l;if(d)if(b=d.getProperty("type"),b==="highlighter")l=new i(c,a,e),l.setContentType(g);else if(b==="grammar"||typeof b==="undefined")d=d.getProperty("grammar"),l=new k.TextMateStyler(c,d,s);return l})}function a(a){this.serviceRegistry=a;this.styler=null}a.prototype={setup:function(a,d,g,c,e){e=typeof e==="undefined"?!0:e;if(this.styler)this.styler.destroy&&this.styler.destroy(),this.styler=null;var i=
this;return b(this.serviceRegistry,this.serviceRegistry.getService("orion.core.contenttypes"),a,d,g,c,e).then(function(a){return i.styler=a})},getStyler:function(){return this.styler}};return{createStyler:b,SyntaxHighlighter:a}});
define("orion/searchExplorer","i18n!orion/search/nls/messages,require,orion/Deferred,orion/webui/littlelib,orion/contentTypes,orion/i18nUtil,orion/explorers/explorer,orion/explorers/explorerNavHandler,orion/fileClient,orion/commands,orion/searchUtils,orion/globalSearch/search-features,orion/compare/compareUIFactory,orion/compare/compareView,orion/highlight,orion/explorers/navigationUtils,orion/webui/tooltip".split(","),function(j,k,i,d,b,a,f,h,g,c,e,l,n,p,o,s,r){function q(a){(a=d.node(a))&&d.empty(a);
return a}function t(a,b,c){(a=d.node(a))&&a.addEventListener(b,c,!1)}function m(a,b,c){if(b=d.node(b))c==="only"&&d.empty(b),b.appendChild(a)}function u(a,b,c,e){a=document.createElement(a);if(b)if(Array.isArray(b))for(var f=0;f<b.length;f++)a.classList.add(b[f]);else if(typeof b==="string")a.className=b;if(c)a.id=c;(b=d.node(e))&&b.appendChild(a);return a}function z(a,b,c,d,e){a=u("a",a,b,d);a.href=c;e&&a.appendChild(document.createTextNode(e));return a}function w(a,b,c,d){a=u("span",a,b,c);d&&a.appendChild(document.createTextNode(d));
return a}function v(a){return!a?null:a.type==="file"?a:a.parent}function D(a){return typeof a.getValidFileList==="function"?a.getValidFileList():a.getListRoot().children}function B(a,b){this._init(a);this.explorer=b}function E(a,b){this._init(a);this.options=a;this.explorer=b}function C(a,b,c){this.parentId=a;this.reportList=b;this.resultModel=c;this.renderer=new E({checkbox:!1},this)}function A(a){this._syntaxHighlither=new o.SyntaxHighlighter(a)}function x(a,b){this.registry=a;this._commandService=
b;this.fileClient=new g.FileClient(this.registry);this.defaulRows=40;this.declareCommands()}B.prototype=new f.SelectionRenderer;B.prototype.initCheckboxColumn=function(){if(this._useCheckboxSelection){var a=u("th"),b=u("span",null,null,a);b.classList.add("selectionCheckmarkSprite");b.classList.add("core-sprite-check");if(this.getCheckedFunc)b.checked=this.getCheckedFunc(this.explorer.model.getListRoot()),b.classList.toggle("core-sprite-check_on");t(b,"click",function(a){this.onCheck(null,a.target,
a.target.checked?!1:!0)}.bind(this));return a}};B.prototype.getCellHeaderElement=function(a){if(a>2)return null;var b,c;if(a!==0){b=u("th");c=u("h2","search_header",null,b);if(a===1)c.textContent=typeof this.explorer.model.getHeaderString==="function"?this.explorer.model.getHeaderString():j.Results;else if(a===2)c.textContent=j.Location;return b}else return u("th")};B.prototype.focus=function(){var a=d.node(this.explorer.getParentDivId());window.setTimeout(function(){a.focus()},10)};B.prototype.staleFileElement=
function(a,b){if(a.stale){var c=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null;s.removeNavGrid(c,d.node(this.getItemLinkId(a)));c=d.node(this.getFileSpanId(a));q(c);m(document.createTextNode(b?b:this.explorer.model.getFileName(a)),c,"last");c=d.node(this.getFileIconId(a));q(c)}else this.explorer._prepareFilter(a)};B.prototype.replaceFileElement=function(a){var b=a.totalMatches?this.explorer.model.getFileName(a)+" ("+a.totalMatches+" matches)":this.explorer.model.getFileName(a)+
" ("+j["No matches"]+")";a.totalMatches?(a=d.node(this.getItemLinkId(a)),m(document.createTextNode(b),a,"only")):(a.stale=!0,this.staleFileElement(a,b))};B.prototype.replaceDetailIcon=function(a,b){if(!this.explorer.model.replaceMode()&&a&&a.type==="detail"){var c=d.node(this.getDetailIconId(a));c&&(q(c),c=w(null,null,c),c.classList.add("imageSprite"),b==="right"?c.classList.add("core-sprite-rightarrow"):b==="left"?c.classList.add("core-sprite-leftarrow"):c.classList.add("core-sprite-none"))}};B.prototype.renderFileElement=
function(a,b,c){var d=null;this.explorer.model._provideSearchHelper&&(d=this.explorer.model._provideSearchHelper());d=a.linkLocation+(d?e.generateFindURLBinding(d.params,d.inFileQuery,null,d.params.replace):"");b=z("navlink",this.getItemLinkId(a),d,b,this.explorer.model._filterText?null:c);s.addNavGrid(this.explorer.getNavDict(),a,b);if(this.explorer.model._filterText){var a=u("span",null,null,b),b=e.searchOnelineLiteral({searchStr:this.explorer.model._filterText.toLowerCase(),searchStrLength:this.explorer.model._filterText.length},
c.toLowerCase(),!1),f=[];f.push({name:c,startIndex:0,bold:!1,highlight:!1});b&&b.forEach(function(a){f=this._mergesingleSegment(f,{start:a.startIndex,end:a.startIndex+a.length})}.bind(this));this._renderSegments(f,a)}};B.prototype.generateContextTip=function(a){for(var b=u("table"),c=0;c<a.context.length;c++){var d=u("tr",null,null,b);a.context[c].current?(d=u("td",null,null,d),d.noWrap=!0,d=u("span",null,null,d),this.generateDetailHighlight(a,d)):(d=u("td",null,null,d),d.noWrap=!0,d.textContent=
a.context[c].context+"\u00a0")}return b};B.prototype._generateDetailSegments=function(a){for(var b=0,c=[],d=0;d<a.matches.length;d++){if(b>=a.lineString.length)break;if(!(this.explorer.model.replaceMode()&&d!==a.matchNumber)&&(b!==a.matches[d].startIndex&&c.push({name:a.lineString.substring(b,a.matches[d].startIndex),startIndex:b,bold:!1,highlight:!1}),b=a.matches[d].length,c.push({name:a.lineString.substring(a.matches[d].startIndex,a.matches[d].startIndex+b),startIndex:a.matches[d].startIndex,bold:!0,
highlight:!1}),b=a.matches[d].startIndex+b,this.explorer.model.replaceMode()))break}b<a.lineString.length-1&&c.push({name:a.lineString.substring(b),startIndex:b,bold:!1,highlight:!1});return c};B.prototype._mergesingleSegment=function(a,b){var c=[];a.forEach(function(a){var d=a.startIndex,e=a.startIndex+a.name.length;b.start>d&&b.end<e?(c.push({name:a.name.substring(0,b.start-d),startIndex:a.startIndex,bold:a.bold,highlight:!1}),c.push({name:a.name.substring(b.start-d,b.end-d),startIndex:b.start,
bold:a.bold,highlight:!0}),c.push({name:a.name.substring(b.end-d),startIndex:b.end,bold:a.bold,highlight:!1})):b.start>d&&b.start<e?(c.push({name:a.name.substring(0,b.start-d),startIndex:a.startIndex,bold:a.bold,highlight:!1}),c.push({name:a.name.substring(b.start-d),startIndex:b.start,bold:a.bold,highlight:!0})):d>=b.start&&e<=b.end?(a.highlight=!0,c.push(a)):b.end>d&&b.end<e?(c.push({name:a.name.substring(0,b.end-d),startIndex:a.startIndex,bold:a.bold,highlight:!0}),c.push({name:a.name.substring(b.end-
d),startIndex:b.end,bold:a.bold,highlight:!1})):c.push(a)}.bind(this));return c};B.prototype._mergeFilteredSegments=function(a,b){if(!this.explorer.model._filterText)return a;var c=e.searchOnelineLiteral({searchStr:this.explorer.model._filterText.toLowerCase(),searchStrLength:this.explorer.model._filterText.length},b.toLowerCase(),!1),d=a;c&&c.forEach(function(a){d=this._mergesingleSegment(d,{start:a.startIndex,end:a.startIndex+a.length})}.bind(this));return d};B.prototype._renderSegments=function(a,
b){a.forEach(function(a){var c=a.bold?u("b",null,null,b):u("span",null,null,b);a.highlight&&c.classList.add("search-filter-text");m(document.createTextNode(a.name),c,"only")}.bind(this))};B.prototype.generateDetailHighlight=function(a,b,c){var a=this.explorer.model.getDetailInfo(a),d=this._generateDetailSegments(a);c&&(d=this._mergeFilteredSegments(d,a.lineString));this._renderSegments(d,b)};B.prototype.renderDetailElement=function(a,b,c,d){b=this.getDetailElement(a,b,c);d&&this.renderDetailLineNumber(a,
b);this.generateDetailHighlight(a,b,!0)};B.prototype.renderDetailLineNumber=function(a,b){var c=this.explorer.model.getDetailInfo(a),d=c.lineNumber+1;!this.explorer.model.replaceMode()||c.matches.length<=1?m(document.createTextNode(d+":"),b,"last"):m(document.createTextNode(d+"("+(c.matchNumber+1)+"):"),b,"last")};B.prototype.getDetailElement=function(a,b,c){var d=this,b=null;this.explorer.model._provideSearchHelper&&(b=this.explorer.model._provideSearchHelper());b=a.parent.linkLocation+(b?e.generateFindURLBinding(b.params,
b.inFileQuery,a.lineNumber,b.params.replace):"");c=z("navlink",this.getItemLinkId(a),b,c);s.addNavGrid(this.explorer.getNavDict(),a,c);t(c,"click",function(){d.explorer.getNavHandler().cursorOn(a)});return u("span",null,null,c)};B.prototype.getRowActionElement=function(a){return d.node(this.getItemLinkId(a))};B.prototype.getLocationSpanId=function(a){return this.explorer.model.getId(a)+"_locationSpan"};B.prototype.getFileSpanId=function(a){return this.explorer.model.getId(a)+"_fileSpan"};B.prototype.getFileIconId=
function(a){return this.explorer.model.getId(a)+"_fileIcon"};B.prototype.getItemLinkId=function(a){return typeof a==="string"?a+"_itemLink":this.explorer.model.getId(a)+"_itemLink"};B.prototype.getDetailIconId=function(a){return this.explorer.model.getId(a)+"_detailIcon"};B.prototype.renderLocationElement=function(a,b){var c=b?b:d.node(this.getLocationSpanId(a));q(c);var f=this.explorer.model.getScopingParams(a),c=z("navlinkonpage",null,f.href,c,this.explorer.model._filterText?null:f.name);c.title=
f.tooltip;s.addNavGrid(this.explorer.getNavDict(),a,c);var g=this;t(c,"click",function(){g.explorer.closeContextTip()});if(this.explorer.model._filterText){var c=u("span",null,null,c),h=e.searchOnelineLiteral({searchStr:this.explorer.model._filterText.toLowerCase(),searchStrLength:this.explorer.model._filterText.length},f.name.toLowerCase(),!1),i=[];i.push({name:f.name,startIndex:0,bold:!1,highlight:!1});h&&h.forEach(function(a){i=this._mergesingleSegment(i,{start:a.startIndex,end:a.startIndex+a.length})}.bind(this));
this._renderSegments(i,c)}};B.prototype.getPrimColumnStyle=function(){return"search_primaryColumn"};B.prototype.getSecondaryColumnStyle=function(){return"search_secondaryColumn"};B.prototype.getCellElement=function(a,b,c){var d;switch(a){case 0:return a=u("td"),b.type==="file"?(a.noWrap=!0,d=w(null,this.getFileIconId(b),a,null),this.explorer.model._provideSearchHelper&&this.explorer.model._provideSearchHelper().params.keyword===""?(b=w(null,null,a,null),b.classList.add("imageSprite"),b.classList.add("core-sprite-file")):
this.getExpandImage(c,d,"core-sprite-file")):(d=w(null,null,a,null),a.noWrap=!0,a.align="right",this.renderDetailLineNumber(b,d)),a;case 1:return a=u("td"),d=w(null,this.getFileSpanId(b),a,null),b.type==="file"?(c=b.totalMatches?this.explorer.model.getFileName(b)+" ("+b.totalMatches+" matches)":this.explorer.model.getFileName(b),this.renderFileElement(b,d,c)):(this.renderDetailElement(b,c,d),b=w(null,this.getDetailIconId(b),d,null),b=w(null,null,b,null),b.classList.add("imageSprite"),b.classList.add("core-sprite-none")),
a;case 2:return a=u("td"),b.type==="file"&&(d=w(null,this.getLocationSpanId(b),a,null),b.parentLocation&&this.renderLocationElement(b,d)),a}};B.prototype.constructor=B;E.prototype=new f.SelectionRenderer;E.prototype.getCellHeaderElement=function(a){switch(a){case 0:a=u("th","search_report",null,null);a=u("h2",null,null,a);a.textContent=j["Files replaced"];break;case 1:a=u("th","search_report",null,null),a=u("h2",null,null,a),a.textContent=j.Status}};E.prototype.getCellElement=function(b,c){switch(b){case 0:var d=
u("td","search_report",null,null),e=u("div",null,null,d),f=u("span","primaryColumn",null,e);m(document.createTextNode(c.model.fullPathName+"/"+this.explorer.resultModel.getFileName(c.model)),f,"only");t(f,"click",function(){window.open(c.model.linkLocation)});t(f,"mouseover",function(){f.style.cursor="pointer"});t(f,"mouseout",function(){f.style.cursor="default"});e=u("span",null,null,e);e.classList.add("imageSprite");if(c.status)switch(c.status){case "warning":e.classList.add("core-sprite-warning");
break;case "failed":e.classList.add("core-sprite-error");break;case "pass":e.classList.add("core-sprite-ok")}return d;case 1:if(c.status){switch(c.status){case "warning":d=c.message;break;case "failed":d=c.message;break;case "pass":d=c.model.totalMatches?a.formatMessage(j["${0} out of ${1}  matches replaced."],c.matchesReplaced,c.model.totalMatches):c.message}e=u("td","search_report",null,null);e.textContent=d;return e}}};E.prototype.constructor=E;C.prototype=new f.Explorer;C.prototype.report=function(){this.createTree(this.parentId,
new f.ExplorerFlatModel(null,null,this.reportList))};C.prototype.constructor=C;A.prototype={highlight:function(a,b,c){return this._syntaxHighlither.setup(b,c.getTextView(),null,a,!1)}};x.prototype=new f.Explorer;x.prototype.onchange=function(){};x.prototype.setResult=function(a,b){var c=this;this.parentNode=a;this.model=b;this.model.replaceMode()?(this.checkbox=this._hasCheckedItems=!0,this.renderer=new B({checkbox:!0,highlightSelection:!1,getCheckedFunc:function(a){return c.getItemChecked(a)},onCheckedFunc:function(a,
b,d){c.onRowChecked(a,b,d)}},c)):(this.checkbox=!1,this.renderer=new B({checkbox:!1,highlightSelection:!1},this));this._reporting=!1;this._currentPreviewModel=this._uiFactory=null;this._currentReplacedContents={contents:null};this._popUpContext=!1;this.timerRunning-=0;this.twoWayCompareView=this._filterTimer=this._timer=null};x.prototype.declareCommands=function(){var a=this,b=new c.Command({name:j["Apply Changes"],tooltip:j["Replace all selected matches"],id:"orion.globalSearch.replaceAll",callback:function(){a.replaceAll()},
visibleWhen:function(){return a.model&&a.model.replaceMode()&&!a._reporting&&a._hasCheckedItems}}),d=new c.Command({name:j["Hide Compare"],tooltip:j["Hide compare view of changes"],id:"orion.globalSearch.hideCompare",callback:function(){a.toggleCompare(!1)},visibleWhen:function(){return a.model&&a.model.replaceMode()&&!a._reporting&&a._uiFactory}}),g=new c.Command({name:j["Show Compare"],tooltip:j["Show compare view of changes"],id:"orion.globalSearch.showCompare",callback:function(){a.toggleCompare(!0)},
visibleWhen:function(){return a.model&&a.model.replaceMode()&&!a._reporting&&!a._uiFactory}});this._commandService.addCommand(d);this._commandService.addCommand(g);this._commandService.addCommand(b);this._commandService.addCommandGroup("pageActions","orion.searchActions.unlabeled",200);this._commandService.registerCommandContribution("pageActions","orion.globalSearch.hideCompare",1,"orion.searchActions.unlabeled");this._commandService.registerCommandContribution("pageActions","orion.globalSearch.showCompare",
2,"orion.searchActions.unlabeled");this._commandService.registerCommandContribution("pageActions","orion.globalSearch.replaceAll",3,"orion.searchActions.unlabeled");var b=new c.Command({name:j["Show All"],tooltip:j["Show all the results in one page"],id:"orion.search.showAll",hrefCallback:function(){if(!this.model._provideSearchHelper)return null;var a=e.copySearchParams(this.model._provideSearchHelper().params,!0);a.start=0;a.rows=this.model.getPagingParams().totalNumber;return e.generateSearchHref(a)}.bind(this),
visibleWhen:function(){var a=this.model.getPagingParams();return a.totalNumber>a.rows}.bind(this)}),d=new c.Command({name:j["< Previous Page"],tooltip:j["Show previous page of search result"],id:"orion.search.prevPage",hrefCallback:function(){if(!a.model._provideSearchHelper)return null;var b=a.caculatePrevPage(),c=e.copySearchParams(a.model._provideSearchHelper().params,!0);c.start=b.start;return e.generateSearchHref(c)},visibleWhen:function(){return a.caculatePrevPage().start!==a.model.getPagingParams().start}}),
g=new c.Command({name:j["Next Page >"],tooltip:j["Show next page of search result"],id:"orion.search.nextPage",hrefCallback:function(){if(!a.model._provideSearchHelper)return null;var b=a.caculateNextPage(),c=e.copySearchParams(a.model._provideSearchHelper().params,!0);c.start=b.start;return e.generateSearchHref(c)},visibleWhen:function(){return a.caculateNextPage().start!==a.model.getPagingParams().start}}),h=new c.Command({tooltip:j["Next result"],imageClass:"core-sprite-move_down",id:"orion.search.nextResult",
groupId:"orion.searchGroup",visibleWhen:function(){return!a._reporting},callback:function(){a.gotoNext(!0,!0)}}),i=new c.Command({tooltip:j["Previous result"],imageClass:"core-sprite-move_up",id:"orion.search.prevResult",groupId:"orion.searchGroup",visibleWhen:function(){return!a._reporting},callback:function(){a.gotoNext(!1,!0)}});this._commandService.addCommand(b);this._commandService.addCommand(d);this._commandService.addCommand(g);this._commandService.addCommand(h);this._commandService.addCommand(i);
f.createExplorerCommands(this._commandService,function(b){var c=!1;a.model._provideSearchHelper&&a.model._provideSearchHelper().params.keyword===""&&(c=!0);return!b._reporting&&!c});this._commandService.registerCommandContribution("pageNavigationActions","orion.explorer.expandAll",1);this._commandService.registerCommandContribution("pageNavigationActions","orion.explorer.collapseAll",2);this._commandService.registerCommandContribution("pageNavigationActions","orion.search.nextResult",3);this._commandService.registerCommandContribution("pageNavigationActions",
"orion.search.prevResult",4);this._commandService.registerCommandContribution("pageNavigationActions","orion.search.showAll",5);this._commandService.registerCommandContribution("pageNavigationActions","orion.search.prevPage",6);this._commandService.registerCommandContribution("pageNavigationActions","orion.search.nextPage",7)};x.prototype._checkStale=function(a){return this.registry.getService("orion.page.progress").progress(this.fileClient.read(a.location),"Checing file "+a.location+" for stale").then(function(b){if(this.model.staleCheck(b))a.stale=
!1}.bind(this),function(a){console.error("Error loading file contents: "+a.message);throw a;}.bind(this))};x.prototype.staleCheck=function(){var a=[];D(this.model).forEach(function(b){a.push(this._loadFileMetaData(b))}.bind(this));return i.all(a,function(a){return{_error:a}})};x.prototype._loadFileMetaData=function(a){return this.registry.getService("orion.page.progress").progress(this.fileClient.read(a.location,!0),"Getting file metadata "+a.location).then(function(b){a.fullPathName=e.fullPathNameByMeta(b.Parents);
a.parentLocation=b.Parents[0].Location;a.stale=a.lastModified!==b.LocalTimeStamp;a.ETag=b.ETag;if(a.stale)return this._checkStale(a).then(function(){this.renderer.staleFileElement(a)}.bind(this));else this._prepareFilter(a);return a}.bind(this),function(b){console.error("Error loading file metadata: status "+b.status);a.stale=!0;this.renderer.staleFileElement(a);throw b;}.bind(this))};x.prototype.setCrawling=function(a){this._crawling=a};x.prototype.preview=function(){var a=this;this._commandService.openParameterCollector("pageActions",
function(b){var c=u("input",null,"globalSearchReplaceWith",b);c.type="text";c.name="ReplaceWith:";c.placeholder="Replace With";c.onkeydown=function(b){if(b.keyCode===13)return b=d.node("globalSearchReplaceWith"),a._commandService.closeParameterCollector(),a._doPreview(b.value);if(b.keyCode===27)return a._commandService.closeParameterCollector(),!1};u("span","parameters","globalSearchReplaceCommands",b);return c});var b=document.getElementById("globalSearchReplaceWith");b.value=this.model.defaultReplaceStr;
window.setTimeout(function(){b.select();b.focus()},10);this._commandService.addCommand(new c.Command({name:"Preview Changes",image:k.toUrl("images/replaceAll.gif"),id:"orion.globalSearch.innerReplaceAll",groupId:"orion.searchGroup",callback:function(){var b=d.node("globalSearchReplaceWith");a._commandService.closeParameterCollector();return a._doPreview(b.value)}}));this._commandService.registerCommandContribution("globalSearchReplaceCommands","orion.globalSearch.innerReplaceAll",1);this._commandService.renderCommands("globalSearchReplaceCommands",
"globalSearchReplaceCommands",this,this,"button")};x.prototype._fileExpanded=function(a,b){var c=D(this.model)[a];if(b===null||b===void 0)return{childrenNumber:0,childDiv:d.node(this.model.getId(c))};return c.children&&c.children.length>0?(b<0?b=c.children.length-1:b>=c.children.length&&(b=0),{childrenNumber:c.children.length,childDiv:d.node(this.model.getId(c.children[b]))}):{childrenNumber:0,childDiv:null}};x.prototype._doPreview=function(a,b){if(this.model._provideSearchHelper){this.model._storeGlobalStatus&&
this.model._storeGlobalStatus(a);var c=e.copySearchParams(this.model._provideSearchHelper().params,!0);c.replace=a;if(b)c.start=0,c.rows=this.model.getPagingParams().totalNumber;c=e.generateSearchHref(c);window.location.href=c}};x.prototype.searchAgain=function(){if(this.model._provideSearchHelper){var a=e.copySearchParams(this.model._provideSearchHelper().params,!0);a.replace=null;if(a.rows>this.defaulRows)a.rows=this.defaulRows;a=e.generateSearchHref(a);a===window.location.href?window.location.reload():
window.location.href=a}};x.prototype.replaceAll=function(){var a=[],b=this;this._reporting=!0;this.initCommands();this.reportStatus(j["Writing files..."]);this.model.writeReplacedContents(a).then(function(){q(b.getParentDivId());(new C(b.getParentDivId(),a,b.model)).report();b.reportStatus("")})};x.prototype.toggleCompare=function(a){this.replacePreview(!1,a)};x.prototype.replacePreview=function(a,b){q(this.getParentDivId());b?(this._uiFactory=new l.SearchUIFactory({parentDivID:this.getParentDivId()}),
this._uiFactory.buildUI()):(this._uiFactory&&this._uiFactory.destroy(),this._uiFactory=null);this._currentPreviewModel=this.twoWayCompareView=null;this.initCommands();a&&this.reportStatus(j["Preparing preview..."]);var c=this;this.createTree(this._uiFactory?this._uiFactory.getMatchDivID():this.getParentDivId(),this.model,{selectionPolicy:"cursorOnly",indent:0,onCollapse:function(a){c.onCollapse(a)}});a?(this.gotoCurrent(this.model.restoreLocationStatus?this.model.restoreLocationStatus():null),this.reportStatus(""),
!this._crawling&&this.model.staleCheck&&this.staleCheck().then(function(){c.refreshValidFiles()})):this.gotoCurrent(this.model.restoreLocationStatus?this.model.restoreLocationStatus():null)};x.prototype.getItemChecked=function(a){if(a.checked===void 0)a.checked=!0;return a.checked};x.prototype._checkedItem=function(){for(var a=D(this.model),b=0;b<a.length;b++){if(a[b].checked)return!0;if(a[b].children)for(var c=0;c<a[b].children.length;c++)if(a[b].children[c].checked)return!0}return!1};x.prototype.onRowChecked=
function(a,b,c){if(a){if((a=d.node(a))&&a._item)this.onItemChecked(a._item,b,c);a=this._checkedItem()}else a=b,this.onItemChecked(this.model.getListRoot(),b,c);if(a!==this._hasCheckedItems)this._hasCheckedItems=a,this.initCommands()};x.prototype.onNewContentChanged=function(a){a===v(this.getNavHandler().currentModel())&&this.buildPreview(!0)};x.prototype.onItemChecked=function(a,b,c){a.checked=b;if(a.type==="file"||a===this.model.getListRoot()){if(a.children)for(c=0;c<a.children.length;c++){var e=
d.node(this.renderer.getCheckBoxId(this.model.getId(a.children[c])));if(e)this.renderer.onCheck(null,e,b,!1);else a.children[c].checked=b}if(a.type==="file")this.onNewContentChanged(a)}else if(c)this.onNewContentChanged(a.parent)};x.prototype.buildPreview=function(c){if(this._uiFactory&&D(this.model).length!==0){var d=this._uiFactory,e=v(this.getNavHandler().currentModel());this._currentPreviewModel=e;var f=this;this.model.provideFileContent(e,function(e){if(f.model.onMatchNumberChanged)f.model.onMatchNumberChanged(e);
f.model.getReplacedFileContent(f._currentReplacedContents,c,e);var g=f._currentReplacedContents.contents;Array.isArray(g)&&(g=f._currentReplacedContents.contents.join(f._currentReplacedContents.lineDelim));var h=new b.ContentTypeService(f.registry),i=f.model.getFileName(e),h=h.getFilenameContentType(i),e={readonly:!0,hasConflicts:!1,newFile:{Name:e.location,Type:h,Content:f.model.getFileContents(e)},oldFile:{Name:e.location,Type:h,Content:g}};f.twoWayCompareView?(f.twoWayCompareView.setOptions(e),
f.twoWayCompareView.refresh(!0)):(f.uiFactoryCompare=new n.TwoWayCompareUIFactory({parentDivID:d.getCompareDivID(),showTitle:!0,rightTitle:a.formatMessage(j["Replaced File (${0})"],i),leftTitle:a.formatMessage(j["Original File (${0})"],i),showLineStatus:!1}),f.uiFactoryCompare.buildUI(),e.uiFactory=f.uiFactoryCompare,e.parentDivID=d.getCompareDivID(),f.twoWayCompareView=new p.TwoWayCompareView(e),f.twoWayCompareView.setOptions({highlighters:[new A(f.registry),new A(f.registry)]}),f.twoWayCompareView.startup(),
f._uiFactory.setCompareWidget(f.twoWayCompareView));q(f.uiFactoryCompare.getTitleDiv());m(document.createTextNode(a.formatMessage(j["Replaced File (${0})"],i)),f.uiFactoryCompare.getTitleDiv(),"only");q(f.uiFactoryCompare.getTitleDiv(!0));m(document.createTextNode(a.formatMessage(j["Original File (${0})"],i)),f.uiFactoryCompare.getTitleDiv(!0),"only");window.setTimeout(function(){f.renderer.focus()},100)})}};x.prototype.addSavedSearch=function(a,b){this.registry.getService("orion.core.savedSearches").addSearch(a,
b)};x.prototype.saveSearch=function(a){if(this.model._provideSearchHelper){var b=e.generateSearchHref(a).split("#")[1],c=b;typeof this.model._provideSearchHelper().displayedSearchTerm==="string"&&typeof a.resource==="string"?(c="'"+this.model._provideSearchHelper().displayedSearchTerm+"' in ",a.resource.length>0?this.registry.getService("orion.page.progress").progress(this.fileClient.read(a.resource,!0),"Getting file metadata "+a.resource).then(function(a){var d=e.fullPathNameByMeta(a.Parents);this.addSavedSearch(c+
(d.length===0?a.Name:d+"/"+a.Name),b)}.bind(this),function(a){console.error("Error loading file meta data: "+a.message);this.addSavedSearch(c+"root",b)}.bind(this)):this.addSavedSearch(c+"root",b)):this.addSavedSearch(c,b)}};x.prototype.caculateNextPage=function(){var a=this.model.getPagingParams();return a.start+a.rows>=a.totalNumber?{start:a.start}:{start:a.start+a.rows}};x.prototype.caculatePrevPage=function(){var a=this.model.getPagingParams(),a=a.start-a.rows;a<0&&(a=0);return{start:a}};x.prototype.initCommands=
function(){this._commandService.destroy("pageActions");this._commandService.renderCommands("pageActions","pageActions",this,this,"button");this._commandService.destroy("pageNavigationActions");this._commandService.renderCommands("pageNavigationActions","pageNavigationActions",this,this,"button")};x.prototype.reportStatus=function(a){this.registry.getService("orion.page.message").setProgressMessage(a)};x.prototype.isExpanded=function(a){return this.myTree.isExpanded(this.model.getId(a))};x.prototype.popupContext=
function(a){if(this.contextTip)this.contextTip.destroy(),this.contextTip=null;var b=this.renderer.getDetailIconId(a),a=this.renderer.generateContextTip(a),b=d.node(b),c=["below","right"];if(b)for(var e=this.myTree._parent.getClientRects()[0],f=b.getClientRects(),g=0,h=f.length;g<h;g++)if(f[g].bottom+100>e.bottom){c=["above","right"];break}this.contextTip=new r.Tooltip({node:b,showDelay:0,trigger:"none",position:c});this.contextTip.contentContainer().appendChild(a);this.contextTip.show()};x.prototype.closeContextTip=
function(a){if(!this.model.replaceMode()){if(this.contextTip)this.contextTip.destroy(),this.contextTip=null;if(!a)this._popUpContext=!1;this.renderer.replaceDetailIcon(this.getNavHandler().currentModel(),"right")}};x.prototype.onCollapse=function(a){var b=this.getNavHandler().currentModel();b&&b.type==="detail"&&v(a)===a&&this.getNavHandler().cursorOn(a)};x.prototype.onExpand=function(a,b){if(a&&a.children&&a.children.length>0&&typeof b==="string"){var c=0,c=b==="first"?0:b==="last"?a.children.length-
1:JSON.parse(b);if(typeof c==="string"||c<0||c>=a.children.length)c=0;this.getNavHandler().cursorOn(a.children[c])}};x.prototype.forceExpandFunc=function(a,b,c){this.myTree.expand(a,function(){this.onExpand(a,b,c)}.bind(this));return null};x.prototype.keyEventListeningDiv=function(a){return d.node(this.getParentDivId(a))};x.prototype.onFocus=function(a){a||this.closeContextTip()};x.prototype.preventDefaultFunc=function(a,b){if(!b)return!0;if(!this.model.replaceMode()&&!a.ctrlKey&&b.type==="detail"){if(a.keyCode===
37&&this._popUpContext)return this.closeContextTip(),a.preventDefault(),!0;if(a.keyCode===39&&!this._popUpContext)return this._popUpContext=!0,this.renderer.replaceDetailIcon(b,"left"),this.popupContext(b),a.preventDefault(),!0}return!1};x.prototype.onReplaceCursorChanged=function(a,b){v(this._currentPreviewModel)===v(b)||this.buildPreview();if(b.type==="detail"){var c=this.model.getDetailInfo(b);this.twoWayCompareView.gotoDiff(c.lineNumber,c.matches[c.matchNumber].startIndex,!1)}};x.prototype.onCursorChanged=
function(a,b){this.renderer.replaceDetailIcon(a,"none");this.model.storeLocationStatus&&this.model.storeLocationStatus(b);var c=this;if(this.model.replaceMode()){if(this._uiFactory)if(this._timer){if(this.timerRunning)window.clearTimeOut(this._timer),this._timer=window.setTimeout(function(){c.onReplaceCursorChanged(a,b);c.timerRunning=!1;c._timer=null},500)}else this._timer=window.setTimeout(function(){c.onReplaceCursorChanged(a,b);c.timerRunning=!1;c._timer=null},500)}else b.type==="detail"?this._popUpContext?
(this.popupContext(b),this.renderer.replaceDetailIcon(b,"left")):this.renderer.replaceDetailIcon(b,"right"):this._popUpContext&&this.closeContextTip(!0)};x.prototype._prepareFilter=function(a){this._validateFilter()&&(a?this.model.getChildren(a,function(){}):D(this.model).forEach(function(a){this.model.getChildren(a,function(){})}.bind(this)))};x.prototype._validateFilter=function(){return!this.model.replaceMode()&&typeof this.model.filterOn==="function"};x.prototype.startUp=function(){var b=q("filterBox");
if(this.model.getPagingParams().numberOnPage===0){if(b)b.style.visibility="hidden";b=j["No matches"];this.model._provideSearchHelper&&(b=a.formatMessage(j["No matches found for ${0}"],this.model._provideSearchHelper().displayedSearchTerm));this.parentNode.textContent="";var c=u("b",null,null,this.parentNode);m(document.createTextNode(b),c,"only")}else{var d=this;if(b&&this._validateFilter()){b.style.visibility="visible";var e=u("input",["search-control","search-filter-input"],null,b);e.type="text";
e.placeholder=j["Type filter text"];e.addEventListener("input",function(){this._filterTimer&&window.clearTimeout(this._filterTimer);this._filterTimer=window.setTimeout(function(){this._filterTimer=null;this._renderFiltered(e.value)}.bind(this),1E3)}.bind(this))}this.model.buildResultModel();this.model.replaceMode()?d.replacePreview(!0,!0):(this.initCommands(),q(this.getParentDivId()),this.createTree(this.getParentDivId(),this.model,{selectionPolicy:"cursorOnly",indent:0,getChildrenFunc:function(a){return this.model.getFilteredChildren(a)}.bind(this),
onCollapse:function(a){d.onCollapse(a)}}),this.gotoCurrent(this.model.restoreLocationStatus?this.model.restoreLocationStatus():null),this.reportStatus(""),!this._crawling&&this.model.staleCheck?this.staleCheck().then(function(){d.refreshValidFiles()}):d._prepareFilter())}};x.prototype.incrementalRender=function(){var a=this;this.model.buildResultModel();this.createTree(this.getParentDivId(),this.model,{selectionPolicy:"cursorOnly",getChildrenFunc:function(a){return this.model.getFilteredChildren(a)}.bind(this),
indent:0,onCollapse:function(b){a.onCollapse(b)}})};x.prototype._renderFiltered=function(a){this.model.filterOn(a);this.createTree(this.getParentDivId(),this.model,{selectionPolicy:"cursorOnly",indent:0,onCollapse:function(a){this.onCollapse(a)}.bind(this)});a&&this.expandAll()};x.prototype.refreshValidFiles=function(){for(var a=[],b=v(this.getNavHandler().currentModel()),c=D(this.model),d=0;d<c.length;d++)c[d].stale?b===c[d]&&(b=null):a.push(c[d]);this.model.setValidFileList&&this.model.setValidFileList(a);
D(this.model).length===0?(this.getNavHandler().refreshModel(this.getNavDict(),this.model,D(this.model)),this.getNavHandler().cursorOn(null,!0)):b?this.getNavHandler().refreshModel(this.getNavDict(),this.model,D(this.model),!0):(this.getNavHandler().cursorOn(null,!0),this.getNavHandler().refreshModel(this.getNavDict(),this.model,D(this.model)),this.gotoCurrent())};x.prototype.getItemCount=function(){return this.model.getListRoot().children.length};x.prototype.getParentDivId=function(a){return!this.model.replaceMode()||
!a?this.parentNode.id:this._uiFactory?this._uiFactory.getMatchDivID():this.parentNode.id};x.prototype.gotoCurrent=function(a){var b=null,c="none";a?(b=a.file,c=a.detail):b=this.getNavHandler().currentModel();b||(b=D(this.model).length>0?D(this.model)[0]:null);this.getNavHandler().cursorOn(b,!0);b&&c&&c!=="none"&&this.myTree.expand(b,function(){this.onExpand(b,c)}.bind(this))};x.prototype.gotoNext=function(a,b){D(this.model).length!==0&&this.getNavHandler().iterate(a,b)};x.prototype.constructor=x;
return{SearchResultExplorer:x}});
define("orion/searchModel","i18n!orion/search/nls/messages,require,orion/Deferred,orion/i18nUtil,orion/explorers/explorer,orion/searchUtils".split(","),function(j,k,i,d,b,a){function f(b,d,c,e,f,i){this.registry=b;this.fileClient=d;this._resultLocation=c;this._numberOnPage=c.length;this._totalNumber=e;this._listRoot={isRoot:!0,children:[]};this._filteredRoot={isRoot:!0,children:[]};this._filterText=null;this._indexedFileItems=[];this._location2ModelMap=[];this._lineDelimiter="\n";this.onMatchNumberChanged=
i.onMatchNumberChanged;this._searchHelper=a.generateSearchHelper(f)}f.prototype=new b.ExplorerModel;f.prototype.getRoot=function(a){a(this.getListRoot())};f.prototype.getChildren=function(b,d){b&&(b.type==="file"&&this._filterText?b.filteredChildren?d(b.filteredChildren):d([]):b.children?d(b.children):b.type==="detail"?d([]):b.type==="file"&&b.location?this._searchHelper.params.keyword!==""&&this.registry.getService("orion.page.progress").progress(this.fileClient.read(b.location),"Getting file contents "+
b.name).then(function(c){a.searchWithinFile(this._searchHelper.inFileQuery,b,c,this._lineDelimiter,this.replaceMode(),this._searchHelper.params.caseSensitive);if(this.onMatchNumberChanged)this.onMatchNumberChanged(b);d(b.children)}.bind(this),function(a){console.error("Error loading file content: "+a.message);d([])}.bind(this)):d([]))};f.prototype.getId=function(a){a===this.getListRoot()?a=this.rootId:(a=a.location,a=a.replace(/[^\.\:\-\_0-9A-Za-z]/g,""));return a};f.prototype.getListRoot=function(){return this._filterText?
this._filteredRoot:this._listRoot};f.prototype.buildResultModel=function(){this._restoreGlobalStatus();this._indexedFileItems=[];for(var b=0;b<this._resultLocation.length;b++){var d={parent:this.getListRoot(),type:"file",name:this._resultLocation[b].name,lastModified:this._resultLocation[b].lastModified,linkLocation:this._resultLocation[b].linkLocation,location:this._resultLocation[b].location,parentLocation:a.path2FolderName(this._resultLocation[b].location,this._resultLocation[b].name,!0),fullPathName:a.path2FolderName(this._resultLocation[b].path,
this._resultLocation[b].name)};this._location2ModelMap[d.location]=d;this.getListRoot().children.push(d);this._indexedFileItems.push(d)}};f.prototype.replaceMode=function(){return typeof this._searchHelper.params.replace==="string"};f.prototype.getPagingParams=function(){return{totalNumber:this._totalNumber,start:this._searchHelper.params.start,rows:this._searchHelper.params.rows,numberOnPage:this._numberOnPage}};f.prototype.getScopingParams=function(b){var f=a.copySearchParams(this._searchHelper.params,
!0);f.resource=b.parentLocation;f.start=0;var f=a.generateSearchHref(f),c=d.formatMessage(j['Search again in this folder with "${0}"'],this._searchHelper.displayedSearchTerm);return{name:b.fullPathName,href:f,tooltip:c}};f.prototype.getDetailInfo=function(a){return{lineString:a.name,lineNumber:a.lineNumber-1,matches:a.matches,matchNumber:a.matchNumber?a.matchNumber-1:0}};f.prototype.getFileName=function(a){return a.name};f.prototype.provideFileContent=function(a,b){this._provideFileContent(a).then(function(){b(a)})};
f.prototype._provideFileContent=function(b){return b.contents?(new i).resolve(b):this.registry.getService("orion.page.progress").progress(this.fileClient.read(b.location),"Getting file contents "+b.Name).then(function(d){a.searchWithinFile(this._searchHelper.inFileQuery,b,d,this._lineDelimiter,this.replaceMode(),this._searchHelper.params.caseSensitive);return b}.bind(this),function(a){console.error("Error loading file content: "+a.message);return b}.bind(this))};f.prototype.getFileContents=function(a){return a.contents.join(this._lineDelimiter)};
f.prototype.getReplacedFileContent=function(b,d,c){a.generateNewContents(d,c.contents,b,c,this._searchHelper.params.replace,this._searchHelper.inFileQuery.searchStrLength);b.lineDelim=this._lineDelimiter};f.prototype.writeReplacedContents=function(a){var b=[];this.getValidFileList().forEach(function(c){b.push(this._writeOneFile(c,a))}.bind(this));return i.all(b,function(a){return{_error:a}})};f.prototype.getHeaderString=function(){var a=j.Results;if(this._searchHelper.displayedSearchTerm){var b=this.getPagingParams();
if(b.numberOnPage>0)var a=b.start+1,c=a+b.numberOnPage-1,a=this.replaceMode()?d.formatMessage(j["Replace ${0} with ${1} for files ${2} of ${3}"],this._searchHelper.displayedSearchTerm,this._searchHelper.params.replace,a+"-"+c,b.totalNumber):d.formatMessage(j["Files ${0} of ${1} matching ${2}"],a+"-"+c,b.totalNumber,this._searchHelper.displayedSearchTerm)}return a};f.prototype.getValidFileList=function(){return this._indexedFileItems};f.prototype.setValidFileList=function(a){this._indexedFileItems=
a};f.prototype.storeLocationStatus=function(a){if(a){var b;b=a?a.type==="file"?a:a.parent:null;if(b)window.sessionStorage[this._searchHelper.params.keyword+"_search_result_currentFileLocation"]=b.location,window.sessionStorage[this._searchHelper.params.keyword+"_search_result_currentDetailIndex"]=a.type==="file"?"none":JSON.stringify(this._model2Index(a))}};f.prototype.restoreLocationStatus=function(){var a=this._location2Model(window.sessionStorage[this._searchHelper.params.keyword+"_search_result_currentFileLocation"]),
b="none",c=window.sessionStorage[this._searchHelper.params.keyword+"_search_result_currentDetailIndex"];typeof c==="string"&&c.length>0&&(b=c);return{file:a,detail:b}};f.prototype.staleCheck=function(b){b=b.toLowerCase();return this._searchHelper.inFileQuery.wildCard?a.searchOnelineRegEx(this._searchHelper.inFileQuery,b,!0):a.searchOnelineLiteral(this._searchHelper.inFileQuery,b,!0)};f.prototype.filterOn=function(a){if(this._filterText=a){var b=this._filterText.toLowerCase();this._filteredRoot.children=
[];this._indexedFileItems.forEach(function(a){var d=!1;if(this._filterSingleString(a.name,b)||this._filterSingleString(a.fullPathName,b))d=!0;if(a.children)a.filteredChildren=[],a.children.forEach(function(f){this._filterSingleString(f.name,b)&&(a.filteredChildren.push(f),d=!0)}.bind(this));d&&this._filteredRoot.children.push(a)}.bind(this))}};f.prototype.getFilteredChildren=function(a){if(a.type==="file"&&this._filterText&&a.filteredChildren)return a.filteredChildren;else if(a.isRoot&&this._filterText)return this._filteredRoot.children;
return a.children};f.prototype._provideSearchHelper=function(){return this._searchHelper};f.prototype._filterSingleString=function(a,b){return a.toLowerCase().indexOf(b)>=0};f.prototype._model2Index=function(a,b){var c=b;if(!c&&a.parent)c=a.parent.children;if(c)for(var d=0;d<c.length;d++)if(c[d]===a)return d;return-1};f.prototype._location2Model=function(a){return a&&this._location2ModelMap[a]?this._location2ModelMap[a]:this._indexedFileItems.length>0?this._indexedFileItems[0]:null};f.prototype._restoreGlobalStatus=
function(){this.defaultReplaceStr=this._searchHelper.displayedSearchTerm;var a=window.sessionStorage.global_search_default_replace_string;if(typeof a==="string"&&a.length>0)this.defaultReplaceStr=a;this.sortByName=this._provideSearchHelper().params.sort.indexOf("Name")>-1};f.prototype._storeGlobalStatus=function(a){window.sessionStorage.global_search_default_replace_string=a};f.prototype._writeOneFile=function(b,d){var c=this._matchesReplaced(b);return c>0?this._provideFileContent(b).then(function(){c=
this._matchesReplaced(b);var e={};a.generateNewContents(!1,b.contents,e,b,this._searchHelper.params.replace,this._searchHelper.inFileQuery.searchStrLength);var e=e.contents.join(this._lineDelimiter),f=b.ETag,f=f?{ETag:f}:null;return this.registry.getService("orion.page.progress").progress(this.fileClient.write(b.location,e,f),"Saving changes to "+b.location).then(function(){d.push({model:b,matchesReplaced:c,status:"pass"})}.bind(this),function(a){a.status===412?d.push({model:b,message:j["Resource has been changed by others."],
matchesReplaced:c,status:"failed"}):(a.log=!0,d.push({model:b,message:j["Failed to write file."],matchesReplaced:c,status:"failed"}))}.bind(this))}.bind(this)):(new i).resolve(b)};f.prototype._matchesReplaced=function(a){var b=0;if(!a.children)return a.checked===!1?0:1;if(a.children)for(var c=0;c<a.children.length;c++)a.children[c].checked!==!1&&(b+=1);return b};f.prototype.constructor=f;return{SearchResultModel:f}});
define("orion/searchResults","i18n!orion/search/nls/messages,orion/i18nUtil,require,orion/webui/littlelib,orion/searchExplorer,orion/searchModel,orion/searchUtils,orion/crawler/searchCrawler".split(","),function(j,k,i,d,b,a,f,h){function g(a,d,f,g,h,i){this.registry=a;this.fileService=g;this.resultsId=d;this.commandService=f;this.searcher=h;this.crawling=i;this.explorer=new b.SearchResultExplorer(this.registry,this.commandService)}g.prototype={_renderSearchResult:function(b,e,f,g,h){var j=!1,k=[];
d.empty(d.node(e));if(g.response.numFound>0)for(var r=0;r<g.response.docs.length;r++){var q=g.response.docs[r];if(!q.Directory){j||(j=!0);var t=q.Location;k.push({linkLocation:i.toUrl("edit/edit.html")+"#"+t,location:t,path:q.Path?q.Path:t,name:q.Name,lastModified:q.LastModified})}}this.explorer.setCrawling(b);var m=this,b=new a.SearchResultModel(this.registry,this.explorer.fileClient,k,g.response.numFound,f,{onMatchNumberChanged:function(a){m.explorer.renderer.replaceFileElement(a)}});this.explorer.setResult(e,
b);h?this.explorer.incrementalRender():this.explorer.startUp()},_search:function(a,b){this.crawling=b.regEx||b.caseSensitive;var f=d.node(this.resultsId),g=this;d.empty(d.node("pageNavigationActions"));d.empty(d.node("pageActions"));if(this.crawling)d.empty(f),f.appendChild(document.createTextNode("")),f=new h.SearchCrawler(this.registry,this.fileService,b,{childrenLocation:this.searcher.getChildrenLocation()}),f.search(function(d,f){g._renderSearchResult(!0,a,b,d,f)});else{d.empty(f);this.registry.getService("orion.page.message").setProgressMessage(j["Searching..."]);
try{this.registry.getService("orion.page.progress").progress(this.fileService.search(b),"Searching "+b.keyword).then(function(d){this.registry.getService("orion.page.message").setProgressMessage("");this._renderSearchResult(!1,a,b,d)}.bind(this),function(a){a=k.formatMessage(j["${0}. Try your search again."],a&&a.error?a.error:"Error");this.registry.getService("orion.page.message").setProgressResult({Message:a,Severity:"Error"})}.bind(this))}catch(i){d.empty(f),f.appendChild(document.createTextNode("")),
typeof i==="string"&&i.indexOf("search")>-1?(f=new h.SearchCrawler(this.registry,this.fileService,b,{childrenLocation:this.searcher.getChildrenLocation()}),f.search(function(d,f){g._renderSearchResult(!0,a,b,d,f)})):this.registry.getService("orion.page.message").setErrorMessage(i)}}},loadResults:function(a){this._search(d.node(this.resultsId),a)}};g.prototype.constructor=g;return{SearchResultsGenerator:g}});
define('built-search.js',"i18n!orion/search/nls/messages,require,orion/browserCompatibility,orion/bootstrap,orion/status,orion/progress,orion/dialogs,orion/commandRegistry,orion/favorites,orion/searchOutliner,orion/searchClient,orion/fileClient,orion/operationsClient,orion/searchResults,orion/globalCommands,orion/contentTypes,orion/searchUtils,orion/PageUtil,orion/webui/littlelib".split(","),function(j,k,i,d,b,a,f,h,g,c,e,l,n,p,o,s,r,q,t){function m(a,b,c,d,e){a=!c||c===""||c==="root"?e.getSearchRootLocation():
c;d=r.copySearchParams(d);d.resource=a;b.href=r.generateSearchHref(d)}function u(a,b,c,d,e,f,g,h){var i=g.resource,k=g.replace?j["Replace All Matches"]:j["Search Results"];i?i===b.fileServiceRootURL(i)?(d.setRootLocationbyURL(i),d.setLocationbyURL(i),o.setPageTarget({task:"Search",title:k,serviceRegistry:a,commandService:c,searchService:d,fileService:b,breadcrumbRootName:b.fileServiceName(i),makeBreadcrumbLink:function(a,c){m(b,a,c,g,d)}}),d.setChildrenLocationbyURL(i),f.loadSearchParams(g),e.loadResults(g)):
h.progress(b.read(i,!0),"Loading file metadata "+i).then(function(h){o.setPageTarget({task:"Search",title:k,target:h,serviceRegistry:a,fileService:b,commandService:c,searchService:d,breadcrumbRootName:"Search",makeBreadcrumbLink:function(a,c){m(b,a,c,g,d)}});f.loadSearchParams(g);e.loadResults(g)}.bind(this),function(a){window.console.error("Error loading file metadata: "+a.message)}.bind(this)):o.setPageTarget({task:"Search",title:k,serviceRegistry:a,commandService:c,searchService:d,fileService:b,
breadcrumbRootName:"Search",makeBreadcrumbLink:function(a,c){m(b,a,c,g,d)}})}d.startup().then(function(d){var i=d.serviceRegistry,d=d.preferences;new f.DialogService(i);var j=new n.OperationsClient(i);new b.StatusReportingService(i,j,"statusPane","notifications","notificationArea");var k=new h.CommandRegistry({}),m=new a.ProgressService(i,j,k);new g.FavoritesService({serviceRegistry:i});new c.SavedSearches({serviceRegistry:i});var E=new l.FileClient(i);new s.ContentTypeService(i);var C=new e.Searcher({serviceRegistry:i,
commandService:k,fileService:E});new c.SearchOutliner({parent:"searchProgress",serviceRegistry:i,commandService:k});var A=new c.SearchBuilder({parent:"searchBuilder",searcher:C,serviceRegistry:i,commandService:k});o.generateBanner("orion-searchResults",i,k,d,C,C,null,null);var x=new p.SearchResultsGenerator(i,"results",k,E,C,!1),F=function(){var a=t.node("filterBox");a&&t.empty(a);a=q.matchResourceParameters();r.convertSearchParams(a);u(i,E,k,C,x,A,a,m);if(a=document.getElementById("pageActions"))k.destroy(a),
k.renderCommands(a.id,a,C,C,"button")};window.addEventListener("hashchange",function(){F()},!0);F()})});