/**
 * @license RequireJS i18n 1.0.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/jrburke/requirejs 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) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @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) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (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) 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) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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) 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, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @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 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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) 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: Anton McConville - 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) 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) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/**
 * @license RequireJS text 1.0.7 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/jrburke/requirejs for details
 */
/*******************************************************************************
 * @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) 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) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/******************************************************************************* 
 * @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
 * 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) 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) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 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
 ******************************************************************************/
/*******************************************************************************
 * @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
 ******************************************************************************/
/*******************************************************************************
 * @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
 ******************************************************************************/
/*******************************************************************************
 * @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) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 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
 * 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) 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: 
 *		Anton McConville (IBM Corporation) - initial API and implementation
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation 
 ******************************************************************************/
/******************************************************************************* 
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license Copyright (c) 2012, 2013 IBM Corporation and others. All rights reserved.
 *          This program and the accompanying materials are made available under
 *          the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license Copyright (c) 2010, 2013 IBM Corporation and others. All rights
 *          reserved. This program and the accompanying materials are made
 *          available under the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license Copyright (c) 2012, 2013 IBM Corporation and others. All rights reserved.
 *          This program and the accompanying materials are made available under
 *          the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license Copyright (c) 2012 IBM Corporation and others. All rights reserved.
 *          This program and the accompanying materials are made available under
 *          the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.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) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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) 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) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2010,2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/******************************************************************************* 
 * @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) 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,2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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) 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, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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
 *     Andy Clement (vmware) - bug 344614
 *******************************************************************************/
/*******************************************************************************
 * @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, 2012 IBM Corporation and others. All rights reserved.
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: 
 *	IBM Corporation - initial API and implementation
 *	Adrian Aichner - regular expression capture group support in replace
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/
/*******************************************************************************
 * @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) 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, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.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, 2013 IBM Corporation and others. All rights
 *          reserved. This program and the accompanying materials are made
 *          available under the terms of the Eclipse Public License v1.0
 *          (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse
 *          Distribution License v1.0
 *          (http://www.eclipse.org/org/documents/edl-v10.html).
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License v1.0
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
 *
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/
/*

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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


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

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

 Contributors:
 IBM Corporation - initial API and implementation

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


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


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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 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) 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
 Andy Clement (vmware) - bug 344614

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

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


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

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

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

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.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 1.0.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/requirejs 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) 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 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and 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, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.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 h(b,f,e,d,c,a){f[b]&&(e.push(b),(f[b]===!0||f[b]===1)&&d.push(c+b+"/"+a))}function k(b,f,e,d,c){f=d+f+"/"+c;require._fileExists(b.toUrl(f))&&e.push(f)}var j=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/,b={};define("i18n",{version:"1.0.0",load:function(g,f,e,d){var d=d||{},c=j.exec(g),a=c[1],i=c[4],m=c[5],o=i.split("-"),q=[],u={},l,s,n="";c[5]?(a=c[1],g=a+m):(m=c[4],i=d.locale||(d.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),
o=i.split("-"));if(d.isBuild){q.push(g);k(f,"root",q,a,m);for(l=0;s=o[l];l++)n+=(n?"-":"")+s,k(f,n,q,a,m);f(q,function(){e()})}else f([g],function(c){var i=[];h("root",c,i,q,a,m);for(l=0;s=o[l];l++)n+=(n?"-":"")+s,h(n,c,i,q,a,m);f(q,function(){var l,n;for(l=i.length-1;l>-1&&(s=i[l]);l--){n=c[s];if(n===!0||n===1)n=f(a+s+"/"+m);var d=u,g=void 0;for(g in n)!(g in b)&&!(g in d)&&(d[g]=n[g])}e(u)})})}})})();
define("orion/i18n",[],function(){return{load:function(h,k,j,b){var b=b||{},g=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,f=g.exec(h);if(f)if(k.defined(h))j(k(h));else if(b.isBuild||b.isTest)j({});else{var e=f[1],d=f[3]?f[2]:"",c=f[3]||f[2];k(["orion/bootstrap"],function(a){a.startup().then(function(a){var m=a.serviceRegistry,a=m.getServiceReferences("orion.i18n.message");if(d)a.some(function(a){return h===a.getProperty("name")?(m.getService(a).getMessageBundle().then(function(a){j(a)},function(){j({})}),
!0):!1})||j({});else{var o={},q;a.forEach(function(a){var l=a.getProperty("name");if((f=g.exec(l))&&e===f[1]&&c===(f[3]||f[2]))if(d=f[3]?f[2]:""){if((a=b.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&a.indexOf(d)===0)o[d]=!0,k.specified(l)||define(l,["orion/i18n!"+l],function(a){return a})}else q=a});k.specified(h)?j(o):q?m.getService(q).getMessageBundle().then(function(a){Object.keys(o).forEach(function(l){typeof a[l]==="undefined"&&(a[l]=o[l])});define(h,
[],a);j(a)},function(){define(h,[],o);j(o)}):(define(h,[],o),j(o))}})})}else j(null)}}});
define("git/nls/root/gitmessages",{Compare:"Compare","View the side-by-side compare":"View the side-by-side compare","Working Directory Version":"Working Directory Version","Working Directory":"Working Directory","View the working directory version of the file":"View the working directory version of the file","Loading...":"Loading...",Repositories:"Repositories","0 on 1 - Git":"${0} on ${1} - Git",Git:"Git","Show in eclipse.org":"Show in eclipse.org","Show this repository at eclipse.org":"Show this repository at eclipse.org",
"Show in GitHub":"Show in GitHub","Show this repository in GitHub":"Show this repository in GitHub","Commit Details":"Commit Details","No Commits":"No Commits","commit: 0":"commit: ${0}","parent: 0":"parent: ${0}","authored by 0 (1) on 2":"authored by ${0} (${1}) on ${2}","committed by 0 (1)":"committed by ${0} (${1})","Tags:":"Tags:","No Tags":"No Tags",Diffs:"Changes",More:"More","Loading git log...":"Loading git log...",local:"local",remote:"remote","Git Log for ${0} branch ${1} on ":"Git Log for ${0} branch ${1} on ",
"Git Log for ${0} branch ${1}":"Git Log for ${0} branch ${1}","Log for branch ${0} - Git":"Log for branch ${0} - Git","Log for ${0} on ${1} - Git":"Log for ${0} on ${1} - Git","View All":"View All","Error ${0}: ":"Error ${0}: ","Loading ":"Loading ",Message:"Message",Author:"Author",Date:"Date",Actions:"Actions",Branches:"Branches",Tags:"Tags",Stage:"Stage","Unstaged removal":"Unstaged removal",Unstage:"Unstage","Staged removal":"Staged removal","Unstaged change":"Unstaged change","Staged change":"Staged change",
"Unstaged add":"Unstaged add","Staged add":"Staged add","Resolve Conflict":"Resolve Conflict",Conflicting:"Conflicting","Commit message":"Commit message","Record changes in the active branch":"Record changes in the active branch",Commit:"Commit","Amend last commit":"Amend last commit"," Amend":" Amend","Rebase in progress. Choose action:":"Rebase in progress. Choose action:","Committer name:":"Committer name:","email:":"email:","Author name: ":"Author name: ","Select a file on the left to compare...":"Select a file on the left to compare...",
Unstaged:"Unstaged",Staged:"Staged","Recent commits on":"Recent commits on","Git Status":"Git Status","Go to Git Status":"Go to Git Status","Recent commits on ${0}":"Recent commits on ${0}","Status for ${0} - Git":"Status for ${0} - Git","Status (${0})":"Status (${0})","Getting git incoming changes...":"Getting git incoming changes...","Loading recent commits...":"Loading recent commits...","Show the side-by-side compare":"Show the side-by-side compare","Change Committer or Author":"Change Committer or Author",
"Use Default Committer and Author":"Use Default Committer and Author",Checkout:"Checkout","Checkout the file, discarding the unstaged change":"Checkout the file, discarding the unstaged change","Your changes to the file will be lost. Are you sure you want to checkout?":"Your changes to the file will be lost. Are you sure you want to checkout?","Checking out...":"Checking out...","Stage the change":"Stage the change","Stage the selected changes":"Stage the selected changes","Staging...":"Staging...",
"Checkout all the selected files, discarding all changes":"Checkout all the selected files, discarding all changes","Your changes to all the selected files will be lost. Are you sure you want to checkout?":"Your changes to all the selected files will be lost. Are you sure you want to checkout?","Save Patch":"Save Patch","Save workspace changes as a patch":"Save workspace changes as a patch","Unstage the change":"Unstage the change","Unstaging...":"Unstaging...",Reset:"Reset","Reset the branch, discarding all staged and unstaged changes":"Reset the branch, discarding all staged and unstaged changes",
"All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.":"All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.","Are you sure you want to continue?":"Are you sure you want to continue?","Resetting local changes...":"Resetting local changes...","Continue rebase...":"Continue rebase...","Skipping patch...":"Skipping patch...","Aborting rebase...":"Aborting rebase...","Complete log":"Complete log",
"local VS index":"local VS index","index VS HEAD":"index VS HEAD","Compare(${0} : ${1})":"Compare(${0} : ${1})","Loading status...":"Loading status...","Committing...":"Committing...","The committer name is required.":"The committer name is required.","The committer mail is required.":"The committer mail is required.","The author name is required.":"The author name is required.","The author mail is required.":"The author mail is required.",". Repository still contains conflicts.":". Repository still contains conflicts.",
". Repository contains unmerged paths. Resolve conflicts first.":". Repository contains unmerged paths. Resolve conflicts first.","Rendering ${0}":"Rendering ${0}",Configuration:"Configuration"," - Git":" - Git","Repositories - Git":"Repositories - Git",Repository:"Repository","Repository Not Found":"Repository Not Found","No Repositories":"No Repositories","Loading repository":"Loading repository","Loading repositories":"Loading repositories","(no remote)":"(no remote)","location: ":"location: ",
"${0} file(s) to stage and ${1} file(s) to commit.":"${0} file(s) to stage and ${1} file(s) to commit.","Nothing to commit.":"Nothing to commit.","Nothing to push.":"Nothing to push."," commit(s) to push.":" commit(s) to push.","You have no changes to commit.":"You have no changes to commit.","You have changes to commit in your workspace!":"You have changes to commit in your workspace!","Rebase in progress!":"Rebase in progress!","View all local and remote tracking branches":"View all local and remote tracking branches",
"tracks no branch, ":"tracks no branch, ","tracks ${0}, ":"tracks ${0}, ","last modified ${0} by ${1}":"last modified ${0} by ${1}","No Remote Branches":"No Remote Branches","Rendering branches":"Rendering branches",Commits:"Commits","Getting current branch":"Getting current branch","See Full Log":"See Full Log","See the full log":"See the full log",'Getting commits for "${0}" branch':'Getting commits for "${0}" branch',"Rendering commits":"Rendering commits","Getting outgoing commits":"Getting outgoing commits",
"The branch is up to date.":"The branch is up to date.","You have no outgoing or incoming commits.":"You have no outgoing or incoming commits.",") by ":") by "," (SHA ":" (SHA ","Getting tags":"Getting tags","View all tags":"View all tags"," on ":" on "," by ":" by ",Remotes:"Remotes","Rendering remotes":"Rendering remotes","No Remotes":"No Remotes","Getting confituration":"Getting confituration","View all configuration entries":"View all configuration entries","Unstaged addition":"Unstaged addition",
"Staged addition":"Staged addition"," (Rebase in Progress)":" (Rebase in Progress)",Status:"Status","Status for ${0} - Git ":"Status for ${0} - Git ","No Unstaged Changes":"No Unstaged Changes","No Staged Changes":"No Staged Changes",'Commits for "${0}" branch':'Commits for "${0}" branch',"Add Remote":"Add Remote","Remote Name:":"Remote Name:","Remote URI:":"Remote URI:","Apply Patch":"Apply Patch","Git Repository":"Git Repository","Go to the git repository":"Go to the git repository","Clone Git Repository":"Clone Git Repository",
"Repository URL:":"Repository URL:","Existing directory:":"Existing directory:","New folder:":"New folder:","Choose a Folder":"Choose a Folder","Commit Changes":"Commit Changes","Message:":"Message:","Amend:":"Amend:","Committer Name:":"Committer Name:","Committer Email:":"Committer Email:","Author Name:":"Author Name:","Author Email:":"Author Email:","The commit message is required.":"The commit message is required.","Git Credentials":"Git Credentials","Username:":"Username:","Ssh password:":"Ssh password:",
"Private key:":"Private key:","Passphrase (optional):":"Passphrase (optional):","commit:":"commit: ","parent:":"parent: ","branches: ":"branches: ","tags: ":"tags: "," authored by ${0} {${1}) on ${2}":" authored by ${0} {${1}) on ${2}",Content:"Content","Go to ${0} section":"Go to ${0} section","Find Commit":"Find Commit","Type the commit name (sha1):":"Type the commit name (sha1):",Search:"Search","Searching...":"Searching...","Looking for the commit":"Looking for the commit"," authored by ${0} (${1})) on ${2}":" authored by ${0} (${1})) on ${2}",
"New Branch:":"New Branch:",OK:"OK"," [New branch]":" [New branch]","Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.":"Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.","Link Repository":"Link Repository","Folder name:":"Folder name:","Repository was linked to ":"Repository was linked to ","Checkout the current tag, creating a local branch based on its contents.":"Checkout the current tag, creating a local branch based on its contents.",
"Checking out tag ${0}":"Checking out tag ${0}","Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.":"Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.","Checking out branch...":"Checking out branch...","Checking out branch ${0}...":"Checking out branch ${0}...",
"Branch checked out.":"Branch checked out.","New Branch":"New Branch","Add a new local branch to the repository":"Add a new local branch to the repository","Branch name":"Branch name",Delete:"Delete","Delete the local branch from the repository":"Delete the local branch from the repository","Are you sure you want to delete branch ${0}?":"Are you sure you want to delete branch ${0}?","Delete the remote tracking branch from the repository":"Delete the remote tracking branch from the repository","Are you sure?":"Are you sure?",
"You're going to delete remote branch ${0} and push the change.":"You're going to delete remote branch ${0} and push the change.","Removing remote branch: ":"Removing remote branch: ","Delete Remote Branch":"Delete Remote Branch","New Remote":"New Remote","Git Remote":"Git Remote","Go to Git Remote":"Go to Git Remote","Add a new remote to the repository":"Add a new remote to the repository","Delete the remote from the repository":"Delete the remote from the repository","Are you sure you want to delete remote ${0}?":"Are you sure you want to delete remote ${0}?",
Pull:"Pull","Pull from the repository":"Pull from the repository","Pulling: ":"Pulling: ","Pull Git Repository":"Pull Git Repository","Git Log":"Git Log","Go to Git Log":"Go to Git Log","Open the log for the branch":"Open the log for the branch","Open the log for the repository":"Open the log for the repository","Open the status for the repository":"Open the status for the repository","Show in Navigator":"Show in Navigator","Show the repository folder in the file navigator":"Show the repository folder in the file navigator",
"Compare With Each Other":"Compare With Each Other","Compare With Working Tree":"Compare With Working Tree",Open:"Open",Fetch:"Fetch","Fetch from the remote":"Fetch from the remote","SSH Password:":"SSH Password:","SSH User Name:":"SSH User Name:","Fetching remote: ":"Fetching remote: ","Force Fetch":"Force Fetch","Fetch from the remote branch into your remote tracking branch overriding its current content":"Fetch from the remote branch into your remote tracking branch overriding its current content",
"You're going to override content of the remote tracking branch. This can cause the branch to lose commits.":"You're going to override content of the remote tracking branch. This can cause the branch to lose commits.",Merge:"Merge","Merge the content from the branch to your active branch":"Merge the content from the branch to your active branch",". Go to ${0}.":". Go to ${0}.","Git Status page":"Git Status page",Rebase:"Rebase","Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch ":"Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch ",
"Rebase on top of ":"Rebase on top of ",". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing":". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing",". Repository state is invalid (i.e. already during rebasing)":". Repository state is invalid (i.e. already during rebasing)",". Repository contains unmerged paths":". Repository contains unmerged paths",". Repository contains pending changes. Please commit or stash them":". Repository contains pending changes. Please commit or stash them",
"Rebase your commits by removing them from the active branch, ":"Rebase your commits by removing them from the active branch, ","starting the active branch again based on the latest state of '":"starting the active branch again based on the latest state of '","and applying each commit again to the updated active branch.":"and applying each commit again to the updated active branch.","Push All":"Push All","Push commits and tags from your local branch into the remote branch":"Push commits and tags from your local branch into the remote branch",
"Pushing remote: ":"Pushing remote: ","Choose Branch":"Choose Branch","Force Push All":"Force Push All","Push commits and tags from your local branch into the remote branch overriding its current content":"Push commits and tags from your local branch into the remote branch overriding its current content","You're going to override content of the remote branch. This can cause the remote repository to lose commits.":"You're going to override content of the remote branch. This can cause the remote repository to lose commits.",
"< Previous Page":"< Previous Page","Show previous page of git log":"Show previous page of git log","Show previous page of git tags":"Show previous page of git tags","Next Page >":"Next Page >","Show next page of git log":"Show next page of git log","Show next page of git tags":"Show next page of git tags","Push from your local branch into the selected remote branch":"Push from your local branch into the selected remote branch","Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.":"Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.",
"The content of your active branch will be replaced with ":"The content of your active branch will be replaced with ","All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?":"All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?","Resetting index...":"Resetting index...","Name:":"Name:",Tag:"Tag","Create a tag for the commit":"Create a tag for the commit","Tag name":"Tag name","Delete the tag from the repository":"Delete the tag from the repository",
"Are you sure you want to delete tag ${0}?":"Are you sure you want to delete tag ${0}?","Cherry-Pick":"Cherry-Pick","Apply the change introduced by the commit to your active branch":"Apply the change introduced by the commit to your active branch","Nothing changed.":"Nothing changed.",". Some conflicts occurred":". Some conflicts occurred","Fetch from the remote branch into your remote tracking branch":"Fetch from the remote branch into your remote tracking branch","Fetch Git Repository":"Fetch Git Repository",
Push:"Push","Push from your local branch into the remote branch":"Push from your local branch into the remote branch","Push Git Repository":"Push Git Repository","Key:":"Key:","Value:":"Value:","New Configuration Entry":"New Configuration Entry",Edit:"Edit","Edit the configuration entry":"Edit the configuration entry","Delete the configuration entry":"Delete the configuration entry","Are you sure you want to delete ${0}?":"Are you sure you want to delete ${0}?","Clone Repository":"Clone Repository",
"Clone an existing Git repository to a folder":"Clone an existing Git repository to a folder","Cloning repository: ":"Cloning repository: ","Init Repository":"Init Repository","Create a new Git repository in a new folder":"Create a new Git repository in a new folder","Initializing repository: ":"Initializing repository: ","Init Git Repository":"Init Git Repository","Delete the repository":"Delete the repository","Are you sure you want do delete ${0} repositories?":"Are you sure you want do delete ${0} repositories?",
"Apply a patch on the selected repository":"Apply a patch on the selected repository","Show content":"Show content","Commit name:":"Commit name:","Open Commit":"Open Commit","Open the commit with the given name":"Open the commit with the given name","No commits found":"No commits found","Staging changes":"Staging changes","Commit message:":"Commit message:","Committing changes":"Committing changes","Resetting local changes":"Resetting local changes","Checkout files, discarding all changes":"Checkout files, discarding all changes",
"Show Patch":"Show Patch","Show workspace changes as a patch":"Show workspace changes as a patch",Continue:"Continue","Contibue Rebase":"Contibue Rebase","Skip Patch":"Skip Patch",Abort:"Abort","Abort Rebase":"Abort Rebase","Your changes to the selected files will be discarded and cannot be recovered.":"Your changes to the selected files will be discarded and cannot be recovered.","Active Branch Log":"Git Log (Active Branch)","Show the log for the active local branch":"Show the log for the active local branch",
"Remote Branch Log":"Git Log (Remote Branch)","Show the log for the corresponding remote tracking branch":"Show the log for the corresponding remote tracking branch","See Full Status":"See Full Status","See the status":"See the status","Choose target location":"Choose target location","Default target location":"Default target location","Change...":"Change...","Merge Squash":"Merge Squash","Squash the content of the branch to the index":"Squash the content of the branch to the index","Local Branch Name:":"Local Branch Name:",
"Filter items":"Filter items","Filter remote branches":"Filter remote branches","Paste link in email or IM":"Paste link in email or IM","Show Commit in GitHub":"Show Commit in GitHub","Show Repository in GitHub":"Show Repository in GitHub","Show this commit in GitHub":"Show this commit in GitHub","Show Commit in eclipse.org":"Show Commit in eclipse.org","Show this commit in eclipse.org":"Show this commit in eclipse.org","Show Repository in eclipse.org":"Show Repository in eclipse.org","Show this repository in eclipse.org":"Show this repository in eclipse.org",
"Ask for review":"Ask for review","Ask for review tooltip":"Send email with request for commit review","Reviewer name":"Reviewer name","Contribution Review Request":"Contribution Review Request","Send the link to the reviewer":"Send the link to the reviewer","Private key file (optional):":"Private key file (optional):","Don't prompt me again:":"Don't prompt me again:","Your private key will be saved in the browser for further use":"Your private key will be saved in the browser for further use","Loading Contribution Review Request...":"Loading Contribution Review Request...",
"The commit can be found in the following repositories":"The commit can be found in the following repositories","Try to update your repositories":"Try to update your repositories","Create new repository":"Create new repository","Attach the remote to one of your existing repositories":"Attach the remote to one of your existing repositories","You are reviewing contribution ${0} from ${1}":"You are reviewing contribution ${0} from ${1}","Unfortunately the commit can not be found in your workspace. To see it try one of the following: ":"Unfortunately the commit can not be found in your workspace. To see it try one of the following: ",
"To review the commit you can also:":"To review the commit you can also:","Contribution Review Request for ${0} on ${1}":"Contribution Review Request for ${0} on ${1}","Failing paths: ${0}":"Failing paths: ${0}","Problem while performing the action":"Problem while performing the action","Clone Git Repository":"Clone Git Repository","Go to the Orion repositories page to provide a git repository URL. Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL. Once the repository is created, it will appear in the Navigator."});
define("git/nls/gitmessages",["orion/i18n!git/nls/gitmessages","git/nls/root/gitmessages"],function(h,k){var j={root:k};Object.keys(h).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=h[b])});return j});
(function(h,k){typeof define==="function"&&define.amd?define("orion/Deferred",[],k):typeof exports==="object"?module.exports=k():(h.orion=h.orion||{},h.orion.Deferred=k())})(this,function(){function h(){for(var a;a=e.shift()||d.shift();)a();c=!1}function k(a,i){(i?d:e).push(a);c||(c=!0,i?setTimeout(h,0):h())}function j(a){return function(){a.apply(null,arguments)}}function b(){}function g(){var a=Error("Cancel");a.name="Cancel";return a}function f(){function a(){for(var a;a=e.shift();){var l=a.deferred,
s=d==="resolved"?"resolve":"reject";if(typeof a[s]==="function")try{var n=a[s](c);n&&typeof n.then==="function"?(l.cancel=n.cancel||b,n.then(j(l.resolve),j(l.reject),l.progress)):l.resolve(n)}catch(y){l.reject(y)}else l[s](c)}}var c,d,e=[],q=this;this.reject=function(b){d||(d="rejected",c=b,e.length&&k(a));return q.promise};this.resolve=function(b){d||(d="resolved",c=b,e.length&&k(a));return q.promise};this.progress=function(a){d||e.forEach(function(l){l.progress&&l.progress(a)});return q.promise};
this.cancel=function(){d||q.reject(g())};this.then=function(c,l,i){var c={resolve:c,reject:l,progress:i,deferred:new f},n=c.deferred,b=this.cancel.bind(this),g=function(){k(function(){(n.cancel===g?b:n.cancel)()},!0)};n.cancel=g;l=n.promise;l.cancel=function(){n.cancel()};e.push(c);d&&k(a,!0);return l};this.promise={then:this.then,cancel:this.cancel}}var e=[],d=[],c=!1;f.all=function(a,c){function d(a,c){l||(g[a]=c,--b===0&&s.resolve(g))}function e(a,b){if(!l){if(c)try{d(a,c(b));return}catch(f){b=
f}s.reject(b)}}var b=a.length,g=[],l=!1,s=new f;s.then(null,function(){l=!0;a.forEach(function(a){a.cancel&&a.cancel()})});b===0?s.resolve(g):a.forEach(function(a,l){a.then(d.bind(null,l),e.bind(null,l))});return s.promise};f.when=function(a,c,d,e){var b;if(!(a&&typeof a.then==="function"))b=new f,b.resolve(a),a=b.promise;return a.then(c,d,e)};return f});
define("orion/EventTarget",[],function(){function h(){this._namedListeners={}}h.prototype={dispatchEvent:function(h){if(!h.type)throw Error("unspecified type");var j=this._namedListeners[h.type];j&&j.forEach(function(b){try{typeof b==="function"?b(h):b.handleEvent(h)}catch(g){typeof console!=="undefined"&&console.log(g)}});return!h.defaultPrevented},addEventListener:function(h,j){if(typeof j==="function"||j.handleEvent)this._namedListeners[h]=this._namedListeners[h]||[],this._namedListeners[h].push(j)},
removeEventListener:function(h,j){var b=this._namedListeners[h];if(b)for(var g=0;g<b.length;g++)if(b[g]===j){b.length===1?delete this._namedListeners[h]:b.splice(g,1);break}}};h.prototype.constructor=h;h.attach=function(k){var j=new h;k.dispatchEvent=j.dispatchEvent.bind(j);k.addEventListener=j.addEventListener.bind(j);k.removeEventListener=j.removeEventListener.bind(j)};return h});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(h,k){function j(d,c,a){this._properties=a||{};this._properties["service.id"]=d;this._properties.objectClass=c;this._properties["service.names"]=c}function b(d,c,a){this._serviceId=d;this._serviceReference=c;this._internalRegistry=a}function g(d,c){function a(a){return function(){var i;try{if(!c())throw Error("Service was unregistered");var e=d[a].apply(d,Array.prototype.slice.call(arguments));if(e&&typeof e.then==="function")return e;
else i=new h,i.resolve(e)}catch(b){i=new h,i.reject(b)}return i.promise}}for(var i in d)typeof d[i]==="function"&&(this[i]=a(i))}function f(d,c){this.type=d;this.serviceReference=c}function e(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var d=this;this._internalRegistry={isRegistered:function(c){return d._entries[c]?!0:!1},unregisterService:function(c){var a=d._entries[c];if(!a)throw Error("already unregistered");var i=a.reference;d._serviceEventTarget.dispatchEvent(new f("unregistering",
i));d._entries[c]=null;i.getProperty("objectClass").forEach(function(a){for(var c=d._namedReferences[a],e=0;e<c.length;e++)if(c[e]===i){c.length===1?delete d._namedReferences[a]:c.splice(e,1);break}})},modifyService:function(c){c=d._entries[c];if(!c)throw Error("already unregistered");d._serviceEventTarget.dispatchEvent(new f("modified",c.reference))}}}j.prototype={getPropertyKeys:function(){var d=[],c;for(c in this._properties)this._properties.hasOwnProperty(c)&&d.push(c);return d},getProperty:function(d){return this._properties[d]}};
j.prototype.constructor=j;b.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(d){var c=this._serviceReference._properties;this._serviceReference._properties=d||{};d["service.id"]=this._serviceId;d.objectClass=c.objectClass;d["service.names"]=c["service.names"];this._internalRegistry.modifyService(this._serviceId)}};
b.prototype.constructor=b;e.prototype={getService:function(d){var c;if(typeof d==="string")(d=this._namedReferences[d])&&d.some(function(a){c=this._entries[a.getProperty("service.id")].service;return!!c},this);else if(d=this._entries[d.getProperty("service.id")])c=d.service;return c||null},getServiceReferences:function(d){if(d)return this._namedReferences[d]?this._namedReferences[d]:[];var c=[];this._entries.forEach(function(a){a&&c.push(a.reference)});return c},registerService:function(d,c,a){if(typeof c===
"undefined"||c===null)throw Error("invalid service");typeof d==="string"?d=[d]:Array.isArray(d)||(d=[]);var i=this._entries.length,e=new j(i,d,a),o=this._namedReferences;d.forEach(function(a){o[a]=o[a]||[];o[a].push(e)});d=new g(c,this._internalRegistry.isRegistered.bind(null,i));this._entries.push({reference:e,service:d});d=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new f("registered",e));return new b(i,e,d)},addEventListener:function(d,c){this._serviceEventTarget.addEventListener(d,
c)},removeEventListener:function(d,c){this._serviceEventTarget.removeEventListener(d,c)}};e.prototype.constructor=e;return{ServiceRegistry:e}});
define("orion/xhr",["orion/Deferred"],function(h){function k(h,b,g,f){var e=typeof g.response!=="undefined"?g.response:g.responseText,d;try{d=g.status}catch(c){d=0}h={args:b,response:e,responseText:typeof e==="string"?e:null,status:d,url:h,xhr:g};if(typeof f!=="undefined")h.error=f;return h}return function(j,b,g){var g=g||{},f=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,e=new h,d=g.headers||{},c=g.log||!1,a;typeof d["X-Requested-With"]==="undefined"&&(d["X-Requested-With"]="XMLHttpRequest");
if(typeof g.data!=="undefined"&&(j==="POST"||j==="PUT"))a=g.data;if(typeof g.responseType==="string")f.responseType=g.responseType;f.onprogress=function(a){a.xhr=f;e.progress(a)};f.onreadystatechange=function(){if(f.readyState===4){var a=k(b,g,f),i=f.status;200<=i&&i<400?e.resolve(a):(c&&typeof console!=="undefined"&&console.log(Error(f.statusText)),e.reject(a))}};try{f.open(j,b,!0);if(typeof g.timeout==="number")if(typeof f.timeout==="number")f.timeout=g.timeout,f.addEventListener("timeout",function(){e.reject(k(b,
g,f,"Timeout exceeded"))});else{var i=setTimeout(function(){e.reject(k(b,g,f,"Timeout exceeded"))},g.timeout);e.then(clearTimeout.bind(null,i),clearTimeout.bind(null,i))}Object.keys(d).forEach(function(a){f.setRequestHeader(a,d[a])});f.send(a)}catch(m){e.reject(k(b,g,f,m))}return e.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(h,k,j){function b(a,c){this._name=a;this._providers=c;this._flushPending=!1;this._cached=null;this._stores=[];this._dirty=[]}function g(a,c){return{get:function(d,e){if(c===0)return null;var b=localStorage.getItem(a+d);if(b===null)return null;b=JSON.parse(b);return e||c===-1||b._expires&&b._expires>(new Date).getTime()?(delete b._expires,b):null},set:function(d,e){if(c!==0){if(c!==-1)e._expires=(new Date).getTime()+1E3*c;
if(Object.keys(e).length===0)localStorage.removeItem(a+d);else{var b=JSON.stringify(e);localStorage.setItem(a+d,b);delete e._expires}}},remove:function(c){localStorage.removeItem(a+c)}}}function f(a){this._currentPromises={};this._cache=new g("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var c=a.getServiceReferences("orion.core.preference.provider");if(c.length>0)this._service=a.getService(c[0])}return!!this._service}}function e(a){this._location=
a;this._currentPromise=null;this._cache=new g("/orion/preferences/default",3600)}function d(){this._cache=new g("/orion/preferences/local",-1)}function c(a,c){this._userProvider=new f(a);this._localProvider=new d;c=c||"defaults.pref";c.indexOf("://")===-1&&(c=h.toUrl(c));this._defaultsProvider=new e(c);this._serviceRegistration=a.registerService("orion.core.preference",this)}b.prototype={_flush:function(){for(var a=[],c=0;c<this._stores.length;++c){var d=this._stores[c];this._dirty.indexOf(d)!==-1&&
a.push(this._providers[c].put(this._name,d))}this._dirty=[];return k.all(a)},_scheduleFlush:function(a){this._dirty.indexOf(a)===-1&&this._dirty.push(a);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 a=0;a<this._stores.length;++a){var c=this._stores[a],d;for(d in c)c.hasOwnProperty(d)&&typeof this._cached[d]==="undefined"&&(this._cached[d]=
c[d])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,c){if(this._stores.length!==0){var d=this._stores[0];if(d[a]!==c)d[a]=c,this._cached=null,this._scheduleFlush(d)}},remove:function(a){for(var c=0;c<this._stores.length;++c){var d=this._stores[c];if(d.hasOwnProperty(a))return delete d[a],this._cached=null,this._scheduleFlush(d),!0}return!1},clear:function(){for(var a=0;a<this._stores.length;++a)this._stores[a]=
{},this._scheduleFlush(this._stores[a]);this._cached=null},sync:function(a){if(this._flushPending)return this._flushPending=!1,this._flush();for(var c=this,d=[],e=0;e<this._providers.length;++e)d.push(this._providers[e].get(this._name,a).then(function(a){return function(d){c._stores[a]=d}}(e)));return k.all(d).then(function(){c._cached=null;c._getCached()})},flush:function(){this._flush()}};f.prototype={get:function(a,c){if(this._currentPromises[a])return this._currentPromises[a];var d=new k,e=null;
c?this._cache.remove(a):e=this._cache.get(a);if(e!==null)d.resolve(e);else{this._currentPromises[a]=d;var b=this;this._service.get(a).then(function(c){b._cache.set(a,c);delete b._currentPromises[a];d.resolve(c)},function(c){c.status===404?(c={},b._cache.set(a,c),delete b._currentPromises[a],d.resolve(c)):(delete b._currentPromises[a],d.resolve(b._cache.get(a,!0)||{}))})}return d},put:function(a,c){this._cache.set(a,c);return this._service.put(a,c)}};e.prototype={get:function(a,c){if(this._currentPromise)return this._currentPromise;
var d=new k,e=null;c?this._cache.remove(a):e=this._cache.get(a);if(e!==null)d.resolve(e);else{this._currentPromise=d;var b=this;j("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(c){c=JSON.parse(c.response);b._cache.set(a,c[a]||{});b._currentPromise=null;d.resolve(c[a]||{})},function(c){c.xhr.status===401||c.xhr.status===404?(b._cache.set(a,{}),b._currentPromise=null,d.resolve({})):(b._currentPromise=null,c=b._cache.get(a,!0),c!==null?d.resolve(c[a]||{}):d.resolve({}))})}return d},
put:function(){var a=new k;a.resolve();return a}};d.prototype={get:function(a){var c=new k,a=this._cache.get(a);a!==null?c.resolve(a):c.resolve({});return c},put:function(a,c){var d=new k;this._cache.set(a,c);d.resolve();return d}};c.DEFAULT_SCOPE=1;c.LOCAL_SCOPE=2;c.USER_SCOPE=4;c.prototype={listenForChangedSettings:function(a){window.addEventListener("storage",a,!1);return"/orion/preferences/local/settings"},getPreferences:function(a,i){if(!i||typeof i!=="number"||i>7||i<1)i=c.DEFAULT_SCOPE|c.LOCAL_SCOPE|
c.USER_SCOPE;var d=[];c.USER_SCOPE&i&&this._userProvider.available()&&d.push(this._userProvider);c.LOCAL_SCOPE&i&&d.push(this._localProvider);c.DEFAULT_SCOPE&i&&d.push(this._defaultsProvider);var e=new b(a,d);return e.sync().then(function(){return e})},getSetting:function(a,c,d){for(var e,b=0;b<a.length;b++)if(a[b].label===c)for(var f=0;f<a[b].data.length;f++)if(a[b].data[f].label===d){e=a[b].data[f].value;break}return e}};return{PreferencesService:c}});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget"],function(h,k){function j(c,a){var i=Object.keys(c),d=Object.keys(a);if(i.length!==d.length)return!1;i.sort();d.sort();for(var e=0,b=i.length;e<b;e++){var f=i[e];if(f!==d[e])return!1;var l=c[f],f=a[f];if(l!==f&&JSON.stringify(l)!==JSON.stringify(f))return!1}return!0}function b(c){if(c.indexOf("://")===-1){var a=document.createElement("a");a.href=c;return a.href}return c}function g(c){var a=null;return{key:function(i){return(a=a||
Object.keys(c))[i]},getItem:function(a){return c[a]},setItem:function(i,d){c[i]=d;a=null},removeItem:function(i){delete c[i];a=null},clear:function(){(a=a||Object.keys(c)).forEach(function(a){delete c[a]}.bind(this));a=null}}}function f(c,a){return{type:c,plugin:a}}function e(c,a,i){function d(a,l,c){if(!C)return(new h).reject(Error("plugin not connected"));var n=z++,e=new h;e.then(null,function(a){x==="active"&&a instanceof Error&&a.name==="Cancel"&&i.postMessage({id:n,cancel:a.message||"Cancel"},
C)});M[String(n)]=e;i.postMessage({id:n,serviceId:a,method:l,params:c},C);return e.promise}function e(a){var l={};if(a.methods&&(a.methods.forEach(function(c){l[c]=function(){var l=Array.prototype.slice.call(arguments);return x==="active"?d(a.serviceId,c,l):n.start({"transient":!0}).then(function(){return d(a.serviceId,c,l)})}}),l.addEventListener&&l.removeEventListener)){var c=new k;l.dispatchEvent=c.dispatchEvent.bind(c);var i=l.addEventListener;l.addEventListener=function(a,l){c._namedListeners[a]||
i(a);c.addEventListener(a,l)};var b=l.removeEventListener;l.removeEventListener=function(a,l){c.removeEventListener(a,l);c._namedListeners[a]&&b(a)}}return l}function b(a){var l=JSON.parse(JSON.stringify(a.properties));l.__plugin__=c;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);l.objectClass=a;return l}function g(a){var l=e(a),c=b(a),c=i.registerService(a.names||a.type,l,c);D[a.serviceId]={registration:c,proxy:l}}function l(){i.persist(c,{created:y,headers:t,services:v,autostart:w,lastModified:A})}
function s(a){var l;try{if(a.method)if("manifest"===a.method||"plugin"===a.method){var c=a.params[0];G({headers:c.headers,services:c.services}).then(function(){r.resolve(n)})}else if("dispatchEvent"===a.method){var d=D[a.serviceId].proxy;d.dispatchEvent.apply(d,a.params)}else if("progress"===a.method)l=M[String(a.requestId)],l.progress.apply(l,a.params);else if("timeout"===a.method)r&&r.reject(a.error);else throw Error("Bad response method: "+a.method);else if(l=M[String(a.id)],delete M[String(a.id)],
a.error){var e=i.handleServiceError(n,a.error);l.reject(e)}else l.resolve(a.result)}catch(b){console.log("Plugin._responseHandler "+b)}}var n=this,a=a||{},y=a.created||(new Date).getTime(),t=a.headers||{},v=a.services||[],w=a.autostart,A=a.lastModified||0,x="installed",p,r,C,D={},z=0,M={},G;this._persist=l;this._resolve=function(){x="resolved";i.dispatchEvent(new f("resolved",n))};this._getAutostart=function(){return w};this._getCreated=function(){return y};this.getLocation=function(){return c};this.getHeaders=
function(){return JSON.parse(JSON.stringify(t))};this.getName=function(){var a=this.getHeaders();return a?a.name||"":null};this.getVersion=function(){var a=this.getHeaders();return a?a.version||"0.0.0":null};this.getLastModified=function(){return A};this.getServiceReferences=function(){var a=[];Object.keys(D).forEach(function(l){a.push(D[l].registration.getReference())});return a};this.getState=function(){return x};this.start=function(a){if(x==="uninstalled")return(new h).reject(Error("Plugin is uninstalled"));
if(p)return p.promise.then(this.start.bind(this,a));if(x==="active")return(new h).resolve();if(!a||!a["transient"]){var d=a&&a.lazy?"lazy":"started";d!==w&&(w=d,l())}d=i.getState();if(d!=="starting"&&d!=="active")return a["transient"]?(new h).reject(Error("start transient error")):(new h).resolve();if(x==="installed")try{this._resolve()}catch(e){return(new h).reject(e)}x==="resolved"&&v.forEach(function(a){g(a)});if(a&&a.lazy)return x!=="starting"&&(x="starting",i.dispatchEvent(new f("lazy activation",
n))),(new h).resolve();var b=new h;p=b;x="starting";i.dispatchEvent(new f("starting",n));r=new h;C=i.connect(c,s);r.then(function(){r=null;x="active";i.dispatchEvent(new f("started",n));p=null;b.resolve()},function(){r=null;x="stopping";i.dispatchEvent(new f("stopping",n));Object.keys(D).forEach(function(a){D[a].registration.unregister();delete D[a]});i.disconnect(C);C=null;x="resolved";p=null;i.dispatchEvent(new f("stopped",n));b.reject(Error("plugin activation error"))});return b.promise};this.stop=
function(a){if(x==="uninstalled")return(new h).reject(Error("Plugin is uninstalled"));if(p)return p.promise.then(this.stop.bind(this,a));if((!a||!a["transient"])&&"stopped"!==w)w="stopped",l();if(x!=="active"&&x!=="starting")return(new h).resolve();p=a=new h;x="stopping";i.dispatchEvent(new f("stopping",n));Object.keys(D).forEach(function(a){D[a].registration.unregister();delete D[a]});C&&(i.disconnect(C),C=null);x="resolved";p=null;i.dispatchEvent(new f("stopped",n));a.resolve();return a.promise};
G=function(a){if(x==="uninstalled")return(new h).reject(Error("Plugin is uninstalled"));if(!a)return A===0&&(A=(new Date).getTime(),l()),i.loadManifest(c).then(G);var d=t,e=v,y=w;t=a.headers||{};v=a.services||{};w=a.autostart||w;a.lastModified?A=a.lastModified:(A=(new Date).getTime(),l());if(j(t,d)&&j(v,e)&&w===y)return(new h).resolve();if(x==="active"||x==="starting"){var m=[];Object.keys(v).forEach(function(a){var l=v[a];m.push(a);var c=D[a];if(c){if(j(l.methods,Object.keys(c.proxy))){var a=b(l),
d=c.registration.getReference(),i={};d.getPropertyKeys().forEach(function(a){i[a]=d.getProperty(a)});j(a,i)||c.registration.setProperties(a);return}c.registration.unregister();delete D[a]}g(l)});Object.keys(D).forEach(function(a){m.indexOf(a)===-1&&(D[a].registration.unregister(),delete D[a])})}x==="active"&&(i.disconnect(C),r=new h,C=i.connect(c,s),r.then(function(){r=null},function(){r=null;x="stopping";i.dispatchEvent(new f("stopping"),n);Object.keys(D).forEach(function(a){D[a].registration.unregister();
delete D[a]});i.disconnect(C);C=null;x="resolved";i.dispatchEvent(new f("stopped",n))}));return(new h).resolve()};this.update=function(a){return G(a).then(function(){i.dispatchEvent(new f("updated",n))})};this.uninstall=function(){if(x==="uninstalled")return(new h).reject(Error("Plugin is uninstalled"));if(x==="active"||x==="starting"||x==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));i.removePlugin(this);x="uninstalled";i.dispatchEvent(new f("uninstalled",
n));return(new h).resolve()}}var d=/^http[s]?/i;return{Plugin:e,PluginRegistry:function(c,a){function i(a){var l=a.source;j.some(function(c){if(l===c.target){if(typeof c.useStructuredClone==="undefined")c.useStructuredClone=typeof a.data!=="string";c.handler(c.useStructuredClone?a.data:JSON.parse(a.data));return!0}})}var a=a||{},m=a.storage||localStorage;m.getItem||(m=g(m));var o="installed",q=[],j=[],l=new k,s={},n={registerService:c.registerService.bind(c),connect:function(l,c,d){function i(a){a=
Error(a);a.name="timeout";c({method:"timeout",error:a})}var n={handler:c,url:l},e=setTimeout(i.bind(null,"Load timeout for: "+l),d||15E3),b=document.createElement("iframe");b.name=l+"_"+(new Date).getTime();if(!a.visible)b.style.display="none",b.style.visibility="hidden";b.src=l;b.onload=function(){clearTimeout(e);setTimeout(i.bind(null,"Plugin handshake timeout for: "+l),5E3)};b.sandbox="allow-scripts allow-same-origin";document.body.appendChild(b);n.target=b.contentWindow;n.close=function(){b&&
(document.body.removeChild(b),b=null)};j.push(n);return n},disconnect:function(a){for(var l=0;l<j.length;l++)if(a===j[l]){j.splice(l,1);try{a.close()}catch(c){}break}},removePlugin:function(a){for(var l=0;l<q.length;l++)if(a===q[l]){q.splice(l,1);break}m.removeItem("plugin."+a.getLocation())},persist:function(a,l){m.setItem("plugin."+a,JSON.stringify(l))},postMessage:function(a,l){l.target.postMessage(l.useStructuredClone?a:JSON.stringify(a),l.url)},dispatchEvent:function(a){try{l.dispatchEvent(a)}catch(c){console&&
console.log("PluginRegistry.dispatchEvent "+c)}},loadManifest:function(a){var l=new h,c=n.connect(a,function(a){c&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],n.disconnect(c),c=null,l.resolve(a)):"timeout"===a.method&&(n.disconnect(c),c=null,l.reject(a.error)))});return l.promise},getState:function(){return o},handleServiceError:function(a,l){if(l&&l.status===401){var c=a.getHeaders(),i=a.getName()||a.getLocation(),n=document.createElement("span");n.appendChild(document.createTextNode("Authentication required for: "+
i+"."));if(c.login)n.appendChild(document.createTextNode(" ")),i=document.createElement("a"),i.target="_blank",i.textContent="Login",i.href=c.login,d.test(i.href)?(n.appendChild(i),n.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+c.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(n)}}if(l.__isError){var e=l,l=Error(e.message);Object.keys(e).forEach(function(a){l[a]=e[a]});delete l.__isError}return l}};this.getLocation=
function(){return"System"};this.getHeaders=function(){return{}};this.getName=function(){return"System"};this.getVersion=function(){return"0.0.0"};this.getLastModified=function(){return 0};this.getState=n.getState;this.init=function(){if(!(o==="starting"||o==="active"||o==="stopping")){addEventListener("message",i,!1);for(var l=[],c=0,d=m.length;c<d;c++)l.push(m.key(c));l.forEach(function(a){if(a.indexOf("plugin.")===0){var l=a.substring(7),a=JSON.parse(m.getItem(a));a.created&&q.push(new e(l,a,n))}});
q.sort(function(a,l){return a._getCreated()<l._getCreated()?-1:1});a.plugins&&Object.keys(a.plugins).forEach(function(l){l=b(l);if(!this.getPlugin(l)){var c=a.plugins[l],c=typeof c==="object"||{};c.autostart=c.autostart||a.defaultAutostart||"lazy";q.push(new e(l,c,n))}}.bind(this));o="starting"}};this.start=function(){o!=="starting"&&this.init();if(o!=="starting")return(new h).reject("Cannot start framework. Framework is already "+o+".");var a=[],l=(new Date).getTime();q.forEach(function(c){var i=
c._getAutostart();c.getLastModified()===0?a.push(c.update().then(function(){if("started"===i)return c.start({"transient":!0});if("lazy"===i)return c.start({lazy:!0,"transient":!0});c._resolve()})):"started"===i?a.push(c.start({"transient":!0})):"lazy"===i?(a.push(c.start({lazy:!0,"transient":!0})),l>c.getLastModified()+864E5&&c.update()):c._resolve()});return h.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){o="active"})};this.stop=function(){if(o!=="starting"&&o!=="active")return(new h).reject("Cannot stop registry. Registry is already "+
o+".");o="stopping";var a=[];q.forEach(function(l){a.push(l.stop({"transient":!0}))});return h.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){removeEventListener("message",i);o="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new h).reject("Cannot uninstall registry")};this.installPlugin=function(a,l){var a=b(a),c=this.getPlugin(a);if(c)return(new h).resolve(c);if(s[a])return s[a];if(l)return c=new e(a,l,n),q.push(c),
c._persist(),n.dispatchEvent(new f("installed",c)),(new h).resolve(c);var i=n.loadManifest(a).then(function(l){c=new e(a,l,n);q.push(c);c._persist();delete s[a];n.dispatchEvent(new f("installed",c));return c},function(l){delete s[a];throw l;});return s[a]=i};this.getPlugins=function(){return q.slice()};this.getPlugin=function(a){var l=null,a=b(a);q.some(function(c){if(a===c.getLocation())return l=c,!0});return l};this.addEventListener=l.addEventListener.bind(l);this.removeEventListener=l.removeEventListener.bind(l);
this.resolvePlugins=function(){var a=!0;q.forEach(function(l){a=a&&l._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function h(b,g){function f(a){var i=a.getProperty("service.id"),e=this.addingService(a);e&&(d[i]=a,c[i]=e)}function e(a){var i=a.getProperty("service.id"),e=c[i];delete d[i];delete c[i];this.removedService(a,e)}this.serviceRegistry=b;var d={},c={},a=k,i,m;this.close=function(){if(a!==j)throw"Already closed";a=k;b.removeEventListener("registered",i);b.removeEventListener("unregistering",m);m=i=null;var c=this;this.getServiceReferences().forEach(function(a){e.call(c,
a)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){return d.length?Object.keys(d).map(function(a){return d[a]}):null};this.open=function(){if(a!==k)throw"Already open";a=j;var c=this;i=function(a){if(a.serviceReference.getProperty("objectClass").indexOf(g)!==-1&&(f.call(c,a.serviceReference),typeof c.onServiceAdded==="function"))return c.onServiceAdded(a.serviceReference,c.serviceRegistry.getService(a.serviceReference))};m=function(a){a.serviceReference.getProperty("objectClass").indexOf(g)!==
-1&&e.call(c,a.serviceReference)};b.addEventListener("registered",i);b.addEventListener("unregistering",m);b.getServiceReferences(g).forEach(function(a){f.call(c,a)});if(typeof this.onOpen==="function")this.onOpen()}}var k=0,j=1;h.prototype={addingService:function(b){return this.serviceRegistry.getService(b)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return h});
define("orion/config",["orion/Deferred","orion/serviceTracker"],function(h,k){var j,b,g,f,e,d="pid";j=function(a,c,e){function b(a,l,d){l.forEach(function(e,b){try{var m=a[b].getProperty("__plugin__"),f=m&&c.getPlugin(m);(!m||f&&f.getState()==="active")&&l[b].updated(d)}catch(g){typeof console!=="undefined"&&console.log(g)}})}k.call(this,a,"orion.cm.managedservice");var f={},g={},l=function(l){var c=[];l.plugin.getServiceReferences().forEach(function(l){if(l.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var i=l.getProperty(d),l=a.getService(l);i&&l&&(i=(i=e._find(i))&&i.getProperties(),c.push(l.updated(i)))}});return h.all(c)};this.addingService=function(l){var c=l.getProperty(d),i=a.getService(l);if(!c||!i)return null;f[c]||(f[c]=[]);g[c]||(g[c]=[]);f[c].push(l);g[c].push(i);return i};this.onServiceAdded=function(a,l){var c=a.getProperty(d),c=e._find(c);b([a],[l],c&&c.getProperties())};this.onOpen=function(){c.addEventListener("started",l)};this.onClose=function(){c.removeEventListener("started",
l)};this.notifyUpdated=function(a){var l=a.getPid();b(f[l]||[],g[l]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();b(f[a]||[],g[a]||[],null)};this.removedService=function(a,l){var c=a.getProperty(d),i=f[c],e=g[c];i.length>1?i.splice(i.indexOf(a),1):delete f[c];e.length>1?e.splice(e.indexOf(l),1):delete g[c]}};b=function(){function a(a,c,d){this.store=new g(this,d);this.configAdmin=new f(this,this.store);this.tracker=new j(a,c,this.store)}a.prototype={getConfigurationAdmin:function(){var a=
this;return this.configAdmin._init().then(function(c){a.tracker.open();return c})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();f=function(){function a(a,c){this.factory=a;this.store=c}a.prototype={_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},listConfigurations:function(){return this.store.list()}};return a}();var c="/cm/configurations";
g=function(){function a(a,b){this.factory=a;this.prefsService=b;this.configs=Object.create(null);this.pref=null;var f=this;this.initPromise=this.prefsService.getPreferences(c).then(function(a){f.pref=a;a.keys().forEach(function(c){if(!f.configs[c]){var l=a.get(c);typeof l==="object"&&l!==null&&Object.keys(l).length>0&&(l[d]=c,f.configs[c]=new e(f.factory,f,l))}})})}a.prototype={_init:function(){return this.initPromise},_find:function(a){return this.configs[a]||null},get:function(a){var c=this._find(a);
c||(c=new e(this.factory,this,a),this.configs[a]=c);return c},list:function(){var a=this,c=[];this.pref.keys().forEach(function(d){(d=a._find(d))&&d.getProperties()!==null&&c.push(d)});return c},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,c){this.pref.put(a,c.getProperties(!0)||{})}};return a}();e=function(){function a(a){for(var c={},d=Object.keys(a),i=0;i<d.length;i++){var l=d[i],e=a[l];c[l]=e instanceof Array?e.slice():e}return c}function c(i,e,b){this.factory=
i;this.store=e;if(b!==null&&typeof b==="object")this.pid=b[d],i=a(b),delete i[d],this.properties=i;else if(typeof b==="string")this.pid=b,this.properties=null;else throw Error("Invalid pid/properties "+b);}c.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(c){this._checkRemoved();var i=null;if(this.properties&&(i=a(this.properties),!c))i[d]=this.pid;return i},remove:function(){this._checkRemoved();
this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=!0},update:function(c){this._checkRemoved();c=a(c);delete c[d];this.properties=c;this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return c}();return{ConfigurationAdminFactory:b}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(h,k,j,b,g,f){var e;return{startup:function(){if(e)return e;e=new k;var d=window.serviceRegistry=new j.ServiceRegistry,c=new b.PreferencesService(d);return c.getPreferences("/plugins").then(function(a){var i={plugins:{}};a.keys().forEach(function(c){var d=h.toUrl(c);i.plugins[d]=a[c]});var b=window.pluginRegistry=new g.PluginRegistry(d,i);return b.start().then(function(){if(d.getServiceReferences("orion.core.preference.provider").length>
0)return c.getPreferences("/plugins",c.USER_SCOPE).then(function(a){var c=[];a.keys().forEach(function(a){a=h.toUrl(a);b.getPlugin(a)||c.push(b.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return k.all(c,function(a){console.log(a)})})}).then(function(){return(new f.ConfigurationAdminFactory(d,b,c)).getConfigurationAdmin().then(d.registerService.bind(d,"orion.cm.configadmin"))}).then(function(){var a=d.getService("orion.core.auth");
if(a){var c=a.getUser().then(function(c){if(c)localStorage.setItem("lastLogin",(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){window.location=a})}),i=localStorage.getItem("lastLogin");if(!i||i<(new Date).getTime()-9E5)return c}}).then(function(){var a={serviceRegistry:d,preferences:c,pluginRegistry:b};e.resolve(a);return a})})}}});
define("orion/webui/littlelib",["require"],function(){function h(d,c){c||(c=document);return c.querySelectorAll(d)}function k(d,c){var a=d.compareDocumentPosition(c);return d===c||Boolean(a&16)}function j(d){if(d.tabIndex>=0)return d;if(d.hasChildNodes())for(var c=0;c<d.childNodes.length;c++){var a=j(d.childNodes[c]);if(a)return a}return null}function b(d){if(d.tabIndex>=0)return d;if(d.hasChildNodes())for(var c=d.childNodes.length-1;c>=0;c--){var a=b(d.childNodes[c]);if(a)return a}return null}function g(d,
c){if(d.nodeType===3){var a=f.exec(d.nodeValue);a&&a.length>1&&d.parentNode.replaceChild(document.createTextNode(c[a[1]]||a[1]),d)}if(d.hasChildNodes())for(a=0;a<d.childNodes.length;a++)g(d.childNodes[a],c)}var f=/\$\{([^\}]+)\}/,e=[];return{$:function(d,c){c||(c=document);return c.querySelector(d)},$$:h,$$array:function(d,c){return Array.prototype.slice.call(h(d,c))},node:function(d){var c=d;typeof d==="string"&&(c=document.getElementById(d));return c},contains:k,bounds:function(d){d=d.getBoundingClientRect();
return{left:d.left+document.body.scrollLeft,top:d.top+document.body.scrollTop,width:d.width,height:d.height}},empty:function(d){for(;d.hasChildNodes();)d.removeChild(d.firstChild)},firstTabbable:j,lastTabbable:b,stop:function(d){window.document.all?d.keyCode=0:(d.preventDefault(),d.stopPropagation())},processTextNodes:g,addAutoDismiss:function(d,c){e.length===0&&document.addEventListener("click",function(a){for(var c=[],d=0;d<e.length;d++){for(var b=e[d].excludeNodes,f=e[d].dismiss,g=!1,l=!0,s=0;s<
b.length;s++)if((g=document.compareDocumentPosition(document,b[s])!==1)&&k(b[s],a.target)){l=!1;break}l&&(f(),g=document.compareDocumentPosition(document,b[s])!==1);g&&c.push(e[d])}e=c},!0);e.push({excludeNodes:d,dismiss:c})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Repositories:"Repositories",Shell:"Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor","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":"Report a Bug",
"Privacy Policy":"Privacy Policy","Terms of Use":"Terms of Use","Copyright Agent":"Copyright Agent","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.":"Orion build I20130222-1257. See the FAQ for terms of service","Add this page to the favorites list":"Add this page to the favorites list","LOG: ":"LOG: ",Switch:"Switch","Switch the type of outliner used":"Switch the type of outliner used",
Outliner:"Outliner","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 Outliner":"Toggle Outliner","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(h,k){var j={root:k};Object.keys(h).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=h[b])});return j});
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(h,k){var j={root:k};Object.keys(h).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=h[b])});return j});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(h,k){function j(b){this._init(b)}j.prototype={_init:function(b){this._node=k.node(b.node);if(!this._node)throw"no dom node for tooltip found";this._position=b.position||["right","above","below","left"];this._text=b.text;this._hideDelay=b.hideDelay===void 0?200:b.hideDelay;this._tailSize=b.tailSize||10;this._trigger=b.trigger||"mouseover";this._afterShowing=b.afterShowing;this._afterHiding=b.afterHiding;var g=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",function(e){e.target===g._node&&(g.show(),k.stop(e))},!1);else if(this._trigger==="mouseover"){this._showDelay=b.showDelay===void 0?1E3:b.showDelay;b=["mouseout","click"];this._node.addEventListener("mouseover",function(e){k.contains(g._node,e.target)&&(g.show(),k.stop(e))},!1);for(var f=0;f<b.length;f++)this._node.addEventListener(b[f],function(e){k.contains(g._node,e.target)&&g.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 b=this;k.addAutoDismiss([this._tip,this._node],function(){b.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(b._timeout)window.clearTimeout(b._timeout),b._timeout=null;b._tip.addEventListener("mouseout",function(g){k.contains(b._tip,g.target)&&(b.hide(),k.stop(g))},!1)},!1)}return this._tip},_positionTip:function(b,g){this._makeTipNode();if(this._tailBorder)this._tip.removeChild(this._tailBorder),this._tailBorder=null,this._tip.removeChild(this._tail),this._tail=null;b==="left"?this._tipInner.classList.add("left"):
this._tipInner.classList.remove("left");var f=k.bounds(this._node),e=k.bounds(this._tipInner),d;switch(b){case "above":d=f.top-e.height-this._tailSize-1;f=f.left-this._tailSize;break;case "below":d=f.top+f.height+this._tailSize+1;f=f.left-this._tailSize;break;case "left":d=f.top-this._tailSize/2;f=f.left-e.width-this._tailSize-1;break;default:d=f.top-this._tailSize/2,f=f.left+f.width+this._tailSize+1}var c=k.bounds(document.documentElement);if(d+e.height>c.height)if(g)d=c.height-e.height-1;else return!1;
if(f+e.width>c.width)if(g)f=c.width-e.width-1;else return!1;if(f<0)if(g)f=4;else return!1;if(d<0)if(g)d=4;else return!1;this._tailBorder=document.createElement("span");this._tailBorder.classList.add("tooltipTailBorderFrom"+b);this._tail=document.createElement("span");this._tail.classList.add("tooltipTailFrom"+b);b==="above"||b==="left"?(this._tip.appendChild(this._tailBorder),this._tip.appendChild(this._tail)):(this._tip.insertBefore(this._tailBorder,this._tipInner),this._tip.insertBefore(this._tail,
this._tipInner));this._tip.style.top=d+"px";this._tip.style.left=f+"px";this._tip.style.width=e.width+"px";this._tip.style.height=e.height+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){var b=this;if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){for(var g=!1,f=0;!g&&f<b._position.length;)g=b._positionTip(b._position[f]),
f++;g||b._positionTip(b._position[0],!0);b._tip.classList.add("tooltipShowing");b._afterShowing&&b._afterShowing()},this._showDelay)}},hide:function(b){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(b===void 0)b=this._hideDelay;var g=this;this._timeout=window.setTimeout(function(){g._tip.classList.remove("tooltipShowing");g._afterHiding&&g._afterHiding()},b)}},destroy:function(){if(this._timeout)window.clearTimeout(this._timeout),
this._timeout=null;if(this._tip)document.body.removeChild(this._tip),this._tailBorder=this._tail=this._tipInner=this._tip=null}};j.prototype.constructor=j;return{Tooltip:j}});
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...",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(h,k){var j={root:k};Object.keys(h).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=h[b])});return j});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(h,k,j,b){function g(){}g.prototype={_initialize:function(f,e,d,c,a){this._tooltip=new b.Tooltip({node:f,hideDelay:a||0,afterShowing:this._afterShowingFunction(e).bind(this),afterHiding:d,trigger:c?c:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";f=document.createRange();f.selectNode(this.$parent);f=f.createContextualFragment(this.TEMPLATE);
this.messages&&j.processTextNodes(f,h);this.$parent.appendChild(f);var i=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===j.KEY.ESCAPE&&i.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(b){for(var e=0;e<b.childNodes.length;e++){var d=b.childNodes[e];d.id&&(this["$"+d.id]=d);this._bindElements(d)}},_afterShowingFunction:function(b){return function(){b&&b.bind(this)();if(!this.customFocus){var e=
j.firstTabbable(this.$parent);e&&e.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};g.prototype.constructor=g;return{PopupDialog:g}});
define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib"],function(h,k){function j(b){var g=window.navigator.platform.indexOf("Mac")!==-1;return g&&b.metaKey||!g&&b.ctrlKey}return{getUserKeyString:function(b){var g="",f=navigator.platform.indexOf("Mac")!==-1;b.mod1&&(g+=f?"Cmd+":"Ctrl+");b.mod2&&(g+="Shift+");b.mod3&&(g+="Alt+");b.mod4&&f&&(g+="Ctrl+");if(b.alphaKey)return g+b.alphaKey;for(var e in k.KEY)if(typeof(k.KEY[e]==="number")&&k.KEY[e]===b.keyCode)return g+e;var d;switch(b.keyCode){case 59:d=
b.mod2?":":";";break;case 61:d=b.mod2?"+":"=";break;case 188:d=b.mod2?"<":",";break;case 190:d=b.mod2?">":".";break;case 191:d=b.mod2?"?":"/";break;case 192:d=b.mod2?"~":"`";break;case 219:d=b.mod2?"{":"[";break;case 220:d=b.mod2?"|":"\\";break;case 221:d=b.mod2?"}":"]";break;case 222:d=b.mod2?'"':"'"}return d?g+d:b.keyCode>=112&&b.keyCode<=123?g+"F"+(b.keyCode-111):g+String.fromCharCode(b.keyCode)},getUserText:function(b,g,f,e,d,c,a,i,m){var o=!1,a=function(a){return function(l){if(!o){var i=k.node(b),
n=i.value;if(i)if(a&&l.keyCode===k.KEY.ESCAPE){if(f)g.style.display="inline";i.parentNode.removeChild(i);o=!0;c&&c()}else if(!(a&&l.keyCode!==k.KEY.ENTER)){if(n.length===0||!m&&n===e){if(f)g.style.display="inline"}else d(n);o=!0;i.parentNode&&i.parentNode.removeChild(i);c&&c()}}}},h=document.createElement("input");h.id=b;h.value=e||"";g.parentNode.insertBefore(h,g.nextSibling);h.classList.add("userEditBoxPrompt");if(f)g.style.display="none";h.addEventListener("keydown",a(!0),!1);h.addEventListener("blur",
a(!1),!1);window.setTimeout(function(){h.focus();if(e){var a=k.node(b),c=i?e.indexOf(i):-1;if(c>0)if(a.createTextRange)a=a.createTextRange(),a.collapse(!0),a.moveStart("character",0),a.moveEnd("character",c),a.select();else if(a.setSelectionRange)a.setSelectionRange(0,c);else{if(a.selectionStart!==void 0)a.selectionStart=0,a.selectionEnd=c}else a.select()}},0)},openInNewWindow:j,followLink:function(b,g){g&&j(g)?window.open(b):window.location=b},createButton:function(b,g){var f=document.createElement("span");
f.role="button";f.tabIndex=0;f.appendChild(document.createTextNode(b));f.className="commandButton commandMargins";f.addEventListener("click",function(e){g();k.stop(e)},!1);f.addEventListener("keydown",function(e){if(e.keyCode===k.KEY.ENTER||e.keyCode===k.KEY.SPACE)g(),k.stop(e)},!1);return f}}});
define("orion/webui/dropdown",["require","orion/webui/littlelib"],function(h,k){function j(b){this._init(b)}j.prototype={_init:function(b){this._dropdownNode=k.node(b.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=b.populate;var g=this;this._triggerNode.addEventListener("click",function(b){g.toggle()&&k.stop(b)},!1);this._triggerNode.tagName.toLowerCase()===
"span"&&this._triggerNode.addEventListener("keydown",function(b){if(b.keyCode===k.KEY.ENTER||b.keyCode===k.KEY.SPACE)g.toggle(),k.stop(b)},!1);this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},toggle:function(){return this._triggerNode.classList.contains("dropdownTriggerOpen")?this.close():this.open()},open:function(){this._populate&&(this.empty(),this._populate(this._dropdownNode));var b=this.getItems();if(b.length>0){if(!this._hookedAutoDismiss)k.addAutoDismiss([this._triggerNode,
this._dropdownNode],this.close.bind(this)),this._hookedAutoDismiss=!0;this._positionDropdown();this._triggerNode.classList.add("dropdownTriggerOpen");this._dropdownNode.classList.add("dropdownMenuOpen");b[0].focus();return!0}return!1},_positionDropdown:function(){this._dropdownNode.style.left="";var b=k.bounds(this._dropdownNode),g=k.bounds(this._boundingNode(this._triggerNode));if(b.left+b.width>g.left+g.width)this._dropdownNode.style.right=0},_boundingNode:function(b){return b.style.right!==""||
b.style.position==="absolute"||!b.parentNode||!b.parentNode.style?b:this._boundingNode(b.parentNode)},close:function(b){this._triggerNode.classList.remove("dropdownTriggerOpen");this._dropdownNode.classList.remove("dropdownMenuOpen");b&&this._triggerNode.focus();return!0},getItems:function(){var b=[],g=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(f){f.parentNode.parentNode===g._dropdownNode&&b.push(f)});return b},empty:function(){var b=this;
k.$$array("li",this._dropdownNode).forEach(function(g){g.parentNode===b._dropdownNode&&g.parentNode.removeChild(g)})},_dropdownKeyDown:function(b){if(b.keyCode===k.KEY.UP||b.keyCode===k.KEY.DOWN||b.keyCode===k.KEY.RIGHT||b.keyCode===k.KEY.ENTER||b.keyCode===k.KEY.LEFT){var g=this.getItems(),f=document.activeElement;if(g.length&&g.length>0&&f){var e=g.indexOf(f);e>=0&&(b.keyCode===k.KEY.UP&&e>0?(e--,g[e].focus()):b.keyCode===k.KEY.DOWN&&e<g.length-1?(e++,g[e].focus()):b.keyCode===k.KEY.ENTER||b.keyCode===
k.KEY.RIGHT?f.classList.contains("dropdownTrigger")&&f.dropdown&&f.dropdown.open():b.keyCode===k.KEY.LEFT&&f.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),k.stop(b))}}else b.keyCode===k.KEY.ESCAPE&&(this.close(!0),k.stop(b))}};j.prototype.constructor=j;return{Dropdown:j}});
define("orion/explorers/navigationUtils",[],function(){function h(h,b){if(!k&&h)h.push({domNode:b}),b.tabIndex=-1,b.style.outline="none"}var k=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(j,b,g){j&&(j=j.getGridNavHolder(b,!0))&&h(j,g)},generateNavGrid:h,removeNavGrid:function(h,b){if(h)for(var g=0;g<h.length;g++)if(h[g].domNode===b){h.splice(g,1);break}}}});
define("orion/dialogs",[],function(){function h(h){this._serviceRegistry=h;this._serviceRegistration=h.registerService("orion.page.dialog",this)}h.prototype={confirm:function(h,j){j(window.confirm(h))},openFiles:function(){}};h.prototype.constructor=h;return{DialogService:h}});
define("orion/selection",["orion/EventTarget"],function(h){function k(j,b){b||(b="orion.page.selection");this._serviceRegistry=j;h.attach(this);this._serviceRegistration=j.registerService(b,this);this._selections=null}k.prototype={getSelection:function(h){h(this._getSingleSelection())},getSelections:function(h){h(this._selections||[])},_getSingleSelection:function(){return this._selections&&this._selections.length>0?this._selections[0]:null},setSelections:function(h){var b=this._selections;this._selections=
Array.isArray(h)?h.length>0?h:null:h?[h]:null;b!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};k.prototype.constructor=k;return{Selection:k}});
define("orion/i18nUtil",["require","orion/Deferred"],function(h,k){function j(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 b={};return{getMessageBundle:function(g){function f(){h(["i18n!"+g],function(a){if(a){var c=g;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+c,JSON.stringify(a));delete a._expires}e.resolve(a)})}if(b[g])return b[g];var e=new k;b[g]=
e;var d=j(g);if(d)return e.resolve(d),e;try{h([g],f)}catch(c){h(["orion/i18n!"+g],f)}return e},formatMessage:function(b){var f=arguments;return b.replace(/\$\{([^\}]+)\}/g,function(e,d){return f[(d<<0)+1]})}}});
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 from ${0}":"Exporting from ${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","Click on an item to make a selection, then use this menu to see what actions are available.":"Click on an item to make a selection, then use this menu to see what actions are available.",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}?"});define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(h,k){var j={root:k};Object.keys(h).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=h[b])});return j});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(h,k,j){function b(e,d,c){if(!e[d])throw d+h[" is not supported in this file system"];return e[d].apply(e,c)}function g(e,d,c,a){if(!e.readBlob)throw h["source file service does not support binary read"];if(!c.writeBlob)throw h["target file service does not support binary write"];if(d[d.length-1]!=="/")return b(e,"readBlob",[d]).then(function(d){return b(c,"writeBlob",[a,d])});var i=a.substring(0,
a.length-1),f=decodeURIComponent(i.substring(i.lastIndexOf("/")+1)),i=i.substring(0,i.lastIndexOf("/")+1);return b(c,"createFolder",[i,f]).then(function(){},function(){}).then(function(){return b(e,"fetchChildren",[d]).then(function(d){for(var i=[],b=0;b<d.length;++b){var l=d[b].Location,s=l;d[b].Directory&&(s=l.substring(0,l.length-1));s=decodeURIComponent(s.substring(s.lastIndexOf("/")+1));s=a+encodeURIComponent(s);d[b].Directory&&(s+="/");i[b]=g(e,l,c,s)}return k.all(i)})})}function f(e,d){function c(a){var c=
new k;c.reject(h["No Matching FileService for location:"]+a);return c}var a=e.getServiceReferences("orion.core.file"),i=a;if(d)for(var i=[],b=0;b<a.length;++b)d(a[b])&&i.push(a[b]);for(var f=[],g=[],u=[],l=[],s={fetchChildren:function(){var a=new k;a.resolve(l);return a},createWorkspace:function(){var a=new k;a.reject(h["no file service"]);return a},loadWorkspaces:function(){var a=new k;a.reject(h["no file service"]);return a},loadWorkspace:function(){var a=new k;window.setTimeout(function(){a.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:h["File Servers"],Location:"/",Children:l,ChildrenLocation:"/"})},100);return a},search:c,createProject:c,createFolder:c,createFile:c,deleteFile:c,moveFile:c,copyFile:c,read:c,write:c},a=0;a<i.length;++a)l[a]={Directory:!0,Length:0,LocalTimeStamp:0,Location:i[a].getProperty("top"),ChildrenLocation:i[a].getProperty("top"),Name:i[a].getProperty("Name")},b=i[a].getProperty("pattern")||".*",b[0]!=="^"&&(b="^"+b),f[a]=RegExp(b),g[a]=e.getService(i[a]),u[a]=i[a].getProperty("Name"),
i[a].getProperty("NameKey")&&i[a].getProperty("nls")&&j.getMessageBundle(i[a].getProperty("nls")).then(function(a,c){l[a].Name=c[i[a].getProperty("NameKey")];u[a]=c[i[a].getProperty("NameKey")]}.bind(this,a));this._getServiceIndex=function(a){if(a==="/")return-1;else if(!a||a.length&&a.length===0)return g[0]?0:-1;for(var c=0;c<f.length;++c)if(f[c].test(a))return c;throw h["No Matching FileService for location:"]+a;};this._getService=function(a){a=this._getServiceIndex(a);return a===-1?s:g[a]};this._getServiceName=
function(a){a=this._getServiceIndex(a);return a===-1?s.Name:u[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return a===-1?s.Location:l[a].Location}}f.prototype={getService:function(b){return this._getService(b)},fileServiceName:function(b){return this._getServiceName(b)},fileServiceRootURL:function(b){return this._getServiceRootURL(b)},fetchChildren:function(e){return b(this._getService(e),"fetchChildren",arguments)},createWorkspace:function(e){return b(this._getService(),"createWorkspace",
arguments)},loadWorkspaces:function(){return b(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(e){return b(this._getService(e),"loadWorkspace",arguments)},createProject:function(e,d,c,a){return b(this._getService(e),"createProject",arguments)},createFolder:function(e,d){return b(this._getService(e),"createFolder",arguments)},createFile:function(e,d){return b(this._getService(e),"createFile",arguments)},deleteFile:function(e){return b(this._getService(e),"deleteFile",arguments)},
moveFile:function(e,d,c){var a=this._getService(e),i=this._getService(d);if(a===i)return b(a,"moveFile",arguments);var f=e[e.length-1]==="/",o=d;o[o.length-1]!=="/"&&(o+="/");if(c)o+=encodeURIComponent(c);else{var h=e;f&&(h=h.substring(0,h.length-1));o+=h.substring(h.lastIndexOf("/")+1)}f&&o[o.length-1]!=="/"&&(o+="/");return g(a,e,i,o).then(function(){return b(a,"deleteFile",[e])})},copyFile:function(e,d,c){var a=this._getService(e),i=this._getService(d);if(a===i)return b(a,"copyFile",arguments);
var f=e[e.length-1]==="/",o=d;o[o.length-1]!=="/"&&(o+="/");if(c)o+=encodeURIComponent(c);else{var h=e;f&&(h=h.substring(0,h.length-1));o+=h.substring(h.lastIndexOf("/")+1)}f&&o[o.length-1]!=="/"&&(o+="/");return g(a,e,i,o)},read:function(e,d){return b(this._getService(e),"read",arguments)},write:function(e,d,c){return b(this._getService(e),"write",arguments)},remoteImport:function(e,d){return b(this._getService(e),"remoteImport",arguments)},remoteExport:function(e,d){return b(this._getService(e),
"remoteExport",arguments)},search:function(e){return b(this._getService(e.resource),"search",arguments)}};f.prototype.constructor=f;return{FileClient:f}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(h,k){function j(b,d,c){return b[d].apply(b,c)}function b(b){this._location=b}function g(){var b=new k;b.reject(h["No Matching OperationService for location:"]+this._location);return b}function f(e){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=e.getService("orion.core.preference");for(var d=e.getServiceReferences("orion.core.operation"),
c=0;c<d.length;c++){var a=e.getService(d[c]);this._services[c]=a;a=d[c].getProperty("pattern")||".*";a[0]!=="^"&&(a="^"+a);this._patterns[c]=RegExp(a)}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 b(a)}}b.prototype={getOperation:g,getOperations:g,removeCompletedOperations:g,removeOperation:g,cancelOperation:g};b.prototype.constructor=b;f.prototype={getOperations:function(){var b=
new k;if(this._operations)return b.resolve(this._operations),b;var d=this;this._preferenceService.getPreferences("/operations").then(function(c){d._operations=c;b.resolve(d._operations)});return b},getOperation:function(b){return j(this._getService(b),"getOperation",arguments)},removeCompletedOperations:function(){for(var b=[],d=this,c=0;c<this._services.length;c++){var a=this._patterns[c],i=new k;b[c]=i.promise;j(this._services[c],"removeCompletedOperations").then(function(c){return function(i){Array.isArray(i)&&
d.getOperations.bind(d)().then(function(d){for(var b=d.keys(),l=0;l<b.length;l++){var e=b[l];a.test(e)&&i.indexOf(e)<0&&d.remove(e)}c.resolve()})}}(i),function(a){return function(c){a.reject(c)}}(i))}return k.all(b)},removeOperation:function(b){var d=this;return j(this._getService(b),"removeOperation",arguments).then(function(){d.getOperations.bind(d)().then(function(c){c.remove(b)})},function(c){return c},function(c){return c})}};f.prototype.constructor=f;return{OperationsClient:f}});
define("orion/search/nls/root/messages",{"Find:":"Find:","Find With":"Find With","ReplaceWith:":"ReplaceWith:","Replace With":"Replace With","Show all":"Show all","Case sensitive":"Case sensitive","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",
"Not found":"Not found","Replacing all...":"Replacing all..."," matches":" matches","Replaced ":"Replaced ","Nothing replaced":"Nothing replaced","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.","Save Search":"Save Search","Save search query":"Save search query",
"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","Search Again":"Search Again","Search again":"Search again","< 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",Searches:"Searches","You can save frequently used by searches by choosing ${0} in the search toolbar.":"You can save frequently used by searches by choosing ${0} in the search toolbar."});define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(h,k){var j={root:k};Object.keys(h).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=h[b])});return j});
define("orion/editor/regex",[],function(){return{escape:function(h){return h.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(h){return(h=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(h))?{pattern:h[1],flags:h[2]}:null}}});
define("orion/URITemplate",[],function(){function h(c){this._text=c}function k(c,a){if(a==="U")return encodeURIComponent(c).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if(a==="U+R")return encodeURI(c).replace(/%5B/g,"[").replace(/%5D/g,"]");if(a==="U+R-,")return encodeURI(c).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+a);}function j(c,a,d){for(var b=[],e=0;e<c.length;e++)typeof c[e]!=="undefined"&&
b.push(k(c[e],a));return b.join(d)}function b(c,a,d,b){for(var e=Object.keys(c),f=[],g=0;g<e.length;g++)typeof c[e[g]]!=="undefined"&&f.push(k(e[g],a)+d+k(c[e[g]],a));return f.join(b)}function g(c){if(c.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=e[c[0]])?c=c.substring(1):this._operator=e.NUL;for(var a=[],i=c.split(","),b=0;b<i.length;b++){var f=i[b].match(d);if(f===null)throw Error("Bad VarSpec: "+c);a.push({name:f[1],explode:!!f[2],prefix:f[3]?parseInt(f[3],
10):-1})}this._varSpecList=a}function f(c){for(var a=[],d=0,b=c.indexOf("{",d);b!==-1;){a.push(new h(c.substring(d,b)));d=c.indexOf("}",b+1);if(d===-1)throw Error("Invalid template: "+c);a.push(new g(c.substring(b+1,d)));d+=1;b=c.indexOf("{",d)}a.push(new h(c.substring(d)));this._templateComponents=a}var e={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},"/":{first:"/",sep:"/",named:!1,ifemp:"",
allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"&",named:!0,ifemp:"=",allow:"U"},"&":{first:"&",sep:"&",named:!0,ifemp:"=",allow:"U"},"#":{first:"#",sep:",",named:!1,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R-,"}},d=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/;h.prototype={expand:function(){return encodeURI(this._text)}};g.prototype={expand:function(c){for(var a=[],d=
0;d<this._varSpecList.length;d++){var e=this._varSpecList[d],f=e.name,g=c[f],h=typeof g;if(h!=="undefined"&&g!==null){var l=a.length===0?this._operator.first:this._operator.sep;if(h==="string")this._operator.named&&(l+=k(f,"U+R"),l+=g.length===0?this._operator.ifemp:"="),e.prefix!==-1&&e.prefix<g.length&&(g=g.substring(0,e.prefix)),l+=k(g,this._operator.allow);else if(Array.isArray(g))e.explode?l+=j(g,this._operator.allow,this._operator.sep):(this._operator.named&&(l+=k(f,"U+R"),l+=g.length===0?this._operator.ifemp:
"="),l+=j(g,this._operator.allow,","));else if(h==="object")e.explode?l+=b(g,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(l+=k(f,"U+R"),l+=Object.keys(g).length===0?this._operator.ifemp:"="),l+=b(g,this._operator.allow,",",","));else throw Error("bad param type: "+f+" : "+h);a.push(l)}}return a.join("")}};f.prototype={expand:function(c){for(var a=[],d=0;d<this._templateComponents.length;d++)a.push(this._templateComponents[d].expand(c));return a.join("")}};return f});
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(h,k){var j={root:k};Object.keys(h).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=h[b])});return j});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(h,k,j){function b(b,f){this._activeContainer=null;this._getElementsFunction=b;this._toolbarLayoutFunction=f}b.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&j.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&j.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,f,e){typeof b==="string"&&(b=j.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=e;var d=f(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!d)return!1;this._activeElements.focusNode=d;b=j.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(b.length===0){f=this._activeElements.dismissArea||
this._activeElements.parameterArea;b=document.createElement("span");b.id="closebox";b.role="button";b.tabIndex=0;b.classList.add("imageSprite");b.classList.add("core-sprite-close");b.classList.add("dismiss");b.title=h.Close;f.appendChild(b);var c=this;b.addEventListener("click",function(){c.close()},!1);b.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&c.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);
if(d)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){d.focus();d.select()},0);this._activeElements.commandNode&&this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(b,f){j.$$array("input",f).forEach(function(e){e.type==="checkbox"?b.parameters.setValue(e.parameterName,e.checked):e.type!=="button"&&b.parameters.setValue(e.parameterName,e.value.trim())});j.$$array("textArea",f).forEach(function(e){b.parameters.setValue(e.parameterName,
e.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,f){var e=this;return function(d,c){var a=null,i=function(){f&&f();e.close()},m=function(a){a.keyCode===j.KEY.ENTER&&e._collectAndCall(b,d);if(a.keyCode===j.KEY.ESCAPE||a.keyCode===j.KEY.ENTER)i(),j.stop(a)};b.parameters.forEach(function(c){var l=
null;if(c.label)l=document.createElement("label"),l.classList.add("parameterInput"),l.setAttribute("for",c.name+"parameterCollector"),l.textContent=c.label,d.appendChild(l);var b=c.name+"parameterCollector",e=l||d;if(c.type==="text"&&typeof c.lines==="number"&&c.lines>1)l=document.createElement("textarea"),l.rows=c.lines,l.type="textarea",l.id=b,e.appendChild(l),m=function(a){a.keyCode===j.KEY.ESCAPE&&(i(),j.stop(a))};else if(c.type==="boolean"){if(l=document.createElement("input"),l.type="checkbox",
l.id=b,e.appendChild(l),c.value)l.checked=!0}else if(l=document.createElement("input"),l.type=c.type,l.id=b,e.appendChild(l),c.value)l.value=c.value;l.classList.add("parameterInput");l.classList.add("parameterInput"+l.type);l.setAttribute("speech","speech");l.setAttribute("x-webkit-speech","x-webkit-speech");l.parameterName=c.name;a||(a=l);l.addEventListener("keydown",m,!1)});var o=c;if(!o)o=document.createElement("span"),o.className="layoutRight parametersDismiss",d.appendChild(o);var q=function(a){a._collectAndCall(b,
d);i()},k=function(a,c){var l=document.createElement("span");l.role="button";l.tabIndex=0;c.appendChild(l);a&&l.appendChild(document.createTextNode(a));l.classList.add("dismiss");return l};if(b.parameters.hasOptionalParameters()){b.parameters.optionsRequested=!1;var l=k(h.More,o);l.addEventListener("click",function(){b.parameters.optionsRequested=!0;q(e)},!1);l.addEventListener("keydown",function(a){if(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)b.parameters.optionsRequested=!0,q(e)},!1)}l=k(h.Submit,
o);l.addEventListener("click",function(){q(e)},!1);l.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&q(e)},!1);o=k(null,o);o.id="closebox";o.classList.add("imageSprite");o.classList.add("core-sprite-close");o.title=h.Close;o.addEventListener("click",function(){i()},!1);o.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&i()},!1);return a}}};b.prototype.constructor=b;return{CommandParameterCollector:b}});
(function(){function h(a){return a?a.slice(1).split("&"):[]}function k(a){return a.length===0?"":"?"+a.join("&")}function j(a){var c=/([^=]*)(?:=?)(.*)/.exec(a),a=c[1]?decodeURIComponent(c[1]):"",c=c[2]?decodeURIComponent(c[2]):"";return[a,c]}function b(a){var c=encodeURIComponent(a[0]);a[1]&&(c+="="+encodeURIComponent(a[1]));return c}function g(a,c){var b="",l=[],d=0;return{next:function(){if(b!==a.search)b=a.search,l=h(b);if(d<l.length){var i=j(l[d++]);switch(c){case "keys":return i[0];case "values":return i[1];
case "keys+values":return[i[0],i[1]];default:throw new TypeError;}}throw m;}}}function f(a){if(typeof a!=="string")throw new TypeError;}function e(a){var c=a.protocol;return!c||c===":"||c==="http:"&&!a.hostname?!1:!0}function d(a){Object.defineProperty(this,"_anchor",{value:a})}function c(a,c){a=a||"";if(typeof a!=="string")throw new TypeError("url");c=c?c.href||c:"";if(typeof c!=="string")throw new TypeError("base");Object.defineProperty(this,"_input",{value:a,writable:!0});var b=document.implementation.createHTMLDocument("");
if(c){var l=b.createElement("a");l.href=c;if(l.protocol.length<2||!l.host)throw Error("InvalidStateError");var i=b.createElement("base");i.href=l.href;b.head.appendChild(i)}var n=b.createElement("a");n.href=a;b.body.appendChild(n);Object.defineProperty(this,"_urlAnchor",{value:n});var f=new d(n);Object.defineProperty(this,"query",{get:function(){return e(n)?f:null},enumerable:!0})}try{if(typeof window.URL==="function"&&window.URL.length!==0&&(new window.URL("http://www.w3.org")).protocol==="http:")return}catch(a){}var i=
/([^:]*):?(.*)/,m=typeof StopIteration!=="undefined"?StopIteration:Error("Stop Iteration");Object.defineProperties(d.prototype,{get:{value:function(a){f(a);var c;h(this._anchor.search).some(function(b){b=j(b);if(b[0]===a)return c=b[1],!0});return c},enumerable:!0},set:{value:function(a,c){f(a);f(c);var d=h(this._anchor.search);d.some(function(l,i){var e=j(l);if(e[0]===a)return e[1]=c,d[i]=b(e),!0})||d.push(b([a,c]));this._anchor.search=k(d)},enumerable:!0},has:{value:function(a){f(a);return h(this._anchor.search).some(function(c){if(j(c)[0]===
a)return!0})},enumerable:!0},"delete":{value:function(a){f(a);var c=h(this._anchor.search),b=c.filter(function(c){return j(c)[0]!==a});return b.length!==c.length?(this._anchor.search=k(b),!0):!1},enumerable:!0},clear:{value:function(){this._anchor.search=""},enumerable:!0},forEach:{value:function(a,c){if(typeof a!=="function")throw new TypeError;var b=g(this._anchor,"keys+values");try{for(;;){var l=b.next();a.call(c,l[1],l[0],this)}}catch(d){if(d!==m)throw d;}},enumerable:!0},keys:{value:function(){return g(this._anchor,
"keys")},enumerable:!0},values:{value:function(){return g(this._anchor,"values")},enumerable:!0},items:{value:function(){return g(this._anchor,"keys+values")}},size:{get:function(){return h(this._anchor.search).length},enumerable:!0},getAll:{value:function(a){f(a);var c=[];h(this._anchor.search).forEach(function(b){b=j(b);b[0]===a&&c.push(b[1])});return c},enumerable:!0},append:{value:function(a,c){f(a);f(c);var d=h(this._anchor.search);d.push(b([a,c]));this._anchor.search=k(d)},enumerable:!0}});
Object.defineProperties(c.prototype,{href:{get:function(){return e(this._urlAnchor)?this._urlAnchor.href:this._input},set:function(a){f(a);this._input=a;this._urlAnchor.href=a},enumerable:!0},origin:{get:function(){return e(this._urlAnchor)?this._urlAnchor.protocol+"//"+this._urlAnchor.host:""},enumerable:!0},protocol:{get:function(){return e(this._urlAnchor)?this._urlAnchor.protocol:":"},set:function(a){f(a);this._urlAnchor.protocol=a},enumerable:!0},_userinfo:{get:function(){return!e(this._urlAnchor)?
"":RegExp("^"+this._urlAnchor.protocol+"(\\/\\/)(?:([^@]*)?@)?"+this._urlAnchor.host).exec(this._urlAnchor.href)[2]||""},set:function(a){f(a);this._urlAnchor.href=this._urlAnchor.href.replace(RegExp("^"+this._urlAnchor.protocol+"(\\/\\/)(?:([^@]*)?@)?"+this._urlAnchor.host),this._urlAnchor.protocol+"//"+(a?a+"@":"")+this._urlAnchor.host)}},username:{get:function(){if(!e(this._urlAnchor))return"";var a=i.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){f(a);var c=i.exec(this._userinfo),
a=[encodeURIComponent(a||"")];c[2]&&a.push(c[2]);this._userinfo=a.join(":")},enumerable:!0},password:{get:function(){if(!e(this._urlAnchor))return"";var a=i.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){f(a);var c=[i.exec(this._userinfo)[1]||""];a&&c.push(encodeURIComponent(a));this._userinfo=c.join(":")},enumerable:!0},host:{get:function(){return e(this._urlAnchor)?this._urlAnchor.host:""},set:function(a){f(a);this._urlAnchor.host=a},enumerable:!0},hostname:{get:function(){return e(this._urlAnchor)?
this._urlAnchor.hostname:""},set:function(a){f(a);this._urlAnchor.hostname=a},enumerable:!0},port:{get:function(){return e(this._urlAnchor)?this._urlAnchor.port:""},set:function(a){f(a);this._urlAnchor.port=a},enumerable:!0},pathname:{get:function(){return e(this._urlAnchor)?this._urlAnchor.pathname:""},set:function(a){f(a);this._urlAnchor.pathname=a},enumerable:!0},search:{get:function(){return e(this._urlAnchor)?this._urlAnchor.search:""},set:function(a){f(a);this._urlAnchor.search=a},enumerable:!0},
hash:{get:function(){return e(this._urlAnchor)?this._urlAnchor.hash:""},set:function(a){f(a);this._urlAnchor.hash=a},enumerable:!0}});window.URL&&window.URL.createObjectURL&&(Object.defineProperty(c,"createObjectURL",{value:window.URL.createObjectURL.bind(window.URL),enumerable:!1}),Object.defineProperty(c,"revokeObjectURL",{value:window.URL.revokeObjectURL.bind(window.URL),enumerable:!1}));window.URL=c})();define("orion/URL-shim",function(){});
define("orion/editor/util",[],function(){var h=navigator.userAgent,k=parseFloat(h.split("MSIE")[1])||void 0,j=parseFloat(h.split("Firefox/")[1]||h.split("Minefield/")[1])||void 0,b=h.indexOf("Opera")!==-1,g=parseFloat(h.split("Chrome/")[1])||void 0,f=h.indexOf("Safari")!==-1&&!g,e=parseFloat(h.split("WebKit/")[1])||void 0,d=h.indexOf("Android")!==-1,c=h.indexOf("iPad")!==-1,h=h.indexOf("iPhone")!==-1,a=c||h,i=navigator.platform.indexOf("Mac")!==-1,m=navigator.platform.indexOf("Win")!==-1,o=navigator.platform.indexOf("Linux")!==
-1;return{formatMessage:function(a){var c=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,b){return c[(b<<0)+1]})},createElement:function(a,c){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",c):a.createElement(c)},isIE:k,isFirefox:j,isOpera:b,isChrome:g,isSafari:f,isWebkit:e,isAndroid:d,isIPad:c,isIPhone:h,isIOS:a,isMac:i,isWindows:m,isLinux:o,platformDelimiter:m?"\r\n":"\n"}});
define("orion/editor/keyBinding",["orion/editor/util"],function(h){function k(h,b,g,f,e){this.keyCode=typeof h==="string"?h.toUpperCase().charCodeAt(0):h;this.mod1=b!==void 0&&b!==null?b:!1;this.mod2=g!==void 0&&g!==null?g:!1;this.mod3=f!==void 0&&f!==null?f:!1;this.mod4=e!==void 0&&e!==null?e:!1}k.prototype={match:function(j){return this.keyCode===j.keyCode?this.mod1!==(h.isMac?j.metaKey:j.ctrlKey)?!1:this.mod2!==j.shiftKey?!1:this.mod3!==j.altKey?!1:h.isMac&&this.mod4!==j.ctrlKey?!1:!0:!1},equals:function(h){return!h?
!1:this.keyCode!==h.keyCode?!1:this.mod1!==h.mod1?!1:this.mod2!==h.mod2?!1:this.mod3!==h.mod3?!1:this.mod4!==h.mod4?!1:!0}};return{KeyBinding:k}});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(h,k){function j(b){this._init(b)}j.prototype={_init:function(b){var g=k.node(b.container);if(!g)throw"no parent container";this._container=g;g.classList.remove("currentLocation");this._id=b.id||"eclipse.breadcrumbs";this._resource=b.resource||null;this._rootSegmentName=b.rootSegmentName;this._workspaceRootSegmentName=b.workspaceRootSegmentName;this._makeHref=b.makeHref;this.path="";this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var b;
this._resource&&this._resource.Parents?(b=document.createElement("a"),this._makeHref?this._makeHref(b,""):b.href=h.toUrl("navigate/table.html")+"#"):b=document.createElement("span");k.empty(b);b.appendChild(document.createTextNode(this._workspaceRootSegmentName));return b}return null},render:function(){var b=this._container,g=k.node(this._id);g?k.empty(g):(g=document.createElement("span"),g.id=this._id,b.appendChild(g));var f;if(f=this.getNavigatorWorkspaceRootSegment())if(f.classList.add("breadcrumb"),
g.appendChild(f),this._resource&&this._resource.Parents)f=document.createElement("span"),f.appendChild(document.createTextNode(" / ")),this.path+="/",f.classList.add("breadcrumbSeparator"),g.appendChild(f);else{f.href="";f.classList.remove("breadcrumb");f.classList.add("currentLocation");return}b=this._rootSegmentName;if(this._resource){if(this._resource.Parents)for(var e=this._resource.Parents,d=e.length;--d>=0;)f=document.createElement("a"),f.classList.add("breadcrumb"),b?(f.appendChild(document.createTextNode(b)),
b=null):f.appendChild(document.createTextNode(e[d].Name)),this.path+=e[d].Name,this._makeHref?this._makeHref(f,e[d].Location):f.href=h.toUrl("navigate/table.html")+"#"+e[d].ChildrenLocation,g.appendChild(f),f=document.createElement("span"),f.appendChild(document.createTextNode(" / ")),this.path+="/",f.classList.add("breadcrumbSeparator"),g.appendChild(f);f=document.createElement("span");b?(f.appendChild(document.createTextNode(b)),b=null):f.appendChild(document.createTextNode(this._resource.Name));
f.classList.add("currentLocation");this.path+=this._resource.Name;g.appendChild(f)}g.childNodes.length===0&&(f=document.createElement("span"),f.appendChild(document.createTextNode(b||document.title)),f.classList.add("breadcrumb"),f.classList.add("currentLocation"),g.appendChild(f))}};j.prototype.constructor=j;return{BreadCrumbs:j}});
define("orion/webui/splitter",["require","orion/webui/littlelib"],function(h,k){function j(b){this._init(b)}j.prototype={_init:function(b){this._tracking=null;this._resizeListeners=[];this._animationDelay=501;this.$node=k.node(b.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=k.node(b.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=k.node(b.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";this._vertical=b.vertical;
this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(b.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add("splitThumbLayout");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(b){this._resizeListeners.push(b)},_initializeFromStoredSettings:function(){this._closed=localStorage.getItem(this._prefix+"/toggleState")==="closed";var b;if(this._vertical){if(b=localStorage.getItem(this._prefix+"/yPosition"))this._splitTop=
parseInt(b,10)}else if(b=localStorage.getItem(this._prefix+"/xPosition"))this._splitLeft=parseInt(b,10)},_adjustToSplitPosition:function(b){var g=k.bounds(this.$node),f=k.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=g.height;if(b||!this._splitTop)this._splitTop=g.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);b=this._splitTop;this.$node.parentNode.style.position==="relative"&&(b=this._splitTop-f.top);this.$sideNode.style.height=b+"px";this.$sideNode.style.bottom=
b-1+"px";this.$sideNode.style.display="block";this.$node.style.top=b+"px"}else{this._splitWidth=g.width;if(b||!this._splitLeft)this._splitLeft=g.left,localStorage.setItem(this._prefix+"/xPosition",this._splitLeft);b=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(b=this._splitLeft-f.left);this.$sideNode.style.width=b+"px";this.$sideNode.style.right=b-1+"px";this.$sideNode.style.display="block";this.$node.style.left=b+"px"}this._resize()},_resize:function(b){var b=b||0,g=k.bounds(this.$node.parentNode),
f=k.bounds(this.$node);this._vertical?this.$mainNode.style.height=g.height-(f.top-g.top+f.height)+"px":this.$mainNode.style.width=g.width-(f.left-g.left+f.width)+"px";var e=this;window.setTimeout(function(){e._notifyResizeListeners(e.$mainNode)},b);window.setTimeout(function(){e._notifyResizeListeners(e.$sideNode)},b)},_notifyResizeListeners:function(b){for(var g=0;g<this._resizeListeners.length;g++)this._resizeListeners[g](b)},_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 b=this;window.setTimeout(function(){b.$sideNode.classList.remove("sidePanelLayoutAnimation");b.$mainNode.classList.remove("mainPanelLayoutAnimation");b.$node.classList.remove("splitLayoutAnimation");b._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(b){if(b.target===this._thumb)return k.stop(b),this._thumbDown(b);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(b)},_mouseMove:function(b){if(this._tracking){var g;this._vertical?(g=this._splitTop=b.clientY,this.$node.parentNode.style.position===
"relative"&&(g=k.bounds(this.$node.parentNode),g=this._splitTop-g.top),this.$node.style.top=g+"px"):(g=this._splitLeft=b.clientX,this.$node.parentNode.style.position==="relative"&&(g=k.bounds(this.$node.parentNode),g=this._splitLeft-g.left),this.$node.style.left=g+"px");this._adjustToSplitPosition(!0);k.stop(b)}},_mouseUp:function(b){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(b)}};j.prototype.constructor=j;return{Splitter:j}});define("orion/fileUtils",["i18n!orion/nls/messages"],function(){return{makeRelative:function(h){if(!h)return h;var k=window.location.protocol+"//"+window.location.host;return h.indexOf(k)===0?h.substring(k.length):h},isAtRoot:function(h){return this.makeRelative(h).indexOf("/workspace")===0}}});
define("orion/favorites",["require","orion/fileUtils","orion/EventTarget"],function(h,k,j){function b(b){this._favorites=[];j.attach(this);this._init(b);this._initializeFavorites()}b.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],f=0;f<b.length;f++){var e=b[f],d=e.ChildrenLocation?e.ChildrenLocation:e.Location,d=k.makeRelative(d);this.addFavorite(e.Name,d,e.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(b){this.addFavorite(b,b,!1,!0)},addFavorite:function(b,f,e){this._favorites.push({name:b,path:f,directory:e,isFavorite:!0});this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},removeFavorite:function(b){for(var f in this._favorites)if(this._favorites[f].path===
b){this._favorites.splice(f,1);break}this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},renameFavorite:function(b,f){var e=!1,d;for(d in this._favorites)if(this._favorites[d].path===b){var c=this._favorites[d];if(c.name!==f)c.name=f,e=!0}e&&(this._favorites.sort(this._sorter),this._storeFavorites(),this._notifyListeners())},hasFavorite:function(b){for(var f in this._favorites)if(this._favorites[f].path===b)return!0;return!1},_SPECIAL_CHARS:"^$\\+[]().",queryFavorites:function(b){var f;
if(!b)return this._favorites;var e="";for(f=0;f<b.length;f++){var d=b.charAt(f);e+=d==="*"?".*":d==="?"?".?":this._SPECIAL_CHARS.indexOf(d)>=0?"\\"+d:d}e+=".*";b=RegExp(e);e=[];for(f in this._favorites)this._favorites[f].name.search(b)===0&&e.push(this._favorites[f]);return e},_initializeFavorites:function(){var b=this;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){var e,f=f.get("navigate");typeof f==="string"&&(f=JSON.parse(f));if(f)for(e in f)f[e].isFavorite=
!0,b._favorites.push(f[e]);b._favorites.sort(b._sorter);b._notifyListeners()})},_storeFavorites:function(){var b=this._favorites;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){f.put("navigate",b)})},_sorter:function(b,f){var e=b.name.toLowerCase(),d=f.name.toLowerCase();return e>d?1:e<d?-1:0},getFavorites:function(){return{navigator:this._favorites}}};b.prototype.constructor=b;return{FavoritesService:b}});
define("orion/widgets/themes/ThemeClass",[],function(){function h(h){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=h;this.classString="."+h+"{ "}h.prototype.className=null;h.prototype.classString=void 0;h.prototype.style=void 0;h.prototype.closeString=" }\n";h.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:h}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(h){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 j="",b=[],g=new h.ThemeClass("orionPage");
g.style.backgroundColor="#fdfdfd";g.style.width="100%";g.style.height="100%";b.push(g);g=new h.ThemeClass("topRowBanner");g.style.margin="0";g.style.border="0";g.style.backgroundColor=this.navbar;g.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.navbar+"), color-stop(100%,"+this.navbar+"))";g.style.background="-moz-linear-gradient(top,"+this.navbar+"0%,"+this.navbar+"100%)";g.style.height="28px";b.push(g);g=new h.ThemeClass("a");g.style.textDecoration="none";
g.style.color=this.content;b.push(g);g=new h.ThemeClass("navlink");g.style.display="inline-block";g.style.padding="2px";g.style.color=this.content;b.push(g);g=new h.ThemeClass("primaryNav");g.style.color=this.navtext;g.style.fontSize="8pt";g.style.fontWeight="normal";g.style.paddingTop="6px";g.style.verticalAlign="baseline";b.push(g);g=new h.ThemeClass("primaryNav a");g.style.fontSize="8pt";g.style.color=this.navtext;g.style.marginRight="6px";g.style.marginLeft="6px";g.style.verticalAlign="baseline";
g.style.textDecoration="none";b.push(g);g=new h.ThemeClass("primaryNav a:hover");g.style.color="#bfbfbf";g.style.cursor="hand";g.style.color="white";g.style.fontWeight="normal";b.push(g);for(var f in b)j+=b[f].toString();return j};k.prototype.writeLocationStyle=function(){var j="",b=[],g=new h.ThemeClass("titleArea");g.style.margin="0";g.style.paddingTop="5px";g.style.border="0";g.style.background=this.location;g.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.location+
"), color-stop(100%,"+this.location+"))";g.style.borderBottom="1px solid "+this.location;g.style.minHeight="20px";b.push(g);g=new h.ThemeClass("breadcrumb");g.style.fontSize="8pt";g.style.textDecoration="none";g.style.color=this.content;g.style.paddingTop="2px";b.push(g);g=new h.ThemeClass("a.breadcrumb:hover");g.style.textDecoration="none";g.style.borderBottom="1px dotted";g.style.color="#F58B0F";g.style.cursor="pointer";b.push(g);g=new h.ThemeClass("breadcrumbSeparator");g.style.fontSize="8pt";
g.style.textDecoration="none";g.style.color=this.navbar;g.style.fontWeight="bold";b.push(g);g=new h.ThemeClass("currentLocation");g.style.fontWeight="bold";g.style.fontSize="8pt";g.style.color=this.navbar;g.style.textDecoration="none";g.style.textWrap="normal";g.style.lineHeight="10pt";b.push(g);g=new h.ThemeClass("a.currentLocation:hover");g.style.fontWeight="bold";g.style.fontSize="10pt";g.style.color="#666666";g.style.textDecoration="none";g.style.borderBottom="0";b.push(g);g=new h.ThemeClass("navlinkonpage");
g.style.color=this.content;b.push(g);for(var f in b)j+=b[f].toString();return j};k.prototype.writeButtonStyle=function(){var j="",b=[],g=new h.ThemeClass("commandButton");g.style.color="#222";g.style.border="1px solid #dedede";g.style.backgroundColor=this.button;g.style.textAlign="center";g.style.verticalAlign="baseline";g.style.cursor="pointer";g.style.display="inline-block";g.style.padding="6px";g.style.paddingTop="4px";g.style.borderRadius="1px";g.style.lineHeight="12px";g.style.fontSize="8pt";
g.style.userSelect="none";b.push(g);g=new h.ThemeClass("commandButton:over");g.style.backgroundColor="#e6e6e6";g.style.border="1px solid #808080";b.push(g);g=new h.ThemeClass("commandMenu");g.style.color="#222";g.style.display="inline-block";g.style.verticalAlign="baseline";g.style.margin="0";g.style.fontSize="8pt";g.style.fontWeight="normal";g.style.border="1px solid #dedede";g.style.backgroundColor="#efefef";g.style.cursor="pointer";g.style.borderRadius="1px";b.push(g);g=new h.ThemeClass("commandMenuItem");
g.style.border="0";g.style.padding="0";g.style.margin="0";b.push(g);for(var f in b)j+=b[f].toString();return j};k.prototype.writeMainStyle=function(){var j="",b=[],g=new h.ThemeClass("searchbox");g.style.backgroundImage="url(../images/core_sprites.png)";g.style.backgroundRepeat="no-repeat";g.style.backgroundPosition="4px -297px";g.style.width="12px";g.style.height="12px";g.style.backgroundColor=this.search;g.style.border="1px solid "+this.search;g.style.fontSize="11px";g.style.width="15em";g.style.height=
"16px";g.style.borderRadius="10px";g.style.color="#999";g.style.padding="0";g.style.paddingLeft="20px";g.style.marginLeft="5px";g.style.marginTop="6px !important";g.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";b.push(g);g=new h.ThemeClass("searchbox:focus");g.style.color="white";g.style.outline="none";b.push(g);g=new h.ThemeClass("checkedRow");g.style.cssText="background-color:"+this.selection+" !important;";b.push(g);g=new h.ThemeClass("navbar-item-selected");
g.style.background=this.selection;g.style.color=this.content;b.push(g);g=new h.ThemeClass("auxpane");g.style.border="0";g.style.background=this.sidepanel;g.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.sidepanel+"), color-stop(100%,"+this.sidepanel+"))";g.style.background="-moz-linear-gradient(top, "+this.sidepanel+" 0%, "+this.sidepanel+" 100%)";g.style.overflowX="auto";g.style.minWidth="200px";g.style.paddingTop="16px";b.push(g);g=new h.ThemeClass("mainpane");
g.style.background=this.mainpanel;g.style.border=0;b.push(g);g=new h.ThemeClass("mainToolbar");g.style.background=this.toolpanel;g.style.height="31px";g.style.borderBottom="1px solid #ebebeb";b.push(g);for(var f in b)j+=b[f].toString();return j};k.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};k.prototype.getSheet=function(h){h.navbar.value?(this.navbar=h.navbar.value,
this.button=h.button.value,this.location=h.location.value,this.selection=h.selection.value,this.sidepanel=h.sidepanel.value,this.mainpanel=h.mainpanel.value,this.navtext=h.navtext.value,this.search=h.search.value,this.content=h.content.value,this.toolpanel=h.toolpanel.value):(this.navbar=h.navbar,this.button=h.button,this.location=h.location,this.selection=h.selection,this.sidepanel=h.sidepanel,this.mainpanel=h.mainpanel,this.navtext=h.navtext,this.search=h.search,this.content=h.content,this.toolpanel=
h.toolpanel);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};return{ThemeSheetWriter:k}});
define("orion/inputCompletion/inputCompletion",[],function(){function h(h,j,b){this._inputField=h;if(typeof this._inputField==="string")this._inputField=document.getElementById(this._inputField);this._binderFunc=j;(h=b?b.group:null)||(h=this._inputField.id?this._inputField.id:"default__input__group");this._completionIdPrefix=h+"__completion__";this._proposeFromStart=b?b.proposeFromStart:!1;this._extendedProvider=b?b.extendedProvider:null;this._proposalIndex=-1;this._dismissed=!0;this._mouseDown=!1;
this._dataList=[];this._initUI();var g=this;this._completionUIContainer.addEventListener("mousedown",function(){g._mouseDown=!0});this._completionUIContainer.addEventListener("mouseup",function(){g._mouseDown=!1});this._inputField.addEventListener("blur",function(){g._mouseDown?window.setTimeout(function(){g._inputField.focus()},200):g._dismiss()});this._inputField.addEventListener("keydown",function(b){g.onKeyDown(b)});this._inputField.addEventListener("input",function(){g._proposeOn(g._inputField.value)});
this._inputField.addEventListener("focus",function(){if(g._dismissed&&g._binderFunc)g._dismissing?g._dismissing=!1:g._binderFunc&&g._binderFunc(function(b){g._bind(b);g._proposeOn(g._inputField.value)})})}h.prototype.onKeyDown=function(h){if(this._dismissed)return!0;var j=h.charCode||h.keyCode;if(j===13){if(this._proposalList&&this._proposalList.length>0&&this._proposalIndex>=0&&this._proposalIndex<this._proposalList.length)return h.preventDefault(),this._dismiss(this._proposalList[this._proposalIndex].item.value,
h.ctrlKey),h.stopPropagation(),!1}else if((j===40||j===38)&&this._proposalList&&this._proposalList.length>0)return h.preventDefault(),this._walk(j===40),h.stopPropagation(),!1;else if(j===27)return h.preventDefault(),this._dismiss(),!1;return!0};h.prototype._bind=function(h){this._dataList=h};h.prototype._getUIContainerID=function(){return this._completionIdPrefix+"UIContainer"};h.prototype._getUIProposalListId=function(){return this._completionIdPrefix+"UIProposalList"};h.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)};h.prototype._createProposalLink=function(h,j,b,g){var f=document.createElement("a");f.href=require.toUrl(j);f.appendChild(this._createBoldText(h,
b,g));return f};h.prototype._createBoldText=function(h,j,b){if(j<0)return document.createTextNode(h);var g=document.createElement("span"),f;0!==j&&(f=document.createTextNode(h.substring(0,j)),g.appendChild(f));var e=document.createElement("b");g.appendChild(e);f=document.createTextNode(h.substring(j,j+b));e.appendChild(f);j+b<h.length-1&&(f=document.createTextNode(h.substring(j+b)),g.appendChild(f));return g};h.prototype._proposeOnCategory=function(h,j){if(j.length!==0){var b=this;if(h){var g=document.createElement("li");
g.className="inputCompletionLICategory";var f=document.createTextNode(h);g.appendChild(f);this._completionUL.appendChild(g)}for(f=0;f<j.length;f++){g=document.createElement("li");g.onmouseover=function(d){b._selectProposal(d.currentTarget)};g.onclick=function(d){b._dismiss(d.currentTarget.completionItem.value)};g.className="inputCompletionLINormal";g.completionItem=j[f].item;if(typeof j[f].item.value==="string"){var e=this._createBoldText(j[f].item.value,j[f].boldIndex,j[f].boldLength);g.appendChild(e)}else j[f].item.value.name&&
j[f].item.value.type==="link"&&g.appendChild(this._createProposalLink(j[f].item.value.name,j[f].item.value.value,j[f].boldIndex,j[f].boldLength));this._completionUL.appendChild(g);this._proposalList.push({item:j[f].item,domNode:g})}}};h.prototype._domNode2Index=function(h){for(var j=0;j<this._proposalList.length;j++)if(this._proposalList[j].domNode===h)return j;return-1};h.prototype._highlight=function(h,j){var b=h,g=!1;isNaN(b)||(g=!0,b=this._proposalList&&h>=0&&h<this._proposalList.length?this._proposalList[h].domNode:
null);if(b)b.className=j?"inputCompletionLISelected":"inputCompletionLINormal",j&&g&&(b.offsetTop<this._completionUIContainer.scrollTop?b.scrollIntoView(!0):b.offsetTop+b.offsetHeight>this._completionUIContainer.scrollTop+this._completionUIContainer.clientHeight&&b.scrollIntoView(!1))};h.prototype._selectProposal=function(h){var j=h;isNaN(j)&&(j=this._domNode2Index(h));if(j!==this._proposalIndex)this._highlight(this._proposalIndex,!1),this._proposalIndex=j,this._highlight(this._proposalIndex,!0)};
h.prototype._dismiss=function(h,j){if(!this._mouseDown){this._dismissed=!0;this._proposalList=null;this._proposalIndex=-1;if(typeof h==="string")this._inputField.value=h,this._dismissing=!0,this._inputField.focus();else if(h&&h.name&&h.type==="link")j?window.open(h.value):window.location.href=h.value;var b=this;window.setTimeout(function(){b._completionUIContainer.style.display="none"},200)}};h.prototype._show=function(){if(this._proposalList&&this._proposalList.length>0){for(var h=0,j=0,b=this._inputField;b;)h+=
b.offsetLeft,j+=b.offsetTop,b=b.offsetParent;this._completionUIContainer.style.display="block";this._completionUIContainer.style.top=j+this._inputField.offsetHeight+2+"px";this._completionUIContainer.style.left=h+"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"};h.prototype._walk=function(h){h=this._proposalIndex+(h?
1:-1);h<-1?h=this._proposalList.length-1:h>=this._proposalList.length&&(h=-1);this._selectProposal(h)};h.prototype._proposeOnList=function(h,j,b){for(var g="",f=[],e=j?j.length:0,d=0;d<h.length;d++)if(h[d].type==="category")this._proposeOnCategory(g,f),g=h[d].label,f=[];else{var c=!0,a=-1;if(j&&b){var i;typeof h[d].value==="string"?i=h[d].value.toLowerCase():h[d].value.name&&(i=h[d].value.name.toLowerCase());a=i.indexOf(j);a<0?c=!1:this._proposeFromStart&&(c=a===0)}c&&f.push({item:h[d],boldIndex:a,
boldLength:e})}this._proposeOnCategory(g,f)};h.prototype._proposeOn=function(h){this._completionUL.textContent="";var j=h?h.toLowerCase():null;this._proposalList=[];this._proposeOnList(this._dataList,j,!0);if(this._extendedProvider&&j){var b=this;this._extendedProvider(h,function(g){if(g)for(var f=0;f<g.length;f++)b._proposeOnList(g[f].proposals,g[f].filterForMe?j:h,g[f].filterForMe);b._show()},[])}else this._show()};h.prototype.constructor=h;return{InputCompletion:h}});
define("orion/globalSearch/nls/root/messages",{"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","Case sensitive":"Case sensitive","Regular expression":"Regular expression"});
define("orion/globalSearch/nls/messages",["orion/i18n!orion/globalSearch/nls/messages","orion/globalSearch/nls/root/messages"],function(h,k){var j={root:k};Object.keys(h).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=h[b])});return j});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(h,k,j,b){function g(){}g.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'<div class="dialog" role="dialog"><div class="dialogTitle"><span id="title" class="dialogTitleText layoutLeft"></span><span tabindex="0" role="button" aria-label="Close" class="dialogDismiss layoutRight core-sprite-close imageSprite" id="closeDialog"></span></div><div id="dialogContent" class="dialogContent layoutBlock"></div><div id="buttons" class="dialogButtons"></div></div>',_initialize:function(){var b=
document.body;this.$frameParent=b;this.$$modalExclusions=this.$$modalExclusions||[];var e=document.createRange();e.selectNode(b);e=e.createContextualFragment(this.CONTAINERTEMPLATE);b.appendChild(e);this.$frame=b.lastChild;this.title&&j.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=j.$("#closeDialog",this.$frame);var d=this;this.$close.addEventListener("click",function(){d.hide()},!1);this.$parent=j.$(".dialogContent",this.$frame);e=document.createRange();e.selectNode(this.$parent);
b=e.createContextualFragment(this.TEMPLATE);this.messages&&j.processTextNodes(b,this.messages);this.$parent.appendChild(b);this.$buttonContainer=j.$(".dialogButtons",this.$frame);this._makeButtons();this.$close.addEventListener("keydown",function(c){(c.keyCode===j.KEY.ENTER||c.keyCode===j.KEY.SPACE)&&d.hide()},!1);this.$frame.addEventListener("keydown",function(c){c.keyCode===j.KEY.ESCAPE?d.hide():c.keyCode===j.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 f=this;this.buttons.forEach(function(e){var d=b.createButton(e.text,e.callback);if(e.id)d.id=e.id,f["$"+d.id]=d;if(e.isDefault)f._defaultCallback=e.callback,f._defaultButton=d;f.$buttonContainer.appendChild(d)})}},_makeModal:function(){var b=this;this.$frame.addEventListener("blur",function(a){b.$lastFocusedElement=a.target},
!0);this._modalListener=function(a){var c=!j.contains(b.$frame,a.target);if(c)for(var d=0;d<b.$$modalExclusions.length;d++)if(j.contains(b.$$modalExclusions[d],a.target)){c=!1;break}c&&(window.setTimeout(function(){(b.$lastFocusedElement||b.$parent).focus()},0),j.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var e=this.$frameParent.childNodes,d=!1;this._addedBackdrop=[];for(var c=0;c<e.length;c++){for(var a=
0;a<this.$$modalExclusions.length;a++)if(j.contains(this.$$modalExclusions[a],e[c])){d=!0;break}!d&&e[c]!==b.$frame&&e[c].classList&&!e[c].classList.contains("tooltipContainer")&&(a=e[c],a.classList.contains("modalBackdrop")||(a.classList.add("modalBackdrop"),this._addedBackdrop.push(a)))}(e=j.lastTabbable(this.$buttonContainer)||j.lastTabbable(this.$parent))&&e.addEventListener("keydown",function(a){if(a.keyCode===j.KEY.TAB){var c=b._getFirstFocusField();c&&c!==a.target&&c.focus();j.stop(a)}},!1)},
_addChildDialog:function(b){this.$$modalExclusions.push(b.$frame||b.$parent)},_bindElements:function(b){for(var e=0;e<b.childNodes.length;e++){var d=b.childNodes[e];d.id&&(this["$"+d.id]=d);this._bindElements(d)}},hide:function(){typeof this._beforeHiding==="function"&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0));this.$frame.classList.remove("dialogShowing");typeof this._afterHiding===
"function"&&this._afterHiding();var b=this;this.keepAlive||window.setTimeout(function(){b.destroy()},0)},show:function(b){typeof this._beforeShowing==="function"&&this._beforeShowing();var e=j.bounds(this.$frame),d=j.bounds(document.documentElement),c;b?(c=j.bounds(b),b=c.top+c.height+4,c=c.left+4,b+e.height>d.height&&(b=Math.max(0,d.height-e.height-4)),c+e.width>d.width&&(c=Math.max(0,d.width-e.width-4))):(c=Math.max(0,(d.width-e.width)/2),b=Math.max(0,(d.height-e.height)/2));this.$lastFocusedElement=
document.activeElement;this.$frame.style.top=b+"px";this.$frame.style.left=c+"px";this.$frame.classList.add("dialogShowing");typeof this._afterShowing==="function"&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return j.firstTabbable(this.$parent)||this._defaultButton||j.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(b){b.classList.remove("modalBackdrop")});
this.$frameParent.removeEventListener("focus",this._modalListener,!0);this.$frameParent.removeEventListener("click",this._modalListener,!0);this.$frameParent.removeChild(this.$frame);this.$parent=this.$frame=void 0}};g.prototype.constructor=g;return{Dialog:g}});
(function(){var h=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],k=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,j=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,b=typeof location!=="undefined"&&location.href,g=b&&location.protocol&&location.protocol.replace(/\:/,""),f=b&&location.hostname,e=b&&(location.port||void 0),d=[];define("text",[],function(){var c,a,i;typeof window!=="undefined"&&window.navigator&&window.document?a=function(a,b){var d=c.createXhr();d.open("GET",a,!0);d.onreadystatechange=
function(){d.readyState===4&&b(d.responseText)};d.send(null)}:typeof process!=="undefined"&&process.versions&&process.versions.node?(i=require.nodeRequire("fs"),a=function(a,c){var b=i.readFileSync(a,"utf8");b.indexOf("\ufeff")===0&&(b=b.substring(1));c(b)}):typeof Packages!=="undefined"&&(a=function(a,c){var b=new java.io.File(a),d=java.lang.System.getProperty("line.separator"),b=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(b),"utf-8")),l,i,e="";try{l=new java.lang.StringBuffer;
(i=b.readLine())&&i.length()&&i.charAt(0)===65279&&(i=i.substring(1));for(l.append(i);(i=b.readLine())!==null;)l.append(d),l.append(i);e=String(l.toString())}finally{b.close()}c(e)});return c={version:"1.0.7",strip:function(a){if(a){var a=a.replace(k,""),c=a.match(j);c&&(a=c[1])}else a="";return a},jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")},createXhr:function(){var a,c,
b;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else for(c=0;c<3;c++){b=h[c];try{a=new ActiveXObject(b)}catch(d){}if(a){h=[b];break}}if(!a)throw Error("createXhr(): XMLHttpRequest not available");return a},get:a,parseName:function(a){var c=!1,b=a.indexOf("."),d=a.substring(0,b),a=a.substring(b+1,a.length),b=a.indexOf("!");b!==-1&&(c=a.substring(b+1,a.length),c=c==="strip",a=a.substring(0,b));return{moduleName:d,ext:a,strip:c}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,
b,d,i){var l=c.xdRegExp.exec(a),e;if(!l)return!0;a=l[2];l=l[3];l=l.split(":");e=l[1];l=l[0];return(!a||a===b)&&(!l||l===d)&&(!e&&!l||e===i)},finishLoad:function(a,b,i,e,l){i=b?c.strip(i):i;l.isBuild&&(d[a]=i);e(i)},load:function(a,d,i,h){if(h.isBuild&&!h.inlineText)i();else{var l=c.parseName(a),s=l.moduleName+"."+l.ext,n=d.toUrl(s),y=h&&h.text&&h.text.useXhr||c.useXhr;!b||y(n,g,f,e)?c.get(n,function(b){c.finishLoad(a,l.strip,b,i,h)}):d([s],function(a){c.finishLoad(l.moduleName+"."+l.ext,l.strip,a,
i,h)})}},write:function(a,b,i){if(b in d){var e=c.jsEscape(d[b]);i.asModule(a+"!"+b,"define(function () { return '"+e+"';});\n")}},writeFile:function(a,b,d,i,l){var b=c.parseName(b),e=b.moduleName+"."+b.ext,n=d.toUrl(b.moduleName+"."+b.ext)+".js";c.load(e,d,function(){var b=function(a){return i(n,a)};b.asModule=function(a,c){return i.asModule(a,n,c)};c.write(a,e,b,l)},l)}}})})();define("text!orion/banner/banner.html",[],function(){return'<header id="banner" role="banner" class="headerLayout">\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="primaryNav layoutBlock topRowBanner">\n\t\t<a id="home" class="layoutLeft logo"></a>\n\t\t<nav id="primaryNav" class="layoutLeft" role="navigation"></nav>\n\t\t<div class="layoutRight">\n\t\t\t<div id="globalActions" class="spacingLeft layoutLeft"></div>\n\t\t\t<div id="relatedLinks" class="spacingLeft layoutLeft" style="padding-top:1px;">\n\t\t\t\t<span tabindex="0" role="button" id="relatedTrigger" class="dropdownTrigger hidden">${Related}<span class="dropdownArrowDown"></span></span>\n\t\t\t\t<ul id="relatedDropdown" class="dropdownMenu" role="menu"></ul>\n\t\t\t</div>\n\t\t\t<input type="text" id="search" autocomplete="off" class="layoutLeft spacingLeft searchbox" role="search">\n\t\t\t<div id="searchOptions" class="layoutLeft" style="padding-top:1px;"></div>\n\t\t\t<div id="userMenu" class="spacingLeft layoutLeft">\n\t\t\t\t<span id="userTrigger" tabindex="0" role="button" class="dropdownTrigger">${Options}<span class="dropdownArrowDown"></span></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<\!-- Task + resource (title) area --\>\n\t<div id="titleArea" class="layoutBlock titleArea">\n\t\t<div class="clear" style="padding-bottom:5px;display:inline;"><span id="location" class="currentLocation"></span><span id="dirty" class="currentLocation"></span></div>\n\t\t<div class="layoutRight pageNav">\n\t\t\t<img class="progressPane" id="progressPane" tabindex="0" role="progressbar"></img>\n\t\t</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="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<a href="http://wiki.eclipse.org/Orion/FAQ" target="_blank">${FAQ}</a>\n\t\t<a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=2.0" target="_blank">${Report a Bug}</a>|\n\t\t<a href="http://www.eclipse.org/legal/privacy.php" target="_blank">${Privacy Policy}</a>|\n\t\t<a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">${Terms of Use}</a>|\n\t\t<a href="http://www.eclipse.org/legal/copyright.php" target="_blank">${Copyright Agent}</a>\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<div class="layoutRight" style="padding-left:7px;padding-right:7px;margin-top:3px;" id="settingsTab" style="visibility:hidden;">\n\t<div class="layoutRight core-sprite-settings" id="settingsAction" role="settings" aria-live="off" style="visibility:hidden;"></div>\n</div>\n<div class="layoutRight status" id="statusPane" role="status" aria-live="off"></div>\n<ul class="layoutRight commandList pageActions" id="pageNavigationActions"></ul>\n<div id="notificationArea" class="layoutLeft layoutBlock slideContainer">\n\t<div class="layoutLeft" id="notifications" aria-live="assertive" aria-atomic="true"></div>\n\t<div class="layoutRight"><span tabindex="0" role="button" class="layoutRight core-sprite-close imageSprite" id="closeNotifications"></span></div>\n</div>\n\t\t\n\t'});
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(h,k,j){return{slideoutHTMLFragment:function(b){var g=document.createElement("div");g.innerHTML=j;var f=k.$("#slideContainer",g);f.id=b+f.id;f=k.$("#pageCommandParameters",g);f.id=b+f.id;f=k.$("#pageCommandDismiss",g);f.id=b+f.id;return g.innerHTML}}});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(h,k){function j(b){this._init(b)}j.prototype={_init:function(b){var g=b.parent,f=this,g=k.node(g);if(!g)throw h["no parent"];if(!b.model)throw h["no tree model"];if(!b.renderer)throw h["no renderer"];this._parent=g;this._treeModel=b.model;this._renderer=b.renderer;this._showRoot=b.showRoot===void 0?!1:b.showRoot;this._indent=b.indent===void 0?16:b.indent;this._onCollapse=b.onCollapse;this._labelColumnIndex=
b.labelColumnIndex===void 0?0:b.labelColumnIndex;this._id=b.id===void 0?"treetable":b.id;this._tableStyle=b.tableStyle;this._tableElement=b.tableElement||"table";this._tableBodyElement=b.tableBodyElement||"tbody";this._tableRowElement=b.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(b){f._showRoot?(b._depth=0,f._generate([b],0)):f._treeModel.getChildren(b,function(b){f._generate(b,0)})})},_generate:function(b,g){k.empty(this._parent);var f=document.createElement(this._tableElement);
f.id=this._id;this._tableStyle&&f.classList.add(this._tableStyle);this._renderer.initTable(f,this);this._bodyElement=document.createElement(this._tableBodyElement);this._bodyElement.id=this._id+"tbody";this._generateChildren(b,g);f.appendChild(this._bodyElement);this._parent.appendChild(f);this._rowsChanged()},_generateChildren:function(b,g,f){for(var e=0;e<b.length;e++){var d=document.createElement(this._tableRowElement);d.id=this._treeModel.getId(b[e]);d._depth=g;d._item=b[e];this._renderer.render(b[e],
d);d.childNodes[this._labelColumnIndex].style.paddingLeft=this._indent*g+"px";f?(this._bodyElement.insertBefore(d,f.nextSibling),f&&(f=d)):this._bodyElement.appendChild(d)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(b,g,f){var e=this._treeModel.getId(b),d;if(e===this._id)this._removeChildRows(e),this._generateChildren(g,0),this._rowsChanged();else{var c=k.node(e);c?(c._item=b,c&&(f||
c._expanded)?(c._expanded=!0,this._removeChildRows(e),this._renderer.updateExpandVisuals(c,!0),g?(this._generateChildren(g,c._depth+1,c),this._rowsChanged()):(d=this,g=this._treeModel.getChildren(c._item,function(a){d._generateChildren(a,c._depth+1,c);d._rowsChanged()}))):this._renderer.updateExpandVisuals(c,!1)):console.log(h["could not find table row "]+e)}},getItem:function(b){var g=k.node(b);return g&&g._item?g._item:b},toggle:function(b){var g=k.node(b);g&&(g._expanded?(this.collapse(b),this._renderer.updateExpandVisuals(g,
!1)):(this.expand(b),this._renderer.updateExpandVisuals(g,!0)))},isExpanded:function(b){return(b=k.node(b))?b._expanded:!1},expand:function(b,g,f){var b=typeof b==="string"?b:this._treeModel.getId(b),e=k.node(b);if(e&&!e._expanded){e._expanded=!0;var d=this;this._renderer.updateExpandVisuals(e,!0);this._treeModel.getChildren(e._item,function(c){d._generateChildren(c,e._depth+1,e);d._rowsChanged();g&&g.apply(d,f)})}},_removeChildRows:function(b){for(var g=b===this._id,f=!1,e=-1,d=[],c=k.$$array(".treeTableRow",
this._parent),a=0;a<c.length;a++){var i=c[a];if(f)break;if(g)i._depth>e?d.push(i):f=!0;else if(i.id===b)g=!0,e=i._depth}for(b=0;b<d.length;b++)g=d[b],g.parentNode.removeChild(g)},collapse:function(b){var b=typeof b==="string"?b:this._treeModel.getId(b),g=k.node(b);if(g){if(!g._expanded)return;g._expanded=!1;this._renderer.updateExpandVisuals(g,!1);this._removeChildRows(b);this._rowsChanged()}this._onCollapse&&this._onCollapse(g._item)}};j.prototype.constructor=j;return{TableTree:j}});
define("orion/treeModelIterator",[],function(){var h={};h.TreeModelIterator=function(){function h(j,b){this.firstLevelChildren=j;this.reset();this._init(b)}h.prototype={_init:function(h){if(h)this.isExpanded=h.isExpanded,this.isExpandable=h.isExpandable,this.forceExpandFunc=h.forceExpandFunc},topLevel:function(h){return h.parent?h.parent===this.root:!0},_expanded:function(h){if(!h)return!0;var b=h.children&&h.children.length>0;this.isExpanded&&b&&(b=this.isExpanded(h));return b},_expandable:function(h){return!h?
!0:this.isExpandable?this.isExpandable(h):!1},_diveIn:function(h){return this._expanded(h)?(this.setCursor(h.children[0]),this.cursor()):null},_drillToLast:function(h){return this._expanded(h)?this._drillToLast(h.children[h.children.length-1]):h},_forward:function(h){if(!this._cursor)return null;var b=this._diveIn(this._cursor);if(!b){if(h&&this._expandable(this._cursor)&&this.forceExpandFunc){var g=this;return this.forceExpandFunc(this._cursor,"first",function(b){b&&g.setCursor(b)})}(b=this._findSibling(this._cursor,
!0))&&this.setCursor(b)}return b},_backward:function(h){if(!this._cursor)return null;var b=this._findSibling(this._cursor,!1);b&&b!==this._cursor.parent&&(b=this._drillToLast(b));if(h&&b&&this._expandable(b)&&this.forceExpandFunc&&b!==this._cursor.parent){var g=this;return this.forceExpandFunc(b,"last",function(b){b&&g.setCursor(b)})}b&&this.setCursor(b);return b},_findSibling:function(h,b){for(var g=this.topLevel(h),f=g?this.firstLevelChildren:h.parent.children,e=0;e<f.length;e++)if(f[e]===h)return e===
0&&!b?g?null:h.parent:e===f.length-1&&b?g?null:this._findSibling(h.parent,b):b?f[e+1]:f[e-1];return null},_inParentChain:function(h,b){for(var g=h.parent;g;){if(g===b)return!0;g=g.parent}return!1},_getTopLevelParent:function(h){if(this.topLevel(h))return h;for(h=h.parent;h;){if(this.topLevel(h))return h;h=h.parent}return null},_onCollapse:function(h){return this._expanded(h.parent)?h:this._onCollapse(h.parent)},_scan:function(h,b,g){this.setCursor(b);var f=[];for(f.push(b);;){if(this.iterate(h))f.push(this.cursor());
else break;if(g===this.cursor())return f}return null},setCursor:function(h){this._prevCursor=this._cursor;this._cursor=h},setTree:function(h){this.firstLevelChildren=h;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(h,b){var g=this.cursor(),f=this._scan(!0,h,b);f||(f=this._scan(!1,h,b));this.setCursor(g);return f},iterate:function(h,b){return h?this._forward(b):this._backward(b)},iterateOnTop:function(h,b){var g=this._findSibling(this._getTopLevelParent(this.cursor()),
h);g?this.setCursor(g):b&&this.firstLevelChildren.length>0&&this.setCursor(h?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(h){if(!this._cursor)return null;return this._inParentChain(this._cursor,h)?(this.setCursor(h),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 h}();return h});
define("orion/explorers/explorerNavHandler",["i18n!orion/nls/messages","orion/webui/littlelib","orion/treeModelIterator"],function(h,k,j){var h={},b=navigator.userAgent.indexOf("iPad")!==-1,g=window.navigator.platform.indexOf("Mac")!==-1;h.ExplorerNavHandler=function(){function f(b,d,c){this.explorer=b;this.model=this.explorer.model;this._navDict=d;this._listeners=[];this._selections=[];this._currentColumn=0;var a=this._getEventListeningDiv();a.tabIndex=0;a.classList.add("selectionModelContainer");
var i=this;this._modelIterator=new j.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),isExpandable:this.explorer.renderer.isExpandable?function(a){return i.explorer.renderer.isExpandable(a)}:function(a){return i.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,c,b){return i.explorer.forceExpandFunc(a,c,b)}:void 0});this._init(c);(!c||c.setFocus!==!1)&&a.focus();b=function(c){if(c.target===a){if(i.explorer.preventDefaultFunc&&i.explorer.preventDefaultFunc(c,i._modelIterator.cursor()))return!0;
if(c.keyCode===k.KEY.DOWN)return i.onDownArrow(c);else if(c.keyCode===k.KEY.UP)return i.onUpArrow(c);else if(c.keyCode===k.KEY.RIGHT)return i.onRightArrow(c);else if(c.keyCode===k.KEY.LEFT)return i.onLeftArrow(c);else if(c.keyCode===k.KEY.SPACE)return i.onSpace(c);else if(c.keyCode===k.KEY.ENTER)return i.onEnter(c)}};a.addEventListener("keydown",b,!1);this._listeners.push({type:"keydown",listener:b});b=function(){if(i.explorer.onFocus)i.explorer.onFocus(!1);else i.toggleCursor(null,!1)};a.addEventListener("blur",
b,!1);this._listeners.push({type:"blur",listener:b});b=function(){if(i.explorer.onFocus)i.explorer.onFocus(!0);else i.toggleCursor(null,!0)};a.addEventListener("focus",b,!1);this._listeners.push({type:"focus",listener:b});this._parentDiv=a}f.prototype={_init:function(b){this._linearGridMove=!1;if(b)this._selectionPolicy=b.selectionPolicy,this.preventDefaultFunc=b.preventDefaultFunc,this.postDefaultFunc=b.postDefaultFunc},_ctrlKeyOn:function(b){return g?b.metaKey:b.ctrlKey},removeListeners:function(){if(this._listeners)for(var b=
0;b<this._listeners.length;b++)this._parentDiv.removeEventListener(this._listeners[b].type,this._listeners[b].listener,!1)},focus:function(){var b=this._getEventListeningDiv();b&&b.focus()},_getEventListeningDiv:function(b){return this.explorer.keyEventListeningDiv&&typeof this.explorer.keyEventListeningDiv==="function"?this.explorer.keyEventListeningDiv(b):k.node(this.explorer._parentId)},isExpandable:function(b){return!b?!1:k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)))?
!0:!1},isExpanded:function(b){return!b?!1:this.explorer.myTree.isExpanded(this.model.getId(b))},refreshSelection:function(b){var d=this;this.explorer.selection&&this.explorer.selection.getSelections(function(c){d._clearSelection();for(var a=0;a<c.length;a++)d._selections.push(c[a]);d._selections.length>0&&d.cursorOn(d._selections[0],!0,!1,b)})},refreshModel:function(b,d,c,a){this._currentColumn=0;this.topIterationNodes=[];this.model=d;this._navDict=b;if(this.model.getTopIterationNodes)this.topIterationNodes=
this.model.getTopIterationNodes();else if(c)this.topIterationNodes=c;this._modelIterator.setTree(this.topIterationNodes);!a&&this.explorer.selection&&this._modelIterator.reset();this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(b){for(var d=0;d<this._selections.length;d++)if(b===this._selections[d])return d;return-1},_clearSelection:function(b){if(b)for(b=0;b<this._selections.length;b++)this._checkRow(this._selections[b],!0);
this._selections=[]},setSelection:function(b,d){if(this._selectionPolicy==="cursorOnly")d&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(b,!0);else if(this._isRowSelectable(b)){if(!d||this._selectionPolicy==="singleSelection")this._clearSelection(!0),this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b;else{var c=this._inSelection(b);c>=0?(this._checkRow(b,!0),this._selections.splice(c,1)):(this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b)}this.explorer.selection&&
(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(b,d){b||(b=this.currentModel());var c=this._getGridChildren(b);if(c&&c.length>1||d===0&&c){d!==0&&this.toggleCursor(b,!1);var a=this._currentColumn,i=!0;a+=d;a<0?(this._linearGridMove&&d!==0&&(this._modelIterator.iterate(!1)?b=this.currentModel():i=!1),a=i?c.length-1:this._currentColumn):a>=c.length&&(this._linearGridMove&&d!==0&&(this._modelIterator.iterate(!0)?b=this.currentModel():
i=!1),a=i?0:this._currentColumn);this._currentColumn=a;d!==0&&this.toggleCursor(b,!0);return!0}return!1},_getGridChildren:function(b){return this._navDict?this._navDict.getGridNavHolder(b):null},getCurrentGrid:function(b){b||(b=this.currentModel());return(b=this._getGridChildren(b))&&b.length>0?b[this._currentColumn]:null},toggleCursor:function(b,d){var c=this.getRowDiv(b),a=this.getCurrentGrid(b);a?(c&&(d?c.classList.add("treeIterationCursorRow"):c.classList.remove("treeIterationCursorRow")),a.domNode&&
(d?a.domNode.classList.add("treeIterationCursor"):a.domNode.classList.remove("treeIterationCursor"))):c&&(d?c.classList.add("treeIterationCursorRow_Dotted"):c.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,d,c,a){var c=c===void 0?!1:c,i,f;if(b||d){if(f===this._modelIterator.cursor())return;i=this._modelIterator.cursor();f=b;this._modelIterator.setCursor(f)}else i=this._modelIterator.prevCursor(),f=this._modelIterator.cursor();
if(i!==f||d)if(this.toggleCursor(i,!1),!d||f)if(this.moveColumn(null,0),this.toggleCursor(f,!0),(b=this.getRowDiv())&&!a&&!this._visible(b)&&b.scrollIntoView(!c),this.explorer.onCursorChanged)this.explorer.onCursorChanged(i,f)},getSelection:function(){return this._selections},getSelectionIds:function(){for(var b=[],d=0;d<this._selections.length;d++)b.push(this.model.getId(this._selections[d]));return b},getRowDiv:function(b){b=b?b:this._modelIterator.cursor();if(!b)return null;var b=this.model.getId(b),
d=this._navDict.getValue(b);return d&&d.rowDomNode?d.rowDomNode:k.node(b)},iterate:function(b,d,c){this.topIterationNodes.length!==0&&this._modelIterator.iterate(b,d)&&(this.cursorOn(null,!1,b),c&&this.setSelection(this.currentModel(),!0))},_checkRow:function(b,d){if(this.explorer.renderer._useCheckboxSelection){var c=this.getRowDiv(b);if(c){var a=k.node(this.explorer.renderer.getCheckBoxId(c.id)),i=d?!a.checked:!0;if(i!==a.checked)this.explorer.renderer.onCheck(c,a,i,!0)}}else this._select(b,d)},
_vpWidth:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},_vpHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},_getToolBarHeight:function(b){return(b=k.node(b))?k.bounds(b).height:0},_visible:function(b){if(b.offsetWidth===0||b.offsetHeight===0)return!1;var d=0;d+=this._getToolBarHeight("staticBanner");d+=this._getToolBarHeight("titleArea");d+=this._getToolBarHeight("pageToolbar");var c=
this._getEventListeningDiv(!0).getClientRects()[0],a=this._vpHeight();this._vpWidth();for(var d=c.top>d?c.top:d,c=c.bottom<a?c.bottom:a,b=b.getClientRects(),a=0,i=b.length;a<i;a++){var f=b[a];if(f.top>=d&&f.top<=c&&f.bottom>=d&&f.bottom<=c)return!0}return!1},_select:function(b){b||(b=this._modelIterator.cursor());var d=this.getRowDiv(b);d&&(this._inSelection(b)<0?d.classList.add("checkedRow"):d.classList.remove("checkedRow"))},_onModelGrid:function(b,d){var c=this._getGridChildren(b);if(c)for(var a=
0;a<c.length;a++)if(d.target===c[a].domNode)return!0;return!1},onClick:function(e,d){var c=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(e)));if(d.target!==c&&!this._onModelGrid(e,d))if(this.cursorOn(e,!0,!1,!0),b)this.setSelection(e,!0);else if(this._ctrlKeyOn(d))this.setSelection(e,!0);else if(d.shiftKey&&this._lastSelection){if(c=this._modelIterator.scan(this._lastSelection,e)){this._clearSelection(!0);for(var a=0;a<c.length;a++)this.setSelection(c[a],!0)}}else this.setSelection(e,
!1)},onCollapse:function(b){this._modelIterator.collapse(b)&&this.cursorOn()},onUpArrow:function(b){this.iterate(!1,!1,b.shiftKey);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1);b.preventDefault();return!1},onDownArrow:function(b){this.iterate(!0,!1,b.shiftKey);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1);b.preventDefault();return!1},_shouldMoveColumn:function(b){var d=this.currentModel(),c=this._getGridChildren(d);return c&&c.length>1?this.isExpandable(d)?
this._ctrlKeyOn(b):!0:!1},onLeftArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,-1),b.preventDefault(),!0;var d=this._modelIterator.cursor();if(!d)return!1;if(this.isExpandable(d)&&this.isExpanded(d))return this.explorer.myTree.collapse(d),b.preventDefault(),!0;this._modelIterator.topLevel(d)?this.explorer.scopeUp&&typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(d.parent),this.setSelection(d.parent,!1))},onRightArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,
1),b.preventDefault(),!0;var d=this._modelIterator.cursor();if(!d)return!1;if(this.isExpandable(d)&&!this.isExpanded(d))return this.explorer.myTree.expand(d),b.preventDefault(),!1},_isRowSelectable:function(b){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(b):!0},onSpace:function(b){this.setSelection(this.currentModel(),!0);b.preventDefault()},onEnter:function(b){var d=this.getCurrentGrid(this._modelIterator.cursor());if(d)if(d.widget)if(typeof d.onClick==="function")d.onClick();
else typeof d.widget.focus==="function"&&d.widget.focus();else{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(b),!1,!1,!1,0,null);d.domNode.dispatchEvent(c)}else if(this.explorer.renderer.getRowActionElement&&(d=this._modelIterator.cursor()))if(d=this.explorer.renderer.getRowActionElement(this.model.getId(d)),d.href)this._ctrlKeyOn(b)?window.open(d.href):window.location.href=d.href}};return f}();h.ExplorerNavDict=function(){function b(e){this._dict=
{};this._model=e}b.prototype={addRow:function(b,d){this._dict[this._model.getId(b)]={model:b,rowDomNode:d}},getValue:function(b){return this._dict[b]},getGridNavHolder:function(b,d){if(!b)return null;var c=this._model.getId(b);if(this._dict[c]){if(!this._dict[c].gridChildren&&d)this._dict[c].gridChildren=[];return this._dict[c].gridChildren}return null},initGridNavHolder:function(b){if(!b)return null;b=this._model.getId(b);if(this._dict[b])this._dict[b].gridChildren=null}};return b}();return h});
define("orion/compare/nls/root/messages",{"Copy current change from right to left":"Copy current change from right to left","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(h,k){var j={root:k};Object.keys(h).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=h[b])});return j});
define("orion/compare/diff-provider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(h,k){function j(b,f,e){var d=new k;b[f].apply(b,e).then(function(c){d.resolve(c)},function(c){d.reject(c)});return d}function b(b,f){var e=b.getServiceReferences("orion.core.diff"),d=e;if(f)for(var d=[],c=0;c<e.length;++c)f(e[c])&&d.push(e[c]);for(var a=[],i=[],c=0;c<d.length;++c)a[c]=RegExp(d[c].getProperty("pattern")||".*"),i[c]=b.getService(d[c]);this._getService=function(c){if(c.indexOf("://")===
-1){var b=document.createElement("a");b.href=c;c=b.href}for(b=0;b<a.length;++b)if(a[b].test(c))return i[b];throw h["No Matching DiffService for location:"]+c;}}b.prototype={getDiffContent:function(b){return j(this._getService(b),"getDiffContent",arguments)},getDiffFileURI:function(b){return j(this._getService(b),"getDiffFileURI",arguments)}};return{DiffProvider:b}});
define("orion/compare/diff-parser",[],function(){var h=h||{};h.DiffParser=function(){function h(b,g){this._lineDelimiter=b?b:j?"\r\n":"\n";this._diffLineDelimiter=g?g:this._lineDelimiter;this._DEBUG=!1}var j=navigator.platform.indexOf("Win")!==-1;h.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(b){this._diffLineDelimiter=this._lineDelimiter=b},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(b,g,f,e){this._init();if(g==="")return{outPutFile:b,mapper:[]};this._oFileContents=b===""?[]:b.split(this._lineDelimiter);this._diffContents=g.split(this._diffLineDelimiter);g=this._diffContents.length;this._hunkRanges=[];for(var d=0;d<g;d++){var c=this._parseHunkRange(d);c&&this._hunkRanges.push(c)}if(0===this._hunkRanges.length)return{outPutFile:b,
mapper:[]};if(this._DEBUG){console.log("***Diff contents: \n");for(b=0;b<this._diffContents.length;b++)console.log(this._diffContents[b]);console.log("***Hunk ranges: \n");console.log(JSON.stringify(this._hunkRanges))}for(b=0;b<this._hunkRanges.length;b++)this._parseHunkBlock(b);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(f);this._DEBUG&&
(console.log("***New Line at end of file(original): \n"),console.log(JSON.stringify(this._oNewLineAtEnd)),console.log("***New Line at end of file(new): \n"),console.log(JSON.stringify(this._nNewLineAtEnd)),console.log("***Mapper: \n"),this._logMap(),console.log("***Total line number in original file: "+this._oFileContents.length));(e===void 0||!e)&&this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var b=0;b<this._deltaMap.length;b++)if(console.log(JSON.stringify(this._deltaMap[b])),
this._deltaMap[b][2]>0){console.log("    **Diff content on change/add: \n");for(var g=0;g<this._deltaMap[b][0];g++)console.log("    "+this._diffContents[this._deltaMap[b][2]+g-1])}},_logNewFile:function(){for(var b=0;b<this._nFileContents.length;b++)console.log(this._nFileContents[b])},_createBlock:function(b,g,f,e){e===f&&b===" "||(f=[f,e-f,"s"],b==="-"?f[2]="r":b==="+"?f[2]="a":b==="c"&&(f[2]="c"),g.push(f))},_createMinusBlock:function(b,g,f){var e=this._oBlocks.length;e===0||b!==this._oBlocks[e-
1][0]?(this._oBlocks.push([b===0?1:b,f]),this._nBlocks.push([g,0,-2])):this._oBlocks[e-1][1]+=f},_createPlusBlock:function(b,g,f,e){var d=this._nBlocks.length;d===0||g!==this._nBlocks[d-1][0]?(this._oBlocks.push([b===0?1:b,0]),this._nBlocks.push([g,f,e])):(this._nBlocks[d-1][1]+=f,this._nBlocks[d-1][2]=e)},_parseHunkBlock:function(b){for(var g=" ",f=this._hunkRanges[b][0]+1,e=b===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[b+1][0],d=0,c=0,a=this._hunkRanges[b][1],i=this._hunkRanges[b][3],
m=f,h=f;h<e;h++)if(0!==this._diffContents[h].length){var j=this._diffContents[h][0];if(j==="\\"&&("\\ No newline at end of file"===this._diffContents[h].substring(0,this._diffContents[h].length-1)||"\\ No newline at end of file"===this._diffContents[h]))g==="-"?this._oNewLineAtEnd=!1:g===" "?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,h>f&&this._diffContents[h-1][this._diffContents[h-1].length-1]==="\r"&&(this._diffContents[h-1]=this._diffContents[h-1].substring(0,this._diffContents[h-
1].length-1));else{switch(j){case "-":case "+":case " ":break;default:continue}if(g!==j){j==="+"&&(m=h);switch(g){case " ":a=this._hunkRanges[b][1]+d;i=this._hunkRanges[b][3]+c;break;case "-":this._createMinusBlock(a,i,this._hunkRanges[b][1]+d-a);break;case "+":this._createPlusBlock(a,i,this._hunkRanges[b][3]+c-i,m)}g=j}switch(j){case "-":d++;break;case "+":c++;break;case " ":d++,c++}}}switch(g){case "-":this._createMinusBlock(a,i,this._hunkRanges[b][1]+d-a);break;case "+":this._createPlusBlock(a,
i,this._hunkRanges[b][3]+c-i,m)}},_detectConflictes:function(b,g){if(b<0)return!1;for(var f=b+g,e=b;e<f;e++){var d=this._diffContents[e];if(d.indexOf("<<<<<")>-1||d.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(b){for(var g=this._oBlocks.length,f=this._oFileContents.length,e=0,d=1,c=0;c<g;c++)d=this._oBlocks[c][0]-d,d>0&&(this._deltaMap.push([d,d,0]),e+=d),b&&this._detectConflictes(this._nBlocks[c][2],this._nBlocks[c][1])?this._deltaMap.push([this._nBlocks[c][1],this._oBlocks[c][1],this._nBlocks[c][2]+
1,1]):this._deltaMap.push([this._nBlocks[c][1],this._oBlocks[c][1],this._nBlocks[c][2]+1]),e+=this._oBlocks[c][1],d=this._oBlocks[c][0]+this._oBlocks[c][1];0<f-d&&(this._deltaMap.push([f-d+1,f-d+1,0]),e+=f-d+1);e<f&&(d=f-e,b=this._deltaMap[this._deltaMap.length-1],b[2]===0?(b[0]+=d,b[1]+=d):b[2]===-1?this._deltaMap.push([d,d,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([d,d,0]):(this._nNewLineAtEnd&&(b[0]+=d),this._oNewLineAtEnd&&(b[1]+=d)))},_buildNewFile:function(){for(var b=
1,g=!1,f=this._deltaMap.length,e=0;e<f;e++){g=!1;if(this._deltaMap[e][2]===0){for(var d=0;d<this._deltaMap[e][0];d++)this._nFileContents.push(this._oFileContents[b+d-1]);g=!0}else if(this._deltaMap[e][2]>0)for(d=0;d<this._deltaMap[e][0];d++)this._nFileContents.push(this._diffContents[this._deltaMap[e][2]+d-1].substring(1));b+=this._deltaMap[e][1]}this._nNewLineAtEnd&&!g&&this._nFileContents.push("")},_parseHRangeBody:function(b,g){if(0<b.indexOf(",")){var f=b.split(","),e=parseInt(f[0]),f=parseInt(f[1]);
g.push(e>=0?e:1);g.push(f>=0?f:1)}else e=parseInt(b),g.push(e>=0?e:1),g.push(1)},_parseHunkRange:function(b){var g=this._diffContents[b];if(!(8>g.length)&&"@@"===g.substring(0,2)){var g=g.substring(2),f=g.indexOf("@@");if(!(f<0)){var g=g.substring(0,f),f=g.indexOf("-"),e=g.indexOf("+");if(!(f<0||e<0))return b=[b],f<e?(g=g.substring(f+1).split("+"),this._parseHRangeBody(g[0],b),this._parseHRangeBody(g[1],b)):(g=g.substring(e+1).split("-"),this._parseHRangeBody(g[1],b),this._parseHRangeBody(g[0],b)),
b}}}};return h}();return h});
define("orion/editor/eventTarget",[],function(){function h(){}h.addMixin=function(k){var j=h.prototype,b;for(b in j)j.hasOwnProperty(b)&&(k[b]=j[b])};h.prototype={addEventListener:function(h,j,b){if(!this._eventTypes)this._eventTypes={};var g=this._eventTypes[h];g||(g=this._eventTypes[h]={level:0,listeners:[]});g.listeners.push({listener:j,useCapture:b})},dispatchEvent:function(h){var j=h.type;this._dispatchEvent("pre"+j,h);this._dispatchEvent(j,h);this._dispatchEvent("post"+j,h)},_dispatchEvent:function(h,
j){var b=this._eventTypes?this._eventTypes[h]:null;if(b){var g=b.listeners;try{if(b.level++,g)for(var f=0,e=g.length;f<e;f++)if(g[f]){var d=g[f].listener;typeof d==="function"?d.call(this,j):d.handleEvent&&typeof d.handleEvent==="function"&&d.handleEvent(j)}}finally{if(b.level--,b.compact&&b.level===0){for(f=g.length-1;f>=0;f--)g[f]||g.splice(f,1);g.length===0&&delete this._eventTypes[h];b.compact=!1}}}},isListening:function(h){return!this._eventTypes?!1:this._eventTypes[h]!==void 0},removeEventListener:function(h,
j,b){if(this._eventTypes){var g=this._eventTypes[h];if(g){for(var f=g.listeners,e=0,d=f.length;e<d;e++){var c=f[e];if(c&&c.listener===j&&c.useCapture===b){g.level!==0?(f[e]=null,g.compact=!0):f.splice(e,1);break}}f.length===0&&delete this._eventTypes[h]}}}};return{EventTarget:h}});define("orion/editor/i18n",{load:function(h,k,j){k.specified&&k.specified("orion/bootstrap")?k(["orion/i18n!"+h],function(b){j(b)}):j({})}});
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",Comment:"Comment","Flat outline":"Flat outline",incrementalFind:"Incremental find: ${0}",incrementalFindNotFound:"Incremental find: ${0} (not found)",find:"Find...",
undo:"Undo",redo:"Redo",cancelMode:"Cancel Current Mode",findNext:"Find Next Occurrence",findPrevious:"Find Previous Occurrence",incrementalFindKey:"Incremental Find",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}"});
define("orion/editor/nls/messages",["orion/editor/i18n!orion/editor/nls/messages","orion/editor/nls/root/messages"],function(h,k){var j={root:k},b;for(b in h)h.hasOwnProperty(b)&&typeof j[b]==="undefined"&&(j[b]=h[b]);return j});
define("orion/editor/contentAssist",["i18n!orion/editor/nls/messages","orion/editor/keyBinding","orion/editor/eventTarget","orion/Deferred","orion/editor/util"],function(h,k,j,b,g){var f,e,d;function c(a){this.textView=a;this.state=f;this.providers=[];var c=this;this.contentAssistListener={onModelChanging:function(a){c.isDeactivatingChange(a)?c.setState(f):c.state===e&&c.setState(d)},onScroll:function(){c.setState(f)},onSelection:function(){var a=c.state;if(a===e||a===d)c.computeProposals(),c.setState(d)}};
a.setKeyBinding(g.isMac?new k.KeyBinding(" ",!1,!1,!1,!0):new k.KeyBinding(" ",!0),"contentAssist");a.setAction("contentAssist",function(){c.activate();return!0},{name:h.contentAssist})}function a(a,c){this.contentAssist=a;this.widget=c;this.proposals=[];var b=this;this.contentAssist.addEventListener("ProposalsComputed",function(a){b.proposals=a.data.proposals;b.selectedIndex=b.proposals.length?0:-1})}function i(a,c){this.contentAssist=a;this.textView=this.contentAssist.getTextView();this.isShowing=
this.textViewListenerAdded=!1;var b=this.textView.getOptions("parent").ownerDocument;this.parentNode=typeof c==="string"?b.getElementById(c):c;if(!this.parentNode){this.parentNode=g.createElement(b,"div");this.parentNode.className="contentassist";var l=b.getElementsByTagName("body")[0];if(l)l.appendChild(this.parentNode);else throw Error("parentNode is required");}var d=this;this.textViewListener={onMouseDown:function(a){a.event.target.parentElement!==d.parentNode&&d.contentAssist.deactivate()}};
this.contentAssist.addEventListener("ProposalsComputed",function(a){d.setProposals(a.data.proposals);d.show();if(!d.textViewListenerAdded)d.textView.addEventListener("MouseDown",d.textViewListener.onMouseDown),d.textViewListenerAdded=!0});this.contentAssist.addEventListener("Deactivating",function(){d.setProposals([]);d.hide();if(d.textViewListenerAdded)d.textView.removeEventListener("MouseDown",d.textViewListener.onMouseDown),d.textViewListenerAdded=!1;d.textViewListenerAdded=!1});this.scrollListener=
function(){d.isShowing&&d.position()};b.addEventListener("scroll",this.scrollListener)}f=1;e=2;d=3;var m={selected:" selected",hr:"proposal-hr",emphasis:"proposal-emphasis",noemphasis:"proposal-noemphasis",dfault:"proposal-default"};c.prototype={apply:function(a){if(!a)return!1;var c=this.textView.getCaretOffset(),b={proposal:a,start:c,end:c};this.setState(f);this.textView.setText(a.proposal||a,c,c);this.dispatchEvent({type:"ProposalApplied",data:b});return!0},activate:function(){this.state===f&&
this.setState(e)},deactivate:function(){this.setState(f)},getTextView:function(){return this.textView},isActive:function(){return this.state===e||this.state===d},isDeactivatingChange:function(a){var c=a.removedCharCount>0&&a.addedCharCount===0,b=this.textView,b=a.start+1<=b.getModel().getCharCount()&&/^\s*$/.test(b.getText(a.start,a.start+1));return a.removedLineCount>0||a.addedLineCount>0||c&&b},setState:function(a){var c;a===e?c="Activating":a===f&&(c="Deactivating");c&&this.dispatchEvent({type:c});
this.state=a;this.onStateChange(a)},onStateChange:function(a){if(a===f){if(this.listenerAdded)this.textView.removeEventListener("ModelChanging",this.contentAssistListener.onModelChanging),this.textView.removeEventListener("Scroll",this.contentAssistListener.onScroll),this.textView.removeEventListener("Selection",this.contentAssistListener.onSelection),this.listenerAdded=!1}else if(a===e){if(!this.listenerAdded)this.textView.addEventListener("ModelChanging",this.contentAssistListener.onModelChanging),
this.textView.addEventListener("Scroll",this.contentAssistListener.onScroll),this.textView.addEventListener("Selection",this.contentAssistListener.onSelection),this.listenerAdded=!0;this.computeProposals()}},computeProposals:function(){var a=this;this._computeProposals(this.textView.getCaretOffset()).then(function(c){a.dispatchEvent({type:"ProposalsComputed",data:{proposals:c}})})},getPrefixStart:function(a){for(;a>0&&/[A-Za-z0-9_]/.test(this.textView.getText(a-1,a));)a--;return a},handleError:function(a){typeof console!==
"undefined"&&(console.log("Error retrieving content assist proposals"),console.log(a))},_computeProposals:function(a){var c=this.providers,d=this.textView,l=d.getModel(),i=d.getText(),n={line:l.getLine(l.getLineAtOffset(a)),prefix:d.getText(this.getPrefixStart(a),a),selection:d.getSelection()},e=this,c=c.map(function(c){var l=c.computeProposals||c.getProposals,d;try{typeof l==="function"&&(d=e.progress?e.progress.progress(l.apply(c,[i,a,n]),"Generating content assist proposal"):l.apply(c,[i,a,n]))}catch(f){e.handleError(f)}return b.when(d)});
return b.all(c,this.handleError).then(function(a){return a.reduce(function(a,c){return c instanceof Array?a.concat(c):a},[])})},setProviders:function(a){this.providers=a.slice(0)},setProgress:function(a){this.progress=a}};j.EventTarget.addMixin(c.prototype);a.prototype={cancel:function(){this.getContentAssist().deactivate()},getContentAssist:function(){return this.contentAssist},isActive:function(){return this.getContentAssist().isActive()},lineUp:function(){for(var a=this.selectedIndex===0?this.proposals.length-
1:this.selectedIndex-1;this.proposals[a].unselectable&&a>0;)a--;this.selectedIndex=a;this.widget&&this.widget.setSelectedIndex(this.selectedIndex);return!0},lineDown:function(){for(var a=this.selectedIndex===this.proposals.length-1?0:this.selectedIndex+1;this.proposals[a].unselectable&&a<this.proposals.length-1;)a++;this.selectedIndex=a;this.widget&&this.widget.setSelectedIndex(this.selectedIndex);return!0},enter:function(){return this.contentAssist.apply(this.proposals[this.selectedIndex]||null)},
tab:function(){return this.widget?(this.widget.createAccessible(this),this.widget.parentNode.focus(),!0):!1}};i.prototype={onClick:function(a){this.contentAssist.apply(this.getProposal(a.target));this.textView.focus()},createDiv:function(a,c,b,l){var d=b.ownerDocument,i=g.createElement(d,"div");i.id="contentoption"+l;i.setAttribute("role","option");a.style==="hr"?a=g.createElement(d,"hr"):(i.className=this.calculateClasses(a.style,c),a=d.createTextNode(this.getDisplayString(a)),c&&this.parentNode.setAttribute("aria-activedescendant",
i.id));i.appendChild(a,i);b.appendChild(i)},createAccessible:function(a){this._isAccessible||this.parentNode.addEventListener("keydown",function(c){c.preventDefault();if(c.keyCode===27)return a.cancel();else if(c.keyCode===38)return a.lineUp();else if(c.keyCode===40)return a.lineDown();else if(c.keyCode===13)return a.enter();return!1});this._isAccessible=!0},calculateClasses:function(a,c){var b=m[a];if(!b)b=m.dfault;return c?b+m.selected:b},getDisplayString:function(a){return typeof a==="string"?
a:a.description&&typeof a.description==="string"?a.description:a.proposal},getProposal:function(a){for(var c=0,b=this.parentNode.firstChild;b!==null;b=b.nextSibling){if(b===a)return this.proposals[c]||null;c++}return null},setSelectedIndex:function(a){this.selectedIndex=a;this.selectNode(this.parentNode.childNodes[this.selectedIndex])},selectNode:function(a){for(var c=this.parentNode.childNodes,b=0;b<c.length;b++){var l=c[b],d=l.className.indexOf(m.selected);if(d>=0)l.className=l.className.substring(0,
d)+l.className.substring(d+m.selected.length);l===a&&(l.className+=m.selected,this.parentNode.setAttribute("aria-activedescendant",l.id),l.focus(),l.offsetTop<this.parentNode.scrollTop?l.scrollIntoView(!0):l.offsetTop+l.offsetHeight>this.parentNode.scrollTop+this.parentNode.clientHeight&&l.scrollIntoView(!1))}},setProposals:function(a){this.proposals=a},show:function(){if(this.proposals.length===0)this.hide();else{this.parentNode.innerHTML="";for(var a=0;a<this.proposals.length;a++)this.createDiv(this.proposals[a],
a===0,this.parentNode,a);this.position();this.parentNode.onclick=this.onClick.bind(this);this.isShowing=!0}},hide:function(){this.parentNode.ownerDocument.activeElement===this.parentNode&&this.textView.focus();this.parentNode.style.display="none";this.parentNode.onclick=null;this.isShowing=!1},position:function(){var a=this.textView.getLocationAtOffset(this.textView.getCaretOffset());a.y+=this.textView.getLineHeight();this.textView.convert(a,"document","page");this.parentNode.style.position="fixed";
this.parentNode.style.left=a.x+"px";this.parentNode.style.top=a.y+"px";this.parentNode.style.display="block";this.parentNode.scrollTop=0;var c=this.parentNode.ownerDocument,b=c.documentElement.clientWidth;if(a.y+this.parentNode.offsetHeight>c.documentElement.clientHeight)this.parentNode.style.top=a.y-this.parentNode.offsetHeight-this.textView.getLineHeight()+"px";if(a.x+this.parentNode.offsetWidth>b)this.parentNode.style.left=b-this.parentNode.offsetWidth+"px"}};return{ContentAssist:c,ContentAssistMode:a,
ContentAssistWidget:i}});
define("orion/editor/undoStack",[],function(){function h(b,g,f){this.offset=b;this.text=g;this.previousText=f}function k(){this.changes=[]}function j(b,g){this.view=b;this.size=g!==void 0?g:100;this.reset();var f=b.getModel();f.getBaseModel&&(f=f.getBaseModel());this.model=f;var e=this;this._listener={onChanging:function(b){e._onChanging(b)},onDestroy:function(b){e._onDestroy(b)}};f.addEventListener("Changing",this._listener.onChanging);b.addEventListener("Destroy",this._listener.onDestroy)}h.prototype=
{undo:function(b,g){this._doUndoRedo(this.offset,this.previousText,this.text,b,g)},redo:function(b,g){this._doUndoRedo(this.offset,this.text,this.previousText,b,g)},_doUndoRedo:function(b,g,f,e,d){var c=e.getModel();if(c.mapOffset&&e.annotationModel){var a=c.mapOffset(b,!0);if(a<0)for(var i=e.annotationModel.getAnnotations(b,b+1);i.hasNext();){var m=i.next();if(m.type==="orion.annotation.folding"){m.expand();a=c.mapOffset(b,!0);break}}if(a<0)return;b=a}e.setText(g,b,b+f.length);d&&e.setSelection(b,
b+g.length)}};k.prototype={add:function(b){this.changes.push(b)},end:function(b){this.endSelection=b.getSelection();this.endCaret=b.getCaretOffset()},undo:function(b,g){for(var f=this.changes.length-1;f>=0;f--)this.changes[f].undo(b,!1);if(g){var f=this.startSelection.start,e=this.startSelection.end;b.setSelection(this.startCaret?f:e,this.startCaret?e:f)}},redo:function(b,g){for(var f=0;f<this.changes.length;f++)this.changes[f].redo(b,!1);if(g){var f=this.endSelection.start,e=this.endSelection.end;
b.setSelection(this.endCaret?f:e,this.endCaret?e:f)}},start:function(b){this.startSelection=b.getSelection();this.startCaret=b.getCaretOffset()}};j.prototype={add:function(b){this.compoundChange?this.compoundChange.add(b):(this.stack.splice(this.index,this.stack.length-this.index,b),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 b=this.index,g=this.stack.length;this._undoStart!==void 0&&b++;return{undo:b,redo:g-b}},undo:function(){this._commitUndo();if(this.index<=0)return!1;var b=this.stack[--this.index];this._ignoreUndo=!0;b.undo(this.view,!0);this._ignoreUndo=!1;return!0},
redo:function(){this._commitUndo();if(this.index>=this.stack.length)return!1;var b=this.stack[this.index++];this._ignoreUndo=!0;b.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(){this._commitUndo();var b=new k;this.add(b);this.compoundChange=b;this.compoundChange.start(this.view)},_commitUndo:function(){if(this._undoStart!==
void 0)this._undoType===-1?this.add(new h(this._undoStart,"",this._undoText)):this.add(new h(this._undoStart,this._undoText,"")),this._undoStart=void 0,this._undoText="",this._undoType=0},_onDestroy:function(){this.model.removeEventListener("Changing",this._listener.onChanging);this.view.removeEventListener("Destroy",this._listener.onDestroy)},_onChanging:function(b){var g=b.text,f=b.start,e=b.removedCharCount,b=b.addedCharCount;if(!this._ignoreUndo){this._undoStart!==void 0&&!(b===1&&e===0&&this._undoType===
1&&f===this._undoStart+this._undoText.length||b===0&&e===1&&this._undoType===-1&&(f+1===this._undoStart||f===this._undoStart))&&this._commitUndo();if(!this.compoundChange)if(b===1&&e===0){if(this._undoStart===void 0)this._undoStart=f;this._undoText+=g;this._undoType=1;return}else if(b===0&&e===1){g=this._undoText.length>0&&this._undoStart===f;this._undoStart=f;this._undoType=-1;g?this._undoText+=this.model.getText(f,f+e):this._undoText=this.model.getText(f,f+e)+this._undoText;return}this.add(new h(f,
g,this.model.getText(f,f+e)))}}};return{UndoStack:j}});
define("orion/edit/nls/root/messages",{"Fetching ":"Fetching ","An error occurred: ":"An error occurred: ","No File Selected":"No File Selected","There are unsaved changes.  Do you still want to navigate away?":"There are unsaved changes.  Do you still want to navigate away?","Search Files":"Search Files","Enter search term:":"Enter search term:","Searching for occurrences of ":"Searching for occurrences of ","Toggle Outliner":"Toggle Outliner","There are unsaved changes.":"There are unsaved changes.",
Save:"Save","Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?","Save this file":"Save this file","Go to Line":"Go to Line","Go to specified line number":"Go to specified line number","Go to line:":"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find","No response from server.  Check your internet connection and try again.":"No response from server.  Check your internet connection and try again.","Saving file {0}":"Saving file {0}",
"Running {0}":"Running {0}"});define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(h,k){var j={root:k};Object.keys(h).forEach(function(b){typeof j[b]==="undefined"&&(j[b]=h[b])});return j});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(h,k){function j(a,c,b){this.start=a;this.end=c;this._projectionModel=b;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function b(){}function g(a,c){var d=a.lastIndexOf("."),d=a.substring(d+1),e={title:h[d],style:{styleClass:"annotation "+d},html:"<div class='annotationHTML "+d+"'></div>",overviewStyle:{styleClass:"annotationOverview "+d}};c?e.lineStyle={styleClass:"annotationLine "+
d}:e.rangeStyle={styleClass:"annotationRange "+d};b.registerType(a,e)}function f(){}function e(a){this._annotations=[];var c=this;this._listener={onChanged:function(a){c._onChanged(a)}};this.setTextModel(a)}function d(a,c){this._view=a;this._annotationModel=c;var b=this;this._listener={onDestroy:function(a){b._onDestroy(a)},onLineStyle:function(a){b._onLineStyle(a)},onChanged:function(a){b._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",
this._listener.onLineStyle);c.addEventListener("Changed",this._listener.onChanged)}j.prototype={_expandedHTML:"<div class='annotationHTML expanded'></div>",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"<div class='annotationHTML collapsed'></div>",_collapsedStyle:{styleClass:"annotation collapsed"},collapse:function(){if(this.expanded){this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var a=this._projectionModel,c=a.getBaseModel();this._projection=
{start:c.getLineStart(c.getLineAtOffset(this.start)+1),end:c.getLineEnd(c.getLineAtOffset(this.end),!0)};a.addProjection(this._projection)}},expand:function(){if(!this.expanded)this.expanded=!0,this.html=this._expandedHTML,this.style=this._expandedStyle,this._projectionModel.removeProjection(this._projection)}};b.ANNOTATION_ERROR="orion.annotation.error";b.ANNOTATION_WARNING="orion.annotation.warning";b.ANNOTATION_TASK="orion.annotation.task";b.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";
b.ANNOTATION_BOOKMARK="orion.annotation.bookmark";b.ANNOTATION_FOLDING="orion.annotation.folding";b.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";b.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";b.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";b.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";b.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";b.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";b.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";
var c={};b.registerType=function(a,b){var d=b;if(typeof d!=="function")d=function(a,c,b){this.start=a;this.end=c;if(b)this.title=b},d.prototype=b;d.prototype.type=a;c[a]=d;return a};b.createAnnotation=function(a,c,b,d){return new (this.getType(a))(c,b,d)};b.getType=function(a){return c[a]};g(b.ANNOTATION_ERROR);g(b.ANNOTATION_WARNING);g(b.ANNOTATION_TASK);g(b.ANNOTATION_BREAKPOINT);g(b.ANNOTATION_BOOKMARK);g(b.ANNOTATION_CURRENT_BRACKET);g(b.ANNOTATION_MATCHING_BRACKET);g(b.ANNOTATION_CURRENT_SEARCH);
g(b.ANNOTATION_MATCHING_SEARCH);g(b.ANNOTATION_READ_OCCURRENCE);g(b.ANNOTATION_WRITE_OCCURRENCE);g(b.ANNOTATION_CURRENT_LINE,!0);b.registerType(b.ANNOTATION_FOLDING,j);f.addMixin=function(a){var c=f.prototype,b;for(b in c)c.hasOwnProperty(b)&&(a[b]=c[b])};f.prototype={addAnnotationType:function(a){if(!this._annotationTypes)this._annotationTypes=[];this._annotationTypes.push(a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var c=0;c<this._annotationTypes.length;c++)if(this._annotationTypes[c]===
a)return c+1;return 0},getAnnotationsByType:function(a,c,b){a=a.getAnnotations(c,b);for(b=[];a.hasNext();)c=a.next(),this.getAnnotationTypePriority(c.type)!==0&&b.push(c);var d=this;b.sort(function(a,c){return d.getAnnotationTypePriority(a.type)-d.getAnnotationTypePriority(c.type)});return b},isAnnotationTypeVisible:function(a){return this.getAnnotationTypePriority(a)!==0},removeAnnotationType:function(a){if(this._annotationTypes)for(var c=0;c<this._annotationTypes.length;c++)if(this._annotationTypes[c]===
a){this._annotationTypes.splice(c,1);break}}};e.prototype={addAnnotation:function(a){if(a){var c=this._annotations,b=this._binarySearch(c,a.start);c.splice(b,0,a);this.onChanged({type:"Changed",added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,c){var b=this._annotations,d,e=0,f=function(){for(;e<b.length;){var l=b[e++];if(a===l.start||(a>l.start?a<l.end:l.start<c))return l;if(l.start>=c)break}return null};d=f();return{next:function(){var a=d;
a&&(d=f());return a},hasNext:function(){return d!==null}}},modifyAnnotation:function(a){if(a&&!(this._getAnnotationIndex(a)<0))this.onChanged({type:"Changed",added:[],removed:[],changed:[a]})},onChanged:function(a){return this.dispatchEvent(a)},removeAnnotations:function(a){var c=this._annotations,b,d;if(a){b=[];for(d=c.length-1;d>=0;d--){var e=c[d];e.type===a&&c.splice(d,1);b.splice(0,0,e)}}else b=c;this.onChanged({type:"Changed",removed:b,added:[],changed:[]})},removeAnnotation:function(a){if(a&&
(a=this._getAnnotationIndex(a),!(a<0)))this.onChanged({type:"Changed",removed:this._annotations.splice(a,1),added:[],changed:[]})},replaceAnnotations:function(a,c){var b=this._annotations,d,e,f,l=[];if(a)for(d=a.length-1;d>=0;d--)f=a[d],e=this._getAnnotationIndex(f),e<0||(b.splice(e,1),l.splice(0,0,f));c||(c=[]);for(d=0;d<c.length;d++)f=c[d],e=this._binarySearch(b,f.start),b.splice(e,0,f);this.onChanged({type:"Changed",removed:l,added:c,changed:[]})},setTextModel:function(a){this._model&&this._model.removeEventListener("Changed",
this._listener.onChanged);(this._model=a)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(a,c){for(var b=a.length,d=-1,e;b-d>1;)e=Math.floor((b+d)/2),c<=a[e].start?b=e:d=e;return b},_getAnnotationIndex:function(a){for(var c=this._annotations,b=this._binarySearch(c,a.start);b<c.length&&c[b].start===a.start;){if(c[b]===a)return b;b++}return-1},_onChanged:function(a){var c=a.start,b=a.removedCharCount,d=this._annotations,e=c+b;if(0<d.length){for(var f={type:"Changed",
added:[],removed:[],changed:[],textModelChangedEvent:a},a=a.addedCharCount-b,b=0;b<d.length;b++){var l=d[b];l.start>=e?(l.start+=a,l.end+=a,f.changed.push(l)):l.end<=c||(l.start<c&&e<l.end?(l.end+=a,f.changed.push(l)):(d.splice(b,1),f.removed.push(l),b--))}if(f.added.length>0||f.removed.length>0||f.changed.length>0)this.onChanged(f)}}};k.EventTarget.addMixin(e.prototype);d.prototype={destroy:function(){var a=this._view;if(a)a.removeEventListener("Destroy",this._listener.onDestroy),a.removeEventListener("LineStyle",
this._listener.onLineStyle),this.view=null;(a=this._annotationModel)&&a.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(a,c){if(c){a||(a={});a.styleClass&&c.styleClass&&a.styleClass!==c.styleClass?a.styleClass+=" "+c.styleClass:a.styleClass=c.styleClass;var b;if(c.style){if(!a.style)a.style={};for(b in c.style)a.style[b]||(a.style[b]=c.style[b])}if(c.attributes){if(!a.attributes)a.attributes={};for(b in c.attributes)a.attributes[b]||(a.attributes[b]=c.attributes[b])}}return a},
_mergeStyleRanges:function(a,c){a||(a=[]);var b,d;for(d=0;d<a.length&&c;d++){var e=a[d];if(c.end<=e.start)break;if(!(c.start>=e.end)){b=this._mergeStyle({},e.style);b=this._mergeStyle(b,c.style);var f=[];f.push(d,1);c.start<e.start&&f.push({start:c.start,end:e.start,style:c.style});c.start>e.start&&f.push({start:e.start,end:c.start,style:e.style});f.push({start:Math.max(e.start,c.start),end:Math.min(e.end,c.end),style:b});c.end<e.end&&f.push({start:c.end,end:e.end,style:e.style});c=c.end>e.end?{start:e.end,
end:c.end,style:c.style}:null;Array.prototype.splice.apply(a,f)}}c&&(b=this._mergeStyle({},c.style),a.splice(d,0,{start:c.start,end:c.end,style:b}));return a},_onAnnotationModelChanged:function(a){function c(a){for(var l=0;l<a.length;l++)if(d.isAnnotationTypeVisible(a[l].type)){var i=a[l].start,n=a[l].end;e.getBaseModel&&(i=e.mapOffset(i,!0),n=e.mapOffset(n,!0));i!==-1&&n!==-1&&b.redrawRange(i,n)}}if(!a.textModelChangedEvent){var b=this._view;if(b){var d=this,e=b.getModel();c(a.added);c(a.removed);
c(a.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){var c=this._annotationModel,b=a.textView.getModel(),d=c.getTextModel(),e=a.lineStart,f=a.lineStart+a.lineText.length;d!==b&&(e=b.mapOffset(e),f=b.mapOffset(f));for(c=c.getAnnotations(e,f);c.hasNext();)if(e=c.next(),this.isAnnotationTypeVisible(e.type)){if(e.rangeStyle){var f=e.start,l=e.end;d!==b&&(f=b.mapOffset(f,!0),l=b.mapOffset(l,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:f,end:l,style:e.rangeStyle})}if(e.lineStyle)a.style=
this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,e.lineStyle)}}};f.addMixin(d.prototype);return{FoldingAnnotation:j,AnnotationType:b,AnnotationTypeList:f,AnnotationModel:e,AnnotationStyler:d}});
define("orion/editor/textDND",[],function(){function h(h,j){this._view=h;this._undoStack=j;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var b=this;this._listener={onDragStart:function(g){b._onDragStart(g)},onDragEnd:function(g){b._onDragEnd(g)},onDragEnter:function(g){b._onDragEnter(g)},onDragOver:function(g){b._onDragOver(g)},onDrop:function(g){b._onDrop(g)},onDestroy:function(g){b._onDestroy(g)}};h.addEventListener("DragStart",this._listener.onDragStart);h.addEventListener("DragEnd",
this._listener.onDragEnd);h.addEventListener("DragEnter",this._listener.onDragEnter);h.addEventListener("DragOver",this._listener.onDragOver);h.addEventListener("Drop",this._listener.onDrop);h.addEventListener("Destroy",this._listener.onDestroy)}h.prototype={destroy:function(){var h=this._view;if(h)h.removeEventListener("DragStart",this._listener.onDragStart),h.removeEventListener("DragEnd",this._listener.onDragEnd),h.removeEventListener("DragEnter",this._listener.onDragEnter),h.removeEventListener("DragOver",
this._listener.onDragOver),h.removeEventListener("Drop",this._listener.onDrop),h.removeEventListener("Destroy",this._listener.onDestroy),this._view=null},_onDestroy:function(){this.destroy()},_onDragStart:function(h){var j=this._view,b=j.getSelection(),j=j.getModel();if(j.getBaseModel)b.start=j.mapOffset(b.start),b.end=j.mapOffset(b.end),j=j.getBaseModel();if(j=j.getText(b.start,b.end))this._dragSelection=b,h.event.dataTransfer.effectAllowed="copyMove",h.event.dataTransfer.setData("Text",j)},_onDragEnd:function(h){var j=
this._view;if(this._dragSelection){this._undoStack&&this._undoStack.startCompoundChange();(h=h.event.dataTransfer.dropEffect==="move")&&j.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var b=this._dropText,g=this._dropOffset;if(h)if(g>=this._dragSelection.end)g-=this._dragSelection.end-this._dragSelection.start;else if(g>=this._dragSelection.start)g=this._dragSelection.start;j.setText(b,g,g);j.setSelection(g,g+b.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&
this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(h){this._onDragOver(h)},_onDragOver:function(h){var j=h.event.dataTransfer.types;if(j){var b=!this._view.getOptions("readonly");b&&(b=j.contains?j.contains("text/plain"):j.indexOf("text/plain")!==-1);if(!b)h.event.dataTransfer.dropEffect="none"}},_onDrop:function(h){var j=this._view,b=h.event.dataTransfer.getData("Text");if(b)h=j.getOffsetAtLocation(h.x,h.y),this._dragSelection?(this._dropOffset=h,this._dropText=b):
(j.setText(b,h,h),j.setSelection(h,h+b.length))}};return{TextDND:h}});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/editor/util"],function(h,k){function j(b,g){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(b);this.setLineDelimiter(g)}j.prototype={find:function(b){if(this._text.length>1)this._text=[this._text.join("")];var g=b.string,f=g;!b.regex&&g&&(f=g.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"));var e=null,d;if(f){var g=b.reverse,c=b.wrap,a=b.wholeWord,i=b.caseInsensitive,h=b.start||0,o=b.end,b=b.end!==void 0,j=
"";j.indexOf("g")===-1&&(j+="g");i&&j.indexOf("i")===-1&&(j+="i");a&&(f="\\b"+f+"\\b");var k=this._text[0],l,s,n=0;b&&(k=k.substring(h,o),n=h);var y=RegExp(f,j);if(g)d=function(){var a=null;for(y.lastIndex=0;;){s=y.lastIndex;l=y.exec(k);if(s===y.lastIndex)return null;if(l){if(!(l.index<h)){if(!c||a)break;h=k.length}a={start:l.index+n,end:y.lastIndex+n}}else break}if(a)h=a.start;return a};else{if(!b)y.lastIndex=h;d=function(){for(;;){s=y.lastIndex;l=y.exec(k);if(s===y.lastIndex)break;if(l)return{start:l.index+
n,end:y.lastIndex+n};if(!(s!==0&&c))break}return null}}e=d()}return{next:function(){var a=e;a&&(e=d());return a},hasNext:function(){return e!==null}}},getCharCount:function(){for(var b=0,g=0;g<this._text.length;g++)b+=this._text[g].length;return b},getLine:function(b,g){var f=this.getLineCount();if(!(0<=b&&b<f))return null;var e=this._lineOffsets[b];if(b+1<f){f=this.getText(e,this._lineOffsets[b+1]);if(g)return f;for(var e=f.length,d;(d=f.charCodeAt(e-1))===10||d===13;)e--;return f.substring(0,e)}else return this.getText(e)},
getLineAtOffset:function(b){var g=this.getCharCount();if(!(0<=b&&b<=g))return-1;var f=this.getLineCount();if(b===g)return f-1;var e,d,c=this._lastLineIndex;if(0<=c&&c<f&&(e=this._lineOffsets[c],d=c+1<f?this._lineOffsets[c+1]:g,e<=b&&b<d))return c;for(var a=f,i=-1;a-i>1;)if(c=Math.floor((a+i)/2),e=this._lineOffsets[c],d=c+1<f?this._lineOffsets[c+1]:g,b<=e)a=c;else if(b<d){a=c;break}else i=c;return this._lastLineIndex=a},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},
getLineEnd:function(b,g){var f=this.getLineCount();if(!(0<=b&&b<f))return-1;if(b+1<f){f=this._lineOffsets[b+1];if(g)return f;for(var e=this.getText(Math.max(this._lineOffsets[b],f-2),f),d=e.length,c;(c=e.charCodeAt(d-1))===10||c===13;)d--;return f-(e.length-d)}else return this.getCharCount()},getLineStart:function(b){return!(0<=b&&b<this.getLineCount())?-1:this._lineOffsets[b]},getText:function(b,g){b===void 0&&(b=0);g===void 0&&(g=this.getCharCount());if(b===g)return"";for(var f=0,e=0,d;e<this._text.length;){d=
this._text[e].length;if(b<=f+d)break;f+=d;e++}for(var c=f,a=e;e<this._text.length;){d=this._text[e].length;if(g<=f+d)break;f+=d;e++}if(a===e)return this._text[a].substring(b-c,g-f);c=this._text[a].substring(b-c);f=this._text[e].substring(0,g-f);return c+this._text.slice(a+1,e).join("")+f},onChanging:function(b){return this.dispatchEvent(b)},onChanged:function(b){return this.dispatchEvent(b)},setLineDelimiter:function(b,g){b==="auto"&&(b=void 0,this.getLineCount()>1&&(b=this.getText(this.getLineEnd(0),
this.getLineEnd(0,!0))));this._lineDelimiter=b?b:k.platformDelimiter;if(g){var f=this.getLineCount();if(f>1){for(var e=Array(f),d=0;d<f;d++)e[d]=this.getLine(d);this.setText(e.join(this._lineDelimiter))}}},setText:function(b,g,f){b===void 0&&(b="");g===void 0&&(g=0);f===void 0&&(f=this.getCharCount());if(!(g===f&&b==="")){for(var e=this.getLineAtOffset(g),d=this.getLineAtOffset(f),c=g,a=f-g,i=d-e,h=b.length,o=0,j=this.getLineCount(),k=0,l=0,s=0,n=[];;){k!==-1&&k<=s&&(k=b.indexOf("\r",s));l!==-1&&
l<=s&&(l=b.indexOf("\n",s));if(l===-1&&k===-1)break;s=k!==-1&&l!==-1?k+1===l?l+1:(k<l?k:l)+1:k!==-1?k+1:l+1;n.push(g+s);o++}this.onChanging({type:"Changing",text:b,start:c,removedCharCount:a,addedCharCount:h,removedLineCount:i,addedLineCount:o});n.length===0&&(k=this.getLineStart(e),d=d+1<j?this.getLineStart(d+1):this.getCharCount(),g!==k&&(b=this.getText(k,g)+b,g=k),f!==d&&(b+=this.getText(f,d),f=d));d=h-a;for(k=e+i+1;k<j;k++)this._lineOffsets[k]+=d;e=[e+1,i].concat(n);Array.prototype.splice.apply(this._lineOffsets,
e);for(d=n=0;d<this._text.length;){k=this._text[d].length;if(g<=n+k)break;n+=k;d++}j=n;for(e=d;d<this._text.length;){k=this._text[d].length;if(f<=n+k)break;n+=k;d++}k=this._text[d];g=this._text[e].substring(0,g-j);f=k.substring(f-n);e=[e,d-e+1];g&&e.push(g);b&&e.push(b);f&&e.push(f);Array.prototype.splice.apply(this._text,e);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:c,removedCharCount:a,addedCharCount:h,removedLineCount:i,addedLineCount:o})}}};h.EventTarget.addMixin(j.prototype);
return{TextModel:j}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(h,k){function j(b){this._model=b;this._projections=[]}j.prototype={addProjection:function(b){if(b){var g=this._model,f=this._projections;b._lineIndex=g.getLineAtOffset(b.start);b._lineCount=g.getLineAtOffset(b.end)-b._lineIndex;var e=b.text;e||(e="");b._model=typeof e==="string"?new h.TextModel(e,g.getLineDelimiter()):e;var g=this.mapOffset(b.start,!0),e=b.end-b.start,d=b._lineCount,c=b._model.getCharCount(),
a=b._model.getLineCount()-1;this.onChanging({type:"Changing",text:b._model.getText(),start:g,removedCharCount:e,addedCharCount:c,removedLineCount:d,addedLineCount:a});var i=this._binarySearch(f,b.start);f.splice(i,0,b);this.onChanged({type:"Changed",start:g,removedCharCount:e,addedCharCount:c,removedLineCount:d,addedLineCount:a})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(b,g){var f=this._projections,e=0,d,c;if(g){for(d=
0;d<f.length;d++){c=f[d];if(c.start>b)break;if(c.end>b)return-1;e+=c._model.getCharCount()-(c.end-c.start)}return b+e}for(d=0;d<f.length;d++){c=f[d];if(c.start>b-e)break;var a=c._model.getCharCount();if(c.start+a>b-e)return-1;e+=a-(c.end-c.start)}return b-e},removeProjection:function(b){var g,f=0;for(g=0;g<this._projections.length;g++){var e=this._projections[g];if(e===b){b=e;break}f+=e._model.getCharCount()-(e.end-e.start)}if(g<this._projections.length){var e=this._model,f=b.start+f,d=b.end-b.start,
c=b._lineCount,a=b._model.getCharCount(),i=b._model.getLineCount()-1;this.onChanging({type:"Changing",text:e.getText(b.start,b.end),start:f,removedCharCount:a,addedCharCount:d,removedLineCount:i,addedLineCount:c});this._projections.splice(g,1);this.onChanged({type:"Changed",start:f,removedCharCount:a,addedCharCount:d,removedLineCount:i,addedLineCount:c})}},_binarySearch:function(b,g){for(var f=b.length,e=-1,d;f-e>1;)d=Math.floor((f+e)/2),g<=b[d].start?f=d:e=d;return f},getCharCount:function(){for(var b=
this._model.getCharCount(),g=this._projections,f=0;f<g.length;f++){var e=g[f];b+=e._model.getCharCount()-(e.end-e.start)}return b},getLine:function(b,g){if(b<0)return null;var f=this._model,e=this._projections,d=0,c=[],a=0,i,h,o;for(i=0;i<e.length;i++){o=e[i];if(o._lineIndex>=b-d)break;h=o._model.getLineCount()-1;if(o._lineIndex+h>=b-d)if(a=b-(o._lineIndex+d),a<h)return o._model.getLine(a,g);else c.push(o._model.getLine(h));a=o.end;d+=h-o._lineCount}for(a=Math.max(a,f.getLineStart(b-d));i<e.length;i++){o=
e[i];if(o._lineIndex>b-d)break;c.push(f.getText(a,o.start));h=o._model.getLineCount()-1;if(o._lineIndex+h>b-d)return c.push(o._model.getLine(0,g)),c.join("");c.push(o._model.getText());a=o.end;d+=h-o._lineCount}e=f.getLineEnd(b-d,g);a<e&&c.push(f.getText(a,e));return c.join("")},getLineAtOffset:function(b){for(var g=this._model,f=this._projections,e=0,d=0,c=0;c<f.length;c++){var a=f[c];if(a.start>b-e)break;var i=a._model.getCharCount();if(a.start+i>b-e){f=b-(a.start+e);d+=a._model.getLineAtOffset(f);
e+=f;break}d+=a._model.getLineCount()-1-a._lineCount;e+=i-(a.end-a.start)}return g.getLineAtOffset(b-e)+d},getLineCount:function(){for(var b=this._projections,g=this._model.getLineCount(),f=0;f<b.length;f++){var e=b[f];g+=e._model.getLineCount()-1-e._lineCount}return g},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(b,g){if(b<0)return-1;for(var f=this._model,e=this._projections,d=0,c=0,a=0;a<e.length;a++){var i=e[a];if(i._lineIndex>b-d)break;var h=i._model.getLineCount()-
1;if(i._lineIndex+h>b-d)return i._model.getLineEnd(b-(i._lineIndex+d),g)+i.start+c;c+=i._model.getCharCount()-(i.end-i.start);d+=h-i._lineCount}return f.getLineEnd(b-d,g)+c},getLineStart:function(b){if(b<0)return-1;for(var g=this._model,f=this._projections,e=0,d=0,c=0;c<f.length;c++){var a=f[c];if(a._lineIndex>=b-e)break;var i=a._model.getLineCount()-1;if(a._lineIndex+i>=b-e)return a._model.getLineStart(b-(a._lineIndex+e))+a.start+d;d+=a._model.getCharCount()-(a.end-a.start);e+=i-a._lineCount}return g.getLineStart(b-
e)+d},getText:function(b,g){b===void 0&&(b=0);var f=this._model,e=this._projections,d=0,c=[],a,i,h;for(a=0;a<e.length;a++){i=e[a];if(i.start>b-d)break;h=i._model.getCharCount();if(i.start+h>b-d)if(g!==void 0&&i.start+h>g-d)return i._model.getText(b-(i.start+d),g-(i.start+d));else c.push(i._model.getText(b-(i.start+d))),b=i.end+d+h-(i.end-i.start);d+=h-(i.end-i.start)}var o=b-d;if(g!==void 0){for(;a<e.length;a++){i=e[a];if(i.start>g-d)break;c.push(f.getText(o,i.start));h=i._model.getCharCount();if(i.start+
h>g-d)return c.push(i._model.getText(0,g-(i.start+d))),c.join("");c.push(i._model.getText());o=i.end;d+=h-(i.end-i.start)}c.push(f.getText(o,g-d))}else{for(;a<e.length;a++)i=e[a],c.push(f.getText(o,i.start)),c.push(i._model.getText()),o=i.end;c.push(f.getText(o))}return c.join("")},_onChanging:function(b,g,f,e,d,c){for(var a=this._model,i=this._projections,h,o=0,j,k=g+f;h<i.length;h++){f=i[h];if(f.start>g)break;o+=f._model.getCharCount()-(f.end-f.start)}g+=o;for(var l=h;h<i.length;h++){f=i[h];if(f.start>
k)break;o+=f._model.getCharCount()-(f.end-f.start);j+=f._model.getLineCount()-1-f._lineCount}f=k+o;o=h;this.onChanging(g,f-g,e,d+j,c);i.splice(i,o-l);for(b=b.length-(f-g);h<i.length;h++)f=i[h],f.start+=b,f.end+=b,f._lineIndex=a.getLineAtOffset(f.start)},onChanging:function(b){return this.dispatchEvent(b)},onChanged:function(b){return this.dispatchEvent(b)},setLineDelimiter:function(b){this._model.setLineDelimiter(b)},setText:function(b,g,f){b===void 0&&(b="");g===void 0&&(g=0);var e=g,d=f,c=this._model,
a=this._projections,i=0,h=0,o,j,k,l,s,n=0;for(o=0;o<a.length;o++){j=a[o];if(j.start>g-i)break;k=j._model.getCharCount();if(j.start+k>g-i)if(f!==void 0&&j.start+k>f-i){j._model.setText(b,g-(j.start+i),f-(j.start+i));return}else n=j._model.getLineCount()-1-j._model.getLineAtOffset(g-(j.start+i)),l={projection:j,start:g-(j.start+i)},g=j.end+i+k-(j.end-j.start);h+=j._model.getLineCount()-1-j._lineCount;i+=k-(j.end-j.start)}g-=i;var y=o,n=c.getLineAtOffset(g)+h-n;if(f!==void 0)for(;o<a.length;o++){j=a[o];
if(j.start>f-i)break;k=j._model.getCharCount();if(j.start+k>f-i){h+=j._model.getLineAtOffset(f-(j.start+i));k=f-(j.start+i);f=j.end+i;s={projection:j,end:k};break}h+=j._model.getLineCount()-1-j._lineCount;i+=k-(j.end-j.start)}else{for(;o<a.length;o++)j=a[o],h+=j._model.getLineCount()-1-j._lineCount,i+=j._model.getCharCount()-(j.end-j.start);f=d=c.getCharCount()+i}f-=i;j=c.getLineAtOffset(f)+h;d-=e;for(var h=j-n,n=b.length,t=k=j=i=0;;){j!==-1&&j<=t&&(j=b.indexOf("\r",t));k!==-1&&k<=t&&(k=b.indexOf("\n",
t));if(k===-1&&j===-1)break;t=j!==-1&&k!==-1?j+1===k?k+1:(j<k?j:k)+1:j!==-1?j+1:k+1;i++}this.onChanging({type:"Changing",text:b,start:e,removedCharCount:d,addedCharCount:n,removedLineCount:h,addedLineCount:i});c.setText(b,g,f);if(l)j=l.projection,j._model.setText("",l.start);if(s)j=s.projection,j._model.setText("",0,s.end),j.start=j.end,j._lineCount=0;a.splice(y,o-y);for(b=b.length-(f-g);o<a.length;o++)j=a[o],j.start+=b,j.end+=b,j._lineIndex=c.getLineAtOffset(j.start);this.onChanged({type:"Changed",
start:e,removedCharCount:d,addedCharCount:n,removedLineCount:h,addedLineCount:i})}};k.EventTarget.addMixin(j.prototype);return{ProjectionTextModel:j}});
define("orion/editor/textView",["orion/editor/textModel","orion/editor/keyBinding","orion/editor/eventTarget","orion/editor/util"],function(h,k,j,b){function g(a,c,b,d){typeof a.addEventListener==="function"?a.addEventListener(c,b,d===!0):a.attachEvent("on"+c,b)}function f(a,c,d){if(d){c.className="";for(var d=c.attributes,i=d.length;i-- >0;)(!b.isIE||b.isIE>=9||b.isIE<9&&d[i].specified)&&c.removeAttribute(d[i].name)}if(a){if(a.styleClass)c.className=a.styleClass;if(d=a.style)for(var e in d)d.hasOwnProperty(e)&&
(c.style[e]=d[e]);if(a=a.attributes)for(var f in a)a.hasOwnProperty(f)&&c.setAttribute(f,a[f])}}function e(a){return a instanceof Array?a.slice(0):a}function d(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(!d(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(!d(a[b],c[b]))return!1}for(b in c)if(!a.hasOwnProperty(b))return!1;return!0}function c(a,c,b){for(var d=0,i=0,e=0,f=a.length;e<f;){d!==-1&&d<=e&&(d=a.indexOf("\r",e));i!==-1&&i<=e&&(i=a.indexOf("\n",e));var h=e,g;if(i===-1&&d===-1){c(a.substring(e));break}d!==-1&&i!==-1?d+1===i?(g=d,e=i+1):(g=d<i?d:i,e=(d<i?d:i)+1):d!==-1?(g=d,e=d+1):(g=i,e=i+1);c(a.substring(h,g));b()}}function a(a){var c,b,d,i,e=a.ownerDocument.defaultView||
a.ownerDocument.parentWindow;if(e.getComputedStyle)a=e.getComputedStyle(a,null),c=a.getPropertyValue("padding-left"),b=a.getPropertyValue("padding-top"),d=a.getPropertyValue("padding-right"),i=a.getPropertyValue("padding-bottom");else if(a.currentStyle)c=a.currentStyle.paddingLeft,b=a.currentStyle.paddingTop,d=a.currentStyle.paddingRight,i=a.currentStyle.paddingBottom;return{left:parseInt(c,10)||0,top:parseInt(b,10)||0,right:parseInt(d,10)||0,bottom:parseInt(i,10)||0}}function i(c){var b,d,i,e,f=
c._trim;if(!f){var f=a(c),g=c.ownerDocument.defaultView||c.ownerDocument.parentWindow;if(g.getComputedStyle)e=g.getComputedStyle(c,null),b=e.getPropertyValue("border-left-width"),d=e.getPropertyValue("border-top-width"),i=e.getPropertyValue("border-right-width"),e=e.getPropertyValue("border-bottom-width");else if(c.currentStyle)b=c.currentStyle.borderLeftWidth,d=c.currentStyle.borderTopWidth,i=c.currentStyle.borderRightWidth,e=c.currentStyle.borderBottomWidth;b=parseInt(b,10)||0;d=parseInt(d,10)||
0;i=parseInt(i,10)||0;e=parseInt(e,10)||0;f.left+=b;f.top+=d;f.right+=i;f.bottom+=e;c._trim=f}return f}function m(a,c,b){this.start=a;this.end=c;this.caret=b}function o(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function q(a,c,b){this.view=a;this.lineIndex=c;this._lineDiv=b}function u(a){this._init(a)}m.prototype={clone:function(){return new m(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}};o.prototype={toString:function(){return"{l="+
this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}};q.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(a,c,i){var e=this.view,g=e._model,h=g.getLine(i),w=g.getLineStart(i),m={type:"LineStyle",textView:e,lineIndex:i,lineText:h,lineStart:w};if(h.length<2E3)e.onLineStyle(m);g=c||b.createElement(a.ownerDocument,"div");if(!c||!d(c.viewStyle,m.style)){f(m.style,g,c);if(c)c._trim=null;
g.viewStyle=m.style;g.setAttribute("role","presentation")}g.lineIndex=i;i=[];this._createRanges(m.ranges,h,0,h.length,w,{tabOffset:0,ranges:i});h=" ";!e._fullSelection&&b.isIE<9&&(h="\ufeff");b.isWebkit&&(h="\u200c");i.push({text:h,style:e._metrics.largestFontStyle,ignoreChars:1});var x,p,r,j,o,h=e=0,k,q;if(c){if(p=c.modelChangedEvent)p.removedLineCount===0&&p.addedLineCount===0?(q=p.start-w,k=p.addedCharCount-p.removedCharCount):q=-1,c.modelChangedEvent=void 0;p=c.firstChild}for(w=0;w<i.length;w++){x=
i[w];j=x.text;e+=j.length;m=x.style;if(p)if(o=p.firstChild.data,r=p.viewStyle,o===j&&d(m,r)){h+=o.length;p._rectsCache=void 0;x=p=p.nextSibling;continue}else for(;p;){if(q!==-1){r=e;r>=q&&(r-=k);o=(o=p.firstChild.data)?o.length:0;if(h+o>r)break;h+=o}r=p.nextSibling;g.removeChild(p);p=r}x=this._createSpan(g,j,m,x.ignoreChars);p?g.insertBefore(x,p):g.appendChild(x);if(c)c.lineWidth=void 0}if(c)for(a=x?x.nextSibling:null;a;)r=a.nextSibling,c.removeChild(a),a=r;else a.appendChild(g);return g},_createRanges:function(a,
c,b,i,e,f){if(!(b>=i)){if(a)for(var g=0;g<a.length;g++){var h=a[g];if(!(h.end<=e+b)){var m=Math.max(e+b,h.start)-e;if(m>=i)break;var p=Math.min(e+i,h.end)-e;if(m<p){m=Math.max(b,m);p=Math.min(i,p);for(b<m&&this._createRange(c,b,m,null,f);g+1<a.length&&a[g+1].start-e===p&&d(h.style,a[g+1].style);)h=a[g+1],p=Math.min(e+i,h.end)-e,g++;this._createRange(c,m,p,h.style,f);b=p}}}b<i&&this._createRange(c,b,i,null,f)}},_createRange:function(a,c,b,d,i){if(!(c>=b)){var e=this.view._customTabSize;if(e&&e!==8)for(var f=
a.indexOf("\t",c);f!==-1&&f<b;){c<f&&(c={text:a.substring(c,f),style:d},i.ranges.push(c),i.tabOffset+=c.text.length);c=e-i.tabOffset%e;if(c>0){for(var g="\u00a0",h=1;h<c;h++)g+=" ";c={text:g,style:d,ignoreChars:c-1};i.ranges.push(c);i.tabOffset+=c.text.length}c=f+1;f=a.indexOf("\t",c)}c<b&&(c={text:a.substring(c,b),style:d},i.ranges.push(c),i.tabOffset+=c.text.length)}},_createSpan:function(a,c,d,i){var e=d&&d.tagName==="A";if(e)a.hasLink=!0;var e=e&&this.view._linksVisible?"a":"span",h=a.ownerDocument,
a=b.createElement(a.ownerDocument,e);a.appendChild(h.createTextNode(c));f(d,a);if(e==="A"){var w=this.view,m=this._getWindow();g(a,"click",function(a){return w._handleLinkClick(a?a:m.event)},!1)}a.viewStyle=d;if(i)a.ignoreChars=i;return a},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(a,c){var d=this._ensureCreated(),i=this.view;if(a===void 0)return this._getLineBoundingClientRect(d,!0);var e=i._model,
f=d.ownerDocument,g=this.lineIndex,h=null;if(a<e.getLineEnd(g)){e=e.getLineStart(g);for(g=d.firstChild;g;){var m=g.firstChild,p=m.length;g.ignoreChars&&(p-=g.ignoreChars);if(e+p>a){h=a-e;if(i._isRangeRects)f=f.createRange(),f.setStart(m,h),f.setEnd(m,h+1),h=new o(f.getBoundingClientRect());else if(b.isIE)f=f.body.createTextRange(),f.moveToElementText(g),f.collapse(),f.moveEnd("character",h+1),f.moveStart("character",h),h=new o(f.getBoundingClientRect());else{var r=m.data;g.removeChild(m);g.appendChild(f.createTextNode(r.substring(0,
h)));var j=b.createElement(f,"span");j.appendChild(f.createTextNode(r.substring(h,h+1)));g.appendChild(j);g.appendChild(f.createTextNode(r.substring(h+1)));h=new o(j.getBoundingClientRect());g.innerHTML="";g.appendChild(m);this._createdDiv||(f=i._getSelection(),(e<=f.start&&f.start<e+p||e<=f.end&&f.end<e+p)&&i._updateDOMSelection())}b.isIE&&(f=d.ownerDocument.defaultView||d.ownerDocument.parentWindow,d=f.screen.logicalXDPI/f.screen.deviceXDPI,f=f.screen.logicalYDPI/f.screen.deviceYDPI,h.left*=d,h.right*=
d,h.top*=f,h.bottom*=f);break}e+=p;g=g.nextSibling}}d=this.getBoundingClientRect();if(!h)i._wrapMode?(i=this.getClientRects(),h=i[i.length-1],h.left=h.right,h.left+=d.left,h.top+=d.top,h.right+=d.left,h.bottom+=d.top):(h=new o(d),h.left=h.right);if(c||c===void 0)h.left-=d.left,h.top-=d.top,h.right-=d.left,h.bottom-=d.top;return h},_getClientRects:function(a,c){var b,d,i,e;if(!a._rectsCache){b=a.getClientRects();d=Array(b.length);for(e=0;e<b.length;e++)i=d[e]=new o(b[e]),i.left-=c.left,i.top-=c.top,
i.right-=c.left,i.bottom-=c.top;a._rectsCache=d}b=a._rectsCache;d=[b.length];for(e=0;e<b.length;e++)d[e]=new o(b[e]);return d},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var c=this._ensureCreated(),b=[],d=c.firstChild,i,e=c.getBoundingClientRect();d;){for(var f=this._getClientRects(d,e),c=0;c<f.length;c++){var h=f[c],g;if(h.top!==h.bottom){var m=h.top+(h.bottom-h.top)/2;for(g=0;g<b.length;g++)if(i=b[g],i.top<=m&&m<i.bottom)break;if(g===b.length)b.push(h);
else{if(h.left<i.left)i.left=h.left;if(h.top<i.top)i.top=h.top;if(h.right>i.right)i.right=h.right;if(h.bottom>i.bottom)i.bottom=h.bottom}}}d=d.nextSibling}return a!==void 0?b[a]:b},_getLineBoundingClientRect:function(a,c){var b=new o(a.getBoundingClientRect());if(!this.view._wrapMode){b.right=b.left;for(var d=a.lastChild;d&&d.ignoreChars===d.firstChild.length;)d=d.previousSibling;if(d)d=d.getBoundingClientRect(),b.right=d.right+i(a).right}c&&(d=i(a),b.left+=d.left,b.right-=d.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(a,c){var d=this.view,i=d._model,e=this.lineIndex,f=i.getLineStart(e),
i=i.getLineEnd(e);if(f===i)return f;var h=this._ensureCreated(),e=this.getBoundingClientRect(),g,m;if(d._wrapMode){g=this.getClientRects();if(c<g[0].top)c=g[0].top;for(var p=0;p<g.length;p++)if(m=g[p],m.top<=c&&c<m.bottom)break;if(a<m.left)a=m.left;a>m.right&&(a=m.right-1)}else a<0&&(a=0),a>e.right-e.left&&(a=e.right-e.left);var r=h.ownerDocument,p=r.defaultView||r.parentWindow,j=b.isIE?p.screen.logicalXDPI/p.screen.deviceXDPI:1,o=b.isIE?p.screen.logicalYDPI/p.screen.deviceYDPI:1,p=f,k=h.firstChild;
a:for(;k;){var q=k.firstChild,h=q.length;k.ignoreChars&&(h-=k.ignoreChars);var u,E,F;g=this._getClientRects(k,e);for(var B=0;B<g.length;B++)if(m=g[B],m.left<=a&&a<m.right&&(!d._wrapMode||m.top<=c&&c<m.bottom)){if(b.isIE||d._isRangeRects){for(var r=d._isRangeRects?r.createRange():r.body.createTextRange(),B=h,H=-1;B-H>1;){var K=Math.floor((B+H)/2);m=H+1;g=K===h-1&&k.ignoreChars?q.length:K+1;d._isRangeRects?(r.setStart(q,m),r.setEnd(q,g)):(r.moveToElementText(k),r.move("character",m),r.moveEnd("character",
g-m));g=r.getClientRects();for(var P=!1,L=0;L<g.length;L++)if(m=g[L],u=m.left*j-e.left,F=m.right*j-e.left,E=m.top*o-e.top,m=m.bottom*o-e.top,u<=a&&a<F&&(!d._wrapMode||E<=c&&c<m)){P=!0;break}P?B=K:H=K}p+=B;m=B;g=B===h-1&&k.ignoreChars?q.length:Math.min(B+1,q.length);d._isRangeRects?(r.setStart(q,m),r.setEnd(q,g)):(r.moveToElementText(k),r.move("character",m),r.moveEnd("character",g-m));m=r.getClientRects()[0];u=m.left*j-e.left;F=m.right*j-e.left;a>u+(F-u)/2&&p++}else{m=[];for(j=0;j<h;j++)m.push("<span>"),
j===h-1?m.push(q.data.substring(j)):m.push(q.data.substring(j,j+1)),m.push("</span>");k.innerHTML=m.join("");for(j=k.firstChild;j;){m=j.getBoundingClientRect();u=m.left-e.left;F=m.right-e.left;if(u<=a&&a<F){a>u+(F-u)/2&&p++;break}p++;j=j.nextSibling}if(!this._createdDiv)k.innerHTML="",k.appendChild(q),e=d._getSelection(),(p<=e.start&&e.start<p+h||p<=e.end&&e.end<p+h)&&d._updateDOMSelection()}break a}p+=h;k=k.nextSibling}return Math.min(i,Math.max(f,p))},getNextOffset:function(a,c,d){return c==="line"?
(c=this.view._model,a=c.getLineAtOffset(a),d>0?c.getLineEnd(a):c.getLineStart(a)):c==="wordend"?this._getNextOffset_W3C(a,c,d):b.isIE?this._getNextOffset_IE(a,c,d):this._getNextOffset_W3C(a,c,d)},_getNextOffset_W3C:function(a,c,b){function d(a){return 33<=a&&a<=47||58<=a&&a<=64||91<=a&&a<=94||a===96||123<=a&&a<=126}if(c==="word"||c==="wordend"){var i=this.view._model,e=i.getLineAtOffset(a),f=i.getLine(e),h=i.getLineStart(e),e=i.getLineEnd(e),i=f.length;a-=h;var g,m;if(b>0){if(a===i)return e;g=f.charCodeAt(a);
m=d(g);b=!m&&!(g===32||g===9);for(a++;a<i;){g=f.charCodeAt(a);e=d(g);if(c==="wordend"){if(!e&&m)break}else if(e&&!m)break;g=!e&&!(g===32||g===9);if(c==="wordend"){if(!g&&b)break}else if(g&&!b)break;b=g;m=e;a++}}else{if(a===0)return h;a--;g=f.charCodeAt(a);m=d(g);for(b=!m&&!(g===32||g===9);0<a;){g=f.charCodeAt(a-1);e=d(g);if(c==="wordend"){if(e&&!m)break}else if(!e&&m)break;g=!e&&!(g===32||g===9);if(c==="wordend"){if(g&&!b)break}else if(!g&&b)break;b=g;m=e;a--}}return h+a}return a+b},_getNextOffset_IE:function(a,
c,b){var d=this._ensureCreated(),i=this.view._model,e=this.lineIndex,f=0,g;g=i.getLineStart(e);var h=d.ownerDocument;if(a===i.getLineEnd(e))f=h.body.createTextRange(),f.moveToElementText(d.lastChild),g=f.text.length,f.moveEnd(c,b),f=a+f.text.length-g;else if(a===g&&b<0)f=g;else for(d=d.firstChild;d;){i=d.firstChild.length;d.ignoreChars&&(i-=d.ignoreChars);if(g+i>a){f=h.body.createTextRange();a===g&&b<0?f.moveToElementText(d.previousSibling):(f.moveToElementText(d),f.collapse(),f.moveEnd("character",
a-g));g=f.text.length;f.moveEnd(c,b);f=a+f.text.length-g;break}g=i+g;d=d.nextSibling}return f},destroy:function(){var a=this._createdDiv;if(a)a.parentNode.removeChild(a),this._createdDiv=null}};u.prototype={addRuler:function(a,c){a.setView(this);var b=this._rulers;if(c!==void 0){var d,i;for(d=0,i=0;d<b.length&&i<c;d++)a.getLocation()===b[d].getLocation()&&i++;b.splice(i,0,a);c=i}else b.push(a);this._createRuler(a,c);this._update()},computeSize:function(){var a=0,c=0,d=this._model,i=this._clientDiv;
if(!i)return{width:a,height:c};var e=i.style.width;if(b.isWebkit)i.style.width="0x7fffffffpx";for(var d=d.getLineCount(),f=0;f<d;f++){var g=this._getLine(f),h=g.getBoundingClientRect(),a=Math.max(a,h.right-h.left);c+=h.bottom-h.top;g.destroy()}if(b.isWebkit)i.style.width=e;i=this._getViewPadding();a+=i.right+i.left;c+=i.bottom+i.top;return{width:a,height:c}},convert:function(a,c,b){if(this._clientDiv){var d=this._getScroll(),i=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect();c==="document"&&
(a.x!==void 0&&(a.x+=-d.x+e.left+i.left),a.y!==void 0&&(a.y+=-d.y+e.top+i.top));b==="document"&&(a.x!==void 0&&(a.x+=d.x-e.left-i.left),a.y!==void 0&&(a.y+=d.y-e.top-i.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._keyBindings=this._doubleClickSelection=this._selection=this._model=this._parent=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),
b.isOpera&&this._clientDiv.blur(),this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(a){if(a=this._actions[a])return a.actionDescription},getActions:function(a){var c=[],b=this._actions,d;for(d in b)b.hasOwnProperty(d)&&(a||!b[d].defaultHandler)&&c.push(d);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._keyBindings,d=0;d<b.length;d++)b[d].actionID===a&&c.push(b[d].keyBinding);return c},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 e(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]=e(this["_"+b]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,c){if(!this._clientDiv)return 0;var b=this._getLineIndex(c),d=this._getLine(b),b=d.getOffset(a,c-this._getLinePixel(b));d.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){if(this._clientDiv){var b=this._actions[a];if(b){if(!c&&b.handler&&b.handler())return;if(b.defaultHandler)return b.defaultHandler()}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)},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(),d=0;d<b.length;d++)this.redrawLines(a,c,b[d])},redrawLines:function(a,c,b){if(!(this._redrawCount>0)&&(a===void 0&&(a=0),c===void 0&&(c=this._model.getLineCount()),a!==c)){var d=this._clientDiv;if(d){if(b)for(var i=
(b.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild.rows[0].cells,e=0;e<i.length;e++)if(i[e].firstChild._ruler===b){d=i[e].firstChild;break}b?d.rulerChanged=!0:this._lineHeight&&this._resetLineHeight(a,c);if(!b||b.getOverview()==="page")for(d=d.firstChild;d;){i=d.lineIndex;if(a<=i&&i<c)d.lineChanged=!0;d=d.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 d=b.getLineAtOffset(a),b=b.getLineAtOffset(Math.max(a,c-1))+1;this.redrawLines(d,b)}},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 d=this._actions,i=d[a];i||(i=d[a]={});
i.handler=c;i.actionDescription=b}},setKeyBinding:function(a,c){for(var b=this._keyBindings,d=0;d<b.length;d++){var i=b[d];if(i.keyBinding.equals(a)){c?i.actionID=c:i.predefined?i.actionID=null:b.splice(d,1);return}}c&&b.push({keyBinding:a,actionID:c})},setCaretOffset:function(a,c){var b=this._model.getCharCount(),a=Math.max(0,Math.min(a,b));this._setSelection(new m(a,a,!1),c===void 0||c)},setHorizontalPixel:function(a){this._clientDiv&&(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},
setRedraw:function(a){a?--this._redrawCount===0&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==this._model){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);var c=this._model.getLineCount(),b=this._model.getCharCount(),d=a.getLineCount(),i=a.getCharCount(),e={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:b,addedCharCount:i,removedLineCount:c,addedLineCount:d};
this.onModelChanging(e);this._model=a;e={type:"ModelChanged",start:0,removedCharCount:b,addedCharCount:i,removedLineCount:c,addedLineCount:d};this.onModelChanged(e);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 i=a[b];if(!d(this["_"+b],i)){var f=c[b]?c[b].update:null;f?f.call(this,
i):this["_"+b]=e(i)}}},setSelection:function(a,c,b){var d=a>c;if(d)var i=a,a=c,c=i;i=this._model.getCharCount();a=Math.max(0,Math.min(a,i));c=Math.max(0,Math.min(c,i));this._setSelection(new m(a,c,d),b===void 0||b)},setText:function(a,c,d){var i=c===void 0&&d===void 0;c===void 0&&(c=0);d===void 0&&(d=this._model.getCharCount());this._modifyContent({text:a,start:c,end:d,_code:!0},!i);if(i)this._columnX=-1,this._setSelection(new m(0,0,!1),!0),b.isFirefox&&this._fixCaret()},setTopIndex:function(a){this._clientDiv&&
this._scrollView(0,this._getLinePixel(Math.max(0,a))-this._getScroll().y)},setTopPixel:function(a){this._clientDiv&&this._scrollView(0,Math.max(0,a)-this._getScroll().y)},showSelection:function(){return this._showCaret(!0)},update:function(a,c){this._clientDiv&&(a&&this._updateStyle(),c===void 0||c?this._update():this._queueUpdate())},_handleRootMouseDown:function(a){if(b.isFirefox&&a.which===1)this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0;var c=
this._overlayDiv||this._clientDiv;if(b.isIE<9)c=this._viewDiv;for(var d=a.target?a.target:a.srcElement;d;){if(c===d)return;d=d.parentNode}a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();if(!this._isW3CEvents){var i=this;this._getWindow().setTimeout(function(){i._clientDiv.focus()},0)}},_handleRootMouseUp:function(a){if(b.isFirefox&&a.which===1)this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),this._ignoreBlur=!1},_handleBlur:function(){if(!this._ignoreBlur){this._hasFocus=
!1;if(b.isIE<9&&!this._getSelection().isEmpty()){var a=this._rootDiv,c=b.createElement(a.ownerDocument,"div");a.appendChild(c);a.removeChild(c)}if(this._selDiv1)if(this._selDiv1.style.background="lightgray",this._selDiv2.style.background="lightgray",this._selDiv3.style.background="lightgray",a=this._getWindow(),c=this._selDiv1.ownerDocument,a.getSelection){c=a.getSelection();for(a=c.anchorNode;a;){if(a===this._clientDiv){c.rangeCount>0&&c.removeAllRanges();break}a=a.parentNode}}else if(c.selection){this._ignoreSelect=
!1;for(a=c.selection.createRange().parentElement();a;){if(a===this._clientDiv){c.selection.empty();break}a=a.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(a){b.isIE&&this._lastMouseButton===3&&this._updateDOMSelection();var c=!1;if(this.isListening("ContextMenu"))c=this._createMouseEvent("ContextMenu",a),c.screenX=a.screenX,c.screenY=a.screenY,this.onContextMenu(c),c=c.defaultPrevented;if(c)return a.preventDefault&&a.preventDefault(),
!1},_handleCopy:function(a){if(!this._ignoreCopy&&this._doCopy(a))return a.preventDefault&&a.preventDefault(),!1},_handleCut:function(a){if(this._doCut(a))return a.preventDefault&&a.preventDefault(),!1},_handleDataModified:function(){this._startIME()},_handleDblclick:function(a){this._lastMouseTime=a.timeStamp?a.timeStamp:(new Date).getTime();if(this._clickCount!==2)this._clickCount=2,this._handleMouse(a)},_handleDragStart:function(a){if(b.isFirefox){var c=this;this._getWindow().setTimeout(function(){c._clientDiv.contentEditable=
!0;c._clientDiv.draggable=!1;c._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",a)),this._dragOffset=-1;else return a.preventDefault&&a.preventDefault(),!1},_handleDrag:function(a){if(this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",a))},_handleDragEnd:function(a){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",
a));b.isFirefox&&(this._fixCaret(),a.dataTransfer.dropEffect==="none"&&!a.dataTransfer.mozUserCancelled&&this._fixCaret())},_handleDragEnter:function(a){var c=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(c=!1,this.onDragEnter(this._createMouseEvent("DragEnter",a)));if(b.isWebkit||c)return a.preventDefault&&a.preventDefault(),!1},_handleDragOver:function(a){var c=!0;this.isListening("DragOver")&&(c=!1,this.onDragOver(this._createMouseEvent("DragOver",a)));if(b.isWebkit||c){if(c)a.dataTransfer.dropEffect=
"none";a.preventDefault&&a.preventDefault();return!1}},_handleDragLeave:function(a){this._dropTarget=!1;if(this.isListening("DragLeave"))this.onDragLeave(this._createMouseEvent("DragLeave",a))},_handleDrop:function(a){this._dropTarget=!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",a));a.preventDefault&&a.preventDefault();return!1},_handleFocus:function(){this._hasFocus=!0;b.isIOS&&this._lastTouchOffset!==void 0?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=
void 0):this._updateDOMSelection();if(this._selDiv1){var a=this._highlightRGB;this._selDiv1.style.background=a;this._selDiv2.style.background=a;this._selDiv3.style.background=a}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(a){var c=!1;switch(a.keyCode){case 16:case 17:case 18:case 91:c=!0;break;default:this._setLinksVisible(!1)}if(a.keyCode===229){if(this._readonly)return a.preventDefault&&a.preventDefault(),!1;c=!0;b.isSafari&&b.isMac&&a.ctrlKey&&(c=!1);c&&this._startIME()}else c||
this._commitIME();if((b.isMac||b.isLinux)&&b.isFirefox<4||b.isOpera)return this._keyDownEvent=a,!0;if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1},_handleKeyPress:function(a){if(b.isMac&&b.isWebkit&&(63232<=a.keyCode&&a.keyCode<=63487||a.keyCode===13||a.keyCode===8))return a.preventDefault&&a.preventDefault(),!1;if(((b.isMac||b.isLinux)&&b.isFirefox<4||b.isOpera)&&this._doAction(this._keyDownEvent))return a.preventDefault&&
a.preventDefault(),!1;var c=b.isMac?a.metaKey:a.ctrlKey;if(a.charCode!==void 0&&c)switch(a.charCode){case 99:case 118:case 120:return!0}c=!1;if(b.isMac){if(a.ctrlKey||a.metaKey)c=!0}else if(b.isFirefox){if(a.ctrlKey||a.altKey)c=!0}else a.ctrlKey^a.altKey&&(c=!0);if(!c&&(c=b.isOpera?a.which:a.charCode!==void 0?a.charCode:a.keyCode,c>31))return this._doContent(String.fromCharCode(c)),a.preventDefault&&a.preventDefault(),!1},_handleKeyUp:function(a){(b.isMac?a.metaKey:a.ctrlKey)||this._setLinksVisible(!1);
a.keyCode===13&&this._commitIME()},_handleLinkClick:function(a){if(!(b.isMac?a.metaKey:a.ctrlKey))return a.preventDefault&&a.preventDefault(),!1},_handleMouse:function(a){var c=this._getWindow(),d=!0,i=c;if(b.isIE||b.isFirefox&&!this._overlayDiv)i=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=!0;var e=this;c.setTimeout(function(){e.focus();e._ignoreFocus=!1},0)}this._clickCount===1?(d=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,!b.isOpera&&this._hasFocus&&this.isListening("DragStart")))&&
this._setGrab(i):(this._isW3CEvents&&this._setGrab(i),this._doubleClickSelection=null,this._setSelectionTo(a.clientX,a.clientY,a.shiftKey),this._doubleClickSelection=this._getSelection());return d},_handleMouseDown:function(a){if(this._linksVisible)if((a.target||a.srcElement).tagName!=="A")this._setLinksVisible(!1);else return;this._commitIME();var c=a.which;c||(a.button===4&&(c=2),a.button===2&&(c=3),a.button===1&&(c=1));var d=c!==2&&a.timeStamp?a.timeStamp:(new Date).getTime(),i=d-this._lastMouseTime,
e=Math.abs(this._lastMouseX-a.clientX),f=Math.abs(this._lastMouseY-a.clientY),g=this._lastMouseButton===c;this._lastMouseX=a.clientX;this._lastMouseY=a.clientY;this._lastMouseTime=d;this._lastMouseButton=c;if(c===1)this._isMouseDown=!0,g&&i<=this._clickTime&&e<=this._clickDist&&f<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&(d=this._createMouseEvent("MouseDown",a),this.onMouseDown(d),d.defaultPrevented)){a.preventDefault();return}if(c===1&&this._handleMouse(a)&&
(b.isIE>=9||b.isOpera||b.isChrome||b.isSafari||b.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),a.preventDefault();b.isFirefox&&this._lastMouseButton===3&&this._updateDOMSelection()},_handleMouseOver:function(a){if(this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",a))},_handleMouseOut:function(a){if(this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",a))},_handleMouseMove:function(a){var c=this._isClientDiv(a);if(this.isListening("MouseMove")&&
c)this.onMouseMove(this._createMouseEvent("MouseMove",a));if(!this._dropTarget){var d=this._linksVisible||this._lastMouseMoveX!==a.clientX||this._lastMouseMoveY!==a.clientY;this._lastMouseMoveX=a.clientX;this._lastMouseMoveY=a.clientY;this._setLinksVisible(d&&!this._isMouseDown&&(b.isMac?a.metaKey:a.ctrlKey));if(!this._isW3CEvents){if(a.button===0)return this._setGrab(null),!0;if(!this._isMouseDown&&a.button===1&&(this._clickCount&1)!==0&&c)return this._clickCount=2,this._handleMouse(a,this._clickCount)}if(this._isMouseDown&&
this._dragOffset===-1){var c=a.clientX,a=a.clientY,i=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect(),f=this._getClientWidth(),g=this._getClientHeight(),d=e.left+i.left,h=e.top+i.top,f=e.left+i.left+f,i=e.top+i.top+g,e=this._model,g=e.getLineAtOffset(this._getSelection().getCaret());a<h&&g!==0?this._doAutoScroll("up",c,a-h):a>i&&g!==e.getLineCount()-1?this._doAutoScroll("down",c,a-i):c<d&&!this._wrapMode?this._doAutoScroll("left",c-d,a):c>f&&!this._wrapMode?this._doAutoScroll("right",
c-f,a):(this._endAutoScroll(),this._setSelectionTo(c,a,!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},_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(a){var c=a.which?a.button===0:a.button===1;if(this.isListening("MouseUp")&&
(this._isClientDiv(a)||c&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",a));if(!this._linksVisible&&c&&this._isMouseDown){if(this._dragOffset!==-1)c=this._getSelection(),c.extend(this._dragOffset),c.collapse(),this._setSelection(c,!0,!0),this._dragOffset=-1;this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null);b.isFirefox&&a.preventDefault()}},_handleMouseWheel:function(a){var c=this._getLineHeight(),d=0,i=0;b.isIE||b.isOpera?i=-a.wheelDelta/40*c:b.isFirefox?
(c=b.isMac?a.detail*3:Math.max(-256,Math.min(256,a.detail))*c,a.axis===a.HORIZONTAL_AXIS?d=c:i=c):b.isMac?(i=d=40,a.wheelDeltaX%120!==0&&(d=1),a.wheelDeltaY%120!==0&&(i=1),d=-a.wheelDeltaX/d,-1<d&&d<0&&(d=-1),0<d&&d<1&&(d=1),i=-a.wheelDeltaY/i,-1<i&&i<0&&(i=-1),0<i&&i<1&&(i=1)):(d=-a.wheelDeltaX,i=-a.wheelDeltaY/120*8*c);if(b.isSafari){for(c=a.target;c&&c.lineIndex===void 0;)c=c.parentNode;this._mouseWheelLine=c}c=this._getScroll();this._scrollView(d,i);d=this._getScroll();if(c.x!==d.x||c.y!==d.y)return a.preventDefault&&
a.preventDefault(),!1},_handlePaste:function(a){if(!this._ignorePaste&&this._doPaste(a)){if(b.isIE){var c=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){c._updateDOMSelection();c._ignoreFocus=!1},0)}a.preventDefault&&a.preventDefault();return!1}},_handleResize:function(){var a=this._parent.clientWidth,c=this._parent.clientHeight;if(this._parentWidth!==a||this._parentHeight!==c)this._parentWidth!==a&&this._resetLineHeight(),this._parentWidth=a,this._parentHeight=c,b.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(),d=this._model.getLineCount(),i=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect(),b=Math.floor((a.clientY-e.top-this._metrics.scrollWidth)*d/(b+i.top+i.bottom-2*this._metrics.scrollWidth));0<=b&&b<d||(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(),c=this._hScroll,b=this._vScroll;if(c!==a.x||b!==a.y)this._checkOverlayScroll(),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 d=0,i=b.lineIndex;if(a.tagName!=="DIV")for(b=b.firstChild;b;){var e=b.firstChild;if(e===a){b.ignoreChars&&(d-=b.ignoreChars);d+=c;break}b.ignoreChars&&(d-=b.ignoreChars);d+=e.data.length;b=b.nextSibling}return Math.max(0,d)+this._model.getLineStart(i)}},_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 m(c,a),!1,!1)},_handleSelectionChange:function(){if(this._imeOffset===-1)if(b.isAndroid){var a=this._getWindow();this._selTimer&&a.clearTimeout(this._selTimer);var c=this;this._selTimer=a.setTimeout(function(){if(c._clientDiv)c._selTimer=null,c._updateSelectionFromDOM()},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(a){this._imeOffset=
-1;if(b.isAndroid){for(var c=this._getWindow().getSelection(),d=c.anchorNode;d;){if(d.lineIndex!==void 0)break;d=d.parentNode}if(d){var i=this._model,e=d.lineIndex,f=i.getLine(e),g=f,h=0,i=i.getLineStart(e);if(c.rangeCount>0)c.getRangeAt(0).deleteContents(),e=d.ownerDocument.createTextNode(a.data),c.getRangeAt(0).insertNode(e),h=this._getDOMText(d,e),g=h.text,h=h.offset,e.parentNode.removeChild(e);d.lineRemoved=!0;for(d=0;f.charCodeAt(d)===g.charCodeAt(d)&&d<h;)d++;c=f.length-1;for(e=g.length-f.length;f.charCodeAt(c)===
g.charCodeAt(c+e)&&c+e>=h+a.data.length;)c--;c++;f=g.substring(d,c+e);d+=i;c+=i;this._modifyContent({text:f,start:d,end:c,_ignoreDOMSelection:!0},!0)}}else this._doContent(a.data);a.preventDefault()},_handleTouchStart:function(a){this._commitIME();var c=this._getWindow();if(this._touchScrollTimer)this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",c.clearInterval(this._touchScrollTimer),this._touchScrollTimer=null;var d=a.touches;if(d.length===1){var d=d[0],i=d.clientX,e=d.clientY;
this._touchStartX=i;this._touchStartY=e;if(b.isAndroid&&(e<d.pageY-c.pageYOffset||i<d.pageX-c.pageXOffset))i=d.pageX-c.pageXOffset,e=d.pageY-c.pageYOffset;c=this.convert({x:i,y:e},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(c.x,c.y);this._touchStartTime=a.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,d=this._getWindow();this._touchScrollTimer=d.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";d.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){for(var c=this._keyBindings,b=0;b<c.length;b++){var d=c[b];if(d.keyBinding.match(a)){if(d.actionID&&(a=this._actions[d.actionID]))if(a.handler){if(!a.handler())return a.defaultHandler?typeof a.defaultHandler()==="boolean":
!1}else if(a.defaultHandler)return typeof a.defaultHandler()==="boolean";return!0}}return!1},_doBackspace:function(a){var c=this._getSelection();if(c.isEmpty()){var b=this._model,d=c.getCaret(),i=b.getLineAtOffset(d),e=b.getLineStart(i);if(d===e)i>0&&c.extend(b.getLineEnd(i-1));else{var f=!1;this._expandTab&&a.unit==="character"&&(d-e)%this._tabSize===0&&(f=!/[^ ]/.test(b.getText(e,d)));f?c.extend(d-this._tabSize):(b=this._getLine(i),c.extend(b.getNextOffset(d,a.unit,-1)),b.destroy())}}this._modifyContent({text:"",
start:c.start,end:c.end},!0);return!0},_doContent:function(a){var c=this._getSelection();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){if(!a.select&&this._clearSelection("next"))return!0;var c=this._model,b=this._getSelection(),d=b.getCaret(),i=c.getLineAtOffset(d);d===c.getLineEnd(i)?i+1<c.getLineCount()&&b.extend(c.getLineStart(i+
1)):(c=this._getLine(i),b.extend(c.getNextOffset(d,a.unit,1)),c.destroy());a.select||b.collapse();this._setSelection(b,!0);return!0},_doCursorPrevious:function(a){if(!a.select&&this._clearSelection("previous"))return!0;var c=this._model,b=this._getSelection(),d=b.getCaret(),i=c.getLineAtOffset(d);d===c.getLineStart(i)?i>0&&b.extend(c.getLineEnd(i-1)):(c=this._getLine(i),b.extend(c.getNextOffset(d,a.unit,-1)),c.destroy());a.select||b.collapse();this._setSelection(b,!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();if(c.isEmpty()){var b=this._model,d=c.getCaret(),i=b.getLineAtOffset(d);d===b.getLineEnd(i)?i+1<b.getLineCount()&&c.extend(b.getLineStart(i+1)):(b=this._getLine(i),c.extend(b.getNextOffset(d,a.unit,1)),b.destroy())}this._modifyContent({text:"",start:c.start,end:c.end},!0);return!0},_doEnd:function(a){var c=this._getSelection(),
b=this._model;if(a.ctrl)c.extend(b.getCharCount());else{var d=c.getCaret(),i=b.getLineAtOffset(d);if(this._wrapMode){var e=this._getLine(i),d=e.getLineIndex(d),d=d===e.getLineCount()-1?b.getLineEnd(i):e.getLineStart(d+1)-1;e.destroy()}else d=b.getLineEnd(i);c.extend(d)}a.select||c.collapse();this._setSelection(c,!0);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);return!0},_doHome:function(a){var c=
this._getSelection(),b=this._model;if(a.ctrl)c.extend(0);else{var d=c.getCaret(),i=b.getLineAtOffset(d);this._wrapMode?(b=this._getLine(i),d=b.getLineIndex(d),d=b.getLineStart(d),b.destroy()):d=b.getLineStart(i);c.extend(d)}a.select||c.collapse();this._setSelection(c,!0);return!0},_doLineDown:function(a){var c=this._model,d=this._getSelection(),i=d.getCaret(),e=c.getLineAtOffset(i),f=this._getLine(e),g=this._columnX,h=1,m=!1;if(g===-1||a.wholeLine||a.select&&b.isIE)g=a.wholeLine?c.getLineEnd(e+1):
i,g=f.getBoundingClientRect(g).left;(i=f.getLineIndex(i))<f.getLineCount()-1?h=f.getClientRects(i+1).top+1:(m=e===c.getLineCount()-1,e++);m?a.select&&(d.extend(c.getCharCount()),this._setSelection(d,!0,!0)):(f.lineIndex!==e&&(f.destroy(),f=this._getLine(e)),d.extend(f.getOffset(g,h)),a.select||d.collapse(),this._setSelection(d,!0,!0));this._columnX=g;f.destroy();return!0},_doLineUp:function(a){var c=this._model,d=this._getSelection(),i=d.getCaret(),e=c.getLineAtOffset(i),f=this._getLine(e),g=this._columnX,
h=!1,m;if(g===-1||a.wholeLine||a.select&&b.isIE)g=a.wholeLine?c.getLineStart(e-1):i,g=f.getBoundingClientRect(g).left;(i=f.getLineIndex(i))>0?m=f.getClientRects(i-1).top+1:(h=e===0,h||(e--,m=this._getLineHeight(e)-1));h?a.select&&(d.extend(0),this._setSelection(d,!0,!0)):(f.lineIndex!==e&&(f.destroy(),f=this._getLine(e)),d.extend(f.getOffset(g,m)),a.select||d.collapse(),this._setSelection(d,!0,!0));this._columnX=g;f.destroy();return!0},_doPageDown:function(a){var c=this._model,d=this._getSelection(),
i=d.getCaret(),e=c.getLineAtOffset(i),f=c.getLineCount(),g=this._getScroll(),h=this._getClientHeight(),m;if(this._lineHeight){c=this._columnX;g=this._getBoundsAtOffset(i);if(c===-1||a.select&&b.isIE)c=g.left;i=this._getLineIndex(g.top+h);m=this._getLine(i);e=this._getLinePixel(i);i=m.getOffset(c,g.top+h-e);h=m.getBoundingClientRect(i);m.destroy();d.extend(i);a.select||d.collapse();this._setSelection(d,!0,!0,h.top+e-g.top);this._columnX=c;return!0}if(e<f-1){var p=this._getLineHeight(),r=Math.min(f-
e-1,Math.floor(h/p)),r=Math.max(1,r),c=this._columnX;if(c===-1||a.select&&b.isIE)m=this._getLine(e),c=m.getBoundingClientRect(i).left,m.destroy();m=this._getLine(e+r);d.extend(m.getOffset(c,0));m.destroy();a.select||d.collapse();a=f*p;i=g.y+r*p;i+h>a&&(i=a-h);this._setSelection(d,!0,!0,i-g.y);this._columnX=c}return!0},_doPageUp:function(a){var c=this._model,d=this._getSelection(),i=d.getCaret(),e=c.getLineAtOffset(i),f=this._getScroll(),g=this._getClientHeight(),h;if(this._lineHeight){c=this._columnX;
f=this._getBoundsAtOffset(i);if(c===-1||a.select&&b.isIE)c=f.left;i=this._getLineIndex(f.bottom-g);h=this._getLine(i);e=this._getLinePixel(i);i=h.getOffset(c,f.bottom-g-e);g=h.getBoundingClientRect(i);h.destroy();d.extend(i);a.select||d.collapse();this._setSelection(d,!0,!0,g.top+e-f.top);this._columnX=c;return!0}if(e>0){var m=this._getLineHeight(),g=Math.max(1,Math.min(e,Math.floor(g/m))),c=this._columnX;if(c===-1||a.select&&b.isIE)h=this._getLine(e),c=h.getBoundingClientRect(i).left,h.destroy();
h=this._getLine(e-g);d.extend(h.getOffset(c,this._getLineHeight(e-g)-1));h.destroy();a.select||d.collapse();a=Math.max(0,f.y-g*m);this._setSelection(d,!0,!0,a-f.y);this._columnX=c}return!0},_doPaste:function(a){var c=this;return this._getClipboardText(a,function(a){a&&(b.isLinux&&c._lastMouseButton===2&&(new Date).getTime()-c._lastMouseTime<=c._clickTime&&c._setSelectionTo(c._lastMouseX,c._lastMouseY),c._doContent(a))})!==null},_doScroll:function(a){var c=a.type,b=this._model,d=b.getLineCount(),a=
this._getClientHeight(),i=this._getLineHeight();d*=i;var e=this._getScroll().y,f;switch(c){case "textStart":f=0;break;case "textEnd":f=d-a;break;case "pageDown":f=e+a;break;case "pageUp":f=e-a;break;case "centerLine":c=this._getSelection(),f=b.getLineAtOffset(c.start),b=(b.getLineAtOffset(c.end)-f+1)*i,f=f*i-a/2+b/2}f!==void 0&&(f=Math.min(Math.max(0,f),d-a),this._scrollView(0,f-e));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},_doTabMode:function(){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(){this.setOptions({wrapMode:!this.getOptions("wrapMode")});
return!0},_autoScroll:function(){var a=this._getSelection(),c=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),b=a.getCaret(),d=this._model.getLineAtOffset(b),i;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")b=this._autoScrollY/this._getLineHeight(),b=b<0?Math.floor(b):Math.ceil(b),i=d,i=Math.max(0,Math.min(this._model.getLineCount()-1,i+b));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")i=this._getLineIndex(c.y),d=this._getLine(d),c.x+=d.getBoundingClientRect(b,
!1).left,d.destroy();d=this._getLine(i);a.extend(d.getOffset(c.x,c.y-this._getLinePixel(i)));d.destroy();this._setSelection(a,!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,d=(new Date).getTime(),i=0;b<c;)if(this._lineHeight[b]||(a++,i||
(i=b),this._lineHeight[b]=this._calculateLineHeight(b)),b++,(new Date).getTime()-d>100)break;this.redrawRulers(0,c);this._queueUpdate()}a=this._getWindow();if(b!==c){var e=this;this._calculateLHTimer=a.setTimeout(function(){e._calculateLHTimer=null;e._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,
Math.ceil(c.bottom-c.top))},_calculateMetrics:function(){var c=this._clientDiv,d=c.ownerDocument,e=b.createElement(d,"div");e.style.lineHeight="normal";var g={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(g);f(g.style,e);e.style.position="fixed";e.style.left="-1000px";var h=b.createElement(d,"span");h.appendChild(d.createTextNode(" "));e.appendChild(h);var m=b.createElement(d,"span");m.style.fontStyle="italic";m.appendChild(d.createTextNode(" "));
e.appendChild(m);var w=b.createElement(d,"span");w.style.fontWeight="bold";w.appendChild(d.createTextNode(" "));e.appendChild(w);g=b.createElement(d,"span");g.style.fontWeight="bold";g.style.fontStyle="italic";g.appendChild(d.createTextNode(" "));e.appendChild(g);c.appendChild(e);var A=e.getBoundingClientRect(),h=h.getBoundingClientRect(),m=m.getBoundingClientRect(),w=w.getBoundingClientRect(),g=g.getBoundingClientRect(),h=h.bottom-h.top,m=m.bottom-m.top,w=w.bottom-w.top,j=g.bottom-g.top,p=0,g=A.bottom-
A.top<=0,A=Math.max(1,A.bottom-A.top);m>h&&(p=1);w>m&&(p=2);j>w&&(p=3);var r;if(p!==0){r={style:{}};if((p&1)!==0)r.style.fontStyle="italic";if((p&2)!==0)r.style.fontWeight="bold"}h=i(e);c.removeChild(e);m=a(this._viewDiv);e=b.createElement(d,"div");e.style.position="fixed";e.style.left="-1000px";e.style.paddingLeft=m.left+"px";e.style.paddingTop=m.top+"px";e.style.paddingRight=m.right+"px";e.style.paddingBottom=m.bottom+"px";e.style.width="100px";e.style.height="100px";w=b.createElement(d,"div");
w.style.width="100%";w.style.height="100%";e.appendChild(w);c.appendChild(e);d=e.getBoundingClientRect();m=w.getBoundingClientRect();e.style.overflow="hidden";w.style.height="200px";w=e.clientWidth;e.style.overflow="scroll";j=e.clientWidth;c.removeChild(e);m={left:m.left-d.left,top:m.top-d.top,right:d.right-m.right,bottom:d.bottom-m.bottom};return{lineHeight:A,largestFontStyle:r,lineTrim:h,viewPadding:m,scrollWidth:w-j,invalid:g}},_checkOverlayScroll:function(){if(b.isMac){var a=this,c=this._getWindow();
this._overlayScrollTimer&&c.clearTimeout(this._overlayScrollTimer);var d=function(){var b=a._isOverOverlayScroll();b.vertical||b.horizontal?a._overlayScrollTimer=c.setTimeout(d,200):(a._overlayScrollTimer=void 0,a._update())};this._overlayScrollTimer=c.setTimeout(d,200)}},_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),d=this._getDOMText(this._getLineNode(c)).text,a=a.getLine(c),b=this._imeOffset-b,a=b+d.length-a.length;b!==a&&this._doContent(d.substring(b,a));this._imeOffset=-1}},_createActions:function(){var a=k.KeyBinding,c=this._keyBindings=[];c.push({actionID:"lineUp",keyBinding:new a(38),predefined:!0});c.push({actionID:"lineDown",keyBinding:new a(40),predefined:!0});c.push({actionID:"charPrevious",keyBinding:new a(37),predefined:!0});
c.push({actionID:"charNext",keyBinding:new a(39),predefined:!0});b.isMac?(c.push({actionID:"scrollPageUp",keyBinding:new a(33),predefined:!0}),c.push({actionID:"scrollPageDown",keyBinding:new a(34),predefined:!0}),c.push({actionID:"pageUp",keyBinding:new a(33,null,null,!0),predefined:!0}),c.push({actionID:"pageDown",keyBinding:new a(34,null,null,!0),predefined:!0}),c.push({actionID:"lineStart",keyBinding:new a(37,!0),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new a(39,!0),predefined:!0}),
c.push({actionID:"wordPrevious",keyBinding:new a(37,null,null,!0),predefined:!0}),c.push({actionID:"wordNext",keyBinding:new a(39,null,null,!0),predefined:!0}),c.push({actionID:"scrollTextStart",keyBinding:new a(36),predefined:!0}),c.push({actionID:"scrollTextEnd",keyBinding:new a(35),predefined:!0}),c.push({actionID:"textStart",keyBinding:new a(38,!0),predefined:!0}),c.push({actionID:"textEnd",keyBinding:new a(40,!0),predefined:!0}),c.push({actionID:"scrollPageUp",keyBinding:new a(38,null,null,null,
!0),predefined:!0}),c.push({actionID:"scrollPageDown",keyBinding:new a(40,null,null,null,!0),predefined:!0}),c.push({actionID:"lineStart",keyBinding:new a(37,null,null,null,!0),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new a(39,null,null,null,!0),predefined:!0}),c.push({actionID:"lineStart",keyBinding:new a(38,null,null,!0),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new a(40,null,null,!0),predefined:!0})):(c.push({actionID:"pageUp",keyBinding:new a(33),predefined:!0}),c.push({actionID:"pageDown",
keyBinding:new a(34),predefined:!0}),c.push({actionID:"lineStart",keyBinding:new a(36),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new a(35),predefined:!0}),c.push({actionID:"wordPrevious",keyBinding:new a(37,!0),predefined:!0}),c.push({actionID:"wordNext",keyBinding:new a(39,!0),predefined:!0}),c.push({actionID:"textStart",keyBinding:new a(36,!0),predefined:!0}),c.push({actionID:"textEnd",keyBinding:new a(35,!0),predefined:!0}));b.isFirefox&&b.isLinux&&(c.push({actionID:"lineUp",keyBinding:new a(38,
!0),predefined:!0}),c.push({actionID:"lineDown",keyBinding:new a(40,!0),predefined:!0}));c.push({actionID:"selectLineUp",keyBinding:new a(38,null,!0),predefined:!0});c.push({actionID:"selectLineDown",keyBinding:new a(40,null,!0),predefined:!0});c.push({actionID:"selectCharPrevious",keyBinding:new a(37,null,!0),predefined:!0});c.push({actionID:"selectCharNext",keyBinding:new a(39,null,!0),predefined:!0});c.push({actionID:"selectPageUp",keyBinding:new a(33,null,!0),predefined:!0});c.push({actionID:"selectPageDown",
keyBinding:new a(34,null,!0),predefined:!0});b.isMac?(c.push({actionID:"selectLineStart",keyBinding:new a(37,!0,!0),predefined:!0}),c.push({actionID:"selectLineEnd",keyBinding:new a(39,!0,!0),predefined:!0}),c.push({actionID:"selectWordPrevious",keyBinding:new a(37,null,!0,!0),predefined:!0}),c.push({actionID:"selectWordNext",keyBinding:new a(39,null,!0,!0),predefined:!0}),c.push({actionID:"selectTextStart",keyBinding:new a(36,null,!0),predefined:!0}),c.push({actionID:"selectTextEnd",keyBinding:new a(35,
null,!0),predefined:!0}),c.push({actionID:"selectTextStart",keyBinding:new a(38,!0,!0),predefined:!0}),c.push({actionID:"selectTextEnd",keyBinding:new a(40,!0,!0),predefined:!0}),c.push({actionID:"selectLineStart",keyBinding:new a(37,null,!0,null,!0),predefined:!0}),c.push({actionID:"selectLineEnd",keyBinding:new a(39,null,!0,null,!0),predefined:!0}),c.push({actionID:"selectLineStart",keyBinding:new a(38,null,!0,!0),predefined:!0}),c.push({actionID:"selectLineEnd",keyBinding:new a(40,null,!0,!0),
predefined:!0})):(b.isLinux&&(c.push({actionID:"selectWholeLineUp",keyBinding:new a(38,!0,!0),predefined:!0}),c.push({actionID:"selectWholeLineDown",keyBinding:new a(40,!0,!0),predefined:!0})),c.push({actionID:"selectLineStart",keyBinding:new a(36,null,!0),predefined:!0}),c.push({actionID:"selectLineEnd",keyBinding:new a(35,null,!0),predefined:!0}),c.push({actionID:"selectWordPrevious",keyBinding:new a(37,!0,!0),predefined:!0}),c.push({actionID:"selectWordNext",keyBinding:new a(39,!0,!0),predefined:!0}),
c.push({actionID:"selectTextStart",keyBinding:new a(36,!0,!0),predefined:!0}),c.push({actionID:"selectTextEnd",keyBinding:new a(35,!0,!0),predefined:!0}));c.push({actionID:"undo",keyBinding:new k.KeyBinding("z",!0),predefined:!0});b.isMac?c.push({actionID:"redo",keyBinding:new k.KeyBinding("z",!0,!0),predefined:!0}):c.push({actionID:"redo",keyBinding:new k.KeyBinding("y",!0),predefined:!0});c.push({actionID:"deletePrevious",keyBinding:new a(8),predefined:!0});c.push({actionID:"deletePrevious",keyBinding:new a(8,
null,!0),predefined:!0});c.push({actionID:"deleteNext",keyBinding:new a(46),predefined:!0});c.push({actionID:"deleteWordPrevious",keyBinding:new a(8,!0),predefined:!0});c.push({actionID:"deleteWordPrevious",keyBinding:new a(8,!0,!0),predefined:!0});c.push({actionID:"deleteWordNext",keyBinding:new a(46,!0),predefined:!0});c.push({actionID:"tab",keyBinding:new a(9),predefined:!0});c.push({actionID:"shiftTab",keyBinding:new a(9,null,!0),predefined:!0});c.push({actionID:"enter",keyBinding:new a(13),predefined:!0});
c.push({actionID:"enter",keyBinding:new a(13,null,!0),predefined:!0});c.push({actionID:"selectAll",keyBinding:new a("a",!0),predefined:!0});c.push({actionID:"toggleTabMode",keyBinding:new a("m",!0),predefined:!0});b.isMac&&(c.push({actionID:"deleteNext",keyBinding:new a(46,null,!0),predefined:!0}),c.push({actionID:"deleteWordPrevious",keyBinding:new a(8,null,null,!0),predefined:!0}),c.push({actionID:"deleteWordNext",keyBinding:new a(46,null,null,!0),predefined:!0}));if(!b.isFirefox){var d=b.isMac&&
b.isChrome;c.push({actionID:null,keyBinding:new a("u",!d,!1,!1,d),predefined:!0});c.push({actionID:null,keyBinding:new a("i",!d,!1,!1,d),predefined:!0});c.push({actionID:null,keyBinding:new a("b",!d,!1,!1,d),predefined:!0})}b.isFirefox&&(c.push({actionID:"copy",keyBinding:new a(45,!0),predefined:!0}),c.push({actionID:"paste",keyBinding:new a(45,null,!0),predefined:!0}),c.push({actionID:"cut",keyBinding:new a(46,null,!0),predefined:!0}));b.isMac&&(c.push({actionID:"lineStart",keyBinding:new a("a",
!1,!1,!1,!0),predefined:!0}),c.push({actionID:"lineEnd",keyBinding:new a("e",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"lineUp",keyBinding:new a("p",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"lineDown",keyBinding:new a("n",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"charPrevious",keyBinding:new a("b",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"charNext",keyBinding:new a("f",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"deletePrevious",keyBinding:new a("h",!1,!1,!1,!0),predefined:!0}),
c.push({actionID:"deleteNext",keyBinding:new a("d",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"deleteLineEnd",keyBinding:new a("k",!1,!1,!1,!0),predefined:!0}),b.isFirefox?(c.push({actionID:"scrollPageDown",keyBinding:new a("v",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"deleteLineStart",keyBinding:new a("u",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"deleteWordPrevious",keyBinding:new a("w",!1,!1,!1,!0),predefined:!0})):(c.push({actionID:"pageDown",keyBinding:new a("v",!1,!1,!1,!0),predefined:!0}),
c.push({actionID:"centerLine",keyBinding:new a("l",!1,!1,!1,!0),predefined:!0}),c.push({actionID:"enterNoCursor",keyBinding:new a("o",!1,!1,!1,!0),predefined:!0})));var i=this;this._actions={lineUp:{defaultHandler:function(){return i._doLineUp({select:!1})}},lineDown:{defaultHandler:function(){return i._doLineDown({select:!1})}},lineStart:{defaultHandler:function(){return i._doHome({select:!1,ctrl:!1})}},lineEnd:{defaultHandler:function(){return i._doEnd({select:!1,ctrl:!1})}},charPrevious:{defaultHandler:function(){return i._doCursorPrevious({select:!1,
unit:"character"})}},charNext:{defaultHandler:function(){return i._doCursorNext({select:!1,unit:"character"})}},pageUp:{defaultHandler:function(){return i._doPageUp({select:!1})}},pageDown:{defaultHandler:function(){return i._doPageDown({select:!1})}},scrollPageUp:{defaultHandler:function(){return i._doScroll({type:"pageUp"})}},scrollPageDown:{defaultHandler:function(){return i._doScroll({type:"pageDown"})}},wordPrevious:{defaultHandler:function(){return i._doCursorPrevious({select:!1,unit:"word"})}},
wordNext:{defaultHandler:function(){return i._doCursorNext({select:!1,unit:"word"})}},textStart:{defaultHandler:function(){return i._doHome({select:!1,ctrl:!0})}},textEnd:{defaultHandler:function(){return i._doEnd({select:!1,ctrl:!0})}},scrollTextStart:{defaultHandler:function(){return i._doScroll({type:"textStart"})}},scrollTextEnd:{defaultHandler:function(){return i._doScroll({type:"textEnd"})}},centerLine:{defaultHandler:function(){return i._doScroll({type:"centerLine"})}},selectLineUp:{defaultHandler:function(){return i._doLineUp({select:!0})}},
selectLineDown:{defaultHandler:function(){return i._doLineDown({select:!0})}},selectWholeLineUp:{defaultHandler:function(){return i._doLineUp({select:!0,wholeLine:!0})}},selectWholeLineDown:{defaultHandler:function(){return i._doLineDown({select:!0,wholeLine:!0})}},selectLineStart:{defaultHandler:function(){return i._doHome({select:!0,ctrl:!1})}},selectLineEnd:{defaultHandler:function(){return i._doEnd({select:!0,ctrl:!1})}},selectCharPrevious:{defaultHandler:function(){return i._doCursorPrevious({select:!0,
unit:"character"})}},selectCharNext:{defaultHandler:function(){return i._doCursorNext({select:!0,unit:"character"})}},selectPageUp:{defaultHandler:function(){return i._doPageUp({select:!0})}},selectPageDown:{defaultHandler:function(){return i._doPageDown({select:!0})}},selectWordPrevious:{defaultHandler:function(){return i._doCursorPrevious({select:!0,unit:"word"})}},selectWordNext:{defaultHandler:function(){return i._doCursorNext({select:!0,unit:"word"})}},selectTextStart:{defaultHandler:function(){return i._doHome({select:!0,
ctrl:!0})}},selectTextEnd:{defaultHandler:function(){return i._doEnd({select:!0,ctrl:!0})}},deletePrevious:{defaultHandler:function(){return i._doBackspace({unit:"character"})}},deleteNext:{defaultHandler:function(){return i._doDelete({unit:"character"})}},deleteWordPrevious:{defaultHandler:function(){return i._doBackspace({unit:"word"})}},deleteWordNext:{defaultHandler:function(){return i._doDelete({unit:"word"})}},deleteLineStart:{defaultHandler:function(){return i._doBackspace({unit:"line"})}},
deleteLineEnd:{defaultHandler:function(){return i._doDelete({unit:"line"})}},tab:{defaultHandler:function(){return i._doTab()}},shiftTab:{defaultHandler:function(){return i._doShiftTab()}},enter:{defaultHandler:function(){return i._doEnter()}},enterNoCursor:{defaultHandler:function(){return i._doEnter({noCursor:!0})}},selectAll:{defaultHandler:function(){return i._doSelectAll()}},copy:{defaultHandler:function(){return i._doCopy()}},cut:{defaultHandler:function(){return i._doCut()}},paste:{defaultHandler:function(){return i._doPaste()}},
toggleWrapMode:{defaultHandler:function(){return i._doWrapMode()}},toggleTabMode:{defaultHandler:function(){return i._doTabMode()}}}},_createRuler:function(a,c){if(this._clientDiv){var d=a.getLocation()==="left"?this._leftDiv:this._rightDiv;d.style.display="block";var i=b.createElement(d.ownerDocument,"div");i._ruler=a;i.rulerChanged=!0;i.style.position="relative";var d=d.firstChild.rows[0],e=d.cells.length,d=d.insertCell(c===void 0||c<0||c>e?e:c);d.vAlign="top";d.style.verticalAlign="top";d.style.borderWidth=
"0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";d.appendChild(i)}},_createView:function(){if(!this._clientDiv){for(var a=this._parent;a.hasChildNodes();)a.removeChild(a.lastChild);var c=a.ownerDocument,d=b.createElement(c,"div");this._rootDiv=d;d.tabIndex=-1;d.style.position="relative";d.style.overflow="hidden";d.style.width="100%";d.style.height="100%";a.style.overflow="hidden";d.setAttribute("role","application");a.appendChild(d);a=b.createElement(c,"div");a.className="textviewLeftRuler";
this._leftDiv=a;a.tabIndex=-1;a.style.overflow="hidden";a.style.MozUserSelect="none";a.style.WebkitUserSelect="none";a.style.position="absolute";a.style.cursor="default";a.style.display="none";a.setAttribute("aria-hidden","true");var i=b.createElement(c,"table");a.appendChild(i);i.cellPadding="0px";i.cellSpacing="0px";i.border="0px";i.style.borderWidth="0px";i.style.margin="0px";i.style.padding="0px";i.style.outline="none";i.style.lineHeight="normal";i=i.insertRow(0);i.style.borderWidth="0px";i.style.margin=
"0px";i.style.padding="0px";i.style.outline="none";i.style.lineHeight="normal";d.appendChild(a);a=b.createElement(c,"div");a.className="textview";this._viewDiv=a;a.tabIndex=-1;a.style.overflow="auto";a.style.position="absolute";a.style.top="0px";a.style.bottom="0px";a.style.borderWidth="0px";a.style.margin="0px";a.style.outline="none";d.appendChild(a);var e=b.createElement(c,"div");e.className="textviewRightRuler";this._rightDiv=e;e.tabIndex=-1;e.style.display="none";e.style.overflow="hidden";e.style.MozUserSelect=
"none";e.style.WebkitUserSelect="none";e.style.position="absolute";e.style.cursor="default";e.style.right="0px";e.setAttribute("aria-hidden","true");i=b.createElement(c,"table");e.appendChild(i);i.cellPadding="0px";i.cellSpacing="0px";i.border="0px";i.style.borderWidth="0px";i.style.margin="0px";i.style.padding="0px";i.style.outline="none";i.style.lineHeight="normal";i=i.insertRow(0);i.style.borderWidth="0px";i.style.margin="0px";i.style.padding="0px";i.style.outline="none";i.style.lineHeight="normal";
d.appendChild(e);this._scrollDiv=i=b.createElement(c,"div");i.style.margin="0px";i.style.borderWidth="0px";i.style.padding="0px";a.appendChild(i);if(b.isFirefox)this._clipboardDiv=a=b.createElement(c,"div"),a.style.position="fixed",a.style.whiteSpace="pre",a.style.left="-1000px",d.appendChild(a);if(!b.isIE&&!b.isIOS)this._clipDiv=a=b.createElement(c,"div"),a.style.position="absolute",a.style.overflow="hidden",a.style.margin="0px",a.style.borderWidth="0px",a.style.padding="0px",d.appendChild(a),this._clipScrollDiv=
i=b.createElement(c,"div"),i.style.position="absolute",i.style.height="1px",i.style.top="-1000px",a.appendChild(i);this._setFullSelection(this._fullSelection,!0);a=b.createElement(c,"div");a.className="textviewContent";this._clientDiv=a;a.style.position="absolute";a.style.borderWidth="0px";a.style.margin="0px";a.style.padding="0px";a.style.outline="none";a.style.zIndex="1";a.style.WebkitUserSelect="text";a.setAttribute("spellcheck","false");if(b.isIOS||b.isAndroid)a.style.WebkitTapHighlightColor=
"transparent";(this._clipDiv||d).appendChild(a);if(b.isIOS||b.isAndroid)this._vScrollDiv=i=b.createElement(c,"div"),i.style.position="absolute",i.style.borderWidth="1px",i.style.borderColor="white",i.style.borderStyle="solid",i.style.borderRadius="4px",i.style.backgroundColor="black",i.style.opacity="0.5",i.style.margin="0px",i.style.padding="0px",i.style.outline="none",i.style.zIndex="3",i.style.width="8px",i.style.display="none",d.appendChild(i),this._hScrollDiv=i=b.createElement(c,"div"),i.style.position=
"absolute",i.style.borderWidth="1px",i.style.borderColor="white",i.style.borderStyle="solid",i.style.borderRadius="4px",i.style.backgroundColor="black",i.style.opacity="0.5",i.style.margin="0px",i.style.padding="0px",i.style.outline="none",i.style.zIndex="3",i.style.height="8px",i.style.display="none",d.appendChild(i);if(b.isFirefox&&!a.setCapture)this._overlayDiv=i=b.createElement(c,"div"),i.style.position=a.style.position,i.style.borderWidth=a.style.borderWidth,i.style.margin=a.style.margin,i.style.padding=
a.style.padding,i.style.cursor="text",i.style.zIndex="2",(this._clipDiv||d).appendChild(i);a.contentEditable="true";a.setAttribute("role","textbox");a.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);if(!c.getElementById("_textviewStyle")&&(d="",b.isWebkit&&this._metrics.scrollWidth>0&&(d+="\n.textviewContainer ::-webkit-scrollbar-corner {background: #eeeeee;}"),
b.isFirefox&&b.isMac&&this._highlightRGB&&this._highlightRGB!=="Highlight"&&(d+="\n.textviewContainer ::-moz-selection {background: "+this._highlightRGB+";}"),d))a=b.createElement(c,"style"),a.id="_textviewStyle",i=c.getElementsByTagName("head")[0]||c.documentElement,a.appendChild(c.createTextNode(d)),i.insertBefore(a,i.firstChild);this._hookEvents();c=this._rulers;for(d=0;d<c.length;d++)this._createRuler(c[d]);this._update()}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,
update:this.setModel},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},wrapMode:{value:!1,update:this._setWrapMode},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.rows[0],d=b.cells,i=0;i<d.length;i++)if(d[i].firstChild._ruler===
a)break;if(i!==d.length&&(b.cells[i]._ruler=void 0,b.deleteCell(i),d.length===0))c.style.display="none"}},_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(a,d){var i=this._model.getLineDelimiter(),
e,f,g=this._getWindow();if(g.clipboardData)return e=[],f=g.clipboardData.getData("Text"),c(f,function(a){e.push(a)},function(){e.push(i)}),f=e.join(""),d&&d(f),f;if(b.isFirefox){this._ignoreFocus=!0;var h=this._clipboardDiv;h.innerHTML="<pre contenteditable=''></pre>";h.firstChild.focus();var m=this,j=function(){var a=m._getTextFromElement(h);h.innerHTML="";e=[];c(a,function(a){e.push(a)},function(){e.push(i)});return e.join("")},p=!1;this._ignorePaste=!0;if(!b.isLinux||this._lastMouseButton!==2)try{p=
h.ownerDocument.execCommand("paste",!1,null)}catch(r){p=h.childNodes.length>1||h.firstChild&&h.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!p)return a?(g.setTimeout(function(){m.focus();(f=j())&&d&&d(f);m._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(f=j())&&d&&d(f);return f}return a&&a.clipboardData?(e=[],f=a.clipboardData.getData("text/plain"),c(f,function(a){e.push(a)},function(){e.push(i)}),(f=e.join(""))&&d&&d(f),f):""},_getDOMText:function(a,
c){for(var b=a.firstChild,d="",i=0;b;){var e;if(b.ignoreChars){e=b.lastChild;for(var f=0,g=[],h=-1;e;){for(var m=e.data,r=m.length-1;r>=0;r--){var j=m.substring(r,r+1);f<b.ignoreChars&&(j===" "||j==="\u200c"||j==="\ufeff")?f++:g.push(j==="\u00a0"?"\t":j)}if(c===e)h=g.length;e=e.previousSibling}g=g.reverse().join("");h!==-1&&(i=d.length+g.length-h);d+=g}else for(e=b.firstChild;e;){if(c===e)i=d.length;d+=e.data;e=e.nextSibling}b=b.nextSibling}return{text:d,offset:i}},_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=[],d;for(d=0;d<a.rangeCount;d++)b.push(a.getRangeAt(d));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(c);c=a.toString();a.removeAllRanges();for(d=0;d<b.length;d++)a.addRange(b[d]);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 q(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,d=this._model.getLineCount();if(this._lineHeight){var b=this._getTopIndex(),
i=-this._topIndexY+this._getScroll().y;if(a!==i)if(a<i)for(;a<i&&b>0;)a+=this._getLineHeight(--b);else for(c=this._getLineHeight(b);a-c>=i&&b<d-1;)a-=c,c=this._getLineHeight(++b)}else c=this._getLineHeight(),b=Math.floor(a/c);return Math.max(0,Math.min(d-1,b))},_getScroll:function(){var 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(),d=this._viewDiv.getBoundingClientRect();a.top<d.top+b.top&&(c=this._getLineNext(c)||c)}return c.lineIndex},_hookEvents:function(){var a=this;this._modelListener={onChanging:function(c){a._onModelChanging(c)},onChanged:function(c){a._onModelChanged(c)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);var c=this._handlers=[],d=this._clientDiv,i=this._viewDiv,
e=this._rootDiv,f=this._overlayDiv||d,h=d.ownerDocument,m=this._getWindow(),j=b.isIE?h:m;c.push({target:m,type:"resize",handler:function(c){return a._handleResize(c?c:m.event)}});c.push({target:d,type:"blur",handler:function(c){return a._handleBlur(c?c:m.event)}});c.push({target:d,type:"focus",handler:function(c){return a._handleFocus(c?c:m.event)}});c.push({target:i,type:"focus",handler:function(){d.focus()}});c.push({target:i,type:"scroll",handler:function(c){return a._handleScroll(c?c:m.event)}});
c.push({target:d,type:"textInput",handler:function(c){return a._handleTextInput(c?c:m.event)}});c.push({target:d,type:"keydown",handler:function(c){return a._handleKeyDown(c?c:m.event)}});c.push({target:d,type:"keypress",handler:function(c){return a._handleKeyPress(c?c:m.event)}});c.push({target:d,type:"keyup",handler:function(c){return a._handleKeyUp(c?c:m.event)}});c.push({target:d,type:"contextmenu",handler:function(c){return a._handleContextMenu(c?c:m.event)}});c.push({target:d,type:"copy",handler:function(c){return a._handleCopy(c?
c:m.event)}});c.push({target:d,type:"cut",handler:function(c){return a._handleCut(c?c:m.event)}});c.push({target:d,type:"paste",handler:function(c){return a._handlePaste(c?c:m.event)}});if(b.isIOS||b.isAndroid)c.push({target:h,type:"selectionchange",handler:function(c){return a._handleSelectionChange(c?c:m.event)}}),c.push({target:d,type:"touchstart",handler:function(c){return a._handleTouchStart(c?c:m.event)}}),c.push({target:d,type:"touchmove",handler:function(c){return a._handleTouchMove(c?c:m.event)}}),
c.push({target:d,type:"touchend",handler:function(c){return a._handleTouchEnd(c?c:m.event)}});else{c.push({target:d,type:"selectstart",handler:function(c){return a._handleSelectStart(c?c:m.event)}});c.push({target:d,type:"mousedown",handler:function(c){return a._handleMouseDown(c?c:m.event)}});c.push({target:d,type:"mouseover",handler:function(c){return a._handleMouseOver(c?c:m.event)}});c.push({target:d,type:"mouseout",handler:function(c){return a._handleMouseOut(c?c:m.event)}});c.push({target:j,
type:"mouseup",handler:function(c){return a._handleMouseUp(c?c:m.event)}});c.push({target:j,type:"mousemove",handler:function(c){return a._handleMouseMove(c?c:m.event)}});c.push({target:e,type:"mousedown",handler:function(c){return a._handleRootMouseDown(c?c:m.event)}});c.push({target:e,type:"mouseup",handler:function(c){return a._handleRootMouseUp(c?c:m.event)}});c.push({target:f,type:"dragstart",handler:function(c){return a._handleDragStart(c?c:m.event)}});c.push({target:f,type:"drag",handler:function(c){return a._handleDrag(c?
c:m.event)}});c.push({target:f,type:"dragend",handler:function(c){return a._handleDragEnd(c?c:m.event)}});c.push({target:f,type:"dragenter",handler:function(c){return a._handleDragEnter(c?c:m.event)}});c.push({target:f,type:"dragover",handler:function(c){return a._handleDragOver(c?c:m.event)}});c.push({target:f,type:"dragleave",handler:function(c){return a._handleDragLeave(c?c:m.event)}});c.push({target:f,type:"drop",handler:function(c){return a._handleDrop(c?c:m.event)}});c.push({target:this._clientDiv,
type:b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(c){return a._handleMouseWheel(c?c:m.event)}});if(b.isFirefox&&(!b.isWindows||b.isFirefox>=15))(i=m.MutationObserver||m.MozMutationObserver)?(this._mutationObserver=new i(function(c){a._handleDataModified(c)}),this._mutationObserver.observe(d,{subtree:!0,characterData:!0})):c.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(c){return a._handleDataModified(c?c:m.event)}});this._overlayDiv&&(c.push({target:this._overlayDiv,
type:"mousedown",handler:function(c){return a._handleMouseDown(c?c:m.event)}}),c.push({target:this._overlayDiv,type:"mouseover",handler:function(c){return a._handleMouseOver(c?c:m.event)}}),c.push({target:this._overlayDiv,type:"mouseout",handler:function(c){return a._handleMouseOut(c?c:m.event)}}),c.push({target:this._overlayDiv,type:"contextmenu",handler:function(c){return a._handleContextMenu(c?c:m.event)}}));this._isW3CEvents||c.push({target:this._clientDiv,type:"dblclick",handler:function(c){return a._handleDblclick(c?
c:m.event)}})}i=this._leftDiv;e=this._rightDiv;b.isIE&&c.push({target:i,type:"selectstart",handler:function(){return!1}});c.push({target:i,type:b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(c){return a._handleMouseWheel(c?c:m.event)}});c.push({target:i,type:"click",handler:function(c){a._handleRulerEvent(c?c:m.event)}});c.push({target:i,type:"dblclick",handler:function(c){a._handleRulerEvent(c?c:m.event)}});c.push({target:i,type:"mousemove",handler:function(c){a._handleRulerEvent(c?c:
m.event)}});c.push({target:i,type:"mouseover",handler:function(c){a._handleRulerEvent(c?c:m.event)}});c.push({target:i,type:"mouseout",handler:function(c){a._handleRulerEvent(c?c:m.event)}});b.isIE&&c.push({target:e,type:"selectstart",handler:function(){return!1}});c.push({target:e,type:b.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(c){return a._handleMouseWheel(c?c:m.event)}});c.push({target:e,type:"click",handler:function(c){a._handleRulerEvent(c?c:m.event)}});c.push({target:e,type:"dblclick",
handler:function(c){a._handleRulerEvent(c?c:m.event)}});c.push({target:e,type:"mousemove",handler:function(c){a._handleRulerEvent(c?c:m.event)}});c.push({target:e,type:"mouseover",handler:function(c){a._handleRulerEvent(c?c:m.event)}});c.push({target:e,type:"mouseout",handler:function(c){a._handleRulerEvent(c?c:m.event)}});for(i=0;i<c.length;i++)e=c[i],g(e.target,e.type,e.handler,e.capture)},_getWindow:function(){return this._parent.ownerDocument.defaultView||this._parent.ownerDocument.parentWindow},
_init:function(a){var c=a.parent;typeof c==="string"&&(c=(a.document||document).getElementById(c));if(!c)throw"no parent";a.parent=c;a.model=a.model||new h.TextModel;var d=this._defaultOptions(),i;for(i in d)d.hasOwnProperty(i)&&(this["_"+i]=a[i]!==void 0?a[i]:d[i].value);this._rulers=[];this._selection=new m(0,0,!1);this._linksVisible=!1;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=!0;this._hasFocus=this._ignoreFocus=!1;this._dragOffset=this._columnX=-1;this._isRangeRects=
(!b.isIE||b.isIE>=9)&&typeof c.ownerDocument.createRange().getBoundingClientRect==="function";this._isW3CEvents=c.addEventListener;this._autoScrollTimerID=this._autoScrollY=this._autoScrollX=null;this._AUTO_SCROLL_RATE=50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;
this._createActions();this._createView()},_isOverOverlayScroll:function(){if(!b.isMac)return{};var a=this._viewDiv.getBoundingClientRect(),c=this._lastMouseMoveX,d=this._lastMouseMoveY;return{vertical:a.top<=d&&d<a.bottom&&a.right-15<=c&&c<a.right,horizontal:a.bottom-15<=d&&d<a.bottom&&a.left<=c&&c<a.right}},_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,d=a.removedCharCount,i=a.addedLineCount,e=a.removedLineCount,f=this._getSelection();f.end>c&&(f.end>c&&f.start<c+d?f.setCaret(c+b):(f.start+=b-d,f.end+=b-d),this._setSelection(f,
!1,!1));c=this._model.getLineAtOffset(c);for(b=this._getLineNext();b;){d=b.lineIndex;if(c<=d&&d<=c+e)c===d&&!b.modelChangedEvent&&!b.lineRemoved?(b.modelChangedEvent=a,b.lineChanged=!0):(b.lineRemoved=!0,b.lineChanged=!1,b.modelChangedEvent=null);if(d>c+e)b.lineIndex=d+i-e,b._line.lineIndex=b.lineIndex;b=this._getLineNext(b)}if(!this._wrapMode&&c<=this._maxLineIndex&&this._maxLineIndex<=c+e)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){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._resetLineHeight();this._setSelection(new m(0,0,!1),!1,!1);if(this._viewDiv)this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0;var a=this._clientDiv;if(a){for(var c=a.firstChild;c;)c.lineRemoved=!0,c=c.nextSibling;if(b.isFirefox)this._ignoreFocus=!1,(c=this._hasFocus)&&a.blur(),a.contentEditable=
!1,a.contentEditable=!0,c&&a.focus(),this._ignoreFocus=!1}},_scrollView:function(a,c){this._ensureCaretVisible=!1;var b=this._viewDiv;a&&(b.scrollLeft+=a);c&&(b.scrollTop+=c)},_setClipboardText:function(a,d){var i,e=this._parent.ownerDocument,f=this._getWindow();if(f.clipboardData)return i=[],c(a,function(a){i.push(a)},function(){i.push(b.platformDelimiter)}),f.clipboardData.setData("Text",i.join(""));if(d&&d.clipboardData&&(i=[],c(a,function(a){i.push(a)},function(){i.push(b.platformDelimiter)}),
d.clipboardData.setData("text/plain",i.join(""))))return!0;var g=b.createElement(e,"pre");g.style.position="fixed";g.style.left="-1000px";c(a,function(a){g.appendChild(e.createTextNode(a))},function(){g.appendChild(b.createElement(e,"br"))});g.appendChild(e.createTextNode(" "));this._clientDiv.appendChild(g);var h=e.createRange();h.setStart(g.firstChild,0);h.setEndBefore(g.lastChild);var m=f.getSelection();m.rangeCount>0&&m.removeAllRanges();m.addRange(h);var j=this,h=function(){g&&g.parentNode===
j._clientDiv&&j._clientDiv.removeChild(g);j._updateDOMSelection()},m=!1;this._ignoreCopy=!0;try{m=e.execCommand("copy",!1,null)}catch(p){}this._ignoreCopy=!1;if(!m&&d)return f.setTimeout(h,0),!1;h();return!0},_setDOMSelection:function(a,c,d,i){for(var e,f,g,h,m=0,p=a.firstChild,r,j,o=this._model.getLine(a.lineIndex).length;p;){r=p.firstChild;j=r.length;p.ignoreChars&&(j-=p.ignoreChars);if(m+j>c||m+j>=o){e=r;f=c-m;p.ignoreChars&&j>0&&f===j&&(f+=p.ignoreChars);break}m+=j;p=p.nextSibling}for(var m=0,
p=d.firstChild,k=this._model.getLine(d.lineIndex).length;p;){r=p.firstChild;j=r.length;p.ignoreChars&&(j-=p.ignoreChars);if(j+m>i||m+j>=k){g=r;h=i-m;p.ignoreChars&&j>0&&h===j&&(h+=p.ignoreChars);break}m+=j;p=p.nextSibling}this._setDOMFullSelection(a,c,o,d,i,k);if(this._hasFocus)if(c=this._getWindow(),a=this._parent.ownerDocument,c.getSelection){if(c=c.getSelection(),!(c.anchorNode===e&&c.anchorOffset===f&&c.focusNode===g&&c.focusOffset===h||c.anchorNode===g&&c.anchorOffset===h&&c.focusNode===e&&c.focusOffset===
f))a=a.createRange(),a.setStart(e,f),a.setEnd(g,h),this._ignoreSelect=!1,c.rangeCount>0&&c.removeAllRanges(),c.addRange(a),this._ignoreSelect=!0}else if(a.selection)c=a.body,a=b.createElement(a,"div"),c.appendChild(a),c.removeChild(a),a=c.createTextRange(),a.moveToElementText(e.parentNode),a.moveStart("character",f),e=c.createTextRange(),e.moveToElementText(g.parentNode),e.moveStart("character",h),a.setEndPoint("EndToStart",e),this._ignoreSelect=!1,a.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(a,
c,b,d,i){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===d&&c===i))){var e=this._model,f=this._getViewPadding(),g=this._clientDiv.getBoundingClientRect(),h=this._viewDiv.getBoundingClientRect(),b=h.left+f.left,m=g.right,f=h.top+f.top,r=g.bottom,h=g=0;this._clipDiv?(h=this._clipDiv.getBoundingClientRect(),g=h.left-this._clipDiv.scrollLeft):(h=this._rootDiv.getBoundingClientRect(),
g=h.left);h=h.top;this._ignoreDOMSelection=!0;var a=(new q(this,a.lineIndex,a)).getBoundingClientRect(e.getLineStart(a.lineIndex)+c,!1),j=a.left,i=(new q(this,d.lineIndex,d)).getBoundingClientRect(e.getLineStart(d.lineIndex)+i,!1),c=i.left;this._ignoreDOMSelection=!1;var e=this._selDiv1,j=Math.min(m,Math.max(b,j)),o=Math.min(r,Math.max(f,a.top)),k=m,d=Math.min(r,Math.max(f,a.bottom));e.style.left=j-g+"px";e.style.top=o-h+"px";e.style.width=Math.max(0,k-j)+"px";e.style.height=Math.max(0,d-o)+"px";
if(a.top===i.top)k=Math.min(c,m),e.style.width=Math.max(0,k-j)+"px";else if(a=Math.min(r,Math.max(f,i.top)),c=Math.min(m,Math.max(b,c)),f=Math.min(r,Math.max(f,i.bottom)),r=this._selDiv3,r.style.left=b-g+"px",r.style.top=a-h+"px",r.style.width=Math.max(0,c-b)+"px",r.style.height=Math.max(0,f-a)+"px",a-d>0)f=this._selDiv2,f.style.left=b-g+"px",f.style.top=d-h+"px",f.style.width=Math.max(0,m-b)+"px",f.style.height=Math.max(0,a-d)+"px"}},_setGrab:function(a){if(a!==this._grabControl)a?(a.setCapture&&
a.setCapture(),this._grabControl=a):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null)},_setLinksVisible:function(a){if(this._linksVisible!==a){this._linksVisible=a;if(b.isIE&&a)this._hadFocus=this._hasFocus;var c=this._clientDiv;c.contentEditable=!a;this._hadFocus&&!a&&c.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=a?"-1":"1";for(a=this._getLineNext();a;){if(a.hasLink)for(c=a.firstChild;c;){var d=c.nextSibling,i=c.viewStyle;i&&i.tagName==="A"&&
a.replaceChild(a._line._createSpan(a,c.firstChild.data,i),c);c=d}a=this._getLineNext(a)}}},_setSelection:function(a,c,b,d){if(a){this._columnX=-1;b===void 0&&(b=!0);var i=this._selection;this._selection=a;c&&this._showCaret(!1,d);b&&this._updateDOMSelection();if(!i.equals(a))this.onSelection({type:"Selection",oldValue:{start:i.start,end:i.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,c,b,d){var i=this._model,e=this._getSelection(),c=this.convert({x:a,y:c},"page","document"),
a=this._getLineIndex(c.y);if(this._clickCount===1){i=this._getLine(a);a=i.getOffset(c.x,c.y-this._getLinePixel(a));i.destroy();if(d&&!b&&e.start<=a&&a<e.end)return this._dragOffset=a,!1;e.extend(a);b||e.collapse()}else(this._clickCount&1)===0?(i=this._getLine(a),a=i.getOffset(c.x,c.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(b=this._doubleClickSelection.start,d=i.getNextOffset(a,"wordend",1)):(b=i.getNextOffset(a,"word",-1),d=this._doubleClickSelection.end):
(b=i.getNextOffset(a,"word",-1),d=i.getNextOffset(b,"wordend",1)),i.destroy()):this._doubleClickSelection?(d=i.getLineAtOffset(this._doubleClickSelection.start),a>=d?(b=i.getLineStart(d),d=i.getLineEnd(a)):(b=i.getLineStart(a),d=i.getLineEnd(d))):(b=i.getLineStart(a),d=i.getLineEnd(a)),e.setCaret(b),e.extend(d);this._setSelection(e,!0,!0);return!0},_setFullSelection:function(a,c){this._fullSelection=a;if(b.isWebkit)this._fullSelection=!0;var d=this._clipDiv||this._rootDiv;if(d)if(this._fullSelection){if(!this._selDiv1&&
this._fullSelection&&!b.isIOS){var i=d.ownerDocument;this._highlightRGB=b.isWebkit?"transparent":"Highlight";var e=b.createElement(i,"div");this._selDiv1=e;e.style.position="absolute";e.style.borderWidth="0px";e.style.margin="0px";e.style.padding="0px";e.style.outline="none";e.style.background=this._highlightRGB;e.style.width="0px";e.style.height="0px";e.style.zIndex="0";d.appendChild(e);var f=b.createElement(i,"div");this._selDiv2=f;f.style.position="absolute";f.style.borderWidth="0px";f.style.margin=
"0px";f.style.padding="0px";f.style.outline="none";f.style.background=this._highlightRGB;f.style.width="0px";f.style.height="0px";f.style.zIndex="0";d.appendChild(f);this._selDiv3=i=b.createElement(i,"div");i.style.position="absolute";i.style.borderWidth="0px";i.style.margin="0px";i.style.padding="0px";i.style.outline="none";i.style.background=this._highlightRGB;i.style.width="0px";i.style.height="0px";i.style.zIndex="0";d.appendChild(i);if(b.isFirefox&&b.isMac){d=this._getWindow().getComputedStyle(i,
null).getPropertyValue("background-color");switch(d){case "rgb(119, 141, 168)":d="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":d="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":d="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":d="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":d="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":d="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":d="rgb(232, 184, 255)";break;default:d="rgb(180, 213, 255)"}this._highlightRGB=d;e.style.background=
d;f.style.background=d;i.style.background=d}c||this._updateDOMSelection()}}else{if(this._selDiv1)d.removeChild(this._selDiv1),this._selDiv1=null;if(this._selDiv2)d.removeChild(this._selDiv2),this._selDiv2=null;if(this._selDiv3)d.removeChild(this._selDiv3),this._selDiv3=null}},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":"false")},_setTabSize:function(a,c){this._tabSize=a;this._customTabSize=void 0;var d=this._clientDiv;if(b.isOpera){if(d)d.style.OTabSize=
this._tabSize+""}else if(b.isWebkit>=537.1){if(d)d.style.tabSize=this._tabSize+""}else if(b.isFirefox>=4){if(d)d.style.MozTabSize=this._tabSize+""}else if(this._tabSize!==8)this._customTabSize=this._tabSize;c||(this.redrawLines(),this._resetLineWidth())},_setThemeClass:function(a,c){this._themeClass=a;var b="textviewContainer";this._themeClass&&(b+=" "+this._themeClass);this._rootDiv.className=b;this._updateStyle(c)},_setWrapMode:function(a,c){this._wrapMode=a;var b=this._clientDiv,d=this._viewDiv;
a?(b.style.whiteSpace="pre-wrap",b.style.wordWrap="break-word",d.style.overflowX="hidden",d.style.overflowY="scroll"):(b.style.whiteSpace="pre",b.style.wordWrap="normal",d.style.overflowX="auto",d.style.overflowY="auto");c||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,c){if(this._clientDiv){var b=this._model,d=this._getSelection(),i=this._getScroll(),e=d.getCaret(),f=d.start,g=d.end,h=b.getLineAtOffset(g),m=Math.max(Math.max(f,b.getLineStart(h)),g-1),b=this._getClientWidth(),
h=this._getClientHeight(),r=b/4,j=this._getBoundsAtOffset(e===f?f:m),o=j.left,k=j.right,q=j.top,u=j.bottom;a&&!d.isEmpty()&&(j=this._getBoundsAtOffset(e===g?f:m),j.top===q?e===f?k=o+Math.min(j.right-o,b):o=k-Math.min(k-j.left,b):e===f?u=q+Math.min(j.bottom-q,h):q=u-Math.min(u-j.top,h));d=0;o<i.x&&(d=Math.min(o-i.x,-r));k>i.x+b&&(d=Math.max(k-i.x-b,r));e=0;q<i.y?e=q-i.y:u>i.y+h&&(e=u-i.y-h);c&&(c>0?e>0&&(e=Math.max(e,c)):e<0&&(e=Math.min(e,c)));return d!==0||e!==0?(this._scrollView(d,e),h!==this._getClientHeight()||
b!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0):!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._modelListener=null;for(var a=0;a<this._handlers.length;a++){var c=
this._handlers[a],b=c.target,d=c.type,c=c.handler;typeof b.removeEventListener==="function"?b.removeEventListener(d,c,!1):b.detachEvent("on"+d,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),d=c.getLineAtOffset(a.end),i=this._getLineNext();if(i){var e=this._getLinePrevious(),f;b<i.lineIndex?
(f=i,b=0):b>e.lineIndex?(f=e,b=0):(f=this._getLineNode(b),b=a.start-c.getLineStart(b));d<i.lineIndex?a=0:d>e.lineIndex?(i=e,a=0):(i=this._getLineNode(d),a=a.end-c.getLineStart(d));this._setDOMSelection(f,b,i,a)}}},_update:function(a){if(!(this._redrawCount>0)){if(this._updateTimer)this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=null,a=!1;var c=this._clientDiv;if(c){if(this._metrics.invalid)this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var d=this._model,
i=this._getScroll(),e=this._getViewPadding(),f=d.getLineCount(),g=this._getLineHeight(),h=this._getClientWidth();if(this._wrapMode)c.style.width=h+"px";var m,j,r,o,k=0,z=0;if(this._lineHeight){for(;z<f;){r=this._getLineHeight(z);if(k+r>i.y)break;k+=r;z++}m=z;j=Math.max(0,m-1);r=d=i.y-k;m>0&&(d+=this._getLineHeight(m-1))}else o=Math.max(0,i.y)/g,m=Math.floor(o),j=Math.max(0,m-1),d=Math.round((o-j)*g),r=Math.round((o-m)*g);this._topIndexY=r;o=this._parent;var u=o.clientWidth,G=o.clientHeight;o=this._getClientHeight();
if(a){j=0;this._leftDiv&&(m=this._leftDiv.getBoundingClientRect(),j=m.right-m.left);m=h;for(this._wrapMode||(m=Math.max(this._maxLineWidth,m));z<f;)r=this._getLineHeight(z,!1),k+=r,z++;f=k}else{for(var h=this._viewDiv,i=Math.min(m+Math.floor((o+r)/g),f-1),E=Math.min(i+1,f-1),g=c.firstChild;g;){r=g.lineIndex;var F=g.nextSibling;if(!(j<=r&&r<=E)||g.lineRemoved||g.lineIndex===-1)this._mouseWheelLine===g?(g.style.display="none",g.lineIndex=-1):c.removeChild(g);g=F}var g=this._getLineNext(),F=h.ownerDocument,
B=F.createDocumentFragment();for(r=j;r<=E;r++)if(!g||g.lineIndex>r)(new q(this,r)).create(B,null);else{B.firstChild&&(c.insertBefore(B,g),B=F.createDocumentFragment());if(g&&g.lineChanged)g=(new q(this,r)).create(B,g),g.lineChanged=!1;g=this._getLineNext(g)}B.firstChild&&c.insertBefore(B,g);if(b.isWebkit&&!this._wrapMode)c.style.width="0x7fffffffpx";g=this._getLineNext();r=o+d;for(F=!1;g;){j=g.lineWidth;if(j===void 0)E=g._line.getBoundingClientRect(),j=g.lineWidth=Math.ceil(E.right-E.left),this._lineHeight&&
(this._lineHeight[g.lineIndex]=Math.ceil(E.bottom-E.top));if(this._lineHeight&&!F&&(r-=this._lineHeight[g.lineIndex],r<0))i=g.lineIndex,F=!0;if(!this._wrapMode){if(j>=this._maxLineWidth)this._maxLineWidth=j,this._maxLineIndex=g.lineIndex;if(this._checkMaxLineIndex===g.lineIndex)this._checkMaxLineIndex=-1}if(g.lineIndex===m)this._topChild=g;if(g.lineIndex===i)this._bottomChild=g;g=this._getLineNext(g)}if(this._checkMaxLineIndex!==-1&&(r=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=r&&r<f)){g=
new q(this,r);E=g.getBoundingClientRect();j=E.right-E.left;if(j>=this._maxLineWidth)this._maxLineWidth=j,this._maxLineIndex=r;g.destroy()}for(;z<f;)r=this._getLineHeight(z,z<=i),k+=r,z++;f=k;this._updateRuler(this._leftDiv,m,i);this._updateRuler(this._rightDiv,m,i);j=0;this._leftDiv&&(m=this._leftDiv.getBoundingClientRect(),j=m.right-m.left);i=0;this._rightDiv&&(i=this._rightDiv.getBoundingClientRect(),i=i.right-i.left);h.style.left=j+"px";h.style.right=i+"px";i=this._scrollDiv;i.style.height=f+"px";
k=h=this._getClientWidth();this._wrapMode||(k=Math.max(this._maxLineWidth,k));m=k;if((!b.isIE||b.isIE>=9)&&this._maxLineWidth>h)k+=e.right+e.left;i.style.width=k+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=k+"px";i=this._getScroll();k=o+e.top+e.bottom;this._updateRulerSize(this._leftDiv,k);this._updateRulerSize(this._rightDiv,k)}if(this._vScrollDiv)k=o-8,z=Math.max(15,Math.ceil(Math.min(1,k/(f+e.top+e.bottom))*k)),this._vScrollDiv.style.left=j+h-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,
i.y*k/f))+"px",this._vScrollDiv.style.height=z+"px";if(!this._wrapMode&&this._hScrollDiv)k=h-8,z=Math.max(15,Math.ceil(Math.min(1,k/(this._maxLineWidth+e.left+e.right))*k)),this._hScrollDiv.style.left=j+Math.floor(Math.max(0,Math.floor(i.x*k/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=o-9+"px",this._hScrollDiv.style.width=z+"px";E=i.x;r=this._clipDiv;k=this._overlayDiv;if(r){r.scrollLeft=E;z=j+e.left;g=e.top;a=h;j=o;E=0;F=-d;if(i.x===0)z-=e.left,a+=e.left,E=e.left;i.x+h===m&&(a+=e.right);
i.y===0&&(g-=e.top,j+=e.top,F+=e.top);i.y+o===f&&(j+=e.bottom);r.style.left=z+"px";r.style.top=g+"px";e=this._isOverOverlayScroll();r.style.right=u-a-z+(this._overlayScrollTimer&&e.vertical?15:0)+"px";r.style.bottom=G-j-g+(this._overlayScrollTimer&&e.horizontal?15:0)+"px";c.style.left=E+"px";c.style.top=F+"px";c.style.width=m+"px";c.style.height=o+d+"px";if(k)k.style.left=c.style.left,k.style.top=c.style.top,k.style.width=c.style.width,k.style.height=c.style.height}else{z=E;g=d;u=E+h;G=d+o;z===0&&
(z-=e.left);g===0&&(g-=e.top);u===m&&(u+=e.right);i.y+o===f&&(G+=e.bottom);c.style.clip="rect("+g+"px,"+u+"px,"+G+"px,"+z+"px)";c.style.left=-E+j+e.left+"px";c.style.width=(b.isWebkit?m:h+E)+"px";if(!a)c.style.top=-d+e.top+"px",c.style.height=o+d+"px";if(k&&(k.style.clip=c.style.clip,k.style.left=c.style.left,k.style.width=c.style.width,!a))k.style.top=c.style.top,k.style.height=c.style.height}this._updateDOMSelection();c=this._ensureCaretVisible;this._ensureCaretVisible=!1;o!==this._getClientHeight()&&
(this._update(),c&&this._showCaret())}}},_updateRulerSize:function(a,c){if(a){for(var b=this._topIndexY,d=this._getLineHeight(),i=a.firstChild.rows[0].cells,e=0;e<i.length;e++){var f=i[e].firstChild,g=d;f._ruler.getOverview()==="page"&&(g+=b);f.style.top=-g+"px";f.style.height=c+g+"px"}a.style.height=c+"px"}},_updateRuler:function(a,c,d){if(a)for(var a=a.firstChild.rows[0].cells,i=this._parent.ownerDocument,e=this._getLineHeight(),g=this._getViewPadding(),h=0;h<a.length;h++){var m=a[h].firstChild,
j=m._ruler;m.rulerChanged&&f(j.getRulerStyle(),m);var o,r=m.firstChild;r?(o=r,r=r.nextSibling):(o=b.createElement(i,"div"),o.style.visibility="hidden",m.appendChild(o));var k,q;if(m.rulerChanged&&o){k=-1;if(q=j.getWidestAnnotation())if(f(q.style,o),q.html)o.innerHTML=q.html;o.lineIndex=k;o.style.height=e+g.top+"px"}var z,u;if(j.getOverview()==="page"){for(j=j.getAnnotations(c,d+1);r;)k=r.lineIndex,q=r.nextSibling,(!(c<=k&&k<=d)||r.lineChanged)&&m.removeChild(r),r=q;r=m.firstChild.nextSibling;u=i.createDocumentFragment();
for(k=c;k<=d;k++)if(!r||r.lineIndex>k){z=b.createElement(i,"div");if(q=j[k]){f(q.style,z);if(q.html)z.innerHTML=q.html;z.annotation=q}z.lineIndex=k;z.style.height=this._getLineHeight(k)+"px";u.appendChild(z)}else if(u.firstChild&&(m.insertBefore(u,r),u=i.createDocumentFragment()),r)r=r.nextSibling;u.firstChild&&m.insertBefore(u,r)}else{q=this._getClientHeight();k=this._model.getLineCount();r=q+g.top+g.bottom-2*this._metrics.scrollWidth;o=e*k<r?e:r/k;if(m.rulerChanged){for(q=m.childNodes.length;q>
1;)m.removeChild(m.lastChild),q--;j=j.getAnnotations(0,k);u=i.createDocumentFragment();for(var G in j)if(k=G>>>0,!(k<0)){z=b.createElement(i,"div");q=j[G];f(q.style,z);z.style.position="absolute";z.style.top=this._metrics.scrollWidth+e+Math.floor(k*o)+"px";if(q.html)z.innerHTML=q.html;z.annotation=q;z.lineIndex=k;u.appendChild(z)}m.appendChild(u)}else if(m._oldTrackHeight!==r)for(z=m.firstChild?m.firstChild.nextSibling:null;z;)z.style.top=this._metrics.scrollWidth+e+Math.floor(z.lineIndex*o)+"px",
z=z.nextSibling;m._oldTrackHeight=r}m.rulerChanged=!1}},_updateStyle:function(a){if(!a&&b.isIE)this._rootDiv.style.lineHeight="normal";var c=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=b.isIE?c.lineHeight-(c.lineTrim.top+c.lineTrim.bottom)+"px":"normal";a||(this.redraw(),this._resetLineWidth())}};j.EventTarget.addMixin(u.prototype);return{TextView:u}});
define("orion/editor/tooltip",["i18n!orion/editor/nls/messages","orion/editor/textView","orion/editor/textModel","orion/editor/projectionTextModel","orion/editor/util"],function(h,k,j,b,g){function f(b){this._view=b;this._create(b.getOptions("parent").ownerDocument);b.addEventListener("Destroy",this,this.destroy)}f.getTooltip=function(b){if(!b._tooltip)b._tooltip=new f(b);return b._tooltip};f.prototype={_create:function(b){if(!this._tooltipDiv){var d=this._tooltipDiv=g.createElement(b,"div");d.className=
"textviewTooltip";d.setAttribute("aria-live","assertive");d.setAttribute("aria-atomic","true");var c=this._tooltipContents=g.createElement(b,"div");d.appendChild(c);b.body.appendChild(d);this.hide()}},_getWindow:function(){var b=this._tooltipDiv.ownerDocument;return b.defaultView||b.parentWindow},destroy:function(){if(this._tooltipDiv){this.hide();var b=this._tooltipDiv.parentNode;b&&b.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 b=this._getWindow();if(this._showTimeout)b.clearTimeout(this._showTimeout),this._showTimeout=null;if(this._hideTimeout)b.clearTimeout(this._hideTimeout),this._hideTimeout=null;if(this._fadeTimeout)b.clearInterval(this._fadeTimeout),this._fadeTimeout=null},isVisible:function(){return this._tooltipDiv&&this._tooltipDiv.style.visibility==="visible"},setTarget:function(b,
d){if(this.target!==b&&(this._target=b,this.hide(),b)){var c=this;if(d===0)c.show(!0);else{var a=this._getWindow();c._showTimeout=a.setTimeout(function(){c.show(!0)},d?d:500)}}},show:function(e){if(this._target){var d=this._target.getTooltipInfo();if(d){var c=this._tooltipDiv,a=this._tooltipContents;c.style.left=c.style.right=c.style.width=c.style.height=a.style.width=a.style.height="auto";var i=d.contents;i instanceof Array&&(i=this._getAnnotationContents(i));if(typeof i==="string")a.innerHTML=i;
else if(this._isNode(i))a.appendChild(i);else if(i instanceof b.ProjectionTextModel){var f=this._view,g=f.getOptions();g.wrapMode=!1;g.parent=a;var h=g.themeClass;h?((h=h.replace("tooltip",""))&&(h=" "+h),h="tooltip"+h):h="tooltip";g.themeClass=h;g=this._contentsView=new k.TextView(g);g._clientDiv.contentEditable=!1;g.addEventListener("LineStyle",function(a){f.onLineStyle(a)});g.setModel(i);i=g.computeSize();a.style.width=i.width+20+"px";a.style.height=i.height+"px";g.resize()}else return;a=c.ownerDocument.documentElement;
d.anchor==="right"?(i=a.clientWidth-d.x,c.style.right=i+"px"):(i=parseInt(this._getNodeStyle(c,"padding-left","0"),10),i+=parseInt(this._getNodeStyle(c,"border-left-width","0"),10),i=d.x-i,c.style.left=i+"px");c.style.maxWidth=a.clientWidth-i-10+"px";i=parseInt(this._getNodeStyle(c,"padding-top","0"),10);i+=parseInt(this._getNodeStyle(c,"border-top-width","0"),10);i=d.y-i;c.style.top=i+"px";c.style.maxHeight=a.clientHeight-i-10+"px";c.style.opacity="1";c.style.visibility="visible";if(e){var j=this,
l=this._getWindow();j._hideTimeout=l.setTimeout(function(){var a=parseFloat(j._getNodeStyle(c,"opacity","1"));j._fadeTimeout=l.setInterval(function(){c.style.visibility==="visible"&&a>0?(a-=0.1,c.style.opacity=a):j.hide()},50)},5E3)}}}},_getAnnotationContents:function(e){function d(c){var b=c.title;if(b==="")return null;var d="<div>";c.html&&(d+=c.html+"&nbsp;");if(!b)b=c.end,c=a.getLineStart(a.getLineAtOffset(c.start)),b=a.getLineEnd(a.getLineAtOffset(b),!0),b=a.getText(c,b);b=b.replace(/</g,"&lt;").replace(/>/g,
"&gt;");d+="<span style='vertical-align:middle;'>"+b+"</span><div>";return d}if(e.length===0)return null;var c=this._view.getModel(),a=c.getBaseModel?c.getBaseModel():c;if(e.length===1)if(c=e[0],c.title!==void 0)return d(c);else{var e=new b.ProjectionTextModel(a),i=a.getLineStart(a.getLineAtOffset(c.start)),f=a.getCharCount();c.end!==f&&e.addProjection({start:c.end,end:f});i>0&&e.addProjection({start:0,end:i});return e}else{i="<div><em>"+h.multipleAnnotations+"</em></div>";for(f=0;f<e.length;f++)c=
e[f],(c=d(c))&&(i+=c);return i}},_getNodeStyle:function(b,d,c){var a;if(b&&(a=b.style[d],!a))if(b.currentStyle){for(a=0;(a=d.indexOf("-",a))!==-1;)d=d.substring(0,a)+d.substring(a+1,a+2).toUpperCase()+d.substring(a+2);a=b.currentStyle[d]}else a=(b=b.ownerDocument.defaultView.getComputedStyle(b,null))?b.getPropertyValue(d):null;return a||c},_isNode:function(b){return typeof Node==="object"?b instanceof Node:b&&typeof b==="object"&&typeof b.nodeType==="number"&&typeof b.nodeName==="string"}};return{Tooltip:f}});
define("orion/editor/editor","i18n!orion/editor/nls/messages,orion/editor/keyBinding,orion/editor/eventTarget,orion/editor/tooltip,orion/editor/annotations,orion/editor/util".split(","),function(h,k,j,b,g,f){function e(a){this._textViewFactory=a.textViewFactory;this._undoStackFactory=a.undoStackFactory;this._textDNDFactory=a.textDNDFactory;this._annotationFactory=a.annotationFactory;this._foldingRulerFactory=a.foldingRulerFactory;this._lineNumberRulerFactory=a.lineNumberRulerFactory;this._contentAssistFactory=
a.contentAssistFactory;this._keyBindingFactory=a.keyBindingFactory;this._statusReporter=a.statusReporter;this._domNode=a.domNode;this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=this._annotationStyler=null;this._dirty=!1;this._title=this._contentAssist=null;this._keyModes=[]}function d(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)}}var c;e.prototype={destroy:function(){this.uninstallTextView();this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=this._statusReporter=this._domNode=null},getAnnotationModel:function(){return this._annotationModel},getAnnotationRuler:function(){return this._annotationRuler},
getAnnotationStyler:function(){return this._annotationStyler},getFoldingRuler:function(){return this._foldingRuler},getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){var a=this._textView.getModel();a.getBaseModel&&(a=a.getBaseModel());return a},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getTitle:function(){return this._title},getKeyModes:function(){return this._keyModes},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(),
b=this._annotationModel;if(b&&c.getBaseModel)for(a=b.getAnnotations(a,a+1);a.hasNext();)c=a.next(),c.type===g.AnnotationType.ANNOTATION_FOLDING&&c.expand&&(c.expand(),b.modifyAnnotation(c))},setCaretOffset:function(a){var c=this._textView,b=c.getModel();b.getBaseModel&&(this._expandOffset(a),a=b.mapOffset(a,!0));c.setCaretOffset(a)},setText:function(a,c,b){var d=this._textView,e=d.getModel();e.getBaseModel&&(c!==void 0&&(this._expandOffset(c),c=e.mapOffset(c,!0)),b!==void 0&&(this._expandOffset(b),
b=e.mapOffset(b,!0)));d.setText(a,c,b)},setFoldingEnabled:function(a){this.setFoldingRulerVisible(a)},setSelection:function(a,c,b){var d=this._textView,e=d.getModel();e.getBaseModel&&(this._expandOffset(a),this._expandOffset(c),a=e.mapOffset(a,!0),c=e.mapOffset(c,!0));d.setSelection(a,c,b)},moveSelection:function(a,b,d,e){var f=this._textView;this.setSelection(a,b||a,!1);var b=f.getTopPixel(),g=f.getBottomPixel(),a=this.getModel().getLineAtOffset(a),a=f.getLinePixel(a);a<b||a>g?(g=Math.max(0,a-Math.floor((a<
b?3:1)*(g-b)/4)),(new c({node:f,duration:300,curve:[b,g],onAnimate:function(a){f.setTopPixel(Math.floor(a))},onEnd:function(){f.showSelection();(e===void 0||e)&&f.focus();d&&d()}})).play()):(f.showSelection(),(e===void 0||e)&&f.focus(),d&&d())},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 e=this._annotationStyler;
if(!e)return null;var f=b.getOffsetAtLocation(a,c);if(f===-1)return null;f=this.mapOffset(f);e=e.getAnnotationsByType(d,f,f+1);d=[];for(f=0;f<e.length;f++)e[f].rangeStyle&&d.push(e[f]);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 b=this._annotationModel;if(b){var d=this._textView.getModel(),e=c?d.getLineAtOffset(c.start):-1,f=d.getLineAtOffset(a.start),h=a.start===a.end,j=!c||c.start===
c.end,n=d.getLineStart(f),y=d.getLineEnd(f);d.getBaseModel&&(n=d.mapOffset(n),y=d.mapOffset(y));d=this._currentLineAnnotation;if(!(e===f&&j&&h&&d&&d.start===n&&d.end===y)){var e=d?[d]:null,k;h&&(d=g.AnnotationType.createAnnotation(g.AnnotationType.ANNOTATION_CURRENT_LINE,n,y),k=[d]);this._currentLineAnnotation=d;b.replaceAnnotations(e,k)}}},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){var a=this._contentAssistFactory.createContentAssistMode(this);this._keyModes.push(a);this._contentAssist=a.getContentAssist()}var c=this,d=this._textView,e=this;this._listener={onModelChanged:function(){e.checkDirty()},onMouseOver:function(a){e._listener.onMouseMove(a)},onMouseMove:function(a){var c=b.Tooltip.getTooltip(d);c&&c.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return e._getTooltipInfo(this.x,this.y)}})},
onMouseOut:function(){var a=b.Tooltip.getTooltip(d);a&&a.setTarget(null)},onSelection:function(a){e._updateCursorStatus();e._highlightCurrentLine(a.newValue,a.oldValue)}};d.addEventListener("ModelChanged",this._listener.onModelChanged);d.addEventListener("Selection",this._listener.onSelection);d.addEventListener("MouseOver",this._listener.onMouseOver);d.addEventListener("MouseOut",this._listener.onMouseOut);d.addEventListener("MouseMove",this._listener.onMouseMove);this._keyBindingFactory&&this._keyBindingFactory(this,
this._keyModes,this._undoStack,this._contentAssist);d.setKeyBinding(new k.KeyBinding(27),"cancelMode");d.setAction("cancelMode",function(){for(var a=!1,c=0;c<this._keyModes.length;c++)this._keyModes[c].isActive()&&(a=this._keyModes[c].cancel()||a);return a}.bind(this),{name:h.cancelMode});d.setAction("lineUp",function(){for(var a=0;a<this._keyModes.length;a++)if(this._keyModes[a].isActive())return this._keyModes[a].lineUp();return!1}.bind(this));d.setAction("lineDown",function(){for(var a=0;a<this._keyModes.length;a++)if(this._keyModes[a].isActive())return this._keyModes[a].lineDown();
return!1}.bind(this));d.setAction("enter",function(){for(var a=0;a<this._keyModes.length;a++)if(this._keyModes[a].isActive())return this._keyModes[a].enter();return!1}.bind(this));a=function(a){if(a!==void 0&&a!==-1){for(var b=this.getView().getModel(),d=this.getAnnotationModel(),e=c.mapOffset(b.getLineStart(a)),a=c.mapOffset(b.getLineEnd(a)),b=d.getAnnotations(e,a),f=null;b.hasNext();){var h=b.next();if(h.type===g.AnnotationType.ANNOTATION_BOOKMARK){f=h;break}}f?d.removeAnnotation(f):(f=g.AnnotationType.createAnnotation(g.AnnotationType.ANNOTATION_BOOKMARK,
e,a),f.title=void 0,d.addAnnotation(f))}};if(this._annotationFactory){var f=d.getModel();f.getBaseModel&&(f=f.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(f))if(f=this._annotationStyler=this._annotationFactory.createAnnotationStyler(d,this._annotationModel))f.addAnnotationType(g.AnnotationType.ANNOTATION_CURRENT_SEARCH),f.addAnnotationType(g.AnnotationType.ANNOTATION_MATCHING_SEARCH),f.addAnnotationType(g.AnnotationType.ANNOTATION_ERROR),f.addAnnotationType(g.AnnotationType.ANNOTATION_WARNING),
f.addAnnotationType(g.AnnotationType.ANNOTATION_MATCHING_BRACKET),f.addAnnotationType(g.AnnotationType.ANNOTATION_CURRENT_BRACKET),f.addAnnotationType(g.AnnotationType.ANNOTATION_CURRENT_LINE),f.addAnnotationType(g.AnnotationType.ANNOTATION_READ_OCCURRENCE),f.addAnnotationType(g.AnnotationType.ANNOTATION_WRITE_OCCURRENCE),f.addAnnotationType("orion.annotation.highlightError");d.annotationModel=this._annotationModel;var f=this._annotationFactory.createAnnotationRulers(this._annotationModel),j=this._annotationRuler=
f.annotationRuler;if(j)j.onClick=function(a){if(a!==void 0&&a!==-1)for(var b=this.getView().getModel(),d=this.getAnnotationModel(),e=c.mapOffset(b.getLineStart(a)),a=c.mapOffset(b.getLineEnd(a)),a=d.getAnnotations(e,a);a.hasNext();)if(d=a.next(),this.isAnnotationTypeVisible(d.type)){a=c.getModel();c.onGotoLine(a.getLineAtOffset(e),d.start-e,d.end-e);break}},j.onDblClick=a,j.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),j.addAnnotationType(g.AnnotationType.ANNOTATION_ERROR),
j.addAnnotationType(g.AnnotationType.ANNOTATION_WARNING),j.addAnnotationType(g.AnnotationType.ANNOTATION_TASK),j.addAnnotationType(g.AnnotationType.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(!0);if(j=this._overviewRuler=f.overviewRuler)j.onClick=function(a){a!==void 0&&(a=d.getModel().getLineStart(a),c.moveSelection(c.mapOffset(a)))},j.addAnnotationType(g.AnnotationType.ANNOTATION_CURRENT_SEARCH),j.addAnnotationType(g.AnnotationType.ANNOTATION_MATCHING_SEARCH),j.addAnnotationType(g.AnnotationType.ANNOTATION_ERROR),
j.addAnnotationType(g.AnnotationType.ANNOTATION_WARNING),j.addAnnotationType(g.AnnotationType.ANNOTATION_TASK),j.addAnnotationType(g.AnnotationType.ANNOTATION_BOOKMARK),j.addAnnotationType(g.AnnotationType.ANNOTATION_MATCHING_BRACKET),j.addAnnotationType(g.AnnotationType.ANNOTATION_CURRENT_BRACKET),j.addAnnotationType(g.AnnotationType.ANNOTATION_CURRENT_LINE),j.addAnnotationType(g.AnnotationType.ANNOTATION_READ_OCCURRENCE),j.addAnnotationType(g.AnnotationType.ANNOTATION_WRITE_OCCURRENCE);this.setOverviewRulerVisible(!0)}if(this._lineNumberRulerFactory)this._lineNumberRuler=
this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.onDblClick=a,this.setLineNumberRulerVisible(!0);if(this._foldingRulerFactory)this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(g.AnnotationType.ANNOTATION_FOLDING),this.setFoldingRulerVisible(!1);this.dispatchEvent({type:"TextViewInstalled",textView:d})},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._keyModes=[],this.dispatchEvent({type:"TextViewUninstalled",textView:a})},_updateCursorStatus:function(){var a=this.getModel(),c=this.getCaretOffset(),b=a.getLineAtOffset(c),a=a.getLineStart(b);c-=a;for(a=0;a<this._keyModes.length;a++){var d=this._keyModes[a];
if(d.isActive()&&d.isStatusActive&&d.isStatusActive())return}this.reportStatus(f.formatMessage(h.lineColumn,b+1,c+1))},showProblems:function(a){var c=this._annotationModel;if(c){for(var b=[],d=[],e=c.getTextModel(),f=c.getAnnotations(0,e.getCharCount()),h;f.hasNext();)h=f.next(),(h.type===g.AnnotationType.ANNOTATION_ERROR||h.type===g.AnnotationType.ANNOTATION_WARNING)&&b.push(h);if(a)for(f=0;f<a.length;f++)if(h=a[f]){var j=h.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),n=e.getLineStart(h.line-
1);h=g.AnnotationType.createAnnotation(h.severity==="error"?g.AnnotationType.ANNOTATION_ERROR:g.AnnotationType.ANNOTATION_WARNING,n+h.start-1,n+h.end,j);d.push(h)}c.replaceAnnotations(b,d)}},showOccurrences:function(a){var c=this._annotationModel;if(c){for(var b=[],d=[],e=c.getTextModel(),f=c.getAnnotations(0,e.getCharCount()),h;f.hasNext();)h=f.next(),(h.type===g.AnnotationType.ANNOTATION_READ_OCCURRENCE||h.type===g.AnnotationType.ANNOTATION_WRITE_OCCURRENCE)&&b.push(h);if(a)for(f=0;f<a.length;f++)if(h=
a[f]){var j=e.getLineStart(h.line-1);h=g.AnnotationType.createAnnotation(h.readAccess===!0?g.AnnotationType.ANNOTATION_READ_OCCURRENCE:g.AnnotationType.ANNOTATION_WRITE_OCCURRENCE,j+h.start-1,j+h.end,h.description);d.push(h)}c.replaceAnnotations(b,d)}},showSelection:function(a,c,b,d,e){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 e!=="number"&&(e=0),this.moveSelection(a,a+e))},
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){if(this._textView){var d=this.getModel(),e=d.getLineStart(a),f=0;b===void 0&&(b=0);typeof c==="string"?(a=d.getLine(a).indexOf(c),a!==-1&&(f=a,b=f+c.length)):(f=c,c=d.getLineEnd(a)-e,f=Math.min(f,c),b=Math.min(b,c));this.moveSelection(e+f,e+b)}},onDirtyChanged:function(a){return this.dispatchEvent(a)}};j.EventTarget.addMixin(e.prototype);c=function(){function a(a){this.options=a}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(){},d=this.options.onEnd||function(){},e=this.options.curve[0],f=this.options.curve[1]-e,g,h,j=-1;h=setInterval(function(){j=j===-1?(new Date).getTime():j;var k=((new Date).getTime()-j)/a;k<1?(k=c(k),g=e+k*f,b(g)):(clearInterval(h),d())},typeof this.options.rate==="number"?this.options.rate:20)};a.prototype.defaultEasing=function(a){return Math.sin(a*(Math.PI/2))};return a}();if(!Function.prototype.bind)Function.prototype.bind=
d;return{Editor:e,util:{bind:d}}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/editor/util"],function(h,k,j,b){function g(a,c,b,d){this._location=c||"left";this._overview=b||"page";this._rulerStyle=d;this._view=null;var e=this;this._listener={onTextModelChanged:function(a){e._onTextModelChanged(a)},onAnnotationModelChanged:function(a){e._onAnnotationModelChanged(a)}};this.setAnnotationModel(a)}function f(a,c,b,d,e){g.call(this,a,c,"page",b);this._oddStyle=
d||{style:{backgroundColor:"white"}};this._evenStyle=e||{style:{backgroundColor:"white"}};this._numOfDigits=0}function e(a,c,b){g.call(this,a,c,"page",b)}function d(a,c,b){g.call(this,a,c,"document",b)}function c(a,c,b){e.call(this,a,c,b)}g.prototype={getAnnotations:function(a,c){var b=this._annotationModel;if(!b)return[];var d=this._view.getModel(),e=d.getLineStart(a),f=d.getLineEnd(c-1),g=d;d.getBaseModel&&(g=d.getBaseModel(),e=d.mapOffset(e),f=d.mapOffset(f));for(var h=[],b=this.getAnnotationsByType(b,
e,f),e=0;e<b.length;e++)for(var f=b[e],j=g.getLineAtOffset(f.start),k=g.getLineAtOffset(Math.max(f.start,f.end-1)),t=j;t<=k;t++){var v=t;if(d!==g){v=g.getLineStart(t);v=d.mapOffset(v,!0);if(v===-1)continue;v=d.getLineAtOffset(v)}if(a<=v&&v<c){var w=this._mergeAnnotation(h[v],f,t-j,k-j+1);w&&(h[v]=w)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var A in h)h[A]._multiple&&(h[A].html+=this._multiAnnotationOverlay.html);return h},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(){},onDblClick:function(){},onMouseMove:function(a,c){var b=j.Tooltip.getTooltip(this._view);if(b&&!(b.isVisible()&&this._tooltipLineIndex===a)){this._tooltipLineIndex=
a;var d=this;b.setTarget({y:c.clientY,getTooltipInfo:function(){return d._getTooltipInfo(d._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,c){this.onMouseMove(a,c)},onMouseOut:function(){var a=j.Tooltip.getTooltip(this._view);a&&a.setTarget(null)},_getTooltipInfo:function(a,c){if(a!==void 0){var b=this._view,d=b.getModel(),e=this._annotationModel,f=[];if(e){var f=d.getLineStart(a),g=d.getLineEnd(a);d.getBaseModel&&(f=d.mapOffset(f),g=d.mapOffset(g));f=this.getAnnotationsByType(e,f,g)}e=this._getTooltipContents(a,
f);if(!e)return null;e={contents:e,anchor:this.getLocation()};f=b.getClientArea();f.y=this.getOverview()==="document"?b.convert({y:c},"view","document").y:b.getLocationAtOffset(d.getLineStart(a)).y;b.convert(f,"document","page");e.x=f.x;e.y=f.y;e.anchor==="right"&&(e.x+=f.width);return e}},_getTooltipContents:function(a,c){return c},_onAnnotationModelChanged:function(a){function c(a){for(var i=0;i<a.length;i++)if(e.isAnnotationTypeVisible(a[i].type)){var f=a[i].start,g=a[i].end;d.getBaseModel&&(f=
d.mapOffset(f,!0),g=d.mapOffset(g,!0));f!==-1&&g!==-1&&b.redrawLines(d.getLineAtOffset(f),d.getLineAtOffset(Math.max(f,g-1))+1,e)}}var b=this._view;if(b){var d=b.getModel(),e=this,f=d.getLineCount();a.textModelChangedEvent?(a=a.textModelChangedEvent.start,d.getBaseModel&&(a=d.mapOffset(a,!0)),a=d.getLineAtOffset(a),b.redrawLines(a,f,e)):(c(a.added),c(a.removed),c(a.changed))}},_mergeAnnotation:function(a,c,b){a||(a={});if(b===0)if(a.html&&c.html){if(c.html!==a.html&&!a._multiple&&this._multiAnnotation)a.html=
this._multiAnnotation.html;a._multiple=!0}else a.html=c.html;a.style=this._mergeStyle(a.style,c.style);return a},_mergeStyle:function(a,c){if(c){a||(a={});a.styleClass&&c.styleClass&&a.styleClass!==c.styleClass?a.styleClass+=" "+c.styleClass:a.styleClass=c.styleClass;var b;if(c.style){if(!a.style)a.style={};for(b in c.style)a.style[b]||(a.style[b]=c.style[b])}if(c.attributes){if(!a.attributes)a.attributes={};for(b in c.attributes)a.attributes[b]||(a.attributes[b]=c.attributes[b])}}return a}};k.AnnotationTypeList.addMixin(g.prototype);
f.prototype=new g;f.prototype.getAnnotations=function(a,c){for(var b=g.prototype.getAnnotations.call(this,a,c),d=this._view.getModel(),e=a;e<c;e++){var f=e&1?this._oddStyle:this._evenStyle,h=e;d.getBaseModel&&(h=d.getLineStart(h),h=d.getBaseModel().getLineAtOffset(d.mapOffset(h)));b[e]||(b[e]={});b[e].html=h+1+"";if(!b[e].style)b[e].style=f}return b};f.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();return this.getAnnotations(a-1,a)[a-1]};f.prototype._onTextModelChanged=
function(a){var a=a.start,c=this._view.getModel(),b=((c.getBaseModel?c.getBaseModel().getLineCount():c.getLineCount())+"").length;if(this._numOfDigits!==b)this._numOfDigits=b,this._view.redrawLines(c.getLineAtOffset(a),c.getLineCount(),this)};e.prototype=new g;d.prototype=new g;d.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};d.prototype.onClick=function(a){a!==void 0&&this._view.setTopIndex(a)};d.prototype._getTooltipContents=
function(a,c){if(c.length===0){var d=this._view.getModel(),e=a;d.getBaseModel&&(e=d.getLineStart(e),e=d.getBaseModel().getLineAtOffset(d.mapOffset(e)));return b.formatMessage(h.line,e+1)}return g.prototype._getTooltipContents.call(this,a,c)};d.prototype._mergeAnnotation=function(a,c,b,d){if(b===0){if(!a)a={html:"&nbsp;",style:{style:{height:3*d+"px"}}},a.style=this._mergeStyle(a.style,c.overviewStyle);return a}};c.prototype=new e;c.prototype.onClick=function(a){if(a!==void 0){var c=this._annotationModel;
if(c){var b=this._view.getModel(),d=b.getLineStart(a),a=b.getLineEnd(a,!0);b.getBaseModel&&(d=b.mapOffset(d),a=b.mapOffset(a),b=b.getBaseModel());for(var e,c=c.getAnnotations(d,a);!e&&c.hasNext();)a=c.next(),this.isAnnotationTypeVisible(a.type)&&(e=a);e&&b.getLineAtOffset(e.start)===b.getLineAtOffset(d)&&((b=j.Tooltip.getTooltip(this._view))&&b.setTarget(null),e.expanded?e.collapse():e.expand(),this._annotationModel.modifyAnnotation(e))}}};c.prototype._getTooltipContents=function(a,c){return c.length===
1&&c[0].expanded?null:e.prototype._getTooltipContents.call(this,a,c)};c.prototype._onAnnotationModelChanged=function(a){function c(a){for(g=0;g<a.length;g++)if(f.isAnnotationTypeVisible(a[g].type)){var b=a[g].start;d.getBaseModel&&(b=d.mapOffset(b,!0));b!==-1&&(j=Math.min(j,d.getLineAtOffset(b)))}}if(a.textModelChangedEvent)e.prototype._onAnnotationModelChanged.call(this,a);else{var b=this._view;if(b){var d=b.getModel(),f=this,g,h=d.getLineCount(),j=h;c(a.added);c(a.removed);c(a.changed);a=b.getRulers();
for(g=0;g<a.length;g++)b.redrawLines(j,h,a[g])}}};return{Ruler:g,AnnotationRuler:e,LineNumberRuler:f,OverviewRuler:d,FoldingRuler:c}});
define("orion/editor/editorFeatures","i18n!orion/editor/nls/messages,orion/editor/undoStack,orion/editor/keyBinding,orion/editor/rulers,orion/editor/annotations,orion/editor/tooltip,orion/editor/textDND,orion/editor/regex,orion/editor/util".split(","),function(h,k,j,b,g,f,e,d,c){function a(){}function i(){}function m(){}function o(){}function q(){}function u(a,c,b){this.editor=a;this.textView=a.getTextView();this.undoStack=c;this._incrementalFindActive=!1;this._incrementalFindSuccess=!0;this._incrementalFindIgnoreSelection=
!1;this._incrementalFindPrefix="";this._searcher=b;this._lastEditLocation=null;this.init()}function l(a,c,b,d){this.editor=a;this.textView=a.getTextView();this.undoStack=c;this.contentAssist=b;this.linkedMode=d;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",this.contentAssistProposalApplied.bind(this));this.init()}function s(a){this.editor=a;this.textView=a.getTextView();this.linkedModeActive=!1;this.linkedModePositions=[];this.linkedModeEscapePosition=this.linkedModeCurrentPositionIndex=
0;this.linkedModeListener={onVerify:function(a){for(var c=!1,b=0,d=0;d<this.linkedModePositions.length;++d){var e=this.linkedModePositions[d];if(c)e.offset+=b;else if(a.start>=e.offset&&a.end<=e.offset+e.length)c=e.length,e.length=a.start-e.offset+a.text.length+(e.offset+e.length-a.end),b=e.length-c,c=!0}c?this.linkedModeEscapePosition+=b:this.cancel()}.bind(this)}}a.prototype={createUndoStack:function(a){var a=a.getTextView(),c=new k.UndoStack(a,200);a.setAction("undo",function(){c.undo();return!0},
{name:h.undo});a.setAction("redo",function(){c.redo();return!0},{name:h.redo});return c}};i.prototype={createLineNumberRuler:function(a){return new b.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};m.prototype={createFoldingRuler:function(a){return new b.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};o.prototype={createAnnotationModel:function(a){return new g.AnnotationModel(a)},createAnnotationStyler:function(a,c){return new g.AnnotationStyler(a,
c)},createAnnotationRulers:function(a){var c=new b.AnnotationRuler(a,"left",{styleClass:"ruler annotations"}),a=new b.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:c,overviewRuler:a}}};q.prototype={createTextDND:function(a,c){return new e.TextDND(a.getTextView(),c)}};u.prototype={init:function(){var a=this;this._incrementalFindListener={onVerify:function(b){var e=a.editor,i=e.getModel(),f=e.mapOffset(b.start),g=e.mapOffset(b.end),f=i.getText(f,g),i=a._incrementalFindPrefix;
if((i=i.match(RegExp("^"+d.escape(f),"i")))&&i.length>0)i=a._incrementalFindPrefix+=b.text,a.editor.reportStatus(c.formatMessage(h.incrementalFind,i)),f=e.getSelection().start,(f=e.getModel().find({string:i,start:f,caseInsensitive:i.toLowerCase()===i}).next())?(a._incrementalFindSuccess=!0,a._incrementalFindIgnoreSelection=!0,e.moveSelection(f.start,f.end),a._incrementalFindIgnoreSelection=!1):(e.reportStatus(c.formatMessage(h.incrementalFindNotFound,i),"error"),a._incrementalFindSuccess=!1),b.text=
null},onSelection:function(){a._incrementalFindIgnoreSelection||a.toggleIncrementalFind()}};this._lastEditListener={onModelChanged:function(c){if(a.editor.isDirty())a._lastEditLocation=c.start+c.addedCharCount}};this.textView.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);this.textView.setKeyBinding(new j.KeyBinding("k",!0),"findNext");this.textView.setAction("findNext",function(){if(this._searcher){var a=this.textView.getSelection();a.start<a.end?this._searcher.findNext(!0,
this.textView.getText(a.start,a.end)):this._searcher.findNext(!0);return!0}return!1}.bind(this),{name:h.findNext});this.textView.setKeyBinding(new j.KeyBinding("k",!0,!0),"findPrevious");this.textView.setAction("findPrevious",function(){if(this._searcher){var a=this.textView.getSelection();a.start<a.end?this._searcher.findNext(!1,this.textView.getText(a.start,a.end)):this._searcher.findNext(!1);return!0}return!1}.bind(this),{name:h.findPrevious});this.textView.setKeyBinding(new j.KeyBinding("j",!0),
"incrementalFind");this.textView.setAction("incrementalFind",function(){if(this._searcher&&this._searcher.visible())return!0;var a=this.editor;if(this._incrementalFindActive){var b=this._incrementalFindPrefix;if(b.length!==0){var d;d=0;this._incrementalFindSuccess&&(d=a.getSelection().start+1);(d=a.getModel().find({string:b,start:d,caseInsensitive:b.toLowerCase()===b}).next())?(this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=!0,a.moveSelection(d.start,d.end),this._incrementalFindIgnoreSelection=
!1,a.reportStatus(c.formatMessage(h.incrementalFind,b))):(a.reportStatus(c.formatMessage(h.incrementalFindNotFound,b),"error"),this._incrementalFindSuccess=!1)}}else a.setCaretOffset(a.getCaretOffset()),this.toggleIncrementalFind();return!0}.bind(this),{name:h.incrementalFindKey});this.textView.setAction("deletePrevious",function(){if(this._incrementalFindActive){var a=this.editor,b=this._incrementalFindPrefix,b=this._incrementalFindPrefix=b.substring(0,b.length-1);if(b.length===0)return this._incrementalFindIgnoreSelection=
this._incrementalFindSuccess=!0,a.setCaretOffset(a.getSelection().start),this._incrementalFindIgnoreSelection=!1,this.toggleIncrementalFind(),!0;a.reportStatus(c.formatMessage(h.incrementalFind,b));var d=a.getModel().find({string:b,start:a.getCaretOffset()-b.length-1,reverse:!0,caseInsensitive:b.toLowerCase()===b}).next();d?(this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=!0,a.moveSelection(d.start,d.end),this._incrementalFindIgnoreSelection=!1):a.reportStatus(c.formatMessage(h.incrementalFindNotFound,
b),"error");return!0}return!1}.bind(this));this.textView.setAction("tab",function(){if(this.textView.getOptions("readonly"))return!1;if(this.textView.getOptions("tabMode")){var a=this.editor,c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start),e=c.getLineAtOffset(b.end>b.start?b.end-1:b.end);if(d!==e){var i=[];i.push("");for(var f=d;f<=e;f++)i.push(c.getLine(f,!0));var f=c.getLineStart(d),c=c.getLineEnd(e,!0),g=this.textView.getOptions("tabSize","expandTab"),g=g.expandTab?Array(g.tabSize+
1).join(" "):"\t";a.setText(i.join(g),f,c);a.setSelection(f===b.start?b.start:b.start+g.length,b.end+(e-d+1)*g.length);return!0}a=a.getKeyModes();for(b=0;b<a.length;b++)if(a[b].isActive())return a[b].tab();return!1}}.bind(this));this.textView.setAction("shiftTab",function(){if(this.textView.getOptions("readonly"))return!1;if(this.textView.getOptions("tabMode")){for(var a=this.editor,c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start),e=c.getLineAtOffset(b.end>b.start?b.end-1:b.end),i=this.textView.getOptions("tabSize"),
f=Array(i+1).join(" "),g=[],h=0,m=0,j=d;j<=e;j++){var n=c.getLine(j,!0);if(c.getLineStart(j)!==c.getLineEnd(j))if(n.indexOf("\t")===0)n=n.substring(1),h++;else if(n.indexOf(f)===0)n=n.substring(i),h+=i;else return!0;j===d&&(m=h);g.push(n)}d=c.getLineStart(d);i=c.getLineEnd(e,!0);c=c.getLineStart(e);a.setText(g.join(""),d,i);g=d===b.start?b.start:b.start-m;b=Math.max(g,b.end-h+(b.end===c+1&&b.start!==b.end?1:0));a.setSelection(g,b);return!0}}.bind(this),{name:h.unindentLines});this.textView.setKeyBinding(new j.KeyBinding(38,
!1,!1,!0),"moveLinesUp");this.textView.setAction("moveLinesUp",function(){if(this.textView.getOptions("readonly"))return!1;var a=this.editor,c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start);if(d===0)return!0;var e=c.getLineAtOffset(b.end>b.start?b.end-1:b.end),i=c.getLineCount(),b=c.getLineStart(d-1),f=c.getLineStart(d),g=c.getLineEnd(e,!0),h=c.getText(f,g),m=0;e===i-1&&(e=c.getLineEnd(d-1),d=c.getLineEnd(d-1,!0),h+=c.getText(e,d),f=e,m=d-e);this.startUndo();a.setText("",f,g);a.setText(h,
b,b);a.setSelection(b,b+h.length-m);this.endUndo();return!0}.bind(this),{name:h.moveLinesUp});this.textView.setKeyBinding(new j.KeyBinding(40,!1,!1,!0),"moveLinesDown");this.textView.setAction("moveLinesDown",function(){if(this.textView.getOptions("readonly"))return!1;var a=this.editor,c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start),e=c.getLineAtOffset(b.end>b.start?b.end-1:b.end),i=c.getLineCount();if(e===i-1)return!0;var d=c.getLineStart(d),b=c.getLineEnd(e,!0),f=c.getLineEnd(e+1,
!0)-(b-d),g=0;e!==i-2?c=c.getText(d,b):(e=c.getLineEnd(e),c=c.getText(e,b)+c.getText(d,e),g+=b-e);this.startUndo();a.setText("",d,b);a.setText(c,f,f);a.setSelection(f+g,f+g+c.length);this.endUndo();return!0}.bind(this),{name:h.moveLinesDown});this.textView.setKeyBinding(new j.KeyBinding(38,!0,!1,!0),"copyLinesUp");this.textView.setAction("copyLinesUp",function(){if(this.textView.getOptions("readonly"))return!1;var a=this.editor,c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start),b=c.getLineAtOffset(b.end>
b.start?b.end-1:b.end),d=c.getLineStart(d),e=c.getLineEnd(b,!0),i=c.getLineCount(),f="",e=c.getText(d,e);b===i-1&&(e+=f=c.getLineDelimiter());a.setText(e,d,d);a.setSelection(d,d+e.length-f.length);return!0}.bind(this),{name:h.copyLinesUp});this.textView.setKeyBinding(new j.KeyBinding(40,!0,!1,!0),"copyLinesDown");this.textView.setAction("copyLinesDown",function(){if(this.textView.getOptions("readonly"))return!1;var a=this.editor,c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start),b=c.getLineAtOffset(b.end>
b.start?b.end-1:b.end),e=c.getLineStart(d),d=c.getLineEnd(b,!0),i=c.getLineCount(),f="",e=c.getText(e,d);b===i-1&&(e=(f=c.getLineDelimiter())+e);a.setText(e,d,d);a.setSelection(d+f.length,d+e.length);return!0}.bind(this),{name:h.copyLinesDown});this.textView.setKeyBinding(new j.KeyBinding("d",!0,!1,!1),"deleteLines");this.textView.setAction("deleteLines",function(){if(this.textView.getOptions("readonly"))return!1;var a=this.editor,c=a.getSelection(),b=a.getModel(),d=b.getLineAtOffset(c.start),c=b.getLineAtOffset(c.end>
c.start?c.end-1:c.end),d=b.getLineStart(d),b=b.getLineEnd(c,!0);a.setText("",d,b);return!0}.bind(this),{name:h.deleteLines});this.textView.setKeyBinding(new j.KeyBinding("l",!0),"gotoLine");this.textView.setAction("gotoLine",function(){var a=this.editor,c=a.getModel().getLineAtOffset(a.getCaretOffset());if(c=prompt(h.gotoLinePrompty,c+1))c=parseInt(c,10),a.onGotoLine(c-1,0);return!0}.bind(this),{name:h.gotoLine});this.textView.setKeyBinding(new j.KeyBinding(190,!0),"nextAnnotation");this.textView.setAction("nextAnnotation",
function(){var a=this.editor,c=a.getAnnotationModel();if(!c)return!0;for(var b=a.getModel(),d=a.getCaretOffset(),c=c.getAnnotations(d,b.getCharCount());c.hasNext();){var e=c.next();if(!(e.start<=d)&&!(e.type!==g.AnnotationType.ANNOTATION_ERROR&&e.type!==g.AnnotationType.ANNOTATION_WARNING&&e.type!==g.AnnotationType.ANNOTATION_TASK&&e.type!==g.AnnotationType.ANNOTATION_BOOKMARK)){var i=f.Tooltip.getTooltip(this.textView);if(!i){a.moveSelection(e.start);break}var h=b.getLineAtOffset(e.start),m=this.textView;
a.moveSelection(e.start,e.start,function(){setTimeout(function(){i.setTarget({getTooltipInfo:function(){var a=m.convert({x:m.getLocationAtOffset(e.start).x,y:m.getLocationAtOffset(b.getLineStart(h)).y},"document","page");return{contents:[e],x:a.x,y:a.y+Math.floor(m.getLineHeight(h)*1.33)}}},0)},0)});break}}return!0}.bind(this),{name:h.nextAnnotation});this.textView.setKeyBinding(new j.KeyBinding(188,!0),"previousAnnotation");this.textView.setAction("previousAnnotation",function(){var a=this.editor,
c=a.getAnnotationModel();if(!c)return!0;for(var b=a.getModel(),d=a.getCaretOffset(),c=c.getAnnotations(0,d),e=null;c.hasNext();){var i=c.next();i.start>=d||i.type!==g.AnnotationType.ANNOTATION_ERROR&&i.type!==g.AnnotationType.ANNOTATION_WARNING&&i.type!==g.AnnotationType.ANNOTATION_TASK&&i.type!==g.AnnotationType.ANNOTATION_BOOKMARK||(e=i)}if(e){var h=b.getLineAtOffset(e.start),m=f.Tooltip.getTooltip(this.textView);if(!m)return a.moveSelection(e.start),!0;var j=this.textView;a.moveSelection(e.start,
e.start,function(){setTimeout(function(){m.setTarget({getTooltipInfo:function(){var a=j.convert({x:j.getLocationAtOffset(e.start).x,y:j.getLocationAtOffset(b.getLineStart(h)).y},"document","page");return{contents:[e],x:a.x,y:a.y+Math.floor(j.getLineHeight(h)*1.33)}}},0)},0)})}return!0}.bind(this),{name:h.prevAnnotation});this.textView.setKeyBinding(new j.KeyBinding("e",!0,!1,!0,!1),"expand");this.textView.setAction("expand",function(){var a=this.editor,c=a.getAnnotationModel();if(!c)return!0;var b=
a.getModel(),a=a.getCaretOffset(),d=b.getLineAtOffset(a),a=b.getLineStart(d),d=b.getLineEnd(d,!0);b.getBaseModel&&(a=b.mapOffset(a),d=b.mapOffset(d),b.getBaseModel());for(var e,b=c.getAnnotations(a,d);!e&&b.hasNext();)a=b.next(),a.type===g.AnnotationType.ANNOTATION_FOLDING&&(a.expanded||(e=a));e&&!e.expanded&&(e.expand(),c.modifyAnnotation(e));return!0}.bind(this),{name:h.expand});this.textView.setKeyBinding(new j.KeyBinding("c",!0,!1,!0,!1),"collapse");this.textView.setAction("collapse",function(){var a=
this.editor,c=a.getAnnotationModel();if(!c)return!0;var b=a.getModel(),d=a.getCaretOffset(),e=b.getLineAtOffset(d),d=b.getLineStart(e),e=b.getLineEnd(e,!0);b.getBaseModel&&(d=b.mapOffset(d),e=b.mapOffset(e),b.getBaseModel());for(var i,b=c.getAnnotations(d,e);!i&&b.hasNext();)d=b.next(),d.type===g.AnnotationType.ANNOTATION_FOLDING&&(i=d);i&&i.expanded&&(a.setCaretOffset(i.start),i.collapse(),c.modifyAnnotation(i));return!0}.bind(this),{name:h.collapse});this.textView.setKeyBinding(new j.KeyBinding("e",
!0,!0,!0,!1),"expandAll");this.textView.setAction("expandAll",function(){var a=this.editor,c=a.getAnnotationModel();if(!c)return!0;var a=a.getModel(),b=c.getAnnotations(0,a.getCharCount());for(this.textView.setRedraw(!1);b.hasNext();)a=b.next(),a.type===g.AnnotationType.ANNOTATION_FOLDING&&!a.expanded&&(a.expand(),c.modifyAnnotation(a));this.textView.setRedraw(!0);return!0}.bind(this),{name:h.expandAll});this.textView.setKeyBinding(new j.KeyBinding("c",!0,!0,!0,!1),"collapseAll");this.textView.setAction("collapseAll",
function(){var a=this.editor,c=a.getAnnotationModel();if(!c)return!0;var a=a.getModel(),b=c.getAnnotations(0,a.getCharCount());for(this.textView.setRedraw(!1);b.hasNext();)a=b.next(),a.type===g.AnnotationType.ANNOTATION_FOLDING&&a.expanded&&(a.collapse(),c.modifyAnnotation(a));this.textView.setRedraw(!0);return!0}.bind(this),{name:h.collapseAll});this.textView.setKeyBinding(new j.KeyBinding("q",!c.isMac,!1,!1,c.isMac),"lastEdit");this.textView.setAction("lastEdit",function(){typeof this._lastEditLocation===
"number"&&this.editor.showSelection(this._lastEditLocation);return!0}.bind(this),{name:h.lastEdit})},toggleIncrementalFind:function(){(this._incrementalFindActive=!this._incrementalFindActive)?(this.editor.reportStatus(c.formatMessage(h.incrementalFind,this._incrementalFindPrefix)),this.textView.addEventListener("Verify",this._incrementalFindListener.onVerify),this.textView.addEventListener("Selection",this._incrementalFindListener.onSelection)):(this._incrementalFindPrefix="",this.editor.reportStatus(""),
this.textView.removeEventListener("Verify",this._incrementalFindListener.onVerify),this.textView.removeEventListener("Selection",this._incrementalFindListener.onSelection),this.textView.setCaretOffset(this.textView.getCaretOffset()))},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},cancel:function(){this.toggleIncrementalFind()},isActive:function(){return this._incrementalFindActive},isStatusActive:function(){return this._incrementalFindActive},
lineUp:function(){if(this._incrementalFindActive){var a=this._incrementalFindPrefix;if(a.length===0)return!1;var b=this.editor,d=b.getModel(),d=this._incrementalFindSuccess?b.getCaretOffset()-a.length-1:d.getCharCount()-1;(d=b.getModel().find({string:a,start:d,reverse:!0,caseInsensitive:a.toLowerCase()===a}).next())?(this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=!0,b.moveSelection(d.start,d.end),this._incrementalFindIgnoreSelection=!1,b.reportStatus(c.formatMessage(h.incrementalFind,
a))):(b.reportStatus(c.formatMessage(h.incrementalFindNotFound,a),"error"),this._incrementalFindSuccess=!1);return!0}return!1},lineDown:function(){if(this._incrementalFindActive){var a=this._incrementalFindPrefix;if(a.length===0)return!1;var b=this.editor,d=0;this._incrementalFindSuccess&&(d=b.getSelection().start+1);(d=b.getModel().find({string:a,start:d,caseInsensitive:a.toLowerCase()===a}).next())?(this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=!0,b.moveSelection(d.start,d.end),
this._incrementalFindIgnoreSelection=!1,b.reportStatus(c.formatMessage(h.incrementalFind,a))):(b.reportStatus(c.formatMessage(h.incrementalFindNotFound,a),"error"),this._incrementalFindSuccess=!1);return!0}return!1},enter:function(){return!1}};l.prototype={startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},init:function(){function a(c,b,d){var e=c.getLineAtOffset(b),i=c.getLineAtOffset(d),f,g,h,m,j,n;for(f=
e;f>=0;f--)if(g=c.getLine(f),h=f===e?b-c.getLineStart(e):g.length,m=g.lastIndexOf("/*",h),g=g.lastIndexOf("*/",h),g>m)break;else if(m!==-1){j=c.getLineStart(f)+m;break}for(f=i;f<c.getLineCount();f++)if(g=c.getLine(f),h=f===i?d-c.getLineStart(i):0,m=g.indexOf("/*",h),g=g.indexOf("*/",h),m!==-1&&m<g)break;else if(g!==-1){n=c.getLineStart(f)+g;break}return{commentStart:j,commentEnd:n}}this.textView.setAction("lineStart",function(){for(var a=this.editor,c=a.getModel(),b=a.getCaretOffset(),d=c.getLineAtOffset(b),
e=c.getLineStart(d),c=c.getLine(d),d=0;d<c.length;d++){var i=c.charCodeAt(d);if(!(i===32||i===9))break}d+=e;return b!==d?(a.setSelection(d,d),!0):!1}.bind(this));this.textView.setKeyBinding(new j.KeyBinding(191,!0),"toggleLineComment");this.textView.setAction("toggleLineComment",function(){if(this.textView.getOptions("readonly"))return!1;for(var a=this.editor,c=a.getModel(),b=a.getSelection(),d=c.getLineAtOffset(b.start),e=c.getLineAtOffset(b.end>b.start?b.end-1:b.end),i=!0,f=[],g,h,m=d;m<=e;m++)if(g=
c.getLine(m,!0),f.push(g),!i||(h=g.indexOf("//"))===-1)i=!1;else if(h!==0){var j;for(j=0;j<h;j++)if(i=g.charCodeAt(j),!(i===32||i===9))break;i=j===h}m=c.getLineStart(d);j=c.getLineEnd(e,!0);if(i){for(i=0;i<f.length;i++)g=f[i],h=g.indexOf("//"),f[i]=g.substring(0,h)+g.substring(h+2);f=f.join("");g=c.getLineStart(e);c=m===b.start?b.start:b.start-2;b=b.end-2*(e-d+1)+(b.end===g+1?2:0)}else f.splice(0,0,""),f=f.join("//"),c=m===b.start?b.start:b.start+2,b=b.end+2*(e-d+1);a.setText(f,m,j);a.setSelection(c,
b);return!0}.bind(this),{name:h.toggleLineComment});this.textView.setKeyBinding(new j.KeyBinding(191,!0,!c.isMac,!1,c.isMac),"addBlockComment");this.textView.setAction("addBlockComment",function(){if(this.textView.getOptions("readonly"))return!1;var c=this.editor,b=c.getModel(),d=c.getSelection(),e=RegExp("/\\*|\\*/","g"),i=a(b,d.start,d.end);if(i.commentStart!==void 0&&i.commentEnd!==void 0)return!0;b=b.getText(d.start,d.end);if(b.length===0)return!0;i=b.length;b=b.replace(e,"");e=b.length;c.setText("/*"+
b+"*/",d.start,d.end);c.setSelection(d.start+2,d.end+2+(e-i));return!0}.bind(this),{name:h.addBlockComment});this.textView.setKeyBinding(new j.KeyBinding(220,!0,!c.isMac,!1,c.isMac),"removeBlockComment");this.textView.setAction("removeBlockComment",function(){if(this.textView.getOptions("readonly"))return!1;var c=this.editor,b=c.getModel(),d=c.getSelection(),e=b.getText(d.start,d.end),i,f,g;for(g=0;g<e.length;g++)if(e.substring(g,g+2)==="/*"){i=d.start+g;break}for(;g<e.length;g++)if(e.substring(g,
g+2)==="*/"){f=d.start+g;break}if(i!==void 0&&f!==void 0)c.setText(b.getText(i+2,f),i,f+2),c.setSelection(i,f);else{e=a(b,d.start,d.end);if(e.commentStart===void 0||e.commentEnd===void 0)return!0;b=b.getText(e.commentStart+2,e.commentEnd);c.setText(b,e.commentStart,e.commentEnd+2);c.setSelection(d.start-2,d.end-2)}return!0}.bind(this),{name:h.removeBlockComment})},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&this.linkedMode){for(var c=[],b=0;b<a.positions.length;++b)c[b]=
{positions:[{offset:a.positions[b].offset,length:a.positions[b].length}]};this.linkedMode.enterLinkedMode({groups:c,escapePosition:a.escapePosition})}else a.escapePosition&&this.textView.setCaretOffset(a.escapePosition);return!0},cancel:function(){return!1},isActive:function(){return!0},isStatusActive:function(){return!1},lineUp:function(){return!1},lineDown:function(){return!1},enter:function(){if(this.textView.getOptions("readonly"))return!1;var a=this.editor,c=a.getSelection();if(c.start===c.end){for(var b=
a.getModel(),d=b.getLineAtOffset(c.start),e=b.getLine(d,!0),i=b.getLineStart(d),d=0,i=c.start-i,f;d<i&&((f=e.charCodeAt(d))===32||f===9);)d++;if(d>0){for(var g=e.substring(0,d),d=i;d<e.length&&((f=e.charCodeAt(d++))===32||f===9);)c.end++;a.setText(b.getLineDelimiter()+g,c.start,c.end);return!0}}return!1},tab:function(){return!1}};s.prototype={enterLinkedMode:function(a){if(!this.linkedModeActive){this.linkedModeActive=!0;this.linkedModePositions=[];for(var c=0;c<a.groups.length;++c){var b=a.groups[c];
this.linkedModePositions[c]={offset:b.positions[0].offset,length:b.positions[0].length}}this.linkedModeEscapePosition=a.escapePosition;this.linkedModeCurrentPositionIndex=0;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);this.textView.addEventListener("Verify",this.linkedModeListener.onVerify);this.textView.setKeyBinding(new j.KeyBinding(9),"nextLinkedModePosition");this.textView.setAction("nextLinkedModePosition",function(){this.linkedModeCurrentPositionIndex=
++this.linkedModeCurrentPositionIndex%this.linkedModePositions.length;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);return!0}.bind(this));this.textView.setKeyBinding(new j.KeyBinding(9,!1,!0),"previousLinkedModePosition");this.textView.setAction("previousLinkedModePosition",function(){this.linkedModeCurrentPositionIndex=this.linkedModeCurrentPositionIndex>0?this.linkedModeCurrentPositionIndex-1:this.linkedModePositions.length-1;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);
return!0}.bind(this));this.editor.reportStatus(h.linkedModeEntered,null,!0)}},isActive:function(){return this.linkedModeActive},isStatusActive:function(){return this.linkedModeActive},enter:function(){this.cancel();return!0},cancel:function(a){if(this.linkedModeActive)this.linkedModeActive=!1,this.textView.removeEventListener("Verify",this.linkedModeListener.onVerify),this.textView.setKeyBinding(new j.KeyBinding(9),"tab"),this.textView.setKeyBinding(new j.KeyBinding(9,!1,!0),"shiftTab"),a||this.textView.setCaretOffset(this.linkedModeEscapePosition,
!1),this.editor.reportStatus(h.linkedModeExited,null,!0)},lineUp:function(){this.cancel(!0);return!1},lineDown:function(){this.cancel(!0);return!1},selectTextForLinkedModePosition:function(a){this.textView.setSelection(a.offset,a.offset+a.length)}};return{UndoFactory:a,LineNumberRulerFactory:i,FoldingRulerFactory:m,AnnotationFactory:o,TextDNDFactory:q,TextActions:u,SourceCodeActions:l,LinkedMode:s}});define("text!orion/compare/compare-features.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/compareUtils",["orion/URITemplate"],function(h){var k=k||{};k.compareUtils=k.compareUtils||{};k.compareUtils.lookUpMapper=function(h,b,g){for(var f=0,e=0;e<h.length;e++){var d=h[e][b];d===0&&(d=1);if(g>=f&&g<f+d)return{mapperIndex:e,startFrom:f};if(e===h.length-1)break;f+=h[e][b]}return{mapperIndex:h.length-1,startFrom:f}};k.compareUtils.lookUpLineIndex=function(h,b,g){if(g===0)return 0;for(var f=0,e=0;e<g;e++)f+=h[e][b];return f};k.compareUtils.updateMapper=function(h,b,g,f,
e){if(f!==e&&(f>0||e>0)){var d=k.compareUtils.lookUpMapper(h,b,g);if(!(d.mapperIndex<0)){if(f>0)for(var c=g-d.startFrom,g=d.mapperIndex;g<h.length;g++){c=h[g][b]-c;if(f<=c){h[g][b]-=f;break}h[g][b]-=c;f-=c;c=0}e>0&&(h[d.mapperIndex][b]+=e)}}};k.compareUtils.overlapMapper=function(h,b,g,f,e){h=g+h[b]-1;h<g&&(h=g);e<f&&(e=f);return h<f||e<g?!1:!0};k.compareUtils.findFirstDiff=function(h,b,g,f){for(var e=0,d=void 0,c=0;c<h.length;c++){if(e>f)break;if(k.compareUtils.overlapMapper(h[c],b,e,g,f)&&(d={mapperIndex:c,
startFrom:e},h[c][2]!==0))break;e+=h[c][b]}return d};k.compareUtils.matchMapper=function(h,b,g,f){if(h.length===0)return g;var e=g+Math.round((f-g)/3),d=k.compareUtils.findFirstDiff(h,b,g,f),c=h[d.mapperIndex][b]===0?d.startFrom:d.startFrom+h[d.mapperIndex][b]-1,a=k.compareUtils.lookUpLineIndex(h,1-b,d.mapperIndex),i=d.startFrom-g;return h[d.mapperIndex][2]===0?a-i:e>=d.startFrom&&e<=c?a-Math.round((f-g)/3):e<d.startFrom?a-i:(h[d.mapperIndex][1-b]===0?a:a+h[d.mapperIndex][1-b]-1)-(c-g)};k.compareUtils.getMapperLineCount=
function(h){for(var b=0,g=0;g<h.length;g++)b+=Math.max(h[g][0],h[g][1]);return b};k.compareUtils.getAnnotationIndex=function(h,b){for(var g=0;g<h.length;g++)if(h[g][0]===b)return g;return-1};k.compareUtils.getAnnotationMapperIndex=function(h,b){return h[b][1]};k.compareUtils.getAnnotationIndexByMapper=function(h,b){for(var g=0;g<h.length;g++)if(h[g][1]===b)return{current:g,prev:g-1,next:g+1};return{current:-1,prev:-1,next:-1}};k.compareUtils.isMapperConflict=function(h,b){return b<0?!1:!h[b][3]?!1:
h[b][3]===1};k.compareUtils.mergeDiffBlocks=function(h,b,g,f,e,d){for(var c=0;c<b.length;c++){var a=b[c][0],i=g[b[c][1]];if(i[0]>0){for(var m="",o=0;o<i[0];o++)m=m+f[i[2]-1+o].substring(e)+d;i=h.getLineCount();a>=i&&(a=i-1);a=h.getLineStart(a);h.setText(m,a,a)}}};k.compareUtils.generateCompareHref=function(j,b){var g=require.toUrl("compare/compare.html");if(!b.conflict)b.conflict=void 0;if(!b.readonly)b.readonly=void 0;return(new h(g+"#{,resource,params*}")).expand({resource:j,params:b})};k.compareUtils.generateCompareTreeHref=
function(j,b){var g=require.toUrl("compare-tree/compare-tree.html");return(new h(g+"#{,resource,params*}")).expand({resource:j,params:b})};return k.compareUtils});
define("orion/compare/compare-features",["i18n!orion/compare/nls/messages","orion/compare/compareUtils","orion/webui/littlelib","orion/webui/splitter","text!orion/compare/compare-features.html"],function(h,k,j,b,g){var f=f||{};f.TwoWayCompareUIFactory=function(){function e(b){this._parentDivID=b.parentDivID;this._commandSpanId=b.commandSpanId;this._showTitle=b.showTitle;this._leftTitle=b.leftTitle;this._rightTitle=b.rightTitle;this._showLineStatus=b.showLineStatus}e.prototype={_init:function(){var b=
this._parentDivID+"_";this._topWidgetDiv=j.node("topWidget_id");this._topWidgetDiv.id=b+"topWidget_id";this._leftEditorParentDiv=j.node("left_editor_id");this._leftEditorParentDiv.id=b+"left_editor_id";this._rightEditorParentDiv=j.node("right_editor_id");this._rightEditorParentDiv.id=b+"right_editor_id";this._rightEditorWrapperDiv=j.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=b+"right_editor_wrapper_id";this._leftTitleDiv=j.node("left_title_id");this._leftTitleDiv.id=b+"left_title_id";
this._rightTitleDiv=j.node("right_title_id");this._rightTitleDiv.id=b+"right_title_id";this._leftStatusDiv=j.node("left_status_id");this._leftStatusDiv.id=b+"left_status_id";this._rightStatusDiv=j.node("right_status_id");this._rightStatusDiv.id=b+"right_status_id";this._diffCanvasDiv=j.node("diff_canvas_id");this._diffCanvasDiv.id=b+"diff_canvas_id";this._splitterId=b+"orion_splitter";if(!this._showTitle)this._leftEditorParentDiv.style.top="0px",this._rightEditorWrapperDiv.style.top="0px",this._leftTitleDiv.style.height=
"0px",this._rightTitleDiv.style.height="0px";if(!this._showLineStatus)this._leftEditorParentDiv.style.marginBottom="0px",this._rightEditorWrapperDiv.style.marginBottom="0px",this._leftStatusDiv.style.height="0px",this._rightStatusDiv.style.height="0px"},_createSplitter:function(){var d=j.$(".split",this._topWidgetDiv);d.id=this._splitterId;var c=j.$(".leftPanelLayout",this._topWidgetDiv),a=j.$(".rightPanelLayout",this._topWidgetDiv);if(d&&c&&a)this._splitter=new b.Splitter({node:d,sidePanel:c,mainPanel:a})},
buildUI:function(){j.node(this._parentDivID).innerHTML=g;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(b){return j.$(".leftPanelLayout",this._topWidgetDiv)===b},getEditorParentDiv:function(b){return b?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(b){return b?this._leftTitleDiv:this._rightTitleDiv},getStatusDiv:function(b){return b?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},
getDiffCanvasDiv:function(){return this._diffCanvasDiv}};return e}();return f});
var JsDiff=function(){function h(b){for(var c=[],a=0;a<b.length;a++)b[a]&&c.push(b[a]);return c}function k(b){b=b.replace(/&/g,"&amp;");b=b.replace(/</g,"&lt;");b=b.replace(/>/g,"&gt;");return b=b.replace(/"/g,"&quot;")}var j=function(b){this.ignoreWhitespace=b};j.prototype={diff:function(b,c){if(c==b)return[{value:c}];if(!c)return[{value:b,removed:!0}];if(!b)return[{value:c,added:!0}];var c=this.tokenize(c),b=this.tokenize(b),a=c.length,e=b.length,f=a+e,g=[{newPos:-1,components:[]}],h=this.extractCommon(g[0],
c,b,0);if(g[0].newPos+1>=a&&h+1>=e)return g[0].components;for(var j=1;j<=f;j++)for(var l=-1*j;l<=j;l+=2){var k;k=g[l-1];var n=g[l+1],h=(n?n.newPos:0)-l;k&&(g[l-1]=void 0);var y=k&&k.newPos+1<a,t=n&&0<=h&&h<e;if(!y&&!t)g[l]=void 0;else if(!y||t&&k.newPos<n.newPos?(k={newPos:n.newPos,components:n.components.slice(0)},this.pushComponent(k.components,b[h],void 0,!0)):(k={newPos:k.newPos,components:k.components.slice(0)},k.newPos++,this.pushComponent(k.components,c[k.newPos],!0,void 0)),h=this.extractCommon(k,
c,b,l),k.newPos+1>=a&&h+1>=e)return k.components;else g[l]=k}},pushComponent:function(b,c,a,e){var f=b[b.length-1];f&&f.added===a&&f.removed===e?b[b.length-1]={value:this.join(f.value,c),added:a,removed:e}:b.push({value:c,added:a,removed:e})},extractCommon:function(b,c,a,e){for(var f=c.length,g=a.length,h=b.newPos,e=h-e;h+1<f&&e+1<g&&this.equals(c[h+1],a[e+1]);)h++,e++,this.pushComponent(b.components,c[h],void 0,void 0);b.newPos=h;return e},equals:function(b,c){var a=/\S/;return this.ignoreWhitespace&&
!a.test(b)&&!a.test(c)?!0:b==c},join:function(b,c){return b+c},tokenize:function(b){return b}};var b=new j,g=new j(!1);g.tokenize=function(b){return h(b.split(/(\s+|\b)/))};var f=new j(!0);f.tokenize=function(b){return h(b.split(/([{}:;,]|\s+)/))};var e=new j;e.tokenize=function(b){return b.split(/^/m)};return{diffChars:function(d,c){return b.diff(d,c)},diffWords:function(b,c){return g.diff(b,c)},diffLines:function(b,c){return e.diff(b,c)},diffCss:function(b,c){return f.diff(b,c)},createPatch:function(b,
c,a,i,f){var g=[];g.push("Index: "+b);g.push("===================================================================");g.push("--- "+b+"\t"+i);g.push("+++ "+b+"\t"+f);b=e.diff(c,a);b.push({value:"",lines:[]});for(var a=c=0,i=[],h=f=1,j=0;j<b.length;j++){var l=b[j],k=l.lines||l.value.replace(/\n$/,"").split("\n");l.lines=k;if(l.added||l.removed){if(!c){var n=b[j-1],c=f,a=h;n&&(i.push.apply(i,n.lines.slice(-4).map(function(a){return" "+a})),c-=4,a-=4)}i.push.apply(i,k.map(function(a){return(l.added?"+":
"-")+a}));l.added?h+=k.length:f+=k.length}else c&&(k.length<=8&&j<b.length-1?i.push.apply(i,k.map(function(a){return" "+a})):(n=Math.min(k.length,4),g.push("@@ -"+c+","+(f-c+n)+" +"+a+","+(h-a+n)+" @@"),g.push.apply(g,i),g.push.apply(g,k.slice(0,n).map(function(a){return" "+a})),a=c=0,i=[])),f+=k.length,h+=k.length}b.length>1&&!/\n$/.test(b[b.length-2].value)&&g.push("\\ No newline at end of file\n");return g.join("\n")},convertChangesToXML:function(b){for(var c=[],a=0;a<b.length;a++){var e=b[a];
e.added?c.push("<ins>"):e.removed&&c.push("<del>");c.push(k(e.value));e.added?c.push("</ins>"):e.removed&&c.push("</del>")}return c.join("")}}}();if(typeof module!=="undefined")module.exports=JsDiff;typeof define==="function"&&define.amd&&define("jsdiff/diff",[],function(){return JsDiff});
define("orion/compare/jsdiffAdapter",["jsdiff/diff"],function(h){var k=k||{};k.JSDiffAdapter=function(){function j(){}j.prototype={adapt:function(b,g,f){f||(f="\n");for(var e=b.split(f),d=g.split(f),c=e[e.length-1]==="",d=d[d.length-1]==="",a=h.diffLines(b,g),b=[],g=[],i=0,m=0,j=-1,k=0,u=!0,l=0;l<a.length;l++){var s=a[l],n=s.lines||s.value.split(f),y=n.length,t=0;n.length>1&&n[n.length-1]===""&&y--;y>1&&!u&&n[0]===""&&(y--,t++);s.lines=n;if(!s.added&&!s.removed){if(i||m)b.push([i,m,j]),m=i=0,j=-1,
k+=m;b.push([y,y,0]);k+=y}else if(s.added){j===-1&&(j=g.length+1);i+=y;for(u=t;u<y+t;u++)g.push(s.lines[u])}else m+=y;u=!1;n.length>1&&n[n.length-1]===""&&(u=!0)}if(i||m)b.push([i,m,j]),k+=m;k<e.length&&e.length>1&&(f=b[b.length-1],f[2]===0?(f[0]+=1,f[1]+=1):f[2]===-1?b.push([1,1,0]):c===d?b.push([1,1,0]):(d&&(f[0]+=1),c&&(f[1]+=1)));return{mapper:b,changContents:{array:g,index:0}}},adaptCharDiff:function(b,g,f){for(var b=f?h.diffWords(b,g):h.diffChars(b,g),g=[],e=f=0,d=0,c=0,a=0;a<b.length;a++){var i=
b[a];if(!i.added&&!i.removed){if(d>0||c>0)g.push([e,e+d,f,f+c]),e+=d,f+=c,c=d=0;e+=i.value.length;f+=i.value.length}else i.added?d+=i.value.length:c+=i.value.length}(d>0||c>0)&&g.push([e,e+d,f,f+c]);return g}};return j}();return k});
define("examples/editor/textStyler",["orion/editor/annotations"],function(h){function k(a,c){this.keywords=a;this.whitespacesVisible=c;this.setText("")}function j(){k.call(this,null,!0)}function b(a){k.call(this,null,a)}function g(){k.call(this,null,!1)}function f(a,i,f){this.commentStart="/*";this.commentEnd="*/";var h=[];switch(i){case "java":h=d;break;case "js":h=e;break;case "css":h=c}this.whitespacesVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=
!0;this._scanner=new k(h,this.whitespacesVisible);this._firstScanner=new g;this._commentScanner=new b(this.whitespacesVisible);this._whitespaceScanner=new j;if(i==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=a;this.annotationModel=f;this._bracketAnnotations=void 0;var m=this;this._listener={onChanged:function(a){m._onModelChanged(a)},onDestroy:function(a){m._onDestroy(a)},onLineStyle:function(a){m._onLineStyle(a)},onMouseDown:function(a){m._onMouseDown(a)},onSelection:function(a){m._onSelection(a)}};
i=a.getModel();i.getBaseModel&&(i=i.getBaseModel());i.addEventListener("Changed",this._listener.onChanged);a.addEventListener("MouseDown",this._listener.onMouseDown);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",this._listener.onLineStyle);this._computeComments();this._computeFolding();a.redrawLines()}var e="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(","),
d="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(","),c="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(","),
a={styleClass:"comment"},i={styleClass:"token_multiline_comment"},m={styleClass:"token_doc_comment"},o={styleClass:"token_doc_html_markup"},q={styleClass:"token_task_tag"},u={styleClass:"token_doc_tag"},l={styleClass:"token-string"},s={styleClass:"token_number"},n={styleClass:"token_keyword"},y={styleClass:"token_space"},t={styleClass:"token_tab"},v={styleClass:"line_caret"};k.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 c=this.isCSS,b=this.offset-1;if(!c&&48<=a&&a<=57){var d=c=!1,e=!1,i=a;do if(a=this._read(),a===46&&!c)c=!0;else if(a===101&&!d)c=d=!0,a=this._read(),a!==45&&this._unread(a);else if(a===
120&&i===48&&this.offset-b===2)c=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&&c){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57||45===a&&c);this._unread(a);a=this.keywords;if(a.length>0){b=this.text.substring(b,this.offset);for(c=0;c<a.length;c++)if(this.keywords[c]===b)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(),c;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();c=7;for(a===42&&(c=8);;){for(;a===42;)if(a=this._read(),a===47)return c;if(a===-1)return this._unread(a),c;a=this._read()}}this._unread(a);return 1;case 39:for(c=4;;)switch(a=this._read(),a){case 39:return c;
case 13:case 10:case -1:return this._unread(a),c;case 92:switch(a=this._read(),a){case 10:c=5;break;case 13:c=5,a=this._read(),a!==10&&this._unread(a)}}break;case 34:for(c=4;;)switch(a=this._read(),a){case 34:return c;case 13:case 10:case -1:return this._unread(a),c;case 92:switch(a=this._read(),a){case 10:c=5;break;case 13:c=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}};j.prototype=new k(null);j.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 k(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}}};g.prototype=new k(null);g.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={getClassNameForToken:function(c){switch(c){case "singleLineComment":return a.styleClass;case "multiLineComment":return i.styleClass;case "docComment":return m.styleClass;case "docHtmlComment":return o.styleClass;case "tasktag":return q.styleClass;case "doctag":return u.styleClass;
case "string":return l.styleClass;case "number":return s.styleClass;case "keyword":return n.styleClass;case "space":return y.styleClass;case "tab":return t.styleClass;case "caretLine":return v.styleClass;case "rulerStyle":return"ruler";case "annotationsStyle":return;case "rulerFolding":return;case "rulerOverview":return"ruler.overview";case "rulerLines":return;case "rulerLinesEven":return"rulerLines.even";case "rulerLinesOdd":return"rulerLines.odd"}return null},destroy:function(){var a=this.view;
if(a){var c=a.getModel();c.getBaseModel&&(c=c.getBaseModel());c.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,c,b,d,e){var i;d===void 0&&(d=-1);if(e===void 0)e=a.length;for(;e-d>1;)if(i=Math.floor((e+d)/2),c<=a[i].start)e=i;else if(b&&c<a[i].end){e=i;break}else d=i;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 c=this.annotationModel;if(c){c.removeAnnotations(h.AnnotationType.ANNOTATION_FOLDING);for(var b=[],d=a.getBaseModel(),e=this.comments,i=0;i<e.length;i++){var f=e[i];(f=this._createFoldingAnnotation(a,d,f.start,f.end))&&b.push(f)}c.replaceAnnotations(null,b)}}}},_createFoldingAnnotation:function(a,c,b,d){var e=c.getLineAtOffset(b),c=c.getLineAtOffset(d);
return e===c?null:new (h.AnnotationType.getType(h.AnnotationType.ANNOTATION_FOLDING))(b,d,a)},_computeTasks:function(a,c,b){if(this.detectTasks){var d=this.annotationModel;if(d){var e=this.view.getModel(),i=e;e.getBaseModel&&(i=e.getBaseModel());for(var f=d.getAnnotations(c,b),e=[],g=h.AnnotationType.ANNOTATION_TASK;f.hasNext();){var m=f.next();m.type===g&&e.push(m)}f=[];m=this._commentScanner;m.setText(i.getText(c,b));for(var j;j=m.nextToken();){var n=m.getStartOffset()+c;j===14&&(j=i.getLineEnd(i.getLineAtOffset(n)),
a!==6&&(j=Math.min(j,b-this.commentEnd.length)),f.push(h.AnnotationType.createAnnotation(g,n,j,i.getText(n,j))))}d.replaceAnnotations(e,f)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var c=this.view,b=c.getModel(),c=c.getSelection();if(c.start===c.end&&b.getLineAtOffset(c.start)===a)return v}return null},_getStyles:function(a,c,b){a.getBaseModel&&(b=a.mapOffset(b));for(var d=b+c.length,e=[],f=b,g=this.comments,h=this._binarySearch(g,b,!0);h<g.length;h++){if(g[h].start>=d)break;var j=
g[h].start,n=g[h].end;f<j&&this._parse(c.substring(f-b,j-b),f,e);var k=g[h].type,o;switch(k){case 8:o=m;break;case 7:o=i;break;case 5:o=l}f=Math.max(f,j);j=Math.min(d,n);(k===8||k===7)&&(this.whitespacesVisible||this.detectHyperlinks)?this._parseComment(c.substring(f-b,j-b),f,e,o,k):k===5&&this.whitespacesVisible?this._parseString(c.substring(f-b,j-b),f,e,l):e.push({start:f,end:j,style:o});f=n}f<d&&this._parse(c.substring(f-b,d-b),f,e);if(a.getBaseModel)for(c=0;c<e.length;c++)b=e[c].end-e[c].start,
e[c].start=a.mapOffset(e[c].start,!0),e[c].end=e[c].start+b;return e},_parse:function(c,b,d){var e=this._scanner;for(e.setText(c);c=e.nextToken();){var f=e.getStartOffset()+b,g=null;switch(c){case 2:g=n;break;case 3:g=s;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(e.getData(),f,d,l);continue}else g=l;break;case 8:this._parseComment(e.getData(),f,d,m,c);continue;case 6:this._parseComment(e.getData(),f,d,a,c);continue;case 7:this._parseComment(e.getData(),f,d,i,c);continue;case 10:this.whitespacesVisible&&
(g=t);break;case 11:this.whitespacesVisible&&(g=y)}d.push({start:f,end:e.getOffset()+b,style:g})}},_parseComment:function(a,c,b,d,e){var i=this._commentScanner;i.setText(a);for(i.setType(e);a=i.nextToken();){var e=i.getStartOffset()+c,f=d;switch(a){case 10:this.whitespacesVisible&&(f=t);break;case 11:this.whitespacesVisible&&(f=y);break;case 12:f=o;break;case 13:f=u;break;case 14:f=q;break;default:this.detectHyperlinks&&(f=this._detectHyperlinks(i.getData(),e,b,f))}f&&b.push({start:e,end:i.getOffset()+
c,style:f})}},_parseString:function(a,c,b,d){var e=this._whitespaceScanner;for(e.setText(a);a=e.nextToken();){var i=e.getStartOffset()+c,f=d;switch(a){case 10:this.whitespacesVisible&&(f=t);break;case 11:this.whitespacesVisible&&(f=y)}f&&b.push({start:i,end:e.getOffset()+c,style:f})}},_detectHyperlinks:function(a,c,b,d){var e=null,i;if((i=a.indexOf("://"))>0){for(var e=a,f=i;f>0;){i=e.charCodeAt(f-1);if(!(97<=i&&i<=122||65<=i&&i<=90||45===i||48<=i&&i<=57))break;f--}if(f>0&&(i="\"\"''(){}[]<>".indexOf(e.substring(f-
1,f)),i!==-1&&(i&1)===0&&(i=e.lastIndexOf("\"\"''(){}[]<>".substring(i+1,i+2)))!==-1)){var g=i;i=this._clone(d);i.tagName="A";i.attributes={href:e.substring(f,g)};b.push({start:c,end:c+f,style:d});b.push({start:c+f,end:c+g,style:i});b.push({start:c+g,end:c+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?(i=this._clone(d),i.tagName="A",i.attributes={href:e},i):d},_clone:function(a){if(!a)return a;
var c={},b;for(b in a)a.hasOwnProperty(b)&&(c[b]=a[b]);return c},_findComments:function(a,c){var c=c||0,b=this._firstScanner,d;b.setText(a);for(var e=[];d=b.nextToken();)(d===7||d===8||d===5)&&e.push({start:b.getStartOffset()+c,end:b.getOffset()+c,type:d}),(d===6||d===7||d===8)&&this._computeTasks(d,b.getStartOffset()+c,b.getOffset()+c);return e},_findMatchingBracket:function(a,c){var b="{}()[]<>",d=a.getText(c,c+1),e=b.indexOf(d,0);if(e===-1)return-1;var i;i=e&1?b.substring(e-1,e):b.substring(e+
1,e+2);for(var f=a.getLineAtOffset(c),b=a.getLine(f),g=a.getLineStart(f),h=a.getLineEnd(f),b=this._findBrackets(d,i,b,g,g,h),h=0;h<b.length;h++)if(g=b[h]>=0?1:-1,b[h]*g-1===c){var m=1;if(e&1){for(h--;h>=0;h--)if(g=b[h]>=0?1:-1,m+=g,m===0)return b[h]*g-1;for(f-=1;f>=0;){b=a.getLine(f);g=a.getLineStart(f);h=a.getLineEnd(f);b=this._findBrackets(d,i,b,g,g,h);for(e=b.length-1;e>=0;e--)if(g=b[e]>=0?1:-1,m+=g,m===0)return b[e]*g-1;f--}}else{for(h++;h<b.length;h++)if(g=b[h]>=0?1:-1,m+=g,m===0)return b[h]*
g-1;f+=1;for(e=a.getLineCount();f<e;){b=a.getLine(f);g=a.getLineStart(f);h=a.getLineEnd(f);b=this._findBrackets(d,i,b,g,g,h);for(h=0;h<b.length;h++)if(g=b[h]>=0?1:-1,m+=g,m===0)return b[h]*g-1;f++}}break}return-1},_findBrackets:function(a,c,b,d,e,i){for(var f=[],a=a.charCodeAt(0),c=c.charCodeAt(0),g=e,h=this._scanner,m,j=this.comments,n=this._binarySearch(j,e,!0);n<j.length;n++){if(j[n].start>=i)break;m=j[n].start;var k=j[n].end;if(g<m)for(h.setText(b.substring(g-e,m-e));m=h.nextToken();)m===a?f.push(h.getStartOffset()+
g-e+d+1):m===c&&f.push(-(h.getStartOffset()+g-e+d+1));g=k}if(g<i)for(h.setText(b.substring(g-e,i-e));m=h.nextToken();)m===a?f.push(h.getStartOffset()+g-e+d+1):m===c&&f.push(-(h.getStartOffset()+g-e+d+1));return f},_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 c=a.oldValue,b=a.newValue,d=this.view,a=d.getModel(),e;if(this.highlightCaretLine){var i=
a.getLineAtOffset(c.start);e=a.getLineAtOffset(b.start);var f=b.start===b.end,c=c.start===c.end;i===e&&c&&f||(c&&d.redrawLines(i,i+1),(i!==e||!c)&&f&&d.redrawLines(e,e+1))}if(this.annotationModel){var c=this._bracketAnnotations,g,m;if(b.start===b.end&&(m=d.getCaretOffset())>0)m-=1,a.getBaseModel&&(m=a.mapOffset(m),a=a.getBaseModel()),a=this._findMatchingBracket(a,m),a!==-1&&(g=[h.AnnotationType.createAnnotation(h.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),h.AnnotationType.createAnnotation(h.AnnotationType.ANNOTATION_CURRENT_BRACKET,
m,m+1)]);this._bracketAnnotations=g;this.annotationModel.replaceAnnotations(c,g)}},_onMouseDown:function(a){if(a.clickCount===2){var c=this.view,b=c.getModel(),d=c.getOffsetAtLocation(a.x,a.y);if(d>0){var e=d-1,i=b;b.getBaseModel&&(e=b.mapOffset(e),i=b.getBaseModel());e=this._findMatchingBracket(i,e);e!==-1&&(a.preventDefault(),a=e,b.getBaseModel&&(a=b.mapOffset(a,!0)),d>a&&(d--,a++),c.setSelection(a,d))}}},_onModelChanged:function(a){var c=a.start,b=a.removedCharCount,d=a.addedCharCount-b,e=this.view,
a=e.getModel(),i=a.getBaseModel?a.getBaseModel():a,b=c+b,f=i.getCharCount(),g=this.comments.length,m=i.getLineStart(i.getLineAtOffset(c)),j=this._binarySearch(this.comments,m,!0),n=this._binarySearch(this.comments,b,!1,j-1,g);j<g&&this.comments[j].start<=m&&m<this.comments[j].end?(m=this.comments[j].start,m>c&&(m+=d)):m=j===g&&g>0&&f-d===this.comments[g-1].end?this.comments[g-1].start:m;var k;n<g?(k=this.comments[n].end,k>c&&(k+=d),n+=1):(n=g,k=f);for(var l,f=this._findComments(i.getText(m,k),m),
g=j;g<this.comments.length;g++)l=this.comments[g],l.start>c&&(l.start+=d),l.start>c&&(l.end+=d);var o=n-j!==f.length;if(!o)for(g=0;g<f.length;g++){l=this.comments[j+g];var v=f[g];if(l.start!==v.start||l.end!==v.end||l.type!==v.type){o=!0;break}}g=[j,n-j].concat(f);Array.prototype.splice.apply(this.comments,g);o&&(g=m,l=k,a!==i&&(g=a.mapOffset(g,!0),l=a.mapOffset(l,!0)),e.redrawRange(g,l));if(this.foldingEnabled&&i!==a&&this.annotationModel){e=this.annotationModel;j=e.getAnnotations(m,k);m=[];for(k=
[];j.hasNext();)if(l=j.next(),l.type===h.AnnotationType.ANNOTATION_FOLDING){k.push(l);for(g=0;g<f.length;g++)if(l.start===f[g].start&&l.end===f[g].end)break;g===f.length?(m.push(l),l.expand()):(g=l.start,n=l.end,g>c&&(g-=d),n>c&&(n-=d),g<=c&&c<n&&g<=b&&b<n&&(g=i.getLineAtOffset(l.start),n=i.getLineAtOffset(l.end),g!==n?l.expanded||(l.expand(),e.modifyAnnotation(l)):e.removeAnnotation(l)))}c=[];for(g=0;g<f.length;g++){l=f[g];for(d=0;d<k.length;d++)if(k[d].start===l.start&&k[d].end===l.end)break;d===
k.length&&(l=this._createFoldingAnnotation(a,i,l.start,l.end))&&c.push(l)}e.replaceAnnotations(m,c)}}};return{TextStyler:f}});
define("orion/editor/textMateStyler",["orion/editor/regex"],function(h){function k(c,a){var b=a.textView._parent.ownerDocument,d=a._stylesheet=a.util.createElement(b,"style");d.appendChild(b.createTextNode(a._styleSheet(c,"",a.util)));(b.getElementsByTagName("head")[0]||b.documentElement).appendChild(d);a.textView.update(!0)}function j(c,a){var b,d=this;c.getPreferences("/settings",2).then(function(c){if(c.get("JavaScript Editor")!==void 0&&(b=JSON.parse(c.get("JavaScript Editor")))){if(d._stylesheet)d._stylesheet.parentNode.removeChild(d._stylesheet),
d._stylesheet=null;d._update(b,d,a)}})}function b(c,a){for(var b=[],d=0;d<c.length;d++)b[c[d].element]=c[d].value;d=[];d.push("");var e=b.fontFamily,e=e==="sans serif"?'"Menlo", "Consolas", "Vera Mono", "monospace"':"monospace";d.push(a+" .textviewContainer {");d.push("\u0008ackground-color:"+b.background+";");d.push("\tfont-family: "+e+";");d.push("\tfont-size: "+b.fontSize+";");d.push("\tmin-width: 50px;");d.push("\tmin-height: 50px;");d.push("\tcolor: "+b.text+";");d.push("}");d.push(a+" {");d.push("\tfont-family: "+
e+";");d.push("\tfont-size: "+b.fontSize+";");d.push("\tcolor: "+b.text+";");d.push("}");d.push(a+" .textview {");d.push("\tbackground-color: "+b.background+";");d.push("}");d.push(a+".ruler.annotations{");d.push("\tbackground-color: white;");d.push("}");d.push(a+" .ruler {");d.push("\tbackground-color: "+b.annotationRuler+";");d.push("}");d.push(a+" .rulerLines {");d.push("\tcolor: "+b.lineNumber+";");d.push("\tbackground-color: "+b.annotationRuler+";");d.push("}");d.push(a+" .rulerLines.even {");
d.push("\tcolor: "+b.lineNumber+";");d.push("\tbackground-color: "+b.annotationRuler+";");d.push("}");d.push(a+" .rulerLines.odd {");d.push("\tcolor: "+b.lineNumber+";");d.push("\tbackground-color: "+b.annotationRuler+";");d.push("}");d.push(a+" .annotationLine.currentLine {");d.push("\tbackground-color: "+b.currentLine+";");d.push("}");d.push(a+" .entity-name-tag {");d.push("color: "+b.keyword+";");d.push("}");return d.join("\n")}function g(c){var a;if(c instanceof Array){a=Array(c.length);for(var b=
0;b<c.length;b++)a[b]=g(c[b])}else for(b in a={},c)if(Object.prototype.hasOwnProperty.call(c,b)){var d=c[b];a[b]=typeof d==="object"&&d!==null?g(d):d}return a}function f(c,a,d,e,f){this.initialize(c,e);this.grammar=g(a);this.externalGrammars=d?g(d):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar);this._updateStylesheet=j;this._update=k;this._styleSheet=b;this.util=f}var e,d={unsupported:[{regex:/\(\?[ims\-]:/,func:function(){return"option on/off for subexp"}},
{regex:/\(\?<([=!])/,func:function(c){return c[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(c){function a(a,c){throw Error('Unsupported regex feature "'+a+'": "'+c[0]+'" at index: '+c.index+" in "+c.input);}var b="",e,c=d.processGlobalFlag("x",c,function(a){for(var c="",b=!1,d=a.length,e=0;e<d;){var i=a.charAt(e);if(!b&&i==="#")for(;e<d&&i!=="\r"&&i!=="\n";)i=a.charAt(++e);else if(!b&&/\s/.test(i))for(;e<d&&/\s/.test(i);)i=
a.charAt(++e);else i==="\\"?(c+=i,/\s/.test(a.charAt(e+1))||(c+=a.charAt(e+1),e+=1)):(i==="["?b=!0:i==="]"&&(b=!1),c+=i),e+=1}return c}),c=d.processGlobalFlag("i",c,function(a){b+="i";return a});for(e=0;e<this.unsupported.length;e++){var f;(f=this.unsupported[e].regex.exec(c))&&a(this.unsupported[e].func(f),f)}return RegExp(c,b)},processGlobalFlag:function(c,a,b){function d(a,c){for(var b=0,e=a.length,i=-1,f=c;f<e&&i===-1;f++)switch(a.charAt(f)){case "\\":f++;break;case "(":b++;break;case ")":b--,
b===0&&(i=f)}return i}var e="(?"+c+")",c="(?"+c+":";if(a.substring(0,e.length)===e)return b(a.substring(e.length));else if(a.substring(0,c.length)===c){e=d(a,0);if(e<a.length-1)throw Error("Only a "+c+") group that encloses the entire regex is supported in: "+a);return b(a.substring(c.length,e))}return a},hasBackReference:function(c){return/\\\d+/.test(c.source)},getSubstitutedRegex:function(c,a,b){for(var b=typeof b==="undefined"?!0:!1,c=c.source.split(/(\\\d+)/g),d=[],e=0;e<c.length;e++){var f=
c[e],g=/\\(\d+)/.exec(f);g?(f=a[g[1]]||"",d.push(b?h.escape(f):f)):d.push(f)}return RegExp(d.join(""))},groupify:function(c,a){for(var b=c.source,d=b.length,e=[],f=0,g=[],h=1,j=1,n=[],k={},t={},v=0;v<d;v++){var w=e[e.length-1],A=b.charAt(v);switch(A){case "(":if(w===4)e.pop(),n.push(")"),g[g.length-1].end=v;var x=v+2<d?b.charAt(v+1)+""+b.charAt(v+2):null;if(x==="?:"||x==="?="||x==="?!"){var p;x==="?:"?p=1:(p=3,f++);e.push(p);g.push({start:v,end:-1,type:p});n.push(A);n.push(x);v+=x.length}else e.push(2),
g.push({start:v,end:-1,type:2,oldNum:h,num:j}),n.push(A),f===0&&(t[j]=null),k[h]=j,h++,j++;break;case ")":w=e.pop();w===3&&f--;g[g.length-1].end=v;n.push(A);break;case "*":case "+":case "?":case "}":var r=A,C=b.charAt(v-1),x=v-1;if(A==="}"){for(p=v-1;b.charAt(p)!=="{"&&p>=0;p--);C=b.charAt(p-1);x=p-1;r=b.substring(p,v+1)}p=g[g.length-1];if(C===")"&&(p.type===2||p.type===4)){n.splice(p.start,0,"(");n.push(r);n.push(")");A={start:p.start,end:n.length-1,type:4,num:p.num};for(C=0;C<g.length;C++)if(w=
g[C],(w.type===2||w.type===4)&&w.start>=p.start&&w.end<=x)if(w.start+=1,w.end+=1,w.num+=1,w.type===2)k[w.oldNum]=w.num;g.push(A);j++;break}default:A!=="|"&&w!==2&&w!==4&&f===0&&(e.push(4),g.push({start:v,end:-1,type:4,num:j}),n.push("("),t[j]=null,j++),n.push(A),A==="\\"&&(A=b.charAt(v+1),n.push(A),v+=1)}}for(;e.length;)e.pop(),n.push(")");var b=RegExp(n.join("")),d={},a=a||k,D;for(D in a)a.hasOwnProperty(D)&&(d[D]="\\"+a[D]);b=this.getSubstitutedRegex(b,d,!1);return[b,k,t]},complexCaptures:function(c){if(!c)return!1;
for(var a in c)if(c.hasOwnProperty(a)&&a!=="0")return!0;return!1}};f.prototype={initialize:function(c,a,b){this.textView=c;this.textView.stylerOptions=this;var d=this;this.textView&&a&&a.startup().then(function(a){e=a.preferences;d.preferences=e;d._updateStylesheet(e,b);d.storageKey=e.listenForChangedSettings(d._listener.onStorage)});this._listener={onModelChanged:function(a){d.onModelChanged(a)},onDestroy:function(a){d.onDestroy(a)},onLineStyle:function(a){d.onLineStyle(a)},onStorage:function(a){d.onStorage(a)}};
c.addEventListener("ModelChanged",this._listener.onModelChanged);c.addEventListener("Destroy",this._listener.onDestroy);c.addEventListener("LineStyle",this._listener.onLineStyle);c.redrawLines()},onDestroy:function(){this.destroy()},onStorage:function(c){c.key===this.storageKey&&this._updateStylesheet(this.preferences)},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged),this.textView.removeEventListener("Destroy",this._listener.onDestroy),
this.textView.removeEventListener("LineStyle",this._listener.onLineStyle),this.textView=null;this._listener=this._tree=this._styles=this.grammar=null},preprocess:function(c){for(c=[c];c.length!==0;){var a=c.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&&c.push(a._resolvedRule),a.patterns)for(var b=0;b<a.patterns.length;b++)c.push(a.patterns[b])}},addStyles:function(c){if(c&&!this._styles[c]){this._styles[c]=[];for(var a=c.split("."),b=0;b<a.length;b++)this._styles[c].push(a.slice(0,b+1).join("-"))}},addStylesForCaptures:function(c){for(var a in c)c.hasOwnProperty(a)&&this.addStyles(c[a].name)},ContainerRule:function(){function c(a){this.rule=a;this.subrules=a.patterns}c.prototype.valueOf=function(){return"aa"};return c}(),BeginEndRule:function(){function c(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 c=d.complexCaptures(a.captures),a=d.complexCaptures(a.beginCaptures)||d.complexCaptures(a.endCaptures);if(this.isComplex=c||a)c=d.groupify(this.beginRegex),this.beginRegex=c[0],this.beginOld2New=c[1],this.beginConsuming=c[2],c=d.groupify(this.endRegex,this.beginOld2New),this.endRegex=c[0],this.endOld2New=c[1],this.endConsuming=c[2]}c.prototype.valueOf=
function(){return this.beginRegex};return c}(),MatchRule:function(){function c(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]}c.prototype.valueOf=function(){return this.matchRegex};return c}(),_createTypedRule:function(c){return c.match?new this.MatchRule(c):c.begin?new this.BeginEndRule(c):new this.ContainerRule(c)},_resolve:function(c){var a=c;if(c.include){if(c.begin||
c.end||c.match)throw Error('Unexpected regex pattern in "include" rule '+c.include);c=c.include;if(c.charAt(0)==="#"){if(a=this.grammar.repository&&this.grammar.repository[c.substring(1)],!a)throw Error("Couldn't find included rule "+c+" in grammar repository");}else if(c==="$self")a=this.grammar;else if(c==="$base")throw Error('Include "$base" is not supported');else if(a=this._allGrammars[c],!a)for(var b=0;b<this.externalGrammars.length;b++){var d=this.externalGrammars[b];if(d.scopeName===c){this.preprocess(d);
a=this._allGrammars[c]=d;break}}}return a},ContainerNode:function(){function c(a,c){this.parent=a;this.rule=c;this.children=[];this.end=this.start=null}c.prototype.addChild=function(a){this.children.push(a)};c.prototype.valueOf=function(){var a=this.rule;return"ContainerNode { "+(a.include||"")+" "+(a.name||"")+(a.comment||"")+"}"};return c}(),BeginEndNode:function(){function c(a,c,b){this.parent=a;this.rule=c;this.children=[];this.setStart(b);this.endMatch=this.end=null;this.endRegexSubstituted=
c.endRegexHasBackRef?d.getSubstitutedRegex(c.endRegex,b):null}c.prototype.addChild=function(a){this.children.push(a)};c.prototype.getIndexInParent=function(){return this.parent?this.parent.children.indexOf(this):-1};c.prototype.setStart=function(a){this.start=a.index;this.beginMatch=a};c.prototype.setEnd=function(a){a&&typeof a==="object"?(this.endMatch=a,this.end=a.index+a[0].length):(this.endMatch=null,this.end=a)};c.prototype.shiftStart=function(a){this.start+=a;this.beginMatch.index+=a};c.prototype.shiftEnd=
function(a){this.end+=a;this.endMatch&&(this.endMatch.index+=a)};c.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+"}"};return c}(),push:function(c,a){if(a)for(var b=a.length;b>0;)c.push(a[--b])},exec:function(c,a,b){(a=c.exec(a))&&(a.index+=b);c.lastIndex=0;return a},afterMatch:function(c){return c.index+c[0].length},getEndMatch:function(c,a,b){if(c instanceof this.BeginEndNode){var d=c.rule,c=c.endRegexSubstituted||d.endRegex;return!c?null:this.exec(c,
a,b)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,!1,0)},onModelChanged:function(c){var a=c.addedCharCount,b=c.removedCharCount,c=c.start;if(this._tree){var d=this.textView.getModel(),e=d.getCharCount(),d=d.getLineEnd(d.getLineAtOffset(c)-1),f=this.getFirstDamaged(d,d),d=d===-1?0:d,a=f?this.parse(f,!0,d,c,a,b):e;this.textView.redrawRange(d,a)}else this.initialParse()},getFirstDamaged:function(c,
a){if(c<0)return this._tree;for(var b=[this._tree],d=null;b.length;){var e=b.pop();if(!e.parent||this.isDamaged(e,c,a)){e instanceof this.BeginEndNode&&(d=e);for(var f=0;f<e.children.length;f++)b.push(e.children[f])}}return d||this._tree},isDamaged:function(c,a,b){return c.start<=b&&c.end>a},parse:function(c,a,b,d,e,f){var g=this.textView.getModel(),h=g.getLineStart(g.getLineCount()-1),j=g.getCharCount(),n=this.getInitialExpected(c,b),k=-1;if(a)c.repaired=!0,c.endNeedsUpdate=!0,k=(k=c.children[c.children.length-
1])?g.getLineEnd(g.getLineAtOffset(k.end+(e-f))):-1,d=g.getLineEnd(g.getLineAtOffset(d+f)),k=Math.max(k,d);for(var k=k===-1?j:k,d=n,t=c,v=!1,w=b,A=-1;t&&(!a||w<k);){var x=this.getNextMatch(g,t,w);x||(w=w>=h?j:g.getLineStart(g.getLineAtOffset(w)+1));var p=x&&x.match,r=x&&x.rule,C=x&&x.isEnd;if(x&&x.isSub){if(w=this.afterMatch(p),r instanceof this.BeginEndRule)v=!0,a&&r===d.rule&&t===d.parent?(t=d,t.setStart(p),t.repaired=!0,t.endNeedsUpdate=!0,d=this.getNextExpected(d,"begin")):(a&&(this.prune(t,d),
a=!1),p=new this.BeginEndNode(t,r,p),t.addChild(p),t=p)}else if(C||w===j){if(t instanceof this.BeginEndNode)p?(v=!0,A=Math.max(A,t.end),t.setEnd(p),w=this.afterMatch(p),a&&t===d&&t.parent===d.parent?(t.repaired=!0,delete t.endNeedsUpdate,d=this.getNextExpected(d,"end")):a&&(this.prune(t,d),a=!1)):(t.setEnd(j),delete t.endNeedsUpdate);t=t.parent}a&&w>=k&&!v&&(this.prune(c,n),a=!1)}this.removeUnrepairedChildren(c,a,b);this.cleanup(a,c,b,k,j,e,f);return a?Math.max(A,w):w},removeUnrepairedChildren:function(c,
a,b){if(a){for(var a=c.children,d=-1,e=0;e<a.length;e++){var f=a[e];if(!f.repaired&&this.isDamaged(f,b,Number.MAX_VALUE)){d=e;break}}if(d!==-1)c.children.length=d}},cleanup:function(c,a,b,d,e,f,g){if(c){c=f-g;e=this.getIntersecting(d-c+1,e);a=this.getIntersecting(b,d);for(b=0;b<e.length;b++)d=e[b],!d.repaired&&d instanceof this.BeginEndNode&&(d.shiftEnd(c),d.shiftStart(c));for(b=0;b<a.length;b++)d=a[b],d.repaired&&d.endNeedsUpdate&&d.shiftEnd(c),delete d.endNeedsUpdate,delete d.repaired}else{a=this.getIntersecting(b,
d);for(b=0;b<a.length;b++)delete a[b].repaired}},getNextMatch:function(c,a,b,d){var e=c.getLineAtOffset(b),e=c.getLineEnd(e),f=c.getText(b,e),g=[],h=[],c=[],e=[];for(this.push(g,a.rule.subrules);g.length;){var j=g.length?g.pop():null,j=j&&j._resolvedRule._typedRule;if(j instanceof this.ContainerRule&&h.indexOf(j)===-1)h.push(j),this.push(g,j.subrules);else if(!j||!d||j.matchRegex){var k=j&&this.exec(j.matchRegex||j.beginRegex,f,b);k&&(c.push(k),e.push(j))}}g=Number.MAX_VALUE;h=-1;for(j=0;j<c.length;j++)if(k=
c[j],k.index<g)g=k.index,h=j;if(!d&&(b=this.getEndMatch(a,f,b)))if(d=a.rule.applyEndPatternLast,h===-1||b.index<g||!d&&b.index===g)return{isEnd:!0,rule:a.rule,match:b};return h===-1?null:{isSub:!0,rule:e[h],match:c[h]}},getInitialExpected:function(c,a){var b,d;if(c===this._tree)for(b=0;b<c.children.length;b++){if(d=c.children[b],d.start>=a)return d}else if(c instanceof this.BeginEndNode&&c.endMatch){var e=c.endMatch.index;for(b=0;b<c.children.length;b++)if(d=c.children[b],d.start>=a)break;if(d&&d.start<
e)return d}return c},getNextExpected:function(c,a){if(a==="begin"){var b=c.children[0];return b?b:c}else if(a==="end"&&(b=c.parent)){var d=b.children[b.children.indexOf(c)+1];return d?d:b}return null},prune:function(c,a){if(a.parent===c)c.children.length=a.getIndexInParent();else if(c instanceof this.BeginEndNode)c.endMatch=null,c.end=null;if(c.parent)c.parent.children.length=c.getIndexInParent()+1},onLineStyle:function(c){this._tree||this.initialParse();var a=c.lineStart,b=this.textView.getModel(),
d=b.getLineEnd(c.lineIndex),e=b.getLineEnd(b.getLineAtOffset(a)-1),e=this.getFirstDamaged(e,e),a=this.getLineScope(b,e,a,d);c.ranges=this.toStyleRanges(a);c.ranges.sort(function(a,c){return a.start-c.start})},getLineScope:function(c,a,b,d){for(var e=b,f=this.getInitialExpected(a,b),g=[],h=[];a&&e<d;){var j=this.getNextMatch(c,a,e);if(!j)break;var k=j&&j.match,y=j&&j.rule,t=j&&j.isSub,j=j&&j.isEnd;k.index!==e&&h.push({start:e,end:k.index,node:a});if(t)e=this.afterMatch(k),y instanceof this.BeginEndRule?
(this.addBeginScope(g,k,y),a=f,f=this.getNextExpected(f,"begin")):this.addMatchScope(g,k,y);else if(j)e=this.afterMatch(k),this.addEndScope(g,k,y),f=this.getNextExpected(f,"end"),a=a.parent}e<d&&h.push({start:e,end:d,node:a});c=this.getInheritedLineScope(h,b,d);return g.concat(c)},getInheritedLineScope:function(c){for(var a=[],b=0;b<c.length;b++)for(var d=c[b],e=d.node;e;){var f=e.rule.rule,g=f.name;if(f=f.contentName||g){this.addScopeRange(a,d.start,d.end,f);break}e=e.parent}return a},addBeginScope:function(c,
a,b){var d=b.rule;this.addCapturesScope(c,a,d.beginCaptures||d.captures,b.isComplex,b.beginOld2New,b.beginConsuming)},addEndScope:function(c,a,b){var d=b.rule;this.addCapturesScope(c,a,d.endCaptures||d.captures,b.isComplex,b.endOld2New,b.endConsuming)},addMatchScope:function(c,a,b){var d=b.rule,e=d.name;(d=d.captures)?this.addCapturesScope(c,a,d,b.isComplex,b.matchOld2New,b.matchConsuming):this.addScope(c,a,e)},addScope:function(c,a,b){b&&c.push({start:a.index,end:this.afterMatch(a),scope:b})},addScopeRange:function(c,
a,b,d){d&&c.push({start:a,end:b,scope:d})},addCapturesScope:function(c,a,b,d,e,f){if(b)if(d){for(var d={1:0},g=0,h=1;a[h]!==void 0;h++)f[h]!==void 0&&(g+=a[h].length),a[h+1]!==void 0&&(d[h+1]=g);f=a.index;for(g=1;b[g];g++){var h=b[g].name,j=e[g],k=f+d[j];typeof a[j]!=="undefined"&&this.addScopeRange(c,k,k+a[j].length,h)}}else this.addScope(c,a,b[0]&&b[0].name)},getIntersecting:function(c,a){for(var b=[],d=this._tree?[this._tree]:[];d.length;){var e=d.pop(),f=!1;e instanceof this.ContainerNode?f=!0:
this.isDamaged(e,c,a)&&(f=!0,b.push(e));if(f)for(var f=e.children.length,g=0;g<f;g++)d.push(e.children[g])}return b.reverse()},toStyleRanges:function(c){for(var a=[],b=0;b<c.length;b++){var d=c[b],e=this._styles[d.scope];if(!e)throw Error("styles not found for "+d.scope);e=e.join(" ");a.push({start:d.start,end:d.end,style:{styleClass:e}})}return a}};return{RegexUtil:d,TextMateStyler:f}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(h,k){function j(b){return b.getProperty("objectClass").indexOf(g)!==-1&&b.getProperty("type")==="highlighter"}function b(b,d,c){this.initialize(b,d,c);this.lineStyles=[]}var g="orion.edit.highlighter",f=g+" service must be an event emitter";k.AnnotationType.registerType("orion.annotation.highlightError",{title:h.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}});
b.prototype={initialize:function(b,d,c){this.textView=b;this.serviceRegistry=d;this.annotationModel=c;this.services=[];var a=this;this.listener={onModelChanging:function(c){a.onModelChanging(c)},onModelChanged:function(c){a.onModelChanged(c)},onDestroy:function(c){a.onDestroy(c)},onLineStyle:function(c){a.onLineStyle(c)},onStyleReady:function(c){a.onStyleReady(c)},onServiceAdded:function(c){a.onServiceAdded(c.serviceReference,a.serviceRegistry.getService(c.serviceReference))},onServiceRemoved:function(c){a.onServiceRemoved(c.serviceReference,
a.serviceRegistry.getService(c.serviceReference))}};b.addEventListener("ModelChanging",this.listener.onModelChanging);b.addEventListener("ModelChanged",this.listener.onModelChanged);b.addEventListener("Destroy",this.listener.onDestroy);b.addEventListener("LineStyle",this.listener.onLineStyle);d.addEventListener("registered",this.listener.onServiceAdded);d.addEventListener("unregistering",this.listener.onServiceRemoved);b=d.getServiceReferences(g);for(c=0;c<b.length;c++){var i=b[c];j(i)&&this.addServiceListener(d.getService(i))}},
onDestroy:function(){this.destroy()},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanging",this.listener.onModelChanging),this.textView.removeEventListener("ModelChanged",this.listener.onModelChanged),this.textView.removeEventListener("Destroy",this.listener.onDestroy),this.textView.removeEventListener("LineStyle",this.listener.onLineStyle),this.textView=null;if(this.services){for(var b=0;b<this.services.length;b++)this.removeServiceListener(this.services[b]);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(b){this.startLine=this.textView.getModel().getLineAtOffset(b.start)},onModelChanged:function(b){var d=this.startLine;(b.addedLineCount||b.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[d,b.removedLineCount].concat(this._getEmptyStyle(b.addedLineCount)))},
onStyleReady:function(b){var d=b.lineStyles||b.style,b=Number.MAX_VALUE,c=-1,a=this.textView.getModel(),i;for(i in d)d.hasOwnProperty(i)&&(this.lineStyles[i]=d[i],b=Math.min(b,i),c=Math.max(c,i));b=Math.max(b,0);c=Math.min(c,a.getLineCount());if(d=this.annotationModel){for(var f=d.getAnnotations(a.getLineStart(b),a.getLineEnd(c)),g=[];f.hasNext();){var h=f.next();h.type==="orion.annotation.highlightError"&&g.push(h)}f=[];for(h=b;h<=c;h++){i=h;var j=this.lineStyles[i],j=j&&j.errors;i=a.getLineStart(i);
if(j)for(var l=0;l<j.length;l++){var s=j[l];f.push(k.AnnotationType.createAnnotation("orion.annotation.highlightError",s.start+i,s.end+i))}}d.replaceAnnotations(g,f)}this.textView.redrawLines(b,c+1)},onLineStyle:function(b){function d(a,c){for(var b=a.length,d=[],e=0;e<b;e++){var f=a[e];d.push({start:f.start+c,end:f.end+c,style:f.style})}return d}var c=this.lineStyles[b.lineIndex];if(c)if(c.ranges)b.ranges=d(c.ranges,b.lineStart);else if(c.style)b.style=c.style},_getEmptyStyle:function(b){for(var d=
[],c=0;c<b;c++)d.push(null);return d},setContentType:function(b){this.contentType=b;if(this.services)for(b=0;b<this.services.length;b++){var d=this.services[b];if(d.setContentType){var c=this.serviceRegistry.getService("orion.page.progress");c?c.progress(d.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):d.setContentType(this.contentType)}}},onServiceAdded:function(b,d){j(b)&&this.addServiceListener(d)},onServiceRemoved:function(b,
d){this.services.indexOf(d)!==-1&&this.removeServiceListener(d)},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(f))},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(f))}};return b});
define("examples/editor/textStylerOptions",["orion/bootstrap","orion/editor/util"],function(h,k){function j(g){this._styler=g;this._view=this._styler.view;this._view.stylerOptions=this;var f=this;this._listener={onStorage:function(b){f._onStorage(b)}};var e=this;this._view&&h.startup().then(function(d){b=d.preferences;e.preferences=b;e._updateStylesheet(b);e.storageKey=b.listenForChangedSettings(e._listener.onStorage)})}var b;j.prototype={_getSetting:function(b,f,e){for(var d,c=0;c<b.length;c++)if(b[c].label===
f)for(var a=0;a<b[c].data.length;a++)if(b[c].data[a].label===e){d=b[c].data[a].value;break}return d},_styleSheet:function(b,f){function e(c,b){var e=i.getClassNameForToken(c);if(e){var g=d[b];a.push("."+f+" ."+e+" {");a.push("\tcolor: "+g+";");a.push("}")}}for(var d=[],c=0;c<b.length;c++)d[b[c].element]=b[c].value;var a=[];a.push("");c=d.fontFamily;c=c==="sans serif"?'"Menlo", "Consolas", "Vera Mono", "monospace"':"monospace";a.push("."+f+" {");a.push("\tfont-family: "+c+";");a.push("\tfont-size: "+
d.fontSize+";");a.push("\tcolor: "+d.text+";");a.push("}");a.push("."+f+" .textview {");a.push("\tbackground-color: "+d.background+";");a.push("}");a.push("."+f+".ruler.annotations{");a.push("\tbackground-color: red;");a.push("}");a.push("."+f+" .ruler {");a.push("\tbackground-color: "+d.annotationRuler+";");a.push("}");a.push("."+f+" .rulerLines {");a.push("\tcolor: "+d.lineNumber+";");a.push("\tbackground-color: "+d.annotationRuler+";");a.push("}");a.push("."+f+" .rulerLines.even {");a.push("\tcolor: "+
d.lineNumber+";");a.push("\tbackground-color: "+d.annotationRuler+";");a.push("}");a.push("."+f+" .rulerLines.odd {");a.push("\tcolor: "+d.lineNumber+";");a.push("\tbackground-color: "+d.annotationRuler+";");a.push("}");a.push("."+f+" .annotationLine.currentLine {");a.push("\tbackground-color: "+d.currentLine+";");a.push("}");var i=this._styler;i.getClassNameForToken&&(e("keyword","keyword"),e("string","string"),e("singleLineComment","comment"),e("multiLineComment","comment"),e("docComment","comment"),
e("docHtmlComment","comment"));return a.join("\n")},_onStorage:function(b){b.key===this.storageKey&&this._updateStylesheet(this.preferences)},_update:function(b,f,e){if(b){if(f._stylesheet)f._stylesheet.parentNode.removeChild(f._stylesheet),f._stylesheet=null;var d=f._view,c=d.getOptions("parent").ownerDocument,a=f._stylesheet=k.createElement(c,"style");a.appendChild(c.createTextNode(f._styleSheet(b,"userTheme",e)));(c.getElementsByTagName("head")[0]||c.documentElement).appendChild(a);b={themeClass:null};
d.getOptions(b);(f=b.themeClass)?((f=f.replace("userTheme",""))&&(f+=" "),f+="userTheme"):f="userTheme";b.themeClass=f;d.setOptions(b);d.update(!0)}},_updateStylesheet:function(b,f){var e,d=this;b.getPreferences("/settings",2).then(function(c){c.get("JavaScript Editor")!==void 0&&(e=JSON.parse(c.get("JavaScript Editor")),d._update(e,d,f))})}};return{TextStylerOptions:j}});
define("orion/highlight","examples/editor/textStyler,orion/editor/textMateStyler,orion/editor/AsyncStyler,examples/editor/textStylerOptions,orion/bootstrap,orion/editor/util,orion/Deferred".split(","),function(h,k,j,b,g,f,e){function d(a,c,d,o,q,u,l){function s(a,b){var f=a.getProperty("contentType"),g=a.getProperty("fileTypes");if(f)return c.isSomeExtensionOf(d,f).then(function(c){return c?a:null});else if(b&&g&&g.indexOf(b)!==-1)return f=new e,f.resolve(a),f;return null}var n=function(a){var c=
null;switch(a&&a.id){case "application/javascript":case "application/json":c=new h.TextStyler(o,"js",q);break;case "text/x-java-source":c=new h.TextStyler(o,"java",q);break;case "text/css":c=new h.TextStyler(o,"css",q)}c&&new b.TextStylerOptions(c);return c}(d);if(n)return u=new e,u.resolve(n),u;for(var n=u&&u.split(".").pop().toLowerCase(),u=a.getServiceReferences("orion.edit.highlighter"),y=[],t=[],v=0;v<u.length;v++){var w=u[v];w.getProperty("type")==="grammar"&&y.push(w.getProperty("grammar"));
(w=s(w,n))&&t.push(w)}return e.all(t,function(a){return{_error:a}}).then(function(c){for(var b,e=c.length-1;e>=0;e--){var i=c[e];if(i&&!i._error&&(l||i.getProperty("type")!=="highlighter")){b=i;break}}var h;if(b)if(c=b.getProperty("type"),c==="highlighter")h=new j(o,a,q),h.setContentType(d);else if(c==="grammar"||typeof c==="undefined")b=b.getProperty("grammar"),h=new k.TextMateStyler(o,b,y,g,f);return h})}function c(a){this.serviceRegistry=a;this.styler=null}c.prototype={setup:function(a,c,b,e,f){f=
typeof f==="undefined"?!0:f;if(this.styler)this.styler.destroy&&this.styler.destroy(),this.styler=null;var g=this;return d(this.serviceRegistry,this.serviceRegistry.getService("orion.core.contenttypes"),a,c,b,e,f).then(function(a){return g.styler=a})},getStyler:function(){return this.styler}};return{createStyler:d,SyntaxHighlighter:c}});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(h,k,j,b){var g={},f,e,d,c,a,i,m,o,q,u,l,s,n,y,t,v;g.DiffTreeNavigator=function(){function g(a,c,b,d,e,i){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,c,b,d,e,i)}f="orion.annotation.diff.addedBlock";e="orion.annotation.diff.currentAddedBlock";d="orion.annotation.diff.deletedBlock";c="orion.annotation.diff.currentDeletedBlock";
a="orion.annotation.diff.blockTop";i="orion.annotation.diff.currentBlockTop";m="orion.annotation.diff.blockConflict";o="orion.annotation.diff.currentBlockConflict";q="orion.annotation.diff.addedWord";u="orion.annotation.diff.currentAddedWord";l="orion.annotation.diff.deletedWord";s="orion.annotation.diff.currentDeletedWord";n="orion.annotation.diff.emptyDeletedWordLeft";y="orion.annotation.diff.emptyDeletedWordRight";t="orion.annotation.diff.emptyAddedWordLeft";v="orion.annotation.diff.emptyAddedWordRight";
j.AnnotationType.registerType(f,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});j.AnnotationType.registerType(e,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});j.AnnotationType.registerType(d,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});j.AnnotationType.registerType(c,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});j.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
j.AnnotationType.registerType(i,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});j.AnnotationType.registerType(m,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});j.AnnotationType.registerType(o,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});j.AnnotationType.registerType(q,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});j.AnnotationType.registerType(u,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});j.AnnotationType.registerType(l,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});j.AnnotationType.registerType(s,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});j.AnnotationType.registerType(n,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});j.AnnotationType.registerType(y,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
j.AnnotationType.registerType(t,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});j.AnnotationType.registerType(v,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});g.prototype={initAll:function(a,c,b,d,e,i,f){this._charOrWordDiff=a?a:"word";if(c)this._initialized=!0;this.editorWrapper=[{editor:c,diffFeeder:d},{editor:b,diffFeeder:e}];this._curveRuler=f;(this._overviewRuler=i)&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(a){if(a)for(var c=
0;c<this.editorWrapper.length;c++)this.editorWrapper[c].diffFeeder.init(this.editorWrapper[c].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 c=0;c<this.editorWrapper[a].annoTypes.length;c++)this.editorWrapper[a].annoTypes[c].current&&
this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[c].current),this.editorWrapper[a].annoTypes[c].normal&&this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[c].normal)}this._root.children=[];c=this.editorWrapper[0].diffFeeder.getDiffBlocks();if(!c||c.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 d=new b.JSDiffAdapter;for(a=0;a<c.length;a++){var e=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(e);var i=this.generatePairWordAnnotations(e,a,d);if(i)e.children=i}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 h.TreeModelIterator(this._root.children)}},replaceAllAnnotations:function(a,c,b,d,e){if(this.editorWrapper[c].annoTypes)for(var i=0;i<this.editorWrapper[c].annoTypes.length;i++)this.editorWrapper[c].annoTypes[i].type===b&&this.replaceDiffAnnotations(this.editorWrapper[c].editor,e?e:this.editorWrapper[c].annoTypes[i].list,d?this.editorWrapper[c].annoTypes[i].normal:this.editorWrapper[c].annoTypes[i].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,c){this.iterator&&(this.iterator.iterateOnTop(a,c),this.updateCurrentAnnotation(!0))},iterateOnChange:function(a){if(this.iterator){this.iterator.iterate(a);var c=this.iterator.cursor();c.type==="block"&&c.children&&c.children.length>0&&this.iterator.iterate(a);this.updateCurrentAnnotation(!0)}},gotoBlock:function(a,
c){if(this.iterator){if(a<0||a>=this._root.children.length||this._root.children.length===0)a=0;c!==void 0&&c>=0&&this._root.children[a].children&&c<this._root.children[a].children.length?this.iterator.setCursor(this._root.children[a].children[c]):this.iterator.setCursor(this._root.children[a]);this.updateCurrentAnnotation(!1);this._positionDiffBlock()}},_hitDiffAnnotation:function(a,c,b){if(b===this.editorWrapper[a].editor.getTextView()){for(var d=0;d<this._root.children.length;d++){var b=this._root.children[d],
e=a===0?b.oldA:b.newA;if(c>=e.start&&c<=e.end){d=b;if(b.children&&b.children.length>0)for(e=0;e<b.children.length;e++){var i=b.children[e],f=a===0?i.oldA:i.newA;if(c>=f.start&&c<=f.end){d=i;break}}return d}}return null}},gotoChange:function(a,c){for(var b=0;b<this.editorWrapper.length;b++){var d=this._hitDiffAnnotation(b,a,c);if(d)return this.iterator.setCursor(d),this.updateCurrentAnnotation(!1,c),!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 c=this.getFeeder().getDiffBlocks();if(!c||c.length===0)return-1;a>c.length-1&&(a=0);return c[a][1]},replaceDiffAnnotations:function(a,c,b,d){if(c&&b&&(a=a.getAnnotationModel())){for(var e=a.getAnnotations(0,
a.getTextModel().getCharCount()),i=[];d&&e.hasNext();){var f=e.next();f.type===b&&i.push(f)}a.replaceAnnotations(i,c)}},updateCurrentAnnotation:function(a,c){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 b=this.iterator.cursor();if(b){var d,e,i={start:b.oldA.start,end:b.oldA.end},f={start:b.newA.start,end:b.newA.end};b.type==="word"?(d=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(i,
this.editorWrapper[0].editor.getTextView().getModel()),e=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(f,this.editorWrapper[1].editor.getTextView().getModel())):(d=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(b.index),e=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(b.index));d&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (j.AnnotationType.getType(d.current))(i.start,i.end)],d,!0);e&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (j.AnnotationType.getType(e.current))(f.start,
f.end)],e,!0);if(a)this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(b.oldA.start,b.oldA.end,!0),this.editorWrapper[1].editor.setSelection(b.newA.start,b.newA.end,!0),this.autoSelecting=!1;else if(c)this.autoSelecting=!0,c!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(b.oldA.start,b.oldA.end,!0),c!==this.editorWrapper[1].editor.getTextView()&&this.editorWrapper[1].editor.setSelection(b.newA.start,b.newA.end,!0),this.autoSelecting=!1}}},generatePairBlockAnnotations:function(a,
c){var b=this.generateBlockDiffAnnotations(0,c),d=this.generateBlockDiffAnnotations(1,c);return{parent:a,index:c,type:"block",oldA:b,newA:d}},generatePairWordAnnotations:function(a,c,b){var d=this.editorWrapper[0].diffFeeder.getTextOnBlock(c),e=this.editorWrapper[1].diffFeeder.getTextOnBlock(c),c=null,i=0,f=0;if(d&&e&&d.text&&e.text&&d.text.length<=5E3&&e.text.length<=5E3)c=b.adaptCharDiff(d.text,e.text,this._charOrWordDiff==="word"),f=e.start,i=d.start;else return null;b=[];d=[];this.generateWordDiffAnnotations(0,
b,i,c,2,3);this.generateWordDiffAnnotations(1,d,f,c,0,1);c=[];for(i=0;i<b.length;i++)c.push({parent:a,index:i,type:"word",oldA:b[i],newA:d[i]});return c},getAnnoModelList:function(a,c,b){for(var d=0;d<this.editorWrapper[a].annoTypes.length;d++)if(this.editorWrapper[a].annoTypes[d].type===c&&this.editorWrapper[a].annoTypes[d].normal===b)return this.editorWrapper[a].annoTypes[d].list;return null},generateBlockDiffAnnotations:function(a,c){var b=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(c),
d=this.getAnnoModelList(a,"block",b.normal),e=this.editorWrapper[a].diffFeeder.getCharRange(c),b=j.AnnotationType.createAnnotation(b.normal,e.start,e.end);d&&d.push(b);return b},generateWordDiffAnnotations:function(a,c,b,d,e,i){if(d)for(var f=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1}),a=this.getAnnoModelList(a,"word",f.normal),g=0;g<d.length;g++){var h=j.AnnotationType.createAnnotation(f.normal,d[g][e]+b,d[g][i]+b);a.push(h);c.push(h)}},_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,c){var b=a.getLineHeight(),d=a.getClientArea(),b=Math.floor(d.height/b/3);a.setTopIndex(c-b>0?c-b:0)},_positionDiffBlock:function(){var a=this.getCurrentBlockIndex();a<0&&(a=0);var c=this.getFeeder().getDiffBlocks();c.length!==0&&(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),
c[a][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor&&(a=k.lookUpLineIndex(this.getMapper(),0,c[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,c){this.gotoChange(a,c)&&(this._updateOverviewRuler(),this._updateCurveRuler())},nextDiff:function(){this.iterateOnBlock(!0,
!0);this._positionDiffBlock()},prevDiff:function(){this.iterateOnBlock(!1,!0);this._positionDiffBlock()},nextChange:function(){this.iterateOnChange(!0);this._positionDiffBlock()},prevChange:function(){this.iterateOnChange(!1);this._positionDiffBlock()}};return g}();g.DiffBlockFeeder=function(){function a(){}a.prototype={getWordAnnoTypes:function(a){this._mapperColumnIndex===0?a.push({type:"word",current:u,normal:q,list:[]}):a.push({type:"word",current:s,normal:l,list:[]});a.push({type:"word",current:n});
a.push({type:"word",current:y});a.push({type:"word",current:t});a.push({type:"word",current:v})},getCurrentWordAnnoType:function(a,c){return a.start===a.end&&c?this._mapperColumnIndex===0?{current:this._repositionEmptyWord(a,c),normal:q}:{current:this._repositionEmptyWord(a,c),normal:l}:this._mapperColumnIndex===0?{current:u,normal:q}:{current:s,normal:l}},_repositionEmptyWord:function(a,c){var b=c.getLineAtOffset(a.start),d=c.getLineStart(b),e=c.getLineEnd(b);if(d!==e){if(a.start===e)return a.start--,
this._mapperColumnIndex===0?v:y;a.end++}else if(b>0&&(b--,d=c.getLineStart(b),e=c.getLineEnd(b),d!==e))return a.start=e-1,a.end=e,this._mapperColumnIndex===0?v:y;return this._mapperColumnIndex===0?t:n},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 c=this._diffBlocks[a][0],b=c+this._mapper[this._diffBlocks[a][1]][this._mapperColumnIndex]-1,a=this._textModel.getLineStart(c);if(b<c)return{start:a,end:a};c=this._textModel.getLineEnd(b,!0);return{start:a,end:c}},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}();g.TwoWayDiffBlockFeeder=function(){function b(a,c,d){this._mapperColumnIndex=d;this.init(a,c)}b.prototype=new g.DiffBlockFeeder;b.prototype.init=function(a,c){this._textModel=a;this._diffBlocks=void 0;if(c){this._mapper=c;this._diffBlocks=[];for(var b=0,d=0;d<this._mapper.length;d++)this._mapper[d][2]!==0&&this._diffBlocks.push([b,d]),b+=this._mapper[d][this._mapperColumnIndex]}};b.prototype.getBlockAnnoTypes=function(b){this._mapperColumnIndex===
0?b.push({type:"block",normal:f,current:e,list:[]}):b.push({type:"block",normal:d,current:c,list:[]});b.push({type:"block",normal:a,current:i,list:[]});b.push({type:"block",normal:m,current:o,list:[]})};b.prototype.getCurrentBlockAnnoType=function(b){if(!this._diffBlocks||this._diffBlocks.length===0)return null;b=this._diffBlocks[b][1];if(this._mapper[b][this._mapperColumnIndex]===0)return{normal:a,current:i};else if(k.isMapperConflict(this.getMapper(),b))return{normal:m,current:o};else if(this._mapperColumnIndex===
0)return{type:"block",normal:f,current:e,list:[]};return{type:"block",normal:d,current:c,list:[]}};return b}();g.inlineDiffBlockFeeder=function(){function a(c,b){this._mapperColumnIndex=b;this.init(c)}a.prototype=new g.DiffBlockFeeder;a.prototype.setModel=function(a){this._textModel=a};a.prototype.init=function(a){this._diffBlocks=void 0;if(a){this._mapper=a;this._diffBlocks=[];this._gapBlocks=[];for(var c=a=0,b=0;b<this._mapper.length;b++){if(this._mapper[b][2]!==0){if(this._mapperColumnIndex===
0){var d=a+this._mapper[b][1];this._diffBlocks.push([d,b]);this._gapBlocks.push([d,d+this._mapper[b][0],c])}else this._diffBlocks.push([a,b]),this._gapBlocks.push([a,a+this._mapper[b][1],c]);a+=this._mapper[b][0]+this._mapper[b][1]}else this._gapBlocks.push([a,a+this._mapper[b][this._mapperColumnIndex],c]),a+=this._mapper[b][this._mapperColumnIndex];c+=this._mapper[b][this._mapperColumnIndex]}}};a.prototype.getBlockAnnoTypes=function(a){this._mapperColumnIndex===0?a.push({type:"block",normal:f,current:e,
list:[]}):a.push({type:"block",normal:d,current:c,list:[]});a.push({type:"block",normal:m,current:o,list:[]})};a.prototype.getCurrentBlockAnnoType=function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return null;a=this._diffBlocks[a][1];if(this._mapper[a][this._mapperColumnIndex]===0)return{current:u,normal:q};else if(k.isMapperConflict(this.getMapper(),a))return{normal:m,current:o};else if(this._mapperColumnIndex===0)return{type:"block",normal:f,current:e,list:[]};return{type:"block",normal:d,
current:c,list:[]}};a.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]};a.prototype.getLineNumber=function(a){for(var c=0;c<this._gapBlocks.length;c++)if(this._gapBlocks[c][0]!==this._gapBlocks[c][1]&&a>=this._gapBlocks[c][0]&&a<this._gapBlocks[c][1])return a-this._gapBlocks[c][0]+this._gapBlocks[c][2];return-1};return a}();return g});
define("orion/compare/compare-rulers",["orion/compare/compareUtils","orion/compare/diffTreeNavigator"],function(h){var k=k||{};k.CompareRuler=function(){function h(b,g,f){this._location=b||"left";this._overview=g||"page";this._rulerStyle=f;this._editor=null;var e=this;this._listener={onModelChanged:function(b){e._onModelChanged(b)}}}h.prototype={setView:function(b){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=b;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(b,g){for(var f=[],e=b;e<g;e++){var d=this.getStyle(e);d&&(f[e]={html:this.getHTML(e),style:d})}return f},getWidestAnnotation:function(){return{html:this.getHTML(-1),
style:this.getStyle(-1)}},getRulerStyle:function(){return this.getStyle(void 0)}};return h}();k.LineNumberCompareRuler=function(){function h(b,g,f,e,d,c){k.CompareRuler.call(this,f,"page",e);this._diffNavigator=b;this._oddStyle=d||{style:{backgroundColor:"white"}};this._evenStyle=c||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=g}h.prototype=new k.CompareRuler;h.prototype.getStyle=function(b){return b===void 0?this._rulerStyle:this._evenStyle};h.prototype.getHTML=function(b){var g=
this._editor.getModel(),f=this._diffNavigator.getFeeder(this._mapperColumnIndex===0);return!f?"":b===-1?g.getLineCount():f.getLineNumber?(b=f.getLineNumber(b),b===-1?"":b+1):b+1};h.prototype._onModelChanged=function(b){var b=b.start,g=this._editor.getModel(),f=g.getLineCount(),e=(f+"").length;if(this._numOfDigits!==e)this._numOfDigits=e,this._editor.redrawLines(g.getLineAtOffset(b),f,this)};return h}();k.CompareOverviewRuler=function(){function j(b,g,f,e){this._diffNavigator=f;this._onClick=e;k.CompareRuler.call(this,
b,"document",g)}j.prototype=new k.CompareRuler;j.prototype.getStyle=function(b){var g,f;if(b===void 0)g=this._rulerStyle||{},f=g.style||(g.style={}),f.lineHeight="1px",f.fontSize="1px",f.width="14px";else if(g=b!==-1?{styleClass:"annotationOverview breakpoint"}:{},f=g.style||(g.style={}),f.cursor="pointer",f.width="8px",f.left="2px",this._editor.getModel(),b>=0){var e;if(this._diffNavigator&&this._diffNavigator.getFeeder())e=this._diffNavigator.getFeeder().getDiffBlocks();else return null;b=h.getAnnotationIndex(e,
b);if(b===-1)return null;e=h.getAnnotationMapperIndex(e,b);var d;d=this._diffNavigator.getMapper();if(e=h.isMapperConflict(d,e))f.border="1px #FF0000 solid";if(b===this._diffNavigator.getCurrentBlockIndex())f.backgroundColor=e?"red":"blue";b=this._diffNavigator.getFeeder().getDiffBlockH(b);e=this._diffNavigator.getFeeder().getOverviewLineCount();if(b<0)return null;d=this._editor.getClientArea();b=Math.floor(d.height*b/e);b<2&&(b=2);f.height=b+"px"}else return f.height="3px";return g};j.prototype.setDiffNavigator=
function(b){this._diffNavigator=b};j.prototype.getHTML=function(){return"&nbsp;"};j.prototype.onClick=function(b){b!==void 0&&this._onClick(b,this)};j.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return j}();k.CompareCurveRuler=function(){function j(b){this._canvasDiv=b;this._mapper=void 0;this._initialized=!1}j.prototype={init:function(b,g,f,e){this._initing=this._initialized=!0;this._mapper=b;this._leftEditor=g;this._rightEditor=
f;this._leftTextView=g.getTextView();this._rightTextView=f.getTextView();this._diffNavigator=e;this.render()},matchPositionFrom:function(b){var g=b?this._leftTextView:this._rightTextView,f=b?this._rightTextView:this._leftTextView,e=g.getTopIndex(),g=g.getBottomIndex(),b=h.matchMapper(this._mapper,b?0:1,e,g);f.setTopIndex(b)},copyToLeft:function(){if(this._diffNavigator.iterator){var b=this._diffNavigator.iterator.cursor();b&&this._leftTextView.setText(this._rightTextView.getText(b.oldA.start,b.oldA.end),
b.newA.start,b.newA.end)}},render:function(){if(this._mapper){var b=this._canvasDiv.getContext("2d");b.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);b.strokeStyle="#AAAAAA";b.lineWidth=1;b.beginPath();var g=this._leftTextView.getTopIndex(),f=this._leftTextView.getBottomIndex(),e=this._rightTextView.getTopIndex(),d=this._rightTextView.getBottomIndex();this._leftLineH=this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();for(var c=0,a=0,i=!1,j=0;j<this._mapper.length;j++){if(this._mapper[j][2]!==
0)if(h.overlapMapper(this._mapper[j],0,c,g,f)||h.overlapMapper(this._mapper[j],1,a,e,d))this._renderCurve(j,c,a,this._canvasDiv,b,g,f,e,d),i=!0;else if(i)break;c+=this._mapper[j][0];a+=this._mapper[j][1]}b.stroke()}},_renderCurve:function(b,g,f,e,d){var c=this._mapper[b],g=this._leftTextView.getLinePixel(g+c[0]/2)+c[0]%2*this._leftLineH/3-this._leftTextView.getTopPixel(),f=this._rightTextView.getLinePixel(f+c[1]/2)+c[1]%2*this._rightLineH/3-this._rightTextView.getTopPixel(),e=e.parentNode.clientWidth;
b===this._diffNavigator.getCurrentMapperIndex()?(d.stroke(),d.strokeStyle="#000",d.lineWidth=1,d.beginPath(),d.moveTo(0,g),d.bezierCurveTo(e/3,g,e*0.666,f,e,f),d.stroke(),d.strokeStyle="#AAAAAA",d.lineWidth=1,d.beginPath()):(d.moveTo(0,g),d.bezierCurveTo(e/3,g,e*0.666,f,e,f),d.stroke())},onChanged:function(b){if(b.removedLineCount!==b.addedLineCount)this._initing||h.updateMapper(this._mapper,0,this._leftTextView.getModel().getLineAtOffset(b.start),b.removedLineCount,b.addedLineCount),this._initing=
!1,(b.removedLineCount>0||b.addedLineCount>0)&&this.render()}};return j}();return k});
define("orion/git/util",["i18n!git/nls/gitmessages"],function(){function h(g){for(var f=0;f<b.length;f++)if(g.type===b[f])return!0;return!1}function k(b){for(var f=0;f<j.length;f++)if(b.type===j[f])return!0;return!1}var j=["Missing","Modified","Untracked","Conflicting"],b=["Added","Changed","Removed"];return{statusUILocation:"git/git-status2.html",isStaged:h,isUnstaged:k,isChange:function(b){return h(b)||k(b)},hasStagedChanges:function(g){for(var f=0;f<b.length;f++)if(g[b[f]].length>0)return!0;return!1},
hasUnstagedChanges:function(b){for(var f=0;f<j.length;f++)if(b[j[f]].length>0)return!0;return!1}}});
define("orion/git/widgets/CommitTooltipDialog",["i18n!git/nls/gitmessages","require","orion/webui/littlelib","orion/i18nUtil","orion/webui/popupdialog"],function(h,k,j,b,g){function f(b){this._init(b)}f.prototype=new g.PopupDialog;f.prototype.TEMPLATE='<div id="parentPane" style="padding:10px; width:520px"></div>';f.prototype._init=function(b){this.commit=b.commit;this._initialize(b.triggerNode,null,null,"mouseover",1E3)};f.prototype._bindToDom=function(){this._displayCommit(this.commit)};f.prototype._displayCommit=
function(e){var d=this.$parentPane,c=e.Message.split(/(\r?\n|$)/)[0],a=document.createElement("a");a.className="navlinkonpage";a.href="/git/git-commit.html#"+e.Location+"?page=1&pageSize=1";a.textContent=c;d.appendChild(a);a=document.createElement("div");a.style.paddingTop="15px";d.appendChild(a);a=document.createElement("div");d.appendChild(a);c=document.createElement("div");d.appendChild(c);if(e.AuthorImage){d=document.createElement("div");d.style["float"]="left";var i=new Image;i.src=e.AuthorImage;
i.name=e.AuthorName;i.className="git-author-icon";d.appendChild(i);a.appendChild(d)}d=document.createElement("span");d.textContent=b.formatMessage(h[" authored by ${0} {${1}) on ${2}"],e.AuthorName,e.AuthorEmail,(new Date(e.Time)).toLocaleString());c.appendChild(d);a=document.createElement("div");c.appendChild(a);d=document.createElement("span");d.textContent=b.formatMessage(h["committed by 0 (1)"],e.CommitterName,e.CommitterEmail);c.appendChild(d);a=document.createElement("div");a.style.paddingTop=
"15px";c.appendChild(a);d=document.createElement("span");d.textContent=h["commit:"]+e.Name;c.appendChild(d);if(e.Parents&&e.Parents.length>0)a=document.createElement("div"),c.appendChild(a),d=document.createElement("span"),d.textContent=h["parent:"],a=document.createElement("a"),a.className="navlinkonpage",a.href="/git/git-commit.html#"+e.Parents[0].Location+"?page=1&pageSize=1",a.textContent=e.Parents[0].Name,d.appendChild(a),c.appendChild(d);d=e.Tags&&e.Tags.length>0;if(e.Branches&&e.Branches.length>
0){a=document.createElement("div");a.style.paddingTop="15px";c.appendChild(a);a=document.createElement("section");c.appendChild(a);i=document.createElement("span");i.textContent=h["branches: "];a.appendChild(i);i=document.createElement("div");a.appendChild(i);for(a=0;a<e.Branches.length;++a){var f=document.createElement("span");f.style.paddingLeft="10px";f.textContent=e.Branches[a].FullName;i.appendChild(f)}}if(d){a=document.createElement("div");a.style.paddingTop="15px";c.appendChild(a);d=document.createElement("section");
c.appendChild(d);c=document.createElement("span");c.textContent=h["tags: "];d.appendChild(c);c=document.createElement("div");d.appendChild(c);for(a=0;a<e.Tags.length;++a)d=document.createElement("span"),d.style.paddingLeft="10px",d.textContent=e.Tags[a].Name,c.appendChild(d)}};f.prototype.constructor=f;return{CommitTooltipDialog:f}});
define("orion/git/gitPreferenceStorage",["orion/Deferred"],function(h){function k(h){this._prefix="/git/credentials";this._preferenceService=h.getService("orion.core.preference")}k.prototype={put:function(j,b){var g={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""};if(b!==void 0){if(b.gitSshUsername!==void 0&&b.gitSshUsername!==null)g.gitSshUsername=b.gitSshUsername;if(b.gitSshPassword!==void 0&&b.gitSshPassword!==null)g.gitSshPassword=b.gitSshPassword;if(b.gitPrivateKey!==void 0&&
b.gitPrivateKey!==null)g.gitPrivateKey=b.gitPrivateKey;if(b.gitPassphrase!==void 0&&b.gitPassphrase!==null)g.gitPassphrase=b.gitPassphrase}var f=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(b){var d=b.get("settings");d===void 0?f.reject():d.enabled?(b.put(j,g),f.resolve()):f.reject()});return f},get:function(j){var b={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""},g=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(f){var e=
f.get("settings");e===void 0?g.reject():e.enabled?(f=f.get(j),f!==void 0?g.resolve(f):g.resolve(b)):g.reject()});return g},isEnabled:function(){var j=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(b){b=b.get("settings");b===void 0?j.resolve(!1):j.resolve(b.enabled)});return j},enable:function(){var j=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(b){b.put("settings",{enabled:!0});j.resolve()});return j},disable:function(){var j=new h;this._preferenceService.getPreferences(this._prefix,
2).then(function(b){b.put("settings",{enabled:!1});j.resolve()});return j},remove:function(j){var b=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(g){g.remove(j);b.resolve()});return b},getRepositories:function(){var j=new h;this._preferenceService.getPreferences(this._prefix,2).then(function(b){for(var g=[],b=b.keys(),f=0;f<b.length;++f)b[f]!=="settings"&&g.push(b[f]);j.resolve(g)});return j}};return k.prototype.constructor=k});
define("orion/git/widgets/ConfirmPushDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(h,k){function j(b){this._init(b)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div id="header"></div>';j.prototype._init=function(b){var g=this;this.title="Git Push";this.modal=!0;this.messages=h;this.location=b.location;this.dialog2=b.dialog;this.func=b.func;this.buttons=[];this.buttons.push({callback:function(){g.destroy();g.dialog2.show()},text:"More"});this.buttons.push({callback:function(){g.destroy();
g.func()},text:"OK"});this._initialize()};j.prototype._bindToDom=function(){var b=this.$header;b.appendChild(document.createTextNode("You are going to push to the following remote: "+this.location));b.appendChild(document.createElement("br"));b.appendChild(document.createTextNode(" Click More to push to another remote or OK to push to default."))};j.prototype.constructor=j;return{ConfirmPushDialog:j}});
define("orion/git/widgets/ReviewRequestDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(h,k){function j(b){this._init(b)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div><div id="treeContentPane" style="padding: 8px"><label for="reviewReqUrl">${Paste link in email or IM}</label><br><input id="reviewReqUrl" style="width: 50em" value=""/></div><div id="newBranchPane" style="padding: 8px"><label for="reviewerName">${Send the link to the reviewer}</label><br><input id="reviewerName" style="width: 30em"  value=""/></div></div>';
j.prototype._init=function(b){var g=this;this.title=b.title||h["Contribution Review Request"];this.modal=!0;this.messages=h;this.url=b.url;this.func=b.func;this.buttons=[];this.buttons.push({callback:function(){g.destroy();g.func(g.$reviewerName.value)},text:"Submit"});this._initialize()};j.prototype._bindToDom=function(){this.$reviewReqUrl.value=this.url};j.prototype.constructor=j;return{ReviewRequestDialog:j}});
define("orion/git/widgets/GitCredentialsDialog",["i18n!git/nls/gitmessages","orion/git/gitPreferenceStorage","orion/webui/dialog"],function(h,k,j){function b(b){this._init(b)}b.prototype=new j.Dialog;b.prototype.TEMPLATE='<div id="gitCredentialsLabel" style="padding: 8px">${Repository URL:}<strong id="url"></strong></div><div id="gitSshUsernameRow" style="padding: 8px"><label id="gitSshUsernameLabel" for="gitSshUsername">${Username:}</label><input id="gitSshUsername" value=""></div><div id="gitSshPasswordRow" style="padding: 8px"><input id="isSshPassword" type="radio" name="isSshPassword" checked value="password"/><label id="gitSshPasswordLabel" for="gitSshPassword" style="padding: 0 8px">${Ssh password:}</label><input type="password" id="gitSshPassword" value="" style="width: 30em"></div><div style="padding: 8px"><div id="gitPrivateKeyRow"><input id="isPrivateKey" type="radio" name="isSshPassword" value="privateKey" style="vertical-align: top"/><label id="gitPrivateKeyLabel" for="gitPrivateKey" style="padding: 0 8px; vertical-align: top">${Private key:}</label><textarea id="gitPrivateKey" value=""></textarea></div><div id="gitPrivateKeyFileRow" style="padding-left: 8em"><label id="gitPrivateKeyFileLabel" for="gitPrivateKeyFile">${Private key file (optional):}</label><br><input id="gitPrivateKeyFile" multiple="false" type="file" size="53" label="Browse..."></div><div id="gitPassphraseRow" style="padding-left: 8em"><label id="gitPassphraseLabel" for="gitPassphrase">${Passphrase (optional):}</label><br><input type="password" id="gitPassphrase" value="" style="width: 30em"></div></div><div id="gitSaveCredentialsRow" style="padding: 8px"><img id="gitSaveCredentialsInfo" src="/images/info.gif""><input id="gitSaveCredentials" type="checkbox" name="gitSaveCredentials"><label id="gitSaveCredentialsLabel" for="gitSaveCredentials">${Don\'t prompt me again:}</label></div>';
b.prototype._init=function(b){var f=this;this.title=b.title||h["Git Credentials"];this.modal=!0;this.messages=h;this.options=b;if(!this.options.username&&!this.options.password&&!this.options.privatekey&&!this.options.passphrase)this.options.username=!0,this.options.password=!0,this.options.privatekey=!0,this.options.passphrase=!0;if(b.serviceRegistry)this._sshService=b.serviceRegistry.getService("orion.net.ssh"),this._progressService=b.serviceRegistry.getService("orion.page.progress");this.buttons=
[];this.buttons.push({callback:function(){f.destroy();f._execute()},text:"OK",isDefault:!0});this._initialize()};b.prototype._bindToDom=function(){var b=this;if(!this.options.username)this.$gitSshUsernameRow.style.display="none";if(!this.options.password)this.$gitSshPasswordRow.style.display="none";if(!this.options.privatekey)this.$gitPrivateKeyRow.style.display="none",this.$gitPrivateKeyFileRow.style.display="none";if(!this.options.passphrase)this.$gitPassphraseRow.style.display="none";if(this.options.errordata&&
this.options.errordata.Url)this.$gitCredentialsLabel.style.display="block",this.$url.textContent=this.options.errordata.Url;if(this.options.errordata&&this.options.errordata.User&&this.options.errordata.User!=="")this.$gitSshUsername.value=this.options.errordata.User,this.$gitSshUsernameRow.style.display="none",setTimeout(function(){b.$gitSshPassword.focus()},400);(new k(this.options.serviceRegistry)).isEnabled().then(function(f){if(!f)b.$gitSaveCredentials.style.display="none",b.$gitSaveCredentialsLabel.style.display=
"none",b.$gitSaveCredentialsInfo.style.display="none"});this.$gitSshPassword.addEventListener("focus",function(){b.$isSshPassword.checked=!0});this.$gitPrivateKey.addEventListener("focus",function(){b.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("focus",function(){b.$isPrivateKey.checked=!0});this.$gitPassphrase.addEventListener("focus",function(){b.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("change",function(f){b.privateKeyFile=f.target.files[0]})};
b.prototype._execute=function(){var b=this,f=this.$gitPrivateKey.value,e=this.$url.textContent,d=function(a){if(b._sshService)b._sshService.getKnownHosts().then(function(c){if(b.options.func){var d=typeof b.options.failedOperation==="undefined"?b.options.errordata.failedOperation:b.options.failedOperation;d!=="undefined"&&b._progressService.removeOperation(d);b.options.func({gitSshUsername:b.$gitSshUsername.value,gitSshPassword:b.$isSshPassword.checked?b.$gitSshPassword.value:"",gitPrivateKey:b.$isPrivateKey.checked?
a:"",gitPassphrase:b.$isPrivateKey.checked?b.$gitPassphrase.value:"",knownHosts:c})}});else if(b.options.func){var c=typeof b.options.failedOperation==="undefined"?b.options.errordata.failedOperation:b.options.failedOperation;c!=="undefined"&&b._progressService.removeOperation(c);b.options.func({gitSshUsername:b.$gitSshUsername.value,gitSshPassword:b.$gitSshPassword.value,gitPrivateKey:a,gitPassphrase:b.$gitPassphrase.value,knownHosts:b.$gitSshKnownHosts.value})}};if(this.privateKeyFile){var c=new FileReader;
c.onload=function(){return function(a){f=a.target.result;a=new k(b.options.serviceRegistry);b.$gitSaveCredentials.checked?a.put(e,{gitPrivateKey:f,gitPassphrase:b.$gitPassphrase.value}).then(function(){d(f)}):d(f)}}(this.privateKeyFile);c.readAsText(this.privateKeyFile)}else f.length>0?(c=new k(b.options.serviceRegistry),b.$gitSaveCredentials.checked?c.put(e,{gitPrivateKey:f,gitPassphrase:b.$gitPassphrase.value}).then(function(){d(f)}):d(f)):(c=new k(b.options.serviceRegistry),b.$gitSaveCredentials.checked?
c.put(e,{gitSshUsername:b.$gitSshUsername.value,gitSshPassword:b.$gitSshPassword.value}).then(function(){d(f)}):d(f))};b.prototype.constructor=b;return{GitCredentialsDialog:b}});
define("orion/git/widgets/OpenCommitDialog",["i18n!git/nls/gitmessages","orion/i18nUtil","orion/Deferred","orion/webui/dialog","orion/webui/littlelib"],function(h,k,j,b,g){function f(b){this._init(b)}f.prototype=new b.Dialog;f.prototype.TEMPLATE='<div><label for="resourceName">${Type the commit name (sha1):}</label></div><div><input type="text" id="resourceName"></div><div id="results" style="max-height:400px; height:auto; overflow-y:auto;"></div>';f.prototype._init=function(b){var d=this;this.title=
b.title||h["Find Commit"];this.modal=!0;this.messages=h;this.SEARCH_DELAY=500;this.timeoutId=null;this.time=0;this.serviceRegistry=b.serviceRegistry;if(!this.serviceRegistry)throw Error("Missing required argument: serviceRegistry");this.repositories=b.repositories;if(!this.repositories)throw Error("Missing required argument: repositories");this.commitName=b.commitName;this.buttons=[];this.buttons.push({callback:function(){d.destroy();d._execute()},text:"OK"});this._initialize()};f.prototype._bindToDom=
function(){var b=this;this.$resourceName.addEventListener("input",function(){b.time=+new Date;b.timeoutId&&clearTimeout(b.timeoutId);b.timeoutId=setTimeout(b._checkSearch.bind(b),0)},!1);this.$resourceName.addEventListener("keydown",function(d){if(d.keyCode===g.KEY.ENTER){var c=g.$("a",b.$results);c&&(g.stop(d),window.open(c.href),b.hide())}},!1);this.$resourceName.value=this.commitName};f.prototype._checkSearch=function(){clearTimeout(this.timeoutId);var b=(new Date).getTime();b-this.time>this.SEARCH_DELAY?
(this.time=b,this._doSearch()):this.timeoutId=setTimeout(this._checkSearch.bind(this),50)};f.prototype._findCommitLocation=function(b,d,c){var a=this;c||(c=new j);b.length>0?this.serviceRegistry.getService("orion.page.progress").progress(a.serviceRegistry.getService("orion.git.provider").doGitLog("/gitapi/commit/"+d+b[0].ContentLocation+"?page=1&pageSize=1"),"Getting commit details "+d).then(function(a){c.resolve(a.Children[0])},function(){a._findCommitLocation(b.slice(1),d,c)}):c.reject();return c};
f.prototype._doSearch=function(){var b=this,d=this.$resourceName&&this.$resourceName.value;if(d){var c=document.createElement("div");c.appendChild(document.createTextNode(h["Searching..."]));g.empty(this.$results);this.$results.appendChild(c);this.serviceRegistry.getService("orion.page.message").setProgressMessage(h["Looking for the commit"]);this._findCommitLocation(this.repositories,d).then(function(a){g.empty(b.$results);b._displayCommit(a,b.$results);b.serviceRegistry.getService("orion.page.message").setProgressMessage("")},
function(){var a=document.createElement("div");a.appendChild(document.createTextNode("No commits found"));g.empty(b.$results);b.$results.appendChild(a);b.serviceRegistry.getService("orion.page.message").setProgressMessage("")})}};f.prototype._displayCommit=function(b,d){var c=this,a=document.createElement("div");a.style.padding="10px";a.style.maxWidth="480px";g.empty(d);d.appendChild(a);var i=b.Message.split(/(\r?\n|$)/)[0],f=document.createElement("a");f.className="navlinkonpage";f.href="/git/git-commit.html#"+
b.Location+"?page=1&pageSize=1";f.textContent=i;a.appendChild(f);f.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&c.hide()},!1);f.addEventListener("keyup",function(a){a.keyCode===g.KEY.ENTER&&c.hide()},!1);f=document.createElement("div");f.style.paddingTop="15px";a.appendChild(f);f=document.createElement("div");a.appendChild(f);i=document.createElement("div");a.appendChild(i);if(b.AuthorImage){a=document.createElement("div");a.style["float"]="left";var j=new Image;j.src=
b.AuthorImage;j.name=b.AuthorName;j.className="git-author-icon";a.appendChild(j);f.appendChild(a)}a=document.createElement("span");a.textContent=k.formatMessage(h[" authored by ${0} {${1}) on ${2}"],b.AuthorName,b.AuthorEmail,(new Date(b.Time)).toLocaleString());i.appendChild(a);f=document.createElement("div");i.appendChild(f);a=document.createElement("span");a.textContent=k.formatMessage(h["committed by 0 (1)"],b.CommitterName,b.CommitterEmail);i.appendChild(a);f=document.createElement("div");f.style.paddingTop=
"15px";i.appendChild(f);a=document.createElement("span");a.textContent=h["commit:"]+b.Name;i.appendChild(a);if(b.Parents&&b.Parents.length>0)f=document.createElement("div"),i.appendChild(f),d=document.createElement("span"),d.textContent=h["parent:"],a=document.createElement("a"),a.className="navlinkonpage",a.href="/git/git-commit.html#"+b.Parents[0].Location+"?page=1&pageSize=1",a.textContent=b.Parents[0].Name,d.appendChild(a),a.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&
c.hide()},!1),a.addEventListener("keyup",function(a){a.keyCode===g.KEY.ENTER&&c.hide()},!1),i.appendChild(d)};f.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};f.prototype.constructor=f;return{OpenCommitDialog:f}});
define("orion/git/widgets/CommitDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(h,k){function j(b){this._init(b)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div style="display: none; padding-top: 10px; padding-bottom: 10px;" id="commitInfoBar"><strong id="commitInfo"></strong></div><div style="padding:4px"><label id="commitMessageLabel" for="commitMessage">${Message:}</label><input id="commitMessage" style="width: 30em" value=""></div><div style="padding:4px"><label id="amendLabel" for="amend">${Amend:}</label><input id="amend" type="checkbox"></div><div style="padding:4px"><label id="committerNameLabel" for="committerName">${Committer Name:}</label><input id="committerName" style="width: 30em" value=""></div><div style="padding:4px"><label id="committerEmailLabel" for="committerEmail">${Committer Email:}</label><input id="committerEmail" style="width: 30em" value=""></div><div style="padding:4px"><label id="authorNameLabel" for="authorName">${Author Name:}</label><input id="authorName" style="width: 30em" value=""></div><div style="padding:4px"><label id="authorEmailLabel" for="authorEmail">${Author Email:}</label><input id="authorEmail" style="width: 30em" value=""></div>';j.prototype._init=
function(b){var g=this;this.title=h["Commit Changes"];this.modal=!0;this.messages=h;this.options=b;this.buttons=[];this.buttons.push({callback:function(){g._execute()},text:"OK",id:"commitChangesButton"});this._initialize()};j.prototype._bindToDom=function(){var b=this;if(this.options.body.Message)this.$commitMessage.value=this.options.body.Message;this.$commitMessage.addEventListener("keyup",function(){b._validate()});if(this.options.body.Amend)this.$amend.checked=!0;if(this.options.body.CommitterName)this.$committerName.value=
this.options.body.CommitterName;this.$committerName.addEventListener("keyup",function(){b._validate()});if(this.options.body.CommitterEmail)this.$committerEmail.value=this.options.body.CommitterEmail;this.$committerEmail.addEventListener("keyup",function(){b._validate()});if(this.options.body.AuthorName)this.$authorName.value=this.options.body.AuthorName;this.$authorName.addEventListener("keyup",function(){b._validate()});if(this.options.body.AuthorEmail)this.$authorEmail.value=this.options.body.AuthorEmail;
this.$authorEmail.addEventListener("keyup",function(){b._validate()});this._validate()};j.prototype._validate=function(){this.$commitMessage.value?this.$committerName.value?this.$committerEmail.value?this.$authorName.value?this.$authorEmail.value?(this.$commitInfoBar.style.display="none",this.$commitChangesButton.classList.remove(this.DISABLED)):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=h["The author mail is required."]):
(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=h["The author name is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=h["The committer mail is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=h["The committer name is required."]):(this.$commitInfoBar.style.display=
"block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=h["The commit message is required."])};j.prototype._execute=function(){if(!this.$commitChangesButton.classList.contains(this.DISABLED)){if(this.options.func){var b={};b.Message=this.$commitMessage.value;b.Amend=this.$amend.checked?!0:!1;b.CommitterName=this.$committerName.value;b.CommitterEmail=this.$committerEmail.value;b.AuthorName=this.$authorName.value;b.AuthorEmail=this.$authorEmail.value;this.options.func(b)}this.hide()}};
j.prototype.constructor=j;return{CommitDialog:j}});
define("orion/git/widgets/ApplyPatchDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(h,k){function j(b){this._init(b)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div style="padding:4px"><input type="radio" name="radio" value="urlRadio" id="urlRadio" checked/>URL:<input type="text" name="url" id="url"/></div><div style="padding:4px"><input type="radio" name="radio" value="fileRadio" id="fileRadio"/>File:<input type="file" name="selectedFile" id="selectedFile" class="uploadChooser" /></div>';j.prototype._init=
function(b){var g=this;this.title=h["Apply Patch"];this.modal=!0;this.messages=h;this.options=b;this.buttons=[];this.buttons.push({callback:function(){g._applyPatch()},text:"OK"});this._initialize()};j.prototype._bindToDom=function(){};j.prototype._applyPatch=function(){var b=new FormData;b.append("uploadedfile",this.$selectedFile.files[0]);b.append("url",this.$url.value);b.append("radio",this.$fileRadio.checked?"fileRadio":"urlRadio");this.req=new XMLHttpRequest;this.req.open("post",this.options.diffLocation);
this.req.onreadystatechange=this.handleReadyState.bind(this);this.req.send(b)};j.prototype.handleReadyState=function(){this.req.readyState===4&&this.hide()};j.prototype.constructor=j;return{ApplyPatchDialog:j}});
define("orion/operation",["orion/xhr","orion/Deferred"],function(h,k){function j(b,f){h("GET",b,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(e){e=e.response?JSON.parse(e.response):null;f.progress(e);!e.type||e.type==="loadstart"||e.type==="progress"?setTimeout(function(){j(b,f)},2E3):(e.type==="error"||e.type==="abort"?f.reject(e.Result):f.resolve(e.Result.JsonData),e.Location||h("DELETE",b,{headers:{"Orion-Version":"1"},timeout:15E3}))},function(b){var d=b;if(b.responseText!==void 0){d=
b.responseText;try{d=JSON.parse(b.responseText)}catch(c){}}d.Message!==void 0?(d.HttpCode=d.HttpCode===void 0?b.status:d.HttpCode,d.Severity=d.Severity===void 0?"Error":d.Severity,f.reject(d)):f.reject({Severity:"Error",Message:d,HttpCode:b.status})})}function b(b,f){f.then(null,function(e){e instanceof Error&&e.name==="Cancel"&&h("PUT",b,{headers:{"Orion-Version":"1"},data:JSON.stringify({abort:!0}),timeout:15E3})})}return{handle:function(g){var f=new k;b(g,f);j(g,f);return f}}});
define("orion/git/gitClient",["require","orion/xhr","orion/Deferred","orion/operation"],function(h,k,j,b){var g=g||{};g.GitService=function(){function f(b){if(b)this._serviceRegistry=b,this._serviceRegistration=b.registerService("orion.git.provider",this),this._sshService=b.getService("orion.net.ssh")}f.prototype={checkGitService:function(){},cloneGitRepository:function(b,d,c,a,f,g,o,q,u){var l=this,s={};if(b)s.Name=b;if(c)s.Path=c;if(d)s.GitUrl=d;s.Location=a;if(f)s.GitSshUsername=f;if(g)s.GitSshPassword=
g;if(o)s.GitSshKnownHost=o;if(q)s.GitSshPrivateKey=q;if(u)s.GitSshPassphrase=u;var b=h.toUrl("gitapi/clone/._"),b=b.substring(0,b.length-2),n=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(s)}).then(function(a){l._getGitServiceResponse(n,a)},function(a){l._handleGitServiceResponseError(n,a)});return n},removeGitRepository:function(b){var d=this,c=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},getGitStatus:function(b){var d=this,c=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},stage:function(b){var d=this,c=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},stageMultipleFiles:function(b,d){var c=this,a=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},unstageAll:function(b,d){var c=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Reset:d})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},unstage:function(b,d){var c=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},checkoutPath:function(b,
d){var c=this,a=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d,RemoveUntracked:"true"})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},commitAll:function(b,d,c){var a=this,f=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:c}).then(function(c){a._getGitServiceResponse(f,c)},function(c){a._handleGitServiceResponseError(f,
c)});return f},getGitClone:function(b){var d=this,c=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},getGitCloneConfig:function(b){var d=this,c=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,
a)});return c},getGitBranch:function(b){var d=this,c=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},getGitRemote:function(b){var d=this,c=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,
a)});return c},checkoutBranch:function(b,d){var c=this,a=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Branch:d})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},resetIndex:function(b,d){var c=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Commit:d,Reset:"HARD"})}).then(function(b){c._getGitServiceResponse(a,
b)},function(b){c._handleGitServiceResponseError(a,b)});return a},addBranch:function(b,d,c){var a=this,f={};if(d)f.Name=d;if(c)f.Branch=c;var g=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(f)}).then(function(c){a._getGitServiceResponse(g,c)},function(c){a._handleGitServiceResponseError(g,c)});return g},removeBranch:function(b){var d=this,c=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},addRemote:function(b,d,c){var a=this,f=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Remote:d,RemoteURI:c})}).then(function(c){a._getGitServiceResponse(f,c)},function(c){a._handleGitServiceResponseError(f,c)});return f},removeRemote:function(b){var d=this,c=new j;k("DELETE",b,
{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},doGitLog:function(b){var d=this,c=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},getDiff:function(b,d){var c=this,a=new j;k("POST",
b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:d})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},doFetch:function(b,d,c,a,f,g,h){var q=this,u=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Fetch:"true",Force:d,GitSshUsername:c,GitSshPassword:a,GitSshKnownHost:f,GitSshPrivateKey:g,GitSshPassphrase:h})}).then(function(a){q._getGitServiceResponse(u,
a)},function(a){q._handleGitServiceResponseError(u,a)});return u},doPull:function(b,d,c,a,f,g,h){var q=this,u=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Pull:"true",Force:d,GitSshUsername:c,GitSshPassword:a,GitSshKnownHost:f,GitSshPrivateKey:g,GitSshPassphrase:h})}).then(function(a){q._getGitServiceResponse(u,a)},function(a){q._handleGitServiceResponseError(u,a)});return u},doMerge:function(b,d,c){var a=this,f=new j;
k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Merge:d,Squash:c})}).then(function(c){a._getGitServiceResponse(f,c)},function(c){a._handleGitServiceResponseError(f,c)});return f},doCherryPick:function(b,d){var c=this,a=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({"Cherry-Pick":d})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,
b)});return a},doRebase:function(b,d,c){var a=this,f={};f.Rebase=d;if(c)f.Operation=c;var g=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(f)}).then(function(c){a._getGitServiceResponse(g,c)},function(c){a._handleGitServiceResponseError(g,c)});return g},doPush:function(b,d,c,a,f,g,h,q,u){var l=this,s=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({PushSrcRef:d,
PushTags:c,Force:a,GitSshUsername:f,GitSshPassword:g,GitSshKnownHost:h,GitSshPrivateKey:q,GitSshPassphrase:u})}).then(function(a){l._getGitServiceResponse(s,a)},function(a){l._handleGitServiceResponseError(s,a)});return s},getLog:function(b,d){var c=this,a=new j,f=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:d})}).then(function(a){f.resolve(a.xhr.getResponseHeader("Location"))},function(b){c._handleGitServiceResponseError(a,
b)});f.then(function(b){k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)})});return a},getDefaultRemoteBranch:function(b){var d=this,c=new j,a=new j;k("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(c){d._getGitServiceResponse(a,c)},function(a){d._handleGitServiceResponseError(c,a)});
a.then(function(a){k("GET",a.Children[0].Location,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)})});return c},doAddTag:function(b,d){var c=this,a=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Name:d})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,
b)});return a},doRemoveTag:function(b){var d=this,c=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},checkoutTag:function(b,d,c){var a=this,f=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Tag:d,Branch:c})}).then(function(c){a._getGitServiceResponse(f,
c)},function(c){a._handleGitServiceResponseError(f,c)});return f},addCloneConfigurationProperty:function(b,d,c){var a=this,f=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Key:d,Value:c})}).then(function(c){a._getGitServiceResponse(f,c)},function(c){a._handleGitServiceResponseError(f,c)});return f},editCloneConfigurationProperty:function(b,d){var c=this,a=new j;k("PUT",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({Value:d})}).then(function(b){c._getGitServiceResponse(a,b)},function(b){c._handleGitServiceResponseError(a,b)});return a},deleteCloneConfigurationProperty:function(b){var d=this,c=new j;k("DELETE",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(c,a)},function(a){d._handleGitServiceResponseError(c,a)});return c},sendCommitReviewRequest:function(b,d,c,a,f,g){var h=
this,q=new j;k("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({ReviewReqCommit:b,ReviewReqUrl:a,ReviewReqNotifyLogin:c,ReviewReqAuthorName:f,ReviewMessage:g})}).then(function(a){h._getGitServiceResponse(q,a)},function(a){h._handleGitServiceResponseError(q,a)});return q},_getGitServiceResponse:function(e,d){var c=d.response?JSON.parse(d.response):null;if(d.xhr&&d.xhr.status===202){var a=b.handle(c.Location);a.then(e.resolve,function(a){a.failedOperation=
c.Location;e.reject(a)},e.progress);e.then(null,function(c){a.reject(c)})}else e.resolve(c)},_handleGitServiceResponseError:function(b,d){b.reject(d)}};return f}();return g});
define("orion/ssh/sshTools",[],function(){var h=h||{};h.SshService=function(){function h(j){if(j)this._serviceRegistry=j,this._serviceRegistration=j.registerService("orion.net.ssh",this)}h.prototype={_KNOWN_HOSTS:"known_hosts",addKnownHosts:function(h,b){b||(b="");var g=localStorage.getItem(b+this._KNOWN_HOSTS);g?g.indexOf(h)<0&&localStorage.setItem(b+this._KNOWN_HOSTS,g+"\n"+h):localStorage.setItem(b+this._KNOWN_HOSTS,h)},clearKnownhosts:function(h){h||(h="");localStorage.removeItem(h+this._KNOWN_HOSTS)},
getKnownHosts:function(h){h||(h="");return localStorage.getItem(h+this._KNOWN_HOSTS)}};return h}();return h});
define("orion/links",[],function(){function h(h){this._init(h)}h.prototype={_init:function(h){this._registry=h.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.textlink",this)},_replaceLink:function(h,j,b,g,f){var e=h.search(b);e>0&&(j.appendChild(document.createTextNode(h.substring(0,e))),h=h.substring(e));var b=h.replace(b,""),e=h.substring(0,h.length-b.length),d=e.split(" ",g);if(d.length===g){for(var h=document.createElement("a"),c=0;c<g;c++)f=f.replace("%"+
(c+1),d[c]);h.setAttribute("href",f);h.textContent=e;j.appendChild(h);h=b}return h},addLinks:function(h,j){var b=j||document.createElement("div"),g=this._registry.getServiceReferences("orion.core.linkScanner");if(g.length>0)for(var f=g[0],g=RegExp(f.getProperty("pattern"),"i"),e=f.getProperty("words"),f=f.getProperty("anchor"),d=h.search(g);d>=0;)h=this._replaceLink(h,b,g,e,f),d=h.search(g);h.length>0&&b.appendChild(document.createTextNode(h));return b}};h.prototype.constructor=h;return{TextLinkService:h}});
define("orion/contentTypes",[],function(){function h(b,e){function d(a,c,b,d){var b=c.filename.indexOf(b)>=0,e=c.extension.indexOf(d)>=0;if(b||e)if(!a||b&&a.extension.indexOf(d)>=0)return c;return a}for(var c=b&&b.split(".").pop(),a=null,i=0;i<e.length;i++){var h=e[i];d(a,h,b,c)===h&&(a=h)}return a}function k(f){this.serviceRegistry=f;this.map=function(e){function d(a){return a===null||typeof a==="undefined"?[]:a instanceof Array?a:[a]}for(var e=e.getServiceReferences(b).concat(e.getServiceReferences(g)),
c={},a=0;a<e.length;a++)for(var f=d(e[a].getProperty("contentTypes")),h=0;h<f.length;h++){var j=f[h];c[j.id]||(c[j.id]={id:j.id,name:j.name,image:j.image,"extends":j["extends"],extension:d(j.extension),filename:d(j.filename)})}return c}(f);f.registerService(j,this)}var j="orion.core.contenttypes",b="orion.core.contenttype",g="orion.file.contenttype";k.prototype={getContentTypes:function(){var b=this.getContentTypesMap(),e=[],d;for(d in b)b.hasOwnProperty(d)&&e.push(b[d]);return e},getContentTypesMap:function(){return this.map},
getFileContentType:function(b){return h(b.Name,this.getContentTypes())},getFilenameContentType:function(b){return h(b,this.getContentTypes())},getContentType:function(b){return this.map[b]||null},isExtensionOf:function(b,e){b=typeof b==="string"?this.getContentType(b):b;e=typeof e==="string"?this.getContentType(e):e;if(!b||!e)return!1;if(b.id===e.id)return!0;else for(var d=b,c={};d&&(d=this.getContentType(d["extends"]));){if(d.id===e.id)return!0;if(c[d.id])throw Error("Cycle: "+d.id);c[d.id]=!0}return!1},
isSomeExtensionOf:function(b,e){for(var d=0;d<e.length;d++)if(this.isExtensionOf(b,e[d]))return!0;return!1}};return{ContentTypeService:k,getFilenameContentType:h}});
define("orion/PageUtil",[],function(){var h=/^http[s]?/i;return{matchResourceParameters:function(h){var h=h||window.location.toString(),j={resource:""},b=h.indexOf("#");if(b!==-1&&(h=h.substring(b+1),h.length!==0)){h=h.split(",");Object.defineProperty(j,"resourceRaw",{value:h[0]});j.resource=decodeURIComponent(h[0]);for(b=1;b<h.length;b++){var g=/([^=]*)(=?)(.*)/.exec(h[b]),f=decodeURIComponent(g[1]||""),g=decodeURIComponent(g[3]||"");f!==""&&f!=="resource"&&(j[f]=g)}}return j},validateURLScheme:function(k,
j){var b=k;if(k.indexOf("://")===-1){var g=document.createElement("a");g.href=k;b=g.href}g=!1;return(g=j?j.some(function(f){return RegExp("^"+f+":","i").test(b)}):h.test(b))?k:(console.log("Illegal URL Scheme: '"+k+"'"),"")}}});
define("orion/commands","i18n!orion/nls/messages,require,orion/uiUtils,orion/PageUtil,orion/webui/littlelib,orion/webui/dropdown,orion/webui/tooltip,orion/explorers/navigationUtils".split(","),function(h,k,j,b,g,f,e,d){function c(a,c,b,d,e){this.commandService=a;this.handler=c;this.items=b;this.userData=d;this.command=e;if(e.parameters)this.parameters=e.parameters.makeCopy();this.id=e.id}function a(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};
this._init(a);this._parameterCollector=null}function i(a,c,b){c.classList.add("commandImage");var d;a.imageClass?(d=document.createElement("span"),c.appendChild(d),d.classList.add(a.spriteClass),d.classList.add(a.imageClass)):(d=new Image,d.alt=a.name,d.name=b,d.id=b,d.src=a.image,c.appendChild(d));return d}function m(a){this._init(a)}function o(a,c,b,d,e,f,i){this.keyCode=typeof a==="string"?a.toUpperCase().charCodeAt(0):a;this.mod1=c!==void 0&&c!==null?c:!1;this.mod2=b!==void 0&&b!==null?b:!1;this.mod3=
d!==void 0&&d!==null?d:!1;this.mod4=e!==void 0&&e!==null?e:!1;this.domScope=g.node(f);this.scopeName=i||(f?f.id:null)}function q(a,c){this.token=a;this.parameterName=c}function u(a,c,b,d,e){this.name=a;this.type=c;this.label=b;this.value=d;this.lines=e||1}function l(a,c,b){this._storeParameters(a);this._hasOptionalParameters=c&&c.hasOptionalParameters;this._options=c;this.optionsRequested=!1;this.getParameters=b;this.clientCollect=c&&c.clientCollect}var s=window.navigator.platform.indexOf("Mac")!==
-1;c.prototype={collectsParameters:function(){return this.commandService&&this.commandService.collectsParameters()},makeCopy:function(a){var b=new c(this.commandService,this.handler,this.items,this.userData,this.command);b.domNode=this.domNode;b.domParent=this.domParent;if(a)b.parameters=a.makeCopy();else if(this.parameters)b.parameters=this.parameters.makeCopy();return b}};c.prototype.constructor=c;a.prototype={_init:function(a){this._registry=a.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.page.command",
this);this._defaultSelectionService=a.selection;var c=this;window.document.addEventListener("keydown",function(a){a=a||window.event;if(function(a){if(s){if(a.metaKey&&!a.altKey)return!a.shiftKey&&!a.ctrlKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===90)?!0:!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===90)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return a["char"].length>0;
else if(a.charCode||a.keyCode)switch(a=a.charCode||a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return a>=32&&a<112||a>123}return!1}(a)){if(a.target.contentEditable==="true")return;var b=a.target.nodeName.toLowerCase();if(b==="input")switch(a.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if(b===
"textarea")return}c._processKey(a)},!1)},_processKey:function(a){function c(a){window.document.all?a.keyCode=0:(a.preventDefault(),a.stopPropagation())}for(var b in this._activeBindings)if(this._activeBindings[b]&&this._activeBindings[b].keyBinding&&this._activeBindings[b].command&&this._activeBindings[b].keyBinding.match(a)){var d=this._activeBindings[b],e=d.invocation;if(e)if(d=d.command,d.hrefCallback){c(a);a=d.hrefCallback.call(e.handler||window,e);a.then?a.then(function(a){window.open(a)}):window.open(a);
break}else if(d.callback){c(a);var f=this;window.setTimeout(function(){f._invoke(e)},0);break}}},processURL:function(a){for(var c in this._urlBindings)if(this._urlBindings[c]&&this._urlBindings[c].urlBinding&&this._urlBindings[c].command){var b=this._urlBindings[c].urlBinding.match(a);if(b){var d=this._urlBindings[c],e=d.command,f=d.invocation;if(f&&f.parameters&&e.callback){f.parameters.setValue(b.parameterName,b.parameterValue);var i=this;window.setTimeout(function(){i._invoke(f)},0);break}}}},
findCommand:function(a){return this._commandList[a]},runCommand:function(a,b,d,e){b?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(b):1)&&a.callback&&this._invoke(new c(this,d,b,null,a),e):(b=this._urlBindings[a])&&b.command&&b.command.callback&&this._invoke(b.invocation,e)},getSelectionService:function(){return this._defaultSelectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,c,b){this._parameterCollector&&(this._parameterCollector.close(),
this._parameterCollector.open(a,c,b))},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(a,c){return this._collectAndInvoke(a.makeCopy(c),!1)},_collectAndInvoke:function(a,c){if(a)if(this._parameterCollector&&a.parameters&&a.parameters.hasParameters()&&(c||a.parameters.shouldCollectParameters())){var b=!1;a.parameters.updateParameters(a);b=this._parameterCollector.collectParameters(a);
if(!b){var d=new e.Tooltip({node:a.domNode,trigger:"click",position:["below","right","above","left"]}),b=d.contentContainer();b.classList.add("parameterPopup");var f=window.document.activeElement,i=this._parameterCollector.getFillFunction(a,function(){f&&f.focus();d.destroy()})(b);d.show();window.setTimeout(function(){i.focus();i.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(a){this._collectAndInvoke(a,!0)},showKeyBindings:function(a){var c={},b,d,e,f;for(f in this._activeBindings)if((d=this._activeBindings[f])&&d.keyBinding&&d.command)d.keyBinding.scopeName?(c[d.keyBinding.scopeName]||(c[d.keyBinding.scopeName]=[]),c[d.keyBinding.scopeName].push(d)):(b=j.getUserKeyString(d.keyBinding),e=document.createElement("span"),e.role="listitem",e.appendChild(document.createTextNode(b+" = "+d.command.name)),e.appendChild(document.createElement("br")),
a.appendChild(e));for(var i in c)if(c[i].length&&c[i].length>0){b=document.createElement("h2");a.appendChild(b);b.appendChild(document.createTextNode(i));for(f=0;f<c[i].length;f++)d=c[i][f],b=j.getUserKeyString(d.keyBinding),e=document.createElement("span"),e.role="listitem",e.appendChild(document.createTextNode(b+" = "+d.command.name)),e.appendChild(document.createElement("br")),a.appendChild(e)}},addCommand:function(a){this._commandList[a.id]=a},addCommandGroup:function(a,c,b,d,e,f){this._contributionsByScopeId[a]||
(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];e&&(a=this._createEntryForPath(a,e));if(a[c]){if(d)a[c].title=d;if(b)a[c].position=b;a[c].emptyGroupMessage=f}else a[c]={title:d,position:b,emptyGroupMessage:f,children:{}},a.sortedContributions=null},_createEntryForPath:function(a,c){if(c)for(var b=c.split("/"),d=0;d<b.length;d++)if(b[d].length>1)a[b[d]]||(a[b[d]]={position:0,children:{}}),a=a[b[d]].children;return a},registerSelectionService:function(a,c){this._contributionsByScopeId[a]||
(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=c},registerCommandContribution:function(a,c,b,d,e,f,i){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];d&&(a=this._createEntryForPath(a,d));a[c]={position:b};f&&(b=this._commandList[c])&&(this._activeBindings[c]={command:b,keyBinding:f,bindingOnly:e});i&&(b=this._commandList[c])&&(this._urlBindings[c]={command:b,urlBinding:i,bindingOnly:e});a.sortedContributions=
null},_checkForTrailingSeparator:function(a,c,b){var d;if(c==="tool"||c==="button")if((d=a.childNodes.length>0?a.childNodes[a.childNodes.length-1]:null)&&d.classList.contains("commandSeparator"))return b?(a.removeChild(d),!1):!0;if(c==="menu"&&(a=g.$$array("li > *",a),a.length>0&&a[a.length-1].classList.contains("dropdownSeparator")))if(d=a[a.length-1],b)d.parentNode.parentNode.removeChild(d.parentNode);else return!0;return!1},renderCommands:function(a,c,b,d,e,f,i){if(typeof a!=="string")throw"a scope id for rendering must be specified";
c=g.node(c);if(!c)throw"no parent";var h=this._contributionsByScopeId[a];if(!b&&h){var b=h.localSelectionService||this._defaultSelectionService,j=this;b&&b.getSelections(function(b){j.renderCommands(a,c,b,d,e,f)})}else h&&(this._render(this._contributionsByScopeId[a],c,b,d,e||"button",f,i),this._checkForTrailingSeparator(c,e,!0))},destroy:function(a){a=g.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var c=a.firstChild;c.commandTooltip&&c.commandTooltip.destroy();c.emptyGroupTooltip&&c.emptyGroupTooltip.destroy();
this.destroy(c);a.removeChild(c)}},_render:function(a,b,f,i,h,g,j){var m=a.sortedContributions;if(!m){var m=[],k=!1,l;for(l in a)if(!a.hasOwnProperty||a.hasOwnProperty(l)){var o=a[l];if(o&&typeof o.position==="number")o.id=l,m.push(o),k=!0}if(k)m.sort(function(a,c){return a.position-c.position}),a.sortedContributions=m}for(a=0;a<m.length;a++){var z;if(m[a].children&&Object.getOwnPropertyNames(m[a].children).length>0){var o=m[a],k=m[a].children,q=this,s;if(h==="tool"||h==="button")if(o.title){s=this._createDropdownMenu(b,
o.title);j&&d.generateNavGrid(j,s.menuButton);var u=k,F=o;window.setTimeout(function(){q._render(u,s.menu,f,i,"menu",g,j);q._checkForTrailingSeparator(s.menu,"menu",!0);if(s.menu.childNodes.length===0)if(F.emptyGroupMessage){if(!s.menuButton.emptyGroupTooltip)s.menuButton.emptyGroupTooltip=new e.Tooltip({node:s.menuButton,text:F.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})}else j&&d.removeNavGrid(j,s.menuButton),s.menu.parentNode&&s.menu.parentNode.removeChild(s.menu),
s.destroyButton&&s.destroyButton.parentNode&&s.destroyButton.parentNode.removeChild(s.destroyButton);else s.menuButton.style.visibility="visible"},0)}else{var B;b.childNodes.length>0&&!this._checkForTrailingSeparator(b,h)&&(B=this.generateSeparatorImage(b));q._render(k,b,f,i,h,g,j);b.childNodes.length>0&&b.childNodes[b.childNodes.length-1]!==B&&(B=this.generateSeparatorImage(b))}else o.title?(l=document.createElement("li"),b.appendChild(l),o=this._createDropdownMenu(l,o.title,!0),q._render(k,o.menu,
f,i,"menu",g,j),o.menu.childNodes.length===0&&b.removeChild(l)):(b.childNodes.length>0&&this._generateMenuSeparator(b),q._render(k,b,f,i,h,g,j),this._generateMenuSeparator(b))}else{l=(k=this._commandList[m[a].id])?!0:!1;var H=null,H=null;if(k){z=new c(this,i,f,g,k);z.domParent=b;o=l&&(k.visibleWhen?k.visibleWhen(f):!0);if(this._activeBindings[k.id]&&this._activeBindings[k.id].keyBinding)H=this._activeBindings[k.id],H.invocation=o?z:null,H.bindingOnly&&(l=!1);if(this._urlBindings[k.id]&&this._urlBindings[k.id].urlBinding)H=
this._urlBindings[k.id],H.invocation=o?z:null,H.bindingOnly&&(l=!1);l=l&&o}if(l)if(k.choiceCallback){h==="tool"||h==="button"?(l=b,o=!1,b.nodeName.toLowerCase()==="ul"&&(l=document.createElement("li"),b.appendChild(l))):(l=b,o=!0);var K=this;this._createDropdownMenu(l,k.name,o,function(a){this.populateChoicesMenu(a,f,i,g,K)}.bind(k))}else h==="tool"?(l="tool"+k.id+a,k._addTool(b,l,z,j)):h==="button"?(l="button"+k.id+a,k._addButton(b,l,z,j)):h==="menu"&&k._addMenuItem(b,z,j)}}},_createDropdownMenu:function(a,
c,b,d){var a=g.node(a),e,i=document.createElement("span");i.classList.add("dropdownTrigger");b?(i.classList.add("dropdownMenuItem"),e="dropdownSubMenu",b="dropdownArrowRight",i.tabIndex=0,i.role="menuitem"):(i.classList.add("commandButton"),b="dropdownArrowDown",i.tabIndex=0,i.role="button");c=document.createTextNode(c);i.appendChild(c);c=document.createElement("span");c.classList.add(b);i.appendChild(c);b=a;a.nodeName.toLowerCase()==="ul"?(b=document.createElement("li"),a.appendChild(b),a=b):(i.classList.add("commandMargins"),
a=i);b.appendChild(i);e&&b.classList.add(e);e=document.createElement("ul");b.appendChild(e);e.classList.add("dropdownMenu");i.dropdown=new f.Dropdown({dropdown:e,populate:d});e.dropdown=i.dropdown;return{menuButton:i,menu:e,dropdown:i.dropdown,destroyButton:a}},_generateCheckedMenuItem:function(a,c,b,d){var e=document.createElement("li");a.appendChild(e);a=document.createElement("label");a.classList.add("dropdownMenuItem");var f=document.createElement("input");f.type="checkbox";f.role="menuitem";
f.checked=b;f.classList.add("checkedMenuItem");a.appendChild(f);c=document.createTextNode(c);a.appendChild(c);e.appendChild(a);f.addEventListener("change",d,!1)},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var c=document.createElement("li");c.classList.add("dropdownSeparator");var b=document.createElement("span");b.classList.add("dropdownSeparator");c.appendChild(b);a.appendChild(c)}},generateSeparatorImage:function(a){var c;c=a.nodeName.toLowerCase()==="ul"?
document.createElement("li"):document.createElement("span");a.appendChild(c);c.classList.add("core-sprite-sep");c.classList.add("imageSprite");c.classList.add("commandSeparator");return c}};a.prototype.constructor=a;m.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip||a.name;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;this.image=a.image||k.toUrl("images/none.png");this.imageClass=a.imageClass;this.spriteClass=a.spriteClass||
"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters},_addTool:function(a,c,b,f){b.handler=b.handler||this;var h;if(this.hrefCallback){if(h=this._makeLink(a,b,"commandLink"),!h)return}else h=document.createElement("span"),h.tabIndex=f?-1:0,h.role="button",this.hasImage()?(i(this,h,c),this.name&&h.setAttribute("aria-label",this.name)):(c=window.document.createTextNode(this.name),h.appendChild(c),h.classList.add("commandMissingImageButton"),h.classList.add("commandButton")),this._hookCallback(h,
b);b.domNode=h;b.domParent=a;if(this.tooltip)h.commandTooltip=new e.Tooltip({node:h,text:this.tooltip,position:["above","below","right","left"]});a.nodeName.toLowerCase()==="ul"?(c=document.createElement("li"),a.appendChild(c),a=c):h.classList.add("commandMargins");a.appendChild(h);d.generateNavGrid(f,b.domNode)},_addButton:function(a,c,b,f){b.handler=b.handler||this;var h;if(this.hrefCallback)h=this._makeLink(a,b,"commandLink");else if(!this.name&&this.hasImage()){if(h=document.createElement("span"),
h.tabIndex=0,h.role="button",i(this,h,c),this.tooltip&&h.setAttribute("aria-label",this.tooltip),this._hookCallback(h,b),this.tooltip)h.commandTooltip=new e.Tooltip({node:h,text:this.tooltip,position:["above","below","right","left"]})}else h=this._makeButton(a,b,"commandButton"),this._hookCallback(h,b);b.domParent=a;a.nodeName.toLowerCase()==="ul"?(c=document.createElement("li"),a.appendChild(c),a=c):h.classList.add("commandMargins");a.appendChild(h);d.generateNavGrid(f,b.domNode)},_addMenuItem:function(a,
c,b){c.domParent=a;var e,f=a.dropdown;this.hrefCallback?e=this._makeLink(a,c,"dropdownMenuItem",["right","left","above","below"]):(e=this._makeButton(a,c,"dropdownMenuItem",["right","left","above","below"]),this.callback&&this._hookCallback(e,c,function(){f.close(!0)}));e.role="menuitem";d.generateNavGrid(b,c.domNode);a.nodeName.toLowerCase()==="ul"?(c=document.createElement("li"),a.appendChild(c),a=c):e.classList.add("commandMargins");a.appendChild(e)},_makeButton:function(a,c,b,d){a=document.createElement("span");
a.role="button";a.tabIndex=0;a.id=this.name;var f=document.createTextNode(this.name);a.appendChild(f);b&&a.classList.add(b);if(this.tooltip)a.commandTooltip=new e.Tooltip({node:a,text:this.tooltip,position:d||["above","below","right","left"]});return c.domNode=a},_makeLink:function(a,c,b,d){var f=document.createElement("a");f.id=this.name;b&&f.classList.add(b);f.appendChild(document.createTextNode(this.name));if(this.hrefCallback)a=this.hrefCallback.call(c.handler,c),a.then?a.then(function(a){f.href=
a}):f.href=a?a:"#";if(this.tooltip)f.commandTooltip=new e.Tooltip({node:f,text:this.tooltip,position:d||["above","below","right","left"]});return c.domNode=f},_hookCallback:function(a,c,b,d){a.addEventListener("click",function(a){b&&b();c.commandService._invoke(c);d&&d();g.stop(a)},!1);a.addEventListener("keydown",function(a){if(a.keyCode===g.KEY.ENTER||a.keyCode===g.KEY.SPACE)b&&b(),c.commandService._invoke(c),d&&d(),g.stop(a)},!1)},populateChoicesMenu:function(a,c,b,d,e){b=this.getChoices(c,b,d);
for(d=0;d<b.length;d++){var f=b[d];if(f.name){var i=document.createElement("li");a.appendChild(i);var h=document.createElement("span");h.tabIndex=0;h.role="menuitem";h.classList.add("dropdownMenuItem");var j=document.createTextNode(f.name);h.appendChild(j);i.appendChild(h);h.choice=f;h.addEventListener("click",function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,c)},!1);h.addEventListener("keydown",function(a){(a.keyCode===g.KEY.ENTER||a.keyCode===g.KEY.SPACE)&&a.target.choice&&
a.target.choice.callback.call(a.target.choice,c)},!1)}else e._generateMenuSeparator(a)}},getChoices:function(a,c,b){return this.choiceCallback?this.choiceCallback.call(c,a,b):null},makeChoiceCallback:function(a,c){return function(b){a.callback&&a.callback.call(a,c,b)}},hasImage:function(){return this.imageClass||this.image!==k.toUrl("images/none.png")}};m.prototype.constructor=m;o.prototype={match:function(a){if(this.keyCode===a.keyCode){if(this.mod1!==(s?a.metaKey:a.ctrlKey))return!1;if(this.mod2!==
a.shiftKey)return!1;if(this.mod3!==a.altKey)return!1;if(s&&this.mod4!==a.ctrlKey)return!1;if(!this.domScope)return!0;for(a=a.target;a;){if(a===window.document)break;if(a===this.domScope)return!0;a=a.parentNode}}return!1},equals:function(a){return!a?!1:this.keyCode!==a.keyCode?!1:this.mod1!==a.mod1?!1:this.mod2!==a.mod2?!1:this.mod3!==a.mod3?!1:this.mod4!==a.mod4?!1:this.domScope!==a.domScope?!1:!0}};o.prototype.constructor=o;q.prototype={match:function(a){a=b.matchResourceParameters(a);return typeof a[this.token]!==
"undefined"?(this.parameterValue=a[this.token],this):null}};q.prototype.constructor=q;u.prototype={optionsRequested:function(){return this.optionsRequested}};u.prototype.constructor=u;l.prototype={_storeParameters:function(a){this.parameterTable=null;if(a){this.parameterTable={};for(var c=0;c<a.length;c++)this.parameterTable[a[c].name]=a[c]}},updateParameters:function(a){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(a))},hasParameters:function(){return this.parameterTable!==
null},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(a){return this.parameterTable[a]},valueFor:function(a){return(a=this.parameterTable[a])?a.value:null},setValue:function(a,c){var b=this.parameterTable[a];if(b)b.value=c},forEach:function(a){for(var c in this.parameterTable)this.parameterTable[c].type&&this.parameterTable[c].name&&a(this.parameterTable[c])},makeCopy:function(){var a=[];this.forEach(function(c){c=new u(c.name,c.type,c.label,
c.value,c.lines);a.push(c)});var c=new l(a,this._options,this.getParameters);c.clientCollect=this.clientCollect;return c},hasOptionalParameters:function(){return this._hasOptionalParameters}};l.prototype.constructor=l;return{CommandService:a,CommandKeyBinding:o,Command:m,CommandInvocation:c,URLBinding:q,ParametersDescription:l,CommandParameter:u}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(h,k,j,b){var g={};(function(){var f=!1;g.updateNavTools=function(b,d,c,a,i){var g=b.getService("orion.page.command"),k=j.node(c);if(k)g.destroy(k);else throw h["could not find toolbar "]+c;g.renderCommands(c,k,i,d,"button");if(a&&(c=j.node(a)))g.destroy(c),g.renderCommands(a,c,null,d,"button");f||(f=!0,b.getService("orion.page.selection").addEventListener("selectionChanged",
function(c){var f=j.node(a);if(f){var i=b.getService("orion.page.command");i.destroy(f);i.renderCommands(a,f,c.selections,d,"button")}}))};g.createOperationsCommands=function(e,d,c){function a(a){return!a.operation||!a.operation.type?!1:a.operation.type==="loadstart"||a.operation.type==="progress"}var f=new b.Command({name:h["Remove Completed"],tooltip:h["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){c.removeCompletedOperations().then(function(){d.loadOperations.bind(d)()})},
visibleWhen:function(){return!0}});e.addCommand(f);f=new b.Command({name:h.Remove,tooltip:h["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],b=0;b<a.length;b++){var e=a[b];c.removeOperation.bind(c)(e.Location).then(function(){d.loadOperations.bind(d)()},function(){d.loadOperations.bind(d)()})}},visibleWhen:function(c){if(!Array.isArray(c)||c.length===0)return!a(c);for(var b in c)if(a(c[b]))return!1;
return!0}});e.addCommand(f);f=new b.Command({name:h.Cancel,tooltip:h["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],c=0;c<a.length;c++){var b=a[c];b.deferred&&b.deferred.cancel()}},visibleWhen:function(c){if(!Array.isArray(c)||c.length===0)return a(c)&&(c.operation&&c.operation.cancelable?!0:!1);for(var b in c)if(!a(c[b])||!c[b].operation||!c[b].operation.cancelable)return!1;
return!0}});e.addCommand(f)}})();return g});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(h,k,j,b,g){function f(b){this._options=b}f.prototype=new b.PopupDialog;f.prototype.TEMPLATE='<table style="width: 360px;"><tr><td><h2>Recent operations</h2></td><td style="text-align: right;"><a id="allOperationsLink">All Operations</a></td></tr></table><span id="operationsExist"><span class="secondaryColumn" id="myOperationsListEmpty">No operations running on this page.</span><table id="myOperationsList" style="display: none;"></table></span><span class="secondaryColumn" id="operationsDontExist">No operations running.</span>';f.prototype._init=
function(b){this._myOperations=[];this._operationsDeferreds=[];this._commandService=b.serviceRegistry.getService("orion.page.command");g.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(b.triggerNode)};f.prototype._bindToDom=function(){this.$allOperationsLink.href=k.toUrl("operations/list.html");this._setOperationsVisibility()};f.prototype.setOperations=function(b,d){this._myOperations||
this._init(this._options);this._myOperations=[];this._operationsDeferreds=[];if(b)for(var c in b)this._myOperations.push(b[c]),this._operationsDeferreds.push(d[c]);this._renderOperations()};f.prototype.parseProgressResult=function(b){if(!b)return{};b=b.responseText||b;try{b=JSON.parse(b)}catch(d){}var c={Message:b.Message||b,Severity:b.Severity};if(b.DetailedMessage&&b.DetailedMessage!==c.Message)c.DetailedMessage=b.DetailedMessage;return c};f.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,
this._myOperations,this._operationsDeferreds)};f.prototype._renderOperationsTable=function(b,d,c){j.empty(b);for(var a=0;a<d.length;a++){var f=d[a],g=document.createElement("tr"),k=document.createElement("td");k.style.paddingLeft="5px;";k.style.paddingRight="5px;";k.textContent=f.Name;g.appendChild(k);var q=document.createElement("div");k.appendChild(q);k=document.createElement("span");q.appendChild(k);k.classList.add("imageSprite");var u=document.createElement("span");u.classList.add("primaryColumn");
q.appendChild(u);u.appendChild(document.createTextNode(f.Name));switch(f.type){case "Warning":k.classList.add("core-sprite-warning");k.setAttribute("aria-label",h["Operation resulted in a warning."]);break;case "error":k.classList.add("core-sprite-error");k.setAttribute("aria-label",h["Operation resulted in an error."]);break;case "loadstart":case "progress":k.classList.add("core-sprite-start");k.setAttribute("aria-label",h["Operation is running."]);break;case "abort":k.classList.add("core-sprite-stop");
k.setAttribute("aria-label",h["Operation is canceled."]);break;case "load":case "loadend":k.classList.add("core-sprite-ok"),k.setAttribute("aria-label","Operation ok.")}if(f.error)k=f.error.Message||f.error,f.error.DetailedMessage&&f.error.DetailedMessage!==""&&(k+=": "+f.error.DetailedMessage),q.appendChild(document.createElement("br")),u=document.createElement("span"),u.classList.add("secondaryColumn"),u.style.marginLeft="18px;",q.appendChild(u),u.textContent=k;k=document.createElement("span");
q.appendChild(k);this._commandService.renderCommands("operationsDialogItems",q,{operation:f,deferred:c[a]},this,"tool");b.appendChild(g)}this._setOperationsVisibility()};f.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"};f.prototype.constructor=f;return{OperationsDialog:f}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(h,k,j,b,g){function f(d,c){if(!this._progressPane){this._progressPane=b.node(d);this._operationsDialog=new g.OperationsDialog({triggerNode:this._progressPane,serviceRegistry:c});var a=this;this._progressPane.addEventListener("keydown",function(c){(c.charOrCode===" "||c.keyCode===b.KEY.ENTER)&&a._operationsDialog.show()})}}function e(b,c,a){this._serviceRegistry=
b;this._serviceRegistration=b.registerService("orion.page.progress",this);this._operationsClient=c;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=a}f.prototype={_switchIconTo:function(b){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=b;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(b,c){var a={},e;for(e in b)b[e].progressMonitor||
(a[e]=b[e]);if(this._isEmpty(a))this._switchIconTo("progressPane_empty"),this._progressPane.title=h.Operations,this._progressPane.alt=h.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var f="";for(e in a){var g=a[e];if(g.type&&(g.type==="loadstart"||g.type==="progress")){f="running";break}}switch(f){case "running":this._progressPane.title=h["Operations running"];this._progressPane.alt=h["Operations running"];this._progressPane.setAttribute("aria-valuetext",
h["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=h["Some operations finished with warning"];this._progressPane.alt=h["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",h["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=h["Some operations finished with error"];this._progressPane.alt=h["Some operations finished with error"];
this._progressPane.setAttribute("aria-valuetext",h["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=h.Operations,this._progressPane.alt=h.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_operations")}}this._operationsDialog.setOperations(a,c)},_isEmpty:function(b){for(var c in b)return!1;return!0}};f.prototype.constructon=f;e.prototype=
{init:function(b){if(!this._progressMonitorClass)this._progressMonitorTool=new f(b,this._serviceRegistry)},progress:function(b,c,a){var e=this,f=this._operationsIndex++;!a&&this._progressMonitorClass&&(a=new this._progressMonitorClass,a.begin(c));b.then(function(){if(e._operations[f]){var h=e._operations[f];if(c)h.Name=c;e._lastOperation=h;h.type="loadend";if(a)h.progressMonitor=a;e.writeOperation.bind(e)(f,h,b);h.Location||e._removeOperationFromTheList.bind(e)(f)}},function(h){if(e._operations[f]){var g=
e._operations[f];if(c)g.Name=c;if(a)g.progressMonitor=a;e._lastOperation=g;g.type=h.canceled?"abort":"error";g.error=h;e.writeOperation.bind(e)(f,g,b);g.Location||e._removeOperationFromTheList.bind(e)(f)}},function(h){if(c)h.Name=c;if(a)h.progressMonitor=a;e.writeOperation.bind(e)(f,h,b)});return b},removeOperation:function(b){for(var c in this._operations)if(this._operations[c].Location&&this._operations[c].Location===b){this._removeOperationFromTheList(c);break}this._operationsClient.removeOperation.bind(this._operationsClient)(b)},
_removeOperationFromTheList:function(b){var c=this._operations[b].progressMonitor;delete this._operations[b];delete this._operationDeferrds[b];c?c.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var b in this._operations){var c=this._operations[b];if(c.type&&c.type!=="loadstart"&&c.type!=="progress")(c=this._operations[b].progressMonitor)&&c.done(),delete this._operations[b],delete this._operationDeferrds[b]}this._progressMonitorTool.generateOperationsInfo(operations,
this._operationDeferrds)},setProgressResult:function(b){this._serviceRegistry.getService("orion.page.message").setProgressResult(b)},showWhile:function(b,c){c&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(c);var a=this;b.then(function(){a._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(c){a.setProgressResult.bind(a)(c);return c});return this.progress(b,c)},writeOperation:function(b,c,a){this._operations[b]=c;this._operationDeferrds[b]=
a;c.Location&&serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(a){a.put(c.Location,{Name:c.Name,expires:c.expires})});c.progressMonitor?c.progressMonitor.progress(c.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};e.prototype.constructor=e;return{ProgressService:e}});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/editor/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim".split(","),function(h,k,j,b,g,f,e){var d={},c=(new URL(h.toUrl("."),window.location)).href.slice(0,-1);d._cloneItemWithoutChildren=function i(c){if(c===null||typeof c!=="object")return c;var b=c.constructor(),d;for(d in c)d!=="children"&&d!=="Children"&&(b[d]=i(c[d]));return b};d._createOpenWithCommands=function(c){function b(c,d){for(var e=
c.getServiceReferences("orion.navigate.openWith"),f=[],i=0;i<e.length;i++){var h=e[i];h.getProperty("editor")===d.id&&(h=h.getProperty("contentType"),h instanceof Array?f=f.concat(h):h!==null&&typeof h!=="undefined"&&f.push(h))}return f}for(var d=function(){for(var b=c.getServiceReferences("orion.edit.editor"),d=[],e=0;e<b.length;e++){var f=b[e],h=f.getProperty("id");d.push({id:h,name:f.getProperty("name"),nameKey:f.getProperty("nameKey"),nls:f.getProperty("nls"),uriTemplate:f.getProperty("orionTemplate")||
f.getProperty("uriTemplate")})}return d}(),e=function(c){for(c=c.getServiceReferences("orion.navigate.openWith.default");0<c.length;)return{editor:c[0].getProperty("editor")};return null}(c),f=[],h=0;h<d.length;h++){var g=d[h],j=e&&e.editor===g.id,k=b(c,g);k.length&&f.push({properties:{name:g.name||g.id,nameKey:g.nameKey,id:"eclipse.openWithCommand."+g.id,tooltip:g.name,tooltipKey:g.nameKey,contentType:k,uriTemplate:g.uriTemplate,nls:g.nls,forceSingleItem:!0,isEditor:j?"default":"editor"},service:{}})}return f};
d._makeValidator=function(b,d,e,h){function j(c,b,d,e){var f=d.match,i;if(b.indexOf("|")>=0)return i=b.substring(0,b.indexOf("|")),b=b.substring(b.indexOf("|")+1),j(c,i,d,e)?!0:j(c,b,d,e);else if(b.indexOf(":")>=0)return i=b.substring(0,b.indexOf(":")),b=b.substring(b.indexOf(":")+1),c[i]?j(c[i],b,d,e):!1;else{a:{i=!1;var h;if(c[b]){if(f)if(typeof f==="string"){if(!typeof(c[b]==="string")){d=!1;break a}if(d.variableName){if(f=RegExp(f).exec(c[b]))i=f[0],h=d.variableMatchPosition==="before"?c[b].substring(0,
f.index):d.variableMatchPosition==="after"?c[b].substring(f.index+i.length):d.variableMatchPosition==="only"?i:c[b],i=!0}else{d=RegExp(f).test(c[b]);break a}}else c[b]===f&&(h=c[b],i=!0);else h=c[b],i=!0;if(i&&d.variableName&&(e[d.variableName]=h,e.itemCached=c,d.replacements))for(c=0;c<d.replacements.length;c++)b=!1,d.replacements[c].pattern?e[d.variableName]=e[d.variableName].replace(RegExp(d.replacements[c].pattern),d.replacements[c].replacement||""):b=!0,b&&window.console.log("Invalid replacements specified in validation property.  "+
d.replacements[c]);d=i}else d=!1}return d}}return{info:b,validationFunction:function(c){typeof h==="function"&&(c=h.call(this,c));if(c){if(Array.isArray(c)){if((this.info.forceSingleItem||this.info.uriTemplate)&&c.length!==1)return!1;if(c.length<1)return!1}else c=[c];for(var d=0;d<c.length;d++){var f;a:{var m=c[d],k=e;if(this.info.validationProperties)for(f=0;f<this.info.validationProperties.length;f++){var v=this.info.validationProperties[f];if(v.source){if(!j(m,v.source,v,this)){f=!1;break a}}else{window.console.log("Invalid validationProperties in "+
b.id+".  No source property specified.");f=!1;break a}}if(this.info.contentType&&k){v=!1;if(m=g.getFilenameContentType(m.Name,k))for(f=0;f<this.info.contentType.length;f++)if(m.id===this.info.contentType[f]){v=!0;break}f=v}else f=!0}if(!f)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(b){if(this.info.uriTemplate){var d={},e;for(e in b)b.hasOwnProperty(e)&&(d[e]=b[e]);if(this.info.validationProperties)for(e=0;e<this.info.validationProperties.length;e++){var i=
this.info.validationProperties[e];i.source&&i.variableName&&(this.itemCached===b&&this[i.variableName]||j(b,i.source,i,this),b[i.variableName]?window.console.log("Variable name "+i.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):d[i.variableName]=this[i.variableName])}d.OrionHome=c;b=new f(this.info.uriTemplate);return window.decodeURIComponent(b.expand(d))}return null}}};d._createCommandOptions=function(c,b,f,h,g,j){function s(e,k){var n=
d._makeValidator(c,f,h,j);e.visibleWhen=n.validationFunction.bind(n);if(g)if(n.generatesURI.bind(n)())e.hrefCallback=function(c){c=Array.isArray(c.items)?c.items[0]:c.items;return n.getURI.bind(n)(c)};else{var w=c;e.callback=function(c){var i;if(w.forceSingleItem)c=Array.isArray(c.items)?c.items[0]:c.items,i=d._cloneItemWithoutChildren(c);else if(Array.isArray(c.items)){i=[];for(var h=0;h<c.items.length;h++)i.push(d._cloneItemWithoutChildren(c.items[h]))}else i=d._cloneItemWithoutChildren(c.items);
if(f)var g=f.getService("orion.page.progress");b.run?g?g.progress(b.run(i),"Running command: "+e.name):b.run(i):f&&(g?g.progress(f.getService(b).run(i),"Running command: "+e.name):f.getService(b).run(i))}}k.resolve(e)}var n=new k;c.nls?e.getMessageBundle(c.nls).then(function(b){s({name:c.nameKey?b[c.nameKey]:c.name,image:c.image,id:c.id||c.name,tooltip:c.tooltipKey?b[c.tooltipKey]:c.tooltip,isEditor:c.isEditor},n)}):s({name:c.name,image:c.image,id:c.id||c.name,tooltip:c.tooltip,isEditor:c.isEditor},
n);return n};d.getOpenWithCommands=function(c){var b=[],d;for(d in c._commandList){var e=c._commandList[d];e.isEditor&&b.push(e)}return b};return d});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands".split(","),function(h,k,j,b,g,f){var e={};e.Explorer=function(){function d(c,a,b){this.registry=c;this.renderer=b;this.selection=a;this.myTree=null}d.prototype={changedItem:function(c,a){this.myTree&&this.myTree.refresh.bind(this.myTree)(c,a,!0)},updateCommands:function(c){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(c)},
makeNewItemPlaceHolder:function(c,a,b){c=this.getRow(c);if(b)return c=c.childNodes[b],c.appendChild(document.createElement("br")),b=document.createElement("span"),b.id=a+"placeHolderRow",c.appendChild(b),{tempNode:b,refNode:b};if(c){b=document.createElement("tr");b.id=a+"placeHolderRow";var d=document.createElement("td");d.id=a+"placeHolderCol";b.appendChild(d);c.appendChild(b);b=j.node(a+"placeHolderRow");c=j.node(a+"placeHolderCol");if(b&&c)return{tempNode:b,refNode:c}}return null},getRow:function(c){if(c=
this.model.getId(c))return j.node(c)},collapseAll:function(){for(var c=this._navHandler.getTopLevelNodes(),a=0;a<c.length;a++)this.myTree.collapse(c[a])},expandAll:function(c){if(c)this._expandRecursively(c);else if(this._navHandler)for(var c=this._navHandler.getTopLevelNodes(),a=0;a<c.length;a++)this._expandRecursively(c[a])},_expandRecursively:function(c){if(this._navHandler&&this._navHandler.isExpandable(c)){var a=this;this.myTree.expand(c,function(){a.model.getChildren(c,function(c){if(!(c===
void 0||c===null))for(var b=c.length,d=0;d<b;d++)a._expandRecursively(c[d])})})}},createTree:function(c,a,d){this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var e=c+"innerTree",f=j.node(e);f&&j.empty(f);if(a)a.rootId=e;this.model=a;this._parentId=c;this._treeOptions=d;if(!d||d&&!d.noSelection)this.selectionPolicy=d?d.selectionPolicy:"",this._navDict=new g.ExplorerNavDict(this.model);this.myTree=new b.TableTree({id:e,model:a,parent:c,labelColumnIndex:this.renderer.getLabelColumnIndex(),
renderer:this.renderer,showRoot:d?!!d.showRoot:!1,indent:d?d.indent:void 0,onCollapse:d?d.onCollapse:void 0,tableElement:d?d.tableElement:void 0,tableBodyElement:d?d.tableBodyElement:void 0,tableRowElement:d?d.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 c=this.getNavHandler(),a=[];
if(c&&this.getNavDict())for(var b=c.getSelection(),d=0;d<b.length;d++){var e=c.getRowDiv(b[d]);e&&e.parentNode&&(e=this.getNavDict().getValue(this.model.getId(b[d])),e.model&&a.push(e.model))}this.selection.setSelections(a)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var c=this._treeOptions;if(!c||c&&!c.noSelection){if(!this.getNavHandler())this._navHandler=new g.ExplorerNavHandler(this,this._navDict,{setFocus:c&&c.setFocus,
selectionPolicy:c?c.selectionPolicy:null});var a=this;this.model.getRoot(function(b){b instanceof Array?a.getNavHandler().refreshModel(a.getNavDict(),a.model,b):b.children&&b.children instanceof Array&&a.getNavHandler().refreshModel(a.getNavDict(),a.model,b.children);c&&c.setFocus&&a.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return d}();e.createExplorerCommands=function(b,c){function a(a){return typeof a.getItemCount==="function"?a.getItemCount()>0?c?c(a):!0:!1:!1}var e=
new f.Command({tooltip:h["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(c){return a(c)},callback:function(a){a.items.expandAll()}}),g=new f.Command({tooltip:h["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(c){return a(c)},callback:function(a){a.items.collapseAll()}});b.addCommand(e);b.addCommand(g)};e.ExplorerModel=function(){function b(c,
a,d){this.rootPath=c;this.fetchItems=a;this.idPrefix=d||""}b.prototype={destroy:function(){},getRoot:function(c){var a=this;this.fetchItems(this.rootPath).then(function(b){a.root=b;c(b)})},getChildren:function(c,a){c.Children?a(c.Children):c.ChildrenLocation?this.fetchItems(c.ChildrenLocation).then(function(b){c.Children=b;a(b)}):a([])},getId:function(c){if(c.Location===this.root.Location)return this.rootId;for(var c=c.Location.replace(/[\\\/]/g,""),a=this.idPrefix,b=0;b<c.length;b++)a+=c[b].match(/[^\.\:\-\_0-9A-Za-z]/g)?
c.charCodeAt(b):c[b];return a}};return b}();e.ExplorerFlatModel=function(){function b(c,a,d){this.rootPath=c;this.fetchItems=a;this.root=d}b.prototype=new e.ExplorerModel;b.prototype.getRoot=function(c){if(this.root)c(this.root);else{var a=this;this.fetchItems(this.rootPath).then(function(b){a.root=b;c(b)})}};b.prototype.getChildren=function(c,a){c===this.root?a(this.root):a([])};return b}();e.ExplorerRenderer=function(){function b(c,a){this.explorer=a;this._init(c);this._expandImageClass="core-sprite-openarrow";
this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite"}b.prototype={_init:function(c){if(c){this._useCheckboxSelection=c.checkbox===void 0?!1:c.checkbox;this.selectionPolicy=c.singleSelection?"singleSelection":"";this._cachePrefix=c.cachePrefix;this.getCheckedFunc=c.getCheckedFunc;this.onCheckedFunc=c.onCheckedFunc;this._highlightSelection=!0;this._treeTableClass=c.treeTableClass||"treetable";if(c.highlightSelection===!1)this._highlightSelection=!1;if(!this.actionScopeId)this.actionScopeId=
c.actionScopeId}},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(c,a){this.tableTree=a;j.empty(c);this._treeTableClass&&c.classList.add(this._treeTableClass);this.renderTableHeader(c)},getActionsColumn:function(c,a,b,d,e){var b=b||"tool",f=this.explorer.registry.getService("orion.page.command"),h=document.createElement("td");h.id=a.id+"actionswrapper";d&&h.classList.add(d);this.actionScopeId?f.renderCommands(this.actionScopeId,h,c,this.explorer,b,null,e&&this.explorer.getNavDict()?
this.explorer.getNavDict().getGridNavHolder(c,!0):null):window.console.log("Warning, no action scope was specified.  No commands rendered.");return h},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(c,a){if(this._useCheckboxSelection){var b=document.createElement("td"),d=document.createElement("span");d.id=this.getCheckBoxId(a.id);d.classList.add("core-sprite-check");d.classList.add("selectionCheckmarkSprite");d.rowId=a.id;
if(this.getCheckedFunc)d.checked=this.getCheckedFunc(c),d.checked?(this._highlightSelection&&a.classList.add("checkedRow"),d.classList.add("core-sprite-check_on")):(this._highlightSelection&&a.classList.remove("checkedRow"),d.classList.remove("core-sprite-check_on"));b.appendChild(d);var e=this;d.addEventListener("click",function(c){e.onCheck(a,c.target,c.target.checked?!1:!0,!0)},!1);return b}},getCheckBoxId:function(c){return c+"selectedState"},onCheck:function(c,a,b,d,e){(a.checked=b)?a.classList.add("core-sprite-check_on"):
a.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(a.rowId,b,d);this.explorer.getNavHandler()&&e&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(c.id).model,!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var c=this.explorer.getNavHandler().getSelectionIds(),a=this._getUIStatePreferencePath();a&&window.sessionStorage&&(window.sessionStorage[a+"selection"]=JSON.stringify(c))}},_restoreSelections:function(c){c=window.sessionStorage[c+
"selection"];typeof c==="string"&&(c=c.length>0?JSON.parse(c):null);var a;if(c&&this.explorer.getNavDict()){var b=[];for(a=0;a<c.length;a++){var d=this.explorer.getNavDict().getValue(c[a]);if(d&&d.rowDomNode&&d.model&&(b.push(d.model),this._highlightSelection&&d.rowDomNode.classList.add("checkedRow"),d=j.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(c){window.sessionStorage[c+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(c){var a=!1,b=window.sessionStorage[c+"expanded"];typeof b==="string"&&(b=b.length>0?JSON.parse(b):null);var d;if(b)for(d=0;d<b.length;d++)if(j.node(b[d])){this._expanded.push(b[d]);var e=this;this.tableTree.expand(b[d],function(){e._restoreSelections(c)});a=!0}return!a},_getUIStatePreferencePath:function(){if(this.explorer){var c=this.explorer.getRootPath();if(this._cachePrefix&&
c)return"/"+this._cachePrefix+"/"+c.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(c){return c+"__expand"},updateExpandVisuals:function(c,a){var b=j.node(this.expandCollapseImageId(c.id));b&&(b.classList.add(a?this._expandImageClass:this._collapseImageClass),b.classList.remove(a?this._collapseImageClass:this._expandImageClass))},getExpandImage:function(c,a,b,d){var e=document.createElement("span");e.id=this.expandCollapseImageId(c.id);a.appendChild(e);e.classList.add(this._twistieSpriteClass);
e.classList.add(this._collapseImageClass);if(b){var f=document.createElement("span");a.appendChild(f);f.classList.add(d||"imageSprite");f.classList.add(b)}var h=this;e.onclick=function(){h.tableTree.toggle(c.id);if(h.tableTree.isExpanded(c.id))h._expanded.push(c.id);else for(var a in h._expanded)if(h._expanded[a]===c.id){h._expanded.splice(a,1);break}(a=h._getUIStatePreferencePath())&&window.sessionStorage&&h._storeExpansions(a)};return e},render:function(c,a){a.classList.add("navRow");this.renderRow(c,
a)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),this.explorer.initNavHandler())},updateCommands:function(){for(var c=this.explorer.registry,a=j.$$array(".treeTableRow"),b=0;b<a.length;b++){var d=a[b],e=j.node(d.id+"actionswrapper"),f=c.getService("orion.page.command");f.destroy(e);this.actionScopeId&&f.renderCommands(this.actionScopeId,e,d._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var c=this._getUIStatePreferencePath();
c&&window.sessionStorage&&this._restoreExpansions(c)&&this._restoreSelections(c)}};return b}();e.SelectionRenderer=function(){function b(c,a){this._init(c);this.explorer=a}b.prototype=new e.ExplorerRenderer;b.prototype.renderTableHeader=function(c){var a=document.createElement("thead"),b=document.createElement("tr");a.classList.add("navTableHeading");this._useCheckboxSelection&&b.appendChild(this.initCheckboxColumn(c));for(var d=0,e=this.getCellHeaderElement(d);e;)e.innerHTML.length>0&&e.classList.add("navColumn"),
b.appendChild(e),e=this.getCellHeaderElement(++d);a.appendChild(b);c.appendChild(a)};b.prototype.renderRow=function(c,a){a.verticalAlign="baseline";a.classList.add("treeTableRow");var b=this.explorer.getNavDict();if(b){b.addRow(c,a);var d=this;a.addEventListener("click",function(a){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(c,a)},!1)}if(b=this.getCheckboxColumn(c,a))b.classList.add("checkColumn"),a.appendChild(b);for(var b=0,e=this.getCellElement(b,c,a);e;)a.appendChild(e),b===
0?this.getPrimColumnStyle?e.classList.add(this.getPrimColumnStyle()):e.classList.add("navColumn"):this.getSecondaryColumnStyle?e.classList.add(this.getSecondaryColumnStyle()):e.classList.add("secondaryColumn"),e=this.getCellElement(++b,c,a)};b.prototype.getCellHeaderElement=function(){};b.prototype.getCellElement=function(){};return b}();e.SimpleFlatModel=function(){function b(c,a,d){this.items=c;this.getKey=d;this.idPrefix=a;this.root={children:c}}b.prototype=new e.ExplorerModel;b.prototype.getRoot=
function(c){c(this.root)};b.prototype.destroy=function(){};b.prototype.getId=function(c){for(var c=this.getKey(c).replace(/[\\\/]/g,""),a="",b=0;b<c.length;b++)a+=c[b].match(/[^\.\:\-\_0-9A-Za-z]/g)?c.charCodeAt(b):c[b];return this.idPrefix+a};b.prototype.getChildren=function(c,a){c===this.root?a(this.items):a([])};return b}();return e});
define("orion/git/widgets/RemotePrompterDialog",["i18n!git/nls/gitmessages","orion/webui/dialog","orion/explorers/explorer","orion/selection"],function(h,k,j,b){function g(b,c){this.explorer=c;this._init(b)}function f(b){this._init(b)}var e=function(){function b(c,a,d,e){this.gitClient=c;this.rootPath=a;this.fetchItems=d;this.root=e?e:null}b.prototype=new j.ExplorerModel;b.prototype.getRoot=function(c){var a=this;this.root?c(this.root):this.fetchItems(this.rootPath).then(function(b){a.root=b;c(b)})};
b.prototype.getIdentity=function(c){c.Location?(c=c.Location,c=c.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")):c="ROOT";return c};b.prototype.getChildren=function(c,a){c.children=[];if(c.Children){for(var b=0;b<c.Children.length;b++)c.Children[b].parent=c,c.children[b]=c.Children[b];a(c.Children)}else c.BranchLocation&&c.RemoteLocation?(c.children=[{GroupNode:"true",Location:c.BranchLocation,Name:"Branches",parent:c},{GroupNode:"true",Location:c.RemoteLocation,BranchLocation:c.BranchLocation,Name:"Remotes",
parent:c},{GroupNode:"true",Location:c.TagLocation,Name:"Tags",parent:c}],a(c.children)):c.GroupNode?this.gitClient.getGitBranch(c.Location).then(function(b){c.children=b.Children;for(var d=0;d<b.Children.length;d++)b.Children[d].parent=c;a(b.Children)}):c.Type==="Remote"&&this.gitClient.getGitBranch(c.Location).then(function(b){c.children=b.Children;for(var d=0;d<b.Children.length;d++)b.Children[d].parent=c;a(b.Children)})};return b}();g.prototype=new j.SelectionRenderer;g.prototype.constructor=
g;g.prototype.getLabelColumnIndex=function(){return 0};g.prototype.getCellElement=function(b,c,a){var e=document.createElement("td");a.appendChild(e);b=document.createElement("span");b.id=a.id+"navSpan";e.appendChild(b);b.className="mainNavColumn singleNavColumn";(c.children||c.Children||c.GroupNode||c.Type==="Remote"||c.BranchLocation&&c.RemoteLocation)&&this.getExpandImage(a,b);a=c.Name;c.Type==="RemoteTrackingBranch"&&!c.Id&&(a=c.Name+h[" [New branch]"]);b.appendChild(document.createTextNode(a))};
f.prototype=new k.Dialog;f.prototype.TEMPLATE='<div><div id="treeContentPane" style="width:25em; min-height: 25em; max-height: 30em; height: auto; overflow-y: auto; padding: 8px"></div><div id="newBranchPane" style="padding: 8px"><label for="newBranch">${New Branch:}</label><input id="newBranch" value="" disabled=true/></div></div>';f.prototype._init=function(b){var c=this;this.title=b.title||h["Choose a Folder"];this.modal=!0;this.messages=h;this.func=b.func;this.treeRoot=b.treeRoot;this.gitClient=
b.gitClient;this.hideNewBranch=b.hideNewBranch;this.serviceRegistry=b.serviceRegistry;this.buttons=[];this.buttons.push({callback:function(){c.$remoteOk.classList.contains(this.DISABLED)||(c.destroy(),c._execute.bind(c)())},text:"OK",isDefault:!0,id:"remoteOk"})};f.prototype._bindToDom=function(){var b=this;this.$newBranch.addEventListener("input",function(){b._validate()});if(this.hideNewBranch)this.$newBranchPane.style.display="none"};f.prototype._beforeShowing=function(){this._initialize();this._loadRemoteChildren()};
f.prototype._afterShowing=function(){this.$treeContentPane.focus();this._validate()};f.prototype._loadRemoteChildren=function(){this._createTree(new e(this.gitClient,null,this.gitClient.getGitClone,this.treeRoot))};f.prototype._createTree=function(d){var c=this,a=this.serviceRegistry.getService("orion.remotePrompter.selection");a||(a=new b.Selection(this.serviceRegistry,"orion.remotePrompter.selection"));var e=new g({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"});this.explorer=
new j.Explorer(this.serviceRegistry,a,e);e.explorer=this.explorer;this.explorer.createTree("treeContentPane",d);a.addEventListener("selectionChanged",function(a){c.$newBranch.disabled=a.selection&&a.selection.Type==="Remote"?!1:!0;c._validate(a.selection)})};f.prototype._validate=function(b){var c=function(a){a&&a.Type==="RemoteTrackingBranch"?this.$remoteOk.classList.remove(this.DISABLED):a&&a.Type==="Remote"&&this.$newBranch.value!==""?this.$remoteOk.classList.remove(this.DISABLED):this.$remoteOk.classList.add(this.DISABLED)};
b?c.bind(this)(b):this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(c.bind(this))};f.prototype._execute=function(){var b=this;this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(function(c){if(b.func)if(c.Type==="RemoteTrackingBranch")b.func(c,c.parent);else{var a=c.CloneLocation.substring(c.CloneLocation.indexOf(c.CloneLocation.split("/")[3])),e={};e.parent=c;e.FullName="refs/remotes/"+c.Name+"/"+b.$newBranch.value;e.Name=c.Name+"/"+b.$newBranch.value;
e.Type="RemoteTrackingBranch";e.Location="/gitapi/remote/"+c.Name+"/"+encodeURIComponent(b.$newBranch.value)+"/"+a;b.func(null,c,e)}})};f.prototype.constructor=f;return{RemotePrompterDialog:f}});
define("orion/explorers/explorer-table","i18n!orion/navigate/nls/messages,require,orion/Deferred,orion/webui/littlelib,orion/i18nUtil,orion/fileUtils,orion/explorers/explorer".split(","),function(h,k,j,b,g,f,e){function d(a,c,b,d,e,f){this.registry=a;this.root=c;this.fileClient=b;this.idPrefix=d||"";this.excludeFiles=!!e;this.excludeFolders=!!f}function c(a){this.registry=a.serviceRegistry;this.treeRoot=a.treeRoot;this.selection=a.selection;this.fileClient=a.fileClient;this.excludeFiles=a.excludeFiles;
this.excludeFolders=a.excludeFolders;this.parentId=a.parentId;this.renderer=a.rendererFactory(this);this.dragAndDrop=a.dragAndDrop;this.myTree=this.model=null;this._hookedDrag=this.checkbox=!1;var c=this.renderer;this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(a){c.setTarget(a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?"_blank":"_self":"_self")}},{pid:"nav.config"})}d.prototype=new e.ExplorerModel;d.prototype.getRoot=function(a){a(this.root)};d.prototype.processParent=
function(a,c){if(this.excludeFiles||this.excludeFolders){var b=[],d;for(d in c)if(!(c[d].Directory?this.excludeFolders:this.excludeFiles))b.push(c[d]),c[d].parent=a;c=b}else for(b in c)c[b].parent=a;a.children=c;a.children.sort(function(a,c){var b=a.Directory;if(b!==c.Directory)return b?-1:1;var b=a.Name&&a.Name.toLowerCase(),d=c.Name&&c.Name.toLowerCase();return b<d?-1:b>d?1:0});return c};d.prototype.getChildren=function(a,c){var b=this;a.children?c(a.children):a.Directory!==void 0&&a.Directory===
!1?c([]):a.Location?this.registry.getService("orion.page.progress").progress(this.fileClient.fetchChildren(a.ChildrenLocation),"Fetching children of "+a.Name).then(function(d){c(b.processParent(a,d))}):c([])};d.prototype.constructor=d;c.prototype=new e.Explorer;c.prototype._makeDropTarget=function(a,c,d){function e(a,c,b,d,f,i){c=c||"";if(a.isFile)b.Location.indexOf("/workspace")===0?d.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:h["You cannot copy files directly into the workspace.  Create a folder first."]}):
a.file(function(a){f(b,a,d,a.name.indexOf(".zip")===a.name.length-4&&window.confirm(g.formatMessage(h["Unzip ${0}?"],a.name)))});else if(a.isDirectory){var j=a.createReader(),k=function(b){j.readEntries(function(h){for(var g=0;g<h.length;g++)e(h[g],c+a.name+"/",b,d,f,i)})},m=d.registry.getService("orion.page.progress");b.Location.indexOf("/workspace")===0?m.progress(i.createProject(b.ChildrenLocation,a.name),"Initializing project "+a.name).then(function(a){d.loadResourceList(d.treeRoot.Path,!0);m.progress(i.read(a.ContentLocation,
!0),"Loading project info "+a.name).then(function(a){k(a)})}):m.progress(i.createFolder(b.Location,a.name),"Creating folder "+a.name).then(function(a){d.changedItem(b,!0);k(a)})}}if(this.dragAndDrop){var f=this,j=this.dragAndDrop,k=function(a){c.classList.remove("dragOver");a.preventDefault();a.stopPropagation()};if(d)this._oldDragLeave&&c.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=k;c.addEventListener("dragleave",k,!1);k=function(a){if(a.dataTransfer.effectAllowed===
"all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0)a.dataTransfer.dropEffect="copy";c.classList.add("dragOver");b.stop(a)};if(d)this._oldDragEnter&&c.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=k;c.addEventListener("dragenter",k,!1);k=function(a){if(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0)a.dataTransfer.dropEffect="copy";b.stop(a)};
if(d&&!this._oldDragOver)c.addEventListener("dragover",k,!1),this._oldDragOver=k;k=function(d){c.classList.remove("dragOver");if(d.dataTransfer.items&&d.dataTransfer.items.length>0)for(var k=0;k<d.dataTransfer.items.length;k++){var m=null;typeof d.dataTransfer.items[k].getAsEntry==="function"?m=d.dataTransfer.items[k].getAsEntry():typeof d.dataTransfer.items[k].webkitGetAsEntry==="function"&&(m=d.dataTransfer.items[k].webkitGetAsEntry());m&&e(m,null,a,f,j,f.fileClient)}else if(d.dataTransfer.files&&
d.dataTransfer.files.length>0)for(k=0;k<d.dataTransfer.files.length;k++)m=d.dataTransfer.files[k],!m.length&&(!m.type||m.type==="")?f.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:g.formatMessage(h["Did not drop ${0}.  Folder drop is not supported in this browser."],m.name)}):a.Location.indexOf("/workspace")===0?f.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:h["You cannot copy files directly into the workspace.  Create a folder first."]}):
j(a,m,f,m.name.indexOf(".zip")===m.name.length-4&&window.confirm(g.formatMessage(h["Unzip ${0}?"],m.name)));b.stop(d)};if(d)this._oldDrop&&c.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=k;c.addEventListener("drop",k,!1)}};c.prototype.changedItem=function(a,c){var b=this;this.registry.getService("orion.page.progress").progress(this.fileClient.fetchChildren(a.ChildrenLocation),"Fetching children of "+a.Name).then(function(d){d=b.model.processParent(a,d);b.getNavHandler();b.myTree.refresh.bind(b.myTree)(a,
d,c)})};c.prototype.isExpanded=function(a){return this.renderer.tableTree.isExpanded(this.model.getId(a))};c.prototype.getNameNode=function(a){if(a=this.model.getId(a))return b.node(a+"NameLink")};c.prototype.scopeUp=function(){if(this.treeRoot&&this.treeRoot.Parents)if(this.treeRoot.Parents.length===0)window.location.href="#";else if(this.treeRoot.Parents[0].ChildrenLocation)window.location.href="#"+this.treeRoot.Parents[0].ChildrenLocation};c.prototype.loadResourceList=function(a,c,b){a=f.makeRelative(a);
if(c||a!==this._lastPath){this._lastPath=a;var d=this;(c||a!==this.treeRoot.Path)&&this.load(this.fileClient.loadWorkspace(a),"Loading "+a,function(){d.treeRoot.Path=a;typeof b==="function"&&b()})}};c.prototype.load=function(a,c,e){var f=b.node(this.parentId),g=b.node("progress");if(!g)g=document.createElement("div"),g.id="progress",b.empty(f),f.appendChild(g);b.empty(g);var k=setTimeout(function(){b.empty(g);g.appendChild(document.createTextNode(c))},500),l=this;j.when(a,function(a){l.treeRoot={};
clearTimeout(k);for(var c in a)l.treeRoot[c]=a[c];l.model=new d(l.registry,l.treeRoot,l.fileClient,l.parentId,l.excludeFiles,l.excludeFolders);l.model.processParent(l.treeRoot,a.Children);if(l.dragAndDrop)l._hookedDrag?l._makeDropTarget(l.treeRoot,f,!0):(a=(a=f&&("draggable"in f||"ondragstart"in f&&"ondrop"in f))&&!(!window.File||!window.FileList||!window.FileReader),l._hookedDrag=!0,a?l._makeDropTarget(l.treeRoot,f,!0):(l.dragAndDrop=null,window.console.log("Local file drag and drop is not supported in this browser.")));
l.createTree(l.parentId,l.model,{setFocus:!0,selectionPolicy:l.renderer.selectionPolicy,onCollapse:function(a){if(l.getNavHandler())l.getNavHandler().onCollapse(a)}});if(typeof e==="function")try{e()}catch(b){l.registry&&l.registry.getService("orion.page.message").setErrorMessage(b)}if(typeof l.onchange==="function")l.onchange(l.treeRoot)},function(a){clearTimeout(k);if(a.status&&a.status!==401){try{a=JSON.parse(a.responseText)}catch(c){}b.empty(g);g.appendChild(document.createTextNode(h["Sorry, an error occurred: "]+
a.Message))}else l.registry.getService("orion.page.message").setProgressResult(a)})};c.prototype.onchange=function(){};c.prototype.constructor=c;return{FileExplorer:c,FileModel:d}});
define("orion/webui/dialogs/DirectoryPrompterDialog","i18n!orion/widgets/nls/messages,orion/webui/littlelib,orion/webui/dialog,orion/fileUtils,orion/selection,orion/explorers/navigationUtils,orion/explorers/explorer,orion/explorers/explorer-table".split(","),function(h,k,j,b,g,f,e,d){function c(a,c){this.explorer=c;this._init(a)}function a(a){this._init(a)}c.prototype=new e.SelectionRenderer;c.prototype.constructor=c;c.prototype.getLabelColumnIndex=function(){return 0};c.prototype.getCellElement=
function(a,c,b){a=document.createElement("td");b.appendChild(a);var d=document.createElement("span");d.id=b.id+"navSpan";a.appendChild(d);d.className="mainNavColumn singleNavColumn";this.getExpandImage(b,d);d.appendChild(document.createTextNode(c.Name))};a.prototype=new j.Dialog;a.prototype.TEMPLATE='<div id="message" style="width: 25em; padding-bottom: 5px;"></div><div id="directoryTree" class="explorerTreeClass" style="width:25em; min-height: 25em; max-height:30em; height: auto; overflow-y: auto;"></div>';
a.prototype._init=function(a){this.title=a.title||h["Choose a Folder"];this.modal=!0;this.buttons=[{text:h.OK,isDefault:!0,callback:this.done.bind(this)}];this.customFocus=!0;this._fileClient=a.fileClient;this._serviceRegistry=a.serviceRegistry;this._message=a.message||"";this._func=a.func;this._initialize()};a.prototype._bindToDom=function(){this.loadFolderList("/");this._message?this.$message.appendChild(document.createTextNode(this._message)):this.$message.style.display="none";this.$directoryTree.focus()};
a.prototype.loadFolderList=function(a){a=b.makeRelative(a);this.selection=new g.Selection(this._serviceRegistry,"orion.directoryPrompter.selection");this.explorer=new d.FileExplorer({treeRoot:{children:[]},selection:this.selection,serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,parentId:"directoryTree",excludeFiles:!0,rendererFactory:function(a){return new c({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"},a)}});this.explorer.loadResourceList(a,!0,null)};a.prototype.done=
function(){this.selection.getSelection(function(a){this.hide();this._func(a)}.bind(this))};a.prototype.constructor=a;return{DirectoryPrompterDialog:a}});
define("orion/git/widgets/CloneGitRepositoryDialog",["i18n!git/nls/gitmessages","orion/webui/dialogs/DirectoryPrompterDialog","orion/webui/dialog"],function(h,k,j){function b(b){this._init(b)}b.prototype=new j.Dialog;b.prototype.TEMPLATE='<span id="basicPane"><div style="padding: 8px"><label for="gitUrl">${Repository URL:}</label><input id="gitUrl" style="width: 50em" value=""/></div><div style="padding: 8px; text-align: right;"><a id="advancedLink" href="javascript:">${Choose target location}</a><a id="advancedLinkHide" href="javascript:" style="display: none">${Default target location}</a></div></span><span id="advancedPane" style="display: none;"><div style="padding: 8px"><input id="isNewProject" type="radio" name="isNewProject" checked value="new"/><label for="gitName" style="padding: 0 8px">${New folder:}</label><input id="gitName" value=""></div><div style="padding: 8px"><input id="isExistingProject" type="radio" name="isNewProject" value="existing"/><label for="gitPath" style="padding: 0 8px">${Existing directory:}</label><input id="gitPath" type="hidden" value=""><span id="shownGitPath" style="padding-right: 24px"></span><a id="changeGitPath" href="javascript:">${Change...}</a></div></span>';b.prototype._init=
function(b){var f=this;this.title=b.title?b.title:h["Clone Git Repository"];this.modal=!0;this.messages=h;this.advancedShown=!1;this.alwaysShowAdvanced=b.alwaysShowAdvanced;this.advancedOnly=b.advancedOnly;this.url=b.url;this.serviceRegistry=b.serviceRegistry;this.fileClient=b.fileClient;this.func=b.func;this.buttons=[];this.buttons.push({callback:function(){f.destroy();f._execute()},text:"OK"});this._initialize()};b.prototype._bindToDom=function(){var b=this;if(this.url)this.$gitUrl.value=this.url;
if(this.advancedOnly)this.$basicPane.style.display="none",this.$advancedPane.style.display="",setTimeout(function(){b.$gitName.focus()},400);this.$changeGitPath.addEventListener("click",function(){b._openDirectoryPickerDialog()});this.$isExistingProject.addEventListener("click",function(){b._checkNewExisting()});this.$isNewProject.addEventListener("click",function(){b._checkNewExisting()});this.$gitName.addEventListener("focus",function(){b._showNewProject()});this.$advancedLink.addEventListener("click",
function(){b._showAdvanced()});this.$advancedLinkHide.addEventListener("click",function(){b._hideAdvanced()});this.alwaysShowAdvanced&&this._showAdvanced()};b.prototype._execute=function(){this.func&&this.func(this.advancedOnly?void 0:this.$gitUrl.value,this.advancedShown&&this.$isNewProject.checked?void 0:this.$gitPath.value,this.advancedShown&&!this.$isNewProject.checked?void 0:this.$gitName.value)};b.prototype._showAdvanced=function(){this.advancedShown=!0;this.$advancedPane.style.display="";this.$advancedLink.style.display=
"none";this.$advancedLinkHide.style.display=""};b.prototype._hideAdvanced=function(){this.advancedShown=!1;this.$advancedPane.style.display="none";this.$advancedLink.style.display="";this.$advancedLinkHide.style.display="none"};b.prototype._checkNewExisting=function(){this.$isExistingProject.checked?this._openDirectoryPickerDialog():this.$gitName.focus()};b.prototype._showNewProject=function(){this.$isNewProject.checked=!0};b.prototype._openDirectoryPickerDialog=function(){function b(d){var c=document.createElement("a");
c.href=require.toUrl("navigate/table.html")+"#"+d.ChildrenLocation;c.textContent=d.Name;return c}var f=this;this.$isExistingProject.checked=!0;var e=new k.DirectoryPrompterDialog({title:h["Choose a Folder"],serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,func:function(d){if(d&&d.Location){for(f.$gitPath.value=d.Location;f.$shownGitPath.hasChildNodes();)f.$shownGitPath.removeChild(f.$shownGitPath.lastChild);for(f.$shownGitPath.appendChild(b(d));d.parent&&d.parent.Location!=="/";)f.$shownGitPath.insertBefore(document.createTextNode("/"),
f.$shownGitPath.firstChild),f.$shownGitPath.insertBefore(b(d.parent),f.$shownGitPath.firstChild),d=d.parent}}});this._addChildDialog(e);e.show()};b.prototype.constructor=b;return{CloneGitRepositoryDialog:b}});
define("orion/section",["orion/webui/littlelib","orion/selection","orion/commands","orion/commonHTMLFragments"],function(h,k,j,b){function g(e,d){var c=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite";if(!d.id)throw Error("Missing required argument: id");this.id=d.id;if(!d.title)throw Error("Missing required argument: title");var a=d.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:
["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");e.appendChild(this.domNode);for(var f=0;f<a.length;f++)this.domNode.classList.add(a[f]);this.domNode.id=d.id;if(d.canHide)this.twistie=document.createElement("span"),this.twistie.classList.add("modelDecorationSprite"),this.twistie.classList.add("layoutLeft"),this.twistie.classList.add("sectionTitle"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),this.domNode.tabIndex=0,this.domNode.addEventListener("click",
function(a){(a.target===c.titleNode||a.target===c.twistie)&&c._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===h.KEY.ENTER&&(a.target===c.domNode||a.target===c.titleNode||a.target===c.twistie)&&c._changeExpandedState()},!1);if(d.iconClass){var g=document.createElement("span");g.classList.add("sectionIcon");this.domNode.appendChild(g);(Array.isArray(d.iconClass)?d.iconClass:[d.iconClass]).forEach(function(a){g.classList.add(a)})}this.titleNode=document.createElement("div");
this.titleNode.id=d.id+"Title";this.titleNode.classList.add("sectionAnchor");this.titleNode.classList.add("sectionTitle");this.titleNode.classList.add("layoutLeft");this.domNode.appendChild(this.titleNode);this.titleNode.textContent=d.title;if(typeof d.getItemCount==="function")a=document.createElement("div"),a.classList.add("layoutLeft"),a.classList.add("sectionItemCount"),this.domNode.appendChild(a),a.textContent=d.getItemCount(this);this._progressNode=document.createElement("div");this._progressNode.id=
d.id+"Progress";this._progressNode.classList.add("sectionProgress");this._progressNode.classList.add("sectionTitle");this._progressNode.classList.add("layoutLeft");this._progressNode.style.visibility="hidden";this._progressNode.textContent="...";this.domNode.appendChild(this._progressNode);a=document.createElement("div");a.id=d.id+"FilterSearchBox";this.domNode.appendChild(a);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=d.id+"ToolActionsArea";this._toolActionsNode.classList.add("layoutRight");
this._toolActionsNode.classList.add("sectionActions");this.domNode.appendChild(this._toolActionsNode);this.actionsNode=document.createElement("div");this.actionsNode.id=d.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("sectionActions");this.domNode.appendChild(this.actionsNode);this.selectionNode=document.createElement("div");this.selectionNode.id=d.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("sectionActions");
this.domNode.appendChild(this.selectionNode);d.slideout&&(a=b.slideoutHTMLFragment(d.id),f=document.createRange(),f.selectNode(this.domNode),a=f.createContextualFragment(a),this.domNode.appendChild(a));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);e.appendChild(this._contentParent);d.content&&this.setContent(d.content);
this.hidden=d.hidden;if(typeof d.onExpandCollapse==="function")this._onExpandCollapse=d.onExpandCollapse;this._preferenceService=d.preferenceService;this._contentParent.style.display="none";if(this._preferenceService){var j=this;this._preferenceService.getPreferences("/window/views").then(function(a){a=a.get(j.id);if(a!==void 0)j.hidden=!a;if(!j.hidden)j._contentParent.style.display="block";j._updateExpandedState(!j.hidden,!1)})}else{if(!this.hidden)this._contentParent.style.display="block";this._updateExpandedState(!this.hidden,
!1)}this._commandService=d.commandService;this._lastMonitor=0;this._loading={}}function f(b){this._section=b;this._id=++b._lastMonitor}g.prototype={setTitle:function(b){this.titleNode.textContent=b},setContent:function(b){typeof b==="string"?this._contentParent.innerHTML=b:(this._contentParent.innerHTML="",this._contentParent.appendChild(b))},getContentElement:function(){return this._contentParent},createProgressMonitor:function(){return new f(this)},_setMonitorMessage:function(b,d){this._progressNode.style.visibility=
"visible";this._loading[b]=d;var c="",a;for(a in this._loading)c!==""&&(c+="\n"),c+=this._loading[a];this._progressNode.title=c},_monitorDone:function(b){delete this._loading[b];var b="",d;for(d in this._loading)b!==""&&(b+="\n"),b+=this._loading[d];this._progressNode.title=b;if(b==="")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(b,d){var c=this.twistie,a=this.id;c&&(c.classList.add(b?this._expandImageClass:this._collapseImageClass),c.classList.remove(b?this._collapseImageClass:this._expandImageClass));this._preferenceService&&d&&this._preferenceService.getPreferences("/window/views").then(function(c){c.put(a,b)});this._onExpandCollapse&&this._onExpandCollapse(b,this)}};g.prototype.constructor=g;f.prototype={begin:function(b){this.status=b;this._section._setMonitorMessage(this.id,b)},worked:function(b){this.status=
b;this._section._setMonitorMessage(this.id,b)},done:function(b){this.status=b;this._section._monitorDone(this.id)}};f.prototype.constructor=f;return{Section:g}});
define("orion/git/gitCommands","i18n!git/nls/gitmessages,require,orion/Deferred,orion/i18nUtil,orion/webui/littlelib,orion/commands,orion/git/util,orion/compare/compareUtils,orion/git/gitPreferenceStorage,orion/git/widgets/ConfirmPushDialog,orion/git/widgets/RemotePrompterDialog,orion/git/widgets/ReviewRequestDialog,orion/git/widgets/CloneGitRepositoryDialog,orion/git/widgets/GitCredentialsDialog,orion/git/widgets/OpenCommitDialog,orion/git/widgets/CommitDialog,orion/git/widgets/ApplyPatchDialog,orion/URL-shim".split(","),function(h,
k,j,b,g,f,e,d,c,a,i,m,o,q,u,l,s){var n={};(function(){function y(a){var c;try{c=JSON.parse(a.responseText)}catch(b){c={Message:h["Problem while performing the action"]}}c.HttpCode=a.status;return c}var t=!1;n.updateNavTools=function(a,c,b,d,e,f){var h=g.node(b),i=a.getService("orion.page.command");if(h)i.destroy(h);else throw"could not find toolbar "+b;i.renderCommands(b,h,e,c,"button");if(f&&(b=g.node(f)))i.destroy(b),i.renderCommands(f,b,e,c,"button");if(d&&(e=g.node(d)))i.destroy(d),i.renderCommands(d,
e,null,c,"button");t||(t=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var b=g.node(d);b&&(i.destroy(b),i.renderCommands(d,b,a.selections,c,"button"))}))};n.handleKnownHostsError=function(a,c,d,e){if(confirm(b.formatMessage(h["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],c.KeyType,c.Host,c.HostFingerprint))){var f=a.getService("orion.net.ssh");f.addKnownHosts(c.Host+" "+c.KeyType+" "+c.HostKey).then(function(){f.getKnownHosts().then(function(c){d.knownHosts=
c;typeof d.failedOperation!=="undefined"&&a.getService("orion.page.progress").removeOperation(d.failedOperation);e(d)})})}};n.handleSshAuthenticationError=function(a,b,d,e,f){var b=b?b.Url:void 0,h=function(){(new q.GitCredentialsDialog({title:f,serviceRegistry:a,func:e,errordata:d.errordata,failedOperation:d.failedOperation})).show()};d.gitSshUsername&&d.gitSshUsername!==""||d.gitSshPassword&&d.gitSshPassword!==""||d.gitPrivateKey&&d.gitPrivateKey!==""?h():(new c(a)).get(b).then(function(c){c.gitPrivateKey!==
""||c.gitSshUsername!==""||c.gitSshPassword!==""?(typeof d.failedOperation!=="undefined"&&a.getService("orion.page.progress").removeOperation(d.failedOperation),e({knownHosts:d.knownHosts,gitSshUsername:c.gitSshUsername,gitSshPassword:c.gitSshPassword,gitPrivateKey:c.gitPrivateKey,gitPassphrase:c.gitPassphrase})):h()},h)};n.getDefaultSshOptions=function(a,c){var b=new j,d=a.getService("orion.net.ssh"),e=c&&!c.optionsRequested?c.valueFor("sshuser"):"",f=c&&!c.optionsRequested?c.valueFor("sshpassword"):
"";d.getKnownHosts().then(function(a){b.resolve({knownHosts:a,gitSshUsername:e,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})});return b};n.handleProgressServiceResponse=function(a,c,b,d,e,f){a&&a.status!==void 0&&(a=y(a));if(!a||a.HttpCode===void 0)d&&d(a);else switch(a.HttpCode){case 401:if(a.JsonData)c.errordata=a.JsonData;if(a.failedOperation)c.failedOperation=a.failedOperation;n.handleSshAuthenticationError(b,a.JsonData,c,e,f);break;case 400:if(a.JsonData&&a.JsonData.HostKey){if(a.failedOperation)c.failedOperation=
a.failedOperation;n.handleKnownHostsError(b,a.JsonData,c,e);break}default:c=[],c.Severity="Error",c.HTML=!1,c.Message=a.DetailedMessage?a.DetailedMessage:a.Message,b.getService("orion.page.message").setProgressResult(c),d&&d(a)}};n.gatherSshCredentials=function(a,d,e){var f=new j,g;if(d.items.RemoteLocation!==void 0)g=d.items.RemoteLocation[0].GitUrl;else if(d.items.GitUrl!==void 0)g=d.items.GitUrl;else if(d.items.errorData!==void 0)g=d.items.errorData.Url;else if(d.items.toRef!==void 0)g=d.items.toRef.RemoteLocation[0].GitUrl;
var i=function(c){a.getService("orion.net.ssh").getKnownHosts().then(function(a){d.sshObject=c;f.resolve({knownHosts:a,gitSshUsername:c.gitSshUsername,gitSshPassword:c.gitSshPassword,gitPrivateKey:c.gitPrivateKey,gitPassphrase:c.gitPassphrase})})},k=d.errorData;if(k&&k.HostKey)return confirm(b.formatMessage(h["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],k.KeyType,k.Host,k.HostFingerprint))&&a.getService("orion.net.ssh").addKnownHosts(k.Host+" "+k.KeyType+
" "+k.HostKey).then(function(){d.sshObject&&(d.sshObject.gitSshUsername!==""||d.sshObject.gitSshPassword!==""||d.sshObject.gitPrivateKey!=="")?i({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""}):(new c(a)).get(g).then(function(a){i(a)},function(){i({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})}),f;var m=function(){if(!d.parameters&&!d.optionsRequested)i({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""});else if(d.parameters&&
!d.optionsRequested){var b=d.parameters?d.parameters.valueFor("sshuser"):"",f=d.parameters?d.parameters.valueFor("sshpassword"):"",h=d.parameters&&d.parameters.valueFor("saveCredentials")?d.parameters.valueFor("saveCredentials"):!1,j=new c(a);h?j.put(g,{gitSshUsername:b,gitSshPassword:f}).then(function(){i({gitSshUsername:b,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})}):i({gitSshUsername:b,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})}else(new q.GitCredentialsDialog({title:e,serviceRegistry:a,
func:i,errordata:k})).show()};d.sshObject&&(d.sshObject.gitSshUsername!==""||d.sshObject.gitSshPassword!==""||d.sshObject.gitPrivateKey!=="")?m():(new c(a)).get(g).then(function(a){a.gitPrivateKey!==""||a.gitSshUsername!==""||a.gitSshPassword!==""?i(a):m()},m);return f};n.handleGitServiceResponse=function(a,c,b,d){a&&a.status!==void 0&&(a=y(a));if(!a||!a.HttpCode)b&&b(a);else switch(a.HttpCode){case 401:d(a);break;case 400:if(a.JsonData&&a.JsonData.HostKey){d(a);break}default:d=[],d.Severity="Error",
d.HTML=!1,d.Message=a.DetailedMessage?a.DetailedMessage:a.Message,c.getService("orion.page.message").setProgressResult(d),b&&b(a)}};n.createFileCommands=function(g,l,o){function x(a){var c={Severity:"Error",HTML:!1};try{var b=JSON.parse(a.responseText);c.Message=b.DetailedMessage?b.DetailedMessage:b.Message?b.Message:h["Problem while performing the action"]}catch(d){c.Message=h["Problem while performing the action"]}g.getService("orion.page.message").setProgressResult(c)}var p=new f.ParametersDescription([new f.CommandParameter("name",
"text",h["Local Branch Name:"])]),p=new f.Command({name:h.Checkout,tooltip:h["Checkout the current tag, creating a local branch based on its contents."],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutTag",parameters:p,callback:function(a){var c=a.items,d=function(a,c,d){g.getService("orion.page.progress").showWhile(g.getService("orion.git.provider").checkoutTag(a,c,d),b.formatMessage(h["Checking out tag ${0}"],d)).then(function(){o.changedItem()},x)},e=c.Repository!==
null?c.Repository.Location:c.CloneLocation;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&d(e,c.Name,a.parameters.valueFor("name"))},visibleWhen:function(a){return a.Type==="Tag"}});l.addCommand(p);p=new f.Command({name:h.Checkout,tooltip:h["Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first."],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",
id:"eclipse.checkoutBranch",callback:function(a){var c=a.items,d=g.getService("orion.git.provider"),e=g.getService("orion.page.message"),f=g.getService("orion.page.progress");e.setProgressMessage(c.Name?b.formatMessage(h["Checking out branch ${0}..."],c.Name):h["Checking out branch..."]);c.Type==="Branch"?f.progress(d.checkoutBranch(c.CloneLocation,c.Name),"Checking out branch "+c.Name).then(function(){e.setProgressResult(h["Branch checked out."]);o.changedItem(c.parent)},function(a){x(a)}):f.progress(d.addBranch(c.Repository!==
null?c.Repository.BranchLocation:c.parent.parent.BranchLocation,null,c.Name),"Adding branch "+c.Name).then(function(a){f.progress(d.checkoutBranch(a.CloneLocation,a.Name),"Checking out branch "+c.Name).then(function(){e.setProgressResult(h["Branch checked out."]);o.changedItem(c.Repository?c.Repository.BranchLocation:c.parent.parent.parent)},function(a){x(a)})},function(a){x(a)})},visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});l.addCommand(p);p=new f.ParametersDescription([new f.CommandParameter("name",
"text","Name:")]);p=new f.Command({name:h["New Branch"],tooltip:h["Add a new local branch to the repository"],imageClass:"core-sprite-add",id:"eclipse.addBranch",parameters:p,callback:function(a){var c=a.items,b=g.getService("orion.page.progress"),d=function(a,d){b.progress(g.getService("orion.git.provider").addBranch(a,d),"Adding branch "+d).then(function(){o.changedItem(c)},x)},e;e=c.Type==="Clone"?c.BranchLocation:c.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&d(e,a.parameters.valueFor("name"))},
visibleWhen:function(a){return a.GroupNode&&a.Name==="Branches"||a.Type==="Clone"&&o.parentId==="artifacts"}});l.addCommand(p);p=new f.Command({name:h.Delete,tooltip:h["Delete the local branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeBranch",callback:function(a){var c=a.items,a=g.getService("orion.page.progress");confirm(b.formatMessage(h["Are you sure you want to delete branch ${0}?"],c.Name))&&a.progress(g.getService("orion.git.provider").removeBranch(c.Location),
"Removing branch "+c.Name).then(function(){o.changedItem?o.changedItem(c.parent):o.displayBranches&&o.displayBranches(c.ParentLocation,null)},x)},visibleWhen:function(a){return a.Type==="Branch"&&!a.Current}});l.addCommand(p);p=new f.Command({name:h.Delete,tooltip:h["Delete the remote tracking branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemoteBranch",callback:function(a){var c=a.items,d=g.getService("orion.page.progress");confirm(b.formatMessage(h["You're going to delete remote branch ${0} and push the change."],
c.Name)+"\n\n"+h["Are you sure?"])&&n.getDefaultSshOptions(g).then(function(a){var b=arguments.callee,e=g.getService("orion.git.provider"),f=g.getService("orion.page.message"),e=d.progress(e.doPush(c.Location,"",!1,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),h["Removing remote branch: "]+c.Name);f.createProgressMonitor(e,h["Removing remote branch: "]+c.Name);e.then(function(d){n.handleProgressServiceResponse(d,a,g,function(a){a.Result.Severity=="Ok"&&o.changedItem(c.parent)},
b,h["Delete Remote Branch"])},function(d){n.handleProgressServiceResponse(d,a,g,function(){},b,h["Removing remote branch: "]+c.Name)})})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});l.addCommand(p);p=new f.ParametersDescription([new f.CommandParameter("name","text","Name:"),new f.CommandParameter("url","url","Url:")]);p=new f.Command({name:h["New Remote"],tooltip:h["Add a new remote to the repository"],imageClass:"core-sprite-add",id:"eclipse.addRemote",parameters:p,callback:function(a){var c=
a.items,b=g.getService("orion.page.progress"),d=function(a,d,e){b.progress(g.getService("orion.git.provider").addRemote(a,d,e),"Adding remote "+a).then(function(){o.changedItem(c)},x)},e;e=c.Type==="Clone"?c.RemoteLocation:c.Location;a.parameters.valueFor("name")&&a.parameters.valueFor("url")&&d(e,a.parameters.valueFor("name"),a.parameters.valueFor("url"))},visibleWhen:function(a){return a.GroupNode&&a.Name==="Remotes"||a.Type==="Clone"&&o.parentId==="artifacts"}});l.addCommand(p);p=new f.Command({name:h.Delete,
tooltip:h["Delete the remote from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemote",callback:function(a){var c=a.items;confirm(b.formatMessage(h["Are you sure you want to delete remote ${0}?"],c.Name))&&g.getService("orion.page.progress").progress(g.getService("orion.git.provider").removeRemote(c.Location),"Removing remote "+c.Name).then(function(){o.changedItem(c.parent)},x)},visibleWhen:function(a){return a.Type==="Remote"}});l.addCommand(p);p=new f.Command({name:h.Pull,
tooltip:h["Pull from the repository"],imageClass:"git-sprite-pull",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pull",callback:function(a){var c=a.items,b=c.Location,d=c.Name;n.getDefaultSshOptions(g).then(function(a){var e=arguments.callee,f=g.getService("orion.git.provider"),i=g.getService("orion.page.message"),f=g.getService("orion.page.progress").progress(f.doPull(b,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),h["Pulling: "]+d);i.createProgressMonitor(f,
h["Pulling: "]+d);var j;f.then(function(b){n.handleProgressServiceResponse(b,a,g,function(){c.Type==="Clone"&&o.changedItem(c)},e,"Pull Git Repository")},function(b){if(j)b.failedOperation=j;n.handleProgressServiceResponse(b,a,g,function(){o.changedItem(c)},e,h["Pull Git Repository"])},function(a){j=a.Location})})},visibleWhen:function(a){return a.Type==="Clone"}});l.addCommand(p);p=new f.Command({name:h["Git Log"],tooltip:h["Open the log for the branch"],id:"eclipse.openGitLog",imageClass:"git-sprite-log",
spriteClass:"gitCommandSprite",hrefCallback:function(a){a=a.items;return k.toUrl("git/git-log.html")+"#"+a.CommitLocation+"?page=1"},visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});l.addCommand(p);p=new f.Command({name:h["Git Log"],tooltip:h["Open the log for the repository"],id:"eclipse.openGitLogAll",imageClass:"git-sprite-log",spriteClass:"gitCommandSprite",hrefCallback:function(a){return k.toUrl("git/git-log.html")+"#"+a.items.CommitLocation+"?page=1"},visibleWhen:function(a){return!a.CommitLocation||
!a.StatusLocation?!1:!0}});l.addCommand(p);p=new f.Command({name:h["Git Status"],tooltip:h["Open the status for the repository"],id:"eclipse.openGitStatus",imageClass:"git-sprite-status",spriteClass:"gitCommandSprite",hrefCallback:function(a){return k.toUrl(e.statusUILocation)+"#"+a.items.StatusLocation},visibleWhen:function(a){return!a.StatusLocation?!1:!0}});l.addCommand(p);p=new f.Command({name:h["Show in Navigator"],tooltip:h["Show the repository folder in the file navigator"],id:"eclipse.openCloneContent",
hrefCallback:function(a){return k.toUrl("navigate/table.html")+"#"+a.items.ContentLocation+"?depth=1"},visibleWhen:function(a){return!a.ContentLocation?!1:!0}});l.addCommand(p);p=new f.Command({name:h["Compare With Each Other"],imageClass:"git-sprite-open_compare",spriteClass:"gitCommandSprite",id:"eclipse.compareGitCommits",hrefCallback:function(a){a=a.items;return g.getService("orion.page.progress").progress(g.getService("orion.git.provider").getDiff(a[1].DiffLocation,a[0].Name),"Generating Diff for "+
a[0].Name+" and "+a[1].Name).then(function(a){return d.generateCompareHref(a,{readonly:!0})})},visibleWhen:function(a){return o.isDirectory?!1:Array.isArray(a)&&a.length===2&&a[0].Type==="Commit"&&a[1].Type==="Commit"?!0:!1}});l.addCommand(p);p=new f.Command({name:h["Compare With Working Tree"],imageClass:"git-sprite-open_compare",spriteClass:"gitCommandSprite",id:"eclipse.compareWithWorkingTree",hrefCallback:function(a){return d.generateCompareHref(a.items.DiffLocation,{})},visibleWhen:function(a){return a.Type===
"Commit"&&a.ContentLocation!==null&&!o.isDirectory}});l.addCommand(p);p=new f.Command({name:h.Open,id:"eclipse.openGitCommit",hrefCallback:function(a){return k.toUrl("edit/edit.html")+"#"+a.items.ContentLocation},visibleWhen:function(a){return a.Type==="Commit"&&a.ContentLocation!=null&&!o.isDirectory}});l.addCommand(p);p=new f.Command({name:h.Fetch,tooltip:h["Fetch from the remote"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",callback:function(a){var b=
a.items,d=b.Location,e=b.Name,i=function(a,b){a.JsonData.HostKey?(b.parameters=null,b.errorData=a.JsonData,b.errorData.failedOperation=a.failedOperation,l.collectParameters(b)):b.optionsRequested?(b.errorData=a.JsonData,b.errorData.failedOperation=a.failedOperation,l.collectParameters(b)):(new c(g)).isEnabled().then(function(c){b.parameters=c?a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",h["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",
h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",h["SSH User Name:"]),new f.CommandParameter("sshpassword","password",h["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser",
"text",h["SSH User Name:"]),new f.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0});b.errorData=a.JsonData;b.errorData.failedOperation=a.failedOperation;l.collectParameters(b)})},j=function(){a.parameters&&a.parameters.optionsRequested?(a.parameters=null,a.optionsRequested=!0,l.collectParameters(a)):(a.errorData&&a.errorData.failedOperation&&g.getService("orion.page.progress").removeOperation(a.errorData.failedOperation),n.gatherSshCredentials(g,a).then(function(c){var f=
g.getService("orion.git.provider"),j=g.getService("orion.page.message"),c=g.getService("orion.page.progress").progress(f.doFetch(d,!1,c.gitSshUsername,c.gitSshPassword,c.knownHosts,c.gitPrivateKey,c.gitPassphrase),h["Fetching remote: "]+e);j.createProgressMonitor(c,h["Fetching remote: "]+e);c.then(function(c){n.handleGitServiceResponse(c,g,function(){o.changedItem(b)},function(c){i(c,a)})},function(c){n.handleGitServiceResponse(c,g,function(){o.changedItem(b)},function(c){i(c,a)})})}))};if(a.items.GitUrl)j();
else{var k=g.getService("orion.git.provider"),m=g.getService("orion.page.progress");m.progress(k.getGitRemote(d),"Getting remote details "+e).then(function(c){m.progress(k.getGitClone(c.CloneLocation),"Getting git repository information "+c.Name).then(function(c){a.items.GitUrl=c.Children[0].GitUrl;j()},x)},x)}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Remote"?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});l.addCommand(p);p=new f.Command({name:h["Force Fetch"],
imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",tooltip:h["Fetch from the remote branch into your remote tracking branch overriding its current content"],id:"eclipse.orion.git.fetchForce",callback:function(a){if(confirm(h["You're going to override content of the remote tracking branch. This can cause the branch to lose commits."]+"\n\n"+h["Are you sure?"])){var b=a.items,d=b.Location,e=b.Name,i=function(a,b){a.JsonData.HostKey?(b.parameters=null,b.errorData=a.JsonData,b.errorData.failedOperation=
a.failedOperation,l.collectParameters(b)):b.optionsRequested?(b.errorData=a.JsonData,l.collectParameters(b)):(new c(g)).isEnabled().then(function(c){b.parameters=c?a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",h["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",h["SSH User Name:"]),new f.CommandParameter("sshpassword",
"password",h["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",h["SSH User Name:"]),new f.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0});b.errorData=a.JsonData;b.errorData.failedOperation=
a.failedOperation;l.collectParameters(b)})},j=function(){a.parameters&&a.parameters.optionsRequested?(a.parameters=null,a.optionsRequested=!0,l.collectParameters(a)):(a.errorData&&a.errorData.failedOperation&&g.getService("orion.page.progress").removeOperation(a.errorData.failedOperation),n.gatherSshCredentials(g,a).then(function(c){var f=g.getService("orion.git.provider"),j=g.getService("orion.page.progress"),k=g.getService("orion.page.message"),c=j.progress(f.doFetch(d,!0,c.gitSshUsername,c.gitSshPassword,
c.knownHosts,c.gitPrivateKey,c.gitPassphrase),h["Fetching remote: "]+e);k.createProgressMonitor(c,h["Fetching remote: "]+e);c.then(function(c){n.handleGitServiceResponse(c,g,function(){o.changedItem(b)},function(c){i(c,a)})},function(c){n.handleGitServiceResponse(c,g,function(){o.changedItem(b)},function(c){i(c,a)})})}))};if(a.items.GitUrl)j();else{var k=g.getService("orion.git.provider");k.getGitRemote(d).then(function(c){k.getGitClone(c.CloneLocation).then(function(c){a.items.GitUrl=c.Children[0].GitUrl;
j()})})}}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Remote"?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});l.addCommand(p);p=new f.Command({name:h.Merge,tooltip:h["Merge the content from the branch to your active branch"],imageClass:"git-sprite-merge",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.merge",callback:function(a){var c=a.items,a=g.getService("orion.git.provider"),d=g.getService("orion.page.progress"),f=g.getService("orion.page.message");
d.progress(a.doMerge(c.HeadLocation,c.Name,!1),"Merging "+c.Name).then(function(a){var d={};if(a.Result==="FAST_FORWARD"||a.Result==="ALREADY_UP_TO_DATE")d.Severity="Ok",d.HTML=!1,d.Message=a.Result;else if(a.Result){var g=c.HeadLocation.replace("commit/HEAD","status");d.Severity="Warning";d.HTML=!0;d.Message="<span>"+a.Result;if(a.FailingPaths){var i="",j=!0,m;for(m in a.FailingPaths)j||(i+=", "),j=!1,i+=m;j||(d.Message+=". "+b.formatMessage(h["Failing paths: ${0}"],i))}d.Message+=b.formatMessage(h[". Go to ${0}."],
'<a href="'+k.toUrl(e.statusUILocation)+"#"+g+'">'+h["Git Status page"]+"</a>")+"</span>"}else if(a.error)g=c.HeadLocation.replace("commit/HEAD","status"),d.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),d.Message=a.DetailedMessage?a.DetailedMessage:a.Message):d.Message=a.error.message,d.HTML=!0,d.Message="<span>"+d.Message+b.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+g+'">'+h["Git Status page"]+"</a>")+
"</span>";f.setProgressResult(d);o.changedItem(c)},function(a,d){var f=[],i=c.HeadLocation.replace("commit/HEAD","status");f.Severity="Error";f.HTML=!0;f.Message="<span>"+JSON.stringify(d.xhr.responseText).DetailedMessage+b.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+i+'">'+h["Git Status page"]+"</a>")+".</span>";g.getService("orion.page.message").setProgressResult(f);o.changedItem(c)})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Branch"&&
!a.Current?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});l.addCommand(p);p=new f.Command({name:h["Merge Squash"],tooltip:h["Squash the content of the branch to the index"],imageClass:"git-sprite-merge_squash",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.mergeSquash",callback:function(a){var c=a.items,a=g.getService("orion.git.provider"),d=g.getService("orion.page.progress"),f=g.getService("orion.page.message");d.progress(a.doMerge(c.HeadLocation,c.Name,!0),
"Merging "+c.Name).then(function(a){var d=[];if(a.Result==="FAST_FORWARD_SQUASHED"||a.Result==="ALREADY_UP_TO_DATE")d.Severity="Ok",d.HTML=!1,d.Message=a.Result;else if(a.Result){var g=c.HeadLocation.replace("commit/HEAD","status");d.Severity="Warning";d.HTML=!0;d.Message="<span>"+a.Result+b.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+g+'">'+h["Git Status page"]+"</a>")+"</span>"}else if(a.error)g=c.HeadLocation.replace("commit/HEAD","status"),d.Severity="Error",a.error.responseText&&
JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),d.Message=a.DetailedMessage?a.DetailedMessage:a.Message):d.Message=a.error.message,d.HTML=!0,d.Message="<span>"+d.Message+b.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+g+'">'+h["Git Status page"]+"</a>")+"</span>";f.setProgressResult(d);o.changedItem(c)},function(a,d){var f=[],i=c.HeadLocation.replace("commit/HEAD","status");f.Severity="Error";f.HTML=!0;f.Message="<span>"+JSON.stringify(d.xhr.responseText).DetailedMessage+
b.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+i+'">'+h["Git Status page"]+"</a>")+".</span>";g.getService("orion.page.message").setProgressResult(f);o.changedItem(c)})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Branch"&&!a.Current?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});l.addCommand(p);p=new f.Command({name:h.Rebase,tooltip:h["Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch "]+
"and applying each commit again to the updated active branch.",id:"eclipse.orion.git.rebase",imageClass:"git-sprite-rebase",spriteClass:"gitCommandSprite",callback:function(a){var c=a.items,a=g.getService("orion.page.message"),d=g.getService("orion.page.progress").progress(g.getService("orion.git.provider").doRebase(c.HeadLocation,c.Name,"BEGIN"),c.Name?h["Rebase on top of "]+c.Name:h.Rebase);a.createProgressMonitor(d,c.Name?h["Rebase on top of "]+c.Name:h.Rebase);d.then(function(a){var d=[],f=c.HeadLocation.replace("commit/HEAD",
"status");a.Result==="OK"||a.Result==="FAST_FORWARD"||a.Result==="UP_TO_DATE"?(d.Severity="Ok",d.HTML=!1,d.Message=a.Result):a.Result==="STOPPED"?(d.Severity="Warning",d.HTML=!0,d.Message="<span>"+a.Result+h[". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing"]+b.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+f+'">'+h["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_WRONG_REPOSITORY_STATE"?(d.Severity="Error",d.HTML=!0,
d.Message="<span>"+a.Result+h[". Repository state is invalid (i.e. already during rebasing)"]+b.formatMessage(". Go to ${0}.",'<a href="'+k.toUrl(e.statusUILocation)+"#"+f+'">'+h["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_UNMERGED_PATHS"?(d.Severity="Error",d.HTML=!0,d.Message="<span>"+a.Result+h[". Repository contains unmerged paths"]+b.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+f+'">'+h["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_PENDING_CHANGES"?
(d.Severity="Error",d.HTML=!0,d.Message="<span>"+a.Result+h[". Repository contains pending changes. Please commit or stash them"]+b.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+f+'">Git Status page</a>')+".</span>"):(d.Severity="Warning",d.HTML=!0,d.Message="<span>"+a.Result+b.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+f+'">'+h["Git Status page"]+"</a>")+".</span>");g.getService("orion.page.message").setProgressResult(d);o.changedItem(c)},
x)},visibleWhen:function(a){this.tooltip=h["Rebase your commits by removing them from the active branch, "]+h["starting the active branch again based on the latest state of '"]+a.Name+"' "+h["and applying each commit again to the updated active branch."];return a.Type==="RemoteTrackingBranch"||a.Type==="Branch"&&!a.Current}});l.addCommand(p);p=new f.Command({name:h["Push All"],tooltip:h["Push commits and tags from your local branch into the remote branch"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",
id:"eclipse.orion.git.push",callback:function(b){var d=b.targetBranch,e,k=b.items;if(k.toRef)k=k.toRef;k.CloneLocation.split("/");var m=function(a,b){a.JsonData.HostKey?(b.parameters=null,b.errorData=a.JsonData,b.errorData.failedOperation=a.failedOperation,l.collectParameters(b)):b.optionsRequested?(b.errorData=a.JsonData,b.errorData.failedOperation=a.failedOperation,l.collectParameters(b)):(new c(g)).isEnabled().then(function(c){b.parameters=c?a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword",
"password",h["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",h["SSH User Name:"]),new f.CommandParameter("sshpassword","password",h["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",h["SSH Password:"])],
{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",h["SSH User Name:"]),new f.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0});b.errorData=a.JsonData;b.errorData.failedOperation=a.failedOperation;l.collectParameters(b)})};if(b.parameters&&b.parameters.optionsRequested)b.parameters=null,b.optionsRequested=!0,l.collectParameters(b);else{var p=g.getService("orion.git.provider"),x=g.getService("orion.page.progress");
b.errorData&&b.errorData.failedOperation&&x.removeOperation(b.errorData.failedOperation);var q=function(a,c,d,e,f){var i=g.getService("orion.page.message"),a=x.progress(p.doPush(c,d,!0,f,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),h["Pushing remote: "]+e);i.createProgressMonitor(a,h["Pushing remote: "]+e);a.then(function(a){n.handleGitServiceResponse(a,g,function(){o.changedItem()},function(a){m(a,b)})},function(a){n.handleGitServiceResponse(a,g,function(){o.changedItem()},
function(a){m(a,b)})})};x.progress(p.getGitClone(k.CloneLocation),"Getting git repository details "+k.Name).then(function(c){var f=c.Children[0].RemoteLocation,m=c.Children[0].ConfigLocation,l=function(a){handleProgressServiceResponse(a,{},g)};n.gatherSshCredentials(g,b).then(function(c){var o=new j;if(k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1)o=x.progress(p.getGitRemote(f),"Getting git remote details "+k.Name);else{var n={};n.Children=k.RemoteLocation;o.resolve(n)}o.then(function(f){d?
q(c,d.Location,"HEAD",d.Name,!1):(f=new i.RemotePrompterDialog({title:h["Choose Branch"],serviceRegistry:g,gitClient:p,treeRoot:{Children:f.Children},hideNewBranch:!1,func:function(a,d,f){e=a===null?f:a;var h="branch."+k.Name+".remote";x.progress(p.addCloneConfigurationProperty(m,h,e.parent.Name),"Adding git configuration property "+k.Name).then(function(){b.targetBranch=e;q(c,e.Location,"HEAD",e.Name,!1)},function(a){a.status===409?p.getGitCloneConfig(m).then(function(a){if(a.Children)for(var d=
0;d<a.Children.length;d++)if(a.Children[d].Key===h){x.progress(p.editCloneConfigurationProperty(a.Children[d].Location,e.parent.Name),"Updating configuration property "+e.parent.Name).then(function(){b.targetBranch=e;q(c,e.Location,"HEAD",e.Name,!1)},l);break}},l):l(erry)})}}),k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1&&(f=new a.ConfirmPushDialog({title:h["Choose Branch"],serviceRegistry:g,gitClient:p,dialog:f,location:k.RemoteLocation[0].Children[0].Name,func:function(){b.targetBranch=
k.RemoteLocation[0].Children[0];q(c,k.RemoteLocation[0].Children[0].Location,"HEAD",k.Name,!1)}})),f.show())})})})}},visibleWhen:function(a){return a.toRef?a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation:a.Type==="Branch"&&a.Current&&a.RemoteLocation}});l.addCommand(p);p=new f.Command({name:h["Force Push All"],tooltip:h["Push commits and tags from your local branch into the remote branch overriding its current content"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",
id:"eclipse.orion.git.pushForce",callback:function(b){var d=b.confirmedWarnings,e=b.targetBranch;if(!d)if(confirm(h["You're going to override content of the remote branch. This can cause the remote repository to lose commits."]+"\n\n"+h["Are you sure?"]))d=b.confirmedWarnings=!0;else return;var k,m=b.items;if(m.toRef)m=m.toRef;var p=m.CloneLocation.split("/"),x=function(a,b){a.JsonData.HostKey?(b.parameters=null,b.errorData=a.JsonData,l.collectParameters(b)):b.optionsRequested?(b.errorData=a.JsonData,
l.collectParameters(b)):(new c(g)).isEnabled().then(function(c){b.parameters=c?a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",h["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",h["SSH User Name:"]),new f.CommandParameter("sshpassword","password",h["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",
h["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",h["SSH User Name:"]),new f.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0});b.errorData=a.JsonData;l.collectParameters(b)})};if(b.parameters&&b.parameters.optionsRequested)b.parameters=null,
b.optionsRequested=!0,l.collectParameters(b);else{var q=g.getService("orion.git.provider"),s=g.getService("orion.page.progress"),t=function(a,c,d,e,f){var i=g.getService("orion.page.message"),a=s.progress(q.doPush(c,d,!0,f,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),h["Pushing remote: "]+e);i.createProgressMonitor(a,h["Pushing remote: "]+e);a.then(function(a){n.handleGitServiceResponse(a,g,function(){o.changedItem()},function(a){x(a,b)})},function(a){n.handleGitServiceResponse(a,
g,function(){o.changedItem(m)},function(a){x(a,b)})})};s.progress(q.getGitClone(m.CloneLocation),"Getting git repository details "+m.Name).then(function(c){var d=c.Children[0].RemoteLocation,f=c.Children[0].ConfigLocation;n.gatherSshCredentials(g,b).then(function(c){var l=new j;if(m.RemoteLocation.length===1&&m.RemoteLocation[0].Children.length===1)l=s.progress(q.getGitRemote(d),"Getting remote details "+m.Name);else{var o={};o.Children=m.RemoteLocation;l.resolve(o)}l.then(function(d){e?t(c,e.Location,
"HEAD",e.Name,!0):(d=new i.RemotePrompterDialog({title:h["Choose Branch"],serviceRegistry:g,gitClient:q,treeRoot:{Children:d.Children},hideNewBranch:!1,func:function(a,d,e){k=a===null?e:a;var h="/gitapi/config/branch."+m.Name+".remote/clone/file/"+p[4];s.progress(q.addCloneConfigurationProperty(f,"branch."+m.Name+".remote",k.parent.Name),"Setting git configuration property "+m.Name).then(function(){b.targetBranch=k;t(c,k.Location,"HEAD",k.Name,!0)},function(a){a.status===409&&s.progres(q.editCloneConfigurationProperty(h,
k.parent.Name),"Setting git configuration property "+k.parent.Name).then(function(){b.targetBranch=k;t(c,k.Location,"HEAD",k.Name,!0)})})}}),m.RemoteLocation.length===1&&m.RemoteLocation[0].Children.length===1&&(d=new a.ConfirmPushDialog({title:h["Choose Branch"],serviceRegistry:g,gitClient:q,dialog:d,location:m.RemoteLocation[0].Children[0].Name,func:function(){b.targetBranch=m.RemoteLocation[0].Children[0];t(c,m.RemoteLocation[0].Children[0].Location,"HEAD",m.Location,!0)}})),d.startup(),d.show())})})})}},
visibleWhen:function(a){if(a.toRef)return a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation}});l.addCommand(p);p=new f.Command({name:h["< Previous Page"],tooltip:h["Show previous page of git log"],id:"eclipse.orion.git.previousLogPage",hrefCallback:function(a){return k.toUrl("git/git-log.html")+"#"+a.items.PreviousLocation},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"||a.toRef!==null&&a.toRef.Type==="Branch"||a.RepositoryPath!==null?a.PreviousLocation!==
void 0:!1}});l.addCommand(p);p=new f.Command({name:h["Next Page >"],tooltip:h["Show next page of git log"],id:"eclipse.orion.git.nextLogPage",hrefCallback:function(a){return k.toUrl("git/git-log.html")+"#"+a.items.NextLocation},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"||a.toRef!==null&&a.toRef.Type==="Branch"||a.RepositoryPath!==null?a.NextLocation!==void 0:!1}});l.addCommand(p);p=new f.Command({name:h["< Previous Page"],tooltip:h["Show previous page of git tags"],id:"eclipse.orion.git.previousTagPage",
hrefCallback:function(a){return k.toUrl("git/git-repository.html")+"#"+a.items.PreviousLocation},visibleWhen:function(a){return a.Type==="Tag"?a.PreviousLocation!==void 0:!1}});l.addCommand(p);p=new f.Command({name:h["Next Page >"],tooltip:h["Show next page of git tags"],id:"eclipse.orion.git.nextTagPage",hrefCallback:function(a){return k.toUrl("git/git-repository.html")+"#"+a.items.NextLocation},visibleWhen:function(a){return a.Type==="Tag"?a.NextLocation!==void 0:!1}});l.addCommand(p);p=new f.Command({name:h.Reset,
tooltip:h["Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes."],id:"eclipse.orion.git.resetIndex",imageClass:"git-sprite-reset",spriteClass:"gitCommandSprite",callback:function(a){var c=a.items;if(confirm(h["The content of your active branch will be replaced with "]+c.Name+". "+h["All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?"])){var a=g.getService("orion.git.provider"),b=g.getService("orion.page.message"),
a=g.getService("orion.page.progress").progress(a.resetIndex(c.IndexLocation,c.Name),"Resetting git index for "+c.Name);b.createProgressMonitor(a,h["Resetting index..."]);a.then(function(){o.changedItem(c);b.setProgressResult({Severity:"Info",HTML:!1,Message:"Ok"})},function(a){var c={Severity:"Error",HTML:!1};c.Message=a.message;b.setProgressResult(c)})}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});l.addCommand(p);p=new f.ParametersDescription([new f.CommandParameter("name",
"text",h["Name:"])]);p=new f.Command({name:h.Tag,tooltip:h["Create a tag for the commit"],imageClass:"git-sprite-tag",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.addTag",parameters:p,callback:function(a){var c=a.items,b=function(a,b){g.getService("orion.page.progress").progress(g.getService("orion.git.provider").doAddTag(a,b),"Adding tag "+b).then(function(){o.changedItem(c)},x)},d=c.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&b(d,a.parameters.valueFor("name"))},
visibleWhen:function(a){return a.Type==="Commit"}});l.addCommand(p);p=new f.Command({name:h.Delete,tooltip:h["Delete the tag from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeTag",callback:function(a){var c=a.items;confirm(b.formatMessage(h["Are you sure you want to delete tag ${0}?"],c.Name))&&g.getService("orion.page.progress").progress(g.getService("orion.git.provider").doRemoveTag(c.Location),"Removing tag "+c.Name).then(function(){o.changedItem(c.parent)},x)},visibleWhen:function(a){return a.Type===
"Tag"}});l.addCommand(p);p=new f.ParametersDescription([new f.CommandParameter("reviewer","text",h["Reviewer name"])],{hasOptionalParameters:!0});p=new f.Command({name:h["Ask for review"],tooltip:h["Ask for review tooltip"],imageClass:"core-sprite-tag",id:"eclipse.orion.git.askForReviewCommand",parameters:p,callback:function(a){var c=g.getService("orion.page.progress"),b=function(a){var c=document.createElement("a");c.href=a;c.protocol==="ssh:"&&(c=a.indexOf("@"),c!==-1&&(a="ssh://"+a.substr(c+1)));
return a},d=function(d){var e=a.items,f=e.Location.replace(e.Name,"HEAD"),h=e.AuthorName,i=e.Name,j=e.Message;c.progress(g.getService("orion.git.provider").getGitClone(e.CloneLocation),"Getting repository details "+e.Name).then(function(a){window.location.href.split("#");var m=(new URL(k.toUrl("."),window.location)).href.slice(0,-1),a=b(a.Children[0].GitUrl),m=m+"/git/reviewRequest.html#"+a+"_"+e.Name;c.progress(g.getService("orion.git.provider").sendCommitReviewRequest(i,f,d,m,h,j),"Sending review request for "+
i).then(function(a){var c={Severity:"Ok",HTML:!1};c.Message=a.Result;g.getService("orion.page.message").setProgressResult(c)},x)})};if(a.parameters.valueFor("reviewer")&&!a.parameters.optionsRequested)d(a.parameters.valueFor("reviewer"));else{var e=a.items;c.progress(g.getService("orion.git.provider").getGitClone(e.CloneLocation),"Getting git details "+e.Name).then(function(a){window.location.href.split("#");var c=(new URL(k.toUrl("."),window.location)).href.slice(0,-1),a=b(a.Children[0].GitUrl);
(new m.ReviewRequestDialog({title:h["Contribution Review Request"],url:c+"/git/reviewRequest.html#"+a+"_"+e.Name,func:d})).show()},x)}},visibleWhen:function(a){return a.Type==="Commit"}});l.addCommand(p);p=new f.Command({name:h["Cherry-Pick"],tooltip:h["Apply the change introduced by the commit to your active branch"],id:"eclipse.orion.git.cherryPick",imageClass:"git-sprite-cherry_pick",spriteClass:"gitCommandSprite",callback:function(a){var c=a.items,a=g.getService("orion.page.progress"),d=g.getService("orion.git.provider"),
f=c.Location.replace(c.Name,"HEAD");a.progress(d.doCherryPick(f,c.Name),"Cherry picking "+c.Name).then(function(a){var d=[],f=c.Location.replace("commit/"+c.Name,"status");if(a.Result==="OK")d.Severity="Ok",a.HeadUpdated?(d.HTML=!1,d.Message=a.Result):(d.HTML=!0,d.Message="<span>"+h["Nothing changed."]+"</span>");else if(a.Result==="CONFLICTING")d.Severity="Warning",d.HTML=!0,d.Message="<span>"+a.Result+h[". Some conflicts occurred"]+ +b.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+
"#"+f+'">'+h["Git Status page"]+"</a>")+".</span>";else if(a.Result==="FAILED"){d.Severity="Error";d.HTML=!0;d.Message="<span>"+a.Result;if(a.FailingPaths){var i="",j=!0,m;for(m in a.FailingPaths)j||(i+=", "),j=!1,i+=m;j||(d.Message+=". "+b.formatMessage(h["Failing paths: ${0}"],i))}d.Message+=b.formatMessage(h[". Go to ${0}."],'<a href="'+k.toUrl(e.statusUILocation)+"#"+f+'">'+h["Git Status page"]+"</a>")+".</span>"}else d.Severity="Warning",d.HTML=!1,d.Message=a.Result;g.getService("orion.page.message").setProgressResult(d)},
x)},visibleWhen:function(a){return a.Type==="Commit"}});l.addCommand(p)};n.createGitClonesCommands=function(a,d,e,g,i,k){function m(c){var b={Severity:"Error",HTML:!1};try{var d=JSON.parse(c.responseText);b.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:h["Problem while performing the action"]}catch(e){b.Message=h["Problem while performing the action"]}a.getService("orion.page.message").setProgressResult(b)}g=new f.ParametersDescription([new f.CommandParameter("key","text",h["Key:"]),
new f.CommandParameter("value","text",h["Value:"])]);g=new f.Command({name:h["New Configuration Entry"],tooltip:"Add a new entry to the repository configuration",imageClass:"core-sprite-add",id:"eclipse.orion.git.addConfigEntryCommand",parameters:g,callback:function(c){var b=c.items,d=a.getService("orion.git.provider"),f=a.getService("orion.page.progress");c.parameters.valueFor("key")&&c.parameters.valueFor("value")&&f.progress(d.addCloneConfigurationProperty(b.ConfigLocation,c.parameters.valueFor("key"),
c.parameters.valueFor("value")),"Setting configuration propetry: "+c.parameters.valueFor("key")).then(function(){e.changedItem(b)},m)}});d.addCommand(g);g=new f.ParametersDescription([new f.CommandParameter("value","text",h["Value:"])]);g=new f.Command({name:h.Edit,tooltip:h["Edit the configuration entry"],imageClass:"core-sprite-edit",id:"eclipse.orion.git.editConfigEntryCommand",parameters:g,callback:function(c){var b=c.items,d=a.getService("orion.git.provider"),f=a.getService("orion.page.progress");
c.parameters.valueFor("value")&&f.progress(d.editCloneConfigurationProperty(b.Location,c.parameters.valueFor("value")),"Editing configuration property "+b.Key).then(function(){e.changedItem(b)},m)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});d.addCommand(g);g=new f.Command({name:h.Delete,tooltip:h["Delete the configuration entry"],imageClass:"core-sprite-delete",id:"eclipse.orion.git.deleteConfigEntryCommand",callback:function(c){var d=c.items,c=a.getService("orion.git.provider"),
f=a.getService("orion.page.progress");confirm(b.formatMessage(h["Are you sure you want to delete ${0}?"],d.Key))&&f.progress(c.deleteCloneConfigurationProperty(d.Location),"Deleting configuration property "+d.Key).then(function(){e.changedItem(d)},m)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});d.addCommand(g);g=new f.ParametersDescription([new f.CommandParameter("url","url",h["Repository URL:"])],{hasOptionalParameters:!0});g=new f.Command({name:h["Clone Repository"],tooltip:h["Clone an existing Git repository to a folder"],
id:"eclipse.cloneGitRepository",parameters:g,callback:function(c){var b=a.getService("orion.git.provider"),d=a.getService("orion.page.progress"),f=function(c,f,g){n.getDefaultSshOptions(a).then(function(i){var j=arguments.callee,k=d.progress(b.cloneGitRepository(g,c,f,e.defaultPath,i.gitSshUsername,i.gitSshPassword,i.knownHosts,i.gitPrivateKey,i.gitPassphrase),"Cloning repository "+g);a.getService("orion.page.message").createProgressMonitor(k,h["Cloning repository: "]+c);k.then(function(c){n.handleProgressServiceResponse(c,
i,a,function(){e.changedItem&&e.changedItem()},j,h["Clone Git Repository"])},function(c){n.handleProgressServiceResponse(c,i,a,function(){},j,h["Clone Git Repository"])})})};c.parameters.valueFor("url")&&!c.parameters.optionsRequested?f(c.parameters.valueFor("url")):(new o.CloneGitRepositoryDialog({serviceRegistry:a,fileClient:k,url:c.parameters.valueFor("url"),alwaysShowAdvanced:c.parameters.optionsRequested,func:f})).show()},visibleWhen:function(){return!0}});d.addCommand(g);g=new f.Command({name:h["Clone Repository"],
tooltip:h["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepositoryReviewReq",callback:function(c){var b=a.getService("orion.git.provider"),d=a.getService("orion.page.progress");(new o.CloneGitRepositoryDialog({serviceRegistry:a,fileClient:k,url:c.userData,alwaysShowAdvanced:!1,func:function(c,f,g){n.getDefaultSshOptions(a).then(function(i){var j=arguments.callee,k=d.progress(b.cloneGitRepository(g,c,f,e.defaultPath,i.gitSshUsername,i.gitSshPassword,i.knownHosts,i.gitPrivateKey,
i.gitPassphrase),"Cloning git repository "+g);a.getService("orion.page.message").createProgressMonitor(k,h["Cloning repository: "]+c);k.then(function(c){n.handleProgressServiceResponse(c,i,a,function(){e.changedItem&&e.changedItem()},j,h["Clone Git Repository"])},function(c){n.handleProgressServiceResponse(c,i,a,function(){},j,h["Clone Git Repository"])})})}})).show()},visibleWhen:function(){return!0}});d.addCommand(g);g=new f.Command({name:h["Add Remote"],tooltip:h["Add a new remote to the repository"],
id:"eclipse.addRemoteReviewRequestCommand",imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",callback:function(b){if(b.parameters&&b.parameters.valueFor("remoteName"))b.remoteName=b.parameters.valueFor("remoteName");var g=function(b,e){b.JsonData.HostKey?(e.parameters=null,e.errorData=b.JsonData,d.collectParameters(e)):e.optionsRequested?(e.errorData=b.JsonData,d.collectParameters(e)):(new c(a)).isEnabled().then(function(a){e.parameters=a?b.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword",
"password",h["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",h["SSH User Name:"]),new f.CommandParameter("sshpassword","password",h["SSH Password:"]),new f.CommandParameter("saveCredentials","boolean",h["Don't prompt me again:"])],{hasOptionalParameters:!0}):b.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",h["SSH Password:"])],
{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",h["SSH User Name:"]),new f.CommandParameter("sshpassword","password",h["SSH Password:"])],{hasOptionalParameters:!0});e.errorData=b.JsonData;d.collectParameters(e)})};if(b.parameters&&b.parameters.optionsRequested)b.parameters=null,b.optionsRequested=!0,d.collectParameters(b);else{var i=function(c,d,f){var i=a.getService("orion.page.progress");i.progress(a.getService("orion.git.provider").addRemote(c,
d,b.userData),"Adding git remote "+d).then(function(){n.gatherSshCredentials(a,b).then(function(c){a.getService("orion.git.provider").getGitRemote(f.RemoteLocation).then(function(j){for(var k,l=0;l<j.Children.length;l++)j.Children[l].Name===d&&(k=j.Children[l]);var p=a.getService("orion.git.provider"),j=a.getService("orion.page.message"),l=i.progress(p.doFetch(k.Location,!1,c.gitSshUsername,c.gitSshPassword,c.knownHosts,c.gitPrivateKey,c.gitPassphrase),"Fetching remote "+d);j.createProgressMonitor(l,
h["Fetching remote: "]+k.Location);l.then(function(c){n.handleGitServiceResponse(c,a,function(){i.progress(p.getGitRemote(k.Location),"Getting remote details "+d).then(function(){e.changedItem(f)},m)},function(a){g(a,b)})},function(c){n.handleGitServiceResponse(c,a,function(){e.changedItem(f)},function(a){g(a,b)})})})})},m)};b.remoteName?i(b.items.RemoteLocation,b.remoteName,b.items):(b.parameters=new f.ParametersDescription([new f.CommandParameter("remoteName","text",h["Remote Name:"])],{hasOptionalParameters:!1}),
d.collectParameters(b))}},visibleWhen:function(){return!0}});d.addCommand(g);g=new f.ParametersDescription([new f.CommandParameter("folderName","text",h["New folder:"])],{hasOptionalParameters:!0});g=new f.Command({name:h["Init Repository"],tooltip:h["Create a new Git repository in a new folder"],id:"eclipse.initGitRepository",parameters:g,callback:function(c){var b=a.getService("orion.git.provider"),d=a.getService("orion.page.progress"),f=function(c,f,g){n.getDefaultSshOptions(a).then(function(i){var j=
arguments.callee,k=d.progress(b.cloneGitRepository(g,c,f,e.defaultPath),h["Initializing repository: "]+g);a.getService("orion.page.message").createProgressMonitor(k,h["Initializing repository: "]+g);k.then(function(c){n.handleProgressServiceResponse(c,i,a,function(){e.changedItem&&e.changedItem()},j,h["Init Git Repository"])},function(c){n.handleProgressServiceResponse(c,i,a,function(){},j,h["Init Git Repository"])})})};c.parameters.valueFor("folderName")&&!c.parameters.optionsRequested?f(null,null,
c.parameters.valueFor("folderName")):(new o.CloneGitRepositoryDialog({serviceRegistry:a,title:h["Init Git Repository"],fileClient:k,advancedOnly:!0,func:f})).show()},visibleWhen:function(){return!0}});d.addCommand(g);g=new f.Command({name:h.Delete,tooltip:h["Delete the repository"],imageClass:"core-sprite-delete",id:"eclipse.git.deleteClone",visibleWhen:function(a){return a.Type==="Clone"},callback:function(c){var d=c.items,c=a.getService("orion.git.provider"),f=a.getService("orion.page.progress");
if(Array.isArray(d)){if(confirm(b.formatMessage(h["Are you sure you want do delete ${0} repositories?"],d.length)))for(var g=0,i=0;i<d.length;i++)f.progress(c.removeGitRepository(d[i].Location),"Removing repository "+d.Name).then(function(){g++;g>=d.length&&e.changedItem&&e.changedItem()},m)}else confirm(b.formatMessage(h["Are you sure you want to delete ${0}?"],d.Name))&&f.progress(c.removeGitRepository(d.Location),"Removing repository "+d.Name).then(function(){e.changedItem&&e.changedItem()},m)}});
d.addCommand(g);g=new f.Command({name:h["Apply Patch"],tooltip:h["Apply a patch on the selected repository"],id:"eclipse.orion.git.applyPatch",imageClass:"git-sprite-apply_patch",spriteClass:"gitCommandSprite",callback:function(a){a=a.items;Array.isArray(a)&&(a=a.length>1?{}:a[0]);(new s.ApplyPatchDialog({title:h["Apply Patch"],diffLocation:a.DiffLocation})).show()},visibleWhen:function(a){return a.Type==="Clone"}});d.addCommand(g);g=new f.ParametersDescription([new f.CommandParameter("commitName",
"text",h["Commit name:"])],{hasOptionalParameters:!0});g=new f.Command({name:h["Open Commit"],tooltip:h["Open the commit with the given name"],id:"eclipse.orion.git.openCommitCommand",imageClass:"git-sprite-apply_patch",spriteClass:"gitCommandSprite",parameters:g,callback:function(c){var b=a.getService("orion.page.progress"),d=function(e,f,g){g==null&&(g=new j);e.length>0?b.progress(a.getService("orion.git.provider").doGitLog("/gitapi/commit/"+c.parameters.valueFor("commitName")+e[0].ContentLocation+
"?page=1&pageSize=1",null,null,h["Looking for the commit"]),"Looking for commit "+c.parameters.valueFor("commitName")).then(function(a){g.resolve(a.Children[0].Location)},function(){d(e.slice(1),f,g)}):g.reject();return g},e=function(b){c.parameters.optionsRequested?(new u.OpenCommitDialog({repositories:b,serviceRegistry:a,commitName:c.parameters.valueFor("commitName")})).show():(a.getService("orion.page.message").setProgressMessage(h["Looking for the commit"]),d(b,c.parameters.valueFor("commitName")).then(function(a){a!==
null&&window.open("/git/git-commit.html#"+a+"?page=1&pageSize=1")},function(){var c=[];c.Severity="warning";c.HTML=!1;c.Message=h["No commits found"];a.getService("orion.page.message").setProgressResult(c)}))};if(c.items.Type==="Clone"){var f=[c.items];e(f)}else c.items.CloneLocation?b.progress(a.getService("orion.git.provider").getGitClone(c.items.CloneLocation),"Getting git repository details").then(function(a){e(a.Children)}):(f=c.items,e(f))},visibleWhen:function(a){return a.Type==="Clone"||a.CloneLocation||
a.length>1&&a[0].Type==="Clone"}});d.addCommand(g)};n.createGitStatusCommands=function(a,c,b){function d(c){var b={Severity:"Error",HTML:!1};try{var e=JSON.parse(c.responseText);b.Message=e.DetailedMessage?e.DetailedMessage:e.Message?e.Message:h["Problem while performing the action"]}catch(f){b.Message=h["Problem while performing the action"]}a.getService("orion.page.message").setProgressResult(b)}function g(a){Array.isArray(a)||(a=[a]);return a}function i(c,e){var f=a.getService("orion.page.message"),
g=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doRebase(c,"",e),"Rebasing git repository");f.createProgressMonitor(g,e);g.then(function(c){if(c.Result==="OK"||c.Result==="ABORTED"||c.Result==="FAST_FORWARD"||c.Result==="UP_TO_DATE"){var d=[];d.Severity="Ok";d.HTML=!1;d.Message=c.Result;a.getService("orion.page.message").setProgressResult(d);b.changedItem({})}if(c.Result==="STOPPED")d=[],d.Severity="Warning",d.HTML=!1,d.Message=c.Result+h[". Repository still contains conflicts."],
a.getService("orion.page.message").setProgressResult(d),b.changedItem({});else if(c.Result==="FAILED_UNMERGED_PATHS")d=[],d.Severity="Error",d.HTML=!1,d.Message=c.Result+h[". Repository contains unmerged paths. Resolve conflicts first."],a.getService("orion.page.message").setProgressResult(d)},d)}var j=new f.Command({name:h.Stage,tooltip:h["Stage the change"],imageClass:"git-sprite-stage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.stageCommand",callback:function(c){var e=g(c.items),f=a.getService("orion.page.message"),
i=a.getService("orion.page.progress");if(e.length===1)c=i.progress(a.getService("orion.git.provider").stage(e[0].indexURI),h["Staging changes"]),f.createProgressMonitor(c,h["Staging changes"]);else{for(var j=[],k=0;k<e.length;k++)j[k]=e[k].name;c=i.progress(a.getService("orion.git.provider").stageMultipleFiles(c.userData.Clone.IndexLocation,j),h["Staging changes"]);f.createProgressMonitor(c,"Staging changes")}c.then(function(){b.changedItem(e)},d)},visibleWhen:function(a){a=g(a);if(a.length===0)return!1;
for(var c=0;c<a.length;c++)if(!e.isChange(a[c])||e.isStaged(a[c]))return!1;return!0}});c.addCommand(j);j=new f.Command({name:h.Unstage,tooltip:h["Unstage the change"],imageClass:"git-sprite-unstage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.unstageCommand",callback:function(c){var e=g(c.items),f=a.getService("orion.page.message"),i=a.getService("orion.page.progress");if(e.length===1)c=i.progress(a.getService("orion.git.provider").unstage(e[0].indexURI,e[0].name),"Unstaging changes");else{for(var j=
[],k=0;k<e.length;k++)j[k]=e[k].name;c=i.progress(a.getService("orion.git.provider").unstage(c.userData.Clone.IndexLocation,j),"Unstaging changes")}f.createProgressMonitor(c,h["Staging changes"]);c.then(function(){b.changedItem(e)},d)},visibleWhen:function(a){a=g(a);if(a.length===0)return!1;for(var c=0;c<a.length;c++)if(!e.isChange(a[c])||!e.isStaged(a[c]))return!1;return!0}});c.addCommand(j);j=new f.ParametersDescription([new f.CommandParameter("name","text",h["Commit message:"],"",4),new f.CommandParameter("amend",
"boolean",h["Amend:"],!1)],{hasOptionalParameters:!0});j=new f.Command({name:"Commit",tooltip:"Commit",id:"eclipse.orion.git.commitCommand",parameters:j,callback:function(c){var e=c.items.status,f=function(c){var f=a.getService("orion.page.message"),c=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").commitAll(e.Clone.HeadLocation,null,JSON.stringify(c)),h["Committing changes"]);f.createProgressMonitor(c,h["Committing changes"]);c.then(function(){b.changedItem(e)},d)},
g={};g.Message=c.parameters.valueFor("name");g.Amend=c.parameters.valueFor("amend");for(var i=e.Clone.Config,j=0;j<i.length;j++)if(i[j].Key==="user.name")g.CommitterName=i[j].Value,g.AuthorName=i[j].Value;else if(i[j].Key==="user.email")g.CommitterEmail=i[j].Value,g.AuthorEmail=i[j].Value;g.Message&&g.CommitterName&&g.CommitterEmail&&!c.parameters.optionsRequested?f(g):(new l.CommitDialog({body:g,func:f})).show()},visibleWhen:function(){return!0}});c.addCommand(j);j=new f.Command({name:h.Reset,tooltip:h["Reset the branch, discarding all staged and unstaged changes"],
imageClass:"core-sprite-refresh",id:"eclipse.orion.git.resetCommand",callback:function(c){var e=c.items;a.getService("orion.page.dialog").confirm(h["All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered."]+"\n"+h["Are you sure you want to continue?"],function(c){if(c){var c=a.getService("orion.page.message"),f=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").unstageAll(e.IndexLocation,"HARD"),h["Resetting local changes"]);
c.createProgressMonitor(f,h["Resetting local changes"]);f.then(function(){b.changedItem(e)},d)}})},visibleWhen:function(a){return e.hasStagedChanges(a)||e.hasUnstagedChanges(a)}});c.addCommand(j);j=new f.Command({name:h.Checkout,tooltip:h["Checkout files, discarding all changes"],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.checkoutCommand",callback:function(c){var e=g(c.items);a.getService("orion.page.dialog").confirm(h["Your changes to the selected files will be discarded and cannot be recovered."]+
"\n"+h["Are you sure you want to continue?"],function(f){if(f){for(var f=a.getService("orion.page.message"),g=a.getService("orion.page.progress"),i=[],j=0;j<e.length;j++)i[j]=e[j].name;g=g.progress(a.getService("orion.git.provider").checkoutPath(c.userData.Clone.Location,i),h["Resetting local changes"]);f.createProgressMonitor(g,h["Resetting local changes"]);g.then(function(){b.changedItem(e)},d)}})},visibleWhen:function(a){a=g(a);if(a.length===0)return!1;for(var c=0;c<a.length;c++)if(!e.isChange(a[c])||
e.isStaged(a[c]))return!1;return!0}});c.addCommand(j);j=new f.Command({name:h["Show Patch"],tooltip:h["Show workspace changes as a patch"],imageClass:"git-sprite-diff",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.showPatchCommand",hrefCallback:function(a){for(var c=g(a.items),a=a.userData.Clone.DiffLocation+"?parts=diff",b=0;b<c.length;b++)a+="&Path=",a+=c[b].name;return a},visibleWhen:function(a){a=g(a);if(a.length===0)return!1;for(var c=0;c<a.length;c++)if(e.isStaged(a[c]))return!1;return!0}});
c.addCommand(j);j=new f.Command({name:h.Continue,tooltip:h["Contibue Rebase"],id:"eclipse.orion.git.rebaseContinueCommand",callback:function(a){return i(a.items.Clone.HeadLocation,"CONTINUE")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});c.addCommand(j);j=new f.Command({name:h["Skip Patch"],tooltip:h["Skip Patch"],id:"eclipse.orion.git.rebaseSkipPatchCommand",callback:function(a){return i(a.items.Clone.HeadLocation,"SKIP")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==
-1}});c.addCommand(j);j=new f.Command({name:h.Abort,tooltip:h["Abort Rebase"],id:"eclipse.orion.git.rebaseAbortCommand",callback:function(a){return i(a.items.Clone.HeadLocation,"ABORT")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});c.addCommand(j)}})();return n});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/editor/regex,orion/commands,orion/PageUtil,orion/URITemplate".split(","),function(h,k,j,b,g,f){function e(c,a,b){var d="";b&&(d="^");if(d=j.parse("/"+d+c.searchStr+"/"))b=d.pattern,d=d.flags,d.indexOf("i")===-1&&!a.caseSensitive&&(d+="i"),c.regExp={pattern:b,flags:d},c.wildCard=!0}var d=d||{};d.searchUtils=d.searchUtils||{};d.searchUtils.ALL_FILE_TYPE="*.*";d.searchUtils.doSearch=function(c,a,b,e){if(c){var f=!0;b==="*"&&(b="");b===
""&&(f=e&&e.type!==d.searchUtils.ALL_FILE_TYPE);if(f){b!==""&&d.searchUtils.addRecentSearch(a,b,e?e.regEx:!1);var c=c.createSearchParams(b,!1,!1,e),g=d.searchUtils.generateSearchHref(c);d.searchUtils.getOpenSearchPref(a,function(a){a?window.open(g):window.location=g})}}else window.alert(h["Can't search: no search service is available"])};d.searchUtils.generateSearchHelper=function(c,a){var b=c.keyword,f=b,g={};c.fileType&&c.fileType!==d.searchUtils.ALL_FILE_TYPE&&b===""&&(f="*."+c.fileType);if(c.regEx)g.searchStr=
b,e(g,c,a);else{var h=b.indexOf("*")>-1,j=b.indexOf("?")>-1;h&&(b=b.split("*").join(".*"));j&&(b=b.split("?").join("."));!h&&!j&&!c.nameSearch?(g.searchStr=c.caseSensitive?b.split("\\").join(""):b.split("\\").join("").toLowerCase(),g.wildCard=!1):(g.searchStr=c.caseSensitive?b:b.toLowerCase(),e(g,c,a),g.wildCard=!0)}g.searchStrLength=g.searchStr.length;return{params:c,inFileQuery:g,displayedSearchTerm:f}};d.searchUtils.convertSearchParams=function(c){if(c.rows!==void 0)c.rows=parseInt(c.rows);if(c.start!==
void 0)c.start=parseInt(c.start);if(typeof c.regEx==="string")c.regEx=c.regEx.toLowerCase()==="true";if(typeof c.caseSensitive==="string")c.caseSensitive=c.caseSensitive.toLowerCase()==="true";if(typeof c.nameSearch==="string")c.nameSearch=c.nameSearch.toLowerCase()==="true"};d.searchUtils.copySearchParams=function(c,a){var b={},d;for(d in c)if(c[d]!==void 0&&c[d]!==null&&(a||d!=="replace"))b[d]=c[d];return b};d.searchUtils.generateSearchHref=function(c){var a=k.toUrl("search/search.html"),c=d.searchUtils.copySearchParams(c,
!0),b=c.resource;c.resource=void 0;return(new f(a+"#{,resource,params*}")).expand({resource:b,params:c})};d.searchUtils.generateFindURLBinding=function(c,a,b,d){c={find:a.searchStr,regEx:a.wildCard?!0:void 0,caseSensitive:c.caseSensitive?!0:void 0,replaceWith:typeof d==="string"?d:void 0,atLine:typeof b==="number"?b:void 0};return","+(new f("{,params*}")).expand({params:c})};d.searchUtils.convertFindURLBinding=function(c){if(typeof c.regEx==="string")c.regEx=c.regEx.toLowerCase()==="true";if(typeof c.caseSensitive===
"string")c.caseSensitive=c.caseSensitive.toLowerCase()==="true";if(typeof c.atLine==="string")c.atLine=parseInt(c.atLine)};d.searchUtils.replaceRegEx=function(c,a,b){return c.replace(RegExp(a.pattern,a.flags),b)};d.searchUtils.replaceStringLiteral=function(c,a,b){a=j.parse("/"+a+"/gim");return d.searchUtils.replaceRegEx(c,a,b)};d.searchUtils.searchOnelineLiteral=function(c,a,b){var d;d=0;for(var e=!1,f=[];;)if(d=a.indexOf(c.searchStr,d),d<0)break;else{f.push({startIndex:d,length:c.searchStrLength});
e=!0;if(b)break;d+=c.searchStrLength}return e?f:null};d.searchUtils.findRegExp=function(c,a,b,d){if(!a)return null;b=b||"";b+=(b.indexOf("g")===-1?"g":"")+(b.indexOf("m")===-1?"m":"");var e=null;return(e=RegExp(a,b).exec(c.substring(d)))&&{startIndex:e.index+d,length:e[0].length}};d.searchUtils.searchOnelineRegEx=function(c,a,b){for(var e=0,f=!1,g=[];;)if(e=d.searchUtils.findRegExp(a,c.regExp.pattern,c.regExp.flags,e)){g.push(e);f=!0;if(b)break;e=e.startIndex+e.length}else break;return f?g:null};
d.searchUtils.generateNewContents=function(c,a,b,e,f,g){if(e&&a){if(!c)b.contents=[];for(var h=0;h<a.length;h++){for(var j=a[h],k=!1,n=!1,y=[],t,v=0,w=0;w<e.children.length;w++)if(e.children[w].lineNumber-1===h){v=w;for(k=0;k<e.children[w].matches.length;k++)e.children[w+k].checked!==!1&&y.push(k);n=y.length>0;t=e.children[w].matches;k=!0;break}if(k){if(n){y=d.searchUtils.replaceCheckedMatches(j,f,t,y,g);j=y.replacedStr;for(k=0;k<e.children[v].matches.length;k++)e.children[v+k].newMatches=y.newMatches}else for(k=
0;k<e.children[v].matches.length;k++)e.children[v+k].newMatches=e.children[v+k].matches;c?b.contents[h]=j:b.contents.push(j)}else c||b.contents.push(j)}}};d.searchUtils.generateMatchContext=function(c,a,b){var d=[],e=c*2+1,f;a.length<=e?(f=0,c=a.length-1):(f=b-c,f<0?(f=0,c=f+e-1):(c=b+c,c>a.length-1&&(c=a.length-1,f=c-e+1)));for(e=f;e<=c;e++)d.push({context:a[e],current:e===b});return d};d.searchUtils.splitFile=function(c){for(var a=0,b=0,d=0,e=0,f=[];;){a!==-1&&a<=d&&(a=c.indexOf("\r",d));b!==-1&&
b<=d&&(b=c.indexOf("\n",d));if(b===-1&&a===-1){f.push(c.substring(e));break}var g=1;a!==-1&&b!==-1?a+1===b?(g=2,d=b+1):d=(a<b?a:b)+1:d=a!==-1?a+1:b+1;f.push(c.substring(e,d-g));e=d}return f};d.searchUtils.searchWithinFile=function(c,a,b,e,f,g){b=d.searchUtils.splitFile(b);if(f)a.contents=b;if(a){a.children=[];for(var h=e=0;h<b.length;h++){var j=b[h];if(j&&j.length>0){var k=g?j:j.toLowerCase();if(k=c.wildCard?d.searchUtils.searchOnelineRegEx(c,k):d.searchUtils.searchOnelineLiteral(c,k)){var n=h+1;
if(f)for(var y=0;y<k.length;y++){var t=y+1,t={parent:a,checked:a.checked,type:"detail",matches:k,lineNumber:n,matchNumber:t,name:j,location:a.location+"-"+n+"-"+t};a.children.push(t)}else t={parent:a,context:d.searchUtils.generateMatchContext(2,b,h),checked:a.checked,type:"detail",matches:k,lineNumber:n,name:j,location:a.location+"-"+n},a.children.push(t);e+=k.length}}}a.totalMatches=e}};d.searchUtils.replaceCheckedMatches=function(c,a,b,d,e){for(var f=0,g="",h=[],j=0;j<b.length;j++){f!==b[j].startIndex&&
(g+=c.substring(f,b[j].startIndex));if(b[j].length)e=b[j].length;for(var f=!1,k=0;k<d.length;k++)if(d[k]===j){f=!0;break}f?(h.push({startIndex:g.length,length:a.length}),g+=a):(h.push({startIndex:g.length,length:e}),g+=c.substring(b[j].startIndex,b[j].startIndex+e));f=b[j].startIndex+e}f<c.length&&(g+=c.substring(f));return{replacedStr:g,newMatches:h}};d.searchUtils.fullPathNameByMeta=function(c){var a=c.length,b="";if(a>0)for(a-=1;a>-1;a--)b=b+(b===""?"":"/")+c[a].Name;return b};d.searchUtils.path2FolderName=
function(c,a,b){return c.substring(0,c.length-a.length-(b?0:1))};d.searchUtils._storeRecentSearch=function(c,a){c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){c.put("recentSearch",a)})};d.searchUtils.addRecentSearch=function(c,a,b){typeof a==="string"&&a&&c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){var f,e=e.get("recentSearch");typeof e==="string"&&(e=JSON.parse(e));if(e){for(f in e)if(e[f].name===a)return;
e.length>=20&&e.splice(19,e.length-20+1)}else e=[];e.splice(0,0,{name:a,regEx:b});d.searchUtils._storeRecentSearch(c,e)})};d.searchUtils.getSearches=function(c,a,b){c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){c=c.get(a);typeof c==="string"&&(c=JSON.parse(c));c&&b&&b(c)})};d.searchUtils.getMixedSearches=function(c,a,b,e){c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var f,g=c.get("recentSearch");typeof g===
"string"&&(g=JSON.parse(g));if(a)for(f in c=c.get("search"),typeof c==="string"&&(c=JSON.parse(c)),c)if(b){var h=d.searchUtils.parseQueryStr(c[f].query);g.some(function(a){return h.searchStrTitle===a.name})||g.push({name:h.searchStrTitle,label:c[f].name})}else g.push({name:null,label:c[f].name,value:c[f].query});g&&e&&e(g)})};d.searchUtils.getOpenSearchPref=function(c,a){c.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(c){c=c.get("nav.config");a(c&&c["links.newtab"]!==
"undefined"?c["links.newtab"]?!0:!1:!1)})};d.searchUtils.setOpenSearchPref=function(c,a){c.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){c.put("openSearchPref",{openInNewTab:a})})};return d.searchUtils});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(h,k,j,b,g,f){function e(d,c,a,e){this.registry=d;this.fileClient=c;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=e&&e.searchOnName;this._buildSkeletonOnly=e&&e.buildSkeletonOnly;this._fetchChildrenCallBack=e&&e.fetchChildrenCallBack;this._searchParams=a;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:b.generateSearchHelper(a);this._location=e&&e.location;this._childrenLocation=e&&e.childrenLocation?e.childrenLocation:this._location}e.prototype.search=function(b){var c=this.registry.getService("orion.core.contenttypes");this._onSearchComplete=b;var a=this;this.registry.getService("orion.page.dialog").confirm(h["The search term on this location will not use indexed files."]+"\n"+h["It will take longer time. Do you want to proceed?"],function(b){b&&c.getContentTypes().then(function(c){a.contentTypesCache=
c;a._visitRecursively(a._childrenLocation).then(function(){a._sort(a.fileLocations);a._onSearchComplete({response:{numFound:a.fileLocations.length,docs:a.fileLocations}})})})})};e.prototype.searchName=function(d,c){if(d)this.searchHelper=b.generateSearchHelper(d,!0);if(c)this.onSearchNameComplete=c;var a=[];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?
b.searchOnelineRegEx(this.searchHelper.inFileQuery,f,!0):b.searchOnelineLiteral(this.searchHelper.inFileQuery,f,!0))if(a.push(this.fileSkeleton[e]),a.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:a.length,docs:a}})}};e.prototype.buildSkeleton=function(b,c){this._buildingSkeleton=!0;var a=this.registry.getService("orion.core.contenttypes"),e=this;b();a.getContentTypes().then(function(a){e.contentTypesCache=a;e._visitRecursively(e._childrenLocation).then(function(){e._buildingSkeleton=
!1;c();e.searchHelper&&!e._buildSkeletonOnly&&e.searchName()})})};e.prototype._searchCompleted=function(){console.log("Search Completed.")};e.prototype._searchFiles=function(){var b=[],c;if(this.fileLocations.length>0){c=this;for(var a=0;a<c.fileLocations.length;a++)b.push(c._sniffSearch(c.fileLocations[a]))}return f.all(b)};e.prototype._sort=function(b){b.sort(function(c,a){var b=c.Name&&c.Name.toLowerCase(),d=a.Name&&a.Name.toLowerCase();return b<d?-1:b>d?1:0})};e.prototype._onFileType=function(d){return this.searchHelper.params.fileType?
this.searchHelper.params.fileType===b.ALL_FILE_TYPE?!0:d.extension.indexOf(this.searchHelper.params.fileType)>=0:!0};e.prototype._visitRecursively=function(b){var c=[],a=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(b);var e=a.registry.getService("orion.page.progress");return(e?e.progress(a.fileClient.fetchChildren(b),"Crawling search for children of "+b):a.fileClient.fetchChildren(b)).then(function(b){for(var d=0;d<b.length;d++)if(b[d].Directory!==void 0&&b[d].Directory===!1)if(a._searchOnName)c.push(a._buildSingleSkeleton(b[d]));
else if(a._buildSkeletonOnly)c.push(a._buildSingleSkeleton(b[d]));else{var e=g.getFilenameContentType(b[d].Name,a.contentTypesCache);e&&(e["extends"]==="text/plain"||e.id==="text/plain")&&a._onFileType(e)&&c.push(a._sniffSearch(b[d]))}else b[d].Location&&c.push(a._visitRecursively(b[d].ChildrenLocation));return f.all(c)})};e.prototype._hitOnceWithinFile=function(d){d=this._searchParams.caseSensitive?d:d.toLowerCase();return this.searchHelper.inFileQuery.wildCard?b.searchOnelineRegEx(this.searchHelper.inFileQuery,
d,!0):b.searchOnelineLiteral(this.searchHelper.inFileQuery,d,!0)};e.prototype._reportSingleHit=function(b){b.LastModified=b.LocalTimeStamp;this.fileLocations.push(b);this._hitCounter++;this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0)};e.prototype._sniffSearch=function(b){this._totalCounter++;var c=this;if(this.searchHelper.params.keyword==="")this._reportSingleHit(b),this.registry.getService("orion.page.message").setProgressResult({Message:j.formatMessage(h["${0} files found out of ${1}"],
this._hitCounter,this._totalCounter)});else return this.registry.getService("orion.page.progress").progress(c.fileClient.read(b.Location),"Reading file "+b.Location).then(function(a){c._hitOnceWithinFile(a)&&c._reportSingleHit(b);c.registry.getService("orion.page.message").setProgressResult({Message:j.formatMessage(h["${0} files found out of ${1}"],c._hitCounter,c._totalCounter)})},function(a){console.error("Error loading file content: "+a.message)})};e.prototype._buildSingleSkeleton=function(b){this._totalCounter++;
this.fileSkeleton.push(b);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();b=new f;b.resolve(this._totalCounter);return b};e.prototype.constructor=e;return{SearchCrawler:e}});
define("orion/searchClient","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/i18nUtil,orion/searchUtils,orion/crawler/searchCrawler".split(","),function(h,k,j,b,g,f){function e(b){this.registry=b.serviceRegistry;this._commandService=b.commandService;(this._fileService=b.fileService)||console.error("No file service on search client")}e.prototype={search:function(b,c,a){var e=function(a){for(var c=[],b=0;b<a.response.docs.length;b++){var d=a.response.docs[b];c.push({name:d.Name,path:d.Location,
folderName:g.path2FolderName(d.Path?d.Path:d.Location,d.Name),directory:d.Directory,lineNumber:d.LineNumber})}return c};if(this._crawler&&b.nameSearch)this._crawler.searchName(b,function(c){a(e(c),null)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(b),"Searching "+b.keyword).then(function(c){var f=b.keyword,f=f.substring(f.indexOf("}")+1),f=f.substring(f.indexOf(":")+1);a(e(c),f)},function(c){a(null,null,c)})}catch(h){typeof h==="string"&&h.indexOf("search")>
-1&&this._crawler?this._crawler.searchName(b,function(c){a(e(c),null)}):typeof h==="string"&&h.indexOf("search")>-1&&!b.nameSearch?(new f.SearchCrawler(this.registry,this._fileService,b,{childrenLocation:this.getChildrenLocation()})).search(function(c){a(e(c),null)}):this.registry.getService("orion.page.message").setErrorMessage(h)}},getFileService:function(){return this._fileService},setCrawler:function(b){this._crawler=b},handleError:function(b,c){console.error(b);j.empty(c);c.appendChild(document.createTextNode(b));
return b},setLocationByMetaData:function(d,c){var a="",e=null;this._searchRootLocation=this._fileService.fileServiceRootURL(d.Location);c&&d&&d.Parents&&d.Parents.length>0?e=c.index==="last"?d.Parents[d.Parents.length-1]:d.Parents[0]:d&&d.Directory&&d.Location&&d.Parents&&(e=d);if(e)this.setLocationbyURL(e.Location),a=e.Name,this._childrenLocation=e.ChildrenLocation;else if(d)this.setLocationbyURL(this._searchRootLocation),a=this._fileService.fileServiceName(d.Location),this._childrenLocation=d.ChildrenLocation;
e=j.node("search");a||(a="");if(e&&e.placeholder){e.value="";var f=b.formatMessage(h["Search ${0}"],a);e.placeholder=f.length>30?f.substring(0,27)+"...":b.formatMessage(h["Search ${0}"],a)}if(e&&e.title)e.title=h["Type a keyword or wild card to search in "]+a},setLocationbyURL:function(b){this._searchLocation=b},setRootLocationbyURL:function(b){this._searchRootLocation=b},setChildrenLocationbyURL:function(b){this._childrenLocation=b},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(b,c,a,e){a=a?this.getSearchRootLocation():this.getSearchLocation();return c?{resource:a,sort:"NameLower asc",rows:100,start:0,nameSearch:!0,keyword:b}:{resource:a,sort:"Path asc",
rows:40,start:0,caseSensitive:e?e.caseSensitive:void 0,regEx:e?e.regEx:void 0,fileType:e?e.type:void 0,keyword:b}},defaultRenderer:{makeRenderFunction:function(d,c,a,e,f){function g(a){return!d?!0:(a=d.getFilenameContentType(a))&&(a["extends"]==="text/plain"||a.id==="text/plain")?!0:!1}return function(d,u,l){if(l)j.empty(c),d=document.createElement("div"),d.appendChild(document.createTextNode(h["Search failed."])),c.appendChild(d),typeof e==="function"&&e(c);else{var l=function(){function a(c,b){var d=
b.folderName?b.folderName:b.path,e=document.createElement("span");e.id=d.replace(/[^a-zA-Z0-9_\.:\-]/g,"");e.appendChild(document.createTextNode(" - "+d+" "));c.appendChild(e)}var c={};return function(b,d){var e=d.name;if(c.hasOwnProperty(e)){a(b,d);var f=c[e];typeof f==="function"&&(c[e]=null,f())}else c[e]=function(){a(b,d)}}}(),s=!1;j.empty(c);if(d&&d.length>0){var n=document.createElement("table");n.setAttribute("role","presentation");for(var y=0;y<d.length;y++){var t=d[y],v;if(!s&&(s=!0,a))v=
n.insertRow(0).insertCell(0),v.textContent=a;v=n.insertRow(-1).insertCell(0);v.colspan=2;f&&f(v);var w=document.createElement("a");w.appendChild(document.createTextNode(t.name));t.LineNumber&&w.appendChild(document.createTextNode(" (Line "+t.LineNumber+")"));var A=t.location;t.isExternalResource?A=t.path:(A=t.directory?k.toUrl("navigate/table.html")+"#"+t.path:g(t.name)?k.toUrl("edit/edit.html")+"#"+t.path:t.path,A==="#"&&(A=""));w.setAttribute("href",A);w.setAttribute("aria-describedby",(t.folderName?
t.folderName:t.path).replace(/[^a-zA-Z0-9_\.:\-]/g,""));w.style.verticalAlign="middle";v.appendChild(w);l(v,t)}c.appendChild(n);typeof e==="function"&&e(c)}!s&&u&&(d=b.formatMessage(h["No matches found for ${0}"],u),j.empty(c),c.appendChild(document.createTextNode(d)),typeof e==="function"&&e(c))}}}}};e.prototype.constructor=e;return{Searcher:e}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages,orion/crawler/searchCrawler,orion/contentTypes,require,orion/webui/littlelib,orion/webui/dialog".split(","),function(h,k,j,b,g,f){function e(b){this._init(b)}e.prototype=new f.Dialog;e.prototype.TEMPLATE='<div role="search"><div><label 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="'+
b.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>';e.prototype._init=function(b){this.title=b.title||h["Find File Named"];this.modal=!0;this.messages=h;this._searcher=b.searcher;this._progress=b.progress;this._onHide=b.onHide;
this._contentTypeService=new j.ContentTypeService(this._searcher.registry);if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=b.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(h["Missing required argument: fileService"]);this._searchRenderer=b.searchRenderer;if(!this._searchRenderer||typeof this._searchRenderer.makeRenderFunction!==
"function")throw Error(h["Missing required argument: searchRenderer"]);this._favService=b.favoriteService;if(!this._favService)throw Error(h["Missing required argument: favService"]);this._initialize()};e.prototype._bindToDom=function(b){var c=this;c.$crawlingProgress.style.display="none";this.$fileName.setAttribute("placeholder",h.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===g.KEY.ENTER){var b=g.$("a",c.$results);b&&(g.stop(a),window.open(b.href),c.hide())}},!1);b.addEventListener("keydown",function(a){var b,d,e,f,h;if(a.keyCode===g.KEY.DOWN||a.keyCode===g.KEY.UP)d=g.$$array("a",c.$results),b=g.$$array("a",c.$favresults),e=document.activeElement,h=d.indexOf(e),f=b.indexOf(e),a.keyCode===g.KEY.DOWN?f>=0?(f<b.length-1?b[f+1]:d.length>0?d[0]:b[0]).focus():h>=0?(h<d.length-1?d[h+1]:b.length>0?b[0]:d[0]).focus():
(d.length>0||b.length>0)&&(-1<b.length-1?b[0]:d[0]).focus():f>=0?(e=c.$fileName,(f>0?b[f-1]:e).focus()):h>=0?(e=c.$fileName,(h>0?d[h-1]:b.length>0?b[b.length-1]:e).focus()):d.length>0?d[d.length-1].focus():b.length>0&&b[b.length-1].focus(),g.stop(a)});b.addEventListener("mouseup",function(a){a.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(h["Building file skeleton..."]))},function(){c.$crawlingProgress.style.display="none";c.$progress.removeChild(c.$progress.lastChild)})}},0)};e.prototype.populateFavorites=function(){var b=document.createElement("div");b.appendChild(document.createTextNode(h["Populating favorites&#x2026;"]));
g.empty(this.$favresults);this.$favresults.appendChild(b);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())};e.prototype.showFavorites=function(){var b=this;return function(c){if(c.navigator)c=c.navigator;b._searchRenderer.makeRenderFunction(b._contentTypeService,b.$favresults,!1,b.decorateResult.bind(b),
b.showFavoritesImage)(c);if(c&&c.length>0)c=document.createElement("div"),c.style.borderBottom="1px dashed #BBBBBB",c.style.padding="5px",b.$favresults.appendChild(c)}};e.prototype.showFavoritesImage=function(d){var c=new Image;c.classList.add("modelDecorationSprite");c.classList.add("core-sprite-makeFavorite");c.src=b.toUrl("images/none.png");c.title=h.Favorite;d.appendChild(c);c.style.verticalAlign="middle"};e.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var b=(new Date).getTime();
b-this._time>this._searchDelay?(this._time=b,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};e.prototype.doSearch=function(){var b=this.$fileName.value,c=this.showFavorites();this._progress?this._progress.progress(this._favService.queryFavorites(b),"Getting favorites for: "+b).then(function(a){c(a)}):this._favService.queryFavorites(b).then(function(a){c(a)});if(b){var a=document.createElement("div");a.appendChild(document.createTextNode(h["Searching..."]));g.empty(this.$favresults);
this.$results.appendChild(a);var e=this;setTimeout(function(){var a=e._searcher.createSearchParams(b,!0,e._searchOnRoot),c=e._searchRenderer.makeRenderFunction(e._contentTypeService,e.$results,!1,e.decorateResult.bind(e));e._searcher.search(a,!1,c)},0)}};e.prototype.decorateResult=function(b){for(var c=this,b=g.$$array("a",b),a=0;a<b.length;a++){var e=b[a];e.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&c.hide()},!1);e.addEventListener("keyup",function(a){a.keyCode===
g.KEY.ENTER&&c.hide()},!1)}};e.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};e.prototype._afterHiding=function(){this._onHide&&this._onHide()};e.prototype.constructor=e;return{OpenResourceDialog:e}});
define("orion/globalSearch/advSearchOptContainer",["i18n!orion/globalSearch/nls/messages","require","orion/searchUtils","orion/contentTypes","orion/i18nUtil"],function(h,k,j,b,g){function f(b,c,a,f){this._inputField=b;if(typeof this._inputField==="string")this._inputField=document.getElementById(this._inputField);(b=f?f.group:null)||(b=this._inputField.id?this._inputField.id:"default__dropDown__group");this._idPrefix=b+"__dropDown__";this.containerId=this._idPrefix+"UIContainer";this._dismissed=!0;
var g=this;this._optRenderer=new e(c,a,function(){g.dismiss();g._inputField.focus()});this._initUI()}function e(b,c,a){this._searcher=b;this._serviceRegistry=c;this._cancelCallBack=a}f.prototype._initUI=function(){this._optUIContainer=document.getElementById(this.containerId);if(!this._optUIContainer)this._optUIContainer=document.createElement("div"),this._optUIContainer.id=this.containerId,this._optUIContainer.style.display="none",this._optUIContainer.className="advSearchOptContainer",document.body.appendChild(this._optUIContainer),
this._optRenderer.render(this._optUIContainer)};f.prototype.dismiss=function(){this._dismissed=!0;this._optUIContainer.style.display="none"};f.prototype.show=function(b){for(var c=0,a=0,e=this._inputField;e;)c+=e.offsetLeft,a+=e.offsetTop,e=e.offsetParent;this._optUIContainer.style.display="block";this._optUIContainer.style.top=a+this._inputField.offsetHeight+2+"px";this._optUIContainer.style.left=c+"px";this._optUIContainer.style.width=this._inputField.offsetWidth+"px";this._optRenderer._searchBox.value=
b;this._optRenderer._searchBox.focus();this._dismissed=this._mouseDown=!1};f.prototype.toggle=function(){this._dismissed?this.show(this._inputField.value):this.dismiss()};f.prototype.constructor=f;e.prototype.getOptions=function(){return{searchStr:this._searchBox.value,caseSensitive:this._caseSensitiveCB.checked,regEx:this._regExCB.checked,type:this._fileTypes.options[this._fileTypes.selectedIndex].value}};e.prototype.render=function(d,c){this._parentDiv=d;if(typeof this._parentDiv==="string")this._parentDiv=
document.getElementById(this._parentDiv);var a=this._serviceRegistry.getService("orion.core.contenttypes");if(a){var e=this;a.getContentTypes().then(function(a){e.contentTypesCache=a;e._render(c)})}else a=new b.ContentTypeService(this._serviceRegistry),this.contentTypesCache=a.getContentTypes(),this._render(c)};e.prototype._render=function(b){b?this._renderHTML(b):this._renderRaw()};e.prototype._submitSearch=function(){var b=this.getOptions();j.doSearch(this._searcher,this._serviceRegistry,b.searchStr,
b)};e.prototype._initControls=function(){this._searchBox=document.getElementById("advSearchInput");this._fileTypes=document.getElementById("advSearchTypes");this._caseSensitiveCB=document.getElementById("advSearchCaseSensitive");this._regExCB=document.getElementById("advSearchRegEx");this._submitButton=document.getElementById("advSearchSubmit");for(var b=[{label:h["All types"],value:j.ALL_FILE_TYPE}],c=0;c<this.contentTypesCache.length;c++)if(this.contentTypesCache[c]["extends"]==="text/plain"||this.contentTypesCache[c].id===
"text/plain")for(var a=0;a<this.contentTypesCache[c].extension.length;a++)b.push({label:this.contentTypesCache[c].extension[a],value:this.contentTypesCache[c].extension[a]});for(c=0;c<b.length;c++){var a=document.createElement("option"),e=document.createTextNode(b[c].label);a.appendChild(e);this._fileTypes.appendChild(a);a.value=b[c].value}var f=this;this._searchBox.addEventListener("keydown",function(a){a=a.charCode||a.keyCode;a===13&&f._submitSearch();a===27&&f._cancelCallBack&&f._cancelCallBack()});
this._fileTypes.addEventListener("change",function(){var a=f._fileTypes.options[f._fileTypes.selectedIndex].value;f._searchBox.placeholder=a===j.ALL_FILE_TYPE?h["Type a search term"]:g.formatMessage(h["All ${0} files"],a)});this._submitButton.onclick=function(){f._submitSearch()}};e.prototype._initHTMLLabels=function(){document.getElementById("advSearchLabel").appendChild(document.createTextNode(h["Files that contain:"]));document.getElementById("advSearchInput").placeholder=h["Type a search term"];
document.getElementById("advSearchTypeLabel").appendChild(document.createTextNode(h["File type:"]));document.getElementById("advSearchCaseSensitiveLabel").appendChild(document.createTextNode(h["Case sensitive"]));document.getElementById("advSearchRegExLabel").appendChild(document.createTextNode(h["Regular expression"]));document.getElementById("advSearchSubmit").value=h.Search};e.prototype._renderHTML=function(b){var c=this,a=new XMLHttpRequest;a.open("GET",k.toUrl(b),!0);a.onreadystatechange=function(){if(this.readyState===
4&&this.status===200)c._parentDiv.innerHTML=this.responseText,c._initHTMLLabels(),c._initControls()};a.send()};e.prototype._htmlTemplate='<ul class="advSearchOptUL"><li class="advSearchOptLILabel"><label>'+h["Files that contain:"]+'</label></li><li class="advSearchOptLIControl"><input type="text" id="advSearchInput" placeholder="'+h["Type a search term"]+'"></input></li><li class="advSearchOptLIControl"><label>'+h["File type:"]+'</label><select id="advSearchTypes"></select></li><li class="advSearchOptLIControl"><label>'+
h["Case sensitive"]+'</label><input type="checkbox" id="advSearchCaseSensitive"></input></li><li class="advSearchOptLIControl"><label>'+h["Regular expression"]+'</label><input type="checkbox" id="advSearchRegEx"></input></li><li class="advSearchOptLIControl"><input type="button" class="advSearchOptButton" id="advSearchSubmit" value="'+h.Search+'"></input></li></ul>';e.prototype._renderRaw=function(){this._parentDiv.innerHTML=this._htmlTemplate;this._initControls()};e.prototype.constructor=e;return{advSearchOptContainer:f,
advSearchOptRenderer:e}});
define("orion/searchAndReplace/textSearcher","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/editor/annotations,orion/commands,orion/searchUtils".split(","),function(h,k,j,b){var g=g||{};g.TextSearcher=function(){function f(b,d,c,a){this._editor=b;this._commandService=d;this._undoStack=c;this._wrapSearch=this._ignoreCase=this._showAllOccurrence=!0;this._wholeWord=!1;this._incremental=!0;this._useRegExp=!1;this._findAfterReplace=!0;this._reverse=!1;this.isMac=navigator.platform.indexOf("Mac")!==
-1;this._timer=this._searchRange=null;this._searchOnRange=!1;this._lastSearchString="";var f=this;this._listeners={onEditorFocus:function(a){f.removeCurrentAnnotation(a)}};this.setOptions(a)}f.prototype={_createActionTable:function(){var e=this;this._commandService.openParameterCollector("pageNavigationActions",function(d){var c=document.createElement("input");c.type="text";c.name=h["Find:"];c.id="localSearchFindWith";c.placeholder=h["Find With"];c.onkeyup=function(a){return e._handleKeyUp(a)};c.onkeydown=
function(a){return e._handleKeyDown(a,!0)};d.appendChild(c);e.createButton("Next",d,function(){e.findNext(!0)});e.createButton("Previous",d,function(){e.findNext(!1)});var a=document.createElement("input");a.type="text";a.name=h["ReplaceWith:"];a.id="localSearchReplaceWith";a.placeholder=h["Replace With"];a.classList.add("searchCmdGroupMargin");a.onkeydown=function(a){return e._handleKeyDown(a,!1)};d.appendChild(a);e.createButton(h.Replace,d,function(){e.replace()});e.createButton(h["Replace All"],
d,function(){e.replaceAll()});a=document.createElement("div");d.appendChild(a);a.classList.add("findOptionsDiv");var f=e._commandService._createDropdownMenu(a,h.Options);f.menuButton.classList.add("findSlideoutMenu");e._commandService._generateCheckedMenuItem(f.menu,h["Show all"],e._showAllOccurrence,function(a){a=a.target.checked;e.setOptions({showAllOccurrence:a});a?e.markAllOccurrences(!0):(a=e._editor.getAnnotationModel())&&a.removeAnnotations(b.AnnotationType.ANNOTATION_MATCHING_SEARCH);f.dropdown.close(!0)});
e._commandService._generateCheckedMenuItem(f.menu,h["Case sensitive"],!e._ignoreCase,function(a){e.setOptions({ignoreCase:!a.target.checked});f.dropdown.close(!0);e.findNext(!0,null,!0)});e._commandService._generateCheckedMenuItem(f.menu,h["Wrap search"],e._wrapSearch,function(a){e.setOptions({wrapSearch:a.target.checked});f.dropdown.close(!0)});e._commandService._generateCheckedMenuItem(f.menu,h["Incremental search"],e._incremental,function(a){e.setOptions({incremental:a.target.checked});f.dropdown.close(!0)});
e._commandService._generateCheckedMenuItem(f.menu,h["Whole Word"],e._wholeWord,function(a){e.setOptions({wholeWord:a.target.checked});f.dropdown.close(!0);e.findNext(!0,null,!0)});e._commandService._generateCheckedMenuItem(f.menu,h["Regular expression"],e._useRegExp,function(a){e.setOptions({useRegExp:a.target.checked});f.dropdown.close(!0);e.findNext(!0,null,!0)});e._commandService._generateCheckedMenuItem(f.menu,h["Find after replace"],e._findAfterReplace,function(a){e.setOptions({findAfterReplace:a.target.checked});
f.dropdown.close(!0)});return c},function(){e.closeUI()})},visible:function(){return document.getElementById("localSearchFindWith")?!0:!1},_handleKeyUp:function(){if(this._incremental&&!this._keyUpHandled)this._noSelection?this._noSelection=!1:this.findNext(!0,null,!0);this._keyUpHandled=!1;return!0},_handleKeyDown:function(b,d){var c=(this.isMac?b.metaKey:b.ctrlKey)&&!b.altKey&&!b.shiftKey;if(c&&b.keyCode===70)return this._keyUpHandled=d,b.stopPropagation&&b.stopPropagation(),b.cancelBubble=!0,!1;
if((this.isMac?b.metaKey:b.ctrlKey)&&!b.altKey&&b.keyCode===75||b.keyCode===13)return b.stopPropagation&&b.stopPropagation(),b.cancelBubble=!0,this.findNext(!b.shiftKey),this._keyUpHandled=d,!1;if(c&&b.keyCode===82)return b.stopPropagation&&b.stopPropagation(),b.cancelBubble=!0,d||this.replace(),this._keyUpHandled=d,!1;return b.keyCode===27?(this.closeUI(),this._keyUpHandled=d,!1):!0},closeUI:function(){this.visible()&&this._commandService.closeParameterCollector();this._editor.getTextView().removeEventListener("Focus",
this._listeners.onEditorFocus);this._editor.getTextView().focus();var e=this._editor.getAnnotationModel();e&&(e.removeAnnotations(b.AnnotationType.ANNOTATION_CURRENT_SEARCH),e.removeAnnotations(b.AnnotationType.ANNOTATION_MATCHING_SEARCH))},removeCurrentAnnotation:function(){var e=this._editor.getAnnotationModel();e&&e.removeAnnotations(b.AnnotationType.ANNOTATION_CURRENT_SEARCH)},createButton:function(b,d,c){var a=document.createElement("span");a.tabIndex=0;a.role="button";a.addEventListener("click",
c.bind(this),!1);var f=this;a.addEventListener("keydown",function(a){a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE?c.bind(f)():a.keyCode===j.KEY.ESCAPE&&f.closeUI()});a.appendChild(document.createTextNode(b));a.classList.add("findSlideoutButton");d.appendChild(a)},buildToolBar:function(b,d){this._keyUpHandled=!0;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var c=document.getElementById("localSearchFindWith");if(this.visible())b.length>0?c.value=b:this._noSelection=
!0;else{this._createActionTable();if(typeof d==="string")document.getElementById("localSearchReplaceWith").value=d;c=document.getElementById("localSearchFindWith");c.value=b}window.setTimeout(function(){c.select();c.focus()},10)},setOptions:function(b){if(b){if(b.showAllOccurrence===!0||b.showAllOccurrence===!1)this._showAllOccurrence=b.showAllOccurrence;if(b.ignoreCase===!0||b.ignoreCase===!1)this._ignoreCase=b.ignoreCase;if(b.wrapSearch===!0||b.wrapSearch===!1)this._wrapSearch=b.wrapSearch;if(b.wholeWord===
!0||b.wholeWord===!1)this._wholeWord=b.wholeWord;if(b.incremental===!0||b.incremental===!1)this._incremental=b.incremental;if(b.useRegExp===!0||b.useRegExp===!1)this._useRegExp=b.useRegExp;if(b.findAfterReplace===!0||b.findAfterReplace===!1)this._findAfterReplace=b.findAfterReplace;if(b.reverse===!0||b.reverse===!1)this._reverse=b.reverse;if(b.toolBarId)this._toolBarId=b.toolBarId;if(b.searchRange)this._searchRange=b.searchRange;if(b.searchOnRange===!0||b.searchOnRange===!1)this._searchOnRange=b.searchOnRange}},
getSearchStartIndex:function(b,d){var c=this._editor.getCaretOffset();if(b){var a=this._editor.getSelection(),f=a.end>a.start?a.end-a.start:0;return!d?c-f-1>0?c-f-1:0:a.end>0?a.end:0}return c>0?c:0},findNext:function(b,d,c){this.setOptions({reverse:!b});var a=document.getElementById("localSearchFindWith"),c=this.getSearchStartIndex(c?!0:!b);d||(d=a?a.value:this._lastSearchString);return this._doFind(d,c,!b,this._wrapSearch)},startUndo:function(){this._undoStack&&this._undoStack.startCompoundChange()},
endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_doReplace:function(b,d,c,a){var f=this._editor;if(this._useRegExp){if(c=f.getText().substring(b,d).replace(RegExp(c,this._ignoreCase?"i":""),a))f.setText(c,b,d),f.setSelection(b,b+c.length,!0)}else f.setText(a,b,d),f.setSelection(b,b+a.length,!0)},replace:function(){this.startUndo();var b=document.getElementById("localSearchReplaceWith").value,d=this._editor,c=d.getSelection(),a=document.getElementById("localSearchFindWith").value,
c=c?c.start:0;a&&(d=d.getModel().find({string:a,start:c,reverse:!1,wrap:this._wrapSearch,regex:this._useRegExp,wholeWord:this._wholeWord,caseInsensitive:this._ignoreCase}).next())&&this._doReplace(d.start,d.end,a,b);this.endUndo();this._findAfterReplace&&a&&this._doFind(a,this.getSearchStartIndex(!1),!1,this._wrapSearch)},_doFind:function(e,d,c,a){var f=this._editor,g=f.getAnnotationModel();if(!e)return g&&(g.removeAnnotations(b.AnnotationType.ANNOTATION_CURRENT_SEARCH),g.removeAnnotations(b.AnnotationType.ANNOTATION_MATCHING_SEARCH)),
null;this._lastSearchString=e;var j=f.getModel().find({string:e,start:d,reverse:c,wrap:a,regex:this._useRegExp,wholeWord:this._wholeWord,caseInsensitive:this._ignoreCase}).next();if(!this._replacingAll&&(j?this._editor.reportStatus(""):this._editor.reportStatus(h["Not found"],"error"),this.visible()&&(e=b.AnnotationType.ANNOTATION_CURRENT_SEARCH,g&&(g.removeAnnotations(e),j&&g.addAnnotation(b.AnnotationType.createAnnotation(e,j.start,j.end))),this._showAllOccurrence))){this._timer&&window.clearTimeout(this._timer);
var k=this;this._timer=window.setTimeout(function(){k.markAllOccurrences(j);k._timer=null},500)}j&&f.moveSelection(j.start,j.end,null,!1);return j},replaceAll:function(){var b=document.getElementById("localSearchFindWith").value;if(b){this._replacingAll=!0;var d=this._editor;d.reportStatus("");d.reportStatus(h["Replacing all..."],"progress");var c=document.getElementById("localSearchReplaceWith").value,a=this;window.setTimeout(function(){for(var f=0,g=0;;){if(!a._doFind(b,f))break;g++;g===1&&a.startUndo();
f=d.getSelection();a._doReplace(f.start,f.end,b,c);f=a.getSearchStartIndex(!0,!0)}g>0&&a.endUndo();d.reportStatus("","progress");f>0?d.reportStatus(h["Replaced "]+g+h[" matches"]):d.reportStatus(h["Nothing replaced"],"error");a._replacingAll=!1},100)}},markAllOccurrences:function(e){var d=this._editor.getAnnotationModel();if(d){for(var c=b.AnnotationType.ANNOTATION_MATCHING_SEARCH,a=d.getAnnotations(0,d.getTextModel().getCharCount()),f=[],g;a.hasNext();){var h=a.next();h.type===c&&f.push(h)}a=document.getElementById("localSearchFindWith").value;
if(e&&a){a=this._editor.getModel().find({string:a,regex:this._useRegExp,wholeWord:this._wholeWord,caseInsensitive:this._ignoreCase});for(g=[];a.hasNext();)e=a.next(),g.push(b.AnnotationType.createAnnotation(c,e.start,e.end))}d.replaceAnnotations(f,g)}}};return f}();return g});
define("orion/PageLinks",["require","orion/Deferred","orion/PageUtil","orion/URITemplate","orion/URL-shim"],function(h,k,j,b){function g(f,e){for(var d=f.getServiceReferences(e||"orion.page.link"),c=j.matchResourceParameters(window.location.href),a={OrionHome:(new URL(h.toUrl("."),window.location)).href.slice(0,-1),Location:c.resource},c=[],g=0;g<d.length;g++){for(var m={},o=d[g].getPropertyKeys(),q=0;q<o.length;q++)m[o[q]]=d[g].getProperty(o[q]);if(m.uriTemplate&&m.nls&&(m.name||m.nameKey)){var u=
new k;h(["i18n!"+m.nls],function(c){var d=new b(m.uriTemplate),d=window.decodeURIComponent(d.expand(a)),d=j.validateURLScheme(d);m.href=d;m.textContent=m.nameKey?c[m.nameKey]:m.name;u.resolve(m)});c.push(u)}else if(m.uriTemplate&&m.name)o=new b(m.uriTemplate),o=window.decodeURIComponent(o.expand(a)),o=j.validateURLScheme(o),m.href=o,m.textContent=m.name,c.push((new k).resolve(m))}return k.all(c)}return{createPageLinks:function(b,e){return g(b,e).then(function(b){return b.map(function(b){var a=b.href,
b=b.textContent,d=document.createElement("a");d.href=a;d.target="_self";d.classList.add("targetSelector");d.textContent=b;return d})})},getPageLinksInfo:g}});
define("orion/widgets/UserMenu",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/PageLinks"],function(h,k,j,b){function g(b){this._init(b)}g.prototype={_init:function(b){this._dropdownNode=j.node(b.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=b.dropdown;this._serviceRegistry=b.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices={}},isSingleService:function(){return this.length(this.unauthenticatedServices)+
this.length(this.authenticatedServices)===1},hasServices:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)>0},length:function(b){var e=0,d;for(d in b)b.hasOwnProperty(d)&&e++;return e},_makeMenuItem:function(b,e){var d=document.createElement("span");d.role="menuitem";d.tabIndex=0;var c=document.createTextNode(b);d.appendChild(c);d.classList.add("dropdownMenuItem");d.addEventListener("click",e,!1);d.addEventListener("keydown",function(a){(a.keyCode===
j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&e()},!1);return d},_renderAuthenticatedService:function(b){var e=this,d=this.authenticatedServices[b].authService;if(d&&d.logout){var c=document.createElement("li"),a=this._makeMenuItem(h["Sign Out"],function(){d.logout().then(function(){e.addUserItem(b,d,e.authenticatedServices[b].label);localStorage.removeItem(b);localStorage.removeItem("lastLogin");for(var a=localStorage.length-1;a>=0;a--){var c=localStorage.key(a);c&&c.indexOf("/orion/preferences/user")===
0&&localStorage.removeItem(c)}d.getAuthForm(window.location.href).then(function(a){window.location=a})})});c.appendChild(a);this._dropdownNode.appendChild(c)}},renderServices:function(){function f(b){d[b]||(d[b]=e.createDocumentFragment());return d[b]}var e=document,d=[];b.getPageLinksInfo(this._serviceRegistry,"orion.page.link.user").then(function(b){this._dropdown.empty();b.forEach(function(a){var b=f(typeof a.category==="number"?a.category:1),c=e.createElement("li"),d=e.createElement("a");d.role=
"menuitem";d.classList.add("dropdownMenuItem");d.href=a.href;d.textContent=a.textContent;c.appendChild(d);b.appendChild(c)});if(this.keyAssistFunction){var b=document.createElement("li"),a=this._makeMenuItem(h["Keyboard Shortcuts"],this.keyAssistFunction);a.classList.add("key-assist-menuitem");b.appendChild(a);f(0).appendChild(b)}var g=this;d.sort(function(a,b){return a-b}).forEach(function(a,b){if(b<d.length-1){var c=document.createElement("li");c.classList.add("dropdownSeparator");var e=document.createElement("span");
e.classList.add("dropdownSeparator");c.appendChild(e);a.appendChild(c)}g._dropdownNode.appendChild(a)});if(this.isSingleService())for(var j in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(j)&&this._renderAuthenticatedService(j,0)}.bind(this))},setKeyAssist:function(b){this.keyAssistFunction=b;this.renderServices()},addUserItem:function(b,e,d,c){c?(this.unauthenticatedServices[b]&&delete this.unauthenticatedServices[b],this.authenticatedServices[b]={authService:e,label:d,data:c}):
(this.authenticatedServices[b]&&delete this.authenticatedServices[b],this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:e,label:d,pending:this.unauthenticatedServices[b].pending}:{authService:e,label:d});this.renderServices()}};g.prototype.constructor=g;return{UserMenu:g}});
define("orion/globalCommands","i18n!orion/nls/messages,require,orion/commonHTMLFragments,orion/commands,orion/parameterCollectors,orion/extensionCommands,orion/uiUtils,orion/editor/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/container/ThemeSheetWriter,orion/searchUtils,orion/inputCompletion/inputCompletion,orion/globalSearch/advSearchOptContainer,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".split(","),function(h,
k,j,b,g,f,e,d,c,a,i,m,o,q,u,l,s,n,y,t,v,w,A,x,p,r,C,D){function z(a,b){if(a.getLabel)return a.getLabel();else{var c=new w;c.resolve(b.properties.name);return c}}function M(b){a.node("progressPane").setAttribute("aria-label",h["Operations - Press spacebar to show current operations"]);(b=b.getService("orion.page.progress"))&&b.init.bind(b)("progressPane")}function G(a,b){var c=a.getService("orion.core.auth");c!==null&&c.getUser().then(function(a){var c;a.Name?c=document.createTextNode(a.Name):a.login&&
(c=document.createTextNode(a.login));c&&(b.childNodes.length>0?b.childNodes[0].nodeType===3?b.replaceChild(c,b.childNodes[0]):b.insertBefore(c,b.childNodes[0]):b.appendChild(c))})}function E(b,c){var d=b.getServiceReferences("orion.core.auth");R=[];if(a.node("userMenu")){var e=a.node("userDropdown"),f=new m.Dropdown({dropdown:e}),g=new A.UserMenu({dropdownNode:e,dropdown:f,serviceRegistry:b}),e=a.node("userTrigger");new o.Tooltip({node:e,text:h.Options,position:["below","left"]});G(b,e);g.setKeyAssist(c);
for(e=0;e<d.length;e++){var f=d[e],i=b.getService(f);z(i,f).then(function(a){i.getKey().then(function(b){R.push(b);i.getUser().then(function(c){g.addUserItem(b,i,a,c)},function(c,d){g.addUserItem(b,i,a,d)});window.addEventListener("storage",function(){N[b]!==localStorage.getItem(b)&&(N[b]=localStorage.getItem(b),i.getUser().then(function(c){g.addUserItem(b,i,a,c)},function(){g.addUserItem(b,i,a)}))},!1)})})}}}function F(b){var c=document.createElement("span");c.id="advancedSearchDropDown";a.node("searchOptions").appendChild(c);
c.tabIndex=0;c.classList.add("advancedSearchDecorationSprite");c.classList.add("core-sprite-openarrow");c.title=h["Advanced search"];c.onclick=function(){b.toggle()};c.addEventListener("keydown",function(a){(a.charCode||a.keyCode)===13&&b.toggle()});c.classList.add("bannerMenuSearchOptions")}function B(b,c){var d=a.node("relatedDropdown");J||(J=new m.Dropdown({dropdown:d}));b._addMenuItem(d,c)}function H(c,d,e,g,h){var i,j=c.getServiceReferences("orion.page.link.related");j.length<=0||a.node("relatedLinks")&&
w.when(function(){if(i)return i;var a=c.getService("orion.core.contenttypes");a||(a=new u.ContentTypeService(c),a=c.getService("orion.core.contenttypes"));return a.getContentTypes().then(function(a){return i=a})}(),function(){var k;a.node("relatedLinks")&&J&&(J.close(),J.empty());for(var l=[],m=0;m<j.length;m++){var p={},n,r=j[m].getPropertyKeys();for(n=0;n<r.length;n++)p[r[n]]=j[m].getProperty(r[n]);if(p.id){var o=function(a){if(a)if(!a.visibleWhen||a.visibleWhen(d)){var c=new b.CommandInvocation(g,
d,d,null,a);B(a,c)}else typeof h==="function"&&(k||(k=h()),w.when(k,function(c){c&&d===S&&(!a.visibleWhen||a.visibleWhen(c))&&B(a,new b.CommandInvocation(g,c,c,null,a))}))},x=null;n=null;if(e.indexOf(p.id)<0)if((p.nls&&p.nameKey||p.name)&&p.uriTemplate)n=f._createCommandOptions(p,j[m],c,i,!0),l.push(n),n.then(function(a){a=new b.Command(a);o(a)});else{if(!x&&(x=g.findCommand(p.id))){o(x);continue}if(!x){var t=c.getServiceReferences("orion.navigate.command");for(n=0;n<t.length;n++)if(t[n].getProperty("id")===
p.id){for(var p={},r=t[n].getPropertyKeys(),C=0;C<r.length;C++)p[r[C]]=t[n].getProperty(r[C]);n=f._createCommandOptions(p,t[n],c,i,!0);l.push(n);n.then(function(a){x=new b.Command(a);o(x)});break}}}}}w.all(l,function(a){return a}).then(function(){var b=a.node("relatedTrigger");if(J&&b)b.style.visibility=J.getItems().length===0?"hidden":"visible"})})}function K(b){var c=a.node("globalActions");c&&(b.destroy(c),b.renderCommands(c.id,c,{},{},"tool"))}function P(a){a.getPreferences("/themes",2).then(function(a){var b=
a.get("selected");if(b&&(b=JSON.parse(b),a=a.get("styles"))){var a=JSON.parse(a),c;for(c in a)if(a[c].name===b.selected){c=a[c];c=(new n.ThemeSheetWriter).getSheet(c);b=document.createElement("STYLE");b.appendChild(document.createTextNode(c));(document.getElementsByTagName("HEAD")[0]||document.documentElement).appendChild(b);break}}})}function L(b){var c={},d=null;typeof b==="string"&&(b=a.node(b));b||(b=a.node("pageActions"));for(var e=b;e&&e.classList;){if(e.classList.contains("toolComposite")){d=
e;break}e=e.parentNode}if(b.classList.contains("commandMarker"))c.commandNode=b;if(d&&(c.slideContainer=a.$(".slideParameters",d),c.parameterArea=a.$(".parameters",d),c.dismissArea=a.$(".parametersDismiss",d),c.notifications=a.$("#notificationArea",d),d.parentNode&&(c.toolbarTarget=a.$(".toolbarTarget",d.parentNode),c.toolbarTarget)))b=a.bounds(d),c.toolbarTargetY=b.height+1;return c}function Q(b){if(b.toolbarTarget&&b.toolbarTargetY){var c=0,d;b.notifications&&b.notifications.classList.contains("slideContainerActive")&&
(d=a.bounds(b.notifications),c+=d.height);b.slideContainer&&b.slideContainer.classList.contains("slideContainerActive")&&(d=a.bounds(b.slideContainer),c+=d.height);c>0&&(c+=8);b.toolbarTarget.style.top=b.toolbarTargetY+c+"px";b.toolbarTarget.style.bottom=0}}var l=function(a){var b=document.createElement("a");b.href=a;return b.href}(k.toUrl("auth/NotifyAuthentication.html")),N={},R=[],J,S,T=[],I,O=null;return{addSettings:function(b){var c=document.getElementById("settingsTab"),d=document.getElementById("settingsAction"),
e=!1,f;c.style.visibility="";d.style.visibility="";d.onclick=function(){if(!e){e=!0;c.style.backgroundColor="#555";c.style.zIndex="99";c.style.borderTopRightRadius="3px";c.style.borderTopLeftRadius="3px";d.className="core-sprite-settings-white";c.id="settingsNode";d.id="settingsButton";var g=document.getElementById("innerPanels"),h=g.getBoundingClientRect(),i=c.getBoundingClientRect();f?f.style.visibility="visible":(f=document.createElement("div"),f.className="settingsPanel",f.style.width="150px",
f.style.height="150px",f.style.backgroundColor="#555",f.style.zIndex="99",f.style.top=i.top-h.top+24-4+"px",f.id="settingsPanel",f.style.borderTopLeftRadius="3px",f.style.borderBottomRightRadius="3px",f.style.borderBottomLeftRadius="3px",g.appendChild(f),a.addAutoDismiss([d,c,f],function(){d.className="core-sprite-settings";c.style.backgroundColor="white";f.style.visibility="hidden";e=!1}));a.empty(f);b.appendTo(f)}}},generateBanner:function(c,f,l,m,n,s,z,A){function u(b){b.registerService("orion.cm.managedservice",
{updated:function(b){for(var b=b&&b["links.newtab"]!=="undefined"?b["links.newtab"]?"_blank":"_self":"_self",c=a.$$array(".targetSelector"),d=0;d<c.length;d++)c[d].target=b}},{pid:"nav.config"})}P(m);m=a.node(c);if(!m)throw h["could not find banner parent, id was "]+c;c=document.createRange();c.selectNode(m);c=c.createContextualFragment(r);a.processTextNodes(c,h);m.firstChild?m.insertBefore(c,m.firstChild):m.appendChild(c);c=a.node("home");c.href=k.toUrl("navigate/table.html");c.setAttribute("aria-label",
h["Orion Home"]);a.node("progressPane").src=k.toUrl("images/none.png");if(c=a.node("pageToolbar"))c.classList.add("toolbarLayout"),c.innerHTML=D+j.slideoutHTMLFragment("mainToolbar");(c=a.node("closeNotifications"))&&c.setAttribute("aria-label",h["Close notification"]);if(c=a.node("footer"))c.innerHTML=C,a.processTextNodes(c,h);l.setParameterCollector(new g.CommandParameterCollector(L,Q));var B=document.createElement("div");B.id="keyAssist";B.style.display="none";B.classList.add("keyAssistFloat");
B.role="list";B.setAttribute("aria-atomic","true");B.setAttribute("aria-live","assertive");document.body.appendChild(B);document.addEventListener("keydown",function(b){if(b.charOrCode===a.KEY.ESCAPE)B.style.display="none"},!1);a.addAutoDismiss([B],function(){B.style.display="none"});var H=a.node("primaryNav");H&&x.createPageLinks(f,"orion.page.link").then(function(a){a.forEach(function(a){H.appendChild(a)})});var G=a.node("search");if(!G)throw"failed to generate HTML for banner";G.setAttribute("placeholder",
h.Search);new o.Tooltip({node:G,text:h["Type a keyword or wild card to search in root"],position:["below","left"]});var N=new v.advSearchOptContainer(G,n,f,{group:"advancedSearch"});new t.InputCompletion(G,function(a){y.getMixedSearches(f,!0,!1,function(b){var c,d=[],e=!1,f=!1;for(c in b)b[c].label&&b[c].value?(e||(d.push({type:"category",label:h["Saved searches"]}),e=!0),d.push({type:"proposal",value:{name:b[c].label,value:k.toUrl("search/search.html")+"#"+b[c].value,type:"link"}})):(f||(d.push({type:"category",
label:h["Recent searches"]}),f=!0),d.push({type:"proposal",label:b[c].name,value:b[c].name}));a(d)})},{group:"globalSearch",extendedProvider:function(a,b){var c=f.getServiceReferences("orion.search.proposal");if(!c||c.length===0)b(null);else{var d=[];c.forEach(function(b){var c=b.getProperty("filterForMe");d.push(f.getService(b).run(a).then(function(a){for(var b={filterForMe:c,proposals:[]},d=0;d<a.length;d++){b.proposals.push({type:"category",label:a[d].category});for(var e=0;e<a[d].datalist.length;e++)b.proposals.push({type:"proposal",
label:a[d].datalist[e],value:a[d].datalist[e]})}return b}))});w.all(d).then(function(a){b(a)})}}});G.addEventListener("keydown",function(a){a.defaultPrevented||(a.charCode||a.keyCode)===13&&y.doSearch(n,f,G.value)});F(N);a.addAutoDismiss([a.node(N.containerId),a.node("advancedSearchDropDown")],function(){N.dismiss()});if(c=a.$(".split")){var m=a.$(".sidePanelLayout"),J=a.$(".mainPanelLayout");if(m&&J)O={side:m,main:J},O.splitter=new i.Splitter({node:c,sidePanel:m,mainPanel:J,toggle:!0}),c=new b.Command({name:h["Toggle side panel"],
tooltip:h["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){O.splitter.toggleSidePanel()}}),l.addCommand(c),l.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new b.CommandKeyBinding("o",!0)),z&&(O.splitter.addResizeListener(function(a){z&&a===J&&z.getTextView().resize()}),z.getTextView().setKeyBinding(new d.KeyBinding("o",!0),"toggleOutliner"),z.getTextView().setAction("toggleOutliner",function(){O.splitter.toggleSidePanel();return!0},{name:h["Toggle Outliner"]}))}c=
new b.Command({name:h["Make Favorite"],tooltip:h["Add to the favorites list"],imageClass:"core-sprite-makeFavorite",id:"orion.makeFavorite",visibleWhen:function(a){a=Array.isArray(a)?a:[a];if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!a[b].Location)return!1;return!0},callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],b=f.getService("orion.core.favorite"),c=f.getService("orion.page.progress"),d=function(a){return function(d){d?f.getService("orion.page.message").setMessage(a.Name+
h[" is already a favorite."],2E3):c.progress(b.makeFavorites(a),"Making favorite "+a.Name)}},e=0;e<a.length;e++){var g=a[e];c.progress(b.hasFavorite(g.ChildrenLocation||g.Location),"Checking favorite "+g.Name).then(d(g))}}});l.addCommand(c);var I=function(a,b,c){var d=b.getService("orion.core.favorite"),e=b.getService("orion.page.progress");d||(d=new q.FavoritesService({serviceRegistry:b}),d=b.getService("orion.core.favorite"));var f=new p.OpenResourceDialog({searcher:a,progress:e,searchRenderer:a.defaultRenderer,
favoriteService:d,onHide:function(){c&&c.getTextView().focus()}});window.setTimeout(function(){f.show()},0)},c=new b.Command({name:h["Find File Named..."],tooltip:h["Choose a file by name and open an editor on it"],id:"eclipse.openResource",callback:function(){I(n,f,z)}});z&&(z.getTextView().setKeyBinding(new d.KeyBinding("f",!0,!0,!1),c.id),z.getTextView().setAction(c.id,function(){I(n,f,z);return!0},c));l.addCommand(c);l.registerCommandContribution("globalActions","eclipse.openResource",100,null,
!0,new b.CommandKeyBinding("f",!0,!0));c=new b.Command({name:h["Global search"],tooltip:h["Global search"],id:"eclipse.globalSearch",callback:function(){var b=a.node("search");b&&b.focus()}});z&&(z.getTextView().setKeyBinding(new d.KeyBinding("h",!0,!1,!0),c.id),z.getTextView().setAction(c.id,function(){var b=z.getSelection(),c=null;b.end>b.start&&(c=z.getModel().getText(b.start,b.end));if(b=a.node("search")){if(c)b.value=c;b.focus()}return!0},c));l.addCommand(c);l.registerCommandContribution("globalActions",
"eclipse.globalSearch",101,null,!0,new b.CommandKeyBinding("h",!0,!1,!0));c=new b.Command({name:h["Toggle banner and footer"],tooltip:h["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var b=a.node("banner"),c=a.node("footer"),d=a.$(".content-fixedHeight");b.style.display==="none"?(b.style.display="block",c.style.display="block",d.classList.remove("content-fixedHeight-maximized")):(b.style.display="none",c.style.display="none",d.classList.add("content-fixedHeight-maximized"));
z&&z.getTextView().resize();return!0}});l.addCommand(c);l.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new b.CommandKeyBinding("m",!0,!0));z&&(z.getTextView().setKeyBinding(new b.CommandKeyBinding("m",!0,!0),c.id),z.getTextView().setAction(c.id,c.callback,c));A&&A.addHandler({isActive:function(){return B.style.display==="block"},cancel:function(){return this.isActive()?(B.style.display="none",!0):!1}});A=new b.Command({name:h["System Configuration Details"],tooltip:h["System Config Tooltip"],
id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});l.addCommand(A);l.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new b.CommandKeyBinding(112,!0,!0));A=new b.Command({name:h["Background Operations"],tooltip:h["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});l.addCommand(A);l.registerCommandContribution("globalActions","orion.backgroundOperations",
100,null,!0,new b.CommandKeyBinding("o",!0,!0));A=new b.Command({name:h["Show Keys"],tooltip:h["Show a list of all the keybindings on this page"],id:"eclipse.keyAssist",callback:function(){if(B.style.display==="none"){var b;a.empty(B);if(z){b=document.createElement("h2");b.appendChild(document.createTextNode(h.Editor));B.appendChild(b);b=z.getTextView().getActions(!1);for(var c=0;c<b.length;c++){var d=b[c],f=d,g=z.getTextView(),i=g.getActionDescription(d);if(i&&i.name)f=i.name;d=g.getKeyBindings(d);
for(g=0;g<d.length;g++){var i=e.getUserKeyString(d[g]),j=document.createElement("span");j.role="listitem";j.appendChild(document.createTextNode(i+" = "+f));j.appendChild(document.createElement("br"));B.appendChild(j)}}}b=document.createElement("h2");b.appendChild(document.createTextNode(h.Global));B.appendChild(b);l.showKeyBindings(B);B.style.display="block"}else B.style.display="none";return!0}});l.addCommand(A);l.registerCommandContribution("globalActions","eclipse.keyAssist",100,null,!0,new b.CommandKeyBinding(191,
!1,!0));z&&(c=window.navigator.platform.indexOf("Mac")!==-1,z.getTextView().setKeyBinding(new b.CommandKeyBinding(191,!1,!0,!c,c),A.id),z.getTextView().setAction(A.id,A.callback,A));K(l);E(f,A.callback);M(f);window.addEventListener("hashchange",function(){l.processURL(window.location.href)},!1);window.setTimeout(function(){u(f)},0)},getToolbarElements:L,getMainSplitter:function(){return O},layoutToolbarElements:Q,setPageTarget:function(b){var d,e,f=b.breadcrumbRootName;b.target?(b.searchService&&
b.searchService.setLocationByMetaData(b.target),b.fileService&&!b.breadcrumbTarget&&(e=f?f+" ":"",e+=b.fileService.fileServiceName(b.target.Location),f=null),d=b.name||b.target.Name,S=b.target,H(b.serviceRegistry,b.target,T,b.commandService,b.makeAlternate)):(b.breadcrumbTarget||(f=f||b.task||b.name),d=b.name);(I=b.title)||(I=d?d+" - "+b.task:b.task);window.document.title=I;a.empty(a.node("location"));new c.BreadCrumbs({container:"location",resource:b.breadcrumbTarget||b.target,rootSegmentName:f,
workspaceRootSegmentName:e,makeHref:b.makeBreadcrumbLink})},setDirtyIndicator:function(b){if(I)I.charAt(0)==="*"&&!b&&(I=I.substring(1)),b&&I.charAt(0)!=="*"&&(I="*"+I),window.document.title=I;var c=a.node("dirty");if(c)c.textContent=b?"*":""},setPageCommandExclusions:function(a){T=a},notifyAuthenticationSite:l}});
define("orion/status",["require","orion/webui/littlelib","orion/globalCommands"],function(h,k,j){function b(b,e,d,c,a){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.message",this);this._operationsClient=e;this.notificationContainerDomId=a;this.domId=d;this.progressDomId=c||d;this._hookedClose=!1}function g(b,e,d,c){this.statusService=b;this.progressId=e;if(d){this.deferred=d;this.begin(c);var a=this;d.then(function(){a.done.bind(a)()},function(){a.done.bind(a)()})}}
b.prototype={_init:function(){var b=k.node("closeNotifications"),e=this;b&&!this._hookedClose&&(b.addEventListener("click",function(){e.setProgressMessage("")},!1),b.addEventListener("keydown",function(b){(b.keyCode===k.KEY.ENTER||b.keyCode===k.KEY.SPACE)&&e.setProgressMessage("")},!1))},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=j.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(b,e,d){this._init();this.currentMessage=
b;var c=k.node(this.domId);if(typeof d==="boolean"){var a=this,g=c.getAttribute("aria-live");c.setAttribute("aria-live",d?"polite":"off");window.setTimeout(function(){b===a.currentMessage&&(k.empty(c),c.appendChild(document.createTextNode(b)),window.setTimeout(function(){c.setAttribute("aria-live",g)},100))},100)}else k.empty(c),c.appendChild(document.createTextNode(b));typeof e==="number"&&(a=this,window.setTimeout(function(){b===a.currentMessage&&(k.empty(c),c.appendChild(document.createTextNode("")))},
e))},setErrorMessage:function(b){this.currentMessage=b;this._init();var e=b.responseText||b.message||b;try{e=JSON.parse(e)}catch(d){}var b=e.Message||e,c="red";if(e.Severity)switch(e.Severity){case "Warning":c="#FFCC00";break;case "Error":c="red";break;case "Info":case "Ok":c="green"}e=document.createElement("span");e.style.color=c;e.appendChild(document.createTextNode(b));b=k.node(this.domId);k.empty(b);b.appendChild(e)},setProgressMessage:function(b){this._init();this.currentMessage=b;var e=document.createElement("span");
e.classList.add("imageSprite");e.classList.add("core-sprite-progress");var d=k.node(this.progressDomId);k.empty(d);d.appendChild(e);d.appendChild(document.createTextNode(b));e=k.node(this.notificationContainerDomId);e.classList.add("progressNormal");if(b&&b.length>0)e.classList.add("slideContainerActive");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();else e.classList.remove("slideContainerActive");j.layoutToolbarElements(this._getNotifierElements())},
setProgressResult:function(b){this.currentMessage=b;var e=b.responseText||b;try{e=JSON.parse(e)}catch(d){}this._init();var c=e.Message||e,a="core-sprite-info",g="progressInfo",h=document.createElement("span");h.classList.add("imageSprite");b=[];if(e.Severity)switch(e.Severity){case "Warning":a="core-sprite-warning";g="progressWarning";b.push("progressInfo");b.push("progressError");b.push("progressNormal");break;case "Error":a="core-sprite-error";g="progressError";b.push("progressWarning");b.push("progressInfo");
b.push("progressNormal");break;default:b.push("progressWarning"),b.push("progressError"),b.push("progressNormal")}h.classList.add(a);var o=k.node(this.progressDomId),a=k.node(this.notificationContainerDomId);k.empty(o);o.appendChild(h);e.HTML?(e=document.createElement("span"),e.innerHTML=c,o.appendChild(e)):o.appendChild(document.createTextNode("   "+c));if(g&&this.progressDomId!==this.domId){a.classList.add(g);for(c=0;c<b.length;c++)a.classList.remove(b[c])}a.classList.add("slideContainerActive");
j.layoutToolbarElements(this._getNotifierElements())},showWhile:function(b,e){var d=this;if(e){d.setProgressMessage(e);var c=function(){e===d.currentMessage&&d.setProgressMessage("")};b.then(c,c)}return b},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(b,e){return new g(this,++this._lastProgressId,b,e)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var b="",e=!0,d;for(d in this._progressMonitors)this._progressMonitors[d].status&&(e||(b+=", "),
b+=this._progressMonitors[d].status,e=!1);this.setProgressMessage(b)}else this.setProgressMessage("")},_beginProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._renderOngoingMonitors()},_doneProgressMonitor:function(b){delete this._progressMonitors[b.progressId];this._progressMonitors.length--;b.status?this.setProgressResult(b.status):this._renderOngoingMonitors()}};
b.prototype.constructor=b;g.prototype.begin=function(b){this.status=b;this.statusService._beginProgressMonitor(this)};g.prototype.done=function(b){this.status=b;this.statusService._doneProgressMonitor(this)};g.prototype.worked=function(b){this.status=b;this.statusService._workedProgressMonitor(this)};g.prototype.constructor=g;return{StatusReportingService:b,ProgressMonitor:g}});
define("orion/editorCommands","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/webui/littlelib,orion/Deferred,orion/URITemplate,orion/commands,orion/globalCommands,orion/extensionCommands,orion/contentTypes,orion/editor/keyBinding,orion/editor/undoStack,orion/searchUtils,orion/PageUtil".split(","),function(h,k,j,b,g,f,e,d,c,a,i,m,o){var e={},q=null;e.EditorCommandFactory=function(){function e(a,b,c,d,f,g,h,i){this.serviceRegistry=a;this.commandService=b;this.fileClient=c;this.inputManager=d;this.toolbarId=
f;this.pageNavId=h;this.isReadOnly=g;this._searcher=i}e.prototype={generateEditorCommands:function(e){function i(a){if(q)return q;var b=a.getService("orion.core.contenttypes");b||(b=new c.ContentTypeService(a),b=a.getService("orion.core.contenttypes"));return b.getContentTypes().then(function(a){return q=a})}function n(b){var c=new a.KeyBinding;a.KeyBinding.apply(c,b);return c}function y(a){var b={Severity:"Error"};a.status===0?b.Message=h["No response from server.  Check your internet connection and try again."]:
b=a;(a=serviceRegistry.getService("orion.page.message"))?a.setProgressResult(b):window.console.log(b)}if(!this.isReadOnly){e.getTextView().setKeyBinding(new a.KeyBinding("s",!0),"save");var t=this;this.inputManager.onSave?e.getTextView().setAction("save",function(){var a=e.getText();t.inputManager.onSave(t.inputManager.getInput(),a,function(){e.setInput(t.inputManager.getInput(),null,a,!0);t.inputManager.afterSave&&t.inputManager.afterSave()},function(a){a.log=!0});return!0},{name:h.Save}):e.getTextView().setAction("save",
function(){var a=e.getText(),b={ETag:t.inputManager.getFileMetadata().ETag},b=t.fileClient.write(t.inputManager.getInput(),a,b),c=t.serviceRegistry.getService("orion.page.progress");c&&c.progress(b,k.formatMessage(h["Saving file {0}"],t.inputManager.getInput()));b.then(function(b){t.inputManager.getFileMetadata().ETag=b.ETag;e.setInput(t.inputManager.getInput(),null,a,!0);t.inputManager.afterSave&&t.inputManager.afterSave()},function(b){b.status===412?confirm(h["Resource is out of sync with the server. Do you want to save it anyway?"])&&
(b=t.fileClient.write(t.inputManager.getInput(),a),c&&c.progress(b,k.formatMessage(h["Saving file {0}"],t.inputManager.getInput())),b.then(function(b){t.inputManager.getFileMetadata().ETag=b.ETag;e.setInput(t.inputManager.getInput(),null,a,!0);t.inputManager.afterSave&&t.inputManager.afterSave()},y)):y(b)});return!0},{name:h.Save});this.commandService.addCommand(new f.Command({name:h.Save,tooltip:h["Save this file"],id:"orion.save",callback:function(){e.getTextView().invokeAction("save")}}));this.commandService.registerCommandContribution(this.toolbarId,
"orion.save",1,null,!1,new f.CommandKeyBinding("s",!0));var v=new f.ParametersDescription([new f.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var a=e.getModel().getLineAtOffset(e.getCaretOffset())+1;return[new f.CommandParameter("line","number","Line:",a.toString())]}),v=new f.Command({name:h["Go to Line"],tooltip:h["Go to specified line number"],id:"orion.gotoLine",parameters:v,callback:function(a){var b=e.getModel();a.parameters&&a.parameters.valueFor("line")?
a=a.parameters.valueFor("line"):(a=b.getLineAtOffset(e.getCaretOffset()),(a=prompt(h["Go to line:"],a+1))&&(a=parseInt(a,10)));if(a)e.onGotoLine(a-1,0)}});this.commandService.addCommand(v);this.commandService.registerCommandContribution(this.pageNavId,"orion.gotoLine",1,null,!0,new f.CommandKeyBinding("l",!0),new f.URLBinding("gotoLine","line"));e.getTextView().setKeyBinding(new a.KeyBinding("l",!0),"gotoLine");e.getTextView().setAction("gotoLine",function(){t.commandService.runCommand("orion.gotoLine");
return!0},v);var v=new f.ParametersDescription([new f.CommandParameter("find","text","Find:")],{clientCollect:!0},function(){var a=e.getSelection(),b="";a.end>a.start&&(b=e.getModel().getText(a.start,a.end));return[new f.CommandParameter("find","text","Find:",b)]}),w=this,v=new f.Command({name:h.Find,tooltip:h.Find,id:"orion.editor.find",parameters:v,callback:function(a){if(w._searcher){var b="",c=null,d=e.getSelection();d.end>d.start?b=e.getModel().getText(d.start,d.end):a.parameters&&a.parameters.valueFor("find")&&
(b=a.parameters.valueFor("find"),c=o.matchResourceParameters(),m.convertFindURLBinding(c));c?(w._searcher.setOptions({useRegExp:c.regEx,ignoreCase:!c.caseSensitive}),c.atLine?(a=e.getModel().getLineStart(c.atLine-1),e.moveSelection(a,a,function(){w._searcher.buildToolBar(b,c.replaceWith);w._searcher.findNext(!0)},focus)):(w._searcher.buildToolBar(b,c.replaceWith),w._searcher.findNext(!0))):w._searcher.buildToolBar(b);return!0}return!1}});this.commandService.addCommand(v);this.commandService.registerCommandContribution(this.pageNavId,
"orion.editor.find",2,null,!0,new f.CommandKeyBinding("f",!0),new f.URLBinding("find","find"));e.getTextView().setKeyBinding(new a.KeyBinding("f",!0),"find");e.getTextView().setAction("find",function(){t.commandService.runCommand("orion.editor.find");return!0},v);var A=this.serviceRegistry.getServiceReferences("orion.edit.command"),x=this.inputManager,p=this.serviceRegistry.getService("orion.page.progress"),r=function(a,b,c){c.callback=function(){e=this;var c=e.getSelection(),d=e.getModel(),f=d.getText(),
i=function(a){a&&a.text?(e.setText(a.text),a.selection&&(e.setSelection(a.selection.start,a.selection.end),e.getTextView().focus())):typeof a==="string"&&(e.setText(a,c.start,c.end),e.setSelection(c.start,c.start+a.length),e.getTextView().focus())};p.progress(b.run(d.getText(c.start,c.end),f,c,x.getInput()),k.formatMessage(h["Running {0}"],a.name)).then(function(b){if(b&&b.uriTemplate){var c=(new g(b.uriTemplate)).expand(x.getFileMetadata()),d=document.createElement("iframe");d.id=a.id;d.name=a.id;
d.type="text/html";d.sandbox="allow-scripts allow-same-origin";d.frameborder=1;d.src=c;d.className="delegatedUI";if(b.width)d.style.width=b.width;if(b.height)d.style.height=b.height;window.document.body.appendChild(d);window.addEventListener("message",function L(b){b.source===d.contentWindow&&typeof b.data==="string"&&(b=JSON.parse(b.data),b.pageService==="orion.page.delegatedUI"&&b.source===a.id&&(b.cancelled||b.result&&i(b.result),window.removeEventListener("message",L,!1),window.document.body.removeChild(d)))},
!1)}else i(b)});return!0};c.callback=c.callback.bind(e);return new f.Command(c)};b.when(i(this.serviceRegistry),function(){var a=[],c=100;A.forEach(function(b){for(var f=t.serviceRegistry.getService(b),g={},h=b.getPropertyKeys(),i=0;i<h.length;i++)g[h[i]]=b.getProperty(h[i]);g.forceSingleItem=!0;b=d._createCommandOptions(g,b,t.serviceRegistry,q,!1,function(){return x.getFileMetadata()});a.push(b);b.then(function(a){a=r(g,f,a);t.commandService.addCommand(a);t.commandService.registerCommandContribution(t.toolbarId,
a.id,c);if(g.key){var b=e.getTextView();b.setKeyBinding(n(g.key),a.id);b.setAction(a.id,a.callback,a)}});c++});b.all(a,function(a){return{_error:a}}).then(function(){if(x.getFileMetadata()){var a=j.node("pageActions");a&&(t.commandService.destroy(a),t.commandService.renderCommands(a.id,a,e,e,"button"));if(a=j.node("pageNavigationActions"))t.commandService.destroy(a),t.commandService.renderCommands(a.id,a,e,e,"button")}})})}}};return e}();e.UndoCommandFactory=function(){function a(b,c,d){this.serviceRegistry=
b;this.commandService=c;this.toolbarId=d}a.prototype={createUndoStack:function(a){var b=new i.UndoStack(a.getTextView(),200),c=new f.Command({name:h.Undo,id:"orion.undo",callback:function(){this.getTextView().invokeAction("undo")}});a.getTextView().setAction("undo",function(){b.undo();return!0},c);this.commandService.addCommand(c);c=new f.Command({name:h.Redo,id:"orion.redo",callback:function(){this.getTextView().invokeAction("redo")}});a.getTextView().setAction("redo",function(){b.redo();return!0},
c);this.commandService.addCommand(c);this.commandService.registerCommandContribution(this.toolbarId,"orion.undo",400,null,!0,a.getTextView().getKeyBindings("undo")[0]);this.commandService.registerCommandContribution(this.toolbarId,"orion.redo",401,null,!0,a.getTextView().getKeyBindings("redo")[0]);return b}};return a}();return e});
define("orion/compare/compare-container","i18n!orion/compare/nls/messages,require,orion/Deferred,orion/webui/littlelib,orion/compare/diff-parser,orion/compare/compare-rulers,orion/editor/contentAssist,orion/editorCommands,orion/editor/editor,orion/editor/editorFeatures,orion/globalCommands,orion/commands,orion/editor/textModel,orion/editor/textView,orion/compare/compare-features,orion/compare/compareUtils,orion/compare/diff-provider,orion/compare/jsdiffAdapter,orion/highlight,orion/compare/diffTreeNavigator,orion/searchAndReplace/textSearcher,orion/fileClient".split(","),function(h,
k,j,b,g,f,e,d,c,a,i,m,o,q,u,l,s,n,y,t,v,w){var A={};A.DefaultDiffProvider=function(){function a(b){this.serviceRegistry=b;this._diffProvider=new s.DiffProvider(b)}a.prototype={_resolveTwoFiles:function(a,b,c){var d=this;j.all([d._getContentType(a),d._getContentType(b)],function(a){return{_error:a}}).then(function(e){if(Array.isArray(e)&&e.length===2&&e[0]&&e[1]){e[0]._error&&c&&c(e[0]._error);e[1]._error&&c&&c(e[1]._error);var f=e[0],e=e[1];d.callBack({baseFile:{URL:a,Name:d._resolveFileName(a),Type:f},
newFile:{URL:b,Name:d._resolveFileName(b),Type:e},diff:d._diffContent})}else f=a?d._resolveFileName(a):"",e=b?d._resolveFileName(b):"",d.callBack({baseFile:{URL:a,Name:f,Type:null},newFile:{URL:b,Name:e,Type:null},diff:d._diffContent})})},_resolveDiff:function(a,b,c,d){if(b)this._resolveTwoFiles(b,a,d);else if(this._diffProvider){var e=this;e._diffProvider.getDiffContent(a).then(function(b){e._diffContent=e._hasConflicts?b.split("diff --git")[1]:b;c?e.callBack({diff:e._diffContent}):e._resolveComplexFileURL(a)},
d)}else console.log("A diff provider is needed for compound diff URL")},_resolveFileName:function(a){return a.split("?")[0]},_getContentType:function(a){a=this._resolveFileName(a);return this.serviceRegistry.getService("orion.core.contenttypes").getFilenameContentType(a)},_resolveComplexFileURL:function(a,b){var c=this;this._diffProvider.getDiffFileURI(a).then(function(a){c._resolveTwoFiles(a.Old,a.New,b)},b)},provide:function(a,b,c,d,e,f){this.callBack=e;this._hasConflicts=d;this._resolveDiff(a,
b,c,f)}};return a}();A.CompareStyler=function(){function a(b){this._syntaxHighlither=new y.SyntaxHighlighter(b)}a.prototype={highlight:function(a,b,c,d,e){this._syntaxHighlither.setup(b,c.getTextView(),null,a,!1).then(function(){d&&e&&(c.setAnnotationRulerVisible(!1),d._highlighterLoaded++,d._highlighterLoaded===e&&(d._diffNavigator.renderAnnotations(),d._diffNavigator.gotoBlock(d.options.blockNumber-1,d.options.changeNumber-1)))})}};return a}();A.CompareContainer=function(){function a(){this._diffParser=
new g.DiffParser}a.prototype={_clearOptions:function(){this.options={};this.options.baseFile={URL:"",Name:"",Type:""};this.options.newFile={URL:"",Name:"",Type:""};this.options.blockNumber=1;this.options.changeNumber=0},setOptions:function(a,b){b&&this._clearOptions();if(a)this.options.mapper=a.mapper?a.mapper:this.options.mapper,this.options.commandSpanId=typeof a.commandSpanId==="string"?a.commandSpanId:this.options.commandSpanId,this.options.generateLink=a.generateLink!==void 0&&a.generateLink!==
null?a.generateLink:this.options.generateLink,this.options.editableInComparePage=a.editableInComparePage!==void 0&&a.editableInComparePage!==null?a.editableInComparePage:this.options.editableInComparePage,this.options.gridRenderer=a.gridRenderer||this.options.gridRenderer,this.options.readonly=a.readonly!==void 0&&a.readonly!==null?a.readonly:this.options.readonly,this.options.onPage=a.onPage!==void 0&&a.onPage!==null?a.onPage:this.options.onPage,this.options.wordLevelNav=a.wordLevelNav!==void 0&&
a.wordLevelNav!==null?a.wordLevelNav:this.options.wordLevelNav,this.options.charDiff=a.charDiff!==void 0&&a.charDiff!==null?a.charDiff:this.options.charDiff,this.options.hasConflicts=a.hasConflicts!==void 0&&a.hasConflicts!==null?a.hasConflicts:this.options.hasConflicts,this.options.diffProvider=a.diffProvider?a.diffProvider:this.options.diffProvider,this.options.resource=a.resource?a.resource:this.options.resource,this.options.compareTo=a.compareTo?a.compareTo:this.options.compareTo,this.options.baseFile.URL=
a.baseFile&&a.baseFile.URL?a.baseFile.URL:this.options.baseFile.URL,this.options.baseFile.Name=a.baseFile&&typeof a.baseFile.Name==="string"?a.baseFile.Name:this.options.baseFile.Name,this.options.baseFile.Type=a.baseFile&&a.baseFile.Type?a.baseFile.Type:this.options.baseFile.Type,this.options.baseFile.Content=a.baseFile&&typeof a.baseFile.Content==="string"?a.baseFile.Content:this.options.baseFile.Content,this.options.newFile.URL=a.newFile&&a.newFile.URL?a.newFile.URL:this.options.newFile.URL,this.options.newFile.Name=
a.newFile&&typeof a.newFile.Name==="string"?a.newFile.Name:this.options.newFile.Name,this.options.newFile.Type=a.newFile&&a.newFile.Type?a.newFile.Type:this.options.newFile.Type,this.options.newFile.Content=a.newFile&&typeof a.newFile.Content==="string"?a.newFile.Content:this.options.newFile.Content,this.options.diffURL=a.diffURL?a.diffURL:this.options.diffURL,this.options.diffContent=a.diffContent?a.diffContent:this.options.diffContent,this.options.diffArray=a.diffArray?a.diffArray:this.options.diffArray,
this.options.blockNumber=a.blockNumber?a.blockNumber:this.options.blockNumber,this.options.changeNumber=a.changeNumber?a.changeNumber:this.options.changeNumber,this.options.onSave=a.onSave?a.onSave:this.options.onSave,this.options.callback=a.callback?a.callback:this.options.callback,this._errorCallback=a.errorCallback?a.errorCallback:this._errorCallback,this.options.onSetTitle=a.onSetTitle?a.onSetTitle:this.options.onSetTitle,this.options.toggler=a.toggler?a.toggler:this.options.toggler},initCommands:function(){var a=
this.getCommandSpanId();if(a){var b=new m.Command({name:h["Copy current change from right to left"],tooltip:h["Copy current change from right to left"],imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",callback:function(a){a.items.copyToLeft()}}),c=new m.Command({tooltip:h["Switch to unified diff"],name:h.Unified,id:"orion.compare.toggle2Inline",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&a.options.toggler.widgetType===
"twoWay"},callback:function(a){a.items.options.toggler.toggle()}}),d=new m.Command({tooltip:h["Switch to side by side diff"],name:h["Side by side"],id:"orion.compare.toggle2TwoWay",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&a.options.toggler.widgetType==="inline"},callback:function(a){a.items.options.toggler.toggle()}}),e=new m.Command({tooltip:h["Generate link of the current diff"],name:h["Generate Link"],id:"orion.compare.generateLink",groupId:"orion.compareGroup",
visibleWhen:function(a){return a.options.resource&&a.options.generateLink},callback:function(a){a.items.generateLink()}}),f=new m.Command({tooltip:h["Open the compare page"],name:h.Compare,id:"orion.compare.openComparePage",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.resource&&!a.options.generateLink},hrefCallback:function(a){return a.items.openComparePage()}}),g=new m.Command({name:h["Next diff block"],tooltip:h["Next diff block"],imageClass:"core-sprite-move_down",id:"orion.compare.nextDiff",
groupId:"orion.compareGroup",callback:function(a){a.items.nextDiff()}}),i=new m.Command({name:h["Previous diff block"],tooltip:h["Previous diff block"],imageClass:"core-sprite-move_up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",callback:function(a){a.items.prevDiff()}}),j=new m.Command({name:h["Next diff change"],tooltip:h["Next diff change"],imageClass:"core-sprite-move_down",id:"orion.compare.nextChange",groupId:"orion.compareGroup",callback:function(a){a.items.nextChange()}}),k=new m.Command({name:h["Previous diff change"],
tooltip:h["Previous diff change"],imageClass:"core-sprite-move_up",id:"orion.compare.prevChange",groupId:"orion.compareGroup",callback:function(a){a.items.prevChange(a)}});this._commandService.addCommand(b);this._commandService.addCommand(d);this._commandService.addCommand(c);this._commandService.addCommand(e);this._commandService.addCommand(f);this._commandService.addCommand(g);this._commandService.addCommand(i);this._commandService.addCommand(j);this._commandService.addCommand(k);this._commandService.registerCommandContribution(a,
"orion.compare.openComparePage",107);this._commandService.registerCommandContribution(a,"orion.compare.generateLink",108,null,!1,new m.CommandKeyBinding("l",!0,!0));this.options.readonly||this._commandService.registerCommandContribution(a,"orion.compare.copyToLeft",109,null,!1,new m.CommandKeyBinding(37,!0,!1,!0));this._commandService.registerCommandContribution(a,"orion.compare.toggle2Inline",110);this._commandService.registerCommandContribution(a,"orion.compare.toggle2TwoWay",111);this._commandService.registerCommandContribution(a,
"orion.compare.nextDiff",112,null,!1,new m.CommandKeyBinding(40,!0));this._commandService.registerCommandContribution(a,"orion.compare.prevDiff",113,null,!1,new m.CommandKeyBinding(38,!0));this.options.wordLevelNav?(this._commandService.registerCommandContribution(a,"orion.compare.nextChange",114,null,!1,new m.CommandKeyBinding(40,!0,!0)),this._commandService.registerCommandContribution(a,"orion.compare.prevChange",115,null,!1,new m.CommandKeyBinding(38,!0,!0))):(this._commandService.registerCommandContribution(a,
"orion.compare.nextChange",114,null,!0,new m.CommandKeyBinding(40,!0,!0)),this._commandService.registerCommandContribution(a,"orion.compare.prevChange",115,null,!0,new m.CommandKeyBinding(38,!0,!0)))}},getCommandSpanId:function(){var a=this.options.commandSpanId;!a&&this.getDefaultCommandSpanId&&(a=this.getDefaultCommandSpanId());return a},renderCommands:function(){var a=this.getCommandSpanId();a&&(b.empty(b.node(a)),this.options.gridRenderer&&this.options.gridRenderer.navGridHolder?(this.options.gridRenderer.navGridHolder.splice(0,
this.options.gridRenderer.navGridHolder.length),this.options.gridRenderer.additionalCmdRender?this.options.gridRenderer.before?(this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder),this._commandService.renderCommands(a,a,this,this,"tool",null,this.options.gridRenderer.navGridHolder)):(this._commandService.renderCommands(a,a,this,this,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):
this._commandService.renderCommands(a,a,this,this,"tool",null,this.options.gridRenderer.navGridHolder)):this._commandService.renderCommands(a,a,this,this,"tool",null))},generateLink:function(){var a=this.getCurrentDiffPos(),a=l.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:this.options.readonly,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0});prompt(h["Copy the link URL:"],a)},openComparePage:function(){var a=this.getCurrentDiffPos();
return l.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:!this.options.editableInComparePage,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0})},getCurrentDiffPos:function(){return this._diffNavigator.getCurrentPosition()},nextDiff:function(){this._diffNavigator.nextDiff()},prevDiff:function(){this._diffNavigator.prevDiff()},nextChange:function(){this._diffNavigator.nextChange()},prevChange:function(){this._diffNavigator.prevChange()},
clearContent:function(){if(this.options.baseFile)this.options.baseFile.Content=null;if(this.options.newFile)this.options.newFile.Content=null},_getLineDelim:function(){return"\n"},resolveDiffByProvider:function(a){if(this.options.diffProvider){var b=this;b.options.diffProvider.provide(b.options.resource,b.options.compareTo,a,b.options.hasConflicts,function(c){b.options.baseFile.URL=c.baseFile&&typeof c.baseFile.URL==="string"?c.baseFile.URL:b.options.baseFile.URL;b.options.baseFile.Name=c.baseFile&&
typeof c.baseFile.Name==="string"?c.baseFile.Name:b.options.baseFile.Name;b.options.baseFile.Type=c.baseFile&&typeof c.baseFile.Type==="object"?c.baseFile.Type:b.options.baseFile.Type;b.options.baseFile.Content=c.baseFile&&typeof c.baseFile.Content==="string"?c.baseFile.Content:b.options.baseFile.Content;b.options.newFile.URL=c.newFile&&typeof c.newFile.URL==="string"?c.newFile.URL:b.options.newFile.URL;b.options.newFile.Name=c.newFile&&typeof c.newFile.Name==="string"?c.newFile.Name:b.options.newFile.Name;
b.options.newFile.Type=c.newFile&&typeof c.newFile.Type==="object"?c.newFile.Type:b.options.newFile.Type;b.options.newFile.Content=c.newFile&&typeof c.newFile.Content==="string"?c.newFile.Content:b.options.newFile.Content;b.options.diffContent=typeof c.diff==="string"?c.diff:b.options.diffContent;a||typeof b.options.baseFile.Content==="string"?b.setEditor(a):(b.options.callback&&b.options.callback(b.options.baseFile.Name,b.options.newFile.Name),b.getFilesContents(b.options.diffContent?[b.options.baseFile]:
[b.options.baseFile,b.options.newFile]).then(function(){var a=this.setEditor();this._onLoadContents&&this._onLoadContents(a)}.bind(b)))},b.options.errorCallback)}else console.log("A diff provider is needed for Complex diff URL")},resolveDiffByContents:function(a){if(typeof this.options.baseFile.Content==="string"&&typeof this.options.newFile.Content==="string"){if(!this.options.diffContent&&!this._mapper)this.options.diffContent="";this._onLoadContents&&this._onLoadContents();this.setEditor(a);return!0}else return!1},
getFilesContents:function(a){var b=[];a.forEach(function(a){b.push(this._loadSingleFile(a))}.bind(this));return j.all(b,function(a){return{_error:a}})},_loadSingleFile:function(a){return this._registry.getService("orion.page.progress").progress(this._fileClient.read(a.URL),"Getting contents of "+a.URL).then(function(b){a.Content=b;return a}.bind(this),function(b,c){b.status===404?a.Content="":this.errorCallback&&this.errorCallback(b,c);return a}.bind(this))},parseMapper: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(b){a=(new n.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}}},startup:function(a,b){this._onLoadContents=b;this.options.resource?this.resolveDiffByProvider(a):this.resolveDiffByContents(a)}};return a}();A.TwoWayCompareContainer=function(){function e(a,c,d,g){this._diffNavigator=new t.DiffTreeNavigator("word");this._registry=a;this._commandService=this._registry.getService("orion.page.command");
this._fileClient=new w.FileClient(a);this._searchService=this._registry.getService("orion.core.search");this._progress=this._registry.getService("orion.page.progress");this._uiFactory=d;if(!this._uiFactory)this._uiFactory=new u.TwoWayCompareUIFactory({parentDivID:c,showTitle:!1,showLineStatus:!1}),this._uiFactory.buildUI();this._viewLoadedCounter=0;this.setOptions(g,!0);var j=this,k=this._uiFactory.getTitleDiv(!0);k&&b.empty(k);var l=this._uiFactory.getTitleDiv(!1);l&&b.empty(l);if(!this.options.callback)this.options.callback=
function(a,b){k&&l&&(k.appendChild(document.createTextNode(b)),l.appendChild(document.createTextNode(a)))};if(!this._errorCallback)this._errorCallback=function(a,b){if(k&&l){var c=typeof a.message==="string"?a.message:b.xhr.statusText;k.appendChild(document.createTextNode(c));l.appendChild(document.createTextNode(c));k.style.color="red";l.style.color="red"}};this._leftEditorDiv=this._uiFactory.getEditorParentDiv(!0);this._rightEditorDiv=this._uiFactory.getEditorParentDiv(!1);this.initCommands();this._inputManager=
{filePath:"",getInput:function(){return this.filePath},setDirty:function(a){i.setDirtyIndicator(a)},getFileMetadata:function(){return this._fileMetadata},setInput:function(a){if(this.onSetTitle)this.onSetTitle(a,function(a){this.setTitle(a)}.bind(this),function(b){console.error("Error loading file metadata: "+b.message);this.setTitle(a)}.bind(this));else j._progress.progress(j._fileClient.read(a,!0),"Getting file metadata "+a).then(function(a){this._fileMetadata=a;this.setTitle(a.Location,a)}.bind(this),
function(b){console.error("Error loading file metadata: "+b.message);this.setTitle(a)}.bind(this));this.lastFilePath=a},setTitle:function(b,c){var d;if(c)d=c.Name;i.setPageTarget({task:h.Compare,name:d,target:c,serviceRegistry:a,commandService:this._commandService,searchService:this._searchService,fileService:this._fileClient});b.charAt(0)==="*"?(i.setDirtyIndicator(!0),b.substring(1)):i.setDirtyIndicator(!1)},afterSave:function(){j.startup(!0)}};if(this.options.onSave)this._inputManager.onSave=this.options.onSave;
if(this.options.onSetTitle)this._inputManager.onSetTitle=this.options.onSetTitle;this._curveRuler=new f.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv());this._highlighter=[];this._highlighter.push(new A.CompareStyler(this._registry));this._highlighter.push(new A.CompareStyler(this._registry));this.initEditorContainers("\n",h["fetching..."],h["fetching..."],[])}e.prototype=new A.CompareContainer;e.prototype.initEditorContainers=function(a,c,d,e,g){this._leftEditor=this.createEditorContainer(c,
a,e,0,this._leftEditorDiv,this._uiFactory.getStatusDiv(!0),this.options.readonly,g,this.options.newFile);if(this.options.onPage&&(c=b.node("pageActions")))this._commandService.destroy(c),this._commandService.renderCommands(c.id,c,this._leftEditor,this._leftEditor,"button");this._leftTextView=this._leftEditor.getTextView();this._rightEditor=this.createEditorContainer(d,a,e,1,this._rightEditorDiv,this._uiFactory.getStatusDiv(!1),!0,g,this.options.baseFile);this._rightTextView=this._rightEditor.getTextView();
var i=this;this._overviewRuler=new f.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a){i._diffNavigator.matchPositionFromOverview(a)});window.onbeforeunload=function(){if(i._leftEditor.isDirty())return h["There are unsaved changes."]}};e.prototype.getDefaultCommandSpanId=function(){return this._uiFactory.getCommandSpanId()};e.prototype.gotoDiff=function(a,b,c){c=c?this._leftTextView:this._rightTextView;this._diffNavigator.gotoDiff(c.getModel().getLineStart(a)+b,c)};e.prototype.gotoMatch=
function(a,b,c,d,e,f){if(!this.onScroll)this.onScroll=e;if(!this.onLoad)this.onLoad=f;a=this._leftTextView.getModel().getLineStart(a)+c.startIndex;this._leftEditor.moveSelection(a,a)};e.prototype.copyToLeft=function(){this._curveRuler.copyToLeft()};e.prototype.resizeEditors=function(){this._leftTextView&&this._leftTextView.resize();this._rightTextView&&this._rightTextView.resize()};e.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};e.prototype.createEditorContainer=function(b,
e,f,g,i,j,k,l,m){var n=this,t=new o.TextModel(b,e),x="",b=k?new a.UndoFactory:new d.UndoCommandFactory(n._registry,n._commandService,"pageActions"),e=new a.AnnotationFactory,s=new c.Editor({textViewFactory:function(){var a=new q.TextView({parent:i,model:t,readonly:k,tabSize:4});n._viewLoadedCounter++;n._viewLoadedCounter===2&&n._diffNavigator.matchPositionFromOverview(-1);if(n.onLoad)n.onLoad();var b=n.getSplitter();if(b){var c=g===0;b.addResizeListener(function(b){if(b){var d=!1;(d=n._uiFactory.isLeftPane(b)?
c:!c)&&a.resize()}})}return a},undoStackFactory:b,annotationFactory:e,keyBindingFactory:function(b,c,e,f){if(k)n._commandService.addCommandGroup("pageActions","orion.editorActions.unlabeled",200);else{var g=new v.TextSearcher(b,n._commandService,e);(new d.EditorCommandFactory(n._registry,n._commandService,n._fileClient,n._inputManager,"pageActions",k,"pageNavigationActions",g)).generateEditorCommands(b);g=new a.TextActions(b,e);c.push(g);b=new a.SourceCodeActions(b,e,f);c.push(b)}},statusReporter:function(a,
b){if(j)x=b?h["ERROR: "]+a:a,j.textContent=""+x},domNode:i});s.installTextView();s.setOverviewRulerVisible(!1);if(!k){var w=this._inputManager;s.addEventListener("DirtyChanged",function(){w.setDirty(s.isDirty())})}var y=s.getTextView();l&&m&&typeof m.Name==="string"&&typeof m.Type==="string"&&(s.setInput(m.Name),this._highlighter[g].highlight(m.Name,m.Type,s));y.addEventListener("Selection",function(a){!(a.newValue&&a.newValue.start!==a.newValue.end)&&!n._diffNavigator.autoSelecting&&n._diffNavigator.editorWrapper[0].diffFeeder&&
(a=y.getCaretOffset(),n._diffNavigator.gotoDiff(a,y))});g===0?(y.getModel().addEventListener("Changed",function(a){n._curveRuler.onChanged(a)}),y.addEventListener("Scroll",function(){n._curveRuler&&(n._curveRuler.matchPositionFrom(!0),n._curveRuler.render());if(n.onScroll)n.onScroll()})):y.addEventListener("Scroll",function(){n._curveRuler&&n._curveRuler.render()});return s};e.prototype.destroy=function(){this._leftTextView&&(this._diffNavigator.destroy(),this._leftEditor.destroy(),this._rightEditor.destroy(),
this._uiFactory.destroy())};e.prototype.addRulers=function(){if(this._rightTextView&&this._leftTextView&&!this._hasRuler)this._leftTextViewRuler=new f.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),this._rightTextViewRuler=new f.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),this._leftTextView.addRuler(this._leftTextViewRuler),
this._rightTextView.addRuler(this._rightTextViewRuler),this._rightTextView.addRuler(this._overviewRuler),this._hasRuler=!0};e.prototype.setEditor=function(a){var b=this.options.baseFile.Content,c=this.options.newFile.Content,d=this.options.diffContent;c?d=this.parseMapper(b,c,d,this.options.hasConflicts,!0):(d=this.parseMapper(b,c,d,this.options.hasConflicts,a),c=d.output);this._highlighterLoaded=0;if(this._leftEditor)if(a)this._diffNavigator.initMapper(d.mapper),this._curveRuler.init(d.mapper,this._leftEditor,
this._rightEditor,this._diffNavigator),this.renderCommands(),this._leftTextView.redrawRange(),this._rightTextView.redrawRange();else{var a=new t.TwoWayDiffBlockFeeder(this._rightTextView.getModel(),d.mapper,1),e=new t.TwoWayDiffBlockFeeder(this._leftTextView.getModel(),d.mapper,0);this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._rightEditor,this._leftEditor,a,e,this._overviewRuler,this._curveRuler);this._curveRuler.init(d.mapper,this._leftEditor,this._rightEditor,this._diffNavigator);
this._inputManager.filePath=this.options.newFile.URL;this._rightEditor.setInput(this.options.baseFile.Name,null,b);this._leftEditor.setInput(this.options.newFile.Name,null,c);this._highlighter[0].highlight(this.options.newFile.Name,this.options.newFile.Type,this._leftEditor,this,2);this._highlighter[1].highlight(this.options.baseFile.Name,this.options.baseFile.Type,this._rightEditor,this,2);this.renderCommands();this.addRulers();this.options.readonly||this._inputManager.setInput(this.options.newFile.URL,
this._leftEditor)}else this.initEditorContainers(d.delim,c,b,d.mapper,!0);this._viewLoadedCounter>1&&this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);b=this._leftTextView.getModel().getLineCount()*this._leftTextView.getLineHeight()+5;c=this._rightTextView.getModel().getLineCount()*this._rightTextView.getLineHeight()+5;return b>c?b:c};return e}();A.InlineCompareContainer=function(){function d(a,c,e){this._diffNavigator=new t.DiffTreeNavigator("word");this._registry=
a;this._commandService=this._registry.getService("orion.page.command");this._fileClient=new w.FileClient(a);this._statusService=this._registry.getService("orion.page.message");this._progress=this._registry.getService("orion.page.progress");this.setOptions(e,!0);this.setOptions({readonly:!0});var f=this;if(!this.options.callback)this.options.callback=function(){var a=b.node("fileNameInViewer");if(a)b.empty(a),a.appendChild(document.createTextNode(f._diffTitle)),a.style.color="#6d6d6d";f._statusService.setProgressMessage("")};
if(!this._errorCallback)this._errorCallback=function(a,b){var c=[];c.Severity="Error";c.HTML=!1;try{var d=JSON.parse(a.responseText);c.Message=d.DetailedMessage?d.DetailedMessage:d.Message}catch(e){c.Message=typeof a.message==="string"?a.message:b.xhr.statusText}this._statusService.setProgressResult(c)};this.initCommands();this._highlighter=[];this._highlighter.push(new A.CompareStyler(this._registry));this._editorDivId=c;this.initEditorContainers("","\n",[],[]);this.hasContent=!1}d.prototype=new A.CompareContainer;
d.prototype.addRulers=function(){if(this._textView&&!this._hasRuler)this._textView.addRuler(this._rulerOrigin),this._textView.addRuler(this._rulerNew),this._textView.addRuler(this._overviewRuler),this._hasRuler=!0};d.prototype.removeRulers=function(){if(this._textView&&this._hasRuler)this._textView.removeRuler(this._rulerOrigin),this._textView.removeRuler(this._rulerNew),this._textView.removeRuler(this._overviewRuler),this._hasRuler=!1};d.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),
this._textView.setText(""),this.removeRulers());this.hasContent=!1};d.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};d.prototype.createEditorContainer=function(d,e,g,h,i,j){var k=b.node(this._editorDivId),l=this,m=new o.TextModel(d,e),d=new a.UndoFactory,e=new a.AnnotationFactory,d=new c.Editor({textViewFactory:function(){return new q.TextView({parent:k,model:m,readonly:!0,tabSize:4})},undoStackFactory:d,annotationFactory:e,keyBindingFactory:function(){},
statusReporter:function(){},domNode:k});d.installTextView();d.setOverviewRulerVisible(!1);d.setAnnotationRulerVisible(!1);i&&j&&d.setInput(j.Name);var n=d.getTextView();this._rulerOrigin=new f.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._rulerNew=new f.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._overviewRuler=
new f.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a){l._diffNavigator.matchPositionFromOverview(a)});n.addEventListener("Selection",function(a){!(a.newValue&&a.newValue.start!==a.newValue.end)&&!l._diffNavigator.autoSelecting&&l._diffNavigator.editorWrapper[0].diffFeeder&&(a=n.getCaretOffset(),l._diffNavigator.gotoDiff(a,n))});return d};d.prototype.initEditorContainers=function(a,b,c,d){this._editor=this.createEditorContainer(b,a,c,d,this.options.newFile);this._textView=
this._editor.getTextView()};d.prototype._initDiffPosition=function(a){var b=a.getModel();if(b&&b.getAnnotations&&(b=b.getAnnotations(),b.length>0)){var b=b[0][0],c=a.getLineHeight(),d=a.getClientArea(),c=Math.floor(d.height/c/3);a.setTopIndex(b-c>0?b-c:0)}};d.prototype.setDiffTitle=function(a){this._diffTitle=a};d.prototype.setEditor=function(){var a=this.options.baseFile.Content,b=this.options.newFile.Content,c=this.options.diffContent;this.hasContent=!0;b=this.parseMapper(a,b,c,this.options.hasConflicts,
!this.options.toggler);this._highlighterLoaded=0;this._textView?(this._textView.getModel().setText(a),a=new t.inlineDiffBlockFeeder(b.mapper,1),c=new t.inlineDiffBlockFeeder(b.mapper,0),l.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._highlighter[0].highlight(this.options.baseFile.Name,this.options.baseFile.Type,this._editor,this,1),this.renderCommands(),this.addRulers(),a=this._textView.getTopIndex(),this._textView.redrawLines(a,a+1,this._overviewRuler),this._textView.redrawLines(a,a+1,this._rulerOrigin),this._textView.redrawLines(a,a+1,this._rulerNew),this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)):this.initEditorContainers(b.delim,a,b.mapper,b.diffArray,!0);return this._textView.getLineHeight()*
this._textView.getModel().getLineCount()+5};d.prototype.setConflicting=function(a){this._conflcit=a};return d}();A.toggleableCompareContainer=function(){function a(b,c,d,e){if(e)e.toggler=this;d==="inline"?(this.widgetType="inline",this._widget=new A.InlineCompareContainer(b,c,e)):(this.widgetType="twoWay",this._widget=new A.TwoWayCompareContainer(b,c,null,e));this._parentDivId=c;this._serviceRegistry=b}a.prototype={startup:function(a){this._widget.startup(!1,a)},toggle:function(){var a=this._widget.options,
c=this._widget.getCurrentDiffPos();a.blockNumber=c.block;a.changeNumber=c.change;this._widget.destroy();b.empty(b.node(this._parentDivId));this.widgetType==="inline"?(this.widgetType="twoWay",this._widget=new A.TwoWayCompareContainer(this._serviceRegistry,this._parentDivId,null,a)):(this.widgetType="inline",this._widget=new A.InlineCompareContainer(this._serviceRegistry,this._parentDivId,a));this._widget.setEditor()}};return a}();return A});
define("orion/git/gitStatusExplorer","i18n!git/nls/gitmessages,orion/explorers/explorer,orion/selection,orion/section,orion/PageUtil,orion/webui/littlelib,orion/i18nUtil,orion/globalCommands,orion/compare/diff-provider,orion/compare/compare-container,orion/git/util,orion/git/gitCommands,orion/Deferred,orion/git/widgets/CommitTooltipDialog".split(","),function(h,k,j,b,g,f,e,d,c,a,i,m,o,q){var c={},u=function(){function a(){this.selectedItem=this.selectedFileId=void 0;this.interestedUnstagedGroup=["Missing",
"Modified","Untracked","Conflicting"];this.interestedStagedGroup=["Added","Changed","Removed"];this.conflictPatterns=[["Both","Modified","Added","Changed","Missing"],["RemoteDelete","Untracked","Removed"],["LocalDelete","Modified","Added","Missing"]];this.conflictType="Conflicting";this.statusTypeMap={Missing:["gitImageSprite git-sprite-removal",h["Unstaged removal"]],Removed:["gitImageSprite git-sprite-removal",h["Staged removal"]],Modified:["gitImageSprite git-sprite-file",h["Unstaged change"]],
Changed:["gitImageSprite git-sprite-file",h["Staged change"]],Untracked:["gitImageSprite git-sprite-addition",h["Unstaged addition"]],Added:["gitImageSprite git-sprite-addition",h["Staged addition"]],Conflicting:["gitImageSprite git-sprite-conflict-file",h.Conflicting]}}a.prototype={destroy:function(){},interestedCategory:function(){},init:function(a){this.items=a},getModelType:function(a,b){return b},_markConflict:function(a){var b=this.getGroupData(a[1]);if(b)for(var c=0;c<b.length;c++)if(!b[c].Conflicting){for(var d=
b[c].Location,e=[],f=2;f<a.length;f++){var g=this.getGroupData(a[f]);g&&(g=this._findSameFile(d,g))&&e.push(g)}if(e.length===a.length-2){b[c].Conflicting=a[0];for(d=0;d<e.length;d++)e[d].Conflicting="Hide"}}},_findSameFile:function(a,b){for(var c=0;c<b.length;c++)if(!b[c].Conflicting&&a===b[c].Location)return b[c]},getGroupData:function(a){return this.items[a]},isStaged:function(a){for(var b=0;b<this.interestedStagedGroup.length;b++)if(a===this.interestedStagedGroup[b])return!0;return!1},getClass:function(a){return this.statusTypeMap[a][0]}};
return a}();c.GitStatusExplorer=function(){function c(a,b,d,e,f,g,h,i){this.parentId=f;this.registry=a;this.commandService=b;this.linkService=d;this.selection=e;this.parentId=f;this.toolbarId=g;this.selectionToolsId=h;this.checkbox=!1;this.actionScopeId=i;k.createExplorerCommands(b)}c.prototype.handleError=function(a){var b={Severity:"Error",HTML:!1};try{var c=JSON.parse(a.responseText);b.Message=c.DetailedMessage?c.DetailedMessage:c.Message}catch(d){b.Message=a.message}this.registry.getService("orion.page.message").setProgressResult(b);
a.status===404&&(this.initTitleBar(),this.displayCommit())};c.prototype.changedItem=function(){this.redisplay()};c.prototype.redisplay=function(){this.display(g.matchResourceParameters().resource)};c.prototype.display=function(a){var b=this,c=this.registry.getService("orion.page.progress");c.progress(this.registry.getService("orion.git.provider").getGitStatus(a),h["Loading..."]).then(function(a){if(a.Type==="Status")b._model=new u,b._model.init(a),c.progress(b.registry.getService("orion.git.provider").getGitClone(a.CloneLocation),
"Getting repository information").then(function(d){var e=d.Children;c.progress(b.registry.getService("orion.git.provider").getGitCloneConfig(e[0].ConfigLocation),"Getting repository configuration ",e[0].Name).then(function(c){c=c.Children;a.Clone=e[0];a.Clone.Config=[];for(var d=0;d<c.length;d++)(c[d].Key==="user.name"||c[d].Key==="user.email")&&a.Clone.Config.push(c[d]);c=f.node("table");f.empty(c);b.initTitleBar(a,e[0]);b.displayUnstaged(a,e[0]);b.displayStaged(a,e[0]);b.displayCommits(e[0]);m.updateNavTools(b.registry,
b,"pageActions","selectionTools",a)},function(a){b.handleError(a)})},function(a){b.handleError(a)})},function(a){loadingDeferred.callback();b.handleError(a)})};c.prototype.initTitleBar=function(a,b){var c={};c.Name=h.Status+(a.RepositoryState&&a.RepositoryState.indexOf("REBASING")!==-1?h[" (Rebase in Progress)"]:"");c.Parents=[];c.Parents[0]={};c.Parents[0].Name=b.Name;c.Parents[0].Location=b.Location;c.Parents[0].ChildrenLocation=b.Location;c.Parents[1]={};c.Parents[1].Name="Repositories";d.setPageTarget({task:h.Status,
target:b,breadcrumbTarget:c,makeBreadcrumbLink:function(a,b){a.href="/git/git-repository.html#"+(b?b:"")},serviceRegistry:this.registry,commandService:this.commandService})};c.prototype._sortBlock=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=this._model.getGroupData(d);if(e)for(var f=0;f<e.length;f++){var g=this._model.getModelType(e[f],d);g&&b.push({name:e[f].Name,type:g,location:e[f].Location,path:e[f].Path,commitURI:e[f].Git.CommitLocation,indexURI:e[f].Git.IndexLocation,diffURI:e[f].Git.DiffLocation,
CloneLocation:this._model.items.CloneLocation,conflicting:g==="Conflicting"})}}b.sort(function(a,b){var c=a.name&&a.name.toLowerCase(),d=b.name&&b.name.toLowerCase();return c<d?-1:c>d?1:0});return b};c.prototype.displayUnstaged=function(c,d){var e=this,g=this._sortBlock(this._model.interestedUnstagedGroup),l=f.node("table"),m=new b.Section(l,{id:"unstagedSection",title:g.length>0?h.Unstaged:h["No Unstaged Changes"],content:'<div id="unstagedNode"></div>',canHide:!0,onExpandCollapse:function(a,b){e.commandService.destroy(b.selectionNode);
a&&e.commandService.renderCommands(b.selectionNode.id,b.selectionNode,null,e,"button",{Clone:d})}});this.commandService.registerCommandContribution(m.actionsNode.id,"orion.explorer.expandAll",200);this.commandService.registerCommandContribution(m.actionsNode.id,"orion.explorer.collapseAll",300);this.commandService.registerCommandContribution(m.selectionNode.id,"eclipse.orion.git.showPatchCommand",100);this.commandService.registerCommandContribution(m.selectionNode.id,"eclipse.orion.git.stageCommand",
200);this.commandService.registerCommandContribution(m.selectionNode.id,"eclipse.orion.git.checkoutCommand",300);if(!this.unstagedOnce){if(!this.unstagedSelection)this.unstagedSelection=new j.Selection(this.registry,"orion.unstagedSection.selection"),this.commandService.registerSelectionService(m.selectionNode.id,this.unstagedSelection);this.registry.getService("orion.unstagedSection.selection").addEventListener("selectionChanged",function(a){var b=f.node(m.selectionNode.id);b&&(e.commandService.destroy(b),
e.commandService.renderCommands(m.selectionNode.id,b,a.selections,e,"button",{Clone:d}))});this.unstagedOnce=!0}this.commandService.registerCommandContribution("DefaultActionWrapper","eclipse.orion.git.stageCommand",100);UnstagedModel=function(){function a(){}a.prototype={destroy:function(){},getRoot:function(a){a(g)},getChildren:function(a,b){if(a instanceof Array&&a.length>0)b(a);else if(i.isChange(a)){if(!a.children)a.children=[],a.children.push({diffUri:a.diffURI,Type:"Diff",parent:a});b(a.children)}else b([])},
getId:function(a){return a instanceof Array&&a.length>0?"unstagedRoot":i.isChange(a)?"unstaged"+a.name:"unstaged"+a.diffUri}};return a}();UnstagedRenderer=function(){function b(a,c){this._init(a);this.options=a;this.explorer=c;this.registry=a.registry}b.prototype=new k.SelectionRenderer;b.prototype.getCellElement=function(b,c,d){switch(b){case 0:if(i.isChange(c)){var b=document.createElement("td"),g=document.createElement("div");g.className="sectionTableItem";b.appendChild(g);this.getExpandImage(d,
g);var h=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(c,!0):null,j=document.createElement("span");j.id="unstaged"+c.name+"DiffActionWrapper";j.className="sectionExplorerActions";g.appendChild(j);window.setTimeout(function(){e.commandService.renderCommands("DefaultActionWrapper",j.id,c,e,"tool",null,h)},300);d=document.createElement("span");d.className="gitImageSprite "+e._model.getClass(c.type);g.appendChild(d);d=document.createElement("span");d.textContent=c.name;g.appendChild(d)}else{b=
document.createElement("td");b.colSpan=2;g=document.createElement("div");g.className="sectionTableItem";b.appendChild(g);var k=document.createElement("div");k.className="sectionExplorerActions";k.id="unstaged"+c.parent.name+"CompareWidgetActionWrapper";g.appendChild(k);d=document.createElement("div");d.id="diffArea_"+c.diffUri;d.style.height="420px";d.style.border="1px solid lightgray";d.style.overflow="hidden";g.appendChild(d);var h=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(c,
!0):null,l=c.parent.type==="Conflicting";window.setTimeout(function(){var b=new a.DefaultDiffProvider(e.registry);(new a.toggleableCompareContainer(e.registry,"diffArea_"+c.diffUri,"inline",{gridRenderer:{navGridHolder:h},commandSpanId:k.id,diffProvider:b,hasConflicts:l,readonly:!0,editableInComparePage:!0,resource:c.diffUri,callback:function(){}})).startup(function(a){var b=420;a<b&&(b=a);f.node("diffArea_"+c.diffUri).style.height=b+"px"})},300)}return b}};return b}();UnstagedNavigator=function(){function a(b,
c,d,e){this.registry=b;this.checkbox=!1;this.parentId=d;this.selection=c;this.actionScopeId=e;this.renderer=new UnstagedRenderer({registry:this.registry,cachePrefix:"UnstagedNavigator",checkbox:!1},this);this.createTree(this.parentId,new UnstagedModel,{setFocus:!0})}a.prototype=new k.Explorer;a.prototype.isRowSelectable=function(a){return i.isChange(a)};a.prototype.getItemCount=function(){return g.length};return a}();l=new UnstagedNavigator(this.registry,this.unstagedSelection,"unstagedNode");this.commandService.renderCommands(m.actionsNode.id,
m.actionsNode.id,l,l,"button")};c.prototype.displayStaged=function(c,d){var e=this,g=this._sortBlock(this._model.interestedStagedGroup),l=f.node("table"),m=new b.Section(l,{id:"stagedSection",title:g.length>0?h.Staged:h["No Staged Changes"],content:'<div id="stagedNode"></div>',slideout:!0,canHide:!0,onExpandCollapse:function(a,b){e.commandService.destroy(b.selectionNode);a&&e.commandService.renderCommands(b.selectionNode.id,b.selectionNode,null,e,"button",{Clone:d})}});this.commandService.registerCommandContribution(m.actionsNode.id,
"eclipse.orion.git.commitCommand",100);this.commandService.registerCommandContribution(m.actionsNode.id,"orion.explorer.expandAll",200);this.commandService.registerCommandContribution(m.actionsNode.id,"orion.explorer.collapseAll",300);this.commandService.registerCommandContribution(m.selectionNode.id,"eclipse.orion.git.unstageCommand",100);if(!this.stagedOnce){if(!this.stagedSelection)this.stagedSelection=new j.Selection(this.registry,"orion.stagedSection.selection"),this.commandService.registerSelectionService(m.selectionNode.id,
this.stagedSelection);this.registry.getService("orion.stagedSection.selection").addEventListener("selectionChanged",function(a){var b=f.node(m.selectionNode.id);b&&(e.commandService.destroy(b),e.commandService.renderCommands(m.selectionNode.id,b,a.selections,e,"button",{Clone:d}))});this.stagedOnce=!0}this.commandService.registerCommandContribution("DefaultActionWrapper","eclipse.orion.git.unstageCommand",100);StagedModel=function(){function a(){}a.prototype={destroy:function(){},getRoot:function(a){a(g)},
getChildren:function(a,b){if(a instanceof Array&&a.length>0)b(a);else if(i.isChange(a)){if(!a.children)a.children=[],a.children.push({diffUri:a.diffURI,Type:"Diff",parent:a});b(a.children)}else b([])},getId:function(a){return a instanceof Array&&a.length>0?"stagedRoot":i.isChange(a)?"staged"+a.name:"staged"+a.diffUri}};return a}();StagedRenderer=function(){function b(a,c){this._init(a);this.options=a;this.explorer=c;this.registry=a.registry}b.prototype=new k.SelectionRenderer;b.prototype.getCellElement=
function(b,c,d){switch(b){case 0:if(i.isChange(c)){var b=document.createElement("td"),g=document.createElement("div");g.className="sectionTableItem";b.appendChild(g);this.getExpandImage(d,g);var h=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(c,!0):null,j=document.createElement("span");j.id="staged"+c.name+"DiffActionWrapper";j.className="sectionExplorerActions";g.appendChild(j);window.setTimeout(function(){e.commandService.renderCommands("DefaultActionWrapper",j.id,c,e,"tool",
null,h)},300);d=document.createElement("span");d.className="gitImageSprite "+e._model.getClass(c.type);g.appendChild(d);d=document.createElement("span");d.textContent=c.name;g.appendChild(d)}else{b=document.createElement("td");b.colSpan=2;g=document.createElement("div");g.className="sectionTableItem";b.appendChild(g);var k=document.createElement("div");k.className="sectionExplorerActions";k.id="staged"+c.parent.name+"CompareWidgetActionWrapper";g.appendChild(k);d=document.createElement("div");d.id=
"diffArea_"+c.diffUri;d.style.height="420px";d.style.border="1px solid lightgray";d.style.overflow="hidden";g.appendChild(d);var h=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(c,!0):null,l=c.parent.type==="Conflicting";window.setTimeout(function(){var b=new a.DefaultDiffProvider(e.registry);(new a.toggleableCompareContainer(e.registry,"diffArea_"+c.diffUri,"inline",{gridRenderer:{navGridHolder:h},commandSpanId:k.id,diffProvider:b,hasConflicts:l,readonly:!0,resource:c.diffUri,
callback:function(){}})).startup(function(a){var b=420;a<b&&(b=a);f.node("diffArea_"+c.diffUri).style.height=b+"px"})},500)}return b}};return b}();StagedNavigator=function(){function a(b,d,e,f){this.registry=b;this.checkbox=!1;this.parentId=e;this.status=c;this.selection=d;this.actionScopeId=f;this.renderer=new StagedRenderer({registry:this.registry,cachePrefix:"StagedNavigator",checkbox:!1},this);this.createTree(this.parentId,new StagedModel)}a.prototype=new k.Explorer;a.prototype.isRowSelectable=
function(a){return i.isChange(a)};a.prototype.getItemCount=function(){return g.length};return a}();l=new StagedNavigator(this.registry,this.stagedSelection,"stagedNode");this.commandService.renderCommands(m.actionsNode.id,m.actionsNode.id,l,l,"button")};c.prototype.displayCommits=function(a){var c=this,d=f.node("table"),g=new b.Section(d,{id:"commitSection",title:h.Commits,content:'<div id="commitNode" class="mainPadding"></div>',slideout:!0,canHide:!0,preferenceService:this.registry.getService("orion.core.preference")}),
i=g.createProgressMonitor();i.begin(h["Getting current branch"]);this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitBranch(a.BranchLocation),"Getting current branch "+a.Name).then(function(a){for(var a=a.Children,b,d=0;d<a.length;d++)if(a[d].Current){b=a[d];break}b?(a=b.RemoteLocation.length===1&&b.RemoteLocation[0].Children.length===1,g.setTitle(e.formatMessage(h['Commits for "${0}" branch'],b.Name)),c.commandService.registerCommandContribution(g.actionsNode.id,
"eclipse.orion.git.repositories.viewAllCommand",10),c.commandService.renderCommands(g.actionsNode.id,g.actionsNode.id,{ViewAllLink:"/git/git-log.html#"+b.CommitLocation+"?page=1",ViewAllLabel:h["See Full Log"],ViewAllTooltip:h["See the full log"]},c,"button"),a&&(c.commandService.registerCommandContribution(g.actionsNode.id,"eclipse.orion.git.fetch",100),c.commandService.registerCommandContribution(g.actionsNode.id,"eclipse.orion.git.merge",100),c.commandService.registerCommandContribution(g.actionsNode.id,
"eclipse.orion.git.rebase",100),c.commandService.registerCommandContribution(g.actionsNode.id,"eclipse.orion.git.resetIndex",100),c.commandService.renderCommands(g.actionsNode.id,g.actionsNode.id,b.RemoteLocation[0].Children[0],c,"button")),c.commandService.registerCommandContribution(g.actionsNode.id,"eclipse.orion.git.push",100),c.commandService.renderCommands(g.actionsNode.id,g.actionsNode.id,b,c,"button"),b.RemoteLocation[0]===null?(i.done(),c.renderNoCommit()):(i.worked(e.formatMessage(h['Getting commits for "${0}" branch'],
b.Name)),a&&b.RemoteLocation[0].Children[0].CommitLocation?c.registry.getService("orion.page.progress").progress(c.registry.getService("orion.git.provider").getLog(b.RemoteLocation[0].Children[0].CommitLocation+"?page=1&pageSize=20","HEAD"),e.formatMessage(h['Getting commits for "${0}" branch'],b.Name)).then(function(a){i.worked(h["Rendering commits"]);for(var d=a.Children.length,e=0;e<a.Children.length;e++)c.renderCommit(a.Children[e],!0,e);i.worked(h["Getting outgoing commits"]);c.registry.getService("orion.page.progress").progress(c.registry.getService("orion.git.provider").getLog(b.CommitLocation+
"?page=1&pageSize=20",b.RemoteLocation[0].Children[0].Id),h["Getting outgoing commits"]).then(function(a){i.worked(h["Rendering commits"]);for(var b=0;b<a.Children.length;b++)c.renderCommit(a.Children[b],!1,b+d);d+=a.Children.length;d===0&&c.renderNoCommit();i.done()},function(a){i.done(a)})},function(a){i.done(a)}):c.registry.getService("orion.page.progress").progress(c.registry.getService("orion.git.provider").doGitLog(b.CommitLocation+"?page=1&pageSize=20"),e.formatMessage(h['Getting commits for "${0}" branch'],
b.Name)).then(function(a){i.worked(h["Rendering commits"]);for(var b=0;b<a.Children.length;b++)c.renderCommit(a.Children[b],!0,b);a.Children.length===0&&c.renderNoCommit();i.done()},function(a){i.done(a)}))):i.done()})};c.prototype.renderNoCommit=function(){var a=document.createElement("div");a.className="sectionTableItem";f.node("commitNode").appendChild(a);var b=document.createElement("div");b.className="sectionTableItem";a.appendChild(b);a=document.createElement("div");a.className="stretch";b.appendChild(a);
b=document.createElement("div");b.appendChild(document.createTextNode(h["The branch is up to date."]));a.appendChild(b);b=document.createElement("div");b.appendChild(document.createTextNode(h["You have no outgoing or incoming commits."]));a.appendChild(b)};c.prototype.renderCommit=function(a,b){var c=document.createElement("div");c.className="sectionTableItem lightTreeTableRow";f.node("commitNode").appendChild(c);var d=document.createElement("div");d.className="sectionTableItem";d.style.overflow=
"hidden";c.appendChild(d);var c=b?"git-sprite-outgoing_commit":"git-sprite-incoming_commit",e=document.createElement("span");e.className="sectionIcon gitImageSprite "+c;d.appendChild(e);if(a.AuthorImage)c=document.createElement("div"),c.style["float"]="left",e=new Image,e.src=a.AuthorImage,e.name=a.AuthorName,e.className="git-author-icon",c.appendChild(e),d.appendChild(c);c=document.createElement("div");c.className="stretch";d.appendChild(c);d=document.createElement("a");d.className="navlinkonpage";
d.href="/git/git-commit.html#"+a.Location+"?page=1&pageSize=1";d.textContent=a.Message;c.appendChild(d);new q.CommitTooltipDialog({commit:a,triggerNode:d});d=document.createElement("div");c.appendChild(d);d=document.createElement("span");d.textContent=" (SHA "+a.Name+") by "+a.AuthorName+" on "+(new Date(a.Time)).toLocaleString();c.appendChild(d)};return c}();return c});var eclipse;
define("git/git-status2","i18n!git/nls/gitmessages,require,orion/bootstrap,orion/status,orion/progress,orion/commands,orion/dialogs,orion/selection,orion/fileClient,orion/operationsClient,orion/searchClient,orion/globalCommands,orion/git/gitStatusExplorer,orion/git/gitCommands,orion/git/gitClient,orion/ssh/sshTools,orion/links,orion/contentTypes,orion/PageUtil".split(","),function(h,k,j,b,g,f,e,d,c,a,i,m,o,q,u,l,s,n,y){j.startup().then(function(j){var v=j.serviceRegistry,w=j.preferences;new e.DialogService(v);
new d.Selection(v);new l.SshService(v);var j=new f.CommandService({serviceRegistry:v}),A=new a.OperationsClient(v);new b.StatusReportingService(v,A,"statusPane","notifications","notificationArea");new g.ProgressService(v,A);A=new s.TextLinkService({serviceRegistry:v});new u.GitService(v);var x=new c.FileClient(v);new n.ContentTypeService(v);var p=new i.Searcher({serviceRegistry:v,commandService:j,fileService:x}),r=new o.GitStatusExplorer(v,j,A,null,"artifacts","pageActions",null,"itemLevelCommands");
m.setPageCommandExclusions(["eclipse.git.status2","eclipse.git.status"]);m.generateBanner("orion-git-status",v,j,w,p,r);q.createFileCommands(v,j,r,"pageActions","selectionTools");q.createGitClonesCommands(v,j,r,"pageActions","selectionTools",x);q.createGitStatusCommands(v,j,r);j.addCommandGroup("pageActions","eclipse.gitGroup",100);j.registerCommandContribution("pageActions","eclipse.orion.git.resetCommand",100,"eclipse.gitGroup");j.registerCommandContribution("pageActions","eclipse.orion.git.rebaseContinueCommand",
200,"eclipse.gitGroup");j.registerCommandContribution("pageActions","eclipse.orion.git.rebaseSkipPatchCommand",300,"eclipse.gitGroup");j.registerCommandContribution("pageActions","eclipse.orion.git.rebaseAbortCommand",400,"eclipse.gitGroup");v=new f.Command({name:h["View All"],id:"eclipse.orion.git.repositories.viewAllCommand",hrefCallback:function(a){return k.toUrl(a.items.ViewAllLink)},visibleWhen:function(a){this.name=a.ViewAllLabel;this.tooltip=a.ViewAllTooltip;return a.ViewAllLabel&&a.ViewAllTooltip&&
a.ViewAllLink}});j.addCommand(v);v=y.matchResourceParameters();r.display(v.resource);window.addEventListener("hashchange",function(){var a=y.matchResourceParameters();r.display(a.resource)},!1)})});