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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/*
 * Copyright 2012, Mozilla Foundation and contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*******************************************************************************
 * @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:
 *     Kris De Volder (VMWare) - initial API and implementation
 *******************************************************************************/

/**
 * marked - a markdown parser
 * Copyright (c) 2011-2013, Christopher Jeffrey. (MIT Licensed)
 * https://github.com/chjj/marked
 */

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

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

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

/*******************************************************************************
 * @license
 * Copyright (c) 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:
 *     Kris De Volder (VMWare) - initial API and implementation
 *******************************************************************************/

/*

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (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) 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). 


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


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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

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

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

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

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


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


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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 Kris De Volder (VMWare) - 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:
 Kris De Volder (VMWare) - initial API and implementation

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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - _initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 Kris De Volder (VMWare) - initial API and implementation
*/
(function(){function l(d,f,b,g,a,e){f[d]&&(b.push(d),(f[d]===!0||f[d]===1)&&g.push(a+d+"/"+e))}function j(d,f,b,g,a){f=g+f+"/"+a;require._fileExists(d.toUrl(f+".js"))&&b.push(f)}function h(d,f,b){for(var g in f)f.hasOwnProperty(g)&&(!d.hasOwnProperty(g)||b)?d[g]=f[g]:typeof f[g]==="object"&&h(d[g],f[g],b)}var f=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(d){var k=d.config?d.config():{};return{version:"2.0.1+",load:function(b,g,a,e){e=e||{};if(e.locale)k.locale=e.locale;
var c=f.exec(b),i=c[1],m=c[4],d=c[5],n=m.split("-"),p=[],t={},u,v="";if(c[5])i=c[1],b=i+d;else{d=c[4];m=k.locale;if(!m)m=k.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();n=m.split("-")}if(e.isBuild){p.push(b);j(g,"root",p,i,d);for(u=0;u<n.length;u++)e=n[u],v+=(v?"-":"")+e,j(g,v,p,i,d);g(p,function(){a()})}else g([b],function(c){var e=[],b;l("root",c,e,p,i,d);for(u=0;u<n.length;u++)b=n[u],v+=(v?"-":"")+b,l(v,c,e,p,i,d);g(p,function(){var b,
m,f;for(b=e.length-1;b>-1&&e[b];b--){f=e[b];m=c[f];if(m===!0||m===1)m=g(i+f+"/"+d);h(t,m)}a(t)})})}}})})();
define("orion/i18n",[],function(){return{load:function(l,j,h,f){var f=f||{},d=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,k=d.exec(l);if(k){if(!j.defined||j.defined(l))try{h(j(l));return}catch(b){}if(f.isBuild||f.isTest)h({});else{var g=k[1],a=k[3]?k[2]:"",e=k[3]||k[2];j(["orion/bootstrap"],function(c){c.startup().then(function(c){var b=c.serviceRegistry,c=b.getServiceReferences("orion.i18n.message");if(a)c.some(function(a){return l===a.getProperty("name")?(b.getService(a).getMessageBundle().then(function(a){h(a)},
function(){h({})}),!0):!1})||h({});else{var o={},n;c.forEach(function(c){var i=c.getProperty("name");if((k=d.exec(i))&&g===k[1]&&e===(k[3]||k[2]))if(a=k[3]?k[2]:""){if((c=f.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&c.toLowerCase().indexOf(a.toLowerCase())===0)o[a]=!0,(!j.specified||!j.specified(i))&&define(i,["orion/i18n!"+i],function(a){return a})}else n=c});!j.specified||!j.specified(l)?n?b.getService(n).getMessageBundle().then(function(a){Object.keys(o).forEach(function(c){typeof a[c]===
"undefined"&&(a[c]=o[c])});define(l,[],a);h(a)},function(){define(l,[],o);h(o)}):(define(l,[],o),h(o)):h(o)}})})}}else h(null)}}});
define("orion/shell/nls/root/messages",{Shell:"Shell","Changed to: ":"Changed to: ","Initial directory: ":"Initial directory: ","${0} is not a directory":"${0} is not a directory","${0} was not found":"${0} was not found","Changes the current directory":"Changes the current directory","The name of the directory":"The name of the directory","Edits a file":"Edits a file","The name of the file":"The name of the file","Lists the files in the current directory":"Lists the files in the current directory",
"Prints the current directory location":"Prints the current directory location","Clears the shell screen":"Clears the shell screen","'${0}' is not valid":"'${0}' is not valid","Error: ${0}":"Error: ${0}",NoResponseFromServer:"No response from server for ${0}. Check your internet connection and try again.",ServerError:"Server error: ${0} returned ${1} ${2}",Succeeded:"Succeeded",Aborted:"Aborted","The name of the plug-in":"The name of the plug-in","The name of the contributed plug-in":"The name of the contributed plug-in",
"Lists all registered plug-ins":"Lists all registered plug-ins","Reloads a plug-in":"Reloads a plug-in","Disables a contributed plug-in":"Disables a contributed plug-in","Enables a contributed plug-in":"Enables a contributed plug-in","Uninstalls a contributed plug-in from the configuration":"Uninstalls a contributed plug-in from the configuration","Plug-in is already installed":"Plug-in is already installed","Invalid plug-in URL":"Invalid plug-in URL","Installs a plug-in from a URL":"Installs a plug-in from a URL",
"The plug-in URL":"The plug-in URL","Commands for working with plug-ins":"Commands for working with plug-ins","Are you sure you want to uninstall all contributed plug-ins?":"Are you sure you want to uninstall all contributed plug-ins?","Displays a plug-in's services":"Displays a plug-in's services","Commands for working with a service":"Commands for working with a service","Displays all plug-in contributions for a service":"Displays all plug-in contributions for a service","The service identifier":"The service identifier",
disabled:"disabled","Open Shell":"Open Shell","Open Shell page":"Open Shell page","'${0}' already exists":"'${0}' already exists","Source file service does not support binary read":"Source file service does not support binary read","Target file service does not support binary write":"Target file service does not support binary write","Cannot create file, it already exists as a directory":"Cannot create file, it already exists as a directory","Cannot create directory, it already exists as a file":"Cannot create directory, it already exists as a file",
"Wrote ${0}":"Wrote ${0}","Failed to write ${0}":"Failed to write ${0}","Cannot write ${0}, it is not a descendent of the output directory":"Cannot write ${0}, it is not a descendent of the output directory","The file or directory to re-direct output to":"The file or directory to re-direct output to"});
define("orion/shell/nls/messages",["orion/i18n!orion/shell/nls/messages","orion/shell/nls/root/messages"],function(l,j){var h={root:j};Object.keys(l).forEach(function(f){typeof h[f]==="undefined"&&(h[f]=l[f])});return h});
(function(){function l(){for(var d=navigator.userAgent,f={browser:!1,version:!1},b=[{name:"Chrome/Chromium",regExp:/(?:chrome|crios|chromium)\/(\d+)/i,minVersion:24},{name:"Firefox",regExp:/firefox\/(\d+)/i,minVersion:17},{name:"Microsoft Internet Explorer",regExp:/msie\s(\d+)/i,minVersion:10},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:5}],g=0;g<b.length;g++){var a=b[g],e=d.match(a.regExp);if(e){f.browser=!0;f.version=e[1]>=a.minVersion;f.name=a.name;break}}return f}function j(){try{return"localStorage"in
window&&window.localStorage!==null}catch(d){return!1}}function h(d){alert(d);throw Error("unsupported browser");}var f=l();if(f.browser)f.version||h("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+f.name+".\n");else if(j()&&!localStorage.skipBrowserCheck)if(confirm("Sorry, your browser is not supported. The latest version of Chrome, Firefox or Safari web browser is recommended.\nContinue anyway?"))localStorage.skipBrowserCheck=1;else throw"unsupported browser";
else j()||h("Sorry, your browser is not supported.\n\nTo use Orion, the latest version of the Chrome, Firefox, or Safari web browser is recommended.\n");return{isSupportedBrowser:l,supportsLocalStorage:j,throwBrowserAlert:h}})();define("orion/browserCompatibility",function(){});
(function(l,j){typeof define==="function"&&define.amd?define("orion/Deferred",j):typeof exports==="object"?module.exports=j():(l.orion=l.orion||{},l.orion.Deferred=j())})(this,function(){function l(){for(var b;b=d.shift();)b();k=!1}function j(b){d.push(b);k||(k=!0,setTimeout(l,0))}function h(b){return function(){b.apply(void 0,arguments)}}function f(){function b(){for(var a;a=m.shift();){var e=a.deferred,g=i==="fulfilled"?"resolve":"reject";if(typeof a[g]==="function")try{var b=(0,a[g])(c),f=b&&(typeof b===
"object"||typeof b==="function")&&b.then;if(typeof f==="function")if(b===e.promise)e.reject(new TypeError);else{var o=b.cancel;typeof o==="function"?e._protected(d).parentCancel=o.bind(b):delete e._protected(d).parentCancel;f.call(b,h(e.resolve),h(e.reject),h(e.progress))}else e.resolve(b)}catch(k){e.reject(k)}else e[g](c)}}function g(a){delete k.parentCancel;i="rejected";c=a;m.length&&j(b)}function a(e){function d(a){return function(c){h||(h=!0,a(c))}}var h=!1;delete k.parentCancel;try{var l=e&&
(typeof e==="object"||typeof e==="function")&&e.then;if(typeof l==="function")if(e===o)g(new TypeError);else{i="assumed";var r=e&&e.cancel;if(typeof r!=="function"){var q=new f,e=q.promise;try{l(q.resolve,q.reject,q.progress)}catch(y){q.reject(y)}r=e.cancel;l=e.then}c=e;l.call(e,d(a),d(g));k.parentCancel=r.bind(e)}else i="fulfilled",c=e,m.length&&j(b)}catch(z){d(g)(z)}}function e(){var a=k.parentCancel;if(a)delete k.parentCancel,a();else if(!i)a=Error("Cancel"),a.name="Cancel",g(a)}var c,i,m=[],o=
this,k={};Object.defineProperty(this,"_protected",{value:function(a){if(a!==d)throw Error("protected");return k}});this.resolve=function(c){i||a(c);return o};this.reject=function(a){i||g(a);return o};this.progress=function(a){i||m.forEach(function(c){if(c.progress)try{c.progress(a)}catch(e){}});return o.promise};this.cancel=function(){k.parentCancel?setTimeout(e,0):e();return o};this.then=function(a,c,e){a={resolve:a,reject:c,progress:e,deferred:new f};m.push(a);a.deferred._protected(d).parentCancel=
o.promise.cancel.bind(o);(i==="fulfilled"||i==="rejected")&&j(b);return a.deferred.promise};this.promise={then:o.then,cancel:o.cancel}}var d=[],k=!1;f.all=function(b,g){function a(a,e){d||(i[a]=e,--c===0&&o.resolve(i))}function e(c,e){if(!d){if(g)try{a(c,g(e));return}catch(i){e=i}o.reject(e)}}var c=b.length,i=[],d=!1,o=new f;o.then(void 0,function(){d=!0;b.forEach(function(a){a.cancel&&a.cancel()})});c===0?o.resolve(i):b.forEach(function(c,i){c.then(a.bind(void 0,i),e.bind(void 0,i))});return o.promise};
f.when=function(b,g,a,e){var c;if(!(b&&typeof b.then==="function"))c=new f,c.resolve(b),b=c.promise;return b.then(g,a,e)};return f});
define("orion/EventTarget",[],function(){function l(){this._namedListeners={}}l.prototype={dispatchEvent:function(j){if(!j.type)throw Error("unspecified type");var h=this._namedListeners[j.type];h&&h.forEach(function(f){try{typeof f==="function"?f(j):f.handleEvent(j)}catch(d){typeof console!=="undefined"&&console.log(d)}});return!j.defaultPrevented},addEventListener:function(j,h){if(typeof h==="function"||h.handleEvent)this._namedListeners[j]=this._namedListeners[j]||[],this._namedListeners[j].push(h)},
removeEventListener:function(j,h){var f=this._namedListeners[j];if(f)for(var d=0;d<f.length;d++)if(f[d]===h){f.length===1?delete this._namedListeners[j]:f.splice(d,1);break}}};l.prototype.constructor=l;l.attach=function(j){var h=new l;j.dispatchEvent=h.dispatchEvent.bind(h);j.addEventListener=h.addEventListener.bind(h);j.removeEventListener=h.removeEventListener.bind(h)};return l});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(l,j){function h(g,a,e){this._properties=e||{};this._properties["service.id"]=g;this._properties.objectClass=a;this._properties["service.names"]=a}function f(g,a,e){this._serviceId=g;this._serviceReference=a;this._internalRegistry=e}function d(g,a){function e(c){return function(){var e;try{if(!a())throw Error("Service was unregistered");var b=g[c].apply(g,Array.prototype.slice.call(arguments));if(b&&typeof b.then==="function")return b;
else e=new l,e.resolve(b)}catch(d){e=new l,e.reject(d)}return e.promise}}for(var c in g)typeof g[c]==="function"&&(this[c]=e(c))}function k(g,a){this.type=g;this.serviceReference=a}function b(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new j;var g=this;this._internalRegistry={isRegistered:function(a){return g._entries[a]?!0:!1},unregisterService:function(a){var e=g._entries[a];if(!e)throw Error("Service has already been unregistered: "+a);var c=e.reference;g._serviceEventTarget.dispatchEvent(new k("unregistering",
c));g._entries[a]=null;c.getProperty("objectClass").forEach(function(a){for(var e=g._namedReferences[a],b=0;b<e.length;b++)if(e[b]===c){e.length===1?delete g._namedReferences[a]:e.splice(b,1);break}})},modifyService:function(a){var e=g._entries[a];if(!e)throw Error("Service not found while trying to send modified event: "+a);g._serviceEventTarget.dispatchEvent(new k("modified",e.reference))}}}h.prototype={getPropertyKeys:function(){var g=[],a;for(a in this._properties)this._properties.hasOwnProperty(a)&&
g.push(a);return g},getProperty:function(g){return this._properties[g]}};h.prototype.constructor=h;f.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("Service has already been unregistered: "+this._serviceId);return this._serviceReference},setProperties:function(g){var a=this._serviceReference._properties;this._serviceReference._properties=g||{};g["service.id"]=this._serviceId;
g.objectClass=a.objectClass;g["service.names"]=a["service.names"];this._internalRegistry.modifyService(this._serviceId)}};f.prototype.constructor=f;b.prototype={getService:function(g){var a;if(typeof g==="string")(g=this._namedReferences[g])&&g.some(function(e){a=this._entries[e.getProperty("service.id")].service;return!!a},this);else if(g=this._entries[g.getProperty("service.id")])a=g.service;return a||null},getServiceReferences:function(g){if(g)return this._namedReferences[g]?this._namedReferences[g]:
[];var a=[];this._entries.forEach(function(e){e&&a.push(e.reference)});return a},registerService:function(g,a,e){if(typeof a==="undefined"||a===null)throw Error("invalid service");typeof g==="string"?g=[g]:Array.isArray(g)||(g=[]);var c=this._entries.length,i=new h(c,g,e),b=this._namedReferences;g.forEach(function(a){b[a]=b[a]||[];b[a].push(i)});g=new d(a,this._internalRegistry.isRegistered.bind(null,c));this._entries.push({reference:i,service:g});g=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new k("registered",
i));return new f(c,i,g)},addEventListener:function(g,a){this._serviceEventTarget.addEventListener(g,a)},removeEventListener:function(g,a){this._serviceEventTarget.removeEventListener(g,a)}};b.prototype.constructor=b;return{ServiceRegistry:b}});
define("orion/xhr",["orion/Deferred"],function(l){function j(h,f,d,k){var b=typeof d.response!=="undefined"?d.response:d.responseText,g;try{g=d.status}catch(a){g=0}h={args:f,response:b,responseText:typeof b==="string"?b:null,status:g,url:h,xhr:d};if(typeof k!=="undefined")h.error=k;return h}return function(h,f,d){var d=d||{},k=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,b=new l,g=d.headers||{},a=d.log||!1,e;typeof g["X-Requested-With"]==="undefined"&&(g["X-Requested-With"]="XMLHttpRequest");
if(typeof d.data!=="undefined"&&(h==="POST"||h==="PUT"))e=d.data;var c=!1,i=!1;b.promise.then(void 0,function(a){c=!0;!i&&a instanceof Error&&a.name==="Cancel"&&k.abort()});k.onabort=function(){i=!0;if(!c){var a=Error("Cancel");a.name="Cancel";b.reject(a)}};k.onload=function(){var c=j(f,d,k);200<=k.status&&k.status<400?b.resolve(c):(b.reject(c),a&&typeof console!=="undefined"&&console.log(Error(k.statusText)))};k.onerror=function(){var c=j(f,d,k);b.reject(c);a&&typeof console!=="undefined"&&console.log(Error(k.statusText))};
k.onprogress=function(a){a.xhr=k;b.progress(a)};try{k.open(h,f,!0);if(typeof d.responseType==="string")k.responseType=d.responseType;if(typeof d.timeout==="number")if(typeof k.timeout==="number")k.timeout=d.timeout,k.addEventListener("timeout",function(){b.reject(j(f,d,k,"Timeout exceeded"))});else{var m=setTimeout(function(){b.reject(j(f,d,k,"Timeout exceeded"))},d.timeout);b.promise.then(clearTimeout.bind(null,m),clearTimeout.bind(null,m))}Object.keys(g).forEach(function(a){k.setRequestHeader(a,
g[a])});k.send(e||null)}catch(o){b.reject(j(f,d,k,o))}return b.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(l,j,h){function f(a,c){this._name=a;this._providers=c;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function d(a,c){return{get:function(i,g){if(c===0)return null;var b=localStorage.getItem(a+i);if(b===null)return null;b=JSON.parse(b);return g||c===-1||b._expires&&b._expires>(new Date).getTime()?(delete b._expires,b):null},set:function(i,g){if(c!==0){if(c!==-1)g._expires=(new Date).getTime()+
1E3*c;if(Object.keys(g).length===0)localStorage.removeItem(a+i);else{var b=JSON.stringify(g);localStorage.setItem(a+i,b);delete g._expires}}},remove:function(c){localStorage.removeItem(a+c)}}}function k(a){this._currentPromises={};this._cache=new d("/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 b(a){this._location=
a;this._currentPromise=null;this._cache=new d("/orion/preferences/default",3600)}function g(){this._cache=new d("/orion/preferences/local",-1)}function a(a,c){this._userProvider=new k(a);this._localProvider=new g;c=c||"defaults.pref";c.indexOf("://")===-1&&(c=l.toUrl(c));this._defaultsProvider=new b(c);this._serviceRegistration=a.registerService("orion.core.preference",this)}f.prototype={_flush:function(){for(var a=[],c=0;c<this._stores.length;++c){var i=this._stores[c];this._dirty.indexOf(i)!==-1&&
a.push(this._providers[c].put(this._name,i));if(this._pendingDeletes[c]&&this._pendingDeletes[c].length>0){for(i=0;i<this._pendingDeletes[c].length;i++)a.push(this._providers[c].remove(this._name,this._pendingDeletes[c][i]));delete this._pendingDeletes[c]}}this._dirty=[];return j.all(a)},_scheduleFlush:function(a){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],i;for(i in c)c.hasOwnProperty(i)&&typeof this._cached[i]==="undefined"&&(this._cached[i]=c[i])}}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 i=this._stores[0];if(i[a]!==c)i[a]=c,this._cached=null,this._scheduleFlush(i)}},remove:function(a){for(var c=0;c<
this._stores.length;++c){var i=this._stores[c];if(i.hasOwnProperty(a))return delete i[a],this._pendingDeletes[c]||(this._pendingDeletes[c]=[]),this._pendingDeletes[c].push(a),this._cached=null,this._scheduleFlush(),!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,i=[],g=0;g<this._providers.length;++g)i.push(this._providers[g].get(this._name,
a).then(function(a){return function(e){c._stores[a]=e}}(g)));return j.all(i).then(function(){c._cached=null;c._getCached()})},flush:function(){this._flush()}};k.prototype={get:function(a,c){if(this._currentPromises[a])return this._currentPromises[a];var i=new j,g=null;c?this._cache.remove(a):g=this._cache.get(a);if(g!==null)i.resolve(g);else{this._currentPromises[a]=i;var b=this;this._service.get(a).then(function(c){b._cache.set(a,c);delete b._currentPromises[a];i.resolve(c)},function(c){c.status===
404?(c={},b._cache.set(a,c),delete b._currentPromises[a],i.resolve(c)):(delete b._currentPromises[a],i.resolve(b._cache.get(a,!0)||{}))})}return i},put:function(a,c){this._cache.set(a,c);return this._service.put(a,c)},remove:function(a,c){var i=this._cache.get(a);delete i[c];this._cache.set(a,i);return this._service.remove(a,c)}};b.prototype={get:function(a,c){if(this._currentPromise)return this._currentPromise;var i=new j,g=null;c?this._cache.remove(a):g=this._cache.get(a);if(g!==null)i.resolve(g);
else{this._currentPromise=i;var b=this;h("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;i.resolve(c[a]||{})},function(c){c.xhr.status===401||c.xhr.status===404?(b._cache.set(a,{}),b._currentPromise=null,i.resolve({})):(b._currentPromise=null,c=b._cache.get(a,!0),c!==null?i.resolve(c[a]||{}):i.resolve({}))})}return i},put:function(){var a=new j;a.resolve();return a},remove:function(a,c){var i=
this._cache.get(a);delete i[c];this.put(a,i)}};g.prototype={get:function(a){var c=new j,a=this._cache.get(a);a!==null?c.resolve(a):c.resolve({});return c},put:function(a,c){var i=new j;this._cache.set(a,c);i.resolve();return i},remove:function(a,c){var i=this._cache.get(a);delete i[c];this.put(a,i)}};a.DEFAULT_SCOPE=1;a.LOCAL_SCOPE=2;a.USER_SCOPE=4;a.prototype={listenForChangedSettings:function(e,c,i){if(!c||typeof c!=="number"||c>7||c<1)i=c,c=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;window.addEventListener("storage",
i,!1);if((a.USER_SCOPE&c)!==0)return"/orion/preferences/user"+e;else if((a.LOCAL_SCOPE&c)!==0)return"/orion/preferences/local"+e;return"/orion/preferences/default"+e},getPreferences:function(e,c){if(!c||typeof c!=="number"||c>7||c<1)c=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;var i=[];a.USER_SCOPE&c&&this._userProvider.available()&&i.push(this._userProvider);a.LOCAL_SCOPE&c&&i.push(this._localProvider);a.DEFAULT_SCOPE&c&&i.push(this._defaultsProvider);var g=new f(e,i);return g.sync().then(function(){return g})},
getSetting:function(a,c,i){for(var g,b=0;b<a.length;b++)if(a[b].label===c)for(var d=0;d<a[b].data.length;d++)if(a[b].data[d].label===i){g=a[b].data[d].value;break}return g}};return{PreferencesService:a}});
(function(){function l(a){if(typeof a!=="string")throw new TypeError;}function j(a){return a?a.split("&"):[]}function h(a){return a.length===0?"":a.join("&")}function f(a){var c=/([^=]*)(?:=?)(.*)/.exec(a),a=c[1]?decodeURIComponent(c[1]):"",c=c[2]?decodeURIComponent(c[2]):"";return[a,c]}function d(a){var c=encodeURIComponent(a[0]);a[1]&&(c+="="+encodeURIComponent(a[1]));return c}function k(a,c){var e="",i=[],g=0;return{next:function(){if(e!==a.query)e=a.query,i=j(e);if(g<i.length){var b=f(i[g++]);
switch(c){case "keys":return b[0];case "values":return b[1];case "keys+values":return[b[0],b[1]];default:throw new TypeError;}}throw B;}}}function b(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function g(a){var c=[];a.split("/").forEach(function(a){a===".."?c.pop():a!=="."&&c.push(a)});return c.join("/")}function a(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function e(c,e){if(typeof c!=="string")throw new TypeError;var c=a(c),i=o.exec(c);
if(!i)return null;var b={};b.scheme=i[1]||"";if(b.scheme&&!p.test(b.scheme))return null;var d=i[2];if(d&&(d=n.exec(d),b.userinfo=d[1],b.host=d[2],b.port=d[3],b.port&&!t.test(b.port)))return null;b.path=i[3];b.query=i[4];b.fragment=i[5];if(!b.scheme&&e&&(b.scheme=e.scheme,!b.host&&e.host))b.userinfo=e.userinfo,b.host=e.host,b.port=e.port,b.pathRelative=!0;if(b.pathRelative)if(b.path){if(b.path[0]!=="/")i=/^(.*\/)[^\/]*$/.exec(e.path)[1]||"/",b.path=i+b.path}else b.path=e.path;if(b.scheme)b.scheme=
b.scheme.toLowerCase();if(b.port)b.port=/[1-9]\d*$/.exec(b.port)[0];if(b.host&&b.path)b.path=g(b.path);return b}function c(a,c){var i;if(c){c=c.href||c;i=e(c);if(!i||!i.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:i})}i=e(a,i);if(!i)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:i,writable:!0});var g=new b(this);Object.defineProperty(this,"query",{get:function(){return this._url?g:null},enumerable:!0})}
try{var i;if(typeof window.URL==="function"&&window.URL.length!==0&&(i=new window.URL("http://www.w3.org?q")).protocol==="http:"&&i.query)return}catch(m){}var o=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,n=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,p=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,t=/^\d*$/,u=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,v=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,r=/^([^?#\s]*)$/,q=/^([^\s]*)$/,y=/^\S*$/,z=/([^:]*):?(.*)/,B=typeof StopIteration!=="undefined"?
StopIteration:Error("Stop Iteration"),D={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(b.prototype,{get:{value:function(a){l(a);var c;j(this._url.query).some(function(i){i=f(i);if(i[0]===a)return c=i[1],!0});return c},enumerable:!0},set:{value:function(a,c){l(a);l(c);var i=j(this._url.query);i.some(function(e,g){var b=f(e);if(b[0]===a)return b[1]=c,i[g]=d(b),!0})||i.push(d([a,c]));this._url.query=h(i)},enumerable:!0},has:{value:function(a){l(a);
return j(this._url.query).some(function(c){if(f(c)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){l(a);var c=j(this._url.query),i=c.filter(function(c){return f(c)[0]!==a});return i.length!==c.length?(this._url.query=h(i),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,c){if(typeof a!=="function")throw new TypeError;var i=k(this._url,"keys+values");try{for(;;){var e=i.next();a.call(c,e[1],e[0],this)}}catch(g){if(g!==B)throw g;
}},enumerable:!0},keys:{value:function(){return k(this._url,"keys")},enumerable:!0},values:{value:function(){return k(this._url,"values")},enumerable:!0},items:{value:function(){return k(this._url,"keys+values")}},size:{get:function(){return j(this._url.query).length},enumerable:!0},getAll:{value:function(a){l(a);var c=[];j(this._url.query).forEach(function(i){i=f(i);i[0]===a&&c.push(i[1])});return c},enumerable:!0},append:{value:function(a,c){l(a);l(c);var i=j(this._url.query);i.push(d([a,c]));this._url.query=
h(i)},enumerable:!0}});Object.defineProperties(c.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var c=a.scheme?a.scheme+":":"";a.host&&(c+="//",a.userinfo&&(c+=a.userinfo+"@"),c+=a.host,a.port&&(c+=":"+a.port));c+=a.path;a.query&&(c+="?"+a.query);a.fragment&&(c+="#"+a.fragment);a=c}else a=this._input;return a},set:function(a){l(a);this._input=a;this._url=e(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:
""},enumerable:!0},protocol:{get:function(){return this._url?this._url.scheme+":":":"},set:function(a){l(a);if(this._url&&(a=a.slice(-1)===":"?a.substring(0,a.length-1):a,p.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){l(a);if(this._url)this._url.userinfo=a}},username:{get:function(){if(!this._url)return"";var a=z.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){l(a);if(this._url){var c=
z.exec(this._userinfo),a=[encodeURIComponent(a||"")];c[2]&&a.push(c[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=z.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){l(a);if(this._url){var c=[z.exec(this._userinfo)[1]||""];a&&c.push(encodeURIComponent(a));this._userinfo=c.join(":")}},enumerable:!0},host:{get:function(){var a="";this._url&&this._url.host&&(a+=this._url.host,this._url.port&&(a+=":"+this._url.port));return a},
set:function(a){l(a);if(this._url&&(a=v.exec(a)))this._url.host=a[1],this._url.port=/[1-9]\d*$/.exec(a[2])[0]},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){l(a);if(this._url&&u.exec(a))this._url.host=a},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===D[this.protocol]&&(a="");return a},set:function(a){l(a);if(this._url&&t.exec(a))this._url.port=/[1-9]\d*$/.exec(a)[0]},enumerable:!0},pathname:{get:function(){return this._url?
this._url.path:""},set:function(a){l(a);if(this._url&&r.exec(a))this._url.host&&a&&a[0]!=="/"&&(a="/"+a),this._url.path=a?g(a):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){l(a);if(this._url&&(a&&a[0]==="?"&&(a=a.substring(1)),q.exec(a)))this._url.query=a},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){l(a);if(this._url&&(a&&a[0]==="#"&&(a=a.substring(1)),y.exec(a)))this._url.fragment=
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/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(l,j){function h(a,c){var e=Object.keys(a),g=Object.keys(c);if(e.length!==g.length)return!1;e.sort();g.sort();for(var b=0,d=e.length;b<d;b++){var f=e[b];if(f!==g[b])return!1;var k=a[f],f=c[f];if(k!==f&&JSON.stringify(k)!==JSON.stringify(f))return!1}return!0}function f(a){if(a.indexOf("://")===-1)try{return(new URL(a,location.href)).href}catch(c){}return a}function d(a){var c=null,e={key:function(e){return(c=
c||Object.keys(a))[e]},getItem:function(c){return a[c]},setItem:function(e,g){a[e]=g;c=null},removeItem:function(e){delete a[e];c=null},clear:function(){(c=c||Object.keys(a)).forEach(function(c){delete a[c]}.bind(this));c=null}};Object.defineProperty(e,"length",{get:function(){return(c=c||Object.keys(a)).length}});return e}function k(a,c){if(c&&c instanceof XMLHttpRequest){var e,g;try{e=c.status,g=c.statusText}catch(b){e=0,g=""}return{status:e||0,statusText:g}}return c}function b(a){var c=a?JSON.parse(JSON.stringify(a,
k)):a;if(a instanceof Error)c.__isError=!0,c.message=c.message||a.message,c.name=c.name||a.name;return c}function g(a,c){this.type=a;this.plugin=c}function a(a,c){this.__objectId=a;this.__methods=c}function e(c,e,d){function f(a){E&&d.postMessage(a,E)}function k(c){if(!E)return(new l).reject(Error("plugin not connected"));c.id=String(Y++);var e=new l;Q[c.id]=e;e.then(null,function(a){x==="active"&&a instanceof Error&&a.name==="Cancel"&&f({requestId:c.id,method:"cancel",params:a.message?[a.message]:
[]})});var i=Object.prototype.toString;c.params.forEach(function(g,b){if(i.call(g)==="[object Object]"&&!(g instanceof a)){var d,m;for(d in g)i.call(g[d])==="[object Function]"&&(m=m||[],m.push(d));if(m){var f=M++;O[f]=g;d=function(){delete O[f]};e.then(d,d);c.params[b]=new a(f,m)}}});d.postMessage(c,E);return e.promise}function t(a,c){a||a===0?f({id:a,result:null,error:c}):console.log(c)}function u(a,c,e,i){i.forEach(function(a,c){if(a&&typeof a.__objectId!=="undefined"){var e={};a.__methods.forEach(function(c){e[c]=
function(){return k({objectId:a.__objectId,method:c,params:Array.prototype.slice.call(arguments)})}});i[c]=e}});var g=typeof a===void 0?null:{id:a,result:null,error:null};try{var d=e.apply(c,i);if(g)d&&typeof d.then==="function"?(N[a]=d,d.then(function(c){delete N[a];g.result=c;f(g)},function(c){if(N[a])delete N[a],g.error=b(c),f(g)},function(){f({responseId:a,method:"progress",params:Array.prototype.slice.call(arguments)})})):(g.result=d,f(g))}catch(m){if(g)g.error=b(m),f(g)}}function v(a){try{if(a.method){var c=
a.method,e=a.params||[];if("serviceId"in a){var i=V[a.serviceId];i||t(a.id,"service not found");c in i?u(a.id,i,i[c],e):t(a.id,"method not found")}else if("objectId"in a){var g=O[a.objectId];g||t(a.id,"object not found");c in g?u(a.id,g,g[c],e):t(a.id,"method not found")}else if("requestId"in a){var b=N[a.requestId];b&&c==="cancel"&&b.cancel&&b.cancel.apply(b,e)}else if("responseId"in a){var m=Q[a.responseId];m&&c==="progress"&&m.progress&&m.progress.apply(m,e)}else if("plugin"===a.method){var f=
a.params[0];P({headers:f.headers,services:f.services}).then(function(){F.resolve(B)})}else if("timeout"===a.method)F&&F.reject(a.error);else throw Error("Bad method: "+a.method);}else{var k=Q[String(a.id)];delete Q[String(a.id)];if(a.error){var h=d.handleServiceError(B,a.error);k.reject(h)}else k.resolve(a.result)}}catch(p){console.log("Plugin._messageHandler "+p)}}function r(c){var e={};if(c.methods&&(c.methods.forEach(function(a){e[a]=function(){var e={serviceId:c.serviceId,method:a,params:Array.prototype.slice.call(arguments)};
return x==="active"?k(e):B.start({"transient":!0}).then(function(){return k(e)})}}),e.addEventListener&&e.removeEventListener)){var i=new j,g=M++;O[g]={handleEvent:i.dispatchEvent.bind(i)};var b=new a(g,["handleEvent"]),d=e.addEventListener;e.addEventListener=function(a,c){i._namedListeners[a]||d(a,b);i.addEventListener(a,c)};var m=e.removeEventListener;e.removeEventListener=function(a,c){i.removeEventListener(a,c);i._namedListeners[a]||m(a,b)}}return e}function q(a){var e=JSON.parse(JSON.stringify(a.properties));
e.__plugin__=c;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);e.objectClass=a;return e}function y(a){var c=r(a),e=q(a),e=d.registerService(a.names||a.type,c,e);I[a.serviceId]={registration:e,proxy:c}}function z(){d.persist(c,{created:D,headers:H,services:C,autostart:s,lastModified:A})}var B=this,e=e||{},D=e.created||(new Date).getTime(),H=e.headers||{},C=e.services||[],s=e.autostart,A=e.lastModified||0,x="installed",w,F,E,I={},Y=0,M=0,N={},Q={},O={},V={},P;this._persist=z;this._resolve=function(){x=
"resolved";d.dispatchEvent(new g("resolved",B))};this._getAutostart=function(){return s};this._getCreated=function(){return D};this.getLocation=function(){return c};this.getHeaders=function(){return JSON.parse(JSON.stringify(H))};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(I).forEach(function(c){a.push(I[c].registration.getReference())});
return a};this.getState=function(){return x};this.start=function(a){if(x==="uninstalled")return(new l).reject(Error("Plugin is uninstalled"));if(w)return w.promise.then(this.start.bind(this,a));if(x==="active")return(new l).resolve();if(!a||!a.transient){var e=a&&a.lazy?"lazy":"started";e!==s&&(s=e,z())}e=d.getState();if(e!=="starting"&&e!=="active")return a.transient?(new l).reject(Error("start transient error")):(new l).resolve();if(x==="installed")try{this._resolve()}catch(b){return(new l).reject(b)}x===
"resolved"&&C.forEach(function(a){y(a)});if(a&&a.lazy)return x!=="starting"&&(x="starting",d.dispatchEvent(new g("lazy activation",B))),(new l).resolve();var m=new l;w=m;x="starting";d.dispatchEvent(new g("starting",B));F=new l;E=d.connect(c,v);F.then(function(){F=null;x="active";d.dispatchEvent(new g("started",B));w=null;m.resolve()},function(){F=null;x="stopping";d.dispatchEvent(new g("stopping",B));Object.keys(I).forEach(function(a){I[a].registration.unregister();delete I[a]});d.disconnect(E);
E=null;x="resolved";w=null;d.dispatchEvent(new g("stopped",B));m.reject(Error("plugin activation error"))});return m.promise};this.stop=function(a){if(x==="uninstalled")return(new l).reject(Error("Plugin is uninstalled"));if(w)return w.promise.then(this.stop.bind(this,a));if((!a||!a.transient)&&"stopped"!==s)s="stopped",z();if(x!=="active"&&x!=="starting")return(new l).resolve();w=a=new l;x="stopping";d.dispatchEvent(new g("stopping",B));Object.keys(I).forEach(function(a){I[a].registration.unregister();
delete I[a]});E&&(d.disconnect(E),E=null);x="resolved";w=null;d.dispatchEvent(new g("stopped",B));a.resolve();return a.promise};P=function(a){if(x==="uninstalled")return(new l).reject(Error("Plugin is uninstalled"));if(!a)return A===0&&(A=(new Date).getTime(),z()),d.loadManifest(c).then(P);var e=H,b=C,m=s;H=a.headers||{};C=a.services||{};s=a.autostart||s;a.lastModified?A=a.lastModified:(A=(new Date).getTime(),z());if(h(H,e)&&h(C,b)&&s===m)return(new l).resolve();if(x==="active"||x==="starting"){var f=
[];Object.keys(C).forEach(function(a){var c=C[a];f.push(a);var e=I[a];if(e){if(h(c.methods,Object.keys(e.proxy))){var a=q(c),i=e.registration.getReference(),g={};i.getPropertyKeys().forEach(function(a){g[a]=i.getProperty(a)});h(a,g)||e.registration.setProperties(a);return}e.registration.unregister();delete I[a]}y(c)});Object.keys(I).forEach(function(a){f.indexOf(a)===-1&&(I[a].registration.unregister(),delete I[a])})}x==="active"&&(d.disconnect(E),F=new l,E=d.connect(c,v),F.then(function(){F=null},
function(){F=null;x="stopping";d.dispatchEvent(new g("stopping"),B);Object.keys(I).forEach(function(a){I[a].registration.unregister();delete I[a]});d.disconnect(E);E=null;x="resolved";d.dispatchEvent(new g("stopped",B))}));return(new l).resolve()};this.update=function(a){return P(a).then(function(){d.dispatchEvent(new g("updated",B))})};this.uninstall=function(){if(x==="uninstalled")return(new l).reject(Error("Plugin is uninstalled"));if(x==="active"||x==="starting"||x==="stopping")return this.stop().then(this.uninstall.bind(this),
this.uninstall.bind(this));d.removePlugin(this);x="uninstalled";d.dispatchEvent(new g("uninstalled",B));return(new l).resolve()}}var c=/^http[s]?/i;return{Plugin:e,PluginRegistry:function(a,b){function o(a){var c=a.source;u.some(function(e){if(c===e.target){try{var i;if(typeof e.useStructuredClone==="undefined"){var g=typeof a.data!=="string";i=g?a.data:JSON.parse(a.data);e.useStructuredClone=g}else i=e.useStructuredClone?a.data:JSON.parse(a.data);e.handler(i)}catch(b){}return!0}})}var b=b||{},k=
b.storage||localStorage;k.getItem||(k=d(k));var h="installed",t=[],u=[],v=new j,r={},q={registerService:a.registerService.bind(a),connect:function(a,c,e){function i(a){a=Error(a);a.name="timeout";c({method:"timeout",error:a})}var g={handler:c,url:a},d=setTimeout(i.bind(null,"Load timeout for: "+a),e||15E3),f=document.createElement("iframe");f.name=a+"_"+(new Date).getTime();if(!b.visible)f.style.display="none",f.style.visibility="hidden";f.src=a;f.onload=function(){clearTimeout(d);setTimeout(i.bind(null,
"Plugin handshake timeout for: "+a),5E3)};f.sandbox="allow-scripts allow-same-origin";document.body.appendChild(f);g.target=f.contentWindow;g.close=function(){f&&(document.body.removeChild(f),f=null)};u.push(g);return g},disconnect:function(a){for(var c=0;c<u.length;c++)if(a===u[c]){u.splice(c,1);try{a.close()}catch(e){}break}},removePlugin:function(a){for(var c=0;c<t.length;c++)if(a===t[c]){t.splice(c,1);break}k.removeItem("plugin."+a.getLocation())},persist:function(a,c){k.setItem("plugin."+a,JSON.stringify(c))},
postMessage:function(a,c){c.target.postMessage(c.useStructuredClone?a:JSON.stringify(a),c.url)},dispatchEvent:function(a){try{v.dispatchEvent(a)}catch(c){console&&console.log("PluginRegistry.dispatchEvent "+c)}},loadManifest:function(a){var c=new l,e=q.connect(a,function(a){e&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],q.disconnect(e),e=null,c.resolve(a)):"timeout"===a.method&&(q.disconnect(e),e=null,c.reject(a.error)))});return c.promise},getState:function(){return h},handleServiceError:function(a,
e){if(e&&e.status===401){var i=a.getHeaders(),g=a.getName()||a.getLocation(),b=document.createElement("span");b.appendChild(document.createTextNode("Authentication required for: "+g+"."));if(i.login)b.appendChild(document.createTextNode(" ")),g=document.createElement("a"),g.target="_blank",g.textContent="Login",g.href=i.login,c.test(g.href)?(b.appendChild(g),b.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+i.login);return{Severity:"Error",HTML:!0,
Message:(new XMLSerializer).serializeToString(b)}}if(e.__isError){var d=e,e=Error(d.message);Object.keys(d).forEach(function(a){e[a]=d[a]});delete e.__isError}return e}};this.getLocation=function(){return"System"};this.getHeaders=function(){return{}};this.getName=function(){return"System"};this.getVersion=function(){return"0.0.0"};this.getLastModified=function(){return 0};this.getState=q.getState;this.init=function(){if(!(h==="starting"||h==="active"||h==="stopping")){addEventListener("message",o,
!1);for(var a=[],c=0,i=k.length;c<i;c++)a.push(k.key(c));a.forEach(function(a){if(a.indexOf("plugin.")===0){var c=a.substring(7),a=JSON.parse(k.getItem(a));a.created&&t.push(new e(c,a,q))}});t.sort(function(a,c){return a._getCreated()<c._getCreated()?-1:1});b.plugins&&Object.keys(b.plugins).forEach(function(a){a=f(a);if(!this.getPlugin(a)){var c=b.plugins[a],c=typeof c==="object"||{};c.autostart=c.autostart||b.defaultAutostart||"lazy";t.push(new e(a,c,q))}}.bind(this));h="starting"}};this.start=function(){h!==
"starting"&&this.init();if(h!=="starting")return(new l).reject("Cannot start framework. Framework is already "+h+".");var a=[],c=(new Date).getTime();t.forEach(function(e){var i=e._getAutostart();e.getLastModified()===0?a.push(e.update().then(function(){if("started"===i)return e.start({"transient":!0});if("lazy"===i)return e.start({lazy:!0,"transient":!0});e._resolve()})):"started"===i?a.push(e.start({"transient":!0})):"lazy"===i?(a.push(e.start({lazy:!0,"transient":!0})),c>e.getLastModified()+864E5&&
e.update()):e._resolve()});return l.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){h="active"})};this.stop=function(){if(h!=="starting"&&h!=="active")return(new l).reject("Cannot stop registry. Registry is already "+h+".");h="stopping";var a=[];t.forEach(function(c){a.push(c.stop({"transient":!0}))});return l.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){removeEventListener("message",o);h="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};
this.uninstall=function(){return(new l).reject("Cannot uninstall registry")};this.installPlugin=function(a,c){var a=f(a),i=this.getPlugin(a);if(i)return(new l).resolve(i);if(r[a])return r[a];if(c)return i=new e(a,c,q),t.push(i),i._persist(),q.dispatchEvent(new g("installed",i)),(new l).resolve(i);var b=q.loadManifest(a).then(function(c){i=new e(a,c,q);t.push(i);i._persist();delete r[a];q.dispatchEvent(new g("installed",i));return i},function(c){delete r[a];throw c;});return r[a]=b};this.getPlugins=
function(){return t.slice()};this.getPlugin=function(a){var c=null,a=f(a);t.some(function(e){if(a===e.getLocation())return c=e,!0});return c};this.addEventListener=v.addEventListener.bind(v);this.removeEventListener=v.removeEventListener.bind(v);this.resolvePlugins=function(){var a=!0;t.forEach(function(c){a=a&&c._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function l(f,d){function k(c){var e=c.getProperty("service.id"),i=this.addingService(c);i&&(g[e]=c,a[e]=i)}function b(c){var e=c.getProperty("service.id"),i=a[e];delete g[e];delete a[e];this.removedService(c,i)}this.serviceRegistry=f;var g={},a={},e=j,c,i;this.close=function(){if(e!==h)throw"Already closed";e=j;f.removeEventListener("registered",c);f.removeEventListener("unregistering",i);i=c=null;var a=this;this.getServiceReferences().forEach(function(c){b.call(a,
c)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){var a=Object.keys(g);return!a.length?null:a.map(function(a){return g[a]})};this.open=function(){if(e!==j)throw"Already open";e=h;var a=this;c=function(c){if(c.serviceReference.getProperty("objectClass").indexOf(d)!==-1&&(k.call(a,c.serviceReference),typeof a.onServiceAdded==="function"))return a.onServiceAdded(c.serviceReference,a.serviceRegistry.getService(c.serviceReference))};i=function(c){c.serviceReference.getProperty("objectClass").indexOf(d)!==
-1&&b.call(a,c.serviceReference)};f.addEventListener("registered",c);f.addEventListener("unregistering",i);f.getServiceReferences(d).forEach(function(c){k.call(a,c)});if(typeof this.onOpen==="function")this.onOpen()}}var j=0,h=1;l.prototype={addingService:function(f){return this.serviceRegistry.getService(f)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return l});
define("orion/objects",[],function(){function l(j){for(var h=1;h<arguments.length;h++){var f=arguments[h],d;for(d in f)Object.prototype.hasOwnProperty.call(f,d)&&(j[d]=f[d])}return j}return{clone:function(j){if(Array.isArray(j))return Array.prototype.slice.call(j);var h=Object.create(Object.getPrototypeOf(j));l(h,j);return h},mixin:l,toArray:function(j){return Array.isArray(j)?j:[j]}}});
define("orion/config",["orion/Deferred","orion/serviceTracker","orion/objects"],function(l,j,h){var f,d,k,b,g,a="pid";f=function(c,e,g){function b(a,c,g){c.forEach(function(b,d){try{var f=a[d].getProperty("__plugin__"),m=f&&e.getPlugin(f);(!f||m&&m.getState()==="active")&&c[d].updated(g)}catch(k){typeof console!=="undefined"&&console.log(k)}})}j.call(this,c,"orion.cm.managedservice");var d={},f={},k=function(e){var i=[];e.plugin.getServiceReferences().forEach(function(e){if(e.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var b=e.getProperty(a),e=c.getService(e);b&&e&&(b=(b=g._find(b))&&b.getProperties(),i.push(e.updated(b)))}});return l.all(i)};this.addingService=function(e){var i=e.getProperty(a),g=c.getService(e);if(!i||!g)return null;d[i]||(d[i]=[]);f[i]||(f[i]=[]);d[i].push(e);f[i].push(g);return g};this.onServiceAdded=function(c,e){var i=c.getProperty(a),i=g._find(i);b([c],[e],i&&i.getProperties())};this.onOpen=function(){e.addEventListener("started",k)};this.onClose=function(){e.removeEventListener("started",
k)};this.notifyUpdated=function(a){var c=a.getPid();b(d[c]||[],f[c]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();b(d[a]||[],f[a]||[],null)};this.removedService=function(c,e){var i=c.getProperty(a),g=d[i],b=f[i];g.length>1?g.splice(g.indexOf(c),1):delete d[i];b.length>1?b.splice(b.indexOf(e),1):delete f[i]}};d=function(){function a(c,e,g){this.store=new k(this,g);this.configAdmin=new b(this,this.store);this.tracker=new f(c,e,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}();b=function(){function a(c,e){this.factory=c;this.store=e}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 e="/cm/configurations";
k=function(){function c(c,b){this.factory=c;this.prefsService=b;this.configs=Object.create(null);this.pref=null;var d=this;this.initPromise=this.prefsService.getPreferences(e).then(function(c){d.pref=c;c.keys().forEach(function(e){if(!d.configs[e]){var i=c.get(e);typeof i==="object"&&i!==null&&Object.keys(i).length>0&&(i[a]=e,d.configs[e]=new g(d.factory,d,i))}})})}c.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 g(this.factory,this,a),this.configs[a]=c);return c},list:function(){var a=this,c=[];this.pref.keys().forEach(function(e){(e=a._find(e))&&e.getProperties()!==null&&c.push(e)});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 c}();g=function(){function c(c,e){e=h.clone(e);delete e[a];c.properties=e}function e(i,g,b){this.factory=i;this.store=g;if(b!==null&&typeof b==="object")this.pid=b[a],c(this,
b);else if(typeof b==="string")this.pid=b,this.properties=null;else throw Error("Invalid pid/properties "+b);}e.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(c){this._checkRemoved();var e=null;if(this.properties&&(e=h.clone(this.properties),!c))e[a]=this.pid;return e},remove:function(){this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=
!0},update:function(a){this._checkRemoved();c(this,a);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return e}();return{ConfigurationAdminFactory:d}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(l,j,h,f,d,k){var b;return{startup:function(){if(b)return b;b=new j;var g=new h.ServiceRegistry,a=new f.PreferencesService(g);return a.getPreferences("/plugins").then(function(e){var c={plugins:{}};e.keys().forEach(function(a){var i=l.toUrl(a);c.plugins[i]=e[a]});var i=new d.PluginRegistry(g,c);return i.start().then(function(){if(g.getServiceReferences("orion.core.preference.provider").length>
0)return a.getPreferences("/plugins",a.USER_SCOPE).then(function(a){var c=[];a.keys().forEach(function(a){a=l.toUrl(a);i.getPlugin(a)||c.push(i.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return j.all(c,function(a){console.log(a)})})}).then(function(){return(new k.ConfigurationAdminFactory(g,i,a)).getConfigurationAdmin().then(g.registerService.bind(g,"orion.cm.configadmin"))}).then(function(){var a=g.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){setTimeout(function(){window.location=a},0)})}),e=localStorage.getItem("lastLogin");if(!e||e<(new Date).getTime()-9E5)return c}}).then(function(){var c={serviceRegistry:g,preferences:a,pluginRegistry:i};b.resolve(c);return c})})}}});
define("orion/util",[],function(){var l=navigator.userAgent,j=l.indexOf("MSIE")!==-1||l.indexOf("Trident")!==-1?document.documentMode:void 0,h=parseFloat(l.split("Firefox/")[1]||l.split("Minefield/")[1])||void 0,f=l.indexOf("Opera")!==-1,d=parseFloat(l.split("Chrome/")[1])||void 0,k=l.indexOf("Safari")!==-1&&!d,b=parseFloat(l.split("WebKit/")[1])||void 0,g=l.indexOf("Android")!==-1,a=l.indexOf("iPad")!==-1,l=l.indexOf("iPhone")!==-1,e=a||l,c=navigator.platform.indexOf("Mac")!==-1,i=navigator.platform.indexOf("Win")!==
-1,m=navigator.platform.indexOf("Linux")!==-1;return{formatMessage:function(a){var c=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,e){return c[(e<<0)+1]})},createElement:function(a,c){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",c):a.createElement(c)},isIE:j,isFirefox:h,isOpera:f,isChrome:d,isSafari:k,isWebkit:b,isAndroid:g,isIPad:a,isIPhone:l,isIOS:e,isMac:c,isWindows:i,isLinux:m,platformDelimiter:i?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(l){function j(g,a){a||(a=document);return a.querySelectorAll(g)}function h(g){if(g.tabIndex>=0)return g;if(g.hasChildNodes())for(var a=0;a<g.childNodes.length;a++){var e=h(g.childNodes[a]);if(e)return e}return null}function f(g){if(g.tabIndex>=0)return g;if(g.hasChildNodes())for(var a=g.childNodes.length-1;a>=0;a--){var e=f(g.childNodes[a]);if(e)return e}return null}function d(g,a){if(g.nodeType===3){var e=k.exec(g.nodeValue);e&&e.length>1&&a(g,
e)}if(g.hasChildNodes())for(e=0;e<g.childNodes.length;e++)d(g.childNodes[e],a)}var k=/\$\{([^\}]+)\}/,b=null;return{$:function(g,a){a||(a=document);return a.querySelector(g)},$$:j,$$array:function(g,a){return Array.prototype.slice.call(j(g,a))},node:function(g){var a=g;typeof g==="string"&&(a=document.getElementById(g));return a},contains:function(g,a){if(!g||!a)return!1;if(g===a)return!0;var e=g.compareDocumentPosition(a);return Boolean(e&16)},bounds:function(g){g=g.getBoundingClientRect();return{left:g.left+
document.body.scrollLeft,top:g.top+document.body.scrollTop,width:g.width,height:g.height}},empty:function(g){for(;g.hasChildNodes();)g.removeChild(g.firstChild)},firstTabbable:h,lastTabbable:f,stop:function(g){if(window.document.all)g.keyCode=0;g.preventDefault&&(g.preventDefault(),g.stopPropagation())},processTextNodes:function(g,a){d(g,function(e,c){e.parentNode.replaceChild(document.createTextNode(a[c[1]]||c[1]),e)})},processDOMNodes:function(g,a){d(g,function(e,c){var i=a[c[1]];if(i){var g=document.createRange(),
b=c.index;g.setStart(e,b);g.setEnd(e,b+c[0].length);g.deleteContents();g.insertNode(i)}})},addAutoDismiss:function(g,a){function e(a){b.forEach(function(e){var g=!1,b=e.excludeNodes.some(function(e){return document.body.contains(e)?(g=!0,e.contains(a.target)):!1});if(g&&!b)try{e.dismiss()}catch(d){typeof console!=="undefined"&&console&&console.error(d&&d.message)}});b=b.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}b===null&&(b=[],document.addEventListener("click",
e,!0),l.isIOS&&document.addEventListener("touchend",function(a){function e(){a.target.removeEventListener("click",e)}a.touches.length===0&&a.target.addEventListener("click",e)},!1));b.push({excludeNodes:g,dismiss:a})},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/webui/dropdown",["require","orion/webui/littlelib"],function(l,j){function h(f){this._init(f)}h.prototype={_init:function(f){this._dropdownNode=j.node(f.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._triggerNode=j.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";this._populate=f.populate;this._selectionClass=f.selectionClass;var d=this;this._triggerNode.addEventListener("click",function(f){d.toggle()&&
j.stop(f)},!1);this._triggerNode.tagName.toLowerCase()==="span"&&this._triggerNode.addEventListener("keydown",function(f){if(f.keyCode===j.KEY.ENTER||f.keyCode===j.KEY.SPACE)d.toggle(),j.stop(f)},!1);this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},toggle:function(){return this.isVisible()?this.close():this.open()},isVisible:function(){return this._triggerNode.classList.contains("dropdownTriggerOpen")},open:function(){if(!this.isVisible()){this._populate&&(this.empty(),
this._populate(this._dropdownNode));var f=this.getItems();if(f.length>0){if(!this._hookedAutoDismiss){var d=j.$$(".dropdownSubMenu",this._dropdownNode);j.addAutoDismiss([this._triggerNode].concat(Array.prototype.slice.call(d)),function(){if(this.isVisible()){this.close();for(var d=this._dropdownNode.parentNode;d;)d.dropdown&&typeof d.dropdown.close==="function"&&d.dropdown.close(),d=d.parentNode}}.bind(this));this._hookedAutoDismiss=!0}this._triggerNode.classList.add("dropdownTriggerOpen");this._selectionClass&&
this._triggerNode.classList.add(this._selectionClass);this._dropdownNode.classList.add("dropdownMenuOpen");this._positionDropdown();f[0].focus();return!0}return!1}},_positionDropdown:function(){this._dropdownNode.style.left="";var f=j.bounds(this._dropdownNode),d=j.bounds(document.body);if(f.left+f.width>d.left+d.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-f.width+"px";else{var d=j.bounds(this._boundingNode(this._triggerNode)),k=j.bounds(this._triggerNode);
this._dropdownNode.style.left=k.left-d.left-f.width+k.width+"px"}},_boundingNode:function(f){var d=window.getComputedStyle(f,null);return d===null?f:d.getPropertyValue("position")==="absolute"||!f.parentNode||f===document.body?f:this._boundingNode(f.parentNode)},close:function(f){if(this.isVisible())return this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),
f&&this._triggerNode.focus(),!0},getItems:function(){var f=[],d=this;j.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(k){k.parentNode.parentNode===d._dropdownNode&&f.push(k)});return f},empty:function(){var f=this;j.$$array("li",this._dropdownNode).forEach(function(d){d.parentNode===f._dropdownNode&&d.parentNode.removeChild(d)})},_dropdownKeyDown:function(f){if(f.keyCode===j.KEY.UP||f.keyCode===j.KEY.DOWN||f.keyCode===j.KEY.RIGHT||f.keyCode===j.KEY.ENTER||
f.keyCode===j.KEY.LEFT){var d=this.getItems(),k=document.activeElement;if(d.length&&d.length>0&&k){var b=d.indexOf(k);b<0&&(b=d.indexOf(k.parentNode));b>=0&&(f.keyCode===j.KEY.UP&&b>0?(b--,d[b].focus()):f.keyCode===j.KEY.DOWN&&b<d.length-1?(b++,d[b].focus()):f.keyCode===j.KEY.ENTER||f.keyCode===j.KEY.RIGHT?k.classList.contains("dropdownTrigger")&&k.dropdown&&k.dropdown.open():f.keyCode===j.KEY.LEFT&&k.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),j.stop(f))}}else f.keyCode===
j.KEY.ESCAPE&&(this.close(!0),j.stop(f))}};h.prototype.constructor=h;return{Dropdown:h}});
define("text",["module"],function(l){var j,h,f=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],d=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,k=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,b=typeof location!=="undefined"&&location.href,g=b&&location.protocol&&location.protocol.replace(/\:/,""),a=b&&location.hostname,e=b&&(location.port||void 0),c=[],i=l.config&&l.config()||{};j={version:"2.0.5",strip:function(a){if(a){var a=a.replace(d,""),c=a.match(k);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").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:i.createXhr||function(){var a,c,e;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(c=0;c<3;c+=1){e=f[c];try{a=new ActiveXObject(e)}catch(i){}if(a){f=[e];break}}return a},parseName:function(a){var c,
e,i=!1,g=a.indexOf(".");c=a.indexOf("./")===0||a.indexOf("../")===0;g!==-1&&(!c||g>1)?(c=a.substring(0,g),e=a.substring(g+1,a.length)):c=a;a=e||c;g=a.indexOf("!");g!==-1&&(i=a.substring(g+1)==="strip",a=a.substring(0,g),e?e=a:c=a);return{moduleName:c,ext:e,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,c,e,i){var g,b;g=j.xdRegExp.exec(a);if(!g)return!0;a=g[2];g=g[3];g=g.split(":");b=g[1];g=g[0];return(!a||a===c)&&(!g||g.toLowerCase()===e.toLowerCase())&&(!b&&!g||b===i)},finishLoad:function(a,
e,g,b){g=e?j.strip(g):g;i.isBuild&&(c[a]=g);b(g)},load:function(c,d,f,k){if(k.isBuild&&!k.inlineText)f();else{i.isBuild=k.isBuild;var h=j.parseName(c),k=h.moduleName+(h.ext?"."+h.ext:""),l=d.toUrl(k),v=i.useXhr||j.useXhr;!b||v(l,g,a,e)?j.get(l,function(a){j.finishLoad(c,h.strip,a,f)},function(a){f.error&&f.error(a)}):d([k],function(a){j.finishLoad(h.moduleName+"."+h.ext,h.strip,a,f)})}},write:function(a,e,i){if(c.hasOwnProperty(e)){var g=j.jsEscape(c[e]);i.asModule(a+"!"+e,"define(function () { return '"+
g+"';});\n")}},writeFile:function(a,c,e,i,g){var c=j.parseName(c),b=c.ext?"."+c.ext:"",d=c.moduleName+b,f=e.toUrl(c.moduleName+b)+".js";j.load(d,e,function(){var c=function(a){return i(f,a)};c.asModule=function(a,c){return i.asModule(a,f,c)};j.write(a,d,c,g)},g)}};if(i.env==="node"||!i.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)h=require.nodeRequire("fs"),j.get=function(a,c){var e=h.readFileSync(a,"utf8");e.indexOf("\ufeff")===0&&(e=e.substring(1));c(e)};else if(i.env===
"xhr"||!i.env&&j.createXhr())j.get=function(a,c,e,g){var b=j.createXhr(),d;b.open("GET",a,!0);if(g)for(d in g)g.hasOwnProperty(d)&&b.setRequestHeader(d.toLowerCase(),g[d]);if(i.onXhr)i.onXhr(b,a);b.onreadystatechange=function(){var i;if(b.readyState===4)i=b.status,i>399&&i<600?(i=Error(a+" HTTP status: "+i),i.xhr=b,e(i)):c(b.responseText)};b.send(null)};else if(i.env==="rhino"||!i.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")j.get=function(a,c){var e,i,g=new java.io.File(a),b=java.lang.System.getProperty("line.separator"),
g=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(g),"utf-8")),d="";try{e=new java.lang.StringBuffer;(i=g.readLine())&&i.length()&&i.charAt(0)===65279&&(i=i.substring(1));for(e.append(i);(i=g.readLine())!==null;)e.append(b),e.append(i);d=String(e.toString())}finally{g.close()}c(d)};return j});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<span class="dropdownArrowDown core-sprite-downarrow"></span></button><ul class="dropdownMenu"></ul>'});
define("text!orion/webui/submenutriggerbutton.html",[],function(){return'<li class="dropdownSubMenu"><span class="dropdownTrigger dropdownMenuItem" role="menuitem" tabindex="0">${ButtonText}<span class="dropdownArrowRight core-sprite-closedarrow"></span></span><ul class="dropdownMenu"></ul></li>'});define("text!orion/webui/checkedmenuitem.html",[],function(){return'<li><label class="dropdownMenuItem"><input class="checkedMenuItem" role="menuitem" type="checkbox" />${ItemText}</label></li>'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(l,j){function h(f){this._init(f)}h.prototype={_init:function(f){this._node=j.node(f.node);if(!this._node)throw"no dom node for tooltip found";this._position=f.position||["right","above","below","left"];this._text=f.text;this._hideDelay=f.hideDelay===void 0?200:f.hideDelay;this._tailSize=f.tailSize||10;this._trigger=f.trigger||"mouseover";this._afterShowing=f.afterShowing;this._afterHiding=f.afterHiding;var d=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(b){b.target===d._node&&(d.show(),j.stop(b))},!1);else if(this._trigger==="mouseover"){this._showDelay=f.showDelay===void 0?500:f.showDelay;f=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(b){j.contains(d._node,b.target)&&(d.show(),j.stop(b))},!1);this._leaveHandler=function(b){j.contains(d._node,b.target)&&d.hide()};for(var k=0;k<f.length;k++)this._node.addEventListener(f[k],
this._leaveHandler,!1)}},_makeTipNode:function(){if(!this._tip){this._tip=document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("div");this._tipInner.classList.add("tooltip");if(this._text)this._tipTextContent=document.createElement("div"),this._tipTextContent.classList.add("textContent"),this._tipInner.appendChild(this._tipTextContent),this._tipTextContent.appendChild(document.createTextNode(this._text));this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var f=this;j.addAutoDismiss([this._tip,this._node],function(){f.hide()});if(this._trigger==="mouseover")this._tipInner.role="tooltip",this._tipInner.id="tooltip"+(new Date).getTime().toString(),this._node.setAttribute("aria-describedby",this._tipInner.id),this._tip.addEventListener("mouseover",function(){if(f._timeout)window.clearTimeout(f._timeout),f._timeout=null;f._tip.addEventListener("mouseout",function(d){j.contains(f._tip,d.target)&&(f.hide(),j.stop(d))},
!1)},!1)}return this._tip},_positionTip:function(f,d){this._makeTipNode();f==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var k=this._node,b;for(b=j.bounds(k);k&&!b.width&&!b.height;k=k.parentNode)b=j.bounds(k);var k=j.bounds(this._tipInner),g;switch(f){case "above":g=b.top-k.height-this._tailSize-1;b=b.left-this._tailSize;break;case "below":g=b.top+b.height+this._tailSize+1;b=b.left-this._tailSize;break;case "left":g=b.top-this._tailSize/2;b=b.left-k.width-
this._tailSize-1;break;default:g=b.top-this._tailSize/2,b=b.left+b.width+this._tailSize+1}var a=j.bounds(document.documentElement);if(g+k.height>a.height)if(d)g=a.height-k.height-1;else return!1;if(b+k.width>a.width)if(d)b=a.width-k.width-1;else return!1;if(b<0)if(d)b=4;else return!1;if(g<0)if(d)g=4;else return!1;if(!this._tail&&(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+f),f==="above"||f==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,
this._tipInner),f==="left"))this._tail.style.left=k.width+"px";this._tip.style.top=g+"px";this._tip.style.left=b+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){var f=this;if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){for(var d=!1,k=0;!d&&k<f._position.length;)d=f._positionTip(f._position[k]),k++;d||f._positionTip(f._position[0],
!0);f._tip.classList.add("tooltipShowing");f._afterShowing&&f._afterShowing()},this._showDelay)}},hide:function(f){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(f===void 0)f=this._hideDelay;var d=this;this._timeout=window.setTimeout(function(){d._tip.classList.remove("tooltipShowing");d._tip.removeAttribute("style");d._afterHiding&&d._afterHiding()},f)}},destroy:function(){if(this._timeout)window.clearTimeout(this._timeout),
this._timeout=null;if(this._tip)document.body.removeChild(this._tip),this._tail=this._tipTextContent=this._tipInner=this._tip=null;if(this._node){this._node.removeEventListener("click",this._clickHandler,!1);this._node.removeEventListener("mouseover",this._mouseoverHandler,!1);for(var f=["mouseout","click"],d=0;d<f.length;d++)this._node.removeEventListener(f[d],this._leaveHandler,!1)}}};h.prototype.constructor=h;return{Tooltip:h}});
define("orion/commands","require,orion/util,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip".split(","),function(l,j,h,f,d,k,b,g){function a(a){var c=a.invocation;if(c){var e=a.command;if(e.hrefCallback)return a=e.hrefCallback.call(c.handler||window,c),a.then?a.then(function(a){window.open(a)}):window.open(a),!0;else if(c.commandRegistry)return c.commandRegistry._invoke(c),
!0;else if(e.onClick||e.callback)return window.setTimeout(function(){(e.onClick||e.callback).call(c.handler||window,c)},0),!0}return!1}function e(c,e){for(var i in e)if(e[i]&&e[i].keyBinding&&e[i].command&&e[i].keyBinding.match(c)){var g=e[i],b=g.keyBinding;if((!b.domScope||h.contains(h.node(b.domScope),c.target))&&a(g)){h.stop(c);break}}}function c(a,c,e){c.classList.add("commandImage");var i;a.imageClass?a.addImageClassToElement?c.classList.add(a.imageClass):(i=document.createElement("span"),c.appendChild(i),
i.classList.add(a.spriteClass),i.classList.add(a.imageClass)):(i=new Image,i.alt=a.name,i.name=e,i.id=e,i.src=a.image,c.appendChild(i));return i}function i(a,c,e,i,g){this.commandRegistry=g;this.handler=a;this.items=c;this.userData=e;this.command=i;if(i.parameters)this.parameters=i.parameters.makeCopy();this.id=i.id}function m(a){this._init(a)}var o=null,n={};window.document.addEventListener("keydown",function(a){a=a||window.event;if(function(a){if(j.isMac){if(a.metaKey&&!a.altKey)return!a.shiftKey&&
!a.ctrlKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===90)?!0:!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===90)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return a["char"].length>0;else if(a.charCode||a.keyCode)switch(a=a.charCode||a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return a>=32&&a<112||a>123}return!1}(a)){if(a.target.contentEditable==="true")return;
var c=a.target.nodeName.toLowerCase();if(c==="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(c==="textarea")return}c={};if(o){var i,g,b;g=Object.keys(n);for(i=0;i<g.length;i++)b=g[i],c[b]=n[b];var d=o();g=Object.keys(d);for(i=0;i<g.length;i++)b=g[i],c[b]=d[b]}else c=n;e(a,c)},!1);i.prototype=
{collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(a){var c=new i(this.handler,this.items,this.userData,this.command,this.commandRegistry);c.domNode=this.domNode;c.domParent=this.domParent;if(a)c.parameters=a.makeCopy();else if(this.parameters)c.parameters=this.parameters.makeCopy();return c}};i.prototype.constructor=i;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||l.toUrl("images/none.png");this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.selectionClass=a.selectionClass;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters},populateChoicesMenu:function(a,c,e,i,g){this.getChoices(c,e,i).forEach(function(e){if(e.name){var i=document.createElement("li");a.appendChild(i);var b=document.createElement("span");
b.tabIndex=0;b.role="menuitem";b.classList.add("dropdownMenuItem");var d=document.createTextNode(e.name);b.appendChild(d);i.appendChild(b);b.choice=e;b.addEventListener("click",function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,c)},!1);b.addEventListener("keydown",function(a){(a.keyCode===h.KEY.ENTER||a.keyCode===h.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,c)},!1)}else g._generateMenuSeparator(a)})},getChoices:function(a,c,e){return this.choiceCallback?
this.choiceCallback.call(c,a,e):null},makeChoiceCallback:function(a,c){return function(e){a.callback&&a.callback.call(a,c,e)}},hasImage:function(){return this.imageClass||this.image!==l.toUrl("images/none.png")}};m.prototype.constructor=m;return{Command:m,CommandInvocation:i,createDropdownMenu:function(a,e,i,g,b,m,k){a=h.node(a);if(!a)throw"no parent node was specified";var o=document.createRange();o.selectNode(a);o=o.createContextualFragment(d);h.processTextNodes(o,{ButtonText:e});a.appendChild(o);
a=a.lastChild;o=a.previousSibling;g?o.classList.add(g):(o.classList.add("orionButton"),o.classList.add("commandButton"));if(b){if(!m)o.textContent="",o.setAttribute("aria-label",e);c({spriteClass:"commandSprite",imageClass:b},o,e);o.classList.add("orionButton")}o.dropdown=new f.Dropdown({dropdown:a,populate:i,selectionClass:k});a.dropdown=o.dropdown;return{menuButton:o,menu:a,dropdown:o.dropdown}},createCheckedMenuItem:function(a,c,e,i){a=h.node(a);if(!a)throw"no parent node was specified";var g=
document.createRange();g.selectNode(a);g=g.createContextualFragment(b);h.processTextNodes(g,{ItemText:c});a.appendChild(g);a=h.$(".checkedMenuItem",a.lastChild);a.checked=e;a.addEventListener("change",i,!1);return a},createCommandItem:function(a,e,i,b,d,f,m){var k,f=f||!e.name&&e.hasImage();if(e.hrefCallback)k=document.createElement("a"),k.id=b,f&&e.hasImage()?c(e,k,b):(k.className="commandLink",k.appendChild(document.createTextNode(e.name))),m=e.hrefCallback.call(i.handler,i),m.then?m.then(function(a){k.href=
a}):k.href=m?m:"#";else{k=document.createElement("button");k.className="orionButton";f?e.hasImage()?(c(e,k,b),e.name&&k.setAttribute("aria-label",e.name)):(k.classList.add("commandButton"),k.classList.add("commandMissingImageButton"),k.appendChild(document.createTextNode(e.name))):(k.classList.add("commandButton"),b=document.createTextNode(e.name),k.appendChild(b));var h=m||e.callback;if(h)e.onClick=h,k.addEventListener("click",function(){h.call(i.handler,i)},!1)}a.nodeName.toLowerCase()==="ul"?(m=
document.createElement("li"),a.appendChild(m),a=m):k.classList.add("commandMargins");a.appendChild(k);if(e.tooltip)k.commandTooltip=new g.Tooltip({node:k,text:e.tooltip,position:["above","below","right","left"]});d&&(n[e.id]={keyBinding:d,command:e,invocation:i});return k},createCommandMenuItem:function(a,c,e,i,b){var d,f=a.dropdown;if(c.hrefCallback)d=document.createElement("a"),d.appendChild(document.createTextNode(c.name)),b=c.hrefCallback.call(e.handler,e),b.then?b.then(function(a){d.href=a}):
d.href=b?b:"#",d.addEventListener("keydown",function(a){(a.keyCode===h.KEY.ENTER||a.keyCode===h.KEY.SPACE)&&d.click()},!1);else{d=document.createElement("span");d.tabIndex=0;d.appendChild(document.createTextNode(c.name));var m=b||c.callback;if(m)c.onClick=m,d.addEventListener("click",function(){f.close(!0);m.call(e.handler,e)},!1),d.addEventListener("keydown",function(a){if(a.keyCode===h.KEY.ENTER||a.keyCode===h.KEY.SPACE)a.preventDefault(),d.click()},!1)}if(c.tooltip)d.commandTooltip=new g.Tooltip({node:d,
text:c.tooltip,position:["right","left","above","below"]});d.className="dropdownMenuItem";d.role="menuitem";b=document.createElement("li");a.appendChild(b);b.appendChild(d);i&&(n[c.id]={keyBinding:i,command:c,invocation:e});return d},executeBinding:a,setKeyBindingProvider:function(a){o=a},localKeyBindings:n,_testMethodProcessKey:e}});
define("orion/explorers/navigationUtils",[],function(){function l(h,f){if(!j&&h)h.push({domNode:f}),f.tabIndex=-1,f.style.outline="none"}var j=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(h,f,d){h&&(h=h.getGridNavHolder(f,!0))&&l(h,d)},generateNavGrid:l,removeNavGrid:function(h,f){if(h)for(var d=0;d<h.length;d++)if(h[d].domNode===f){h.splice(d,1);break}}}});
define("orion/PageUtil",[],function(){var l=/^http[s]?/i;return{hash:function(){var j=window.location.href.split("#")[1];return j?"#"+j:""},matchResourceParameters:function(j){var j=j||window.location.toString(),h={resource:""},f=j.indexOf("#");if(f!==-1&&(j=j.substring(f+1),j.length!==0)){j=j.split(",");h.resource=decodeURIComponent(j[0]);for(f=1;f<j.length;f++){var d=/([^=]*)(=?)(.*)/.exec(j[f]),k=decodeURIComponent(d[1]||""),d=decodeURIComponent(d[3]||"");k!==""&&k!=="resource"&&(h[k]=d)}}return h},
validateURLScheme:function(j,h){var f=j;if(j.indexOf("://")===-1){var d=document.createElement("a");d.href=j;f=d.href}d=!1;return(d=h?h.some(function(d){return RegExp("^"+d+":","i").test(f)}):l.test(f))?j:(console.log("Illegal URL Scheme: '"+j+"'"),"")}}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion","Show a list of all the keybindings on this page":"Show a list of all the keybindings on this page","Show Keys":"Show Keys","Hide or show the page banner and footer":"Hide or show the page banner and footer",
"Toggle banner and footer":"Toggle banner and footer","Choose a file by name and open an editor on it":"Choose a file by name and open an editor on it","Find File Named...":"Find File Named...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown",
"Unknown item":"Unknown item","Can't search: no search service is available":"Can't search: no search service is available","could not find banner parent, id was ":"could not find banner parent, id was ",Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy","Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"I20131030-1703","LOG: ":"LOG: ",View:"View","no parent":"no parent",
"no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ","Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?",Operations:"Operations","Operations running":"Operations running","Some operations finished with warning":"Some operations finished with warning","Some operations finished with error":"Some operations finished with error","no service registry":"no service registry",
Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Saved searches":"Saved searches","Recent searches":"Recent searches","Regular expression":"Regular expression","Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations",
"Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site","Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plugin",
"Generate a sample plugin for integrating with Orion.":"Generate a sample plugin for integrating with Orion.",Raw:"Raw","Open the raw file or folder in the browser":"Open the raw file or folder in the browser",OutlineProgress:"Getting outline for ${0} from ${1}",UnknownError:"An unknown error occurred.",UnknownWarning:"An unknown warning occurred."});
define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(l,j){var h={root:j};Object.keys(l).forEach(function(f){typeof h[f]==="undefined"&&(h[f]=l[f])});return h});
define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib"],function(l,j){function h(d){var f="",b=navigator.platform.indexOf("Mac")!==-1;d.mod1&&(f+=b?"Cmd+":"Ctrl+");d.mod2&&(f+="Shift+");d.mod3&&(f+="Alt+");d.mod4&&b&&(f+="Ctrl+");if(d.alphaKey)return f+d.alphaKey;if(d.type==="keypress")return f+d.keyCode;for(var g in j.KEY)if(typeof(j.KEY[g]==="number")&&j.KEY[g]===d.keyCode)return f+g;var a;switch(d.keyCode){case 59:a=d.mod2?":":";";break;case 61:a=d.mod2?"+":"=";break;case 188:a=
d.mod2?"<":",";break;case 190:a=d.mod2?">":".";break;case 191:a=d.mod2?"?":"/";break;case 192:a=d.mod2?"~":"`";break;case 219:a=d.mod2?"{":"[";break;case 220:a=d.mod2?"|":"\\";break;case 221:a=d.mod2?"}":"]";break;case 222:a=d.mod2?'"':"'"}return a?f+a:d.keyCode>=112&&d.keyCode<=123?f+"F"+(d.keyCode-111):f+String.fromCharCode(d.keyCode)}function f(d){var f=window.navigator.platform.indexOf("Mac")!==-1;return f&&d.metaKey||!f&&d.ctrlKey}return{getUserKeyString:function(d){for(var f="",d=d.getKeys(),
b=0;b<d.length;b++)b!==0&&(f+=" "),f+=h(d[b]);return f},getUserText:function(d,f,b,g,a,e,c,i,m){var h=!1,c=function(c){return function(i){if(!h){var n=j.node(d),l=n.value;if(n)if(c&&i.keyCode===j.KEY.ESCAPE){if(b)f.style.display="inline";h=!0;n.parentNode.removeChild(n);e&&e()}else if(!(c&&i.keyCode!==j.KEY.ENTER)){if(l.length===0||!m&&l===g){if(b)f.style.display="inline"}else if(a(l),b&&f.parentNode)f.style.display="inline";h=!0;n.parentNode&&n.parentNode.removeChild(n);e&&e()}}}},n=document.createElement("input");
n.id=d;n.value=g||"";f.parentNode.insertBefore(n,f.nextSibling);n.classList.add("userEditBoxPrompt");if(b)f.style.display="none";n.addEventListener("keydown",c(!0),!1);n.addEventListener("blur",c(!1),!1);window.setTimeout(function(){n.focus();if(g){var a=j.node(d),c=i?g.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:f,followLink:function(d,k){k&&f(k)?window.open(d):window.location=d},createButton:function(d,f){var b=document.createElement("button");b.className="orionButton commandButton commandMargins";b.addEventListener("click",function(g){f();j.stop(g)},!1);d&&b.appendChild(document.createTextNode(d));return b},createDropdownButton:function(){},isFormElement:function(d){switch(d.tagName.toLowerCase()){case "button":case "fieldset":case "form":case "input":case "keygen":case "label":case "legend":case "meter":case "optgroup":case "output":case "progress":case "select":case "textarea":return!0}return!1}}});
define("orion/commandRegistry","require,orion/commands,orion/explorers/navigationUtils,orion/PageUtil,orion/uiUtils,orion/webui/littlelib,orion/webui/dropdown,orion/webui/tooltip,text!orion/webui/checkedmenuitem.html,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html".split(","),function(l,j,h,f,d,k,b,g,a,e,c){function i(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function m(a,c){this.token=a;this.parameterName=c}function o(a,c,e,i,g){this.name=a;this.type=c;this.label=e;this.value=i;this.lines=g||1}function n(a,c,e){this._storeParameters(a);this._hasOptionalParameters=c&&c.hasOptionalParameters;this._options=c;this.optionsRequested=!1;this.getParameters=e;this.clientCollect=c&&c.clientCollect}i.prototype={_init:function(a){this._selectionService=a.selection;var c=this;j.setKeyBindingProvider(function(){return c._activeBindings})},processURL:function(a){for(var c in this._urlBindings)if(this._urlBindings[c]&&
this._urlBindings[c].urlBinding&&this._urlBindings[c].command){var e=this._urlBindings[c].urlBinding.match(a);if(e){var i=this._urlBindings[c],g=i.command,b=i.invocation;if(b&&b.parameters&&g.callback){b.parameters.setValue(e.parameterName,e.parameterValue);var d=this;window.setTimeout(function(){d._invoke(b)},0);break}}}},findCommand:function(a){return this._commandList[a]},runCommand:function(a,c,e,i){c?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(c):1)&&a.callback&&this._invoke(new j.CommandInvocation(e,
c,null,a,this),i):(c=this._urlBindings[a])&&c.command&&c.command.callback&&this._invoke(c.invocation,i)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,c,e){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,c,e))},confirm:function(a,c,e,i,g,b){var d=!1;if(this._parameterCollector&&!g){var f=this;this._parameterCollector.close();if(this._parameterCollector.open(a,
function(a,g){var b=document.createElement("span");b.classList.add("parameterPrompt");b.textContent=c;a.appendChild(b);b=document.createElement("button");b.addEventListener("click",function(){d=!0;f._parameterCollector.close()},!1);g.appendChild(b);b.appendChild(document.createTextNode(e));b.className="dismissButton";var m=document.createElement("button");m.addEventListener("click",function(){d=!1;f._parameterCollector.close()},!1);g.appendChild(m);m.appendChild(document.createTextNode(i));m.className=
"dismissButton";return b},function(){b(d)}))return}d=window.confirm(c);b(d)},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 e=!1;a.parameters.updateParameters(a);
if(a.parameters.shouldCollectParameters()&&(e=this._parameterCollector.collectParameters(a),!e)){var i=new g.Tooltip({node:a.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),e=i.contentContainer();e.classList.add("parameterPopup");var b=window.document.activeElement,d=this._parameterCollector.getFillFunction(a,function(){b&&b.focus();i.destroy()})(e);i.show();window.setTimeout(function(){d.focus();d.select()},0);e=!0}e||a.command.callback.call(a.handler||
window,a)}else a.command.callback.call(a.handler||window,a);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(a){this._collectAndInvoke(a,!0)},showKeyBindings:function(a){function c(a){return function(){j.executeBinding(a)}}var e={},i,g,b=[],f;for(f in this._activeBindings)(g=this._activeBindings[f])&&g.keyBinding&&g.command&&(g.command.name||g.command.tooltip)&&b.push(g);b.sort(function(a,c){return(a.command.name||
a.command.tooltip).localeCompare(c.command.name||c.command.tooltip)});for(f=0;f<b.length;f++)g=b[f],g.keyBinding.scopeName?(e[g.keyBinding.scopeName]||(e[g.keyBinding.scopeName]=[]),e[g.keyBinding.scopeName].push(g)):(i=d.getUserKeyString(g.keyBinding),a.createItem(i,g.command.name||g.command.tooltip,c(g)));for(var m in e)e[m].length&&e[m].length>0&&(a.createHeader(m),e[m].forEach(function(e){i=d.getUserKeyString(e.keyBinding);a.createItem(i,e.command.name||e.command.tooltip,c(e))}))},addCommand:function(a){this._commandList[a.id]=
a;var c=this._pendingBindings[a.id];if(c){var e=this;c.forEach(function(c){e._addBinding(a,c.type,c.binding,c.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,c,e,i,g,b,d,f,m){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];g&&(a=this._createEntryForPath(a,g));if(a[c]){if(i)a[c].title=i;if(e)a[c].position=e;if(d)a[c].imageClass=d;if(f)a[c].tooltip=f;if(m)a[c].selectionClass=m;a[c].emptyGroupMessage=b}else a[c]={title:i,
position:e,emptyGroupMessage:b,imageClass:d,tooltip:f,selectionClass:m,children:{}},a.sortedContributions=null},_createEntryForPath:function(a,c){c&&c.split("/").forEach(function(c){if(c.length>1)a[c]||(a[c]={position:0,children:{}}),a=a[c].children});return a},registerSelectionService:function(a,c){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=c},registerCommandContribution:function(a,c,e,i,g,b,d){this._contributionsByScopeId[a]||
(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];i&&(a=this._createEntryForPath(a,i));a[c]={position:e};b&&((e=this._commandList[c])?this._addBinding(e,"key",b,g):this._addPendingBinding(c,"key",b,g));d&&((e=this._commandList[c])?this._addBinding(e,"url",d,g):this._addPendingBinding(c,"url",d,g));a.sortedContributions=null},_addBinding:function(a,c,e,i){if(!a.id)throw Error("No command id: "+a);c==="key"?this._activeBindings[a.id]={command:a,keyBinding:e,bindingOnly:i}:c==="url"&&
(this._urlBindings[a.id]={command:a,urlBinding:e,bindingOnly:i})},_addPendingBinding:function(a,c,e,i){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:c,binding:e,bindingOnly:i})},_checkForTrailingSeparator:function(a,c,e){var i;if(c==="tool"||c==="button")if((i=a.childNodes.length>0?a.childNodes[a.childNodes.length-1]:null)&&i.classList.contains("commandSeparator"))return e?(a.removeChild(i),!1):!0;if(c==="menu"&&(a=k.$$array("li > *",a),a.length>0&&a[a.length-
1].classList.contains("dropdownSeparator")))if(i=a[a.length-1],e)i.parentNode.parentNode.removeChild(i.parentNode);else return!0;return!1},renderCommands:function(a,c,e,i,g,b,d){if(typeof a!=="string")throw"a scope id for rendering must be specified";c=k.node(c);if(!c)throw"no parent";var f=this._contributionsByScopeId[a];if(!e&&f){var e=f.localSelectionService||this._selectionService,m=this;e&&e.getSelections(function(e){m.renderCommands(a,c,e,i,g,b)})}else f&&(this._render(this._contributionsByScopeId[a],
c,e,i,g||"button",b,d),this._checkForTrailingSeparator(c,g,!0))},destroy:function(a){a=k.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,c,e,i,b,d,f){var m=a.sortedContributions;if(!m){var m=[],k=!1,o;for(o in a)if(Object.prototype.hasOwnProperty.call(a,o)){var n=a[o];if(n&&typeof n.position==="number")n.id=o,m.push(n),k=!0}if(k)m.sort(function(a,
c){return a.position-c.position}),a.sortedContributions=m}var l=0,s=this;m.forEach(function(a){var m,k;if(!a.imageClass)a.imageClass=null;if(a.children&&Object.getOwnPropertyNames(a.children).length>0){m=a.children;var o;if(b==="tool"||b==="button")if(a.title)o=s._createDropdownMenu(c,a.title,null,null,a.imageClass,a.tooltip,a.selectionClass),f&&h.generateNavGrid(f,o.menuButton),window.setTimeout(function(){s._render(a.children,o.menu,e,i,"menu",d,f);s._checkForTrailingSeparator(o.menu,"menu",!0);
if(o.menu.childNodes.length===0)if(a.emptyGroupMessage){if(!o.menuButton.emptyGroupTooltip)o.menuButton.emptyGroupTooltip=new g.Tooltip({node:o.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})}else f&&h.removeNavGrid(f,o.menuButton),o.menu.parentNode&&o.menu.parentNode.removeChild(o.menu),o.destroyButton&&o.destroyButton.parentNode&&o.destroyButton.parentNode.removeChild(o.destroyButton);else o.menuButton.style.visibility="visible"},0);else{var n;c.childNodes.length>
0&&!s._checkForTrailingSeparator(c,b)&&(n=s.generateSeparatorImage(c));s._render(m,c,e,i,b,d,f);c.childNodes.length>0&&c.childNodes[c.childNodes.length-1]!==n&&(n=s.generateSeparatorImage(c))}else if(a.title){if(n=s._createDropdownMenu(c,a.title,!0,null,null,a.imageClass))s._render(m,n.menu,e,i,"menu",d,f),n.menu.childNodes.length===0&&n.destroyButton&&c.removeChild(n.destroyButton)}else c.childNodes.length>0&&s._generateMenuSeparator(c),s._render(m,c,e,i,b,d,f),s._generateMenuSeparator(c)}else{var p=
s._commandList[a.id];m=p?!0:!1;var z=null,z=null;if(p){k=new j.CommandInvocation(i,e,d,p,s);k.domParent=c;n=m&&(p.visibleWhen?p.visibleWhen(e):!0);if(s._activeBindings[p.id]&&s._activeBindings[p.id].keyBinding)z=s._activeBindings[p.id],z.invocation=n?k:null,z.bindingOnly&&(m=!1);if(s._urlBindings[p.id]&&s._urlBindings[p.id].urlBinding)z=s._urlBindings[p.id],z.invocation=n?k:null,z.bindingOnly&&(m=!1);m=m&&n}if(m)p.choiceCallback?(b==="tool"||b==="button"?(m=c,n=!1,c.nodeName.toLowerCase()==="ul"&&
(m=document.createElement("li"),c.appendChild(m))):(m=c,n=!0),s._createDropdownMenu(m,p.name,n,function(a){p.populateChoicesMenu(a,e,i,d,s)}.bind(p),p.imageClass,p.tooltip||p.title,p.selectionClass)):(k.handler=k.handler||this,k.domParent=c,n=function(){s._invoke(k)},b==="menu"?m=j.createCommandMenuItem(c,p,k,null,n):(m=b+p.id+l,m=j.createCommandItem(c,p,k,m,null,b==="tool",n)),h.generateNavGrid(f,m),k.domNode=m,l++)}})},_createDropdownMenu:function(a,e,i,d,f,m,h){a=k.node(a);if(!a||!k.contains(document.body,
a))return null;var o,n=a;if(i)m=document.createRange(),m.selectNode(a),m=m.createContextualFragment(c),k.processTextNodes(m,{ButtonText:e}),a.appendChild(m),o=a.lastChild,a=o.lastChild,e=a.previousSibling,e.dropdown=new b.Dropdown({dropdown:a,populate:d}),a.dropdown=e.dropdown;else if(a.nodeName.toLowerCase()==="ul"&&(n=document.createElement("li"),a.appendChild(n),o=n),a=null,f&&(a="dropdownButtonWithIcon",m=m||e),m=f?m||e:m,d=j.createDropdownMenu(n,e,d,a,f,!1,h),e=d.menuButton,a=d.menu,m)e.commandTooltip=
new g.Tooltip({node:e,text:m,position:["above","below","right","left"]});return{menuButton:e,menu:a,dropdown:e.dropdown,destroyButton:o}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var c=document.createElement("li");c.classList.add("dropdownSeparator");var e=document.createElement("span");e.classList.add("dropdownSeparator");c.appendChild(e);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}};i.prototype.constructor=i;m.prototype={match:function(a){a=f.matchResourceParameters(a);return typeof a[this.token]!=="undefined"?(this.parameterValue=a[this.token],this):null}};m.prototype.constructor=m;o.prototype={optionsRequested:function(){return this.optionsRequested}};o.prototype.constructor=o;n.prototype={_storeParameters:function(a){this.parameterTable=
null;if(a){var c=this.parameterTable={};a.forEach(function(a){c[a.name]=a})}},updateParameters:function(a){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(a))},hasParameters:function(){return this.parameterTable!==null},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(a){return this.parameterTable[a]},valueFor:function(a){return(a=this.parameterTable[a])?a.value:null},setValue:function(a,c){var e=this.parameterTable[a];
if(e)e.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 o(c.name,c.type,c.label,c.value,c.lines);a.push(c)});var c=new n(a,this._options,this.getParameters);c.clientCollect=this.clientCollect;return c},hasOptionalParameters:function(){return this._hasOptionalParameters}};n.prototype.constructor=n;return{CommandRegistry:i,URLBinding:m,ParametersDescription:n,
CommandParameter:o}});
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","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}'?","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","Go Into":"Go Into","Move into the selected folder":"Move into the selected folder","Import local file...":"Import local file...","Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP from...","Copy files and folders from a specified SFTP connection":"Copy files and folders from a specified SFTP connection",
"Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP to...","Copy files and folders to a specified SFTP location":"Copy files and folders to a specified SFTP location",Exporting:"Exporting to ${0}","Pasting ${0}":"Pasting ${0}","Copy to":"Copy to","Move to":"Move to","Copying ${0}":"Copying ${0}","Moving ${0}":"Moving ${0}","Renaming ${0}":"Renaming ${0}","Deleting ${0}":"Deleting ${0}","Creating ${0}":"Creating ${0}","Linking to ${0}":"Linking to ${0}","Move files and folders to a new location":"Move files and folders to a new location",
"Copy Items":"Copy Items","Copy the selected items to the copy/paste buffer":"Copy the selected items to the copy/paste buffer","Paste Items":"Paste Items","Paste items from the copy/paste buffer":"Paste items from the copy/paste buffer","Cannot paste into the Workspace root":"Cannot paste into the Workspace root","Open With":"Open With","Loading ":"Loading ",New:"New",Actions:"Actions","Orion Content":"Orion Content"," is not supported in this file system":" is not supported in this file system",
"Create new content":"Create new content","Import from HTTP...":"Import from HTTP...","File URL:":"File URL:","Copy a file from a URL and optionally unzip it":"Copy a file from a URL and optionally unzip it","Unzip *.zip files:":"Unzip *.zip files:","Extracted from:":"Extracted from:","Did not drop ${0}.  Folder drop is not supported in this browser.":"Did not drop ${0}.  Folder drop is not supported in this browser.","You cannot copy files directly into the workspace.  Create a folder first.":"You cannot copy files directly into the workspace.  Create a folder first.",
"Unzip ${0}?":"Unzip ${0}?",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding."});define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(l,j){var h={root:j};Object.keys(l).forEach(function(f){typeof h[f]==="undefined"&&(h[f]=l[f])});return h});
define("orion/i18nUtil",["require","orion/Deferred"],function(l,j){function h(d){if(d=localStorage.getItem("orion/messageBundle/"+d))if(d=JSON.parse(d),d._expires&&d._expires>(new Date).getTime())return delete d._expires,d;return null}var f={};return{getMessageBundle:function(d){function k(){l(["i18n!"+d],function(a){if(a){var c=d;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+c,JSON.stringify(a));delete a._expires}b.resolve(a)})}if(f[d])return f[d];var b=new j;f[d]=
b;var g=h(d);if(g)return b.resolve(g),b;try{l([d],k)}catch(a){l(["orion/i18n!"+d],k)}return b},formatMessage:function(d){var f=arguments;return d.replace(/\$\{([^\}]+)\}/g,function(b,g){return f[(g<<0)+1]})}}});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(l,j,h){function f(b,g,a){if(!b[g])throw g+l[" is not supported in this file system"];return b[g].apply(b,a)}function d(b,g,a,e){if(!b.readBlob)throw l["source file service does not support binary read"];if(!a.writeBlob)throw l["target file service does not support binary write"];if(g[g.length-1]!=="/")return f(b,"readBlob",[g]).then(function(c){return f(a,"writeBlob",[e,c])});var c=e.substring(0,
e.length-1),i=decodeURIComponent(c.substring(c.lastIndexOf("/")+1)),c=c.substring(0,c.lastIndexOf("/")+1);return f(a,"createFolder",[c,i]).then(function(){},function(){}).then(function(){return f(b,"fetchChildren",[g]).then(function(c){for(var i=[],g=0;g<c.length;++g){var f=c[g].Location,k=f;c[g].Directory&&(k=f.substring(0,f.length-1));k=decodeURIComponent(k.substring(k.lastIndexOf("/")+1));k=e+encodeURIComponent(k);c[g].Directory&&(k+="/");i[g]=d(b,f,a,k)}return j.all(i)})})}function k(b,g){function a(a){var c=
new j;c.reject(l["No Matching FileService for location:"]+a);return c}var e=b.getServiceReferences("orion.core.file"),c=e;if(g)for(var c=[],i=0;i<e.length;++i)g(e[i])&&c.push(e[i]);for(var d=[],f=[],k=[],p=[],t={fetchChildren:function(){var a=new j;a.resolve(p);return a},createWorkspace:function(){var a=new j;a.reject(l["no file service"]);return a},loadWorkspaces:function(){var a=new j;a.reject(l["no file service"]);return a},loadWorkspace:function(){var a=new j;window.setTimeout(function(){a.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:l["File Servers"],Location:"/",Children:p,ChildrenLocation:"/"})},100);return a},search:a,createProject:a,createFolder:a,createFile:a,deleteFile:a,moveFile:a,copyFile:a,read:a,write:a},e=0;e<c.length;++e)p[e]={Directory:!0,Length:0,LocalTimeStamp:0,Location:c[e].getProperty("top"),ChildrenLocation:c[e].getProperty("top"),Name:c[e].getProperty("Name")},i=c[e].getProperty("pattern")||".*",i[0]!=="^"&&(i="^"+i),d[e]=RegExp(i),f[e]=b.getService(c[e]),k[e]=c[e].getProperty("Name"),
c[e].getProperty("NameKey")&&c[e].getProperty("nls")&&h.getMessageBundle(c[e].getProperty("nls")).then(function(a,e){p[a].Name=e[c[a].getProperty("NameKey")];k[a]=e[c[a].getProperty("NameKey")]}.bind(this,e));this._getServiceIndex=function(a){if(a==="/")return-1;else if(!a||a.length&&a.length===0)return f[0]?0:-1;for(var c=0;c<d.length;++c)if(d[c].test(a))return c;throw l["No Matching FileService for location:"]+a;};this._getService=function(a){a=this._getServiceIndex(a);return a===-1?t:f[a]};this._getServiceName=
function(a){a=this._getServiceIndex(a);return a===-1?t.Name:k[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return a===-1?t.Location:p[a].Location}}k.prototype={getService:function(b){return this._getService(b)},fileServiceName:function(b){return this._getServiceName(b)},fileServiceRootURL:function(b){return this._getServiceRootURL(b)},fetchChildren:function(b){return f(this._getService(b),"fetchChildren",arguments)},createWorkspace:function(b){return f(this._getService(),"createWorkspace",
arguments)},loadWorkspaces:function(){return f(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(b){return f(this._getService(b),"loadWorkspace",arguments)},createProject:function(b,g,a,e){return f(this._getService(b),"createProject",arguments)},createFolder:function(b,g){return f(this._getService(b),"createFolder",arguments)},createFile:function(b,g){return f(this._getService(b),"createFile",arguments)},deleteFile:function(b){return f(this._getService(b),"deleteFile",arguments)},
moveFile:function(b,g,a){var e=this._getService(b),c=this._getService(g);if(e===c)return f(e,"moveFile",arguments);var i=b[b.length-1]==="/",m=g;m[m.length-1]!=="/"&&(m+="/");if(a)m+=encodeURIComponent(a);else{var k=b;i&&(k=k.substring(0,k.length-1));m+=k.substring(k.lastIndexOf("/")+1)}i&&m[m.length-1]!=="/"&&(m+="/");return d(e,b,c,m).then(function(){return f(e,"deleteFile",[b])})},copyFile:function(b,g,a){var e=this._getService(b),c=this._getService(g);if(e===c)return f(e,"copyFile",arguments);
var i=b[b.length-1]==="/",m=g;m[m.length-1]!=="/"&&(m+="/");if(a)m+=encodeURIComponent(a);else{var k=b;i&&(k=k.substring(0,k.length-1));m+=k.substring(k.lastIndexOf("/")+1)}i&&m[m.length-1]!=="/"&&(m+="/");return d(e,b,c,m)},read:function(b,g){return f(this._getService(b),"read",arguments)},write:function(b,g,a){return f(this._getService(b),"write",arguments)},remoteImport:function(b,g){return f(this._getService(b),"remoteImport",arguments)},remoteExport:function(b,g){return f(this._getService(b),
"remoteExport",arguments)},search:function(b){return f(this._getService(b.resource),"search",arguments)}};k.prototype.constructor=k;return{FileClient:k}});
define("orion/search/nls/root/messages",{"Find:":"Find:","Find With":"Find With","ReplaceWith:":"ReplaceWith:","Replace With":"Replace With","Show all":"Show all","Wrap search":"Wrap search","Incremental search":"Incremental search","Whole Word":"Whole Word","Regular expression":"Regular expression","Find after replace":"Find after replace",Options:"Options","Find next match":"Find next match","Find previous match":"Find previous match",Replace:"Replace","Replace All":"Replace All","Search ${0}":"Search ${0}",
"Type a keyword or wild card to search in ":"Type a keyword or wild card to search in ","Search failed.":"Search failed.","No matches found for ${0}":"No matches found for ${0}","Searching...":"Searching...","Resource has been changed by others.":"Resource has been changed by others.","Failed to write file.":"Failed to write file.",Results:"Results","Files ${0} of ${1} matching ${2}":"Files ${0} of ${1} matching ${2}","Replace ${0} with ${1} for files ${2} of ${3}":"Replace ${0} with ${1} for files ${2} of ${3}",
Location:"Location","Click to compare":"Click to compare",'Search again in this folder with "${0}"':'Search again in this folder with "${0}"',"Files replaced":"Files replaced",Status:"Status","${0} out of ${1}  matches replaced.":"${0} out of ${1}  matches replaced.","Replace all matches with...":"Replace all matches with...","Apply Changes":"Apply Changes","Replace all selected matches":"Replace all selected matches","Hide Compare":"Hide Compare","Hide compare view of changes":"Hide compare view of changes",
"Show Compare":"Show Compare","Show compare view of changes":"Show compare view of changes","Show All":"Show All","Show all the results in one page":"Show all the results in one page","< Previous Page":"< Previous Page","Show previous page of search result":"Show previous page of search result","Next Page >":"Next Page >","Show next page of search result":"Show next page of search result","Next result":"Next result","Previous result":"Previous result","Expand all results":"Expand all results","Collapse all results":"Collapse all results",
"Writing files...":"Writing files...","Preparing preview...":"Preparing preview...","Replaced File (${0})":"Replaced File (${0})","Original File (${0})":"Original File (${0})","Sort by Name":"Sort by Name","Compare changes":"Compare changes","Search Results":"Search Results","Replace All Matches":"Replace All Matches","No matches":"No matches",Rename:"Rename","My Saved Searches":"My Saved Searches","Save frequently used searches by choosing ${0} shown above.":"Save frequently used searches by choosing ${0} shown above.",
"Save frequently used searches by clicking on the ${0} button above.":"Save frequently used searches by clicking on the ${0} button above.","Files that contain:":"Files that contain:",Search:"Search","All types":"All types","File type":"File type","All ${0} files":"All ${0} files","Type a search term":"Type a search term","Type a replace term":"Type a replace term","Case sensitive":"Case sensitive","Sort by":"Sort by","File name":"File name","Path name":"Path name",Save:"Save","Type a name for the search":"Type a name for the search",
"Save the current search":"Save the current search","Type filter text":"Type filter text","Scope Search":"Scope Search","Open in Search page for this directory":"Open in Search page for this directory","${0}. Try your search again.":"${0}. Try your search again.","Click or use delete key to delete the search term":"Click or use delete key to delete the search term","${0} matches":"${0} matches","Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.":"Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.",
"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.":"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>."});
define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(l,j){var h={root:j};Object.keys(l).forEach(function(f){typeof h[f]==="undefined"&&(h[f]=l[f])});return h});define("orion/regex",[],function(){return{escape:function(l){return l.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(l){return(l=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(l))?{pattern:l[1],flags:l[2]}:null}}});
define("orion/URITemplate",[],function(){function l(a){this._text=a}function j(a){return a.replace("%25","%")}function h(a,i){if(i==="U")return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if(i==="U+R")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(e,j);if(i==="U+R-,")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+i);}function f(a,e,g){for(var b=
[],d=0;d<a.length;d++)typeof a[d]!=="undefined"&&b.push(h(a[d],e));return b.join(g)}function d(a,e,g,b){for(var d=Object.keys(a),f=[],k=0;k<d.length;k++)typeof a[d[k]]!=="undefined"&&f.push(h(d[k],e)+g+h(a[d[k]],e));return f.join(b)}function k(c){if(c.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=g[c[0]])?c=c.substring(1):this._operator=g.NUL;for(var e=[],b=c.split(","),d=0;d<b.length;d++){var f=b[d].match(a);if(f===null)throw Error("Bad VarSpec: "+c);e.push({name:f[1],
explode:!!f[2],prefix:f[3]?parseInt(f[3],10):-1})}this._varSpecList=e}function b(a){for(var e=[],g=0,b=a.indexOf("{",g);b!==-1;){e.push(new l(a.substring(g,b)));g=a.indexOf("}",b+1);if(g===-1)throw Error("Invalid template: "+a);e.push(new k(a.substring(b+1,g)));g+=1;b=a.indexOf("{",g)}e.push(new l(a.substring(g)));this._templateComponents=e}var g={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-,"}},a=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,e=/%25[0-9A-F][0-9A-F]/g;l.prototype={expand:function(){return encodeURI(this._text)}};
k.prototype={expand:function(a){for(var e=[],g=0;g<this._varSpecList.length;g++){var b=this._varSpecList[g],k=b.name,j=a[k],l=typeof j;if(l!=="undefined"&&j!==null){var u=e.length===0?this._operator.first:this._operator.sep;if(l==="string")this._operator.named&&(u+=h(k,"U+R"),u+=j.length===0?this._operator.ifemp:"="),b.prefix!==-1&&b.prefix<j.length&&(j=j.substring(0,b.prefix)),u+=h(j,this._operator.allow);else if(Array.isArray(j))b.explode?u+=f(j,this._operator.allow,this._operator.sep):(this._operator.named&&
(u+=h(k,"U+R"),u+=j.length===0?this._operator.ifemp:"="),u+=f(j,this._operator.allow,","));else if(l==="object")b.explode?u+=d(j,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(u+=h(k,"U+R"),u+=Object.keys(j).length===0?this._operator.ifemp:"="),u+=d(j,this._operator.allow,",",","));else throw Error("bad param type: "+k+" : "+l);e.push(u)}}return e.join("")}};b.prototype={expand:function(a){for(var e=[],g=0;g<this._templateComponents.length;g++)e.push(this._templateComponents[g].expand(a));
return e.join("")}};return b});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(l,j,h,f,d,k){function b(a,e,c){var i="";c&&(i="^");if(i=h.parse("/"+i+a.searchStr+"/"))c=i.pattern,i=i.flags,i.indexOf("i")===-1&&!e.caseSensitive&&(i+="i"),a.regExp={pattern:c,flags:i},a.wildCard=!0}var g={ALL_FILE_TYPE:"*.*"};g.doSearch=function(a,e,c,i){if(a){var b=!0;c==="*"&&(c="");c===""&&(b=i&&i.type!==g.ALL_FILE_TYPE);if(b){c!==""&&g.addRecentSearch(e,
c,i?i.regEx:!1);var a=a.createSearchParams(c,!1,!1,i),d=g.generateSearchHref(a);g.getOpenSearchPref(e,function(a){a?window.open(d):window.location=d})}}else window.alert(l["Can't search: no search service is available"])};g.generateSearchHelper=function(a,e){var c=a.keyword,i=c,d={};a.fileType&&a.fileType!==g.ALL_FILE_TYPE&&c===""&&(i="*."+a.fileType);if(a.regEx)d.searchStr=c,b(d,a,e);else{var f=c.indexOf("*")>-1,k=c.indexOf("?")>-1;f&&(c=c.split("*").join(".*"));k&&(c=c.split("?").join("."));!f&&
!k&&!a.nameSearch?(d.searchStr=a.caseSensitive?c.split("\\").join(""):c.split("\\").join("").toLowerCase(),d.wildCard=!1):(d.searchStr=a.caseSensitive?c:c.toLowerCase(),b(d,a,e),d.wildCard=!0)}d.searchStrLength=d.searchStr.length;return{params:a,inFileQuery:d,displayedSearchTerm:i}};g.convertSearchParams=function(a){if(a.rows!==void 0)a.rows=parseInt(a.rows,10);if(a.start!==void 0)a.start=parseInt(a.start,10);if(typeof a.regEx==="string")a.regEx=a.regEx.toLowerCase()==="true";if(typeof a.caseSensitive===
"string")a.caseSensitive=a.caseSensitive.toLowerCase()==="true";if(typeof a.nameSearch==="string")a.nameSearch=a.nameSearch.toLowerCase()==="true"};g.copySearchParams=function(a,e){var c={},i;for(i in a)if(a[i]!==void 0&&a[i]!==null&&(e||i!=="replace"))c[i]=a[i];return c};g.generateSearchHref=function(a){var e=j.toUrl("search/search.html"),a=g.copySearchParams(a,!0),c=a.resource;a.resource=void 0;return typeof a.keyword!=="undefined"?(new k(e+"#{,resource,params*}")).expand({resource:c,params:a}):
(new k(e+"#{,resource}")).expand({resource:c})};g.generateFindURLBinding=function(a,e,c,i,g){a={find:e.searchStr,regEx:e.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:typeof i==="string"?i:void 0,atLine:typeof c==="number"?c:void 0};return g?a:","+(new k("{,params*}")).expand({params:a})};g.convertFindURLBinding=function(a){if(typeof a.regEx==="string")a.regEx=a.regEx.toLowerCase()==="true";if(typeof a.caseSensitive==="string")a.caseSensitive=a.caseSensitive.toLowerCase()===
"true";if(typeof a.atLine==="string")a.atLine=parseInt(a.atLine,10)};g.replaceRegEx=function(a,e,c){return a.replace(RegExp(e.pattern,e.flags),c)};g.replaceStringLiteral=function(a,e,c){e=h.parse("/"+e+"/gim");return g.replaceRegEx(a,e,c)};g.searchOnelineLiteral=function(a,e,c){var i;i=0;for(var g=!1,b=[];;)if(i=e.indexOf(a.searchStr,i),i<0)break;else{b.push({startIndex:i,length:a.searchStrLength});g=!0;if(c)break;i+=a.searchStrLength}return g?b:null};g.findRegExp=function(a,e,c,i){if(!e)return null;
c=c||"";c+=(c.indexOf("g")===-1?"g":"")+(c.indexOf("m")===-1?"m":"");var g=null;return(g=RegExp(e,c).exec(a.substring(i)))&&{startIndex:g.index+i,length:g[0].length}};g.searchOnelineRegEx=function(a,e,c){for(var i=0,b=!1,d=[];;)if(i=g.findRegExp(e,a.regExp.pattern,a.regExp.flags,i)){d.push(i);b=!0;if(c)break;i=i.startIndex+i.length}else break;return b?d:null};g.generateNewContents=function(a,e,c,i,b,d){if(i&&e){if(!a)c.contents=[];for(var f=0;f<e.length;f++){for(var k=e[f],h=!1,j=!1,l=[],r,q=0,y=
0;y<i.children.length;y++)if(i.children[y].lineNumber-1===f){q=y;for(h=0;h<i.children[y].matches.length;h++)i.children[y+h].checked!==!1&&l.push(h);j=l.length>0;r=i.children[y].matches;h=!0;break}if(h){if(j){l=g.replaceCheckedMatches(k,b,r,l,d);k=l.replacedStr;for(h=0;h<i.children[q].matches.length;h++)i.children[q+h].newMatches=l.newMatches}else for(h=0;h<i.children[q].matches.length;h++)i.children[q+h].newMatches=i.children[q+h].matches;a?c.contents[f]=k:c.contents.push(k)}else a||c.contents.push(k)}}};
g.generateMatchContext=function(a,e,c){var i=[],g=a*2+1,b;e.length<=g?(b=0,a=e.length-1):(b=c-a,b<0?(b=0,a=b+g-1):(a=c+a,a>e.length-1&&(a=e.length-1,b=a-g+1)));for(g=b;g<=a;g++)i.push({context:e[g],current:g===c});return i};g.splitFile=function(a){for(var e=0,c=0,i=0,g=0,b=[];;){e!==-1&&e<=i&&(e=a.indexOf("\r",i));c!==-1&&c<=i&&(c=a.indexOf("\n",i));if(c===-1&&e===-1){b.push(a.substring(g));break}var d=1;e!==-1&&c!==-1?e+1===c?(d=2,i=c+1):i=(e<c?e:c)+1:i=e!==-1?e+1:c+1;b.push(a.substring(g,i-d));
g=i}return b};g.searchWithinFile=function(a,e,c,i,b,d){c=g.splitFile(c);if(b)e.contents=c;if(e){e.children=[];for(var f=i=0;f<c.length;f++){var k=c[f];if(k&&k.length>0){var h=d?k:k.toLowerCase();if(h=a.wildCard?g.searchOnelineRegEx(a,h):g.searchOnelineLiteral(a,h)){var j,l=f+1;if(b)for(var r=0;r<h.length;r++)j=r+1,j={parent:e,checked:e.checked,type:"detail",matches:h,lineNumber:l,matchNumber:j,name:k,location:e.location+"-"+l+"-"+j},e.children.push(j);else j={parent:e,context:g.generateMatchContext(2,
c,f),checked:e.checked,type:"detail",matches:h,lineNumber:l,name:k,location:e.location+"-"+l},e.children.push(j);i+=h.length}}}e.totalMatches=i}};g.replaceCheckedMatches=function(a,e,c,i,g){for(var b=0,d="",f=[],k=0;k<c.length;k++){b!==c[k].startIndex&&(d+=a.substring(b,c[k].startIndex));if(c[k].length)g=c[k].length;for(var b=!1,h=0;h<i.length;h++)if(i[h]===k){b=!0;break}b?(f.push({startIndex:d.length,length:e.length}),d+=e):(f.push({startIndex:d.length,length:g}),d+=a.substring(c[k].startIndex,c[k].startIndex+
g));b=c[k].startIndex+g}b<a.length&&(d+=a.substring(b));return{replacedStr:d,newMatches:f}};g.fullPathNameByMeta=function(a){var e=a.length,c="";if(e>0)for(e-=1;e>-1;e--)c=c+(c===""?"":"/")+a[e].Name;return c};g.path2FolderName=function(a,e,c){return a.substring(0,a.length-e.length-(c?0:1))};g._storeRecentSearch=function(a,e,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("recentSearch",e);c&&window.setTimeout(function(){c.dispatchEvent({type:"recentSearchesChanged"})}.bind(this),
20)})};g.addRecentSearch=function(a,e,c){typeof e==="string"&&e&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(i){var b,i=i.get("recentSearch");typeof i==="string"&&(i=JSON.parse(i));if(i){for(b in i)if(i[b].name===e)return;i.length>=20&&i.splice(19,i.length-20+1)}else i=[];i.splice(0,0,{name:e,regEx:c});g._storeRecentSearch(a,i)})};g.removeRecentSearch=function(a,e,c){typeof e==="string"&&e&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(i){var b,
i=i.get("recentSearch");typeof i==="string"&&(i=JSON.parse(i));if(i)for(b in i)if(i[b].name===e){i.splice(b,1);g._storeRecentSearch(a,i,c);break}})};g.getSearches=function(a,e,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a=a.get(e);typeof a==="string"&&(a=JSON.parse(a));a&&c&&c(a)})};g.getMixedSearches=function(a,e,c,i){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var b=a.get("recentSearch");typeof b===
"string"&&(b=JSON.parse(b));e&&(a=a.get("search"),typeof a==="string"&&(a=JSON.parse(a)),a&&a.forEach(function(a){if(c){var e=g.parseQueryStr(a.query);b.some(function(a){return e.searchStrTitle===a.name})||b.push({name:e.searchStrTitle,label:a.name})}else b.push({name:null,label:a.name,value:a.query})}));b&&i&&i(b)})};g.getOpenSearchPref=function(a,e){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");e(a&&a["links.newtab"]!=="undefined"?
a["links.newtab"]?!0:!1:!1)})};g.setOpenSearchPref=function(a,e){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",{openInNewTab:e})})};return g});
define("orion/crawler/nls/root/messages",{"Searching file:":"Searching file:","is not supported in this file system":"is not supported in this file system","${0} files found out of ${1}":"${0} files found out of ${1}","The search term on this location will not use indexed files.":"The search term on this location will not use indexed files.","It will take longer time. Do you want to proceed?":"It will take longer time. Do you want to proceed?","Search cancelled by user":"Search cancelled by user",
Cancel:"Cancel"});define("orion/crawler/nls/messages",["orion/i18n!orion/crawler/nls/messages","orion/crawler/nls/root/messages"],function(l,j){var h={root:j};Object.keys(l).forEach(function(f){typeof h[f]==="undefined"&&(h[f]=l[f])});return h});
define("orion/contentTypes",[],function(){function l(d,b){function g(a,c,e,i){var e=c.filename.indexOf(e)>=0,b;b=i.toLowerCase();b=c.extension.indexOf(b)!==-1;if(e||b){if(!(b=!a))e&&(i=i.toLowerCase(),e=a.extension.indexOf(i)!==-1),b=e;if(b)return c}return a}if(typeof d!=="string")return null;for(var a=d&&d.split(".").pop(),e=null,c=0;c<b.length;c++){var i=b[c];g(e,i,d,a)===i&&(e=i)}return e}function j(k){this.serviceRegistry=k;this.map=function(b){function g(a){return a===null||typeof a==="undefined"?
[]:Array.isArray(a)?a:[a]}function a(a){return g(a).map(function(a){return String.prototype.toLowerCase.call(a)})}for(var b=b.getServiceReferences(f).concat(b.getServiceReferences(d)),e={},c=0;c<b.length;c++)for(var i=g(b[c].getProperty("contentTypes")),k=0;k<i.length;k++){var h=i[k];e[h.id]||(e[h.id]={id:h.id,name:h.name,image:h.image,"extends":h["extends"],extension:a(h.extension),filename:g(h.filename)})}return e}(k);k.registerService(h,this)}var h="orion.core.contentTypeRegistry",f="orion.core.contenttype",
d="orion.file.contenttype";j.prototype={getContentTypes:function(){var d=this.getContentTypesMap(),b=[],g;for(g in d)Object.prototype.hasOwnProperty.call(d,g)&&b.push(d[g]);return b},getContentTypesMap:function(){return this.map},getFileContentType:function(d){return l(d.Name,this.getContentTypes())},getFilenameContentType:function(d){return l(d,this.getContentTypes())},getContentType:function(d){return this.map[d]||null},isExtensionOf:function(d,b){d=typeof d==="string"?this.getContentType(d):d;
b=typeof b==="string"?this.getContentType(b):b;if(!d||!b)return!1;if(d.id===b.id)return!0;else for(var g=d,a={};g&&(g=this.getContentType(g["extends"]));){if(g.id===b.id)return!0;if(a[g.id])throw Error("Cycle: "+g.id);a[g.id]=!0}return!1},isSomeExtensionOf:function(d,b){for(var g=0;g<b.length;g++)if(this.isExtensionOf(d,b[g]))return!0;return!1}};return{ContentTypeRegistry:j,getFilenameContentType:l}});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(l,j,h,f,d,k){function b(b,a,e,c){this.registry=b;this.fileClient=a;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=c&&c.searchOnName;this._buildSkeletonOnly=c&&c.buildSkeletonOnly;this._fetchChildrenCallBack=c&&c.fetchChildrenCallBack;this._searchParams=e;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:f.generateSearchHelper(e);this._location=c&&c.location;this._childrenLocation=c&&c.childrenLocation?c.childrenLocation:this._location;this._cancelled=!1;this.registry.getService("orion.page.message").setCancelFunction(function(){this._cancelFileContentsSearch()}.bind(this))}b.prototype.search=function(b){var a=this.registry.getService("orion.core.contentTypeRegistry");this._onSearchComplete=b;this._cancelled=!1;this._deferredArray=[];a.getContentTypes().then(function(a){this.contentTypesCache=
a;this._visitRecursively(this._childrenLocation).then(function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}})}.bind(this))}.bind(this))};b.prototype.searchName=function(b,a){if(b)this.searchHelper=f.generateSearchHelper(b,!0);if(a)this.onSearchNameComplete=a;var e=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var c=0;c<this.fileSkeleton.length;c++){var i=
this.fileSkeleton[c].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?f.searchOnelineRegEx(this.searchHelper.inFileQuery,i,!0):f.searchOnelineLiteral(this.searchHelper.inFileQuery,i,!0))if(e.push(this.fileSkeleton[c]),e.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:e.length,docs:e}})}};b.prototype.buildSkeleton=function(b,a){this._buildingSkeleton=!0;var e=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=
[];var c=this;b();e.getContentTypes().then(function(e){c.contentTypesCache=e;c._visitRecursively(c._childrenLocation).then(function(){c._buildingSkeleton=!1;a();c.searchHelper&&!c._buildSkeletonOnly&&c.searchName()})})};b.prototype._searchCompleted=function(){console.log("Search Completed.")};b.prototype._searchFiles=function(){var b=[];if(this.fileLocations.length>0)for(var a=0;a<this.fileLocations.length;a++)b.push(this._sniffSearch(this.fileLocations[a]));return k.all(b)};b.prototype._sort=function(b){b.sort(function(a,
e){var c=a.Name&&a.Name.toLowerCase(),b=e.Name&&e.Name.toLowerCase();return c<b?-1:c>b?1:0})};b.prototype._onFileType=function(b){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===f.ALL_FILE_TYPE?!0:b.extension.indexOf(this.searchHelper.params.fileType)>=0:!0};b.prototype._visitRecursively=function(b){var a=[],e=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(b);var c=e.registry.getService("orion.page.progress");return(c?c.progress(e.fileClient.fetchChildren(b),
"Crawling search for children of "+b):e.fileClient.fetchChildren(b)).then(function(c){for(var b=0;b<c.length;b++)if(c[b].Directory!==void 0&&c[b].Directory===!1)if(e._searchOnName)a.push(e._buildSingleSkeleton(c[b]));else if(e._buildSkeletonOnly)a.push(e._buildSingleSkeleton(c[b]));else{if(!e._cancelled){var g=d.getFilenameContentType(c[b].Name,e.contentTypesCache);if(g&&(g["extends"]==="text/plain"||g.id==="text/plain")&&e._onFileType(g))g=e._sniffSearch(c[b]),a.push(g),e._deferredArray.push(g)}}else if(c[b].Location)if(e._cancelled)break;
else g=e._visitRecursively(c[b].ChildrenLocation),a.push(g),e._deferredArray.push(g);return k.all(a)})};b.prototype._hitOnceWithinFile=function(b){b=this._searchParams.caseSensitive?b:b.toLowerCase();return this.searchHelper.inFileQuery.wildCard?f.searchOnelineRegEx(this.searchHelper.inFileQuery,b,!0):f.searchOnelineLiteral(this.searchHelper.inFileQuery,b,!0)};b.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)};b.prototype._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(b){b.cancel()});this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}});console.log("Crawling search cancelled. Deferred array length : "+this._deferredArray.length);this.registry.getService("orion.page.message").setProgressResult({Message:l["Search cancelled by user"],
Severity:"Warning"})};b.prototype._sniffSearch=function(b){this._totalCounter++;var a=this;if(!this._cancelled)if(this.searchHelper.params.keyword==="")this._reportSingleHit(b),this.registry.getService("orion.page.message").setProgressResult({Message:h.formatMessage(l["${0} files found out of ${1}"],this._hitCounter,this._totalCounter)});else return this.registry.getService("orion.page.progress").progress(a.fileClient.read(b.Location),"Reading file "+b.Location).then(function(e){a._hitOnceWithinFile(e)&&
a._reportSingleHit(b);a.registry.getService("orion.page.message").setProgressResult({Message:h.formatMessage(l["${0} files found out of ${1}"],a._hitCounter,a._totalCounter)},l.Cancel)},function(a){a&&a.message&&a.message.toLowerCase()!=="cancel"&&console.error("Error loading file content: "+a.message)})};b.prototype._buildSingleSkeleton=function(b){this._totalCounter++;this.fileSkeleton.push(b);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();b=new k;b.resolve(this._totalCounter);
return b};b.prototype.constructor=b;return{SearchCrawler:b}});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(l,j){function h(f){this._init(f)}h.prototype={_init:function(f){var d=f.parent,k=this,d=j.node(d);if(!d)throw l["no parent"];if(!f.model)throw l["no tree model"];if(!f.renderer)throw l["no renderer"];this._parent=d;this._treeModel=f.model;this._renderer=f.renderer;this._showRoot=f.showRoot===void 0?!1:f.showRoot;this._indent=f.indent===void 0?16:f.indent;this._onCollapse=f.onCollapse;this._labelColumnIndex=
f.labelColumnIndex===void 0?0:f.labelColumnIndex;this._id=f.id===void 0?"treetable":f.id;this._tableStyle=f.tableStyle;this._tableElement=f.tableElement||"table";this._tableBodyElement=f.tableBodyElement||"tbody";this._tableRowElement=f.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(b){k._showRoot?(b._depth=0,k._generate([b],0)):k._treeModel.getChildren(b,function(b){k.destroyed||k._generate(b,0)})})},destroy:function(){this.destroyed=!0},_generate:function(f,d){j.empty(this._parent);
var k=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(k);var b=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(b);b.id=this._id;this._tableStyle&&b.classList.add(this._tableStyle);this._renderer.initTable(b,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+"tbody";f.length===
0?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(f,d);b.appendChild(this._bodyElement);k.appendChild(b);this._parent.appendChild(k);this._rowsChanged()},_generateChildren:function(f,d,k){for(var b=0;b<f.length;b++){var g=document.createElement(this._tableRowElement);g.id=this._treeModel.getId(f[b]);this._renderer.rowCallback&&this._renderer.rowCallback(g);g._depth=d;g._item=f[b];this._renderer.render(f[b],g);g.childNodes[this._labelColumnIndex].style.paddingLeft=
this._indent*d+"px";k?(this._bodyElement.insertBefore(g,k.nextSibling),k&&(k=g)):this._bodyElement.appendChild(g)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(f,d,k){var b=this._treeModel.getId(f),g;if(b===this._id)this._removeChildRows(b),this._generateChildren(d,0),this._rowsChanged();else{var a=j.node(b);a?(a._item=f,a&&(k||a._expanded)?(this._removeChildRows(b),this._renderer.updateExpandVisuals(a,
!0),d?(a._expanded=!0,this._generateChildren(d,a._depth+1,a),this._rowsChanged()):(g=this,d=this._treeModel.getChildren(a._item,function(e){if(!g.destroyed&&!a._expanded)a._expanded=!0,g._generateChildren(e,a._depth+1,a),g._rowsChanged()}))):this._renderer.updateExpandVisuals(a,!1)):console.log(l["could not find table row "]+b)}},getItem:function(f){var d=j.node(f);return d&&d._item?d._item:f},toggle:function(f){var d=j.node(f);d&&(d._expanded?(this.collapse(f),this._renderer.updateExpandVisuals(d,
!1)):(this.expand(f),this._renderer.updateExpandVisuals(d,!0)))},isExpanded:function(f){f=typeof f==="string"?f:this._treeModel.getId(f);return(f=j.node(f))?f._expanded:!1},expand:function(f,d,k){var f=typeof f==="string"?f:this._treeModel.getId(f),b=j.node(f);if(b&&!b._expanded){var g=this;this._renderer.updateExpandVisuals(b,!0);this._treeModel.getChildren(b._item,function(a){if(!g.destroyed){if(!b._expanded)b._expanded=!0,g._generateChildren(a,b._depth+1,b),g._rowsChanged();d&&d.apply(g,k)}})}},
_removeChildRows:function(f){for(var d=f===this._id,k=!1,b=-1,g=[],a=j.$$array(".treeTableRow",this._parent),e=0;e<a.length;e++){var c=a[e];if(k)break;if(d)c._depth>b?g.push(c):k=!0;else if(c.id===f)d=!0,b=c._depth}for(f=0;f<g.length;f++)d=g[f],d.parentNode.removeChild(d)},collapse:function(f){var f=typeof f==="string"?f:this._treeModel.getId(f),d=j.node(f);if(d){if(!d._expanded)return;d._expanded=!1;this._renderer.updateExpandVisuals(d,!1);this._removeChildRows(f);this._rowsChanged()}this._onCollapse&&
this._onCollapse(d._item)}};h.prototype.constructor=h;return{TableTree:h}});
define("orion/treeModelIterator",[],function(){var l={};l.TreeModelIterator=function(){function j(h,f){this.firstLevelChildren=h;this.reset();this._init(f)}j.prototype={_init:function(h){if(h)this.isExpanded=h.isExpanded,this.isExpandable=h.isExpandable,this.forceExpandFunc=h.forceExpandFunc,this.getChildrenFunc=h.getChildrenFunc},topLevel:function(h){return h.parent?h.parent===this.root:!0},_getChildren:function(h){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(h):h?h.children:
null},_expanded:function(h){if(!h)return!0;var f=this._getChildren(h),f=f&&f.length>0;this.isExpanded&&f&&(f=this.isExpanded(h));return f},_expandable:function(h){return!h?!0:this.isExpandable?this.isExpandable(h):!1},_diveIn:function(h){return this._expanded(h)?(this.setCursor(this._getChildren(h)[0]),this.cursor()):null},_drillToLast:function(h){return this._expanded(h)?(h=this._getChildren(h),this._drillToLast(h[h.length-1])):h},_forward:function(h){if(!this._cursor)return null;var f=this._diveIn(this._cursor);
if(!f){if(h&&this._expandable(this._cursor)&&this.forceExpandFunc){var d=this;return this.forceExpandFunc(this._cursor,"first",function(f){f&&d.setCursor(f)})}(f=this._findSibling(this._cursor,!0))&&this.setCursor(f)}return f},_backward:function(h){if(!this._cursor)return null;var f=this._findSibling(this._cursor,!1);f&&f!==this._cursor.parent&&(f=this._drillToLast(f));if(h&&f&&this._expandable(f)&&this.forceExpandFunc&&f!==this._cursor.parent){var d=this;return this.forceExpandFunc(f,"last",function(f){f&&
d.setCursor(f)})}f&&this.setCursor(f);return f},_findSibling:function(h,f){for(var d=this.topLevel(h),k=this._getChildren(h.parent),k=d?this.firstLevelChildren:k,b=0;b<k.length;b++)if(k[b]===h)return b===0&&!f?d?null:h.parent:b===k.length-1&&f?d?null:this._findSibling(h.parent,f):f?k[b+1]:k[b-1];return null},_inParentChain:function(h,f){for(var d=h.parent;d;){if(d===f)return!0;d=d.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,f,d){this.setCursor(f);var k=[];for(k.push(f);;){if(this.iterate(h))k.push(this.cursor());else break;if(d===this.cursor())return k}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,f){var d=this.cursor(),
k=this._scan(!0,h,f);k||(k=this._scan(!1,h,f));this.setCursor(d);return k},iterate:function(h,f){return h?this._forward(f):this._backward(f)},iterateOnTop:function(h,f){var d=this._findSibling(this._getTopLevelParent(this.cursor()),h);d?this.setCursor(d):f&&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 j}();return l});
define("orion/explorers/explorerNavHandler",["i18n!orion/nls/messages","orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(l,j,h,f){var l={},d=navigator.userAgent.indexOf("iPad")!==-1,k=window.navigator.platform.indexOf("Mac")!==-1;l.ExplorerNavHandler=function(){function b(b,a,e){this.explorer=b;this.model=this.explorer.model;this._navDict=a;this._listeners=[];this._selections=[];this._currentColumn=0;b=this._getEventListeningDiv();b.tabIndex=0;b.classList.add("selectionModelContainer");
var c=this;this._modelIterator=new h.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:e.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return c.explorer.renderer.isExpandable(a)}:function(a){return c.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,e,b){return c.explorer.forceExpandFunc(a,e,b)}:void 0});this._init(e);(!e||e.setFocus!==!1)&&b.focus();e=function(a){if(f.isFormElement(a.target))return!0;if(c.explorer.preventDefaultFunc&&
c.explorer.preventDefaultFunc(a,c._modelIterator.cursor()))return!0;if(a.keyCode===j.KEY.DOWN)return c.onDownArrow(a);else if(a.keyCode===j.KEY.UP)return c.onUpArrow(a);else if(a.keyCode===j.KEY.RIGHT)return c.onRightArrow(a);else if(a.keyCode===j.KEY.LEFT)return c.onLeftArrow(a);else if(a.keyCode===j.KEY.SPACE)return c.onSpace(a);else if(a.keyCode===j.KEY.ENTER)return c.onEnter(a)};b.addEventListener("keydown",e,!1);this._listeners.push({type:"keydown",listener:e});e=function(){if(c.explorer.onFocus)c.explorer.onFocus(!1);
else c.toggleCursor(null,!1)};b.addEventListener("blur",e,!1);this._listeners.push({type:"blur",listener:e});e=function(){if(c.explorer.onFocus)c.explorer.onFocus(!0);else c.toggleCursor(null,!0)};b.addEventListener("focus",e,!1);this._listeners.push({type:"focus",listener:e});this._parentDiv=b}b.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_init:function(b){this._linearGridMove=!1;if(b)this._selectionPolicy=b.selectionPolicy,this.gridClickSelectionPolicy=
b.gridClickSelectionPolicy||"none",this.preventDefaultFunc=b.preventDefaultFunc,this.postDefaultFunc=b.postDefaultFunc},_ctrlKeyOn:function(b){return k?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):j.node(this.explorer._parentId)},isExpandable:function(b){return!b?!1:j.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 a=this;this.explorer.selection&&this.explorer.selection.getSelections(function(e){a._clearSelection();for(var c=0;c<e.length;c++)a._selections.push(e[c]);a._selections.length>0?a.cursorOn(a._selections[0],
!0,!1,b):a.cursorOn();if(!(a._shiftSelectionAnchor&&a._inSelection(a._shiftSelectionAnchor)>=0))a._shiftSelectionAnchor=null})},refreshModel:function(b,a,e,c){this._currentColumn=0;this.topIterationNodes=[];this.model=a;this._navDict=b;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(e)this.topIterationNodes=e;this._modelIterator.setTree(this.topIterationNodes);!c&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),!1),this._modelIterator.reset());
this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(b){for(var b=this.model.getId(b),a=0;a<this._selections.length;a++)if(b===this.model.getId(this._selections[a]))return a;return-1},_clearSelection:function(b){if(b)for(b=0;b<this._selections.length;b++)this._checkRow(this._selections[b],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(b){if(this._selectionPolicy!==
b)this._selectionPolicy=b,this._selectionPolicy==="cursorOnly"&&this._clearSelection(!0)},setSelection:function(b,a,e){if(this._selectionPolicy==="cursorOnly")a&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(b,!0);else if(this._isRowSelectable(b)){!a||this._selectionPolicy==="singleSelection"?(this._clearSelection(!0),this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b):(a=this._inSelection(b),a>=0?(this._checkRow(b,!0),this._selections.splice(a,1)):(this._checkRow(b,
!1),this._selections.push(b),this._lastSelection=b));if(e)this._shiftSelectionAnchor=this._lastSelection;this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(b,a){b||(b=this.currentModel());var e=this._getGridChildren(b);if(e&&e.length>1||a===0&&e){a!==0&&this.toggleCursor(b,!1);var c=this._currentColumn,i=!0;c+=a;c<0?(this._linearGridMove&&a!==0&&(this._modelIterator.iterate(!1)?b=this.currentModel():i=!1),
c=i?e.length-1:this._currentColumn):c>=e.length&&(this._linearGridMove&&a!==0&&(this._modelIterator.iterate(!0)?b=this.currentModel():i=!1),c=i?0:this._currentColumn);this._currentColumn=c;a!==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},getAriaContainerElement:function(b){for(var a=
this._parentDiv,e;b&&b!==a&&(e=b.getAttribute("role"))!=="grid"&&e!=="tree"&&e!=="treegrid";)b=b.parentNode;return b===a?null:b},toggleCursor:function(b,a){var e=this.getRowDiv(b),c=this.getCurrentGrid(b);c?(e&&(a?e.classList.add("treeIterationCursorRow"):e.classList.remove("treeIterationCursorRow")),c.domNode&&(e=this.getAriaContainerElement(c.domNode),a?(c.domNode.classList.add("treeIterationCursor"),e&&e.setAttribute("aria-activedescendant",c.domNode.id)):c.domNode.classList.remove("treeIterationCursor"))):
e&&(a?e.classList.add("treeIterationCursorRow_Dotted"):e.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,a,e,c){var i,d;if(b||a){if(d===this._modelIterator.cursor())return;i=this._modelIterator.cursor();d=b;this._modelIterator.setCursor(d)}else i=this._modelIterator.prevCursor(),d=this._modelIterator.cursor();if(i!==d||a)if(this.toggleCursor(i,!1),!a||d){this.moveColumn(null,0);this.toggleCursor(d,!0);if((b=this.getRowDiv())&&
!c){for(c=b.parentNode;c;){a=window.getComputedStyle(c,null);if(!a)break;a=a.getPropertyValue("overflow-y");if(a==="hidden"||a==="auto"||a==="scroll")break;c=c.parentNode}if(!c)c=document.body;a=!0;b.offsetTop<=c.scrollTop?(a=!1,e===void 0&&(e=!1)):b.offsetTop+b.offsetHeight>=c.scrollTop+c.clientHeight&&(a=!1,e===void 0&&(e=!0));a||b.scrollIntoView(!e)}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(i,d)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var b=
[],a=0;a<this._selections.length;a++)b.push(this.model.getId(this._selections[a]));return b},getRowDiv:function(b){b=b?b:this._modelIterator.cursor();if(!b)return null;var b=this.model.getId(b),a=this._navDict.getValue(b);return a&&a.rowDomNode?a.rowDomNode:j.node(b)},iterate:function(b,a,e){this.topIterationNodes.length!==0&&this._modelIterator.iterate(b,a)&&(this.cursorOn(null,!1,b),e&&(b=this._inSelection(this._modelIterator.prevCursor()),a=this._inSelection(this._modelIterator.cursor()),b>=0&&
a>=0?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)))},_checkRow:function(b,a){if(this.explorer.renderer._useCheckboxSelection){var e=this.getRowDiv(b);if(e){var c=j.node(this.explorer.renderer.getCheckBoxId(e.id)),i=a?!c.checked:!0;if(i!==c.checked)this.explorer.renderer.onCheck(e,c,i,!0)}}else this._select(b,a)},_select:function(b){b||(b=this._modelIterator.cursor());var a=this.getRowDiv(b);a&&(this._inSelection(b)<0?a.classList.add("checkedRow"):
a.classList.remove("checkedRow"))},_onModelGrid:function(b,a){var e=this._getGridChildren(b);if(e)for(var c=0;c<e.length;c++)if(a.target===e[c].domNode)return!0;return!1},onClick:function(b,a){var e=j.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)));if(a.target!==e&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(b,a)))if(this.cursorOn(b,!0,!1,!0),d)this.setSelection(b,!0);else if(this._ctrlKeyOn(a))this.setSelection(b,!0,!0);else if(a.shiftKey&&this._shiftSelectionAnchor){if(e=
this._modelIterator.scan(this._shiftSelectionAnchor,b)){this._clearSelection(!0);for(var c=0;c<e.length;c++)this.setSelection(e[c],!0)}}else this.setSelection(b,!1,!0)},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,!0);b.preventDefault();return!1},onDownArrow:function(b){this.iterate(!0,!1,b.shiftKey);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),
!1,!0);b.preventDefault();return!1},_shouldMoveColumn:function(b){var a=this.currentModel(),e=this._getGridChildren(a);return e&&e.length>1?this.isExpandable(a)?this._ctrlKeyOn(b):!0:!1},onLeftArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,-1),b.preventDefault(),!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&this.isExpanded(a))return this.explorer.myTree.collapse(a),b.preventDefault(),!0;this._modelIterator.topLevel(a)?this.explorer.scopeUp&&
typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(a.parent),this.setSelection(a.parent,!1,!0))},onRightArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,1),b.preventDefault(),!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&!this.isExpanded(a))return this.explorer.myTree.expand(a),b.preventDefault(),!1},_isRowSelectable:function(b){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(b):!0},onSpace:function(b){this.setSelection(this.currentModel(),
!0,!0);b.preventDefault()},onEnter:function(b){var a=this.getCurrentGrid(this._modelIterator.cursor());if(a)if(a.widget)if(typeof a.onClick==="function")a.onClick();else typeof a.widget.focus==="function"&&a.widget.focus();else{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(b),!1,!1,!1,0,null);a.domNode.dispatchEvent(e)}else if(this.explorer.renderer.getRowActionElement&&(a=this._modelIterator.cursor()))if(a=this.explorer.renderer.getRowActionElement(this.model.getId(a)),
a.href)this._ctrlKeyOn(b)?window.open(a.href):window.location.href=a.href}};return b}();l.ExplorerNavDict=function(){function b(b){this._dict={};this._model=b}b.prototype={addRow:function(b,a){this._dict[this._model.getId(b)]={model:b,rowDomNode:a}},getValue:function(b){return this._dict[b]},getGridNavHolder:function(b,a){if(!b)return null;var e=this._model.getId(b);if(this._dict[e]){if(!this._dict[e].gridChildren&&a)this._dict[e].gridChildren=[];return this._dict[e].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 l});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands,orion/commandRegistry".split(","),function(l,j,h,f,d,k){var b={};b.Explorer=function(){function b(a,e,c,i){this.registry=a;this.renderer=c;this.selection=e;this.commandService=i;this.myTree=null}b.prototype={destroy:function(){this.model&&this.model.destroy();this.myTree&&this.myTree.destroy();this.destroyed=!0},changedItem:function(a,e){this.myTree&&
this.myTree.refresh.bind(this.myTree)(a,e,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},makeNewItemPlaceHolder:function(a,e,c){a=this.getRow(a);if(c)return a=a.childNodes[c],a.appendChild(document.createElement("br")),c=document.createElement("span"),c.id=e+"placeHolderRow",a.appendChild(c),{tempNode:c,refNode:c};if(a){c=document.createElement("tr");c.id=e+"placeHolderRow";var b=document.createElement("td");b.id=e+"placeHolderCol";
c.appendChild(b);a.appendChild(c);c=h.node(e+"placeHolderRow");a=h.node(e+"placeHolderCol");if(c&&a)return{tempNode:c,refNode:a}}return null},getRow:function(a){if(a=this.model.getId(a))return h.node(a)},collapseAll:function(){for(var a=this._navHandler.getTopLevelNodes(),e=0;e<a.length;e++)this.myTree.collapse(a[e])},expandAll:function(a){if(a)this._expandRecursively(a);else if(this._navHandler)for(var a=this._navHandler.getTopLevelNodes(),e=0;e<a.length;e++)this._expandRecursively(a[e])},_expandRecursively:function(a){if(this._navHandler&&
this._navHandler.isExpandable(a)){var e=this;this.myTree.expand(a,function(){e.model.getChildren(a,function(a){if(!(a===void 0||a===null))for(var b=a.length,d=0;d<b;d++)e._expandRecursively(a[d])})})}},createTree:function(a,e,c){a=typeof a==="string"?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var b=a+"innerTree",g=h.node(b);g&&h.empty(g);if(e)e.rootId=b;this.model=e;this._parentId=a;this._treeOptions=c;if(!c||c&&!c.noSelection)this.selectionPolicy=
c?c.selectionPolicy:"",this._navDict=new d.ExplorerNavDict(this.model);this.myTree=new f.TableTree({id:b,model:e,parent:a,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:c?!!c.showRoot:!1,indent:c?c.indent:void 0,onCollapse:c?c.onCollapse:void 0,navHandlerFactory:c?c.navHandlerFactory:void 0,tableElement:c?c.tableElement:void 0,tableBodyElement:c?c.tableBodyElement:void 0,tableRowElement:c?c.tableRowElement:void 0});this.renderer._initializeUIState();this.selectionPolicy===
"cursorOnly"&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},refreshSelection:function(){if(this.selection){var a=this.getNavHandler(),e=[];if(a&&this.getNavDict())for(var c=a.getSelection(),b=0;b<c.length;b++){var d=a.getRowDiv(c[b]);d&&d.parentNode&&(d=this.getNavDict().getValue(this.model.getId(c[b])),d.model&&e.push(d.model))}this.selection.setSelections(e)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:
null},initNavHandler:function(){var a=this._treeOptions;if(!a||a&&!a.noSelection){if(!this.getNavHandler())this._navHandler=a&&a.navHandlerFactory&&typeof a.navHandlerFactory.createNavHandler==="function"?a.navHandlerFactory.createNavHandler(this,this._navDict,a):new d.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null});var b=this;this.model.getRoot(function(c){c instanceof Array?b.getNavHandler().refreshModel(b.getNavDict(),
b.model,c):c.children&&c.children instanceof Array&&b.getNavHandler().refreshModel(b.getNavDict(),b.model,c.children);a&&a.setFocus&&b.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return b}();b.createExplorerCommands=function(b,a){function e(c){return typeof c.getItemCount==="function"?c.getItemCount()>0?a?a(c):!0:!1:!1}var c=new k.Command({tooltip:l["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return e(a)},
callback:function(a){a.items.expandAll()}}),i=new k.Command({tooltip:l["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return e(a)},callback:function(a){a.items.collapseAll()}});b.addCommand(c);b.addCommand(i)};b.ExplorerModel=function(){function b(a,e,c){this.rootPath=a;this.fetchItems=e;this.idPrefix=c||""}b.prototype={destroy:function(){this.destroyed=!0},getRoot:function(a){var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=
c;a(c)})},getChildren:function(a,b){a.Children?b(a.Children):a.ChildrenLocation?this.fetchItems(a.ChildrenLocation).then(function(c){a.Children=c;b(c)}):b([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;for(var a=a.Location.replace(/[\\\/]/g,""),b=this.idPrefix,c=0;c<a.length;c++)b+=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(c):a[c];return b}};return b}();b.ExplorerFlatModel=function(){function d(a,b,c){this.rootPath=a;this.fetchItems=b;this.root=c}d.prototype=new b.ExplorerModel;
d.prototype.getRoot=function(a){if(this.root)a(this.root);else{var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})}};d.prototype.getChildren=function(a,b){a===this.root?b(this.root):b([])};return d}();b.ExplorerRenderer=function(){function b(a,e){this.explorer=e;this._init(a);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite"}b.prototype={_init:function(a){if(a){this._useCheckboxSelection=
a.checkbox===void 0?!1:a.checkbox;this.selectionPolicy=a.singleSelection?"singleSelection":"";this._cachePrefix=a.cachePrefix;this.getCheckedFunc=a.getCheckedFunc;this.onCheckedFunc=a.onCheckedFunc;this._highlightSelection=!0;this._treeTableClass=a.treeTableClass||"treetable";if(a.highlightSelection===!1)this._highlightSelection=!1;if(!this.actionScopeId)this.actionScopeId=a.actionScopeId;if(!this.commandService)this.commandService=a.commandService}},getLabelColumnIndex:function(){return this.explorer.checkbox?
1:0},initTable:function(a,b){this.tableTree=b;h.empty(a);this._treeTableClass&&a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,b,c,i,d){var c=c||"tool",g=document.createElement("td");g.id=b.id+"actionswrapper";i&&g.classList.add(i);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,g,a,this.explorer,c,null,d&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return g},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,b){if(this._useCheckboxSelection){var c=document.createElement("td"),i=document.createElement("span");i.id=this.getCheckBoxId(b.id);i.classList.add("core-sprite-check");i.classList.add("selectionCheckmarkSprite");i.rowId=b.id;if(this.getCheckedFunc)i.checked=this.getCheckedFunc(a),i.checked?(this._highlightSelection&&b.classList.add("checkedRow"),i.classList.add("core-sprite-check_on")):
(this._highlightSelection&&b.classList.remove("checkedRow"),i.classList.remove("core-sprite-check_on"));c.appendChild(i);var d=this;i.addEventListener("click",function(a){d.onCheck(b,a.target,a.target.checked?!1:!0,!0)},!1);return c}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,b,c,i,d){(b.checked=c)?b.classList.add("core-sprite-check_on"):b.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(b.rowId,c,i);this.explorer.getNavHandler()&&d&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,
!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),b=this._getUIStatePreferencePath();b&&window.sessionStorage&&(window.sessionStorage[b+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){var b=this.explorer.getNavDict(),c=this.explorer.getNavHandler();if(c&&b&&c.getSelectionPolicy()!=="cursorOnly"&&(a=window.sessionStorage[a+"selection"],typeof a==="string"&&(a=a.length>0?JSON.parse(a):null),a)){for(var i=[],c=0;c<
a.length;c++){var d=b.getValue(a[c]);if(d&&d.rowDomNode&&d.model&&(i.push(d.model),this._highlightSelection&&d.rowDomNode.classList.add("checkedRow"),d=h.node(this.getCheckBoxId(d.rowDomNode.id))))d.checked=!0,d.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(i),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var b=
!1,c=window.sessionStorage[a+"expanded"];typeof c==="string"&&(c=c.length>0?JSON.parse(c):null);var i;if(c)for(i=0;i<c.length;i++)if(h.node(c[i])){this._expanded.push(c[i]);var d=this;this.tableTree.expand(c[i],function(){d._restoreSelections(a)});b=!0}return!b},_getUIStatePreferencePath:function(){if(this.explorer){var a=this.explorer.getRootPath();if(this._cachePrefix&&a)return"/"+this._cachePrefix+"/"+a.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(a){return a+
"__expand"},updateExpandVisuals:function(a,b){var c=h.node(this.expandCollapseImageId(a.id));c&&(c.classList.add(b?this._expandImageClass:this._collapseImageClass),c.classList.remove(b?this._collapseImageClass:this._expandImageClass))},getExpandImage:function(a,b,c,i){var d=document.createElement("span");d.id=this.expandCollapseImageId(a.id);b.appendChild(d);d.classList.add(this._twistieSpriteClass);d.classList.add(this._collapseImageClass);if(c){var g=document.createElement("span");b.appendChild(g);
g.classList.add(i||"imageSprite");g.classList.add(c)}var f=this;d.onclick=function(){f.tableTree.toggle(a.id);if(f.tableTree.isExpanded(a.id))f._expanded.push(a.id);else for(var c in f._expanded)if(f._expanded[c]===a.id){f._expanded.splice(c,1);break}(c=f._getUIStatePreferencePath())&&window.sessionStorage&&f._storeExpansions(c)};return d},render:function(a,b){b.classList.add("navRow");this.renderRow(a,b)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),
this.explorer.initNavHandler())},updateCommands:function(){if(this.commandService)for(var a=h.$$array(".treeTableRow"),b=0;b<a.length;b++){var c=a[b],i=h.node(c.id+"actionswrapper");this.commandService.destroy(i);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,i,c._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return b}();
b.SelectionRenderer=function(){function d(a,b){this._init(a);this.explorer=b}d.prototype=new b.ExplorerRenderer;d.prototype.renderTableHeader=function(a){var b=document.createElement("thead"),c=document.createElement("tr");b.classList.add("navTableHeading");this._useCheckboxSelection&&c.appendChild(this.initCheckboxColumn(a));for(var i=0,d=this.getCellHeaderElement(i);d;)d.innerHTML.length>0&&d.classList.add("navColumn"),c.appendChild(d),d=this.getCellHeaderElement(++i);b.appendChild(c);i>0&&a.appendChild(b)};
d.prototype.renderRow=function(a,b){b.verticalAlign="baseline";b.classList.add("treeTableRow");var c=this.explorer.getNavDict();if(c){c.addRow(a,b);var i=this;b.addEventListener("click",function(c){if(i.explorer.getNavHandler())i.explorer.getNavHandler().onClick(a,c)},!1)}if(c=this.getCheckboxColumn(a,b))c.classList.add("checkColumn"),b.appendChild(c);for(var c=0,d=this.getCellElement(c,a,b);d;)b.appendChild(d),c===0?this.getPrimColumnStyle?d.classList.add(this.getPrimColumnStyle()):d.classList.add("navColumn"):
this.getSecondaryColumnStyle?d.classList.add(this.getSecondaryColumnStyle()):d.classList.add("secondaryColumn"),d=this.getCellElement(++c,a,b)};d.prototype.getCellHeaderElement=function(){};d.prototype.getCellElement=function(){};return d}();b.SimpleFlatModel=function(){function d(a,b,c){this.items=a;this.getKey=c;this.idPrefix=b;this.root={children:a}}d.prototype=new b.ExplorerModel;d.prototype.getRoot=function(a){a(this.root)};d.prototype.getId=function(a){for(var a=this.getKey(a).replace(/[\\\/]/g,
""),b="",c=0;c<a.length;c++)b+=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(c):a[c];return this.idPrefix+b};d.prototype.getChildren=function(a,b){a===this.root?b(this.items):b([])};return d}();return b});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/URL-shim".split(","),function(l,j,h,f,d){function k(){return(new URL(l.toUrl("orion/../"),window.location.href)).href.slice(0,-1)}function b(b,a){var e=b.getServiceReferences(a||"orion.page.link"),c=h.matchResourceParameters(window.location.href),i={OrionHome:k(),Location:c.resource},m=[];e.forEach(function(a){var c={};a.getPropertyKeys().forEach(function(b){c[b]=a.getProperty(b)});if(c.uriTemplate&&
c.nls&&(c.name||c.nameKey)){var b=new j;d.getMessageBundle(c.nls).then(function(a){var e=(new f(c.uriTemplate)).expand(i),e=h.validateURLScheme(e);c.href=e;c.textContent=c.nameKey?a[c.nameKey]:c.name;b.resolve(c)});m.push(b)}else if(c.uriTemplate&&c.name){var e=(new f(c.uriTemplate)).expand(i),e=h.validateURLScheme(e);c.href=e;c.textContent=c.name;m.push((new j).resolve(c))}});return j.all(m)}return{createPageLinks:function(d,a){return b(d,a).then(function(a){a.sort(function(a,b){var e=a.textContent&&
a.textContent.toLowerCase(),d=b.textContent&&b.textContent.toLowerCase();return e<d?-1:e>d?1:0});return a.map(function(a){var b=a.href,a=a.textContent,e=document.createElement("a");e.href=b;e.target="_self";e.classList.add("targetSelector");e.textContent=a;return e})})},getPageLinksInfo:b,getOrionHome:k}});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks".split(","),function(l,j,h,f,d,k,b,g,a){var e={},c=a.getOrionHome();e._cloneItemWithoutChildren=function o(a){if(a===null||typeof a!=="object")return a;var c=a.constructor(),b;for(b in a)b!=="children"&&b!=="Children"&&(c[b]=o(a[b]));return c};e._getOpenWithNavCommandExtensions=function(a){function c(a,b){for(var e=a.getServiceReferences("orion.navigate.openWith"),
i=[],d=0;d<e.length;d++){var g=e[d];g.getProperty("editor")===b.id&&(g=g.getProperty("contentType"),g instanceof Array?i=i.concat(g):g!==null&&typeof g!=="undefined"&&i.push(g))}return i}for(var b=function(){for(var c=a.getServiceReferences("orion.edit.editor"),b=[],e=0;e<c.length;e++){var i=c[e],d=i.getProperty("id");b.push({id:d,name:i.getProperty("name"),nameKey:i.getProperty("nameKey"),nls:i.getProperty("nls"),uriTemplate:i.getProperty("orionTemplate")||i.getProperty("uriTemplate"),validationProperties:i.getProperty("validationProperties")||
[]})}return b}(),e=function(a){for(a=a.getServiceReferences("orion.navigate.openWith.default");0<a.length;)return{editor:a[0].getProperty("editor")};return null}(a),i=[],d=0;d<b.length;d++){var g=b[d],f=e&&e.editor===g.id,k=c(a,g);k.length&&i.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:f?"default":"editor",validationProperties:g.validationProperties},
service:{}})}return i};e._makeValidator=function(a,b,e,i){function g(a,c,b,e){var i=b.match,d;if(c.indexOf("[")===0){if(c.indexOf("]")<0)return!1;if(!Array.isArray(a))return!1;d=c.replace("[","").replace("]","");for(c=0;c<a.length;c++)if(g(a[c],d,b,e))return!0}else if(c.indexOf("|")>=0)return d=c.substring(0,c.indexOf("|")),c=c.substring(c.indexOf("|")+1),g(a,d,b,e)?!0:g(a,c,b,e);else if(c.indexOf(":")>=0)return d=c.substring(0,c.indexOf(":")),c=c.substring(c.indexOf(":")+1),a[d]?g(a[d],c,b,e):!1;
else{a:{d=!1;var f;if(c.charAt(0)==="!")b=typeof a[c.substring(1)]==="undefined";else if(typeof a[c]!=="undefined"){if(typeof i==="undefined")f=a[c],d=!0;else if(typeof i==="string"){if(!typeof(a[c]==="string")){b=!1;break a}if(b.variableName){if(i=RegExp(i).exec(a[c]))d=i[0],f=b.variableMatchPosition==="before"?a[c].substring(0,i.index):b.variableMatchPosition==="after"?a[c].substring(i.index+d.length):b.variableMatchPosition==="only"?d:a[c],d=!0}else{b=RegExp(i).test(a[c]);break a}}else a[c]===
i&&(f=a[c],d=!0);if(d&&b.variableName&&(e[b.variableName]=f,e.itemCached=a,b.replacements))for(a=0;a<b.replacements.length;a++)c=!1,b.replacements[a].pattern?e[b.variableName]=e[b.variableName].replace(RegExp(b.replacements[a].pattern),b.replacements[a].replacement||""):c=!0,c&&window.console.log("Invalid replacements specified in validation property.  "+b.replacements[a]);b=d}else b=!1}return b}}return{info:a,validationFunction:function(c){typeof i==="function"&&(c=i.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 b=0;b<c.length;b++){var f;a:{var k=c[b],h=e;if(this.info.validationProperties)for(f=0;f<this.info.validationProperties.length;f++){var j=this.info.validationProperties[f];if(typeof j.source!=="undefined"){if(!g(k,j.source,j,this)){f=!1;break a}}else{window.console.log("Invalid validationProperties in "+a.id+".  No source property specified.");f=!1;break a}}if(this.info.contentType&&h){j=!1;if(k=d.getFilenameContentType(k.Name,
h))for(f=0;f<this.info.contentType.length;f++)if(k.id===this.info.contentType[f]){j=!0;break}f=j}else f=!0}if(!f)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var b={},e;for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&(b[e]=a[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===a&&this[i.variableName]||
g(a,i.source,i,this),a[i.variableName]?window.console.log("Variable name "+i.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):b[i.variableName]=this[i.variableName])}b.OrionHome=c;return(new k(this.info.uriTemplate)).expand(b)}return null}}};e._createCommandOptions=function(a,c,i,d,g,f){function k(b,h){var j=e._makeValidator(a,i,d,f);b.visibleWhen=j.validationFunction.bind(j);if(g)if(j.generatesURI.bind(j)())b.hrefCallback=function(a){a=
Array.isArray(a.items)?a.items[0]:a.items;return j.getURI.bind(j)(a)};else{var l=a;b.callback=function(a){var d;if(l.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,d=e._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){d=[];for(var g=0;g<a.items.length;g++)d.push(e._cloneItemWithoutChildren(a.items[g]))}else d=e._cloneItemWithoutChildren(a.items);if(i)var f=i.getService("orion.page.progress");c.run?f?f.progress(c.run(d),"Running command: "+b.name):c.run(d):i&&(f?f.progress(i.getService(c).run(d),
"Running command: "+b.name):i.getService(c).run(d))}}h.resolve(b)}var h=new j;a.nls?b.getMessageBundle(a.nls).then(function(c){k({name:a.nameKey?c[a.nameKey]:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltipKey?c[a.tooltipKey]:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},h)}):k({name:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},h);return h};e.getOpenWithCommands=function(a){var c=[],b;for(b in a._commandList){var e=a._commandList[b];
e.isEditor&&c.push(e)}return c};var i;e.createAndPlaceFileCommandsExtension=function(a,c,b,i,d,g){var f=!!g;return e.createFileCommands(a,null,g?"all":void 0,f).then(function(a){c._addedOpenWithCommands=f;var e=!1,g=!1;a.forEach(function(a){c.addCommand(a);d&&!e&&(e=!0,c.addCommandGroup(b,"eclipse.fileCommandExtensions",1E3,null,d));d&&!g&&(g=!0,c.addCommandGroup(b,"eclipse.openWith",1E3,"Open With",d+"/eclipse.fileCommandExtensions"));this.isEditor?c.registerCommandContribution(b,a.id,i+this.index,
d?d+"/eclipse.fileCommandExtensions/eclipse.openWith":null):c.registerCommandContribution(b,a.id,i+this.index,d?d+"/eclipse.fileCommandExtensions":null)});return{}})};e.createFileCommands=function(a,c,b,d){var b=b===void 0?"global":b,d=d===void 0?!0:d,g=a.getServiceReferences("orion.navigate.command"),f=[];if(b==="all"||b==="global")for(var k=0;k<g.length;k++)if(g[k].getProperty("id")!=="orion.navigateFromMetadata"){for(var l=a.getService(g[k]),y={},z=g[k].getPropertyKeys(),B=0;B<z.length;B++)y[z[B]]=
g[k].getProperty(z[B]);(b==="all"||y.forceSingleItem&&y.showGlobally)&&f.push({properties:y,service:l})}return j.when(function(){var b=a.getService("orion.core.contentTypeRegistry")||c;return i||j.when(b.getContentTypes(),function(a){return i=a})}(),function(){f=d?f.concat(e._getOpenWithNavCommandExtensions(a,i)):f;var c=f.map(function(c){var b=c.properties;return e._createCommandOptions(b,c.service,a,i,!0).then(function(a){a=new h.Command(a);if(b.isEditor)a.isEditor=b.isEditor;return a})});return j.all(c,
function(a){return{_error:a}}).then(function(a){return a})})};e.createOpenWithCommands=function(a,c,b){return b&&b._addedOpenWithCommands?(new j).resolve(e.getOpenWithCommands(b)):e.createFileCommands(a,c,"none",!0)};return e});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages,orion/Deferred,orion/explorers/explorer,orion/explorers/navigationUtils,orion/extensionCommands,orion/objects,orion/URITemplate,orion/webui/littlelib".split(","),function(l,j,h,f,d,k,b,g){function a(a,e,g,f,h,l,u,v,r){var e=k.clone(e),q;if(e.Directory)q=document.createElement("a"),q.className="navlinkonpage",q.href=!a?c:(new b(a+"#{,resource,params*}")).expand({resource:e.ChildrenLocation}),e.Name&&q.appendChild(document.createTextNode(e.Name));
else{h||(h=d.getOpenWithCommands(g));if(!l)for(a=0;a<h.length;a++)h[a].isEditor==="default"&&(l=h[a]);q=document.createElement("a");q.className="navlink targetSelector";u&&typeof u==="object"&&Object.keys(u).forEach(function(a){q[a]=u[a]});var y=null,z=null;if(y=r?r.holderDom:q)z=document.createElement("span"),z.className="core-sprite-file modelDecorationSprite",y.appendChild(z);e.Name&&q.appendChild(document.createTextNode(e.Name));var B=!1,D=e.Location;if(v&&typeof v==="object")e.params={},k.mixin(e.params,
v);for(a=0;a<h.length;a++)if(v=h[a],v.visibleWhen(e)){D=v.hrefCallback({items:e});B=!0;break}j.when(f.getFileContentType(e),function(a){var c;if(c=!B)if(c=l){a:{switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":c=!0;break a}c=!1}c=!c}c&&(D=l.hrefCallback({items:e}));if(y){c=y;var b=e.Location,d=z,i;switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":i=document.createElement("img");
i.src=b;i.classList.add("thumbnail");break;default:if(a&&a.image)i=document.createElement("img"),i.src=a.image,i.classList.add("thumbnail")}i&&c.replaceChild(i,d)}q.href=D})}return q}function e(a,c,b,e){this.explorer=c;this.commandService=b;this.contentTypeService=e;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var c=new b("#{,resource,params*}");e.prototype=new h.SelectionRenderer;e.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};
e.prototype.tableCallback=function(a){a.setAttribute("aria-label",l.Navigator);a.setAttribute("role","presentation")};e.prototype.rowCallback=function(a){a.setAttribute("role","treeitem")};e.prototype.emptyCallback=function(a){var c=document.createElement("tr"),b=document.createElement("td");b.colSpan=this.oneColumn?1:3;var e=document.createElement("div");e.classList.add("noFile");e.textContent=l.NoFile;var d=document.createElement("span");d.classList.add("core-sprite-addcontent");d.classList.add("icon-inline");
d.classList.add("imageSprite");g.processDOMNodes(e,[d]);b.appendChild(e);c.appendChild(b);a.appendChild(c)};e.prototype.getCellHeaderElement=function(a){if(this.oneColumn&&a!==0)return null;switch(a){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};e.prototype.setTarget=function(a){this.target=a};e.prototype.getFolderImage=function(){if(!this.showFolderImage)return null;var a=document.createElement("span");a.className="core-sprite-folder modelDecorationSprite";return a};e.prototype.createFolderNode=
function(c){var b;this.showFolderLinks?(b=a(this.folderLink||"",c,this.commandService,this.contentTypeService),(c=this.getFolderImage(c))&&b.insertBefore(c,b.firstChild)):(b=document.createElement("span"),b.textContent=c.Name);return b};e.prototype.showFolderLinks=!0;e.prototype.getCellElement=function(c,b,e){switch(c){case 0:var c=document.createElement("td"),g=document.createElement("span");g.id=e.id+"MainCol";g.setAttribute("role","presentation");c.appendChild(g);c.setAttribute("role","presentation");
g.className="mainNavColumn";var k;if(b.Directory)this.getExpandImage(e,g),k=this.createFolderNode(b),g.appendChild(k),this.explorer._makeDropTarget(b,k),this.explorer._makeDropTarget(b,e);else{if(!this.openWithCommands){this.openWithCommands=d.getOpenWithCommands(this.commandService);for(k=0;k<this.openWithCommands.length;k++)if(this.openWithCommands[k].isEditor==="default")this.defaultEditor=this.openWithCommands[k]}k=a("",b,this.commandService,this.contentTypeService,this.openWithCommands,this.defaultEditor,
{target:this.target});g.appendChild(k)}if(k)k.id=e.id+"NameLink",k.nodeType===1&&(f.addNavGrid(this.explorer.getNavDict(),b,k),k.setAttribute("role","link"),k.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,g,b,this.explorer,"tool",null,!0);return c;case 1:if(this.oneColumn)return null;e=document.createElement("td");if(b.LocalTimeStamp)e.textContent=(new Date(b.LocalTimeStamp)).toLocaleString();return e;case 2:if(this.oneColumn)return null;
e=document.createElement("td");if(!b.Directory&&typeof b.Length==="number")b=parseInt(b.Length,10)/1024,e.textContent=Math.ceil(b).toLocaleString()+" KB";e.style.textAlign="right";return e}};e.prototype.constructor=e;return{NavigatorRenderer:e,createLink:a}});
define("orion/searchClient","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/i18nUtil,orion/searchUtils,orion/crawler/searchCrawler,orion/explorers/navigatorRenderer,orion/extensionCommands,orion/Deferred".split(","),function(l,j,h,f,d,k,b,g,a){function e(a,c){this.serviceRegistry=a;this.commandRegistry=c;this.openWithCommands=null}function c(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new e(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}e.prototype.makeRenderFunction=function(c,e,k,n,p){var t=this.serviceRegistry,u=this.commandRegistry;this.openWithCommands=this.openWithCommands||g.createOpenWithCommands(t,c,u);var v=this;return function(g,t,y,z){a.when(v.openWithCommands,function(a){if(y)h.empty(e),a=document.createElement("div"),a.appendChild(document.createTextNode(l["Search failed."])),e.appendChild(a),typeof n==="function"&&n(e);else{var v=
function(){function a(c,b){var e=b.folderName?b.folderName:b.path,d=document.createElement("span");d.id=e.replace(/[^a-zA-Z0-9_\.:\-]/g,"");d.appendChild(document.createTextNode(" - "+e+" "));c.appendChild(d)}var c={};return function(b,e){var d=e.name;if(c.hasOwnProperty(d)){a(b,e);var i=c[d];typeof i==="function"&&(c[d]=null,i())}else c[d]=function(){a(b,e)}}}(),H=!1;h.empty(e);if(g&&g.length>0){var C=document.createElement("table");C.setAttribute("role","presentation");for(var s=0;s<g.length;s++){var A=
g[s],x;if(!H&&(H=!0,k))x=C.insertRow(0).insertCell(0),x.textContent=k;x=C.insertRow(-1).insertCell(0);x.colspan=2;p&&p(x);var w={Name:A.name,Directory:A.directory,Location:A.path||A.location},F=null;if(typeof A.LineNumber==="number")F={},F.line=A.LineNumber;if(z&&z.keyword&&!z.nameSearch){var E=d.generateSearchHelper(z),F=F||{};F.find=E.inFileQuery.searchStr;F.regEx=E.inFileQuery.wildCard?!0:void 0}w=b.createLink(j.toUrl("edit/edit.html"),w,u,c,a,null,{"aria-describedby":(A.folderName?A.folderName:
A.path).replace(/[^a-zA-Z0-9_\.:\-]/g,""),style:{verticalAlign:"middle"}},F);A.LineNumber&&w.appendChild(document.createTextNode(" (Line "+A.LineNumber+")"));x.appendChild(w);v(x,A)}e.appendChild(C);typeof n==="function"&&n(e)}!H&&t&&(a=f.formatMessage(l["No matches found for ${0}"],t),h.empty(e),e.appendChild(document.createTextNode(a)),typeof n==="function"&&n(e))}})}};c.prototype={search:function(a,c,b){var e=function(a){for(var c=[],b=0;b<a.response.docs.length;b++){var e=a.response.docs[b];c.push({name:e.Name,
path:e.Location,folderName:d.path2FolderName(e.Path?e.Path:e.Location,e.Name),directory:e.Directory,lineNumber:e.LineNumber})}return c};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(c){b(e(c),a.keyword,null,a)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(c){var d=a.keyword,d=d.substring(d.indexOf("}")+1),d=d.substring(d.indexOf(":")+1);b(e(c),d,null,a)},function(a){b(null,null,a,null)})}catch(g){typeof g===
"string"&&g.indexOf("search")>-1&&this._crawler?this._crawler.searchName(a,function(c){b(e(c),null,null,a)}):typeof g==="string"&&g.indexOf("search")>-1&&!a.nameSearch?(new k.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(c){b(e(c),null,null,a)}):this.registry.getService("orion.page.message").setErrorMessage(g)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=a},handleError:function(a,c){console.error(a);
h.empty(c);c.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,c){var b="",e=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);c&&a&&a.Parents&&a.Parents.length>0?e=c.index==="last"?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&a.Directory&&a.Location&&a.Parents&&(e=a);if(e)this.setLocationbyURL(e.Location),b=e.Name,this._childrenLocation=e.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),b=this._fileService.fileServiceName(a.Location),
this._childrenLocation=a.ChildrenLocation;e=h.node("search");b||(b="");if(e&&e.placeholder){e.value="";var d=f.formatMessage(l["Search ${0}"],b);e.placeholder=d.length>30?d.substring(0,27)+"...":f.formatMessage(l["Search ${0}"],b)}if(e&&e.title)e.title=l["Type a keyword or wild card to search in "]+b},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=a},getSearchLocation:function(){return this._searchLocation?
this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,c,b,e){b=b?this.getSearchRootLocation():this.getSearchLocation();return c?{resource:b,sort:"NameLower asc",rows:100,start:0,nameSearch:!0,keyword:a}:{resource:b,
sort:e&&e.sort?e.sort:"Path asc",rows:e&&e.rows?e.rows:40,start:0,caseSensitive:e?e.caseSensitive:void 0,regEx:e?e.regEx:void 0,fileType:e?e.fileType:void 0,keyword:a,replace:e?e.replace:void 0}}};c.prototype.constructor=c;return{Searcher:c}});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(l,j,h){return{slideoutHTMLFragment:function(f){var d=document.createElement("div");d.innerHTML=h;var k=j.$("#slideContainer",d);k.id=f+k.id;k=j.$("#pageCommandParameters",d);k.id=f+k.id;k=j.$("#pageCommandDismiss",d);k.id=f+k.id;return d.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(l){function j(f,d,k,b,g,a){this.type=a||"keydown";this.keyCode=typeof f==="string"&&this.type==="keydown"?f.toUpperCase().charCodeAt(0):f;this.mod1=d!==void 0&&d!==null?d:!1;this.mod2=k!==void 0&&k!==null?k:!1;this.mod3=b!==void 0&&b!==null?b:!1;this.mod4=g!==void 0&&g!==null?g:!1}function h(f){this.keys=f}j.prototype={getKeys:function(){return[this]},match:function(f,d){if(d!==void 0){if(d!==0)return!1}else if(f instanceof Array){if(f.length>1)return!1;
f=f[0]}return f.type!==this.type?!1:this.keyCode===f.keyCode||this.keyCode===String.fromCharCode(l.isOpera?f.which:f.charCode!==void 0?f.charCode:f.keyCode)?this.mod1!==(l.isMac?f.metaKey:f.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==f.shiftKey?!1:this.mod3!==f.altKey?!1:l.isMac&&this.mod4!==f.ctrlKey?!1:!0:!1},equals:function(f){return!f?!1:this.keyCode!==f.keyCode?!1:this.mod1!==f.mod1?!1:this.mod2!==f.mod2?!1:this.mod3!==f.mod3?!1:this.mod4!==f.mod4?!1:this.type!==f.type?!1:!0}};h.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(f,d){var k=this.keys;if(d!==void 0)return d>k.length?!1:k[d].match(f)?d===k.length-1?!0:d+1:!1;else{f instanceof Array||(f=[f]);if(f.length>k.length)return!1;var b;for(b=0;b<f.length;b++)if(!k[b].match(f[b]))return!1;return b===k.length?!0:b}},equals:function(f){if(!f.keys)return!1;if(f.keys.length!==this.keys.length)return!1;for(var d=0;d<f.keys.length;d++)if(!f.keys[d].equals(this.keys[d]))return!1;return!0}};return{KeyBinding:j,KeyStroke:j,
KeySequence:h}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(l,j,h){function f(d,f){this._activeContainer=null;this._getElementsFunction=d;this._toolbarLayoutFunction=f}f.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&h.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&h.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();if(this._oldFocusNode)this._oldFocusNode.focus(),this._oldFocusNode=null}this._activeElements=null},open:function(d,f,b){typeof d==="string"&&(d=h.node(d));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===d)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(d))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=b;var g=f(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!g)return!1;this._activeElements.focusNode=g;d=h.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(d.length===0){f=this._activeElements.dismissArea||
this._activeElements.parameterArea;d=document.createElement("button");d.id="closebox";d.className="imageSprite core-sprite-close dismissButton";d.title=l.Close;f.appendChild(d);var a=this;d.addEventListener("click",function(){a.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);if(g)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){g.focus();g.select&&g.select()},0);this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(d,f){h.$$array("input",f).forEach(function(b){b.type==="checkbox"?d.parameters.setValue(b.parameterName,b.checked):b.type!=="button"&&d.parameters.setValue(b.parameterName,b.value.trim())});h.$$array("textArea",f).forEach(function(b){d.parameters.setValue(b.parameterName,b.value.trim())});d.command.callback&&d.command.callback.call(d.handler,d)},collectParameters:function(d){return d.parameters?
(d.domNode&&d.domNode.classList.add("commandMarker"),this.open(d.domNode||d.domParent,this.getFillFunction(d))):!1},getFillFunction:function(d,f){var b=this;return function(g,a){var e=null,c=function(){f&&f();b.close()},i=function(a){a.keyCode===h.KEY.ENTER&&b._collectAndCall(d,g);if(a.keyCode===h.KEY.ESCAPE||a.keyCode===h.KEY.ENTER)c(),h.stop(a)};d.parameters.forEach(function(a){var b=null;if(a.label)b=document.createElement("label"),b.classList.add("parameterInput"),b.setAttribute("for",a.name+
"parameterCollector"),b.textContent=a.label,g.appendChild(b);var d=a.name+"parameterCollector",f=b||g;if(a.type==="text"&&typeof a.lines==="number"&&a.lines>1)b=document.createElement("textarea"),b.rows=a.lines,b.type="textarea",b.id=d,f.appendChild(b),i=function(a){a.keyCode===h.KEY.ESCAPE&&(c(),h.stop(a))};else if(a.type==="boolean"){if(b=document.createElement("input"),b.type="checkbox",b.id=d,f.appendChild(b),a.value)b.checked=!0}else if(b=document.createElement("input"),b.type=a.type,b.id=d,
f.appendChild(b),a.value)b.value=a.value;b.classList.add("parameterInput");b.setAttribute("speech","speech");b.setAttribute("x-webkit-speech","x-webkit-speech");b.parameterName=a.name;e||(e=b);b.addEventListener("keydown",i,!1)});var j=a;j||(j=document.createElement("span"),j.classList.add("layoutRight"),j.classList.add("parametersDismiss"),g.appendChild(j));var o=function(a,c){var b=document.createElement("button");c.appendChild(b);a&&b.appendChild(document.createTextNode(a));b.classList.add("dismissButton");
return b};if(d.parameters.hasOptionalParameters())d.parameters.optionsRequested=!1,o(l.More,j).addEventListener("click",function(){d.parameters.optionsRequested=!0;b._collectAndCall(d,g);c()},!1);o(l.Submit,j).addEventListener("click",function(){b._collectAndCall(d,g);c()},!1);j=o(null,j);j.id="closebox";j.classList.add("imageSprite");j.classList.add("core-sprite-close");j.title=l.Close;j.addEventListener("click",function(){c()},!1);return e}}};f.prototype.constructor=f;return{CommandParameterCollector:f}});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(l,j){function h(f){this._init(f)}h.prototype={_init:function(f){var d=j.node(f.container);if(!d)throw"no parent container";this._container=d;d.classList.remove("currentLocation");this._id=f.id||"eclipse.breadcrumbs";this._resource=f.resource||null;this._rootSegmentName=f.rootSegmentName;this._workspaceRootSegmentName=f.workspaceRootSegmentName;this._workspaceRootURL=f.workspaceRootURL;this._makeHref=f.makeHref;this.path="";this.measure();
this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var f;if(this._resource&&this._resource.Parents){f=document.createElement("a");var d=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(f,d):f.href=l.toUrl("edit/edit.html")+"#"+d}else f=document.createElement("span");j.empty(f);f.appendChild(document.createTextNode(this._workspaceRootSegmentName));return f}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(f){var d=
document.createElement("a");d.classList.add("breadcrumb");d.appendChild(document.createTextNode(f));return d},addSegmentHref:function(f,d){this._makeHref?this._makeHref(f,d.Location,d):f.href=l.toUrl("edit/edit.html")+"#"+d.ChildrenLocation},buildSegments:function(f,d){if(this._resource.Parents){var k=this._resource.Parents.slice(0),b,g;k&&(k=k.slice(0),d==="reverse"&&(k=k.reverse().slice(0)),k.forEach(function(a){f?(g=f,f=null):g=a.Name;b=this.buildSegment(g);this.path+=a.Name;this.addSegmentHref(b,
a);b.include=!1;this.segments.push(b)}.bind(this)))}},addDivider:function(){var f=document.createElement("span");f.appendChild(document.createTextNode(" / "));this.path+="/";f.classList.add("breadcrumbSeparator");this.append(f)},refresh:function(){(this.crumbs=j.node(this._id))?j.empty(this.crumbs):(this.crumbs=document.createElement("span"),this.crumbs.id=this._id,this._container.appendChild(this.crumbs),this.dirty=document.createElement("span"),this.dirty.id="dirty",this.dirty.className="modifiedFileMarker",
this._container.appendChild(this.dirty));this.crumbs.style.width="auto";this.crumbs.style.visibility="visible";this.crumbs.parentNode.className="currentLocation";this.crumbs.parentNode.style.width="auto"},append:function(f){this.crumbs.appendChild(f)},addTitle:function(f,d){var k=d||document.title;this.crumbs.childNodes.length===0&&(f=document.createElement("span"),f.appendChild(document.createTextNode(k)),f.classList.add("breadcrumb"),f.classList.add("currentLocation"),this.append(f))},finalSegment:function(f,
d){f=document.createElement("span");d?f.appendChild(document.createTextNode(d)):f.appendChild(document.createTextNode(this._resource.Name));f.classList.add("currentLocation");this.path+=this._resource.Name;this.append(f)},firstSegment:function(f){if(f)this.append(f),this._resource&&this._resource.Parents?(f.classList.add("breadcrumb"),this.addDivider()):(f.href="",f.classList.add("currentLocation"))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(f){f.include===
!0&&(this.append(f),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var f=this.segments.slice(0).reverse();f.forEach(function(d){this.append(d);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?d.include=!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=f.reverse()}},measure:function(){var f=document.getElementById("location");f.style.width="auto";this.MAX_LENGTH=f.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility=
"hidden";var f=this.getNavigatorWorkspaceRootSegment(),d=this._rootSegmentName;if(d)this.addTitle(f,d);else if(this.finalSegment(f,d),this._resource&&this._resource.Parents&&(this.buildSegments(d,"reverse"),this.measureSegments(),this.firstSegment(f)),this.crumbs.offsetWidth>=this.MAX_LENGTH)this.INCLUDE_FIRST_SECTION=!1},render:function(){this.refresh();var f=this.getNavigatorWorkspaceRootSegment(),d=this._rootSegmentName;d?this.addTitle(f,d):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(f),
this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(f,d)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};h.prototype.constructor=h;return{BreadCrumbs:h}});
define("orion/webui/splitter",["require","orion/EventTarget","orion/webui/littlelib"],function(l,j,h){function f(d){j.attach(this);this._init(d)}f.prototype={_init:function(d){this._tracking=null;this._animationDelay=501;this.$node=h.node(d.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=h.node(d.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=h.node(d.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";this._vertical=
d.vertical;this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(d.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add(this._vertical?"splitVerticalThumbLayout":"splitThumbLayout");this._closeByDefault=this.$node.getAttribute("data-initial-state")==="closed";if(typeof d.closeByDefault!=="undefined")this._closeByDefault=d.closeByDefault;this._initializeFromStoredSettings();this._closed?
(this._closed=!1,this._thumbDown(!0,!0)):this._adjustToSplitPosition();this.$node.style.visibility="visible";this.$mainNode.style.display="block";this.$sideNode.style.display="block";this.$node.addEventListener("mousedown",this._mouseDown.bind(this),!1);window.addEventListener("mouseup",this._mouseUp.bind(this),!1);window.addEventListener("resize",this._resize.bind(this),!1)},isClosed:function(){return this._closed},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||
this._thumbDown()},addResizeListener:function(d){this.addEventListener("resize",function(f){d(f.node)})},_initializeFromStoredSettings:function(){var d=localStorage.getItem(this._prefix+"/toggleState");this._closed=typeof d==="string"?d==="closed":this._closeByDefault;if(this._vertical)if(d=localStorage.getItem(this._prefix+"/yPosition"))this._splitTop=parseInt(d,10);else{if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitTop=0}else if(d=localStorage.getItem(this._prefix+
"/xPosition"))this._splitLeft=parseInt(d,10);else if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitLeft=0},_getSplitPosition:function(){var d=h.bounds(this.$node),f=h.bounds(this.$node.parentNode);return this.vertical?d.top-f.top:d.left-f.left},_adjustToSplitPosition:function(d){var f=h.bounds(this.$node),b=h.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=f.height;if(d||!this._splitTop)this._splitTop=f.top,localStorage.setItem(this._prefix+"/yPosition",
this._splitTop);d=this._splitTop;this.$node.parentNode.style.position==="relative"&&(d=this._splitTop-b.top);this.$sideNode.style.height=d+"px";this.$sideNode.style.display="block";this.$node.style.top=d+"px"}else{this._splitWidth=f.width;if(d||!this._splitLeft)this._splitLeft=f.left,localStorage.setItem(this._prefix+"/xPosition",this._splitLeft);d=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(d=this._splitLeft-b.left);this.$sideNode.style.width=d+"px";this.$sideNode.style.display=
"block";this.$node.style.left=d+"px"}this._resize()},_resize:function(d,f,b){var d=d||0,g=h.bounds(this.$node.parentNode),a=h.bounds(this.$node);if(this._vertical){if(b===void 0)b=a.top,this.$node.parentNode.style.position==="relative"&&(b-=g.top);b+=a.height;this.$mainNode.style.top=b+"px"}else{if(f===void 0)f=a.left,this.$node.parentNode.style.position==="relative"&&(f-=g.left);f+=a.width;this.$mainNode.style.left=f+"px"}var e=this;window.setTimeout(function(){e._notifyResizeListeners(e.$mainNode);
e._notifyResizeListeners(e.$sideNode)},d)},_notifyResizeListeners:function(d){this.dispatchEvent({type:"resize",node:d})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(d,f){d||this._addAnimation();var b=this._splitTop,g=this._splitLeft;if(this._closed){if(this._closed=!1,!this._splitLeft&&!this._splitTop&&typeof this._initialSplit==="number")b=g=this._initialSplit}else this._closed=!0,b=g=0;this._vertical?(this.$sideNode.style.height=
b+"px",this.$node.style.top=b+"px"):(this.$sideNode.style.width=g+"px",this.$node.style.left=g+"px");this._resize(this._animationDelay,g,b);d||this._removeAnimation();f||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var a=this;window.setTimeout(function(){a._notifyToggleListeners()},this._animationDelay)},_removeAnimation:function(){var d=this;window.setTimeout(function(){d.$sideNode.classList.remove(d._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");
d.$mainNode.classList.remove(d._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");d.$node.classList.remove(d._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add(this._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");this.$mainNode.classList.add(this._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");this.$node.classList.add(this._vertical?"splitVerticalLayoutAnimation":
"splitLayoutAnimation")},_mouseDown:function(d){if(d.target===this._thumb)return h.stop(d),this._thumbDown();if(!this._tracking)this.$node.classList.add("splitTracking"),this.$mainNode.classList.add("panelTracking"),this.$sideNode.classList.add("panelTracking"),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),h.stop(d)},_mouseMove:function(d){if(this._tracking){var f=h.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=d.clientY;if(this._splitTop<
f.top+5)this._splitTop=f.top+5;else if(this._splitTop>f.top+f.height-5)this._splitTop=f.top+f.height-5;var b=this._splitTop;this.$node.parentNode.style.position==="relative"&&(b=this._splitTop-f.top);this.$node.style.top=b+"px"}else{this._splitLeft=d.clientX;if(this._splitLeft<f.left+5)this._splitLeft=f.left+5;else if(this._splitLeft>f.left+f.width-5)this._splitLeft=f.left+f.width-5;b=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(b=this._splitLeft-f.left);this.$node.style.left=
b+"px"}this._adjustToSplitPosition(!0);h.stop(d)}},_mouseUp:function(d){if(this._tracking)window.removeEventListener("mousemove",this._tracking),this._tracking=null,this.$node.classList.remove("splitTracking"),this.$mainNode.classList.remove("panelTracking"),this.$sideNode.classList.remove("panelTracking"),h.stop(d)}};f.prototype.constructor=f;return{Splitter:f}});
define("orion/widgets/themes/ThemePreferences",[],function(){function l(j,h){this._preferences=j;this._themeData=h;var f=h.getThemeStorageInfo(),d=j.listenForChangedSettings(f.storage,2,function(f){f.key===d&&this.apply()}.bind(this))}l.prototype={_initialize:function(j,h,f){var d=f.get(j.styleset);d||(d=h.getStyles(),f.put(j.styleset,JSON.stringify(d)));(h=f.get("selected"))&&(h=JSON.parse(h));if(!h||h[j.selectedKey]===void 0)h=h||{},h[j.selectedKey]=j.defaultTheme,f.put("selected",JSON.stringify(h))},
apply:function(){this.setTheme()},getTheme:function(j){var h=this._themeData,f=h.getThemeStorageInfo();this._preferences.getPreferences(f.storage,2).then(function(d){this._initialize(f,h,d);var k=JSON.parse(d.get("selected")),d=JSON.parse(d.get(f.styleset)),b;if(d)for(var g=0;g<d.length;g++)if(d[g].name===k[f.selectedKey]){b=d[g];break}j({style:b,styles:d})}.bind(this))},setTheme:function(j,h){var f=this._themeData,d=f.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(k){this._initialize(d,
f,k);var b=JSON.parse(k.get("selected"));j||(j=b[d.selectedKey]);b[d.selectedKey]=j;k.put("selected",JSON.stringify(b));h?k.put(d.styleset,JSON.stringify(h)):h=JSON.parse(k.get(d.styleset));for(k=0;k<h.length;k++)if(h[k].name===b[d.selectedKey]){f.processSettings(h[k]);break}}.bind(this))},setFontSize:function(j){var h=this._themeData,f=h.getThemeStorageInfo();this._preferences.getPreferences(f.storage,2).then(function(d){this._initialize(f,h,d);var k=JSON.parse(d.get("selected")),b=JSON.parse(d.get(f.styleset)),
g;if(b)for(var a=0;a<b.length;a++)b[a].fontSize=j,b[a].name===k[f.selectedKey]&&(g=b[a]);d.put(f.styleset,JSON.stringify(b));h.processSettings(g)}.bind(this))}};return{ThemePreferences:l}});
define("orion/settings/nls/root/messages",{"Plugin Description":"Plugin Description",Create:"Create","Loading...":"Loading...","Label:":"Label:",Title:"Title",Plugins:"Plugins","User Profile":"User Profile","Git Settings":"Git Settings",General:"General",Navigation:"Navigation",Links:"Links","Open in same tab":"Open in same tab","Open in new tab":"Open in new tab",Font:"Font",Family:"Family","Sans Serif":"Sans Serif",Serif:"Serif",Size:"Size","8pt":"8pt","9pt":"9pt","10pt":"10pt","12pt":"12pt",Color:"Color",
Background:"Background",Strings:"Strings","String Types":"String Types",blue:"blue",Weight:"Weight",Normal:"Normal",Bold:"Bold",Comments:"Comments","Comment Types":"Comment Types",green:"green",Keywords:"Keywords","Keyword Types":"Keyword Types",darkred:"darkred",Categories:"Categories",Username:"Username","Full Name":"Full Name","Email Address":"Email Address","Email Confirmed":"Email Confirmed",Account:"Account","Current Password":"Current Password","New Password":"New Password","Verify Password":"Verify Password",
Password:"Password",OpenId:"OpenId",AOL:"AOL",Yahoo:"Yahoo",Google:"Google",Unlink:"Unlink",Link:"Link",Unlinked:"Unlinked",Linked:"Linked","Linked Accounts":"Linked Accounts","Git Email Address":"Git Email Address","Git Username":"Git Username","Git Credentials Storage":"Git Credentials Storage",Update:"Update","Update Profile Settings":"Update Profile Settings","Update Git User Settings":"Update Git User Settings","Update Git Credentials":"Update Git Credentials","User profile data successfully updated.":"User profile data successfully updated.",
"Git user data successfully updated.":"Git user data successfully updated.","Git Credentials successfully updated.":"Git Credentials successfully updated.","Edit Plugin JavaScript":"Edit Plugin JavaScript","Install Plugin":"Install Plugin","Plugin Name:":"Plugin Name:","Author Name:":"Author Name:","Licence:":"Licence:","Description:":"Description:","A plugin for Eclipse Orion":"A plugin for Eclipse Orion","Plugin Link":"Plugin Link",Install:"Install","Install a plugin by specifying its URL":"Install a plugin by specifying its URL",
"Plugin URL:":"Plugin URL:",Disable:"Disable",DisableTooltip:"Disable the plugin",Enable:"Enable",EnableTooltip:"Enable the plugin","Reload all":"Reload all","Reload all installed plugins":"Reload all installed plugins","Create a new Orion Plugin":"Create a new Orion Plugin","Find More Orion Plugins":"Find More Orion Plugins","Get Plugins":"Get Plugins",Reload:"Reload","Reload the plugin":"Reload the plugin",Delete:"Delete","Delete this plugin from the configuration":"Delete this plugin from the configuration",
"Type a plugin url here ...":"Type a plugin url here ...","Installed ":"Installed ","Installing ":"Installing ","Already installed":"Already installed"," plugin":" plugin","Reloaded ":"Reloaded ","Uninstalled ":"Uninstalled ","Are you sure you want to uninstall '":"Are you sure you want to uninstall '",Services:"Services",Value:"Value","JavaScript Object":"JavaScript Object","click here, then check javascript console to drill down":"click here, then check javascript console to drill down",Item:"Item",
"Git Config":"Git Config","Clear Git Credentials":"Clear Git Credentials","Enable Storage":"Enable Storage","Please be aware that your credentials will be stored persistently in the browser.":"Please be aware that your credentials will be stored persistently in the browser.","Do you wish to enable the Key Storage?":"Do you wish to enable the Key Storage?",general:"General",validation:"Validation","Deleted git credentials for ${0}":"Deleted git credentials for ${0}",Editor:"Editor",editorSettings:"Settings",
EditorThemes:"Themes",Import:"Import","Import a theme":"Import a theme",fileManagement:"File Management",typing:"Typing",autoSave:"Auto Save",autoSaveTimeout:"Save interval (ms)",autoLoad:"Auto Load",saveDiffs:"Save file as diffs",trimTrailingWhiteSpace:"Trim Trailing Whitespace on Save",Restore:"Restore Defaults",Default:"Default",keys:"Keys",tabs:"Tabs",tabSize:"Tab Size",expandTab:"Insert spaces for tabs",smoothScrolling:"Smooth Scrolling",scrollAnimation:"Scrolling Animation",scrollAnimationTimeout:"Scrolling Duration (ms)",
keyBindings:"Key Bindings",rulers:"Rulers",annotationRuler:"Show Annotation Ruler",lineNumberRuler:"Show Line Number Ruler",foldingRuler:"Show Folding Ruler",overviewRuler:"Show Overview Ruler",whitespaces:"White Spaces",wrapping:"Wrapping",wordWrap:"Word Wrap",showMargin:"Show Margin",marginOffset:"Margin Column",showTabs:"Show Tabs",showSpaces:"Show Spaces",autoSaveTimeoutInvalid:"Invalid save interval.",scrollAnimationTimeoutInvalid:"Invalid scrolling duration.",tabSizeInvalid:"Invalid tab size.",
localSettingsTooltip:"Toggle whether this setting is shown in local editor settings drop down.",autoPairParentheses:"Autopair (Parentheses)",autoPairBraces:"Autopair {Braces}",autoPairSquareBrackets:"Autopair [Square] Brackets",autoPairAngleBrackets:"Autopair <Angle> Brackets",autoPairQuotations:'Autopair "Strings"',autoCompleteComments:"Autocomplete /** Block Comments */",smartIndentation:"Smart Indentation",sourceControl:"Source Control",showBlame:"Show Blame","Editor preferences updated":"Editor preferences updated",
"Editor defaults restored":"Editor defaults restored",Theme:"Theme","Font Size":"Font Size","New Theme Name:":"New Theme Name:","Font Size:":"Font Size:","UI Theme":"UI Theme","Navigation Bar":"Navigation Bar","Navigation Text":"Navigation Text","Search Box":"Search Box","Tool Panel":"Tool Panel","Selection Bar":"Selection Bar",Location:"Location",Content:"Content","Main Panel":"Main Panel",Button:"Button","Button Text":"Button Text","Section Text":"Section Text","Side Panel":"Side Panel","Line Color":"Line Color",
"Line Numbers":"Line Numbers",Foreground:"Foreground","Current Line":"Current Line","HTML Attribute":"HTML Attribute","Overview Ruler":"Overview Ruler","HTML Tag":"HTML Tag","Annotation Ruler":"Annotation Ruler","Show Guide":"Show Guide","Check Guide":"Check Guide",Cancel:"Cancel","Revert Theme":"Revert Theme","Update Theme":"Update Theme","Theme:":"Theme:",clickDiagram:"Click diagram to style.",clickUpdate:"Click Update button to save preview.","CSS Class Name":"CSS Class Name","CSS Attribute":"CSS Attribute",
"CSS Value":"CSS Value","CSS Text":"CSS Text","COLOR:":"Color:","NEW COLOR:":"New Color:",Ok:"Ok","OR HEX:":"Or Hex: "});define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(l,j){var h={root:j};Object.keys(l).forEach(function(f){typeof h[f]==="undefined"&&(h[f]=l[f])});return h});
define("orion/editor/eventTarget",[],function(){function l(){}l.addMixin=function(j){var h=l.prototype,f;for(f in h)h.hasOwnProperty(f)&&(j[f]=h[f])};l.prototype={addEventListener:function(j,h,f){if(!this._eventTypes)this._eventTypes={};var d=this._eventTypes[j];d||(d=this._eventTypes[j]={level:0,listeners:[]});d.listeners.push({listener:h,useCapture:f})},dispatchEvent:function(j){var h=j.type;this._dispatchEvent("pre"+h,j);this._dispatchEvent(h,j);this._dispatchEvent("post"+h,j)},_dispatchEvent:function(j,
h){var f=this._eventTypes?this._eventTypes[j]:null;if(f){var d=f.listeners;try{if(f.level++,d)for(var k=0,b=d.length;k<b;k++)if(d[k]){var g=d[k].listener;typeof g==="function"?g.call(this,h):g.handleEvent&&typeof g.handleEvent==="function"&&g.handleEvent(h)}}finally{if(f.level--,f.compact&&f.level===0){for(k=d.length-1;k>=0;k--)d[k]||d.splice(k,1);d.length===0&&delete this._eventTypes[j];f.compact=!1}}}},isListening:function(j){return!this._eventTypes?!1:this._eventTypes[j]!==void 0},removeEventListener:function(j,
h,f){if(this._eventTypes){var d=this._eventTypes[j];if(d){for(var k=d.listeners,b=0,g=k.length;b<g;b++){var a=k[b];if(a&&a.listener===h&&a.useCapture===f){d.level!==0?(k[b]=null,d.compact=!0):k.splice(b,1);break}}k.length===0&&delete this._eventTypes[j]}}}};return{EventTarget:l}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(l,j,h){function f(d){d=d||{};this._document=d.document||document}var d={};f.getTheme=function(k){var k=k||"default",b=d[k];b||(b=d[k]=new f);return b};f.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(d,b){var g=this,a=g._themeClass;g._themeClass=d;this._load(d,b,function(){g.onThemeChanged({type:"ThemeChanged",oldValue:a,newValue:g.getThemeClass()})})},onThemeChanged:function(d){return this.dispatchEvent(d)},
buildStyleSheet:function(d,b){function g(b,c,i){c&&(a.push("."+d+" ."+b+" {"),a.push("\t"+(i?"background-color":"color")+": "+c+";"),a.push("}"))}var a=[];a.push("");a.push("."+d+" {");b.fontFamily&&a.push("\tfont-family: "+b.fontFamily+";");b.fontSize&&a.push("\tfont-size: "+b.fontSize+";");b.fontSize&&a.push("\tcolor: "+b.text+";");a.push("}");a.push("."+d+".textview {");b.background&&a.push("\tbackground-color: "+b.background+";");a.push("}");g("ruler.annotations",b.annotationRuler,!0);g("ruler.lines",
b.annotationRuler,!0);g("ruler.folding",b.annotationRuler,!0);g("ruler.overview",b.overviewRuler,!0);g("rulerLines",b.lineNumber,!1);g("rulerLines.even",b.lineNumberEven,!1);g("rulerLines.odd",b.lineNumberOdd,!1);g("annotationLine.currentLine",b.currentLine,!0);g("entity-name-tag",b.keyword,!1);g("entity-other-attribute-name",b.attribute,!1);g("string-quoted",b.string,!1);g("line_caret",b.currentLine,!0);g("token_keyword",b.keyword,!1);g("token_string",b.string,!1);g("token_singleline_comment",b.comment,
!1);g("token_multiline_comment",b.comment,!1);g("token_doc_comment",b.comment,!1);g("token_doc_html_markup",b.comment,!1);return a.join("\n")},_createStyle:function(d,b,g,a){var e=this._document,d="orion-theme-"+d,c=e.getElementById(d);if(c){if(a||c.firstChild.data===b)return;c.removeChild(c.firstChild);c.appendChild(e.createTextNode(b))}else a?(c=h.createElement(e,"link"),c.rel="stylesheet",c.type="text/css",c.href=b,c.addEventListener("load",function(){g()})):(c=h.createElement(e,"style"),c.appendChild(e.createTextNode(b))),
c.id=d,(e.getElementsByTagName("head")[0]||e.documentElement).appendChild(c);a||g()},_load:function(d,b,g){if(d)if(typeof b==="string")this._createStyle(d,b,g);else if(b=b.href,b.substring(b.length-4)!==".css"&&(b+=".css"),/^\//.test(b)||/[a-zA-Z0-9]+:\/\//i.test(b)||!l.toUrl)this._createStyle(d,b,g,!0);else{var a=this;l(["text!"+b],function(b){a._createStyle(d,b,g,!1)})}else g()}};j.EventTarget.addMixin(f.prototype);return{TextTheme:f}});
define("orion/widgets/themes/ThemeClass",[],function(){function l(j){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=j;this.classString="."+j+"{ "}l.prototype.className=null;l.prototype.classString=void 0;l.prototype.style=void 0;l.prototype.closeString=" }\n";l.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:l}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(l){function j(){}j.prototype.navbar="#333";j.prototype.button="#777777";j.prototype.location="#EFEFEF";j.prototype.selection="FEC";j.prototype.sidepanel="#FBFBFB";j.prototype.mainpanel="white";j.prototype.navtext="#bfbfbf";j.prototype.content="#3087B3";j.prototype.search="#444";j.prototype.toolpanel="white";j.prototype.writeNavigationStyle=function(){var h="",f=[],d=new l.ThemeClass("orionPage");
d.style.backgroundColor="#fdfdfd";d.style.width="100%";d.style.height="100%";f.push(d);d=new l.ThemeClass("topRowBanner");d.style.margin="0";d.style.border="0";d.style.backgroundColor=this.navbar;d.style.height="16px";d.style.padding="10px";d.style.paddingLeft="6px";d.style.paddingRight="2px";f.push(d);d=new l.ThemeClass("a");d.style.textDecoration="none";d.style.color=this.content;f.push(d);d=new l.ThemeClass("navlink");d.style.display="inline-block";d.style.padding="2px";d.style.color=this.content;
f.push(d);d=new l.ThemeClass("primaryNav");d.style.color=this.navtext;d.style.fontSize="8pt";d.style.fontWeight="normal";d.style.paddingTop="0";d.style.verticalAlign="baseline";f.push(d);d=new l.ThemeClass("primaryNav a");d.style.fontSize="8pt";d.style.color=this.navtext;d.style.marginRight="6px";d.style.marginLeft="6px";d.style.verticalAlign="baseline";d.style.textDecoration="none";f.push(d);d=new l.ThemeClass("primaryNav a:hover");d.style.color="#bfbfbf";d.style.cursor="hand";d.style.color="white";
d.style.fontWeight="normal";f.push(d);for(var k in f)h+=f[k].toString();return h};j.prototype.writeLocationStyle=function(){var h="",f=[],d=new l.ThemeClass("titleArea");d.style.margin="0";d.style.paddingTop="5px";d.style.border="0";d.style.background=this.location;d.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.location+"), color-stop(100%,"+this.location+"))";d.style.borderBottom="1px solid "+this.location;d.style.minHeight="20px";f.push(d);d=new l.ThemeClass("breadcrumb");
d.style.fontSize="8pt";d.style.textDecoration="none";d.style.color="#f1f1f2;";d.style.paddingTop="2px";f.push(d);d=new l.ThemeClass("a.breadcrumb:hover");d.style.textDecoration="none";d.style.borderBottom="1px dotted";d.style.color="#F58B0F";d.style.cursor="pointer";f.push(d);d=new l.ThemeClass("breadcrumbSeparator");d.style.fontSize="8pt";d.style.textDecoration="none";d.style.color="#f1f1f2";d.style.fontWeight="bold";f.push(d);d=new l.ThemeClass("currentLocation");d.style.fontWeight="bold";d.style.fontSize=
"8pt";d.style.color="#f1f1f2";d.style.textDecoration="none";d.style.textWrap="normal";d.style.lineHeight="10pt";f.push(d);d=new l.ThemeClass("a.currentLocation:hover");d.style.fontWeight="bold";d.style.fontSize="10pt";d.style.color="#666666";d.style.textDecoration="none";d.style.borderBottom="0";f.push(d);d=new l.ThemeClass("navlinkonpage");d.style.color=this.content;f.push(d);d=new l.ThemeClass("progressPane_running");d.style.background="url(../images/progress_running_dark.gif) no-repeat center";
d.style.width="16px";d.style.height="16px";f.push(d);for(var k in f)h+=f[k].toString();return h};j.prototype.writeButtonStyle=function(){var h="",f=[],d=new l.ThemeClass("commandButton");d.style.color="#666";d.style.border="1px solid #dedede";d.style.backgroundColor="#ddd";d.style.textAlign="center";d.style.verticalAlign="baseline";d.style.cursor="pointer";d.style.display="inline-block";d.style.padding="4px 6px";d.style.borderRadius="3px";d.style.lineHeight="12px";d.style.fontSize="8pt";d.style.userSelect=
"none";f.push(d);d=new l.ThemeClass("commandButton:over");d.style.backgroundColor="#e6e6e6";d.style.border="1px solid #808080";f.push(d);d=new l.ThemeClass("commandMenu");d.style.color="#222";d.style.display="inline-block";d.style.verticalAlign="baseline";d.style.margin="0";d.style.fontSize="8pt";d.style.fontWeight="normal";d.style.border="1px solid #dedede";d.style.backgroundColor="#efefef";d.style.cursor="pointer";d.style.borderRadius="1px";f.push(d);d=new l.ThemeClass("commandMenuItem");d.style.border=
"0";d.style.padding="0";d.style.margin="0";f.push(d);for(var k in f)h+=f[k].toString();return h};j.prototype.writeMainStyle=function(){var h="",f=[],d=new l.ThemeClass("searchbox");d.style.backgroundImage="url(../images/core_sprites.png)";d.style.backgroundRepeat="no-repeat";d.style.backgroundPosition="4px -297px";d.style.width="12px";d.style.height="12px";d.style.backgroundColor=this.search;d.style.border="1px solid "+this.search;d.style.fontSize="11px";d.style.width="15em";d.style.height="16px";
d.style.borderRadius="10px";d.style.color="#999";d.style.padding="0";d.style.paddingLeft="20px";d.style.marginLeft="5px";d.style.marginTop="6px !important";d.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";f.push(d);d=new l.ThemeClass("searchbox:focus");d.style.color="white";d.style.outline="none";f.push(d);d=new l.ThemeClass("checkedRow");d.style.cssText="background-color:"+this.selection+" !important;";f.push(d);d=new l.ThemeClass("navbar-item-selected");
d.style.background=this.selection;d.style.color=this.content;f.push(d);d=new l.ThemeClass("auxpane");d.style.border="0";d.style.background=this.sidepanel;d.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.sidepanel+"), color-stop(100%,"+this.sidepanel+"))";d.style.background="-moz-linear-gradient(top, "+this.sidepanel+" 0%, "+this.sidepanel+" 100%)";f.push(d);d=new l.ThemeClass("mainpane");d.style.background=this.mainpanel;d.style.border=0;f.push(d);d=new l.ThemeClass("mainToolbar");
d.style.background=this.toolpanel;d.style.height="32px";d.style.borderBottom="1px solid #ebebeb";d.style.paddingTop="3px";f.push(d);for(var k in f)h+=f[k].toString();return h};j.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};j.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:j}});
define("orion/widgets/themes/container/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter"],function(l,j,h){function f(){}function d(){this.styles=[];var b=new f;b.name="Orion";b.navbar="#404648";b.button="#EFEFEF";b.location="#efefef";b.selection="FEC";b.sidepanel="#FBFBFB";b.mainpanel="white";b.toolpanel="white";b.navtext="#bfbfbf";b.content="#3087B3";b.search="#444";b.breadcrumb="#3087B3";b.separator="#333";this.styles.push(b);
b=new f;b.name="Green Zone";b.navbar="seagreen";b.button="lavender";b.location="darkseagreen";b.selection="moccasin";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="darkgreen";b.search="darkgreen";b.breadcrumb="#3087B3";b.separator="seagreen";this.styles.push(b);b=new f;b.name="Pretty In Pink";b.navbar="plum";b.button="lavender";b.location="pink";b.selection="lavender";b.sidepanel="seashell";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";
b.content="mediumorchid";b.search="violet";b.breadcrumb="#3087B3";b.separator="plum";this.styles.push(b);b=new f;b.name="Blue Monday";b.navbar="cornflowerblue";b.button="lavender";b.location="skyblue";b.selection="lavender";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="royalblue";b.search="royalblue";b.breadcrumb="#3087B3";b.separator="cornflowerblue";this.styles.push(b);b=new f;b.name="Vanilla Skies";b.navbar="sandybrown";b.button="lemmonchiffon";
b.location="cornsilk";b.selection="lemonchiffon";b.sidepanel="white";b.mainpanel="white";b.toolpanel="white";b.navtext="lemonchiffon";b.content="chocolate";b.search="moccasin";b.breadcrumb="#3087B3";b.separator="sandybrown";this.styles.push(b);b=new f;b.name="Beetlejuice";b.navbar="indigo";b.button="slateblue";b.location="darkslateblue";b.selection="silver";b.sidepanel="lavender";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumslateblue";b.search="#444";b.breadcrumb="#3087B3";
b.separator="indigo";this.styles.push(b);b=new f;b.name="Red";b.navbar="#CD2127";b.button="#777777";b.location="#D85F56";b.selection="lightcoral";b.sidepanel="#EFDAB2";b.mainpanel="#FDFADD";b.toolpanel="#FDFADD";b.navtext="#FBFBFB";b.content="darkred";b.search="#D85F56";b.breadcrumb="darkred";b.separator="#CD2127";this.styles.push(b)}function k(){return this.styles}f.prototype.name="Orion";f.prototype.navbar="#404648";f.prototype.button="#EFEFEF";f.prototype.location="#333";f.prototype.breadcrumb=
"#3087B3";f.prototype.separator="#333";f.prototype.selection="FEC";f.prototype.sidepanel="#FBFBFB";f.prototype.mainpanel="white";f.prototype.toolpanel="white";f.prototype.navtext="#bfbfbf";f.prototype.content="#3087B3";f.prototype.search="#444";d.prototype.styles=[];d.prototype.getStyles=k;d.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion",selectedKey:"selected"}};d.prototype.getViewData=function(){var b={top:10,left:10,width:350,height:350};
b.shapes=[{type:"RECTANGLE",name:l["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:l["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:l["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:l["Tool Panel"],x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",name:l["Selection Bar"],
x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:l.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:l["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:l.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:l.Content,label:"/",x:78,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif",
order:9},{type:"TEXT",name:l.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:l["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:l.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:l["Button Text"],label:"Button",x:158,y:90,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,
y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:l["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:l["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:l["Line Color"],x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:l["Line Color"],x1:20,y1:100,x2:140,
y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:l["Side Panel"],x:10,y:71,width:140,height:289,family:"sidepanel",fill:"#FBFBFB",order:12},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:l["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TRIANGLE",
name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}];for(var d=0;d<3;d++)b.shapes.push({type:"TEXT",name:l.Content,label:"org.eclipse.orion.content",x:170,y:127+20*d,fill:"#3087B3",family:"content"});for(d=0;d<3;d++)b.shapes.push({type:"TEXT",name:l.Content,label:"Item",x:25,y:115+20*d,fill:"#3087B3",family:"content"});for(d=0;d<3;d++)b.shapes.push({type:"TRIANGLE",
name:"twisty",x1:160,y1:121+d*20,x2:165,y2:124+d*20,x3:160,y3:127+d*20,family:"navbar",fill:"#333"});b.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return b};d.prototype.processSettings=function(b){var d=new h.ThemeSheetWriter;(new j.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",d.getSheet(b))};return{ThemeData:d,getStyles:k}});
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","Searching...":"Searching...","Searching for occurrences of":'Searching for occurrences of: "${0}"',name:"name","orion.widgets.UserMenu":"orion.widgets.UserMenu",
test:"test","Sign Out":"Sign Out","Sign Out ":"Sign Out ","</a>":"</a>",">":">","Sign In To ":"Sign In To ","Sign In":"Sign In",Help:"Help","Keyboard Shortcuts":"Keyboard Shortcuts",Settings:"Settings","View profile of ":"View profile of ",Profiles:"Profiles","Information Needed":"Information Needed",Cancel:"Cancel","If the same file exists in both the source and destination:":"If the same file exists in both the source and destination:","Cancel the transfer":"Cancel the transfer","Always overwrite destination":"Always overwrite destination",
"Overwrite if source is newer":"Overwrite if source is newer",New:"New","Building file skeleton...":"Building file skeleton...",Add:"Add","Upload...":"Upload...","For a list of available commands type '${0}'.":"For a list of available commands type '${0}'.","Main Pages":"Main Pages","Related Links":"Related Links"});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(l,j){var h={root:j};Object.keys(l).forEach(function(f){typeof h[f]==="undefined"&&(h[f]=l[f])});return h});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(l){function j(h,f,d){this.elements=d;this.taskPanel=document.createElement("div");this.taskPanel.className="UAContainer";this.taskPanel.innerHTML='<header class="UAHeader">Develop software from within the cloud</header>';this.elementNode=document.createElement("div");this.switchesContainer=document.createElement("div");this.switches=document.createElement("span");this.radioButtons=[];this.elementNode.className="UAContainer-body";
this.taskPanel.appendChild(this.elementNode);this.switchesContainer.className="UAContainer-switch-body";this.switches.className="UAContainer-switches";this.switchesContainer.innerHTML="";this.switchesContainer.appendChild(this.switches);this.taskPanel.appendChild(this.switchesContainer);f===!0?(this.container=document.createElement("div"),this.container.className="UAModal",this.container.appendChild(this.taskPanel),this.backdrop=document.createElement("div"),this.backdrop.className="UAModalBackground",
document.body.appendChild(this.backdrop),document.body.appendChild(this.container),l.addAutoDismiss([this.container],this.destroy.bind(this))):h.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}j.prototype.elementNode=null;j.prototype.switchesContainer=null;j.prototype.switches=null;j.prototype.radioButtons=null;j.prototype.chosenSwitch=null;j.prototype.addElement=
function(h){var f=document.createElement("span");f.className="UAContainer-icon";f.innerHTML='<span class="workingSpan"><img src="'+h.image+'" id="'+h.label+'ImageNode" alt="'+h.alt+'" height="64" width="64"></span><span class="UAIcon-label"><span class="UALabel" id="'+h.label+'LabelNode" >'+h.label+"</span></span>";f.onmouseover=function(){document.getElementById(h.label+"ImageNode").src=h.secondaryImage;document.getElementById(h.label+"LabelNode").className="UALabel-live";f.className="UAContainer-icon-live"};
f.onmouseout=function(){document.getElementById(h.label+"ImageNode").src=h.image;document.getElementById(h.label+"LabelNode").className="UALabel";f.className="UAContainer-icon"};var d=this;f.onclick=function(){d.showMedia(h)};this.elementNode.appendChild(f)};j.prototype.clearElements=function(){this.elementNode.innerHTML=""};j.prototype.showMedia=function(h){this.clearElements();this.addElement(h);var f=document.createElement("span");f.className="UAContainer-media";f.innerHTML='<div></div><div></div><span class="mediaSpan"><img src="'+
h.media+'" alt="'+h.alt+'" height="300" width="400"></span>';this.elementNode.appendChild(f);setTimeout(function(){f.style.opacity=1},100);h=document.getElementById(h.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=h.parentNode;h.className="chosenCircle"};j.prototype.createSwitch=function(h){var f;f=h?h.label+"switch":"indexSwitch";var d=document.createElement("span");d.className="workingSpan";d.innerHTML='<div class="circle" id ="'+f+'"></div>';var k=this;d.onclick=
h?function(){k.showMedia(h)}:function(){k.initialize();k.chosenSwitch.firstChild.className="circle";k.chosenSwitch=d;k.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(d);return this.radioButtons[this.radioButtons.length]=d};j.prototype.initialize=function(){this.clearElements();this.elements.forEach(this.addElement.bind(this))};j.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return j});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(l,j,h,f){function d(){}d.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'<div class="dialog" role="dialog"><div class="dialogTitle"><span id="title" class="dialogTitleText layoutLeft"></span><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" id="closeDialog"></button></div><div id="dialogContent" class="dialogContent layoutBlock"></div><div id="buttons" class="dialogButtons"></div></div>',
_initialize:function(){var d=document.body;this.$frameParent=d;this.$$modalExclusions=this.$$modalExclusions||[];var b=document.createRange();b.selectNode(d);b=b.createContextualFragment(this.CONTAINERTEMPLATE);d.appendChild(b);this.$frame=d.lastChild;this.title&&h.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=h.$("#closeDialog",this.$frame);var g=this;this.$close.addEventListener("click",function(){g.hide()},!1);this.$parent=h.$(".dialogContent",this.$frame);
b=document.createRange();b.selectNode(this.$parent);d=b.createContextualFragment(this.TEMPLATE);this.messages&&h.processTextNodes(d,this.messages);this.$parent.appendChild(d);this.$buttonContainer=h.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(a){a.keyCode===h.KEY.ESCAPE?g.hide():a.keyCode===h.KEY.ENTER&&typeof g._defaultCallback==="function"&&g._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 d=this;this.buttons.forEach(function(b){var g=f.createButton(b.text,b.callback);if(b.id)g.id=b.id,d["$"+g.id]=g;if(b.isDefault)d._defaultCallback=b.callback,d._defaultButton=g;d.$buttonContainer.appendChild(g)})}},_makeModal:function(){var d=this;this.$frame.addEventListener("blur",function(a){d.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var b=!h.contains(d.$frame,
a.target);if(b)for(var e=0;e<d.$$modalExclusions.length;e++)if(h.contains(d.$$modalExclusions[e],a.target)){b=!1;break}b&&(window.setTimeout(function(){(d.$lastFocusedElement||d.$parent).focus()},0),h.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var b=this.$frameParent.childNodes,g=!1;this._addedBackdrop=[];for(var a=0;a<b.length;a++){for(var e=0;e<this.$$modalExclusions.length;e++)if(h.contains(this.$$modalExclusions[e],
b[a])){g=!0;break}!g&&b[a]!==d.$frame&&b[a].classList&&!b[a].classList.contains("tooltipContainer")&&(e=b[a],e.classList.contains("modalBackdrop")||(e.classList.add("modalBackdrop"),this._addedBackdrop.push(e)))}(b=h.lastTabbable(this.$buttonContainer)||h.lastTabbable(this.$parent))&&b.addEventListener("keydown",function(a){if(a.keyCode===h.KEY.TAB){var b=d._getFirstFocusField();b&&b!==a.target&&b.focus();h.stop(a)}},!1)},_addChildDialog:function(d){this.$$modalExclusions.push(d.$frame||d.$parent)},
_bindElements:function(d){for(var b=0;b<d.childNodes.length;b++){var g=d.childNodes[b];g.id&&(this["$"+g.id]=g);this._bindElements(g)}},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 d=this;this.keepAlive||
window.setTimeout(function(){d.destroy()},0)},show:function(d){typeof this._beforeShowing==="function"&&this._beforeShowing();var b=h.bounds(this.$frame),g=h.bounds(document.documentElement),a;d?(a=h.bounds(d),d=a.top+a.height+4,a=a.left+4,d+b.height>g.height&&(d=Math.max(0,g.height-b.height-4)),a+b.width>g.width&&(a=Math.max(0,g.width-b.width-4))):(a=Math.max(0,(g.width-b.width)/2),d=Math.max(0,(g.height-b.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=d+"px";this.$frame.style.left=
a+"px";this.$frame.classList.add("dialogShowing");typeof this._afterShowing==="function"&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return h.firstTabbable(this.$parent)||this._defaultButton||h.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(d){d.classList.remove("modalBackdrop")});this.$frameParent.removeEventListener("focus",
this._modalListener,!0);this.$frameParent.removeEventListener("click",this._modalListener,!0);this.$frameParent.removeChild(this.$frame);this.$parent=this.$frame=void 0}};d.prototype.constructor=d;return{Dialog:d}});
define("orion/widgets/UserMenu","i18n!orion/widgets/nls/messages,require,orion/webui/littlelib,orion/PageLinks,orion/widgets/userAssistance/UATaskPanel,orion/webui/dialog".split(","),function(l,j,h,f,d){function k(b){this._displaySignOut=!0;this._init(b)}k.prototype={_init:function(b){this._dropdownNode=h.node(b.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=b.dropdown;this._serviceRegistry=b.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices=
{};this._noSeparator=b.noSeparator;this._dropDownItemClass=b.dropDownItemClass;this._keyAssistClass=b.keyAssistClass;if(b.signOut!==void 0)this._displaySignOut=b.signOut},isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},hasServices:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)>0},length:function(b){var d=0,a;for(a in b)b.hasOwnProperty(a)&&d++;return d},_makeMenuItem:function(b,
d){var a=document.createElement("span");a.role="menuitem";a.tabIndex=0;var e=document.createTextNode(b);a.appendChild(e);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&a.classList.add(this._dropDownItemClass):a.classList.add("dropdownMenuItem");a.addEventListener("click",d,!1);a.addEventListener("keydown",function(a){(a.keyCode===h.KEY.ENTER||a.keyCode===h.KEY.SPACE)&&d()},!1);return a},_renderAuthenticatedService:function(b){var d=this,a=this.authenticatedServices[b].authService;
if(a&&a.logout&&this._displaySignOut){var e=document.createElement("li"),c=this._makeMenuItem(l["Sign Out"],function(){a.logout().then(function(){d.addUserItem(b,a,d.authenticatedServices[b].label);localStorage.removeItem(b);localStorage.removeItem("lastLogin");for(var c=localStorage.length-1;c>=0;c--){var e=localStorage.key(c);e&&e.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(e)}a.getAuthForm(window.location.href).then(function(a){window.location=a})})});e.appendChild(c);this._dropdownNode.appendChild(e)}},
renderServices:function(){function b(c){a[c]||(a[c]=d.createDocumentFragment());return a[c]}var d=document,a=[],e=this._serviceRegistry;f.getPageLinksInfo(e,"orion.page.link.user").then(function(c){this._dropdown?this._dropdown.empty():this._dropdownNode&&h.empty(this._dropdownNode);c.forEach(function(a){var c=b(typeof a.category==="number"?a.category:1),e=d.createElement("li"),i=d.createElement("a");i.role="menuitem";typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&i.classList.add(this._dropDownItemClass):
i.classList.add("dropdownMenuItem");i.href=a.href;i.textContent=a.textContent;e.appendChild(i);c.appendChild(e);i.addEventListener("keydown",function(a){(a.keyCode===h.KEY.ENTER||a.keyCode===h.KEY.SPACE)&&i.click()},!1)}.bind(this));if(this.keyAssistFunction){var c=document.createElement("li"),i=this._makeMenuItem(l["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass==="string"?this._keyAssistClass!==""&&i.classList.add(this._keyAssistClass):i.classList.add("key-assist-menuitem");
c.appendChild(i);b(0).appendChild(c)}if(c=e.getServiceReferences("orion.page.getstarted")[0])i=c.getProperty("data"),c=document.createElement("li"),i=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,i)),c.appendChild(i),b(0).appendChild(c);var f=this;a.sort(function(a,c){return a-c}).forEach(function(c,b){if(b<a.length-1&&!this._noSeparator){var e=document.createElement("li");e.classList.add("dropdownSeparator");var d=document.createElement("span");d.classList.add("dropdownSeparator");
e.appendChild(d);c.appendChild(e)}f._dropdownNode.appendChild(c)}.bind(this));if(this.isSingleService())for(var k in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(k)&&this._renderAuthenticatedService(k,0)}.bind(this))},getStartedDialog:function(b){new d(null,!0,b)},setKeyAssist:function(b){this.keyAssistFunction=b;this.renderServices()},addUserItem:function(b,d,a,e){e?(this.unauthenticatedServices[b]&&delete this.unauthenticatedServices[b],this.authenticatedServices[b]={authService:d,
label:a,data:e}):(this.authenticatedServices[b]&&delete this.authenticatedServices[b],this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:d,label:a,pending:this.unauthenticatedServices[b].pending}:{authService:d,label:a});this.renderServices()}};k.prototype.constructor=k;return{UserMenu:k}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages,orion/crawler/searchCrawler,orion/contentTypes,require,orion/webui/littlelib,orion/util,orion/webui/dialog".split(","),function(l,j,h,f,d,k,b){function g(a){this._init(a)}g.prototype=new b.Dialog;g.prototype.TEMPLATE='<div role="search"><div><label id="fileNameMessage" for="fileName">${Type the name of a file to open (? = any character, * = any string):}</label></div><div><input id="fileName" type="text" class="setting-control" style="width:90%;"/></div><div id="progress" style="padding: 2px 0 0; width: 100%;"><img src="'+
f.toUrl("../../../images/progress_running.gif")+'" class="progressPane_running_dialog" id="crawlingProgress"></img></div><div id="results" style="max-height:400px; height:auto; overflow-y:auto;" aria-live="off"></div><div id="statusbar"></div></div>';g.prototype._init=function(a){this.title=a.title||l["Find File Named"];this.modal=!0;this.messages=l;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=new h.ContentTypeRegistry(this._searcher.registry);
if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=a.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=a.initialText;this._message=a.message;this._nameSearch=!0;if(a.nameSearch!==void 0)this._nameSearch=a.nameSearch;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(l["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||
typeof this._searchRenderer.makeRenderFunction!=="function")throw Error(l["Missing required argument: searchRenderer"]);this._initialize()};g.prototype._bindToDom=function(a){var b=this;b.$crawlingProgress.style.display="none";this.$fileName.setAttribute("placeholder",l.Search);this.$fileName.addEventListener("input",function(){b._time=+new Date;b._timeoutId&&clearTimeout(b._timeoutId);b._timeoutId=setTimeout(b.checkSearch.bind(b),0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===
d.KEY.ENTER){var i=d.$("a",b.$results);i&&(d.stop(a),window.open(i.href),b.hide())}},!1);a.addEventListener("keydown",function(a){var i,g,f;if(a.keyCode===d.KEY.DOWN||a.keyCode===d.KEY.UP)i=d.$$array("a",b.$results),g=document.activeElement,f=i.indexOf(g),a.keyCode===d.KEY.DOWN?f>=0?(g.classList.remove("treeIterationCursor"),i=f<i.length-1?i[f+1]:i[0],i.focus(),i.classList.add("treeIterationCursor")):i.length>0&&(i=-1<i.length-1?i[0]:i[0],i.focus(),i.classList.add("treeIterationCursor")):f>=0?(g.classList.remove("treeIterationCursor"),
g=b.$fileName,i=f>0?i[f-1]:g,i.focus(),f>0&&i.classList.add("treeIterationCursor")):i.length>0&&(i[i.length-1].focus(),i[i.length-1].classList.add("treeIterationCursor")),d.stop(a)});a.addEventListener("mouseup",function(a){a.target.focus()},!1);setTimeout(function(){if(b._forceUseCrawler||!b._fileService.getService(b._searcher.getSearchLocation()).search){var a=b._searchOnRoot?b._searcher.getSearchRootLocation():b._searcher.getChildrenLocation(),a=new j.SearchCrawler(b._searcher.registry,b._fileService,
"",{searchOnName:!0,location:a});b._searcher.setCrawler(a);a.buildSkeleton(function(){b.$crawlingProgress.style.display="inline";b.$progress.appendChild(document.createTextNode(l["Building file skeleton..."]))},function(){b.$crawlingProgress.style.display="none";b.$progress.removeChild(b.$progress.lastChild)})}},0);this._message&&(this.$fileNameMessage.removeChild(this.$fileNameMessage.firstChild),this.$fileNameMessage.appendChild(document.createTextNode(this._message)));if(this._initialText)this.$fileName.value=
this._initialText,this.doSearch()};g.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var a=(new Date).getTime();a-this._time>this._searchDelay?(this._time=a,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};g.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var b=this._searcher.createSearchParams(a,this._nameSearch,this._searchOnRoot),c=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));
this.currentSearch=c;var i=document.createElement("div");i.appendChild(document.createTextNode(this._nameSearch?l["Searching..."]:k.formatMessage(l["Searching for occurrences of"],a)));d.empty(this.$results);this.$results.appendChild(i);this._searcher.search(b,!1,function(){c===this.currentSearch&&c.apply(null,arguments)}.bind(this))}};g.prototype.decorateResult=function(a){for(var b=this,a=d.$$array("a",a),c=0;c<a.length;c++){var i=a[c];i.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&
!a.metaKey&&b.hide()},!1);i.addEventListener("keyup",function(a){a.keyCode===d.KEY.ENTER&&b.hide()},!1)}};g.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};g.prototype._afterHiding=function(){this._onHide&&this._onHide()};g.prototype.constructor=g;return{OpenResourceDialog:g}});define("text!orion/banner/banner.html",[],function(){return'<header id="banner" role="banner">\n\t<\!-- Requires some js code to bind the home link, link to progress image, and binding NLS variables  --\>\n\t<\!-- Top row:  Logo + discovery links + search + user --\>\n\t<div id="staticBanner" class="layoutBlock topRowBanner"> <\!-- primaryNav --\>\n\t\t<a id="home" class="layoutLeft "></a>\n\t\t<nav id="primaryNav" class="bannerLeftArea" role="navigation">\n\t\t\t<button class="centralNavigation commandSprite core-sprite-hamburger" type="button"id="centralNavigation"></button>\n\t\t</nav>\n\t\t<div class="clear navigationBreadcrumb bannerMiddleArea" >\n\t\t\t<div id="location" class="currentLocation"></div>\n\t\t</div>\n\t\t<div class="bannerRightArea">\n\t\t\t<div id="globalActions" class="spacingLeft layoutLeft"></div>\n\t\t\t<input type="text" id="search" autocomplete="off" class="layoutLeft spacingLeft searchbox" role="search" style="display:none;">\n\t\t\t<div id="searchOptions" class="layoutLeft" style="padding-top:1px;display:none;"></div>\n\t\t\t<div id="userMenu" class="spacingRight layoutRight" style="color:#ccc;">\n\t\t\t\t<img class="progressPane" id="progressPane" tabindex="0" role="progressbar"></img>\n\t\t\t\t<span id="userTrigger" tabindex="0" role="button" class="dropdownTrigger">\n\t\t\t\t\t<span class="dropdownArrowEmpty"></span>\n\t\t\t\t</span>\n\t\t\t\t<ul id="userDropdown" class="dropdownMenu" role="menu"></ul>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div id="notificationArea" class="notificationHide">\n\t\t<div class="layoutLeft" id="notifications" aria-live="assertive" aria-atomic="true"></div>\n\t\t<div class="layoutRight"><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" type="button" id="closeNotifications"></span></div>\n\t</div>\n</header>'});
define("text!orion/banner/footer.html",[],function(){return'<footer id="footerContent" class="layoutBlock footerLayout" role="contentinfo">\n\t<\!-- Requires some js code to bind the NLS variables  --\>\n\t<div class="logoFooter commandSprite core-sprite-orion-logo"></div>\n\t<div class="footerBlock">${Orion is in Beta. Please try it out but BEWARE your data may be lost.}</div>\n\t<div class="footerRightBlock">\n\t\t<ul>\n\t\t\t<\!-- <li><a href="http://wiki.eclipse.org/Orion/FAQ" target="_blank">${FAQ}</a></li --\>\n\t\t\t<li><a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=4.0" target="_blank">${Report a Bug}</a>\n\t\t\t<li><a href="http://www.eclipse.org/legal/privacy.php" target="_blank">${Privacy Policy}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">${Terms of Use}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/copyright.php" target="_blank">${Copyright Agent}</a></li>\n\t\t</ul>\n\t</div>\n</footer>'});
define("text!orion/banner/toolbar.html",[],function(){return'<ul class="layoutLeft commandList pageActions" id="pageActions"></ul>\n<ul class="layoutLeft commandList pageActions" id="selectionTools"></ul>\n<ul class="layoutLeft commandList pageActions" id="navActions"></ul>\n<div class="layoutLeft" style="padding-left:7px;padding-right:7px;margin-top:2px;" id="filterBox" style="visibility: hidden;"></div>\n<div class="layoutRight commandList pageActions" id="settingsActions"></div>\n<div class="layoutRight status" id="statusPane" role="status" aria-live="off"></div>\n<ul class="layoutRight commandList pageActions" id="pageNavigationActions"></ul>'});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(l,j){function h(f,d,h){if(f=j.node(f))this._parent=f;else throw Error("Parent node of dropdown menu not found");this.options=h=h||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=h.selectionClass;f=document.createElement("div");f.classList.add("dropDownContainer");f.id=this.navDropDownId;f.style.display="none";this._parent.appendChild(f);this._dropdownMenu=f;if(d=j.node(d))this._triggerNode=
d;else throw"Trigger node of dropdown menu not found";if(this._triggerNode.style.visibility==="hidden")this._triggerNode.style.visibility="visible";if(!h.noClick)this._triggerNode.onclick=this.click.bind(this);this._dropdownMenu.addEventListener("keydown",function(b){b.keyCode===j.KEY.ESCAPE&&this.clearPanel()}.bind(this))}l.mixin(h.prototype,{click:function(){this._dropdownMenu.style.display==="none"?this.updateContent(this.getContentNode(),function(){this._dropdownMenu.style.display="";this._positionDropdown();
this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=j.addAutoDismiss([this._triggerNode,this._dropdownMenu],this.clearPanel.bind(this));if(this.options.onShow)this.options.onShow()}.bind(this)):this.clearPanel()},clearPanel:function(){if(this.isVisible()&&(this._dropdownMenu.style.display="none",this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},addContent:function(f){this._dropdownMenu.innerHTML=
f},getContentNode:function(){return this._dropdownMenu},updateContent:function(f,d){d()},_positionDropdown:function(){this._dropdownMenu.style.left="";var f=j.bounds(this._dropdownMenu),d=j.bounds(this._boundingNode(this._parent));if(f.left+f.width>d.left+d.width)this._dropdownMenu.style.right=0},_boundingNode:function(f){return f.style.right!==""||f.style.position==="absolute"||!f.parentNode||!f.parentNode.style?f:this._boundingNode(f.parentNode)},isDestroyed:function(){return!this._dropdownMenu.parentNode},
isVisible:function(){return this._dropdownMenu.style.display!=="none"&&!this.isDestroyed()},focus:function(){this._dropdownMenu.focus()},destroy:function(){if(this._parent)j.empty(this._parent),this._parent=this.select=null}});return h});
define("orion/widgets/input/GroupedContent",["i18n!orion/widgets/nls/messages","orion/objects","orion/webui/littlelib"],function(l,j){function h(){}j.mixin(h.prototype,{templateString:'<div style="float:left;"><section><span style="color:#333;padding:15px;">'+l["Main Pages"]+'</span><nav><ul id="navigationlinks"></ul></nav></section></div><div class="groupedContentDivider"></div><div style="float:left;"><section><span style="color:#333;padding:15px;">'+l["Related Links"]+'</span><nav><ul id="relatedLinks"></ul></nav></section></div>',
getContentPane:function(){return this.templateString}});return h});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/globalCommands","i18n!orion/nls/messages,require,orion/commonHTMLFragments,orion/keyBinding,orion/commandRegistry,orion/commands,orion/parameterCollectors,orion/extensionCommands,orion/uiUtils,orion/keyBinding,orion/breadcrumbs,orion/webui/littlelib,orion/webui/splitter,orion/webui/dropdown,orion/webui/tooltip,orion/contentTypes,orion/URITemplate,orion/PageUtil,orion/widgets/themes/ThemePreferences,orion/widgets/themes/container/ThemeData,orion/Deferred,orion/widgets/UserMenu,orion/PageLinks,orion/webui/dialogs/OpenResourceDialog,text!orion/banner/banner.html,text!orion/banner/footer.html,text!orion/banner/toolbar.html,orion/widgets/input/DropDownMenu,orion/widgets/input/GroupedContent,orion/util,orion/customGlobalCommands,orion/fileClient".split(","),function(l,
j,h,f,d,k,b,g,a,e,c,i,m,o,n,p,t,u,v,r,q,y,z,B,D,H,C,s,A,x,w,F){function E(a,c){if(a.getLabel)return a.getLabel();else{var b=new q;b.resolve(c.properties.name);return b}}function I(a){i.node("progressPane").setAttribute("aria-label",l["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function Y(a,c){var b=a.getServiceReferences("orion.core.auth");ba=[];for(var e=K.createMenuGenerator.apply(this,arguments),d=0;d<b.length;d++){var i=
b[d],g=a.getService(i);E(g,i).then(function(a){g.getKey().then(function(c){ba.push(c);g.getUser().then(function(b){e.addUserItem(c,g,a,b)},function(b,d){e.addUserItem(c,g,a,d)});window.addEventListener("storage",function(){$[c]!==localStorage.getItem(c)&&($[c]=localStorage.getItem(c),g.getUser().then(function(b){e.addUserItem(c,g,a,b)},function(){e.addUserItem(c,g,a)}))},!1)})})}}function M(a){return a}function N(a,c,b,e,d){function i(a){if(a)if(!a.visibleWhen||a.visibleWhen(c)){var b=new k.CommandInvocation(c,
c,null,a,e);return(new q).resolve([a,b])}else if(typeof d==="function")return j||(j=d()),q.when(j,function(b){if(b&&c===aa&&(!a.visibleWhen||a.visibleWhen(b)))return b=new k.CommandInvocation(b,b,null,a,e),[a,b]});return(new q).resolve()}var f=arguments,h,j,m=a&&a.getServiceReferences("orion.page.link.related");m&&m.length!==0&&q.when(function(){if(h)return h;var c=a.getService("orion.core.contentTypeRegistry");c||(c=new p.ContentTypeRegistry(a),c=a.getService("orion.core.contentTypeRegistry"));return c.getContentTypes().then(function(a){return h=
a})}(),function(){if(K.beforeGenerateRelatedLinks.apply(this,f)){for(var c=[],d=0;d<m.length;d++){var j={},l,o=m[d].getPropertyKeys();for(l=0;l<o.length;l++)j[o[l]]=m[d].getProperty(o[l]);if(j.id&&(l=l=null,b.indexOf(j.id)<0))if((j.nls&&j.nameKey||j.name)&&j.uriTemplate)l=g._createCommandOptions(j,m[d],a,h,!0),c.push(l);else if(l=e.findCommand(j.id))c.push((new q).resolve(l));else{var n=a.getServiceReferences("orion.navigate.command");for(l=0;l<n.length;l++)if(n[l].getProperty("id")===j.id){for(var j=
{},o=n[l].getPropertyKeys(),r=0;r<o.length;r++)j[o[r]]=n[l].getProperty(o[r]);l=g._createCommandOptions(j,n[l],a,h,!0);c.push(l);break}}}q.all(c,M).then(function(a){a=a.map(function(a){return a instanceof k.Command?a:new k.Command(a)}).sort(function(a,c){return a.name.localeCompare(c.name)});return q.all(a.map(i),M).then(function(a){a.forEach(function(a){a&&K.addRelatedLinkCommand(a[0],a[1])});K.afterGenerateRelatedLinks.apply(this,f)})})}})}function Q(a){var c=i.node("globalActions");c&&(a.destroy(c),
a.renderCommands(c.id,c,{},{},"tool"))}function O(a){var c=window.getComputedStyle(a,null);return c===null?a:c.getPropertyValue("position")==="absolute"||!a.parentNode||a===document.body?a:O(a.parentNode)}function V(a){var c={},b=null;typeof a==="string"&&(a=i.node(a));a||(a=i.node("pageActions"));for(var e=a;e&&e.classList;){if(e.classList.contains("toolComposite")){b=e;break}e=e.parentNode}if(a.classList.contains("commandMarker"))c.commandNode=a;if(b&&(c.slideContainer=i.$(".slideParameters",b),
c.parameterArea=i.$(".parameters",b),c.dismissArea=i.$(".parametersDismiss",b),c.notifications=i.$("#notificationArea",b),b.parentNode&&(c.toolbarTarget=i.$(".toolbarTarget",b.parentNode),c.toolbarTarget)))a=i.bounds(c.toolbarTarget),e=i.bounds(O(c.toolbarTarget.parentNode)),c.toolbarTargetY=a.top-e.top,c.toolbar=b;return c}function P(a){if(a.toolbarTarget&&a.toolbarTargetY){var c=0,b;a.notifications&&a.notifications.classList.contains("slideContainerActive")&&(b=i.bounds(a.notifications),c+=b.height);
a.slideContainer&&a.slideContainer.classList.contains("slideContainerActive")&&(b=i.bounds(a.slideContainer),c+=b.height);c>0&&(c+=8);c?(a.toolbarTarget.style.top=a.toolbarTargetY+c+"px",a.toolbar.style.paddingBottom=c+"px"):a.toolbarTarget.style.top=a.toolbar.style.paddingBottom=""}}var d=function(a){var c=document.createElement("a");c.href=a;return c.href}(j.toUrl("auth/NotifyAuthentication.html")),$={},K={createMenuGenerator:w.createMenuGenerator||function(a,c){if(i.node("userMenu")){var b=i.node("userDropdown"),
e=new o.Dropdown({dropdown:b}),b=new y.UserMenu({dropdownNode:b,dropdown:e,serviceRegistry:a}),e=i.node("userTrigger");new n.Tooltip({node:e,text:l.Options,position:["below","left"]});var e=document.getElementById("userTrigger"),d=e.className;d+=" imageSprite core-sprite-silhouette";e.className=d;b.setKeyAssist(c);return b}},beforeGenerateRelatedLinks:w.beforeGenerateRelatedLinks||function(){var a=i.node("relatedLinks");i.empty(a);return!0},addRelatedLinkCommand:w.addRelatedLinkCommand||function(a,
c){var b=i.node("relatedLinks");k.createCommandMenuItem(b,a,c).classList.remove("dropdownMenuItem")},afterGenerateRelatedLinks:w.afterGenerateRelatedLinks||function(){},afterSetPageTarget:w.afterSetPageTarget||function(){},generateNavigationMenu:w.generateNavigationMenu||function(){var a=document.getElementById("centralNavigation");new n.Tooltip({node:a,text:"Navigation Menu",position:["right"]});var a=new s("primaryNav","centralNavigation"),c=new A;a.addContent(c.getContentPane())},afterGenerateBanner:w.afterGenerateBanner||
function(){}},ba=[],aa,T=[],L,R=null;return{generateBanner:function(c,e,d,g,o,n,p,u){function q(){this.create();this._filterString=""}function t(a){a.registerService("orion.cm.managedservice",{updated:function(a){for(var a=a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?"_blank":"_self":"_self",c=i.$$array(".targetSelector"),b=0;b<c.length;b++)c[b].target=a}},{pid:"nav.config"})}(new v.ThemePreferences(g,new r.ThemeData)).apply();var w=i.node(c);if(!w)throw l["could not find banner parent, id was "]+
c;var y=document.createRange();y.selectNode(w);y=y.createContextualFragment(D);i.processTextNodes(y,l);w.firstChild?w.insertBefore(y,w.firstChild):w.appendChild(y);w=i.node("home");w.href=j.toUrl("edit/edit.html");w.setAttribute("aria-label",l["Orion Home"]);i.node("progressPane").src=j.toUrl("images/none.png");if(w=i.node("pageToolbar"))w.classList.add("toolbarLayout"),w.innerHTML=C+h.slideoutHTMLFragment("mainToolbar");(w=i.node("closeNotifications"))&&w.setAttribute("aria-label",l["Close notification"]);
if(x.isFirefox<=17&&(w=i.node("staticBanner")))w.style.width="100%",w.style.MozBoxSizing="border-box";if(w=i.node("footer"))w.innerHTML=H,i.processTextNodes(w,l);d.setParameterCollector(new b.CommandParameterCollector(V,P));document.addEventListener("keydown",function(a){a.keyCode===i.KEY.ESCAPE&&(a=e.getService("orion.page.message"))&&a.setProgressMessage("")},!1);K.generateNavigationMenu.apply(this,arguments);var F=i.node("navigationlinks");F&&z.createPageLinks(e,"orion.page.link").then(function(a){a.forEach(function(a){var c=
document.createElement("li");c.appendChild(a);F.appendChild(c)})});if(w=i.$(".split")){var y=i.$(".sidePanelLayout"),E=i.$(".mainPanelLayout");if(y&&E)R={side:y,main:E},R.splitter=new m.Splitter({node:w,sidePanel:y,mainPanel:E,toggle:!0,closeByDefault:u}),w=new k.Command({name:l["Toggle side panel"],tooltip:l["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){R.splitter.toggleSidePanel()}}),d.addCommand(w),d.registerCommandContribution("pageActions","orion.toggleSidePane",
1,null,!0,new f.KeyBinding("o",!0)),p&&R.splitter.addResizeListener(function(a){p&&a===E&&p.resize()})}var s=!1,N=function(a,c,b){if(!s){var c=c.getService("orion.page.progress"),e=new B.OpenResourceDialog({searcher:a,progress:c,searchRenderer:a.defaultRenderer,onHide:function(){s=!1;b&&b.focus()}});window.setTimeout(function(){s=!0;e.show()},0)}},w=new k.Command({name:l["Find File Named..."],tooltip:l["Choose a file by name and open an editor on it"],id:"eclipse.openResource",callback:function(){N(o,
e,p)}});d.addCommand(w);d.registerCommandContribution("globalActions","eclipse.openResource",100,null,!0,new f.KeyBinding("f",!0,!0));w=new k.Command({name:l["Toggle banner and footer"],tooltip:l["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var a=i.node("banner"),c=i.node("footer"),b=i.$(".content-fixedHeight");a.style.visibility==="hidden"?(a.style.visibility="visible",c.style.visibility="visible",b.classList.remove("content-fixedHeight-maximized")):(a.style.visibility=
"hidden",c.style.visibility="hidden",b.classList.add("content-fixedHeight-maximized"));p&&p.resize();return!0}});d.addCommand(w);d.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new f.KeyBinding("m",!0,!0));w=new k.Command({name:l["System Configuration Details"],tooltip:l["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return j.toUrl("help/about.html")}});d.addCommand(w);d.registerCommandContribution("globalActions","orion.configDetailsPage",
100,null,!0,new f.KeyBinding(112,!0,!0));w=new k.Command({name:l["Background Operations"],tooltip:l["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return j.toUrl("operations/list.html")}});d.addCommand(w);d.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new f.KeyBinding("o",!0,!0));q.prototype={create:function(){var a=this._keyAssistDiv=document.createElement("div");a.id="keyAssist";a.style.display="none";a.classList.add("keyAssistFloat");
a.setAttribute("role","menu");var c=this._keyAssistInput=document.createElement("input");c.classList.add("keyAssistInput");c.type="text";c.placeholder=l["Filter bindings"];a.appendChild(c);var b=this._keyAssistContents=document.createElement("div");b.classList.add("keyAssistContents");if(x.isIOS||x.isAndroid)b.style.overflowY="auto";a.appendChild(b);var e=this._keyAssistTable=document.createElement("table");e.tabIndex=0;e.classList.add("keyAssistList");b.appendChild(e);document.body.appendChild(a);
c.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));e.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));c.addEventListener("input",function(){this.filterChanged()}.bind(this));b.addEventListener(x.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===i.KEY.ESCAPE&&this.hide()}.bind(this));i.addAutoDismiss([a],function(){this.hide()}.bind(this))},createContents:function(){i.empty(this._keyAssistTable);
this._selectedIndex=-1;this._selectedRow=null;this._idCount=this._keyAssistContents.scrollTop=0;if(p&&p.getTextView&&p.getTextView()){var c=p.getTextView(),b=c.getActions(!0).filter(function(a){return(a=c.getActionDescription(a))&&a.name});b.sort(function(a,b){return c.getActionDescription(a).name.localeCompare(c.getActionDescription(b).name)});this.createHeader(l.Editor);for(var e=function(a){return function(){c.focus();return c.invokeAction(a)}},g={},f,h=0;h<b.length;h++)for(var k=b[h],j=c.getActionDescription(k),
m=c.getKeyBindings(k),o=0;o<m.length;o++){f=m[o];var n=a.getUserKeyString(f);f.scopeName?(g[f.scopeName]||(g[f.scopeName]=[]),g[f.scopeName].push({bindingString:n,name:j.name,execute:e(k)})):this.createItem(n,j.name,e(k))}for(var r in g)if(g[r].length){this.createHeader(r);for(b=0;b<g[r].length;b++)f=g[r][b],this.createItem(f.bindingString,f.name,f.execute)}}this.createHeader(l.Global);d.showKeyBindings(this)},createItem:function(a,c,b){if(this._filterString){var e=this._filterString.toLowerCase(),
d;e!==this._filterString?(e=this._filterString,d=function(a){return a}):d=function(a){return a.toLowerCase()};if(d(c).indexOf(e)===-1&&d(a).indexOf(e)===-1&&d(this._lastHeader).indexOf(e)===-1)return}var i=this._keyAssistTable.insertRow(-1);i.id="keyAssist-keyBinding-"+this._idCount++;i.setAttribute("role","menuitem");i._execute=b;i.classList.add("keyAssistItem");i.addEventListener("click",function(a){this._selectedRow=i;this.execute();a.preventDefault()}.bind(this));b=i.insertCell(-1);b.classList.add("keyAssistName");
b.appendChild(document.createTextNode(c));b=i.insertCell(-1);b.classList.add("keyAssistAccel");b.appendChild(document.createTextNode(a))},createHeader:function(a){this._lastHeader=a;var c=this._keyAssistTable.insertRow(-1);c.classList.add("keyAssistSection");var c=c.insertCell(-1),b=document.createElement("h2");b.appendChild(document.createTextNode(a));c.appendChild(b)},execute:function(){window.setTimeout(function(){this.hide();var a=this._selectedRow;this._selectedRow=null;a&&a._execute&&a._execute()}.bind(this),
0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var a=this._keyAssistInput.value;if(this._filterString!==a)this._filterString=a,this.createContents()}.bind(this),100)},hide:function(){if(this.isVisible()){var a=document.activeElement,c=this._keyAssistDiv,a=c===a||(c.compareDocumentPosition(a)&16)!==0;c.style.display="none";a&&document.compareDocumentPosition(this._previousActiveElement)!==1&&this._previousActiveElement.focus();
this._previousActiveElement=null}},isVisible:function(){return this._keyAssistDiv.style.display==="block"},select:function(a){var c=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(c.length===0)this._selectedIndex=-1;else{var b=this._selectedIndex;b+=a?1:-1;b%=c.length;b<0&&(b=c.length-1);if(this._selectedIndex!==-1)a=c[this._selectedIndex],a.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=b;if(this._selectedIndex!==-1){this._selectedRow=a=c[this._selectedIndex];
a.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",a.id);this._keyAssistTable.focus();var c=a.getBoundingClientRect(),e=this._keyAssistContents,d=e.getBoundingClientRect();a.offsetTop<e.scrollTop?b===0?e.scrollTop=0:a.scrollIntoView(!0):c.bottom>d.bottom&&a.scrollIntoView(!1)}}},show:function(){if(!this.isVisible())this._previousActiveElement=document.activeElement,this.createContents(),this._keyAssistContents.style.height=Math.floor(this._keyAssistDiv.parentNode.clientHeight*
0.75)+"px",this._keyAssistDiv.style.display="block",this._keyAssistInput.value=this._filterString,this._keyAssistInput.focus(),this._keyAssistInput.select()},_keyDown:function(a){if(a.keyCode===40)this.select(!0);else if(a.keyCode===38)this.select(!1);else if(a.keyCode===13)this.execute();else return;a.preventDefault()},_scrollWheel:function(a){var c=0,c=x.isIE||x.isOpera?-a.wheelDelta:x.isFirefox?a.detail*40:-a.wheelDeltaY,b=this._keyAssistContents,e=b.scrollTop;b.scrollTop+=c;if(e!==b.scrollTop)return a.preventDefault&&
a.preventDefault(),!1}};var A=new q,M=new k.Command({name:l["Show Keys"],tooltip:l["Show a list of all the keybindings on this page"],id:"eclipse.keyAssist",callback:function(){A.isVisible()?A.hide():A.show();return!0}});d.addCommand(M);d.registerCommandContribution("globalActions","eclipse.keyAssist",100,null,!0,new f.KeyBinding(191,!1,!0));w=function(){p.getTextView().setKeyBinding(new f.KeyBinding(191,!1,!0,!x.isMac,x.isMac),M.id);p.getTextView().setAction(M.id,M.callback,M)};p&&p.getTextView&&
(p.getTextView()?w():p.addEventListener("TextViewInstalled",w));Q(d);Y(e,M.callback);I(e);window.addEventListener("hashchange",function(){d.processURL(window.location.href)},!1);window.setTimeout(function(){t(e)},0);K.afterGenerateBanner.apply(this,arguments)},getToolbarElements:V,getMainSplitter:function(){return R},layoutToolbarElements:P,setPageTarget:function(a){var b,e,d=a.breadcrumbRootName,g=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&
!a.breadcrumbTarget&&(e=d?d+" ":"",e+=a.fileService.fileServiceName(a.target.Location),d=null),b=a.name||a.target.Name,aa=a.target,N(g,a.target,T,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(d=d||a.task||a.name),b=a.name,N(g,{NoTarget:""},T,a.commandService,a.makeAlternate));(L=a.title)||(L=b?b+" - "+a.task:a.task);window.document.title=L;K.afterSetPageTarget.apply(this,arguments);if(b=i.node("location")){i.empty(b);var f=g&&new F.FileClient(g),g=a.breadcrumbTarget||a.target,f=f&&g&&g.Location?
f.fileServiceRootURL(g.Location):null;new c.BreadCrumbs({container:b,resource:g,rootSegmentName:d,workspaceRootSegmentName:e,workspaceRootURL:f,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){if(L)L.charAt(0)==="*"&&!a&&(L=L.substring(1)),a&&L.charAt(0)!=="*"&&(L="*"+L),window.document.title=L;var c=i.node("dirty");if(c)c.textContent=a?"*":""},setPageCommandExclusions:function(a){T=a},notifyAuthenticationSite:d}});
define("util/legacy",["require","exports","module"],function(){if(!(typeof window==="undefined"||typeof document==="undefined")){if(window.console==null)window.console={};"debug,log,warn,error,trace,group,groupEnd".split(",").forEach(function(l){window.console[l]||(window.console[l]=function(){})});!("classList"in document.documentElement)&&Object.defineProperty&&typeof HTMLElement!=="undefined"&&Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){function l(f){return function(d){var h=
j.className.split(/\s+/),b=h.indexOf(d);f(h,b,d);j.className=h.join(" ")}}var j=this,h={add:l(function(f,d,h){~d||f.push(h)}),remove:l(function(f,d){~d&&f.splice(d,1)}),toggle:l(function(f,d,h){~d?f.splice(d,1):f.push(h)}),contains:function(f){return!!~j.className.split(/\s+/).indexOf(f)},item:function(f){return j.className.split(/\s+/)[f]||null}};Object.defineProperty(h,"length",{get:function(){return j.className.split(/\s+/).length}});return h}});if(!String.prototype.trimLeft)String.prototype.trimLeft=
function(){return String(this).replace(/\s*$/,"")};if(!Function.prototype.bind)Function.prototype.bind=function(l){if(typeof this!=="function")throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var j=Array.prototype.slice.call(arguments,1),h=this,f=function(){},d=function(){return h.apply(this instanceof f&&l?this:l,j.concat(Array.prototype.slice.call(arguments)))};f.prototype=this.prototype;d.prototype=new f;return d}}});
define("util/promise",["require","exports","module"],function(l,j,h){function f(a){return{then:function(b){b(a)}}}function d(a){return{then:function(b,c){c(a)}}}function k(a){return function(b){try{return a(b)}catch(c){return d(c)}}}function b(a){var e=[],c,a=a||a===null?a:Object.prototype,i={promise:Object.create(a,{then:{value:function(i,g){function h(a){l.resolve(i(a))}function j(a){l.resolve(g(a))}var l=b(a),i=i?k(i):f,g=g?k(g):d;e?e.push([h,j]):c.then(h,j);return l.promise}}}),resolve:function(a){if(e){for(c=
a&&typeof a.then==="function"?a:f(a);e.length;)c.then.apply(c,e.shift());e=null}},reject:function(a){i.resolve(d(a))}};return i}function g(a,e){var c=b(e);c.resolve(a);return c.promise}h.metadata={stability:"unstable"};j.defer=b;j.resolve=g;j.reject=function(a,e){var c=b(e);c.reject(a);return c.promise};l=function(){function a(a){return c.apply(c,a)}function b(a,c){return a.then(function(a){return g(c).then(function(c){return a.concat([c])})})}var c=Function.call,d=Array.prototype.concat;return function(c,
f){return function(){return d.apply([c,this],arguments).reduce(b,g([],f)).then(a)}}}();j.promised=l});
define("util/util",["require","exports","module","util/promise"],function(l,j){function h(b,d){for(var a=0;a<d.length;a++)if(b===d[a])return a;return-1}function f(b,d){var a=b.getAttribute("data-command");a||(a=b.querySelector("*[data-command]").getAttribute("data-command"));a?d(a):console.warn("Missing data-command for "+util.findCssSelector(b))}j.createEvent=function(b){var d=[],a=!1,e=[],c=void 0,i=function(c){if(a)e.push(c);else for(var b=0;b<d.length;b++){var i=d[b];i.func.call(i.scope,c)}};
i.add=function(a,c){d.push({func:a,scope:c})};i.remove=function(a,c){var e=!1;d=d.filter(function(b){(b=b.func===a&&b.scope===c)&&(e=!0);return!b});e||console.warn("Handler not found. Attached to "+b)};i.removeAll=function(){d=[]};i.holdFire=function(){a=!0};i.resumeFire=function(){if(a!==!0)throw Error("Event not held: "+b);a=!1;if(e.length!==0){if(e.length===1)i(e[0]);else{var d=e[0],g=e[e.length-1];c?i(c(d,g,e)):i(g)}e=[]}};Object.defineProperty(i,"eventCombiner",{set:function(a){if(typeof a!==
"function")throw Error("eventCombiner is not a function");c=a},enumerable:!0});return i};var d=l("util/promise");j.promised=function(){function b(c){return a.apply(a,c)}function g(a,b){return a.then(function(a){return d.resolve(b).then(function(c){return a.concat([c])})})}var a=Function.call,e=Array.prototype.concat;return function(a,i){return function(){return e.apply([a,this],arguments).reduce(g,d.resolve([],i)).then(b)}}}();j.all=j.promised(Array);j.synchronize=function(b){if(b==null||typeof b.then!==
"function")return b;var d=void 0,a=void 0;b.then(function(b){d=!1;a=b},function(b){d=!0;a=b});if(d===void 0)throw Error("non synchronizable promise");if(d)throw a;return a};j.promiseEach=function(b,g,a){if(b.length===0)return d.resolve([]);var e=d.defer(),c=function(i){var f=[],h=g.call(a,b[i]);d.resolve(h).then(function(a){f[i]=a;a=i+1;a>=b.length?e.resolve(f):c(a)}).then(null,function(a){e.reject(a)})};c(0);return e.promise};j.NS_XHTML="http://www.w3.org/1999/xhtml";j.NS_XUL="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
j.createElement=function(b,d){return j.isXmlDocument(b)?b.createElementNS(j.NS_XHTML,d):b.createElement(d)};j.clearElement=function(b){for(;b.hasChildNodes();)b.removeChild(b.firstChild)};var k=/^\s*$/;j.removeWhitespace=function(b,d){for(var a=0;a<b.childNodes.length;){var e=b.childNodes.item(a);e.nodeType===3&&k.test(e.textContent)?b.removeChild(e):(d&&e.nodeType===1&&j.removeWhitespace(e,d),a++)}};j.importCss=function(b,d,a){if(b){d=d||document;if(!a){a=0;if(b.length!=0)for(var e=0;e<b.length;e++){var c=
b.charCodeAt(e),a=(a<<5)-a+c;a&=a}a="hash-"+a}if(e=d.getElementById(a))return e.tagName.toLowerCase()!=="style"&&console.error("Warning: importCss passed id="+a+", but that pre-exists (and isn't a style tag)"),e;e=j.createElement(d,"style");e.id=a;e.appendChild(d.createTextNode(b));(d.getElementsByTagName("head")[0]||d.documentElement).appendChild(e);return e}};j.setTextContent=function(b,d){j.clearElement(b);var a=b.ownerDocument.createTextNode(d);b.appendChild(a)};j.setContents=function(b,d){if(typeof HTMLElement!==
"undefined"&&d instanceof HTMLElement)j.clearElement(b),b.appendChild(d);else if("innerHTML"in b)b.innerHTML=d;else try{var a=b.ownerDocument.documentElement.namespaceURI;if(!a)a=j.NS_XHTML;j.clearElement(b);for(var e=b.ownerDocument.createRange().createContextualFragment('<div xmlns="'+a+'">'+d+"</div>").firstChild;e.hasChildNodes();)b.appendChild(e.firstChild)}catch(c){throw console.error("Bad XHTML",c),console.trace(),c;}};j.toDom=function(b,d){var a=j.createElement(b,"div");j.setContents(a,d);
return a.children[0]};j.isXmlDocument=function(b){b=b||document;return b.contentType&&b.contentType!="text/html"?!0:b.xmlVersion!=null?!0:!1};j.findCssSelector=function(b){var d=b.ownerDocument;if(b.id&&d.getElementById(b.id)===b)return"#"+b.id;var a=b.tagName.toLowerCase();if(a==="html")return"html";if(a==="head")return"head";if(a==="body")return"body";b.parentNode==null&&console.log("danger: "+a);var e,c;if(b.classList.length>0)for(var i=0;i<b.classList.length;i++){e="."+b.classList.item(i);c=d.querySelectorAll(e);
if(c.length===1)return e;e=a+e;c=d.querySelectorAll(e);if(c.length===1)return e;c=h(b,b.parentNode.children)+1;e=e+":nth-child("+c+")";c=d.querySelectorAll(e);if(c.length===1)return e}c=h(b,b.parentNode.children)+1;return e=j.findCssSelector(b.parentNode)+" > "+a+":nth-child("+c+")"};j.createUrlLookup=function(b){return function(d){try{return l("text!gcli/ui/"+d)}catch(a){if(b.filename)return b.filename+d;var e=b.id.split("/").pop()+".js";return b.uri.substr(-e.length)!==e?(console.error("Can't work out path from module.uri/module.id"),
d):b.uri?b.uri.substr(0,b.uri.length-e.length-1)+"/"+d:e+"/"+d}}};j.updateCommand=function(b,d){f(b,function(a){d.update(a)})};j.executeCommand=function(b,d){f(b,function(a){d.exec({visible:!0,typed:a})})};j.KeyEvent={DOM_VK_CANCEL:3,DOM_VK_HELP:6,DOM_VK_BACK_SPACE:8,DOM_VK_TAB:9,DOM_VK_CLEAR:12,DOM_VK_RETURN:13,DOM_VK_ENTER:14,DOM_VK_SHIFT:16,DOM_VK_CONTROL:17,DOM_VK_ALT:18,DOM_VK_PAUSE:19,DOM_VK_CAPS_LOCK:20,DOM_VK_ESCAPE:27,DOM_VK_SPACE:32,DOM_VK_PAGE_UP:33,DOM_VK_PAGE_DOWN:34,DOM_VK_END:35,DOM_VK_HOME:36,
DOM_VK_LEFT:37,DOM_VK_UP:38,DOM_VK_RIGHT:39,DOM_VK_DOWN:40,DOM_VK_PRINTSCREEN:44,DOM_VK_INSERT:45,DOM_VK_DELETE:46,DOM_VK_0:48,DOM_VK_1:49,DOM_VK_2:50,DOM_VK_3:51,DOM_VK_4:52,DOM_VK_5:53,DOM_VK_6:54,DOM_VK_7:55,DOM_VK_8:56,DOM_VK_9:57,DOM_VK_SEMICOLON:59,DOM_VK_EQUALS:61,DOM_VK_A:65,DOM_VK_B:66,DOM_VK_C:67,DOM_VK_D:68,DOM_VK_E:69,DOM_VK_F:70,DOM_VK_G:71,DOM_VK_H:72,DOM_VK_I:73,DOM_VK_J:74,DOM_VK_K:75,DOM_VK_L:76,DOM_VK_M:77,DOM_VK_N:78,DOM_VK_O:79,DOM_VK_P:80,DOM_VK_Q:81,DOM_VK_R:82,DOM_VK_S:83,DOM_VK_T:84,
DOM_VK_U:85,DOM_VK_V:86,DOM_VK_W:87,DOM_VK_X:88,DOM_VK_Y:89,DOM_VK_Z:90,DOM_VK_CONTEXT_MENU:93,DOM_VK_NUMPAD0:96,DOM_VK_NUMPAD1:97,DOM_VK_NUMPAD2:98,DOM_VK_NUMPAD3:99,DOM_VK_NUMPAD4:100,DOM_VK_NUMPAD5:101,DOM_VK_NUMPAD6:102,DOM_VK_NUMPAD7:103,DOM_VK_NUMPAD8:104,DOM_VK_NUMPAD9:105,DOM_VK_MULTIPLY:106,DOM_VK_ADD:107,DOM_VK_SEPARATOR:108,DOM_VK_SUBTRACT:109,DOM_VK_DECIMAL:110,DOM_VK_DIVIDE:111,DOM_VK_F1:112,DOM_VK_F2:113,DOM_VK_F3:114,DOM_VK_F4:115,DOM_VK_F5:116,DOM_VK_F6:117,DOM_VK_F7:118,DOM_VK_F8:119,
DOM_VK_F9:120,DOM_VK_F10:121,DOM_VK_F11:122,DOM_VK_F12:123,DOM_VK_F13:124,DOM_VK_F14:125,DOM_VK_F15:126,DOM_VK_F16:127,DOM_VK_F17:128,DOM_VK_F18:129,DOM_VK_F19:130,DOM_VK_F20:131,DOM_VK_F21:132,DOM_VK_F22:133,DOM_VK_F23:134,DOM_VK_F24:135,DOM_VK_NUM_LOCK:144,DOM_VK_SCROLL_LOCK:145,DOM_VK_COMMA:188,DOM_VK_PERIOD:190,DOM_VK_SLASH:191,DOM_VK_BACK_QUOTE:192,DOM_VK_OPEN_BRACKET:219,DOM_VK_BACK_SLASH:220,DOM_VK_CLOSE_BRACKET:221,DOM_VK_QUOTE:222,DOM_VK_META:224}});
define("gcli/nls/strings",["require","exports","module"],function(l,j){j.root={canonDescNone:"(No description)",cliEvalJavascript:"Enter JavaScript directly",cliUnusedArg:"Too many arguments",cliOptions:"Available Options",fieldSelectionSelect:"Select a %S\u2026",fieldArrayAdd:"Add",fieldArrayDel:"Delete",fieldMenuMore:"More matches, keep typing",jstypeParseScope:"Scope lost",jstypeParseMissing:"Can't find property '%S'",jstypeBeginSyntax:"Syntax error",jstypeBeginUnterm:"Unterminated string literal",
jstypeParseError:"Error",typesNumberNan:'Can\'t convert "%S" to a number.',typesNumberMax:"%1$S is greater than maximum allowed: %2$S.",typesNumberMin:"%1$S is smaller than minimum allowed: %2$S.",typesNumberNotInt2:'Can\'t convert "%S" to an integer.',typesSelectionNomatch:"Can't use '%S'.",nodeParseSyntax:"Syntax error in CSS query",nodeParseMultiple:"Too many matches (%S)",nodeParseNone:"No matches",helpDesc:"Get help on the available commands",helpManual:"Provide help either on a specific command (if a search string is provided and an exact match is found) or on the available commands (if a search string is not provided, or if no exact match is found).",
helpSearchDesc:"Search string",helpSearchManual3:"search string to use in narrowing down the displayed commands. Regular expressions not supported.",helpManSynopsis:"Synopsis",helpManDescription:"Description",helpManParameters:"Parameters",helpManNone:"None",helpListAll:"Available Commands:",helpListPrefix:"Commands starting with '%1$S':",helpListNone:"No commands starting with '%1$S'",helpManRequired:"required",helpManOptional:"optional",subCommands:"Sub-Commands",subCommandsNone:"None",prefDesc:"Commands to control settings",
prefManual:"Commands to display and alter preferences both for GCLI and the surrounding environment",prefListDesc:"Display available settings",prefListManual:"Display a list of preferences, optionally filtered when using the 'search' parameter",prefListSearchDesc:"Filter the list of settings displayed",prefListSearchManual:"Search for the given string in the list of available preferences",prefShowDesc:"Display setting value",prefShowManual:"Display the value of a given preference",prefShowSettingDesc:"Setting to display",
prefShowSettingManual:"The name of the setting to display",prefSetDesc:"Alter a setting",prefSetManual:"Alter preferences defined by the environment",prefSetSettingDesc:"Setting to alter",prefSetSettingManual:"The name of the setting to alter.",prefSetValueDesc:"New value for setting",prefSetValueManual:"The new value for the specified setting",prefSetCheckHeading:"This might void your warranty!",prefSetCheckBody:"Changing these advanced settings can be harmful to the stability, security, and performance of this application. You should only continue if you are sure of what you are doing.",
prefSetCheckGo:"I'll be careful, I promise!",prefResetDesc:"Reset a setting",prefResetManual:"Reset the value of a setting to the system defaults",prefResetSettingDesc:"Setting to reset",prefResetSettingManual:"The name of the setting to reset to the system default value",prefOutputFilter:"Filter",prefOutputName:"Name",prefOutputValue:"Value",introDesc:"Show the opening message",introManual:"Redisplay the message that is shown to new users until they click the 'Got it!' button",introTextOpening2:"This command line is designed for developers. It focuses on speed of input over JavaScript syntax and a rich display over monospace output.",
introTextCommands:"For a list of commands type",introTextKeys2:", or to show/hide command hints press",introTextF1Escape:"F1/Escape",introTextGo:"Got it!",hideIntroDesc:"Show the initial welcome message",eagerHelperDesc:"How eager are the tooltips",allowSetDesc:"Has the user enabled the 'pref set' command?"}});
define("util/l10n",["require","exports","module","gcli/nls/strings"],function(l,j){function h(a,b){return a.replace(/\{[^}]*\}/g,function(a){a=a.slice(1,-1);if(b==null)return console.log("Missing swaps while looking up '"+a+"'"),"";var d=b[a];d==null&&(console.log("Can't find '"+a+"' in "+JSON.stringify(b)),d="");return d})}function f(a,b){var c=0,a=a.replace(/%S/g,function(){return b[c++]});return a=a.replace(/%([0-9])\$S/g,function(a,c){return b[c-1]})}function d(){if(!g){var a=navigator.language||
navigator.userLanguage;b.some(function(b){return b.locales.indexOf(a)!==-1?(g=b,!0):!1});g||(console.error("Failed to find plural rule for "+a),g=b[0])}return g}var k={};j.registerStringsSource=function(a){var b=l(a).root;Object.keys(b).forEach(function(c){k[c]?console.error("Key '"+c+"' (loaded from "+a+") already exists. Ignoring."):k[c]=b[c]},this)};l("gcli/nls/strings");j.registerStringsSource("gcli/nls/strings");j.unregisterStringsSource=function(a){a=l(a).root;Object.keys(a).forEach(function(a){delete k[a]},
this)};j.getPreferredLocales=function(){var a=(typeof navigator!=="undefined"?(navigator.language||navigator.userLanguage).toLowerCase():"en-us").split("-"),b=a.map(function(c,b){return a.slice(0,a.length-b).join("-")});b.push("root");return b};j.lookup=function(a){var b=k[a];if(b==null)throw Error("No i18n key: "+a);return b};j.propertyLookup=typeof Proxy!=="undefined"?Proxy.create({get:function(a,b){return j.lookup(b)}}):k;j.lookupSwap=function(a,b){var c=j.lookup(a);return h(c,b)};j.lookupFormat=
function(a,b){var c=j.lookup(a);return f(c,b)};j.lookupPlural=function(a,b,c){var i=d().get(b),a=j.lookup(a)[i],c=c||{};c.ord=b;return h(a,c)};var b=[{locales:"fa,fa-ir,id,ja,ja-jp-mac,ka,ko,ko-kr,th,th-th,tr,tr-tr,zh,zh-tw,zh-cn".split(","),numForms:1,get:function(){return 0}},{locales:"af,af-za,as,ast,bg,br,bs,bs-ba,ca,cy,cy-gb,da,de,de-de,de-ch,en,en-gb,en-us,en-za,el,el-gr,eo,es,es-es,es-ar,es-cl,es-mx,et,et-ee,eu,fi,fi-fi,fy,fy-nl,gl,gl-gl,he,hu,hu-hu,hy,hy-am,it,it-it,kk,ku,lg,mai,ml,ml-in,mn,nb,nb-no,no,no-no,nl,nn,nn-no,no,no-no,nb,nb-no,nso,nso-za,pa,pa-in,pt,pt-pt,rm,rm-ch,si,si-lk,son,son-ml,sq,sq-al,sv,sv-se,vi,vi-vn,zu,zu-za".split(","),
numForms:2,get:function(a){return a!=1?1:0}},{locales:"ak,ak-gh,bn,bn-in,bn-bd,fr,fr-fr,gu,gu-in,kn,kn-in,mr,mr-in,oc,oc-oc,or,or-in,pt-br,ta,ta-in,ta-lk,te,te-in".split(","),numForms:2,get:function(a){return a>1?1:0}},{locales:["lv"],numForms:3,get:function(a){return a%10==1&&a%100!=11?1:a!=0?2:0}},{locales:["gd","gd-gb"],numForms:4,get:function(a){return a==1||a==11?0:a==2||a==12?1:a>0&&a<20?2:3}},{locales:["ro","ro-ro"],numForms:3,get:function(a){return a==1?0:a==0||a%100>0&&a%100<20?1:2}},{locales:["lt"],
numForms:3,get:function(a){return a%10==1&&a%100!=11?0:a%10>=2&&(a%100<10||a%100>=20)?2:1}},{locales:"be,be-by,hr,hr-hr,ru,ru-ru,sr,sr-rs,sr-cs,uk".split(","),numForms:3,get:function(a){return a%10==1&&a%100!=11?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2}},{locales:["cs","sk"],numForms:3,get:function(a){return a==1?0:a>=2&&a<=4?1:2}},{locales:["pl"],numForms:3,get:function(a){return a==1?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2}},{locales:["sl"],numForms:4,get:function(a){return a%100==1?
0:a%100==2?1:a%100==3||a%100==4?2:3}},{locales:["ga-ie","ga-ie","ga","en-ie"],numForms:5,get:function(a){return a==1?0:a==2?1:a>=3&&a<=6?2:a>=7&&a<=10?3:4}},{locales:["ar"],numForms:6,get:function(a){return a==0?5:a==1?0:a==2?1:a%100>=3&&a%100<=10?2:a%100>=11&&a%100<=99?3:4}},{locales:["mt"],numForms:4,get:function(a){return a==1?0:a==0||a%100>0&&a%100<=10?1:a%100>10&&a%100<20?2:3}},{locales:["mk","mk-mk"],numForms:3,get:function(a){return a%10==1?0:a%10==2?1:2}},{locales:["is"],numForms:2,get:function(a){return a%
10==1&&a%100!=11?0:1}}],g});
define("gcli/argument",["require","exports","module"],function(l,j){function h(a,b,e){a===void 0?this.suffix=this.prefix=this.text="":(this.text=a,this.prefix=b!==void 0?b:"",this.suffix=e!==void 0?e:"")}function f(){this.suffix=this.prefix=this.text=""}function d(a,b,e){this.text=a!==void 0?a:"";this.prefix=b!==void 0?b:"";this.suffix=e!==void 0?e:"";d._moveSpaces(this)}function k(a,b,e){if(!Array.isArray(a))throw Error("args is not an array of Arguments");this.args=b===void 0?a:a.slice(b,e);a=h.merge(this.args);
this.text=a.text;this.prefix=a.prefix;this.suffix=a.suffix}function b(a){this.arg=a;this.text=a.text;this.prefix=a.prefix;this.suffix=a.suffix}function g(){this.suffix=this.prefix=this.text=""}function a(a,b,e){typeof a==="string"?(this.valueArg=this.nameArg=null,this.text=a,this.prefix=b,this.suffix=e):b==null?(this.nameArg=a,this.valueArg=null,this.text="",this.prefix=this.nameArg.toString(),this.suffix=""):(this.nameArg=a,this.valueArg=b,this.text=this.valueArg.text,this.prefix=this.nameArg.toString()+
this.valueArg.prefix,this.suffix=this.valueArg.suffix)}function e(){this.args=[]}h.prototype.type="Argument";h.prototype.merge=function(a){return new h(this.text+this.suffix+a.prefix+a.text,this.prefix,a.suffix)};h.prototype.beget=function(a){var b=this.text,e=this.prefix,d=this.suffix;if(a.text!=null&&(b=a.text,!a.dontQuote)){var f=b.indexOf(" ")>=0||b.length==0,g=/['"]$/.test(e);f&&!g&&(e+="'",d="'"+d)}a.prefixSpace&&e.charAt(0)!==" "&&(e=" "+e);a.prefixPostSpace&&e.charAt(e.length-1)!==" "&&(e+=
" ");a.suffixSpace&&d.charAt(d.length-1)!==" "&&(d+=" ");return b===this.text&&d===this.suffix&&e===this.prefix?this:new (a.type||h)(b,e,d)};h.prototype.assign=function(a){this.assignment=a};h.prototype.getArgs=function(){return[this]};h.prototype.equals=function(a){return this===a?!0:a==null||!(a instanceof h)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};h.prototype.toString=function(){return this.prefix+this.text+this.suffix};h.merge=function(a,b,e){for(var e=e===void 0?
a.length:e,d,b=b===void 0?0:b;b<e;b++){var f=a[b];d=d?d.merge(f):f}return d};Object.defineProperty(h.prototype,"_summaryJson",{get:function(){return"<"+this.prefix+":"+this.text+":"+this.suffix+"> (a="+(this.assignment==null?"null":this.assignment.param.name)+", t="+this.type+")"},enumerable:!0});j.Argument=h;f.prototype=Object.create(h.prototype);f.prototype.type="BlankArgument";j.BlankArgument=f;d.prototype=Object.create(h.prototype);d.prototype.type="ScriptArgument";d._moveSpaces=function(a){for(;a.text.charAt(0)===
" ";)a.prefix+=" ",a.text=a.text.substring(1);for(;a.text.charAt(a.text.length-1)===" ";)a.suffix=" "+a.suffix,a.text=a.text.slice(0,-1)};d.prototype.beget=function(a){a.type=d;a=h.prototype.beget.call(this,a);d._moveSpaces(a);return a};j.ScriptArgument=d;k.prototype=Object.create(h.prototype);k.prototype.type="MergedArgument";k.prototype.assign=function(a){this.args.forEach(function(b){b.assign(a)},this);this.assignment=a};k.prototype.getArgs=function(){return this.args};k.prototype.equals=function(a){return this===
a?!0:a==null||!(a instanceof k)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};j.MergedArgument=k;b.prototype=Object.create(h.prototype);b.prototype.type="TrueNamedArgument";b.prototype.assign=function(a){this.arg&&this.arg.assign(a);this.assignment=a};b.prototype.getArgs=function(){return[this.arg]};b.prototype.equals=function(a){return this===a?!0:a==null||!(a instanceof b)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};b.prototype.beget=function(a){a.text&&
console.error("Can't change text of a TrueNamedArgument",this,a);a.type=b;a=h.prototype.beget.call(this,a);a.arg=new h(a.text,a.prefix,a.suffix);return a};j.TrueNamedArgument=b;g.prototype=Object.create(h.prototype);g.prototype.type="FalseNamedArgument";g.prototype.getArgs=function(){return[]};g.prototype.equals=function(a){return this===a?!0:a==null||!(a instanceof g)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};j.FalseNamedArgument=g;a.prototype=Object.create(h.prototype);
a.prototype.type="NamedArgument";a.prototype.assign=function(a){this.nameArg.assign(a);this.valueArg!=null&&this.valueArg.assign(a);this.assignment=a};a.prototype.getArgs=function(){return this.valueArg?[this.nameArg,this.valueArg]:[this.nameArg]};a.prototype.equals=function(c){return this===c?!0:c==null?!1:!(c instanceof a)?!1:this.text===c.text&&this.prefix===c.prefix&&this.suffix===c.suffix};a.prototype.beget=function(c){c.type=a;var c=h.prototype.beget.call(this,c),b=/^([\s]*)([^\s]*)([\s]*['"]?)$/.exec(c.prefix);
this.valueArg==null&&c.text===""?(c.nameArg=new h(b[2],b[1],b[3]),c.valueArg=null):(c.nameArg=new h(b[2],b[1],""),c.valueArg=new h(c.text,b[3],c.suffix));return c};j.NamedArgument=a;e.prototype=Object.create(h.prototype);e.prototype.type="ArrayArgument";e.prototype.addArgument=function(a){this.args.push(a)};e.prototype.addArguments=function(a){Array.prototype.push.apply(this.args,a)};e.prototype.getArguments=function(){return this.args};e.prototype.assign=function(a){this.args.forEach(function(b){b.assign(a)},
this);this.assignment=a};e.prototype.getArgs=function(){return this.args};e.prototype.equals=function(a){if(this===a)return!0;if(a==null)return!1;if(a.type!=="ArrayArgument")return!1;if(this.args.length!==a.args.length)return!1;for(var b=0;b<this.args.length;b++)if(!this.args[b].equals(a.args[b]))return!1;return!0};e.prototype.toString=function(){return"{"+this.args.map(function(a){return a.toString()},this).join(",")+"}"};j.ArrayArgument=e});
define("gcli/types","require,exports,module,util/promise,gcli/argument,gcli/argument".split(","),function(l,j){function h(b,e,d,f,g){this.value=b;this.arg=e;if(e==null)throw Error("Missing arg");if(g!=null){b=typeof g==="function"?g():g;if(typeof b.then!=="function")throw Error("predictions is not a promise");b.then(function(a){if(!Array.isArray(a))throw Error("prediction resolves to non array");},console.error)}this._status=d||a.VALID;this.message=f;this.predictions=g}function f(b,e){this.arg=e;
this.conversions=b;this.value=b.map(function(a){return a.value},this);this._status=a.combine(b.map(function(a){return a.getStatus()}));this.message="";this.predictions=[]}function d(){}var k=l("util/promise"),b=l("gcli/argument").Argument,g=l("gcli/argument").BlankArgument,a={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},ERROR:{toString:function(){return"ERROR"},valueOf:function(){return 2}},
combine:function(){for(var b=a.VALID,e=0;e<arguments.length;e++){var d=arguments[e];Array.isArray(d)&&(d=a.combine.apply(null,d));d>b&&(b=d)}return b}};j.Status=a;h.prototype.assign=function(a){this.arg.assign(a)};h.prototype.isDataProvided=function(){return this.arg.type!=="BlankArgument"};h.prototype.equals=function(a){return this===a?!0:a==null?!1:this.valueEquals(a)&&this.argEquals(a)};h.prototype.valueEquals=function(a){return this.value===a.value};h.prototype.argEquals=function(a){return a==
null?!1:this.arg.equals(a.arg)};h.prototype.getStatus=function(){return this._status};h.prototype.toString=function(){return this.arg.toString()};h.prototype.getPredictions=function(){return typeof this.predictions==="function"?this.predictions():k.resolve(this.predictions||[])};h.prototype.constrainPredictionIndex=function(a){return a==null?k.resolve():this.getPredictions().then(function(b){if(b.length!==0)return a%=b.length,a<0&&(a=b.length+a),a}.bind(this))};h.maxPredictions=11;j.Conversion=h;
f.prototype=Object.create(h.prototype);f.prototype.assign=function(a){this.conversions.forEach(function(b){b.assign(a)},this);this.assignment=a};f.prototype.getStatus=function(a){return a&&a.conversion?a.conversion.getStatus():this._status};f.prototype.isDataProvided=function(){return this.conversions.length>0};f.prototype.valueEquals=function(a){if(!(a instanceof f))throw Error("Can't compare values with non ArrayConversion");if(this.value===a.value)return!0;if(this.value.length!==a.value.length)return!1;
for(var b=0;b<this.conversions.length;b++)if(!this.conversions[b].valueEquals(a.conversions[b]))return!1;return!0};f.prototype.toString=function(){return"[ "+this.conversions.map(function(a){return a.toString()},this).join(", ")+" ]"};j.ArrayConversion=f;d.prototype.stringify=function(){throw Error("Not implemented");};d.prototype.parse=function(){throw Error("Not implemented");};d.prototype.parseString=function(a){return this.parse(new b(a))};d.prototype.name=void 0;d.prototype.increment=function(){};
d.prototype.decrement=function(){};d.prototype.getBlank=function(){return new h(void 0,new g,a.INCOMPLETE,"")};d.prototype.getType=function(){return this};j.Type=d;var e={};j.getTypeNames=function(){return Object.keys(e)};j.registerType=function(a){if(typeof a==="object")if(a instanceof d){if(!a.name)throw Error("All registered types must have a name");e[a.name]=a}else throw Error("Can't registerType using: "+a);else if(typeof a==="function"){if(!a.prototype.name)throw Error("All registered types must have a name");
e[a.prototype.name]=a}else throw Error("Unknown type: "+a);};j.registerTypes=function(a){Object.keys(a).forEach(function(b){var e=a[b];e.name=b;a.registerType(e)})};j.deregisterType=function(a){delete e[a.name]};j.getType=function(a){var b;if(typeof a==="string")return b=e[a],typeof b==="function"&&(b=new b({})),b;if(typeof a==="object"){if(!a.name)throw Error("Missing 'name' member to typeSpec");b=e[a.name];typeof b==="function"&&(b=new b(a));return b}throw Error("Can't extract type from "+a);}});
define("gcli/types/spell",["require","exports","module"],function(l,j){j.correct=function(h,f){if(f.length!==0){var d={},k;f.forEach(function(b){var f=h.length,a=b.length,e=Array(f+1),c=Array(f+1),i=Array(f+1),k,j;for(k=0;k<=f;k++)c[k]=k*1;for(j=1;j<=a;j++){e[0]=j*1;for(k=1;k<=f;k++)e[k]=Math.min(e[k-1]+1,c[k]+1,c[k-1]+(h[k-1]===b[j-1]?0:2)),k>1&&j>1&&h[k-1]===b[j-2]&&b[j-1]===h[k-2]&&(e[k]=Math.min(e[k],i[k-2]+1));k=i;i=c;c=e;e=k}d[b]=c[f]});k=f.sort(function(b,f){return d[b]!==d[f]?d[b]-d[f]:b<
f});if(d[k[0]]<=4)return k[0]}}});
define("gcli/types/selection","require,exports,module,util/promise,util/util,util/l10n,gcli/types,gcli/types,gcli/types,gcli/types,gcli/types/spell,gcli/argument".split(","),function(l,j){function h(a){a&&Object.keys(a).forEach(function(b){this[b]=a[b]},this)}function f(a,b){if(n&&!b){var c=k.defer();setTimeout(function(){k.resolve(a).then(function(a){typeof a==="function"&&(a=f(a(),b));c.resolve(a)})},500);return c.promise}return k.resolve(a).then(function(a){return typeof a==="function"?f(a(),b):
a})}function d(a){if(!Array.isArray(a))throw Error("SelectionType has no lookup or data");return a.map(function(a){return{name:a,value:a}},this)}var k=l("util/promise"),b=l("util/util"),g=l("util/l10n"),a=l("gcli/types"),e=l("gcli/types").Type,c=l("gcli/types").Status,i=l("gcli/types").Conversion,m=l("gcli/types/spell"),o=l("gcli/argument").BlankArgument;j.startup=function(){a.registerType(h)};j.shutdown=function(){a.unregisterType(h)};h.prototype=Object.create(e.prototype);h.prototype.stringify=
function(a){if(a==null)return"";if(this.stringifyProperty!=null)return a[this.stringifyProperty];try{var c=null;b.synchronize(this.getLookup()).some(function(b){return b.value===a?(c=b.name,!0):!1},this);return c}catch(e){return a.toString()}};h.prototype.clearCache=function(){delete this._cachedLookup};h.prototype.getLookup=function(){if(this._cachedLookup!=null)return this._cachedLookup;var a;this.lookup==null?a=f(this.data,this.neverForceAsync).then(d):(a=typeof this.lookup==="function"?this.lookup.bind(this):
this.lookup,a=f(a,this.neverForceAsync));if(this.cacheable&&!n)this._cachedLookup=a;return a};var n=!1;h.prototype._findPredictions=function(a){return k.resolve(this.getLookup()).then(function(b){var c=[],e,d,f=i.maxPredictions,g=a.text.toLowerCase();if(a.suffix.length>0){for(e=0;e<b.length&&c.length<f;e++)d=b[e],d.name===a.text&&this._addToPredictions(c,d,a);return c}for(e=0;e<b.length;e++)if(d=b[e],d._gcliLowerName==null)d._gcliLowerName=d.name.toLowerCase();for(e=0;e<b.length&&c.length<f;e++)d=
b[e],d.name===a.text&&this._addToPredictions(c,d,a);for(e=0;e<b.length&&c.length<f;e++)d=b[e],d._gcliLowerName.indexOf(g)===0&&!d.value.hidden&&c.indexOf(d)===-1&&this._addToPredictions(c,d,a);if(c.length<f/2)for(e=0;e<b.length&&c.length<f;e++)d=b[e],d._gcliLowerName.indexOf(g)!==-1&&!d.value.hidden&&c.indexOf(d)===-1&&this._addToPredictions(c,d,a);if(c.length===0){var h=[];b.forEach(function(a){a.value.hidden||h.push(a.name)});var k=m.correct(g,h);k&&b.forEach(function(a){a.name===k&&c.push(a)},
this)}return c}.bind(this))};h.prototype._addToPredictions=function(a,b){a.push(b)};h.prototype.parse=function(a){return this._findPredictions(a).then(function(b){if(b.length===0){var e=g.lookupFormat("typesSelectionNomatch",[a.text]);return new i(void 0,a,c.ERROR,e,k.resolve(b))}this.noMatch&&this.noMatch();return b[0].name===a.text?new i(b[0].value,a,c.VALID,"",k.resolve(b)):new i(void 0,a,c.INCOMPLETE,"",k.resolve(b))}.bind(this))};h.prototype.getBlank=function(){var a=function(){return k.resolve(this.getLookup()).then(function(a){return a.filter(function(a){return!a.value.hidden}).slice(0,
i.maxPredictions-1)},console.error)}.bind(this);return new i(void 0,new o,c.INCOMPLETE,"",a)};h.prototype.decrement=function(a){var c=b.synchronize(this.getLookup()),a=this._findValue(c,a);a===-1&&(a=0);a++;a>=c.length&&(a=0);return c[a].value};h.prototype.increment=function(a){var c=b.synchronize(this.getLookup()),a=this._findValue(c,a);a===-1&&(a=1);a--;a<0&&(a=c.length-1);return c[a].value};h.prototype._findValue=function(a,b){for(var c=-1,e=0;e<a.length;e++)if(a[e].value===b){c=e;break}return c};
h.prototype.name="selection";j.SelectionType=h});
define("gcli/types/basic","require,exports,module,util/promise,util/util,util/l10n,gcli/types,gcli/types,gcli/types,gcli/types,gcli/types,gcli/types/selection,gcli/argument,gcli/argument".split(","),function(l,j){function h(){}function f(a){this._allowFloat=!!a.allowFloat;if(a){if(this._min=a.min,this._max=a.max,this._step=a.step||1,!this._allowFloat&&(this._isFloat(this._min)||this._isFloat(this._max)||this._isFloat(this._step)))throw Error("allowFloat is false, but non-integer values given in type spec");}else this._step=
1}function d(){}function k(a){if(typeof a.delegateType!=="function")throw Error("Instances of DelegateType need typeSpec.delegateType to be a function that returns a type");Object.keys(a).forEach(function(b){this[b]=a[b]},this)}function b(){}function g(a){if(!a.subtype)console.error("Array.typeSpec is missing subtype. Assuming string."+JSON.stringify(a)),a.subtype="string";Object.keys(a).forEach(function(b){this[b]=a[b]},this);this.subtype=i.getType(this.subtype)}var a=l("util/promise"),e=l("util/util"),
c=l("util/l10n"),i=l("gcli/types"),m=l("gcli/types").Type,o=l("gcli/types").Status,n=l("gcli/types").Conversion,p=l("gcli/types").ArrayConversion,t=l("gcli/types/selection").SelectionType,u=l("gcli/argument").BlankArgument,v=l("gcli/argument").ArrayArgument;j.startup=function(){i.registerType(h);i.registerType(f);i.registerType(d);i.registerType(b);i.registerType(k);i.registerType(g)};j.shutdown=function(){i.unregisterType(h);i.unregisterType(f);i.unregisterType(d);i.unregisterType(b);i.unregisterType(k);
i.unregisterType(g)};h.prototype=Object.create(m.prototype);h.prototype.stringify=function(a){return a==null?"":a.toString()};h.prototype.parse=function(b){return b.text==null||b.text===""?a.resolve(new n(void 0,b,o.INCOMPLETE,"")):a.resolve(new n(b.text,b))};h.prototype.name="string";j.StringType=h;f.prototype=Object.create(m.prototype);f.prototype.stringify=function(a){return a==null?"":""+a};f.prototype.getMin=function(){if(this._min){if(typeof this._min==="function")return this._min();if(typeof this._min===
"number")return this._min}};f.prototype.getMax=function(){if(this._max){if(typeof this._max==="function")return this._max();if(typeof this._max==="number")return this._max}};f.prototype.parse=function(b){if(b.text.replace(/^\s*-?/,"").length===0)return a.resolve(new n(void 0,b,o.INCOMPLETE,""));if(!this._allowFloat&&b.text.indexOf(".")!==-1){var e=c.lookupFormat("typesNumberNotInt2",[b.text]);return a.resolve(new n(void 0,b,o.ERROR,e))}e=this._allowFloat?parseFloat(b.text):parseInt(b.text,10);if(isNaN(e))return e=
c.lookupFormat("typesNumberNan",[b.text]),a.resolve(new n(void 0,b,o.ERROR,e));var d=this.getMax();if(d!=null&&e>d)return e=c.lookupFormat("typesNumberMax",[e,d]),a.resolve(new n(void 0,b,o.ERROR,e));d=this.getMin();return d!=null&&e<d?(e=c.lookupFormat("typesNumberMin",[e,d]),a.resolve(new n(void 0,b,o.ERROR,e))):a.resolve(new n(e,b))};f.prototype.decrement=function(a){if(typeof a!=="number"||isNaN(a))return this.getMax()||1;a-=this._step;a=Math.ceil(a/this._step)*this._step;return this._boundsCheck(a)};
f.prototype.increment=function(a){if(typeof a!=="number"||isNaN(a))return a=this.getMin(),a!=null?a:0;a+=this._step;a=Math.floor(a/this._step)*this._step;return this.getMax()==null?a:this._boundsCheck(a)};f.prototype._boundsCheck=function(a){var b=this.getMin();if(b!=null&&a<b)return b;b=this.getMax();return b!=null&&a>b?b:a};f.prototype._isFloat=function(a){return typeof a==="number"&&isFinite(a)&&a%1!==0};f.prototype.name="number";j.NumberType=f;d.prototype=Object.create(t.prototype);d.prototype.lookup=
[{name:"false",value:!1},{name:"true",value:!0}];d.prototype.parse=function(b){return b.type==="TrueNamedArgument"?a.resolve(new n(!0,b)):b.type==="FalseNamedArgument"?a.resolve(new n(!1,b)):t.prototype.parse.call(this,b)};d.prototype.stringify=function(a){return a==null?"":""+a};d.prototype.getBlank=function(){return new n(!1,new u,o.VALID,"",a.resolve(this.lookup))};d.prototype.name="boolean";j.BooleanType=d;k.prototype.delegateType=function(){throw Error("Not implemented");};k.prototype=Object.create(m.prototype);
k.prototype.stringify=function(a){return this.delegateType().stringify(a)};k.prototype.parse=function(a){return this.delegateType().parse(a)};k.prototype.decrement=function(a){var b=this.delegateType();return b.decrement?b.decrement(a):void 0};k.prototype.increment=function(a){var b=this.delegateType();return b.increment?b.increment(a):void 0};k.prototype.getType=function(){return this.delegateType()};Object.defineProperty(k.prototype,"isImportant",{get:function(){return this.delegateType().isImportant},
enumerable:!0});k.prototype.name="delegate";j.DelegateType=k;b.prototype=Object.create(m.prototype);b.prototype.stringify=function(){return""};b.prototype.parse=function(b){return a.resolve(new n(void 0,b))};b.prototype.name="blank";j.BlankType=b;g.prototype=Object.create(m.prototype);g.prototype.stringify=function(a){return a==null?"":a.join(" ")};g.prototype.parse=function(a){if(a.type!=="ArrayArgument")throw console.error("non ArrayArgument to ArrayType.parse",a),Error("non ArrayArgument to ArrayType.parse");
var b=function(a){return this.subtype.parse(a).then(function(b){return a.conversion=b}.bind(this),console.error)}.bind(this),b=a.getArguments().map(b);return e.all(b).then(function(b){return new p(b,a)})};g.prototype.getBlank=function(){return new p([],new v)};g.prototype.name="array";j.ArrayType=g});
define("gcli/canon","require,exports,module,util/promise,util/util,util/l10n,gcli/types,gcli/types,gcli/types/basic,gcli/types/selection".split(","),function(l,j){function h(a,c){if(a==null)return c?b.lookup(c):a;if(typeof a==="string")return a;if(typeof a==="object"){if(a.key)return b.lookup(a.key);var e=b.getPreferredLocales(),d;e.some(function(b){d=a[b];return d!=null});if(d!=null)return d;console.error("Can't find locale in descriptions: locales="+JSON.stringify(e)+", description="+JSON.stringify(a));
return"(No description)"}return b.lookup(c)}function f(a){Object.keys(a).forEach(function(b){this[b]=a[b]},this);if(!this.name)throw Error("All registered commands must have a name");if(this.params==null)this.params=[];if(!Array.isArray(this.params))throw Error("command.params must be an array in "+this.name);this.hasNamedParameters=!1;this.description="description"in this?this.description:void 0;this.description=h(this.description,"canonDescNone");this.manual="manual"in this?this.manual:void 0;this.manual=
h(this.manual);var b=this.params;this.params=[];var c=!1;if(this.returnType==null)this.returnType="string";b.forEach(function(a){if(a.group)a.params.forEach(function(b){b=new d(b,this,a.group);this.params.push(b);if(!b.isPositionalAllowed)this.hasNamedParameters=!0},this),c=!0;else if(c)throw Error("Parameters can't come after param groups. Ignoring "+this.name+"/"+a.name);else{var b=new d(a,this,null);this.params.push(b);if(!b.isPositionalAllowed)this.hasNamedParameters=!0}},this)}function d(b,c,
d){this.command=c||{name:"unnamed"};this.paramSpec=b;this.name=this.paramSpec.name;this.type=this.paramSpec.type;this.groupName=d;if(!this.name)throw Error("In "+this.command.name+": all params must have a name");b=this.type;this.type=g.getType(b);if(this.type==null)throw console.error("Known types: "+g.getTypeNames().join(", ")),Error("In "+this.command.name+"/"+this.name+": can't find type for: "+JSON.stringify(b));if(this.type instanceof e&&this.paramSpec.defaultValue!==void 0)throw Error("In "+
this.command.name+"/"+this.name+": boolean parameters can not have a defaultValue. Ignoring");if(this._defaultValue!=null)try{this.type.parseString(this.type.stringify(this.paramSpec.defaultValue)).then(function(b){b.getStatus()!==a.VALID&&console.error("In "+this.command.name+"/"+this.name+": Error round tripping defaultValue. status = "+b.getStatus())}.bind(this),console.error)}catch(i){throw Error("In "+this.command.name+"/"+this.name+": "+i);}if(!this.isPositionalAllowed&&this.paramSpec.defaultValue===
void 0&&this.type.getBlank==null&&!(this.type instanceof e))throw Error("In "+this.command.name+"/"+this.name+": Missing defaultValue for optional parameter.");}l("util/promise");var k=l("util/util"),b=l("util/l10n"),g=l("gcli/types"),a=l("gcli/types").Status,e=l("gcli/types/basic").BooleanType;l("gcli/types/selection");j.Command=f;Object.defineProperty(d.prototype,"defaultValue",{get:function(){if(!("_defaultValue"in this))this._defaultValue=this.paramSpec.defaultValue!==void 0?this.paramSpec.defaultValue:
this.type.getBlank().value;return this._defaultValue},enumerable:!0});d.prototype.isKnownAs=function(a){return a==="--"+this.name?!0:!1};d.prototype.getBlank=function(){return this.type.getBlank()};Object.defineProperty(d.prototype,"manual",{get:function(){return h(this.paramSpec.manual||void 0)},enumerable:!0});Object.defineProperty(d.prototype,"description",{get:function(){return h(this.paramSpec.description||void 0,"canonDescNone")},enumerable:!0});Object.defineProperty(d.prototype,"isDataRequired",
{get:function(){return this.defaultValue===void 0},enumerable:!0});Object.defineProperty(d.prototype,"hidden",{get:function(){return this.paramSpec.hidden},enumerable:!0});Object.defineProperty(d.prototype,"isPositionalAllowed",{get:function(){return this.groupName==null},enumerable:!0});j.Parameter=d;var c={},i=[],m={};j.addCommand=function(a){c[a.name]!=null&&(delete c[a.name],i=i.filter(function(b){return b!==a.name}));var b=new f(a);c[a.name]=b;i.push(a.name);i.sort();m[a.name]=a;j.onCanonChange();
return b};j.removeCommand=function(a){var b=typeof a==="string"?a:a.name;if(!c[b])return!1;delete c[b];delete m[b];i=i.filter(function(a){return a!==b});j.onCanonChange();return!0};j.getCommand=function(a){return c[a]||void 0};j.getCommands=function(){return Object.keys(c).map(function(a){return c[a]},this)};j.getCommandNames=function(){return i.slice(0)};j.getCommandSpecs=function(){return m};j.onCanonChange=k.createEvent("canon.onCanonChange");j.CommandOutputManager=function(){this.onOutput=k.createEvent("CommandOutputManager.onOutput")}});
define("gcli/types/command","require,exports,module,util/promise,util/l10n,gcli/canon,gcli/types,gcli/types/selection,gcli/types,gcli/types".split(","),function(l,j){function h(a){this.requisition=a.requisition;this.isIncompleteName=a.isIncompleteName;this.stringifyProperty="name";this.neverForceAsync=!0}function f(){this.stringifyProperty="name";this.neverForceAsync=!0}var d=l("util/promise"),k=l("util/l10n"),b=l("gcli/canon"),g=l("gcli/types"),a=l("gcli/types/selection").SelectionType,e=l("gcli/types").Status,
c=l("gcli/types").Conversion;j.startup=function(){g.registerType(f);g.registerType(h)};j.shutdown=function(){g.unregisterType(f);g.unregisterType(h)};h.prototype=Object.create(a.prototype);h.prototype.name="param";h.prototype.lookup=function(){var a=[],b=this.requisition.commandAssignment.value;b!=null&&b.params.forEach(function(b){var c=this.requisition.getAssignment(b.name).arg;!b.isPositionalAllowed&&c.type==="BlankArgument"&&a.push({name:"--"+b.name,value:b})},this);return a};h.prototype.parse=
function(b){if(this.isIncompleteName)return a.prototype.parse.call(this,b);else{var f=k.lookup("cliUnusedArg");return d.resolve(new c(void 0,b,e.ERROR,f))}};f.prototype=Object.create(a.prototype);f.prototype.name="command";f.prototype.lookup=function(){var a=b.getCommands();a.sort(function(a,b){return a.name.localeCompare(b.name)});return a.map(function(a){return{name:a.name,value:a}},this)};f.prototype._addToPredictions=function(a,b,c){(c.text.length!==0||b.name.indexOf(" ")===-1)&&a.push(b)};f.prototype.parse=
function(a){var b=function(){return this._findPredictions(a)}.bind(this);return this._findPredictions(a).then(function(d){if(d.length===0)return d=k.lookupFormat("typesSelectionNomatch",[a.text]),new c(void 0,a,e.ERROR,d,b);var f=d[0].value;return d.length===1?f.name===a.text&&typeof f.exec==="function"?new c(f,a,e.VALID,""):new c(void 0,a,e.INCOMPLETE,"",b):d[0].name===a.text?new c(f,a,e.VALID,"",b):new c(void 0,a,e.INCOMPLETE,"",b)}.bind(this))}});
define("gcli/types/javascript","require,exports,module,util/promise,util/l10n,gcli/types".split(","),function(l,j){var h,f;function d(){}function k(a){return a.indexOf("moz")===0||a.indexOf("webkit")===0||a.indexOf("ms")===0}var b=l("util/promise"),g=l("util/l10n"),a=l("gcli/types"),e=a.Conversion,c=a.Type,i=a.Status;j.startup=function(){a.registerType(d)};j.shutdown=function(){a.unregisterType(d)};var m=void 0;typeof window!=="undefined"&&(m=window);j.setGlobalObject=function(a){m=a};j.getGlobalObject=
function(){return m};j.unsetGlobalObject=function(){m=void 0};d.prototype=Object.create(c.prototype);d.prototype.stringify=function(a){return a==null?"":a};d.MAX_COMPLETION_MATCHES=10;d.prototype.parse=function(a){var c=a.text,j=m;if(c==="")return b.resolve(new e(void 0,a,i.INCOMPLETE));if(!isNaN(parseFloat(c))&&isFinite(c))return b.resolve(new e(c,a));if(c.trim().match(/(null|undefined|NaN|Infinity|true|false)/))return b.resolve(new e(c,a));var l=this._findCompletionBeginning(c);if(l.err)return b.resolve(new e(c,
a,i.ERROR,l.err));if(l.state===h)return b.resolve(new e(c,a));if(l.state!==f)return b.resolve(new e(c,a,i.INCOMPLETE,""));var l=c.substring(l.startPos).split("."),o,n=void 0;if(l.length>1){o=l.pop().trimLeft();for(var p=0;p<l.length;p++){n=l[p].trim();if(j==null)return b.resolve(new e(c,a,i.ERROR,g.lookup("jstypeParseScope")));if(n==="")return b.resolve(new e(c,a,i.INCOMPLETE,""));if(this._isSafeProperty(j,n))return b.resolve(new e(c,a));try{j=j[n]}catch(t){return b.resolve(new e(c,a,i.VALID,""))}}}else o=
l[0].trimLeft();if(n&&!n.match(/^[0-9A-Za-z]*$/))return b.resolve(new e(c,a));if(j==null)return l=g.lookupFormat("jstypeParseMissing",[n]),b.resolve(new e(c,a,i.ERROR,l));if(!o.match(/^[0-9A-Za-z]*$/))return b.resolve(new e(c,a));if(this._isIteratorOrGenerator(j))return b.resolve(new e(c,a));var l=o.length,H=l===0?c:c.slice(0,-l),C=i.INCOMPLETE,l="",s={},A=0,n=j;try{for(;n!=null&&Object.keys(s).length<d.MAX_COMPLETION_MATCHES;)Object.keys(n).forEach(function(a){a.indexOf(o)===0&&!(a in s)&&(s[a]=
{prop:a,distUpPrototypeChain:A})}),A++,n=Object.getPrototypeOf(n)}catch(x){return b.resolve(new e(c,a,i.INCOMPLETE,""))}s=Object.keys(s).map(function(a){if(a===o)C=i.VALID;return s[a]});s.sort(function(a,b){return a.distUpPrototypeChain!==b.distUpPrototypeChain?a.distUpPrototypeChain-b.distUpPrototypeChain:k(a.prop)?k(b.prop)?a.prop.localeCompare(b.prop):1:k(b.prop)?-1:a.prop.localeCompare(b.prop)});s.length>d.MAX_COMPLETION_MATCHES&&(s=s.slice(0,d.MAX_COMPLETION_MATCHES-1));n=s.map(function(a){var b,
c=!0;if(this._isSafeProperty(j,a.prop))b="(property getter)";else try{var e=j[a.prop];typeof e==="function"?b="(function)":typeof e==="boolean"||typeof e==="number"?(b="= "+e,c=!1):typeof e==="string"?(e.length>40&&(e=e.substring(0,37)+"\u2026"),b="= '"+e+"'",c=!1):b="("+typeof e+")"}catch(d){b="("+g.lookup("jstypeParseError")+")"}return{name:H+a.prop,value:{name:H+a.prop,description:b},description:b,incomplete:c}},this);if(n.length===0)C=i.ERROR,l=g.lookupFormat("jstypeParseMissing",[o]);n.length===
1&&C===i.VALID&&(n=[]);return b.resolve(new e(c,a,C,l,b.resolve(n)))};f=0;h=1;var o="{[(".split(""),n="}])".split(""),p={"{":"}","[":"]","(":")"},t=/[a-zA-Z0-9.]/;d.prototype._findCompletionBeginning=function(a){for(var b=[],c=f,e=0,d,i=!1,k=0;k<a.length;k++)switch(d=a[k],t.test(d)||(i=!0),c){case f:if(d==='"')c=3;else if(d==="'")c=2;else if(d===";")e=k+1;else if(d===" ")e=k+1;else if(o.indexOf(d)!=-1)b.push({token:d,start:e}),e=k+1;else if(n.indexOf(d)!=-1){e=b.pop();if(!e||p[e.token]!=d)return{err:g.lookup("jstypeBeginSyntax")};
e=d==="}"?k+1:e.start}break;case 3:if(d==="\\")k++;else if(d==="\n")return{err:g.lookup("jstypeBeginUnterm")};else d==='"'&&(c=f);break;case 2:if(d==="\\")k++;else if(d==="\n")return{err:g.lookup("jstypeBeginUnterm")};else d==="'"&&(c=f)}c===f&&i&&(c=h);return{state:c,startPos:e}};d.prototype._isIteratorOrGenerator=function(a){if(a===null)return!1;if(typeof aObject==="object"){if(typeof a.__iterator__==="function"||a.constructor&&a.constructor.name==="Iterator")return!0;try{var b=a.toString();if(typeof a.next===
"function"&&b.indexOf("[object Generator")===0)return!0}catch(c){}}return!1};d.prototype._isSafeProperty=function(a,b){if(typeof a!=="object")return!1;for(var c=void 0;a;){try{if(c=Object.getOwnPropertyDescriptor(a,b))break}catch(e){return e.name==="NS_ERROR_XPC_BAD_CONVERT_JS"||e.name==="NS_ERROR_XPC_BAD_OP_ON_WN_PROTO"?!1:!0}a=Object.getPrototypeOf(a)}return!c?!1:!c.get?!1:typeof c.get!=="function"||"prototype"in c.get};d.prototype.name="javascript";j.JavascriptType=d});
define("util/host",["require","exports","module"],function(l,j){function h(f,d){if(!f.__gcliHighlighting){f.__gcliHighlighting=!0;var h=f.style.background;f.style.background=d?"green":"red";setTimeout(function(){f.style.background=h;delete f.__gcliHighlighting},500)}}j.flashNodes=function(f,d){f.style?h(f,d):Array.prototype.forEach.call(f,function(f){h(f,d)})};j.exec=function(f,d){var h=JSON.stringify(d),b=new XMLHttpRequest;b.open("POST","/exec/",!0);b.setRequestHeader("Content-Type","application/json; charset=utf-8");
b.setRequestHeader("Content-Length",h.length);b.onreadystatechange=function(){b.readyState==4&&(b.status>=300||b.status<200?f.reject(b.responseText):f.resolve(b.responseText))};b.send(h)};j.func=function(f,d){var h=JSON.stringify(d),b=new XMLHttpRequest;b.open("POST","/func/",!0);b.setRequestHeader("Content-Type","application/json; charset=utf-8");b.setRequestHeader("Content-Length",h.length);b.onreadystatechange=function(){b.readyState==4&&(b.status>=300||b.status<200?f.reject(JSON.parse(b.responseText)):
f.resolve(JSON.parse(b.responseText)))};b.send(h)}});
define("gcli/types/node","require,exports,module,util/promise,util/host,util/l10n,gcli/types,gcli/types,gcli/types,gcli/types,gcli/argument".split(","),function(l,j){function h(){}function f(a){if("allowEmpty"in a&&typeof a.allowEmpty!=="boolean")throw Error("Legal values for allowEmpty are [true|false]");this.allowEmpty=a.allowEmpty}var d=l("util/promise"),k=l("util/host"),b=l("util/l10n"),g=l("gcli/types"),a=l("gcli/types").Type,e=l("gcli/types").Status,c=l("gcli/types").Conversion,i=l("gcli/argument").BlankArgument;
j.startup=function(){g.registerType(h);g.registerType(f)};j.shutdown=function(){g.unregisterType(h);g.unregisterType(f)};var m=void 0;typeof document!=="undefined"&&(m=document);j._empty=[];j.setDocument=function(a){m=a;if(m!=null)j._empty=m.querySelectorAll("x>:root")};j.unsetDocument=function(){m=void 0;j._empty=void 0};j.getDocument=function(){return m};h.prototype=Object.create(a.prototype);h.prototype.stringify=function(a){return a==null?"":a.__gcliQuery||"Error"};h.prototype.parse=function(a){if(a.text===
"")return d.resolve(new c(void 0,a,e.INCOMPLETE));var f;try{f=m.querySelectorAll(a.text)}catch(i){return d.resolve(new c(void 0,a,e.ERROR,b.lookup("nodeParseSyntax")))}if(f.length===0)return d.resolve(new c(void 0,a,e.INCOMPLETE,b.lookup("nodeParseNone")));if(f.length===1)return f=f.item(0),f.__gcliQuery=a.text,k.flashNodes(f,!0),d.resolve(new c(f,a,e.VALID,""));k.flashNodes(f,!1);f=b.lookupFormat("nodeParseMultiple",[f.length]);return d.resolve(new c(void 0,a,e.ERROR,f))};h.prototype.name="node";
f.prototype=Object.create(a.prototype);f.prototype.getBlank=function(){return new c(j._empty,new i,e.VALID)};f.prototype.stringify=function(a){return a==null?"":a.__gcliQuery||"Error"};f.prototype.parse=function(a){if(a.text==="")return d.resolve(new c(void 0,a,e.INCOMPLETE));var f;try{f=m.querySelectorAll(a.text)}catch(i){return d.resolve(new c(void 0,a,e.ERROR,b.lookup("nodeParseSyntax")))}if(f.length===0&&!this.allowEmpty)return d.resolve(new c(void 0,a,e.INCOMPLETE,b.lookup("nodeParseNone")));
k.flashNodes(f,!1);return d.resolve(new c(f,a,e.VALID,""))};f.prototype.name="nodelist"});
define("gcli/types/resource","require,exports,module,util/promise,gcli/types,gcli/types/selection".split(","),function(l,j){function h(a,b,c,e){this.name=a;this.type=b;this.inline=c;this.element=e}function f(a){this.name=a.href;if(!this.name)this.name=a.ownerNode.id?"css#"+a.ownerNode.id:"inline-css";this.inline=a.href==null;this.type=h.TYPE_CSS;this.element=a}function d(a){this.name=a.src;if(!this.name)this.name=a.id?"script#"+a.id:"inline-script";this.inline=a.src===""||a.src==null;this.type=h.TYPE_SCRIPT;
this.element=a}function k(a,b){var c={};a.forEach(function(a){c[a.name]==null&&(c[a.name]=[]);c[a.name].push(a)});Object.keys(c).forEach(function(a){a=c[a];a.length>1&&b(a)})}function b(a){this.include=a.include;if(this.include!==h.TYPE_SCRIPT&&this.include!==h.TYPE_CSS&&this.include!=null)throw Error("invalid include property: "+this.include);}var g=l("util/promise"),a=l("gcli/types"),e=l("gcli/types/selection").SelectionType;j.startup=function(){a.registerType(b)};j.shutdown=function(){a.unregisterType(b);
j.clearResourceCache()};j.clearResourceCache=function(){i.clear()};var c=void 0;typeof document!=="undefined"&&(c=document);j.setDocument=function(a){c=a};j.unsetDocument=function(){i.clear();c=void 0};j.getDocument=function(){return c};h.prototype.getContents=function(){throw Error("not implemented");};h.TYPE_SCRIPT="text/javascript";h.TYPE_CSS="text/css";f.prototype=Object.create(h.prototype);f.prototype.loadContents=function(a){a(this.element.ownerNode.innerHTML)};f._getAllStyles=function(){var a=
[];if(c==null)return a;Array.prototype.forEach.call(c.styleSheets,function(b){f._getStyle(b,a)});k(a,function(a){for(var b=0;b<a.length;b++)a[b].name=a[b].name+"-"+b});return a};f._getStyle=function(a,b){var c=i.get(a);c||(c=new f(a),i.add(a,c));b.push(c);try{Array.prototype.forEach.call(a.cssRules,function(a){a.type==CSSRule.IMPORT_RULE&&a.styleSheet&&f._getStyle(a.styleSheet,b)},this)}catch(e){}};d.prototype=Object.create(h.prototype);d.prototype.loadContents=function(a){if(this.inline)a(this.element.innerHTML);
else{var b=new XMLHttpRequest;b.onreadystatechange=function(){b.readyState===b.DONE&&a(b.responseText)};b.open("GET",this.element.src,!0);b.send()}};d._getAllScripts=function(){if(c==null)return[];var a=c.querySelectorAll("script"),a=Array.prototype.map.call(a,function(a){var b=i.get(a);b||(b=new d(a),i.add(a,b));return b});k(a,function(a){for(var b=0;b<a.length;b++)a[b].name=a[b].name+"-"+b});return a};b.prototype=Object.create(e.prototype);b.prototype.getLookup=function(){var a=[];this.include!==
h.TYPE_SCRIPT&&Array.prototype.push.apply(a,f._getAllStyles());this.include!==h.TYPE_CSS&&Array.prototype.push.apply(a,d._getAllScripts());return g.resolve(a.map(function(a){return{name:a.name,value:a}}))};b.prototype.name="resource";var i={_cached:[],get:function(a){for(var b=0;b<i._cached.length;b++)if(i._cached[b].node===a)return i._cached[b].resource;return null},add:function(a,b){i._cached.push({node:a,resource:b})},clear:function(){i._cached=[]}}});
define("gcli/settings",["require","exports","module","util/util","gcli/types"],function(l,j){function h(){}function f(a,b,f,g){this.name=a;this.type=b;this.description=f;this._defaultValue=g;this.onChange=d.createEvent("Setting.onChange");this.setDefault()}var d=l("util/util"),k=l("gcli/types"),b={},g={},a;j.setDefaults=function(a){Object.keys(a).forEach(function(b){g[b]===void 0&&(g[b]=a[b])})};j.startup=function(){a=new h;a.load(g)};j.shutdown=function(){};j.getAll=function(a){var c=[];Object.keys(b).forEach(function(d){(a==
null||d.indexOf(a)!==-1)&&c.push(b[d])}.bind(this));c.sort(function(a,b){return a.name.localeCompare(b.name)}.bind(this));return c};j.addSetting=function(a){var c=k.getType(a.type),a=new f(a.name,c,a.description,a.defaultValue);b[a.name]=a;j.onChange({added:a.name});return a};j.getSetting=function(a){return b[a]};j.removeSetting=function(a){a=typeof nameOrPrefSpec==="string"?a:a.name;delete b[a];j.onChange({removed:a})};j.onChange=d.createEvent("Settings.onChange");h.prototype.load=function(a){if(typeof localStorage!==
"undefined"){var b=localStorage.getItem("gcli-settings");if(b!=null){var d=JSON.parse(b);Object.keys(d).forEach(function(b){a[b]=d[b]})}}};h.prototype.save=function(a){typeof localStorage!=="undefined"&&(a=JSON.stringify(a),localStorage.setItem("gcli-settings",a))};j.LocalSettingStorage=h;f.prototype.setDefault=function(){this.value=this._defaultValue};Object.defineProperty(f.prototype,"value",{get:function(){return g[this.name]},set:function(b){g[this.name]=b;a.save(g);this.onChange({setting:this,
value:b})},enumerable:!0})});
define("gcli/types/setting","require,exports,module,gcli/settings,gcli/types,gcli/types/selection,gcli/types/basic".split(","),function(l,j){function h(){d.onChange.add(function(){this.clearCache()},this)}function f(){}var d=l("gcli/settings"),k=l("gcli/types"),b=l("gcli/types/selection").SelectionType,g=l("gcli/types/basic").DelegateType;j.startup=function(){k.registerType(h);k.registerType(f)};j.shutdown=function(){k.unregisterType(h);k.unregisterType(f)};var a=null;h.prototype=new b({cacheable:!0});
h.prototype.lookup=function(){return d.getAll().map(function(a){return{name:a.name,value:a}})};h.prototype.noMatch=function(){a=null};h.prototype.stringify=function(e){a=e;return b.prototype.stringify.call(this,e)};h.prototype.parse=function(e){e=b.prototype.parse.call(this,e);e.then(function(b){a=b.value});return e};h.prototype.name="setting";f.prototype=Object.create(g.prototype);f.prototype.delegateType=function(){return a!=null?a.type:k.getType("blank")};f.prototype.name="settingValue"});
define("util/domtemplate",["require","exports","module"],function(l,j){function h(d,h,b){b=new f(b||{});b.processNode(d,h);return b}function f(d){d==null&&(d={allowEval:!0});this.options=d;this.stack=d.stack&&Array.isArray(d.stack)?d.stack:typeof d.stack==="string"?[d.stack]:[];this.nodes=[]}f.prototype._templateRegion=/\$\{([^}]*)\}/g;f.prototype._splitSpecial=/\uF001|\uF002/;f.prototype._isPropertyScript=/^[_a-zA-Z0-9.]*$/;f.prototype.processNode=function(d,f){typeof d==="string"&&(d=document.getElementById(d));
f==null&&(f={});this.stack.push(d.nodeName+(d.id?"#"+d.id:""));var b=!1;try{if(d.attributes&&d.attributes.length){if(d.hasAttribute("foreach")){this._processForEach(d,f);return}if(d.hasAttribute("if")&&!this._processIf(d,f))return;this.nodes.push(f.__element);f.__element=d;for(var b=!0,g=Array.prototype.slice.call(d.attributes),a=0;a<g.length;a++){var e=g[a].value,c=g[a].name;this.stack.push(c);try{if(c==="save")e=this._stripBraces(e),this._property(e,f,d),d.removeAttribute("save");else if(c.substring(0,
2)==="on")if(e.substring(0,2)==="${"&&e.slice(-1)==="}"&&e.indexOf("${",2)===-1){var e=this._stripBraces(e),i=this._property(e,f);if(typeof i==="function"){d.removeAttribute(c);var h=d.hasAttribute("capture"+c.substring(2));d.addEventListener(c.substring(2),i,h);h&&d.removeAttribute("capture"+c.substring(2))}else d.setAttribute(c,i)}else d.setAttribute(c,this._processString(e,f));else{d.removeAttribute(c);c.charAt(0)==="_"&&(c=c.substring(1));var j;e.indexOf("${")===0&&e.charAt(e.length-1)==="}"?
(j=this._envEval(e.slice(2,-1),f,e))&&typeof j.then==="function"?(d.setAttribute(c,""),j.then(function(a){d.setAttribute(c,a)}.bind(this)).then(null,console.error)):(this.options.blankNullUndefined&&j==null&&(j=""),d.setAttribute(c,j)):d.setAttribute(c,this._processString(e,f))}}finally{this.stack.pop()}}}for(var l=Array.prototype.slice.call(d.childNodes),g=0;g<l.length;g++)this.processNode(l[g],f);d.nodeType===3&&this._processTextNode(d,f)}finally{if(b)f.__element=this.nodes.pop();this.stack.pop()}};
f.prototype._processString=function(d,f){return d.replace(this._templateRegion,function(b){b=this._envEval(b.slice(2,-1),f,d);return this.options.blankNullUndefined&&b==null?"":b}.bind(this))};f.prototype._processIf=function(d,f){this.stack.push("if");try{var b=d.getAttribute("if"),g=this._stripBraces(b),a=!0;try{a=!!this._envEval(g,f,b)}catch(e){this._handleError("Error with '"+g+"'",e),a=!1}a||d.parentNode.removeChild(d);d.removeAttribute("if");return a}finally{this.stack.pop()}};f.prototype._processForEach=
function(d,f){this.stack.push("foreach");try{var b=d.getAttribute("foreach"),g=b,a="param";if(g.charAt(0)==="$")g=this._stripBraces(g);else var e=g.split(" in "),a=e[0].trim(),g=this._stripBraces(e[1].trim());d.removeAttribute("foreach");try{this._handleAsync(this._envEval(g,f,b),d,function(b,c){this._processForEachLoop(b,d,c,f,a)}.bind(this)),d.parentNode.removeChild(d)}catch(c){this._handleError("Error with '"+g+"'",c)}}finally{this.stack.pop()}};f.prototype._processForEachLoop=function(d,f,b,g,
a){if(Array.isArray(d))d.forEach(function(c,e){this._processForEachMember(c,f,b,g,a,""+e)},this);else for(var e in d)d.hasOwnProperty(e)&&this._processForEachMember(e,f,b,g,a,e)};f.prototype._processForEachMember=function(d,f,b,g,a,e){this.stack.push(e);try{this._handleAsync(d,b,function(b,e){g[a]=b;if(e.parentNode!=null)if(f.nodeName.toLowerCase()==="loop")for(var d=0;d<f.childNodes.length;d++){var h=f.childNodes[d].cloneNode(!0);e.parentNode.insertBefore(h,e);this.processNode(h,g)}else h=f.cloneNode(!0),
h.removeAttribute("foreach"),e.parentNode.insertBefore(h,e),this.processNode(h,g);delete g[a]}.bind(this))}finally{this.stack.pop()}};f.prototype._processTextNode=function(d,f){var b=d.data,b=b.replace(this._templateRegion,"\uf001$$$1\uf002"),b=b.split(this._splitSpecial);b.length>1&&(b.forEach(function(b){b===null||b===void 0||b===""||(b.charAt(0)==="$"&&(b=this._envEval(b.slice(1),f,d.data)),this._handleAsync(b,d,function(a,b){var c=b.ownerDocument;a==null&&(a=this.options.blankNullUndefined?"":
""+a);typeof a.cloneNode==="function"?(a=this._maybeImportNode(a,c),b.parentNode.insertBefore(a,b)):typeof a.item==="function"&&a.length?Array.prototype.slice.call(a,0).forEach(function(a){a=this._maybeImportNode(a,c);b.parentNode.insertBefore(a,b)}.bind(this)):(a=c.createTextNode(a.toString()),b.parentNode.insertBefore(a,b))}.bind(this)))},this),d.parentNode.removeChild(d))};f.prototype._maybeImportNode=function(d,f){return d.ownerDocument===f?d:f.importNode(d,!0)};f.prototype._handleAsync=function(d,
f,b){if(d!=null&&typeof d.then==="function"){var g=f.ownerDocument.createElement("span");f.parentNode.insertBefore(g,f);d.then(function(a){b(a,g);g.parentNode!=null&&g.parentNode.removeChild(g)}.bind(this)).then(null,function(a){console.error(a.stack)})}else b(d,f)};f.prototype._stripBraces=function(d){return!d.match(this._templateRegion)?(this._handleError("Expected "+d+" to match ${...}"),d):d.slice(2,-1)};f.prototype._property=function(d,f,b){try{typeof d==="string"&&(d=d.split("."));var g=f[d[0]];
if(d.length===1)return b!==void 0&&(f[d[0]]=b),typeof g==="function"?g.bind(f):g;return!g?(this._handleError('"'+d[0]+'" is undefined'),null):this._property(d.slice(1),g,b)}catch(a){return this._handleError("Path error with '"+d+"'",a),"${"+d+"}"}};f.prototype._envEval=function(d,f,b){try{if(this.stack.push(b.replace(/\s+/g," ")),this._isPropertyScript.test(d))return this._property(d,f);else{if(!this.options.allowEval)return this._handleError("allowEval is not set, however '"+d+"' can not be resolved using a simple property path."),
"${"+d+"}";with(f)return eval(d)}}catch(g){return this._handleError("Template error evaluating '"+d+"'",g),"${"+d+"}"}finally{this.stack.pop()}};f.prototype._handleError=function(d,f){this._logError(d+" (In: "+this.stack.join(" > ")+")");f&&this._logError(f)};f.prototype._logError=function(d){console.log(d)};if(typeof j!=="undefined")j.template=h});
define("gcli/ui/view",["require","exports","module","util/util","util/domtemplate"],function(l,j){var h=l("util/util"),f=l("util/domtemplate");j.createView=function(d){if(d.html==null)throw Error("options.html is missing");return{isView:!0,appendTo:function(d,b){b===!0&&h.clearElement(d);d.appendChild(this.toDom(d.ownerDocument))},toDom:function(k){d.css&&h.importCss(d.css,k,d.cssId);k=h.toDom(k,d.html);f.template(k,d.data||{},d.options||{});return k}}}});
define("gcli/cli","require,exports,module,util/promise,util/util,util/l10n,gcli/ui/view,gcli/canon,gcli/canon,gcli/types,gcli/types,gcli/types/basic,gcli/types/basic,gcli/types/basic,gcli/types/basic,gcli/argument,gcli/argument,gcli/argument,gcli/argument,gcli/argument,gcli/argument".split(","),function(l,j){function h(a,b){this.param=a;this.conversion=void 0;this.paramIndex=b;this.onAssignmentChange=e.createEvent("Assignment.onAssignmentChange")}function f(){var a={name:"__command",type:"command"},
b=this;Object.defineProperty(a,"description",{get:function(){var a=b.value;return a&&a.description?a.description:"The command to execute"},enumerable:!0});this.param=new m.Parameter(a);this.paramIndex=-1;this.onAssignmentChange=e.createEvent("CommandAssignment.onAssignmentChange")}function d(a,b){this.param=new m.Parameter({name:"__unassigned",description:c.lookup("cliOptions"),type:{name:"param",requisition:a,isIncompleteName:b.text.charAt(0)==="-"}});this.paramIndex=-1;this.onAssignmentChange=e.createEvent("UnassignedAssignment.onAssignmentChange");
this.conversion=e.synchronize(this.param.type.parse(b));this.conversion.assign(this)}function k(a,b,c){this.environment=a;this.document=b;if(this.document==null)try{this.document=document}catch(d){}this.commandOutputManager=c||new o;this.commandAssignment=new f;a=this.setAssignment(this.commandAssignment,null,{skipArgUpdate:!0});e.synchronize(a);this._assignments={};this.assignmentCount=0;this._args=[];this._unassigned=[];this._structuralChangeInProgress=!1;this.commandAssignment.onAssignmentChange.add(this._commandAssignmentChanged,
this);this.commandAssignment.onAssignmentChange.add(this._assignmentChanged,this);this.onAssignmentChange=e.createEvent("Requisition.onAssignmentChange");this.onTextChange=e.createEvent("Requisition.onTextChange")}function b(a){for(var b=0;b<a.length;b++){var c=a.charAt(b);if(c===" "||c==='"'||c==="'"||c==="{"||c==="}"||c==="\\")return!1}return!0}function g(b){b=b||{};this.command=b.command||"";this.args=b.args||{};this.typed=b.typed||"";this.canonical=b.canonical||"";this.hidden=b.hidden===!0?!0:
!1;this.data=void 0;this.error=this.completed=!1;this.start=new Date;this.deferred=a.defer();this.then=this.deferred.promise.then;this.onClose=e.createEvent("Output.onClose");this.onChange=e.createEvent("Output.onChange")}var a=l("util/promise"),e=l("util/util"),c=l("util/l10n"),i=l("gcli/ui/view"),m=l("gcli/canon"),o=l("gcli/canon").CommandOutputManager,n=l("gcli/types").Status,p=l("gcli/types").Conversion,t=l("gcli/types/basic").ArrayType,u=l("gcli/types/basic").StringType,v=l("gcli/types/basic").BooleanType,
r=l("gcli/types/basic").NumberType,q=l("gcli/argument").Argument,y=l("gcli/argument").ArrayArgument,z=l("gcli/argument").NamedArgument,B=l("gcli/argument").TrueNamedArgument,D=l("gcli/argument").MergedArgument,H=l("gcli/argument").ScriptArgument,C;j.startup=function(){C=m.addCommand(A)};j.shutdown=function(){m.removeCommand(A.name);C=void 0};Object.defineProperty(h.prototype,"arg",{get:function(){return this.conversion.arg},enumerable:!0});Object.defineProperty(h.prototype,"value",{get:function(){return this.conversion.value},
enumerable:!0});h.prototype.getMessage=function(){return this.conversion.message?this.conversion.message:""};h.prototype.getPredictions=function(){return this.conversion.getPredictions()};h.prototype.getPredictionAt=function(b){b==null&&(b=0);return this.isInName()?a.resolve(void 0):this.getPredictions().then(function(a){if(a.length!==0)return b%=a.length,b<0&&(b=a.length+b),a[b]}.bind(this),console.error)};h.prototype.isInName=function(){return this.conversion.arg.type==="NamedArgument"&&this.conversion.arg.prefix.slice(-1)!==
" "};h.prototype.ensureVisibleArgument=function(){if(this.conversion.arg.type!=="BlankArgument")return!1;var a=this.conversion.arg.beget({text:"",prefixSpace:this.param instanceof f});this.conversion=e.synchronize(this.param.type.parse(a));this.conversion.assign(this);return!0};h.prototype.getStatus=function(a){return this.param.isDataRequired&&!this.conversion.isDataProvided()?n.INCOMPLETE:!this.param.isDataRequired&&this.arg.type==="BlankArgument"?n.VALID:this.conversion.getStatus(a)};h.prototype.toString=
function(){return this.conversion.toString()};Object.defineProperty(h.prototype,"_summaryJson",{get:function(){var a="<async>";this.getPredictions().then(function(b){a=b.length},console.log);return{param:this.param.name+"/"+this.param.type.name,defaultValue:this.param.defaultValue,arg:this.conversion.arg._summaryJson,value:this.value,message:this.getMessage(),status:this.getStatus().toString(),predictionCount:a}},enumerable:!0});j.Assignment=h;var s=eval;j.setEvalFunction=function(a){s=a};j.unsetEvalFunction=
function(){s=void 0};var A={name:"{",params:[{name:"javascript",type:"javascript",description:""}],hidden:!0,returnType:"object",description:{key:"cliEvalJavascript"},exec:function(a){return s(a.javascript)},evalRegexp:/^\s*{\s*/};f.prototype=Object.create(h.prototype);f.prototype.getStatus=function(a){return n.combine(h.prototype.getStatus.call(this,a),this.conversion.value&&this.conversion.value.exec?n.VALID:n.INCOMPLETE)};j.CommandAssignment=f;d.prototype=Object.create(h.prototype);d.prototype.getStatus=
function(){return this.conversion.getStatus()};k.prototype.destroy=function(){this.commandAssignment.onAssignmentChange.remove(this._commandAssignmentChanged,this);this.commandAssignment.onAssignmentChange.remove(this._assignmentChanged,this);delete this.document;delete this.environment};k.prototype._assignmentChanged=function(a){if(!(a.oldConversion!=null&&a.conversion.valueEquals(a.oldConversion))&&!this._structuralChangeInProgress&&(this.onAssignmentChange(a),!a.conversion.argEquals(a.oldConversion)))this.onTextChange()};
k.prototype._commandAssignmentChanged=function(a){if(!a.conversion.valueEquals(a.oldConversion)){this._assignments={};if(a=this.commandAssignment.value)for(var b=0;b<a.params.length;b++){var c=a.params[b],d=new h(c,b),f=this.setAssignment(d,null,{skipArgUpdate:!0});e.synchronize(f);d.onAssignmentChange.add(this._assignmentChanged,this);this._assignments[c.name]=d}this.assignmentCount=Object.keys(this._assignments).length}};k.prototype.getAssignment=function(a){return this._assignments[typeof a===
"string"?a:Object.keys(this._assignments)[a]]||void 0};k.prototype._getFirstBlankPositionalAssignment=function(){var a=null;Object.keys(this._assignments).some(function(b){b=this.getAssignment(b);return b.arg.type==="BlankArgument"&&b.param.isPositionalAllowed?(a=b,!0):!1},this);return a};k.prototype.getParameterNames=function(){return Object.keys(this._assignments)};k.prototype.cloneAssignments=function(){return Object.keys(this._assignments).map(function(a){return this._assignments[a]},this)};k.prototype.getStatus=
function(){var a=n.VALID;if(this._unassigned.length!==0){var b=!0;this._unassigned.forEach(function(a){a.param.type.isIncompleteName||(b=!1)});a=b?n.INCOMPLETE:n.ERROR}this.getAssignments(!0).forEach(function(b){b=b.getStatus();b>a&&(a=b)},this);if(a===n.INCOMPLETE)a=n.ERROR;return a};k.prototype.getArgsObject=function(){var a={};this.getAssignments().forEach(function(b){a[b.param.name]=b.conversion.isDataProvided()?b.value:b.param.defaultValue},this);return a};k.prototype.getAssignments=function(a){var b=
[];a===!0&&b.push(this.commandAssignment);Object.keys(this._assignments).forEach(function(a){b.push(this.getAssignment(a))},this);return b};k.prototype.setAssignment=function(b,c,e){function d(a){var c=b.conversion;b.conversion=a;b.conversion.assign(b);if(!b.conversion.equals(c))b.onAssignmentChange({assignment:b,conversion:b.conversion,oldConversion:c})}e=e||{};if(e.skipArgUpdate!==!0)for(var f=b.arg.getArgs(),i=c.getArgs(),g=Math.max(f.length,i.length),h=0;h<g;h++)if(h>=f.length||f[h].type==="BlankArgument")this._args.push(i[h]);
else{var k=this._args.indexOf(f[h]);if(k===-1)throw console.error("Couldn't find ",f[h]," in ",this._args),Error("Couldn't find "+f[h]);if(h>=i.length)this._args.splice(k,1);else{if(e.matchPadding){if(i[h].prefix.length===0&&this._args[k].prefix.length!==0)i[h].prefix=this._args[k].prefix;if(i[h].suffix.length===0&&this._args[k].suffix.length!==0)i[h].suffix=this._args[k].suffix}this._args[k]=i[h]}}if(c==null)d(b.param.type.getBlank());else if(typeof c.getStatus==="function")d(c);else return b.param.type.parse(c).then(function(a){d(a)}.bind(this),
console.error);return a.resolve(void 0)};k.prototype.setBlankArguments=function(){this.getAssignments().forEach(function(a){a=this.setAssignment(a,null,{skipArgUpdate:!0});e.synchronize(a)},this)};k.prototype.complete=function(a,b){var c=this.getAssignmentAt(a.start);return c.getPredictionAt(b).then(function(a){var b=[];this.onTextChange.holdFire();if(a==null)c.arg.suffix.slice(-1)!==" "&&c.getStatus()===n.VALID&&b.push(this._addSpace(c)),c.isInName()&&(a=c.conversion.arg.beget({prefixPostSpace:!0}),
a=this.setAssignment(c,a),b.push(a));else{var f=c.arg.beget({text:a.name,dontQuote:c===this.commandAssignment}),f=this.setAssignment(c,f);a.incomplete||(f=f.then(function(){return this._addSpace(c).then(function(){if(c instanceof d)return this.update(this.toString())}.bind(this))}.bind(this)));b.push(f)}return e.all(b).then(function(){this.onTextChange();this.onTextChange.resumeFire()}.bind(this))}.bind(this))};k.prototype._assertArgsAssigned=function(){this._args.forEach(function(a){a.assignment==
null&&console.log("No assignment for "+a)},this)};k.prototype._addSpace=function(b){var c=b.conversion.arg.beget({suffixSpace:!0});return c!==b.conversion.arg?this.setAssignment(b,c):a.resolve(void 0)};k.prototype.decrement=function(a){var b=a.param.type.decrement(a.conversion.value);b!=null&&(b=a.param.type.stringify(b),b=a.conversion.arg.beget({text:b}),a=this.setAssignment(a,b),e.synchronize(a))};k.prototype.increment=function(a){var b=a.param.type.increment(a.conversion.value);b!=null&&(b=a.param.type.stringify(b),
b=a.conversion.arg.beget({text:b}),a=this.setAssignment(a,b),e.synchronize(a))};k.prototype.toCanonicalString=function(){var a=[],b=this.commandAssignment.value?this.commandAssignment.value.name:this.commandAssignment.arg.text;a.push(b);Object.keys(this._assignments).forEach(function(b){var b=this._assignments[b],c=b.param.type;b.value!==b.param.defaultValue&&(a.push(" "),a.push(c.stringify(b.value)))},this);b==="{"&&this.getAssignment(0).arg.suffix.indexOf("}")===-1&&a.push(" }");return a.join("")};
k.prototype.createInputArgTrace=function(){if(!this._args)throw Error("createInputMap requires a command line. See source.");var a=[],b;this._args.forEach(function(c){for(b=0;b<c.prefix.length;b++)a.push({arg:c,character:c.prefix[b],part:"prefix"});for(b=0;b<c.text.length;b++)a.push({arg:c,character:c.text[b],part:"text"});for(b=0;b<c.suffix.length;b++)a.push({arg:c,character:c.suffix[b],part:"suffix"})});return a};k.prototype.toString=function(){return this._args?this._args.map(function(a){return a.toString()}).join(""):
this.toCanonicalString()};k.prototype.typedEndsWithSeparator=function(){if(this._args){var a=this._args.slice(-1)[0];return a.suffix.slice(-1)===" "?!0:a.text===""&&a.suffix===""&&a.prefix.slice(-1)===" "}return this.toCanonicalString().slice(-1)===" "};k.prototype.getInputStatusMarkup=function(a){for(var b=this.createInputArgTrace(),a=b[a===0?0:a-1],c=[],e=0;e<b.length;e++){var d=b[e],i=d.arg,g=n.VALID;if(d.part==="text"&&(g=i.assignment.getStatus(i),g===n.INCOMPLETE)){var h=a.arg.assignment.arg.type===
"NamedArgument",h=a.part==="text"||h&&a.part==="suffix";if((i.assignment!==a.arg.assignment||!h)&&!(i.assignment instanceof f))g=n.ERROR}c.push({status:g,string:d.character})}for(e=0;e<c.length-1;)c[e].status===c[e+1].status?(c[e].string+=c[e+1].string,c.splice(e+1,1)):e++;return c};k.prototype.getAssignmentAt=function(a){if(!this._args)throw console.trace(),Error("Missing args");if(a===0)return this.commandAssignment;var b=[],c,e;for(c=0;c<this._args.length;c++){var d=this._args[c],f=d.assignment;
for(e=0;e<d.prefix.length;e++)b.push(f);for(e=0;e<d.text.length;e++)b.push(f);if(d.assignment.arg.type!=="NamedArgument")this._args.length>c+1?f=this._args[c+1].assignment:(e=this._getFirstBlankPositionalAssignment(),e!=null&&(f=e));for(e=0;e<d.suffix.length;e++)b.push(f)}b=b[a-1];if(!b)throw Error("Missing assignment. cursor="+a+" text="+this.toString());return b};k.prototype.exec=function(a){var b=null,c=null,e=!1;a&&a.hidden&&(e=!0);if(a)if(typeof input==="string")this.update(a);else if(typeof a.typed===
"string")this.update(a.typed);else if(a.command!=null)(b=m.getCommand(a.command))||console.error("Command not found: "+a.command),c=a.args;if(!b)b=this.commandAssignment.value,c=this.getArgsObject();if(!b)throw Error("Unknown command");a=this.toString();A.evalRegexp.test(a)&&(a=a.replace(A.evalRegexp,""),a=a.replace(/\s*}\s*$/,""));var d=new g({command:b,args:c,typed:a,canonical:this.toCanonicalString(),hidden:e});this.commandOutputManager.onOutput({output:d});var e=function(a){d.complete(a,!1)},
a=function(a){d.complete(a,!0)},f=function(a){d.changed(a)};try{var i=j.createExecutionContext(this);this._then(b.exec(c,i),e,a,f)}catch(h){console.error(h),a(h)}this.clear();return d};k.prototype.updateExec=function(a,b){return this.update(a).then(function(){return this.exec(b)}.bind(this))};k.prototype.clear=function(){this._structuralChangeInProgress=!0;var a=new q("","","");this._args=[a];this.setAssignment(this.commandAssignment,e.synchronize(this.commandAssignment.param.type.parse(a)),{skipArgUpdate:!0});
this._structuralChangeInProgress=!1;this.onTextChange()};k.prototype._then=function(a,b,c,e){var d=null;if(a!=null&&typeof a.then==="function")d=a.then;else if(a!=null&&a.promise!=null&&typeof a.promise.then==="function")d=a.promise.then;d!=null?d(b,c,e):b(a)};k.prototype.update=function(a){this._structuralChangeInProgress=!0;this._args=this._tokenize(a);var b=this._args.slice(0);return this._split(b).then(function(){return this._assign(b).then(function(){this._structuralChangeInProgress=!1;this.onTextChange()}.bind(this))}.bind(this))};
Object.defineProperty(k.prototype,"_summaryJson",{get:function(){var a={$args:this._args.map(function(a){return a._summaryJson}),_command:this.commandAssignment._summaryJson,_unassigned:this._unassigned.forEach(function(a){return a._summaryJson})};Object.keys(this._assignments).forEach(function(b){a[b]=this.getAssignment(b)._summaryJson}.bind(this));return a},enumerable:!0});k.prototype._tokenize=function(a){function c(a){return a.replace(/\uF000/g," ").replace(/\uF001/g,"'").replace(/\uF002/g,'"').replace(/\uF003/g,
"{").replace(/\uF004/g,"}")}if(a==null||a.length===0)return[new q("","","")];if(b(a))return[new q(a,"","")];for(var e=1,a=a.replace(/\\\\/g,"\\").replace(/\\b/g,"\u0008").replace(/\\f/g,"\u000c").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\u000b").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\ /g,"\uf000").replace(/\\'/g,"\uf001").replace(/\\"/g,"\uf002").replace(/\\{/g,"\uf003").replace(/\\}/g,"\uf004"),d=0,f=0,i="",g=[],h=0;;){var k=a[d];switch(e){case 1:k===
"'"?(i=a.substring(f,d+1),e=3,f=d+1):k==='"'?(i=a.substring(f,d+1),e=4,f=d+1):k==="{"?(i=a.substring(f,d+1),e=5,h++,f=d+1):/ /.test(k)||(i=a.substring(f,d),e=2,f=d);break;case 2:k===" "&&(e=c(a.substring(f,d)),g.push(new q(e,i,"")),e=1,f=d,i="");break;case 3:k==="'"&&(e=c(a.substring(f,d)),g.push(new q(e,i,k)),e=1,f=d+1,i="");break;case 4:k==='"'&&(e=c(a.substring(f,d)),g.push(new q(e,i,k)),e=1,f=d+1,i="");break;case 5:k==="{"?h++:k==="}"&&(h--,h===0&&(e=c(a.substring(f,d)),g.push(new H(e,i,k)),e=
1,f=d+1,i=""))}d++;if(d>=a.length){e===1?d!==f&&(a=a.substring(f,d),(d=g[g.length-1])?d.suffix+=a:g.push(new q("",a,""))):e===5?(e=c(a.substring(f,d+1)),g.push(new H(e,i,""))):(e=c(a.substring(f,d+1)),g.push(new q(e,i,"")));break}}return g};k.prototype._split=function(a){var b={skipArgUpdate:!0},c=void 0;if(a[0].type==="ScriptArgument")return c=new p(C,new H),this.setAssignment(this.commandAssignment,c,b);for(var d=1,f=this.commandAssignment.param.type;d<=a.length;){c=d===1?a[0]:new D(a,0,d);c=e.synchronize(f.parse(c));
if(!c.value||c.value.exec)break;d++}for(f=0;f<d;f++)a.shift();return this.setAssignment(this.commandAssignment,c,b)};k.prototype._addUnassignedArgs=function(a){a.forEach(function(a){this._unassigned.push(new d(this,a))}.bind(this))};k.prototype._assign=function(a){var b={skipArgUpdate:!0};this._unassigned=[];var c=[];if(!this.commandAssignment.value)return this._addUnassignedArgs(a),e.all(c);if(a.length===0)return this.setBlankArguments(),e.all(c);if(this.assignmentCount===0)return this._addUnassignedArgs(a),
e.all(c);if(this.assignmentCount===1){var f=this.getAssignment(0);if(f.param.type instanceof u){var i=a.length===1?a[0]:new D(a);c.push(this.setAssignment(f,i,b));return e.all(c)}}var g=this.getParameterNames(),h={};this.getAssignments(!1).forEach(function(e){for(var d=0;d<a.length;)if(e.param.isKnownAs(a[d].text)){var f=a.splice(d,1)[0];g=g.filter(function(a){return a!==e.param.name});if(e.param.type instanceof v)f=new B(f);else{var i=null;d+1<=a.length&&(i=a.splice(d,1)[0]);f=new z(f,i)}e.param.type instanceof
t?(i=h[e.param.name],i||(i=new y,h[e.param.name]=i),i.addArgument(f)):c.push(this.setAssignment(e,f,b))}else d++},this);g.forEach(function(e){e=this.getAssignment(e);if(e.param.isPositionalAllowed)if(e.param.type instanceof t){var f=h[e.param.name];f||(f=new y,h[e.param.name]=f);f.addArguments(a);a=[]}else a.length===0?c.push(this.setAssignment(e,null,b)):(f=a.splice(0,1)[0],(e.param.type instanceof r?/-[-a-zA-Z_]/.test(f.text):f.text.charAt(0)==="-")?this._unassigned.push(new d(this,f)):c.push(this.setAssignment(e,
f,b)));else c.push(this.setAssignment(e,null,b))},this);Object.keys(h).forEach(function(a){var e=this.getAssignment(a);c.push(this.setAssignment(e,h[a],b))},this);this._addUnassignedArgs(a);return e.all(c)};j.Requisition=k;g.prototype.changed=function(a,b){this.data=a;b=b||{};b.output=this;this.onChange(b)};g.prototype.complete=function(a,b,c){this.end=new Date;this.duration=this.end.getTime()-this.start.getTime();this.completed=!0;this.error=b;this.changed(a,c);b?this.deferred.reject():this.deferred.resolve()};
g.prototype.toDom=function(a){e.clearElement(a);var b=a.ownerDocument,c=this.data;if(c!=null){var d;typeof HTMLElement!=="undefined"&&c instanceof HTMLElement?d=c:c.isView?d=c.toDom(b):(this.command.returnType==="terminal"?Array.isArray(c)?(d=e.createElement(b,"div"),c.forEach(function(){var a=e.createElement(b,"textarea");a.classList.add("gcli-row-subterminal");a.readOnly=!0;d.appendChild(a)})):(d=e.createElement(b,"textarea"),d.classList.add("gcli-row-terminal"),d.readOnly=!0):d=e.createElement(b,
"p"),this.command.returnType==="string"?d.textContent=c:e.setContents(d,c.toString()));for(var c=d.querySelectorAll("*[href]"),f=0;f<c.length;f++)c[f].setAttribute("target","_blank");a.appendChild(d)}};g.prototype.toString=function(a){return this.data.isView?this.data.toDom(a).textContent:typeof HTMLElement!=="undefined"&&this.data instanceof HTMLElement?this.data.textContent:this.data==null?"":this.data.toString()};j.Output=g;j.createExecutionContext=function(b){return{exec:b.exec.bind(b),update:b.update.bind(b),
updateExec:b.updateExec.bind(b),document:b.document,environment:b.environment,createView:i.createView,defer:function(){return a.defer()},createPromise:function(){return a.defer()}}}});define("text!gcli/ui/intro.html",[],function(){return'\n<div>\n  <p>${l10n.introTextOpening2}</p>\n\n  <p>\n    ${l10n.introTextCommands}\n    <span class="gcli-out-shortcut" onclick="${onclick}"\n        ondblclick="${ondblclick}" data-command="help">help</span>${l10n.introTextKeys2}\n    <code>${l10n.introTextF1Escape}</code>.\n  </p>\n\n  <button onclick="${onGotIt}" if="${showHideButton}">${l10n.introTextGo}</button>\n</div>'});
define("gcli/ui/intro","require,exports,module,util/util,util/l10n,gcli/settings,gcli/ui/view,gcli/cli,text!gcli/ui/intro.html".split(","),function(l,j){var h=l("util/util"),f=l("util/l10n"),d=l("gcli/settings"),k=l("gcli/ui/view"),b=l("gcli/cli").Output,g={name:"hideIntro",type:"boolean",description:f.lookup("hideIntroDesc"),defaultValue:!1},a;j.startup=function(){a=d.addSetting(g)};j.shutdown=function(){d.removeSetting(g);a=void 0};j.maybeShowIntro=function(e,c){if(!a.value){var d=new b;e.onOutput({output:d});
var f=this.createView(c);d.complete(f)}};j.createView=function(b,c){return k.createView({html:l("text!gcli/ui/intro.html"),options:{stack:"intro.html"},data:{l10n:f.propertyLookup,onclick:function(a){h.updateCommand(a.currentTarget,b)},ondblclick:function(a){h.executeCommand(a.currentTarget,b)},showHideButton:c!=null,onGotIt:function(){a.value=!0;c.onClose()}}})}});
define("gcli/ui/focus","require,exports,module,util/util,util/l10n,gcli/settings,gcli/canon".split(","),function(l,j){function h(a,b){a=a||{};this._document=b.document||document;this._requisition=b.requisition;this._debug=a.debug||!1;this._blurDelay=a.blurDelay||150;this._window=this._document.defaultView;this._requisition.commandOutputManager.onOutput.add(this._outputted,this);this._blurDelayTimeout=null;this._monitoredElements=[];this._recentOutput=this._helpRequested=this._hasFocus=this._isError=
!1;this.onVisibilityChange=f.createEvent("FocusManager.onVisibilityChange");this._focused=this._focused.bind(this);this._document.addEventListener("focus",this._focused,!0);g.onChange.add(this._eagerHelperChanged,this);this.isOutputVisible=this.isTooltipVisible=void 0;this._checkShow()}var f=l("util/util"),d=l("util/l10n"),k=l("gcli/settings");l("gcli/canon");var b={name:"eagerHelper",type:{name:"selection",lookup:[{name:"never",value:1},{name:"sometimes",value:2},{name:"always",value:3}]},defaultValue:2,
description:d.lookup("eagerHelperDesc"),ignoreTypeDifference:!0},g;j.startup=function(){g=k.addSetting(b)};j.shutdown=function(){k.removeSetting(b);g=void 0};h.prototype.destroy=function(){g.onChange.remove(this._eagerHelperChanged,this);this._document.removeEventListener("focus",this._focused,!0);this._requisition.commandOutputManager.onOutput.remove(this._outputted,this);for(var a=0;a<this._monitoredElements.length;a++){var b=this._monitoredElements[a];console.error("Hanging monitored element: ",
b.element);b.element.removeEventListener("focus",b.onFocus,!0);b.element.removeEventListener("blur",b.onBlur,!0)}if(this._blurDelayTimeout)this._window.clearTimeout(this._blurDelayTimeout),this._blurDelayTimeout=null;delete this._focused;delete this._document;delete this._window;delete this._requisition};h.prototype.addMonitoredElement=function(a,b){this._debug&&console.log("FocusManager.addMonitoredElement("+(b||"unknown")+")");var c={element:a,where:b,onFocus:function(){this._reportFocus(b)}.bind(this),
onBlur:function(){this._reportBlur(b)}.bind(this)};a.addEventListener("focus",c.onFocus,!0);a.addEventListener("blur",c.onBlur,!0);this._document.activeElement===a&&this._reportFocus(b);this._monitoredElements.push(c)};h.prototype.removeMonitoredElement=function(a,b){this._debug&&console.log("FocusManager.removeMonitoredElement("+(b||"unknown")+")");this._monitoredElements=this._monitoredElements.filter(function(b){return b.element===a?(a.removeEventListener("focus",b.onFocus,!0),a.removeEventListener("blur",
b.onBlur,!0),!1):!0})};h.prototype.updatePosition=function(a){this.onVisibilityChange({tooltipVisible:this.isTooltipVisible,outputVisible:this.isOutputVisible,dimensions:a})};h.prototype._outputted=function(){this._recentOutput=!0;this._helpRequested=!1;this._checkShow()};h.prototype._focused=function(){this._reportBlur("document")};h.prototype._reportFocus=function(a){this._debug&&console.log("FocusManager._reportFocus("+(a||"unknown")+")");if(this._blurDelayTimeout)this._debug&&console.log("FocusManager.cancelBlur"),
this._window.clearTimeout(this._blurDelayTimeout),this._blurDelayTimeout=null;if(!this._hasFocus)this._hasFocus=!0;this._checkShow()};h.prototype._reportBlur=function(a){this._debug&&console.log("FocusManager._reportBlur("+a+")");if(this._hasFocus)this._blurDelayTimeout?this._debug&&console.log("FocusManager.blurPending"):this._blurDelayTimeout=this._window.setTimeout(function(){this._debug&&console.log("FocusManager.blur");this._hasFocus=!1;this._checkShow();this._blurDelayTimeout=null}.bind(this),
this._blurDelay)};h.prototype._eagerHelperChanged=function(){this._checkShow()};h.prototype.onInputChange=function(){this._recentOutput=!1;this._checkShow()};h.prototype.helpRequest=function(){this._debug&&console.log("FocusManager.helpRequest");this._helpRequested=!0;this._recentOutput=!1;this._checkShow()};h.prototype.removeHelp=function(){this._debug&&console.log("FocusManager.removeHelp");this._recentOutput=this._helpRequested=this._isError=this._importantFieldFlag=!1;this._checkShow()};h.prototype.setImportantFieldFlag=
function(a){this._debug&&console.log("FocusManager.setImportantFieldFlag",a);this._importantFieldFlag=a;this._checkShow()};h.prototype.setError=function(a){this._debug&&console.log("FocusManager._isError",a);this._isError=a;this._checkShow()};h.prototype._checkShow=function(){var a=!1,b={tooltipVisible:this.isTooltipVisible,outputVisible:this.isOutputVisible},c=this._shouldShowTooltip();if(this.isTooltipVisible!==c.visible)b.tooltipVisible=this.isTooltipVisible=c.visible,a=!0;c=this._shouldShowOutput();
if(this.isOutputVisible!==c.visible)b.outputVisible=this.isOutputVisible=c.visible,a=!0;a&&(this._debug&&console.log("FocusManager.onVisibilityChange",b),this.onVisibilityChange(b))};h.prototype._shouldShowTooltip=function(){return!this._hasFocus?{visible:!1,reason:"notHasFocus"}:g.value===1?{visible:!1,reason:"eagerHelperNever"}:g.value===3?{visible:!0,reason:"eagerHelperAlways"}:this._isError?{visible:!0,reason:"isError"}:this._helpRequested?{visible:!0,reason:"helpRequested"}:this._importantFieldFlag?
{visible:!0,reason:"importantFieldFlag"}:{visible:!1,reason:"default"}};h.prototype._shouldShowOutput=function(){return!this._hasFocus?{visible:!1,reason:"notHasFocus"}:this._recentOutput?{visible:!0,reason:"recentOutput"}:{visible:!1,reason:"default"}};j.FocusManager=h});
define("gcli/ui/fields","require,exports,module,util/promise,util/util,util/util,gcli/types/basic".split(","),function(l,j){function h(a,b){this.type=a;this.document=b.document;this.requisition=b.requisition}function f(a,b){h.call(this,a,b);this.element=k.createElement(this.document,"div");this.onFieldChange=k.createEvent("BlankField.onFieldChange")}var d=l("util/promise"),k=l("util/util"),b=l("util/util").KeyEvent,g=l("gcli/types/basic").BlankType;h.prototype.element=void 0;h.prototype.destroy=function(){delete this.messageElement};
h.prototype.setConversion=function(){throw Error("Field should not be used directly");};h.prototype.getConversion=function(){throw Error("Field should not be used directly");};h.prototype.setMessageElement=function(a){this.messageElement=a};h.prototype.setMessage=function(a){this.messageElement&&k.setTextContent(this.messageElement,a||"")};h.prototype.onInputChange=function(a){d.resolve(this.getConversion()).then(function(c){this.onFieldChange({conversion:c});this.setMessage(c.message);a.keyCode===
b.DOM_VK_RETURN&&this.requisition.exec()}.bind(this),console.error)};h.prototype.isImportant=!1;h.claim=function(){throw Error("Field should not be used directly");};h.TOOLTIP_MATCH=5;h.TOOLTIP_DEFAULT=4;h.MATCH=3;h.DEFAULT=2;h.BASIC=1;h.NO_MATCH=0;j.Field=h;var a=[];j.addField=function(b){if(typeof b!=="function")throw console.error("addField erroring on ",b),Error("addField requires a Field constructor");a.push(b)};j.removeField=function(a){if(typeof a!=="string")fields=fields.filter(function(b){return b!==
a}),delete fields[a];else if(a instanceof h)removeField(a.name);else throw console.error("removeField erroring on ",a),Error("removeField requires an instance of Field");};j.getField=function(b,c){var d,g=-1;a.forEach(function(a){var c=a.claim(b);c>g&&(g=c,d=a)});if(!d)throw console.error("Unknown field type ",b," in ",a),Error("Can't find field for "+b);return c.tooltip&&g<h.TOOLTIP_DEFAULT?new f(b,c):new d(b,c)};f.prototype=Object.create(h.prototype);f.claim=function(a){return a instanceof g?h.MATCH:
h.NO_MATCH};f.prototype.setConversion=function(a){this.setMessage(a.message)};f.prototype.getConversion=function(){return this.type.parse(new Argument)};j.addField(f)});
define("gcli/ui/fields/basic","require,exports,module,util/util,util/l10n,gcli/argument,gcli/argument,gcli/argument,gcli/argument,gcli/types,gcli/types/basic,gcli/types/basic,gcli/types/basic,gcli/types/basic,gcli/types/basic,gcli/ui/fields,gcli/ui/fields".split(","),function(l,j){function h(a,b){r.call(this,a,b);this.arg=new e;this.element=g.createElement(this.document,"input");this.element.type="text";this.element.classList.add("gcli-field");this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("keyup",
this.onInputChange,!1);this.onFieldChange=g.createEvent("StringField.onFieldChange")}function f(a,b){r.call(this,a,b);this.arg=new e;this.element=g.createElement(this.document,"input");this.element.type="number";if(this.type.max)this.element.max=this.type.max;if(this.type.min)this.element.min=this.type.min;if(this.type.step)this.element.step=this.type.step;this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("keyup",this.onInputChange,!1);this.onFieldChange=g.createEvent("NumberField.onFieldChange")}
function d(a,b){r.call(this,a,b);this.name=b.name;this.named=b.named;this.element=g.createElement(this.document,"input");this.element.type="checkbox";this.element.id="gcliForm"+this.name;this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("change",this.onInputChange,!1);this.onFieldChange=g.createEvent("BooleanField.onFieldChange")}function k(a,b){r.call(this,a,b);this.options=b;this.requisition.onAssignmentChange.add(this.update,this);this.element=g.createElement(this.document,
"div");this.update();this.onFieldChange=g.createEvent("DelegateField.onFieldChange")}function b(b,c){r.call(this,b,c);this.options=c;this._onAdd=this._onAdd.bind(this);this.members=[];this.element=g.createElement(this.document,"div");this.element.classList.add("gcli-array-parent");this.addButton=g.createElement(this.document,"button");this.addButton.classList.add("gcli-array-member-add");this.addButton.addEventListener("click",this._onAdd,!1);this.addButton.textContent=a.lookup("fieldArrayAdd");this.element.appendChild(this.addButton);
this.container=g.createElement(this.document,"div");this.container.classList.add("gcli-array-members");this.element.appendChild(this.container);this.onInputChange=this.onInputChange.bind(this);this.onFieldChange=g.createEvent("ArrayField.onFieldChange")}var g=l("util/util"),a=l("util/l10n"),e=l("gcli/argument").Argument,c=l("gcli/argument").TrueNamedArgument,i=l("gcli/argument").FalseNamedArgument,m=l("gcli/argument").ArrayArgument,o=l("gcli/types").ArrayConversion,n=l("gcli/types/basic").StringType,
p=l("gcli/types/basic").NumberType,t=l("gcli/types/basic").BooleanType,u=l("gcli/types/basic").DelegateType,v=l("gcli/types/basic").ArrayType,r=l("gcli/ui/fields").Field,q=l("gcli/ui/fields");j.startup=function(){q.addField(h);q.addField(f);q.addField(d);q.addField(k);q.addField(b)};j.shutdown=function(){q.removeField(h);q.removeField(f);q.removeField(d);q.removeField(k);q.removeField(b)};h.prototype=Object.create(r.prototype);h.prototype.destroy=function(){r.prototype.destroy.call(this);this.element.removeEventListener("keyup",
this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};h.prototype.setConversion=function(a){this.arg=a.arg;this.element.value=a.arg.text;this.setMessage(a.message)};h.prototype.getConversion=function(){this.arg=this.arg.beget({text:this.element.value,prefixSpace:!0});return this.type.parse(this.arg)};h.claim=function(a){return a instanceof n?r.MATCH:r.BASIC};f.prototype=Object.create(r.prototype);f.claim=function(a){return a instanceof p?r.MATCH:r.NO_MATCH};f.prototype.destroy=
function(){r.prototype.destroy.call(this);this.element.removeEventListener("keyup",this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};f.prototype.setConversion=function(a){this.arg=a.arg;this.element.value=a.arg.text;this.setMessage(a.message)};f.prototype.getConversion=function(){this.arg=this.arg.beget({text:this.element.value,prefixSpace:!0});return this.type.parse(this.arg)};d.prototype=Object.create(r.prototype);d.claim=function(a){return a instanceof t?
r.MATCH:r.NO_MATCH};d.prototype.destroy=function(){r.prototype.destroy.call(this);this.element.removeEventListener("change",this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};d.prototype.setConversion=function(a){this.element.checked=a.value;this.setMessage(a.message)};d.prototype.getConversion=function(){return this.type.parse(this.named?this.element.checked?new c(new e(" --"+this.name)):new i:new e(" "+this.element.checked))};k.prototype=Object.create(r.prototype);
k.prototype.update=function(){var a=this.type.delegateType();if(a!==this.subtype)this.field&&(this.field.onFieldChange.remove(this.fieldChanged,this),this.field.destroy()),this.subtype=a,this.field=q.getField(a,this.options),this.field.onFieldChange.add(this.fieldChanged,this),g.clearElement(this.element),this.element.appendChild(this.field.element)};k.claim=function(a){return a instanceof u?r.MATCH:r.NO_MATCH};k.prototype.destroy=function(){r.prototype.destroy.call(this);this.requisition.onAssignmentChange.remove(this.update,
this);delete this.element;delete this.document;delete this.onInputChange};k.prototype.setConversion=function(a){this.field.setConversion(a)};k.prototype.getConversion=function(){return this.field.getConversion()};Object.defineProperty(k.prototype,"isImportant",{get:function(){return this.field.isImportant},enumerable:!0});b.prototype=Object.create(r.prototype);b.claim=function(a){return a instanceof v?r.MATCH:r.NO_MATCH};b.prototype.destroy=function(){r.prototype.destroy.call(this);this.addButton.removeEventListener("click",
this._onAdd,!1)};b.prototype.setConversion=function(a){g.clearElement(this.container);this.members=[];a.conversions.forEach(function(a){this._onAdd(null,a)},this)};b.prototype.getConversion=function(){for(var a=[],b=new m,c=0;c<this.members.length;c++)Promise.resolve(this.members[c].field.getConversion()).then(function(c){a.push(c);b.addArgument(c.arg)}.bind(this),console.error);return new o(a,b)};b.prototype._onAdd=function(b,c){var d=g.createElement(this.document,"div");d.classList.add("gcli-array-member");
this.container.appendChild(d);var e=q.getField(this.type.subtype,this.options);e.onFieldChange.add(function(){Promise.resolve(this.getConversion()).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)},this);c&&e.setConversion(c);d.appendChild(e.element);var f=g.createElement(this.document,"button");f.classList.add("gcli-array-member-del");f.addEventListener("click",this._onDel,!1);f.textContent=a.lookup("fieldArrayDel");d.appendChild(f);d={element:d,
field:e,parent:this};d.onDelete=function(){this.parent.container.removeChild(this.element);this.parent.members=this.parent.members.filter(function(a){return a!==this});this.parent.onInputChange()}.bind(d);f.addEventListener("click",d.onDelete,!1);this.members.push(d)}});define("text!gcli/ui/fields/menu.css",[],function(){return"\n.gcli-menu {\n  width: 100%;\n  overflow: hidden;\n  font-size: 90%;\n}\n\n.gcli-menu-field {\n  border: 1px solid #aaa;\n  border-top: 0;\n  border-bottom-right-radius: 5px;\n  border-bottom-left-radius: 5px;\n  max-height: 300px;\n  margin: 0 3px;\n  padding: 0;\n}\n\n.gcli-menu-template {\n  border-collapse: collapse;\n  width: 100%;\n}\n\n.gcli-menu-option {\n  overflow: hidden;\n  white-space: nowrap;\n  cursor: pointer;\n}\n\n.gcli-menu-option:hover {\n  background-image: -moz-linear-gradient(top, #f8f8f8, #ccc);\n  background-color: #ddd;\n}\n\n.gcli-menu-name {\n  padding: 2px 3px;\n  -moz-padding-start: 8px;\n  -webkit-padding-start: 8px;\n}\n\n.gcli-menu-desc {\n  color: #777;\n  padding: 0 3px;\n  -moz-padding-end: 8px;\n  -webkit-padding-end: 8px;\n}\n\n.gcli-menu-highlight,\n.gcli-menu-highlight.gcli-menu-option:hover {\n  background-image: -moz-linear-gradient(top, #eee, #b8b8b8);\n  background-color: #c8c8c8;\n}\n\n.gcli-menu-typed {\n  color: #FF6600;\n}\n\n.gcli-menu-more {\n  font-size: 80%;\n  text-align: right;\n  -moz-padding-end: 8px;\n  -webkit-padding-end: 8px;\n}"});
define("text!gcli/ui/fields/menu.html",[],function(){return'\n<div>\n  <table class="gcli-menu-template" aria-live="polite">\n    <tr class="gcli-menu-option" foreach="item in ${items}"\n        onclick="${onItemClickInternal}" title="${item.manual}">\n      <td class="gcli-menu-name">${item.name}</td>\n      <td class="gcli-menu-desc">${item.description}</td>\n    </tr>\n  </table>\n  <div class="gcli-menu-more" if="${items.hasMore}">${l10n.fieldMenuMore}</div>\n</div>'});
define("gcli/ui/fields/menu","require,exports,module,util/util,util/l10n,util/domtemplate,gcli/argument,gcli/types,gcli/canon,text!gcli/ui/fields/menu.css,text!gcli/ui/fields/menu.html".split(","),function(l,j){function h(a){a=a||{};this.document=a.document||document;this.type=a.type;if(!this.document)throw Error("No document");this.element=d.createElement(this.document,"div");this.element.classList.add(a.menuClass||"gcli-menu");a&&a.field&&this.element.classList.add(a.menuFieldClass||"gcli-menu-field");
e!=null&&d.importCss(e,this.document,"gcli-menu");this.template=d.toDom(this.document,c);this.templateOptions={blankNullUndefined:!0,stack:"menu.html"};this.items=null;this.onItemClick=d.createEvent("Menu.onItemClick")}function f(a,b,c){return typeof Proxy==="undefined"?a:Proxy.create({get:function(d,e){var f=a[e];if(e!=="name")return f;var g=f.indexOf(b);if(g===-1)return f;var h=f.substr(0,g),f=f.substr(g+b.length),g=c.createElement("span");g.appendChild(c.createTextNode(h));h=c.createElement("span");
h.classList.add("gcli-menu-typed");h.appendChild(c.createTextNode(b));g.appendChild(h);g.appendChild(c.createTextNode(f));return g}})}var d=l("util/util"),k=l("util/l10n"),b=l("util/domtemplate"),g=l("gcli/argument").Argument,a=l("gcli/types").Conversion;l("gcli/canon");var e=l("text!gcli/ui/fields/menu.css"),c=l("text!gcli/ui/fields/menu.html");h.prototype.l10n=k.propertyLookup;h.prototype.destroy=function(){delete this.element;delete this.template;delete this.document};h.prototype.onItemClickInternal=
function(a){a=a.currentTarget.querySelector(".gcli-menu-name").textContent;a=new g(a);a.suffix=" ";this.onItemClick({arg:a})};h.prototype.show=function(c,e){this.items=c.filter(function(a){return a.hidden===void 0||a.hidden!==!0}.bind(this));if(e)this.items=this.items.map(function(a){return f(a,e,this.template.ownerDocument)}.bind(this));if(this.items.length===0)this.element.style.display="none";else{if(this.items.length>=a.maxPredictions)this.items.splice(-1),this.items.hasMore=!0;var g=this.template.cloneNode(!0);
b.template(g,this,this.templateOptions);d.clearElement(this.element);this.element.appendChild(g);this.element.style.display="block"}};h.prototype.setChoiceIndex=function(a){for(var b=this.element.querySelectorAll(".gcli-menu-option"),c=0;c<b.length;c++)b[c].classList.remove("gcli-menu-highlight");a!=null&&(b.length<=a?console.error("Cant highlight "+a+". Only "+b.length+" options"):b.item(a).classList.add("gcli-menu-highlight"))};h.prototype.selectChoice=function(){var a=this.element.querySelector(".gcli-menu-highlight .gcli-menu-name");
if(!a)return!1;a=new g(a.textContent);a.suffix=" ";a.prefix=" ";this.onItemClick({arg:a});return!0};h.prototype.hide=function(){this.element.style.display="none"};h.prototype.setMaxHeight=function(a){this.element.style.maxHeight=a+"px"};j.Menu=h});
define("gcli/ui/fields/javascript","require,exports,module,util/util,util/promise,gcli/types,gcli/types,gcli/argument,gcli/types/javascript,gcli/ui/fields/menu,gcli/ui/fields,gcli/ui/fields".split(","),function(l,j){function h(a,d){c.call(this,a,d);this.onInputChange=this.onInputChange.bind(this);this.arg=new g("","{ "," }");this.element=f.createElement(this.document,"div");this.input=f.createElement(this.document,"input");this.input.type="text";this.input.addEventListener("keyup",this.onInputChange,
!1);this.input.classList.add("gcli-field");this.input.classList.add("gcli-field-javascript");this.element.appendChild(this.input);this.menu=new e({document:this.document,field:!0,type:a});this.element.appendChild(this.menu.element);this.setConversion(new b(void 0,new g(""),k.INCOMPLETE,""));this.onFieldChange=f.createEvent("JavascriptField.onFieldChange");this.menu.onItemClick.add(this.itemClicked,this)}var f=l("util/util"),d=l("util/promise"),k=l("gcli/types").Status,b=l("gcli/types").Conversion,
g=l("gcli/argument").ScriptArgument,a=l("gcli/types/javascript").JavascriptType,e=l("gcli/ui/fields/menu").Menu,c=l("gcli/ui/fields").Field,i=l("gcli/ui/fields");j.startup=function(){i.addField(h)};j.shutdown=function(){i.removeField(h)};h.prototype=Object.create(c.prototype);h.claim=function(b){return b instanceof a?c.TOOLTIP_MATCH:c.NO_MATCH};h.prototype.destroy=function(){c.prototype.destroy.call(this);this.input.removeEventListener("keyup",this.onInputChange,!1);this.menu.onItemClick.remove(this.itemClicked,
this);this.menu.destroy();delete this.element;delete this.input;delete this.menu;delete this.document;delete this.onInputChange};h.prototype.setConversion=function(b){this.arg=b.arg;this.input.value=b.arg.text;var c=0;if(this.type instanceof a){var d=b.arg.text.lastIndexOf(".");d!==-1&&(c=d)}this.setMessage(b.message);b.getPredictions().then(function(a){var b=[];a.forEach(function(a){a.hidden||b.push({name:a.name.substring(c),complete:a.name,description:a.description||""})},this);this.menu.show(b)}.bind(this),
console.error)};h.prototype.itemClicked=function(a){d.resolve(this.type.parse(a.arg)).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)};h.prototype.onInputChange=function(a){this.item=a.currentTarget.item;d.resolve(this.getConversion()).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)};h.prototype.getConversion=function(){this.arg=new g(this.input.value,"{ "," }");return this.type.parse(this.arg)};
h.DEFAULT_VALUE="__JavascriptField.DEFAULT_VALUE"});
define("gcli/ui/fields/selection","require,exports,module,util/promise,util/util,util/l10n,gcli/argument,gcli/types,gcli/types,gcli/types/basic,gcli/types/selection,gcli/ui/fields/menu,gcli/ui/fields,gcli/ui/fields".split(","),function(l,j){function h(a,c){i.call(this,a,c);this.items=[];this.element=k.createElement(this.document,"select");this.element.classList.add("gcli-field");this._addOption({name:b.lookupFormat("fieldSelectionSelect",[c.name])});d.resolve(this.type.getLookup()).then(function(a){a.forEach(this._addOption,
this)}.bind(this),console.error);this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("change",this.onInputChange,!1);this.onFieldChange=k.createEvent("SelectionField.onFieldChange")}function f(a,b){i.call(this,a,b);this.onInputChange=this.onInputChange.bind(this);this.arg=new g;this.menu=new c({document:this.document,type:a});this.element=this.menu.element;this.onFieldChange=k.createEvent("SelectionTooltipField.onFieldChange");this.menu.onItemClick.add(this.itemClicked,
this)}var d=l("util/promise"),k=l("util/util"),b=l("util/l10n"),g=l("gcli/argument").Argument;l("gcli/types");l("gcli/types");var a=l("gcli/types/basic").BooleanType,e=l("gcli/types/selection").SelectionType,c=l("gcli/ui/fields/menu").Menu,i=l("gcli/ui/fields").Field,m=l("gcli/ui/fields");j.startup=function(){m.addField(h);m.addField(f)};j.shutdown=function(){m.removeField(h);m.removeField(f)};h.prototype=Object.create(i.prototype);h.claim=function(b){return b instanceof a?i.BASIC:b instanceof e?
i.DEFAULT:i.NO_MATCH};h.prototype.destroy=function(){i.prototype.destroy.call(this);this.element.removeEventListener("change",this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};h.prototype.setConversion=function(a){var b;this.items.forEach(function(c){if(c.value&&c.value===a.value)b=c.index},this);this.element.value=b;this.setMessage(a.message)};h.prototype.getConversion=function(){return this.type.parse(new g(this.items[this.element.value].name," "))};h.prototype._addOption=
function(a){a.index=this.items.length;this.items.push(a);var b=k.createElement(this.document,"option");b.textContent=a.name;b.value=a.index;this.element.appendChild(b)};f.prototype=Object.create(i.prototype);f.claim=function(a){return a.getType()instanceof e?i.TOOLTIP_MATCH:i.NO_MATCH};f.prototype.destroy=function(){i.prototype.destroy.call(this);this.menu.onItemClick.remove(this.itemClicked,this);this.menu.destroy();delete this.element;delete this.document;delete this.onInputChange};f.prototype.setConversion=
function(a){this.arg=a.arg;this.setMessage(a.message);a.getPredictions().then(function(b){this.menu.show(b.map(function(a){return a.value.description?a.value:a},this),a.arg.text)}.bind(this),console.error)};f.prototype.itemClicked=function(a){d.resolve(this.type.parse(a.arg)).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)};f.prototype.onInputChange=function(a){this.item=a.currentTarget.item;d.resolve(this.getConversion()).then(function(a){this.onFieldChange({conversion:a});
this.setMessage(a.message)}.bind(this),console.error)};f.prototype.getConversion=function(){this.arg=this.arg.beget({text:this.input.value});return this.type.parse(this.arg)};f.prototype.setChoiceIndex=function(a){this.menu.setChoiceIndex(a)};f.prototype.selectChoice=function(){return this.menu.selectChoice()};Object.defineProperty(f.prototype,"isImportant",{get:function(){return this.type.name!=="command"},enumerable:!0});f.DEFAULT_VALUE="__SelectionTooltipField.DEFAULT_VALUE"});
define("text!gcli/ui/tooltip.css",[],function(){return"\n.gcli-panel {\n  -moz-transition-property: opacity, height;\n  -moz-transition-duration: 0.5s, 2s;\n  overflow-y: auto;\n  overflow-x: hidden;\n  z-index: 2;\n  position: absolute;\n  max-height: 100%;\n  max-width: 350px;\n  left: 0;\n  bottom: 0;\n  font-family: Segoe UI, Helvetica Neue, Verdana, Arial, sans-serif;\n  margin-bottom: -3px;\n}\n\n.gcli-panel.gcli-panel-hide {\n  opacity: 0;\n  height: 0;\n}\n\n.gcli-panel-connector {\n  height: 10px;\n  margin-top: -1px;\n  margin-left: 20px;\n  width: 20px;\n  background: white;\n  border-left: 1px solid #999;\n  border-right: 1px solid #999;\n}\n\n.gcli-tt-description {\n  padding: 5px 10px 0;\n  font-size: 90%;\n}\n\n.gcli-tt-error {\n  font-size: 80%;\n  color: #900;\n  padding: 0 10px;\n}\n\n.gcli-field {\n  width: 100%;\n}\n\n.gcli-field-javascript {\n  margin-bottom: 0;\n}\n\n.gcli-tt {\n  box-shadow: 0 0 10px 1px #ddd;\n  border: 1px solid #999;\n  border-radius: 3px;\n  margin: 10px 0 0 0;\n  background: hsla(0, 100%, 100%, 0.95);\n  padding-bottom: 5px;\n}"});
define("text!gcli/ui/tooltip.html",[],function(){return'\n<div class="gcli-tt" aria-live="polite">\n  <div class="gcli-tt-description" save="${descriptionEle}">${description}</div>\n  ${field.element}\n  <div class="gcli-tt-error" save="${errorEle}">${assignment.conversion.message}</div>\n  <div class="gcli-tt-highlight" save="${highlightEle}"></div>\n</div>'});
define("gcli/ui/tooltip","require,exports,module,util/util,util/domtemplate,gcli/cli,gcli/ui/fields,text!gcli/ui/tooltip.css,text!gcli/ui/tooltip.html".split(","),function(l,j){function h(b,c){this.inputter=c.inputter;this.requisition=c.requisition;this.focusManager=c.focusManager;this.element=c.element;this.element.classList.add(b.tooltipClass||"gcli-tooltip");this.document=this.element.ownerDocument;if(this.panelElement=c.panelElement)this.panelElement.classList.add("gcli-panel-hide"),this.focusManager.onVisibilityChange.add(this.visibilityChanged,
this);this.focusManager.addMonitoredElement(this.element,"tooltip");this.fields=[];if(g!=null)this.style=f.importCss(g,this.document,"gcli-tooltip");this.template=f.toDom(this.document,a);this.templateOptions={blankNullUndefined:!0,stack:"tooltip.html"};this.inputter.onChoiceChange.add(this.choiceChanged,this);this.inputter.onAssignmentChange.add(this.assignmentChanged,this);this.assignment=void 0;this.assignmentChanged({assignment:this.inputter.assignment})}var f=l("util/util"),d=l("util/domtemplate"),
k=l("gcli/cli").CommandAssignment,b=l("gcli/ui/fields"),g=l("text!gcli/ui/tooltip.css"),a=l("text!gcli/ui/tooltip.html");h.prototype.destroy=function(){this.inputter.onAssignmentChange.remove(this.assignmentChanged,this);this.inputter.onChoiceChange.remove(this.choiceChanged,this);this.panelElement&&this.focusManager.onVisibilityChange.remove(this.visibilityChanged,this);this.focusManager.removeMonitoredElement(this.element,"tooltip");this.style&&(this.style.parentNode.removeChild(this.style),delete this.style);
this.field.onFieldChange.remove(this.fieldChanged,this);this.field.destroy();delete this.errorEle;delete this.descriptionEle;delete this.highlightEle;delete this.document;delete this.element;delete this.panelElement;delete this.template};Object.defineProperty(h.prototype,"isMenuShowing",{get:function(){return this.focusManager.isTooltipVisible&&this.field!=null&&this.field.menu!=null},enumerable:!0});h.prototype.assignmentChanged=function(a){if(this.assignment!==a.assignment)this.assignment&&this.assignment.onAssignmentChange.remove(this.assignmentContentsChanged,
this),this.assignment=a.assignment,this.field&&(this.field.onFieldChange.remove(this.fieldChanged,this),this.field.destroy()),this.field=b.getField(this.assignment.param.type,{document:this.document,name:this.assignment.param.name,requisition:this.requisition,required:this.assignment.param.isDataRequired,named:!this.assignment.param.isPositionalAllowed,tooltip:!0}),this.focusManager.setImportantFieldFlag(this.field.isImportant),this.field.onFieldChange.add(this.fieldChanged,this),this.assignment.onAssignmentChange.add(this.assignmentContentsChanged,
this),this.field.setConversion(this.assignment.conversion),this.highlightEle=this.descriptionEle=this.errorEle=void 0,a=this.template.cloneNode(!0),d.template(a,this,this.templateOptions),f.clearElement(this.element),this.element.appendChild(a),this.element.style.display="block",this.field.setMessageElement(this.errorEle),this._updatePosition()};h.prototype.choiceChanged=function(a){this.field&&this.field.setChoiceIndex&&this.assignment.conversion.constrainPredictionIndex(a.choice).then(function(a){this.field.setChoiceIndex(a)}.bind(this)).then(null,
console.error)};h.prototype.selectChoice=function(){return this.field&&this.field.selectChoice?this.field.selectChoice():!1};h.prototype.fieldChanged=function(a){this.requisition.setAssignment(this.assignment,a.conversion.arg,{matchPadding:!0});this.focusManager.setError(a.conversion.message!=null&&a.conversion.message!=="");this.document.defaultView.setTimeout(function(){this.inputter.focus()}.bind(this),10)};h.prototype.assignmentContentsChanged=function(a){a.conversion.arg.text!==a.oldConversion.arg.text&&
(this.field.setConversion(a.conversion),f.setTextContent(this.descriptionEle,this.description),this._updatePosition())};h.prototype._updatePosition=function(){var a=this.getDimensionsOfAssignment();if(this.panelElement)this.panelElement.style.left=a.start*10+"px";this.focusManager.updatePosition(a)};h.prototype.getDimensionsOfAssignment=function(){for(var a="",b=this.requisition.getAssignments(!0),d=0;d<b.length;d++){if(b[d]===this.assignment)break;a+=b[d].toString()}a+=this.assignment.arg.prefix;
b=a.length;a+=this.assignment.arg.text;return{start:b,end:a.length}};Object.defineProperty(h.prototype,"description",{get:function(){return this.assignment instanceof k&&this.assignment.value==null?"":this.assignment.param.manual||this.assignment.param.description},enumerable:!0});h.prototype.visibilityChanged=function(a){this.panelElement&&(a.tooltipVisible?this.panelElement.classList.remove("gcli-panel-hide"):this.panelElement.classList.add("gcli-panel-hide"))};j.Tooltip=h});
define("text!gcli/ui/output_view.css",[],function(){return"\n.gcli-row-in {\n  padding: 0 4px;\n  box-shadow: 0 -6px 10px -6px #ddd;\n  border-top: 1px solid #bbb;\n}\n\n.gcli-row-in > img {\n  cursor: pointer;\n}\n\n.gcli-row-hover {\n  display: none;\n  float: right;\n  padding: 2px 2px 0;\n}\n\n.gcli-row-in:hover > .gcli-row-hover {\n  display: inline;\n}\n\n.gcli-row-in:hover > .gcli-row-hover.gcli-row-hidden {\n  display: none;\n}\n\n.gcli-row-duration {\n  color: #666;\n}\n\n.gcli-row-prompt {\n  color: #00F;\n  font-weight: bold;\n  font-size: 120%;\n}\n\n.gcli-row-prompt.gcli-row-complete {\n  color: #060;\n}\n\n.gcli-row-prompt.gcli-row-error {\n  color: #F00;\n}\n\n.gcli-row-duration {\n  font-size: 80%;\n}\n\n.gcli-row-out {\n  margin: 0 10px 15px;\n  padding: 0 10px;\n  line-height: 1.2em;\n  font-size: 95%;\n}\n\n.gcli-row-out strong,\n.gcli-row-out b,\n.gcli-row-out th,\n.gcli-row-out h1,\n.gcli-row-out h2,\n.gcli-row-out h3 {\n  color: #000;\n}\n\n.gcli-row-out p {\n  margin: 5px 0;\n}\n\n.gcli-row-out a {\n  color: hsl(200,40%,40%);\n  text-decoration: none;\n}\n\n.gcli-row-out a:hover {\n  cursor: pointer;\n  border-bottom: 1px dotted hsl(200,40%,60%);\n}\n\n.gcli-row-out input[type=password],\n.gcli-row-out input[type=text],\n.gcli-row-out textarea {\n  font-size: 120%;\n  background: transparent;\n  padding: 3px;\n  border-radius: 3px;\n  border: 1px solid #bbb;\n}\n\n.gcli-row-out table,\n.gcli-row-out td,\n.gcli-row-out th {\n  border: 0;\n  padding: 0 2px;\n}\n\n.gcli-row-terminal,\n.gcli-row-subterminal {\n  border-radius: 3px;\n  border: 1px solid #ddd;\n}\n\n.gcli-row-terminal {\n  height: 200px;\n  width: 620px;\n  font-size: 80%;\n}\n\n.gcli-row-subterminal {\n  height: 150px;\n  width: 300px;\n  font-size: 75%;\n}\n\n.gcli-out-shortcut {\n  font-weight: normal;\n  border: 1px solid #999;\n  border-radius: 3px;\n  color: #666;\n  cursor: pointer;\n  padding: 0 3px 1px;\n  margin: 1px 4px;\n  display: inline-block;\n}\n\n.gcli-out-shortcut:before {\n  content: '\\bb';\n  padding-right: 2px;\n  color: hsl(25,78%,50%);\n  font-weight: bold;\n  font-size: 110%;\n}"});
define("text!gcli/ui/output_terminal.html",[],function(){return'\n<div class="gcli-row">\n  <\!-- The div for the input (i.e. what was typed) --\>\n  <div class="gcli-row-in" save="${elems.rowin}" aria-live="assertive"\n      onclick="${copyToInput}" ondblclick="${execute}">\n\n    <\!-- What the user actually typed --\>\n    <span save="${elems.prompt}" class="gcli-row-prompt ${elems.error ? \'gcli-row-error\' : \'\'} ${elems.completed ? \'gcli-row-complete\' : \'\'}">${prompt}</span>\n    <span class="gcli-row-in-typed">${outputData.canonical}</span>\n\n    <\!-- The extra details that appear on hover --\>\n    <span class="gcli-row-duration gcli-row-hover" save="${elems.duration}"></span>\n    <\!--\n    <img class="gcli-row-hover" onclick="${hideOutput}" save="${elems.hide}"\n        alt="Hide command output" _src="${url(\'images/minus.png\')}"/>\n    <img class="gcli-row-hover gcli-row-hidden" onclick="${showOutput}" save="${elems.show}"\n        alt="Show command output" _src="${url(\'images/plus.png\')}"/>\n    <img class="gcli-row-hover" onclick="${remove}"\n        alt="Remove this command from the history"\n        _src="${url(\'images/closer.png\')}"/>\n    --\>\n    <img style="float:right;" _src="${url(\'images/throbber.gif\')}" save="${elems.throb}"/>\n  </div>\n\n  <\!-- The div for the command output --\>\n  <div class="gcli-row-out" aria-live="assertive" save="${elems.rowout}">\n  </div>\n</div>'});
define("gcli/ui/output_terminal","require,exports,module,util/util,util/domtemplate,gcli/canon,text!gcli/ui/output_view.css,text!gcli/ui/output_terminal.html".split(","),function(l,j,h){function f(b,c){this.element=c.element;this.requisition=c.requisition;this.requisition.commandOutputManager.onOutput.add(this.outputted,this);var d=c.element.ownerDocument;if(g!=null)this.style=k.importCss(g,d,"gcli-output-view");this.template=k.toDom(d,a);this.templateOptions={allowEval:!0,stack:"output_terminal.html"}}
function d(a,c){this.outputData=a;this.outputTerminal=c;this.url=k.createUrlLookup(h);this.elems={rowin:null,rowout:null,hide:null,show:null,duration:null,throb:null,prompt:null};var d=this.outputTerminal.template.cloneNode(!0);b.template(d,this,this.outputTerminal.templateOptions);this.outputTerminal.element.appendChild(this.elems.rowin);this.outputTerminal.element.appendChild(this.elems.rowout);this.outputData.onClose.add(this.closed,this);this.outputData.onChange.add(this.changed,this)}var k=l("util/util"),
b=l("util/domtemplate");l("gcli/canon");var g=l("text!gcli/ui/output_view.css"),a=l("text!gcli/ui/output_terminal.html");f.prototype.destroy=function(){this.style&&(this.style.parentNode.removeChild(this.style),delete this.style);this.requisition.commandOutputManager.onOutput.remove(this.outputted,this);delete this.requisition;delete this.element;delete this.template};f.prototype.outputted=function(a){if(!a.output.hidden)a.output.view=new d(a.output,this)};f.prototype.setHeight=function(a){this.element.style.height=
a+"px"};j.OutputTerminal=f;d.prototype.destroy=function(){this.outputData.onChange.remove(this.changed,this);this.outputData.onClose.remove(this.closed,this);this.outputTerminal.element.removeChild(this.elems.rowin);this.outputTerminal.element.removeChild(this.elems.rowout);delete this.outputData;delete this.outputTerminal;delete this.url;delete this.elems};Object.defineProperty(d.prototype,"prompt",{get:function(){return this.outputData.canonical?"\u00bb":""},enumerable:!0});d.prototype.copyToInput=
function(){this.outputTerminal.requisition&&this.outputTerminal.requisition.update(this.outputData.typed)};d.prototype.execute=function(){this.outputTerminal.requisition&&this.outputTerminal.requisition.updateExec(this.outputData.typed)};d.prototype.hideOutput=function(a){this.elems.rowout.style.display="none";this.elems.hide.classList.add("cmd_hidden");this.elems.show.classList.remove("cmd_hidden");a.stopPropagation()};d.prototype.showOutput=function(a){this.elems.rowout.style.display="block";this.elems.hide.classList.remove("cmd_hidden");
this.elems.show.classList.add("cmd_hidden");a.stopPropagation()};d.prototype.closed=function(){this.destroy()};d.prototype.changed=function(){var a=this.outputData.duration!=null?"completed in "+this.outputData.duration/1E3+" sec ":"",a=this.elems.rowout.ownerDocument.createTextNode(a);this.elems.duration.appendChild(a);this.outputData.completed&&this.elems.prompt.classList.add("gcli-row-complete");this.outputData.error&&this.elems.prompt.classList.add("gcli-row-error");this.outputData.toDom(this.elems.rowout);
this.outputTerminal.element.scrollTop=Math.max(this.outputTerminal.element.scrollHeight,this.outputTerminal.element.clientHeight)-this.outputTerminal.element.clientHeight;this.elems.throb.style.display=this.outputData.completed?"none":"block"};j.OutputView=d});
define("gcli/history",["require","exports","module"],function(l,j){function h(){this._buffer=[""];this._current=0}h.prototype.destroy=function(){delete this._buffer};h.prototype.add=function(f){this._buffer.splice(1,0,f);this._current=0};h.prototype.forward=function(){this._current>0&&this._current--;return this._buffer[this._current]};h.prototype.backward=function(){this._current<this._buffer.length-1&&this._current++;return this._buffer[this._current]};j.History=h});
define("text!gcli/ui/inputter.css",[],function(){return"\n.gcli-in-input,\n.gcli-in-complete,\n.gcli-prompt {\n  font-family: Segoe UI, Helvetica Neue, Verdana, Arial, sans-serif;\n}\n\n.gcli-in-input,\n.gcli-in-complete {\n  font-size: 110%;\n  font-weight: normal;\n  font-style: normal;\n  padding: 0 0 0 22px;\n  background-color: transparent;\n}\n\n.gcli-in-input {\n  color: #000;\n  border: 0;\n  box-shadow: 0 0 10px 1px #ddd;\n  border-top: 1px solid #999;\n}\n\n.gcli-in-complete {\n  position: absolute;\n  z-index: -1000;\n  color: transparent;\n  margin-top: -1px;\n  border-top: 1px solid transparent;\n}\n\n.gcli-prompt {\n  position: absolute;\n  z-index: -1001;\n  padding: 0 1px;\n  color: hsl(25,78%,50%);\n  font-size: 150%;\n  font-weight: bold;\n  line-height: 95%;\n}\n\n.gcli-in-incomplete {\n  border-bottom: 2px dotted #999;\n}\n\n.gcli-in-error {\n  border-bottom: 2px dotted #F00;\n}\n\n.gcli-in-ontab {\n  color: hsl(200,40%,70%);\n}\n\n.gcli-in-todo {\n  color: hsl(48,28%,76%);\n}\n\n.gcli-in-closebrace {\n  color: hsl(0,0%,80%);\n}\n\n.gcli-in-scratchlink {\n  float: right;\n  font-size: 85%;\n  color: #888;\n  padding-right: 10px;\n}"});
define("gcli/ui/inputter","require,exports,module,util/promise,util/util,util/util,gcli/types,gcli/history,text!gcli/ui/inputter.css".split(","),function(l,j){var h;function f(b,d){this.requisition=d.requisition;this.focusManager=d.focusManager;this.element=d.element;this.element.classList.add("gcli-in-input");this.element.spellcheck=!1;this.document=this.element.ownerDocument;this.scratchpad=b.scratchpad;if(e!=null)this.style=k.importCss(e,this.document,"gcli-inputter");this.lastTabDownAt=0;this._caretChange=
null;this.onKeyDown=this.onKeyDown.bind(this);this.onKeyUp=this.onKeyUp.bind(this);this.element.addEventListener("keydown",this.onKeyDown,!1);this.element.addEventListener("keyup",this.onKeyUp,!1);this.history=new a;this._scrollingThroughHistory=!1;this._choice=null;this.onChoiceChange=k.createEvent("Inputter.onChoiceChange");this.onMouseUp=this.onMouseUp.bind(this);this.element.addEventListener("mouseup",this.onMouseUp,!1);this.focusManager&&this.focusManager.addMonitoredElement(this.element,"input");
this._completed=c;this.requisition.onTextChange.add(this.textChanged,this);this.assignment=this.requisition.getAssignmentAt(0);this.onAssignmentChange=k.createEvent("Inputter.onAssignmentChange");this.onInputChange=k.createEvent("Inputter.onInputChange");this.onResize=k.createEvent("Inputter.onResize");this.onWindowResize=this.onWindowResize.bind(this);this.document.defaultView.addEventListener("resize",this.onWindowResize,!1);this.requisition.update(this.element.value||"")}var d=l("util/promise"),
k=l("util/util"),b=l("util/util").KeyEvent,g=l("gcli/types").Status,a=l("gcli/history").History,e=l("text!gcli/ui/inputter.css"),c=d.resolve(void 0);f.prototype.destroy=function(){this.document.defaultView.removeEventListener("resize",this.onWindowResize,!1);this.requisition.onTextChange.remove(this.textChanged,this);this.focusManager&&this.focusManager.removeMonitoredElement(this.element,"input");this.element.removeEventListener("mouseup",this.onMouseUp,!1);this.element.removeEventListener("keydown",
this.onKeyDown,!1);this.element.removeEventListener("keyup",this.onKeyUp,!1);this.history.destroy();this.style&&(this.style.parentNode.removeChild(this.style),delete this.style);delete this.onMouseUp;delete this.onKeyDown;delete this.onKeyUp;delete this.onWindowResize;delete this.tooltip;delete this.document;delete this.element};f.prototype.onWindowResize=function(){if(this.element){var a=this.getDimensions();if(a)this.onResize(a)}};f.prototype.getDimensions=function(){if(this.element.getBoundingClientRect){for(var a,
b,c=this.element.parentNode;c&&c.nodeName!=="#document";){var d=this.document.defaultView.getComputedStyle(c,"");if(d&&(d=d.getPropertyValue("position"),d==="absolute"||d==="fixed")){b=c.getBoundingClientRect();a=b.top;b=b.left;break}c=c.parentNode}c=this.element.getBoundingClientRect();return{top:c.top-(a||0)+1,height:c.bottom-c.top-1,left:c.left-(b||0)+2,width:c.right-c.left}}};f.prototype.onMouseUp=function(){this._checkAssignment()};f.prototype.textChanged=function(){if(this.document){if(this._caretChange==
null)this._caretChange=h;var a=this.requisition.toString(),b=this.getInputState();b.typed=a;this._processCaretChange(b);if(this.element.value!==a)this.element.value=a;this.onInputChange({inputState:b})}};h=3;f.prototype._processCaretChange=function(a){var b,c;switch(this._caretChange){case 1:b=0;c=a.typed.length;break;case 2:c=b=a.typed.length;break;case h:b=a.cursor.start;do b++;while(b<a.typed.length&&a.typed[b-1]!==" ");c=b;break;default:b=a.cursor.start,c=a.cursor.end}b=b>a.typed.length?a.typed.length:
b;c=c>a.typed.length?a.typed.length:c;a={typed:a.typed,cursor:{start:b,end:c}};if(this.element.selectionStart!==b)this.element.selectionStart=b;if(this.element.selectionEnd!==c)this.element.selectionEnd=c;this._checkAssignment(b);this._caretChange=null;return a};f.prototype._checkAssignment=function(a){if(a==null)a=this.element.selectionStart;a=this.requisition.getAssignmentAt(a);if(this.assignment!==a)this.assignment=a,this.onAssignmentChange({assignment:this.assignment});if(this.focusManager)a=
this.assignment.conversion.message,this.focusManager.setError(a!=null&&a!=="")};f.prototype.setInput=function(a){return this.requisition.update(a)};f.prototype.setCursor=function(a){this._caretChange=0;this._processCaretChange({typed:this.element.value,cursor:a})};f.prototype.focus=function(){this.element.focus();this._checkAssignment()};f.prototype.onKeyDown=function(a){if(a.keyCode===b.DOM_VK_UP||a.keyCode===b.DOM_VK_DOWN)a.preventDefault();else if(!(a.keyCode===b.DOM_VK_F1||a.keyCode===b.DOM_VK_ESCAPE||
a.keyCode===b.DOM_VK_UP||a.keyCode===b.DOM_VK_DOWN)){if(this.focusManager)this.focusManager.onInputChange();if(a.keyCode===b.DOM_VK_TAB){this.lastTabDownAt=0;if(!a.shiftKey)a.preventDefault(),this.lastTabDownAt=a.timeStamp;if(a.metaKey||a.altKey||a.crtlKey)this.document.commandDispatcher?this.document.commandDispatcher.advanceFocus():this.element.blur()}}};f.prototype.onKeyUp=function(a){this.handleKeyUp(a).then(null,console.error)};f.prototype.handleKeyUp=function(a){if(this.focusManager&&a.keyCode===
b.DOM_VK_F1)return this.focusManager.helpRequest(),c;if(this.focusManager&&a.keyCode===b.DOM_VK_ESCAPE)return this.focusManager.removeHelp(),c;if(a.keyCode===b.DOM_VK_UP){if(this.tooltip&&this.tooltip.isMenuShowing)this.changeChoice(-1);else if(this.element.value===""||this._scrollingThroughHistory)return this._scrollingThroughHistory=!0,this.requisition.update(this.history.backward());else if(this.assignment.getStatus()===g.VALID){if(this.requisition.increment(this.assignment),this.focusManager)this.focusManager.onInputChange()}else this.changeChoice(-1);
return c}if(a.keyCode===b.DOM_VK_DOWN){if(this.tooltip&&this.tooltip.isMenuShowing)this.changeChoice(1);else if(this.element.value===""||this._scrollingThroughHistory)return this._scrollingThroughHistory=!0,this.requisition.update(this.history.forward());else if(this.assignment.getStatus()===g.VALID){if(this.requisition.decrement(this.assignment),this.focusManager)this.focusManager.onInputChange()}else this.changeChoice(1);return c}if(a.keyCode===b.DOM_VK_RETURN)return this.requisition.getStatus()===
g.VALID?(this._scrollingThroughHistory=!1,this.history.add(this.element.value),this.requisition.exec()):this.tooltip.selectChoice()||this.focusManager.setError(!0),this._choice=null,c;if(a.keyCode===b.DOM_VK_TAB&&!a.shiftKey){if(this.element.value.length>0&&this.lastTabDownAt+1E3>a.timeStamp){this._caretChange=h;a=this.getInputState();this._processCaretChange(a);if(this._choice==null)this._choice=0;this._completed=this.requisition.complete(a.cursor,this._choice)}this.lastTabDownAt=0;this._scrollingThroughHistory=
!1;return this._completed.then(function(){this._choice=null;this.onChoiceChange({choice:this._choice})}.bind(this))}if(this.scratchpad&&this.scratchpad.shouldActivate(a))return this.scratchpad.activate(this.element.value)?this.requisition.update(""):c;this._scrollingThroughHistory=!1;this._caretChange=0;this._completed=this.requisition.update(this.element.value);return this._completed.then(function(){this._choice=null;this.onChoiceChange({choice:this._choice})}.bind(this))};f.prototype.changeChoice=
function(a){if(this._choice==null)this._choice=0;this._choice+=a;this.onChoiceChange({choice:this._choice})};f.prototype.getCurrentAssignment=function(){return this.requisition.getAssignmentAt(this.element.selectionStart)};f.prototype.getInputState=function(){var a={typed:this.element.value,cursor:{start:this.element.selectionStart,end:this.element.selectionEnd}};a.typed==null&&(a={typed:"",cursor:{start:0,end:0}});if(a.cursor.start==null)a.cursor.start=0;return a};j.Inputter=f});
define("text!gcli/ui/completer.html",[],function(){return'\n<div>\n  <loop foreach="member in ${statusMarkup}">\n    <span class="${member.className}">${member.string}</span>\n  </loop>\n  <span class="gcli-in-ontab">${directTabText}</span>\n  <span class="gcli-in-todo" foreach="param in ${emptyParameters}">${param}</span>\n  <span class="gcli-in-ontab">${arrowTabText}</span>\n  <span class="gcli-in-closebrace" if="${unclosedJs}">}</span>\n  <div class="gcli-in-scratchlink" if="${scratchLink}">${scratchLink}</div>\n</div>'});
define("gcli/ui/completer","require,exports,module,util/promise,util/util,util/domtemplate,text!gcli/ui/completer.html".split(","),function(l,j){function h(f,a){this.requisition=a.requisition;this.scratchpad=f.scratchpad;this.input={typed:"",cursor:{start:0,end:0}};this.choice=0;this.element=a.element;this.element.classList.add("gcli-in-complete");this.element.setAttribute("tabindex","-1");this.element.setAttribute("aria-live","polite");this.document=this.element.ownerDocument;this.inputter=a.inputter;
this.inputter.onInputChange.add(this.update,this);this.inputter.onAssignmentChange.add(this.update,this);this.inputter.onChoiceChange.add(this.update,this);if(this.autoResize=a.autoResize){this.inputter.onResize.add(this.resized,this);var e=this.inputter.getDimensions();e&&this.resized(e)}this.template=d.toDom(this.document,b);d.removeWhitespace(this.template,!0);this.update()}var f=l("util/promise"),d=l("util/util"),k=l("util/domtemplate"),b=l("text!gcli/ui/completer.html");h.prototype.destroy=function(){this.inputter.onInputChange.remove(this.update,
this);this.inputter.onAssignmentChange.remove(this.update,this);this.inputter.onChoiceChange.remove(this.update,this);this.autoResize&&this.inputter.onResize.remove(this.resized,this);delete this.document;delete this.element;delete this.template;delete this.inputter};h.prototype.resized=function(b){this.element.style.top=b.top+"px";this.element.style.height=b.height+"px";this.element.style.lineHeight=b.height+"px";this.element.style.left=b.left+"px";this.element.style.width=b.width+"px"};h.prototype.update=
function(b){this.choice=b&&b.choice!=null?b.choice:0;var b=this._getCompleterTemplateData(),a=this.template.cloneNode(!0);k.template(a,b,{stack:"completer.html"});for(d.clearElement(this.element);a.hasChildNodes();)this.element.appendChild(a.firstChild)};h.prototype._getCompleterTemplateData=function(){var b=f.defer(),a=f.defer(),d=f.defer(),c=this.inputter.getInputState(),i=this.requisition.getAssignmentAt(c.cursor.start),h=void 0;c.typed.trim().length!==0&&(h=i.getPredictionAt(this.choice));f.resolve(h).then(function(f){var h=
"",k="",j=[];if(c.typed.trim().length!==0){var l=i.arg;if(f){if(f=f.name,l=l.text,i.isInName()&&(f=" "+f),l!==f){var m=l.replace(/^\s*/,"");f.indexOf(m)===0&&c.cursor.start===c.typed.length?(m=l.match(/^(\s*)/)[0].length,h=f.slice(l.length-m)):k="\u21e5 "+f}}else l.type==="NamedArgument"&&l.text===""&&j.push("<"+i.param.type.name+">\u00a0")}h!==""?h+="\u00a0":this.requisition.typedEndsWithSeparator()||j.unshift("\u00a0");this.requisition.getAssignments().forEach(function(a){a.param.isPositionalAllowed&&
a.arg.toString().trim()===""&&(h!==""&&i===a||j.push(a.param.isDataRequired?"<"+a.param.name+">\u00a0":"["+a.param.name+"]\u00a0"))}.bind(this));var f=this.requisition.commandAssignment.value,r=!1;f&&f.hasNamedParameters&&f.params.forEach(function(a){var b=this.requisition.getAssignment(a.name).arg;!a.isPositionalAllowed&&!a.hidden&&b.type==="BlankArgument"&&(r=!0)},this);r&&j.push("[options]\u00a0");b.resolve(h);a.resolve(k);d.resolve(j)}.bind(this),console.error);return{statusMarkup:this._getStatusMarkup(c),
unclosedJs:this._getUnclosedJs(),scratchLink:this._getScratchLink(),directTabText:b.promise,arrowTabText:a.promise,emptyParameters:d.promise}};h.prototype._getStatusMarkup=function(b){b=this.requisition.getInputStatusMarkup(b.cursor.start);b.forEach(function(a){a.string=a.string.replace(/ /g,"\u00a0");a.className="gcli-in-"+a.status.toString().toLowerCase()},this);return b};h.prototype._getUnclosedJs=function(){var b=this.requisition.commandAssignment.value;return b&&b.name==="{"&&this.requisition.getAssignment(0).arg.suffix.indexOf("}")===
-1};h.prototype._getScratchLink=function(){var b=this.requisition.commandAssignment.value;return this.scratchpad&&b&&b.name==="{"?this.scratchpad.linkText:""};j.Completer=h});
define("gcli/ui/prompt",["require","exports","module"],function(l,j){function h(f,d){this.element=d.element;this.element.classList.add("gcli-prompt");this.element.appendChild(this.element.ownerDocument.createTextNode(f.promptChar||"\u00bb"));if(this.inputter=d.inputter){this.inputter.onResize.add(this.resized,this);var h=this.inputter.getDimensions();h&&this.resized(h)}}h.prototype.destroy=function(){this.inputter&&this.inputter.onResize.remove(this.resized,this);delete this.element};h.prototype.resized=
function(f){this.element.style.top=f.top+"px";this.element.style.height=f.height+"px";this.element.style.left=f.left+"px";this.element.style.width=f.width+"px"};j.Prompt=h});define("text!gcli/ui/display.css",[],function(){return"\n.gcli-output {\n  height: 100%;\n  overflow-x: hidden;\n  overflow-y: auto;\n  font-family: Segoe UI, Helvetica Neue, Verdana, Arial, sans-serif;\n}"});define("text!gcli/ui/display.html",[],function(){return'\n<div class="gcli-panel" save="${panel}">\n  <div save="${tooltip}"></div>\n  <div class="gcli-panel-connector"></div>\n</div>'});
define("gcli/ui/display","require,exports,module,util/util,util/domtemplate,gcli/settings,gcli/canon,gcli/cli,gcli/ui/intro,gcli/ui/tooltip,gcli/ui/output_terminal,gcli/ui/inputter,gcli/ui/completer,gcli/ui/focus,gcli/ui/prompt,text!gcli/ui/display.css,text!gcli/ui/display.html".split(","),function(l,j){function h(g){var h=g.document||document;this.displayStyle=void 0;if(u!=null)this.displayStyle=k.importCss(u,h,"gcli-css-display");this.commandOutputManager=g.commandOutputManager;if(this.commandOutputManager==
null)this.commandOutputManager=new a;this.requisition=new e(g.environment||{},h,this.commandOutputManager);this.focusManager=new p(g,{document:h,requisition:this.requisition});this.inputElement=f(h,g.inputElement||null,"gcli-input");this.inputter=new o(g,{requisition:this.requisition,focusManager:this.focusManager,element:this.inputElement});this.completeElement=d(this.inputElement,g.completeElement||null,"gcli-row-complete");this.completer=new n(g,{requisition:this.requisition,inputter:this.inputter,
autoResize:this.completeElement.gcliCreated,element:this.completeElement});this.prompt=new t(g,{inputter:this.inputter,element:d(this.inputElement,g.promptElement||null,"gcli-prompt")});this.element=f(h,g.displayElement||null,"gcli-display");this.element.classList.add("gcli-display");this.template=k.toDom(h,v);this.elements={};b.template(this.template,this.elements,{stack:"display.html"});this.element.appendChild(this.template);this.tooltip=new i(g,{requisition:this.requisition,inputter:this.inputter,
focusManager:this.focusManager,element:this.elements.tooltip,panelElement:this.elements.panel});this.inputter.tooltip=this.tooltip;this.outputElement=k.createElement(h,"div");this.outputElement.classList.add("gcli-output");this.outputList=new m(g,{requisition:this.requisition,element:this.outputElement});this.element.appendChild(this.outputElement);c.maybeShowIntro(this.commandOutputManager,this.requisition)}function f(a,b,c){if(!b&&(b=a.getElementById(c),!b))throw Error("Missing element, id="+c);
return b}function d(a,b){var c=a.ownerDocument;if(!b&&(b=c.getElementById("gcli-row-complete"),!b))b=k.createElement(c,"div"),a.parentNode.insertBefore(b,a.nextSibling),b.gcliCreated=!0;return b}var k=l("util/util"),b=l("util/domtemplate"),g=l("gcli/settings"),a=l("gcli/canon").CommandOutputManager,e=l("gcli/cli").Requisition,c=l("gcli/ui/intro"),i=l("gcli/ui/tooltip").Tooltip,m=l("gcli/ui/output_terminal").OutputTerminal,o=l("gcli/ui/inputter").Inputter,n=l("gcli/ui/completer").Completer,p=l("gcli/ui/focus").FocusManager,
t=l("gcli/ui/prompt").Prompt,u=l("text!gcli/ui/display.css"),v=l("text!gcli/ui/display.html");j.createDisplay=function(a){a.settings!=null&&g.setDefaults(a.settings);var a=new h(a),b=a.requisition;return{exec:b.exec.bind(b),update:b.update.bind(b),updateExec:b.updateExec.bind(b),destroy:a.destroy.bind(a)}};h.prototype.destroy=function(){delete this.element;delete this.template;this.outputList.destroy();delete this.outputList;delete this.outputElement;this.tooltip.destroy();delete this.tooltip;this.prompt.destroy();
delete this.prompt;this.completer.destroy();delete this.completer;delete this.completeElement;this.inputter.destroy();delete this.inputter;delete this.inputElement;this.focusManager.destroy();delete this.focusManager;this.requisition.destroy();delete this.requisition;this.displayStyle&&this.displayStyle.parentNode.removeChild(this.displayStyle);delete this.displayStyle};j.Display=h});
define("gcli/index","require,exports,module,util/legacy,gcli/canon,gcli/canon,gcli/types/basic,gcli/types/command,gcli/types/javascript,gcli/types/node,gcli/types/resource,gcli/types/selection,gcli/types/setting,gcli/settings,gcli/cli,gcli/ui/intro,gcli/ui/focus,gcli/ui/fields/basic,gcli/ui/fields/javascript,gcli/ui/fields/selection,gcli/ui/display".split(","),function(l,j){l("util/legacy");j.addCommand=l("gcli/canon").addCommand;j.removeCommand=l("gcli/canon").removeCommand;l("gcli/types/basic").startup();
l("gcli/types/command").startup();l("gcli/types/javascript").startup();l("gcli/types/node").startup();l("gcli/types/resource").startup();l("gcli/types/selection").startup();l("gcli/types/setting").startup();l("gcli/settings").startup();l("gcli/cli").startup();l("gcli/ui/intro").startup();l("gcli/ui/focus").startup();l("gcli/ui/fields/basic").startup();l("gcli/ui/fields/javascript").startup();l("gcli/ui/fields/selection").startup();var h=l("gcli/ui/display");j.createDisplay=function(f){return h.createDisplay(f||
{})};j.createView=j.createDisplay});define("text!gcli/commands/help_man.html",[],function(){return'\n<div>\n  <h3>${command.name}</h3>\n\n  <h4 class="gcli-help-header">\n    ${l10n.helpManSynopsis}:\n    <span class="gcli-out-shortcut" onclick="${onclick}" data-command="${command.name}">\n      ${command.name}\n      <span foreach="param in ${command.params}">\n        ${param.defaultValue !== undefined ? \'[\' + param.name + \']\' : param.name}\n      </span>\n    </span>\n  </h4>\n\n  <h4 class="gcli-help-header">${l10n.helpManDescription}:</h4>\n\n  <p class="gcli-help-description">${describe(command)}</p>\n\n  <div if="${command.exec}">\n    <h4 class="gcli-help-header">${l10n.helpManParameters}:</h4>\n\n    <ul class="gcli-help-parameter">\n      <li if="${command.params.length === 0}">${l10n.helpManNone}</li>\n      <li foreach="param in ${command.params}">\n        ${param.name} <em>${getTypeDescription(param)}</em>\n        <br/>\n        ${describe(param)}\n      </li>\n    </ul>\n  </div>\n\n  <div if="${!command.exec}">\n    <h4 class="gcli-help-header">${l10n.subCommands}:</h4>\n\n    <ul class="gcli-help-${subcommands}">\n      <li if="${subcommands.length === 0}">${l10n.subcommandsNone}</li>\n      <li foreach="subcommand in ${subcommands}">\n        <strong>${subcommand.name}</strong>:\n        ${subcommand.description}\n        <span class="gcli-out-shortcut" data-command="help ${subcommand.name}"\n            onclick="${onclick}" ondblclick="${ondblclick}">\n          help ${subcommand.name}\n        </span>\n      </li>\n    </ul>\n  </div>\n\n</div>'});
define("text!gcli/commands/help_list.html",[],function(){return'\n<div>\n  <div if="${includeIntro}">\n    <h2>Welcome to GCLI</h2>\n    <p>GCLI is an experiment to create a highly usable JavaScript command line for developers.</p>\n    <p>\n      Useful links:\n      <a href=\'https://github.com/joewalker/gcli\'>Source</a> (Apache-2.0),\n      <a href=\'https://github.com/joewalker/gcli/blob/master/docs/index.md\'>Documentation</a> (for users/embedders),\n      <a href=\'https://wiki.mozilla.org/DevTools/Features/GCLI\'>Mozilla feature page</a> (for GCLI in the web console).\n    </p>\n  </div>\n\n  <h3>${heading}</h3>\n\n  <table>\n    <tr foreach="command in ${matchingCommands}">\n      <th class="gcli-help-name">${command.name}</th>\n      <td class="gcli-help-arrow">-</td>\n      <td>\n        ${command.description}\n        <span class="gcli-out-shortcut"\n            onclick="${onclick}" ondblclick="${ondblclick}"\n            data-command="help ${command.name}">help ${command.name}</span>\n      </td>\n    </tr>\n  </table>\n</div>'});
define("text!gcli/commands/help.css",[],function(){return"\n.gcli-help-name {\n  text-align: end;\n}\n\n.gcli-help-arrow {\n  color: #AAA;\n}\n\n.gcli-help-description {\n  margin: 0 20px;\n  padding: 0;\n}\n\n.gcli-help-parameter {\n  margin: 0 30px;\n  padding: 0;\n}\n\n.gcli-help-header {\n  margin: 10px 0 6px;\n}"});
define("gcli/commands/help","require,exports,module,util/util,util/l10n,gcli/canon,gcli/ui/view,text!gcli/commands/help_man.html,text!gcli/commands/help_list.html,text!gcli/commands/help.css".split(","),function(l,j){function h(a,c){var f=b.getCommands().filter(function(b){return b.hidden?!1:a.search&&b.name.indexOf(a.search)!==0?!1:!a.search&&b.name.indexOf(" ")!=-1?!1:!0});f.sort(function(a,b){return a.name.localeCompare(b.name)});var g;g=f.length===0?k.lookupFormat("helpListNone",[a.search]):a.search==
null?k.lookup("helpListAll"):k.lookupFormat("helpListPrefix",[a.search]);return{l10n:k.propertyLookup,includeIntro:a.search==null,matchingCommands:f,heading:g,onclick:function(a){d.updateCommand(a.currentTarget,c)},ondblclick:function(a){d.executeCommand(a.currentTarget,c)}}}function f(a,c){var f={l10n:k.propertyLookup,command:a,onclick:function(a){d.updateCommand(a.currentTarget,c)},ondblclick:function(a){d.executeCommand(a.currentTarget,c)},describe:function(a){return a.manual||a.description},getTypeDescription:function(a){var b=
"",b=a.defaultValue===void 0?k.lookup("helpManRequired"):a.defaultValue===null?k.lookup("helpManOptional"):a.defaultValue;return"("+a.type.name+", "+b+")"}};Object.defineProperty(f,"subcommands",{get:function(){var c=b.getCommands().filter(function(b){return b.name.indexOf(a.name)===0&&b.name!==a.name});c.sort(function(a,b){return a.name.localeCompare(b.name)});return c},enumerable:!0});return f}var d=l("util/util"),k=l("util/l10n"),b=l("gcli/canon"),g=l("gcli/ui/view");j.helpManHtml=l("text!gcli/commands/help_man.html");
j.helpListHtml=l("text!gcli/commands/help_list.html");j.helpCss=l("text!gcli/commands/help.css");var a={name:"help",description:k.lookup("helpDesc"),manual:k.lookup("helpManual"),params:[{name:"search",type:"string",description:k.lookup("helpSearchDesc"),manual:k.lookup("helpSearchManual3"),defaultValue:null}],returnType:"html",exec:function(a,c){var d=b.getCommand(a.search||void 0);return d?g.createView({html:j.helpManHtml,options:{allowEval:!0,stack:"help_man.html"},data:f(d,c),css:j.helpCss,cssId:"gcli-help"}):
g.createView({html:j.helpListHtml,options:{allowEval:!0,stack:"help_list.html"},data:h(a,c),css:j.helpCss,cssId:"gcli-help"})}};j.startup=function(){b.addCommand(a)};j.shutdown=function(){b.removeCommand(a)}});
define("orion/shell/Shell","i18n!orion/widgets/nls/messages,orion/i18nUtil,gcli/index,gcli/types,gcli/types/selection,gcli/argument,gcli/ui/fields,gcli/ui/fields/menu,util/util,gcli/settings,gcli/canon,gcli/cli,gcli/commands/help,util/promise".split(","),function(l,j,h,f,d,k,b,g,a,e,c,i,m,o){function n(){}n.prototype=Object.create(d.SelectionType.prototype);var p;p={CompletionStatus:{MATCH:0,PARTIAL:1,ERROR:2}};p.Shell=function(){function d(a){this._init(a.input,a.output)}d.prototype={clear:function(){for(var a=
document.getElementsByClassName("gcli-output")[0];a.hasChildNodes();)a.removeChild(a.lastChild);this.output(j.formatMessage(l["For a list of available commands type '${0}'."],"<b>help</b>"))},output:function(a){var b=new i.Output;this.commandOutputManager.onOutput({output:b});b.complete(a)},registerCommand:function(a){if(!a.exec)a.exec=a.callback;if(!a.params)a.params=a.parameters;var b=function(a){return function(b,c){var d=a(b,c);this.registeredTypes.forEach(function(a){a.prototype.lastParseTimestamp=
0});return d}.bind(this)}.bind(this);if(a.exec)a.exec=b(a.exec);h.addCommand(a)},registerType:function(a){a=function(a){function b(a){this.typeSpec=a}b.prototype=Object.create(n.prototype);b.prototype.name=a.getName();b.prototype.lastParseTimestamp=0;b.prototype.parse=function(b){var c=Object.getPrototypeOf(this),d=c.lastParseTimestamp;c.lastParseTimestamp=Math.round((new Date).getTime()/1E3);c=JSON.parse(JSON.stringify(b));return a.parse(c,this.typeSpec,{lastParseTimestamp:d}).then(function(a){var c=
f.Status.VALID;if(a.status)switch(a.status){case p.CompletionStatus.ERROR:c=f.Status.ERROR;break;case p.CompletionStatus.PARTIAL:c=f.Status.INCOMPLETE}var d=o.defer();d.resolve(a.predictions);return new f.Conversion(a.value,b,c,a.message,d.promise)})};b.prototype.lookup=function(){var b=Object.getPrototypeOf(this),c=b.lastParseTimestamp;b.lastParseTimestamp=Math.round((new Date).getTime()/1E3);return a.parse({prefix:"",suffix:"",text:""},this.typeSpec,{lastParseTimestamp:c}).then(function(a){return a.predictions})};
if(a.stringify)b.prototype.stringify=function(b){return a.stringify(b,this.typeSpec)};return b}(a);f.registerType(a);this.registeredTypes.push(a)},setFocusToInput:function(){this.inputText.focus()},setInputText:function(a){if(a)this.inputText.value=a.toString()},addField:function(){},_init:function(d,f){function i(c,d){b.Field.call(this,c,d);this.isImportant=!0;this.element=a.createElement(this.document,"div");this.element.className="orion";this.menu=new g.Menu({document:this.document,field:!0,type:c});
this.menu.onItemClick=this.onItemClick.bind(this);this.element.appendChild(this.menu.element);this.onFieldChange=a.createEvent("CustomField.fieldChanged");this.onInputChange=this.onInputChange.bind(this)}this.registeredTypes=[];var k=document.createElement("div");k.id="gcli-display";k.style.height="100%";k.style.width="100%";f.appendChild(k);this.inputText=document.createElement("input");this.inputText.type="text";this.inputText.id="gcli-input";this.inputText.style.width="100%";this.inputText.style.height=
"100%";d.appendChild(this.inputText);e.getSetting("hideIntro").value=!0;e.getSetting("eagerHelper").value=2;setTimeout(function(){this.commandOutputManager=new c.CommandOutputManager;h.createDisplay({commandOutputManager:this.commandOutputManager});this.output(j.formatMessage(l["For a list of available commands type '${0}'."],"<b>help</b>"))}.bind(this),1);m.startup();m.helpListHtml=m.helpListHtml.replace('"${includeIntro}"',"${false}");i.prototype=Object.create(b.Field.prototype);i.prototype.destroy=
function(){b.Field.prototype.destroy.call(this);this.menu.destroy();delete this.element;delete this.menu;delete this.document;delete this.onInputChange};i.prototype.setConversion=function(a){this.setMessage(a.message);var b=[];a.getPredictions().forEach(function(a){a.hidden||b.push({name:a.name,complete:a.name,description:a.description||""})},this);this.menu.show(b);a.then&&a.then(function(){this.element&&this.setConversion(this.getConversion())}.bind(this))};i.prototype.onItemClick=function(a){a=
a.conversion;this.onFieldChange({conversion:a});this.setMessage(a.message)};i.claim=function(a){return a instanceof n?b.Field.MATCH+1:b.Field.NO_MATCH};b.addField(i)}};return d}();return p});
define("shell/shellPageFileService",["i18n!orion/shell/nls/messages","orion/bootstrap","orion/fileClient","orion/Deferred"],function(l,j,h,f){var d;d={};var k,b;j.startup().then(function(d){b=d.serviceRegistry;k=new h.FileClient(b)});d.ShellPageFileService=function(){function d(){this.currentDirectory=null;this.withNode(this.SEPARATOR,function(a){this.rootNode=a}.bind(this));this.currentRetrievals={}}d.prototype={SEPARATOR:"/",computePathString:function(a){if(a.Location===this.SEPARATOR)return this.SEPARATOR;
var b=this.SEPARATOR+k.fileServiceName(a.Location),c=a.Parents;if(c){b+=this.SEPARATOR;for(var d=c.length;--d>=0;)b+=c[d].Name,b+=this.SEPARATOR;b+=a.Name}a.Directory&&(b+=this.SEPARATOR);return b},createDirectory:function(a,b){return this._createResource(a,b,!0)},createFile:function(a,b){return this._createResource(a,b,!1)},ensureDirectory:function(a,b){var c=new f;typeof b!=="string"?b.Directory?c.resolve(b):c.reject(l["Cannot create directory, it already exists as a file"]):(a=a||this.getCurrentDirectory(),
this.withChildren(a,function(d){if(d)for(var f=0;f<d.length;f++)if(d[f].Name===b){d[f].Directory?c.resolve(d[f]):c.reject(l["Cannot create directory, it already exists as a file"]);return}this.createDirectory(a,b).then(function(a){c.resolve(a)},function(a){c.reject(a)})}.bind(this),function(a){c.reject(a)}));return c},ensureFile:function(a,b){var c=new f;typeof b!=="string"?b.Directory?c.reject(l["Cannot create file, it already exists as a directory"]):c.resolve(b):(a=a||this.getCurrentDirectory(),
this.withChildren(a,function(d){if(d)for(var f=0;f<d.length;f++)if(d[f].Name===b){d[f].Directory?c.reject(l["Cannot create file, it already exists as a directory"]):c.resolve(d[f]);return}this.createFile(a,b).then(function(a){c.resolve(a)},function(a){c.reject(a)})}.bind(this),function(a){c.reject(a)}));return c},getChild:function(a,b){if(b.length===0)return null;if(b===".")return a;if(b==="..")return this.getParent(a);if(!a.Children)return null;for(var c=0;c<a.Children.length;c++)if(a.Children[c].Name===
b)return a.Children[c];return null},getCurrentDirectory:function(){return this.currentDirectory},getDirectory:function(a,b){if(b.indexOf(this.SEPARATOR)===0)a=this.rootNode,b=b.substring(1);else if(!a){if(!this.currentDirectory)return null;a=this.currentDirectory}for(var c=b.substring(0,b.lastIndexOf(this.SEPARATOR)).split(this.SEPARATOR),d=a,f=0;f<c.length;f++)if(c[f].length>0&&(d=this.getChild(d,c[f]),!d||!d.Directory))return null;c=b.substring(b.lastIndexOf(this.SEPARATOR)+1);(c=this.getChild(d,
c))&&this._retrieveNode(c);d.Children||this._retrieveNode(d);return d},getParent:function(a){a.parent&&this._retrieveNode(a.parent);return a.parent},loadWorkspace:function(a){var d=b.getService("orion.page.progress");return d?d.progress(k.loadWorkspace(a),"Loading workspace "+a):k.loadWorkspace(a)},read:function(a){return k.read(a.Location,!1)},readBlob:function(a){var b=k._getService(a.Location);return!b.readBlob?(a=new f,a.reject(l["Source file service does not support binary read"]),a):b.readBlob(a.Location)},
setCurrentDirectory:function(a){this.currentDirectory=a;this._retrieveNode(a)},withChildren:function(a,d,c){if(a.Children)d&&d(a.Children);else if(a.ChildrenLocation){var f=b.getService("orion.page.progress");(f?f.progress(k.fetchChildren(a.ChildrenLocation),"Getting children of "+a.Name):k.fetchChildren(a.ChildrenLocation)).then(function(b){this._sort(b);var c=a.Parents?a.Parents.slice(0):[];c.unshift(a);for(var f=0;f<b.length;f++)b[f].parent=a,b[f].Parents=c;a.Children=b;d&&d(b)}.bind(this),function(a){c&&
c(a)})}else d&&d(null)},withNode:function(a,d,c){var f=b.getService("orion.page.progress");(f?f.progress(k.loadWorkspace(a),"Loading workspace "+a):k.loadWorkspace(a)).then(function(a){this._retrieveNode(a,d,c)}.bind(this),c)},write:function(a,b){return k.write(a.Location,b)},writeBlob:function(a,b){var c=k._getService(a.Location);return!c.writeBlob?(c=new f,c.reject(l["Target file service does not support binary write"]),c):c.writeBlob(a.Location,b)},_createResource:function(a,b,c){var d=a.Location+
this.SEPARATOR+b,g=new f,h=this.currentRetrievals[d]||[];h.push(g);if(h.length===1){this.currentRetrievals[d]=h;var j=function(a){if(c)a.Name=b;this.currentRetrievals[d].forEach(function(b){b.resolve(a)});delete this.currentRetrievals[d]}.bind(this),l=function(a){this.currentRetrievals[d].forEach(function(b){b.reject(a.responseText)});delete this.currentRetrievals[d]}.bind(this);c?a.Projects?k.createProject(a.Location,b).then(function(a){k.read(a.ContentLocation,!0).then(j,l)},l):k.createFolder(a.Location,
b).then(j,l):k.createFile(a.Location,b).then(j,l)}return g},_retrieveNode:function(a,d,c){if(a.parent&&a.Children)d&&d(a);else{var f=function(a,b,c){a.Directory&&!a.Children?this.withChildren(a,function(){b&&b(a)},c):b&&b(a)}.bind(this),g=function(a,c,d){if(a.Location===this.SEPARATOR)c(a);else if(a.Parents)if(a.Parents.length===0){var e=k.fileServiceRootURL(a.Location),f=b.getService("orion.page.progress");(f?f.progress(k.loadWorkspace(e),"Loading workspace "+e):k.loadWorkspace(e)).then(function(b){b.parent=
this.rootNode;a.parent=b;c(a)}.bind(this),d)}else{a.parent=a.Parents[0];for(d=0;d<a.Parents.length-1;d++)a.Parents[d].parent=a.Parents[d+1],a.Parents[d].Directory=!0;c(a)}else a.parent=this.rootNode,c(a)}.bind(this);if(!a.Parents&&!a.Projects&&a.Location!==this.SEPARATOR&&a.Name!==k.fileServiceName(a.Location)){var h=b.getService("orion.page.progress");(h?h.progress(k.loadWorkspace(a.Location),"Loading workspace "+a.Location):k.loadWorkspace(a.Location)).then(function(b){a.Parents=b.Parents;g(a,function(a){f(a,
d,c)},function(){f(a,d,c)})})}else{if(a.ChildrenLocation)a.Directory=!0;g(a,function(a){f(a,d,c)},function(){f(a,d,c)})}}},_sort:function(a){a.sort(function(a,b){if(a.Directory!==b.Directory)return a.Directory?-1:1;var d=a.Name&&a.Name.toLowerCase(),f=b.Name&&b.Name.toLowerCase();return d<f?-1:d>f?1:0})}};return d}();return d});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(l){return{detectValidURL:function(j){for(var h=/\[([^\]]*)\]\(([^\)]+)\)/g,f=h.exec(j),d=[],k=0;f;){if(f.length===3&&f[2].length>0){var b=new URL(f[2]);b.protocol!==":"&&l.validateURLScheme(b.href)&&(f.index>k&&d.push({segmentStr:j.substring(k,f.index)}),d.push({segmentStr:f[1].length>0?f[1]:f[2],urlStr:f[2]}),k=f.index+f[0].length)}f=h.exec(j)}if(k===0)return null;k<j.length-1&&d.push({segmentStr:j.substring(k)});return d},processURLSegments:function(j,
h){h.forEach(function(f){if(f.urlStr){var d=document.createElement("a");d.href=f.urlStr;d.appendChild(document.createTextNode(f.segmentStr))}else d=document.createElement("span"),d.textContent=f.segmentStr;j.appendChild(d)})}}});
(function(){function l(b){this.tokens=[];this.tokens.links={};this.options=b||g.defaults;this.rules=a.normal;if(this.options.gfm)this.rules=this.options.tables?a.tables:a.gfm}function j(a,b){this.options=b||g.defaults;this.links=a;this.rules=e.normal;if(!this.links)throw Error("Tokens array requires a `links` property.");if(this.options.gfm)this.rules=this.options.breaks?e.breaks:e.gfm;else if(this.options.pedantic)this.rules=e.pedantic}function h(a){this.tokens=[];this.token=null;this.options=a||
g.defaults}function f(a,b){return a.replace(!b?/&(?!#?\w+;)/g:/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function d(a,b){a=a.source;b=b||"";return function o(d,e){if(!d)return RegExp(a,b);e=e.source||e;e=e.replace(/(^|[^\[])\^/g,"$1");a=a.replace(d,e);return o}}function k(){}function b(a){for(var b=1,d,e;b<arguments.length;b++)for(e in d=arguments[b],d)Object.prototype.hasOwnProperty.call(d,e)&&(a[e]=d[e]);return a}function g(a,d,e){if(e||
typeof d==="function"){e||(e=d,d=null);d&&(d=b({},g.defaults,d));var k=d.highlight,j,p,t=0;try{j=l.lex(a,d)}catch(u){return e(u)}p=j.length;var v=function(a){var b,c;a!==!0&&delete d.highlight;try{b=h.parse(j,d)}catch(f){c=f}d.highlight=k;return c?e(c):e(null,b)};if(!k||k.length<3)return v(!0);if(!p)return v();for(;t<j.length;t++)(function(a){return a.type!=="code"?--p||v():k(a.text,a.lang,function(b,c){if(c==null||c===a.text)return--p||v();a.text=c;a.escaped=!0;--p||v()})})(j[t])}else try{return d&&
(d=b({},g.defaults,d)),h.parse(l.lex(a,d),d)}catch(r){r.message+="\nPlease report this to https://github.com/chjj/marked.";if((d||g.defaults).silent)return"<p>An error occured:</p><pre>"+f(r.message+"",!0)+"</pre>";throw r;}}var a={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:k,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:k,lheading:/^([^\n]+)\n *(=|-){3,} *\n*/,blockquote:/^( *>[^\n]+(\n[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:k,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/,bullet:/(?:[*+-]|\d+\.)/,item:/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/};a.item=d(a.item,"gm")(/bull/g,a.bullet)();a.list=d(a.list)(/bull/g,a.bullet)("hr",/\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/)();a._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|@)\\b";
a.html=d(a.html)("comment",/<\!--[\s\S]*?--\>/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,a._tag)();a.paragraph=d(a.paragraph)("hr",a.hr)("heading",a.heading)("lheading",a.lheading)("blockquote",a.blockquote)("tag","<"+a._tag)("def",a.def)();a.normal=b({},a);a.gfm=b({},a.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});a.gfm.paragraph=d(a.paragraph)("(?!","(?!"+a.gfm.fences.source.replace("\\1","\\2")+"|")();a.tables=
b({},a.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});l.rules=a;l.lex=function(a,b){return(new l(b)).lex(a)};l.prototype.lex=function(a){a=a.replace(/\r\n|\r/g,"\n").replace(/\t/g,"    ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(a,!0)};l.prototype.token=function(b,d){for(var b=b.replace(/^ +$/gm,""),e,f,g,h,k,j,l;b;){if(g=this.rules.newline.exec(b))b=b.substring(g[0].length),g[0].length>
1&&this.tokens.push({type:"space"});if(g=this.rules.code.exec(b))b=b.substring(g[0].length),g=g[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:!this.options.pedantic?g.replace(/\n+$/,""):g});else if(g=this.rules.fences.exec(b))b=b.substring(g[0].length),this.tokens.push({type:"code",lang:g[2],text:g[3]});else if(g=this.rules.heading.exec(b))b=b.substring(g[0].length),this.tokens.push({type:"heading",depth:g[1].length,text:g[2]});else if(d&&(g=this.rules.nptable.exec(b))){b=b.substring(g[0].length);
k={type:"table",header:g[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:g[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:g[3].replace(/\n$/,"").split("\n")};for(j=0;j<k.align.length;j++)k.align[j]=/^ *-+: *$/.test(k.align[j])?"right":/^ *:-+: *$/.test(k.align[j])?"center":/^ *:-+ *$/.test(k.align[j])?"left":null;for(j=0;j<k.cells.length;j++)k.cells[j]=k.cells[j].split(/ *\| */);this.tokens.push(k)}else if(g=this.rules.lheading.exec(b))b=b.substring(g[0].length),this.tokens.push({type:"heading",
depth:g[2]==="="?1:2,text:g[1]});else if(g=this.rules.hr.exec(b))b=b.substring(g[0].length),this.tokens.push({type:"hr"});else if(g=this.rules.blockquote.exec(b))b=b.substring(g[0].length),this.tokens.push({type:"blockquote_start"}),g=g[0].replace(/^ *> ?/gm,""),this.token(g,d),this.tokens.push({type:"blockquote_end"});else if(g=this.rules.list.exec(b)){b=b.substring(g[0].length);h=g[2];this.tokens.push({type:"list_start",ordered:h.length>1});g=g[0].match(this.rules.item);e=!1;l=g.length;for(j=0;j<
l;j++)k=g[j],f=k.length,k=k.replace(/^ *([*+-]|\d+\.) +/,""),~k.indexOf("\n ")&&(f-=k.length,k=!this.options.pedantic?k.replace(RegExp("^ {1,"+f+"}","gm"),""):k.replace(/^ {1,4}/gm,"")),this.options.smartLists&&j!==l-1&&(f=a.bullet.exec(g[j+1])[0],h!==f&&!(h.length>1&&f.length>1)&&(b=g.slice(j+1).join("\n")+b,j=l-1)),f=e||/\n\n(?!\s*$)/.test(k),j!==l-1&&(e=k[k.length-1]==="\n",f||(f=e)),this.tokens.push({type:f?"loose_item_start":"list_item_start"}),this.token(k,!1),this.tokens.push({type:"list_item_end"});
this.tokens.push({type:"list_end"})}else if(g=this.rules.html.exec(b))b=b.substring(g[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:g[1]==="pre"||g[1]==="script",text:g[0]});else if(d&&(g=this.rules.def.exec(b)))b=b.substring(g[0].length),this.tokens.links[g[1].toLowerCase()]={href:g[2],title:g[3]};else if(d&&(g=this.rules.table.exec(b))){b=b.substring(g[0].length);k={type:"table",header:g[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:g[2].replace(/^ *|\| *$/g,
"").split(/ *\| */),cells:g[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(j=0;j<k.align.length;j++)k.align[j]=/^ *-+: *$/.test(k.align[j])?"right":/^ *:-+: *$/.test(k.align[j])?"center":/^ *:-+ *$/.test(k.align[j])?"left":null;for(j=0;j<k.cells.length;j++)k.cells[j]=k.cells[j].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(k)}else if(d&&(g=this.rules.paragraph.exec(b)))b=b.substring(g[0].length),this.tokens.push({type:"paragraph",text:g[1][g[1].length-1]==="\n"?g[1].slice(0,-1):
g[1]});else if(g=this.rules.text.exec(b))b=b.substring(g[0].length),this.tokens.push({type:"text",text:g[0]});else if(b)throw Error("Infinite loop on byte: "+b.charCodeAt(0));}return this.tokens};var e={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:k,tag:/^<\!--[\s\S]*?--\>|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:k,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/,_inside:/(?:\[[^\]]*\]|[^\]]|\](?=[^\[]*\]))*/,_href:/\s*<?([^\s]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/};e.link=d(e.link)("inside",e._inside)("href",e._href)();e.reflink=d(e.reflink)("inside",e._inside)();e.normal=b({},e);e.pedantic=b({},e.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});
e.gfm=b({},e.normal,{escape:d(e.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:d(e.text)("]|","~]|")("|","|https?://|")()});e.breaks=b({},e.gfm,{br:d(e.br)("{2,}","*")(),text:d(e.gfm.text)("{2,}","*")()});j.rules=e;j.output=function(a,b,d){return(new j(b,d)).output(a)};j.prototype.output=function(a){var i;var c;for(var b="",d,e;a;)if(e=this.rules.escape.exec(a))a=a.substring(e[0].length),b+=e[1];else if(e=this.rules.autolink.exec(a))a=a.substring(e[0].length),
e[2]==="@"?(d=e[1][6]===":"?this.mangle(e[1].substring(7)):this.mangle(e[1]),e=this.mangle("mailto:")+d):(c=d=f(e[1]),e=c),b+='<a href="'+e+'">'+d+"</a>";else if(e=this.rules.url.exec(a))a=a.substring(e[0].length),i=d=f(e[1]),e=i,b+='<a href="'+e+'">'+d+"</a>";else if(e=this.rules.tag.exec(a))a=a.substring(e[0].length),b+=this.options.sanitize?f(e[0]):e[0];else if(e=this.rules.link.exec(a))a=a.substring(e[0].length),b+=this.outputLink(e,{href:e[2],title:e[3]});else if((e=this.rules.reflink.exec(a))||
(e=this.rules.nolink.exec(a)))a=a.substring(e[0].length),d=(e[2]||e[1]).replace(/\s+/g," "),d=this.links[d.toLowerCase()],!d||!d.href?(b+=e[0][0],a=e[0].substring(1)+a):b+=this.outputLink(e,d);else if(e=this.rules.strong.exec(a))a=a.substring(e[0].length),b+="<strong>"+this.output(e[2]||e[1])+"</strong>";else if(e=this.rules.em.exec(a))a=a.substring(e[0].length),b+="<em>"+this.output(e[2]||e[1])+"</em>";else if(e=this.rules.code.exec(a))a=a.substring(e[0].length),b+="<code>"+f(e[2],!0)+"</code>";
else if(e=this.rules.br.exec(a))a=a.substring(e[0].length),b+="<br>";else if(e=this.rules.del.exec(a))a=a.substring(e[0].length),b+="<del>"+this.output(e[1])+"</del>";else if(e=this.rules.text.exec(a))a=a.substring(e[0].length),b+=f(this.smartypants(e[0]));else if(a)throw Error("Infinite loop on byte: "+a.charCodeAt(0));return b};j.prototype.outputLink=function(a,b){return a[0][0]!=="!"?'<a href="'+f(b.href)+'"'+(b.title?' title="'+f(b.title)+'"':"")+">"+this.output(a[1])+"</a>":'<img src="'+f(b.href)+
'" alt="'+f(a[1])+'"'+(b.title?' title="'+f(b.title)+'"':"")+">"};j.prototype.smartypants=function(a){return!this.options.smartypants?a:a.replace(/--/g,"\u2014").replace(/'([^']*)'/g,"\u2018$1\u2019").replace(/"([^"]*)"/g,"\u201c$1\u201d").replace(/\.{3}/g,"\u2026")};j.prototype.mangle=function(a){for(var b="",d=a.length,e=0,f;e<d;e++)f=a.charCodeAt(e),Math.random()>0.5&&(f="x"+f.toString(16)),b+="&#"+f+";";return b};h.parse=function(a,b){return(new h(b)).parse(a)};h.prototype.parse=function(a){this.inline=
new j(a.links,this.options);this.tokens=a.reverse();for(a="";this.next();)a+=this.tok();return a};h.prototype.next=function(){return this.token=this.tokens.pop()};h.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};h.prototype.parseText=function(){for(var a=this.token.text;this.peek().type==="text";)a+="\n"+this.next().text;return this.inline.output(a)};h.prototype.tok=function(){switch(this.token.type){case "space":return"";case "hr":return"<hr>\n";case "heading":return"<h"+
this.token.depth+">"+this.inline.output(this.token.text)+"</h"+this.token.depth+">\n";case "code":if(this.options.highlight){var a=this.options.highlight(this.token.text,this.token.lang);if(a!=null&&a!==this.token.text)this.token.escaped=!0,this.token.text=a}if(!this.token.escaped)this.token.text=f(this.token.text,!0);return"<pre><code"+(this.token.lang?' class="'+this.options.langPrefix+this.token.lang+'"':"")+">"+this.token.text+"</code></pre>\n";case "table":var a="",b,d,e,g;a+="<thead>\n<tr>\n";
for(d=0;d<this.token.header.length;d++)b=this.inline.output(this.token.header[d]),a+=this.token.align[d]?'<th align="'+this.token.align[d]+'">'+b+"</th>\n":"<th>"+b+"</th>\n";a+="</tr>\n</thead>\n";a+="<tbody>\n";for(d=0;d<this.token.cells.length;d++){b=this.token.cells[d];a+="<tr>\n";for(g=0;g<b.length;g++)e=this.inline.output(b[g]),a+=this.token.align[g]?'<td align="'+this.token.align[g]+'">'+e+"</td>\n":"<td>"+e+"</td>\n";a+="</tr>\n"}a+="</tbody>\n";return"<table>\n"+a+"</table>\n";case "blockquote_start":for(a=
"";this.next().type!=="blockquote_end";)a+=this.tok();return"<blockquote>\n"+a+"</blockquote>\n";case "list_start":d=this.token.ordered?"ol":"ul";for(a="";this.next().type!=="list_end";)a+=this.tok();return"<"+d+">\n"+a+"</"+d+">\n";case "list_item_start":for(a="";this.next().type!=="list_item_end";)a+=this.token.type==="text"?this.parseText():this.tok();return"<li>"+a+"</li>\n";case "loose_item_start":for(a="";this.next().type!=="list_item_end";)a+=this.tok();return"<li>"+a+"</li>\n";case "html":return!this.token.pre&&
!this.options.pedantic?this.inline.output(this.token.text):this.token.text;case "paragraph":return"<p>"+this.inline.output(this.token.text)+"</p>\n";case "text":return"<p>"+this.parseText()+"</p>\n"}};k.exec=k;g.options=g.setOptions=function(a){b(g.defaults,a);return g};g.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1};g.Parser=h;g.parser=h.parse;g.Lexer=l;g.lexer=l.lex;g.InlineLexer=j;g.inlineLexer=j.output;g.parse=
g;typeof exports==="object"?module.exports=g:typeof define==="function"&&define.amd?define("marked/marked",[],function(){return g}):this.marked=g}).call(function(){return this||(typeof window!=="undefined"?window:global)}());
define("shell/resultWriters",["orion/Deferred","orion/urlUtils","marked/marked"],function(l,j,h){var f;f={};f.FileBlobWriter=function(){function d(d,b){this.destination=d;this.shellPageFileService=b;this.blobs=[]}d.prototype={addBlob:function(d){this.blobs.push(d)},write:function(){var d=new l;this.shellPageFileService.ensureFile(null,this.destination).then(function(b){this.shellPageFileService.writeBlob(b,this.blobs[0]).then(function(){d.resolve()},function(b){d.reject(b)})}.bind(this),function(b){d.reject(b)});
return d}};return d}();f.FileStringWriter=function(){function d(d,b){this.destination=d;this.shellPageFileService=b}d.prototype={write:function(d){var b=new l;this.shellPageFileService.ensureFile(null,this.destination).then(function(f){this.shellPageFileService.write(f,d).then(function(){b.resolve()},function(a){b.reject(a)})}.bind(this),function(d){b.reject(d)});return b}};return d}();f.ShellBlobWriter=function(){function d(d){this.rootElement=d;this.blobCount=0}d.prototype={addBlob:function(){this.blobCount++},
write:function(){var d=new l,b=document.createElement("span");b.textContent="("+this.blobCount+" blobs)";this.rootElement.appendChild(b);d.resolve();return d}};return d}();f.ShellStringWriter=function(){function d(d,b){this.rootElement=d;this.processMarkdown=b}d.prototype={write:function(d){var b=document.createElement("div");if(this.processMarkdown)b.innerHTML=h(d,{sanitize:!0,breaks:!0});else{this.rootElement.className+=" string-result-output";var f=j.detectValidURL(d);f?j.processURLSegments(b,
f):b.textContent=d}for(d=b.childNodes;d.length>0;)this.rootElement.appendChild(d[0]);d=new l;d.resolve();return d}};return d}();return f});
define("shell/paramType-file",["i18n!orion/shell/nls/messages","orion/shell/Shell","orion/i18nUtil","orion/Deferred","shell/resultWriters"],function(l,j,h,f,d){function k(b,a,d,c){this.value=b;this.typeSpec=a;this.typedPath=d;this.shellPageFileService=c}var b;b={};k.prototype={getPluginRepresentation:function(){var b=new f;if(typeof this.value==="string")b.resolve({file:{path:this.value}});else{var a=0,d=this.value.slice(0),c=[],i=function(f){f&&c.push(f);a===0&&d.length===0&&(this.typeSpec.multiple?
b.resolve(c):b.resolve(c[0]))}.bind(this),h=function(){for(;d.length>0;){var b=d[0],c=this.shellPageFileService.getCurrentDirectory(),f=c.Parents;if((!f||f.length===0)&&c.parent)f=[c.parent];f=f?f.slice(0):[];if(f.length>0)for(var g=f[f.length-1].parent;g;)f.push(g),g=g.parent;f.splice(0,0,c);c=f.length-1;g=b.Parents;if((!g||g.length===0)&&b.parent)g=[b.parent];g=g?g.slice(0):[];if(g.length>0)for(var j=g[g.length-1].parent;j;)g.push(j),j=j.parent;g.splice(0,0,b);for(j=g.length-1;j>=0&&c>=0;)if(g[j].Location===
f[c].Location)j--,c--;else break;f="";if(b.Location.indexOf(g[j+1].Location)===0){for(var k=0;k<=c;k++)f+=".."+this.shellPageFileService.SEPARATOR;f+=b.Location.substring(g[j+1].Location.length)}else f=b.Location;f={isDirectory:b.Directory,path:f.length?f:"."};b.Directory&&this.typeSpec.multiple&&this.typeSpec.recurse&&function(b){a++;this.shellPageFileService.withChildren(b,function(c){a--;if(c.length===0)i();else{var f=b.recursePath?b.recursePath.slice(0):[];f.push(b.Name);var g=function(b){a--;
d.push(b);d.length===1&&h()};c.forEach(function(b){b.recursePath=f;a++;b.parent?g(b):this.shellPageFileService.withNode(b.Location,g,function(){a--;i()})}.bind(this))}}.bind(this),function(){a--;i()})}.call(this,b);d.splice(0,1);this.typeSpec.content&&!f.isDirectory?function(c){a++;this.shellPageFileService.readBlob(b).then(function(b){a--;c.blob=b;i(c)},function(){a--;i(c)})}.call(this,f):i(f)}}.bind(this);h()}return b},getValue:function(){return this.value},resourceExists:function(){return typeof this.value!==
"string"},stringify:function(){return this.typedPath}};b.ParamTypeFile=function(){function b(a){this.shellPageFileService=a}b.prototype={getName:function(){return"file"},parse:function(a,b){var c=new f;this._getPredictions(a.text).then(function(d){c.resolve(this._createCompletion(a.text,d,b))}.bind(this),function(a){c.error(a)});return c},processResult:function(a,b,c,f){var g=document.createElement("div"),j=0,k=function(b){this.callback=function(){var c=h.formatMessage(l["Wrote ${0}"],typeof b===
"string"?b:this.shellPageFileService.computePathString(b)),e=new d.ShellStringWriter(g);e.appendText(c);e.appendNewline();e.write();--j!==0||f?a.progress(g):a.resolve(g)}.bind(this);return this}.bind(this),p=function(b){this.callback=function(c){var e=h.formatMessage(l["Failed to write ${0}"],typeof b==="string"?b:this.shellPageFileService.computePathString(b));e+=" ["+c+"]";c=new d.ShellStringWriter(g);c.appendText(e);c.appendNewline();c.write();--j!==0||f?a.progress(g):a.resolve(g)}.bind(this);
return this}.bind(this),c=c||this.shellPageFileService.getCurrentDirectory();j++;this.shellPageFileService.ensureDirectory(null,c).then(function(a){j--;var c=b.getValue();b.isArray()||(c=[c]);c.forEach(function(b){j++;for(var c=b.path.split(this.shellPageFileService.SEPARATOR),e=0;e<c.length;){var f=c[e];if(f===".")c.splice(e,1);else if(f===".."){if(e===0){p(h.formatMessage(l["Cannot write ${0}, it is not a descendent of the output directory"],b.path));return}c.splice(e-- -1,2)}else e++}var g=function(a,
b,c){var e=c[0];c.splice(0,1);var f=this.shellPageFileService.computePathString(a)+this.shellPageFileService.SEPARATOR+e;c.length===0?b.isDirectory?this.shellPageFileService.ensureDirectory(a,e).then(k(f).callback,p(f).callback):this.shellPageFileService.ensureFile(a,e).then(function(a){var c=new d.FileBlobWriter(a,this.shellPageFileService);c.addBlob(b.blob);c.write().then(k(a).callback,p(a).callback)}.bind(this),p(f).callback):this.shellPageFileService.ensureDirectory(a,e).then(function(a){g(a,
b,c)},p(this.shellPageFileService.computePathString(a)+this.shellPageFileService.SEPARATOR+e).callback)}.bind(this);g(a,b,c)}.bind(this))}.bind(this),p(c).callback)},stringify:function(a){return!a?"":typeof a==="string"?a:a.stringify()},_createCompletion:function(a,b,c){if(!b)return{value:void 0,status:j.CompletionStatus.ERROR,message:h.formatMessage(l["'${0}' is not valid"],a),predictions:null};var d,f,g;if(c.exist===!1){var n;for(f=0;f<b.length;f++){var p=b[f];if(p.name===a){n=p;break}}n?(f=j.CompletionStatus.ERROR,
d=h.formatMessage(l["'${0}' already exists"],a)):(f=j.CompletionStatus.MATCH,g=new k(a,c,a,this.shellPageFileService));b=[]}else{var t=[];b.forEach(function(a){(a.value.Directory||c.file)&&t.push(a)});b=t;if(c.exist){var u=[];n=a.replace(/[\-(){}\[\]+,.\\\^$|#]/g,"\\$&");n=n.replace(/\?/g,".");n=n.replace(/\*/g,".*");var v=RegExp("^"+n+"$");b.forEach(function(a){a.name.match(v)&&(a.value.Directory&&c.directory||!a.value.Directory&&c.file)&&u.push(a.value)});c.multiple&&u.length||u.length===1?(f=j.CompletionStatus.MATCH,
g=new k(u,c,a,this.shellPageFileService)):b.length?f=j.CompletionStatus.PARTIAL:(f=j.CompletionStatus.ERROR,d=h.formatMessage(l["'${0}' is not valid"],a))}else{for(f=0;f<b.length;f++)if(p=b[f],p.name===a){n=p;break}f=j.CompletionStatus.MATCH;g=n?new k([n.value],c,a,this.shellPageFileService):new k(a,c,a,this.shellPageFileService)}}return{value:g,status:f,message:d,predictions:b}},_find:function(a,b){for(var c=0;c<a.length;c++)if(b(a[c]))return a[c];return null},_getPredictions:function(a){var b=new f,
c=this.shellPageFileService.getDirectory(null,a);c?this.shellPageFileService.withChildren(c,function(d){var f=a.lastIndexOf(this.shellPageFileService.SEPARATOR)+1,g=a.substring(0,f),h=a.substring(f),j=h.length===0||h===".",f=[],k=[];j&&f.push({name:g+".",value:c,incomplete:!0});if(j||h==="..")(j=this.shellPageFileService.getParent(c))&&f.push({name:g+"..",value:j,incomplete:!0});h.trim().length===0&&g.length>0&&f.push({name:g,value:c,incomplete:!1});for(var h=h.replace(/[\-(){}\[\]+,.\\\^$|#]/g,"\\$&"),
h=h.replace(/\?/g,"."),h=h.replace(/\*/g,".*"),j=RegExp("^"+h),l=0;l<d.length;l++){var v=d[l];if(v.Name.match(j)){var r=!v.Directory||v.Children&&v.Children.length===0,h=g+v.Name;v.Directory?f.push({name:h,value:v,incomplete:!r}):k.push({name:h,value:v,incomplete:!r})}}b.resolve(f.concat(k))}.bind(this),function(a){b.error(a)}):b.resolve(null);return b}};return b}();return b});
define("shell/paramType-plugin",["i18n!orion/shell/nls/messages","require","orion/shell/Shell","orion/i18nUtil","orion/Deferred"],function(l,j,h,f,d){var k;k={};var b=function(){function b(a,d){this.plugins=a;this.urlsToExclude=d}b.prototype={name:"all",getPluginLocations:function(){var a=[];this.plugins.forEach(function(b){b=b.getLocation();(!this.urlsToExclude||!this.urlsToExclude[b])&&a.push(b)}.bind(this));return a},isAllPlugin:function(){return!0},start:function(a){return this._invokeOnAllPlugins("start",
a)},stop:function(){return this._invokeOnAllPlugins("stop")},uninstall:function(){return this._invokeOnAllPlugins("uninstall")},update:function(){return this._invokeOnAllPlugins("update")},_invokeOnAllPlugins:function(a,b){var c=this.urlsToExclude?[]:this.plugins;this.urlsToExclude&&this.plugins.forEach(function(a){this.urlsToExclude[a.getLocation()]||c.push(a)}.bind(this));var f=new d,g=c.length,h=0;c.forEach(function(c){c[a](b).then(function(){++h===g&&f.resolve()},function(a){f.reject(a)})});return f}};
return b}();k.ParamTypePlugin=function(){function g(a){this.pluginRegistry=a;a.addEventListener("installed",function(){this._initPluginsList()}.bind(this));a.addEventListener("uninstalled",function(){this._initPluginsList()}.bind(this));a.addEventListener("stopping",function(){this._sort(this.plugins)}.bind(this));a.addEventListener("lazy activation",function(){this._sort(this.plugins)}.bind(this));window.setTimeout(function(){this._computeDefaultPlugins();this._initPluginsList()}.bind(this),1)}g.prototype=
{getName:function(){return"plugin"},getPlugins:function(){return this.plugins.slice(0)},parse:function(a,b){var c=new d,f=this._getPredictions(a.text,b);c.resolve(this._createCompletion(a.text,f));return c},stringify:function(a){return a.name},_defaultPluginUrls:{},_computeDefaultPlugins:function(){var a=localStorage.getItem("/orion/preferences/default/plugins");a&&(a=JSON.parse(a),Object.keys(a).forEach(function(a){var b=this._defaultPluginUrls;a=j.toUrl(a);if(a.indexOf("://")===-1){var d=document.createElement("a");
d.href=a;a=d.href}b[a]=!0}.bind(this)))},_createCompletion:function(a,b){for(var c,d=0;d<b.length;d++){var g=b[d];if(g.name===a){c=g;break}}var j;c?d=h.CompletionStatus.MATCH:b&&b.length>0?d=h.CompletionStatus.PARTIAL:(d=h.CompletionStatus.ERROR,j=f.formatMessage(l["'${0}' is not valid"],a));return{value:c?c.value:void 0,status:d,message:j,predictions:b}},_formatLocationAsPluginName:function(a){var b=a.split("/"),b=b[b.length-1],b=b.split(".html")[0],b=b.replace(/([a-z])([A-Z])/,"$1 $2"),b=function(a){return a.toLowerCase().replace(/\b[a-z]/g,
function(a){return a.toUpperCase()})}(b),b=b.replace("plugin",""),b=b.replace("Plugin","");b===""&&(b=a);return b.trim()},_getPredictions:function(a,d){var c=[];this.plugins&&(this.plugins.forEach(function(b){(!d.excludeDefaultPlugins||!this._defaultPluginUrls[b.getLocation()])&&b.name.indexOf(a)===0&&c.push({name:b.name,value:b})}.bind(this)),d.multiple&&"all".indexOf(a)===0&&c.push({name:"all",value:new b(this.plugins,d.excludeDefaultPlugins?this._defaultPluginUrls:null)}));return c},_initPluginsList:function(){this.plugins=
[];this.pluginRegistry.getPlugins().forEach(function(a){var b=a.getLocation(),c=a.getHeaders();a.name=c.name||this._formatLocationAsPluginName(b);this.plugins.push(a)}.bind(this));this._sort(this.plugins)},_sort:function(a){a.sort(function(a,b){var d=a.getState(),d=d==="active"||d==="starting",f=b.getState();if(d!==(f==="active"||f==="starting"))return d?-1:1;d=a.name&&a.name.toLowerCase();f=b.name&&b.name.toLowerCase();return d<f?-1:d>f?1:0})}};return g}();return k});
define("shell/paramType-service",["i18n!orion/shell/nls/messages","orion/shell/Shell","orion/i18nUtil","orion/Deferred"],function(l,j,h,f){var d;d={};d.ParamTypeService=function(){function d(b){this.pluginRegistry=b;b.addEventListener("installed",function(){this._initServicesList()}.bind(this));b.addEventListener("uninstalled",function(){this._initServicesList()}.bind(this));window.setTimeout(function(){this._initServicesList()}.bind(this),1)}d.prototype={getName:function(){return"service"},parse:function(b){var d=
new f,a=this._getPredictions(b.text);d.resolve(this._createCompletion(b.text,a));return d},stringify:function(b){return b},_createCompletion:function(b,d){for(var a,e=0;e<d.length;e++){var c=d[e];if(c.name===b){a=c;break}}var f;a?e=j.CompletionStatus.MATCH:d&&d.length>0?e=j.CompletionStatus.PARTIAL:(e=j.CompletionStatus.ERROR,f=h.formatMessage(l["'${0}' is not valid"],b));return{value:a?a.value:void 0,status:e,message:f,predictions:d}},_getPredictions:function(b){var d=[];this.services&&this.services.forEach(function(a){a.indexOf(b)===
0&&d.push({name:a,value:a})});return d},_initServicesList:function(){var b={};this.pluginRegistry.getPlugins().forEach(function(a){a.getServiceReferences().forEach(function(a){a.getProperty("service.names").forEach(function(a){b[a]=!0})})});this.services=[];for(var d in b)this.services.push(d);this._sort(this.services)},_sort:function(b){b.sort(function(b,a){var d=b.toLowerCase(),c=a.toLowerCase();return d<c?-1:d>c?1:0})}};return d}();return d});
define("shell/extensionCommands","require,orion/Deferred,orion/commands,orion/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks".split(","),function(l,j,h,f,d,k,b,g,a){var e={},c=a.getOrionHome();e._cloneItemWithoutChildren=function m(a){if(a===null||typeof a!=="object")return a;var b=a.constructor(),c;for(c in a)c!=="children"&&c!=="Children"&&(b[c]=m(a[c]));return b};e._createOpenWithCommands=function(a){function b(a,c){for(var d=a.getServiceReferences("orion.navigate.openWith"),
e=[],f=0;f<d.length;f++){var g=d[f];g.getProperty("editor")===c.id&&(g=g.getProperty("contentType"),g instanceof Array?e=e.concat(g):g!==null&&typeof g!=="undefined"&&e.push(g))}return e}for(var c=function(){for(var b=a.getServiceReferences("orion.edit.editor"),c=[],d=0;d<b.length;d++){var e=b[d],f=e.getProperty("id");c.push({id:f,name:e.getProperty("name"),nameKey:e.getProperty("nameKey"),nls:e.getProperty("nls"),uriTemplate:e.getProperty("orionTemplate")||e.getProperty("uriTemplate")})}return c}(),
d=function(a){for(a=a.getServiceReferences("orion.navigate.openWith.default");0<a.length;)return{editor:a[0].getProperty("editor")};return null}(a),e=[],f=0;f<c.length;f++){var g=c[f],h=d&&d.editor===g.id,j=b(a,g);j.length&&e.push({properties:{name:g.name||g.id,nameKey:g.nameKey,id:"eclipse.openWithCommand."+g.id,tooltip:g.name,tooltipKey:g.nameKey,contentType:j,uriTemplate:g.uriTemplate,nls:g.nls,forceSingleItem:!0,isEditor:h?"default":"editor"},service:{}})}return e};e._makeValidator=function(a,
b,e,f){function g(a,b,c,d){var e=c.match,f;if(b.indexOf("|")>=0)return f=b.substring(0,b.indexOf("|")),b=b.substring(b.indexOf("|")+1),g(a,f,c,d)?!0:g(a,b,c,d);else if(b.indexOf(":")>=0)return f=b.substring(0,b.indexOf(":")),b=b.substring(b.indexOf(":")+1),a[f]?g(a[f],b,c,d):!1;else{a:{f=!1;var h;if(a[b]){if(e)if(typeof e==="string"){if(!typeof(a[b]==="string")){c=!1;break a}if(c.variableName){if(e=RegExp(e).exec(a[b]))f=e[0],h=c.variableMatchPosition==="before"?a[b].substring(0,e.index):c.variableMatchPosition===
"after"?a[b].substring(e.index+f.length):c.variableMatchPosition==="only"?f:a[b],f=!0}else{c=RegExp(e).test(a[b]);break a}}else a[b]===e&&(h=a[b],f=!0);else h=a[b],f=!0;if(f&&c.variableName&&(d[c.variableName]=h,d.itemCached=a,c.replacements))for(a=0;a<c.replacements.length;a++)b=!1,c.replacements[a].pattern?d[c.variableName]=d[c.variableName].replace(RegExp(c.replacements[a].pattern),c.replacements[a].replacement||""):b=!0,b&&window.console.log("Invalid replacements specified in validation property.  "+
c.replacements[a]);c=f}else c=!1}return c}}return{info:a,validationFunction:function(b){typeof f==="function"&&(b=f.call(this,b));if(b){if(Array.isArray(b)){if((this.info.forceSingleItem||this.info.uriTemplate)&&b.length!==1)return!1;if(b.length<1)return!1}else b=[b];for(var c=0;c<b.length;c++){var h;a:{var j=b[c],k=e;if(this.info.validationProperties)for(h=0;h<this.info.validationProperties.length;h++){var l=this.info.validationProperties[h];if(l.source){if(!g(j,l.source,l,this)){h=!1;break a}}else{window.console.log("Invalid validationProperties in "+
a.id+".  No source property specified.");h=!1;break a}}if(this.info.contentType&&k){l=!1;if(j=d.getFilenameContentType(j.Name,k))for(h=0;h<this.info.contentType.length;h++)if(j.id===this.info.contentType[h]){l=!0;break}h=l}else h=!0}if(!h)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var b={},d;for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&(b[d]=a[d]);if(this.info.validationProperties)for(d=0;d<this.info.validationProperties.length;d++){var e=
this.info.validationProperties[d];e.source&&e.variableName&&(this.itemCached===a&&this[e.variableName]||g(a,e.source,e,this),a[e.variableName]?window.console.log("Variable name "+e.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):b[e.variableName]=this[e.variableName])}b.OrionHome=c;return(new k(this.info.uriTemplate)).expand(b)}return null}}};e._createCommandOptions=function(a,c,d,f,g,h){function k(b,j){var l=e._makeValidator(a,d,f,h);b.visibleWhen=
l.validationFunction.bind(l);if(g)if(l.generatesURI.bind(l)())b.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return l.getURI.bind(l)(a)};else{var r=a;b.callback=function(a){var f;if(r.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,f=e._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){f=[];for(var g=0;g<a.items.length;g++)f.push(e._cloneItemWithoutChildren(a.items[g]))}else f=e._cloneItemWithoutChildren(a.items);if(d)var h=d.getService("orion.page.progress");
c.run?h?h.progress(c.run(f),"Running command: "+b.name):c.run(f):d&&(h?h.progress(d.getService(c).run(f),"Running command: "+b.name):d.getService(c).run(f))}}j.resolve(b)}var l=new j;a.nls?b.getMessageBundle(a.nls).then(function(b){k({name:a.nameKey?b[a.nameKey]:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltipKey?b[a.tooltipKey]:a.tooltip,isEditor:a.isEditor},l)}):k({name:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor},l);return l};e.getOpenWithCommands=function(a){var b=
[],c;for(c in a._commandList){var d=a._commandList[c];d.isEditor&&b.push(d)}return b};return e});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(l,j,h,f){function d(b,d,a,e,c){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.message",this);this._operationsClient=d;this.notificationContainerDomId=c;this.domId=a;this.progressDomId=e||a;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var k;d.prototype={_init:function(){var b=j.node("closeNotifications");if(b&&
!this._hookedClose){b.style.cursor="pointer";this._hookedClose=!0;var d=j.node(this.notificationContainerDomId);j.addAutoDismiss([d],function(){this._clickToDisMiss&&this.close()}.bind(this));b.addEventListener("click",function(){this.close()}.bind(this));d.addEventListener("click",function(a){a&&a.target&&a.target.nodeName.toLowerCase()==="a"&&(a=j.$$("a",d))&&a.length&&a.length===1&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);this.setProgressMessage("");var b=j.node("closeNotifications");
if(this._cancelMsg&&this._cancelFunc&&b)b.innerHTML="",b.classList.remove("cancelButton"),b.classList.add("dismissButton"),b.classList.add("core-sprite-close"),b.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=h.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(b,d,a){this._init();this.currentMessage=b;var e=j.node(this.domId);if(typeof a==="boolean"){var c=
e.getAttribute("aria-live");e.setAttribute("aria-live",a?"polite":"off");window.setTimeout(function(){b===this.currentMessage&&(j.empty(e),e.appendChild(document.createTextNode(b)),window.setTimeout(function(){e.setAttribute("aria-live",c)},100))}.bind(this),100)}else j.empty(e),e.appendChild(document.createTextNode(b));typeof d==="number"&&window.setTimeout(function(){b===this.currentMessage&&(j.empty(e),e.appendChild(document.createTextNode("")))}.bind(this),d)},setErrorMessage:function(b){this._clickToDisMiss=
!0;this.currentMessage=b;this._init();var d=b.responseText||b.message||b;if(typeof d==="string")try{d=JSON.parse(d)}catch(a){}var b=d.Message||d,e="red";if(d.Severity)switch(d.Severity){case "Warning":e="#FFCC00";break;case "Error":e="red";break;case "Info":case "Ok":e="green"}d=document.createElement("span");d.style.color=e;d.appendChild(document.createTextNode(b));b=j.node(this.domId);j.empty(b);b.appendChild(d)},setProgressMessage:function(b){this._clickToDisMiss=!1;this._init();this.currentMessage=
b;var d=document.createElement("span");d.classList.add("imageSprite");d.classList.add("progressIcon");d.classList.add("core-sprite-progress");var a=j.node(this.progressDomId);j.empty(a);a.appendChild(d);a.appendChild(document.createTextNode(b));d=j.node(this.notificationContainerDomId);d.classList.remove("notificationHide");if(b&&b.length>0)d.classList.add("progressNormal"),d.classList.add("notificationShow");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();
else d.classList.remove("notificationShow"),d.classList.add("notificationHide")},setCancelFunction:function(b){this._cancelFunc=b},setProgressResult:function(b,d){this._clickToDisMiss=!1;this._cancelMsg=d;this.currentMessage=b;var a=b.responseText||b;if(typeof a==="string")try{a=JSON.parse(a)}catch(e){}this._init();var c=a.Message||a.toString(),h=l.UnknownError,k="core-sprite-information",o="progressNormal",n=document.createElement("span");n.classList.add("imageSprite");n.classList.add("progressIcon");
var p=[];if(a.Severity)switch(a.Severity){case "Warning":h=l.UnknownWarning;k="core-sprite-warning";o="progressWarning";p.push("progressInfo");p.push("progressError");p.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":k="core-sprite-error";o="progressError";p.push("progressWarning");p.push("progressInfo");p.push("progressNormal");this._clickToDisMiss=!0;break;default:o="progressNormal",p.push("progressWarning"),p.push("progressError"),p.push("progressNormal")}p.push("notificationHide");
n.classList.add(k);var t=j.node(this.progressDomId),k=j.node(this.notificationContainerDomId);j.empty(t);t.appendChild(n);c===Object.prototype.toString()&&(c=h);if(a.HTML)a=document.createElement("span"),a.innerHTML=c,t.appendChild(a);else{if(h=f.detectValidURL(c))c=document.createDocumentFragment(),f.processURLSegments(c,h),Array.prototype.forEach.call(j.$$("a",c),function(a){a.target="_blank"});else{if(a.Severity!=="Warning"&&a.Severity!=="Error"&&!d)this._timer&&window.clearTimeout(this._timer),
this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3);c=document.createTextNode(c)}t.appendChild(c)}if(o&&this.progressDomId!==this.domId){k.classList.add(o);for(o=0;o<p.length;o++)k.classList.remove(p[o])}k.classList.add("notificationShow");if((p=j.node("closeNotifications"))&&this._cancelMsg)p.classList.add("cancelButton"),p.classList.remove("dismissButton"),p.classList.remove("core-sprite-close"),p.classList.remove("imageSprite"),p.innerHTML=this._cancelMsg},
showWhile:function(b,d){var a=this;if(d){a.setProgressMessage(d);var e=function(){d===a.currentMessage&&a.setProgressMessage("")};b.then(e,e)}return b},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(b,d){return new k(this,++this._lastProgressId,b,d)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var b="",d=!0,a;for(a in this._progressMonitors)this._progressMonitors[a].status&&(d||(b+=", "),b+=this._progressMonitors[a].status,d=!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()}};d.prototype.constructor=d;k=function(b,d,a,e){this.statusService=b;this.progressId=
d;if(a){this.deferred=a;this.begin(e);var c=this;a.then(function(){c.done.bind(c)()},function(){c.done.bind(c)()})}};k.prototype.begin=function(b){this.status=b;this.statusService._beginProgressMonitor(this)};k.prototype.done=function(b){this.status=b;this.statusService._doneProgressMonitor(this)};k.prototype.worked=function(b){this.status=b;this.statusService._workedProgressMonitor(this)};k.prototype.constructor=k;return{StatusReportingService:d,ProgressMonitor:k}});
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(l,j){var h={root:j};Object.keys(l).forEach(function(f){typeof h[f]==="undefined"&&(h[f]=l[f])});return h});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(l,j,h,f){function d(){}d.prototype={_initialize:function(d,b,g,a,e){this._tooltip=new f.Tooltip({node:d,hideDelay:e||0,afterShowing:this._afterShowingFunction(b).bind(this),afterHiding:g,trigger:a?a:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";d=document.createRange();d.selectNode(this.$parent);d=d.createContextualFragment(this.TEMPLATE);
this.messages&&h.processTextNodes(d,l);this.$parent.appendChild(d);var c=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===h.KEY.ESCAPE&&c.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(d){for(var b=0;b<d.childNodes.length;b++){var f=d.childNodes[b];f.id&&(this["$"+f.id]=f);this._bindElements(f)}},_afterShowingFunction:function(d){return function(){d&&d.bind(this)();if(!this.customFocus){var b=
h.firstTabbable(this.$parent);b&&b.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};d.prototype.constructor=d;return{PopupDialog:d}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(l,j,h,f){var d={};(function(){var j=!1;d.updateNavTools=function(b,d,a,e,c,f){var m=h.node(e);if(m)d.destroy(m);else throw l["could not find toolbar "]+e;d.renderCommands(e,m,f,a,"button");if(c&&(e=h.node(c)))d.destroy(e),d.renderCommands(c,e,null,a,"button");j||(j=!0,b.getService("orion.page.selection").addEventListener("selectionChanged",function(b){var e=h.node(c);
e&&(d.destroy(e),d.renderCommands(c,e,b.selections,a,"button"))}))};d.createOperationsCommands=function(b,d,a){function e(a){return!a.operation||!a.operation.type?!1:a.operation.type==="loadstart"||a.operation.type==="progress"}var c=new f.Command({name:l["Remove Completed"],tooltip:l["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){a.removeCompletedOperations().then(function(){d.loadOperations.bind(d)()})},visibleWhen:function(){return!0}});b.addCommand(c);
c=new f.Command({name:l.Remove,tooltip:l["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(b){for(var b=Array.isArray(b.items)?b.items:[b.items],c=0;c<b.length;c++){var e=b[c];a.removeOperation.bind(a)(e.Location).then(function(){d.loadOperations.bind(d)()},function(){d.loadOperations.bind(d)()})}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return!e(a);for(var b in a)if(e(a[b]))return!1;return!0}});b.addCommand(c);
c=new f.Command({name:l.Cancel,tooltip:l["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],b=0;b<a.length;b++){var c=a[b];c.deferred&&c.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return e(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var b in a)if(!e(a[b])||!a[b].operation||!a[b].operation.cancelable)return!1;return!0}});b.addCommand(c)}})();
return d});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(l,j,h,f,d){function k(b){this._options=b}k.prototype=new f.PopupDialog;k.prototype.TEMPLATE='<table style="width: 360px;"><tr><td><h2>Recent operations</h2></td><td style="text-align: right;"><a id="allOperationsLink" class="navlinkonpage">All Operations</a></td></tr></table><div id="operationsExist"><div style="padding-left: 7px" id="myOperationsListEmpty">No operations running on this page.</div><table id="myOperationsList" style="display: none;"></table></div><div style="padding-left: 7px" id="operationsDontExist">No operations running.</div>';k.prototype._init=
function(b){this._myOperations=[];this._operationsDeferreds=[];this._commandService=b.commandRegistry;d.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(b.triggerNode)};k.prototype._bindToDom=function(){this.$allOperationsLink.href=j.toUrl("operations/list.html");this._setOperationsVisibility()};k.prototype.setOperations=function(b,d){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(b)for(var a in b)this._myOperations.push(b[a]),this._operationsDeferreds.push(d[a]);this._renderOperations()};k.prototype.parseProgressResult=function(b){if(!b)return{};b=b.responseText||b;try{b=JSON.parse(b)}catch(d){}var a={Message:b.Message||b,Severity:b.Severity};if(b.DetailedMessage&&b.DetailedMessage!==a.Message)a.DetailedMessage=b.DetailedMessage;return a};k.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};k.prototype._renderOperationsTable=function(b,d,a){h.empty(b);for(var e=0;e<d.length;e++){var c=d[e],f=document.createElement("tr"),j=document.createElement("td");j.style.paddingLeft="5px";j.style.paddingRight="5px";j.textContent=c.Name;f.appendChild(j);var k=document.createElement("div");j.appendChild(k);j=document.createElement("span");j.style.paddingRight="5px";j.classList.add("imageSprite");switch(c.type){case "Warning":j.classList.add("core-sprite-warning");j.setAttribute("aria-label",
l["Operation resulted in a warning."]);break;case "error":j.classList.add("core-sprite-error");j.setAttribute("aria-label",l["Operation resulted in an error."]);break;case "loadstart":case "progress":j.classList.add("core-sprite-start");j.setAttribute("aria-label",l["Operation is running."]);break;case "abort":j.classList.add("core-sprite-stop");j.setAttribute("aria-label",l["Operation is canceled."]);break;case "load":case "loadend":j.classList.add("core-sprite-ok"),j.setAttribute("aria-label","Operation ok.")}k.appendChild(j);
j=document.createElement("span");j.classList.add("operationStatus");j.textContent=c.Name;k.appendChild(j);if(c.error){var n=c.error.Message||c.error;c.error.DetailedMessage&&c.error.DetailedMessage!==""&&(n+=": "+c.error.DetailedMessage);j.textContent=n;j.classList.remove("operationStatus");j.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",k,{operation:c,deferred:a[e]},this,"tool");b.appendChild(f)}this._setOperationsVisibility()};k.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"};k.prototype.constructor=k;return{OperationsDialog:k}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(l,j,h,f,d){function k(b,a){if(!this._progressPane){this._progressPane=f.node(b);this._operationsDialog=new d.OperationsDialog({triggerNode:this._progressPane,commandRegistry:a});var e=this;this._progressPane.addEventListener("keydown",function(a){(a.charOrCode===" "||a.keyCode===f.KEY.ENTER)&&e._operationsDialog.show()})}}function b(b,a,d,c){this._serviceRegistry=
b;this._serviceRegistration=b.registerService("orion.page.progress",this);this._commandRegistry=d;this._operationsClient=a;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=c}k.prototype={_switchIconTo:function(b){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=b;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(b,a){var d=
{},c;for(c in b)b[c].progressMonitor||(d[c]=b[c]);if(this._isEmpty(d))this._switchIconTo("progressPane_empty"),this._progressPane.title=l.Operations,this._progressPane.alt=l.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var f="";for(c in d){var h=d[c];if(h.type&&(h.type==="loadstart"||h.type==="progress")){f="running";break}}switch(f){case "running":this._progressPane.title=l["Operations running"];this._progressPane.alt=l["Operations running"];
this._progressPane.setAttribute("aria-valuetext",l["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=l["Some operations finished with warning"];this._progressPane.alt=l["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",l["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=l["Some operations finished with error"];this._progressPane.alt=
l["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",l["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=l.Operations,this._progressPane.alt=l.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_operations")}}this._operationsDialog.setOperations(d,a)},_isEmpty:function(b){for(var a in b)return!1;return!0}};
k.prototype.constructon=k;b.prototype={init:function(b){if(!this._progressMonitorClass)this._progressMonitorTool=new k(b,this._commandRegistry)},progress:function(b,a,d){var c=this,f=this._operationsIndex++;!d&&this._progressMonitorClass&&(d=new this._progressMonitorClass,d.begin(a));b.then(function(){if(c._operations[f]){var h=c._operations[f];if(a)h.Name=a;c._lastOperation=h;h.type="loadend";if(d)h.progressMonitor=d;c.writeOperation.bind(c)(f,h,b);h.Location||c._removeOperationFromTheList.bind(c)(f)}},
function(h){if(c._operations[f]){var j=c._operations[f];if(a)j.Name=a;if(d)j.progressMonitor=d;c._lastOperation=j;j.type=h.canceled?"abort":"error";j.error=h;c.writeOperation.bind(c)(f,j,b);j.Location||c._removeOperationFromTheList.bind(c)(f)}},function(h){if(a)h.Name=a;if(d)h.progressMonitor=d;c.writeOperation.bind(c)(f,h,b)});return b},removeOperation:function(b){for(var a in this._operations)if(this._operations[a].Location&&this._operations[a].Location===b){this._removeOperationFromTheList(a);
break}this._operationsClient.removeOperation.bind(this._operationsClient)(b)},_removeOperationFromTheList:function(b){var a=this._operations[b].progressMonitor;delete this._operations[b];delete this._operationDeferrds[b];a?a.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var b in this._operations){var a=this._operations[b];if(a.type&&a.type!=="loadstart"&&a.type!=="progress")(a=this._operations[b].progressMonitor)&&
a.done(),delete this._operations[b],delete this._operationDeferrds[b]}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(b){this._serviceRegistry.getService("orion.page.message").setProgressResult(b)},showWhile:function(b,a){a&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(a);var d=this;b.then(function(){d._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){d.setProgressResult.bind(d)(a);
return a});return this.progress(b,a)},writeOperation:function(b,a,d){this._operations[b]=a;this._operationDeferrds[b]=d;a.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(b){b.put(a.Location,{Name:a.Name,expires:a.expires})});a.progressMonitor?a.progressMonitor.progress(a.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};b.prototype.constructor=b;return{ProgressService:b}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(l,j){function h(b,d,a){return b[d].apply(b,a)}function f(b){this._location=b}function d(){var b=new j;b.reject(l["No Matching OperationService for location:"]+this._location);return b}function k(b){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=b.getService("orion.core.preference");for(var d=b.getServiceReferences("orion.core.operation"),
a=0;a<d.length;a++){var e=b.getService(d[a]);this._services[a]=e;e=d[a].getProperty("pattern")||".*";e[0]!=="^"&&(e="^"+e);this._patterns[a]=RegExp(e)}this._getService=function(a){if(!a)return this._services[0];for(var b=0;b<this._patterns.length;++b)if(this._patterns[b].test(a))return this._services[b];this._operations.remove(a);return new f(a)}}f.prototype={getOperation:d,getOperations:d,removeCompletedOperations:d,removeOperation:d,cancelOperation:d};f.prototype.constructor=f;k.prototype={getOperations:function(){var b=
new j;if(this._operations)return b.resolve(this._operations),b;var d=this;this._preferenceService.getPreferences("/operations").then(function(a){d._operations=a;b.resolve(d._operations)});return b},getOperation:function(b){return h(this._getService(b),"getOperation",arguments)},removeCompletedOperations:function(){for(var b=[],d=this,a=0;a<this._services.length;a++){var e=this._patterns[a],c=new j;b[a]=c.promise;h(this._services[a],"removeCompletedOperations").then(function(a){return function(b){Array.isArray(b)&&
d.getOperations.bind(d)().then(function(c){for(var d=c.keys(),f=0;f<d.length;f++){var g=d[f];e.test(g)&&b.indexOf(g)<0&&c.remove(g)}a.resolve()})}}(c),function(a){return function(b){a.reject(b)}}(c))}return j.all(b)},removeOperation:function(b){var d=this;return h(this._getService(b),"removeOperation",arguments).then(function(){d.getOperations.bind(d)().then(function(a){a.remove(b)})},function(a){return a},function(a){return a})}};k.prototype.constructor=k;return{OperationsClient:k}});
define('built-shellPage.js',"require,i18n!orion/shell/nls/messages,orion/browserCompatibility,orion/bootstrap,orion/commandRegistry,orion/fileClient,orion/searchClient,orion/globalCommands,orion/shell/Shell,orion/webui/treetable,shell/shellPageFileService,shell/paramType-file,shell/paramType-plugin,shell/paramType-service,orion/i18nUtil,shell/extensionCommands,orion/contentTypes,orion/pluginregistry,orion/PageUtil,orion/URITemplate,orion/Deferred,orion/status,orion/progress,orion/operationsClient,shell/resultWriters,orion/URL-shim".split(","),
function(l,j,h,f,d,k,b,g,a,e,c,i,m,o,n,p,t,u,v,r,q,y,z,B,D){function H(){var a=v.matchResourceParameters(window.location.href).resource;return a.length>0?a:null}function C(a,b){var c=(new r(ka)).expand({resource:a.Location});b?window.location.replace(c):window.location.href=c;g.setPageTarget({task:j.Shell,serviceRegistry:J,commandService:U,target:a})}function s(a){for(var b=0;b<W.length;b++){var c=W[b];if(c.visibleWhen(a))return c.hrefCallback({items:a})}b=ja.getFileContentType(a);switch(b&&b.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return a.Location}c=
null;for(b=0;b<W.length;b++)if(W[b].isEditor==="default"){c=W[b];break}return!c?a.Location:c.hrefCallback({items:a})}function A(a){var b=document.createElement("a");if(a.Directory)return b.href="#"+a.Location,b.className="shellPageDirectory",b.textContent=a.Name,b;b.href=s(a);b.target="_blank";b.textContent=a.Name;return b}function x(a,b){var c=document.createElement("span");c.appendChild(document.createTextNode(b?j["Initial directory: "]:j["Changed to: "]));var d=document.createElement("b");d.appendChild(document.createTextNode(a));
c.appendChild(d);return c}function w(a){a=a.directory.value[0];G.setCurrentDirectory(a);ha=!0;C(a,!1);a=G.computePathString(a);return x(a,!1)}function F(a){a=s(a.file.getValue()[0]);window.open(a)}function E(a,b){var c=b.createPromise(),d=G.getCurrentDirectory(),d=d?d.Location:H()||ea;G.loadWorkspace(d).then(function(a){G.setCurrentDirectory(a);G.withChildren(a,function(a){for(var b=document.createElement("div"),d=0;d<a.length;d++)b.appendChild(A(a[d])),b.appendChild(document.createElement("br"));
c.resolve(b);setTimeout(function(){for(var a=S.querySelectorAll(".shellPageDirectory"),b=0;b<a.length;b++)a[b].setAttribute("target","_self"),a[b].className=""},1)},function(a){fa(c,a)})},function(a){fa(c,a)});return c}function I(a,b){var c=b.createPromise(),d=G.getCurrentDirectory();G.loadWorkspace(d.Location).then(function(a){var a=G.computePathString(a),b=document.createElement("b");b.appendChild(document.createTextNode(a));c.resolve(b)},function(a){fa(c,a)});return c}function Y(a){var b=document.createElement("div");
a.plugin.getServiceReferences().forEach(function(a){var c={values:[]};a.getPropertyKeys().forEach(function(b){if(b==="service.names")c.name=a.getProperty(b).join();if(b==="id")c.id=a.getProperty(b);c.values.push({name:b,value:a.getProperty(b)})});if(c.name){c.elementId="serviceElement"+da++;c.values.forEach(function(a){a.elementId="serviceElement"+da++});var d=document.createElement("div");b.appendChild(d);var f=new na,d=new e.TableTree({model:new ma(c),showRoot:!0,parent:d,renderer:f});f.tableTree=
d}});return b}function M(){for(var a=ca.getPlugins(),b=document.createElement("table"),c=0;c<a.length;c++){var d=document.createElement("tr");b.appendChild(d);var e=document.createElement("td");d.appendChild(e);d=document.createElement("b");e.appendChild(d);d.textContent=a[c].name;d=a[c].getState();if(d!=="active"&&d!=="starting")d=document.createElement("span"),e.appendChild(d),d.textContent=" ("+j.disabled+")"}return b}function N(a,b){var c=b.createPromise();a.plugin.stop().then(function(){c.resolve(j.Succeeded)},
function(a){c.resolve(a)});return c}function Q(a,b){var c=b.createPromise();a.plugin.start({lazy:!0}).then(function(){c.resolve(j.Succeeded)},function(a){c.resolve(a)});return c}function O(a,b){var c=a.url.trim();if(/^\S+$/.test(c)){if(X.getPlugin(c))return j["Plug-in is already installed"];var d=b.createPromise();X.installPlugin(c).then(function(a){a.start({lazy:!0}).then(function(){Z.getPreferences("/plugins").then(function(a){a.put(c,!0)});d.resolve(j.Succeeded)},function(a){d.resolve(a)})},function(a){d.resolve(a)});
return d}return j["Invalid plug-in URL"]}function V(a,b){var c=b.createPromise();a.plugin.update().then(function(){c.resolve(j.Succeeded)},function(a){c.resolve(a)});return c}function P(a,b){var c=b.createPromise();if(a.plugin.isAllPlugin){if(!window.confirm(j["Are you sure you want to uninstall all contributed plug-ins?"]))return j.Aborted;a.plugin.uninstall().then(function(){Z.getPreferences("/plugins").then(function(b){for(var c=a.plugin.getPluginLocations(),d=0;d<c.length;d++)b.remove(c[d])}.bind(this));
c.resolve(j.Succeeded)},function(a){c.resolve(a)})}else{var d=a.plugin.getLocation();X.getPlugin(d).uninstall().then(function(){Z.getPreferences("/plugins").then(function(a){a.remove(d)}.bind(this));c.resolve(j.Succeeded)},function(a){c.resolve(a)})}return c}function $(a){var b=a.id.trim(),c=document.createElement("div");ca.getPlugins().forEach(function(a){a.getServiceReferences().forEach(function(d){if(d.getProperty("service.names").indexOf(b)!==-1){var f={name:a.name,values:[]};d.getPropertyKeys().forEach(function(a){if(a===
"id")f.id=d.getProperty(a);f.values.push({name:a,value:d.getProperty(a)})});f.elementId="serviceElement"+da++;f.values.forEach(function(a){a.elementId="serviceElement"+da++});var g=document.createElement("div");c.appendChild(g);var h=new na,g=new e.TableTree({model:new ma(f),showRoot:!0,parent:g,renderer:h});h.tableTree=g}})});return c}function K(a,b){typeof a!=="string"&&(a=a.xhr&&a.xhr.statusText?a.xhr.statusText:a.toString());return b.write(a)}function ba(a,b,c,d){var e,f;c?f=new D.FileBlobWriter(c,
G):(e=document.createElement("div"),f=new D.ShellBlobWriter(e));c=b.getValue();b.isArray()||(c=[c]);c.forEach(function(a){f.addBlob(a)});f.write().then(function(){d?a.progress(e):a.resolve(e)},function(b){e=e||document.createElement("div");f=new D.ShellStringWriter(e);K(b,f).then(function(){a.reject(e)},function(){a.reject()})})}function aa(a,b,c,d){var e,f;c?f=new D.FileStringWriter(c,G):(e=document.createElement("div"),f=new D.ShellStringWriter(e));K(b.stringify(),f).then(function(){d?a.progress(e):
a.resolve(e)},function(b){e=e||document.createElement("div");f=new D.ShellStringWriter(e);K(b,f).then(function(){a.reject(e)},function(){a.reject()})})}function T(a,b,c,d){var e=b.getType();e==="file"?ga.processResult(a,b,c,d):e==="blob"?ba(a,b,c,d):aa(a,b,c,d)}function L(a,b,c,d,e){return typeof a.callback!=="function"?void 0:function(f){var g=new q,h=null;if(e)(h=f.output)&&(h=h.resourceExists()?h.getValue()[0]:h.getValue()),delete f.output;(function(a,b){var c=Object.keys(a);if(c.length===0)b(a);
else{var d=0;c.forEach(function(e){(function(e){(function(a,b){a&&a.getPluginRepresentation?a.getPluginRepresentation().then(function(a){b(a)}):b(a)})(a[e],function(f){a[e]=f;++d===c.length&&b(a)})})(e)})}})(f,function(e){var i=function(a){a=new la(a,d);T(g,a,h)},j=function(a){fa(g,a)},k=function(a){if(a&&a.uriTemplate){var c=new r(a.uriTemplate);G.getCurrentDirectory();var c=c.expand({}),e=document.createElement("iframe");e.id=b;e.name=b;e.type="text/html";e.sandbox="allow-scripts allow-same-origin";
e.frameborder=1;e.src=c;e.className="delegatedUI";if(a.width)e.style.width=a.width;if(a.height)e.style.height=a.height;var a=document.getElementsByClassName("gcli-row-out"),f=a[a.length-1];f.appendChild(e);window.addEventListener("message",function pa(a){a.source===e.contentWindow&&typeof a.data==="string"&&(a=JSON.parse(a.data),a.pageService==="orion.page.delegatedUI"&&a.source===b&&(window.removeEventListener("message",pa,!1),a.error?j(a.error):(f.removeChild(e),a.result?i(a.result):a.progress&&
k(a.progress))))},!1)}else typeof g.progress==="function"&&(a=new la(a,d),T(g,a,h,!0))};c.progress(a.callback(e,{cwd:H()}),"Executing command "+function(a,b){var c=a,d;for(d in b)c+=" ",c+=b[d];return c}(b,f)).then(i,j,k)});return g}}function R(a){return typeof a!=="function"?void 0:function(b,c,d){var e=new q;if(d)d.cwd=H();a(b,c,d).then(function(a){e.resolve(a)},function(a){e.reject(a)});return e}}var G,ia,U,S,ga,ha=!1,ja,W=[],J,X,ca,Z,da=0,ea=(new URL(l.toUrl("file"),window.location.href)).pathname,
ka=l.toUrl("shell/shellPage.html")+"#{,resource}",la=function(){function a(b,c){this.value=b;this.array=!1;if(c.indexOf("[")===0&&c.lastIndexOf("]")===c.length-1)this.array=!0,c=c.substring(1,c.length-1);this.type=c}a.prototype={getType:function(){return this.type},getValue:function(){return this.value},isArray:function(){return this.array},stringify:function(){if(this.type!=="string"&&this.type!=="markdown")return"("+(this.array?"[":"")+this.value+(this.array?"]":"")+")";if(!this.array)return this.value;
for(var a="",b=0;b<this.value.length;b++)a+=this.value[b],b!==this.value.length-1&&(a+="\n");return a}};return a}(),oa=function(){function a(b,c,d){this.name=b;this.parseFn=c;this.stringifyFn=d}a.prototype={getName:function(){return this.name},parse:function(a,b,c){var d=new q;this.parseFn(a,b,c).then(function(a){d.resolve(a)},function(a){d.reject(a)});return d},stringify:function(a,b){var c=new q;if(!this.stringifyFn)return a?a.name:"";this.stringifyFn(a,b).then(function(a){c.resolve(a)},function(a){c.reject(a)});
return c}};return a}(),ma=function(){function a(b){this.root=b}a.prototype={getRoot:function(a){a(this.root)},getChildren:function(a,b){b(a.values)},getId:function(a){return a.elementId}};return a}(),na=function(){function a(){}a.prototype={getTwistieElementId:function(a){return a+"__expand"},initTable:function(){},labelColumnIndex:function(){return 0},render:function(a,b){b.className+=" treeTableRow";var c=document.createElement("td");b.appendChild(c);if(a.value)c=document.createElement("td"),b.appendChild(c),
c.textContent=a.name,c=document.createElement("td"),b.appendChild(c),c.textContent=a.value;else{var d=document.createElement("span");c.appendChild(d);c=document.createElement("span");c.id=this.getTwistieElementId(b.id);d.appendChild(c);c.className="modelDecorationSprite core-sprite-closedarrow";c.onclick=function(){this.tableTree.toggle(b.id)}.bind(this);c=document.createElement("td");b.appendChild(c);d=document.createElement("b");c.appendChild(d);d.textContent=a.name;if(a.id)d=document.createElement("span"),
c.appendChild(d),d.textContent=" ("+a.id+")";c.colSpan="2"}},updateExpandVisuals:function(a,b){var c=document.getElementById(this.getTwistieElementId(a.id));if(c){var d=c.className;b?(d+=" core-sprite-openarrow",d=d.replace(/\s?core-sprite-closedarrow/g,"")):(d+=" core-sprite-closedarrow",d=d.replace(/\s?core-sprite-openarrow/g,""));c.className=d}}};return a}(),fa=function(a,b){var c=b;try{c=JSON.parse(b.responseText)}catch(d){}c&&c.DetailedMessage?c=n.formatMessage(j["Error: ${0}"],c.DetailedMessage):
c&&c.Message?c=n.formatMessage(j["Error: ${0}"],c.Message):typeof b.url==="string"&&(c=b.status===0?n.formatMessage(j.NoResponseFromServer,b.url):n.formatMessage(j.ServerError,b.url,b.status,b.statusText));var e=document.createElement("span");e.textContent=c;a.reject(e)};f.startup().then(function(e){X=e.pluginRegistry;J=e.serviceRegistry;Z=e.preferences;U=new d.CommandRegistry({});ia=new k.FileClient(J);var e=new b.Searcher({serviceRegistry:J,commandService:U,fileService:ia}),f=new B.OperationsClient(J);
new y.StatusReportingService(J,f,"statusPane","notifications","notificationArea");new z.ProgressService(J,f,U);g.generateBanner("orion-shellPage",J,U,Z,e);g.setPageTarget({task:j.Shell,serviceRegistry:J,commandService:U});S=document.getElementById("shell-output");var e=document.getElementById("shell-input"),h=new a.Shell({input:e,output:S});S.onmousedown=function(a){S.onmouseup=null;if(a.button===0&&a.target.tagName.toUpperCase()==="DIV")S.onmouseup=function(b){S.onmouseup=null;b.target===a.target&&
Math.abs(b.clientX-a.clientX)<=2&&Math.abs(b.clientY-a.clientY)<=2&&h.setFocusToInput()}};var l=v.matchResourceParameters(window.location.href);if(l.command)h.setInputText(l.command),delete l.command,e=(new r(ka)).expand(l),window.location.href=e;h.setFocusToInput();G=new c.ShellPageFileService;(function(a,b){var c=function(a){C(a,b);G.setCurrentDirectory(a);a=G.computePathString(a);h.output(x(a,!0))};a?G.loadWorkspace(a).then(c,function(){G.loadWorkspace(ea).then(c)}):G.loadWorkspace(ea).then(c)})(H(),
!0);ga=new i.ParamTypeFile(G);h.registerType(ga);ca=new m.ParamTypePlugin(X);h.registerType(ca);e=new o.ParamTypeService(X);h.registerType(e);h.registerCommand({name:"cd",description:j["Changes the current directory"],callback:w,parameters:[{name:"directory",type:{name:"file",directory:!0,exist:!0},description:j["The name of the directory"]}],returnType:"html"});h.registerCommand({name:"edit",description:j["Edits a file"],callback:F,parameters:[{name:"file",type:{name:"file",file:!0,exist:!0},description:j["The name of the file"]}]});
h.registerCommand({name:"ls",description:j["Lists the files in the current directory"],callback:E,returnType:"html"});h.registerCommand({name:"pwd",description:j["Prints the current directory location"],callback:I,returnType:"html"});h.registerCommand({name:"clear",description:j["Clears the shell screen"],callback:function(){h.clear()}});h.registerCommand({name:"plugins",description:j["Commands for working with plug-ins"]});h.registerCommand({name:"plugins list",description:j["Lists all registered plug-ins"],
callback:M,returnType:"html"});h.registerCommand({name:"plugins install",description:j["Installs a plug-in from a URL"],callback:O,parameters:[{name:"url",type:"string",description:j["The plug-in URL"]}],returnType:"string"});h.registerCommand({name:"plugins uninstall",description:j["Uninstalls a contributed plug-in from the configuration"],callback:P,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!0},description:j["The name of the contributed plug-in"]}],returnType:"string"});
h.registerCommand({name:"plugins reload",description:j["Reloads a plug-in"],callback:V,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!1},description:j["The name of the plug-in"]}],returnType:"string"});h.registerCommand({name:"plugins enable",description:j["Enables a contributed plug-in"],callback:Q,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!0},description:j["The name of the contributed plug-in"]}],returnType:"string"});h.registerCommand({name:"plugins disable",
description:j["Disables a contributed plug-in"],callback:N,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!0},description:j["The name of the contributed plug-in"]}],returnType:"string"});h.registerCommand({name:"plugins services",description:j["Displays a plug-in's services"],callback:Y,parameters:[{name:"plugin",type:{name:"plugin",multiple:!1,excludeDefaultPlugins:!1},description:j["The name of the plug-in"]}],returnType:"html"});h.registerCommand({name:"service",
description:j["Commands for working with a service"]});h.registerCommand({name:"service contributors",description:j["Displays all plug-in contributions for a service"],callback:$,parameters:[{name:"id",type:"service",description:j["The service identifier"]}],returnType:"html"});ja=new t.ContentTypeRegistry(J);J.getService("orion.core.contentTypeRegistry").getContentTypes().then(function(a){for(var b=p._createOpenWithCommands(J,a),c=function(a){W.push(a)},d=0;d<b.length;d++)p._createCommandOptions(b[d].properties,
b[d].service,J,a,!0).then(c)});e=J.getServiceReferences("orion.shell.type");for(f=0;f<e.length;++f){var q=e[f],s=J.getService(q);s&&(q=new oa(q.getProperty("name"),R(s.parse),R(s.stringify)),h.registerType(q))}for(var e=J.getServiceReferences("orion.shell.command"),u=J.getService("orion.page.progress"),f=0;f<e.length;++f)if(q=e[f],s=J.getService(q)){for(var l=q.getProperty("parameters")||[],A,D=0;D<l.length;D++)if(l[D].name==="output"){A=!0;break}A||l.push({name:"output",type:{name:"file",file:!0,
directory:!0},description:j["The file or directory to re-direct output to"],defaultValue:null});var K=q.getProperty("returnType")||"string";q.getProperty("nls")&&q.getProperty("descriptionKey")?n.getMessageBundle(q.getProperty("nls")).then(function(a,b){var c=a.getProperty("name");h.registerCommand({name:c,description:b[a.getProperty("descriptionKey")],callback:L(s,c,u,K,!A),returnType:"html",parameters:l,manual:b[a.getProperty("manual")]})},q):(D=q.getProperty("name"),h.registerCommand({name:D,description:q.getProperty("description"),
callback:L(s,D,u,K,!A),returnType:"html",parameters:l,manual:q.getProperty("manual")}))}window.addEventListener("hashchange",function(){if(ha)ha=!1;else{var a=v.hash().substring(1);a.length===0&&(a=ea);G.loadWorkspace(a).then(function(a){if(G.getCurrentDirectory().Location!==a.Location){G.setCurrentDirectory(a);var b=G.computePathString(a);h.output(x(b,!1));C(a,!1)}},function(){C(G.getCurrentDirectory(),!0)})}})})});