/*

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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


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


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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - _initial API and implementation

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: 
  Felipe Heidrich (IBM Corporation) - initial API and implementation
  Silenio Quarti (IBM Corporation) - initial API and implementation
  Mihai Sucan (Mozilla Foundation) - fix for Bug#334583 Bug#348471 Bug#349485 Bug#350595 Bug#360726 Bug#361180 Bug#362835 Bug#362428 Bug#362286 Bug#354270 Bug#361474 Bug#363945 Bug#366312 Bug#370584

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: 
 IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation
               Alex Lakatos - fix for bug#369781

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

 Contributors: IBM Corporation - initial API and implementation
               Alex Lakatos - fix for bug#369781

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: 
 IBM Corporation - initial API and implementation
 Adrian Aichner - regular expression capture group support in replace

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 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


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

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

 Contributors:
     IBM Corporation - initial API and implementation

 Copyright (c) 2011, 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, 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, 2014 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and 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
*/
(function(){function l(f,h,g,d,a,e){h[f]&&(g.push(f),(!0===h[f]||1===h[f])&&d.push(a+f+"/"+e))}function n(f,h,g,d,a){h=d+h+"/"+a;require._fileExists(f.toUrl(h+".js"))&&g.push(h)}function m(f,h,g){for(var d in h)h.hasOwnProperty(d)&&(!f.hasOwnProperty(d)||g)?f[d]=h[d]:"object"===typeof h[d]&&m(f[d],h[d],g)}var k=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(f){var h=f.config?f.config():{},h=h||{};return{version:"2.0.1+",load:function(g,d,a,e){e=e||{};e.locale&&(h.locale=
e.locale);var b=k.exec(g),p=b[1],f=b[4],t=b[5],s=f.split("-"),y=[],r={},x,u="";b[5]?(p=b[1],g=p+t):(t=b[4],f=h.locale,f||(f=h.locale="undefined"===typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),s=f.split("-"));if(e.isBuild){y.push(g);n(d,"root",y,p,t);for(x=0;x<s.length;x++)e=s[x],u+=(u?"-":"")+e,n(d,u,y,p,t);d(y,function(){a()})}else d([g],function(e){var b=[],g;l("root",e,b,y,p,t);for(x=0;x<s.length;x++)g=s[x],u+=(u?"-":"")+g,l(u,e,b,y,p,t);d(y,function(){var v,
g,f;for(v=b.length-1;-1<v&&b[v];v--){f=b[v];g=e[f];if(!0===g||1===g)g=d(p+f+"/"+t);m(r,g)}a(r)})})}}})})();
define("orion/i18n",[],function(){return{load:function(l,n,m,k){k=k||{};var f=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,h=f.exec(l);if(h){if(!n.defined||n.defined(l))try{m(n(l));return}catch(g){}if(k.isBuild||k.isTest)m({});else if(n.specified&&!n.specified("orion/bootstrap"))m({});else{var d=h[1],a=h[3]?h[2]:"",e=h[3]||h[2];n(["orion/bootstrap"],function(b){b.startup().then(function(b){var g=b.serviceRegistry;b=g.getServiceReferences("orion.i18n.message");if(a)b.some(function(a){return l===a.getProperty("name")?
(g.getService(a).getMessageBundle().then(function(a){m(a)},function(){m({})}),!0):!1})||m({});else{var t={},s;b.forEach(function(b){var p=b.getProperty("name");if((h=f.exec(p))&&d===h[1]&&e===(h[3]||h[2]))if(a=h[3]?h[2]:""){if((b=k.locale||("undefined"!==typeof navigator?navigator.language||navigator.userLanguage:null))&&0===b.toLowerCase().indexOf(a.toLowerCase()))t[a]=!0,(!n.specified||!n.specified(p))&&define(p,["orion/i18n!"+p],function(a){return a})}else s=b});!n.specified||!n.specified(l)?s?
g.getService(s).getMessageBundle().then(function(a){Object.keys(t).forEach(function(e){"undefined"===typeof a[e]&&(a[e]=t[e])});define(l,[],a);m(a)},function(){define(l,[],t);m(t)}):(define(l,[],t),m(t)):m(t)}})})}}else m(null)}}});
define("git/nls/root/gitmessages",{Compare:"Compare","View the side-by-side compare":"View the side-by-side compare","Working Directory Version":"Working Directory Version","Working Directory":"Working Directory","View the working directory version of the file":"View the working directory version of the file","Loading...":"Loading...",Repositories:"All Git Repositories",Repo:"Repositories","0 on 1 - Git":"${0} on ${1} - Git",Git:"Git","Show in eclipse.org":"Show in eclipse.org","Show this repository at eclipse.org":"Show this repository at eclipse.org",
"Show in GitHub":"Show in GitHub","Show this repository in GitHub":"Show this repository in GitHub","Commit Details":"Commit Details","No Commits":"No Commits","commit: 0":"commit: ${0}","parent: 0":"parent: ${0}","authored by 0 (1) on 2":"authored by ${0} (${1}) on ${2}","committed by 0 (1)":"committed by ${0} (${1})","Tags:":"Tags:","No Tags":"No Tags",Diffs:"Changes",More:"More","Loading git log...":"Loading git log...",local:"local",remote:"remote","Git Log for ${0} branch ${1} on ":"Git Log for ${0} branch ${1} on ",
"Git Log for ${0} branch ${1}":"Git Log for ${0} branch ${1}","Log for branch ${0} - Git":"Log for branch ${0} - Git","Log for ${0} on ${1} - Git":"Log for ${0} on ${1} - Git","View All":"View All","Error ${0}: ":"Error ${0}: ","Loading ":"Loading ",Message:"Message",Author:"Author",Date:"Date",Actions:"Actions",Branches:"Branches",Tags:"Tags",Stage:"Stage","Unstaged removal":"Unstaged removal",Unstage:"Unstage","Staged removal":"Staged removal","Unstaged change":"Unstaged change","Staged change":"Staged change",
"Unstaged add":"Unstaged add","Staged add":"Staged add",Addition:"Addition",Deletion:"Deletion","Resolve Conflict":"Resolve Conflict",Conflicting:"Conflicting","Commit message":"Commit message","Record changes in the active branch":"Record changes in the active branch",Commit:"Commit",SmartCommit:"Type a message here to commit...",SmartCountCommit:"Commit ${0} file(s)","Amend last commit":"Amend last commit"," Amend":" Amend","Rebase in progress. Choose action:":"Rebase in progress. Choose action:",
RebaseProgress:"Commits (Rebase in progress)",RebaseProgressDetails:"Rebasing branch.\n\n\tUse Continue after resolving any conflicts;\n\tSkip to bypass the current patch;\n\tAbort to end the rebase at any time.","Committer name:":"Committer name:","email:":"email:","Author name: ":"Author name: ","Select a file on the left to compare...":"Select a file on the left to compare...",Unstaged:"Unstaged",Staged:"Staged",ChangedFiles:"Changed Files","Recent commits on":"Recent commits on","Git Status":"Git Status",
"Go to Git Status":"Open the Git Status page for the repository containing this file or folder.","Recent commits on ${0}":"Recent commits on ${0}","Status for ${0} - Git":"Status for ${0} - Git","Status (${0})":"Status (${0})","Getting git incoming changes...":"Getting git incoming changes...","Loading recent commits...":"Loading recent commits...","Show the side-by-side compare":"Show the side-by-side compare","Change Committer or Author":"Change Committer or Author","Use Default Committer and Author":"Use Default Committer and Author",
Checkout:"Checkout","Checkout the file, discarding the unstaged change":"Checkout the file, discarding the unstaged change","Your changes to the file will be lost. Are you sure you want to checkout?":"Your changes to the file will be lost. Are you sure you want to checkout?","Checking out...":"Checking out...","Stage the change":"Stage the change","Stage the selected changes":"Stage the selected changes","Staging...":"Staging...","Checkout all the selected files, discarding all changes":"Checkout all the selected files, discarding all changes",
"Your changes to all the selected files will be lost. Are you sure you want to checkout?":"Your changes to all the selected files will be lost. Are you sure you want to checkout?","Save Patch":"Save Patch","Save workspace changes as a patch":"Save workspace changes as a patch","Unstage the change":"Unstage the change","Unstaging...":"Unstaging...",Undo:"Undo",UndoTooltip:"Revert this commit, keeping all changed files and not making any changes to the working directory.",UndoConfirm:"The content of your active branch will be replaced with ${0}. All changes in the commit and working directory will be kept. Are you sure?",
Reset:"Reset","Reset the branch, discarding all staged and unstaged changes":"Reset the branch, discarding all staged and unstaged changes","All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.":"All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.","Are you sure you want to continue?":"Are you sure you want to continue?","Resetting local changes...":"Resetting local changes...","Continue rebase...":"Continue rebase...",
"Skipping patch...":"Skipping patch...","Aborting rebase...":"Aborting rebase...","Complete log":"Complete log","local VS index":"local VS index","index VS HEAD":"index VS HEAD","Compare(${0} : ${1})":"Compare(${0} : ${1})","Loading status...":"Loading status...","Committing...":"Committing...","The committer name is required.":"The committer name is required.","The committer mail is required.":"The committer mail is required.","The author name is required.":"The author name is required.","The author mail is required.":"The author mail is required.",
". Repository still contains conflicts.":". Repository still contains conflicts.",". Repository contains unmerged paths. Resolve conflicts first.":". Repository contains unmerged paths. Resolve conflicts first.","Rendering ${0}":"Rendering ${0}",Configuration:"Configuration","Getting configuration of":"Getting configuration of ${0}"," - Git":" - Git","Repositories - Git":"Repositories - Git",Repository:"Repository","Repository Not Found":"Repository Not Found","No Repositories":"No Repositories",
"Loading repository":"Loading repository","Loading repositories":"Loading repositories","(no remote)":"(no remote)","location: ":"location: ","${0} file(s) to stage and ${1} file(s) to commit.":"${0} file(s) to stage and ${1} file(s) to commit.","Nothing to commit.":"Nothing to commit.","Nothing to push.":"Nothing to push."," commit(s) to push.":" commit(s) to push.","You have no changes to commit.":"You have no changes to commit.","You have changes to commit in your workspace!":"You have changes to commit in your workspace!",
"Rebase in progress!":"Rebase in progress!","View all local and remote tracking branches":"View all local and remote tracking branches","tracks no branch, ":"tracks no branch, ","tracks ${0}, ":"tracks ${0}, ","last modified ${0} by ${1}":"last modified ${0} by ${1}","No Remote Branches":"No Remote Branches","Rendering branches":"Rendering branches",Commits:"Commits",GettingCurrentBranch:"Getting current branch for ${0}","See Full Log":"See Full Log","See the full log":"See the full log",'Getting commits for "${0}" branch':'Getting commits for "${0}" branch',
"Rendering commits":"Rendering commits","Getting outgoing commits":"Getting outgoing commits","The branch is up to date.":"The branch is up to date.","You have no outgoing or incoming commits.":"You have no outgoing or incoming commits.",") by ":") by "," (SHA ":" (SHA ","Getting tags":"Getting tags","View all tags":"View all tags"," on ":" on "," by ":" by ",Remotes:"Remotes","Rendering remotes":"Rendering remotes","No Remotes":"No Remotes","View all configuration entries":"View all configuration entries",
"Unstaged addition":"Unstaged addition","Staged addition":"Staged addition"," (Rebase in Progress)":" (Rebase in Progress)",Status:"Status","Log (0)":"Log (${0})","Log (0) - 1":"Log (${0}) - ${1}","Status for ${0} - Git ":"Status for ${0} - Git ","No Unstaged Changes":"No Unstaged Changes","No Staged Changes":"No Staged Changes",'Commits for "${0}" branch':'Commits for "${0}" branch','Commits for "${0}" branch against':'Commits for "${0}" branch against',"Add Remote":"Add Remote","Remote Name:":"Remote Name:",
"Remote URI:":"Remote URI:","Apply Patch":"Apply Patch","Git Repository":"Git Repository","Go to the git repository":"Open the Git Repository page for this file or folder.","Clone Git Repository":"Clone Git Repository","Repository URL:":"Repository URL:","Existing directory:":"Existing directory:","New folder:":"New folder:","Choose a Folder":"Choose a Folder","Commit Changes":"Commit Changes","Message:":"Message:","Amend:":"Amend:",SmartAmend:"Amend Previous Commit","ChangeId:":"ChangeId:",SmartChangeId:"Prepare for Gerrit",
"Committer Name:":"Committer Name:","Committer Email:":"Committer Email:","Author Name:":"Author Name:","Author Email:":"Author Email:","The commit message is required.":"The commit message is required.","Git Credentials":"Git Credentials","Username:":"Username:","Private key:":"Private key:","Passphrase (optional):":"Passphrase (optional):","commit:":"commit: ","parent:":"parent: ","branches: ":"branches: ","tags: ":"tags: "," authored by ${0} {${1}) on ${2}":" authored by ${0} (${1}) on ${2}",Content:"Content",
"Go to ${0} section":"Go to ${0} section","Find Commit":"Find Commit","Type the commit name (sha1):":"Type the commit name (sha1):",Search:"Search","Searching...":"Searching...",SelectAll:"Select All","Looking for the commit":"Looking for the commit","New Branch:":"New Branch:","No remote selected":"No remote selected","Enter a name...":"Enter a name...",OK:"OK"," [New branch]":" [New branch]","Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.":"Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.",
"Link Repository":"Link Repository","Folder name:":"Folder name:","Repository was linked to ":"Repository was linked to ","Checkout the current tag, creating a local branch based on its contents.":"Checkout this commit, creating a local branch based on its contents.","Checking out tag ${0}":"Checking out tag ${0}","Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.":"Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.",
"Checking out branch...":"Checking out branch...","Checking out branch ${0}...":"Checking out branch ${0}...","Branch checked out.":"Branch checked out.","New Branch":"New Branch","Add a new local branch to the repository":"Add a new local branch to the repository","Branch name":"Branch name",Delete:"Delete","Delete the local branch from the repository":"Delete the local branch from the repository","Are you sure you want to delete branch ${0}?":"Are you sure you want to delete branch ${0}?","Delete the remote tracking branch from the repository":"Delete the remote tracking branch from the repository",
"Are you sure?":"Are you sure?","You're going to delete remote branch ${0} and push the change.":"You're going to delete remote branch ${0} and push the change.","Removing remote branch: ":"Removing remote branch: ","Delete Remote Branch":"Delete Remote Branch","New Remote":"New Remote","Git Remote":"Git Remote","Go to Git Remote":"Open the remote Git Log page for this file or folder.","Add a new remote to the repository":"Add a new remote to the repository","Delete the remote from the repository":"Delete the remote from the repository",
"Are you sure you want to delete remote ${0}?":"Are you sure you want to delete remote ${0}?",Pull:"Pull","Pull from the repository":"Pull from the repository","Pulling: ":"Pulling: ","Pull Git Repository":"Pull Git Repository","Git Log":"Git Log","Go to Git Log":"Open the local Git Log page for this file or folder.","Open the log for the branch":"Open the log for the branch","Open the log for the repository":"Open the log for the repository","Open the status for the repository":"Open the status for the repository",
ShowInEditor:"Show in Editor",ShowInEditorTooltip:"Show the repository folder in the editor","Compare With Each Other":"Compare With Each Other","Compare With Working Tree":"Compare With Working Tree",Open:"Open",Fetch:"Fetch","Fetch from the remote":"Fetch from the remote","Password:":"Password:","User Name:":"User Name:","Fetching remote: ":"Fetching remote: ","Force Fetch":"Force Fetch","Fetch from the remote branch into your remote tracking branch overriding its current content":"Fetch from the remote branch into your remote tracking branch overriding its current content",
"You're going to override content of the remote tracking branch. This can cause the branch to lose commits.":"You're going to override content of the remote tracking branch. This can cause the branch to lose commits.",Merge:"Merge","Merge the content from the branch to your active branch":"Merge the content from the branch to your active branch",". Go to ${0}.":". Go to ${0}.","Git Status page":"Git Status page",Rebase:"Rebase","Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch ":"Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch ",
"Rebase on top of ":"Rebase on top of ",RebaseSTOPPED:". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing.",RebaseFAILED_WRONG_REPOSITORY_STATE:". Repository state is invalid (i.e. already during rebasing).",RebaseFAILED_UNMERGED_PATHS:". Repository contains unmerged paths.",RebaseFAILED_PENDING_CHANGES:". Repository contains pending changes. Please commit or stash them.",RebaseUNCOMMITTED_CHANGES:". There are uncommitted changes.","Rebase your commits by removing them from the active branch, ":"Rebase your commits by removing them from the active branch, ",
"starting the active branch again based on the latest state of '":"starting the active branch again based on the latest state of '","and applying each commit again to the updated active branch.":"and applying each commit again to the updated active branch.","Push All":"Push All","Push commits and tags from your local branch into the remote branch":"Push commits and tags from your local branch into the remote branch","Push Branch":"Push Branch","Push commits without tags from your local branch into the remote branch":"Push commits without tags from your local branch into the remote branch",
"Push for Review":"Push for Review","Push commits to Gerrit Code Review":"Push commits to Gerrit Code Review","Force Push Branch":"Force Push Branch","Push commits without tags from your local branch into the remote branch overriding its current content":"Push commits without tags from your local branch into the remote branch overriding its current content","Pushing remote: ":"Pushing remote: ","Choose Branch":"Choose Branch","Choose the remote branch.":"Choose the remote branch.","Force Push All":"Force Push All",
"Push commits and tags from your local branch into the remote branch overriding its current content":"Push commits and tags from your local branch into the remote branch overriding its current content","You're going to override content of the remote branch. This can cause the remote repository to lose commits.":"You're going to override content of the remote branch. This can cause the remote repository to lose commits.","\x3c Previous Page":"\x3c Previous Page","Show previous page of git log":"Show previous page of git log",
"Show previous page of git tags":"Show previous page of git tags","Next Page \x3e":"Next Page \x3e","Show next page of git log":"Show next page of git log","Show next page of git tags":"Show next page of git tags","Push from your local branch into the selected remote branch":"Push from your local branch into the selected remote branch","Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.":"Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.",
GitResetIndexConfirm:"The content of your active branch will be replaced with ${0}. All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?","Resetting index...":"Resetting index...","Name:":"Name:",Tag:"Tag","Create a tag for the commit":"Create a tag for the commit","Tag name":"Tag name","Delete the tag from the repository":"Delete the tag from the repository","Are you sure you want to delete tag ${0}?":"Are you sure you want to delete tag ${0}?","Cherry-Pick":"Cherry-Pick",
"Apply the change introduced by the commit to your active branch":"Apply the change introduced by the commit to your active branch","Nothing changed.":"Nothing changed.",". Some conflicts occurred":". Some conflicts occurred.","Fetch from the remote branch into your remote tracking branch":"Fetch from the remote branch into your remote tracking branch","Fetch Git Repository":"Fetch Git Repository",Push:"Push","Push from your local branch into the remote branch":"Push from your local branch into the remote branch",
"Push Git Repository":"Push Git Repository","Key:":"Key:","Value:":"Value:","New Configuration Entry":"New Configuration Entry",Edit:"Edit","Edit the configuration entry":"Edit the configuration entry","Delete the configuration entry":"Delete the configuration entry","Are you sure you want to delete ${0}?":"Are you sure you want to delete ${0}?","Clone Repository":"Clone Repository","Clone an existing Git repository to a folder":"Clone an existing Git repository to a folder","Cloning repository: ":"Cloning repository: ",
"Init Repository":"Init Repository","Create a new Git repository in a new folder":"Create a new Git repository in a new folder","Initializing repository: ":"Initializing repository: ","Init Git Repository":"Init Git Repository","Delete the repository":"Delete the repository","Are you sure you want do delete ${0} repositories?":"Are you sure you want do delete ${0} repositories?","Apply a patch on the selected repository":"Apply a patch on the selected repository","Show content":"Show content","Commit name:":"Commit name:",
"Open Commit":"Open Commit","Open the commit with the given name":"Open the commit with the given name","No commits found":"No commits found","Staging changes":"Staging changes","Commit message:":"Commit message:","Committing changes":"Committing changes","Fetching previous commit message":"Fetching previous commit message","Resetting local changes":"Resetting local changes","Checkout files, discarding all changes":"Checkout files, discarding all changes","Show Patch":"Show Patch","Show workspace changes as a patch":"Show workspace changes as a patch",
"Show checked changes as a patch":"Show checked changes as a patch",Continue:"Continue","Contibue Rebase":"Contibue Rebase","Skip Patch":"Skip Patch",Abort:"Abort","Abort Rebase":"Abort Rebase",Discard:"Discard ${0} file(s)","Your changes to the selected files will be discarded and cannot be recovered.":"Your changes to the selected files will be discarded and cannot be recovered.","Getting git log":"Getting git log","Active Branch Log":"Git Log (Active Branch)","Show the log for the active local branch":"Show the log for the active local branch",
"Remote Branch Log":"Git Log (Remote Branch)","Show the log for the corresponding remote tracking branch":"Show the log for the corresponding remote tracking branch","See Full Status":"See Full Status","See the status":"See the status","Choose target location":"Choose target location","Default target location":"Default target location","Change...":"Change...","Merge Squash":"Merge Squash","Squash the content of the branch to the index":"Squash the content of the branch to the index","Local Branch Name:":"Local Branch Name:",
Local:"local","Filter items":"Filter items","Filter remote branches":"Filter remote branches","Getting remote branches":"Getting remote branches ${0}","Getting branches":"Getting branches ${0}","Paste link in email or IM":"Paste link in email or IM","Show Commit in GitHub":"Show Commit in GitHub","Show Repository in GitHub":"Show Repository in GitHub","Show this commit in GitHub":"Show this commit in GitHub","Show Commit in eclipse.org":"Show Commit in eclipse.org","Show this commit in eclipse.org":"Show this commit in eclipse.org",
"Show Repository in eclipse.org":"Show Repository in eclipse.org","Show this repository in eclipse.org":"Show this repository in eclipse.org","Ask for review":"Ask for review","Ask for review tooltip":"Send email with request for commit review","Reviewer name":"Reviewer name","Contribution Review Request":"Contribution Review Request","Send the link to the reviewer":"Send the link to the reviewer","Private key file (optional):":"Private key file (optional):","Don't prompt me again:":"Don't prompt me again:",
"Your private key will be saved in the browser for further use":"Your private key will be saved in the browser for further use","Loading Contribution Review Request...":"Loading Contribution Review Request...","The commit can be found in the following repositories":"The commit can be found in the following repositories","Try to update your repositories":"Try to update your repositories","Create new repository":"Create new repository","Attach the remote to one of your existing repositories":"Attach the remote to one of your existing repositories",
"You are reviewing contribution ${0} from ${1}":"You are reviewing contribution ${0} from ${1}","Unfortunately the commit can not be found in your workspace. To see it try one of the following: ":"Unfortunately the commit can not be found in your workspace. To see it try one of the following: ","To review the commit you can also:":"To review the commit you can also:","Contribution Review Request for ${0} on ${1}":"Contribution Review Request for ${0} on ${1}","Failing paths: ${0}":"Failing paths: ${0}",
"Problem while performing the action":"Problem while performing the action","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.","URL:":"URL:","File:":"File:",Submit:"Submit","git url:":"git url: ",Revert:"Revert","Revert changes introduced by the commit into your active branch":"Revert changes introduced by the commit into your active branch",
". Could not revert into active branch":". Could not revert into active branch.",Login:"Login","Authentication required for: ${0}. ${1} and re-try the request.":"Authentication required for: ${0}. ${1} and re-try the request.","Remember my committer name and email:":"Remember my committer name and email:","Successfully edited ${0} to have value ${1}":"Successfully edited ${0} to have value ${1}","Successfully added ${0} with value ${1}":"Successfully added ${0} with value ${1}","Signed-off-by: ":"Signed-off-by: ",
"Change-Id: ":"Change-Id: ",REJECTED_NONFASTFORWARD:"Push is non-fastforward and was rejected. Use Fetch to see new commits that must be merged.","Commit and Push":"Commit and Push",Sync:"Sync",SyncTooltip:"Fetch from the remote branch. Rebase your commits by removing them from the local branch, starting the local branch again based on the latest state of the remote branch and applying each commit to the updated local branch. Push commits and tags from your local branch into the remote branch.",NoCommits:"No Commits",
Incoming:"Incoming",Outgoing:"Outgoing",Synchronized:"History",NoBranch:"No Branch",None:"None"});define("git/nls/gitmessages",["orion/i18n!git/nls/gitmessages","git/nls/root/gitmessages"],function(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
(function(l,n){"function"===typeof define&&define.amd?define("orion/Deferred",n):"object"===typeof exports?module.exports=n():(l.orion=l.orion||{},l.orion.Deferred=n())})(this,function(){function l(){for(var d;d=f.shift();)d();h=!1}function n(d){f.push(d);h||(h=!0,g())}function m(d){return function(a){d(a)}}function k(){function d(){for(var a;a=f.shift();){var e=a.deferred,b="fulfilled"===g?"resolve":"reject";a=a[b];if("function"===typeof a)try{var d=a(p),h=d&&("object"===typeof d||"function"===typeof d)&&
d.then;if("function"===typeof h)if(d===e.promise)e.reject(new TypeError);else{var k=d.cancel;"function"===typeof k?e._parentCancel=k.bind(d):delete e._parentCancel;h.call(d,m(e.resolve),m(e.reject),m(e.progress))}else e.resolve(d)}catch(s){e.reject(s)}else e[b](p)}}function a(a){delete h._parentCancel;g="rejected";p=a;f.length&&n(d)}function e(b){function r(a){return function(e){(!g||"assumed"===g)&&a(e)}}delete h._parentCancel;try{var l=b&&("object"===typeof b||"function"===typeof b)&&b.then;if("function"===
typeof l)if(b===h)a(new TypeError);else{g="assumed";var m=b&&b.cancel;if("function"!==typeof m){var w=new k;b=w.promise;try{l(w.resolve,w.reject,w.progress)}catch(z){w.reject(z)}m=b.cancel;l=b.then}p=b;l.call(b,r(e),r(a));h._parentCancel=m.bind(b)}else g="fulfilled",p=b,f.length&&n(d)}catch(B){r(a)(B)}}function b(){var e=h._parentCancel;e?(delete h._parentCancel,e()):g||(e=Error("Cancel"),e.name="Cancel",a(e))}var p,g,f=[],h=this;this.resolve=function(a){g||e(a);return h};this.reject=function(e){g||
a(e);return h};this.progress=function(a){g||f.forEach(function(e){if(e.progress)try{e.progress(a)}catch(b){}});return h.promise};this.cancel=function(){h._parentCancel?setTimeout(b,0):b();return h};this.then=function(a,e,b){var p=new k;p._parentCancel=h.promise.cancel;f.push({resolve:a,reject:e,progress:b,deferred:p});("fulfilled"===g||"rejected"===g)&&n(d);return p.promise};this.promise={then:h.then,cancel:h.cancel}}var f=[],h=!1,g=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var d=
process.nextTick;return function(){d(l)}}if("function"===typeof MutationObserver){var a=document.createElement("div");(new MutationObserver(l)).observe(a,{attributes:!0});return function(){a.setAttribute("class","_tick")}}return function(){setTimeout(l,0)}}();k.all=function(d,a){function e(a,e){f||(g[a]=e,0===--p&&h.resolve(g))}function b(b,d){if(!f){if(a)try{e(b,a(d));return}catch(p){d=p}h.reject(d)}}var p=d.length,g=[],f=!1,h=new k;h.then(void 0,function(){f=!0;d.forEach(function(a){a.cancel&&a.cancel()})});
0===p?h.resolve(g):d.forEach(function(a,d){a.then(e.bind(void 0,d),b.bind(void 0,d))});return h.promise};k.when=function(d,a,e,b){var p;d&&"function"===typeof d.then||(p=new k,p.resolve(d),d=p.promise);return d.then(a,e,b)};return k});
define("orion/EventTarget",[],function(){function l(){this._namedListeners={}}l.prototype={dispatchEvent:function(l){if(!l.type)throw Error("unspecified type");var m=this._namedListeners[l.type];m&&m.forEach(function(k){try{"function"===typeof k?k(l):k.handleEvent(l)}catch(f){"undefined"!==typeof console&&console.log(f)}});return!l.defaultPrevented},addEventListener:function(l,m){if("function"===typeof m||m.handleEvent)this._namedListeners[l]=this._namedListeners[l]||[],this._namedListeners[l].push(m)},
removeEventListener:function(l,m){var k=this._namedListeners[l];if(k)for(var f=0;f<k.length;f++)if(k[f]===m){1===k.length?delete this._namedListeners[l]:k.splice(f,1);break}}};l.prototype.constructor=l;l.attach=function(n){var m=new l;n.dispatchEvent=m.dispatchEvent.bind(m);n.addEventListener=m.addEventListener.bind(m);n.removeEventListener=m.removeEventListener.bind(m)};return l});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(l,n){function m(d,a,e){this._properties=e||{};this._properties["service.id"]=d;this._properties.objectClass=a;this._properties["service.names"]=a}function k(d,a,e){this._serviceId=d;this._serviceReference=a;this._internalRegistry=e}function f(d,a){function e(e){return function(){var b;try{if(!a())throw Error("Service was unregistered");var g=d[e].apply(d,Array.prototype.slice.call(arguments));if(g&&"function"===typeof g.then)return g;
b=new l;b.resolve(g)}catch(f){b=new l,b.reject(f)}return b.promise}}for(var b in d)"function"===typeof d[b]&&(this[b]=e(b))}function h(d,a){this.type=d;this.serviceReference=a}function g(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new n;var d=this;this._internalRegistry={isRegistered:function(a){return d._entries[a]?!0:!1},unregisterService:function(a){var e=d._entries[a];if(!e)throw Error("Service has already been unregistered: "+a);var b=e.reference;d._serviceEventTarget.dispatchEvent(new h("unregistering",
b));d._entries[a]=null;b.getProperty("objectClass").forEach(function(a){for(var e=d._namedReferences[a],g=0;g<e.length;g++)if(e[g]===b){1===e.length?delete d._namedReferences[a]:e.splice(g,1);break}})},modifyService:function(a){var e=d._entries[a];if(!e)throw Error("Service not found while trying to send modified event: "+a);d._serviceEventTarget.dispatchEvent(new h("modified",e.reference))}}}m.prototype={getPropertyKeys:function(){var d=[],a;for(a in this._properties)this._properties.hasOwnProperty(a)&&
d.push(a);return d},getProperty:function(d){return this._properties[d]}};m.prototype.constructor=m;k.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(d){var a=this._serviceReference._properties;this._serviceReference._properties=d||{};d["service.id"]=this._serviceId;
d.objectClass=a.objectClass;d["service.names"]=a["service.names"];this._internalRegistry.modifyService(this._serviceId)}};k.prototype.constructor=k;g.prototype={getService:function(d){var a;if("string"===typeof d)(d=this._namedReferences[d])&&d.some(function(e){a=this._entries[e.getProperty("service.id")].service;return!!a},this);else if(d=this._entries[d.getProperty("service.id")])a=d.service;return a||null},getServiceReferences:function(d){if(d)return this._namedReferences[d]?this._namedReferences[d]:
[];var a=[];this._entries.forEach(function(e){e&&a.push(e.reference)});return a},registerService:function(d,a,e){if("undefined"===typeof a||null===a)throw Error("invalid service");"string"===typeof d?d=[d]:Array.isArray(d)||(d=[]);var b=this._entries.length,p=new m(b,d,e),g=this._namedReferences;d.forEach(function(a){g[a]=g[a]||[];g[a].push(p)});d=new f(a,this._internalRegistry.isRegistered.bind(null,b));this._entries.push({reference:p,service:d});d=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new h("registered",
p));return new k(b,p,d)},addEventListener:function(d,a){this._serviceEventTarget.addEventListener(d,a)},removeEventListener:function(d,a){this._serviceEventTarget.removeEventListener(d,a)}};g.prototype.constructor=g;return{ServiceRegistry:g}});
define("orion/xhr",["orion/Deferred"],function(l){function n(l,k,f,h){var g="undefined"!==typeof f.response?f.response:f.responseText,d;try{d=f.status}catch(a){d=0}l={args:k,response:g,responseText:"string"===typeof g?g:null,status:d,url:l,xhr:f};"undefined"!==typeof h&&(l.error=h);return l}return function(m,k,f){f=f||{};var h=3<arguments.length&&arguments[3]?arguments[3]:new XMLHttpRequest,g=new l,d=f.headers||{},a=f.log||!1,e;"undefined"===typeof d["X-Requested-With"]&&(d["X-Requested-With"]="XMLHttpRequest");
if("undefined"!==typeof f.data&&("POST"===m||"PUT"===m))e=f.data;var b=!1,p=!1;g.promise.then(void 0,function(a){b=!0;!p&&(a instanceof Error&&"Cancel"===a.name)&&h.abort()});h.onabort=function(){p=!0;if(!b){var a=Error("Cancel");a.name="Cancel";g.reject(a)}};h.onload=function(){var e=n(k,f,h);200<=h.status&&400>h.status?g.resolve(e):(g.reject(e),a&&"undefined"!==typeof console&&console.log(Error(h.statusText)))};h.onerror=function(){var e=n(k,f,h);g.reject(e);a&&"undefined"!==typeof console&&console.log(Error(h.statusText))};
h.onprogress=function(a){a.xhr=h;g.progress(a)};try{h.open(m,k,!0);"string"===typeof f.responseType&&(h.responseType=f.responseType);if("number"===typeof f.timeout)if("number"===typeof h.timeout)h.timeout=f.timeout,h.addEventListener("timeout",function(a){g.reject(n(k,f,h,"Timeout exceeded"))});else{var q=setTimeout(function(){g.reject(n(k,f,h,"Timeout exceeded"))},f.timeout);g.promise.then(clearTimeout.bind(null,q),clearTimeout.bind(null,q))}Object.keys(d).forEach(function(a){h.setRequestHeader(a,
d[a])});h.send(e||null)}catch(t){g.reject(n(k,f,h,t))}return g.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(l,n,m){function k(a,b){this._name=a;this._providers=b;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function f(a,b){return{get:function(d,g){if(0===b)return null;var f=localStorage.getItem(a+d);if(null===f)return null;f=JSON.parse(f);return g||-1===b||f._expires&&f._expires>(new Date).getTime()?(delete f._expires,f):null},set:function(d,g){if(0!==b)if(-1!==b&&(g._expires=(new Date).getTime()+
1E3*b),0===Object.keys(g).length)localStorage.removeItem(a+d);else{var f=JSON.stringify(g);localStorage.setItem(a+d,f);delete g._expires}},remove:function(b){localStorage.removeItem(a+b)}}}function h(a){this._currentPromises={};this._cache=new f("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var b=a.getServiceReferences("orion.core.preference.provider");0<b.length&&(this._service=a.getService(b[0]))}return!!this._service}}function g(a){this._location=
a;this._currentPromise=null;this._cache=new f("/orion/preferences/default",3600)}function d(){this._cache=new f("/orion/preferences/local",-1)}function a(a,b){this._userProvider=new h(a);this._localProvider=new d;b=b||"defaults.pref";-1===b.indexOf("://")&&(b=l.toUrl(b));this._defaultsProvider=new g(b);this._serviceRegistration=a.registerService("orion.core.preference",this)}k.prototype={_flush:function(){for(var a=[],b=0;b<this._stores.length;++b){var d=this._stores[b];-1!==this._dirty.indexOf(d)&&
a.push(this._providers[b].put(this._name,d));if(this._pendingDeletes[b]&&0<this._pendingDeletes[b].length){for(d=0;d<this._pendingDeletes[b].length;d++)a.push(this._providers[b].remove(this._name,this._pendingDeletes[b][d]));delete this._pendingDeletes[b]}}this._dirty=[];return n.all(a)},_scheduleFlush:function(a){a&&-1===this._dirty.indexOf(a)&&this._dirty.push(a);this._flushPending||(this._flushPending=!0,window.setTimeout(function(){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 b=this._stores[a],d;for(d in b)b.hasOwnProperty(d)&&"undefined"===typeof this._cached[d]&&(this._cached[d]=b[d])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,b){if(0!==this._stores.length){var d=this._stores[0];d[a]!==b&&(d[a]=b,this._cached=null,this._scheduleFlush(d))}},remove:function(a){for(var b=0;b<
this._stores.length;++b){var d=this._stores[b];if(d.hasOwnProperty(a))return delete d[a],this._pendingDeletes[b]||(this._pendingDeletes[b]=[]),this._pendingDeletes[b].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 b=this,d=[],g=0;g<this._providers.length;++g)d.push(this._providers[g].get(this._name,
a).then(function(a){return function(e){b._stores[a]=e}}(g)));return n.all(d).then(function(){b._cached=null;b._getCached()})},flush:function(){this._flush()}};h.prototype={get:function(a,b){if(this._currentPromises[a])return this._currentPromises[a];var d=new n,g=null;b?this._cache.remove(a):g=this._cache.get(a);if(null!==g)d.resolve(g);else{this._currentPromises[a]=d;var f=this;this._service.get(a).then(function(b){f._cache.set(a,b);delete f._currentPromises[a];d.resolve(b)},function(b){404===b.status?
(b={},f._cache.set(a,b),delete f._currentPromises[a],d.resolve(b)):(delete f._currentPromises[a],d.resolve(f._cache.get(a,!0)||{}))})}return d},put:function(a,b){this._cache.set(a,b);return this._service.put(a,b)},remove:function(a,b){var d=this._cache.get(a);delete d[b];this._cache.set(a,d);return this._service.remove(a,b)}};g.prototype={get:function(a,b){if(this._currentPromise)return this._currentPromise;var d=new n,g=null;b?this._cache.remove(a):g=this._cache.get(a);if(null!==g)d.resolve(g);else{this._currentPromise=
d;var f=this;m("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(b){b=JSON.parse(b.response);f._cache.set(a,b[a]||{});f._currentPromise=null;d.resolve(b[a]||{})},function(b){401===b.xhr.status||404===b.xhr.status?(f._cache.set(a,{}),f._currentPromise=null,d.resolve({})):(f._currentPromise=null,b=f._cache.get(a,!0),null!==b?d.resolve(b[a]||{}):d.resolve({}))})}return d},put:function(a,b){var d=new n;d.resolve();return d},remove:function(a,b){var d=this._cache.get(a);
delete d[b];this.put(a,d)}};d.prototype={get:function(a){var b=new n;a=this._cache.get(a);null!==a?b.resolve(a):b.resolve({});return b},put:function(a,b){var d=new n;this._cache.set(a,b);d.resolve();return d},remove:function(a,b){var d=this._cache.get(a);delete d[b];this.put(a,d)}};a.DEFAULT_SCOPE=1;a.LOCAL_SCOPE=2;a.USER_SCOPE=4;a.prototype={listenForChangedSettings:function(e,b,d){if(!b||"number"!==typeof b||7<b||1>b)d=b,b=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;window.addEventListener("storage",
d,!1);return 0!==(a.USER_SCOPE&b)?"/orion/preferences/user"+e:0!==(a.LOCAL_SCOPE&b)?"/orion/preferences/local"+e:"/orion/preferences/default"+e},getPreferences:function(e,b){if(!b||"number"!==typeof b||7<b||1>b)b=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;var d=[];a.USER_SCOPE&b&&this._userProvider.available()&&d.push(this._userProvider);a.LOCAL_SCOPE&b&&d.push(this._localProvider);a.DEFAULT_SCOPE&b&&d.push(this._defaultsProvider);var g=new k(e,d);return g.sync().then(function(){return g})},getSetting:function(a,
b,d){for(var g,f=0;f<a.length;f++)if(a[f].label===b)for(var h=0;h<a[f].data.length;h++)if(a[f].data[h].label===d){g=a[f].data[h].value;break}return g}};return{PreferencesService:a}});
(function(){function l(a){if("string"!==typeof a)throw new TypeError;}function n(a){return a?a.split("\x26"):[]}function m(a){return 0===a.length?"":a.join("\x26")}function k(a){var b=/([^=]*)(?:=?)(.*)/.exec(a);a=b[1]?decodeURIComponent(b[1]):"";b=b[2]?decodeURIComponent(b[2]):"";return[a,b]}function f(a){var b=encodeURIComponent(a[0]);a[1]&&(b+="\x3d"+encodeURIComponent(a[1]));return b}function h(a,b){var e="",d=[],g=0;return{next:function(){e!==a.query&&(e=a.query,d=n(e));if(g<d.length){var v=
k(d[g++]);switch(b){case "keys":return v[0];case "values":return v[1];case "keys+values":return[v[0],v[1]];default:throw new TypeError;}}throw D;}}}function g(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function d(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function a(a){var b=[];a.split("/").forEach(function(a){".."===a?b.pop():"."!==a&&b.push(a)});return b.join("/")}function e(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function b(b,v){if("string"!==
typeof b)throw new TypeError;b=e(b);var g=s.exec(b);if(!g)return null;var p={};p.scheme=g[1]||"";if(p.scheme&&!r.test(p.scheme))return null;var f=g[2];if(f&&(f=y.exec(f),p.userinfo=f[1],p.host=f[2],p.port=f[3],p.port&&!x.test(p.port)))return null;p.path=g[3];p.query=g[4];p.fragment=g[5];!p.scheme&&v&&(p.scheme=v.scheme,!p.host&&v.host&&(p.userinfo=v.userinfo,p.host=v.host,p.port=v.port,p.pathRelative=!0));p.pathRelative&&(p.path?"/"!==p.path[0]&&(g=/^(.*\/)[^\/]*$/.exec(v.path)[1]||"/",p.path=g+p.path):
p.path=v.path);p.scheme&&(p.scheme=p.scheme.toLowerCase());p.port&&(p.port=d(p.port));p.host&&p.path&&(p.path=a(p.path));return p}function p(a,e){var d;if(e){e=e.href||e;d=b(e);if(!d||!d.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:d})}d=b(a,d);if(!d)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:d,writable:!0});var p=new g(this);Object.defineProperty(this,"query",{get:function(){return this._url?
p:null},enumerable:!0})}try{var q;if("function"===typeof window.URL&&0!==window.URL.length&&"http:"===(q=new window.URL("http://www.w3.org?q")).protocol&&q.query)return}catch(t){}var s=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,y=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,r=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,x=/^\d*$/,u=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,w=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,z=/^([^?#\s]*)$/,B=/^([^\s]*)$/,v=/^\S*$/,A=/([^:]*):?(.*)/,D="undefined"!==
typeof StopIteration?StopIteration:Error("Stop Iteration"),C={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(g.prototype,{get:{value:function(a){l(a);var b;n(this._url.query).some(function(e){e=k(e);if(e[0]===a)return b=e[1],!0});return b},enumerable:!0},set:{value:function(a,b){l(a);l(b);var e=n(this._url.query);e.some(function(d,p){var v=k(d);if(v[0]===a)return v[1]=b,e[p]=f(v),!0})||e.push(f([a,b]));this._url.query=m(e)},enumerable:!0},has:{value:function(a){l(a);
return n(this._url.query).some(function(b){if(k(b)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){l(a);var b=n(this._url.query),e=b.filter(function(b){return k(b)[0]!==a});return e.length!==b.length?(this._url.query=m(e),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,b){if("function"!==typeof a)throw new TypeError;var e=h(this._url,"keys+values");try{for(;;){var d=e.next();a.call(b,d[1],d[0],this)}}catch(p){if(p!==D)throw p;
}},enumerable:!0},keys:{value:function(){return h(this._url,"keys")},enumerable:!0},values:{value:function(){return h(this._url,"values")},enumerable:!0},items:{value:function(){return h(this._url,"keys+values")}},size:{get:function(){return n(this._url.query).length},enumerable:!0},getAll:{value:function(a){l(a);var b=[];n(this._url.query).forEach(function(e){e=k(e);e[0]===a&&b.push(e[1])});return b},enumerable:!0},append:{value:function(a,b){l(a);l(b);var e=n(this._url.query);e.push(f([a,b]));this._url.query=
m(e)},enumerable:!0}});Object.defineProperties(p.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var b=a.scheme?a.scheme+":":"";a.host&&(b+="//",a.userinfo&&(b+=a.userinfo+"@"),b+=a.host,a.port&&(b+=":"+a.port));b+=a.path;a.query&&(b+="?"+a.query);a.fragment&&(b+="#"+a.fragment);a=b}else a=this._input;return a},set:function(a){l(a);this._input=a;this._url=b(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:
""},enumerable:!0},protocol:{get:function(){return this._url?this._url.scheme+":":":"},set:function(a){l(a);if(this._url&&(a=":"===a.slice(-1)?a.substring(0,a.length-1):a,""===a||r.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){l(a);this._url&&(this._url.userinfo=a)}},username:{get:function(){if(!this._url)return"";var a=A.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){l(a);if(this._url){var b=
A.exec(this._userinfo);a=[encodeURIComponent(a||"")];b[2]&&a.push(b[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=A.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){l(a);if(this._url){var b=[A.exec(this._userinfo)[1]||""];a&&b.push(encodeURIComponent(a));this._userinfo=b.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=w.exec(a)))this._url.host=a[1],this._url.port=d(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){l(a);this._url&&u.exec(a)&&(this._url.host=a)},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===C[this.protocol]&&(a="");return a},set:function(a){l(a);this._url&&x.exec(a)&&(this._url.port=d(a))},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(b){l(b);
this._url&&z.exec(b)&&(this._url.host&&(b&&"/"!==b[0])&&(b="/"+b),this._url.path=b?a(b):"")},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){l(a);this._url&&(a&&"?"===a[0]&&(a=a.substring(1)),B.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);this._url&&(a&&"#"===a[0]&&(a=a.substring(1)),v.exec(a)&&(this._url.fragment=a))},enumerable:!0}});
if((q=window.URL||window.webkitURL)&&q.createObjectURL)Object.defineProperty(p,"createObjectURL",{value:q.createObjectURL.bind(q),enumerable:!1}),Object.defineProperty(p,"revokeObjectURL",{value:q.revokeObjectURL.bind(q),enumerable:!1});window.URL=p})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(l,n){function m(a,b){var e=Object.keys(a),d=Object.keys(b);if(e.length!==d.length)return!1;e.sort();d.sort();for(var g=0,f=e.length;g<f;g++){var h=e[g];if(h!==d[g])return!1;var k=a[h],h=b[h];if(k!==h&&JSON.stringify(k)!==JSON.stringify(h))return!1}return!0}function k(a){if(-1===a.indexOf("://"))try{return(new URL(a,location.href)).href}catch(b){}return a}function f(a){var b=null,e={key:function(e){return(b=
b||Object.keys(a))[e]},getItem:function(b){return a[b]},setItem:function(e,d){a[e]=d;b=null},removeItem:function(e){delete a[e];b=null},clear:function(){(b=b||Object.keys(a)).forEach(function(b){delete a[b]}.bind(this));b=null}};Object.defineProperty(e,"length",{get:function(){return(b=b||Object.keys(a)).length}});return e}function h(a,b){if(b&&b instanceof XMLHttpRequest){var e,d;try{e=b.status,d=b.statusText}catch(g){e=0,d=""}return{status:e||0,statusText:d}}return b}function g(a){var b=a?JSON.parse(JSON.stringify(a,
h)):a;a instanceof Error&&(b.__isError=!0,b.message=b.message||a.message,b.name=b.name||a.name);return b}function d(a,b){this.type=a;this.plugin=b}function a(a,b){this.__objectId=a;this.__methods=b}function e(b,e,f){function h(a){I&&f.postMessage(a,I)}function k(b){if(!I)return(new l).reject(Error("plugin not connected"));b.id=String(V++);var e=new l;W[b.id]=e;e.then(null,function(a){"active"===F&&(a instanceof Error&&"Cancel"===a.name)&&h({requestId:b.id,method:"cancel",params:a.message?[a.message]:
[]})});var d=Object.prototype.toString;b.params.forEach(function(g,v){if("[object Object]"===d.call(g)&&!(g instanceof a)){var p,f;for(p in g)"[object Function]"===d.call(g[p])&&(f=f||[],f.push(p));if(f){var A=U++;T[A]=g;p=function(){delete T[A]};e.then(p,p);b.params[v]=new a(A,f)}}});f.postMessage(b,I);return e.promise}function r(a,b){a||0===a?h({id:a,result:null,error:b}):console.log(b)}function x(a,b,e,d){d.forEach(function(a,b){if(a&&"undefined"!==typeof a.__objectId){var e={};a.__methods.forEach(function(b){e[b]=
function(){return k({objectId:a.__objectId,method:b,params:Array.prototype.slice.call(arguments)})}});d[b]=e}});var v=void 0===typeof a?null:{id:a,result:null,error:null};try{var p=e.apply(b,d);v&&(p&&"function"===typeof p.then?(S[a]=p,p.then(function(b){delete S[a];v.result=b;h(v)},function(b){S[a]&&(delete S[a],v.error=g(b),h(v))},function(){h({responseId:a,method:"progress",params:Array.prototype.slice.call(arguments)})})):(v.result=p,h(v)))}catch(f){v&&(v.error=g(f),h(v))}}function u(a){try{if(a.method){var b=
a.method,e=a.params||[];if("serviceId"in a){var d=ba[a.serviceId];d||r(a.id,"service not found");b in d?x(a.id,d,d[b],e):r(a.id,"method not found")}else if("objectId"in a){var v=T[a.objectId];v||r(a.id,"object not found");b in v?x(a.id,v,v[b],e):r(a.id,"method not found")}else if("requestId"in a){var g=S[a.requestId];g&&("cancel"===b&&g.cancel)&&g.cancel.apply(g,e)}else if("responseId"in a){var p=W[a.responseId];p&&("progress"===b&&p.progress)&&p.progress.apply(p,e)}else if("plugin"===a.method){I.connected();
var q=a.params[0];X({headers:q.headers,services:q.services}).then(function(){H&&H.resolve(A)})}else if("timeout"===a.method)H&&H.reject(a.error);else throw Error("Bad method: "+a.method);}else{var D=W[String(a.id)];delete W[String(a.id)];if(a.error){var h=f.handleServiceError(A,a.error);D.reject(h)}else D.resolve(a.result)}}catch(k){console.log("Plugin._messageHandler "+k)}}function w(b){var e={};if(b.methods&&(b.methods.forEach(function(a){e[a]=function(){var e={serviceId:b.serviceId,method:a,params:Array.prototype.slice.call(arguments)};
return"active"===F?k(e):A.start({"transient":!0}).then(function(){return k(e)})}}),e.addEventListener&&e.removeEventListener)){var d=new n,v=U++;T[v]={handleEvent:d.dispatchEvent.bind(d)};var g=new a(v,["handleEvent"]),p=e.addEventListener;e.addEventListener=function(a,b){d._namedListeners[a]||p(a,g);d.addEventListener(a,b)};var f=e.removeEventListener;e.removeEventListener=function(a,b){d.removeEventListener(a,b);d._namedListeners[a]||f(a,g)}}return e}function z(a){var e=JSON.parse(JSON.stringify(a.properties));
e.__plugin__=b;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);e.objectClass=a;return e}function B(a){var b=w(a),e=z(a),e=f.registerService(a.names||a.type,b,e);J[a.serviceId]={registration:e,proxy:b}}function v(){f.persist(b,{created:D,headers:C,services:E,autostart:K,lastModified:L})}var A=this;e=e||{};var D=e.created||(new Date).getTime(),C=e.headers||{},E=e.services||[],K=e.autostart,L=e.lastModified||0,F="installed",G,H,I,P,J={},V=0,U=0,S={},W={},T={},ba={},X;this._default=!1;this._persist=v;
this._resolve=function(){F="resolved";f.dispatchEvent(new d("resolved",A))};this._getAutostart=function(){return K};this._getCreated=function(){return D};this.getLocation=function(){return b};this.getHeaders=function(){return JSON.parse(JSON.stringify(C))};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 L};this.getServiceReferences=function(){var a=
[];Object.keys(J).forEach(function(b){a.push(J[b].registration.getReference())});return a};this.setParent=function(a){return P!==a?(P=a,A.stop({"transient":!0}).then(function(){if("started"===K)return A.start({"transient":!0});if("lazy"===K)return A.start({lazy:!0,"transient":!0})})):(new l).resolve()};this.getState=function(){return F};this.start=function(a){if("uninstalled"===F)return(new l).reject(Error("Plugin is uninstalled"));if(G)return G.promise.then(this.start.bind(this,a));if("active"===
F)return(new l).resolve();if(!a||!a.transient){var e=a&&a.lazy?"lazy":"started";e!==K&&(K=e,v())}e=f.getState();if("starting"!==e&&"active"!==e)return a.transient?(new l).reject(Error("start transient error")):(new l).resolve();if("installed"===F)try{this._resolve()}catch(g){return(new l).reject(g)}"resolved"===F&&E.forEach(function(a){B(a)});if(a&&a.lazy)return"starting"!==F&&(F="starting",f.dispatchEvent(new d("lazy activation",A))),(new l).resolve();var q=new l;G=q;F="starting";f.dispatchEvent(new d("starting",
A));H=new l;I=f.connect(b,u,P);H.then(function(){H=null;F="active";f.dispatchEvent(new d("started",A));G=null;q.resolve()},function(){H=null;F="stopping";f.dispatchEvent(new d("stopping",A));Object.keys(J).forEach(function(a){J[a].registration.unregister();delete J[a]});f.disconnect(I);I=null;F="resolved";G=null;f.dispatchEvent(new d("stopped",A));q.reject(Error("Failed to load plugin: "+b));A._default&&(L=0,v())});return q.promise};this.stop=function(a){if("uninstalled"===F)return(new l).reject(Error("Plugin is uninstalled"));
if(G)return G.promise.then(this.stop.bind(this,a));if((!a||!a.transient)&&"stopped"!==K)K="stopped",v();if("active"!==F&&"starting"!==F)return(new l).resolve();G=a=new l;F="stopping";f.dispatchEvent(new d("stopping",A));Object.keys(J).forEach(function(a){J[a].registration.unregister();delete J[a]});I&&(f.disconnect(I),I=null);F="resolved";G=null;f.dispatchEvent(new d("stopped",A));a.resolve();return a.promise};X=function(a){if("uninstalled"===F)return(new l).reject(Error("Plugin is uninstalled"));
if(!a)return 0===L&&(L=(new Date).getTime(),v()),f.loadManifest(b).then(X,function(){A._default&&(L=0,v());console.log("Failed to load plugin: "+b)});var e=C,g=E,q=K;C=a.headers||{};E=a.services||[];K=a.autostart||K;a.lastModified?L=a.lastModified:(L=(new Date).getTime(),v());if(m(C,e)&&m(E,g)&&K===q)return(new l).resolve();if("active"===F||"starting"===F){var D=[];Object.keys(E).forEach(function(a){var b=E[a];D.push(a);var e=J[a];if(e){if(m(b.methods,Object.keys(e.proxy))){a=z(b);var d=e.registration.getReference(),
v={};d.getPropertyKeys().forEach(function(a){v[a]=d.getProperty(a)});m(a,v)||e.registration.setProperties(a);return}e.registration.unregister();delete J[a]}B(b)});Object.keys(J).forEach(function(a){-1===D.indexOf(a)&&(J[a].registration.unregister(),delete J[a])})}"active"===F&&(f.disconnect(I),H=new l,I=f.connect(b,u,P),H.then(function(){H=null},function(){H=null;F="stopping";f.dispatchEvent(new d("stopping"),A);Object.keys(J).forEach(function(a){J[a].registration.unregister();delete J[a]});f.disconnect(I);
I=null;F="resolved";f.dispatchEvent(new d("stopped",A))}));return(new l).resolve()};this.update=function(a){return X(a).then(function(){f.dispatchEvent(new d("updated",A))})};this.uninstall=function(){if("uninstalled"===F)return(new l).reject(Error("Plugin is uninstalled"));if("active"===F||"starting"===F||"stopping"===F)return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));f.removePlugin(this);F="uninstalled";f.dispatchEvent(new d("uninstalled",A));return(new l).resolve()}}
var b=/^http[s]?/i;return{Plugin:e,PluginRegistry:function(a,g){function h(a){var b=a.source;u.some(function(e){if(b===e.target){try{var d;if("undefined"===typeof e.useStructuredClone){var g="string"!==typeof a.data;d=g?a.data:JSON.parse(a.data);e.useStructuredClone=g}else d=e.useStructuredClone?a.data:JSON.parse(a.data);e.handler(d)}catch(p){}return!0}})}g=g||{};var s=g.storage||localStorage;s.getItem||(s=f(s));var y="installed",r,m=[],u=[],w=new n,z={},B={registerService:a.registerService.bind(a),
connect:function(a,b,e,d){function g(a){a=Error(a);a.name="timeout";b({method:"timeout",error:a})}var p={handler:b,url:a},f=setTimeout(g.bind(null,"Load timeout for: "+a),d||15E3),q=document.createElement("iframe");q.name=a+"_"+(new Date).getTime();q.src=a;q.onload=function(){clearTimeout(f);f=setTimeout(g.bind(null,"Plugin handshake timeout for: "+a),5E3)};q.sandbox="allow-scripts allow-same-origin";q.style.width=q.style.height="100%";q.frameBorder=0;(e||r).appendChild(q);p.target=q.contentWindow;
p.connected=function(){clearTimeout(f)};p.close=function(){clearTimeout(f);if(q){var a=q.parentNode;a&&a.removeChild(q);q=null}};u.push(p);return p},disconnect:function(a){for(var b=0;b<u.length;b++)if(a===u[b]){u.splice(b,1);try{a.close()}catch(e){}break}},removePlugin:function(a){for(var b=0;b<m.length;b++)if(a===m[b]){m.splice(b,1);break}s.removeItem("plugin."+a.getLocation())},persist:function(a,b){s.setItem("plugin."+a,JSON.stringify(b))},postMessage:function(a,b){b.target.postMessage(b.useStructuredClone?
a:JSON.stringify(a),b.url)},dispatchEvent:function(a){try{w.dispatchEvent(a)}catch(b){console&&console.log("PluginRegistry.dispatchEvent "+b)}},loadManifest:function(a){var b=new l,e=B.connect(a,function(a){e&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],B.disconnect(e),e=null,b.resolve(a)):"timeout"===a.method&&(B.disconnect(e),e=null,b.reject(a.error)))});return b.promise},getState:function(){return y},handleServiceError:function(a,e){if(e&&401===e.status){var d=a.getHeaders(),
g=a.getName()||a.getLocation(),p=document.createElement("span");p.appendChild(document.createTextNode("Authentication required for: "+g+"."));d.login&&(p.appendChild(document.createTextNode(" ")),g=document.createElement("a"),g.target="_blank",g.textContent="Login",g.href=d.login,b.test(g.href)?(p.appendChild(g),p.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+d.login));return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(p)}}if(e.__isError){var f=
e;e=Error(f.message);Object.keys(f).forEach(function(a){e[a]=f[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=B.getState;this.init=function(){if(!("starting"===y||"active"===y||"stopping"===y)){addEventListener("message",h,!1);for(var a=[],b=0,d=s.length;b<d;b++)a.push(s.key(b));a.forEach(function(a){if(0===
a.indexOf("plugin.")){var b=a.substring(7);a=JSON.parse(s.getItem(a));a.created&&m.push(new e(b,a,B))}});m.sort(function(a,b){return a._getCreated()<b._getCreated()?-1:1});g.parent?r=g.parent:(r=document.createElement("div"),g.visible||(r.style.display="none",r.style.visibility="hidden"),document.body.appendChild(r));g.plugins&&Object.keys(g.plugins).forEach(function(a){a=k(a);var b=this.getPlugin(a);b?b._default=!0:(b=g.plugins[a],"object"!==typeof b&&(b={}),b.autostart=b.autostart||g.defaultAutostart||
"lazy",b=new e(a,b,B),b._default=!0,m.push(b))}.bind(this));y="starting"}};this.start=function(){"starting"!==y&&this.init();if("starting"!==y)return(new l).reject("Cannot start framework. Framework is already "+y+".");var a=[],b=(new Date).getTime();m.forEach(function(e){var d=e._getAutostart();0===e.getLastModified()?a.push(e.update().then(function(){if("started"===d)return e.start({"transient":!0});if("lazy"===d)return e.start({lazy:!0,"transient":!0});e._resolve()})):"started"===d?a.push(e.start({"transient":!0})):
"lazy"===d?(a.push(e.start({lazy:!0,"transient":!0})),b>e.getLastModified()+864E5&&e.update()):e._resolve()});return l.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){y="active"})};this.stop=function(){if("starting"!==y&&"active"!==y)return(new l).reject("Cannot stop registry. Registry is already "+y+".");y="stopping";var a=[];m.forEach(function(b){a.push(b.stop({"transient":!0}))});return l.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){if(!g.parent){var a=
r.parentNode;a&&a.removeChild(r)}r=null;removeEventListener("message",h);y="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,b){a=k(a);var g=this.getPlugin(a);if(g)return(new l).resolve(g);if(z[a])return z[a];if(b)return g=new e(a,b,B),m.push(g),g._persist(),B.dispatchEvent(new d("installed",g)),(new l).resolve(g);var p=B.loadManifest(a).then(function(b){g=new e(a,
b,B);m.push(g);g._persist();delete z[a];B.dispatchEvent(new d("installed",g));return g},function(b){delete z[a];throw b;});return z[a]=p};this.getPlugins=function(){return m.slice()};this.getPlugin=function(a){var b=null;a=k(a);m.some(function(e){if(a===e.getLocation())return b=e,!0});return b};this.addEventListener=w.addEventListener.bind(w);this.removeEventListener=w.removeEventListener.bind(w);this.resolvePlugins=function(){var a=!0;m.forEach(function(b){a=a&&b._resolve()});return a}}}});
define("orion/objects",[],function(){function l(l){for(var m=Object.prototype.hasOwnProperty,k=1,f=arguments.length;k<f;k++){var h=arguments[k],g;for(g in h)m.call(h,g)&&(l[g]=h[g])}return l}return{clone:function(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var m=Object.create(Object.getPrototypeOf(n));l(m,n);return m},mixin:l,toArray:function(l){return Array.isArray(l)?l:[l]}}});
define("orion/serviceTracker",[],function(){function l(k,f){function h(b){var e=b.getProperty("service.id"),g=this.addingService(b);g&&(d[e]=b,a[e]=g)}function g(b){var e=b.getProperty("service.id"),g=a[e];delete d[e];delete a[e];this.removedService(b,g)}this.serviceRegistry=k;var d={},a={},e=n,b,p;this.close=function(){if(e!==m)throw"Already closed";e=n;k.removeEventListener("registered",b);k.removeEventListener("unregistering",p);p=b=null;var a=this;this.getServiceReferences().forEach(function(b){g.call(a,
b)});if("function"===typeof this.onClose)this.onClose()};this.getServiceReferences=function(){var a=Object.keys(d);return!a.length?null:a.map(function(a){return d[a]})};this.open=function(){if(e!==n)throw"Already open";e=m;var a=this;b=function(b){if(-1!==b.serviceReference.getProperty("objectClass").indexOf(f)&&(h.call(a,b.serviceReference),"function"===typeof a.onServiceAdded))return a.onServiceAdded(b.serviceReference,a.serviceRegistry.getService(b.serviceReference))};p=function(b){-1!==b.serviceReference.getProperty("objectClass").indexOf(f)&&
g.call(a,b.serviceReference)};k.addEventListener("registered",b);k.addEventListener("unregistering",p);k.getServiceReferences(f).forEach(function(b){h.call(a,b);if("function"===typeof a.onServiceAdded)return a.onServiceAdded(b,k.getService(b))});if("function"===typeof this.onOpen)this.onOpen()}}var n=0,m=1;l.prototype={addingService:function(k){return this.serviceRegistry.getService(k)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(k,f){}};return l});
define("orion/config",["orion/Deferred","orion/objects","orion/preferences","orion/serviceTracker"],function(l,n,m,k){var f=m.PreferencesService,h,g,d,a,e=f.DEFAULT_SCOPE,b="pid",p="/cm/configurations";h=function(a,e,d){function g(a,b,d){b.forEach(function(g,p){try{var f=a[p].getProperty("__plugin__"),q=f&&e.getPlugin(f);(!f||q&&"active"===q.getState())&&b[p].updated(d)}catch(h){"undefined"!==typeof console&&console.log(h)}})}k.call(this,a,"orion.cm.managedservice");var p={},f={},h=function(e){var g=
[];e.plugin.getServiceReferences().forEach(function(e){if(-1!==e.getProperty("objectClass").indexOf("orion.cm.managedservice")){var p=e.getProperty(b);e=a.getService(e);p&&e&&(p=(p=d._find(p))&&p.getProperties(),g.push(e.updated(p)))}});return l.all(g)};this.addingService=function(e){var d=e.getProperty(b),g=a.getService(e);if(!d||!g)return null;p[d]||(p[d]=[]);f[d]||(f[d]=[]);p[d].push(e);f[d].push(g);return g};this.onServiceAdded=function(a,e){var p=a.getProperty(b),p=d._find(p);g([a],[e],p&&p.getProperties())};
this.onOpen=function(){e.addEventListener("started",h)};this.onClose=function(){e.removeEventListener("started",h)};this.notifyUpdated=function(a){var b=a.getPid();g(p[b]||[],f[b]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();g(p[a]||[],f[a]||[],null)};this.removedService=function(a,e){var d=a.getProperty(b),g=p[d],q=f[d];1<g.length?g.splice(g.indexOf(a),1):delete p[d];1<q.length?q.splice(q.indexOf(e),1):delete f[d]}};m=function(){function a(b,e,p){this.store=new g(this,p);this.configAdmin=
new d(this,this.store);this.tracker=new h(b,e,this.store)}a.prototype={getConfigurationAdmin:function(){var a=this;return this.configAdmin._init().then(function(b){a.tracker.open();return b})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();d=function(){function a(b,e){this.factory=b;this.store=e}a.prototype={_prefName:p,_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},
getDefaultConfiguration:function(a){return this.store._find(a,e)},listConfigurations:function(){return this.store.list()}};return a}();g=function(){function d(a,b){this.factory=a;this.prefsService=b;this.pref=this.configs=this.defaultConfigs=null;var g=this;this.initPromise=l.all([this.prefsService.getPreferences(p,e),this.prefsService.getPreferences(p)]).then(function(a){var b=a[0];g.pref=a[1];g.defaultConfigs=g._toConfigs(b,!0);g.configs=g._toConfigs(g.pref,!1,b)})}d.prototype={_toConfigs:function(e,
d,g){var p=Object.create(null),f=this;e.keys().forEach(function(q){if(!p[q]){var h=e.get(q),k=g&&g.get(q);"object"===typeof h&&(null!==h&&0<Object.keys(h).length)&&(h[b]=q,p[q]=new a(f.factory,f,h,d,k))}});return p},_init:function(){return this.initPromise},_find:function(a,b){return b===f.DEFAULT_SCOPE?this.defaultConfigs[a]||null:this.configs[a]||null},get:function(b){var d=this._find(b),g=this._find(b,e);d||(d=g&&g.getProperties(!0),d=new a(this.factory,this,b,!1,d),this.configs[b]=d);return d},
list:function(){var a=this,b=[];this.pref.keys().forEach(function(e){(e=a._find(e))&&null!==e.getProperties()&&b.push(e)});return b},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,b){var d=b.getProperties(!0)||{},g=this._find(a,e);if(g){var p=g.getProperties(!0);Object.keys(p).forEach(function(a){Object.prototype.hasOwnProperty.call(d,a)&&d[a]===p[a]&&delete d[a]})}this.pref.put(a,d)}};return d}();a=function(){function a(e,d){d=n.clone(d);delete d[b];e.properties=d}
function e(d,g,p,f,h){this.factory=d;this.store=g;this.readOnly=f;if(null!==p&&"object"===typeof p)this.pid=p[b],a(this,p);else if("string"===typeof p)this.pid=p,this.properties=null;else throw Error("Invalid pid/properties "+p);if(h){var k=this;Object.keys(h).forEach(function(a){a===b||Object.prototype.hasOwnProperty.call(k.properties,a)||(k.properties[a]=h[a])})}}e.prototype={_checkReadOnly:function(){if(this.readOnly)throw Error("Configuration is read only");},_checkRemoved:function(){if(this.removed)throw Error("Configuration was removed");
},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(a){this._checkRemoved();var e=null;this.properties&&(e=n.clone(this.properties),a||(e[b]=this.pid));return e},remove:function(){this._checkReadOnly();this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this.removed=!0},update:function(b){this._checkReadOnly();this._checkRemoved();a(this,b);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:m}});
define("orion/bootstrap","require orion/Deferred orion/serviceregistry orion/preferences orion/pluginregistry orion/config".split(" "),function(l,n,m,k,f,h){var g;return{startup:function(){if(g)return g;g=new n;var d=new m.ServiceRegistry,a=new k.PreferencesService(d);return a.getPreferences("/plugins").then(function(e){var b={plugins:{}};e.keys().forEach(function(a){var d=l.toUrl(a);b.plugins[d]=e[a]});var p=new f.PluginRegistry(d,b);return p.start().then(function(){if(0<d.getServiceReferences("orion.core.preference.provider").length)return a.getPreferences("/plugins",
a.USER_SCOPE).then(function(a){var b=[];a.keys().forEach(function(a){a=l.toUrl(a);p.getPlugin(a)||b.push(p.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return n.all(b,function(a){console.log(a)})})}).then(function(){return(new h.ConfigurationAdminFactory(d,p,a)).getConfigurationAdmin().then(d.registerService.bind(d,"orion.cm.configadmin"))}).then(function(){var a=d.getService("orion.core.auth");if(a){var b=a.getUser().then(function(b){if(b)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 b}}).then(function(){var b={serviceRegistry:d,preferences:a,pluginRegistry:p};g.resolve(b);return b})})}}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell",ShellLinkWorkspace:"Workspace Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor",EditorRelatedLink:"Show Current Folder",EditorRelatedLinkParent:"Show Enclosing Folder",EditorLinkWorkspace:"Show Workspace",EditorRelatedLinkProj:"Show Project","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","Orion Image Viewer":"Orion Image Viewer","Orion Markdown Editor":"Orion Markdown Editor","Orion Markdown Viewer":"Orion Markdown Viewer",
"Orion JSON Editor":"Orion JSON 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.":"2014-06-28_22-01-29","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","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.",Browser:"Web Browser",OutlineProgress:"Getting outline for ${0} from ${1}",UnknownError:"An unknown error occurred.",UnknownWarning:"An unknown warning occurred.",Filter:"Filter (* \x3d any string, ? \x3d any character)",
"To view the browser's context menu, trigger the context menu again.":"To view the browser's context menu, trigger the context menu again.",Edit:"Edit",CentralNavTooltip:"Toggle Navigation Menu"});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/util",[],function(){var l=navigator.userAgent,n=-1!==l.indexOf("MSIE")||-1!==l.indexOf("Trident")?document.documentMode:void 0,m=parseFloat(l.split("Firefox/")[1]||l.split("Minefield/")[1])||void 0,k=-1!==l.indexOf("Opera")?parseFloat(l.split("Version/")[1]):void 0,f=parseFloat(l.split("Chrome/")[1])||void 0,h=-1!==l.indexOf("Safari")&&!f,g=parseFloat(l.split("WebKit/")[1])||void 0,d=-1!==l.indexOf("Android"),a=-1!==l.indexOf("iPad"),l=-1!==l.indexOf("iPhone"),e=a||l,b=-1!==navigator.platform.indexOf("Mac"),
p=-1!==navigator.platform.indexOf("Win"),q=-1!==navigator.platform.indexOf("Linux"),t="undefined"!==typeof document&&"ontouchstart"in document.createElement("input");return{formatMessage:function(a){var b=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,e){return b[(e<<0)+1]})},createElement:function(a,b){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",b):a.createElement(b)},isIE:n,isFirefox:m,isOpera:k,isChrome:f,isSafari:h,isWebkit:g,isAndroid:d,isIPad:a,isIPhone:l,
isIOS:e,isMac:b,isWindows:p,isLinux:q,isTouch:t,platformDelimiter:p?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(l){function n(a,e){e||(e=document);return e.querySelectorAll(a)}function m(a){var e=a.tabIndex;0===e&&l.isIE&&!{a:!0,body:!0,button:!0,frame:!0,iframe:!0,img:!0,input:!0,isindex:!0,object:!0,select:!0,textarea:!0}[a.nodeName.toLowerCase()]&&!a.attributes.tabIndex&&(e=-1);return e}function k(a){if(0<=m(a))return a;if(a.hasChildNodes())for(var e=0;e<a.childNodes.length;e++){var b=k(a.childNodes[e]);if(b)return b}return null}function f(a){if(0<=
m(a))return a;if(a.hasChildNodes())for(var e=a.childNodes.length-1;0<=e;e--){var b=f(a.childNodes[e]);if(b)return b}return null}function h(a,e){if(3===a.nodeType){var b=g.exec(a.nodeValue);b&&1<b.length&&e(a,b)}if(a.hasChildNodes())for(b=0;b<a.childNodes.length;b++)h(a.childNodes[b],e)}var g=/\$\{([^\}]+)\}/,d=null;return{$:function(a,e){e||(e=document);return e.querySelector(a)},$$:n,$$array:function(a,e){return Array.prototype.slice.call(n(a,e))},node:function(a){var e=a;"string"===typeof a&&(e=
document.getElementById(a));return e},contains:function(a,e){if(!a||!e)return!1;if(a===e)return!0;var b=a.compareDocumentPosition(e);return Boolean(b&16)},bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+document.documentElement.scrollLeft,top:a.top+document.documentElement.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:k,lastTabbable:f,stop:function(a){window.document.all&&(a.keyCode=0);a.preventDefault&&
(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,e){h(a,function(a,d){a.parentNode.replaceChild(document.createTextNode(e[d[1]]||d[1]),a)})},processDOMNodes:function(a,e){h(a,function(a,d){var g=e[d[1]];if(g){var f=document.createRange(),h=d.index;f.setStart(a,h);f.setEnd(a,h+d[0].length);f.deleteContents();f.insertNode(g)}})},addAutoDismiss:function(a,e){function b(a){d.forEach(function(b){var e=!1,d=b.excludeNodes.some(function(b){return document.body.contains(b)?(e=!0,b.contains(a.target)):
!1});if(e&&!d)try{b.dismiss(a)}catch(g){"undefined"!==typeof console&&console&&console.error(g&&g.message)}});d=d.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}null===d&&(d=[],document.addEventListener("click",b,!0),l.isIOS&&document.addEventListener("touchend",function(a){function b(){a.target.removeEventListener("click",b)}0===a.touches.length&&a.target.addEventListener("click",b)},!1));d.push({excludeNodes:a,dismiss:e})},setFramesEnabled:function(a){for(var e=
document.getElementsByTagName("iframe"),b=0;b<e.length;b++)e[b].parentNode.style.pointerEvents=a?"":"none"},removeAutoDismiss:function(a){d=d.filter(function(e){return a!==e.dismiss})},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("text",["module"],function(l){var n,m,k=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],f=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,h=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,g="undefined"!==typeof location&&location.href,d=g&&location.protocol&&location.protocol.replace(/\:/,""),a=g&&location.hostname,e=g&&(location.port||void 0),b=[],p=l.config&&l.config()||{};n={version:"2.0.5",strip:function(a){if(a){a=a.replace(f,"");var b=a.match(h);b&&(a=b[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:p.createXhr||function(){var a,b,e;if("undefined"!==typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!==typeof ActiveXObject)for(b=0;3>b;b+=1){e=k[b];try{a=new ActiveXObject(e)}catch(d){}if(a){k=[e];break}}return a},parseName:function(a){var b,
e,d=!1,g=a.indexOf(".");b=0===a.indexOf("./")||0===a.indexOf("../");-1!==g&&(!b||1<g)?(b=a.substring(0,g),e=a.substring(g+1,a.length)):b=a;a=e||b;g=a.indexOf("!");-1!==g&&(d="strip"===a.substring(g+1),a=a.substring(0,g),e?e=a:b=a);return{moduleName:b,ext:e,strip:d}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,b,e,d){var g,p;g=n.xdRegExp.exec(a);if(!g)return!0;a=g[2];g=g[3];g=g.split(":");p=g[1];g=g[0];return(!a||a===b)&&(!g||g.toLowerCase()===e.toLowerCase())&&(!p&&!g||p===d)},finishLoad:function(a,
e,d,g){d=e?n.strip(d):d;p.isBuild&&(b[a]=d);g(d)},load:function(b,f,h,k){if(k.isBuild&&!k.inlineText)h();else{p.isBuild=k.isBuild;var l=n.parseName(b);k=l.moduleName+(l.ext?"."+l.ext:"");var m=f.toUrl(k),u=p.useXhr||n.useXhr;!g||u(m,d,a,e)?n.get(m,function(a){n.finishLoad(b,l.strip,a,h)},function(a){h.error&&h.error(a)}):f([k],function(a){n.finishLoad(l.moduleName+"."+l.ext,l.strip,a,h)})}},write:function(a,e,d,g){b.hasOwnProperty(e)&&(g=n.jsEscape(b[e]),d.asModule(a+"!"+e,"define(function () { return '"+
g+"';});\n"))},writeFile:function(a,b,e,d,g){b=n.parseName(b);var p=b.ext?"."+b.ext:"",f=b.moduleName+p,h=e.toUrl(b.moduleName+p)+".js";n.load(f,e,function(b){b=function(a){return d(h,a)};b.asModule=function(a,b){return d.asModule(a,h,b)};n.write(a,f,b,g)},g)}};if("node"===p.env||!p.env&&"undefined"!==typeof process&&process.versions&&process.versions.node)m=require.nodeRequire("fs"),n.get=function(a,b){var e=m.readFileSync(a,"utf8");0===e.indexOf("\ufeff")&&(e=e.substring(1));b(e)};else if("xhr"===
p.env||!p.env&&n.createXhr())n.get=function(a,b,e,d){var g=n.createXhr(),f;g.open("GET",a,!0);if(d)for(f in d)d.hasOwnProperty(f)&&g.setRequestHeader(f.toLowerCase(),d[f]);if(p.onXhr)p.onXhr(g,a);g.onreadystatechange=function(d){4===g.readyState&&(d=g.status,399<d&&600>d?(d=Error(a+" HTTP status: "+d),d.xhr=g,e(d)):b(g.responseText))};g.send(null)};else if("rhino"===p.env||!p.env&&"undefined"!==typeof Packages&&"undefined"!==typeof java)n.get=function(a,b){var e,d,g=new java.io.File(a),p=java.lang.System.getProperty("line.separator"),
g=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(g),"utf-8")),f="";try{e=new java.lang.StringBuffer;(d=g.readLine())&&(d.length()&&65279===d.charAt(0))&&(d=d.substring(1));for(null!==d&&e.append(d);null!==(d=g.readLine());)e.append(p),e.append(d);f=String(e.toString())}finally{g.close()}b(f)};return n});define("text!orion/banner/slideout.html",[],function(){return'\x3cdiv id\x3d"slideContainer" class\x3d"slideParameters slideContainer"\x3e\n\t\x3cspan id\x3d"pageCommandParameters" class\x3d"layoutLeft parameters"\x3e\x3c/span\x3e\n\t\x3cspan id\x3d"pageCommandDismiss" class\x3d"layoutRight parametersDismiss"\x3e\x3c/span\x3e\n\x3c/div\x3e'});
define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(l,n,m){return{slideoutHTMLFragment:function(k){var f=document.createElement("div");f.innerHTML=m;var h=n.$("#slideContainer",f);h.id=k+h.id;h=n.$("#pageCommandParameters",f);h.id=k+h.id;h=n.$("#pageCommandDismiss",f);h.id=k+h.id;return f.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(l){function n(k,f,h,g,d,a){this.type=a||"keydown";this.keyCode="string"===typeof k&&"keydown"===this.type?k.toUpperCase().charCodeAt(0):k;this.mod1=void 0!==f&&null!==f?f:!1;this.mod2=void 0!==h&&null!==h?h:!1;this.mod3=void 0!==g&&null!==g?g:!1;this.mod4=void 0!==d&&null!==d?d:!1}function m(k){this.keys=k}n.prototype={getKeys:function(){return[this]},match:function(k,f){if(void 0!==f){if(0!==f)return!1}else if(k instanceof Array){if(1<k.length)return!1;
k=k[0]}return k.type!==this.type?!1:this.keyCode===k.keyCode||this.keyCode===String.fromCharCode(l.isOpera?k.which:void 0!==k.charCode?k.charCode:k.keyCode)?this.mod1!==(l.isMac?k.metaKey:k.ctrlKey)||"keydown"===this.type&&this.mod2!==k.shiftKey||this.mod3!==k.altKey||l.isMac&&this.mod4!==k.ctrlKey?!1:!0:!1},equals:function(k){return!k||this.keyCode!==k.keyCode||this.mod1!==k.mod1||this.mod2!==k.mod2||this.mod3!==k.mod3||this.mod4!==k.mod4||this.type!==k.type?!1:!0}};m.prototype={getKeys:function(){return this.keys.slice(0)},
match:function(k,f){var h=this.keys;if(void 0!==f)return f>h.length?!1:h[f].match(k)?f===h.length-1?!0:f+1:!1;k instanceof Array||(k=[k]);if(k.length>h.length)return!1;var g;for(g=0;g<k.length;g++)if(!h[g].match(k[g]))return!1;return g===h.length?!0:g},equals:function(k){if(!k.keys||k.keys.length!==this.keys.length)return!1;for(var f=0;f<k.keys.length;f++)if(!k.keys[f].equals(this.keys[f]))return!1;return!0}};return{KeyBinding:n,KeyStroke:n,KeySequence:m}});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(l,n,m){function k(g){m.attach(this);this._init(g)}function f(g,d){var a=document.createElement(void 0===d?"span":d);a.tabIndex=0;a.className="dropdownMenuItem";a.role="menuitem";var e=document.createElement("span");e.appendChild(document.createTextNode(g));e.classList.add("dropdownCommandName");a.appendChild(e);e=document.createElement("li");e.appendChild(a);return e}function h(){var g=document.createElement("li");
g.classList.add("dropdownSeparator");return g}k.prototype={_init:function(g){this._dropdownNode=n.node(g.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=g.populate;this._selectionClass=g.selectionClass;this._parentDropdown=g.parentDropdown;this._positioningNode=g.positioningNode;if(!this._parentDropdown)for(var d=this._dropdownNode.parentNode;d&&document!==d;){if(d.classList&&d.classList.contains("dropdownMenu")){this._parentDropdown=d.dropdown;break}d=d.parentNode}this._dropdownNode.tabIndex=
0;this._triggerNode=g.triggerNode?g.triggerNode:n.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!g.skipTriggerEventListeners){var a=this;this._triggerNode.addEventListener("click",function(e){a.toggle(e)&&n.stop(e)},!1);"span"===this._triggerNode.tagName.toLowerCase()&&this._triggerNode.addEventListener("keydown",function(e){if(e.keyCode===n.KEY.ENTER||e.keyCode===n.KEY.SPACE)a.toggle(),n.stop(e)},!1)}this._dropdownNode.addEventListener("keydown",
this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(g){var d=this;g.addEventListener("click",function(a){d.toggle(a)&&n.stop(a)},!1)},toggle:function(g){return this.isVisible()?this.close():this.open(g)},isVisible:function(){return this._isVisible},open:function(g){var d=!1;this.isVisible()||(this.dispatchEvent({type:"triggered",dropdown:this,event:g}),n.setFramesEnabled(!1),this._populate&&(this.empty(),this._populate(this._dropdownNode)),0<this.getItems().length&&(this._hookedAutoDismiss||
(this._boundAutoDismiss?n.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),d=n.$$array(".dropdownSubMenu",this._dropdownNode),n.addAutoDismiss([this._triggerNode].concat(d),this._boundAutoDismiss),this._hookedAutoDismiss=!0),this._triggerNode.classList.add("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.add(this._selectionClass),this._dropdownNode.classList.add("dropdownMenuOpen"),this._isVisible=!0,this._positionDropdown(g),this._focusDropdownNode(),
d=!0,this._parentDropdown&&this._parentDropdown.submenuOpen(this)));return d},_focusDropdownNode:function(){this._dropdownNode.focus()},_autoDismiss:function(g){if(this.close(!1)&&this._dropdownNode.contains(g.target))for(g=this._parentDropdown;g;)g.close(!1),g=g._parentDropdown},_positionDropdown:function(g){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+"px";else{g=n.bounds(this._dropdownNode);
var d=n.bounds(document.body);if(g.left+g.width>d.left+d.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-g.width+"px";else{var a=n.bounds(this._boundingNode(this._triggerNode)),e=n.bounds(this._triggerNode);this._dropdownNode.style.left=e.left-a.left-g.width+e.width+"px"}g=g.top+g.height-(d.top+d.height);0<g&&(this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-g)+"px")}},_boundingNode:function(g){var d=window.getComputedStyle(g,null);
return null===d||"absolute"===d.getPropertyValue("position")||!g.parentNode||g===document.body?g:this._boundingNode(g.parentNode)},close:function(g){var d=!1;this.isVisible()&&(this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),n.setFramesEnabled(!0),g&&this._triggerNode.focus(),this._isVisible=!1,this._selectedItem&&(this._selectedItem.classList.remove("dropdownMenuItemSelected"),
this._selectedItem=null),d=!0);return d},getItems:function(){var g=[],d=this;n.$$array("li:not(.dropdownSeparator) \x3e .dropdownMenuItem",this._dropdownNode,!0).forEach(function(a){a.parentNode.parentNode===d._dropdownNode&&g.push(a)});g.forEach(function(a){a._hasDropdownMouseover||(a.addEventListener("mouseover",function(e){a.dropdown?a.dropdown.open(e):(d._closeSelectedSubmenu(),n.stop(e));d._selectItem(a)}),a._hasDropdownMouseover=!0)});return g},empty:function(){var g=this;n.$$array("li",this._dropdownNode).forEach(function(d){d.parentNode===
g._dropdownNode&&d.parentNode.removeChild(d)});this._hookedAutoDismiss=!1},_dropdownKeyDown:function(g){if(g.keyCode===n.KEY.UP||g.keyCode===n.KEY.DOWN||g.keyCode===n.KEY.RIGHT||g.keyCode===n.KEY.ENTER||g.keyCode===n.KEY.LEFT){var d=this.getItems();if(d.length&&0<d.length){if(this._selectedItem){var a=d.indexOf(this._selectedItem);0>a&&(a=d.indexOf(this._selectedItem.parentNode));0<=a&&(g.keyCode===n.KEY.UP&&0<a?(a--,this._selectItem(d[a])):g.keyCode===n.KEY.DOWN&&a<d.length-1?(a++,this._selectItem(d[a])):
g.keyCode===n.KEY.ENTER||g.keyCode===n.KEY.RIGHT?this._selectedItem.classList.contains("dropdownTrigger")&&this._selectedItem.dropdown?(this._selectedItem.dropdown.open(),this._selectedItem.dropdown._selectItem()):g.keyCode===n.KEY.ENTER&&this._selectedItem.click():g.keyCode===n.KEY.LEFT&&this._selectedItem.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&(this.close(!0),this._parentDropdown&&this._parentDropdown._dropdownNode.focus()))}else this._selectItem(d[0]);n.stop(g)}}else g.keyCode===
n.KEY.ESCAPE&&(this.close(!0),n.stop(g))},_selectItem:function(g){if(g=g||this.getItems()[0])this._selectedItem&&this._selectedItem.classList.remove("dropdownMenuItemSelected"),this._selectedItem=g,this._selectedItem.classList.add("dropdownMenuItemSelected");document.activeElement!==this._dropdownNode&&this._dropdownNode.focus()},submenuOpen:function(g){g!==this._selectedSubmenu&&(this._closeSelectedSubmenu(),this._selectedSubmenu=g)},_closeSelectedSubmenu:function(){for(var g=this._selectedSubmenu;g;)g.close(),
g=g._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&n.removeAutoDismiss(this._boundAutoDismiss)},appendMenuItem:function(g,d){var a=f(g,d);this._dropdownNode.appendChild(a);return a},appendSeparator:function(){var g=h();this._dropdownNode.appendChild(g);return g}};k.prototype.constructor=k;return{Dropdown:k,appendKeyBindingString:function(g,d){var a=document.createElement("span");a.classList.add("dropdownKeyBinding");a.appendChild(document.createTextNode(d));g.appendChild(a)},
createMenuItem:f,createSeparator:h}});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'\x3cbutton class\x3d"dropdownTrigger"\x3e${ButtonText}\x3c!--span class\x3d"dropdownArrowDown core-sprite-openarrow"\x3e\x3c/span--\x3e\x3c/button\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e'});define("text!orion/webui/dropdowntriggerbuttonwitharrow.html",[],function(){return'\x3cbutton class\x3d"dropdownTrigger dropdownDefaultButton"\x3e${ButtonText}\x3cspan class\x3d"dropdownArrowDown core-sprite-openarrow"\x3e\x3c/span\x3e\x3c/button\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e'});
define("text!orion/webui/submenutriggerbutton.html",[],function(){return'\x3cli class\x3d"dropdownSubMenu"\x3e\x3cspan class\x3d"dropdownTrigger dropdownMenuItem" role\x3d"menuitem" tabindex\x3d"0"\x3e\x3cspan class\x3d"dropdownCommandName"\x3e${ButtonText}\x3c/span\x3e\x3cspan class\x3d"dropdownArrowRight core-sprite-closedarrow"\x3e\x3c/span\x3e\x3c/span\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e\x3c/li\x3e'});define("text!orion/webui/checkedmenuitem.html",[],function(){return'\x3cli\x3e\x3clabel class\x3d"dropdownMenuItem"\x3e\x3cinput class\x3d"checkedMenuItem" role\x3d"menuitem" type\x3d"checkbox" /\x3e${ItemText}\x3c/label\x3e\x3c/li\x3e'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(l,n){function m(k){this._init(k)}m.prototype={_init:function(k){this._node=n.node(k.node);if(!this._node)throw"no dom node for tooltip found";this._position=k.position||["right","above","below","left"];this._text=k.text;this._hideDelay=void 0===k.hideDelay?200:k.hideDelay;this._tailSize=k.tailSize||10;this._trigger=k.trigger||"mouseover";this._afterShowing=k.afterShowing;this._afterHiding=k.afterHiding;var f=this;if("click"===
this._trigger)this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(g){g.target===f._node&&(f.show(),n.stop(g))},!1);else if("mouseover"===this._trigger){this._showDelay=void 0===k.showDelay?500:k.showDelay;k=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(g){n.contains(f._node,g.target)&&(f.show(),n.stop(g))},!1);this._leaveHandler=function(g){n.contains(f._node,g.target)&&f.hide()};for(var h=0;h<k.length;h++)this._node.addEventListener(k[h],
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);var k=document.createTextNode(this._text);this._tipTextContent.appendChild(k)}this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var f=this;n.addAutoDismiss([this._tip,this._node],function(){f.hide()});"mouseover"===this._trigger&&(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(h){f._timeout&&(window.clearTimeout(f._timeout),f._timeout=null);f._tip.addEventListener("mouseout",function(g){n.contains(f._tip,g.target)&&(f.hide(),n.stop(g))},
!1)},!1))}return this._tip},_positionTip:function(k,f){this._makeTipNode();"left"===k?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var h=this._node,g;for(g=n.bounds(h);h&&!g.width&&!g.height;h=h.parentNode)g=n.bounds(h);var h=n.bounds(this._tipInner),d;switch(k){case "above":d=g.top-h.height-this._tailSize-1;g=g.left-this._tailSize;break;case "below":d=g.top+g.height+this._tailSize+1;g=g.left-this._tailSize;break;case "left":d=g.top-this._tailSize/2;g=g.left-h.width-
this._tailSize-1;break;default:d=g.top-this._tailSize/2,g=g.left+g.width+this._tailSize+1}var a=n.bounds(document.documentElement);if(d+h.height>a.height)if(f)d=a.height-h.height-1;else return!1;if(g+h.width>a.width)if(f)g=a.width-h.width-1;else return!1;if(0>g)if(f)g=4;else return!1;if(0>d)if(f)d=4;else return!1;this._tail&&this._tail.previousPosition!==k&&(this._tip.removeChild(this._tail),this._tail=null);this._tail||(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+
k),"above"===k||"left"===k?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),this._tail.previousPosition=k);this._tip.style.top=d+"px";this._tip.style.left=g+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing"))this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null),this._showDelay?this._timeout=window.setTimeout(this._showImmediately.bind(this),
this._showDelay):this._showImmediately()},_showImmediately:function(){for(var k=!1,f=0;!k&&f<this._position.length;)k=this._positionTip(this._position[f]),f++;k||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(k){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);if(this._tip&&this._tip.classList.contains("tooltipShowing")){void 0===k&&(k=this._hideDelay);var f=this;this._timeout=window.setTimeout(function(){f._tip.classList.remove("tooltipShowing");
f._tip.removeAttribute("style");f._afterHiding&&f._afterHiding()},k)}},destroy:function(){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);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 k=["mouseout","click"],f=0;f<k.length;f++)this._node.removeEventListener(k[f],
this._leaveHandler,!1)}}};m.prototype.constructor=m;return{Tooltip:m}});
define("orion/commands","orion/util orion/webui/littlelib orion/webui/dropdown text!orion/webui/dropdowntriggerbutton.html text!orion/webui/dropdowntriggerbuttonwitharrow.html text!orion/webui/submenutriggerbutton.html text!orion/webui/checkedmenuitem.html orion/webui/tooltip".split(" "),function(l,n,m,k,f,h,g,d){function a(a){var b=a.invocation;if(b){var e=a.command;if(e.hrefCallback)return a=e.hrefCallback.call(b.handler||window,b),a.then?a.then(function(a){window.open(a)}):window.open(a),!0;if(b.commandRegistry)return b.commandRegistry._invoke(b),
!0;if(e.onClick||e.callback)return window.setTimeout(function(){(e.onClick||e.callback).call(b.handler||window,b)},0),!0}return!1}function e(b,e){for(var d in e)if(e[d]&&(e[d].keyBinding&&e[d].command)&&e[d].keyBinding.match(b)){var g=e[d],p=g.keyBinding;if((!p.domScope||n.contains(n.node(p.domScope),b.target))&&a(g)){n.stop(b);break}}}function b(){var a={};if(x){var b,e,d;e=Object.keys(u);for(b=0;b<e.length;b++)d=e[b],a[d]=u[d];var g=x();e=Object.keys(g);for(b=0;b<e.length;b++)d=e[b],a[d]=g[d]}else a=
u;return a}function p(a){e(a,b())}function q(a,b){a=a||window.event;if(function(a){if(l.isMac){if(a.metaKey&&!a.altKey)return!a.shiftKey&&!a.ctrlKey&&(65===a.keyCode||67===a.keyCode||86===a.keyCode||88===a.keyCode||90===a.keyCode)?!0:!1;if(a.ctrlKey)return!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(65===a.keyCode||67===a.keyCode||86===a.keyCode||88===a.keyCode||90===a.keyCode)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return 0<a["char"].length;if(a.charCode||a.keyCode)switch(a=a.charCode||
a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return 32<=a&&112>a||123<a}return!1}(a)){if("true"===a.target.contentEditable)return;var e=a.target.nodeName.toLowerCase();if("input"===e)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("textarea"===e)return}b?b(a):p(a)}function t(){this._init()}
function s(a,b,e){b.classList.add("commandImage");var d;a.imageClass?a.addImageClassToElement?b.classList.add(a.imageClass):(d=document.createElement("span"),b.appendChild(d),d.classList.add(a.spriteClass),d.classList.add(a.imageClass)):(d=new Image,d.alt=a.name,d.name=e,d.id=e,d.src=a.image,b.appendChild(d));return d}function y(a,b,e,d,g){this.commandRegistry=g;this.handler=a;this.items=b;this.userData=e;this.command=d;d.parameters&&(this.parameters=d.parameters.makeCopy());this.id=d.id}function r(a){this._init(a)}
var x=null,u={};t.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(b){return q(b,function(b){var e=a.proxy,d=a.bindings;if(d&&e)for(var g=0;g<d.length;g++)d[g].match(b)&&(e.processKey({type:b.type,keyCode:b.keyCode,altKey:b.altKey,ctrlKey:b.ctrlKey,metaKey:b.metaKey,shiftKey:b.shiftKey}),n.stop(b))})})}};window.document.addEventListener("keydown",q,!1);y.prototype={collectsParameters:function(){return this.commandRegistry&&
this.commandRegistry.collectsParameters()},makeCopy:function(a){var b=new y(this.handler,this.items,this.userData,this.command,this.commandRegistry);b.domNode=this.domNode;b.domParent=this.domParent;a?b.parameters=a.makeCopy():this.parameters&&(b.parameters=this.parameters.makeCopy());return b}};y.prototype.constructor=y;r.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;
this.positioningNode=a.positioningNode;this.image=a.image||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC";this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.extraClass=a.extraClass;this.selectionClass=a.selectionClass;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters;this.isEditor=a.isEditor},populateChoicesMenu:function(a,
b,e,d,g){e=this.getChoices(b,e,d);var p=e.some(function(a){return a.checked});e.forEach(function(e){if(e.name){var d=document.createElement("li");a.appendChild(d);var f=document.createElement("span");f.tabIndex=0;f.role="menuitem";f.classList.add("dropdownMenuItem");if(p){var v=document.createElement("span");v.classList.add("check");v.appendChild(document.createTextNode(e.checked?"\u25cf":""));f.appendChild(v)}v=document.createTextNode(e.name);f.appendChild(v);d.appendChild(f);f.choice=e;f.addEventListener("click",
function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,b)},!1);f.addEventListener("keydown",function(a){(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,b)},!1)}else g._generateMenuSeparator(a)})},getChoices:function(a,b,e){return this.choiceCallback?this.choiceCallback.call(b,a,e):null},makeChoiceCallback:function(a,b){return function(e){a.callback&&a.callback.call(a,b,e)}},hasImage:function(){return this.imageClass||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"!==this.image}};r.prototype.constructor=r;return{Command:r,CommandInvocation:y,createDropdownMenu:function(a,b,e,d,g,p,q,h,t){a=n.node(a);if(!a)throw"no parent node was specified";var l=document.createRange();l.selectNode(a);l=t?l.createContextualFragment(f):l.createContextualFragment(k);n.processTextNodes(l,{ButtonText:b});a.appendChild(l);a=a.lastChild;
var y;t?(t=a.previousSibling,y=t.lastChild):t=a.previousSibling;d?t.classList.add(d):(t.classList.add("orionButton"),t.classList.add("commandButton"));g&&(p||(t.textContent="",t.setAttribute("aria-label",b)),s({spriteClass:"commandSprite",imageClass:g},t,b),t.classList.add("orionButton"));t.dropdown=new m.Dropdown({dropdown:a,populate:e,selectionClass:q,skipTriggerEventListeners:!!y,positioningNode:h});a.dropdown=t.dropdown;return{menuButton:t,menu:a,dropdown:t.dropdown,dropdownArrow:y}},createCheckedMenuItem:function(a,
b,e,d){a=n.node(a);if(!a)throw"no parent node was specified";var p=document.createRange();p.selectNode(a);p=p.createContextualFragment(g);n.processTextNodes(p,{ItemText:b});a.appendChild(p);a=n.$(".checkedMenuItem",a.lastChild);a.checked=e;a.addEventListener("change",d,!1);return a},createCommandItem:function(a,b,e,g,p,f,q){var h;f=f||!b.name&&b.hasImage();if(b.hrefCallback)h=document.createElement("a"),h.id=g,f&&b.hasImage()?s(b,h,g):(h.className="commandLink",h.appendChild(document.createTextNode(b.name))),
q=b.hrefCallback.call(e.handler,e),q.then?q.then(function(a){h.href=a}):h.href=q?q:"#";else{h=document.createElement("button");h.className="orionButton";b.extraClass&&h.classList.add(b.extraClass);f?b.hasImage()?(s(b,h,g),b.name&&h.setAttribute("aria-label",b.name)):(h.classList.add("commandButton"),h.classList.add("commandMissingImageButton"),h.appendChild(document.createTextNode(b.name))):(h.classList.add("commandButton"),g=document.createTextNode(b.name),h.appendChild(g));var k=q||b.callback;k&&
(b.onClick=k,h.addEventListener("click",function(a){k.call(e.handler,e)},!1))}"ul"===a.nodeName.toLowerCase()?(q=document.createElement("li"),a.appendChild(q),a=q):h.classList.add("commandMargins");a.appendChild(h);b.tooltip&&(h.commandTooltip=new d.Tooltip({node:h,text:b.tooltip,position:["above","below","right","left"]}));p&&(u[b.id]={keyBinding:p,command:b,invocation:e});return h},createCommandMenuItem:function(a,b,e,g,p,f){var q,h,k=a.dropdown;if(b.hrefCallback)h=m.createMenuItem(b.name,"a"),
q=h.firstElementChild,p=b.hrefCallback.call(e.handler,e),p.then?p.then(function(a){q.href=a}):q.href=p?p:"#",q.addEventListener("keydown",function(a){(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)&&q.click()},!1);else{h=m.createMenuItem(b.name);q=h.firstElementChild;var t=p||b.callback;t&&(b.onClick=t,q.addEventListener("click",function(a){k.close(!0);t.call(e.handler,e)},!1),q.addEventListener("keydown",function(a){if(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)a.preventDefault(),q.click()},
!1))}b.tooltip&&(q.commandTooltip=new d.Tooltip({node:q,text:b.tooltip,position:["above","below","right","left"]}));f&&m.appendKeyBindingString(q,f);a.appendChild(h);g&&(u[b.id]={keyBinding:g,command:b,invocation:e});return q},executeBinding:a,setKeyBindingProvider:function(a){x=a},localKeyBindings:u,CommandsProxy:t,getKeyBindings:b,processKey:p,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",
_testMethodProcessKey:e}});define("orion/explorers/navigationUtils",[],function(){function l(l,k,f,h){!n&&l&&(l.push({domNode:k}),k.tabIndex=-1,k.style.outline="none")}var n=-1!==navigator.userAgent.indexOf("iPad");return{addNavGrid:function(m,k,f){m&&(m=m.getGridNavHolder(k,!0))&&l(m,f)},generateNavGrid:l,removeNavGrid:function(l,k){if(l)for(var f=0;f<l.length;f++)if(l[f].domNode===k){l.splice(f,1);break}}}});
define("orion/PageUtil",[],function(){var l=/^http[s]?/i;return{hash:function(){var l=window.location.href.split("#")[1];return l?"#"+l:""},matchResourceParameters:function(l){l=l||window.location.toString();var m={resource:""},k=l.indexOf("#");if(-1!==k&&(l=l.substring(k+1),0!==l.length)){l=l.split(",");m.resource=decodeURIComponent(l[0]);for(k=1;k<l.length;k++){var f=/([^=]*)(=?)(.*)/.exec(l[k]),h=decodeURIComponent(f[1]||""),f=decodeURIComponent(f[3]||"");""!==h&&"resource"!==h&&(m[h]=f)}}return m},
validateURLScheme:function(n,m){var k=n;if(-1===n.indexOf("://")){var f=document.createElement("a");f.href=n;k=f.href}f=!1;if(f=m?m.some(function(f){return RegExp("^"+f+":","i").test(k)}):l.test(k))return n;console.log("Illegal URL Scheme: '"+n+"'");return""}}});
define("orion/uiUtils",["orion/webui/littlelib"],function(l){function n(k){var f="",h=-1!==navigator.platform.indexOf("Mac");h?(k.mod4&&(f+="\u2303"),k.mod3&&(f+="\u2325"),k.mod2&&(f+="\u21e7"),k.mod1&&(f+="\u2318")):(k.mod1&&(f+="Ctrl+"),k.mod2&&(f+="Shift+"),k.mod3&&(f+="Alt+"));if(k.alphaKey)return f+k.alphaKey;if("keypress"===k.type)return f+k.keyCode;for(var g in l.KEY)if(typeof("number"===l.KEY[g])&&l.KEY[g]===k.keyCode){if(h)switch(l.KEY[g]){case l.KEY.BKSPC:g="\u232b";break;case l.KEY.TAB:g=
"\u21e5";break;case l.KEY.ENTER:g="\u23ce";break;case l.KEY.ESCAPE:g="\u238b";break;case l.KEY.SPACE:g="\u2423";break;case l.KEY.PAGEUP:g="\u21de";break;case l.KEY.PAGEDOWN:g="\u21df";break;case l.KEY.END:g="\u21f2";break;case l.KEY.HOME:g="\u21f1";break;case l.KEY.DEL:g="\u2326"}switch(l.KEY[g]){case l.KEY.DOWN:g="\u2193";break;case l.KEY.UP:g="\u2191";break;case l.KEY.RIGHT:g="\u2192";break;case l.KEY.LEFT:g="\u2190"}return f+g}var d;switch(k.keyCode){case 59:d=k.mod2?":":";";break;case 61:d=k.mod2?
"+":"\x3d";break;case 188:d=k.mod2?"\x3c":",";break;case 190:d=k.mod2?"\x3e":".";break;case 191:d=k.mod2?"?":"/";break;case 192:d=k.mod2?"~":"`";break;case 219:d=k.mod2?"{":"[";break;case 220:d=k.mod2?"|":"\\";break;case 221:d=k.mod2?"}":"]";break;case 222:d=k.mod2?'"':"'"}return d?f+d:112<=k.keyCode&&123>=k.keyCode?f+"F"+(k.keyCode-111):f+String.fromCharCode(k.keyCode)}function m(k){var f=-1!==window.navigator.platform.indexOf("Mac");return f&&k.metaKey||!f&&k.ctrlKey}return{getUserKeyString:function(k){var f=
"";k=k.getKeys();for(var h=0;h<k.length;h++)0!==h&&(f+=" "),f+=n(k[h]);return f},getUserText:function(k){var f=k.id,h=k.refNode,g=k.hideRefNode,d=k.initialText,a=k.onComplete,e=k.onEditDestroy,b=k.selectTo,p=k.isInitialValid;k=k.insertAsChild;var q=!1,t=function(b){return function(k){if(!q){var t=l.node(f),s=t.value;t&&(b&&k.keyCode===l.KEY.ESCAPE?(g&&(h.style.display="inline"),q=!0,t.parentNode.removeChild(t),e&&e()):b&&k.keyCode!==l.KEY.ENTER||(0===s.length||!p&&s===d?g&&(h.style.display="inline"):
(a(s),g&&h.parentNode&&(h.style.display="inline")),q=!0,t.parentNode&&t.parentNode.removeChild(t),e&&e()))}}},s=document.createElement("input");s.id=f;s.value=d||"";k?h.appendChild(s):h.parentNode.insertBefore(s,h.nextSibling);s.classList.add("userEditBoxPrompt");g&&(h.style.display="none");s.addEventListener("keydown",t(!0),!1);s.addEventListener("blur",t(!1),!1);window.setTimeout(function(){s.focus();if(d){var a=l.node(f),e=b?d.indexOf(b):-1;0<e?a.createTextRange?(a=a.createTextRange(),a.collapse(!0),
a.moveStart("character",0),a.moveEnd("character",e),a.select()):a.setSelectionRange?a.setSelectionRange(0,e):void 0!==a.selectionStart&&(a.selectionStart=0,a.selectionEnd=e):a.select()}},0)},openInNewWindow:m,followLink:function(k,f){f&&m(f)?window.open(k):window.location=k},createButton:function(k,f){var h=document.createElement("button");h.className="orionButton commandButton commandMargins";h.addEventListener("click",function(g){f();l.stop(g)},!1);k&&h.appendChild(document.createTextNode(k));return h},
createDropdownButton:function(k,f,h){},isFormElement:function(k){switch(k.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","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,n,m,k,f,h,g,d,a,e){function b(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function p(a,b){this.token=a;this.parameterName=b}function q(a,b,e){this.event=a;this.handler=b;this.capture=e||!1}function t(a,b,e,d,g,p){this.name=a;this.type=b;this.label=e;this.value=d;this.lines=g||1;this.eventListeners=Array.isArray(p)?p:p?[p]:[]}function s(a,b,e){this._storeParameters(a);this._hasOptionalParameters=b&&b.hasOptionalParameters;this._options=b;this.optionsRequested=!1;this.getParameters=e;this.clientCollect=b&&b.clientCollect;this.getParameterElement=b&&b.getParameterElement;
this.getSubmitName=b&&b.getSubmitName}b.prototype={_init:function(a){this._selectionService=a.selection;var b=this;l.setKeyBindingProvider(function(){return b._activeBindings})},processURL:function(a){for(var b in this._urlBindings)if(this._urlBindings[b]&&this._urlBindings[b].urlBinding&&this._urlBindings[b].command){var e=this._urlBindings[b].urlBinding.match(a);if(e){var d=this._urlBindings[b],g=d.command,p=d.invocation;if(p&&p.parameters&&g.callback){p.parameters.setValue(e.parameterName,e.parameterValue);
var f=this;window.setTimeout(function(){f._invoke(p)},0);break}}}},findCommand:function(a){return this._commandList[a]},runCommand:function(a,b,e,d,g,p){if(b){if((a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(b):1)&&a.callback)return b=new l.CommandInvocation(e,b,g,a,this),b.domParent=p,this._invoke(b,d)}else if((p=this._urlBindings[a])&&p.command&&p.command.callback)return this._invoke(p.invocation,d)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=
a},openParameterCollector:function(a,b,e){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,b,e))},confirm:function(a,b,e,d,g,p){var f=!1;if(this._parameterCollector&&!g){var v=this;this._parameterCollector.close();if(this._parameterCollector.open(a,function(a,g){var p=document.createElement("span");p.classList.add("parameterPrompt");p.textContent=b;a.appendChild(p);p=document.createElement("button");p.addEventListener("click",function(a){f=!0;v._parameterCollector.close()},
!1);g.appendChild(p);p.appendChild(document.createTextNode(e));p.className="dismissButton";var q=document.createElement("button");q.addEventListener("click",function(a){f=!1;v._parameterCollector.close()},!1);g.appendChild(q);q.appendChild(document.createTextNode(d));q.className="dismissButton";return p},function(){p(f)}))return}f=window.confirm(b);p(f)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},
_invoke:function(a,b){return this._collectAndInvoke(a.makeCopy(b),!1)},_collectAndInvoke:function(a,b,e){if(a)if(this._parameterCollector&&a.parameters&&a.parameters.hasParameters()&&(b||a.parameters.shouldCollectParameters())){b=!1;a.parameters.updateParameters(a);if(a.parameters.shouldCollectParameters()&&(b=this._parameterCollector.collectParameters(a,e),!b)){var d=new g.Tooltip({node:a.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]});b=
d.contentContainer();b.classList.add("parameterPopup");var p=window.document.activeElement,f=this._parameterCollector.getFillFunction(a,function(){p&&p.focus();d.destroy()},e)(b);d.show();window.setTimeout(function(){f.focus();f.select()},0);b=!0}if(!b)return a.command.callback.call(a.handler||window,a)}else return 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,
b){this._collectAndInvoke(a,!0,b)},showKeyBindings:function(a){function b(a){return function(){l.executeBinding(a)}}var e={},d,g,p=[],f;for(f in this._activeBindings)(g=this._activeBindings[f])&&(g.keyBinding&&g.command&&(g.command.name||g.command.tooltip))&&p.push(g);p.sort(function(a,b){return(a.command.name||a.command.tooltip).localeCompare(b.command.name||b.command.tooltip)});for(f=0;f<p.length;f++)g=p[f],g.keyBinding.scopeName?(e[g.keyBinding.scopeName]||(e[g.keyBinding.scopeName]=[]),e[g.keyBinding.scopeName].push(g)):
(d=k.getUserKeyString(g.keyBinding),a.createItem(d,g.command.name||g.command.tooltip,b(g)));for(var v in e)e[v].length&&0<e[v].length&&(a.createHeader(v),e[v].forEach(function(e){d=k.getUserKeyString(e.keyBinding);a.createItem(d,e.command.name||e.command.tooltip,b(e))}))},addCommand:function(a){this._commandList[a.id]=a;var b=this._pendingBindings[a.id];if(b){var e=this;b.forEach(function(b){e._addBinding(a,b.type,b.binding,b.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,
b,e,d,g,p,f,v,q,h){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];g&&(a=this._createEntryForPath(a,g));a[b]?(d&&(a[b].title=d),e&&(a[b].position=e),f&&(a[b].imageClass=f),v&&(a[b].tooltip=v),q&&(a[b].selectionClass=q),!0===h?a[b].pretendDefaultActionId=!0:a[b].defaultActionId=h,a[b].emptyGroupMessage=p):(a[b]={title:d,position:e,emptyGroupMessage:p,imageClass:f,tooltip:v,selectionClass:q,defaultActionId:!0===h?null:h,pretendDefaultActionId:!0===
h,children:{}},a.sortedContributions=null)},_createEntryForPath:function(a,b){b&&b.split("/").forEach(function(b){1<b.length&&(a[b]||(a[b]={position:0,children:{}},a.sortedContributions=null),a=a[b].children)});return a},registerSelectionService:function(a,b){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=b},registerCommandContribution:function(a,b,e,d,g,p,f){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]=
{});a=this._contributionsByScopeId[a];d&&(a=this._createEntryForPath(a,d));a[b]={position:e};p&&((e=this._commandList[b])?this._addBinding(e,"key",p,g):this._addPendingBinding(b,"key",p,g));f&&((e=this._commandList[b])?this._addBinding(e,"url",f,g):this._addPendingBinding(b,"url",f,g));a.sortedContributions=null},unregisterCommandContribution:function(a,b,e){if(this._contributionsByScopeId[a]){delete this._commandList[b];delete this._activeBindings[b];delete this._urlBindings[b];delete this._pendingBindings[b];
var d=this._contributionsByScopeId[a];e&&e.split("/").forEach(function(a){1<a.length&&d[a]&&(d=d[a].children)});delete d[b];d.sortedContributions=null}},_addBinding:function(a,b,e,d){if(!a.id)throw Error("No command id: "+a);"key"===b?this._activeBindings[a.id]={command:a,keyBinding:e,bindingOnly:d}:"url"===b&&(this._urlBindings[a.id]={command:a,urlBinding:e,bindingOnly:d})},_addPendingBinding:function(a,b,e,d){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:b,
binding:e,bindingOnly:d})},_checkForTrailingSeparator:function(a,b,e){var d;if("tool"===b||"button"===b)if((d=0<a.childNodes.length?a.childNodes[a.childNodes.length-1]:null)&&d.classList.contains("commandSeparator"))return e?(a.removeChild(d),!1):!0;if("menu"===b&&(a=f.$$array("li \x3e *",a),0<a.length&&a[a.length-1].classList.contains("dropdownSeparator")))if(d=a[a.length-1],e)d.parentNode.parentNode.removeChild(d.parentNode);else return!0;return!1},renderCommands:function(a,b,e,d,g,p,q){if("string"!==
typeof a)throw"a scope id for rendering must be specified";b=f.node(b);if(!b)throw"no parent";var v=this._contributionsByScopeId[a];if(!e&&v){e=v.localSelectionService||this._selectionService;var h=this;e&&e.getSelections(function(e){h.renderCommands(a,b,e,d,g,p)})}else v&&(this._render(v,b,e,d,g||"button",p,q),this._checkForTrailingSeparator(b,g,!0))},destroy:function(a){a=f.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var b=a.firstChild;b.commandTooltip&&b.commandTooltip.destroy();b.emptyGroupTooltip&&
b.emptyGroupTooltip.destroy();this.destroy(b);a.removeChild(b)}},_render:function(a,b,e,d,p,f,q){var v=a.sortedContributions;if(!v){var v=[],h=!1,D;for(D in a)if(Object.prototype.hasOwnProperty.call(a,D)){var t=a[D];t&&"number"===typeof t.position&&(t.id=D,v.push(t),h=!0)}h&&(v.sort(function(a,b){return a.position-b.position}),a.sortedContributions=v)}var s=0,m=this;v.forEach(function(a){var v;a.imageClass||(a.imageClass=null);if(a.children&&0<Object.getOwnPropertyNames(a.children).length){var h=
a.children;if("tool"===p||"button"===p)if(a.title){var A;a.defaultActionId&&((h=m._commandList[a.defaultActionId])&&(h.visibleWhen?h.visibleWhen(e):1)?(A=new l.CommandInvocation(d,e,f,h,m),A.domParent=b):a.pretendDefaultActionId=!0);h=m._createDropdownMenu(b,a.title,null,null,a.imageClass,a.tooltip,a.selectionClass,null,A,a.pretendDefaultActionId);q&&n.generateNavGrid(q,h.menuButton);h&&(m._render(a.children,h.menu,e,d,"menu",f,q),m._checkForTrailingSeparator(h.menu,"menu",!0),0===h.menu.childNodes.length?
a.emptyGroupMessage?h.menuButton.emptyGroupTooltip||(h.menuButton.emptyGroupTooltip=new g.Tooltip({node:h.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})):(q&&n.removeNavGrid(q,h.menuButton),a=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},a(h.menu),a(h.menuButton),a(h.destroyButton)):h.menuButton.style.visibility="visible")}else{var D;0<b.childNodes.length&&!m._checkForTrailingSeparator(b,p)&&(D=m.generateSeparatorImage(b));m._render(h,b,
e,d,p,f,q);0<b.childNodes.length&&b.childNodes[b.childNodes.length-1]!==D&&(D=m.generateSeparatorImage(b))}else if(a.title){if(a=m._createDropdownMenu(b,a.title,!0,null,null,a.imageClass))m._render(h,a.menu,e,d,"menu",f,q),m._checkForTrailingSeparator(a.menu,"menu",!0),0===a.menu.childNodes.length&&a.destroyButton&&b.removeChild(a.destroyButton)}else 0<b.childNodes.length&&m._generateMenuSeparator(b),m._render(h,b,e,d,p,f,q),m._generateMenuSeparator(b)}else{var t=m._commandList[a.id],h=t?!0:!1;A=
a=null;if(t){v=new l.CommandInvocation(d,e,f,t,m);v.domParent=b;D=!1;try{D=h&&(t.visibleWhen?t.visibleWhen(e):!0)}catch(C){throw console.log(C),C;}m._activeBindings[t.id]&&m._activeBindings[t.id].keyBinding&&(a=m._activeBindings[t.id],a.invocation=D?v:null,a.bindingOnly&&(h=!1));m._urlBindings[t.id]&&m._urlBindings[t.id].urlBinding&&(A=m._urlBindings[t.id],A.invocation=D?v:null,A.bindingOnly&&(h=!1));h=h&&D}h&&(t.choiceCallback?("tool"===p||"button"===p?(a=b,h=!1,"ul"===b.nodeName.toLowerCase()&&
(a=document.createElement("li"),b.appendChild(a))):(a=b,h=!0),m._createDropdownMenu(a,t.name,h,function(a){t.populateChoicesMenu(a,e,d,f,m)}.bind(t),t.imageClass,t.tooltip||t.title,t.selectionClass,t.positioningNode)):(v.handler=v.handler||this,v.domParent=b,h=function(a){m._invoke(v)},"menu"===p?(A=null,a&&a.keyBinding&&(A=k.getUserKeyString(a.keyBinding)),a=l.createCommandMenuItem(b,t,v,null,h,A)):(a=p+t.id+s,a=l.createCommandItem(b,t,v,a,null,"tool"===p,h)),n.generateNavGrid(q,a),v.domNode=a,s++))}})},
_createDropdownMenu:function(a,b,d,p,q,k,t,v,A,D){a=f.node(a);if(!a||!f.contains(document.body,a))return null;var s,m,n=a;if(d)k=document.createRange(),k.selectNode(a),k=k.createContextualFragment(e),f.processTextNodes(k,{ButtonText:b}),a.appendChild(k),m=a.lastChild,q=m.lastChild,b=q.previousSibling,b.dropdown=new h.Dropdown({dropdown:q,populate:p,parentDropdown:a.dropdown}),q.dropdown=b.dropdown;else{"ul"===a.nodeName.toLowerCase()&&(n=document.createElement("li"),a.appendChild(n),m=n);a=null;q&&
(a="dropdownButtonWithIcon",k=k||b);k=q?k||b:k;var L=l.createDropdownMenu(n,b,p,a,q,!1,t,v,A||D);s=L.dropdownArrow;b=L.menuButton;if(s){A&&(A.domNode=L.menuButton);var F=this;b.onclick=function(a){var b=f.bounds(s);a.clientX>=b.left&&L.dropdown?L.dropdown.toggle(a):F._invoke(A)};L.dropdown&&(b.onkeydown=function(a){f.KEY.DOWN===a.keyCode&&(L.dropdown.toggle(a),f.stop(a))})}q=L.menu;var G;(p=A&&A.command&&(A.command.tooltip||A.command.name))?G=A.command.tooltip||A.command.name:p&&(G=k);G&&(b.commandTooltip=
new g.Tooltip({node:b,text:G,position:["above","below","right","left"]}))}return{menuButton:b,menu:q,dropdown:b.dropdown,destroyButton:m,dropdownArrow:s}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var b=document.createElement("li");b.classList.add("dropdownSeparator");var e=document.createElement("span");e.classList.add("dropdownSeparator");b.appendChild(e);a.appendChild(b)}},generateSeparatorImage:function(a){var b;b="ul"===a.nodeName.toLowerCase()?document.createElement("li"):
document.createElement("span");a.appendChild(b);b.classList.add("core-sprite-sep");b.classList.add("imageSprite");b.classList.add("commandSeparator");return b}};b.prototype.constructor=b;p.prototype={match:function(a){a=m.matchResourceParameters(a);return"undefined"!==typeof a[this.token]?(this.parameterValue=a[this.token],this):null}};p.prototype.constructor=p;q.prototype.constructor=q;t.prototype={optionsRequested:function(){return this.optionsRequested}};t.prototype.constructor=t;s.prototype={_storeParameters:function(a){this.parameterTable=
null;if(a){var b=this.parameterTable={};a.forEach(function(a){b[a.name]=a})}},updateParameters:function(a){"function"===typeof this.getParameters&&this._storeParameters(this.getParameters(a))},hasParameters:function(){return null!==this.parameterTable},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,b){var e=this.parameterTable[a];
e&&(e.value=b)},forEach:function(a){for(var b in this.parameterTable)this.parameterTable[b].type&&this.parameterTable[b].name&&a(this.parameterTable[b])},makeCopy:function(){var a=[];this.forEach(function(b){b=new t(b.name,b.type,b.label,b.value,b.lines,b.eventListeners);a.push(b)});var b=new s(a,this._options,this.getParameters);b.clientCollect=this.clientCollect;return b},hasOptionalParameters:function(){return this._hasOptionalParameters}};s.prototype.constructor=s;return{CommandRegistry:b,URLBinding:p,
ParametersDescription:s,CommandParameter:t,CommandEventListener:q}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(l,n,m){function k(f,h){this._activeContainer=null;this._getElementsFunction=f;this._toolbarLayoutFunction=h}k.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&m.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&m.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();this._oldFocusNode&&(this._oldFocusNode.focus(),this._oldFocusNode=null)}this._activeElements=null},open:function(f,h,g){"string"===typeof f&&(f=m.node(f));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===f)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(f))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=g;var d=h(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!d)return!1;this._activeElements.focusNode=d;f=m.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(0===f.length){h=this._activeElements.dismissArea||
this._activeElements.parameterArea;f=document.createElement("button");f.id="closebox";f.className="imageSprite core-sprite-close dismissButton";f.title=l.Close;h.appendChild(f);var a=this;f.addEventListener("click",function(e){a.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);d&&(this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){d.focus();d.select&&d.select()},0));this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(f,h){m.$$array("input",h).forEach(function(d){"checkbox"===d.type?f.parameters.setValue(d.parameterName,d.checked):"button"!==d.type&&f.parameters.setValue(d.parameterName,d.value.trim())});m.$$array("textArea",h).forEach(function(d){f.parameters.setValue(d.parameterName,d.value.trim())});var g=f.parameters.getParameterElement;g&&f.parameters.forEach(function(d){(d=g(d,h))&&("checkbox"===d.type?
f.parameters.setValue(d.parameterName,d.checked):"button"!==d.type?f.parameters.setValue(d.parameterName,d.value.trim()):"textarea"!==d.type&&f.parameters.setValue(d.parameterName,d.value.trim()))});f.command.callback&&f.command.callback.call(f.handler,f)},collectParameters:function(f,h){return f.parameters?(f.domNode&&f.domNode.classList.add("commandMarker"),this.open(f.domNode||f.domParent,this.getFillFunction(f,null,h))):!1},getFillFunction:function(f,h,g){var d=this;return function(a,e){var b=
null,p=function(){h&&h();d.close()},q=function(b){b.keyCode===m.KEY.ENTER&&(d._collectAndCall(f,a),p(),m.stop(b));b.keyCode===m.KEY.ESCAPE&&("function"===typeof g&&g(),p(),m.stop(b))},k=f.parameters;k.forEach(function(e){var d=k.getParameterElement?k.getParameterElement(e,a):null,g=null;!d&&e.label&&(g=document.createElement("label"),g.classList.add("parameterInput"),g.setAttribute("for",e.name+"parameterCollector"),g.textContent=e.label,a.appendChild(g));var h=e.name+"parameterCollector",g=g||a;
"text"===e.type&&"number"===typeof e.lines&&1<e.lines?(d||(d=document.createElement("textarea"),d.rows=e.lines,d.type="textarea",d.id=h,g.appendChild(d)),q=function(a){a.keyCode===m.KEY.ESCAPE&&(p(),m.stop(a))}):"boolean"===e.type?(d||(d=document.createElement("input"),d.type="checkbox",d.id=h,g.appendChild(d)),e.value&&(d.checked=!0)):(d||(d=document.createElement("input"),d.type=e.type,d.id=h,g.appendChild(d)),e.value&&(d.value=e.value));d.classList.add("parameterInput");d.setAttribute("speech",
"speech");d.setAttribute("x-webkit-speech","x-webkit-speech");d.parameterName=e.name;b||(b=d);0<e.eventListeners.length&&e.eventListeners.forEach(function(a){d.addEventListener(a.event,function(b){return a.handler(b,f)},a.capture)});d.addEventListener("keydown",q,!1)});var s=e;s||(s=document.createElement("span"),s.classList.add("layoutRight"),s.classList.add("parametersDismiss"),a.appendChild(s));var y=function(a,b){var e=document.createElement("button");b.appendChild(e);a&&e.appendChild(document.createTextNode(a));
e.classList.add("dismissButton");return e};f.parameters.hasOptionalParameters()&&(f.parameters.optionsRequested=!1,y(l.More,s).addEventListener("click",function(){f.parameters.optionsRequested=!0;d._collectAndCall(f,a);p()},!1));y(k.getSubmitName?k.getSubmitName(f):l.Submit,s).addEventListener("click",function(){d._collectAndCall(f,a);p()},!1);s=y(null,s);s.id="closebox";s.classList.add("imageSprite");s.classList.add("core-sprite-close");s.title=l.Close;s.addEventListener("click",function(a){p();
"function"===typeof g&&g()},!1);return b}}};k.prototype.constructor=k;return{CommandParameterCollector:k}});define("orion/regex",[],function(){return{escape:function(l){return l.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$\x26")},parse:function(l){return(l=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(l))?{pattern:l[1],flags:l[2]}:null}}});
define("orion/contentTypes",[],function(){function l(a,b){if("string"!==typeof a)return null;for(var d=a&&a.split(".").pop(),g=null,f=0;f<b.length;f++){var h=b[f],k;a:{k=g;var l=h,m=d,n=0<=l.filename.indexOf(a),w;w=m.toLowerCase();w=-1!==l.extension.indexOf(w);if(n||w){if(!(w=!k))n&&(m=m.toLowerCase(),n=-1!==k.extension.indexOf(m)),w=n;if(w){k=l;break a}}}k===h&&(g=h)}return g}function n(a){return null===a||"undefined"===typeof a?[]:Array.isArray(a)?a:[a]}function m(a){return n(a).map(function(a){return String.prototype.toLowerCase.call(a)})}
function k(a){return{id:a.id,name:a.name,image:a.image,imageClass:a.imageClass,"extends":a["extends"],extension:m(a.extension),filename:n(a.filename)}}function f(a){var b=Object.create(null);a.map(k).forEach(function(a){Object.prototype.hasOwnProperty.call(b,a.id)||(b[a.id]=a)});return b}function h(e){if(e&&e.registerService){this.serviceRegistry=e;for(var b=e.getServiceReferences(d).concat(e.getServiceReferences(a)),p=[],h=0;h<b.length;h++)for(var k=n(b[h].getProperty("contentTypes")),s=0;s<k.length;s++)p.push(k[s]);
this.map=f(p);e.registerService(g,this)}else if(Array.isArray(e))this.serviceRegistry=null,this.map=f(e);else throw Error("Invalid parameter");}var g="orion.core.contentTypeRegistry",d="orion.core.contenttype",a="orion.file.contenttype";h.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),b=[],d;for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&b.push(a[d]);return b},getContentTypesMap:function(){return this.map},getFileContentType:function(a){return l(a.Name,this.getContentTypes())},
getFilenameContentType:function(a){return l(a,this.getContentTypes())},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,b){a="string"===typeof a?this.getContentType(a):a;b="string"===typeof b?this.getContentType(b):b;if(!a||!b)return!1;if(a.id===b.id)return!0;for(var d=a,g={};d&&(d=this.getContentType(d["extends"]));){if(d.id===b.id)return!0;if(g[d.id])throw Error("Cycle: "+d.id);g[d.id]=!0}return!1},isSomeExtensionOf:function(a,b){for(var d=0;d<b.length;d++)if(this.isExtensionOf(a,
b[d]))return!0;return!1}};return{ContentTypeRegistry:h,getFilenameContentType:l}});
define("orion/URITemplate",[],function(){function l(a){this._text=a}function n(a){return a.replace("%25","%")}function m(a,d){if("U"===d)return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===d)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(e,n);if("U+R-,"===d)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+d);}function k(a,e,d){for(var g=
[],f=0;f<a.length;f++)"undefined"!==typeof a[f]&&g.push(m(a[f],e));return g.join(d)}function f(a,e,d,g){for(var f=Object.keys(a),h=[],k=0;k<f.length;k++)"undefined"!==typeof a[f[k]]&&h.push(m(f[k],e)+d+m(a[f[k]],e));return h.join(g)}function h(b){if(0===b.length)throw Error("Invalid Expression: 0 length expression");(this._operator=d[b[0]])?b=b.substring(1):this._operator=d.NUL;for(var e=[],g=b.split(","),f=0;f<g.length;f++){var h=g[f].match(a);if(null===h)throw Error("Bad VarSpec: "+b);e.push({name:h[1],
explode:!!h[2],prefix:h[3]?parseInt(h[3],10):-1})}this._varSpecList=e}function g(a){for(var e=[],d=0,g=a.indexOf("{",d);-1!==g;){e.push(new l(a.substring(d,g)));d=a.indexOf("}",g+1);if(-1===d)throw Error("Invalid template: "+a);e.push(new h(a.substring(g+1,d)));d+=1;g=a.indexOf("{",d)}e.push(new l(a.substring(d)));this._templateComponents=e}var d={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:"\x26",named:!0,ifemp:"\x3d",allow:"U"},"\x26":{first:"\x26",sep:"\x26",named:!0,ifemp:"\x3d",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(a){return encodeURI(this._text)}};
h.prototype={expand:function(a){for(var e=[],d=0;d<this._varSpecList.length;d++){var g=this._varSpecList[d],h=g.name,l=a[h],r=typeof l;if("undefined"!==r&&null!==l){var n=0===e.length?this._operator.first:this._operator.sep;if("string"===r)this._operator.named&&(n+=m(h,"U+R"),n+=0===l.length?this._operator.ifemp:"\x3d"),-1!==g.prefix&&g.prefix<l.length&&(l=l.substring(0,g.prefix)),n+=m(l,this._operator.allow);else if(Array.isArray(l)){if(0===l.length)continue;g.explode?n+=k(l,this._operator.allow,
this._operator.sep):(g=k(l,this._operator.allow,","),this._operator.named&&(n+=m(h,"U+R"),n+=0===g.length?this._operator.ifemp:"\x3d"),n+=g)}else if("object"===r){if(0===Object.keys(l).length)continue;g.explode?n+=f(l,this._operator.allow,"\x3d",this._operator.sep):(g=f(l,this._operator.allow,",",","),this._operator.named&&(n+=m(h,"U+R"),n+=0===g.length?this._operator.ifemp:"\x3d"),n+=g)}else throw Error("bad param type: "+h+" : "+r);e.push(n)}}return e.join("")}};g.prototype={expand:function(a){for(var e=
[],d=0;d<this._templateComponents.length;d++)e.push(this._templateComponents[d].expand(a));return e.join("")}};return g});
define("orion/i18nUtil",["require","orion/Deferred"],function(l,n){function m(f){if(f=localStorage.getItem("orion/messageBundle/"+f))if(f=JSON.parse(f),f._expires&&f._expires>(new Date).getTime())return delete f._expires,f;return null}var k={};return{getMessageBundle:function(f){function h(a){a?l(["i18n!"+f],function(a){if(a){var b=f;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+b,JSON.stringify(a));delete a._expires}d.resolve(a)}):g(Error(f))}function g(a){d.reject(a)}
if(k[f])return k[f];var d=new n;k[f]=d;var a=m(f);if(a)return d.resolve(a),d;try{l([f],h,g)}catch(e){l(["orion/i18n!"+f],h,g)}return d},formatMessage:function(f){var h=arguments;return f.replace(/\$\{([^\}]+)\}/g,function(g,d){return h[(d<<0)+1]})}}});
define("orion/PageLinks","require orion/Deferred orion/PageUtil orion/URITemplate orion/i18nUtil orion/objects orion/URL-shim".split(" "),function(l,n,m,k,f,h,g){function d(){return l.toUrl?(new URL(l.toUrl("orion/../"),window.location.href)).href.slice(0,-1):(new URL("/",window.location.href)).href.slice(0,-1)}function a(a){var b={};a.getPropertyKeys().forEach(function(e){"objectClass"!==e&&("service.names"!==e&&"service.id"!==e&&"__plugin__"!==e)&&(b[e]=a.getProperty(e))});return b}function e(a){return f.getMessageBundle(a.nls).then(function(b){a.textContent=
a.nameKey?b[a.nameKey]:a.name;return a},function(b){a.textContent=a.nameKey||a.name;return a})}function b(b,g){var p=b.getServiceReferences(g||"orion.page.link"),f=m.matchResourceParameters(window.location.href),h={OrionHome:d(),Location:f.resource},q=[];p.forEach(function(b){b=a(b);if(b.uriTemplate&&(b.nls||b.name)){var d=(new k(b.uriTemplate)).expand(h),d=m.validateURLScheme(d);b.href=d;b.nls?q.push(e(b)):(b.textContent=b.name,q.push((new n).resolve(b)))}});return n.all(q)}function p(a){var b=this.categories=
Object.create(null);a.forEach(function(a){b[a.id]=a})}function q(a){this.allPageLinks=a;this.allPageLinks.sort(t)}function t(a,b){var e=a.textContent&&a.textContent.toLowerCase(),d=b.textContent&&b.textContent.toLowerCase();return e<d?-1:e>d?1:0}var s;h.mixin(p.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(a){return this.categories[a]||null}});h.mixin(q.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(a){var b=a.href;a=
a.textContent;var e=document.createElement("a");e.href=b;e.target="_self";e.classList.add("targetSelector");e.textContent=a;return e})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(b){var d;return!s?(d=[],b.getServiceReferences("orion.page.link.category").forEach(function(g){var p=a(g);if(p.id&&(p.name||p.nameKey))p.service=b.getService(g),p.nls?d.push(e(p)):(p.textContent=p.name,d.push((new n).resolve(p)))}),n.all(d).then(function(a){return s=new p(a)})):(new n).resolve(s)},
getPageLinksInfo:function(a,e){return b(a,e).then(function(a){return new q(a)})},getOrionHome:d}});
define("orion/edit/nls/root/messages",{Editor:"Editor",switchEditor:"Switch Editor",Fetching:"Fetching: ${0}",confirmUnsavedChanges:"There are unsaved changes.  Do you still want to navigate away?",searchFiles:"Search Files...",searchTerm:"Enter search term:",unsavedChanges:"There are unsaved changes.",unsavedAutoSaveChanges:"Please stay on the page until Auto Save is complete.",Save:"Save",Saved:"Saved",Blame:"Blame",BlameTooltip:"Show blame annotations",saveOutOfSync:"Resource is out of sync with the server. Do you want to save it anyway?",
loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.",ReadingMetadata:"Reading metadata of ${0}",ReadingMetadataError:"Can not get metadata of ${0}",Reading:"Reading ${0}",readonly:"Read Only.",saveFile:"Save this file",gotoLine:"Go to Line...",gotoLineTooltip:"Go to specified line number",gotoLinePrompt:"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find...",noResponse:"No response from server.  Check your internet connection and try again.",
savingFile:"Saving file ${0}",running:"Running ${0}","Saving...":"Saving...",View:"View",SidePanel:"Side Panel",SidePanelTooltip:"Choose what to show in the side panel.",Actions:"Actions",Navigator:"Navigator",FolderNavigator:"Folder Navigator",Project:"Project",New:"New",File:"File",Edit:"Edit",Tools:"Tools",Add:"Add",noActions:"There are no actions for the current selection.",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding.",LocalEditorSettings:"Local Editor Settings",
NoProject:"${0} is not a project. To convert it to a project use ${1}.",NoProjects:"There are no projects in your workspace. Use the ${0} menu to create projects.",disconnected:"(disconnected)",ChooseFS:"Choose Filesystem",ChooseFSTooltip:"Choose the filesystem you want to view.",FSTitle:"${0} (${1})",Deploy:"Deploy","Deploy As":"Deploy As",Import:"Import",Export:"Export",OpenWith:"Open With",OpenRelated:"Open Related",Dependency:"Dependency",UnnamedCommand:"Unnamed"});
define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/extensionCommands","require orion/Deferred orion/commands orion/regex orion/contentTypes orion/URITemplate orion/i18nUtil orion/URL-shim orion/PageLinks i18n!orion/edit/nls/messages".split(" "),function(l,n,m,k,f,h,g,d,a,e){function b(a){var b={};a.getPropertyKeys().forEach(function(e){b[e]=a.getProperty(e)});return b}var p={},q=a.getOrionHome();p._cloneItemWithoutChildren=function r(a){if(null===a||"object"!==typeof a)return a;var b=a.constructor(),e;for(e in a)"children"!==e&&"Children"!==
e&&(b[e]=r(a[e]));return b};p._getOpenWithNavCommandExtensions=function(a,b){function e(a,b){for(var d=a.getServiceReferences("orion.navigate.openWith"),g=[],p=[],f=0;f<d.length;f++){var v=d[f];if(v.getProperty("editor")===b.id){var h=v.getProperty("contentType");h instanceof Array?g=g.concat(h):g.push(h||"*/*");v=v.getProperty("excludedContentTypes");v instanceof Array?p=p.concat(v):null!==v&&"undefined"!==typeof v&&p.push(v)}}0===g.length&&(g=null);0===p.length&&(p=null);return{contentTypes:g,excludedContentTypes:p}}
for(var d=function(){for(var b=a.getServiceReferences("orion.edit.editor"),e=[],d=0;d<b.length;d++){var g=b[d],p=g.getProperty("id");e.push({id:p,"default":g.getProperty("default")||!1,name:g.getProperty("name"),nameKey:g.getProperty("nameKey"),nls:g.getProperty("nls"),uriTemplate:g.getProperty("orionTemplate")||g.getProperty("uriTemplate"),validationProperties:g.getProperty("validationProperties")||[]})}return e}(),g=[],p,f=0;f<d.length;f++){var h=d[f],q=e(a,h),q={properties:{name:h.name||h.id,nameKey:h.nameKey,
id:"eclipse.openWithCommand."+h.id,contentType:q.contentTypes,excludedContentTypes:q.excludedContentTypes,uriTemplate:h.uriTemplate,nls:h.nls,forceSingleItem:!0,isEditor:h["default"]?"default":"editor",validationProperties:h.validationProperties},service:{}};"orion.editor"===h.id?p=q:g.push(q)}p&&g.push(p);return g};p._makeValidator=function(a,b,e,d){function g(a,b,e,d,p){var f=!1,v;if("!"===b.charAt(0))return"undefined"===typeof a[b.substring(1)];if("undefined"!==typeof a[b]){if("undefined"===typeof e)v=
a[b],f=!0;else if("string"===typeof e){if(!typeof("string"===a[b]))return!1;if(d.variableName){if(e=RegExp(e).exec(a[b]))f=e[0],v="before"===d.variableMatchPosition?a[b].substring(0,e.index):"after"===d.variableMatchPosition?a[b].substring(e.index+f.length):"only"===d.variableMatchPosition?f:a[b],f=!0}else return RegExp(e).test(a[b])}else a[b]===e&&(v=a[b],f=!0);b=d.variableName;d=d.replacements;if(f&&b&&(p[b]=v,p.itemCached=a,d)){if("string"!==typeof v)return window.console.log("Cannot replace "+
b+", value is not a string: "+v),f;for(a=0;a<d.length;a++){v=!1;if(d[a].pattern){e=d[a].pattern;var h=d[a].replacement||"";p[b]=p[b].replace(RegExp(e),h).replace(RegExp(e),h)}else v=!0;v&&window.console.log("Invalid replacements specified in validation property.  "+d[a])}}return f}return!1}function p(a,b,e,d){var f=e.match,v,h;if(0<=(v=b.indexOf("["))){if(0>(h=b.indexOf("]")))return!1;var q=b.substring(0,v),k;if(!(k=a[q])||!Array.isArray(k))return!1;v=b.substring(v+1,h);v=parseInt(v,10);if(isNaN(v))return!1;
0>v&&(v+=k.length);b=b.substring(h+1);b=q+":"+String(v)+b}return 0<=b.indexOf("|")?(v=b.substring(0,b.indexOf("|")),b=b.substring(b.indexOf("|")+1),p(a,v,e,d)?!0:p(a,b,e,d)):0<=b.indexOf(":")?(v=b.substring(0,b.indexOf(":")),b=b.substring(b.indexOf(":")+1),a[v]?p(a[v],b,e,d):!1):g(a,b,f,e,d)}function v(b,e,d){if(d.info.validationProperties)for(var g=0;g<d.info.validationProperties.length;g++){var v=d.info.validationProperties[g];if("undefined"!==typeof v.source){if(!p(b,v.source,v,d))return!1}else return window.console.log("Invalid validationProperties in "+
a.id+".  No source property specified."),!1}var g=!0,h=e?f.getFilenameContentType(b.Name,e):null,h=h||{id:"application/octet-stream"};d.info.excludedContentTypes&&e&&(g=d.info.excludedContentTypes.every(function(a){a=a.replace(/([*?])/g,".$1");return-1!==h.id.search(a)?!1:!0}));g&&(d.info.contentType&&e)&&(g=d.info.contentType.some(function(a){a=a.replace(/([*?])/g,".$1");return-1!==h.id.search(a)?!0:!1}));return g}return{info:a,validationFunction:function(a){"function"===typeof d&&(a=d.call(this,
a));if(a){if(Array.isArray(a)){if((this.info.forceSingleItem||this.info.uriTemplate)&&1!==a.length||1>a.length)return!1}else a=[a];for(var b=0;b<a.length;b++)if(!v(a[b],e,this))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 d=this.info.validationProperties[e];
d.source&&d.variableName&&(this.itemCached===a&&this[d.variableName]||p(a,d.source,d,this),a[d.variableName]?window.console.log("Variable name "+d.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):b[d.variableName]=this[d.variableName])}b.OrionHome=q;return(new h(this.info.uriTemplate)).expand(b)}return null}}};var t=e.UnnamedCommand;p._createCommandOptions=function(a,b,e,d,f,h){function v(g,v){var q=p._makeValidator(a,e,d,h);g.visibleWhen=
q.validationFunction.bind(q);if(f)if(q.generatesURI.bind(q)())g.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return q.getURI.bind(q)(a)};else{var k=a;g.callback=function(a){var d;if(k.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,d=p._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){d=[];for(var f=0;f<a.items.length;f++)d.push(p._cloneItemWithoutChildren(a.items[f]))}else d=p._cloneItemWithoutChildren(a.items);if(e)var v=e.getService("orion.page.progress");
b.run?v?v.progress(b.run(d),"Running command: "+g.name):b.run(d):e&&(v?v.progress(e.getService(b).run(d),"Running command: "+g.name):e.getService(b).run(d))}}v.resolve(g)}var q=new n;if(a.nls){var k=function(b){var e;b?(e=a.tooltipKey&&b[a.tooltipKey],b=a.nameKey&&b[a.nameKey]||a.name||t,e=e||a.tooltip||""):(b=a.name||a.nameKey||t,e=a.tooltip||a.tooltipKey||"");v({name:b,image:a.image,id:a.id||a.name,tooltip:e,isEditor:a.isEditor,showGlobally:a.showGlobally},q)};g.getMessageBundle(a.nls).then(k,k.bind(this,
null))}else v({name:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},q);return q};p.getOpenWithCommand=function(a,b,e){var d;a=e||p.getOpenWithCommands(a);for(e=0;e<a.length;e++)if(a[e].visibleWhen(b)){var g="default"===a[e].isEditor;if(!d||g)if(d=a[e],g)break}return d};p.getOpenWithCommands=function(a){var b=[],e;for(e in a._commandList){var d=a._commandList[e];d.isEditor&&b.push(d)}return b};var s;p.createAndPlaceFileCommandsExtension=function(a,
b,d,g,f,h){return p.createFileCommands(a,null,h?"all":void 0,!!h,b).then(function(a){f&&0<a.length&&(b.addCommandGroup(d,"eclipse.openWith",1E3,e.OpenWith,f,null,null,null,"dropdownSelection"),b.addCommandGroup(d,"eclipse.fileCommandExtensions",1E3,e.OpenRelated,f));a.forEach(function(a){var e=null;f&&(e=a.isEditor?f+"/eclipse.openWith":f+"/eclipse.fileCommandExtensions");b.registerCommandContribution(d,a.id,g,e)});return{}})};p.createFileCommands=function(a,b,e,d,g){e=void 0===e?"global":e;d=void 0===
d?!0:d;var f=[];p._cachedFileCommands||p._createCachedFileCommands(a);("all"===e||"global"===e)&&p._cachedFileCommands.forEach(function(a){var b=a.properties;("all"===e||b.forceSingleItem&&b.showGlobally)&&f.push(a)});return n.when(function(){var e=a.getService("orion.core.contentTypeRegistry")||b;return s||n.when(e.getContentTypes(),function(a){return s=a})}(),function(){d&&(p._cachedOpenWithExtensions||(p._cachedOpenWithExtensions=p._getOpenWithNavCommandExtensions(a,s)),f=f.concat(p._cachedOpenWithExtensions),
g._addedOpenWithCommands=d);var b=f.map(function(b){var e=b.properties;b=b.service;var d=g.findCommand(e.id||e.name);return d?(new n).resolve(d):p._createCommandOptions(e,b,a,s,!0).then(function(a){a=new m.Command(a);g.addCommand(a);return a})});return n.all(b,function(a){return{_error:a}}).then(function(a){return a})})};p._createCachedFileCommands=function(a){var e=a.getServiceReferences("orion.navigate.command");p._cachedFileCommands=[];for(var d=0;d<e.length;d++)if("orion.navigateFromMetadata"!==
e[d].getProperty("id")){var g=a.getService(e[d]),f=b(e[d]);p._cachedFileCommands.push({properties:f,service:g})}};p.getFileCommandIds=function(){var a=[];if(p._cachedFileCommands)p._cachedFileCommands.length&&(a=p._cachedFileCommands.map(function(a){return a.properties.id}));else throw"extensionCommandUtils._cachedFileCommands is not initialized";return a};p.createOpenWithCommands=function(a,b,e){return e&&e._addedOpenWithCommands?(new n).resolve(p.getOpenWithCommands(e)):p.createFileCommands(a,b,
"none",!0,e)};return p});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(l,n){function m(k){this._init(k)}m.prototype={_init:function(k){var f=n.node(k.container);if(!f)throw"no parent container";this._container=f;f.classList.remove("currentLocation");this._id=k.id||"eclipse.breadcrumbs";this._resource=k.resource||null;this._rootSegmentName=k.rootSegmentName;this._workspaceRootSegmentName=k.workspaceRootSegmentName;this._workspaceRootURL=k.workspaceRootURL;this._makeHref=k.makeHref;this._makeFinalHref=
k.makeFinalHref;this._maxLength=k.maxLength;this.path="";this.measure();this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var k;if(this._resource&&this._resource.Parents&&!this._resource.skip){k=document.createElement("a");var f=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(k,f):k.href=l.toUrl("edit/edit.html")+"#"+f}else k=document.createElement("span");n.empty(k);k.appendChild(document.createTextNode(this._workspaceRootSegmentName));
return k}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(k){var f=document.createElement("a");f.classList.add("breadcrumb");f.appendChild(document.createTextNode(k));return f},addSegmentHref:function(k,f){this._makeHref?this._makeHref(k,f.Location,f):k.href=l.toUrl("edit/edit.html")+"#"+f.ChildrenLocation},buildSegments:function(k,f){if(this._resource.Parents){var h=this._resource.Parents.slice(0),g,d;h&&(h=h.slice(0),"reverse"===f&&(h=h.reverse().slice(0)),
h.forEach(function(a){a.skip||(k?(d=k,k=null):d=a.Name,g=this.buildSegment(d),this.path+=a.Name,this.addSegmentHref(g,a),g.include=!1,this.segments.push(g))}.bind(this)))}},addDivider:function(){var k=document.createElement("span");k.appendChild(document.createTextNode(" / "));this.path+="/";k.classList.add("breadcrumbSeparator");this.append(k)},refresh:function(){(this.crumbs=n.node(this._id))?n.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(k){this.crumbs.appendChild(k)},addTitle:function(k,f){var h=f||document.title;0===this.crumbs.childNodes.length&&(k=document.createElement("span"),k.appendChild(document.createTextNode(h)),
k.classList.add("breadcrumb"),k.classList.add("currentLocation"),this.append(k))},finalSegment:function(k,f){if(!this._resource.skip){var h;h=f?f:this._resource.Name;this._makeFinalHref?(k=this.buildSegment(h),this.addSegmentHref(k,this._resource)):(k=document.createElement("span"),k.appendChild(document.createTextNode(h)));k.classList.add("currentLocation");this.path+=this._resource.Name;this.append(k)}},firstSegment:function(k){k&&(this.append(k),this._resource&&this._resource.Parents&&!this._resource.skip?
(k.classList.add("breadcrumb"),this.addDivider()):(this._resource.skip||(k.href=""),k.classList.add("currentLocation")))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(k){!0===k.include&&(this.append(k),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var k=this.segments.slice(0).reverse();k.forEach(function(f){this.append(f);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?f.include=
!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=k.reverse()}},measure:function(){var k=this._container;k.style.width="auto";this.MAX_LENGTH=this._maxLength?this._maxLength:k.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var k=this.getNavigatorWorkspaceRootSegment(),f=this._rootSegmentName;f?this.addTitle(k,f):(this.finalSegment(k,f),this._resource&&this._resource.Parents&&(this.buildSegments(f,"reverse"),this.measureSegments(),this.firstSegment(k)),
this.crumbs.offsetWidth>=this.MAX_LENGTH&&(this.INCLUDE_FIRST_SECTION=!1))},render:function(){this.refresh();var k=this.getNavigatorWorkspaceRootSegment(),f=this._rootSegmentName;f?this.addTitle(k,f):(!0===this.INCLUDE_FIRST_SECTION&&this.firstSegment(k),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(k,f)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};m.prototype.constructor=m;return{BreadCrumbs:m}});
define("orion/webui/splitter",["orion/EventTarget","orion/util","orion/webui/littlelib"],function(l,n,m){function k(f){l.attach(this);this._init(f)}k.prototype={_init:function(f){this._tracking=null;this._animationDelay=501;this._closeReversely=f.closeReversely;this.$node=m.node(f.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=m.node(f.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=m.node(f.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";
this._vertical=f.vertical||!1;var h=this.$node.classList;h.add("split");h.add(this._vertical?"splitVerticalLayout":"splitLayout");h=this.$sideNode.classList;h.add("hasSplit");h.add(this._vertical?"sidePanelVerticalLayout":"sidePanelLayout");h=this.$mainNode.classList;h.add("hasSplit");h.add(this._vertical?"mainPanelVerticalLayout":"mainPanelLayout");this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");f.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="closed"===this.$node.getAttribute("data-initial-state");"undefined"!==typeof f.closeByDefault&&(this._closeByDefault=f.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";n.isIOS||n.isAndroid?(this.$node.addEventListener("touchstart",this._touchStart.bind(this),!1),this._thumb&&this._thumb.addEventListener("touchstart",this._touchStart.bind(this),!1),this.$node.addEventListener("touchmove",this._touchMove.bind(this),!1),this.$node.addEventListener("touchend",this._touchEnd.bind(this),!1)):(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},getOrientation:function(){return this._vertical?"vertical":"horizontal"},setOrientation:function(f){f="vertical"===f;f!==this._vertical&&(this._vertical=f,f=this.$node.classList,f.toggle("splitLayout"),f.toggle("splitVerticalLayout"),this.$node.style.left="",this.$node.style.top="",f=this.$sideNode.classList,f.toggle("sidePanelLayout"),f.toggle("sidePanelVerticalLayout"),this.$sideNode.style.left="",this.$sideNode.style.top="",this.$sideNode.style.width=
"",this.$sideNode.style.height="",f=this.$mainNode.classList,f.toggle("mainPanelLayout"),f.toggle("mainPanelVerticalLayout"),this.$mainNode.style.left="",this.$mainNode.style.top="",this.$mainNode.style.width="",this.$mainNode.style.height="",this._thumb&&(f=this._thumb.classList,f.toggle("splitThumbLayout"),f.toggle("splitVerticalThumbLayout")),this._initializeFromStoredSettings(),this._closed?(this._closed=!1,this._thumbDown(!0,!0)):this._adjustToSplitPosition())},toggleSidePanel:function(){this._thumbDown()},
openSidePanel:function(){this._closed||this._thumbDown()},addResizeListener:function(f){this.addEventListener("resize",function(h){f(h.node)})},_initializeFromStoredSettings:function(){var f=localStorage.getItem(this._prefix+"/toggleState");this._closed="string"===typeof f?"closed"===f:this._closeByDefault;var f=m.bounds(this.$node.parentNode),h=m.bounds(this.$node),g;this._vertical?(g=localStorage.getItem(this._prefix+"/yPosition"))?(this._splitTop=parseInt(g,10),this._splitTop>f.top+f.height-h.height&&
(this._splitTop=f.top+f.height/2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitTop=0):(g=localStorage.getItem(this._prefix+"/xPosition"))?(this._splitLeft=parseInt(g,10),this._splitLeft>f.left+f.width-h.width&&(this._splitLeft=f.left+f.width/2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitLeft=0)},_getSplitPosition:function(){var f=m.bounds(this.$node),h=m.bounds(this.$node.parentNode);return this.vertical?f.top-h.top:f.left-h.left},
_adjustToSplitPosition:function(f){var h=m.bounds(this.$node),g=m.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=h.height;if(f||!this._splitTop)this._splitTop=h.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);f=this._splitTop;f=this._splitTop-g.top;this.$sideNode.style.height=f+"px";this.$sideNode.style.display="block";this.$node.style.top=f+"px"}else{this._splitWidth=h.width;if(f||!this._splitLeft)this._splitLeft=h.left,localStorage.setItem(this._prefix+"/xPosition",
this._splitLeft);f=this._splitLeft;f=this._splitLeft-g.left;this.$sideNode.style.width=f+"px";this.$sideNode.style.display="block";this.$node.style.left=f+"px"}this._resize()},_resize:function(f,h,g){f=f||0;var d=m.bounds(this.$node.parentNode),a=m.bounds(this.$node);this._vertical?(void 0===g&&(g=a.top-d.top),g+=a.height,this.$mainNode.style.top=g+"px"):(void 0===h&&(h=a.left-d.left),h+=a.width,this.$mainNode.style.left=h+"px");var e=this;window.setTimeout(function(){e._notifyResizeListeners(e.$mainNode);
e._notifyResizeListeners(e.$sideNode)},f)},_notifyResizeListeners:function(f){this.dispatchEvent({type:"resize",node:f})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(f,h){f||this._addAnimation();var g=this._splitTop,d=this._splitLeft;if(this._closed)this._closed=!1,!this._splitLeft&&(!this._splitTop&&"number"===typeof this._initialSplit)&&(g=d=this._initialSplit);else if(this._closed=!0,this._closeReversely){var a=m.bounds(this.$node.parentNode),
e=m.bounds(this.$node);this._vertical?g=a.height-e.height:d=a.width-e.width}else g=d=0;this._vertical?(this.$sideNode.style.height=g+"px",this.$node.style.top=g+"px"):(this.$sideNode.style.width=d+"px",this.$node.style.left=d+"px");this._resize(this._animationDelay,d,g);f||this._removeAnimation();h||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var b=this;window.setTimeout(function(){b._notifyToggleListeners()},this._animationDelay)},_removeAnimation:function(){var f=
this;window.setTimeout(function(){f.$sideNode.classList.remove(f._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");f.$mainNode.classList.remove(f._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");f.$node.classList.remove(f._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")},_down:function(){this.$node.classList.add("splitTracking");this.$mainNode.classList.add("panelTracking");this.$sideNode.classList.add("panelTracking")},_move:function(f,h){var g=m.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=h;this._splitTop<g.top+5?this._splitTop=g.top+5:this._splitTop>g.top+g.height-5&&(this._splitTop=g.top+
g.height-5);var d=this._splitTop,d=this._splitTop-g.top;this.$node.style.top=d+"px"}else this._splitLeft=f,this._splitLeft<g.left+5?this._splitLeft=g.left+5:this._splitLeft>g.left+g.width-5&&(this._splitLeft=g.left+g.width-5),d=this._splitLeft,d=this._splitLeft-g.left,this.$node.style.left=d+"px";this._adjustToSplitPosition(!0)},_up:function(){this.$node.classList.remove("splitTracking");this.$mainNode.classList.remove("panelTracking");this.$sideNode.classList.remove("panelTracking")},_mouseDown:function(f){if(f.target===
this._thumb)return m.stop(f),this._thumbDown();this._tracking||(this._down(f),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),m.setFramesEnabled(!1),m.stop(f))},_mouseMove:function(f){this._tracking&&this._move(f.clientX,f.clientY)},_mouseUp:function(f){this._tracking&&(m.setFramesEnabled(!0),window.removeEventListener("mousemove",this._tracking),this._tracking=null,this._up(),m.stop(f))},_touchStart:function(f){if(1===f.touches.length){m.stop(f);if(f.target===
this._thumb)return this._thumbDown();this._down(f);this._touching=!0}},_touchMove:function(f){this._touching&&(f=f.touches,1===f.length&&(f=f[0],this._move(f.clientX,f.clientY)))},_touchEnd:function(f){0===f.touches.length&&(this._touching=!1,this._up())}};k.prototype.constructor=k;return{Splitter:k,ORIENTATION_HORIZONTAL:"horizontal",ORIENTATION_VERTICAL:"vertical"}});
define("orion/keyAssist",["i18n!orion/nls/messages","orion/webui/littlelib","orion/util"],function(l,n,m){function k(f){this.commandRegistry=f.commandRegistry;this.create();this._filterString="";this._providers=[]}k.prototype={addProvider:function(f){this._providers.push(f)},create:function(){var f=this._keyAssistDiv=document.createElement("div");f.id="keyAssist";f.style.display="none";f.classList.add("keyAssistFloat");f.setAttribute("role","menu");var h=this._keyAssistInput=document.createElement("input");
h.classList.add("keyAssistInput");h.type="text";h.placeholder=l["Filter bindings"];f.appendChild(h);var g=this._keyAssistContents=document.createElement("div");g.classList.add("keyAssistContents");if(m.isIOS||m.isAndroid)g.style.overflowY="auto";f.appendChild(g);var d=this._keyAssistTable=document.createElement("table");d.tabIndex=0;d.classList.add("keyAssistList");g.appendChild(d);document.body.appendChild(f);h.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));d.addEventListener("keydown",
function(a){this._keyDown(a)}.bind(this));h.addEventListener("input",function(a){this.filterChanged()}.bind(this));g.addEventListener(m.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===n.KEY.ESCAPE&&this.hide()}.bind(this));n.addAutoDismiss([f],function(){this.hide()}.bind(this))},createContents:function(){n.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;for(var f=this._idCount=
this._keyAssistContents.scrollTop=0;f<this._providers.length;f++)this._providers[f].showKeyBindings(this);this.createHeader(l.Global);this.commandRegistry.showKeyBindings(this)},createItem:function(f,h,g){if(this._filterString){var d=this._filterString.toLowerCase(),a;d!==this._filterString?(d=this._filterString,a=function(a){return a}):a=function(a){return a.toLowerCase()};if(-1===a(h).indexOf(d)&&-1===a(f).indexOf(d)&&-1===a(this._lastHeader).indexOf(d))return}var e=this._keyAssistTable.insertRow(-1);
e.id="keyAssist-keyBinding-"+this._idCount++;e.setAttribute("role","menuitem");e._execute=g;e.classList.add("keyAssistItem");e.addEventListener("click",function(a){this._selectedRow=e;this.execute();a.preventDefault()}.bind(this));g=e.insertCell(-1);g.classList.add("keyAssistName");g.appendChild(document.createTextNode(h));g=e.insertCell(-1);g.classList.add("keyAssistAccel");g.appendChild(document.createTextNode(f))},createHeader:function(f){this._lastHeader=f;var h=this._keyAssistTable.insertRow(-1);
h.classList.add("keyAssistSection");var h=h.insertCell(-1),g=document.createElement("h2");g.appendChild(document.createTextNode(f));h.appendChild(g)},execute:function(){window.setTimeout(function(){this.hide();var f=this._selectedRow;this._selectedRow=null;f&&f._execute&&f._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var f=this._keyAssistInput.value;this._filterString!==f&&(this._filterString=
f,this.createContents())}.bind(this),100)},hide:function(){if(this.isVisible()){var f=document.activeElement,h=this._keyAssistDiv,f=h===f||0!==(h.compareDocumentPosition(f)&16);h.style.display="none";f&&1!==document.compareDocumentPosition(this._previousActiveElement)&&this._previousActiveElement.focus();this._previousActiveElement=null}},isVisible:function(){return"block"===this._keyAssistDiv.style.display},removeProvider:function(f){f=this._providers.indexOf(f);-1!==f&&this._providers.splice(f,
1)},select:function(f){var h=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(0===h.length)this._selectedIndex=-1;else{var g=this._selectedIndex,g=(g+(f?1:-1))%h.length;0>g&&(g=h.length-1);-1!==this._selectedIndex&&(f=h[this._selectedIndex],f.classList.remove("selected"),this._selectedRow=null);this._selectedIndex=g;if(-1!==this._selectedIndex){this._selectedRow=f=h[this._selectedIndex];f.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",f.id);this._keyAssistTable.focus();
var h=f.getBoundingClientRect(),d=this._keyAssistContents,a=d.getBoundingClientRect();f.offsetTop<d.scrollTop?0===g?d.scrollTop=0:f.scrollIntoView(!0):h.bottom>a.bottom&&f.scrollIntoView(!1)}}},show:function(){this.isVisible()||(this._previousActiveElement=document.activeElement,this.createContents(),this._keyAssistContents.style.height=Math.floor(0.75*this._keyAssistDiv.parentNode.clientHeight)+"px",this._keyAssistDiv.style.display="block",this._keyAssistInput.value=this._filterString,this._keyAssistInput.focus(),
this._keyAssistInput.select())},_keyDown:function(f){if(40===f.keyCode)this.select(!0);else if(38===f.keyCode)this.select(!1);else if(13===f.keyCode)this.execute();else return;f.preventDefault()},_scrollWheel:function(f){var h=0,h=m.isIE||m.isOpera?-f.wheelDelta:m.isFirefox?40*f.detail:-f.wheelDeltaY,g=this._keyAssistContents,d=g.scrollTop;g.scrollTop+=h;if(d!==g.scrollTop)return f.preventDefault&&f.preventDefault(),!1}};return{KeyAssistPanel:k}});
define("orion/widgets/themes/ThemePreferences",[],function(){function l(l,m){this._preferences=l;this._themeData=m;var k=m.getThemeStorageInfo();this._themeVersion=k.version;var f=l.listenForChangedSettings(k.storage,2,function(h){h.key===f&&this.apply()}.bind(this))}l.prototype={_initialize:function(l,m,k){var f,h;void 0===this._themeVersion||k.get("version")===this._themeVersion?(f=k.get(l.styleset),(h=k.get("selected"))&&(h=JSON.parse(h))):h=f=null;f||(f=m.getStyles(),k.put(l.styleset,JSON.stringify(f)));
if(!h||void 0===h[l.selectedKey])h=h||{},h[l.selectedKey]=l.defaultTheme,k.put("selected",JSON.stringify(h));k.put("version",this._themeVersion)},apply:function(){this.setTheme()},getTheme:function(l){var m=this._themeData,k=m.getThemeStorageInfo();this._preferences.getPreferences(k.storage,2).then(function(f){this._initialize(k,m,f);var h=JSON.parse(f.get("selected"));f=JSON.parse(f.get(k.styleset));var g;if(f)for(var d=0;d<f.length;d++)if(f[d].name===h[k.selectedKey]){g=f[d];break}l({style:g,styles:f})}.bind(this))},
setTheme:function(l,m){var k=this._themeData,f=k.getThemeStorageInfo();this._preferences.getPreferences(f.storage,2).then(function(h){this._initialize(f,k,h);var g=JSON.parse(h.get("selected"));l||(l=g[f.selectedKey]);g[f.selectedKey]=l;h.put("selected",JSON.stringify(g));m?h.put(f.styleset,JSON.stringify(m)):m=JSON.parse(h.get(f.styleset));for(var d=0;d<m.length;d++)if(m[d].name===g[f.selectedKey]){k.processSettings(m[d]);break}h.put("version",this._themeVersion)}.bind(this))},setFontSize:function(l){var m=
this._themeData,k=m.getThemeStorageInfo();this._preferences.getPreferences(k.storage,2).then(function(f){this._initialize(k,m,f);var h=JSON.parse(f.get("selected")),g=JSON.parse(f.get(k.styleset)),d;if(g)for(var a=0;a<g.length;a++)g[a].fontSize=l,g[a].name===h[k.selectedKey]&&(d=g[a]);f.put(k.styleset,JSON.stringify(g));m.processSettings(d)}.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:"Git","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",
DeleteUser:"Delete User Profile as well as workspaces and projects",DeleteUserComfirmation:"WARNING: This will permanently delete your user profile as well all your work!","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",Export:"Export","Export a theme":"Export a theme","Theme name:":"Theme name:",yourTheme:"yourTheme",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 the local editor settings drop down.",editorSettingsInfo:"Use the ${0} and ${1} to toggle whether a given setting is shown in the local editor settings drop down ${2}.",autoPairParentheses:"Autopair (Parentheses)",
autoPairBraces:"Autopair {Braces}",autoPairSquareBrackets:"Autopair [Square] Brackets",autoPairAngleBrackets:"Autopair \x3cAngle\x3e Brackets",autoPairQuotations:'Autopair "Strings"',autoCompleteComments:"Autocomplete /** Block Comments */",smartIndentation:"Smart Indentation",sourceControl:"Source Control",showBlame:"Show Blame",languageTools:"Language Tools",showOccurrences:"Show Occurrences",contentAssistAutoTrigger:"Show Content Assist automatically","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: ",splitEditors:"Split Editors",splitOrientation:"Split Orientation",horizontal:"Horizontal",vertical:"Vertical"});define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/editor/eventTarget",[],function(){function l(){}l.addMixin=function(n){var m=l.prototype,k;for(k in m)m.hasOwnProperty(k)&&(n[k]=m[k])};l.prototype={addEventListener:function(l,m,k){this._eventTypes||(this._eventTypes={});var f=this._eventTypes[l];f||(f=this._eventTypes[l]={level:0,listeners:[]});f.listeners.push({listener:m,useCapture:k})},dispatchEvent:function(l){var m=l.type;this._dispatchEvent("pre"+m,l);this._dispatchEvent(m,l);this._dispatchEvent("post"+m,l)},_dispatchEvent:function(l,
m){var k=this._eventTypes?this._eventTypes[l]:null;if(k){var f=k.listeners;try{if(k.level++,f)for(var h=0,g=f.length;h<g;h++)if(f[h]){var d=f[h].listener;"function"===typeof d?d.call(this,m):d.handleEvent&&"function"===typeof d.handleEvent&&d.handleEvent(m)}}finally{if(k.level--,k.compact&&0===k.level){for(h=f.length-1;0<=h;h--)f[h]||f.splice(h,1);0===f.length&&delete this._eventTypes[l];k.compact=!1}}}},isListening:function(l){return!this._eventTypes?!1:void 0!==this._eventTypes[l]},removeEventListener:function(l,
m,k){if(this._eventTypes){var f=this._eventTypes[l];if(f){for(var h=f.listeners,g=0,d=h.length;g<d;g++){var a=h[g];if(a&&a.listener===m&&a.useCapture===k){0!==f.level?(h[g]=null,f.compact=!0):h.splice(g,1);break}}0===h.length&&delete this._eventTypes[l]}}}};return{EventTarget:l}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(l,n,m){function k(f){f=f||{};this._document=f.document||document}var f={};k.getTheme=function(h){h=h||"default";var g=f[h];g||(g=f[h]=new k);return g};k.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(f,g){var d=this,a=d._themeClass;d._themeClass=f;this._load(f,g,function(){d.onThemeChanged({type:"ThemeChanged",oldValue:a,newValue:d.getThemeClass()})})},onThemeChanged:function(f){return this.dispatchEvent(f)},
buildStyleSheet:function(f,g){function d(e,b,d){b&&(a.push("."+f+" ."+e+" {"),a.push("\t"+(d?"background-color":"color")+": "+b+";"),a.push("}"))}var a=[];a.push("");a.push("."+f+" {");g.fontFamily&&a.push("\tfont-family: "+g.fontFamily+";");g.fontSize&&a.push("\tfont-size: "+g.fontSize+";");g.fontSize&&a.push("\tcolor: "+g.text+";");a.push("}");a.push("."+f+".textview {");g.background&&a.push("\tbackground-color: "+g.background+";");a.push("}");a.push("."+f+" .textviewLeftRuler {");g.leftRuler&&
a.push("\tborder-right: 1px solid "+g.leftRuler+";");a.push("}");a.push("."+f+" .textviewRightRuler {");g.rightRuler&&a.push("\tborder-left: 1px solid "+g.rightRuler+";");a.push("}");d("ruler.annotations",g.annotationRuler,!0);d("ruler.lines",g.annotationRuler,!0);d("ruler.folding",g.annotationRuler,!0);d("ruler.overview",g.overviewRuler,!0);d("rulerLines",g.lineNumber,!1);d("rulerLines.even",g.lineNumberEven,!1);d("rulerLines.odd",g.lineNumberOdd,!1);d("annotationLine.currentLine",g.currentLine,
!0);d("entity-name-tag",g.keyword,!1);d("entity-other-attribute-name",g.attribute,!1);d("string-quoted",g.string,!1);d("meta.annotation.currentLine",g.currentLine,!0);d("keyword",g.keyword,!1);d("string",g.string,!1);d("constant",g.constant,!1);d("comment",g.comment,!1);d("comment.block.documentation",g.comment,!1);d("keyword.other.documentation.markup",g.comment,!1);d("keyword.other.documentation.markup",g.comment,!1);return a.join("\n")},_createStyle:function(f,g,d,a){var e=this._document;f="orion-theme-"+
f;var b=e.getElementById(f);if(b){if(a||b.firstChild.data===g)return;b.removeChild(b.firstChild);b.appendChild(e.createTextNode(g))}else a?(b=m.createElement(e,"link"),b.rel="stylesheet",b.type="text/css",b.href=g,b.addEventListener("load",function(){d()})):(b=m.createElement(e,"style"),b.appendChild(e.createTextNode(g))),b.id=f,(e.getElementsByTagName("head")[0]||e.documentElement).appendChild(b);a||d()},_load:function(f,g,d){if(f)if("string"===typeof g)this._createStyle(f,g,d);else if(g=g.href,
".css"!==g.substring(g.length-4)&&(g+=".css"),/^\//.test(g)||/[a-zA-Z0-9]+:\/\//i.test(g)||!l.toUrl)this._createStyle(f,g,d,!0);else{var a=this;l(["text!"+g],function(e){a._createStyle(f,e,d,!1)})}else d()}};n.EventTarget.addMixin(k.prototype);return{TextTheme:k}});
define("orion/widgets/themes/ThemeClass",[],function(){function l(l){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=l;this.classString="."+l+"{ "}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 n(){}n.prototype.navbar="white";n.prototype.button="#777777";n.prototype.location="#EFEFEF";n.prototype.selection="#cedce7";n.prototype.sidepanel="#F7F7F7";n.prototype.mainpanel="white";n.prototype.navtext="#bfbfbf";n.prototype.content="#3087B3";n.prototype.search="#444";n.prototype.toolpanel="white";n.prototype.writeNavigationStyle=function(){var m="",k=[],f=new l.ThemeClass("orionPage");
f.style.backgroundColor="#fdfdfd";f.style.width="100%";f.style.height="100%";k.push(f);f=new l.ThemeClass("topRowBanner");f.style.margin="0";f.style.border="0";f.style.backgroundColor=this.navbar;f.style.height="16px";f.style.padding="10px";f.style.paddingLeft="6px";f.style.paddingRight="2px";f.style.borderBottom="none";f.style.boxShadow="0 2px 2px 0 rgba(0, 0, 0, 0.1),0 1px 0 0 rgba(0, 0, 0, 0.1)";f.style.zIndex="100";k.push(f);f=new l.ThemeClass("a");f.style.textDecoration="none";f.style.color=
this.content;k.push(f);f=new l.ThemeClass("navlink");f.style.display="inline-block";f.style.padding="2px";f.style.color=this.content;f.style.verticalAlign="bottom";k.push(f);f=new l.ThemeClass("primaryNav");f.style.color=this.navtext;f.style.fontSize="8pt";f.style.fontWeight="normal";f.style.paddingTop="0";f.style.verticalAlign="baseline";k.push(f);f=new l.ThemeClass("primaryNav a");f.style.fontSize="8pt";f.style.color=this.navtext;f.style.marginRight="6px";f.style.marginLeft="6px";f.style.verticalAlign=
"baseline";f.style.textDecoration="none";k.push(f);f=new l.ThemeClass("primaryNav a:hover");f.style.color="#bfbfbf";f.style.cursor="hand";f.style.color="white";f.style.fontWeight="normal";k.push(f);for(var h in k)m+=k[h].toString();return m};n.prototype.writeLocationStyle=function(){var m="",k=[],f=new l.ThemeClass("titleArea");f.style.margin="0";f.style.paddingTop="5px";f.style.border="0";f.style.background=this.location;f.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+
this.location+"), color-stop(100%,"+this.location+"))";f.style.borderBottom="1px solid "+this.location;f.style.minHeight="20px";k.push(f);f=new l.ThemeClass("breadcrumb");f.style.fontSize="8pt";f.style.textDecoration="none";f.style.color="#f1f1f2;";f.style.paddingTop="2px";k.push(f);f=new l.ThemeClass("a.breadcrumb:hover");f.style.textDecoration="none";f.style.borderBottom="1px dotted";f.style.color="#F58B0F";f.style.cursor="pointer";k.push(f);f=new l.ThemeClass("breadcrumbSeparator");f.style.fontSize=
"8pt";f.style.textDecoration="none";f.style.color=this.separator;f.style.fontWeight="bold";k.push(f);f=new l.ThemeClass("currentLocation");f.style.fontWeight="bold";f.style.fontSize="8pt";f.style.color=this.breadcrumb;f.style.textDecoration="none";f.style.textWrap="normal";f.style.lineHeight="10pt";k.push(f);f=new l.ThemeClass("a.currentLocation:hover");f.style.fontWeight="bold";f.style.fontSize="10pt";f.style.color="#666666";f.style.textDecoration="none";f.style.borderBottom="0";k.push(f);f=new l.ThemeClass("navlinkonpage");
f.style.color=this.content;f.style.verticalAlign="middle";k.push(f);this.bannerProgress&&(f=new l.ThemeClass("topRowBanner .progressPane_running"),f.style.borderColor=this.bannerProgress,k.push(f));for(var h in k)m+=k[h].toString();return m};n.prototype.writeButtonStyle=function(){var m="",k=[],f=new l.ThemeClass("commandButton");f.style.color="#666";f.style.border="1px solid #dedede";f.style.backgroundColor="#ddd";f.style.textAlign="center";f.style.verticalAlign="middle";f.style.cursor="pointer";
f.style.display="inline-block";f.style.padding="4px 6px";f.style.borderRadius="3px";f.style.lineHeight="12px";f.style.fontSize="9pt";f.style.userSelect="none";k.push(f);f=new l.ThemeClass("commandButton:over");f.style.backgroundColor="#e6e6e6";f.style.border="1px solid #808080";k.push(f);f=new l.ThemeClass("commandMenu");f.style.color="#222";f.style.display="inline-block";f.style.verticalAlign="baseline";f.style.margin="0";f.style.fontSize="8pt";f.style.fontWeight="normal";f.style.border="1px solid #dedede";
f.style.backgroundColor="#efefef";f.style.cursor="pointer";f.style.borderRadius="1px";k.push(f);f=new l.ThemeClass("commandMenuItem");f.style.border="0";f.style.padding="0";f.style.margin="0";k.push(f);for(var h in k)m+=k[h].toString();return m};n.prototype.writeMainStyle=function(){var m="",k=[],f=new l.ThemeClass("searchbox");f.style.backgroundImage="url(../images/core_sprites.png)";f.style.backgroundRepeat="no-repeat";f.style.backgroundPosition="4px -297px";f.style.width="12px";f.style.height=
"12px";f.style.backgroundColor=this.search;f.style.border="1px solid "+this.search;f.style.fontSize="11px";f.style.width="15em";f.style.height="16px";f.style.borderRadius="10px";f.style.color="#999";f.style.padding="0";f.style.paddingLeft="20px";f.style.marginLeft="5px";f.style.marginTop="6px !important";f.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";k.push(f);f=new l.ThemeClass("searchbox:focus");f.style.color="white";f.style.outline=
"none";k.push(f);f=new l.ThemeClass("checkedRow");f.style.cssText="background-color:"+this.selection+" !important;";k.push(f);f=new l.ThemeClass("navbar-item-selected");f.style.background=this.selection;f.style.color=this.content;k.push(f);f=new l.ThemeClass("auxpane");f.style.border="0";f.style.background=this.sidepanel;k.push(f);f=new l.ThemeClass("mainpane");f.style.background=this.mainpanel;f.style.border=0;k.push(f);f=new l.ThemeClass("mainToolbar");f.style.background=this.toolpanel;k.push(f);
for(var h in k)m+=k[h].toString();return m};n.prototype.render=function(l){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};n.prototype.getSheet=function(l){l.navbar.value?(this.navbar=l.navbar.value,this.button=l.button.value,this.location=l.location.value,this.selection=l.selection.value,this.sidepanel=l.sidepanel.value,this.mainpanel=l.mainpanel.value,this.navtext=l.navtext.value,this.search=
l.search.value,this.content=l.content.value,this.toolpanel=l.toolpanel.value,this.bannerProgress=l.bannerProgress.value):(this.navbar=l.navbar,this.button=l.button,this.location=l.location,this.selection=l.selection,this.sidepanel=l.sidepanel,this.mainpanel=l.mainpanel,this.navtext=l.navtext,this.search=l.search,this.content=l.content,this.toolpanel=l.toolpanel,this.bannerProgress=l.bannerProgress);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:n}});define("orion/widgets/themes/ThemeVersion",[],function(){return"6.1"});
define("orion/widgets/themes/container/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter","orion/widgets/themes/ThemeVersion"],function(l,n,m,k){function f(){}function h(){this.styles=[];var d=new f;d.name="Orion";d.navbar="white";d.button="#EFEFEF";d.location="#efefef";d.selection="FEC";d.sidepanel="#FBFBFB";d.mainpanel="white";d.toolpanel="white";d.navtext="#bfbfbf";d.content="#3087B3";d.search="#444";d.breadcrumb="#3087B3";
d.separator="#333";d.bannerProgress="whitesmoke";this.styles.push(d);d=new f;d.name="Orion2014";d.navbar="white";d.button="#EFEFEF";d.location="#EFEFEF";d.selection="FEC";d.sidepanel="#EEEEEE";d.mainpanel="#EEEEEE";d.toolpanel="#EEEEEE";d.navtext="#BFBFBF";d.content="#333333";d.search="#444444";d.breadcrumb="#333333";d.separator="#333333";d.bannerProgress="orange";this.styles.push(d);d=new f;d.name="Green Zone";d.navbar="seagreen";d.button="lavender";d.location="darkseagreen";d.selection="moccasin";
d.sidepanel="aliceblue";d.mainpanel="white";d.toolpanel="white";d.navtext="#FBFBFB";d.content="darkgreen";d.search="darkgreen";d.breadcrumb="#3087B3";d.separator="seagreen";d.bannerProgress="#F2F2F2";this.styles.push(d);d=new f;d.name="Pretty In Pink";d.navbar="plum";d.button="lavender";d.location="pink";d.selection="lavender";d.sidepanel="seashell";d.mainpanel="white";d.toolpanel="white";d.navtext="#FBFBFB";d.content="mediumorchid";d.search="violet";d.breadcrumb="#3087B3";d.separator="plum";d.bannerProgress=
"#F2F2F2";this.styles.push(d);d=new f;d.name="Blue Monday";d.navbar="cornflowerblue";d.button="lavender";d.location="skyblue";d.selection="lavender";d.sidepanel="aliceblue";d.mainpanel="white";d.toolpanel="white";d.navtext="#FBFBFB";d.content="royalblue";d.search="royalblue";d.breadcrumb="#3087B3";d.separator="cornflowerblue";d.bannerProgress="#F2F2F2";this.styles.push(d);d=new f;d.name="Vanilla Skies";d.navbar="sandybrown";d.button="lemmonchiffon";d.location="cornsilk";d.selection="lemonchiffon";
d.sidepanel="white";d.mainpanel="white";d.toolpanel="white";d.navtext="lemonchiffon";d.content="chocolate";d.search="moccasin";d.breadcrumb="#3087B3";d.separator="sandybrown";d.bannerProgress="#F2F2F2";this.styles.push(d);d=new f;d.name="Beetlejuice";d.navbar="indigo";d.button="slateblue";d.location="darkslateblue";d.selection="silver";d.sidepanel="lavender";d.mainpanel="white";d.toolpanel="white";d.navtext="#FBFBFB";d.content="mediumslateblue";d.search="#444";d.breadcrumb="#3087B3";d.separator="indigo";
d.bannerProgress="#F2F2F2";this.styles.push(d);d=new f;d.name="Red";d.navbar="#CD2127";d.button="#777777";d.location="#D85F56";d.selection="lightcoral";d.sidepanel="#EFDAB2";d.mainpanel="#FDFADD";d.toolpanel="#FDFADD";d.navtext="#FBFBFB";d.content="darkred";d.search="#D85F56";d.breadcrumb="darkred";d.separator="#CD2127";d.bannerProgress="#F2F2F2";this.styles.push(d)}function g(){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";f.prototype.bannerProgress="white";h.prototype.styles=[];h.prototype.getStyles=g;h.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion2014",selectedKey:"selected",version:k}};
h.prototype.getViewData=function(){var d={top:10,left:10,width:350,height:350};d.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 a=0;3>a;a++)d.shapes.push({type:"TEXT",name:l.Content,label:"org.eclipse.orion.content",x:170,y:127+20*a,fill:"#3087B3",family:"content"});for(a=0;3>a;a++)d.shapes.push({type:"TEXT",name:l.Content,label:"Item",
x:25,y:115+20*a,fill:"#3087B3",family:"content"});for(a=0;3>a;a++)d.shapes.push({type:"TRIANGLE",name:"twisty",x1:160,y1:121+20*a,x2:165,y2:124+20*a,x3:160,y3:127+20*a,family:"navbar",fill:"#333"});d.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return d};h.prototype.processSettings=function(d){var a=new m.ThemeSheetWriter;(new n.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",a.getSheet(d))};return{ThemeData:h,getStyles:g}});
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"," \x3cNo available services or timed out, check URL and try reloading\x3e":" \x3cNo available services or timed out, check URL and try reloading\x3e",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 (? \x3d any character, * \x3d any string):":"Type the name of a file to open (? \x3d any character, * \x3d any string):",Search:"Search","FileName FolderName":"FileName FolderName(Optional)","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 ","\x3c/a\x3e":"\x3c/a\x3e","\x3e":"\x3e","Sign In To ":"Sign In To ","Sign In":"Sign In",Help:"Help","Report a Bug":"Report a Bug","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",Yes:"Yes",No:"No","Click or use delete key to delete the search term":"Click or use delete key to delete the search term"});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(l){function n(m,k,f){this.elements=f;this.taskPanel=document.createElement("div");this.taskPanel.className="UAContainer";this.taskPanel.innerHTML='\x3cheader class\x3d"UAHeader"\x3eDevelop software from within the cloud\x3c/header\x3e';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);!0===k?(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))):m.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}n.prototype.elementNode=null;n.prototype.switchesContainer=null;n.prototype.switches=null;n.prototype.radioButtons=null;n.prototype.chosenSwitch=
null;n.prototype.addElement=function(l){var k=document.createElement("span");k.className="UAContainer-icon";k.innerHTML='\x3cspan class\x3d"workingSpan"\x3e\x3cimg src\x3d"'+l.image+'" id\x3d"'+l.label+'ImageNode" alt\x3d"'+l.alt+'" height\x3d"64" width\x3d"64"\x3e\x3c/span\x3e\x3cspan class\x3d"UAIcon-label"\x3e\x3cspan class\x3d"UALabel" id\x3d"'+l.label+'LabelNode" \x3e'+l.label+"\x3c/span\x3e\x3c/span\x3e";k.onmouseover=function(){document.getElementById(l.label+"ImageNode").src=l.secondaryImage;
document.getElementById(l.label+"LabelNode").className="UALabel-live";k.className="UAContainer-icon-live"};k.onmouseout=function(){document.getElementById(l.label+"ImageNode").src=l.image;document.getElementById(l.label+"LabelNode").className="UALabel";k.className="UAContainer-icon"};var f=this;k.onclick=function(){f.showMedia(l)};this.elementNode.appendChild(k)};n.prototype.clearElements=function(){this.elementNode.innerHTML=""};n.prototype.showMedia=function(l){this.clearElements();this.addElement(l);
var k=document.createElement("span");k.className="UAContainer-media";k.innerHTML='\x3cdiv\x3e\x3c/div\x3e\x3cdiv\x3e\x3c/div\x3e\x3cspan class\x3d"mediaSpan"\x3e\x3cimg src\x3d"'+l.media+'" alt\x3d"'+l.alt+'" height\x3d"300" width\x3d"400"\x3e\x3c/span\x3e';this.elementNode.appendChild(k);setTimeout(function(){k.style.opacity=1},100);l=document.getElementById(l.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=l.parentNode;l.className="chosenCircle"};n.prototype.createSwitch=
function(l){var k;k=l?l.label+"switch":"indexSwitch";var f=document.createElement("span");f.className="workingSpan";f.innerHTML='\x3cdiv class\x3d"circle" id \x3d"'+k+'"\x3e\x3c/div\x3e';var h=this;f.onclick=l?function(){h.showMedia(l)}:function(){h.initialize();h.chosenSwitch.firstChild.className="circle";h.chosenSwitch=f;h.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(f);return this.radioButtons[this.radioButtons.length]=f};n.prototype.initialize=function(){this.clearElements();
this.elements.forEach(this.addElement.bind(this))};n.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return n});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(l,n,m,k){function f(){}var h=null;f.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'\x3cdiv class\x3d"dialog" role\x3d"dialog"\x3e\x3cdiv class\x3d"dialogTitle"\x3e\x3cspan id\x3d"title" class\x3d"dialogTitleText layoutLeft"\x3e\x3c/span\x3e\x3cbutton aria-label\x3d"Close" class\x3d"dismissButton layoutRight core-sprite-close imageSprite" id\x3d"closeDialog"\x3e\x3c/button\x3e\x3c/div\x3e\x3cdiv id\x3d"dialogContent" class\x3d"dialogContent layoutBlock"\x3e\x3c/div\x3e\x3cdiv id\x3d"buttons" class\x3d"dialogButtons"\x3e\x3c/div\x3e\x3c/div\x3e',_initialize:function(){var g=
document.body;this.$frameParent=g;this.$$modalExclusions=this.$$modalExclusions||[];var d=document.createRange();d.selectNode(g);d=d.createContextualFragment(this.CONTAINERTEMPLATE);g.appendChild(d);this.$frame=g.lastChild;this.title&&m.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=m.$("#closeDialog",this.$frame);var a=this;this.$close.addEventListener("click",function(e){a.hide()},!1);this.$parent=m.$(".dialogContent",this.$frame);d=document.createRange();d.selectNode(this.$parent);
g=d.createContextualFragment(this.TEMPLATE);this.messages&&m.processTextNodes(g,this.messages);this.$parent.appendChild(g);this.$buttonContainer=m.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(e){e.keyCode===m.KEY.ESCAPE?a.hide():e.keyCode===m.KEY.ENTER&&"function"===typeof a._defaultCallback&&a._defaultCallback()},!1);this._bindElements(this.$parent);"function"===typeof this._bindToDom&&this._bindToDom(this.$parent)},_makeButtons:function(){if(this.$buttonContainer&&
Array.isArray(this.buttons)){var g=this;this.buttons.forEach(function(d){var a=k.createButton(d.text,d.callback);d.id&&(a.id=d.id,g["$"+a.id]=a);d.isDefault&&(g._defaultCallback=d.callback,g._defaultButton=a);g.$buttonContainer.appendChild(a)})}},_makeModal:function(g){var d=this;this.$frame.addEventListener("blur",function(a){d.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var b=!m.contains(d.$frame,a.target);if(b)for(var e=0;e<d.$$modalExclusions.length;e++)if(m.contains(d.$$modalExclusions[e],
a.target)){b=!1;break}b&&(window.setTimeout(function(){(d.$lastFocusedElement||d.$parent).focus()},0),m.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);g=this.$frameParent.childNodes;var a=!1;this._addedBackdrop=[];for(var e=0;e<g.length;e++){for(var b=0;b<this.$$modalExclusions.length;b++)if(m.contains(this.$$modalExclusions[b],g[e])){a=!0;break}!a&&(g[e]!==d.$frame&&g[e].classList&&!g[e].classList.contains("tooltipContainer"))&&
(b=g[e],b.classList.contains("modalBackdrop")||(b.classList.add("modalBackdrop"),this._addedBackdrop.push(b)))}(g=m.lastTabbable(this.$buttonContainer)||m.lastTabbable(this.$parent))&&g.addEventListener("keydown",function(a){if(a.keyCode===m.KEY.TAB){var b=d._getFirstFocusField();b&&b!==a.target&&b.focus();m.stop(a)}},!1)},_addChildDialog:function(g){this.$$modalExclusions.push(g.$frame||g.$parent)},_inModalExclusion:function(g){return this.$$modalExclusions.some(function(d){return g.$frame===d||
g.$parent===d})},_bindElements:function(g){for(var d=0;d<g.childNodes.length;d++){var a=g.childNodes[d];a.id&&(this["$"+a.id]=a);this._bindElements(a)}},hide:function(g){!g&&h===this&&(h=null);"function"===typeof this._beforeHiding&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0));this.$frame.classList.remove("dialogShowing");m.setFramesEnabled(!0);"function"===typeof this._afterHiding&&
this._afterHiding();var d=this;this.keepAlive||window.setTimeout(function(){d.destroy()},0)},show:function(g){if(this.modal)if(this._makeModal(),h){if(!h._inModalExclusion(this)){this.hide(!0);return}}else h=this;"function"===typeof this._beforeShowing&&this._beforeShowing();m.setFramesEnabled(!1);var d=m.bounds(this.$frame),a=m.bounds(document.documentElement),e;g?(e=m.bounds(g),g=e.top+e.height+4,e=e.left+4,g+d.height>a.height&&(g=Math.max(0,a.height-d.height-4)),e+d.width>a.width&&(e=Math.max(0,
a.width-d.width-4))):(e=Math.max(0,(a.width-d.width)/2),g=Math.max(0,(a.height-d.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=g+"px";this.$frame.style.left=e+"px";this.$frame.classList.add("dialogShowing");"function"===typeof this._afterShowing&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return m.firstTabbable(this.$parent)||this._defaultButton||m.firstTabbable(this.$buttonContainer)||this.$close},
destroy:function(){this.$frame&&(h===this&&(h=null),m.setFramesEnabled(!0),this._addedBackdrop&&0<this._addedBackdrop.length&&this._addedBackdrop.forEach(function(g){g.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)}};f.prototype.constructor=f;return{Dialog:f}});
define("orion/widgets/UserMenu","i18n!orion/widgets/nls/messages require orion/webui/littlelib orion/PageLinks orion/widgets/userAssistance/UATaskPanel orion/webui/dialog orion/webui/dropdown".split(" "),function(l,n,m,k,f,h,g){function d(a){this._displaySignOut=!0;this._init(a)}d.prototype={_init:function(a){this._dropdownNode=m.node(a.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=a.dropdown;this._serviceRegistry=a.serviceRegistry;this.authenticatedServices=
{};this.unauthenticatedServices={};this._noSeparator=a.noSeparator;this._dropDownItemClass=a.dropDownItemClass;this._keyAssistClass=a.keyAssistClass;void 0!==a.signOut&&(this._displaySignOut=a.signOut)},isSingleService:function(){return 1===this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)},hasServices:function(){return 0<this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)},length:function(a){var e=0,b;for(b in a)a.hasOwnProperty(b)&&e++;
return e},_makeMenuItem:function(a,e){var b=g.createMenuItem(a).firstElementChild;"string"===typeof this._dropDownItemClass&&""!==this._dropDownItemClass&&b.classList.add(this._dropDownItemClass);b.addEventListener("click",e,!1);b.addEventListener("keydown",function(a){(a.keyCode===m.KEY.ENTER||a.keyCode===m.KEY.SPACE)&&e()},!1);return b},_renderAuthenticatedService:function(a,e){var b=this,d=this.authenticatedServices[a].authService;if(d&&d.logout&&this._displaySignOut){var g=this._makeMenuItem(l["Sign Out"],
function(){d.logout().then(function(){b.addUserItem(a,d,b.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var e=localStorage.length-1;0<=e;e--){var g=localStorage.key(e);g&&0===g.indexOf("/orion/preferences/user")&&localStorage.removeItem(g)}d.getAuthForm(window.location.href).then(function(a){window.location=a})})});this._dropdownNode.appendChild(g.parentNode)}},renderServices:function(){function a(a){b[a]||(b[a]=e.createDocumentFragment());return b[a]}
var e=document,b=[],d=this._serviceRegistry;k.getPageLinksInfo(d,"orion.page.link.user").then(function(f){this._dropdown?this._dropdown.empty():this._dropdownNode&&m.empty(this._dropdownNode);f.getAllLinks().forEach(function(b){var d,g;if(b.category&&(g=/user\.(\d+)/.exec(b.category)))d=parseInt(g[1],10);if("number"!==typeof d||isNaN(d))d=1;d=a(d);g=e.createElement("li");var f=e.createElement("a");f.role="menuitem";"string"===typeof this._dropDownItemClass?""!==this._dropDownItemClass&&f.classList.add(this._dropDownItemClass):
f.classList.add("dropdownMenuItem");f.href=b.href;f.textContent=b.textContent;g.appendChild(f);d.appendChild(g);f.addEventListener("keydown",function(a){(a.keyCode===m.KEY.ENTER||a.keyCode===m.KEY.SPACE)&&f.click()},!1)}.bind(this));this.keyAssistFunction&&(f=this._makeMenuItem(l["Keyboard Shortcuts"],this.keyAssistFunction),"string"===typeof this._keyAssistClass?""!==this._keyAssistClass&&f.classList.add(this._keyAssistClass):f.classList.add("key-assist-menuitem"),f=f.parentNode,a(0).appendChild(f));
if(f=d.getServiceReferences("orion.page.getstarted")[0])f=f.getProperty("data"),f=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,f)).parentNode,a(0).appendChild(f);var h=this;b.sort(function(a,b){return a-b}).forEach(function(a,e){if(e<b.length-1&&!this._noSeparator){var d=g.createSeparator();a.appendChild(d)}h._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var k in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(k)&&this._renderAuthenticatedService(k,
0)}.bind(this))},getStartedDialog:function(a){new f(null,!0,a)},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,e,b,d){d?(this.unauthenticatedServices[a]&&delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:e,label:b,data:d}):(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:e,label:b,pending:this.unauthenticatedServices[a].pending}:
{authService:e,label:b});this.renderServices()}};d.prototype.constructor=d;return{UserMenu:d}});
define("orion/crawler/nls/root/messages",{"Searching file:":"Searching file:","is not supported in this file system":"is not supported in this file system","${0} files found out of ${1}":"${0} files found out of ${1}","The search term on this location will not use indexed files.":"The search term on this location will not use indexed files.","It will take longer time. Do you want to proceed?":"It will take longer time. Do you want to proceed?","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,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/searchUtils","i18n!orion/nls/messages require orion/regex orion/commandRegistry orion/PageUtil orion/URITemplate".split(" "),function(l,n,m,k,f,h){function g(a,e,b){var d="";b&&(d="^");if(d=m.parse("/"+d+a.searchStr+"/"))b=d.pattern,d=d.flags,-1===d.indexOf("i")&&!e.caseSensitive&&(d+="i"),a.regExp={pattern:b,flags:d},a.wildCard=!0}var d={ALL_FILE_TYPE:"*.*",doSearch:function(a,e,b,g){a?(e=b,b=!0,"*"===e&&(e=""),""===e&&(b=g&&g.type!==d.ALL_FILE_TYPE),b&&(a=a.createSearchParams(e,!1,
!1,g),a=d.generateSearchHref(a),window.location=a)):window.alert(l["Can't search: no search service is available"])},generateSearchHelper:function(a,e){var b=a.keyword,f=b,h={};a.fileType&&(a.fileType!==d.ALL_FILE_TYPE&&""===b)&&(f="*."+a.fileType);if(a.regEx)h.searchStr=b,g(h,a,e);else{var k=-1<b.indexOf("*"),l=-1<b.indexOf("?");k&&(b=b.split("*").join(".*"));l&&(b=b.split("?").join("."));!k&&!l&&!a.nameSearch?(h.searchStr=a.caseSensitive?b.split("\\").join(""):b.split("\\").join("").toLowerCase(),
h.wildCard=!1):(h.searchStr=a.caseSensitive?b:b.toLowerCase(),g(h,a,e),h.wildCard=!0)}h.searchStrLength=h.searchStr.length;return{params:a,inFileQuery:h,displayedSearchTerm:f}},convertSearchParams:function(a){void 0!==a.rows&&(a.rows=parseInt(a.rows,10));void 0!==a.start&&(a.start=parseInt(a.start,10));"string"===typeof a.regEx&&(a.regEx="true"===a.regEx.toLowerCase());"string"===typeof a.caseSensitive&&(a.caseSensitive="true"===a.caseSensitive.toLowerCase());"string"===typeof a.nameSearch&&(a.nameSearch=
"true"===a.nameSearch.toLowerCase());void 0!==a.fileNamePatterns&&(a.fileNamePatterns=d.getFileNamePatternsArray(a.fileNamePatterns))},getFileNamePatternsArray:function(a){var e=void 0;a&&(a=a.trim(),a=a.replace(/^(\s*,\s*)+/g,""),a=a.replace(/([^\\]),(\s*,\s*)*/g,"$1/"),a=a.replace(/(\s*\/\s*)/g,"/"),a=a.replace(/\/\/+/g,"/"),a=a.replace(/\/+$/g,""),e=a.split("/"));return e},copySearchParams:function(a,e){var b={},d;for(d in a)if(void 0!==a[d]&&null!==a[d]&&(e||"replace"!==d))b[d]=a[d];return b},
generateSearchHref:function(a){var e=n.toUrl("search/search.html");a=d.copySearchParams(a,!0);var b=a.resource;a.resource=void 0;return"undefined"!==typeof a.keyword?(new h(e+"#{,resource,params*}")).expand({resource:b,params:a}):(new h(e+"#{,resource}")).expand({resource:b})},generateFindURLBinding:function(a,e,b,d,g){a={find:e.searchStr,regEx:e.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:"string"===typeof d?d:void 0,atLine:"number"===typeof b?b:void 0};return g?a:","+
(new h("{,params*}")).expand({params:a})},convertFindURLBinding:function(a){"string"===typeof a.regEx&&(a.regEx="true"===a.regEx.toLowerCase());"string"===typeof a.caseSensitive&&(a.caseSensitive="true"===a.caseSensitive.toLowerCase());"string"===typeof a.atLine&&(a.atLine=parseInt(a.atLine,10))},replaceRegEx:function(a,e,b){return a.replace(RegExp(e.pattern,e.flags),b)},replaceStringLiteral:function(a,e,b){e=m.parse("/"+e+"/gim");return d.replaceRegEx(a,e,b)},searchOnelineLiteral:function(a,e,b){var d;
d=0;for(var g=!1,f=[];!(d=e.indexOf(a.searchStr,d),0>d);){f.push({startIndex:d,length:a.searchStrLength});g=!0;if(b)break;d+=a.searchStrLength}return g?f:null},findRegExp:function(a,e,b,d){if(!e)return null;b=b||"";b+=(-1===b.indexOf("g")?"g":"")+(-1===b.indexOf("m")?"m":"");var g=null;return(g=RegExp(e,b).exec(a.substring(d)))&&{startIndex:g.index+d,length:g[0].length}},searchOnelineRegEx:function(a,e,b){for(var g=0,f=!1,h=[];;)if(g=d.findRegExp(e,a.regExp.pattern,a.regExp.flags,g)){h.push(g);f=
!0;if(b)break;g=g.startIndex+g.length}else break;return f?h:null},generateNewContents:function(a,e,b,g,f,h){if(g&&e){a||(b.contents=[]);for(var k=0;k<e.length;k++){for(var l=e[k],m=!1,n=!1,u=[],w,z=0,B=0;B<g.children.length;B++)if(g.children[B].lineNumber-1===k){z=B;for(m=0;m<g.children[B].matches.length;m++)!1!==g.children[B+m].checked&&u.push(m);n=0<u.length;w=g.children[B].matches;m=!0;break}if(m){if(n){u=d.replaceCheckedMatches(l,f,w,u,h);l=u.replacedStr;for(m=0;m<g.children[z].matches.length;m++)g.children[z+
m].newMatches=u.newMatches}else for(m=0;m<g.children[z].matches.length;m++)g.children[z+m].newMatches=g.children[z+m].matches;a?b.contents[k]=l:b.contents.push(l)}else a||b.contents.push(l)}}},generateMatchContext:function(a,e,b){var d=[],g=2*a+1,f;e.length<=g?(f=0,a=e.length-1):(f=b-a,0>f?(f=0,a=f+g-1):(a=b+a,a>e.length-1&&(a=e.length-1,f=a-g+1)));for(g=f;g<=a;g++)d.push({context:e[g],current:g===b});return d},splitFile:function(a){for(var e=0,b=0,d=0,g=0,f=[];;){-1!==e&&e<=d&&(e=a.indexOf("\r",
d));-1!==b&&b<=d&&(b=a.indexOf("\n",d));if(-1===b&&-1===e){f.push(a.substring(g));break}var h=1;-1!==e&&-1!==b?e+1===b?(h=2,d=b+1):d=(e<b?e:b)+1:d=-1!==e?e+1:b+1;f.push(a.substring(g,d-h));g=d}return f},searchWithinFile:function(a,e,b,g,f,h){b=d.splitFile(b);f&&(e.contents=b);if(e){e.children=[];for(var k=g=0;k<b.length;k++){var l=b[k];if(l&&0<l.length){var m=h?l:l.toLowerCase();if(m=a.wildCard?d.searchOnelineRegEx(a,m):d.searchOnelineLiteral(a,m)){var n,u=k+1;if(f)for(var w=0;w<m.length;w++)n=w+
1,n={parent:e,checked:e.checked,type:"detail",matches:m,lineNumber:u,matchNumber:n,name:l,location:e.location+"-"+u+"-"+n},e.children.push(n);else n={parent:e,context:d.generateMatchContext(2,b,k),checked:e.checked,type:"detail",matches:m,lineNumber:u,name:l,location:e.location+"-"+u},e.children.push(n);g+=m.length}}}e.totalMatches=g}},replaceCheckedMatches:function(a,e,b,d,g){for(var f=0,h="",k=[],l=0;l<b.length;l++){f!==b[l].startIndex&&(h+=a.substring(f,b[l].startIndex));b[l].length&&(g=b[l].length);
for(var f=!1,m=0;m<d.length;m++)if(d[m]===l){f=!0;break}f?(k.push({startIndex:h.length,length:e.length}),h+=e):(k.push({startIndex:h.length,length:g}),h+=a.substring(b[l].startIndex,b[l].startIndex+g));f=b[l].startIndex+g}f<a.length&&(h+=a.substring(f));return{replacedStr:h,newMatches:k}},fullPathNameByMeta:function(a){var e=a.length,b="";if(0<e)for(e-=1;-1<e;e--)b=b+(""===b?"":"/")+a[e].Name;return b},path2FolderName:function(a,e,b){return a.substring(0,a.length-e.length-(b?0:1))},getOpenSearchPref:function(a,
e){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");e(a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?!0:!1:!1)})},setOpenSearchPref:function(a,e){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",{openInNewTab:e})})}};return d});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages require orion/i18nUtil orion/searchUtils orion/contentTypes orion/Deferred".split(" "),function(l,n,m,k,f,h){function g(d,a,e,b){this.registry=d;this.fileClient=a;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=b&&b.searchOnName;this._buildSkeletonOnly=b&&b.buildSkeletonOnly;this._fetchChildrenCallBack=b&&b.fetchChildrenCallBack;this._searchParams=e;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:k.generateSearchHelper(e);this._location=b&&b.location;this._childrenLocation=b&&b.childrenLocation?b.childrenLocation:this._location;this._reportOnCancel=b&&b.reportOnCancel;this._cancelled=!1;this._statusService=this.registry.getService("orion.page.message");this._progressService=this.registry.getService("orion.page.progress");this._statusService&&this._statusService.setCancelFunction(function(){this._cancelFileContentsSearch()}.bind(this))}g.prototype.search=function(d){var a=
this.registry.getService("orion.core.contentTypeRegistry");this._onSearchComplete=d;this._cancelled=!1;this._deferredArray=[];a.getContentTypes().then(function(a){this.contentTypesCache=a;var b=this;this._visitRecursively(this._childrenLocation).then(function(){(!b._cancelled||b._reportOnCancel)&&b._reportResult();b._cancelled&&b._HandleStatus({name:"Cancel"})}.bind(b),function(a){b._reportResult();b._HandleStatus(a)}.bind(b))}.bind(this))};g.prototype.searchName=function(d,a){d&&(this._searchParams=
d,this.searchHelper=k.generateSearchHelper(d,!0));a&&(this.onSearchNameComplete=a);var e=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(0<this.fileSkeleton.length){for(var b=0;b<this.fileSkeleton.length;b++){var g=this.fileSkeleton[b].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?k.searchOnelineRegEx(this.searchHelper.inFileQuery,g,!0):k.searchOnelineLiteral(this.searchHelper.inFileQuery,g,!0))if(e.push(this.fileSkeleton[b]),e.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:e.length,
docs:e}})}else this.onSearchNameComplete({response:{numFound:0,docs:[]}})};g.prototype.buildSkeleton=function(d,a){this._buildingSkeleton=!0;var e=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=[];var b=this;d();e.getContentTypes().then(function(e){b.contentTypesCache=e;b._visitRecursively(b._childrenLocation).then(function(){b._buildingSkeleton=!1;a();b.searchHelper&&!b._buildSkeletonOnly&&b.searchName()})})};g.prototype._sort=function(d){d.sort(function(a,
e){var b,d;if("Path asc"===this._searchParams.sort){b=a.Location&&a.Location.toLowerCase();b=k.path2FolderName(b,a.Name&&a.Name.toLowerCase(),!0);d=e.Location&&e.Location.toLowerCase();d=k.path2FolderName(d,e.Name&&e.Name.toLowerCase(),!0);if(b<d)return-1;if(b>d)return 1}return this._sortOnNameSingle(a,e)}.bind(this))};g.prototype._HandleStatus=function(d){this._statusService&&"Cancel"===d.name&&(console.log("Crawling search cancelled. Deferred array length : "+this._deferredArray.length),this._statusService.setProgressResult({Message:l["Search cancelled by user"],
Severity:"Warning"}))};g.prototype._reportResult=function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}})};g.prototype._sortOnNameSingle=function(d,a){var e=d.Name&&d.Name.toLowerCase(),b=a.Name&&a.Name.toLowerCase();return e<b?-1:e>b?1:0};g.prototype._fileNameMatches=function(d){var a=!0;this.searchHelper.params.fileNamePatterns&&(a=this.searchHelper.params.fileNamePatterns.some(function(a){a="^"+a.replace(/([*?])/g,
".$1")+"$";return d.match(a)}));return a};g.prototype._visitRecursively=function(d){var a=[],e=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(d);return(e._progressService?this._progressService.progress(e.fileClient.fetchChildren(d),"Crawling search for children of "+d):e.fileClient.fetchChildren(d)).then(function(b){for(var d=0;d<b.length;d++)if(void 0!==b[d].Directory&&!1===b[d].Directory)if(e._searchOnName)a.push(e._buildSingleSkeleton(b[d]));else if(e._buildSkeletonOnly)a.push(e._buildSingleSkeleton(b[d]));
else{if(!e._cancelled){var g=f.getFilenameContentType(b[d].Name,e.contentTypesCache);if(g&&("text/plain"===g["extends"]||"text/plain"===g.id)&&e._fileNameMatches(b[d].Name))g=e._sniffSearch(b[d]),a.push(g),e._deferredArray.push(g)}}else if(b[d].Location)if(e._cancelled)break;else g=e._visitRecursively(b[d].ChildrenLocation),a.push(g),e._deferredArray.push(g);return h.all(a)})};g.prototype._hitOnceWithinFile=function(d){d=this._searchParams.caseSensitive?d:d.toLowerCase();return this.searchHelper.inFileQuery.wildCard?
k.searchOnelineRegEx(this.searchHelper.inFileQuery,d,!0):k.searchOnelineLiteral(this.searchHelper.inFileQuery,d,!0)};g.prototype._reportSingleHit=function(d){this._cancelled||(d.LastModified=d.LocalTimeStamp,this.fileLocations.push(d),this._hitCounter++,this._sort(this.fileLocations),this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0))};g.prototype._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(d){d.cancel()})};
g.prototype._sniffSearch=function(d){this._totalCounter++;var a=this;if(!this._cancelled)if(""===this.searchHelper.params.keyword)this._reportSingleHit(d),this._statusService&&this._statusService.setProgressResult({Message:m.formatMessage(l["${0} files found out of ${1}"],this._hitCounter,this._totalCounter)});else return(a._progressService?a._progressService.progress(a.fileClient.read(d.Location),"Reading file "+d.Location):a.fileClient.read(d.Location)).then(function(e){a._hitOnceWithinFile(e)&&
a._reportSingleHit(d);a._statusService&&a._statusService.setProgressResult({Message:m.formatMessage(l["${0} files found out of ${1}"],a._hitCounter,a._totalCounter)},l.Cancel)},function(a){a&&(a.message&&"cancel"!==a.message.toLowerCase())&&console.error("Error loading file content: "+a.message)})};g.prototype._buildSingleSkeleton=function(d){this._totalCounter++;this.fileSkeleton.push(d);this.searchHelper&&(!this._buildSkeletonOnly&&0===this._totalCounter%100)&&this.searchName();d=new h;d.resolve(this._totalCounter);
return d};g.prototype.constructor=g;return{SearchCrawler:g}});
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,n,m,k,f,h,g){function d(a){this._init(a)}d.prototype=new g.Dialog;d.prototype.TEMPLATE='\x3cdiv role\x3d"search"\x3e\x3cdiv\x3e\x3clabel id\x3d"fileNameMessage" for\x3d"fileName"\x3e${Type the name of a file to open (? \x3d any character, * \x3d any string):}\x3c/label\x3e\x3c/div\x3e\x3cdiv\x3e\x3cinput id\x3d"fileName" type\x3d"text" class\x3d"setting-control" style\x3d"width:90%;"/\x3e\x3c/div\x3e\x3cdiv id\x3d"progress" style\x3d"padding: 2px 0 0; width: 100%;"\x3e\x3cimg src\x3d"'+k.toUrl("../../../images/progress_running.gif")+
'" class\x3d"progressPane_running_dialog" id\x3d"crawlingProgress"\x3e\x3c/img\x3e\x3c/div\x3e\x3cdiv id\x3d"results" style\x3d"max-height:250px; height:auto; overflow-y:auto;" aria-live\x3d"off"\x3e\x3c/div\x3e\x3cdiv id\x3d"statusbar"\x3e\x3c/div\x3e\x3c/div\x3e';d.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 m.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;void 0!==a.nameSearch&&(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||
"function"!==typeof this._searchRenderer.makeRenderFunction)throw Error(l["Missing required argument: searchRenderer"]);this._initialize()};d.prototype._bindToDom=function(a){var e=this;e.$crawlingProgress.style.display="none";this._nameSearch?this.$fileName.setAttribute("placeholder",l["FileName FolderName"]):this.$fileName.setAttribute("placeholder",l.Search);this.$fileName.addEventListener("input",function(a){e._time=+new Date;e._timeoutId&&clearTimeout(e._timeoutId);e._timeoutId=setTimeout(e.checkSearch.bind(e),
0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===f.KEY.ENTER){var d=f.$("a",e.$results);d&&(f.stop(a),(h.isMac?a.metaKey:a.ctrlKey)?window.open(d.href):(window.location.href=d.href,e.hide()))}},!1);a.addEventListener("keydown",function(a){var d,g,h;if(a.keyCode===f.KEY.DOWN||a.keyCode===f.KEY.UP)d=f.$$array("a",e.$results),g=document.activeElement,h=d.indexOf(g),a.keyCode===f.KEY.DOWN?0<=h?(g.classList.remove("treeIterationCursor"),d=h<d.length-1?d[h+1]:d[0],d.focus(),
d.classList.add("treeIterationCursor")):0<d.length&&(d=d[0],d.focus(),d.classList.add("treeIterationCursor")):0<=h?(g.classList.remove("treeIterationCursor"),g=e.$fileName,d=0<h?d[h-1]:g,d.focus(),0<h&&d.classList.add("treeIterationCursor")):0<d.length&&(d[d.length-1].focus(),d[d.length-1].classList.add("treeIterationCursor")),f.stop(a)});a.addEventListener("mouseup",function(a){a.target.focus()},!1);setTimeout(function(){if(e._forceUseCrawler||!e._fileService.getService(e._searcher.getSearchLocation()).search){var a=
e._searchOnRoot?e._searcher.getSearchRootLocation():e._searcher.getChildrenLocation(),a=new n.SearchCrawler(e._searcher.registry,e._fileService,"",{searchOnName:!0,location:a});e._searcher.setCrawler(a);a.buildSkeleton(function(){e.$crawlingProgress.style.display="inline";e.$progress.appendChild(document.createTextNode(l["Building file skeleton..."]))},function(){e.$crawlingProgress.style.display="none";e.$progress.removeChild(e.$progress.lastChild)})}},0);this._message&&(this.$fileNameMessage.removeChild(this.$fileNameMessage.firstChild),
this.$fileNameMessage.appendChild(document.createTextNode(this._message)));this._initialText&&(this.$fileName.value=this._initialText,this.doSearch())};d.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)};d.prototype._detectFolderKeyword=function(a){var e,b=a,d=null;if(this._nameSearch&&(e=/(\S+)\s*(.*)/,(a=e.exec(a))&&3===a.length))a[1]&&
(b=a[1]),a[2]&&(d=a[2]);return{keyword:b,folderKeyword:d}};d.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var e=this._detectFolderKeyword(a),b=this._searcher.createSearchParams(e.keyword,this._nameSearch,this._searchOnRoot),d=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=d;var g=document.createElement("div");g.appendChild(document.createTextNode(this._nameSearch?l["Searching..."]:h.formatMessage(l["Searching for occurrences of"],
a)));f.empty(this.$results);this.$results.appendChild(g);this._searcher.search(b,e.folderKeyword,function(){d===this.currentSearch&&d.apply(null,arguments)}.bind(this))}};d.prototype.decorateResult=function(a){function e(a){0===a.button&&(!a.ctrlKey&&!a.metaKey)&&b.hide()}var b=this;a=f.$$array("a",a);for(var d=0;d<a.length;d++)a[d].addEventListener("click",e,!1)};d.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};d.prototype._afterHiding=function(){this._onHide&&this._onHide()};
d.prototype.constructor=d;return{OpenResourceDialog:d}});define("text!orion/banner/banner.html",[],function(){return'\x3cheader id\x3d"banner" role\x3d"banner"\x3e\n\t\x3c!-- Requires some js code to bind the home link, link to progress image, and binding NLS variables  --\x3e\n\n\t\x3cdiv id\x3d"staticBanner" class\x3d"layoutBlock topRowBanner"\x3e \x3c!-- primaryNav --\x3e\n\t\t\x3cdiv id\x3d"centralNavigationArea" style\x3d"position:absolute;left:0;top:0;width:39px;height:36px; z-index:1;border-right:1px solid #ddd;"\x3e\x3c/div\x3e\n\n\t\t\x3c!-- Static "Home" link. TODO delete this --\x3e\n\t\t\x3ca id\x3d"home" class\x3d"layoutLeft "\x3e\x3c/a\x3e\n\n\t\t\x3c!-- Left banner component: hamburger --\x3e\n\t\t\x3cnav id\x3d"primaryNav" class\x3d"bannerLeftArea" style\x3d"z-index:2;" role\x3d"navigation"\x3e\n\t\t\t\t\x3cbutton class\x3d"centralNavigation commandSprite core-sprite-hamburger" type\x3d"button"id\x3d"centralNavigation"\x3e\x3c/button\x3e\n\t\t\x3c/nav\x3e\n\n\t\t\x3c!-- Middle banner component: Breadcrumb bar --\x3e\n\t\t\x3cdiv class\x3d"clear navigationBreadcrumb bannerMiddleArea" \x3e\n\t\t\t\x3cdiv id\x3d"location" class\x3d"currentLocation"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\n\t\t\x3c!-- Right banner component: user identity --\x3e\n\t\t\x3cdiv class\x3d"bannerRightArea" style\x3d"z-index:2;"\x3e\n\t\t\t\x3c!-- Global commands support. --\x3e\n\t\t\t\x3cdiv id\x3d"globalActions" class\x3d"spacingLeft layoutLeft"\x3e\x3c/div\x3e\n\n\t\t\t\x3c!-- Search. TODO delete this --\x3e\n\t\t\t\x3cinput type\x3d"text" id\x3d"search" autocomplete\x3d"off" class\x3d"layoutLeft spacingLeft searchbox" role\x3d"search" style\x3d"display:none;"\x3e\n\t\t\t\x3cdiv id\x3d"searchOptions" class\x3d"layoutLeft" style\x3d"padding-top:1px;display:none;"\x3e\x3c/div\x3e\n\n\t\t\t\x3c!-- User identity menu and Progress --\x3e\n\t\t\t\x3cdiv id\x3d"userMenu" class\x3d"spacingRight layoutRight" style\x3d"color:#ccc;line-height:16px;"\x3e\n\t\t\t\t\x3cdiv id\x3d"progressPane" class\x3d"progressWatch" tabindex\x3d"0" role\x3d"progressbar"\x3e\n\t\t\t\t\t\x3cdiv id\x3d"watchButton" class\x3d"watchButton"\x3e\x3c/div\x3e\n\t\t\t\t\t\x3cdiv id\x3d"watchBody" class\x3d"watchBody"\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"hand longMinute"\x3e\n\t\t\t\t\t\t\t\x3cspan class\x3d"darkSide"\x3e\x3c/span\x3e\n\t\t\t\t\t\t\x3c/span\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"hand longHour"\x3e\n\t\t\t\t\t\t\t\x3cspan class\x3d"darkSide"\x3e\x3c/span\x3e\n\t\t\t\t\t\t\x3c/span\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\x3c/div\x3e\n\t\t\t\t\n\t\t\t\t\x3cdiv style\x3d"position: absolute;right: 0px;top:0;width: 39px;height:36px; z-index:-50;border-left: 1px solid #ddd;"\x3e\x3c/div\x3e\n\t\t\t\t\x3cspan id\x3d"userTrigger" tabindex\x3d"0" role\x3d"button" class\x3d"dropdownTrigger" style\x3d"z-index:2;"\x3e\n\t\t\t\t\x3c/span\x3e\n\t\t\t\t\x3cul id\x3d"userDropdown" class\x3d"dropdownMenu" role\x3d"menu"\x3e\x3c/ul\x3e\n\t\t\t\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\x3c/div\x3e\n\n\t\x3c!-- IDE notification messages go in here --\x3e\n\t\x3cdiv id\x3d"notificationArea" class\x3d"notificationHide"\x3e\n\t\t\x3cdiv class\x3d"layoutLeft" id\x3d"notifications" aria-live\x3d"assertive" aria-atomic\x3d"true"\x3e\x3c/div\x3e\n\t\t\x3cdiv class\x3d"layoutRight"\x3e\x3cbutton aria-label\x3d"Close" class\x3d"dismissButton layoutRight core-sprite-close imageSprite" type\x3d"button" id\x3d"closeNotifications"\x3e\x3c/span\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\x3c/header\x3e'});
define("text!orion/banner/footer.html",[],function(){return'\x3c!--\n\x3cfooter id\x3d"footerContent" class\x3d"layoutBlock footerLayout" role\x3d"contentinfo"\x3e\n\t\x3cdiv class\x3d"logoFooter commandSprite core-sprite-orion-logo"\x3e\x3c/div\x3e\n\t\x3cdiv class\x3d"footerBlock"\x3e${Orion is in Beta. Please try it out but BEWARE your data may be lost.}\x3c/div\x3e\n\t\x3cdiv class\x3d"footerRightBlock"\x3e\n\t\t\x3cul\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"https://bugs.eclipse.org/bugs/enter_bug.cgi?product\x3dOrion\x26version\x3d5.0" target\x3d"_blank"\x3e${Report a Bug}\x3c/a\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/privacy.php" target\x3d"_blank"\x3e${Privacy Policy}\x3c/a\x3e\x3c/li\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/termsofuse.php" target\x3d"_blank"\x3e${Terms of Use}\x3c/a\x3e\x3c/li\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/copyright.php" target\x3d"_blank"\x3e${Copyright Agent}\x3c/a\x3e\x3c/li\x3e\n\t\t\x3c/ul\x3e\n\t\x3c/div\x3e\n\x3c/footer\x3e\n--\x3e'});
define("text!orion/banner/toolbar.html",[],function(){return'\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"pageActions"\x3e\x3c/ul\x3e\n\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"selectionTools"\x3e\x3c/ul\x3e\n\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"navActions"\x3e\x3c/ul\x3e\n\x3cdiv class\x3d"layoutLeft" style\x3d"padding-left:7px;padding-right:7px;margin-top:2px;" id\x3d"filterBox" style\x3d"visibility: hidden;"\x3e\x3c/div\x3e\n\x3cul class\x3d"layoutRight commandList pageActions" id\x3d"settingsActions"\x3e\x3c/ul\x3e\n\x3cdiv class\x3d"layoutRight status" id\x3d"statusPane" role\x3d"status" aria-live\x3d"off"\x3e\x3c/div\x3e\n\x3cul class\x3d"layoutRight commandList pageActions" id\x3d"pageNavigationActions"\x3e\x3c/ul\x3e'});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(l,n){function m(k,f,h){if(k=n.node(k))this._parent=k;else throw Error("Parent node of dropdown menu not found");this.options=h=h||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=h.selectionClass;k=document.createElement("div");k.classList.add("dropdownMenu");k.classList.add("dropdownMenuOpen");k.id=this.navDropDownId;k.style.display="none";this._parent.appendChild(k);this._dropdownMenu=
k;if(f=n.node(f))this._triggerNode=f;else throw"Trigger node of dropdown menu not found";"hidden"===this._triggerNode.style.visibility&&(this._triggerNode.style.visibility="visible");h.noClick||(this._triggerNode.onclick=this.click.bind(this));this._dropdownMenu.addEventListener("keydown",function(g){g.keyCode===n.KEY.ESCAPE&&this.clearPanel()}.bind(this))}l.mixin(m.prototype,{click:function(){"none"===this._dropdownMenu.style.display?this.updateContent(this.getContentNode(),function(){n.setFramesEnabled(!1);
this._dropdownMenu.style.display="";this._positionDropdown();this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=n.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",n.setFramesEnabled(!0),this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},
addContent:function(k){this._dropdownMenu.innerHTML=k},getContentNode:function(){return this._dropdownMenu},updateContent:function(k,f){f()},_positionDropdown:function(){this._dropdownMenu.style.right="";var k=n.bounds(this._dropdownMenu),f=n.bounds(document.body);k.left+k.width>f.left+f.width&&(k=n.bounds(this._boundingNode(this._triggerNode)),f=n.bounds(this._triggerNode),this._dropdownMenu.style.right=k.width-(f.left-k.left+f.width)+"px")},_boundingNode:function(k){var f=window.getComputedStyle(k,
null);return null===f||"absolute"===f.getPropertyValue("position")||!k.parentNode||k===document.body?k:this._boundingNode(k.parentNode)},isDestroyed:function(){return!this._dropdownMenu.parentNode},isVisible:function(){return"none"!==this._dropdownMenu.style.display&&!this.isDestroyed()},focus:function(){this._dropdownMenu.focus()},destroy:function(){this._parent&&(n.setFramesEnabled(!0),n.empty(this._parent),this._parent=this.select=null)}});return m});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize strings from JavaScript files in this folder.",
"Choose a Folder":"Choose a Folder","Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","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":"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":"File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"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",
"File or zip archive":"File or zip archive","Import a file or zip archive from your local file system":"Import a file or zip archive from your local file system","SFTP from...":"SFTP","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","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",Cut:"Cut",Copy:"Copy","Fetching children of ":"Fetching children of ",Paste:"Paste","Cannot paste into the Workspace root":"Cannot paste into the Workspace root",
"Open With":"Open With","Loading ":"Loading ",New:"New",File:"File",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...":"HTTP","File URL:":"File URL:","Import a file from a URL and optionally unzip it":"Import 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}?","Upload progress: ":"Upload progress: ","Uploading ":"Uploading ","Cancel upload":"Cancel upload","Uploading the following file failed: ":"Uploading the following file failed: ","Enter project name:":"Enter project name:","Creating project ":"Creating project ",NoFile:"Use the ${0} menu to create new files and folders. Click a file to start coding.",
Download:"Download",Download_tooltips:"Download the file contents as the displayed name","Downloading...":"Reading file contents...","Download not supported":"Contents download is not supported in this browser."});define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(l,n,m){function k(g,d,a){if(!g[d])throw d+l[" is not supported in this file system"];return g[d].apply(g,a)}function f(g,d,a,e){if(!g.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("/"!==d[d.length-1])return k(g,"readBlob",[d]).then(function(b){return k(a,"writeBlob",[e,b])});var b=e.substring(0,
e.length-1),p=decodeURIComponent(b.substring(b.lastIndexOf("/")+1)),b=b.substring(0,b.lastIndexOf("/")+1);return k(a,"createFolder",[b,p]).then(function(){},function(){}).then(function(){return k(g,"fetchChildren",[d]).then(function(b){for(var d=[],p=0;p<b.length;++p){var h=b[p].Location,k=h;b[p].Directory&&(k=h.substring(0,h.length-1));k=decodeURIComponent(k.substring(k.lastIndexOf("/")+1));k=e+encodeURIComponent(k);b[p].Directory&&(k+="/");d[p]=f(g,h,a,k)}return n.all(d)})})}function h(g,d){function a(a){var b=
new n;b.reject(l["No Matching FileService for location:"]+a);return b}var e=g.getServiceReferences("orion.core.file"),b=e;if(d)for(var b=[],f=0;f<e.length;++f)d(e[f])&&b.push(e[f]);for(var h=[],k=[],s=[],y=[],r={fetchChildren:function(){var a=new n;a.resolve(y);return a},createWorkspace:function(){var a=new n;a.reject(l["no file service"]);return a},loadWorkspaces:function(){var a=new n;a.reject(l["no file service"]);return a},loadWorkspace:function(a){var b=new n;window.setTimeout(function(){b.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:l["File Servers"],Location:"/",Children:y,ChildrenLocation:"/"})},100);return b},search:a,createProject:a,createFolder:a,createFile:a,deleteFile:a,moveFile:a,copyFile:a,read:a,write:a},e=0;e<b.length;++e)y[e]={Directory:!0,Length:0,LocalTimeStamp:0,Location:b[e].getProperty("top"),ChildrenLocation:b[e].getProperty("top"),Name:b[e].getProperty("Name")},f=b[e].getProperty("pattern")||b[e].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"^"!==f[0]&&(f=
"^"+f),h[e]=RegExp(f),k[e]=g.getService(b[e]),s[e]=b[e].getProperty("Name"),b[e].getProperty("NameKey")&&b[e].getProperty("nls")&&m.getMessageBundle(b[e].getProperty("nls")).then(function(a,e){y[a].Name=e[b[a].getProperty("NameKey")];s[a]=e[b[a].getProperty("NameKey")]}.bind(this,e));this._getServiceIndex=function(a){if("/"===a)return-1;if(!a||a.length&&0===a.length)return k[0]?0:-1;for(var b=0;b<h.length;++b)if(h[b].test(a))return b;throw l["No Matching FileService for location:"]+a;};this._getService=
function(a){a=this._getServiceIndex(a);return-1===a?r:k[a]};this._getServiceName=function(a){a=this._getServiceIndex(a);return-1===a?r.Name:s[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return-1===a?r.Location:y[a].Location}}h.prototype={getService:function(g){return this._getService(g)},fileServiceName:function(g){return this._getServiceName(g)},fileServiceRootURL:function(g){return this._getServiceRootURL(g)},fetchChildren:function(g){return k(this._getService(g),"fetchChildren",
arguments)},createWorkspace:function(g){return k(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return k(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(g){return k(this._getService(g),"loadWorkspace",arguments)},createProject:function(g,d,a,e){return k(this._getService(g),"createProject",arguments)},createFolder:function(g,d){return k(this._getService(g),"createFolder",arguments)},createFile:function(g,d){return k(this._getService(g),"createFile",
arguments)},deleteFile:function(g){return k(this._getService(g),"deleteFile",arguments)},moveFile:function(g,d,a){var e=this._getService(g),b=this._getService(d);if(e===b)return k(e,"moveFile",arguments);var p="/"===g[g.length-1],h=d;"/"!==h[h.length-1]&&(h+="/");if(a)h+=encodeURIComponent(a);else{var l=g;p&&(l=l.substring(0,l.length-1));h+=l.substring(l.lastIndexOf("/")+1)}p&&"/"!==h[h.length-1]&&(h+="/");return f(e,g,b,h).then(function(){return k(e,"deleteFile",[g])})},copyFile:function(g,d,a){var e=
this._getService(g),b=this._getService(d);if(e===b)return k(e,"copyFile",arguments);var p="/"===g[g.length-1],h=d;"/"!==h[h.length-1]&&(h+="/");if(a)h+=encodeURIComponent(a);else{var l=g;p&&(l=l.substring(0,l.length-1));h+=l.substring(l.lastIndexOf("/")+1)}p&&"/"!==h[h.length-1]&&(h+="/");return f(e,g,b,h)},read:function(g,d){return k(this._getService(g),"read",arguments)},readBlob:function(g){return k(this._getService(g),"readBlob",arguments)},write:function(g,d,a){return k(this._getService(g),"write",
arguments)},remoteImport:function(g,d){return k(this._getService(g),"remoteImport",arguments)},remoteExport:function(g,d){return k(this._getService(g),"remoteExport",arguments)},search:function(g){return k(this._getService(g.resource),"search",arguments)}};h.prototype.constructor=h;return{FileClient:h}});
define("orion/webui/SideMenu",["orion/webui/littlelib","orion/PageUtil","orion/URL-shim"],function(l,n){function m(h,g){this._parentNode=l.node(h);if(!this._parentNode)throw Error("Missing parentNode");this._contentNode=l.node(g);this._categoryInfos=[];this._categorizedPageLinks={};this._categorizedRelatedLinks={};this._categorizedAnchors=null;this._state=localStorage.getItem(k)||f;this._currentCategory="";this._renderTimeout=this._notificationTimeout=null}var k="sideMenuNavigation",f="open";m.prototype=
{constructor:m.prototype.constructor,setCategories:function(f){this._categoryInfos=f.getCategoryIDs().map(function(g){return f.getCategory(g)}).sort(function(g,d){var a=g.order||100,e=d.order||100;return a<e?-1:e<a?1:g.textContent.localeCompare(d.textContent)})},setPageLinks:function(f){this._categorizedPageLinks={};f.getAllLinks().forEach(function(g){var d=g.category;this._categorizedPageLinks[d]=this._categorizedPageLinks[d]||[];this._categorizedPageLinks[d].push({title:g.textContent,order:g.order||
100,href:g.href})},this)},setRelatedLinks:function(f,g){this._categorizedRelatedLinks={};f.forEach(function(d){var a=d.relatedLink,e=d.command;d=d.invocation;if(!g||-1===g.indexOf(a.id)){var b=a.category;this._categorizedRelatedLinks[b]=this._categorizedRelatedLinks[b]||[];this._categorizedRelatedLinks[b].push({title:e.name,order:a.order||100,href:e.hrefCallback.call(d.handler,d)})}},this);this._updateCategoryAnchors();this._updateCategoryNotifications()},render:function(){if(null===this._categorizedAnchors){this._categorizedAnchors=
{};var f=new URL(window.location.href);this._currentCategory=f.hash="";Object.keys(this._categorizedPageLinks).some(function(d){if(this._categorizedPageLinks[d].some(function(a){var e=new URL(a.href);a.hash="";return f.href===e.href}))return this._currentCategory=d,!0},this);var g=document.createElement("ul");g.classList.add("sideMenuList");this._categoryInfos.forEach(function(d){var a=document.createElement("li");a.classList.add("sideMenuItem");a.classList.add("sideMenu-notification");this._currentCategory===
d.id&&a.classList.add("sideMenuItemActive");a.categoryId=d.id;a.categoryName=d.textContent||d.id;var e=document.createElement("a");e.classList.add("submenu-trigger");if("string"===typeof d.imageDataURI&&0===d.imageDataURI.indexOf("data:image")){var b=document.createElement("img");b.width="16";b.height="16";b.src=d.imageDataURI;e.appendChild(b)}else e.classList.add(d.imageClass||"core-sprite-blank-menu-item");a.appendChild(e);g.appendChild(a);this._categorizedAnchors[d.id]=e},this);this._updateCategoryAnchors();
this._show=function(){this._parentNode.appendChild(g);this._show=m.prototype._show};window.setTimeout(function(){this._show()}.bind(this),1E3)}"closed"===this._state?(this._contentNode.style.left="0",this._renderTimeout&&(window.clearTimeout(this._renderTimeout),this._renderTimeout=null),this._renderTimeout=window.setTimeout(function(){this._parentNode.style.display="none";this._renderTimeout=null}.bind(this),301),this._parentNode.classList.add("animating")):(this._renderTimeout&&(window.clearTimeout(this._renderTimeout),
this._renderTimeout=null),this._parentNode.classList.remove("animating"),this._parentNode.style.display="block",this._parentNode.style.width="40px",this._contentNode.style.left="40px")},hide:function(){localStorage.setItem(k,"closed");this._contentNode.style.left="0"},toggle:function(){var h=this._contentNode;h&&h.classList.add("content-fixedHeight-animation");this._state="open"===this._state?"closed":"open";this._state===f?localStorage.removeItem(k):localStorage.setItem(k,this._state);this.render()},
_updateCategoryAnchors:function(){var f=[];Object.keys(this._categorizedRelatedLinks).forEach(function(g){("git"===g||g.match(/-scm$/))&&f.push(g)});Object.keys(this._categorizedAnchors).forEach(function(g){var d=this._categorizedAnchors[g],a=[];g===this._currentCategory?(d.parentElement.style.display="",d.href="",d.onclick=function(){return!1},d.title=d.parentElement.categoryName):(this._categorizedPageLinks[g]&&a.push.apply(a,this._categorizedPageLinks[g]),this._categorizedRelatedLinks[g]&&a.push.apply(a,
this._categorizedRelatedLinks[g]),0===a.length||0!==f.length&&("git"===g||g.match(/-scm$/))&&-1===f.indexOf(g)?(d.href="",d.title=d.parentElement.categoryName,d.parentElement.style.display="none"):(d.parentElement.style.display="",a.sort(function(a,b){return a.order<b.order?-1:b.order<a.order?1:a.title.localeCompare(b.title)}),g=a.shift(),d.href=g.href,d.title=g.title))},this);this._show()},_updateCategoryNotifications:function(){clearTimeout(this._notificationTimeout);this._notificationTimeout=setTimeout(this._updateCategoryNotifications.bind(this),
3E5);var f=n.matchResourceParameters().resource,g=(new URL(f,window.location.href)).href;this._categoryInfos.forEach(function(d){if(d.service&&d.service.getNotifications){var a=this._categorizedAnchors[d.id].parentElement;d.service.getNotifications(g).then(function(e){if(f===n.matchResourceParameters().resource){var b="";e.forEach(function(a){"info"===a.level&&!b?b="info":"warn"===a.level&&(!b||"info"===b)?b="warn":"error"===a.level&&"error"!==b&&(b="error")});b?a.setAttribute("level",b):a.removeAttribute("level")}},
function(a){window.console.log(a)})}},this)},_show:function(){}};return m});
define("orion/globalCommands","i18n!orion/nls/messages require orion/commonHTMLFragments orion/keyBinding orion/EventTarget 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/keyAssist 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/util orion/customGlobalCommands orion/fileClient orion/webui/SideMenu orion/objects".split(" "),function(l,
n,m,k,f,h,g,d,a,e,b,p,q,t,s,y,r,x,u,w,z,B,v,A,D,C,E,K,L,F,G,H,I,P,J){function V(a,b){if(a.getLabel)return a.getLabel();var e=new v;e.resolve(b.properties.name);return e}function U(a){q.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 S(a,b){var e=a.getServiceReferences("orion.core.auth");ca=[];var d=O.createMenuGenerator.apply(this,arguments);if(d)for(var g=0;g<
e.length;g++){var f=e[g],p=a.getService(f);V(p,f).then(function(a){p.getKey().then(function(b){ca.push(b);p.getUser().then(function(e){d.addUserItem(b,p,a,e)},function(e,g){d.addUserItem(b,p,a,g)});window.addEventListener("storage",function(e){M[b]!==localStorage.getItem(b)&&(M[b]=localStorage.getItem(b),p.getUser().then(function(e){d.addUserItem(b,p,a,e)},function(e){d.addUserItem(b,p,a)}))},!1)})})}}function W(a){return a}function T(b,e,d,f,p){function h(){if(t)return t;var a=b.getService("orion.core.contentTypeRegistry");
a||(a=new r.ContentTypeRegistry(b),a=b.getService("orion.core.contentTypeRegistry"));return a.getContentTypes().then(function(a){return t=a})}function k(a){for(var b={},e=a.getPropertyKeys(),d,g=0;g<e.length;g++)d=e[g],b[d]=a.getProperty(d);return b}function D(a,b){var e=null;a.some(function(a){return b===a.getProperty("id")?!!(e=a):!1});return e}function A(a){var b=a.command;return!b.visibleWhen||b.visibleWhen(e)?(a.invocation=new g.CommandInvocation(e,e,null,b,f),(new v).resolve(a)):"function"===
typeof p?(s||(s=p()),v.when(s,function(d){if(d&&e===$&&(!b.visibleWhen||b.visibleWhen(d)))return a.invocation=new g.CommandInvocation(d,d,null,b,f),a})):(new v).resolve()}function q(a,b,e){return e?(new v).resolve({relatedLink:a,command:e}):b.then(function(b){return{relatedLink:a,command:new g.Command(b)}})}var l=arguments,t,s,m=b&&b.getServiceReferences("orion.page.link.related");if(m&&0!==m.length){var C=this;v.when(h(),function(){if(O.beforeGenerateRelatedLinks.apply(C,l)){var e=b.getServiceReferences("orion.navigate.command"),
g=[];m.forEach(function(d){var p=k(d);if(p.id){var v;if((p.nls&&p.nameKey||p.name)&&p.uriTemplate)v=a._createCommandOptions(p,d,b,t,!0),g.push(q(p,v,null));else if(v=D(e,p.id)){var h=k(v);d={};J.mixin(d,h,p);(p=f.findCommand(p.id))?g.push(q(d,null,p)):(v=a._createCommandOptions(h,v,b,t,!0),g.push(q(d,v,null)))}}});v.all(g,W).then(function(a){a.sort(function(a,b){return a.command.name.localeCompare(b.command.name)});return v.all(a.map(A),W).then(function(b){var e=[];b=b.filter(function(b,d){if(b)return!0;
e.push(a[d]);return!1});O.addRelatedLinkCommands.call(C,f,b,e,d);O.afterGenerateRelatedLinks.apply(C,l)})})}})}}function ba(a){var b=q.node("globalActions");b&&(a.destroy(b),a.renderCommands(b.id,b,{},{},"tool"))}function X(a){var b=window.getComputedStyle(a,null);return null===b||"absolute"===b.getPropertyValue("position")||!a.parentNode||a===document.body?a:X(a.parentNode)}function Q(a){var b={},e=null;"string"===typeof a&&(a=q.node(a));a||(a=q.node("pageActions"));for(var d=a;d&&d.classList;){if(d.classList.contains("toolComposite")){e=
d;break}d=d.parentNode}a.classList.contains("commandMarker")&&(b.commandNode=a);e||(e=q.node("pageToolbar"));e&&(b.slideContainer=q.$(".slideParameters",e),b.parameterArea=q.$(".parameters",e),b.dismissArea=q.$(".parametersDismiss",e),b.notifications=q.$("#notificationArea",e),e.parentNode&&(b.toolbarTarget=q.$(".toolbarTarget",e.parentNode),b.toolbarTarget&&(a=q.bounds(b.toolbarTarget),d=q.bounds(X(b.toolbarTarget.parentNode)),b.toolbarTargetY=a.top-d.top,b.toolbar=e)));return b}function N(a){if(a=
a.slideContainer)if(a.style.left="",a.style.top="",a.classList.contains("slideContainerActive")){var b=q.bounds(a),e=q.bounds(a.parentNode);a.style.left=(e.width-b.width)/2+"px";a.style.top="0"}}h=function(a){var b=document.createElement("a");b.href=a;return b.href}(n.toUrl("auth/NotifyAuthentication.html"));var M={},O={createMenuGenerator:H.createMenuGenerator||function(a,b){if(q.node("userMenu")){var e=q.node("userDropdown"),d=new s.Dropdown({dropdown:e}),e=new A.UserMenu({dropdownNode:e,dropdown:d,
serviceRegistry:a}),d=q.node("userTrigger");new y.Tooltip({node:d,text:l.Options,position:["below","left"]});var d=document.getElementById("userTrigger"),g=d.className;d.className=g+" imageSprite core-sprite-silhouette";e.setKeyAssist(b);return e}},beforeGenerateRelatedLinks:H.beforeGenerateRelatedLinks||function(a,b,e,d,g){return!0},addRelatedLinkCommands:H.addRelatedLinkCommands||function(a,b,e,d){this.sideMenu&&this.sideMenu.setRelatedLinks(b,d)},afterGenerateRelatedLinks:H.afterGenerateRelatedLinks||
function(a,b,e,d,g){},afterSetPageTarget:H.afterSetPageTarget||function(a){},generateNavigationMenu:H.generateNavigationMenu||function(a,b,e,d,g,f,p){if(a=q.node("sideMenu"))b=q.node("centralNavigation"),new y.Tooltip({node:b,text:l.CentralNavTooltip,position:["right"]}),this.sideMenu=new P(a,q.node("pageContent")),b.addEventListener("click",this.sideMenu.toggle.bind(this.sideMenu)),(a=q.node("sideMenuToggle"))&&a.addEventListener("click",this.sideMenu.toggle.bind(this.sideMenu))},afterGenerateNavigationMenu:H.afterGenerateNavigationMenu||
function(a,b,e,d,g,f,p){},afterGenerateBanner:H.afterGenerateBanner||function(a,b,e,d,g,f,p){}},ca=[],$,Y=[],R,aa=null,Z=null,da=new f;return{generateBanner:function(a,b,e,f,p,h,A,s){function y(a){a.registerService("orion.cm.managedservice",{updated:function(a){a=a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?"_blank":"_self":"_self";for(var b=q.$$array(".targetSelector"),e=0;e<b.length;e++)b[e].target=a}},{pid:"nav.config"})}(new z.ThemePreferences(f,new B.ThemeData)).apply();var r=q.node(a);
if(!r)throw l["could not find banner parent, id was "]+a;var w=document.createRange();w.selectNode(r);w=w.createContextualFragment(E);q.processTextNodes(w,l);r.firstChild?r.insertBefore(w,r.firstChild):r.appendChild(w);r=q.node("home");r.href=n.toUrl("edit/edit.html");r.setAttribute("aria-label",l["Orion Home"]);q.node("progressPane").src=g.NO_IMAGE;if(r=q.node("pageToolbar"))r.classList.add("toolbarLayout"),r.innerHTML=L+m.slideoutHTMLFragment("mainToolbar");(r=q.node("closeNotifications"))&&r.setAttribute("aria-label",
l["Close notification"]);if(17>=G.isFirefox&&(r=q.node("staticBanner")))r.style.width="100%",r.style.MozBoxSizing="border-box";if(r=q.node("footer"))r.innerHTML=K,q.processTextNodes(r,l);e.setParameterCollector(new d.CommandParameterCollector(Q,N));document.addEventListener("keydown",function(a){a.keyCode===q.KEY.ESCAPE&&(a=b.getService("orion.page.message"))&&a.setProgressMessage("")},!1);O.generateNavigationMenu.apply(this,arguments);O.afterGenerateNavigationMenu.apply(this,arguments);r=D.getCategoriesInfo(b);
w=D.getPageLinksInfo(b,"orion.page.link");v.all([r,w]).then(function(a){if(this.sideMenu){var b=a[1];this.sideMenu.setCategories(a[0]);this.sideMenu.setPageLinks(b);this.sideMenu.render()}}.bind(this));if(r=q.$(".split")){var w=q.$(".sidePanelLayout"),x=q.$(".mainPanelLayout");w&&x&&(aa={side:w,main:x},aa.splitter=new t.Splitter({node:r,sidePanel:w,mainPanel:x,toggle:!0,closeByDefault:s}),r=new g.Command({name:l["Toggle side panel"],tooltip:l["Open or close the side panel"],id:"orion.toggleSidePane",
callback:function(){aa.splitter.toggleSidePanel()}}),e.addCommand(r),e.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new k.KeyBinding("l",G.isMac?!1:!0,!0,!1,G.isMac?!0:!1)))}var F=!1,H=function(a,b){if(!F){var e=b.getService("orion.page.progress"),d=new C.OpenResourceDialog({searcher:a,progress:e,searchRenderer:a.defaultRenderer,onHide:function(){F=!1}});window.setTimeout(function(){F=!0;d.show()},0)}},r=new g.Command({name:l["Find File Named..."],tooltip:l["Choose a file by name and open an editor on it"],
id:"orion.openResource",callback:function(a){H(p,b)}});e.addCommand(r);e.registerCommandContribution("globalActions","orion.openResource",100,null,!0,new k.KeyBinding("f",!0,!0));var P=!1,r=function(){if(P)return!1;var a=q.node("banner"),b=q.node("footer"),e=q.node("sideMenu"),d=q.$(".content-fixedHeight"),g="hidden"===a.style.visibility;g?(a.style.visibility="visible",b.style.visibility="visible",d.classList.remove("content-fixedHeight-maximized"),e&&e.classList.remove("sideMenu-maximized")):(a.style.visibility=
"hidden",b.style.visibility="hidden",d.classList.add("content-fixedHeight-maximized"),e&&e.classList.add("sideMenu-maximized"));da.dispatchEvent({type:"toggleTrim",maximized:!g});return!0};window.orionNoTrim?(r(),P=!0,this.sideMenu.hide()):(r=new g.Command({name:l["Toggle banner and footer"],tooltip:l["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:r}),e.addCommand(r),e.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new k.KeyBinding("m",!0,!0)));
r=new g.Command({name:l["System Configuration Details"],tooltip:l["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return n.toUrl("help/about.html")}});e.addCommand(r);e.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new k.KeyBinding(112,!0,!0));r=new g.Command({name:l["Background Operations"],tooltip:l["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return n.toUrl("operations/list.html")}});e.addCommand(r);
e.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new k.KeyBinding("o",!0,!0));Z=new u.KeyAssistPanel({commandRegistry:e});r=new g.Command({name:l["Show Keys"],tooltip:l["Show a list of all the keybindings on this page"],id:"orion.keyAssist",callback:function(){Z.isVisible()?Z.hide():Z.show();return!0}});e.addCommand(r);e.registerCommandContribution("globalActions","orion.keyAssist",100,null,!0,new k.KeyBinding(191,!1,!0));ba(e);S(b,r.callback);U(b);window.addEventListener("hashchange",
function(){e.processURL(window.location.href)},!1);window.setTimeout(function(){y(b)},0);O.afterGenerateBanner.apply(this,arguments)},getToolbarElements:Q,getMainSplitter:function(){return aa},getKeyAssist:function(){return Z},getGlobalEventTarget:function(){return da},layoutToolbarElements:N,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&&!a.staticBreadcrumb)&&
(e=(d?d+" ":"")+a.fileService.fileServiceName(a.target.Location),d=null),b=a.name||a.target.Name,$=a.target,T.call(this,g,a.target,Y,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(d=d||a.task||a.name),b=a.name,T.call(this,g,{NoTarget:""},Y,a.commandService,a.makeAlternate));(R=a.title)||(R=b?b+" - "+a.task:a.task);window.document.title=R;O.afterSetPageTarget.apply(this,arguments);if(b=a.breadCrumbContainer?q.node(a.breadCrumbContainer):q.node("location"))if(q.empty(b),a.staticBreadcrumb)new p.BreadCrumbs({container:b,
rootSegmentName:d});else{var f=g&&new I.FileClient(g),g=a.breadcrumbTarget||a.target,f=f&&g&&g.Location?f.fileServiceRootURL(g.Location):null;new p.BreadCrumbs({container:b,resource:g,rootSegmentName:d,workspaceRootSegmentName:e,workspaceRootURL:f,makeFinalHref:a.makeBreadcrumFinalLink,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){R&&("*"===R.charAt(0)&&!a&&(R=R.substring(1)),a&&"*"!==R.charAt(0)&&(R="*"+R),window.document.title=R);var b=q.node("dirty");b&&(b.textContent=a?"*":"")},
setPageCommandExclusions:function(a){Y=a},notifyAuthenticationSite:h}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(l){return{detectValidURL:function(n){for(var m=/\[([^\]]*)\]\(([^\)]+)\)/g,k=m.exec(n),f=[],h=0;k;){if(3===k.length&&0<k[2].length){var g=new URL(k[2]);":"!==g.protocol&&l.validateURLScheme(g.href)&&(k.index>h&&f.push({segmentStr:n.substring(h,k.index)}),f.push({segmentStr:0<k[1].length?k[1]:k[2],urlStr:k[2]}),h=k.index+k[0].length)}k=m.exec(n)}if(0===h)return null;h<n.length&&f.push({segmentStr:n.substring(h)});return f},processURLSegments:function(l,
m){m.forEach(function(k){if(k.urlStr){var f=document.createElement("a");f.href=k.urlStr;f.appendChild(document.createTextNode(k.segmentStr))}else f=document.createElement("span"),f.textContent=k.segmentStr;l.appendChild(f)})}}});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(l,n,m,k){function f(g,d,a,e,b){this._serviceRegistry=g;this._serviceRegistration=g.registerService("orion.page.message",this);this._operationsClient=d;this.notificationContainerDomId=b;this.domId=a;this.progressDomId=e||a;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var h;f.prototype={_init:function(){var g=n.node("closeNotifications");if(g&&
!this._hookedClose){g.style.cursor="pointer";this._hookedClose=!0;var d=n.node(this.notificationContainerDomId);n.addAutoDismiss([d],function(){this._clickToDisMiss&&this.close()}.bind(this));g.addEventListener("click",function(){this.close()}.bind(this));d.addEventListener("click",function(a){a&&a.target&&"a"===a.target.nodeName.toLowerCase()&&(a=n.$$("a",d))&&(a.length&&1===a.length)&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);var g=n.node("closeNotifications");
this._cancelMsg&&this._cancelFunc&&g?(g.innerHTML="",g.classList.remove("cancelButton"),g.classList.add("dismissButton"),g.classList.add("core-sprite-close"),g.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null):this.setProgressMessage("")},_getNotifierElements:function(){this._notifierElements||(this._notifierElements=m.getToolbarElements(this.notificationContainerDomId));return this._notifierElements},setMessage:function(g,d,a){this._init();this.currentMessage=g;var e=n.node(this.domId);
if("boolean"===typeof a){var b=e.getAttribute("aria-live");e.setAttribute("aria-live",a?"polite":"off");window.setTimeout(function(){g===this.currentMessage&&(n.empty(e),e.appendChild(document.createTextNode(g)),window.setTimeout(function(){e.setAttribute("aria-live",b)},100))}.bind(this),100)}else n.empty(e),e.appendChild(document.createTextNode(g));"number"===typeof d&&window.setTimeout(function(){g===this.currentMessage&&(n.empty(e),e.appendChild(document.createTextNode("")))}.bind(this),d)},setErrorMessage:function(g){this._clickToDisMiss=
!0;this.currentMessage=g;this._init();var d=g.responseText||g.message||g;if("string"===typeof d)try{d=JSON.parse(d)}catch(a){}g=d.Message||d;var 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(g));g=n.node(this.domId);n.empty(g);g.appendChild(d)},setProgressMessage:function(g){this._clickToDisMiss=!1;this._init();this.currentMessage=
g;var d=document.createElement("span");d.classList.add("progressIcon");var a=n.node(this.progressDomId);n.empty(a);a.appendChild(d);a.appendChild(document.createTextNode(g));d=n.node(this.notificationContainerDomId);d.classList.remove("notificationHide");if(g&&0<g.length)d.classList.add("progressNormal"),d.classList.add("notificationShow");else{if(this._progressMonitors&&0<this._progressMonitors.length)return this._renderOngoingMonitors();d.classList.remove("notificationShow");d.classList.add("notificationHide")}},
setCancelFunction:function(g){this._cancelFunc=g},setProgressResult:function(g,d){this._clickToDisMiss=!1;this._cancelMsg=d;this.currentMessage=g;var a=g.responseText||g;if("string"===typeof a)try{a=JSON.parse(a)}catch(e){}this._init();var b=a.Message||a.toString(),f=l.UnknownError,h="core-sprite-information",t="progressNormal",s=document.createElement("span");s.classList.add("imageSprite");s.classList.add("progressIcon");var m=[];if(a.Severity)switch(a.Severity){case "Warning":f=l.UnknownWarning;
h="core-sprite-warning";t="progressWarning";m.push("progressInfo");m.push("progressError");m.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":h="core-sprite-error";t="progressError";m.push("progressWarning");m.push("progressInfo");m.push("progressNormal");this._clickToDisMiss=!0;break;default:t="progressNormal",m.push("progressWarning"),m.push("progressError"),m.push("progressNormal")}m.push("notificationHide");s.classList.add(h);var r=n.node(this.progressDomId),h=n.node(this.notificationContainerDomId);
n.empty(r);r.appendChild(s);b===Object.prototype.toString()&&(b=f);a.HTML?(a=document.createElement("span"),a.innerHTML=b,r.appendChild(a)):((f=k.detectValidURL(b))?(b=document.createDocumentFragment(),k.processURLSegments(b,f),Array.prototype.forEach.call(n.$$("a",b),function(a){a.target="_blank"})):("Warning"!==a.Severity&&("Error"!==a.Severity&&!d)&&(this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3)),
b=document.createTextNode(b)),r.appendChild(b));if(t&&this.progressDomId!==this.domId){h.classList.add(t);for(t=0;t<m.length;t++)h.classList.remove(m[t])}h.classList.add("notificationShow");if(m=n.node("closeNotifications"))this._cancelMsg?(m.classList.add("cancelButton"),m.classList.remove("dismissButton"),m.classList.remove("core-sprite-close"),m.classList.remove("imageSprite"),m.innerHTML=this._cancelMsg):(m.innerHTML="",m.classList.remove("cancelButton"),m.classList.add("dismissButton"),m.classList.add("core-sprite-close"),
m.classList.add("imageSprite"))},showWhile:function(g,d){var a=this;if(d){a.setProgressMessage(d);var e=function(){d===a.currentMessage&&a.setProgressMessage("")};g.then(e,e)}return g},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(g,d){return new h(this,++this._lastProgressId,g,d)},_renderOngoingMonitors:function(){if(0<this._progressMonitors.length){var g="",d=!0,a;for(a in this._progressMonitors)this._progressMonitors[a].status&&(d||(g+=", "),g+=this._progressMonitors[a].status,
d=!1);this.setProgressMessage(g)}else this.setProgressMessage("")},_beginProgressMonitor:function(g){this._progressMonitors[g.progressId]=g;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(g){this._progressMonitors[g.progressId]=g;this._renderOngoingMonitors()},_doneProgressMonitor:function(g){delete this._progressMonitors[g.progressId];this._progressMonitors.length--;g.status?this.setProgressResult(g.status):this._renderOngoingMonitors()}};f.prototype.constructor=
f;h=function(g,d,a,e){this.statusService=g;this.progressId=d;if(a){this.deferred=a;this.begin(e);var b=this;a.then(function(a,e){b.done.bind(b)()},function(a,e){b.done.bind(b)()})}};h.prototype.begin=function(g){this.status=g;this.statusService._beginProgressMonitor(this)};h.prototype.done=function(g){this.status=g;this.statusService._doneProgressMonitor(this)};h.prototype.worked=function(g){this.status=g;this.statusService._workedProgressMonitor(this)};h.prototype.constructor=h;return{StatusReportingService:f,
ProgressMonitor:h}});
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,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(l,n,m,k){function f(){}f.prototype={_initialize:function(f,g,d,a,e){this._tooltip=new k.Tooltip({node:f,hideDelay:e||0,afterShowing:this._afterShowingFunction(g).bind(this),afterHiding:d,trigger:a?a:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";f=document.createRange();f.selectNode(this.$parent);f=f.createContextualFragment(this.TEMPLATE);
this.messages&&m.processTextNodes(f,l);this.$parent.appendChild(f);var b=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===m.KEY.ESCAPE&&b.hide()},!1);this._bindElements(this.$parent);"function"===typeof this._bindToDom&&this._bindToDom(this.$parent)},_bindElements:function(f){for(var g=0;g<f.childNodes.length;g++){var d=f.childNodes[g];d.id&&(this["$"+d.id]=d);this._bindElements(d)}},_afterShowingFunction:function(f){return function(){f&&f.bind(this)();if(!this.customFocus){var g=
m.firstTabbable(this.$parent);g&&g.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};f.prototype.constructor=f;return{PopupDialog:f}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(l,n,m,k){var f={};(function(){var h=!1;f.updateNavTools=function(g,d,a,e,b,f){var k=m.node(e);if(k)d.destroy(k);else throw l["could not find toolbar "]+e;d.renderCommands(e,k,f,a,"button");if(b&&(e=m.node(b)))d.destroy(e),d.renderCommands(b,e,null,a,"button");h||(h=!0,g.getService("orion.page.selection").addEventListener("selectionChanged",function(e){var g=m.node(b);
g&&(d.destroy(g),d.renderCommands(b,g,e.selections,a,"button"))}))};f.createOperationsCommands=function(g,d,a){function e(a){return!a.operation||!a.operation.type?!1:"loadstart"===a.operation.type||"progress"===a.operation.type}var b=new k.Command({name:l["Remove Completed"],tooltip:l["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(b){a.removeCompletedOperations().then(function(a){d.loadOperations.bind(d)()})},visibleWhen:function(a){return!0}});g.addCommand(b);
b=new k.Command({name:l.Remove,tooltip:l["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(b){b=Array.isArray(b.items)?b.items:[b.items];for(var e=0;e<b.length;e++){var g=b[e];a.removeOperation.bind(a)(g.Location).then(function(){d.loadOperations.bind(d)()},function(){d.loadOperations.bind(d)()})}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return!e(a);for(var b in a)if(e(a[b]))return!1;return!0}});g.addCommand(b);
b=new k.Command({name:l.Cancel,tooltip:l["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){a=Array.isArray(a.items)?a.items:[a.items];for(var b=0;b<a.length;b++){var e=a[b];e.deferred&&e.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)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}});g.addCommand(b)}})();
return f});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(l,n,m,k,f){function h(g){this._options=g}h.prototype=new k.PopupDialog;h.prototype.TEMPLATE='\x3ctable style\x3d"width: 360px;"\x3e\x3ctr\x3e\x3ctd\x3e\x3ch2\x3eRecent operations\x3c/h2\x3e\x3c/td\x3e\x3ctd style\x3d"text-align: right;"\x3e\x3ca id\x3d"allOperationsLink" class\x3d"navlinkonpage"\x3eAll Operations\x3c/a\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3cdiv id\x3d"operationsExist"\x3e\x3cdiv style\x3d"padding-left: 7px" id\x3d"myOperationsListEmpty"\x3eNo operations running on this page.\x3c/div\x3e\x3ctable id\x3d"myOperationsList" style\x3d"display: none;"\x3e\x3c/table\x3e\x3c/div\x3e\x3cdiv style\x3d"padding-left: 7px" id\x3d"operationsDontExist"\x3eNo operations running.\x3c/div\x3e';h.prototype._init=
function(g){this._myOperations=[];this._operationsDeferreds=[];this._commandService=g.commandRegistry;f.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(g.triggerNode)};h.prototype._bindToDom=function(g){this.$allOperationsLink.href=n.toUrl("operations/list.html");this._setOperationsVisibility()};h.prototype.setOperations=function(g,d){this._myOperations||this._init(this._options);
this._myOperations=[];this._operationsDeferreds=[];if(g)for(var a in g)this._myOperations.push(g[a]),this._operationsDeferreds.push(d[a]);this._renderOperations()};h.prototype.parseProgressResult=function(g){if(!g)return{};g=g.responseText||g;try{g=JSON.parse(g)}catch(d){}var a={Message:g.Message||g,Severity:g.Severity};g.DetailedMessage&&g.DetailedMessage!==a.Message&&(a.DetailedMessage=g.DetailedMessage);return a};h.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,
this._myOperations,this._operationsDeferreds)};h.prototype._renderOperationsTable=function(g,d,a){m.empty(g);for(var e=0;e<d.length;e++){var b=d[e],f=document.createElement("tr"),h=document.createElement("td");h.style.paddingLeft="5px";h.style.paddingRight="5px";h.textContent=b.Name;f.appendChild(h);var k=document.createElement("div");h.appendChild(k);h=document.createElement("span");h.style.paddingRight="5px";h.classList.add("imageSprite");switch(b.type){case "Warning":h.classList.add("core-sprite-warning");
h.setAttribute("aria-label",l["Operation resulted in a warning."]);break;case "error":h.classList.add("core-sprite-error");h.setAttribute("aria-label",l["Operation resulted in an error."]);break;case "loadstart":case "progress":h.classList.add("core-sprite-start");h.setAttribute("aria-label",l["Operation is running."]);break;case "abort":h.classList.add("core-sprite-stop");h.setAttribute("aria-label",l["Operation is canceled."]);break;case "load":case "loadend":h.classList.add("core-sprite-ok"),h.setAttribute("aria-label",
"Operation ok.")}k.appendChild(h);h=document.createElement("span");h.classList.add("operationStatus");h.textContent=b.Name;k.appendChild(h);if(b.error){var s=b.error.Message||b.error;b.error.DetailedMessage&&""!==b.error.DetailedMessage&&(s+=": "+b.error.DetailedMessage);h.textContent=s;h.classList.remove("operationStatus");h.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",k,{operation:b,deferred:a[e]},this,"tool");g.appendChild(f)}this._setOperationsVisibility()};
h.prototype._setOperationsVisibility=function(){this.$myOperationsList.style.display=0<this._myOperations.length?"":"none";this.$myOperationsListEmpty.style.display=0<this._myOperations.length?"none":"";this.$operationsDontExist.style.display=0<this._myOperations.length?"none":"";this.$operationsExist.style.display=0<this._myOperations.length?"":"none"};h.prototype.constructor=h;return{OperationsDialog:h}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(l,n,m,k,f){function h(d,a){if(!this._progressPane){this._progressPane=k.node(d);this._operationsDialog=new f.OperationsDialog({triggerNode:this._progressPane,commandRegistry:a});var e=this;this._progressPane.addEventListener("keydown",function(a){(" "===a.charOrCode||a.keyCode===k.KEY.ENTER)&&e._operationsDialog.show()});this._progressPane.addEventListener("click",
function(a){e._operationsDialog.show()});this._operationsDialog.setOperations(null,null)}}function g(d,a,e,b){this._serviceRegistry=d;this._serviceRegistration=d.registerService("orion.page.progress",this);this._commandRegistry=e;this._operationsClient=a;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=b}h.prototype={_switchIconTo:function(d){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);
this._lastIconClass=d;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(d,a){var e={},b;for(b in d)d[b].progressMonitor||(e[b]=d[b]);if(this._isEmpty(e))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 g="";for(b in e){var f=e[b];if(f.type&&("loadstart"===f.type||"progress"===f.type)){g=
"running";break}}""===g&&null!=this._lastOperation&&this._lastOperation.type&&"error"===this._lastOperation.type&&"error"==g;switch(g){case "running":this._progressPane.title=l["Operations running"];this._progressPane.alt=l["Operations running"];this._progressPane.setAttribute("aria-valuetext",l["Operations running"]);this._switchIconTo("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("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("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_empty")}}this._operationsDialog.setOperations(e,a)},_isEmpty:function(d){for(var a in d)return!1;return!0}};h.prototype.constructor=h;g.prototype={init:function(d){this._progressMonitorClass||(this._progressMonitorTool=new h(d,this._commandRegistry))},progress:function(d,a,e){var b=this,g=this._operationsIndex++;!e&&this._progressMonitorClass&&(e=new this._progressMonitorClass,e.begin(a));d.then(function(f){b._operations[g]&&
(f=b._operations[g],a&&(f.Name=a),b._lastOperation=f,f.type="loadend",e&&(f.progressMonitor=e),b.writeOperation.bind(b)(g,f,d),f.Location||b._removeOperationFromTheList.bind(b)(g))},function(f){if(b._operations[g]){var h=b._operations[g];a&&(h.Name=a);e&&(h.progressMonitor=e);b._lastOperation=h;h.type=f.canceled?"abort":"error";h.error=f;b.writeOperation.bind(b)(g,h,d);h.Location||b._removeOperationFromTheList.bind(b)(g)}},function(f){a&&(f.Name=a);e&&(f.progressMonitor=e);b.writeOperation.bind(b)(g,
f,d)});return d},removeOperation:function(d){for(var a in this._operations)if(this._operations[a].Location&&this._operations[a].Location===d){this._removeOperationFromTheList(a);break}this._operationsClient.removeOperation.bind(this._operationsClient)(d)},_removeOperationFromTheList:function(d){var a=this._operations[d].progressMonitor;delete this._operations[d];delete this._operationDeferrds[d];a?a.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},
removeCompletedOperations:function(){for(var d in this._operations){var a=this._operations[d];a.type&&("loadstart"!==a.type&&"progress"!==a.type)&&((a=this._operations[d].progressMonitor)&&a.done(),delete this._operations[d],delete this._operationDeferrds[d])}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(d){this._serviceRegistry.getService("orion.page.message").setProgressResult(d)},showWhile:function(d,a,e){a&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(a);
var b=this;d.then(function(a){b._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){e?b._serviceRegistry.getService("orion.page.message").setProgressMessage(""):b.setProgressResult.bind(b)(a);return a});return this.progress(d,a)},writeOperation:function(d,a,e){this._operations[d]=a;this._operationDeferrds[d]=e;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)}};g.prototype.constructor=g;return{ProgressService:g}});define("orion/dialogs",[],function(){function l(l){this._serviceRegistry=l;this._serviceRegistration=l.registerService("orion.page.dialog",this)}l.prototype={confirm:function(l,m){m(window.confirm(l))},openFiles:function(l){}};l.prototype.constructor=l;return{DialogService:l}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(l,n){function m(k,f){f||(f="orion.page.selection");this._serviceRegistry=k;l.attach(this);this._serviceRegistration=k.registerService(f,this);this._selections=null}m.prototype={getSelection:function(k){var f=this._getSingleSelection();"function"===typeof k&&k(f);return f},getSelections:function(k){var f=Array.isArray(this._selections)?this._selections.slice():[];"function"===typeof k&&k(f);return f},_getSingleSelection:function(){return this._selections&&
0<this._selections.length?this._selections[0]:null},setSelections:function(k){var f=this._selections;Array.isArray(k)?this._selections=0<k.length?k.slice():null:this._selections=k?[k]:null;f!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};m.prototype.constructor=m;return{Selection:m}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(l,n){function m(g,d,a){return g[d].apply(g,a)}function k(g){this._location=g}function f(){var g=new n;g.reject(l["No Matching OperationService for location:"]+this._location);return g}function h(g){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=g.getService("orion.core.preference");for(var d=g.getServiceReferences("orion.core.operation"),
a=0;a<d.length;a++){var e=g.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 e=0;e<this._patterns.length;++e)if(this._patterns[e].test(a))return this._services[e];this._operations.remove(a);return new k(a)}}k.prototype={getOperation:f,getOperations:f,removeCompletedOperations:f,removeOperation:f,cancelOperation:f};k.prototype.constructor=k;h.prototype={getOperations:function(){var g=
new n;if(this._operations)return g.resolve(this._operations),g;var d=this;this._preferenceService.getPreferences("/operations").then(function(a){d._operations=a;g.resolve(d._operations)});return g},getOperation:function(g){return m(this._getService(g),"getOperation",arguments)},removeCompletedOperations:function(){for(var g=[],d=this,a=0;a<this._services.length;a++){var e=this._patterns[a],b=new n;g[a]=b.promise;m(this._services[a],"removeCompletedOperations").then(function(a){return function(b){Array.isArray(b)&&
d.getOperations.bind(d)().then(function(d){for(var g=d.keys(),f=0;f<g.length;f++){var h=g[f];e.test(h)&&0>b.indexOf(h)&&d.remove(h)}a.resolve()})}}(b),function(a){return function(b){a.reject(b)}}(b))}return n.all(g)},removeOperation:function(g){var d=this;return m(this._getService(g),"removeOperation",arguments).then(function(a){d.getOperations.bind(d)().then(function(a){a.remove(g)})},function(a){return a},function(a){return a})}};h.prototype.constructor=h;return{OperationsClient:h}});
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",Next:"Next",Previous:"Previous",Replace:"Replace","Replace...":"Replace...",
"Replace All":"Replace All","Show Replace":"Show Replace","Hide Replace":"Hide Replace","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","\x3c Previous Page":"\x3c Previous Page","Show previous page of search result":"Show previous page of search result","Next Page \x3e":"Next Page \x3e","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","Save frequently used searches by clicking on the ${0} button above.":"Save frequently used searches by clicking on the ${0} button above.",
Search:"Search","All types":"All types","File type":"File type","All ${0} files":"All ${0} files","${0} is already saved":"${0} is already saved","Type a search term":"Type a search term","Type a replace term":"Type a replace term","Case sensitive":"Case sensitive","File name":"File name","Path name":"Path name",Save:"Save","Type filter text":"Type filter text","Scope Search":"Scoped Search","Open in Search page for this directory":"Open the Search page for this folder.","${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 \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.":"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 \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.",
"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 \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.":"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 \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.",Scope:"Scope","Show previous search terms":"Show previous search terms","Show previous replace terms":"Show previous replace terms","Show replacement preview":"Show replacement preview",
"File name patterns (comma-separated)":"File name patterns (comma-separated)","(* \x3d any string, ? \x3d any character)":"(* \x3d any string, ? \x3d any character)","Choose a Folder":"Choose a Folder"});define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(l,n){function m(k){this._init(k)}m.prototype={_init:function(k){var f=k.parent,h=this,f=n.node(f);if(!f)throw l["no parent"];if(!k.model)throw l["no tree model"];if(!k.renderer)throw l["no renderer"];this._parent=f;this._treeModel=k.model;this._onComplete=k.onComplete;this._renderer=k.renderer;this._showRoot=void 0===k.showRoot?!1:k.showRoot;this._indent=void 0===k.indent?16:k.indent;this._onCollapse=k.onCollapse;
this._labelColumnIndex=void 0===k.labelColumnIndex?0:k.labelColumnIndex;this._id=void 0===k.id?"treetable":k.id;this._tableStyle=k.tableStyle;this._tableElement=k.tableElement||"table";this._tableBodyElement=k.tableBodyElement||"tbody";this._tableRowElement=k.tableRowElement||"tr";this._treeModel.getRoot(function(g){h._root=g;h._showRoot?(g._depth=0,h._generate([g],0)):h._treeModel.getChildren(g,function(d){h.destroyed||h._generate(d,0)})})},destroy:function(){this.destroyed=!0},_generate:function(k,
f){n.empty(this._parent);var h=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(h);var g=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(g);g.id=this._id;this._tableStyle&&g.classList.add(this._tableStyle);this._renderer.initTable(g,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+
"tbody";0===k.length?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(k,f);g.appendChild(this._bodyElement);h.appendChild(g);this._parent.appendChild(h);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(k,f,h){for(var g=0;g<k.length;g++){var d=document.createElement(this._tableRowElement);d.id=this._treeModel.getId(k[g]);d._depth=f;d._item=k[g];this._renderer.render(k[g],d);var a=this._indent*f;d.childNodes[Math.min(d.childNodes.length-
1,this._labelColumnIndex)].style.paddingLeft=a+"px";this._renderer.rowCallback&&this._renderer.rowCallback(d,k[g]);h?(this._bodyElement.insertBefore(d,h.nextSibling),h&&(h=d)):this._bodyElement.appendChild(d)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(k,f,h){var g=this._treeModel.getId(k),d;if(g===this._id)this._removeChildRows(g),this._generateChildren(f,0),this._rowsChanged();else if(g===
this._treeModel.getId(this._root)&&k.removeAll)this._removeAllRows(),this._generateChildren(f,0),this._rowsChanged();else{var a=n.node(g);a?(a._item=k,a&&(h||a._expanded)?(this._removeChildRows(g),f?(a._expanded=!0,this._renderer.updateExpandVisuals(a,!0),this._generateChildren(f,a._depth+1,a),this._rowsChanged()):(d=this,this._renderer.updateExpandVisuals(a,"progress"),f=this._treeModel.getChildren(a._item,function(e){d.destroyed||(d._renderer.updateExpandVisuals(a,!0),a._expanded||(a._expanded=
!0,d._generateChildren(e,a._depth+1,a),d._rowsChanged()))}))):this._renderer.updateExpandVisuals(a,!1)):console.log(l["could not find table row "]+g)}},getItem:function(k){var f=n.node(k);return f&&f._item?f._item:k},toggle:function(k){var f=n.node(k);f&&(f._expanded?this.collapse(k):this.expand(k))},isExpanded:function(k){k="string"===typeof k?k:this._treeModel.getId(k);return(k=n.node(k))?k._expanded:!1},expand:function(k,f,h){k="string"===typeof k?k:this._treeModel.getId(k);var g=n.node(k);if(g){var d=
this;g._expanded?f&&f.apply(d,h):(this._renderer.updateExpandVisuals(g,"progress"),this._treeModel.getChildren(g._item,function(a){d.destroyed||(d._renderer.updateExpandVisuals(g,!0),g._expanded||(g._expanded=!0,d._generateChildren(a,g._depth+1,g),d._rowsChanged()),f&&f.apply(d,h))}))}},_removeChildRows:function(k){for(var f=k===this._id,h=!1,g=-1,d=[],a=n.$$array(".treeTableRow",this._parent),e=0;e<a.length;e++){var b=a[e];if(h)break;f?b._depth>g?d.push(b):h=!0:b.id===k&&(f=!0,g=b._depth)}for(k=
0;k<d.length;k++)f=d[k],f.parentNode.removeChild(f)},_removeAllRows:function(){for(var k=n.$$array(".treeTableRow",this._parent),f=0;f<k.length;f++)k[f].parentNode.removeChild(k[f])},collapse:function(k){k="string"===typeof k?k:this._treeModel.getId(k);var f=n.node(k);if(f){if(!f._expanded)return;f._expanded=!1;this._renderer.updateExpandVisuals(f,!1);this._removeChildRows(k);this._rowsChanged()}this._onCollapse&&this._onCollapse(f._item)},getIndent:function(){return this._indent}};m.prototype.constructor=
m;return{TableTree:m}});
define("orion/treeModelIterator",[],function(){var l={};l.TreeModelIterator=function(){function l(m,k){this.firstLevelChildren=m;this.reset();this._init(k)}l.prototype={_init:function(l){l&&(this.isExpanded=l.isExpanded,this.isExpandable=l.isExpandable,this.forceExpandFunc=l.forceExpandFunc,this.getChildrenFunc=l.getChildrenFunc)},topLevel:function(l){return l.parent?l.parent===this.root:!0},_getChildren:function(l){return"function"===typeof this.getChildrenFunc?this.getChildrenFunc(l):l?l.children:
null},_expanded:function(l){if(!l)return!0;var k=this._getChildren(l),k=k&&0<k.length;this.isExpanded&&k&&(k=this.isExpanded(l));return k},_expandable:function(l){return!l?!0:this.isExpandable?this.isExpandable(l):!1},_diveIn:function(l){return this._expanded(l)?(l=this._getChildren(l),this.setCursor(l[0]),this.cursor()):null},_drillToLast:function(l){return this._expanded(l)?(l=this._getChildren(l),this._drillToLast(l[l.length-1])):l},_forward:function(l){if(!this._cursor)return null;var k=this._diveIn(this._cursor);
if(!k){if(l&&this._expandable(this._cursor)&&this.forceExpandFunc){var f=this;return this.forceExpandFunc(this._cursor,"first",function(h){h&&f.setCursor(h)})}(k=this._findSibling(this._cursor,!0))&&this.setCursor(k)}return k},_backward:function(l){if(!this._cursor)return null;var k=this._findSibling(this._cursor,!1);k&&k!==this._cursor.parent&&(k=this._drillToLast(k));if(l&&k&&this._expandable(k)&&this.forceExpandFunc&&k!==this._cursor.parent){var f=this;return this.forceExpandFunc(k,"last",function(h){h&&
f.setCursor(h)})}k&&this.setCursor(k);return k},_findSibling:function(l,k){for(var f=this.topLevel(l),h=this._getChildren(l.parent),h=f?this.firstLevelChildren:h,g=0;g<h.length;g++)if(h[g]===l)return 0===g&&!k?f?null:l.parent:g===h.length-1&&k?f?null:this._findSibling(l.parent,k):k?h[g+1]:h[g-1];return null},_inParentChain:function(l,k){for(var f=l.parent;f;){if(f===k)return!0;f=f.parent}return!1},_getTopLevelParent:function(l){if(this.topLevel(l))return l;for(l=l.parent;l;){if(this.topLevel(l))return l;
l=l.parent}return null},_onCollapse:function(l){return this._expanded(l.parent)?l:this._onCollapse(l.parent)},_scan:function(l,k,f){this.setCursor(k);var h=[];for(h.push(k);;){if(this.iterate(l))h.push(this.cursor());else break;if(f===this.cursor())return h}return null},setCursor:function(l){this._prevCursor=this._cursor;this._cursor=l},setTree:function(l){this.firstLevelChildren=l;0<this.firstLevelChildren.length&&(this.root=this.firstLevelChildren[0].parent)},scan:function(l,k){var f=this.cursor(),
h=this._scan(!0,l,k);h||(h=this._scan(!1,l,k));this.setCursor(f);return h},iterate:function(l,k){return l?this._forward(k):this._backward(k)},iterateOnTop:function(l,k){var f=this._findSibling(this._getTopLevelParent(this.cursor()),l);f?this.setCursor(f):k&&0<this.firstLevelChildren.length&&this.setCursor(l?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(l){return!this._cursor?null:this._inParentChain(this._cursor,l)?(this.setCursor(l),this._cursor):
null},reset:function(){this.root=this._prevCursor=this._cursor=null;0<this.firstLevelChildren.length&&(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 l}();return l});
define("orion/explorers/explorerNavHandler",["orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(l,n,m){var k={},f=-1!==navigator.userAgent.indexOf("iPad"),h=-1!==window.navigator.platform.indexOf("Mac");k.ExplorerNavHandler=function(){function g(d,a,e){this.explorer=d;this.model=this.explorer.model;this._navDict=a;this._listeners=[];this._selections=[];this._currentColumn=0;d=this._getEventListeningDiv();d.tabIndex=0;d.classList.add("selectionModelContainer");var b=this;this._modelIterator=
new n.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:e.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return b.explorer.renderer.isExpandable(a)}:function(a){return b.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,e,d){return b.explorer.forceExpandFunc(a,e,d)}:void 0});this._init(e);(!e||!1!==e.setFocus)&&d.focus();e=function(a){if(m.isFormElement(a.target)||b.explorer.preventDefaultFunc&&b.explorer.preventDefaultFunc(a,
b._modelIterator.cursor()))return!0;if(a.keyCode===l.KEY.DOWN)return b.onDownArrow(a);if(a.keyCode===l.KEY.UP)return b.onUpArrow(a);if(a.keyCode===l.KEY.RIGHT)return b.onRightArrow(a);if(a.keyCode===l.KEY.LEFT)return b.onLeftArrow(a);if(a.keyCode===l.KEY.SPACE)return b.onSpace(a);if(a.keyCode===l.KEY.ENTER)return b.onEnter(a)};d.addEventListener("keydown",e,!1);this._listeners.push({type:"keydown",listener:e});e=function(a){if(b.explorer.onFocus)b.explorer.onFocus(!1);else b.toggleCursor(null,!1)};
d.addEventListener("blur",e,!1);this._listeners.push({type:"blur",listener:e});e=function(a){if(b.explorer.onFocus)b.explorer.onFocus(!0);else b.toggleCursor(null,!0)};d.addEventListener("focus",e,!1);this._listeners.push({type:"focus",listener:e});this._parentDiv=d}g.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_init:function(d){this._linearGridMove=!1;d&&(this._selectionPolicy=d.selectionPolicy,this.gridClickSelectionPolicy=d.gridClickSelectionPolicy||
"none",this.preventDefaultFunc=d.preventDefaultFunc,this.postDefaultFunc=d.postDefaultFunc)},_ctrlKeyOn:function(d){return h?d.metaKey:d.ctrlKey},removeListeners:function(){if(this._listeners)for(var d=0;d<this._listeners.length;d++)this._parentDiv.removeEventListener(this._listeners[d].type,this._listeners[d].listener,!1)},focus:function(){var d=this._getEventListeningDiv();d&&d.focus()},_getEventListeningDiv:function(d){return this.explorer.keyEventListeningDiv&&"function"===typeof this.explorer.keyEventListeningDiv?
this.explorer.keyEventListeningDiv(d):l.node(this.explorer._parentId)},isExpandable:function(d){return!d?!1:l.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(d)))?!0:!1},isExpanded:function(d){return!d?!1:this.explorer.myTree.isExpanded(this.model.getId(d))},refreshSelection:function(d,a){var e=this;this.explorer.selection&&this.explorer.selection.getSelections(function(b){e._clearSelection(a);for(var g=0;g<b.length;g++)e._selections.push(b[g]);0<e._selections.length?e.cursorOn(e._selections[0],
!0,!1,d):e.cursorOn(null,!1,!1,d);e._shiftSelectionAnchor&&0<=e._inSelection(e._shiftSelectionAnchor)||(e._shiftSelectionAnchor=null)})},refreshModel:function(d,a,e,b){this._currentColumn=0;this.topIterationNodes=[];this.model=a;this._navDict=d;this.model.getTopIterationNodes?this.topIterationNodes=this.model.getTopIterationNodes():e&&(this.topIterationNodes=e);this._modelIterator.setTree(this.topIterationNodes);!b&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),!1),this._modelIterator.reset());
this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(d){d=this.model.getId(d);for(var a=0;a<this._selections.length;a++)if(d===this.model.getId(this._selections[a]))return a;return-1},_clearSelection:function(d){if(d)for(d=0;d<this._selections.length;d++)this._checkRow(this._selections[d],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(d){this._selectionPolicy!==
d&&(("readonlySelection"===this._selectionPolicy||"readonlySelection"===d)&&this._toggleSelectionClass("disabledRow","readonlySelection"===d),this._selectionPolicy=d,"cursorOnly"===this._selectionPolicy&&this._clearSelection(!0))},setSelection:function(d,a,e){"readonlySelection"!==this._selectionPolicy&&("cursorOnly"===this._selectionPolicy?a&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(d,!0):this._isRowSelectable(d)&&(!a||"singleSelection"===this._selectionPolicy?(this._clearSelection(!0),
this._checkRow(d,!1),this._selections.push(d),this._lastSelection=d):(a=this._inSelection(d),0<=a?(this._checkRow(d,!0),this._selections.splice(a,1)):(this._checkRow(d,!1),this._selections.push(d),this._lastSelection=d)),e&&(this._shiftSelectionAnchor=this._lastSelection),this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))))},moveColumn:function(d,a){d||(d=this.currentModel());var e=this._getGridChildren(d);if(e&&1<e.length||
0===a&&e){0!==a&&this.toggleCursor(d,!1);var b=this._currentColumn,g=!0,b=b+a;0>b?(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!1)?d=this.currentModel():g=!1),b=g?e.length-1:this._currentColumn):b>=e.length&&(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!0)?d=this.currentModel():g=!1),b=g?0:this._currentColumn);this._currentColumn=b;0!==a&&this.toggleCursor(d,!0);return!0}return!1},_getGridChildren:function(d){return this._navDict?this._navDict.getGridNavHolder(d):null},
getCurrentGrid:function(d){d||(d=this.currentModel());return(d=this._getGridChildren(d))&&0<d.length?d[this._currentColumn]:null},getAriaContainerElement:function(d){for(var a=this._parentDiv,e;d&&d!==a&&"grid"!==(e=d.getAttribute("role"))&&"tree"!==e&&"treegrid"!==e;)d=d.parentNode;return d===a?null:d},toggleCursor:function(d,a){var e=this.getRowDiv(d),b=this.getCurrentGrid(d);b?(e&&(a?e.classList.add("treeIterationCursorRow"):e.classList.remove("treeIterationCursorRow")),b.domNode&&(e=this.getAriaContainerElement(b.domNode),
a?(b.domNode.classList.add("treeIterationCursor"),e&&e.setAttribute("aria-activedescendant",b.domNode.id)):b.domNode.classList.remove("treeIterationCursor"))):e&&(a?e.classList.add("treeIterationCursorRow_Dotted"):e.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(d,a,e,b){var g,f;if(d||a){if(f===this._modelIterator.cursor())return;g=this._modelIterator.cursor();f=d;this._modelIterator.setCursor(f)}else g=this._modelIterator.prevCursor(),
f=this._modelIterator.cursor();if(g!==f||a)if(this.toggleCursor(g,!1),!a||f){this.moveColumn(null,0);this.toggleCursor(f,!0);if((d=this.getRowDiv())&&!b){b=d.parentNode;for(a=document.documentElement;b&&b!==a;){var h=window.getComputedStyle(b,null);if(!h)break;h=h.getPropertyValue("overflow-y");if("auto"===h||"scroll"===h)break;b=b.parentNode}b&&(a=!0,d.offsetTop<=b.scrollTop?(a=!1,void 0===e&&(e=!1)):d.offsetTop+d.offsetHeight>=b.scrollTop+b.clientHeight&&(a=!1,void 0===e&&(e=!0)),a||d.scrollIntoView(!e))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(g,
f)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var d=[],a=0;a<this._selections.length;a++)d.push(this.model.getId(this._selections[a]));return d},getRowDiv:function(d){d=d?d:this._modelIterator.cursor();if(!d)return null;d=this.model.getId(d);var a=this._navDict.getValue(d);return a&&a.rowDomNode?a.rowDomNode:l.node(d)},iterate:function(d,a,e,b){var g=null;if(this.topIterationNodes&&0!==this.topIterationNodes.length)if(b){b=this.currentModel();for((g=this._modelIterator.iterate(d,
a))&&this._setCursorOnItem(d,e);g&&g.isNotSelectable;)(g=this._modelIterator.iterate(d,a))&&this._setCursorOnItem(d,e);g||(this.cursorOn(b,!0,!1,!0),this._setCursorOnItem(d,e))}else(g=this._modelIterator.iterate(d,a))&&this._setCursorOnItem(d,e)},_toggleSelectionClass:function(d,a){this._selections.forEach(function(e){(e=this.getRowDiv(e))&&(a?e.classList.add(d):e.classList.remove(d))}.bind(this))},_setCursorOnItem:function(d,a){this.cursorOn(null,!1,d);if(a){var e=this._inSelection(this._modelIterator.prevCursor()),
b=this._inSelection(this._modelIterator.cursor());0<=e&&0<=b?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(d,a){if(this.explorer.renderer._useCheckboxSelection&&"singleSelection"!==this._selectionPolicy){var e=this.getRowDiv(d);if(e){var b=l.node(this.explorer.renderer.getCheckBoxId(e.id)),g=a?!b.checked:!0;if(g!==b.checked)this.explorer.renderer.onCheck(e,b,g,!0)}}else this._select(d,a)},_select:function(d,a){d||(d=this._modelIterator.cursor());
var e=this.getRowDiv(d);e&&(0>this._inSelection(d)?e.classList.add("checkedRow"):e.classList.remove("checkedRow"))},_onModelGrid:function(d,a){var e=this._getGridChildren(d);if(e)for(var b=0;b<e.length;b++)if(a.target===e[b].domNode)return!0;return!1},onClick:function(d,a){if("readonlySelection"===this._selectionPolicy||this.isDisabled(this.getRowDiv(d)))l.stop(a);else{var e=l.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(d)));if(a.target!==e&&!("none"===this.gridClickSelectionPolicy&&
this._onModelGrid(d,a)))if(this.cursorOn(d,!0,!1,!0),f)this.setSelection(d,!0);else if(this._ctrlKeyOn(a))this.setSelection(d,!0,!0);else if(a.shiftKey&&this._shiftSelectionAnchor){if(e=this._modelIterator.scan(this._shiftSelectionAnchor,d)){this._clearSelection(!0);for(var b=0;b<e.length;b++)this.setSelection(e[b],!0)}}else this.setSelection(d,!1,!0)}},onCollapse:function(d){this._modelIterator.collapse(d)&&this.cursorOn()},onUpArrow:function(d){this.iterate(!1,!1,d.shiftKey,!0);!this._ctrlKeyOn(d)&&
!d.shiftKey&&this.setSelection(this.currentModel(),!1,!0);d.preventDefault();return!1},onDownArrow:function(d){this.iterate(!0,!1,d.shiftKey,!0);!this._ctrlKeyOn(d)&&!d.shiftKey&&this.setSelection(this.currentModel(),!1,!0);d.preventDefault();return!1},_shouldMoveColumn:function(d){var a=this.currentModel(),e=this._getGridChildren(a);return e&&1<e.length?this.isExpandable(a)?this._ctrlKeyOn(d):!0:!1},onLeftArrow:function(d){if(this._shouldMoveColumn(d))return this.moveColumn(null,-1),d.preventDefault(),
!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&this.isExpanded(a))return this.explorer.myTree.collapse(a),d.preventDefault(),!0;this._modelIterator.topLevel(a)?this.explorer.scopeUp&&"function"===typeof this.explorer.scopeUp&&this.explorer.scopeUp():(this.cursorOn(a.parent),this.setSelection(a.parent,!1,!0))},onRightArrow:function(d){if(this._shouldMoveColumn(d))return this.moveColumn(null,1),d.preventDefault(),!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&
!this.isExpanded(a))return this.explorer.myTree.expand(a),this.explorer.postUserExpand&&this.explorer.postUserExpand(this.model.getId(a)),d.preventDefault(),!1},_isRowSelectable:function(d){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(d):!0},onSpace:function(d){this.setSelection(this.currentModel(),!0,!0);d.preventDefault()},onEnter:function(d){var a=this.getCurrentGrid(this._modelIterator.cursor());if(a)if(a.widget)if("function"===typeof a.onClick)a.onClick();else"function"===
typeof a.widget.focus&&a.widget.focus();else{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(d),!1,!1,!1,0,null);a.domNode.dispatchEvent(e)}else if(a=this._modelIterator.cursor())if(this.explorer.renderer.getRowActionElement&&(e=this.explorer.renderer.getRowActionElement(this.model.getId(a)),e.href&&(this._ctrlKeyOn(d)?window.open(e.href):window.location.href=e.href)),this.explorer.renderer.performRowAction)return this.explorer.renderer.performRowAction(d,
a),d.preventDefault(),!1},setIsNotSelectable:function(d,a){d.isNotSelectable=a},disableItem:function(d){var a=this.getRowDiv(d);this.isExpandable(d)&&this.isExpanded(d)&&(this._modelIterator.collapse(d),this.explorer.myTree.toggle(a.id));a.classList.remove("checkedRow");a.classList.add("disabledNavRow");this.setIsNotSelectable(d,!0)},isDisabled:function(d){return d.classList.contains("disabledNavRow")},enableItem:function(d){var a=this.getRowDiv(d);a&&(a.classList.remove("disabledNavRow"),this.setIsNotSelectable(d,
!1))}};return g}();k.ExplorerNavDict=function(){function g(d){this._dict={};this._model=d}g.prototype={addRow:function(d,a){var e=this._model.getId(d);this._dict[e]={model:d,rowDomNode:a}},getValue:function(d){return this._dict[d]},getGridNavHolder:function(d,a){if(!d)return null;var e=this._model.getId(d);return this._dict[e]?(!this._dict[e].gridChildren&&a&&(this._dict[e].gridChildren=[]),this._dict[e].gridChildren):null},initGridNavHolder:function(d){if(!d)return null;d=this._model.getId(d);this._dict[d]&&
(this._dict[d].gridChildren=null)}};return g}();return k});
define("orion/explorers/explorer","i18n!orion/nls/messages require orion/webui/littlelib orion/webui/treetable orion/explorers/explorerNavHandler orion/commands".split(" "),function(l,n,m,k,f,h){var g={};g.Explorer=function(){function d(a,e,b,d){this.registry=a;this.renderer=b;this.selection=e;this.commandService=d;this.renderer&&(this.renderer.explorer=this);this.myTree=null}d.prototype={destroy:function(){this._navHandler&&this._navHandler.destroy();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,b){var d=null;if(a=this.getRow(a)){var d=a.parentNode,g=document.createElement("tr");g.id=e+"placeHolderRow";g.classList.add("navRow");var f=document.createElement("td");f.id=e+"placeHolderCol";f.classList.add("navColumn");g.appendChild(f);
b?d.insertBefore(g,a.nextSibling):d.insertBefore(g,a);f.style.paddingLeft=a.firstChild.style.paddingLeft;d={wrapperNode:g,refNode:f,destroyFunction:function(){try{g&&g.parentNode&&g.parentNode.removeChild(g)}catch(a){}}}}return d},getRow:function(a){if(a=this.model.getId(a))return m.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){a=this._navHandler.getTopLevelNodes();
for(var 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(!(void 0===a||null===a))for(var d=a.length,g=0;g<d;g++)e._expandRecursively(a[g])})})}},createTree:function(a,e,b){a="string"===typeof a?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var d=a+"innerTree",
g=m.node(d);g&&m.empty(g);e&&(e.rootId=d);this.model=e;this._parentId=a;this._treeOptions=b;if(!b||b&&!b.noSelection)this.selectionPolicy=b?b.selectionPolicy:"",this._navDict=new f.ExplorerNavDict(this.model);this.myTree=new k.TableTree({id:d,model:e,parent:a,onComplete:b?b.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:b?!!b.showRoot:!1,indent:b?b.indent:void 0,onCollapse:b?b.onCollapse:void 0,navHandlerFactory:b?b.navHandlerFactory:void 0,
tableElement:b?b.tableElement:void 0,tableBodyElement:b?b.tableBodyElement:void 0,tableRowElement:b?b.tableRowElement:void 0});this.renderer._initializeUIState();"cursorOnly"===this.selectionPolicy&&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 b=a.getSelection(),d=0;d<b.length;d++){var g=a.getRowDiv(b[d]);g&&g.parentNode&&
(g=this.getNavDict().getValue(this.model.getId(b[d])),g.model&&e.push(g.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){this.getNavHandler()||(this._navHandler=a&&a.navHandlerFactory&&"function"===typeof a.navHandlerFactory.createNavHandler?a.navHandlerFactory.createNavHandler(this,this._navDict,a):new f.ExplorerNavHandler(this,this._navDict,
{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null}));var e=this;this.model.getRoot(function(b){b instanceof Array?e.getNavHandler().refreshModel(e.getNavDict(),e.model,b):b.children&&b.children instanceof Array&&e.getNavHandler().refreshModel(e.getNavDict(),e.model,b.children);a&&a.setFocus&&e.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return d}();g.createExplorerCommands=function(d,a){function e(b){return"function"===
typeof b.getItemCount&&0<b.getItemCount()?a?a(b):!0:!1}var b=new h.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()}}),g=new h.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()}});
d.addCommand(b);d.addCommand(g)};g.ExplorerModel=function(){function d(a,e,b){this.rootPath=a;this.fetchItems=e;this.idPrefix=b||""}d.prototype={destroy:function(){this.destroyed=!0},getRoot:function(a){var e=this;this.fetchItems(this.rootPath).then(function(b){e.root=b;a(b)})},getChildren:function(a,e){a.Children?e(a.Children):a.ChildrenLocation?this.fetchItems(a.ChildrenLocation).then(function(b){a.Children=b;e(b)}):e([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;
a=a.Location.replace(/[\\\/]/g,"");for(var e=this.idPrefix,b=0;b<a.length;b++)e=a[b].match(/[^\.\:\-\_0-9A-Za-z]/g)?e+a.charCodeAt(b):e+a[b];return e}};return d}();g.ExplorerFlatModel=function(){function d(a,e,b){this.rootPath=a;this.fetchItems=e;this.root=b}d.prototype=new g.ExplorerModel;d.prototype.getRoot=function(a){if(this.root)a(this.root);else{var e=this;this.fetchItems(this.rootPath).then(function(b){e.root=b;a(b)})}};d.prototype.getChildren=function(a,e){a===this.root?e(this.root):e([])};
return d}();g.ExplorerRenderer=function(){function d(a,e){this.explorer=e;this._init(a);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite"}d.prototype={_init:function(a){a&&(this._useCheckboxSelection=void 0===a.checkbox?!1:a.checkbox,this.selectionPolicy=a.singleSelection?"singleSelection":"",this._cachePrefix=a.cachePrefix,a.getCheckedFunc&&(this.getCheckedFunc=
a.getCheckedFunc),a.onCheckedFunc&&(this.onCheckedFunc=a.onCheckedFunc),this._noRowHighlighting=a.noRowHighlighting,this._highlightSelection=!0,this._treeTableClass=a.treeTableClass||"treetable",!1===a.highlightSelection&&(this._highlightSelection=!1),this.actionScopeId||(this.actionScopeId=a.actionScopeId),this.commandService||(this.commandService=a.commandService))},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(a,e){this.tableTree=e;this.tableNode=a;m.empty(a);
this._treeTableClass&&a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,e,b,d,g){b=b||"tool";var f=document.createElement("td");f.id=e.id+"actionswrapper";d&&f.classList.add(d);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,f,a,this.explorer,b,null,g&&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 f},initCheckboxColumn:function(a){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,e){if(this._useCheckboxSelection){var b=document.createElement("td"),d=document.createElement("span");d.id=this.getCheckBoxId(e.id);d.classList.add("core-sprite-check");d.classList.add("selectionCheckmarkSprite");d.rowId=e.id;this.getCheckedFunc&&(d.checked=this.getCheckedFunc(a),d.checked?(this._highlightSelection&&e.classList.add("checkedRow"),d.classList.add("core-sprite-check_on")):
(this._highlightSelection&&e.classList.remove("checkedRow"),d.classList.remove("core-sprite-check_on")));b.appendChild(d);var g=this;d.addEventListener("click",function(b){g.onCheck(e,b.target,b.target.checked?!1:!0,!0,!1,a)},!1);return b}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,e,b,d,g,f){(e.checked=b)?e.classList.add("core-sprite-check_on"):e.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(e.rowId,b,d,f);this.explorer.getNavHandler()&&
g&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),e=this._getUIStatePreferencePath();e&&window.sessionStorage&&(window.sessionStorage[e+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){var e=this.explorer.getNavDict(),b=this.explorer.getNavHandler();if(b&&(e&&"cursorOnly"!==b.getSelectionPolicy())&&(a=window.sessionStorage[a+
"selection"],"string"===typeof a&&(a=0<a.length?JSON.parse(a):null),a)){for(var d=[],b=0;b<a.length;b++){var g=e.getValue(a[b]);if(g&&(g.rowDomNode&&g.model)&&(d.push(g.model),this._highlightSelection&&g.rowDomNode.classList.add("checkedRow"),g=m.node(this.getCheckBoxId(g.rowDomNode.id))))g.checked=!0,g.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(d),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+
"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var e=!1,b=window.sessionStorage[a+"expanded"];"string"===typeof b&&(b=0<b.length?JSON.parse(b):null);var d;if(b)for(d=0;d<b.length;d++)if(m.node(b[d])){this._expanded.push(b[d]);var g=this;this.tableTree.expand(b[d],function(){g._restoreSelections(a)});e=!0}return!e},_getUIStatePreferencePath:function(){if(this.explorer){var a=this.explorer.getRootPath();if(this._cachePrefix&&a)return a=a.replace(/[^\.\:\-\_0-9A-Za-z]/g,""),
"/"+this._cachePrefix+"/"+a+"/uiState"}return null},expandCollapseImageId:function(a){return a+"__expand"},updateExpandVisuals:function(a,e){var b=m.node(this.expandCollapseImageId(a.id));b&&(b.classList.remove(this._expandImageClass),b.classList.remove(this._collapseImageClass),b.classList.remove(this._progressImageClass),b.classList.add("progress"===e?this._progressImageClass:e?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(a,e,b,d){var g=document.createElement("span");
g.id=this.expandCollapseImageId(a.id);e.appendChild(g);g.classList.add(this._twistieSpriteClass);g.classList.add(this._collapseImageClass);if(b){var f=document.createElement("span");e.appendChild(f);f.classList.add(d||"imageSprite");f.classList.add(b)}var h=this;g.onclick=function(b){if(!h.explorer.getNavHandler().isDisabled(a)){h.tableTree.toggle(a.id);if(h.tableTree.isExpanded(a.id))h._expanded.push(a.id),h.explorer.postUserExpand&&h.explorer.postUserExpand(a.id);else for(var e in h._expanded)if(h._expanded[e]===
a.id){h._expanded.splice(e,1);break}(b=h._getUIStatePreferencePath())&&window.sessionStorage&&h._storeExpansions(b)}};return g},render:function(a,e){e.classList.add("navRow");this.renderRow(a,e)},rowsChanged:function(){"cursorOnly"!==this.explorer.selectionPolicy&&(this.explorer.refreshSelection(),this.explorer.initNavHandler());this._noRowHighlighting||(m.$(".sectionTreeTable",this.tableNode.parentNode)||m.$(".treetable",this.tableNode.parentNode))&&m.$$array(".treeTableRow",this.tableNode).forEach(function(a,
e){var b=!(e%2)?"lightSectionTreeTableRow":"darkSectionTreeTableRow",d="lightSectionTreeTableRow"===b?"darkSectionTreeTableRow":"lightSectionTreeTableRow";a.classList.add(b);a.classList.remove(d)})},updateCommands:function(){if(this.commandService)for(var a=m.$$array(".treeTableRow"),e=0;e<a.length;e++){var b=a[e],d=m.node(b.id+"actionswrapper");this.commandService.destroy(d);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,d,b._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=
[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return d}();g.SelectionRenderer=function(){function d(a,e){this._init(a);this.explorer=e}d.prototype=new g.ExplorerRenderer;d.prototype.renderTableHeader=function(a){var e=document.createElement("thead"),b=document.createElement("tr");e.classList.add("navTableHeading");this._useCheckboxSelection&&b.appendChild(this.initCheckboxColumn(a));for(var d=0,g=this.getCellHeaderElement(d);g;)0<
g.innerHTML.length&&g.classList.add("navColumn"),b.appendChild(g),g=this.getCellHeaderElement(++d);e.appendChild(b);0<d&&a.appendChild(e)};d.prototype.renderRow=function(a,e){e.verticalAlign="baseline";e.classList.add("treeTableRow");if(void 0===a.selectable||a.selectable){var b=this.explorer.getNavDict();if(b){"cursorOnly"!==this.explorer.selectionPolicy&&e.classList.add("selectableNavRow");b.addRow(a,e);var d=this;e.addEventListener("click",function(b){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(a,
b)},!1)}if(b=this.getCheckboxColumn(a,e))b.classList.add("checkColumn"),e.appendChild(b)}for(var b=0,g=this.getCellElement(b,a,e);g;)e.appendChild(g),0===b?this.getPrimColumnStyle?g.classList.add(this.getPrimColumnStyle(a)):g.classList.add("navColumn"):this.getSecondaryColumnStyle?g.classList.add(this.getSecondaryColumnStyle()):g.classList.add("secondaryColumn"),g=this.getCellElement(++b,a,e)};d.prototype.getCellHeaderElement=function(a){};d.prototype.getCellElement=function(a,e,b){};return d}();
g.SimpleFlatModel=function(){function d(a,e,b){this.items=a;this.getKey=b;this.idPrefix=e;this.root={children:a}}d.prototype=new g.ExplorerModel;d.prototype.getRoot=function(a){a(this.root)};d.prototype.getId=function(a){a=this.getKey(a).replace(/[\\\/]/g,"");for(var e="",b=0;b<a.length;b++)e=a[b].match(/[^\.\:\-\_0-9A-Za-z]/g)?e+a.charCodeAt(b):e+a[b];return this.idPrefix+e};d.prototype.getChildren=function(a,e){a===this.root?e(this.items):e([])};return d}();return g});
define("orion/widgets/browse/commitInfoRenderer",["orion/objects","orion/URITemplate","orion/webui/littlelib","orion/xhr","orion/URL-shim"],function(l,n,m,k){function f(d,a,e){return 0<d?1===d?a+" ":d+" "+e+" ":""}function h(d){d=new Date(d);var a=(new Date).getTime()-d.getTime();d=Math.floor(a/1E3/60/60/24/365);var a=a-31536E6*d,e=Math.floor(a/1E3/60/60/24/30),a=a-2592E6*e,b=Math.floor(a/1E3/60/60/24),a=a-864E5*b,g=Math.floor(a/1E3/60/60),h=Math.floor((a-36E5*g)/1E3/60),a=f(d,"a year","years"),k=
f(e,"a month","months"),l=f(b,"a day","days"),m=f(g,"an hour","hours"),h=f(h,"a minute","minutes"),n="";a?n=0<d?a:a+k:k?n=0<e?k:k+l:l?n=0<b?l:l+m:m?n=0<g?m:m+h:h&&(n=h);return n?n+"ago":"Just now"}function g(d){this._parentDomNode=m.node(d.parent);this._commitInfo=d.commitInfo}l.mixin(g.prototype,{destroy:function(){},_simpleMessage:function(d){var a=this._commitInfo.Message?this._commitInfo.Message:"";if(a){var e=a.replace(/\r\n|\n\r|\n|\r/g,"\n").split("\n");e&&0<e.length&&(a=e[0]);10<d&&a.length>
d&&(a=a.substring(0,d-3)+"...")}return a},_generateMessageNode:function(d){var a;if(this._commitInfo.URL||this._commitInfo.SHA1){a=document.createElement("a");if(this._commitInfo.SHA1){var e=(new URL("commit",window.location.href)).href,e=decodeURIComponent(e);a.href=(new n(e+"{/SHA1}")).expand(this._commitInfo)}else a.href=this._commitInfo.URL;a.classList.add("commitInfolink")}else a=document.createElement("span");a.appendChild(document.createTextNode(d));return a},_requestPhotoURL:function(d,a){var e=
this,b=new URL("/manage/service/com.ibm.team.jazzhub.common.service.IPhotoService/getContributorPhotoURI",window.location.href);b.query.set("contributorUserId",d);k("GET",b.href,{timeout:15E3}).then(function(b){b=JSON.parse(b.response);a.src=b.photoURI},function(){e._useOtherPhotoURL(a)})},_useOtherPhotoURL:function(d){d.src=this._commitInfo.AvatarURL?this._commitInfo.AvatarURL:"https://www.gravatar.com/avatar/?d\x3dmm"},renderSimple:function(d){this._parentDomNode.appendChild(this._generateMessageNode(this._simpleMessage(d)))},
render:function(d,a){var e=this._commitInfo.Author&&this._commitInfo.Author.Date?h(this._commitInfo.Author.Date):"",b=this._simpleMessage(-1),g=this._commitInfo.Author&&this._commitInfo.Author.Name?this._commitInfo.Author.Name:"",f=d;f||(f="Commit");f="Last "+f;if(a){var k=document.createElement("div"),l=new Image;this._commitInfo.Author&&this._commitInfo.Author.UserId?this._requestPhotoURL(this._commitInfo.Author.UserId,l):this._useOtherPhotoURL(l);l.classList.add("commitInfoAvatar");k.appendChild(l)}else k=
document.createElement("div"),k.classList.add("commitInfoLabelContainer"),k.appendChild(document.createTextNode(f.toUpperCase()));this._parentDomNode.appendChild(k);k=document.createElement("div");k.classList.add("commitInfoMessageContainer");l=document.createElement("div");l.classList.add("commitInfoAutorContainer");var y=document.createDocumentFragment(),n=document.createElement("span");n.appendChild(document.createTextNode(g));n.classList.add("navColumnBold");a?(g=document.createElement("span"),
g.appendChild(document.createTextNode(f)),g.classList.add("navColumnBold"),y.textContent=e?"${0} by ${1} "+e+".":"${0} by ${1}.",e=[g,n]):(y.textContent=e?"by ${0} "+e+".":"by ${0}.",e=[n]);m.processDOMNodes(y,e);l.appendChild(y);k.appendChild(l);e=document.createElement("div");e.classList.add("commitInfoMessageTextContainer");e.appendChild(this._generateMessageNode(b));k.appendChild(e);this._parentDomNode.appendChild(k)}});return{CommitInfoRenderer:g,calculateTime:h}});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages orion/Deferred orion/explorers/explorer orion/explorers/navigationUtils orion/extensionCommands orion/objects orion/URITemplate orion/widgets/browse/commitInfoRenderer orion/webui/littlelib".split(" "),function(l,n,m,k,f,h,g,d,a){function e(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1}function b(a,b,d,p,k,l,m,B,v){b=h.clone(b);
var A;if(b.Directory)A=document.createElement("a"),A.className="navlinkonpage",p=!a?q:new g(a+"#{,resource,params*}"),A.href=p.expand({resource:b.ChildrenLocation}),b.Name&&A.appendChild(document.createTextNode(b.Name));else{k||(k=f.getOpenWithCommands(d));A=document.createElement("a");A.className="navlink targetSelector";l&&"object"===typeof l&&Object.keys(l).forEach(function(a){A[a]=l[a]});var D=null,C=null;if(D=B?B.holderDom:A)C=document.createElement("span"),C.className="core-sprite-file modelDecorationSprite thumbnail",
D.appendChild(C);b.Name&&A.appendChild(document.createTextNode(b.Name));var E=b.Location;m&&"object"===typeof m&&(b.params={},h.mixin(b.params,m));(a=f.getOpenWithCommand(d,b,k))&&(E=a.hrefCallback({items:b}));n.when(p.getFileContentType(b),function(a){if(D){var d=D,g=C;if(a){var f,p=a.imageClass,h=a.image;p?(f=document.createElement("span"),f.className+=p,f.classList.add("thumbnail")):h&&(f=document.createElement("img"),f.src=h,f.classList.add("thumbnail"));f&&d.replaceChild(f,g)}}A.href=E;v&&"function"===
typeof v.updateFileNode&&v.updateFileNode(b,A,e(a))})}A.addEventListener("click",function(){t=b}.bind(this),!1);return A}function p(a,b,e,d){this.explorer=b;this.commandService=e;this.contentTypeService=d;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var q=new g("#{,resource,params*}"),t;p.prototype=new m.SelectionRenderer;p.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};p.prototype.tableCallback=function(a){a.setAttribute("aria-label",
l.Navigator);a.setAttribute("role","presentation")};p.prototype.rowCallback=function(a,b){a.setAttribute("role","treeitem")};p.prototype.emptyCallback=function(b){var e=document.createElement("tr"),d=document.createElement("td");d.colSpan=this.oneColumn?1:3;var g=document.createElement("div");g.classList.add("noFile");g.textContent=l.NoFile;var f=document.createElement("span");f.appendChild(document.createTextNode(l.File));a.processDOMNodes(g,[f]);d.appendChild(g);e.appendChild(d);b.appendChild(e)};
p.prototype.getDisplayTime=function(a){return(new Date(a)).toLocaleString()};p.prototype.getCommitRenderer=function(a,b){return new d.CommitInfoRenderer({parent:a,commitInfo:b})};p.prototype.getCellHeaderElement=function(a){if(this.oneColumn&&0!==a)return null;switch(a){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};p.prototype.setTarget=function(a){this.target=a};p.prototype.getFolderImage=function(a){if(!this.showFolderImage)return null;a=document.createElement("span");a.className=
"core-sprite-folder modelDecorationSprite";return a};p.prototype.createFolderNode=function(a){var e;this.showFolderLinks?(e=b(this.folderLink||"",a,this.commandService,this.contentTypeService),(a=this.getFolderImage(a))&&e.insertBefore(a,e.firstChild)):(e=document.createElement("span"),e.textContent=a.Name);return e};p.prototype.updateFileNode=function(a,b,e){};p.prototype.showFolderLinks=!0;p.prototype.getCellElement=function(a,e,d){var g=e.LastCommit?2:1,p=e.LastCommit?3:2,h=e.LastCommit?1:-1;switch(a){case 0:return a=
document.createElement("td"),g=document.createElement("span"),g.id=d.id+"MainCol",g.setAttribute("role","presentation"),a.appendChild(g),a.setAttribute("role","presentation"),g.className="mainNavColumn",e.Directory?(this.getExpandImage(d,g),p=this.createFolderNode(e),g.appendChild(p),this.explorer._makeDropTarget(e,p),this.explorer._makeDropTarget(e,d)):(this.openWithCommands||(this.openWithCommands=f.getOpenWithCommands(this.commandService)),p=b("",e,this.commandService,this.contentTypeService,this.openWithCommands,
{target:this.target},null,null,this),g.appendChild(p)),p&&(p.id=d.id+"NameLink",1===p.nodeType&&(k.addNavGrid(this.explorer.getNavDict(),e,p),p.setAttribute("role","link"),p.setAttribute("tabindex","-1"))),this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,g,e,this.explorer,"tool",null,!0),a;case g:if(this.oneColumn)return null;d=document.createElement("td");e.LocalTimeStamp&&(d.textContent=this.getDisplayTime(e.LocalTimeStamp));return d;case p:if(this.oneColumn)return null;
d=document.createElement("td");!e.Directory&&"number"===typeof e.Length&&(e=parseInt(e.Length,10)/1024,d.textContent=Math.ceil(e).toLocaleString()+" KB");d.style.textAlign="right";return d;case h:if(this.oneColumn||!e.LastCommit)return null;d=document.createElement("td");this.getCommitRenderer(d,e.LastCommit).renderSimple(60);return d}};p.prototype.constructor=p;return{NavigatorRenderer:p,isImage:e,getClickedItem:function(){return t},createLink:b}});
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,n,m,k,f,h,g,d,a){function e(a,b){this.serviceRegistry=a;this.commandRegistry=b;this.openWithCommands=null}function b(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new e(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}e.prototype.makeRenderFunction=function(b,e,h,s,y){var r=this.serviceRegistry,x=this.commandRegistry;this.openWithCommands=this.openWithCommands||d.createOpenWithCommands(r,b,x);var u=this;return function(d,r,B,v){a.when(u.openWithCommands,function(a){if(B)m.empty(e),a=document.createElement("div"),a.appendChild(document.createTextNode(l["Search failed."])),e.appendChild(a),"function"===typeof s&&s(e);else{var D=
function(){function a(b,e){var d=e.folderName?e.folderName:e.path,g=document.createElement("span");g.id=d.replace(/[^a-zA-Z0-9_\.:\-]/g,"");g.appendChild(document.createTextNode(" - "+d+" "));b.appendChild(g)}var b={};return function(e,d){var g=d.name;if(b.hasOwnProperty(g)){a(e,d);var f=b[g];"function"===typeof f&&(b[g]=null,f())}else b[g]=function(){a(e,d)}}}(),C=!1;m.empty(e);if(d&&0<d.length){var E=document.createElement("table");E.setAttribute("role","presentation");for(var K=0;K<d.length;K++){var u=
d[K],F;C||(C=!0,h&&(F=E.insertRow(0).insertCell(0),F.textContent=h));F=E.insertRow(-1).insertCell(0);F.colspan=2;y&&y(F);var G={Name:u.name,Directory:u.directory,Location:u.path||u.location},H=null;"number"===typeof u.LineNumber&&(H={},H.line=u.LineNumber);if(v&&v.keyword&&!v.nameSearch){var I=f.generateSearchHelper(v),H=H||{};H.find=I.inFileQuery.searchStr;H.regEx=I.inFileQuery.wildCard?!0:void 0}G=g.createLink(n.toUrl("edit/edit.html"),G,x,b,a,{"aria-describedby":(u.folderName?u.folderName:u.path).replace(/[^a-zA-Z0-9_\.:\-]/g,
""),style:{verticalAlign:"middle"}},H);u.LineNumber&&G.appendChild(document.createTextNode(" (Line "+u.LineNumber+")"));F.appendChild(G);D(F,u)}e.appendChild(E);"function"===typeof s&&s(e)}!C&&r&&(a=k.formatMessage(l["No matches found for ${0}"],r),m.empty(e),e.appendChild(document.createTextNode(a)),"function"===typeof s&&s(e))}})}};b.prototype={search:function(a,b,e){var d=function(a){for(var e=[],d=0;d<a.response.docs.length;d++){var g=a.response.docs[d],h=g.Location,p=f.path2FolderName(g.Path?
g.Path:g.Location,g.Name),v=p?p:h;(b?0<=v.indexOf(b):1)&&e.push({name:g.Name,path:h,folderName:p,directory:g.Directory,lineNumber:g.LineNumber})}return e};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(b){e(d(b),a.keyword,null,a)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(b){var g=a.keyword,g=g.substring(g.indexOf("}")+1),g=g.substring(g.indexOf(":")+1);e(d(b),g,null,a)},function(a){e(null,
null,a,null)})}catch(g){"string"===typeof g&&-1<g.indexOf("search")&&this._crawler?this._crawler.searchName(a,function(b){e(d(b),null,null,a)}):"string"===typeof g&&-1<g.indexOf("search")&&!a.nameSearch?(new h.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(b){e(d(b),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,b){console.error(a);m.empty(b);b.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,b){var e="",d=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);b&&a&&a.Parents&&0<a.Parents.length?d="last"===b.index?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&(a.Directory&&a.Location&&a.Parents)&&(d=a);d?(this.setLocationbyURL(d.Location),e=d.Name,this._childrenLocation=d.ChildrenLocation):a&&(this.setLocationbyURL(this._searchRootLocation),
e=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation);d=m.node("search");e||(e="");if(d&&d.placeholder){d.value="";var g=k.formatMessage(l["Search ${0}"],e);d.placeholder=30<g.length?g.substring(0,27)+"...":k.formatMessage(l["Search ${0}"],e)}d&&d.title&&(d.title=l["Type a keyword or wild card to search in "]+e)},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=
a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,b,e,d){e=e?this.getSearchRootLocation():this.getSearchLocation();return b?{resource:e,sort:"NameLower asc",
rows:100,start:0,nameSearch:!0,keyword:a}:{resource:e,sort:d&&d.sort?d.sort:"Path asc",rows:d&&d.rows?d.rows:40,start:0,caseSensitive:d?d.caseSensitive:void 0,regEx:d?d.regEx:void 0,fileType:d?d.fileType:void 0,fileNamePatterns:d&&d.fileNamePatterns?d.fileNamePatterns:void 0,keyword:a,replace:d?d.replace:void 0}}};b.prototype.constructor=b;return{Searcher:b}});
define("orion/section","orion/webui/littlelib orion/selection orion/commandRegistry orion/commonHTMLFragments orion/objects orion/selection".split(" "),function(l,n,m,k,f,h){function g(a,e){var b=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite";if(!e.id)throw Error("Missing required argument: id");this.id=e.id;if(!e.title)throw Error("Missing required argument: title");
var d=e.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");a.appendChild(this.domNode);for(var g=0;g<d.length;g++)this.domNode.classList.add(d[g]);this.domNode.id=e.id;e.canHide&&(this.twistie=document.createElement("span"),this.twistie.classList.add("modelDecorationSprite"),this.twistie.classList.add("layoutLeft"),this.twistie.classList.add("sectionTitleTwistie"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),
this.domNode.tabIndex=0,this.domNode.addEventListener("click",function(a){(a.target===b.titleNode||a.target===b.twistie||a.target===b.domNode)&&b._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===l.KEY.ENTER&&(a.target===b.domNode||a.target===b.titleNode||a.target===b.twistie)&&b._changeExpandedState()},!1));if(e.iconClass){var f=document.createElement("span");f.classList.add("sectionIcon");this.domNode.appendChild(f);d=Array.isArray(e.iconClass)?e.iconClass:
[e.iconClass];d.forEach(function(a){f.classList.add(a)})}e.headerClass&&(d=Array.isArray(e.headerClass)?e.headerClass:[e.headerClass],d.forEach(function(a){this.domNode.classList.add(a)}.bind(this)));this.titleActionsNode=document.createElement("div");this.titleActionsNode.id=e.id+"TitleActionsArea";this.titleActionsNode.classList.add("layoutLeft");this.titleActionsNode.classList.add("sectionActions");this.domNode.appendChild(this.titleActionsNode);this.titleNode=document.createElement("div");this.titleNode.id=
e.id+"Title";this.titleNode.classList.add("sectionAnchor");this.titleNode.classList.add("sectionTitle");this.titleNode.classList.add("layoutLeft");this.domNode.appendChild(this.titleNode);this.titleNode.textContent=e.title;"function"===typeof e.getItemCount&&(d=document.createElement("div"),d.classList.add("layoutLeft"),d.classList.add("sectionItemCount"),this.domNode.appendChild(d),d.textContent=e.getItemCount(this));this._progressNode=document.createElement("div");this._progressNode.id=e.id+"Progress";
this._progressNode.classList.add("sectionProgress");this._progressNode.classList.add("sectionTitle");this._progressNode.classList.add("layoutLeft");this._progressNode.style.display="none";this._progressNode.textContent="...";this.domNode.appendChild(this._progressNode);this.titleLeftActionsNode=document.createElement("div");this.titleLeftActionsNode.id=e.id+"LeftTitleActionsArea";this.titleLeftActionsNode.classList.add("layoutLeft");this.titleLeftActionsNode.classList.add("sectionActions");this.domNode.appendChild(this.titleLeftActionsNode);
d=document.createElement("div");d.id=e.id+"FilterSearchBox";this.domNode.appendChild(d);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=e.id+"ToolActionsArea";this._toolActionsNode.classList.add("layoutRight");this._toolActionsNode.classList.add("sectionActions");this.domNode.appendChild(this._toolActionsNode);this.actionsNode=document.createElement("ul");this.actionsNode.id=e.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("commandList");
this.actionsNode.classList.add("sectionActions");this.domNode.appendChild(this.actionsNode);this.selectionNode=document.createElement("ul");this.selectionNode.id=e.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("commandList");this.selectionNode.classList.add("sectionActions");this.domNode.appendChild(this.selectionNode);e.slideout&&(d=k.slideoutHTMLFragment(e.id),g=document.createRange(),g.selectNode(this.domNode),d=g.createContextualFragment(d),
this.domNode.appendChild(d));this._contentParent=document.createElement("div");this._contentParent.id=this.id+"Content";this._contentParent.role="region";this._contentParent.classList.add("sectionTable");this._contentParent.setAttribute("aria-labelledby",this.titleNode.id);a.appendChild(this._contentParent);e.content&&this.setContent(e.content);"function"===typeof e.onExpandCollapse&&(this._onExpandCollapse=e.onExpandCollapse);this._preferenceService=e.preferenceService;this._collapse();if(this._preferenceService){var h=
this;this._preferenceService.getPreferences("/window/views").then(function(a){a=a.get(h.id);void 0===a?e.hidden||h._expand():a&&h._expand();h._updateExpandedState(!1)})}else e.hidden||this._expand(),this._updateExpandedState(!1);this._commandService=e.commandService;this._lastMonitor=0;this._loading={}}function d(a){this._section=a;this._id=++a._lastMonitor}g.prototype={setTitle:function(a){this.titleNode.textContent=a},getHeaderElement:function(a){return this.domNode},getTitleElement:function(a){return this.titleNode},
getActionElement:function(a){return this._toolActionsNode},setContent:function(a){"string"===typeof a?this._contentParent.innerHTML=a:(this._contentParent.innerHTML="",this._contentParent.appendChild(a))},getContentElement:function(){return this._contentParent},embedExplorer:function(a,e,b){this._contentParent.innerHTML="";a.parent||(a.parent=e);this._contentParent.appendChild(a.parent);a.section=this;f.mixin(a,{createActionSections:function(){this.actionsSections&&this.actionsSections.forEach(function(a){if(!l.node(a)){var b=
document.createElement("ul");b.id=a;b.classList.add("commandList");b.classList.add("layoutRight");this.section.actionsNode.appendChild(b)}}.bind(this))},getCommandsVisible:function(){return"hidden"!==this.section.actionsNode.style.visibility},setCommandsVisible:function(a,b){this.section.actionsNode.style.visibility=a?"":"hidden";void 0===b&&(b=a?null:"cursorOnly");this.renderer.selectionPolicy=b;var e=this.getNavHandler();e&&e.setSelectionPolicy(b);a?this.updateCommands():this.actionsSections&&this.actionsSections.forEach(function(a){l.node(a)&&
this.commandRegistry.destroy(a)}.bind(this))},destroy:function(){Object.getPrototypeOf(this).destroy.call(this);var a=this;this.actionsSections&&(this.actionsSections.forEach(function(b){delete a[b]}),delete this.actionsSections)},updateCommands:function(a){this.section.actionsNode&&this.getCommandsVisible()&&(this.createActionSections(),Object.getPrototypeOf(this).updateCommands.call(this,a))},loaded:function(){var a=this;!this.selection&&!b&&(this.serviceRegistry||this.registry?(this.selection=
new h.Selection(this.serviceRegistry||this.registry,this.parent.id+"Selection"),this.selection.addEventListener("selectionChanged",function(b){a.updateCommands(b.selections)})):window.console.error("Could not create a Selection for the explorer because of lack of serviceRegistry"));var e=this.registerCommands();!e||!e.then?a.updateCommands():e.then(function(){a.updateCommands()})}});a.renderer&&(a.renderer.section=this,f.mixin(a.renderer,{getCellHeaderElement:function(a){(a=Object.getPrototypeOf(this).getCellHeaderElement.call(this,
a))&&this.section.setTitle(a.innerHTML);return null}}))},createProgressMonitor:function(){return new d(this)},_setMonitorMessage:function(a,e){this._progressNode.style.display="block";this._loading[a]=e;var b="",d;for(d in this._loading)""!==b&&(b+="\n"),b+=this._loading[d];this._progressNode.title=b;this._updateExpandedState(!1)},_monitorDone:function(a){delete this._loading[a];a="";for(var e in this._loading)""!==a&&(a+="\n"),a+=this._loading[e];this._progressNode.title=a;""===a&&(this._progressNode.style.display=
"none");this._updateExpandedState(!1)},_changeExpandedState:function(){this.hidden?this._expand():this._collapse();this._updateExpandedState(!0)},_updateExpandedState:function(a){var e=!this.hidden,b=this.working,d=this.twistie,g=this.id;d&&(d.classList.remove(this._expandImageClass),d.classList.remove(this._collapseImageClass),d.classList.remove(this._progressImageClass),d.classList.add(b?this._progressImageClass:e?this._expandImageClass:this._collapseImageClass));this._preferenceService&&a&&this._preferenceService.getPreferences("/window/views").then(function(a){a.put(g,
e)});this._onExpandCollapse&&this._onExpandCollapse(e,this)},_expand:function(){this._contentParent.classList.remove("sectionClosed");this.domNode.classList.remove("sectionClosed");this.hidden=!1},_collapse:function(){this.hidden=!0;this._contentParent.classList.add("sectionClosed");this.domNode.classList.add("sectionClosed")}};g.prototype.constructor=g;d.prototype={begin:function(a){this._section.working=!0;this.status=a;this._section._setMonitorMessage(this.id,a)},worked:function(a){this.status=
a;this._section._setMonitorMessage(this.id,a)},done:function(a){this._section.working=!1;this.status=a;this._section._monitorDone(this.id)}};d.prototype.constructor=d;return{Section:g}});
define("orion/compare/nls/root/messages",{"Copy current change from right to left":"Copy current change from right to left","Copy current change from left to right":"Copy current change from left to right","Switch to unified diff":"Switch to unified diff",Unified:"Unified","Switch to side by side diff":"Switch to side by side diff","Side by side":"Side by side","Generate link of the current diff":"Generate link of the current diff","Generate Link":"Generate Link","Next diff block":"Next diff block",
"Previous diff block":"Previous diff block","Next diff change":"Next diff change","Previous diff change":"Previous diff change","Copy the link URL:":"Copy the link URL:",Compare:"Compare","Open the compare page":"Open the compare page","fetching...":"fetching...","There are unsaved changes.":"There are unsaved changes.","ERROR: ":"ERROR: ","Compare...":"Compare...","files changed":" files changed",Location:"Location",Options:"Options","Sort by folders":"Sort by folders","Line 0 : Col 0":"Line 0 : Col 0",
"No Matching DiffService for location:":"No Matching DiffService for location:","${0} files compared. The two folders are identical.":"${0} files compared. The two folders are identical."});define("orion/compare/nls/messages",["orion/i18n!orion/compare/nls/messages","orion/compare/nls/root/messages"],function(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/compare/compareCommands",["i18n!orion/compare/nls/messages","orion/commands","orion/keyBinding","orion/webui/littlelib"],function(l,n,m,k){var f={};f.CompareCommandFactory=function(){function f(g){this.setOptions(g,!0)}f.prototype={setOptions:function(g,d){d&&(this.options={});this.options||(this.options={});g&&Object.keys(g).forEach(function(a){this.options[a]=g[a]}.bind(this))},getOptions:function(){return this.options},initCommands:function(g){var d=this.options.commandSpanId,a=this.options.commandService;
if(a&&d){var e=new n.Command({name:l["Copy current change from right to left"],tooltip:l["Copy current change from right to left"],imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",visibleWhen:function(a){return"twoWay"===g.type&&!g.getImageMode()&&g.options.newFile&&!g.options.newFile.readonly}.bind(this),callback:function(a){a.items.copyToLeft()}}),b=new n.Command({name:l["Copy current change from left to right"],tooltip:l["Copy current change from left to right"],
imageClass:"core-sprite-rightarrow",id:"orion.compare.copyToRight",groupId:"orion.compareGroup",visibleWhen:function(a){return"twoWay"===g.type&&!g.getImageMode()&&g.options.oldFile&&!g.options.oldFile.readonly}.bind(this),callback:function(a){a.items.copyToRight()}}),f=new n.Command({tooltip:l["Switch to unified diff"],name:l.Unified,id:"orion.compare.toggle2Inline",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&"twoWay"===a.options.toggler.getWidget().type},callback:function(a){a.items.options.toggler.toggle()}}),
h=new n.Command({tooltip:l["Switch to side by side diff"],name:l["Side by side"],id:"orion.compare.toggle2TwoWay",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&"inline"===a.options.toggler.getWidget().type},callback:function(a){a.items.options.toggler.toggle()}}),k=new n.Command({name:l["Next diff block"],tooltip:l["Next diff block"],imageClass:"core-sprite-move-down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",visibleWhen:function(a){return!g.getImageMode()},
callback:function(a){a.items.nextDiff()}}),s=new n.Command({name:l["Previous diff block"],tooltip:l["Previous diff block"],imageClass:"core-sprite-move-up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",visibleWhen:function(a){return!g.getImageMode()},callback:function(a){a.items.prevDiff()}}),y=new n.Command({name:l["Next diff change"],tooltip:l["Next diff change"],imageClass:"core-sprite-move-down",id:"orion.compare.nextChange",groupId:"orion.compareGroup",visibleWhen:function(a){return!g.getImageMode()},
callback:function(a){a.items.nextChange()}}),r=new n.Command({name:l["Previous diff change"],tooltip:l["Previous diff change"],imageClass:"core-sprite-move-up",id:"orion.compare.prevChange",groupId:"orion.compareGroup",visibleWhen:function(a){return!g.getImageMode()},callback:function(a){a.items.prevChange(a)}});a.addCommand(e);a.addCommand(b);a.addCommand(h);a.addCommand(f);a.addCommand(k);a.addCommand(s);a.addCommand(y);a.addCommand(r);a.registerCommandContribution(d,"orion.compare.toggle2Inline",
108);a.registerCommandContribution(d,"orion.compare.toggle2TwoWay",109);a.registerCommandContribution(d,"orion.compare.copyToLeft",110,null,!1,new m.KeyBinding(37,!0,!1,!0));a.registerCommandContribution(d,"orion.compare.copyToRight",111,null,!1,new m.KeyBinding(39,!0,!1,!0));a.registerCommandContribution(d,"orion.compare.nextDiff",112,null,!1,new m.KeyBinding(40,!0));a.registerCommandContribution(d,"orion.compare.prevDiff",113,null,!1,new m.KeyBinding(38,!0));g.options.wordLevelNav?(a.registerCommandContribution(d,
"orion.compare.nextChange",114,null,!1,new m.KeyBinding(40,!0,!0)),a.registerCommandContribution(d,"orion.compare.prevChange",115,null,!1,new m.KeyBinding(38,!0,!0))):(a.registerCommandContribution(d,"orion.compare.nextChange",114,null,!0,new m.KeyBinding(40,!0,!0)),a.registerCommandContribution(d,"orion.compare.prevChange",115,null,!0,new m.KeyBinding(38,!0,!0)))}},renderCommands:function(g){var d=this.options.commandSpanId,a=this.options.commandService;a&&d&&(k.empty(k.node(d)),this.options.gridRenderer&&
this.options.gridRenderer.navGridHolder?(this.options.gridRenderer.navGridHolder.splice(0,this.options.gridRenderer.navGridHolder.length),this.options.gridRenderer.additionalCmdRender?this.options.gridRenderer.before?(this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder),a.renderCommands(d,d,g,g,"tool",null,this.options.gridRenderer.navGridHolder)):(a.renderCommands(d,d,g,g,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):
a.renderCommands(d,d,g,g,"tool",null,this.options.gridRenderer.navGridHolder)):a.renderCommands(d,d,g,g,"tool",null))}};return f}();return f});
define("orion/compare/compareUtils",["orion/URITemplate"],function(l){var n=n||{};n.compareUtils=n.compareUtils||{};n.compareUtils.lookUpMapper=function(l,k,f){for(var h=0,g=0;g<l.length;g++){var d=l[g][k];0===d&&(d=1);if(f>=h&&f<h+d)return{mapperIndex:g,startFrom:h};if(g===l.length-1)break;h+=l[g][k]}return{mapperIndex:l.length-1,startFrom:h}};n.compareUtils.lookUpLineIndex=function(l,k,f){if(0===f)return 0;for(var h=0,g=0;g<f;g++)h+=l[g][k];return h};n.compareUtils.updateMapper=function(l,k,f,h,
g){if(h!==g&&(0<h||0<g)){var d=n.compareUtils.lookUpMapper(l,k,f);if(!(0>d.mapperIndex)){if(0<h){var a=f-d.startFrom;for(f=d.mapperIndex;f<l.length;f++){a=l[f][k]-a;if(h<=a){l[f][k]-=h;break}l[f][k]-=a;h-=a;a=0}}0<g&&(l[d.mapperIndex][k]+=g)}}};n.compareUtils.overlapMapper=function(l,k,f,h,g){l=f+l[k]-1;l<f&&(l=f);g<h&&(g=h);return l<h||g<f?!1:!0};n.compareUtils.findFirstDiff=function(l,k,f,h){for(var g=0,d=null,a=0;a<l.length&&!(g>h)&&(!n.compareUtils.overlapMapper(l[a],k,g,f,h)||!(d={mapperIndex:a,
startFrom:g},0!==l[a][2]));a++)g+=l[a][k];return d};n.compareUtils.matchMapper=function(l,k,f,h){if(0===l.length)return f;var g=f+Math.round((h-f)/3),d=n.compareUtils.findFirstDiff(l,k,f,h),a=0===l[d.mapperIndex][k]?d.startFrom:d.startFrom+l[d.mapperIndex][k]-1,e=n.compareUtils.lookUpLineIndex(l,1-k,d.mapperIndex),b=d.startFrom-f;return 0===l[d.mapperIndex][2]?e-b:g>=d.startFrom&&g<=a?e-Math.round((h-f)/3):g<d.startFrom?e-b:(0===l[d.mapperIndex][1-k]?e:e+l[d.mapperIndex][1-k]-1)-(a-f)};n.compareUtils.getMapperLineCount=
function(l){for(var k=0,f=0;f<l.length;f++)k+=Math.max(l[f][0],l[f][1]);return k};n.compareUtils.getAnnotationIndex=function(l,k){for(var f=0;f<l.length;f++)if(l[f][0]===k)return f;return-1};n.compareUtils.getAnnotationMapperIndex=function(l,k){return l[k][1]};n.compareUtils.getAnnotationIndexByMapper=function(l,k){for(var f=0;f<l.length;f++)if(l[f][1]===k)return{current:f,prev:f-1,next:f+1};return{current:-1,prev:-1,next:-1}};n.compareUtils.isMapperConflict=function(l,k){return 0>k||!l[k][3]?!1:
1===l[k][3]};n.compareUtils.mergeDiffBlocks=function(l,k,f,h,g,d){for(var a=0;a<k.length;a++){var e=k[a][0],b=f[k[a][1]];if(0<b[0]){for(var p="",q=0;q<b[0];q++)p=p+h[b[2]-1+q].substring(g)+d;b=l.getLineCount();e>=b&&(e=l.getLineEnd(b-1),q=l.getLineEnd(b-1,!0),e===q?(l.setText(d,e,e),e=b):e=b-1);e=l.getLineStart(e);l.setText(p,e,e)}}};n.compareUtils.generateCompareHref=function(m,k){var f=require.toUrl("compare/compare.html");k.conflict||(k.conflict=void 0);k.readonly||(k.readonly=void 0);return(new l(f+
"#{,resource,params*}")).expand({resource:m,params:k})};n.compareUtils.generateCompareTreeHref=function(m,k){var f=require.toUrl("compare-tree/compare-tree.html");return(new l(f+"#{,resource,params*}")).expand({resource:m,params:k})};return n.compareUtils});
define("orion/compare/diffProvider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(l,n){function m(f,h,g){var d=new n;f[h].apply(f,g).then(function(a){d.resolve(a)},function(a){d.reject(a)});return d}function k(f,h){var g=f.getServiceReferences("orion.core.diff"),d,a=g;if(h){a=[];for(d=0;d<g.length;++d)h(g[d])&&a.push(g[d])}var e=[],b=[];for(d=0;d<a.length;++d)e[d]=RegExp(a[d].getProperty("pattern")||".*"),b[d]=f.getService(a[d]);this._getService=function(a){if(-1===a.indexOf("://")){var d=
document.createElement("a");d.href=a;a=d.href}for(d=0;d<e.length;++d)if(e[d].test(a))return b[d];throw l["No Matching DiffService for location:"]+a;}}k.prototype={getDiffContent:function(f){return m(this._getService(f),"getDiffContent",arguments)},getDiffFileURI:function(f){return m(this._getService(f),"getDiffFileURI",arguments)}};return{DiffProvider:k}});
define("orion/compare/diffParser",[],function(){var l=l||{};l.DiffParser=function(){function l(k,f){this._lineDelimiter=k?k:m?"\r\n":"\n";this._diffLineDelimiter=f?f:this._lineDelimiter;this._DEBUG=!1}var m=-1!==window.navigator.platform.indexOf("Win");l.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=!0;this._diffContentIndex=
1},setLineDelim:function(k){this._diffLineDelimiter=this._lineDelimiter=k},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(k,f,h,g){this._init();if(""===f)return{outPutFile:k,mapper:[]};this._oFileContents=""===k?[]:k.split(this._lineDelimiter);this._diffContents=f.split(this._diffLineDelimiter);f=this._diffContents.length;this._hunkRanges=[];for(var d=0;d<f;d++){var a=this._parseHunkRange(d);a&&this._hunkRanges.push(a)}if(0===this._hunkRanges.length)return{outPutFile:k,
mapper:[]};this._DEBUG&&(console.log("***Diff contents: \n"),this._diffContents.forEach(function(a){console.log(a)}),console.log("***Hunk ranges: \n"),console.log(JSON.stringify(this._hunkRanges)));for(k=0;k<this._hunkRanges.length;k++)this._parseHunkBlock(k);this._DEBUG&&(console.log("***Original Hunk range blocks: \n"),console.log(JSON.stringify(this._oBlocks)),console.log("***New Hunk range blocks: \n"),console.log(JSON.stringify(this._nBlocks)));this._buildMap(h);this._DEBUG&&(console.log("***New Line at end of file(original): \n"),
console.log(JSON.stringify(this._oNewLineAtEnd)),console.log("***New Line at end of file(new): \n"),console.log(JSON.stringify(this._nNewLineAtEnd)),console.log("***Mapper: \n"),this._logMap(),console.log("***Total line number in original file: "+this._oFileContents.length));g||this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var k=0;k<this._deltaMap.length;k++)if(console.log(JSON.stringify(this._deltaMap[k])),
0<this._deltaMap[k][2]){console.log("    **Diff content on change/add: \n");for(var f=0;f<this._deltaMap[k][0];f++)console.log("    "+this._diffContents[this._deltaMap[k][2]+f-1])}},_logNewFile:function(){for(var k=0;k<this._nFileContents.length;k++)console.log(this._nFileContents[k])},_createBlock:function(k,f,h,g){g===h&&" "===k||(h=[h,g-h,"s"],"-"===k?h[2]="r":"+"===k?h[2]="a":"c"===k&&(h[2]="c"),f.push(h))},_createMinusBlock:function(k,f,h){var g=this._oBlocks.length;0===g||k!==this._oBlocks[g-
1][0]?(this._oBlocks.push([0===k?1:k,h]),this._nBlocks.push([f,0,-2])):this._oBlocks[g-1][1]+=h},_createPlusBlock:function(k,f,h,g){var d=this._nBlocks.length;0===d||f!==this._nBlocks[d-1][0]?(this._oBlocks.push([0===k?1:k,0]),this._nBlocks.push([f,h,g])):(this._nBlocks[d-1][1]+=h,this._nBlocks[d-1][2]=g)},_parseHunkBlock:function(k){for(var f=" ",h=this._hunkRanges[k][0]+1,g=k===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[k+1][0],d=0,a=0,e=this._hunkRanges[k][1],b=this._hunkRanges[k][3],
p=h,l=h;l<g;l++)if(0!==this._diffContents[l].length){var t=this._diffContents[l][0];if("\\"===t&&("\\ No newline at end of file"===this._diffContents[l].substring(0,this._diffContents[l].length-1)||"\\ No newline at end of file"===this._diffContents[l]))"-"===f?this._oNewLineAtEnd=!1:" "===f?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,l>h&&"\r"===this._diffContents[l-1][this._diffContents[l-1].length-1]&&(this._diffContents[l-1]=this._diffContents[l-1].substring(0,this._diffContents[l-
1].length-1));else{switch(t){case "-":case "+":case " ":break;default:continue}if(f!==t){"+"===t&&(p=l);switch(f){case " ":e=this._hunkRanges[k][1]+d;b=this._hunkRanges[k][3]+a;break;case "-":this._createMinusBlock(e,b,this._hunkRanges[k][1]+d-e);break;case "+":this._createPlusBlock(e,b,this._hunkRanges[k][3]+a-b,p)}f=t}switch(t){case "-":d++;break;case "+":a++;break;case " ":d++,a++}}}switch(f){case "-":this._createMinusBlock(e,b,this._hunkRanges[k][1]+d-e);break;case "+":this._createPlusBlock(e,
b,this._hunkRanges[k][3]+a-b,p)}},_detectConflictes:function(k,f){if(0>k)return!1;for(var h=k+f,g=k;g<h;g++){var d=this._diffContents[g];if(-1<d.indexOf("\x3c\x3c\x3c\x3c\x3c")||-1<d.indexOf("\x3e\x3e\x3e\x3e\x3e"))return!0}return!1},_buildMap:function(k){var f=this._oBlocks.length,h=this._oFileContents.length,g=0,d;d=1;for(var a=0;a<f;a++)d=this._oBlocks[a][0]-d,0<d&&(this._deltaMap.push([d,d,0]),g+=d),k&&this._detectConflictes(this._nBlocks[a][2],this._nBlocks[a][1])?this._deltaMap.push([this._nBlocks[a][1],
this._oBlocks[a][1],this._nBlocks[a][2]+1,1]):this._deltaMap.push([this._nBlocks[a][1],this._oBlocks[a][1],this._nBlocks[a][2]+1]),g+=this._oBlocks[a][1],d=this._oBlocks[a][0]+this._oBlocks[a][1];0<h-d&&(this._deltaMap.push([h-d+1,h-d+1,0]),g+=h-d+1);g<h&&(d=h-g,k=this._deltaMap[this._deltaMap.length-1],0===k[2]?(k[0]+=d,k[1]+=d):-1===k[2]?this._deltaMap.push([d,d,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([d,d,0]):(this._nNewLineAtEnd&&(k[0]+=d),this._oNewLineAtEnd&&(k[1]+=
d)))},_buildNewFile:function(){var k=1,f=!1,h=this._deltaMap.length,g,d;for(g=0;g<h;g++){f=!1;if(0===this._deltaMap[g][2]){for(d=0;d<this._deltaMap[g][0];d++)this._nFileContents.push(this._oFileContents[k+d-1]);f=!0}else if(0<this._deltaMap[g][2])for(d=0;d<this._deltaMap[g][0];d++)this._nFileContents.push(this._diffContents[this._deltaMap[g][2]+d-1].substring(1));k+=this._deltaMap[g][1]}this._nNewLineAtEnd&&!f&&this._nFileContents.push("")},_converHRangeBody:function(k,f){if(k){var h=parseInt(k,10);
f.push(0<=h?h:1)}else f.push(1)},_parseHunkRange:function(k){var f=this._diffContents[k],h=/^@@\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/,g=/^@@\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/.exec(f),d=null;if(g&&5===g.length)d=[k],this._converHRangeBody(g[1],d),this._converHRangeBody(g[2],d),this._converHRangeBody(g[3],d),this._converHRangeBody(g[4],d);else if((g=h.exec(f))&&5===g.length)d=[k],this._converHRangeBody(g[3],d),this._converHRangeBody(g[4],
d),this._converHRangeBody(g[1],d),this._converHRangeBody(g[2],d);return d}};return l}();return l});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(l){var n=n||{};n.CompareRuler=function(){function l(k,f,h){this._location=k||"left";this._overview=f||"page";this._rulerStyle=h;this._editor=null;var g=this;this._listener={onModelChanged:function(d){g._onModelChanged(d)}}}l.prototype={setView:function(k){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=k;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",
this._listener.onModelChanged)},getLocation:function(){return this._location},getOverview:function(k){return this._overview},getAnnotationModel:function(){return null},addAnnotationType:function(k){},isAnnotationTypeVisible:function(k){return!1},removeAnnotationType:function(k){},setAnnotationModel:function(k){},getAnnotations:function(k,f){for(var h=[],g=k;g<f;g++){var d=this.getStyle(g);d&&(h[g]={html:this.getHTML(g),style:d})}return h},getWidestAnnotation:function(){return{html:this.getHTML(-1),
style:this.getStyle(-1)}},getRulerStyle:function(){return this.getStyle(void 0)}};return l}();n.LineNumberCompareRuler=function(){function l(k,f,h,g,d,a){n.CompareRuler.call(this,h,"page",g);this._diffNavigator=k;this._oddStyle=d||{style:{backgroundColor:"white"}};this._evenStyle=a||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=f}l.prototype=new n.CompareRuler;l.prototype.getStyle=function(k){return void 0===k?this._rulerStyle:this._evenStyle};l.prototype.getHTML=function(k){var f=
this._editor.getModel(),h=this._diffNavigator.getFeeder(0===this._mapperColumnIndex);return!h?"":-1===k?f.getLineCount():h.getLineNumber?(k=h.getLineNumber(k),-1===k?"":k+1):k+1};l.prototype._onModelChanged=function(k){var f=k.start,h=this._editor.getModel();k=h.getLineCount();var g=(k+"").length;this._numOfDigits!==g&&(this._numOfDigits=g,f=h.getLineAtOffset(f),this._editor.redrawLines(f,k,this))};return l}();n.CompareOverviewRuler=function(){function m(k,f,h,g){this._diffNavigator=h;this._onClick=
g;n.CompareRuler.call(this,k,"document",f)}m.prototype=new n.CompareRuler;m.prototype.getStyle=function(k){var f,h;if(void 0===k)f=this._rulerStyle||{},h=f.style||(f.style={}),h.lineHeight="1px",h.fontSize="1px",h.width="14px";else if(f=-1!==k?{styleClass:"annotationOverview breakpoint"}:{},h=f.style||(f.style={}),h.cursor="pointer",h.width="8px",h.left="2px",0<=k){var g;if(this._diffNavigator&&this._diffNavigator.getFeeder())g=this._diffNavigator.getFeeder().getDiffBlocks();else return null;k=l.getAnnotationIndex(g,
k);if(-1===k)return null;g=l.getAnnotationMapperIndex(g,k);var d;d=this._diffNavigator.getMapper();if(g=l.isMapperConflict(d,g))h.border="1px #FF0000 solid";k===this._diffNavigator.getCurrentBlockIndex()&&(h.backgroundColor=g?"red":"blue");k=this._diffNavigator.getFeeder().getDiffBlockH(k);g=this._diffNavigator.getFeeder().getOverviewLineCount();if(0>k)return null;d=this._editor.getClientArea();k=Math.floor(d.height*k/g);2>k&&(k=2);h.height=k+"px"}else return null;return f};m.prototype.setDiffNavigator=
function(k){this._diffNavigator=k};m.prototype.getHTML=function(k){return"\x26nbsp;"};m.prototype.onClick=function(k,f){void 0!==k&&this._onClick(k,this)};m.prototype._onModelChanged=function(k){0<this._editor.getModel().getLineCount()&&this._editor.redrawLines(0,1,this)};return m}();n.CompareCurveRuler=function(){function m(k){this._canvasDiv=k;this._mapper=void 0}m.prototype={init:function(k,f,h,g){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=k;this._leftEditor=f;this._rightEditor=
h;this._leftTextView=f.getTextView();this._rightTextView=h.getTextView();this._diffNavigator=g;this.render()},matchPositionFrom:function(k){var f=k?this._leftTextView:this._rightTextView,h=k?this._rightTextView:this._leftTextView,g=f.getTopIndex(),f=f.getBottomIndex();k=l.matchMapper(this._mapper,k?0:1,g,f);h.setTopIndex(k)},copyTo:function(k){if(this._diffNavigator.iterator){var f=this._diffNavigator.iterator.cursor();if(f&&("word"===f.type?!f.copied&&!f.parent.copied:!f.copied)){var h=k?this._rightTextView.getText(f.oldA.start,
f.oldA.end):this._leftTextView.getText(f.newA.start,f.newA.end),g=k?f.newA:f.oldA;(k?this._leftTextView:this._rightTextView).setText(h,g.start,g.end);f.copied=!0}}},render:function(){if(this._mapper){var k=this._canvasDiv.getContext("2d");k.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);k.strokeStyle="#AAAAAA";k.lineWidth=1;k.beginPath();var f=this._leftTextView.getTopIndex(),h=this._leftTextView.getBottomIndex(),g=this._rightTextView.getTopIndex(),d=this._rightTextView.getBottomIndex();
this._leftLineH=this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();for(var a=0,e=0,b=!1,p=0;p<this._mapper.length;p++){if(0!==this._mapper[p][2])if(l.overlapMapper(this._mapper[p],0,a,f,h)||l.overlapMapper(this._mapper[p],1,e,g,d))this._renderCurve(p,a,e,this._canvasDiv,k,f,h,g,d),b=!0;else if(b)break;a+=this._mapper[p][0];e+=this._mapper[p][1]}k.stroke()}},_renderCurve:function(k,f,h,g,d,a,e,b,p){a=this._mapper[k];f=this._leftTextView.getLinePixel(f+a[0]/2)+a[0]%
2*this._leftLineH/3-this._leftTextView.getTopPixel();h=this._rightTextView.getLinePixel(h+a[1]/2)+a[1]%2*this._rightLineH/3-this._rightTextView.getTopPixel();g=g.parentNode.clientWidth;k===this._diffNavigator.getCurrentMapperIndex()?(d.stroke(),d.strokeStyle="#000",d.lineWidth=1,d.beginPath(),d.moveTo(0,f),d.bezierCurveTo(g/3,f,0.666*g,h,g,h),d.stroke(),d.strokeStyle="#AAAAAA",d.lineWidth=1,d.beginPath()):(d.moveTo(0,f),d.bezierCurveTo(g/3,f,0.666*g,h,g,h),d.stroke())},onChanged:function(k,f){var h=
f?this._rightIniting:this._leftIniting;if(k.removedLineCount!==k.addedLineCount){var g=f?this._rightTextView:this._leftTextView;h||l.updateMapper(this._mapper,f?1:0,g.getModel().getLineAtOffset(k.start),k.removedLineCount,k.addedLineCount);(0<k.removedLineCount||0<k.addedLineCount)&&this.render()}f?this._rightIniting=!1:this._leftIniting=!1;return h}};return m}();return n});
define("orion/editor/i18n",{load:function(l,n,m,k){n.specified&&n.specified("orion/bootstrap")?n(["orion/i18n!"+l],function(f){m(f)}):n(["orion/editor/config"],function(f){m(f&&f.languages||{})})}});
define("orion/editor/nls/root/messages",{multipleAnnotations:"Multiple annotations:",line:"Line: ${0}",breakpoint:"Breakpoint",bookmark:"Bookmark",task:"Task",error:"Error",warning:"Warning",matchingSearch:"Matching Search",currentSearch:"Current Search",currentLine:"Current Line",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",lineUp:"Line Up",lineDown:"Line Down",lineStart:"Line Start",lineEnd:"Line End",charPrevious:"Previous Character",charNext:"Next Character",pageUp:"Page Up",
pageDown:"Page Down",scrollPageUp:"Scroll Page Up",scrollPageDown:"Scroll Page Down",scrollLineUp:"Scroll Line Up",scrollLineDown:"Scroll Line Down",wordPrevious:"Previous Word",wordNext:"Next Word",textStart:"Document Start",textEnd:"Document End",scrollTextStart:"Scroll Document Start",scrollTextEnd:"Scroll Document End",centerLine:"Center Line",selectLineUp:"Select Line Up",selectLineDown:"Select Line Down",selectWholeLineUp:" Select Whole Line Up",selectWholeLineDown:"Select Whole Line Down",
selectLineStart:"Select Line Start",selectLineEnd:"Select Line End",selectCharPrevious:"Select Previous Character",selectCharNext:"Select Next Character",selectPageUp:"Select Page Up",selectPageDown:"Select Page Down",selectWordPrevious:"Select Previous Word",selectWordNext:"Select Next Word",selectTextStart:"Select Document Start",selectTextEnd:"Select Document End",deletePrevious:"Delete Previous Character",deleteNext:"Delete Next Character",deleteWordPrevious:"Delete Previous Word",deleteWordNext:"Delete Next Word",
deleteLineStart:"Delete Line Start",deleteLineEnd:"Delete Line End",tab:"Insert Tab",enter:"Insert Line Delimiter",enterNoCursor:"Insert Line Delimiter",selectAll:"Select All",copy:"Copy",cut:"Cut",paste:"Paste",uppercase:"To Upper Case",lowercase:"To Lower Case",capitalize:"Capitalize",reversecase:"Reverse Case",toggleWrapMode:"Toggle Wrap Mode",toggleTabMode:"Toggle Tab Mode",toggleOverwriteMode:"Toggle Overwrite Mode",committerOnTime:"${0} on ${1}",emacs:"Emacs",exchangeMarkPoint:"Exchange Mark and Point",
setMarkCommand:"Set Mark",clearMark:"Clear Mark",digitArgument:"Digit Argument ${0}",negativeArgument:"Negative Argument",Comment:"Comment","Flat outline":"Flat outline",incrementalFindStr:"Incremental find: ${0}",incrementalFindStrNotFound:"Incremental find: ${0} (not found)",incrementalFindReverseStr:"Reverse Incremental find: ${0}",incrementalFindReverseStrNotFound:"Reverse Incremental find: ${0} (not found)",find:"Find...",undo:"Undo",redo:"Redo",cancelMode:"Cancel Current Mode",findNext:"Find Next Occurrence",
findPrevious:"Find Previous Occurrence",incrementalFind:"Incremental Find",incrementalFindReverse:"Incremental Find Reverse",indentLines:"Indent Lines",unindentLines:"Unindent Lines",moveLinesUp:"Move Lines Up",moveLinesDown:"Move Lines Down",copyLinesUp:"Copy Lines Up",copyLinesDown:"Copy Lines Down",deleteLines:"Delete Lines",gotoLine:"Goto Line...",gotoLinePrompty:"Goto Line:",nextAnnotation:"Next Annotation",prevAnnotation:"Previous Annotation",expand:"Expand",collapse:"Collapse",expandAll:"Expand All",
collapseAll:"Collapse All",lastEdit:"Last Edit Location",trimTrailingWhitespaces:"Trim Trailing Whitespaces",toggleLineComment:"Toggle Line Comment",addBlockComment:"Add Block Comment",removeBlockComment:"Remove Block Comment",linkedModeEntered:"Linked Mode entered",linkedModeExited:"Linked Mode exited",syntaxError:"Syntax Error",contentAssist:"Content Assist",lineColumn:"Line ${0} : Col ${1}",vi:"vi",vimove:"(Move)",viyank:"(Yank)",videlete:"(Delete)",vichange:"(Change)",viLeft:"${0} Left",viRight:"${0} Right",
viUp:"${0} Up",viDown:"${0} Down",viw:"${0} Next Word",vib:"${0} Beginning of Word",viW:"${0} Next Word (ws stop)",viB:"${0} Beginning of Word (ws stop)",vie:"${0} End of Word",viE:"${0} End of Word (ws stop)",vi$:"${0} End of the line","vi^_":"${0} First non-blank Char Current Line","vi+":"${0} First Char Next Line","vi-":"${0} First Char Previous Line","vi|":"${0} nth Column in Line",viH:"${0} Top of Page",viM:"${0} Middle of Page",viL:"${0} Bottom of Page","vi/":"${0} Search Forward","vi?":"${0} Search Backward",
vin:"${0} Next Search",viN:"${0} Previous Search",vif:"${0} Search Char Fwd",viF:"${0} Search Char Bckwd",vit:"${0} Search Before Char Fwd",viT:"${0} Search Before Char Bckwd","vi,":"${0} Repeat Reverse Char Search","vi;":"${0} Repeat Char Search",viG:"${0} Go to Line",viycd:"${0} Current Line",via:"Append After Cursor",viA:"Append to End of Line",vii:"Insert Before Cursor",viI:"Insert at Beginning of Line",viO:"Insert Line Above",vio:"Insert Line Below",viR:"Begin Overwriting Text",vis:"Substitute a Character",
viS:"Substitute Entire Line",viC:"Change Text Until Line End",vip:"Paste After Char or Line",viP:"Paste Before Char or Line",viStar:"Search Word Under Cursor",next:"Next",previous:"Previous",replace:"Replace",replaceAll:"Replace All",findWith:"Find With",replaceWith:"Replace With",caseInsensitive:"Aa",regex:"/.*/",wholeWord:"\\b",caseInsensitiveTooltip:"Toggle Case Insensitive",regexTooltip:"Toogle Regex",wholeWordTooltip:"Toggle Whole Word",closeTooltip:"Close",replacingAll:"Replacing all...",replacedMatches:"Replaced ${0} matches",
nothingReplaced:"Nothing replaced",notFound:"Not found"});define("orion/editor/nls/messages",["orion/editor/i18n!orion/editor/nls/messages","orion/editor/nls/root/messages"],function(l,n){var m={root:n},k;for(k in l)l.hasOwnProperty(k)&&"undefined"===typeof m[k]&&(m[k]=l[k]);return m});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/regex","orion/util"],function(l,n,m){function k(f,h){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(f);this.setLineDelimiter(h)}k.prototype={destroy:function(){},find:function(f){1<this._text.length&&(this._text=[this._text.join("")]);var h=f.string,g=f.regex,d=h,a="",e=f.caseInsensitive;if(d)if(g){if(h=n.parse(d))d=h.pattern,a=h.flags}else d=h.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$\x26"),e&&(d=d.replace(/[iI\u0130\u0131]/g,
"[Ii\u0130\u0131]"));var b=null,p;if(d){var h=f.reverse,k=f.wrap,g=f.wholeWord,l=f.start||0;f=f.end;var s=null!==f&&void 0!==f;-1===a.indexOf("g")&&(a+="g");-1===a.indexOf("m")&&(a+="m");e&&-1===a.indexOf("i")&&(a+="i");g&&(d="\\b"+d+"\\b");var m=this._text[0],r,x,u=0;s&&(e=l<f?l:f,m=m.substring(e,l<f?f:l),u=e);var w=RegExp(d,a);h?p=function(){var a=null;for(w.lastIndex=0;;){x=w.lastIndex;r=w.exec(m);if(x===w.lastIndex)return null;if(r){if(!(r.index+u<l)){if(!k||a)break;l=m.length+u}a={start:r.index+
u,end:w.lastIndex+u}}else break}a&&(l=a.start);return a}:(s||(w.lastIndex=l),p=function(){for(;;){x=w.lastIndex;r=w.exec(m);if(x===w.lastIndex)break;if(r)return{start:r.index+u,end:w.lastIndex+u};if(!(0!==x&&k))break}return null});b=p()}return{next:function(){var a=b;a&&(b=p());return a},hasNext:function(){return null!==b}}},getCharCount:function(){for(var f=0,h=0;h<this._text.length;h++)f+=this._text[h].length;return f},getLine:function(f,h){var g=this.getLineCount();if(!(0<=f&&f<g))return null;
var d=this._lineOffsets[f];if(f+1<g){g=this.getText(d,this._lineOffsets[f+1]);if(h)return g;for(var d=g.length,a;10===(a=g.charCodeAt(d-1))||13===a;)d--;return g.substring(0,d)}return this.getText(d)},getLineAtOffset:function(f){var h=this.getCharCount();if(!(0<=f&&f<=h))return-1;var g=this.getLineCount();if(f===h)return g-1;var d,a,e=this._lastLineIndex;if(0<=e&&e<g&&(d=this._lineOffsets[e],a=e+1<g?this._lineOffsets[e+1]:h,d<=f&&f<a))return e;for(var b=g,p=-1;1<b-p;)if(e=Math.floor((b+p)/2),d=this._lineOffsets[e],
a=e+1<g?this._lineOffsets[e+1]:h,f<=d)b=e;else if(f<a){b=e;break}else p=e;return this._lastLineIndex=b},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(f,h){var g=this.getLineCount();if(!(0<=f&&f<g))return-1;if(f+1<g){g=this._lineOffsets[f+1];if(h)return g;for(var d=this.getText(Math.max(this._lineOffsets[f],g-2),g),a=d.length,e;10===(e=d.charCodeAt(a-1))||13===e;)a--;return g-(d.length-a)}return this.getCharCount()},
getLineStart:function(f){return!(0<=f&&f<this.getLineCount())?-1:this._lineOffsets[f]},getText:function(f,h){void 0===f&&(f=0);void 0===h&&(h=this.getCharCount());if(f===h)return"";for(var g=0,d=0,a;d<this._text.length;){a=this._text[d].length;if(f<=g+a)break;g+=a;d++}for(var e=g,b=d;d<this._text.length;){a=this._text[d].length;if(h<=g+a)break;g+=a;d++}if(b===d)return this._text[b].substring(f-e,h-g);e=this._text[b].substring(f-e);g=this._text[d].substring(0,h-g);return e+this._text.slice(b+1,d).join("")+
g},onChanging:function(f){return this.dispatchEvent(f)},onChanged:function(f){return this.dispatchEvent(f)},setLineDelimiter:function(f,h){"auto"===f&&(f=void 0,1<this.getLineCount()&&(f=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=f?f:m.platformDelimiter;if(h){var g=this.getLineCount();if(1<g){for(var d=Array(g),a=0;a<g;a++)d[a]=this.getLine(a);this.setText(d.join(this._lineDelimiter))}}},setText:function(f,h,g){void 0===f&&(f="");void 0===h&&(h=0);void 0===g&&(g=
this.getCharCount());if(!(h===g&&""===f)){for(var d=this.getLineAtOffset(h),a=this.getLineAtOffset(g),e=h,b=g-h,p=a-d,k=f.length,l=0,s=this.getLineCount(),m=0,n=0,x=0,u=[];;){-1!==m&&m<=x&&(m=f.indexOf("\r",x));-1!==n&&n<=x&&(n=f.indexOf("\n",x));if(-1===n&&-1===m)break;x=-1!==m&&-1!==n?m+1===n?n+1:(m<n?m:n)+1:-1!==m?m+1:n+1;u.push(h+x);l++}this.onChanging({type:"Changing",text:f,start:e,removedCharCount:b,addedCharCount:k,removedLineCount:p,addedLineCount:l});0===u.length&&(x=this.getLineStart(d),
a=a+1<s?this.getLineStart(a+1):this.getCharCount(),h!==x&&(f=this.getText(x,h)+f,h=x),g!==a&&(f+=this.getText(g,a),g=a));x=k-b;for(a=d+p+1;a<s;a++)this._lineOffsets[a]+=x;if(5E4>u.length)d=[d+1,p].concat(u),Array.prototype.splice.apply(this._lineOffsets,d);else{x=d+1;this._lineOffsets.splice(x,p);for(s=0;s<u.length;s+=5E4)d=[x,0].concat(u.slice(s,Math.min(u.length,s+5E4))),Array.prototype.splice.apply(this._lineOffsets,d),x+=5E4}for(x=s=0;x<this._text.length;){a=this._text[x].length;if(h<=s+a)break;
s+=a;x++}d=s;for(u=x;x<this._text.length;){a=this._text[x].length;if(g<=s+a)break;s+=a;x++}a=this._text[x];h=this._text[u].substring(0,h-d);g=a.substring(g-s);u=[u,x-u+1];h&&u.push(h);f&&u.push(f);g&&u.push(g);Array.prototype.splice.apply(this._text,u);0===this._text.length&&(this._text=[""]);this.onChanged({type:"Changed",start:e,removedCharCount:b,addedCharCount:k,removedLineCount:p,addedLineCount:l})}}};l.EventTarget.addMixin(k.prototype);return{TextModel:k}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(l,n){function m(f){f&&(this._view=f,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0)}function k(f){m.call(this,f)}m.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(f){for(var h=[],g=this._keyBindings,d=0;d<g.length;d++)g[d].actionID===f&&h.push(g[d].keyBinding);return h},getView:function(){return this._view},isActive:function(){return-1!==this._view.getKeyModes().indexOf(this)},match:function(f){if("keydown"===
f.type)switch(f.keyCode){case 16:case 17:case 18:case 91:return}for(var h=this._keyBindingIndex,g=this._matchingKeyBindings||this._keyBindings,d=[],a=0;a<g.length;a++){var e=g[a],b=e.keyBinding.match(f,h);if(!0===b)return this._keyBindingIndex=0,this._matchingKeyBindings=null,e.actionID;"number"===typeof b&&d.push(e)}if(0===d.length)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=d,"noop"},setKeyBinding:function(f,h){for(var g=this._keyBindings,
d=0;d<g.length;d++){var a=g[d];if(a.keyBinding.equals(f)){h?a.actionID=h:a.predefined?a.actionID="noop":g.splice(d,1);return}}h&&g.push({keyBinding:f,actionID:h})},setView:function(f){this._view=f}};k.prototype=new m;k.prototype.createKeyBindings=function(){var f=l.KeyBinding,h=[];h.push({actionID:"lineUp",keyBinding:new f(38),predefined:!0});h.push({actionID:"lineDown",keyBinding:new f(40),predefined:!0});h.push({actionID:"charPrevious",keyBinding:new f(37),predefined:!0});h.push({actionID:"charNext",
keyBinding:new f(39),predefined:!0});n.isMac?(h.push({actionID:"scrollPageUp",keyBinding:new f(33),predefined:!0}),h.push({actionID:"scrollPageDown",keyBinding:new f(34),predefined:!0}),h.push({actionID:"pageUp",keyBinding:new f(33,null,null,!0),predefined:!0}),h.push({actionID:"pageDown",keyBinding:new f(34,null,null,!0),predefined:!0}),h.push({actionID:"lineStart",keyBinding:new f(37,!0),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new f(39,!0),predefined:!0}),h.push({actionID:"wordPrevious",
keyBinding:new f(37,null,null,!0),predefined:!0}),h.push({actionID:"wordNext",keyBinding:new f(39,null,null,!0),predefined:!0}),h.push({actionID:"scrollTextStart",keyBinding:new f(36),predefined:!0}),h.push({actionID:"scrollTextEnd",keyBinding:new f(35),predefined:!0}),h.push({actionID:"textStart",keyBinding:new f(38,!0),predefined:!0}),h.push({actionID:"textEnd",keyBinding:new f(40,!0),predefined:!0}),h.push({actionID:"scrollPageUp",keyBinding:new f(38,null,null,null,!0),predefined:!0}),h.push({actionID:"scrollPageDown",
keyBinding:new f(40,null,null,null,!0),predefined:!0}),h.push({actionID:"lineStart",keyBinding:new f(37,null,null,null,!0),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new f(39,null,null,null,!0),predefined:!0}),h.push({actionID:"lineStart",keyBinding:new f(38,null,null,!0),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new f(40,null,null,!0),predefined:!0})):(h.push({actionID:"pageUp",keyBinding:new f(33),predefined:!0}),h.push({actionID:"pageDown",keyBinding:new f(34),predefined:!0}),
h.push({actionID:"lineStart",keyBinding:new f(36),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new f(35),predefined:!0}),h.push({actionID:"wordPrevious",keyBinding:new f(37,!0),predefined:!0}),h.push({actionID:"wordNext",keyBinding:new f(39,!0),predefined:!0}),h.push({actionID:"textStart",keyBinding:new f(36,!0),predefined:!0}),h.push({actionID:"textEnd",keyBinding:new f(35,!0),predefined:!0}));n.isFirefox&&n.isLinux&&(h.push({actionID:"lineUp",keyBinding:new f(38,!0),predefined:!0}),h.push({actionID:"lineDown",
keyBinding:new f(40,!0),predefined:!0}));n.isWindows&&(h.push({actionID:"scrollLineUp",keyBinding:new f(38,!0),predefined:!0}),h.push({actionID:"scrollLineDown",keyBinding:new f(40,!0),predefined:!0}));h.push({actionID:"selectLineUp",keyBinding:new f(38,null,!0),predefined:!0});h.push({actionID:"selectLineDown",keyBinding:new f(40,null,!0),predefined:!0});h.push({actionID:"selectCharPrevious",keyBinding:new f(37,null,!0),predefined:!0});h.push({actionID:"selectCharNext",keyBinding:new f(39,null,!0),
predefined:!0});h.push({actionID:"selectPageUp",keyBinding:new f(33,null,!0),predefined:!0});h.push({actionID:"selectPageDown",keyBinding:new f(34,null,!0),predefined:!0});n.isMac?(h.push({actionID:"selectLineStart",keyBinding:new f(37,!0,!0),predefined:!0}),h.push({actionID:"selectLineEnd",keyBinding:new f(39,!0,!0),predefined:!0}),h.push({actionID:"selectWordPrevious",keyBinding:new f(37,null,!0,!0),predefined:!0}),h.push({actionID:"selectWordNext",keyBinding:new f(39,null,!0,!0),predefined:!0}),
h.push({actionID:"selectTextStart",keyBinding:new f(36,null,!0),predefined:!0}),h.push({actionID:"selectTextEnd",keyBinding:new f(35,null,!0),predefined:!0}),h.push({actionID:"selectTextStart",keyBinding:new f(38,!0,!0),predefined:!0}),h.push({actionID:"selectTextEnd",keyBinding:new f(40,!0,!0),predefined:!0}),h.push({actionID:"selectLineStart",keyBinding:new f(37,null,!0,null,!0),predefined:!0}),h.push({actionID:"selectLineEnd",keyBinding:new f(39,null,!0,null,!0),predefined:!0}),h.push({actionID:"selectLineStart",
keyBinding:new f(38,null,!0,!0),predefined:!0}),h.push({actionID:"selectLineEnd",keyBinding:new f(40,null,!0,!0),predefined:!0})):(n.isLinux&&(h.push({actionID:"selectWholeLineUp",keyBinding:new f(38,!0,!0),predefined:!0}),h.push({actionID:"selectWholeLineDown",keyBinding:new f(40,!0,!0),predefined:!0})),h.push({actionID:"selectLineStart",keyBinding:new f(36,null,!0),predefined:!0}),h.push({actionID:"selectLineEnd",keyBinding:new f(35,null,!0),predefined:!0}),h.push({actionID:"selectWordPrevious",
keyBinding:new f(37,!0,!0),predefined:!0}),h.push({actionID:"selectWordNext",keyBinding:new f(39,!0,!0),predefined:!0}),h.push({actionID:"selectTextStart",keyBinding:new f(36,!0,!0),predefined:!0}),h.push({actionID:"selectTextEnd",keyBinding:new f(35,!0,!0),predefined:!0}));h.push({actionID:"undo",keyBinding:new l.KeyBinding("z",!0),predefined:!0});n.isMac?h.push({actionID:"redo",keyBinding:new l.KeyBinding("z",!0,!0),predefined:!0}):h.push({actionID:"redo",keyBinding:new l.KeyBinding("y",!0),predefined:!0});
h.push({actionID:"deletePrevious",keyBinding:new f(8),predefined:!0});h.push({actionID:"deletePrevious",keyBinding:new f(8,null,!0),predefined:!0});h.push({actionID:"deleteNext",keyBinding:new f(46),predefined:!0});h.push({actionID:"deleteWordPrevious",keyBinding:new f(8,!0),predefined:!0});h.push({actionID:"deleteWordPrevious",keyBinding:new f(8,!0,!0),predefined:!0});h.push({actionID:"deleteWordNext",keyBinding:new f(46,!0),predefined:!0});h.push({actionID:"tab",keyBinding:new f(9),predefined:!0});
h.push({actionID:"shiftTab",keyBinding:new f(9,null,!0),predefined:!0});h.push({actionID:"enter",keyBinding:new f(13),predefined:!0});h.push({actionID:"enter",keyBinding:new f(13,null,!0),predefined:!0});h.push({actionID:"selectAll",keyBinding:new f("a",!0),predefined:!0});h.push({actionID:"toggleTabMode",keyBinding:new f("m",!0),predefined:!0});n.isMac&&(h.push({actionID:"deleteNext",keyBinding:new f(46,null,!0),predefined:!0}),h.push({actionID:"deleteWordPrevious",keyBinding:new f(8,null,null,!0),
predefined:!0}),h.push({actionID:"deleteWordNext",keyBinding:new f(46,null,null,!0),predefined:!0}));h.push({actionID:"toggleWrapMode",keyBinding:new l.KeyBinding("w",!0,!1,!0)});h.push({actionID:"toggleOverwriteMode",keyBinding:new l.KeyBinding(45)});if(!n.isFirefox){var g=n.isMac&&n.isChrome;h.push({actionID:"noop",keyBinding:new f("u",!g,!1,!1,g),predefined:!0});h.push({actionID:"noop",keyBinding:new f("i",!g,!1,!1,g),predefined:!0});h.push({actionID:"noop",keyBinding:new f("b",!g,!1,!1,g),predefined:!0})}n.isFirefox&&
(h.push({actionID:"copy",keyBinding:new f(45,!0),predefined:!0}),h.push({actionID:"paste",keyBinding:new f(45,null,!0),predefined:!0}),h.push({actionID:"cut",keyBinding:new f(46,null,!0),predefined:!0}));n.isMac&&(h.push({actionID:"lineStart",keyBinding:new f("a",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new f("e",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"lineUp",keyBinding:new f("p",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"lineDown",keyBinding:new f("n",!1,!1,
!1,!0),predefined:!0}),h.push({actionID:"charPrevious",keyBinding:new f("b",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"charNext",keyBinding:new f("f",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"deletePrevious",keyBinding:new f("h",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"deleteNext",keyBinding:new f("d",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"deleteLineEnd",keyBinding:new f("k",!1,!1,!1,!0),predefined:!0}),n.isFirefox?(h.push({actionID:"scrollPageDown",keyBinding:new f("v",!1,
!1,!1,!0),predefined:!0}),h.push({actionID:"deleteLineStart",keyBinding:new f("u",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"deleteWordPrevious",keyBinding:new f("w",!1,!1,!1,!0),predefined:!0})):(h.push({actionID:"pageDown",keyBinding:new f("v",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"centerLine",keyBinding:new f("l",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"enterNoCursor",keyBinding:new f("o",!1,!1,!1,!0),predefined:!0})));return h};return{KeyMode:m,DefaultKeyMode:k}});
define("orion/editor/util",[],function(){return{contains:function(l,n){if(!n)return!1;if(!l.compareDocumentPosition){for(var m=n;m;){if(l===m)return!0;m=m.parentNode}return!1}return l===n||0!==(l.compareDocumentPosition(n)&16)},addEventListener:function(l,n,m,k){"function"===typeof l.addEventListener?l.addEventListener(n,m,!0===k):l.attachEvent("on"+n,m)},removeEventListener:function(l,n,m,k){"function"===typeof l.removeEventListener?l.removeEventListener(n,m,!0===k):l.detachEvent("on"+n,m)},Animation:function(){function l(l){this.options=
l}l.prototype.play=function(){var l="number"===typeof this.options.duration?this.options.duration:350,m=this.options.easing||this.defaultEasing,k=this.options.onAnimate||function(){},f=this.options.curve[0],h=this.options.curve[1],g=h-f,d=-1,a,e=this;this.interval=this.options.window.setInterval(function(){d=-1===d?(new Date).getTime():d;var b=((new Date).getTime()-d)/l;1>b?(b=m(b),a=f+b*g,k(a)):(k(h),e.stop())},"number"===typeof this.options.rate?this.options.rate:20)};l.prototype.stop=function(){this.options.window.clearInterval(this.interval);
(this.options.onEnd||function(){})()};l.prototype.defaultEasing=function(l){return Math.sin(l*(Math.PI/2))};return l}()}});
define("orion/editor/textView","i18n!orion/editor/nls/messages orion/editor/textModel orion/editor/keyModes orion/editor/eventTarget orion/editor/textTheme orion/editor/util orion/util".split(" "),function(l,n,m,k,f,h,g){function d(a,b,e){if(e){b.className="";e=b.attributes;for(var d=e.length;0<d--;)(!g.isIE||9<=g.isIE||9>g.isIE&&e[d].specified)&&b.removeAttribute(e[d].name)}if(a){a.styleClass&&(b.className=a.styleClass);if(e=a.style)for(var f in e)e.hasOwnProperty(f)&&(b.style[f]=e[f]);if(a=a.attributes)for(var h in a)a.hasOwnProperty(h)&&
b.setAttribute(h,a[h])}}function a(a){return a instanceof Array?a.slice(0):a}function e(a,b){if(!a)return b;if(!b)return a;for(var e in b)b.hasOwnProperty(e)&&(a.hasOwnProperty(e)||(a[e]=b[e]));return a}function b(a,e){if(a===e)return!0;if(a&&!e||!a&&e||a&&a.constructor===String||e&&e.constructor===String)return!1;if(a instanceof Array||e instanceof Array){if(!(a instanceof Array&&e instanceof Array)||a.length!==e.length)return!1;for(var d=0;d<a.length;d++)if(!b(a[d],e[d]))return!1;return!0}if(!(a instanceof
Object)||!(e instanceof Object))return!1;for(d in a)if(a.hasOwnProperty(d)&&(!e.hasOwnProperty(d)||!b(a[d],e[d])))return!1;for(d in e)if(!a.hasOwnProperty(d))return!1;return!0}function p(a,b,e){for(var d=0,g=0,f=0,h=a.length;f<h;){-1!==d&&d<=f&&(d=a.indexOf("\r",f));-1!==g&&g<=f&&(g=a.indexOf("\n",f));var p=f,k;if(-1===g&&-1===d){b(a.substring(f));break}-1!==d&&-1!==g?d+1===g?(k=d,f=g+1):(k=d<g?d:g,f=(d<g?d:g)+1):-1!==d?(k=d,f=d+1):(k=g,f=g+1);b(a.substring(p,k));e()}}function q(a){var b,e,d,g,f=
a.ownerDocument.defaultView||a.ownerDocument.parentWindow;f.getComputedStyle?(a=f.getComputedStyle(a,null),b=a.getPropertyValue("padding-left"),e=a.getPropertyValue("padding-top"),d=a.getPropertyValue("padding-right"),g=a.getPropertyValue("padding-bottom")):a.currentStyle&&(b=a.currentStyle.paddingLeft,e=a.currentStyle.paddingTop,d=a.currentStyle.paddingRight,g=a.currentStyle.paddingBottom);return{left:parseInt(b,10)||0,top:parseInt(e,10)||0,right:parseInt(d,10)||0,bottom:parseInt(g,10)||0}}function t(a){var b,
e,d,g,f=a._trim;if(!f){var f=q(a),h=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;h.getComputedStyle?(g=h.getComputedStyle(a,null),b=g.getPropertyValue("border-left-width"),e=g.getPropertyValue("border-top-width"),d=g.getPropertyValue("border-right-width"),g=g.getPropertyValue("border-bottom-width")):a.currentStyle&&(b=a.currentStyle.borderLeftWidth,e=a.currentStyle.borderTopWidth,d=a.currentStyle.borderRightWidth,g=a.currentStyle.borderBottomWidth);b=parseInt(b,10)||0;e=parseInt(e,10)||
0;d=parseInt(d,10)||0;g=parseInt(g,10)||0;f.left+=b;f.top+=e;f.right+=d;f.bottom+=g;a._trim=f}return f}function s(a,b,e,d){function g(b){if(b.animationName===h){var e=b.target;"function"===typeof e.__DOMReady&&(a.defaultView||a.parentWindow).setTimeout(function(){e.__DOMReady()},0)}}function f(a,b){for(var e=["","-webkit-","-moz-","-ms-","-o-"],d="",g="body ."+a+" {\n",v=0;v<e.length;v++)d+="@"+e[v]+"keyframes "+b+" {\nfrom { opacity: 0.99; }\nto { opacity: 1; }\n}\n",g+=e[v]+"animation-duration: 0.001s;\n"+
e[v]+"animation-name: "+b+";\n";return d+(g+"}")}e="_"+e+"DOMReady";b.className=b.className?b.className+" "+e:e;b.__DOMReady=d;d=e+"Style";if(!a.getElementById(d)){var h=e+"Animation";w(a,"animationstart",g,!1);w(a,"MSAnimationStart",g,!1);w(a,"webkitAnimationStart",g,!1);b=a.createElement("style");b.id=d;d=a.getElementsByTagName("head")[0]||a.documentElement;b.appendChild(a.createTextNode(f(e,h)));d.insertBefore(b,d.firstChild)}}function y(a,b,e){this.start=a;this.end=b;this.caret=e}function r(a){this.left=
a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function x(a,b,e){this.view=a;this.lineIndex=b;this._lineDiv=e}function u(a){this._init(a||{})}var w=h.addEventListener,z=h.removeEventListener,B=h.Animation;y.prototype={clone:function(){return new y(this.start,this.end,this.caret)},collapse:function(){this.caret?this.end=this.start:this.start=this.end},extend:function(a){this.caret?this.start=a:this.end=a;this.start>this.end&&(a=this.start,this.start=this.end,this.end=a,this.caret=!this.caret)},
setCaret:function(a){this.end=this.start=a;this.caret=!1},getCaret:function(){return this.caret?this.start:this.end},toString:function(){return"start\x3d"+this.start+" end\x3d"+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(a){return this.caret===a.caret&&this.start===a.start&&this.end===a.end}};r.prototype={toString:function(){return"{l\x3d"+this.left+", t\x3d"+this.top+", r\x3d"+this.right+", b\x3d"+this.bottom+"}"}};
x.prototype={create:function(a,b){if(!this._lineDiv){var e=this._lineDiv=this._createLine(a,b,this.lineIndex);e._line=this;return e}},_createLine:function(a,e,f){var h=this.view,p=h._model,k=p.getLine(f),l=p.getLineStart(f),q={type:"LineStyle",textView:h,lineIndex:f,lineText:k,lineStart:l};h.onLineStyle(q);var t=a.ownerDocument,p=e||g.createElement(t,"div");if(!e||!b(e.viewStyle,q.style))d(q.style,p,e),e&&(e._trim=null),p.viewStyle=q.style,p.setAttribute("role","presentation");p.lineIndex=f;if(e&&
p.viewLineText===k&&b(q.ranges,p.viewRanges))return p;p.viewRanges=q.ranges;p.viewLineText=k;f=[];this._createRanges(q.ranges,k,0,k.length,l,{tabOffset:0,ranges:f});q=" ";!h._fullSelection&&9>g.isIE&&(q="\ufeff");h={text:q,style:h._metrics.largestFontStyle,ignoreChars:1};0===f.length||!f[f.length-1].style||"div"!==f[f.length-1].style.tagName?f.push(h):f.splice(f.length-1,0,h);var s,m,n,y=q=0;if(g.isFirefox&&2E3<k.length){e&&(p.innerHTML="",e.lineWidth=void 0);e=t.createDocumentFragment();for(k=0;k<
f.length;k++)h=f[k],l=h.text,s=h.style,s=this._createSpan(p,l,s,h.ignoreChars),e.appendChild(s);p.appendChild(e)}else{var r,w;if(e){if(m=e.modelChangedEvent)0===m.removedLineCount&&0===m.addedLineCount?(w=m.start-l,r=m.addedCharCount-m.removedCharCount):w=-1,e.modelChangedEvent=void 0;m=e.firstChild}for(k=0;k<f.length;k++){h=f[k];l=h.text;q+=l.length;s=h.style;if(m)if(n=m.firstChild.data,t=m.viewStyle,n===l&&b(s,t)){y+=n.length;m._rectsCache=void 0;s=m=m.nextSibling;continue}else for(;m;){if(-1!==
w){t=q;t>=w&&(t-=r);n=(n=m.firstChild.data)?n.length:0;if(y+n>t)break;y+=n}t=m.nextSibling;p.removeChild(m);m=t}s=this._createSpan(p,l,s,h.ignoreChars);m?p.insertBefore(s,m):p.appendChild(s);e&&(e.lineWidth=void 0)}if(e)for(r=s?s.nextSibling:null;r;)t=r.nextSibling,e.removeChild(r),r=t}p.parentNode||a.appendChild(p);return p},_createRanges:function(a,e,d,g,f,h){if(!(d>g)){if(a)for(var p=0;p<a.length;p++){var k=a[p];if(!(k.end<f+d)){var l=Math.max(f+d,k.start)-f;if(l>g)break;var q=Math.min(f+g,k.end)-
f;if(l<=q){l=Math.max(d,l);q=Math.min(g,q);d<l&&this._createRange(e,d,l,null,h);if(!k.style||!k.style.unmergeable)for(;p+1<a.length&&a[p+1].start-f===q&&b(k.style,a[p+1].style);)k=a[p+1],q=Math.min(f+g,k.end)-f,p++;this._createRange(e,l,q,k.style,h);d=q}}}d<g&&this._createRange(e,d,g,null,h)}},_createRange:function(a,b,e,d,g){if(!(b>e)){var f=this.view._customTabSize;if(f&&8!==f)for(var h=a.indexOf("\t",b);-1!==h&&h<e;){b<h&&(b={text:a.substring(b,h),style:d},g.ranges.push(b),g.tabOffset+=b.text.length);
b=f-g.tabOffset%f;if(0<b){for(var p="\u00a0",k=1;k<b;k++)p+=" ";b={text:p,style:d,ignoreChars:b-1};g.ranges.push(b);g.tabOffset+=b.text.length}b=h+1;if(b===e)return;h=a.indexOf("\t",b)}b<=e&&(b={text:a.substring(b,e),style:d},g.ranges.push(b),g.tabOffset+=b.text.length)}},_createSpan:function(a,b,e,f){var h=this.view,p="span";e&&e.tagName&&(p=e.tagName.toLowerCase());var k="a"===p;k&&(this.hasLink=!0);k&&!h._linksVisible&&(p="span");k=a.ownerDocument;a=g.createElement(a.ownerDocument,p);a.appendChild(k.createTextNode(e&&
e.text?e.text:b));e&&e.html?(a.innerHTML=e.html,a.ignore=!0):e&&e.node&&(a.appendChild(e.node),a.ignore=!0);d(e,a);if("a"===p){var l=h._getWindow();w(a,"click",function(a){return h._handleLinkClick(a?a:l.event)},!1)}a.viewStyle=e;f&&(a.ignoreChars=f);return a},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(a,b){var e=this._ensureCreated(),d=this.view;if(void 0===a)return this._getLineBoundingClientRect(e,
!0);var f=d._model,h=e.ownerDocument,p=this.lineIndex,k=null;if(a<f.getLineEnd(p)){var l=f.getLineStart(p);this.forEach(function(b){var f=b.firstChild,p=this._nodeLength(b);if(l+p>a){var A=a-l;if(1===f.length)k=new r(b.getBoundingClientRect());else if(d._isRangeRects)p=h.createRange(),p.setStart(f,A),p.setEnd(f,A+1),k=new r(p.getBoundingClientRect());else if(g.isIE)p=h.body.createTextRange(),p.moveToElementText(b),p.collapse(),(f=0===A&&8===g.isIE)&&(A=1),p.moveEnd("character",A+1),p.moveStart("character",
A),k=new r(p.getBoundingClientRect()),f&&(k.left=b.getClientRects()[0].left);else{var q=f.data;b.removeChild(f);b.appendChild(h.createTextNode(q.substring(0,A)));var t=g.createElement(h,"span");t.appendChild(h.createTextNode(q.substring(A,A+1)));b.appendChild(t);b.appendChild(h.createTextNode(q.substring(A+1)));k=new r(t.getBoundingClientRect());b.innerHTML="";b.appendChild(f);this._createdDiv||(b=d._getSelection(),(l<=b.start&&b.start<l+p||l<=b.end&&b.end<l+p)&&d._updateDOMSelection())}g.isIE&&(A=
e.ownerDocument.defaultView||e.ownerDocument.parentWindow,b=A.screen.logicalXDPI/A.screen.deviceXDPI,A=A.screen.logicalYDPI/A.screen.deviceYDPI,k.left*=b,k.right*=b,k.top*=A,k.bottom*=A);return!1}l+=p;return!0})}f=this.getBoundingClientRect();k||(d._wrapMode?(p=this.getClientRects(),k=p[p.length-1],k.left=k.right,k.left+=f.left,k.top+=f.top,k.right+=f.left,k.bottom+=f.top):(k=new r(f),k.left=k.right));if(b||void 0===b)k.left-=f.left,k.top-=f.top,k.right-=f.left,k.bottom-=f.top;return k},forEach:function(a){for(var b=
this._ensureCreated().firstChild;b;){var e=b.nextSibling;if(!b.ignore&&!a.call(this,b))break;b=e}},_getClientRects:function(a,b){var e,d,g,f;if(!a._rectsCache){e=a.getClientRects();d=Array(e.length);for(f=0;f<e.length;f++)g=d[f]=new r(e[f]),g.left-=b.left,g.top-=b.top,g.right-=b.left,g.bottom-=b.top;a._rectsCache=d}e=a._rectsCache;d=[e.length];for(f=0;f<e.length;f++)d[f]=new r(e[f]);return d},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];var b=[],e=this._ensureCreated().getBoundingClientRect();
this.forEach(function(a){a=this._getClientRects(a,e);for(var d=0;d<a.length;d++){var g=a[d],f,h;if(g.top!==g.bottom){var v=g.top+(g.bottom-g.top)/2;for(f=0;f<b.length&&!(h=b[f],h.top<=v&&v<h.bottom);f++);f===b.length?b.push(g):(g.left<h.left&&(h.left=g.left),g.top<h.top&&(h.top=g.top),g.right>h.right&&(h.right=g.right),g.bottom>h.bottom&&(h.bottom=g.bottom))}}return!0});return void 0!==a?b[a]:b},_getLineBoundingClientRect:function(a,b){var e=new r(a.getBoundingClientRect());if(!this.view._wrapMode){e.right=
e.left;for(var d=a.lastChild;d&&d.ignoreChars===d.firstChild.length;)d=d.previousSibling;d&&(d=d.getBoundingClientRect(),e.right=d.right+t(a).right)}b&&(d=t(a),e.left+=d.left,e.right-=d.right);return e},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(a){if(!this.view._wrapMode)return 0;var b=this.getClientRects();a=this.getBoundingClientRect(a);a=a.top+(a.bottom-a.top)/2;for(var e=0;e<b.length;e++)if(b[e].top<=a&&a<b[e].bottom)return e;return b.length-
1},getLineStart:function(a){if(!this.view._wrapMode||0===a)return this.view._model.getLineStart(this.lineIndex);var b=this.getClientRects();return this.getOffset(b[a].left+1,b[a].top+1)},_nodeLength:function(a){if(!a||a.ignore)return 0;var b=a.firstChild.length;a.ignoreChars&&(b-=a.ignoreChars);return b},getModelOffset:function(a,b){if(!a)return 0;var e=0;this.forEach(function(d){var g=d.firstChild;if(g===a)return d.ignoreChars&&(e-=d.ignoreChars),e+=b,!1;d.ignoreChars&&(e-=d.ignoreChars);e+=g.data.length;
return!0});return Math.max(0,e)+this.view._model.getLineStart(this.lineIndex)},getNodeOffset:function(a){var b=0,e,d,g=this.view._model,f=g.getLineStart(this.lineIndex),h=a-f,p=g.getLineEnd(this.lineIndex)-f;this.forEach(function(a){var g=a.firstChild,f=this._nodeLength(a);if(f+b>h||b+f>=p)return e=g,d=h-b,a.ignoreChars&&(0<f&&d===f)&&(d+=a.ignoreChars),!1;b+=f;return!0});return{node:e,offset:d}},getText:function(a){var b="",e=0;this.forEach(function(d){var g;if(d.ignoreChars){g=d.lastChild;for(var f=
0,h=[],p=-1;g;){var k=g.data;if(k)for(var l=k.length-1;0<=l;l--){var q=k.substring(l,l+1);f<d.ignoreChars&&(" "===q||"\ufeff"===q)?f++:h.push("\u00a0"===q?"\t":q)}a===g&&(p=h.length);g=g.previousSibling}h=h.reverse().join("");-1!==p&&(e=b.length+h.length-p);b+=h}else for(g=d.firstChild;g;)a===g&&(e=b.length),b+=g.data,g=g.nextSibling;return!0});return{text:b,offset:e}},getOffset:function(a,b){function e(d,l,D){var m=d.firstChild,C=s._nodeLength(d),n=q.ownerDocument,y=n.defaultView||n.parentWindow,
r=g.isIE?y.screen.logicalXDPI/y.screen.deviceXDPI:1,w=g.isIE?y.screen.logicalYDPI/y.screen.deviceYDPI:1,x,u,z,y=D.left+t.left,B,J;if(g.isIE||f._isRangeRects){for(var n=f._isRangeRects?n.createRange():n.body.createTextRange(),G=C,U=-1;1<G-U;){var V=Math.floor((G+U)/2);D=U+1;x=V===C-1&&d.ignoreChars?m.length:V+1;B=0===D&&8===g.isIE;f._isRangeRects?(n.setStart(m,D),n.setEnd(m,x)):(B&&(D=1),n.moveToElementText(d),n.move("character",D),n.moveEnd("character",x-D));J=n.getClientRects();for(var T=!1,S=0;S<
J.length;S++)if(D=J[S],x=(B?y:D.left)*r-t.left,z=D.right*r-t.left,u=D.top*w-t.top,D=D.bottom*w-t.top,x<=a&&a<z&&(!f._wrapMode||u<=b&&b<D)){T=!0;break}T?G=V:U=V}l+=G;D=G;x=G===C-1&&d.ignoreChars?m.length:Math.min(G+1,m.length);f._isRangeRects?(n.setStart(m,D),n.setEnd(m,x)):(n.moveToElementText(d),n.move("character",D),n.moveEnd("character",x-D));J=n.getClientRects();C=!1;0<J.length&&(D=J[0],x=(B?y:D.left)*r-t.left,z=D.right*r-t.left,C=a>x+(z-x)/2);d=l-k;m=h.getLine(p);r=m.charCodeAt(d);55296<=r&&
56319>=r&&C?d<m.length&&(r=m.charCodeAt(d+1),56320<=r&&57343>=r&&(l+=1)):56320<=r&&(57343>=r&&!C)&&0<d&&(r=m.charCodeAt(d-1),55296<=r&&56319>=r&&(l-=1));C&&l++}else{r=[];for(B=0;B<C;B++)r.push("\x3cspan\x3e"),B===C-1?r.push(m.data.substring(B)):r.push(m.data.substring(B,B+1)),r.push("\x3c/span\x3e");d.innerHTML=r.join("");for(r=d.firstChild;r;){D=r.getBoundingClientRect();x=D.left-t.left;z=D.right-t.left;if(x<=a&&a<z){a>x+(z-x)/2&&l++;break}l++;r=r.nextSibling}s._createdDiv||(d.innerHTML="",d.appendChild(m),
d=f._getSelection(),(l<=d.start&&d.start<l+C||l<=d.end&&d.end<l+C)&&f._updateDOMSelection())}return l}function d(e){if(e.ignore)return null;e=s._getClientRects(e,t);for(var g=0;g<e.length;g++){var h=e[g];if(h.left<=a&&a<h.right&&(!f._wrapMode||h.top<=b&&b<h.bottom))return h}return null}var f=this.view,h=f._model,p=this.lineIndex,k=h.getLineStart(p),l=h.getLineEnd(p);if(k===l)return k;var q=this._ensureCreated(),t=this.getBoundingClientRect(),s=this,m,n;if(f._wrapMode){m=this.getClientRects();b<m[0].top&&
(b=m[0].top);for(var y=0;y<m.length&&!(n=m[y],n.top<=b&&b<n.bottom);y++);a<n.left&&(a=n.left);a>n.right&&(a=n.right-1)}else 0>a&&(a=0),a>t.right-t.left&&(a=t.right-t.left);var r,w;if(this._lastHitChild&&this._lastHitChild.parentNode){if(r=this._lastHitOffset,w=this._lastHitChild,n=d(w),!n){m=r;for(var y=r+this._nodeLength(w),x=w.previousSibling,u=w.nextSibling;x||u;){if(x){m-=this._nodeLength(x);if(n=d(x)){w=x;r=m;break}x=x.previousSibling}if(u){if(n=d(u)){w=u;r=y;break}y+=this._nodeLength(u);u=u.nextSibling}}}}else r=
k,this.forEach(function(a){w=a;if(n=d(w))return!1;r+=this._nodeLength(w);return!0});w&&n&&(this._lastHitChild=w,this._lastHitOffset=r,r=e(w,r,n));return Math.min(l,Math.max(k,r))},getNextOffset:function(a,b){if("line"===b.unit){var e=this.view._model,d=e.getLineAtOffset(a);if(0<b.count)return b.count--,e.getLineEnd(d);b.count++;return e.getLineStart(d)}return"wordend"===b.unit||"wordWS"===b.unit||"wordendWS"===b.unit?this._getNextOffset_W3C(a,b):g.isIE?this._getNextOffset_IE(a,b):this._getNextOffset_W3C(a,
b)},_getNextOffset_W3C:function(a,b){function e(a){return 33<=a&&47>=a||58<=a&&64>=a||91<=a&&94>=a||96===a||123<=a&&126>=a}function d(a){return 32===a||9===a}var g=this.view._model,f=g.getLineAtOffset(a),h=g.getLine(f),p=g.getLineStart(f),g=g.getLineEnd(f),f=h.length,k=a-p,l,q=0>b.count?-1:1;if("word"===b.unit||"wordend"===b.unit||"wordWS"===b.unit||"wordendWS"===b.unit)for(var t,m,s;0!==b.count;){if(0<b.count){if(k===f)return g;l=h.charCodeAt(k);t=e(l);m=!t&&!d(l);for(k++;k<f;){l=h.charCodeAt(k);
if("wordWS"!==b.unit&&"wordendWS"!==b.unit){s=e(l);if("wordend"===b.unit){if(!s&&t)break}else if(s&&!t)break;l=!s&&!d(l)}else l=!d(l);if("wordend"===b.unit||"wordendWS"===b.unit){if(!l&&m)break}else if(l&&!m)break;m=l;t=s;k++}}else{if(0===k)return p;k--;l=h.charCodeAt(k);t=e(l);for(m=!t&&!d(l);0<k;){l=h.charCodeAt(k-1);if("wordWS"!==b.unit&&"wordendWS"!==b.unit){s=e(l);if("wordend"===b.unit){if(s&&!t)break}else if(!s&&t)break;l=!s&&!d(l)}else l=!d(l);if("wordend"===b.unit||"wordendWS"===b.unit){if(l&&
!m)break}else if(!l&&m)break;m=l;t=s;k--}}b.count-=q}else for(;0!==b.count&&0<=k+q&&k+q<=f;)k+=q,l=h.charCodeAt(k),56320<=l&&57343>=l&&0<k&&(l=h.charCodeAt(k-1),55296<=l&&56319>=l&&(k+=q)),b.count-=q;return p+k},_getNextOffset_IE:function(a,b){var e=this._ensureCreated(),d=this.view._model,g=this.lineIndex,f=0,h;h=d.getLineStart(g);var p=d.getLine(g),k=d.getLineStart(g),l=e.ownerDocument,q=0>b.count?-1:1;if(a===d.getLineEnd(g)){for(e=e.lastChild;e&&e.ignoreChars===e.firstChild.length;)e=e.previousSibling;
if(!e)return h;f=l.body.createTextRange();f.moveToElementText(e);h=f.text.length;f.moveEnd(b.unit,q);f=a+f.text.length-h}else if(a===h&&0>b.count)f=h;else for(e=e.firstChild;e;){d=this._nodeLength(e);if(h+d>a){f=l.body.createTextRange();if(a===h&&0>b.count){for(h=e.previousSibling;h&&(!h.firstChild||!h.firstChild.length);)h=h.previousSibling;f.moveToElementText(h?h:e.previousSibling)}else f.moveToElementText(e),f.collapse(),f.moveEnd("character",a-h);h=f.text.length;f.moveEnd(b.unit,q);f=a+f.text.length-
h;break}h=d+h;e=e.nextSibling}h=f-k;c=p.charCodeAt(h);56320<=c&&57343>=c&&0<h&&(c=p.charCodeAt(h-1),55296<=c&&56319>=c&&(h+=q));b.count-=q;return h+k},updateLinks:function(){var a=this._ensureCreated();if(this.hasLink){var b=this;this.forEach(function(e){var d=e.viewStyle;d&&(d.tagName&&"a"===d.tagName.toLowerCase())&&a.replaceChild(b._createSpan(a,e.firstChild.data,d),e);return!0})}},destroy:function(){var a=this._createdDiv;a&&(a.parentNode.removeChild(a),this._createdDiv=null)}};u.prototype={addKeyMode:function(a,
b){var e=this._keyModes;void 0!==b?e.splice(b,0,a):e.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,b){a.setView(this);var e=this._rulers;if(void 0!==b){var d,g;for(g=d=0;d<e.length&&g<b;d++)a.getLocation()===e[d].getLocation()&&g++;e.splice(g,0,a);b=g}else e.push(a);this._createRuler(a,b);this._update()},computeSize:function(){var a=0,b=0,e=this._model,d=this._clientDiv;if(!d)return{width:a,height:b};var f=d.style.width;g.isWebkit&&(d.style.width="0x7fffffffpx");for(var e=e.getLineCount(),
h=0;h<e;h++){var p=this._getLine(h),k=p.getBoundingClientRect(),a=Math.max(a,k.right-k.left),b=b+(k.bottom-k.top);p.destroy()}g.isWebkit&&(d.style.width=f);d=this._getViewPadding();a+=d.right+d.left+this._metrics.scrollWidth;b+=d.bottom+d.top+this._metrics.scrollWidth;return{width:a,height:b}},convert:function(a,b,e){if(this._clientDiv){var d=this._getScroll(),g=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect();"document"===b&&(void 0!==a.x&&(a.x+=-d.x+f.left+g.left),void 0!==a.y&&(a.y+=
-d.y+f.top+g.top));"document"===e&&(void 0!==a.x&&(a.x+=d.x-f.left-g.left),void 0!==a.y&&(a.y+=d.y-f.top-g.top));return a}},destroy:function(){for(var a=0;a<this._rulers.length;a++)this._rulers[a].setView(null);this.rulers=null;this._destroyView();this.onDestroy({type:"Destroy"});this._parent=null;this._model&&this._model.destroy&&this._model.destroy();this._actions=this._keyModes=this._doubleClickSelection=this._selection=this._theme=this._model=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),
this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(a){if(a=this._actions[a])return a.actionDescription},getActions:function(a){var b=[],e=this._actions,d;for(d in e)e.hasOwnProperty(d)&&(a||!e[d].defaultHandler)&&b.push(d);return b},getBottomIndex:function(a){return!this._clientDiv?0:this._getBottomIndex(a)},getBottomPixel:function(){return!this._clientDiv?0:this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},
getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var a=this._getScroll();return{x:a.x,y:a.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?0:this._getScroll().x},getKeyBindings:function(a){for(var b=[],e=this._keyModes,d=0;d<e.length;d++)b=b.concat(e[d].getKeyBindings(a));return b},getKeyModes:function(){return this._keyModes.slice(0)},getLineHeight:function(a){return!this._clientDiv?0:this._getLineHeight(a)},
getLineIndex:function(a){return!this._clientDiv?0:this._getLineIndex(a)},getLinePixel:function(a){return!this._clientDiv?0:this._getLinePixel(a)},getLocationAtOffset:function(a){if(!this._clientDiv)return{x:0,y:0};var b=this._model;a=Math.min(Math.max(0,a),b.getCharCount());var b=b.getLineAtOffset(a),e=this._getLine(b);a=e.getBoundingClientRect(a);e.destroy();e=a.left;b=this._getLinePixel(b)+a.top;return{x:e,y:b}},getNextOffset:function(a,b){var e=new y(a,a,!1);this._doMove(b,e);return e.getCaret()},
getOptions:function(){var b;if(0===arguments.length)b=this._defaultOptions();else if(1===arguments.length){if(b=arguments[0],"string"===typeof b)return a(this["_"+b])}else{b={};for(var e in arguments)arguments.hasOwnProperty(e)&&(b[arguments[e]]=void 0)}for(var d in b)b.hasOwnProperty(d)&&(b[d]=a(this["_"+d]));return b},getModel:function(){return this._model},getOffsetAtLocation:function(a,b){if(!this._clientDiv)return 0;var e=this._getLineIndex(b),d=this._getLine(e),e=d.getOffset(a,b-this._getLinePixel(e));
d.destroy();return e},getLineAtOffset:function(a){return this.getModel().getLineAtOffset(a)},getLineStart:function(a){this.getModel().getLineStart(a)},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=this._getSelection();return{start:a.start,end:a.end}},getText:function(a,b){return this._model.getText(a,b)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(a,
b,e){if(this._clientDiv){if(a=this._actions[a]){if(!b&&a.handler&&a.handler(e))return!0;if(a.defaultHandler)return"boolean"===typeof a.defaultHandler(e)}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(a){return this.dispatchEvent(a)},onDragStart:function(a){return this.dispatchEvent(a)},onDrag:function(a){return this.dispatchEvent(a)},onDragEnd:function(a){return this.dispatchEvent(a)},onDragEnter:function(a){return this.dispatchEvent(a)},onDragOver:function(a){return this.dispatchEvent(a)},
onDragLeave:function(a){return this.dispatchEvent(a)},onDrop:function(a){return this.dispatchEvent(a)},onDestroy:function(a){return this.dispatchEvent(a)},onLineStyle:function(a){return this.dispatchEvent(a)},onKeyDown:function(a){return this.dispatchEvent(a)},onKeyPress:function(a){return this.dispatchEvent(a)},onKeyUp:function(a){return this.dispatchEvent(a)},onModelChanged:function(a){return this.dispatchEvent(a)},onModelChanging:function(a){return this.dispatchEvent(a)},onModify:function(a){return this.dispatchEvent(a)},
onMouseDown:function(a){return this.dispatchEvent(a)},onMouseUp:function(a){return this.dispatchEvent(a)},onMouseMove:function(a){return this.dispatchEvent(a)},onMouseOver:function(a){return this.dispatchEvent(a)},onMouseOut:function(a){return this.dispatchEvent(a)},onSelection:function(a){return this.dispatchEvent(a)},onScroll:function(a){return this.dispatchEvent(a)},onVerify:function(a){return this.dispatchEvent(a)},onFocus:function(a){return this.dispatchEvent(a)},onBlur:function(a){return this.dispatchEvent(a)},
redraw:function(){if(!(0<this._redrawCount)){var a=this._model.getLineCount();this.redrawRulers(0,a);this.redrawLines(0,a)}},redrawRulers:function(a,b){if(!(0<this._redrawCount))for(var e=this.getRulers(),d=0;d<e.length;d++)this.redrawLines(a,b,e[d])},redrawLines:function(a,b,e){if(!(0<this._redrawCount)&&(void 0===a&&(a=0),void 0===b&&(b=this._model.getLineCount()),a!==b)){var d=this._clientDiv;if(d){if(e)for(d=this._getRulerParent(e).firstChild;d&&d._ruler!==e;)d=d.nextSibling;e?d.rulerChanged=
!0:this._lineHeight&&this._resetLineHeight(a,b);if(!e||"page"===e.getOverview())for(d=d.firstChild;d;){var g=d.lineIndex;a<=g&&g<b&&(d.lineChanged=!0);d=d.nextSibling}!e&&(!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<b)&&(this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0);this._queueUpdate()}}},redrawRange:function(a,b){if(!(0<this._redrawCount)){var e=this._model;void 0===a&&(a=0);void 0===b&&(b=e.getCharCount());var d=e.getLineAtOffset(a),e=e.getLineAtOffset(Math.max(a,
b-1))+1;this.redrawLines(d,e)}},removeKeyMode:function(a){for(var b=this._keyModes,e=0;e<b.length;e++)if(b[e]===a){b.splice(e,1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var b=this._rulers,e=0;e<b.length;e++)if(b[e]===a){b.splice(e,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,b,e){if(a){var d=this._actions,g=d[a];g||(g=d[a]={});g.handler=b;void 0!==e&&(g.actionDescription=
e)}},setKeyBinding:function(a,b){this._keyModes[0].setKeyBinding(a,b)},setCaretOffset:function(a,b,e){var d=this._model.getCharCount();a=Math.max(0,Math.min(a,d));a=new y(a,a,!1);this._setSelection(a,void 0===b||b,!0,e)},setHorizontalPixel:function(a){this._clientDiv&&(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},setRedraw:function(a){a?0===--this._redrawCount&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==this._model){this._model.removeEventListener("preChanging",
this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);var b=this._model.getLineCount(),e=this._model.getCharCount(),d=a.getLineCount(),g=a.getCharCount(),f={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:e,addedCharCount:g,removedLineCount:b,addedLineCount:d};this.onModelChanging(f);this._model=a;f={type:"ModelChanged",start:0,removedCharCount:e,addedCharCount:g,removedLineCount:b,addedLineCount:d};this.onModelChanged(f);this._model.addEventListener("preChanging",
this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(e){var d=this._defaultOptions(),g;for(g in e)if(e.hasOwnProperty(g)){var f=e[g];if(!b(this["_"+g],f)){var h=d[g]?d[g].update:null;h?h.call(this,f):this["_"+g]=a(f)}}},setSelection:function(a,b,e,d){var g=a>b;if(g){var f=a;a=b;b=f}f=this._model.getCharCount();a=Math.max(0,Math.min(a,f));b=Math.max(0,Math.min(b,f));a=new y(a,b,g);this._setSelection(a,
void 0===e||e,!0,d)},setText:function(a,b,e){var d=void 0===b&&void 0===e;void 0===b&&(b=0);void 0===e&&(e=this._model.getCharCount());d&&(this._variableLineHeight=!1);this._modifyContent({text:a,start:b,end:e,_code:!0},!d);d&&(this._columnX=-1,this._setSelection(new y(0,0,!1),!0),13>g.isFirefox&&this._fixCaret())},setTopIndex:function(a){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,a))-this._getScroll().y)},setTopPixel:function(a){this._clientDiv&&this._scrollView(0,Math.max(0,
a)-this._getScroll().y)},showSelection:function(a,b){return this._showCaret(a?!1:!0,b,a)},update:function(a,b){this._clientDiv&&((a||this._metrics.invalid)&&this._updateStyle(),void 0===b||b?this._update():this._queueUpdate())},_handleRootMouseDown:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)){13>g.isFirefox&&1===a.which&&(this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0);var b=this._overlayDiv||this._clientDiv;9>g.isIE&&(b=
this._viewDiv);for(var e=a.target?a.target:a.srcElement;e;){if(b===e||e.className&&-1!==e.className.indexOf("textViewFind"))return;e=e.parentNode}a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();if(!this._isW3CEvents){var d=this;this._getWindow().setTimeout(function(){d._clientDiv.focus()},0)}}},_handleRootMouseUp:function(a){!this._ignoreEvent(a)&&(13>g.isFirefox&&1===a.which)&&(this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),
this._ignoreBlur=!1)},_handleBlur:function(a){this._cancelCheckSelection();if(!this._ignoreBlur){this._commitIME();this._hasFocus=!1;if(9>g.isIE&&!this._getSelection().isEmpty()){a=this._rootDiv;var b=g.createElement(a.ownerDocument,"div");a.appendChild(b);a.removeChild(b)}this._cursorDiv&&(this._cursorDiv.style.display="none");if(this._selDiv1)if(this._selDiv1.style.background="lightgray",this._selDiv2.style.background="lightgray",this._selDiv3.style.background="lightgray",a=this._getWindow(),b=
this._selDiv1.ownerDocument,a.getSelection){b=a.getSelection();for(a=b.anchorNode;a;){if(a===this._clientDiv){0<b.rangeCount&&b.removeAllRanges();break}a=a.parentNode}}else if(b.selection){this._ignoreSelect=!1;for(a=b.selection.createRange().parentElement();a;){if(a===this._clientDiv){b.selection.empty();break}a=a.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleCompositionStart:function(a){this._ignoreEvent(a)||(this._startIME(),this._mutationObserver&&
(this._mutationObserver.disconnect(),this._mutationObserver=null))},_handleCompositionEnd:function(a){this._ignoreEvent(a)||this._commitIME(a.data)},_handleContextMenu:function(a){if(!this._ignoreEvent(a)){g.isIE&&3===this._lastMouseButton&&this._updateDOMSelection();var b=!1;this.isListening("ContextMenu")?(b=this._createMouseEvent("ContextMenu",a),b.screenX=a.screenX,b.screenY=a.screenY,this.onContextMenu(b),b=b.defaultPrevented):g.isMac&&(g.isFirefox&&0===a.button)&&(b=!0);if(b)return a.preventDefault&&
a.preventDefault(),!1;this._contextMenuOpen=!0;g.isFirefox&&(this._checkSelectionChange=!0,this._pollSelectionChange(!0))}},_handleCopy:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)&&!this._ignoreCopy&&this._doCopy(a))return a.preventDefault&&a.preventDefault(),!1},_handleCut:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)&&this._doCut(a))return a.preventDefault&&a.preventDefault(),!1},_handleDataModified:function(a){this._ignoreEvent(a)||this._startIME()},_handleDblclick:function(a){this._ignoreEvent(a)||
(this._lastMouseTime=a.timeStamp?a.timeStamp:(new Date).getTime(),2!==this._clickCount&&(this._clickCount=2,this._handleMouse(a)))},_handleDragStart:function(a){if(!this._ignoreEvent(a)){if(13>g.isFirefox){var b=this;this._getWindow().setTimeout(function(){b._clientDiv.contentEditable=!0;b._clientDiv.draggable=!1;b._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&-1!==this._dragOffset)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",a)),this._dragOffset=-1;else return a.preventDefault&&
a.preventDefault(),!1}},_handleDrag:function(a){if(!this._ignoreEvent(a)&&this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",a))},_handleDragEnd:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",a));13>g.isFirefox&&(this._fixCaret(),"none"===a.dataTransfer.dropEffect&&!a.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(a){if(!this._ignoreEvent(a)){var b=
!0;this._dropTarget=!0;this.isListening("DragEnter")&&(b=!1,this.onDragEnter(this._createMouseEvent("DragEnter",a)));if(g.isWebkit||b)return a.preventDefault&&a.preventDefault(),!1}},_handleDragOver:function(a){if(!this._ignoreEvent(a)){var b=!0;this.isListening("DragOver")&&(b=!1,this.onDragOver(this._createMouseEvent("DragOver",a)));if(g.isWebkit||b)return b&&(a.dataTransfer.dropEffect="none"),a.preventDefault&&a.preventDefault(),!1}},_handleDragLeave:function(a){if(!this._ignoreEvent(a)&&(this._dropTarget=
!1,this.isListening("DragLeave")))this.onDragLeave(this._createMouseEvent("DragLeave",a))},_handleDrop:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",a));a.preventDefault&&a.preventDefault();return!1}},_handleFocus:function(a){this._hasFocus=!0;g.isIOS&&void 0!==this._lastTouchOffset?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=void 0):this._updateDOMSelection();this._cursorDiv&&(this._cursorDiv.style.display=
"block");this._selDiv1&&(a=this._highlightRGB,this._selDiv1.style.background=a,this._selDiv2.style.background=a,this._selDiv3.style.background=a);if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)){if(this.isListening("KeyDown")){var b=this._createKeyEvent("KeyDown",a);this.onKeyDown(b);if(b.defaultPrevented){g.isFirefox&&(this._keyDownPrevented=!0);a.preventDefault();return}}b=!1;switch(a.keyCode){case 16:case 17:case 18:case 91:b=
!0;break;default:this._setLinksVisible(!1)}if(229===a.keyCode){if(this._readonly)return a.preventDefault&&a.preventDefault(),!1;b=!0;g.isSafari&&g.isMac&&a.ctrlKey&&(b=!1,a.keyCode=129);b&&this._startIME()}else b||this._commitIME();if((g.isMac||g.isLinux)&&4>g.isFirefox||12.16>g.isOpera)return this._keyDownEvent=a,!0;if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1}},_handleKeyPress:function(a){if(!this._ignoreEvent(a))if(this._keyDownPrevented)a.preventDefault&&
(a.preventDefault(),a.stopPropagation()),this._keyDownPrevented=void 0;else{if(g.isMac&&g.isWebkit&&(63232<=a.keyCode&&63487>=a.keyCode||13===a.keyCode||8===a.keyCode)||((g.isMac||g.isLinux)&&4>g.isFirefox||12.16>g.isOpera)&&this._doAction(this._keyDownEvent))return a.preventDefault&&a.preventDefault(),!1;var b=g.isMac?a.metaKey:a.ctrlKey;if(void 0!==a.charCode&&b)switch(a.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(b=this._createKeyEvent("KeyPress",a),this.onKeyPress(b),
b.defaultPrevented)){a.preventDefault();return}if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1;b=!1;if(g.isMac){if(a.ctrlKey||a.metaKey)b=!0}else if(g.isFirefox){if(a.ctrlKey||a.altKey)b=!0}else a.ctrlKey^a.altKey&&(b=!0);if(!b&&(b=g.isOpera?a.which:void 0!==a.charCode?a.charCode:a.keyCode,31<b))return this._doContent(String.fromCharCode(b)),a.preventDefault&&a.preventDefault(),!1}},_handleDocKeyUp:function(a){(g.isMac?
a.metaKey:a.ctrlKey)||this._setLinksVisible(!1)},_handleKeyUp:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyUp")){var b=this._createKeyEvent("KeyUp",a);this.onKeyUp(b);if(b.defaultPrevented){a.preventDefault();return}}this._handleDocKeyUp(a);13===a.keyCode&&this._commitIME()}},_handleLinkClick:function(a){if(!(g.isMac?a.metaKey:a.ctrlKey))return a.preventDefault&&a.preventDefault(),!1},_handleMouse:function(a){var b=this._getWindow(),e=!0,d=b;if(g.isIE||g.isFirefox&&!this._overlayDiv)d=
this._clientDiv;if(this._overlayDiv){this._hasFocus&&(this._ignoreFocus=!0);var f=this;b.setTimeout(function(){f.focus();f._ignoreFocus=!1},0)}1===this._clickCount?(e=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,(!g.isOpera||12.16<=g.isOpera)&&this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(d):(this._isW3CEvents&&this._setGrab(d),this._doubleClickSelection=null,this._setSelectionTo(a.clientX,a.clientY,a.shiftKey),this._doubleClickSelection=this._getSelection());return e},_handleMouseDown:function(a){if(!this._ignoreEvent(a)){if(this._linksVisible)if("A"!==
(a.target||a.srcElement).tagName)this._setLinksVisible(!1);else return;this._commitIME();var b=a.which;b||(4===a.button&&(b=2),2===a.button&&(b=3),1===a.button&&(b=1));var e=2!==b&&a.timeStamp?a.timeStamp:(new Date).getTime(),d=e-this._lastMouseTime,f=Math.abs(this._lastMouseX-a.clientX),h=Math.abs(this._lastMouseY-a.clientY),p=this._lastMouseButton===b;this._lastMouseX=a.clientX;this._lastMouseY=a.clientY;this._lastMouseTime=e;this._lastMouseButton=b;1===b&&(this._isMouseDown=!0,p&&d<=this._clickTime&&
f<=this._clickDist&&h<=this._clickDist?this._clickCount++:this._clickCount=1);if(this.isListening("MouseDown")&&(e=this._createMouseEvent("MouseDown",a),this.onMouseDown(e),e.defaultPrevented)){a.preventDefault();return}if(1===b&&this._handleMouse(a)&&(9<=g.isIE||g.isOpera||g.isChrome||g.isSafari||g.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),a.preventDefault();g.isFirefox&&3===this._lastMouseButton&&this._updateDOMSelection()}},_handleMouseOver:function(a){if(!this._ignoreEvent(a)&&
!this._animation&&this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",a))},_handleMouseOut:function(a){if(!this._ignoreEvent(a)&&!this._animation&&this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",a))},_handleMouseMove:function(a){if(!this._animation){var b=this._isClientDiv(a);if(this.isListening("MouseMove")&&b)this.onMouseMove(this._createMouseEvent("MouseMove",a));if(!this._dropTarget){var e=this._linksVisible||this._lastMouseMoveX!==
a.clientX||this._lastMouseMoveY!==a.clientY;this._lastMouseMoveX=a.clientX;this._lastMouseMoveY=a.clientY;this._setLinksVisible(e&&!this._isMouseDown&&(g.isMac?a.metaKey:a.ctrlKey));this._checkOverlayScroll();if(!this._isW3CEvents){if(0===a.button)return this._setGrab(null),!0;if(!this._isMouseDown&&1===a.button&&0!==(this._clickCount&1)&&b)return this._clickCount=2,this._handleMouse(a,this._clickCount)}if(this._isMouseDown&&-1===this._dragOffset){b=a.clientX;a=a.clientY;var d=this._getViewPadding(),
f=this._viewDiv.getBoundingClientRect(),h=this._getClientWidth(),p=this._getClientHeight(),e=f.left+d.left,k=f.top+d.top,h=f.left+d.left+h,d=f.top+d.top+p;a<k?this._doAutoScroll("up",b,a-k):a>d?this._doAutoScroll("down",b,a-d):b<e&&!this._wrapMode?this._doAutoScroll("left",b-e,a):b>h&&!this._wrapMode?this._doAutoScroll("right",b-h,a):(this._endAutoScroll(),this._setSelectionTo(b,a,!0))}}}},_isClientDiv:function(a){var b=this._overlayDiv||this._clientDiv;for(a=a.target?a.target:a.srcElement;a;){if(b===
a)return!0;a=a.parentNode}return!1},_createKeyEvent:function(a,b){return{type:a,event:b,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,b){var e=this.convert({x:b.clientX,y:b.clientY},"page","document");return{type:a,event:b,clickCount:this._clickCount,x:e.x,y:e.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(a){var b=a.which?0===a.button:1===a.button;if(this.isListening("MouseUp")&&(this._isClientDiv(a)||b&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",
a));if(!this._linksVisible){if(b&&this._isMouseDown){if(-1!==this._dragOffset){var e=this._getSelection();e.extend(this._dragOffset);e.collapse();this._setSelection(e,!0,!0);this._dragOffset=-1}this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null)}b&&g.isFirefox&&(this._updateDOMSelection(),a.preventDefault())}},_handleMouseWheel:function(a){var b=this._getLineHeight(),e=0,d=0;g.isIE||g.isOpera?d=-a.wheelDelta/40*b:g.isFirefox?"wheel"===a.type?a.deltaMode?(e=Math.max(-256,
Math.min(256,a.deltaX))*b,d=Math.max(-256,Math.min(256,a.deltaY))*b):(e=a.deltaX,d=a.deltaY):(b=g.isMac?3*a.detail:Math.max(-256,Math.min(256,a.detail))*b,a.axis===a.HORIZONTAL_AXIS?e=b:d=b):g.isMac?(d=a.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=a.timeStamp,e=0!==a.wheelDeltaX%120?1:40>d?40/(40-d):40,d=0!==a.wheelDeltaY%120?1:40>d?40/(40-d):40,e=Math.ceil(-a.wheelDeltaX/e),-1<e&&0>e&&(e=-1),0<e&&1>e&&(e=1),d=Math.ceil(-a.wheelDeltaY/d),-1<d&&0>d&&(d=-1),0<d&&1>d&&(d=1)):(e=-a.wheelDeltaX,
d=8*(-a.wheelDeltaY/120)*b);if(g.isSafari||g.isChrome&&g.isMac){for(b=a.target;b&&void 0===b.lineIndex;)b=b.parentNode;this._mouseWheelLine=b}b=this._getScroll();this._scrollView(e,d);e=this._getScroll();if(b.x!==e.x||b.y!==e.y)return a.preventDefault&&a.preventDefault(),!1},_handlePaste:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)&&!this._ignorePaste&&this._doPaste(a)){if(g.isIE){var b=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){b._updateDOMSelection();
b._ignoreFocus=!1},0)}a.preventDefault&&a.preventDefault();return!1}},_handleResize:function(a){a=this._rootDiv.clientWidth;var e=this._rootDiv.clientHeight;if(this._rootWidth!==a||this._rootHeight!==e)this._rootWidth!==a&&this._wrapMode&&this._resetLineHeight(),this._rootWidth=a,this._rootHeight=e,a=9>g.isIE,e=this._calculateMetrics(),b(e,this._metrics)||(this._variableLineHeight&&(this._variableLineHeight=!1,this._resetLineHeight()),this._metrics=e,a=!0),a?this._queueUpdate():this._update()},_handleRulerEvent:function(a){for(var b=
a.target?a.target:a.srcElement,e=b.lineIndex;b&&!b._ruler;)void 0===e&&void 0!==b.lineIndex&&(e=b.lineIndex),b=b.parentNode;var d=b?b._ruler:null;if(void 0===e&&d&&"document"===d.getOverview()){var e=this._getClientHeight(),g=this._model.getLineCount(),f=this._getViewPadding(),h=this._viewDiv.getBoundingClientRect(),e=Math.floor((a.clientY-h.top-this._metrics.scrollWidth)*g/(e+f.top+f.bottom-2*this._metrics.scrollWidth));0<=e&&e<g||(e=void 0)}if(d)switch(a.type){case "click":if(d.onClick)d.onClick(e,
a);break;case "dblclick":if(d.onDblClick)d.onDblClick(e,a);break;case "mousemove":if(d.onMouseMove)d.onMouseMove(e,a);break;case "mouseover":if(d.onMouseOver)d.onMouseOver(e,a);break;case "mouseout":if(d.onMouseOut){for(g=a.relatedTarget;g&&g!==this._rootDiv;){if(g===b)return;g=g.parentNode}d.onMouseOut(e,a)}}},_handleScroll:function(){this._lastScrollTime=(new Date).getTime();var a=this._getScroll(!1),b=this._hScroll,e=this._vScroll;if(b!==a.x||e!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),
this._update(e===a.y),this.onScroll({type:"Scroll",oldValue:{x:b,y:e},newValue:a})},_handleSelectStart:function(a){var b=this._contextMenuOpen;this._contextMenuOpen=!1;if(b)this._checkSelectionChange=!0;else if(this._ignoreSelect)return a&&a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,b){if(a){var e;e="DIV"===a.tagName?a:a.parentNode.parentNode;return!e._line?0:e._line.getModelOffset(a,b)}},_updateSelectionFromDOM:function(){if(!g.isIOS&&!g.isAndroid&&!this._checkSelectionChange)return!1;
var a=this._getWindow().getSelection(),b=this._getModelOffset(a.anchorNode,a.anchorOffset),e=this._getModelOffset(a.focusNode,a.focusOffset),d=this._getSelection();if(void 0===b||void 0===e||d.start===b&&d.end===e)return!1;if(this._checkSelectionChange){var d=this._getLineNext(),f=this._getLinePrevious();if(a.anchorNode===d.firstChild.firstChild&&0===a.anchorOffset&&a.focusNode===f.firstChild.firstChild&&0===a.focusOffset)return!1;if(a.anchorNode===d.firstChild.firstChild&&0===a.anchorOffset&&a.focusNode===
f.lastChild.firstChild||a.anchorNode===this._clientDiv&&a.focusNode===this._clientDiv)b=0,e=this.getModel().getCharCount()}this._setSelection(new y(b,e),!1,!1);this._checkSelectionChange=!1;return!0},_cancelCheckSelection:function(){this._checkSelectionChange&&(this._checkSelectionChange=!1,this._cancelPollSelectionChange())},_cancelPollSelectionChange:function(){this._selPollTimer&&(this._getWindow().clearTimeout(this._selPollTimer),this._selPollTimer=null)},_pollSelectionChange:function(a){var b=
this,e=this._getWindow();this._cancelPollSelectionChange();this._selPollTimer=e.setTimeout(function(){b._selPollTimer=null;b._clientDiv&&!b._updateSelectionFromDOM()&&a&&b._pollSelectionChange(a)},100)},_handleSelectionChange:function(a){-1===this._imeOffset&&(g.isAndroid?this._pollSelectionChange():this._updateSelectionFromDOM())},_handleTextInput:function(a){if(!this._ignoreEvent(a)){this._imeOffset=-1;var b=this._getWindow().getSelection();if(b.anchorNode!==this._anchorNode||b.focusNode!==this._focusNode||
b.anchorOffset!==this._anchorOffset||b.focusOffset!==this._focusOffset){for(var e=b.anchorNode;e&&void 0===e.lineIndex;)e=e.parentNode;if(e){var d=this._model,f=e.lineIndex,h=d.getLine(f),p=h,k=0,d=d.getLineStart(f);0<b.rangeCount&&(b.getRangeAt(0).deleteContents(),f=e.ownerDocument.createTextNode(a.data),b.getRangeAt(0).insertNode(f),k=this._getDOMText(e,f),p=k.text,k=k.offset,f.parentNode.removeChild(f));e.lineRemoved=!0;for(e=0;h.charCodeAt(e)===p.charCodeAt(e)&&e<k;)e++;b=h.length-1;for(f=p.length-
h.length;h.charCodeAt(b)===p.charCodeAt(b+f)&&b+f>=k+a.data.length;)b--;b++;h=p.substring(e,b+f);this._ignoreQueueUpdate=g.isSafari;this._modifyContent({text:h,start:e+d,end:b+d,_ignoreDOMSelection:!0,_ignoreDOMSelection1:g.isChrome},!0);this._ignoreQueueUpdate=!1}}else this._doContent(a.data);a.preventDefault()}},_handleTouchStart:function(a){this._commitIME();var b=this._getWindow();this._touchScrollTimer&&(this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",b.clearInterval(this._touchScrollTimer),
this._touchScrollTimer=null);var e=a.touches;if(1===e.length){var e=e[0],d=e.clientX,f=e.clientY;this._touchStartX=d;this._touchStartY=f;if(g.isAndroid&&(f<e.pageY-b.pageYOffset||d<e.pageX-b.pageXOffset))d=e.pageX-b.pageXOffset,f=e.pageY-b.pageYOffset;b=this.convert({x:d,y:f},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(b.x,b.y);this._touchStartTime=a.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var b=a.touches;if(1===b.length){b=b[0];this._touchCurrentX=b.clientX;
this._touchCurrentY=b.clientY;if(!this._touchScrollTimer&&200>a.timeStamp-this._touchStartTime){this._vScrollDiv.style.display="block";this._wrapMode||(this._hScrollDiv.style.display="block");var e=this,d=this._getWindow();this._touchScrollTimer=d.setInterval(function(){var a=0,b=0;if(e._touching)a=e._touchStartX-e._touchCurrentX,b=e._touchStartY-e._touchCurrentY,e._touchSpeedX=a/10,e._touchSpeedY=b/10,e._touchStartX=e._touchCurrentX,e._touchStartY=e._touchCurrentY;else{if(0.1>Math.abs(e._touchSpeedX)&&
0.1>Math.abs(e._touchSpeedY)){e._vScrollDiv.style.display="none";e._hScrollDiv.style.display="none";d.clearInterval(e._touchScrollTimer);e._touchScrollTimer=null;return}a=10*e._touchSpeedX;b=10*e._touchSpeedY;e._touchSpeedX*=0.95;e._touchSpeedY*=0.95}e._scrollView(a,b)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){0===a.touches.length&&(this._touching=!1)},_doAction:function(a){var b,e,d=this._keyModes;for(e=d.length-1;0<=e;e--)if(b=d[e],"function"===typeof b.match&&
(b=b.match(a),void 0!==b))return this.invokeAction(b);return!1},_doMove:function(a,b){var e=this._model,d=b.getCaret(),g=e.getLineAtOffset(d);a.count||(a.count=1);for(;0!==a.count;){var f=e.getLineStart(g);if(0>a.count&&d===f)if(0<g)"character"===a.unit&&a.count++,g--,b.extend(e.getLineEnd(g));else break;else if(0<a.count&&d===e.getLineEnd(g))if(g+1<e.getLineCount())"character"===a.unit&&a.count--,g++,b.extend(e.getLineStart(g));else break;else{var h=!1;a.expandTab&&("character"===a.unit&&0===(d-
f)%this._tabSize)&&(f=e.getText(f,d),h=!/[^ ]/.test(f));h?(b.extend(d-this._tabSize),a.count+=0>a.count?1:-1):(f=this._getLine(g),b.extend(f.getNextOffset(d,a)),f.destroy())}d=b.getCaret()}return b},_doBackspace:function(a){var b=this._getSelection();b.isEmpty()&&(a.count||(a.count=1),a.count*=-1,a.expandTab=this._expandTab,this._doMove(a,b));this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doCase:function(a){var b=this._getSelection();this._doMove(a,b);var e=this.getText(b.start,
b.end);this._setSelection(b,!0);switch(a.type){case "lower":e=e.toLowerCase();break;case "capitalize":e=e.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});break;case "reverse":a="";for(b=0;b<e.length;b++){var d=e[b],g=d.toLowerCase(),d=g!==d?g:d.toUpperCase();a+=d}e=a;break;default:e=e.toUpperCase()}this._doContent(e);return!0},_doContent:function(a){var b=this._getSelection();if(this._overwriteMode&&b.isEmpty()){var e=this._model,d=e.getLineAtOffset(b.end);b.end<e.getLineEnd(d)&&(e=this._getLine(d),
b.extend(e.getNextOffset(b.getCaret(),{unit:"character",count:1})),e.destroy())}return this._modifyContent({text:a,start:b.start,end:b.end,_ignoreDOMSelection:!0},!0)},_doCopy:function(a){var b=this._getSelection();return!b.isEmpty()?(b=this._getBaseText(b.start,b.end),this._setClipboardText(b,a)):!0},_doCursorNext:function(a){var b=this._getSelection();!b.isEmpty()&&!a.select?b.start=b.end:this._doMove(a,b);a.select||b.collapse();this._setSelection(b,!0);return!0},_doCursorPrevious:function(a){var b=
this._getSelection();!b.isEmpty()&&!a.select?b.end=b.start:(a.count||(a.count=1),a.count*=-1,this._doMove(a,b));a.select||b.collapse();this._setSelection(b,!0);return!0},_doCut:function(a){var b=this._getSelection();return!b.isEmpty()?(b=this._getBaseText(b.start,b.end),this._doContent(""),this._setClipboardText(b,a)):!0},_doDelete:function(a){var b=this._getSelection();b.isEmpty()&&this._doMove(a,b);this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doEnd:function(a){var b=this._getSelection(),
e=this._model,d;if(a.ctrl)b.extend(e.getCharCount()),d=function(){};else{var g=b.getCaret(),f=e.getLineAtOffset(g);if(this._wrapMode){var h=this._getLine(f),g=h.getLineIndex(g),g=g===h.getLineCount()-1?e.getLineEnd(f):h.getLineStart(g+1)-1;h.destroy()}else a.count&&0<a.count&&(f=Math.min(f+a.count-1,e.getLineCount()-1)),g=e.getLineEnd(f);b.extend(g)}a.select||b.collapse();this._setSelection(b,!0,!0,d);return!0},_doEnter:function(a){var b=this._model,e=this._getSelection();this._doContent(b.getLineDelimiter());
a&&a.noCursor&&(e.end=e.start,this._setSelection(e,!0));return!0},_doHome:function(a){var b=this._getSelection(),e=this._model,d;if(a.ctrl)b.extend(0),d=function(){};else{var g=b.getCaret(),f=e.getLineAtOffset(g);this._wrapMode?(e=this._getLine(f),g=e.getLineIndex(g),g=e.getLineStart(g),e.destroy()):g=e.getLineStart(f);b.extend(g)}a.select||b.collapse();this._setSelection(b,!0,!0,d);return!0},_doLineDown:function(a){var b=this._model,e=this._getSelection(),d=e.getCaret(),f=b.getLineAtOffset(d),h=
this._getLine(f),p=this._columnX,k=1,l=!1;if(-1===p||a.wholeLine||a.select&&g.isIE)p=a.wholeLine?b.getLineEnd(f+1):d,p=h.getBoundingClientRect(p).left;(d=h.getLineIndex(d))<h.getLineCount()-1?k=h.getClientRects(d+1).top+1:(d=b.getLineCount()-1,l=f===d,a.count&&0<a.count?f=Math.min(f+a.count,d):f++);d=!1;if(l){if(a.select||g.isMac||g.isLinux)e.extend(b.getCharCount()),d=!0}else h.lineIndex!==f&&(h.destroy(),h=this._getLine(f)),e.extend(h.getOffset(p,k)),d=!0;d&&(a.select||e.collapse(),this._setSelection(e,
!0,!0));this._columnX=p;h.destroy();return!0},_doLineUp:function(a){var b=this._model,e=this._getSelection(),d=e.getCaret(),f=b.getLineAtOffset(d),h=this._getLine(f),p=this._columnX,k=!1,l;if(-1===p||a.wholeLine||a.select&&g.isIE)p=a.wholeLine?b.getLineStart(f-1):d,p=h.getBoundingClientRect(p).left;0<(d=h.getLineIndex(d))?l=h.getClientRects(d-1).top+1:(k=0===f,k||(a.count&&0<a.count?f=Math.max(f-a.count,0):f--,l=this._getLineHeight(f)-1));d=!1;if(k){if(a.select||g.isMac||g.isLinux)e.extend(0),d=!0}else h.lineIndex!==
f&&(h.destroy(),h=this._getLine(f)),e.extend(h.getOffset(p,l)),d=!0;d&&(a.select||e.collapse(),this._setSelection(e,!0,!0));this._columnX=p;h.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(a){var b=this,e=this._model,d=this._getSelection(),f=d.getCaret(),h=e.getLineAtOffset(f),p=e.getLineCount(),k=this._getScroll(),e=this._getClientHeight(),l,q;if(this._lineHeight){l=this._columnX;k=this._getBoundsAtOffset(f);if(-1===l||a.select&&g.isIE)l=k.left;f=this._getLineIndex(k.top+e);
q=this._getLine(f);h=this._getLinePixel(f);f=q.getOffset(l,k.top+e-h);e=q.getBoundingClientRect(f);q.destroy();d.extend(f);a.select||d.collapse();this._setSelection(d,!0,!0,function(){b._columnX=l},e.top+h-k.top);return!0}if(h<p-1){var t=this._getLineHeight(),m=Math.min(p-h-1,Math.floor(e/t)),m=Math.max(1,m);l=this._columnX;if(-1===l||a.select&&g.isIE)q=this._getLine(h),l=q.getBoundingClientRect(f).left,q.destroy();q=this._getLine(h+m);d.extend(q.getOffset(l,0));q.destroy();a.select||d.collapse();
a=p*t;f=k.y+m*t;f+e>a&&(f=a-e);this._setSelection(d,!0,!0,function(){b._columnX=l},f-k.y)}return!0},_doPageUp:function(a){var b=this,e=this._model,d=this._getSelection(),f=d.getCaret(),h=e.getLineAtOffset(f),p=this._getScroll(),k=this._getClientHeight(),l;if(this._lineHeight){l=this._columnX;p=this._getBoundsAtOffset(f);if(-1===l||a.select&&g.isIE)l=p.left;f=this._getLineIndex(p.bottom-k);e=this._getLine(f);h=this._getLinePixel(f);f=e.getOffset(l,p.bottom-k-h);k=e.getBoundingClientRect(f);e.destroy();
d.extend(f);a.select||d.collapse();this._setSelection(d,!0,!0,function(){b._columnX=l},k.top+h-p.top);return!0}if(0<h){var q=this._getLineHeight(),k=Math.max(1,Math.min(h,Math.floor(k/q)));l=this._columnX;if(-1===l||a.select&&g.isIE)e=this._getLine(h),l=e.getBoundingClientRect(f).left,e.destroy();e=this._getLine(h-k);d.extend(e.getOffset(l,this._getLineHeight(h-k)-1));e.destroy();a.select||d.collapse();a=Math.max(0,p.y-k*q);this._setSelection(d,!0,!0,function(){b._columnX=l},a-p.y)}return!0},_doPaste:function(a){var b=
this;return null!==this._getClipboardText(a,function(a){a&&(g.isLinux&&2===b._lastMouseButton&&(new Date).getTime()-b._lastMouseTime<=b._clickTime&&b._setSelectionTo(b._lastMouseX,b._lastMouseY),b._doContent(a))})},_doScroll:function(a){var b=a.type,e=this._model,d=e.getLineCount();a=this._getClientHeight();var g=this._getLineHeight(),d=d*g,f=this._getScroll().y,h;switch(b){case "textStart":h=0;break;case "textEnd":h=d-a;break;case "pageDown":h=f+a;break;case "pageUp":h=f-a;break;case "lineDown":h=
f+g;break;case "lineUp":h=f-g;break;case "centerLine":b=this._getSelection(),h=e.getLineAtOffset(b.start),e=(e.getLineAtOffset(b.end)-h+1)*g,h=h*g-a/2+e/2}void 0!==h&&(h=Math.min(Math.max(0,h),d-a),this._scrollViewAnimated(0,h-f,function(){}));return!0},_doSelectAll:function(a){a=this._model;var b=this._getSelection();b.setCaret(0);b.extend(a.getCharCount());this._setSelection(b,!1);return!0},_doTab:function(a){if(this._tabMode&&!this._readonly){a="\t";if(this._expandTab){var b=this._model;a=this._getSelection().getCaret();
var e=b.getLineAtOffset(a),b=b.getLineStart(e);a=Array(this._tabSize-(a-b)%this._tabSize+1).join(" ")}this._doContent(a);return!0}},_doShiftTab:function(a){if(this._tabMode&&!this._readonly)return!0},_doOverwriteMode:function(a){if(!this._readonly)return this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),!0},_doTabMode:function(a){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(a){this.setOptions({wrapMode:!this.getOptions("wrapMode")});return!0},_autoScroll:function(){var a=
this._model,b=this._getSelection(),e=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),d=b.getCaret(),f=a.getLineCount(),h=a.getLineAtOffset(d),p;if("up"===this._autoScrollDir||"down"===this._autoScrollDir)d=this._autoScrollY/this._getLineHeight(),d=0>d?Math.floor(d):Math.ceil(d),p=Math.max(0,Math.min(f-1,h+d));else if("left"===this._autoScrollDir||"right"===this._autoScrollDir)p=this._getLineIndex(e.y),h=this._getLine(h),e.x+=h.getBoundingClientRect(d,!1).left,h.destroy();
0===p&&(g.isMac||g.isLinux)?b.extend(0):p===f-1&&(g.isMac||g.isLinux)?b.extend(a.getCharCount()):(h=this._getLine(p),b.extend(h.getOffset(e.x,e.y-this._getLinePixel(p))),h.destroy());this._setSelection(b,!0)},_autoScrollTimer:function(){this._autoScroll();var a=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){a._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(a){if(this._lineHeight&&!this._calculateLHTimer){var b=this._model.getLineCount(),e=0;if(a){a=
0;for(var d=(new Date).getTime(),g=0;e<b&&!(this._lineHeight[e]||(a++,g||(g=e),this._lineHeight[e]=this._calculateLineHeight(e)),e++,100<(new Date).getTime()-d););this.redrawRulers(0,b);this._queueUpdate()}a=this._getWindow();if(e!==b){var f=this;this._calculateLHTimer=a.setTimeout(function(){f._calculateLHTimer=null;f._calculateLineHeightTimer(!0)},0)}else this._calculateLHTimer&&(a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0)}},_calculateLineHeight:function(a){a=this._getLine(a);
var b=a.getBoundingClientRect();a.destroy();return Math.max(1,b.bottom-b.top)},_calculateMetrics:function(){var a=this._clientDiv,b=a.ownerDocument,e=g.createElement(b,"div");e.style.lineHeight="normal";var f={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(f);d(f.style,e);e.style.position="fixed";e.style.left="-1000px";var h=g.createElement(b,"span");h.appendChild(b.createTextNode(" "));e.appendChild(h);var p=g.createElement(b,"span");p.style.fontStyle=
"italic";p.appendChild(b.createTextNode(" "));e.appendChild(p);var k=g.createElement(b,"span");k.style.fontWeight="bold";k.appendChild(b.createTextNode(" "));e.appendChild(k);f=g.createElement(b,"span");f.style.fontWeight="bold";f.style.fontStyle="italic";f.appendChild(b.createTextNode(" "));e.appendChild(f);a.appendChild(e);var l=e.getBoundingClientRect(),h=h.getBoundingClientRect(),p=p.getBoundingClientRect(),k=k.getBoundingClientRect(),f=f.getBoundingClientRect(),h=h.bottom-h.top,p=p.bottom-p.top,
k=k.bottom-k.top,m=f.bottom-f.top,s=0,f=0>=l.bottom-l.top,l=Math.max(1,l.bottom-l.top);p>h&&(s=1);k>p&&(s=2);m>k&&(s=3);var n;0!==s&&(n={style:{}},0!==(s&1)&&(n.style.fontStyle="italic"),0!==(s&2)&&(n.style.fontWeight="bold"));h=t(e);a.removeChild(e);m=q(this._viewDiv);e=g.createElement(b,"div");e.style.position="fixed";e.style.left="-1000px";e.style.paddingLeft=m.left+"px";e.style.paddingTop=m.top+"px";e.style.paddingRight=m.right+"px";e.style.paddingBottom=m.bottom+"px";e.style.width="100px";e.style.height=
"100px";m=g.createElement(b,"div");m.style.width="100%";m.style.height="100%";e.appendChild(m);a.appendChild(e);s=e.getBoundingClientRect();p=m.getBoundingClientRect();k=0;this._singleMode||(e.style.overflow="hidden",m.style.height="200px",k=e.clientWidth,e.style.overflow="scroll",k-=e.clientWidth);a.removeChild(e);m={left:p.left-s.left,top:p.top-s.top,right:s.right-p.right,bottom:s.bottom-p.bottom};p=s=0;if(!f&&(this._wrapOffset||this._marginOffset))e=g.createElement(b,"div"),e.style.position="fixed",
e.style.left="-1000px",e.innerHTML=Array(this._wrapOffset+1+(g.isWebkit?0:1)).join(" "),a.appendChild(e),s=e.getBoundingClientRect(),s=Math.ceil(s.right-s.left),e.innerHTML=Array(this._marginOffset+1).join(" "),p=e.getBoundingClientRect(),p=Math.ceil(p.right-p.left),a.removeChild(e);return{lineHeight:l,largestFontStyle:n,lineTrim:h,viewPadding:m,scrollWidth:k,wrapWidth:s,marginWidth:p,invalid:f}},_cancelAnimation:function(){this._animation&&(this._animation.stop(),this._animation=null)},_clearSelection:function(a){var b=
this._getSelection();if(b.isEmpty())return!1;"next"===a?b.start=b.end:b.end=b.start;this._setSelection(b,!0);return!0},_commitIME:function(a){if(-1!==this._imeOffset){var b=this._model,e=b.getLineAtOffset(this._imeOffset),d=b.getLineStart(e),f=this._getLineNode(e);if(!a){this._scrollDiv.focus();this._clientDiv.focus();var h=this._getDOMText(f).text,b=b.getLine(e),d=this._imeOffset-d,b=d+h.length-b.length;d!==b&&(a=h.substring(d,b))}a&&(!this._doContent(a)&&!g.isWebkit)&&(f.lineRemoved=!0,this._queueUpdate());
this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new m.DefaultKeyMode(this));var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},lineUp:{defaultHandler:function(b){return a._doLineUp(e(b,{select:!1}))},actionDescription:{name:l.lineUp}},lineDown:{defaultHandler:function(b){return a._doLineDown(e(b,{select:!1}))},actionDescription:{name:l.lineDown}},lineStart:{defaultHandler:function(b){return a._doHome(e(b,{select:!1,ctrl:!1}))},actionDescription:{name:l.lineStart}},
lineEnd:{defaultHandler:function(b){return a._doEnd(e(b,{select:!1,ctrl:!1}))},actionDescription:{name:l.lineEnd}},charPrevious:{defaultHandler:function(b){return a._doCursorPrevious(e(b,{select:!1,unit:"character"}))},actionDescription:{name:l.charPrevious}},charNext:{defaultHandler:function(b){return a._doCursorNext(e(b,{select:!1,unit:"character"}))},actionDescription:{name:l.charNext}},pageUp:{defaultHandler:function(b){return a._doPageUp(e(b,{select:!1}))},actionDescription:{name:l.pageUp}},
pageDown:{defaultHandler:function(b){return a._doPageDown(e(b,{select:!1}))},actionDescription:{name:l.pageDown}},scrollPageUp:{defaultHandler:function(b){return a._doScroll(e(b,{type:"pageUp"}))},actionDescription:{name:l.scrollPageUp}},scrollPageDown:{defaultHandler:function(b){return a._doScroll(e(b,{type:"pageDown"}))},actionDescription:{name:l.scrollPageDown}},scrollLineUp:{defaultHandler:function(b){return a._doScroll(e(b,{type:"lineUp"}))},actionDescription:{name:l.scrollLineUp}},scrollLineDown:{defaultHandler:function(b){return a._doScroll(e(b,
{type:"lineDown"}))},actionDescription:{name:l.scrollLineDown}},wordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(e(b,{select:!1,unit:"word"}))},actionDescription:{name:l.wordPrevious}},wordNext:{defaultHandler:function(b){return a._doCursorNext(e(b,{select:!1,unit:"word"}))},actionDescription:{name:l.wordNext}},textStart:{defaultHandler:function(b){return a._doHome(e(b,{select:!1,ctrl:!0}))},actionDescription:{name:l.textStart}},textEnd:{defaultHandler:function(b){return a._doEnd(e(b,
{select:!1,ctrl:!0}))},actionDescription:{name:l.textEnd}},scrollTextStart:{defaultHandler:function(b){return a._doScroll(e(b,{type:"textStart"}))},actionDescription:{name:l.scrollTextStart}},scrollTextEnd:{defaultHandler:function(b){return a._doScroll(e(b,{type:"textEnd"}))},actionDescription:{name:l.scrollTextEnd}},centerLine:{defaultHandler:function(b){return a._doScroll(e(b,{type:"centerLine"}))},actionDescription:{name:l.centerLine}},selectLineUp:{defaultHandler:function(b){return a._doLineUp(e(b,
{select:!0}))},actionDescription:{name:l.selectLineUp}},selectLineDown:{defaultHandler:function(b){return a._doLineDown(e(b,{select:!0}))},actionDescription:{name:l.selectLineDown}},selectWholeLineUp:{defaultHandler:function(b){return a._doLineUp(e(b,{select:!0,wholeLine:!0}))},actionDescription:{name:l.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(b){return a._doLineDown(e(b,{select:!0,wholeLine:!0}))},actionDescription:{name:l.selectWholeLineDown}},selectLineStart:{defaultHandler:function(b){return a._doHome(e(b,
{select:!0,ctrl:!1}))},actionDescription:{name:l.selectLineStart}},selectLineEnd:{defaultHandler:function(b){return a._doEnd(e(b,{select:!0,ctrl:!1}))},actionDescription:{name:l.selectLineEnd}},selectCharPrevious:{defaultHandler:function(b){return a._doCursorPrevious(e(b,{select:!0,unit:"character"}))},actionDescription:{name:l.selectCharPrevious}},selectCharNext:{defaultHandler:function(b){return a._doCursorNext(e(b,{select:!0,unit:"character"}))},actionDescription:{name:l.selectCharNext}},selectPageUp:{defaultHandler:function(b){return a._doPageUp(e(b,
{select:!0}))},actionDescription:{name:l.selectPageUp}},selectPageDown:{defaultHandler:function(b){return a._doPageDown(e(b,{select:!0}))},actionDescription:{name:l.selectPageDown}},selectWordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(e(b,{select:!0,unit:"word"}))},actionDescription:{name:l.selectWordPrevious}},selectWordNext:{defaultHandler:function(b){return a._doCursorNext(e(b,{select:!0,unit:"word"}))},actionDescription:{name:l.selectWordNext}},selectTextStart:{defaultHandler:function(b){return a._doHome(e(b,
{select:!0,ctrl:!0}))},actionDescription:{name:l.selectTextStart}},selectTextEnd:{defaultHandler:function(b){return a._doEnd(e(b,{select:!0,ctrl:!0}))},actionDescription:{name:l.selectTextEnd}},deletePrevious:{defaultHandler:function(b){return a._doBackspace(e(b,{unit:"character"}))},actionDescription:{name:l.deletePrevious}},deleteNext:{defaultHandler:function(b){return a._doDelete(e(b,{unit:"character"}))},actionDescription:{name:l.deleteNext}},deleteWordPrevious:{defaultHandler:function(b){return a._doBackspace(e(b,
{unit:"word"}))},actionDescription:{name:l.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(b){return a._doDelete(e(b,{unit:"word"}))},actionDescription:{name:l.deleteWordNext}},deleteLineStart:{defaultHandler:function(b){return a._doBackspace(e(b,{unit:"line"}))},actionDescription:{name:l.deleteLineStart}},deleteLineEnd:{defaultHandler:function(b){return a._doDelete(e(b,{unit:"line"}))},actionDescription:{name:l.deleteLineEnd}},tab:{defaultHandler:function(b){return a._doTab()},actionDescription:{name:l.tab}},
shiftTab:{defaultHandler:function(b){return a._doShiftTab()},actionDescription:{name:l.shiftTab}},enter:{defaultHandler:function(b){return a._doEnter()},actionDescription:{name:l.enter}},enterNoCursor:{defaultHandler:function(b){return a._doEnter(e(b,{noCursor:!0}))},actionDescription:{name:l.enterNoCursor}},selectAll:{defaultHandler:function(b){return a._doSelectAll()},actionDescription:{name:l.selectAll}},copy:{defaultHandler:function(b){return a._doCopy()},actionDescription:{name:l.copy}},cut:{defaultHandler:function(b){return a._doCut()},
actionDescription:{name:l.cut}},paste:{defaultHandler:function(b){return a._doPaste()},actionDescription:{name:l.paste}},uppercase:{defaultHandler:function(b){return a._doCase(e(b,{type:"upper"}))},actionDescription:{name:l.uppercase}},lowercase:{defaultHandler:function(b){return a._doCase(e(b,{type:"lower"}))},actionDescription:{name:l.lowercase}},capitalize:{defaultHandler:function(b){return a._doCase(e(b,{unit:"word",type:"capitalize"}))},actionDescription:{name:l.capitalize}},reversecase:{defaultHandler:function(b){return a._doCase(e(b,
{type:"reverse"}))},actionDescription:{name:l.reversecase}},toggleOverwriteMode:{defaultHandler:function(b){return a._doOverwriteMode()},actionDescription:{name:l.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(b){return a._doTabMode()},actionDescription:{name:l.toggleTabMode}},toggleWrapMode:{defaultHandler:function(b){return a._doWrapMode()},actionDescription:{name:l.toggleWrapMode}}}},_createRulerParent:function(a,b){var e=g.createElement(a,"div");e.className=b;e.tabIndex=-1;e.style.overflow=
"hidden";e.style.MozUserSelect="none";e.style.WebkitUserSelect="none";e.style.position="absolute";e.style.top="0px";e.style.bottom="0px";e.style.cursor="default";e.style.display="none";e.setAttribute("aria-hidden","true");this._rootDiv.appendChild(e);return e},_createRuler:function(a,b){if(this._clientDiv){var e=this._getRulerParent(a);if(e){if(e!==this._marginDiv||this._marginOffset)e.style.display="block";var d=g.createElement(e.ownerDocument,"div");d._ruler=a;d.rulerChanged=!0;d.style.position=
"relative";d.style.cssFloat="left";d.style.styleFloat="left";d.style.outline="none";if(void 0===b||0>b||b>=e.children.length)e.appendChild(d);else{for(var f=e.firstChild;f&&0<b--;)f=f.nextSibling;e.insertBefore(d,f)}}}},_createView:function(){function a(){h._rootDiv&&(h.update(!0),h._metrics.invalid&&h._getWindow().setTimeout(function(){a()},100))}if(!this._clientDiv){for(var b=this._parent;b.hasChildNodes();)b.removeChild(b.lastChild);var e=b.ownerDocument,d=g.createElement(e,"div");this._rootDiv=
d;d.tabIndex=-1;d.style.position="relative";d.style.overflow="hidden";d.style.width="100%";d.style.height="100%";d.style.overflow="hidden";d.style.WebkitTextSizeAdjust="100%";d.setAttribute("role","application");b.appendChild(d);this._leftDiv=this._createRulerParent(e,"textviewLeftRuler");b=g.createElement(e,"div");b.className="textviewScroll";this._viewDiv=b;b.tabIndex=-1;b.style.position="absolute";b.style.top="0px";b.style.bottom="0px";b.style.borderWidth="0px";b.style.margin="0px";b.style.outline=
"none";b.style.background="transparent";d.appendChild(b);var f=this._createRulerParent(e,"textviewRightRuler");this._rightDiv=f;f.style.right="0px";this._scrollDiv=f=g.createElement(e,"div");f.style.margin="0px";f.style.borderWidth="0px";f.style.padding="0px";b.appendChild(f);(this._marginDiv=this._createRulerParent(e,"textviewMarginRuler")).style.zIndex="4";!g.isIE&&!g.isIOS&&(this._clipDiv=b=g.createElement(e,"div"),b.style.position="absolute",b.style.overflow="hidden",b.style.margin="0px",b.style.borderWidth=
"0px",b.style.padding="0px",b.style.background="transparent",d.appendChild(b),this._clipScrollDiv=f=g.createElement(e,"div"),f.style.position="absolute",f.style.height="1px",f.style.top="-1000px",f.style.background="transparent",b.appendChild(f));this._setFullSelection(this._fullSelection,!0);b=g.createElement(e,"div");b.className="textviewContent";this._clientDiv=b;b.tabIndex=0;b.style.position="absolute";b.style.borderWidth="0px";b.style.margin="0px";b.style.padding="0px";b.style.outline="none";
b.style.zIndex="1";b.style.WebkitUserSelect="text";b.setAttribute("spellcheck","false");if(g.isIOS||g.isAndroid)b.style.WebkitTapHighlightColor="transparent";(this._clipDiv||d).appendChild(b);if(g.isIOS||g.isAndroid)this._vScrollDiv=f=g.createElement(e,"div"),f.style.position="absolute",f.style.borderWidth="1px",f.style.borderColor="white",f.style.borderStyle="solid",f.style.borderRadius="4px",f.style.backgroundColor="black",f.style.opacity="0.5",f.style.margin="0px",f.style.padding="0px",f.style.outline=
"none",f.style.zIndex="3",f.style.width="8px",f.style.display="none",d.appendChild(f),this._hScrollDiv=f=g.createElement(e,"div"),f.style.position="absolute",f.style.borderWidth="1px",f.style.borderColor="white",f.style.borderStyle="solid",f.style.borderRadius="4px",f.style.backgroundColor="black",f.style.opacity="0.5",f.style.margin="0px",f.style.padding="0px",f.style.outline="none",f.style.zIndex="3",f.style.height="8px",f.style.display="none",d.appendChild(f);g.isFirefox&&!b.setCapture&&(this._overlayDiv=
f=g.createElement(e,"div"),f.style.position=b.style.position,f.style.borderWidth=b.style.borderWidth,f.style.margin=b.style.margin,f.style.padding=b.style.padding,f.style.cursor="text",f.style.zIndex="2",(this._clipDiv||d).appendChild(f));b.contentEditable="true";b.setAttribute("role","textbox");b.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);this._setMarginOffset(this._marginOffset,
!0);this._hookEvents();b=this._rulers;for(f=0;f<b.length;f++)this._createRuler(b[f]);this._update();var h=this;s(e,d,"textview",a)}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,update:this.setModel},scrollAnimation:{value:0,update:null},readonly:{value:!1,update:this._setReadOnly},fullSelection:{value:!0,update:this._setFullSelection},tabMode:{value:!0,update:null},tabSize:{value:8,update:this._setTabSize},expandTab:{value:!1,update:null},singleMode:{value:!1,
update:this._setSingleMode},overwriteMode:{value:!1,update:this._setOverwriteMode},blockCursorVisible:{value:!1,update:this._setBlockCursor},marginOffset:{value:0,update:this._setMarginOffset},wrapOffset:{value:0,update:this._setWrapOffset},wrapMode:{value:!1,update:this._setWrapMode},wrappable:{value:!1,update:null},theme:{value:f.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var b=this._getRulerParent(a);if(b)for(var e=
b.firstChild;e;){if(e._ruler===a){e._ruler=void 0;b.removeChild(e);if(0===b.children.length&&(b!==this._marginDiv||!this._marginOffset))b.style.display="none";break}e=e.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();var a=this._getWindow();this._autoScrollTimerID&&(a.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null);this._updateTimer&&(a.clearTimeout(this._updateTimer),this._updateTimer=null);a=this._rootDiv;a.parentNode.removeChild(a);
this._hScrollDiv=this._vScrollDiv=this._cursorDiv=this._marginDiv=this._rightDiv=this._leftDiv=this._overlayDiv=this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(a,b,e){this._autoScrollDir=a;this._autoScrollX=b;this._autoScrollY=e;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);
this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var a=this._clientDiv;if(a){var b=this._hasFocus;this._ignoreFocus=!0;b&&a.blur();a.contentEditable=!1;a.contentEditable=!0;b&&a.focus();this._ignoreFocus=!1}},_getBaseText:function(a,b){var e=this._model;e.getBaseModel&&(a=e.mapOffset(a),b=e.mapOffset(b),e=e.getBaseModel());return e.getText(a,b)},_getBottomIndex:function(a){var b=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){a=b.getBoundingClientRect();
var e=this._clientDiv.getBoundingClientRect();a.bottom>e.bottom&&(b=this._getLinePrevious(b)||b)}return b.lineIndex},_getBoundsAtOffset:function(a){var b=this._getLine(this._model.getLineAtOffset(a));a=b.getBoundingClientRect(a);var e=this._getLinePixel(b.lineIndex);a.top+=e;a.bottom+=e;b.destroy();return a},_getClientHeight:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-a.top-a.bottom)},_getClientWidth:function(){var a=this._getViewPadding();return Math.max(0,
this._viewDiv.clientWidth-a.left-a.right)},_getClipboardText:function(a,b){var e=this._model.getLineDelimiter(),d,f,h=this._getWindow(),k=h.clipboardData;!k&&a&&(k=a.clipboardData);if(k)return d=[],f=k.getData(g.isIE?"Text":"text/plain"),p(f,function(a){d.push(a)},function(){d.push(e)}),f=d.join(""),b&&b(f),f;if(g.isFirefox){this._ignoreFocus=!0;var l=this._clipboardDiv,k=this._rootDiv.ownerDocument;l||(this._clipboardDiv=l=g.createElement(k,"div"),l.style.position="fixed",l.style.whiteSpace="pre",
l.style.left="-1000px",this._rootDiv.appendChild(l));l.innerHTML="\x3cpre contenteditable\x3d''\x3e\x3c/pre\x3e";l.firstChild.focus();var q=this,t=function(){var a=q._getTextFromElement(l);l.innerHTML="";d=[];p(a,function(a){d.push(a)},function(){d.push(e)});return d.join("")},m=!1;this._ignorePaste=!0;if(!g.isLinux||2!==this._lastMouseButton)try{m=k.execCommand("paste",!1,null)}catch(s){m=1<l.childNodes.length||l.firstChild&&0<l.firstChild.childNodes.length}this._ignorePaste=!1;if(!m){if(a)return h.setTimeout(function(){q.focus();
(f=t())&&b&&b(f);q._ignoreFocus=!1},0),null;this.focus();this._ignoreFocus=!1;return""}this.focus();this._ignoreFocus=!1;(f=t())&&b&&b(f);return f}return""},_getDOMText:function(a,b){return a._line.getText(b)},_getTextFromElement:function(a){var b=a.ownerDocument,e=b.defaultView;if(!e.getSelection)return a.innerText||a.textContent;b=b.createRange();b.selectNode(a);a=e.getSelection();var e=[],d;for(d=0;d<a.rangeCount;d++)e.push(a.getRangeAt(d));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(b);
b=a.toString();a.removeAllRanges();for(d=0;d<e.length;d++)a.addRange(e[d]);this._ignoreSelect=!1;return b},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var b=this._getLineNode(a);return b&&!b.lineChanged&&!b.lineRemoved?b._line:new x(this,a)},_getLineHeight:function(a,b){if(void 0!==a&&this._lineHeight){var e=this._lineHeight[a];if(e)return e;if(b||void 0===b)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var b=
this._clientDiv.firstChild;b;){if(a===b.lineIndex)return b;b=b.nextSibling}},_getLineNext:function(a){for(a=a?a.nextSibling:this._clientDiv.firstChild;a&&(-1===a.lineIndex||!a._line);)a=a.nextSibling;return a},_getLinePrevious:function(a){for(a=a?a.previousSibling:this._clientDiv.lastChild;a&&(-1===a.lineIndex||!a._line);)a=a.previousSibling;return a},_getLinePixel:function(a){a=Math.min(Math.max(0,a),this._model.getLineCount());if(this._lineHeight){var b=this._getTopIndex(),e=-this._topIndexY+this._getScroll().y;
if(a>b)for(;b<a;b++)e+=this._getLineHeight(b);else for(b-=1;b>=a;b--)e-=this._getLineHeight(b);return e}return this._getLineHeight()*a},_getLineIndex:function(a){var b,e=0,d=this._model.getLineCount();if(this._lineHeight){var e=this._getTopIndex(),g=-this._topIndexY+this._getScroll().y;if(a!==g)if(a<g)for(;a<g&&0<e;)a+=this._getLineHeight(--e);else for(b=this._getLineHeight(e);a-b>=g&&e<d-1;)a-=b,b=this._getLineHeight(++e)}else b=this._getLineHeight(),e=Math.floor(a/b);return Math.max(0,Math.min(d-
1,e))},_getRulerParent:function(a){switch(a.getLocation()){case "left":return this._leftDiv;case "right":return this._rightDiv;case "margin":return this._marginDiv}return null},_getScroll:function(a){(void 0===a||a)&&this._cancelAnimation();a=this._viewDiv;return{x:a.scrollLeft,y:a.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(a){var b=this._topChild;if(a&&this._getClientHeight()>this._getLineHeight()){a=b.getBoundingClientRect();var e=this._getViewPadding(),
d=this._viewDiv.getBoundingClientRect();a.top<d.top+e.top&&(b=this._getLineNext(b)||b)}return b.lineIndex},_hookEvents:function(){var a=this;this._modelListener={onChanging:function(b){a._onModelChanging(b)},onChanged:function(b){a._onModelChanged(b)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._themeListener={onChanged:function(b){a._setThemeClass(a._themeClass)}};this._theme.addEventListener("ThemeChanged",
this._themeListener.onChanged);var b=this._handlers=[],e=this._clientDiv,d=this._viewDiv,f=this._rootDiv,h=this._overlayDiv||e,p=e.ownerDocument,k=this._getWindow(),l=g.isIE?p:k;b.push({target:k,type:"resize",handler:function(b){return a._handleResize(b?b:k.event)}});b.push({target:e,type:"blur",handler:function(b){return a._handleBlur(b?b:k.event)}});b.push({target:e,type:"focus",handler:function(b){return a._handleFocus(b?b:k.event)}});b.push({target:d,type:"focus",handler:function(a){e.focus()}});
b.push({target:d,type:"scroll",handler:function(b){return a._handleScroll(b?b:k.event)}});b.push({target:e,type:"textInput",handler:function(b){return a._handleTextInput(b?b:k.event)}});b.push({target:e,type:"keydown",handler:function(b){return a._handleKeyDown(b?b:k.event)}});b.push({target:e,type:"keypress",handler:function(b){return a._handleKeyPress(b?b:k.event)}});b.push({target:e,type:"keyup",handler:function(b){return a._handleKeyUp(b?b:k.event)}});g.isIE&&b.push({target:p,type:"keyup",handler:function(b){return a._handleDocKeyUp(b?
b:k.event)}});b.push({target:e,type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:k.event)}});b.push({target:e,type:"copy",handler:function(b){return a._handleCopy(b?b:k.event)}});b.push({target:e,type:"cut",handler:function(b){return a._handleCut(b?b:k.event)}});b.push({target:e,type:"paste",handler:function(b){return a._handlePaste(b?b:k.event)}});b.push({target:p,type:"selectionchange",handler:function(b){return a._handleSelectionChange(b?b:k.event)}});if(g.isIOS||g.isAndroid)b.push({target:e,
type:"touchstart",handler:function(b){return a._handleTouchStart(b?b:k.event)}}),b.push({target:e,type:"touchmove",handler:function(b){return a._handleTouchMove(b?b:k.event)}}),b.push({target:e,type:"touchend",handler:function(b){return a._handleTouchEnd(b?b:k.event)}});else{b.push({target:e,type:"selectstart",handler:function(b){return a._handleSelectStart(b?b:k.event)}});b.push({target:e,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:k.event)}});b.push({target:e,type:"mouseover",
handler:function(b){return a._handleMouseOver(b?b:k.event)}});b.push({target:e,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:k.event)}});b.push({target:l,type:"mouseup",handler:function(b){return a._handleMouseUp(b?b:k.event)}});b.push({target:l,type:"mousemove",handler:function(b){return a._handleMouseMove(b?b:k.event)}});b.push({target:f,type:"mousedown",handler:function(b){return a._handleRootMouseDown(b?b:k.event)}});b.push({target:f,type:"mouseup",handler:function(b){return a._handleRootMouseUp(b?
b:k.event)}});b.push({target:h,type:"dragstart",handler:function(b){return a._handleDragStart(b?b:k.event)}});b.push({target:h,type:"drag",handler:function(b){return a._handleDrag(b?b:k.event)}});b.push({target:h,type:"dragend",handler:function(b){return a._handleDragEnd(b?b:k.event)}});b.push({target:h,type:"dragenter",handler:function(b){return a._handleDragEnter(b?b:k.event)}});b.push({target:h,type:"dragover",handler:function(b){return a._handleDragOver(b?b:k.event)}});b.push({target:h,type:"dragleave",
handler:function(b){return a._handleDragLeave(b?b:k.event)}});b.push({target:h,type:"drop",handler:function(b){return a._handleDrop(b?b:k.event)}});b.push({target:this._clientDiv,type:26<g.isFirefox?"wheel":g.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return a._handleMouseWheel(b?b:k.event)}});this._clipDiv&&b.push({target:this._clipDiv,type:26<g.isFirefox?"wheel":g.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return a._handleMouseWheel(b?b:k.event)}});if(g.isFirefox&&
(!g.isWindows||15<=g.isFirefox))(d=k.MutationObserver||k.MozMutationObserver)?(this._mutationObserver=new d(function(b){a._handleDataModified(b)}),this._mutationObserver.observe(e,{subtree:!0,characterData:!0})):b.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(b){return a._handleDataModified(b?b:k.event)}});if(g.isFirefox&&(!g.isWindows||15<=g.isFirefox)||g.isIE)b.push({target:this._clientDiv,type:"compositionstart",handler:function(b){return a._handleCompositionStart(b?
b:k.event)}}),b.push({target:this._clientDiv,type:"compositionend",handler:function(b){return a._handleCompositionEnd(b?b:k.event)}});this._overlayDiv&&(b.push({target:this._overlayDiv,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:k.event)}}),b.push({target:this._overlayDiv,type:"mouseover",handler:function(b){return a._handleMouseOver(b?b:k.event)}}),b.push({target:this._overlayDiv,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:k.event)}}),b.push({target:this._overlayDiv,
type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:k.event)}}));this._isW3CEvents||b.push({target:this._clientDiv,type:"dblclick",handler:function(b){return a._handleDblclick(b?b:k.event)}})}this._hookRulerEvents(this._leftDiv,b);this._hookRulerEvents(this._rightDiv,b);this._hookRulerEvents(this._marginDiv,b);for(d=0;d<b.length;d++)f=b[d],w(f.target,f.type,f.handler,f.capture)},_hookRulerEvents:function(a,b){if(a){var e=this,d=this._getWindow();g.isIE&&b.push({target:a,type:"selectstart",
handler:function(){return!1}});b.push({target:a,type:26<g.isFirefox?"wheel":g.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return e._handleMouseWheel(a?a:d.event)}});b.push({target:a,type:"click",handler:function(a){e._handleRulerEvent(a?a:d.event)}});b.push({target:a,type:"dblclick",handler:function(a){e._handleRulerEvent(a?a:d.event)}});b.push({target:a,type:"mousemove",handler:function(a){e._handleRulerEvent(a?a:d.event)}});b.push({target:a,type:"mouseover",handler:function(a){e._handleRulerEvent(a?
a:d.event)}});b.push({target:a,type:"mouseout",handler:function(a){e._handleRulerEvent(a?a:d.event)}})}},_getWindow:function(){return this._parent.ownerDocument.defaultView||this._parent.ownerDocument.parentWindow},_ignoreEvent:function(a){for(a=a.target;a&&a!==this._clientDiv;){if(a.ignore)return!0;a=a.parentNode}return!1},_init:function(a){var b=a.parent;"string"===typeof b&&(b=(a.document||document).getElementById(b));if(!b)throw"no parent";a.parent=b;a.model=a.model||new n.TextModel;var e=this._defaultOptions(),
d;for(d in e)e.hasOwnProperty(d)&&(this["_"+d]=void 0!==a[d]?a[d]:e[d].value);this._keyModes=[];this._rulers=[];this._selection=new y(0,0,!1);this._linksVisible=!1;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=!0;this._hasFocus=this._ignoreFocus=!1;this._dragOffset=this._columnX=-1;this._isRangeRects=(!g.isIE||9<=g.isIE)&&"function"===typeof b.ownerDocument.createRange().getBoundingClientRect;this._isW3CEvents=b.addEventListener;this._autoScrollTimerID=this._autoScrollY=
this._autoScrollX=null;this._AUTO_SCROLL_RATE=50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createView()},_checkOverlayScroll:function(){if(g.isMac&&g.isWebkit&&!this._metrics.invalid&&0===this._metrics.scrollWidth){var a=this._viewDiv,b=
this._isOverOverlayScroll();a.style.pointerEvents=b.vertical||b.horizontal?"":"none"}},_isOverOverlayScroll:function(){if(!(200>(new Date).getTime()-this._lastScrollTime))return{};var a=this._viewDiv.getBoundingClientRect(),b=this._lastMouseMoveX,e=this._lastMouseMoveY;return{vertical:a.top<=e&&e<a.bottom&&a.right-15<=b&&b<a.right,horizontal:a.bottom-15<=e&&e<a.bottom&&a.left<=b&&b<a.right}},_modifyContent:function(a,b){if(this._readonly&&!a._code)return!1;a.type="Verify";this.onVerify(a);if(null===
a.text||void 0===a.text)return!1;var e=this._model;try{a._ignoreDOMSelection&&(this._ignoreDOMSelection=!0),e.setText(a.text,a.start,a.end)}finally{a._ignoreDOMSelection&&(this._ignoreDOMSelection=!1)}if(b){e=this._getSelection();e.setCaret(a.start+a.text.length);try{a._ignoreDOMSelection1&&(this._ignoreDOMSelection=!0),this._setSelection(e,!0)}finally{a._ignoreDOMSelection1&&(this._ignoreDOMSelection=!1)}}this.onModify({type:"Modify"});return!0},_onModelChanged:function(a){a.type="ModelChanged";
this.onModelChanged(a);a.type="Changed";var b=a.start,e=a.addedCharCount,d=a.removedCharCount,g=a.addedLineCount,f=a.removedLineCount,h=this._getSelection();h.end>b&&(h.end>b&&h.start<b+d?h.setCaret(b+e):(h.start+=e-d,h.end+=e-d),this._setSelection(h,!1,!1));b=this._model.getLineAtOffset(b);for(e=this._getLineNext();e;)d=e.lineIndex,b<=d&&d<=b+f&&(b===d&&!e.modelChangedEvent&&!e.lineRemoved?(e.modelChangedEvent=a,e.lineChanged=!0):(e.lineRemoved=!0,e.lineChanged=!1,e.modelChangedEvent=null)),d>b+
f&&(e.lineIndex=d+g-f,e._line.lineIndex=e.lineIndex),e=this._getLineNext(e);this._lineHeight&&(a=[b,f].concat(Array(g)),Array.prototype.splice.apply(this._lineHeight,a));!this._wrapMode&&(b<=this._maxLineIndex&&this._maxLineIndex<=b+f)&&(this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0);this._update()},_onModelChanging:function(a){a.type="ModelChanging";this.onModelChanging(a);a.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var a=
this;this._updateTimer=this._getWindow().setTimeout(function(){a._updateTimer=null;a._update()},0)}},_resetLineHeight:function(a,b){if(this._wrapMode||this._variableLineHeight){if(void 0!==a&&void 0!==b)for(var e=a;e<b;e++)this._lineHeight[e]=void 0;else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=null},_resetLineWidth:function(){var a=this._clientDiv;if(a)for(a=a.firstChild;a;)a.lineWidth=void 0,a=a.nextSibling},_reset:function(){this._maxLineIndex=
-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._variableLineHeight=!1;this._resetLineHeight();this._setSelection(new y(0,0,!1),!1,!1);this._viewDiv&&(this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0);var a=this._clientDiv;if(a){for(a=a.firstChild;a;)a.lineRemoved=!0,a=a.nextSibling;13>g.isFirefox&&this._fixCaret()}},_scrollViewAnimated:function(a,b,e){var d=this._getWindow();if(e&&this._scrollAnimation){var g=this;this._animation=new B({window:d,
duration:this._scrollAnimation,curve:[b,0],onAnimate:function(a){a=b-Math.floor(a);g._scrollView(0,a);b-=a},onEnd:function(){g._animation=null;g._scrollView(a,b);e&&d.setTimeout(e,0)}});this._animation.play()}else this._scrollView(a,b),e&&d.setTimeout(e,0)},_scrollView:function(a,b){this._ensureCaretVisible=!1;var e=this._viewDiv;a&&(e.scrollLeft+=a);b&&(e.scrollTop+=b)},_setClipboardText:function(a,b){var e,d=this._getWindow(),f=d.clipboardData;!f&&b&&(f=b.clipboardData);if(f&&(e=[],p(a,function(a){e.push(a)},
function(){e.push(g.platformDelimiter)}),f.setData(g.isIE?"Text":"text/plain",e.join(""))||21<g.isFirefox))return!0;var h=this._parent.ownerDocument,k=g.createElement(h,"pre");k.style.position="fixed";k.style.left="-1000px";p(a,function(a){k.appendChild(h.createTextNode(a))},function(){k.appendChild(g.createElement(h,"br"))});k.appendChild(h.createTextNode(" "));this._clientDiv.appendChild(k);f=h.createRange();f.setStart(k.firstChild,0);f.setEndBefore(k.lastChild);var l=d.getSelection();0<l.rangeCount&&
l.removeAllRanges();l.addRange(f);var q=this,f=function(){k&&k.parentNode===q._clientDiv&&q._clientDiv.removeChild(k);q._updateDOMSelection()},l=!1;this._ignoreCopy=!0;try{l=h.execCommand("copy",!1,null)}catch(t){}this._ignoreCopy=!1;if(!l&&b)return d.setTimeout(f,0),!1;f();return!0},_setDOMSelection:function(a,b,e,d,f){this._setDOMFullSelection(a,b,e,d);a=a._line.getNodeOffset(b);e=e._line.getNodeOffset(d);d=this._getWindow();b=this._parent.ownerDocument;if(d.getSelection){var h=d.getSelection();
d=b.createRange();d.setStart(a.node,a.offset);d.setEnd(e.node,e.offset);if(this._hasFocus&&(h.anchorNode!==a.node||h.anchorOffset!==a.offset||h.focusNode!==e.node||h.focusOffset!==e.offset||h.anchorNode!==e.node||h.anchorOffset!==e.offset||h.focusNode!==a.node||h.focusOffset!==a.offset))this._anchorNode=a.node,this._anchorOffset=a.offset,this._focusNode=e.node,this._focusOffset=e.offset,this._ignoreSelect=!1,0<h.rangeCount&&h.removeAllRanges(),h.addRange(d),this._ignoreSelect=!0;this._cursorDiv&&
(d=b.createRange(),f?(d.setStart(a.node,a.offset),d.setEnd(a.node,a.offset)):(d.setStart(e.node,e.offset),d.setEnd(e.node,e.offset)),f=d.getClientRects()[0],a=this._cursorDiv.parentNode,e=a.getBoundingClientRect(),f&&e&&(this._cursorDiv.style.top=f.top-e.top+a.scrollTop+"px",this._cursorDiv.style.left=f.left-e.left+a.scrollLeft+"px"))}else b.selection&&this._hasFocus&&(f=b.body,d=g.createElement(b,"div"),f.appendChild(d),f.removeChild(d),d=f.createTextRange(),d.moveToElementText(a.node.parentNode),
d.moveStart("character",a.offset),f=f.createTextRange(),f.moveToElementText(e.node.parentNode),f.moveStart("character",e.offset),d.setEndPoint("EndToStart",f),this._ignoreSelect=!1,d.select(),this._ignoreSelect=!0)},_setDOMFullSelection:function(a,b,e,d){if(this._selDiv1){var g=this._selDiv1;g.style.width="0px";g.style.height="0px";g=this._selDiv2;g.style.width="0px";g.style.height="0px";g=this._selDiv3;g.style.width="0px";g.style.height="0px";if(!(a===e&&b===d)){var f=this._getViewPadding(),h=this._clientDiv.getBoundingClientRect(),
p=this._viewDiv.getBoundingClientRect(),g=p.left+f.left,k=h.right,f=p.top+f.top,l=h.bottom,p=h=0;this._clipDiv?(p=this._clipDiv.getBoundingClientRect(),h=p.left-this._clipDiv.scrollLeft):(p=this._rootDiv.getBoundingClientRect(),h=p.left);p=p.top;this._ignoreDOMSelection=!0;var q=(new x(this,a.lineIndex,a)).getBoundingClientRect(b,!1),t=q.left;b=(new x(this,e.lineIndex,e)).getBoundingClientRect(d,!1);var m=b.left;this._ignoreDOMSelection=!1;var s=this._selDiv1,t=Math.min(k,Math.max(g,t)),n=Math.min(l,
Math.max(f,q.top)),y=k;d=Math.min(l,Math.max(f,q.bottom));s.style.left=t-h+"px";s.style.top=n-p+"px";s.style.width=Math.max(0,y-t)+"px";s.style.height=Math.max(0,d-n)+"px";a.lineIndex===e.lineIndex?(y=Math.min(m,k),s.style.width=Math.max(0,y-t)+"px"):(q=Math.min(l,Math.max(f,b.top)),m=Math.min(k,Math.max(g,m)),f=Math.min(l,Math.max(f,b.bottom)),l=this._selDiv3,l.style.left=g-h+"px",l.style.top=q-p+"px",l.style.width=Math.max(0,m-g)+"px",l.style.height=Math.max(0,f-q)+"px",1<Math.abs(a.lineIndex-e.lineIndex)&&
(a=this._selDiv2,a.style.left=g-h+"px",a.style.top=d-p+"px",a.style.width=Math.max(0,k-g)+"px",a.style.height=Math.max(0,q-d)+"px"))}}},_setGrab:function(a){a!==this._grabControl&&(a?(a.setCapture&&a.setCapture(),this._grabControl=a):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null))},_setLinksVisible:function(a){if(this._linksVisible!==a){this._linksVisible=a;g.isIE&&a&&(this._hadFocus=this._hasFocus);var b=this._clientDiv;b.contentEditable=!a;this._hadFocus&&
!a&&b.focus();this._overlayDiv&&(this._overlayDiv.style.zIndex=a?"-1":"1");for(a=this._getLineNext();a;)a._line.updateLinks(),a=this._getLineNext(a);this._updateDOMSelection()}},_setSelection:function(a,b,e,d,g){if(a){this._columnX=-1;void 0===e&&(e=!0);var f=this._selection;this._selection=a;!1!==b&&this._showCaret(!1,d,b,g);e&&this._updateDOMSelection();if(!f.equals(a))this.onSelection({type:"Selection",oldValue:{start:f.start,end:f.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,
b,e,d){var g=this._model,f=this._getSelection();b=this.convert({x:a,y:b},"page","document");a=this._getLineIndex(b.y);if(1===this._clickCount){g=this._getLine(a);a=g.getOffset(b.x,b.y-this._getLinePixel(a));g.destroy();if(d&&!e&&f.start<=a&&a<f.end)return this._dragOffset=a,!1;f.extend(a);e||f.collapse()}else 0===(this._clickCount&1)?(g=this._getLine(a),a=g.getOffset(b.x,b.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(e=this._doubleClickSelection.start,d=
g.getNextOffset(a,{unit:"wordend",count:1})):(e=g.getNextOffset(a,{unit:"word",count:-1}),d=this._doubleClickSelection.end):(e=g.getNextOffset(a,{unit:"word",count:-1}),d=g.getNextOffset(e,{unit:"wordend",count:1})),g.destroy()):this._doubleClickSelection?(d=g.getLineAtOffset(this._doubleClickSelection.start),a>=d?(e=g.getLineStart(d),d=g.getLineEnd(a)):(e=g.getLineStart(a),d=g.getLineEnd(d))):(e=g.getLineStart(a),d=g.getLineEnd(a)),f.setCaret(e),f.extend(d);this._setSelection(f,!0,!0);return!0},
_setFullSelection:function(a,b){this._fullSelection=a;g.isWebkit&&(this._fullSelection=!0);var e=this._clipDiv||this._rootDiv;if(e)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&!g.isIOS){var d=e.ownerDocument;this._highlightRGB=g.isWebkit?"transparent":"Highlight";var f=g.createElement(d,"div");this._selDiv1=f;f.style.position="absolute";f.style.borderWidth="0px";f.style.margin="0px";f.style.padding="0px";f.style.outline="none";f.style.background=this._highlightRGB;f.style.width=
"0px";f.style.height="0px";f.style.zIndex="0";e.appendChild(f);var h=g.createElement(d,"div");this._selDiv2=h;h.style.position="absolute";h.style.borderWidth="0px";h.style.margin="0px";h.style.padding="0px";h.style.outline="none";h.style.background=this._highlightRGB;h.style.width="0px";h.style.height="0px";h.style.zIndex="0";e.appendChild(h);this._selDiv3=d=g.createElement(d,"div");d.style.position="absolute";d.style.borderWidth="0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";
d.style.background=this._highlightRGB;d.style.width="0px";d.style.height="0px";d.style.zIndex="0";e.appendChild(d);if(g.isFirefox&&g.isMac){e=this._getWindow().getComputedStyle(d,null).getPropertyValue("background-color");switch(e){case "rgb(119, 141, 168)":e="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":e="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":e="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":e="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":e="rgb(255, 209, 129)";break;
case "rgb(102, 197, 71)":e="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":e="rgb(232, 184, 255)";break;default:e="rgb(180, 213, 255)"}this._highlightRGB=e;f.style.background=e;h.style.background=e;d.style.background=e}b||this._updateDOMSelection()}}else this._selDiv1&&(e.removeChild(this._selDiv1),this._selDiv1=null),this._selDiv2&&(e.removeChild(this._selDiv2),this._selDiv2=null),this._selDiv3&&(e.removeChild(this._selDiv3),this._selDiv3=null)},_setBlockCursor:function(a){this._blockCursorVisible=
a;this._updateBlockCursorVisible()},_setOverwriteMode:function(a){this._overwriteMode=a;this._updateBlockCursorVisible()},_updateBlockCursorVisible:function(){if(this._blockCursorVisible||this._overwriteMode){if(!this._cursorDiv){var a=this._viewDiv,b=g.createElement(a.ownerDocument,"div");b.className="textviewBlockCursor";this._cursorDiv=b;b.tabIndex=-1;b.style.zIndex="2";b.style.color="transparent";b.style.position="absolute";b.style.pointerEvents="none";b.innerHTML="\x26nbsp;";a.appendChild(b);
this._updateDOMSelection()}}else this._cursorDiv&&(this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null)},_setMarginOffset:function(a,b){this._marginOffset=a;this._marginDiv.style.display=a?"block":"none";b||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setWrapOffset:function(a,b){this._wrapOffset=a;b||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":
"false")},_setSingleMode:function(a,b){this._singleMode=a;this._updateOverflow();this._updateStyle(b)},_setTabSize:function(a,b){this._tabSize=a;this._customTabSize=void 0;var e=this._clientDiv;g.isOpera?e&&(e.style.OTabSize=this._tabSize+""):537.1<=g.isWebkit?e&&(e.style.tabSize=this._tabSize+""):4<=g.isFirefox?e&&(e.style.MozTabSize=this._tabSize+""):8!==this._tabSize&&(this._customTabSize=this._tabSize);b||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(a){this._theme&&this._theme.removeEventListener("ThemeChanged",
this._themeListener.onChanged);(this._theme=a)&&this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);this._setThemeClass(this._themeClass)},_setThemeClass:function(a,b){this._themeClass=a;var e="textview",d=this._theme.getThemeClass();d&&(e+=" "+d);this._themeClass&&d!==this._themeClass&&(e+=" "+this._themeClass);this._rootDiv.className=e;this._updateStyle(b)},_setWrapMode:function(a,b){this._wrapMode=a&&this._wrappable;var e=this._clientDiv;this._wrapMode?(e.style.whiteSpace=
"pre-wrap",e.style.wordWrap="break-word"):(e.style.whiteSpace="pre",e.style.wordWrap="normal");this._updateOverflow();b||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,b,e,d){if(this._clientDiv&&!(0<this._redrawCount)&&!this._ignoreDOMSelection){var g=this._model,f=this._getSelection(),h=this._getScroll(),p=f.getCaret(),k=f.start,l=f.end,q=g.getLineAtOffset(k),t=g.getLineAtOffset(l),m=Math.max(Math.max(k,g.getLineStart(t)),l-1),g=this._getClientWidth(),s=this._getClientHeight(),
n=g/4,y=this._getBoundsAtOffset(p===k?k:m),r=y.left,w=y.right,x=y.top,u=y.bottom,z=0,B="object"===typeof e;if((a||B)&&!f.isEmpty())y=this._getBoundsAtOffset(p===l?k:m),z=(y.bottom>u?y.bottom:u)-(y.top<x?y.top:x),a&&(y.top===x?p===k?w=r+Math.min(y.right-r,g):r=w-Math.min(w-y.left,g):p===k?u=x+Math.min(y.bottom-x,s):x=u-Math.min(u-y.top,s));a=0;r<h.x&&(a=Math.min(r-h.x,-n));w>h.x+g&&(a=Math.max(w-h.x-g,n));f=0;x<h.y?f=x-h.y:u>h.y+s&&(f=u-h.y-s);d&&(0<d?0<f&&(f=Math.max(f,d)):0>f&&(f=Math.min(f,d)));
d=B&&"always"===e.scrollPolicy;if(0!==a||0!==f||d)return B?(d=0<f,0===f&&(f=x-h.y),h=e.viewAnchor,x=e.selectionAnchor,e=Math.min(Math.max(0,e.viewAnchorOffset||0)),f="top"===h?f+Math.floor(d?(1-e)*s:-e*s):"bottom"===h?f+Math.floor(d?e*s:-(1-e)*s):"center"===h?f+Math.floor(d?s/2+e*s:s/2-(1-e)*s):f+Math.floor(d?e*s:-e*s),q!==t&&("top"===x&&p!==k?f+=Math.floor(-z):"bottom"===x&&p!==l?f+=Math.floor(z):"center"===x&&(f+=Math.floor(z/2)))):0!==f&&"number"===typeof e&&(0>e&&(e=0),1<e&&(e=1),f+=Math.floor(0<
f?e*s:-e*s)),this._scrollViewAnimated(a,f,b),s!==this._getClientHeight()||g!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;b&&b();return!1}},_startIME:function(){if(-1===this._imeOffset){var a=this._getSelection();a.isEmpty()||this._modifyContent({text:"",start:a.start,end:a.end},!0);this._imeOffset=a.start}},_unhookEvents:function(){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);
this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);this._modelListener=null;for(var a=0;a<this._handlers.length;a++){var b=this._handlers[a];z(b.target,b.type,b.handler)}this._handlers=null;this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null)},_updateDOMSelection:function(){if(!(0<this._redrawCount)&&!this._ignoreDOMSelection&&this._clientDiv){var a=this._getSelection(),b=this._model,e=b.getLineAtOffset(a.start),d=b.getLineAtOffset(a.end),
g=this._getLineNext();if(g){var f=this._getLinePrevious(),h;e<g.lineIndex?(e=g,h=b.getLineStart(g.lineIndex)):e>f.lineIndex?(e=f,h=b.getLineStart(f.lineIndex)):(e=this._getLineNode(e),h=a.start);d<g.lineIndex?(d=g,b=b.getLineStart(g.lineIndex)):d>f.lineIndex?(d=f,b=b.getLineStart(f.lineIndex)):(d=this._getLineNode(d),b=a.end);this._setDOMSelection(e,h,d,b,a.caret)}}},_update:function(a){if(!(0<this._redrawCount)){this._updateTimer&&(this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=
null,a=!1);var b=this._clientDiv,e=this._viewDiv;if(b){this._metrics.invalid&&(this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1);var d=this._model,f=this._getScroll(!1),h=this._getViewPadding(),p=d.getLineCount(),k=this._getLineHeight(),l=!1,q=!1,t=!1,s=this._metrics.scrollWidth;this._wrapMode&&(b.style.width=(this._metrics.wrapWidth||this._getClientWidth())+"px");var m,n,y,r,w=0,u=0,z;if(this._lineHeight){for(;u<p;){z=this._getLineHeight(u);if(w+z>f.y)break;w+=z;u++}m=u;
n=Math.max(0,m-1);y=d=f.y-w;0<m&&(d+=this._getLineHeight(m-1))}else r=Math.max(0,f.y)/k,m=Math.floor(r),n=Math.max(0,m-1),d=Math.round((r-n)*k),y=Math.round((r-m)*k);this._topIndexY=y;r=this._rootDiv;var B=r.clientWidth,Q=r.clientHeight;if(a){k=0;this._leftDiv&&(m=this._leftDiv.getBoundingClientRect(),k=m.right-m.left);m=this._getClientWidth();r=this._getClientHeight();q=m;this._wrapMode?this._metrics.wrapWidth&&(q=this._metrics.wrapWidth):q=Math.max(this._maxLineWidth,q);for(;u<p;)z=this._getLineHeight(u,
!1),w+=z,u++;p=w}else{r=this._getClientHeight();y=Math.min(m+Math.floor((r+y)/k),p-1);var f=Math.min(y+1,p-1),N;for(z=b.firstChild;z;){N=z.lineIndex;var M=z.nextSibling;if(!(n<=N&&N<=f)||z.lineRemoved||-1===z.lineIndex)this._mouseWheelLine===z?(z.style.display="none",z.lineIndex=-1):b.removeChild(z);z=M}z=this._getLineNext();var M=e.ownerDocument,O=M.createDocumentFragment();for(N=n;N<=f;N++)!z||z.lineIndex>N?(new x(this,N)).create(O,null):(O.firstChild&&(b.insertBefore(O,z),O=M.createDocumentFragment()),
z&&z.lineChanged&&(z=(new x(this,N)).create(O,z),z.lineChanged=!1),z=this._getLineNext(z));O.firstChild&&b.insertBefore(O,z);g.isWebkit&&!this._wrapMode&&(b.style.width="0x7fffffffpx");z=this._getLineNext();N=r+d;for(O=!1;z;)n=z.lineWidth,void 0===n&&(M=z._line.getBoundingClientRect(),n=z.lineWidth=Math.ceil(M.right-M.left),M=M.bottom-M.top,this._lineHeight?this._lineHeight[z.lineIndex]=M:0!==k&&(0!==M&&Math.ceil(k)!==Math.ceil(M))&&(this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[z.lineIndex]=
M)),this._lineHeight&&!O&&(N-=this._lineHeight[z.lineIndex],0>N&&(y=z.lineIndex,O=!0)),this._wrapMode||(n>=this._maxLineWidth&&(this._maxLineWidth=n,this._maxLineIndex=z.lineIndex),this._checkMaxLineIndex===z.lineIndex&&(this._checkMaxLineIndex=-1)),z.lineIndex===m&&(this._topChild=z),z.lineIndex===y&&(this._bottomChild=z),z=this._getLineNext(z);-1!==this._checkMaxLineIndex&&(N=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=N&&N<p&&(k=new x(this,N),M=k.getBoundingClientRect(),n=M.right-M.left,
n>=this._maxLineWidth&&(this._maxLineWidth=n,this._maxLineIndex=N),k.destroy()));for(;u<p;)z=this._getLineHeight(u,u<=y),w+=z,u++;p=w;this._updateRuler(this._leftDiv,m,f,Q);this._updateRuler(this._rightDiv,m,f,Q);this._updateRuler(this._marginDiv,m,f,Q);k=0;this._leftDiv&&(m=this._leftDiv.getBoundingClientRect(),k=m.right-m.left);f=0;this._rightDiv&&(f=this._rightDiv.getBoundingClientRect(),f=f.right-f.left);e.style.left=k+"px";e.style.right=f+"px";f=this._scrollDiv;f.style.height=p+"px";m=this._getClientWidth();
!this._singleMode&&!this._wrapMode&&(w=l=r,(u="scroll"===e.style.overflowX)?l+=s:w-=s,z=y=m,(n="scroll"===e.style.overflowY)?y+=s:z-=s,r=l,m=y,p>r&&(t=!0,m=z),this._maxLineWidth>m&&(q=!0,r=w,p>r&&(t=!0,m=z)),u!==q&&(e.style.overflowX=q?"scroll":"hidden"),n!==t&&(e.style.overflowY=t?"scroll":"hidden"),l=u!==q||n!==t);t=m;this._wrapMode?this._metrics.wrapWidth&&(t=this._metrics.wrapWidth):t=Math.max(this._maxLineWidth,t);q=t;if((!g.isIE||9<=g.isIE)&&this._maxLineWidth>m)t+=h.right+h.left;f.style.width=
t+"px";this._clipScrollDiv&&(this._clipScrollDiv.style.width=t+"px");f=this._getScroll(!1)}this._vScrollDiv&&(t=r-8,w=Math.max(15,Math.ceil(Math.min(1,t/(p+h.top+h.bottom))*t)),this._vScrollDiv.style.left=k+m-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,f.y*t/p))+"px",this._vScrollDiv.style.height=w+"px");!this._wrapMode&&this._hScrollDiv&&(t=m-8,w=Math.max(15,Math.ceil(Math.min(1,t/(this._maxLineWidth+h.left+h.right))*t)),this._hScrollDiv.style.left=k+Math.floor(Math.max(0,Math.floor(f.x*
t/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=r-9+"px",this._hScrollDiv.style.width=w+"px");u=f.x;w=this._clipDiv;t=this._overlayDiv;if(y=this._marginDiv)y.style.left=-u+k+this._metrics.marginWidth+h.left+"px",y.style.bottom=("scroll"===e.style.overflowX?s:0)+"px";w?(w.scrollLeft=u,w.scrollTop=0,e=k+h.left,s=h.top,a=m,k=r,u=0,y=-d,0===f.x&&(e-=h.left,a+=h.left,u=h.left),f.x+m===q&&(a+=h.right),0===f.y&&(s-=h.top,k+=h.top,y+=h.top),f.y+r===p&&(k+=h.bottom),w.style.left=e+"px",w.style.top=
s+"px",w.style.right=B-a-e+"px",w.style.bottom=Q-k-s+"px",b.style.left=u+"px",b.style.top=y+"px",b.style.width=q+"px",b.style.height=r+d+"px",t&&(t.style.left=b.style.left,t.style.top=b.style.top,t.style.width=b.style.width,t.style.height=b.style.height)):(e=u,s=d,B=u+m,Q=d+r,0===e&&(e-=h.left),0===s&&(s-=h.top),B===q&&(B+=h.right),f.y+r===p&&(Q+=h.bottom),b.style.clip="rect("+s+"px,"+B+"px,"+Q+"px,"+e+"px)",b.style.left=-u+k+h.left+"px",b.style.width=(this._wrapMode||g.isWebkit?q:m+u)+"px",a||(b.style.top=
-d+h.top+"px",b.style.height=r+d+"px"),t&&(t.style.clip=b.style.clip,t.style.left=b.style.left,t.style.width=b.style.width,a||(t.style.top=b.style.top,t.style.height=b.style.height)));this._updateDOMSelection();l&&(b=this._ensureCaretVisible,this._ensureCaretVisible=!1,b&&this._showCaret(),this._queueUpdate())}}},_updateOverflow:function(){var a=this._viewDiv;this._wrapMode?(a.style.overflowX="hidden",a.style.overflowY="scroll"):a.style.overflow="hidden"},_updateRuler:function(a,b,e,f){if(a){var h=
this._parent.ownerDocument,k=this._getLineHeight(),p=this._getViewPadding();for(a=a.firstChild;a;){var l=a._ruler,q=k,t=l.getOverview();"page"===t&&(q+=this._topIndexY);a.style.top=-q+"px";a.style.height=f+q+"px";a.rulerChanged&&d(l.getRulerStyle(),a);var m,s=a.firstChild;s?(m=s,s=s.nextSibling):(m=g.createElement(h,"div"),m.style.visibility="hidden",a.appendChild(m));var n;if(a.rulerChanged&&m){q=-1;if(n=l.getWidestAnnotation())d(n.style,m),n.html&&(m.innerHTML=n.html);m.lineIndex=q;m.style.height=
k+p.top+"px"}var y;if("page"===t){for(l=l.getAnnotations(b,e+1);s;)q=s.lineIndex,n=s.nextSibling,(!(b<=q&&q<=e)||s.lineChanged)&&a.removeChild(s),s=n;s=a.firstChild.nextSibling;y=h.createDocumentFragment();for(q=b;q<=e;q++)if(!s||s.lineIndex>q){m=g.createElement(h,"div");if(n=l[q])d(n.style,m),n.html&&(m.innerHTML=n.html),m.annotation=n;m.lineIndex=q;m.style.height=this._getLineHeight(q)+"px";y.appendChild(m)}else y.firstChild&&(a.insertBefore(y,s),y=h.createDocumentFragment()),s&&(s=s.nextSibling);
y.firstChild&&a.insertBefore(y,s)}else{n=this._getClientHeight();q=this._model.getLineCount();s=n+p.top+p.bottom-2*this._metrics.scrollWidth;t=k*q<s?k:s/q;if(a.rulerChanged){for(n=a.childNodes.length;1<n;)a.removeChild(a.lastChild),n--;l=l.getAnnotations(0,q);y=h.createDocumentFragment();for(var r in l)q=r>>>0,0>q||(m=g.createElement(h,"div"),n=l[r],d(n.style,m),m.style.position="absolute",m.style.top=this._metrics.scrollWidth+k+Math.floor(q*t)+"px",n.html&&(m.innerHTML=n.html),m.annotation=n,m.lineIndex=
q,y.appendChild(m));a.appendChild(y)}else if(a._oldTrackHeight!==s)for(m=a.firstChild?a.firstChild.nextSibling:null;m;)m.style.top=this._metrics.scrollWidth+k+Math.floor(m.lineIndex*t)+"px",m=m.nextSibling;a._oldTrackHeight=s}a.rulerChanged=!1;a=a.nextSibling}}},_updateStyleSheet:function(){var a="";g.isWebkit&&0<this._metrics.scrollWidth&&(a+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");g.isFirefox&&(g.isMac&&this._highlightRGB&&"Highlight"!==this._highlightRGB)&&(a+="\n.textview ::-moz-selection {background: "+
this._highlightRGB+";}");if(a){var b=this._clientDiv.ownerDocument,e=b.getElementById("_textviewStyle");if(e)e.removeChild(e.firstChild),e.appendChild(b.createTextNode(a));else{e=g.createElement(b,"style");e.id="_textviewStyle";var d=b.getElementsByTagName("head")[0]||b.documentElement;e.appendChild(b.createTextNode(a));d.insertBefore(e,d.firstChild)}}},_updateStyle:function(a){!a&&g.isIE&&(this._rootDiv.style.lineHeight="normal");var b=this._metrics=this._calculateMetrics();this._variableLineHeight&&
(this._variableLineHeight=!1,this._resetLineHeight());this._rootDiv.style.lineHeight=g.isIE?b.lineHeight-(b.lineTrim.top+b.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();if(g.isMac&&g.isWebkit){var e=this._viewDiv;!b.invalid&&0===b.scrollWidth?(e.style.pointerEvents="none",e.style.zIndex="2"):(e.style.pointerEvents="",e.style.zIndex="")}a||(this.redraw(),this._resetLineWidth())}};k.EventTarget.addMixin(u.prototype);return{TextView:u}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(l,n){function m(k){this._model=k;this._projections=[];var f=this;this._listener={onChanged:function(h){f._onChanged(h)},onChanging:function(h){f._onChanging(h)}};k.addEventListener("postChanged",this._listener.onChanged);k.addEventListener("preChanging",this._listener.onChanging)}m.prototype={destroy:function(){this._model&&(this._model.removeEventListener("postChanged",this._listener.onChanged),
this._model.removeEventListener("preChanging",this._listener.onChanging),this._model=null)},addProjection:function(k){if(k){var f=this._model,h=this._projections;k._lineIndex=f.getLineAtOffset(k.start);k._lineCount=f.getLineAtOffset(k.end)-k._lineIndex;var g=k.text;g||(g="");k._model="string"===typeof g?new l.TextModel(g,f.getLineDelimiter()):g;var f=this.mapOffset(k.start,!0),g=k.end-k.start,d=k._lineCount,a=k._model.getCharCount(),e=k._model.getLineCount()-1,b={type:"Changing",text:k._model.getText(),
start:f,removedCharCount:g,addedCharCount:a,removedLineCount:d,addedLineCount:e};this.onChanging(b);b=this._binarySearch(h,k.start);h.splice(b,0,k);this.onChanged({type:"Changed",start:f,removedCharCount:g,addedCharCount:a,removedLineCount:d,addedLineCount:e})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(k,f){var h=this._projections,g=0,d,a;if(f){for(d=0;d<h.length;d++){a=h[d];if(a.start>k)break;if(a.end>k)return-1;g+=
a._model.getCharCount()-(a.end-a.start)}return k+g}for(d=0;d<h.length;d++){a=h[d];if(a.start>k-g)break;var e=a._model.getCharCount();if(a.start+e>k-g)return-1;g+=e-(a.end-a.start)}return k-g},removeProjection:function(k){this._removeProjection(k)},_removeProjection:function(k,f){var h,g=0;for(h=0;h<this._projections.length;h++){var d=this._projections[h];if(d===k){k=d;break}g+=d._model.getCharCount()-(d.end-d.start)}if(h<this._projections.length){var d=this._model,g=k.start+g,a=k.end-k.start,e=k._lineCount,
b=k._model.getCharCount(),p=k._model.getLineCount()-1;f||(d={type:"Changing",text:d.getText(k.start,k.end),start:g,removedCharCount:b,addedCharCount:a,removedLineCount:p,addedLineCount:e},this.onChanging(d));this._projections.splice(h,1);if(!f)this.onChanged({type:"Changed",start:g,removedCharCount:b,addedCharCount:a,removedLineCount:p,addedLineCount:e})}},_binarySearch:function(k,f){for(var h=k.length,g=-1,d;1<h-g;)d=Math.floor((h+g)/2),f<=k[d].start?h=d:g=d;return h},getCharCount:function(){for(var k=
this._model.getCharCount(),f=this._projections,h=0;h<f.length;h++)var g=f[h],k=k+(g._model.getCharCount()-(g.end-g.start));return k},getLine:function(k,f){if(0>k)return null;var h=this._model,g=this._projections,d=0,a=[],e=0,b,p,l;for(b=0;b<g.length;b++){l=g[b];if(l._lineIndex>=k-d)break;p=l._model.getLineCount()-1;if(l._lineIndex+p>=k-d){e=k-(l._lineIndex+d);if(e<p)return l._model.getLine(e,f);a.push(l._model.getLine(p))}e=l.end;d+=p-l._lineCount}for(e=Math.max(e,h.getLineStart(k-d));b<g.length;b++){l=
g[b];if(l._lineIndex>k-d)break;a.push(h.getText(e,l.start));p=l._model.getLineCount()-1;if(l._lineIndex+p>k-d)return a.push(l._model.getLine(0,f)),a.join("");a.push(l._model.getText());e=l.end;d+=p-l._lineCount}g=h.getLineEnd(k-d,f);e<g&&a.push(h.getText(e,g));return a.join("")},getLineAtOffset:function(k){for(var f=this._model,h=this._projections,g=0,d=0,a=0;a<h.length;a++){var e=h[a];if(e.start>k-g)break;var b=e._model.getCharCount();if(e.start+b>k-g){h=k-(e.start+g);d+=e._model.getLineAtOffset(h);
g+=h;break}d+=e._model.getLineCount()-1-e._lineCount;g+=b-(e.end-e.start)}return f.getLineAtOffset(k-g)+d},getLineCount:function(){for(var k=this._projections,f=this._model.getLineCount(),h=0;h<k.length;h++)var g=k[h],f=f+(g._model.getLineCount()-1-g._lineCount);return f},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(k,f){if(0>k)return-1;for(var h=this._model,g=this._projections,d=0,a=0,e=0;e<g.length;e++){var b=g[e];if(b._lineIndex>k-d)break;var p=b._model.getLineCount()-
1;if(b._lineIndex+p>k-d)return b._model.getLineEnd(k-(b._lineIndex+d),f)+b.start+a;a+=b._model.getCharCount()-(b.end-b.start);d+=p-b._lineCount}return h.getLineEnd(k-d,f)+a},getLineStart:function(k){if(0>k)return-1;for(var f=this._model,h=this._projections,g=0,d=0,a=0;a<h.length;a++){var e=h[a];if(e._lineIndex>=k-g)break;var b=e._model.getLineCount()-1;if(e._lineIndex+b>=k-g)return e._model.getLineStart(k-(e._lineIndex+g))+e.start+d;d+=e._model.getCharCount()-(e.end-e.start);g+=b-e._lineCount}return f.getLineStart(k-
g)+d},getText:function(k,f){void 0===k&&(k=0);var h=this._model,g=this._projections,d=0,a=[],e,b,p;for(e=0;e<g.length;e++){b=g[e];if(b.start>k-d)break;p=b._model.getCharCount();if(b.start+p>k-d){if(void 0!==f&&b.start+p>f-d)return b._model.getText(k-(b.start+d),f-(b.start+d));a.push(b._model.getText(k-(b.start+d)));k=b.end+d+p-(b.end-b.start)}d+=p-(b.end-b.start)}var l=k-d;if(void 0!==f){for(;e<g.length;e++){b=g[e];if(b.start>f-d)break;a.push(h.getText(l,b.start));p=b._model.getCharCount();if(b.start+
p>f-d)return a.push(b._model.getText(0,f-(b.start+d))),a.join("");a.push(b._model.getText());l=b.end;d+=p-(b.end-b.start)}a.push(h.getText(l,f-d))}else{for(;e<g.length;e++)b=g[e],a.push(h.getText(l,b.start)),a.push(b._model.getText()),l=b.end;a.push(h.getText(l))}return a.join("")},_onChanged:function(k){k=this._change;var f=k.baseStart,h=k.baseEnd,g,d,a=this._projections;for(g=0;g<a.length&&!(d=a[g],d.end>f);g++);var e=g;for(g=0;g<a.length&&!(d=a[g],d.start>=h);g++);var b=g,p=this._model,f=k.baseText.length-
(h-f);for(g=b;g<a.length;g++)d=a[g],d.start+=f,d.end+=f,d._lineIndex=p.getLineAtOffset(d.start);d=a.splice(e,b-e);for(g=0;g<d.length;g++)d[g].annotation&&d[g].annotation._expand();this.onChanged({type:"Changed",start:k.start,removedCharCount:k.removedCharCount,addedCharCount:k.addedCharCount,removedLineCount:k.removedLineCount,addedLineCount:k.addedLineCount});this._change=void 0},_onChanging:function(k){var f=!!this._change,h=this._change||{},g=k.start,d=g+k.removedCharCount;h.baseStart=g;h.baseEnd=
d;h.baseText=k.text;h.addedLineCount=k.addedLineCount;if(!f){this._change=h;h.text=k.text;var a=this._projections,e,b,p;k=function(d){for(e=b=0;b<a.length;b++){p=a[b];if(p.start>d)break;if(p.end>d)return-1;e+=p._model.getCharCount()-(p.end-p.start)}return d+e};h.start=k(g);-1===h.start&&(h.text=this._model.getText(p.start,g)+h.text,h.addedLineCount+=this._model.getLineAtOffset(g)-this._model.getLineAtOffset(p.start),h.start=p.start+e);h.end=k(d);-1===h.end&&(h.text+=this._model.getText(d,p.end),h.addedLineCount+=
this._model.getLineAtOffset(p.end)-this._model.getLineAtOffset(d),h.end=p.start+e)}h.addedCharCount=h.text.length;h.removedCharCount=h.end-h.start;h.removedLineCount=this.getLineAtOffset(h.end)-this.getLineAtOffset(h.start);this.onChanging({type:"Changing",text:h.text,start:h.start,removedCharCount:h.removedCharCount,addedCharCount:h.addedCharCount,removedLineCount:h.removedLineCount,addedLineCount:h.addedLineCount})},onChanging:function(k){return this.dispatchEvent(k)},onChanged:function(k){return this.dispatchEvent(k)},
setLineDelimiter:function(k){this._model.setLineDelimiter(k)},setText:function(k,f,h){function g(g){for(a=e=0;e<d.length;e++){b=d[e];if(b.start>g-a)break;var f=b._model.getCharCount();if(b.start+f>g-a)return-1;a+=f-(b.end-b.start)}return g-a}this._change={text:k||"",start:f||0,end:void 0===h?this.getCharCount():h};var d=this._projections,a,e,b,p,l;k=g(this._change.start);-1===k&&(p={projection:b,start:this._change.start-(b.start+a)},k=b.end);f=g(this._change.end);-1===f&&(l={projection:b,end:this._change.end-
(b.start+a)},f=b.start);p&&l&&p.projection===l.projection?b._model.setText(this._change.text,p.start,l.end):(this._model.setText(this._change.text,k,f),p&&(b=p.projection,b._model.setText("",p.start)),l&&(b=l.projection,b._model.setText("",0,l.end),b.start=b.end,b._lineCount=0));this._change=void 0}};n.EventTarget.addMixin(m.prototype);return{ProjectionTextModel:m}});
define("orion/editor/tooltip","i18n!orion/editor/nls/messages orion/editor/textView orion/editor/textModel orion/editor/projectionTextModel orion/editor/util orion/util".split(" "),function(l,n,m,k,f,h){function g(d){this._view=d;this._fadeDelay=500;this._hideDelay=200;this._showDelay=500;this._autoHideDelay=5E3;this._create(d.getOptions("parent").ownerDocument)}g.getTooltip=function(d){d._tooltip||(d._tooltip=new g(d));return d._tooltip};g.prototype={_create:function(d){if(!this._tooltipDiv){var a=
this._tooltipDiv=h.createElement(d,"div");a.tabIndex=0;a.className="textviewTooltip";a.setAttribute("aria-live","assertive");a.setAttribute("aria-atomic","true");var e=this._tooltipContents=h.createElement(d,"div");a.appendChild(e);d.body.appendChild(a);var b=this;f.addEventListener(a,"mouseover",function(a){b._hideDelay&&(a=b._getWindow(),b._delayedHideTimeout&&(a.clearTimeout(b._delayedHideTimeout),b._delayedHideTimeout=null),b._hideTimeout&&(a.clearTimeout(b._hideTimeout),b._hideTimeout=null),
b._nextTarget=null)},!1);f.addEventListener(a,"mouseout",function(e){e=e.relatedTarget||e.toElement;!(e===a||b._hasFocus())&&(!e||!f.contains(a,e))&&b._hide()},!1);f.addEventListener(a,"keydown",function(a){27===a.keyCode&&b._hide()},!1);f.addEventListener(d,"mousedown",this._mouseDownHandler=function(e){b.isVisible()&&(f.contains(a,e.target||e.srcElement)||b._hide())},!0);this._view.addEventListener("Destroy",function(){b.destroy()});this._hide()}},_getWindow:function(){var d=this._tooltipDiv.ownerDocument;
return d.defaultView||d.parentWindow},destroy:function(){if(this._tooltipDiv){this._hide();var d=this._tooltipDiv.parentNode;d&&d.removeChild(this._tooltipDiv);f.removeEventListener(this._tooltipDiv.ownerDocument,"mousedown",this._mouseDownHandler,!0);this._tooltipDiv=null}},_hasFocus:function(){var d=this._tooltipDiv;return!d?!1:f.contains(d,d.ownerDocument.activeElement)},hide:function(d){void 0===d&&(d=this._hideDelay);var a=this._getWindow();this._delayedHideTimeout&&(a.clearTimeout(this._delayedHideTimeout),
this._delayedHideTimeout=null);var e=this;d?e._delayedHideTimeout=a.setTimeout(function(){e._delayedHideTimeout=null;e._hide();e.setTarget(e._nextTarget,0)},d):(e._hide(),e.setTarget(e._nextTarget,0))},_hide:function(){var d=this._tooltipDiv;d&&(this._hasFocus()&&this._view.focus(),this._contentsView&&(this._contentsView.destroy(),this._contentsView=null),this._tooltipContents&&(this._tooltipContents.innerHTML=""),d.style.visibility="hidden",d=this._getWindow(),this._showTimeout&&(d.clearTimeout(this._showTimeout),
this._showTimeout=null),this._delayedHideTimeout&&(d.clearTimeout(this._delayedHideTimeout),this._delayedHideTimeout=null),this._hideTimeout&&(d.clearTimeout(this._hideTimeout),this._hideTimeout=null),this._fadeTimeout&&(d.clearInterval(this._fadeTimeout),this._fadeTimeout=null))},isVisible:function(){return this._tooltipDiv&&"visible"===this._tooltipDiv.style.visibility},setTarget:function(d,a,e){if(this.isVisible())this._hasFocus()||(this._nextTarget=d,this.hide(e));else if(this._target=d){var b=
this;d=b._getWindow();b._showTimeout&&(d.clearTimeout(b._showTimeout),b._showTimeout=null);0===a?b.show(!0):b._showTimeout=d.setTimeout(function(){b._showTimeout=null;b.show(!0)},a?a:b._showDelay)}},show:function(d){if(this._target){var a=this._target.getTooltipInfo();if(a){var e=this._tooltipDiv,b=this._tooltipContents;e.style.left=e.style.right=e.style.width=e.style.height=b.style.width=b.style.height="auto";var g=a.contents;g instanceof Array&&(g=this._getAnnotationContents(g));if("string"===typeof g)b.innerHTML=
g;else if(this._isNode(g))b.appendChild(g);else if(g instanceof k.ProjectionTextModel){var f=this._view,h=f.getOptions();h.wrapMode=!1;h.parent=b;var l=h.themeClass;l?((l=l.replace("tooltipTheme",""))&&(l=" "+l),l="tooltipTheme"+l):l="tooltipTheme";h.themeClass=l;h=this._contentsView=new n.TextView(h);h.addEventListener("LineStyle",function(a){f.onLineStyle(a)});h.setModel(g);g=h.computeSize();b.style.width=g.width+"px";b.style.height=g.height+"px";h.resize()}else return;b=e.ownerDocument.documentElement;
"right"===a.anchor?(g=b.clientWidth-a.x,e.style.right=g+"px"):(g=parseInt(this._getNodeStyle(e,"padding-left","0"),10),g+=parseInt(this._getNodeStyle(e,"border-left-width","0"),10),g=a.x-g,e.style.left=g+"px");e.style.maxWidth=b.clientWidth-g-10+"px";g=parseInt(this._getNodeStyle(e,"padding-top","0"),10);g+=parseInt(this._getNodeStyle(e,"border-top-width","0"),10);g=a.y-g;e.style.top=g+"px";e.style.maxHeight=b.clientHeight-g-10+"px";e.style.opacity="1";e.style.visibility="visible";if(d){var m=this,
r=this._getWindow();m._hideTimeout=r.setTimeout(function(){m._hideTimeout=null;var a=parseFloat(m._getNodeStyle(e,"opacity","1"));m._fadeTimeout=r.setInterval(function(){"visible"===e.style.visibility&&0<a?(a-=0.1,e.style.opacity=a):m._hide()},m._fadeDelay/10)},m._autoHideDelay)}}}},_getAnnotationContents:function(d){function a(a,b){var e=x.getLineStart(x.getLineAtOffset(a)),d=x.getLineEnd(x.getLineAtOffset(b),!0);return x.getText(e,d)}function e(b){var e=b.title,d=h.createElement(m,"div");d.className=
"tooltipRow";b.html&&(d.innerHTML=b.html,d.lastChild&&f.addEventListener(d.lastChild,"click",function(a){a=b.start;var e=b.end;r.getBaseModel&&(a=r.mapOffset(a,!0),e=r.mapOffset(e,!0));n.setSelection(a,e,1/3,function(){t._hide()})},!1),d.appendChild(m.createTextNode("\u00a0")));e||(e=a(b.start,b.end));"function"===typeof e&&(e=b.title());if("string"===typeof e){var g=h.createElement(m,"span");g.appendChild(m.createTextNode(e));e=g}d.appendChild(e);return d}for(var b,g=[],q=0;q<d.length;q++)b=d[q],
""!==b.title&&!b.groupAnnotation&&g.push(b);d=g;if(0===d.length)return null;var t=this,m=this._tooltipDiv.ownerDocument,n=this._view,r=n.getModel(),x=r.getBaseModel?r.getBaseModel():r;if(1===d.length){b=d[0];if(void 0!==b.title)return b=e(b),b.firstChild&&((d=b.firstChild.className)&&(d+=" "),b.firstChild.className=d+"single"),b;d=new k.ProjectionTextModel(x);g=x.getLineStart(x.getLineAtOffset(b.start));q=x.getCharCount();b.end!==q&&d.addProjection({start:b.end,end:q});0<g&&d.addProjection({start:0,
end:g});return d}g=h.createElement(m,"div");b=h.createElement(m,"em");b.appendChild(m.createTextNode(l.multipleAnnotations));g.appendChild(b);for(q=0;q<d.length;q++)b=d[q],(b=e(b))&&g.appendChild(b);return g},_getNodeStyle:function(d,a,e){var b;if(d&&(b=d.style[a],!b))if(d.currentStyle){for(b=0;-1!==(b=a.indexOf("-",b));)a=a.substring(0,b)+a.substring(b+1,b+2).toUpperCase()+a.substring(b+2);b=d.currentStyle[a]}else b=(d=d.ownerDocument.defaultView.getComputedStyle(d,null))?d.getPropertyValue(a):null;
return b||e},_isNode:function(d){return"object"===typeof Node?d instanceof Node:d&&"object"===typeof d&&"number"===typeof d.nodeType&&"string"===typeof d.nodeName}};return{Tooltip:g}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(l,n){function m(){}function k(a,e,d){this.start=a;this.end=e;this._projectionModel=d;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function f(a,e){var d=a.lastIndexOf("."),d=a.substring(d+1),g={title:l[d],style:{styleClass:"annotation "+d},html:"\x3cdiv class\x3d'annotationHTML "+d+"'\x3e\x3c/div\x3e",overviewStyle:{styleClass:"annotationOverview "+d}};e?g.lineStyle=
{styleClass:"annotationLine "+d}:g.rangeStyle={styleClass:"annotationRange "+d};m.registerType(a,g)}function h(){}function g(a,e,d,g,f){var h;void 0===g&&(g=-1);void 0===f&&(f=a.length);for(;1<f-g;)if(h=Math.floor((f+g)/2),e<=a[h].start)f=h;else if(d&&e<a[h].end){f=h;break}else g=h;return f}function d(a){this._annotations=[];var e=this;this._listener={onChanged:function(a){e._onChanged(a)}};this.setTextModel(a)}function a(a,e){this._view=a;this._annotationModel=e;var d=this;this._listener={onDestroy:function(a){d._onDestroy(a)},
onLineStyle:function(a){d._onLineStyle(a)},onChanged:function(a){d._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",this._listener.onLineStyle);e.addEventListener("Changed",this._listener.onChanged)}k.prototype={_expandedHTML:"\x3cdiv class\x3d'annotationHTML expanded'\x3e\x3c/div\x3e",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"\x3cdiv class\x3d'annotationHTML collapsed'\x3e\x3c/div\x3e",_collapsedStyle:{styleClass:"annotation collapsed"},
_collapse:function(){if(!this.expanded)return!1;this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;this._annotationModel&&this._annotationModel.modifyAnnotation(this);return!0},_expand:function(){if(this.expanded)return!1;this.expanded=!0;this.html=this._expandedHTML;this.style=this._expandedStyle;this._annotationModel&&this._annotationModel.modifyAnnotation(this);return!0},_collapseImpl:function(a){if(this._collapse()){a&&this._forEachOverlaping(function(a){a.expanded||
(a._expandImpl(!1),a._recollapse=!0)});a=this._projectionModel;var e=a.getBaseModel();this._projection={annotation:this,start:e.getLineStart(e.getLineAtOffset(this.start)+1),end:e.getLineEnd(e.getLineAtOffset(this.end),!0)};a.addProjection(this._projection)}},_expandImpl:function(a){this._expand()&&(this._projectionModel._removeProjection(this._projection,!this._annotationModel),a&&this._forEachOverlaping(function(a){a._recollapse&&(a._collapseImpl(!1),a._recollapse=!1)}))},_forEachOverlaping:function(a){if(this._annotationModel)for(var e=
this._annotationModel.getAnnotations(this.start,this.end);e.hasNext();){var d=e.next();d!==this&&d.type===m.ANNOTATION_FOLDING&&a.call(this,d)}},collapse:function(){this._recollapse=!1;this._collapseImpl(!0)},expand:function(){this._recollapse=!1;this._expandImpl(!0)}};m.ANNOTATION_ERROR="orion.annotation.error";m.ANNOTATION_WARNING="orion.annotation.warning";m.ANNOTATION_TASK="orion.annotation.task";m.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";m.ANNOTATION_BOOKMARK="orion.annotation.bookmark";
m.ANNOTATION_FOLDING="orion.annotation.folding";m.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";m.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";m.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";m.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";m.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";m.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";m.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";m.ANNOTATION_SELECTED_LINKED_GROUP=
"orion.annotation.selectedLinkedGroup";m.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";m.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";m.ANNOTATION_BLAME="orion.annotation.blame";m.ANNOTATION_CURRENT_BLAME="orion.annotation.currentBlame";var e={};m.registerType=function(a,d){var g=d;"function"!==typeof g&&(g=function(a,b,e){this.start=a;this.end=b;void 0!==e&&(this.title=e)},g.prototype=d);g.prototype.type=a;e[a]=g;return a};m.createAnnotation=function(a,e,d,g){return new (this.getType(a))(e,
d,g)};m.getType=function(a){return e[a]};f(m.ANNOTATION_ERROR);f(m.ANNOTATION_WARNING);f(m.ANNOTATION_TASK);f(m.ANNOTATION_BREAKPOINT);f(m.ANNOTATION_BOOKMARK);f(m.ANNOTATION_CURRENT_BRACKET);f(m.ANNOTATION_MATCHING_BRACKET);f(m.ANNOTATION_CURRENT_SEARCH);f(m.ANNOTATION_MATCHING_SEARCH);f(m.ANNOTATION_READ_OCCURRENCE);f(m.ANNOTATION_WRITE_OCCURRENCE);f(m.ANNOTATION_SELECTED_LINKED_GROUP);f(m.ANNOTATION_CURRENT_LINKED_GROUP);f(m.ANNOTATION_LINKED_GROUP);f(m.ANNOTATION_CURRENT_LINE,!0);f(m.ANNOTATION_BLAME,
!0);f(m.ANNOTATION_CURRENT_BLAME,!0);m.registerType(m.ANNOTATION_FOLDING,k);h.addMixin=function(a){var e=h.prototype,d;for(d in e)e.hasOwnProperty(d)&&(a[d]=e[d])};h.prototype={addAnnotationType:function(a,e){this._annotationTypes||(this._annotationTypes=[]);var d=e-1;void 0==e||!(0<=d&&d<this._annotationTypes.length)?this._annotationTypes.push(a):this._annotationTypes.splice(d,0,a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var e=0;e<this._annotationTypes.length;e++)if(this._annotationTypes[e]===
a)return e+1;return 0},getAnnotationsByType:function(a,e,d){a=a.getAnnotations(e,d);for(d=[];a.hasNext();)e=a.next(),0!==this.getAnnotationTypePriority(e.type)&&d.push(e);var g=this;d.sort(function(a,b){return g.getAnnotationTypePriority(a.type)-g.getAnnotationTypePriority(b.type)});return d},isAnnotationTypeVisible:function(a){return 0!==this.getAnnotationTypePriority(a)},removeAnnotationType:function(a){if(this._annotationTypes)for(var e=0;e<this._annotationTypes.length;e++)if(this._annotationTypes[e]===
a){this._annotationTypes.splice(e,1);break}}};d.prototype={addAnnotation:function(a){if(a){var e=this._annotations,d=g(e,a.start);e.splice(d,0,a);a._annotationModel=this;this.onChanged({type:"Changed",added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,e){var d=this._annotations,g,f=0,h;h=void 0===a&&void 0===e?function(){return f<d.length?d[f++]:null}:function(){for(;f<d.length;){var g=d[f++];if(a===g.start||(a>g.start?a<g.end:g.start<e))return g;
if(g.start>=e)break}return null};g=h();return{next:function(){var a=g;a&&(g=h());return a},hasNext:function(){return null!==g}}},modifyAnnotation:function(a){if(a&&!(0>this._getAnnotationIndex(a)))this.onChanged({type:"Changed",added:[],removed:[],changed:[a]})},onChanged:function(a){return this.dispatchEvent(a)},removeAnnotations:function(a){var e=this._annotations,d,g;if(a){d=[];for(g=e.length-1;0<=g;g--){var f=e[g];f.type===a&&(e.splice(g,1),d.splice(0,0,f),f._annotationModel=null)}}else d=e;this.onChanged({type:"Changed",
removed:d,added:[],changed:[]})},removeAnnotation:function(a){if(a){var e=this._getAnnotationIndex(a);0>e||(a._annotationModel=null,a={type:"Changed",removed:this._annotations.splice(e,1),added:[],changed:[]},this.onChanged(a))}},replaceAnnotations:function(a,e){var d=this._annotations,f,h,k,l=[];if(a)for(f=a.length-1;0<=f;f--)k=a[f],h=this._getAnnotationIndex(k),0>h||(k._annotationModel=null,d.splice(h,1),l.splice(0,0,k));e||(e=[]);for(f=0;f<e.length;f++)k=e[f],h=g(d,k.start),k._annotationModel=
this,d.splice(h,0,k);this.onChanged({type:"Changed",removed:l,added:e,changed:[]})},setTextModel:function(a){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=a)&&this._model.addEventListener("Changed",this._listener.onChanged)},_getAnnotationIndex:function(a){for(var e=this._annotations,d=g(e,a.start);d<e.length&&e[d].start===a.start;){if(e[d]===a)return d;d++}return-1},_onChanged:function(a){var e=a.start,d=a.addedCharCount,g=a.removedCharCount,f=this._annotations,
h=e+g;if(0<f.length){a={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:a};d-=g;for(g=0;g<f.length;g++){var k=f[g];k.start>=h?(k._oldStart=k.start,k._oldEnd=k.end,k.start+=d,k.end+=d,a.changed.push(k)):k.end<=e||(k.start<e&&h<k.end?(k._oldStart=k.start,k._oldEnd=k.end,k.end+=d,a.changed.push(k)):(f.splice(g,1),a.removed.push(k),k._annotationModel=null,k.expand&&k.expand(),g--))}if(0<a.added.length||0<a.removed.length||0<a.changed.length)this.onChanged(a)}}};n.EventTarget.addMixin(d.prototype);
a.prototype={destroy:function(){var a=this._view;a&&(a.removeEventListener("Destroy",this._listener.onDestroy),a.removeEventListener("LineStyle",this._listener.onLineStyle),this.view=null);(a=this._annotationModel)&&a.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(a,e){if(e){a||(a={});a.styleClass=a.styleClass&&e.styleClass&&a.styleClass!==e.styleClass?a.styleClass+(" "+e.styleClass):e.styleClass;var d;e.tagName&&!a.tagName&&(a.tagName=e.tagName);if(e.style)for(d in a.style||
(a.style={}),e.style)a.style[d]||(a.style[d]=e.style[d]);if(e.attributes)for(d in a.attributes||(a.attributes={}),e.attributes)a.attributes[d]||(a.attributes[d]=e.attributes[d])}return a},_mergeStyleRanges:function(a,e){a||(a=[]);for(var d,f=g(a,e.start,!0);f<a.length&&e;f++){var h=a[f];if(e.end<=h.start)break;if(!(e.start>=h.end)){d=this._mergeStyle({},h.style);d=this._mergeStyle(d,e.style);var k=[];k.push(f,1);e.start<h.start&&k.push({start:e.start,end:h.start,style:e.style});e.start>h.start&&k.push({start:h.start,
end:e.start,style:h.style});k.push({start:Math.max(h.start,e.start),end:Math.min(h.end,e.end),style:d});e.end<h.end&&k.push({start:e.end,end:h.end,style:h.style});e=e.end>h.end?{start:h.end,end:e.end,style:e.style}:null;Array.prototype.splice.apply(a,k)}}e&&(d=this._mergeStyle({},e.style),a.splice(f,0,{start:e.start,end:e.end,style:d}));return a},_onAnnotationModelChanged:function(a){function e(a,b){h.getBaseModel&&(a=h.mapOffset(a,!0),b=h.mapOffset(b,!0));-1!==a&&-1!==b&&g.redrawRange(a,b)}function d(a,
b){for(var g=0;g<a.length;g++)if(f.isAnnotationTypeVisible(a[g].type)){var h=a[g];e(h.start,h.end);b&&(void 0!==h._oldStart&&h._oldEnd)&&e(h._oldStart,h._oldEnd)}}var g=this._view;if(g){var f=this,h=g.getModel();d(a.added);d(a.removed);d(a.changed,!0)}},_onDestroy:function(a){this.destroy()},_onLineStyle:function(a){var e=this._annotationModel,d=a.textView.getModel(),g=e.getTextModel(),f=a.lineStart,h=a.lineStart+a.lineText.length;g!==d&&(f=d.mapOffset(f),h=d.mapOffset(h));for(e=e.getAnnotations(f,
h);e.hasNext();)if(f=e.next(),this.isAnnotationTypeVisible(f.type)){if(f.rangeStyle){var h=f.start,k=f.end;g!==d&&(h=d.mapOffset(h,!0),k=d.mapOffset(k,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:h,end:k,style:f.rangeStyle})}f.lineStyle&&(a.style=this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,f.lineStyle))}}};h.addMixin(a.prototype);return{FoldingAnnotation:k,AnnotationType:m,AnnotationTypeList:h,AnnotationModel:d,AnnotationStyler:a}});
define("orion/editor/editor","i18n!orion/editor/nls/messages orion/editor/eventTarget orion/editor/tooltip orion/editor/annotations orion/objects orion/util".split(" "),function(l,n,m,k,f,h){function g(a){a=a||{};this._domNode=a.domNode;this._model=a.model;this._undoStack=a.undoStack;this._statusReporter=a.statusReporter;this._title=null;var b=this;this._listener={onChanged:function(a){b.onChanged(a)}};this._model&&this._model.addEventListener("Changed",this._listener.onChanged);this.checkDirty()}
function d(a){a=a||{};g.call(this,a);this._textViewFactory=a.textViewFactory;this._undoStackFactory=a.undoStackFactory;this._textDNDFactory=a.textDNDFactory;this._annotationFactory=a.annotationFactory;this._foldingRulerFactory=a.foldingRulerFactory;this._lineNumberRulerFactory=a.lineNumberRulerFactory;this._contentAssistFactory=a.contentAssistFactory;this._keyBindingFactory=a.keyBindingFactory;this._contentAssist=this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=
this._annotationStyler=null}var a=k.AnnotationType;g.prototype={destroy:function(){this.uninstall();this._statusReporter=this._domNode=null;this._model&&this._model.removeEventListener("Changed",this._listener.onChanged)},checkDirty:function(){this.setDirty(this._undoStack&&!this._undoStack.isClean())},focus:function(){},getModel:function(){return this._model},getText:function(a,b){return this.getModel().getText(a,b)},getTitle:function(){return this._title},getUndoStack:function(){return this._undoStack},
install:function(){this.installed=!0},isDirty:function(){return this._dirty},markClean:function(){this.getUndoStack().markClean();this.setDirty(!1)},onDirtyChanged:function(a){return this.dispatchEvent(a)},onInputChanged:function(a){return this.dispatchEvent(a)},onChanged:function(a){this.checkDirty()},reportStatus:function(a,b,d){this._statusReporter&&this._statusReporter(a,b,d)},resize:function(){},setDirty:function(a){this._dirty!==a&&(this._dirty=a,this.onDirtyChanged({type:"DirtyChanged"}))},
_setModelText:function(a){this._model&&this._model.setText(a)},setInput:function(a,b,d,g){this._title=a;g||(b?this.reportStatus(b,"error"):null!==d&&(void 0!==d&&"string"===typeof d)&&this._setModelText(d),this._undoStack&&this._undoStack.reset());this.checkDirty();this.onInputChanged({type:"InputChanged",title:a,message:b,contents:d,contentsSaved:g})},setText:function(a,b,d){this.getModel().setText(a,b,d)},uninstall:function(){this.installed=!1}};n.EventTarget.addMixin(g.prototype);d.prototype=new g;
f.mixin(d.prototype,{destroy:function(){g.prototype.destroy.call(this);this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=null},getAnnotationModel:function(){return this._annotationModel},getAnnotationRuler:function(){return this._annotationRuler},getAnnotationStyler:function(){return this._annotationStyler},getContentAssist:function(){return this._contentAssist},
getFoldingRuler:function(){return this._foldingRuler},getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){if(!this._textView)return null;var a=this._textView.getModel();a.getBaseModel&&(a=a.getBaseModel());return a},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getKeyModes:function(){return this._textView.getKeyModes()},getSourceCodeActions:function(){return this._sourceCodeActions},getLinkedMode:function(){return this._linkedMode},
getTextActions:function(){return this._textActions},focus:function(){this._textView&&this._textView.focus()},resize:function(){this._textView&&this._textView.resize()},setAnnotationRulerVisible:function(a,b){if(this._annotationRulerVisible!==a||b)if(this._annotationRulerVisible=a,this._annotationRuler){var d=this._textView;a?d.addRuler(this._annotationRuler,0):d.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(a,b){if(this._foldingRulerVisible!==a||b)if(this._foldingRulerVisible=
a,this._foldingRuler){var d=this._textView;d.getModel().getBaseModel&&(a?d.addRuler(this._foldingRuler):d.removeRuler(this._foldingRuler))}},setLineNumberRulerVisible:function(a,b){if(this._lineNumberRulerVisible!==a||b)if(this._lineNumberRulerVisible=a,this._lineNumberRuler){var d=this._textView;a?d.addRuler(this._lineNumberRuler,!this._annotationRulerVisible?0:1):d.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(a,b){if(this._overviewRulerVisible!==a||b)if(this._overviewRulerVisible=
a,this._overviewRuler){var d=this._textView;a?d.addRuler(this._overviewRuler):d.removeRuler(this._overviewRuler)}},mapOffset:function(a,b){var d=this._textView.getModel();d.getBaseModel&&(a=d.mapOffset(a,b));return a},getLineAtOffset:function(a){return this.getModel().getLineAtOffset(this.mapOffset(a))},getLineStart:function(a){return this.getModel().getLineStart(a)},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},getSelection:function(){var a=this._textView,b=a.getSelection(),
a=a.getModel();a.getBaseModel&&(b.start=a.mapOffset(b.start),b.end=a.mapOffset(b.end));return b},_expandOffset:function(e){var b=this._textView.getModel(),d=this._annotationModel;if(d&&b.getBaseModel)for(e=d.getAnnotations(e,e+1);e.hasNext();)b=e.next(),b.type===a.ANNOTATION_FOLDING&&b.expand&&b.expand()},setCaretOffset:function(a,b,d){var g=this._textView,f=g.getModel();f.getBaseModel&&(this._expandOffset(a),a=f.mapOffset(a,!0));g.setCaretOffset(a,b,d)},setText:function(a,b,d){var g=this._textView,
f=g.getModel();f.getBaseModel&&(void 0!==b&&(this._expandOffset(b),b=f.mapOffset(b,!0)),void 0!==d&&(this._expandOffset(d),d=f.mapOffset(d,!0)));g.setText(a,b,d)},setSelection:function(a,b,d,g){var f=this._textView,h=f.getModel();h.getBaseModel&&(this._expandOffset(a),this._expandOffset(b),a=h.mapOffset(a,!0),b=h.mapOffset(b,!0));f.setSelection(a,b,d,g)},moveSelection:function(a,b,d,g){var f=this._textView;this.setSelection(a,b||a,1/3,function(){(void 0===g||g)&&f.focus();d&&d()})},_getTooltipInfo:function(a,
b){var d=this._textView,g=this.getAnnotationModel();if(!g)return null;var f=this._annotationStyler;if(!f)return null;var h=d.getOffsetAtLocation(a,b);if(-1===h)return null;h=this.mapOffset(h);f=f.getAnnotationsByType(g,h,h+1);g=[];for(h=0;h<f.length;h++)f[h].rangeStyle&&g.push(f[h]);if(0===g.length)return null;d=d.convert({x:a,y:b},"document","page");return{contents:g,anchor:"left",x:d.x+10,y:d.y+20}},_highlightCurrentLine:function(e,b){var d=this._annotationModel;if(d){var g=this._textView;if(!g.getOptions("singleMode")){var f=
g.getModel(),h=b?f.getLineAtOffset(b.start):-1,k=f.getLineAtOffset(e.start),g=e.start===e.end,l=!b||b.start===b.end,m=f.getLineStart(k),n=f.getLineEnd(k);f.getBaseModel&&(m=f.mapOffset(m),n=f.mapOffset(n));f=this._currentLineAnnotation;if(!(h===k&&l&&g&&f&&f.start===m&&f.end===n)){var h=f?[f]:null,w;g&&(f=a.createAnnotation(a.ANNOTATION_CURRENT_LINE,m,n),w=[f]);this._currentLineAnnotation=f;d.replaceAnnotations(h,w)}}}},installTextView:function(){this.install()},install:function(){if(!this._textView){this._textView=
this._textViewFactory();this._undoStackFactory&&(this._undoStack=this._undoStackFactory.createUndoStack(this),this.checkDirty());this._textDNDFactory&&(this._textDND=this._textDNDFactory.createTextDND(this,this._undoStack));this._contentAssistFactory&&(this._contentAssist=this._contentAssistFactory.createContentAssistMode(this).getContentAssist());var e=this,b=this._textView,d=this;this._listener={onModelChanged:function(a){d.checkDirty()},onMouseOver:function(a){d._listener.onMouseMove(a)},onMouseMove:function(a){var e=
m.Tooltip.getTooltip(b);e&&!(d._listener.lastMouseX===a.event.clientX&&d._listener.lastMouseY===a.event.clientY)&&(d._listener.lastMouseX=a.event.clientX,d._listener.lastMouseY=a.event.clientY,e.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return d._getTooltipInfo(this.x,this.y)}}))},onMouseOut:function(a){var e=m.Tooltip.getTooltip(b);e&&!(d._listener.lastMouseX===a.event.clientX&&d._listener.lastMouseY===a.event.clientY)&&(d._listener.lastMouseX=a.event.clientX,d._listener.lastMouseY=a.event.clientY,
e.setTarget(null))},onScroll:function(a){(a=m.Tooltip.getTooltip(b))&&a.setTarget(null,0,0)},onSelection:function(a){d._updateCursorStatus();d._highlightCurrentLine(a.newValue,a.oldValue)}};b.addEventListener("ModelChanged",this._listener.onModelChanged);b.addEventListener("Selection",this._listener.onSelection);b.addEventListener("MouseOver",this._listener.onMouseOver);b.addEventListener("MouseOut",this._listener.onMouseOut);b.addEventListener("MouseMove",this._listener.onMouseMove);b.addEventListener("Scroll",
this._listener.onScroll);if(this._keyBindingFactory){var f;if(f="function"===typeof this._keyBindingFactory?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):this._keyBindingFactory.createKeyBindings(e,this._undoStack,this._contentAssist))this._textActions=f.textActions,this._linkedMode=f.linkedMode,this._sourceCodeActions=f.sourceCodeActions}f=function(b,d){if(void 0!==b&&-1!==b){for(var g=this.getView().getModel(),f=this.getAnnotationModel(),h=e.mapOffset(g.getLineStart(b)),
g=e.mapOffset(g.getLineEnd(b)),k=f.getAnnotations(h,g),l=null;k.hasNext();){var p=k.next();if(p.type===a.ANNOTATION_BOOKMARK){l=p;break}}l?f.removeAnnotation(l):(l=a.createAnnotation(a.ANNOTATION_BOOKMARK,h,g),l.title=void 0,f.addAnnotation(l))}};if(this._annotationFactory){var h=b.getModel();h.getBaseModel&&(h=h.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(h))if(h=this._annotationStyler=this._annotationFactory.createAnnotationStyler(b,this._annotationModel))h.addAnnotationType(a.ANNOTATION_CURRENT_SEARCH),
h.addAnnotationType(a.ANNOTATION_MATCHING_SEARCH),h.addAnnotationType(a.ANNOTATION_ERROR),h.addAnnotationType(a.ANNOTATION_WARNING),h.addAnnotationType(a.ANNOTATION_MATCHING_BRACKET),h.addAnnotationType(a.ANNOTATION_CURRENT_BRACKET),h.addAnnotationType(a.ANNOTATION_CURRENT_LINE),h.addAnnotationType(a.ANNOTATION_READ_OCCURRENCE),h.addAnnotationType(a.ANNOTATION_WRITE_OCCURRENCE),h.addAnnotationType(a.ANNOTATION_SELECTED_LINKED_GROUP),h.addAnnotationType(a.ANNOTATION_CURRENT_LINKED_GROUP),h.addAnnotationType(a.ANNOTATION_LINKED_GROUP),
h.addAnnotationType("orion.annotation.highlightError");var h=this._annotationFactory.createAnnotationRulers(this._annotationModel),k=this._annotationRuler=h.annotationRuler;k&&(k.onDblClick=f,k.setMultiAnnotationOverlay({html:"\x3cdiv class\x3d'annotationHTML overlay'\x3e\x3c/div\x3e"}),k.addAnnotationType(a.ANNOTATION_ERROR),k.addAnnotationType(a.ANNOTATION_WARNING),k.addAnnotationType(a.ANNOTATION_TASK),k.addAnnotationType(a.ANNOTATION_BOOKMARK));this.setAnnotationRulerVisible(this._annotationRulerVisible||
void 0===this._annotationRulerVisible,!0);if(k=this._overviewRuler=h.overviewRuler)k.addAnnotationType(a.ANNOTATION_CURRENT_SEARCH),k.addAnnotationType(a.ANNOTATION_MATCHING_SEARCH),k.addAnnotationType(a.ANNOTATION_READ_OCCURRENCE),k.addAnnotationType(a.ANNOTATION_WRITE_OCCURRENCE),k.addAnnotationType(a.ANNOTATION_CURRENT_BLAME),k.addAnnotationType(a.ANNOTATION_ERROR),k.addAnnotationType(a.ANNOTATION_WARNING),k.addAnnotationType(a.ANNOTATION_TASK),k.addAnnotationType(a.ANNOTATION_BOOKMARK),k.addAnnotationType(a.ANNOTATION_MATCHING_BRACKET),
k.addAnnotationType(a.ANNOTATION_CURRENT_BRACKET),k.addAnnotationType(a.ANNOTATION_CURRENT_LINE);this.setOverviewRulerVisible(this._overviewRulerVisible||void 0===this._overviewRulerVisible,!0)}this._lineNumberRulerFactory&&(this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.addAnnotationType(a.ANNOTATION_CURRENT_BLAME),this._lineNumberRuler.addAnnotationType(a.ANNOTATION_BLAME),this._lineNumberRuler.onDblClick=f,this.setLineNumberRulerVisible(this._lineNumberRulerVisible||
void 0===this._lineNumberRulerVisible,!0));this._foldingRulerFactory&&(this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(a.ANNOTATION_FOLDING),this.setFoldingRulerVisible(this._foldingRulerVisible||void 0===this._foldingRulerVisible,!0));this.dispatchEvent({type:"TextViewInstalled",textView:b});g.prototype.install.call(this)}},uninstallTextView:function(){this.uninstall()},uninstall:function(){var a=this._textView;a&&(a.destroy(),
this._annotationModel&&this._annotationModel.setTextModel(null),this._textView=this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=this._title=null,this._dirty=!1,this._foldingRulerVisible=this._overviewRulerVisible=this._lineNumberRulerVisible=this._annotationRulerVisible=void 0,this.dispatchEvent({type:"TextViewUninstalled",textView:a}),
g.prototype.uninstall.call(this))},_updateCursorStatus:function(){for(var a=this.getModel(),b=this.getCaretOffset(),d=a.getLineAtOffset(b),a=a.getLineStart(d),b=b-a,a=this.getKeyModes(),g=0;g<a.length;g++){var f=a[g];if(f.isActive()&&f.isStatusActive&&f.isStatusActive())return}this.reportStatus(h.formatMessage(l.lineColumn,d+1,b+1))},showAnnotations:function(e,b,d,g){var f=this._annotationModel;if(f){for(var h=[],k=[],l=f.getTextModel(),m=f.getAnnotations(),n;m.hasNext();)n=m.next(),-1!==b.indexOf(n.type)&&
n.creatorID===this&&h.push(n);if(e)for(b=0;b<e.length;b++)if(n=e[b]){if(d)n=d(n);else{var w;"number"===typeof n.line?(w=l.getLineStart(n.line-1),m=w+n.start-1,w=w+n.end-1):(m=n.start,w=n.end);var z=g(n);if(!z)continue;n=a.createAnnotation(z,m,w,n.description)}n.creatorID=this;k.push(n)}f.replaceAnnotations(h,k)}},showProblems:function(e){this.showAnnotations(e,[a.ANNOTATION_ERROR,a.ANNOTATION_WARNING,a.ANNOTATION_TASK],null,function(b){switch(b.severity){case "error":return a.ANNOTATION_ERROR;case "warning":return a.ANNOTATION_WARNING;
case "task":return a.ANNOTATION_TASK}return null})},showOccurrences:function(e){this.showAnnotations(e,[a.ANNOTATION_READ_OCCURRENCE,a.ANNOTATION_WRITE_OCCURRENCE],null,function(b){return b.readAccess?a.ANNOTATION_READ_OCCURRENCE:a.ANNOTATION_WRITE_OCCURRENCE})},showBlame:function(e){var b=this._blameRGB,d=this.getTextView().getOptions("parent").ownerDocument;if(!b){var g=h.createElement(d,"div");g.className="annotation blame";d.body.appendChild(g);var m=(d.defaultView||d.parentWindow).getComputedStyle(g).getPropertyValue("background-color");
g.parentNode.removeChild(g);var g=m.indexOf("("),s=m.indexOf(")"),m=m.substring(g+1,s);this._blameRGB=b=m.split(",").slice(0,3)}var n=function(){var a=k.AnnotationType.createAnnotation(this.groupType,this.start,this.end,this.title);a.style=f.mixin({},a.style);a.style.style=f.mixin({},a.style.style);a.style.style.backgroundColor="";this.groupAnnotation=a;a.blame=this.blame;a.html=this.html;a.creatorID=this.creatorID;return a},r=function(){var a=h.createElement(d,"div");a.className="tooltipTitle";var b=
this.blame.Message.indexOf("\n");-1===b&&(b=this.blame.Message.length);var e=h.createElement(d,"a");e.href=this.blame.CommitLink;e.appendChild(d.createTextNode(this.blame.Message.substring(0,b)));a.appendChild(e);a.appendChild(h.createElement(d,"br"));a.appendChild(d.createTextNode(h.formatMessage(l.committerOnTime,this.blame.AuthorName,this.blame.Time)));return a},x=this.getModel();this.showAnnotations(e,[a.ANNOTATION_BLAME,a.ANNOTATION_CURRENT_BLAME],function(e){var d=x.getLineStart(e.Start-1),
g=x.getLineEnd(e.End-1,!0),d=k.AnnotationType.createAnnotation(a.ANNOTATION_BLAME,d,g,r),g=b.slice(0);g.push(e.Shade);d.style=f.mixin({},d.style);d.style.style=f.mixin({},d.style.style);d.style.style.backgroundColor="rgba("+g.join()+")";d.groupId=e.Name;d.groupType=a.ANNOTATION_CURRENT_BLAME;d.createGroupAnnotation=n;d.html='\x3cimg class\x3d"annotationHTML blame" src\x3d"'+e.AuthorImage+'"/\x3e';d.blame=e;return d})},showSelection:function(a,b,d,g,f){"number"===typeof a?("number"!==typeof b&&(b=
a),this.moveSelection(a,b)):"number"===typeof d&&(a=this.getModel().getLineStart(d-1),"number"===typeof g&&(a+=g),"number"!==typeof f&&(f=0),this.moveSelection(a,a+f))},_setModelText:function(a){this._textView&&(this._textView.setText(a),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection()))},setInput:function(a,b,d,f,h){g.prototype.setInput.call(this,a,b,d,f);this._textView&&(!f&&!h)&&this._textView.focus()},onGotoLine:function(a,b,d,g){if(this._textView){var f=
this.getModel();a=Math.max(0,Math.min(a,f.getLineCount()-1));var h=f.getLineStart(a),k=0;void 0===d&&(d=0);"string"===typeof b?(a=f.getLine(a).indexOf(b),-1!==a&&(k=a,d=k+b.length)):(k=b,b=f.getLineEnd(a)-h,k=Math.min(k,b),d=Math.min(d,b));this.moveSelection(h+k,h+d,g)}}});return{BaseEditor:g,Editor:d}});
define("orion/editor/find","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/keyModes orion/editor/annotations orion/regex orion/objects orion/util".split(" "),function(l,n,m,k,f,h,g){function d(a){var e=a.getTextView();m.KeyMode.call(this,e);this.editor=a;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";e.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));e.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
var d=this;this._listener={onVerify:function(a){var b=d.editor,e=b.getModel(),g=b.mapOffset(a.start),b=b.mapOffset(a.end),e=e.getText(g,b);if((e=d._prefix.match(RegExp("^"+f.escape(e),"i")))&&0<e.length)d._prefix+=a.text,d._success=!0,d._status(),d.find(d._forward,!0),a.text=null},onSelection:function(){d._ignoreSelection||d.setActive(!1)}}}function a(a,e,d){if(a){this._editor=a;this._undoStack=e;this._showAll=!0;this._visible=!1;this._wrap=this._caseInsensitive=!0;this._wholeWord=!1;this._incremental=
!0;this._regex=!1;this._findAfterReplace=!0;this._reverse=this._hideAfterFind=!1;this._timer=this._end=this._start=void 0;this._lastString="";var g=this;this._listeners={onEditorFocus:function(a){g._removeCurrentAnnotation(a)}};this.setOptions(d)}}var e={};d.prototype=new m.KeyMode;h.mixin(d.prototype,{createKeyBindings:function(){var a=n.KeyBinding,e=[];e.push({actionID:"incrementalFindBackspace",keyBinding:new a(8)});e.push({actionID:"incrementalFindCancel",keyBinding:new a(13)});e.push({actionID:"incrementalFindCancel",
keyBinding:new a(27)});e.push({actionID:"incrementalFindReverse",keyBinding:new a(38)});e.push({actionID:"incrementalFind",keyBinding:new a(40)});e.push({actionID:"incrementalFindReverse",keyBinding:new a("k",!0,!0)});e.push({actionID:"incrementalFind",keyBinding:new a("k",!0)});return e},find:function(a,e){this._forward=a;if(!this.isActive())return this.setActive(!0),!1;var d=this._prefix;if(0===d.length)return!1;var g=this.editor,f=g.getModel(),f=a?this._success?e?this._start:g.getCaretOffset()+
1:0:this._success?e?this._start:g.getCaretOffset():f.getCharCount()-1;(d=g.getModel().find({string:d,start:f,reverse:!a,caseInsensitive:d.toLowerCase()===d}).next())?(e||(this._start=f),this._ignoreSelection=this._success=!0,g.moveSelection(a?d.start:d.end,a?d.end:d.start),this._ignoreSelection=!1):this._success=!1;this._status();return!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(a){this._active!==a&&(this._active=a,this._prefix=
"",this._success=!0,a=this.editor.getTextView(),this._start=this.editor.getCaretOffset(),this.editor.setCaretOffset(this._start),this._active?(a.addEventListener("Verify",this._listener.onVerify),a.addEventListener("Selection",this._listener.onSelection),a.addKeyMode(this)):(a.removeEventListener("Verify",this._listener.onVerify),a.removeEventListener("Selection",this._listener.onSelection),a.removeKeyMode(this)),this._status())},_backspace:function(){var a=this._prefix,a=this._prefix=a.substring(0,
a.length-1);return 0===a.length?(this._ignoreSelection=this._success=!0,this.editor.setCaretOffset(this.editor.getSelection().start),this._ignoreSelection=!1,this._status(),!0):this.find(this._forward,!0)},_status:function(){if(this.isActive()){var a;a=this._forward?this._success?l.incrementalFindStr:l.incrementalFindStrNotFound:this._success?l.incrementalFindReverseStr:l.incrementalFindReverseStrNotFound;a=g.formatMessage(a,this._prefix);this.editor.reportStatus(a,this._success?"":"error")}else this.editor.reportStatus("")}});
e.IncrementalFind=d;a.prototype={find:function(a,e,d){this.setOptions({reverse:!a});var g=this.getFindString(),f;e&&(g=e.findString||g,f=e.count);a=this.getOptions();this.setOptions(e);e=d?this._startOffset:this.getStartOffset();if((f=this._doFind(g,e,f))&&!d)this._startOffset=f.start;this.setOptions(a);this._hideAfterFind&&this.hide();return f},getStartOffset:function(){return void 0!==this._start?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var a=
this._editor.getSelection(),a=this._editor.getText(a.start,a.end);this._regex&&(a=f.escape(a));return a||this._lastString},getOptions:function(){return{showAll:this._showAll,caseInsensitive:this._caseInsensitive,wrap:this._wrap,wholeWord:this._wholeWord,incremental:this._incremental,regex:this._regex,findAfterReplace:this._findAfterReplace,hideAfterFind:this._hideAfterFind,reverse:this._reverse,findCallback:this._findCallback,start:this._start,end:this._end}},getReplaceString:function(){return""},
hide:function(){this._visible=!1;this._savedOptions&&(this.setOptions(this._savedOptions.pop()),0===this._savedOptions.length&&(this._savedOptions=null));this._removeAllAnnotations();var a=this._editor.getTextView();a&&(a.removeEventListener("Focus",this._listeners.onEditorFocus),a.focus())},_processReplaceString:function(a){var e=a;if(this._regex){for(var e="",d=!1,g=this._editor.getModel().getLineDelimiter(),f=0;f<a.length;f++){var h=a.substring(f,f+1);if(d){switch(h){case "R":e+=g;break;case "r":e+=
"\r";break;case "n":e+="\n";break;case "t":e+="\t";break;case "\\":e+="\\";break;default:e+="\\"+h}d=!1}else"\\"===h?d=!0:e+=h}d&&(e+="\\")}return e},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var e=this._editor,d=this._processReplaceString(this.getReplaceString()),g=e.getSelection().start;if(e=e.getModel().find({string:a,start:g,reverse:!1,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),
this._doReplace(e.start,e.end,a,d),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var a=this.getFindString();if(a){this._replacingAll=!0;var e=this._editor,d=e.getTextView();e.reportStatus(l.replacingAll);var f=this._processReplaceString(this.getReplaceString()),h=this;window.setTimeout(function(){for(var k=0,m=0;;){var n=h._doFind(a,k,null,!0);if(!n)break;m++;1===m&&(d.setRedraw(!1),h.startUndo());h._doReplace(n.start,n.end,a,f);k=h.getStartOffset()}0<
m&&(h.endUndo(),d.setRedraw(!0));0<k?e.reportStatus(g.formatMessage(l.replacedMatches,m)):e.reportStatus(l.nothingReplaced,"error");h._replacingAll=!1},100)}},setOptions:function(a){if(a){if((!0===a.showAll||!1===a.showAll)&&this._showAll!==a.showAll)if(this._showAll=a.showAll,this.isVisible())if(this._showAll)this._markAllOccurrences();else{var e=this._editor.getAnnotationModel();e&&e.removeAnnotations(k.AnnotationType.ANNOTATION_MATCHING_SEARCH)}if(!0===a.caseInsensitive||!1===a.caseInsensitive)this._caseInsensitive=
a.caseInsensitive;if(!0===a.wrap||!1===a.wrap)this._wrap=a.wrap;if(!0===a.wholeWord||!1===a.wholeWord)this._wholeWord=a.wholeWord;if(!0===a.incremental||!1===a.incremental)this._incremental=a.incremental;if(!0===a.regex||!1===a.regex)this._regex=a.regex;if(!0===a.findAfterReplace||!1===a.findAfterReplace)this._findAfterReplace=a.findAfterReplace;if(!0===a.hideAfterFind||!1===a.hideAfterFind)this._hideAfterFind=a.hideAfterFind;if(!0===a.reverse||!1===a.reverse)this._reverse=a.reverse;a.hasOwnProperty("findCallback")&&
(this._findCallback=a.findCallback);a.hasOwnProperty("start")&&(this._start=a.start);a.hasOwnProperty("end")&&(this._end=a.end)}},show:function(a){this._visible=!0;a&&(this._savedOptions||(this._savedOptions=[]),this._savedOptions.push(this.getOptions()),this.setOptions(a));this._startOffset=this._editor.getSelection().start;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var e=this;window.setTimeout(function(){e._incremental&&e.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&
this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_find:function(a,e,d){return this._editor.getModel().find({string:a,start:e,end:this._end,reverse:this._reverse,wrap:d?!1:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})},_doFind:function(a,e,d,g){d=d||1;var f=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;var h,m;if(this._regex)try{m=this._find(a,e,g)}catch(n){f.reportStatus(n.message,
"error");return}else m=this._find(a,e,g);for(a=0;a<d&&m.hasNext();a++)h=m.next();if(!this._replacingAll){h?this._editor.reportStatus(""):this._editor.reportStatus(l.notFound,"error");if(this.isVisible()){d=k.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(m=f.getAnnotationModel())m.removeAnnotations(d),h&&m.addAnnotation(k.AnnotationType.createAnnotation(d,h.start,h.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var u=this;this._timer=window.setTimeout(function(){u._markAllOccurrences();
u._timer=null},500)}}this._findCallback?this._findCallback(h):h&&f.moveSelection(h.start,h.end,null,!1)}return h},_doReplace:function(a,e,d,g){var f=this._editor;this._regex&&(g=f.getText(a,e).replace(RegExp(d,this._caseInsensitive?"i":""),g));f.setText(g,a,e);f.setSelection(a,a+g.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var e=k.AnnotationType.ANNOTATION_MATCHING_SEARCH,d=a.getAnnotations(),g=[],f;d.hasNext();){var h=d.next();h.type===e&&g.push(h)}if(this.isVisible()){d=
this.getFindString();d=this._editor.getModel().find({string:d,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(f=[];d.hasNext();)h=d.next(),f.push(k.AnnotationType.createAnnotation(e,h.start,h.end))}a.replaceAnnotations(g,f)}},_removeAllAnnotations:function(){var a=this._editor.getAnnotationModel();a&&(a.removeAnnotations(k.AnnotationType.ANNOTATION_CURRENT_SEARCH),a.removeAnnotations(k.AnnotationType.ANNOTATION_MATCHING_SEARCH))},_removeCurrentAnnotation:function(a){(a=
this._editor.getAnnotationModel())&&a.removeAnnotations(k.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};e.Find=a;return e});
define("orion/editor/findUI",["i18n!orion/editor/nls/messages","orion/editor/find","orion/objects","orion/editor/util","orion/util"],function(l,n,m,k,f){function h(g,d,a){n.Find.call(this,g,d,a)}h.prototype=new n.Find;m.mixin(h.prototype,{getFindString:function(){var g=this._findInput;return!g?n.Find.prototype.getFindString.call(this):g.value},getReplaceString:function(){var g=this._replaceInput;return!g?n.Find.prototype.getReplaceString(this):g.value},hide:function(){var g=this.isVisible();n.Find.prototype.hide.call(this);
g&&(this._rootDiv.className="textViewFind")},show:function(g){n.Find.prototype.show.call(this,g);var d=g.findString;g=g.replaceString;var a=this._findInput;a||(this._create(),a=this._findInput);d&&(a.value=d);g&&(this._replaceInput.value=g);var e=this;window.setTimeout(function(){e._rootDiv.className="textViewFind show";a.select();a.focus()},0)},_create:function(){var g=this,d=this._editor.getTextView(),a=d.getOptions("parent").ownerDocument,e=f.createElement(a,"div");e.className="textViewFind";k.addEventListener(e,
"keydown",function(a){g._handleKeyDown(a)});this._rootDiv=e;this._createContents(a,e);d._rootDiv.insertBefore(e,d._rootDiv.firstChild)},_createContents:function(g,d){var a=this,e=f.createElement(g,"input");e.className="textViewFindInput";this._findInput=e;e.type="text";e.placeholder=l.findWith;k.addEventListener(e,"input",function(b){return a._handleInput(b)});d.appendChild(e);e=f.createElement(g,"span");a._createButton(g,e,l.next,function(){a.find(!0)});a._createButton(g,e,l.previous,function(){a.find(!1)});
d.appendChild(e);a._editor.getTextView().getOptions("readonly")||(e=f.createElement(g,"input"),e.className="textViewReplaceInput",this._replaceInput=e,e.type="text",e.placeholder=l.replaceWith,d.appendChild(e),e=f.createElement(g,"span"),a._createButton(g,e,l.replace,function(){a.replace()}),a._createButton(g,e,l.replaceAll,function(){a.replaceAll()}),d.appendChild(e));e=f.createElement(g,"span");a._createButton(g,e,l.regex,function(b){a._toggle("regex",b.target)},this._regex,l.regexTooltip);a._createButton(g,
e,l.caseInsensitive,function(b){a._toggle("caseInsensitive",b.target)},this._caseInsensitive,l.caseInsensitiveTooltip);a._createButton(g,e,l.wholeWord,function(b){a._toggle("wholeWord",b.target)},this._wholeWord,l.wholeWordTooltip);d.appendChild(e);e=a._createButton(g,d,"",function(){a.hide()});e.className="textViewFindCloseButton";e.title=l.closeTooltip},_createButton:function(g,d,a,e,b,f){var h=g.createElement("button");this._checked(b,h);f&&(h.title=f);k.addEventListener(h,"click",function(a){e.call(this,
a)},!1);a&&h.appendChild(g.createTextNode(a));d.appendChild(h);return h},_toggle:function(g,d){var a={};a[g]=!this["_"+g];this.setOptions(a);this._checked(a[g],d)},_checked:function(g,d){d.className="textViewFindButton";g&&(d.className+=" checked")},_handleInput:function(){this._incremental&&this.find(!0,null,!0);return!0},_handleKeyDown:function(g){var d,a=(f.isMac?g.metaKey:g.ctrlKey)&&!g.altKey&&!g.shiftKey;a&&70===g.keyCode&&(d=!0);if((f.isMac?g.metaKey:g.ctrlKey)&&!g.altKey&&75===g.keyCode||
13===g.keyCode)13===g.keyCode?this.find(this._reverse?g.shiftKey:!g.shiftKey):this.find(!g.shiftKey),d=!0;a&&82===g.keyCode&&(this.replace(),d=!0);27===g.keyCode&&(this.hide(),d=!0);return d?(g.stopPropagation&&g.stopPropagation(),g.preventDefault&&g.preventDefault(),g.cancelBubble=!0,!1):!0}});return{FindUI:h}});
define("orion/editor/actions","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/annotations orion/editor/tooltip orion/editor/find orion/editor/findUI orion/util".split(" "),function(l,n,m,k,f,h,g){function d(a,b,e){this.editor=a;this.undoStack=b;this._incrementalFind=new f.IncrementalFind(a);this._find=e?e:new h.FindUI(a,b);this._lastEditLocation=null;this.init()}function a(a,b,e,d){this.editor=a;this.undoStack=b;this.contentAssist=e;this.linkedMode=d;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var e=m.AnnotationType,b={};d.prototype={init:function(){var a=this.editor.getTextView();this._lastEditListener={onModelChanged:function(a){this.editor.isDirty()&&(this._lastEditLocation=a.start+a.addedCharCount)}.bind(this)};a.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);a.setAction("undo",function(a){if(this.undoStack){var b=1;a&&a.count&&(b=a.count);for(;0<b;)this.undoStack.undo(),--b;return!0}return!1}.bind(this),
{name:l.undo});a.setAction("redo",function(a){if(this.undoStack){var b=1;a&&a.count&&(b=a.count);for(;0<b;)this.undoStack.redo(),--b;return!0}return!1}.bind(this),{name:l.redo});a.setKeyBinding(new n.KeyBinding("f",!0),"find");a.setAction("find",function(){if(this._find){var a=this.editor.getSelection();this._find.show({findString:this.editor.getText(a.start,a.end)});return!0}return!1}.bind(this),{name:l.find});a.setKeyBinding(new n.KeyBinding("k",!0),"findNext");a.setAction("findNext",function(a){return this._find?
(this._find.find(!0,a),!0):!1}.bind(this),{name:l.findNext});a.setKeyBinding(new n.KeyBinding("k",!0,!0),"findPrevious");a.setAction("findPrevious",function(a){return this._find?(this._find.find(!1,a),!0):!1}.bind(this),{name:l.findPrevious});a.setKeyBinding(new n.KeyBinding("j",!0),"incrementalFind");a.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:l.incrementalFind});a.setKeyBinding(new n.KeyBinding("j",!0,!0),"incrementalFindReverse");
a.setAction("incrementalFindReverse",function(){this._incrementalFind&&this._incrementalFind.find(!1);return!0}.bind(this),{name:l.incrementalFindReverse});a.setAction("tab",function(){return this.indentLines()}.bind(this));a.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:l.unindentLines});a.setKeyBinding(new n.KeyBinding(38,!1,!1,!0),"moveLinesUp");a.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:l.moveLinesUp});a.setKeyBinding(new n.KeyBinding(40,
!1,!1,!0),"moveLinesDown");a.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:l.moveLinesDown});a.setKeyBinding(new n.KeyBinding(38,!0,!1,!0),"copyLinesUp");a.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:l.copyLinesUp});a.setKeyBinding(new n.KeyBinding(40,!0,!1,!0),"copyLinesDown");a.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:l.copyLinesDown});a.setKeyBinding(new n.KeyBinding("d",!0,!1,!1),
"deleteLines");a.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:l.deleteLines});a.setKeyBinding(new n.KeyBinding("l",!g.isMac,!1,!1,g.isMac),"gotoLine");a.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:l.gotoLine});a.setKeyBinding(new n.KeyBinding(190,!0),"nextAnnotation");a.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:l.nextAnnotation});a.setKeyBinding(new n.KeyBinding(188,!0),"previousAnnotation");
a.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:l.prevAnnotation});a.setKeyBinding(new n.KeyBinding("e",!0,!1,!0,!1),"expand");a.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:l.expand});a.setKeyBinding(new n.KeyBinding("c",!0,!1,!0,!1),"collapse");a.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:l.collapse});a.setKeyBinding(new n.KeyBinding("e",!0,!0,!0,!1),"expandAll");a.setAction("expandAll",
function(){return this.expandAnnotations(!0)}.bind(this),{name:l.expandAll});a.setKeyBinding(new n.KeyBinding("c",!0,!0,!0,!1),"collapseAll");a.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:l.collapseAll});a.setKeyBinding(new n.KeyBinding("q",!g.isMac,!1,!1,g.isMac),"lastEdit");a.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:l.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
var b=a.getModel(),e=a.getSelection(),d=b.getLineAtOffset(e.start),e=b.getLineAtOffset(e.end>e.start?e.end-1:e.end),g=b.getLineStart(d),d=b.getLineEnd(e,!0),f=b.getLineCount(),h="",g=b.getText(g,d);e===f-1&&(g=(h=b.getLineDelimiter())+g);a.setText(g,d,d);a.setSelection(d+h.length,d+g.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=b.getLineAtOffset(e.start),e=b.getLineAtOffset(e.end>e.start?e.end-
1:e.end),d=b.getLineStart(d),g=b.getLineEnd(e,!0),f=b.getLineCount(),h="",g=b.getText(d,g);e===f-1&&(g+=h=b.getLineDelimiter());a.setText(g,d,d);a.setSelection(d,d+g.length-h.length);return!0},deleteLines:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var e=1;a&&a.count&&(e=a.count);var d=b.getSelection(),g=b.getModel(),f=g.getLineAtOffset(d.start);a=g.getLineStart(f);e=d.start!==d.end||1===e?g.getLineAtOffset(d.end>d.start?d.end-1:d.end):Math.min(f+e-1,g.getLineCount()-
1);e=g.getLineEnd(e,!0);b.setText("",a,e);return!0},expandAnnotation:function(a){var b=this.editor,e=b.getAnnotationModel();if(!e)return!0;var d=b.getModel(),g=b.getCaretOffset(),f=d.getLineAtOffset(g),g=d.getLineStart(f),f=d.getLineEnd(f,!0);d.getBaseModel&&(g=d.mapOffset(g),f=d.mapOffset(f),d.getBaseModel());for(var h,e=e.getAnnotations(g,f);!h&&e.hasNext();)d=e.next(),d.type===m.AnnotationType.ANNOTATION_FOLDING&&(h=d);h&&a!==h.expanded&&(a?h.expand():(b.setCaretOffset(h.start),h.collapse()));
return!0},expandAnnotations:function(a){var b=this.editor,e=b.getTextView(),b=b.getAnnotationModel();if(!b)return!0;var d=b.getAnnotations();for(e.setRedraw(!1);d.hasNext();)b=d.next(),b.type===m.AnnotationType.ANNOTATION_FOLDING&&a!==b.expanded&&(a?b.expand():b.collapse());e.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){var e=a.getModel(),d=a.getSelection(),g=e.getLineAtOffset(d.start),f=e.getLineAtOffset(d.end>
d.start?d.end-1:d.end);if(g!==f){var h=[];h.push("");for(var k=g;k<=f;k++)h.push(e.getLine(k,!0));k=e.getLineStart(g);e=e.getLineEnd(f,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(h.join(b),k,e);a.setSelection(k===d.start?d.start:d.start+b.length,d.end+(f-g+1)*b.length);return!0}return!1}},gotoLastEdit:function(){"number"===typeof this._lastEditLocation&&this.editor.showSelection(this._lastEditLocation);return!0},gotoLine:function(){var a=this.editor,
b=a.getModel().getLineAtOffset(a.getCaretOffset());if(b=prompt(l.gotoLinePrompty,b+1))b=parseInt(b,10),a.onGotoLine(b-1,0);return!0},moveLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=b.getLineAtOffset(e.start),g=b.getLineAtOffset(e.end>e.start?e.end-1:e.end),f=b.getLineCount();if(g===f-1)return!0;var d=b.getLineStart(d),e=b.getLineEnd(g,!0),h=b.getLineEnd(g+1,!0)-(e-d),k=0;g!==f-2?b=b.getText(d,e):(g=b.getLineEnd(g),
b=b.getText(g,e)+b.getText(d,g),k+=e-g);this.startUndo();a.setText("",d,e);a.setText(b,h,h);a.setSelection(h+k,h+k+b.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=b.getLineAtOffset(e.start);if(0===d)return!0;var g=b.getLineAtOffset(e.end>e.start?e.end-1:e.end),f=b.getLineCount(),e=b.getLineStart(d-1),h=b.getLineStart(d),k=b.getLineEnd(g,!0),l=b.getText(h,k),m=0;g===f-1&&(g=b.getLineEnd(d-
1),d=b.getLineEnd(d-1,!0),l+=b.getText(g,d),h=g,m=d-g);this.startUndo();a.setText("",h,k);a.setText(l,e,e);a.setSelection(e,e+l.length-m);this.endUndo();return!0},nextAnnotation:function(a){function b(a){return!!a.lineStyle||a.type===e.ANNOTATION_MATCHING_BRACKET||a.type===e.ANNOTATION_CURRENT_BRACKET||!f.isAnnotationTypeVisible(a.type)}var d=this.editor,g=d.getAnnotationModel();if(!g)return!0;var f=d.getOverviewRuler()||d.getAnnotationStyler();if(!f)return!0;for(var h=d.getModel(),l=d.getCaretOffset(),
m=g.getAnnotations(a?l:0,a?h.getCharCount():l),n=null;m.hasNext();){var z=m.next();if(a){if(z.start<=l)continue}else if(z.start>=l)continue;if(!b(z)&&(n=z,a))break}if(n){for(var B=[n],m=g.getAnnotations(n.start,n.start);m.hasNext();)z=m.next(),z!==n&&!b(z)&&B.push(z);var v=d.getTextView(),A=h.getLineAtOffset(n.start),D=k.Tooltip.getTooltip(v);if(!D)return d.moveSelection(n.start),!0;d.moveSelection(n.start,n.start,function(){D.setTarget({getTooltipInfo:function(){var a=v.convert({x:v.getLocationAtOffset(n.start).x,
y:v.getLocationAtOffset(h.getLineStart(A)).y},"document","page");return{contents:B,x:a.x,y:a.y+Math.floor(1.33*v.getLineHeight(A))}}},0)})}return!0},unindentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){for(var e=a.getModel(),d=a.getSelection(),g=e.getLineAtOffset(d.start),f=e.getLineAtOffset(d.end>d.start?d.end-1:d.end),h=b.getOptions("tabSize"),k=Array(h+1).join(" "),l=[],m=b=0,n=g;n<=f;n++){var v=e.getLine(n,!0);if(e.getLineStart(n)!==
e.getLineEnd(n))if(0===v.indexOf("\t"))v=v.substring(1),b++;else if(0===v.indexOf(k))v=v.substring(h),b+=h;else return!0;n===g&&(m=b);l.push(v)}g=e.getLineStart(g);h=e.getLineEnd(f,!0);e=e.getLineStart(f);a.setText(l.join(""),g,h);f=g===d.start?d.start:d.start-m;d=Math.max(f,d.end-b+(d.end===e+1&&d.start!==d.end?1:0));a.setSelection(f,d);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};b.TextActions=
d;a.prototype={init:function(){var a=this.editor.getTextView();a.setAction("lineStart",function(){return this.lineStart()}.bind(this));a.setAction("enter",function(){return this.autoIndent()}.bind(this));a.setKeyBinding(new n.KeyBinding("t",!0,!1,!0),"trimTrailingWhitespaces");a.setAction("trimTrailingWhitespaces",function(){return this.trimTrailingWhitespaces()}.bind(this),{name:l.trimTrailingWhitespaces});a.setKeyBinding(new n.KeyBinding(191,!0),"toggleLineComment");a.setAction("toggleLineComment",
function(){return this.toggleLineComment()}.bind(this),{name:l.toggleLineComment});a.setKeyBinding(new n.KeyBinding(191,!0,!g.isMac,!1,g.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:l.addBlockComment});a.setKeyBinding(new n.KeyBinding(220,!0,!g.isMac,!1,g.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:l.removeBlockComment});a.setKeyBinding(new n.KeyBinding("[",
!1,!1,!1,!1,"keypress"),"autoPairSquareBracket");a.setAction("autoPairSquareBracket",function(){return this.autoPairBrackets("[","]")}.bind(this));a.setKeyBinding(new n.KeyBinding("]",!1,!1,!1,!1,"keypress"),"skipClosingSquareBracket");a.setAction("skipClosingSquareBracket",function(){return this.skipClosingBracket("]")}.bind(this));a.setKeyBinding(new n.KeyBinding("\x3c",!1,!1,!1,!1,"keypress"),"autoPairAngleBracket");a.setAction("autoPairAngleBracket",function(){return this.autoPairBrackets("\x3c",
"\x3e")}.bind(this));a.setKeyBinding(new n.KeyBinding("\x3e",!1,!1,!1,!1,"keypress"),"skipClosingAngleBracket");a.setAction("skipClosingAngleBracket",function(){return this.skipClosingBracket("\x3e")}.bind(this));a.setKeyBinding(new n.KeyBinding("(",!1,!1,!1,!1,"keypress"),"autoPairParentheses");a.setAction("autoPairParentheses",function(){return this.autoPairBrackets("(",")")}.bind(this));a.setKeyBinding(new n.KeyBinding(")",!1,!1,!1,!1,"keypress"),"skipClosingParenthesis");a.setAction("skipClosingParenthesis",
function(){return this.skipClosingBracket(")")}.bind(this));a.setKeyBinding(new n.KeyBinding("{",!1,!1,!1,!1,"keypress"),"autoPairBraces");a.setAction("autoPairBraces",function(){return this.autoPairBrackets("{","}")}.bind(this));a.setKeyBinding(new n.KeyBinding("}",!1,!1,!1,!1,"keypress"),"skipClosingBrace");a.setAction("skipClosingBrace",function(){return this.skipClosingBracket("}")}.bind(this));a.setKeyBinding(new n.KeyBinding("'",!1,!1,!1,!1,"keypress"),"autoPairSingleQuotation");a.setAction("autoPairSingleQuotation",
function(){return this.autoPairQuotations("'")}.bind(this));a.setKeyBinding(new n.KeyBinding('"',!1,!1,!1,!1,"keypress"),"autoPairDblQuotation");a.setAction("autoPairDblQuotation",function(){return this.autoPairQuotations('"')}.bind(this));a.setAction("deletePrevious",function(){return this.deletePrevious()}.bind(this))},autoIndent:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;var e=a.getSelection();if(e.start===e.end){for(var d=a.getModel(),g=d.getLineAtOffset(e.start),
f=d.getLine(g,!1),h=d.getLineStart(g),k=0,l=e.start-h,m;k<l&&(32===(m=f.charCodeAt(k))||9===m);)k++;var h=f.substring(0,k),b=b.getOptions("tabSize","expandTab"),n=b.expandTab?Array(b.tabSize+1).join(" "):"\t",b=d.getLineDelimiter(),v=/^[\s]*\/\*[\*]*[\s]*$/,A=/^[\s]*\*/,D=/\*\/[\s]*$/,C=f.substring(0,l),E=f.substring(l),K;if(this.smartIndentation&&123===f.charCodeAt(K=C.trimRight().length-1))return d=l-K-1,E=E.length-E.trimLeft().length,f=125===f.charCodeAt(l+E)?b+h+n+b+h:b+h+n,a.setText(f,e.start-
d,e.end+E),a.setCaretOffset(e.start+b.length+h.length+n.length-d),!0;if(this.autoCompleteComments&&!D.test(C)&&(v.test(C)||A.test(C))){if(k=v.exec(C)){f=b+h+" * ";f=D.test(E)?f+E.substring(0,E.length-2).trim():f+E.trim();if(d.getLineCount()===g+1||!A.test(d.getLine(g+1)))f+=b+h+" */";a.setText(f,e.start,e.end+E.length);a.setCaretOffset(e.start+b.length+h.length+3);return!0}if(k=A.exec(C))for(g-=1;0<=g;g--){k=d.getLine(g,!1);if(v.test(k))return D.test(E)||47===f.charCodeAt(l)?(f=b+h+"*"+E,h=e.start+
b.length+h.length+1):(f=b+h+"* "+E,h=e.start+b.length+h.length+2),a.setText(f,e.start,e.end+E.length),a.setCaretOffset(h),!0;if(!A.test(k))break}}else{if(D.test(C)&&32===h.charCodeAt(h.length-1))return f=b+h.substring(0,h.length-1),a.setText(f,e.start,e.end),a.setCaretOffset(e.start+f.length),!0;if(0<k){for(k=l;k<f.length&&(32===(m=f.charCodeAt(k++))||9===m);)e.end++;a.setText(d.getLineDelimiter()+h,e.start,e.end);return!0}}}return!1},addBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
var b=a.getModel(),e=a.getSelection(),d=this._findEnclosingComment(b,e.start,e.end);if(void 0!==d.commentStart&&void 0!==d.commentEnd)return!0;b=b.getText(e.start,e.end);if(0===b.length)return!0;var d=b.length,b=b.replace(/\/\*|\*\//g,""),g=b.length;a.setText("/*"+b+"*/",e.start,e.end);a.setSelection(e.start+2,e.end+2+(g-d));return!0},autoPairBrackets:function(a,b){if("["===a&&!this.autoPairSquareBrackets||"{"===a&&!this.autoPairBraces||"("===a&&!this.autoPairParentheses||"\x3c"===a&&!this.autoPairAngleBrackets)return!1;
var e=this.editor;if(e.getTextView().getOptions("readonly"))return!1;var d=e.getSelection(),g=e.getModel(),f=e.getCaretOffset()===g.getCharCount()?"":g.getText(d.start,d.start+1).trim(),h=/^$|[)}\]>]/;return d.start===d.end&&h.test(f)?(e.setText(a+b,d.start,d.start),e.setCaretOffset(d.start+1),!0):d.start!==d.end?(g=g.getText(d.start,d.end),e.setText(a+g+b,d.start,d.end),e.setSelection(d.start+1,d.end+1),!0):!1},autoPairQuotations:function(a){if(!this.autoPairQuotation)return!1;var b=this.editor;
if(b.getTextView().getOptions("readonly"))return!1;var e=b.getSelection(),d=b.getModel(),g=b.getCaretOffset(),f=0===g?"":d.getText(e.start-1,e.start).trim(),h=g===d.getCharCount()?"":d.getText(e.start,e.start+1).trim(),g=/^"$|^'$/,k=/\w/,l=/^$|[)}\]>]/;if(e.start!==e.end){d=d.getText(e.start,e.end);if(g.test(d))return!1;b.setText(a+d+a,e.start,e.end);b.setSelection(e.start+1,e.end+1)}else{if(h!==a){if(f===a||g.test(h)||k.test(f)||!l.test(h))return!1;b.setText(a+a,e.start,e.start)}b.setCaretOffset(e.start+
1)}return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&0<a.positions.length&&this.linkedMode){for(var b=[],e=0;e<a.positions.length;++e)b[e]={positions:[{offset:a.positions[e].offset,length:a.positions[e].length}]};this.linkedMode.enterLinkedMode({groups:b,escapePosition:a.escapePosition})}else a.groups&&0<a.groups.length&&this.linkedMode?this.linkedMode.enterLinkedMode({groups:a.groups,escapePosition:a.escapePosition}):a.escapePosition&&this.editor.getTextView().setCaretOffset(a.escapePosition);
return!0},deletePrevious:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getSelection();if(b.start!==b.end)return!1;var e=a.getModel(),d=a.getCaretOffset(),g=0===d?"":e.getText(b.start-1,b.start),e=d===e.getCharCount()?"":e.getText(b.start,b.start+1);("("===g&&")"===e||"["===g&&"]"===e||"{"===g&&"}"===e||"\x3c"===g&&"\x3e"===e||'"'===g&&'"'===e||"'"===g&&"'"===e)&&a.setText("",b.start,b.start+1);return!1},_findEnclosingComment:function(a,b,e){var d=a.getLineAtOffset(b),
g=a.getLineAtOffset(e),f,h,k,l,m,n;for(f=d;0<=f&&!(h=a.getLine(f),k=f===d?b-a.getLineStart(d):h.length,l=h.lastIndexOf("/*",k),h=h.lastIndexOf("*/",k),h>l);f--)if(-1!==l){m=a.getLineStart(f)+l;break}for(f=g;f<a.getLineCount()&&!(h=a.getLine(f),k=f===g?e-a.getLineStart(g):0,l=h.indexOf("/*",k),h=h.indexOf("*/",k),-1!==l&&l<h);f++)if(-1!==h){n=a.getLineStart(f)+h;break}return{commentStart:m,commentEnd:n}},lineStart:function(){for(var a=this.editor,b=a.getModel(),e=a.getCaretOffset(),d=b.getLineAtOffset(e),
g=b.getLineStart(d),b=b.getLine(d),d=0;d<b.length;d++){var f=b.charCodeAt(d);if(!(32===f||9===f))break}d+=g;return e!==d?(a.setSelection(d,d),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=b.getText(e.start,e.end),g,f,h;for(h=0;h<d.length;h++)if("/*"===d.substring(h,h+2)){g=e.start+h;break}for(;h<d.length;h++)if("*/"===d.substring(h,h+2)){f=e.start+h;break}if(void 0!==g&&void 0!==f)a.setText(b.getText(g+
2,f),g,f+2),a.setSelection(g,f);else{d=this._findEnclosingComment(b,e.start,e.end);if(void 0===d.commentStart||void 0===d.commentEnd)return!0;b=b.getText(d.commentStart+2,d.commentEnd);a.setText(b,d.commentStart,d.commentEnd+2);a.setSelection(e.start-2,e.end-2)}return!0},toggleLineComment:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;for(var e=this.lineComment||"//",d=a.getModel(),g=a.getSelection(),f=d.getLineAtOffset(g.start),h=d.getLineAtOffset(g.end>g.start?
g.end-1:g.end),k=!0,l=[],m,n=f;n<=h;n++){var v=d.getLine(n,!0);m=v.indexOf(e);l.push(m);if(!k||-1===m)k=!1;else if(0!==m){for(k=0;k<m;k++){var A=v.charCodeAt(k);if(!(32===A||9===A))break}k=k===m}}n=e.length;v=d.getLineStart(f);b.setRedraw(!1);this.startUndo();if(k){for(k=l.length-1;0<=k;k--)m=l[k]+d.getLineStart(f+k),a.setText("",m,m+n);d=d.getLineStart(h);e=v===g.start?g.start:g.start-n;g=g.end-n*(h-f+1)+(g.end===d+1?n:0)}else{for(k=l.length-1;0<=k;k--)m=d.getLineStart(f+k),a.setText(e,m,m);e=v===
g.start?g.start:g.start+n;g=g.end+n*(h-f+1)}this.endUndo();b.setRedraw(!0);a.setSelection(e,g);return!0},trimTrailingWhitespaces:function(){var a=this.editor,b=a.getModel(),e=a.getSelection();a.getTextView().setRedraw(!1);a.getUndoStack().startCompoundChange();for(var d=/(\s+$)/,g=b.getLineCount(),f=0;f<g;f++){var h=b.getLine(f),k=d.exec(h);if(k){var l=b.getLineStart(f),h=k[0].length,k=l+k.index;b.setText("",k,k+h);e.start>k&&(e.start=Math.max(k,e.start-h));e.start!==e.end&&e.end>k&&(e.end=Math.max(k,
e.end-h))}}a.getUndoStack().endCompoundChange();a.getTextView().setRedraw(!0);a.setSelection(e.start,e.end,!1)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},skipClosingBracket:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var e=b.getSelection(),d=b.getModel();return(b.getCaretOffset()===d.getCharCount()?"":d.getText(e.start,e.start+1))===a?(b.setCaretOffset(e.start+1),!0):!1},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},
setAutoPairParentheses:function(a){this.autoPairParentheses=a},setAutoPairBraces:function(a){this.autoPairBraces=a},setAutoPairSquareBrackets:function(a){this.autoPairSquareBrackets=a},setAutoPairAngleBrackets:function(a){this.autoPairAngleBrackets=a},setAutoPairQuotations:function(a){this.autoPairQuotation=a},setAutoCompleteComments:function(a){this.autoCompleteComments=a},setLineComment:function(a){this.lineComment=a},setSmartIndentation:function(a){this.smartIndentation=a}};b.SourceCodeActions=
a;String.prototype.trimLeft||(String.prototype.trimLeft=function(){return this.replace(/^\s+/g,"")});String.prototype.trimRight||(String.prototype.trimRight=function(){return this.replace(/\s+$/g,"")});return b});
define("orion/editor/undoStack",[],function(){function l(k,f,h,g,d){this.model=k;this.offset=f;this.text=h;this.previousText=g;this.type=d}function n(k){this.owner=k;this.changes=[]}function m(k,f){this.size=void 0!==f?f:100;this.reset();var h=this;this._listener={onChanging:function(d){h._onChanging(d)},onDestroy:function(d){h._onDestroy(d)}};if(k.getModel){var g=k.getModel();g.getBaseModel&&(g=g.getBaseModel());this.model=g;this.setView(k)}else this.shared=!0,this.model=k;this.model.addEventListener("Changing",
this._listener.onChanging)}l.prototype={getRedoChanges:function(){return[{start:this.offset,end:this.offset+this.previousText.length,text:this.text}]},getUndoChanges:function(){return[{start:this.offset,end:this.offset+this.text.length,text:this.previousText}]},undo:function(k,f){this._doUndoRedo(this.offset,this.previousText,this.text,k,f);return!0},redo:function(k,f){this._doUndoRedo(this.offset,this.text,this.previousText,k,f);return!0},merge:function(k,f,h,g,d){if(g===this.type){if(1===g&&k===
this.offset+this.text.length)return this.text+=f,!0;if(-1===g&&d===this.offset)return this.offset=k,this.previousText=h+this.previousText,!0;if(-1===g&&k===this.offset)return this.previousText+=h,!0}return!1},_doUndoRedo:function(k,f,h,g,d){this.model.setText(f,k,k+h.length);d&&g&&(h=g.getModel(),h!==this.model&&(k=h.mapOffset(k,!0)),g.setSelection(k,k+f.length))}};n.prototype={getRedoChanges:function(){for(var k=[],f=0;f<this.changes.length;f++)k=k.concat(this.changes[f].getRedoChanges());return k},
getUndoChanges:function(){for(var k=[],f=this.changes.length-1;0<=f;f--)k=k.concat(this.changes[f].getUndoChanges());return k},add:function(k){this.changes.push(k)},end:function(k){k&&(this.endSelection=k.getSelection(),this.endCaret=k.getCaretOffset());(k=this.owner)&&k.end&&k.end()},undo:function(k,f){1<this.changes.length&&k&&k.setRedraw(!1);for(var h=this.changes.length-1;0<=h;h--)this.changes[h].undo(k,!1);1<this.changes.length&&k&&k.setRedraw(!0);if(f&&k){var h=this.startSelection.start,g=this.startSelection.end;
k.setSelection(this.startCaret?h:g,this.startCaret?g:h)}(h=this.owner)&&h.undo&&h.undo();return 0<this.changes.length},redo:function(k,f){1<this.changes.length&&k&&k.setRedraw(!1);for(var h=0;h<this.changes.length;h++)this.changes[h].redo(k,!1);(1<this.changes.length,k)&&k.setRedraw(!0);if(f&&k){var h=this.endSelection.start,g=this.endSelection.end;k.setSelection(this.endCaret?h:g,this.endCaret?g:h)}(h=this.owner)&&h.redo&&h.redo();return 0<this.changes.length},merge:function(k,f,h,g,d){var a=this.changes.length;
return 0<a?this.changes[a-1].merge(k,f,h,g,d):!1},start:function(k){k&&(this.startSelection=k.getSelection(),this.startCaret=k.getCaretOffset());(k=this.owner)&&k.start&&k.start()}};m.prototype={destroy:function(){this._onDestroy()},add:function(k){this.compoundChange?this.compoundChange.add(k):(this.stack.splice(this.index,this.stack.length-this.index,k),this.index++,this.stack.length>this.size&&(this.stack.shift(),this.index--))},markClean:function(){this._commitUndo();if(this.cleanChange=this.stack[this.index-
1])this.cleanChange.type=2},isClean:function(){return this.cleanChange===this.stack[this.index-1]},canUndo:function(){return 0<this.index},canRedo:function(){return 0<this.stack.length-this.index},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=void 0},getSize:function(){return{undo:this.index,redo:this.stack.length-this.index}},getRedoChanges:function(){this._commitUndo();for(var k=[],f=this.index;f<this.stack.length;f++)k=k.concat(this.stack[f].getRedoChanges());
return k},getUndoChanges:function(){this._commitUndo();for(var k=[],f=this.index;0<=f;f--)k=k.concat(this.stack[f].getUndoChanges());return k},undo:function(){this._commitUndo();var k;k=!1;this._ignoreUndo=!0;do{if(0>=this.index)break;k=this.stack[--this.index]}while(!(k=k.undo(this.view,!0)));this._ignoreUndo=!1;return k},redo:function(){this._commitUndo();var k;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;k=this.stack[this.index++]}while(!k.redo(this.view,!0));this._ignoreUndo=
!1;return!0},reset:function(){this.index=0;this.cleanChange=void 0;this.stack=[];this._ignoreUndo=!1;this._compoundChange=void 0},setView:function(k){this.view!==k&&(this.view&&k.removeEventListener("Destroy",this._listener.onDestroy),(this.view=k)&&k.addEventListener("Destroy",this._listener.onDestroy))},startCompoundChange:function(k){this._commitUndo();k=new n(k);this.add(k);this.compoundChange=k;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){this.endCompoundChange()},
_onDestroy:function(k){(!k||!this.shared)&&this.model.removeEventListener("Changing",this._listener.onChanging);this.view&&(this.view.removeEventListener("Destroy",this._listener.onDestroy),this.view=null)},_onChanging:function(k){if(!this._ignoreUndo){var f=k.text,h=k.start,g=k.addedCharCount,d=k.removedCharCount;k=h+d;var a=0;0===g&&1===d?a=-1:1===g&&0===d&&(a=1);g=this.stack.length;d=this.model.getText(h,k);(!(0<g&&this.index===g)||!this.stack[g-1].merge(h,f,d,a,k))&&this.add(new l(this.model,
h,f,d,a))}}};return{UndoStack:m}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(l,n,m,k){function f(a,b,d,g){this._location=b||"left";this._overview=d||"page";this._rulerStyle=g;this._view=null;var f=this;this._listener={onTextModelChanged:function(a){f._onTextModelChanged(a)},onAnnotationModelChanged:function(a){f._onAnnotationModelChanged(a)}};this.setAnnotationModel(a)}function h(a,b,d,g,h){f.call(this,a,b,"page",d);this._oddStyle=g||{style:{backgroundColor:"white"}};
this._evenStyle=h||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._firstLine=1}function g(a,b,d){f.call(this,a,b,"page",d)}function d(a,b,d){f.call(this,a,b,"document",d)}function a(a,b,d){g.call(this,a,b,d)}f.prototype={getAnnotations:function(a,b){var d=this._annotationModel;if(!d)return[];var g=this._view.getModel(),f=g.getLineStart(a),h=g.getLineEnd(b-1),k=g;g.getBaseModel&&(k=g.getBaseModel(),f=g.mapOffset(f),h=g.mapOffset(h));for(var l=[],d=this.getAnnotationsByType(d,f,h),f=0;f<
d.length;f++)for(var h=d[f],m=k.getLineAtOffset(h.start),n=k.getLineAtOffset(Math.max(h.start,h.end-1)),w=m;w<=n;w++){var z=w;if(g!==k){z=k.getLineStart(w);z=g.mapOffset(z,!0);if(-1===z)continue;z=g.getLineAtOffset(z)}if(a<=z&&z<b){var B=this._mergeAnnotation(l[z],h,w-m,n-m+1);B&&(l[z]=B)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var v in l)l[v]._multiple&&(l[v].html+=this._multiAnnotationOverlay.html);return l},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(a){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=a)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(a){this._multiAnnotation=a},setMultiAnnotationOverlay:function(a){this._multiAnnotationOverlay=
a},setView:function(a){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=a;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(a,b){if(void 0!==a){var d=this._view,g=d.getModel(),f=g,h=g.getLineStart(a),k=h,l=h,n=this._annotationModel;if(n){d=d.getSelection();l=g.getLineEnd(a,!0);h<=d.start&&d.start<l&&(h=d.start);g.getBaseModel&&(h=g.mapOffset(h),
l=g.mapOffset(l),f=g.getBaseModel());for(var u,l=n.getAnnotations(h,l),n=null;!u&&l.hasNext();)d=l.next(),this.isAnnotationTypeVisible(d.type)&&(n=d,d.start<=h||(u=d));n&&void 0!==n.groupId&&(this._currentClickGroup=this._currentClickGroup===n.groupId?null:n.groupId,this._setCurrentGroup(a));u&&f.getLineAtOffset(u.start)===f.getLineAtOffset(h)?(h=u.start,l=u.end):l=h=k;g.getBaseModel&&(h=g.mapOffset(h,!0),l=g.mapOffset(l,!0))}(g=m.Tooltip.getTooltip(this._view))&&g.setTarget(null);this._view.setSelection(l,
h,1/3,function(){})}},onDblClick:function(a,b){},onMouseMove:function(a,b){var d=m.Tooltip.getTooltip(this._view);if(d&&!(d.isVisible()&&this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var g=this;d.setTarget({y:b.clientY,getTooltipInfo:function(){return g._getTooltipInfo(g._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,b){this.onMouseMove(a,b);this._currentClickGroup||this._setCurrentGroup(a)},onMouseOut:function(a,b){this._currentClickGroup||this._setCurrentGroup(-1);var d=m.Tooltip.getTooltip(this._view);
d&&d.setTarget(null)},_getTooltipInfo:function(a,b){if(void 0!==a){var d=this._view,g=d.getModel(),f=this._annotationModel,h=[];if(f){var h=g.getLineStart(a),k=g.getLineEnd(a);g.getBaseModel&&(h=g.mapOffset(h),k=g.mapOffset(k));h=this.getAnnotationsByType(f,h,k)}f=this._getTooltipContents(a,h);if(!f)return null;f={contents:f,anchor:this.getLocation()};h=d.getClientArea();"document"===this.getOverview()?h.y=d.convert({y:b},"view","document").y:h.y=d.getLocationAtOffset(g.getLineStart(a)).y;d.convert(h,
"document","page");f.x=h.x;f.y=h.y;"right"===f.anchor&&(f.x+=h.width);return f}},_getTooltipContents:function(a,b){return b},_onAnnotationModelChanged:function(a){function b(a){for(var b=0;b<a.length;b++)if(f.isAnnotationTypeVisible(a[b].type)){var e=a[b].start,h=a[b].end;g.getBaseModel&&(e=g.mapOffset(e,!0),h=g.mapOffset(h,!0));-1!==e&&-1!==h&&d.redrawLines(g.getLineAtOffset(e),g.getLineAtOffset(Math.max(e,h-1))+1,f)}}var d=this._view;if(d){var g=d.getModel(),f=this,h=g.getLineCount();a.textModelChangedEvent?
(a=a.textModelChangedEvent.start,g.getBaseModel&&(a=g.mapOffset(a,!0)),a=g.getLineAtOffset(a),d.redrawLines(a,h,f)):(b(a.added),b(a.removed),b(a.changed))}},_mergeAnnotation:function(a,b,d,g){a||(a={});0===d&&(a.html&&b.html?(b.html!==a.html&&(!a._multiple&&this._multiAnnotation)&&(a.html=this._multiAnnotation.html),a._multiple=!0):a.html=b.html);a.style=this._mergeStyle(a.style,b.style);return a},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass=a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?
a.styleClass+(" "+b.styleClass):b.styleClass;var d;if(b.style)for(d in a.style||(a.style={}),b.style)void 0===a.style[d]&&(a.style[d]=b.style[d]);if(b.attributes)for(d in a.attributes||(a.attributes={}),b.attributes)void 0===a.attributes[d]&&(a.attributes[d]=b.attributes[d])}return a},_setCurrentGroup:function(a){var b=this._annotationModel,d=null,g=b.getTextModel(),f,h=this._currentGroupAnnotation;if(-1!==a){var k=g.getLineStart(a),l=g.getLineEnd(a);g.getBaseModel&&(k=g.mapOffset(k),l=g.mapOffset(l));
for(f=b.getAnnotations(k,l);f.hasNext();)if(g=f.next(),this.isAnnotationTypeVisible(g.type)&&g.start<=k&&g.end>=l&&void 0!==g.groupId){d=g;break}if(h&&d&&h.groupId===d.groupId)return}this._currentGroupAnnotation=null;h&&b.removeAnnotations(h.groupType);if(d&&-1!==a){this._currentGroupAnnotation=d;f=b.getAnnotations();for(a=[];f.hasNext();)g=f.next(),delete g.groupAnnotation,g.groupId===d.groupId&&(g=g.createGroupAnnotation(),a.push(g));b.replaceAnnotations(null,a)}}};n.AnnotationTypeList.addMixin(f.prototype);
h.prototype=new f;h.prototype.getAnnotations=function(a,b){for(var d=f.prototype.getAnnotations.call(this,a,b),g=this._view.getModel(),h=a;h<b;h++){var k=h&1?this._oddStyle:this._evenStyle,l=h;g.getBaseModel&&(l=g.getLineStart(l),l=g.getBaseModel().getLineAtOffset(g.mapOffset(l)));d[h]||(d[h]={});d[h].html=this._firstLine+l+"";d[h].style||(d[h].style=k)}return d};h.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();return this.getAnnotations(a-1,a)[a-1]};h.prototype.setFirstLine=
function(a){this._firstLine=void 0!==a?a:1};h.prototype._onTextModelChanged=function(a){var b=a.start;a=this._view.getModel();var d=a.getBaseModel?a.getBaseModel().getLineCount():a.getLineCount(),d=(this._firstLine+d-1+"").length;this._numOfDigits!==d&&(this._numOfDigits=d,b=a.getLineAtOffset(b),this._view.redrawLines(b,a.getLineCount(),this))};g.prototype=new f;d.prototype=new f;d.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};
d.prototype._getTooltipContents=function(a,b){if(0===b.length){var d=this._view.getModel(),g=a;d.getBaseModel&&(g=d.getLineStart(g),g=d.getBaseModel().getLineAtOffset(d.mapOffset(g)));return k.formatMessage(l.line,g+1)}return f.prototype._getTooltipContents.call(this,a,b)};d.prototype._mergeAnnotation=function(a,b,d,g){if(0===d)return a||(a={html:"\x26nbsp;",style:{style:{height:3*g+"px"}}},a.style=this._mergeStyle(a.style,b.overviewStyle)),a};a.prototype=new g;a.prototype.onClick=function(a,b){if(void 0!==
a){var d=this._annotationModel;if(d){var g=this._view.getModel(),f=g.getLineStart(a),h=g.getLineEnd(a,!0);g.getBaseModel&&(f=g.mapOffset(f),h=g.mapOffset(h),g=g.getBaseModel());for(var k,d=d.getAnnotations(f,h);!k&&d.hasNext();)h=d.next(),this.isAnnotationTypeVisible(h.type)&&g.getLineAtOffset(h.start)===g.getLineAtOffset(f)&&(k=h);k&&((g=m.Tooltip.getTooltip(this._view))&&g.setTarget(null),k.expanded?k.collapse():k.expand())}}};a.prototype._getTooltipContents=function(a,b){if(0<b.length){var d=this._view.getModel(),
f=d.getLineStart(a);d.getBaseModel&&(f=d.mapOffset(f),d=d.getBaseModel());for(var f=d.getLineAtOffset(f),h=0;h<b.length;h++){var k=b[h];if(this.isAnnotationTypeVisible(k.type)&&d.getLineAtOffset(k.start)===f){if(b[h].expanded)break;return g.prototype._getTooltipContents.call(this,a,[k])}}}return null};a.prototype._onAnnotationModelChanged=function(a){function b(a){for(k=0;k<a.length;k++)if(h.isAnnotationTypeVisible(a[k].type)){var b=a[k].start;f.getBaseModel&&(b=f.mapOffset(b,!0));-1!==b&&(m=Math.min(m,
f.getLineAtOffset(b)))}}if(a.textModelChangedEvent)g.prototype._onAnnotationModelChanged.call(this,a);else{var d=this._view;if(d){var f=d.getModel(),h=this,k,l=f.getLineCount(),m=l;b(a.added);b(a.removed);b(a.changed);a=d.getRulers();for(k=0;k<a.length;k++)d.redrawLines(m,l,a[k])}}};return{Ruler:f,AnnotationRuler:g,LineNumberRuler:h,OverviewRuler:d,FoldingRuler:a}});
define("orion/editor/textDND",["orion/util"],function(l){function n(l,k){this._view=l;this._undoStack=k;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var f=this;this._listener={onDragStart:function(h){f._onDragStart(h)},onDragEnd:function(h){f._onDragEnd(h)},onDragEnter:function(h){f._onDragEnter(h)},onDragOver:function(h){f._onDragOver(h)},onDrop:function(h){f._onDrop(h)},onDestroy:function(h){f._onDestroy(h)}};l.addEventListener("DragStart",this._listener.onDragStart);l.addEventListener("DragEnd",
this._listener.onDragEnd);l.addEventListener("DragEnter",this._listener.onDragEnter);l.addEventListener("DragOver",this._listener.onDragOver);l.addEventListener("Drop",this._listener.onDrop);l.addEventListener("Destroy",this._listener.onDestroy)}n.prototype={destroy:function(){var l=this._view;l&&(l.removeEventListener("DragStart",this._listener.onDragStart),l.removeEventListener("DragEnd",this._listener.onDragEnd),l.removeEventListener("DragEnter",this._listener.onDragEnter),l.removeEventListener("DragOver",
this._listener.onDragOver),l.removeEventListener("Drop",this._listener.onDrop),l.removeEventListener("Destroy",this._listener.onDestroy),this._view=null)},_onDestroy:function(l){this.destroy()},_onDragStart:function(l){var k=this._view,f=k.getSelection(),k=k.getModel();k.getBaseModel&&(f.start=k.mapOffset(f.start),f.end=k.mapOffset(f.end),k=k.getBaseModel());if(k=k.getText(f.start,f.end))this._dragSelection=f,l.event.dataTransfer.effectAllowed="copyMove",l.event.dataTransfer.setData("Text",k)},_onDragEnd:function(m){if(this._dragSelection){var k=
this._view,f=m.event.dataTransfer.dropEffect;if(!l.isFirefox&&("none"!==f||this._dropText))f=m.event.dataTransfer.dropEffect=this._dropEffect;this._undoStack&&this._undoStack.startCompoundChange();(m="move"===f)&&k.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var f=this._dropText,h=this._dropOffset;m&&(h>=this._dragSelection.end?h-=this._dragSelection.end-this._dragSelection.start:h>=this._dragSelection.start&&(h=this._dragSelection.start));k.setText(f,h,h);k.setSelection(h,
h+f.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(l){this._onDragOver(l)},_onDragOver:function(m){var k=m.event.dataTransfer.types,f=!this._view.getOptions("readonly");f&&k&&(f=k.contains?k.contains("text/plain")||k.contains("Text"):-1!==k.indexOf("text/plain")||-1!==k.indexOf("Text"));f?l.isFirefox||(this._dropEffect=m.event.dataTransfer.dropEffect=(l.isMac?m.event.altKey:m.event.ctrlKey)?"copy":
"move"):m.event.dataTransfer.dropEffect="none"},_onDrop:function(m){var k=this._view,f=m.event.dataTransfer.getData("Text");f&&(l.isFirefox||(m.event.dataTransfer.dropEffect=this._dropEffect),m=k.getOffsetAtLocation(m.x,m.y),this._dragSelection?(this._dropOffset=m,this._dropText=f):(k.setText(f,m,m),k.setSelection(m,m+f.length)))}};return{TextDND:n}});
define("orion/editor/templates",[],function(){function l(l,k,f,h){this.prefix=l;this.description=k;this.template=f;this.name=h;this._parse()}function n(l,k){this._keywords=l||[];this._templates=[];this.addTemplates(k||[])}l.prototype={getProposal:function(l,k,f){l=k-l.length;k={};var h,g=void 0!==f.delimiter?f.delimiter:"\n";f.indentation&&(g+=f.indentation);var d=void 0!==f.tab?f.tab:"\t",a=0,e=this.variables,b=this.segments;f=[];for(var p=0;p<b.length;p++){var n=b[p],t=e[n];if(void 0!==t)switch(n){case "${tab}":n=
d;break;case "${delimiter}":n=g;break;case "${cursor}":n="";h=a;break;default:var s=k[n];s||(s=k[n]={data:t.data,positions:[]});n=t.substitution;s.data&&s.data.values&&(n=s.data.values[0]);s.positions.push({offset:l+a,length:n.length})}f.push(n);a+=n.length}var g=[],y;for(y in k)k.hasOwnProperty(y)&&g.push(k[y]);f=f.join("");void 0===h&&(h=f.length);return{proposal:f,name:this.name,description:this.description,groups:g,escapePosition:l+h,style:"noemphasis"}},match:function(l){return 0===this.prefix.indexOf(l)},
_parse:function(){var l=this.template,k=[],f={},h,g=0,l=l.replace(/\n/g,"${delimiter}"),l=l.replace(/\t/g,"${tab}");l.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(d,a,e){var b=d.substring(2,d.length-1);a=d;var p=b,n=null,t=p.indexOf(":");-1!==t&&(p=p.substring(0,t),a="${"+p+"}",n=JSON.parse(b.substring(t+1).replace("\\}","}").trim()));(b=f[a])||(b=f[a]={});b.substitution=p;n&&(b.data=n);(h=l.substring(g,e))&&k.push(h);k.push(a);g=e+d.length;return p});(h=l.substring(g,l.length))&&k.push(h);this.segments=
k;this.variables=f}};n.prototype={addTemplates:function(m){for(var k=this.getTemplates(),f=0;f<m.length;f++)k.push(new l(m[f].prefix,m[f].description,m[f].template,m[f].name))},initialize:function(){},computeProposals:function(l,k,f){var h=this.getPrefix(l,k,f),g=[];this.isValid(h,l,k,f)&&(g=g.concat(this.getTemplateProposals(h,k,f)),g=g.concat(this.getKeywordProposals(h)));return g},getKeywords:function(){return this._keywords},getKeywordProposals:function(l){var k=[],f=this.getKeywords();if(f){for(var h=
0;h<f.length;h++)0===f[h].indexOf(l)&&k.push({proposal:f[h].substring(l.length),description:f[h],style:"noemphasis_keyword"});0<k.length&&k.splice(0,0,{proposal:"",description:"Keywords",style:"noemphasis_title_keywords",unselectable:!0})}return k},getPrefix:function(l,k,f){return f.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(l,k,f){for(var h=[],g=this.getTemplates(),d=0;d<g.length;d++){var a=g[d];a.match(l)&&(a=a.getProposal(l,k,f),this.removePrefix(l,a),
h.push(a))}0<h.length&&(h.sort(function(a,b){return a.name<b.name?-1:a.name>b.name?1:0}),h.splice(0,0,{proposal:"",description:"Templates",style:"noemphasis_title",unselectable:!0}));return h},removePrefix:function(l,k){if(!(k.overwrite=k.proposal.substring(0,l.length)!==l))k.proposal=k.proposal.substring(l.length)},isValid:function(l,k,f,h){return!0}};return{Template:l,TemplateContentAssist:n}});
define("orion/editor/linkedMode","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/keyModes orion/editor/annotations orion/editor/templates orion/objects orion/util".split(" "),function(l,n,m,k,f,h){function g(a,e,b){var d=a.getTextView();m.KeyMode.call(this,d);this.editor=a;this.undoStack=e;this.contentAssist=b;this.linkedModeModel=null;d.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));d.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);
return!0}.bind(this));d.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));d.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(0<a.selectedGroupIndex?a.selectedGroupIndex-1:a.groups.length-1);return!0}.bind(this));this.linkedModeListener={onActivating:function(a){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),
this.contentAssist.setProgress(null))}.bind(this),onModelChanged:function(a){if(!this.ignoreVerify){for(var b=this.editor.mapOffset(a.start),d=this.linkedModeModel,e,g;d;)if(e=this._getPositionChanged(d,b,b+a.removedCharCount),g=e.position,void 0===g||g.model!==d)this.exitLinkedMode(!1),d=this.linkedModeModel;else break;if(d){d=0;a=a.addedCharCount-a.removedCharCount;e=e.positions;for(var f,h=0;h<e.length;++h){f=e[h];g=f.position;var k=g.offset<=b&&b<=g.offset+g.length;k&&!f.ansestor?(g.offset+=d,
g.length+=a,d+=a):(g.offset+=d,f.ansestor&&k&&(g.length+=a));f.escape&&(f.model.escapePosition=g.offset)}this._updateAnnotations(e)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var b=this.editor,d=b.mapOffset(a.start),e=this.editor.mapOffset(a.end),g=this.linkedModeModel,f,h;g;)if(f=this._getPositionChanged(g,d,e),h=f.position,void 0===h||h.model!==g)this.exitLinkedMode(!1),g=this.linkedModeModel;else break;if(g){var k=this._compoundChange;k?k.owner.model===g&&k.owner.group===h.group||
(this.endUndo(),this.startUndo()):this.startUndo();g.selectedGroupIndex=h.group;var k=0,l=a.text.length-(e-d);f=f.positions;for(var p,d=d-h.position.offset,m=e-h.position.offset,n=0;n<f.length;++n)p=f[n],e=p.position,p.oldOffset=e.offset,p.model===g&&p.group===h.group?(e.offset+=k,e.length+=l,k+=l):(e.offset+=k,p.ansestor&&(e.length+=h.count*l)),p.escape&&(p.model.escapePosition=e.offset);this.ignoreVerify=!0;for(n=f.length-1;0<=n;n--)p=f[n],p.model===g&&p.group===h.group&&b.setText(a.text,p.oldOffset+
d,p.oldOffset+m);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(f)}}}.bind(this)}}var d={};g.prototype=new m.KeyMode;h.mixin(g.prototype,{createKeyBindings:function(){var a=n.KeyBinding,e=[];e.push({actionID:"linkedModeEnter",keyBinding:new a(13)});e.push({actionID:"linkedModeCancel",keyBinding:new a(27)});e.push({actionID:"linkedModeNextGroup",keyBinding:new a(9)});e.push({actionID:"linkedModePreviousGroup",keyBinding:new a(9,!1,!0)});return e},enterLinkedMode:function(a){if(!this.linkedModeModel){var e=
this.editor.getTextView();e.addKeyMode(this);e.addEventListener("Verify",this.linkedModeListener.onVerify);e.addEventListener("ModelChanged",this.linkedModeListener.onModelChanged);this.contentAssist.addEventListener("Activating",this.linkedModeListener.onActivating);this.editor.reportStatus(l.linkedModeEntered,null,!0)}this._sortedPositions=null;this.linkedModeModel&&(a.previousModel=this.linkedModeModel,a.parentGroup=this.linkedModeModel.selectedGroupIndex,this.linkedModeModel.nextModel=a);this.linkedModeModel=
a;this.selectLinkedGroup(0)},exitLinkedMode:function(a){if(this.isActive()){this._compoundChange&&(this.endUndo(),this._compoundChange=null);this._sortedPositions=null;var e=this.linkedModeModel;this.linkedModeModel=e.previousModel;e.parentGroup=e.previousModel=void 0;this.linkedModeModel&&(this.linkedModeModel.nextModel=void 0);if(!this.linkedModeModel){var b=this.editor,d=b.getTextView();d.removeKeyMode(this);d.removeEventListener("Verify",this.linkedModeListener.onVerify);d.removeEventListener("ModelChanged",
this.linkedModeListener.onModelChanged);d=this.contentAssist;d.removeEventListener("Activating",this.linkedModeListener.onActivating);d.offset=void 0;this.editor.reportStatus(l.linkedModeExited,null,!0);a&&b.setCaretOffset(e.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var a=this,d=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:d,group:d.selectedGroupIndex,end:function(){a._compoundChange=null}})}},endUndo:function(){this.undoStack&&
this.undoStack.endCompoundChange()},isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},selectLinkedGroup:function(a){var d=this.linkedModeModel;if(d){d.selectedGroupIndex=a;a=d.groups[a];var b=a.positions[0],g=this.editor;g.setSelection(b.offset,b.offset+b.length);if(d=this.contentAssist)d.offset=void 0,a.data&&"link"===a.data.type&&a.data.values?((this._groupContentAssistProvider=new f.TemplateContentAssist(a.data.values)).getPrefix=function(){var a=
g.getSelection();return a.start===a.end&&(a=g.getCaretOffset(),b.offset<=a&&a<=b.offset+b.length)?g.getText(b.offset,a):""},d.offset=b.offset,d.deactivate(),d.activate()):this._groupContentAssistProvider&&(this._groupContentAssistProvider=null,d.deactivate())}this._updateAnnotations()},_getModelPositions:function(a,d,b){for(var g=d.groups,f=0;f<g.length;f++)for(var h=g[f].positions,k=0;k<h.length;k++){var l=h[k];b&&(l={offset:l.offset+b,length:l.length});l={index:k,group:f,count:h.length,model:d,
position:l};a.push(l);d.nextModel&&d.nextModel.parentGroup===f&&(l.ansestor=!0,this._getModelPositions(a,d.nextModel,(b||0)+h[k].offset-h[0].offset))}},_getSortedPositions:function(a){var d=this._sortedPositions;if(!d){for(d=[];a.previousModel;)a=a.previousModel;for(this._getModelPositions(d,a);a;)void 0!==a.escapePosition&&d.push({escape:!0,model:a,position:{offset:a.escapePosition,length:0}}),a=a.nextModel;d.sort(function(a,d){return a.position.offset-d.position.offset});this._sortedPositions=d}return d},
_getPositionChanged:function(a,d,b){var g;a=this._getSortedPositions(a);for(var f=a.length-1;0<=f;f--){var h=a[f].position;if(h.offset<=d&&b<=h.offset+h.length){g=a[f];break}}return{position:g,positions:a}},_updateAnnotations:function(a){var d=this.editor.getAnnotationModel();if(d){for(var b=[],g=[],f=d.getAnnotations(),h;f.hasNext();)switch(h=f.next(),h.type){case k.AnnotationType.ANNOTATION_LINKED_GROUP:case k.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case k.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:b.push(h)}if(f=
this.linkedModeModel){a=a||this._getSortedPositions(f);for(var l=0;l<a.length;l++)if(h=a[l],h.model===f){var m=k.AnnotationType.ANNOTATION_LINKED_GROUP;h.group===f.selectedGroupIndex&&(m=0===h.index?k.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:k.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);h=h.position;h=k.AnnotationType.createAnnotation(m,h.offset,h.offset+h.length,"");g.push(h)}}d.replaceAnnotations(b,g)}}});d.LinkedMode=g;return d});
define("orion/editor/factories","orion/editor/actions orion/editor/undoStack orion/editor/rulers orion/editor/annotations orion/editor/textDND orion/editor/linkedMode".split(" "),function(l,n,m,k,f,h){function g(){}function d(){}function a(){}function e(){}function b(){}function p(){}var q={};g.prototype={createKeyBindings:function(a,b,d,e){e=new l.TextActions(a,b,e);var g=new h.LinkedMode(a,b,d);a=new l.SourceCodeActions(a,b,d,g);return{textActions:e,linkedMode:g,sourceCodeActions:a}}};q.KeyBindingsFactory=
g;d.prototype={createUndoStack:function(a){a=a.getTextView();return new n.UndoStack(a,200)}};q.UndoFactory=d;a.prototype={createLineNumberRuler:function(a){return new m.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};q.LineNumberRulerFactory=a;e.prototype={createFoldingRuler:function(a){return new m.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};q.FoldingRulerFactory=e;b.prototype={createAnnotationModel:function(a){return new k.AnnotationModel(a)},
createAnnotationStyler:function(a,b){return new k.AnnotationStyler(a,b)},createAnnotationRulers:function(a){var b=new m.AnnotationRuler(a,"left",{styleClass:"ruler annotations"});a=new m.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};q.AnnotationFactory=b;p.prototype={createTextDND:function(a,b){return new f.TextDND(a.getTextView(),b)}};q.TextDNDFactory=p;return q});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode","orion/objects"],function(l,n,m,k){return k.mixin({},l,n,m)});define("text!orion/compare/sideBySideTemplate.html",[],function(){return'\x3cdiv id\x3d"topWidget_id" style\x3d"height:100%;width:100%;position:relative"\x3e\n\t\x3cdiv class\x3d"leftPanelLayout "\x3e\n\t\t\x3cdiv class\x3d"titleActionContainer"\x3e\n\t\t\t\x3cdiv class\x3d"compareActionContainer" id\x3d"left_action_id"\x3e\x3c/div\x3e\n\t\t\t\x3cdiv class\x3d"titleContainer" id\x3d"left_title_id"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\t\x3cdiv class\x3d"compareEditorParent" id\x3d"left_editor_id"\x3e\x3c/div\x3e\n\t\t\x3cdiv class\x3d"statusContainer" id\x3d"left_status_id"\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\t\x3cdiv class\x3d"split compareSplitLayout"\x3e\x3c/div\x3e\n\t\x3cdiv class\x3d"rightPanelLayout"\x3e\n\t\t\x3cdiv class\x3d"titleActionContainer"\x3e\n\t\t\t\x3cdiv class\x3d"compareActionContainer" id\x3d"right_action_id"\x3e\x3c/div\x3e\n\t\t\t\x3cdiv class\x3d"titleContainer" id\x3d"right_title_id"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\t\x3cdiv class\x3d"compareEditorParent"  id\x3d"right_editor_wrapper_id"\x3e\n\t\t\t\x3cdiv class\x3d"canvasContainer"\x3e\n\t\t\t\t\x3ccanvas id\x3d"diff_canvas_id" class\x3d"compareCanvas" width\x3d"46" height\x3d"3000"\x3e\x3c/canvas\x3e\n\t\t\t\x3c/div\x3e\n\t\t\t\x3cdiv class\x3d"compareEditorParentWithCanvas" id\x3d"right_editor_id"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\t\x3cdiv class\x3d"statusContainer" id\x3d"right_status_id"\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\x3c/div\x3e'});
define("orion/compare/compareUIFactory",["orion/webui/littlelib","orion/webui/splitter","text!orion/compare/sideBySideTemplate.html"],function(l,n,m){var k=k||{};k.TwoWayCompareUIFactory=function(){function f(f){this._parentDivID=f.parentDivID;this._commandSpanId=f.commandSpanId;this._showTitle=f.showTitle;this._leftTitle=f.leftTitle;this._rightTitle=f.rightTitle;this._showLineStatus=f.showLineStatus}f.prototype={_init:function(){var f=this._parentDivID+"_";this._topWidgetDiv=l.node("topWidget_id");
this._topWidgetDiv.id=f+"topWidget_id";this._leftEditorParentDiv=l.node("left_editor_id");this._leftEditorParentDiv.id=f+"left_editor_id";this._rightEditorParentDiv=l.node("right_editor_id");this._rightEditorParentDiv.id=f+"right_editor_id";this._rightEditorWrapperDiv=l.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=f+"right_editor_wrapper_id";this._leftActionDiv=l.node("left_action_id");this._leftActionDiv.id=f+"left_action_id";this._rightActionDiv=l.node("right_action_id");this._rightActionDiv.id=
f+"right_action_id";this._leftTitleDiv=l.node("left_title_id");this._leftTitleDiv.id=f+"left_title_id";this._rightTitleDiv=l.node("right_title_id");this._rightTitleDiv.id=f+"right_title_id";this._leftStatusDiv=l.node("left_status_id");this._leftStatusDiv.id=f+"left_status_id";this._rightStatusDiv=l.node("right_status_id");this._rightStatusDiv.id=f+"right_status_id";this._diffCanvasDiv=l.node("diff_canvas_id");this._diffCanvasDiv.id=f+"diff_canvas_id";this._splitterId=f+"orion_splitter";this._showTitle||
this.disableTitle();this._showLineStatus||this.disableLineStatus()},_createSplitter:function(){var f=l.$(".split",this._topWidgetDiv);f.id=this._splitterId;var g=l.$(".leftPanelLayout",this._topWidgetDiv),d=l.$(".rightPanelLayout",this._topWidgetDiv);f&&(g&&d)&&(this._splitter=new n.Splitter({node:f,sidePanel:g,mainPanel:d}))},buildUI:function(){l.node(this._parentDivID).innerHTML=m;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(f){return l.$(".leftPanelLayout",
this._topWidgetDiv)===f},getEditorParentDiv:function(f){return f?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(f){return f?this._leftTitleDiv:this._rightTitleDiv},getActionDivId:function(f){return f?this._leftActionDiv.id:this._rightActionDiv.id},getStatusDiv:function(f){return f?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv},disableTitle:function(){this._leftEditorParentDiv.style.top=
"0px";this._rightEditorWrapperDiv.style.top="0px";this._leftTitleDiv.style.height="0px";this._rightTitleDiv.style.height="0px"},disableLineStatus:function(){this._leftEditorParentDiv.style.marginBottom="0px";this._rightEditorWrapperDiv.style.marginBottom="0px";this._leftStatusDiv.style.height="0px";this._rightStatusDiv.style.height="0px"}};return f}();return k});
var JsDiff=function(){function l(d){for(var a=[],e=0;e<d.length;e++)d[e]&&a.push(d[e]);return a}function n(d){d=d.replace(/&/g,"\x26amp;");d=d.replace(/</g,"\x26lt;");d=d.replace(/>/g,"\x26gt;");return d=d.replace(/"/g,"\x26quot;")}var m=function(d){this.ignoreWhitespace=d};m.prototype={diff:function(d,a){if(a==d)return[{value:a}];if(!a)return[{value:d,removed:!0}];if(!d)return[{value:a,added:!0}];a=this.tokenize(a);d=this.tokenize(d);var e=a.length,b=d.length,g=e+b,f=[{newPos:-1,components:[]}],
h=this.extractCommon(f[0],a,d,0);if(f[0].newPos+1>=e&&h+1>=b)return f[0].components;for(var k=1;k<=g;k++)for(var l=-1*k;l<=k;l+=2){var m;m=f[l-1];var n=f[l+1],h=(n?n.newPos:0)-l;m&&(f[l-1]=void 0);var u=m&&m.newPos+1<e,w=n&&0<=h&&h<b;if(!u&&!w)f[l]=void 0;else{!u||w&&m.newPos<n.newPos?(m={newPos:n.newPos,components:n.components.slice(0)},this.pushComponent(m.components,d[h],void 0,!0)):(m={newPos:m.newPos,components:m.components.slice(0)},m.newPos++,this.pushComponent(m.components,a[m.newPos],!0,
void 0));h=this.extractCommon(m,a,d,l);if(m.newPos+1>=e&&h+1>=b)return m.components;f[l]=m}}},pushComponent:function(d,a,e,b){var g=d[d.length-1];g&&g.added===e&&g.removed===b?d[d.length-1]={value:this.join(g.value,a),added:e,removed:b}:d.push({value:a,added:e,removed:b})},extractCommon:function(d,a,e,b){var g=a.length,f=e.length,h=d.newPos;for(b=h-b;h+1<g&&b+1<f&&this.equals(a[h+1],e[b+1]);)h++,b++,this.pushComponent(d.components,a[h],void 0,void 0);d.newPos=h;return b},equals:function(d,a){var e=
/\S/;return this.ignoreWhitespace&&!e.test(d)&&!e.test(a)?!0:d==a},join:function(d,a){return d+a},tokenize:function(d){return d}};var k=new m,f=new m(!1);f.tokenize=function(d){return l(d.split(/(\s+|\b)/))};var h=new m(!0);h.tokenize=function(d){return l(d.split(/([{}:;,]|\s+)/))};var g=new m;g.tokenize=function(d){return d.split(/^/m)};return{diffChars:function(d,a){return k.diff(d,a)},diffWords:function(d,a){return f.diff(d,a)},diffLines:function(d,a){return g.diff(d,a)},diffCss:function(d,a){return h.diff(d,
a)},createPatch:function(d,a,e,b,f){var h=[];h.push("Index: "+d);h.push("\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d");h.push("--- "+d+"\t"+b);h.push("+++ "+d+"\t"+f);d=g.diff(a,e);d.push({value:"",lines:[]});e=a=0;b=[];for(var k=f=1,l=0;l<d.length;l++){var m=d[l],n=m.lines||
m.value.replace(/\n$/,"").split("\n");m.lines=n;if(m.added||m.removed){if(!a){var x=d[l-1];a=f;e=k;x&&(b.push.apply(b,x.lines.slice(-4).map(function(a){return" "+a})),a-=4,e-=4)}b.push.apply(b,n.map(function(a){return(m.added?"+":"-")+a}));m.added?k+=n.length:f+=n.length}else a&&(8>=n.length&&l<d.length-1?b.push.apply(b,n.map(function(a){return" "+a})):(x=Math.min(n.length,4),h.push("@@ -"+a+","+(f-a+x)+" +"+e+","+(k-e+x)+" @@"),h.push.apply(h,b),h.push.apply(h,n.slice(0,x).map(function(a){return" "+
a})),e=a=0,b=[])),f+=n.length,k+=n.length}1<d.length&&!/\n$/.test(d[d.length-2].value)&&h.push("\\ No newline at end of file\n");return h.join("\n")},convertChangesToXML:function(d){for(var a=[],e=0;e<d.length;e++){var b=d[e];b.added?a.push("\x3cins\x3e"):b.removed&&a.push("\x3cdel\x3e");a.push(n(b.value));b.added?a.push("\x3c/ins\x3e"):b.removed&&a.push("\x3c/del\x3e")}return a.join("")}}}();"undefined"!==typeof module&&(module.exports=JsDiff);
"function"===typeof define&&define.amd&&define("jsdiff/diff",[],function(){return JsDiff});
define("orion/compare/jsdiffAdapter",["jsdiff/diff"],function(l){var n=n||{};n.JSDiffAdapter=function(){function m(){}m.prototype={_specialLine:function(k,f,h){return f.value===k&&h!==k},adapt:function(k,f,h){h||(h="\n");var g=k.split(h),d=f.split(h),a=""===g[g.length-1],d=""===d[d.length-1],e=l.diffLines(k,f);k=[];f=[];for(var b=0,p=0,m=-1,n=0,s=!0,y=h,r=0;r<e.length;r++){var x=e[r],u=x.lines||x.value.split(h),w=u.length,z=0;1<u.length&&""===u[u.length-1]&&w--;1<w&&!s&&""===u[0]&&(w--,z++);x.lines=
u;if(!x.added&&!x.removed){if(!this._specialLine(h,x,y)){if(b||p)k.push([b,p,m]),p=b=0,m=-1,n+=p;k.push([w,w,0]);n+=w}}else if(x.added){-1===m&&(m=f.length+1);b+=w;for(s=z;s<w+z;s++)f.push(x.lines[s])}else p+=w;s=!1;1<u.length&&""===u[u.length-1]&&(s=!0);y=x.value?x.value[x.value.length-1]:h}if(b||p)k.push([b,p,m]),n+=p;n<g.length&&1<g.length&&(h=k[k.length-1],0===h[2]?(h[0]+=1,h[1]+=1):-1===h[2]?k.push([1,1,0]):a===d?k.push([1,1,0]):(d&&(h[0]+=1),a&&(h[1]+=1)));return{mapper:k,changContents:{array:f,
index:0}}},adaptCharDiff:function(k,f,h){k=h?l.diffWords(k,f):l.diffChars(k,f);f=[];for(var g=h=0,d=0,a=0,e=0;e<k.length;e++){var b=k[e];if(!b.added&&!b.removed){if(0<d||0<a)f.push([g,g+d,h,h+a]),g+=d,h+=a,a=d=0;g+=b.value.length;h+=b.value.length}else b.added?d+=b.value.length:a+=b.value.length}(0<d||0<a)&&f.push([g,g+d,h,h+a]);return f}};return m}();return n});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(l,n,m,k){var f={},h,g,d,a,e,b,p,q,t,s,y,r,x,u,w,z;f.DiffTreeNavigator=function(){function f(a,b,d,e,g,h){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,b,d,e,g,h)}h="orion.annotation.diff.addedBlock";g="orion.annotation.diff.currentAddedBlock";d="orion.annotation.diff.deletedBlock";a="orion.annotation.diff.currentDeletedBlock";
e="orion.annotation.diff.blockTop";b="orion.annotation.diff.currentBlockTop";p="orion.annotation.diff.blockConflict";q="orion.annotation.diff.currentBlockConflict";t="orion.annotation.diff.addedWord";s="orion.annotation.diff.currentAddedWord";y="orion.annotation.diff.deletedWord";r="orion.annotation.diff.currentDeletedWord";x="orion.annotation.diff.emptyDeletedWordLeft";u="orion.annotation.diff.emptyDeletedWordRight";w="orion.annotation.diff.emptyAddedWordLeft";z="orion.annotation.diff.emptyAddedWordRight";
m.AnnotationType.registerType(h,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});m.AnnotationType.registerType(g,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});m.AnnotationType.registerType(d,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});m.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});m.AnnotationType.registerType(e,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
m.AnnotationType.registerType(b,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});m.AnnotationType.registerType(p,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});m.AnnotationType.registerType(q,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});m.AnnotationType.registerType(t,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});m.AnnotationType.registerType(s,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});m.AnnotationType.registerType(y,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});m.AnnotationType.registerType(r,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});m.AnnotationType.registerType(x,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});m.AnnotationType.registerType(u,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
m.AnnotationType.registerType(w,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});m.AnnotationType.registerType(z,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});f.prototype={initAll:function(a,b,d,e,g,f,h){this._charOrWordDiff=a?a:"word";b&&(this._initialized=!0);this.editorWrapper=[{editor:b,diffFeeder:e},{editor:d,diffFeeder:g}];this._curveRuler=h;(this._overviewRuler=f)&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(a){if(a)for(var b=
0;b<this.editorWrapper.length;b++)this.editorWrapper[b].diffFeeder.init(this.editorWrapper[b].editor.getTextView().getModel(),a)},destroy:function(){this.initAll(this._charOrWordDiff)},renderAnnotations:function(){var a;for(a=0;a<this.editorWrapper.length;a++){this.editorWrapper[a].annoTypes=[];this.editorWrapper[a].diffFeeder.getBlockAnnoTypes(this.editorWrapper[a].annoTypes);this.editorWrapper[a].diffFeeder.getWordAnnoTypes(this.editorWrapper[a].annoTypes);for(var b=0;b<this.editorWrapper[a].annoTypes.length;b++)this.editorWrapper[a].annoTypes[b].current&&
this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].current),this.editorWrapper[a].annoTypes[b].normal&&this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].normal)}this._root.children=[];b=this.editorWrapper[0].diffFeeder.getDiffBlocks();if(!b||0===b.length)this.replaceAllAnnotations(!0,0,"block",!1,[]),this.replaceAllAnnotations(!0,1,"block",!1,[]),this.replaceAllAnnotations(!0,0,"word",!1,[]),
this.replaceAllAnnotations(!0,1,"word",!1,[]),this.replaceAllAnnotations(!0,0,"block",!0,[]),this.replaceAllAnnotations(!0,1,"block",!0,[]),this.replaceAllAnnotations(!0,0,"word",!0,[]),this.replaceAllAnnotations(!0,1,"word",!0,[]);else{var d=new k.JSDiffAdapter;for(a=0;a<b.length;a++){var e=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(e);var g=this.generatePairWordAnnotations(e,a,d);g&&(e.children=g)}this.replaceAllAnnotations(!1,0,"block",!0);this.replaceAllAnnotations(!1,
1,"block",!0);this.replaceAllAnnotations(!1,0,"word",!0);this.replaceAllAnnotations(!1,1,"word",!0);this.iterator=new l.TreeModelIterator(this._root.children)}},replaceAllAnnotations:function(a,b,d,e,g){if(this.editorWrapper[b].annoTypes)for(var f=0;f<this.editorWrapper[b].annoTypes.length;f++)this.editorWrapper[b].annoTypes[f].type===d&&this.replaceDiffAnnotations(this.editorWrapper[b].editor,g?g:this.editorWrapper[b].annoTypes[f].list,e?this.editorWrapper[b].annoTypes[f].normal:this.editorWrapper[b].annoTypes[f].current,
a)},getMapper:function(){return this.editorWrapper[0].diffFeeder.getMapper()},getFeeder:function(a){return a?this.editorWrapper[1].diffFeeder:this.editorWrapper[0].diffFeeder},iterateOnBlock:function(a,b){this.iterator&&(this.iterator.iterateOnTop(a,b),this.updateCurrentAnnotation(!0))},iterateOnChange:function(a){if(!this.iterator)return null;var b=this.iterator.iterate(a);if(b){var d=this.iterator.cursor();"block"===d.type&&(d.children&&0<d.children.length)&&this.iterator.iterate(a);this.updateCurrentAnnotation(!0)}return b},
gotoBlock:function(a,b){if(this.iterator){if(0>a||a>=this._root.children.length||0===this._root.children.length)a=0;void 0!==b&&0<=b&&this._root.children[a].children&&b<this._root.children[a].children.length?this.iterator.setCursor(this._root.children[a].children[b]):this.iterator.setCursor(this._root.children[a]);this.updateCurrentAnnotation(!1);this._positionDiffBlock()}},_hitDiffAnnotation:function(a,b,d){if(d===this.editorWrapper[a].editor.getTextView()){for(var e=0;e<this._root.children.length;e++){d=
this._root.children[e];var g=0===a?d.oldA:d.newA;if(b>=g.start&&b<=g.end){e=d;if(d.children&&0<d.children.length)for(g=0;g<d.children.length;g++){var f=d.children[g],h=0===a?f.oldA:f.newA;if(b>=h.start&&b<=h.end){e=f;break}}return e}}return null}},gotoChange:function(a,b){for(var d=0;d<this.editorWrapper.length;d++){var e=this._hitDiffAnnotation(d,a,b);if(e)return this.iterator.setCursor(e),this.updateCurrentAnnotation(!1,b),!0}return!1},getCurrentBlockIndex:function(){if(!this.iterator)return-1;
var a=this.iterator.cursor();return!a?-1:"block"===a.type?a.index:a.parent.index},getCurrentPosition:function(){if(!this.iterator)return{};var a=this.iterator.cursor();return"block"===a.type?{block:a.index+1}:{block:a.parent.index+1,change:a.index+1}},getCurrentMapperIndex:function(){var a=this.getCurrentBlockIndex();0>a&&(a=0);var b=this.getFeeder().getDiffBlocks();if(!b||0===b.length)return-1;a>b.length-1&&(a=0);return b[a][1]},replaceDiffAnnotations:function(a,b,d,e){if(b&&d&&(a=a.getAnnotationModel())){for(var g=
a.getAnnotations(),f=[];e&&g.hasNext();){var h=g.next();h.type===d&&f.push(h)}a.replaceAnnotations(f,b)}},updateCurrentAnnotation:function(a,b){this.replaceAllAnnotations(!0,0,"block",!1,[]);this.replaceAllAnnotations(!0,1,"block",!1,[]);this.replaceAllAnnotations(!0,0,"word",!1,[]);this.replaceAllAnnotations(!0,1,"word",!1,[]);if(this.iterator){var d=this.iterator.cursor();if(d){var e,g,f={start:d.oldA.start,end:d.oldA.end},h={start:d.newA.start,end:d.newA.end};"word"===d.type?(e=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(f,
this.editorWrapper[0].editor.getTextView().getModel()),g=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(h,this.editorWrapper[1].editor.getTextView().getModel())):(e=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(d.index),g=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(d.index));e&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (m.AnnotationType.getType(e.current))(f.start,f.end)],e,!0);g&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (m.AnnotationType.getType(g.current))(h.start,
h.end)],g,!0);a?(this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(d.oldA.start,d.oldA.end,!0),this.editorWrapper[1].editor.setSelection(d.newA.start,d.newA.end,!0),this.autoSelecting=!1):b&&(this.autoSelecting=!0,b!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(d.oldA.start,d.oldA.end,!0),b!==this.editorWrapper[1].editor.getTextView()&&this.editorWrapper[1].editor.setSelection(d.newA.start,d.newA.end,!0),this.autoSelecting=!1)}}},generatePairBlockAnnotations:function(a,
b){var d=this.generateBlockDiffAnnotations(0,b),e=this.generateBlockDiffAnnotations(1,b);return{parent:a,index:b,type:"block",oldA:d,newA:e}},generatePairWordAnnotations:function(a,b,d){var e=this.editorWrapper[0].diffFeeder.getTextOnBlock(b),g=this.editorWrapper[1].diffFeeder.getTextOnBlock(b);b=null;var f=0,h=0;if(e&&g&&e.text&&g.text&&5E3>=e.text.length&&5E3>=g.text.length)b=d.adaptCharDiff(e.text,g.text,"word"===this._charOrWordDiff),h=g.start,f=e.start;else return null;d=[];e=[];this.generateWordDiffAnnotations(0,
d,f,b,2,3);this.generateWordDiffAnnotations(1,e,h,b,0,1);b=[];for(f=0;f<d.length;f++)b.push({parent:a,index:f,type:"word",oldA:d[f],newA:e[f]});return b},getAnnoModelList:function(a,b,d){for(var e=0;e<this.editorWrapper[a].annoTypes.length;e++)if(this.editorWrapper[a].annoTypes[e].type===b&&this.editorWrapper[a].annoTypes[e].normal===d)return this.editorWrapper[a].annoTypes[e].list;return null},generateBlockDiffAnnotations:function(a,b){var d=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(b),
e=this.getAnnoModelList(a,"block",d.normal),g=this.editorWrapper[a].diffFeeder.getCharRange(b),d=m.AnnotationType.createAnnotation(d.normal,g.start,g.end);e&&e.push(d);return d},generateWordDiffAnnotations:function(a,b,d,e,g,f){if(e){var h=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1});a=this.getAnnoModelList(a,"word",h.normal);for(var k=0;k<e.length;k++){var l=m.AnnotationType.createAnnotation(h.normal,e[k][g]+d,e[k][f]+d);a.push(l);b.push(l)}}},_updateOverviewRuler:function(){if(this._overviewRuler){var a=
this.editorWrapper[0].editor.getTextView().getTopIndex();this.editorWrapper[0].editor.getTextView().redrawLines(a,a+1,this._overviewRuler)}},_updateCurveRuler:function(){this._curveRuler&&this._curveRuler.render()},_setTextViewPosition:function(a,b){var d=a.getLineHeight(),e=a.getClientArea(),d=Math.floor(e.height/d/3);a.setTopIndex(0<b-d?b-d:0)},_positionDiffBlock:function(){var a=this.getCurrentBlockIndex();0>a&&(a=0);var b=this.getFeeder().getDiffBlocks();0!==b.length&&(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),
b[a][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor&&(a=n.lookUpLineIndex(this.getMapper(),0,b[a][1]),this._setTextViewPosition(this.editorWrapper[1].editor.getTextView(),a)),this._updateOverviewRuler(),this._updateCurveRuler())},matchPositionFromOverview:function(a){this._initialized&&(a=0>a?0:n.getAnnotationIndex(this.getFeeder().getDiffBlocks(),a),this.gotoBlock(a))},gotoDiff:function(a,b){this.gotoChange(a,b)&&(this._updateOverviewRuler(),this._updateCurveRuler())},nextDiff:function(){this.iterateOnBlock(!0,
!0);this._positionDiffBlock()},prevDiff:function(){this.iterateOnBlock(!1,!0);this._positionDiffBlock()},nextChange:function(){var a=this.iterateOnChange(!0);this._positionDiffBlock();return a},prevChange:function(){this.iterateOnChange(!1);this._positionDiffBlock()}};return f}();f.DiffBlockFeeder=function(){function a(){}a.prototype={_isAddedSide:function(){return 0===this._mapperColumnIndex},getWordAnnoTypes:function(a){this._isAddedSide()?a.push({type:"word",current:s,normal:t,list:[]}):a.push({type:"word",
current:r,normal:y,list:[]});a.push({type:"word",current:x});a.push({type:"word",current:u});a.push({type:"word",current:w});a.push({type:"word",current:z})},getCurrentWordAnnoType:function(a,b){return a.start===a.end&&b?this._isAddedSide()?{current:this._repositionEmptyWord(a,b),normal:t}:{current:this._repositionEmptyWord(a,b),normal:y}:this._isAddedSide()?{current:s,normal:t}:{current:r,normal:y}},_repositionEmptyWord:function(a,b){var d=b.getLineAtOffset(a.start),e=b.getLineStart(d),g=b.getLineEnd(d);
if(e!==g){if(a.start===g)return a.start--,this._isAddedSide()?z:u;a.end++}else if(0<d&&(d--,e=b.getLineStart(d),g=b.getLineEnd(d),e!==g))return a.start=g-1,a.end=g,this._isAddedSide()?z:u;return this._isAddedSide()?w:x},getMapper:function(){return this._mapper},getDiffBlocks:function(){return this._diffBlocks},getDiffBlockH:function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return-1;a=this._diffBlocks[a][1];return-1===a?0:this._mapper[a][this._mapperColumnIndex]},getOverviewLineCount:function(){return this._textModel.getLineCount()},
getLineNumber:function(a){return a},getCharRange:function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return null;var b=this._diffBlocks[a][0],d=b+this._mapper[this._diffBlocks[a][1]][this._mapperColumnIndex]-1;a=this._textModel.getLineStart(b);if(d<b)return{start:a,end:a};b=this._textModel.getLineEnd(d,!0);return{start:a,end:b}},getTextOnBlock:function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return null;a=this.getCharRange(a);return{start:a.start,text:this._textModel.getText(a.start,
a.end)}},isMapperEmpty:function(){return 0===this._mapper.length}};return a}();f.TwoWayDiffBlockFeeder=function(){function k(a,b,d,e){this._mapperColumnIndex=d;this._reverseAnnotation=e;this.init(a,b)}k.prototype=new f.DiffBlockFeeder;k.prototype._isAddedSide=function(){return this._reverseAnnotation?0!==this._mapperColumnIndex:0===this._mapperColumnIndex};k.prototype.init=function(a,b){this._textModel=a;this._diffBlocks=void 0;if(b){this._mapper=b;this._diffBlocks=[];for(var d=0,e=0;e<this._mapper.length;e++)0!==
this._mapper[e][2]&&this._diffBlocks.push([d,e]),d+=this._mapper[e][this._mapperColumnIndex]}};k.prototype.getBlockAnnoTypes=function(f){this._isAddedSide()?f.push({type:"block",normal:h,current:g,list:[]}):f.push({type:"block",normal:d,current:a,list:[]});f.push({type:"block",normal:e,current:b,list:[]});f.push({type:"block",normal:p,current:q,list:[]})};k.prototype.getCurrentBlockAnnoType=function(f){if(!this._diffBlocks||0===this._diffBlocks.length||this._diffBlocks.length<=f)return null;f=this._diffBlocks[f][1];
return 0===this._mapper[f][this._mapperColumnIndex]?{normal:e,current:b}:n.isMapperConflict(this.getMapper(),f)?{normal:p,current:q}:this._isAddedSide()?{type:"block",normal:h,current:g,list:[]}:{type:"block",normal:d,current:a,list:[]}};return k}();f.inlineDiffBlockFeeder=function(){function b(a,d){this._mapperColumnIndex=d;this.init(a)}b.prototype=new f.DiffBlockFeeder;b.prototype.setModel=function(a){this._textModel=a};b.prototype.init=function(a){this._diffBlocks=void 0;if(a){this._mapper=a;this._diffBlocks=
[];this._gapBlocks=[];for(var b=a=0,d=0;d<this._mapper.length;d++){if(0!==this._mapper[d][2]){if(this._isAddedSide()){var e=a+this._mapper[d][1];this._diffBlocks.push([e,d]);this._gapBlocks.push([e,e+this._mapper[d][0],b])}else this._diffBlocks.push([a,d]),this._gapBlocks.push([a,a+this._mapper[d][1],b]);a+=this._mapper[d][0]+this._mapper[d][1]}else this._gapBlocks.push([a,a+this._mapper[d][this._mapperColumnIndex],b]),a+=this._mapper[d][this._mapperColumnIndex];b+=this._mapper[d][this._mapperColumnIndex]}}};
b.prototype.getBlockAnnoTypes=function(b){this._isAddedSide()?b.push({type:"block",normal:h,current:g,list:[]}):b.push({type:"block",normal:d,current:a,list:[]});b.push({type:"block",normal:p,current:q,list:[]})};b.prototype.getCurrentBlockAnnoType=function(b){if(!this._diffBlocks||0===this._diffBlocks.length)return null;b=this._diffBlocks[b][1];return 0===this._mapper[b][this._mapperColumnIndex]?{current:s,normal:t}:n.isMapperConflict(this.getMapper(),b)?{normal:p,current:q}:this._isAddedSide()?
{type:"block",normal:h,current:g,list:[]}:{type:"block",normal:d,current:a,list:[]}};b.prototype.getDiffBlockH=function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return-1;a=this._diffBlocks[a][1];return this._mapper[a][0]+this._mapper[a][1]};b.prototype.getLineNumber=function(a){for(var b=0;b<this._gapBlocks.length;b++)if(this._gapBlocks[b][0]!==this._gapBlocks[b][1]&&a>=this._gapBlocks[b][0]&&a<this._gapBlocks[b][1])return a-this._gapBlocks[b][0]+this._gapBlocks[b][2];return-1};return b}();
return f});
define("orion/compare/compareView","i18n!orion/compare/nls/messages orion/Deferred orion/webui/littlelib orion/compare/diffParser orion/compare/compareRulers orion/editor/editor orion/editor/editorFeatures orion/keyBinding orion/editor/textView orion/compare/compareUIFactory orion/compare/compareUtils orion/compare/jsdiffAdapter orion/compare/diffTreeNavigator".split(" "),function(l,n,m,k,f,h,g,d,a,e,b,p,q,t,s,y){var r={};r.CompareView=function(){function a(){this._diffParser=new k.DiffParser}a.prototype=
{_clearOptions:function(){this.options={};this.options.blockNumber=1;this.options.changeNumber=0},_getLineDelim:function(a,b){return"\n"},_generateMapper:function(a,b,d,e,g){var f=this._getLineDelim(a,d);this._diffParser.setLineDelim(f);if(this.options.mapper&&this.options.toggler)return{delim:f,mapper:this.options.mapper,output:this.options.newFile.Content,diffArray:this.options.diffArray};if("string"===typeof b&&"string"===typeof a)return a=(new p.JSDiffAdapter).adapt(a,b,f),this.options.toggler&&
(this.options.mapper=a.mapper,this.options.newFile.Content=b,this.options.diffArray=a.changContents),{delim:f,mapper:a.mapper,output:b,diffArray:a.changContents};b=this._diffParser.parse(a,d,e,g);a=this._diffParser.getDiffArray();this.options.toggler&&(this.options.mapper=b.mapper,this.options.newFile.Content=b.outPutFile,this.options.diffArray=a);return{delim:f,mapper:b.mapper,output:b.outPutFile,diffArray:a}},_loadImageFile:function(a,b,d){var e=document.createElement("img");e.src=a;var g=new n;
e.onload=function(){b.appendChild(e);if(d){var a=document.createElement("hr");b.appendChild(a)}g.resolve(e.height)};e.onerror=function(){g.resolve(0)};return g},_initSyntaxHighlighter:function(a){this._syntaxHighlighters=null;if(this.options.highlighters&&0<this.options.highlighters.length&&!(1>a.length||2<a.length))this._syntaxHighlighters=[{highlighter:this.options.highlighters[0],target:a[0]}],2===a.length&&2===this.options.highlighters.length&&this._syntaxHighlighters.push({highlighter:this.options.highlighters[1],
target:a[1]})},_highlightSyntax:function(){if(this._syntaxHighlighters){var a=[];this._syntaxHighlighters.forEach(function(b){a.push(b.highlighter.highlight(b.target.fileName,b.target.contentType,b.target.editor))}.bind(this));n.all(a,function(a){return{_error:a}}).then(function(a){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this))}else window.setTimeout(function(){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-
1,this.options.changeNumber-1)}.bind(this),50)},setOptions:function(a,b){b&&this._clearOptions();this.options||(this.options={});a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this));if(a.newFileOnRight){var d=this.options.newFile;this.options.newFile=this.options.oldFile;this.options.oldFile=d}},getOptions:function(){return this.options},getCurrentDiffPos:function(){return this._diffNavigator.getCurrentPosition()},initDiffNav:function(){this._diffNavigator.gotoBlock(0,0)},nextDiff:function(){this._diffNavigator.nextDiff()},
prevDiff:function(){this._diffNavigator.prevDiff()},nextChange:function(){return this._diffNavigator.nextChange()},prevChange:function(){this._diffNavigator.prevChange()},getWidget:function(){return this},startup:function(){this.initEditors();this.refresh(!0)},initEditors:function(a){},initImageMode:function(){}};return a}();r.TwoWayCompareView=function(){function b(a){this.setOptions(a,!0);this._diffNavigator=new q.DiffTreeNavigator("word");this.type="twoWay";this._uiFactory=this.options.uiFactory;
this._uiFactory||(this._uiFactory=new e.TwoWayCompareUIFactory({parentDivID:this.options.parentDivId,showTitle:this.options.showTitle?this.options.showTitle:!1,showLineStatus:this.options.showLineStatus?this.options.showLineStatus:!1}),this._uiFactory.buildUI());this._viewLoadedCounter=0;this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._curveRuler=new f.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}b.prototype=new r.CompareView;b.prototype.initEditors=function(a){this._editors=
[];this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!1),this._uiFactory.getStatusDiv(!1),this.options.oldFile));this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!0),this._uiFactory.getStatusDiv(!0),this.options.newFile,!0));this._overviewRuler=new f.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a,b){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));window.onbeforeunload=function(){if(this._editors&&this._editors.some(function(a){return a.isDirty()}))return l["There are unsaved changes."]}.bind(this)};
b.prototype.initImageMode=function(){this._editors&&(this._editors.forEach(function(a){a.destroy()}),this._editors=null);this._uiFactory.getEditorParentDiv(!0).classList.add("compareEditorParentImageMode");this._uiFactory.getEditorParentDiv().classList.add("compareEditorParentImageMode");this._uiFactory.disableTitle();this._uiFactory.disableLineStatus();this._imageMode=!0};b.prototype.getImageMode=function(){return this._imageMode};b.prototype.getEditors=function(){return this._editors};b.prototype.gotoDiff=
function(a,b,d){d=d?this._editors[1].getTextView():this._editors[0].getTextView();a=d.getModel().getLineStart(a)+b;this._diffNavigator.gotoDiff(a,d)};b.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)};b.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)};b.prototype.resizeEditors=function(){this._editors.forEach(function(a){a.getTextView().resize()})};b.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};b.prototype._createEditor=function(b,d,e,f,k){var p=
"undefined"===typeof f.readonly?!0:f.readonly,m=function(){var b=new a.TextView({parent:d,readonly:p,tabSize:4});this._viewLoadedCounter++;2===this._viewLoadedCounter&&this._diffNavigator.matchPositionFromOverview(-1);if(this.onLoad)this.onLoad();var e=this.getSplitter();e&&e.addResizeListener(function(a){if(a){var d=!1;(d=this._uiFactory.isLeftPane(a)?k:!k)&&b.resize()}}.bind(this));return b}.bind(this),n=f.keyBindingFactory;n||(n=new g.KeyBindingsFactory);var q=null;if(e)var t="",q=function(a,b){e&&
(t=b?l["ERROR: "]+a:a,e.textContent=""+t)};m=new h.Editor({textViewFactory:m,undoStackFactory:new g.UndoFactory,annotationFactory:new g.AnnotationFactory,keyBindingFactory:n,statusReporter:q,domNode:d});m.installTextView();m.setInput(null,null,f.Content?f.Content:b);m.setOverviewRulerVisible(!1);var s=m.getTextView();s.addEventListener("Selection",function(a){!(a.newValue&&a.newValue.start!==a.newValue.end)&&(!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder)&&(a=
s.getCaretOffset(),this._diffNavigator.gotoDiff(a,s))}.bind(this));s.getModel().addEventListener("Changed",function(a){this._curveRuler.onChanged(a,!k)||(this.options.mapper=null)}.bind(this));k?s.addEventListener("Scroll",function(a){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render());if(this.onScroll)this.onScroll()}.bind(this)):s.addEventListener("Scroll",function(a){this._curveRuler&&this._curveRuler.render()}.bind(this));return m};b.prototype.destroy=function(){this._editors&&
(this._diffNavigator.destroy(),this._editors.forEach(function(a){a.destroy()}),this._uiFactory.destroy())};b.prototype.addRulers=function(){if(this._editors&&!this._hasRuler){var a=new f.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),b=new f.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._editors[1].getTextView().addRuler(a);
this._editors[0].getTextView().addRuler(b);this._editors[0].getTextView().addRuler(this._overviewRuler);this._hasRuler=!0}};b.prototype.refresh=function(a){if(this._imageMode){this.options.commandProvider&&this.options.commandProvider.renderCommands(this);var b=this;return this._loadImageFile(this.options.newFile.URL,this._uiFactory.getEditorParentDiv(!0)).then(function(a){return b._loadImageFile(b.options.oldFile.URL,b._uiFactory.getEditorParentDiv()).then(function(b){return(new n).resolve(a>b?a:
b)})})}var d=this.options.oldFile.Content,e=this.options.newFile.Content,g=this.options.diffContent;"string"===typeof e?g=this._generateMapper(d,e,g,this.options.hasConflicts):(g=this._generateMapper(d,e,g,this.options.hasConflicts),e=g.output);var f=new q.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),g.mapper,1,this.options.newFileOnRight),h=new q.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),g.mapper,0,this.options.newFileOnRight);this._diffNavigator.initAll(this.options.charDiff?
"char":"word",this._editors[0],this._editors[1],f,h,this._overviewRuler,this._curveRuler);this._curveRuler.init(g.mapper,this._editors[1],this._editors[0],this._diffNavigator);a&&(this._editors[1].setInput(this.options.newFile.Name,null,e),this._editors[0].setInput(this.options.oldFile.Name,null,d));this._initSyntaxHighlighter([{fileName:this.options.newFile.Name,contentType:this.options.newFile.Type,editor:this._editors[1]},{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,
editor:this._editors[0]}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();2===this._viewLoadedCounter&&this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);this.refreshTitle(0);this.refreshTitle(1);a=this._editors[1].getTextView().getModel().getLineCount()*this._editors[1].getTextView().getLineHeight()+5;d=this._editors[0].getTextView().getModel().getLineCount()*this._editors[0].getTextView().getLineHeight()+
5;return a>d?a:d};b.prototype.refreshTitle=function(a,b){if(1===a){var d=this._uiFactory.getTitleDiv(!0);d&&(m.empty(d),d.appendChild(document.createTextNode(b||this._editors[a].isDirty()?this.options.newFile.Name+"*":this.options.newFile.Name)))}else if(d=this._uiFactory.getTitleDiv(!1))m.empty(d),d.appendChild(document.createTextNode(b||this._editors[a].isDirty()?this.options.oldFile.Name+"*":this.options.oldFile.Name))};return b}();r.InlineCompareView=function(){function d(a){this.setOptions(a,
!0);this._diffNavigator=new q.DiffTreeNavigator("word");this.type="inline";this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._editorDiv=this.options.parentDivId}d.prototype=new r.CompareView;d.prototype.addRulers=function(){this._textView&&!this._hasRuler&&(this._textView.addRuler(this._rulerOrigin),this._textView.addRuler(this._rulerNew),this._textView.addRuler(this._overviewRuler),this._hasRuler=!0)};d.prototype.removeRulers=function(){this._textView&&this._hasRuler&&
(this._textView.removeRuler(this._rulerOrigin),this._textView.removeRuler(this._rulerNew),this._textView.removeRuler(this._overviewRuler),this._hasRuler=!1)};d.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.setText(""),this.removeRulers())};d.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};d.prototype.initEditors=function(b){var d=m.node(this._editorDiv),e=function(){return new a.TextView({parent:d,
readonly:!0,tabSize:4})}.bind(this);this._editor=new h.Editor({textViewFactory:e,undoStackFactory:new g.UndoFactory,annotationFactory:new g.AnnotationFactory,domNode:d});this._editor.installTextView();this._editor.setInput(null,null,b);this._editor.setOverviewRulerVisible(!1);this._editor.setAnnotationRulerVisible(!1);this._textView=this._editor.getTextView();this._rulerOrigin=new f.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines inlineRulerLeft"},{styleClass:"rulerLines odd"},
{styleClass:"rulerLines even"});this._rulerNew=new f.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._overviewRuler=new f.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a,b){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));this._textView.addEventListener("Selection",function(a){!(a.newValue&&a.newValue.start!==a.newValue.end)&&(!this._diffNavigator.autoSelecting&&
this._diffNavigator.editorWrapper[0].diffFeeder)&&(a=this._textView.getCaretOffset(),this._diffNavigator.gotoDiff(a,this._textView))}.bind(this))};d.prototype.initImageMode=function(){this._editor&&(this._editor.destroy(),this._editor=null);m.node(this._editorDiv).classList.add("compareEditorParentImageMode");this._imageMode=!0};d.prototype.getImageMode=function(){return this._imageMode};d.prototype._initDiffPosition=function(a){var b=a.getModel();if(b&&b.getAnnotations&&(b=b.getAnnotations(),0<b.length)){var b=
b[0][0],d=a.getLineHeight(),e=a.getClientArea(),d=Math.floor(e.height/d/3);a.setTopIndex(0<b-d?b-d:0)}};d.prototype.refresh=function(){if(this._imageMode){this.options.commandProvider&&this.options.commandProvider.renderCommands(this);var a=this;return this._loadImageFile(this.options.newFile.URL,m.node(this._editorDiv),!0).then(function(b){return a._loadImageFile(a.options.oldFile.URL,m.node(a._editorDiv)).then(function(a){return(new n).resolve(b+a+20)})})}var d=this.options.oldFile.Content,e=this.options.newFile.Content,
g=this._generateMapper(d,e,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);"string"!==typeof e&&(e=g.output);this._textView.getModel().setText(d);d=new q.inlineDiffBlockFeeder(g.mapper,1);e=new q.inlineDiffBlockFeeder(g.mapper,0);b.mergeDiffBlocks(this._textView.getModel(),e.getDiffBlocks(),g.mapper,g.diffArray.array,g.diffArray.index,this._diffParser._lineDelimiter);d.setModel(this._textView.getModel());e.setModel(this._textView.getModel());this._diffNavigator.initAll(this.options.charDiff?
"char":"word",this._editor,this._editor,d,e,this._overviewRuler);this._initSyntaxHighlighter([{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editor}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();g=this._textView.getTopIndex();this._textView.redrawLines(g,g+1,this._overviewRuler);this._textView.redrawLines(g,g+1,this._rulerOrigin);this._textView.redrawLines(g,g+1,this._rulerNew);this._diffNavigator.gotoBlock(this.options.blockNumber-
1,this.options.changeNumber-1);return this._textView.getLineHeight()*this._textView.getModel().getLineCount()+5};d.prototype.setConflicting=function(a){this._conflcit=a};return d}();r.toggleableCompareView=function(){function a(b,d){d&&(d.toggler=this);this._widget="inline"===b?new r.InlineCompareView(d):new r.TwoWayCompareView(d)}a.prototype={startup:function(){this._widget.startup()},initImageMode:function(){this._imageMode=!0;this._widget.initImageMode()},toggle:function(){var a=this._widget.options;
if(!this._imageMode){var b=this._widget.getCurrentDiffPos();a.blockNumber=b.block;a.changeNumber=b.change}this._widget.destroy();m.empty(m.node(a.parentDivId));this._widget="inline"===this._widget.type?new r.TwoWayCompareView(a):new r.InlineCompareView(a);this._imageMode?this._widget.initImageMode():this._widget.initEditors();this._widget.refresh(!0)},getWidget:function(){return this._widget}};return a}();return r});
define("orion/editor/stylers/lib/syntax",[],function(){return{id:"orion.lib",grammars:[{id:"orion.lib",repository:{brace_open:{match:"{",name:"punctuation.section.block.begin"},brace_close:{match:"}",name:"punctuation.section.block.end"},bracket_open:{match:"\\[",name:"punctuation.section.bracket.begin"},bracket_close:{match:"\\]",name:"punctuation.section.bracket.end"},parenthesis_open:{match:"\\(",name:"punctuation.section.parens.begin"},parenthesis_close:{match:"\\)",name:"punctuation.section.parens.end"},
doc_block:{begin:{match:"/\\*\\*",literal:"/**"},end:{match:"\\*/",literal:"*/"},name:"comment.block.documentation",patterns:[{match:"@(?:(?!\\*/)\\S)*",name:"keyword.other.documentation.tag"},{match:"\\\x3c\\S*\\\x3e",name:"keyword.other.documentation.markup"},{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},number_decimal:{match:"\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?\\b",name:"constant.numeric.number"},
number_hex:{match:"\\b0[xX][0-9A-Fa-f]+\\b",name:"constant.numeric.hex"},string_doubleQuote:{match:'"(?:\\\\.|[^"])*"?',name:"string.quoted.double"},string_singleQuote:{match:"'(?:\\\\.|[^'])*'?",name:"string.quoted.single"},todo_comment_singleLine:{match:"(\\b)(TODO)(\\b)(.*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}}},{id:"orion.c-like",repository:{comment_singleLine:{match:{match:"//.*",literal:"//"},name:"comment.line.double-slash",
patterns:[{include:"orion.lib#todo_comment_singleLine"}]},comment_block:{begin:{match:"/\\*",literal:"/*"},end:{match:"\\*/",literal:"*/"},name:"comment.block",patterns:[{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]}}}],keywords:[]}});
define("orion/editor/stylers/application_javascript/syntax",["orion/editor/stylers/lib/syntax"],function(l){var n="break case class catch continue const debugger default delete do else enum export extends false finally for function if implements import in instanceof interface let new null package private protected public return static super switch this throw true try typeof undefined var void while with yield".split(" ");l=l.grammars;l.push({id:"orion.js",contentTypes:["application/javascript"],patterns:[{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",
end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.js"},{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.js"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{match:"/(?![\\s\\*])(?:\\\\.|[^/])+/(?:[gim]{0,3})",name:"string.regexp.js"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},
{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+n.join("|")+")\\b",name:"keyword.control.js"}]});return{id:l[l.length-1].id,grammars:l,keywords:n}});
define("orion/editor/stylers/text_x-java-source/syntax",["orion/editor/stylers/lib/syntax"],function(l){var n="abstract boolean break byte case catch char class continue default do double else extends false final finally float for if implements import instanceof int interface long native new null package private protected public return short static super switch synchronized this throw throws transient true try void volatile while".split(" ");l=l.grammars;l.push({id:"orion.java",contentTypes:["text/x-java-source"],
patterns:[{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+
n.join("|")+")\\b",name:"keyword.control.java"}]});return{id:l[l.length-1].id,grammars:l,keywords:n}});
define("orion/editor/stylers/text_css/syntax",["orion/editor/stylers/lib/syntax"],function(l){var n="alignment-adjust alignment-baseline animation-delay animation-direction animation-duration animation-iteration-count animation-name animation-play-state animation-timing-function animation appearance azimuth backface-visibility background-attachment background-clip background-color background-image background-origin background-position background-repeat background-size background baseline-shift binding bleed bookmark-label bookmark-level bookmark-state bookmark-target border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-bottom border-collapse border-color border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-image border-left-color border-left-style border-left-width border-left border-radius border-right-color border-right-style border-right-width border-right border-spacing border-style border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-top border-width border bottom box-align box-decoration-break box-direction box-flex-group box-flex box-lines box-ordinal-group box-orient box-pack box-shadow box-sizing break-after break-before break-inside caption-side clear clip color-profile color column-count column-fill column-gap column-rule-color column-rule-style column-rule-width column-rule column-span column-width columns content counter-increment counter-reset crop cue-after cue-before cue cursor direction display dominant-baseline drop-initial-after-adjust drop-initial-after-align drop-initial-before-adjust drop-initial-before-align drop-initial-size drop-initial-value elevation empty-cells fit-position fit flex-align flex-flow flex-inline-pack flex-order flex-pack float-offset float font-family font-size font-size-adjust font-stretch font-style font-variant font-weight font grid-columns grid-rows hanging-punctuation height hyphenate-after hyphenate-before hyphenate-character hyphenate-lines hyphenate-resource hyphens icon image-orientation image-rendering image-resolution inline-box-align left letter-spacing line-height line-stacking-ruby line-stacking-shift line-stacking-strategy line-stacking list-style-image list-style-position list-style-type list-style margin-bottom margin-left margin-right margin-top margin mark-after mark-before mark marker-offset marks marquee-direction marquee-loop marquee-play-count marquee-speed marquee-style max-height max-width min-height min-width move-to nav-down nav-index nav-left nav-right nav-up opacity orphans outline-color outline-offset outline-style outline-width outline overflow-style overflow-x overflow-y overflow padding-bottom padding-left padding-right padding-top padding page-break-after page-break-before page-break-inside page-policy page pause-after pause-before pause perspective-origin perspective phonemes pitch-range pitch play-during position presentation-level punctuation-trim quotes rendering-intent resize rest-after rest-before rest richness right rotation-point rotation ruby-align ruby-overhang ruby-position ruby-span size speak-header speak-numeral speak-punctuation speak speech-rate stress string-set table-layout target-name target-new target-position target text-align-last text-align text-decoration text-emphasis text-height text-indent text-justify text-outline text-shadow text-transform text-wrap top transform-origin transform-style transform transition-delay transition-duration transition-property transition-timing-function transition unicode-bidi vertical-align visibility voice-balance voice-duration voice-family voice-pitch-range voice-pitch voice-rate voice-stress voice-volume volume white-space-collapse white-space widows width word-break word-spacing word-wrap z-index".split(" ");l=
l.grammars;l.push({id:"orion.css",contentTypes:["text/css"],patterns:[{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.css"},{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.css"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},
{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"#number_hex"},{match:"(?i)\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:%|em|ex|ch|rem|vw|vh|vmin|vmax|in|cm|mm|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?\\b",name:"constant.numeric.value.css"},{match:"(?:-webkit-|-moz-|-ms-|-o-|\\b)(?:"+n.join("|")+")\\b",name:"keyword.control.css"}],repository:{number_hex:{match:"#[0-9A-Fa-f]+\\b",name:"constant.numeric.hex.css"}}});
return{id:l[l.length-1].id,grammars:l,keywords:n}});
define("examples/editor/textStyler",["orion/editor/annotations","orion/editor/stylers/application_javascript/syntax","orion/editor/stylers/text_x-java-source/syntax","orion/editor/stylers/text_css/syntax"],function(l,n,m,k){function f(a,b){this.keywords=a;this.whitespacesVisible=b;this.setText("")}function h(){f.call(this,null,!0)}function g(a){f.call(this,null,a)}function d(){f.call(this,null,!1)}function a(a,k,l){this.commentStart="/*";this.commentEnd="*/";var m=[];switch(k){case "java":m=b;break;
case "js":m=e;break;case "css":m=p}this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=!0;this._scanner=new f(m,this.whitespacesVisible);this._firstScanner=new d;this._commentScanner=new g(this.whitespacesVisible);this._whitespaceScanner=new h;"css"===k&&(this._scanner.isCSS=!0,this._firstScanner.isCSS=!0);this.view=a;this.annotationModel=l;this._bracketAnnotations=void 0;var n=this;this._listener=
{onChanged:function(a){n._onModelChanged(a)},onDestroy:function(a){n._onDestroy(a)},onLineStyle:function(a){n._onLineStyle(a)},onMouseDown:function(a){n._onMouseDown(a)},onSelection:function(a){n._onSelection(a)}};k=a.getModel();k.getBaseModel&&(k=k.getBaseModel());k.addEventListener("Changed",this._listener.onChanged);a.addEventListener("MouseDown",this._listener.onMouseDown);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",
this._listener.onLineStyle);this._computeComments();this._computeFolding();a.redrawLines()}var e=n.keywords,b=m.keywords,p=k.keywords,q={styleClass:"comment"},t={styleClass:"comment"},s={styleClass:"comment block documentation"},y={styleClass:"keyword other documentation markup"},r={styleClass:"keyword other documentation task"},x={styleClass:"keyword other documentation tag"},u={styleClass:"string"},w={styleClass:"constant numeric"},z={styleClass:"keyword"},B={styleClass:"punctuation separator space",
unmergeable:!0},v={styleClass:"punctuation separator tab",unmergeable:!0},A={styleClass:"meta annotation currentLine"};f.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,this.offset)},getDataLength:function(){return this.offset-this.startOffset},_default:function(a){switch(a){case 32:case 9:if(this.whitespacesVisible)return 32===a?11:10;do a=this._read();while(32===a||9===a);this._unread(a);
return 9;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return a;default:var b=this.isCSS,d=this.offset-1;if(!b&&48<=a&&57>=a){var e=b=!1,g=!1,f=a;do if(a=this._read(),46===a&&!b)b=!0;else if(101===a&&!e)b=e=!0,a=this._read(),45!==a&&this._unread(a);else if(120===a&&48===f&&2===this.offset-d)b=e=g=!0;else if(!(48<=a&&57>=a||g&&(65<=a&&70>=a||97<=a&&102>=a)))break;while(1);this._unread(a);return 3}if(97<=a&&122>=a||65<=a&&90>=a||95===a||45===a&&b){do a=this._read();while(97<=a&&
122>=a||65<=a&&90>=a||95===a||48<=a&&57>=a||45===a&&b);this._unread(a);a=this.keywords;if(0<a.length){d=this.text.substring(d,this.offset);for(b=0;b<a.length;b++)if(this.keywords[b]===d)return 2}}return 1}},_read:function(){return this.offset<this.text.length?this.text.charCodeAt(this.offset++):-1},_unread:function(a){-1!==a&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var a=this._read(),b;switch(a){case -1:return null;case 47:a=this._read();if(!this.isCSS&&47===a)for(;;)if(a=
this._read(),-1===a||10===a||13===a)return this._unread(a),6;if(42===a){a=this._read();b=7;for(42===a&&(b=8);;){for(;42===a;)if(a=this._read(),47===a)return b;if(-1===a)return this._unread(a),b;a=this._read()}}this._unread(a);return 1;case 39:for(b=4;;)switch(a=this._read(),a){case 39:return b;case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),10!==a&&this._unread(a)}}break;case 34:for(b=4;;)switch(a=this._read(),a){case 34:return b;
case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),10!==a&&this._unread(a)}}break;default:return this._default(a)}}},setText:function(a){this.text=a;this.startOffset=this.offset=0}};h.prototype=new f(null);h.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:return 11;case 9:return 10;default:do a=this._read();while(!(32===a||9===a||-1===a));this._unread(a);
return 1}}};g.prototype=new f(null);g.prototype.setType=function(a){this._type=a};g.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:case 9:if(this.whitespacesVisible)return 32===a?11:10;do a=this._read();while(32===a||9===a);this._unread(a);return 9;case 60:if(8===this._type){do a=this._read();while(!(62===a||-1===a));if(62===a)return 12}return 1;case 64:if(8===this._type){do a=this._read();while(97<=a&&122>=a||65<=a&&90>=
a||95===a||48<=a&&57>=a);this._unread(a);return 13}return 1;case 84:if(79===(a=this._read()))if(68===(a=this._read()))if(79===(a=this._read()))if(a=this._read(),!(97<=a&&122>=a||65<=a&&90>=a||95===a||48<=a&&57>=a))return this._unread(a),14;this._unread(a);default:do a=this._read();while(!(32===a||9===a||-1===a||60===a||64===a||84===a));this._unread(a);return 1}}};d.prototype=new f(null);d.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),
1}};a.prototype={destroy:function(){var a=this.view;if(a){var b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.removeEventListener("Changed",this._listener.onChanged);a.removeEventListener("MouseDown",this._listener.onMouseDown);a.removeEventListener("Selection",this._listener.onSelection);a.removeEventListener("Destroy",this._listener.onDestroy);a.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a,
b){this.whitespacesVisible!==a&&(this.whitespacesVisible=a,this._scanner.whitespacesVisible=a,this._commentScanner.whitespacesVisible=a,b&&this.view.redraw())},setTabsVisible:function(a){this.tabsVisible!==a&&(this.tabsVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw())},setSpacesVisible:function(a){this.spacesVisible!==a&&(this.spacesVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw())},setDetectHyperlinks:function(a){this.detectHyperlinks=
a},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,b,d,e,g){var f;void 0===e&&(e=-1);void 0===g&&(g=a.length);for(;1<g-e;)if(f=Math.floor((g+e)/2),b<=a[f].start)g=f;else if(d&&b<a[f].end){g=f;break}else e=f;return g},_computeComments:function(){var a=this.view.getModel();a.getBaseModel&&(a=a.getBaseModel());this.comments=this._findComments(a.getText())},_computeFolding:function(){if(this.foldingEnabled){var a=this.view.getModel();
if(a.getBaseModel){var b=this.annotationModel;if(b){b.removeAnnotations(l.AnnotationType.ANNOTATION_FOLDING);for(var d=[],e=a.getBaseModel(),g=this.comments,f=0;f<g.length;f++){var h=g[f];(h=this._createFoldingAnnotation(a,e,h.start,h.end))&&d.push(h)}b.replaceAnnotations(null,d)}}}},_createFoldingAnnotation:function(a,b,d,e){var g=b.getLineAtOffset(d);b=b.getLineAtOffset(e);return g===b?null:new (l.AnnotationType.getType(l.AnnotationType.ANNOTATION_FOLDING))(d,e,a)},_computeTasks:function(a,b,d){if(this.detectTasks){var e=
this.annotationModel;if(e){var g=this.view.getModel(),f=g;g.getBaseModel&&(f=g.getBaseModel());for(var h=e.getAnnotations(b,d),g=[],k=l.AnnotationType.ANNOTATION_TASK;h.hasNext();){var p=h.next();p.type===k&&g.push(p)}h=[];p=this._commentScanner;p.setText(f.getText(b,d));for(var m;m=p.nextToken();){var n=p.getStartOffset()+b;14===m&&(m=f.getLineEnd(f.getLineAtOffset(n)),6!==a&&(m=Math.min(m,d-this.commentEnd.length)),h.push(l.AnnotationType.createAnnotation(k,n,m,f.getText(n,m))))}e.replaceAnnotations(g,
h)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var b=this.view,d=b.getModel(),b=b.getSelection();if(b.start===b.end&&d.getLineAtOffset(b.start)===a)return A}return null},_getStyles:function(a,b,d){a.getBaseModel&&(d=a.mapOffset(d));for(var e=d+b.length,g=[],f=d,h=this.comments,k=this._binarySearch(h,d,!0);k<h.length&&!(h[k].start>=e);k++){var l=h[k].start,p=h[k].end;f<l&&this._parse(b.substring(f-d,l-d),f,g);var m=h[k].type,n;switch(m){case 8:n=s;break;case 7:n=t;break;case 5:n=u}f=Math.max(f,
l);l=Math.min(e,p);(8===m||7===m)&&(this.whitespacesVisible||this.detectHyperlinks)?this._parseComment(b.substring(f-d,l-d),f,g,n,m):5===m&&this.whitespacesVisible?this._parseString(b.substring(f-d,l-d),f,g,u):g.push({start:f,end:l,style:n});f=p}f<e&&this._parse(b.substring(f-d,e-d),f,g);if(a.getBaseModel)for(b=0;b<g.length;b++)d=g[b].end-g[b].start,g[b].start=a.mapOffset(g[b].start,!0),g[b].end=g[b].start+d;return g},_parse:function(a,b,d){var e=this._scanner;for(e.setText(a);a=e.nextToken();){var g=
e.getStartOffset()+b,f=null;switch(a){case 2:f=z;break;case 3:f=w;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(e.getData(),g,d,u);continue}else f=u;break;case 8:this._parseComment(e.getData(),g,d,s,a);continue;case 6:this._parseComment(e.getData(),g,d,q,a);continue;case 7:this._parseComment(e.getData(),g,d,t,a);continue;case 10:this.whitespacesVisible&&this.tabsVisible&&(f=v);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(f=B)}d.push({start:g,end:e.getOffset()+b,
style:f})}},_parseComment:function(a,b,d,e,g){var f=this._commentScanner;f.setText(a);for(f.setType(g);a=f.nextToken();){g=f.getStartOffset()+b;var h=e;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(h=v);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(h=B);break;case 12:h=y;break;case 13:h=x;break;case 14:h=r;break;default:this.detectHyperlinks&&(h=this._detectHyperlinks(f.getData(),g,d,h))}h&&d.push({start:g,end:f.getOffset()+b,style:h})}},_parseString:function(a,b,d,e){var g=
this._whitespaceScanner;for(g.setText(a);a=g.nextToken();){var f=g.getStartOffset()+b,h=e;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(h=v);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(h=B)}h&&d.push({start:f,end:g.getOffset()+b,style:h})}},_detectHyperlinks:function(a,b,d,e){var g=null,f;if(0<(f=a.indexOf("://"))){for(var g=a,h=f;0<h;){f=g.charCodeAt(h-1);if(!(97<=f&&122>=f||65<=f&&90>=f||45===f||48<=f&&57>=f))break;h--}if(0<h&&(f="\"\"''(){}[]\x3c\x3e".indexOf(g.substring(h-
1,h)),-1!==f&&0===(f&1)&&-1!==(f=g.lastIndexOf("\"\"''(){}[]\x3c\x3e".substring(f+1,f+2))))){var k=f;f=this._clone(e);f.tagName="a";f.attributes={href:g.substring(h,k)};d.push({start:b,end:b+h,style:e});d.push({start:b+h,end:b+k,style:f});d.push({start:b+k,end:b+a.length,style:e});return null}}else 0===a.toLowerCase().indexOf("bug#")&&(g="https://bugs.eclipse.org/bugs/show_bug.cgi?id\x3d"+parseInt(a.substring(4),10));return g?(f=this._clone(e),f.tagName="a",f.attributes={href:g},f):e},_clone:function(a){if(!a)return a;
var b={},d;for(d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);return b},_findComments:function(a,b){b=b||0;var d=this._firstScanner,e;d.setText(a);for(var g=[];e=d.nextToken();)(7===e||8===e||5===e)&&g.push({start:d.getStartOffset()+b,end:d.getOffset()+b,type:e}),(6===e||7===e||8===e)&&this._computeTasks(e,d.getStartOffset()+b,d.getOffset()+b);return g},_findMatchingBracket:function(a,b){var d="{}()[]\x3c\x3e",e=a.getText(b,b+1),g=d.indexOf(e,0);if(-1===g)return-1;var f;f=g&1?d.substring(g-1,g):d.substring(g+
1,g+2);for(var h=a.getLineAtOffset(b),d=a.getLine(h),k=a.getLineStart(h),l=a.getLineEnd(h),d=this._findBrackets(e,f,d,k,k,l),l=0;l<d.length;l++)if(k=0<=d[l]?1:-1,d[l]*k-1===b){var p=1;if(g&1){for(l--;0<=l;l--)if(k=0<=d[l]?1:-1,p+=k,0===p)return d[l]*k-1;for(h-=1;0<=h;){d=a.getLine(h);k=a.getLineStart(h);l=a.getLineEnd(h);d=this._findBrackets(e,f,d,k,k,l);for(g=d.length-1;0<=g;g--)if(k=0<=d[g]?1:-1,p+=k,0===p)return d[g]*k-1;h--}}else{for(l++;l<d.length;l++)if(k=0<=d[l]?1:-1,p+=k,0===p)return d[l]*
k-1;h+=1;for(g=a.getLineCount();h<g;){d=a.getLine(h);k=a.getLineStart(h);l=a.getLineEnd(h);d=this._findBrackets(e,f,d,k,k,l);for(l=0;l<d.length;l++)if(k=0<=d[l]?1:-1,p+=k,0===p)return d[l]*k-1;h++}}break}return-1},_findBrackets:function(a,b,d,e,g,f){var h=[];a=a.charCodeAt(0);b=b.charCodeAt(0);for(var k=g,l=this._scanner,p,m=this.comments,n=this._binarySearch(m,g,!0);n<m.length&&!(m[n].start>=f);n++){p=m[n].start;var q=m[n].end;if(k<p)for(l.setText(d.substring(k-g,p-g));p=l.nextToken();)p===a?h.push(l.getStartOffset()+
k-g+e+1):p===b&&h.push(-(l.getStartOffset()+k-g+e+1));k=q}if(k<f)for(l.setText(d.substring(k-g,f-g));p=l.nextToken();)p===a?h.push(l.getStartOffset()+k-g+e+1):p===b&&h.push(-(l.getStartOffset()+k-g+e+1));return h},_onDestroy:function(a){this.destroy()},_onLineStyle:function(a){a.textView===this.view&&(a.style=this._getLineStyle(a.lineIndex));a.ranges=this._getStyles(a.textView.getModel(),a.lineText,a.lineStart)},_onSelection:function(a){var b=a.oldValue,d=a.newValue,e=this.view;a=e.getModel();var g;
if(this.highlightCaretLine){var f=a.getLineAtOffset(b.start);g=a.getLineAtOffset(d.start);var h=d.start===d.end,b=b.start===b.end;f===g&&b&&h||(b&&e.redrawLines(f,f+1),(f!==g||!b)&&h&&e.redrawLines(g,g+1))}if(this.annotationModel){var b=this._bracketAnnotations,k,p;if(d.start===d.end&&0<(p=e.getCaretOffset()))p-=1,a.getBaseModel&&(p=a.mapOffset(p),a=a.getBaseModel()),a=this._findMatchingBracket(a,p),-1!==a&&(k=[l.AnnotationType.createAnnotation(l.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),
l.AnnotationType.createAnnotation(l.AnnotationType.ANNOTATION_CURRENT_BRACKET,p,p+1)]);this._bracketAnnotations=k;this.annotationModel.replaceAnnotations(b,k)}},_onMouseDown:function(a){if(2===a.clickCount){var b=this.view,d=b.getModel(),e=b.getOffsetAtLocation(a.x,a.y);if(0<e){var g=e-1,f=d;d.getBaseModel&&(g=d.mapOffset(g),f=d.getBaseModel());g=this._findMatchingBracket(f,g);-1!==g&&(a.preventDefault(),a=g,d.getBaseModel&&(a=d.mapOffset(a,!0)),e>a&&(e--,a++),b.setSelection(a,e))}}},_onModelChanged:function(a){var b=
a.start,d=a.removedCharCount,e=a.addedCharCount-d,g=this.view;a=g.getModel();var f=a.getBaseModel?a.getBaseModel():a,d=b+d,h=f.getCharCount(),k=this.comments.length,p=f.getLineStart(f.getLineAtOffset(b)),m=this._binarySearch(this.comments,p,!0),n=this._binarySearch(this.comments,d,!1,m-1,k);m<k&&this.comments[m].start<=p&&p<this.comments[m].end?(p=this.comments[m].start,p>b&&(p+=e)):p=m===k&&0<k&&h-e===this.comments[k-1].end?this.comments[k-1].start:p;var q;n<k?(q=this.comments[n].end,q>b&&(q+=e),
n+=1):(n=k,q=h);for(var h=f.getText(p,q),t,h=this._findComments(h,p),k=m;k<this.comments.length;k++)t=this.comments[k],t.start>b&&(t.start+=e),t.start>b&&(t.end+=e);var s=n-m!==h.length;if(!s)for(k=0;k<h.length;k++){t=this.comments[m+k];var r=h[k];if(t.start!==r.start||t.end!==r.end||t.type!==r.type){s=!0;break}}k=[m,n-m].concat(h);Array.prototype.splice.apply(this.comments,k);s&&(k=p,t=q,a!==f&&(k=a.mapOffset(k,!0),t=a.mapOffset(t,!0)),g.redrawRange(k,t));if(this.foldingEnabled&&f!==a&&this.annotationModel){g=
this.annotationModel;m=g.getAnnotations(p,q);p=[];for(q=[];m.hasNext();)if(t=m.next(),t.type===l.AnnotationType.ANNOTATION_FOLDING){q.push(t);for(k=0;k<h.length&&!(t.start===h[k].start&&t.end===h[k].end);k++);k===h.length?(p.push(t),t.expand()):(k=t.start,n=t.end,k>b&&(k-=e),n>b&&(n-=e),k<=b&&(b<n&&k<=d&&d<n)&&(k=f.getLineAtOffset(t.start),n=f.getLineAtOffset(t.end),k!==n?t.expanded||t.expand():g.removeAnnotation(t)))}b=[];for(k=0;k<h.length;k++){t=h[k];for(e=0;e<q.length&&!(q[e].start===t.start&&
q[e].end===t.end);e++);e===q.length&&(t=this._createFoldingAnnotation(a,f,t.start,t.end))&&b.push(t)}g.replaceAnnotations(p,b)}}};return{TextStyler:a}});
define("orion/editor/textStyler",["orion/editor/annotations","orion/editor/eventTarget"],function(l,n){function m(a,d){this._patternManager=new k(a,d)}function k(a,d){this._unnamedCounter=0;this._patterns=[];this._rootId=d;a.forEach(function(a){this._addRepositoryPatterns(a.repository||{},a.id);this._addPatterns(a.patterns||[],a.id)}.bind(this))}function f(a,d,b,g,f,h,k){this.start=a.start;this.end=a.end;this.contentStart=a.contentStart;this.contentEnd=a.contentEnd;this.name=d;this.typeId=b;this.styler=
g;this.parent=h;k&&k(this);this._subBlocks=g.computeBlocks(f,f.getText(this.start,this.end),this,this.start,null,null,null)}function h(a){this._styler=a}function g(a,d,b){this._highlightCaretLine=this._whitespacesVisible=this._spacesVisible=this._tabsVisible=!1;this._detectTasks=this._foldingEnabled=!0;this._view=a;this._annotationModel=d;this._stylerAdapter=b;this._stylerAdapter.setStyler(this);this._accessor=new h(this);this._bracketAnnotations;var g=this;this._listener={onChanged:function(a){g._onModelChanged(a)},
onDestroy:function(a){g._onDestroy(a)},onLineStyle:function(a){g._onLineStyle(a)},onMouseDown:function(a){g._onMouseDown(a)},onSelection:function(a){g._onSelection(a)}};b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.addEventListener("Changed",this._listener.onChanged);a.addEventListener("MouseDown",this._listener.onMouseDown);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",this._listener.onLineStyle);
var f=b.getCharCount();this._rootBlock=this._stylerAdapter.createBlock({start:0,contentStart:0,end:f,contentEnd:f},this,b,null);d&&(f=[],d.removeAnnotations(l.AnnotationType.ANNOTATION_FOLDING),this._computeFolding(this._rootBlock.getBlocks(),a.getModel(),f),this._detectTasks&&(d.removeAnnotations(l.AnnotationType.ANNOTATION_TASK),this._computeTasks(this._rootBlock,b,f)),d.replaceAnnotations([],f));a.redrawLines()}var d=function(a,d,b,g,f){var h;void 0===g&&(g=-1);void 0===f&&(f=a.length);for(;1<
f-g;)if(h=Math.floor((f+g)/2),d<=a[h].start)f=h;else if(b&&d<a[h].end){f=h;break}else g=h;return f};m.prototype={blockSpansBeyondEnd:function(a){return a.pattern.regexEnd===this._eolRegex},computeBlocks:function(a,d,b,g,f,h,k){if(!d)return[];var l=[],m=[];f=f||0;h=h||Infinity;k=k||Infinity;b.blockPatterns.forEach(function(a){var b=this._findMatch(a.regexBegin||a.regex,d,f);b&&m.push({result:b,pattern:a})}.bind(this));if(!m.length)return l;m.sort(function(a,b){return a.result.index<b.result.index?
-1:a.result.index>b.result.index?1:a.pattern.pattern.index<b.pattern.pattern.index?-1:1});for(var n=0;0<m.length;){var u=m[0];m.splice(0,1);if(h<u.result.index)break;if(!(u.result.index<n)){var n=g+u.result.index,w=u.result.index,z=null,B=u.pattern.regexEnd;if(B){var w=w+u.result[0].length,v=u.pattern,A=this._substituteCaptureValues(B,u.result);A!==B&&(v={pattern:v.pattern,regexBegin:v.regexBegin,regexEnd:A},B=A);for(A=w;!z;){A=this._findMatch(B,d,A);A||(this._eolRegex.lastIndex=0,A=this._eolRegex.exec(d),
v={pattern:v.pattern,regexBegin:v.regexBegin,regexEnd:this._eolRegex});var D=this.createBlock({start:n,end:g+A.index+A[0].length,contentStart:g+w,contentEnd:g+A.index},b.styler,a,b,v),C=D.getBlocks();if(!C.length||C[C.length-1].end<=A.index+g)z=D;A=A.index+A[0].length}}else z=this.createBlock({start:n,end:n+u.result[0].length,contentStart:n,contentEnd:n+u.result[0].length},b.styler,a,b,u.pattern);l.push(z);if(l.length===k||h<=z.end)break;n=z.end-g}this._updateMatch(u,d,m,n,h)}return l},computeStyle:function(a,
e,b){if(!a.pattern)return null;var g={start:a.start,end:a.end,style:a.pattern.pattern.name};if(a.contentStart<=b&&b<a.contentEnd)return a.pattern.pattern.contentName?{start:a.contentStart,end:a.contentEnd,style:a.pattern.pattern.contentName}:g;var f,h;if(b<a.contentStart){h=a.pattern.pattern.beginCaptures||a.pattern.pattern.captures;if(!h)return g;f=a.pattern.regexBegin;e=e.getText(a.start,a.contentStart);a=a.start}else{h=a.pattern.pattern.endCaptures||a.pattern.pattern.captures;if(!h)return g;f=
a.pattern.regexEnd;e=e.getText(a.contentEnd,a.end);a=a.contentEnd}f.lastIndex=0;if(f=f.exec(e))if(e=[],this._getCaptureStyles(f,h,a,e),(h=e[d(e,b,!0)])&&h.start<=b&&b<h.end)return h;return g},createBlock:function(a,d,b,g,h){return new f(a,h?h.pattern.name:null,h?h.pattern.id:null,d,b,g,function(a){a.pattern=h;a.linePatterns=[];a.blockPatterns=[];a.enclosurePatterns={};this._initPatterns(this._patternManager,a)}.bind(this))},getBlockContentStyleName:function(a){return a.pattern.pattern.contentName||
a.pattern.pattern.name},getBlockEndStyle:function(a,d,b,g){var f;if(a.pattern.regexEnd&&(f=this._findMatch(a.pattern.regexEnd,d,0)))(d=a.pattern.pattern.endCaptures||a.pattern.pattern.captures)?this._getCaptureStyles(f,d,b-f[0].length,g):a.pattern.pattern.name&&g.push({start:b-f[0].length,end:b,style:a.pattern.pattern.name});return f?f[0]:null},getBlockStartStyle:function(a,d,b,g){var f;if(a.pattern.regexBegin&&(f=this._findMatch(a.pattern.regexBegin,d,0)))(d=a.pattern.pattern.beginCaptures||a.pattern.pattern.captures)?
this._getCaptureStyles(f,d,b,g):g.push({start:b,end:b+f[0].length,style:a.pattern.pattern.name});return f?f[0]:null},getBracketMatch:function(a,d){for(var b,g=Object.keys(a.enclosurePatterns),f=0;f<g.length;f++){var h=a.enclosurePatterns[g[f]],k=this._findMatch(h.regex,d,0);if(k&&0===k.index){b=h;break}}if(!b)return null;f=!1;-1!==b.pattern.name.indexOf(this._PUNCTUATION_SECTION_BEGIN)?(f=!0,g=b.pattern.name.replace(this._PUNCTUATION_SECTION_BEGIN,this._PUNCTUATION_SECTION_END)):g=b.pattern.name.replace(this._PUNCTUATION_SECTION_END,
this._PUNCTUATION_SECTION_BEGIN);return!a.enclosurePatterns[g]?null:{beginName:b.pattern.name,endName:g,atStart:f}},parse:function(a,d,b,g,f){if(a&&(b=b.linePatterns)){var h=[];b.forEach(function(b){var d=b.regex||b.regexBegin;d.oldLastIndex=d.lastIndex;(d=this._findMatch(d,a,0))&&h.push({result:d,pattern:b})}.bind(this));h.sort(function(a,b){return a.result.index<b.result.index?-1:a.result.index>b.result.index?1:a.pattern.pattern.index<b.pattern.pattern.index?-1:1});for(var k=0;0<h.length;){var l=
h[0];h.splice(0,1);if(!(l.result.index<k)){var m=l.result.index,n,u=[];if(l.pattern.regex){k=l.result;n=m+k[0].length;n={start:d+m,end:d+n,style:l.pattern.pattern.name};if(!f){l.pattern.pattern.captures&&this._getCaptureStyles(k,l.pattern.pattern.captures,d+m,u);u.sort(function(a,b){return a.start<b.start?-1:a.start>b.start?1:0});for(m=0;m<u.length-1;m++)if(u[m+1].start<u[m].end){var w={start:u[m+1].end,end:u[m].end,style:u[m].style};u[m].end=u[m+1].start;u.splice(m+2,0,w)}}this._mergeStyles(n,u,
g)}else k=l.pattern.regexEnd,k=this._substituteCaptureValues(k,l.result),k=this._findMatch(k,a,l.result.index+l.result[0].length),k||(this._eolRegex.lastIndex=0,k=this._eolRegex.exec(a)),n=k.index+k[0].length,g.push({start:d+m,end:d+n,style:l.pattern.pattern.name});k=k.index+k[0].length}this._updateMatch(l,a,h,k)}b.forEach(function(a){a=a.regex||a.regexBegin;a.lastIndex=a.oldLastIndex})}},setStyler:function(){},verifyBlock:function(a,d,b,g){var f=null,h=[];b.parent.blockPatterns.forEach(function(a){var b=
this._findMatch(a.regexBegin||a.regex,d,0);b&&h.push({result:b,pattern:a})}.bind(this));h.sort(function(a,b){return!a.result.index&&b.result.index?-1:a.result.index&&!b.result.index?1:!a.result.index&&!b.result.index?a.pattern.pattern.index<b.pattern.pattern.index?-1:1:0});if(!h.length||0!==h[0].result.index||h[0].pattern.pattern.id!==b.pattern.pattern.id)f=!1;else{var k=h[0],l=k.pattern.regexEnd;if(l){for(var l=this._substituteCaptureValues(l,k.result),k=k.result[0].length,m=this._findMatch(l,d,
k);null===f&&m&&b.start+m.index!==b.contentEnd+g;){var n=this.computeBlocks(a,d,b,b.start,k,m.index+1,null);!n.length||n[n.length-1].end<=b.start+m.index?f=!1:n.length?(k=n[n.length-1].end-b.start,m=this._findMatch(l,d,k)):m=null}m||(this._eolRegex.lastIndex=0,m=this._eolRegex.exec(d),f=b.start+m.index===b.end+g)}else f=b.start+k.result[0].length===b.end+g}return null!==f?f:!0},_findMatch:function(a,d,b,g){var f=b,h=a.lastIndex;this._linebreakRegex.lastIndex=b;b=this._linebreakRegex.exec(d);var k,
l;a.lastIndex=0;if(b){for(l=b.index;0<=--l&&!(k=d.charAt(l),k===this._NEWLINE||k===this._CR););k=d.substring(l+1,b.index+b[1].length);a.lastIndex=l=b.index-l-1}for(;b&&b.index<d.length;){var m;if(g){var n=a.lastIndex;a.test(k)&&(a.lastIndex=n,m=a.exec(k))}else m=a.exec(k);if(m)return m.index+=f,m.index-=l,a.lastIndex=h,m;l=0;f+=b[0].length;if(b=this._linebreakRegex.exec(d))k=b[1],a.lastIndex=0}a.lastIndex=h;return null},_getCaptureStyles:function(a,d,b,g){if(d[0])g.push({start:b,end:b+a[0].length,
style:d[0].name});else for(var f=0,h=1;h<a.length;h++)if(a[h]){var k=d[h];if(k){var l=b+f;g.push({start:l,end:l+a[h].length,style:k.name})}f+=a[h].length}},_initPatterns:function(a,d){if(d.pattern&&d.pattern.pattern.linePatterns)d.linePatterns=d.pattern.pattern.linePatterns,d.blockPatterns=d.pattern.pattern.blockPatterns,d.enclosurePatterns=d.pattern.pattern.enclosurePatterns;else{var b=a.getPatterns(d.pattern?d.pattern.pattern:null),g=function(a){a="string"===typeof a?a:a.match;var b=this._ignoreCaseRegex.exec(a),
d=this._FLAGS;b&&(a=a.substring(b[0].length),d+="i");return RegExp(a,d)}.bind(this),f=-1,h=0;b.forEach(function(a){var b;if(a.match&&!a.begin&&!a.end){if(b={regex:g(a.match),pattern:a},d.linePatterns.push(b),a.name&&0===a.name.indexOf("punctuation.section")&&(-1!==a.name.indexOf(this._PUNCTUATION_SECTION_BEGIN)||-1!==a.name.indexOf(this._PUNCTUATION_SECTION_END)))d.enclosurePatterns[a.name]=b}else!a.match&&(a.begin&&a.end)&&(f=h,b={regexBegin:g(a.begin),regexEnd:g(a.end),pattern:a},d.linePatterns.push(b));
h++}.bind(this));d.blockPatterns=d.linePatterns.slice(0,f+1);d.pattern&&(d.pattern.pattern.enclosurePatterns=d.enclosurePatterns,d.pattern.pattern.linePatterns=d.linePatterns,d.pattern.pattern.blockPatterns=d.blockPatterns)}},_mergeStyles:function(a,d,b){var g=a.start;d.forEach(function(d){g<=d.start&&b.push({start:g,end:d.start,style:a.style});b.push(d);g=d.end});g<a.end&&b.push({start:g,end:a.end,style:a.style})},_substituteCaptureValues:function(a,d){var b=a.toString();this._captureReferenceRegex.lastIndex=
0;if(!this._captureReferenceRegex.test(b))return a;this._captureReferenceRegex.lastIndex=0;for(var g=this._captureReferenceRegex.exec(b);g;)b=b.replace(g[0],d[g[1]]||""),this._captureReferenceRegex.lastIndex=0,g=this._captureReferenceRegex.exec(b);return RegExp(b.substring(1,b.length-1-this._FLAGS.length),this._FLAGS)},_updateMatch:function(a,d,b,g,f){var h=a.pattern.regex?a.pattern.regex:a.pattern.regexBegin;f=f||Infinity;if((d=this._findMatch(h,d,g,!0))&&d.index<f){a.result=d;for(f=0;f<b.length;f++)if(d.index<
b[f].result.index||d.index===b[f].result.index&&a.pattern.pattern.index<b[f].pattern.pattern.index){b.splice(f,0,a);return}b.push(a)}},_captureReferenceRegex:/\\(\d)/g,_eolRegex:/$/,_ignoreCaseRegex:/^\(\?i\)\s*/,_linebreakRegex:/(.*)(?:[\r\n]|$)/g,_CR:"\r",_FLAGS:"g",_NEWLINE:"\n",_PUNCTUATION_SECTION_BEGIN:".begin",_PUNCTUATION_SECTION_END:".end"};k.prototype={getPatterns:function(a){a?(a="string"===typeof a?a:a.qualifiedId,a+="#"):a=this._rootId+"#"+this._NO_ID;var d=[0],b={},g=RegExp("^"+a+"[^#]+$");
this._patterns.forEach(function(a){g.test(a.qualifiedId)&&(a.include?this._processInclude(a,d,b):(a.index=d[0]++,b[a.id]=a))}.bind(this));var f=[];Object.keys(b).forEach(function(a){f.push(b[a])});return f},_addPattern:function(a,d,b){a.parentId=b;a.id=d;a.qualifiedId=a.parentId+"#"+a.id;this._patterns.push(a);a.patterns&&!a.include&&this._addPatterns(a.patterns,a.qualifiedId)},_addPatterns:function(a,d){a.forEach(function(a){this._addPattern(a,this._NO_ID+this._unnamedCounter++,d)}.bind(this))},
_addRepositoryPatterns:function(a,d){Object.keys(a).forEach(function(b){this._addPattern(a[b],b,d)}.bind(this))},_processInclude:function(a,d,b){var g,f=a.include.indexOf("#");g=0===f?RegExp("^"+a.qualifiedId.substring(0,a.qualifiedId.indexOf("#"))+a.include+"$"):-1===f?RegExp("^"+a.include+"#"+this._NO_ID+"[^#]+$"):RegExp("^"+a.include+"$");this._patterns.forEach(function(a){g.test(a.qualifiedId)&&(a.include?this._processInclude(a,d,b):b[a.id]||(a.index=d[0]++,b[a.id]=a))}.bind(this))},_NO_ID:"NoID"};
f.prototype={adjustBounds:function(a,d){a<this.start&&(this.start+=d);a<this.contentStart&&(this.contentStart+=d);a<=this.end&&(this.end+=d);a<=this.contentEnd&&(this.contentEnd+=d);this._subBlocks.forEach(function(b){a<=b.end&&b.adjustBounds(a,d)})},getBlocks:function(){return this._subBlocks},getBlockAtIndex:function(a){return d(this.getBlocks(),a,!0)},isRenderingWhitespace:function(){return this.styler._isRenderingWhitespace()}};h.prototype={getStyles:function(a){return this._styler.getStyles(a)}};
g.prototype={computeBlocks:function(a,d,b,g,f,h,k){return this._stylerAdapter.computeBlocks(a,d,b,g,f,h,k)},destroy:function(){if(this._view){var a=this._view.getModel();a.getBaseModel&&(a=a.getBaseModel());a.removeEventListener("Changed",this._listener.onChanged);this._view.removeEventListener("MouseDown",this._listener.onMouseDown);this._view.removeEventListener("Selection",this._listener.onSelection);this._view.removeEventListener("Destroy",this._listener.onDestroy);this._view.removeEventListener("LineStyle",
this._listener.onLineStyle);this._view=null}},getBlockAtIndex:function(a){return this._findBlock(this._rootBlock,a)},getRootBlock:function(){return this._rootBlock},getStyleAccessor:function(){return this._accessor},getStyles:function(a){var e=[],b=this._view.getModel();b.getBaseModel&&(b=b.getBaseModel());var g=this._findBlock(this._rootBlock,a),f=b.getLineAtOffset(a),h=b.getLine(f),k=[];this._stylerAdapter.parse(h,b.getLineStart(f),g,k);for((f=k[d(k,a,!0)])&&(f.start<=a&&a<f.end)&&e.push(f);g;)(f=
this._stylerAdapter.computeStyle(g,b,a))&&e.splice(0,0,f),g=g.parent;return e},setDetectHyperlinks:function(){},setDetectTasks:function(a){this._detectTasks=a},setFoldingEnabled:function(a){this._foldingEnabled=a},setHighlightCaretLine:function(a){this._highlightCaretLine=a},setSpacesVisible:function(a){this._spacesVisible!==a&&(this._spacesVisible=a,this.setWhitespacesVisible(this._tabsVisible||this._spacesVisible,!1),this._view.redraw())},setTabsVisible:function(a){this._tabsVisible!==a&&(this._tabsVisible=
a,this.setWhitespacesVisible(this._tabsVisible||this._spacesVisible,!1),this._view.redraw())},setWhitespacesVisible:function(a,d){this._whitespacesVisible!==a&&(this._whitespacesVisible=a,d&&this._view.redraw())},_computeFolding:function(a,d,b){if(d.getBaseModel){var g=d.getBaseModel();a.forEach(function(a){var f=this._createFoldingAnnotation(d,g,a.start,a.end);f&&b.push(f);this._computeFolding(a.getBlocks(),d,b)}.bind(this))}},_computeTasks:function(a,d,b,g,f){g=g||a.start;f=f||a.end;if(a.start<=
f&&g<=a.end&&this._annotationModel){var h=l.AnnotationType.ANNOTATION_TASK;if(a.name&&0===a.name.indexOf("comment")){var k=[];this._stylerAdapter.parse(d.getText(a.contentStart,a.end),a.contentStart,a,k,!0);for(var m=0;m<k.length;m++)"meta.annotation.task.todo"===k[m].style&&(g<=k[m].start&&k[m].end<=f)&&b.push(l.AnnotationType.createAnnotation(h,k[m].start,k[m].end,d.getText(k[m].start,k[m].end)))}a.getBlocks().forEach(function(a){this._computeTasks(a,d,b,g,f)}.bind(this))}},_createFoldingAnnotation:function(a,
d,b,g){var f=d.getLineAtOffset(b),h=d.getLineAtOffset(g);return f===h||f+1===h&&d.getLineStart(h)===d.getLineEnd(h)?null:new (l.AnnotationType.getType(l.AnnotationType.ANNOTATION_FOLDING))(b,g,a)},_findBlock:function(a,e){var b=a.getBlocks();if(!b.length)return a;var g=d(b,e,!0);return g<b.length&&b[g].start<=e&&e<b[g].end?this._findBlock(b[g],e):a},_findBrackets:function(a,e,b,g,f){for(var h=[],k=[],l=g,m=e.getBlocks(),n=d(m,g,!0);n<m.length&&!(m[n].start>=f);n++){var u=m[n].start,w=m[n].end;l<u&&
(this._stylerAdapter.parse(b.substring(l-g,u-g),l,e,k),k.forEach(function(b){0===b.style.indexOf(a.beginName)?h.push(b.start+1):0===b.style.indexOf(a.endName)&&h.push(-(b.start+1))}),k=[]);l=w}l<f&&(this._stylerAdapter.parse(b.substring(l-g,f-g),l,e,k),k.forEach(function(b){b.style&&(0===b.style.indexOf(a.beginName)?h.push(b.start+1):0===b.style.indexOf(a.endName)&&h.push(-(b.start+1)))}));return h},_findMatchingBracket:function(a,d,b){var g=a.getLineAtOffset(b),f=a.getLineEnd(g),h=a.getText(b,f),
h=this._stylerAdapter.getBracketMatch(d,h);if(!h)return-1;for(var k=a.getLine(g),l=a.getLineStart(g),f=this._findBrackets(h,d,k,l,f),m=0;m<f.length;m++)if(k=0<=f[m]?1:-1,f[m]*k-1===b){b=1;if(h.atStart){for(m++;m<f.length;m++)if(k=0<=f[m]?1:-1,b+=k,0===b)return f[m]*k-1;g+=1;for(m=a.getLineCount();g<m;){k=a.getLine(g);l=a.getLineStart(g);f=a.getLineEnd(g);f=this._findBrackets(h,d,k,l,f);for(l=0;l<f.length;l++)if(k=0<=f[l]?1:-1,b+=k,0===b)return f[l]*k-1;g++}}else{for(m--;0<=m;m--)if(k=0<=f[m]?1:-1,
b+=k,0===b)return f[m]*k-1;for(g-=1;0<=g;){k=a.getLine(g);l=a.getLineStart(g);f=a.getLineEnd(g);f=this._findBrackets(h,d,k,l,f);for(m=f.length-1;0<=m;m--)if(k=0<=f[m]?1:-1,b+=k,0===b)return f[m]*k-1;g--}}break}return-1},_getLineStyle:function(a){if(this._highlightCaretLine){var d=this._view.getModel(),b=this._view.getSelection();if(b.start===b.end&&d.getLineAtOffset(b.start)===a)return this._caretLineStyle}return null},_getStyles:function(a,e,b,g){e.getBaseModel&&(g=e.mapOffset(g));for(var f=g+b.length,
h=[],k=g,l=a.getBlocks(),m=d(l,g,!0);m<l.length&&!(l[m].start>=f);m++){var n=l[m].start,u=l[m].end;k<n&&this._stylerAdapter.parse(b.substring(k-g,n-g),k,a,h);var w=Math.max(k,n);w===n&&(n=this._stylerAdapter.getBlockStartStyle(l[m],b.substring(w-g),w,h))&&(w+=n.length);var n=Math.min(f,u),z=[];n===u&&(k=b.substring(n-k-(l[m].end-l[m].contentEnd)),(k=this._stylerAdapter.getBlockEndStyle(l[m],k,n,z))&&(n-=k.length));var k=this._getStyles(l[m],e,b.substring(w-g,n-g),w),B=this._stylerAdapter.getBlockContentStyleName(l[m]);
if(B){var v=w;k.forEach(function(a){a.start-v&&h.push({start:v,end:a.start,style:B});a.mergeable&&(a.style+=","+B);h.push(a);v=a.end});n-v&&h.push({start:v,end:n,style:B})}else h=h.concat(k);h=h.concat(z);k=u}k<f&&this._stylerAdapter.parse(b.substring(k-g,f-g),k,a,h);if(e.getBaseModel)for(a=0;a<h.length;a++)b=h[a].end-h[a].start,h[a].start=e.mapOffset(h[a].start,!0),h[a].end=h[a].start+b;return h},_isRenderingWhitespace:function(){return this._whitespacesVisible&&(this._tabsVisible||this._spacesVisible)},
_onDestroy:function(){this.destroy()},_onLineStyle:function(a){a.textView===this._view&&(a.style=this._getLineStyle(a.lineIndex));a.ranges=this._getStyles(this._rootBlock,a.textView.getModel(),a.lineText,a.lineStart);a.ranges.forEach(function(a){a.style&&(a.style={styleClass:a.style.replace(/\./g," ")})});this._isRenderingWhitespace()&&(this._spacesVisible&&this._spliceStyles(this._spacePattern,a.ranges,a.lineText,a.lineStart),this._tabsVisible&&this._spliceStyles(this._tabPattern,a.ranges,a.lineText,
a.lineStart))},_onModelChanged:function(a){var e=a.start,b=a.removedCharCount;a=a.addedCharCount-b;var g=this._view.getModel(),f=g.getBaseModel?g.getBaseModel():g,b=e+b,h=f.getCharCount(),k=f.getLineStart(f.getLineAtOffset(e)),m=this._findBlock(this._rootBlock,e),n,x,u,w,z,B,v;do{u=m.parent;if(!n&&u&&(z=f.getText(m.start,Math.min(h,m.end+a+1)),!this._stylerAdapter.verifyBlock(f,z,m,a))){m=u;continue}x=m.getBlocks();var A=x.length,D=d(x,k,!0),C=d(x,b,!1,D-1,A);n=!1;if(D&&x.length&&x[D-1].end===e){z=
f.getText(x[D-1].start,Math.min(h,e+1));var E=this.computeBlocks(f,z,m,x[D-1].start,null,null,null);E.length&&E[0].end!==x[D-1].end&&(D--,n=!0)}D<A&&x[D].start<=k&&(k<x[D].end||n)?(v=x[D].start,v>e&&(v+=a)):D===A&&0<A&&m.end-a===x[A-1].end?(v=x[--D].start,v>e&&(v+=a)):v=Math.max(k,m.contentStart);B=C<A?x[C].end:m.contentEnd;e<=B&&(B+=a);B=Math.min(B,h-1);z=f.getText(v,B+1);E=this.computeBlocks(f,z,m,v,null,null,null);if(C<A){if(E.length&&E[E.length-1].end===B&&E[E.length-1].typeId===x[C].typeId)break;
if(E.length&&this._stylerAdapter.blockSpansBeyondEnd(E[E.length-1])){C++;for(var K=E[E.length-1].getBlocks(),K=(K.length?K[K.length-1]:E[E.length-1]).typeId;C<A;){if(x[C].typeId===K){var L=x[C].end+a,L=Math.min(L,h-1);z=f.getText(v,L+1);z=this.computeBlocks(f,z,m,v,null,null,null);if(z.length&&z[z.length-1].end===L){B=L;E=z;break}}C++}if(C<A)break}}else if(!E.length||E[E.length-1].end<=m.contentEnd+a)break;if(!u){B=h;C=A;z=f.getText(v,B);E=this.computeBlocks(f,z,m,v,null,null,null);break}m=u;w=!0}while(1);
this._rootBlock.adjustBounds(e,a);C=Math.min(C+1,A);w||(w=C-D!==E.length);if(!w)for(A=0;A<E.length;A++)if(n=x[D+A],h=E[A],n.start!==h.start||n.end!==h.end||n.typeId!==h.typeId){w=!0;break}!x.length&&!E.length?this.dispatchEvent({type:"BlocksChanged",old:[m],"new":[m]}):this.dispatchEvent({type:"BlocksChanged",old:x.slice(D,C),"new":E});D=[D,C-D].concat(E);Array.prototype.splice.apply(x,D);w&&(x=v,w=B,g!==f&&(x=g.mapOffset(x,!0),w=g.mapOffset(w,!0)),this._view.redrawRange(x,w));if(this._annotationModel){x=
[];var F=[],G=[];w=this._annotationModel.getAnnotations(v,B);D=this._foldingEnabled&&f!==g;for(C=m.parent||m;w.hasNext();)E=w.next(),D&&E.type===l.AnnotationType.ANNOTATION_FOLDING?(G.push(E),n=this._findBlock(C,E.start),!n||!(E.start===n.start&&E.end===n.end)?(x.push(E),E.expand()):(n=E.start,A=E.end,n>e&&(n-=a),A>e&&(A-=a),n<=e&&(e<A&&n<=b&&b<A)&&(n=f.getLineAtOffset(E.start),A=f.getLineAtOffset(E.end),n!==A?E.expanded||E.expand():x.push(E)))):E.type===l.AnnotationType.ANNOTATION_TASK&&m.start<=
E.start&&E.end<=m.end&&x.push(E);D&&C.getBlocks().forEach(function(a){this._updateFolding(a,f,g,G,F,v,B)}.bind(this));this._detectTasks&&this._computeTasks(m,f,F,v,B);this._annotationModel.replaceAnnotations(x,F)}},_onMouseDown:function(a){if(2===a.clickCount){var d=this._view.getModel(),b=this._view.getOffsetAtLocation(a.x,a.y);if(0<b){var g=b-1,f=d;d.getBaseModel&&(g=d.mapOffset(g),f=d.getBaseModel());var h=this._findBlock(this._rootBlock,g),g=this._findMatchingBracket(f,h,g);-1!==g&&(a.preventDefault(),
a=g,d.getBaseModel&&(a=d.mapOffset(a,!0)),b>a&&(b--,a++),this._view.setSelection(a,b))}}},_onSelection:function(a){var d=a.oldValue,b=a.newValue;a=this._view.getModel();var g;if(this._highlightCaretLine){var f=a.getLineAtOffset(d.start);g=a.getLineAtOffset(b.start);var h=b.start===b.end,d=d.start===d.end;f===g&&d&&h||(d&&this._view.redrawLines(f,f+1),(f!==g||!d)&&h&&this._view.redrawLines(g,g+1))}if(this._annotationModel){var d=this._bracketAnnotations,k,m;if(b.start===b.end&&0<(m=this._view.getCaretOffset()))m-=
1,a.getBaseModel&&(m=a.mapOffset(m),a=a.getBaseModel()),b=this._findBlock(this._rootBlock,m),a=this._findMatchingBracket(a,b,m),-1!==a&&(k=[l.AnnotationType.createAnnotation(l.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),l.AnnotationType.createAnnotation(l.AnnotationType.ANNOTATION_CURRENT_BRACKET,m,m+1)]);this._bracketAnnotations=k;this._annotationModel.replaceAnnotations(d,k)}},_spliceStyles:function(a,d,b,g){for(var f=a.regex,h=f.lastIndex=0,k=f.exec(b);k;){for(k=g+k.index;h<d.length&&!(k<
d[h].end);)h++;var l={start:k,end:k+1,style:a.style};if(h<d.length&&d[h].start<=k){var m={start:k+1,end:d[h].end,style:d[h].style};d[h].end=k;d.splice(h+1,0,m);d.splice(h+1,0,l);h+=2}else d.splice(h,0,l),h++;k=f.exec(b)}},_updateFolding:function(a,e,b,g,f,h,k){h=h||a.start;k=k||a.end;if(!a.doNotFold&&a.start<=k&&h<=a.end){var l=d(g,a.start,!0);l<g.length&&g[l].start===a.start&&g[l].end===a.end||(l=this._createFoldingAnnotation(b,e,a.start,a.end))&&f.push(l);a.getBlocks().forEach(function(a){this._updateFolding(a,
e,b,g,f,h,k)}.bind(this))}},_caretLineStyle:{styleClass:"meta annotation currentLine"},_spacePattern:{regex:/[ ]/g,style:{styleClass:"punctuation separator space",unmergeable:!0}},_tabPattern:{regex:/\t/g,style:{styleClass:"punctuation separator tab",unmergeable:!0}}};n.EventTarget.addMixin(g.prototype);return{TextStyler:g,Block:f,createPatternBasedAdapter:function(a,d){return new m(a,d)}}});
define("orion/editor/textMateStyler",["orion/regex"],function(l){function n(f){var h;if(f instanceof Array){h=Array(f.length);for(var g=0;g<f.length;g++)h[g]=n(f[g])}else for(g in h={},f)if(Object.prototype.hasOwnProperty.call(f,g)){var d=f[g];h[g]="object"===typeof d&&null!==d?n(d):d}return h}function m(f,h,g){this.initialize(f);this.grammar=n(h);this.externalGrammars=g?n(g):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var k={unsupported:[{regex:/\(\?[ims\-]:/,
func:function(f){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(f){return"\x3d"===f[1]?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(f){return"atomic group"}}],toRegExp:function(f){function h(a,b){throw Error('Unsupported regex feature "'+a+'": "'+b[0]+'" at index: '+b.index+" in "+b.input);}var g="",d;f=k.processGlobalFlag("x",f,function(a){for(var b="",d=!1,g=a.length,f=0;f<g;){var h=a.charAt(f);if(!d&&"#"===h)for(;f<g&&"\r"!==h&&"\n"!==h;)h=a.charAt(++f);
else if(!d&&/\s/.test(h))for(;f<g&&/\s/.test(h);)h=a.charAt(++f);else"\\"===h?(b+=h,/\s/.test(a.charAt(f+1))||(b+=a.charAt(f+1),f+=1)):("["===h?d=!0:"]"===h&&(d=!1),b+=h),f+=1}return b});f=k.processGlobalFlag("i",f,function(a){g+="i";return a});for(d=0;d<this.unsupported.length;d++){var a;(a=this.unsupported[d].regex.exec(f))&&h(this.unsupported[d].func(a),a)}return RegExp(f,g)},processGlobalFlag:function(f,h,g){var d="(?"+f+")";f="(?"+f+":";if(h.substring(0,d.length)===d)return g(h.substring(d.length));
if(h.substring(0,f.length)===f){for(var d=0,a=h.length,e=-1,b=0;b<a&&-1===e;b++)switch(h.charAt(b)){case "\\":b++;break;case "(":d++;break;case ")":d--,0===d&&(e=b)}d=e;if(d<h.length-1)throw Error("Only a "+f+") group that encloses the entire regex is supported in: "+h);return g(h.substring(f.length,d))}return h},hasBackReference:function(f){return/\\\d+/.test(f.source)},getSubstitutedRegex:function(f,h,g){g="undefined"===typeof g?!0:!1;f=f.source.split(/(\\\d+)/g);for(var d=[],a=0;a<f.length;a++){var e=
f[a],b=/\\(\d+)/.exec(e);b?(e=h[b[1]]||"",d.push(g?l.escape(e):e)):d.push(e)}return RegExp(d.join(""))},groupify:function(f,h){for(var g=f.source,d=g.length,a=[],e=0,b=[],k=1,l=1,m=[],n={},y={},r=0;r<d;r++){var x=a[a.length-1],u=g.charAt(r);switch(u){case "(":4===x&&(a.pop(),m.push(")"),b[b.length-1].end=r);var w=r+2<d?g.charAt(r+1)+""+g.charAt(r+2):null;if("?:"===w||"?\x3d"===w||"?!"===w){var z;"?:"===w?z=1:(z=3,e++);a.push(z);b.push({start:r,end:-1,type:z});m.push(u);m.push(w);r+=w.length}else a.push(2),
b.push({start:r,end:-1,type:2,oldNum:k,num:l}),m.push(u),0===e&&(y[l]=null),n[k]=l,k++,l++;break;case ")":x=a.pop();3===x&&e--;b[b.length-1].end=r;m.push(u);break;case "*":case "+":case "?":case "}":var B=u,v=g.charAt(r-1),w=r-1;if("}"===u){for(z=r-1;"{"!==g.charAt(z)&&0<=z;z--);v=g.charAt(z-1);w=z-1;B=g.substring(z,r+1)}z=b[b.length-1];if(")"===v&&(2===z.type||4===z.type)){m.splice(z.start,0,"(");m.push(B);m.push(")");u={start:z.start,end:m.length-1,type:4,num:z.num};for(v=0;v<b.length;v++)if(x=
b[v],(2===x.type||4===x.type)&&x.start>=z.start&&x.end<=w)x.start+=1,x.end+=1,x.num+=1,2===x.type&&(n[x.oldNum]=x.num);b.push(u);l++;break}default:"|"!==u&&(2!==x&&4!==x)&&0===e&&(a.push(4),b.push({start:r,end:-1,type:4,num:l}),m.push("("),y[l]=null,l++),m.push(u),"\\"===u&&(u=g.charAt(r+1),m.push(u),r+=1)}}for(;a.length;)a.pop(),m.push(")");g=RegExp(m.join(""));d={};h=h||n;for(var A in h)h.hasOwnProperty(A)&&(d[A]="\\"+h[A]);g=this.getSubstitutedRegex(g,d,!1);return[g,n,y]},complexCaptures:function(f){if(!f)return!1;
for(var h in f)if(f.hasOwnProperty(h)&&"0"!==h)return!0;return!1}};m.prototype={initialize:function(f){this.textView=f;this.textView.stylerOptions=this;var h=this;this._listener={onModelChanged:function(g){h.onModelChanged(g)},onDestroy:function(g){h.onDestroy(g)},onLineStyle:function(g){h.onLineStyle(g)},onStorage:function(g){h.onStorage(g)}};f.addEventListener("ModelChanged",this._listener.onModelChanged);f.addEventListener("Destroy",this._listener.onDestroy);f.addEventListener("LineStyle",this._listener.onLineStyle);
f.redrawLines()},onDestroy:function(f){this.destroy()},destroy:function(){this.textView&&(this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged),this.textView.removeEventListener("Destroy",this._listener.onDestroy),this.textView.removeEventListener("LineStyle",this._listener.onLineStyle),this.textView=null);this._listener=this._tree=this._styles=this.grammar=null},preprocess:function(f){for(f=[f];0!==f.length;){var h=f.pop();if(!h._resolvedRule||!h._typedRule)if(h._resolvedRule=
this._resolve(h),h._typedRule=this._createTypedRule(h),this.addStyles(h.name),this.addStyles(h.contentName),this.addStylesForCaptures(h.captures),this.addStylesForCaptures(h.beginCaptures),this.addStylesForCaptures(h.endCaptures),h._resolvedRule!==h&&f.push(h._resolvedRule),h.patterns)for(var g=0;g<h.patterns.length;g++)f.push(h.patterns[g])}},addStyles:function(f){if(f&&!this._styles[f]){this._styles[f]=[];for(var h=f.split("."),g=0;g<h.length;g++)this._styles[f].push(h.slice(0,g+1).join("-"))}},
addStylesForCaptures:function(f){for(var h in f)f.hasOwnProperty(h)&&this.addStyles(f[h].name)},ContainerRule:function(){function f(f){this.rule=f;this.subrules=f.patterns}f.prototype.valueOf=function(){return"aa"};return f}(),BeginEndRule:function(){function f(f){this.rule=f;this.beginRegex=k.toRegExp(f.begin);this.endRegex=k.toRegExp(f.end);this.subrules=f.patterns||[];this.endRegexHasBackRef=k.hasBackReference(this.endRegex);var g=k.complexCaptures(f.captures);f=k.complexCaptures(f.beginCaptures)||
k.complexCaptures(f.endCaptures);if(this.isComplex=g||f)g=k.groupify(this.beginRegex),this.beginRegex=g[0],this.beginOld2New=g[1],this.beginConsuming=g[2],g=k.groupify(this.endRegex,this.beginOld2New),this.endRegex=g[0],this.endOld2New=g[1],this.endConsuming=g[2]}f.prototype.valueOf=function(){return this.beginRegex};return f}(),MatchRule:function(){function f(f){this.rule=f;this.matchRegex=k.toRegExp(f.match);if(this.isComplex=k.complexCaptures(f.captures))f=k.groupify(this.matchRegex),this.matchRegex=
f[0],this.matchOld2New=f[1],this.matchConsuming=f[2]}f.prototype.valueOf=function(){return this.matchRegex};return f}(),_createTypedRule:function(f){return f.match?new this.MatchRule(f):f.begin?new this.BeginEndRule(f):new this.ContainerRule(f)},_resolve:function(f){var h=f;if(f.include){if(f.begin||f.end||f.match)throw Error('Unexpected regex pattern in "include" rule '+f.include);f=f.include;if("#"===f.charAt(0)){if(h=this.grammar.repository&&this.grammar.repository[f.substring(1)],!h)throw Error("Couldn't find included rule "+
f+" in grammar repository");}else if("$self"===f)h=this.grammar;else{if("$base"===f)throw Error('Include "$base" is not supported');h=this._allGrammars[f];if(!h)for(var g=0;g<this.externalGrammars.length;g++){var d=this.externalGrammars[g];if(d.scopeName===f){this.preprocess(d);h=this._allGrammars[f]=d;break}}}}return h},ContainerNode:function(){function f(f,g){this.parent=f;this.rule=g;this.children=[];this.end=this.start=null}f.prototype.addChild=function(f){this.children.push(f)};f.prototype.valueOf=
function(){var f=this.rule;return"ContainerNode { "+(f.include||"")+" "+(f.name||"")+(f.comment||"")+"}"};return f}(),BeginEndNode:function(){function f(f,g,d){this.parent=f;this.rule=g;this.children=[];this.setStart(d);this.endMatch=this.end=null;this.endRegexSubstituted=g.endRegexHasBackRef?k.getSubstitutedRegex(g.endRegex,d):null}f.prototype.addChild=function(f){this.children.push(f)};f.prototype.getIndexInParent=function(f){return this.parent?this.parent.children.indexOf(this):-1};f.prototype.setStart=
function(f){this.start=f.index;this.beginMatch=f};f.prototype.setEnd=function(f){f&&"object"===typeof f?(this.endMatch=f,this.end=f.index+f[0].length):(this.endMatch=null,this.end=f)};f.prototype.shiftStart=function(f){this.start+=f;this.beginMatch.index+=f};f.prototype.shiftEnd=function(f){this.end+=f;this.endMatch&&(this.endMatch.index+=f)};f.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range\x3d"+this.start+".."+this.end+"}"};return f}(),push:function(f,h){if(h)for(var g=h.length;0<
g;)f.push(h[--g])},exec:function(f,h,g){if(h=f.exec(h))h.index+=g;f.lastIndex=0;return h},afterMatch:function(f){return f.index+f[0].length},getEndMatch:function(f,h,g){if(f instanceof this.BeginEndNode){var d=f.rule;f=f.endRegexSubstituted||d.endRegex;return!f?null:this.exec(f,h,g)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,!1,0)},onModelChanged:function(f){var h=f.addedCharCount,
g=f.removedCharCount;f=f.start;if(this._tree){var d=this.textView.getModel(),a=d.getCharCount(),d=d.getLineEnd(d.getLineAtOffset(f)-1),e=this.getFirstDamaged(d,d),d=-1===d?0:d,h=e?this.parse(e,!0,d,f,h,g):a;this.textView.redrawRange(d,h)}else this.initialParse()},getFirstDamaged:function(f,h){if(0>f)return this._tree;for(var g=[this._tree],d=null;g.length;){var a=g.pop();if(!a.parent||this.isDamaged(a,f,h)){a instanceof this.BeginEndNode&&(d=a);for(var e=0;e<a.children.length;e++)g.push(a.children[e])}}return d||
this._tree},isDamaged:function(f,h,g){return f.start<=g&&f.end>h},parse:function(f,h,g,d,a,e){var b=this.textView.getModel(),k=b.getLineStart(b.getLineCount()-1),l=b.getCharCount(),m=this.getInitialExpected(f,g),n=-1;h&&(f.repaired=!0,f.endNeedsUpdate=!0,n=(n=f.children[f.children.length-1])?b.getLineEnd(b.getLineAtOffset(n.end+(a-e))):-1,d=b.getLineEnd(b.getLineAtOffset(d+e)),n=Math.max(n,d));n=-1===n?l:n;d=m;for(var y=f,r=!1,x=g,u=-1;y&&(!h||x<n);){var w=this.getNextMatch(b,y,x);w||(x=x>=k?l:b.getLineStart(b.getLineAtOffset(x)+
1));var z=w&&w.match,B=w&&w.rule,v=w&&w.isEnd;if(w&&w.isSub)x=this.afterMatch(z),B instanceof this.BeginEndRule&&(r=!0,h&&B===d.rule&&y===d.parent?(y=d,y.setStart(z),y.repaired=!0,y.endNeedsUpdate=!0,d=this.getNextExpected(d,"begin")):(h&&(this.prune(y,d),h=!1),z=new this.BeginEndNode(y,B,z),y.addChild(z),y=z));else if(v||x===l)y instanceof this.BeginEndNode&&(z?(r=!0,u=Math.max(u,y.end),y.setEnd(z),x=this.afterMatch(z),h&&y===d&&y.parent===d.parent?(y.repaired=!0,delete y.endNeedsUpdate,d=this.getNextExpected(d,
"end")):h&&(this.prune(y,d),h=!1)):(y.setEnd(l),delete y.endNeedsUpdate)),y=y.parent;h&&(x>=n&&!r)&&(this.prune(f,m),h=!1)}this.removeUnrepairedChildren(f,h,g);this.cleanup(h,f,g,n,l,a,e);return h?Math.max(u,x):x},removeUnrepairedChildren:function(f,h,g){if(h){h=f.children;for(var d=-1,a=0;a<h.length;a++){var e=h[a];if(!e.repaired&&this.isDamaged(e,g,Number.MAX_VALUE)){d=a;break}}-1!==d&&(f.children.length=d)}},cleanup:function(f,h,g,d,a,e,b){if(f){f=e-b;a=this.getIntersecting(d-f+1,a);h=this.getIntersecting(g,
d);for(g=0;g<a.length;g++)d=a[g],!d.repaired&&d instanceof this.BeginEndNode&&(d.shiftEnd(f),d.shiftStart(f));for(g=0;g<h.length;g++)d=h[g],d.repaired&&d.endNeedsUpdate&&d.shiftEnd(f),delete d.endNeedsUpdate,delete d.repaired}else{h=this.getIntersecting(g,d);for(g=0;g<h.length;g++)delete h[g].repaired}},getNextMatch:function(f,h,g,d){var a=f.getLineAtOffset(g),a=f.getLineEnd(a),e=f.getText(g,a),b=[],k=[];f=[];a=[];for(this.push(b,h.rule.subrules);b.length;){var l=b.length?b.pop():null,l=l&&l._resolvedRule._typedRule;
if(l instanceof this.ContainerRule&&-1===k.indexOf(l))k.push(l),this.push(b,l.subrules);else if(!l||!d||l.matchRegex){var m=l&&this.exec(l.matchRegex||l.beginRegex,e,g);m&&(f.push(m),a.push(l))}}b=Number.MAX_VALUE;k=-1;for(l=0;l<f.length;l++)m=f[l],m.index<b&&(b=m.index,k=l);if(!d&&(g=this.getEndMatch(h,e,g)))if(d=h.rule.applyEndPatternLast,-1===k||g.index<b||!d&&g.index===b)return{isEnd:!0,rule:h.rule,match:g};return-1===k?null:{isSub:!0,rule:a[k],match:f[k]}},getInitialExpected:function(f,h){var g,
d;if(f===this._tree)for(g=0;g<f.children.length;g++){if(d=f.children[g],d.start>=h)return d}else if(f instanceof this.BeginEndNode&&f.endMatch){var a=f.endMatch.index;for(g=0;g<f.children.length&&!(d=f.children[g],d.start>=h);g++);if(d&&d.start<a)return d}return f},getNextExpected:function(f,h){if("begin"===h){var g=f.children[0];return g?g:f}if("end"===h&&(g=f.parent)){var d=g.children[g.children.indexOf(f)+1];return d?d:g}return null},prune:function(f,h){h.parent===f?f.children.length=h.getIndexInParent():
f instanceof this.BeginEndNode&&(f.endMatch=null,f.end=null);f.parent&&(f.parent.children.length=f.getIndexInParent()+1)},onLineStyle:function(f){this._tree||this.initialParse();var h=f.lineStart,g=this.textView.getModel(),d=g.getLineEnd(f.lineIndex),a=g.getLineEnd(g.getLineAtOffset(h)-1),a=this.getFirstDamaged(a,a),h=this.getLineScope(g,a,h,d);f.ranges=this.toStyleRanges(h);f.ranges.sort(function(a,b){return a.start-b.start})},getLineScope:function(f,h,g,d){for(var a=g,e=this.getInitialExpected(h,
g),b=[],k=[];h&&a<d;){var l=this.getNextMatch(f,h,a);if(!l)break;var m=l&&l.match,n=l&&l.rule,y=l&&l.isSub,l=l&&l.isEnd;m.index!==a&&k.push({start:a,end:m.index,node:h});y?(a=this.afterMatch(m),n instanceof this.BeginEndRule?(this.addBeginScope(b,m,n),h=e,e=this.getNextExpected(e,"begin")):this.addMatchScope(b,m,n)):l&&(a=this.afterMatch(m),this.addEndScope(b,m,n),e=this.getNextExpected(e,"end"),h=h.parent)}a<d&&k.push({start:a,end:d,node:h});f=this.getInheritedLineScope(k,g,d);return b.concat(f)},
getInheritedLineScope:function(f,h,g){h=[];for(g=0;g<f.length;g++)for(var d=f[g],a=d.node;a;){var e=a.rule.rule,b=e.name;if(e=e.contentName||b){this.addScopeRange(h,d.start,d.end,e);break}a=a.parent}return h},addBeginScope:function(f,h,g){var d=g.rule;this.addCapturesScope(f,h,d.beginCaptures||d.captures,g.isComplex,g.beginOld2New,g.beginConsuming)},addEndScope:function(f,h,g){var d=g.rule;this.addCapturesScope(f,h,d.endCaptures||d.captures,g.isComplex,g.endOld2New,g.endConsuming)},addMatchScope:function(f,
h,g){var d=g.rule,a=d.name;(d=d.captures)?this.addCapturesScope(f,h,d,g.isComplex,g.matchOld2New,g.matchConsuming):this.addScope(f,h,a)},addScope:function(f,h,g){g&&f.push({start:h.index,end:this.afterMatch(h),scope:g})},addScopeRange:function(f,h,g,d){d&&f.push({start:h,end:g,scope:d})},addCapturesScope:function(f,h,g,d,a,e){if(g)if(d){d={1:0};for(var b=0,k=1;void 0!==h[k];k++)void 0!==e[k]&&(b+=h[k].length),void 0!==h[k+1]&&(d[k+1]=b);e=h.index;for(b=1;g[b];b++){var k=g[b].name,l=a[b],m=e+d[l];
"undefined"!==typeof h[l]&&this.addScopeRange(f,m,m+h[l].length,k)}}else this.addScope(f,h,g[0]&&g[0].name)},getIntersecting:function(f,h){for(var g=[],d=this._tree?[this._tree]:[];d.length;){var a=d.pop(),e=!1;a instanceof this.ContainerNode?e=!0:this.isDamaged(a,f,h)&&(e=!0,g.push(a));if(e)for(var e=a.children.length,b=0;b<e;b++)d.push(a.children[b])}return g.reverse()},toStyleRanges:function(f){for(var h=[],g=0;g<f.length;g++){var d=f[g],a=this._styles[d.scope];if(!a)throw Error("styles not found for "+
d.scope);a=a.join(" ");h.push({start:d.start,end:d.end,style:{styleClass:a}})}return h}};return{RegexUtil:k,TextMateStyler:m}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(l,n){function m(g){return-1!==g.getProperty("objectClass").indexOf(f)&&"highlighter"===g.getProperty("type")}function k(g,d,a){this.initialize(g,d,a);this.lineStyles=[]}var f="orion.edit.highlighter",h=f+" service must be an event emitter";n.AnnotationType.registerType("orion.annotation.highlightError",{title:l.syntaxError,html:"\x3cdiv class\x3d'annotationHTML error'\x3e\x3c/div\x3e",rangeStyle:{styleClass:"annotationRange error"}});
k.prototype={initialize:function(g,d,a){this.textView=g;this.serviceRegistry=d;this.annotationModel=a;this.services=[];var e=this;this.listener={onModelChanging:function(a){e.onModelChanging(a)},onModelChanged:function(a){e.onModelChanged(a)},onDestroy:function(a){e.onDestroy(a)},onLineStyle:function(a){e.onLineStyle(a)},onStyleReady:function(a){e.onStyleReady(a)},onServiceAdded:function(a){e.onServiceAdded(a.serviceReference,e.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){e.onServiceRemoved(a.serviceReference,
e.serviceRegistry.getService(a.serviceReference))}};g.addEventListener("ModelChanging",this.listener.onModelChanging);g.addEventListener("ModelChanged",this.listener.onModelChanged);g.addEventListener("Destroy",this.listener.onDestroy);g.addEventListener("LineStyle",this.listener.onLineStyle);d.addEventListener("registered",this.listener.onServiceAdded);d.addEventListener("unregistering",this.listener.onServiceRemoved);g=d.getServiceReferences(f);for(a=0;a<g.length;a++){var b=g[a];m(b)&&this.addServiceListener(d.getService(b))}},
onDestroy:function(g){this.destroy()},destroy:function(){this.textView&&(this.textView.removeEventListener("ModelChanging",this.listener.onModelChanging),this.textView.removeEventListener("ModelChanged",this.listener.onModelChanged),this.textView.removeEventListener("Destroy",this.listener.onDestroy),this.textView.removeEventListener("LineStyle",this.listener.onLineStyle),this.textView=null);if(this.services){for(var g=0;g<this.services.length;g++)this.removeServiceListener(this.services[g]);this.services=
null}this.serviceRegistry&&(this.serviceRegistry.removeEventListener("registered",this.listener.onServiceAdded),this.serviceRegistry.removeEventListener("unregistering",this.listener.onServiceRemoved),this.serviceRegistry=null);this.lineStyles=this.listener=null},onModelChanging:function(g){this.startLine=this.textView.getModel().getLineAtOffset(g.start)},onModelChanged:function(g){var d=this.startLine;(g.addedLineCount||g.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[d,g.removedLineCount].concat(this._getEmptyStyle(g.addedLineCount)))},
onStyleReady:function(g){var d=g.lineStyles||g.style;g=Number.MAX_VALUE;var a=-1,e=this.textView.getModel(),b;for(b in d)Object.prototype.hasOwnProperty.call(d,b)&&(this.lineStyles[b]=d[b],g=Math.min(g,b),a=Math.max(a,b));g=Math.max(g,0);a=Math.min(a,e.getLineCount());if(d=this.annotationModel){for(var f=d.getAnnotations(e.getLineStart(g),e.getLineEnd(a)),h=[];f.hasNext();){var k=f.next();"orion.annotation.highlightError"===k.type&&h.push(k)}f=[];for(k=g;k<=a;k++){b=k;var l=this.lineStyles[b],l=l&&
l.errors;b=e.getLineStart(b);if(l)for(var m=0;m<l.length;m++){var r=l[m];f.push(n.AnnotationType.createAnnotation("orion.annotation.highlightError",r.start+b,r.end+b))}}d.replaceAnnotations(h,f)}this.textView.redrawLines(g,a+1)},onLineStyle:function(g){var d=this.lineStyles[g.lineIndex];if(d)if(d.ranges){for(var d=d.ranges,a=g.lineStart,e=d.length,b=[],f=0;f<e;f++){var h=d[f];b.push({start:h.start+a,end:h.end+a,style:h.style})}g.ranges=b}else d.style&&(g.style=d.style)},_getEmptyStyle:function(g){for(var d=
[],a=0;a<g;a++)d.push(null);return d},setContentType:function(g){this.contentType=g;if(this.services)for(g=0;g<this.services.length;g++){var d=this.services[g];if(d.setContentType){var a=this.serviceRegistry.getService("orion.page.progress");a?a.progress(d.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):d.setContentType(this.contentType)}}},onServiceAdded:function(g,d){m(g)&&this.addServiceListener(d)},onServiceRemoved:function(g,
d){-1!==this.services.indexOf(d)&&this.removeServiceListener(d)},addServiceListener:function(g){if("function"===typeof g.addEventListener){if(g.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(g),g.setContentType&&this.contentType){var d=this.serviceRegistry.getService("orion.page.progress");d?d.progress(g.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):g.setContentType(this.contentType)}}else"undefined"!==
typeof console&&console.log(Error(h))},removeServiceListener:function(g){"function"===typeof g.removeEventListener?(g.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),g=this.services.indexOf(g),-1!==g&&this.services.splice(g,1)):"undefined"!==typeof console&&console.log(Error(h))}};return k});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(l,n,m,k,f){function h(a,e,b,g,h,t,s){function y(a,d){var g=a.getProperty("contentType")||a.getProperty("contentTypes"),h=a.getProperty("fileTypes");return g?f.when(e.isSomeExtensionOf(b,g)).then(function(b){return b?a:null}):d&&h&&-1!==h.indexOf(d)?(g=new f,g.resolve(a),g):null}function r(a){var b=null;switch(a&&a.id){case "application/javascript":case "application/json":b=
new l.TextStyler(g,"js",h);break;case "text/x-java-source":b=new l.TextStyler(g,"java",h);break;case "text/css":b=new l.TextStyler(g,"css",h)}return b}if(!d){var x=r(b);if(x)return t=new f,t.resolve(x),t}d&&!this.orionGrammars&&(this.orionGrammars={});x=t&&t.split(".").pop().toLowerCase();t=a.getServiceReferences("orion.edit.highlighter");for(var u=[],w=[],z=0;z<t.length;z++){var B=t[z],v=B.getProperty("type");"grammar"===v||!d&&"undefined"===typeof v?u.push(B.getProperty("grammar")):"highlighter"!==
v&&(v=B.getProperty("id"))&&!this.orionGrammars[v]&&(this.orionGrammars[v]={id:v,contentTypes:B.getProperty("contentTypes"),patterns:B.getProperty("patterns"),repository:B.getProperty("repository")});(B=y(B,x))&&w.push(B)}return f.all(w,function(a){return{_error:a}}).then(function(e){for(var f,l=e.length-1;0<=l;l--){var t=e[l];if(t&&!t._error&&(s||"highlighter"!==t.getProperty("type"))){f=t;break}}var w;if(f)if(e=f.getProperty("type"),"highlighter"===e)w=new k(g,a,h),w.setContentType(b);else if("grammar"===
e||!d&&"undefined"===typeof e)f=f.getProperty("grammar"),w=new m.TextMateStyler(g,f,u);else if(d){w=[];for(var r in this.orionGrammars)w.push(this.orionGrammars[r]);f=new n.createPatternBasedAdapter(w,f.getProperty("id"));w=new n.TextStyler(g,h,f)}return w})}function g(a,d){this.serviceRegistry=a;this.contentTypeService=d;this.styler=null}var d=1;g.prototype={setup:function(a,d,b,g,f){f="undefined"===typeof f?!0:f;this.styler&&(this.styler.destroy&&this.styler.destroy(),this.styler=null);var k=this;
return h(this.serviceRegistry,this.contentTypeService?this.contentTypeService:this.serviceRegistry.getService("orion.core.contentTypeRegistry"),a,d,b,g,f).then(function(a){return k.styler=a})},getStyler:function(){return this.styler}};return{createStyler:h,SyntaxHighlighter:g}});
define("orion/inputCompletion/inputCompletion",["orion/EventTarget"],function(l){function n(m,k,f){l.attach(this);this._binderFunc=k;this.setInputField(m);(m=f?f.group:null)||(m=this._inputField&&this._inputField.id?this._inputField.id:"default__input__group");this._completionIdPrefix=m+"__completion__";this._proposeFromStart=f?f.proposeFromStart:!1;this._extendedProvider=f?f.extendedProvider:null;this._serviceRegistry=f?f.serviceRegistry:null;this._onDelete=f?f.onDelete:null;this._deleteToolTips=
f?f.deleteToolTips:"";this._proposalIndex=-1;this._dismissed=!0;this._mouseDown=!1;this._dataList=[];this._initUI();this._listeners=[];f=function(f){this._binderFunc&&this._binderFunc(function(g){this._bind(g);f.deleting&&(this._proposeOn(this._inputField.value),this._selectProposal(this._proposalIndex,!0))}.bind(this))}.bind(this);this.addEventListener("inputDataListChanged",f);this._listeners.push({evtTarget:this,type:"inputDataListChanged",handler:f});f=function(f){this._mouseDown=!0}.bind(this);
this._completionUIContainer.addEventListener("mousedown",f);this._listeners.push({evtTarget:this._completionUIContainer,type:"mousedown",handler:f});f=function(f){this._mouseDown=!1}.bind(this);this._completionUIContainer.addEventListener("mouseup",f);this._listeners.push({evtTarget:this._completionUIContainer,type:"mouseup",handler:f})}n.prototype._removeListeners=function(l){l&&l.forEach(function(k){k.evtTarget.removeEventListener(k.type,k.handler,!1)})};n.prototype.destroy=function(){this._removeListeners(this._inputFieldListeners);
this._removeListeners(this.listeners)};n.prototype.hasValueOf=function(l){return this._dataList.some(function(k){return k.value===l})};n.prototype.setInputField=function(l){this._inputField&&this._inputFieldListeners&&this._removeListeners(this._inputFieldListeners);this._inputFieldListeners=[];this._inputField=l;"string"===typeof this._inputField&&(this._inputField=document.getElementById(this._inputField));l=function(k){this._mouseDown?window.setTimeout(function(){this._inputField.focus()}.bind(this),
200):document.activeElement!==this._inputField&&this._dismiss()}.bind(this);this._inputField.addEventListener("blur",l);this._inputFieldListeners.push({evtTarget:this._inputField,type:"blur",handler:l});l=function(k){this.onKeyDown(k)}.bind(this);this._inputField.addEventListener("keydown",l);this._inputFieldListeners.push({evtTarget:this._inputField,type:"keydown",handler:l});l=function(k){this._proposeOn(this._inputField.value)}.bind(this);this._inputField.addEventListener("input",l);this._inputFieldListeners.push({evtTarget:this._inputField,
type:"input",handler:l});l=function(k){this._dismissed&&this._binderFunc&&(this._dismissing?this._dismissing=!1:this._binderFunc&&this._binderFunc(function(f){this._bind(f)}.bind(this)))}.bind(this);this._inputField.addEventListener("focus",l);this._inputFieldListeners.push({evtTarget:this._inputField,type:"focus",handler:l})};n.prototype.onKeyDown=function(l){if(this._dismissed)return!0;var k=l.charCode||l.keyCode;if(13===k){if(this._proposalList&&0<this._proposalList.length&&0<=this._proposalIndex&&
this._proposalIndex<this._proposalList.length)return l.preventDefault(),this._dismiss(this._proposalList[this._proposalIndex].item.value,l.ctrlKey),l.stopPropagation(),!1}else{if((40===k||38===k)&&this._proposalList&&0<this._proposalList.length)return l.preventDefault(),this._walk(40===k),l.stopPropagation(),!1;if(27===k)return l.preventDefault(),this._dismiss(),!1;if(46===k&&-1<this._proposalIndex&&this._onDelete)return l.preventDefault(),this._onDelete(this._proposalList[this._proposalIndex].item.value,
this),this._resetIndexAfterDeletion(),l.stopPropagation(),!1}return!0};n.prototype._resetIndexAfterDeletion=function(){1>=this._proposalList.length?this._proposalIndex=-1:this._proposalIndex===this._proposalList.length-1&&(this._proposalIndex=this._proposalList.length-2)};n.prototype._bind=function(l){this._dataList=l};n.prototype._getUIContainerID=function(){return this._completionIdPrefix+"UIContainer"};n.prototype._getUIProposalListId=function(){return this._completionIdPrefix+"UIProposalList"};
n.prototype._initUI=function(){this._completionUIContainer=document.getElementById(this._getUIContainerID());this._completionUIContainer||(this._completionUIContainer=document.createElement("div"),this._completionUIContainer.id=this._getUIContainerID(),this._completionUIContainer.style.display="none",this._completionUIContainer.className="inputCompletionContainer",this._completionUIContainer.setAttribute("role","list"),this._completionUIContainer.setAttribute("aria-atomic","true"),this._completionUIContainer.setAttribute("aria-live",
"assertive"),document.body.appendChild(this._completionUIContainer));this._completionUIContainer.textContent="";this._completionUL=document.getElementById(this._getUIProposalListId());this._completionUL||(this._completionUL=document.createElement("ul"),this._completionUL.id=this._getUIProposalListId(),this._completionUL.className="inputCompletionUL");this._completionUL.textContent="";this._completionUIContainer.appendChild(this._completionUL)};n.prototype._createProposalLink=function(l,k,f,h){var g=
document.createElement("a");g.href=require.toUrl(k);g.appendChild(this._createBoldText(l,f,h));return g};n.prototype._createBoldText=function(l,k,f,h){if(0>k)return document.createTextNode(l);h=h?h:document.createElement("span");var g;0!==k&&(g=document.createTextNode(l.substring(0,k)),h.appendChild(g));var d=document.createElement("b");h.appendChild(d);g=document.createTextNode(l.substring(k,k+f));d.appendChild(g);k+f<l.length&&(g=document.createTextNode(l.substring(k+f)),h.appendChild(g));return h};
n.prototype._proposeOnCategory=function(l,k){if(0!==k.length){var f;if(l){f=document.createElement("li");f.className="inputCompletionLICategory";var h=document.createTextNode(l);f.appendChild(h);this._completionUL.appendChild(f)}k.forEach(function(g){f=document.createElement("li");f.onmouseover=function(a){this._selectProposal(a.currentTarget)}.bind(this);f.onclick=function(a){this._dismiss(a.currentTarget.completionItem.value)}.bind(this);f.className="inputCompletionLINormal";f.completionItem=g.item;
var d;if("string"===typeof g.item.value){var a=document.createElement("table");a.style.width="100%";a.style.tableLayout="fixed";a.style.borderSpacing="0";var e=document.createElement("tr");e.style.width=this._inputField.offsetWidth+"px";a.appendChild(e);var b=document.createElement("td");b.classList.add("inputCompletionLILeftTD");var h=this._createBoldText(g.item.value,g.boldIndex,g.boldLength);b.appendChild(h);b.style.overflow="hidden";e.appendChild(b);this._onDelete&&(d=document.createElement("button"),
d.classList.add("inputCompletionDismissButton"),d.classList.add("layoutRight"),d.classList.add("core-sprite-close"),d.classList.add("imageSprite"),d.style.display="none",d.style.margin="0 0 0",d.title=this._deleteToolTips,d.onclick=function(a){a.stopPropagation();this._onDelete(g.item.value,this);this._resetIndexAfterDeletion()}.bind(this),b=document.createElement("td"),b.classList.add("inputCompletionLIRightTD"),b.appendChild(d),e.appendChild(b));f.appendChild(a)}else g.item.value.name&&"link"===
g.item.value.type&&f.appendChild(this._createProposalLink(g.item.value.name,g.item.value.value,g.boldIndex,g.boldLength));this._completionUL.appendChild(f);this._proposalList.push({item:g.item,domNode:f,deleteBtn:d})}.bind(this))}};n.prototype._domNode2Index=function(l){if(this._proposalList)for(var k=0;k<this._proposalList.length;k++)if(this._proposalList[k].domNode===l)return k;return-1};n.prototype._highlight=function(l,k){var f=l,h,g=!1;isNaN(f)||(g=!0,this._proposalList&&0<=l&&l<this._proposalList.length?
(f=this._proposalList[l].domNode,h=this._proposalList[l].deleteBtn):f=null);f&&(f.className=k?"inputCompletionLISelected":"inputCompletionLINormal",h&&(h.style.display=k?"":"none"),k&&g&&(f.offsetTop<this._completionUIContainer.scrollTop?f.scrollIntoView(!0):f.offsetTop+f.offsetHeight>this._completionUIContainer.scrollTop+this._completionUIContainer.clientHeight&&f.scrollIntoView(!1)))};n.prototype._selectProposal=function(l,k){var f=l;isNaN(f)&&(f=this._domNode2Index(l));if(f!==this._proposalIndex||
k)this._highlight(this._proposalIndex,!1),this._proposalIndex=f,this._highlight(this._proposalIndex,!0)};n.prototype._dismiss=function(l,k){this._mouseDown||(this._dismissed=!0,this._proposalList=null,this._proposalIndex=-1,"string"===typeof l?(this._inputField.value=l,this._dismissing=!0,this._inputField.focus()):l&&(l.name&&"link"===l.type)&&(k?window.open(l.value):window.location.href=l.value),this._completionUIContainer.style.display="none")};n.prototype._show=function(){if(this._proposalList&&
0<this._proposalList.length){for(var l=0,k=0,f=this._inputField;f;)l+=f.offsetLeft,k+=f.offsetTop,f=f.offsetParent;this._completionUIContainer.style.display="block";this._completionUIContainer.style.top=k+this._inputField.offsetHeight+2+"px";this._completionUIContainer.style.left=l+"px";this._completionUIContainer.style.width=this._inputField.offsetWidth+"px";this._dismissed=this._mouseDown=!1}else this._dismissed=!0,this._proposalList=null,this._proposalIndex=-1,this._completionUIContainer.style.display=
"none"};n.prototype._walk=function(l){l=this._proposalIndex+(l?1:-1);-1>l?l=this._proposalList.length-1:l>=this._proposalList.length&&(l=-1);this._selectProposal(l)};n.prototype._proposeOnList=function(l,k,f){var h="",g=[],d=k?k.length:0;l.forEach(function(a){if("category"===a.type)this._proposeOnCategory(h,g),h=a.label,g=[];else{var e=!0,b=-1;if(k&&f){var l;"string"===typeof a.value?l=a.value.toLowerCase():a.value.name&&(l=a.value.name.toLowerCase());b=l.indexOf(k);0>b?e=!1:this._proposeFromStart&&
(e=0===b)}e&&g.push({item:a,boldIndex:b,boldLength:d})}}.bind(this));this._proposeOnCategory(h,g)};n.prototype._proposeOn=function(l){this._completionUL.textContent="";var k=l?l.toLowerCase():null;this._proposalList=[];this._proposeOnList(this._dataList,k,!0);this._extendedProvider&&k?this._extendedProvider(l,function(f){f&&f.forEach(function(f){this._proposeOnList(f.proposals,f.filterForMe?k:l,f.filterForMe)}.bind(this));this._show()}.bind(this),[]):this._show()};n.prototype.constructor=n;return{InputCompletion:n}});
define("orion/searchAndReplace/textSearcher","i18n!orion/search/nls/messages orion/editor/find orion/commands orion/objects orion/searchUtils orion/inputCompletion/inputCompletion orion/webui/littlelib".split(" "),function(l,n,m,k,f,h,g){function d(a,d,b,g,f){n.Find.call(this,a,g,f);this._serviceRegistry=d;this._commandService=b}d.prototype=new n.Find;k.mixin(d.prototype,{getFindString:function(){var a=document.getElementById("localSearchFindWith");return!a?n.Find.prototype.getFindString.call(this):
a.value},getReplaceString:function(){var a=document.getElementById("localSearchReplaceWith");return!a?n.Find.prototype.getReplaceString(this):a.value},hide:function(){var a=this.isVisible();n.Find.prototype.hide.call(this);a&&this._commandService.closeParameterCollector()},show:function(a){n.Find.prototype.show.call(this,a);var d=a.findString;this._addRecentfind(d);a=a.replaceString;var b=document.getElementById("localSearchFindWith");b||(this._createActionTable(),b=document.getElementById("localSearchFindWith"));
d&&(b.value=d);a&&(document.getElementById("localSearchReplaceWith").value=a);window.setTimeout(function(){b.select();b.focus()},10)},_showReplaceInfo:function(){this._regex?(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAMQAAMzX6cbT5kh4qFiIuKC40FCIuGSXwmWZw2SaxGacxmadxmWcxbPM4GigyJW92JzC26DI0P///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAAHAAgAAAUmoEQUQkFI0PBEz5A2yII0w9AwkUPbRpTsjUNEQUsFIgCXiGSShAAAOw\x3d\x3d",this._replaceInfo.title=l["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 \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e."]):
(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAEAAACH5BAEAABIALAAAAAAHAAgAhwAAAAAAMwAAZgAAmQAAzAAA/wArAAArMwArZgArmQArzAAr/wBVAABVMwBVZgBVmQBVzABV/wCAAACAMwCAZgCAmQCAzACA/wCqAACqMwCqZgCqmQCqzACq/wDVAADVMwDVZgDVmQDVzADV/wD/AAD/MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMrADMrMzMrZjMrmTMrzDMr/zNVADNVMzNVZjNVmTNVzDNV/zOAADOAMzOAZjOAmTOAzDOA/zOqADOqMzOqZjOqmTOqzDOq/zPVADPVMzPVZjPVmTPVzDPV/zP/ADP/MzP/ZjP/mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YrAGYrM2YrZmYrmWYrzGYr/2ZVAGZVM2ZVZmZVmWZVzGZV/2aAAGaAM2aAZmaAmWaAzGaA/2aqAGaqM2aqZmaqmWaqzGaq/2bVAGbVM2bVZmbVmWbVzGbV/2b/AGb/M2b/Zmb/mWb/zGb//5kAAJkAM5kAZpkAmZkAzJkA/5krAJkrM5krZpkrmZkrzJkr/5lVAJlVM5lVZplVmZlVzJlV/5mAAJmAM5mAZpmAmZmAzJmA/5mqAJmqM5mqZpmqmZmqzJmq/5nVAJnVM5nVZpnVmZnVzJnV/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwAM8wAZswAmcwAzMwA/8wrAMwrM8wrZswrmcwrzMwr/8xVAMxVM8xVZsxVmcxVzMxV/8yAAMyAM8yAZsyAmcyAzMyA/8yqAMyqM8yqZsyqmcyqzMyq/8zVAMzVM8zVZszVmczVzMzV/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8Amf8AzP8A//8rAP8rM/8rZv8rmf8rzP8r//9VAP9VM/9VZv9Vmf9VzP9V//+AAP+AM/+AZv+Amf+AzP+A//+qAP+qM/+qZv+qmf+qzP+q///VAP/VM//VZv/Vmf/VzP/V////AP//M///Zv//mf//zP///wAAAAAAAAAAAAAAAAgsAPcpQzMJjbJ9xNAQQ6hwUqaHDws+3PeQoMN9DiUuzFRQ2ZiDyyYdHFhwYUAAOw\x3d\x3d",
this._replaceInfo.title=l["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 \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e."]);this._replaceInfo.style.display=""},_createActionTable:function(){var a=this;this._commandService.openParameterCollector("pageNavigationActions",function(d){var b=document.createElement("input");b.type="text";b.name=l["Find:"];b.className="parameterInput";b.id="localSearchFindWith";
b.placeholder=l["Find With"];b.oninput=function(b){return a._handleInput(b)};b.onkeydown=function(b){return a._handleKeyDown(b)};d.appendChild(b);a._initCompletion(b);a._createButton(l.Next,d,function(){a._addRecentfind(a.getFindString());a.find(!0)});a._createButton(l.Previous,d,function(){a._addRecentfind(a.getFindString());a.find(!1)});var g=a._editor.getTextView().getOptions("readonly");if(!g){var f=document.createElement("input");f.type="text";f.name=l["ReplaceWith:"];f.className="parameterInput";
f.id="localSearchReplaceWith";f.placeholder=l["Replace With"];f.onkeydown=function(b){return a._handleKeyDown(b)};d.appendChild(f);a._replaceInfo=a._createInfoImage(null,d,null);a._showReplaceInfo();a._createButton(l.Replace,d,function(){a.replace()});a._createButton(l["Replace All"],d,function(){a.replaceAll()})}f=document.createElement("div");d.appendChild(f);f.classList.add("findOptionsDiv");var h=m.createDropdownMenu(f,l.Options,null,"dismissButton",null,!0);h.menuButton.classList.add("parameterInlineButton");
m.createCheckedMenuItem(h.menu,l["Show all"],a._showAll,function(b){a.setOptions({showAll:b.target.checked});h.dropdown.close(!0)});m.createCheckedMenuItem(h.menu,l["Case sensitive"],!a._caseInsensitive,function(b){a.setOptions({caseInsensitive:!b.target.checked});h.dropdown.close(!0);a.find(!0)});m.createCheckedMenuItem(h.menu,l["Wrap search"],a._wrap,function(b){a.setOptions({wrap:b.target.checked});h.dropdown.close(!0)});m.createCheckedMenuItem(h.menu,l["Incremental search"],a._incremental,function(b){a.setOptions({incremental:b.target.checked});
h.dropdown.close(!0)});m.createCheckedMenuItem(h.menu,l["Whole Word"],a._wholeWord,function(b){a.setOptions({wholeWord:b.target.checked});h.dropdown.close(!0);a.find(!0)});a._regExBox=m.createCheckedMenuItem(h.menu,l["Regular expression"],a._regex,function(b){a.setOptions({regex:b.target.checked});h.dropdown.close(!0);a.find(!0);a._showReplaceInfo()});g||m.createCheckedMenuItem(h.menu,l["Find after replace"],a._findAfterReplace,function(b){a.setOptions({findAfterReplace:b.target.checked});h.dropdown.close(!0)});
return b},function(){a.hide()})},_storeRecentFind:function(a,d,b){this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(g){g.put("recentFind",a);d&&window.setTimeout(function(){d.dispatchEvent({type:"inputDataListChanged",deleting:b})}.bind(this),20)})},_addRecentfind:function(a){"string"===typeof a&&a&&(!this._completion||!this._completion.hasValueOf(a))&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(d){var b;
d=d.get("recentFind");"string"===typeof d&&(d=JSON.parse(d));if(d){for(b in d)if(d[b].name===a)return;30<=d.length&&d.splice(29,d.length-30+1)}else d=[];d.splice(0,0,{name:a});this._storeRecentFind(d,this._completion)}.bind(this))},_removeRecentSearch:function(a,d){"string"===typeof a&&a&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var g;b=b.get("recentFind");"string"===typeof b&&(b=JSON.parse(b));if(b)for(g in b)if(b[g].name===a){b.splice(g,
1);this._storeRecentFind(b,d,!0);break}}.bind(this))},_initCompletion:function(a){if(this._completion)this._completion.setInputField(a);else{var d=function(a){this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(d){d=d.get("recentFind");"string"===typeof d&&(d=JSON.parse(d));if(d){var e=[];d.forEach(function(a){e.push({type:"proposal",label:a.name,value:a.name})});a(e)}})}.bind(this);this._completion=new h.InputCompletion(a,d,{serviceRegistry:this._serviceRegistry,
group:"localSearch",onDelete:function(a,d){this._removeRecentSearch(a,d)}.bind(this),deleteToolTips:l["Click or use delete key to delete the search term"]})}},_createButton:function(a,d,b){var f=document.createElement("button");f.addEventListener("click",b.bind(this),!1);var h=this;f.addEventListener("keydown",function(a){a.keyCode===g.KEY.ESCAPE&&h.hide()});f.appendChild(document.createTextNode(a));f.className="dismissButton parameterInlineButton";d.appendChild(f)},_createInfoImage:function(a,d,
b){a=document.createElement("img");a.classList.add("replaceInfo");a.addEventListener("click",function(a){this._regExBox.checked=!this._regex;this.setOptions({regex:!this._regex});this.find(!0);this._showReplaceInfo()}.bind(this));d.appendChild(a);return a},_handleInput:function(a){this._incremental&&this.find(!0,null,!0);return!0},_handleKeyDown:function(a){var d=(this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&!a.shiftKey;return d&&70===a.keyCode?(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=
!0,!1):(this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&75===a.keyCode||13===a.keyCode?(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,this._addRecentfind(this.getFindString()),13===a.keyCode?this.find(this._reverse?a.shiftKey:!a.shiftKey):this.find(!a.shiftKey),!1):d&&82===a.keyCode?(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,this.replace(),!1):27===a.keyCode?(this.hide(),!1):!0}});return{TextSearcher:d}});
define("orion/edit/editorContext",[],function(){return{getEditorContext:function(l){var n=Object.create(null);l.getServiceReferences("orion.edit.context").forEach(function(m){var k=l.getService(m);Object.keys(k).forEach(function(f){"function"===typeof k[f]&&(n[f]=k[f].bind(k))})});return n},getOptions:function(l){var n=Object.create(null);l.getServiceReferences("orion.edit.context").forEach(function(l){l.getPropertyKeys().forEach(function(k){"service.id"!==k&&("service.names"!==k&&"objectClass"!==
k)&&(n[k]=l.getProperty(k))})});return n}}});
define("orion/blamer",["orion/extensionCommands","orion/PageLinks","orion/URITemplate","orion/edit/editorContext"],function(l,n,m,k){function f(f,g){for(var d=g.getFileMetadata(),a=f.getServiceReferences("orion.edit.blamer"),e=0;e<a.length;e++){var b=a[e],k={};k.validationProperties=b.getProperty("validationProperties");k.forceSingleItem=!0;k=l._makeValidator(k,f);if(k.validationFunction.bind(k)(d))return f.getService(b)}return null}return{isVisible:function(h,g){return!!f(h,g)&&!!h.getService("orion.core.blame")},
getBlame:function(h,g){var d=f(h,g);if(d){var a=function(a){for(var d=n.getOrionHome(),e=0;e<a.length;e++){var g=a[e],f=new m(g.CommitLink),k={};k.OrionHome=d;g.CommitLink=f.expand(k)}h.getService("orion.core.blame")._setAnnotations(a)};if(d.computeBlame){var e={metadata:g.getFileMetadata()};d.computeBlame(k.getEditorContext(h),e).then(a)}else d.doBlame(g.getInput()).then(a)}}}});
define("orion/editorCommands","i18n!orion/edit/nls/messages orion/i18nUtil orion/webui/littlelib orion/webui/dialogs/OpenResourceDialog orion/widgets/input/DropDownMenu orion/Deferred orion/URITemplate orion/commands orion/keyBinding orion/commandRegistry orion/extensionCommands orion/contentTypes orion/searchUtils orion/PageUtil orion/PageLinks orion/editor/annotations orion/blamer orion/regex orion/util orion/edit/editorContext".split(" "),function(l,n,m,k,f,h,g,d,a,e,b,p,q,t,s,y,r,x,u,w){function z(a){var b=
new g(a.uriTemplate),d=a.params||{};d.OrionHome=d.OrionHome||s.getOrionHome();var b=b.expand(d),e=document.createElement("div"),f=document.createElement("iframe");f.id=a.id;f.name=a.id;f.type="text/html";f.sandbox="allow-scripts allow-same-origin";f.frameborder=void 0!==a.border?a.border:1;f.src=b;f.className="delegatedUI";a.width&&(e.style.width=a.width,f.style.width=a.width);a.height&&(e.style.height=a.height,f.style.height=a.height);f.style.visibility="hidden";null!==a.parent&&(a.parent||window.document.body).appendChild(e);
e.appendChild(f);f.style.left=a.left||(window.innerWidth-parseInt(f.clientWidth,10))/2+"px";f.style.top=a.top||(window.innerHeight-parseInt(f.clientHeight,10))/2+"px";f.style.visibility="";window.addEventListener("message",function G(b){if(b.source===f.contentWindow&&"string"===typeof b.data&&(b=JSON.parse(b.data),"orion.page.delegatedUI"===b.pageService&&b.source===a.id)){if(b.cancelled)a.cancelled&&a.cancelled();else if(b.result)a.done&&a.done(b.result);else if(b.Status||b.status)a.status&&a.status(b.Status||
b.status);window.removeEventListener("message",G,!1);e.parentNode&&e.parentNode.removeChild(e)}},!1);return e}function B(a){this.serviceRegistry=a.serviceRegistry;this.commandService=a.commandRegistry;this.fileClient=a.fileClient;this.inputManager=a.inputManager;this.toolbarId=a.toolbarId;this.saveToolbarId=a.saveToolbarId;this.editToolbarId=a.editToolbarId;this.pageNavId=a.navToolbarId;this.isReadOnly=a.readonly;this._localSearcher=a.textSearcher;this._searcher=a.searcher;this.editorSettings=a.editorSettings;
this.localSettings=a.localSettings}var v={},A=null;v.createDelegatedUI=z;B.prototype={generateSimpleEditorCommands:function(a,b){this.isReadOnly||(this._generateUndoStackCommands(a),this._generateSaveCommand(a,b));this._generateSearchFilesCommand(a);this._generateGotoLineCommnand(a);this._generateFindCommnand(a)},generateEditorCommands:function(a){this.generateBaseEditorCommands(a);this.generateExtraEditorCommands(a)},generateBaseEditorCommands:function(a){this.isReadOnly||(this._generateUndoStackCommands(a),
this._generateSaveCommand(a),this._generateEditCommands(a))},generateExtraEditorCommands:function(a){this._generateSettingsCommand(a);this._generateSearchFilesCommand(a);this._generateGotoLineCommnand(a);this._generateFindCommnand(a);this._generateBlame(a)},_generateSettingsCommand:function(b){var e=this,g=new d.Command({imageClass:"core-sprite-wrench",tooltip:l.LocalEditorSettings,id:"orion.edit.settings",visibleWhen:function(){return b.installed},callback:function(a){var d=g.settingsDropDown;if(!d||
d.isDestroyed())d=g.settingsDropDown=new f(a.domNode.parentNode,a.domNode,{noClick:!0,selectionClass:"dropdownSelection",onShow:function(){d.focus()},onHide:function(){b.focus()}}),d.updateContent=e.localSettings.show.bind(e.localSettings),a=d.getContentNode(),a.tabIndex=a.style.marginTop=0;d.click()}});this.commandService.addCommand(g);this.commandService.registerCommandContribution("settingsActions","orion.edit.settings",1,null,!1,new a.KeyBinding("s",!0,!0))},_generateUndoStackCommands:function(b){var e=
new d.Command({name:l.Undo,id:"orion.undo",visibleWhen:function(){return b.installed},callback:function(a){b.getUndoStack().undo()}});this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.editToolbarId||this.toolbarId,"orion.undo",400,this.editToolbarId?"orion.menuBarEditGroup/orion.undoGroup":null,!this.editToolbarId,new a.KeyBinding("z",!0));e=new d.Command({name:l.Redo,id:"orion.redo",visibleWhen:function(){return b.installed},callback:function(a){b.getUndoStack().redo()}});
this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.editToolbarId||this.toolbarId,"orion.redo",401,this.editToolbarId?"orion.menuBarEditGroup/orion.undoGroup":null,!this.editToolbarId,u.isMac?new a.KeyBinding("z",!0,!0):new a.KeyBinding("y",!0))},_generateSearchFilesCommand:function(b){var e=this;if(e._searcher){var g=!1,f=new d.Command({name:l.searchFiles,tooltip:l.searchFiles,id:"orion.searchFiles",visibleWhen:function(){return b.installed},callback:function(a){if(!g){a=
b.getSelection();a=b.getText(a.start,a.end);var d=e.serviceRegistry.getService("orion.page.progress"),f=new k.OpenResourceDialog({searcher:e._searcher,progress:d,searchRenderer:e._searcher.defaultRenderer,nameSearch:!1,title:l.searchFiles,message:l.searchTerm,initialText:a,onHide:function(){g=!1;b.focus()}});window.setTimeout(function(){g=!0;f.show(m.node(e.toolbarId))},0)}}});this.commandService.addCommand(f);this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.searchFiles",
1,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new a.KeyBinding("h",!0))}},_generateSaveCommand:function(b,e){var g=this,f=e?e:"orion.save",h=new d.Command({name:l.Save,tooltip:l.saveFile,id:f,visibleWhen:function(){return!b.installed||g.inputManager.getReadOnly()?!1:!0},callback:function(a){g.inputManager.save();return!0}});this.commandService.addCommand(h);this.commandService.registerCommandContribution(this.saveToolbarId||this.toolbarId,f,1,this.saveToolbarId?
"orion.menuBarFileGroup/orion.saveGroup":null,!1,new a.KeyBinding("s",!0));b.getTextView&&b.getTextView()&&(b.getTextView().setKeyBinding(new a.KeyBinding("s",!0),"save"),b.getTextView().setAction("save",h.callback,h))},_generateGotoLineCommnand:function(b){var g=this,f=new e.ParametersDescription([new e.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var a=b.getModel().getLineAtOffset(b.getCaretOffset())+1;return[new e.CommandParameter("line","number","Line:",a.toString())]}),
f=new d.Command({name:l.gotoLine,tooltip:l.gotoLineTooltip,id:"orion.gotoLine",visibleWhen:function(){return b.installed},parameters:f,callback:function(a){var d=b.getModel();a.parameters&&a.parameters.valueFor("line")?a=a.parameters.valueFor("line"):(a=d.getLineAtOffset(b.getCaretOffset()),(a=prompt(l.gotoLinePrompt,a+1))&&(a=parseInt(a,10)));if(a)b.onGotoLine(a-1,0)}});this.commandService.addCommand(f);this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.gotoLine",
3,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new a.KeyBinding("l",!u.isMac,!1,!1,u.isMac),new e.URLBinding("gotoLine","line"));b.getTextView&&b.getTextView()&&b.getTextView().setAction("gotoLine",function(a){if(a)return b.onGotoLine(a.line-1,0,void 0,a.callback),!0;g.commandService.runCommand("orion.gotoLine");return!0},f)},_generateFindCommnand:function(b){var g=this,f=new e.ParametersDescription([new e.CommandParameter("find","text","Find:")],{clientCollect:!0},
function(){var a=b.getSelection(),d="";a.end>a.start&&(d=b.getModel().getText(a.start,a.end),g._localSearcher&&g._localSearcher.getOptions().regex&&(d=x.escape(d)));return[new e.CommandParameter("find","text","Find:",d)]}),f=new d.Command({name:l.Find,tooltip:l.Find,id:"orion.editor.find",visibleWhen:function(){return b.installed},parameters:f,callback:function(a){if(g._localSearcher){var d="",e=null,f=b.getSelection();f.end>f.start&&a.parameters.valueFor("useEditorSelection")?(d=b.getModel().getText(f.start,
f.end),g._localSearcher.getOptions().regex&&(d=x.escape(d))):a.parameters&&a.parameters.valueFor("find")&&(d=a.parameters.valueFor("find"),e=t.matchResourceParameters(),q.convertFindURLBinding(e));e?(g._localSearcher.setOptions({regex:e.regEx,caseInsensitive:!e.caseSensitive}),a={},e.atLine&&(a.start=b.getModel().getLineStart(e.atLine-1)),g._localSearcher.show({findString:d,replaceString:e.replaceWith}),g._localSearcher.find(!0,a)):g._localSearcher.show({findString:d});return!0}return!1}});this.commandService.addCommand(f);
this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.editor.find",0,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new a.KeyBinding("f",!0),new e.URLBinding("find","find"));b.getTextView&&b.getTextView()&&b.getTextView().setAction("find",function(a){if(a)return g._localSearcher.show(a),!0;g.commandService.runCommand("orion.editor.find",null,null,new e.ParametersDescription([new e.CommandParameter("useEditorSelection","text",
"","true")],{clientCollect:!0}));return!0},f)},_generateBlame:function(b){var g=this,f=new d.Command({name:l.Blame,tooltip:l.BlameTooltip,id:"orion.edit.blame",parameters:new e.ParametersDescription([new e.CommandParameter("blame","boolean")],{clientCollect:!0}),visibleWhen:function(){return!b.installed?!1:r.isVisible(g.serviceRegistry,g.inputManager)},callback:function(a){for(var d=!1,e=b.getAnnotationModel().getAnnotations();e.hasNext();)if(e.next().type===y.AnnotationType.ANNOTATION_BLAME){d=!0;
break}d=!d;a.parameters&&a.parameters.valueFor("blame")&&(d="true"===a.parameters.valueFor("blame"));d?r.getBlame(g.serviceRegistry,g.inputManager):b.showBlame([])}});this.commandService.addCommand(f);this.commandService.registerCommandContribution(this.toolbarId,"orion.edit.blame",1,"orion.menuBarToolsGroup",!1,new a.KeyBinding("b",!0,!0),new e.URLBinding("blame","blame"))},_generateEditCommands:function(e){function g(b){if(!b)return null;var d=new a.KeyBinding;a.KeyBinding.apply(d,b);return d}function f(a,
b){!b&&(a&&"undefined"!==typeof a.HTML)&&delete a.HTML;var d=k.serviceRegistry.getService("orion.page.message");d?d.setProgressResult(a):window.console.log(a)}var k=this,t=this.toolbarId,q=this.serviceRegistry,s=q.getServiceReferences("orion.edit.command"),r=this.inputManager,v=q.getService("orion.page.progress"),y=function(a,b,g){var h=g.visibleWhen;g.visibleWhen=function(a){return!e.installed||k.inputManager.getReadOnly()?!1:!h||h(a)};g.callback=function(d){e=this;var g=e.getSelection?e.getSelection():
{start:0,end:0};d=e.getModel();var h=function(a){"object"===typeof a&&a?(a.text&&e.setText(a.text),a.selection&&(e.setSelection&&e.setSelection(a.selection.start,a.selection.end,!0),e.focus())):"string"===typeof a&&(e.setText(a,g.start,g.end,!0),e.setSelection&&e.setSelection(g.start,g.start+a.length),e.focus())},k;b.execute?(d={contentType:r.getContentType(),input:r.getInput()},k=w.getEditorContext(q),k.openDelegatedUI=z,k.setStatus=f,d=b.execute(k,d),k=null):(d=b.run(d.getText(g.start,g.end),d.getText(),
g,r.getInput()),k=function(b){if(b&&b.uriTemplate){var d={};d.uriTemplate=b.uriTemplate;d.params=r.getFileMetadata();d.id=a.id;d.width=b.width;d.height=b.height;d.done=h;d.status=f;z(d)}else b&&(b.Status||b.status)?f(b.Status||b.status):h(b)});v.showWhile(d,n.formatMessage(l.running,a.name)).then(k);return!0};g.callback=g.callback.bind(e);return new d.Command(g)};h.when(function(a){if(A)return A;var b=a.getService("orion.core.contentTypeRegistry");b||(b=new p.ContentTypeRegistry(a),b=a.getService("orion.core.contentTypeRegistry"));
return b.getContentTypes().then(function(a){return A=a})}(this.serviceRegistry),function(){var a=[],d=100;s.forEach(function(f){var h=f.getProperty("editor");if(!h||!(e.id&&h!==e.id)){for(var l=k.serviceRegistry.getService(f),m={},h=f.getPropertyKeys(),n=0;n<h.length;n++)m[h[n]]=f.getProperty(h[n]);m.forceSingleItem=!0;f=b._createCommandOptions(m,f,k.serviceRegistry,A,!1,function(a){return r.getFileMetadata()});a.push(f);f.then(function(a){a=y(m,l,a);k.commandService.addCommand(a);k.commandService.registerCommandContribution(k.toolbarId,
a.id,d,"orion.menuBarToolsGroup",m.bindingOnly,g(m.key))});d++}});h.all(a,function(a){return{_error:a}}).then(function(a){if(a=r.getFileMetadata()){var b=m.node(t);b&&(k.commandService.destroy(b),k.commandService.renderCommands(b.id,b,a,e,"button"));if(b=m.node("pageNavigationActions"))k.commandService.destroy(b),k.commandService.renderCommands(b.id,b,e,e,"button")}})})}};v.EditorCommandFactory=B;return v});
define("orion/inputManager","i18n!orion/edit/nls/messages orion/explorers/navigatorRenderer orion/i18nUtil orion/Deferred orion/EventTarget orion/objects orion/PageUtil".split(" "),function(l,n,m,k,f,h,g){function d(a){this._document=a.document||document;this._timeout=a.timeout;a=["keypress","keydown","keyup"];for(var d=function(a){this._resetTimer()}.bind(this),e=0;e<a.length;e++)this._document.addEventListener(a[e],d,!0);f.attach(this)}function a(a,d){if(a){if(!d.Severity){var e=d,g={Severity:"Error",
Message:l.noResponse};if("Cancel"===e.name)d={Severity:"Warning",Message:e.name,Cancel:!0};else{if(0===e.status)g.Cancel=!0;else if(e.responseText){e=e.responseText;try{var f=JSON.parse(e);g.Severity=f.Severity||g.Severity;g.Message=f.Message||g.Message}catch(h){g.Message=e}}else try{g.Message=JSON.stringify(e)}catch(k){}d=g}}a.setProgressResult(d)}else window.console.log(d)}function e(a){f.attach(this);this.serviceRegistry=a.serviceRegistry;this.statusService=a.statusService;this.fileClient=a.fileClient;
this.progressService=a.progressService;this.contentTypeRegistry=a.contentTypeRegistry;this.selection=a.selection;this._input=this._title="";this.dispatcher=null;this._unsavedChanges=[]}d.prototype={_resetTimer:function(){var a=this._document.defaultView||this._document.parentWindow;this._timer&&(a.clearTimeout(this._timer),this._timer=null);-1!==this._timeout&&(this._timer=a.setTimeout(function(){this.onIdle({type:"Idle"});this._timer=null;this._resetTimer()}.bind(this),this._timeout))},onIdle:function(a){return this.dispatchEvent(a)},
setTimeout:function(a){this._timeout=a;this._resetTimer()}};h.mixin(e.prototype,{_maybeLoadWorkspace:function(a){var d=this.fileClient;return a===d.fileServiceRootURL(a)?d.loadWorkspace(a).then(function(a){return a.Location}):(new k).resolve(a)},_read:function(a){var d=this.cachedMetadata||n.getClickedItem();if(d&&d.Location===a&&d.Parents&&d.Attributes&&d.ETag)return(new k).resolve(d);var e=this.fileClient,g=Array.prototype.slice.call(arguments,1);return this._maybeLoadWorkspace(a).then(function(a){return e.read.apply(e,
[a].concat(g))})},load:function(){var b=this.getInput();if(b){var d=this.fileClient,e=this._parsedLocation.resource,g=this.progressService,f=function(a,b,d){return!g?a:g.progress(a,m.formatMessage(b,d))},h=this.getEditor();if(this._fileMetadata)!this._saving&&(!this._fileMetadata.Directory&&!this._readonly)&&f(d.read(e,!0),l.ReadingMetadata,b).then(function(a){this._fileMetadata&&(this._fileMetadata.Location===a.Location&&this._fileMetadata.ETag!==a.ETag)&&(this._fileMetadata=a,(!h.isDirty()||window.confirm(l.loadOutOfSync))&&
f(d.read(e),l.Reading,b).then(function(a){h.setInput(b,null,a);this._unsavedChanges=[]}.bind(this)))}.bind(this));else{var n=e;if(0===n.indexOf("/gitapi/commit/")){var x=n.indexOf("/file"),u=n.indexOf("?",x);-1===u&&(u=n.length);n=n.substring(x,u);this._readonly=!0}var w=window.setTimeout(function(){w=null;this.reportStatus(m.formatMessage(l.Fetching,b))}.bind(this),800),z=function(){this.reportStatus("");w&&window.clearTimeout(w)}.bind(this),B=function(b){z();var d=null;this.serviceRegistry?d=this.serviceRegistry.getService("orion.page.message"):
this.statusService&&(d=this.statusService);a(d,b);this._setNoInput()}.bind(this);this._acceptPatch=null;f(this._read(n,!0),l.ReadingMetadata,n).then(function(a){a?a.Directory?k.when(a.Children||f(d.fetchChildren(a.ChildrenLocation),l.Reading,b),function(d){z();a.Children=d;this._setInputContents(this._parsedLocation,b,d,a)}.bind(this),B):this._isText(a)?f(d.read(e,!1,!0),l.Reading,b).then(function(d){z();"string"!==typeof d&&(this._acceptPatch=d.acceptPatch,d=d.result);this._setInputContents(this._parsedLocation,
b,d,a)}.bind(this),B):f(d._getService(e).readBlob(e),l.Reading,b).then(function(d){z();this._setInputContents(this._parsedLocation,b,d,a)}.bind(this),B):B({responseText:m.formatMessage(l.ReadingMetadataError,n)})}.bind(this),B)}}},processParameters:function(a){var d=this.getEditor();d&&d.processParameters&&d.processParameters(a)},getAutoLoadEnabled:function(){return this._autoLoadEnabled},getAutoSaveEnabled:function(){return this._autoSaveEnabled},getEditor:function(){return this.editor},getInput:function(){return this._input},
getTitle:function(){return this._title},getFileMetadata:function(){return this._fileMetadata},getReadOnly:function(){var a=this._fileMetadata;return this._readonly||!a||a.Attributes&&a.Attributes.ReadOnly},getContentType:function(){return this._contentType},onFocus:function(a){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()},onChanging:function(a){if(this._getSaveDiffsEnabled()){var d=this._unsavedChanges.length,e=a.removedCharCount,g=a.start,f=a.start+e,h=
0;0===a.addedCharCount?h=-1:0===e&&(h=1);if(0<d&&h===this.previousChangeType){d=this._unsavedChanges[d-1];if(0===e&&g===d.end+d.text.length){d.text+=a.text;return}if(0===a.addedCharCount&&f===d.start){d.start=g;return}}this.previousChangeType=h;this._unsavedChanges.push({start:g,end:f,text:a.text})}},reportStatus:function(a){this.statusReporter?this.statusReporter(a):this.editor&&this.editor.reportStatus(a)},save:function(){function b(a){f===A.getInput()&&(A.getFileMetadata().ETag=a.ETag,e.setInput(f,
null,h,!0));A.reportStatus("");g&&v&&v.setProgressResult({Message:l.Saved,Severity:"Normal"});A.afterSave&&A.afterSave();A._saving=!1}function d(b){A.reportStatus("");a(v,b);A._saving=!1;A._errorSaving=!0}if(!this._saving){var e=this.getEditor();if(e&&e.isDirty()&&!this.getReadOnly()){var g=this._errorSaving;this._saving=!0;var f=this.getInput();this.reportStatus(l["Saving..."]);this.dispatchEvent({type:"Saving",inputManager:this});e.markClean();var h=e.getText(),k=h;if(this._getSaveDiffsEnabled()&&
!this._errorSaving){for(var n=this._unsavedChanges,u=0,w=0;w<n.length;w++)u+=n[w].text.length;h.length>u&&(k={diff:n})}this._unsavedChanges=[];this._errorSaving=!1;var n={ETag:this.getFileMetadata().ETag},z=this._parsedLocation.resource,k=this.fileClient.write(z,k,n),B=this.progressService,v=null;this.serviceRegistry&&(v=this.serviceRegistry.getService("orion.page.message"));B&&(k=B.progress(k,m.formatMessage(l.savingFile,f)));var A=this;k.then(b,function(a){412===a.status?window.confirm(l.saveOutOfSync)?
(a=A.fileClient.write(z,h),B&&(a=B.progress(a,m.formatMessage(l.savingFile,f))),a.then(b,d)):A._saving=!1:d(a)})}}},setAutoLoadEnabled:function(a){this._autoLoadEnabled=a},setAutoSaveTimeout:function(a){this._autoSaveEnabled=-1!==a;this._idle?this._idle.setTimeout(a):(this._idle=new d({document:document,timeout:a}),this._idle.addEventListener("Idle",function(){this._errorSaving||this.save()}.bind(this)))},setContentType:function(a){this._contentType=a},setInput:function(a){if(!this._ignoreInput&&
(a||(a=g.hash()),"string"===typeof a)){var d=this.getEditor();a&&"#"!==a[0]&&(a="#"+a);var e=g.matchResourceParameters(a),f=this._parsedLocation||{};if(d&&d.isDirty()){var h=this._location;if(f.resource!==e.resource)if(this._autoSaveEnabled)this.save();else if(!window.confirm(l.confirmUnsavedChanges)){window.location.hash=h;return}}d=d&&f.editor!==e.editor;this._location=a;this._parsedLocation=e;this._ignoreInput=!0;this.selection&&this.selection.setSelections(a);this._ignoreInput=!1;(a=e.resource)?
a===this._input?d?(this.reportStatus(""),this._setInputContents(e,a,null,this._fileMetadata,this._isText(this._fileMetadata))):this.processParameters(e):(this._input=a,this._readonly=!1,this._fileMetadata=null,this.load()):this._setNoInput(!0)}},setTitle:function(a){var d=a.lastIndexOf("/");-1!==d&&(a=a.substring(d+1));this._title=a},setSaveDiffsEnabled:function(a){this._saveDiffsEnabled=a},_getSaveDiffsEnabled:function(){return this._saveDiffsEnabled&&null!==this._acceptPatch&&-1!==this._acceptPatch.indexOf("application/json-patch")},
_unknownContentTypeAsText:function(){return!0},_isText:function(a){a=this.contentTypeRegistry.getFileContentType(a);if(!a)return this._unknownContentTypeAsText();var d=this.contentTypeRegistry.getContentType("text/plain");return this.contentTypeRegistry.isExtensionOf(a,d)},_setNoInput:function(a){a?this.fileClient.loadWorkspace("").then(function(a){this._input=a.ChildrenLocation;this._setInputContents(a.ChildrenLocation,null,a,a)}.bind(this)):(this._input=this._title=this._fileMetadata=null,this.setContentType(null),
this.dispatchEvent({type:"InputChanged",input:null}))},_setInputContents:function(a,d,e,g,f){var h,k=!1;g?(this._fileMetadata=g,this.setTitle(g.Location||String(g)),this.setContentType(this.contentTypeRegistry.getFileContentType(g)),h=g.Name,k=g.Directory):(this._fileMetadata=null,this.setTitle(d),this.setContentType(this.contentTypeRegistry.getFilenameContentType(this.getTitle())),h=this.getTitle());var l=this.getEditor();this._focusListener&&(l&&(l.getTextView&&l.getTextView())&&l.getTextView().removeEventListener("Focus",
this._focusListener),this._focusListener=null);this._changingListener&&(l&&(l.getModel&&l.getModel())&&l.getModel().removeEventListener("Changing",this._changingListener),this._changingListener=null);g={type:"InputChanged",input:a,name:h,title:d,contentType:this.getContentType(),metadata:g,location:window.location,contents:e};this.dispatchEvent(g);this.editor=l=g.editor;k||(l&&(l.getModel&&l.getModel())&&l.getModel().addEventListener("Changing",this._changingListener=this.onChanging.bind(this)),f||
l.setInput(d,null,e),l&&(l.getTextView&&l.getTextView())&&l.getTextView().addEventListener("Focus",this._focusListener=this.onFocus.bind(this)),this._unsavedChanges=[],this.processParameters(a))}});return{handleError:a,InputManager:e}});
define("orion/compare/resourceComparer","i18n!orion/compare/nls/messages require orion/Deferred orion/webui/littlelib orion/compare/compareUtils orion/compare/diffProvider orion/compare/compareView orion/highlight orion/fileClient orion/globalCommands orion/commands orion/keyBinding orion/searchAndReplace/textSearcher orion/editorCommands orion/objects orion/inputManager orion/editor/editorFeatures orion/URL-shim".split(" "),function(l,n,m,k,f,h,g,d,a,e,b,p,q,t,s,y,r){function x(a){this._syntaxHighlither=
new d.SyntaxHighlighter(a)}n={};n.DefaultDiffProvider=function(){function a(b){this.serviceRegistry=b;this._diffProvider=new h.DiffProvider(b)}a.prototype={_resolveTwoFiles:function(a,b){var d=this;return m.all([d._getContentType(a),d._getContentType(b)],function(a){return{_error:a}}).then(function(e){if(Array.isArray(e)&&2===e.length&&e[0]&&e[1]){var g=e[0];e=e[1];return(new m).resolve({oldFile:{URL:a,Name:d._resolveFileName(a),Type:g},newFile:{URL:b,Name:d._resolveFileName(b),Type:e},diffContent:d._diffContent})}g=
a?d._resolveFileName(a):"";e=b?d._resolveFileName(b):"";return(new m).resolve({oldFile:{URL:a,Name:g,Type:null},newFile:{URL:b,Name:e,Type:null},diffContent:d._diffContent})})},_resolveFileName:function(a){return a.split("?")[0]},_getContentType:function(a){a=this._resolveFileName(a);return this.serviceRegistry.getService("orion.core.contentTypeRegistry").getFilenameContentType(a)},_resolveComplexFileURL:function(a){var b=this;return this._diffProvider.getDiffFileURI(a).then(function(a,d){return b._resolveTwoFiles(a.Old,
a.New)},function(){})},resolveDiff:function(a,b,d){this._hasConflicts=d;if(b)return this._resolveTwoFiles(b,a);if(this._diffProvider){var e=this;return e._diffProvider.getDiffContent(a).then(function(b,d){e._diffContent=e._hasConflicts?b.split("diff --git")[1]:b;return e._resolveComplexFileURL(a)},function(){})}console.log("A diff provider is needed for compound diff URL")}};return a}();x.prototype={highlight:function(a,b,d){return this._syntaxHighlither.setup(b,d.getTextView(),null,a,!1)}};n.ResourceComparer=
function(){function d(b,e,f,h){this._registry=b;this._commandService=e;this._fileClient=new a.FileClient(b);this._fileClient=new a.FileClient(b);this._searchService=this._registry.getService("orion.core.search");this._progress=this._registry.getService("orion.page.progress");this.setOptions(f,!0);this._compareView=f.toggleable?new g.toggleableCompareView("inline"===f.type?"inline":"twoWay",h):"inline"===f.type?new g.inlineCompareView(h):new g.TwoWayCompareView(h);this._compareView.getWidget().setOptions({extCmdHolder:this});
h.highlighters||this._compareView.getWidget().setOptions({highlighters:[new x(b),new x(b)]});h.oldFile||this._compareView.getWidget().setOptions({oldFile:{readonly:this._checkReadonly(f.readonlyRight)}});h.newFile||this._compareView.getWidget().setOptions({newFile:{readonly:this._checkReadonly(f.readonly,!0)}});this.initExtCmds();this._initInputManagers();this._compareView.getWidget().initEditors(l["fetching..."]);this._inputManagers.forEach(function(a){if(a.manager){var b=this._compareView.getWidget().getEditors()[a.manager._editorIndex];
b.addEventListener("DirtyChanged",function(d){a.manager.setDirty(b.isDirty())})}}.bind(this))}d.prototype={_clearOptions:function(){this.options={}},_checkReadonly:function(a,b){return b?"undefined"===typeof a?!1:a:"undefined"===typeof a?!0:a},_getFileOptions:function(a){return 1===a?this._compareView.getWidget().options.newFile:this._compareView.getWidget().options.oldFile},_createInputManager:function(){return new y.InputManager({serviceRegistry:this._registry,fileClient:this._fileClient,progressService:this._progress})},
_initInputManagers:function(){this._inputManagers=[{},{}];!this.options.toggleable&&(this._compareView.getWidget()._uiFactory&&"twoWay"===this._compareView.getWidget().type)&&(this._checkReadonly(this.options.readonlyRight)||(this._inputManagers[0].manager=this._createInputManager(),this._initInputManager(this._inputManagers[0].manager,0,this._compareView.getWidget()._uiFactory.getActionDivId())),this._checkReadonly(this.options.readonly,!0)||(this._inputManagers[1].manager=this._createInputManager(),
this._initInputManager(this._inputManagers[1].manager,1,this._compareView.getWidget()._uiFactory.getActionDivId(!0))));var a=this;this._inputManagers.forEach(function(b){b.manager&&(this._getFileOptions(b.manager._editorIndex).keyBindingFactory=function(d,e,g,f){e=new q.TextSearcher(d,a._registry,a._commandService,g);g=(new r.KeyBindingsFactory).createKeyBindings(d,g,f,e);(new t.EditorCommandFactory({serviceRegistry:a._registry,commandRegistry:a._commandService,fileClient:a._fileClient,inputManager:b.manager,
toolbarId:b.manager._actionBarId,readonly:!1,navToolbarId:"pageNavigationActions",textSearcher:e})).generateSimpleEditorCommands(d,1===b.manager._editorIndex?"orion.compare.save.left":"orion.compare.save.right");return g})}.bind(this))},_initInputManager:function(a,b,d){var g=this;s.mixin(a,{filePath:"",_editorIndex:b,_actionBarId:d,getInput:function(){return this.filePath},setDirty:function(a){var b=g._compareView.getWidget().getEditors(),d=a;b&&2===b.length&&(d=b[0].isDirty()||b[1].isDirty());e.setDirtyIndicator(d);
g._compareView.getWidget().refreshTitle&&g._compareView.getWidget().refreshTitle(this._editorIndex,a)},getFileMetadata:function(){return this._fileMetadata},getEditor:function(){return g._compareView.getWidget().getEditors()[this._editorIndex]},setInput:function(a,b){this._parsedLocation={resource:a};g._progress.progress(g._fileClient.read(a,!0),"Getting file metadata "+a).then(function(a){this._fileMetadata=a;var b=k.node(this._actionBarId);if(b){g._commandService.destroy(b);var d=this._editorIndex;
g._commandService.renderCommands(b.id,b,g._compareView.getWidget().getEditors()[d],g._compareView.getWidget().getEditors()[d],"button")}a&&this.setTitle(a.Location,a)}.bind(this),function(b){console.error("Error loading file metadata: "+b.message);this.setTitle(a)}.bind(this));this.lastFilePath=a},setTitle:function(a,b){"*"===a.charAt(0)?e.setDirtyIndicator(!0):e.setDirtyIndicator(!1)},afterSave:function(){var a=g._compareView.getWidget().getEditors()[this._editorIndex].getTextView().getText();g._getFileOptions(this._editorIndex).Content=
a;g._compareView.getWidget().refresh()}})},setOptions:function(a,b){b&&this._clearOptions();this.options||(this.options={});a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},generateLink:function(a){a=a.getCurrentDiffPos();a=f.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:this.options.readonly,readonlyRight:this.options.readonlyRight,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0});a=(new URL(a,window.location.href)).href;
prompt(l["Copy the link URL:"],a)},openComparePage:function(a){a=a.getCurrentDiffPos();return f.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:!this.options.editableInComparePage,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0})},initExtCmds:function(){var a=this._compareView.getWidget().options.commandProvider;if(a&&a.getOptions().commandSpanId){var a=a.getOptions().commandSpanId,d=new b.Command({tooltip:l["Generate link of the current diff"],
name:l["Generate Link"],id:"orion.compare.generateLink",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&a.options.extCmdHolder.options.generateLink},callback:function(a){a.items.options.extCmdHolder.generateLink(a.items)}}),e=new b.Command({tooltip:l["Open the compare page"],name:l.Compare,id:"orion.compare.openComparePage",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&!a.options.extCmdHolder.options.generateLink},
hrefCallback:function(a){return a.items.options.extCmdHolder.openComparePage(a.items)}});this._commandService.addCommand(d);this._commandService.addCommand(e);this._commandService.registerCommandContribution(a,"orion.compare.openComparePage",98);this._commandService.registerCommandContribution(a,"orion.compare.generateLink",99,null,!1,new p.KeyBinding("l",!0,!0))}},_getFilesContents:function(a){var b=[];a.forEach(function(a){b.push(this._loadSingleFile(a))}.bind(this));return m.all(b,function(a){return{_error:a}})},
_isImage:function(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1},_loadSingleFile:function(a){return this._registry.getService("orion.page.progress").progress(this._fileClient.read(a.URL),"Getting contents of "+a.URL).then(function(b){a.Content=b;return a}.bind(this),function(b,d){404===b.status&&(a.Content="");return a}.bind(this))},start:function(){if(this.options.resource){if(this.options.diffProvider){var a=
this;return a.options.diffProvider.resolveDiff(a.options.resource,a.options.compareTo,a.options.hasConflicts).then(function(b){a._compareView.getWidget().setOptions(b);b=a._isImage(b.newFile.Type);var d=a._compareView.getWidget().options;if(a._checkReadonly(a.options.readonlyRight)||b)d.oldFile.readonly=!0;if(a._checkReadonly(a.options.readonly,!0)||b)d.newFile.readonly=!0;return b?(a._compareView.initImageMode(),a._compareView.getWidget().refresh().then(function(a){return(new m).resolve(a+5)})):
a._getFilesContents(d.diffContent?[d.oldFile]:[d.oldFile,d.newFile]).then(function(){var b=a._compareView.getWidget().refresh(!0);this._inputManagers.forEach(function(b){if(b.manager){var d=a._getFileOptions(b.manager._editorIndex),e=a._compareView.getWidget().getEditors()[b.manager._editorIndex];b.manager.filePath=d.URL;b.manager.setInput(d.URL,e)}});return(new m).resolve(b)}.bind(a))})}console.log("A diff provider is needed for Complex diff URL")}}};return d}();return n});
define("orion/git/util",["orion/URL-shim"],function(l){function n(h){for(var g=0;g<f.length;g++)if(h.type===f[g])return!0;return!1}function m(f){for(var g=0;g<k.length;g++)if(f.type===k[g])return!0;return!1}var k=["Missing","Modified","Untracked","Conflicting"],f=["Added","Changed","Removed"];return{statusUILocation:"git/git-status.html",isStaged:n,isUnstaged:m,isChange:function(f){return n(f)||m(f)},hasStagedChanges:function(h){for(var g=0;g<f.length;g++)if(0<h[f[g]].length)return!0;return!1},hasUnstagedChanges:function(f){for(var g=
0;g<k.length;g++)if(0<f[k[g]].length)return!0;return!1},parseSshGitUrl:function(f){try{var g=new URL(f);return{host:g.hostname,port:g.port}}catch(d){try{var a=f.split(":")[0].split("@");return{host:1<a.length?a[1]:a[0],port:22}}catch(e){return{host:"",port:""}}}},trimCommitMessage:function(f){f=f.split(/\r\n|\n/);for(var g=0;0<f.length&&/^\s*$/.test(f[g]);)g++;return 100<f[g].length?f[g].substring(0,100)+"...":f[g]},getGerritFooter:function(f){f=f.split(/\r\n|\n/);for(var g={},d=0,a=f.length-1;0<=
a;--a)if(0===f[a].indexOf("Change-Id: ")){if(g.changeId=f[a].substring(11,f[a].length),1<++d){g={};break}}else 0===f[a].indexOf("Signed-off-by: ")&&(g.signedOffBy=f[a].substring(15,f[a].length));return g}}});
define("orion/git/uiUtil",["orion/compare/compareCommands","orion/compare/resourceComparer","orion/webui/littlelib","orion/git/util"],function(l,n,m,k){k=Object.create(k);k.createCompareWidget=function(f,h,g,d,a,e,b,k,q){var t=new n.DefaultDiffProvider(f);e=new l.CompareCommandFactory({commandService:h,commandSpanId:e,gridRenderer:k});(new n.ResourceComparer(f,h,{toggleable:!0,type:"inline",readonly:!0,hasConflicts:d,diffProvider:t,resource:g,compareTo:q,editableInComparePage:b},{parentDivId:a,commandProvider:e})).start().then(function(b){var d=
420;b<d&&(d=b);m.node(a).style.height=d+"px"})};return k});
define("orion/git/gitConfigPreference",["orion/Deferred"],function(l){function n(l){this._prefix="/git/config";this._preferenceService=l.getService("orion.core.preference")}n.prototype={getConfig:function(){var m=new l;this._preferenceService.getPreferences(this._prefix).then(function(k){k=k.get("userInfo");m.resolve(k)});return m},setConfig:function(m){var k=new l;this._preferenceService.getPreferences(this._prefix).then(function(f){f.put("userInfo",m);k.resolve()});return k}};return n.prototype.constructor=
n});
define("orion/git/widgets/CommitDialog",["i18n!git/nls/gitmessages","orion/webui/dialog","orion/git/gitConfigPreference"],function(l,n,m){function k(f){this._init(f)}k.prototype=new n.Dialog;k.prototype.TEMPLATE='\x3cdiv style\x3d"display: none; padding-top: 10px; padding-bottom: 10px;" id\x3d"commitInfoBar"\x3e\x3cstrong id\x3d"commitInfo"\x3e\x3c/strong\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3cdiv style\x3d"vertical-align:top"\x3e\x3clabel style\x3d"display:block; float:left" id\x3d"commitMessageLabel" for\x3d"commitMessage"\x3e${Message:}\x3c/label\x3e\x3ctextarea id\x3d"commitMessage" rows\x3d"5" style\x3d"width: 30em"\x3e\x3c/textarea\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"amendLabel" for\x3d"amend"\x3e${Amend:}\x3c/label\x3e\x3cinput id\x3d"amend" type\x3d"checkbox"\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"changeIdLabel" for\x3d"changeId"\x3e${ChangeId:}\x3c/label\x3e\x3cinput id\x3d"changeId" type\x3d"checkbox"\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"committerNameLabel" for\x3d"committerName"\x3e${Committer Name:}\x3c/label\x3e\x3cinput id\x3d"committerName" style\x3d"width: 30em" value\x3d""\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"committerEmailLabel" for\x3d"committerEmail"\x3e${Committer Email:}\x3c/label\x3e\x3cinput id\x3d"committerEmail" style\x3d"width: 30em" value\x3d""\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"authorNameLabel" for\x3d"authorName"\x3e${Author Name:}\x3c/label\x3e\x3cinput id\x3d"authorName" style\x3d"width: 30em" value\x3d""\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"authorEmailLabel" for\x3d"authorEmail"\x3e${Author Email:}\x3c/label\x3e\x3cinput id\x3d"authorEmail" style\x3d"width: 30em" value\x3d""\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"persistLabel" for\x3d"persist"\x3e${Remember my committer name and email:}\x3c/label\x3e\x3cinput id\x3d"persist" type\x3d"checkbox"\x3e\x3c/div\x3e';k.prototype._init=
function(f){var h=this;this.title=l["Commit Changes"];this.modal=!0;this.messages=l;this.options=f;this.buttons=[];this.buttons.push({callback:function(){h._execute()},text:"OK",id:"commitChangesButton"});this._initialize()};k.prototype._bindToDom=function(f){var h=this;this.options.body.Message&&(this.$commitMessage.value=this.options.body.Message);this.$commitMessage.addEventListener("keyup",function(g){h._validate()});this.options.body.Amend&&(this.$amend.checked=!0);this.options.body.ChangeId&&
(this.$changeId.checked=!0);this.options.body.CommitterName&&(this.$committerName.value=this.options.body.CommitterName);this.$committerName.addEventListener("keyup",function(g){h._validate()});this.options.body.CommitterEmail&&(this.$committerEmail.value=this.options.body.CommitterEmail);this.$committerEmail.addEventListener("keyup",function(g){h._validate()});this.options.body.AuthorName&&(this.$authorName.value=this.options.body.AuthorName);this.$authorName.addEventListener("keyup",function(g){h._validate()});
this.options.body.AuthorEmail&&(this.$authorEmail.value=this.options.body.AuthorEmail);this.$authorEmail.addEventListener("keyup",function(g){h._validate()});this._validate()};k.prototype._validate=function(){this.$commitMessage.value?this.$committerName.value?this.$committerEmail.value?this.$authorName.value?this.$authorEmail.value?(this.$commitInfoBar.style.display="none",this.$commitChangesButton.classList.remove(this.DISABLED)):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),
this.$commitInfo.textContent=l["The author mail is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=l["The author name is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=l["The committer mail is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=
l["The committer name is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=l["The commit message is required."])};k.prototype._execute=function(){if(!this.$commitChangesButton.classList.contains(this.DISABLED)){if(this.options.func){var f={};f.Message=this.$commitMessage.value;f.Amend=this.$amend.checked?!0:!1;f.ChangeId=this.$changeId.checked?!0:!1;f.CommitterName=this.$committerName.value;f.CommitterEmail=
this.$committerEmail.value;f.AuthorName=this.$authorName.value;f.AuthorEmail=this.$authorEmail.value;f.persist=this.$persist.checked?!0:!1;this.options.func(f)}this.hide()}};k.prototype.constructor=k;return{CommitDialog:k}});
define("orion/git/gitPreferenceStorage",["orion/Deferred"],function(l){function n(l){this._prefix="/git/credentials";this._preferenceService=l.getService("orion.core.preference")}n.prototype={put:function(m,k){var f={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""};void 0!==k&&(void 0!==k.gitSshUsername&&null!==k.gitSshUsername&&(f.gitSshUsername=k.gitSshUsername),void 0!==k.gitSshPassword&&null!==k.gitSshPassword&&(f.gitSshPassword=k.gitSshPassword),void 0!==k.gitPrivateKey&&
null!==k.gitPrivateKey&&(f.gitPrivateKey=k.gitPrivateKey),void 0!==k.gitPassphrase&&null!==k.gitPassphrase&&(f.gitPassphrase=k.gitPassphrase));var h=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(g){var d=g.get("settings");void 0===d?h.reject():d.enabled?(g.put(m,f),h.resolve()):h.reject()});return h},get:function(m){var k={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""},f=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(h){var g=
h.get("settings");void 0===g?f.reject():g.enabled?(h=h.get(m),void 0!==h?f.resolve(h):f.resolve(k)):f.reject()});return f},isEnabled:function(){var m=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(k){k=k.get("settings");void 0===k?m.resolve(!1):m.resolve(k.enabled)});return m},enable:function(){var m=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(k){k.put("settings",{enabled:!0});m.resolve()});return m},disable:function(){var m=new l;this._preferenceService.getPreferences(this._prefix,
2).then(function(k){k.put("settings",{enabled:!1});m.resolve()});return m},remove:function(m){var k=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(f){f.remove(m);k.resolve()});return k},getRepositories:function(){var m=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(k){var f=[];k=k.keys();for(var h=0;h<k.length;++h)"settings"!==k[h]&&f.push(k[h]);m.resolve(f)});return m}};return n.prototype.constructor=n});
define("orion/git/widgets/GitCredentialsDialog",["i18n!git/nls/gitmessages","orion/git/gitPreferenceStorage","orion/webui/dialog","orion/git/util"],function(l,n,m,k){function f(f){this._init(f)}f.prototype=new m.Dialog;f.prototype.TEMPLATE='\x3cdiv id\x3d"gitCredentialsLabel" style\x3d"padding: 8px"\x3e${Repository URL:}\x3cstrong id\x3d"url"\x3e\x3c/strong\x3e\x3c/div\x3e\x3cdiv id\x3d"gitSshUsernameRow" style\x3d"padding: 8px"\x3e\x3clabel id\x3d"gitSshUsernameLabel" for\x3d"gitSshUsername"\x3e${Username:}\x3c/label\x3e\x3cinput id\x3d"gitSshUsername" value\x3d""\x3e\x3c/div\x3e\x3cdiv id\x3d"gitSshPasswordRow" style\x3d"padding: 8px"\x3e\x3cinput id\x3d"isSshPassword" type\x3d"radio" name\x3d"isSshPassword" checked value\x3d"password"/\x3e\x3clabel id\x3d"gitSshPasswordLabel" for\x3d"gitSshPassword" style\x3d"padding: 0 8px"\x3e${Password:}\x3c/label\x3e\x3cinput type\x3d"password" id\x3d"gitSshPassword" value\x3d"" style\x3d"width: 30em"\x3e\x3c/div\x3e\x3cdiv style\x3d"padding: 8px"\x3e\x3cdiv id\x3d"gitPrivateKeyRow"\x3e\x3cinput id\x3d"isPrivateKey" type\x3d"radio" name\x3d"isSshPassword" value\x3d"privateKey" style\x3d"vertical-align: top"/\x3e\x3clabel id\x3d"gitPrivateKeyLabel" for\x3d"gitPrivateKey" style\x3d"padding: 0 8px; vertical-align: top"\x3e${Private key:}\x3c/label\x3e\x3ctextarea id\x3d"gitPrivateKey" value\x3d""\x3e\x3c/textarea\x3e\x3c/div\x3e\x3cdiv id\x3d"gitPrivateKeyFileRow" style\x3d"padding-left: 8em"\x3e\x3clabel id\x3d"gitPrivateKeyFileLabel" for\x3d"gitPrivateKeyFile"\x3e${Private key file (optional):}\x3c/label\x3e\x3cbr\x3e\x3cinput id\x3d"gitPrivateKeyFile" multiple\x3d"false" type\x3d"file" size\x3d"53" label\x3d"Browse..."\x3e\x3c/div\x3e\x3cdiv id\x3d"gitPassphraseRow" style\x3d"padding-left: 8em"\x3e\x3clabel id\x3d"gitPassphraseLabel" for\x3d"gitPassphrase"\x3e${Passphrase (optional):}\x3c/label\x3e\x3cbr\x3e\x3cinput type\x3d"password" id\x3d"gitPassphrase" value\x3d"" style\x3d"width: 30em"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv id\x3d"gitSaveCredentialsRow" style\x3d"padding: 8px"\x3e\x3cimg id\x3d"gitSaveCredentialsInfo" src\x3d"/images/info.gif""\x3e\x3cinput id\x3d"gitSaveCredentials" type\x3d"checkbox" name\x3d"gitSaveCredentials"\x3e\x3clabel id\x3d"gitSaveCredentialsLabel" for\x3d"gitSaveCredentials"\x3e${Don\'t prompt me again:}\x3c/label\x3e\x3c/div\x3e';
f.prototype._init=function(f){var g=this;this.title=f.title||l["Git Credentials"];this.modal=!0;this.messages=l;this.options=f;this._afterHiding=f.closeCallback;!this.options.username&&(!this.options.password&&!this.options.privatekey&&!this.options.passphrase)&&(this.options.username=!0,this.options.password=!0,this.options.privatekey=!0,this.options.passphrase=!0);f.serviceRegistry&&(this._sshService=f.serviceRegistry.getService("orion.net.ssh"),this._progressService=f.serviceRegistry.getService("orion.page.progress"));
this.buttons=[];this.buttons.push({callback:function(){g.destroy();g._execute()},text:"OK",isDefault:!0});this._initialize()};f.prototype._bindToDom=function(f){var g=this;this.options.username||(this.$gitSshUsernameRow.style.display="none");this.options.password||(this.$gitSshPasswordRow.style.display="none");this.options.privatekey||(this.$gitPrivateKeyRow.style.display="none",this.$gitPrivateKeyFileRow.style.display="none");this.options.passphrase||(this.$gitPassphraseRow.style.display="none");
this.options.errordata&&this.options.errordata.Url&&(this.$gitCredentialsLabel.style.display="block",this.$url.textContent=this.options.errordata.Url);this.options.errordata&&(this.options.errordata.User&&""!==this.options.errordata.User)&&(this.$gitSshUsername.value=this.options.errordata.User,this.$gitSshUsernameRow.style.display="none",setTimeout(function(){g.$gitSshPassword.focus()},400));(new n(this.options.serviceRegistry)).isEnabled().then(function(d){d||(g.$gitSaveCredentials.style.display=
"none",g.$gitSaveCredentialsLabel.style.display="none",g.$gitSaveCredentialsInfo.style.display="none")});this.$gitSshPassword.addEventListener("focus",function(d){g.$isSshPassword.checked=!0});this.$gitPrivateKey.addEventListener("focus",function(d){g.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("focus",function(d){g.$isPrivateKey.checked=!0});this.$gitPassphrase.addEventListener("focus",function(d){g.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("change",
function(d){g.privateKeyFile=d.target.files[0]})};f.prototype._execute=function(){var f=this,g=this.$gitPrivateKey.value,d=this.$url.textContent,a=function(a){if(f._sshService){var e=k.parseSshGitUrl(d);f._sshService.getKnownHostCredentials(e.host,e.port).then(function(d){if(f.options.func){var e="undefined"===typeof f.options.failedOperation?f.options.errordata.failedOperation:f.options.failedOperation;"undefined"!==e&&f._progressService.removeOperation(e);f.options.func({gitSshUsername:f.$gitSshUsername.value,
gitSshPassword:f.$isSshPassword.checked?f.$gitSshPassword.value:"",gitPrivateKey:f.$isPrivateKey.checked?a:"",gitPassphrase:f.$isPrivateKey.checked?f.$gitPassphrase.value:"",knownHosts:d})}})}else f.options.func&&(e="undefined"===typeof f.options.failedOperation?f.options.errordata.failedOperation:f.options.failedOperation,"undefined"!==e&&f._progressService.removeOperation(e),f.options.func({gitSshUsername:f.$gitSshUsername.value,gitSshPassword:f.$gitSshPassword.value,gitPrivateKey:a,gitPassphrase:f.$gitPassphrase.value,
knownHosts:f.$gitSshKnownHosts.value}))};if(this.privateKeyFile){var e=new FileReader;e.onload=function(b){return function(b){g=b.target.result;b=new n(f.options.serviceRegistry);f.$gitSaveCredentials.checked?b.put(d,{gitPrivateKey:g,gitPassphrase:f.$gitPassphrase.value}).then(function(){a(g)}):a(g)}}(this.privateKeyFile);e.readAsText(this.privateKeyFile)}else 0<g.length?(e=new n(f.options.serviceRegistry),f.$gitSaveCredentials.checked?e.put(d,{gitPrivateKey:g,gitPassphrase:f.$gitPassphrase.value}).then(function(){a(g)}):
a(g)):(e=new n(f.options.serviceRegistry),f.$gitSaveCredentials.checked?e.put(d,{gitSshUsername:f.$gitSshUsername.value,gitSshPassword:f.$gitSshPassword.value}).then(function(){a(g)}):a(g))};f.prototype.constructor=f;return{GitCredentialsDialog:f}});
define("orion/git/logic/gitCommon","orion/git/util orion/i18nUtil orion/git/gitPreferenceStorage orion/git/widgets/GitCredentialsDialog orion/Deferred i18n!git/nls/gitmessages".split(" "),function(l,n,m,k,f,h){function g(a){var b;try{b=JSON.parse(a.responseText)}catch(d){b={Message:h["Problem while performing the action"]}}b.HttpCode=a.status;return b}var d=function(a,b,d,f){if(confirm(n.formatMessage(h["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],b.KeyType,
b.Host,b.HostFingerprint))){var g=l.parseSshGitUrl(b.Url);b={host:b.Host,keyType:b.KeyType,hostKey:b.HostKey,port:g.port};a.getService("orion.net.ssh").addKnownHost(b).then(function(b){d.knownHosts=b;"undefined"!==typeof d.failedOperation&&a.getService("orion.page.progress").removeOperation(d.failedOperation);f(d)})}},a=function(a,b,d,f,g,h){b=b?b.Url:void 0;var l=function(){(new k.GitCredentialsDialog({title:g,serviceRegistry:a,func:f,errordata:d.errordata,failedOperation:d.failedOperation,closeCallback:h})).show()};
d.gitSshUsername&&""!==d.gitSshUsername||d.gitSshPassword&&""!==d.gitSshPassword||d.gitPrivateKey&&""!==d.gitPrivateKey?l():(new m(a)).get(b).then(function(b){""!==b.gitPrivateKey||""!==b.gitSshUsername||""!==b.gitSshPassword?("undefined"!==typeof d.failedOperation&&a.getService("orion.page.progress").removeOperation(d.failedOperation),f({knownHosts:d.knownHosts,gitSshUsername:b.gitSshUsername,gitSshPassword:b.gitSshPassword,gitPrivateKey:b.gitPrivateKey,gitPassphrase:b.gitPassphrase})):l()},l)};
return{handleGitServiceResponse:function(a,b,d,f){a&&void 0!==a.status&&(a=g(a));if(!a||!a.HttpCode)d&&d(a);else switch(a.HttpCode){case 401:var k=new m(b);k.isEnabled().then(function(b){b&&void 0!==a.JsonData.Url?k.remove(a.JsonData.Url).then(function(){f(a)}):f(a)});break;case 400:if(a.JsonData&&a.JsonData.HostKey){f(a);break}default:var l=[];l.Severity=a.Severity||"Error";l.HTML=!1;l.Message="REJECTED_NONFASTFORWARD"===(a.DetailedMessage?a.DetailedMessage:a.Message)?h.REJECTED_NONFASTFORWARD:a.DetailedMessage?
a.DetailedMessage:a.Message;b.getService("orion.page.message").setProgressResult(l);d&&d(a)}},handleProgressServiceResponse:function(e,b,f,h,k,l){e&&void 0!==e.status&&(e=g(e));if(!e||void 0===e.HttpCode)h&&h(e);else switch(e.HttpCode){case 401:e.JsonData&&(b.errordata=e.JsonData);e.failedOperation&&(b.failedOperation=e.failedOperation);a(f,e.JsonData,b,k,l);break;case 400:if(e.JsonData&&e.JsonData.HostKey){e.failedOperation&&(b.failedOperation=e.failedOperation);d(f,e.JsonData,b,k);break}else if(e.JsonData&&
e.JsonData.Host){e.JsonData&&(b.errordata=e.JsonData);e.failedOperation&&(b.failedOperation=e.failedOperation);a(f,e.JsonData,b,k,l);break}default:b=[],b.Severity="Error",b.HTML=!1,b.Message=e.DetailedMessage?e.DetailedMessage:e.Message,f.getService("orion.page.message").setProgressResult(b),h&&h(e)}},gatherSshCredentials:function(a,b,d,g){var t=new f,s,y=b.items;y.LocalBranch&&y.RemoteBranch&&(y=y.LocalBranch);void 0!==y.RemoteLocation?s=y.RemoteLocation[0].GitUrl:void 0!==y.GitUrl?s=y.GitUrl:void 0!==
y.errorData?s=y.errorData.Url:void 0!==y.toRef&&(s=y.toRef.RemoteLocation[0].GitUrl);var y=a.getService("orion.net.ssh"),r=l.parseSshGitUrl(s),x=function(d){a.getService("orion.net.ssh").getKnownHostCredentials(r.host,r.port).then(function(a){b.sshObject=d;t.resolve({knownHosts:a,gitSshUsername:d.gitSshUsername,gitSshPassword:d.gitSshPassword,gitPrivateKey:d.gitPrivateKey,gitPassphrase:d.gitPassphrase})})},u=b.errorData;if(u&&u.HostKey){if(confirm(n.formatMessage(h["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],
u.KeyType,u.Host,u.HostFingerprint))){var w=l.parseSshGitUrl(u.Url);y.addKnownHost({host:u.Host,keyType:u.KeyType,hostKey:u.HostKey,port:w.port}).then(function(){b.sshObject&&(""!==b.sshObject.gitSshUsername||""!==b.sshObject.gitSshPassword||""!==b.sshObject.gitPrivateKey)?x({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""}):(new m(a)).get(s).then(function(a){x(a)},function(){x({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})})}else"function"===typeof g&&
g();return t}var z=function(){if(!b.parameters&&!b.optionsRequested)x({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""});else if(b.parameters&&!b.optionsRequested){var f=b.parameters&&b.parameters.valueFor("sshuser")?b.parameters.valueFor("sshuser"):b.errorData.User,h=b.parameters?b.parameters.valueFor("sshpassword"):"",l=b.parameters&&b.parameters.valueFor("saveCredentials")?b.parameters.valueFor("saveCredentials"):!1,n=new m(a);l?n.put(s,{gitSshUsername:f,gitSshPassword:h}).then(function(){x({gitSshUsername:f,
gitSshPassword:h,gitPrivateKey:"",gitPassphrase:""})}):x({gitSshUsername:f,gitSshPassword:h,gitPrivateKey:"",gitPassphrase:""})}else(new k.GitCredentialsDialog({title:d,serviceRegistry:a,func:x,errordata:u,closeCallback:g})).show()};b.sshObject&&(""!==b.sshObject.gitSshUsername||""!==b.sshObject.gitSshPassword||""!==b.sshObject.gitPrivateKey)?z():(new m(a)).get(s).then(function(a){""!==a.gitPrivateKey||""!==a.gitSshUsername||""!==a.gitSshPassword?x(a):z()},z);return t},handleSshAuthenticationError:a,
handleKnownHostsError:d}});
define("orion/git/logic/gitCommit","i18n!git/nls/gitmessages orion/commandRegistry orion/Deferred orion/git/widgets/CommitDialog orion/git/logic/gitCommon orion/i18nUtil orion/webui/littlelib".split(" "),function(l,n,m,k,f,h,g){var d=f.handleProgressServiceResponse;return function(a){var e=a.serviceRegistry,b=new n.CommandEventListener("change",function(a,b){var d=b.status,f=b.messageTextArea;if(a.target.checked){var g=e.getService("orion.page.message"),d=e.getService("orion.page.progress").progress(e.getService("orion.git.provider").doGitLog(d.CommitLocation+"?page\x3d1\x26pageSize\x3d1"),
l["Fetching previous commit message"]);g.createProgressMonitor(d,l["Fetching previous commit message"],d.then(function(a){f.value=a.Children[0].Message}),function(a){f.value=""})}else f.value=""}),f=function(a,b,d){var f=e.getService("orion.git.provider"),g=new m;f.addCloneConfigurationProperty(d,a,b).then(function(){g.resolve()},function(e){409===e.status?f.getGitCloneConfig(d).then(function(d){if(d.Children)for(var e=0;e<d.Children.length;e++)if(d.Children[e].Key===a){f.editCloneConfigurationProperty(d.Children[e].Location,
b).then(function(){g.resolve()},function(a){g.reject(a)});break}},function(a){g.reject(a)}):g.reject(e)});return g},q=function(a){var b={Severity:"Error",HTML:!1};try{var d=JSON.parse(a.responseText);401===a.status?(b.HTML=!0,b.Message="\x3cspan\x3e",b.Message+=h.formatMessage(l["Authentication required for: ${0}. ${1} and re-try the request."],d.label,'\x3ca target\x3d"_blank" href\x3d"'+d.SignInLocation+'"\x3e'+l.Login+"\x3c/a\x3e")+"\x3c/span\x3e"):b.Message=d.DetailedMessage?d.DetailedMessage:
d.Message?d.Message:l["Problem while performing the action"]}catch(f){b.Message=l["Problem while performing the action"]}e.getService("orion.page.message").setProgressResult(b)};return{perform:function(a){var b=new m,g=a.items.status||a.handler.status,h=g.Clone.ConfigLocation,n=function(a){a.persist&&f("user.name",a.CommitterName,h).then(function(){f("user.email",a.CommitterEmail,h).then(function(){},function(a){d(a,{},e);b.reject(a)})},function(a){d(a,{},e);b.reject(a)});var k=e.getService("orion.page.message"),
m=e.getService("orion.page.progress").progress(e.getService("orion.git.provider").commitAll(g.Clone.HeadLocation,null,JSON.stringify(a)),l["Committing changes"]);k.createProgressMonitor(m,l["Committing changes"]);m.then(function(a){b.resolve()},function(a){q(a);b.reject(a)})},u=function(a,b){for(var d=0;d<b.length;d++)"user.name"===b[d].Key?(a.CommitterName=b[d].Value,a.AuthorName=b[d].Value):"user.email"===b[d].Key&&(a.CommitterEmail=b[d].Value,a.AuthorEmail=b[d].Value);a.Message&&a.CommitterName&&
a.CommitterEmail?n(a):(new k.CommitDialog({body:a,func:n})).show()},w={};w.Message=a.userData.name;w.Amend=a.userData.amend;w.ChangeId=a.userData.changeId;var z=g.Clone.Config;if(w.Amend&&!w.Message){a=e.getService("orion.page.message");var B=e.getService("orion.page.progress").progress(e.getService("orion.git.provider").doGitLog(g.CommitLocation+"?page\x3d1\x26pageSize\x3d1"),l["Committing changes"]);a.createProgressMonitor(B,l["Committing changes"]);B.then(function(a){w.Message=a.Children[0].Message;
u(w,z)},function(a){u(w,z)})}else u(w,z);return b},createParameters:function(a){return new n.ParametersDescription([new n.CommandParameter("name","text",l["Commit message:"],"",4),new n.CommandParameter("amend","boolean",a?l.SmartAmend:l["Amend:"],!1,null,b),new n.CommandParameter("changeId","boolean",a?l.SmartChangeId:l["ChangeId:"],!1)],{hasOptionalParameters:!0,getParameterElement:a?function(a,b){return g.$("#"+a.name+"parameterCollector",b.parentNode.parentNode)}:null,getSubmitName:a?function(a){a=
a.items;Array.isArray(a)||(a=[a]);return h.formatMessage(l.SmartCountCommit,a.length)}:null})},displayErrorOnStatus:q,amendEventListener:b,setGitCloneConfig:f}}});
define("orion/git/widgets/gitChangeList","i18n!git/nls/gitmessages orion/i18nUtil orion/Deferred orion/explorers/explorer orion/git/uiUtil orion/git/util orion/webui/tooltip orion/selection orion/webui/littlelib orion/commands orion/git/logic/gitCommit orion/objects".split(" "),function(l,n,m,k,f,h,g,d,a,e,b,p){function q(a){this.changes=a.changes;this.registry=a.registry;this.prefix=a.prefix;this.location=a.location;this.repository=a.repository;this.handleError=a.handleError;this.changes=a.changes;
this.gitClient=a.gitClient;this.progressService=a.progressService;this.section=a.section}function t(a){this.checkbox="all"===a.prefix;var b=new s({registry:a.serviceRegistry,commandService:a.commandRegistry,actionScopeId:a.actionScopeId,cachePrefix:a.prefix+"Navigator",checkbox:this.checkbox},this);k.Explorer.call(this,a.serviceRegistry,a.selection,b,a.commandRegistry);this.parentId=a.parentId;this.actionScopeId=a.actionScopeId;this.prefix=a.prefix;this.changes=a.changes;this.section=a.section;this.location=
a.location;this.repository=a.repository;this.editableInComparePage=a.editableInComparePage;this.handleError=a.handleError;this.gitClient=a.gitClient;this.progressService=a.progressService;this.explorerSelectionScope="explorerSelection";this.createSelection();this.createCommands();"all"!==this.prefix&&this.updateCommands()}function s(a,b){k.SelectionRenderer.apply(this,arguments);this.registry=a.registry}var y=["Missing","Modified","Untracked","Conflicting"],r=["Added","Changed","Removed"],x=y.concat(r),
u={Missing:{imageClass:"gitImageSprite git-sprite-removal",tooltip:l["Unstaged removal"]},Removed:{imageClass:"gitImageSprite git-sprite-removal",tooltip:l["Staged removal"]},Modified:{imageClass:"gitImageSprite git-sprite-file",tooltip:l["Unstaged change"]},Changed:{imageClass:"gitImageSprite git-sprite-file",tooltip:l["Staged change"]},Untracked:{imageClass:"gitImageSprite git-sprite-addition",tooltip:l["Unstaged addition"]},Added:{imageClass:"gitImageSprite git-sprite-addition",tooltip:l["Staged addition"]},
Conflicting:{imageClass:"gitImageSprite git-sprite-conflict-file",tooltip:l.Conflicting},ADD:{imageClass:"gitImageSprite git-sprite-addition",tooltip:l.Addition},MODIFY:{imageClass:"gitImageSprite git-sprite-file",tooltip:l.Deletion},DELETE:{imageClass:"gitImageSprite git-sprite-removal",tooltip:l.Diffs}};q.prototype=Object.create(k.Explorer.prototype);p.mixin(q.prototype,{destroy:function(){},getRoot:function(a){a(this.changes||this.root||(this.root={Type:"Root"}))},getGroups:function(a){switch(a){case "all":return x;
case "staged":return r;case "unstaged":return y}},getChildren:function(a,b){if(a instanceof Array&&0<a.length)b(a);else if("Root"===a.Type){var d=this;if(a.children)b(a.children);else{var e=this.location,g=this.progressService,h=this.gitClient,k=this.section.createProgressMonitor();k.begin("Getting changes");g.progress(h.getGitStatus(e),l["Loading..."]).then(function(e){if("Status"===e.Type){var f=d.status=d.items=e;m.when(d.repository||g.progress(h.getGitClone(f.CloneLocation),"Getting repository information"),
function(e){var h=e.Children?e.Children[0]:e;d.repository=h;h.status=f;g.progress(d.registry.getService("orion.git.provider").getGitCloneConfig(h.ConfigLocation),"Getting repository configuration ",h.Name).then(function(e){e=e.Children;f.Clone=h;f.Clone.Config=[];for(var g=0;g<e.length;g++)("user.name"===e[g].Key||"user.email"===e[g].Key)&&f.Clone.Config.push(e[g]);e=a.children=d._sortBlock(d.getGroups(d.prefix));"all"===d.prefix&&(0<e.length&&e.unshift({Type:"ExplorerSelection",selectable:!0}),e.unshift({Type:"CommitMsg",
selectable:!1}));e.forEach(function(b){b.parent=a});k.done();b(e)},function(a){k.done();d.handleError(a)})},function(a){k.done();d.handleError(a)})}},function(a){k.done();d.handleError(a)})}}else f.isChange(a)||"Diff"===a.Type?(a.children||(a.children=[],a.children.push({DiffLocation:a.DiffLocation,Type:"Compare",parent:a,selectable:"all"!==this.prefix})),b(a.children)):b([])},getId:function(a){var b=this.prefix;return a instanceof Array&&0<a.length||"Root"===a.Type?b+"Root":f.isChange(a)?b+a.type+
a.name:"ExplorerSelection"===a.Type||"CommitMsg"===a.Type?b+a.Type:b+a.type+a.DiffLocation},getModelType:function(a,b){return b},_markConflict:function(a){var b=this.getGroupData(a[1]);if(b)for(var d=0;d<b.length;d++)if(!b[d].Conflicting){for(var e=b[d].Location,f=[],g=2;g<a.length;g++){var h=this.getGroupData(a[g]);h&&(h=this._findSameFile(e,h))&&f.push(h)}if(f.length===Math.max(0,a.length-2)){b[d].Conflicting=a[0];for(e=0;e<f.length;e++)f[e].Conflicting="Hide"}}},_findSameFile:function(a,b){for(var d=
0;d<b.length;d++)if(!b[d].Conflicting&&a===b[d].Location)return b[d]},_sortBlock:function(a){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.getGroupData(e);if(f)for(var g=0;g<f.length;g++){var h=this.getModelType(f[g],e);h&&b.push({name:f[g].Name,type:h,location:f[g].Location,path:f[g].Path,commitURI:f[g].Git.CommitLocation,indexURI:f[g].Git.IndexLocation,DiffLocation:f[g].Git.DiffLocation,CloneLocation:this.items.CloneLocation,conflicting:"Conflicting"===h})}}b.sort(function(a,b){var d=a.name&&
a.name.toLowerCase(),e=b.name&&b.name.toLowerCase();return d<e?-1:d>e?1:0});return b},getGroupData:function(a){return this.items[a]},isStaged:function(a){for(var b=0;b<r.length;b++)if(a===r[b])return!0;return!1},getClass:function(a){return u[a.type].imageClass},getTooltip:function(a){return u[a.type].tooltip}});t.prototype=Object.create(k.Explorer.prototype);p.mixin(t.prototype,{changedItem:function(a){var b=new m;if("all"===this.prefix){var d=a[0].parent,e=this.messageTextArea.value,f=this.amendCheck.checked,
g=this.changeIDCheck.checked,h=this;d.children=d.Children=null;this.model.getChildren(d,function(a){d.removeAll=!0;h.myTree.refresh.bind(h.myTree)(d,a,!1);var k=a.filter(function(a){return h.model.isStaged(a.type)});h.selection.setSelections(k);h.messageTextArea.value=e;h.amendCheck.checked=f;h.changeIDCheck.checked=g;b.resolve(a)})}else b.resolve();return b},destroy:function(){this._selectionListener&&(this.selection.removeEventListener("selectionChanged",this._selectionListener),this._selectionListener=
null)},display:function(){var a=this,b=new m,d=new q({registry:this.registry,progress:this.progressService,prefix:this.prefix,location:this.location,repository:this.repository,handleError:this.handleError,changes:this.changes,gitClient:this.gitClient,progressService:this.progressService,section:this.section});this.createTree(this.parentId,d,{onComplete:function(){var d=a.model;"all"===a.prefix&&(a.updateCommands(),a.selection.setSelections(d._sortBlock(d.getGroups("staged"))));a.status=d.status;b.resolve()}});
return b},isRowSelectable:function(a){return"all"===this.prefix?!1:f.isChange(a)},getItemCount:function(){var a=0,b=this.model;b&&b.getRoot(function(d){b.getChildren(d,function(b){a=Math.max(0,b.length-2)})});return a},updateCommands:function(){k.createExplorerCommands(this.commandService);var b=this.section.actionsNode.id,d=this.section.selectionNode.id,e=this.explorerSelectionScope;this.commandService.registerCommandContribution(e,"orion.explorer.expandAll",200);this.commandService.registerCommandContribution(e,
"orion.explorer.collapseAll",300);if("staged"===this.prefix)this.commandService.addCommandGroup(b,"eclipse.gitCommitGroup",1E3,"Commit",null,null,null,"Commit",null,"eclipse.orion.git.commitCommand"),this.commandService.registerCommandContribution(b,"eclipse.orion.git.commitCommand",100,"eclipse.gitCommitGroup"),this.commandService.registerCommandContribution(b,"eclipse.orion.git.commitAndPushCommand",200,"eclipse.gitCommitGroup"),this.commandService.registerCommandContribution(d,"eclipse.orion.git.unstageCommand",
100),this.commandService.registerCommandContribution("DefaultActionWrapper","eclipse.orion.git.unstageCommand",100);else if("unstaged"===this.prefix)this.commandService.registerCommandContribution(d,"eclipse.orion.git.showPatchCommand",100),this.commandService.registerCommandContribution(d,"eclipse.orion.git.stageCommand",200),this.commandService.registerCommandContribution(d,"eclipse.orion.git.checkoutCommand",300),this.commandService.registerCommandContribution("DefaultActionWrapper","eclipse.orion.git.stageCommand",
100);else if("all"===this.prefix){this.commandService.registerCommandContribution(d,"eclipse.orion.git.showStagedPatchCommand",100);this.commandService.registerCommandContribution(d,"eclipse.orion.git.checkoutStagedCommand",200);this.commandService.registerCommandContribution(d,"eclipse.orion.git.precommitCommand",300);var f=a.node(e);f&&(this.commandService.destroy(f),this.commandService.renderCommands(e,e,this,this,"button"));this.commandService.renderCommands(d,d,[],this,"button",{Clone:this.model.repository})}this.commandService.renderCommands(b,
b,this,this,"button")},createCommands:function(){if("all"===this.prefix){var a=this,b=new e.Command({tooltip:l["Select all"],imageClass:"core-sprite-check",id:"orion.explorer.selectAllCommandChangeList",visibleWhen:function(b){var d=!1;a.model.getRoot(function(b){d=0<b.children.filter(function(b){return!a.model.isStaged(b.type)&&h.isChange(b)}).length});return d},callback:function(b){a.model.getRoot(function(b){b=b.children.filter(function(b){return!a.model.isStaged(b.type)&&h.isChange(b)});a.commandService.runCommand("eclipse.orion.git.stageCommand",
b,a,null,a.status)})}}),d=new e.Command({tooltip:l["Deselect all"],imageClass:"core-sprite-check_on",id:"orion.explorer.deselectAllCommandChangeList",visibleWhen:function(b){var d=!1;a.model.getRoot(function(b){1<b.children.length&&(d=b.children.filter(function(b){return a.model.isStaged(b.type)}).length===Math.max(0,b.children.length-2))});return d},callback:function(b){a.model.getRoot(function(b){b=b.children.filter(function(b){return a.model.isStaged(b.type)});a.commandService.runCommand("eclipse.orion.git.unstageCommand",
b,a,null,a.status)})}}),f=new e.Command({tooltip:l.Commit,id:"eclipse.orion.git.precommitCommand",extraClass:"primaryButton",callback:function(b){var d=a.messageTextArea.value.trim();a.commandService.runCommand("eclipse.orion.git.commitCommand",b.items,b.handler,null,{name:d,amend:a.amendCheck.checked,changeId:a.changeIDCheck.checked})},visibleWhen:function(a){Array.isArray(a)||(a=[a]);f.name=n.formatMessage(l.SmartCountCommit,a.length);return!0}});this.commandService.addCommand(f);this.commandService.addCommand(b);
this.commandService.addCommand(d)}},createSelection:function(){if(!this.selection){this.selection=new d.Selection(this.registry,"orion.selection."+this.prefix+"Section");this.commandService.registerSelectionService(this.section.selectionNode.id,this.selection);var a=this.section,b=this.commandService,e=this;this.selection.addEventListener("selectionChanged",this._selectionListener=function(d){var f=a.selectionNode;f&&(b.destroy(f),b.renderCommands(a.selectionNode.id,f,d.selections,e,"button",{Clone:e.model.repository}));
"all"===e.prefix&&((d=a.titleActionsNode)&&b.destroy(d),b.renderCommands(d.id,d,e,e,"button"))})}},refreshSelection:function(){}});s.prototype=Object.create(k.SelectionRenderer.prototype);p.mixin(s.prototype,{getCellElement:function(a,d,e){var h,k,m,n=this.explorer;switch(a){case 0:h=document.createElement("td");a=document.createElement("div");a.className="sectionTableItem";h.appendChild(a);if("CommitMsg"===d.Type){e.classList.add("gitCommitListSection");k=document.createElement("div");k.id="gitCommitMessage";
k.className="gitCommitMessage toolComposite";h.colSpan=2;e.classList.remove("selectableNavRow");e=document.createElement("div");e.className="gitCommitMessageTopRow";var p=n.messageTextArea=document.createElement("textarea");p.rows=2;p.type="textarea";p.id="nameparameterCollector";p.placeholder=l.SmartCommit;p.classList.add("parameterInput");e.appendChild(p);p=document.createElement("div");p.className="gitCommitMessageBottomRow";var t=document.createElement("span");t.className="layoutRight parameters";
p.appendChild(t);var q=n.amendCheck=document.createElement("input");q.type="checkbox";q.id="amendparameterCollector";var s=b({serviceRegistry:n.registry,commandService:n.commandService}).amendEventListener;q.addEventListener(s.event,function(a){return s.handler(a,n)},s.capture);t.appendChild(q);var r=document.createElement("label");r.classList.add("parameterInput");r.setAttribute("for",q.id);r.textContent=l.SmartAmend;t.appendChild(r);q=n.changeIDCheck=document.createElement("input");q.type="checkbox";
q.id="changeIDparameterCollector";t.appendChild(q);r=document.createElement("label");r.classList.add("parameterInput");r.setAttribute("for",q.id);r.textContent=l.SmartChangeId;t.appendChild(r);k.appendChild(e);k.appendChild(p);a.appendChild(k)}else f.isChange(d)||"Diff"===d.Type?(this.getExpandImage(e,a),e=n.getNavDict()?n.getNavDict().getGridNavHolder(d,!0):null,m=document.createElement("span"),m.id=n.prefix+d.name+d.type+"DiffActionWrapper",m.className="sectionExplorerActions",a.appendChild(m),
n.commandService.destroy(m),n.commandService.renderCommands("DefaultActionWrapper",m,d,n,"tool",null,e),k=document.createElement("span"),k.className=n.model.getClass(d),k.commandTooltip=new g.Tooltip({node:k,text:n.model.getTooltip(d),position:["above","below","right","left"]}),a.appendChild(k),k=document.createElement("span"),k.textContent=d.name,a.appendChild(k)):"ExplorerSelection"===d.Type?(h.colSpan=2,k=document.createElement("span"),k.textContent=l.SelectAll,a.appendChild(k),k=document.createElement("div"),
k.className="layoutRight commandList",k.id=n.explorerSelectionScope,a.appendChild(k),n.commandService.renderCommands(k.id,k,n,n,"button")):(h.colSpan=2,e=document.createElement("div"),e.className="sectionExplorerActions",a.appendChild(e),m=document.createElement("span"),p=n.prefix+d.parent.name+d.parent.type,m.id=p+"DiffActionWrapperChange",e.appendChild(m),k=document.createElement("span"),k.id=p+"CompareWidgetActionWrapper",e.appendChild(k),p=document.createElement("div"),p.id="diffArea_"+d.DiffLocation,
p.style.height="420px",p.style.border="1px solid lightgray",p.style.overflow="hidden",a.appendChild(p),e=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(d,!0):null,f.createCompareWidget(n.registry,n.commandService,d.DiffLocation,"Conflicting"===d.parent.type,p,k.id,n.editableInComparePage,{navGridHolder:e,additionalCmdRender:function(a){n.commandService.destroy(m.id);n.commandService.renderCommands("itemLevelCommands",m.id,d.parent,n,"tool",!1,a)},before:!0}));return h}},onCheckedFunc:function(a,
b,d,e){"ExplorerSelection"===e.Type?b?this.explorer.commandService.runCommand("orion.explorer.selectAllCommandChangeList",this.explorer,this.explorer):this.explorer.commandService.runCommand("orion.explorer.deselectAllCommandChangeList",this.explorer,this.explorer):b?this.explorer.commandService.runCommand("eclipse.orion.git.stageCommand",[e],this.explorer):this.explorer.commandService.runCommand("eclipse.orion.git.unstageCommand",[e],this.explorer)},getCheckedFunc:function(a){return"ExplorerSelection"===
a.Type?!this.explorer.commandService.findCommand("orion.explorer.selectAllCommandChangeList").visibleWhen(this.explorer):this.explorer.model.isStaged(a.type)}});return{GitChangeListExplorer:t,GitChangeListRenderer:s,GitChangeListModel:q}});
define("orion/dynamicContent",["require","orion/commands","orion/webui/littlelib","orion/webui/tooltip"],function(l,n,m,k){function f(a,b){if(void 0===a)throw Error("Missing reqired argument: id");if(void 0===b)throw Error("Missing reqired argument: anchor");this._id=a;this._anchor=b;this._prefix="progressSpinner:"}function h(a,b){if(void 0===a)throw Error("Missing reqired argument: id");if(void 0===b)throw Error("Missing reqired argument: anchor");this._id=a;this._anchor=b;this._prefix="progressDots:"}
function g(a,b){if(!a)throw Error("Missing reqired argument: objects");if(!b)throw Error("Missing reqired argument: populate");this._objects=a;this._populate=b}function d(){}function a(a){if(!a)throw Error("Missing required argument: model");this._model=a;this.use(new d)}f.prototype={start:function(){var a=document.createElement("img");a.id=this._prefix+this._id;a.src=n.NO_IMAGE;a.className="progressPane_running";this._anchor.appendChild(a)},stop:function(){var a=m.node(this._prefix+this._id);a&&
a.parentNode.removeChild(a)},error:function(a){var b=m.node(this._prefix+this._id);b.src=l.toUrl("images/problem.gif");b.className="";new k.Tooltip({node:b,text:a})}};f.prototype.constructor=f;h.prototype={start:function(){var a=document.createElement("img");a.id=this._prefix+this._id;a.style.textDecoration="blink";a.appendChild(document.createTextNode(" ..."));this._anchor.appendChild(a)},stop:function(){var a=m.node(this._prefix+this._id);a&&a.parentNode.removeChild(a)},error:function(a){var b=
m.node(this._prefix+this._id);b.parentNode.removeChild(b);var d=document.createElement("img");d.src=l.toUrl("images/problem.gif");this._anchor.appendChild(d);new k.Tooltip({node:b,text:a})}};h.prototype.constructor=h;g.prototype={getObjects:function(){return this._objects},getDetails:function(a){return this._populate(a)}};g.prototype.constructor=g;d.prototype={progressIndicator:h,setupProperties:{progressIndicators:[]},errorHandler:function(a,b){this.explorer.progressIndicators[a].error(b)}};d.prototype.constructor=
d;a.prototype={render:function(){var a=this;this._initialRender&&this._initialRender();for(var b=function(b){return function(){a._renderAfterItemPopulation(b);a.progressIndicators[b].stop()}},d=function(b){return function(d){if(a._errorHandler)a._errorHandler(b,d);else throw Error(d);}},f=0;f<this._model.getObjects().length;f++)this._renderBeforeItemPopulation(f),this.progressIndicators[f].start(),this._model.getDetails(f).then(b(f),d(f));this._cleanupRender&&this._cleanupRender()},use:function(a){for(var b in a)if("populateItem"===
b)this._populateItem=a.populateItem.bind(a),a.explorer=this;else if("renderBeforeItemPopulation"===b)this._renderBeforeItemPopulation=a.renderBeforeItemPopulation.bind(a),a.explorer=this;else if("renderAfterItemPopulation"===b)this._renderAfterItemPopulation=a.renderAfterItemPopulation.bind(a),a.explorer=this;else if("errorHandler"===b)this._errorHandler=a.errorHandler.bind(a),a.explorer=this;else if("initialRender"===b)this._initialRender=a.initialRender.bind(a),a.explorer=this;else if("cleanupRender"===
b)this._cleanupRender=a.cleanupRender.bind(a),a.explorer=this;else if("progressIndicator"===b)this.progressIndicator=a.progressIndicator,a.explorer=this;else if("setupProperties"===b){for(var d in a.setupProperties)this[d]=a.setupProperties[d];a.explorer=this}}};a.prototype.constructor=a;return{DynamicContentModel:g,DynamicContentExplorer:a,DynamicContentRenderer:d,ProgressSpinner:f,ProgressDots:h}});
define("orion/git/widgets/gitCommitInfo","require i18n!git/nls/gitmessages orion/URITemplate orion/i18nUtil orion/git/util orion/objects".split(" "),function(l,n,m,k,f,h){function g(a){this.parent=a.parent;this.commit=a.commit;this.showTags=a.showTags;this.commitLink=a.commitLink}var d=new m("git/git-commit.html#{,resource,params*}?page\x3d1\x26pageSize\x3d1");h.mixin(g.prototype,{display:function(){var a=this.commit,e=this.parent,b=a.Message.split(/(\r?\n|$)/)[0],g;this.commitLink?(g=document.createElement("a"),
g.className="navlinkonpage",g.href=l.toUrl(d.expand({resource:a.Location}))):g=document.createElement("span");g.appendChild(document.createTextNode(f.trimCommitMessage(b)));e.appendChild(g);b=document.createElement("div");b.style.paddingTop="15px";e.appendChild(b);a.AuthorImage&&(e=new Image,e.src=a.AuthorImage,e.name=a.AuthorName,e.className="git-author-icon",b.appendChild(e));e=document.createElement("div");e.textContent=k.formatMessage(n[" authored by ${0} {${1}) on ${2}"],a.AuthorName,a.AuthorEmail,
(new Date(a.Time)).toLocaleString());b.appendChild(e);e=document.createElement("div");e.textContent=k.formatMessage(n["committed by 0 (1)"],a.CommitterName,a.CommitterEmail);b.appendChild(e);e=document.createElement("div");e.style.paddingTop="15px";e.textContent=n["commit:"]+a.Name;b.appendChild(e);e=f.getGerritFooter(a.Message);e.changeId&&(g=document.createElement("div"),g.style.paddingTop="15px",g.textContent=n["Change-Id: "]+e.changeId,b.appendChild(g));e.signedOffBy&&(g=document.createElement("div"),
g.textContent=n["Signed-off-by: "]+e.signedOffBy,b.appendChild(g));if(a.Parents&&0<a.Parents.length){g=document.createElement("div");g.textContent=n["parent:"];if(e.signedOffBy||e.changeId)g.style.paddingTop="15px";e=document.createElement("a");e.className="navlinkonpage";e.href=l.toUrl(d.expand({resource:a.Parents[0].Location}));e.textContent=a.Parents[0].Name;g.appendChild(e);b.appendChild(g)}g=this.showTags&&a.Tags&&0<a.Tags.length;if(a.Branches&&0<a.Branches.length){e=document.createElement("section");
e.style.paddingTop="15px";e.textContent=n["branches: "];b.appendChild(e);var h=document.createElement("div");e.appendChild(h);for(e=0;e<a.Branches.length;++e){var m=document.createElement("span");m.style.paddingLeft="10px";m.textContent=a.Branches[e].FullName;h.appendChild(m)}}if(g){e=document.createElement("div");e.style.paddingTop="15px";b.appendChild(e);e=document.createElement("section");b.appendChild(e);b=document.createElement("span");b.textContent=n["tags: "];e.appendChild(b);b=document.createElement("div");
e.appendChild(b);for(e=0;e<a.Tags.length;++e)g=document.createElement("span"),g.style.paddingLeft="10px",g.textContent=a.Tags[e].Name,b.appendChild(g)}}});return{GitCommitInfo:g}});
define("orion/git/widgets/CommitTooltipDialog",["orion/git/widgets/gitCommitInfo","orion/webui/popupdialog"],function(l,n){function m(k){this._init(k)}m.prototype=new n.PopupDialog;m.prototype.TEMPLATE='\x3cdiv id\x3d"parentPane" style\x3d"padding:10px; width:520px"\x3e\x3c/div\x3e';m.prototype._init=function(k){this.commit=k.commit;this._initialize(k.triggerNode,null,null,"mouseover",1E3)};m.prototype._bindToDom=function(k){this._displayCommit(this.commit)};m.prototype._displayCommit=function(k){(new l.GitCommitInfo({parent:this.$parentPane,
commit:k,showTags:!0,commitLink:!0})).display()};m.prototype.constructor=m;return{CommitTooltipDialog:m}});
define("orion/git/widgets/gitTagList","require i18n!git/nls/gitmessages orion/URITemplate orion/PageUtil orion/Deferred orion/dynamicContent orion/webui/littlelib orion/git/widgets/CommitTooltipDialog orion/objects".split(" "),function(l,n,m,k,f,h,g,d,a){function e(a){this.registry=a.serviceRegistry;this.commandService=a.commandRegistry;this.parentId=a.parentId;this.actionScopeId=a.actionScopeId;this.repository=a.repository;this.mode=a.mode;this.section=a.section;this.commit=a.commit}var b=new m("git/git-repository.html#{,resource,params*}?page\x3d1\x26pageSize\x3d20"),
p=new m("git/git-commit.html#{,resource,params*}?page\x3d1\x26pageSize\x3d1");a.mixin(e.prototype,{decorateTag:function(a,b){b=b||new f;this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").doGitLog(a.CommitLocation+"?page\x3d1\x26pageSize\x3d1"),"Getting tag last commit "+a.Name).then(function(d){a.Commit=d.Children[0];b.resolve()},function(a){b.reject()});return b},display:function(){var a=this,d=this.section,e=document.createElement("a"),m=k.matchResourceParameters();
e.href=m.resource;var e=e.search?e.search:"?page\x3d1\x26pageSize\x3d20",p=d.createProgressMonitor();p.begin(n["Getting tags"]);var x=document.createElement("div");x.className="mainPadding";var u=this.repository,w=this.mode;f.when(this.commit||this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitBranch(u.TagLocation+("full"===w?e:"?page\x3d1\x26pageSize\x3d5")),"Getting tags "+u.Name),function(e){var k=e.Children,m=!1;k||(k=e.Tags,m=!0);e=new h.DynamicContentModel(k,
function(b){return m?(new f).resolve():a.decorateTag.bind(a)(k[b])});e=new h.DynamicContentExplorer(e);e.use({initialRender:function(){p.done();var e=g.node(a.parentId);e&&(g.empty(e),e.appendChild(x),a.commandService.destroy(d.actionsNode.id),"full"!==w&&0!==k.length?(a.commandService.registerCommandContribution(d.actionsNode.id,"eclipse.orion.git.repositories.viewAllCommand",10),a.commandService.renderCommands(d.actionsNode.id,d.actionsNode.id,{ViewAllLink:l.toUrl(b.expand({resource:u.TagLocation})),
ViewAllLabel:n["View All"],ViewAllTooltip:n["View all tags"]},a,"button")):a.commit&&(a.commandService.registerCommandContribution(d.actionsNode.id,"eclipse.orion.git.addTag",100),a.commandService.renderCommands(d.actionsNode.id,d.actionsNode,a.commit,a,"button")),0===k.length&&d.setTitle(n["No Tags"]))},renderBeforeItemPopulation:function(b){var d=document.createElement("div");d.className="sectionTableItem lightTreeTableRow";x.appendChild(d);var e=document.createElement("div");e.style.overflow="hidden";
d.appendChild(e);d=document.createElement("div");d.className="stretch";e.appendChild(d);var f=document.createElement("span");f.textContent=k[b].Name;d.appendChild(f);this.explorer.progressIndicators[b]=new this.explorer.progressIndicator(b,f);f=document.createElement("div");f.id="tagDetailsView"+b;d.appendChild(f);d=document.createElement("div");d.className="sectionTableItemActions";d.id="tagActionsArea";e.appendChild(d);a.commandService.renderCommands(a.actionScopeId,d,k[b],a,"tool")},renderAfterItemPopulation:function(b){a.renderTag(k[b],
b)}});e.render()},function(b){p.done();a.handleError(b)})},renderTag:function(a,b){var e=document.createElement("span");e.className="tag-description";g.empty(g.node("tagDetailsView"+b));g.node("tagDetailsView"+b).appendChild(e);var f=a.Commit;if(f){var h=document.createElement("a");h.className="navlinkonpage";h.href=l.toUrl(p.expand({resource:f.Location}));h.textContent=f.Message;e.appendChild(h);e.appendChild(document.createTextNode(n[" by "]+f.AuthorName+n[" on "]+(new Date(f.Time)).toLocaleString()));
new d.CommitTooltipDialog({commit:f,triggerNode:h})}}});return{GitTagListExplorer:e}});
define("orion/git/widgets/ConfirmPushDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(l,n){function m(k){this._init(k)}m.prototype=new n.Dialog;m.prototype.TEMPLATE='\x3cdiv id\x3d"header"\x3e\x3c/div\x3e';m.prototype._init=function(k){var f=this;this.title="Git Push";this.modal=!0;this.messages=l;this.location=k.location;this.moreCallback=k.moreCallback;this.func=k.func;this._afterHiding=k.closeCallback;this.buttons=[];this.moreCallback&&this.buttons.push({callback:function(){f.destroy();
f.moreCallback()},text:"More"});this.buttons.push({callback:function(){f.destroy();f.func()},text:"OK"});this._initialize()};m.prototype._bindToDom=function(k){k=this.$header;k.appendChild(document.createTextNode("You are going to push to the following remote: "+this.location));k.appendChild(document.createElement("br"));this.moreCallback&&k.appendChild(document.createTextNode(" Click More to push to another remote or OK to push to default."))};m.prototype.constructor=m;return{ConfirmPushDialog:m}});
define("orion/git/widgets/RemotePrompterDialog",["i18n!git/nls/gitmessages","orion/webui/dialog","orion/explorers/explorer","orion/selection"],function(l,n,m,k){function f(d,a){this.explorer=a;this._init(d)}function h(d){this._init(d)}var g=function(){function d(a,d,b,f){this.gitClient=a;this.rootPath=d;this.fetchItems=b;this.root=f?f:null}d.prototype=new m.ExplorerModel;d.prototype.getRoot=function(a){var d=this;this.root?a(this.root):this.fetchItems(this.rootPath).then(function(b){d.root=b;a(b)})};
d.prototype.getIdentity=function(a){a.Location?(a=a.Location,a=a.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")):a="ROOT";return a};d.prototype.getChildren=function(a,d){a.children=[];if(a.Children){for(var b=0;b<a.Children.length;b++)a.Children[b].parent=a,a.children[b]=a.Children[b];d(a.Children)}else a.BranchLocation&&a.RemoteLocation?(a.children=[{GroupNode:"true",Location:a.BranchLocation,Name:"Branches",parent:a},{GroupNode:"true",Location:a.RemoteLocation,BranchLocation:a.BranchLocation,Name:"Remotes",
parent:a},{GroupNode:"true",Location:a.TagLocation,Name:"Tags",parent:a}],d(a.children)):a.GroupNode?this.gitClient.getGitBranch(a.Location).then(function(b){a.children=b.Children;for(var f=0;f<b.Children.length;f++)b.Children[f].parent=a;d(b.Children)}):"Remote"===a.Type&&this.gitClient.getGitBranch(a.Location).then(function(b){a.children=b.Children;for(var f=0;f<b.Children.length;f++)b.Children[f].parent=a;d(b.Children)})};return d}();f.prototype=new m.SelectionRenderer;f.prototype.constructor=
f;f.prototype.getLabelColumnIndex=function(){return 0};f.prototype.getCellElement=function(d,a,e){var b=document.createElement("td");e.appendChild(b);d=document.createElement("span");d.id=e.id+"navSpan";b.appendChild(d);d.className="mainNavColumn singleNavColumn";(a.children||a.Children||a.GroupNode||"Remote"===a.Type||a.BranchLocation&&a.RemoteLocation)&&this.getExpandImage(e,d);e=a.Name;"RemoteTrackingBranch"===a.Type&&!a.Id&&(e=a.Name+l[" [New branch]"]);d.appendChild(document.createTextNode(e))};
h.prototype=new n.Dialog;h.prototype.TEMPLATE='\x3cdiv\x3e\x3cdiv id\x3d"treeContentPane" style\x3d"width:25em; min-height: 25em; max-height: 30em; height: auto; overflow-y: auto; padding: 8px"\x3e\x3c/div\x3e\x3cdiv id\x3d"newBranchPane" style\x3d"padding: 8px"\x3e\x3clabel for\x3d"newBranch"\x3e${New Branch:}\x3c/label\x3e\x3cinput id\x3d"newBranch" value\x3d"" disabled\x3dtrue/\x3e\x3c/div\x3e\x3c/div\x3e';h.prototype._init=function(d){var a=this;this.title=d.title||l["Choose a Folder"];this.modal=
!0;this.messages=l;this.func=d.func;this.treeRoot=d.treeRoot;this.gitClient=d.gitClient;this.hideNewBranch=d.hideNewBranch;this.serviceRegistry=d.serviceRegistry;this._afterHiding=d.closeCallback;this.buttons=[];this.buttons.push({callback:function(){a.$remoteOk.classList.contains(this.DISABLED)||(a.destroy(),a._execute.bind(a)())},text:"OK",isDefault:!0,id:"remoteOk"});this._initialize()};h.prototype._bindToDom=function(d){var a=this;this.$newBranch.addEventListener("input",function(d){a._validate()});
this.$newBranch.placeholder=l["No remote selected"];this.hideNewBranch&&(this.$newBranchPane.style.display="none")};h.prototype._beforeShowing=function(){this._loadRemoteChildren()};h.prototype._afterShowing=function(){this.$treeContentPane.focus();this._validate()};h.prototype._loadRemoteChildren=function(){var d=new g(this.gitClient,null,this.gitClient.getGitClone,this.treeRoot);this._createTree(d)};h.prototype._createTree=function(d){var a=this,e=this.serviceRegistry.getService("orion.remotePrompter.selection");
e||(e=new k.Selection(this.serviceRegistry,"orion.remotePrompter.selection"));var b=new f({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"});this.explorer=new m.Explorer(this.serviceRegistry,e,b);b.explorer=this.explorer;this.explorer.createTree("treeContentPane",d);e.addEventListener("selectionChanged",function(b){b.selection&&"Remote"===b.selection.Type?(a.$newBranch.disabled=!1,a.$newBranch.placeholder=l["Enter a name..."]):(a.$newBranch.disabled=!0,a.$newBranch.placeholder=l["No remote selected"]);
a._validate(b.selection)})};h.prototype._validate=function(d){var a=function(a){a&&"RemoteTrackingBranch"===a.Type?this.$remoteOk.classList.remove(this.DISABLED):a&&"Remote"===a.Type&&""!==this.$newBranch.value?this.$remoteOk.classList.remove(this.DISABLED):this.$remoteOk.classList.add(this.DISABLED)};d?a.bind(this)(d):this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(a.bind(this))};h.prototype._execute=function(){var d=this;this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(function(a){if(d.func)if("RemoteTrackingBranch"===
a.Type)d.func(a,a.parent);else{var e=a.CloneLocation.substring(a.CloneLocation.indexOf(a.CloneLocation.split("/")[3])),b={};b.parent=a;b.FullName="refs/remotes/"+a.Name+"/"+d.$newBranch.value;b.Name=a.Name+"/"+d.$newBranch.value;b.Type="RemoteTrackingBranch";b.Location="/gitapi/remote/"+a.Name+"/"+encodeURIComponent(encodeURIComponent(d.$newBranch.value))+"/"+e;d.func(null,a,b)}})};h.prototype.constructor=h;return{RemotePrompterDialog:h}});
define("orion/git/widgets/ReviewRequestDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(l,n){function m(k){this._init(k)}m.prototype=new n.Dialog;m.prototype.TEMPLATE='\x3cdiv\x3e\x3cdiv id\x3d"treeContentPane" style\x3d"padding: 8px"\x3e\x3clabel for\x3d"reviewReqUrl"\x3e${Paste link in email or IM}\x3c/label\x3e\x3cbr\x3e\x3cinput id\x3d"reviewReqUrl" style\x3d"width: 50em" value\x3d""/\x3e\x3c/div\x3e\x3cdiv id\x3d"newBranchPane" style\x3d"padding: 8px"\x3e\x3clabel for\x3d"reviewerName"\x3e${Send the link to the reviewer}\x3c/label\x3e\x3cbr\x3e\x3cinput id\x3d"reviewerName" style\x3d"width: 30em"  value\x3d""/\x3e\x3c/div\x3e\x3c/div\x3e';
m.prototype._init=function(k){var f=this;this.title=k.title||l["Contribution Review Request"];this.modal=!0;this.messages=l;this.url=k.url;this.func=k.func;this.buttons=[];this.buttons.push({callback:function(){f.destroy();f.func(f.$reviewerName.value)},text:l.Submit});this._initialize()};m.prototype._bindToDom=function(k){this.$reviewReqUrl.value=this.url};m.prototype.constructor=m;return{ReviewRequestDialog:m}});
define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(l,n){var m;m=l.toUrl?(new URL(l.toUrl("workspace"),window.location.href)).href:(new URL("/",window.location.href)).href;return{makeRelative:function(k){if(!k)return k;var f=window.location.protocol+"//"+window.location.host;return 0===k.indexOf(f)?k.substring(f.length):k},isAtRoot:function(k){return!k?!1:"/workspace"===k?!0:0===(new URL(k,window.location.href)).href.indexOf(m)}}});
define("orion/explorers/explorer-table","i18n!orion/navigate/nls/messages orion/Deferred orion/webui/littlelib orion/i18nUtil orion/fileUtils orion/explorers/explorer orion/EventTarget orion/objects orion/util".split(" "),function(l,n,m,k,f,h,g,d,a){function e(a,b,d,e,f,g){this.registry=a;this.root=b;this.fileClient=d;this.idPrefix=e||"";this.excludeFiles=!!f;this.excludeFolders=!!g}function b(a){g.attach(this);this.registry=a.serviceRegistry;this.treeRoot=a.treeRoot;this.selection=a.selection;this.fileClient=
a.fileClient;this.excludeFiles=a.excludeFiles;this.excludeFolders=a.excludeFolders;this.navHandlerFactory=a.navHandlerFactory;this.parentId=a.parentId;this.renderer=a.rendererFactory(this);this.dragAndDrop=a.dragAndDrop;this.setFocus=a.setFocus;this.myTree=this.model=null;this._hookedDrag=this.checkbox=!1;var b=a.modelEventDispatcher?a.modelEventDispatcher:new g;this.modelEventDispatcher=b;var d=this;this._modelListeners={};"copy copyMultiple create delete deleteMultiple import move moveMultiple".split(" ").forEach(function(a){b.addEventListener(a,
d._modelListeners[a]=d.modelHandler[a].bind(d))});this._clickListener=function(a){if("A"===a.target.tagName){for(a=a.target;a&&!a._item;)a=a.parentNode;if(a&&a._item)d.onLinkClick({type:"linkClick",item:a._item})}};(a=m.node(this.parentId))&&a.addEventListener("click",this._clickListener);var e=this.renderer;this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(a){a=a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?"_blank":"_self":"_self";e.setTarget&&e.setTarget(a)}},
{pid:"nav.config"})}e.prototype=new h.ExplorerModel;d.mixin(e.prototype,{getRoot:function(a){a(this.root)},processParent:function(a,b){var d=a.Projects?[]:[a].concat(a.Parents||[]);if(this.excludeFiles||this.excludeFolders){var e=[],f;for(f in b)if(!(b[f].Directory?this.excludeFolders:this.excludeFiles))e.push(b[f]),b[f].parent=a,b[f].Parents||(b[f].Parents=d);b=e}else for(e in b)b[e].parent=a,b[e].Parents||(b[e].Parents=d);a.children=b;a.children.sort(this.sortChildren);return b},sortChildren:function(a,
b){var d=a.Directory;if(d!==b.Directory)return d?-1:1;var d=a.Name&&a.Name.toLowerCase(),e=b.Name&&b.Name.toLowerCase();return d<e?-1:d>e?1:0},getChildren:function(a,b){var d=this;if(a.children)b(a.children);else if(void 0!==a.Directory&&!1===a.Directory)b([]);else if(a.Children)b(d.processParent(a,a.Children));else if(a.Location){var e=null;this.registry&&(e=this.registry.getService("orion.page.progress"));(e?e.progress(this.fileClient.fetchChildren(a.ChildrenLocation),l["Fetching children of "]+
a.Name):this.fileClient.fetchChildren(a.ChildrenLocation)).then(function(e){d.destroyed||b(d.processParent(a,e))},function(){b([])})}else b([])},hasChildren:function(){var a=!1;this.root.Children&&(a=0<this.root.Children.length);return a}});e.prototype.constructor=e;var p,q;b.prototype=Object.create(h.Explorer.prototype);d.mixin(b.prototype,{destroy:function(){var a=this;Object.keys(this._modelListeners).forEach(function(b){a.modelEventDispatcher.removeEventListener(b,a._modelListeners[b])});var b=
m.node(this.parentId);b&&b.removeEventListener("click",this._clickListener);h.Explorer.prototype.destroy.call(this)},onLinkClick:function(a){this.dispatchEvent(a)},onModelCreate:function(a){return this.changedItem(a.parent,!0)},onModelCopy:function(a){var b=this,d={};(a.items||[a]).forEach(function(a){a=(a=a.parent)||b.treeRoot;d[a.Location]=a});return n.all(Object.keys(d).map(function(a){return b.changedItem(d[a],!0)}))},onModelMove:function(a){var b=this,d={};(a.items||[a]).forEach(function(a){var e=
b.treeRoot;if((e.Location||e.ContentLocation)===a.oldValue.Location){var f=b.treeRoot;a=a.newValue;a=a.ChildrenLocation?a:this.fileClient.read(a.ContentLocation,!0);return n.when(a,function(a){b.dispatchEvent({type:"rootMoved",oldValue:f,newValue:a});b.loadResourceList(a)})}e=(e=a.oldValue.parent)||b.treeRoot;d[e.Location]=e;e=(e=a.parent)||b.treeRoot;d[e.Location]=e;a.oldValue.Directory&&(a.newValue&&b.isExpanded(a.oldValue))&&(d[a.newValue.Location]=a.newValue)});return n.all(Object.keys(d).map(function(a){return b.changedItem(d[a],
!0)}))},onModelDelete:function(a){a=a.items||[a];var b=this,d=b.treeRoot,e;if(a.some(function(a){if(a.oldValue.Location===(d.Location||d.ContentLocation)){if(a.oldValue.Location!==(a.parent.Location||a.parent.ContentLocation))e=a.parent;return!0}return!1}))return this.loadResourceList(e);var f={};a.forEach(function(a){a=a.parent;f[a.Location]=a});return n.all(Object.keys(f).map(function(a){return b.changedItem(f[a],!0)}))},modelHandler:{copy:function(a){if(!a.count)return this.onModelCopy(a)},copyMultiple:function(a){return this.onModelCopy(a)},
create:function(a){return this.onModelCreate(a)},"delete":function(a){if(!a.count)return this.onModelDelete(a)},deleteMultiple:function(a){return this.onModelDelete(a)},"import":function(a){return this.changedItem(a.target,!0)},move:function(a){if(!a.count)return this.onModelMove(a)},moveMultiple:function(a){return this.onModelMove(a)}},makeNewChildItemPlaceholder:function(a,b,d){var e=new n;this.model.getChildren(a,function(f){var g=null,h=!1;if(f){f.push(b);f.sort(this.model.sortChildren);var g=
f.indexOf(b),k=g+1;f.length>k?g=f[k]:(h=g-1,g=0<=h?f[h]:a,h=!0)}else g=a;f=this.makeNewItemPlaceholder(g,d,h);e.resolve(f)}.bind(this));return e},_makeDropTarget:function(b,d,e){if(this.dragAndDrop){var g=this,h=this.dragAndDrop,u=function(a){p=a.target};e&&(this._oldDragStart&&d.removeEventListener("dragstart",this._oldDragStart,!1),this._oldDragStart=u);d.addEventListener("dragstart",u,!1);u=function(a){p=null};e&&(this._oldDragEnd&&d.removeEventListener("dragend",this._oldDragEnd,!1),this._oldDragEnd=
u);d.addEventListener("dragend",u,!1);u=function(a){d.classList.remove("dragOver");a.preventDefault();a.stopPropagation()};e&&(this._oldDragLeave&&d.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=u);d.addEventListener("dragleave",u,!1);u=function(b){if(p)q=b.dataTransfer.dropEffect=(a.isMac?b.altKey:b.ctrlKey)?"copy":"move";else if(!a.isIE&&("all"===b.dataTransfer.effectAllowed||"uninitialized"===b.dataTransfer.effectAllowed||0<=b.dataTransfer.effectAllowed.indexOf("copy")))b.dataTransfer.dropEffect=
"copy";d.classList.add("dragOver");m.stop(b)};e&&(this._oldDragEnter&&d.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=u);d.addEventListener("dragenter",u,!1);u=function(b){if(p)q=b.dataTransfer.dropEffect=(a.isMac?b.altKey:b.ctrlKey)?"copy":"move";else if(!a.isIE&&("all"===b.dataTransfer.effectAllowed||"uninitialized"===b.dataTransfer.effectAllowed||0<=b.dataTransfer.effectAllowed.indexOf("copy")))b.dataTransfer.dropEffect="copy";m.stop(b)};e&&!this._oldDragOver&&(d.addEventListener("dragover",
u,!1),this._oldDragOver=u);var w=null,z=null;g.registry&&(w=g.registry.getService("orion.page.progress"),z=g.registry.getService("orion.page.message"));var B=function(a){if(z){var b=null,b="string"===typeof a?{Severity:"Error",Message:a}:a&&a.error?{Severity:"Error",Message:a.error}:a;z.setProgressResult(b)}else window.console.log(a)},v=function(a,d,e,g,h,m){var p=!1,q=f.isAtRoot(d.Location);m?(p=!0,m.entryCount++):a.isDirectory&&(p=!0,m={entryCount:1,deferred:new n},e._makeUploadNode(d,a.name,!0).then(function(a){var b=
function(){a.destroyFunction();q?e.loadResourceList(e.treeRoot.Path,!0):e.changedItem(d)};m.deferred.then(b,b)}));var s=function(){m&&(m.entryCount--,0===m.entryCount&&m.deferred.resolve())},r=function(a){if(z){var b=null,b="string"===typeof a?{Severity:"Error",Message:a}:a&&a.error?{Severity:"Error",Message:a.error}:a;z.setProgressResult(b)}else window.console.log(a);s()};!d.Location&&d.fileMetadata&&(d=d.fileMetadata);if(a.isFile)q?r(l["You cannot copy files directly into the workspace.  Create a folder first."]):
a.file(function(a){if(m){var f=a.name.indexOf(".zip")===a.name.length-4&&window.confirm(k.formatMessage(l["Unzip ${0}?"],a.name));g(d,a,e,f,!1,{error:function(b){b=l["Uploading the following file failed: "]+a.name;z?z.setProgressResult({Severity:"Error",Message:b}):window.console.log(b)},loadend:s},!0)}else e._uploadFile(b,a,!0)}.bind(this));else if(a.isDirectory){var u=a.createReader(),y=function(a){u.readEntries(function(b){for(var d=0;d<b.length;d++)v(b[d],a,e,g,h,m);s()})};q?(w?w.progress(h.createProject(d.ChildrenLocation,
a.name),k.formatMessage(l["Creating ${0}"],a.name)):h.createProject(d.ChildrenLocation,a.name)).then(function(a){(w?w.progress(h.read(a.ContentLocation,!0),l["Loading "]+a.name):h.read(a.ContentLocation,!0)).then(function(a){y(a)},r)},r):(w?w.progress(h.createFolder(d.Location,a.name),k.formatMessage(l["Creating ${0}"],a.name)):h.createFolder(d.Location,a.name)).then(function(a){var d=e.modelEventDispatcher;p||d.dispatchEvent({type:"create",parent:b,newValue:a});y(a)},r)}},u=function(a){var e;d.classList.remove("dragOver");
if(p){e=g.fileClient;for(var n=p,u;n;){if(n._item){u=n._item;break}n=n.parentNode}if(!u)return;var y="copy"===q;e=(y?e.copyFile:e.moveFile).apply(e,[u.Location,b.Location,u.Name]);w&&(n=k.formatMessage(l[y?"Copying ${0}":"Moving ${0}"],u.Location),e=w.showWhile(e,n));e.then(function(a){g.modelEventDispatcher.dispatchEvent({type:y?"copy":"move",oldValue:u,newValue:a,parent:b})},B)}else if(a.dataTransfer.items&&0<a.dataTransfer.items.length)for(e=0;e<a.dataTransfer.items.length;e++)n=null,"function"===
typeof a.dataTransfer.items[e].getAsEntry?n=a.dataTransfer.items[e].getAsEntry():"function"===typeof a.dataTransfer.items[e].webkitGetAsEntry&&(n=a.dataTransfer.items[e].webkitGetAsEntry()),n&&v(n,b,g,h,g.fileClient);else if(a.dataTransfer.files&&0<a.dataTransfer.files.length)for(e=0;e<a.dataTransfer.files.length;e++)n=a.dataTransfer.files[e],!n.size&&!n.type?B(k.formatMessage(l["Did not drop ${0}.  Folder drop is not supported in this browser."],n.name)):f.isAtRoot(b.Location)?B(l["You cannot copy files directly into the workspace.  Create a folder first."]):
g._uploadFile(b,n,!0);m.stop(a)};e&&(this._oldDrop&&d.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=u);d.addEventListener("drop",u,!1)}},_uploadFile:function(a,b,d){var e=a;!e.Location&&e.fileMetadata&&(e=e.fileMetadata);a=function(){this._makeUploadNode(e,b.name,!1).then(function(a){var d=a.refNode,f=a.progressBar,g=a.cancelButton,h=a.destroyFunction,m=this.registry.getService("orion.page.message");a={progress:function(a){var b="";if(a.lengthComputable){b=Math.floor(100*(a.loaded/a.total))+
"%";f.style.width=b;var e=Math.round(a.loaded/1024);a=Math.round(a.total/1024);f.title=l["Upload progress: "]+b+",  "+e+"/"+a+" KB";d.title=f.title}},loadend:function(a){h();this.changedItem(e)}.bind(this),error:function(a){a=l["Uploading the following file failed: "]+b.name;m?m.setProgressResult({Severity:"Error",Message:a}):window.console.log(a)}};var n=b.name.indexOf(".zip")===b.name.length-4&&window.confirm(k.formatMessage(l["Unzip ${0}?"],b.name)),p=this.dragAndDrop(e,b,this,n,!1,a,!0);g.addEventListener("click",
function(){p.abort()})}.bind(this))}.bind(this);d?this.expandItem(e,!1).then(a):a()},_makeUploadNode:function(a,b,d){var e=this.getRow(a).id;return this.makeNewChildItemPlaceholder(a,{Name:b,Directory:d},e).then(function(a){var e=null,f,g;if(a){e={};f=a.refNode;g=a.wrapperNode;f.classList.add("uploadNode");e.refNode=f;e.wrapperNode=g;g=document.createElement("span");g.classList.add("uploadNodeText");g.appendChild(document.createTextNode(b));f.appendChild(g);g=document.createElement("span");g.classList.add("progressBarWrapper");
var h=document.createElement("span");h.classList.add("progressBar");g.appendChild(h);f.appendChild(g);e.progressBar=h;d?(h.classList.add("continuous"),f.title=l["Uploading "]+b,h.title=f.title):(g=document.createElement("button"),g.classList.add("imageSprite"),g.classList.add("core-sprite-delete"),g.classList.add("uploadCancelButton"),g.title=l["Cancel upload"],f.appendChild(g),e.cancelButton=g);e.destroyFunction=a.destroyFunction}return e}.bind(this))},createModel:function(){return new e(this.registry,
this.treeRoot,this.fileClient,this.parentId,this.excludeFiles,this.excludeFolders)},changedItem:function(a,b){if(this.treeRoot&&this.treeRoot.Location===a.Location)return this.loadResourceList(this.treeRoot,b);var d=this,e=new n;a.children=a.Children=null;this.model.getChildren(a,function(f){d.getNavHandler();d.myTree.refresh.bind(d.myTree)(a,f,b);e.resolve(f)});return e},showItem:function(a,b){var d=new n;if(!a||!this.model||!this.myTree||!this.myTree.showRoot&&a.Location===this.treeRoot.Location)return d.reject();
var e=this.getRow(a);if(e)d.resolve(e._item||a);else return a.Parents&&0<a.Parents.length?(a.Parents[0].Parents=a.Parents.slice(1),this.expandItem(a.Parents[0],b).then(function(b){var d=this.getRow(a);return!d?this.changedItem(b,!0).then(function(){var b=this.getRow(a);return b?b._item:(new n).reject()}.bind(this)):d._item||a}.bind(this))):void 0===b||b?this.reroot(a):d.reject();return d},expandItem:function(a,b){var d=new n;this.showItem(a,b).then(function(a){this.myTree.isExpanded(a)?d.resolve(a):
this.myTree.expand(this.model.getId(a),function(){d.resolve(a)})}.bind(this),d.reject);return d},reveal:function(a,b){return this.showItem(a,b).then(function(a){var b=this.getNavHandler();b&&(b.cursorOn(a,!0),b.setSelection(a));return a}.bind(this))},reroot:function(a){return(new n).reject()},isExpanded:function(a){a=this.model.getId(a);return this.renderer.tableTree.isExpanded(a)},getNameNode:function(a){if(a=this.model.getId(a))return m.node(a+"NameLink")},scopeUp:function(){},scopeDown:function(a){},
loadResourceList:function(a,b,d){a&&"object"===typeof a&&(a=a.ChildrenLocation||a.ContentLocation);a=f.makeRelative(a);if(!b&&a===this._lastPath)return(new n).resolve(this.treeRoot);this._lastPath=a;var e=this;return b||a!==this.treeRoot.Path?this.load(this.fileClient.loadWorkspace(a),l["Loading "]+a).then(function(b){e.treeRoot.Path=a;"function"===typeof d&&d();e.dispatchEvent({type:"rootChanged",root:e.treeRoot});return(new n).resolve(e.treeRoot)},function(a){e.treeRoot.Path=null;e.dispatchEvent({type:"rootChanged",
root:e.treeRoot});return(new n).reject(a)}):(new n).resolve(e.treeRoot)},load:function(a,b,d){var e=m.node(this.parentId),f=m.node("progress");f||(f=document.createElement("div"),f.id="progress",m.empty(e),e.appendChild(f));m.empty(f);var g=setTimeout(function(){m.empty(f);f.appendChild(document.createTextNode(b))},500),h=this;return n.when(a,function(a){clearTimeout(g);if(!h.destroyed){h.treeRoot={};for(var b in a)h.treeRoot[b]=a[b];h.model=h.createModel();h.dragAndDrop&&(h._hookedDrag?h._makeDropTarget(h.treeRoot,
e,!0):(a=(a=e&&("draggable"in e||"ondragstart"in e&&"ondrop"in e))&&!(!window.File||!window.FileList||!window.FileReader),h._hookedDrag=!0,a?h._makeDropTarget(h.treeRoot,e,!0):(h.dragAndDrop=null,window.console.log("Local file drag and drop is not supported in this browser."))));var f=new n;h.createTree(h.parentId,h.model,{onComplete:function(a){f.resolve(a)},navHandlerFactory:h.navHandlerFactory,setFocus:"undefined"===typeof h.setFocus?!0:h.setFocus,selectionPolicy:h.renderer.selectionPolicy,onCollapse:function(a){if(h.getNavHandler())h.getNavHandler().onCollapse(a)}});
return f.then(function(){if("function"===typeof d)try{d()}catch(a){h.registry&&h.registry.getService("orion.page.message").setErrorMessage(a)}if("function"===typeof h.onchange)h.onchange(h.treeRoot);return h.treeRoot})}},function(a){clearTimeout(g);h.registry&&h.registry.getService("orion.page.message").setProgressResult(a);return(new n).reject(a)})},onchange:function(a){}});b.prototype.constructor=b;return{FileExplorer:b,FileModel:e}});
define("orion/webui/dialogs/DirectoryPrompterDialog","i18n!orion/widgets/nls/messages orion/webui/littlelib orion/webui/dialog orion/fileUtils orion/selection orion/explorers/navigationUtils orion/explorers/explorer orion/explorers/explorer-table".split(" "),function(l,n,m,k,f,h,g,d){function a(a,d){this.explorer=d;this._init(a)}function e(a){this._init(a)}a.prototype=new g.SelectionRenderer;a.prototype.constructor=a;a.prototype.getLabelColumnIndex=function(){return 0};a.prototype.getCellElement=
function(a,d,e){a=document.createElement("td");e.appendChild(a);var f=document.createElement("span");f.id=e.id+"navSpan";a.appendChild(f);f.className="mainNavColumn singleNavColumn";this.getExpandImage(e,f);f.appendChild(document.createTextNode(d.Name))};e.prototype=new m.Dialog;e.prototype.TEMPLATE='\x3cdiv id\x3d"message" style\x3d"width: 25em; padding-bottom: 5px;"\x3e\x3c/div\x3e\x3cdiv id\x3d"directoryTree" class\x3d"explorerTreeClass" style\x3d"width:25em; min-height: 25em; max-height:30em; height: auto; overflow-y: auto;"\x3e\x3c/div\x3e';
e.prototype._init=function(a){this.title=a.title||l["Choose a Folder"];this.modal=!0;this.buttons=[{text:l.OK,isDefault:!0,callback:this.done.bind(this)}];this.customFocus=!0;this._fileClient=a.fileClient;this._serviceRegistry=a.serviceRegistry;this._message=a.message||"";this._func=a.func;this._initialize()};e.prototype._bindToDom=function(a){this.loadFolderList("/");this._message?this.$message.appendChild(document.createTextNode(this._message)):this.$message.style.display="none";this.$directoryTree.focus()};
e.prototype.loadFolderList=function(b){b=k.makeRelative(b);this.selection=new f.Selection(this._serviceRegistry,"orion.directoryPrompter.selection");this.explorer=new d.FileExplorer({treeRoot:{children:[]},selection:this.selection,serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,parentId:"directoryTree",excludeFiles:!0,rendererFactory:function(b){return new a({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"},b)}});this.explorer.loadResourceList(b,!0,null)};e.prototype.done=
function(){this.selection.getSelection(function(a){this.hide();this._func(a)}.bind(this))};e.prototype.constructor=e;return{DirectoryPrompterDialog:e}});
define("orion/git/widgets/CloneGitRepositoryDialog",["i18n!git/nls/gitmessages","orion/webui/dialogs/DirectoryPrompterDialog","orion/webui/dialog","orion/URITemplate","require"],function(l,n,m,k,f){function h(d){this._init(d)}var g=new k("edit/edit.html#{,resource,params*}");h.prototype=new m.Dialog;h.prototype.TEMPLATE='\x3cspan id\x3d"basicPane"\x3e\x3cdiv style\x3d"padding: 8px"\x3e\x3clabel for\x3d"gitUrl"\x3e${Repository URL:}\x3c/label\x3e\x3cinput id\x3d"gitUrl" style\x3d"width: 50em" value\x3d""/\x3e\x3c/div\x3e\x3cdiv style\x3d"padding: 8px; text-align: right;"\x3e\x3ca id\x3d"advancedLink" href\x3d"javascript:"\x3e${Choose target location}\x3c/a\x3e\x3ca id\x3d"advancedLinkHide" href\x3d"javascript:" style\x3d"display: none"\x3e${Default target location}\x3c/a\x3e\x3c/div\x3e\x3c/span\x3e\x3cspan id\x3d"advancedPane" style\x3d"display: none;"\x3e\x3cdiv style\x3d"padding: 8px"\x3e\x3cinput id\x3d"isNewProject" type\x3d"radio" name\x3d"isNewProject" checked value\x3d"new"/\x3e\x3clabel for\x3d"gitName" style\x3d"padding: 0 8px"\x3e${New folder:}\x3c/label\x3e\x3cinput id\x3d"gitName" value\x3d""\x3e\x3c/div\x3e\x3cdiv style\x3d"padding: 8px"\x3e\x3cinput id\x3d"isExistingProject" type\x3d"radio" name\x3d"isNewProject" value\x3d"existing"/\x3e\x3clabel for\x3d"gitPath" style\x3d"padding: 0 8px"\x3e${Existing directory:}\x3c/label\x3e\x3cinput id\x3d"gitPath" type\x3d"hidden" value\x3d""\x3e\x3cspan id\x3d"shownGitPath" style\x3d"padding-right: 24px"\x3e\x3c/span\x3e\x3ca id\x3d"changeGitPath" href\x3d"javascript:"\x3e${Change...}\x3c/a\x3e\x3c/div\x3e\x3c/span\x3e';h.prototype._init=
function(d){var a=this;this.title=d.title?d.title:l["Clone Git Repository"];this.modal=!0;this.messages=l;this.advancedShown=!1;this.alwaysShowAdvanced=d.alwaysShowAdvanced;this.advancedOnly=d.advancedOnly;this.url=d.url;this.serviceRegistry=d.serviceRegistry;this.fileClient=d.fileClient;this.func=d.func;this.buttons=[];this.buttons.push({callback:function(){a.destroy();a._execute()},text:"OK"});this._initialize()};h.prototype._bindToDom=function(d){var a=this;this.url&&(this.$gitUrl.value=this.url);
this.advancedOnly&&(this.$basicPane.style.display="none",this.$advancedPane.style.display="",setTimeout(function(){a.$gitName.focus()},400));this.$changeGitPath.addEventListener("click",function(d){a._openDirectoryPickerDialog()});this.$isExistingProject.addEventListener("click",function(d){a._checkNewExisting()});this.$isNewProject.addEventListener("click",function(d){a._checkNewExisting()});this.$gitName.addEventListener("focus",function(d){a._showNewProject()});this.$advancedLink.addEventListener("click",
function(d){a._showAdvanced()});this.$advancedLinkHide.addEventListener("click",function(d){a._hideAdvanced()});this.alwaysShowAdvanced&&this._showAdvanced()};h.prototype._execute=function(){this.func&&this.func(this.advancedOnly?void 0:this.$gitUrl.value,this.advancedShown&&this.$isNewProject.checked?void 0:this.$gitPath.value,this.advancedShown&&!this.$isNewProject.checked?void 0:this.$gitName.value)};h.prototype._showAdvanced=function(){this.advancedShown=!0;this.$advancedPane.style.display="";
this.$advancedLink.style.display="none";this.$advancedLinkHide.style.display=""};h.prototype._hideAdvanced=function(){this.advancedShown=!1;this.$advancedPane.style.display="none";this.$advancedLink.style.display="";this.$advancedLinkHide.style.display="none"};h.prototype._checkNewExisting=function(){this.$isExistingProject.checked?this._openDirectoryPickerDialog():this.$gitName.focus()};h.prototype._showNewProject=function(){this.$isNewProject.checked=!0};h.prototype._openDirectoryPickerDialog=function(){function d(a){var d=
document.createElement("a");d.href=f.toUrl(g.expand({resource:a.ChildrenLocation}));d.textContent=a.Name;return d}var a=this;this.$isExistingProject.checked=!0;var e=new n.DirectoryPrompterDialog({title:l["Choose a Folder"],serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,func:function(b){if(b&&b.Location){for(a.$gitPath.value=b.Location;a.$shownGitPath.hasChildNodes();)a.$shownGitPath.removeChild(a.$shownGitPath.lastChild);for(a.$shownGitPath.appendChild(d(b));b.parent&&"/"!==b.parent.Location;)a.$shownGitPath.insertBefore(document.createTextNode("/"),
a.$shownGitPath.firstChild),a.$shownGitPath.insertBefore(d(b.parent),a.$shownGitPath.firstChild),b=b.parent}}});this._addChildDialog(e);e.show()};h.prototype.constructor=h;return{CloneGitRepositoryDialog:h}});
define("orion/git/widgets/OpenCommitDialog","require i18n!git/nls/gitmessages orion/i18nUtil orion/Deferred orion/webui/dialog orion/URITemplate orion/webui/littlelib".split(" "),function(l,n,m,k,f,h,g){function d(a){this._init(a)}var a=new h("git/git-commit.html#{,resource,params*}?page\x3d1\x26pageSize\x3d1");d.prototype=new f.Dialog;d.prototype.TEMPLATE='\x3cdiv\x3e\x3clabel for\x3d"resourceName"\x3e${Type the commit name (sha1):}\x3c/label\x3e\x3c/div\x3e\x3cdiv\x3e\x3cinput type\x3d"text" id\x3d"resourceName"\x3e\x3c/div\x3e\x3cdiv id\x3d"results" style\x3d"max-height:400px; height:auto; overflow-y:auto;"\x3e\x3c/div\x3e';
d.prototype._init=function(a){this.title=a.title||n["Find Commit"];this.modal=!0;this.messages=n;this.SEARCH_DELAY=500;this.timeoutId=null;this.time=0;this.serviceRegistry=a.serviceRegistry;if(!this.serviceRegistry)throw Error("Missing required argument: serviceRegistry");this.repositories=a.repositories;if(!this.repositories)throw Error("Missing required argument: repositories");this.commitName=a.commitName;this._initialize()};d.prototype._bindToDom=function(a){var b=this;this.$resourceName.addEventListener("input",
function(a){b.time=+new Date;b.timeoutId&&clearTimeout(b.timeoutId);b.timeoutId=setTimeout(b._checkSearch.bind(b),0)},!1);this.$resourceName.addEventListener("keydown",function(a){if(a.keyCode===g.KEY.ENTER){var d=g.$("a",b.$results);d&&(g.stop(a),window.open(d.href),b.hide())}},!1);this.$resourceName.value=this.commitName};d.prototype._checkSearch=function(){clearTimeout(this.timeoutId);var a=(new Date).getTime();a-this.time>this.SEARCH_DELAY?(this.time=a,this._doSearch()):this.timeoutId=setTimeout(this._checkSearch.bind(this),
50)};d.prototype._findCommitLocation=function(a,b,d){var f=this;d||(d=new k);0<a.length?this.serviceRegistry.getService("orion.page.progress").progress(f.serviceRegistry.getService("orion.git.provider").doGitLog("/gitapi/commit/"+b+a[0].ContentLocation+"?page\x3d1\x26pageSize\x3d1"),"Getting commit details "+b).then(function(a){d.resolve(a.Children[0])},function(g){f._findCommitLocation(a.slice(1),b,d)}):d.reject();return d};d.prototype._doSearch=function(){var a=this,b=this.$resourceName&&this.$resourceName.value;
if(b){var d=document.createElement("div");d.appendChild(document.createTextNode(n["Searching..."]));g.empty(this.$results);this.$results.appendChild(d);this.serviceRegistry.getService("orion.page.message").setProgressMessage(n["Looking for the commit"]);this._findCommitLocation(this.repositories,b).then(function(b){g.empty(a.$results);a._displayCommit(b,a.$results);a.serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(b){b=document.createElement("div");b.appendChild(document.createTextNode("No commits found"));
g.empty(a.$results);a.$results.appendChild(b);a.serviceRegistry.getService("orion.page.message").setProgressMessage("")})}};d.prototype._displayCommit=function(d,b){var f=this,h=document.createElement("div");h.style.padding="10px";h.style.maxWidth="480px";g.empty(b);b.appendChild(h);var k=d.Message.split(/(\r?\n|$)/)[0],s=document.createElement("a");s.className="navlinkonpage";s.href=l.toUrl(a.expand({resource:d.Location}));s.textContent=k;h.appendChild(s);s.addEventListener("mouseup",function(a){0===
a.button&&(!a.ctrlKey&&!a.metaKey)&&f.hide()},!1);s.addEventListener("keyup",function(a){a.keyCode===g.KEY.ENTER&&f.hide()},!1);k=document.createElement("div");k.style.paddingTop="15px";h.appendChild(k);d.AuthorImage&&(h=new Image,h.src=d.AuthorImage,h.name=d.AuthorName,h.className="git-author-icon",k.appendChild(h));h=document.createElement("div");h.textContent=m.formatMessage(n[" authored by ${0} {${1}) on ${2}"],d.AuthorName,d.AuthorEmail,(new Date(d.Time)).toLocaleString());k.appendChild(h);h=
document.createElement("div");h.textContent=m.formatMessage(n["committed by 0 (1)"],d.CommitterName,d.CommitterEmail);k.appendChild(h);h=document.createElement("div");h.style.paddingTop="15px";h.textContent=n["commit:"]+d.Name;k.appendChild(h);d.Parents&&0<d.Parents.length&&(b=document.createElement("div"),b.textContent=n["parent:"],h=document.createElement("a"),h.className="navlinkonpage",h.href=l.toUrl(a.expand({resource:d.Parents[0].Location})),h.textContent=d.Parents[0].Name,b.appendChild(h),
h.addEventListener("mouseup",function(a){0===a.button&&(!a.ctrlKey&&!a.metaKey)&&f.hide()},!1),h.addEventListener("keyup",function(a){a.keyCode===g.KEY.ENTER&&f.hide()},!1),k.appendChild(b))};d.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};d.prototype.constructor=d;return{OpenCommitDialog:d}});
define("orion/git/widgets/ApplyPatchDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(l,n){function m(k){this._init(k)}m.prototype=new n.Dialog;m.prototype.TEMPLATE='\x3cdiv style\x3d"padding:4px"\x3e\x3cinput type\x3d"radio" name\x3d"radio" value\x3d"urlRadio" id\x3d"urlRadio" checked/\x3e'+l["URL:"]+'\x3cinput type\x3d"text" name\x3d"url" id\x3d"url"/\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3cinput type\x3d"radio" name\x3d"radio" value\x3d"fileRadio" id\x3d"fileRadio"/\x3e'+
l["File:"]+'\x3cinput type\x3d"file" name\x3d"selectedFile" id\x3d"selectedFile" class\x3d"uploadChooser" /\x3e\x3c/div\x3e';m.prototype._init=function(k){var f=this;this.title=l["Apply Patch"];this.modal=!0;this.messages=l;this.options=k;this.buttons=[];this.buttons.push({callback:function(){f._applyPatch()},text:l.OK});this._initialize()};m.prototype._bindToDom=function(k){this.$selectedFile.onchange=function(f){this.$urlRadio.checked=!1;this.$fileRadio.checked="fileRadio"}.bind(this);this.$url.onchange=
function(f){this.$urlRadio.checked="urlRadio";this.$fileRadio.checked=!1}.bind(this)};m.prototype._applyPatch=function(k){k=new FormData;k.append("uploadedfile",this.$selectedFile.files[0]);k.append("url",this.$url.value);k.append("radio",this.$fileRadio.checked?"fileRadio":"urlRadio");this.req=new XMLHttpRequest;this.req.open("post",this.options.diffLocation);this.req.setRequestHeader("Orion-Version","1");this.req.onreadystatechange=this.handleReadyState.bind(this);this.req.send(k)};m.prototype.handleReadyState=
function(k){4===this.req.readyState&&(200===this.req.status?this.options.deferred&&this.options.deferred.resolve(this.req.responseText):this.options.deferred&&this.options.deferred.reject(this.req.responseText),this.hide())};m.prototype.constructor=m;return{ApplyPatchDialog:m}});
define("orion/git/logic/gitPush","i18n!git/nls/gitmessages orion/commandRegistry orion/git/widgets/ConfirmPushDialog orion/git/gitPreferenceStorage orion/git/logic/gitCommon orion/Deferred orion/git/widgets/RemotePrompterDialog".split(" "),function(l,n,m,k,f,h,g){var d=f.handleGitServiceResponse,a=f.handleProgressServiceResponse,e=f.gatherSshCredentials;return function(b){var f=b.serviceRegistry,q=b.commandService,t=b.tags,s=b.force,y=b.gerrit,r=b.confirmDialogCloseCallback,x=b.remotePrompterDialogCloseCallback,
u=b.sshCredentialsDialogCloseCallback,w=b.sshSlideoutCloseCallback,z=function(b,d,e){var k=new h,m=new h,n=f.getService("orion.git.provider"),q=f.getService("orion.page.progress");1===d.RemoteLocation.length&&d.RemoteLocation[0].Children&&1===d.RemoteLocation[0].Children.length?m=q.progress(n.getGitRemote(b.RemoteLocation),"Getting git remote details "+d.Name):m.resolve({Children:d.RemoteLocation});m.then(function(h){var m=function(b){a(b,{},f);k.reject(b)};(new g.RemotePrompterDialog({title:l["Choose Branch"],
serviceRegistry:f,gitClient:n,closeCallback:function(){k.reject()},treeRoot:{Children:h.Children},hideNewBranch:!1,func:function(a,f,g){var h;h=null===a?g:a;if(void 0===e||e){var l="branch."+d.Name+".remote";q.progress(n.addCloneConfigurationProperty(b.ConfigLocation,l,h.parent.Name),"Adding git configuration property "+d.Name).then(function(){k.resolve(h)},function(a){409===a.status?n.getGitCloneConfig(b.ConfigLocation).then(function(a){if(a.Children)for(var b=0;b<a.Children.length;b++)if(a.Children[b].Key===
l){q.progress(n.editCloneConfigurationProperty(a.Children[b].Location,h.parent.Name),"Updating configuration property "+h.parent.Name).then(function(){k.resolve(h)},m);break}},m):m(a)})}else k.resolve(h)}})).show()});return k};return{perform:function(a){function b(a){var h=a.targetBranch,r=a.confirmedWarnings;if(s&&!r)if(confirm(l["You're going to override content of the remote branch. This can cause the remote repository to lose commits."]+"\n\n"+l["Are you sure?"]))r=a.confirmedWarnings=!0;else{g.reject();
return}var u=a.items;u.LocalBranch&&u.RemoteBranch&&(h=u.RemoteBranch,u=u.LocalBranch);u.toRef&&(u=u.toRef);a.command||(a.command={},a.command.callback=b);var w=function(a,b){a.JsonData.HostKey?(b.parameters=null,b.errorData=a.JsonData,b.errorData.failedOperation=a.failedOperation,q.collectParameters(b,E)):b.optionsRequested?(b.errorData=a.JsonData,b.errorData.failedOperation=a.failedOperation,q.collectParameters(b,E)):(new k(f)).isEnabled().then(function(d){b.parameters=d?a.JsonData.User?new n.ParametersDescription([new n.CommandParameter("sshpassword",
"password",l["Password:"]),new n.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):new n.ParametersDescription([new n.CommandParameter("sshuser","text",l["User Name:"]),new n.CommandParameter("sshpassword","password",l["Password:"]),new n.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new n.ParametersDescription([new n.CommandParameter("sshpassword","password",l["Password:"])],
{hasOptionalParameters:!0}):new n.ParametersDescription([new n.CommandParameter("sshuser","text",l["User Name:"]),new n.CommandParameter("sshpassword","password",l["Password:"])],{hasOptionalParameters:!0});b.errorData=a.JsonData;b.errorData.failedOperation=a.failedOperation;q.collectParameters(b,E)})};if(a.parameters&&a.parameters.optionsRequested)a.parameters=null,a.optionsRequested=!0,q.collectParameters(a,E);else{var B=f.getService("orion.git.provider"),P=f.getService("orion.page.progress");a.errorData&&
a.errorData.failedOperation&&P.removeOperation(a.errorData.failedOperation);var J=function(b,e,h,k,m){var n=f.getService("orion.page.message");b=P.progress(B.doPush(e,h,t,m,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),l["Pushing remote: "]+k);n.createProgressMonitor(b,l["Pushing remote: "]+k);b.then(function(b){d(b,f,function(){g.resolve()},function(b){w(b,a)})},function(b){d(b,f,function(){g.resolve()},function(b){w(b,a)})})};P.progress(B.getGitClone(u.CloneLocation),
"Getting git repository details "+u.Name).then(function(b){var d=b.Children[0];e(f,a,null,C).then(function(b){if(h)J(b,h.Location,"HEAD",h.Name,s);else{var e=function(){z(d,u).then(function(d){a.targetBranch=d;a.items.RemoteLocation=d.parent;J(b,d.Location,"HEAD",d.Name,s)},function(){"function"===typeof x&&x();g.reject()})};if(1===u.RemoteLocation.length&&u.RemoteLocation[0].Children&&1===u.RemoteLocation[0].Children.length){var k=u.RemoteLocation[0].Children[0],n=u.Name;if(y){var q=u.RemoteLocation[0].Children[0].Location.split("/"),
n="refs/for/master";q[4]=encodeURIComponent(encodeURIComponent(n));q=q.join("/");k.Location=q;k.Name=n}(new m.ConfirmPushDialog({title:l["Choose Branch"],serviceRegistry:f,gitClient:B,moreCallback:function(){e()},location:k.Name,func:function(){a.targetBranch=k;J(b,k.Location,"HEAD",n,s)},closeCallback:D})).show()}else e()}})})}}var g=new h,D=function(){"function"===typeof r&&r();g.reject()},C=function(){"function"===typeof u&&u();g.reject()},E=function(){"function"===typeof w&&w();g.reject()};b(a);
return g},chooseRemote:z}}});
define("orion/git/gitCommands","i18n!git/nls/gitmessages require orion/Deferred orion/i18nUtil orion/webui/littlelib orion/commands orion/commandRegistry orion/git/util orion/compare/compareUtils orion/git/gitPreferenceStorage orion/git/gitConfigPreference orion/git/widgets/ConfirmPushDialog orion/git/widgets/RemotePrompterDialog orion/git/widgets/ReviewRequestDialog orion/git/widgets/CloneGitRepositoryDialog orion/git/widgets/GitCredentialsDialog orion/git/widgets/OpenCommitDialog orion/git/widgets/CommitDialog orion/git/widgets/ApplyPatchDialog orion/URL-shim orion/PageLinks orion/URITemplate orion/git/logic/gitPush orion/git/logic/gitCommit orion/objects".split(" "),function(l,
n,m,k,f,h,g,d,a,e,b,p,q,t,s,y,r,x,u,w,z,B,v,A,D){var C={};(function(){function p(a){var b;try{b=JSON.parse(a.responseText)}catch(d){b={Message:l["Problem while performing the action"]}}b.HttpCode=a.status;return b}var q=!1,w=new B("git/git-repository.html#{,resource,params*}"),x=new B("git/git-log.html#{,resource,params*}?page\x3d1"),G=new B("git/git-log.html#{,resource,params*}"),H=new B("git/git-commit.html#{,resource,params*}?page\x3d1\x26pageSize\x3d1"),I=new B("edit/edit.html#{,resource,params*}");
C.updateNavTools=function(a,b,d,e,g,h,k){var l=f.node(e);if(l)b.destroy(l);else throw"could not find toolbar "+e;b.renderCommands(e,l,h,d,"button");if(k&&(e=f.node(k)))b.destroy(e),b.renderCommands(k,e,h,d,"button");if(g&&(h=f.node(g)))b.destroy(g),b.renderCommands(g,h,null,d,"button");q||(q=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var e=f.node(g);e&&(b.destroy(e),b.renderCommands(g,e,a.selections,d,"button"))}))};C.handleKnownHostsError=function(a,b,
e,f){if(confirm(k.formatMessage(l["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],b.KeyType,b.Host,b.HostFingerprint))){var g=d.parseSshGitUrl(b.Url);b={host:b.Host,keyType:b.KeyType,hostKey:b.HostKey,port:g.port};a.getService("orion.net.ssh").addKnownHost(b).then(function(b){e.knownHosts=b;"undefined"!==typeof e.failedOperation&&a.getService("orion.page.progress").removeOperation(e.failedOperation);f(e)})}};C.handleSshAuthenticationError=function(a,b,
d,f,g){b=b?b.Url:void 0;var h=function(){(new y.GitCredentialsDialog({title:g,serviceRegistry:a,func:f,errordata:d.errordata,failedOperation:d.failedOperation})).show()};d.gitSshUsername&&""!==d.gitSshUsername||d.gitSshPassword&&""!==d.gitSshPassword||d.gitPrivateKey&&""!==d.gitPrivateKey?h():(new e(a)).get(b).then(function(b){""!==b.gitPrivateKey||""!==b.gitSshUsername||""!==b.gitSshPassword?("undefined"!==typeof d.failedOperation&&a.getService("orion.page.progress").removeOperation(d.failedOperation),
f({knownHosts:d.knownHosts,gitSshUsername:b.gitSshUsername,gitSshPassword:b.gitSshPassword,gitPrivateKey:b.gitPrivateKey,gitPassphrase:b.gitPassphrase})):h()},h)};C.getDefaultSshOptions=function(a,b,e){var f=new m;a=a.getService("orion.net.ssh");var g=e&&!e.optionsRequested?e.valueFor("sshuser"):"",h=e&&!e.optionsRequested?e.valueFor("sshpassword"):"",k;void 0!==b.GitUrl?k=b.GitUrl:void 0!==b.errorData?k=b.errorData.Url:void 0!==b.toRef?k=b.toRef.RemoteLocation[0].GitUrl:void 0!==b.RemoteLocation&&
(k=b.RemoteLocation[0].GitUrl);if(!k)return f.resolve({knownHosts:"",gitSshUsername:g,gitSshPassword:h,gitPrivateKey:"",gitPassphrase:""}),f;b=d.parseSshGitUrl(k);a.getKnownHostCredentials(b.host,b.port).then(function(a){f.resolve({knownHosts:a,gitSshUsername:g,gitSshPassword:h,gitPrivateKey:"",gitPassphrase:""})});return f};C.handleProgressServiceResponse=function(a,b,d,e,f,g){a&&void 0!==a.status&&(a=p(a));if(!a||void 0===a.HttpCode)e&&e(a);else switch(a.HttpCode){case 401:a.JsonData&&(b.errordata=
a.JsonData);a.failedOperation&&(b.failedOperation=a.failedOperation);C.handleSshAuthenticationError(d,a.JsonData,b,f,g);break;case 400:if(a.JsonData&&a.JsonData.HostKey){a.failedOperation&&(b.failedOperation=a.failedOperation);C.handleKnownHostsError(d,a.JsonData,b,f);break}else if(a.JsonData&&a.JsonData.Host){a.JsonData&&(b.errordata=a.JsonData);a.failedOperation&&(b.failedOperation=a.failedOperation);C.handleSshAuthenticationError(d,a.JsonData,b,f,g);break}default:b=[],b.Severity="Error",b.HTML=
!1,b.Message=a.DetailedMessage?a.DetailedMessage:a.Message,d.getService("orion.page.message").setProgressResult(b),e&&e(a)}};C.gatherSshCredentials=function(a,b,f,g){var h=new m,n;void 0!==b.items.RemoteLocation?n=b.items.RemoteLocation[0].GitUrl:void 0!==b.items.GitUrl?n=b.items.GitUrl:void 0!==b.items.errorData?n=b.items.errorData.Url:void 0!==b.items.toRef&&(n=b.items.toRef.RemoteLocation[0].GitUrl);g=a.getService("orion.net.ssh");var p=d.parseSshGitUrl(n),q=function(d){a.getService("orion.net.ssh").getKnownHostCredentials(p.host,
p.port).then(function(a){b.sshObject=d;h.resolve({knownHosts:a,gitSshUsername:d.gitSshUsername,gitSshPassword:d.gitSshPassword,gitPrivateKey:d.gitPrivateKey,gitPassphrase:d.gitPassphrase})})},s=b.errorData;if(s&&s.HostKey){if(confirm(k.formatMessage(l["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],s.KeyType,s.Host,s.HostFingerprint))){var t=d.parseSshGitUrl(s.Url);g.addKnownHost({host:s.Host,keyType:s.KeyType,hostKey:s.HostKey,port:t.port}).then(function(){b.sshObject&&
(""!==b.sshObject.gitSshUsername||""!==b.sshObject.gitSshPassword||""!==b.sshObject.gitPrivateKey)?q({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""}):(new e(a)).get(n).then(function(a){q(a)},function(){q({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})})}return h}var r=function(){if(!b.parameters&&!b.optionsRequested)q({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""});else if(b.parameters&&!b.optionsRequested){var d=b.parameters&&
b.parameters.valueFor("sshuser")?b.parameters.valueFor("sshuser"):b.errorData.User,g=b.parameters?b.parameters.valueFor("sshpassword"):"",h=b.parameters&&b.parameters.valueFor("saveCredentials")?b.parameters.valueFor("saveCredentials"):!1,k=new e(a);h?k.put(n,{gitSshUsername:d,gitSshPassword:g}).then(function(){q({gitSshUsername:d,gitSshPassword:g,gitPrivateKey:"",gitPassphrase:""})}):q({gitSshUsername:d,gitSshPassword:g,gitPrivateKey:"",gitPassphrase:""})}else(new y.GitCredentialsDialog({title:f,
serviceRegistry:a,func:q,errordata:s})).show()};b.sshObject&&(""!==b.sshObject.gitSshUsername||""!==b.sshObject.gitSshPassword||""!==b.sshObject.gitPrivateKey)?r():(new e(a)).get(n).then(function(a){""!==a.gitPrivateKey||""!==a.gitSshUsername||""!==a.gitSshPassword?q(a):r()},r);return h};C.handleGitServiceResponse=function(a,b,d,f){a&&void 0!==a.status&&(a=p(a));if(!a||!a.HttpCode)d&&d(a);else switch(a.HttpCode){case 401:var g=new e(b);g.isEnabled().then(function(b){b&&void 0!==a.JsonData.Url?g.remove(a.JsonData.Url).then(function(){f(a)}):
f(a)});break;case 400:if(a.JsonData&&a.JsonData.HostKey){f(a);break}default:var h=[];h.Severity="Error";h.HTML=!1;h.Message="REJECTED_NONFASTFORWARD"===(a.DetailedMessage?a.DetailedMessage:a.Message)?l.REJECTED_NONFASTFORWARD:a.DetailedMessage?a.DetailedMessage:a.Message;b.getService("orion.page.message").setProgressResult(h);d&&d(a)}};C.createFileCommands=function(b,d,f,p){function q(a){var d={Severity:"Error",HTML:!1};try{var e=JSON.parse(a.responseText);401===a.status?(d.HTML=!0,d.Message="\x3cspan\x3e",
d.Message+=k.formatMessage(l["Authentication required for: ${0}. ${1} and re-try the request."],e.label,'\x3ca target\x3d"_blank" href\x3d"'+e.SignInLocation+'"\x3e'+l.Login+"\x3c/a\x3e")+"\x3c/span\x3e"):d.Message=e.DetailedMessage?e.DetailedMessage:e.Message?e.Message:l["Problem while performing the action"]}catch(f){d.Message=l["Problem while performing the action"]}b.getService("orion.page.message").setProgressResult(d)}var s=function(a){a&&a.handler.changedItem?a.handler.changedItem():f.changedItem()},
r=new g.ParametersDescription([new g.CommandParameter("name","text",l["Local Branch Name:"])]),r=new h.Command({name:l.Checkout,tooltip:l["Checkout the current tag, creating a local branch based on its contents."],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutTag",parameters:r,callback:function(a){var d=a.items,e=function(a,d,e){b.getService("orion.page.progress").showWhile(b.getService("orion.git.provider").checkoutTag(a,d,e),k.formatMessage(l["Checking out tag ${0}"],
e)).then(function(){f.changedItem()},q)},g=d.Repository?d.Repository.Location:d.CloneLocation;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&e(g,d.Name,a.parameters.valueFor("name"))},visibleWhen:function(a){return"Tag"===a.Type||"Commit"===a.Type}});d.addCommand(r);r=new h.Command({name:l.Checkout,tooltip:l["Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first."],
imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutBranch",callback:function(a){var d=a.items,e=b.getService("orion.git.provider"),g=b.getService("orion.page.message"),h=b.getService("orion.page.progress");g.setProgressMessage(d.Name?k.formatMessage(l["Checking out branch ${0}..."],d.Name):l["Checking out branch..."]);"Branch"===d.Type?h.progress(e.checkoutBranch(d.CloneLocation,d.Name),"Checking out branch "+d.Name).then(function(){g.setProgressResult(l["Branch checked out."]);
f.changedItem(d.parent)},function(a){q(a)}):h.progress(e.addBranch(d.Repository?d.Repository.BranchLocation:d.parent.parent.repository.BranchLocation,null,d.Name),"Adding branch "+d.Name).then(function(a){h.progress(e.checkoutBranch(a.CloneLocation,a.Name),"Checking out branch "+d.Name).then(function(){g.setProgressResult(l["Branch checked out."]);f.changedItem(d.Repository?d.Repository.BranchLocation:d.parent.parent.parent)},function(a){q(a)})},function(a){q(a)})},visibleWhen:function(a){return"Branch"===
a.Type||"RemoteTrackingBranch"===a.Type}});d.addCommand(r);r=new g.ParametersDescription([new g.CommandParameter("name","text","Name:")]);r=new h.Command({name:l["New Branch"],tooltip:l["Add a new local branch to the repository"],id:"eclipse.addBranch",parameters:r,callback:function(a){var d=a.items,e=b.getService("orion.page.progress"),g=function(a,g){e.progress(b.getService("orion.git.provider").addBranch(a,g),"Adding branch "+g).then(function(){f.changedItem(d)},q)},h;h="Clone"===d.Type?d.BranchLocation:
d.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&g(h,a.parameters.valueFor("name"))},visibleWhen:function(a){return a.GroupNode&&"Branches"===a.Name||"Clone"===a.Type&&"artifacts"===f.parentId}});d.addCommand(r);r=new h.Command({name:l.Delete,tooltip:l["Delete the local branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeBranch",callback:function(a){var d=a.items;a=b.getService("orion.page.progress");confirm(k.formatMessage(l["Are you sure you want to delete branch ${0}?"],
d.Name))&&a.progress(b.getService("orion.git.provider").removeBranch(d.Location),"Removing branch "+d.Name).then(function(){f.changedItem?f.changedItem(d.parent):f.displayBranches&&f.displayBranches(d.ParentLocation,null)},q)},visibleWhen:function(a){return"Branch"===a.Type&&!a.Current}});d.addCommand(r);r=new h.Command({name:l.Delete,tooltip:l["Delete the remote tracking branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemoteBranch",callback:function(a){var d=a.items,
e=b.getService("orion.page.progress");confirm(k.formatMessage(l["You're going to delete remote branch ${0} and push the change."],d.Name)+"\n\n"+l["Are you sure?"])&&C.getDefaultSshOptions(b,d).then(function(a){var g=arguments.callee,h=b.getService("orion.git.provider"),k=b.getService("orion.page.message"),h=e.progress(h.doPush(d.Location,"",!1,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),l["Removing remote branch: "]+d.Name);k.createProgressMonitor(h,l["Removing remote branch: "]+
d.Name);h.then(function(e){C.handleProgressServiceResponse(e,a,b,function(a){"Ok"==a.Result.Severity&&f.changedItem(d.parent)},g,l["Delete Remote Branch"])},function(e,f){C.handleProgressServiceResponse(e,a,b,function(){},g,l["Removing remote branch: "]+d.Name)})})},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type}});d.addCommand(r);r=new g.ParametersDescription([new g.CommandParameter("name","text","Name:"),new g.CommandParameter("url","url","Url:")]);r=new h.Command({name:l["New Remote"],
tooltip:l["Add a new remote to the repository"],id:"eclipse.addRemote",parameters:r,callback:function(a){var d=a.items,e=b.getService("orion.page.progress"),g=function(a,g,h){e.progress(b.getService("orion.git.provider").addRemote(a,g,h),"Adding remote "+a).then(function(){f.changedItem(d)},q)},h;h="Clone"===d.Type?d.RemoteLocation:d.Location;a.parameters.valueFor("name")&&a.parameters.valueFor("url")&&g(h,a.parameters.valueFor("name"),a.parameters.valueFor("url"))},visibleWhen:function(a){return a.GroupNode&&
"Remotes"===a.Name||"Clone"===a.Type&&"artifacts"===f.parentId}});d.addCommand(r);r=new h.Command({name:l.Delete,tooltip:l["Delete the remote from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemote",callback:function(a){var d=a.items;confirm(k.formatMessage(l["Are you sure you want to delete remote ${0}?"],d.Name))&&b.getService("orion.page.progress").progress(b.getService("orion.git.provider").removeRemote(d.Location),"Removing remote "+d.Name).then(function(){f.changedItem(d.parent)},
q)},visibleWhen:function(a){return"Remote"===a.Type}});d.addCommand(r);r=new h.Command({name:l.Pull,tooltip:l["Pull from the repository"],imageClass:"git-sprite-pull",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pull",callback:function(a){var d=a.items,e=d.Location,g=d.Name;C.getDefaultSshOptions(b,d).then(function(a){var h=arguments.callee,k=b.getService("orion.git.provider"),m=b.getService("orion.page.message"),k=b.getService("orion.page.progress").progress(k.doPull(e,!1,a.gitSshUsername,
a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),l["Pulling: "]+g);m.createProgressMonitor(k,l["Pulling: "]+g);var n;k.then(function(e){C.handleProgressServiceResponse(e,a,b,function(a){"Clone"===d.Type&&f.changedItem(d)},h,"Pull Git Repository")},function(e,g){n&&(e.failedOperation=n);C.handleProgressServiceResponse(e,a,b,function(){f.changedItem(d)},h,l["Pull Git Repository"])},function(a){n=a.Location})})},visibleWhen:function(a){return"Clone"===a.Type}});d.addCommand(r);r=new h.Command({name:l["Git Log"],
tooltip:l["Open the log for the branch"],id:"eclipse.openGitLog",hrefCallback:function(a){return n.toUrl(x.expand({resource:a.items.CommitLocation}))},visibleWhen:function(a){return"Branch"===a.Type||"RemoteTrackingBranch"===a.Type}});d.addCommand(r);r=new h.Command({name:l["Git Log"],tooltip:l["Open the log for the repository"],id:"eclipse.openGitLogAll",imageClass:"git-sprite-log",spriteClass:"gitCommandSprite",hrefCallback:function(a){return n.toUrl(x.expand({resource:a.items.CommitLocation}))},
visibleWhen:function(a){return!a.CommitLocation||!a.StatusLocation?!1:!0}});d.addCommand(r);r=new h.Command({name:l.ShowInEditor,tooltip:l.ShowInEditorTooltip,id:"eclipse.openCloneContent",hrefCallback:function(a){return n.toUrl(I.expand({resource:a.items.ContentLocation}))},visibleWhen:function(a){return!a.ContentLocation?!1:!0}});d.addCommand(r);r=new h.Command({name:l["Compare With Each Other"],id:"eclipse.compareGitCommits",hrefCallback:function(d){d=d.items;return b.getService("orion.page.progress").progress(b.getService("orion.git.provider").getDiff(d[1].DiffLocation,
d[0].Name),"Generating Diff for "+d[0].Name+" and "+d[1].Name).then(function(b){return a.generateCompareHref(b.Location,{readonly:!0})})},visibleWhen:function(a){return f.isDirectory?!1:Array.isArray(a)&&2===a.length&&"Commit"===a[0].Type&&"Commit"===a[1].Type?!0:!1}});d.addCommand(r);r=new h.Command({name:l["Compare With Working Tree"],imageClass:"git-sprite-compare",spriteClass:"gitCommandSprite",id:"eclipse.compareWithWorkingTree",hrefCallback:function(b){return a.generateCompareHref(b.items.DiffLocation,
{})},visibleWhen:function(a){return"Commit"===a.Type&&null!==a.ContentLocation&&!f.isDirectory}});d.addCommand(r);r=new h.Command({name:l.Open,id:"eclipse.openGitCommit",imageClass:"git-sprite-open",spriteClass:"gitCommandSprite",hrefCallback:function(a){return n.toUrl(I.expand({resource:a.items.ContentLocation}))},visibleWhen:function(a){return"Commit"===a.Type&&null!=a.ContentLocation&&!f.isDirectory}});d.addCommand(r);var u=function(a,f,h){var k=new m;if(h&&!h(h))return k.reject(),k;h=a.items;
var n=!1;h.LocalBranch&&h.RemoteBranch&&(n=h.noAuth,h=h.RemoteBranch);var p=h.Location,r=h.Name,s=function(a,f){a.JsonData.HostKey?(f.parameters=null,f.errorData=a.JsonData,f.errorData.failedOperation=a.failedOperation,d.collectParameters(f)):f.optionsRequested?(f.errorData=a.JsonData,f.errorData.failedOperation=a.failedOperation,d.collectParameters(f)):(new e(b)).isEnabled().then(function(b){f.parameters=b?a.JsonData.User?new g.ParametersDescription([new g.CommandParameter("sshpassword","password",
l["Password:"]),new g.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):new g.ParametersDescription([new g.CommandParameter("sshuser","text",l["User Name:"]),new g.CommandParameter("sshpassword","password",l["Password:"]),new g.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new g.ParametersDescription([new g.CommandParameter("sshpassword","password",l["Password:"])],{hasOptionalParameters:!0}):
new g.ParametersDescription([new g.CommandParameter("sshuser","text",l["User Name:"]),new g.CommandParameter("sshpassword","password",l["Password:"])],{hasOptionalParameters:!0});f.errorData=a.JsonData;f.errorData.failedOperation=a.failedOperation;d.collectParameters(f)})},t=function(){a.parameters&&a.parameters.optionsRequested?(a.parameters=null,a.optionsRequested=!0,d.collectParameters(a)):(a.errorData&&a.errorData.failedOperation&&b.getService("orion.page.progress").removeOperation(a.errorData.failedOperation),
C.gatherSshCredentials(b,a,null).then(function(d){var e=b.getService("orion.git.provider"),g=b.getService("orion.page.message");d=b.getService("orion.page.progress").progress(e.doFetch(p,f,d.gitSshUsername,d.gitSshPassword,d.knownHosts,d.gitPrivateKey,d.gitPassphrase),l["Fetching remote: "]+r);g.createProgressMonitor(d,l["Fetching remote: "]+r);d.then(function(d){C.handleGitServiceResponse(d,b,function(){k.resolve()},function(b){s(b,a)})},function(d){var e=d.status||d.HttpCode;n&&(400===e||401===
e)?k.reject():C.handleGitServiceResponse(d,b,function(){k.resolve()},function(b){s(b,a)})})},k.reject))};if(a.items.GitUrl)t();else{var u=b.getService("orion.git.provider"),v=b.getService("orion.page.progress");v.progress(u.getGitRemote(p),"Getting remote details "+r).then(function(b){v.progress(u.getGitClone(b.CloneLocation),"Getting git repository information "+b.Name).then(function(b){a.items.GitUrl=b.Children[0].GitUrl;t()},q)},q)}return k},r=function(a){a.LocalBranch&&a.RemoteBranch&&(a=a.RemoteBranch);
return"RemoteTrackingBranch"===a.Type||"Remote"===a.Type||"Commit"===a.Type&&a.toRef&&"RemoteTrackingBranch"===a.toRef.Type?!0:!1},y=new h.Command({name:l.Fetch,tooltip:l["Fetch from the remote"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",callback:function(a){return u(a,!1).then(function(){s(a)})},visibleWhen:r});d.addCommand(y);r=new h.Command({name:l["Force Fetch"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",tooltip:l["Fetch from the remote branch into your remote tracking branch overriding its current content"],
id:"eclipse.orion.git.fetchForce",callback:function(a){u(a,!0,l["You're going to override content of the remote tracking branch. This can cause the branch to lose commits."]+"\n\n"+l["Are you sure?"]).then(function(){s(a)})},visibleWhen:r});d.addCommand(r);r=new h.Command({name:l.Merge,tooltip:l["Merge the content from the branch to your active branch"],imageClass:"git-sprite-merge",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.merge",callback:function(a){var d=a.items;a=b.getService("orion.git.provider");
var e=b.getService("orion.page.progress"),g=b.getService("orion.page.message");e.progress(a.doMerge(d.HeadLocation,d.Name,!1),"Merging "+d.Name).then(function(a){var b={};if("FAST_FORWARD"===a.Result||"ALREADY_UP_TO_DATE"===a.Result)b.Severity="Ok",b.HTML=!1,b.Message=a.Result;else if(a.Result){b.Severity="Warning";b.HTML=!0;b.Message="\x3cspan\x3e"+a.Result;if(a.FailingPaths){var e="",h=!0,m;for(m in a.FailingPaths)h||(e+=", "),h=!1,e+=m;h||(b.Severity="Error",b.Message+=". "+k.formatMessage(l["Failing paths: ${0}"],
e))}b.Message+="\x3c/span\x3e"}else a.error&&(b.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),b.Message=a.DetailedMessage?a.DetailedMessage:a.Message):b.Message=a.error.message,b.HTML=!0,b.Message="\x3cspan\x3e"+b.Message+"\x3c/span\x3e");g.setProgressResult(b);f.changedItem(d)},function(a,e){var g={Severity:"Error",HTML:!0};g.Message="\x3cspan\x3e"+JSON.stringify(e.xhr.responseText).DetailedMessage+"\x3c/span\x3e";b.getService("orion.page.message").setProgressResult(g);
f.changedItem(d)})},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type||"Branch"===a.Type&&!a.Current||"Commit"===a.Type&&a.toRef&&"RemoteTrackingBranch"===a.toRef.Type?!0:!1}});d.addCommand(r);r=new h.Command({name:l["Merge Squash"],tooltip:l["Squash the content of the branch to the index"],imageClass:"git-sprite-merge-squash",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.mergeSquash",callback:function(a){var d=a.items;a=b.getService("orion.git.provider");var e=b.getService("orion.page.progress"),
g=b.getService("orion.page.message");e.progress(a.doMerge(d.HeadLocation,d.Name,!0),"Merging "+d.Name).then(function(a){var b=[];"FAST_FORWARD_SQUASHED"===a.Result||"ALREADY_UP_TO_DATE"===a.Result?(b.Severity="Ok",b.HTML=!1,b.Message=a.Result):a.Result?(b.Severity="Warning",b.HTML=!0,b.Message="\x3cspan\x3e"+a.Result+"\x3c/span\x3e"):a.error&&(b.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),b.Message=a.DetailedMessage?a.DetailedMessage:
a.Message):b.Message=a.error.message,b.HTML=!0,b.Message="\x3cspan\x3e"+b.Message+"\x3c/span\x3e");g.setProgressResult(b);f.changedItem(d)},function(a,e){var g=[];g.Severity="Error";g.HTML=!0;g.Message="\x3cspan\x3e"+JSON.stringify(e.xhr.responseText).DetailedMessage+".\x3c/span\x3e";b.getService("orion.page.message").setProgressResult(g);f.changedItem(d)})},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type||"Branch"===a.Type&&!a.Current||"Commit"===a.Type&&a.toRef&&"RemoteTrackingBranch"===
a.toRef.Type?!0:!1}});d.addCommand(r);var A=function(a){var d=new m;a=a.items;a.LocalBranch&&a.RemoteBranch&&(a=a.RemoteBranch);var e=b.getService("orion.page.message"),f=b.getService("orion.page.progress").progress(b.getService("orion.git.provider").doRebase(a.HeadLocation,a.Name,"BEGIN"),a.Name?l["Rebase on top of "]+a.Name:l.Rebase);e.createProgressMonitor(f,a.Name?l["Rebase on top of "]+a.Name:l.Rebase);f.then(function(a){var e={};switch(a.Result){case "OK":case "FAST_FORWARD":case "UP_TO_DATE":e.Severity=
"Ok";break;case "FAILED_WRONG_REPOSITORY_STATE":case "FAILED_UNMERGED_PATHS":case "FAILED_PENDING_CHANGES":case "UNCOMMITTED_CHANGES":e.Severity="Error";break;default:e.Severity="Warning"}if("Ok"===e.Severity)e.HTML=!1,e.Message=a.Result,d.resolve(a);else{e.HTML=!0;var f=l["Rebase"+a.Result];e.Message="\x3cspan\x3e"+a.Result+(f?f:"")+"\x3c/span\x3e";d.reject(a)}b.getService("orion.page.message").setProgressResult(e)},function(a){q(a);d.reject()});return d},r=new h.Command({name:l.Rebase,tooltip:l["Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch "]+
"and applying each commit again to the updated active branch.",id:"eclipse.orion.git.rebase",imageClass:"git-sprite-rebase",spriteClass:"gitCommandSprite",callback:function(a){A(a).then(function(){s(a)},function(){s()})},visibleWhen:function(a){this.tooltip=l["Rebase your commits by removing them from the active branch, "]+l["starting the active branch again based on the latest state of '"]+a.Name+"' "+l["and applying each commit again to the updated active branch."];return"RemoteTrackingBranch"===
a.Type||"Branch"===a.Type&&!a.Current}});d.addCommand(r);p={serviceRegistry:b,commandService:d,explorer:f,toolbarId:p};var B=v(D.mixin(p,{tags:!0,force:!1})).perform,M=v(D.mixin(p,{tags:!1,force:!1})).perform,O=v(D.mixin(p,{tags:!0,force:!0})).perform,E=v(D.mixin(p,{tags:!1,force:!0})).perform,$=v(D.mixin(p,{tags:!1,force:!1,gerrit:!0})).perform;p=function(a){a.LocalBranch&&a.RemoteBranch&&(a=a.LocalBranch);return a.toRef?""===a.RepositoryPath&&"Branch"===a.toRef.Type&&a.toRef.Current&&a.toRef.RemoteLocation:
"Branch"===a.Type&&a.Current&&a.RemoteLocation};r=new h.Command({name:l.Sync,tooltip:l.SyncTooltip,extraClass:"primaryButton",id:"eclipse.orion.git.sync",callback:function(a){return u(a).then(function(){return A(a).then(function(b){return B(a).then(function(){s(a)})},function(){s()})})},visibleWhen:p});d.addCommand(r);r=new h.Command({name:l["Push All"],tooltip:l["Push commits and tags from your local branch into the remote branch"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.push",
callback:function(a){B(a).then(function(){s(a)})},visibleWhen:p});d.addCommand(r);r=new h.Command({name:l["Push Branch"],tooltip:l["Push commits without tags from your local branch into the remote branch"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushBranch",callback:function(a){M(a).then(function(){s(a)})},visibleWhen:p});d.addCommand(r);r=new h.Command({name:l["Push for Review"],tooltip:l["Push commits to Gerrit Code Review"],imageClass:"git-sprite-push",
spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushToGerrit",callback:function(a){$(a).then(function(){s(a)})},visibleWhen:function(a){a.LocalBranch&&a.RemoteBranch&&(a=a.LocalBranch);return a.toRef?""===a.RepositoryPath&&"Branch"===a.toRef.Type&&a.toRef.Current&&a.toRef.RemoteLocation&&a.toRef.RemoteLocation[0].IsGerrit:"Branch"===a.Type&&a.Current&&a.RemoteLocation&&a.RemoteLocation[0].IsGerrit}});d.addCommand(r);r=new h.Command({name:l["Force Push All"],tooltip:l["Push commits and tags from your local branch into the remote branch overriding its current content"],
imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushForce",callback:function(a){O(a).then(function(){s(a)})},visibleWhen:p});d.addCommand(r);p=new h.Command({name:l["Force Push Branch"],tooltip:l["Push commits without tags from your local branch into the remote branch overriding its current content"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushForceBranch",callback:function(a){E(a).then(function(){s(a)})},visibleWhen:p});
d.addCommand(p);p=new h.Command({name:l["\x3c Previous Page"],tooltip:l["Show previous page of git log"],id:"eclipse.orion.git.previousLogPage",hrefCallback:function(a){return n.toUrl(G.expand({resource:a.items.PreviousLocation}))},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type||a.toRef&&"Branch"===a.toRef.Type||null!==a.RepositoryPath?void 0!==a.PreviousLocation:!1}});d.addCommand(p);p=new h.Command({name:l["Next Page \x3e"],tooltip:l["Show next page of git log"],id:"eclipse.orion.git.nextLogPage",
hrefCallback:function(a){return n.toUrl(G.expand({resource:a.items.NextLocation}))},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type||a.toRef&&"Branch"===a.toRef.Type||null!==a.RepositoryPath?void 0!==a.NextLocation:!1}});d.addCommand(p);p=new h.Command({name:l["\x3c Previous Page"],tooltip:l["Show previous page of git tags"],id:"eclipse.orion.git.previousTagPage",hrefCallback:function(a){return n.toUrl(w.expand({resource:a.items.PreviousLocation}))},visibleWhen:function(a){return"Tag"===
a.Type?void 0!==a.PreviousLocation:!1}});d.addCommand(p);p=new h.Command({name:l["Next Page \x3e"],tooltip:l["Show next page of git tags"],id:"eclipse.orion.git.nextTagPage",hrefCallback:function(a){return n.toUrl(w.expand({resource:a.items.NextLocation}))},visibleWhen:function(a){return"Tag"===a.Type?void 0!==a.NextLocation:!1}});d.addCommand(p);var Y=function(a,d,e,g,h){var m=a.items;if(confirm(k.formatMessage(h,e))){a=b.getService("orion.git.provider");var n=b.getService("orion.page.message");
d=b.getService("orion.page.progress").progress(a.resetIndex(d,e,g),"Resetting git index for "+e);n.createProgressMonitor(d,l["Resetting index..."]);d.then(function(a){f.changedItem(m);n.setProgressResult({Severity:"Info",HTML:!1,Message:"Ok"})},function(a){var b={Severity:"Error",HTML:!1};b.Message=a.message;n.setProgressResult(b)})}};p=new h.Command({name:l.Reset,tooltip:l["Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes."],id:"eclipse.orion.git.resetIndex",
imageClass:"git-sprite-reset",spriteClass:"gitCommandSprite",callback:function(a){Y(a,a.items.IndexLocation,a.items.Name,"HARD",l.GitResetIndexConfirm)},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type}});d.addCommand(p);p=new h.Command({name:l.Undo,tooltip:l.UndoTooltip,id:"eclipse.orion.git.undoCommit",callback:function(a){Y(a,a.items.parent.remoteBranch.IndexLocation,"HEAD^","SOFT",l.UndoConfirm)},visibleWhen:function(a){return"Commit"===a.Type&&a.parent&&"Outgoing"===a.parent.Type&&
a.parent.children&&a.parent.children[0].Name===a.Name}});d.addCommand(p);p=new g.ParametersDescription([new g.CommandParameter("name","text",l["Name:"])]);p=new h.Command({name:l.Tag,tooltip:l["Create a tag for the commit"],imageClass:"git-sprite-tag",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.addTag",parameters:p,callback:function(a){var d=a.items,e=function(a,e){b.getService("orion.page.progress").progress(b.getService("orion.git.provider").doAddTag(a,e),"Adding tag "+e).then(function(){f.changedItem(d)},
q)},g=d.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&e(g,a.parameters.valueFor("name"))},visibleWhen:function(a){return"Commit"===a.Type}});d.addCommand(p);p=new h.Command({name:l.Delete,tooltip:l["Delete the tag from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeTag",callback:function(a){var d=a.items;confirm(k.formatMessage(l["Are you sure you want to delete tag ${0}?"],d.Name))&&b.getService("orion.page.progress").progress(b.getService("orion.git.provider").doRemoveTag(d.Location),
"Removing tag "+d.Name).then(function(){f.changedItem(d.parent)},q)},visibleWhen:function(a){return"Tag"===a.Type}});d.addCommand(p);p=new g.ParametersDescription([new g.CommandParameter("reviewer","text",l["Reviewer name"])],{hasOptionalParameters:!0});p=new h.Command({name:l["Ask for review"],tooltip:l["Ask for review tooltip"],imageClass:"core-sprite-tag",id:"eclipse.orion.git.askForReviewCommand",parameters:p,callback:function(a){var d=b.getService("orion.page.progress"),e=function(a){var b=document.createElement("a");
b.href=a;"ssh:"===b.protocol&&(b=a.indexOf("@"),-1!==b&&(a="ssh://"+a.substr(b+1)));return a},f=function(f){var g=a.items,h=g.Location.replace(g.Name,"HEAD"),k=g.AuthorName,l=g.Name,m=g.Message;d.progress(b.getService("orion.git.provider").getGitClone(g.CloneLocation),"Getting repository details "+g.Name).then(function(a){window.location.href.split("#");var n=z.getOrionHome();a=e(a.Children[0].GitUrl);n=n+"/git/reviewRequest.html#"+a+"_"+g.Name;d.progress(b.getService("orion.git.provider").sendCommitReviewRequest(l,
h,f,n,k,m),"Sending review request for "+l).then(function(a){var d={Severity:"Ok",HTML:!1};d.Message=a.Result;b.getService("orion.page.message").setProgressResult(d)},q)})};if(a.parameters.valueFor("reviewer")&&!a.parameters.optionsRequested)f(a.parameters.valueFor("reviewer"));else{var g=a.items;d.progress(b.getService("orion.git.provider").getGitClone(g.CloneLocation),"Getting git details "+g.Name).then(function(a){window.location.href.split("#");var b=z.getOrionHome();a=e(a.Children[0].GitUrl);
(new t.ReviewRequestDialog({title:l["Contribution Review Request"],url:b+"/git/reviewRequest.html#"+a+"_"+g.Name,func:f})).show()},q)}},visibleWhen:function(a){return"Commit"===a.Type}});d.addCommand(p);p=new h.Command({name:l["Cherry-Pick"],tooltip:l["Apply the change introduced by the commit to your active branch"],id:"eclipse.orion.git.cherryPick",imageClass:"git-sprite-cherry-pick",spriteClass:"gitCommandSprite",callback:function(a){a=a.items;var d=b.getService("orion.page.progress"),e=b.getService("orion.git.provider"),
f=a.Location.replace(a.Name,"HEAD");d.progress(e.doCherryPick(f,a.Name),"Cherry picking "+a.Name).then(function(a){var d={};if("OK"===a.Result)d.Severity="Ok",a.HeadUpdated?(d.HTML=!1,d.Message=a.Result):(d.HTML=!0,d.Message="\x3cspan\x3e"+l["Nothing changed."]+"\x3c/span\x3e");else if("CONFLICTING"===a.Result)d.Severity="Warning",d.HTML=!0,d.Message="\x3cspan\x3e"+a.Result+l[". Some conflicts occurred"]+"\x3c/span\x3e";else if("FAILED"===a.Result){d.Severity="Error";d.HTML=!0;d.Message="\x3cspan\x3e"+
a.Result;if(a.FailingPaths){var e="",f=!0,g;for(g in a.FailingPaths)f||(e+=", "),f=!1,e+=g;f||(d.Message+=". "+k.formatMessage(l["Failing paths: ${0}"],e))}d.Message+="\x3c/span\x3e"}else d.Severity="Warning",d.HTML=!1,d.Message=a.Result;b.getService("orion.page.message").setProgressResult(d)},q)},visibleWhen:function(a){return"Commit"===a.Type}});d.addCommand(p);p=new h.Command({name:l.Revert,tooltip:l["Revert changes introduced by the commit into your active branch"],id:"eclipse.orion.git.revert",
imageClass:"git-sprite-reset",spriteClass:"gitCommandSprite",callback:function(a){a=a.items;var d=b.getService("orion.page.progress"),e=b.getService("orion.git.provider"),f=a.Location.replace(a.Name,"HEAD");d.progress(e.doRevert(f,a.Name),"Reverting "+a.Name).then(function(a){var d=[];"OK"===a.Result?(d.Severity="Ok",d.HTML=!1,d.Message=a.Result):"FAILURE"===a.Result?(d.Severity="Warning",d.HTML=!0,d.Message="\x3cspan\x3e"+a.Result+l[". Could not revert into active branch"]+"\x3c/span\x3e"):(d.Severity=
"Warning",d.HTML=!1,d.Message=a.Result);b.getService("orion.page.message").setProgressResult(d)},q)},visibleWhen:function(a){return"Commit"===a.Type}});d.addCommand(p)};C.createGitClonesCommands=function(a,d,f,p,q,t){function v(b){var d={Severity:"Error",HTML:!1};try{var e=JSON.parse(b.responseText);d.Message=e.DetailedMessage?e.DetailedMessage:e.Message?e.Message:l["Problem while performing the action"]}catch(f){d.Message=l["Problem while performing the action"]}a.getService("orion.page.message").setProgressResult(d)}
function y(a){Array.isArray(a)&&(a=1<a.length?{}:a[0]);return a}p=new g.ParametersDescription([new g.CommandParameter("key","text",l["Key:"]),new g.CommandParameter("value","text",l["Value:"])]);p=new h.Command({name:l["New Configuration Entry"],tooltip:"Add a new entry to the repository configuration",id:"eclipse.orion.git.addConfigEntryCommand",parameters:p,callback:function(b){var d=b.items,e=a.getService("orion.git.provider"),g=a.getService("orion.page.progress");b.parameters.valueFor("key")&&
b.parameters.valueFor("value")&&g.progress(e.addCloneConfigurationProperty(d.ConfigLocation,b.parameters.valueFor("key"),b.parameters.valueFor("value")),"Setting configuration propetry: "+b.parameters.valueFor("key")).then(function(a){f.changedItem(d)},v)}});d.addCommand(p);p=new g.ParametersDescription([],null,function(a){a=a.items;var b;a&&(b=a.Value);return[new g.CommandParameter("value","text",l["Value:"],b)]});p=new h.Command({name:l.Edit,tooltip:l["Edit the configuration entry"],imageClass:"core-sprite-edit",
id:"eclipse.orion.git.editConfigEntryCommand",parameters:p,callback:function(b){var d=b.items,e=a.getService("orion.git.provider"),g=a.getService("orion.page.progress");b.parameters.valueFor("value")&&g.progress(e.editCloneConfigurationProperty(d.Location,b.parameters.valueFor("value")),"Editing configuration property "+d.Key).then(function(a){f.changedItem(d)},v)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});d.addCommand(p);p=new h.Command({name:l.Delete,tooltip:l["Delete the configuration entry"],
imageClass:"core-sprite-delete",id:"eclipse.orion.git.deleteConfigEntryCommand",callback:function(b){var d=b.items;b=a.getService("orion.git.provider");var e=a.getService("orion.page.progress");confirm(k.formatMessage(l["Are you sure you want to delete ${0}?"],d.Key))&&e.progress(b.deleteCloneConfigurationProperty(d.Location),"Deleting configuration property "+d.Key).then(function(a){f.changedItem(d)},v)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});d.addCommand(p);p=new g.ParametersDescription([new g.CommandParameter("url",
"url",l["Repository URL:"])],{hasOptionalParameters:!0});q=new h.Command({name:l["Clone Repository"],tooltip:l["Clone an existing Git repository to a folder"],id:"eclipse.createGitProject",callback:function(d){var e=d.items,g=a.getService("orion.git.provider"),h=a.getService("orion.page.progress"),k=function(d,k,m){e.GitUrl=d;C.getDefaultSshOptions(a,e).then(function(p){var q=arguments.callee,r=new b(a);a.getService("orion.page.message").setProgressMessage("Your project is being set up. This may take a minute...");
r.getConfig().then(function(b){h.progress(g.cloneGitRepository(m,d,k,f.defaultPath,p.gitSshUsername,p.gitSshPassword,p.knownHosts,p.gitPrivateKey,p.gitPassphrase,b,!0),"Cloning repository "+m).then(function(b,d){C.handleProgressServiceResponse(b,p,a,function(a){g.getGitClone(a.Location).then(function(a){var b="",d;for(d in e.projectDescription)b+=d+"\x3d"+e.projectDescription[d]+"\n";t.write(a.Children[0].ContentLocation+".git/.projectInfo",b).then(function(){var b=n.toUrl(I.expand({resource:a.Children[0].ContentLocation}));
window.location=b})})},q,l["Clone Git Repository"])},function(b,d){C.handleProgressServiceResponse(b,p,a,function(){},q,l["Clone Git Repository"])})})})};e.url&&e.projectDescription.name&&(a.getService("orion.page.message").setProgressMessage("Looking for project "+e.projectDescription.name),t.loadWorkspace().then(function(a){for(var b=0;b<a.Children.length;++b){var d=a.Children[b];if(d.Name===e.projectDescription.name){d.Git?g.getGitClone(d.Git.CloneLocation).then(function(a){a.Children[0].GitUrl===
e.url?window.location=n.toUrl(I.expand({resource:a.Children[0].ContentLocation})):console.info("Folder project is used")}):console.info("Folder project is used");return}}k(e.url,null,e.projectDescription.name)}))},visibleWhen:function(a){return!0}});d.addCommand(q);p=new h.Command({name:l["Clone Repository"],tooltip:l["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepository",parameters:p,callback:function(d){var e=d.items,g=a.getService("orion.git.provider"),h=a.getService("orion.page.progress"),
k=function(d,k,m){e.GitUrl=d;C.getDefaultSshOptions(a,e).then(function(e){var n=arguments.callee;(new b(a)).getConfig().then(function(b){b=h.progress(g.cloneGitRepository(m,d,k,f.defaultPath,e.gitSshUsername,e.gitSshPassword,e.knownHosts,e.gitPrivateKey,e.gitPassphrase,b),"Cloning repository "+m);a.getService("orion.page.message").createProgressMonitor(b,l["Cloning repository: "]+d);b.then(function(b,d){C.handleProgressServiceResponse(b,e,a,function(a){f.changedItem&&f.changedItem()},n,l["Clone Git Repository"])},
function(b,d){C.handleProgressServiceResponse(b,e,a,function(){},n,l["Clone Git Repository"])})})})};d.parameters.valueFor("url")&&!d.parameters.optionsRequested?k(d.parameters.valueFor("url")):(new s.CloneGitRepositoryDialog({serviceRegistry:a,fileClient:t,url:d.parameters.valueFor("url"),alwaysShowAdvanced:d.parameters.optionsRequested,func:k})).show()},visibleWhen:function(a){return!0}});d.addCommand(p);p=new h.Command({name:l["Clone Repository"],tooltip:l["Clone an existing Git repository to a folder"],
id:"eclipse.cloneGitRepositoryReviewReq",callback:function(d){var e=d.items,g=a.getService("orion.git.provider"),h=a.getService("orion.page.progress");(new s.CloneGitRepositoryDialog({serviceRegistry:a,fileClient:t,url:d.userData,alwaysShowAdvanced:!1,func:function(d,k,m){e.GitUrl=d;C.getDefaultSshOptions(a,e).then(function(e){var n=arguments.callee;(new b(a)).getConfig().then(function(b){b=h.progress(g.cloneGitRepository(m,d,k,f.defaultPath,e.gitSshUsername,e.gitSshPassword,e.knownHosts,e.gitPrivateKey,
e.gitPassphrase,b),"Cloning git repository "+m);a.getService("orion.page.message").createProgressMonitor(b,l["Cloning repository: "]+d);b.then(function(b,d){C.handleProgressServiceResponse(b,e,a,function(a){f.changedItem&&f.changedItem()},n,l["Clone Git Repository"])},function(b,d){C.handleProgressServiceResponse(b,e,a,function(){},n,l["Clone Git Repository"])})})})}})).show()},visibleWhen:function(a){return!0}});d.addCommand(p);p=new h.Command({name:l["Add Remote"],tooltip:l["Add a new remote to the repository"],
id:"eclipse.addRemoteReviewRequestCommand",imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",callback:function(b){b.parameters&&b.parameters.valueFor("remoteName")&&(b.remoteName=b.parameters.valueFor("remoteName"));var h=function(b,f){b.JsonData.HostKey?(f.parameters=null,f.errorData=b.JsonData,d.collectParameters(f)):f.optionsRequested?(f.errorData=b.JsonData,d.collectParameters(f)):(new e(a)).isEnabled().then(function(a){f.parameters=a?b.JsonData.User?new g.ParametersDescription([new g.CommandParameter("sshpassword",
"password",l["Password:"]),new g.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):new g.ParametersDescription([new g.CommandParameter("sshuser","text",l["User Name:"]),new g.CommandParameter("sshpassword","password",l["Password:"]),new g.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):b.JsonData.User?new g.ParametersDescription([new g.CommandParameter("sshpassword","password",l["Password:"])],
{hasOptionalParameters:!0}):new g.ParametersDescription([new g.CommandParameter("sshuser","text",l["User Name:"]),new g.CommandParameter("sshpassword","password",l["Password:"])],{hasOptionalParameters:!0});f.errorData=b.JsonData;d.collectParameters(f)})};if(b.parameters&&b.parameters.optionsRequested)b.parameters=null,b.optionsRequested=!0,d.collectParameters(b);else{var k=function(d,e,g){var k=a.getService("orion.page.progress");k.progress(a.getService("orion.git.provider").addRemote(d,e,b.userData),
"Adding git remote "+e).then(function(){C.gatherSshCredentials(a,b).then(function(d){a.getService("orion.git.provider").getGitRemote(g.RemoteLocation).then(function(m){for(var n,p=0;p<m.Children.length;p++)m.Children[p].Name===e&&(n=m.Children[p]);var q=a.getService("orion.git.provider");m=a.getService("orion.page.message");p=k.progress(q.doFetch(n.Location,!1,d.gitSshUsername,d.gitSshPassword,d.knownHosts,d.gitPrivateKey,d.gitPassphrase),"Fetching remote "+e);m.createProgressMonitor(p,l["Fetching remote: "]+
n.Location);p.then(function(d,l){C.handleGitServiceResponse(d,a,function(){k.progress(q.getGitRemote(n.Location),"Getting remote details "+e).then(function(a){f.changedItem(g)},v)},function(a){h(a,b)})},function(d,e){C.handleGitServiceResponse(d,a,function(){f.changedItem(g)},function(a){h(a,b)})})})})},v)};b.remoteName?k(b.items.RemoteLocation,b.remoteName,b.items):(b.parameters=new g.ParametersDescription([new g.CommandParameter("remoteName","text",l["Remote Name:"])],{hasOptionalParameters:!1}),
d.collectParameters(b))}},visibleWhen:function(a){return!0}});d.addCommand(p);p=new g.ParametersDescription([new g.CommandParameter("folderName","text",l["New folder:"])],{hasOptionalParameters:!0});p=new h.Command({name:l["Init Repository"],tooltip:l["Create a new Git repository in a new folder"],id:"eclipse.initGitRepository",parameters:p,callback:function(d){var e=d.items,g=a.getService("orion.git.provider"),h=a.getService("orion.page.progress"),k=function(d,k,m){e.GitUrl=d;C.getDefaultSshOptions(a,
e).then(function(e){var n=arguments.callee;(new b(a)).getConfig().then(function(b){b=h.progress(g.cloneGitRepository(m,d,k,f.defaultPath,null,null,null,null,null,b),l["Initializing repository: "]+m);a.getService("orion.page.message").createProgressMonitor(b,l["Initializing repository: "]+m);b.then(function(b,d){C.handleProgressServiceResponse(b,e,a,function(a){f.changedItem&&f.changedItem()},n,l["Init Git Repository"])},function(b,d){C.handleProgressServiceResponse(b,e,a,function(){},n,l["Init Git Repository"])})})})};
d.parameters.valueFor("folderName")&&!d.parameters.optionsRequested?k(null,null,d.parameters.valueFor("folderName")):(new s.CloneGitRepositoryDialog({serviceRegistry:a,title:l["Init Git Repository"],fileClient:t,advancedOnly:!0,func:k})).show()},visibleWhen:function(a){return!0}});d.addCommand(p);p=new h.Command({name:l.Delete,tooltip:l["Delete the repository"],imageClass:"core-sprite-delete",id:"eclipse.git.deleteClone",visibleWhen:function(a){return"Clone"===a.Type},callback:function(b){var d=b.items;
b=a.getService("orion.git.provider");var e=a.getService("orion.page.progress");if(Array.isArray(d)){if(confirm(k.formatMessage(l["Are you sure you want do delete ${0} repositories?"],d.length)))for(var g=0,h=0;h<d.length;h++)e.progress(b.removeGitRepository(d[h].Location),"Removing repository "+d.Name).then(function(a){g++;g>=d.length&&f.changedItem&&f.changedItem()},v)}else confirm(k.formatMessage(l["Are you sure you want to delete ${0}?"],d.Name))&&e.progress(b.removeGitRepository(d.Location),"Removing repository "+
d.Name).then(function(a){f.changedItem&&(window.location=n.toUrl(w.expand({})),f.changedItem())},v)}});d.addCommand(p);p=new h.Command({name:l["Apply Patch"],tooltip:l["Apply a patch on the selected repository"],id:"eclipse.orion.git.applyPatch",imageClass:"git-sprite-apply-patch",spriteClass:"gitCommandSprite",callback:function(b){b=y(b.items);var d=new m;(new u.ApplyPatchDialog({title:l["Apply Patch"],diffLocation:b.DiffLocation||b.repository.DiffLocation,deferred:d})).show();var e=a.getService("orion.page.message");
d.then(function(a){var b;try{var d=JSON.parse(a);if(d.JsonData&&d.JsonData.modifiedFieles){b="Patch applied, files modified: ";a=!0;for(var f=0;f<d.JsonData.modifiedFieles.length;f++)a||(b+=", "),b+=d.JsonData.modifiedFieles[f],a=!1;d=[];d.Severity="Info";d.HTML=!1;d.Message=b;e.setProgressResult(d);return}}catch(g){}e.setMessage("Patch applied")},function(a){var b=JSON.parse(a);a="Apply patch failed.";b.DetailedMessage?a=a+" "+b.DetailedMessage:b.Message&&(a+=" ",a+=b.Message);b=[];b.Severity="Error";
b.HTML=!1;b.Message=a;e.setProgressResult(b)})},visibleWhen:function(a){return"Clone"===a.Type||a.repository}});d.addCommand(p);p=new g.ParametersDescription([new g.CommandParameter("commitName","text",l["Commit name:"])],{hasOptionalParameters:!0});p=new h.Command({name:l["Open Commit"],tooltip:l["Open the commit with the given name"],id:"eclipse.orion.git.openCommitCommand",imageClass:"git-sprite-apply-patch",spriteClass:"gitCommandSprite",parameters:p,callback:function(b){var d=a.getService("orion.page.progress"),
e=function(f,g,h){null==h&&(h=new m);0<f.length?d.progress(a.getService("orion.git.provider").doGitLog("/gitapi/commit/"+b.parameters.valueFor("commitName")+f[0].ContentLocation+"?page\x3d1\x26pageSize\x3d1",null,null,l["Looking for the commit"]),"Looking for commit "+b.parameters.valueFor("commitName")).then(function(a){h.resolve(a.Children[0].Location)},function(a){e(f.slice(1),g,h)}):h.reject();return h},f=function(d){b.parameters.optionsRequested?(new r.OpenCommitDialog({repositories:d,serviceRegistry:a,
commitName:b.parameters.valueFor("commitName")})).show():(a.getService("orion.page.message").setProgressMessage(l["Looking for the commit"]),e(d,b.parameters.valueFor("commitName")).then(function(b){b&&(b=n.toUrl(H.expand({resource:b})),window.open(b));a.getService("orion.page.message").setProgressMessage("")},function(){var b=[];b.Severity="warning";b.HTML=!1;b.Message=l["No commits found"];a.getService("orion.page.message").setProgressResult(b)}))};if("Clone"===b.items.Type){var g=[b.items];f(g)}else b.items.CloneLocation?
d.progress(a.getService("orion.git.provider").getGitClone(b.items.CloneLocation),"Getting git repository details").then(function(a){f(a.Children)}):(g=b.items,f(g))},visibleWhen:function(a){return"Clone"===a.Type||a.CloneLocation||1<a.length&&"Clone"===a[0].Type}});d.addCommand(p)};C.createGitStatusCommands=function(a,b,e,f){function g(a){Array.isArray(a)||(a=[a]);return a}function m(b,d){var f=a.getService("orion.page.message"),g=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doRebase(b,
"",d),"Rebasing git repository");f.createProgressMonitor(g,d);g.then(function(b){if("OK"===b.Result||"ABORTED"===b.Result||"FAST_FORWARD"===b.Result||"UP_TO_DATE"===b.Result){var d=[];d.Severity="Ok";d.HTML=!1;d.Message=b.Result;a.getService("orion.page.message").setProgressResult(d);e.changedItem({})}"STOPPED"===b.Result?(d=[],d.Severity="Warning",d.HTML=!1,d.Message=b.Result+l[". Repository still contains conflicts."],a.getService("orion.page.message").setProgressResult(d),e.changedItem({})):"FAILED_UNMERGED_PATHS"===
b.Result&&(d=[],d.Severity="Error",d.HTML=!1,d.Message=b.Result+l[". Repository contains unmerged paths. Resolve conflicts first."],a.getService("orion.page.message").setProgressResult(d))},q)}var n=A({serviceRegistry:a,commandService:b}),p=n.perform,q=n.displayErrorOnStatus,n=new h.Command({name:l.Stage,tooltip:l["Stage the change"],imageClass:f?"core-sprite-check":"git-sprite-stage",spriteClass:f?"commandSprite":"gitCommandSprite",id:"eclipse.orion.git.stageCommand",callback:function(b){var d=g(b.items),
h=a.getService("orion.page.message"),k=a.getService("orion.page.progress");if(1===d.length)k=k.progress(a.getService("orion.git.provider").stage(d[0].indexURI),l["Staging changes"]),h.createProgressMonitor(k,l["Staging changes"]),k.then(function(a){f?b.handler.changedItem(d):e.changedItem(d)},q);else{for(var m=[],n=0;n<d.length;n++)m[n]=d[n].name;k=k.progress(a.getService("orion.git.provider").stageMultipleFiles(b.userData.Clone.IndexLocation,m),l["Staging changes"]);h.createProgressMonitor(k,"Staging changes");
k.then(function(a){f?b.handler.changedItem(d):e.changedItem(d)},q)}},visibleWhen:function(a){a=g(a);if(0===a.length)return!1;for(var b=0;b<a.length;b++)if(!d.isChange(a[b])||d.isStaged(a[b]))return!1;return!0}});b.addCommand(n);var r=function(b){var d=g(b.items),e=a.getService("orion.page.message"),f=a.getService("orion.page.progress");if(1===d.length)b=f.progress(a.getService("orion.git.provider").unstage(d[0].indexURI,d[0].name),"Unstaging changes");else{for(var h=[],k=0;k<d.length;k++)h[k]=d[k].name;
b=f.progress(a.getService("orion.git.provider").unstage(b.userData.Clone.IndexLocation,h),"Unstaging changes")}e.createProgressMonitor(b,l["Staging changes"]);return b.then(function(){return d})},n=new h.Command({name:l.Unstage,tooltip:l["Unstage the change"],imageClass:f?"core-sprite-check_on":"git-sprite-unstage",spriteClass:f?"commandSprite":"gitCommandSprite",id:"eclipse.orion.git.unstageCommand",callback:function(a){r(a).then(function(b){f?a.handler.changedItem(b):e.changedItem(b)},q)},visibleWhen:function(a){a=
g(a);if(0===a.length)return!1;for(var b=0;b<a.length;b++)if(!d.isChange(a[b])||!d.isStaged(a[b]))return!1;return!0}});b.addCommand(n);n=new h.Command({name:f?l.SmartCommit:l.Commit,tooltip:f?"":l.Commit,id:"eclipse.orion.git.commitCommand",callback:function(a){p(a).then(function(){e.changedItem()})},visibleWhen:function(a){return!0}});b.addCommand(n);n=new h.Command({name:l.Reset,tooltip:l["Reset the branch, discarding all staged and unstaged changes"],imageClass:"core-sprite-refresh",id:"eclipse.orion.git.resetCommand",
callback:function(b){var d=b.items;a.getService("orion.page.dialog").confirm(l["All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered."]+"\n"+l["Are you sure you want to continue?"],function(b){if(b){b=a.getService("orion.page.message");var f=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").unstageAll(d.IndexLocation,"HARD"),l["Resetting local changes"]);b.createProgressMonitor(f,l["Resetting local changes"]);f.then(function(a){e.changedItem(d)},
q)}})},visibleWhen:function(a){return"Status"!==a.Type?!1:d.hasStagedChanges(a)||d.hasUnstagedChanges(a)}});b.addCommand(n);n=new h.Command({name:l.Checkout,tooltip:l["Checkout all the selected files, discarding all changes"],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.checkoutCommand",callback:function(b){var d=g(b.items);a.getService("orion.page.dialog").confirm(l["Your changes to the selected files will be discarded and cannot be recovered."]+"\n"+l["Are you sure you want to continue?"],
function(f){if(f){f=a.getService("orion.page.message");for(var g=a.getService("orion.page.progress"),h=[],k=0;k<d.length;k++)h[k]=d[k].name;g=g.progress(a.getService("orion.git.provider").checkoutPath(b.userData.Clone.Location,h),l["Resetting local changes"]);f.createProgressMonitor(g,l["Resetting local changes"]);g.then(function(a){e.changedItem(d)},q)}})},visibleWhen:function(a){a=g(a);if(0===a.length)return!1;for(var b=0;b<a.length;b++)if(!d.isChange(a[b])||d.isStaged(a[b]))return!1;return!0}});
b.addCommand(n);var s=new h.Command({name:l.Discard,tooltip:l["Checkout all the selected files, discarding all changes"],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.checkoutStagedCommand",callback:function(b){a.getService("orion.page.dialog").confirm(l["Your changes to the selected files will be discarded and cannot be recovered."]+"\n"+l["Are you sure you want to continue?"],function(d){d&&r(b).then(function(d){for(var g=a.getService("orion.page.message"),
h=a.getService("orion.page.progress"),k=[],m=0;m<d.length;m++)k[m]=d[m].name;h=h.progress(a.getService("orion.git.provider").checkoutPath(b.userData.Clone.Location,k),l["Resetting local changes"]);g.createProgressMonitor(h,l["Resetting local changes"]);return h.then(function(a){f?b.handler.changedItem(d):e.changedItem(d)},q)})})},visibleWhen:function(a){a=g(a);s.name=k.formatMessage(l.Discard,a.length);return!0}});b.addCommand(s);n=new h.Command({name:l["Show Patch"],tooltip:l["Show workspace changes as a patch"],
id:"eclipse.orion.git.showPatchCommand",hrefCallback:function(a){var b=g(a.items);a=a.userData.Clone.DiffLocation+"?parts\x3ddiff";for(var d=0;d<b.length;d++)a+="\x26Path\x3d",a+=b[d].name;return a},visibleWhen:function(a){a=g(a);if(0===a.length)return!1;for(var b=0;b<a.length;b++)if(d.isStaged(a[b]))return!1;return!0}});b.addCommand(n);n=new h.Command({name:l["Show Patch"],tooltip:l["Show checked changes as a patch"],id:"eclipse.orion.git.showStagedPatchCommand",hrefCallback:function(a){var b=g(a.items);
a=a.userData.Clone.DiffLocation.replace("/Default/","/Cached/")+"?parts\x3ddiff";for(var d=0;d<b.length;d++)a+="\x26Path\x3d",a+=b[d].name;return a},visibleWhen:function(a){return 0!==g(a).length}});b.addCommand(n);n=new h.Command({name:l.Continue,tooltip:l["Contibue Rebase"],id:"eclipse.orion.git.rebaseContinueCommand",callback:function(a){return m(a.items.Clone.HeadLocation,"CONTINUE")},visibleWhen:function(a){return a.RepositoryState&&-1!==a.RepositoryState.indexOf("REBASING")}});b.addCommand(n);
n=new h.Command({name:l["Skip Patch"],tooltip:l["Skip Patch"],id:"eclipse.orion.git.rebaseSkipPatchCommand",callback:function(a){return m(a.items.Clone.HeadLocation,"SKIP")},visibleWhen:function(a){return a.RepositoryState&&-1!==a.RepositoryState.indexOf("REBASING")}});b.addCommand(n);n=new h.Command({name:l.Abort,tooltip:l["Abort Rebase"],id:"eclipse.orion.git.rebaseAbortCommand",callback:function(a){return m(a.items.Clone.HeadLocation,"ABORT")},visibleWhen:function(a){return a.RepositoryState&&
-1!==a.RepositoryState.indexOf("REBASING")}});b.addCommand(n)};C.createSharedCommands=function(a,b,d,e,f,g){var k=function(){d.changedItem()};f={serviceRegistry:a,commandService:b};e=v({serviceRegistry:a,commandService:b,explorer:d,toolbarId:e,tags:!0,confirmDialogCloseCallback:k,remotePrompterDialogCloseCallback:k,sshCredentialsDialogCloseCallback:k,sshSlideoutCloseCallback:k});f=A(f);g=f.createParameters(!1);var m=f.perform,n=f.displayErrorOnStatus,p=e.perform;e=new h.Command({name:l["Commit and Push"],
tooltip:l["Commit and Push"],id:"eclipse.orion.git.commitAndPushCommand",parameters:g,callback:function(b){m(b).then(function(){a.getService("orion.git.provider").getGitBranch(b.items.status.Clone.BranchLocation).then(function(a){a=a.Children;for(var d,e=0;e<a.length;e++)if(a[e].Current){d=a[e];break}b.command=void 0;b.targetBranch=void 0;b.parameters=void 0;b.items=d;p(b).then(function(){k()})},function(a){n(a)})},function(a){n(a);k()})},visibleWhen:function(a){return!0}});b.addCommand(e)}})();return C});
define("orion/git/gitCommitExplorer","require i18n!git/nls/gitmessages orion/section orion/git/widgets/gitChangeList orion/git/widgets/gitTagList orion/git/widgets/gitCommitInfo orion/explorers/explorer orion/URITemplate orion/PageUtil orion/webui/littlelib orion/globalCommands orion/git/gitCommands".split(" "),function(l,n,m,k,f,h,g,d,a,e,b,p){g={};var q=new d("git/git-repository.html#{,resource,params*}");g.GitCommitExplorer=function(){function d(a){this.parentId=a.parentId;this.registry=a.registry;
this.commandService=a.commandService;this.fileClient=a.fileClient;this.gitClient=a.gitClient;this.commandService=a.commandService;this.statusService=a.statusService;this.progressService=a.progressService;this.preferencesService=a.preferencesService;this.linkService=a.linkService;this.selection=a.selection;this.toolbarId=a.toolbarId;this.selectionToolsId=a.selectionToolsId;this.actionScopeId=a.actionScopeId;this.checkbox=!1}d.prototype.handleError=function(a){var b={Severity:"Error",HTML:!1};try{var d=
JSON.parse(a.responseText);b.Message=d.DetailedMessage?d.DetailedMessage:d.Message}catch(e){b.Message=a.message}this.statusService.setProgressResult(b);404===a.status&&(this.initTitleBar(),this.displayCommit())};d.prototype.changedItem=function(a,b){this.redisplay()};d.prototype.redisplay=function(){var b=a.matchResourceParameters();this.display(b.resource)};d.prototype.display=function(a){var b=this,d=this.progressService;d.showWhile(this.gitClient.getGitClone(a),"Getting repository details").then(function(a){if(0===
a.Children.length)b.initTitleBar(),b.displayCommit();else if(1===a.Children.length&&"Commit"===a.Children[0].Type){var e=a.Children;d.progress(b.gitClient.getGitClone(a.CloneLocation),"Getting repository details "+a.Name).then(function(a){a=a.Children;b.initTitleBar(e[0],a[0]);b.displayCommit(e[0]);b.displayTags(e[0],a[0]);b.displayDiffs(e[0],a[0]);e[0].CloneLocation=a[0].Location;p.updateNavTools(b.registry,b.commandService,b,"pageActions","selectionTools",e[0])},function(a){b.handleError(a)})}},
function(a){b.handleError(a)})};d.prototype.initTitleBar=function(a,d){var e={};a.GitUrl=d.GitUrl;a.ContentLocation=d.ContentLocation;a&&(e={},e.Name=a.Name,e.Parents=[],e.Parents[0]={},e.Parents[0].Name=d.Name,e.Parents[0].Location=d.Location,e.Parents[0].ChildrenLocation=d.Location,e.Parents[1]={},e.Parents[1].Name=n.Repositories);b.setPageTarget({task:"Commit",target:a,breadcrumbTarget:e,makeBreadcrumbLink:function(a,b){a.href=l.toUrl(q.expand({resource:b||""}))},serviceRegistry:this.registry,
commandService:this.commandService})};d.prototype.displayCommit=function(a){var b=e.node("table");e.empty(b);if(a){var d=document.createElement("div");d.className="sectionTable";b.appendChild(d);b=document.createElement("div");b.className="mainPadding";b.id="commitNode";d.appendChild(b);d=document.createElement("div");d.className="sectionTableItem";b.appendChild(d);(new h.GitCommitInfo({parent:d,commit:a,showTags:!1,commitLink:!1})).display()}else new m.Section(b,{id:"commitSection",title:n["No Commits"],
iconClass:"core-sprite-file"})};d.prototype.displayTags=function(a,b){var d=a.Tags,g=e.node("table"),d=new m.Section(g,{id:"tagSection",title:d&&0<d.length?n["Tags:"]:n["No Tags"],iconClass:["gitImageSprite","git-sprite-tag"],slideout:!0,content:'\x3cdiv id\x3d"tagNode"\x3e\x3c/div\x3e',canHide:!0,preferencesService:this.preferencesService});(new f.GitTagListExplorer({serviceRegistry:this.registry,commandRegistry:this.commandService,parentId:"tagNode",actionScopeId:this.actionScopeId,section:d,repository:b,
mode:"full",commit:a})).display()};d.prototype.displayDiffs=function(a,b){var d=a.Diffs;d.forEach(function(a){var b=a.OldPath;"ADD"===a.ChangeType&&(b=a.NewPath);a.name=b;a.type=a.ChangeType});var f=e.node("table"),f=new m.Section(f,{id:"diffSection",title:n.Diffs,content:'\x3cdiv id\x3d"diffNode"\x3e\x3c/div\x3e',canHide:!0,preferencesService:this.preferencesService});this.diffNavigator&&this.diffNavigator.destroy();this.diffNavigator=new k.GitChangeListExplorer({serviceRegistry:this.registry,commandRegistry:this.commandService,
selection:null,parentId:"diffNode",actionScopeId:"diffSectionItemActionArea",prefix:"diff",changes:d,section:f,repository:b});this.diffNavigator.display()};return d}();return g});
define("orion/widgets/themes/editor/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/ThemeVersion"],function(l,n,m){function k(){}function f(){this.styles=[];var a=new k;a.name="Eclipse";a.annotationRuler="white";a.background="white";a.comment="green";a.keyword="#7f0055";a.text="darkSlateGray";a.string="blue";a.overviewRuler="white";a.lineNumberOdd="#444";a.lineNumberEven="#444";a.lineNumber="#444";a.currentLine="#EAF2FE";a.constant="blue";a.tag="darkorange";
a.attribute="cadetBlue";a.fontFamily=g;a.fontSize=d;a.rightRuler="#DDDDDD";a.leftRuler="#DDDDDD";this.styles.push(a);a=new k;a.name="Prospecto";a.annotationRuler="white";a.background="white";a.comment="#3C802C";a.keyword="#CC4C07";a.text="#333";a.string="#446FBD";a.overviewRuler="white";a.lineNumberOdd="#CCCCCC";a.lineNumberEven="#CCCCCC";a.lineNumber="#CCCCCC";a.currentLine="#EAF2FE";a.tag="#CC4C07";a.attribute="cadetBlue";a.fontFamily=g;a.fontSize=d;a.rightRuler="#EEEEEE";a.leftRuler="#EEEEEE";
a.constant="darkOrchid";this.styles.push(a);a=new k;a.name="Blue";a.annotationRuler="lavender";a.background="aliceBlue";a.comment="indigo";a.keyword="cornFlowerBlue";a.text="navy";a.string="cornFlowerBlue";a.overviewRuler="lavender";a.lineNumberOdd="darkSlateGray";a.lineNumberEven="darkSlateGray";a.lineNumber="darkSlateGray";a.currentLine="white";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.rightRuler="white";a.leftRuler="white";a.fontFamily=g;a.fontSize=d;a.constant="blue";this.styles.push(a);
a=new k;a.name="Ambience";a.annotationRuler="#3D3D3D";a.background="darkgrey";a.comment="mediumslateblue";a.keyword="cornFlowerBlue";a.text="darkseagreen";a.string="lightcoral";a.overviewRuler="white";a.lineNumberOdd="black";a.lineNumberEven="black";a.lineNumber="black";a.currentLine="lightcyan";a.tag="cornFlowerBlue";a.attribute="cadetBlue";a.rightRuler="#baa289";a.leftRuler="#baa289";a.fontFamily=g;a.fontSize=d;a.constant="blue";this.styles.push(a);a=new k;a.name="Tierra";a.annotationRuler="moccasin";
a.background="lemonchiffon";a.comment="darkseagreen";a.keyword="darkred";a.text="#555555";a.string="orangered";a.overviewRuler="moccasin";a.lineNumberOdd="chocolate";a.lineNumberEven="chocolate";a.lineNumber="chocolate";a.currentLine="#baa289";a.tag="darkred";a.attribute="cadetBlue";a.rightRuler="#baa289";a.leftRuler="#baa289";a.fontFamily=g;a.fontSize=d;a.constant="blue";this.styles.push(a);a=new k;a.name="Nimbus";a.annotationRuler="#232323";a.background="#333333";a.comment="darkseagreen";a.keyword=
"darkorange";a.text="#DDDDDD";a.string="cornflowerblue";a.overviewRuler="#232323";a.lineNumberOdd="#555555";a.lineNumberEven="#555555";a.lineNumber="#555555";a.currentLine="dimgrey";a.tag="darkorange";a.attribute="cadetBlue";a.rightRuler="#3a3a3a";a.leftRuler="#3a3a3a";a.fontFamily=g;a.fontSize=d;a.constant="#01B199";this.styles.push(a);a=new k;a.name="Adelante";a.annotationRuler="#E2D2B2";a.background="#F1E7C8";a.comment="#5D774E";a.keyword="#AF473B";a.text="dimgray";a.string="#DE5D3B";a.overviewRuler=
"#E2D2B2";a.lineNumberOdd="#AF473B";a.lineNumberEven="#AF473B";a.lineNumber="#AF473B";a.currentLine="#9e937b";a.tag="#AF473B";a.attribute="cadetBlue";a.rightRuler="#9e937b";a.leftRuler="#9e937b";a.fontFamily=g;a.fontSize=d;a.constant="blue";this.styles.push(a);a=new k;a.name="Raspberry Pi";a.annotationRuler="seashell";a.background="seashell";a.comment="#66B32F";a.keyword="#E73E36";a.text="dimgray";a.string="darkorange";a.overviewRuler="seashell";a.lineNumberOdd="#f6b8b6";a.lineNumberEven="#f6b8b6";
a.lineNumber="#E73E36";a.currentLine="#F5B1AE";a.tag="#E73E36";a.attribute="cadetBlue";a.rightRuler="#fbdfde";a.leftRuler="#fbdfde";a.fontFamily=g;a.fontSize=d;a.constant="blue";this.styles.push(a)}function h(){return this.styles}var g='"Consolas", "Monaco", "Vera Mono", monospace',d="10pt";f.prototype.styles=[];f.prototype.getStyles=h;f.prototype.fontSettable=!0;f.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"editorstyles",defaultTheme:"Prospecto",selectedKey:"editorSelected",
version:m}};f.prototype.parseToXML=function(a){try{var d=null;if(window.DOMParser){var d=(new DOMParser).parseFromString(a,"text/xml"),b=d.getElementsByTagName("parsererror");return!b||!b.length||!b[0].childNodes.length?d:null}d=new ActiveXObject("Microsoft.XMLDOM");d.async=!1;d.loadXML(a);return d}catch(f){}};f.prototype.selectFontSize=function(a){console.log("fontsize: "+a)};f.prototype.importTheme=function(a){console.log("import theme");console.log(a);var d=a.parameters.valueFor("name"),d=this.parseToXML(d),
b=new k;b.name=d.getElementsByTagName("colorTheme")[0].attributes[1].value;b.annotationRuler=d.getElementsByTagName("background")[0].attributes[0].value;b.background=d.getElementsByTagName("background")[0].attributes[0].value;b.comment=d.getElementsByTagName("singleLineComment")[0].attributes[0].value;b.keyword=d.getElementsByTagName("keyword")[0].attributes[0].value;b.text=d.getElementsByTagName("foreground")[0].attributes[0].value;b.string=d.getElementsByTagName("string")[0].attributes[0].value;
b.overviewRuler=d.getElementsByTagName("background")[0].attributes[0].value;b.lineNumberOdd=d.getElementsByTagName("lineNumber")[0].attributes[0].value;b.lineNumberEven=d.getElementsByTagName("lineNumber")[0].attributes[0].value;b.lineNumber=d.getElementsByTagName("lineNumber")[0].attributes[0].value;b.currentLine=d.getElementsByTagName("selectionBackground")[0].attributes[0].value;a.items.addTheme(b)};f.prototype.processSettings=function(a,d){var b=n.TextTheme.getTheme();b.setThemeClass("editorTheme",
b.buildStyleSheet("editorTheme",a))};f.prototype.getViewData=function(){var a={top:10,left:10,width:400,height:350},d=a.left,b=a.top;a.shapes=[{type:"TEXT",name:l["Line Numbers"],label:"1",x:d+20,y:b+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:l.Background,x:d+46,y:b,width:290,height:a.height,family:"background",fill:"white"},{type:"TEXT",name:l.Strings,label:"'text/javascript'",x:d+134,y:b+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",
name:l.Foreground,label:"\x3d",x:d+124,y:b+20,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"RECTANGLE",name:l["Current Line"],x:d+46,y:b+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:l["HTML Attribute"],label:"type",x:d+98,y:b+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:l["Overview Ruler"],x:d+336,y:b,width:14,height:a.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:l.Comments,label:"/* comment */",
x:d+75,y:b+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3cscript",x:d+55,y:b+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3e",x:d+213,y:b+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l.Strings,label:"'Result'",x:d+164,y:b+80,fill:"cornflowerBlue",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:l.Foreground,label:"multiply(a,b){",x:d+120,y:b+
60,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l.Keywords,label:"function",x:d+75,y:b+60,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l.Keywords,label:"var",x:d+95,y:b+80,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l.Foreground,label:"output \x3d ",x:d+115,y:b+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l.Foreground,label:";",x:d+205,y:b+80,fill:"darkSlateGray",family:"text",
font:"9pt sans-serif"},{type:"TEXT",name:l.Keywords,label:"var",x:d+95,y:b+100,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l.Foreground,label:"result \x3d a*b;",x:d+115,y:b+100,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l.Keywords,label:"return",x:d+95,y:b+120,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l.Foreground,label:"output + result;",x:d+135,y:b+120,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},
{type:"TEXT",name:l.Foreground,label:"}",x:d+75,y:b+140,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3c/script\x3e",x:d+55,y:b+160,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3cstyle",x:d+55,y:b+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Attribute"],label:"type",x:d+95,y:b+200,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"TEXT",
name:l.Foreground,label:"\x3d",x:d+121,y:b+200,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l.Strings,label:"'text/css'",x:d+131,y:b+200,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3e",x:d+180,y:b+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Class Name"],label:".some-class",x:d+75,y:b+220,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Class Name"],
label:"{",x:d+145,y:b+220,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Attribute"],label:"color:",x:d+95,y:b+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Value"],label:"#123456",x:d+130,y:b+240,fill:"darkSlateGray",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Text"],label:";",x:d+180,y:b+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l["CSS Class Name"],label:"}",x:d+
75,y:b+260,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:l["HTML Tag"],label:"\x3c/style\x3e",x:d+55,y:b+280,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:l["Annotation Ruler"],x:d,y:b,width:46,height:a.height,family:"annotationRuler",fill:"white"}];for(var f=0;16>f;f++)a.shapes.push({type:"TEXT",name:l["Line Numbers"],label:f+1,x:d+20,y:b+20*f+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return a};return{ThemeData:f,
getStyles:h}});
define("orion/operation",["orion/xhr","orion/Deferred"],function(l,n){function m(f,h,g,d){l("GET",f,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(a){a=a.response?JSON.parse(a.response):null;h.progress(a);!a.type||"loadstart"===a.type||"progress"===a.type?setTimeout(function(){m(f,h,g,d)},2E3):("error"===a.type||"abort"===a.type?h.reject(d?d(a):a.Result):h.resolve(g?g(a):a.Result.JsonData),a.Location||l("DELETE",f,{headers:{"Orion-Version":"1"},timeout:15E3}))},function(a){var d=a;if(void 0!==
a.responseText){d=a.responseText;try{d=JSON.parse(a.responseText)}catch(b){}}void 0!==d.Message?(d.HttpCode=void 0===d.HttpCode?a.status:d.HttpCode,d.Severity=void 0===d.Severity?"Error":d.Severity,h.reject(d)):h.reject({Severity:"Error",Message:d,HttpCode:a.status})})}function k(f,h){h.then(null,function(g){g instanceof Error&&"Cancel"===g.name&&l("PUT",f,{headers:{"Orion-Version":"1"},data:JSON.stringify({abort:!0}),timeout:15E3})})}return{handle:function(f,h,g){var d=new n;k(f,d);m(f,d,h,g);return d}}});
define("orion/git/gitClient",["require","orion/xhr","orion/Deferred","orion/operation"],function(l,n,m,k){var f=f||{};f.GitService=function(){function f(g){g&&(this._serviceRegistry=g,this._serviceRegistration=g.registerService("orion.git.provider",this))}f.prototype={checkGitService:function(){},cloneGitRepository:function(f,d,a,e,b,h,k,t,s,y,r){var x=this,u={};f&&(u.Name=f);a&&(u.Path=a);d&&(u.GitUrl=d);u.Location=e;b&&(u.GitSshUsername=b);h&&(u.GitSshPassword=h);k&&(u.GitSshKnownHost=k);t&&(u.GitSshPrivateKey=
t);s&&(u.GitSshPassphrase=s);y&&(y.GitMail&&(u.GitMail=y.GitMail),y.GitName&&(u.GitName=y.GitName));r&&(u.initProject=r);f=l.toUrl("gitapi/clone/._");f=f.substring(0,f.length-2);var w=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(u)}).then(function(a){x._getGitServiceResponse(w,a)},function(a){x._handleGitServiceResponseError(w,a)});return w},removeGitRepository:function(f){var d=this,a=new m;n("DELETE",
f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},getGitStatus:function(f){var d=this,a=new m;n("GET",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},
stage:function(f){var d=this,a=new m;n("PUT",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},stageMultipleFiles:function(f,d){var a=this,e=new m;n("PUT",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d})}).then(function(b){a._getGitServiceResponse(e,
b)},function(b){a._handleGitServiceResponseError(e,b)});return e},unstageAll:function(f,d){var a=this,e=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Reset:d})}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)});return e},unstage:function(f,d){var a=this,e=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d})}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)});return e},checkoutPath:function(f,d){var a=this,e=new m;n("PUT",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d,RemoveUntracked:"true"})}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)});return e},
commitAll:function(f,d,a){var e=this,b=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:a}).then(function(a){e._getGitServiceResponse(b,a)},function(a){e._handleGitServiceResponseError(b,a)});return b},getGitClone:function(f){var d=this,a=new m;n("GET",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},
function(e){d._handleGitServiceResponseError(a,e)});return a},getGitCloneConfig:function(f){var d=this,a=new m;n("GET",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},getGitBranch:function(f){var d=this,a=new m;n("GET",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,
e)},function(e){d._handleGitServiceResponseError(a,e)});return a},getGitRemote:function(f){var d=this,a=new m;n("GET",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},checkoutBranch:function(f,d){var a=this,e=new m;n("PUT",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",
data:JSON.stringify({Branch:d})}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)});return e},resetIndex:function(f,d,a){var e=this,b=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Commit:d,Reset:a?a:"HARD"})}).then(function(a){e._getGitServiceResponse(b,a)},function(a){e._handleGitServiceResponseError(b,a)});return b},addBranch:function(f,d,a){var e=
this,b={};d&&(b.Name=d);a&&(b.Branch=a);var h=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(b)}).then(function(a){e._getGitServiceResponse(h,a)},function(a){e._handleGitServiceResponseError(h,a)});return h},removeBranch:function(f){var d=this,a=new m;n("DELETE",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,
e)},function(e){d._handleGitServiceResponseError(a,e)});return a},addRemote:function(f,d,a){var e=this,b=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Remote:d,RemoteURI:a})}).then(function(a){e._getGitServiceResponse(b,a)},function(a){e._handleGitServiceResponseError(b,a)});return b},removeRemote:function(f){var d=this,a=new m;n("DELETE",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},doGitLog:function(f){var d=this,a=new m;n("GET",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},getDiff:function(f,d){var a=this,e=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({New:d})}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)});return e},doFetch:function(f,d,a,e,b,h,k){var l=this,s=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Fetch:"true",Force:d,GitSshUsername:a,GitSshPassword:e,GitSshKnownHost:b,GitSshPrivateKey:h,GitSshPassphrase:k})}).then(function(a){l._getGitServiceResponse(s,
a)},function(a){l._handleGitServiceResponseError(s,a)});return s},doPull:function(f,d,a,e,b,h,k){var l=this,s=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Pull:"true",Force:d,GitSshUsername:a,GitSshPassword:e,GitSshKnownHost:b,GitSshPrivateKey:h,GitSshPassphrase:k})}).then(function(a){l._getGitServiceResponse(s,a)},function(a){l._handleGitServiceResponseError(s,a)});return s},doMerge:function(f,
d,a){var e=this,b=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Merge:d,Squash:a})}).then(function(a){e._getGitServiceResponse(b,a)},function(a){e._handleGitServiceResponseError(b,a)});return b},doCherryPick:function(f,d){var a=this,e=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({"Cherry-Pick":d})}).then(function(b){a._getGitServiceResponse(e,
b)},function(b){a._handleGitServiceResponseError(e,b)});return e},doRevert:function(f,d){var a=this,e=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Revert:d})}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)});return e},doRebase:function(f,d,a){var e=this,b={};b.Rebase=d;a&&(b.Operation=a);var h=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify(b)}).then(function(a){e._getGitServiceResponse(h,a)},function(a){e._handleGitServiceResponseError(h,a)});return h},doPush:function(f,d,a,e,b,h,k,l,s){var y=this,r=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({PushSrcRef:d,PushTags:a,Force:e,GitSshUsername:b,GitSshPassword:h,GitSshKnownHost:k,GitSshPrivateKey:l,GitSshPassphrase:s})}).then(function(a){y._getGitServiceResponse(r,
a)},function(a){y._handleGitServiceResponseError(r,a)});return r},getLog:function(f,d){var a=this,e=new m,b=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:d})}).then(function(a){b.resolve(a.xhr.getResponseHeader("Location"))},function(b){a._handleGitServiceResponseError(e,b)});b.then(function(b){n("GET",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,
handleAs:"json"}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)})});return e},getDefaultRemoteBranch:function(f){var d=this,a=new m,e=new m;n("GET",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(e,a)},function(b){d._handleGitServiceResponseError(a,b)});e.then(function(b){n("GET",b.Children[0].Location,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json"}).then(function(b){d._getGitServiceResponse(a,b)},function(b){d._handleGitServiceResponseError(a,b)})});return a},doAddTag:function(f,d){var a=this,e=new m;n("PUT",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Name:d})}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)});return e},doRemoveTag:function(f){var d=this,a=new m;n("DELETE",
f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},checkoutTag:function(f,d,a){var e=this,b=new m;n("PUT",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Tag:d,Branch:a})}).then(function(a){e._getGitServiceResponse(b,a)},function(a){e._handleGitServiceResponseError(b,
a)});return b},addCloneConfigurationProperty:function(f,d,a){var e=this,b=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Key:d,Value:a})}).then(function(a){e._getGitServiceResponse(b,a)},function(a){e._handleGitServiceResponseError(b,a)});return b},editCloneConfigurationProperty:function(f,d){var a=this,e=new m;n("PUT",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({Value:d})}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)});return e},deleteCloneConfigurationProperty:function(f){var d=this,a=new m;n("DELETE",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},sendCommitReviewRequest:function(f,
d,a,e,b,h){var k=this,l=new m;n("POST",d,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({ReviewReqCommit:f,ReviewReqUrl:e,ReviewReqNotifyLogin:a,ReviewReqAuthorName:b,ReviewMessage:h})}).then(function(a){k._getGitServiceResponse(l,a)},function(a){k._handleGitServiceResponseError(l,a)});return l},_getGitServiceResponse:function(f,d){var a=d.response?JSON.parse(d.response):null;if(d.xhr&&202===d.xhr.status){var e=k.handle(a.Location);
e.then(f.resolve,function(b){b.failedOperation=a.Location;f.reject(b)},f.progress);f.then(null,function(a){e.reject(a)})}else f.resolve(a)},_handleGitServiceResponseError:function(f,d){f.reject(d)}};return f}();return f});
define("orion/links",[],function(){function l(l){this._init(l)}l.prototype={_init:function(l){this._registry=l.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.textlink",this)},_replaceLink:function(l,m,k,f,h){var g=l.search(k);0<g&&(m.appendChild(document.createTextNode(l.substring(0,g))),l=l.substring(g));k=l.replace(k,"");var g=l.substring(0,l.length-k.length),d=g.split(" ",f);if(d.length===f){l=document.createElement("a");for(var a=0;a<f;a++)h=h.replace("%"+
(a+1),d[a]);l.setAttribute("href",h);l.textContent=g;m.appendChild(l);l=k}return l},addLinks:function(l,m){var k=m||document.createElement("div"),f=this._registry.getServiceReferences("orion.core.linkScanner");if(0<f.length)for(var h=f[0],f=RegExp(h.getProperty("pattern"),"i"),g=h.getProperty("words"),h=h.getProperty("anchor"),d=l.search(f);0<=d;)l=this._replaceLink(l,k,f,g,h),d=l.search(f);0<l.length&&k.appendChild(document.createTextNode(l));return k}};l.prototype.constructor=l;return{TextLinkService:l}});
var eclipse;
define("git/git-commit","i18n!git/nls/gitmessages require orion/bootstrap orion/status orion/progress orion/commandRegistry orion/commands orion/keyBinding orion/dialogs orion/selection orion/fileClient orion/operationsClient orion/searchClient orion/globalCommands orion/git/gitCommitExplorer orion/git/gitCommands orion/widgets/themes/ThemePreferences orion/widgets/themes/editor/ThemeData orion/git/gitClient orion/links orion/contentTypes orion/URITemplate orion/PageUtil".split(" "),function(l,n,
m,k,f,h,g,d,a,e,b,p,q,t,s,y,r,x,u,w,z,B,v){m.startup().then(function(m){var D=m.serviceRegistry;m=m.preferences;new a.DialogService(D);var C=new e.Selection(D),C=new h.CommandRegistry({selection:C}),E=new p.OperationsClient(D),K=new k.StatusReportingService(D,E,"statusPane","notifications","notificationArea"),E=new f.ProgressService(D,E,C);(new r.ThemePreferences(m,new x.ThemeData)).apply();var L=new w.TextLinkService({serviceRegistry:D}),F=new u.GitService(D),G=new b.FileClient(D);new z.ContentTypeRegistry(D);
var H=new q.Searcher({serviceRegistry:D,commandService:C,fileService:G}),I=new s.GitCommitExplorer({registry:D,commandService:C,fileClient:G,gitClient:F,statusService:K,progressService:E,preferencesService:m,linkService:L,selection:null,parentId:"artifacts",toolbarId:"pageActions",selectionToolsId:null,actionScopeId:"itemLevelCommands"});t.generateBanner("orion-git-commit",D,C,m,H,I);y.createFileCommands(D,C,I,"pageActions","selectionTools");y.createGitClonesCommands(D,C,I,"pageActions","selectionTools",
G);C.addCommandGroup("pageActions","eclipse.gitGroup",100);C.registerCommandContribution("pageActions","eclipse.orion.git.cherryPick",100,"eclipse.gitGroup");C.registerCommandContribution("pageActions","eclipse.orion.git.revert",101,"eclipse.gitGroup");C.registerCommandContribution("pageActions","eclipse.orion.git.askForReviewCommand",102,"eclipse.gitGroup");C.registerCommandContribution("pageActions","eclipse.orion.git.openCommitCommand",102,"eclipse.gitGroup",!0,new d.KeyBinding("h",!0,!0));C.registerCommandContribution("itemLevelCommands",
"eclipse.removeTag",1E3);var P=new B("edit/edit.html#{,resource,params*}"),D=new g.Command({name:l["Working Directory Version"],tooltip:l["View the working directory version of the file"],id:"eclipse.orion.git.diff.showCurrent",hrefCallback:function(a){return n.toUrl(P.expand({resource:a.items.ContentLocation}))},visibleWhen:function(a){return"Diff"===a.Type}});C.addCommand(D);C.registerCommandContribution("itemLevelCommands","eclipse.orion.git.diff.showCurrent",2E3);D=v.matchResourceParameters();
I.display(D.resource);window.addEventListener("hashchange",function(){var a=v.matchResourceParameters();I.display(a.resource)},!1)})});
//@ sourceMappingURL=git-commit.js.map